@forge/manifest 3.5.0-next.4 → 3.5.0-next.7

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,28 @@
1
1
  # @forge/manifest
2
2
 
3
+ ## 3.5.0-next.7
4
+
5
+ ### Minor Changes
6
+
7
+ - 3d82376: Added confluence:customContent module
8
+
9
+ ## 3.5.0-next.6
10
+
11
+ ### Minor Changes
12
+
13
+ - f3ac287: [CONFDEV-79900] Add manifest validation for confluence:spaceSettings, confluence:globalPage, confluence:spacePage to ensure that route param is unique
14
+
15
+ ### Patch Changes
16
+
17
+ - 0accde8: Update manifest definitions
18
+ - ffb508a: Update manifest definitions
19
+
20
+ ## 3.5.0-next.5
21
+
22
+ ### Minor Changes
23
+
24
+ - d196b41: [CONFDEV-79785] Add manifest validation for confluence:globalSettings new, optional, useAsGetStarted property to ensure it's only designated once
25
+
3
26
  ## 3.5.0-next.4
4
27
 
5
28
  ### Patch Changes
@@ -1020,6 +1020,12 @@
1020
1020
  "minLength": 1,
1021
1021
  "maxLength": 255
1022
1022
  },
1023
+ "route": {
1024
+ "type": "string",
1025
+ "minLength": 1,
1026
+ "maxLength": 255,
1027
+ "pattern": "^[a-z0-9\\-]+$"
1028
+ },
1023
1029
  "function": {
1024
1030
  "type": "string",
1025
1031
  "minLength": 1,
@@ -1047,6 +1053,12 @@
1047
1053
  "minLength": 1,
1048
1054
  "maxLength": 255
1049
1055
  },
1056
+ "route": {
1057
+ "type": "string",
1058
+ "minLength": 1,
1059
+ "maxLength": 255,
1060
+ "pattern": "^[a-z0-9\\-]+$"
1061
+ },
1050
1062
  "resolver": {
1051
1063
  "additionalProperties": false,
1052
1064
  "type": "object",
@@ -609,6 +609,7 @@ export interface Modules {
609
609
  (
610
610
  | {
611
611
  title: string;
612
+ route?: string;
612
613
  function: string;
613
614
  displayConditions?: {
614
615
  [k: string]: unknown;
@@ -618,6 +619,7 @@ export interface Modules {
618
619
  }
619
620
  | {
620
621
  title: string;
622
+ route?: string;
621
623
  resolver?: {
622
624
  function: string;
623
625
  };
@@ -633,6 +635,7 @@ export interface Modules {
633
635
  ...(
634
636
  | {
635
637
  title: string;
638
+ route?: string;
636
639
  function: string;
637
640
  displayConditions?: {
638
641
  [k: string]: unknown;
@@ -642,6 +645,7 @@ export interface Modules {
642
645
  }
643
646
  | {
644
647
  title: string;
648
+ route?: string;
645
649
  resolver?: {
646
650
  function: string;
647
651
  };
@@ -34,9 +34,8 @@ export declare const errors: {
34
34
  typeMismatch: (moduleKey: string, propertyName: string, errorDetails: string) => string;
35
35
  };
36
36
  confluence: {
37
- globalSettingsValidator: {
38
- multipleUseAsConfig: (keys: string[]) => string;
39
- };
37
+ multipleProperty: (property: string, moduleKey: string, keys: string[]) => string;
38
+ propertyUniquenessValidator: (property: string, moduleKey: string, keys: string[]) => string;
40
39
  };
41
40
  jiraWorkflowValidator: {
42
41
  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,KAAG,MAAM;4CACJ,MAAM,KAAG,MAAM;;;gCAG3B,MAAM,KAAG,MAAM;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G,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"}
@@ -46,9 +46,8 @@ exports.errors = {
46
46
  typeMismatch: (moduleKey, propertyName, errorDetails) => `Display conditions of the "${moduleKey}" module are invalid. "${propertyName}" property ${errorDetails}.`
47
47
  },
48
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
- }
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(', ')}`
52
51
  },
53
52
  jiraWorkflowValidator: {
54
53
  missingProperty: (key) => `${types_1.AllModuleTypes.JiraWorkflowValidator} module '${key}' must have either a function or expression.`,
@@ -8,6 +8,7 @@ export declare enum AllModuleTypes {
8
8
  ConfluenceContentAction = "confluence:contentAction",
9
9
  ConfluenceContentBylineItem = "confluence:contentBylineItem",
10
10
  ConfluenceContextMenu = "confluence:contextMenu",
11
+ ConfluenceCustomContent = "confluence:customContent",
11
12
  ConfluenceGlobalSettings = "confluence:globalSettings",
12
13
  ConfluenceGlobalPage = "confluence:globalPage",
13
14
  ConfluenceHomepageFeed = "confluence:homepageFeed",
@@ -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,oBAAoB,0BAA0B;IAC9C,sBAAsB,4BAA4B;IAClD,mBAAmB,yBAAyB;IAC5C,uBAAuB,6BAA6B;IACpD,kBAAkB,wBAAwB;IAC1C,qBAAqB,2BAA2B;IAChD,qBAAqB,2BAA2B;IAChD,eAAe,qBAAqB;IACpC,mBAAmB,yBAAyB;IAC5C,eAAe,qBAAqB;IACpC,iBAAiB,uBAAuB;IACxC,mBAAmB,yBAAyB;IAC5C,eAAe,qBAAqB;IACpC,cAAc,oBAAoB;IAClC,aAAa,mBAAmB;IAChC,eAAe,qBAAqB;IACpC,uBAAuB,6BAA6B;IACpD,cAAc,oBAAoB;IAClC,mBAAmB,yBAAyB;IAC5C,gBAAgB,sBAAsB;IACtC,oBAAoB,0BAA0B;IAC9C,iBAAiB,uBAAuB;IACxC,eAAe,qBAAqB;IAEpC,8B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AAoB,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"}
@@ -12,6 +12,7 @@ var AllModuleTypes;
12
12
  AllModuleTypes["ConfluenceContentAction"] = "confluence:contentAction";
13
13
  AllModuleTypes["ConfluenceContentBylineItem"] = "confluence:contentBylineItem";
14
14
  AllModuleTypes["ConfluenceContextMenu"] = "confluence:contextMenu";
15
+ AllModuleTypes["ConfluenceCustomContent"] = "confluence:customContent";
15
16
  AllModuleTypes["ConfluenceGlobalSettings"] = "confluence:globalSettings";
16
17
  AllModuleTypes["ConfluenceGlobalPage"] = "confluence:globalPage";
17
18
  AllModuleTypes["ConfluenceHomepageFeed"] = "confluence:homepageFeed";
@@ -7,7 +7,7 @@ const text_1 = require("../text");
7
7
  const fs_1 = require("fs");
8
8
  const path_1 = require("path");
9
9
  const issue_adjustment_1 = require("./modules-validators/jira/issue-adjustment");
10
- const global_settings_1 = require("./modules-validators/confluence/global-settings");
10
+ const confluence_1 = require("./modules-validators/confluence");
11
11
  class ModulesValidator {
12
12
  constructor() {
13
13
  this.functionHandlerRegex = /^([a-zA-Z0-9-_]+)\.([a-zA-Z0-9-_]+)$/;
@@ -129,7 +129,7 @@ class ModulesValidator {
129
129
  }
130
130
  });
131
131
  });
132
- validationErrors.push(...global_settings_1.validateGlobalSettingsModule(modules, yamlContentByLine));
132
+ validationErrors.push(...confluence_1.validateConfluenceModules(modules, yamlContentByLine));
133
133
  }
134
134
  return {
135
135
  success: validationErrors.length === 0,
@@ -0,0 +1,4 @@
1
+ import { Modules } from '../../../schema/manifest';
2
+ import { ValidationError } from '../../../types';
3
+ export declare const validateConfluenceModules: (modules: Modules, yamlContentByLine?: string[] | undefined) => ValidationError[];
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +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"}
@@ -0,0 +1,22 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.validateConfluenceModules = void 0;
4
+ const types_1 = require("../../../types");
5
+ const validateSingleProperty_1 = require("./validateSingleProperty");
6
+ const validatePropertyUniqueness_1 = require("./validatePropertyUniqueness");
7
+ const ROUTE = 'route';
8
+ const USE_AS_CONFIG = 'useAsConfig';
9
+ const USE_AS_GET_STARTED = 'useAsGetStarted';
10
+ exports.validateConfluenceModules = (modules, yamlContentByLine) => {
11
+ const validationErrors = [];
12
+ [
13
+ types_1.AllModuleTypes.ConfluenceSpaceSettings,
14
+ types_1.AllModuleTypes.ConfluenceGlobalPage,
15
+ types_1.AllModuleTypes.ConfluenceSpacePage
16
+ ].forEach((moduleType) => {
17
+ validationErrors.push(...validatePropertyUniqueness_1.validatePropertyUniqueness(modules, moduleType, ROUTE, yamlContentByLine));
18
+ });
19
+ validationErrors.push(...validateSingleProperty_1.validateSingleProperty(modules, types_1.AllModuleTypes.ConfluenceGlobalSettings, USE_AS_CONFIG, yamlContentByLine));
20
+ validationErrors.push(...validateSingleProperty_1.validateSingleProperty(modules, types_1.AllModuleTypes.ConfluenceGlobalSettings, USE_AS_GET_STARTED, yamlContentByLine));
21
+ return validationErrors;
22
+ };
@@ -0,0 +1,4 @@
1
+ import { AllModuleTypes, ValidationError } from '../../../types';
2
+ import { Modules } from '../../../schema/manifest';
3
+ export declare const validatePropertyUniqueness: (allModules: Modules, moduleType: AllModuleTypes, property: string, yamlContentByLine?: string[] | undefined) => ValidationError[];
4
+ //# sourceMappingURL=validatePropertyUniqueness.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"validatePropertyUniqueness.d.ts","sourceRoot":"","sources":["../../../../src/validators/modules-validators/confluence/validatePropertyUniqueness.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAGjE,OAAO,EAAE,OAAO,EAAE,MAAM,0BAA0B,CAAC;AAEnD,eAAO,MAAM,0BAA0B,eACzB,OAAO,cACP,cAAc,YAChB,MAAM,+CAEf,eAAe,EAqBjB,CAAC"}
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.validatePropertyUniqueness = void 0;
4
+ const text_1 = require("../../../text");
5
+ const utils_1 = require("../../../utils");
6
+ exports.validatePropertyUniqueness = (allModules, moduleType, property, yamlContentByLine) => {
7
+ var _a;
8
+ const validationErrors = [];
9
+ const modules = allModules[moduleType] || [];
10
+ const allPropertyValues = modules.map((module) => module[property]).filter((property) => property);
11
+ const duplicatePropertyValues = allPropertyValues.filter((property, index, all) => all.indexOf(property) !== index);
12
+ if (duplicatePropertyValues.length > 0) {
13
+ const allModulesWithDuplicatedPropertyValues = modules.filter((module) => module[property] === duplicatePropertyValues[0]);
14
+ validationErrors.push(Object.assign({ message: text_1.errors.modules.confluence.propertyUniquenessValidator(property, moduleType, duplicatePropertyValues), reference: text_1.References.Modules, level: 'error' }, utils_1.findPosition((_a = allModulesWithDuplicatedPropertyValues === null || allModulesWithDuplicatedPropertyValues === void 0 ? void 0 : allModulesWithDuplicatedPropertyValues[0]) === null || _a === void 0 ? void 0 : _a.key, yamlContentByLine)));
15
+ }
16
+ return validationErrors;
17
+ };
@@ -0,0 +1,4 @@
1
+ import { AllModuleTypes, ValidationError } from '../../../types';
2
+ import { Modules } from '../../../schema/manifest';
3
+ export declare const validateSingleProperty: (allModules: Modules, moduleType: AllModuleTypes, property: string, yamlContentByLine?: string[] | undefined) => ValidationError[];
4
+ //# sourceMappingURL=validateSingleProperty.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"validateSingleProperty.d.ts","sourceRoot":"","sources":["../../../../src/validators/modules-validators/confluence/validateSingleProperty.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAGjE,OAAO,EAAE,OAAO,EAAE,MAAM,0BAA0B,CAAC;AAEnD,eAAO,MAAM,sBAAsB,eACrB,OAAO,cACP,cAAc,YAChB,MAAM,+CAEf,eAAe,EAgBjB,CAAC"}
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.validateSingleProperty = void 0;
4
+ const text_1 = require("../../../text");
5
+ const utils_1 = require("../../../utils");
6
+ exports.validateSingleProperty = (allModules, moduleType, property, yamlContentByLine) => {
7
+ const validationErrors = [];
8
+ const modules = allModules[moduleType] || [];
9
+ const modulesWithProperty = modules.filter((module) => module[property]);
10
+ if (modulesWithProperty.length > 1) {
11
+ const moduleKeys = modulesWithProperty.map((module) => module.key);
12
+ validationErrors.push(Object.assign({ message: text_1.errors.modules.confluence.multipleProperty(property, moduleType, moduleKeys), reference: text_1.References.Modules, level: 'error' }, utils_1.findPosition(moduleKeys[moduleKeys.length - 1], yamlContentByLine)));
13
+ }
14
+ return validationErrors;
15
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@forge/manifest",
3
- "version": "3.5.0-next.4",
3
+ "version": "3.5.0-next.7",
4
4
  "description": "Definitions and validations of the Forge manifest",
5
5
  "main": "out/index.js",
6
6
  "scripts": {
@@ -1,5 +0,0 @@
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
@@ -1 +0,0 @@
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"}
@@ -1,24 +0,0 @@
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;