@contrail/cli 2.0.13 → 2.0.15
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 +3 -3
- package/dist/commands/app/uninstall.js +2 -2
- package/dist/commands/app/upgrade.js +3 -0
- package/dist/templates/typescript/package.json +2 -2
- package/dist/templates/typescript/src/framework/action-dispatcher.ts +2 -0
- package/oclif.manifest.json +3 -3
- package/package.json +1 -1
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.0.
|
|
18
|
+
@contrail/cli/2.0.15 darwin-arm64 node-v18.13.0
|
|
19
19
|
$ contrail --help [COMMAND]
|
|
20
20
|
USAGE
|
|
21
21
|
$ contrail COMMAND
|
|
@@ -177,10 +177,10 @@ Uninstall an app that is currently installed
|
|
|
177
177
|
|
|
178
178
|
```
|
|
179
179
|
USAGE
|
|
180
|
-
$ contrail app uninstall [-
|
|
180
|
+
$ contrail app uninstall [-i <value>]
|
|
181
181
|
|
|
182
182
|
FLAGS
|
|
183
|
-
-
|
|
183
|
+
-i, --appIdentifier=<value> The identifier of the app to uninstall. The identifier can be found on the app's page in
|
|
184
184
|
the marketplace.
|
|
185
185
|
|
|
186
186
|
DESCRIPTION
|
|
@@ -9,7 +9,7 @@ const sdk_1 = require("@contrail/sdk");
|
|
|
9
9
|
const apps_1 = require("../../api/apps");
|
|
10
10
|
class UninstallApp extends core_1.Command {
|
|
11
11
|
async run() {
|
|
12
|
-
const {
|
|
12
|
+
const { flags } = await this.parse(UninstallApp);
|
|
13
13
|
await (0, login_1.authUser)();
|
|
14
14
|
const installedApps = await (0, apps_1.getInstalledApps)();
|
|
15
15
|
if (!flags.appIdentifier) {
|
|
@@ -51,7 +51,7 @@ UninstallApp.examples = [
|
|
|
51
51
|
// variable argument length
|
|
52
52
|
UninstallApp.strict = true;
|
|
53
53
|
UninstallApp.flags = {
|
|
54
|
-
appIdentifier: core_1.Flags.string({ char: '
|
|
54
|
+
appIdentifier: core_1.Flags.string({ char: 'i', description: 'The identifier of the app to uninstall. The identifier can be found on the app\'s page in the marketplace.', required: false }),
|
|
55
55
|
};
|
|
56
56
|
function delay(ms) {
|
|
57
57
|
return new Promise(resolve => setTimeout(resolve, ms));
|
|
@@ -25,6 +25,9 @@ class UpgradeApp extends core_1.Command {
|
|
|
25
25
|
}
|
|
26
26
|
const appOrgToUpgrade = installedApps.find(x => x.app.identifier === flags.appIdentifier);
|
|
27
27
|
const appToUpgrade = allApps.find(x => x.identifier === flags.appIdentifier);
|
|
28
|
+
if (!appToUpgrade) {
|
|
29
|
+
throw new Error(`App ${flags.appIdentifier} not found`);
|
|
30
|
+
}
|
|
28
31
|
const versions = await (0, apps_1.getAppVersions)(appToUpgrade);
|
|
29
32
|
let versionToUpgrade;
|
|
30
33
|
if (flags.latest) {
|
|
@@ -38,14 +38,14 @@
|
|
|
38
38
|
"license": "ISC",
|
|
39
39
|
"dependencies": {
|
|
40
40
|
"@contrail/sdk": "^1.1.54",
|
|
41
|
-
"chalk": "^4.0.0"
|
|
41
|
+
"chalk": "^4.0.0",
|
|
42
|
+
"js-yaml": "^4.1.0"
|
|
42
43
|
},
|
|
43
44
|
"devDependencies": {
|
|
44
45
|
"@types/node": "^18.14.6",
|
|
45
46
|
"body-parser": "^1.20.2",
|
|
46
47
|
"express": "^4.18.2",
|
|
47
48
|
"jest": "^29.2.2",
|
|
48
|
-
"js-yaml": "^4.1.0",
|
|
49
49
|
"nodemon": "^1.19.4",
|
|
50
50
|
"ts-jest": "^29.0.3",
|
|
51
51
|
"ts-node": "^7.0.1",
|
|
@@ -8,6 +8,7 @@ import { setAppCredentials } from "@contrail/sdk";
|
|
|
8
8
|
import { loadAppConfig } from "./app-config";
|
|
9
9
|
import { AppActionCallbackStatus, AppActionRequest, AppActionResponse } from "./interfaces";
|
|
10
10
|
import { Logger } from "./logger";
|
|
11
|
+
var pjson = require('../../package.json');
|
|
11
12
|
|
|
12
13
|
const APP_CONFIG = loadAppConfig();
|
|
13
14
|
const appName = APP_CONFIG.appIdentifier;
|
|
@@ -23,6 +24,7 @@ export class ActionDispatcher {
|
|
|
23
24
|
? JSON.parse(data.event)
|
|
24
25
|
: data.event;
|
|
25
26
|
|
|
27
|
+
logger.log(`App Info: `, pjson.name, ':', pjson.version);
|
|
26
28
|
return ActionDispatcher.delegateToHandler(event, data, logger);
|
|
27
29
|
}
|
|
28
30
|
|
package/oclif.manifest.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "2.0.
|
|
2
|
+
"version": "2.0.15",
|
|
3
3
|
"commands": {
|
|
4
4
|
"app:create": {
|
|
5
5
|
"id": "app:create",
|
|
@@ -128,8 +128,8 @@
|
|
|
128
128
|
"appIdentifier": {
|
|
129
129
|
"name": "appIdentifier",
|
|
130
130
|
"type": "option",
|
|
131
|
-
"char": "
|
|
132
|
-
"description": "The identifier of the app to
|
|
131
|
+
"char": "i",
|
|
132
|
+
"description": "The identifier of the app to uninstall. The identifier can be found on the app's page in the marketplace.",
|
|
133
133
|
"required": false,
|
|
134
134
|
"multiple": false
|
|
135
135
|
}
|