@forge/cli 6.11.0 → 6.11.1-next.0-experimental-5ec0ed7
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 +23 -0
- package/npm-shrinkwrap.json +77 -74
- package/out/command-line/command.d.ts +3 -1
- package/out/command-line/command.d.ts.map +1 -1
- package/out/command-line/command.js +10 -8
- package/out/command-line/controller/default-environment-controller.d.ts +25 -0
- package/out/command-line/controller/default-environment-controller.d.ts.map +1 -0
- package/out/command-line/controller/default-environment-controller.js +108 -0
- package/out/command-line/controller/deploy-controller.d.ts +7 -2
- package/out/command-line/controller/deploy-controller.d.ts.map +1 -1
- package/out/command-line/controller/deploy-controller.js +37 -6
- package/out/command-line/controller/install-controller.d.ts.map +1 -1
- package/out/command-line/controller/install-controller.js +5 -5
- package/out/command-line/controller/settings-controller.d.ts +1 -0
- package/out/command-line/controller/settings-controller.d.ts.map +1 -1
- package/out/command-line/controller/settings-controller.js +4 -3
- 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 +8 -3
- package/out/command-line/environment.d.ts.map +1 -1
- package/out/command-line/environment.js +1 -1
- package/out/command-line/register-app-commands.d.ts.map +1 -1
- package/out/command-line/register-app-commands.js +23 -24
- package/out/command-line/register-environment-commands.d.ts.map +1 -1
- package/out/command-line/register-environment-commands.js +2 -2
- package/out/command-line/register-environment-variables-commands.d.ts.map +1 -1
- package/out/command-line/register-environment-variables-commands.js +4 -4
- package/out/command-line/register-installation-commands.d.ts.map +1 -1
- package/out/command-line/register-installation-commands.js +2 -2
- package/out/command-line/register-lint-command.js +1 -1
- package/out/command-line/register-providers-commands.d.ts.map +1 -1
- package/out/command-line/register-providers-commands.js +1 -2
- package/out/command-line/utils.d.ts +4 -0
- package/out/command-line/utils.d.ts.map +1 -0
- package/out/command-line/utils.js +30 -0
- package/out/command-line/view/deploy-view.d.ts +5 -2
- package/out/command-line/view/deploy-view.d.ts.map +1 -1
- package/out/command-line/view/deploy-view.js +20 -4
- package/out/command-line/view/install-view.js +1 -1
- package/out/command-line/view/tunnel-view.d.ts.map +1 -1
- package/out/command-line/view/tunnel-view.js +1 -1
- package/out/environment/graphql-client.d.ts.map +1 -1
- package/out/environment/graphql-client.js +1 -1
- package/out/installations/graphql-client.d.ts.map +1 -1
- package/out/installations/graphql-client.js +1 -1
- package/package.json +6 -5
|
@@ -29,7 +29,7 @@ class InvalidConnectKeyError extends cli_shared_1.HiddenError {
|
|
|
29
29
|
}
|
|
30
30
|
exports.InvalidConnectKeyError = InvalidConnectKeyError;
|
|
31
31
|
class DeployController {
|
|
32
|
-
constructor(appConfigProvider, configFile, lintService, installationsService, migrationKeysService, appEnvironmentClient, deployView, packageUploadDeployCommand) {
|
|
32
|
+
constructor(appConfigProvider, configFile, lintService, installationsService, migrationKeysService, appEnvironmentClient, deployView, packageUploadDeployCommand, createEnvironmentCommand) {
|
|
33
33
|
this.appConfigProvider = appConfigProvider;
|
|
34
34
|
this.configFile = configFile;
|
|
35
35
|
this.lintService = lintService;
|
|
@@ -38,6 +38,7 @@ class DeployController {
|
|
|
38
38
|
this.appEnvironmentClient = appEnvironmentClient;
|
|
39
39
|
this.deployView = deployView;
|
|
40
40
|
this.packageUploadDeployCommand = packageUploadDeployCommand;
|
|
41
|
+
this.createEnvironmentCommand = createEnvironmentCommand;
|
|
41
42
|
}
|
|
42
43
|
isMpacProductionApp(mpacAppKey, environment) {
|
|
43
44
|
return !!(mpacAppKey && environment === 'production');
|
|
@@ -93,11 +94,43 @@ class DeployController {
|
|
|
93
94
|
}
|
|
94
95
|
const manifest = await this.configFile.readConfig();
|
|
95
96
|
if ((_b = (_a = manifest === null || manifest === void 0 ? void 0 : manifest.app) === null || _a === void 0 ? void 0 : _a.storage) === null || _b === void 0 ? void 0 : _b.entities) {
|
|
96
|
-
this.deployView.displayIndexingCommand(
|
|
97
|
+
this.deployView.displayIndexingCommand(environment);
|
|
97
98
|
}
|
|
98
99
|
}
|
|
99
|
-
async
|
|
100
|
-
|
|
100
|
+
async confirmAndCreateEnvironment(environment, nonInteractive) {
|
|
101
|
+
let confirm = nonInteractive;
|
|
102
|
+
if (!confirm) {
|
|
103
|
+
this.deployView.displayEnvironmentCreationWarning(environment);
|
|
104
|
+
confirm = await this.deployView.promptToCreateEnvironment();
|
|
105
|
+
}
|
|
106
|
+
if (confirm) {
|
|
107
|
+
await this.createEnvironmentCommand.execute({ environmentKey: environment });
|
|
108
|
+
this.deployView.displayEnvironmentCreationSuccessMessage(environment);
|
|
109
|
+
}
|
|
110
|
+
return confirm;
|
|
111
|
+
}
|
|
112
|
+
async getAppEnvironmentDetails(id, environment, nonInteractive) {
|
|
113
|
+
try {
|
|
114
|
+
return await this.appEnvironmentClient.getAppEnvironmentDetails(id, environment);
|
|
115
|
+
}
|
|
116
|
+
catch (e) {
|
|
117
|
+
if (!(e instanceof cli_shared_1.MissingAppEnvironmentError)) {
|
|
118
|
+
throw e;
|
|
119
|
+
}
|
|
120
|
+
const created = await this.confirmAndCreateEnvironment(environment, nonInteractive);
|
|
121
|
+
if (!created) {
|
|
122
|
+
return;
|
|
123
|
+
}
|
|
124
|
+
return this.appEnvironmentClient.getAppEnvironmentDetails(id, environment);
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
async run({ environment, verify, nonInteractive }) {
|
|
128
|
+
const { id } = await this.appConfigProvider();
|
|
129
|
+
const appDetails = await this.getAppEnvironmentDetails(id, environment, nonInteractive);
|
|
130
|
+
if (appDetails === undefined) {
|
|
131
|
+
return;
|
|
132
|
+
}
|
|
133
|
+
this.deployView.displayStart(environment, appDetails.environmentType);
|
|
101
134
|
let hasConnectKeyChanged = false;
|
|
102
135
|
let hasConnectKeyDeleted = false;
|
|
103
136
|
if (verify) {
|
|
@@ -110,10 +143,8 @@ class DeployController {
|
|
|
110
143
|
hasConnectKeyChanged = connectKeyChanged;
|
|
111
144
|
hasConnectKeyDeleted = connectKeyDeleted;
|
|
112
145
|
}
|
|
113
|
-
const { id } = await this.appConfigProvider();
|
|
114
146
|
const handlers = await this.configFile.getAppHandlers();
|
|
115
147
|
const resources = await this.configFile.getResources();
|
|
116
|
-
const appDetails = await this.appEnvironmentClient.getAppEnvironmentDetails(id, environment);
|
|
117
148
|
let hasProdInstallations = false;
|
|
118
149
|
try {
|
|
119
150
|
const prodInstallations = await this.installationsService.listAppInstallations({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"install-controller.d.ts","sourceRoot":"","sources":["../../../src/command-line/controller/install-controller.ts"],"names":[],"mappings":";AAAA,OAAO,EAEL,iBAAiB,EAEjB,UAAU,EAEV,EAAE,
|
|
1
|
+
{"version":3,"file":"install-controller.d.ts","sourceRoot":"","sources":["../../../src/command-line/controller/install-controller.ts"],"names":[],"mappings":";AAAA,OAAO,EAEL,iBAAiB,EAEjB,UAAU,EAEV,EAAE,EASF,iBAAiB,EAClB,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAC1B,OAAO,EAAE,qBAAqB,EAAE,MAAM,sCAAsC,CAAC;AAC7E,OAAO,EAA6B,mBAAmB,EAAE,MAAM,oCAAoC,CAAC;AACpG,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAEnD,UAAU,gBAAgB;IACxB,WAAW,EAAE,MAAM,CAAC;IACpB,IAAI,CAAC,EAAE,GAAG,CAAC;IACX,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,OAAO,CAAC;IACjB,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,aAAa,EAAE,OAAO,CAAC;CACxB;AAYD,qBAAa,iBAAkB,SAAQ,KAAK;gBAC9B,WAAW,EAAE,MAAM;CAGhC;AASD,qBAAa,iBAAiB;IAE1B,OAAO,CAAC,QAAQ,CAAC,iBAAiB;IAClC,OAAO,CAAC,QAAQ,CAAC,UAAU;IAC3B,OAAO,CAAC,QAAQ,CAAC,EAAE;IACnB,OAAO,CAAC,QAAQ,CAAC,qBAAqB;IACtC,OAAO,CAAC,QAAQ,CAAC,mBAAmB;IACpC,OAAO,CAAC,QAAQ,CAAC,WAAW;IAC5B,OAAO,CAAC,QAAQ,CAAC,YAAY;gBANZ,iBAAiB,EAAE,iBAAiB,EACpC,UAAU,EAAE,UAAU,EACtB,EAAE,EAAE,EAAE,EACN,qBAAqB,EAAE,qBAAqB,EAC5C,mBAAmB,EAAE,mBAAmB,EACxC,WAAW,EAAE,WAAW,EACxB,YAAY,EAAE,iBAAiB;YAGpC,cAAc;YAmBd,gBAAgB;YAuChB,gBAAgB;YAKhB,aAAa;YAeb,gBAAgB;IAqB9B,OAAO,CAAC,uCAAuC;IAalC,GAAG,CAAC,EACf,WAAW,EACX,IAAI,EACJ,OAAO,EACP,OAAO,EACP,aAAa,EACb,cAAc,EACf,EAAE,gBAAgB,GAAG,OAAO,CAAC,IAAI,CAAC;YA6GrB,kBAAkB;CAYjC"}
|
|
@@ -5,7 +5,7 @@ const cli_shared_1 = require("@forge/cli-shared");
|
|
|
5
5
|
const manifest_1 = require("@forge/manifest");
|
|
6
6
|
class NoDeploymentError extends Error {
|
|
7
7
|
constructor(environment) {
|
|
8
|
-
super(cli_shared_1.Text.install.error.noDeploymentFound(
|
|
8
|
+
super(cli_shared_1.Text.install.error.noDeploymentFound(environment));
|
|
9
9
|
}
|
|
10
10
|
}
|
|
11
11
|
exports.NoDeploymentError = NoDeploymentError;
|
|
@@ -49,7 +49,7 @@ class InstallController {
|
|
|
49
49
|
});
|
|
50
50
|
return false;
|
|
51
51
|
}
|
|
52
|
-
}, text.cmd.start(environment, environmentType
|
|
52
|
+
}, text.cmd.start(environment, environmentType), (alreadyUpdated) => {
|
|
53
53
|
if (alreadyUpdated) {
|
|
54
54
|
return cli_shared_1.Text.upgrade.alreadyUpdated.spinner;
|
|
55
55
|
}
|
|
@@ -143,11 +143,11 @@ class InstallController {
|
|
|
143
143
|
return;
|
|
144
144
|
const isAlreadyUpdated = await this.installOrUpgrade(upgrade, environment, environmentType, site, product, id, text);
|
|
145
145
|
if (isAlreadyUpdated) {
|
|
146
|
-
this.ui.info(cli_shared_1.Text.upgrade.alreadyUpdated.banner(environment,
|
|
146
|
+
this.ui.info(cli_shared_1.Text.upgrade.alreadyUpdated.banner(environment, product, site.host));
|
|
147
147
|
}
|
|
148
148
|
else {
|
|
149
149
|
this.ui.emptyLine();
|
|
150
|
-
this.ui.info(text.success.banner(environment, environmentType,
|
|
150
|
+
this.ui.info(text.success.banner(environment, environmentType, product, site.host));
|
|
151
151
|
const uniqueProductsFromScopes = this.getUniqueInstallationProductsFromScopes(environmentScopes);
|
|
152
152
|
if (!uniqueProductsFromScopes || uniqueProductsFromScopes.length <= 1)
|
|
153
153
|
return;
|
|
@@ -162,7 +162,7 @@ class InstallController {
|
|
|
162
162
|
const productsToInstall = uniqueProductsFromScopes.filter((product) => !installedProducts.includes(product));
|
|
163
163
|
if (productsToInstall.length === 0 && productsToUpgrade.length === 0)
|
|
164
164
|
return;
|
|
165
|
-
this.ui.warn(cli_shared_1.Text.install.multiProductScopesDetected(productsToInstall, productsToUpgrade, site.host, environment
|
|
165
|
+
this.ui.warn(cli_shared_1.Text.install.multiProductScopesDetected(productsToInstall, productsToUpgrade, site.host, environment));
|
|
166
166
|
}
|
|
167
167
|
}
|
|
168
168
|
async extractAddedScopes({ addedScopes }) {
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { CachedConfigService } from '../../service/cached-config-service';
|
|
2
2
|
import { SettingsView } from '../view/settings-view';
|
|
3
3
|
import { AppConfigProvider, FeatureFlagService } from '@forge/cli-shared';
|
|
4
|
+
export declare const DEFAULT_ENVIRONMENT_SETTING = "default-environment";
|
|
4
5
|
export declare class SettingsController {
|
|
5
6
|
private readonly settingsView;
|
|
6
7
|
private readonly cachedConfigService;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"settings-controller.d.ts","sourceRoot":"","sources":["../../../src/command-line/controller/settings-controller.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,qCAAqC,CAAC;AAC1E,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AACrD,OAAO,EACL,iBAAiB,EAEjB,kBAAkB,EAInB,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"settings-controller.d.ts","sourceRoot":"","sources":["../../../src/command-line/controller/settings-controller.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,qCAAqC,CAAC;AAC1E,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AACrD,OAAO,EACL,iBAAiB,EAEjB,kBAAkB,EAInB,MAAM,mBAAmB,CAAC;AAK3B,eAAO,MAAM,2BAA2B,wBAAwB,CAAC;AAajE,qBAAa,kBAAkB;IAE3B,OAAO,CAAC,QAAQ,CAAC,YAAY;IAC7B,OAAO,CAAC,QAAQ,CAAC,mBAAmB;IACpC,OAAO,CAAC,QAAQ,CAAC,YAAY;IAC7B,OAAO,CAAC,QAAQ,CAAC,kBAAkB;gBAHlB,YAAY,EAAE,YAAY,EAC1B,mBAAmB,EAAE,mBAAmB,EACxC,YAAY,EAAE,iBAAiB,EAC/B,kBAAkB,EAAE,kBAAkB;IAGzD,OAAO,CAAC,YAAY,CA4BlB;YAEY,QAAQ;YAKR,mBAAmB;IAKjC,OAAO,CAAC,YAAY;IAWpB,OAAO,CAAC,gBAAgB;YAIV,UAAU;IAWX,iBAAiB;IAWjB,YAAY,CAAC,IAAI,CAAC,EAAE,OAAO;IAY3B,UAAU,CAAC,UAAU,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM;CAY1D"}
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.SettingsController = void 0;
|
|
3
|
+
exports.SettingsController = exports.DEFAULT_ENVIRONMENT_SETTING = void 0;
|
|
4
4
|
const cli_shared_1 = require("@forge/cli-shared");
|
|
5
5
|
const manifest_1 = require("@forge/manifest");
|
|
6
6
|
const environment_1 = require("../environment");
|
|
7
|
-
|
|
7
|
+
exports.DEFAULT_ENVIRONMENT_SETTING = 'default-environment';
|
|
8
|
+
const ALLOWED_SETTINGS = ['usage-analytics', exports.DEFAULT_ENVIRONMENT_SETTING];
|
|
8
9
|
class SettingsController {
|
|
9
10
|
constructor(settingsView, cachedConfigService, getAppConfig, featureFlagService) {
|
|
10
11
|
this.settingsView = settingsView;
|
|
@@ -35,7 +36,7 @@ class SettingsController {
|
|
|
35
36
|
const appId = await this.getAppId();
|
|
36
37
|
this.cachedConfigService.setDefaultEnvironment(appId, environment);
|
|
37
38
|
},
|
|
38
|
-
display: (value) => cli_shared_1.Text.env.displayEnvironment(value, cli_shared_1.AppEnvironmentType.Development
|
|
39
|
+
display: (value) => cli_shared_1.Text.env.displayEnvironment(value, cli_shared_1.AppEnvironmentType.Development),
|
|
39
40
|
isAvailable: async () => (await this.validateAppManifest()).success && (await this.featureFlagService.isConcurrentDevEnabled())
|
|
40
41
|
}
|
|
41
42
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { CLIDetails, CommandLineUI, ConfigFile, CreateAppCommand, FeatureFlagService, LoginCommand, LogoutCommand, RegisterAppCommand, ViewAppLogsCommand } from '@forge/cli-shared';
|
|
1
|
+
import { CLIDetails, CommandLineUI, ConfigFile, CreateAppCommand, FeatureFlagService, GetAppOwnerQuery, LoginCommand, LogoutCommand, RegisterAppCommand, ViewAppLogsCommand } from '@forge/cli-shared';
|
|
2
2
|
import { AnalyticsClientReporter } from '../analytics-client/analytics-client';
|
|
3
3
|
import { PackageUploadDeployCommand } from '../deploy';
|
|
4
4
|
import { DeleteEnvironmentVariableCommand } from '../environment-variables/delete-environment-variable';
|
|
@@ -29,6 +29,7 @@ import { TunnelController } from './controller/tunnel-controller';
|
|
|
29
29
|
import { StubController } from './controller/stubController';
|
|
30
30
|
import { PrerequisitesController } from './controller/prerequisites-controller';
|
|
31
31
|
import { ListEntitiesIndexesCommand } from '../entities/list-indexes';
|
|
32
|
+
import { DefaultEnvironmentController } from './controller/default-environment-controller';
|
|
32
33
|
export declare const getDependencies: (cliDetails: CLIDetails | undefined) => Promise<{
|
|
33
34
|
ui: CommandLineUI;
|
|
34
35
|
cmd: Command<[], import("./command").DefaultOpts>;
|
|
@@ -44,6 +45,7 @@ export declare const getDependencies: (cliDetails: CLIDetails | undefined) => Pr
|
|
|
44
45
|
registerAppCommand: RegisterAppCommand;
|
|
45
46
|
installAppSiteCommand: InstallAppSiteCommand;
|
|
46
47
|
uninstallAppCommand: UninstallAppCommand;
|
|
48
|
+
getAppOwnerQuery: GetAppOwnerQuery;
|
|
47
49
|
packageUploadDeployCommand: PackageUploadDeployCommand;
|
|
48
50
|
setEnvironmentVariableCommand: SetEnvironmentVariableCommand;
|
|
49
51
|
deleteEnvironmentVariableCommand: DeleteEnvironmentVariableCommand;
|
|
@@ -76,6 +78,7 @@ export declare const getDependencies: (cliDetails: CLIDetails | undefined) => Pr
|
|
|
76
78
|
settingsController: SettingsController;
|
|
77
79
|
stubController: StubController;
|
|
78
80
|
prerequisitesController: PrerequisitesController;
|
|
81
|
+
defaultEnvironmentController: DefaultEnvironmentController;
|
|
79
82
|
};
|
|
80
83
|
}>;
|
|
81
84
|
declare type PromiseType<T> = T extends Promise<infer R> ? R : any;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dependency-injection.d.ts","sourceRoot":"","sources":["../../src/command-line/dependency-injection.ts"],"names":[],"mappings":"AAIA,OAAO,EASL,UAAU,EACV,aAAa,EAEb,UAAU,EAGV,gBAAgB,EAGhB,kBAAkB,
|
|
1
|
+
{"version":3,"file":"dependency-injection.d.ts","sourceRoot":"","sources":["../../src/command-line/dependency-injection.ts"],"names":[],"mappings":"AAIA,OAAO,EASL,UAAU,EACV,aAAa,EAEb,UAAU,EAGV,gBAAgB,EAGhB,kBAAkB,EAGlB,gBAAgB,EAQhB,YAAY,EACZ,aAAa,EAOb,kBAAkB,EAIlB,kBAAkB,EAEnB,MAAM,mBAAmB,CAAC;AAc3B,OAAO,EAAE,uBAAuB,EAAE,MAAM,sCAAsC,CAAC;AAE/E,OAAO,EAML,0BAA0B,EAG3B,MAAM,WAAW,CAAC;AAEnB,OAAO,EAAE,gCAAgC,EAAE,MAAM,sDAAsD,CAAC;AAExG,OAAO,EAAE,+BAA+B,EAAE,MAAM,qDAAqD,CAAC;AACtG,OAAO,EAAE,6BAA6B,EAAE,MAAM,mDAAmD,CAAC;AAIlG,OAAO,EAAE,wBAAwB,EAAE,MAAM,iCAAiC,CAAC;AAG3E,OAAO,EAAE,qBAAqB,EAAE,MAAM,iCAAiC,CAAC;AACxE,OAAO,EAAE,uBAAuB,EAAE,MAAM,mCAAmC,CAAC;AAC5E,OAAO,EAAE,yBAAyB,EAAE,MAAM,qCAAqC,CAAC;AAGhF,OAAO,EAAE,wBAAwB,EAAE,MAAM,mCAAmC,CAAC;AAC7E,OAAO,EAAE,sBAAsB,EAAE,MAAM,iCAAiC,CAAC;AACzE,OAAO,EAAE,wBAAwB,EAAE,MAAM,mCAAmC,CAAC;AAM7E,OAAO,EAAE,qBAAqB,EAAE,MAAM,mCAAmC,CAAC;AAC1E,OAAO,EAAE,mBAAmB,EAAE,MAAM,gCAAgC,CAAC;AAIrE,OAAO,EAAE,mBAAmB,EAAE,MAAM,iCAAiC,CAAC;AAQtE,OAAO,EAAE,oBAAoB,EAAE,MAAM,mCAAmC,CAAC;AAIzE,OAAO,EAAE,uBAAuB,EAAE,MAAM,kCAAkC,CAAC;AAG3E,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAE5D,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC,OAAO,EAAE,sBAAsB,EAAE,MAAM,sCAAsC,CAAC;AAC9E,OAAO,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAC;AAClE,OAAO,EAAE,kBAAkB,EAAE,MAAM,kCAAkC,CAAC;AACtE,OAAO,EAAE,iBAAiB,EAAE,MAAM,iCAAiC,CAAC;AACpE,OAAO,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAC9D,OAAO,EAAE,oBAAoB,EAAE,MAAM,qCAAqC,CAAC;AAC3E,OAAO,EAAE,kBAAkB,EAAE,MAAM,kCAAkC,CAAC;AACtE,OAAO,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAC;AAWlE,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAC7D,OAAO,EAAE,uBAAuB,EAAE,MAAM,uCAAuC,CAAC;AAIhF,OAAO,EAAE,0BAA0B,EAAE,MAAM,0BAA0B,CAAC;AACtE,OAAO,EAAE,4BAA4B,EAAE,MAAM,6CAA6C,CAAC;AAE3F,eAAO,MAAM,eAAe,eAAsB,UAAU,GAAG,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAqVvE,CAAC;AAGF,aAAK,WAAW,CAAC,CAAC,IAAI,CAAC,SAAS,OAAO,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,GAAG,GAAG,CAAC;AAC3D,oBAAY,YAAY,GAAG,WAAW,CAAC,UAAU,CAAC,OAAO,eAAe,CAAC,CAAC,CAAC"}
|
|
@@ -68,6 +68,7 @@ const runtime_bundler_1 = require("../deploy/packager/runtime-bundler");
|
|
|
68
68
|
const nativeui_bundler_1 = require("../deploy/packager/nativeui-bundler");
|
|
69
69
|
const sentry_1 = require("./sentry");
|
|
70
70
|
const list_indexes_1 = require("../entities/list-indexes");
|
|
71
|
+
const default_environment_controller_1 = require("./controller/default-environment-controller");
|
|
71
72
|
const getDependencies = async (cliDetails) => {
|
|
72
73
|
let cmd;
|
|
73
74
|
const ui = new cli_shared_1.CommandLineUI(() => cmd.verbose);
|
|
@@ -92,7 +93,6 @@ const getDependencies = async (cliDetails) => {
|
|
|
92
93
|
const preCommandController = new pre_command_controller_1.PreCommandController(liteLintService, liteLintView, configFile, cachedConfigService, analyticsSettingsView, settingsView);
|
|
93
94
|
const graphqlGateway = (0, cli_shared_1.getGraphqlGateway)();
|
|
94
95
|
const authenticator = new cli_shared_1.PersonalTokenAuthenticator(credentialStore);
|
|
95
|
-
cmd = command_1.Command.program(ui, analyticsClientReporter, preCommandController, cliDetails, credentialStore);
|
|
96
96
|
await (0, sentry_1.initialiseSentry)(cachedConfigService);
|
|
97
97
|
const createGraphQLClient = (auth) => {
|
|
98
98
|
const minimalGraphQLRunner = new cli_shared_1.MinimalGraphQLRunner(auth, graphqlGateway, cliDetails);
|
|
@@ -113,6 +113,7 @@ const getDependencies = async (cliDetails) => {
|
|
|
113
113
|
const templater = new cli_shared_1.ComposableTemplater(downloader, extractor, lister, ui);
|
|
114
114
|
const npmInstaller = new cli_shared_1.NpmInstaller(ui);
|
|
115
115
|
const createAppCommand = new cli_shared_1.CreateAppCommand(templater, registerAppCommand, npmInstaller);
|
|
116
|
+
const getAppOwnerQuery = new cli_shared_1.GetAppOwnerQuery(graphQLClient, assertiveAppConfigReader);
|
|
116
117
|
const environmentVariablesClient = new graphql_client_1.GraphqlClient(graphQLClient);
|
|
117
118
|
const setEnvironmentVariableCommand = new set_environment_variable_1.SetEnvironmentVariableCommand(environmentVariablesClient, assertiveAppConfigReader);
|
|
118
119
|
const deleteEnvironmentVariableCommand = new delete_environment_variable_1.DeleteEnvironmentVariableCommand(environmentVariablesClient, assertiveAppConfigReader);
|
|
@@ -167,7 +168,7 @@ const getDependencies = async (cliDetails) => {
|
|
|
167
168
|
const iframeResizerScriptService = new cli_shared_1.IframeResizerScriptService();
|
|
168
169
|
const resourcePackagingService = new resource_packaging_service_1.ResourcePackagingService(archiverFactory, fileReader, process.cwd(), bridgeScriptService, iframeResizerScriptService);
|
|
169
170
|
const packageUploadDeployCommand = new deploy_1.PackageUploadDeployCommand(appPackager, archiveUploader, deployer, resourcePackagingService);
|
|
170
|
-
const deployController = new deploy_controller_1.DeployController(assertiveAppConfigReader, configFile, lintService, installationsService, migrationKeysService, appEnvironmentClient, deployView, packageUploadDeployCommand);
|
|
171
|
+
const deployController = new deploy_controller_1.DeployController(assertiveAppConfigReader, configFile, lintService, installationsService, migrationKeysService, appEnvironmentClient, deployView, packageUploadDeployCommand, createEnvironmentCommand);
|
|
171
172
|
const createSandbox = async (cfg) => new runtime_1.NodeSandbox(cfg);
|
|
172
173
|
const functionHost = new tunnel_1.LocalFunctionHost(configFile, ui, null, createSandbox, featureFlagService);
|
|
173
174
|
const localInvocationService = new tunnel_1.LocalInvocationService(configFile, ui, runtime_1.notImplementedInspector);
|
|
@@ -183,6 +184,8 @@ const getDependencies = async (cliDetails) => {
|
|
|
183
184
|
const tunnelController = new tunnel_controller_1.TunnelController(tunnelAnalyticsService, nodeTunnelService, localTunnelService, dockerTunnelService, tunnelView, featureFlagService);
|
|
184
185
|
const stubController = new stubController_1.StubController();
|
|
185
186
|
const prerequisitesController = new prerequisites_controller_1.PrerequisitesController(ui, featureFlagService, cliDetails);
|
|
187
|
+
const defaultEnvironmentController = new default_environment_controller_1.DefaultEnvironmentController(ui, credentialStore, featureFlagService, cachedConfigService, assertiveAppConfigReader, loginCommand, createEnvironmentCommand, listEnvironmentCommand, getAppOwnerQuery);
|
|
188
|
+
cmd = command_1.Command.program(ui, analyticsClientReporter, preCommandController, cliDetails, credentialStore, defaultEnvironmentController);
|
|
186
189
|
return {
|
|
187
190
|
ui,
|
|
188
191
|
cmd,
|
|
@@ -198,6 +201,7 @@ const getDependencies = async (cliDetails) => {
|
|
|
198
201
|
registerAppCommand,
|
|
199
202
|
installAppSiteCommand,
|
|
200
203
|
uninstallAppCommand,
|
|
204
|
+
getAppOwnerQuery,
|
|
201
205
|
packageUploadDeployCommand,
|
|
202
206
|
setEnvironmentVariableCommand,
|
|
203
207
|
deleteEnvironmentVariableCommand,
|
|
@@ -229,7 +233,8 @@ const getDependencies = async (cliDetails) => {
|
|
|
229
233
|
tunnelController,
|
|
230
234
|
settingsController,
|
|
231
235
|
stubController,
|
|
232
|
-
prerequisitesController
|
|
236
|
+
prerequisitesController,
|
|
237
|
+
defaultEnvironmentController
|
|
233
238
|
}
|
|
234
239
|
};
|
|
235
240
|
};
|
|
@@ -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":"AAUA,eAAO,MAAM,yBAAyB,cAAe,MAAM,KAAG,MAK7D,CAAC;AAEF,eAAO,MAAM,sBAAsB,cAAe,MAAM,KAAG,MAK1D,CAAC;AAEF,eAAO,MAAM,sBAAsB,cAAe,MAAM,KAAG,MAE1D,CAAC"}
|
|
@@ -12,7 +12,7 @@ const validateEnvironmentOption = (userValue) => {
|
|
|
12
12
|
exports.validateEnvironmentOption = validateEnvironmentOption;
|
|
13
13
|
const validateDevEnvironment = (userValue) => {
|
|
14
14
|
if ([cli_shared_1.STAGING_ENVIRONMENT_KEY, cli_shared_1.PRODUCTION_ENVIRONMENT_KEY].includes(userValue)) {
|
|
15
|
-
throw new cli_shared_1.ValidationError(cli_shared_1.Text.env.developmentOnly(userValue
|
|
15
|
+
throw new cli_shared_1.ValidationError(cli_shared_1.Text.env.developmentOnly(userValue));
|
|
16
16
|
}
|
|
17
17
|
return userValue;
|
|
18
18
|
};
|
|
@@ -1 +1 @@
|
|
|
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,
|
|
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,EAChB,kBAAkB,EACnB,MAAM,mBAAmB,CAAC;AAG3B,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAsBtD,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,kBAAkB,EAAE,kBAAkB,EACtC,IAAI,EAAE,MAAM,EACZ,EAAE,QAAQ,EAAE,SAAS,EAAE,EAAE,2BAA2B,GACnD,OAAO,CAAC,sBAAsB,CAAC,CAwGjC;AA+CD,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,YAAY,QAGlD"}
|
|
@@ -5,7 +5,6 @@ const tslib_1 = require("tslib");
|
|
|
5
5
|
const fs_1 = tslib_1.__importDefault(require("fs"));
|
|
6
6
|
const sanitize_filename_1 = tslib_1.__importDefault(require("sanitize-filename"));
|
|
7
7
|
const cli_shared_1 = require("@forge/cli-shared");
|
|
8
|
-
const cli_shared_2 = require("@forge/cli-shared");
|
|
9
8
|
var TemplateCategory;
|
|
10
9
|
(function (TemplateCategory) {
|
|
11
10
|
TemplateCategory["SHOW_ALL"] = "Show All";
|
|
@@ -16,12 +15,12 @@ var TemplateCategory;
|
|
|
16
15
|
})(TemplateCategory || (TemplateCategory = {}));
|
|
17
16
|
function ensureDirectoryDoesntExist(directory) {
|
|
18
17
|
if (fs_1.default.existsSync(directory)) {
|
|
19
|
-
throw new
|
|
18
|
+
throw new cli_shared_1.ValidationError(cli_shared_1.Text.create.error.directory.exists(directory));
|
|
20
19
|
}
|
|
21
20
|
}
|
|
22
21
|
function ensureValidNameLength(name) {
|
|
23
22
|
if (name.length <= 0 || name.length > 50) {
|
|
24
|
-
throw new
|
|
23
|
+
throw new cli_shared_1.ValidationError(cli_shared_1.Text.create.error.name.tooLong());
|
|
25
24
|
}
|
|
26
25
|
}
|
|
27
26
|
function directoryNameFromAppName(appName) {
|
|
@@ -37,7 +36,7 @@ exports.directoryNameFromAppName = directoryNameFromAppName;
|
|
|
37
36
|
async function createCommandHandler(ui, createAppCommand, featureFlagService, name, { template, directory }) {
|
|
38
37
|
if (directory) {
|
|
39
38
|
ensureDirectoryDoesntExist(directory);
|
|
40
|
-
ui.info(
|
|
39
|
+
ui.info(cli_shared_1.Text.create.intro(directory));
|
|
41
40
|
}
|
|
42
41
|
else {
|
|
43
42
|
directory = directoryNameFromAppName(name) || template;
|
|
@@ -45,12 +44,12 @@ async function createCommandHandler(ui, createAppCommand, featureFlagService, na
|
|
|
45
44
|
ensureDirectoryDoesntExist(directory);
|
|
46
45
|
}
|
|
47
46
|
const currentDirectory = process.cwd();
|
|
48
|
-
ui.info(
|
|
47
|
+
ui.info(cli_shared_1.Text.create.introWithCurrentDirectory(currentDirectory));
|
|
49
48
|
}
|
|
50
|
-
ui.info(
|
|
49
|
+
ui.info(cli_shared_1.Text.ctrlC);
|
|
51
50
|
if (!name) {
|
|
52
|
-
ui.info(
|
|
53
|
-
name = await ui.promptForText(
|
|
51
|
+
ui.info(cli_shared_1.Text.create.overviewAppName);
|
|
52
|
+
name = await ui.promptForText(cli_shared_1.Text.create.promptName);
|
|
54
53
|
if (!directory) {
|
|
55
54
|
directory = directoryNameFromAppName(name) || template;
|
|
56
55
|
if (directory) {
|
|
@@ -60,10 +59,10 @@ async function createCommandHandler(ui, createAppCommand, featureFlagService, na
|
|
|
60
59
|
}
|
|
61
60
|
ensureValidNameLength(name);
|
|
62
61
|
if (!template) {
|
|
63
|
-
ui.info(
|
|
64
|
-
const templates = await ui.displayTemporaryMessage(() => createAppCommand.getAvailableTemplates(),
|
|
62
|
+
ui.info(cli_shared_1.Text.create.overviewTemplates);
|
|
63
|
+
const templates = await ui.displayTemporaryMessage(() => createAppCommand.getAvailableTemplates(), cli_shared_1.Text.create.waitTemplates);
|
|
65
64
|
const enableCSUIK = await featureFlagService.readFlag('forge-cli-enable-csuik');
|
|
66
|
-
const type = await ui.promptForList(
|
|
65
|
+
const type = await ui.promptForList(cli_shared_1.Text.create.promptCategory, Object.values(TemplateCategory).filter((category) => enableCSUIK || category !== TemplateCategory.UI_KIT_2));
|
|
67
66
|
const filteredTemplates = type === TemplateCategory.SHOW_ALL
|
|
68
67
|
? templates
|
|
69
68
|
: templates
|
|
@@ -83,7 +82,7 @@ async function createCommandHandler(ui, createAppCommand, featureFlagService, na
|
|
|
83
82
|
}
|
|
84
83
|
})
|
|
85
84
|
.map((name) => name.replace('-ui-kit', '').replace('-custom-ui', '').replace('-csuik', ''));
|
|
86
|
-
template = await ui.promptForList(
|
|
85
|
+
template = await ui.promptForList(cli_shared_1.Text.create.promptTemplate, filteredTemplates);
|
|
87
86
|
if (type === TemplateCategory.UI_KIT) {
|
|
88
87
|
template = `${template}-ui-kit`;
|
|
89
88
|
}
|
|
@@ -101,35 +100,35 @@ async function createCommandHandler(ui, createAppCommand, featureFlagService, na
|
|
|
101
100
|
ui.emptyLine();
|
|
102
101
|
directory = directory;
|
|
103
102
|
const args = { name, template, directory };
|
|
104
|
-
const result = await ui.displayProgress(() => createAppCommand.execute(args),
|
|
105
|
-
ui.info(
|
|
103
|
+
const result = await ui.displayProgress(() => createAppCommand.execute(args), cli_shared_1.Text.create.cmd.start, cli_shared_1.Text.create.cmd.success(name));
|
|
104
|
+
ui.info(cli_shared_1.Text.create.cmd.successDetails(directory, result.environments));
|
|
106
105
|
return result;
|
|
107
106
|
}
|
|
108
107
|
exports.createCommandHandler = createCommandHandler;
|
|
109
108
|
function registerCreateCommands({ cmd, ui, commands: { createAppCommand }, services: { featureFlagService } }) {
|
|
110
109
|
cmd
|
|
111
110
|
.command('create [name]')
|
|
112
|
-
.description(
|
|
113
|
-
.option('-t, --template <template name>',
|
|
114
|
-
.option('-d, --directory <directory name>',
|
|
111
|
+
.description(cli_shared_1.Text.create.cmd.desc)
|
|
112
|
+
.option('-t, --template <template name>', cli_shared_1.Text.create.optionTemplate)
|
|
113
|
+
.option('-d, --directory <directory name>', cli_shared_1.Text.create.optionDirectory)
|
|
115
114
|
.action((name, options) => createCommandHandler(ui, createAppCommand, featureFlagService, name, options));
|
|
116
115
|
}
|
|
117
116
|
function registerRegisterCommand({ cmd, ui, commands: { registerAppCommand } }) {
|
|
118
117
|
cmd
|
|
119
118
|
.command('register [name]')
|
|
120
|
-
.description(
|
|
119
|
+
.description(cli_shared_1.Text.register.cmd.desc)
|
|
121
120
|
.requireManifestFile()
|
|
122
121
|
.action(async (name) => {
|
|
123
|
-
ui.info(
|
|
124
|
-
ui.info(
|
|
122
|
+
ui.info(cli_shared_1.Text.register.intro);
|
|
123
|
+
ui.info(cli_shared_1.Text.ctrlC);
|
|
125
124
|
ui.emptyLine();
|
|
126
125
|
if (!name) {
|
|
127
|
-
ui.info(
|
|
128
|
-
name = await ui.promptForText(
|
|
126
|
+
ui.info(cli_shared_1.Text.create.overviewAppName);
|
|
127
|
+
name = await ui.promptForText(cli_shared_1.Text.create.promptName);
|
|
129
128
|
ui.emptyLine();
|
|
130
129
|
}
|
|
131
|
-
const result = await ui.displayProgress(() => registerAppCommand.execute({ name }),
|
|
132
|
-
ui.info(
|
|
130
|
+
const result = await ui.displayProgress(() => registerAppCommand.execute({ name }), cli_shared_1.Text.register.cmd.start, cli_shared_1.Text.register.cmd.success(name));
|
|
131
|
+
ui.info(cli_shared_1.Text.register.cmd.successDetails(result.environments));
|
|
133
132
|
return result;
|
|
134
133
|
});
|
|
135
134
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"register-environment-commands.d.ts","sourceRoot":"","sources":["../../src/command-line/register-environment-commands.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,EAAE,EAMH,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAEtD,OAAO,EAAE,wBAAwB,EAAE,MAAM,mCAAmC,CAAC;AAC7E,OAAO,EAAE,sBAAsB,EAAE,MAAM,iCAAiC,CAAC;AACzE,OAAO,EAAE,wBAAwB,EAA2B,MAAM,mCAAmC,CAAC;AAMtG,UAAU,qBAAqB;IAC7B,WAAW,CAAC,EAAE,MAAM,EAAE,CAAC;IACvB,cAAc,CAAC,EAAE,OAAO,CAAC;CAC1B;AAED,eAAO,MAAM,wBAAwB,OAC/B,EAAE,4BACoB,wBAAwB,mBACjC,MAAM,kBAoBxB,CAAC;AAEF,eAAO,MAAM,sBAAsB,OAAc,EAAE,0BAA0B,sBAAsB,kBAiClG,CAAC;AAEF,eAAO,MAAM,wBAAwB,OAC/B,EAAE,WACG,qBAAqB,0BACN,sBAAsB,4BACpB,wBAAwB,kBAmCnD,CAAC;
|
|
1
|
+
{"version":3,"file":"register-environment-commands.d.ts","sourceRoot":"","sources":["../../src/command-line/register-environment-commands.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,EAAE,EAMH,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAEtD,OAAO,EAAE,wBAAwB,EAAE,MAAM,mCAAmC,CAAC;AAC7E,OAAO,EAAE,sBAAsB,EAAE,MAAM,iCAAiC,CAAC;AACzE,OAAO,EAAE,wBAAwB,EAA2B,MAAM,mCAAmC,CAAC;AAMtG,UAAU,qBAAqB;IAC7B,WAAW,CAAC,EAAE,MAAM,EAAE,CAAC;IACvB,cAAc,CAAC,EAAE,OAAO,CAAC;CAC1B;AAED,eAAO,MAAM,wBAAwB,OAC/B,EAAE,4BACoB,wBAAwB,mBACjC,MAAM,kBAoBxB,CAAC;AAEF,eAAO,MAAM,sBAAsB,OAAc,EAAE,0BAA0B,sBAAsB,kBAiClG,CAAC;AAEF,eAAO,MAAM,wBAAwB,OAC/B,EAAE,WACG,qBAAqB,0BACN,sBAAsB,4BACpB,wBAAwB,kBAmCnD,CAAC;AAyIF,eAAO,MAAM,gBAAgB,SAAU,YAAY,KAAG,IAOrD,CAAC"}
|
|
@@ -16,7 +16,7 @@ const createEnvironmentHandler = async (ui, createEnvironmentCommand, environmen
|
|
|
16
16
|
const args = {
|
|
17
17
|
environmentKey: (0, cli_shared_1.optionToEnvironment)(environmentKey)
|
|
18
18
|
};
|
|
19
|
-
await ui.displayProgress(() => createEnvironmentCommand.execute(args), cli_shared_1.Text.createEnvironment.cmd.start, cli_shared_1.Text.createEnvironment.cmd.success(environmentKey, cli_shared_1.AppEnvironmentType.Development
|
|
19
|
+
await ui.displayProgress(() => createEnvironmentCommand.execute(args), cli_shared_1.Text.createEnvironment.cmd.start, cli_shared_1.Text.createEnvironment.cmd.success(environmentKey, cli_shared_1.AppEnvironmentType.Development));
|
|
20
20
|
ui.emptyLine();
|
|
21
21
|
ui.info(cli_shared_1.Text.createEnvironment.successMessage);
|
|
22
22
|
};
|
|
@@ -121,7 +121,7 @@ const displayDeleteResult = (ui, deletedEnvironments, deleteSuccessful) => {
|
|
|
121
121
|
const successfulDelete = deletedEnvironments.filter((env) => env.successful);
|
|
122
122
|
const failedDelete = deletedEnvironments.filter((env) => !env.successful);
|
|
123
123
|
successfulDelete.forEach(({ environmentKey }) => {
|
|
124
|
-
ui.info(cli_shared_1.Text.deleteEnvironment.individualSuccessMessage(environmentKey, cli_shared_1.AppEnvironmentType.Development
|
|
124
|
+
ui.info(cli_shared_1.Text.deleteEnvironment.individualSuccessMessage(environmentKey, cli_shared_1.AppEnvironmentType.Development));
|
|
125
125
|
});
|
|
126
126
|
failedDelete.forEach(({ error }) => {
|
|
127
127
|
if (error !== undefined) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"register-environment-variables-commands.d.ts","sourceRoot":"","sources":["../../src/command-line/register-environment-variables-commands.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,
|
|
1
|
+
{"version":3,"file":"register-environment-variables-commands.d.ts","sourceRoot":"","sources":["../../src/command-line/register-environment-variables-commands.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAA8B,MAAM,mBAAmB,CAAC;AAEnE,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AACtD,OAAO,EAAE,+BAA+B,EAAE,MAAM,qDAAqD,CAAC;AA2EtG,wBAAsB,qCAAqC,CACzD,EAAE,EAAE,EAAE,EACN,+BAA+B,EAAE,+BAA+B,EAChE,WAAW,EAAE,MAAM,EACnB,IAAI,EAAE,OAAO,iBAwBd;AA4BD,eAAO,MAAM,gBAAgB,qBAAsB,YAAY,KAAG,IAOjE,CAAC"}
|
|
@@ -13,7 +13,7 @@ const registerSetEnvironmentVariableCommand = ({ cmd, ui, commands: { setEnviron
|
|
|
13
13
|
.option('--encrypt', cli_shared_1.Text.varsSet.optionSecret, false)
|
|
14
14
|
.environmentOption()
|
|
15
15
|
.action(async (key, value, { environment, encrypt }) => {
|
|
16
|
-
ui.info(cli_shared_1.Text.varsSet.overview(environment, (0, cli_shared_1.guessEnvironmentType)(environment)
|
|
16
|
+
ui.info(cli_shared_1.Text.varsSet.overview(environment, (0, cli_shared_1.guessEnvironmentType)(environment)));
|
|
17
17
|
ui.info(cli_shared_1.Text.ctrlC);
|
|
18
18
|
ui.emptyLine();
|
|
19
19
|
if (!value && !encrypt) {
|
|
@@ -47,7 +47,7 @@ const registerDeleteEnvironmentVariableCommand = ({ cmd, ui, commands: { deleteE
|
|
|
47
47
|
.description(cli_shared_1.Text.varsUnset.cmd.desc)
|
|
48
48
|
.environmentOption()
|
|
49
49
|
.action(async (key, { environment }) => {
|
|
50
|
-
ui.info(cli_shared_1.Text.varsUnset.cmd.start(environment, (0, cli_shared_1.guessEnvironmentType)(environment)
|
|
50
|
+
ui.info(cli_shared_1.Text.varsUnset.cmd.start(environment, (0, cli_shared_1.guessEnvironmentType)(environment)));
|
|
51
51
|
ui.info(cli_shared_1.Text.ctrlC);
|
|
52
52
|
await deleteEnvironmentVariableCommand.execute({ environment, key });
|
|
53
53
|
ui.info(cli_shared_1.Text.varsUnset.cmd.success(key));
|
|
@@ -67,8 +67,8 @@ async function listEnvironmentVariableCommandHandler(ui, listEnvironmentVariable
|
|
|
67
67
|
value: encrypted ? cli_shared_1.Text.varsList.encryptedValue : value
|
|
68
68
|
})), {
|
|
69
69
|
json,
|
|
70
|
-
emptyMessage: cli_shared_1.Text.varsList.empty(environment, (0, cli_shared_1.guessEnvironmentType)(environment)
|
|
71
|
-
preMessage: cli_shared_1.Text.varsList.overview(environment, (0, cli_shared_1.guessEnvironmentType)(environment)
|
|
70
|
+
emptyMessage: cli_shared_1.Text.varsList.empty(environment, (0, cli_shared_1.guessEnvironmentType)(environment)),
|
|
71
|
+
preMessage: cli_shared_1.Text.varsList.overview(environment, (0, cli_shared_1.guessEnvironmentType)(environment)),
|
|
72
72
|
postMessage: cli_shared_1.Text.varsList.postfix,
|
|
73
73
|
format: {
|
|
74
74
|
encrypted: (value) => (value ? '✔' : '')
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"register-installation-commands.d.ts","sourceRoot":"","sources":["../../src/command-line/register-installation-commands.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAY1B,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAEtD,OAAO,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAC;AAK/D,wBAAsB,eAAe,CAAC,EACpC,IAAI,EACJ,OAAO,EACR,EAAE;IACD,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB,GAAG,OAAO,CAAC;IAAE,OAAO,CAAC,EAAE,GAAG,CAAC;IAAC,OAAO,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC,CAW/C;AAoDD,eAAO,MAAM,sBAAsB,cACtB,MAAM,6CAC0B,YAAY,
|
|
1
|
+
{"version":3,"file":"register-installation-commands.d.ts","sourceRoot":"","sources":["../../src/command-line/register-installation-commands.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAY1B,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAEtD,OAAO,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAC;AAK/D,wBAAsB,eAAe,CAAC,EACpC,IAAI,EACJ,OAAO,EACR,EAAE;IACD,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB,GAAG,OAAO,CAAC;IAAE,OAAO,CAAC,EAAE,GAAG,CAAC;IAAC,OAAO,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC,CAW/C;AAoDD,eAAO,MAAM,sBAAsB,cACtB,MAAM,6CAC0B,YAAY,kBAuBxD,CAAC;AAEF,eAAO,MAAM,yBAAyB,oBACnB,YAAY,EAAE,6CACY,YAAY,kBA8CxD,CAAC;AAgEF,eAAO,MAAM,gBAAgB,qBAAsB,YAAY,KAAG,IAejE,CAAC"}
|
|
@@ -66,7 +66,7 @@ const performSingleUninstall = async (installId, { ui, commands: { uninstallAppC
|
|
|
66
66
|
message: cli_shared_1.Text.uninstall.cmd.success(false)
|
|
67
67
|
}));
|
|
68
68
|
const uninstallMessageFormat = installation.successful ? cli_shared_1.Text.uninstall.done : cli_shared_1.Text.uninstall.failed;
|
|
69
|
-
const uninstallMessage = uninstallMessageFormat((0, cli_shared_1.capitalizeProduct)(installation.product), installation.site, installation.environmentKey,
|
|
69
|
+
const uninstallMessage = uninstallMessageFormat((0, cli_shared_1.capitalizeProduct)(installation.product), installation.site, installation.environmentKey, false);
|
|
70
70
|
if (installation.successful) {
|
|
71
71
|
ui.info(uninstallMessage);
|
|
72
72
|
}
|
|
@@ -88,7 +88,7 @@ const performMultipleUninstalls = async (appsToUninstall, { ui, commands: { unin
|
|
|
88
88
|
const deferredErrors = [];
|
|
89
89
|
uninstalledApps.forEach((uninstall) => {
|
|
90
90
|
const uninstallMessageFormat = uninstall.successful ? cli_shared_1.Text.uninstall.done : cli_shared_1.Text.uninstall.failed;
|
|
91
|
-
const formattedMessage = uninstallMessageFormat((0, cli_shared_1.capitalizeProduct)(uninstall.product), uninstall.site, uninstall.environmentKey,
|
|
91
|
+
const formattedMessage = uninstallMessageFormat((0, cli_shared_1.capitalizeProduct)(uninstall.product), uninstall.site, uninstall.environmentKey, hasMultipleNonIdentityApps);
|
|
92
92
|
if (uninstall.successful && uninstall.product !== 'identity') {
|
|
93
93
|
ui.info(formattedMessage);
|
|
94
94
|
}
|
|
@@ -5,7 +5,7 @@ const cli_shared_1 = require("@forge/cli-shared");
|
|
|
5
5
|
const registerCommands = ({ cmd, controllers: { lintController } }) => {
|
|
6
6
|
cmd
|
|
7
7
|
.command('lint')
|
|
8
|
-
.
|
|
8
|
+
.requireAppId()
|
|
9
9
|
.description(cli_shared_1.Text.lint.cmd)
|
|
10
10
|
.option('--fix', 'Attempt to automatically fix any issues encountered', false)
|
|
11
11
|
.environmentOption()
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"register-providers-commands.d.ts","sourceRoot":"","sources":["../../src/command-line/register-providers-commands.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;
|
|
1
|
+
{"version":3,"file":"register-providers-commands.d.ts","sourceRoot":"","sources":["../../src/command-line/register-providers-commands.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AA8DtD,eAAO,MAAM,gBAAgB,SAAU,YAAY,KAAG,IAErD,CAAC"}
|
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.registerCommands = void 0;
|
|
4
4
|
const cli_shared_1 = require("@forge/cli-shared");
|
|
5
|
-
const cli_shared_2 = require("@forge/cli-shared");
|
|
6
5
|
const registerConfigureProviderCommand = ({ cmd, ui, commands: { configureProviderCommand }, configFile }) => {
|
|
7
6
|
cmd
|
|
8
7
|
.command('providers')
|
|
@@ -13,7 +12,7 @@ const registerConfigureProviderCommand = ({ cmd, ui, commands: { configureProvid
|
|
|
13
12
|
.option('-s, --oauth-client-secret [oauthClientSecret]', cli_shared_1.Text.configureProvider.optionClientSecret)
|
|
14
13
|
.environmentOption()
|
|
15
14
|
.action(async (providerKey, { environment, oauthClientSecret }) => {
|
|
16
|
-
ui.info(cli_shared_1.Text.configureProvider.overview(environment
|
|
15
|
+
ui.info(cli_shared_1.Text.configureProvider.overview(environment));
|
|
17
16
|
ui.info(cli_shared_1.Text.ctrlC);
|
|
18
17
|
ui.emptyLine();
|
|
19
18
|
const availableProviders = await configFile.getAuthProviders();
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/command-line/utils.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,OAAO,UAAW,MAAM,WAQpC,CAAC;AAEF,eAAO,MAAM,UAAU,SAAU,MAAM,uBAatC,CAAC;AAEF,eAAO,MAAM,iBAAiB,UAAW,MAAM,uBAI9C,CAAC"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getAcceptableSlug = exports.filterSlug = exports.slugify = void 0;
|
|
4
|
+
const slugify = (value) => {
|
|
5
|
+
return value
|
|
6
|
+
.normalize('NFD')
|
|
7
|
+
.replace(/[\u0300-\u036f]/g, '')
|
|
8
|
+
.toLowerCase()
|
|
9
|
+
.trim()
|
|
10
|
+
.replace(/[^a-z0-9 ]/g, '')
|
|
11
|
+
.replace(/\s+/g, '-');
|
|
12
|
+
};
|
|
13
|
+
exports.slugify = slugify;
|
|
14
|
+
const filterSlug = (slug) => {
|
|
15
|
+
if (slug === '') {
|
|
16
|
+
return undefined;
|
|
17
|
+
}
|
|
18
|
+
const characters = Array.from(slug);
|
|
19
|
+
const dashesOnly = characters.every((char) => char === '-');
|
|
20
|
+
if (dashesOnly) {
|
|
21
|
+
return undefined;
|
|
22
|
+
}
|
|
23
|
+
return slug;
|
|
24
|
+
};
|
|
25
|
+
exports.filterSlug = filterSlug;
|
|
26
|
+
const getAcceptableSlug = (value) => {
|
|
27
|
+
const slug = (0, exports.slugify)(value);
|
|
28
|
+
return (0, exports.filterSlug)(slug);
|
|
29
|
+
};
|
|
30
|
+
exports.getAcceptableSlug = getAcceptableSlug;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { AppEnvironmentDetails, UI } from '@forge/cli-shared';
|
|
1
|
+
import { AppEnvironmentDetails, AppEnvironmentType, 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 {
|
|
5
5
|
private readonly ui;
|
|
6
6
|
constructor(ui: UI);
|
|
7
7
|
getLogger(): UI;
|
|
8
|
-
displayStart(environment: string): void;
|
|
8
|
+
displayStart(environment: string, environmentType: AppEnvironmentType): void;
|
|
9
9
|
displayListAppInstallationsError(): void;
|
|
10
10
|
displayLintRunning(): void;
|
|
11
11
|
displayOutdatedInstallationsMessage(): void;
|
|
@@ -16,8 +16,11 @@ export declare class DeployView {
|
|
|
16
16
|
displayConnectKeyChangeWarning(environment: string, migrationKey: string, connectKey: string): void;
|
|
17
17
|
displayConnectKeyDeleteWarning(environment: string): void;
|
|
18
18
|
displayMPACAppConnectKeyChangeError(mpacAppKey: string, connectKey: string): void;
|
|
19
|
+
displayEnvironmentCreationWarning(environment: string): void;
|
|
20
|
+
displayEnvironmentCreationSuccessMessage(environment: string): void;
|
|
19
21
|
promptToContinueDeletingConnectKey(): Promise<boolean>;
|
|
20
22
|
promptToContinueChangingConnectKey(): Promise<boolean>;
|
|
23
|
+
promptToCreateEnvironment(): Promise<boolean>;
|
|
21
24
|
reportDeploymentProgress({ appAri, name, environmentKey, environmentType }: AppEnvironmentDetails, showDistributionPageLink: boolean, deployCallback: () => Promise<DeploymentResult>): Promise<DeploymentResult>;
|
|
22
25
|
}
|
|
23
26
|
//# 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,qBAAqB,
|
|
1
|
+
{"version":3,"file":"deploy-view.d.ts","sourceRoot":"","sources":["../../../src/command-line/view/deploy-view.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,kBAAkB,EAAkB,EAAE,EAAE,MAAM,mBAAmB,CAAC;AAClG,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,EAAE,eAAe,EAAE,kBAAkB,GAAG,IAAI;IAI5E,gCAAgC,IAAI,IAAI;IAIxC,kBAAkB,IAAI,IAAI;IAI1B,mCAAmC,IAAI,IAAI;IAK3C,sBAAsB,CAAC,WAAW,EAAE,MAAM,GAAG,IAAI;IAKjD,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;IAIjF,iCAAiC,CAAC,WAAW,EAAE,MAAM,GAAG,IAAI;IAM5D,wCAAwC,CAAC,WAAW,EAAE,MAAM,GAAG,IAAI;IAK7D,kCAAkC,IAAI,OAAO,CAAC,OAAO,CAAC;IAItD,kCAAkC,IAAI,OAAO,CAAC,OAAO,CAAC;IAItD,yBAAyB,IAAI,OAAO,CAAC,OAAO,CAAC;IAQ7C,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"}
|