@forge/cli-shared 8.22.1-next.0 → 8.23.0-next.10
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 +88 -0
- package/out/apps/create-an-app.d.ts +3 -1
- package/out/apps/create-an-app.d.ts.map +1 -1
- package/out/apps/create-an-app.js +3 -2
- package/out/apps/register-app.d.ts +3 -1
- package/out/apps/register-app.d.ts.map +1 -1
- package/out/apps/register-app.js +2 -1
- package/out/ari/ari.d.ts +4 -0
- package/out/ari/ari.d.ts.map +1 -1
- package/out/ari/ari.js +13 -1
- package/out/config/config-file.d.ts.map +1 -1
- package/out/config/config-file.js +16 -3
- package/out/graphql/graphql-types.d.ts +3319 -221
- package/out/graphql/graphql-types.d.ts.map +1 -1
- package/out/graphql/graphql-types.js +450 -69
- package/out/graphql/minimal-graphql-runner.d.ts.map +1 -1
- package/out/graphql/minimal-graphql-runner.js +1 -2
- package/out/shared/forge-cli-attribution.d.ts +20 -0
- package/out/shared/forge-cli-attribution.d.ts.map +1 -0
- package/out/shared/forge-cli-attribution.js +139 -0
- package/out/shared/index.d.ts +1 -0
- package/out/shared/index.d.ts.map +1 -1
- package/out/shared/index.js +1 -0
- package/out/ui/text.d.ts +22 -2
- package/out/ui/text.d.ts.map +1 -1
- package/out/ui/text.js +47 -6
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,93 @@
|
|
|
1
1
|
# @forge/cli-shared
|
|
2
2
|
|
|
3
|
+
## 8.23.0-next.10
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 3bbb9da: Extend `ForgeCliAttribution` to emit additional fields on the `atl-attribution` GraphQL header and GASv3 analytics events: `skillName`, `agentHint` (auto-detects rovo-dev, claude-code, cursor, codex, antigravity, opencode, windsurf, gemini, github-copilot), and `isStudio`. All three are sourced from reserved `ATL_FORGE_ATTRIBUTION_*` env vars with input validation. Adds a generic `ATL_FORGE_ATTRIBUTION_<KEY>` wildcard pass-through so additional attribution fields can be supplied via environment variables (with key/value validation and reserved-field protection)
|
|
8
|
+
|
|
9
|
+
### Patch Changes
|
|
10
|
+
|
|
11
|
+
- Updated dependencies [bf76c3c]
|
|
12
|
+
- @forge/manifest@12.8.0-next.8
|
|
13
|
+
|
|
14
|
+
## 8.23.0-next.9
|
|
15
|
+
|
|
16
|
+
### Minor Changes
|
|
17
|
+
|
|
18
|
+
- 30060eb: Emit `isAgent`/`isCI` on GASv3 analytics events via a new shared `ForgeCliAttribution` class, used by both the `atl-attribution` GraphQL header and analytics client.
|
|
19
|
+
|
|
20
|
+
## 8.23.0-next.8
|
|
21
|
+
|
|
22
|
+
### Patch Changes
|
|
23
|
+
|
|
24
|
+
- Updated dependencies [f7c39e1]
|
|
25
|
+
- @forge/manifest@12.8.0-next.7
|
|
26
|
+
|
|
27
|
+
## 8.23.0-next.7
|
|
28
|
+
|
|
29
|
+
### Patch Changes
|
|
30
|
+
|
|
31
|
+
- Updated dependencies [e7b0684]
|
|
32
|
+
- @forge/manifest@12.8.0-next.6
|
|
33
|
+
|
|
34
|
+
## 8.23.0-next.6
|
|
35
|
+
|
|
36
|
+
### Patch Changes
|
|
37
|
+
|
|
38
|
+
- ef0434d: Added support for multi-entry resources in UI Kit applications, enabling developers to define multiple entry points within a single resource.
|
|
39
|
+
- Updated dependencies [ef0434d]
|
|
40
|
+
- @forge/manifest@12.8.0-next.5
|
|
41
|
+
|
|
42
|
+
## 8.23.0-next.5
|
|
43
|
+
|
|
44
|
+
### Patch Changes
|
|
45
|
+
|
|
46
|
+
- Updated dependencies [1eded6e]
|
|
47
|
+
- Updated dependencies [cf7000f]
|
|
48
|
+
- Updated dependencies [d660fb0]
|
|
49
|
+
- @forge/manifest@12.8.0-next.4
|
|
50
|
+
|
|
51
|
+
## 8.23.0-next.4
|
|
52
|
+
|
|
53
|
+
### Minor Changes
|
|
54
|
+
|
|
55
|
+
- a885062: Support a limit parameter in the version bulk-upgrade start command
|
|
56
|
+
|
|
57
|
+
### Patch Changes
|
|
58
|
+
|
|
59
|
+
- 84d9930: adding option to include installation-id for uninstall flow
|
|
60
|
+
|
|
61
|
+
## 8.23.0-next.3
|
|
62
|
+
|
|
63
|
+
### Patch Changes
|
|
64
|
+
|
|
65
|
+
- Updated dependencies [8d90f4f]
|
|
66
|
+
- @forge/manifest@12.8.0-next.3
|
|
67
|
+
|
|
68
|
+
## 8.23.0-next.2
|
|
69
|
+
|
|
70
|
+
### Minor Changes
|
|
71
|
+
|
|
72
|
+
- 808adbd: Grouped commands in CLI help and commander.js version bump
|
|
73
|
+
|
|
74
|
+
### Patch Changes
|
|
75
|
+
|
|
76
|
+
- Updated dependencies [55991a3]
|
|
77
|
+
- @forge/manifest@12.8.0-next.2
|
|
78
|
+
|
|
79
|
+
## 8.22.1-next.1
|
|
80
|
+
|
|
81
|
+
### Patch Changes
|
|
82
|
+
|
|
83
|
+
- 2c85db9: Add option to create global app
|
|
84
|
+
- Updated dependencies [0e45239]
|
|
85
|
+
- Updated dependencies [2e44a71]
|
|
86
|
+
- Updated dependencies [c775d3d]
|
|
87
|
+
- Updated dependencies [c99451e]
|
|
88
|
+
- Updated dependencies [f80e7b3]
|
|
89
|
+
- @forge/manifest@12.8.0-next.1
|
|
90
|
+
|
|
3
91
|
## 8.22.1-next.0
|
|
4
92
|
|
|
5
93
|
### Patch Changes
|
|
@@ -2,10 +2,12 @@ import { CreateAppClientInput, RegisterAppCommand, RegisterAppResult } from './r
|
|
|
2
2
|
import { Templater } from './template';
|
|
3
3
|
import { PackageInstaller } from './package-installer';
|
|
4
4
|
import { StatsigService } from '../service';
|
|
5
|
+
import { InstallationTarget } from '../graphql';
|
|
5
6
|
export interface CreateAppCommandInput extends CreateAppClientInput {
|
|
6
7
|
template: string;
|
|
7
8
|
directory: string;
|
|
8
9
|
requiredProduct?: string;
|
|
10
|
+
installationTarget?: InstallationTarget;
|
|
9
11
|
}
|
|
10
12
|
export declare class NoTemplatesError extends Error {
|
|
11
13
|
constructor();
|
|
@@ -21,7 +23,7 @@ export declare class CreateAppCommand {
|
|
|
21
23
|
private readonly packageInstaller;
|
|
22
24
|
private readonly statsig;
|
|
23
25
|
constructor(templater: Templater, registerAppCommand: RegisterAppCommand, packageInstaller: PackageInstaller, statsig: StatsigService);
|
|
24
|
-
execute({ name, description, template, directory, requiredProduct, developerSpaceId, billingConsent }: CreateAppCommandInput): Promise<CreateAppCommandResult>;
|
|
26
|
+
execute({ name, description, template, directory, requiredProduct, installationTarget, developerSpaceId, billingConsent }: CreateAppCommandInput): Promise<CreateAppCommandResult>;
|
|
25
27
|
getAvailableTemplates(): Promise<string[]>;
|
|
26
28
|
filterAvailableProducts<T extends string>(products: T[], teamworkGraph: T, crossContext: T): Promise<T[]>;
|
|
27
29
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create-an-app.d.ts","sourceRoot":"","sources":["../../src/apps/create-an-app.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,oBAAoB,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAC7F,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AACvC,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"create-an-app.d.ts","sourceRoot":"","sources":["../../src/apps/create-an-app.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,oBAAoB,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAC7F,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AACvC,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAC5C,OAAO,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAChD,MAAM,WAAW,qBAAsB,SAAQ,oBAAoB;IACjE,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,kBAAkB,CAAC,EAAE,kBAAkB,CAAC;CACzC;AAED,qBAAa,gBAAiB,SAAQ,KAAK;;CAI1C;AAED,oBAAY,sBAAsB,GAAG,iBAAiB,GAAG;IACvD,SAAS,EAAE;QACT,QAAQ,EAAE,MAAM,CAAC;KAClB,CAAC;CACH,CAAC;AAEF,qBAAa,gBAAgB;IAEzB,OAAO,CAAC,QAAQ,CAAC,SAAS;IAC1B,OAAO,CAAC,QAAQ,CAAC,kBAAkB;IACnC,OAAO,CAAC,QAAQ,CAAC,gBAAgB;IACjC,OAAO,CAAC,QAAQ,CAAC,OAAO;gBAHP,SAAS,EAAE,SAAS,EACpB,kBAAkB,EAAE,kBAAkB,EACtC,gBAAgB,EAAE,gBAAgB,EAClC,OAAO,EAAE,cAAc;IAG7B,OAAO,CAAC,EACnB,IAAI,EACJ,WAAW,EACX,QAAQ,EACR,SAAS,EACT,eAAe,EACf,kBAAkB,EAClB,gBAAgB,EAChB,cAAc,EACf,EAAE,qBAAqB,GAAG,OAAO,CAAC,sBAAsB,CAAC;IAkB7C,qBAAqB,IAAI,OAAO,CAAC,MAAM,EAAE,CAAC;IAS1C,uBAAuB,CAAC,CAAC,SAAS,MAAM,EACnD,QAAQ,EAAE,CAAC,EAAE,EACb,aAAa,EAAE,CAAC,EAChB,YAAY,EAAE,CAAC,GACd,OAAO,CAAC,CAAC,EAAE,CAAC;CAchB"}
|
|
@@ -19,11 +19,12 @@ class CreateAppCommand {
|
|
|
19
19
|
this.packageInstaller = packageInstaller;
|
|
20
20
|
this.statsig = statsig;
|
|
21
21
|
}
|
|
22
|
-
async execute({ name, description, template, directory, requiredProduct, developerSpaceId, billingConsent }) {
|
|
22
|
+
async execute({ name, description, template, directory, requiredProduct, installationTarget, developerSpaceId, billingConsent }) {
|
|
23
23
|
await this.templater.downloadAndExtract(template, directory);
|
|
24
24
|
const result = await this.registerAppCommand.registerApp({ name, description, developerSpaceId, billingConsent }, directory, {
|
|
25
25
|
shouldPrependAppName: true,
|
|
26
|
-
requiredProduct
|
|
26
|
+
requiredProduct,
|
|
27
|
+
installationTarget
|
|
27
28
|
});
|
|
28
29
|
await this.packageInstaller.install(directory);
|
|
29
30
|
return {
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { ConfigFile, ConfigSectionReader, ConfigSectionWriter, NO_VALIDATION_TYPE } from '../config';
|
|
2
|
+
import { InstallationTarget } from '../graphql';
|
|
2
3
|
import { Logger } from '../ui';
|
|
3
4
|
import { AppDetails } from './app-config';
|
|
4
5
|
export interface CreateAppClientInput {
|
|
@@ -33,9 +34,10 @@ export declare class RegisterAppCommand {
|
|
|
33
34
|
execute(input: CreateAppClientInput, { shouldPrependAppName }?: {
|
|
34
35
|
shouldPrependAppName?: boolean | undefined;
|
|
35
36
|
}): Promise<RegisterAppResult>;
|
|
36
|
-
registerApp(input: CreateAppClientInput, directory: string, { shouldPrependAppName, requiredProduct }: {
|
|
37
|
+
registerApp(input: CreateAppClientInput, directory: string, { shouldPrependAppName, requiredProduct, installationTarget }: {
|
|
37
38
|
shouldPrependAppName: boolean;
|
|
38
39
|
requiredProduct?: string;
|
|
40
|
+
installationTarget?: InstallationTarget;
|
|
39
41
|
}): Promise<CreateAppResult>;
|
|
40
42
|
}
|
|
41
43
|
//# sourceMappingURL=register-app.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"register-app.d.ts","sourceRoot":"","sources":["../../src/apps/register-app.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,mBAAmB,EAAE,mBAAmB,EAAqB,kBAAkB,EAAE,MAAM,WAAW,CAAC;AAExH,OAAO,EAAE,MAAM,EAAQ,MAAM,OAAO,CAAC;AACrC,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE1C,MAAM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AAiB,CAAC;IAQvG,WAAW,CACtB,KAAK,EAAE,oBAAoB,EAC3B,SAAS,EAAE,MAAM,EACjB,EACE,oBAAoB,EACpB,eAAe,EACf,kBAAkB,EACnB,EAAE;QACD,oBAAoB,EAAE,OAAO,CAAC;QAC9B,eAAe,CAAC,EAAE,MAAM,CAAC;QACzB,kBAAkB,CAAC,EAAE,kBAAkB,CAAC;KACzC,GACA,OAAO,CAAC,eAAe,CAAC;CAwC5B"}
|
package/out/apps/register-app.js
CHANGED
|
@@ -24,7 +24,7 @@ class RegisterAppCommand {
|
|
|
24
24
|
environments: result.environments.map((env) => env.key)
|
|
25
25
|
};
|
|
26
26
|
}
|
|
27
|
-
async registerApp(input, directory, { shouldPrependAppName, requiredProduct }) {
|
|
27
|
+
async registerApp(input, directory, { shouldPrependAppName, requiredProduct, installationTarget }) {
|
|
28
28
|
this.logger.info(ui_1.Text.create.taskRegister);
|
|
29
29
|
const result = await this.appClient.createApp(input);
|
|
30
30
|
await (0, file_system_1.inDirectory)(directory, async () => {
|
|
@@ -38,6 +38,7 @@ class RegisterAppCommand {
|
|
|
38
38
|
const section = await this.appConfigReader.readConfigSection();
|
|
39
39
|
let newAppDetails = {
|
|
40
40
|
id: result.id,
|
|
41
|
+
...(installationTarget && { installationTarget }),
|
|
41
42
|
...(requiredProduct && {
|
|
42
43
|
compatibility: {
|
|
43
44
|
[requiredProduct]: {
|
package/out/ari/ari.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { Ari, AnyAri, JiraWorkspaceAri, ConfluenceWorkspaceAri, CompassWorkspaceAri, GraphWorkspaceAri } from '@forge/util/packages/ari';
|
|
2
2
|
export declare const SITE_RESOURCE_TYPE = "site";
|
|
3
3
|
export declare const WORKSPACE_RESOURCE_TYPE = "workspace";
|
|
4
|
+
export declare const INSTALLATION_RESOURCE_TYPE = "installation";
|
|
4
5
|
export declare const TRELLO_RESOURCE_OWNER = "trello";
|
|
5
6
|
export declare const BITBUCKET_RESOURCE_OWNER = "bitbucket";
|
|
6
7
|
export declare function appIdToAriString(appId: string): string;
|
|
@@ -13,6 +14,9 @@ export declare class UnknownSiteWithoutResourceIdError extends Error {
|
|
|
13
14
|
export declare class UnknownWorkspaceWithoutResourceIdError extends Error {
|
|
14
15
|
constructor();
|
|
15
16
|
}
|
|
17
|
+
export declare class UnknownInstallationWithoutResourceIdError extends Error {
|
|
18
|
+
constructor();
|
|
19
|
+
}
|
|
16
20
|
export declare function parseInstallationContext(installationContext: string): AnyAri;
|
|
17
21
|
export declare const createWorkspaceAriByProduct: {
|
|
18
22
|
jira: (siteId: string, activationId: string) => JiraWorkspaceAri;
|
package/out/ari/ari.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ari.d.ts","sourceRoot":"","sources":["../../src/ari/ari.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,GAAG,EACH,MAAM,EACN,gBAAgB,EAChB,sBAAsB,EACtB,mBAAmB,EACnB,iBAAiB,EAClB,MAAM,0BAA0B,CAAC;AAIlC,eAAO,MAAM,kBAAkB,SAAS,CAAC;AACzC,eAAO,MAAM,uBAAuB,cAAc,CAAC;AACnD,eAAO,MAAM,qBAAqB,WAAW,CAAC;AAC9C,eAAO,MAAM,wBAAwB,cAAc,CAAC;AAEpD,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAEtD;AAID,wBAAgB,eAAe,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,GAAG,CAMrE;AAED,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,GAAG,GAAG,CAMhG;AAGD,wBAAgB,aAAa,CAAC,OAAO,EAAE,GAAG,EAAE,SAAS,EAAE,GAAG,GAAG,MAAM,CAKlE;AACD,qBAAa,iCAAkC,SAAQ,KAAK;;CAI3D;AACD,qBAAa,sCAAuC,SAAQ,K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strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.createWorkspaceAriByProduct = exports.parseInstallationContext = exports.UnknownWorkspaceWithoutResourceIdError = exports.UnknownSiteWithoutResourceIdError = exports.encodeContext = exports.buildExtensionAri = exports.buildContextAri = exports.appIdToAriString = exports.BITBUCKET_RESOURCE_OWNER = exports.TRELLO_RESOURCE_OWNER = exports.WORKSPACE_RESOURCE_TYPE = exports.SITE_RESOURCE_TYPE = void 0;
|
|
3
|
+
exports.createWorkspaceAriByProduct = exports.parseInstallationContext = exports.UnknownInstallationWithoutResourceIdError = exports.UnknownWorkspaceWithoutResourceIdError = exports.UnknownSiteWithoutResourceIdError = exports.encodeContext = exports.buildExtensionAri = exports.buildContextAri = exports.appIdToAriString = exports.BITBUCKET_RESOURCE_OWNER = exports.TRELLO_RESOURCE_OWNER = exports.INSTALLATION_RESOURCE_TYPE = exports.WORKSPACE_RESOURCE_TYPE = exports.SITE_RESOURCE_TYPE = void 0;
|
|
4
4
|
const ari_1 = require("@forge/util/packages/ari");
|
|
5
5
|
const shared_1 = require("../shared");
|
|
6
6
|
const ui_1 = require("../ui");
|
|
7
7
|
exports.SITE_RESOURCE_TYPE = 'site';
|
|
8
8
|
exports.WORKSPACE_RESOURCE_TYPE = 'workspace';
|
|
9
|
+
exports.INSTALLATION_RESOURCE_TYPE = 'installation';
|
|
9
10
|
exports.TRELLO_RESOURCE_OWNER = 'trello';
|
|
10
11
|
exports.BITBUCKET_RESOURCE_OWNER = 'bitbucket';
|
|
11
12
|
function appIdToAriString(appId) {
|
|
@@ -45,6 +46,12 @@ class UnknownWorkspaceWithoutResourceIdError extends Error {
|
|
|
45
46
|
}
|
|
46
47
|
}
|
|
47
48
|
exports.UnknownWorkspaceWithoutResourceIdError = UnknownWorkspaceWithoutResourceIdError;
|
|
49
|
+
class UnknownInstallationWithoutResourceIdError extends Error {
|
|
50
|
+
constructor() {
|
|
51
|
+
super(ui_1.Text.installList.noResourceIdInInstallation);
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
exports.UnknownInstallationWithoutResourceIdError = UnknownInstallationWithoutResourceIdError;
|
|
48
55
|
function parseInstallationContext(installationContext) {
|
|
49
56
|
const context = ari_1.AnyAri.parse(installationContext);
|
|
50
57
|
switch (context.resourceType) {
|
|
@@ -58,6 +65,11 @@ function parseInstallationContext(installationContext) {
|
|
|
58
65
|
throw new UnknownWorkspaceWithoutResourceIdError();
|
|
59
66
|
}
|
|
60
67
|
break;
|
|
68
|
+
case exports.INSTALLATION_RESOURCE_TYPE:
|
|
69
|
+
if (!context.resourceId) {
|
|
70
|
+
throw new UnknownInstallationWithoutResourceIdError();
|
|
71
|
+
}
|
|
72
|
+
break;
|
|
61
73
|
default:
|
|
62
74
|
throw new Error('Unknown resource type');
|
|
63
75
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config-file.d.ts","sourceRoot":"","sources":["../../src/config/config-file.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAGpE,OAAO,EAAE,YAAY,EAAE,YAAY,EAAoB,MAAM,IAAI,CAAC;AAGlE,OAAO,EACL,OAAO,EACP,cAAc,EACd,SAAS,
|
|
1
|
+
{"version":3,"file":"config-file.d.ts","sourceRoot":"","sources":["../../src/config/config-file.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAGpE,OAAO,EAAE,YAAY,EAAE,YAAY,EAAoB,MAAM,IAAI,CAAC;AAGlE,OAAO,EACL,OAAO,EACP,cAAc,EACd,SAAS,EAOV,MAAM,iBAAiB,CAAC;AASzB,OAAO,EAAE,SAAS,EAAE,eAAe,EAAQ,MAAM,WAAW,CAAC;AAE7D,qBAAa,oBAAqB,SAAQ,eAAe;;CAIxD;AAED,qBAAa,8BAA+B,SAAQ,SAAS;gBAC/C,SAAS,EA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AAO,CAAC,gBAAgB;IAIX,oBAAoB,IAAI,OAAO,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,EAAE,GAAG,SAAS,CAAA;KAAE,EAAE,CAAC;IAqClF,gBAAgB,IAAI,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE;QAAE,GAAG,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IAe1E,YAAY,CAAC,aAAa,CAAC,EAAE,cAAc,EAAE,GAAG,OAAO,CAAC,eAAe,EAAE,CAAC;IAsB1E,aAAa,IAAI,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC;IAKzD,OAAO,CAAC,eAAe;CAkCxB"}
|
|
@@ -182,7 +182,10 @@ class ConfigFile {
|
|
|
182
182
|
return [module.resource, ...config_1.ModuleEntryPoints.map((entryPoint) => module[entryPoint]?.resource || '')];
|
|
183
183
|
})
|
|
184
184
|
.filter(Boolean);
|
|
185
|
-
const missingModuleResourcesKeys = modulesResourcesKeys.filter((
|
|
185
|
+
const missingModuleResourcesKeys = modulesResourcesKeys.filter((resourceReference) => {
|
|
186
|
+
const { resourceKey } = (0, manifest_1.parseResourceReference)(resourceReference);
|
|
187
|
+
return !resources.some((resource) => resource.key === resourceKey);
|
|
188
|
+
});
|
|
186
189
|
if (missingModuleResourcesKeys.length > 0) {
|
|
187
190
|
throw new ResourceDefinitionMissingError(missingModuleResourcesKeys);
|
|
188
191
|
}
|
|
@@ -267,7 +270,12 @@ class ConfigFile {
|
|
|
267
270
|
return app.connect?.key;
|
|
268
271
|
}
|
|
269
272
|
getResourceType({ key: resourceKey }, allModules) {
|
|
270
|
-
const linkedModule = allModules.find((m) =>
|
|
273
|
+
const linkedModule = allModules.find((m) => {
|
|
274
|
+
if (!m.resource)
|
|
275
|
+
return false;
|
|
276
|
+
const { resourceKey: moduleResourceKey } = (0, manifest_1.parseResourceReference)(m.resource);
|
|
277
|
+
return moduleResourceKey === resourceKey;
|
|
278
|
+
}) ??
|
|
271
279
|
allModules
|
|
272
280
|
.reduce((acc, m) => {
|
|
273
281
|
config_1.ModuleEntryPoints.forEach((entryPoint) => {
|
|
@@ -278,7 +286,12 @@ class ConfigFile {
|
|
|
278
286
|
});
|
|
279
287
|
return acc;
|
|
280
288
|
}, [])
|
|
281
|
-
.find(({ resource }) =>
|
|
289
|
+
.find(({ resource }) => {
|
|
290
|
+
if (!resource)
|
|
291
|
+
return false;
|
|
292
|
+
const { resourceKey: moduleResourceKey } = (0, manifest_1.parseResourceReference)(resource);
|
|
293
|
+
return moduleResourceKey === resourceKey;
|
|
294
|
+
});
|
|
282
295
|
if (!linkedModule) {
|
|
283
296
|
return 'default';
|
|
284
297
|
}
|