@pax2pay/model-banking 0.1.49 → 0.1.50
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/Authorization.ts +19 -0
- package/Card/Operation/Card.ts +20 -0
- package/Card/Operation/Settlement.ts +19 -0
- package/Card/Operation/index.ts +5 -5
- package/Card/index.ts +12 -8
- package/dist/Card/Operation/Authorization.d.ts +12 -0
- package/dist/Card/Operation/Authorization.js +13 -0
- package/dist/Card/Operation/Authorization.js.map +1 -0
- package/dist/Card/Operation/Card.d.ts +13 -0
- package/dist/Card/Operation/Card.js +14 -0
- package/dist/Card/Operation/Card.js.map +1 -0
- package/dist/Card/Operation/Settlement.d.ts +12 -0
- package/dist/Card/Operation/Settlement.js +13 -0
- package/dist/Card/Operation/Settlement.js.map +1 -0
- package/dist/Card/Operation/index.d.ts +6 -6
- package/dist/Card/Operation/index.js +4 -4
- package/dist/Card/Operation/index.js.map +1 -1
- package/dist/Card/index.d.ts +2 -3
- package/dist/Card/index.js +10 -6
- package/dist/Card/index.js.map +1 -1
- package/package.json +1 -1
- package/Card/Operation/Cancel.ts +0 -15
- package/Card/Operation/Change.ts +0 -18
- package/Card/Operation/Create.ts +0 -15
- package/dist/Card/Operation/Cancel.d.ts +0 -10
- package/dist/Card/Operation/Cancel.js +0 -11
- package/dist/Card/Operation/Cancel.js.map +0 -1
- package/dist/Card/Operation/Change.d.ts +0 -12
- package/dist/Card/Operation/Change.js +0 -13
- package/dist/Card/Operation/Change.js.map +0 -1
- package/dist/Card/Operation/Create.d.ts +0 -10
- package/dist/Card/Operation/Create.js +0 -11
- package/dist/Card/Operation/Create.js.map +0 -1
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { isoly } from "isoly"
|
|
2
|
+
import { isly } from "isly"
|
|
3
|
+
|
|
4
|
+
export interface Authorization {
|
|
5
|
+
type: "authorization"
|
|
6
|
+
status: "create" | "approve" | "decline"
|
|
7
|
+
reason?: string
|
|
8
|
+
created: isoly.DateTime
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export namespace Authorization {
|
|
12
|
+
export const type = isly.object<Authorization>({
|
|
13
|
+
type: isly.string("authorization"),
|
|
14
|
+
status: isly.union(isly.string("create"), isly.string("approve"), isly.string("decline")),
|
|
15
|
+
reason: isly.string().optional(),
|
|
16
|
+
created: isly.fromIs("isoly.DateTime", isoly.DateTime.is),
|
|
17
|
+
})
|
|
18
|
+
export const is = type.is
|
|
19
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { isoly } from "isoly"
|
|
2
|
+
import { isly } from "isly"
|
|
3
|
+
import { Changeable } from "../Changeable"
|
|
4
|
+
|
|
5
|
+
export interface Card {
|
|
6
|
+
type: "card"
|
|
7
|
+
status: "create" | "change" | "cancel"
|
|
8
|
+
from?: Changeable
|
|
9
|
+
created: isoly.DateTime
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export namespace Card {
|
|
13
|
+
export const type = isly.object<Card>({
|
|
14
|
+
type: isly.string("card"),
|
|
15
|
+
status: isly.union(isly.string("create"), isly.string("change"), isly.string("cancel")),
|
|
16
|
+
from: Changeable.type.optional(),
|
|
17
|
+
created: isly.fromIs("isoly.DateTime", isoly.DateTime.is),
|
|
18
|
+
})
|
|
19
|
+
export const is = type.is
|
|
20
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { isoly } from "isoly"
|
|
2
|
+
import { isly } from "isly"
|
|
3
|
+
|
|
4
|
+
export interface Settlement {
|
|
5
|
+
type: "settlement"
|
|
6
|
+
status: "capture" | "cancel" | "refund"
|
|
7
|
+
transaction?: string
|
|
8
|
+
created: isoly.DateTime
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export namespace Settlement {
|
|
12
|
+
export const type = isly.object<Settlement>({
|
|
13
|
+
type: isly.string("settlement"),
|
|
14
|
+
status: isly.union(isly.string("capture"), isly.string("cancel"), isly.string("refund")),
|
|
15
|
+
transaction: isly.string().optional(),
|
|
16
|
+
created: isly.fromIs("isoly.DateTime", isoly.DateTime.is),
|
|
17
|
+
})
|
|
18
|
+
export const is = type.is
|
|
19
|
+
}
|
package/Card/Operation/index.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { isly } from "isly"
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
2
|
+
import { Authorization } from "./Authorization"
|
|
3
|
+
import { Card } from "./Card"
|
|
4
|
+
import { Settlement } from "./Settlement"
|
|
5
5
|
|
|
6
|
-
export type Operation =
|
|
6
|
+
export type Operation = Card | Authorization | Settlement
|
|
7
7
|
|
|
8
8
|
export namespace Operation {
|
|
9
|
-
export const type = isly.union(
|
|
9
|
+
export const type = isly.union(Card.type, Authorization.type, Settlement.type)
|
|
10
10
|
export const is = type.is
|
|
11
11
|
}
|
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 { Operation as BankingOperation } from "../Operation"
|
|
5
4
|
import { Realm } from "../Realm"
|
|
6
5
|
import { Changeable as CardChangeable } from "./Changeable"
|
|
7
6
|
import { Creatable as CardCreatable } from "./Creatable"
|
|
@@ -13,7 +12,6 @@ import { Preset as CardPreset } from "./Preset"
|
|
|
13
12
|
export interface Card {
|
|
14
13
|
id: string
|
|
15
14
|
number?: string
|
|
16
|
-
token: string
|
|
17
15
|
created: isoly.DateTime
|
|
18
16
|
organization: string
|
|
19
17
|
account: string
|
|
@@ -25,11 +23,12 @@ export interface Card {
|
|
|
25
23
|
last4: string
|
|
26
24
|
expiry: CardExpiry
|
|
27
25
|
holder: string
|
|
26
|
+
token: string
|
|
28
27
|
}
|
|
29
28
|
limit: [isoly.Currency, number]
|
|
30
29
|
spent: [isoly.Currency, number]
|
|
31
30
|
status: "active" | "cancelled"
|
|
32
|
-
history:
|
|
31
|
+
history: CardOperation[]
|
|
33
32
|
rules: string[]
|
|
34
33
|
meta?: CardMeta
|
|
35
34
|
}
|
|
@@ -40,17 +39,22 @@ export namespace Card {
|
|
|
40
39
|
return {
|
|
41
40
|
id: cryptly.Identifier.generate(8),
|
|
42
41
|
number: card.number,
|
|
43
|
-
token: token,
|
|
44
42
|
created: created,
|
|
45
43
|
organization: organization,
|
|
46
44
|
account: card.account,
|
|
47
45
|
realm: card.realm,
|
|
48
46
|
preset: card.preset,
|
|
49
|
-
details: {
|
|
47
|
+
details: {
|
|
48
|
+
iin: card.details.iin,
|
|
49
|
+
last4: last4,
|
|
50
|
+
expiry: card.details.expiry,
|
|
51
|
+
holder: card.details.holder,
|
|
52
|
+
token: token,
|
|
53
|
+
},
|
|
50
54
|
limit: card.limit,
|
|
51
55
|
spent: [card.limit[0], 0],
|
|
52
56
|
status: "active",
|
|
53
|
-
history: [{ type: "create", created: created }],
|
|
57
|
+
history: [{ type: "card", status: "create", created: created }],
|
|
54
58
|
rules: card.rules ?? [],
|
|
55
59
|
meta: card.meta,
|
|
56
60
|
}
|
|
@@ -58,7 +62,6 @@ export namespace Card {
|
|
|
58
62
|
export const type = isly.object<Card>({
|
|
59
63
|
id: isly.string(),
|
|
60
64
|
number: isly.string().optional(),
|
|
61
|
-
token: isly.string(),
|
|
62
65
|
created: isly.string(),
|
|
63
66
|
organization: isly.string(),
|
|
64
67
|
account: isly.string(),
|
|
@@ -70,11 +73,12 @@ export namespace Card {
|
|
|
70
73
|
last4: isly.string(),
|
|
71
74
|
expiry: CardExpiry.type,
|
|
72
75
|
holder: isly.string(),
|
|
76
|
+
token: isly.string(),
|
|
73
77
|
}),
|
|
74
78
|
limit: isly.tuple(isly.fromIs("isoly.Currency", isoly.Currency.is), isly.number()),
|
|
75
79
|
spent: isly.tuple(isly.fromIs("isoly.Currency", isoly.Currency.is), isly.number()),
|
|
76
80
|
status: isly.union(isly.string("active"), isly.string("cancelled")),
|
|
77
|
-
history: isly.
|
|
81
|
+
history: isly.array(CardOperation.type),
|
|
78
82
|
rules: isly.string().array(),
|
|
79
83
|
meta: isly.fromIs("Card.Meta", CardMeta.is).optional(),
|
|
80
84
|
})
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { isoly } from "isoly";
|
|
2
|
+
import { isly } from "isly";
|
|
3
|
+
export interface Authorization {
|
|
4
|
+
type: "authorization";
|
|
5
|
+
status: "create" | "approve" | "decline";
|
|
6
|
+
reason?: string;
|
|
7
|
+
created: isoly.DateTime;
|
|
8
|
+
}
|
|
9
|
+
export declare namespace Authorization {
|
|
10
|
+
const type: isly.object.ExtendableType<Authorization>;
|
|
11
|
+
const is: isly.Type.IsFunction<Authorization>;
|
|
12
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { isoly } from "isoly";
|
|
2
|
+
import { isly } from "isly";
|
|
3
|
+
export var Authorization;
|
|
4
|
+
(function (Authorization) {
|
|
5
|
+
Authorization.type = isly.object({
|
|
6
|
+
type: isly.string("authorization"),
|
|
7
|
+
status: isly.union(isly.string("create"), isly.string("approve"), isly.string("decline")),
|
|
8
|
+
reason: isly.string().optional(),
|
|
9
|
+
created: isly.fromIs("isoly.DateTime", isoly.DateTime.is),
|
|
10
|
+
});
|
|
11
|
+
Authorization.is = Authorization.type.is;
|
|
12
|
+
})(Authorization || (Authorization = {}));
|
|
13
|
+
//# sourceMappingURL=Authorization.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Authorization.js","sourceRoot":"../","sources":["Card/Operation/Authorization.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,OAAO,CAAA;AAC7B,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAA;AAS3B,MAAM,KAAW,aAAa,CAQ7B;AARD,WAAiB,aAAa;IAChB,kBAAI,GAAG,IAAI,CAAC,MAAM,CAAgB;QAC9C,IAAI,EAAE,IAAI,CAAC,MAAM,CAAC,eAAe,CAAC;QAClC,MAAM,EAAE,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,EAAE,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,EAAE,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;QACzF,MAAM,EAAE,IAAI,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;QAChC,OAAO,EAAE,IAAI,CAAC,MAAM,CAAC,gBAAgB,EAAE,KAAK,CAAC,QAAQ,CAAC,EAAE,CAAC;KACzD,CAAC,CAAA;IACW,gBAAE,GAAG,cAAA,IAAI,CAAC,EAAE,CAAA;AAC1B,CAAC,EARgB,aAAa,KAAb,aAAa,QAQ7B"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { isoly } from "isoly";
|
|
2
|
+
import { isly } from "isly";
|
|
3
|
+
import { Changeable } from "../Changeable";
|
|
4
|
+
export interface Card {
|
|
5
|
+
type: "card";
|
|
6
|
+
status: "create" | "change" | "cancel";
|
|
7
|
+
from?: Changeable;
|
|
8
|
+
created: isoly.DateTime;
|
|
9
|
+
}
|
|
10
|
+
export declare namespace Card {
|
|
11
|
+
const type: isly.object.ExtendableType<Card>;
|
|
12
|
+
const is: isly.Type.IsFunction<Card>;
|
|
13
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { isoly } from "isoly";
|
|
2
|
+
import { isly } from "isly";
|
|
3
|
+
import { Changeable } from "../Changeable";
|
|
4
|
+
export var Card;
|
|
5
|
+
(function (Card) {
|
|
6
|
+
Card.type = isly.object({
|
|
7
|
+
type: isly.string("card"),
|
|
8
|
+
status: isly.union(isly.string("create"), isly.string("change"), isly.string("cancel")),
|
|
9
|
+
from: Changeable.type.optional(),
|
|
10
|
+
created: isly.fromIs("isoly.DateTime", isoly.DateTime.is),
|
|
11
|
+
});
|
|
12
|
+
Card.is = Card.type.is;
|
|
13
|
+
})(Card || (Card = {}));
|
|
14
|
+
//# sourceMappingURL=Card.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Card.js","sourceRoot":"../","sources":["Card/Operation/Card.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,OAAO,CAAA;AAC7B,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAA;AAC3B,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAA;AAS1C,MAAM,KAAW,IAAI,CAQpB;AARD,WAAiB,IAAI;IACP,SAAI,GAAG,IAAI,CAAC,MAAM,CAAO;QACrC,IAAI,EAAE,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC;QACzB,MAAM,EAAE,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,EAAE,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,EAAE,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;QACvF,IAAI,EAAE,UAAU,CAAC,IAAI,CAAC,QAAQ,EAAE;QAChC,OAAO,EAAE,IAAI,CAAC,MAAM,CAAC,gBAAgB,EAAE,KAAK,CAAC,QAAQ,CAAC,EAAE,CAAC;KACzD,CAAC,CAAA;IACW,OAAE,GAAG,KAAA,IAAI,CAAC,EAAE,CAAA;AAC1B,CAAC,EARgB,IAAI,KAAJ,IAAI,QAQpB"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { isoly } from "isoly";
|
|
2
|
+
import { isly } from "isly";
|
|
3
|
+
export interface Settlement {
|
|
4
|
+
type: "settlement";
|
|
5
|
+
status: "capture" | "cancel" | "refund";
|
|
6
|
+
transaction?: string;
|
|
7
|
+
created: isoly.DateTime;
|
|
8
|
+
}
|
|
9
|
+
export declare namespace Settlement {
|
|
10
|
+
const type: isly.object.ExtendableType<Settlement>;
|
|
11
|
+
const is: isly.Type.IsFunction<Settlement>;
|
|
12
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { isoly } from "isoly";
|
|
2
|
+
import { isly } from "isly";
|
|
3
|
+
export var Settlement;
|
|
4
|
+
(function (Settlement) {
|
|
5
|
+
Settlement.type = isly.object({
|
|
6
|
+
type: isly.string("settlement"),
|
|
7
|
+
status: isly.union(isly.string("capture"), isly.string("cancel"), isly.string("refund")),
|
|
8
|
+
transaction: isly.string().optional(),
|
|
9
|
+
created: isly.fromIs("isoly.DateTime", isoly.DateTime.is),
|
|
10
|
+
});
|
|
11
|
+
Settlement.is = Settlement.type.is;
|
|
12
|
+
})(Settlement || (Settlement = {}));
|
|
13
|
+
//# sourceMappingURL=Settlement.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Settlement.js","sourceRoot":"../","sources":["Card/Operation/Settlement.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,OAAO,CAAA;AAC7B,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAA;AAS3B,MAAM,KAAW,UAAU,CAQ1B;AARD,WAAiB,UAAU;IACb,eAAI,GAAG,IAAI,CAAC,MAAM,CAAa;QAC3C,IAAI,EAAE,IAAI,CAAC,MAAM,CAAC,YAAY,CAAC;QAC/B,MAAM,EAAE,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,EAAE,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,EAAE,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;QACxF,WAAW,EAAE,IAAI,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;QACrC,OAAO,EAAE,IAAI,CAAC,MAAM,CAAC,gBAAgB,EAAE,KAAK,CAAC,QAAQ,CAAC,EAAE,CAAC;KACzD,CAAC,CAAA;IACW,aAAE,GAAG,WAAA,IAAI,CAAC,EAAE,CAAA;AAC1B,CAAC,EARgB,UAAU,KAAV,UAAU,QAQ1B"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { isly } from "isly";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
export type Operation =
|
|
2
|
+
import { Authorization } from "./Authorization";
|
|
3
|
+
import { Card } from "./Card";
|
|
4
|
+
import { Settlement } from "./Settlement";
|
|
5
|
+
export type Operation = Card | Authorization | Settlement;
|
|
6
6
|
export declare namespace Operation {
|
|
7
|
-
const type: isly.Type<
|
|
8
|
-
const is: isly.Type.IsFunction<
|
|
7
|
+
const type: isly.Type<Authorization | Card | Settlement>;
|
|
8
|
+
const is: isly.Type.IsFunction<Authorization | Card | Settlement>;
|
|
9
9
|
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { isly } from "isly";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
2
|
+
import { Authorization } from "./Authorization";
|
|
3
|
+
import { Card } from "./Card";
|
|
4
|
+
import { Settlement } from "./Settlement";
|
|
5
5
|
export var Operation;
|
|
6
6
|
(function (Operation) {
|
|
7
|
-
Operation.type = isly.union(
|
|
7
|
+
Operation.type = isly.union(Card.type, Authorization.type, Settlement.type);
|
|
8
8
|
Operation.is = Operation.type.is;
|
|
9
9
|
})(Operation || (Operation = {}));
|
|
10
10
|
//# 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;AAC3B,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"../","sources":["Card/Operation/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAA;AAC3B,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAA;AAC/C,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAA;AAC7B,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA;AAIzC,MAAM,KAAW,SAAS,CAGzB;AAHD,WAAiB,SAAS;IACZ,cAAI,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,EAAE,aAAa,CAAC,IAAI,EAAE,UAAU,CAAC,IAAI,CAAC,CAAA;IACjE,YAAE,GAAG,UAAA,IAAI,CAAC,EAAE,CAAA;AAC1B,CAAC,EAHgB,SAAS,KAAT,SAAS,QAGzB"}
|
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 { Operation as BankingOperation } from "../Operation";
|
|
4
3
|
import { Realm } from "../Realm";
|
|
5
4
|
import { Changeable as CardChangeable } from "./Changeable";
|
|
6
5
|
import { Creatable as CardCreatable } from "./Creatable";
|
|
@@ -11,7 +10,6 @@ import { Preset as CardPreset } from "./Preset";
|
|
|
11
10
|
export interface Card {
|
|
12
11
|
id: string;
|
|
13
12
|
number?: string;
|
|
14
|
-
token: string;
|
|
15
13
|
created: isoly.DateTime;
|
|
16
14
|
organization: string;
|
|
17
15
|
account: string;
|
|
@@ -23,11 +21,12 @@ export interface Card {
|
|
|
23
21
|
last4: string;
|
|
24
22
|
expiry: CardExpiry;
|
|
25
23
|
holder: string;
|
|
24
|
+
token: string;
|
|
26
25
|
};
|
|
27
26
|
limit: [isoly.Currency, number];
|
|
28
27
|
spent: [isoly.Currency, number];
|
|
29
28
|
status: "active" | "cancelled";
|
|
30
|
-
history:
|
|
29
|
+
history: CardOperation[];
|
|
31
30
|
rules: string[];
|
|
32
31
|
meta?: CardMeta;
|
|
33
32
|
}
|
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 { Operation as BankingOperation } from "../Operation";
|
|
5
4
|
import { Realm } from "../Realm";
|
|
6
5
|
import { Changeable as CardChangeable } from "./Changeable";
|
|
7
6
|
import { Creatable as CardCreatable } from "./Creatable";
|
|
@@ -16,17 +15,22 @@ export var Card;
|
|
|
16
15
|
return {
|
|
17
16
|
id: cryptly.Identifier.generate(8),
|
|
18
17
|
number: card.number,
|
|
19
|
-
token: token,
|
|
20
18
|
created: created,
|
|
21
19
|
organization: organization,
|
|
22
20
|
account: card.account,
|
|
23
21
|
realm: card.realm,
|
|
24
22
|
preset: card.preset,
|
|
25
|
-
details: {
|
|
23
|
+
details: {
|
|
24
|
+
iin: card.details.iin,
|
|
25
|
+
last4: last4,
|
|
26
|
+
expiry: card.details.expiry,
|
|
27
|
+
holder: card.details.holder,
|
|
28
|
+
token: token,
|
|
29
|
+
},
|
|
26
30
|
limit: card.limit,
|
|
27
31
|
spent: [card.limit[0], 0],
|
|
28
32
|
status: "active",
|
|
29
|
-
history: [{ type: "create", created: created }],
|
|
33
|
+
history: [{ type: "card", status: "create", created: created }],
|
|
30
34
|
rules: card.rules ?? [],
|
|
31
35
|
meta: card.meta,
|
|
32
36
|
};
|
|
@@ -35,7 +39,6 @@ export var Card;
|
|
|
35
39
|
Card.type = isly.object({
|
|
36
40
|
id: isly.string(),
|
|
37
41
|
number: isly.string().optional(),
|
|
38
|
-
token: isly.string(),
|
|
39
42
|
created: isly.string(),
|
|
40
43
|
organization: isly.string(),
|
|
41
44
|
account: isly.string(),
|
|
@@ -47,11 +50,12 @@ export var Card;
|
|
|
47
50
|
last4: isly.string(),
|
|
48
51
|
expiry: CardExpiry.type,
|
|
49
52
|
holder: isly.string(),
|
|
53
|
+
token: isly.string(),
|
|
50
54
|
}),
|
|
51
55
|
limit: isly.tuple(isly.fromIs("isoly.Currency", isoly.Currency.is), isly.number()),
|
|
52
56
|
spent: isly.tuple(isly.fromIs("isoly.Currency", isoly.Currency.is), isly.number()),
|
|
53
57
|
status: isly.union(isly.string("active"), isly.string("cancelled")),
|
|
54
|
-
history: isly.
|
|
58
|
+
history: isly.array(CardOperation.type),
|
|
55
59
|
rules: isly.string().array(),
|
|
56
60
|
meta: isly.fromIs("Card.Meta", CardMeta.is).optional(),
|
|
57
61
|
});
|
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,KAAK,EAAE,MAAM,UAAU,CAAA;AAChC,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;AA0B/C,MAAM,KAAW,IAAI,CA8DpB;AA9DD,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,CAA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QA8DpB"}
|
package/package.json
CHANGED
package/Card/Operation/Cancel.ts
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { isoly } from "isoly"
|
|
2
|
-
import { isly } from "isly"
|
|
3
|
-
|
|
4
|
-
export interface Cancel {
|
|
5
|
-
type: "cancel"
|
|
6
|
-
created: isoly.DateTime
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
export namespace Cancel {
|
|
10
|
-
export const type = isly.object<Cancel>({
|
|
11
|
-
type: isly.string("cancel"),
|
|
12
|
-
created: isly.fromIs("isoly.DateTime", isoly.DateTime.is),
|
|
13
|
-
})
|
|
14
|
-
export const is = type.is
|
|
15
|
-
}
|
package/Card/Operation/Change.ts
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { isoly } from "isoly"
|
|
2
|
-
import { isly } from "isly"
|
|
3
|
-
import { Changeable } from "../Changeable"
|
|
4
|
-
|
|
5
|
-
export interface Change {
|
|
6
|
-
type: "change"
|
|
7
|
-
from: Changeable
|
|
8
|
-
created: isoly.DateTime
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
export namespace Change {
|
|
12
|
-
export const type = isly.object<Change>({
|
|
13
|
-
type: isly.string("change"),
|
|
14
|
-
from: Changeable.type,
|
|
15
|
-
created: isly.fromIs("isoly.DateTime", isoly.DateTime.is),
|
|
16
|
-
})
|
|
17
|
-
export const is = type.is
|
|
18
|
-
}
|
package/Card/Operation/Create.ts
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { isoly } from "isoly"
|
|
2
|
-
import { isly } from "isly"
|
|
3
|
-
|
|
4
|
-
export interface Create {
|
|
5
|
-
type: "create"
|
|
6
|
-
created: isoly.DateTime
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
export namespace Create {
|
|
10
|
-
export const type = isly.object<Create>({
|
|
11
|
-
type: isly.string("create"),
|
|
12
|
-
created: isly.fromIs("isoly.DateTime", isoly.DateTime.is),
|
|
13
|
-
})
|
|
14
|
-
export const is = type.is
|
|
15
|
-
}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { isoly } from "isoly";
|
|
2
|
-
import { isly } from "isly";
|
|
3
|
-
export interface Cancel {
|
|
4
|
-
type: "cancel";
|
|
5
|
-
created: isoly.DateTime;
|
|
6
|
-
}
|
|
7
|
-
export declare namespace Cancel {
|
|
8
|
-
const type: isly.object.ExtendableType<Cancel>;
|
|
9
|
-
const is: isly.Type.IsFunction<Cancel>;
|
|
10
|
-
}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { isoly } from "isoly";
|
|
2
|
-
import { isly } from "isly";
|
|
3
|
-
export var Cancel;
|
|
4
|
-
(function (Cancel) {
|
|
5
|
-
Cancel.type = isly.object({
|
|
6
|
-
type: isly.string("cancel"),
|
|
7
|
-
created: isly.fromIs("isoly.DateTime", isoly.DateTime.is),
|
|
8
|
-
});
|
|
9
|
-
Cancel.is = Cancel.type.is;
|
|
10
|
-
})(Cancel || (Cancel = {}));
|
|
11
|
-
//# sourceMappingURL=Cancel.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Cancel.js","sourceRoot":"../","sources":["Card/Operation/Cancel.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,OAAO,CAAA;AAC7B,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAA;AAO3B,MAAM,KAAW,MAAM,CAMtB;AAND,WAAiB,MAAM;IACT,WAAI,GAAG,IAAI,CAAC,MAAM,CAAS;QACvC,IAAI,EAAE,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC;QAC3B,OAAO,EAAE,IAAI,CAAC,MAAM,CAAC,gBAAgB,EAAE,KAAK,CAAC,QAAQ,CAAC,EAAE,CAAC;KACzD,CAAC,CAAA;IACW,SAAE,GAAG,OAAA,IAAI,CAAC,EAAE,CAAA;AAC1B,CAAC,EANgB,MAAM,KAAN,MAAM,QAMtB"}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { isoly } from "isoly";
|
|
2
|
-
import { isly } from "isly";
|
|
3
|
-
import { Changeable } from "../Changeable";
|
|
4
|
-
export interface Change {
|
|
5
|
-
type: "change";
|
|
6
|
-
from: Changeable;
|
|
7
|
-
created: isoly.DateTime;
|
|
8
|
-
}
|
|
9
|
-
export declare namespace Change {
|
|
10
|
-
const type: isly.object.ExtendableType<Change>;
|
|
11
|
-
const is: isly.Type.IsFunction<Change>;
|
|
12
|
-
}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { isoly } from "isoly";
|
|
2
|
-
import { isly } from "isly";
|
|
3
|
-
import { Changeable } from "../Changeable";
|
|
4
|
-
export var Change;
|
|
5
|
-
(function (Change) {
|
|
6
|
-
Change.type = isly.object({
|
|
7
|
-
type: isly.string("change"),
|
|
8
|
-
from: Changeable.type,
|
|
9
|
-
created: isly.fromIs("isoly.DateTime", isoly.DateTime.is),
|
|
10
|
-
});
|
|
11
|
-
Change.is = Change.type.is;
|
|
12
|
-
})(Change || (Change = {}));
|
|
13
|
-
//# sourceMappingURL=Change.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Change.js","sourceRoot":"../","sources":["Card/Operation/Change.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,OAAO,CAAA;AAC7B,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAA;AAC3B,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAA;AAQ1C,MAAM,KAAW,MAAM,CAOtB;AAPD,WAAiB,MAAM;IACT,WAAI,GAAG,IAAI,CAAC,MAAM,CAAS;QACvC,IAAI,EAAE,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC;QAC3B,IAAI,EAAE,UAAU,CAAC,IAAI;QACrB,OAAO,EAAE,IAAI,CAAC,MAAM,CAAC,gBAAgB,EAAE,KAAK,CAAC,QAAQ,CAAC,EAAE,CAAC;KACzD,CAAC,CAAA;IACW,SAAE,GAAG,OAAA,IAAI,CAAC,EAAE,CAAA;AAC1B,CAAC,EAPgB,MAAM,KAAN,MAAM,QAOtB"}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { isoly } from "isoly";
|
|
2
|
-
import { isly } from "isly";
|
|
3
|
-
export interface Create {
|
|
4
|
-
type: "create";
|
|
5
|
-
created: isoly.DateTime;
|
|
6
|
-
}
|
|
7
|
-
export declare namespace Create {
|
|
8
|
-
const type: isly.object.ExtendableType<Create>;
|
|
9
|
-
const is: isly.Type.IsFunction<Create>;
|
|
10
|
-
}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { isoly } from "isoly";
|
|
2
|
-
import { isly } from "isly";
|
|
3
|
-
export var Create;
|
|
4
|
-
(function (Create) {
|
|
5
|
-
Create.type = isly.object({
|
|
6
|
-
type: isly.string("create"),
|
|
7
|
-
created: isly.fromIs("isoly.DateTime", isoly.DateTime.is),
|
|
8
|
-
});
|
|
9
|
-
Create.is = Create.type.is;
|
|
10
|
-
})(Create || (Create = {}));
|
|
11
|
-
//# sourceMappingURL=Create.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Create.js","sourceRoot":"../","sources":["Card/Operation/Create.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,OAAO,CAAA;AAC7B,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAA;AAO3B,MAAM,KAAW,MAAM,CAMtB;AAND,WAAiB,MAAM;IACT,WAAI,GAAG,IAAI,CAAC,MAAM,CAAS;QACvC,IAAI,EAAE,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC;QAC3B,OAAO,EAAE,IAAI,CAAC,MAAM,CAAC,gBAAgB,EAAE,KAAK,CAAC,QAAQ,CAAC,EAAE,CAAC;KACzD,CAAC,CAAA;IACW,SAAE,GAAG,OAAA,IAAI,CAAC,EAAE,CAAA;AAC1B,CAAC,EANgB,MAAM,KAAN,MAAM,QAMtB"}
|