@pax2pay/model-banking 0.1.73 → 0.1.75
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/Card/Creatable.ts +0 -3
- package/Card/Expiry.ts +1 -3
- package/Card/index.ts +0 -4
- package/Organization/Rule.ts +11 -13
- package/dist/Card/Creatable.d.ts +0 -2
- package/dist/Card/Creatable.js +0 -2
- package/dist/Card/Creatable.js.map +1 -1
- package/dist/Card/Expiry.d.ts +1 -1
- package/dist/Card/Expiry.js +1 -3
- package/dist/Card/Expiry.js.map +1 -1
- package/dist/Card/index.d.ts +0 -2
- package/dist/Card/index.js +0 -3
- package/dist/Card/index.js.map +1 -1
- package/dist/Organization/Rule.d.ts +7 -4
- package/dist/Organization/Rule.js +6 -9
- package/dist/Organization/Rule.js.map +1 -1
- package/package.json +1 -1
package/Card/Creatable.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { isoly } from "isoly"
|
|
2
2
|
import { isly } from "isly"
|
|
3
|
-
import { Realm } from "../Realm"
|
|
4
3
|
import { Expiry } from "./Expiry"
|
|
5
4
|
import { Meta } from "./Meta"
|
|
6
5
|
import { Preset } from "./Preset"
|
|
@@ -8,7 +7,6 @@ import { Preset } from "./Preset"
|
|
|
8
7
|
export interface Creatable {
|
|
9
8
|
account: string
|
|
10
9
|
number?: string
|
|
11
|
-
realm: Realm
|
|
12
10
|
preset: Preset
|
|
13
11
|
details: {
|
|
14
12
|
iin: string
|
|
@@ -24,7 +22,6 @@ export namespace Creatable {
|
|
|
24
22
|
export const type = isly.object<Creatable>({
|
|
25
23
|
account: isly.string(),
|
|
26
24
|
number: isly.string().optional(),
|
|
27
|
-
realm: isly.fromIs("Realm", Realm.is),
|
|
28
25
|
preset: Preset.type,
|
|
29
26
|
details: isly.object({
|
|
30
27
|
iin: isly.string(),
|
package/Card/Expiry.ts
CHANGED
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import { isly } from "isly"
|
|
2
2
|
|
|
3
|
-
const year = [
|
|
4
|
-
2023, 2024, 2025, 2026, 2027, 2028, 2029, 2030, 2031, 2032, 2033, 2034, 2035, 2036, 2037, 2038, 2039, 2040,
|
|
5
|
-
] as const
|
|
3
|
+
const year = [23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40] as const
|
|
6
4
|
type Year = typeof year[number]
|
|
7
5
|
|
|
8
6
|
const month = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12] as const
|
package/Card/index.ts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { cryptly } from "cryptly"
|
|
2
2
|
import { isoly } from "isoly"
|
|
3
3
|
import { isly } from "isly"
|
|
4
|
-
import { Realm } from "../Realm"
|
|
5
4
|
import { Changeable as CardChangeable } from "./Changeable"
|
|
6
5
|
import { Creatable as CardCreatable } from "./Creatable"
|
|
7
6
|
import { Expiry as CardExpiry } from "./Expiry"
|
|
@@ -15,7 +14,6 @@ export interface Card {
|
|
|
15
14
|
created: isoly.DateTime
|
|
16
15
|
organization: string
|
|
17
16
|
account: string
|
|
18
|
-
realm: Realm
|
|
19
17
|
preset: CardPreset
|
|
20
18
|
reference?: string
|
|
21
19
|
details: {
|
|
@@ -42,7 +40,6 @@ export namespace Card {
|
|
|
42
40
|
created: created,
|
|
43
41
|
organization: organization,
|
|
44
42
|
account: card.account,
|
|
45
|
-
realm: card.realm,
|
|
46
43
|
preset: card.preset,
|
|
47
44
|
details: {
|
|
48
45
|
iin: card.details.iin,
|
|
@@ -65,7 +62,6 @@ export namespace Card {
|
|
|
65
62
|
created: isly.string(),
|
|
66
63
|
organization: isly.string(),
|
|
67
64
|
account: isly.string(),
|
|
68
|
-
realm: isly.fromIs("Realm", Realm.is),
|
|
69
65
|
preset: CardPreset.type,
|
|
70
66
|
reference: isly.string().optional(),
|
|
71
67
|
details: isly.object({
|
package/Organization/Rule.ts
CHANGED
|
@@ -1,11 +1,14 @@
|
|
|
1
1
|
import { selectively } from "selectively"
|
|
2
2
|
|
|
3
|
+
const action = ["review", "reject", "flag"] as const
|
|
4
|
+
const type = ["authorization", "outbound", "inbound"] as const
|
|
3
5
|
export interface Rule {
|
|
4
|
-
|
|
5
|
-
action: "approve" | "review" | "approveReview" | "reject"
|
|
6
|
-
type: "transaction" | "authorization"
|
|
7
|
-
condition: string
|
|
6
|
+
name: string
|
|
8
7
|
description: string
|
|
8
|
+
action: typeof action[number]
|
|
9
|
+
type: typeof type[number]
|
|
10
|
+
condition: string
|
|
11
|
+
flags: string[]
|
|
9
12
|
}
|
|
10
13
|
|
|
11
14
|
interface RuleResult {
|
|
@@ -27,19 +30,14 @@ export namespace Rule {
|
|
|
27
30
|
return (
|
|
28
31
|
value &&
|
|
29
32
|
typeof value == "object" &&
|
|
30
|
-
typeof value.
|
|
31
|
-
|
|
32
|
-
(value.
|
|
33
|
-
value.action == "reject" ||
|
|
34
|
-
value.action == "review" ||
|
|
35
|
-
value.action == "approveReview") &&
|
|
36
|
-
typeof value.type == "string" &&
|
|
37
|
-
(value.type == "transaction" || value.type == "authorization") &&
|
|
33
|
+
typeof value.name == "string" &&
|
|
34
|
+
action.includes(value.action) &&
|
|
35
|
+
type.includes(value.type) &&
|
|
38
36
|
typeof value.condition == "string" &&
|
|
39
37
|
typeof value.description == "string"
|
|
40
38
|
)
|
|
41
39
|
}
|
|
42
40
|
export function stringify(rule: Rule): string {
|
|
43
|
-
return `{ label: ${rule.
|
|
41
|
+
return `{ label: ${rule.name}, action: ${rule.action}, type: ${rule.type}, condition: ${rule.condition}, description: ${rule.description}. }`
|
|
44
42
|
}
|
|
45
43
|
}
|
package/dist/Card/Creatable.d.ts
CHANGED
|
@@ -1,13 +1,11 @@
|
|
|
1
1
|
import { isoly } from "isoly";
|
|
2
2
|
import { isly } from "isly";
|
|
3
|
-
import { Realm } from "../Realm";
|
|
4
3
|
import { Expiry } from "./Expiry";
|
|
5
4
|
import { Meta } from "./Meta";
|
|
6
5
|
import { Preset } from "./Preset";
|
|
7
6
|
export interface Creatable {
|
|
8
7
|
account: string;
|
|
9
8
|
number?: string;
|
|
10
|
-
realm: Realm;
|
|
11
9
|
preset: Preset;
|
|
12
10
|
details: {
|
|
13
11
|
iin: string;
|
package/dist/Card/Creatable.js
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { isoly } from "isoly";
|
|
2
2
|
import { isly } from "isly";
|
|
3
|
-
import { Realm } from "../Realm";
|
|
4
3
|
import { Expiry } from "./Expiry";
|
|
5
4
|
import { Meta } from "./Meta";
|
|
6
5
|
import { Preset } from "./Preset";
|
|
@@ -9,7 +8,6 @@ export var Creatable;
|
|
|
9
8
|
Creatable.type = isly.object({
|
|
10
9
|
account: isly.string(),
|
|
11
10
|
number: isly.string().optional(),
|
|
12
|
-
realm: isly.fromIs("Realm", Realm.is),
|
|
13
11
|
preset: Preset.type,
|
|
14
12
|
details: isly.object({
|
|
15
13
|
iin: isly.string(),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Creatable.js","sourceRoot":"../","sources":["Card/Creatable.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,OAAO,CAAA;AAC7B,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAA;AAC3B,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"Creatable.js","sourceRoot":"../","sources":["Card/Creatable.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,OAAO,CAAA;AAC7B,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAA;AAC3B,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAA;AACjC,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAA;AAC7B,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAA;AAgBjC,MAAM,KAAW,SAAS,CAezB;AAfD,WAAiB,SAAS;IACZ,cAAI,GAAG,IAAI,CAAC,MAAM,CAAY;QAC1C,OAAO,EAAE,IAAI,CAAC,MAAM,EAAE;QACtB,MAAM,EAAE,IAAI,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;QAChC,MAAM,EAAE,MAAM,CAAC,IAAI;QACnB,OAAO,EAAE,IAAI,CAAC,MAAM,CAAC;YACpB,GAAG,EAAE,IAAI,CAAC,MAAM,EAAE;YAClB,MAAM,EAAE,MAAM,CAAC,IAAI;YACnB,MAAM,EAAE,IAAI,CAAC,MAAM,EAAE;SACrB,CAAC;QACF,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,gBAAgB,EAAE,KAAK,CAAC,QAAQ,CAAC,EAAE,CAAC,EAAE,IAAI,CAAC,MAAM,EAAE,CAAC;QAClF,KAAK,EAAE,IAAI,CAAC,MAAM,EAAE,CAAC,KAAK,EAAE,CAAC,QAAQ,EAAE;QACvC,IAAI,EAAE,IAAI,CAAC,MAAM,CAAC,WAAW,EAAE,IAAI,CAAC,EAAE,CAAC,CAAC,QAAQ,EAAE;KAClD,CAAC,CAAA;IACW,YAAE,GAAG,UAAA,IAAI,CAAC,EAAE,CAAA;AAC1B,CAAC,EAfgB,SAAS,KAAT,SAAS,QAezB"}
|
package/dist/Card/Expiry.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { isly } from "isly";
|
|
2
|
-
declare const year: readonly [
|
|
2
|
+
declare const year: readonly [23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40];
|
|
3
3
|
type Year = typeof year[number];
|
|
4
4
|
declare const month: readonly [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12];
|
|
5
5
|
type Month = typeof month[number];
|
package/dist/Card/Expiry.js
CHANGED
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
import { isly } from "isly";
|
|
2
|
-
const year = [
|
|
3
|
-
2023, 2024, 2025, 2026, 2027, 2028, 2029, 2030, 2031, 2032, 2033, 2034, 2035, 2036, 2037, 2038, 2039, 2040,
|
|
4
|
-
];
|
|
2
|
+
const year = [23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40];
|
|
5
3
|
const month = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12];
|
|
6
4
|
export var Expiry;
|
|
7
5
|
(function (Expiry) {
|
package/dist/Card/Expiry.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Expiry.js","sourceRoot":"../","sources":["Card/Expiry.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAA;AAE3B,MAAM,IAAI,GAAG
|
|
1
|
+
{"version":3,"file":"Expiry.js","sourceRoot":"../","sources":["Card/Expiry.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAA;AAE3B,MAAM,IAAI,GAAG,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,CAAU,CAAA;AAG9F,MAAM,KAAK,GAAG,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,CAAU,CAAA;AAI9D,MAAM,KAAW,MAAM,CAGtB;AAHD,WAAiB,MAAM;IACT,WAAI,GAAG,IAAI,CAAC,KAAK,CAAS,IAAI,CAAC,MAAM,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC,GAAG,KAAK,CAAC,CAAC,CAAC,CAAA;IAC1E,SAAE,GAAG,OAAA,IAAI,CAAC,EAAE,CAAA;AAC1B,CAAC,EAHgB,MAAM,KAAN,MAAM,QAGtB"}
|
package/dist/Card/index.d.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { isoly } from "isoly";
|
|
2
2
|
import { isly } from "isly";
|
|
3
|
-
import { Realm } from "../Realm";
|
|
4
3
|
import { Changeable as CardChangeable } from "./Changeable";
|
|
5
4
|
import { Creatable as CardCreatable } from "./Creatable";
|
|
6
5
|
import { Expiry as CardExpiry } from "./Expiry";
|
|
@@ -13,7 +12,6 @@ export interface Card {
|
|
|
13
12
|
created: isoly.DateTime;
|
|
14
13
|
organization: string;
|
|
15
14
|
account: string;
|
|
16
|
-
realm: Realm;
|
|
17
15
|
preset: CardPreset;
|
|
18
16
|
reference?: string;
|
|
19
17
|
details: {
|
package/dist/Card/index.js
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { cryptly } from "cryptly";
|
|
2
2
|
import { isoly } from "isoly";
|
|
3
3
|
import { isly } from "isly";
|
|
4
|
-
import { Realm } from "../Realm";
|
|
5
4
|
import { Changeable as CardChangeable } from "./Changeable";
|
|
6
5
|
import { Creatable as CardCreatable } from "./Creatable";
|
|
7
6
|
import { Expiry as CardExpiry } from "./Expiry";
|
|
@@ -18,7 +17,6 @@ export var Card;
|
|
|
18
17
|
created: created,
|
|
19
18
|
organization: organization,
|
|
20
19
|
account: card.account,
|
|
21
|
-
realm: card.realm,
|
|
22
20
|
preset: card.preset,
|
|
23
21
|
details: {
|
|
24
22
|
iin: card.details.iin,
|
|
@@ -42,7 +40,6 @@ export var Card;
|
|
|
42
40
|
created: isly.string(),
|
|
43
41
|
organization: isly.string(),
|
|
44
42
|
account: isly.string(),
|
|
45
|
-
realm: isly.fromIs("Realm", Realm.is),
|
|
46
43
|
preset: CardPreset.type,
|
|
47
44
|
reference: isly.string().optional(),
|
|
48
45
|
details: isly.object({
|
package/dist/Card/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"../","sources":["Card/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAA;AACjC,OAAO,EAAE,KAAK,EAAE,MAAM,OAAO,CAAA;AAC7B,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAA;AAC3B,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"../","sources":["Card/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAA;AACjC,OAAO,EAAE,KAAK,EAAE,MAAM,OAAO,CAAA;AAC7B,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAA;AAC3B,OAAO,EAAE,UAAU,IAAI,cAAc,EAAE,MAAM,cAAc,CAAA;AAC3D,OAAO,EAAE,SAAS,IAAI,aAAa,EAAE,MAAM,aAAa,CAAA;AACxD,OAAO,EAAE,MAAM,IAAI,UAAU,EAAE,MAAM,UAAU,CAAA;AAC/C,OAAO,EAAE,IAAI,IAAI,QAAQ,EAAE,MAAM,QAAQ,CAAA;AACzC,OAAO,EAAE,SAAS,IAAI,aAAa,EAAE,MAAM,aAAa,CAAA;AACxD,OAAO,EAAE,MAAM,IAAI,UAAU,EAAE,MAAM,UAAU,CAAA;AAyB/C,MAAM,KAAW,IAAI,CA4DpB;AA5DD,WAAiB,IAAI;IACpB,SAAgB,aAAa,CAAC,IAAe,EAAE,YAAoB,EAAE,KAAa,EAAE,KAAa;QAChG,MAAM,OAAO,GAAG,KAAK,CAAC,QAAQ,CAAC,GAAG,EAAE,CAAA;QACpC,OAAO;YACN,EAAE,EAAE,OAAO,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC,CAAC;YAClC,MAAM,EAAE,IAAI,CAAC,MAAM;YACnB,OAAO,EAAE,OAAO;YAChB,YAAY,EAAE,YAAY;YAC1B,OAAO,EAAE,IAAI,CAAC,OAAO;YACrB,MAAM,EAAE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MAAM,EAAE;SACpB,CAAC;QACF,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,gBAAgB,EAAE,KAAK,CAAC,QAAQ,CAAC,EAAE,CAAC,EAAE,IAAI,CAAC,MAAM,EAAE,CAAC;QAClF,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,gBAAgB,EAAE,KAAK,CAAC,QAAQ,CAAC,EAAE,CAAC,EAAE,IAAI,CAAC,MAAM,EAAE,CAAC;QAClF,MAAM,EAAE,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,EAAE,IAAI,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC;QACnE,OAAO,EAAE,IAAI,CAAC,KAAK,CAAC,aAAa,CAAC,IAAI,CAAC;QACvC,KAAK,EAAE,IAAI,CAAC,MAAM,EAAE,CAAC,KAAK,EAAE;QAC5B,IAAI,EAAE,IAAI,CAAC,MAAM,CAAC,WAAW,EAAE,QAAQ,CAAC,EAAE,CAAC,CAAC,QAAQ,EAAE;KACtD,CAAC,CAAA;IACW,OAAE,GAAG,KAAA,IAAI,CAAC,EAAE,CAAA;IAEZ,cAAS,GAAG,aAAa,CAAA;IAEzB,WAAM,GAAG,UAAU,CAAA;IAEnB,SAAI,GAAG,QAAQ,CAAA;IAEf,WAAM,GAAG,UAAU,CAAA;IAEnB,eAAU,GAAG,cAAc,CAAA;IAE3B,cAAS,GAAG,aAAa,CAAA;AACvC,CAAC,EA5DgB,IAAI,KAAJ,IAAI,QA4DpB"}
|
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
import { selectively } from "selectively";
|
|
2
|
+
declare const action: readonly ["review", "reject", "flag"];
|
|
3
|
+
declare const type: readonly ["authorization", "outbound", "inbound"];
|
|
2
4
|
export interface Rule {
|
|
3
|
-
|
|
4
|
-
action: "approve" | "review" | "approveReview" | "reject";
|
|
5
|
-
type: "transaction" | "authorization";
|
|
6
|
-
condition: string;
|
|
5
|
+
name: string;
|
|
7
6
|
description: string;
|
|
7
|
+
action: typeof action[number];
|
|
8
|
+
type: typeof type[number];
|
|
9
|
+
condition: string;
|
|
10
|
+
flags: string[];
|
|
8
11
|
}
|
|
9
12
|
interface RuleResult {
|
|
10
13
|
rule: Rule;
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
const action = ["review", "reject", "flag"];
|
|
2
|
+
const type = ["authorization", "outbound", "inbound"];
|
|
1
3
|
var RuleResult;
|
|
2
4
|
(function (RuleResult) {
|
|
3
5
|
function stringify(data) {
|
|
@@ -11,20 +13,15 @@ export var Rule;
|
|
|
11
13
|
function is(value) {
|
|
12
14
|
return (value &&
|
|
13
15
|
typeof value == "object" &&
|
|
14
|
-
typeof value.
|
|
15
|
-
|
|
16
|
-
(value.
|
|
17
|
-
value.action == "reject" ||
|
|
18
|
-
value.action == "review" ||
|
|
19
|
-
value.action == "approveReview") &&
|
|
20
|
-
typeof value.type == "string" &&
|
|
21
|
-
(value.type == "transaction" || value.type == "authorization") &&
|
|
16
|
+
typeof value.name == "string" &&
|
|
17
|
+
action.includes(value.action) &&
|
|
18
|
+
type.includes(value.type) &&
|
|
22
19
|
typeof value.condition == "string" &&
|
|
23
20
|
typeof value.description == "string");
|
|
24
21
|
}
|
|
25
22
|
Rule.is = is;
|
|
26
23
|
function stringify(rule) {
|
|
27
|
-
return `{ label: ${rule.
|
|
24
|
+
return `{ label: ${rule.name}, action: ${rule.action}, type: ${rule.type}, condition: ${rule.condition}, description: ${rule.description}. }`;
|
|
28
25
|
}
|
|
29
26
|
Rule.stringify = stringify;
|
|
30
27
|
})(Rule || (Rule = {}));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Rule.js","sourceRoot":"../","sources":["Organization/Rule.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Rule.js","sourceRoot":"../","sources":["Organization/Rule.ts"],"names":[],"mappings":"AAEA,MAAM,MAAM,GAAG,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