@contrail/cli 1.0.36 → 1.0.38

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.
@@ -25,7 +25,8 @@ export class ConfigPropertiesParser {
25
25
  const config = {
26
26
  label: declaration.label,
27
27
  slug: configKey,
28
- propertyType: declaration.propertyType, // TODO should support options
28
+ propertyType: declaration.propertyType,
29
+ dynamic: (declaration === null || declaration === void 0 ? void 0 : declaration.dynamic) || false,
29
30
  };
30
31
  if (declaration.options) {
31
32
  config.options = declaration.options;
@@ -76,8 +76,27 @@ export async function installApp() {
76
76
  configProperties = await getConfigProperties(app);
77
77
  }
78
78
  console.log('%s Installing apps', chalk.green.bold('APP INSTALLATION'));
79
- await installAppToOrg(app, configProperties);
80
- console.log('%s App installed', chalk.green.bold('APP INSTALLATION'));
79
+ const appOrg = await installAppToOrg(app, configProperties);
80
+ // eslint-disable-next-line no-constant-condition
81
+ while (true) {
82
+ await delay(1000);
83
+ try {
84
+ const installingApp = await new Entities().get({ entityName: 'app-org', id: appOrg.id });
85
+ if (installingApp.status === 'READY') {
86
+ console.log('%s App installed', chalk.green.bold('APP INSTALLATION'));
87
+ return;
88
+ }
89
+ if (installingApp.status === 'FAILED_INSTALLING') {
90
+ console.log('%s App installation failed', chalk.red.bold('APP INSTALLATION'));
91
+ return;
92
+ }
93
+ process.stdout.write('.');
94
+ }
95
+ catch (e) {
96
+ console.log('Error is:', e);
97
+ break;
98
+ }
99
+ }
81
100
  }
82
101
  function delay(ms) {
83
102
  return new Promise(resolve => setTimeout(resolve, ms));
@@ -30,6 +30,7 @@ export interface ConfigPropertyElement {
30
30
  propertyType: string;
31
31
  options?: any[];
32
32
  label: string;
33
+ dynamic?: boolean;
33
34
  }
34
35
  export interface AppActionDeclaration {
35
36
  handler: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@contrail/cli",
3
- "version": "1.0.36",
3
+ "version": "1.0.38",
4
4
  "description": "VibeIQ's Contrail Platform CLI.",
5
5
  "main": "lib/index.js",
6
6
  "bin": {
@@ -32,6 +32,7 @@ export class ConfigPropertiesParser {
32
32
  label: declaration.label,
33
33
  slug: configKey,
34
34
  propertyType: declaration.propertyType, // TODO should support options
35
+ dynamic: declaration?.dynamic || false,
35
36
  };
36
37
  if (declaration.options) {
37
38
  config.options = declaration.options;
@@ -78,8 +78,26 @@ export async function installApp() {
78
78
  }
79
79
  console.log('%s Installing apps', chalk.green.bold('APP INSTALLATION'));
80
80
 
81
- await installAppToOrg(app, configProperties);
82
- console.log('%s App installed', chalk.green.bold('APP INSTALLATION'));
81
+ const appOrg = await installAppToOrg(app, configProperties);
82
+ // eslint-disable-next-line no-constant-condition
83
+ while (true) {
84
+ await delay(1000);
85
+ try{
86
+ const installingApp = await new Entities().get({entityName: 'app-org', id: appOrg.id});
87
+ if (installingApp.status === 'READY') {
88
+ console.log('%s App installed', chalk.green.bold('APP INSTALLATION'));
89
+ return;
90
+ }
91
+ if(installingApp.status === 'FAILED_INSTALLING') {
92
+ console.log('%s App installation failed', chalk.red.bold('APP INSTALLATION'));
93
+ return;
94
+ }
95
+ process.stdout.write('.');
96
+ } catch (e) {
97
+ console.log('Error is:', e);
98
+ break;
99
+ }
100
+ }
83
101
  }
84
102
 
85
103
  function delay(ms: number) {
package/src/interfaces.ts CHANGED
@@ -26,6 +26,7 @@ export interface ConfigPropertyElement {
26
26
  propertyType: string;
27
27
  options?: any[];
28
28
  label: string;
29
+ dynamic?: boolean;
29
30
  }
30
31
 
31
32
  export interface AppActionDeclaration {