@pax2pay/model-banking 0.1.292 → 0.1.293
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/Operation/index.ts +28 -5
- package/Card/index.ts +8 -16
- package/dist/Card/Operation/index.d.ts +8 -5
- package/dist/Card/Operation/index.js +23 -2
- package/dist/Card/Operation/index.js.map +1 -1
- package/dist/Card/index.d.ts +8 -16
- package/dist/Card/index.js.map +1 -1
- package/dist/Rail/index.d.ts +1 -1
- package/dist/Transaction/Status.d.ts +2 -2
- package/package.json +1 -1
package/Card/Operation/index.ts
CHANGED
|
@@ -1,19 +1,42 @@
|
|
|
1
|
+
import { isoly } from "isoly"
|
|
1
2
|
import { isly } from "isly"
|
|
3
|
+
import { Authorization } from "../../Authorization"
|
|
2
4
|
import { Entry } from "../../Settlement/Entry"
|
|
3
|
-
import { Authorization } from "./Authorization"
|
|
5
|
+
import { Authorization as OperationAuthorization } from "./Authorization"
|
|
4
6
|
import { Card } from "./Card"
|
|
5
7
|
|
|
6
|
-
export type Operation = Card |
|
|
8
|
+
export type Operation = Card | OperationAuthorization
|
|
7
9
|
|
|
8
10
|
export namespace Operation {
|
|
9
|
-
export function
|
|
10
|
-
|
|
11
|
+
export function fromAuthorization(
|
|
12
|
+
authorization: Authorization,
|
|
13
|
+
status: OperationAuthorization.Status
|
|
14
|
+
): Operation | undefined {
|
|
15
|
+
return {
|
|
16
|
+
type: "authorization",
|
|
17
|
+
id: authorization?.id ?? authorization.transaction?.id ?? "unknown",
|
|
18
|
+
status,
|
|
19
|
+
created: isoly.DateTime.now(),
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
export function fromEntry(entry: Entry): Operation | undefined {
|
|
23
|
+
return entry.type == "unknown"
|
|
24
|
+
? undefined
|
|
25
|
+
: {
|
|
26
|
+
type: "authorization",
|
|
27
|
+
id: (entry.type != "refund" ? entry.authorization?.id : entry.transaction?.id) ?? "unknown",
|
|
28
|
+
status: Operation.fromEntryStatus(entry.type),
|
|
29
|
+
created: isoly.DateTime.now(),
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
export function fromEntryStatus(status: Exclude<Entry.Type, "unknown">): OperationAuthorization.Status {
|
|
33
|
+
const statusConverter: Record<Exclude<Entry.Type, "unknown">, OperationAuthorization.Status> = {
|
|
11
34
|
capture: "captured",
|
|
12
35
|
cancel: "cancelled",
|
|
13
36
|
refund: "refunded",
|
|
14
37
|
}
|
|
15
38
|
return statusConverter[status]
|
|
16
39
|
}
|
|
17
|
-
export const type = isly.union(Card.type,
|
|
40
|
+
export const type = isly.union(Card.type, OperationAuthorization.type)
|
|
18
41
|
export const is = type.is
|
|
19
42
|
}
|
package/Card/index.ts
CHANGED
|
@@ -63,20 +63,12 @@ export namespace Card {
|
|
|
63
63
|
meta: isly.fromIs("Card.Meta", CardMeta.is).optional(),
|
|
64
64
|
})
|
|
65
65
|
export const is = type.is
|
|
66
|
-
export
|
|
67
|
-
export
|
|
68
|
-
export
|
|
69
|
-
export
|
|
70
|
-
export
|
|
71
|
-
export
|
|
72
|
-
export
|
|
73
|
-
export
|
|
74
|
-
export type Changeable = CardChangeable
|
|
75
|
-
export const Changeable = CardChangeable
|
|
76
|
-
export type Operation = CardOperation
|
|
77
|
-
export const Operation = CardOperation
|
|
78
|
-
export type Scheme = CardScheme
|
|
79
|
-
export const Scheme = CardScheme
|
|
80
|
-
export type Stack = CardStack
|
|
81
|
-
export const Stack = CardStack
|
|
66
|
+
export import Creatable = CardCreatable
|
|
67
|
+
export import Preset = CardPreset
|
|
68
|
+
export import Meta = CardMeta
|
|
69
|
+
export import Expiry = CardExpiry
|
|
70
|
+
export import Changeable = CardChangeable
|
|
71
|
+
export import Operation = CardOperation
|
|
72
|
+
export import Scheme = CardScheme
|
|
73
|
+
export import Stack = CardStack
|
|
82
74
|
}
|
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
import { isly } from "isly";
|
|
2
|
+
import { Authorization } from "../../Authorization";
|
|
2
3
|
import { Entry } from "../../Settlement/Entry";
|
|
3
|
-
import { Authorization } from "./Authorization";
|
|
4
|
+
import { Authorization as OperationAuthorization } from "./Authorization";
|
|
4
5
|
import { Card } from "./Card";
|
|
5
|
-
export type Operation = Card |
|
|
6
|
+
export type Operation = Card | OperationAuthorization;
|
|
6
7
|
export declare namespace Operation {
|
|
7
|
-
function
|
|
8
|
-
|
|
9
|
-
|
|
8
|
+
function fromAuthorization(authorization: Authorization, status: OperationAuthorization.Status): Operation | undefined;
|
|
9
|
+
function fromEntry(entry: Entry): Operation | undefined;
|
|
10
|
+
function fromEntryStatus(status: Exclude<Entry.Type, "unknown">): OperationAuthorization.Status;
|
|
11
|
+
const type: isly.Type<Card | OperationAuthorization>;
|
|
12
|
+
const is: isly.Type.IsFunction<Card | OperationAuthorization>;
|
|
10
13
|
}
|
|
@@ -1,8 +1,29 @@
|
|
|
1
|
+
import { isoly } from "isoly";
|
|
1
2
|
import { isly } from "isly";
|
|
2
|
-
import { Authorization } from "./Authorization";
|
|
3
|
+
import { Authorization as OperationAuthorization } from "./Authorization";
|
|
3
4
|
import { Card } from "./Card";
|
|
4
5
|
export var Operation;
|
|
5
6
|
(function (Operation) {
|
|
7
|
+
function fromAuthorization(authorization, status) {
|
|
8
|
+
return {
|
|
9
|
+
type: "authorization",
|
|
10
|
+
id: authorization?.id ?? authorization.transaction?.id ?? "unknown",
|
|
11
|
+
status,
|
|
12
|
+
created: isoly.DateTime.now(),
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
Operation.fromAuthorization = fromAuthorization;
|
|
16
|
+
function fromEntry(entry) {
|
|
17
|
+
return entry.type == "unknown"
|
|
18
|
+
? undefined
|
|
19
|
+
: {
|
|
20
|
+
type: "authorization",
|
|
21
|
+
id: (entry.type != "refund" ? entry.authorization?.id : entry.transaction?.id) ?? "unknown",
|
|
22
|
+
status: Operation.fromEntryStatus(entry.type),
|
|
23
|
+
created: isoly.DateTime.now(),
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
Operation.fromEntry = fromEntry;
|
|
6
27
|
function fromEntryStatus(status) {
|
|
7
28
|
const statusConverter = {
|
|
8
29
|
capture: "captured",
|
|
@@ -12,7 +33,7 @@ export var Operation;
|
|
|
12
33
|
return statusConverter[status];
|
|
13
34
|
}
|
|
14
35
|
Operation.fromEntryStatus = fromEntryStatus;
|
|
15
|
-
Operation.type = isly.union(Card.type,
|
|
36
|
+
Operation.type = isly.union(Card.type, OperationAuthorization.type);
|
|
16
37
|
Operation.is = Operation.type.is;
|
|
17
38
|
})(Operation || (Operation = {}));
|
|
18
39
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"../","sources":["Card/Operation/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAA;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"../","sources":["Card/Operation/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,OAAO,CAAA;AAC7B,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAA;AAG3B,OAAO,EAAE,aAAa,IAAI,sBAAsB,EAAE,MAAM,iBAAiB,CAAA;AACzE,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAA;AAI7B,MAAM,KAAW,SAAS,CAgCzB;AAhCD,WAAiB,SAAS;IACzB,SAAgB,iBAAiB,CAChC,aAA4B,EAC5B,MAAqC;QAErC,OAAO;YACN,IAAI,EAAE,eAAe;YACrB,EAAE,EAAE,aAAa,EAAE,EAAE,IAAI,aAAa,CAAC,WAAW,EAAE,EAAE,IAAI,SAAS;YACnE,MAAM;YACN,OAAO,EAAE,KAAK,CAAC,QAAQ,CAAC,GAAG,EAAE;SAC7B,CAAA;IACF,CAAC;IAVe,2BAAiB,oBAUhC,CAAA;IACD,SAAgB,SAAS,CAAC,KAAY;QACrC,OAAO,KAAK,CAAC,IAAI,IAAI,SAAS;YAC7B,CAAC,CAAC,SAAS;YACX,CAAC,CAAC;gBACA,IAAI,EAAE,eAAe;gBACrB,EAAE,EAAE,CAAC,KAAK,CAAC,IAAI,IAAI,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,aAAa,EAAE,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,WAAW,EAAE,EAAE,CAAC,IAAI,SAAS;gBAC3F,MAAM,EAAE,SAAS,CAAC,eAAe,CAAC,KAAK,CAAC,IAAI,CAAC;gBAC7C,OAAO,EAAE,KAAK,CAAC,QAAQ,CAAC,GAAG,EAAE;aAC5B,CAAA;IACL,CAAC;IATe,mBAAS,YASxB,CAAA;IACD,SAAgB,eAAe,CAAC,MAAsC;QACrE,MAAM,eAAe,GAA0E;YAC9F,OAAO,EAAE,UAAU;YACnB,MAAM,EAAE,WAAW;YACnB,MAAM,EAAE,UAAU;SAClB,CAAA;QACD,OAAO,eAAe,CAAC,MAAM,CAAC,CAAA;IAC/B,CAAC;IAPe,yBAAe,kBAO9B,CAAA;IACY,cAAI,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,EAAE,sBAAsB,CAAC,IAAI,CAAC,CAAA;IACzD,YAAE,GAAG,UAAA,IAAI,CAAC,EAAE,CAAA;AAC1B,CAAC,EAhCgB,SAAS,KAAT,SAAS,QAgCzB"}
|
package/dist/Card/index.d.ts
CHANGED
|
@@ -38,20 +38,12 @@ export interface Card {
|
|
|
38
38
|
export declare namespace Card {
|
|
39
39
|
const type: isly.object.ExtendableType<Card>;
|
|
40
40
|
const is: isly.Type.IsFunction<Card>;
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
type Changeable = CardChangeable;
|
|
50
|
-
const Changeable: typeof CardChangeable;
|
|
51
|
-
type Operation = CardOperation;
|
|
52
|
-
const Operation: typeof CardOperation;
|
|
53
|
-
type Scheme = CardScheme;
|
|
54
|
-
const Scheme: typeof CardScheme;
|
|
55
|
-
type Stack = CardStack;
|
|
56
|
-
const Stack: typeof CardStack;
|
|
41
|
+
export import Creatable = CardCreatable;
|
|
42
|
+
export import Preset = CardPreset;
|
|
43
|
+
export import Meta = CardMeta;
|
|
44
|
+
export import Expiry = CardExpiry;
|
|
45
|
+
export import Changeable = CardChangeable;
|
|
46
|
+
export import Operation = CardOperation;
|
|
47
|
+
export import Scheme = CardScheme;
|
|
48
|
+
export import Stack = CardStack;
|
|
57
49
|
}
|
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,KAAK,EAAE,MAAM,OAAO,CAAA;AAC7B,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAA;AAE3B,OAAO,EAAE,KAAK,EAAE,MAAM,UAAU,CAAA;AAChC,OAAO,EAAQ,IAAI,IAAI,QAAQ,EAAE,MAAM,cAAc,CAAA;AACrD,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;AAC/C,OAAO,EAAE,MAAM,IAAI,UAAU,EAAE,MAAM,UAAU,CAAA;AAC/C,OAAO,EAAE,KAAK,IAAI,SAAS,EAAE,MAAM,SAAS,CAAA;AA2B5C,MAAM,KAAW,IAAI,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"../","sources":["Card/index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AI,KAAJ,IAAI,QAkCpB"}
|
package/dist/Rail/index.d.ts
CHANGED
|
@@ -3,6 +3,6 @@ import { Address as RailAddress } from "./Address";
|
|
|
3
3
|
export type Rail = typeof Rail.rails[number];
|
|
4
4
|
export declare namespace Rail {
|
|
5
5
|
const rails: readonly ["internal", "paxgiro", "paxgiro-credit", "mastercard", "fasterpayments", "chaps", "bacs", "transfer", "credit"];
|
|
6
|
-
const type: isly.Type<"paxgiro" | "paxgiro-credit" | "
|
|
6
|
+
const type: isly.Type<"paxgiro" | "paxgiro-credit" | "internal" | "mastercard" | "fasterpayments" | "chaps" | "bacs" | "transfer" | "credit">;
|
|
7
7
|
export import Address = RailAddress;
|
|
8
8
|
}
|
|
@@ -2,7 +2,7 @@ import { isly } from "isly";
|
|
|
2
2
|
export type Status = typeof Status.values[number];
|
|
3
3
|
export declare namespace Status {
|
|
4
4
|
const values: readonly ["created", "approved", "rejected", "processing", "finalized", "cancelled"];
|
|
5
|
-
const type: isly.Type<"rejected" | "created" | "
|
|
6
|
-
const is: isly.Type.IsFunction<"rejected" | "created" | "
|
|
5
|
+
const type: isly.Type<"rejected" | "created" | "approved" | "processing" | "finalized" | "cancelled">;
|
|
6
|
+
const is: isly.Type.IsFunction<"rejected" | "created" | "approved" | "processing" | "finalized" | "cancelled">;
|
|
7
7
|
const flaw: isly.Type.FlawFunction;
|
|
8
8
|
}
|