@forge/cli
12.9.012.10.0-next.4
out/command-line/controller/install-controller.js~
out/command-line/controller/install-controller.jsModified+12−2
Index: package/out/command-line/controller/install-controller.js
===================================================================
--- package/out/command-line/controller/install-controller.js
+++ package/out/command-line/controller/install-controller.js
@@ -130,8 +130,9 @@
product: this.supportedProductsService.validateSupportedProduct(productName),
environment: environmentKey,
environmentType,
scopes: version.scopes,
+ egressAddresses: version.egressAddresses,
currentVersion: version.version
};
}
getUniqueInstallationProductsFromScopes(scopes) {
@@ -223,15 +224,17 @@
environmentPermissions = await this.installationService.getAppEnvironmentPermissions(id, environment);
requiredProducts = environmentPermissions?.requiredProducts;
}
let scopesFromLastInstallation = new Set();
+ let egressFromLastInstallation = new Set();
let currentVersion;
if (isUpgrade) {
const upgradeResult = await this.getInstallationToUpgrade(site, products?.[0], environment, isCodeUpgrade, environmentPermissions?.version, environmentPermissions?.isLatest);
environment = upgradeResult.environment;
site = upgradeResult.site;
products = [upgradeResult.product];
scopesFromLastInstallation = new Set(upgradeResult.scopes);
+ egressFromLastInstallation = new Set(upgradeResult.egressAddresses);
currentVersion = upgradeResult.currentVersion;
this.ui.info(this.supportedProductsService.isWorkspaceProduct(products[0]) ? text.bannerWorkspace : text.bannerSite);
}
else if (!requiredProducts?.length) {
@@ -251,18 +254,20 @@
if (!environmentPermissions?.hasDeployments) {
this.ui.error(new NoDeploymentError(environment), { pad: false });
return;
}
- const { scopes: environmentScopes, environmentType } = environmentPermissions;
+ const { scopes: environmentScopes, egressAddresses: environmentEgressAddresses, environmentType } = environmentPermissions;
const [{ permissions, modules }, manifestEgressEntries] = await Promise.all([
this.configFile.readConfig(),
this.configFile.getEgressPermissions()
]);
this.checkForUIKit1Modules(modules);
const { manifestEgressAddresses, manifestScopes } = this.extractManifestData(manifestEgressEntries, permissions);
const differenceInScopes = environmentScopes.filter((x) => !scopesFromLastInstallation.has(x));
const listScopes = await this.convertListScope(differenceInScopes);
- const scopesConfirmationResult = await this.installView.promptForPermissionsConfirmation(environmentPermissions, listScopes, [...manifestScopes], manifestEgressAddresses, environment, confirmScopes, !!nonInteractive, text, !!majorVersion, isCodeUpgrade);
+ const differenceInEgress = environmentEgressAddresses.filter((x) => !egressFromLastInstallation.has(x));
+ const listEgress = this.convertListEgress(differenceInEgress);
+ const scopesConfirmationResult = await this.installView.promptForPermissionsConfirmation(environmentPermissions, listScopes, listEgress, [...manifestScopes], manifestEgressAddresses, environment, confirmScopes, !!nonInteractive, text, !!majorVersion, isCodeUpgrade);
if (!scopesConfirmationResult)
return;
const successfulProducts = [];
const failedProducts = [];
@@ -404,8 +409,13 @@
name: scope,
requiresInteractiveConsent: scopesWithInteractiveConsent.has(scope)
}));
}
+ convertListEgress(egressToList) {
+ return egressToList.map((egress) => ({
+ address: egress
+ }));
+ }
isValidLicenseMode(value) {
return Object.values(cli_shared_1.EcosystemLicenseMode).includes(value);
}
validateLicenseModes(licenseModes, usersWithAccess, environment) {