@forge/cli 6.5.0 → 6.6.0-next.3
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 +42 -0
- package/npm-shrinkwrap.json +90 -88
- package/out/autocomplete/autocomplete-config.json +3 -0
- package/out/command-line/command.d.ts.map +1 -1
- package/out/command-line/command.js +1 -1
- package/out/command-line/controller/deploy-controller.d.ts +3 -2
- package/out/command-line/controller/deploy-controller.d.ts.map +1 -1
- package/out/command-line/controller/deploy-controller.js +4 -2
- package/out/command-line/controller/install-controller.d.ts.map +1 -1
- package/out/command-line/controller/install-controller.js +8 -7
- package/out/command-line/controller/tunnel-controller.d.ts.map +1 -1
- package/out/command-line/controller/tunnel-controller.js +1 -1
- package/out/command-line/dependency-injection.d.ts +2 -0
- package/out/command-line/dependency-injection.d.ts.map +1 -1
- package/out/command-line/dependency-injection.js +4 -1
- package/out/command-line/environment.d.ts +1 -0
- package/out/command-line/environment.d.ts.map +1 -1
- package/out/command-line/environment.js +8 -8
- package/out/command-line/register-app-commands.d.ts.map +1 -1
- package/out/command-line/register-app-commands.js +23 -23
- package/out/command-line/register-environment-commands.d.ts +4 -2
- package/out/command-line/register-environment-commands.d.ts.map +1 -1
- package/out/command-line/register-environment-commands.js +39 -4
- package/out/command-line/register-tunnel-commands.d.ts.map +1 -1
- package/out/command-line/register-tunnel-commands.js +1 -0
- package/out/command-line/view/deploy-view.d.ts +2 -2
- package/out/command-line/view/deploy-view.d.ts.map +1 -1
- package/out/command-line/view/deploy-view.js +5 -5
- package/out/command-line/view/tunnel-view.d.ts +1 -1
- package/out/command-line/view/tunnel-view.d.ts.map +1 -1
- package/out/command-line/view/tunnel-view.js +6 -1
- package/out/environment/graphql-client.d.ts +10 -2
- package/out/environment/graphql-client.d.ts.map +1 -1
- package/out/environment/graphql-client.js +36 -1
- package/out/environment/list-environment.d.ts +17 -0
- package/out/environment/list-environment.d.ts.map +1 -0
- package/out/environment/list-environment.js +16 -0
- package/out/installations/graphql-client.d.ts +5 -4
- package/out/installations/graphql-client.d.ts.map +1 -1
- package/out/installations/graphql-client.js +15 -4
- package/out/migration-keys/graphql-client.js +1 -1
- package/out/service/installation-service.d.ts +8 -2
- package/out/service/installation-service.d.ts.map +1 -1
- package/out/service/installation-service.js +8 -2
- package/out/service/tunnel-service.d.ts +1 -0
- package/out/service/tunnel-service.d.ts.map +1 -1
- package/out/service/tunnel-service.js +2 -5
- package/package.json +7 -7
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"environment.d.ts","sourceRoot":"","sources":["../../src/command-line/environment.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"environment.d.ts","sourceRoot":"","sources":["../../src/command-line/environment.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,yBAAyB,cAAe,MAAM,KAAG,MAK7D,CAAC;AAEF,eAAO,MAAM,sBAAsB,cAAe,MAAM,KAAG,MAE1D,CAAC"}
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.checkEnvironmentOption = void 0;
|
|
3
|
+
exports.checkEnvironmentOption = exports.validateEnvironmentOption = void 0;
|
|
4
4
|
const cli_shared_1 = require("@forge/cli-shared");
|
|
5
|
-
const
|
|
6
|
-
const
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
throw new cli_shared_3.ValidationError(cli_shared_2.Text.env.invalid(cli_shared_1.VALID_ENVIRONMENT_OPTIONS));
|
|
5
|
+
const ENVIRONMENT_KEY_PATTERN = /^[a-zA-Z0-9-_]+$/;
|
|
6
|
+
const validateEnvironmentOption = (userValue) => {
|
|
7
|
+
if (!ENVIRONMENT_KEY_PATTERN.test(userValue)) {
|
|
8
|
+
throw new cli_shared_1.ValidationError(cli_shared_1.Text.env.invalid);
|
|
10
9
|
}
|
|
11
10
|
return userValue;
|
|
12
|
-
}
|
|
11
|
+
};
|
|
12
|
+
exports.validateEnvironmentOption = validateEnvironmentOption;
|
|
13
13
|
const checkEnvironmentOption = (userValue) => {
|
|
14
|
-
return (0, cli_shared_1.optionToEnvironment)(validateEnvironmentOption(userValue));
|
|
14
|
+
return (0, cli_shared_1.optionToEnvironment)((0, exports.validateEnvironmentOption)(userValue));
|
|
15
15
|
};
|
|
16
16
|
exports.checkEnvironmentOption = checkEnvironmentOption;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"register-app-commands.d.ts","sourceRoot":"","sources":["../../src/command-line/register-app-commands.ts"],"names":[],"mappings":"AAEA,OAAO,
|
|
1
|
+
{"version":3,"file":"register-app-commands.d.ts","sourceRoot":"","sources":["../../src/command-line/register-app-commands.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,sBAAsB,EAEtB,aAAa,EACb,gBAAgB,EAEjB,MAAM,mBAAmB,CAAC;AAG3B,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAqBtD,wBAAgB,wBAAwB,CAAC,OAAO,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAY7E;AAED,MAAM,WAAW,2BAA2B;IAC1C,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,wBAAsB,oBAAoB,CACxC,EAAE,EAAE,aAAa,EACjB,gBAAgB,EAAE,gBAAgB,EAClC,IAAI,EAAE,MAAM,EACZ,EAAE,QAAQ,EAAE,SAAS,EAAE,EAAE,2BAA2B,GACnD,OAAO,CAAC,sBAAsB,CAAC,CAwFjC;AA0CD,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,YAAY,QAGlD"}
|
|
@@ -15,12 +15,12 @@ var TemplateCategory;
|
|
|
15
15
|
})(TemplateCategory || (TemplateCategory = {}));
|
|
16
16
|
function ensureDirectoryDoesntExist(directory) {
|
|
17
17
|
if (fs_1.default.existsSync(directory)) {
|
|
18
|
-
throw new
|
|
18
|
+
throw new cli_shared_2.ValidationError(cli_shared_2.Text.create.error.directory.exists(directory));
|
|
19
19
|
}
|
|
20
20
|
}
|
|
21
21
|
function ensureValidNameLength(name) {
|
|
22
22
|
if (name.length <= 0 || name.length > 50) {
|
|
23
|
-
throw new
|
|
23
|
+
throw new cli_shared_2.ValidationError(cli_shared_2.Text.create.error.name.tooLong());
|
|
24
24
|
}
|
|
25
25
|
}
|
|
26
26
|
function directoryNameFromAppName(appName) {
|
|
@@ -36,7 +36,7 @@ exports.directoryNameFromAppName = directoryNameFromAppName;
|
|
|
36
36
|
async function createCommandHandler(ui, createAppCommand, name, { template, directory }) {
|
|
37
37
|
if (directory) {
|
|
38
38
|
ensureDirectoryDoesntExist(directory);
|
|
39
|
-
ui.info(
|
|
39
|
+
ui.info(cli_shared_2.Text.create.intro(directory));
|
|
40
40
|
}
|
|
41
41
|
else {
|
|
42
42
|
directory = directoryNameFromAppName(name) || template;
|
|
@@ -44,12 +44,12 @@ async function createCommandHandler(ui, createAppCommand, name, { template, dire
|
|
|
44
44
|
ensureDirectoryDoesntExist(directory);
|
|
45
45
|
}
|
|
46
46
|
const currentDirectory = process.cwd();
|
|
47
|
-
ui.info(
|
|
47
|
+
ui.info(cli_shared_2.Text.create.introWithCurrentDirectory(currentDirectory));
|
|
48
48
|
}
|
|
49
|
-
ui.info(
|
|
49
|
+
ui.info(cli_shared_2.Text.ctrlC);
|
|
50
50
|
if (!name) {
|
|
51
|
-
ui.info(
|
|
52
|
-
name = await ui.promptForText(
|
|
51
|
+
ui.info(cli_shared_2.Text.create.overviewAppName);
|
|
52
|
+
name = await ui.promptForText(cli_shared_2.Text.create.promptName);
|
|
53
53
|
if (!directory) {
|
|
54
54
|
directory = directoryNameFromAppName(name) || template;
|
|
55
55
|
if (directory) {
|
|
@@ -59,9 +59,9 @@ async function createCommandHandler(ui, createAppCommand, name, { template, dire
|
|
|
59
59
|
}
|
|
60
60
|
ensureValidNameLength(name);
|
|
61
61
|
if (!template) {
|
|
62
|
-
ui.info(
|
|
63
|
-
const templates = await ui.displayTemporaryMessage(() => createAppCommand.getAvailableTemplates(),
|
|
64
|
-
const type = await ui.promptForList(
|
|
62
|
+
ui.info(cli_shared_2.Text.create.overviewTemplates);
|
|
63
|
+
const templates = await ui.displayTemporaryMessage(() => createAppCommand.getAvailableTemplates(), cli_shared_2.Text.create.waitTemplates);
|
|
64
|
+
const type = await ui.promptForList(cli_shared_2.Text.create.promptCategory, Object.values(TemplateCategory));
|
|
65
65
|
const filteredTemplates = type === TemplateCategory.SHOW_ALL
|
|
66
66
|
? templates
|
|
67
67
|
: templates
|
|
@@ -76,7 +76,7 @@ async function createCommandHandler(ui, createAppCommand, name, { template, dire
|
|
|
76
76
|
}
|
|
77
77
|
})
|
|
78
78
|
.map((name) => name.replace('-ui-kit', '').replace('-custom-ui', ''));
|
|
79
|
-
template = await ui.promptForList(
|
|
79
|
+
template = await ui.promptForList(cli_shared_2.Text.create.promptTemplate, filteredTemplates);
|
|
80
80
|
if (type === TemplateCategory.UI_KIT) {
|
|
81
81
|
template = `${template}-ui-kit`;
|
|
82
82
|
}
|
|
@@ -91,35 +91,35 @@ async function createCommandHandler(ui, createAppCommand, name, { template, dire
|
|
|
91
91
|
ui.emptyLine();
|
|
92
92
|
directory = directory;
|
|
93
93
|
const args = { name, template, directory };
|
|
94
|
-
const result = await ui.displayProgress(() => createAppCommand.execute(args),
|
|
95
|
-
ui.info(
|
|
94
|
+
const result = await ui.displayProgress(() => createAppCommand.execute(args), cli_shared_2.Text.create.cmd.start, cli_shared_2.Text.create.cmd.success(name));
|
|
95
|
+
ui.info(cli_shared_2.Text.create.cmd.successDetails(directory, result.environments, cli_shared_1.environmentToOption));
|
|
96
96
|
return result;
|
|
97
97
|
}
|
|
98
98
|
exports.createCommandHandler = createCommandHandler;
|
|
99
99
|
function registerCreateCommands({ cmd, ui, commands: { createAppCommand } }) {
|
|
100
100
|
cmd
|
|
101
101
|
.command('create [name]')
|
|
102
|
-
.description(
|
|
103
|
-
.option('-t, --template <template name>',
|
|
104
|
-
.option('-d, --directory <directory name>',
|
|
102
|
+
.description(cli_shared_2.Text.create.cmd.desc)
|
|
103
|
+
.option('-t, --template <template name>', cli_shared_2.Text.create.optionTemplate)
|
|
104
|
+
.option('-d, --directory <directory name>', cli_shared_2.Text.create.optionDirectory)
|
|
105
105
|
.action((name, options) => createCommandHandler(ui, createAppCommand, name, options));
|
|
106
106
|
}
|
|
107
107
|
function registerRegisterCommand({ cmd, ui, commands: { registerAppCommand } }) {
|
|
108
108
|
cmd
|
|
109
109
|
.command('register [name]')
|
|
110
|
-
.description(
|
|
110
|
+
.description(cli_shared_2.Text.register.cmd.desc)
|
|
111
111
|
.requireManifestFile()
|
|
112
112
|
.action(async (name) => {
|
|
113
|
-
ui.info(
|
|
114
|
-
ui.info(
|
|
113
|
+
ui.info(cli_shared_2.Text.register.intro);
|
|
114
|
+
ui.info(cli_shared_2.Text.ctrlC);
|
|
115
115
|
ui.emptyLine();
|
|
116
116
|
if (!name) {
|
|
117
|
-
ui.info(
|
|
118
|
-
name = await ui.promptForText(
|
|
117
|
+
ui.info(cli_shared_2.Text.create.overviewAppName);
|
|
118
|
+
name = await ui.promptForText(cli_shared_2.Text.create.promptName);
|
|
119
119
|
ui.emptyLine();
|
|
120
120
|
}
|
|
121
|
-
const result = await ui.displayProgress(() => registerAppCommand.execute({ name }),
|
|
122
|
-
ui.info(
|
|
121
|
+
const result = await ui.displayProgress(() => registerAppCommand.execute({ name }), cli_shared_2.Text.register.cmd.start, cli_shared_2.Text.register.cmd.success(name));
|
|
122
|
+
ui.info(cli_shared_2.Text.register.cmd.successDetails(result.environments, cli_shared_1.environmentToOption));
|
|
123
123
|
return result;
|
|
124
124
|
});
|
|
125
125
|
}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { UI } from '@forge/cli-shared';
|
|
2
2
|
import { Dependencies } from './dependency-injection';
|
|
3
3
|
import { CreateEnvironmentCommand } from '../environment/create-environment';
|
|
4
|
-
|
|
4
|
+
import { ListEnvironmentCommand } from '../environment/list-environment';
|
|
5
|
+
export declare const createEnvironmentHandler: (ui: UI, createEnvironmentCommand: CreateEnvironmentCommand, listEnvironmentCommand: ListEnvironmentCommand, environmentKey?: string) => Promise<void>;
|
|
6
|
+
export declare const listEnvironmentHandler: (ui: UI, listEnvironmentCommand: ListEnvironmentCommand) => Promise<void>;
|
|
5
7
|
export declare const registerCommands: (deps: Dependencies) => void;
|
|
6
8
|
//# sourceMappingURL=register-environment-commands.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"register-environment-commands.d.ts","sourceRoot":"","sources":["../../src/command-line/register-environment-commands.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"register-environment-commands.d.ts","sourceRoot":"","sources":["../../src/command-line/register-environment-commands.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAQ,MAAM,mBAAmB,CAAC;AAE7C,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAEtD,OAAO,EAAE,wBAAwB,EAAE,MAAM,mCAAmC,CAAC;AAC7E,OAAO,EAAE,sBAAsB,EAAE,MAAM,iCAAiC,CAAC;AAIzE,eAAO,MAAM,wBAAwB,OAC/B,EAAE,4BACoB,wBAAwB,0BAC1B,sBAAsB,mBAC7B,MAAM,kBAmBxB,CAAC;AAEF,eAAO,MAAM,sBAAsB,OAAc,EAAE,0BAA0B,sBAAsB,kBA8BlG,CAAC;AA8BF,eAAO,MAAM,gBAAgB,SAAU,YAAY,KAAG,IAMrD,CAAC"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.registerCommands = exports.createEnvironmentHandler = void 0;
|
|
3
|
+
exports.registerCommands = exports.listEnvironmentHandler = exports.createEnvironmentHandler = void 0;
|
|
4
4
|
const cli_shared_1 = require("@forge/cli-shared");
|
|
5
5
|
const COMMAND_NAME = 'environment';
|
|
6
|
-
const createEnvironmentHandler = async (ui, createEnvironmentCommand, environmentKey) => {
|
|
6
|
+
const createEnvironmentHandler = async (ui, createEnvironmentCommand, listEnvironmentCommand, environmentKey) => {
|
|
7
7
|
ui.info(cli_shared_1.Text.createEnvironment.overview);
|
|
8
8
|
ui.emptyLine();
|
|
9
9
|
if (!environmentKey) {
|
|
@@ -16,7 +16,32 @@ const createEnvironmentHandler = async (ui, createEnvironmentCommand, environmen
|
|
|
16
16
|
ui.info(cli_shared_1.Text.createEnvironment.successMessage);
|
|
17
17
|
};
|
|
18
18
|
exports.createEnvironmentHandler = createEnvironmentHandler;
|
|
19
|
-
const
|
|
19
|
+
const listEnvironmentHandler = async (ui, listEnvironmentCommand) => {
|
|
20
|
+
const envOrder = {
|
|
21
|
+
PRODUCTION: 1,
|
|
22
|
+
STAGING: 2,
|
|
23
|
+
DEVELOPMENT: 3
|
|
24
|
+
};
|
|
25
|
+
const environments = (await listEnvironmentCommand.execute()).sort((a, b) => a.type === b.type ? Number(a.lastDeployedAt) - Number(b.lastDeployedAt) : envOrder[a.type] - envOrder[b.type]);
|
|
26
|
+
ui.table([
|
|
27
|
+
['type', 'Type'],
|
|
28
|
+
['name', 'Name'],
|
|
29
|
+
['lastDeployedAt', 'Last deployed at']
|
|
30
|
+
], environments.map(({ type, key: name, lastDeployedAt }) => {
|
|
31
|
+
return {
|
|
32
|
+
type,
|
|
33
|
+
name,
|
|
34
|
+
lastDeployedAt
|
|
35
|
+
};
|
|
36
|
+
}), {
|
|
37
|
+
preMessage: cli_shared_1.Text.listEnvironment.overview,
|
|
38
|
+
format: {
|
|
39
|
+
lastDeployedAt: (value) => new Date(Number(value)).toISOString()
|
|
40
|
+
}
|
|
41
|
+
});
|
|
42
|
+
};
|
|
43
|
+
exports.listEnvironmentHandler = listEnvironmentHandler;
|
|
44
|
+
const registerCreateEnvironmentCommand = (parent, { ui, commands: { createEnvironmentCommand, listEnvironmentCommand } }) => {
|
|
20
45
|
parent
|
|
21
46
|
.command('create')
|
|
22
47
|
.requireAppId()
|
|
@@ -24,12 +49,22 @@ const registerCreateEnvironmentCommand = (parent, { ui, commands: { createEnviro
|
|
|
24
49
|
.option('-e, --environment [environment]', cli_shared_1.Text.createEnvironment.optionEnvironmentKey)
|
|
25
50
|
.nonInteractiveOption('--environment')
|
|
26
51
|
.action(async ({ environment }) => {
|
|
27
|
-
await (0, exports.createEnvironmentHandler)(ui, createEnvironmentCommand, environment);
|
|
52
|
+
await (0, exports.createEnvironmentHandler)(ui, createEnvironmentCommand, listEnvironmentCommand, environment);
|
|
53
|
+
});
|
|
54
|
+
};
|
|
55
|
+
const registerListEnvironmentCommand = (parent, { ui, commands: { listEnvironmentCommand } }) => {
|
|
56
|
+
parent
|
|
57
|
+
.command('list')
|
|
58
|
+
.requireAppId()
|
|
59
|
+
.description(cli_shared_1.Text.listEnvironment.cmd.desc)
|
|
60
|
+
.action(async () => {
|
|
61
|
+
await (0, exports.listEnvironmentHandler)(ui, listEnvironmentCommand);
|
|
28
62
|
});
|
|
29
63
|
};
|
|
30
64
|
const registerCommands = (deps) => {
|
|
31
65
|
const { cmd } = deps;
|
|
32
66
|
const environment = cmd.command(COMMAND_NAME).description(cli_shared_1.Text.environment.desc);
|
|
33
67
|
registerCreateEnvironmentCommand(environment, deps);
|
|
68
|
+
registerListEnvironmentCommand(environment, deps);
|
|
34
69
|
};
|
|
35
70
|
exports.registerCommands = registerCommands;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"register-tunnel-commands.d.ts","sourceRoot":"","sources":["../../src/command-line/register-tunnel-commands.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAGtD,eAAO,MAAM,gBAAgB,mDAAoD,YAAY,KAAG,
|
|
1
|
+
{"version":3,"file":"register-tunnel-commands.d.ts","sourceRoot":"","sources":["../../src/command-line/register-tunnel-commands.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAGtD,eAAO,MAAM,gBAAgB,mDAAoD,YAAY,KAAG,IAU/F,CAAC"}
|
|
@@ -7,6 +7,7 @@ const registerCommands = ({ cmd, ui, controllers: { tunnelController } }) => {
|
|
|
7
7
|
.command('tunnel')
|
|
8
8
|
.requireAppId()
|
|
9
9
|
.description(cli_shared_1.Text.tunnel.cmd)
|
|
10
|
+
.environmentOption()
|
|
10
11
|
.option('-d, --debug', cli_shared_1.Text.tunnel.optionDebugger)
|
|
11
12
|
.action(async (options) => {
|
|
12
13
|
await tunnelController.run(options, ui);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { UI } from '@forge/cli-shared';
|
|
1
|
+
import { AppEnvironmentDetails, UI } from '@forge/cli-shared';
|
|
2
2
|
import { LintResult } from '@forge/lint';
|
|
3
3
|
import { DeploymentResult } from '../register-deployment-commands';
|
|
4
4
|
export declare class DeployView {
|
|
@@ -16,6 +16,6 @@ export declare class DeployView {
|
|
|
16
16
|
displayMPACAppConnectKeyChangeError(mpacAppKey: string, connectKey: string): void;
|
|
17
17
|
promptToContinueDeletingConnectKey(): Promise<boolean>;
|
|
18
18
|
promptToContinueChangingConnectKey(): Promise<boolean>;
|
|
19
|
-
reportDeploymentProgress(
|
|
19
|
+
reportDeploymentProgress({ appAri, name, environmentKey, environmentType }: AppEnvironmentDetails, showDistributionPageLink: boolean, deployCallback: () => Promise<DeploymentResult>): Promise<DeploymentResult>;
|
|
20
20
|
}
|
|
21
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,
|
|
1
|
+
{"version":3,"file":"deploy-view.d.ts","sourceRoot":"","sources":["../../../src/command-line/view/deploy-view.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAA2D,EAAE,EAAE,MAAM,mBAAmB,CAAC;AACvH,OAAO,EAAE,UAAU,EAAqB,MAAM,aAAa,CAAC;AAE5D,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,MAAM,EAAE,IAAI,EAAE,cAAc,EAAE,eAAe,EAAE,EAAE,qBAAqB,EACxE,wBAAwB,EAAE,OAAO,EACjC,cAAc,EAAE,MAAM,OAAO,CAAC,gBAAgB,CAAC,GAC9C,OAAO,CAAC,gBAAgB,CAAC;CAY7B"}
|
|
@@ -46,11 +46,11 @@ class DeployView {
|
|
|
46
46
|
async promptToContinueChangingConnectKey() {
|
|
47
47
|
return await this.ui.confirm(cli_shared_1.Text.deploy.connectKeyChange.continueChange);
|
|
48
48
|
}
|
|
49
|
-
async reportDeploymentProgress(
|
|
50
|
-
const result = await this.ui.displayProgress(() => deployCallback(), cli_shared_1.Text.deploy.cmd.start2(
|
|
51
|
-
this.ui.info(cli_shared_1.Text.deploy.cmd.successDetails(
|
|
52
|
-
if (
|
|
53
|
-
this.ui.info(cli_shared_1.Text.deploy.cmd.distributePageLink((0, cs_ari_1.parseAppAri)((0, cs_ari_1.parse)(
|
|
49
|
+
async reportDeploymentProgress({ appAri, name, environmentKey, environmentType }, showDistributionPageLink, deployCallback) {
|
|
50
|
+
const result = await this.ui.displayProgress(() => deployCallback(), cli_shared_1.Text.deploy.cmd.start2(name, environmentKey, environmentType, cli_shared_1.environmentToOption), cli_shared_1.Text.deploy.cmd.success);
|
|
51
|
+
this.ui.info(cli_shared_1.Text.deploy.cmd.successDetails(name, environmentKey, environmentType, cli_shared_1.environmentToOption));
|
|
52
|
+
if (environmentType === cli_shared_1.AppEnvironmentType.Production && showDistributionPageLink) {
|
|
53
|
+
this.ui.info(cli_shared_1.Text.deploy.cmd.distributePageLink((0, cs_ari_1.parseAppAri)((0, cs_ari_1.parse)(appAri)).appId));
|
|
54
54
|
}
|
|
55
55
|
return result;
|
|
56
56
|
}
|
|
@@ -11,7 +11,7 @@ export declare class TunnelViewError extends UserError {
|
|
|
11
11
|
export declare class TunnelView {
|
|
12
12
|
private readonly ui;
|
|
13
13
|
constructor(ui: CommandLineUI);
|
|
14
|
-
dockerPreamble(): void;
|
|
14
|
+
dockerPreamble(environmentKey?: string): void;
|
|
15
15
|
getTunnelErrorHandler(exitFn: typeof exitOnError): (err: Error) => Promise<void>;
|
|
16
16
|
updatePullPercent(dataBuffer: Buffer, dockerPullPercent: number): number;
|
|
17
17
|
calculateProgress(progress: string, regex: RegExp, dockerPullPercent: number, clamp: number): number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tunnel-view.d.ts","sourceRoot":"","sources":["../../../src/command-line/view/tunnel-view.ts"],"names":[],"mappings":";AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"tunnel-view.d.ts","sourceRoot":"","sources":["../../../src/command-line/view/tunnel-view.ts"],"names":[],"mappings":";AAAA,OAAO,EACL,aAAa,EAGb,WAAW,EAGX,SAAS,EACV,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAGpC,MAAM,WAAW,yBAAyB;IACxC,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,SAAS,EAAE,MAAM,IAAI,CAAC;IACtB,SAAS,EAAE,MAAM,IAAI,CAAC;CACvB;AAED,qBAAa,eAAgB,SAAQ,SAAS;CAAG;AAEjD,qBAAa,UAAU;IACT,OAAO,CAAC,QAAQ,CAAC,EAAE;gBAAF,EAAE,EAAE,aAAa;IAEvC,cAAc,CAAC,cAAc,CAAC,EAAE,MAAM,GAAG,IAAI;IAW7C,qBAAqB,CAAC,MAAM,EAAE,OAAO,WAAW,GAAG,CAAC,GAAG,EAAE,KAAK,KAAK,OAAO,CAAC,IAAI,CAAC;IAQhF,iBAAiB,CAAC,UAAU,EAAE,MAAM,EAAE,iBAAiB,EAAE,MAAM,GAAG,MAAM;IA+BxE,iBAAiB,CAAC,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,iBAAiB,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM;IAQpG,sBAAsB,CAC3B,yBAAyB,EAAE,UAAU,CAAC,OAAO,KAAK,CAAC,EACnD,EAAE,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,EAAE,yBAAyB,GAC3D,OAAO,CAAC,IAAI,CAAC;CAyCjB"}
|
|
@@ -11,8 +11,13 @@ class TunnelView {
|
|
|
11
11
|
constructor(ui) {
|
|
12
12
|
this.ui = ui;
|
|
13
13
|
}
|
|
14
|
-
dockerPreamble() {
|
|
14
|
+
dockerPreamble(environmentKey) {
|
|
15
15
|
this.ui.info(cli_shared_1.Text.tunnel.preamble);
|
|
16
|
+
if (environmentKey && environmentKey !== cli_shared_1.DEFAULT_ENVIRONMENT_KEY) {
|
|
17
|
+
this.ui.emptyLine();
|
|
18
|
+
this.ui.info(cli_shared_1.Text.tunnel.startingTunnel(environmentKey, cli_shared_1.environmentToOption));
|
|
19
|
+
this.ui.emptyLine();
|
|
20
|
+
}
|
|
16
21
|
this.ui.info(cli_shared_1.Text.ctrlC);
|
|
17
22
|
this.ui.emptyLine();
|
|
18
23
|
}
|
|
@@ -1,8 +1,16 @@
|
|
|
1
|
-
import { GraphQLClient } from '@forge/cli-shared';
|
|
1
|
+
import { AppEnvironmentType, GraphQLClient, UserError } from '@forge/cli-shared';
|
|
2
2
|
import { AppEnvironmentDetails, CreateEnvironmentClient } from './create-environment';
|
|
3
|
-
|
|
3
|
+
import { ListEnvironmentClient, ListEnvironmentDetails } from './list-environment';
|
|
4
|
+
export declare class MissingAppError extends UserError {
|
|
5
|
+
}
|
|
6
|
+
export declare class GraphqlClient implements CreateEnvironmentClient, ListEnvironmentClient {
|
|
4
7
|
private readonly graphqlClient;
|
|
5
8
|
constructor(graphqlClient: GraphQLClient);
|
|
6
9
|
createEnvironment(details: AppEnvironmentDetails): Promise<void>;
|
|
10
|
+
listEnvironment(details: ListEnvironmentDetails): Promise<{
|
|
11
|
+
type: AppEnvironmentType;
|
|
12
|
+
key: string;
|
|
13
|
+
lastDeployedAt: string;
|
|
14
|
+
}[]>;
|
|
7
15
|
}
|
|
8
16
|
//# sourceMappingURL=graphql-client.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"graphql-client.d.ts","sourceRoot":"","sources":["../../src/environment/graphql-client.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"graphql-client.d.ts","sourceRoot":"","sources":["../../src/environment/graphql-client.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,kBAAkB,EAGlB,aAAa,EAGb,SAAS,EACV,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,qBAAqB,EAAE,uBAAuB,EAAE,MAAM,sBAAsB,CAAC;AACtF,OAAO,EAAE,qBAAqB,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAC;AAEnF,qBAAa,eAAgB,SAAQ,SAAS;CAAG;AAEjD,qBAAa,aAAc,YAAW,uBAAuB,EAAE,qBAAqB;IACtE,OAAO,CAAC,QAAQ,CAAC,aAAa;gBAAb,aAAa,EAAE,aAAa;IAE5C,iBAAiB,CAAC,OAAO,EAAE,qBAAqB;IAgDhD,eAAe,CAAC,OAAO,EAAE,sBAAsB;;;;;CAkC7D"}
|
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.GraphqlClient = void 0;
|
|
3
|
+
exports.GraphqlClient = exports.MissingAppError = void 0;
|
|
4
4
|
const cli_shared_1 = require("@forge/cli-shared");
|
|
5
|
+
class MissingAppError extends cli_shared_1.UserError {
|
|
6
|
+
}
|
|
7
|
+
exports.MissingAppError = MissingAppError;
|
|
5
8
|
class GraphqlClient {
|
|
6
9
|
constructor(graphqlClient) {
|
|
7
10
|
this.graphqlClient = graphqlClient;
|
|
@@ -43,5 +46,37 @@ class GraphqlClient {
|
|
|
43
46
|
});
|
|
44
47
|
}
|
|
45
48
|
}
|
|
49
|
+
async listEnvironment(details) {
|
|
50
|
+
const query = `
|
|
51
|
+
query forge_cli_listEnvironment($id: ID!) {
|
|
52
|
+
app(id: $id) {
|
|
53
|
+
environments {
|
|
54
|
+
key
|
|
55
|
+
type
|
|
56
|
+
createdAt
|
|
57
|
+
versions(first: 1) {
|
|
58
|
+
nodes {
|
|
59
|
+
updatedAt
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
`;
|
|
66
|
+
const { app } = await this.graphqlClient.query(query, {
|
|
67
|
+
id: details.appId
|
|
68
|
+
});
|
|
69
|
+
if (!app) {
|
|
70
|
+
throw new MissingAppError();
|
|
71
|
+
}
|
|
72
|
+
return app.environments.map((environment) => {
|
|
73
|
+
var _a, _b, _c;
|
|
74
|
+
return {
|
|
75
|
+
type: environment.type,
|
|
76
|
+
key: environment.key,
|
|
77
|
+
lastDeployedAt: ((_c = (_b = (_a = environment.versions) === null || _a === void 0 ? void 0 : _a.nodes) === null || _b === void 0 ? void 0 : _b[0]) === null || _c === void 0 ? void 0 : _c.updatedAt) || environment.createdAt
|
|
78
|
+
};
|
|
79
|
+
});
|
|
80
|
+
}
|
|
46
81
|
}
|
|
47
82
|
exports.GraphqlClient = GraphqlClient;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { AppConfigProvider, AppEnvironment } from '@forge/cli-shared';
|
|
2
|
+
export interface ListEnvironmentDetails {
|
|
3
|
+
appId: string;
|
|
4
|
+
}
|
|
5
|
+
export interface ListEnvironmentOutput extends Pick<AppEnvironment, 'key' | 'type'> {
|
|
6
|
+
lastDeployedAt: string;
|
|
7
|
+
}
|
|
8
|
+
export interface ListEnvironmentClient {
|
|
9
|
+
listEnvironment(details: ListEnvironmentDetails): Promise<ListEnvironmentOutput[]>;
|
|
10
|
+
}
|
|
11
|
+
export declare class ListEnvironmentCommand {
|
|
12
|
+
private readonly client;
|
|
13
|
+
private readonly getAppConfig;
|
|
14
|
+
constructor(client: ListEnvironmentClient, getAppConfig: AppConfigProvider);
|
|
15
|
+
execute(): Promise<ListEnvironmentOutput[]>;
|
|
16
|
+
}
|
|
17
|
+
//# sourceMappingURL=list-environment.d.ts.map
|
|
@@ -0,0 +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;CACxB;AAED,MAAM,WAAW,qBAAqB;IACpC,eAAe,CAAC,OAAO,EAAE,sBAAsB,GAAG,OAAO,CAAC,qBAAqB,EAAE,CAAC,CAAC;CACpF;AAED,qBAAa,sBAAsB;IACrB,OAAO,CAAC,QAAQ,CAAC,MAAM;IAAyB,OAAO,CAAC,QAAQ,CAAC,YAAY;gBAA5D,MAAM,EAAE,qBAAqB,EAAmB,YAAY,EAAE,iBAAiB;IAE/F,OAAO;CAMrB"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ListEnvironmentCommand = void 0;
|
|
4
|
+
class ListEnvironmentCommand {
|
|
5
|
+
constructor(client, getAppConfig) {
|
|
6
|
+
this.client = client;
|
|
7
|
+
this.getAppConfig = getAppConfig;
|
|
8
|
+
}
|
|
9
|
+
async execute() {
|
|
10
|
+
const { id: appId } = await this.getAppConfig();
|
|
11
|
+
return this.client.listEnvironment({
|
|
12
|
+
appId
|
|
13
|
+
});
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
exports.ListEnvironmentCommand = ListEnvironmentCommand;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { AppUninstallationInput, GraphQLClient, GraphQlMutationError, Pause, BaseError, UserError } from '@forge/cli-shared';
|
|
2
2
|
import { AppInstallSiteDetails, InstallAppClient } from './install-app-site';
|
|
3
|
-
import { Installation, ListAppInstallationsClient, UpgradeAppInstallationsClient } from '../service/installation-service';
|
|
3
|
+
import { AppEnvironmentVersionData, 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;
|
|
@@ -25,7 +25,8 @@ export declare class UpgradeError extends GraphQlMutationError {
|
|
|
25
25
|
statusCode: number | undefined;
|
|
26
26
|
});
|
|
27
27
|
}
|
|
28
|
-
export declare class EnvironmentNotFoundError extends
|
|
28
|
+
export declare class EnvironmentNotFoundError extends UserError {
|
|
29
|
+
constructor(environmentKey: string);
|
|
29
30
|
}
|
|
30
31
|
export declare class MissingTaskIdError extends Error {
|
|
31
32
|
}
|
|
@@ -70,6 +71,6 @@ export declare class InstallationsGraphqlClient implements InstallAppClient, Lis
|
|
|
70
71
|
private getCombinedHostnameMap;
|
|
71
72
|
private resolveInstallationsHostnames;
|
|
72
73
|
private getAllInstallations;
|
|
73
|
-
getVersions(appId: string, environmentKey: string, firstN?: number): Promise<
|
|
74
|
+
getVersions(appId: string, environmentKey: string, firstN?: number): Promise<AppEnvironmentVersionData>;
|
|
74
75
|
}
|
|
75
76
|
//# sourceMappingURL=graphql-client.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"graphql-client.d.ts","sourceRoot":"","sources":["../../src/installations/graphql-client.ts"],"names":[],"mappings":"AAEA,OAAO,
|
|
1
|
+
{"version":3,"file":"graphql-client.d.ts","sourceRoot":"","sources":["../../src/installations/graphql-client.ts"],"names":[],"mappings":"AAEA,OAAO,EAKL,sBAAsB,EAItB,aAAa,EACb,oBAAoB,EAMpB,KAAK,EAGL,SAAS,EACT,SAAS,EAEV,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EAAE,qBAAqB,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAC7E,OAAO,EACL,yBAAyB,EACzB,YAAY,EACZ,0BAA0B,EAC1B,6BAA6B,EAC9B,MAAM,iCAAiC,CAAC;AACzC,OAAO,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AAEzE,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAEpD,eAAO,MAAM,kCAAkC,MAAM,CAAC;AAkBtD,eAAO,MAAM,qBAAqB,kCA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pB,WAAW,CAAC,KAAK,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,EAAE,MAAM,SAAI,GAAG,OAAO,CAAC,yBAAyB,CAAC;CAyChH"}
|
|
@@ -35,7 +35,10 @@ class UpgradeError extends cli_shared_1.GraphQlMutationError {
|
|
|
35
35
|
}
|
|
36
36
|
}
|
|
37
37
|
exports.UpgradeError = UpgradeError;
|
|
38
|
-
class EnvironmentNotFoundError extends
|
|
38
|
+
class EnvironmentNotFoundError extends cli_shared_1.UserError {
|
|
39
|
+
constructor(environmentKey) {
|
|
40
|
+
super(cli_shared_1.Text.env.error.envNotExist(environmentKey, cli_shared_1.environmentToOption));
|
|
41
|
+
}
|
|
39
42
|
}
|
|
40
43
|
exports.EnvironmentNotFoundError = EnvironmentNotFoundError;
|
|
41
44
|
class MissingTaskIdError extends Error {
|
|
@@ -314,12 +317,13 @@ class InstallationsGraphqlClient {
|
|
|
314
317
|
});
|
|
315
318
|
const combinedAriToHostname = await this.getCombinedHostnameMap(installationContexts);
|
|
316
319
|
return installationContexts.map((context, i) => {
|
|
317
|
-
const { environment, installation } = installations[i];
|
|
320
|
+
const { environment, environmentType, installation } = installations[i];
|
|
318
321
|
const site = combinedAriToHostname[context.toString()];
|
|
319
322
|
return {
|
|
320
323
|
id: installation.id,
|
|
321
324
|
product: context.resourceOwner,
|
|
322
325
|
environmentKey: environment,
|
|
326
|
+
environmentType,
|
|
323
327
|
context: installation.installationContext,
|
|
324
328
|
site,
|
|
325
329
|
version: installation.version || {
|
|
@@ -342,6 +346,7 @@ class InstallationsGraphqlClient {
|
|
|
342
346
|
}
|
|
343
347
|
appEnvironment {
|
|
344
348
|
key
|
|
349
|
+
type
|
|
345
350
|
}
|
|
346
351
|
}
|
|
347
352
|
pageInfo {
|
|
@@ -376,6 +381,7 @@ class InstallationsGraphqlClient {
|
|
|
376
381
|
}
|
|
377
382
|
output.push({
|
|
378
383
|
environment: node.appEnvironment.key,
|
|
384
|
+
environmentType: node.appEnvironment.type,
|
|
379
385
|
installation: node
|
|
380
386
|
});
|
|
381
387
|
}
|
|
@@ -386,10 +392,12 @@ class InstallationsGraphqlClient {
|
|
|
386
392
|
return output;
|
|
387
393
|
}
|
|
388
394
|
async getVersions(appId, environmentKey, firstN = 1) {
|
|
395
|
+
var _a;
|
|
389
396
|
const query = `
|
|
390
397
|
query forge_cli_getApplicationEnvironmentLatestVersions($appId: ID!, $environmentKey: String!, $firstN: Int!) {
|
|
391
398
|
app(id: $appId) {
|
|
392
399
|
environmentByKey(key: $environmentKey) {
|
|
400
|
+
type
|
|
393
401
|
versions(first: $firstN) {
|
|
394
402
|
nodes {
|
|
395
403
|
permissions {
|
|
@@ -415,9 +423,12 @@ class InstallationsGraphqlClient {
|
|
|
415
423
|
throw new MissingAppError();
|
|
416
424
|
}
|
|
417
425
|
if (!result.app.environmentByKey) {
|
|
418
|
-
throw new EnvironmentNotFoundError();
|
|
426
|
+
throw new EnvironmentNotFoundError(environmentKey);
|
|
419
427
|
}
|
|
420
|
-
return
|
|
428
|
+
return {
|
|
429
|
+
nodes: (_a = result.app.environmentByKey.versions) === null || _a === void 0 ? void 0 : _a.nodes,
|
|
430
|
+
environmentType: result.app.environmentByKey.type
|
|
431
|
+
};
|
|
421
432
|
}
|
|
422
433
|
}
|
|
423
434
|
exports.InstallationsGraphqlClient = InstallationsGraphqlClient;
|
|
@@ -39,7 +39,7 @@ class GraphqlClient {
|
|
|
39
39
|
throw new cli_shared_1.MissingAppError();
|
|
40
40
|
}
|
|
41
41
|
if (!result.app.environmentByKey) {
|
|
42
|
-
throw new cli_shared_1.MissingAppEnvironmentError();
|
|
42
|
+
throw new cli_shared_1.MissingAppEnvironmentError(environmentKey);
|
|
43
43
|
}
|
|
44
44
|
const mpacAppKey = (_a = result.app.marketplaceApp) === null || _a === void 0 ? void 0 : _a.appKey;
|
|
45
45
|
const versions = result.app.environmentByKey.versions;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
|
-
import { AppConfigProvider,
|
|
2
|
+
import { AppConfigProvider, AppEnvironmentType, AppEnvironmentVersion, Maybe } from '@forge/cli-shared';
|
|
3
3
|
import { URL } from 'url';
|
|
4
4
|
import { AppInstallSiteDetails } from '../installations/install-app-site';
|
|
5
5
|
export interface Installation {
|
|
@@ -7,6 +7,7 @@ export interface Installation {
|
|
|
7
7
|
product: string;
|
|
8
8
|
site: string;
|
|
9
9
|
environmentKey: string;
|
|
10
|
+
environmentType: AppEnvironmentType;
|
|
10
11
|
context: string;
|
|
11
12
|
version: {
|
|
12
13
|
isLatest: boolean;
|
|
@@ -21,15 +22,20 @@ export interface AppEnvironmentVersionPermissions {
|
|
|
21
22
|
}
|
|
22
23
|
export interface AppEnvironmentPermissions extends AppEnvironmentVersionPermissions {
|
|
23
24
|
addedScopes: string[];
|
|
25
|
+
environmentType: AppEnvironmentType;
|
|
24
26
|
}
|
|
25
27
|
interface InstallationFilterOptions {
|
|
26
28
|
site?: string;
|
|
27
29
|
product?: 'Jira' | 'Confluence';
|
|
28
30
|
environment?: string;
|
|
29
31
|
}
|
|
32
|
+
export interface AppEnvironmentVersionData {
|
|
33
|
+
nodes?: Array<Maybe<AppEnvironmentVersion>> | null;
|
|
34
|
+
environmentType: AppEnvironmentType;
|
|
35
|
+
}
|
|
30
36
|
export interface ListAppInstallationsClient {
|
|
31
37
|
listInstallations(appId: string): Promise<Installation[]>;
|
|
32
|
-
getVersions(appId: string, environmentKey: string, firstN: number): Promise<
|
|
38
|
+
getVersions(appId: string, environmentKey: string, firstN: number): Promise<AppEnvironmentVersionData>;
|
|
33
39
|
}
|
|
34
40
|
export interface UpgradeAppInstallationsClient {
|
|
35
41
|
upgradeInstallation({ site, product, environmentKey, appId }: AppInstallSiteDetails): Promise<void>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"installation-service.d.ts","sourceRoot":"","sources":["../../src/service/installation-service.ts"],"names":[],"mappings":";AAAA,OAAO,EACL,iBAAiB,EACjB,
|
|
1
|
+
{"version":3,"file":"installation-service.d.ts","sourceRoot":"","sources":["../../src/service/installation-service.ts"],"names":[],"mappings":";AAAA,OAAO,EACL,iBAAiB,EACjB,kBAAkB,EAClB,qBAAqB,EAKrB,KAAK,EAEN,MAAM,mBAAmB,CAAC;AAG3B,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAG1B,OAAO,EAAE,qBAAqB,EAAE,MAAM,mCAAmC,CAAC;AAE1E,MAAM,WAAW,YAAY;IAC3B,EAAE,EAAE,MAAM,CAAC;IACX,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,cAAc,EAAE,MAAM,CAAC;IACvB,eAAe,EAAE,kBAAkB,CAAC;IACpC,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE;QACP,QAAQ,EAAE,OAAO,CAAC;KACnB,CAAC;CACH;AAED,MAAM,WAAW,eAAe;IAC9B,aAAa,EAAE,YAAY,EAAE,CAAC;CAC/B;AAED,MAAM,WAAW,gCAAgC;IAC/C,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,eAAe,EAAE,MAAM,EAAE,CAAC;CAC3B;AAED,MAAM,WAAW,yBAA0B,SAAQ,gCAAgC;IACjF,WAAW,EAAE,MAAM,EAAE,CAAC;IACtB,eAAe,EAAE,kBAAkB,CAAC;CACrC;AAED,UAAU,yBAAyB;IACjC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,MAAM,GAAG,YAAY,CAAC;IAChC,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,WAAW,yBAAyB;IACxC,KAAK,CAAC,EAAE,KAAK,CAAC,KAAK,CAAC,qBAAqB,CAAC,CAAC,GAAG,IAAI,CAAC;IACnD,eAAe,EAAE,kBAAkB,CAAC;CACrC;AAED,MAAM,WAAW,0BAA0B;IACzC,iBAAiB,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,YAAY,EAAE,CAAC,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