@contrail/cli 2.1.26 → 2.1.28

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.28 darwin-arm64 node-v18.13.0
21
21
  $ contrail --help [COMMAND]
22
22
  USAGE
23
23
  $ contrail COMMAND
@@ -517,7 +517,7 @@ DESCRIPTION
517
517
  Display help for contrail.
518
518
  ```
519
519
 
520
- _See code: [@oclif/plugin-help](https://github.com/oclif/plugin-help/blob/v5.2.6/src/commands/help.ts)_
520
+ _See code: [@oclif/plugin-help](https://github.com/oclif/plugin-help/blob/v5.2.20/src/commands/help.ts)_
521
521
 
522
522
  ## `contrail instance export`
523
523
 
@@ -696,6 +696,8 @@ EXAMPLES
696
696
  $ contrail plugins:inspect myplugin
697
697
  ```
698
698
 
699
+ _See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v2.3.2/src/commands/plugins/inspect.ts)_
700
+
699
701
  ## `contrail plugins:install PLUGIN...`
700
702
 
701
703
  Installs a plugin into the CLI.
@@ -734,6 +736,8 @@ EXAMPLES
734
736
  $ contrail plugins:install someuser/someplugin
735
737
  ```
736
738
 
739
+ _See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v2.3.2/src/commands/plugins/install.ts)_
740
+
737
741
  ## `contrail plugins:link PLUGIN`
738
742
 
739
743
  Links a plugin into the CLI for development.
@@ -761,6 +765,8 @@ EXAMPLES
761
765
  $ contrail plugins:link myplugin
762
766
  ```
763
767
 
768
+ _See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v2.3.2/src/commands/plugins/link.ts)_
769
+
764
770
  ## `contrail plugins:uninstall PLUGIN...`
765
771
 
766
772
  Removes a plugin from the CLI.
@@ -807,6 +813,8 @@ ALIASES
807
813
  $ contrail plugins remove
808
814
  ```
809
815
 
816
+ _See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v2.3.2/src/commands/plugins/uninstall.ts)_
817
+
810
818
  ## `contrail plugins:uninstall PLUGIN...`
811
819
 
812
820
  Removes a plugin from the CLI.
@@ -846,6 +854,8 @@ DESCRIPTION
846
854
  Update installed plugins.
847
855
  ```
848
856
 
857
+ _See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v2.3.2/src/commands/plugins/update.ts)_
858
+
849
859
  ## `contrail projects export PROJECTNAME`
850
860
 
851
861
  Export a project.
@@ -0,0 +1,7 @@
1
+ export declare function getExistingSchedules(): Promise<any[]>;
2
+ export declare function createSchedule(object: any): Promise<any>;
3
+ export declare function deleteSchedule(id: string): Promise<void>;
4
+ export declare function updateSchedule(options: {
5
+ id: string;
6
+ updates: any;
7
+ }): Promise<any>;
@@ -0,0 +1,32 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.updateSchedule = exports.deleteSchedule = exports.createSchedule = exports.getExistingSchedules = void 0;
4
+ const sdk_1 = require("@contrail/sdk");
5
+ async function getExistingSchedules() {
6
+ return await new sdk_1.Entities().get({
7
+ entityName: 'scheduler',
8
+ });
9
+ }
10
+ exports.getExistingSchedules = getExistingSchedules;
11
+ async function createSchedule(object) {
12
+ return await new sdk_1.Entities().create({
13
+ entityName: 'scheduler',
14
+ object,
15
+ });
16
+ }
17
+ exports.createSchedule = createSchedule;
18
+ async function deleteSchedule(id) {
19
+ return await new sdk_1.Entities().delete({
20
+ entityName: 'scheduler',
21
+ id,
22
+ });
23
+ }
24
+ exports.deleteSchedule = deleteSchedule;
25
+ async function updateSchedule(options) {
26
+ return await new sdk_1.Entities().update({
27
+ entityName: 'scheduler',
28
+ id: options.id,
29
+ object: options.updates,
30
+ });
31
+ }
32
+ exports.updateSchedule = updateSchedule;
@@ -2,13 +2,13 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const tslib_1 = require("tslib");
4
4
  const sdk_1 = require("@contrail/sdk");
5
+ const types_1 = require("@contrail/types");
6
+ const core_1 = require("@oclif/core");
5
7
  const chalk_1 = tslib_1.__importDefault(require("chalk"));
6
8
  const login_1 = require("../../auth/login");
7
- const helpers_1 = require("../../helpers/projects/helpers");
8
- const core_1 = require("@oclif/core");
9
9
  const basecommand_1 = require("../../basecommand");
10
+ const helpers_1 = require("../../helpers/projects/helpers");
10
11
  const logger_1 = tslib_1.__importDefault(require("../../logger"));
11
- const types_1 = require("@contrail/types");
12
12
  class LoadProject extends basecommand_1.BaseCommand {
13
13
  async run() {
14
14
  const { args } = await this.parse(LoadProject);
@@ -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;
@@ -1,13 +1,15 @@
1
1
  import { EventWorkflowActionDefinition, WorkflowTemplate, WorkflowTemplateDeclaration } from '../../interfaces';
2
2
  export declare class LocalWorkflowTemplateDeployer {
3
3
  deployWorkflows(wtDeclaration: WorkflowTemplateDeclaration): Promise<void>;
4
- deployWorkflowTemplate(workflow: WorkflowTemplate, existingWorkflows: WorkflowTemplate[]): Promise<WorkflowTemplate>;
4
+ deployWorkflowTemplate(workflow: WorkflowTemplate, existingWorkflows: WorkflowTemplate[], appIdentifier: string): Promise<WorkflowTemplate>;
5
5
  private createNewWorkflowTemplate;
6
6
  private populateActionIds;
7
+ createWorkflowSchedule(workflowTemplate: WorkflowTemplate, workflowId: string): Promise<any>;
8
+ updateWorkflowSchedule(workflowTemplate: WorkflowTemplate, workflowId: string): Promise<any>;
7
9
  private updateWorkflowTemplate;
8
10
  deleteWorkflowTemplates(wtDeclaration: WorkflowTemplateDeclaration): Promise<void>;
9
11
  }
10
- export declare function getWorkflowTemplateIdentifier(workflowKey: string): string;
12
+ export declare function getWorkflowTemplateIdentifier(workflowTemplate: WorkflowTemplate): string;
11
13
  export declare function getActionByIdentifier(identifier: string): Promise<EventWorkflowActionDefinition>;
12
14
  export declare class WorkflowTemplateDeployer {
13
15
  deleteWorkflowTemplates(): Promise<void>;
@@ -2,40 +2,44 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.populateActionIdentifiers = exports.localDeployWorkflowTemplate = exports.deleteWorkflowTemplates = exports.WorkflowTemplateDeployer = exports.getActionByIdentifier = exports.getWorkflowTemplateIdentifier = exports.LocalWorkflowTemplateDeployer = void 0;
4
4
  const tslib_1 = require("tslib");
5
- const path = tslib_1.__importStar(require("path"));
5
+ const util_1 = require("@contrail/util");
6
6
  const chalk_1 = tslib_1.__importDefault(require("chalk"));
7
7
  const fs_1 = tslib_1.__importDefault(require("fs"));
8
8
  const inquirer_1 = tslib_1.__importDefault(require("inquirer"));
9
+ const js_yaml_1 = tslib_1.__importDefault(require("js-yaml"));
10
+ const path = tslib_1.__importStar(require("path"));
11
+ const apps_1 = require("../../api/apps");
9
12
  const event_workflow_action_definition_1 = require("../../api/event-workflow-action-definition");
10
13
  const event_workflow_templates_1 = require("../../api/event-workflow-templates");
14
+ const schedules_1 = require("../../api/schedules");
11
15
  const login_1 = require("../../auth/login");
12
16
  const interface_converters_1 = require("../../interface-converters");
13
17
  const logger_1 = tslib_1.__importDefault(require("../../logger"));
14
- const js_yaml_1 = tslib_1.__importDefault(require("js-yaml"));
15
18
  class LocalWorkflowTemplateDeployer {
16
19
  async deployWorkflows(wtDeclaration) {
17
20
  // FETCH ALL WORKFLOWS FROM THE API.
18
21
  const existingWorkflows = await (0, event_workflow_templates_1.getExistingWorkflowTemplates)();
19
22
  // UPSERT / DELETE BASED ON WORKFLOW TEMPLATES IDENTIFIER
20
23
  logger_1.default.info('%s \tDeploying workflow templates.', chalk_1.default.yellow.bold('WORKFLOW TEMPLATES'));
21
- for (const workflow of wtDeclaration.workflows) {
22
- await this.deployWorkflowTemplate(workflow, existingWorkflows);
24
+ logger_1.default.info(wtDeclaration);
25
+ for (const workflowKey of Object.keys(wtDeclaration.workflows)) {
26
+ await this.deployWorkflowTemplate(wtDeclaration.workflows[workflowKey], existingWorkflows, wtDeclaration.appIdentifier);
23
27
  }
24
28
  }
25
- async deployWorkflowTemplate(workflow, existingWorkflows) {
29
+ async deployWorkflowTemplate(workflow, existingWorkflows, appIdentifier) {
26
30
  logger_1.default.info(`%s \tDeploying workflow: ${workflow.triggerKey}`, chalk_1.default.yellow.bold('WORKFLOW TEMPLATES'));
27
- const identifier = getWorkflowTemplateIdentifier(workflow.identifier);
31
+ const identifier = getWorkflowTemplateIdentifier(workflow);
28
32
  const existingTemplate = existingWorkflows.find((ad) => ad.identifier === identifier);
29
33
  (0, interface_converters_1.convertWorkflow)(workflow);
30
34
  if (existingTemplate) {
31
- return await this.updateWorkflowTemplate(identifier, existingTemplate, workflow);
35
+ return await this.updateWorkflowTemplate(identifier, existingTemplate, workflow, appIdentifier);
32
36
  }
33
- return await this.createNewWorkflowTemplate(identifier, workflow);
37
+ return await this.createNewWorkflowTemplate(identifier, workflow, appIdentifier);
34
38
  }
35
- async createNewWorkflowTemplate(workflowKey, workflowTemplate) {
36
- await this.populateActionIds(workflowTemplate, workflowKey);
39
+ async createNewWorkflowTemplate(workflowKey, workflowTemplate, appIdentifier) {
40
+ await this.populateActionIds(workflowTemplate, workflowKey, appIdentifier);
37
41
  const newObject = {
38
- identifier: getWorkflowTemplateIdentifier(workflowKey),
42
+ identifier: getWorkflowTemplateIdentifier(workflowTemplate),
39
43
  name: workflowTemplate.name,
40
44
  triggerKey: workflowTemplate.triggerKey,
41
45
  workflowDefinition: workflowTemplate.workflowDefinition,
@@ -45,11 +49,16 @@ class LocalWorkflowTemplateDeployer {
45
49
  parallelWorkerCount: workflowTemplate.parallelWorkerCount,
46
50
  };
47
51
  const newWorkflowTemplate = await (0, event_workflow_templates_1.createWorkflowTemplate)(newObject);
52
+ if (workflowTemplate.crons) {
53
+ await this.createWorkflowSchedule(workflowTemplate, newWorkflowTemplate.id);
54
+ }
48
55
  logger_1.default.info(`%s Created new workflow definition: ${workflowKey}`, chalk_1.default.yellow.bold('WORKFLOW TEMPLATES'));
49
56
  return newWorkflowTemplate;
50
57
  }
51
- async populateActionIds(workflowTemplate, workflowKey) {
58
+ async populateActionIds(workflowTemplate, workflowKey, appIdentifier) {
52
59
  var _a;
60
+ const installedApps = await (0, apps_1.getInstalledApps)();
61
+ const appOrg = installedApps.find((x) => x.app.identifier === appIdentifier);
53
62
  logger_1.default.info('workflow template:', JSON.stringify(workflowTemplate, null, 2));
54
63
  if (!((_a = workflowTemplate === null || workflowTemplate === void 0 ? void 0 : workflowTemplate.workflowDefinition) === null || _a === void 0 ? void 0 : _a.paths)) {
55
64
  return;
@@ -61,8 +70,14 @@ class LocalWorkflowTemplateDeployer {
61
70
  for (const actionConfiguration of path.actionDefinitionConfigs) {
62
71
  const actionKey = actionConfiguration.action;
63
72
  try {
64
- const actionEntity = await getActionByIdentifier(actionKey);
73
+ const actionIdentifier = util_1.AppUtil.createActionIdentifier({
74
+ actionNameIdentifier: actionKey,
75
+ appIdentifier,
76
+ versionId: appOrg.appVersionId,
77
+ });
78
+ const actionEntity = await getActionByIdentifier(actionIdentifier);
65
79
  actionConfiguration.id = actionEntity.id;
80
+ actionConfiguration.identifier = actionEntity.identifier;
66
81
  }
67
82
  catch (e) {
68
83
  logger_1.default.info(e);
@@ -73,9 +88,77 @@ class LocalWorkflowTemplateDeployer {
73
88
  }
74
89
  }
75
90
  }
76
- async updateWorkflowTemplate(workflowKey, existingWorkflowTemplate, workflowTemplate) {
91
+ async createWorkflowSchedule(workflowTemplate, workflowId) {
92
+ var _a;
93
+ if (!((_a = workflowTemplate === null || workflowTemplate === void 0 ? void 0 : workflowTemplate.crons) === null || _a === void 0 ? void 0 : _a.length) || !workflowTemplate.id) {
94
+ return;
95
+ }
96
+ const crons = [];
97
+ for (const cron of workflowTemplate.crons) {
98
+ crons.push(await (0, schedules_1.createSchedule)({
99
+ cron: cron.cron,
100
+ entityReference: `event-workflow-template:${workflowId}`,
101
+ name: cron.name,
102
+ requestMethod: 'POST',
103
+ entityName: 'event-workflow-request',
104
+ isActive: true,
105
+ payload: {
106
+ event: {},
107
+ triggerKey: workflowTemplate.triggerKey,
108
+ },
109
+ }));
110
+ }
111
+ return crons;
112
+ }
113
+ async updateWorkflowSchedule(workflowTemplate, workflowId) {
114
+ var _a, _b, _c, _d;
115
+ const existingSchedules = (_a = (await (0, schedules_1.getExistingSchedules)()).filter((x) => (x === null || x === void 0 ? void 0 : x.ownerReference) === `event-workflow-template:${workflowId}`)) !== null && _a !== void 0 ? _a : [];
116
+ const newSchedules = (_b = workflowTemplate === null || workflowTemplate === void 0 ? void 0 : workflowTemplate.crons) !== null && _b !== void 0 ? _b : [];
117
+ const existingCronNames = (_c = existingSchedules.map((x) => x.name)) !== null && _c !== void 0 ? _c : [];
118
+ const newCronNames = (_d = newSchedules.map((x) => x.name)) !== null && _d !== void 0 ? _d : [];
119
+ const cronsToAdd = newSchedules.filter((x) => !existingCronNames.includes(x.name));
120
+ const cronsToRemove = existingSchedules.filter((x) => !newCronNames.includes(x.name));
121
+ const cronsToEdit = existingSchedules.filter((x) => newCronNames.includes(x.name));
122
+ for (const cron of cronsToAdd) {
123
+ logger_1.default.info(`%s Adding new schedule: ${cron.name}`, chalk_1.default.yellow.bold('WORKFLOW TEMPLATES'));
124
+ await (0, schedules_1.createSchedule)({
125
+ cron: cron.cron,
126
+ entityReference: `event-workflow-template:${workflowId}`,
127
+ name: cron.name,
128
+ requestMethod: 'POST',
129
+ entityName: 'event-workflow-request',
130
+ isActive: true,
131
+ payload: {
132
+ event: {},
133
+ triggerKey: workflowTemplate.triggerKey,
134
+ },
135
+ });
136
+ }
137
+ for (const cron of cronsToRemove) {
138
+ logger_1.default.info(`%s Removing schedule: ${cron.name}`, chalk_1.default.yellow.bold('WORKFLOW TEMPLATES'));
139
+ await (0, schedules_1.deleteSchedule)(cron.id);
140
+ }
141
+ for (const cron of cronsToEdit) {
142
+ logger_1.default.info(`%s Updating schedule: ${cron.name}`, chalk_1.default.yellow.bold('WORKFLOW TEMPLATES'));
143
+ const newCron = workflowTemplate.crons.find((x) => x.name === cron.name);
144
+ await (0, schedules_1.updateSchedule)({
145
+ id: cron.id,
146
+ updates: {
147
+ cron: newCron.cron,
148
+ requestMethod: 'POST',
149
+ entityName: 'event-workflow-request',
150
+ isActive: true,
151
+ payload: {
152
+ event: {},
153
+ triggerKey: workflowTemplate.triggerKey,
154
+ },
155
+ },
156
+ });
157
+ }
158
+ }
159
+ async updateWorkflowTemplate(workflowKey, existingWorkflowTemplate, workflowTemplate, appIdentifier) {
77
160
  var _a, _b;
78
- await this.populateActionIds(workflowTemplate, workflowKey);
161
+ await this.populateActionIds(workflowTemplate, workflowKey, appIdentifier);
79
162
  const updates = Object.assign(new Object(), {
80
163
  name: workflowTemplate.name,
81
164
  triggerKey: workflowTemplate.triggerKey,
@@ -88,6 +171,7 @@ class LocalWorkflowTemplateDeployer {
88
171
  id: existingWorkflowTemplate.id,
89
172
  updates,
90
173
  });
174
+ await this.updateWorkflowSchedule(workflowTemplate, updatedWorkflowTemplate.id);
91
175
  logger_1.default.info(`%s Updated existing workflow template: ${updatedWorkflowTemplate.identifier}`, chalk_1.default.yellow.bold('WORKFLOW TEMPLATES'));
92
176
  return updatedWorkflowTemplate;
93
177
  }
@@ -97,7 +181,7 @@ class LocalWorkflowTemplateDeployer {
97
181
  // UPSERT / DELETE BASED ON WORKFLOW TEMPLATES IDENTIFIER
98
182
  logger_1.default.info('%s \tDELETING workflow templates.', chalk_1.default.yellow.bold('WORKFLOW TEMPLATES'));
99
183
  for (const workflowKey of Object.keys(wtDeclaration.workflows)) {
100
- const identifier = getWorkflowTemplateIdentifier(workflowKey);
184
+ const identifier = getWorkflowTemplateIdentifier(wtDeclaration.workflows[workflowKey]);
101
185
  const existingTemplate = existingWorkflows.find((ad) => ad.identifier === identifier);
102
186
  if (existingTemplate) {
103
187
  try {
@@ -114,8 +198,8 @@ class LocalWorkflowTemplateDeployer {
114
198
  }
115
199
  }
116
200
  exports.LocalWorkflowTemplateDeployer = LocalWorkflowTemplateDeployer;
117
- function getWorkflowTemplateIdentifier(workflowKey) {
118
- return workflowKey;
201
+ function getWorkflowTemplateIdentifier(workflowTemplate) {
202
+ return workflowTemplate.identifier;
119
203
  }
120
204
  exports.getWorkflowTemplateIdentifier = getWorkflowTemplateIdentifier;
121
205
  async function getActionByIdentifier(identifier) {
@@ -77,6 +77,7 @@ export interface WorkflowDefinition {
77
77
  parallelWorkerCount?: number;
78
78
  }
79
79
  export interface WorkflowTemplateDeclaration {
80
+ appIdentifier: string;
80
81
  workflows?: WorkflowTemplate[];
81
82
  }
82
83
  export interface WorkflowTemplate {
@@ -88,6 +89,7 @@ export interface WorkflowTemplate {
88
89
  workflowDefinition: WorkflowDefinitionPaths;
89
90
  isActive: boolean;
90
91
  ownerKey?: string;
92
+ crons?: CronDeclaration[];
91
93
  supportingAppId?: string;
92
94
  parallelism?: number;
93
95
  groupId?: string;
@@ -114,6 +116,7 @@ export interface ActionDefinitionConfig {
114
116
  [key: string]: any;
115
117
  };
116
118
  id?: string;
119
+ identifier?: string;
117
120
  }
118
121
  export interface App {
119
122
  id: string;
@@ -367,3 +370,7 @@ export declare enum PropertyType {
367
370
  Image = "image",
368
371
  Json = "json"
369
372
  }
373
+ export interface CronDeclaration {
374
+ name: string;
375
+ cron: string;
376
+ }
@@ -29,6 +29,7 @@ actions:
29
29
 
30
30
  workflows:
31
31
  logItemUpdate:
32
+ identifier: "logItemUpdate"
32
33
  name: "Item Update -> Log"
33
34
  triggerKey: item|update
34
35
  isActive: true
@@ -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
+ }
@@ -14,7 +14,8 @@
14
14
  "build": "tsc; npx copyfiles assets/**/* dist/",
15
15
  "start": "nodemon --watch \"src/**/*.ts\" --exec ts-node src/main.ts",
16
16
  "debug": "nodemon -r ts-node/register --inspect=127.0.0.1:60002 --watch 'actions/**/*.ts' --exec node src/main.ts",
17
- "lint": "eslint . --fix",
17
+ "lint": "eslint --config eslintrc.json .",
18
+ "lint-fix": "eslint --fix --config eslintrc.json .",
18
19
  "test": "jest",
19
20
  "test-watch": "jest --watch"
20
21
  },
@@ -36,6 +37,9 @@
36
37
  "nodemon": "^1.19.4",
37
38
  "ts-jest": "^29.0.3",
38
39
  "ts-node": "^7.0.1",
40
+ "@typescript-eslint/eslint-plugin": "^6.10.0",
41
+ "eslint": "^8.53.0",
42
+ "eslint-plugin-unused-imports": "^3.0.0",
39
43
  "typescript": "^4.7.4"
40
44
  }
41
45
  }
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "2.1.26",
2
+ "version": "2.1.28",
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.28",
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",
@@ -61,7 +61,7 @@
61
61
  "eslint-config-prettier": "^8.8.0",
62
62
  "eslint-plugin-prettier": "^5.0.0",
63
63
  "jest": "^29.5.0",
64
- "oclif": "^3",
64
+ "oclif": "3.16",
65
65
  "prettier": "^3.0.0",
66
66
  "shx": "^0.3.3",
67
67
  "ts-jest": "^29.0.5",