@contrail/cli 2.1.8 → 2.1.10

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
@@ -15,7 +15,7 @@ $ npm install -g @contrail/cli
15
15
  $ contrail COMMAND
16
16
  running command...
17
17
  $ contrail (--version)
18
- @contrail/cli/2.1.8 darwin-arm64 node-v18.13.0
18
+ @contrail/cli/2.1.10 darwin-arm64 node-v18.13.0
19
19
  $ contrail --help [COMMAND]
20
20
  USAGE
21
21
  $ contrail COMMAND
@@ -48,6 +48,7 @@ class AppDeployer {
48
48
  if (appDeclaration === null || appDeclaration === void 0 ? void 0 : appDeclaration.appConfiguration) {
49
49
  configProperties = app_template_parsers_1.ConfigPropertiesParser.getConfigProperties(appDeclaration.appConfiguration);
50
50
  }
51
+ const externalLinks = appDeclaration.externalLinks ? app_template_parsers_1.ExternalLinkParser.validateAndGetExternalLinks(appDeclaration.externalLinks) : [];
51
52
  let triggerKeyDefinitions;
52
53
  if (appDeclaration === null || appDeclaration === void 0 ? void 0 : appDeclaration.triggers) {
53
54
  triggerKeyDefinitions = app_template_parsers_1.TriggerKeyDefinitionParser.buildTriggersArray(appDeclaration);
@@ -63,6 +64,7 @@ class AppDeployer {
63
64
  eventWorkflowTriggerKeyMapping: appDeclaration.eventWorkflowTriggerKeyMapping,
64
65
  keywords: appDeclaration.keywords,
65
66
  configProperties,
67
+ externalLinks,
66
68
  triggerKeyDefinitions,
67
69
  dockerImageRef: (_a = appDeclaration.dockerImageRef) !== null && _a !== void 0 ? _a : null,
68
70
  frameworkVersion: 2,
@@ -99,6 +101,7 @@ class AppDeployer {
99
101
  const appCodePackage = await createNodePackage(appDeclaration.appIdentifier, this.debug, this.dryRun);
100
102
  appCodePackageId = appCodePackage.id;
101
103
  }
104
+ const externalLinks = appDeclaration.externalLinks ? app_template_parsers_1.ExternalLinkParser.validateAndGetExternalLinks(appDeclaration.externalLinks) : [];
102
105
  const updates = {
103
106
  name: appDeclaration.appName,
104
107
  public: appDeclaration.visibility === 'public',
@@ -109,6 +112,7 @@ class AppDeployer {
109
112
  eventWorkflowTriggerKeyMapping: appDeclaration.eventWorkflowTriggerKeyMapping,
110
113
  keywords: appDeclaration.keywords,
111
114
  configProperties,
115
+ externalLinks,
112
116
  triggerKeyDefinitions,
113
117
  dockerImageRef: (_a = appDeclaration.dockerImageRef) !== null && _a !== void 0 ? _a : null,
114
118
  appCodePackageId: appCodePackageId !== null && appCodePackageId !== void 0 ? appCodePackageId : null,
@@ -1,3 +1,4 @@
1
+ import { ExternalLink } from '@contrail/entity-types';
1
2
  import { AppDeclaration, TriggerKeyDefinition, ConfigPropertyElements } from '../../interfaces';
2
3
  export declare class TriggerKeyDefinitionParser {
3
4
  static buildTriggersArray(appDeclaration: AppDeclaration): Array<TriggerKeyDefinition>;
@@ -5,3 +6,6 @@ export declare class TriggerKeyDefinitionParser {
5
6
  export declare class ConfigPropertiesParser {
6
7
  static getConfigProperties(configPropertyElements: ConfigPropertyElements): any[];
7
8
  }
9
+ export declare class ExternalLinkParser {
10
+ static validateAndGetExternalLinks(externalLinks: ExternalLink[]): ExternalLink[];
11
+ }
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ConfigPropertiesParser = exports.TriggerKeyDefinitionParser = void 0;
3
+ exports.ExternalLinkParser = exports.ConfigPropertiesParser = exports.TriggerKeyDefinitionParser = void 0;
4
4
  class TriggerKeyDefinitionParser {
5
5
  static buildTriggersArray(appDeclaration) {
6
6
  const triggers = [];
@@ -41,3 +41,33 @@ class ConfigPropertiesParser {
41
41
  }
42
42
  }
43
43
  exports.ConfigPropertiesParser = ConfigPropertiesParser;
44
+ class ExternalLinkParser {
45
+ static validateAndGetExternalLinks(externalLinks) {
46
+ if (typeof externalLinks !== 'object' || !Array.isArray(externalLinks)) {
47
+ throw new Error('externalLinks must be an array');
48
+ }
49
+ for (const link of externalLinks) {
50
+ if (!link.name || typeof link.name !== 'string') {
51
+ throw new Error('externalLinks must have a url property (string)');
52
+ }
53
+ if (!link.link || typeof link.link !== 'string') {
54
+ throw new Error('externalLinks must have a link property (string)');
55
+ }
56
+ if (link.extraAttributes) {
57
+ if (!Array.isArray(link.extraAttributes)) {
58
+ throw new Error('optional externalLinks[].extraAttributes must be an array of objects');
59
+ }
60
+ for (const attr of link.extraAttributes) {
61
+ if (!attr.name || typeof attr.name !== 'string') {
62
+ throw new Error(`externalLinks[].extraAttributes must have a name property (string). Found ${JSON.stringify(attr)}`);
63
+ }
64
+ if (!attr.value || typeof attr.value !== 'string') {
65
+ throw new Error(`externalLinks[].extraAttributes must have a value property (string). Found ${JSON.stringify(attr)}`);
66
+ }
67
+ }
68
+ }
69
+ }
70
+ return externalLinks;
71
+ }
72
+ }
73
+ exports.ExternalLinkParser = ExternalLinkParser;
@@ -1,3 +1,4 @@
1
+ import { ExternalLink } from '@contrail/entity-types';
1
2
  /** Describes the derivative JSON / object represented
2
3
  * in app.yml file.
3
4
  */
@@ -16,6 +17,7 @@ export interface AppDeclaration {
16
17
  [key: string]: AppActionDeclaration;
17
18
  };
18
19
  appConfiguration: ConfigPropertyElements;
20
+ externalLinks: ExternalLink[];
19
21
  triggers: {
20
22
  [key: string]: AppTriggerDeclaration;
21
23
  };
@@ -1,10 +1,5 @@
1
- ### building and uploading docker image to ECR
2
- 1. set AWS_REGISTRY environment variable to be able to tag and/or push to ECR
3
- ### Example: xxx.dkr.ecr.us-east-1.amazonaws.com
4
- 1. To build, run, tag, and push using docker, there are npm scripts that can be used.
5
- 2. The npm scripts use the npm package name, version, and config fields to set the appropriate values
6
- 3. OPTIONAL: if you want to inspect the container you can run `npm run docker-run-entry`
7
- 4. OPTIONAL: if you want to run this locally using port 9000, you can run `npm run docker-run`
8
- 5. To tag the image for pushing to ECR `npm run docker-tag`
9
- 6. To push the image to ECR `npm run docker-push`
10
- 7. All the npm scripts have a ':win" version to run on windows
1
+ ### Running your app
2
+ Run `npm run start` at the root directory of your app (where the `package.json` file is located).
3
+
4
+ ### Publishing your app
5
+ Run `contrail app publish` to publish a new version of the app.
@@ -22,7 +22,7 @@
22
22
  "author": "",
23
23
  "license": "ISC",
24
24
  "dependencies": {
25
- "@contrail/app-framework": "^1.0.9",
25
+ "@contrail/app-framework": "^1.2.2",
26
26
  "@contrail/sdk": "^1.1.54",
27
27
  "chalk": "^4.0.0",
28
28
  "js-yaml": "^4.1.0"
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "2.1.8",
2
+ "version": "2.1.10",
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.8",
3
+ "version": "2.1.10",
4
4
  "description": "VibeIQ's Contrail Platform CLI.",
5
5
  "bin": {
6
6
  "contrail-cli": "./bin/run",
@@ -22,6 +22,7 @@
22
22
  "/oclif.manifest.json"
23
23
  ],
24
24
  "dependencies": {
25
+ "@contrail/entity-types": "^1.1.9",
25
26
  "@contrail/sdk": "^1.2.3",
26
27
  "@contrail/types": "^3.0.20",
27
28
  "@contrail/util": "^1.0.17",