@pax2pay/model-banking 0.1.43 → 0.1.45

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 (53) hide show
  1. package/Card/Changeable.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 +88 -0
  11. package/Client/Cards.ts +36 -0
  12. package/Client/index.ts +2 -0
  13. package/dist/Card/Changeable.d.ts +11 -0
  14. package/dist/Card/Changeable.js +12 -0
  15. package/dist/Card/Changeable.js.map +1 -0
  16. package/dist/Card/Creatable.d.ts +22 -0
  17. package/dist/Card/Creatable.js +23 -0
  18. package/dist/Card/Creatable.js.map +1 -0
  19. package/dist/Card/Expiry.d.ts +11 -0
  20. package/dist/Card/Expiry.js +11 -0
  21. package/dist/Card/Expiry.js.map +1 -0
  22. package/dist/Card/Meta.d.ts +8 -0
  23. package/dist/Card/Meta.js +13 -0
  24. package/dist/Card/Meta.js.map +1 -0
  25. package/dist/Card/Operation/Cancel.d.ts +10 -0
  26. package/dist/Card/Operation/Cancel.js +11 -0
  27. package/dist/Card/Operation/Cancel.js.map +1 -0
  28. package/dist/Card/Operation/Change.d.ts +12 -0
  29. package/dist/Card/Operation/Change.js +13 -0
  30. package/dist/Card/Operation/Change.js.map +1 -0
  31. package/dist/Card/Operation/Create.d.ts +10 -0
  32. package/dist/Card/Operation/Create.js +11 -0
  33. package/dist/Card/Operation/Create.js.map +1 -0
  34. package/dist/Card/Operation/index.d.ts +9 -0
  35. package/dist/Card/Operation/index.js +10 -0
  36. package/dist/Card/Operation/index.js.map +1 -0
  37. package/dist/Card/Preset.d.ts +8 -0
  38. package/dist/Card/Preset.js +8 -0
  39. package/dist/Card/Preset.js.map +1 -0
  40. package/dist/Card/index.d.ts +46 -0
  41. package/dist/Card/index.js +62 -0
  42. package/dist/Card/index.js.map +1 -0
  43. package/dist/Client/Cards.d.ts +17 -0
  44. package/dist/Client/Cards.js +20 -0
  45. package/dist/Client/Cards.js.map +1 -0
  46. package/dist/Client/index.d.ts +2 -0
  47. package/dist/Client/index.js +2 -0
  48. package/dist/Client/index.js.map +1 -1
  49. package/dist/pax2pay.d.ts +1 -0
  50. package/dist/pax2pay.js +1 -0
  51. package/dist/pax2pay.js.map +1 -1
  52. package/package.json +3 -2
  53. package/pax2pay.ts +1 -0
@@ -0,0 +1,17 @@
1
+ import { isoly } from "isoly"
2
+ import { isly } from "isly"
3
+ import { Meta } from "./Meta"
4
+
5
+ export type Changeable = {
6
+ limit?: [isoly.Currency, number]
7
+ rules?: string[]
8
+ meta?: Meta
9
+ }
10
+
11
+ export namespace Changeable {
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 { 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 { 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 { 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
+ }
@@ -0,0 +1,15 @@
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
+ }
@@ -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,88 @@
1
+ import { cryptly } from "cryptly"
2
+ import { isoly } from "isoly"
3
+ import { isly } from "isly"
4
+ import { Operation as BankingOperation } from "../Operation"
5
+ import { Changeable as CardChangeable } from "./Changeable"
6
+ import { Creatable as CardCreatable } from "./Creatable"
7
+ import { Expiry as CardExpiry } from "./Expiry"
8
+ import { Meta as CardMeta } from "./Meta"
9
+ import { Operation as CardOperation } from "./Operation"
10
+ import { Preset as CardPreset } from "./Preset"
11
+
12
+ export interface Card {
13
+ id: string
14
+ number?: string
15
+ token: string
16
+ created: isoly.DateTime
17
+ organization: string
18
+ account: string
19
+ preset: CardPreset
20
+ reference?: string
21
+ details: {
22
+ iin: string
23
+ last4: string
24
+ expiry: CardExpiry
25
+ holder: string
26
+ }
27
+ limit: [isoly.Currency, number]
28
+ spent: [isoly.Currency, number]
29
+ status: "active" | "cancelled"
30
+ history: (BankingOperation | CardOperation)[]
31
+ rules: string[]
32
+ meta?: CardMeta
33
+ }
34
+
35
+ export namespace Card {
36
+ export function fromCreatable(card: Creatable, organization: string, last4: string, token: string): Card {
37
+ const created = isoly.DateTime.now()
38
+ return {
39
+ id: cryptly.Identifier.generate(8),
40
+ number: card.number,
41
+ token: token,
42
+ created: created,
43
+ organization: organization,
44
+ account: card.account,
45
+ preset: card.preset,
46
+ details: { iin: card.details.iin, last4: last4, expiry: card.details.expiry, holder: card.details.holder },
47
+ limit: card.limit,
48
+ spent: [card.limit[0], 0],
49
+ status: "active",
50
+ history: [{ type: "create", created: created }],
51
+ rules: card.rules ?? [],
52
+ meta: card.meta,
53
+ }
54
+ }
55
+ export const type = isly.object<Card>({
56
+ id: isly.string(),
57
+ number: isly.string().optional(),
58
+ token: isly.string(),
59
+ created: isly.string(),
60
+ organization: isly.string(),
61
+ account: isly.string(),
62
+ preset: CardPreset.type,
63
+ reference: isly.string().optional(),
64
+ details: isly.object({
65
+ iin: isly.string(),
66
+ last4: isly.string(),
67
+ expiry: CardExpiry.type,
68
+ holder: isly.string(),
69
+ }),
70
+ limit: isly.tuple(isly.fromIs("isoly.Currency", isoly.Currency.is), isly.number()),
71
+ spent: isly.tuple(isly.fromIs("isoly.Currency", isoly.Currency.is), isly.number()),
72
+ status: isly.union(isly.string("active"), isly.string("cancelled")),
73
+ history: isly.union(CardOperation.type, isly.fromIs("Banking.Operation", BankingOperation.is)).array(),
74
+ rules: isly.string().array(),
75
+ meta: isly.fromIs("Card.Meta", CardMeta.is).optional(),
76
+ })
77
+ export const is = type.is
78
+ export type Creatable = CardCreatable
79
+ export const Creatable = CardCreatable
80
+ export type Preset = CardPreset
81
+ export const Preset = CardPreset
82
+ export type Meta = CardMeta
83
+ export const Meta = CardMeta
84
+ export type Expiry = CardExpiry
85
+ export const Expiry = CardExpiry
86
+ export type Changeable = CardChangeable
87
+ export const Changeable = CardChangeable
88
+ }
@@ -0,0 +1,36 @@
1
+ import { gracely } from "gracely"
2
+ import { http } from "cloudly-http"
3
+ import * as rest from "cloudly-rest"
4
+ import { Card } from "../Card"
5
+
6
+ export class Cards extends rest.Collection<gracely.Error> {
7
+ constructor(client: http.Client) {
8
+ super(client)
9
+ }
10
+
11
+ async fetch(card: string): Promise<Card | gracely.Error> {
12
+ // I mean it's supposed to return Card.Storable
13
+ return this.client.get<Card>(`/card/card/${card}`)
14
+ }
15
+ async list(options?: {
16
+ start?: string
17
+ end?: string
18
+ limit?: string
19
+ cursor?: string
20
+ prefix?: string
21
+ }): Promise<(Card[] & { cursor?: string | undefined }) | gracely.Error> {
22
+ // I mean it's supposed to return Card.Static
23
+ const search =
24
+ options?.start && options?.end
25
+ ? `?start=${options?.start}&end=${options?.end}`
26
+ : options?.start
27
+ ? `?start=${options?.start}`
28
+ : options?.end
29
+ ? `?end=${options?.end}`
30
+ : ""
31
+ return this.client.get<Card[] & { cursor?: string | undefined }>(
32
+ `/card/card${search}`,
33
+ options && (({ start, end, ...headers }) => headers)(options)
34
+ )
35
+ }
36
+ }
package/Client/index.ts CHANGED
@@ -4,6 +4,7 @@ import { http } from "cloudly-http"
4
4
  import * as rest from "cloudly-rest"
5
5
  import { Accounts } from "./Accounts"
6
6
  import { Application as ClientApplication } from "./Application"
7
+ import { Cards } from "./Cards"
7
8
  import { Me as ClientMe } from "./Me"
8
9
  import { Operations } from "./Operations"
9
10
  import { Organization as ClientOrganization } from "./Organization"
@@ -23,6 +24,7 @@ export class Client extends rest.Client<gracely.Error> {
23
24
  readonly transactions = new Transactions(this.client)
24
25
  readonly treasury = new Treasury(this.client)
25
26
  readonly version = new Version(this.client)
27
+ readonly cards = new Cards(this.client)
26
28
 
27
29
  static create<T = Record<string, any>>(server: string, key: string, load?: (client: http.Client) => T): Client & T {
28
30
  let httpClient: http.Client<gracely.Error>
@@ -0,0 +1,11 @@
1
+ import { isoly } from "isoly";
2
+ import { isly } from "isly";
3
+ import { Meta } from "./Meta";
4
+ export type Changeable = {
5
+ limit?: [isoly.Currency, number];
6
+ rules?: string[];
7
+ meta?: Meta;
8
+ };
9
+ export declare namespace Changeable {
10
+ const type: isly.object.ExtendableType<object>;
11
+ }
@@ -0,0 +1,12 @@
1
+ import { isoly } from "isoly";
2
+ import { isly } from "isly";
3
+ import { Meta } from "./Meta";
4
+ export var Changeable;
5
+ (function (Changeable) {
6
+ Changeable.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
+ })(Changeable || (Changeable = {}));
12
+ //# sourceMappingURL=Changeable.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Changeable.js","sourceRoot":"../","sources":["Card/Changeable.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,OAAO,CAAA;AAC7B,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAA;AAC3B,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAA;AAQ7B,MAAM,KAAW,UAAU,CAM1B;AAND,WAAiB,UAAU;IACb,eAAI,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,UAAU,KAAV,UAAU,QAM1B"}
@@ -0,0 +1,22 @@
1
+ import { 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 { 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,EAAE,KAAK,EAAE,MAAM,OAAO,CAAA;AAC7B,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 { 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 { 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,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"}
@@ -0,0 +1,12 @@
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
+ }
@@ -0,0 +1,13 @@
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
@@ -0,0 +1 @@
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"}
@@ -0,0 +1,10 @@
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
+ }
@@ -0,0 +1,11 @@
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
@@ -0,0 +1 @@
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"}
@@ -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,46 @@
1
+ import { isoly } from "isoly";
2
+ import { isly } from "isly";
3
+ import { Operation as BankingOperation } from "../Operation";
4
+ import { Changeable as CardChangeable } from "./Changeable";
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
+ function fromCreatable(card: Creatable, organization: string, last4: string, token: string): Card;
34
+ const type: isly.object.ExtendableType<Card>;
35
+ const is: isly.Type.IsFunction<Card>;
36
+ type Creatable = CardCreatable;
37
+ const Creatable: typeof CardCreatable;
38
+ type Preset = CardPreset;
39
+ const Preset: typeof CardPreset;
40
+ type Meta = CardMeta;
41
+ const Meta: typeof CardMeta;
42
+ type Expiry = CardExpiry;
43
+ const Expiry: typeof CardExpiry;
44
+ type Changeable = CardChangeable;
45
+ const Changeable: typeof CardChangeable;
46
+ }
@@ -0,0 +1,62 @@
1
+ import { cryptly } from "cryptly";
2
+ import { isoly } from "isoly";
3
+ import { isly } from "isly";
4
+ import { Operation as BankingOperation } from "../Operation";
5
+ import { Changeable as CardChangeable } from "./Changeable";
6
+ import { Creatable as CardCreatable } from "./Creatable";
7
+ import { Expiry as CardExpiry } from "./Expiry";
8
+ import { Meta as CardMeta } from "./Meta";
9
+ import { Operation as CardOperation } from "./Operation";
10
+ import { Preset as CardPreset } from "./Preset";
11
+ export var Card;
12
+ (function (Card) {
13
+ function fromCreatable(card, organization, last4, token) {
14
+ const created = isoly.DateTime.now();
15
+ return {
16
+ id: cryptly.Identifier.generate(8),
17
+ number: card.number,
18
+ token: token,
19
+ created: created,
20
+ organization: organization,
21
+ account: card.account,
22
+ preset: card.preset,
23
+ details: { iin: card.details.iin, last4: last4, expiry: card.details.expiry, holder: card.details.holder },
24
+ limit: card.limit,
25
+ spent: [card.limit[0], 0],
26
+ status: "active",
27
+ history: [{ type: "create", created: created }],
28
+ rules: card.rules ?? [],
29
+ meta: card.meta,
30
+ };
31
+ }
32
+ Card.fromCreatable = fromCreatable;
33
+ Card.type = isly.object({
34
+ id: isly.string(),
35
+ number: isly.string().optional(),
36
+ token: isly.string(),
37
+ created: isly.string(),
38
+ organization: isly.string(),
39
+ account: isly.string(),
40
+ preset: CardPreset.type,
41
+ reference: isly.string().optional(),
42
+ details: isly.object({
43
+ iin: isly.string(),
44
+ last4: isly.string(),
45
+ expiry: CardExpiry.type,
46
+ holder: isly.string(),
47
+ }),
48
+ limit: isly.tuple(isly.fromIs("isoly.Currency", isoly.Currency.is), isly.number()),
49
+ spent: isly.tuple(isly.fromIs("isoly.Currency", isoly.Currency.is), isly.number()),
50
+ status: isly.union(isly.string("active"), isly.string("cancelled")),
51
+ history: isly.union(CardOperation.type, isly.fromIs("Banking.Operation", BankingOperation.is)).array(),
52
+ rules: isly.string().array(),
53
+ meta: isly.fromIs("Card.Meta", CardMeta.is).optional(),
54
+ });
55
+ Card.is = Card.type.is;
56
+ Card.Creatable = CardCreatable;
57
+ Card.Preset = CardPreset;
58
+ Card.Meta = CardMeta;
59
+ Card.Expiry = CardExpiry;
60
+ Card.Changeable = CardChangeable;
61
+ })(Card || (Card = {}));
62
+ //# sourceMappingURL=index.js.map
@@ -0,0 +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,SAAS,IAAI,gBAAgB,EAAE,MAAM,cAAc,CAAA;AAC5D,OAAO,EAAE,UAAU,IAAI,cAAc,EAA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I,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,eAAU,GAAG,cAAc,CAAA;AACzC,CAAC,EArDgB,IAAI,KAAJ,IAAI,QAqDpB"}
@@ -0,0 +1,17 @@
1
+ import { gracely } from "gracely";
2
+ import { http } from "cloudly-http";
3
+ import * as rest from "cloudly-rest";
4
+ import { Card } from "../Card";
5
+ export declare class Cards extends rest.Collection<gracely.Error> {
6
+ constructor(client: http.Client);
7
+ fetch(card: string): Promise<Card | gracely.Error>;
8
+ list(options?: {
9
+ start?: string;
10
+ end?: string;
11
+ limit?: string;
12
+ cursor?: string;
13
+ prefix?: string;
14
+ }): Promise<(Card[] & {
15
+ cursor?: string | undefined;
16
+ }) | gracely.Error>;
17
+ }
@@ -0,0 +1,20 @@
1
+ import * as rest from "cloudly-rest";
2
+ export class Cards extends rest.Collection {
3
+ constructor(client) {
4
+ super(client);
5
+ }
6
+ async fetch(card) {
7
+ return this.client.get(`/card/card/${card}`);
8
+ }
9
+ async list(options) {
10
+ const search = options?.start && options?.end
11
+ ? `?start=${options?.start}&end=${options?.end}`
12
+ : options?.start
13
+ ? `?start=${options?.start}`
14
+ : options?.end
15
+ ? `?end=${options?.end}`
16
+ : "";
17
+ return this.client.get(`/card/card${search}`, options && (({ start, end, ...headers }) => headers)(options));
18
+ }
19
+ }
20
+ //# sourceMappingURL=Cards.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Cards.js","sourceRoot":"../","sources":["Client/Cards.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,IAAI,MAAM,cAAc,CAAA;AAGpC,MAAM,OAAO,KAAM,SAAQ,IAAI,CAAC,UAAyB;IACxD,YAAY,MAAmB;QAC9B,KAAK,CAAC,MAAM,CAAC,CAAA;IACd,CAAC;IAED,KAAK,CAAC,KAAK,CAAC,IAAY;QAEvB,OAAO,IAAI,CAAC,MAAM,CAAC,GAAG,CAAO,cAAc,IAAI,EAAE,CAAC,CAAA;IACnD,CAAC;IACD,KAAK,CAAC,IAAI,CAAC,OAMV;QAEA,MAAM,MAAM,GACX,OAAO,EAAE,KAAK,IAAI,OAAO,EAAE,GAAG;YAC7B,CAAC,CAAC,UAAU,OAAO,EAAE,KAAK,QAAQ,OAAO,EAAE,GAAG,EAAE;YAChD,CAAC,CAAC,OAAO,EAAE,KAAK;gBAChB,CAAC,CAAC,UAAU,OAAO,EAAE,KAAK,EAAE;gBAC5B,CAAC,CAAC,OAAO,EAAE,GAAG;oBACd,CAAC,CAAC,QAAQ,OAAO,EAAE,GAAG,EAAE;oBACxB,CAAC,CAAC,EAAE,CAAA;QACN,OAAO,IAAI,CAAC,MAAM,CAAC,GAAG,CACrB,aAAa,MAAM,EAAE,EACrB,OAAO,IAAI,CAAC,CAAC,EAAE,KAAK,EAAE,GAAG,EAAE,GAAG,OAAO,EAAE,EAAE,EAAE,CAAC,OAAO,CAAC,CAAC,OAAO,CAAC,CAC7D,CAAA;IACF,CAAC;CACD"}
@@ -4,6 +4,7 @@ import { http } from "cloudly-http";
4
4
  import * as rest from "cloudly-rest";
5
5
  import { Accounts } from "./Accounts";
6
6
  import { Application as ClientApplication } from "./Application";
7
+ import { Cards } from "./Cards";
7
8
  import { Me as ClientMe } from "./Me";
8
9
  import { Operations } from "./Operations";
9
10
  import { Organization as ClientOrganization } from "./Organization";
@@ -22,6 +23,7 @@ export declare class Client extends rest.Client<gracely.Error> {
22
23
  readonly transactions: Transactions;
23
24
  readonly treasury: Treasury;
24
25
  readonly version: Version;
26
+ readonly cards: Cards;
25
27
  static create<T = Record<string, any>>(server: string, key: string, load?: (client: http.Client) => T): Client & T;
26
28
  }
27
29
  export declare namespace Client {
@@ -3,6 +3,7 @@ import { http } from "cloudly-http";
3
3
  import * as rest from "cloudly-rest";
4
4
  import { Accounts } from "./Accounts";
5
5
  import { Application as ClientApplication } from "./Application";
6
+ import { Cards } from "./Cards";
6
7
  import { Me as ClientMe } from "./Me";
7
8
  import { Operations } from "./Operations";
8
9
  import { Organization as ClientOrganization } from "./Organization";
@@ -21,6 +22,7 @@ export class Client extends rest.Client {
21
22
  this.transactions = new Transactions(this.client);
22
23
  this.treasury = new Treasury(this.client);
23
24
  this.version = new Version(this.client);
25
+ this.cards = new Cards(this.client);
24
26
  }
25
27
  static create(server, key, load) {
26
28
  let httpClient;
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"../","sources":["Client/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAA;AAChD,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAAA;AACnC,OAAO,KAAK,IAAI,MAAM,cAAc,CAAA;AACpC,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA;AACrC,OAAO,EAAE,WAAW,IAAI,iBAAiB,EAAE,MAAM,eAAe,CAAA;AAChE,OAAO,EAAE,EAAE,IAAI,QAAQ,EAAE,MAAM,MAAM,CAAA;AACrC,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA;AACzC,OAAO,EAAE,YAAY,IAAI,kBAAkB,EAAE,MAAM,gBAAgB,CAAA;AACnE,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAA;AAC/C,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAC7C,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA;AAC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{ 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.45",
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"