@forge/manifest 0.0.0-experimental-9fff5da → 0.0.0-experimental-7c72fec

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.
Files changed (45) hide show
  1. package/CHANGELOG.md +535 -1
  2. package/out/builder/processor-builder.d.ts.map +1 -1
  3. package/out/builder/processor-builder.js +3 -0
  4. package/out/index.d.ts +1 -1
  5. package/out/index.d.ts.map +1 -1
  6. package/out/mapping/product-event-to-scope-mapping.json +90 -0
  7. package/out/processor/deprecated-csp-method-validation-processor.d.ts +6 -0
  8. package/out/processor/deprecated-csp-method-validation-processor.d.ts.map +1 -0
  9. package/out/processor/deprecated-csp-method-validation-processor.js +18 -0
  10. package/out/processor/full-validation-processor.d.ts.map +1 -1
  11. package/out/processor/full-validation-processor.js +3 -0
  12. package/out/schema/basic-manifest-schema.json +9 -0
  13. package/out/schema/basic-manifest.d.ts +4 -0
  14. package/out/schema/display-conditions-schema.json +42 -0
  15. package/out/schema/manifest-schema.json +1876 -644
  16. package/out/schema/manifest.d.ts +1510 -872
  17. package/out/scopes/deprecated-shipyard-scopes.json +24 -0
  18. package/out/scopes/shipyard-scopes.json +314 -170
  19. package/out/text/errors.d.ts +3 -0
  20. package/out/text/errors.d.ts.map +1 -1
  21. package/out/text/errors.js +7 -4
  22. package/out/types/display-condition-types.d.ts +8 -0
  23. package/out/types/display-condition-types.d.ts.map +1 -1
  24. package/out/types/module-types.d.ts +12 -0
  25. package/out/types/module-types.d.ts.map +1 -1
  26. package/out/types/module-types.js +12 -0
  27. package/out/types/validation-types.d.ts +2 -1
  28. package/out/types/validation-types.d.ts.map +1 -1
  29. package/out/types/validation-types.js +1 -0
  30. package/out/validators/connect-authentication-validator.d.ts +7 -0
  31. package/out/validators/connect-authentication-validator.d.ts.map +1 -0
  32. package/out/validators/connect-authentication-validator.js +27 -0
  33. package/out/validators/deprecated-permissions-validator.d.ts +7 -0
  34. package/out/validators/deprecated-permissions-validator.d.ts.map +1 -0
  35. package/out/validators/deprecated-permissions-validator.js +31 -0
  36. package/out/validators/index.d.ts +1 -0
  37. package/out/validators/index.d.ts.map +1 -1
  38. package/out/validators/index.js +1 -0
  39. package/out/validators/modules-validator.d.ts.map +1 -1
  40. package/out/validators/modules-validator.js +7 -2
  41. package/out/validators/permissions-validator.d.ts.map +1 -1
  42. package/out/validators/permissions-validator.js +14 -8
  43. package/out/validators/resources-validator.d.ts.map +1 -1
  44. package/out/validators/resources-validator.js +26 -2
  45. package/package.json +3 -2
@@ -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",
@@ -21,9 +22,20 @@ export declare enum AllModuleTypes {
21
22
  JiraIssuePanel = "jira:issuePanel",
22
23
  JiraAdminPage = "jira:adminPage",
23
24
  JiraProjectPage = "jira:projectPage",
25
+ JiraProjectSettingsPage = "jira:projectSettingsPage",
26
+ JiraGlobalPage = "jira:globalPage",
24
27
  JiraDashboardGadget = "jira:dashboardGadget",
25
28
  CompassAdminPage = "compass:adminPage",
26
29
  CompassComponentPage = "compass:componentPage",
30
+ CompassGlobalPage = "compass:globalPage",
31
+ JiraServiceManagementQueuePage = "jiraServiceManagement:queuePage",
32
+ JiraServiceManagementPortalRequestDetail = "jiraServiceManagement:portalRequestDetail",
33
+ JiraServiceManagementPortalRequestDetailPanel = "jiraServiceManagement:portalRequestDetailPanel",
34
+ JiraServiceManagementOrganizationPanel = "jiraServiceManagement:organizationPanel",
35
+ JiraServiceManagementPortalHeader = "jiraServiceManagement:portalHeader",
36
+ JiraServiceManagementPortalSubheader = "jiraServiceManagement:portalSubheader",
37
+ JiraServiceManagementPortalFooter = "jiraServiceManagement:portalFooter",
38
+ JiraServiceManagementPortalUserMenuAction = "jiraServiceManagement:portalUserMenuAction",
27
39
  ConnectJiraAdminPages = "connect-jira:adminPages",
28
40
  ConnectJiraJiraBackgroundScripts = "connect-jira:jiraBackgroundScripts",
29
41
  ConnectJiraGeneralPages = "connect-jira:generalPages",
@@ -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;IACpC,mBAAmB,yBAAyB;IAC5C,gBAAgB,sBAAsB;IACtC,oBAAoB,0BAA0B;IAE9C,qBAAqB,4BAA4B;IACjD,gCAAgC,uCAAuC;IACvE,uBAAuB,8BAA8B;IACrD,6BAA6B,oCAAoC;IACjE,gCAAgC,uCAAuC;IACvE,0BAA0B,iCAAiC;IAC3D,2BAA2B,kCAAkC;IAC7D,oCAAoC,2CAA2C;IAC/E,+BAA+B,sCAAsC;IACrE,iCAAiC,wCAAwC;IACzE,oCAAoC,2CAA2C;IAC/E,4BAA4B,mCAAmC;IAC/D,mBAAmB,0BAA0B;IAC7C,oBAAoB,2BAA2B;IAC/C,2BAA2B,kCA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;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";
@@ -25,9 +26,20 @@ var AllModuleTypes;
25
26
  AllModuleTypes["JiraIssuePanel"] = "jira:issuePanel";
26
27
  AllModuleTypes["JiraAdminPage"] = "jira:adminPage";
27
28
  AllModuleTypes["JiraProjectPage"] = "jira:projectPage";
29
+ AllModuleTypes["JiraProjectSettingsPage"] = "jira:projectSettingsPage";
30
+ AllModuleTypes["JiraGlobalPage"] = "jira:globalPage";
28
31
  AllModuleTypes["JiraDashboardGadget"] = "jira:dashboardGadget";
29
32
  AllModuleTypes["CompassAdminPage"] = "compass:adminPage";
30
33
  AllModuleTypes["CompassComponentPage"] = "compass:componentPage";
34
+ AllModuleTypes["CompassGlobalPage"] = "compass:globalPage";
35
+ AllModuleTypes["JiraServiceManagementQueuePage"] = "jiraServiceManagement:queuePage";
36
+ AllModuleTypes["JiraServiceManagementPortalRequestDetail"] = "jiraServiceManagement:portalRequestDetail";
37
+ AllModuleTypes["JiraServiceManagementPortalRequestDetailPanel"] = "jiraServiceManagement:portalRequestDetailPanel";
38
+ AllModuleTypes["JiraServiceManagementOrganizationPanel"] = "jiraServiceManagement:organizationPanel";
39
+ AllModuleTypes["JiraServiceManagementPortalHeader"] = "jiraServiceManagement:portalHeader";
40
+ AllModuleTypes["JiraServiceManagementPortalSubheader"] = "jiraServiceManagement:portalSubheader";
41
+ AllModuleTypes["JiraServiceManagementPortalFooter"] = "jiraServiceManagement:portalFooter";
42
+ AllModuleTypes["JiraServiceManagementPortalUserMenuAction"] = "jiraServiceManagement:portalUserMenuAction";
31
43
  AllModuleTypes["ConnectJiraAdminPages"] = "connect-jira:adminPages";
32
44
  AllModuleTypes["ConnectJiraJiraBackgroundScripts"] = "connect-jira:jiraBackgroundScripts";
33
45
  AllModuleTypes["ConnectJiraGeneralPages"] = "connect-jira:generalPages";
@@ -1,6 +1,7 @@
1
1
  export declare enum ValidationTypes {
2
2
  BASIC = "basic",
3
3
  FULL = "full",
4
- PRODUCT_TRIGGER = "product-trigger"
4
+ PRODUCT_TRIGGER = "product-trigger",
5
+ DEPRECATED_CSP_METHOD = "deprecated-csp-method"
5
6
  }
6
7
  //# sourceMappingURL=validation-types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"validation-types.d.ts","sourceRoot":"","sources":["../../src/types/validation-types.ts"],"names":[],"mappings":"AAAA,oBAAY,eAAe;IACzB,KAAK,UAAU;IACf,IAAI,SAAS;IACb,eAAe,oBAAoB;CACpC"}
1
+ {"version":3,"file":"validation-types.d.ts","sourceRoot":"","sources":["../../src/types/validation-types.ts"],"names":[],"mappings":"AAAA,oBAAY,eAAe;IACzB,KAAK,UAAU;IACf,IAAI,SAAS;IACb,eAAe,oBAAoB;IACnC,qBAAqB,0BAA0B;CAChD"}
@@ -6,4 +6,5 @@ var ValidationTypes;
6
6
  ValidationTypes["BASIC"] = "basic";
7
7
  ValidationTypes["FULL"] = "full";
8
8
  ValidationTypes["PRODUCT_TRIGGER"] = "product-trigger";
9
+ ValidationTypes["DEPRECATED_CSP_METHOD"] = "deprecated-csp-method";
9
10
  })(ValidationTypes = exports.ValidationTypes || (exports.ValidationTypes = {}));
@@ -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;
@@ -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 DeprecatedPermissionsValidator implements ValidatorInterface<ManifestObject<ManifestSchema> | undefined, ManifestSchema> {
5
+ validate(manifest: ManifestObject<ManifestSchema> | undefined): ManifestValidationResult<ManifestSchema>;
6
+ }
7
+ //# sourceMappingURL=deprecated-permissions-validator.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"deprecated-permissions-validator.d.ts","sourceRoot":"","sources":["../../src/validators/deprecated-permissions-validator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAC3D,OAAO,EAAE,cAAc,EAAmB,wBAAwB,EAAE,MAAM,UAAU,CAAC;AACrF,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAKpD,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;CAoCzG"}
@@ -0,0 +1,31 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.DeprecatedPermissionsValidator = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const deprecated_shipyard_scopes_json_1 = tslib_1.__importDefault(require("../scopes/deprecated-shipyard-scopes.json"));
6
+ const text_1 = require("../text");
7
+ const utils_1 = require("../utils");
8
+ class DeprecatedPermissionsValidator {
9
+ validate(manifest) {
10
+ var _a, _b;
11
+ if (!((_a = manifest === null || manifest === void 0 ? void 0 : manifest.typedContent) === null || _a === void 0 ? void 0 : _a.permissions)) {
12
+ return {
13
+ success: false,
14
+ manifestObject: manifest
15
+ };
16
+ }
17
+ const validationErrors = [];
18
+ function addValidationError(element, value, schemaManifestObject) {
19
+ validationErrors.push(Object.assign({ message: text_1.errors.permissions.deprecatedPermission(element, value), reference: text_1.References.Permissions, level: 'warning' }, utils_1.findPosition(value[0], schemaManifestObject.yamlContentByLine)));
20
+ }
21
+ const deprecatedScopes = (_b = manifest.typedContent.permissions.scopes) === null || _b === void 0 ? void 0 : _b.filter((key) => deprecated_shipyard_scopes_json_1.default.includes(key));
22
+ if (deprecatedScopes && deprecatedScopes.length > 0) {
23
+ addValidationError('scopes', deprecatedScopes, manifest);
24
+ }
25
+ return {
26
+ success: validationErrors.length === 0,
27
+ errors: validationErrors
28
+ };
29
+ }
30
+ }
31
+ exports.DeprecatedPermissionsValidator = DeprecatedPermissionsValidator;
@@ -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":"modules-validator.d.ts","sourceRoot":"","sources":["../../src/validators/modules-validator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAkB,cAAc,EAAE,wBAAwB,EAAsC,MAAM,UAAU,CAAC;AAGxH,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAK3D,qBAAa,gBACX,YAAW,kBAAkB,CAAC,cAAc,CAAC,cAAc,CAAC,GAAG,SAAS,EAAE,cAAc,CAAC;IACzF,OAAO,CAAC,oBAAoB,CAA0C;IAEtE,QAAQ,CAAC,QAAQ,EAAE,cAAc,CAAC,cAAc,CAAC,GAAG,SAAS,GAAG,wBAAwB,CAAC,cAAc,CAAC;CAgMzG"}
1
+ {"version":3,"file":"modules-validator.d.ts","sourceRoot":"","sources":["../../src/validators/modules-validator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAkB,cAAc,EAAE,wBAAwB,EAAsC,MAAM,UAAU,CAAC;AAGxH,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAK3D,qBAAa,gBACX,YAAW,kBAAkB,CAAC,cAAc,CAAC,cAAc,CAAC,GAAG,SAAS,EAAE,cAAc,CAAC;IACzF,OAAO,CAAC,oBAAoB,CAA0C;IAEtE,QAAQ,CAAC,QAAQ,EAAE,cAAc,CAAC,cAAc,CAAC,GAAG,SAAS,GAAG,wBAAwB,CAAC,cAAc,CAAC;CAqMzG"}
@@ -55,7 +55,7 @@ class ModulesValidator {
55
55
  });
56
56
  });
57
57
  const moduleKeys = [];
58
- validModules.forEach((moduleKey) => {
58
+ Object.keys(modules).forEach((moduleKey) => {
59
59
  var _a;
60
60
  (_a = modules[moduleKey]) === null || _a === void 0 ? void 0 : _a.forEach((module) => moduleKeys.push(module.key));
61
61
  });
@@ -86,7 +86,12 @@ class ModulesValidator {
86
86
  validationErrors.push(Object.assign({ message: text_1.errors.modules.jiraWorkflow.invalidProperty(module.key), reference: text_1.References.Modules, level: 'error' }, utils_1.findPosition(module.key, yamlContentByLine)));
87
87
  }
88
88
  });
89
- [types_1.AllModuleTypes.JiraAdminPage, types_1.AllModuleTypes.JiraProjectPage].forEach((moduleType) => {
89
+ [
90
+ types_1.AllModuleTypes.JiraAdminPage,
91
+ types_1.AllModuleTypes.JiraProjectPage,
92
+ types_1.AllModuleTypes.JiraProjectSettingsPage,
93
+ types_1.AllModuleTypes.JiraGlobalPage
94
+ ].forEach((moduleType) => {
90
95
  const module = modules[moduleType];
91
96
  if (module && module.length > 1) {
92
97
  validationErrors.push(Object.assign({ message: text_1.errors.modules.fullPage.children(moduleType), reference: text_1.References.Modules, level: 'error' }, utils_1.findPosition(module[1].key, yamlContentByLine)));
@@ -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;AAK3D,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;CAwHzG"}
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"}
@@ -7,9 +7,10 @@ const text_1 = require("../text");
7
7
  const egress_types_1 = require("../types/egress-types");
8
8
  const url_1 = require("url");
9
9
  const shipyard_scopes_json_1 = tslib_1.__importDefault(require("../scopes/shipyard-scopes.json"));
10
+ const deprecated_shipyard_scopes_json_1 = tslib_1.__importDefault(require("../scopes/deprecated-shipyard-scopes.json"));
10
11
  class PermissionsValidator {
11
12
  validate(manifest) {
12
- 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;
13
14
  if (!manifest || !manifest.typedContent || !manifest.typedContent.permissions) {
14
15
  return {
15
16
  success: false,
@@ -54,7 +55,8 @@ class PermissionsValidator {
54
55
  return false;
55
56
  }
56
57
  }
57
- const invalidScope = (_a = manifest.typedContent.permissions.scopes) === null || _a === void 0 ? void 0 : _a.find((key) => !shipyard_scopes_json_1.default.includes(key));
58
+ const ALL_SCOPES = shipyard_scopes_json_1.default.concat(deprecated_shipyard_scopes_json_1.default);
59
+ const invalidScope = (_a = manifest.typedContent.permissions.scopes) === null || _a === void 0 ? void 0 : _a.find((key) => !ALL_SCOPES.includes(key));
58
60
  if (invalidScope) {
59
61
  addValidationError('scopes', invalidScope, manifest);
60
62
  }
@@ -71,23 +73,27 @@ class PermissionsValidator {
71
73
  if (invalidBackendRemote) {
72
74
  addValidationError('external.fetch.backend', invalidBackendRemote.remote, manifest);
73
75
  }
74
- 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)));
75
81
  if (invalidClient) {
76
- addValidationError('external.fetch.client', invalidClient, manifest);
82
+ addValidationError('external.fetch.client', invalidClient.remote, manifest);
77
83
  }
78
- 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));
79
85
  if (invalidNavigation) {
80
86
  addValidationError('external.navigation', invalidNavigation, manifest);
81
87
  }
82
- 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));
83
89
  if (invalidImages) {
84
90
  addValidationError('external.images', invalidImages, manifest);
85
91
  }
86
- 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));
87
93
  if (invalidMedia) {
88
94
  addValidationError('external.media', invalidMedia, manifest);
89
95
  }
90
- 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));
91
97
  if (invalidExternalScripts) {
92
98
  addValidationError('external.scripts', invalidExternalScripts, manifest);
93
99
  }
@@ -1 +1 @@
1
- {"version":3,"file":"resources-validator.d.ts","sourceRoot":"","sources":["../../src/validators/resources-validator.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAE,wBAAwB,EAAmB,MAAM,UAAU,CAAC;AAGrF,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAK3D,qBAAa,kBACX,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;CAqGzG"}
1
+ {"version":3,"file":"resources-validator.d.ts","sourceRoot":"","sources":["../../src/validators/resources-validator.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,cAAc,EAAE,wBAAwB,EAAmB,MAAM,UAAU,CAAC;AAGrF,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAK3D,qBAAa,kBACX,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;CAgIzG"}
@@ -4,6 +4,7 @@ exports.ResourcesValidator = void 0;
4
4
  const tslib_1 = require("tslib");
5
5
  const fs_1 = tslib_1.__importDefault(require("fs"));
6
6
  const path_1 = require("path");
7
+ const cheerio_1 = tslib_1.__importDefault(require("cheerio"));
7
8
  const utils_1 = require("../utils");
8
9
  const text_1 = require("../text");
9
10
  const utils_2 = require("../utils");
@@ -41,8 +42,31 @@ class ResourcesValidator {
41
42
  utils_1.getValidModules(modules).forEach((moduleKey) => {
42
43
  const uniquePaths = new Set(modules[moduleKey].map(({ resource }) => resourceMap.get(resource)));
43
44
  uniquePaths.forEach((path) => {
44
- if (path && !fs_1.default.existsSync(path_1.resolve(manifestDir, path, 'index.html'))) {
45
- validationErrors.push(Object.assign({ message: text_1.errors.resources.missingEntrypoint(path, moduleKey), reference: text_1.References.Resources, level: 'error' }, utils_1.findPosition(path, yamlContentByLine)));
45
+ var _a, _b, _c;
46
+ if (path) {
47
+ if (!fs_1.default.existsSync(path_1.resolve(manifestDir, path, 'index.html'))) {
48
+ validationErrors.push(Object.assign({ message: text_1.errors.resources.missingEntrypoint(path, moduleKey), reference: text_1.References.Resources, level: 'error' }, utils_1.findPosition(path, yamlContentByLine)));
49
+ }
50
+ else {
51
+ const content = fs_1.default.readFileSync(path_1.resolve(manifestDir, path, 'index.html'));
52
+ const $ = cheerio_1.default.load(content);
53
+ const cspContent = $('meta[http-equiv="Content-Security-Policy"]').attr('content');
54
+ if (cspContent) {
55
+ const cspStyleSrc = cspContent.split(';').find((s) => s.startsWith('style-src'));
56
+ if (cspStyleSrc === null || cspStyleSrc === void 0 ? void 0 : cspStyleSrc.includes("'unsafe-inline'")) {
57
+ const existingStylesPermissions = (_c = (_b = (_a = manifest.typedContent) === null || _a === void 0 ? void 0 : _a.permissions) === null || _b === void 0 ? void 0 : _b.content) === null || _c === void 0 ? void 0 : _c.styles;
58
+ let shouldShowError = false;
59
+ if (!(existingStylesPermissions === null || existingStylesPermissions === void 0 ? void 0 : existingStylesPermissions.length) || !(existingStylesPermissions === null || existingStylesPermissions === void 0 ? void 0 : existingStylesPermissions.includes('unsafe-inline'))) {
60
+ shouldShowError = true;
61
+ }
62
+ if (shouldShowError) {
63
+ validationErrors.push(Object.assign({ message: text_1.errors.resources.deprecatedCspPolicyDefinition(path), reference: text_1.References.Resources, level: 'error', metadata: {
64
+ missingContentStylePermission: 'unsafe-inline'
65
+ } }, utils_1.findPosition(path, yamlContentByLine)));
66
+ }
67
+ }
68
+ }
69
+ }
46
70
  }
47
71
  });
48
72
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@forge/manifest",
3
- "version": "0.0.0-experimental-9fff5da",
3
+ "version": "0.0.0-experimental-7c72fec",
4
4
  "description": "Definitions and validations of the Forge manifest",
5
5
  "main": "out/index.js",
6
6
  "scripts": {
@@ -23,8 +23,9 @@
23
23
  "author": "Atlassian",
24
24
  "license": "UNLICENSED",
25
25
  "dependencies": {
26
- "@forge/util": "1.0.0",
26
+ "@forge/util": "1.0.1",
27
27
  "ajv": "^6.12.5",
28
+ "cheerio": "^0.22.0",
28
29
  "js-yaml": "^3.13.1",
29
30
  "json-schema-to-typescript": "^9.1.1",
30
31
  "node-fetch": "^2.6.1",