@contrail/cli 1.0.39 → 1.0.41

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.
Files changed (60) hide show
  1. package/lib/api/apps.d.ts +13 -0
  2. package/lib/{apps/app-api.js → api/apps.js} +27 -1
  3. package/lib/api/event-workflow-action-definition.d.ts +1 -0
  4. package/lib/api/event-workflow-action-definition.js +7 -0
  5. package/lib/api/event-workflow-template-definition.d.ts +5 -0
  6. package/lib/api/event-workflow-template-definition.js +14 -0
  7. package/lib/api/event-workflow-templates.d.ts +7 -0
  8. package/lib/api/event-workflow-templates.js +25 -0
  9. package/lib/apps/deploy-app/app-deployer.js +4 -17
  10. package/lib/apps/install-app/app-installer.js +21 -4
  11. package/lib/apps/upgrade-app/app-upgrader.js +1 -1
  12. package/lib/cli.js +121 -45
  13. package/lib/config/config.d.ts +2 -2
  14. package/lib/config/configCommands.d.ts +1 -0
  15. package/lib/config/configCommands.js +25 -1
  16. package/lib/interfaces.d.ts +65 -1
  17. package/lib/interfaces.js +21 -0
  18. package/lib/types/parse-types.d.ts +1 -0
  19. package/lib/types/parse-types.js +48 -1
  20. package/lib/workflow-template-definitions/workflow-template-definition-commands.d.ts +2 -0
  21. package/lib/workflow-template-definitions/workflow-template-definition-commands.js +10 -0
  22. package/lib/workflow-template-definitions/workflow-template-definition-deployer.d.ts +12 -0
  23. package/lib/workflow-template-definitions/workflow-template-definition-deployer.js +148 -0
  24. package/lib/{workflows/workflow-template-deployer.d.ts → workflow-templates/local-workflow-template-deployer.d.ts} +1 -4
  25. package/lib/{workflows/workflow-template-deployer.js → workflow-templates/local-workflow-template-deployer.js} +9 -34
  26. package/lib/workflow-templates/workflow-template-commands.d.ts +4 -0
  27. package/lib/{workflows/workflowCommands.js → workflow-templates/workflow-template-commands.js} +9 -4
  28. package/lib/workflow-templates/workflow-template-deployer.d.ts +4 -0
  29. package/lib/workflow-templates/workflow-template-deployer.js +25 -0
  30. package/package.json +2 -2
  31. package/src/api/apps.ts +97 -0
  32. package/src/api/event-workflow-action-definition.ts +8 -0
  33. package/src/api/event-workflow-template-definition.ts +16 -0
  34. package/src/api/event-workflow-templates.ts +29 -0
  35. package/src/apps/deploy-app/app-deployer.ts +4 -19
  36. package/src/apps/install-app/app-installer.ts +34 -13
  37. package/src/apps/upgrade-app/app-upgrader.ts +1 -1
  38. package/src/cli.ts +123 -45
  39. package/src/config/config.ts +2 -2
  40. package/src/config/configCommands.ts +26 -1
  41. package/src/interfaces.ts +76 -6
  42. package/src/types/parse-types.ts +58 -1
  43. package/src/workflow-template-definitions/workflow-template-definition-commands.ts +13 -0
  44. package/src/workflow-template-definitions/workflow-template-definition-deployer.ts +182 -0
  45. package/src/{workflows/workflow-template-deployer.ts → workflow-templates/local-workflow-template-deployer.ts} +9 -38
  46. package/src/{workflows/workflowCommands.ts → workflow-templates/workflow-template-commands.ts} +10 -4
  47. package/src/workflow-templates/workflow-template-deployer.ts +29 -0
  48. package/lib/apps/app-api.d.ts +0 -6
  49. package/lib/apps/deploy-app/docker-action-builder.d.ts +0 -10
  50. package/lib/apps/deploy-app/docker-action-builder.js +0 -97
  51. package/lib/apps/deploy-app/interfaces.d.ts +0 -76
  52. package/lib/apps/deploy-app/interfaces.js +0 -4
  53. package/lib/apps/deploy-app/workflow-definition-deployer.d.ts +0 -10
  54. package/lib/apps/deploy-app/workflow-definition-deployer.js +0 -94
  55. package/lib/apps/deploy-app/workflow-deployer.d.ts +0 -10
  56. package/lib/apps/deploy-app/workflow-deployer.js +0 -87
  57. package/lib/workflows/workflowCommands.d.ts +0 -3
  58. package/src/apps/app-api.ts +0 -66
  59. package/src/apps/deploy-app/workflow-definition-deployer.ts +0 -118
  60. package/tslint.json +0 -57
@@ -0,0 +1,13 @@
1
+ import { App, AppOrg, AppVersion, WorkflowDefinition } from '../interfaces';
2
+ export declare function getAllAvailableApps(options: {
3
+ orgId: string;
4
+ }): Promise<App[]>;
5
+ export declare function getWorkflowTemplateDefinitionsForApp(options: {
6
+ appId: string;
7
+ }): Promise<WorkflowDefinition[]>;
8
+ export declare function getAppVersions(app: any): Promise<AppVersion[]>;
9
+ export declare function upgradeAppVersion(appOrg: any, appVersionId: any): Promise<AppOrg>;
10
+ export declare function deleteAppOrg(appOrgId: string): Promise<AppOrg>;
11
+ export declare function getInstalledApps(): Promise<AppOrg[]>;
12
+ export declare function installAppToOrg(app: any, configProperties: any): Promise<AppOrg>;
13
+ export declare function getAvailableApps(): Promise<App[]>;
@@ -1,5 +1,31 @@
1
- import { Entities } from '@contrail/sdk';
2
1
  import { Auth } from '../auth/auth';
2
+ import { Entities } from '@contrail/sdk';
3
+ export async function getAllAvailableApps(options) {
4
+ const apps = [];
5
+ apps.push(...await new Entities().get({
6
+ entityName: 'app',
7
+ criteria: {
8
+ orgId: options.orgId,
9
+ private: true,
10
+ },
11
+ }));
12
+ apps.push(...await new Entities().get({
13
+ entityName: 'app',
14
+ criteria: {
15
+ orgId: options.orgId,
16
+ private: false,
17
+ },
18
+ }));
19
+ return apps;
20
+ }
21
+ export async function getWorkflowTemplateDefinitionsForApp(options) {
22
+ return await new Entities().get({
23
+ entityName: 'event-workflow-template-definition',
24
+ criteria: {
25
+ ownerKey: `app:${options.appId}`
26
+ }
27
+ });
28
+ }
3
29
  export async function getAppVersions(app) {
4
30
  return await new Entities().get({
5
31
  entityName: 'app-version',
@@ -0,0 +1 @@
1
+ export declare function getEventWorkflowActionDefinition(criteria: any): Promise<any>;
@@ -0,0 +1,7 @@
1
+ import { Entities } from '@contrail/sdk';
2
+ export async function getEventWorkflowActionDefinition(criteria) {
3
+ return await new Entities().get({
4
+ entityName: 'event-workflow-action-definition',
5
+ criteria
6
+ });
7
+ }
@@ -0,0 +1,5 @@
1
+ export declare function createWorkflowTemplateDefinition(object: any): Promise<any>;
2
+ export declare function updateWorkflowTemplateDefinition(options: {
3
+ id: string;
4
+ updates: any;
5
+ }): Promise<any>;
@@ -0,0 +1,14 @@
1
+ import { Entities } from '@contrail/sdk';
2
+ export async function createWorkflowTemplateDefinition(object) {
3
+ return await new Entities().create({
4
+ entityName: 'event-workflow-template-definition',
5
+ object: object,
6
+ });
7
+ }
8
+ export async function updateWorkflowTemplateDefinition(options) {
9
+ return await new Entities().update({
10
+ entityName: 'event-workflow-template-definition',
11
+ id: options.id,
12
+ object: options.updates,
13
+ });
14
+ }
@@ -0,0 +1,7 @@
1
+ export declare function getExistingWorkflowTemplates(): Promise<any>;
2
+ export declare function createWorkflowTemplate(object: any): Promise<any>;
3
+ export declare function deleteWorkflowTemplate(id: string): Promise<any>;
4
+ export declare function updateWorkflowTemplate(options: {
5
+ id: string;
6
+ updates: any;
7
+ }): Promise<any>;
@@ -0,0 +1,25 @@
1
+ import { Entities } from '@contrail/sdk';
2
+ export async function getExistingWorkflowTemplates() {
3
+ return await new Entities().get({
4
+ entityName: 'event-workflow-template'
5
+ });
6
+ }
7
+ export async function createWorkflowTemplate(object) {
8
+ return await new Entities().create({
9
+ entityName: 'event-workflow-template',
10
+ object
11
+ });
12
+ }
13
+ export async function deleteWorkflowTemplate(id) {
14
+ return await new Entities().delete({
15
+ entityName: 'event-workflow-template',
16
+ id,
17
+ });
18
+ }
19
+ export async function updateWorkflowTemplate(options) {
20
+ return await new Entities().update({
21
+ entityName: 'event-workflow-template',
22
+ id: options.id,
23
+ object: options.updates,
24
+ });
25
+ }
@@ -3,7 +3,8 @@ import chalk from 'chalk';
3
3
  import { Auth } from '../../auth/auth';
4
4
  import { ActionsDeployer, getActionsForApp, deleteAction } from './actions-deployer';
5
5
  import { TriggerKeyDefinitionParser, ConfigPropertiesParser } from './app-template-parsers';
6
- import { WorkflowDefinitionDeployer } from './workflow-definition-deployer';
6
+ import { WorkflowTemplateDefinitionDeployer } from '../../workflow-template-definitions/workflow-template-definition-deployer';
7
+ import { getAllAvailableApps } from '../../api/apps';
7
8
  export class AppDeployer {
8
9
  async deploy(appDeclaration) {
9
10
  let app = await this.getExistingApp(appDeclaration);
@@ -16,25 +17,11 @@ export class AppDeployer {
16
17
  app = await this.updateExistingApp(appDeclaration, app);
17
18
  }
18
19
  await new ActionsDeployer().deployActions(appDeclaration, app);
19
- await new WorkflowDefinitionDeployer().deployWorkflowDefinitions(appDeclaration, app);
20
+ await new WorkflowTemplateDefinitionDeployer().deployWorkflowTemplateDefinitions(appDeclaration, app);
20
21
  }
21
22
  async getExistingApp(appDeclaration) {
22
23
  const orgId = Auth.config.orgId;
23
- const apps = [];
24
- apps.push(...await new Entities().get({
25
- entityName: 'app',
26
- criteria: {
27
- orgId,
28
- private: true,
29
- },
30
- }));
31
- apps.push(...await new Entities().get({
32
- entityName: 'app',
33
- criteria: {
34
- orgId,
35
- private: false,
36
- },
37
- }));
24
+ const apps = await getAllAvailableApps({ orgId });
38
25
  return apps.find(app => app.identifier === appDeclaration.appIdentifier);
39
26
  }
40
27
  async createNewApp(appDeclaration) {
@@ -2,7 +2,8 @@ import inquirer from 'inquirer';
2
2
  import chalk from 'chalk';
3
3
  import { Entities } from '@contrail/sdk';
4
4
  import { authUser } from '../../auth/login';
5
- import { deleteAppOrg, getAvailableApps, getInstalledApps, installAppToOrg } from '../app-api';
5
+ import { deleteAppOrg, getAvailableApps, getInstalledApps, getWorkflowTemplateDefinitionsForApp, installAppToOrg } from '../../api/apps';
6
+ import { WorkflowTemplateDefinitionDeployer } from '../../workflow-template-definitions/workflow-template-definition-deployer';
6
7
  async function getConfigProperties(app) {
7
8
  const config = {};
8
9
  for (const key of Object.keys(app.configProperties)) {
@@ -69,7 +70,7 @@ export async function installApp() {
69
70
  message: 'Which app would you like to install?',
70
71
  choices: installableApps.map(x => x.identifier)
71
72
  });
72
- const answers = await inquirer.prompt(questions);
73
+ let answers = await inquirer.prompt(questions);
73
74
  const app = installableApps.find(x => x.identifier === answers.appIdentifier);
74
75
  let configProperties;
75
76
  if (app.configProperties) {
@@ -84,7 +85,7 @@ export async function installApp() {
84
85
  const installingApp = await new Entities().get({ entityName: 'app-org', id: appOrg.id });
85
86
  if (installingApp.status === 'READY') {
86
87
  console.log('%s App installed', chalk.green.bold('APP INSTALLATION'));
87
- return;
88
+ break;
88
89
  }
89
90
  if (installingApp.status === 'FAILED_INSTALLING') {
90
91
  console.log('%s App installation failed', chalk.red.bold('APP INSTALLATION'));
@@ -93,10 +94,26 @@ export async function installApp() {
93
94
  process.stdout.write('.');
94
95
  }
95
96
  catch (e) {
97
+ console.log('%s App installation failed', chalk.red.bold('APP INSTALLATION'));
96
98
  console.log('Error is:', e);
97
- break;
99
+ return;
98
100
  }
99
101
  }
102
+ const workflowTemplateDefinitions = await getWorkflowTemplateDefinitionsForApp({ appId: app.id });
103
+ if (!workflowTemplateDefinitions.length) {
104
+ return;
105
+ }
106
+ answers = await inquirer.prompt([{
107
+ type: 'confirm',
108
+ name: 'shouldInstallWorkflows',
109
+ message: 'Would you like to install the Workflows associated with this app?',
110
+ default: false
111
+ }]);
112
+ if (!answers.shouldInstallWorkflows) {
113
+ console.log('%s Not installing associated app workflows', chalk.yellow.bold('APP INSTALLATION'));
114
+ return;
115
+ }
116
+ new WorkflowTemplateDefinitionDeployer().installWorkflowTemplateDefinitions(workflowTemplateDefinitions);
100
117
  }
101
118
  function delay(ms) {
102
119
  return new Promise(resolve => setTimeout(resolve, ms));
@@ -2,7 +2,7 @@ import inquirer from 'inquirer';
2
2
  import chalk from 'chalk';
3
3
  import { Entities } from '@contrail/sdk';
4
4
  import { authUser } from '../../auth/login';
5
- import { deleteAppOrg, getAppVersions, getAvailableApps, getInstalledApps, installAppToOrg, upgradeAppVersion } from '../app-api';
5
+ import { deleteAppOrg, getAppVersions, getAvailableApps, getInstalledApps, installAppToOrg, upgradeAppVersion } from '../../api/apps';
6
6
  async function getConfigProperties(app) {
7
7
  const config = {};
8
8
  for (const key of Object.keys(app.configProperties)) {
package/lib/cli.js CHANGED
@@ -6,12 +6,13 @@ import { UploadOptionSets } from './types/option-set-uploader';
6
6
  import { ParseOptionSetsLocalFiles } from './types/option-set-parser';
7
7
  import { MergeOptionSets } from './types/option-set-merger';
8
8
  import { MergeTypeProperties } from './types/types-properties-merger';
9
- import { ParseTypesFromFiles, ParseTypesFromLocalFiles, ParseTypesFromTemplateFromLocalFiles } from './types/parse-types';
9
+ import { ParseTypesFromFiles, ParseTypesFromLocalFiles, ParseTypesFromTemplateFromLocalFiles, ParseTypesFromTemplateAndDataFromLocalFiles } from './types/parse-types';
10
10
  import { loadColors, deleteColors } from './colors/color-loader';
11
- import { listConfig, removeConfig } from './config/configCommands';
12
- import { deleteWorkflowTemplate, deployWorkflowTemplate, listWorkflowTemplate } from './workflows/workflowCommands';
11
+ import { listConfig, removeConfig, setConfig } from './config/configCommands';
12
+ import { deleteWorkflowTemplates, localDeployWorkflowTemplate, listWorkflowTemplate } from './workflow-templates/workflow-template-commands';
13
13
  import { installApp, uninstallApp } from './apps/install-app/app-installer';
14
14
  import { upgradeApp } from './apps/upgrade-app/app-upgrader';
15
+ import { cliInstallWorkflowTemplateDefinitions, listWorkflowTemplateDefinitions } from './workflow-template-definitions/workflow-template-definition-commands';
15
16
  const cliUsage = require('command-line-usage');
16
17
  /**
17
18
  * Built using documentation here:
@@ -19,8 +20,6 @@ const cliUsage = require('command-line-usage');
19
20
  */
20
21
  export async function cli(args) {
21
22
  const fullCommand = args[2];
22
- let domain;
23
- let command;
24
23
  if (!fullCommand) {
25
24
  printIllegalCommand();
26
25
  return;
@@ -30,12 +29,15 @@ export async function cli(args) {
30
29
  printIllegalCommand();
31
30
  return;
32
31
  }
33
- if ((commandParts === null || commandParts === void 0 ? void 0 : commandParts.length) < 2 && commandParts[0].toLowerCase() !== 'help' && commandParts[0].toLowerCase() !== '-help' && commandParts[0].toLowerCase() !== '--help') {
32
+ if ((commandParts === null || commandParts === void 0 ? void 0 : commandParts.length) < 2 &&
33
+ commandParts[0].toLowerCase() !== 'help' &&
34
+ commandParts[0].toLowerCase() !== '-help' &&
35
+ commandParts[0].toLowerCase() !== '--help') {
34
36
  printIllegalCommand();
35
37
  return;
36
38
  }
37
- domain = commandParts[0];
38
- command = commandParts[1];
39
+ const domain = commandParts[0];
40
+ const command = commandParts[1];
39
41
  switch (domain) {
40
42
  case 'app': {
41
43
  switch (command) {
@@ -95,6 +97,10 @@ export async function cli(args) {
95
97
  ParseTypesFromTemplateFromLocalFiles(args);
96
98
  break;
97
99
  }
100
+ case 'parseTypesFromTemplateAndDataFromLocalFiles': {
101
+ ParseTypesFromTemplateAndDataFromLocalFiles(args);
102
+ break;
103
+ }
98
104
  case 'parseTypesFromFiles': {
99
105
  ParseTypesFromFiles(args);
100
106
  break;
@@ -132,11 +138,11 @@ export async function cli(args) {
132
138
  case 'workflow-templates': {
133
139
  switch (command) {
134
140
  case 'load': {
135
- await deployWorkflowTemplate();
141
+ await localDeployWorkflowTemplate();
136
142
  break;
137
143
  }
138
144
  case 'delete': {
139
- await deleteWorkflowTemplate();
145
+ await deleteWorkflowTemplates();
140
146
  break;
141
147
  }
142
148
  case 'list': {
@@ -149,12 +155,32 @@ export async function cli(args) {
149
155
  }
150
156
  break;
151
157
  }
158
+ case 'workflow-template-definitions': {
159
+ switch (command) {
160
+ case 'install': {
161
+ await cliInstallWorkflowTemplateDefinitions();
162
+ break;
163
+ }
164
+ case 'list': {
165
+ await listWorkflowTemplateDefinitions();
166
+ break;
167
+ }
168
+ default: {
169
+ printIllegalCommand();
170
+ }
171
+ }
172
+ break;
173
+ }
152
174
  case 'config': {
153
175
  switch (command) {
154
176
  case 'list': {
155
177
  await listConfig();
156
178
  break;
157
179
  }
180
+ case 'set': {
181
+ await setConfig(args);
182
+ break;
183
+ }
158
184
  case 'remove': {
159
185
  await removeConfig(args);
160
186
  break;
@@ -205,55 +231,105 @@ const helpSections = [
205
231
  {
206
232
  header: 'App Commands - Domain: app',
207
233
  content: [
208
- 'create Create a new app workspace.',
209
- 'deploy Deploy your app.',
210
- 'deploy [OPTIONS] --template-only deploy event workflow as',
211
- '. a template directly to the org',
212
- 'deploy Deploy your app.',
213
- 'remove Remove your app.',
214
- 'install Install an app to your org.',
215
- 'uninstall Uninstall an app from your org.',
234
+ {
235
+ name: 'create',
236
+ summary: 'Create a new app workspace.'
237
+ },
238
+ {
239
+ name: 'deploy [--template-only]',
240
+ summary: 'Deploy your app. --template-only can be used to deploy event workflow as a template directly to the org'
241
+ },
242
+ {
243
+ name: 'remove',
244
+ summary: 'Remove your app.'
245
+ },
246
+ {
247
+ name: 'install',
248
+ summary: 'Install an app to your org.'
249
+ },
250
+ {
251
+ name: 'uninstall',
252
+ summary: 'Uninstall an app from your org.'
253
+ },
216
254
  ],
217
255
  },
218
256
  {
219
257
  header: 'Colors Commands - Domain: colors',
220
- content: [
221
- 'load Load colors from a CSV. Headers (name, hex, red,',
222
- '. green, blue) are required.',
223
- // 'delete Delete all colors.',
258
+ content: [{
259
+ name: 'load',
260
+ summary: 'Load colors from a CSV. Headers (name, hex, red, green, blue) are required'
261
+ }
262
+ // , {name: 'delete', summary: 'Delete all colors.'}
224
263
  ],
225
264
  },
226
265
  {
227
266
  header: 'Workflow Template Commands - Domain: workflow-templates',
228
267
  content: [
229
- 'deploy Deploy your workflow. Assumes a workflow.yml file.',
230
- 'delete Removes the workflows in the workflow.yml file.',
231
- 'list Lists the workflow templates in the org',
268
+ {
269
+ name: 'deploy',
270
+ summary: 'Deploy your workflow. Assumes a workflow.yml file.'
271
+ },
272
+ {
273
+ name: 'delete',
274
+ summary: 'Removes the workflows in the workflow.yml file.'
275
+ },
276
+ {
277
+ name: 'list',
278
+ summary: 'Lists the workflow templates in the org'
279
+ },
280
+ ],
281
+ },
282
+ {
283
+ header: 'Workflow Template Definition Commands - Domain: workflow-template-definitions',
284
+ content: [{
285
+ name: 'install',
286
+ summary: 'Install the template definitions of an app to your org'
287
+ },
288
+ {
289
+ name: 'list',
290
+ summary: 'Lists the workflow templates in the org'
291
+ }
232
292
  ],
233
293
  },
234
294
  {
235
295
  header: 'Type Commands - Domain: types',
236
296
  content: [
237
- 'getAll Get all OptionSets and Types for your Org.',
238
- 'uploadTypes Upload Types for your Org.',
239
- '. Types are uploaded from types.yml\n',
240
- 'uploadOptionSets Upload OptionSets for your Org.',
241
- '. OptionSets are loaded from option_sets.yml\n',
242
- 'parseOptionSetsLocalFiles <File Paths> Parse CSV files into OptionSets',
243
- 'parseTypesFromLocalFiles <File Paths> Parse CSV files into Types and ',
244
- '. OptionSets from local files.\n',
245
- 'parseTypesFromTemplateFromLocalFiles <File Paths> Parse CSV files into ',
246
- '. Types and OptionSets from local files.\n',
247
- 'parseTypesFromFiles <fileIds> Parse CSV files into Types and ',
248
- '. OptionSets from VibeIQ Files.\n',
249
- 'mergeOptionSets <File Path> Merge the OptionSets from an existing',
250
- '. org and the OptionSets passed in.',
251
- '. File must be .yml\n',
252
- 'mergeTypeProperties <File Path> <TypePaths> ',
253
- '. Merge the TypeProperties from an existing',
254
- '. org and the TypeProperties passed in.',
255
- '. Add to Types via TypePath',
256
- '. File must be .yml\n',
297
+ {
298
+ name: 'getAll',
299
+ summary: 'Get all OptionSets and Types for your Org.'
300
+ },
301
+ {
302
+ name: 'uploadTypes',
303
+ summary: 'Upload Types for your Org. Types are uploaded from types.yml\n'
304
+ },
305
+ {
306
+ name: 'uploadOptionSets',
307
+ summary: 'Upload OptionSets for your Org. OptionSets are loaded from option_sets.yml\n'
308
+ },
309
+ {
310
+ name: 'parseOptionSetsLocalFiles <File Paths>',
311
+ summary: 'Parse CSV files into OptionSets'
312
+ },
313
+ {
314
+ name: 'parseTypesFromLocalFiles <File Paths>',
315
+ summary: 'Parse CSV files into Types and OptionSets from local files.\n'
316
+ },
317
+ {
318
+ name: 'parseTypesFromTemplateFromLocalFiles <File Paths>',
319
+ summary: 'Parse CSV files into Types and OptionSets from local type template files.\n'
320
+ },
321
+ {
322
+ name: 'parseTypesFromTemplateAndDataFromLocalFiles <File Paths>',
323
+ summary: 'Parse CSV files into Types and OptionSets from local type template and data files.\n'
324
+ },
325
+ {
326
+ name: 'parseTypesFromFiles <fileIds>',
327
+ summary: 'Parse CSV files into Types and OptionSets from VibeIQ Files.\n File must be .yml\n'
328
+ },
329
+ {
330
+ name: 'mergeTypeProperties <File Path> <TypePaths>',
331
+ summary: 'Merge the TypeProperties from an existing org and the TypeProperties passed in. Add to Types via TypePath File must be .yml\n'
332
+ },
257
333
  ],
258
334
  },
259
335
  ];
@@ -1,6 +1,6 @@
1
1
  export declare function initializeVibeIQConfig(): Promise<void>;
2
2
  export declare function readVibeIQConfig(): Promise<any>;
3
- export declare function writeVibeIQConfig(config: Object): Promise<void>;
3
+ export declare function writeVibeIQConfig(config: any): Promise<void>;
4
4
  export declare function getConfig(): Promise<any>;
5
5
  export declare function deleteConfigs(configNames: string[]): Promise<void>;
6
- export declare function storeConfig(incomingConfig: Object, merge?: boolean): Promise<void>;
6
+ export declare function storeConfig(incomingConfig: any, merge?: boolean): Promise<void>;
@@ -1,2 +1,3 @@
1
1
  export declare function listConfig(): Promise<void>;
2
+ export declare function setConfig(args: any): Promise<void>;
2
3
  export declare function removeConfig(args: any): Promise<void>;
@@ -1,7 +1,31 @@
1
- import { deleteConfigs, readVibeIQConfig } from './config';
1
+ import { deleteConfigs, readVibeIQConfig, storeConfig } from './config';
2
2
  export async function listConfig() {
3
3
  console.log(await readVibeIQConfig());
4
4
  }
5
+ export async function setConfig(args) {
6
+ const helpConfigLine = `
7
+ Usage:
8
+ contrail config.set key1=value1 key2=value2
9
+ `;
10
+ if ((args === null || args === void 0 ? void 0 : args.length) < 4) {
11
+ console.log(helpConfigLine);
12
+ throw new Error('You need to pass at least one config to set');
13
+ }
14
+ const configsToSet = args.slice(3);
15
+ const config = {};
16
+ for (const conf of configsToSet) {
17
+ if (conf.length < 3 || conf.indexOf('=') <= 0) {
18
+ console.log(helpConfigLine);
19
+ throw new Error(`value ${conf} does not adhere to key1=value1 standard`);
20
+ }
21
+ const [key, value] = conf.split('=');
22
+ console.log('key and value:', key, value);
23
+ console.log(conf.split('='));
24
+ config[key] = value;
25
+ }
26
+ console.log('config is:', config);
27
+ await storeConfig(config);
28
+ }
5
29
  export async function removeConfig(args) {
6
30
  if ((args === null || args === void 0 ? void 0 : args.length) < 4) {
7
31
  throw new Error('At least one configuration must be included to be removed.');
@@ -66,7 +66,7 @@ export interface WorkflowTemplateDeclaration {
66
66
  }
67
67
  export interface WorkflowTemplate {
68
68
  id?: string;
69
- identifier: string;
69
+ identifier?: string;
70
70
  name: string;
71
71
  triggerKey: string;
72
72
  workflowDefinition: WorkflowDefinitionPaths;
@@ -103,6 +103,70 @@ export interface App {
103
103
  configProperties?: ConfigProperty[];
104
104
  triggerKeyDefinitions?: TriggerKeyDefinition[];
105
105
  }
106
+ export interface AppOrg {
107
+ id: string;
108
+ createdOn?: Date;
109
+ updatedOn?: Date;
110
+ createdById?: string;
111
+ updatedById?: string;
112
+ createdBy?: any;
113
+ updatedBy?: any;
114
+ orgId?: string;
115
+ status: AppOrgStatus;
116
+ appId?: string;
117
+ app?: App;
118
+ appVersionId?: string;
119
+ appVersion?: AppVersion;
120
+ apiKey?: AppApiKey;
121
+ appConfig?: any;
122
+ }
123
+ export declare enum AppOrgStatus {
124
+ INSTALLING = "INSTALLING",
125
+ FAILED_INSTALLING = "FAILED_INSTALLING",
126
+ READY = "READY",
127
+ DELETING = "DELETING",
128
+ FAILED_DELETING = "FAILED_DELETING"
129
+ }
130
+ export declare enum AppVersionStatus {
131
+ PUBLISHING = "PUBLISHING",
132
+ FAILED_PUBLISHING = "FAILED_PUBLISHING",
133
+ PUBLISHED = "PUBLISHED",
134
+ ARCHIVING = "ARCHIVING",
135
+ FAILED_ARCHIVING = "FAILED_ARCHIVING",
136
+ ARCHIVED = "ARCHIVED"
137
+ }
138
+ export declare class AppVersion {
139
+ id: string;
140
+ createdOn?: Date;
141
+ updatedOn?: Date;
142
+ createdById?: string;
143
+ updatedById?: string;
144
+ createdBy?: any;
145
+ updatedBy?: any;
146
+ orgId?: string;
147
+ appId?: string;
148
+ app?: App;
149
+ appOrgs?: AppOrg[];
150
+ versionNumber: number;
151
+ status: AppVersionStatus;
152
+ eventWorkflowTriggerKeyMapping: string;
153
+ configProperties?: ConfigProperty[];
154
+ triggerKeyDefinitions?: TriggerKeyDefinition[];
155
+ dockerImageRef?: string;
156
+ }
157
+ export declare class AppApiKey {
158
+ id: string;
159
+ createdOn?: Date;
160
+ updatedOn?: Date;
161
+ createdById?: string;
162
+ updatedById?: string;
163
+ createdBy?: any;
164
+ updatedBy?: any;
165
+ orgId?: string;
166
+ appOrgId?: string;
167
+ appOrg?: AppOrg;
168
+ apiKey?: string;
169
+ }
106
170
  export declare class ConfigProperty {
107
171
  slug: string;
108
172
  propertyType: string;
package/lib/interfaces.js CHANGED
@@ -1,3 +1,24 @@
1
+ export var AppOrgStatus;
2
+ (function (AppOrgStatus) {
3
+ AppOrgStatus["INSTALLING"] = "INSTALLING";
4
+ AppOrgStatus["FAILED_INSTALLING"] = "FAILED_INSTALLING";
5
+ AppOrgStatus["READY"] = "READY";
6
+ AppOrgStatus["DELETING"] = "DELETING";
7
+ AppOrgStatus["FAILED_DELETING"] = "FAILED_DELETING";
8
+ })(AppOrgStatus || (AppOrgStatus = {}));
9
+ export var AppVersionStatus;
10
+ (function (AppVersionStatus) {
11
+ AppVersionStatus["PUBLISHING"] = "PUBLISHING";
12
+ AppVersionStatus["FAILED_PUBLISHING"] = "FAILED_PUBLISHING";
13
+ AppVersionStatus["PUBLISHED"] = "PUBLISHED";
14
+ AppVersionStatus["ARCHIVING"] = "ARCHIVING";
15
+ AppVersionStatus["FAILED_ARCHIVING"] = "FAILED_ARCHIVING";
16
+ AppVersionStatus["ARCHIVED"] = "ARCHIVED";
17
+ })(AppVersionStatus || (AppVersionStatus = {}));
18
+ export class AppVersion {
19
+ }
20
+ export class AppApiKey {
21
+ }
1
22
  export class ConfigProperty {
2
23
  }
3
24
  export class TriggerKeyDefinition {
@@ -1,3 +1,4 @@
1
1
  export declare function ParseTypesFromLocalFiles(args: any): Promise<void>;
2
2
  export declare function ParseTypesFromFiles(args: any): Promise<void>;
3
3
  export declare function ParseTypesFromTemplateFromLocalFiles(args: any): Promise<void>;
4
+ export declare function ParseTypesFromTemplateAndDataFromLocalFiles(args: any): Promise<void>;