@forge/manifest 2.6.0-next.8 → 3.0.1-fix.0

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.
@@ -70,6 +70,7 @@ export declare const errors: {
70
70
  app: {
71
71
  missingAppConnectRemote: () => string;
72
72
  missingRemoteForConnect: (key: string) => string;
73
+ missingConnectModules: () => string;
73
74
  };
74
75
  };
75
76
  export declare enum References {
@@ -1 +1 @@
1
- {"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../src/text/errors.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,MAAM;8BACS,MAAM,KAAG,MAAM;2BACpB,MAAM;yBAEN,MAAM,GAAG,SAAS,QAAQ,MAAM,EAAE,UAAU,MAAM,GAAG,SAAS,KAAG,MAAM;;uBAO3E,MAAM,EAAE,EAAE,GAAG,SAAS,KAAG,MAAM;4BAI1B,MAAM,EAAE,KAAG,MAAM;mCACV,MAAM,SAAS,MAAM,0CAA4B,MAAM;mDAIvC,MAAM,KAAG,MAAM;;;qCAI7B,MAAM,SAAS,MAAM,KAAG,MAAM;4CAEvB,MAAM,SAAS,MAAM,KAAG,MAAM;wCAElC,MAAM,SAAS,MAAM,EAAE,KAAG,MAAM;;;uCAMjC,MAAM,KAAG,MAAM;oCACpB,MAAM;iCAEP,MAAM,KAAG,MAAM;4CACJ,MAAM,KAAG,MAAM;;;gCAG3B,MAAM,KAAG,MAAM;6BACpB,MAAM;+BACJ,MAAM;iCACF,MAAM,KAAG,MAAM;yCACP,MAAM,eAAe,MAAM,KAAG,MAAM;yCAEpC,MAAM,eAAe,MAAM,KAAG,MAAM;;yCAGtC,MAAM,KAAG,MAAM;iCAEvB,MAAM,KAAG,MAAM;4CACJ,MAAM,gBAAgB,MAAM,KAAG,MAAM;sCAE3C,MAAM,gBAAgB,MAAM,gBAAgB,MAAM,KAAG,MAAM;;;mCAI9D,MAAM,KAAG,MAAM;mCAEf,MAAM,KAAG,MAAM;;;mCAIf,MAAM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A4B;IACrC,UAAU,wBAAwB;IAClC,GAAG,8BAA8B;CAClC"}
@@ -81,7 +81,8 @@ exports.errors = {
81
81
  },
82
82
  app: {
83
83
  missingAppConnectRemote: () => `missing app.connect.remote. app.connect.remote is required if connectModules are present.`,
84
- missingRemoteForConnect: (key) => `no remote found with key '${key}' matching app.connect.remote value.`
84
+ missingRemoteForConnect: (key) => `no remote found with key '${key}' matching app.connect.remote value.`,
85
+ missingConnectModules: () => 'Missing connectModules. When app.connect.authentication is present, connectModules is required.'
85
86
  }
86
87
  };
87
88
  var References;
@@ -9,6 +9,7 @@ export declare enum AllModuleTypes {
9
9
  ConfluenceContentBylineItem = "confluence:contentBylineItem",
10
10
  ConfluenceContextMenu = "confluence:contextMenu",
11
11
  ConfluenceGlobalSettings = "confluence:globalSettings",
12
+ ConfluenceGlobalPage = "confluence:globalPage",
12
13
  ConfluenceHomepageFeed = "confluence:homepageFeed",
13
14
  ConfluenceSpacePage = "confluence:spacePage",
14
15
  ConfluenceSpaceSettings = "confluence:spaceSettings",
@@ -1 +1 @@
1
- {"version":3,"file":"module-types.d.ts","sourceRoot":"","sources":["../../src/types/module-types.ts"],"names":[],"mappings":"AAAA,oBAAY,cAAc;IACxB,YAAY,kBAAkB;IAC9B,WAAW,iBAAiB;IAC5B,cAAc,oBAAoB;IAClC,YAAY,kBAAkB;IAC9B,oBAAoB,0BAA0B;IAC9C,QAAQ,cAAc;IACtB,uBAAuB,6BAA6B;IACpD,2BAA2B,iCAAiC;IAC5D,qBAAqB,2BAA2B;IAChD,wBAAwB,8BAA8B;IACtD,sBAAsB,4BAA4B;IAClD,mBAAmB,yBAAyB;IAC5C,uBAAuB,6BAA6B;IACpD,qBAAqB,2BAA2B;IAChD,eAAe,qBAAqB;IACpC,mBAAmB,yBAAyB;IAC5C,eAAe,qBAAqB;IACpC,iBAAiB,uBAAuB;IACxC,eAAe,qBAAqB;IACpC,cAAc,oBAAoB;IAClC,aAAa,mBAAmB;IAChC,eAAe,qBAAqB;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,4BAA4B,mCAAmC;IAC/D,mBAAmB,0BAA0B;IAC7C,oBAAoB,2BAA2B;IAC/C,2BAA2B,kCAAkC;IAC7D,2BAA2B,kCAAkC;IAC7D,8BAA8B,qCAAqC;IACnE,4CAA4C,mDAAmD;IAC/F,iCAAiC,wCAAwC;IACzE,mCAAmC,0CAA0C;IAC7E,8BAA8B,qCAAqC;IACnE,wBAAwB,+BAA+B;IACvD,qCAAqC,4CAA4C;IACjF,6BAA6B,oCAAoC;IACjE,kCAAkC,yCAAyC;IAC3E,gCAAgC,uCAAuC;IACvE,+BAA+B,sCAAsC;IACrE,oCAAoC,2CAA2C;IAC/E,yBAAyB,gCAAgC;IACzD,0BAA0B,iCAAiC;IAC3D,4BAA4B,mCAAmC;IAC/D,yBAAyB,gCAAgC;IACzD,wBAAwB,+BAA+B;IACvD,kBAAkB,yBAAyB;IAC3C,gCAAgC,uCAAuC;IACvE,qCAAqC,4CAA4C;IACjF,8BAA8B,qCAAqC;IACnE,+BAA+B,sCAAsC;IACrE,sCAAsC,6CAA6C;IACnF,4BAA4B,mCAAmC;IAC/D,6BAA6B,oCAAoC;IACjE,yBAAyB,gCAAgC;IACzD,2BAA2B,kCAAkC;IAC7D,iCAAiC,wCAAwC;IACzE,sBAAsB,6BAA6B;IACnD,iCAAiC,wCAAwC;IACzE,oCAAoC,2CAA2C;IAC/E,iCAAiC,wCAAwC;IACzE,0BAA0B,iCAAiC;IAC3D,oBAAoB,2BAA2B;IAC/C,sBAAsB,6BAA6B;IACnD,mBAAmB,0BAA0B;IAC7C,0BAA0B,iCAAiC;CAC5D;AAED,eAAO,MAAM,iBAAiB,kBAAgC,CAAC;AAE/D,eAAO,MAAM,uBAAuB,UAAwE,CAAC"}
@@ -13,6 +13,7 @@ var AllModuleTypes;
13
13
  AllModuleTypes["ConfluenceContentBylineItem"] = "confluence:contentBylineItem";
14
14
  AllModuleTypes["ConfluenceContextMenu"] = "confluence:contextMenu";
15
15
  AllModuleTypes["ConfluenceGlobalSettings"] = "confluence:globalSettings";
16
+ AllModuleTypes["ConfluenceGlobalPage"] = "confluence:globalPage";
16
17
  AllModuleTypes["ConfluenceHomepageFeed"] = "confluence:homepageFeed";
17
18
  AllModuleTypes["ConfluenceSpacePage"] = "confluence:spacePage";
18
19
  AllModuleTypes["ConfluenceSpaceSettings"] = "confluence:spaceSettings";
@@ -0,0 +1,7 @@
1
+ import { ValidatorInterface } from './validator-interface';
2
+ import { ManifestObject, ManifestValidationResult } from '../types';
3
+ import { ManifestSchema } from '../schema/manifest';
4
+ export declare class ConnectAuthenticationValidator implements ValidatorInterface<ManifestObject<ManifestSchema> | undefined, ManifestSchema> {
5
+ validate(manifest: ManifestObject<ManifestSchema> | undefined): ManifestValidationResult<ManifestSchema>;
6
+ }
7
+ //# sourceMappingURL=connect-authentication-validator.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"connect-authentication-validator.d.ts","sourceRoot":"","sources":["../../src/validators/connect-authentication-validator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAC3D,OAAO,EAAE,cAAc,EAAE,wBAAwB,EAAmB,MAAM,UAAU,CAAC;AACrF,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAIpD,qBAAa,8BACX,YAAW,kBAAkB,CAAC,cAAc,CAAC,cAAc,CAAC,GAAG,SAAS,EAAE,cAAc,CAAC;IACzF,QAAQ,CAAC,QAAQ,EAAE,cAAc,CAAC,cAAc,CAAC,GAAG,SAAS,GAAG,wBAAwB,CAAC,cAAc,CAAC;CA0BzG"}
@@ -0,0 +1,27 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ConnectAuthenticationValidator = void 0;
4
+ const text_1 = require("../text");
5
+ const utils_1 = require("../utils");
6
+ class ConnectAuthenticationValidator {
7
+ validate(manifest) {
8
+ var _a, _b;
9
+ if (!((_a = manifest === null || manifest === void 0 ? void 0 : manifest.typedContent) === null || _a === void 0 ? void 0 : _a.app)) {
10
+ return {
11
+ success: false,
12
+ manifestObject: manifest
13
+ };
14
+ }
15
+ const app = manifest.typedContent.app;
16
+ const validationErrors = [];
17
+ if (!manifest.typedContent.connectModules && ((_b = app === null || app === void 0 ? void 0 : app.connect) === null || _b === void 0 ? void 0 : _b.authentication)) {
18
+ validationErrors.push(Object.assign({ message: text_1.errors.app.missingConnectModules(), reference: text_1.References.App, level: 'error' }, utils_1.findPosition('connect', manifest.yamlContentByLine)));
19
+ }
20
+ return {
21
+ success: validationErrors.length === 0,
22
+ manifestObject: manifest,
23
+ errors: validationErrors
24
+ };
25
+ }
26
+ }
27
+ exports.ConnectAuthenticationValidator = ConnectAuthenticationValidator;
@@ -10,4 +10,5 @@ export * from './product-trigger-scopes-validator';
10
10
  export * from './providers-validator';
11
11
  export * from './permissions-validator';
12
12
  export * from './connect-remote-validator';
13
+ export * from './connect-authentication-validator';
13
14
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/validators/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAC;AACpC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,oBAAoB,CAAC;AACnC,cAAc,kBAAkB,CAAC;AACjC,cAAc,kBAAkB,CAAC;AACjC,cAAc,uBAAuB,CAAC;AACtC,cAAc,uBAAuB,CAAC;AACtC,cAAc,gCAAgC,CAAC;AAC/C,cAAc,oCAAoC,CAAC;AACnD,cAAc,uBAAuB,CAAC;AACtC,cAAc,yBAAyB,CAAC;AACxC,cAAc,4BAA4B,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/validators/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAC;AACpC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,oBAAoB,CAAC;AACnC,cAAc,kBAAkB,CAAC;AACjC,cAAc,kBAAkB,CAAC;AACjC,cAAc,uBAAuB,CAAC;AACtC,cAAc,uBAAuB,CAAC;AACtC,cAAc,gCAAgC,CAAC;AAC/C,cAAc,oCAAoC,CAAC;AACnD,cAAc,uBAAuB,CAAC;AACtC,cAAc,yBAAyB,CAAC;AACxC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,oCAAoC,CAAC"}
@@ -13,3 +13,4 @@ tslib_1.__exportStar(require("./product-trigger-scopes-validator"), exports);
13
13
  tslib_1.__exportStar(require("./providers-validator"), exports);
14
14
  tslib_1.__exportStar(require("./permissions-validator"), exports);
15
15
  tslib_1.__exportStar(require("./connect-remote-validator"), exports);
16
+ tslib_1.__exportStar(require("./connect-authentication-validator"), exports);
@@ -1 +1 @@
1
- {"version":3,"file":"permissions-validator.d.ts","sourceRoot":"","sources":["../../src/validators/permissions-validator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,wBAAwB,EAAmB,MAAM,UAAU,CAAC;AAGrF,OAAO,EAAE,cAAc,EAAU,MAAM,oBAAoB,CAAC;AAC5D,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAM3D,qBAAa,oBACX,YAAW,kBAAkB,CAAC,cAAc,CAAC,cAAc,CAAC,GAAG,SAAS,EAAE,cAAc,CAAC;IACzF,QAAQ,CAAC,QAAQ,EAAE,cAAc,CAAC,cAAc,CAAC,GAAG,SAAS,GAAG,wBAAwB,CAAC,cAAc,CAAC;CAyHzG"}
1
+ {"version":3,"file":"permissions-validator.d.ts","sourceRoot":"","sources":["../../src/validators/permissions-validator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,wBAAwB,EAAmB,MAAM,UAAU,CAAC;AAGrF,OAAO,EAAE,cAAc,EAAU,MAAM,oBAAoB,CAAC;AAC5D,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAM3D,qBAAa,oBACX,YAAW,kBAAkB,CAAC,cAAc,CAAC,cAAc,CAAC,GAAG,SAAS,EAAE,cAAc,CAAC;IACzF,QAAQ,CAAC,QAAQ,EAAE,cAAc,CAAC,cAAc,CAAC,GAAG,SAAS,GAAG,wBAAwB,CAAC,cAAc,CAAC;CAkIzG"}
@@ -10,7 +10,7 @@ const shipyard_scopes_json_1 = tslib_1.__importDefault(require("../scopes/shipya
10
10
  const deprecated_shipyard_scopes_json_1 = tslib_1.__importDefault(require("../scopes/deprecated-shipyard-scopes.json"));
11
11
  class PermissionsValidator {
12
12
  validate(manifest) {
13
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w;
13
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z;
14
14
  if (!manifest || !manifest.typedContent || !manifest.typedContent.permissions) {
15
15
  return {
16
16
  success: false,
@@ -73,23 +73,27 @@ class PermissionsValidator {
73
73
  if (invalidBackendRemote) {
74
74
  addValidationError('external.fetch.backend', invalidBackendRemote.remote, manifest);
75
75
  }
76
- const invalidClient = (_o = (_m = (_l = manifest.typedContent.permissions.external) === null || _l === void 0 ? void 0 : _l.fetch) === null || _m === void 0 ? void 0 : _m.client) === null || _o === void 0 ? void 0 : _o.find((key) => !isValidURL(key));
76
+ const invalidClientString = (_o = (_m = (_l = manifest.typedContent.permissions.external) === null || _l === void 0 ? void 0 : _l.fetch) === null || _m === void 0 ? void 0 : _m.client) === null || _o === void 0 ? void 0 : _o.filter((item) => typeof item === 'string').find((key) => !isValidURL(key));
77
+ if (invalidClientString) {
78
+ addValidationError('external.fetch.client', invalidClientString, manifest);
79
+ }
80
+ const invalidClient = (_r = (_q = (_p = manifest.typedContent.permissions.external) === null || _p === void 0 ? void 0 : _p.fetch) === null || _q === void 0 ? void 0 : _q.client) === null || _r === void 0 ? void 0 : _r.filter((item) => typeof item === 'object').find((item) => !remoteMap || !remoteMap.has(item.remote) || !isValidURL(remoteMap.get(item.remote)));
77
81
  if (invalidClient) {
78
- addValidationError('external.fetch.client', invalidClient, manifest);
82
+ addValidationError('external.fetch.client', invalidClient.remote, manifest);
79
83
  }
80
- const invalidNavigation = (_q = (_p = manifest.typedContent.permissions.external) === null || _p === void 0 ? void 0 : _p.navigation) === null || _q === void 0 ? void 0 : _q.find((key) => !isValidURL(key));
84
+ const invalidNavigation = (_t = (_s = manifest.typedContent.permissions.external) === null || _s === void 0 ? void 0 : _s.navigation) === null || _t === void 0 ? void 0 : _t.find((key) => !isValidURL(key));
81
85
  if (invalidNavigation) {
82
86
  addValidationError('external.navigation', invalidNavigation, manifest);
83
87
  }
84
- const invalidImages = (_s = (_r = manifest.typedContent.permissions.external) === null || _r === void 0 ? void 0 : _r.images) === null || _s === void 0 ? void 0 : _s.find((key) => !isValidURL(key));
88
+ const invalidImages = (_v = (_u = manifest.typedContent.permissions.external) === null || _u === void 0 ? void 0 : _u.images) === null || _v === void 0 ? void 0 : _v.find((key) => !isValidURL(key));
85
89
  if (invalidImages) {
86
90
  addValidationError('external.images', invalidImages, manifest);
87
91
  }
88
- const invalidMedia = (_u = (_t = manifest.typedContent.permissions.external) === null || _t === void 0 ? void 0 : _t.media) === null || _u === void 0 ? void 0 : _u.find((key) => !isValidURL(key));
92
+ const invalidMedia = (_x = (_w = manifest.typedContent.permissions.external) === null || _w === void 0 ? void 0 : _w.media) === null || _x === void 0 ? void 0 : _x.find((key) => !isValidURL(key));
89
93
  if (invalidMedia) {
90
94
  addValidationError('external.media', invalidMedia, manifest);
91
95
  }
92
- const invalidExternalScripts = (_w = (_v = manifest.typedContent.permissions.external) === null || _v === void 0 ? void 0 : _v.scripts) === null || _w === void 0 ? void 0 : _w.find((key) => !isValidURL(key));
96
+ const invalidExternalScripts = (_z = (_y = manifest.typedContent.permissions.external) === null || _y === void 0 ? void 0 : _y.scripts) === null || _z === void 0 ? void 0 : _z.find((key) => !isValidURL(key));
93
97
  if (invalidExternalScripts) {
94
98
  addValidationError('external.scripts', invalidExternalScripts, manifest);
95
99
  }
@@ -3,7 +3,10 @@ import { ValidatorInterface } from './validator-interface';
3
3
  import { ManifestSchema } from '../schema/manifest';
4
4
  export interface MappingEntry {
5
5
  productEvent: string;
6
- oAuthScopes: string[];
6
+ oAuthScopes: {
7
+ current: string[];
8
+ deprecated?: string[];
9
+ };
7
10
  }
8
11
  export interface MappingConfig {
9
12
  mapping: MappingEntry[];
@@ -1 +1 @@
1
- {"version":3,"file":"product-trigger-scopes-validator.d.ts","sourceRoot":"","sources":["../../src/validators/product-trigger-scopes-validator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,wBAAwB,EAAmB,MAAM,UAAU,CAAC;AACrF,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAC3D,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAIpD,MAAM,WAAW,YAAY;IAC3B,YAAY,EAAE,MAAM,CAAC;IACrB,WAAW,EAAE,MAAM,EAAE,CAAC;CACvB;AAED,MAAM,WAAW,aAAa;IAC5B,OAAO,EAAE,YAAY,EAAE,CAAC;CACzB;AAED,qBAAa,6BAA6B,CAAC,CAAC,CAC1C,YAAW,kBAAkB,CAAC,cAAc,CAAC,cAAc,CAAC,GAAG,SAAS,EAAE,cAAc,CAAC;IAC7E,OAAO,CAAC,QAAQ,CAAC,MAAM;gBAAN,MAAM,EAAE,aAAa;IAElD,QAAQ,CAAC,QAAQ,EAAE,cAAc,CAAC,cAAc,CAAC,GAAG,SAAS,GAAG,wBAAwB,CAAC,cAAc,CAAC;CAgDzG"}
1
+ {"version":3,"file":"product-trigger-scopes-validator.d.ts","sourceRoot":"","sources":["../../src/validators/product-trigger-scopes-validator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,wBAAwB,EAAmB,MAAM,UAAU,CAAC;AACrF,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAC3D,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAIpD,MAAM,WAAW,YAAY;IAC3B,YAAY,EAAE,MAAM,CAAC;IACrB,WAAW,EAAE;QACX,OAAO,EAAE,MAAM,EAAE,CAAC;QAClB,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC;KACvB,CAAC;CACH;AAED,MAAM,WAAW,aAAa;IAC5B,OAAO,EAAE,YAAY,EAAE,CAAC;CACzB;AAED,qBAAa,6BAA6B,CAAC,CAAC,CAC1C,YAAW,kBAAkB,CAAC,cAAc,CAAC,cAAc,CAAC,GAAG,SAAS,EAAE,cAAc,CAAC;IAC7E,OAAO,CAAC,QAAQ,CAAC,MAAM;gBAAN,MAAM,EAAE,aAAa;IAElD,QAAQ,CAAC,QAAQ,EAAE,cAAc,CAAC,cAAc,CAAC,GAAG,SAAS,GAAG,wBAAwB,CAAC,cAAc,CAAC;CAsEzG"}
@@ -16,9 +16,9 @@ class ProductTriggerScopesValidator {
16
16
  };
17
17
  }
18
18
  const validationErrors = [];
19
- const getRequiredScopesForProductEvent = (productEvent) => {
19
+ const getRequiredScopes = (productEvent, status) => {
20
20
  var _a;
21
- return ((_a = this.config.mapping.find((value) => value.productEvent == productEvent)) === null || _a === void 0 ? void 0 : _a.oAuthScopes) || [];
21
+ return (_a = this.config.mapping.find((value) => value.productEvent == productEvent)) === null || _a === void 0 ? void 0 : _a.oAuthScopes[status];
22
22
  };
23
23
  const addValidationError = (scope, event) => {
24
24
  validationErrors.push(Object.assign({ message: text_1.errors.permissions.missingPermissionFromScope(scope, event), reference: text_1.References.MissingScopes, level: 'error', metadata: {
@@ -33,11 +33,27 @@ class ProductTriggerScopesValidator {
33
33
  }
34
34
  const manifestScopes = ((_a = manifest.typedContent.permissions) === null || _a === void 0 ? void 0 : _a.scopes) || [];
35
35
  manifest.typedContent.modules.trigger.forEach((element) => {
36
- element.events.forEach((event) => {
37
- const requiredScopes = getRequiredScopesForProductEvent(event);
38
- const missingScopes = requiredScopes.filter((requiredScope) => !manifestScopes.includes(requiredScope));
39
- missingScopes.forEach((missingScope) => addValidationError(missingScope, event));
40
- });
36
+ for (const event of element.events) {
37
+ const currentScopes = getRequiredScopes(event, 'current');
38
+ if (!currentScopes)
39
+ continue;
40
+ const missingCurrentScopes = currentScopes.filter((scope) => !manifestScopes.includes(scope));
41
+ if (missingCurrentScopes.length === 0)
42
+ continue;
43
+ const deprecatedScopes = getRequiredScopes(event, 'deprecated');
44
+ const missingDeprecatedScopes = deprecatedScopes === null || deprecatedScopes === void 0 ? void 0 : deprecatedScopes.filter((scope) => !manifestScopes.includes(scope));
45
+ if ((missingDeprecatedScopes === null || missingDeprecatedScopes === void 0 ? void 0 : missingDeprecatedScopes.length) === 0)
46
+ continue;
47
+ if (missingCurrentScopes.length < currentScopes.length) {
48
+ missingCurrentScopes.forEach((scope) => addValidationError(scope, event));
49
+ continue;
50
+ }
51
+ if (missingDeprecatedScopes && deprecatedScopes && missingDeprecatedScopes.length < deprecatedScopes.length) {
52
+ missingDeprecatedScopes.forEach((scope) => addValidationError(scope, event));
53
+ continue;
54
+ }
55
+ missingCurrentScopes.forEach((scope) => addValidationError(scope, event));
56
+ }
41
57
  });
42
58
  return {
43
59
  success: validationErrors.length === 0,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@forge/manifest",
3
- "version": "2.6.0-next.8",
3
+ "version": "3.0.1-fix.0",
4
4
  "description": "Definitions and validations of the Forge manifest",
5
5
  "main": "out/index.js",
6
6
  "scripts": {