@forge/cli 10.13.6 → 11.0.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/CHANGELOG.md +251 -0
- package/LICENSE.txt +7 -0
- package/npm-shrinkwrap.json +142 -130
- package/out/autocomplete/autocomplete-config.json +26 -0
- package/out/command-line/command.d.ts +15 -2
- package/out/command-line/command.d.ts.map +1 -1
- package/out/command-line/command.js +29 -6
- package/out/command-line/controller/deploy-controller.d.ts.map +1 -1
- package/out/command-line/controller/deploy-controller.js +4 -7
- package/out/command-line/controller/install-controller.d.ts +3 -3
- package/out/command-line/controller/install-controller.d.ts.map +1 -1
- package/out/command-line/controller/install-controller.js +16 -13
- package/out/command-line/controller/version-controller.d.ts +36 -0
- package/out/command-line/controller/version-controller.d.ts.map +1 -0
- package/out/command-line/controller/version-controller.js +114 -0
- package/out/command-line/dependency-injection.d.ts +4 -1
- package/out/command-line/dependency-injection.d.ts.map +1 -1
- package/out/command-line/dependency-injection.js +14 -6
- package/out/command-line/index.d.ts +1 -1
- package/out/command-line/index.d.ts.map +1 -1
- package/out/command-line/index.js +6 -4
- package/out/command-line/register-app-commands.d.ts.map +1 -1
- package/out/command-line/register-app-commands.js +9 -1
- package/out/command-line/register-installation-commands.d.ts +2 -10
- package/out/command-line/register-installation-commands.d.ts.map +1 -1
- package/out/command-line/register-installation-commands.js +29 -32
- package/out/command-line/register-version-commands.d.ts +4 -0
- package/out/command-line/register-version-commands.d.ts.map +1 -0
- package/out/command-line/register-version-commands.js +76 -0
- package/out/command-line/register-webtrigger-commands.d.ts +1 -1
- package/out/command-line/register-webtrigger-commands.d.ts.map +1 -1
- package/out/command-line/register-webtrigger-commands.js +13 -5
- package/out/command-line/view/deploy-view.d.ts +1 -1
- package/out/command-line/view/deploy-view.d.ts.map +1 -1
- package/out/command-line/view/deploy-view.js +2 -2
- package/out/command-line/view/version-view.d.ts +26 -0
- package/out/command-line/view/version-view.d.ts.map +1 -0
- package/out/command-line/view/version-view.js +198 -0
- package/out/environment/graphql-client.d.ts +1 -0
- package/out/environment/graphql-client.d.ts.map +1 -1
- package/out/environment/graphql-client.js +3 -1
- package/out/environment/list-environment.d.ts +1 -0
- package/out/environment/list-environment.d.ts.map +1 -1
- package/out/installations/graphql-client.d.ts +6 -5
- package/out/installations/graphql-client.d.ts.map +1 -1
- package/out/installations/graphql-client.js +44 -7
- package/out/installations/installation-helper.d.ts.map +1 -1
- package/out/installations/installation-helper.js +1 -1
- package/out/installations/site-translation/bitbucket.d.ts +3 -4
- package/out/installations/site-translation/bitbucket.d.ts.map +1 -1
- package/out/installations/site-translation/bitbucket.js +1 -1
- package/out/installations/site-translation/index.d.ts +1 -1
- package/out/installations/site-translation/index.d.ts.map +1 -1
- package/out/installations/site-translation/index.js +1 -1
- package/out/installations/site-translation/site-translation.d.ts +3 -4
- package/out/installations/site-translation/site-translation.d.ts.map +1 -1
- package/out/installations/site-translation/sited-products.d.ts +29 -0
- package/out/installations/site-translation/sited-products.d.ts.map +1 -0
- package/out/installations/site-translation/sited-products.js +133 -0
- package/out/service/installation-service.d.ts +18 -4
- package/out/service/installation-service.d.ts.map +1 -1
- package/out/service/installation-service.js +44 -10
- package/out/service/tunnel-service.d.ts.map +1 -1
- package/out/service/tunnel-service.js +1 -1
- package/out/service/version-service.d.ts +77 -0
- package/out/service/version-service.d.ts.map +1 -0
- package/out/service/version-service.js +163 -0
- package/out/version/graphql-client.d.ts +25 -0
- package/out/version/graphql-client.d.ts.map +1 -0
- package/out/version/graphql-client.js +144 -0
- package/package.json +13 -11
- package/out/installations/site-translation/cloudid-products.d.ts +0 -25
- package/out/installations/site-translation/cloudid-products.d.ts.map +0 -1
- package/out/installations/site-translation/cloudid-products.js +0 -103
|
@@ -1,29 +1,17 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.registerCommands = exports.performMultipleUninstalls = exports.performSingleUninstall = exports.
|
|
3
|
+
exports.registerCommands = exports.performMultipleUninstalls = exports.performSingleUninstall = exports.registerListInstallationsCommand = void 0;
|
|
4
4
|
const cli_shared_1 = require("@forge/cli-shared");
|
|
5
5
|
const shared_1 = require("../installations/shared");
|
|
6
6
|
const errors_1 = require("./errors");
|
|
7
7
|
const semver_1 = require("semver");
|
|
8
8
|
const COMMAND_NAME = 'install';
|
|
9
|
-
async
|
|
10
|
-
|
|
11
|
-
product = (0, cli_shared_1.productDisplayName)(product);
|
|
12
|
-
if (!(0, cli_shared_1.isSupportedProduct)(product)) {
|
|
13
|
-
throw new cli_shared_1.ValidationError(cli_shared_1.Text.error.invalidProduct);
|
|
14
|
-
}
|
|
15
|
-
}
|
|
16
|
-
const siteURL = site ? (0, cli_shared_1.validateSite)(site, product) : undefined;
|
|
17
|
-
return { siteURL, product };
|
|
18
|
-
}
|
|
19
|
-
exports.validateContext = validateContext;
|
|
20
|
-
const registerInstallAppCommand = ({ cmd, controllers: { installController } }) => {
|
|
9
|
+
const registerInstallAppCommand = async ({ cmd, controllers: { installController }, services: { supportedProductsService } }) => {
|
|
10
|
+
const supportedProducts = await supportedProductsService.getSupportedProducts();
|
|
21
11
|
cmd
|
|
22
12
|
.requireAppId()
|
|
23
13
|
.environmentOption()
|
|
24
|
-
.
|
|
25
|
-
.option('-p, --product [product]', cli_shared_1.Text.optionProduct((0, cli_shared_1.getSupportedProducts)()))
|
|
26
|
-
.precondition(validateContext)
|
|
14
|
+
.contextOption(supportedProducts)
|
|
27
15
|
.option('--upgrade', cli_shared_1.Text.install.optionUpgrade, false)
|
|
28
16
|
.option('--confirm-scopes', cli_shared_1.Text.install.optionConfirmScopes, false)
|
|
29
17
|
.option('-l, --license [license]', cli_shared_1.Text.install.optionLicense)
|
|
@@ -31,10 +19,10 @@ const registerInstallAppCommand = ({ cmd, controllers: { installController } })
|
|
|
31
19
|
.option('--users-with-access [user...]', cli_shared_1.Text.install.optionUsersWithAccess)
|
|
32
20
|
.nonInteractiveOption('--site', '--product', '--environment')
|
|
33
21
|
.description(cli_shared_1.Text.install.cmd.description)
|
|
34
|
-
.action(async ({ environment,
|
|
22
|
+
.action(async ({ environment, site, product, upgrade, confirmScopes, license, licenseModes, usersWithAccess, nonInteractive }) => {
|
|
35
23
|
await installController.run({
|
|
36
24
|
environment,
|
|
37
|
-
site
|
|
25
|
+
site,
|
|
38
26
|
product,
|
|
39
27
|
upgrade,
|
|
40
28
|
confirmScopes,
|
|
@@ -54,18 +42,19 @@ const registerListInstallationsCommand = ({ cmd, ui, services: { installationsSe
|
|
|
54
42
|
.description(cli_shared_1.Text.installList.cmd)
|
|
55
43
|
.action(async ({ json }) => {
|
|
56
44
|
const { installations } = await installationsService.listAppInstallations();
|
|
45
|
+
const hasSecondaryInstallations = installations.some(({ secondaryProducts }) => secondaryProducts?.length);
|
|
57
46
|
ui.table([
|
|
58
47
|
['id', 'Installation ID'],
|
|
59
48
|
['environment', 'Environment'],
|
|
60
49
|
['site', 'Site'],
|
|
61
|
-
['product', 'Product'],
|
|
50
|
+
['product', hasSecondaryInstallations ? 'Product(s)' : 'Product'],
|
|
62
51
|
['version', 'Version'],
|
|
63
52
|
['majorVersion', 'Major Version']
|
|
64
|
-
], installations.map(({ id, environmentKey, product, site, version: { isLatest, version } }) => ({
|
|
53
|
+
], installations.map(({ id, environmentKey, product, secondaryProducts, site, version: { isLatest, version } }) => ({
|
|
65
54
|
id,
|
|
66
55
|
environment: (0, cli_shared_1.environmentToOption)(environmentKey),
|
|
67
56
|
site,
|
|
68
|
-
product: (0, cli_shared_1.
|
|
57
|
+
product: (0, cli_shared_1.productsDisplayName)(product, secondaryProducts),
|
|
69
58
|
version: cli_shared_1.Text.install.booleanToScope(isLatest),
|
|
70
59
|
majorVersion: (0, semver_1.major)(version).toString()
|
|
71
60
|
})), {
|
|
@@ -75,6 +64,7 @@ const registerListInstallationsCommand = ({ cmd, ui, services: { installationsSe
|
|
|
75
64
|
});
|
|
76
65
|
});
|
|
77
66
|
};
|
|
67
|
+
exports.registerListInstallationsCommand = registerListInstallationsCommand;
|
|
78
68
|
const performSingleUninstall = async (installId, { ui, commands: { uninstallAppCommand } }) => {
|
|
79
69
|
const installation = await ui.displayProgress(() => uninstallAppCommand.execute(installId), cli_shared_1.Text.uninstall.cmd.start, (result) => ({
|
|
80
70
|
successful: !!result.successful,
|
|
@@ -121,24 +111,31 @@ const performMultipleUninstalls = async (appsToUninstall, { ui, commands: { unin
|
|
|
121
111
|
}
|
|
122
112
|
};
|
|
123
113
|
exports.performMultipleUninstalls = performMultipleUninstalls;
|
|
124
|
-
const registerUninstallCommand = (deps) => {
|
|
125
|
-
const { cmd, ui, services: { installationsService } } = deps;
|
|
114
|
+
const registerUninstallCommand = async (deps) => {
|
|
115
|
+
const { cmd, ui, services: { installationsService, supportedProductsService } } = deps;
|
|
116
|
+
const supportedProducts = await supportedProductsService.getSupportedProducts();
|
|
126
117
|
cmd
|
|
127
|
-
.command('uninstall
|
|
118
|
+
.command('uninstall')
|
|
119
|
+
.contextOption(supportedProducts)
|
|
120
|
+
.environmentOption()
|
|
128
121
|
.requireAppId()
|
|
129
122
|
.description(cli_shared_1.Text.uninstall.cmd.desc)
|
|
130
|
-
.action(async (
|
|
123
|
+
.action(async ({ site, environment, product }) => {
|
|
131
124
|
const { installations } = await installationsService.listAppInstallations();
|
|
132
125
|
if (!installations.length) {
|
|
133
126
|
ui.info(cli_shared_1.Text.installList.noInstallations);
|
|
134
127
|
return;
|
|
135
128
|
}
|
|
136
|
-
|
|
137
|
-
|
|
129
|
+
if (site && product) {
|
|
130
|
+
const installation = await installationsService.findOnlyMatchingInstallation({
|
|
131
|
+
site,
|
|
132
|
+
product,
|
|
133
|
+
environment
|
|
134
|
+
});
|
|
138
135
|
ui.info(cli_shared_1.Text.uninstall.info);
|
|
139
136
|
ui.info(cli_shared_1.Text.ctrlC);
|
|
140
137
|
ui.emptyLine();
|
|
141
|
-
await (0, exports.performSingleUninstall)(
|
|
138
|
+
await (0, exports.performSingleUninstall)(installation.id, deps);
|
|
142
139
|
}
|
|
143
140
|
else {
|
|
144
141
|
const filteredInstallations = installations.filter((install) => install.product !== 'identity' && install.product !== 'jira-servicedesk');
|
|
@@ -160,11 +157,11 @@ const registerUninstallCommand = (deps) => {
|
|
|
160
157
|
});
|
|
161
158
|
};
|
|
162
159
|
const DEPRECATED_LIST_COMMAND = 'install:list';
|
|
163
|
-
const registerCommands = ({ cmd, ...deps }) => {
|
|
160
|
+
const registerCommands = async ({ cmd, ...deps }) => {
|
|
164
161
|
const install = cmd.command(COMMAND_NAME).description(cli_shared_1.Text.variables.description);
|
|
165
|
-
registerUninstallCommand({ cmd, ...deps });
|
|
162
|
+
await registerUninstallCommand({ cmd, ...deps });
|
|
166
163
|
cmd.deprecatedCommand(DEPRECATED_LIST_COMMAND, `${COMMAND_NAME} ${LIST_COMMAND_NAME}`, deps.controllers.stubController);
|
|
167
|
-
registerInstallAppCommand({ cmd: install, ...deps });
|
|
168
|
-
registerListInstallationsCommand({ cmd: install, ...deps });
|
|
164
|
+
await registerInstallAppCommand({ cmd: install, ...deps });
|
|
165
|
+
(0, exports.registerListInstallationsCommand)({ cmd: install, ...deps });
|
|
169
166
|
};
|
|
170
167
|
exports.registerCommands = registerCommands;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { Dependencies } from './dependency-injection';
|
|
2
|
+
export declare function parseMajorVersion(majorVersionStr: string, property?: string): number;
|
|
3
|
+
export declare const registerCommands: (deps: Dependencies) => void;
|
|
4
|
+
//# sourceMappingURL=register-version-commands.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"register-version-commands.d.ts","sourceRoot":"","sources":["../../src/command-line/register-version-commands.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAItD,wBAAgB,iBAAiB,CAAC,eAAe,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,MAAM,GAAG,MAAM,CASpF;AA2DD,eAAO,MAAM,gBAAgB,SAAU,YAAY,SAMlD,CAAC"}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.registerCommands = exports.parseMajorVersion = void 0;
|
|
4
|
+
const cli_shared_1 = require("@forge/cli-shared");
|
|
5
|
+
function parseMajorVersion(majorVersionStr, property) {
|
|
6
|
+
if (!/^\d+$/.test(majorVersionStr)) {
|
|
7
|
+
throw new cli_shared_1.ValidationError(cli_shared_1.Text.version.check.error.invalidMajorVersion(property));
|
|
8
|
+
}
|
|
9
|
+
const version = parseInt(majorVersionStr, 10);
|
|
10
|
+
if (version < 1) {
|
|
11
|
+
throw new cli_shared_1.ValidationError(cli_shared_1.Text.version.check.error.invalidMajorVersion(property));
|
|
12
|
+
}
|
|
13
|
+
return version;
|
|
14
|
+
}
|
|
15
|
+
exports.parseMajorVersion = parseMajorVersion;
|
|
16
|
+
const registerDetailsCommands = (parent, { controllers: { versionController } }) => {
|
|
17
|
+
parent
|
|
18
|
+
.command(cli_shared_1.Text.version.check.cmdName)
|
|
19
|
+
.description(cli_shared_1.Text.version.check.desc)
|
|
20
|
+
.requireAppId()
|
|
21
|
+
.environmentOption()
|
|
22
|
+
.nonInteractiveOption()
|
|
23
|
+
.option('-v, --major-version [version]', cli_shared_1.Text.version.check.option.majorVersion)
|
|
24
|
+
.option('--json', cli_shared_1.Text.version.check.option.json)
|
|
25
|
+
.option('-f, --out-file [outFile]', cli_shared_1.Text.version.check.option.outFile)
|
|
26
|
+
.action(async ({ environment, majorVersion, json, outFile, nonInteractive }) => {
|
|
27
|
+
const majorVersionInt = majorVersion ? parseMajorVersion(majorVersion) : undefined;
|
|
28
|
+
await versionController.getAppVersionDetails({
|
|
29
|
+
environment,
|
|
30
|
+
majorVersion: majorVersionInt,
|
|
31
|
+
json,
|
|
32
|
+
outFile,
|
|
33
|
+
nonInteractive
|
|
34
|
+
});
|
|
35
|
+
});
|
|
36
|
+
};
|
|
37
|
+
const registerListCommands = (parent, { controllers: { versionController } }) => {
|
|
38
|
+
parent
|
|
39
|
+
.command(cli_shared_1.Text.version.list.cmdName)
|
|
40
|
+
.description(cli_shared_1.Text.version.list.desc)
|
|
41
|
+
.requireAppId()
|
|
42
|
+
.environmentOption()
|
|
43
|
+
.nonInteractiveOption()
|
|
44
|
+
.option('--json', cli_shared_1.Text.version.list.option.json)
|
|
45
|
+
.option('-f, --out-file [outFile]', cli_shared_1.Text.version.list.option.outFile)
|
|
46
|
+
.action(async ({ environment, json, outFile, nonInteractive }) => {
|
|
47
|
+
await versionController.getVersionList({ environment, json, outFile, nonInteractive });
|
|
48
|
+
});
|
|
49
|
+
};
|
|
50
|
+
const registerDiffCommands = (parent, { controllers: { versionController } }) => {
|
|
51
|
+
parent
|
|
52
|
+
.command(cli_shared_1.Text.version.diff.cmdName)
|
|
53
|
+
.description(cli_shared_1.Text.version.diff.desc)
|
|
54
|
+
.requireAppId()
|
|
55
|
+
.environmentOption()
|
|
56
|
+
.nonInteractiveOption()
|
|
57
|
+
.option('-v1, --version1 [version]', cli_shared_1.Text.version.diff.option.version1)
|
|
58
|
+
.option('-v2, --version2 [version]', cli_shared_1.Text.version.diff.option.version2)
|
|
59
|
+
.option('-f, --out-file [outFile]', cli_shared_1.Text.version.diff.option.outFile)
|
|
60
|
+
.action(async ({ environment, version1, version2, outFile }) => {
|
|
61
|
+
if (!version1 || !version2) {
|
|
62
|
+
throw new cli_shared_1.ValidationError(cli_shared_1.Text.version.diff.error.noVersionProvided);
|
|
63
|
+
}
|
|
64
|
+
const version1Int = parseMajorVersion(version1, '--version1');
|
|
65
|
+
const version2Int = parseMajorVersion(version2, '--version2');
|
|
66
|
+
await versionController.getAppVersionDiff({ environment, version1: version1Int, version2: version2Int, outFile });
|
|
67
|
+
});
|
|
68
|
+
};
|
|
69
|
+
const registerCommands = (deps) => {
|
|
70
|
+
const { cmd } = deps;
|
|
71
|
+
const version = cmd.command(cli_shared_1.Text.version.cmd.cmdName).description(cli_shared_1.Text.version.cmd.desc);
|
|
72
|
+
registerDetailsCommands(version, deps);
|
|
73
|
+
registerDiffCommands(version, deps);
|
|
74
|
+
registerListCommands(version, deps);
|
|
75
|
+
};
|
|
76
|
+
exports.registerCommands = registerCommands;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { Dependencies } from './dependency-injection';
|
|
2
|
-
export declare const registerCommands: ({ cmd, ui,
|
|
2
|
+
export declare const registerCommands: ({ cmd, ui, configFile, services: { installationsService, supportedProductsService }, commands: { getWebTriggerURLCommand } }: Dependencies) => Promise<void>;
|
|
3
3
|
//# sourceMappingURL=register-webtrigger-commands.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"register-webtrigger-commands.d.ts","sourceRoot":"","sources":["../../src/command-line/register-webtrigger-commands.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAgCtD,eAAO,MAAM,gBAAgB,
|
|
1
|
+
{"version":3,"file":"register-webtrigger-commands.d.ts","sourceRoot":"","sources":["../../src/command-line/register-webtrigger-commands.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAgCtD,eAAO,MAAM,gBAAgB,iIAM1B,YAAY,kBAyDd,CAAC"}
|
|
@@ -26,7 +26,7 @@ function manifestDefinesTriggers(configFile) {
|
|
|
26
26
|
await getValidWebtriggers(configFile);
|
|
27
27
|
};
|
|
28
28
|
}
|
|
29
|
-
const registerCommands = ({ cmd, ui,
|
|
29
|
+
const registerCommands = async ({ cmd, ui, configFile, services: { installationsService, supportedProductsService }, commands: { getWebTriggerURLCommand } }) => {
|
|
30
30
|
const validateWebtriggerKey = async (functionKey) => {
|
|
31
31
|
const availableWebTriggers = await getValidWebtriggers(configFile);
|
|
32
32
|
if (functionKey) {
|
|
@@ -40,17 +40,25 @@ const registerCommands = ({ cmd, ui, graphqlGateway, configFile, services: { ins
|
|
|
40
40
|
return await ui.promptForList(cli_shared_1.Text.webtrigger.promptFuncKey, options);
|
|
41
41
|
}
|
|
42
42
|
};
|
|
43
|
+
const supportedProducts = await supportedProductsService.getSupportedProducts();
|
|
43
44
|
cmd
|
|
44
|
-
.command('webtrigger
|
|
45
|
+
.command('webtrigger')
|
|
45
46
|
.requireAppId()
|
|
46
47
|
.description(cli_shared_1.Text.webtrigger.cmd)
|
|
47
48
|
.option('-f, --functionKey [function]', cli_shared_1.Text.webtrigger.optionFuncKey)
|
|
49
|
+
.contextOption(supportedProducts)
|
|
50
|
+
.environmentOption()
|
|
48
51
|
.precondition(manifestDefinesTriggers(configFile))
|
|
49
|
-
.action(async (
|
|
52
|
+
.action(async ({ functionKey, site, environment, product }) => {
|
|
50
53
|
let selectedInstallationId = '';
|
|
51
|
-
if (
|
|
54
|
+
if (site && product) {
|
|
52
55
|
ui.info(cli_shared_1.Text.webtrigger.overviewFuncKey);
|
|
53
|
-
|
|
56
|
+
const installation = await installationsService.findOnlyMatchingInstallation({
|
|
57
|
+
site,
|
|
58
|
+
environment,
|
|
59
|
+
product
|
|
60
|
+
});
|
|
61
|
+
selectedInstallationId = (0, installation_helper_1.validateInstallationId)(installation?.id);
|
|
54
62
|
}
|
|
55
63
|
else {
|
|
56
64
|
const appInstallation = await installationsService.listNonTechnicalAppInstallations();
|
|
@@ -6,7 +6,7 @@ export declare class DeployView {
|
|
|
6
6
|
constructor(ui: UI);
|
|
7
7
|
getLogger(): UI;
|
|
8
8
|
displayStart(environment: string, environmentType: AppEnvironmentType): void;
|
|
9
|
-
|
|
9
|
+
displayHasNoAppInstallationsForEnvError(): void;
|
|
10
10
|
displayLintRunning(): void;
|
|
11
11
|
displayOutdatedInstallationsMessage(): void;
|
|
12
12
|
displayRoaEligibilityFailureMessage(appVersion: string, envKey: string, envType: AppEnvironmentType): void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"deploy-view.d.ts","sourceRoot":"","sources":["../../../src/command-line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-
|
|
19
|
-
this.ui.info(cli_shared_1.Text.deploy.
|
|
18
|
+
displayHasNoAppInstallationsForEnvError() {
|
|
19
|
+
this.ui.info(cli_shared_1.Text.deploy.hasNoAppInstallationsForEnv.hasNoAppInstallationsForEnvError);
|
|
20
20
|
}
|
|
21
21
|
displayLintRunning() {
|
|
22
22
|
this.ui.info(cli_shared_1.Text.lint.running);
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { AppEnvironmentType, UI } from '@forge/cli-shared';
|
|
2
|
+
import { VersionDetails, VersionOverview } from '../../service/version-service';
|
|
3
|
+
import { Change } from 'diff';
|
|
4
|
+
export declare class VersionView {
|
|
5
|
+
private readonly ui;
|
|
6
|
+
constructor(ui: UI);
|
|
7
|
+
displayDetailsProgress(progress: () => Promise<VersionDetails>): Promise<VersionDetails>;
|
|
8
|
+
displayDiffProgress(progress: () => Promise<VersionDetails[]>): Promise<VersionDetails[]>;
|
|
9
|
+
displayListProgress(progress: () => Promise<VersionOverview[]>): Promise<VersionOverview[]>;
|
|
10
|
+
promptVersionDetailsProperties(): Promise<(keyof VersionDetails)[]>;
|
|
11
|
+
displayVersionDetailsBanner(appVersion: number, envKey: string, envType: AppEnvironmentType): void;
|
|
12
|
+
displayDetailsAsTable(details: Partial<VersionDetails>): void;
|
|
13
|
+
displayDataInJson(data: VersionDetails): void;
|
|
14
|
+
displayDiffBanner(version1: number, version2: number, envKey: string, envType: AppEnvironmentType): void;
|
|
15
|
+
displayDiffAsTable(versions: {
|
|
16
|
+
v1: number;
|
|
17
|
+
v2: number;
|
|
18
|
+
}, input: {
|
|
19
|
+
key: string;
|
|
20
|
+
diff: Change[];
|
|
21
|
+
}[]): void;
|
|
22
|
+
displayListBanner(versions: number, envKey: string, envType: AppEnvironmentType): void;
|
|
23
|
+
displayWriteToFile(outFile: string): void;
|
|
24
|
+
displayVersionList(data: VersionOverview[]): void;
|
|
25
|
+
}
|
|
26
|
+
//# sourceMappingURL=version-view.d.ts.map
|
|
@@ -0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AM,CAAC;QAAC,IAAI,EAAE,MAAM,EAAE,CAAA;KAAE,EAAE,GAAG,IAAI;IAkCxG,iBAAiB,CAAC,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,kBAAkB,GAAG,IAAI;IAMtF,kBAAkB,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI;IAIzC,kBAAkB,CAAC,IAAI,EAAE,eAAe,EAAE,GAAG,IAAI;CAwBzD"}
|
|
@@ -0,0 +1,198 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.VersionView = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const cli_shared_1 = require("@forge/cli-shared");
|
|
6
|
+
const chalk_1 = tslib_1.__importDefault(require("chalk"));
|
|
7
|
+
class VersionView {
|
|
8
|
+
ui;
|
|
9
|
+
constructor(ui) {
|
|
10
|
+
this.ui = ui;
|
|
11
|
+
}
|
|
12
|
+
async displayDetailsProgress(progress) {
|
|
13
|
+
return this.ui.displayProgress(progress, cli_shared_1.Text.version.check.start, cli_shared_1.Text.version.check.end);
|
|
14
|
+
}
|
|
15
|
+
async displayDiffProgress(progress) {
|
|
16
|
+
return this.ui.displayProgress(progress, cli_shared_1.Text.version.diff.start, cli_shared_1.Text.version.diff.end);
|
|
17
|
+
}
|
|
18
|
+
async displayListProgress(progress) {
|
|
19
|
+
return this.ui.displayProgress(progress, cli_shared_1.Text.version.list.start, cli_shared_1.Text.version.list.end);
|
|
20
|
+
}
|
|
21
|
+
async promptVersionDetailsProperties() {
|
|
22
|
+
const { options, properties: { descriptions, banner, info, headers } } = cli_shared_1.Text.version.check.details.prompt;
|
|
23
|
+
const propsOptions = [
|
|
24
|
+
{
|
|
25
|
+
names: ['License', descriptions.license],
|
|
26
|
+
property: 'requiresLicense'
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
names: ['Scopes', descriptions.scopes],
|
|
30
|
+
property: 'scopes'
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
names: ['Egress', descriptions.egress],
|
|
34
|
+
property: 'egresses'
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
names: ['Policies', descriptions.policies],
|
|
38
|
+
property: 'policies'
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
names: ['Connect Key', descriptions.connectKeys],
|
|
42
|
+
property: 'connectKeys'
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
names: ['Functions', descriptions.functions],
|
|
46
|
+
property: 'functions'
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
names: ['Modules', descriptions.modules],
|
|
50
|
+
property: 'modules'
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
names: ['Remotes', descriptions.remotes],
|
|
54
|
+
property: 'remotes'
|
|
55
|
+
}
|
|
56
|
+
];
|
|
57
|
+
const allOrNot = await this.ui.promptForList(options.banner, [options.choices.all, options.choices.manual]);
|
|
58
|
+
if (allOrNot === options.choices.manual) {
|
|
59
|
+
const choices = await this.ui.promptForTable(banner, info, headers, propsOptions);
|
|
60
|
+
return choices.map((index) => propsOptions[index].property);
|
|
61
|
+
}
|
|
62
|
+
return [];
|
|
63
|
+
}
|
|
64
|
+
displayVersionDetailsBanner(appVersion, envKey, envType) {
|
|
65
|
+
this.ui.emptyLine();
|
|
66
|
+
this.ui.info(cli_shared_1.Text.version.check.details.banner(envKey, envType, appVersion));
|
|
67
|
+
this.ui.emptyLine();
|
|
68
|
+
}
|
|
69
|
+
displayDetailsAsTable(details) {
|
|
70
|
+
const tableData = [
|
|
71
|
+
{
|
|
72
|
+
entry: 'deployment date',
|
|
73
|
+
detailsFn: cli_shared_1.Text.version.check.details.deploymentDate,
|
|
74
|
+
property: 'deploymentDateTime'
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
entry: 'functions',
|
|
78
|
+
detailsFn: cli_shared_1.Text.version.check.details.functions,
|
|
79
|
+
property: 'functions'
|
|
80
|
+
},
|
|
81
|
+
{
|
|
82
|
+
entry: 'modules',
|
|
83
|
+
detailsFn: cli_shared_1.Text.version.check.details.modules,
|
|
84
|
+
property: 'modules'
|
|
85
|
+
},
|
|
86
|
+
{
|
|
87
|
+
entry: 'license',
|
|
88
|
+
detailsFn: cli_shared_1.Text.version.check.details.license,
|
|
89
|
+
property: 'requiresLicense'
|
|
90
|
+
},
|
|
91
|
+
{
|
|
92
|
+
entry: 'scopes',
|
|
93
|
+
detailsFn: cli_shared_1.Text.version.check.details.scopes,
|
|
94
|
+
property: 'scopes'
|
|
95
|
+
},
|
|
96
|
+
{
|
|
97
|
+
entry: 'egress',
|
|
98
|
+
detailsFn: cli_shared_1.Text.version.check.details.egress,
|
|
99
|
+
property: 'egresses'
|
|
100
|
+
},
|
|
101
|
+
{
|
|
102
|
+
entry: 'policies',
|
|
103
|
+
detailsFn: cli_shared_1.Text.version.check.details.securityPolicies,
|
|
104
|
+
property: 'policies'
|
|
105
|
+
},
|
|
106
|
+
{
|
|
107
|
+
entry: 'connect keys',
|
|
108
|
+
detailsFn: cli_shared_1.Text.version.check.details.connectKeys,
|
|
109
|
+
property: 'connectKeys'
|
|
110
|
+
},
|
|
111
|
+
{
|
|
112
|
+
entry: 'remotes',
|
|
113
|
+
detailsFn: cli_shared_1.Text.version.check.details.remotes,
|
|
114
|
+
property: 'remotes'
|
|
115
|
+
}
|
|
116
|
+
];
|
|
117
|
+
const filteredData = [...tableData]
|
|
118
|
+
.sort((a, b) => a.entry.localeCompare(b.entry))
|
|
119
|
+
.filter(({ property }) => details[property] !== undefined)
|
|
120
|
+
.map(({ entry, detailsFn, property }) => ({
|
|
121
|
+
entry,
|
|
122
|
+
details: detailsFn(details[property]),
|
|
123
|
+
property
|
|
124
|
+
}));
|
|
125
|
+
this.ui.table([
|
|
126
|
+
['entry', 'Property'],
|
|
127
|
+
['details', 'Details']
|
|
128
|
+
], filteredData);
|
|
129
|
+
}
|
|
130
|
+
displayDataInJson(data) {
|
|
131
|
+
this.ui.info(JSON.stringify(data, null, 2));
|
|
132
|
+
}
|
|
133
|
+
displayDiffBanner(version1, version2, envKey, envType) {
|
|
134
|
+
this.ui.emptyLine();
|
|
135
|
+
this.ui.info(cli_shared_1.Text.version.diff.details.banner(envKey, envType, version1, version2));
|
|
136
|
+
this.ui.emptyLine();
|
|
137
|
+
}
|
|
138
|
+
displayDiffAsTable(versions, input) {
|
|
139
|
+
this.ui.table([
|
|
140
|
+
['entry', 'Property'],
|
|
141
|
+
['v1', `Version 1 [${versions.v1}]`],
|
|
142
|
+
['v2', `Version 2 [${versions.v2}]`]
|
|
143
|
+
], input
|
|
144
|
+
.filter(({ diff }) => diff.filter((change) => change.added || change.removed).length > 0)
|
|
145
|
+
.map(({ key, diff }) => ({
|
|
146
|
+
entry: key,
|
|
147
|
+
v1: diff
|
|
148
|
+
.filter((change) => !change.added)
|
|
149
|
+
.map((change) => {
|
|
150
|
+
if (!change.removed) {
|
|
151
|
+
return chalk_1.default.gray(change.value);
|
|
152
|
+
}
|
|
153
|
+
return change.value;
|
|
154
|
+
})
|
|
155
|
+
.join(''),
|
|
156
|
+
v2: diff
|
|
157
|
+
.filter((change) => !change.removed)
|
|
158
|
+
.map((change) => {
|
|
159
|
+
if (!change.added) {
|
|
160
|
+
return chalk_1.default.gray(change.value);
|
|
161
|
+
}
|
|
162
|
+
return change.value;
|
|
163
|
+
})
|
|
164
|
+
.join('')
|
|
165
|
+
}))
|
|
166
|
+
.sort((a, b) => a.entry.localeCompare(b.entry)));
|
|
167
|
+
}
|
|
168
|
+
displayListBanner(versions, envKey, envType) {
|
|
169
|
+
this.ui.emptyLine();
|
|
170
|
+
this.ui.info(cli_shared_1.Text.version.list.details.banner(envKey, envType, versions));
|
|
171
|
+
this.ui.emptyLine();
|
|
172
|
+
}
|
|
173
|
+
displayWriteToFile(outFile) {
|
|
174
|
+
this.ui.info(cli_shared_1.Text.version.check.details.writeToFile(outFile));
|
|
175
|
+
}
|
|
176
|
+
displayVersionList(data) {
|
|
177
|
+
this.ui.table([
|
|
178
|
+
['version', 'Major Versions'],
|
|
179
|
+
['deploymentDate', 'Deployment Date'],
|
|
180
|
+
['egresses', 'Egress'],
|
|
181
|
+
['policies', 'Policies'],
|
|
182
|
+
['scopes', 'Scopes'],
|
|
183
|
+
['connectKeys', 'Connect keys'],
|
|
184
|
+
['functions', 'Functions'],
|
|
185
|
+
['remotes', 'Remotes'],
|
|
186
|
+
['modules', 'Modules'],
|
|
187
|
+
['requiresLicense', 'License']
|
|
188
|
+
], data.map(({ version, egresses, modules, policies, deploymentDateTime, ...rest }) => ({
|
|
189
|
+
...rest,
|
|
190
|
+
version: version.toString(),
|
|
191
|
+
deploymentDate: cli_shared_1.Text.version.list.details.deploymentDate(deploymentDateTime),
|
|
192
|
+
egresses: cli_shared_1.Text.version.list.details.egresses(egresses),
|
|
193
|
+
policies: cli_shared_1.Text.version.list.details.policies(policies),
|
|
194
|
+
modules: cli_shared_1.Text.version.list.details.modules(modules)
|
|
195
|
+
})));
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
exports.VersionView = VersionView;
|
|
@@ -13,6 +13,7 @@ export declare class GraphqlClient implements CreateEnvironmentClient, ListEnvir
|
|
|
13
13
|
type: AppEnvironmentType;
|
|
14
14
|
key: string;
|
|
15
15
|
lastDeployedAt: string;
|
|
16
|
+
primaryProduct: import("@forge/cli-shared").EcosystemRequiredProduct | undefined;
|
|
16
17
|
}[]>;
|
|
17
18
|
deleteEnvironments(details: BatchDeleteEnvironmentDetails): Promise<DeleteEnvironmentOutput[]>;
|
|
18
19
|
deleteEnvironment(details: DeleteEnvironmentDetails): Promise<true>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"graphql-client.d.ts","sourceRoot":"","sources":["../../src/environment/graphql-client.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,kBAAkB,EAIlB,aAAa,EAIb,SAAS,EACV,MAAM,mBAAmB,CAAC;AAC3B,O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OAAO,EAAE,6BAA6B;IAkBzD,iBAAiB,CAAC,OAAO,EAAE,wBAAwB;CAuDjE"}
|
|
@@ -59,6 +59,7 @@ class GraphqlClient {
|
|
|
59
59
|
versions(first: 1) {
|
|
60
60
|
nodes {
|
|
61
61
|
updatedAt
|
|
62
|
+
primaryProduct
|
|
62
63
|
}
|
|
63
64
|
}
|
|
64
65
|
}
|
|
@@ -75,7 +76,8 @@ class GraphqlClient {
|
|
|
75
76
|
return {
|
|
76
77
|
type: environment.type,
|
|
77
78
|
key: environment.key,
|
|
78
|
-
lastDeployedAt: environment.versions?.nodes?.[0]?.updatedAt || environment.createdAt
|
|
79
|
+
lastDeployedAt: environment.versions?.nodes?.[0]?.updatedAt || environment.createdAt,
|
|
80
|
+
primaryProduct: environment.versions?.nodes?.[0]?.primaryProduct || undefined
|
|
79
81
|
};
|
|
80
82
|
});
|
|
81
83
|
}
|
|
@@ -4,6 +4,7 @@ export interface ListEnvironmentDetails {
|
|
|
4
4
|
}
|
|
5
5
|
export interface ListEnvironmentOutput extends Pick<AppEnvironment, 'key' | 'type'> {
|
|
6
6
|
lastDeployedAt: string;
|
|
7
|
+
primaryProduct?: string;
|
|
7
8
|
}
|
|
8
9
|
export interface ListEnvironmentClient {
|
|
9
10
|
listEnvironment(details: ListEnvironmentDetails): Promise<ListEnvironmentOutput[]>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"list-environment.d.ts","sourceRoot":"","sources":["../../src/environment/list-environment.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAEtE,MAAM,WAAW,sBAAsB;IACrC,KAAK,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,qBAAsB,SAAQ,IAAI,CAAC,cAAc,EAAE,KAAK,GAAG,MAAM,CAAC;IACjF,cAAc,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"list-environment.d.ts","sourceRoot":"","sources":["../../src/environment/list-environment.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAEtE,MAAM,WAAW,sBAAsB;IACrC,KAAK,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,qBAAsB,SAAQ,IAAI,CAAC,cAAc,EAAE,KAAK,GAAG,MAAM,CAAC;IACjF,cAAc,EAAE,MAAM,CAAC;IACvB,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AAED,MAAM,WAAW,qBAAqB;IACpC,eAAe,CAAC,OAAO,EAAE,sBAAsB,GAAG,OAAO,CAAC,qBAAqB,EAAE,CAAC,CAAC;CACpF;AAED,qBAAa,sBAAsB;IAE/B,OAAO,CAAC,QAAQ,CAAC,MAAM;IACvB,OAAO,CAAC,QAAQ,CAAC,YAAY;gBADZ,MAAM,EAAE,qBAAqB,EAC7B,YAAY,EAAE,iBAAiB;IAGrC,OAAO;CAMrB"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { AppUninstallationInput, GraphQLClient, GraphQlMutationError, Pause, BaseError, UserError } from '@forge/cli-shared';
|
|
1
|
+
import { AppEnvironmentType, AppUninstallationInput, GraphQLClient, GraphQlMutationError, Pause, BaseError, UserError } from '@forge/cli-shared';
|
|
2
2
|
import { AppInstallSiteDetails, InstallAppClient } from './install-app-site';
|
|
3
|
-
import { AppEnvironmentVersionData, Installation, ListAppInstallationsClient, UpgradeAppInstallationsClient } from '../service/installation-service';
|
|
3
|
+
import { AppEnvironmentVersionData, HasNoAppInstallationsForEnvClient, Installation, ListAppInstallationsClient, UpgradeAppInstallationsClient } from '../service/installation-service';
|
|
4
4
|
import { UninstallAppClient, UninstallAppOutput } from './uninstall-app';
|
|
5
5
|
import { SiteTranslator } from './site-translation';
|
|
6
6
|
export declare const UNINSTALLATION_EVENT_POLL_INTERVAL = 500;
|
|
@@ -44,15 +44,15 @@ export declare class MissingAppUninstallTask extends Error {
|
|
|
44
44
|
}
|
|
45
45
|
export declare class InstallationNotFoundError extends UserError {
|
|
46
46
|
}
|
|
47
|
-
export declare class InstallationsGraphqlClient implements InstallAppClient, ListAppInstallationsClient, UninstallAppClient, UpgradeAppInstallationsClient {
|
|
47
|
+
export declare class InstallationsGraphqlClient implements InstallAppClient, ListAppInstallationsClient, UninstallAppClient, UpgradeAppInstallationsClient, HasNoAppInstallationsForEnvClient {
|
|
48
48
|
private readonly graphqlClient;
|
|
49
|
-
private readonly
|
|
49
|
+
private readonly sitedProductTranslator;
|
|
50
50
|
private readonly bitbucketTranslator;
|
|
51
51
|
private readonly pause;
|
|
52
52
|
SITE_RESOURCE_TYPE: string;
|
|
53
53
|
WORKSPACE_RESOURCE_TYPE: string;
|
|
54
54
|
static buildInstallationContext(product: string, resourceId: string, resourceType: string): string;
|
|
55
|
-
constructor(graphqlClient: GraphQLClient,
|
|
55
|
+
constructor(graphqlClient: GraphQLClient, sitedProductTranslator: SiteTranslator, bitbucketTranslator: SiteTranslator, pause: Pause);
|
|
56
56
|
private buildInstallationContext;
|
|
57
57
|
private getProductTranslation;
|
|
58
58
|
installAppIntoSite({ environmentKey, site, product, appId, licenseOverride, overrides }: AppInstallSiteDetails): Promise<void>;
|
|
@@ -62,6 +62,7 @@ export declare class InstallationsGraphqlClient implements InstallAppClient, Lis
|
|
|
62
62
|
uninstallMultipleApps(apps: AppUninstallationInput[]): Promise<Partial<UninstallAppOutput>[]>;
|
|
63
63
|
listInstallations(appId: string): Promise<Installation[]>;
|
|
64
64
|
getInstallation(appId: string, installationId: string): Promise<Installation>;
|
|
65
|
+
hasNoAppInstallationsForEnv(appId: string, appEnv: AppEnvironmentType): Promise<boolean>;
|
|
65
66
|
private getAppInstallationTask;
|
|
66
67
|
private getAppInstallationTaskRetry;
|
|
67
68
|
private monitorUninstallApp;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"graphql-client.d.ts","sourceRoot":"","sources":["../../src/installations/graphql-client.ts"],"names":[],"mappings":"AAKA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