@contrail/cli 1.0.2 → 1.0.3

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 (53) hide show
  1. package/.vscode/settings.json +5 -5
  2. package/bin/init +3 -3
  3. package/lib/auth/auth.d.ts +9 -9
  4. package/lib/auth/auth.js +2 -2
  5. package/lib/auth/login.d.ts +1 -1
  6. package/lib/auth/login.js +112 -96
  7. package/lib/cli.d.ts +5 -5
  8. package/lib/cli.js +30 -30
  9. package/lib/create-app/create.d.ts +1 -1
  10. package/lib/create-app/create.js +63 -48
  11. package/lib/create-app/setup-template.d.ts +1 -1
  12. package/lib/create-app/setup-template.js +34 -48
  13. package/lib/deploy-app/actions-deployer.d.ts +10 -10
  14. package/lib/deploy-app/actions-deployer.js +86 -75
  15. package/lib/deploy-app/app-deployer.d.ts +8 -10
  16. package/lib/deploy-app/app-deployer.js +79 -84
  17. package/lib/deploy-app/app-template-parsers.d.ts +7 -0
  18. package/lib/deploy-app/app-template-parsers.js +37 -0
  19. package/lib/deploy-app/deploy.d.ts +2 -2
  20. package/lib/deploy-app/deploy.js +56 -30
  21. package/lib/deploy-app/interfaces.d.ts +74 -43
  22. package/lib/deploy-app/interfaces.js +4 -0
  23. package/package.json +63 -63
  24. package/publish.sh +5 -0
  25. package/src/auth/auth.ts +9 -9
  26. package/src/auth/login.ts +124 -107
  27. package/src/cli.ts +32 -33
  28. package/src/create-app/create.ts +73 -58
  29. package/src/create-app/setup-template.ts +37 -56
  30. package/src/deploy-app/actions-deployer.ts +109 -84
  31. package/src/deploy-app/app-deployer.ts +86 -89
  32. package/src/deploy-app/app-template-parsers.ts +43 -0
  33. package/src/deploy-app/deploy.ts +64 -33
  34. package/src/deploy-app/interfaces.ts +78 -43
  35. package/templates/javascript/actions/example/action.js +37 -37
  36. package/templates/javascript/app.yml +54 -42
  37. package/templates/javascript/package.json +23 -23
  38. package/templates/javascript/set_auth.bat +3 -0
  39. package/templates/javascript/set_auth.sh +3 -0
  40. package/templates/typescript/actions/exampleAction.ts +38 -0
  41. package/templates/typescript/app.yml +56 -0
  42. package/templates/typescript/package.json +24 -0
  43. package/templates/typescript/set_auth.bat +3 -0
  44. package/templates/typescript/set_auth.sh +3 -0
  45. package/templates/typescript/tsconfig.json +31 -0
  46. package/tsconfig.json +22 -22
  47. package/tslint.json +57 -57
  48. package/lib/deploy-app/actions.d.ts +0 -5
  49. package/lib/deploy-app/actions.js +0 -17
  50. package/lib/deploy-app/app-declaration.d.ts +0 -20
  51. package/lib/deploy-app/app-declaration.js +0 -0
  52. package/lib/deploy-app/app.d.ts +0 -8
  53. package/lib/deploy-app/app.js +0 -56
@@ -1,75 +1,86 @@
1
- import { Entities } from '@contrail/sdk';
2
- import chalk from 'chalk';
3
- import fs from 'fs';
4
- export class ActionsDeployer {
5
- async deployActions(appDeclaration, app) {
6
- // FETCH ALL ACTIONS FROM THE API.
7
- const existingActions = await this.getActionsForApp(app);
8
- // UPSERT / DELETE BASED ON ACTION IDENTIFIER
9
- console.log('%s \tDeploying actions.', chalk.yellow.bold('ACTION'));
10
- for (const actionKey of Object.keys(appDeclaration.actions)) {
11
- await this.deployAction(actionKey, appDeclaration.actions[actionKey], app, existingActions);
12
- }
13
- }
14
- async getActionsForApp(app) {
15
- return await new Entities().get({ entityName: 'event-workflow-action-definition',
16
- criteria: { ownerKey: `app:${app.id}` } });
17
- }
18
- async deployAction(actionKey, actionDeclaration, app, existingActions) {
19
- console.log(`%s \tDeploying action: ${actionKey}`, chalk.yellow.bold('ACTION'));
20
- const identifier = this.getActionDeclarationIdentifier(actionKey, app);
21
- const existingDefinition = existingActions.find(ad => ad.identifier === identifier);
22
- if (!existingDefinition) {
23
- await this.createNewActionDefinition(actionKey, actionDeclaration, app);
24
- }
25
- else {
26
- await this.updateActionDefinition(existingDefinition, actionDeclaration);
27
- }
28
- }
29
- async createNewActionDefinition(actionKey, actionDeclaration, app) {
30
- const newObject = {
31
- identifier: this.getActionDeclarationIdentifier(actionKey, app),
32
- name: actionDeclaration.name,
33
- ownerKey: `app:${app.id}`,
34
- public: !app.private,
35
- };
36
- const functionString = await this.getFunction(actionDeclaration);
37
- if (functionString) {
38
- newObject.executeFunctionString = functionString;
39
- }
40
- const actionDefinition = await new Entities().create({
41
- entityName: 'event-workflow-action-definition',
42
- object: newObject
43
- });
44
- console.log(`%s Created new action defintion: ${actionKey}`, chalk.yellow.bold('APP'));
45
- return actionDefinition;
46
- }
47
- async updateActionDefinition(existingActionDefinition, actionDeclaration) {
48
- const updates = {
49
- name: actionDeclaration.name,
50
- };
51
- const functionString = await this.getFunction(actionDeclaration);
52
- if (functionString) {
53
- updates.executeFunctionString = functionString;
54
- }
55
- const actionDefinition = await new Entities().update({
56
- entityName: 'event-workflow-action-definition',
57
- id: existingActionDefinition.id,
58
- object: updates
59
- });
60
- console.log(`%s Updated existingaction defintion: ${actionDefinition.identifier}`, chalk.yellow.bold('APP'));
61
- return actionDefinition;
62
- }
63
- getActionDeclarationIdentifier(actionKey, app) {
64
- return app.identifier + ':' + actionKey;
65
- }
66
- async getFunction(actionDeclaration) {
67
- if (!actionDeclaration.handler) {
68
- return;
69
- }
70
- const CURRENT_DIR = process.cwd();
71
- const functionLocaiton = CURRENT_DIR + '\\' + actionDeclaration.handler;
72
- const content = fs.readFileSync(functionLocaiton);
73
- return content.toString();
74
- }
75
- }
1
+ import { Entities } from '@contrail/sdk';
2
+ import chalk from 'chalk';
3
+ import { ConfigPropertiesParser } from './app-template-parsers';
4
+ import fs from 'fs';
5
+ export class ActionsDeployer {
6
+ async deployActions(appDeclaration, app) {
7
+ // FETCH ALL ACTIONS FROM THE API.
8
+ const existingActions = await this.getActionsForApp(app);
9
+ // UPSERT / DELETE BASED ON ACTION IDENTIFIER
10
+ console.log('%s \tDeploying actions.', chalk.yellow.bold('ACTION'));
11
+ for (const actionKey of Object.keys(appDeclaration.actions)) {
12
+ await this.deployAction(actionKey, appDeclaration.actions[actionKey], app, existingActions);
13
+ }
14
+ }
15
+ async getActionsForApp(app) {
16
+ return await new Entities().get({
17
+ entityName: 'event-workflow-action-definition',
18
+ criteria: { ownerKey: `app:${app.id}` },
19
+ });
20
+ }
21
+ async deployAction(actionKey, actionDeclaration, app, existingActions) {
22
+ console.log(`%s \tDeploying action: ${actionKey}`, chalk.yellow.bold('ACTION'));
23
+ const identifier = this.getActionDeclarationIdentifier(actionKey, app);
24
+ const existingDefinition = existingActions.find(ad => ad.identifier === identifier);
25
+ if (!existingDefinition) {
26
+ await this.createNewActionDefinition(actionKey, actionDeclaration, app);
27
+ }
28
+ else {
29
+ await this.updateActionDefinition(existingDefinition, actionDeclaration);
30
+ }
31
+ }
32
+ async createNewActionDefinition(actionKey, actionDeclaration, app) {
33
+ const newObject = {
34
+ identifier: this.getActionDeclarationIdentifier(actionKey, app),
35
+ name: actionDeclaration.name,
36
+ ownerKey: `app:${app.id}`,
37
+ public: app.public,
38
+ configProperties: ConfigPropertiesParser.getConfigProperties(actionDeclaration.actionConfiguration),
39
+ };
40
+ const functionString = await this.getFunction(actionDeclaration);
41
+ if (functionString) {
42
+ newObject.executeFunctionString = functionString;
43
+ }
44
+ const actionDefinition = await new Entities().create({
45
+ entityName: 'event-workflow-action-definition',
46
+ object: newObject,
47
+ });
48
+ console.log(`%s Created new action definition: ${actionKey}`, chalk.yellow.bold('APP'));
49
+ return actionDefinition;
50
+ }
51
+ async updateActionDefinition(existingActionDefinition, actionDeclaration) {
52
+ const updates = {
53
+ name: actionDeclaration.name,
54
+ // public: actionDeclaration.public, // TODO - an actions visibility is allowed to change
55
+ configProperties: ConfigPropertiesParser.getConfigProperties(actionDeclaration.actionConfiguration),
56
+ };
57
+ const functionString = await this.getFunction(actionDeclaration);
58
+ if (functionString) {
59
+ updates.executeFunctionString = functionString;
60
+ }
61
+ const actionDefinition = await new Entities().update({
62
+ entityName: 'event-workflow-action-definition',
63
+ id: existingActionDefinition.id,
64
+ object: updates,
65
+ });
66
+ console.log(`%s Updated existingaction defintion: ${actionDefinition.identifier}`, chalk.yellow.bold('APP'));
67
+ return actionDefinition;
68
+ }
69
+ getActionDeclarationIdentifier(actionKey, app) {
70
+ return app.identifier + ':' + actionKey;
71
+ }
72
+ async getFunction(actionDeclaration) {
73
+ if (!actionDeclaration.handler) {
74
+ return;
75
+ }
76
+ if (!actionDeclaration.handler.endsWith('.js')) {
77
+ throw new Error('Action handler must be a .js file.');
78
+ }
79
+ const CURRENT_DIR = process.cwd();
80
+ const isWin = process.platform === 'win32';
81
+ const separator = isWin ? '\\' : '/';
82
+ const functionLocaiton = CURRENT_DIR + separator + actionDeclaration.handler;
83
+ const content = fs.readFileSync(functionLocaiton);
84
+ return content.toString();
85
+ }
86
+ }
@@ -1,10 +1,8 @@
1
- import { AppDeclartion } from './interfaces';
2
- export declare class AppDeployer {
3
- private app;
4
- deploy(appDeclaration: AppDeclartion): Promise<void>;
5
- remove(appDeclaration: AppDeclartion): Promise<void>;
6
- getExistingApp(appDeclaration: AppDeclartion): Promise<any>;
7
- updateExistingApp(appDeclaration: AppDeclartion, existingApp: any): Promise<any>;
8
- private createNewApp;
9
- private getAppConfigProperties;
10
- }
1
+ import { App, AppDeclaration } from './interfaces';
2
+ export declare class AppDeployer {
3
+ deploy(appDeclaration: AppDeclaration): Promise<void>;
4
+ getExistingApp(appDeclaration: AppDeclaration): Promise<App>;
5
+ private createNewApp;
6
+ updateExistingApp(appDeclaration: AppDeclaration, existingApp: any): Promise<any>;
7
+ remove(appDeclaration: AppDeclaration): Promise<void>;
8
+ }
@@ -1,84 +1,79 @@
1
- import { Entities } from '@contrail/sdk';
2
- import chalk from 'chalk';
3
- import { Auth } from '../auth/auth';
4
- import { ActionsDeployer } from './actions-deployer';
5
- export class AppDeployer {
6
- async deploy(appDeclaration) {
7
- let app = await this.getExistingApp(appDeclaration);
8
- if (!app) {
9
- app = await this.createNewApp(appDeclaration);
10
- }
11
- else {
12
- app = await this.updateExistingApp(appDeclaration, app);
13
- }
14
- this.app = app;
15
- await new ActionsDeployer().deployActions(appDeclaration, this.app);
16
- }
17
- async remove(appDeclaration) {
18
- let app = await this.getExistingApp(appDeclaration);
19
- if (app) {
20
- app = await new Entities().delete({ entityName: 'app', id: app.id });
21
- console.log(`%s Deleted app: ${app.name}`, chalk.yellow.bold('APP'));
22
- }
23
- else {
24
- console.log(`%s App not found. Can not remove`, chalk.red.bold('APP'));
25
- }
26
- }
27
- async getExistingApp(appDeclaration) {
28
- const orgId = Auth.config.orgId;
29
- const apps = await new Entities().get({ entityName: 'app', criteria: {
30
- orgId,
31
- private: (appDeclaration.visibility === 'private')
32
- },
33
- });
34
- // console.log('Existing: ', apps);
35
- return apps.find(app => app.identifier === appDeclaration.appIdentifier);
36
- }
37
- async updateExistingApp(appDeclaration, existingApp) {
38
- const updates = {
39
- name: appDeclaration.appName,
40
- public: appDeclaration.visibility === 'public',
41
- description: appDeclaration.appDescription,
42
- publisher: appDeclaration.publisher,
43
- thumbnail: appDeclaration.thumbnail,
44
- eventWorkflowTriggerKeyMapping: 'NONE',
45
- keywords: appDeclaration.keywords,
46
- configProperties: this.getAppConfigProperties(appDeclaration),
47
- };
48
- const app = await new Entities().update({ entityName: 'app', id: existingApp.id, object: updates });
49
- console.log(`%s Updated app: ${app.name}`, chalk.yellow.bold('APP'));
50
- return app;
51
- }
52
- async createNewApp(appDeclaration) {
53
- const newApp = {
54
- identifier: appDeclaration.appIdentifier,
55
- name: appDeclaration.appName,
56
- public: appDeclaration.visibility === 'public',
57
- description: appDeclaration.appDescription,
58
- publisher: appDeclaration.publisher,
59
- thumbnail: appDeclaration.thumbnail,
60
- eventWorkflowTriggerKeyMapping: 'NONE',
61
- keywords: appDeclaration.keywords,
62
- configProperties: this.getAppConfigProperties(appDeclaration),
63
- };
64
- const app = await new Entities().create({ entityName: 'app', object: newApp });
65
- console.log(`%s Created new app: ${app.name}`, chalk.yellow.bold('APP'));
66
- return app;
67
- }
68
- getAppConfigProperties(appDeclaration) {
69
- const appConfiguration = [];
70
- for (const configKey of Object.keys(appDeclaration.appConfiguration)) {
71
- const declaration = appDeclaration.appConfiguration[configKey];
72
- const config = {
73
- label: declaration.label,
74
- slug: configKey,
75
- propertyType: declaration.propertyType,
76
- };
77
- if (declaration.options) {
78
- config.options = declaration.options;
79
- }
80
- appConfiguration.push(config);
81
- }
82
- return appConfiguration;
83
- }
84
- }
1
+ import { Entities } from '@contrail/sdk';
2
+ import chalk from 'chalk';
3
+ import { Auth } from '../auth/auth';
4
+ import { ActionsDeployer } from './actions-deployer';
5
+ import { TriggerKeyDefinitionParser, ConfigPropertiesParser } from './app-template-parsers';
6
+ export class AppDeployer {
7
+ async deploy(appDeclaration) {
8
+ let app = await this.getExistingApp(appDeclaration);
9
+ if (!app) {
10
+ app = await this.createNewApp(appDeclaration);
11
+ }
12
+ else {
13
+ app = await this.updateExistingApp(appDeclaration, app);
14
+ }
15
+ await new ActionsDeployer().deployActions(appDeclaration, app);
16
+ }
17
+ async getExistingApp(appDeclaration) {
18
+ const orgId = Auth.config.orgId;
19
+ const apps = [];
20
+ apps.push(...await new Entities().get({
21
+ entityName: 'app',
22
+ criteria: {
23
+ orgId,
24
+ private: true,
25
+ },
26
+ }));
27
+ apps.push(...await new Entities().get({
28
+ entityName: 'app',
29
+ criteria: {
30
+ orgId,
31
+ private: false,
32
+ },
33
+ }));
34
+ return apps.find(app => app.identifier === appDeclaration.appIdentifier);
35
+ }
36
+ async createNewApp(appDeclaration) {
37
+ const newApp = {
38
+ identifier: appDeclaration.appIdentifier,
39
+ name: appDeclaration.appName,
40
+ public: appDeclaration.visibility === 'public',
41
+ description: appDeclaration.appDescription,
42
+ publisher: appDeclaration.publisher,
43
+ thumbnail: appDeclaration.thumbnail,
44
+ eventWorkflowTriggerKeyMapping: appDeclaration.eventWorkflowTriggerKeyMapping,
45
+ keywords: appDeclaration.keywords,
46
+ configProperties: ConfigPropertiesParser.getConfigProperties(appDeclaration.appConfiguration),
47
+ triggerKeyDefinitions: TriggerKeyDefinitionParser.buildTriggersArray(appDeclaration),
48
+ };
49
+ const app = await new Entities().create({ entityName: 'app', object: newApp });
50
+ console.log(`%s Created new app: ${app.name}`, chalk.yellow.bold('APP'));
51
+ return app;
52
+ }
53
+ async updateExistingApp(appDeclaration, existingApp) {
54
+ const updates = {
55
+ name: appDeclaration.appName,
56
+ public: appDeclaration.visibility === 'public',
57
+ description: appDeclaration.appDescription,
58
+ publisher: appDeclaration.publisher,
59
+ thumbnail: appDeclaration.thumbnail,
60
+ eventWorkflowTriggerKeyMapping: appDeclaration.eventWorkflowTriggerKeyMapping,
61
+ keywords: appDeclaration.keywords,
62
+ configProperties: ConfigPropertiesParser.getConfigProperties(appDeclaration.appConfiguration),
63
+ triggerKeyDefinitions: TriggerKeyDefinitionParser.buildTriggersArray(appDeclaration),
64
+ };
65
+ const app = await new Entities().update({ entityName: 'app', id: existingApp.id, object: updates });
66
+ console.log(`%s Updated app: ${app.name}`, chalk.yellow.bold('APP'));
67
+ return app;
68
+ }
69
+ async remove(appDeclaration) {
70
+ let app = await this.getExistingApp(appDeclaration);
71
+ if (app) {
72
+ app = await new Entities().delete({ entityName: 'app', id: app.id });
73
+ console.log(`%s Deleted app: ${app.name}`, chalk.yellow.bold('APP'));
74
+ }
75
+ else {
76
+ throw new Error('App not found.');
77
+ }
78
+ }
79
+ }
@@ -0,0 +1,7 @@
1
+ import { AppDeclaration, TriggerKeyDefinition, ConfigPropertyElements } from './interfaces';
2
+ export declare class TriggerKeyDefinitionParser {
3
+ static buildTriggersArray(appDeclaration: AppDeclaration): Array<TriggerKeyDefinition>;
4
+ }
5
+ export declare class ConfigPropertiesParser {
6
+ static getConfigProperties(configPropertyElements: ConfigPropertyElements): any[];
7
+ }
@@ -0,0 +1,37 @@
1
+ export class TriggerKeyDefinitionParser {
2
+ static buildTriggersArray(appDeclaration) {
3
+ const triggers = [];
4
+ for (const triggerName of Object.keys(appDeclaration.triggers)) {
5
+ const triggerDeclaration = appDeclaration.triggers[triggerName];
6
+ const triggerDefinition = {
7
+ triggerKey: triggerDeclaration.external ? `${appDeclaration.appIdentifier}:${triggerDeclaration.key}` : triggerDeclaration.key,
8
+ name: triggerDeclaration.name,
9
+ external: triggerDeclaration.external,
10
+ description: triggerDeclaration.description,
11
+ };
12
+ if (!triggerDefinition.triggerKey || !triggerDefinition.name) {
13
+ throw new Error('Illegal trigger declaration: must have key and name');
14
+ }
15
+ triggers.push(triggerDefinition);
16
+ }
17
+ return triggers;
18
+ }
19
+ }
20
+ export class ConfigPropertiesParser {
21
+ static getConfigProperties(configPropertyElements) {
22
+ const appConfiguration = [];
23
+ for (const configKey of Object.keys(configPropertyElements)) {
24
+ const declaration = configPropertyElements[configKey];
25
+ const config = {
26
+ label: declaration.label,
27
+ slug: configKey,
28
+ propertyType: declaration.propertyType,
29
+ };
30
+ if (declaration.options) {
31
+ config.options = declaration.options;
32
+ }
33
+ appConfiguration.push(config);
34
+ }
35
+ return appConfiguration;
36
+ }
37
+ }
@@ -1,2 +1,2 @@
1
- export declare function deployApp(args: any): Promise<void>;
2
- export declare function removeApp(args: any): Promise<void>;
1
+ export declare function deployApp(args: any): Promise<void>;
2
+ export declare function removeApp(args: any): Promise<void>;
@@ -1,30 +1,56 @@
1
- import chalk from 'chalk';
2
- import fs from 'fs';
3
- import { authUser } from '../auth/login';
4
- import { AppDeployer } from './app-deployer';
5
- const yaml = require('js-yaml');
6
- function loadAppConfig() {
7
- const TARGET_DIR = process.cwd();
8
- try {
9
- const doc = yaml.load(fs.readFileSync(TARGET_DIR + '/app.yml', 'utf8'));
10
- console.log(doc);
11
- return doc;
12
- }
13
- catch (e) {
14
- console.log('ERROR PARSING YAML: ', e);
15
- }
16
- }
17
- export async function deployApp(args) {
18
- const appDeclaration = loadAppConfig();
19
- console.log(`%s Deploying application. ${appDeclaration.appIdentifier}`, chalk.blue.bold('START'));
20
- const user = await authUser();
21
- await new AppDeployer().deploy(appDeclaration);
22
- console.log('%s Deployment complete.', chalk.green.bold('COMPLETE'));
23
- }
24
- export async function removeApp(args) {
25
- const appDeclaration = loadAppConfig();
26
- console.log(`%s Removing application. ${appDeclaration.appIdentifier}`, chalk.blue.bold('START'));
27
- await authUser();
28
- await new AppDeployer().remove(appDeclaration);
29
- console.log('%s Removing complete.', chalk.green.bold('COMPLETE'));
30
- }
1
+ import chalk from 'chalk';
2
+ import fs from 'fs';
3
+ import { authUser } from '../auth/login';
4
+ import { AppDeployer } from './app-deployer';
5
+ const yaml = require('js-yaml');
6
+ function loadAppConfig() {
7
+ const TARGET_DIR = process.cwd();
8
+ try {
9
+ const doc = yaml.load(fs.readFileSync(TARGET_DIR + '/app.yml', 'utf8'));
10
+ console.log(doc);
11
+ return doc;
12
+ }
13
+ catch (e) {
14
+ throw new Error(`ERROR PARSING YAML: ${e}`);
15
+ }
16
+ }
17
+ export async function deployApp(args) {
18
+ let appDeclaration;
19
+ try {
20
+ appDeclaration = loadAppConfig();
21
+ }
22
+ catch (e) {
23
+ console.log(`%s Application Deployment Failed. ${e}`, chalk.red.bold('FAIL'));
24
+ return;
25
+ }
26
+ console.log(`%s Deploying Application. ${appDeclaration.appIdentifier}`, chalk.blue.bold('START'));
27
+ try {
28
+ await authUser();
29
+ await new AppDeployer().deploy(appDeclaration);
30
+ }
31
+ catch (e) {
32
+ console.log(`%s Application Deployment Failed. ${e}`, chalk.red.bold('FAIL'));
33
+ return;
34
+ }
35
+ console.log('%s Deployment Complete.', chalk.green.bold('COMPLETE'));
36
+ }
37
+ export async function removeApp(args) {
38
+ let appDeclaration;
39
+ try {
40
+ appDeclaration = loadAppConfig();
41
+ }
42
+ catch (e) {
43
+ console.log(`%s Application Removal Failed. ${e}`, chalk.red.bold('FAIL'));
44
+ return;
45
+ }
46
+ console.log(`%s Removing Application. ${appDeclaration.appIdentifier}`, chalk.blue.bold('START'));
47
+ try {
48
+ await authUser();
49
+ await new AppDeployer().remove(appDeclaration);
50
+ }
51
+ catch (e) {
52
+ console.log(`%s Application Removal Failed. ${e}`, chalk.red.bold('FAIL'));
53
+ return;
54
+ }
55
+ console.log('%s Application Removal Complete.', chalk.green.bold('COMPLETE'));
56
+ }
@@ -1,43 +1,74 @@
1
- /** Describes the derivative JSON / object represented
2
- * in app.yml file.
3
- */
4
- export interface AppDeclartion {
5
- appIdentifier: string;
6
- appName: string;
7
- appDescription?: string;
8
- visibility: 'private' | 'public';
9
- publisher: string;
10
- version: string;
11
- thumbnail?: string;
12
- keywords?: Array<string>;
13
- actions?: {
14
- [key: string]: AppActionDeclaration;
15
- };
16
- appConfiguration: {
17
- [key: string]: AppConfigurationElement;
18
- };
19
- }
20
- export interface AppConfigurationElement {
21
- propertyType: string;
22
- options?: any[];
23
- label: string;
24
- }
25
- export interface AppActionDeclaration {
26
- handler: string;
27
- name: string;
28
- description?: string;
29
- }
30
- export interface App {
31
- id: string;
32
- identifier: string;
33
- name: string;
34
- private: boolean;
35
- }
36
- export interface EventWorkflowActionDefinition {
37
- id?: string;
38
- identifier?: string;
39
- name?: string;
40
- executeFunctionString?: string;
41
- ownerKey?: string;
42
- public?: boolean;
43
- }
1
+ /** Describes the derivative JSON / object represented
2
+ * in app.yml file.
3
+ */
4
+ export interface AppDeclaration {
5
+ appIdentifier: string;
6
+ appName: string;
7
+ appDescription?: string;
8
+ visibility: 'private' | 'public';
9
+ publisher: string;
10
+ version: string;
11
+ eventWorkflowTriggerKeyMapping: string;
12
+ thumbnail?: string;
13
+ keywords?: Array<string>;
14
+ actions?: {
15
+ [key: string]: AppActionDeclaration;
16
+ };
17
+ appConfiguration: ConfigPropertyElements;
18
+ triggers: {
19
+ [key: string]: AppTriggerDeclaration;
20
+ };
21
+ }
22
+ export interface ConfigPropertyElements {
23
+ [key: string]: ConfigPropertyElement;
24
+ }
25
+ export interface ConfigPropertyElement {
26
+ propertyType: string;
27
+ options?: any[];
28
+ label: string;
29
+ }
30
+ export interface AppActionDeclaration {
31
+ handler: string;
32
+ name: string;
33
+ description?: string;
34
+ actionConfiguration: ConfigPropertyElements;
35
+ }
36
+ export interface AppTriggerDeclaration {
37
+ key: string;
38
+ name: string;
39
+ external?: boolean;
40
+ description?: string;
41
+ }
42
+ export interface App {
43
+ id: string;
44
+ identifier: string;
45
+ name: string;
46
+ public: boolean;
47
+ description?: string;
48
+ publisher: string;
49
+ thumbnail: string;
50
+ eventWorkflowTriggerKeyMapping: string;
51
+ configProperties?: ConfigProperty[];
52
+ triggerKeyDefinitions?: TriggerKeyDefinition[];
53
+ }
54
+ export declare class ConfigProperty {
55
+ slug: string;
56
+ propertyType: string;
57
+ options?: any[];
58
+ label: string;
59
+ }
60
+ export interface EventWorkflowActionDefinition {
61
+ id?: string;
62
+ identifier?: string;
63
+ name?: string;
64
+ executeFunctionString?: string;
65
+ ownerKey?: string;
66
+ public?: boolean;
67
+ configProperties?: ConfigProperty[];
68
+ }
69
+ export declare class TriggerKeyDefinition {
70
+ name: string;
71
+ description?: string;
72
+ triggerKey: string;
73
+ external?: boolean;
74
+ }
@@ -0,0 +1,4 @@
1
+ export class ConfigProperty {
2
+ }
3
+ export class TriggerKeyDefinition {
4
+ }