@forge/cli 11.3.1-next.6 → 11.3.1-next.8-experimental-98585b7
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 +43 -0
- package/npm-shrinkwrap.json +35 -35
- package/out/command-line/controller/install-controller.d.ts +5 -2
- package/out/command-line/controller/install-controller.d.ts.map +1 -1
- package/out/command-line/controller/install-controller.js +39 -1
- package/out/command-line/dependency-injection.d.ts.map +1 -1
- package/out/command-line/dependency-injection.js +2 -2
- package/out/deploy/packager/runtime-bundler.js +1 -1
- package/out/installations/graphql-client.d.ts +7 -3
- package/out/installations/graphql-client.d.ts.map +1 -1
- package/out/installations/graphql-client.js +60 -0
- package/out/service/installation-service.d.ts +7 -2
- package/out/service/installation-service.d.ts.map +1 -1
- package/out/service/installation-service.js +6 -1
- package/package.json +6 -6
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,48 @@
|
|
|
1
1
|
# @forge/cli
|
|
2
2
|
|
|
3
|
+
## 11.3.1-next.8-experimental-98585b7
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 3e82523: Added CLI warnings
|
|
8
|
+
|
|
9
|
+
### Patch Changes
|
|
10
|
+
|
|
11
|
+
- fb10a5a: Fix runtime bundler added duplicated i18n file
|
|
12
|
+
- 0881ee9: Update module artifacts and types
|
|
13
|
+
- Updated dependencies [ff60490]
|
|
14
|
+
- Updated dependencies [680704b]
|
|
15
|
+
- Updated dependencies [14a1075]
|
|
16
|
+
- Updated dependencies [042ef75]
|
|
17
|
+
- Updated dependencies [57700e7]
|
|
18
|
+
- Updated dependencies [0881ee9]
|
|
19
|
+
- Updated dependencies [683d423]
|
|
20
|
+
- Updated dependencies [ea7c7b6]
|
|
21
|
+
- Updated dependencies [2051059]
|
|
22
|
+
- Updated dependencies [3e82523]
|
|
23
|
+
- @forge/manifest@9.1.0-next.5-experimental-98585b7
|
|
24
|
+
- @forge/tunnel@5.10.2-next.7-experimental-98585b7
|
|
25
|
+
- @forge/cli-shared@6.9.0-next.6-experimental-98585b7
|
|
26
|
+
- @forge/bundler@4.22.1-next.7-experimental-98585b7
|
|
27
|
+
- @forge/lint@5.7.4-next.7-experimental-98585b7
|
|
28
|
+
|
|
29
|
+
## 11.3.1-next.8
|
|
30
|
+
|
|
31
|
+
### Patch Changes
|
|
32
|
+
|
|
33
|
+
- Updated dependencies [ea7c7b6]
|
|
34
|
+
- @forge/manifest@9.1.0-next.5
|
|
35
|
+
- @forge/bundler@4.22.1-next.7
|
|
36
|
+
- @forge/cli-shared@6.9.0-next.6
|
|
37
|
+
- @forge/lint@5.7.4-next.7
|
|
38
|
+
- @forge/tunnel@5.10.2-next.7
|
|
39
|
+
|
|
40
|
+
## 11.3.1-next.7
|
|
41
|
+
|
|
42
|
+
### Patch Changes
|
|
43
|
+
|
|
44
|
+
- fb10a5a: Fix runtime bundler added duplicated i18n file
|
|
45
|
+
|
|
3
46
|
## 11.3.1-next.6
|
|
4
47
|
|
|
5
48
|
### Patch Changes
|
package/npm-shrinkwrap.json
CHANGED
|
@@ -1,23 +1,23 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@forge/cli",
|
|
3
|
-
"version": "11.3.1-next.
|
|
3
|
+
"version": "11.3.1-next.8-experimental-98585b7",
|
|
4
4
|
"lockfileVersion": 3,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "@forge/cli",
|
|
9
|
-
"version": "11.3.1-next.
|
|
9
|
+
"version": "11.3.1-next.8-experimental-98585b7",
|
|
10
10
|
"hasInstallScript": true,
|
|
11
11
|
"license": "SEE LICENSE IN LICENSE.txt",
|
|
12
12
|
"dependencies": {
|
|
13
|
-
"@forge/bundler": "4.22.1-next.
|
|
14
|
-
"@forge/cli-shared": "6.9.0-next.
|
|
13
|
+
"@forge/bundler": "4.22.1-next.7-experimental-98585b7",
|
|
14
|
+
"@forge/cli-shared": "6.9.0-next.6-experimental-98585b7",
|
|
15
15
|
"@forge/egress": "1.4.0",
|
|
16
16
|
"@forge/i18n": "0.0.5",
|
|
17
|
-
"@forge/lint": "5.7.4-next.
|
|
18
|
-
"@forge/manifest": "9.1.0-next.
|
|
17
|
+
"@forge/lint": "5.7.4-next.7-experimental-98585b7",
|
|
18
|
+
"@forge/manifest": "9.1.0-next.5-experimental-98585b7",
|
|
19
19
|
"@forge/runtime": "5.10.7",
|
|
20
|
-
"@forge/tunnel": "5.10.2-next.
|
|
20
|
+
"@forge/tunnel": "5.10.2-next.7-experimental-98585b7",
|
|
21
21
|
"@forge/util": "1.4.8",
|
|
22
22
|
"@sentry/node": "7.106.0",
|
|
23
23
|
"ajv": "^8.12.0",
|
|
@@ -834,9 +834,9 @@
|
|
|
834
834
|
"license": "SEE LICENSE IN LICENSE.txt"
|
|
835
835
|
},
|
|
836
836
|
"node_modules/@forge/bundler": {
|
|
837
|
-
"version": "4.22.1-next.
|
|
838
|
-
"resolved": "https://registry.npmjs.org/@forge/bundler/-/bundler-4.22.1-next.
|
|
839
|
-
"integrity": "sha512-
|
|
837
|
+
"version": "4.22.1-next.7-experimental-98585b7",
|
|
838
|
+
"resolved": "https://registry.npmjs.org/@forge/bundler/-/bundler-4.22.1-next.7-experimental-98585b7.tgz",
|
|
839
|
+
"integrity": "sha512-aRFmGbX9gGJWLjaHZv1/pBtYEYRuqB6GsiHo/r+dlstdG+GXU32yKJolJOjqCQKujIfWBSf2Xqnp3TFzynv4Rg==",
|
|
840
840
|
"license": "SEE LICENSE IN LICENSE.txt",
|
|
841
841
|
"dependencies": {
|
|
842
842
|
"@babel/core": "^7.24.0",
|
|
@@ -848,10 +848,10 @@
|
|
|
848
848
|
"@babel/preset-typescript": "^7.23.3",
|
|
849
849
|
"@forge/api": "5.2.0",
|
|
850
850
|
"@forge/babel-plugin-transform-ui": "1.1.21",
|
|
851
|
-
"@forge/cli-shared": "6.9.0-next.
|
|
851
|
+
"@forge/cli-shared": "6.9.0-next.6-experimental-98585b7",
|
|
852
852
|
"@forge/i18n": "0.0.5",
|
|
853
|
-
"@forge/lint": "5.7.4-next.
|
|
854
|
-
"@forge/manifest": "9.1.0-next.
|
|
853
|
+
"@forge/lint": "5.7.4-next.7-experimental-98585b7",
|
|
854
|
+
"@forge/manifest": "9.1.0-next.5-experimental-98585b7",
|
|
855
855
|
"@forge/util": "1.4.8",
|
|
856
856
|
"assert": "^2.1.0",
|
|
857
857
|
"babel-loader": "^8.3.0",
|
|
@@ -922,13 +922,13 @@
|
|
|
922
922
|
"license": "SEE LICENSE IN LICENSE.txt"
|
|
923
923
|
},
|
|
924
924
|
"node_modules/@forge/cli-shared": {
|
|
925
|
-
"version": "6.9.0-next.
|
|
926
|
-
"resolved": "https://registry.npmjs.org/@forge/cli-shared/-/cli-shared-6.9.0-next.
|
|
927
|
-
"integrity": "sha512
|
|
925
|
+
"version": "6.9.0-next.6-experimental-98585b7",
|
|
926
|
+
"resolved": "https://registry.npmjs.org/@forge/cli-shared/-/cli-shared-6.9.0-next.6-experimental-98585b7.tgz",
|
|
927
|
+
"integrity": "sha512-kbniBX0GplUQfabYN4I8S6frJ392xzwp6Q5FDeBchGHzihnY36pg2wPeTNIOyTF2xWQoaOtjdb2ASka2nPillA==",
|
|
928
928
|
"license": "SEE LICENSE IN LICENSE.txt",
|
|
929
929
|
"dependencies": {
|
|
930
930
|
"@forge/i18n": "0.0.5",
|
|
931
|
-
"@forge/manifest": "9.1.0-next.
|
|
931
|
+
"@forge/manifest": "9.1.0-next.5-experimental-98585b7",
|
|
932
932
|
"@forge/util": "1.4.8",
|
|
933
933
|
"@sentry/node": "7.106.0",
|
|
934
934
|
"adm-zip": "^0.5.10",
|
|
@@ -961,9 +961,9 @@
|
|
|
961
961
|
}
|
|
962
962
|
},
|
|
963
963
|
"node_modules/@forge/csp": {
|
|
964
|
-
"version": "3.7.1-next.0",
|
|
965
|
-
"resolved": "https://registry.npmjs.org/@forge/csp/-/csp-3.7.1-next.0.tgz",
|
|
966
|
-
"integrity": "sha512-
|
|
964
|
+
"version": "3.7.1-next.0-experimental-98585b7",
|
|
965
|
+
"resolved": "https://registry.npmjs.org/@forge/csp/-/csp-3.7.1-next.0-experimental-98585b7.tgz",
|
|
966
|
+
"integrity": "sha512-h6O8+h+g2mpnRCJll/WiqDC/KC76wW+bwecnRlPPwtQJeYAGzZ7mT+nL9tmaMBr1mdjIVxmygjOuHhPsuZybpQ==",
|
|
967
967
|
"license": "SEE LICENSE IN LICENSE.txt",
|
|
968
968
|
"dependencies": {
|
|
969
969
|
"cheerio": "^0.22.0",
|
|
@@ -989,15 +989,15 @@
|
|
|
989
989
|
}
|
|
990
990
|
},
|
|
991
991
|
"node_modules/@forge/lint": {
|
|
992
|
-
"version": "5.7.4-next.
|
|
993
|
-
"resolved": "https://registry.npmjs.org/@forge/lint/-/lint-5.7.4-next.
|
|
994
|
-
"integrity": "sha512-
|
|
992
|
+
"version": "5.7.4-next.7-experimental-98585b7",
|
|
993
|
+
"resolved": "https://registry.npmjs.org/@forge/lint/-/lint-5.7.4-next.7-experimental-98585b7.tgz",
|
|
994
|
+
"integrity": "sha512-ai341L0ycnMna/a1QtOk23cx2HSjMmVsr1MZYg70rvU41F1WNI74lpacqQuK3WCdTihjfGuB8DV5V9U2l4cJtA==",
|
|
995
995
|
"license": "SEE LICENSE IN LICENSE.txt",
|
|
996
996
|
"dependencies": {
|
|
997
|
-
"@forge/cli-shared": "6.9.0-next.
|
|
998
|
-
"@forge/csp": "3.7.1-next.0",
|
|
997
|
+
"@forge/cli-shared": "6.9.0-next.6-experimental-98585b7",
|
|
998
|
+
"@forge/csp": "3.7.1-next.0-experimental-98585b7",
|
|
999
999
|
"@forge/egress": "1.4.0",
|
|
1000
|
-
"@forge/manifest": "9.1.0-next.
|
|
1000
|
+
"@forge/manifest": "9.1.0-next.5-experimental-98585b7",
|
|
1001
1001
|
"@typescript-eslint/typescript-estree": "^5.62.0",
|
|
1002
1002
|
"array.prototype.flatmap": "^1.3.2",
|
|
1003
1003
|
"atlassian-openapi": "^1.0.18",
|
|
@@ -1006,9 +1006,9 @@
|
|
|
1006
1006
|
}
|
|
1007
1007
|
},
|
|
1008
1008
|
"node_modules/@forge/manifest": {
|
|
1009
|
-
"version": "9.1.0-next.
|
|
1010
|
-
"resolved": "https://registry.npmjs.org/@forge/manifest/-/manifest-9.1.0-next.
|
|
1011
|
-
"integrity": "sha512-
|
|
1009
|
+
"version": "9.1.0-next.5-experimental-98585b7",
|
|
1010
|
+
"resolved": "https://registry.npmjs.org/@forge/manifest/-/manifest-9.1.0-next.5-experimental-98585b7.tgz",
|
|
1011
|
+
"integrity": "sha512-Rd1O+5G2GffvVV1nn1UqMNE28t/1wFdsH8/mV082wkiWb9kQTwamnLsFyxBnyYU0PNmlzSxArIzU8pDbFZQ5ug==",
|
|
1012
1012
|
"license": "SEE LICENSE IN LICENSE.txt",
|
|
1013
1013
|
"dependencies": {
|
|
1014
1014
|
"@forge/i18n": "0.0.5",
|
|
@@ -1039,14 +1039,14 @@
|
|
|
1039
1039
|
}
|
|
1040
1040
|
},
|
|
1041
1041
|
"node_modules/@forge/tunnel": {
|
|
1042
|
-
"version": "5.10.2-next.
|
|
1043
|
-
"resolved": "https://registry.npmjs.org/@forge/tunnel/-/tunnel-5.10.2-next.
|
|
1044
|
-
"integrity": "sha512-
|
|
1042
|
+
"version": "5.10.2-next.7-experimental-98585b7",
|
|
1043
|
+
"resolved": "https://registry.npmjs.org/@forge/tunnel/-/tunnel-5.10.2-next.7-experimental-98585b7.tgz",
|
|
1044
|
+
"integrity": "sha512-uFPaeR2GdWUvxYq+EJjONabhR7+mjTLIdo4R9ClWWlAR2u+sT0e5wKEbo5dNR9es4PbwhmArZlUQOlpo4d5Fzw==",
|
|
1045
1045
|
"license": "SEE LICENSE IN LICENSE.txt",
|
|
1046
1046
|
"dependencies": {
|
|
1047
|
-
"@forge/bundler": "4.22.1-next.
|
|
1048
|
-
"@forge/cli-shared": "6.9.0-next.
|
|
1049
|
-
"@forge/csp": "3.7.1-next.0",
|
|
1047
|
+
"@forge/bundler": "4.22.1-next.7-experimental-98585b7",
|
|
1048
|
+
"@forge/cli-shared": "6.9.0-next.6-experimental-98585b7",
|
|
1049
|
+
"@forge/csp": "3.7.1-next.0-experimental-98585b7",
|
|
1050
1050
|
"@forge/runtime": "5.10.7",
|
|
1051
1051
|
"chokidar": "^3.6.0",
|
|
1052
1052
|
"cloudflared": "^0.7.0",
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
|
-
import { AppConfigProvider, ConfigFile, UI, SupportedProduct, SupportedProductsService } from '@forge/cli-shared';
|
|
2
|
+
import { AppConfigProvider, AppEnvironmentType, ConfigFile, UI, SupportedProduct, SupportedProductsService, StatsigService } from '@forge/cli-shared';
|
|
3
3
|
import { URL } from 'url';
|
|
4
4
|
import { InstallAppSiteCommand } from '../../installations/install-app-site';
|
|
5
5
|
import { InstallationService } from '../../service/installation-service';
|
|
@@ -26,7 +26,8 @@ export declare class InstallController {
|
|
|
26
26
|
private readonly installationService;
|
|
27
27
|
private readonly installView;
|
|
28
28
|
private readonly supportedProductsService;
|
|
29
|
-
|
|
29
|
+
protected readonly statsigService: StatsigService;
|
|
30
|
+
constructor(appConfigProvider: AppConfigProvider, configFile: ConfigFile, ui: UI, installAppSiteCommand: InstallAppSiteCommand, installationService: InstallationService, installView: InstallView, supportedProductsService: SupportedProductsService, statsigService: StatsigService);
|
|
30
31
|
private securityPrompt;
|
|
31
32
|
private installOrUpgrade;
|
|
32
33
|
private promptForProducts;
|
|
@@ -38,6 +39,8 @@ export declare class InstallController {
|
|
|
38
39
|
private validateLicenseOption;
|
|
39
40
|
private checkForUIKit1Modules;
|
|
40
41
|
run({ environment, site, products, upgrade, confirmScopes, license, licenseModes, usersWithAccess, nonInteractive }: InstallViewProps): Promise<void>;
|
|
42
|
+
private getEntitlementOfferingName;
|
|
43
|
+
shouldPreventDevAppInstall(site: URL, product: SupportedProduct, environmentType: AppEnvironmentType): Promise<boolean>;
|
|
41
44
|
private extractManifestData;
|
|
42
45
|
private getXPAProductsAndSite;
|
|
43
46
|
private checkForMultiProductScopes;
|
|
@@ -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,
|
|
1
|
+
{"version":3,"file":"install-controller.d.ts","sourceRoot":"","sources":["../../../src/command-line/controller/install-controller.ts"],"names":[],"mappings":";AAAA,OAAO,EAEL,iBAAiB,EACjB,kBAAkB,EAClB,UAAU,EAEV,EAAE,EAUF,gBAAgB,EAChB,wBAAwB,EAIxB,cAAc,EAGf,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAC1B,OAAO,EAAE,qBAAqB,EAAE,MAAM,sCAAsC,CAAC;AAC7E,OAAO,EAAgB,mBAAmB,EAAE,MAAM,oCAAoC,CAAC;AACvF,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAEnD,UAAU,gBAAgB;IACxB,WAAW,EAAE,MAAM,CAAC;IACpB,IAAI,CAAC,EAAE,GAAG,CAAC;IACX,QAAQ,CAAC,EAAE,gBAAgB,EAAE,CAAC;IAC9B,OAAO,EAAE,OAAO,CAAC;IACjB,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,aAAa,EAAE,OAAO,CAAC;IACvB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;IACxB,eAAe,CAAC,EAAE,MAAM,EAAE,CAAC;CAC5B;AAYD,qBAAa,iBAAkB,SAAQ,KAAK;gBAC9B,WAAW,EAAE,MAAM;CAGhC;AAUD,qBAAa,iBAAiB;IAE1B,OAAO,CAAC,QAAQ,CAAC,iBAAiB;IAClC,OAAO,CAAC,QAAQ,CAAC,UAAU;IAC3B,OAAO,CAAC,QAAQ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
|
17
17
|
installationService;
|
|
18
18
|
installView;
|
|
19
19
|
supportedProductsService;
|
|
20
|
-
|
|
20
|
+
statsigService;
|
|
21
|
+
constructor(appConfigProvider, configFile, ui, installAppSiteCommand, installationService, installView, supportedProductsService, statsigService) {
|
|
21
22
|
this.appConfigProvider = appConfigProvider;
|
|
22
23
|
this.configFile = configFile;
|
|
23
24
|
this.ui = ui;
|
|
@@ -25,6 +26,7 @@ class InstallController {
|
|
|
25
26
|
this.installationService = installationService;
|
|
26
27
|
this.installView = installView;
|
|
27
28
|
this.supportedProductsService = supportedProductsService;
|
|
29
|
+
this.statsigService = statsigService;
|
|
28
30
|
}
|
|
29
31
|
async securityPrompt(site) {
|
|
30
32
|
this.ui.info(cli_shared_1.Text.install.security.banner(site.host));
|
|
@@ -217,8 +219,18 @@ class InstallController {
|
|
|
217
219
|
return;
|
|
218
220
|
const successfulProducts = [];
|
|
219
221
|
const failedProducts = [];
|
|
222
|
+
const isInstallationsWarningsEnabled = await this.statsigService.enableInstallationWarnings();
|
|
220
223
|
for (const product of products) {
|
|
221
224
|
try {
|
|
225
|
+
if (isInstallationsWarningsEnabled) {
|
|
226
|
+
if (await this.shouldPreventDevAppInstall(site, product, environmentType)) {
|
|
227
|
+
this.ui.warn(cli_shared_1.Text.install.devAppInstallWarning);
|
|
228
|
+
if (!nonInteractive) {
|
|
229
|
+
if (!(await this.ui.confirm(cli_shared_1.Text.install.devAppInstallConfirm)))
|
|
230
|
+
return;
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
}
|
|
222
234
|
const isAlreadyUpdated = await this.installOrUpgrade(upgrade, environment, environmentType, site, product, id, text, validLicense, overrides);
|
|
223
235
|
if (isAlreadyUpdated) {
|
|
224
236
|
this.ui.info(cli_shared_1.Text.upgrade.alreadyUpdated.banner(environment, (0, cli_shared_1.productDisplayName)(product), site.host));
|
|
@@ -246,6 +258,32 @@ class InstallController {
|
|
|
246
258
|
throw new cli_shared_1.PartialInstallationError(cli_shared_1.Text.error.partialInstallation(failedProducts));
|
|
247
259
|
}
|
|
248
260
|
}
|
|
261
|
+
getEntitlementOfferingName(entitlementOffering) {
|
|
262
|
+
if (!entitlementOffering)
|
|
263
|
+
return false;
|
|
264
|
+
if ('currentEdition' in entitlementOffering) {
|
|
265
|
+
return entitlementOffering.currentEdition?.toLowerCase();
|
|
266
|
+
}
|
|
267
|
+
else if ('offering' in entitlementOffering) {
|
|
268
|
+
return entitlementOffering.offering?.name?.toLowerCase();
|
|
269
|
+
}
|
|
270
|
+
return undefined;
|
|
271
|
+
}
|
|
272
|
+
async shouldPreventDevAppInstall(site, product, environmentType) {
|
|
273
|
+
try {
|
|
274
|
+
const entitlementOffering = await this.installationService.getEntitlementOfferingProduct(site, product);
|
|
275
|
+
const entitlementOfferingName = this.getEntitlementOfferingName(entitlementOffering);
|
|
276
|
+
if (!entitlementOfferingName)
|
|
277
|
+
return false;
|
|
278
|
+
const isProduction = environmentType === cli_shared_1.AppEnvironmentType.Production;
|
|
279
|
+
const isEntitlementOfferingString = typeof entitlementOffering === 'string';
|
|
280
|
+
const isFreeOrDeveloperOffering = entitlementOfferingName?.includes('free') || entitlementOfferingName?.includes('developer');
|
|
281
|
+
return !isProduction && !isEntitlementOfferingString && !isFreeOrDeveloperOffering;
|
|
282
|
+
}
|
|
283
|
+
catch (error) {
|
|
284
|
+
return false;
|
|
285
|
+
}
|
|
286
|
+
}
|
|
249
287
|
extractManifestData = (manifestEgressEntries, permissions) => {
|
|
250
288
|
const manifestEgressAddresses = (0, cli_shared_1.flatMap)(manifestEgressEntries, ({ domains }) => domains ?? []);
|
|
251
289
|
const manifestScopes = new Set(permissions?.scopes ?? []);
|
|
@@ -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,EAKhB,gBAAgB,EAQhB,YAAY,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OAAO,EAAE,4BAA4B,EAAE,MAAM,6CAA6C,CAAC;AAG3F,OAAO,EAAE,qBAAqB,EAAE,MAAM,qCAAqC,CAAC;AAE5E,OAAO,EAAE,iBAAiB,EAAE,MAAM,iCAAiC,CAAC;AAIpE,OAAO,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAEjD,eAAO,MAAM,eAAe,eAAsB,UAAU,GAAG,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAmZvE,CAAC;AAGF,aAAK,WAAW,CAAC,CAAC,IAAI,CAAC,SAAS,OAAO,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;AAC7D,oBAAY,YAAY,GAAG,WAAW,CAAC,UAAU,CAAC,OAAO,eAAe,CAAC,CAAC,CAAC"}
|
|
@@ -164,9 +164,9 @@ const getDependencies = async (cliDetails) => {
|
|
|
164
164
|
const nodeAppPackager = new deploy_1.AppPackager(nodeRuntimeBundler, nativeUiBundler, ui);
|
|
165
165
|
const getWebTriggerURLCommand = new get_webtrigger_url_1.GetWebTriggerURLCommand(assertiveAppConfigReader, installationsClient, appEnvironmentClient, webTriggerGraphqlClient);
|
|
166
166
|
const autocompleteController = new autocomplete_controller_1.AutocompleteController(ui);
|
|
167
|
-
const installationsService = new installation_service_1.InstallationService(assertiveAppConfigReader, installationsClient, installationsClient, installationsClient);
|
|
167
|
+
const installationsService = new installation_service_1.InstallationService(assertiveAppConfigReader, installationsClient, installationsClient, installationsClient, installationsClient);
|
|
168
168
|
const installView = new install_view_1.InstallView(ui);
|
|
169
|
-
const installController = new install_controller_1.InstallController(assertiveAppConfigReader, configFile, ui, installAppSiteCommand, installationsService, installView, supportedProductsService);
|
|
169
|
+
const installController = new install_controller_1.InstallController(assertiveAppConfigReader, configFile, ui, installAppSiteCommand, installationsService, installView, supportedProductsService, statsigService);
|
|
170
170
|
const feedbackController = new feedback_controller_1.FeedbackController(credentialStore, feedbackPostClient);
|
|
171
171
|
const eligibilityController = new eligibility_controller_1.EligibilityController(new roa_service_1.RoaService(assertiveAppConfigReader, new graphql_client_8.RoaEligibilityClient(graphQLClient)), new eligibility_view_1.EligibilityView(ui));
|
|
172
172
|
const versionController = new version_controller_1.VersionController(new version_service_1.VersionService(assertiveAppConfigReader, new graphql_client_9.AppVersionDetailsClient(graphQLClient)), new version_view_1.VersionView(ui));
|
|
@@ -66,7 +66,7 @@ class RuntimeBundler {
|
|
|
66
66
|
async bundle(handlers, i18nResourceBundle, packageConfig) {
|
|
67
67
|
const archiver = this.archiverFactory();
|
|
68
68
|
const moduleList = await this.packageAll(archiver, handlers, packageConfig, i18nResourceBundle);
|
|
69
|
-
if (
|
|
69
|
+
if (handlers.length === 0) {
|
|
70
70
|
this.packageI18nResources(archiver, i18nResourceBundle);
|
|
71
71
|
}
|
|
72
72
|
const archivePath = await archiver.finalise();
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
import { URL } from 'url';
|
|
3
|
+
import { AppEnvironmentType, AppUninstallationInput, GraphQLClient, GraphQlMutationError, Maybe, Pause, BaseError, UserError, SupportedProduct, HamsEntitlement, CcpEntitlement } from '@forge/cli-shared';
|
|
2
4
|
import { AppInstallSiteDetails, InstallAppClient } from './install-app-site';
|
|
3
|
-
import { AppEnvironmentVersionData, HasNoAppInstallationsForEnvClient, Installation, ListAppInstallationsClient, UpgradeAppInstallationsClient } from '../service/installation-service';
|
|
5
|
+
import { AppEnvironmentVersionData, HasNoAppInstallationsForEnvClient, Installation, ListAppInstallationsClient, UpgradeAppInstallationsClient, GetEntitlementOffering } from '../service/installation-service';
|
|
4
6
|
import { UninstallAppClient, UninstallAppOutput } from './uninstall-app';
|
|
5
7
|
import { SiteTranslator } from './site-translation';
|
|
6
8
|
export declare const UNINSTALLATION_EVENT_POLL_INTERVAL = 500;
|
|
@@ -44,7 +46,7 @@ export declare class MissingAppUninstallTask extends Error {
|
|
|
44
46
|
}
|
|
45
47
|
export declare class InstallationNotFoundError extends UserError {
|
|
46
48
|
}
|
|
47
|
-
export declare class InstallationsGraphqlClient implements InstallAppClient, ListAppInstallationsClient, UninstallAppClient, UpgradeAppInstallationsClient, HasNoAppInstallationsForEnvClient {
|
|
49
|
+
export declare class InstallationsGraphqlClient implements InstallAppClient, ListAppInstallationsClient, UninstallAppClient, UpgradeAppInstallationsClient, GetEntitlementOffering, HasNoAppInstallationsForEnvClient {
|
|
48
50
|
private readonly graphqlClient;
|
|
49
51
|
private readonly sitedProductTranslator;
|
|
50
52
|
private readonly bitbucketTranslator;
|
|
@@ -56,6 +58,8 @@ export declare class InstallationsGraphqlClient implements InstallAppClient, Lis
|
|
|
56
58
|
private buildInstallationContext;
|
|
57
59
|
private getProductTranslation;
|
|
58
60
|
installAppIntoSite({ environmentKey, site, product, appId, licenseOverride, overrides }: AppInstallSiteDetails): Promise<void>;
|
|
61
|
+
getEntitlementOffering(site: URL, product: SupportedProduct): Promise<Maybe<CcpEntitlement | HamsEntitlement | undefined>>;
|
|
62
|
+
private getHamsProductKeys;
|
|
59
63
|
upgradeInstallation({ site, product, environmentKey, appId }: AppInstallSiteDetails): Promise<void>;
|
|
60
64
|
private monitorAppInstallOrUpgrade;
|
|
61
65
|
private handleFailedInstallOrUpgrade;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"graphql-client.d.ts","sourceRoot":"","sources":["../../src/installations/graphql-client.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"graphql-client.d.ts","sourceRoot":"","sources":["../../src/installations/graphql-client.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAK1B,OAAO,EACL,kBAAkB,EAIlB,sBAAsB,EAKtB,aAAa,EACb,oBAAoB,EAGpB,KAAK,EAIL,KAAK,EAGL,SAAS,EACT,SAAS,EAET,gBAAgB,EAChB,eAAe,EACf,cAAc,EACf,MAAM,mBAAmB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C,CAAC;IAiD/D,OAAO,CAAC,kBAAkB;IAoBb,mBAAmB,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,cAAc,EAAE,KAAK,EAAE,EAAE,qBAAqB;YAiDlF,0BAA0B;IAexC,OAAO,CAAC,4BAA4B;IAmBvB,YAAY,CAAC,KAAK,EAAE,sBAAsB,GAAG,OAAO,CAAC,OAAO,CAAC;IAqC7D,qBAAqB,CAAC,IAAI,EAAE,sBAAsB,EAAE,GAAG,OAAO,CAAC,OAAO,CAAC,kBAAkB,CAAC,EAAE,CAAC;IAmB7F,iBAAiB,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,YAAY,EAAE,CAAC;IAKzD,eAAe,CAAC,KAAK,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,GAAG,OAAO,CAAC,YAAY,CAAC;IAS7E,2BAA2B,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,kBAAkB,GAAG,OAAO,CAAC,OAAO,CAAC;YAkCvF,sBAAsB;YAqCtB,2BAA2B;YAY3B,mBAAmB;IAiBjC,OAAO,CAAC,yBAAyB;YAInB,sBAAsB;YAuBtB,6BAA6B;YA0C7B,mBAAmB;IA6EpB,WAAW,CAAC,KAAK,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,EAAE,MAAM,SAAI,GAAG,OAAO,CAAC,yBAAyB,CAAC;CA0ChH"}
|
|
@@ -149,6 +149,66 @@ class InstallationsGraphqlClient {
|
|
|
149
149
|
}
|
|
150
150
|
await this.monitorAppInstallOrUpgrade(taskId);
|
|
151
151
|
}
|
|
152
|
+
async getEntitlementOffering(site, product) {
|
|
153
|
+
try {
|
|
154
|
+
const productKeys = this.getHamsProductKeys(product);
|
|
155
|
+
const results = await Promise.allSettled(productKeys.map((productKey) => this.graphqlClient.query(`query getEntitlementOffering($hostNames: [String!], $product: String!) {
|
|
156
|
+
tenantContexts(hostNames: $hostNames) {
|
|
157
|
+
cloudUrl
|
|
158
|
+
entitlementInfo(hamsProductKey: $product) {
|
|
159
|
+
entitlement {
|
|
160
|
+
... on HamsEntitlement {
|
|
161
|
+
id
|
|
162
|
+
name
|
|
163
|
+
currentEdition
|
|
164
|
+
}
|
|
165
|
+
... on CcpEntitlement {
|
|
166
|
+
id
|
|
167
|
+
offering {
|
|
168
|
+
name
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
}`, {
|
|
175
|
+
hostNames: [site.hostname],
|
|
176
|
+
product: productKey
|
|
177
|
+
})));
|
|
178
|
+
for (const result of results) {
|
|
179
|
+
if (result.status === 'fulfilled') {
|
|
180
|
+
const data = result.value;
|
|
181
|
+
const tenantContexts = data.tenantContexts || [];
|
|
182
|
+
if (tenantContexts[0]?.entitlementInfo) {
|
|
183
|
+
return tenantContexts[0].entitlementInfo.entitlement;
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
return undefined;
|
|
188
|
+
}
|
|
189
|
+
catch (error) {
|
|
190
|
+
return undefined;
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
getHamsProductKeys(product) {
|
|
194
|
+
switch (product) {
|
|
195
|
+
case 'Jira':
|
|
196
|
+
[
|
|
197
|
+
'jira-software.ondemand',
|
|
198
|
+
'jira-core.ondemand',
|
|
199
|
+
'jira-servicedesk.ondemand',
|
|
200
|
+
'jira-product-discovery.ondemand'
|
|
201
|
+
];
|
|
202
|
+
case 'Confluence':
|
|
203
|
+
return ['confluence.ondemand'];
|
|
204
|
+
case 'Compass':
|
|
205
|
+
return ['compass'];
|
|
206
|
+
case 'Atlas':
|
|
207
|
+
return ['townsquare'];
|
|
208
|
+
default:
|
|
209
|
+
throw new Error('Unsupported product');
|
|
210
|
+
}
|
|
211
|
+
}
|
|
152
212
|
async upgradeInstallation({ site, product, environmentKey, appId }) {
|
|
153
213
|
const workspaceAri = await this.buildInstallationContext(product, site);
|
|
154
214
|
const query = `
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
|
-
import { AppConfigProvider, AppEnvironmentType, AppEnvironmentVersion, Maybe, SupportedProduct, BaseError } from '@forge/cli-shared';
|
|
2
|
+
import { AppConfigProvider, AppEnvironmentType, AppEnvironmentVersion, Maybe, SupportedProduct, BaseError, HamsEntitlement, CcpEntitlement } from '@forge/cli-shared';
|
|
3
3
|
import { URL } from 'url';
|
|
4
4
|
import { AppInstallSiteDetails } from '../installations/install-app-site';
|
|
5
5
|
export interface Installation {
|
|
@@ -43,6 +43,9 @@ export interface ListAppInstallationsClient {
|
|
|
43
43
|
listInstallations(appId: string): Promise<Installation[]>;
|
|
44
44
|
getVersions(appId: string, environmentKey: string, firstN: number): Promise<AppEnvironmentVersionData>;
|
|
45
45
|
}
|
|
46
|
+
export interface GetEntitlementOffering {
|
|
47
|
+
getEntitlementOffering(site: URL, product: SupportedProduct): Promise<Maybe<CcpEntitlement> | Maybe<HamsEntitlement> | undefined>;
|
|
48
|
+
}
|
|
46
49
|
export interface UpgradeAppInstallationsClient {
|
|
47
50
|
upgradeInstallation({ site, product, environmentKey, appId }: AppInstallSiteDetails): Promise<void>;
|
|
48
51
|
}
|
|
@@ -57,7 +60,8 @@ export declare class InstallationService {
|
|
|
57
60
|
private readonly listInstallationsClient;
|
|
58
61
|
private readonly upgradeAppInstallationsClient;
|
|
59
62
|
private readonly hasNoAppInstallationsForEnvClient;
|
|
60
|
-
|
|
63
|
+
private readonly getEntitlementOffering;
|
|
64
|
+
constructor(getAppConfig: AppConfigProvider, listInstallationsClient: ListAppInstallationsClient, upgradeAppInstallationsClient: UpgradeAppInstallationsClient, hasNoAppInstallationsForEnvClient: HasNoAppInstallationsForEnvClient, getEntitlementOffering: GetEntitlementOffering);
|
|
61
65
|
private comparePossibleInstallations;
|
|
62
66
|
private matchSiteForProduct;
|
|
63
67
|
private filterInstallations;
|
|
@@ -66,6 +70,7 @@ export declare class InstallationService {
|
|
|
66
70
|
listNonTechnicalAppInstallations(filter?: InstallationFilterOptions): Promise<AppInstallation>;
|
|
67
71
|
findOnlyMatchingInstallation(filter: InstallationFilterOptions): Promise<Installation>;
|
|
68
72
|
hasOutdatedProductInstallation(environment: string): Promise<boolean>;
|
|
73
|
+
getEntitlementOfferingProduct(site: URL, product: SupportedProduct): Promise<Maybe<CcpEntitlement> | Maybe<HamsEntitlement> | undefined>;
|
|
69
74
|
upgradeInstallation(site: URL, product: string, environmentKey: string, appId: string): Promise<boolean>;
|
|
70
75
|
private getPermissionsFromAppEnvironmentVersion;
|
|
71
76
|
getAppEnvironmentPermissions(appId: string, environmentKey: string): Promise<AppEnvironmentPermissions | undefined>;
|
|
@@ -1 +1 @@
|
|
|
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,EAGrB,KAAK,EAGL,gBAAgB,EAEhB,SAAS,
|
|
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,EAGrB,KAAK,EAGL,gBAAgB,EAEhB,SAAS,EACT,eAAe,EACf,cAAc,EACf,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,iBAAiB,CAAC,EAAE,MAAM,EAAE,CAAC;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,cAAc,EAAE,MAAM,CAAC;IACvB,eAAe,EAAE,kBAAkB,CAAC;IACpC,OAAO,EAAE,MAAM,CAAC;IAChB,iBAAiB,CAAC,EAAE,MAAM,E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AAC,eAAe,CAAC,GAAG,SAAS,CAAC;IAIzD,mBAAmB,CAC9B,IAAI,EAAE,GAAG,EACT,OAAO,EAAE,MAAM,EACf,cAAc,EAAE,MAAM,EACtB,KAAK,EAAE,MAAM,GACZ,OAAO,CAAC,OAAO,CAAC;IAkBnB,OAAO,CAAC,uCAAuC;IAiBlC,4BAA4B,CACvC,KAAK,EAAE,MAAM,EACb,cAAc,EAAE,MAAM,GACrB,OAAO,CAAC,yBAAyB,GAAG,SAAS,CAAC;CAmClD"}
|
|
@@ -19,11 +19,13 @@ class InstallationService {
|
|
|
19
19
|
listInstallationsClient;
|
|
20
20
|
upgradeAppInstallationsClient;
|
|
21
21
|
hasNoAppInstallationsForEnvClient;
|
|
22
|
-
|
|
22
|
+
getEntitlementOffering;
|
|
23
|
+
constructor(getAppConfig, listInstallationsClient, upgradeAppInstallationsClient, hasNoAppInstallationsForEnvClient, getEntitlementOffering) {
|
|
23
24
|
this.getAppConfig = getAppConfig;
|
|
24
25
|
this.listInstallationsClient = listInstallationsClient;
|
|
25
26
|
this.upgradeAppInstallationsClient = upgradeAppInstallationsClient;
|
|
26
27
|
this.hasNoAppInstallationsForEnvClient = hasNoAppInstallationsForEnvClient;
|
|
28
|
+
this.getEntitlementOffering = getEntitlementOffering;
|
|
27
29
|
}
|
|
28
30
|
comparePossibleInstallations(url1, url2) {
|
|
29
31
|
const trimmedUrl1 = url1.replace(/\/+$/, '');
|
|
@@ -75,6 +77,9 @@ class InstallationService {
|
|
|
75
77
|
});
|
|
76
78
|
return installations.some((installation) => !installation.version.isLatest);
|
|
77
79
|
}
|
|
80
|
+
async getEntitlementOfferingProduct(site, product) {
|
|
81
|
+
return await this.getEntitlementOffering.getEntitlementOffering(site, product);
|
|
82
|
+
}
|
|
78
83
|
async upgradeInstallation(site, product, environmentKey, appId) {
|
|
79
84
|
try {
|
|
80
85
|
await this.upgradeAppInstallationsClient.upgradeInstallation({
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@forge/cli",
|
|
3
|
-
"version": "11.3.1-next.
|
|
3
|
+
"version": "11.3.1-next.8-experimental-98585b7",
|
|
4
4
|
"description": "A command line interface for managing Atlassian-hosted apps",
|
|
5
5
|
"author": "Atlassian",
|
|
6
6
|
"license": "SEE LICENSE IN LICENSE.txt",
|
|
@@ -18,13 +18,13 @@
|
|
|
18
18
|
"postinstall": "node -e \"fs.existsSync('./out/bin/postinstall.js') && require('./out/bin/postinstall.js')\""
|
|
19
19
|
},
|
|
20
20
|
"dependencies": {
|
|
21
|
-
"@forge/bundler": "4.22.1-next.
|
|
22
|
-
"@forge/cli-shared": "6.9.0-next.
|
|
21
|
+
"@forge/bundler": "4.22.1-next.7-experimental-98585b7",
|
|
22
|
+
"@forge/cli-shared": "6.9.0-next.6-experimental-98585b7",
|
|
23
23
|
"@forge/egress": "1.4.0",
|
|
24
|
-
"@forge/lint": "5.7.4-next.
|
|
25
|
-
"@forge/manifest": "9.1.0-next.
|
|
24
|
+
"@forge/lint": "5.7.4-next.7-experimental-98585b7",
|
|
25
|
+
"@forge/manifest": "9.1.0-next.5-experimental-98585b7",
|
|
26
26
|
"@forge/runtime": "5.10.7",
|
|
27
|
-
"@forge/tunnel": "5.10.2-next.
|
|
27
|
+
"@forge/tunnel": "5.10.2-next.7-experimental-98585b7",
|
|
28
28
|
"@forge/util": "1.4.8",
|
|
29
29
|
"@sentry/node": "7.106.0",
|
|
30
30
|
"@forge/i18n": "0.0.5",
|