@forge/manifest 3.5.0-next.2 → 3.5.0-next.3

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 CHANGED
@@ -1,5 +1,11 @@
1
1
  # @forge/manifest
2
2
 
3
+ ## 3.5.0-next.3
4
+
5
+ ### Minor Changes
6
+
7
+ - d094c69: [CONFDEV-79785] Add manifest validation for confluence:globalSettings new, optional, useAsConfig property to ensure it's only designated once
8
+
3
9
  ## 3.5.0-next.2
4
10
 
5
11
  ### Patch Changes
@@ -33,6 +33,11 @@ export declare const errors: {
33
33
  propertyNotAllowed: (moduleKey: string, propertyName: string) => string;
34
34
  typeMismatch: (moduleKey: string, propertyName: string, errorDetails: string) => string;
35
35
  };
36
+ confluence: {
37
+ globalSettingsValidator: {
38
+ multipleUseAsConfig: (keys: string[]) => string;
39
+ };
40
+ };
36
41
  jiraWorkflowValidator: {
37
42
  missingProperty: (key: string) => string;
38
43
  invalidProperty: (key: string) => string;
@@ -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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AM;qCAI7B,MAAM,YAAY,MAAM,KAAG,MAAM;;;;;mCAQ/B,MAAM,OAAO,MAAM,KAAG,MAAM;iCAE9B,MAAM,OAAO,MAAM,KAAG,MAAM;oCAEzB,MAAM,OAAO,MAAM,KAAG,MAAM;gDAEhB,MAAM,KAAG,MAAM;uCAExB,MAAM,KAAG,MAAM;;;;;;;;kCAQpB,MAAM,UAAU,MAAM,KAAG,MAAM;gCAEjC,MAAM,KAAG,MAAM;2CAEJ,MAAM,eAAe,MAAM,KAAG,MAAM;;;uCAI1C,MAAM;uCAEJ,MAAM,KAAG,MAAM;qCAEnB,MAAM;;CAGpC,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;CAClC"}
@@ -45,6 +45,11 @@ exports.errors = {
45
45
  propertyNotAllowed: (moduleKey, propertyName) => `Display conditions of the "${moduleKey}" module are invalid. "${propertyName}" property is not allowed.`,
46
46
  typeMismatch: (moduleKey, propertyName, errorDetails) => `Display conditions of the "${moduleKey}" module are invalid. "${propertyName}" property ${errorDetails}.`
47
47
  },
48
+ confluence: {
49
+ globalSettingsValidator: {
50
+ multipleUseAsConfig: (keys) => `There can be only 1 ${types_1.AllModuleTypes.ConfluenceGlobalSettings} module which designates "useAsConfig": true. Modules containing designation: ${keys.join(', ')}`
51
+ }
52
+ },
48
53
  jiraWorkflowValidator: {
49
54
  missingProperty: (key) => `${types_1.AllModuleTypes.JiraWorkflowValidator} module '${key}' must have either a function or expression.`,
50
55
  invalidProperty: (key) => `${types_1.AllModuleTypes.JiraWorkflowValidator} module '${key}' can only have either a function or expression`
@@ -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;CA0OzG"}
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;AAM3D,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;CA6OzG"}
@@ -6,7 +6,8 @@ const utils_1 = require("../utils");
6
6
  const text_1 = require("../text");
7
7
  const fs_1 = require("fs");
8
8
  const path_1 = require("path");
9
- const issue_adjustment_1 = require("./modules-validators/issue-adjustment");
9
+ const issue_adjustment_1 = require("./modules-validators/jira/issue-adjustment");
10
+ const global_settings_1 = require("./modules-validators/confluence/global-settings");
10
11
  class ModulesValidator {
11
12
  constructor() {
12
13
  this.functionHandlerRegex = /^([a-zA-Z0-9-_]+)\.([a-zA-Z0-9-_]+)$/;
@@ -128,6 +129,7 @@ class ModulesValidator {
128
129
  }
129
130
  });
130
131
  });
132
+ validationErrors.push(...global_settings_1.validateGlobalSettingsModule(modules, yamlContentByLine));
131
133
  }
132
134
  return {
133
135
  success: validationErrors.length === 0,
@@ -0,0 +1,5 @@
1
+ import { ValidationError } from '../../../types';
2
+ import { Modules } from '../../../schema/manifest';
3
+ declare const validateGlobalSettingsModule: (modules: Modules, yamlContentByLine?: string[] | undefined) => ValidationError[];
4
+ export { validateGlobalSettingsModule };
5
+ //# sourceMappingURL=global-settings.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"global-settings.d.ts","sourceRoot":"","sources":["../../../../src/validators/modules-validators/confluence/global-settings.ts"],"names":[],"mappings":"AAAA,OAAO,EAAkB,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAGjE,OAAO,EAAE,OAAO,EAAE,MAAM,0BAA0B,CAAC;AAwBnD,QAAA,MAAM,4BAA4B,YAAa,OAAO,+CAAiC,eAAe,EASrG,CAAC;AAEF,OAAO,EAAE,4BAA4B,EAAE,CAAC"}
@@ -0,0 +1,24 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.validateGlobalSettingsModule = void 0;
4
+ const types_1 = require("../../../types");
5
+ const text_1 = require("../../../text");
6
+ const utils_1 = require("../../../utils");
7
+ const validateMultipleUseAsConfig = (globalSettingsModules, yamlContentByLine) => {
8
+ const validationErrors = [];
9
+ const globalSettingsModulesUsedAsConfig = globalSettingsModules.filter((module) => module.useAsConfig);
10
+ if (globalSettingsModulesUsedAsConfig.length > 1) {
11
+ const moduleKeys = globalSettingsModulesUsedAsConfig.map((module) => module.key);
12
+ validationErrors.push(Object.assign({ message: text_1.errors.modules.confluence.globalSettingsValidator.multipleUseAsConfig(moduleKeys), reference: text_1.References.Modules, level: 'error' }, utils_1.findPosition(moduleKeys[moduleKeys.length - 1], yamlContentByLine)));
13
+ }
14
+ return validationErrors;
15
+ };
16
+ const validateGlobalSettingsModule = (modules, yamlContentByLine) => {
17
+ const validationErrors = [];
18
+ const globalSettingsModules = modules[types_1.AllModuleTypes.ConfluenceGlobalSettings];
19
+ if (globalSettingsModules) {
20
+ validationErrors.push(...validateMultipleUseAsConfig(globalSettingsModules, yamlContentByLine));
21
+ }
22
+ return validationErrors;
23
+ };
24
+ exports.validateGlobalSettingsModule = validateGlobalSettingsModule;
@@ -0,0 +1,4 @@
1
+ import { ValidationError } from '../../../types';
2
+ import { Modules } from '../../../schema/manifest';
3
+ export declare function validateIssueAdjustmentModule(modules: Modules, yamlContentByLine?: string[]): ValidationError[];
4
+ //# sourceMappingURL=issue-adjustment.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"issue-adjustment.d.ts","sourceRoot":"","sources":["../../../../src/validators/modules-validators/jira/issue-adjustment.ts"],"names":[],"mappings":"AAAA,OAAO,EAAkB,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAGjE,OAAO,EAAE,OAAO,EAAE,MAAM,0BAA0B,CAAC;AAEnD,wBAAgB,6BAA6B,CAAC,OAAO,EAAE,OAAO,EAAE,iBAAiB,CAAC,EAAE,MAAM,EAAE,GAAG,eAAe,EAAE,CAe/G"}
@@ -1,9 +1,9 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.validateIssueAdjustmentModule = void 0;
4
- const types_1 = require("../../types");
5
- const text_1 = require("../../text");
6
- const utils_1 = require("../../utils");
4
+ const types_1 = require("../../../types");
5
+ const text_1 = require("../../../text");
6
+ const utils_1 = require("../../../utils");
7
7
  function validateIssueAdjustmentModule(modules, yamlContentByLine) {
8
8
  const validationErrors = [];
9
9
  const moduleType = types_1.AllModuleTypes.JiraIssueAdjustment;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@forge/manifest",
3
- "version": "3.5.0-next.2",
3
+ "version": "3.5.0-next.3",
4
4
  "description": "Definitions and validations of the Forge manifest",
5
5
  "main": "out/index.js",
6
6
  "scripts": {
@@ -1,4 +0,0 @@
1
- import { ValidationError } from '../../types';
2
- import { Modules } from '../../schema/manifest';
3
- export declare function validateIssueAdjustmentModule(modules: Modules, yamlContentByLine?: string[]): ValidationError[];
4
- //# sourceMappingURL=issue-adjustment.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"issue-adjustment.d.ts","sourceRoot":"","sources":["../../../src/validators/modules-validators/issue-adjustment.ts"],"names":[],"mappings":"AAAA,OAAO,EAAkB,eAAe,EAAE,MAAM,aAAa,CAAC;AAG9D,OAAO,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAEhD,wBAAgB,6BAA6B,CAAC,OAAO,EAAE,OAAO,EAAE,iBAAiB,CAAC,EAAE,MAAM,EAAE,GAAG,eAAe,EAAE,CAe/G"}