@forge/cli 0.0.0-experimental-819498d → 0.0.0-experimental-a9f00a0
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 +2901 -7
- package/README.md +18 -19
- package/npm-shrinkwrap.json +1957 -4159
- package/out/analytics-client/analytics-client.d.ts +0 -24
- package/out/analytics-client/analytics-client.d.ts.map +1 -1
- package/out/analytics-client/analytics-client.js +0 -115
- package/out/analytics-client/analytics-message-handler.d.ts +1 -5
- package/out/analytics-client/analytics-message-handler.d.ts.map +1 -1
- package/out/analytics-client/analytics-message-handler.js +2 -30
- package/out/autocomplete/autocomplete-config.json +16 -26
- package/out/bin/cli.js +0 -2
- package/out/bin/postinstall.js +0 -13
- package/out/command-line/anon-user-id.js +6 -10
- package/out/command-line/command.d.ts +7 -3
- package/out/command-line/command.d.ts.map +1 -1
- package/out/command-line/command.js +56 -60
- package/out/command-line/controller/deploy-controller.d.ts +13 -2
- package/out/command-line/controller/deploy-controller.d.ts.map +1 -1
- package/out/command-line/controller/deploy-controller.js +67 -5
- package/out/command-line/controller/install-controller.d.ts +2 -1
- package/out/command-line/controller/install-controller.d.ts.map +1 -1
- package/out/command-line/controller/install-controller.js +28 -32
- package/out/command-line/controller/lint-controller.js +1 -1
- package/out/command-line/controller/pre-command-controller.js +1 -1
- package/out/command-line/controller/prerequisites-controller.d.ts +11 -0
- package/out/command-line/controller/prerequisites-controller.d.ts.map +1 -0
- package/out/command-line/controller/prerequisites-controller.js +34 -0
- package/out/command-line/controller/stubController.d.ts +9 -0
- package/out/command-line/controller/stubController.d.ts.map +1 -0
- package/out/command-line/controller/stubController.js +15 -0
- package/out/command-line/controller/tunnel-controller.d.ts.map +1 -1
- package/out/command-line/controller/tunnel-controller.js +0 -1
- package/out/command-line/dependency-injection.d.ts +11 -3
- package/out/command-line/dependency-injection.d.ts.map +1 -1
- package/out/command-line/dependency-injection.js +38 -23
- package/out/command-line/index.d.ts.map +1 -1
- package/out/command-line/index.js +4 -0
- package/out/command-line/register-app-commands.d.ts.map +1 -1
- package/out/command-line/register-app-commands.js +1 -9
- package/out/command-line/register-authentication-command.d.ts.map +1 -1
- package/out/command-line/register-authentication-command.js +0 -16
- package/out/command-line/register-deployment-commands.d.ts +8 -0
- package/out/command-line/register-deployment-commands.d.ts.map +1 -1
- package/out/command-line/register-environment-variables-commands.d.ts +1 -1
- package/out/command-line/register-environment-variables-commands.d.ts.map +1 -1
- package/out/command-line/register-environment-variables-commands.js +22 -7
- package/out/command-line/register-installation-commands.d.ts +1 -1
- package/out/command-line/register-installation-commands.d.ts.map +1 -1
- package/out/command-line/register-installation-commands.js +19 -13
- package/out/command-line/register-providers-commands.d.ts +3 -0
- package/out/command-line/register-providers-commands.d.ts.map +1 -0
- package/out/command-line/register-providers-commands.js +43 -0
- package/out/command-line/register-webtrigger-commands.d.ts.map +1 -1
- package/out/command-line/register-webtrigger-commands.js +9 -11
- package/out/command-line/unique-machine-id.d.ts.map +1 -1
- package/out/command-line/unique-machine-id.js +1 -10
- package/out/command-line/version-info.d.ts +1 -0
- package/out/command-line/version-info.d.ts.map +1 -1
- package/out/command-line/version-info.js +3 -2
- package/out/command-line/view/deploy-view.d.ts +7 -1
- package/out/command-line/view/deploy-view.d.ts.map +1 -1
- package/out/command-line/view/deploy-view.js +22 -5
- package/out/command-line/view/install-view.d.ts +5 -5
- package/out/command-line/view/install-view.d.ts.map +1 -1
- package/out/command-line/view/install-view.js +20 -15
- package/out/command-line/view/lint-view.d.ts +3 -2
- package/out/command-line/view/lint-view.d.ts.map +1 -1
- package/out/command-line/view/lint-view.js +3 -0
- package/out/command-line/view/lite-lint-view.d.ts +3 -2
- package/out/command-line/view/lite-lint-view.d.ts.map +1 -1
- package/out/command-line/view/lite-lint-view.js +3 -0
- package/out/deploy/deployer/deploy-monitor-graphql-client.js +1 -1
- package/out/deploy/deployer/trigger-deploy-graphql-client.js +1 -1
- package/out/deploy/packager/archiver.d.ts +3 -2
- package/out/deploy/packager/archiver.d.ts.map +1 -1
- package/out/deploy/packager/archiver.js +10 -2
- package/out/deploy/packager/packager.d.ts +1 -3
- package/out/deploy/packager/packager.d.ts.map +1 -1
- package/out/deploy/packager/packager.js +2 -25
- package/out/deploy/uploader/artifact-graphql-client.js +2 -2
- package/out/environment-variables/graphql-client.d.ts +1 -1
- package/out/environment-variables/graphql-client.js +3 -3
- package/out/installations/graphql-client.d.ts +7 -9
- package/out/installations/graphql-client.d.ts.map +1 -1
- package/out/installations/graphql-client.js +61 -85
- package/out/installations/install-app-site.d.ts +2 -8
- package/out/installations/install-app-site.d.ts.map +1 -1
- package/out/installations/install-app-site.js +2 -3
- package/out/installations/uninstall-app.d.ts +0 -1
- package/out/installations/uninstall-app.d.ts.map +1 -1
- package/out/installations/uninstall-app.js +2 -4
- package/out/migration-keys/graphql-client.d.ts +8 -0
- package/out/migration-keys/graphql-client.d.ts.map +1 -0
- package/out/migration-keys/graphql-client.js +55 -0
- package/out/providers/configure-provider.d.ts +19 -0
- package/out/providers/configure-provider.d.ts.map +1 -0
- package/out/providers/configure-provider.js +14 -0
- package/out/providers/graphql-client.d.ts +12 -0
- package/out/providers/graphql-client.d.ts.map +1 -0
- package/out/providers/graphql-client.js +47 -0
- package/out/service/installation-service.d.ts +13 -11
- package/out/service/installation-service.d.ts.map +1 -1
- package/out/service/installation-service.js +38 -13
- package/out/service/lint-service.d.ts +2 -2
- package/out/service/lint-service.d.ts.map +1 -1
- package/out/service/lint-service.js +2 -2
- package/out/service/lite-lint-service.d.ts +3 -3
- package/out/service/lite-lint-service.d.ts.map +1 -1
- package/out/service/lite-lint-service.js +2 -2
- package/out/service/migration-keys-service.d.ts +19 -0
- package/out/service/migration-keys-service.d.ts.map +1 -0
- package/out/service/migration-keys-service.js +14 -0
- package/out/service/resource-packaging-service.d.ts +3 -2
- package/out/service/resource-packaging-service.d.ts.map +1 -1
- package/out/service/resource-packaging-service.js +6 -2
- package/out/service/tunnel-analytics-service.d.ts +0 -5
- package/out/service/tunnel-analytics-service.d.ts.map +1 -1
- package/out/service/tunnel-analytics-service.js +3 -14
- package/out/service/tunnel-service.d.ts +1 -3
- package/out/service/tunnel-service.d.ts.map +1 -1
- package/out/service/tunnel-service.js +8 -9
- package/out/webtrigger/get-webtrigger-url.d.ts +10 -4
- package/out/webtrigger/get-webtrigger-url.d.ts.map +1 -1
- package/out/webtrigger/get-webtrigger-url.js +11 -21
- package/out/webtrigger/graphql-client.d.ts +14 -0
- package/out/webtrigger/graphql-client.d.ts.map +1 -0
- package/out/webtrigger/graphql-client.js +52 -0
- package/out/workers/forge-cli-workers.js +2 -2
- package/package.json +12 -13
- package/out/bin/preinstall.d.ts +0 -3
- package/out/bin/preinstall.d.ts.map +0 -1
- package/out/bin/preinstall.js +0 -9
- package/out/command-line/cli-prerequisites.d.ts +0 -3
- package/out/command-line/cli-prerequisites.d.ts.map +0 -1
- package/out/command-line/cli-prerequisites.js +0 -37
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.registerCommands = void 0;
|
|
4
|
+
const cli_shared_1 = require("@forge/cli-shared");
|
|
5
|
+
const cli_shared_2 = require("@forge/cli-shared");
|
|
6
|
+
const registerConfigureProviderCommand = ({ cmd, ui, commands: { configureProviderCommand }, configFile }) => {
|
|
7
|
+
cmd
|
|
8
|
+
.command('providers')
|
|
9
|
+
.description(cli_shared_1.Text.providers.desc)
|
|
10
|
+
.command('configure [providerKey]')
|
|
11
|
+
.requireAppId()
|
|
12
|
+
.description(cli_shared_1.Text.configureProvider.cmd.desc)
|
|
13
|
+
.option('-s, --oauth-client-secret [oauthClientSecret]', cli_shared_1.Text.configureProvider.optionClientSecret)
|
|
14
|
+
.environmentOption()
|
|
15
|
+
.action(async (providerKey, { environment, oauthClientSecret }) => {
|
|
16
|
+
ui.info(cli_shared_1.Text.configureProvider.overview(environment, cli_shared_2.environmentToOption));
|
|
17
|
+
ui.info(cli_shared_1.Text.ctrlC);
|
|
18
|
+
ui.emptyLine();
|
|
19
|
+
const availableProviders = await configFile.getAuthProviders();
|
|
20
|
+
if (!providerKey || !availableProviders[providerKey]) {
|
|
21
|
+
const providersList = Object.values(availableProviders);
|
|
22
|
+
if (providersList.length === 0) {
|
|
23
|
+
ui.info(cli_shared_1.Text.configureProvider.noProviders);
|
|
24
|
+
ui.emptyLine();
|
|
25
|
+
return;
|
|
26
|
+
}
|
|
27
|
+
const providerIndex = await ui.promptForSingleChoiceTable(cli_shared_1.Text.configureProvider.promptProviderKey, cli_shared_1.Text.configureProvider.providerKeyInfo, ['Provider Key', 'Provider Name'], providersList.map(({ key, name }) => ({
|
|
28
|
+
names: [key, name],
|
|
29
|
+
value: key,
|
|
30
|
+
primary: name
|
|
31
|
+
})));
|
|
32
|
+
providerKey = providersList[providerIndex].key;
|
|
33
|
+
}
|
|
34
|
+
if (!oauthClientSecret) {
|
|
35
|
+
oauthClientSecret = await ui.promptForSecret(cli_shared_1.Text.configureProvider.promptClientSecret);
|
|
36
|
+
ui.emptyLine();
|
|
37
|
+
}
|
|
38
|
+
await ui.displayProgress(() => configureProviderCommand.execute({ environment, providerKey, clientSecret: oauthClientSecret }), cli_shared_1.Text.configureProvider.cmd.start, cli_shared_1.Text.configureProvider.cmd.success);
|
|
39
|
+
});
|
|
40
|
+
};
|
|
41
|
+
exports.registerCommands = (deps) => {
|
|
42
|
+
registerConfigureProviderCommand(deps);
|
|
43
|
+
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"register-webtrigger-commands.d.ts","sourceRoot":"","sources":["../../src/command-line/register-webtrigger-commands.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"register-webtrigger-commands.d.ts","sourceRoot":"","sources":["../../src/command-line/register-webtrigger-commands.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AA+BtD,eAAO,MAAM,gBAAgB,mFAM1B,YAAY,SA8Bd,CAAC"}
|
|
@@ -4,7 +4,6 @@ exports.registerCommands = void 0;
|
|
|
4
4
|
const cli_shared_1 = require("@forge/cli-shared");
|
|
5
5
|
const cli_shared_2 = require("@forge/cli-shared");
|
|
6
6
|
const cli_shared_3 = require("@forge/cli-shared");
|
|
7
|
-
const cli_shared_4 = require("@forge/cli-shared");
|
|
8
7
|
const getAvailableWebTriggers = (appConfig) => {
|
|
9
8
|
const output = new Map();
|
|
10
9
|
if (appConfig.modules && appConfig.modules.webtrigger) {
|
|
@@ -18,7 +17,7 @@ async function getValidWebtriggers(configFile) {
|
|
|
18
17
|
const manifest = await configFile.readConfig();
|
|
19
18
|
const availableWebTriggers = getAvailableWebTriggers(manifest);
|
|
20
19
|
if (!availableWebTriggers.size) {
|
|
21
|
-
throw new
|
|
20
|
+
throw new cli_shared_3.ValidationError(cli_shared_2.Text.webtrigger.error.noWebtriggers);
|
|
22
21
|
}
|
|
23
22
|
return availableWebTriggers;
|
|
24
23
|
}
|
|
@@ -32,26 +31,25 @@ exports.registerCommands = ({ cmd, ui, graphqlGateway, configFile, commands: { g
|
|
|
32
31
|
const availableWebTriggers = await getValidWebtriggers(configFile);
|
|
33
32
|
if (functionKey) {
|
|
34
33
|
if (!availableWebTriggers.has(functionKey)) {
|
|
35
|
-
throw new
|
|
34
|
+
throw new cli_shared_3.ValidationError(cli_shared_2.Text.webtrigger.error.funcKey);
|
|
36
35
|
}
|
|
37
36
|
return functionKey;
|
|
38
37
|
}
|
|
39
38
|
else {
|
|
40
39
|
const options = [...availableWebTriggers.keys()];
|
|
41
|
-
return await ui.promptForList(
|
|
40
|
+
return await ui.promptForList(cli_shared_2.Text.webtrigger.promptFuncKey, options);
|
|
42
41
|
}
|
|
43
42
|
};
|
|
44
43
|
cmd
|
|
45
44
|
.command('webtrigger [installationId]')
|
|
46
45
|
.requireAppId()
|
|
47
|
-
.description(
|
|
48
|
-
.option('-f, --functionKey [function]',
|
|
46
|
+
.description(cli_shared_2.Text.webtrigger.cmd)
|
|
47
|
+
.option('-f, --functionKey [function]', cli_shared_2.Text.webtrigger.optionFuncKey)
|
|
49
48
|
.precondition(manifestDefinesTriggers(configFile))
|
|
50
49
|
.action(async (installationId, { functionKey }) => {
|
|
51
|
-
ui.info(
|
|
52
|
-
const installId = await
|
|
53
|
-
const
|
|
54
|
-
|
|
55
|
-
ui.info(cli_shared_3.Text.webtrigger.copy(url));
|
|
50
|
+
ui.info(cli_shared_2.Text.webtrigger.overviewFuncKey);
|
|
51
|
+
const installId = await cli_shared_1.getInstallationId(ui, installationId);
|
|
52
|
+
const url = await getWebTriggerURLCommand.execute(installId, await validateWebtriggerKey(functionKey));
|
|
53
|
+
ui.info(cli_shared_2.Text.webtrigger.copy(url));
|
|
56
54
|
});
|
|
57
55
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"unique-machine-id.d.ts","sourceRoot":"","sources":["../../src/command-line/unique-machine-id.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,iBAAiB,eAAe,CAAC;AAW9C,eAAO,MAAM,YAAY,QAAO,
|
|
1
|
+
{"version":3,"file":"unique-machine-id.d.ts","sourceRoot":"","sources":["../../src/command-line/unique-machine-id.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,iBAAiB,eAAe,CAAC;AAW9C,eAAO,MAAM,YAAY,QAAO,MACgE,CAAC"}
|
|
@@ -15,13 +15,4 @@ const generateMachineId = () => {
|
|
|
15
15
|
return uuid_1.default();
|
|
16
16
|
}
|
|
17
17
|
};
|
|
18
|
-
exports.getMachineId = () =>
|
|
19
|
-
const cachedConf = cli_shared_1.CachedConf.getCache(exports.FORGE_CLI_PACKAGE);
|
|
20
|
-
const storedMachineId = cachedConf.get(MACHINE_ID_CACHE_KEY);
|
|
21
|
-
if (storedMachineId) {
|
|
22
|
-
return storedMachineId;
|
|
23
|
-
}
|
|
24
|
-
const newMachineId = generateMachineId();
|
|
25
|
-
cachedConf.set(MACHINE_ID_CACHE_KEY, newMachineId);
|
|
26
|
-
return newMachineId;
|
|
27
|
-
};
|
|
18
|
+
exports.getMachineId = () => cli_shared_1.CachedConf.getCache(exports.FORGE_CLI_PACKAGE).cached(MACHINE_ID_CACHE_KEY, generateMachineId);
|
|
@@ -2,6 +2,7 @@ export declare const VERSION_CACHE_KEY = "latest";
|
|
|
2
2
|
export declare const VERSION_CACHE_INTERVAL: number;
|
|
3
3
|
import { CLIDetails } from '@forge/cli-shared';
|
|
4
4
|
export declare const getCLIDetails: () => CLIDetails | undefined;
|
|
5
|
+
export declare const supportedNodeVersion = "14.x || 16.x";
|
|
5
6
|
export declare const cacheLatestVersion: (name: string) => Promise<void>;
|
|
6
7
|
export declare const clearVersionCache: (name: string) => void;
|
|
7
8
|
//# sourceMappingURL=version-info.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"version-info.d.ts","sourceRoot":"","sources":["../../src/command-line/version-info.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,iBAAiB,WAAW,CAAC;AAC1C,eAAO,MAAM,sBAAsB,QAAsB,CAAC;AAE1D,OAAO,EAAc,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAE3D,eAAO,MAAM,aAAa,QAAO,UAAU,GAAG,SAgB7C,CAAC;AAEF,eAAO,MAAM,kBAAkB,SAAgB,MAAM,KAAG,OAAO,CAAC,IAAI,CAInE,CAAC;AAEF,eAAO,MAAM,iBAAiB,SAAU,MAAM,SAG7C,CAAC"}
|
|
1
|
+
{"version":3,"file":"version-info.d.ts","sourceRoot":"","sources":["../../src/command-line/version-info.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,iBAAiB,WAAW,CAAC;AAC1C,eAAO,MAAM,sBAAsB,QAAsB,CAAC;AAE1D,OAAO,EAAc,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAE3D,eAAO,MAAM,aAAa,QAAO,UAAU,GAAG,SAgB7C,CAAC;AAEF,eAAO,MAAM,oBAAoB,iBAAiB,CAAC;AAEnD,eAAO,MAAM,kBAAkB,SAAgB,MAAM,KAAG,OAAO,CAAC,IAAI,CAInE,CAAC;AAEF,eAAO,MAAM,iBAAiB,SAAU,MAAM,SAG7C,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.clearVersionCache = exports.cacheLatestVersion = exports.getCLIDetails = exports.VERSION_CACHE_INTERVAL = exports.VERSION_CACHE_KEY = void 0;
|
|
3
|
+
exports.clearVersionCache = exports.cacheLatestVersion = exports.supportedNodeVersion = exports.getCLIDetails = exports.VERSION_CACHE_INTERVAL = exports.VERSION_CACHE_KEY = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const latest_version_1 = tslib_1.__importDefault(require("latest-version"));
|
|
6
6
|
exports.VERSION_CACHE_KEY = 'latest';
|
|
@@ -15,13 +15,14 @@ exports.getCLIDetails = () => {
|
|
|
15
15
|
name: packageInfo.name,
|
|
16
16
|
version: packageInfo.version,
|
|
17
17
|
latest: latest,
|
|
18
|
-
|
|
18
|
+
compatibleNodeVersion: packageInfo.engines.node
|
|
19
19
|
};
|
|
20
20
|
}
|
|
21
21
|
catch (_a) {
|
|
22
22
|
return undefined;
|
|
23
23
|
}
|
|
24
24
|
};
|
|
25
|
+
exports.supportedNodeVersion = '14.x || 16.x';
|
|
25
26
|
exports.cacheLatestVersion = async (name) => {
|
|
26
27
|
const latest = await latest_version_1.default(name);
|
|
27
28
|
const cachedConf = cli_shared_1.CachedConf.getCache(name);
|
|
@@ -4,12 +4,18 @@ import { DeploymentResult } from '../register-deployment-commands';
|
|
|
4
4
|
export declare class DeployView {
|
|
5
5
|
private readonly ui;
|
|
6
6
|
constructor(ui: UI);
|
|
7
|
+
getLogger(): UI;
|
|
7
8
|
displayStart(environment: string): void;
|
|
8
9
|
displayLintRunning(): void;
|
|
9
10
|
displayOutdatedInstallationsMessage(): void;
|
|
10
11
|
displayLintErrors(lintResults: LintResult[]): void;
|
|
11
12
|
displayLintWarnings(warnings: number): void;
|
|
12
13
|
displayNoLintProblems(): void;
|
|
13
|
-
|
|
14
|
+
displayConnectKeyChangeWarning(environment: string, migrationKey: string, connectKey: string): void;
|
|
15
|
+
displayConnectKeyDeleteWarning(environment: string): void;
|
|
16
|
+
displayMPACAppConnectKeyChangeError(mpacAppKey: string, connectKey: string): void;
|
|
17
|
+
promptToContinueDeletingConnectKey(): Promise<boolean>;
|
|
18
|
+
promptToContinueChangingConnectKey(): Promise<boolean>;
|
|
19
|
+
reportDeploymentProgress(id: string, environment: string, showDistributionPageLink: boolean, deployCallback: () => Promise<DeploymentResult>): Promise<DeploymentResult>;
|
|
14
20
|
}
|
|
15
21
|
//# sourceMappingURL=deploy-view.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"deploy-view.d.ts","sourceRoot":"","sources":["../../../src/command-line/view/deploy-view.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAuC,MAAM,mBAAmB,CAAC;AAC5E,OAAO,EAAqB,UAAU,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"deploy-view.d.ts","sourceRoot":"","sources":["../../../src/command-line/view/deploy-view.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAuC,MAAM,mBAAmB,CAAC;AAC5E,OAAO,EAAqB,UAAU,EAAE,MAAM,aAAa,CAAC;AAC5D,OAAO,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AAEnE,qBAAa,UAAU;IACT,OAAO,CAAC,QAAQ,CAAC,EAAE;gBAAF,EAAE,EAAE,EAAE;IAE5B,SAAS,IAAI,EAAE;IAIf,YAAY,CAAC,WAAW,EAAE,MAAM,GAAG,IAAI;IAIvC,kBAAkB,IAAI,IAAI;IAI1B,mCAAmC,IAAI,IAAI;IAK3C,iBAAiB,CAAC,WAAW,EAAE,UAAU,EAAE,GAAG,IAAI;IAKlD,mBAAmB,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI;IAI3C,qBAAqB,IAAI,IAAI;IAI7B,8BAA8B,CAAC,WAAW,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,IAAI;IAInG,8BAA8B,CAAC,WAAW,EAAE,MAAM,GAAG,IAAI;IAIzD,mCAAmC,CAAC,UAAU,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,IAAI;IAI3E,kCAAkC,IAAI,OAAO,CAAC,OAAO,CAAC;IAItD,kCAAkC,IAAI,OAAO,CAAC,OAAO,CAAC;IAItD,wBAAwB,CACnC,EAAE,EAAE,MAAM,EACV,WAAW,EAAE,MAAM,EACnB,wBAAwB,EAAE,OAAO,EACjC,cAAc,EAAE,MAAM,OAAO,CAAC,gBAAgB,CAAC,GAC9C,OAAO,CAAC,gBAAgB,CAAC;CAY7B"}
|
|
@@ -3,11 +3,13 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.DeployView = void 0;
|
|
4
4
|
const cli_shared_1 = require("@forge/cli-shared");
|
|
5
5
|
const lint_1 = require("@forge/lint");
|
|
6
|
-
const cs_ari_1 = require("@forge/util/packages/cs-ari");
|
|
7
6
|
class DeployView {
|
|
8
7
|
constructor(ui) {
|
|
9
8
|
this.ui = ui;
|
|
10
9
|
}
|
|
10
|
+
getLogger() {
|
|
11
|
+
return this.ui;
|
|
12
|
+
}
|
|
11
13
|
displayStart(environment) {
|
|
12
14
|
this.ui.info(cli_shared_1.Text.deploy.cmd.start1(environment, cli_shared_1.environmentToOption));
|
|
13
15
|
}
|
|
@@ -28,11 +30,26 @@ class DeployView {
|
|
|
28
30
|
displayNoLintProblems() {
|
|
29
31
|
this.ui.info(cli_shared_1.LogColor.trace(cli_shared_1.Text.lint.noProblems) + '\n');
|
|
30
32
|
}
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
33
|
+
displayConnectKeyChangeWarning(environment, migrationKey, connectKey) {
|
|
34
|
+
this.ui.warn(cli_shared_1.Text.deploy.connectKeyChange.connectKeyChangeWarning(environment, migrationKey, connectKey));
|
|
35
|
+
}
|
|
36
|
+
displayConnectKeyDeleteWarning(environment) {
|
|
37
|
+
this.ui.warn(cli_shared_1.Text.deploy.connectKeyChange.connectKeyDeleteWarning(environment));
|
|
38
|
+
}
|
|
39
|
+
displayMPACAppConnectKeyChangeError(mpacAppKey, connectKey) {
|
|
40
|
+
this.ui.info(cli_shared_1.Text.deploy.connectKeyChange.mpacAppConnectKeyChangeError(mpacAppKey, connectKey));
|
|
41
|
+
}
|
|
42
|
+
async promptToContinueDeletingConnectKey() {
|
|
43
|
+
return await this.ui.confirm(cli_shared_1.Text.deploy.connectKeyChange.continueDelete);
|
|
44
|
+
}
|
|
45
|
+
async promptToContinueChangingConnectKey() {
|
|
46
|
+
return await this.ui.confirm(cli_shared_1.Text.deploy.connectKeyChange.continueChange);
|
|
47
|
+
}
|
|
48
|
+
async reportDeploymentProgress(id, environment, showDistributionPageLink, deployCallback) {
|
|
49
|
+
const result = await this.ui.displayProgress(() => deployCallback(), cli_shared_1.Text.deploy.cmd.start2(environment, cli_shared_1.environmentToOption), cli_shared_1.Text.deploy.cmd.success);
|
|
50
|
+
this.ui.info(cli_shared_1.Text.deploy.cmd.successDetails(environment, cli_shared_1.environmentToOption));
|
|
34
51
|
if (environment === 'production' && showDistributionPageLink) {
|
|
35
|
-
this.ui.info(
|
|
52
|
+
this.ui.info('fff');
|
|
36
53
|
}
|
|
37
54
|
return result;
|
|
38
55
|
}
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import { Installation } from '../../service/installation-service';
|
|
2
1
|
import { UI } from '@forge/cli-shared';
|
|
2
|
+
import { AppEnvironmentPermissions, Installation } from '../../service/installation-service';
|
|
3
3
|
interface InstallOrUpgradeCommandText {
|
|
4
4
|
listScopes: (scopes: string[]) => string;
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
listEgressAddresses: (egressAddresses: string[]) => string;
|
|
6
|
+
permissionsMismatch: (environment: string) => string;
|
|
7
|
+
promptForPermissionsConfirmation: (permissionsMismatchInDevelopment: boolean) => string;
|
|
7
8
|
}
|
|
8
9
|
export declare class NoScopesError extends Error {
|
|
9
10
|
}
|
|
10
11
|
export declare class InstallView {
|
|
11
12
|
private readonly ui;
|
|
12
13
|
constructor(ui: UI);
|
|
13
|
-
|
|
14
|
-
promptForScopesConfirmation(environmentScopes: string[], manifestScopes: string[] | undefined, environment: string, confirmScopes: boolean, text: InstallOrUpgradeCommandText): Promise<boolean>;
|
|
14
|
+
promptForPermissionsConfirmation({ scopes, egressAddresses, addedScopes }: AppEnvironmentPermissions, manifestScopes: string[], manifestEgressAddresses: string[], environment: string, confirmScopes: boolean, nonInteractive: boolean, text: InstallOrUpgradeCommandText): Promise<boolean>;
|
|
15
15
|
promptForUpgrade(installations: Installation[]): Promise<Installation>;
|
|
16
16
|
}
|
|
17
17
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"install-view.d.ts","sourceRoot":"","sources":["../../../src/command-line/view/install-view.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"install-view.d.ts","sourceRoot":"","sources":["../../../src/command-line/view/install-view.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgD,EAAE,EAA8B,MAAM,mBAAmB,CAAC;AAGjH,OAAO,EAAE,yBAAyB,EAAE,YAAY,EAAE,MAAM,oCAAoC,CAAC;AAE7F,UAAU,2BAA2B;IACnC,UAAU,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,MAAM,CAAC;IACzC,mBAAmB,EAAE,CAAC,eAAe,EAAE,MAAM,EAAE,KAAK,MAAM,CAAC;IAC3D,mBAAmB,EAAE,CAAC,WAAW,EAAE,MAAM,KAAK,MAAM,CAAC;IACrD,gCAAgC,EAAE,CAAC,gCAAgC,EAAE,OAAO,KAAK,MAAM,CAAC;CACzF;AAED,qBAAa,aAAc,SAAQ,KAAK;CAAG;AAE3C,qBAAa,WAAW;IACV,OAAO,CAAC,QAAQ,CAAC,EAAE;gBAAF,EAAE,EAAE,EAAE;IAEtB,gCAAgC,CAC3C,EAAE,MAAM,EAAE,eAAe,EAAE,WAAW,EAAE,EAAE,yBAAyB,EACnE,cAAc,EAAE,MAAM,EAAE,EACxB,uBAAuB,EAAE,MAAM,EAAE,EACjC,WAAW,EAAE,MAAM,EACnB,aAAa,EAAE,OAAO,EACtB,cAAc,EAAE,OAAO,EACvB,IAAI,EAAE,2BAA2B,GAChC,OAAO,CAAC,OAAO,CAAC;IAoCN,gBAAgB,CAAC,aAAa,EAAE,YAAY,EAAE,GAAG,OAAO,CAAC,YAAY,CAAC;CAqBpF"}
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.InstallView = exports.NoScopesError = void 0;
|
|
4
4
|
const cli_shared_1 = require("@forge/cli-shared");
|
|
5
|
+
const lodash_1 = require("lodash");
|
|
5
6
|
class NoScopesError extends Error {
|
|
6
7
|
}
|
|
7
8
|
exports.NoScopesError = NoScopesError;
|
|
@@ -9,23 +10,27 @@ class InstallView {
|
|
|
9
10
|
constructor(ui) {
|
|
10
11
|
this.ui = ui;
|
|
11
12
|
}
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
}
|
|
15
|
-
async promptForScopesConfirmation(environmentScopes, manifestScopes, environment, confirmScopes, text) {
|
|
16
|
-
if (environmentScopes.length === 0) {
|
|
13
|
+
async promptForPermissionsConfirmation({ scopes, egressAddresses, addedScopes }, manifestScopes, manifestEgressAddresses, environment, confirmScopes, nonInteractive, text) {
|
|
14
|
+
if (scopes.length === 0) {
|
|
17
15
|
throw new NoScopesError();
|
|
18
16
|
}
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
(
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
17
|
+
if (addedScopes.length)
|
|
18
|
+
this.ui.info(text.listScopes(addedScopes));
|
|
19
|
+
if (egressAddresses.length)
|
|
20
|
+
this.ui.info(text.listEgressAddresses(egressAddresses));
|
|
21
|
+
const cleanedManifestScopes = [...new Set(['read:me', ...manifestScopes])];
|
|
22
|
+
const groupedManifestEgressAddresses = [];
|
|
23
|
+
let permissionsMismatchWithManifest = false;
|
|
24
|
+
if (cli_shared_1.environmentToOption(environment) === cli_shared_1.DEFAULT_ENVIRONMENT_OPTION) {
|
|
25
|
+
const scopesMismatch = !lodash_1.isEqual([...cleanedManifestScopes].sort(), [...scopes].sort());
|
|
26
|
+
const egressAddressesMismatch = !lodash_1.isEqual([...groupedManifestEgressAddresses].sort(), [...egressAddresses].sort());
|
|
27
|
+
permissionsMismatchWithManifest = scopesMismatch || egressAddressesMismatch;
|
|
28
|
+
if (permissionsMismatchWithManifest) {
|
|
29
|
+
this.ui.warn(text.permissionsMismatch(cli_shared_1.environmentToOption(environment)));
|
|
30
|
+
}
|
|
26
31
|
}
|
|
27
|
-
if (!confirmScopes) {
|
|
28
|
-
const scopesConfirmationResult = await this.ui.confirm(text.
|
|
32
|
+
if (!confirmScopes && !nonInteractive) {
|
|
33
|
+
const scopesConfirmationResult = await this.ui.confirm(text.promptForPermissionsConfirmation(permissionsMismatchWithManifest));
|
|
29
34
|
if (scopesConfirmationResult)
|
|
30
35
|
this.ui.emptyLine();
|
|
31
36
|
return scopesConfirmationResult;
|
|
@@ -33,7 +38,7 @@ class InstallView {
|
|
|
33
38
|
return true;
|
|
34
39
|
}
|
|
35
40
|
async promptForUpgrade(installations) {
|
|
36
|
-
const installationIndex = await this.ui.promptForSingleChoiceTable(cli_shared_1.Text.upgradeContext.promptInstallation, cli_shared_1.Text.upgradeContext.overview, ['Environment', 'Site', 'Product', '
|
|
41
|
+
const installationIndex = await this.ui.promptForSingleChoiceTable(cli_shared_1.Text.upgradeContext.promptInstallation, cli_shared_1.Text.upgradeContext.overview, ['Environment', 'Site', 'Product', 'Version'], installations.map(({ id, environmentKey, product, site, version }) => ({
|
|
37
42
|
names: [
|
|
38
43
|
cli_shared_1.environmentToOption(environmentKey),
|
|
39
44
|
site,
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { UI } from '@forge/cli-shared';
|
|
2
|
-
import { LintFixState, LintResult } from '@forge/lint';
|
|
2
|
+
import { LintFixState, LintLogger, LintResult } from '@forge/lint';
|
|
3
3
|
export declare class LintView {
|
|
4
4
|
private readonly ui;
|
|
5
5
|
private lintResultReporter;
|
|
6
|
-
constructor(ui: UI, lintResultReporter?: (logger: Pick<import("@forge/cli-shared").Logger, "info">, lintResults: LintResult[], showSummary?: boolean | undefined) => void);
|
|
6
|
+
constructor(ui: UI, lintResultReporter?: (logger: Pick<import("@forge/cli-shared/src").Logger, "info">, lintResults: LintResult[], showSummary?: boolean | undefined) => void);
|
|
7
7
|
reportLintResult(results: LintResult[]): void;
|
|
8
8
|
reportFixResult(result: LintFixState): void;
|
|
9
|
+
getLogger(): LintLogger;
|
|
9
10
|
showBlurb(): void;
|
|
10
11
|
}
|
|
11
12
|
//# sourceMappingURL=lint-view.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lint-view.d.ts","sourceRoot":"","sources":["../../../src/command-line/view/lint-view.ts"],"names":[],"mappings":"AAAA,OAAO,EAAQ,EAAE,EAAY,MAAM,mBAAmB,CAAC;AACvD,OAAO,EAAE,YAAY,EAAE,UAAU,EAAqB,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"lint-view.d.ts","sourceRoot":"","sources":["../../../src/command-line/view/lint-view.ts"],"names":[],"mappings":"AAAA,OAAO,EAAQ,EAAE,EAAY,MAAM,mBAAmB,CAAC;AACvD,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,UAAU,EAAqB,MAAM,aAAa,CAAC;AAEtF,qBAAa,QAAQ;IACP,OAAO,CAAC,QAAQ,CAAC,EAAE;IAAM,OAAO,CAAC,kBAAkB;gBAAlC,EAAE,EAAE,EAAE,EAAU,kBAAkB,uIAAoB;IAE5E,gBAAgB,CAAC,OAAO,EAAE,UAAU,EAAE,GAAG,IAAI;IAI7C,eAAe,CAAC,MAAM,EAAE,YAAY,GAAG,IAAI;IAU3C,SAAS,IAAI,UAAU;IAIvB,SAAS,IAAI,IAAI;CAGzB"}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { UI } from '@forge/cli-shared';
|
|
2
|
-
import { LintResult } from '@forge/lint';
|
|
2
|
+
import { LintLogger, LintResult } from '@forge/lint';
|
|
3
3
|
export declare class LiteLintView {
|
|
4
4
|
private readonly ui;
|
|
5
5
|
private reporter;
|
|
6
|
-
constructor(ui: UI, reporter?: (logger: Pick<import("@forge/cli-shared").Logger, "info">, lintResults: LintResult[], showSummary?: boolean | undefined) => void);
|
|
6
|
+
constructor(ui: UI, reporter?: (logger: Pick<import("@forge/cli-shared/src").Logger, "info">, lintResults: LintResult[], showSummary?: boolean | undefined) => void);
|
|
7
7
|
reportErrors(report: LintResult[]): void;
|
|
8
|
+
getLogger(): LintLogger;
|
|
8
9
|
}
|
|
9
10
|
//# sourceMappingURL=lite-lint-view.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lite-lint-view.d.ts","sourceRoot":"","sources":["../../../src/command-line/view/lite-lint-view.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAE,MAAM,mBAAmB,CAAC;AACvC,OAAO,EAAqB,UAAU,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"lite-lint-view.d.ts","sourceRoot":"","sources":["../../../src/command-line/view/lite-lint-view.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAE,MAAM,mBAAmB,CAAC;AACvC,OAAO,EAAqB,UAAU,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAExE,qBAAa,YAAY;IACX,OAAO,CAAC,QAAQ,CAAC,EAAE;IAAM,OAAO,CAAC,QAAQ;gBAAxB,EAAE,EAAE,EAAE,EAAU,QAAQ,uIAAoB;IAElE,YAAY,CAAC,MAAM,EAAE,UAAU,EAAE,GAAG,IAAI;IAKxC,SAAS,IAAI,UAAU;CAG/B"}
|
|
@@ -14,7 +14,7 @@ class DeployMonitorGraphqlClient {
|
|
|
14
14
|
}
|
|
15
15
|
async getDeployment({ appId, environmentKey, deploymentId }) {
|
|
16
16
|
const result = await this.graphqlClient.query(`
|
|
17
|
-
query
|
|
17
|
+
query forge_cli_getApplicationDeploymentStatus($appId: ID!, $environmentKey: String!, $id: ID!) {
|
|
18
18
|
appDeployment(appId: $appId, environmentKey: $environmentKey, id: $id) {
|
|
19
19
|
status
|
|
20
20
|
errorDetails {
|
|
@@ -14,7 +14,7 @@ class TriggerDeployGraphQLClient {
|
|
|
14
14
|
}
|
|
15
15
|
async deploy(deploymentDetails) {
|
|
16
16
|
const deployAppQuery = `
|
|
17
|
-
mutation
|
|
17
|
+
mutation forge_cli_deployApplication($input: CreateAppDeploymentInput!) {
|
|
18
18
|
createAppDeployment(input: $input) {
|
|
19
19
|
success
|
|
20
20
|
errors {
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
|
+
import { Logger } from '@forge/cli-shared';
|
|
2
3
|
export interface Archiver {
|
|
3
4
|
addFile(fileName: string, contents: Buffer): void;
|
|
4
|
-
|
|
5
|
+
addRootDependencyFiles(filePaths: string[], logger: Logger): void;
|
|
5
6
|
finalise(): Promise<string>;
|
|
6
7
|
onWarning(cb: (err: Error) => void): void;
|
|
7
8
|
onEntry(cb: (filePath: string) => void): void;
|
|
@@ -13,7 +14,7 @@ export declare class ZipArchiver implements Archiver {
|
|
|
13
14
|
private rejects;
|
|
14
15
|
constructor();
|
|
15
16
|
addFile(fileName: string, contents: Buffer): void;
|
|
16
|
-
|
|
17
|
+
addRootDependencyFiles(fileNames: string[], logger: Logger): void;
|
|
17
18
|
finalise(): Promise<string>;
|
|
18
19
|
onWarning(cb: (err: Error) => void): void;
|
|
19
20
|
onEntry(cb: (filePath: string) => void): void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"archiver.d.ts","sourceRoot":"","sources":["../../../src/deploy/packager/archiver.ts"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"archiver.d.ts","sourceRoot":"","sources":["../../../src/deploy/packager/archiver.ts"],"names":[],"mappings":";AAKA,OAAO,EAAE,MAAM,EAAQ,MAAM,mBAAmB,CAAC;AAEjD,MAAM,WAAW,QAAQ;IACvB,OAAO,CAAC,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IAClD,sBAAsB,CAAC,SAAS,EAAE,MAAM,EAAE,EAAE,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IAClE,QAAQ,IAAI,OAAO,CAAC,MAAM,CAAC,CAAC;IAC5B,SAAS,CAAC,EAAE,EAAE,CAAC,GAAG,EAAE,KAAK,KAAK,IAAI,GAAG,IAAI,CAAC;IAC1C,OAAO,CAAC,EAAE,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,IAAI,GAAG,IAAI,CAAC;CAC/C;AAED,qBAAa,WAAY,YAAW,QAAQ;IAC1C,OAAO,CAAC,OAAO,CAAmB;IAClC,OAAO,CAAC,QAAQ,CAAqC;IACrD,OAAO,CAAC,QAAQ,CAAsC;IACtD,OAAO,CAAC,OAAO,CAAmC;;IAU3C,OAAO,CAAC,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,IAAI;IAIjD,sBAAsB,CAAC,SAAS,EAAE,MAAM,EAAE,EAAE,MAAM,EAAE,MAAM,GAAG,IAAI;IAWjE,QAAQ,IAAI,OAAO,CAAC,MAAM,CAAC;IAS3B,SAAS,CAAC,EAAE,EAAE,CAAC,GAAG,EAAE,KAAK,KAAK,IAAI;IAIlC,OAAO,CAAC,EAAE,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,IAAI;IAQ7C,OAAO,CAAC,cAAc,CAIpB;IAEF,OAAO,CAAC,OAAO,CAIb;CACH"}
|
|
@@ -4,6 +4,7 @@ exports.ZipArchiver = void 0;
|
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const archiver_1 = tslib_1.__importDefault(require("archiver"));
|
|
6
6
|
const fs_1 = require("fs");
|
|
7
|
+
const path_1 = require("path");
|
|
7
8
|
const tmp_1 = tslib_1.__importDefault(require("tmp"));
|
|
8
9
|
const cli_shared_1 = require("@forge/cli-shared");
|
|
9
10
|
class ZipArchiver {
|
|
@@ -30,8 +31,15 @@ class ZipArchiver {
|
|
|
30
31
|
addFile(fileName, contents) {
|
|
31
32
|
this.archive.append(contents, { name: fileName });
|
|
32
33
|
}
|
|
33
|
-
|
|
34
|
-
|
|
34
|
+
addRootDependencyFiles(fileNames, logger) {
|
|
35
|
+
const currentDirectory = process.cwd();
|
|
36
|
+
fileNames.forEach((fileName) => {
|
|
37
|
+
const filePath = path_1.join(currentDirectory, fileName);
|
|
38
|
+
if (fs_1.existsSync(filePath)) {
|
|
39
|
+
logger.debug(cli_shared_1.Text.deploy.taskPackage.packageFile(fileName, filePath));
|
|
40
|
+
this.archive.file(filePath, { name: fileName });
|
|
41
|
+
}
|
|
42
|
+
});
|
|
35
43
|
}
|
|
36
44
|
finalise() {
|
|
37
45
|
return new Promise((resolve, reject) => {
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { Logger } from '@forge/cli-shared';
|
|
2
2
|
import { Archiver } from './archiver';
|
|
3
|
-
import { Bundler } from '@forge/bundler';
|
|
4
3
|
export interface PackagerBundlerOutput {
|
|
5
4
|
output: {
|
|
6
5
|
[filename: string]: string;
|
|
@@ -28,8 +27,7 @@ export declare class BundlerError extends Error {
|
|
|
28
27
|
export declare class AppPackager implements Packager {
|
|
29
28
|
private readonly archiverFactory;
|
|
30
29
|
private readonly logger;
|
|
31
|
-
|
|
32
|
-
constructor(archiverFactory: () => Archiver, logger: Logger, bundle: Bundler);
|
|
30
|
+
constructor(archiverFactory: () => Archiver, logger: Logger);
|
|
33
31
|
package(handlers: Array<string>): Promise<PackageResult>;
|
|
34
32
|
}
|
|
35
33
|
//# sourceMappingURL=packager.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"packager.d.ts","sourceRoot":"","sources":["../../../src/deploy/packager/packager.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"packager.d.ts","sourceRoot":"","sources":["../../../src/deploy/packager/packager.ts"],"names":[],"mappings":"AAAA,OAAO,EAAuB,MAAM,EAAQ,MAAM,mBAAmB,CAAC;AAEtE,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAEtC,MAAM,WAAW,qBAAqB;IACpC,MAAM,EAAE;QAAE,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAAA;KAAE,CAAC;IACvC,SAAS,CAAC,EAAE;QAAE,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAAA;KAAE,CAAC;IAC3C,QAAQ,CAAC,EAAE;QACT,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC;KACpB,CAAC;CACH;AAED,MAAM,WAAW,aAAa;IAC5B,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC;CACvB;AAED,MAAM,WAAW,QAAQ;IACvB,OAAO,CAAC,QAAQ,EAAE,KAAK,CAAC,MAAM,CAAC,GAAG,OAAO,CAAC,aAAa,CAAC,CAAC;CAC1D;AAED,MAAM,WAAW,UAAU;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;CACd;AAED,qBAAa,YAAa,SAAQ,KAAK;CAAG;AAE1C,qBAAa,WAAY,YAAW,QAAQ;IAC9B,OAAO,CAAC,QAAQ,CAAC,eAAe;IAAkB,OAAO,CAAC,QAAQ,CAAC,MAAM;gBAAxD,eAAe,EAAE,MAAM,QAAQ,EAAmB,MAAM,EAAE,MAAM;IAEhF,OAAO,CAAC,QAAQ,EAAE,KAAK,CAAC,MAAM,CAAC,GAAG,OAAO,CAAC,aAAa,CAAC;CAgCtE"}
|
|
@@ -7,10 +7,9 @@ class BundlerError extends Error {
|
|
|
7
7
|
}
|
|
8
8
|
exports.BundlerError = BundlerError;
|
|
9
9
|
class AppPackager {
|
|
10
|
-
constructor(archiverFactory, logger
|
|
10
|
+
constructor(archiverFactory, logger) {
|
|
11
11
|
this.archiverFactory = archiverFactory;
|
|
12
12
|
this.logger = logger;
|
|
13
|
-
this.bundle = bundle;
|
|
14
13
|
}
|
|
15
14
|
async package(handlers) {
|
|
16
15
|
let moduleList;
|
|
@@ -30,29 +29,7 @@ class AppPackager {
|
|
|
30
29
|
path: path_1.join(currentDirectory, 'src', handler)
|
|
31
30
|
});
|
|
32
31
|
}
|
|
33
|
-
|
|
34
|
-
try {
|
|
35
|
-
bundlerResponse = await this.bundle(process.cwd(), entryPoints);
|
|
36
|
-
}
|
|
37
|
-
catch (e) {
|
|
38
|
-
throw new BundlerError(e.message);
|
|
39
|
-
}
|
|
40
|
-
const { output, sourceMap, metadata } = bundlerResponse;
|
|
41
|
-
if (metadata) {
|
|
42
|
-
moduleList = metadata.modules;
|
|
43
|
-
}
|
|
44
|
-
this.logger.debug(cli_shared_1.Text.deploy.taskPackage.packageBundledFiles);
|
|
45
|
-
for (const { name } of entryPoints) {
|
|
46
|
-
archiver.addFile(`${name}.js`, Buffer.from(output[name]));
|
|
47
|
-
}
|
|
48
|
-
if (sourceMap) {
|
|
49
|
-
for (const { name } of entryPoints) {
|
|
50
|
-
archiver.addFile(`${name}.js.map`, Buffer.from(sourceMap[name]));
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
const manifestPath = path_1.resolve(currentDirectory, cli_shared_1.manifestFilename);
|
|
54
|
-
this.logger.debug(cli_shared_1.Text.deploy.taskPackage.packageManifest(manifestPath));
|
|
55
|
-
archiver.addManifestFile(manifestPath);
|
|
32
|
+
archiver.addRootDependencyFiles(cli_shared_1.dependencyFileNames, this.logger);
|
|
56
33
|
const archivePath = await archiver.finalise();
|
|
57
34
|
this.logger.debug(cli_shared_1.Text.deploy.taskPackage.archiveCreated(archivePath));
|
|
58
35
|
return { archivePath, moduleList };
|
|
@@ -26,7 +26,7 @@ class ArtifactGraphQLClient {
|
|
|
26
26
|
}
|
|
27
27
|
async getUploadUrl(appDetails) {
|
|
28
28
|
const artifactQuery = `
|
|
29
|
-
mutation
|
|
29
|
+
mutation forge_cli_getDeploymentUrl($input: CreateAppDeploymentUrlInput!) {
|
|
30
30
|
createAppDeploymentUrl(input: $input) {
|
|
31
31
|
success
|
|
32
32
|
errors {
|
|
@@ -55,7 +55,7 @@ class ArtifactGraphQLClient {
|
|
|
55
55
|
}
|
|
56
56
|
async getHostedResourcesUploadUrls(appDetails, environmentKey, resourceKeys) {
|
|
57
57
|
const artifactQuery = `
|
|
58
|
-
mutation
|
|
58
|
+
mutation forge_cli_getHostedResourcesUploadUrls($input: CreateHostedResourceUploadUrlInput!) {
|
|
59
59
|
createHostedResourceUploadUrl(input: $input) {
|
|
60
60
|
success
|
|
61
61
|
errors {
|
|
@@ -9,7 +9,7 @@ export declare class MissingAppEnvironmentError extends Error {
|
|
|
9
9
|
export declare class GraphqlClient implements SetEnvironmentVariableClient, DeleteEnvironmentVariableClient, ListEnvironmentVariablesClient {
|
|
10
10
|
private readonly graphqlClient;
|
|
11
11
|
constructor(graphqlClient: GraphQLClient);
|
|
12
|
-
listEnvironmentVariables(details: ListAppEnvironmentVariablesDetails): Promise<import("@forge/cli-shared").AppEnvironmentVariable[] | null | undefined>;
|
|
12
|
+
listEnvironmentVariables(details: ListAppEnvironmentVariablesDetails): Promise<import("@forge/cli-shared/src").AppEnvironmentVariable[] | null | undefined>;
|
|
13
13
|
setEnvironmentVariable(details: SetAppEnvironmentVariableDetails): Promise<void>;
|
|
14
14
|
deleteEnvironmentVariable(details: DeleteAppEnvironmentVariableDetails): Promise<void>;
|
|
15
15
|
}
|
|
@@ -14,7 +14,7 @@ class GraphqlClient {
|
|
|
14
14
|
}
|
|
15
15
|
async listEnvironmentVariables(details) {
|
|
16
16
|
const query = `
|
|
17
|
-
query
|
|
17
|
+
query forge_cli_getAppEnvironmentVariables($appId: ID!, $key: String!) {
|
|
18
18
|
app(id: $appId) {
|
|
19
19
|
name
|
|
20
20
|
description
|
|
@@ -43,7 +43,7 @@ class GraphqlClient {
|
|
|
43
43
|
}
|
|
44
44
|
async setEnvironmentVariable(details) {
|
|
45
45
|
const mutation = `
|
|
46
|
-
mutation
|
|
46
|
+
mutation forge_cli_setAppEnvironmentVariable($input: SetAppEnvironmentVariableInput!) {
|
|
47
47
|
setAppEnvironmentVariable(input: $input) {
|
|
48
48
|
success
|
|
49
49
|
errors {
|
|
@@ -75,7 +75,7 @@ class GraphqlClient {
|
|
|
75
75
|
}
|
|
76
76
|
async deleteEnvironmentVariable(details) {
|
|
77
77
|
const mutation = `
|
|
78
|
-
mutation
|
|
78
|
+
mutation forge_cli_deleteAppEnvironmentVariable($input: DeleteAppEnvironmentVariableInput!) {
|
|
79
79
|
deleteAppEnvironmentVariable(input: $input) {
|
|
80
80
|
success
|
|
81
81
|
errors {
|