@contrail/cli 3.0.6 → 3.1.0
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 +63 -267
- package/dist/api/app-extension-deployments.d.ts +2 -0
- package/dist/api/app-extension-deployments.js +11 -0
- package/dist/api/app-extension-packages.d.ts +2 -0
- package/dist/api/app-extension-packages.js +11 -0
- package/dist/api/types.d.ts +0 -1
- package/dist/api/types.js +1 -7
- package/dist/commands/app/create.js +1 -11
- package/dist/commands/app/extension/deploy.d.ts +17 -0
- package/dist/commands/app/extension/deploy.js +118 -0
- package/dist/commands/app/extension/deployment/list.d.ts +14 -0
- package/dist/commands/app/extension/deployment/list.js +82 -0
- package/dist/commands/app/getApiKey.js +1 -1
- package/dist/commands/app/install.js +1 -1
- package/dist/commands/app/publish.js +1 -1
- package/dist/commands/app/uninstall.js +1 -1
- package/dist/commands/app/upgrade.js +1 -1
- package/dist/commands/config/describe.js +1 -1
- package/dist/commands/types/getAll.js +0 -1
- package/dist/helpers/app/app-template-parsers.js +0 -1
- package/dist/helpers/app/extension-package.d.ts +5 -0
- package/dist/helpers/app/extension-package.js +180 -0
- package/dist/interfaces.d.ts +45 -1
- package/dist/interfaces.js +15 -1
- package/oclif.manifest.json +108 -8
- package/package.json +12 -11
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
4
|
+
const sdk_1 = require("@contrail/sdk");
|
|
5
|
+
const core_1 = require("@oclif/core");
|
|
6
|
+
const chalk_1 = tslib_1.__importDefault(require("chalk"));
|
|
7
|
+
const login_1 = require("../../../../auth/login");
|
|
8
|
+
const basecommand_1 = require("../../../../basecommand");
|
|
9
|
+
const extension_package_1 = require("../../../../helpers/app/extension-package");
|
|
10
|
+
const load_app_config_1 = require("../../../../helpers/app/load-app-config");
|
|
11
|
+
const logger_1 = tslib_1.__importDefault(require("../../../../logger"));
|
|
12
|
+
const lodash_1 = require("lodash");
|
|
13
|
+
class ListExtensionDeployments extends basecommand_1.BaseCommand {
|
|
14
|
+
static description = 'List extension deployments';
|
|
15
|
+
static examples = [`$ contrail extension deployment list`];
|
|
16
|
+
static flags = {
|
|
17
|
+
...basecommand_1.BaseCommand.baseFlags,
|
|
18
|
+
all: core_1.Flags.boolean({
|
|
19
|
+
char: 'a',
|
|
20
|
+
description: 'List all extension deployments. By default, only the latest 20 are shown',
|
|
21
|
+
required: false,
|
|
22
|
+
default: false,
|
|
23
|
+
}),
|
|
24
|
+
};
|
|
25
|
+
async run() {
|
|
26
|
+
await (0, login_1.authUser)();
|
|
27
|
+
logger_1.default.info(`%s Listing extension deployments`, chalk_1.default.blue.bold('START'));
|
|
28
|
+
const appDeclaration = (0, load_app_config_1.loadAppConfig)();
|
|
29
|
+
const app = await (0, extension_package_1.getExistingApp)(appDeclaration);
|
|
30
|
+
const packages = this.flags.all
|
|
31
|
+
? await this.getAllExtensionPackages(app.id)
|
|
32
|
+
: await this.getLatest20ExtensionPackages(app.id);
|
|
33
|
+
logger_1.default.debug('packages:', packages);
|
|
34
|
+
const deploymentIds = Array.from(new Set(packages.map((p) => p.deploymentId))).filter((id) => !!id);
|
|
35
|
+
logger_1.default.debug('deploymentIds:', deploymentIds);
|
|
36
|
+
const deployments = await Promise.all(deploymentIds.map((id) => new sdk_1.Entities().get({ entityName: 'app-extension-deployment', id })));
|
|
37
|
+
const deploymentsById = (0, lodash_1.keyBy)(deployments, 'id');
|
|
38
|
+
const uniqueDeploymentUrls = new Set(deployments.map((d) => d.cloudFrontUrl).filter((url) => !!url));
|
|
39
|
+
if (uniqueDeploymentUrls.size > 1) {
|
|
40
|
+
logger_1.default.info(`${chalk_1.default.red.yellow('WARNING')} Multiple extension deployment URLS found for app ${appDeclaration.appIdentifier}`);
|
|
41
|
+
return;
|
|
42
|
+
}
|
|
43
|
+
else if (uniqueDeploymentUrls.size === 0) {
|
|
44
|
+
logger_1.default.info(`${chalk_1.default.red.yellow('WARNING')} No extension deployment URL found for app ${appDeclaration.appIdentifier}`);
|
|
45
|
+
return;
|
|
46
|
+
}
|
|
47
|
+
const tableData = packages.map((extensionPackage) => ({
|
|
48
|
+
'Created At': extensionPackage.createdOn,
|
|
49
|
+
'Package ID': extensionPackage.id,
|
|
50
|
+
Status: deploymentsById[extensionPackage.deploymentId]?.status || '-',
|
|
51
|
+
URL: deploymentsById[extensionPackage.deploymentId]
|
|
52
|
+
? `${deploymentsById[extensionPackage.deploymentId]?.cloudFrontUrl}/packages/${extensionPackage.id}/index.html`
|
|
53
|
+
: '-',
|
|
54
|
+
}));
|
|
55
|
+
console.table(tableData);
|
|
56
|
+
}
|
|
57
|
+
async getLatest20ExtensionPackages(appId) {
|
|
58
|
+
return await new sdk_1.Entities().get({
|
|
59
|
+
entityName: 'app-extension-package',
|
|
60
|
+
criteria: { appId },
|
|
61
|
+
order: [{ orderField: 'createdOn', order: sdk_1.SortOrderOptions.DESC }],
|
|
62
|
+
take: 20,
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
async getAllExtensionPackages(appId) {
|
|
66
|
+
const packages = [];
|
|
67
|
+
let nextPageKey = null;
|
|
68
|
+
do {
|
|
69
|
+
const response = await new sdk_1.Entities().get({
|
|
70
|
+
entityName: 'app-extension-package',
|
|
71
|
+
criteria: { appId },
|
|
72
|
+
order: [{ orderField: 'createdOn', order: sdk_1.SortOrderOptions.DESC }],
|
|
73
|
+
nextPageKey,
|
|
74
|
+
apiVersion: sdk_1.API_VERSION.V2,
|
|
75
|
+
});
|
|
76
|
+
packages.push(...response.results);
|
|
77
|
+
nextPageKey = response.nextPageKey;
|
|
78
|
+
} while (nextPageKey);
|
|
79
|
+
return packages;
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
exports.default = ListExtensionDeployments;
|
|
@@ -8,7 +8,7 @@ const login_1 = require("../../auth/login");
|
|
|
8
8
|
const basecommand_1 = require("../../basecommand");
|
|
9
9
|
const logger_1 = tslib_1.__importDefault(require("../../logger"));
|
|
10
10
|
class GetAPIKeyApp extends basecommand_1.BaseCommand {
|
|
11
|
-
static description = 'Get an api key for an app';
|
|
11
|
+
static description = 'Get an api key for an installed app';
|
|
12
12
|
static examples = [
|
|
13
13
|
`$ contrail app getApiKey
|
|
14
14
|
`,
|
|
@@ -12,7 +12,7 @@ const basecommand_1 = require("../../basecommand");
|
|
|
12
12
|
const logger_1 = tslib_1.__importDefault(require("../../logger"));
|
|
13
13
|
const common_1 = require("../../common");
|
|
14
14
|
class InstallApp extends basecommand_1.BaseCommand {
|
|
15
|
-
static description = 'Install an app from the marketplace';
|
|
15
|
+
static description = 'Install an app from the marketplace to a specific organization';
|
|
16
16
|
static examples = [
|
|
17
17
|
`$ contrail app install --appIdentifier @VibeIQ/Flex-PLM-Connector
|
|
18
18
|
`,
|
|
@@ -11,7 +11,7 @@ const upgrade_1 = require("./upgrade");
|
|
|
11
11
|
const basecommand_1 = require("../../basecommand");
|
|
12
12
|
const logger_1 = tslib_1.__importDefault(require("../../logger"));
|
|
13
13
|
class PublishApp extends basecommand_1.BaseCommand {
|
|
14
|
-
static description = 'Publish the app';
|
|
14
|
+
static description = 'Publish the app to the marketplace. This visibility of your app depends on the app.yml configuration ("visibility" property)';
|
|
15
15
|
static examples = [
|
|
16
16
|
`$ contrail app publish
|
|
17
17
|
`,
|
|
@@ -10,7 +10,7 @@ const apps_1 = require("../../api/apps");
|
|
|
10
10
|
const basecommand_1 = require("../../basecommand");
|
|
11
11
|
const common_1 = require("../../common");
|
|
12
12
|
class UninstallApp extends basecommand_1.BaseCommand {
|
|
13
|
-
static description = 'Uninstall an app that is currently installed';
|
|
13
|
+
static description = 'Uninstall an app that is currently installed in a specific organization';
|
|
14
14
|
static examples = [
|
|
15
15
|
`$ contrail app uninstall --name @vibeiq/flexplm-connector
|
|
16
16
|
`,
|
|
@@ -12,7 +12,7 @@ const basecommand_1 = require("../../basecommand");
|
|
|
12
12
|
const logger_1 = tslib_1.__importDefault(require("../../logger"));
|
|
13
13
|
const common_1 = require("../../common");
|
|
14
14
|
class UpgradeApp extends basecommand_1.BaseCommand {
|
|
15
|
-
static description = 'Upgrade an installed app';
|
|
15
|
+
static description = 'Upgrade an installed app in a specific organization';
|
|
16
16
|
static examples = [
|
|
17
17
|
`$ contrail app upgrade --appIdentifier @VibeIQ/Flex-PLM-Connector --latest
|
|
18
18
|
`,
|
|
@@ -7,7 +7,7 @@ const inquirer_1 = tslib_1.__importDefault(require("inquirer"));
|
|
|
7
7
|
const core_1 = require("@oclif/core");
|
|
8
8
|
const logger_1 = tslib_1.__importDefault(require("../../logger"));
|
|
9
9
|
class DescribeConfig extends basecommand_1.BaseCommand {
|
|
10
|
-
static description = '
|
|
10
|
+
static description = 'Display the contents of a configuration file';
|
|
11
11
|
skipConfirmEnv = true;
|
|
12
12
|
static examples = ['$ contrail config describe demo-org'];
|
|
13
13
|
static args = {
|
|
@@ -64,7 +64,6 @@ 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)(),
|
|
68
67
|
};
|
|
69
68
|
const reducedData = await (0, types_2.getAllReducedTypes)(data);
|
|
70
69
|
await saveData(reducedData, outDir, overwrite);
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { App } from '@contrail/entity-types';
|
|
2
|
+
import { AppDeclaration, AppExtensionPackage } from '../../interfaces';
|
|
3
|
+
export declare function createExtensionPackage(appId: string, extensionDir: string): Promise<any>;
|
|
4
|
+
export declare function getExistingApp(appDeclaration: AppDeclaration): Promise<App>;
|
|
5
|
+
export declare function getExtensionPackage(packageId: string): Promise<AppExtensionPackage>;
|
|
@@ -0,0 +1,180 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getExtensionPackage = exports.getExistingApp = exports.createExtensionPackage = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const sdk_1 = require("@contrail/sdk");
|
|
6
|
+
const axios_1 = tslib_1.__importDefault(require("axios"));
|
|
7
|
+
const chalk_1 = tslib_1.__importDefault(require("chalk"));
|
|
8
|
+
const fs_1 = tslib_1.__importDefault(require("fs"));
|
|
9
|
+
const path_1 = tslib_1.__importDefault(require("path"));
|
|
10
|
+
const zip_a_folder_1 = require("zip-a-folder");
|
|
11
|
+
const apps_1 = require("../../api/apps");
|
|
12
|
+
const logger_1 = tslib_1.__importDefault(require("../../logger"));
|
|
13
|
+
function createTmpDir(extensionDir) {
|
|
14
|
+
const tmpDir = path_1.default.join(extensionDir, 'tmp');
|
|
15
|
+
fs_1.default.mkdirSync(tmpDir, { recursive: true });
|
|
16
|
+
return tmpDir;
|
|
17
|
+
}
|
|
18
|
+
function cleanAndPrepareTmpDir(extensionDir, tmpDir) {
|
|
19
|
+
try {
|
|
20
|
+
fs_1.default.rmSync(tmpDir, { recursive: true, force: true });
|
|
21
|
+
fs_1.default.mkdirSync(tmpDir, { recursive: true });
|
|
22
|
+
fs_1.default.cpSync(path_1.default.join(extensionDir, 'package.json'), path_1.default.join(tmpDir, 'package.json'));
|
|
23
|
+
if (fs_1.default.existsSync(path_1.default.join(extensionDir, 'package-lock.json'))) {
|
|
24
|
+
fs_1.default.cpSync(path_1.default.join(extensionDir, 'package-lock.json'), path_1.default.join(tmpDir, 'package-lock.json'));
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
catch (e) {
|
|
28
|
+
logger_1.default.info(`${chalk_1.default.red.bold('FAIL')} Failed during tmp dir preparation: ${e}`);
|
|
29
|
+
throw e;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
function cleanUp(tmpDir) {
|
|
33
|
+
fs_1.default.rmSync(tmpDir, { recursive: true, force: true });
|
|
34
|
+
}
|
|
35
|
+
function installDependencies(tmpDir) {
|
|
36
|
+
try {
|
|
37
|
+
logger_1.default.info('Installing production dependencies started...');
|
|
38
|
+
const child_process = require('child_process');
|
|
39
|
+
child_process.execSync('npm install --omit=dev --prefix ./', {
|
|
40
|
+
cwd: tmpDir,
|
|
41
|
+
stdio: 'inherit',
|
|
42
|
+
});
|
|
43
|
+
logger_1.default.info('Installing production dependencies done.');
|
|
44
|
+
}
|
|
45
|
+
catch (e) {
|
|
46
|
+
logger_1.default.info(`${chalk_1.default.red.bold('FAIL')} Failed during dependency install: ${e}`);
|
|
47
|
+
throw e;
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
function buildExtension(packageId, extensionDir, tmpDir) {
|
|
51
|
+
try {
|
|
52
|
+
logger_1.default.info('Building package...');
|
|
53
|
+
const child_process = require('child_process');
|
|
54
|
+
console.log('Building package... in ', tmpDir);
|
|
55
|
+
child_process.execSync(`npx ng build --output-path ${tmpDir}/dist --deploy-url /packages/${packageId}/`, {
|
|
56
|
+
cwd: extensionDir,
|
|
57
|
+
stdio: 'inherit',
|
|
58
|
+
});
|
|
59
|
+
logger_1.default.info('Building package done.');
|
|
60
|
+
}
|
|
61
|
+
catch (e) {
|
|
62
|
+
logger_1.default.error(`${chalk_1.default.red.bold('EXTENSION')} Failed to build package.`);
|
|
63
|
+
const stdOut = e.stdout?.toString() || '';
|
|
64
|
+
const stdErr = e.stderr?.toString() || '';
|
|
65
|
+
logger_1.default.error('Build Error(stdout):', stdOut);
|
|
66
|
+
logger_1.default.error('Build Error(stderr):', stdErr);
|
|
67
|
+
throw e;
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
function copyAssets(extensionDir, tmpDir) {
|
|
71
|
+
try {
|
|
72
|
+
logger_1.default.info('Copying Assets...');
|
|
73
|
+
const child_process = require('child_process');
|
|
74
|
+
child_process.execSync(`npx copyfiles assets/**/* ${tmpDir}/dist/`, {
|
|
75
|
+
cwd: extensionDir,
|
|
76
|
+
stdio: 'inherit',
|
|
77
|
+
});
|
|
78
|
+
logger_1.default.info('Copying Assets done.');
|
|
79
|
+
}
|
|
80
|
+
catch (e) {
|
|
81
|
+
logger_1.default.info('No assets to copy or failed to copy assets.');
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
async function zipDist(tmpDir) {
|
|
85
|
+
const tmpDistPath = path_1.default.join(tmpDir, 'dist');
|
|
86
|
+
const tmpZipPath = path_1.default.join(tmpDir, 'dist.zip');
|
|
87
|
+
try {
|
|
88
|
+
if (fs_1.default.existsSync(tmpZipPath)) {
|
|
89
|
+
fs_1.default.rmSync(tmpZipPath);
|
|
90
|
+
}
|
|
91
|
+
await (0, zip_a_folder_1.zip)(tmpDistPath, tmpZipPath);
|
|
92
|
+
logger_1.default.info(`${chalk_1.default.blue.bold('EXTENSION')} Zipped extension package at ${tmpZipPath}`);
|
|
93
|
+
}
|
|
94
|
+
catch (err) {
|
|
95
|
+
logger_1.default.error(`${chalk_1.default.red.bold('EXTENSION')} Failed to zip extension package: ${err}`);
|
|
96
|
+
throw err;
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
async function uploadExtensionPackage(appExtensionPackage, tmpDir) {
|
|
100
|
+
const tmpZipPath = path_1.default.join(tmpDir, 'dist.zip');
|
|
101
|
+
const readStream = fs_1.default.readFileSync(tmpZipPath);
|
|
102
|
+
const postBody = Buffer.from(readStream);
|
|
103
|
+
console.log('extension package ', JSON.stringify(appExtensionPackage, null, 2));
|
|
104
|
+
await axios_1.default.request({
|
|
105
|
+
method: 'PUT',
|
|
106
|
+
url: appExtensionPackage.uploadURL,
|
|
107
|
+
data: postBody,
|
|
108
|
+
headers: {
|
|
109
|
+
'content-type': '',
|
|
110
|
+
},
|
|
111
|
+
});
|
|
112
|
+
logger_1.default.debug(`${chalk_1.default.green.bold('EXTENSION')} Uploaded extension package to ${appExtensionPackage.uploadURL}`);
|
|
113
|
+
logger_1.default.info(`${chalk_1.default.green.bold('EXTENSION')} Extension package uploaded. ID: ${appExtensionPackage.id}`);
|
|
114
|
+
return appExtensionPackage;
|
|
115
|
+
}
|
|
116
|
+
async function createExtensionPackage(appId, extensionDir) {
|
|
117
|
+
const tmpDir = createTmpDir(extensionDir);
|
|
118
|
+
logger_1.default.info(`%s Creating extension package at ${tmpDir}`, chalk_1.default.blue.bold('START'));
|
|
119
|
+
cleanAndPrepareTmpDir(extensionDir, tmpDir);
|
|
120
|
+
installDependenciesInExtensionDirectory(extensionDir);
|
|
121
|
+
installDependenciesInTmpDir(tmpDir);
|
|
122
|
+
const appExtensionPackage = await new sdk_1.Entities().create({
|
|
123
|
+
entityName: 'app-extension-package',
|
|
124
|
+
object: { appId },
|
|
125
|
+
});
|
|
126
|
+
buildExtension(appExtensionPackage.id, extensionDir, tmpDir);
|
|
127
|
+
copyAssets(extensionDir, tmpDir);
|
|
128
|
+
await zipDist(tmpDir);
|
|
129
|
+
await uploadExtensionPackage(appExtensionPackage, tmpDir);
|
|
130
|
+
logger_1.default.info(`${chalk_1.default.green.bold('COMPLETE')} Extension packaged and uploaded.`);
|
|
131
|
+
cleanUp(tmpDir);
|
|
132
|
+
return appExtensionPackage;
|
|
133
|
+
}
|
|
134
|
+
exports.createExtensionPackage = createExtensionPackage;
|
|
135
|
+
function installDependenciesInExtensionDirectory(extensionDir) {
|
|
136
|
+
try {
|
|
137
|
+
logger_1.default.info('Installing development dependencies in extension directory started...');
|
|
138
|
+
const child_process = require('child_process');
|
|
139
|
+
child_process.execSync('npm install --prefix ./', {
|
|
140
|
+
cwd: extensionDir,
|
|
141
|
+
stdio: 'inherit',
|
|
142
|
+
});
|
|
143
|
+
logger_1.default.info('Installing development dependencies in extension directory done.');
|
|
144
|
+
}
|
|
145
|
+
catch (e) {
|
|
146
|
+
logger_1.default.info(`${chalk_1.default.red.bold('FAIL')} Failed during dependency install: ${e}`);
|
|
147
|
+
throw e;
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
function installDependenciesInTmpDir(tmpDir) {
|
|
151
|
+
try {
|
|
152
|
+
logger_1.default.info('Installing production dependencies in tmp dir started...');
|
|
153
|
+
const child_process = require('child_process');
|
|
154
|
+
child_process.execSync('npm install --omit=dev --prefix ./', {
|
|
155
|
+
cwd: tmpDir,
|
|
156
|
+
stdio: 'inherit',
|
|
157
|
+
});
|
|
158
|
+
logger_1.default.info('Installing production dependencies in tmp dir done.');
|
|
159
|
+
}
|
|
160
|
+
catch (e) {
|
|
161
|
+
logger_1.default.info(`${chalk_1.default.red.bold('FAIL')} Failed during dependency install: ${e}`);
|
|
162
|
+
throw e;
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
async function getExistingApp(appDeclaration) {
|
|
166
|
+
const apps = await (0, apps_1.getAvailableApps)();
|
|
167
|
+
const foundApp = apps.find((app) => app.identifier === appDeclaration.appIdentifier);
|
|
168
|
+
if (!foundApp) {
|
|
169
|
+
throw new Error(`App ${appDeclaration.appIdentifier} not found. Extensions deployments can only be deployed for existing apps.`);
|
|
170
|
+
}
|
|
171
|
+
return foundApp;
|
|
172
|
+
}
|
|
173
|
+
exports.getExistingApp = getExistingApp;
|
|
174
|
+
async function getExtensionPackage(packageId) {
|
|
175
|
+
return await new sdk_1.Entities().get({
|
|
176
|
+
entityName: 'app-extension-package',
|
|
177
|
+
criteria: { id: packageId },
|
|
178
|
+
});
|
|
179
|
+
}
|
|
180
|
+
exports.getExtensionPackage = getExtensionPackage;
|
package/dist/interfaces.d.ts
CHANGED
|
@@ -62,7 +62,6 @@ export interface ConfigPropertyElement {
|
|
|
62
62
|
options?: any[];
|
|
63
63
|
label: string;
|
|
64
64
|
dynamic?: boolean;
|
|
65
|
-
masked?: boolean;
|
|
66
65
|
}
|
|
67
66
|
export interface AppActionDeclaration {
|
|
68
67
|
handler: string;
|
|
@@ -402,3 +401,48 @@ export interface CronDeclaration {
|
|
|
402
401
|
name: string;
|
|
403
402
|
cron: string;
|
|
404
403
|
}
|
|
404
|
+
export declare enum AppExtensionDeploymentStatus {
|
|
405
|
+
PENDING = "PENDING",
|
|
406
|
+
PROCESSING = "PROCESSING",
|
|
407
|
+
FAILED = "FAILED",
|
|
408
|
+
DEPLOYED = "DEPLOYED"
|
|
409
|
+
}
|
|
410
|
+
export declare enum AppExtensionPackageStatus {
|
|
411
|
+
PENDING = "PENDING",
|
|
412
|
+
PROCESSING = "PROCESSING",
|
|
413
|
+
FAILED = "FAILED",
|
|
414
|
+
READY = "READY"
|
|
415
|
+
}
|
|
416
|
+
export interface AppExtensionPackage {
|
|
417
|
+
id: string;
|
|
418
|
+
createdOn?: Date;
|
|
419
|
+
updatedOn?: Date;
|
|
420
|
+
createdById?: string;
|
|
421
|
+
updatedById?: string;
|
|
422
|
+
createdBy?: any;
|
|
423
|
+
updatedBy?: any;
|
|
424
|
+
orgId?: string;
|
|
425
|
+
name: string;
|
|
426
|
+
appId?: string;
|
|
427
|
+
app?: App;
|
|
428
|
+
deploymentId?: string;
|
|
429
|
+
deployment?: AppExtensionDeployment;
|
|
430
|
+
status: AppExtensionPackageStatus;
|
|
431
|
+
uploadURL?: string;
|
|
432
|
+
}
|
|
433
|
+
export interface AppExtensionDeployment {
|
|
434
|
+
id: string;
|
|
435
|
+
createdOn?: Date;
|
|
436
|
+
updatedOn?: Date;
|
|
437
|
+
createdById?: string;
|
|
438
|
+
updatedById?: string;
|
|
439
|
+
createdBy?: any;
|
|
440
|
+
updatedBy?: any;
|
|
441
|
+
orgId?: string;
|
|
442
|
+
appId?: string;
|
|
443
|
+
app?: App;
|
|
444
|
+
name: string;
|
|
445
|
+
cloudFrontUrl?: string;
|
|
446
|
+
distributionId?: string;
|
|
447
|
+
status: AppExtensionDeploymentStatus;
|
|
448
|
+
}
|
package/dist/interfaces.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.AssortmentConfigurationRelationships = exports.AssortmentConfigurationSlim = exports.FolderSlim = exports.ProjectConfigurationTemplate = exports.ProjectConfiguration = exports.Folder = exports.AssortmentConfiguration = exports.AssortmentType = exports.CommonConfiguration = exports.TriggerKeyDefinition = exports.ConfigProperty = exports.AppApiKey = exports.AppVersion = exports.AppRuntime = exports.AppVersionStatus = exports.AppOrgStatus = exports.AppAccessPermission = exports.AppAccessGrantScope = void 0;
|
|
3
|
+
exports.AppExtensionPackageStatus = exports.AppExtensionDeploymentStatus = exports.AssortmentConfigurationRelationships = exports.AssortmentConfigurationSlim = exports.FolderSlim = exports.ProjectConfigurationTemplate = exports.ProjectConfiguration = exports.Folder = exports.AssortmentConfiguration = exports.AssortmentType = exports.CommonConfiguration = exports.TriggerKeyDefinition = exports.ConfigProperty = exports.AppApiKey = exports.AppVersion = exports.AppRuntime = exports.AppVersionStatus = exports.AppOrgStatus = exports.AppAccessPermission = exports.AppAccessGrantScope = void 0;
|
|
4
4
|
var AppAccessGrantScope;
|
|
5
5
|
(function (AppAccessGrantScope) {
|
|
6
6
|
AppAccessGrantScope["install"] = "INSTALL";
|
|
@@ -154,3 +154,17 @@ class AssortmentConfigurationRelationships {
|
|
|
154
154
|
assortmentAtts;
|
|
155
155
|
}
|
|
156
156
|
exports.AssortmentConfigurationRelationships = AssortmentConfigurationRelationships;
|
|
157
|
+
var AppExtensionDeploymentStatus;
|
|
158
|
+
(function (AppExtensionDeploymentStatus) {
|
|
159
|
+
AppExtensionDeploymentStatus["PENDING"] = "PENDING";
|
|
160
|
+
AppExtensionDeploymentStatus["PROCESSING"] = "PROCESSING";
|
|
161
|
+
AppExtensionDeploymentStatus["FAILED"] = "FAILED";
|
|
162
|
+
AppExtensionDeploymentStatus["DEPLOYED"] = "DEPLOYED";
|
|
163
|
+
})(AppExtensionDeploymentStatus = exports.AppExtensionDeploymentStatus || (exports.AppExtensionDeploymentStatus = {}));
|
|
164
|
+
var AppExtensionPackageStatus;
|
|
165
|
+
(function (AppExtensionPackageStatus) {
|
|
166
|
+
AppExtensionPackageStatus["PENDING"] = "PENDING";
|
|
167
|
+
AppExtensionPackageStatus["PROCESSING"] = "PROCESSING";
|
|
168
|
+
AppExtensionPackageStatus["FAILED"] = "FAILED";
|
|
169
|
+
AppExtensionPackageStatus["READY"] = "READY";
|
|
170
|
+
})(AppExtensionPackageStatus = exports.AppExtensionPackageStatus || (exports.AppExtensionPackageStatus = {}));
|
package/oclif.manifest.json
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "3.0
|
|
2
|
+
"version": "3.1.0",
|
|
3
3
|
"commands": {
|
|
4
4
|
"app:create": {
|
|
5
5
|
"id": "app:create",
|
|
6
|
-
"description": "Create
|
|
6
|
+
"description": "Create a new app. The current organization will be set as the owner of the app",
|
|
7
7
|
"strict": true,
|
|
8
8
|
"pluginName": "@contrail/cli",
|
|
9
9
|
"pluginAlias": "@contrail/cli",
|
|
@@ -87,7 +87,7 @@
|
|
|
87
87
|
},
|
|
88
88
|
"app:getApiKey": {
|
|
89
89
|
"id": "app:getApiKey",
|
|
90
|
-
"description": "Get an api key for an app",
|
|
90
|
+
"description": "Get an api key for an installed app",
|
|
91
91
|
"strict": true,
|
|
92
92
|
"pluginName": "@contrail/cli",
|
|
93
93
|
"pluginAlias": "@contrail/cli",
|
|
@@ -179,7 +179,7 @@
|
|
|
179
179
|
},
|
|
180
180
|
"app:install": {
|
|
181
181
|
"id": "app:install",
|
|
182
|
-
"description": "Install an app from the marketplace",
|
|
182
|
+
"description": "Install an app from the marketplace to a specific organization",
|
|
183
183
|
"strict": true,
|
|
184
184
|
"pluginName": "@contrail/cli",
|
|
185
185
|
"pluginAlias": "@contrail/cli",
|
|
@@ -237,7 +237,7 @@
|
|
|
237
237
|
},
|
|
238
238
|
"app:publish": {
|
|
239
239
|
"id": "app:publish",
|
|
240
|
-
"description": "Publish the app",
|
|
240
|
+
"description": "Publish the app to the marketplace. This visibility of your app depends on the app.yml configuration (\"visibility\" property)",
|
|
241
241
|
"strict": true,
|
|
242
242
|
"pluginName": "@contrail/cli",
|
|
243
243
|
"pluginAlias": "@contrail/cli",
|
|
@@ -303,7 +303,7 @@
|
|
|
303
303
|
},
|
|
304
304
|
"app:uninstall": {
|
|
305
305
|
"id": "app:uninstall",
|
|
306
|
-
"description": "Uninstall an app that is currently installed",
|
|
306
|
+
"description": "Uninstall an app that is currently installed in a specific organization",
|
|
307
307
|
"strict": true,
|
|
308
308
|
"pluginName": "@contrail/cli",
|
|
309
309
|
"pluginAlias": "@contrail/cli",
|
|
@@ -353,7 +353,7 @@
|
|
|
353
353
|
},
|
|
354
354
|
"app:upgrade": {
|
|
355
355
|
"id": "app:upgrade",
|
|
356
|
-
"description": "Upgrade an installed app",
|
|
356
|
+
"description": "Upgrade an installed app in a specific organization",
|
|
357
357
|
"strict": true,
|
|
358
358
|
"pluginName": "@contrail/cli",
|
|
359
359
|
"pluginAlias": "@contrail/cli",
|
|
@@ -460,7 +460,7 @@
|
|
|
460
460
|
},
|
|
461
461
|
"config:describe": {
|
|
462
462
|
"id": "config:describe",
|
|
463
|
-
"description": "
|
|
463
|
+
"description": "Display the contents of a configuration file",
|
|
464
464
|
"strict": true,
|
|
465
465
|
"pluginName": "@contrail/cli",
|
|
466
466
|
"pluginAlias": "@contrail/cli",
|
|
@@ -3010,6 +3010,56 @@
|
|
|
3010
3010
|
}
|
|
3011
3011
|
}
|
|
3012
3012
|
},
|
|
3013
|
+
"app:extension:deploy": {
|
|
3014
|
+
"id": "app:extension:deploy",
|
|
3015
|
+
"description": "Deploy an extension from the extensions directory to a VibeIQ managed URL.",
|
|
3016
|
+
"strict": true,
|
|
3017
|
+
"pluginName": "@contrail/cli",
|
|
3018
|
+
"pluginAlias": "@contrail/cli",
|
|
3019
|
+
"pluginType": "core",
|
|
3020
|
+
"aliases": [],
|
|
3021
|
+
"examples": [
|
|
3022
|
+
"$ contrail extension deploy --identifier <extensionIdentifier>"
|
|
3023
|
+
],
|
|
3024
|
+
"flags": {
|
|
3025
|
+
"logLevel": {
|
|
3026
|
+
"name": "logLevel",
|
|
3027
|
+
"type": "option",
|
|
3028
|
+
"char": "l",
|
|
3029
|
+
"description": "The Log Level",
|
|
3030
|
+
"required": false,
|
|
3031
|
+
"multiple": false,
|
|
3032
|
+
"options": [
|
|
3033
|
+
"error",
|
|
3034
|
+
"warn",
|
|
3035
|
+
"info",
|
|
3036
|
+
"debug"
|
|
3037
|
+
]
|
|
3038
|
+
},
|
|
3039
|
+
"alwaysConfirmEnv": {
|
|
3040
|
+
"name": "alwaysConfirmEnv",
|
|
3041
|
+
"type": "option",
|
|
3042
|
+
"char": "e",
|
|
3043
|
+
"description": "The Environment variables",
|
|
3044
|
+
"required": false,
|
|
3045
|
+
"multiple": false,
|
|
3046
|
+
"options": [
|
|
3047
|
+
"true",
|
|
3048
|
+
"false"
|
|
3049
|
+
],
|
|
3050
|
+
"default": "true"
|
|
3051
|
+
},
|
|
3052
|
+
"identifier": {
|
|
3053
|
+
"name": "identifier",
|
|
3054
|
+
"type": "option",
|
|
3055
|
+
"char": "i",
|
|
3056
|
+
"description": "The extension identifier to deploy. The identifier of the extension is the \"identifier\" property in the extension defined in the app.yml",
|
|
3057
|
+
"required": true,
|
|
3058
|
+
"multiple": false
|
|
3059
|
+
}
|
|
3060
|
+
},
|
|
3061
|
+
"args": {}
|
|
3062
|
+
},
|
|
3013
3063
|
"app:version:major": {
|
|
3014
3064
|
"id": "app:version:major",
|
|
3015
3065
|
"description": "Upgrade the Major app version",
|
|
@@ -3135,6 +3185,56 @@
|
|
|
3135
3185
|
}
|
|
3136
3186
|
},
|
|
3137
3187
|
"args": {}
|
|
3188
|
+
},
|
|
3189
|
+
"app:extension:deployment:list": {
|
|
3190
|
+
"id": "app:extension:deployment:list",
|
|
3191
|
+
"description": "List extension deployments",
|
|
3192
|
+
"strict": true,
|
|
3193
|
+
"pluginName": "@contrail/cli",
|
|
3194
|
+
"pluginAlias": "@contrail/cli",
|
|
3195
|
+
"pluginType": "core",
|
|
3196
|
+
"aliases": [],
|
|
3197
|
+
"examples": [
|
|
3198
|
+
"$ contrail extension deployment list"
|
|
3199
|
+
],
|
|
3200
|
+
"flags": {
|
|
3201
|
+
"logLevel": {
|
|
3202
|
+
"name": "logLevel",
|
|
3203
|
+
"type": "option",
|
|
3204
|
+
"char": "l",
|
|
3205
|
+
"description": "The Log Level",
|
|
3206
|
+
"required": false,
|
|
3207
|
+
"multiple": false,
|
|
3208
|
+
"options": [
|
|
3209
|
+
"error",
|
|
3210
|
+
"warn",
|
|
3211
|
+
"info",
|
|
3212
|
+
"debug"
|
|
3213
|
+
]
|
|
3214
|
+
},
|
|
3215
|
+
"alwaysConfirmEnv": {
|
|
3216
|
+
"name": "alwaysConfirmEnv",
|
|
3217
|
+
"type": "option",
|
|
3218
|
+
"char": "e",
|
|
3219
|
+
"description": "The Environment variables",
|
|
3220
|
+
"required": false,
|
|
3221
|
+
"multiple": false,
|
|
3222
|
+
"options": [
|
|
3223
|
+
"true",
|
|
3224
|
+
"false"
|
|
3225
|
+
],
|
|
3226
|
+
"default": "true"
|
|
3227
|
+
},
|
|
3228
|
+
"all": {
|
|
3229
|
+
"name": "all",
|
|
3230
|
+
"type": "boolean",
|
|
3231
|
+
"char": "a",
|
|
3232
|
+
"description": "List all extension deployments. By default, only the latest 20 are shown",
|
|
3233
|
+
"required": false,
|
|
3234
|
+
"allowNo": false
|
|
3235
|
+
}
|
|
3236
|
+
},
|
|
3237
|
+
"args": {}
|
|
3138
3238
|
}
|
|
3139
3239
|
}
|
|
3140
3240
|
}
|