@contrail/cli 2.1.26 → 2.1.27

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -17,7 +17,7 @@ $ npm install -g @contrail/cli
17
17
  $ contrail COMMAND
18
18
  running command...
19
19
  $ contrail (--version)
20
- @contrail/cli/2.1.26 darwin-arm64 node-v18.13.0
20
+ @contrail/cli/2.1.27 darwin-arm64 node-v18.13.0
21
21
  $ contrail --help [COMMAND]
22
22
  USAGE
23
23
  $ contrail COMMAND
@@ -22,14 +22,23 @@ async function getLocalColors() {
22
22
  exports.getLocalColors = getLocalColors;
23
23
  async function getExistingColors() {
24
24
  logger_1.default.info('%s Getting Existing Colors', chalk_1.default.yellow.bold('COLORS'));
25
+ const colors = [];
25
26
  try {
26
- const result = await new sdk_1.Entities().get({ entityName: 'color', take: 3000 }); //, useSearch: false }); Not in EntitiesClientGetOptions yet
27
- logger_1.default.info('Found %s existing colors', result.length);
28
- return result;
27
+ let nextPageKey = null;
28
+ do {
29
+ const result = await new sdk_1.Entities().get({
30
+ entityName: 'color',
31
+ nextPageKey,
32
+ apiVersion: sdk_1.API_VERSION.V2,
33
+ });
34
+ colors.push(...result.results);
35
+ nextPageKey = result.nextPageKey;
36
+ } while (nextPageKey);
29
37
  }
30
38
  catch (e) {
31
39
  throw new Error(`ERROR DOWNLOADING COLORS: ${e}`);
32
40
  }
41
+ return colors;
33
42
  }
34
43
  exports.getExistingColors = getExistingColors;
35
44
  async function deleteColor(color) {
@@ -8,5 +8,6 @@ export declare class WorkflowTemplateDefinitionDeployer {
8
8
  private createNewWorkflowDefinition;
9
9
  private populateActionIds;
10
10
  private updateWorkflowTemplateDefinition;
11
- getWorkflowDeclarationIdentifier(actionKey: any, app: App): string;
11
+ getActionDeclarationIdentifier(actionKey: any, app: App): string;
12
+ getWorkflowDeclarationIdentifier(workflowKey: any, app: App): string;
12
13
  }
@@ -147,6 +147,10 @@ class WorkflowTemplateDefinitionDeployer {
147
147
  throw new Error(`Could not find action ${actionKey} declared in workflow definition ${workflowDefinition.name}`);
148
148
  }
149
149
  actionConfiguration.id = action.id;
150
+ actionConfiguration.identifier = (0, actions_deployer_1.getActionDeclarationIdentifier)(actionKey, app);
151
+ if (!actionConfiguration.identifier) {
152
+ throw new Error(`Could not create action identifier for action ${actionKey} workflow definition ${workflowDefinition.name}`);
153
+ }
150
154
  }
151
155
  }
152
156
  }
@@ -168,8 +172,11 @@ class WorkflowTemplateDefinitionDeployer {
168
172
  logger_1.default.info(`%s Updated existing workflow definition: ${updatedWorkflowDefinition.identifier}`, chalk_1.default.yellow.bold('WORKFLOW DEFINITION'));
169
173
  return updatedWorkflowDefinition;
170
174
  }
171
- getWorkflowDeclarationIdentifier(actionKey, app) {
175
+ getActionDeclarationIdentifier(actionKey, app) {
172
176
  return `${app.identifier}@${app.latestAppVersionId}:${actionKey}`;
173
177
  }
178
+ getWorkflowDeclarationIdentifier(workflowKey, app) {
179
+ return `${app.identifier}@${app.latestAppVersionId}:${workflowKey}`;
180
+ }
174
181
  }
175
182
  exports.WorkflowTemplateDefinitionDeployer = WorkflowTemplateDefinitionDeployer;
@@ -114,6 +114,7 @@ export interface ActionDefinitionConfig {
114
114
  [key: string]: any;
115
115
  };
116
116
  id?: string;
117
+ identifier?: string;
117
118
  }
118
119
  export interface App {
119
120
  id: string;
@@ -0,0 +1,47 @@
1
+ {
2
+ "env": {
3
+ "browser": true,
4
+ "es2021": true,
5
+ "node": true
6
+ },
7
+ "extends": [
8
+ "eslint:recommended",
9
+ "plugin:@typescript-eslint/eslint-recommended",
10
+ "plugin:@typescript-eslint/recommended"
11
+ ],
12
+ "ignorePatterns": ["node_modules/", "dist/"],
13
+ "parser": "@typescript-eslint/parser",
14
+ "parserOptions": {
15
+ "ecmaVersion": "latest",
16
+ "sourceType": "module"
17
+ },
18
+ "plugins": ["@typescript-eslint", "unused-imports"],
19
+ "rules": {
20
+ "indent": ["error", 2],
21
+ "linebreak-style": ["error", "unix"],
22
+ "quote-props": ["error", "as-needed"],
23
+ "quotes": ["error", "single"],
24
+ "semi": ["error", "always"],
25
+ "no-multiple-empty-lines": ["error", { "max": 1, "maxEOF": 0 }],
26
+ "no-trailing-spaces": "error",
27
+ "no-mixed-spaces-and-tabs": ["error", "smart-tabs"],
28
+ "@typescript-eslint/no-empty-function": [
29
+ "error",
30
+ { "allow": ["arrowFunctions"] }
31
+ ],
32
+ "@typescript-eslint/no-explicit-any": "off",
33
+ "@typescript-eslint/no-var-requires": "warn",
34
+ "no-unused-vars": "off",
35
+ "@typescript-eslint/no-unused-vars": "off",
36
+ "unused-imports/no-unused-imports": "error",
37
+ "unused-imports/no-unused-vars": [
38
+ "warn",
39
+ {
40
+ "vars": "all",
41
+ "varsIgnorePattern": "^_",
42
+ "args": "after-used",
43
+ "argsIgnorePattern": "^_"
44
+ }
45
+ ]
46
+ }
47
+ }
@@ -36,6 +36,9 @@
36
36
  "nodemon": "^1.19.4",
37
37
  "ts-jest": "^29.0.3",
38
38
  "ts-node": "^7.0.1",
39
+ "@typescript-eslint/eslint-plugin": "^6.10.0",
40
+ "eslint": "^8.53.0",
41
+ "eslint-plugin-unused-imports": "^3.0.0",
39
42
  "typescript": "^4.7.4"
40
43
  }
41
44
  }
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "2.1.26",
2
+ "version": "2.1.27",
3
3
  "commands": {
4
4
  "app:create": {
5
5
  "id": "app:create",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@contrail/cli",
3
- "version": "2.1.26",
3
+ "version": "2.1.27",
4
4
  "description": "VibeIQ's Contrail Platform CLI.",
5
5
  "bin": {
6
6
  "contrail-cli": "./bin/run",
@@ -23,7 +23,7 @@
23
23
  ],
24
24
  "dependencies": {
25
25
  "@contrail/entity-types": "^1.1.17",
26
- "@contrail/sdk": "^1.2.3",
26
+ "@contrail/sdk": "^1.2.17",
27
27
  "@contrail/types": "^3.0.20",
28
28
  "@contrail/util": "^1.0.41",
29
29
  "@oclif/core": "^2",