@atlassian/forge-conditions 0.3.4 → 0.3.5-experimental-04cc2b9
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 +18 -0
- package/LICENSE.txt +1 -1
- package/out/check.d.ts.map +1 -1
- package/out/check.js +4 -1
- package/out/common.d.ts.map +1 -1
- package/out/common.js +1 -1
- package/out/condition-types/entity-property.d.ts.map +1 -1
- package/out/types.d.ts +13 -13
- package/out/types.d.ts.map +1 -1
- package/out/types.js +2 -2
- package/package.json +12 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,23 @@
|
|
|
1
1
|
# @atlassian/forge-conditions
|
|
2
2
|
|
|
3
|
+
## 0.3.5-experimental-04cc2b9
|
|
4
|
+
|
|
5
|
+
### Major Changes
|
|
6
|
+
|
|
7
|
+
- d9ef926: Adds support for TypeScript 5
|
|
8
|
+
|
|
9
|
+
## 0.3.5
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- 94243f1: Split development and contribution guidelines
|
|
14
|
+
|
|
15
|
+
## 0.3.5-next.0
|
|
16
|
+
|
|
17
|
+
### Patch Changes
|
|
18
|
+
|
|
19
|
+
- 94243f1: Split development and contribution guidelines
|
|
20
|
+
|
|
3
21
|
## 0.3.4
|
|
4
22
|
|
|
5
23
|
### Patch Changes
|
package/LICENSE.txt
CHANGED
package/out/check.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"check.d.ts","sourceRoot":"","sources":["../src/check.ts"],"names":[],"mappings":"AAAA,OAAO,EAAkD,UAAU,EAAE,aAAa,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"check.d.ts","sourceRoot":"","sources":["../src/check.ts"],"names":[],"mappings":"AAAA,OAAO,EAAkD,UAAU,EAAE,aAAa,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAsNxH,eAAO,MAAM,kBAAkB,GAC7B,YAAY,UAAU,EACtB,eAAe,aAAa,EAC5B,qBAAqB,kBAAkB,KACtC,OAAO,CAAC,OAAO,CAAC,GAAG,OAwBrB,CAAC"}
|
package/out/check.js
CHANGED
|
@@ -26,7 +26,10 @@ const checkOperation = (operation, conditionsInput, staticContextInput, clientDa
|
|
|
26
26
|
const staticKeysLength = staticKeys.length;
|
|
27
27
|
const operationsLength = operationEntries.length;
|
|
28
28
|
const propertyConditionsLength = propertyConditions.length;
|
|
29
|
-
const staticEqualityComparator = (key) =>
|
|
29
|
+
const staticEqualityComparator = (key) => {
|
|
30
|
+
const cond = conditions;
|
|
31
|
+
return (Array.isArray(cond[key]) ? cond[key] : [cond[key]]).includes(staticContext[key]);
|
|
32
|
+
};
|
|
30
33
|
if (staticKeysLength === 0 && operationsLength === 0 && propertyConditionsLength === 0) {
|
|
31
34
|
return common_1.Instruction.Skip;
|
|
32
35
|
}
|
package/out/common.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"common.d.ts","sourceRoot":"","sources":["../src/common.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EACZ,YAAY,EAEZ,WAAW,EACX,qBAAqB,EACrB,mBAAmB,EACpB,MAAM,SAAS,CAAC;AAEjB,eAAO,MAAM,aAAa,EAAE,YAAoB,CAAC;AACjD,eAAO,MAAM,YAAY,EAAE,WAAkB,CAAC;AAC9C,eAAO,MAAM,aAAa,EAAE,YAAoB,CAAC;AACjD,eAAO,MAAM,oBAAoB,EAAE,mBAAkE,CAAC;AAEtG,oBAAY,WAAW;IACrB,IAAI,SAAS;IACb,QAAQ,cAAc;IACtB,QAAQ,aAAa;CACtB;AAED,eAAO,MAAM,QAAQ,
|
|
1
|
+
{"version":3,"file":"common.d.ts","sourceRoot":"","sources":["../src/common.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EACZ,YAAY,EAEZ,WAAW,EACX,qBAAqB,EACrB,mBAAmB,EACpB,MAAM,SAAS,CAAC;AAEjB,eAAO,MAAM,aAAa,EAAE,YAAoB,CAAC;AACjD,eAAO,MAAM,YAAY,EAAE,WAAkB,CAAC;AAC9C,eAAO,MAAM,aAAa,EAAE,YAAoB,CAAC;AACjD,eAAO,MAAM,oBAAoB,EAAE,mBAAkE,CAAC;AAEtG,oBAAY,WAAW;IACrB,IAAI,SAAS;IACb,QAAQ,cAAc;IACtB,QAAQ,aAAa;CACtB;AAED,eAAO,MAAM,QAAQ,GAAI,GAAG,GAAG,KAAG,OAAkE,CAAC;AACrG,eAAO,MAAM,eAAe,GAAI,GAAG,GAAG,KAAG,OAA0C,CAAC;AAEpF,eAAO,MAAM,WAAW,GAAI,KAAK,MAAM,KAAG,OAA0D,CAAC;AACrG,eAAO,MAAM,yBAAyB,GAAI,KAAK,MAAM,KAAG,GAAG,IAAI,qBACc,CAAC;AAC9E,eAAO,MAAM,WAAW,GAAI,KAAK,MAAM,KAAG,OAA4E,CAAC"}
|
package/out/common.js
CHANGED
|
@@ -11,7 +11,7 @@ var Instruction;
|
|
|
11
11
|
Instruction["Skip"] = "skip";
|
|
12
12
|
Instruction["NeedData"] = "need-data";
|
|
13
13
|
Instruction["Continue"] = "continue";
|
|
14
|
-
})(Instruction
|
|
14
|
+
})(Instruction || (exports.Instruction = Instruction = {}));
|
|
15
15
|
const isObject = (x) => Object.prototype.toString.call(x) === '[object Object]';
|
|
16
16
|
exports.isObject = isObject;
|
|
17
17
|
const isObjectOrArray = (x) => (0, exports.isObject)(x) || Array.isArray(x);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"entity-property.d.ts","sourceRoot":"","sources":["../../src/condition-types/entity-property.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,UAAU,EACV,UAAU,EAEV,uBAAuB,EAEvB,oBAAoB,EAErB,MAAM,UAAU,CAAC;AAElB,OAAO,EAIL,WAAW,EAIZ,MAAM,WAAW,CAAC;AAiHnB,eAAO,MAAM,sBAAsB;8BAxDb,uBAAuB,EAAE,eAChC,UAAU,KACtB,OAAO,GAAG,WAAW;6BAgBF,uBAAuB,EAAE,eAChC,UAAU,KACtB,OAAO,GAAG,WAAW;8BAgBF,uBAAuB,EAAE,eAChC,UAAU,KACtB,OAAO,GAAG,WAAW;CAsBvB,CAAC;AAgBF,eAAO,MAAM,8BAA8B,
|
|
1
|
+
{"version":3,"file":"entity-property.d.ts","sourceRoot":"","sources":["../../src/condition-types/entity-property.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,UAAU,EACV,UAAU,EAEV,uBAAuB,EAEvB,oBAAoB,EAErB,MAAM,UAAU,CAAC;AAElB,OAAO,EAIL,WAAW,EAIZ,MAAM,WAAW,CAAC;AAiHnB,eAAO,MAAM,sBAAsB;8BAxDb,uBAAuB,EAAE,eAChC,UAAU,KACtB,OAAO,GAAG,WAAW;6BAgBF,uBAAuB,EAAE,eAChC,UAAU,KACtB,OAAO,GAAG,WAAW;8BAgBF,uBAAuB,EAAE,eAChC,UAAU,KACtB,OAAO,GAAG,WAAW;CAsBvB,CAAC;AAgBF,eAAO,MAAM,8BAA8B,GAAI,iBAAiB,UAAU,KAAG,oBAAoB,EAiChG,CAAC"}
|
package/out/types.d.ts
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
export
|
|
2
|
-
export
|
|
3
|
-
export
|
|
4
|
-
export
|
|
5
|
-
export
|
|
6
|
-
export
|
|
7
|
-
export
|
|
1
|
+
export type AndOperation = 'and';
|
|
2
|
+
export type OrOperation = 'or';
|
|
3
|
+
export type NotOperation = 'not';
|
|
4
|
+
export type Operation = AndOperation | OrOperation | NotOperation;
|
|
5
|
+
export type SupportedOperations = [AndOperation, OrOperation, NotOperation];
|
|
6
|
+
export type GenericCondition<T> = AndCondition<T> | OrCondition<T> | NotCondition<T> | T;
|
|
7
|
+
export type AndCondition<T> = T & {
|
|
8
8
|
[key in AndOperation]: GenericCondition<T>;
|
|
9
9
|
};
|
|
10
|
-
export
|
|
10
|
+
export type OrCondition<T> = T & {
|
|
11
11
|
[key in OrOperation]: GenericCondition<T>;
|
|
12
12
|
};
|
|
13
|
-
export
|
|
13
|
+
export type NotCondition<T> = T & {
|
|
14
14
|
[key in NotOperation]: GenericCondition<T>;
|
|
15
15
|
};
|
|
16
16
|
export declare enum PropertyConditionType {
|
|
@@ -29,7 +29,7 @@ export interface EntityProperty {
|
|
|
29
29
|
objectName?: string;
|
|
30
30
|
value: string | string[];
|
|
31
31
|
}
|
|
32
|
-
export
|
|
32
|
+
export type EntityPropertyCondition = {
|
|
33
33
|
[key in PropertyConditionType]?: EntityProperty;
|
|
34
34
|
};
|
|
35
35
|
export interface PropertyValueRequest {
|
|
@@ -54,9 +54,9 @@ export declare class ClientDataProvider {
|
|
|
54
54
|
resolve(clientData: ClientData): void;
|
|
55
55
|
reject(reason: any): void;
|
|
56
56
|
}
|
|
57
|
-
export
|
|
58
|
-
export
|
|
59
|
-
export
|
|
57
|
+
export type Condition = StaticContext | (StaticContext & EntityPropertyCondition) | EntityPropertyCondition[];
|
|
58
|
+
export type Conditions = GenericCondition<Condition>;
|
|
59
|
+
export type StaticContext = {
|
|
60
60
|
[key in string]: any;
|
|
61
61
|
};
|
|
62
62
|
//# sourceMappingURL=types.d.ts.map
|
package/out/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAEA,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAEA,MAAM,MAAM,YAAY,GAAG,KAAK,CAAC;AACjC,MAAM,MAAM,WAAW,GAAG,IAAI,CAAC;AAC/B,MAAM,MAAM,YAAY,GAAG,KAAK,CAAC;AAEjC,MAAM,MAAM,SAAS,GAAG,YAAY,GAAG,WAAW,GAAG,YAAY,CAAC;AAClE,MAAM,MAAM,mBAAmB,GAAG,CAAC,YAAY,EAAE,WAAW,EAAE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AAM,EAAE,CAAC;CACjC;AAKD,MAAM,WAAW,UAAU;IACzB,cAAc,EAAE,sBAAsB,CAAC;CACxC;AAaD,qBAAa,kBAAkB;IAC7B,OAAO,CAAC,QAAQ,CAAC,kBAAkB,CAAsB;IACzD,OAAO,CAAC,kBAAkB,CAAC,CAA8B;IACzD,OAAO,CAAC,iBAAiB,CAAC,CAAwB;IAKlD,qBAAqB,EAAE,oBAAoB,EAAE,CAAC;;IAe9C,mBAAmB,CAAC,iBAAiB,EAAE,oBAAoB,EAAE,GAAG,OAAO,CAAC,UAAU,CAAC;IAanF,OAAO,CAAC,UAAU,EAAE,UAAU,GAAG,IAAI;IAYrC,MAAM,CAAC,MAAM,EAAE,GAAG,GAAG,IAAI;CAG1B;AAQD,MAAM,MAAM,SAAS,GAAG,aAAa,GAAG,CAAC,aAAa,GAAG,uBAAuB,CAAC,GAAG,uBAAuB,EAAE,CAAC;AAK9G,MAAM,MAAM,UAAU,GAAG,gBAAgB,CAAC,SAAS,CAAC,CAAC;AAQrD,MAAM,MAAM,aAAa,GAAG;KACzB,GAAG,IAAI,MAAM,GAAG,GAAG;CACrB,CAAC"}
|
package/out/types.js
CHANGED
|
@@ -7,12 +7,12 @@ var PropertyConditionType;
|
|
|
7
7
|
PropertyConditionType["EntityPropertyEqualTo"] = "entityPropertyEqualTo";
|
|
8
8
|
PropertyConditionType["EntityPropertyContainsAny"] = "entityPropertyContainsAny";
|
|
9
9
|
PropertyConditionType["EntityPropertyContainsAll"] = "entityPropertyContainsAll";
|
|
10
|
-
})(PropertyConditionType
|
|
10
|
+
})(PropertyConditionType || (exports.PropertyConditionType = PropertyConditionType = {}));
|
|
11
11
|
var EntityType;
|
|
12
12
|
(function (EntityType) {
|
|
13
13
|
EntityType["Space"] = "space";
|
|
14
14
|
EntityType["Content"] = "content";
|
|
15
|
-
})(EntityType
|
|
15
|
+
})(EntityType || (exports.EntityType = EntityType = {}));
|
|
16
16
|
class ClientDataProvider {
|
|
17
17
|
constructor() {
|
|
18
18
|
this.globalFetchPromise = new Promise((resolve, reject) => {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlassian/forge-conditions",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.5-experimental-04cc2b9",
|
|
4
4
|
"description": "Support conditions in the forge apps",
|
|
5
5
|
"main": "out/index.js",
|
|
6
6
|
"license": "SEE LICENSE IN LICENSE.txt",
|
|
@@ -11,5 +11,16 @@
|
|
|
11
11
|
},
|
|
12
12
|
"publishConfig": {
|
|
13
13
|
"registry": "https://packages.atlassian.com/api/npm/npm-public/"
|
|
14
|
+
},
|
|
15
|
+
"peerDependencies": {
|
|
16
|
+
"typescript": ">=5.0.0"
|
|
17
|
+
},
|
|
18
|
+
"peerDependenciesMeta": {
|
|
19
|
+
"typescript": {
|
|
20
|
+
"optional": true
|
|
21
|
+
}
|
|
22
|
+
},
|
|
23
|
+
"devDependencies": {
|
|
24
|
+
"typescript": "5.9.2"
|
|
14
25
|
}
|
|
15
26
|
}
|