@forge/manifest 10.8.0 → 11.0.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 +12 -0
- package/README.md +22 -0
- package/out/text/errors.d.ts +2 -2
- package/out/text/errors.d.ts.map +1 -1
- package/out/text/errors.js +2 -2
- package/out/types/module-types.d.ts +1 -1
- package/out/types/module-types.d.ts.map +1 -1
- package/out/types/module-types.js +1 -1
- package/out/types/validation-types.d.ts +7 -0
- package/out/types/validation-types.d.ts.map +1 -1
- package/out/validators/index.d.ts +1 -0
- package/out/validators/index.d.ts.map +1 -1
- package/out/validators/index.js +1 -0
- package/out/validators/modules-validators/confluence/index.d.ts.map +1 -1
- package/out/validators/modules-validators/confluence/index.js +8 -3
- package/out/validators/modules-validators/confluence/validateFullPage.d.ts +4 -0
- package/out/validators/modules-validators/confluence/validateFullPage.d.ts.map +1 -0
- package/out/validators/modules-validators/confluence/validateFullPage.js +36 -0
- package/out/validators/product-trigger-scopes-validator.d.ts +5 -1
- package/out/validators/product-trigger-scopes-validator.d.ts.map +1 -1
- package/out/validators/product-trigger-scopes-validator.js +9 -7
- package/out/validators/simple-trigger-scope-validator.d.ts +3 -0
- package/out/validators/simple-trigger-scope-validator.d.ts.map +1 -0
- package/out/validators/simple-trigger-scope-validator.js +17 -0
- package/package.json +1 -1
- package/out/validators/modules-validators/confluence/validateFullPageApp.d.ts +0 -4
- package/out/validators/modules-validators/confluence/validateFullPageApp.d.ts.map +0 -1
- package/out/validators/modules-validators/confluence/validateFullPageApp.js +0 -21
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# @forge/manifest
|
|
2
2
|
|
|
3
|
+
## 11.0.0-next.1
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 9a6d346: Add standalone trigger scope validation API (only event name and scopes required)
|
|
8
|
+
|
|
9
|
+
## 11.0.0-next.0
|
|
10
|
+
|
|
11
|
+
### Major Changes
|
|
12
|
+
|
|
13
|
+
- 8962080: Added routePrefix mandatory prop for confluence:fullPage
|
|
14
|
+
|
|
3
15
|
## 10.8.0
|
|
4
16
|
|
|
5
17
|
### Minor Changes
|
package/README.md
CHANGED
|
@@ -17,6 +17,28 @@ const results = ProcessorBuilder.instance()
|
|
|
17
17
|
console.log(`Valid manifest ? ${results.success}`);
|
|
18
18
|
```
|
|
19
19
|
|
|
20
|
+
## Simple Trigger Scopes Validation
|
|
21
|
+
|
|
22
|
+
For validating trigger event scopes, use the simple validation API that only requires the event name and scopes:
|
|
23
|
+
|
|
24
|
+
```typescript
|
|
25
|
+
import { validateTriggerScopes } from '@forge/manifest';
|
|
26
|
+
|
|
27
|
+
// Simple: just pass event and scopes
|
|
28
|
+
const result = await validateTriggerScopes(
|
|
29
|
+
'avi:jira:assigned:issue',
|
|
30
|
+
['read:jira-work']
|
|
31
|
+
);
|
|
32
|
+
|
|
33
|
+
if (!result.valid) {
|
|
34
|
+
console.error(`Missing scopes: ${result.missingScopes.join(', ')}`);
|
|
35
|
+
}
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
This is useful for:
|
|
39
|
+
- External tools that need to verify scope requirements
|
|
40
|
+
- Any service that validates event-scope mappings
|
|
41
|
+
|
|
20
42
|
## How to check the errors
|
|
21
43
|
|
|
22
44
|
In case of an invalid `manifest.yml`, the following information will be populated:
|
package/out/text/errors.d.ts
CHANGED
|
@@ -76,8 +76,8 @@ export declare const errors: {
|
|
|
76
76
|
invalidMatcherPatternRegex: (pattern: string, keyName: string, index: number) => string;
|
|
77
77
|
emptyMatcherArray: (keyName: string) => string;
|
|
78
78
|
};
|
|
79
|
-
|
|
80
|
-
invalidRouteRegex: (pattern: string, keyName: string) => string;
|
|
79
|
+
fullPage: {
|
|
80
|
+
invalidRouteRegex: (pattern: string, keyName: string, index: number) => string;
|
|
81
81
|
};
|
|
82
82
|
};
|
|
83
83
|
jiraWorkflowValidator: {
|
package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M,KAAG,MAAM;4CAE3B,MAAM,SAAS,MAAM,KAAG,MAAM;gDAE1B,MAAM,aAAa,MAAM,KAAG,MAAM;4CAEtC,MAAM,SAAS,MAAM,KAAG,MAAM;;;;;gCAM1C,MAAM;;;;;0DAKwB,wBAAwB,KAAG,MAAM;sDAErC,wBAAwB,KAAG,MAAM;kDAErC,wBAAwB,QAAQ,MAAM,KAAG,MAAM;mDAE9C,wBAAwB,KAAG,MAAM;mCAEjD,MAAM,KAAG,MAAM;;oDAEE,MAAM,aAAa,MAAM,KAAG,MAAM;4CAE1C,MAAM,sBAAsB,wBAAwB,YAAY,MAAM;;;;mCAKjF,MAAM;;;CAQlC,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,SAAS,4BAA4B;IACrC,SAAS,4BAA4B;IACrC,UAAU,wBAAwB;IAClC,GAAG,8BAA8B;CAClC"}
|
package/out/text/errors.js
CHANGED
|
@@ -88,8 +88,8 @@ exports.errors = {
|
|
|
88
88
|
invalidMatcherPatternRegex: (pattern, keyName, index) => `The pattern '${pattern}' at index '${index}' for key '${keyName}' needs to be in a valid URL format between 1-1024 characters long and cannot use wildcard (*) for protocol. Please provide a valid URL within the character limitations and with a valid protocol.`,
|
|
89
89
|
emptyMatcherArray: (keyName) => `Macro autoConvert matchers array for key '${keyName}' must not be empty array.`
|
|
90
90
|
},
|
|
91
|
-
|
|
92
|
-
invalidRouteRegex: (pattern, keyName) => `The
|
|
91
|
+
fullPage: {
|
|
92
|
+
invalidRouteRegex: (pattern, keyName, index) => `The routePrefix '${pattern}' at index '${index}' for key '${keyName}' needs to be in a valid URL route between 1-255 characters and contain only URL safe characters such as: a-z, 0-9 and '\' and '-'.`
|
|
93
93
|
}
|
|
94
94
|
},
|
|
95
95
|
jiraWorkflowValidator: {
|
|
@@ -28,7 +28,7 @@ export declare enum AllModuleTypes {
|
|
|
28
28
|
ConfluenceSpaceSettings = "confluence:spaceSettings",
|
|
29
29
|
ConfluenceBackgroundScript = "confluence:backgroundScript",
|
|
30
30
|
ConfluencePageBanner = "confluence:pageBanner",
|
|
31
|
-
|
|
31
|
+
ConfluenceFullPage = "confluence:fullPage",
|
|
32
32
|
ConfluenceContentProperty = "confluence:contentProperty",
|
|
33
33
|
JiraEntityProperty = "jira:entityProperty",
|
|
34
34
|
JiraWorkflowValidator = "jira:workflowValidator",
|
|
@@ -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,YAAY,kBAAkB;IAC9B,WAAW,iBAAiB;IAC5B,cAAc,oBAAoB;IAClC,YAAY,kBAAkB;IAC9B,SAAS,eAAe;IACxB,YAAY,kBAAkB;IAC9B,oBAAoB,0BAA0B;IAC9C,YAAY,kBAAkB;IAC9B,aAAa,mBAAmB;IAChC,UAAU,gBAAgB;IAC1B,OAAO,aAAa;IACpB,MAAM,qBAAqB;IAC3B,OAAO,aAAa;IACpB,QAAQ,cAAc;IACtB,sBAAsB,4BAA4B;IAClD,gBAAgB,sBAAsB;IACtC,0BAA0B,gCAAgC;IAE1D,uBAAuB,6BAA6B;IACpD,2BAA2B,iCAAiC;IAC5D,qBAAqB,2BAA2B;IAChD,uBAAuB,6BAA6B;IACpD,wBAAwB,8BAA8B;IACtD,oBAAoB,0BAA0B;IAC9C,sBAAsB,4BAA4B;IAClD,mBAAmB,yBAAyB;IAC5C,uBAAuB,6BAA6B;IACpD,0BAA0B,gCAAgC;IAC1D,oBAAoB,0BAA0B;IAC9C,
|
|
1
|
+
{"version":3,"file":"module-types.d.ts","sourceRoot":"","sources":["../../src/types/module-types.ts"],"names":[],"mappings":"AAAA,oBAAY,cAAc;IACxB,YAAY,k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;IACvF,kCAAkC,yCAAyC;IAC3E,iCAAiC,wCAAwC;IACzE,2CAA2C,kDAAkD;IAC7F,0CAA0C,iDAAiD;IAC3F,8CAA8C,qDAAqD;IACnG,yCAAyC,gDAAgD;IACzF,4BAA4B,mCAAmC;IAC/D,+BAA+B,sCAAsC;IACrE,sBAAsB,6BAA6B;IACnD,2BAA2B,kCAAkC;IAC7D,qCAAqC,4CAA4C;IACjF,sCAAsC,6CAA6C;IAEnF,8BAA8B,uBAAuB;IACrD,6BAA6B,sBAAsB;IACnD,6BAA6B,sBAAsB;IACnD,gCAAgC,yBAAyB;IACzD,wCAAwC,iCAAiC;IACzE,+BAA+B,wBAAwB;IACvD,2BAA2B,oBAAoB;IAC/C,wBAAwB,8BAA8B;IAEtD,SAAS,eAAe;IACxB,UAAU,gBAAgB;IAC1B,mBAAmB,yBAAyB;IAC5C,cAAc,oBAAoB;IAClC,UAAU,oBAAoB;IAE9B,6BAA6B,mCAAmC;IAChE,6BAA6B,mCAAmC;IAChE,4BAA4B,kCAAkC;IAC9D,uBAAuB,6BAA6B;IACpD,4BAA4B,kCAAkC;CAC/D;AAED,eAAO,MAAM,iBAAiB,kBAAgC,CAAC;AAE/D,eAAO,MAAM,uBAAuB,UAAwE,CAAC"}
|
|
@@ -32,7 +32,7 @@ var AllModuleTypes;
|
|
|
32
32
|
AllModuleTypes["ConfluenceSpaceSettings"] = "confluence:spaceSettings";
|
|
33
33
|
AllModuleTypes["ConfluenceBackgroundScript"] = "confluence:backgroundScript";
|
|
34
34
|
AllModuleTypes["ConfluencePageBanner"] = "confluence:pageBanner";
|
|
35
|
-
AllModuleTypes["
|
|
35
|
+
AllModuleTypes["ConfluenceFullPage"] = "confluence:fullPage";
|
|
36
36
|
AllModuleTypes["ConfluenceContentProperty"] = "confluence:contentProperty";
|
|
37
37
|
AllModuleTypes["JiraEntityProperty"] = "jira:entityProperty";
|
|
38
38
|
AllModuleTypes["JiraWorkflowValidator"] = "jira:workflowValidator";
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { RequiredScopes } from '../scopes';
|
|
1
2
|
export declare enum ValidationTypes {
|
|
2
3
|
BASIC = "basic",
|
|
3
4
|
FULL = "full",
|
|
@@ -6,4 +7,10 @@ export declare enum ValidationTypes {
|
|
|
6
7
|
FORGE_REMOTE_COMPUTE = "forge-remote-compute",
|
|
7
8
|
DEPRECATED_EGRESS_PERMISSIONS = "deprecated-egress-permissions"
|
|
8
9
|
}
|
|
10
|
+
export interface TriggerScopeValidationResult {
|
|
11
|
+
valid: boolean;
|
|
12
|
+
event: string;
|
|
13
|
+
missingScopes: string[];
|
|
14
|
+
requiredScopes: RequiredScopes | null;
|
|
15
|
+
}
|
|
9
16
|
//# 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;IACnC,qBAAqB,0BAA0B;IAC/C,oBAAoB,yBAAyB;IAC7C,6BAA6B,kCAAkC;CAChE"}
|
|
1
|
+
{"version":3,"file":"validation-types.d.ts","sourceRoot":"","sources":["../../src/types/validation-types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAE3C,oBAAY,eAAe;IACzB,KAAK,UAAU;IACf,IAAI,SAAS;IACb,eAAe,oBAAoB;IACnC,qBAAqB,0BAA0B;IAC/C,oBAAoB,yBAAyB;IAC7C,6BAA6B,kCAAkC;CAChE;AAKD,MAAM,WAAW,4BAA4B;IAC3C,KAAK,EAAE,OAAO,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IACd,aAAa,EAAE,MAAM,EAAE,CAAC;IACxB,cAAc,EAAE,cAAc,GAAG,IAAI,CAAC;CACvC"}
|
|
@@ -7,6 +7,7 @@ export * from './validator-interface';
|
|
|
7
7
|
export * from './resources-validator';
|
|
8
8
|
export * from './display-conditions-validator';
|
|
9
9
|
export * from './product-trigger-scopes-validator';
|
|
10
|
+
export * from './simple-trigger-scope-validator';
|
|
10
11
|
export * from './providers-validator';
|
|
11
12
|
export * from './permissions-validator';
|
|
12
13
|
export * from './connect-remote-validator';
|
|
@@ -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;AAC3C,cAAc,oCAAoC,CAAC;AACnD,cAAc,6BAA6B,CAAC;AAC5C,cAAc,qBAAqB,CAAC;AACpC,cAAc,0BAA0B,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,kCAAkC,CAAC;AACjD,cAAc,uBAAuB,CAAC;AACtC,cAAc,yBAAyB,CAAC;AACxC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,oCAAoC,CAAC;AACnD,cAAc,6BAA6B,CAAC;AAC5C,cAAc,qBAAqB,CAAC;AACpC,cAAc,0BAA0B,CAAC"}
|
package/out/validators/index.js
CHANGED
|
@@ -10,6 +10,7 @@ tslib_1.__exportStar(require("./validator-interface"), exports);
|
|
|
10
10
|
tslib_1.__exportStar(require("./resources-validator"), exports);
|
|
11
11
|
tslib_1.__exportStar(require("./display-conditions-validator"), exports);
|
|
12
12
|
tslib_1.__exportStar(require("./product-trigger-scopes-validator"), exports);
|
|
13
|
+
tslib_1.__exportStar(require("./simple-trigger-scope-validator"), exports);
|
|
13
14
|
tslib_1.__exportStar(require("./providers-validator"), exports);
|
|
14
15
|
tslib_1.__exportStar(require("./permissions-validator"), exports);
|
|
15
16
|
tslib_1.__exportStar(require("./connect-remote-validator"), exports);
|
|
@@ -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;
|
|
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;AAejE,eAAO,MAAM,yBAAyB,YAAa,OAAO,sBAAsB,MAAM,EAAE,KAAG,eAAe,EAwCzG,CAAC"}
|
|
@@ -8,8 +8,9 @@ const validateKeyboardShortcuts_1 = require("./validateKeyboardShortcuts");
|
|
|
8
8
|
const validateCrossModulePropertyUniqueness_1 = require("./validateCrossModulePropertyUniqueness");
|
|
9
9
|
const validateCustomContentHierarchy_1 = require("./validateCustomContentHierarchy");
|
|
10
10
|
const validateMacroAutoConvert_1 = require("./validateMacroAutoConvert");
|
|
11
|
-
const
|
|
11
|
+
const validateFullPage_1 = require("./validateFullPage");
|
|
12
12
|
const ROUTE = 'route';
|
|
13
|
+
const ROUTE_FULL_PAGE = 'routePrefix';
|
|
13
14
|
const USE_AS_CONFIG = 'useAsConfig';
|
|
14
15
|
const USE_AS_GET_STARTED = 'useAsGetStarted';
|
|
15
16
|
const KEYBOARD_SHORTCUT_ACCELERATOR = 'keyboardShortcut.accelerator';
|
|
@@ -18,16 +19,20 @@ const validateConfluenceModules = (modules, yamlContentByLine) => {
|
|
|
18
19
|
[
|
|
19
20
|
types_1.AllModuleTypes.ConfluenceSpaceSettings,
|
|
20
21
|
types_1.AllModuleTypes.ConfluenceGlobalPage,
|
|
21
|
-
types_1.AllModuleTypes.ConfluenceSpacePage
|
|
22
|
+
types_1.AllModuleTypes.ConfluenceSpacePage,
|
|
23
|
+
types_1.AllModuleTypes.ConfluenceFullPage
|
|
22
24
|
].forEach((moduleType) => {
|
|
23
25
|
validationErrors.push(...(0, validatePropertyUniqueness_1.validatePropertyUniqueness)(modules, moduleType, ROUTE, yamlContentByLine));
|
|
24
26
|
});
|
|
27
|
+
[types_1.AllModuleTypes.ConfluenceFullPage].forEach((moduleType) => {
|
|
28
|
+
validationErrors.push(...(0, validatePropertyUniqueness_1.validatePropertyUniqueness)(modules, moduleType, ROUTE_FULL_PAGE, yamlContentByLine));
|
|
29
|
+
});
|
|
25
30
|
validationErrors.push(...(0, validateSingleProperty_1.validateSingleProperty)(modules, types_1.AllModuleTypes.ConfluenceGlobalSettings, USE_AS_CONFIG, yamlContentByLine));
|
|
26
31
|
validationErrors.push(...(0, validateSingleProperty_1.validateSingleProperty)(modules, types_1.AllModuleTypes.ConfluenceGlobalSettings, USE_AS_GET_STARTED, yamlContentByLine));
|
|
27
32
|
validationErrors.push(...(0, validateCustomContentHierarchy_1.validateCustomContentHierarchy)(modules, types_1.AllModuleTypes.ConfluenceCustomContent, yamlContentByLine));
|
|
28
33
|
validationErrors.push(...(0, validateCrossModulePropertyUniqueness_1.validateCrossModulePropertyUniqueness)(modules, KEYBOARD_SHORTCUT_ACCELERATOR, yamlContentByLine), ...(0, validateKeyboardShortcuts_1.validateKeyboardShortcuts)(modules, yamlContentByLine));
|
|
29
34
|
validationErrors.push(...(0, validateMacroAutoConvert_1.validateMacroAutoConvert)(modules, yamlContentByLine));
|
|
30
|
-
validationErrors.push(...(0,
|
|
35
|
+
validationErrors.push(...(0, validateFullPage_1.validateFullPage)(modules, yamlContentByLine));
|
|
31
36
|
return validationErrors;
|
|
32
37
|
};
|
|
33
38
|
exports.validateConfluenceModules = validateConfluenceModules;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validateFullPage.d.ts","sourceRoot":"","sources":["../../../../src/validators/modules-validators/confluence/validateFullPage.ts"],"names":[],"mappings":"AAAA,OAAO,EAAkB,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAGjE,OAAO,EAAE,OAAO,EAAE,MAAM,0BAA0B,CAAC;AAuDnD,eAAO,MAAM,gBAAgB,YAAa,OAAO,sBAAsB,MAAM,EAAE,KAAG,eAAe,EAqBhG,CAAC"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.validateFullPage = void 0;
|
|
4
|
+
const types_1 = require("../../../types");
|
|
5
|
+
const text_1 = require("../../../text");
|
|
6
|
+
const utils_1 = require("../../../utils");
|
|
7
|
+
const VALID_ROUTE_PATTERN = new RegExp(/^[a-z0-9\\-]+$/);
|
|
8
|
+
const errorMessages = text_1.errors.modules.confluence.fullPage;
|
|
9
|
+
const mapToFullPageError = (validationErrors, moduleKey) => validationErrors.map((message) => ({ moduleKey, message }));
|
|
10
|
+
const validateRegex = (pattern, moduleKey, index) => {
|
|
11
|
+
const validationErrors = [];
|
|
12
|
+
if (!VALID_ROUTE_PATTERN.test(pattern)) {
|
|
13
|
+
validationErrors.push(errorMessages.invalidRouteRegex(pattern, moduleKey, index));
|
|
14
|
+
}
|
|
15
|
+
return validationErrors;
|
|
16
|
+
};
|
|
17
|
+
const validateRoute = (moduleKey, pattern, index) => {
|
|
18
|
+
const validationErrors = [];
|
|
19
|
+
validationErrors.push(...validateRegex(pattern, moduleKey, index));
|
|
20
|
+
return mapToFullPageError(validationErrors, moduleKey);
|
|
21
|
+
};
|
|
22
|
+
const validateFullPage = (modules, yamlContentByLine) => {
|
|
23
|
+
const validationErrors = [];
|
|
24
|
+
const moduleType = types_1.AllModuleTypes.ConfluenceFullPage;
|
|
25
|
+
const fullPageModules = modules[moduleType] || [];
|
|
26
|
+
fullPageModules.forEach((module, index) => {
|
|
27
|
+
validationErrors.push(...validateRoute(module.key, module.routePrefix, index).map((error) => ({
|
|
28
|
+
message: error.message,
|
|
29
|
+
reference: text_1.References.Modules,
|
|
30
|
+
level: 'error',
|
|
31
|
+
...(0, utils_1.findPosition)(error.moduleKey, yamlContentByLine)
|
|
32
|
+
})));
|
|
33
|
+
});
|
|
34
|
+
return validationErrors;
|
|
35
|
+
};
|
|
36
|
+
exports.validateFullPage = validateFullPage;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ManifestObject, ManifestValidationResult } from '../types';
|
|
2
2
|
import { ValidatorInterface } from './validator-interface';
|
|
3
|
-
import { ManifestSchema } from '../schema/manifest';
|
|
3
|
+
import { ManifestSchema, Scopes } from '../schema/manifest';
|
|
4
4
|
import { RequiredScopes } from '../scopes';
|
|
5
5
|
export interface MappingEntry {
|
|
6
6
|
productEvent: string;
|
|
@@ -9,6 +9,10 @@ export interface MappingEntry {
|
|
|
9
9
|
export interface MappingConfig {
|
|
10
10
|
mapping: MappingEntry[];
|
|
11
11
|
}
|
|
12
|
+
export declare function validateEventScopes(event: string, scopes: Scopes | undefined, config: MappingConfig): Promise<{
|
|
13
|
+
requiredScopes: RequiredScopes;
|
|
14
|
+
missingScopes: string[];
|
|
15
|
+
}>;
|
|
12
16
|
export declare class ProductTriggerScopesValidator<T> implements ValidatorInterface<ManifestObject<ManifestSchema> | undefined, ManifestSchema> {
|
|
13
17
|
private readonly config;
|
|
14
18
|
constructor(config: MappingConfig);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"product-trigger-scopes-validator.d.ts","sourceRoot":"","sources":["../../src/validators/product-trigger-scopes-validator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,wBAAwB,EAAmB,MAAM,UAAU,CAAC;AACrF,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAC3D,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"product-trigger-scopes-validator.d.ts","sourceRoot":"","sources":["../../src/validators/product-trigger-scopes-validator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,wBAAwB,EAAmB,MAAM,UAAU,CAAC;AACrF,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAC3D,OAAO,EAAE,cAAc,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAG5D,OAAO,EAAoB,cAAc,EAAE,MAAM,WAAW,CAAC;AAE7D,MAAM,WAAW,YAAY;IAC3B,YAAY,EAAE,MAAM,CAAC;IACrB,WAAW,EAAE,cAAc,CAAC;CAC7B;AAED,MAAM,WAAW,aAAa;IAC5B,OAAO,EAAE,YAAY,EAAE,CAAC;CACzB;AAcD,wBAAsB,mBAAmB,CACvC,KAAK,EAAE,MAAM,EACb,MAAM,EAAE,MAAM,GAAG,SAAS,EAC1B,MAAM,EAAE,aAAa,GACpB,OAAO,CAAC;IAAE,cAAc,EAAE,cAAc,CAAC;IAAC,aAAa,EAAE,MAAM,EAAE,CAAA;CAAE,CAAC,CAStE;AAED,qBAAa,6BAA6B,CAAC,CAAC,CAC1C,YAAW,kBAAkB,CAAC,cAAc,CAAC,cAAc,CAAC,GAAG,SAAS,EAAE,cAAc,CAAC;IAE7E,OAAO,CAAC,QAAQ,CAAC,MAAM;gBAAN,MAAM,EAAE,aAAa;IAE5C,QAAQ,CACZ,QAAQ,EAAE,cAAc,CAAC,cAAc,CAAC,GAAG,SAAS,GACnD,OAAO,CAAC,wBAAwB,CAAC,cAAc,CAAC,CAAC;CA6CrD"}
|
|
@@ -1,9 +1,16 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ProductTriggerScopesValidator = void 0;
|
|
3
|
+
exports.ProductTriggerScopesValidator = exports.validateEventScopes = void 0;
|
|
4
4
|
const text_1 = require("../text");
|
|
5
5
|
const utils_1 = require("../utils");
|
|
6
6
|
const scopes_1 = require("../scopes");
|
|
7
|
+
async function validateEventScopes(event, scopes, config) {
|
|
8
|
+
const emptyRequiredScopes = { current: [] };
|
|
9
|
+
const requiredScopes = config.mapping.find((entry) => entry.productEvent === event)?.oAuthScopes || emptyRequiredScopes;
|
|
10
|
+
const missingScopes = await (0, scopes_1.getMissingScopes)(scopes, requiredScopes);
|
|
11
|
+
return { requiredScopes, missingScopes };
|
|
12
|
+
}
|
|
13
|
+
exports.validateEventScopes = validateEventScopes;
|
|
7
14
|
class ProductTriggerScopesValidator {
|
|
8
15
|
config;
|
|
9
16
|
constructor(config) {
|
|
@@ -17,10 +24,6 @@ class ProductTriggerScopesValidator {
|
|
|
17
24
|
};
|
|
18
25
|
}
|
|
19
26
|
const validationErrors = [];
|
|
20
|
-
const getRequiredScopes = (productEvent) => {
|
|
21
|
-
const emptyRequiredScopes = { current: [] };
|
|
22
|
-
return (this.config.mapping.find((value) => value.productEvent == productEvent)?.oAuthScopes || emptyRequiredScopes);
|
|
23
|
-
};
|
|
24
27
|
const addValidationError = (scope, event) => {
|
|
25
28
|
validationErrors.push({
|
|
26
29
|
message: text_1.errors.permissions.missingPermissionFromScope(scope, event),
|
|
@@ -41,8 +44,7 @@ class ProductTriggerScopesValidator {
|
|
|
41
44
|
const manifestScopes = manifest.typedContent.permissions?.scopes || [];
|
|
42
45
|
for (const element of manifest.typedContent.modules.trigger) {
|
|
43
46
|
for (const event of element.events) {
|
|
44
|
-
const
|
|
45
|
-
const missingScopes = await (0, scopes_1.getMissingScopes)(manifestScopes, requiredScopes);
|
|
47
|
+
const { missingScopes } = await validateEventScopes(event, manifestScopes, this.config);
|
|
46
48
|
missingScopes.forEach((scope) => addValidationError(scope, event));
|
|
47
49
|
}
|
|
48
50
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"simple-trigger-scope-validator.d.ts","sourceRoot":"","sources":["../../src/validators/simple-trigger-scope-validator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,4BAA4B,EAAE,MAAM,2BAA2B,CAAC;AA4BzE,wBAAsB,qBAAqB,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,4BAA4B,CAAC,CAgBlH"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.validateTriggerScopes = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const product_trigger_scopes_validator_1 = require("./product-trigger-scopes-validator");
|
|
6
|
+
const EVENT_SCOPE_MAPPING = tslib_1.__importStar(require("../mapping/product-event-to-scope-mapping.json"));
|
|
7
|
+
async function validateTriggerScopes(event, scopes) {
|
|
8
|
+
const { requiredScopes, missingScopes } = await (0, product_trigger_scopes_validator_1.validateEventScopes)(event, scopes, EVENT_SCOPE_MAPPING);
|
|
9
|
+
const hasRequirements = requiredScopes.current.length > 0;
|
|
10
|
+
return {
|
|
11
|
+
valid: missingScopes.length === 0,
|
|
12
|
+
event,
|
|
13
|
+
missingScopes,
|
|
14
|
+
requiredScopes: hasRequirements ? requiredScopes : null
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
exports.validateTriggerScopes = validateTriggerScopes;
|
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"validateFullPageApp.d.ts","sourceRoot":"","sources":["../../../../src/validators/modules-validators/confluence/validateFullPageApp.ts"],"names":[],"mappings":"AAAA,OAAO,EAAkB,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAGjE,OAAO,EAAE,OAAO,EAAE,MAAM,0BAA0B,CAAC;AAoBnD,eAAO,MAAM,mBAAmB,YAAa,OAAO,sBAAsB,MAAM,EAAE,KAAG,eAAe,EAkBnG,CAAC"}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.validateFullPageApp = void 0;
|
|
4
|
-
const types_1 = require("../../../types");
|
|
5
|
-
const text_1 = require("../../../text");
|
|
6
|
-
const utils_1 = require("../../../utils");
|
|
7
|
-
const validateFullPageApp = (modules, yamlContentByLine) => {
|
|
8
|
-
const validationErrors = [];
|
|
9
|
-
const moduleType = types_1.AllModuleTypes.ConfluenceFullPageApp;
|
|
10
|
-
const moduleArray = modules[moduleType];
|
|
11
|
-
if (moduleArray && moduleArray.length > 1) {
|
|
12
|
-
validationErrors.push({
|
|
13
|
-
message: text_1.errors.modules.singleEntryOfTheModule(moduleType),
|
|
14
|
-
reference: text_1.References.Modules,
|
|
15
|
-
level: 'error',
|
|
16
|
-
...(0, utils_1.findPosition)(moduleArray[1].key, yamlContentByLine)
|
|
17
|
-
});
|
|
18
|
-
}
|
|
19
|
-
return validationErrors;
|
|
20
|
-
};
|
|
21
|
-
exports.validateFullPageApp = validateFullPageApp;
|