@forge/manifest 3.8.2-next.0 → 3.9.0-next.1

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.9.0-next.1
4
+
5
+ ### Minor Changes
6
+
7
+ - b447be27: CONFDEV-80332 Added validation for Custom Content modules
8
+
3
9
  ## 3.8.2-next.0
4
10
 
5
11
  ### Patch Changes
@@ -36,6 +36,9 @@ export declare const errors: {
36
36
  confluence: {
37
37
  multipleProperty: (property: string, moduleKey: string, keys: string[]) => string;
38
38
  propertyUniquenessValidator: (property: string, moduleKey: string, keys: string[]) => string;
39
+ validateCustomContentHierarchyUnknown: (property: string, moduleKey: string, unknownKey: string) => string;
40
+ validateCustomContentCrossReferenceMissingContainer: (moduleKey: string, referredModuleKey: string) => string;
41
+ validateCustomContentCrossReferenceMissingChild: (moduleKey: string, referredModuleKey: string) => string;
39
42
  };
40
43
  jiraWorkflowValidator: {
41
44
  missingProperty: (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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AAa,MAAM,cAAc,MAAM,KAAG,MAAM;6EAEvC,MAAM,qBAAqB,MAAM,KAAG,MAAM;yEAE9C,MAAM,qBAAqB,MAAM,KAAG,MAAM;;;mCAIhF,MAAM,KAAG,MAAM;mCAEf,MAAM,KAAG,MAAM;;;qCAIb,MAAM,KAAG,MAAM;;;0CAIV,MAAM,KAAG,MAAM;;;mCAItB,MAAM,EAAE,KAAG,MAAM;;;qCAIf,MAAM,KAAG,MAAM;2CAET,MAAM,KAAG,MAAM;;;oCAGtB,MAAM,KAAG,MAAM;;oCAEjB,MAAM,SAAS,MAAM,KAAG,MAAM;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"}
@@ -47,7 +47,10 @@ exports.errors = {
47
47
  },
48
48
  confluence: {
49
49
  multipleProperty: (property, moduleKey, keys) => `There can be only 1 ${moduleKey} module which designates "${property}": true. Modules containing designation: ${keys.join(', ')}`,
50
- propertyUniquenessValidator: (property, moduleKey, keys) => `${property} should be unique across all ${moduleKey} modules. Found duplicates: ${keys.join(', ')}`
50
+ propertyUniquenessValidator: (property, moduleKey, keys) => `${property} should be unique across all ${moduleKey} modules. Found duplicates: ${keys.join(', ')}`,
51
+ validateCustomContentHierarchyUnknown: (property, moduleKey, unknownKey) => `${property} of the "${moduleKey}" module refers to unknown key: ${unknownKey}`,
52
+ validateCustomContentCrossReferenceMissingContainer: (moduleKey, referredModuleKey) => `supportedContainerTypes of the "${moduleKey}" module refers to "${referredModuleKey}" module. "${referredModuleKey}" module must include "${moduleKey}" in supportedChildTypes`,
53
+ validateCustomContentCrossReferenceMissingChild: (moduleKey, referredModuleKey) => `supportedChildTypes of the "${moduleKey}" module refers to "${referredModuleKey}" module. "${referredModuleKey}" module must include "${moduleKey}" in supportedContainerTypes`
51
54
  },
52
55
  jiraWorkflowValidator: {
53
56
  missingProperty: (key) => `${types_1.AllModuleTypes.JiraWorkflowValidator} module '${key}' must have either a function or expression.`,
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/validators/modules-validators/confluence/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,0BAA0B,CAAC;AACnD,OAAO,EAAkB,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAQjE,eAAO,MAAM,yBAAyB,YAAa,OAAO,+CAAiC,eAAe,EAkBzG,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/validators/modules-validators/confluence/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,0BAA0B,CAAC;AACnD,OAAO,EAAkB,eAAe,EAAE,MAAM,gBAAgB,CAAC;AASjE,eAAO,MAAM,yBAAyB,YAAa,OAAO,+CAAiC,eAAe,EAsBzG,CAAC"}
@@ -4,6 +4,7 @@ exports.validateConfluenceModules = void 0;
4
4
  const types_1 = require("../../../types");
5
5
  const validateSingleProperty_1 = require("./validateSingleProperty");
6
6
  const validatePropertyUniqueness_1 = require("./validatePropertyUniqueness");
7
+ const validateCustomContentHierarchy_1 = require("./validateCustomContentHierarchy");
7
8
  const ROUTE = 'route';
8
9
  const USE_AS_CONFIG = 'useAsConfig';
9
10
  const USE_AS_GET_STARTED = 'useAsGetStarted';
@@ -18,5 +19,6 @@ exports.validateConfluenceModules = (modules, yamlContentByLine) => {
18
19
  });
19
20
  validationErrors.push(...validateSingleProperty_1.validateSingleProperty(modules, types_1.AllModuleTypes.ConfluenceGlobalSettings, USE_AS_CONFIG, yamlContentByLine));
20
21
  validationErrors.push(...validateSingleProperty_1.validateSingleProperty(modules, types_1.AllModuleTypes.ConfluenceGlobalSettings, USE_AS_GET_STARTED, yamlContentByLine));
22
+ validationErrors.push(...validateCustomContentHierarchy_1.validateCustomContentHierarchy(modules, types_1.AllModuleTypes.ConfluenceCustomContent, yamlContentByLine));
21
23
  return validationErrors;
22
24
  };
@@ -0,0 +1,4 @@
1
+ import { AllModuleTypes, ValidationError } from '../../../types';
2
+ import { Modules } from '../../../schema/manifest';
3
+ export declare const validateCustomContentHierarchy: (allModules: Modules, moduleType: AllModuleTypes, yamlContentByLine?: string[] | undefined) => ValidationError[];
4
+ //# sourceMappingURL=validateCustomContentHierarchy.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"validateCustomContentHierarchy.d.ts","sourceRoot":"","sources":["../../../../src/validators/modules-validators/confluence/validateCustomContentHierarchy.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAGjE,OAAO,EAAE,OAAO,EAAE,MAAM,0BAA0B,CAAC;AAInD,eAAO,MAAM,8BAA8B,eAC7B,OAAO,cACP,cAAc,+CAEzB,eAAe,EAyDjB,CAAC"}
@@ -0,0 +1,43 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.validateCustomContentHierarchy = void 0;
4
+ const text_1 = require("../../../text");
5
+ const utils_1 = require("../../../utils");
6
+ const INNER_TYPE_PREFIX = 'this:';
7
+ exports.validateCustomContentHierarchy = (allModules, moduleType, yamlContentByLine) => {
8
+ const validationErrors = [];
9
+ const modules = allModules[moduleType] || [];
10
+ modules.forEach((module) => {
11
+ const supportedContainerTypes = module.supportedContainerTypes || [];
12
+ const supportedChildTypes = module.supportedChildTypes || [];
13
+ [
14
+ {
15
+ propName: 'supportedContainerTypes',
16
+ propInnerValues: supportedContainerTypes.filter((supportedContainerType) => supportedContainerType.startsWith(INNER_TYPE_PREFIX)),
17
+ dependentPropName: 'supportedChildTypes',
18
+ dependentReferenceMissingMessage: text_1.errors.modules.confluence.validateCustomContentCrossReferenceMissingContainer
19
+ },
20
+ {
21
+ propName: 'supportedChildTypes',
22
+ propInnerValues: supportedChildTypes.filter((supportedChildType) => supportedChildType.startsWith(INNER_TYPE_PREFIX)),
23
+ dependentPropName: 'supportedContainerTypes',
24
+ dependentReferenceMissingMessage: text_1.errors.modules.confluence.validateCustomContentCrossReferenceMissingChild
25
+ }
26
+ ].forEach(({ propName, propInnerValues, dependentPropName, dependentReferenceMissingMessage }) => {
27
+ propInnerValues.forEach((value) => {
28
+ const referredModuleName = value.substring(INNER_TYPE_PREFIX.length);
29
+ const referredModule = modules.find((m) => m.key === referredModuleName);
30
+ if (!referredModule) {
31
+ validationErrors.push(Object.assign({ message: text_1.errors.modules.confluence.validateCustomContentHierarchyUnknown(propName, module.key, referredModuleName), reference: text_1.References.Modules, level: 'error' }, utils_1.findPosition(module.key, yamlContentByLine)));
32
+ }
33
+ else {
34
+ const referredModuleDependentPropValues = referredModule[dependentPropName] || [];
35
+ if (!referredModuleDependentPropValues.includes(`${INNER_TYPE_PREFIX}${module.key}`)) {
36
+ validationErrors.push(Object.assign({ message: dependentReferenceMissingMessage(module.key, referredModule.key), reference: text_1.References.Modules, level: 'error' }, utils_1.findPosition(module.key, yamlContentByLine)));
37
+ }
38
+ }
39
+ });
40
+ });
41
+ });
42
+ return validationErrors;
43
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@forge/manifest",
3
- "version": "3.8.2-next.0",
3
+ "version": "3.9.0-next.1",
4
4
  "description": "Definitions and validations of the Forge manifest",
5
5
  "main": "out/index.js",
6
6
  "scripts": {