@forge/manifest 7.2.0-next.1 → 7.2.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.
Files changed (46) hide show
  1. package/CHANGELOG.md +17 -0
  2. package/out/builder/processor-builder.js +1 -2
  3. package/out/processor/abstract-validation-processor.js +2 -2
  4. package/out/scopes/index.js +7 -6
  5. package/out/text/errors.d.ts +0 -1
  6. package/out/text/errors.d.ts.map +1 -1
  7. package/out/text/errors.js +1 -2
  8. package/out/utils/index.d.ts +0 -1
  9. package/out/utils/index.d.ts.map +1 -1
  10. package/out/utils/index.js +0 -1
  11. package/out/utils/module-references.js +1 -1
  12. package/out/validators/app-features-validator.js +4 -8
  13. package/out/validators/connect-authentication-validator.js +4 -8
  14. package/out/validators/connect-modules-validator.js +3 -18
  15. package/out/validators/connect-remote-validator.js +7 -16
  16. package/out/validators/data-classification-validator.js +5 -8
  17. package/out/validators/display-conditions-validator.js +7 -8
  18. package/out/validators/entity-property-validator.js +6 -9
  19. package/out/validators/jql-function-validator.js +6 -9
  20. package/out/validators/modules-validator.js +49 -136
  21. package/out/validators/modules-validators/bitbucket/validateBackendModuleEndpoints.js +8 -16
  22. package/out/validators/modules-validators/confluence/validateCrossModulePropertyUniqueness.js +2 -6
  23. package/out/validators/modules-validators/confluence/validateCustomContentHierarchy.js +2 -12
  24. package/out/validators/modules-validators/confluence/validateKeyboardShortcuts.js +2 -7
  25. package/out/validators/modules-validators/confluence/validatePropertyUniqueness.js +2 -6
  26. package/out/validators/modules-validators/confluence/validateSingleProperty.js +1 -6
  27. package/out/validators/modules-validators/jira/ui-modifications.js +1 -6
  28. package/out/validators/modules-validators/jira/validate-full-admin-page.js +11 -21
  29. package/out/validators/modules-validators/jira/validate-subpages-in-module.js +2 -12
  30. package/out/validators/modules-validators/remote/validate-storage-operation.js +4 -8
  31. package/out/validators/modules-validators/validateModuleScopes.js +2 -7
  32. package/out/validators/package-validator.js +2 -1
  33. package/out/validators/permissions-validator.js +24 -32
  34. package/out/validators/product-trigger-scopes-validator.js +6 -11
  35. package/out/validators/providers-validator.js +16 -35
  36. package/out/validators/resources-validator.js +15 -54
  37. package/out/validators/schema-validator.js +84 -104
  38. package/out/validators/snapshot-validator.js +4 -3
  39. package/out/validators/storage-validator.js +14 -41
  40. package/out/validators/yaml-validator.d.ts +0 -2
  41. package/out/validators/yaml-validator.d.ts.map +1 -1
  42. package/out/validators/yaml-validator.js +6 -10
  43. package/package.json +1 -2
  44. package/out/utils/manifest-parser.d.ts +0 -15
  45. package/out/utils/manifest-parser.d.ts.map +0 -1
  46. package/out/utils/manifest-parser.js +0 -42
package/CHANGELOG.md CHANGED
@@ -1,5 +1,22 @@
1
1
  # @forge/manifest
2
2
 
3
+ ## 7.2.0
4
+
5
+ ### Minor Changes
6
+
7
+ - d72f638: Add support for new live page events (page started and page snapshotted)
8
+ - 9eee9ac: external oauth2 scope name must have no space
9
+
10
+ ### Patch Changes
11
+
12
+ - 937db7a: Rollback manifest env var support
13
+
14
+ ## 7.2.0-next.2
15
+
16
+ ### Patch Changes
17
+
18
+ - 937db7a: Rollback manifest env var support
19
+
3
20
  ## 7.2.0-next.1
4
21
 
5
22
  ### Minor Changes
@@ -6,8 +6,6 @@ const processor_1 = require("../processor");
6
6
  const deprecated_csp_method_validation_processor_1 = require("../processor/deprecated-csp-method-validation-processor");
7
7
  const remote_compute_validation_processor_1 = require("../processor/remote-compute-validation-processor");
8
8
  class ProcessorBuilder {
9
- static cache = new Map();
10
- validationType;
11
9
  constructor() {
12
10
  this.validationType = types_1.ValidationTypes.FULL;
13
11
  }
@@ -45,3 +43,4 @@ class ProcessorBuilder {
45
43
  }
46
44
  }
47
45
  exports.ProcessorBuilder = ProcessorBuilder;
46
+ ProcessorBuilder.cache = new Map();
@@ -2,16 +2,16 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.AbstractValidationProcessor = void 0;
4
4
  class AbstractValidationProcessor {
5
- validators;
6
5
  constructor(validators) {
7
6
  this.validators = validators;
8
7
  }
9
8
  async process(manifest) {
9
+ var _a;
10
10
  let results = {
11
11
  success: true
12
12
  };
13
13
  for (const validator of this.validators) {
14
- const stepResults = await validator.validate(results.manifestObject ?? manifest);
14
+ const stepResults = await validator.validate((_a = results.manifestObject) !== null && _a !== void 0 ? _a : manifest);
15
15
  results = {
16
16
  success: results.success && stepResults.success,
17
17
  manifestObject: stepResults.manifestObject || results.manifestObject,
@@ -4,19 +4,20 @@ exports.getScopesWithInteractiveConsent = exports.getMissingScopes = void 0;
4
4
  const tslib_1 = require("tslib");
5
5
  const shipyard_scopes_with_interactive_consent_json_1 = tslib_1.__importDefault(require("./shipyard-scopes-with-interactive-consent.json"));
6
6
  async function getMissingScopes(existing, required) {
7
- if (!existing?.length) {
7
+ var _a, _b;
8
+ if (!(existing === null || existing === void 0 ? void 0 : existing.length)) {
8
9
  return required.current;
9
10
  }
10
11
  if (required.current.length === 0)
11
12
  return [];
12
- const missingCurrent = required.current.filter((scope) => !existing?.includes(scope));
13
+ const missingCurrent = required.current.filter((scope) => !(existing === null || existing === void 0 ? void 0 : existing.includes(scope)));
13
14
  if (missingCurrent.length === 0)
14
15
  return [];
15
- const missingBeta = required.beta?.filter((scope) => !existing?.includes(scope));
16
- if (required.beta && missingBeta?.length === 0)
16
+ const missingBeta = (_a = required.beta) === null || _a === void 0 ? void 0 : _a.filter((scope) => !(existing === null || existing === void 0 ? void 0 : existing.includes(scope)));
17
+ if (required.beta && (missingBeta === null || missingBeta === void 0 ? void 0 : missingBeta.length) === 0)
17
18
  return [];
18
- const missingDeprecated = required.deprecated?.filter((scope) => !existing?.includes(scope));
19
- if (required.deprecated && missingDeprecated?.length === 0)
19
+ const missingDeprecated = (_b = required.deprecated) === null || _b === void 0 ? void 0 : _b.filter((scope) => !(existing === null || existing === void 0 ? void 0 : existing.includes(scope)));
20
+ if (required.deprecated && (missingDeprecated === null || missingDeprecated === void 0 ? void 0 : missingDeprecated.length) === 0)
20
21
  return [];
21
22
  return missingCurrent;
22
23
  }
@@ -9,7 +9,6 @@ export declare const errors: {
9
9
  deprecatedValue: (section: string, field: string, additionalInfo?: string) => string;
10
10
  additionalProperties: (additionalProperty: string) => string;
11
11
  notAllowed: (props: string[] | undefined) => string;
12
- missingEnvironmentVariable: (variable: string) => string;
13
12
  };
14
13
  permissions: {
15
14
  invalidPermission: (element: string, value: string) => string;
@@ -1 +1 @@
1
- {"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../src/text/errors.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAG1C,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,mBAAmB,MAAM,KAAG,MAAM;mDAIvC,MAAM,KAAG,MAAM;4BAEtC,MAAM,EAAE,GAAG,SAAS,KAAG,MAAM;+CAIV,MAAM;;;qCAGhB,MAAM,SAAS,MAAM,KAAG,MAAM;4CAEvB,MAAM,SAAS,MAAM,KAAG,MAAM;oDAEtB,MAAM,OAAO,MAAM,KAAG,MAAM;wCAExC,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;yCAEpC,MAAM,eAAe,MAAM,KAAG,MAAM;oCAEzC,MAAM;6CACG,MAAM,KAAG,MAAM;0EAEc,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;+BACvB,MAAM,OAAO,MAAM,KAAG,MAAM;;;;;;;;kCASzB,MAAM,UAAU,MAAM,KAAG,MAAM;gCAEjC,MAAM,KAAG,MAAM;2CAEJ,MAAM,eAAe,MAAM,KAAG,MAAM;;;uCAI1C,MAAM;uCAEJ,MAAM,KAAG,MAAM;qCAEnB,MAAM;;6CAGA,MAAM;;;mDAIE,MAAM,KAAG,MAAM;;;;4CAKxB,MAAM,SAAS,MAAM,KAAG,MAAM;4CAE9B,MAAM,KAAG,MAAM;4CACf,MAAM,SAAS,MAAM,KAAG,MAAM;+CAE3B,MAAM,aAAa,MAAM,SAAS,MAAM,KAAG,MAAM;yCAEvD,MAAM,SAAS,MAAM,KAAG,MAAM;4CAE3B,MAAM,SAAS,MAAM,KAAG,MAAM;gDAE1B,MAAM,aAAa,MAAM,KAAG,MAAM;4CAEtC,MAAM,SAAS,MAAM,KAAG,MAAM;;;2CAI7B,MAAM;;;gCAInB,MAAM;;;;CAI7B,CAAC;AAEF,oBAAY,UAAU;IACpB,eAAe,2BAA2B;IAC1C,eAAe,wBAAwB;IACvC,WAAW,4BAA4B;IACvC,WAAW,+BAA+B;IAC1C,aAAa,8BAA8B;IAC3C,OAAO,0BAA0B;IACjC,cAAc,kCAAkC;IAChD,mBAAmB,0BAA0B;IAC7C,SAAS,4BAA4B;IACrC,SAAS,4BAA4B;IACrC,UAAU,wBAAwB;IAClC,GAAG,8BAA8B;IACjC,eAAe,0BAA0B;CAC1C"}
@@ -21,8 +21,7 @@ exports.errors = {
21
21
  additionalProperties: (additionalProperty) => `should NOT have additional property '${additionalProperty}'`,
22
22
  notAllowed: (props) => props
23
23
  ? `does not support the following Forge properties - ${props.map((v) => "'" + v + "'").join(', ')}`
24
- : 'provided properties do not match schema. Learn more about modules at https://go.atlassian.com/forge-modules',
25
- missingEnvironmentVariable: (variable) => `could not find environment variable '${variable}'`
24
+ : 'provided properties do not match schema. Learn more about modules at https://go.atlassian.com/forge-modules'
26
25
  },
27
26
  permissions: {
28
27
  invalidPermission: (element, value) => `Invalid '${element}' permission in the manifest.yml file - '${value}'. Learn more about permissions at: https://go.atlassian.com/forge-permissions.`,
@@ -2,5 +2,4 @@ export * from './get-all-modules';
2
2
  export * from './line-finder';
3
3
  export * from './module-key-cleaner';
4
4
  export * from './module-references';
5
- export * from './manifest-parser';
6
5
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC;AAClC,cAAc,eAAe,CAAC;AAC9B,cAAc,sBAAsB,CAAC;AACrC,cAAc,qBAAqB,CAAC;AACpC,cAAc,mBAAmB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC;AAClC,cAAc,eAAe,CAAC;AAC9B,cAAc,sBAAsB,CAAC;AACrC,cAAc,qBAAqB,CAAC"}
@@ -5,4 +5,3 @@ tslib_1.__exportStar(require("./get-all-modules"), exports);
5
5
  tslib_1.__exportStar(require("./line-finder"), exports);
6
6
  tslib_1.__exportStar(require("./module-key-cleaner"), exports);
7
7
  tslib_1.__exportStar(require("./module-references"), exports);
8
- tslib_1.__exportStar(require("./manifest-parser"), exports);
@@ -4,7 +4,7 @@ exports.findInvalidEndpointReferences = exports.findInvalidResourceReferences =
4
4
  const findInvalidReferenceKeys = (property, module, functionsOrResources) => {
5
5
  const invalidFunctions = [];
6
6
  const _checkFunctionKey = (functionKey) => {
7
- if (functionKey && !functionsOrResources?.find((func) => func.key === functionKey)) {
7
+ if (functionKey && !(functionsOrResources === null || functionsOrResources === void 0 ? void 0 : functionsOrResources.find((func) => func.key === functionKey))) {
8
8
  invalidFunctions.push(functionKey);
9
9
  }
10
10
  };
@@ -5,15 +5,11 @@ const text_1 = require("../text");
5
5
  const utils_1 = require("../utils");
6
6
  class AppFeaturesValidator {
7
7
  async validate(manifest) {
8
- const app = manifest?.typedContent?.app;
8
+ var _a, _b;
9
+ const app = (_a = manifest === null || manifest === void 0 ? void 0 : manifest.typedContent) === null || _a === void 0 ? void 0 : _a.app;
9
10
  const validationErrors = [];
10
- if (app?.features?.autoUserConsent !== undefined) {
11
- validationErrors.push({
12
- message: text_1.errors.app.features.deprecatedAutoUserConsent(),
13
- reference: text_1.References.Deprecated,
14
- level: 'warning',
15
- ...(0, utils_1.findPosition)('autoUserConsent', manifest?.yamlContentByLine)
16
- });
11
+ if (((_b = app === null || app === void 0 ? void 0 : app.features) === null || _b === void 0 ? void 0 : _b.autoUserConsent) !== undefined) {
12
+ validationErrors.push(Object.assign({ message: text_1.errors.app.features.deprecatedAutoUserConsent(), reference: text_1.References.Deprecated, level: 'warning' }, (0, utils_1.findPosition)('autoUserConsent', manifest === null || manifest === void 0 ? void 0 : manifest.yamlContentByLine)));
17
13
  }
18
14
  return {
19
15
  success: validationErrors.length === 0,
@@ -5,7 +5,8 @@ const text_1 = require("../text");
5
5
  const utils_1 = require("../utils");
6
6
  class ConnectAuthenticationValidator {
7
7
  async validate(manifest) {
8
- if (!manifest?.typedContent?.app) {
8
+ var _a, _b;
9
+ if (!((_a = manifest === null || manifest === void 0 ? void 0 : manifest.typedContent) === null || _a === void 0 ? void 0 : _a.app)) {
9
10
  return {
10
11
  success: false,
11
12
  manifestObject: manifest
@@ -13,13 +14,8 @@ class ConnectAuthenticationValidator {
13
14
  }
14
15
  const app = manifest.typedContent.app;
15
16
  const validationErrors = [];
16
- if (!manifest.typedContent.connectModules && app?.connect?.authentication) {
17
- validationErrors.push({
18
- message: text_1.errors.app.missingConnectModules(),
19
- reference: text_1.References.App,
20
- level: 'error',
21
- ...(0, utils_1.findPosition)('connect', manifest.yamlContentByLine)
22
- });
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' }, (0, utils_1.findPosition)('connect', manifest.yamlContentByLine)));
23
19
  }
24
20
  return {
25
21
  success: validationErrors.length === 0,
@@ -20,35 +20,20 @@ class ConnectModulesValidator {
20
20
  connectModuleNames
21
21
  .filter((name) => !validconnectModuleNames.includes(name))
22
22
  .forEach((invalidName) => {
23
- validationErrors.push({
24
- message: text_1.errors.connectModules.invalidConnectModule(invalidName),
25
- reference: text_1.References.ConnectModules,
26
- level: 'error',
27
- ...(0, utils_1.findPosition)(invalidName, yamlContentByLine, 'connectModules')
28
- });
23
+ validationErrors.push(Object.assign({ message: text_1.errors.connectModules.invalidConnectModule(invalidName), reference: text_1.References.ConnectModules, level: 'error' }, (0, utils_1.findPosition)(invalidName, yamlContentByLine, 'connectModules')));
29
24
  });
30
25
  const modules = connectModuleNames.map((moduleName) => connectModules[moduleName]);
31
26
  const moduleKeys = [].concat(...modules).map((item) => item.key);
32
27
  const duplicateKeys = [...new Set(moduleKeys.filter((item, index) => moduleKeys.indexOf(item) != index))];
33
28
  duplicateKeys.forEach((duplicateKey) => {
34
- validationErrors.push({
35
- message: text_1.errors.connectModules.duplicateKeyFound(duplicateKey),
36
- reference: text_1.References.ConnectModules,
37
- level: 'error',
38
- ...(0, utils_1.findPosition)(duplicateKey, yamlContentByLine)
39
- });
29
+ validationErrors.push(Object.assign({ message: text_1.errors.connectModules.duplicateKeyFound(duplicateKey), reference: text_1.References.ConnectModules, level: 'error' }, (0, utils_1.findPosition)(duplicateKey, yamlContentByLine)));
40
30
  });
41
31
  const lifecycleModules = connectModuleNames.filter((m) => m.endsWith(':lifecycle'));
42
32
  if (lifecycleModules) {
43
33
  lifecycleModules.forEach((lifecycle) => {
44
34
  const lifecycleModule = connectModules[lifecycle];
45
35
  if (Array.isArray(lifecycleModule) && lifecycleModule.length > 1) {
46
- validationErrors.push({
47
- message: text_1.errors.connectModules.duplicatateLifecycleFound(lifecycle),
48
- reference: text_1.References.ConnectModules,
49
- level: 'error',
50
- ...(0, utils_1.findPosition)(lifecycle, yamlContentByLine)
51
- });
36
+ validationErrors.push(Object.assign({ message: text_1.errors.connectModules.duplicatateLifecycleFound(lifecycle), reference: text_1.References.ConnectModules, level: 'error' }, (0, utils_1.findPosition)(lifecycle, yamlContentByLine)));
52
37
  }
53
38
  });
54
39
  }
@@ -5,7 +5,8 @@ const text_1 = require("../text");
5
5
  const utils_1 = require("../utils");
6
6
  class ConnectRemoteValidator {
7
7
  async validate(manifest) {
8
- if (!manifest?.typedContent?.app) {
8
+ var _a, _b, _c, _d, _e;
9
+ if (!((_a = manifest === null || manifest === void 0 ? void 0 : manifest.typedContent) === null || _a === void 0 ? void 0 : _a.app)) {
9
10
  return {
10
11
  success: false,
11
12
  manifestObject: manifest
@@ -13,23 +14,13 @@ class ConnectRemoteValidator {
13
14
  }
14
15
  const app = manifest.typedContent.app;
15
16
  const validationErrors = [];
16
- if (manifest.typedContent.connectModules && !app.connect?.remote) {
17
- validationErrors.push({
18
- message: text_1.errors.app.missingAppConnectRemote(),
19
- reference: text_1.References.App,
20
- level: 'error',
21
- ...(0, utils_1.findPosition)('connect', manifest.yamlContentByLine)
22
- });
17
+ if (manifest.typedContent.connectModules && !((_b = app.connect) === null || _b === void 0 ? void 0 : _b.remote)) {
18
+ validationErrors.push(Object.assign({ message: text_1.errors.app.missingAppConnectRemote(), reference: text_1.References.App, level: 'error' }, (0, utils_1.findPosition)('connect', manifest.yamlContentByLine)));
23
19
  }
24
20
  if (manifest.typedContent.connectModules &&
25
- app?.connect?.remote &&
26
- !manifest.typedContent.remotes?.find((remote) => remote.key === app?.connect?.remote)) {
27
- validationErrors.push({
28
- message: text_1.errors.app.missingRemoteForConnect(app?.connect?.remote || 'undefined'),
29
- reference: text_1.References.App,
30
- level: 'error',
31
- ...(0, utils_1.findPosition)('connect', manifest.yamlContentByLine)
32
- });
21
+ ((_c = app === null || app === void 0 ? void 0 : app.connect) === null || _c === void 0 ? void 0 : _c.remote) &&
22
+ !((_d = manifest.typedContent.remotes) === null || _d === void 0 ? void 0 : _d.find((remote) => { var _a; return remote.key === ((_a = app === null || app === void 0 ? void 0 : app.connect) === null || _a === void 0 ? void 0 : _a.remote); }))) {
23
+ validationErrors.push(Object.assign({ message: text_1.errors.app.missingRemoteForConnect(((_e = app === null || app === void 0 ? void 0 : app.connect) === null || _e === void 0 ? void 0 : _e.remote) || 'undefined'), reference: text_1.References.App, level: 'error' }, (0, utils_1.findPosition)('connect', manifest.yamlContentByLine)));
33
24
  }
34
25
  return {
35
26
  success: validationErrors.length === 0,
@@ -5,7 +5,8 @@ const text_1 = require("../text");
5
5
  const utils_1 = require("../utils");
6
6
  class DataClassificationValidator {
7
7
  async validate(manifest) {
8
- if (!manifest?.typedContent?.remotes) {
8
+ var _a;
9
+ if (!((_a = manifest === null || manifest === void 0 ? void 0 : manifest.typedContent) === null || _a === void 0 ? void 0 : _a.remotes)) {
9
10
  return {
10
11
  success: true,
11
12
  manifestObject: manifest
@@ -13,13 +14,9 @@ class DataClassificationValidator {
13
14
  }
14
15
  const validationErrors = [];
15
16
  manifest.typedContent.remotes.forEach((remote) => {
16
- if (remote.operations && remote.operations.includes('storage') && !remote.storage?.inScopeEUD) {
17
- validationErrors.push({
18
- message: text_1.errors.app.remotes.missingRemotesStorageInScopeEUD(remote.key),
19
- reference: text_1.References.App,
20
- level: 'error',
21
- ...(0, utils_1.findPosition)(remote.key, manifest.yamlContentByLine)
22
- });
17
+ var _a;
18
+ if (remote.operations && remote.operations.includes('storage') && !((_a = remote.storage) === null || _a === void 0 ? void 0 : _a.inScopeEUD)) {
19
+ validationErrors.push(Object.assign({ message: text_1.errors.app.remotes.missingRemotesStorageInScopeEUD(remote.key), reference: text_1.References.App, level: 'error' }, (0, utils_1.findPosition)(remote.key, manifest.yamlContentByLine)));
23
20
  }
24
21
  });
25
22
  return {
@@ -7,17 +7,14 @@ const text_1 = require("../text");
7
7
  const isPlainObject = (obj) => Object.prototype.toString.call(obj) === '[object Object]';
8
8
  const errors = text_1.errors.modules.displayConditions;
9
9
  class DisplayConditionsValidator {
10
- schema;
11
- validateSchema;
12
- moduleSchemas;
13
- supportedOperations;
14
10
  constructor(schema) {
11
+ var _a, _b, _c;
15
12
  this.schema = schema;
16
13
  const ajv = new ajv_1.default({ allErrors: true, verbose: true, strict: false });
17
14
  this.validateSchema = ajv.compile(this.schema);
18
15
  const properties = this.schema.properties;
19
- this.moduleSchemas = properties.modules?.properties;
20
- this.supportedOperations = properties.operations?.items?.enum;
16
+ this.moduleSchemas = (_a = properties.modules) === null || _a === void 0 ? void 0 : _a.properties;
17
+ this.supportedOperations = (_c = (_b = properties.operations) === null || _b === void 0 ? void 0 : _b.items) === null || _c === void 0 ? void 0 : _c.enum;
21
18
  }
22
19
  flattenDisplayConditions(moduleKey, displayConditions, nesting = 0) {
23
20
  if (nesting >= 10) {
@@ -72,7 +69,8 @@ class DisplayConditionsValidator {
72
69
  }
73
70
  };
74
71
  Object.keys(this.moduleSchemas).forEach((m) => {
75
- modules[m]?.forEach((module) => {
72
+ var _a;
73
+ (_a = modules[m]) === null || _a === void 0 ? void 0 : _a.forEach((module) => {
76
74
  if (!module.displayConditions) {
77
75
  return;
78
76
  }
@@ -89,8 +87,9 @@ class DisplayConditionsValidator {
89
87
  return;
90
88
  }
91
89
  displayConditions.forEach((result) => {
90
+ var _a;
92
91
  void this.validateSchema({ modules: { [m]: result } });
93
- this.validateSchema.errors?.forEach((error) => {
92
+ (_a = this.validateSchema.errors) === null || _a === void 0 ? void 0 : _a.forEach((error) => {
94
93
  const { keyword, instancePath, params, message } = error;
95
94
  const split = instancePath.split('/');
96
95
  const path = String(split.pop());
@@ -5,21 +5,18 @@ const types_1 = require("../types");
5
5
  const text_1 = require("../text");
6
6
  const utils_1 = require("../utils");
7
7
  const isManifestWithModules = (manifest) => {
8
- return !!manifest?.typedContent?.['modules'];
8
+ var _a;
9
+ return !!((_a = manifest === null || manifest === void 0 ? void 0 : manifest.typedContent) === null || _a === void 0 ? void 0 : _a['modules']);
9
10
  };
10
11
  class EntityPropertyValidator {
11
12
  async validate(manifest) {
13
+ var _a;
12
14
  const validationErrors = [];
13
- if (manifest?.typedContent && isManifestWithModules(manifest)) {
15
+ if ((manifest === null || manifest === void 0 ? void 0 : manifest.typedContent) && isManifestWithModules(manifest)) {
14
16
  const { yamlContentByLine, typedContent: { modules } } = manifest;
15
- const appValuesLength = modules[types_1.AllModuleTypes.JiraEntityProperty]?.reduce((acc, module) => acc + module.values.length, 0) || 0;
17
+ const appValuesLength = ((_a = modules[types_1.AllModuleTypes.JiraEntityProperty]) === null || _a === void 0 ? void 0 : _a.reduce((acc, module) => acc + module.values.length, 0)) || 0;
16
18
  if (appValuesLength > 30) {
17
- validationErrors.push({
18
- message: text_1.errors.modules.jiraEntityProperty.maxExtractionsPerApp(30),
19
- reference: text_1.References.Modules,
20
- level: 'error',
21
- ...(0, utils_1.findPosition)('app', yamlContentByLine)
22
- });
19
+ validationErrors.push(Object.assign({ message: text_1.errors.modules.jiraEntityProperty.maxExtractionsPerApp(30), reference: text_1.References.Modules, level: 'error' }, (0, utils_1.findPosition)('app', yamlContentByLine)));
23
20
  }
24
21
  }
25
22
  return {
@@ -5,14 +5,16 @@ const types_1 = require("../types");
5
5
  const text_1 = require("../text");
6
6
  const utils_1 = require("../utils");
7
7
  const isManifestWithModules = (manifest) => {
8
- return !!manifest?.typedContent?.['modules'];
8
+ var _a;
9
+ return !!((_a = manifest === null || manifest === void 0 ? void 0 : manifest.typedContent) === null || _a === void 0 ? void 0 : _a['modules']);
9
10
  };
10
11
  class JqlFunctionValidator {
11
12
  async validate(manifest) {
13
+ var _a;
12
14
  const validationErrors = [];
13
- if (manifest?.typedContent && isManifestWithModules(manifest)) {
15
+ if ((manifest === null || manifest === void 0 ? void 0 : manifest.typedContent) && isManifestWithModules(manifest)) {
14
16
  const { yamlContentByLine, typedContent: { modules } } = manifest;
15
- const functionNames = modules[types_1.AllModuleTypes.JiraJqlFunction]?.map((m) => m.name) || [];
17
+ const functionNames = ((_a = modules[types_1.AllModuleTypes.JiraJqlFunction]) === null || _a === void 0 ? void 0 : _a.map((m) => m.name)) || [];
16
18
  const lowerCaseFunctionNames = functionNames.map((name) => name.toLowerCase());
17
19
  const lowerCaseNameToActualName = {};
18
20
  const lowerCaseDuplicateNames = [
@@ -24,12 +26,7 @@ class JqlFunctionValidator {
24
26
  }))
25
27
  ];
26
28
  if (lowerCaseDuplicateNames.length > 0) {
27
- validationErrors.push({
28
- message: text_1.errors.modules.jiraJqlFunction.duplicateFunctionNames(lowerCaseDuplicateNames.map((lowerCaseName) => lowerCaseNameToActualName[lowerCaseName])),
29
- reference: text_1.References.Modules,
30
- level: 'error',
31
- ...(0, utils_1.findPosition)(lowerCaseNameToActualName[lowerCaseDuplicateNames[0]], yamlContentByLine)
32
- });
29
+ validationErrors.push(Object.assign({ message: text_1.errors.modules.jiraJqlFunction.duplicateFunctionNames(lowerCaseDuplicateNames.map((lowerCaseName) => lowerCaseNameToActualName[lowerCaseName])), reference: text_1.References.Modules, level: 'error' }, (0, utils_1.findPosition)(lowerCaseNameToActualName[lowerCaseDuplicateNames[0]], yamlContentByLine)));
33
30
  }
34
31
  }
35
32
  return {