@pax2pay/model-banking 0.1.314 → 0.1.316
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/Analytics/Configuration/Mapping/Field.ts +16 -0
- package/Analytics/Configuration/Mapping/Transform.ts +8 -0
- package/Analytics/Configuration/Mapping/index.ts +9 -0
- package/Analytics/Configuration/Schema/Field.ts +16 -0
- package/Analytics/Configuration/Schema/Mode.ts +8 -0
- package/Analytics/Configuration/Schema/Type.ts +23 -0
- package/Analytics/Configuration/Schema/index.ts +7 -0
- package/Analytics/Configuration/index.ts +72 -0
- package/Analytics/Event/Base.ts +10 -0
- package/Analytics/Event/Operation.ts +20 -0
- package/Analytics/Event/Transaction.ts +22 -0
- package/Analytics/Event/index.ts +10 -0
- package/Analytics/index.ts +22 -0
- package/Card/Expiry.ts +8 -0
- package/Rule/State/Authorization.ts +16 -0
- package/Rule/State/Card.ts +23 -0
- package/dist/Analytics/Configuration/Mapping/Field.d.ts +12 -0
- package/dist/Analytics/Configuration/Mapping/Field.js +11 -0
- package/dist/Analytics/Configuration/Mapping/Field.js.map +1 -0
- package/dist/Analytics/Configuration/Mapping/Transform.d.ts +6 -0
- package/dist/Analytics/Configuration/Mapping/Transform.js +7 -0
- package/dist/Analytics/Configuration/Mapping/Transform.js.map +1 -0
- package/dist/Analytics/Configuration/Mapping/index.d.ts +7 -0
- package/dist/Analytics/Configuration/Mapping/index.js +8 -0
- package/dist/Analytics/Configuration/Mapping/index.js.map +1 -0
- package/dist/Analytics/Configuration/Schema/Field.d.ts +14 -0
- package/dist/Analytics/Configuration/Schema/Field.js +15 -0
- package/dist/Analytics/Configuration/Schema/Field.js.map +1 -0
- package/dist/Analytics/Configuration/Schema/Mode.d.ts +6 -0
- package/dist/Analytics/Configuration/Schema/Mode.js +7 -0
- package/dist/Analytics/Configuration/Schema/Mode.js.map +1 -0
- package/dist/Analytics/Configuration/Schema/Type.d.ts +6 -0
- package/dist/Analytics/Configuration/Schema/Type.js +22 -0
- package/dist/Analytics/Configuration/Schema/Type.js.map +1 -0
- package/dist/Analytics/Configuration/Schema/index.d.ts +6 -0
- package/dist/Analytics/Configuration/Schema/index.js +7 -0
- package/dist/Analytics/Configuration/Schema/index.js.map +1 -0
- package/dist/Analytics/Configuration/index.d.ts +76 -0
- package/dist/Analytics/Configuration/index.js +62 -0
- package/dist/Analytics/Configuration/index.js.map +1 -0
- package/dist/Analytics/Event/Base.d.ts +12 -0
- package/dist/Analytics/Event/Base.js +2 -0
- package/dist/Analytics/Event/Base.js.map +1 -0
- package/dist/Analytics/Event/Operation.d.ts +13 -0
- package/dist/Analytics/Event/Operation.js +15 -0
- package/dist/Analytics/Event/Operation.js.map +1 -0
- package/dist/Analytics/Event/Transaction.d.ts +14 -0
- package/dist/Analytics/Event/Transaction.js +16 -0
- package/dist/Analytics/Event/Transaction.js.map +1 -0
- package/dist/Analytics/Event/index.d.ts +11 -0
- package/dist/Analytics/Event/index.js +8 -0
- package/dist/Analytics/Event/index.js.map +1 -0
- package/dist/Analytics/index.d.ts +6 -0
- package/dist/Analytics/index.js +8 -0
- package/dist/Analytics/index.js.map +1 -0
- package/dist/Card/Expiry.d.ts +1 -0
- package/dist/Card/Expiry.js +7 -0
- package/dist/Card/Expiry.js.map +1 -1
- package/dist/Identity.d.ts +2 -2
- package/dist/Rule/State/Authorization.d.ts +5 -0
- package/dist/Rule/State/Authorization.js +13 -0
- package/dist/Rule/State/Authorization.js.map +1 -1
- package/dist/Rule/State/Card.d.ts +4 -0
- package/dist/Rule/State/Card.js +23 -0
- package/dist/Rule/State/Card.js.map +1 -1
- package/dist/pax2pay.d.ts +1 -1
- package/dist/pax2pay.js +1 -1
- package/dist/pax2pay.js.map +1 -1
- package/package.json +7 -7
- package/pax2pay.ts +1 -1
- package/Event/index.ts +0 -97
- package/dist/Event/index.d.ts +0 -40
- package/dist/Event/index.js +0 -101
- package/dist/Event/index.js.map +0 -1
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
export var Configuration;
|
|
2
|
+
(function (Configuration) {
|
|
3
|
+
Configuration.baseFields = [
|
|
4
|
+
"realm",
|
|
5
|
+
"entity",
|
|
6
|
+
"entityId",
|
|
7
|
+
"action",
|
|
8
|
+
"created",
|
|
9
|
+
"isError",
|
|
10
|
+
"version",
|
|
11
|
+
"source",
|
|
12
|
+
];
|
|
13
|
+
Configuration.baseMapping = {
|
|
14
|
+
realm: "realm",
|
|
15
|
+
entity: "entity.type",
|
|
16
|
+
entityId: "entity.id",
|
|
17
|
+
action: "action",
|
|
18
|
+
created: "created",
|
|
19
|
+
isError: { selector: "isError", transform: "boolean" },
|
|
20
|
+
version: "version",
|
|
21
|
+
source: "source",
|
|
22
|
+
};
|
|
23
|
+
Configuration.baseTableSchema = [
|
|
24
|
+
{ name: "realm", type: "STRING" },
|
|
25
|
+
{ name: "entity", type: "STRING" },
|
|
26
|
+
{ name: "entityId", type: "STRING" },
|
|
27
|
+
{ name: "action", type: "STRING" },
|
|
28
|
+
{ name: "created", type: "TIMESTAMP" },
|
|
29
|
+
{ name: "isError", type: "BOOLEAN" },
|
|
30
|
+
{ name: "source", type: "STRING" },
|
|
31
|
+
{ name: "version", type: "STRING" },
|
|
32
|
+
];
|
|
33
|
+
function create(mapping, schema, config, filter) {
|
|
34
|
+
return {
|
|
35
|
+
name: "ledger-events",
|
|
36
|
+
type: "bigquery",
|
|
37
|
+
filter: [
|
|
38
|
+
{
|
|
39
|
+
type: "selectively",
|
|
40
|
+
expression: filter ?? "source:pax2pay-worker-banking-ledger",
|
|
41
|
+
},
|
|
42
|
+
{ type: "useragent" },
|
|
43
|
+
{
|
|
44
|
+
type: "mapping",
|
|
45
|
+
mapping: {
|
|
46
|
+
...Configuration.baseMapping,
|
|
47
|
+
...mapping,
|
|
48
|
+
},
|
|
49
|
+
},
|
|
50
|
+
],
|
|
51
|
+
batchSize: 10,
|
|
52
|
+
batchInterval: 3,
|
|
53
|
+
projectName: "paxpay-nonprod",
|
|
54
|
+
datasetName: "banking_ledger",
|
|
55
|
+
...config,
|
|
56
|
+
tableSchema: [...Configuration.baseTableSchema, ...schema],
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
Configuration.create = create;
|
|
60
|
+
Configuration.backup = create({ value: { selector: "value", transform: "stringify" } }, [{ name: "value", type: "STRING" }], { tableName: "backup_test" });
|
|
61
|
+
})(Configuration || (Configuration = {}));
|
|
62
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"../","sources":["Analytics/Configuration/index.ts"],"names":[],"mappings":"AAGA,MAAM,KAAW,aAAa,CAoE7B;AApED,WAAiB,aAAa;IAChB,wBAAU,GAAG;QACzB,OAAO;QACP,QAAQ;QACR,UAAU;QACV,QAAQ;QACR,SAAS;QACT,SAAS;QACT,SAAS;QACT,QAAQ;KACC,CAAA;IAEG,yBAAW,GAAwB;QAC/C,KAAK,EAAE,OAAO;QACd,MAAM,EAAE,aAAa;QACrB,QAAQ,EAAE,WAAW;QACrB,MAAM,EAAE,QAAQ;QAChB,OAAO,EAAE,SAAS;QAClB,OAAO,EAAE,EAAE,QAAQ,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE;QACtD,OAAO,EAAE,SAAS;QAClB,MAAM,EAAE,QAAQ;KAChB,CAAA;IACY,6BAAe,GAAuB;QAClD,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE;QACjC,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,QAAQ,EAAE;QAClC,EAAE,IAAI,EAAE,UAAU,EAAE,IAAI,EAAE,QAAQ,EAAE;QACpC,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,QAAQ,EAAE;QAClC,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,WAAW,EAAE;QACtC,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,SAAS,EAAE;QACpC,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,QAAQ,EAAE;QAClC,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,QAAQ,EAAE;KACnC,CAAA;IACD,SAAgB,MAAM,CACrB,OAAgB,EAChB,MAAc,EACd,MAAmG,EACnG,MAAe;QAEf,OAAO;YACN,IAAI,EAAE,eAAe;YACrB,IAAI,EAAE,UAAU;YAChB,MAAM,EAAE;gBACP;oBACC,IAAI,EAAE,aAAa;oBACnB,UAAU,EAAE,MAAM,IAAI,sCAAsC;iBAC5D;gBACD,EAAE,IAAI,EAAE,WAAW,EAAE;gBACrB;oBACC,IAAI,EAAE,SAAS;oBACf,OAAO,EAAE;wBACR,GAAG,cAAA,WAAW;wBACd,GAAG,OAAO;qBACV;iBACD;aACD;YACD,SAAS,EAAE,EAAE;YACb,aAAa,EAAE,CAAC;YAChB,WAAW,EAAE,gBAAgB;YAC7B,WAAW,EAAE,gBAAgB;YAC7B,GAAG,MAAM;YACT,WAAW,EAAE,CAAC,GAAG,cAAA,eAAe,EAAE,GAAG,MAAM,CAAC;SAC5C,CAAA;IACF,CAAC;IA9Be,oBAAM,SA8BrB,CAAA;IACY,oBAAM,GAAG,MAAM,CAC3B,EAAE,KAAK,EAAE,EAAE,QAAQ,EAAE,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,EAAE,EACxD,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC,EACnC,EAAE,SAAS,EAAE,aAAa,EAAE,CAC5B,CAAA;AACF,CAAC,EApEgB,aAAa,KAAb,aAAa,QAoE7B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Base.js","sourceRoot":"../","sources":["Analytics/Event/Base.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Operation as modelOperation } from "../../Operation";
|
|
2
|
+
import { Realm } from "../../Realm";
|
|
3
|
+
import { Base } from "./Base";
|
|
4
|
+
export type Operation = Base<modelOperation> & {
|
|
5
|
+
entity: {
|
|
6
|
+
type: "operation";
|
|
7
|
+
id: string;
|
|
8
|
+
};
|
|
9
|
+
action: "created";
|
|
10
|
+
};
|
|
11
|
+
export declare namespace Operation {
|
|
12
|
+
function create(value: modelOperation, realm: Realm, action: Operation["action"]): Operation;
|
|
13
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { isoly } from "isoly";
|
|
2
|
+
export var Operation;
|
|
3
|
+
(function (Operation) {
|
|
4
|
+
function create(value, realm, action) {
|
|
5
|
+
return {
|
|
6
|
+
realm,
|
|
7
|
+
entity: { type: "operation", id: value.signature ?? "" },
|
|
8
|
+
action,
|
|
9
|
+
created: isoly.DateTime.now(),
|
|
10
|
+
value,
|
|
11
|
+
};
|
|
12
|
+
}
|
|
13
|
+
Operation.create = create;
|
|
14
|
+
})(Operation || (Operation = {}));
|
|
15
|
+
//# sourceMappingURL=Operation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Operation.js","sourceRoot":"../","sources":["Analytics/Event/Operation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,OAAO,CAAA;AAS7B,MAAM,KAAW,SAAS,CAUzB;AAVD,WAAiB,SAAS;IACzB,SAAgB,MAAM,CAAC,KAAqB,EAAE,KAAY,EAAE,MAA2B;QACtF,OAAO;YACN,KAAK;YACL,MAAM,EAAE,EAAE,IAAI,EAAE,WAAW,EAAE,EAAE,EAAE,KAAK,CAAC,SAAS,IAAI,EAAE,EAAE;YACxD,MAAM;YACN,OAAO,EAAE,KAAK,CAAC,QAAQ,CAAC,GAAG,EAAE;YAC7B,KAAK;SACL,CAAA;IACF,CAAC;IARe,gBAAM,SAQrB,CAAA;AACF,CAAC,EAVgB,SAAS,KAAT,SAAS,QAUzB"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Realm } from "../../Realm";
|
|
2
|
+
import { Transaction as modelTransaction } from "../../Transaction";
|
|
3
|
+
import { Base } from "./Base";
|
|
4
|
+
export type Transaction = Base<modelTransaction> & {
|
|
5
|
+
entity: {
|
|
6
|
+
type: "transaction";
|
|
7
|
+
id: string;
|
|
8
|
+
};
|
|
9
|
+
action: "created" | "finalized" | "cancelled" | "failed";
|
|
10
|
+
isError?: true;
|
|
11
|
+
};
|
|
12
|
+
export declare namespace Transaction {
|
|
13
|
+
function create(value: modelTransaction, realm: Realm, action: Transaction["action"]): Transaction;
|
|
14
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { isoly } from "isoly";
|
|
2
|
+
export var Transaction;
|
|
3
|
+
(function (Transaction) {
|
|
4
|
+
function create(value, realm, action) {
|
|
5
|
+
return {
|
|
6
|
+
realm,
|
|
7
|
+
entity: { type: "transaction", id: value.id },
|
|
8
|
+
action,
|
|
9
|
+
...(action == "failed" ? { isError: true } : {}),
|
|
10
|
+
created: isoly.DateTime.now(),
|
|
11
|
+
value,
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
Transaction.create = create;
|
|
15
|
+
})(Transaction || (Transaction = {}));
|
|
16
|
+
//# sourceMappingURL=Transaction.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Transaction.js","sourceRoot":"../","sources":["Analytics/Event/Transaction.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,OAAO,CAAA;AAU7B,MAAM,KAAW,WAAW,CAW3B;AAXD,WAAiB,WAAW;IAC3B,SAAgB,MAAM,CAAC,KAAuB,EAAE,KAAY,EAAE,MAA6B;QAC1F,OAAO;YACN,KAAK;YACL,MAAM,EAAE,EAAE,IAAI,EAAE,aAAa,EAAE,EAAE,EAAE,KAAK,CAAC,EAAE,EAAE;YAC7C,MAAM;YACN,GAAG,CAAC,MAAM,IAAI,QAAQ,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;YAChD,OAAO,EAAE,KAAK,CAAC,QAAQ,CAAC,GAAG,EAAE;YAC7B,KAAK;SACL,CAAA;IACF,CAAC;IATe,kBAAM,SASrB,CAAA;AACF,CAAC,EAXgB,WAAW,KAAX,WAAW,QAW3B"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Base as EventBase } from "./Base";
|
|
2
|
+
import { Operation as OperationEvent } from "./Operation";
|
|
3
|
+
import { Transaction as TransactionEvent } from "./Transaction";
|
|
4
|
+
export type Event = (Event.Transaction | Event.Operation) & {
|
|
5
|
+
version: string;
|
|
6
|
+
};
|
|
7
|
+
export declare namespace Event {
|
|
8
|
+
type Base<T> = EventBase<T>;
|
|
9
|
+
export import Transaction = TransactionEvent;
|
|
10
|
+
export import Operation = OperationEvent;
|
|
11
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Operation as OperationEvent } from "./Operation";
|
|
2
|
+
import { Transaction as TransactionEvent } from "./Transaction";
|
|
3
|
+
export var Event;
|
|
4
|
+
(function (Event) {
|
|
5
|
+
Event.Transaction = TransactionEvent;
|
|
6
|
+
Event.Operation = OperationEvent;
|
|
7
|
+
})(Event || (Event = {}));
|
|
8
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"../","sources":["Analytics/Event/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,IAAI,cAAc,EAAE,MAAM,aAAa,CAAA;AACzD,OAAO,EAAE,WAAW,IAAI,gBAAgB,EAAE,MAAM,eAAe,CAAA;AAG/D,MAAM,KAAW,KAAK,CAIrB;AAJD,WAAiB,KAAK;IAEP,iBAAW,GAAG,gBAAgB,CAAA;IAC9B,eAAS,GAAG,cAAc,CAAA;AACzC,CAAC,EAJgB,KAAK,KAAL,KAAK,QAIrB"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Configuration as AnalyticsConfiguration } from "./Configuration";
|
|
2
|
+
import { Event as AnalyticsEvent } from "./Event";
|
|
3
|
+
export var Analytics;
|
|
4
|
+
(function (Analytics) {
|
|
5
|
+
Analytics.Event = AnalyticsEvent;
|
|
6
|
+
Analytics.Configuration = AnalyticsConfiguration;
|
|
7
|
+
})(Analytics || (Analytics = {}));
|
|
8
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"../","sources":["Analytics/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,IAAI,sBAAsB,EAAE,MAAM,iBAAiB,CAAA;AACzE,OAAO,EAAE,KAAK,IAAI,cAAc,EAAE,MAAM,SAAS,CAAA;AAEjD,MAAM,KAAW,SAAS,CAGzB;AAHD,WAAiB,SAAS;IACX,eAAK,GAAG,cAAc,CAAA;IACtB,uBAAa,GAAG,sBAAsB,CAAA;AACrD,CAAC,EAHgB,SAAS,KAAT,SAAS,QAGzB"}
|
package/dist/Card/Expiry.d.ts
CHANGED
package/dist/Card/Expiry.js
CHANGED
|
@@ -10,5 +10,12 @@ export var Expiry;
|
|
|
10
10
|
return isoly.DateTime.nextMonth("20" + expiry[0].toString() + "-" + expiry[1].toString().padStart(2, "0") + "-01T00:00:01.000Z");
|
|
11
11
|
}
|
|
12
12
|
Expiry.toDateTime = toDateTime;
|
|
13
|
+
function isExpired(expiry) {
|
|
14
|
+
const now = isoly.DateTime.now();
|
|
15
|
+
const expiryYear = 2000 + expiry[0];
|
|
16
|
+
return (expiryYear < isoly.DateTime.getYear(now) ||
|
|
17
|
+
(expiryYear == isoly.DateTime.getYear(now) && expiry[1] < isoly.DateTime.getMonth(now)));
|
|
18
|
+
}
|
|
19
|
+
Expiry.isExpired = isExpired;
|
|
13
20
|
})(Expiry || (Expiry = {}));
|
|
14
21
|
//# sourceMappingURL=Expiry.js.map
|
package/dist/Card/Expiry.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"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|
+
readonly realm?: Realm | undefined;
|
|
8
8
|
readonly organization?: string | undefined;
|
|
9
9
|
get realms(): Realm[] | undefined;
|
|
10
|
-
constructor(key: Key, realm?:
|
|
10
|
+
constructor(key: Key, realm?: Realm | undefined, organization?: string | undefined);
|
|
11
11
|
check(constraint: Key.Permissions | Key.Permissions[], realm?: Realm, organization?: string): boolean;
|
|
12
12
|
collectionCheck(collection: string): boolean;
|
|
13
13
|
static authenticate<T extends Partial<Record<"realm" | "organization", true>> = Record<string, never>>(header: {
|
|
@@ -2,6 +2,8 @@ import { isoly } from "isoly";
|
|
|
2
2
|
import { isly } from "isly";
|
|
3
3
|
import { Creatable as AuthorizationCreatable } from "../../Authorization/Creatable";
|
|
4
4
|
import { Merchant } from "../../Merchant";
|
|
5
|
+
import type { Rail } from "../../Rail";
|
|
6
|
+
import type { Transaction } from "../../Transaction";
|
|
5
7
|
export interface Authorization extends Omit<AuthorizationCreatable, "amount"> {
|
|
6
8
|
time: string;
|
|
7
9
|
hour: number;
|
|
@@ -13,6 +15,9 @@ export interface Authorization extends Omit<AuthorizationCreatable, "amount"> {
|
|
|
13
15
|
}
|
|
14
16
|
export declare namespace Authorization {
|
|
15
17
|
function from(authorization: AuthorizationCreatable): Authorization;
|
|
18
|
+
function toTransaction(authorization: Authorization): Transaction.Creatable & {
|
|
19
|
+
counterpart: Rail.Address.Card.Counterpart;
|
|
20
|
+
};
|
|
16
21
|
const type: isly.object.ExtendableType<Authorization>;
|
|
17
22
|
const is: isly.Type.IsFunction<Authorization>;
|
|
18
23
|
const flaw: isly.Type.FlawFunction;
|
|
@@ -15,6 +15,19 @@ export var Authorization;
|
|
|
15
15
|
};
|
|
16
16
|
}
|
|
17
17
|
Authorization.from = from;
|
|
18
|
+
function toTransaction(authorization) {
|
|
19
|
+
return {
|
|
20
|
+
amount: authorization.amount,
|
|
21
|
+
currency: authorization.currency,
|
|
22
|
+
description: authorization.description,
|
|
23
|
+
counterpart: {
|
|
24
|
+
type: "card",
|
|
25
|
+
merchant: authorization.merchant,
|
|
26
|
+
acquirer: authorization.acquirer,
|
|
27
|
+
},
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
Authorization.toTransaction = toTransaction;
|
|
18
31
|
Authorization.type = AuthorizationCreatable.type.omit(["amount"]).extend({
|
|
19
32
|
time: isly.string(),
|
|
20
33
|
hour: isly.number(),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Authorization.js","sourceRoot":"../","sources":["Rule/State/Authorization.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,OAAO,CAAA;AAC7B,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAA;AAC3B,OAAO,EAAE,SAAS,IAAI,sBAAsB,EAAE,MAAM,+BAA+B,CAAA;AACnF,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAA;
|
|
1
|
+
{"version":3,"file":"Authorization.js","sourceRoot":"../","sources":["Rule/State/Authorization.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,OAAO,CAAA;AAC7B,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAA;AAC3B,OAAO,EAAE,SAAS,IAAI,sBAAsB,EAAE,MAAM,+BAA+B,CAAA;AACnF,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAA;AAWzC,MAAM,KAAW,aAAa,CAqC7B;AArCD,WAAiB,aAAa;IAC7B,SAAgB,IAAI,CAAC,aAAqC;QACzD,OAAO;YACN,GAAG,aAAa;YAChB,IAAI,EAAE,KAAK,CAAC,QAAQ,CAAC,OAAO,CAAC,KAAK,CAAC,QAAQ,CAAC,GAAG,EAAE,CAAC;YAClD,IAAI,EAAE,KAAK,CAAC,QAAQ,CAAC,OAAO,CAAC,KAAK,CAAC,QAAQ,CAAC,GAAG,EAAE,CAAC;YAClD,QAAQ,EAAE,aAAa,CAAC,MAAM,CAAC,CAAC,CAAC;YACjC,MAAM,EAAE,IAA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@ -1,6 +1,8 @@
|
|
|
1
1
|
import { isoly } from "isoly";
|
|
2
2
|
import { isly } from "isly";
|
|
3
3
|
import { Card as ModelCard } from "../../Card";
|
|
4
|
+
import type { Rail } from "../../Rail";
|
|
5
|
+
import type { Status as TransactionStatus } from "../../Transaction/Status";
|
|
4
6
|
export interface Card extends Omit<ModelCard, "limit">, Card.Statistics {
|
|
5
7
|
age: {
|
|
6
8
|
days: number;
|
|
@@ -25,6 +27,8 @@ export declare namespace Card {
|
|
|
25
27
|
};
|
|
26
28
|
const initialStatistics: Statistics;
|
|
27
29
|
function from(card: ModelCard, statistics?: Statistics): Card;
|
|
30
|
+
function check(card: Card, amount: number): TransactionStatus;
|
|
31
|
+
function toAddress(card: Card): Rail.Address.Card;
|
|
28
32
|
const type: isly.object.ExtendableType<Card>;
|
|
29
33
|
const is: isly.Type.IsFunction<Card>;
|
|
30
34
|
const flaw: isly.Type.FlawFunction;
|
package/dist/Rule/State/Card.js
CHANGED
|
@@ -21,6 +21,29 @@ export var Card;
|
|
|
21
21
|
};
|
|
22
22
|
}
|
|
23
23
|
Card.from = from;
|
|
24
|
+
function check(card, amount) {
|
|
25
|
+
let result;
|
|
26
|
+
if (ModelCard.Expiry.isExpired(card.details.expiry))
|
|
27
|
+
result = ["rejected", "card expired"];
|
|
28
|
+
else if (amount + card.spent[1] > card.limit)
|
|
29
|
+
result = ["rejected", "exceeds limit"];
|
|
30
|
+
else
|
|
31
|
+
result = "processing";
|
|
32
|
+
return result;
|
|
33
|
+
}
|
|
34
|
+
Card.check = check;
|
|
35
|
+
function toAddress(card) {
|
|
36
|
+
return {
|
|
37
|
+
type: "card",
|
|
38
|
+
id: card.id,
|
|
39
|
+
expiry: card.details.expiry,
|
|
40
|
+
holder: card.details.holder,
|
|
41
|
+
iin: card.details.iin,
|
|
42
|
+
last4: card.details.last4,
|
|
43
|
+
scheme: card.scheme,
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
Card.toAddress = toAddress;
|
|
24
47
|
Card.type = ModelCard.type.omit(["limit"]).extend({
|
|
25
48
|
age: isly.object({ days: isly.number(), minutes: isly.number() }),
|
|
26
49
|
limit: isly.number(),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Card.js","sourceRoot":"../","sources":["Rule/State/Card.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,OAAO,CAAA;AAC7B,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAA;AAC3B,OAAO,EAAE,IAAI,IAAI,SAAS,EAAE,MAAM,YAAY,CAAA;
|
|
1
|
+
{"version":3,"file":"Card.js","sourceRoot":"../","sources":["Rule/State/Card.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,OAAO,CAAA;AAC7B,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAA;AAC3B,OAAO,EAAE,IAAI,IAAI,SAAS,EAAE,MAAM,YAAY,CAAA;AAU9C,MAAM,KAAW,IAAI,CAuDpB;AAvDD,WAAiB,IAAI;IAKP,sBAAiB,GAAe;QAC5C,IAAI,EAAE,EAAE,KAAK,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,SAAS,EAAE,EAAE,EAAE;QAC5C,MAAM,EAAE,EAAE,KAAK,EAAE,CAAC,EAAE;KACpB,CAAA;IACD,SAAS,WAAW,CAAC,IAAoB;QACxC,MAAM,OAAO,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,EAAE,GAAG,CAAC,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,IAAI,EAAE,cAAc,CAAC,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC,CAAA;QACzF,OAAO,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,OAAO,GAAG,CAAC,EAAE,GAAG,EAAE,CAAC,CAAC,EAAE,OAAO,EAAE,CAAA;IAClD,CAAC;IACD,SAAgB,IAAI,CAAC,IAAe,EAAE,aAAyB,KAAA,iBAAi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C,CAAC,MAAM,CAAO;QAC/D,GAAG,EAAE,IAAI,CAAC,MAAM,CAAc,EAAE,IAAI,EAAE,IAAI,CAAC,MAAM,EAAE,EAAE,OAAO,EAAE,IAAI,CAAC,MAAM,EAAE,EAAE,CAAC;QAC9E,KAAK,EAAE,IAAI,CAAC,MAAM,EAAE;QACpB,QAAQ,EAAE,IAAI,CAAC,MAAM,CAAmB;YACvC,QAAQ,EAAE,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC;YAC3C,KAAK,EAAE,IAAI,CAAC,MAAM,EAAE;SACpB,CAAC;QACF,IAAI,EAAE,IAAI,CAAC,MAAM,CAAe,EAAE,MAAM,EAAE,IAAI,CAAC,MAAM,EAAE,EAAE,KAAK,EAAE,IAAI,CAAC,MAAM,EAAE,EAAE,SAAS,EAAE,IAAI,CAAC,MAAM,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC;QAClH,MAAM,EAAE,IAAI,CAAC,MAAM,CAAiB,EAAE,KAAK,EAAE,IAAI,CAAC,MAAM,EAAE,EAAE,CAAC;KAC7D,CAAC,CAAA;IACW,OAAE,GAAG,KAAA,IAAI,CAAC,EAAE,CAAA;IACZ,SAAI,GAAG,KAAA,IAAI,CAAC,IAAI,CAAA;AAC9B,CAAC,EAvDgB,IAAI,KAAJ,IAAI,QAuDpB"}
|
package/dist/pax2pay.d.ts
CHANGED
|
@@ -2,7 +2,6 @@ export { Account } from "./Account";
|
|
|
2
2
|
export { Acquirer } from "./Acquirer";
|
|
3
3
|
export { Balances } from "./Balances";
|
|
4
4
|
export { Card } from "./Card";
|
|
5
|
-
export { Event } from "./Event";
|
|
6
5
|
export { Holidays } from "./Holidays";
|
|
7
6
|
export { Operation } from "./Operation";
|
|
8
7
|
export { Organization } from "./Organization";
|
|
@@ -28,3 +27,4 @@ export { Key } from "./Key";
|
|
|
28
27
|
export { Exchange } from "./Exchange";
|
|
29
28
|
export { Log } from "./Log";
|
|
30
29
|
export { Audit } from "./Audit";
|
|
30
|
+
export { Analytics } from "./Analytics";
|
package/dist/pax2pay.js
CHANGED
|
@@ -2,7 +2,6 @@ export { Account } from "./Account";
|
|
|
2
2
|
export { Acquirer } from "./Acquirer";
|
|
3
3
|
export { Balances } from "./Balances";
|
|
4
4
|
export { Card } from "./Card";
|
|
5
|
-
export { Event } from "./Event";
|
|
6
5
|
export { Holidays } from "./Holidays";
|
|
7
6
|
export { Operation } from "./Operation";
|
|
8
7
|
export { Organization } from "./Organization";
|
|
@@ -27,4 +26,5 @@ export { Identity } from "./Identity";
|
|
|
27
26
|
export { Key } from "./Key";
|
|
28
27
|
export { Exchange } from "./Exchange";
|
|
29
28
|
export { Log } from "./Log";
|
|
29
|
+
export { Analytics } from "./Analytics";
|
|
30
30
|
//# sourceMappingURL=pax2pay.js.map
|
package/dist/pax2pay.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pax2pay.js","sourceRoot":"../","sources":["pax2pay.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AACnC,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA;AACrC,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA;AACrC,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAA;AAC7B,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"pax2pay.js","sourceRoot":"../","sources":["pax2pay.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AACnC,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA;AACrC,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA;AACrC,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAA;AAC7B,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA;AACrC,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AACvC,OAAO,EA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.
|
|
3
|
+
"version": "0.1.316",
|
|
4
4
|
"description": "Library containing data model types and functions for the Pax2Pay Banking API.",
|
|
5
5
|
"author": "Pax2Pay Ltd",
|
|
6
6
|
"license": "MIT",
|
|
@@ -57,10 +57,10 @@
|
|
|
57
57
|
"semver": "7.5.3"
|
|
58
58
|
},
|
|
59
59
|
"devDependencies": {
|
|
60
|
-
"@cloudflare/workers-types": "^4.
|
|
60
|
+
"@cloudflare/workers-types": "^4.20240620.0",
|
|
61
61
|
"@types/jest": "^29.5.12",
|
|
62
|
-
"@typescript-eslint/eslint-plugin": "7.
|
|
63
|
-
"@typescript-eslint/parser": "7.
|
|
62
|
+
"@typescript-eslint/eslint-plugin": "7.15.0",
|
|
63
|
+
"@typescript-eslint/parser": "7.15.0",
|
|
64
64
|
"eslint": "^8.56.0",
|
|
65
65
|
"eslint-plugin-prettierx": "github:utily/eslint-plugin-prettierx#utily-20231004",
|
|
66
66
|
"eslint-plugin-simple-import-sort": "^12.1.0",
|
|
@@ -68,10 +68,10 @@
|
|
|
68
68
|
"prettierx": "github:utily/prettierx#utily-20231004",
|
|
69
69
|
"rimraf": "^5.0.7",
|
|
70
70
|
"ts-jest": "^29.1.5",
|
|
71
|
-
"typescript": "^5.
|
|
71
|
+
"typescript": "^5.5.3"
|
|
72
72
|
},
|
|
73
73
|
"dependencies": {
|
|
74
|
-
"@userwidgets/model": "0.8.
|
|
74
|
+
"@userwidgets/model": "0.8.30",
|
|
75
75
|
"authly": "^3.1.1",
|
|
76
76
|
"cloudly-http": "^0.1.7",
|
|
77
77
|
"cloudly-rest": "^0.1.4",
|
|
@@ -79,7 +79,7 @@
|
|
|
79
79
|
"cryptly": "^4.0.5",
|
|
80
80
|
"gracely": "^2.0.8",
|
|
81
81
|
"isly": "0.1.16",
|
|
82
|
-
"isoly": "^2.3.
|
|
82
|
+
"isoly": "^2.3.11",
|
|
83
83
|
"selectively": "^2.0.11"
|
|
84
84
|
}
|
|
85
85
|
}
|
package/pax2pay.ts
CHANGED
|
@@ -2,7 +2,6 @@ export { Account } from "./Account"
|
|
|
2
2
|
export { Acquirer } from "./Acquirer"
|
|
3
3
|
export { Balances } from "./Balances"
|
|
4
4
|
export { Card } from "./Card"
|
|
5
|
-
export { Event } from "./Event"
|
|
6
5
|
export { Holidays } from "./Holidays"
|
|
7
6
|
export { Operation } from "./Operation"
|
|
8
7
|
export { Organization } from "./Organization"
|
|
@@ -28,3 +27,4 @@ export { Key } from "./Key"
|
|
|
28
27
|
export { Exchange } from "./Exchange"
|
|
29
28
|
export { Log } from "./Log"
|
|
30
29
|
export { Audit } from "./Audit"
|
|
30
|
+
export { Analytics } from "./Analytics"
|
package/Event/index.ts
DELETED
|
@@ -1,97 +0,0 @@
|
|
|
1
|
-
import { Account as modelAccount } from "../Account"
|
|
2
|
-
import { Operation as modelOperation } from "../Operation"
|
|
3
|
-
import { Organization as modelOrganization } from "../Organization"
|
|
4
|
-
import { Rail as modelRail } from "../Rail"
|
|
5
|
-
import { Transaction as modelTransaction } from "../Transaction"
|
|
6
|
-
|
|
7
|
-
export interface Event {
|
|
8
|
-
organization?: string
|
|
9
|
-
account?: string
|
|
10
|
-
entity: Entity
|
|
11
|
-
action: string
|
|
12
|
-
data: any
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
type Entity = "account" | "transaction" | "operation" | "rail" | "organization" | "authorization" | "supplier"
|
|
16
|
-
export namespace Event {
|
|
17
|
-
export namespace Account {
|
|
18
|
-
export function created(account: modelAccount, organization: string): Event {
|
|
19
|
-
return { organization, entity: "account", action: "created", data: account }
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
export namespace Operation {
|
|
23
|
-
export function performed(operation: modelOperation, organization: string, account: string): Event {
|
|
24
|
-
return { organization, account, entity: "operation", action: "performed", data: operation }
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
export namespace Organization {
|
|
28
|
-
export function created(organization: modelOrganization): Event {
|
|
29
|
-
return { entity: "organization", action: "created", data: organization }
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
export namespace Rail {
|
|
33
|
-
export function added(rail: modelRail, organization: string, account: string): Event {
|
|
34
|
-
return { organization, account, entity: "rail", action: "added", data: rail }
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
export namespace Transaction {
|
|
38
|
-
export function initiated(transaction: modelTransaction, organization: string, account: string): Event {
|
|
39
|
-
return {
|
|
40
|
-
organization,
|
|
41
|
-
account,
|
|
42
|
-
entity: "transaction",
|
|
43
|
-
action: "initiated",
|
|
44
|
-
data: transaction,
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
export function finalized(transaction: modelTransaction, organization: string, account: string): Event {
|
|
48
|
-
return {
|
|
49
|
-
organization,
|
|
50
|
-
account,
|
|
51
|
-
entity: "transaction",
|
|
52
|
-
action: "finalized",
|
|
53
|
-
data: transaction,
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
export function incoming(transaction: modelTransaction, organization: string, account: string): Event {
|
|
57
|
-
return {
|
|
58
|
-
organization,
|
|
59
|
-
account,
|
|
60
|
-
entity: "transaction",
|
|
61
|
-
action: "incoming",
|
|
62
|
-
data: transaction,
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
export function validated(transaction: modelTransaction, organization: string, account: string): Event {
|
|
66
|
-
return {
|
|
67
|
-
organization,
|
|
68
|
-
account,
|
|
69
|
-
entity: "transaction",
|
|
70
|
-
action: "validated",
|
|
71
|
-
data: transaction,
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
export function expired(transaction: modelTransaction, organization: string, account: string): Event {
|
|
75
|
-
return {
|
|
76
|
-
organization,
|
|
77
|
-
account,
|
|
78
|
-
entity: "transaction",
|
|
79
|
-
action: "expired",
|
|
80
|
-
data: transaction,
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
export namespace Supplier {
|
|
85
|
-
export namespace PaxGiro {
|
|
86
|
-
export function response(response: any, organization: string, account: string): Event {
|
|
87
|
-
return {
|
|
88
|
-
organization,
|
|
89
|
-
account,
|
|
90
|
-
entity: "supplier",
|
|
91
|
-
action: "transaction response",
|
|
92
|
-
data: response,
|
|
93
|
-
}
|
|
94
|
-
}
|
|
95
|
-
}
|
|
96
|
-
}
|
|
97
|
-
}
|
package/dist/Event/index.d.ts
DELETED
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import { Account as modelAccount } from "../Account";
|
|
2
|
-
import { Operation as modelOperation } from "../Operation";
|
|
3
|
-
import { Organization as modelOrganization } from "../Organization";
|
|
4
|
-
import { Rail as modelRail } from "../Rail";
|
|
5
|
-
import { Transaction as modelTransaction } from "../Transaction";
|
|
6
|
-
export interface Event {
|
|
7
|
-
organization?: string;
|
|
8
|
-
account?: string;
|
|
9
|
-
entity: Entity;
|
|
10
|
-
action: string;
|
|
11
|
-
data: any;
|
|
12
|
-
}
|
|
13
|
-
type Entity = "account" | "transaction" | "operation" | "rail" | "organization" | "authorization" | "supplier";
|
|
14
|
-
export declare namespace Event {
|
|
15
|
-
namespace Account {
|
|
16
|
-
function created(account: modelAccount, organization: string): Event;
|
|
17
|
-
}
|
|
18
|
-
namespace Operation {
|
|
19
|
-
function performed(operation: modelOperation, organization: string, account: string): Event;
|
|
20
|
-
}
|
|
21
|
-
namespace Organization {
|
|
22
|
-
function created(organization: modelOrganization): Event;
|
|
23
|
-
}
|
|
24
|
-
namespace Rail {
|
|
25
|
-
function added(rail: modelRail, organization: string, account: string): Event;
|
|
26
|
-
}
|
|
27
|
-
namespace Transaction {
|
|
28
|
-
function initiated(transaction: modelTransaction, organization: string, account: string): Event;
|
|
29
|
-
function finalized(transaction: modelTransaction, organization: string, account: string): Event;
|
|
30
|
-
function incoming(transaction: modelTransaction, organization: string, account: string): Event;
|
|
31
|
-
function validated(transaction: modelTransaction, organization: string, account: string): Event;
|
|
32
|
-
function expired(transaction: modelTransaction, organization: string, account: string): Event;
|
|
33
|
-
}
|
|
34
|
-
namespace Supplier {
|
|
35
|
-
namespace PaxGiro {
|
|
36
|
-
function response(response: any, organization: string, account: string): Event;
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
export {};
|