@pax2pay/model-banking 0.1.161 → 0.1.163
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/Operation/index.ts +16 -9
- package/Rule/Rule.ts +0 -4
- package/Rule/index.ts +0 -1
- package/dist/Operation/index.d.ts +5 -4
- package/dist/Operation/index.js +9 -3
- package/dist/Operation/index.js.map +1 -1
- package/dist/Rule/Rule.d.ts +0 -1
- package/dist/Rule/Rule.js +0 -3
- package/dist/Rule/Rule.js.map +1 -1
- package/dist/Rule/index.d.ts +0 -1
- package/dist/Rule/index.js +0 -1
- package/dist/Rule/index.js.map +1 -1
- package/package.json +1 -1
package/Operation/index.ts
CHANGED
|
@@ -7,29 +7,36 @@ export interface Operation extends OperationCreatable {
|
|
|
7
7
|
transaction: string
|
|
8
8
|
counter: number
|
|
9
9
|
created: isoly.DateTime
|
|
10
|
-
|
|
10
|
+
signature?: string
|
|
11
11
|
}
|
|
12
12
|
export namespace Operation {
|
|
13
|
+
export type Creatable = OperationCreatable
|
|
14
|
+
export const Creatable = OperationCreatable
|
|
15
|
+
export type Changes = OperationChanges
|
|
16
|
+
export const Changes = OperationChanges
|
|
17
|
+
export namespace Changes {
|
|
18
|
+
export type Entry = OperationChanges.Entry
|
|
19
|
+
}
|
|
13
20
|
export const type = OperationCreatable.type.extend<Operation>({
|
|
14
21
|
transaction: isly.string(),
|
|
15
22
|
counter: isly.number(),
|
|
16
23
|
created: isly.fromIs("isoly.DateTime", isoly.DateTime.is),
|
|
24
|
+
signature: isly.string().optional(),
|
|
17
25
|
})
|
|
18
26
|
export const is = type.is
|
|
19
27
|
export const flaw = type.flaw
|
|
20
|
-
|
|
28
|
+
//TODO: actual signing function
|
|
29
|
+
function sign(precursor: string): string | undefined {
|
|
30
|
+
const signature = Number.parseInt(precursor)
|
|
31
|
+
return Number.isNaN(signature) ? undefined : (signature + 1).toString()
|
|
32
|
+
}
|
|
33
|
+
export function fromCreatable(transaction: string, creatable: Creatable, oldSignature?: string): Operation {
|
|
21
34
|
return {
|
|
22
35
|
...creatable,
|
|
23
36
|
transaction,
|
|
24
37
|
counter: 0,
|
|
25
38
|
created: isoly.DateTime.now(),
|
|
39
|
+
signature: oldSignature && sign(oldSignature),
|
|
26
40
|
}
|
|
27
41
|
}
|
|
28
|
-
export type Creatable = OperationCreatable
|
|
29
|
-
export const Creatable = OperationCreatable
|
|
30
|
-
export type Changes = OperationChanges
|
|
31
|
-
export const Changes = OperationChanges
|
|
32
|
-
export namespace Changes {
|
|
33
|
-
export type Entry = OperationChanges.Entry
|
|
34
|
-
}
|
|
35
42
|
}
|
package/Rule/Rule.ts
CHANGED
|
@@ -24,7 +24,3 @@ export const type = isly.object<Rule>({
|
|
|
24
24
|
})
|
|
25
25
|
export const is = type.is
|
|
26
26
|
export const flaw = type.flaw
|
|
27
|
-
//TODO: remove when rule evaluation rebuilt
|
|
28
|
-
export function stringify(rule: Rule): string {
|
|
29
|
-
return `{ label: ${rule.name}, action: ${rule.action}, type: ${rule.type}, condition: ${rule.condition}, description: ${rule.description}. }`
|
|
30
|
-
}
|
package/Rule/index.ts
CHANGED
|
@@ -6,12 +6,9 @@ export interface Operation extends OperationCreatable {
|
|
|
6
6
|
transaction: string;
|
|
7
7
|
counter: number;
|
|
8
8
|
created: isoly.DateTime;
|
|
9
|
+
signature?: string;
|
|
9
10
|
}
|
|
10
11
|
export declare namespace Operation {
|
|
11
|
-
const type: isly.object.ExtendableType<Operation>;
|
|
12
|
-
const is: isly.Type.IsFunction<Operation>;
|
|
13
|
-
const flaw: isly.Type.FlawFunction;
|
|
14
|
-
function fromCreatable(transaction: string, creatable: Creatable): Operation;
|
|
15
12
|
type Creatable = OperationCreatable;
|
|
16
13
|
const Creatable: typeof OperationCreatable;
|
|
17
14
|
type Changes = OperationChanges;
|
|
@@ -19,4 +16,8 @@ export declare namespace Operation {
|
|
|
19
16
|
namespace Changes {
|
|
20
17
|
type Entry = OperationChanges.Entry;
|
|
21
18
|
}
|
|
19
|
+
const type: isly.object.ExtendableType<Operation>;
|
|
20
|
+
const is: isly.Type.IsFunction<Operation>;
|
|
21
|
+
const flaw: isly.Type.FlawFunction;
|
|
22
|
+
function fromCreatable(transaction: string, creatable: Creatable, oldSignature?: string): Operation;
|
|
22
23
|
}
|
package/dist/Operation/index.js
CHANGED
|
@@ -4,23 +4,29 @@ import { Changes as OperationChanges } from "./Changes";
|
|
|
4
4
|
import { Creatable as OperationCreatable } from "./Creatable";
|
|
5
5
|
export var Operation;
|
|
6
6
|
(function (Operation) {
|
|
7
|
+
Operation.Creatable = OperationCreatable;
|
|
8
|
+
Operation.Changes = OperationChanges;
|
|
7
9
|
Operation.type = OperationCreatable.type.extend({
|
|
8
10
|
transaction: isly.string(),
|
|
9
11
|
counter: isly.number(),
|
|
10
12
|
created: isly.fromIs("isoly.DateTime", isoly.DateTime.is),
|
|
13
|
+
signature: isly.string().optional(),
|
|
11
14
|
});
|
|
12
15
|
Operation.is = Operation.type.is;
|
|
13
16
|
Operation.flaw = Operation.type.flaw;
|
|
14
|
-
function
|
|
17
|
+
function sign(precursor) {
|
|
18
|
+
const signature = Number.parseInt(precursor);
|
|
19
|
+
return Number.isNaN(signature) ? undefined : (signature + 1).toString();
|
|
20
|
+
}
|
|
21
|
+
function fromCreatable(transaction, creatable, oldSignature) {
|
|
15
22
|
return {
|
|
16
23
|
...creatable,
|
|
17
24
|
transaction,
|
|
18
25
|
counter: 0,
|
|
19
26
|
created: isoly.DateTime.now(),
|
|
27
|
+
signature: oldSignature && sign(oldSignature),
|
|
20
28
|
};
|
|
21
29
|
}
|
|
22
30
|
Operation.fromCreatable = fromCreatable;
|
|
23
|
-
Operation.Creatable = OperationCreatable;
|
|
24
|
-
Operation.Changes = OperationChanges;
|
|
25
31
|
})(Operation || (Operation = {}));
|
|
26
32
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"../","sources":["Operation/index.ts"],"names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,SAAS,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,SAAS,GAAG,CAAC,CAAC,CAAC,QAAQ,EAAE,CAAA;IACxE,CAAC;IACD,SAAgB,aAAa,CAAC,WAAmB,EAAE,SAAoB,EAAE,YAAqB;QAC7F,OAAO;YACN,GAAG,SAAS;YACZ,WAAW;YACX,OAAO,EAAE,CAAC;YACV,OAAO,EAAE,KAAK,CAAC,QAAQ,CAAC,GAAG,EAAE;YAC7B,SAAS,EAAE,YAAY,IAAI,IAAI,CAAC,YAAY,CAAC;SAC7C,CAAA;IACF,CAAC;IARe,uBAAa,gBAQ5B,CAAA;AACF,CAAC,EA9BgB,SAAS,KAAT,SAAS,QA8BzB"}
|
package/dist/Rule/Rule.d.ts
CHANGED
|
@@ -14,4 +14,3 @@ export type Kind = typeof kinds[number];
|
|
|
14
14
|
export declare const type: isly.object.ExtendableType<Rule>;
|
|
15
15
|
export declare const is: isly.Type.IsFunction<Rule>;
|
|
16
16
|
export declare const flaw: isly.Type.FlawFunction;
|
|
17
|
-
export declare function stringify(rule: Rule): string;
|
package/dist/Rule/Rule.js
CHANGED
|
@@ -11,7 +11,4 @@ export const type = isly.object({
|
|
|
11
11
|
});
|
|
12
12
|
export const is = type.is;
|
|
13
13
|
export const flaw = type.flaw;
|
|
14
|
-
export function stringify(rule) {
|
|
15
|
-
return `{ label: ${rule.name}, action: ${rule.action}, type: ${rule.type}, condition: ${rule.condition}, description: ${rule.description}. }`;
|
|
16
|
-
}
|
|
17
14
|
//# sourceMappingURL=Rule.js.map
|
package/dist/Rule/Rule.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Rule.js","sourceRoot":"../","sources":["Rule/Rule.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAA;AAW3B,MAAM,CAAC,MAAM,OAAO,GAAG,CAAC,QAAQ,EAAE,QAAQ,EAAE,MAAM,CAAU,CAAA;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EAAE;CAC5B,CAAC,CAAA;AACF,MAAM,CAAC,MAAM,EAAE,GAAG,IAAI,CAAC,EAAE,CAAA;AACzB,MAAM,CAAC,MAAM,IAAI,GAAG,IAAI,CAAC,IAAI,CAAA"}
|
package/dist/Rule/index.d.ts
CHANGED
|
@@ -22,6 +22,5 @@ export declare namespace Rule {
|
|
|
22
22
|
const type: import("isly/dist/object").object.ExtendableType<ModelRule.Rule>;
|
|
23
23
|
const is: import("isly/dist/Type").Type.IsFunction<ModelRule.Rule>;
|
|
24
24
|
const flaw: import("isly/dist/Type").Type.FlawFunction;
|
|
25
|
-
const stringify: typeof ModelRule.stringify;
|
|
26
25
|
function evaluate(rules: Rule[], state: State, macros?: Record<string, selectively.Definition>): Record<Action, Rule[]>;
|
|
27
26
|
}
|
package/dist/Rule/index.js
CHANGED
|
@@ -10,7 +10,6 @@ export var Rule;
|
|
|
10
10
|
Rule.type = ModelRule.type;
|
|
11
11
|
Rule.is = ModelRule.type.is;
|
|
12
12
|
Rule.flaw = ModelRule.type.flaw;
|
|
13
|
-
Rule.stringify = ModelRule.stringify;
|
|
14
13
|
function evaluate(rules, state, macros) {
|
|
15
14
|
const result = { review: [], reject: [], flag: [] };
|
|
16
15
|
rules.forEach(r => selectively.resolve({ ...macros, ...definitions }, selectively.parse(r.condition)).is(state) &&
|
package/dist/Rule/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"../","sources":["Rule/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAA;AACzC,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAA;AAC3C,OAAO,KAAK,SAAS,MAAM,QAAQ,CAAA;AACnC,OAAO,EAAE,KAAK,IAAI,SAAS,EAAE,MAAM,SAAS,CAAA;AAI5C,MAAM,KAAW,IAAI,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"../","sources":["Rule/index.ts"],"names":[],"mappings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