@pax2pay/model-banking 0.1.43 → 0.1.44

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.
Files changed (45) hide show
  1. package/Card/Changable.ts +17 -0
  2. package/Card/Creatable.ts +36 -0
  3. package/Card/Expiry.ts +15 -0
  4. package/Card/Meta.ts +17 -0
  5. package/Card/Operation/Cancel.ts +15 -0
  6. package/Card/Operation/Change.ts +18 -0
  7. package/Card/Operation/Create.ts +15 -0
  8. package/Card/Operation/index.ts +11 -0
  9. package/Card/Preset.ts +10 -0
  10. package/Card/index.ts +68 -0
  11. package/dist/Card/Changable.d.ts +11 -0
  12. package/dist/Card/Changable.js +12 -0
  13. package/dist/Card/Changable.js.map +1 -0
  14. package/dist/Card/Creatable.d.ts +22 -0
  15. package/dist/Card/Creatable.js +23 -0
  16. package/dist/Card/Creatable.js.map +1 -0
  17. package/dist/Card/Expiry.d.ts +11 -0
  18. package/dist/Card/Expiry.js +11 -0
  19. package/dist/Card/Expiry.js.map +1 -0
  20. package/dist/Card/Meta.d.ts +8 -0
  21. package/dist/Card/Meta.js +13 -0
  22. package/dist/Card/Meta.js.map +1 -0
  23. package/dist/Card/Operation/Cancel.d.ts +10 -0
  24. package/dist/Card/Operation/Cancel.js +11 -0
  25. package/dist/Card/Operation/Cancel.js.map +1 -0
  26. package/dist/Card/Operation/Change.d.ts +12 -0
  27. package/dist/Card/Operation/Change.js +13 -0
  28. package/dist/Card/Operation/Change.js.map +1 -0
  29. package/dist/Card/Operation/Create.d.ts +10 -0
  30. package/dist/Card/Operation/Create.js +11 -0
  31. package/dist/Card/Operation/Create.js.map +1 -0
  32. package/dist/Card/Operation/index.d.ts +9 -0
  33. package/dist/Card/Operation/index.js +10 -0
  34. package/dist/Card/Operation/index.js.map +1 -0
  35. package/dist/Card/Preset.d.ts +8 -0
  36. package/dist/Card/Preset.js +8 -0
  37. package/dist/Card/Preset.js.map +1 -0
  38. package/dist/Card/index.d.ts +45 -0
  39. package/dist/Card/index.js +41 -0
  40. package/dist/Card/index.js.map +1 -0
  41. package/dist/pax2pay.d.ts +1 -0
  42. package/dist/pax2pay.js +1 -0
  43. package/dist/pax2pay.js.map +1 -1
  44. package/package.json +3 -2
  45. package/pax2pay.ts +1 -0
@@ -0,0 +1,17 @@
1
+ import * as isoly from "isoly"
2
+ import { isly } from "isly"
3
+ import { Meta } from "./Meta"
4
+
5
+ export type Changable = {
6
+ limit?: [isoly.Currency, number]
7
+ rules?: string[]
8
+ meta?: Meta
9
+ }
10
+
11
+ export namespace Changable {
12
+ export const type = isly.object({
13
+ limit: isly.tuple(isly.fromIs("isoly.Currency", isoly.Currency.is), isly.number()).optional(),
14
+ rules: isly.string().array().optional(),
15
+ meta: isly.fromIs("Card.Meta", Meta.is).optional(),
16
+ })
17
+ }
@@ -0,0 +1,36 @@
1
+ import * as isoly from "isoly"
2
+ import { isly } from "isly"
3
+ import { Expiry } from "./Expiry"
4
+ import { Meta } from "./Meta"
5
+ import { Preset } from "./Preset"
6
+
7
+ export interface Creatable {
8
+ account: string
9
+ number?: string
10
+ preset: Preset
11
+ details: {
12
+ iin: string
13
+ expiry: Expiry
14
+ holder: string
15
+ }
16
+ limit: [isoly.Currency, number]
17
+ rules?: string[]
18
+ meta?: Meta
19
+ }
20
+
21
+ export namespace Creatable {
22
+ export const type = isly.object<Creatable>({
23
+ account: isly.string(),
24
+ number: isly.string().optional(),
25
+ preset: Preset.type,
26
+ details: isly.object({
27
+ iin: isly.string(),
28
+ expiry: Expiry.type,
29
+ holder: isly.string(),
30
+ }),
31
+ limit: isly.tuple(isly.fromIs("isoly.Currency", isoly.Currency.is), isly.number()),
32
+ rules: isly.string().array().optional(),
33
+ meta: isly.fromIs("Card.Meta", Meta.is).optional(),
34
+ })
35
+ export const is = type.is
36
+ }
package/Card/Expiry.ts ADDED
@@ -0,0 +1,15 @@
1
+ import { isly } from "isly"
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
6
+ type Year = typeof year[number]
7
+
8
+ const month = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12] as const
9
+ type Month = typeof month[number]
10
+
11
+ export type Expiry = [Year, Month]
12
+ export namespace Expiry {
13
+ export const type = isly.tuple<Expiry>(isly.number([...year]), isly.number([...month])) // Deconstructing to remove readonly.
14
+ export const is = type.is
15
+ }
package/Card/Meta.ts ADDED
@@ -0,0 +1,17 @@
1
+ type Value = Meta | Value[] | undefined | number | string | boolean
2
+ export interface Meta {
3
+ [key: string]: Value
4
+ }
5
+
6
+ export namespace Meta {
7
+ export function is(value: any | Meta): value is Meta {
8
+ return (
9
+ (typeof value == "object" && Object.values(value).every(Meta.is)) ||
10
+ (Array.isArray(value) && value.every(Meta.is)) ||
11
+ value == undefined ||
12
+ typeof value == "number" ||
13
+ typeof value == "string" ||
14
+ typeof value == "boolean"
15
+ )
16
+ }
17
+ }
@@ -0,0 +1,15 @@
1
+ import * as 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
+ }
@@ -0,0 +1,18 @@
1
+ import * as isoly from "isoly"
2
+ import { isly } from "isly"
3
+ import { Changable } from "../Changable"
4
+
5
+ export interface Change {
6
+ type: "change"
7
+ from: Changable
8
+ created: isoly.DateTime
9
+ }
10
+
11
+ export namespace Change {
12
+ export const type = isly.object<Change>({
13
+ type: isly.string("change"),
14
+ from: Changable.type,
15
+ created: isly.fromIs("isoly.DateTime", isoly.DateTime.is),
16
+ })
17
+ export const is = type.is
18
+ }
@@ -0,0 +1,15 @@
1
+ import * as 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
+ }
@@ -0,0 +1,11 @@
1
+ import { isly } from "isly"
2
+ import { Cancel } from "./Cancel"
3
+ import { Change } from "./Change"
4
+ import { Create } from "./Create"
5
+
6
+ export type Operation = Cancel | Change | Create
7
+
8
+ export namespace Operation {
9
+ export const type = isly.union(Cancel.type, Change.type, Create.type)
10
+ export const is = type.is
11
+ }
package/Card/Preset.ts ADDED
@@ -0,0 +1,10 @@
1
+ import { isly } from "isly"
2
+
3
+ const preset = ["example1"] as const
4
+
5
+ export type Preset = typeof preset[number]
6
+
7
+ export namespace Preset {
8
+ export const type = isly.string(preset)
9
+ export const is = type.is
10
+ }
package/Card/index.ts ADDED
@@ -0,0 +1,68 @@
1
+ import * as isoly from "isoly"
2
+ import { isly } from "isly"
3
+ import { Operation as BankingOperation } from "../Operation"
4
+ import { Changable as CardChangable } from "./Changable"
5
+ import { Creatable as CardCreatable } from "./Creatable"
6
+ import { Expiry as CardExpiry } from "./Expiry"
7
+ import { Meta as CardMeta } from "./Meta"
8
+ import { Operation as CardOperation } from "./Operation"
9
+ import { Preset as CardPreset } from "./Preset"
10
+
11
+ export interface Card {
12
+ id: string
13
+ number?: string
14
+ token: string
15
+ created: isoly.DateTime
16
+ organization: string
17
+ account: string
18
+ preset: CardPreset
19
+ reference?: string
20
+ details: {
21
+ iin: string
22
+ last4: string
23
+ expiry: CardExpiry
24
+ holder: string
25
+ }
26
+ limit: [isoly.Currency, number]
27
+ spent: [isoly.Currency, number]
28
+ status: "active" | "cancelled"
29
+ history: (BankingOperation | CardOperation)[]
30
+ rules: string[]
31
+ meta?: CardMeta
32
+ }
33
+
34
+ export namespace Card {
35
+ export const type = isly.object<Card>({
36
+ id: isly.string(),
37
+ number: isly.string().optional(),
38
+ token: isly.string(),
39
+ created: isly.string(),
40
+ organization: isly.string(),
41
+ account: isly.string(),
42
+ preset: CardPreset.type,
43
+ reference: isly.string().optional(),
44
+ details: isly.object({
45
+ iin: isly.string(),
46
+ last4: isly.string(),
47
+ expiry: CardExpiry.type,
48
+ holder: isly.string(),
49
+ }),
50
+ limit: isly.tuple(isly.fromIs("isoly.Currency", isoly.Currency.is), isly.number()),
51
+ spent: isly.tuple(isly.fromIs("isoly.Currency", isoly.Currency.is), isly.number()),
52
+ status: isly.union(isly.string("active"), isly.string("cancelled")),
53
+ history: isly.union(CardOperation.type, isly.fromIs("Banking.Operation", BankingOperation.is)).array(),
54
+ rules: isly.string().array(),
55
+ meta: isly.fromIs("Card.Meta", CardMeta.is).optional(),
56
+ })
57
+ export const is = type.is
58
+ export type Creatable = CardCreatable
59
+ export const Creatable = CardCreatable
60
+ export type Preset = CardPreset
61
+ export const Preset = CardPreset
62
+ export type Meta = CardMeta
63
+ export const Meta = CardMeta
64
+ export type Expiry = CardExpiry
65
+ export const Expiry = CardExpiry
66
+ export type Changable = CardChangable
67
+ export const Changable = CardChangable
68
+ }
@@ -0,0 +1,11 @@
1
+ import * as isoly from "isoly";
2
+ import { isly } from "isly";
3
+ import { Meta } from "./Meta";
4
+ export type Changable = {
5
+ limit?: [isoly.Currency, number];
6
+ rules?: string[];
7
+ meta?: Meta;
8
+ };
9
+ export declare namespace Changable {
10
+ const type: isly.object.ExtendableType<object>;
11
+ }
@@ -0,0 +1,12 @@
1
+ import * as isoly from "isoly";
2
+ import { isly } from "isly";
3
+ import { Meta } from "./Meta";
4
+ export var Changable;
5
+ (function (Changable) {
6
+ Changable.type = isly.object({
7
+ limit: isly.tuple(isly.fromIs("isoly.Currency", isoly.Currency.is), isly.number()).optional(),
8
+ rules: isly.string().array().optional(),
9
+ meta: isly.fromIs("Card.Meta", Meta.is).optional(),
10
+ });
11
+ })(Changable || (Changable = {}));
12
+ //# sourceMappingURL=Changable.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Changable.js","sourceRoot":"../","sources":["Card/Changable.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAA;AAC3B,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAA;AAQ7B,MAAM,KAAW,SAAS,CAMzB;AAND,WAAiB,SAAS;IACZ,cAAI,GAAG,IAAI,CAAC,MAAM,CAAC;QAC/B,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,gBAAgB,EAAE,KAAK,CAAC,QAAQ,CAAC,EAAE,CAAC,EAAE,IAAI,CAAC,MAAM,EAAE,CAAC,CAAC,QAAQ,EAAE;QAC7F,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;AACH,CAAC,EANgB,SAAS,KAAT,SAAS,QAMzB"}
@@ -0,0 +1,22 @@
1
+ import * as isoly from "isoly";
2
+ import { isly } from "isly";
3
+ import { Expiry } from "./Expiry";
4
+ import { Meta } from "./Meta";
5
+ import { Preset } from "./Preset";
6
+ export interface Creatable {
7
+ account: string;
8
+ number?: string;
9
+ preset: Preset;
10
+ details: {
11
+ iin: string;
12
+ expiry: Expiry;
13
+ holder: string;
14
+ };
15
+ limit: [isoly.Currency, number];
16
+ rules?: string[];
17
+ meta?: Meta;
18
+ }
19
+ export declare namespace Creatable {
20
+ const type: isly.object.ExtendableType<Creatable>;
21
+ const is: isly.Type.IsFunction<Creatable>;
22
+ }
@@ -0,0 +1,23 @@
1
+ import * as isoly from "isoly";
2
+ import { isly } from "isly";
3
+ import { Expiry } from "./Expiry";
4
+ import { Meta } from "./Meta";
5
+ import { Preset } from "./Preset";
6
+ export var Creatable;
7
+ (function (Creatable) {
8
+ Creatable.type = isly.object({
9
+ account: isly.string(),
10
+ number: isly.string().optional(),
11
+ preset: Preset.type,
12
+ details: isly.object({
13
+ iin: isly.string(),
14
+ expiry: Expiry.type,
15
+ holder: isly.string(),
16
+ }),
17
+ limit: isly.tuple(isly.fromIs("isoly.Currency", isoly.Currency.is), isly.number()),
18
+ rules: isly.string().array().optional(),
19
+ meta: isly.fromIs("Card.Meta", Meta.is).optional(),
20
+ });
21
+ Creatable.is = Creatable.type.is;
22
+ })(Creatable || (Creatable = {}));
23
+ //# sourceMappingURL=Creatable.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Creatable.js","sourceRoot":"../","sources":["Card/Creatable.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,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"}
@@ -0,0 +1,11 @@
1
+ import { isly } from "isly";
2
+ declare const year: readonly [2023, 2024, 2025, 2026, 2027, 2028, 2029, 2030, 2031, 2032, 2033, 2034, 2035, 2036, 2037, 2038, 2039, 2040];
3
+ type Year = typeof year[number];
4
+ declare const month: readonly [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12];
5
+ type Month = typeof month[number];
6
+ export type Expiry = [Year, Month];
7
+ export declare namespace Expiry {
8
+ const type: isly.Type<Expiry>;
9
+ const is: isly.Type.IsFunction<Expiry>;
10
+ }
11
+ export {};
@@ -0,0 +1,11 @@
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
+ ];
5
+ const month = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12];
6
+ export var Expiry;
7
+ (function (Expiry) {
8
+ Expiry.type = isly.tuple(isly.number([...year]), isly.number([...month]));
9
+ Expiry.is = Expiry.type.is;
10
+ })(Expiry || (Expiry = {}));
11
+ //# sourceMappingURL=Expiry.js.map
@@ -0,0 +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;IACZ,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI;CACjG,CAAA;AAGV,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"}
@@ -0,0 +1,8 @@
1
+ type Value = Meta | Value[] | undefined | number | string | boolean;
2
+ export interface Meta {
3
+ [key: string]: Value;
4
+ }
5
+ export declare namespace Meta {
6
+ function is(value: any | Meta): value is Meta;
7
+ }
8
+ export {};
@@ -0,0 +1,13 @@
1
+ export var Meta;
2
+ (function (Meta) {
3
+ function is(value) {
4
+ return ((typeof value == "object" && Object.values(value).every(Meta.is)) ||
5
+ (Array.isArray(value) && value.every(Meta.is)) ||
6
+ value == undefined ||
7
+ typeof value == "number" ||
8
+ typeof value == "string" ||
9
+ typeof value == "boolean");
10
+ }
11
+ Meta.is = is;
12
+ })(Meta || (Meta = {}));
13
+ //# sourceMappingURL=Meta.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Meta.js","sourceRoot":"../","sources":["Card/Meta.ts"],"names":[],"mappings":"AAKA,MAAM,KAAW,IAAI,CAWpB;AAXD,WAAiB,IAAI;IACpB,SAAgB,EAAE,CAAC,KAAiB;QACnC,OAAO,CACN,CAAC,OAAO,KAAK,IAAI,QAAQ,IAAI,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;YACjE,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;YAC9C,KAAK,IAAI,SAAS;YAClB,OAAO,KAAK,IAAI,QAAQ;YACxB,OAAO,KAAK,IAAI,QAAQ;YACxB,OAAO,KAAK,IAAI,SAAS,CACzB,CAAA;IACF,CAAC;IATe,OAAE,KASjB,CAAA;AACF,CAAC,EAXgB,IAAI,KAAJ,IAAI,QAWpB"}
@@ -0,0 +1,10 @@
1
+ import * as 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
+ }
@@ -0,0 +1,11 @@
1
+ import * as 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
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Cancel.js","sourceRoot":"../","sources":["Card/Operation/Cancel.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,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"}
@@ -0,0 +1,12 @@
1
+ import * as isoly from "isoly";
2
+ import { isly } from "isly";
3
+ import { Changable } from "../Changable";
4
+ export interface Change {
5
+ type: "change";
6
+ from: Changable;
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
+ }
@@ -0,0 +1,13 @@
1
+ import * as isoly from "isoly";
2
+ import { isly } from "isly";
3
+ import { Changable } from "../Changable";
4
+ export var Change;
5
+ (function (Change) {
6
+ Change.type = isly.object({
7
+ type: isly.string("change"),
8
+ from: Changable.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
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Change.js","sourceRoot":"../","sources":["Card/Operation/Change.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAA;AAC3B,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAA;AAQxC,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,SAAS,CAAC,IAAI;QACpB,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"}
@@ -0,0 +1,10 @@
1
+ import * as 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
+ }
@@ -0,0 +1,11 @@
1
+ import * as 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
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Create.js","sourceRoot":"../","sources":["Card/Operation/Create.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,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"}
@@ -0,0 +1,9 @@
1
+ import { isly } from "isly";
2
+ import { Cancel } from "./Cancel";
3
+ import { Change } from "./Change";
4
+ import { Create } from "./Create";
5
+ export type Operation = Cancel | Change | Create;
6
+ export declare namespace Operation {
7
+ const type: isly.Type<Cancel | Change | Create>;
8
+ const is: isly.Type.IsFunction<Cancel | Change | Create>;
9
+ }
@@ -0,0 +1,10 @@
1
+ import { isly } from "isly";
2
+ import { Cancel } from "./Cancel";
3
+ import { Change } from "./Change";
4
+ import { Create } from "./Create";
5
+ export var Operation;
6
+ (function (Operation) {
7
+ Operation.type = isly.union(Cancel.type, Change.type, Create.type);
8
+ Operation.is = Operation.type.is;
9
+ })(Operation || (Operation = {}));
10
+ //# sourceMappingURL=index.js.map
@@ -0,0 +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,MAAM,EAAE,MAAM,UAAU,CAAA;AACjC,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAA;AACjC,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAA;AAIjC,MAAM,KAAW,SAAS,CAGzB;AAHD,WAAiB,SAAS;IACZ,cAAI,GAAG,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,IAAI,EAAE,MAAM,CAAC,IAAI,EAAE,MAAM,CAAC,IAAI,CAAC,CAAA;IACxD,YAAE,GAAG,UAAA,IAAI,CAAC,EAAE,CAAA;AAC1B,CAAC,EAHgB,SAAS,KAAT,SAAS,QAGzB"}
@@ -0,0 +1,8 @@
1
+ import { isly } from "isly";
2
+ declare const preset: readonly ["example1"];
3
+ export type Preset = typeof preset[number];
4
+ export declare namespace Preset {
5
+ const type: isly.Type<"example1">;
6
+ const is: isly.Type.IsFunction<"example1">;
7
+ }
8
+ export {};
@@ -0,0 +1,8 @@
1
+ import { isly } from "isly";
2
+ const preset = ["example1"];
3
+ export var Preset;
4
+ (function (Preset) {
5
+ Preset.type = isly.string(preset);
6
+ Preset.is = Preset.type.is;
7
+ })(Preset || (Preset = {}));
8
+ //# sourceMappingURL=Preset.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Preset.js","sourceRoot":"../","sources":["Card/Preset.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAA;AAE3B,MAAM,MAAM,GAAG,CAAC,UAAU,CAAU,CAAA;AAIpC,MAAM,KAAW,MAAM,CAGtB;AAHD,WAAiB,MAAM;IACT,WAAI,GAAG,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,CAAA;IAC1B,SAAE,GAAG,OAAA,IAAI,CAAC,EAAE,CAAA;AAC1B,CAAC,EAHgB,MAAM,KAAN,MAAM,QAGtB"}
@@ -0,0 +1,45 @@
1
+ import * as isoly from "isoly";
2
+ import { isly } from "isly";
3
+ import { Operation as BankingOperation } from "../Operation";
4
+ import { Changable as CardChangable } from "./Changable";
5
+ import { Creatable as CardCreatable } from "./Creatable";
6
+ import { Expiry as CardExpiry } from "./Expiry";
7
+ import { Meta as CardMeta } from "./Meta";
8
+ import { Operation as CardOperation } from "./Operation";
9
+ import { Preset as CardPreset } from "./Preset";
10
+ export interface Card {
11
+ id: string;
12
+ number?: string;
13
+ token: string;
14
+ created: isoly.DateTime;
15
+ organization: string;
16
+ account: string;
17
+ preset: CardPreset;
18
+ reference?: string;
19
+ details: {
20
+ iin: string;
21
+ last4: string;
22
+ expiry: CardExpiry;
23
+ holder: string;
24
+ };
25
+ limit: [isoly.Currency, number];
26
+ spent: [isoly.Currency, number];
27
+ status: "active" | "cancelled";
28
+ history: (BankingOperation | CardOperation)[];
29
+ rules: string[];
30
+ meta?: CardMeta;
31
+ }
32
+ export declare namespace Card {
33
+ const type: isly.object.ExtendableType<Card>;
34
+ const is: isly.Type.IsFunction<Card>;
35
+ type Creatable = CardCreatable;
36
+ const Creatable: typeof CardCreatable;
37
+ type Preset = CardPreset;
38
+ const Preset: typeof CardPreset;
39
+ type Meta = CardMeta;
40
+ const Meta: typeof CardMeta;
41
+ type Expiry = CardExpiry;
42
+ const Expiry: typeof CardExpiry;
43
+ type Changable = CardChangable;
44
+ const Changable: typeof CardChangable;
45
+ }
@@ -0,0 +1,41 @@
1
+ import * as isoly from "isoly";
2
+ import { isly } from "isly";
3
+ import { Operation as BankingOperation } from "../Operation";
4
+ import { Changable as CardChangable } from "./Changable";
5
+ import { Creatable as CardCreatable } from "./Creatable";
6
+ import { Expiry as CardExpiry } from "./Expiry";
7
+ import { Meta as CardMeta } from "./Meta";
8
+ import { Operation as CardOperation } from "./Operation";
9
+ import { Preset as CardPreset } from "./Preset";
10
+ export var Card;
11
+ (function (Card) {
12
+ Card.type = isly.object({
13
+ id: isly.string(),
14
+ number: isly.string().optional(),
15
+ token: isly.string(),
16
+ created: isly.string(),
17
+ organization: isly.string(),
18
+ account: isly.string(),
19
+ preset: CardPreset.type,
20
+ reference: isly.string().optional(),
21
+ details: isly.object({
22
+ iin: isly.string(),
23
+ last4: isly.string(),
24
+ expiry: CardExpiry.type,
25
+ holder: isly.string(),
26
+ }),
27
+ limit: isly.tuple(isly.fromIs("isoly.Currency", isoly.Currency.is), isly.number()),
28
+ spent: isly.tuple(isly.fromIs("isoly.Currency", isoly.Currency.is), isly.number()),
29
+ status: isly.union(isly.string("active"), isly.string("cancelled")),
30
+ history: isly.union(CardOperation.type, isly.fromIs("Banking.Operation", BankingOperation.is)).array(),
31
+ rules: isly.string().array(),
32
+ meta: isly.fromIs("Card.Meta", CardMeta.is).optional(),
33
+ });
34
+ Card.is = Card.type.is;
35
+ Card.Creatable = CardCreatable;
36
+ Card.Preset = CardPreset;
37
+ Card.Meta = CardMeta;
38
+ Card.Expiry = CardExpiry;
39
+ Card.Changable = CardChangable;
40
+ })(Card || (Card = {}));
41
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"../","sources":["Card/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAA;AAC3B,OAAO,EAAE,SAAS,IAAI,gBAAgB,EAAE,MAAM,cAAc,CAAA;AAC5D,OAAO,EAAE,SAAS,IAAI,aAAa,EAAE,MAAM,aAAa,CAAA;AACxD,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,CAkCpB;AAlCD,WAAiB,IAAI;IACP,SAAI,GAAG,IAAI,CAAC,MAAM,CAAO;QACrC,EAAE,EAAE,IAAI,CAAC,MAAM,EAAE;QACjB,MAAM,EAAE,IAAI,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;QAChC,KAAK,EAAE,IAAI,CAAC,MAAM,EAAE;QACpB,OAAO,EAAE,IAAI,CAAC,MAAM,EAAE;QACtB,YAAY,EAAE,IAAI,CAAC,MAAM,EAAE;QAC3B,OAAO,EAAE,IAAI,CAAC,MAAM,EAAE;QACtB,MAAM,EAAE,UAAU,CAAC,IAAI;QACvB,SAAS,EAAE,IAAI,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;QACnC,OAAO,EAAE,IAAI,CAAC,MAAM,CAAC;YACpB,GAAG,EAAE,IAAI,CAAC,MAAM,EAAE;YAClB,KAAK,EAAE,IAAI,CAAC,MAAM,EAAE;YACpB,MAAM,EAAE,UAAU,CAAC,IAAI;YACvB,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,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,EAAE,IAAI,CAAC,MAAM,CAAC,mBAAmB,EAAE,gBAAgB,CAAC,EAAE,CAAC,CAAC,CAAC,KAAK,EAAE;QACtG,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,cAAS,GAAG,aAAa,CAAA;AACvC,CAAC,EAlCgB,IAAI,KAAJ,IAAI,QAkCpB"}
package/dist/pax2pay.d.ts CHANGED
@@ -1,5 +1,6 @@
1
1
  export { Account } from "./Account";
2
2
  export { Balances } from "./Balances";
3
+ export { Card } from "./Card";
3
4
  export { Event } from "./Event";
4
5
  export { Operation } from "./Operation";
5
6
  export { Organization } from "./Organization";
package/dist/pax2pay.js CHANGED
@@ -1,5 +1,6 @@
1
1
  export { Account } from "./Account";
2
2
  export { Balances } from "./Balances";
3
+ export { Card } from "./Card";
3
4
  export { Event } from "./Event";
4
5
  export { Operation } from "./Operation";
5
6
  export { Organization } from "./Organization";
@@ -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,KAAK,EAAE,MAAM,SAAS,CAAA;AAC/B,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AACvC,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAC7C,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAA;AAC7B,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAA;AAC3C,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAA;AACjC,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA;AACrC,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAA;AAC/B,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA"}
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,IAAI,EAAE,MAAM,QAAQ,CAAA;AAC7B,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAA;AAC/B,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AACvC,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAC7C,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAA;AAC7B,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAA;AAC3C,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAA;AACjC,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA;AACrC,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAA;AAC/B,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pax2pay/model-banking",
3
- "version": "0.1.43",
3
+ "version": "0.1.44",
4
4
  "description": "Library containing data model types and functions for the Pax2Pay Banking API.",
5
5
  "author": "Pax2Pay Ltd",
6
6
  "license": "MIT",
@@ -29,7 +29,7 @@
29
29
  "^.+\\.(j|t)sx?$": "ts-jest"
30
30
  },
31
31
  "transformIgnorePatterns": [
32
- "<rootDir>/node_modules/(?!(cryptly|authly|isoly|gracely|cloudly-http|cloudly-rest|cloudly-router|cloudly-formdata|@userwidgets)/.*)"
32
+ "<rootDir>/node_modules/(?!(cryptly|authly|isly|isoly|gracely|cloudly-http|cloudly-rest|cloudly-router|cloudly-formdata|@userwidgets)/.*)"
33
33
  ],
34
34
  "testEnvironment": "node",
35
35
  "testRegex": "((\\.|/)(test|spec))(\\.|\\/.+)(jsx?|tsx?)$",
@@ -73,6 +73,7 @@
73
73
  "cryptly": "^3.0.4",
74
74
  "gracely": "^2.0.4",
75
75
  "isoly": "^2.0.20",
76
+ "isly": "0.1.7",
76
77
  "selectively": "^2.0.4"
77
78
  }
78
79
  }
package/pax2pay.ts CHANGED
@@ -1,5 +1,6 @@
1
1
  export { Account } from "./Account"
2
2
  export { Balances } from "./Balances"
3
+ export { Card } from "./Card"
3
4
  export { Event } from "./Event"
4
5
  export { Operation } from "./Operation"
5
6
  export { Organization } from "./Organization"