@contrail/cli 3.1.0 → 3.1.2
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 +1 -1
- package/dist/api/types.d.ts +1 -0
- package/dist/api/types.js +7 -1
- package/dist/commands/app/create.js +10 -0
- package/dist/commands/app/extension/deploy.js +5 -4
- package/dist/commands/types/getAll.js +1 -0
- package/dist/helpers/app/app-template-parsers.js +1 -0
- package/dist/interfaces.d.ts +1 -0
- package/oclif.manifest.json +1 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -17,7 +17,7 @@ $ npm install -g @contrail/cli
|
|
|
17
17
|
$ contrail COMMAND
|
|
18
18
|
running command...
|
|
19
19
|
$ contrail (--version)
|
|
20
|
-
@contrail/cli/3.1.
|
|
20
|
+
@contrail/cli/3.1.2 darwin-arm64 node-v20.18.0
|
|
21
21
|
$ contrail --help [COMMAND]
|
|
22
22
|
USAGE
|
|
23
23
|
$ contrail COMMAND
|
package/dist/api/types.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export declare function getOptionSets(): Promise<any[]>;
|
|
2
|
+
export declare function getUserLists(): Promise<any[]>;
|
|
2
3
|
export declare function getOptionSetHierarchies(): Promise<any[]>;
|
|
3
4
|
export declare function getOptionSetHierarchyLinks(): Promise<any[]>;
|
|
4
5
|
export declare function getRuleSets(): Promise<any[]>;
|
package/dist/api/types.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getTypePolicyLinks = exports.getTypePolicies = exports.getTypePropertyPolicyLinks = exports.getTypePropertyPolicies = exports.getUsageInfo = exports.getRuleSetLinks = exports.getRuleSets = exports.getOptionSetHierarchyLinks = exports.getOptionSetHierarchies = exports.getOptionSets = void 0;
|
|
3
|
+
exports.getTypePolicyLinks = exports.getTypePolicies = exports.getTypePropertyPolicyLinks = exports.getTypePropertyPolicies = exports.getUsageInfo = exports.getRuleSetLinks = exports.getRuleSets = exports.getOptionSetHierarchyLinks = exports.getOptionSetHierarchies = exports.getUserLists = exports.getOptionSets = void 0;
|
|
4
4
|
const sdk_1 = require("@contrail/sdk");
|
|
5
5
|
async function getOptionSets() {
|
|
6
6
|
return await new sdk_1.Entities().get({
|
|
@@ -8,6 +8,12 @@ async function getOptionSets() {
|
|
|
8
8
|
});
|
|
9
9
|
}
|
|
10
10
|
exports.getOptionSets = getOptionSets;
|
|
11
|
+
async function getUserLists() {
|
|
12
|
+
return await new sdk_1.Entities().get({
|
|
13
|
+
entityName: 'user-list',
|
|
14
|
+
});
|
|
15
|
+
}
|
|
16
|
+
exports.getUserLists = getUserLists;
|
|
11
17
|
async function getOptionSetHierarchies() {
|
|
12
18
|
const entitiesClient = new sdk_1.Entities();
|
|
13
19
|
return await entitiesClient.get({
|
|
@@ -7,6 +7,8 @@ const login_1 = require("../../auth/login");
|
|
|
7
7
|
const basecommand_1 = require("../../basecommand");
|
|
8
8
|
const setup_template_1 = require("../../helpers/app/setup-template");
|
|
9
9
|
const logger_1 = tslib_1.__importDefault(require("../../logger"));
|
|
10
|
+
const app_deployer_1 = require("../../helpers/app/app-deployer");
|
|
11
|
+
const load_app_config_1 = require("../../helpers/app/load-app-config");
|
|
10
12
|
class CreateApp extends basecommand_1.BaseCommand {
|
|
11
13
|
static description = 'Create a new app. The current organization will be set as the owner of the app';
|
|
12
14
|
static examples = [
|
|
@@ -80,6 +82,14 @@ class CreateApp extends basecommand_1.BaseCommand {
|
|
|
80
82
|
appDescription: answers.appDescription,
|
|
81
83
|
appPublisher: answers.appPublisher,
|
|
82
84
|
});
|
|
85
|
+
try {
|
|
86
|
+
let appDeclaration = (0, load_app_config_1.loadAppConfig)();
|
|
87
|
+
await new app_deployer_1.AppDeployer().deploy(appDeclaration);
|
|
88
|
+
}
|
|
89
|
+
catch (error) {
|
|
90
|
+
logger_1.default.error(`Failed to deploy the app: ${error}`);
|
|
91
|
+
this.exit(1);
|
|
92
|
+
}
|
|
83
93
|
}
|
|
84
94
|
}
|
|
85
95
|
exports.default = CreateApp;
|
|
@@ -100,17 +100,18 @@ class DeployExtension extends basecommand_1.BaseCommand {
|
|
|
100
100
|
throw new Error('No extensions defined in app.yml.');
|
|
101
101
|
}
|
|
102
102
|
const extensionDecl = extensions.find((ext) => ext.identifier === extensionIdentifier);
|
|
103
|
+
const message = `Extension '${extensionIdentifier}' not found in app.yml.`;
|
|
103
104
|
if (!extensionDecl) {
|
|
104
|
-
logger_1.default.info(`${chalk_1.default.red.bold('FAIL')}
|
|
105
|
-
|
|
105
|
+
logger_1.default.info(`${chalk_1.default.red.bold('FAIL')} ${message}`);
|
|
106
|
+
throw new Error(message);
|
|
106
107
|
}
|
|
107
108
|
return extensionDecl;
|
|
108
109
|
}
|
|
109
110
|
getExtensionDirectory(extensionIdentifier) {
|
|
110
111
|
const extensionDir = path.resolve(process.cwd(), 'extensions', extensionIdentifier);
|
|
111
112
|
if (!fs.existsSync(extensionDir)) {
|
|
112
|
-
logger_1.default.info(`${chalk_1.default.red.bold('FAIL')}
|
|
113
|
-
|
|
113
|
+
logger_1.default.info(`${chalk_1.default.red.bold('FAIL')} ${extensionDir} does not exist.`);
|
|
114
|
+
throw new Error(`${extensionDir} does not exist.`);
|
|
114
115
|
}
|
|
115
116
|
return extensionDir;
|
|
116
117
|
}
|
|
@@ -64,6 +64,7 @@ async function getAll(outDir, overwrite) {
|
|
|
64
64
|
typePolicyLinks: await (0, types_1.getTypePolicyLinks)(),
|
|
65
65
|
orgUsers: await (0, users_1.getUserOrgs)(),
|
|
66
66
|
groups: await (0, users_1.getGroups)(),
|
|
67
|
+
userList: await (0, types_1.getUserLists)(),
|
|
67
68
|
};
|
|
68
69
|
const reducedData = await (0, types_2.getAllReducedTypes)(data);
|
|
69
70
|
await saveData(reducedData, outDir, overwrite);
|
package/dist/interfaces.d.ts
CHANGED
package/oclif.manifest.json
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@contrail/cli",
|
|
3
|
-
"version": "3.1.
|
|
3
|
+
"version": "3.1.2",
|
|
4
4
|
"description": "VibeIQ's Contrail Platform CLI.",
|
|
5
5
|
"bin": {
|
|
6
6
|
"contrail-cli": "./bin/run",
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
],
|
|
24
24
|
"dependencies": {
|
|
25
25
|
"@contrail/entity-types": "^1.1.17",
|
|
26
|
-
"@contrail/org-config-migration": "^1.1.
|
|
26
|
+
"@contrail/org-config-migration": "^1.1.4",
|
|
27
27
|
"@contrail/sdk": "^1.4.6",
|
|
28
28
|
"@contrail/types": "^3.0.48",
|
|
29
29
|
"@contrail/util": "^1.1.10",
|