@forge/manifest 13.6.0-next.3 → 13.6.0-next.5
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/out/schema/manifest-schema.json +55 -0
- package/out/schema/manifest.d.ts +22 -0
- package/out/validators/display-conditions-validator.d.ts +1 -1
- package/out/validators/display-conditions-validator.d.ts.map +1 -1
- package/out/validators/display-conditions-validator.js +7 -3
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# @forge/manifest
|
|
2
2
|
|
|
3
|
+
## 13.6.0-next.5
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 537590c: Update manifest definitions
|
|
8
|
+
|
|
9
|
+
## 13.6.0-next.4
|
|
10
|
+
|
|
11
|
+
### Minor Changes
|
|
12
|
+
|
|
13
|
+
- 5932866: Allow `and`/`or`/`not` in `displayConditions` on Jira and JSM modules to be a list of composite conditions, in addition to a single condition object.
|
|
14
|
+
|
|
3
15
|
## 13.6.0-next.3
|
|
4
16
|
|
|
5
17
|
### Minor Changes
|
|
@@ -3806,6 +3806,61 @@
|
|
|
3806
3806
|
},
|
|
3807
3807
|
"minItems": 1
|
|
3808
3808
|
},
|
|
3809
|
+
"confluence:attachmentAction": {
|
|
3810
|
+
"type": "array",
|
|
3811
|
+
"items": {
|
|
3812
|
+
"type": "object",
|
|
3813
|
+
"properties": {
|
|
3814
|
+
"title": {
|
|
3815
|
+
"type": "string",
|
|
3816
|
+
"minLength": 1,
|
|
3817
|
+
"maxLength": 100
|
|
3818
|
+
},
|
|
3819
|
+
"icon": {
|
|
3820
|
+
"type": "string",
|
|
3821
|
+
"minLength": 1,
|
|
3822
|
+
"maxLength": 255
|
|
3823
|
+
},
|
|
3824
|
+
"resource": {
|
|
3825
|
+
"type": "string",
|
|
3826
|
+
"minLength": 1,
|
|
3827
|
+
"maxLength": 47,
|
|
3828
|
+
"pattern": "^[a-zA-Z0-9_\\-]{1,23}(/[a-zA-Z0-9_\\-]{1,23})?$"
|
|
3829
|
+
},
|
|
3830
|
+
"resolvedResourceEntry": {
|
|
3831
|
+
"type": "string",
|
|
3832
|
+
"minLength": 1,
|
|
3833
|
+
"maxLength": 64,
|
|
3834
|
+
"pattern": "^[a-zA-Z0-9._-]+$"
|
|
3835
|
+
},
|
|
3836
|
+
"render": {
|
|
3837
|
+
"enum": [
|
|
3838
|
+
"native",
|
|
3839
|
+
"default"
|
|
3840
|
+
],
|
|
3841
|
+
"type": "string",
|
|
3842
|
+
"default": "default"
|
|
3843
|
+
},
|
|
3844
|
+
"location": {
|
|
3845
|
+
"type": "string",
|
|
3846
|
+
"enum": [
|
|
3847
|
+
"action",
|
|
3848
|
+
"metadata"
|
|
3849
|
+
]
|
|
3850
|
+
},
|
|
3851
|
+
"key": {
|
|
3852
|
+
"$ref": "#/definitions/ModuleKeySchema"
|
|
3853
|
+
}
|
|
3854
|
+
},
|
|
3855
|
+
"required": [
|
|
3856
|
+
"title",
|
|
3857
|
+
"resource",
|
|
3858
|
+
"location",
|
|
3859
|
+
"key"
|
|
3860
|
+
]
|
|
3861
|
+
},
|
|
3862
|
+
"minItems": 1
|
|
3863
|
+
},
|
|
3809
3864
|
"confluence:contentBylineItem": {
|
|
3810
3865
|
"type": "array",
|
|
3811
3866
|
"items": {
|
package/out/schema/manifest.d.ts
CHANGED
|
@@ -13654,6 +13654,28 @@ export interface Modules {
|
|
|
13654
13654
|
}
|
|
13655
13655
|
)[]
|
|
13656
13656
|
];
|
|
13657
|
+
'confluence:attachmentAction'?: [
|
|
13658
|
+
{
|
|
13659
|
+
title: string;
|
|
13660
|
+
icon?: string;
|
|
13661
|
+
resource: string;
|
|
13662
|
+
resolvedResourceEntry?: string;
|
|
13663
|
+
render?: 'native' | 'default';
|
|
13664
|
+
location: 'action' | 'metadata';
|
|
13665
|
+
key: ModuleKeySchema;
|
|
13666
|
+
[k: string]: unknown;
|
|
13667
|
+
},
|
|
13668
|
+
...{
|
|
13669
|
+
title: string;
|
|
13670
|
+
icon?: string;
|
|
13671
|
+
resource: string;
|
|
13672
|
+
resolvedResourceEntry?: string;
|
|
13673
|
+
render?: 'native' | 'default';
|
|
13674
|
+
location: 'action' | 'metadata';
|
|
13675
|
+
key: ModuleKeySchema;
|
|
13676
|
+
[k: string]: unknown;
|
|
13677
|
+
}[]
|
|
13678
|
+
];
|
|
13657
13679
|
'confluence:contentBylineItem'?: [
|
|
13658
13680
|
(
|
|
13659
13681
|
| {
|
|
@@ -7,7 +7,7 @@ export declare class DisplayConditionsValidator<T> implements ValidatorInterface
|
|
|
7
7
|
private readonly moduleSchemas;
|
|
8
8
|
private readonly supportedOperations;
|
|
9
9
|
constructor(schema: object);
|
|
10
|
-
flattenDisplayConditions(moduleKey: string, displayConditions: any, nesting?: number, location?: string): any;
|
|
10
|
+
flattenDisplayConditions(moduleType: string, moduleKey: string, displayConditions: any, nesting?: number, location?: string): any;
|
|
11
11
|
toValidationError(message: string): ValidationError;
|
|
12
12
|
private collectNestedDisplayConditionsTargets;
|
|
13
13
|
private validateDisplayConditions;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"display-conditions-validator.d.ts","sourceRoot":"","sources":["../../src/validators/display-conditions-validator.ts"],"names":[],"mappings":"AACA,OAAO,EAAkB,cAAc,EAAE,wBAAwB,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAGrG,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAC3D,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"display-conditions-validator.d.ts","sourceRoot":"","sources":["../../src/validators/display-conditions-validator.ts"],"names":[],"mappings":"AACA,OAAO,EAAkB,cAAc,EAAE,wBAAwB,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAGrG,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAC3D,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAsBpD,qBAAa,0BAA0B,CAAC,CAAC,CACvC,YAAW,kBAAkB,CAAC,cAAc,CAAC,cAAc,CAAC,GAAG,SAAS,EAAE,cAAc,CAAC;IAM7E,OAAO,CAAC,QAAQ,CAAC,MAAM;IAJnC,OAAO,CAAC,QAAQ,CAAC,cAAc,CAAmB;IAClD,OAAO,CAAC,QAAQ,CAAC,aAAa,CAAiB;IAC/C,OAAO,CAAC,QAAQ,CAAC,mBAAmB,CAA2B;gBAElC,MAAM,EAAE,MAAM;IAoE3C,wBAAwB,CACtB,UAAU,EAAE,MAAM,EAClB,SAAS,EAAE,MAAM,EACjB,iBAAiB,EAAE,GAAG,EACtB,OAAO,SAAI,EACX,QAAQ,CAAC,EAAE,MAAM,GAChB,GAAG;IAqCN,iBAAiB,CAAC,OAAO,EAAE,MAAM,GAAG,eAAe;IAanD,OAAO,CAAC,qCAAqC;IA0C7C,OAAO,CAAC,yBAAyB;IAuD3B,QAAQ,CACZ,QAAQ,EAAE,cAAc,CAAC,cAAc,CAAC,GAAG,SAAS,GACnD,OAAO,CAAC,wBAAwB,CAAC,cAAc,CAAC,CAAC;CA4ErD"}
|
|
@@ -9,6 +9,7 @@ const isPlainObject = (obj) => Object.prototype.toString.call(obj) === '[object
|
|
|
9
9
|
const errors = text_1.errors.modules.displayConditions;
|
|
10
10
|
const pageLocation = (page, index) => typeof page?.route === 'string' ? `page "${page.route}"` : `page[${index}]`;
|
|
11
11
|
const sectionLocation = (section, index) => typeof section?.header === 'string' ? `section "${section.header}"` : `section[${index}]`;
|
|
12
|
+
const isJiraOrJsmModuleType = (moduleType) => moduleType.startsWith('jira:') || moduleType.startsWith('jiraServiceManagement:');
|
|
12
13
|
class DisplayConditionsValidator {
|
|
13
14
|
schema;
|
|
14
15
|
validateSchema;
|
|
@@ -22,11 +23,14 @@ class DisplayConditionsValidator {
|
|
|
22
23
|
this.moduleSchemas = properties.modules?.properties;
|
|
23
24
|
this.supportedOperations = properties.operations?.items?.enum;
|
|
24
25
|
}
|
|
25
|
-
flattenDisplayConditions(moduleKey, displayConditions, nesting = 0, location) {
|
|
26
|
+
flattenDisplayConditions(moduleType, moduleKey, displayConditions, nesting = 0, location) {
|
|
26
27
|
if (nesting >= 10) {
|
|
27
28
|
throw Error(errors.overcomplicated(moduleKey, location));
|
|
28
29
|
}
|
|
29
30
|
if (Array.isArray(displayConditions)) {
|
|
31
|
+
if (isJiraOrJsmModuleType(moduleType)) {
|
|
32
|
+
return displayConditions.flatMap((entry) => this.flattenDisplayConditions(moduleType, moduleKey, entry, nesting, location));
|
|
33
|
+
}
|
|
30
34
|
return [displayConditions];
|
|
31
35
|
}
|
|
32
36
|
const result = [];
|
|
@@ -34,7 +38,7 @@ class DisplayConditionsValidator {
|
|
|
34
38
|
const keys = Object.keys(displayConditions);
|
|
35
39
|
for (let i = 0; i < keys.length; i += 1) {
|
|
36
40
|
if (this.supportedOperations.includes(keys[i])) {
|
|
37
|
-
result.push(...this.flattenDisplayConditions(moduleKey, displayConditions[keys[i]], nesting + 1, location));
|
|
41
|
+
result.push(...this.flattenDisplayConditions(moduleType, moduleKey, displayConditions[keys[i]], nesting + 1, location));
|
|
38
42
|
}
|
|
39
43
|
else {
|
|
40
44
|
obj[keys[i]] = displayConditions[keys[i]];
|
|
@@ -90,7 +94,7 @@ class DisplayConditionsValidator {
|
|
|
90
94
|
}
|
|
91
95
|
let flattened = [];
|
|
92
96
|
try {
|
|
93
|
-
flattened = this.flattenDisplayConditions(moduleKey, displayConditions, 0, location);
|
|
97
|
+
flattened = this.flattenDisplayConditions(moduleType, moduleKey, displayConditions, 0, location);
|
|
94
98
|
}
|
|
95
99
|
catch (e) {
|
|
96
100
|
reportError('n/a', e.message);
|