# cognigy-extension-manager

> Cognigy Extension Manager

Latest version **0.4.2** (published 2023-04-25) · ISC license · 0 weekly downloads

## Install

```sh
npm install cognigy-extension-manager
pnpm add cognigy-extension-manager
yarn add cognigy-extension-manager
bun add cognigy-extension-manager
```

Provides the command `cu.upload-handler`.

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.4.2 |
| Published | 2023-04-25 |
| First published | 2023-03-22 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 9 |
| Unpacked size | 41.8 KB |
| Known vulnerabilities | 0 (+23 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Alex Barbu |
| Maintainers | barbualex.tgv |

## Links

- npm: https://www.npmjs.com/package/cognigy-extension-manager
- Repository: https://github.com/ali3nnn/cognigy-extension-manager
- Homepage: https://github.com/ali3nnn/cognigy-extension-manager#readme
- Issues: https://github.com/ali3nnn/cognigy-extension-manager/issues
- npm.io page: https://npm.io/package/cognigy-extension-manager

## Dependencies (9)

- [axios](https://npm.io/package/axios.md) ~0.27.2
- [dotenv](https://npm.io/package/dotenv.md) ^16.0.1
- [moment](https://npm.io/package/moment.md) ^2.29.4
- [ts-node](https://npm.io/package/ts-node.md) ^10.9.1
- [readline](https://npm.io/package/readline.md) ^1.3.0
- [form-data](https://npm.io/package/form-data.md) ^4.0.0
- [args-parser](https://npm.io/package/args-parser.md) ^1.3.0
- [@types/axios](https://npm.io/package/@types/axios.md) ^0.14.0
- [untar-to-memory](https://npm.io/package/untar-to-memory.md) ^1.0.4

## Recent versions

- 0.4.2 (latest) — 2023-04-25
- 0.4.1 — 2023-04-25
- 0.4.0 — 2023-04-25
- 0.3.6 — 2023-04-25
- 0.3.4 — 2023-04-25
- 0.3.3 — 2023-04-25
- 0.3.2 — 2023-04-25
- 0.3.1 — 2023-04-25
- 0.3.0 — 2023-04-25
- 0.2.3 — 2023-03-30
- 0.2.1 — 2023-03-27
- 0.2.0 — 2023-03-27
- 0.1.14 — 2023-03-24
- 0.1.13 — 2023-03-24
- 0.1.12 — 2023-03-22
- … 11 more at https://npm.io/package/cognigy-extension-manager/versions

## README

# cognigy-extension-manager

The script is used to upload the extensions to Cognigy by running a simple command from within the pipeline or manually.

To use this script in a repo follow the steps:

1. Install the package inside the extension repo:
```bash
npm i cognigy-extension-manager@latest --save-dev
```

2. Add execution permission for the script
```bash
chmod +x node_modules/.bin/cu.upload-handler
```

3. Run the script
```bash
npm exec cu.upload-handler config.json PROJECT_1
```

```bash
npm exec cu.upload-handler config.json all
```

```config.json``` - is a json file with an object containing ```C_API_KEY``` and ```PROJECT_ID``` for multiple projects as in the following example:

```json
{
    "PROJECT_1": {
        "C_API_KEY": "api_key",
        "PROJECT_ID": "project_id"
    },
    "PROJECT_2": {
        "C_API_KEY": "api_key_2",
        "PROJECT_ID": "project_id_1"
    }
}
```

```PROJECT_1``` - is the name of project you want to deploy to. It can also have the value ```all```, in which case all projects will be updated.

If ```C_API_KEY``` is missing from ```config.json```, then the script will check if there is an environment variable with the following name: ```PROJECT_1_API_KEY```. If there is no api key, the upload process will not start.

By adding the flag ```--dev``` at the end of the CLI command will set the axios agent not to reject unauthorized certificates. In production it shouldn't use this flag.

example: ```npm exec cu.add-extension config.json PROJECT_1 --dev```


---

If you'd like to contribute to improve the extension, you can raise a pull reuqest here https://github.com/ali3nnn/cognigy-extension-manager

Further improvements: take the extension name from package.json

---
_Source: https://npm.io/package/cognigy-extension-manager · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
