@contrail/cli 1.0.69 → 1.0.71

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@contrail/cli",
3
- "version": "1.0.69",
3
+ "version": "1.0.71",
4
4
  "description": "VibeIQ's Contrail Platform CLI.",
5
5
  "main": "lib/index.js",
6
6
  "bin": {
@@ -1,10 +1,10 @@
1
- appIdentifier: "@your-co/app-name"
2
- appName: "Your App Name"
3
- appDescription: "Your app description."
4
- visibility: private
5
- publisher: "Your company name"
1
+ appIdentifier: "@your-co/app-name" # Change to be your company root domain and the name of the app
2
+ appName: "Your App Name" # Give your app a name
3
+ appDescription: "Your app description." # Give your app a description
4
+ visibility: private # This should be private unless you want to develop an app for all VibeIQ customers to use
5
+ publisher: "Your company name" # Your company name, used for public apps
6
6
  version: 1.0
7
- dockerImageRef: CHANGE_ME
7
+ dockerImageRef: CHANGE_ME # For VibeIQ Deployment... for use by VibeIQ employees only
8
8
 
9
9
  # Properties you can configure when you install the app.
10
10
  # These property values will be available to all of your actions when they run
@@ -18,13 +18,13 @@ appConfiguration:
18
18
  # should match the name of a 'handler' in the /actions folder.
19
19
  # See documentation on how to implement actions.
20
20
  actions:
21
- exampleAction:
21
+ logItem:
22
22
  name: "Log Item"
23
23
  description: "Fetches an item from the API and returns it to the log."
24
24
  async: false
25
25
  actionConfiguration:
26
26
  message:
27
- label: "Additinoal message to log."
27
+ label: "Additional message to log."
28
28
  propertyType: "string"
29
29
 
30
30
  workflows:
@@ -4,6 +4,7 @@
4
4
  */
5
5
 
6
6
 
7
+ import { setAppCredentials } from "@contrail/sdk";
7
8
  import { loadAppConfig } from "./app-config";
8
9
  import { AppActionCallbackStatus, AppActionRequest, AppActionResponse } from "./interfaces";
9
10
  import { Logger } from "./logger";
@@ -14,6 +15,9 @@ const appName = APP_CONFIG.appIdentifier;
14
15
  export class ActionDispatcher {
15
16
 
16
17
  public static async dispatchActionRequest(data: AppActionRequest) : Promise<AppActionResponse> {
18
+ // Sets the auth creds on the SDK
19
+ await setAppCredentials(data.apiKey, data.orgSlug);
20
+
17
21
  const logger = new Logger();
18
22
  const event = (typeof data.event === 'string')
19
23
  ? JSON.parse(data.event)
@@ -1,11 +1,11 @@
1
- /**
2
- * WARNING: Do not modify this file, it is part of the generic runtime handling logic
3
- * for VibeIQ app actions.
4
- */
5
-
6
-
7
- import { AppActionRequest, AppActionResponse, ActionDispatcher } from '.';
8
-
9
- export async function execute(data: AppActionRequest): Promise<AppActionResponse> {
10
- return ActionDispatcher.dispatchActionRequest(data);
11
- }
1
+ /**
2
+ * WARNING: Do not modify this file, it is part of the generic runtime handling logic
3
+ * for VibeIQ app actions.
4
+ */
5
+
6
+
7
+ import { AppActionRequest, AppActionResponse, ActionDispatcher } from '.';
8
+
9
+ export async function execute(data: AppActionRequest): Promise<AppActionResponse> {
10
+ return ActionDispatcher.dispatchActionRequest(data);
11
+ }
@@ -1,21 +1,21 @@
1
- /**
2
- * WARNING: Do not modify this file, it is part of the generic runtime handling logic
3
- * for VibeIQ app actions.
4
- */
5
-
6
-
7
- export class Logger {
8
- allEntries : Array<string> = [];
9
- public log(...args){
10
- console.log(...args);
11
- this.allEntries.push(new Date().toISOString() + ': ' + args.join(''));
12
- }
13
-
14
- public getEntries(){
15
- return this.allEntries.join('\n');
16
- }
17
-
18
- public clearEntries(){
19
- this.allEntries = [];
20
- }
21
- }
1
+ /**
2
+ * WARNING: Do not modify this file, it is part of the generic runtime handling logic
3
+ * for VibeIQ app actions.
4
+ */
5
+
6
+
7
+ export class Logger {
8
+ allEntries : Array<string> = [];
9
+ public log(...args){
10
+ console.log(...args);
11
+ this.allEntries.push(new Date().toISOString() + ': ' + args.join(''));
12
+ }
13
+
14
+ public getEntries(){
15
+ return this.allEntries.join('\n');
16
+ }
17
+
18
+ public clearEntries(){
19
+ this.allEntries = [];
20
+ }
21
+ }
@@ -1,31 +1,31 @@
1
- /**
2
- * WARNING: Do not modify this file, it is part of the generic runtime handling logic
3
- * for VibeIQ app actions.
4
- */
5
-
6
-
7
- import { execute } from './handler';
8
-
9
- const express = require('express');
10
- const bodyParser = require('body-parser');
11
- const app = express();
12
- const port = 5050;
13
-
14
- // parse application/x-www-form-urlencoded
15
- app.use(bodyParser.urlencoded({ extended: false }));
16
- // parse application/json
17
- app.use(bodyParser.json());
18
-
19
- app.get('/health_check', (req, res) => {
20
- res.send('Hello World!');
21
- });
22
-
23
- // DO NOT CHANGE THIS IMPLEMENTATION
24
- app.post('/', async (req, res) => {
25
- const result = await execute(req.body);
26
- res.send(result);
27
- });
28
-
29
- app.listen(port, () => {
30
- console.log(`Mock server listening on port ${port}`);
31
- });
1
+ /**
2
+ * WARNING: Do not modify this file, it is part of the generic runtime handling logic
3
+ * for VibeIQ app actions.
4
+ */
5
+
6
+
7
+ import { execute } from './handler';
8
+
9
+ const express = require('express');
10
+ const bodyParser = require('body-parser');
11
+ const app = express();
12
+ const port = 5050;
13
+
14
+ // parse application/x-www-form-urlencoded
15
+ app.use(bodyParser.urlencoded({ extended: false }));
16
+ // parse application/json
17
+ app.use(bodyParser.json());
18
+
19
+ app.get('/health_check', (req, res) => {
20
+ res.send('Hello World!');
21
+ });
22
+
23
+ // DO NOT CHANGE THIS IMPLEMENTATION
24
+ app.post('/', async (req, res) => {
25
+ const result = await execute(req.body);
26
+ res.send(result);
27
+ });
28
+
29
+ app.listen(port, () => {
30
+ console.log(`Mock server listening on port ${port}`);
31
+ });