Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update dev with main changes #184

Open
wants to merge 14 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"ts-node/register/transpile-only",
"--preserve-symlinks"
],
"args":["./src/cognigy.ts","clone","--config", "./config.json", "--forceYes"],
"args":["./src/cognigy.ts","push", "aiAgent", "Neon", "--config", "./config.json", "--forceYes"],
"console": "integratedTerminal"
}
]
Expand Down
28 changes: 28 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,31 @@
# [1.6.0](https://github.com/Cognigy/Cognigy-CLI/compare/v1.5.5...v1.6.0) (2024-12-28)


### Features

* **cli:** added aiAgents ([501a321](https://github.com/Cognigy/Cognigy-CLI/commit/501a3216e18c8ed1ba05fc73c8107e3729678ead))

## [1.5.5](https://github.com/Cognigy/Cognigy-CLI/compare/v1.5.4...v1.5.5) (2024-12-16)


### Bug Fixes

* package.json & package-lock.json to reduce vulnerabilities ([1d9d088](https://github.com/Cognigy/Cognigy-CLI/commit/1d9d088cae0dfc89b0f84f41115d4f682426d4a8))

## [1.5.4](https://github.com/Cognigy/Cognigy-CLI/compare/v1.5.3...v1.5.4) (2024-12-16)


### Bug Fixes

* package.json & package-lock.json to reduce vulnerabilities ([5527c30](https://github.com/Cognigy/Cognigy-CLI/commit/5527c301c0e79781312df21b94d1cfb2804c43e7))

## [1.5.3](https://github.com/Cognigy/Cognigy-CLI/compare/v1.5.2...v1.5.3) (2024-11-15)


### Bug Fixes

* **packages:** fix vulnerabilities in packages.json ([#186](https://github.com/Cognigy/Cognigy-CLI/issues/186)) ([fdf8d33](https://github.com/Cognigy/Cognigy-CLI/commit/fdf8d3344856e38e1419b7345bdac208dd806e3e))

## [1.5.2](https://github.com/Cognigy/Cognigy-CLI/compare/v1.5.1...v1.5.2) (2024-09-23)


Expand Down
10 changes: 9 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ Currently supported resources (`<resourceType>`):
- Endpoints (clone, restore, push, pull, diff)
- Snapshots (create)
- Extensions (pull)
- AI Agents (clone, push, pull)

For Endpoints, Transformers will be separately stores as TypeScript files

Expand Down Expand Up @@ -101,6 +102,13 @@ Clones a Virtual Agent from Cognigy.AI to disk
| ------ | ----- | ------ | ------- | --------------------------------------------------------------------- |
| <nobr>--type</nobr> | -t | String | `agent` | Which type of resource to clone (`agent` stands for the full project) |

Supported resource types for clone:
- agent (default, clones everything including AI Agents)
- flows
- endpoints
- lexicons
- aiAgents

### Command: restore

`cognigy restore`
Expand Down Expand Up @@ -289,7 +297,6 @@ Commit using the commitizen hook with semantic naming convetion promt
```bash
npx cz
```

### Pull Requests

Create PR with any kind of feature/bugfix folloving the [semantic message format](https://github.com/semantic-release/semantic-release#commit-message-format) to the develop branch.
Expand All @@ -301,3 +308,4 @@ Any PRs to develop needs to be merged as squash merges.
Create a PR from develop to main and do a merge commit. This will automatically trigger a new release.
To make the release publish a new minor version to the npm registry, the commit message needs to follow the [semantic message format] and having at least one of the commits to main from the last release with a fix.


64 changes: 34 additions & 30 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@cognigy/cognigy-cli",
"version": "0.0.0-semantic-release",
"version": "1.6.0",
"description": "Cognigy Command Line Interface",
"main": "./build/cognigy.js",
"scripts": {
Expand Down Expand Up @@ -44,10 +44,10 @@
},
"dependencies": {
"-": "0.0.1",
"@cognigy/rest-api-client": "0.19.0",
"@cognigy/rest-api-client": "^0.20.0",
"@google-cloud/translate": "8.0.2",
"@istanbuljs/nyc-config-typescript": "1.0.2",
"axios": "1.7.7",
"axios": "1.7.8",
"chalk": "4.1.2",
"cheerio": "1.0.0-rc.12",
"cli-progress": "3.12.0",
Expand All @@ -58,7 +58,7 @@
"d3-dsv": "2.0.0",
"diff": "5.0.0",
"epub2": "3.0.2",
"express": "4.21.1",
"express": "4.21.2",
"form-data": "3.0.0",
"gpt-3-encoder": "1.1.4",
"html-to-text": "9.0.5",
Expand Down
7 changes: 7 additions & 0 deletions src/commands/clone.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import { upperFirst } from '../utils/stringUtils';
import { cloneEndpoints } from '../lib/endpoints';
import { cloneFlows } from '../lib/flows';
import { cloneLexicons } from '../lib/lexicons';
import { cloneAiAgents } from '../lib/aiagents';

/**
* Clones a full Virtual Agent project to disk
Expand Down Expand Up @@ -43,6 +44,7 @@ export const clone = async ({ resourceType = 'agent', forceYes = false }): Promi
await cloneFlows(33);
await cloneEndpoints(33);
await cloneLexicons(33);
await cloneAiAgents();
break;

case "flows":
Expand All @@ -59,6 +61,11 @@ export const clone = async ({ resourceType = 'agent', forceYes = false }): Promi
case "lexicon":
await cloneLexicons(100);
break;

case "aiAgents":
case "aiAgent":
await cloneAiAgents();
break;
}

endProgressBar();
Expand Down
8 changes: 6 additions & 2 deletions src/commands/diff.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { checkAgentDir, checkProject } from '../utils/checks';
import { diffFlows } from '../lib/flows';
import { diffEndpoints } from '../lib/endpoints';
import { diffLexicons } from '../lib/lexicons';
import { diffAiAgents } from '../lib/aiagents';

/**
* Provides a diff between a resource on disk and remote
Expand Down Expand Up @@ -29,8 +30,11 @@ export const diff = async (resourceType: string, resourceId: string, mode: strin
await diffLexicons(resourceId, mode);
break;

case "aiAgent":
await diffAiAgents(resourceId, mode);
break;

default:
console.log(`\n\nInvalid diff resource type ${resourceType}.`);
return;
console.log(`Resource type ${resourceType} can't be compared.`);
}
};
6 changes: 6 additions & 0 deletions src/commands/pull.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import { upperFirst } from '../utils/stringUtils';
import { pullLexicon } from '../lib/lexicons';
import { pullLocales } from '../lib/locales';
import { pullExtensions } from '../lib/extensions';
import { pullAiAgent } from '../lib/aiagents';

/**
* Pushes a single resource from disk to Cognigy.AI
Expand Down Expand Up @@ -59,6 +60,11 @@ export const pull = async ({ resourceType, resourceName, forceYes = false }): Pr
case "extensions":
await pullExtensions();
break;

case 'aiAgent':
await pullAiAgent(resourceName);
break;

default:
throw(new Error(`Resource type ${resourceType} can't be pulled.`));
}
Expand Down
7 changes: 7 additions & 0 deletions src/commands/push.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { pushEndpoint } from '../lib/endpoints';
import { checkAgentDir, checkResourceDir, checkProject } from '../utils/checks';
import { upperFirst } from '../utils/stringUtils';
import { pushLexicon } from '../lib/lexicons';
import { pushAiAgent } from '../lib/aiagents';

/**
* Pushes a single resource from disk to Cognigy.AI
Expand Down Expand Up @@ -55,6 +56,12 @@ export const push = async ({ resourceType, resourceName, options }): Promise<voi
await pushLexicon(resourceName, 100, options.timeout);
break;

case 'aiAgent':
startProgressBar(100);
await pushAiAgent(resourceName, 100);
endProgressBar();
break;

default:
console.log(`Resource type ${resourceType} can't be pushed.`);
}
Expand Down
13 changes: 10 additions & 3 deletions src/commands/restore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import { upperFirst } from '../utils/stringUtils';
import { restoreFlows } from '../lib/flows';
import { restoreEndpoints } from '../lib/endpoints';
import { restoreLexicons } from '../lib/lexicons';
import { restoreAiAgents } from '../lib/aiagents';

/**
* Restores a Virtual Agent project from disk to Cognigy.AI
Expand Down Expand Up @@ -40,9 +41,10 @@ export const restore = async ({ resourceType = 'agent', forceYes = false }): Pro
switch (resourceType) {
case "agent":
await Promise.all([
restoreFlows(33),
restoreEndpoints(33),
restoreLexicons(33)
restoreFlows(25),
restoreEndpoints(25),
restoreLexicons(25),
restoreAiAgents(25)
]);
break;

Expand All @@ -60,6 +62,11 @@ export const restore = async ({ resourceType = 'agent', forceYes = false }): Pro
case "lexicon":
await restoreLexicons(100);
break;

case "aiAgents":
case "aiAgent":
await restoreAiAgents(100);
break;
}

endProgressBar();
Expand Down
Loading
Loading