@pax2pay/model-banking 0.1.658 → 0.1.660

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 (130) hide show
  1. package/Amount.ts +2 -0
  2. package/Balance.ts +11 -1
  3. package/Balances.ts +1 -1
  4. package/Card/Changeable.ts +5 -0
  5. package/Card/Creatable.ts +12 -0
  6. package/Card/Meta.ts +3 -0
  7. package/Card/Operation/Authorization.ts +8 -0
  8. package/Card/Operation/Card.ts +7 -0
  9. package/Card/Operation/index.ts +2 -0
  10. package/Card/Restriction/index.ts +2 -0
  11. package/Card/Stack.ts +4 -0
  12. package/Card/index.ts +26 -0
  13. package/Operation/Change.ts +7 -0
  14. package/Operation/Changes.ts +2 -0
  15. package/Operation/Creatable.ts +8 -0
  16. package/Operation/Status.ts +2 -0
  17. package/Operation/index.ts +8 -0
  18. package/dist/cjs/Account/Details.d.ts +1 -1
  19. package/dist/cjs/Account/index.d.ts +6 -2
  20. package/dist/cjs/Amount.d.ts +182 -0
  21. package/dist/cjs/Amount.js +2 -0
  22. package/dist/cjs/Amount.js.map +1 -1
  23. package/dist/cjs/Balance.d.ts +27 -1
  24. package/dist/cjs/Balance.js +12 -1
  25. package/dist/cjs/Balance.js.map +1 -1
  26. package/dist/cjs/Balances.d.ts +4 -0
  27. package/dist/cjs/Balances.js +1 -1
  28. package/dist/cjs/Balances.js.map +1 -1
  29. package/dist/cjs/Card/Changeable.d.ts +185 -0
  30. package/dist/cjs/Card/Changeable.js +6 -0
  31. package/dist/cjs/Card/Changeable.js.map +1 -1
  32. package/dist/cjs/Card/Creatable.d.ts +406 -0
  33. package/dist/cjs/Card/Creatable.js +13 -0
  34. package/dist/cjs/Card/Creatable.js.map +1 -1
  35. package/dist/cjs/Card/Expiry.d.ts +1 -1
  36. package/dist/cjs/Card/Meta.d.ts +2 -0
  37. package/dist/cjs/Card/Meta.js +2 -0
  38. package/dist/cjs/Card/Meta.js.map +1 -1
  39. package/dist/cjs/Card/Operation/Authorization.d.ts +14 -0
  40. package/dist/cjs/Card/Operation/Authorization.js +8 -0
  41. package/dist/cjs/Card/Operation/Authorization.js.map +1 -1
  42. package/dist/cjs/Card/Operation/Card.d.ts +194 -0
  43. package/dist/cjs/Card/Operation/Card.js +7 -0
  44. package/dist/cjs/Card/Operation/Card.js.map +1 -1
  45. package/dist/cjs/Card/Operation/index.d.ts +206 -0
  46. package/dist/cjs/Card/Operation/index.js +2 -0
  47. package/dist/cjs/Card/Operation/index.js.map +1 -1
  48. package/dist/cjs/Card/Restriction/index.d.ts +194 -0
  49. package/dist/cjs/Card/Restriction/index.js +2 -0
  50. package/dist/cjs/Card/Restriction/index.js.map +1 -1
  51. package/dist/cjs/Card/Stack.d.ts +21 -0
  52. package/dist/cjs/Card/Stack.js +4 -0
  53. package/dist/cjs/Card/Stack.js.map +1 -1
  54. package/dist/cjs/Card/index.d.ts +812 -0
  55. package/dist/cjs/Card/index.js +27 -0
  56. package/dist/cjs/Card/index.js.map +1 -1
  57. package/dist/cjs/Operation/Change.d.ts +14 -0
  58. package/dist/cjs/Operation/Change.js +7 -0
  59. package/dist/cjs/Operation/Change.js.map +1 -1
  60. package/dist/cjs/Operation/Changes.d.ts +14 -0
  61. package/dist/cjs/Operation/Changes.js +2 -0
  62. package/dist/cjs/Operation/Changes.js.map +1 -1
  63. package/dist/cjs/Operation/Creatable.d.ts +216 -0
  64. package/dist/cjs/Operation/Creatable.js +8 -0
  65. package/dist/cjs/Operation/Creatable.js.map +1 -1
  66. package/dist/cjs/Operation/Status.d.ts +6 -0
  67. package/dist/cjs/Operation/Status.js +2 -0
  68. package/dist/cjs/Operation/Status.js.map +1 -1
  69. package/dist/cjs/Operation/index.d.ts +221 -0
  70. package/dist/cjs/Operation/index.js +8 -0
  71. package/dist/cjs/Operation/index.js.map +1 -1
  72. package/dist/cjs/Rail/Address/Card.d.ts +1 -1
  73. package/dist/cjs/Rail/Address/index.d.ts +1 -1
  74. package/dist/mjs/Account/Details.d.ts +1 -1
  75. package/dist/mjs/Account/index.d.ts +6 -2
  76. package/dist/mjs/Amount.d.ts +182 -0
  77. package/dist/mjs/Amount.js +2 -0
  78. package/dist/mjs/Amount.js.map +1 -1
  79. package/dist/mjs/Balance.d.ts +27 -1
  80. package/dist/mjs/Balance.js +12 -1
  81. package/dist/mjs/Balance.js.map +1 -1
  82. package/dist/mjs/Balances.d.ts +4 -0
  83. package/dist/mjs/Balances.js +1 -1
  84. package/dist/mjs/Balances.js.map +1 -1
  85. package/dist/mjs/Card/Changeable.d.ts +185 -0
  86. package/dist/mjs/Card/Changeable.js +6 -0
  87. package/dist/mjs/Card/Changeable.js.map +1 -1
  88. package/dist/mjs/Card/Creatable.d.ts +406 -0
  89. package/dist/mjs/Card/Creatable.js +13 -0
  90. package/dist/mjs/Card/Creatable.js.map +1 -1
  91. package/dist/mjs/Card/Expiry.d.ts +1 -1
  92. package/dist/mjs/Card/Meta.d.ts +2 -0
  93. package/dist/mjs/Card/Meta.js +2 -0
  94. package/dist/mjs/Card/Meta.js.map +1 -1
  95. package/dist/mjs/Card/Operation/Authorization.d.ts +14 -0
  96. package/dist/mjs/Card/Operation/Authorization.js +8 -0
  97. package/dist/mjs/Card/Operation/Authorization.js.map +1 -1
  98. package/dist/mjs/Card/Operation/Card.d.ts +194 -0
  99. package/dist/mjs/Card/Operation/Card.js +7 -0
  100. package/dist/mjs/Card/Operation/Card.js.map +1 -1
  101. package/dist/mjs/Card/Operation/index.d.ts +206 -0
  102. package/dist/mjs/Card/Operation/index.js +2 -0
  103. package/dist/mjs/Card/Operation/index.js.map +1 -1
  104. package/dist/mjs/Card/Restriction/index.d.ts +194 -0
  105. package/dist/mjs/Card/Restriction/index.js +2 -0
  106. package/dist/mjs/Card/Restriction/index.js.map +1 -1
  107. package/dist/mjs/Card/Stack.d.ts +21 -0
  108. package/dist/mjs/Card/Stack.js +4 -0
  109. package/dist/mjs/Card/Stack.js.map +1 -1
  110. package/dist/mjs/Card/index.d.ts +812 -0
  111. package/dist/mjs/Card/index.js +27 -0
  112. package/dist/mjs/Card/index.js.map +1 -1
  113. package/dist/mjs/Operation/Change.d.ts +14 -0
  114. package/dist/mjs/Operation/Change.js +7 -0
  115. package/dist/mjs/Operation/Change.js.map +1 -1
  116. package/dist/mjs/Operation/Changes.d.ts +14 -0
  117. package/dist/mjs/Operation/Changes.js +2 -0
  118. package/dist/mjs/Operation/Changes.js.map +1 -1
  119. package/dist/mjs/Operation/Creatable.d.ts +216 -0
  120. package/dist/mjs/Operation/Creatable.js +8 -0
  121. package/dist/mjs/Operation/Creatable.js.map +1 -1
  122. package/dist/mjs/Operation/Status.d.ts +6 -0
  123. package/dist/mjs/Operation/Status.js +2 -0
  124. package/dist/mjs/Operation/Status.js.map +1 -1
  125. package/dist/mjs/Operation/index.d.ts +221 -0
  126. package/dist/mjs/Operation/index.js +8 -0
  127. package/dist/mjs/Operation/index.js.map +1 -1
  128. package/dist/mjs/Rail/Address/Card.d.ts +1 -1
  129. package/dist/mjs/Rail/Address/index.d.ts +1 -1
  130. package/package.json +1 -1
package/Amount.ts CHANGED
@@ -1,6 +1,7 @@
1
1
  import { isoly } from "isoly"
2
2
  import { isly } from "isly"
3
3
  import { Amounts } from "./Amounts"
4
+ import { zod } from "./zod"
4
5
 
5
6
  export type Amount = [isoly.Currency, number]
6
7
 
@@ -9,4 +10,5 @@ export namespace Amount {
9
10
  return !amount ? {} : Object.fromEntries<number>([amount])
10
11
  }
11
12
  export const type = isly.tuple<Amount>(isly.string(isoly.Currency.values), isly.number())
13
+ export const typeZod = zod.tuple([zod.enum(isoly.Currency.values), zod.number()])
12
14
  }
package/Balance.ts CHANGED
@@ -26,15 +26,25 @@ export namespace Balance {
26
26
  export namespace Entry {
27
27
  export const values = ["actual", "incomingReserved", "outgoingReserved", "bufferReserved"] as const
28
28
  export const type = isly.string<Entry>(values)
29
+ export const typeZod = zod.enum(values)
29
30
  }
30
31
  export const type = isly.record<Legacy>(Entry.type, isly.number())
32
+ export const typeZod = zod.partialRecord(Entry.typeZod, zod.number())
31
33
  }
32
34
  export type MaybeLegacy = Balance | Legacy
33
35
  export namespace MaybeLegacy {
34
36
  export const legacyType = isly.union<MaybeLegacy>(type, Legacy.type)
35
37
  }
36
38
  export type Extended = Balance & Legacy
37
- export const Extended = isly.intersection<Extended, Balance, Legacy>(type, Legacy.type)
39
+ export namespace Extended {
40
+ export const type = isly.intersection<Extended, Balance, Legacy>(Balance.type, Legacy.type)
41
+ export const typeZod = Balance.typeZod.extend({
42
+ actual: zod.number().optional(),
43
+ incomingReserved: zod.number().optional(),
44
+ outgoingReserved: zod.number().optional(),
45
+ bufferReserved: zod.number().optional(),
46
+ })
47
+ }
38
48
  export function update(currency: isoly.Currency, balance: MaybeLegacy): Extended {
39
49
  const result: Extended = { ...balance }
40
50
  if (Legacy.type.is(balance)) {
package/Balances.ts CHANGED
@@ -9,7 +9,7 @@ export type Balances = Partial<Record<isoly.Currency, Balances.Balance.Extended>
9
9
  export namespace Balances {
10
10
  export import Balance = BalancesBalance
11
11
  export const type = isly.record<Balances>(isly.fromIs("isoly.Currency", isoly.Currency.is), Balances.Balance.type)
12
- export const typeZod = zod.partialRecord(zod.enum(isoly.Currency.values), Balances.Balance.typeZod)
12
+ export const typeZod = zod.partialRecord(zod.enum(isoly.Currency.values), Balances.Balance.Extended.typeZod)
13
13
  export function update(balances: Balances): Balances {
14
14
  const result: Balances = {}
15
15
  for (const [currency, balance] of Object.entries(balances)) {
@@ -1,6 +1,7 @@
1
1
  import { isoly } from "isoly"
2
2
  import { isly } from "isly"
3
3
  import { Amount } from "../Amount"
4
+ import { zod } from "../zod"
4
5
  import { Meta } from "./Meta"
5
6
 
6
7
  export type Changeable = {
@@ -13,4 +14,8 @@ export namespace Changeable {
13
14
  limit: isly.tuple(isly.fromIs("isoly.Currency", isoly.Currency.is), isly.number()).optional(),
14
15
  meta: isly.fromIs("Card.Meta", Meta.is).optional(),
15
16
  })
17
+ export const typeZod = zod.object({
18
+ limit: Amount.typeZod.optional(),
19
+ meta: Meta.typeZod.optional(),
20
+ })
16
21
  }
package/Card/Creatable.ts CHANGED
@@ -3,6 +3,7 @@ import { isly } from "isly"
3
3
  import { Amount } from "../Amount"
4
4
  import type { Rule } from "../Rule"
5
5
  import { type as ruleType } from "../Rule/type"
6
+ import { zod } from "../zod"
6
7
  import { Expiry } from "./Expiry"
7
8
  import { Meta } from "./Meta"
8
9
  import { Preset } from "./Preset"
@@ -35,4 +36,15 @@ export namespace Creatable {
35
36
  key: isly.string().optional(),
36
37
  restricted: isly.object<Required<Creatable>["restricted"]>({ to: Restriction.type.optional() }).optional(),
37
38
  })
39
+ export const typeZod = zod.object({
40
+ account: zod.string(),
41
+ number: zod.string().optional(),
42
+ preset: Preset.typeZod,
43
+ details: zod.object({ expiry: Expiry.typeZod, holder: zod.string() }),
44
+ limit: Amount.typeZod,
45
+ rules: zod.array(zod.never()).optional(),
46
+ meta: Meta.typeZod.optional(),
47
+ key: zod.string().optional(),
48
+ restricted: zod.object({ to: Restriction.typeZod.optional() }).optional(),
49
+ })
38
50
  }
package/Card/Meta.ts CHANGED
@@ -1,3 +1,5 @@
1
+ import { zod } from "../zod"
2
+
1
3
  export interface Meta {
2
4
  [key: string]: any
3
5
  }
@@ -14,4 +16,5 @@ export namespace Meta {
14
16
  typeof value == "boolean"
15
17
  )
16
18
  }
19
+ export const typeZod = zod.any().refine(Meta.is)
17
20
  }
@@ -1,5 +1,6 @@
1
1
  import { isoly } from "isoly"
2
2
  import { isly } from "isly"
3
+ import { zod } from "../../zod"
3
4
 
4
5
  export interface Authorization {
5
6
  type: "authorization"
@@ -18,4 +19,11 @@ export namespace Authorization {
18
19
  reason: isly.string().optional(),
19
20
  created: isly.fromIs("isoly.DateTime", isoly.DateTime.is),
20
21
  })
22
+ export const typeZod = zod.object({
23
+ type: zod.literal("authorization"),
24
+ id: zod.string(),
25
+ status: zod.enum(statuses),
26
+ reason: zod.string().optional(),
27
+ created: zod.string().refine(isoly.DateTime.is),
28
+ })
21
29
  }
@@ -1,5 +1,6 @@
1
1
  import { isoly } from "isoly"
2
2
  import { isly } from "isly"
3
+ import { zod } from "../../zod"
3
4
  import { Changeable } from "../Changeable"
4
5
 
5
6
  export interface Card {
@@ -18,4 +19,10 @@ export namespace Card {
18
19
  from: Changeable.type.optional(),
19
20
  created: isly.fromIs("isoly.DateTime", isoly.DateTime.is),
20
21
  })
22
+ export const typeZod = zod.object({
23
+ type: zod.literal("card"),
24
+ status: zod.enum(statuses),
25
+ from: Changeable.typeZod.optional(),
26
+ created: zod.string().refine(isoly.DateTime.is),
27
+ })
21
28
  }
@@ -2,6 +2,7 @@ import { isoly } from "isoly"
2
2
  import { isly } from "isly"
3
3
  import { Authorization } from "../../Authorization"
4
4
  import { Entry } from "../../Settlement/Entry"
5
+ import { zod } from "../../zod"
5
6
  import { Authorization as OperationAuthorization } from "./Authorization"
6
7
  import { Card } from "./Card"
7
8
 
@@ -27,4 +28,5 @@ export namespace Operation {
27
28
  }
28
29
  }
29
30
  export const type = isly.union(Card.type, OperationAuthorization.type)
31
+ export const typeZod = zod.union([Card.typeZod, OperationAuthorization.typeZod])
30
32
  }
@@ -1,5 +1,6 @@
1
1
  import { isly } from "isly"
2
2
  import type { Transaction } from "../../Transaction"
3
+ import { zod } from "../../zod"
3
4
  import { Merchant as RestrictionsMerchant } from "./Merchant"
4
5
 
5
6
  export interface Restriction {
@@ -8,6 +9,7 @@ export interface Restriction {
8
9
  export namespace Restriction {
9
10
  export import Merchant = RestrictionsMerchant
10
11
  export const type = isly.object<Restriction>({ merchants: Merchant.type.array().optional() })
12
+ export const typeZod = zod.object({ merchants: zod.array(Merchant.typeZod).optional() })
11
13
  export function check(
12
14
  restrictions: Restriction,
13
15
  transaction: Transaction.Creatable.CardTransaction | Transaction.PreTransaction.Authorization
package/Card/Stack.ts CHANGED
@@ -1,5 +1,6 @@
1
1
  import { isly } from "isly"
2
2
  import { Realm } from "../Realm"
3
+ import { zod } from "../zod"
3
4
 
4
5
  export type Stack = (typeof Stack.stacks)[number]
5
6
 
@@ -11,15 +12,18 @@ export namespace Stack {
11
12
  export const uk = ["uk-visa-tpl-marqeta", "uk-diners-clowd9"] as const
12
13
  export const values = [...test, ...uk] as const
13
14
  export const type = isly.string([...test, ...uk])
15
+ export const typeZod = zod.enum([...test, ...uk])
14
16
  }
15
17
  export type Decommissioned = (typeof Decommissioned.values)[number]
16
18
  export namespace Decommissioned {
17
19
  export const uk = ["uk-diners-dpg", "uk-mc-tpl-marqeta"] as const
18
20
  export const values = [...uk] as const
19
21
  export const type = isly.string(values)
22
+ export const typeZod = zod.enum(values)
20
23
  }
21
24
  export const stacks = [...Active.values, ...Decommissioned.values] as const
22
25
  export const type = isly.string(stacks)
26
+ export const typeZod = zod.enum(stacks)
23
27
  export function toRealm(stack: Stack): Realm {
24
28
  return stack.split("-")[0] as Realm
25
29
  }
package/Card/index.ts CHANGED
@@ -5,6 +5,7 @@ import { Realm } from "../Realm"
5
5
  import { Report } from "../Report"
6
6
  import type { Rule } from "../Rule"
7
7
  import { type as ruleType } from "../Rule/type"
8
+ import { zod } from "../zod"
8
9
  import { Changeable as CardChangeable } from "./Changeable"
9
10
  import { Creatable as CardCreatable } from "./Creatable"
10
11
  import { Expiry as CardExpiry } from "./Expiry"
@@ -75,6 +76,31 @@ export namespace Card {
75
76
  meta: isly.fromIs("Card.Meta", CardMeta.is).optional(),
76
77
  restricted: isly.object<Required<Card>["restricted"]>({ to: CardRestriction.type.optional() }).optional(),
77
78
  })
79
+ export const typeZod = zod.object({
80
+ id: zod.string(),
81
+ number: zod.string().optional(),
82
+ created: zod.string().refine(isoly.DateTime.is),
83
+ organization: zod.string(),
84
+ realm: Realm.typeZod,
85
+ account: zod.string(),
86
+ preset: CardPreset.typeZod,
87
+ scheme: CardScheme.typeZod,
88
+ reference: zod.string(),
89
+ details: zod.object({
90
+ iin: zod.string(),
91
+ last4: zod.string(),
92
+ expiry: CardExpiry.typeZod,
93
+ holder: zod.string(),
94
+ token: zod.string().optional(),
95
+ }),
96
+ limit: Amount.typeZod,
97
+ spent: Amount.typeZod,
98
+ status: zod.enum(["active", "cancelled"]),
99
+ history: zod.array(CardOperation.typeZod),
100
+ rules: zod.array(zod.never()),
101
+ meta: CardMeta.typeZod.optional(),
102
+ restricted: zod.object({ to: CardRestriction.typeZod.optional() }).optional(),
103
+ })
78
104
  const csvMap: Record<string, (card: Card) => string | number | undefined> = {
79
105
  id: card => card.id,
80
106
  created: card => readableDate(card.created),
@@ -1,4 +1,5 @@
1
1
  import { isly } from "isly"
2
+ import { zod } from "../zod"
2
3
  import { Status } from "./Status"
3
4
 
4
5
  export interface Change<T extends Change.Operand = Change.Operand> {
@@ -17,6 +18,12 @@ export namespace Change {
17
18
  status: Status.type,
18
19
  result: isly.number().optional(),
19
20
  })
21
+ export const typeZod = zod.object({
22
+ type: zod.enum(operand),
23
+ amount: zod.number(),
24
+ status: Status.typeZod,
25
+ result: zod.number().optional(),
26
+ })
20
27
  export namespace Add {
21
28
  export const type = Change.type.extend<Change<"add">>({
22
29
  type: isly.string("add"),
@@ -2,6 +2,7 @@ import { isoly } from "isoly"
2
2
  import { isly } from "isly"
3
3
  import { Balance as AccountBalance } from "../Balance"
4
4
  import type { Settlement } from "../Settlement"
5
+ import { zod } from "../zod"
5
6
  import { Change } from "./Change"
6
7
 
7
8
  export type Changes = Partial<Record<Changes.Entry.Balance, Change>>
@@ -47,6 +48,7 @@ export namespace Changes {
47
48
  export type Sum = Partial<Record<Changes.Entry.Balance, number>>
48
49
  export type MaybeLegacy = Changes | Legacy
49
50
  export const type = isly.record<Changes>(isly.string(), Change.type)
51
+ export const typeZod = zod.record(zod.string(), Change.typeZod)
50
52
  export type Legacy = Partial<Record<AccountBalance.Legacy.Entry, Change>>
51
53
  export namespace Legacy {
52
54
  export const type = isly.record<Legacy>(isly.string(), Change.type)
@@ -2,6 +2,7 @@ import { cryptly } from "cryptly"
2
2
  import { isoly } from "isoly"
3
3
  import { isly } from "isly"
4
4
  import { Settlement } from "../Settlement"
5
+ import { zod } from "../zod"
5
6
  import { Changes } from "./Changes"
6
7
 
7
8
  export interface Creatable {
@@ -37,6 +38,13 @@ export namespace Creatable {
37
38
  type: isly.string(types),
38
39
  counterbalance: isly.string().optional(),
39
40
  })
41
+ export const typeZod = zod.object({
42
+ account: zod.string(),
43
+ currency: zod.enum(isoly.Currency.values),
44
+ changes: Changes.typeZod,
45
+ type: zod.enum(types),
46
+ counterbalance: zod.string().optional(),
47
+ })
40
48
  export function fromRefund(account: string, settlement: string, entry: Settlement.Entry.Creatable.Refund): Creatable {
41
49
  // The Entry.Refund.Creatable has negative amount and fee
42
50
  // The operation amounts should always be positive
@@ -1,8 +1,10 @@
1
1
  import { isly } from "isly"
2
+ import { zod } from "../zod"
2
3
 
3
4
  export type Status = (typeof Status.values)[number]
4
5
 
5
6
  export namespace Status {
6
7
  export const values = ["pending", "success", "failed"] as const
7
8
  export const type = isly.string(values)
9
+ export const typeZod = zod.enum(values)
8
10
  }
@@ -1,5 +1,6 @@
1
1
  import { isoly } from "isoly"
2
2
  import { isly } from "isly"
3
+ import { zod } from "../zod"
3
4
  import { Change as OperationChange } from "./Change"
4
5
  import { Changes as OperationChanges } from "./Changes"
5
6
  import { Creatable as OperationCreatable } from "./Creatable"
@@ -34,6 +35,13 @@ export namespace Operation {
34
35
  export import Creatable = OperationCreatable
35
36
  export import Changes = OperationChanges
36
37
  export import Change = OperationChange
38
+ export const typeZod = Creatable.typeZod.extend({
39
+ transaction: zod.string(),
40
+ counter: zod.number(),
41
+ created: zod.string().refine(isoly.DateTime.is),
42
+ signature: zod.string().optional(),
43
+ previous: zod.string().optional(),
44
+ })
37
45
  export const type = OperationCreatable.type.extend<Operation>({
38
46
  transaction: isly.string(),
39
47
  counter: isly.number(),
@@ -208,7 +208,7 @@ export declare namespace Details {
208
208
  id: zod.ZodString;
209
209
  iin: zod.ZodString;
210
210
  last4: zod.ZodString;
211
- expiry: zod.ZodTuple<[zod.ZodLiteral<26 | 23 | 24 | 25 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40>, zod.ZodLiteral<2 | 1 | 3 | 4 | 5 | 6 | 11 | 8 | 9 | 7 | 10 | 12>], null>;
211
+ expiry: zod.ZodTuple<[zod.ZodLiteral<26 | 23 | 24 | 25 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40>, zod.ZodLiteral<2 | 1 | 4 | 3 | 5 | 6 | 11 | 8 | 9 | 7 | 10 | 12>], null>;
212
212
  holder: zod.ZodString;
213
213
  }, zod.z.core.$strip>, zod.ZodObject<{
214
214
  type: zod.ZodLiteral<"card">;
@@ -226,6 +226,10 @@ export declare namespace Account {
226
226
  outgoing: "outgoing";
227
227
  buffer: "buffer";
228
228
  }> & zod.z.core.$partial, zod.ZodOptional<zod.ZodNumber>>>;
229
+ actual: zod.ZodOptional<zod.ZodNumber>;
230
+ incomingReserved: zod.ZodOptional<zod.ZodNumber>;
231
+ outgoingReserved: zod.ZodOptional<zod.ZodNumber>;
232
+ bufferReserved: zod.ZodOptional<zod.ZodNumber>;
229
233
  }, zod.z.core.$strip>>;
230
234
  rails: zod.ZodArray<zod.ZodUnion<readonly [zod.ZodObject<{
231
235
  type: zod.ZodLiteral<"card">;
@@ -237,7 +241,7 @@ export declare namespace Account {
237
241
  id: zod.ZodString;
238
242
  iin: zod.ZodString;
239
243
  last4: zod.ZodString;
240
- expiry: zod.ZodTuple<[zod.ZodLiteral<26 | 23 | 24 | 25 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40>, zod.ZodLiteral<2 | 1 | 3 | 4 | 5 | 6 | 11 | 8 | 9 | 7 | 10 | 12>], null>;
244
+ expiry: zod.ZodTuple<[zod.ZodLiteral<26 | 23 | 24 | 25 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40>, zod.ZodLiteral<2 | 1 | 4 | 3 | 5 | 6 | 11 | 8 | 9 | 7 | 10 | 12>], null>;
241
245
  holder: zod.ZodString;
242
246
  }, zod.z.core.$strip>, zod.ZodObject<{
243
247
  type: zod.ZodLiteral<"card">;
@@ -479,7 +483,7 @@ export declare namespace Account {
479
483
  id: zod.ZodString;
480
484
  iin: zod.ZodString;
481
485
  last4: zod.ZodString;
482
- expiry: zod.ZodTuple<[zod.ZodLiteral<26 | 23 | 24 | 25 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40>, zod.ZodLiteral<2 | 1 | 3 | 4 | 5 | 6 | 11 | 8 | 9 | 7 | 10 | 12>], null>;
486
+ expiry: zod.ZodTuple<[zod.ZodLiteral<26 | 23 | 24 | 25 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40>, zod.ZodLiteral<2 | 1 | 4 | 3 | 5 | 6 | 11 | 8 | 9 | 7 | 10 | 12>], null>;
483
487
  holder: zod.ZodString;
484
488
  }, zod.z.core.$strip>, zod.ZodObject<{
485
489
  type: zod.ZodLiteral<"card">;
@@ -1,8 +1,190 @@
1
1
  import { isoly } from "isoly";
2
2
  import { isly } from "isly";
3
3
  import { Amounts } from "./Amounts";
4
+ import { zod } from "./zod";
4
5
  export type Amount = [isoly.Currency, number];
5
6
  export declare namespace Amount {
6
7
  function toAmounts(amount?: Amount): Amounts;
7
8
  const type: isly.Type<Amount>;
9
+ const typeZod: zod.ZodTuple<[zod.ZodEnum<{
10
+ AED: "AED";
11
+ AFN: "AFN";
12
+ ALL: "ALL";
13
+ AMD: "AMD";
14
+ ANG: "ANG";
15
+ AOA: "AOA";
16
+ ARS: "ARS";
17
+ AUD: "AUD";
18
+ AWG: "AWG";
19
+ AZN: "AZN";
20
+ BAM: "BAM";
21
+ BBD: "BBD";
22
+ BDT: "BDT";
23
+ BGN: "BGN";
24
+ BHD: "BHD";
25
+ BIF: "BIF";
26
+ BMD: "BMD";
27
+ BND: "BND";
28
+ BOB: "BOB";
29
+ BOV: "BOV";
30
+ BRL: "BRL";
31
+ BSD: "BSD";
32
+ BTN: "BTN";
33
+ BWP: "BWP";
34
+ BYN: "BYN";
35
+ BZD: "BZD";
36
+ CAD: "CAD";
37
+ CDF: "CDF";
38
+ CHE: "CHE";
39
+ CHF: "CHF";
40
+ CHW: "CHW";
41
+ CLF: "CLF";
42
+ CLP: "CLP";
43
+ CNY: "CNY";
44
+ COP: "COP";
45
+ COU: "COU";
46
+ CRC: "CRC";
47
+ CUC: "CUC";
48
+ CUP: "CUP";
49
+ CVE: "CVE";
50
+ CZK: "CZK";
51
+ DJF: "DJF";
52
+ DKK: "DKK";
53
+ DOP: "DOP";
54
+ DZD: "DZD";
55
+ EGP: "EGP";
56
+ ERN: "ERN";
57
+ ETB: "ETB";
58
+ EUR: "EUR";
59
+ FJD: "FJD";
60
+ FKP: "FKP";
61
+ GBP: "GBP";
62
+ GEL: "GEL";
63
+ GHS: "GHS";
64
+ GIP: "GIP";
65
+ GMD: "GMD";
66
+ GNF: "GNF";
67
+ GTQ: "GTQ";
68
+ GYD: "GYD";
69
+ HKD: "HKD";
70
+ HNL: "HNL";
71
+ HRK: "HRK";
72
+ HTG: "HTG";
73
+ HUF: "HUF";
74
+ IDR: "IDR";
75
+ ILS: "ILS";
76
+ INR: "INR";
77
+ IQD: "IQD";
78
+ IRR: "IRR";
79
+ ISK: "ISK";
80
+ JMD: "JMD";
81
+ JOD: "JOD";
82
+ JPY: "JPY";
83
+ KES: "KES";
84
+ KGS: "KGS";
85
+ KHR: "KHR";
86
+ KMF: "KMF";
87
+ KPW: "KPW";
88
+ KRW: "KRW";
89
+ KWD: "KWD";
90
+ KYD: "KYD";
91
+ KZT: "KZT";
92
+ LAK: "LAK";
93
+ LBP: "LBP";
94
+ LKR: "LKR";
95
+ LRD: "LRD";
96
+ LSL: "LSL";
97
+ LYD: "LYD";
98
+ MAD: "MAD";
99
+ MDL: "MDL";
100
+ MGA: "MGA";
101
+ MKD: "MKD";
102
+ MMK: "MMK";
103
+ MNT: "MNT";
104
+ MOP: "MOP";
105
+ MRU: "MRU";
106
+ MUR: "MUR";
107
+ MVR: "MVR";
108
+ MWK: "MWK";
109
+ MXN: "MXN";
110
+ MXV: "MXV";
111
+ MYR: "MYR";
112
+ MZN: "MZN";
113
+ NAD: "NAD";
114
+ NGN: "NGN";
115
+ NIO: "NIO";
116
+ NOK: "NOK";
117
+ NPR: "NPR";
118
+ NZD: "NZD";
119
+ OMR: "OMR";
120
+ PAB: "PAB";
121
+ PEN: "PEN";
122
+ PGK: "PGK";
123
+ PHP: "PHP";
124
+ PKR: "PKR";
125
+ PLN: "PLN";
126
+ PYG: "PYG";
127
+ QAR: "QAR";
128
+ RON: "RON";
129
+ RSD: "RSD";
130
+ RUB: "RUB";
131
+ RWF: "RWF";
132
+ SAR: "SAR";
133
+ SBD: "SBD";
134
+ SCR: "SCR";
135
+ SDG: "SDG";
136
+ SEK: "SEK";
137
+ SGD: "SGD";
138
+ SHP: "SHP";
139
+ SLL: "SLL";
140
+ SOS: "SOS";
141
+ SRD: "SRD";
142
+ SSP: "SSP";
143
+ STN: "STN";
144
+ SVC: "SVC";
145
+ SYP: "SYP";
146
+ SZL: "SZL";
147
+ THB: "THB";
148
+ TJS: "TJS";
149
+ TMT: "TMT";
150
+ TND: "TND";
151
+ TOP: "TOP";
152
+ TRY: "TRY";
153
+ TTD: "TTD";
154
+ TWD: "TWD";
155
+ TZS: "TZS";
156
+ UAH: "UAH";
157
+ UGX: "UGX";
158
+ USD: "USD";
159
+ USN: "USN";
160
+ UYI: "UYI";
161
+ UYU: "UYU";
162
+ UYW: "UYW";
163
+ UZS: "UZS";
164
+ VES: "VES";
165
+ VND: "VND";
166
+ VUV: "VUV";
167
+ WST: "WST";
168
+ XAF: "XAF";
169
+ XAG: "XAG";
170
+ XAU: "XAU";
171
+ XBA: "XBA";
172
+ XBB: "XBB";
173
+ XBC: "XBC";
174
+ XBD: "XBD";
175
+ XCD: "XCD";
176
+ XDR: "XDR";
177
+ XOF: "XOF";
178
+ XPD: "XPD";
179
+ XPF: "XPF";
180
+ XPT: "XPT";
181
+ XSU: "XSU";
182
+ XTS: "XTS";
183
+ XUA: "XUA";
184
+ XXX: "XXX";
185
+ YER: "YER";
186
+ ZAR: "ZAR";
187
+ ZMW: "ZMW";
188
+ ZWL: "ZWL";
189
+ }>, zod.ZodNumber], null>;
8
190
  }
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.Amount = void 0;
4
4
  const isoly_1 = require("isoly");
5
5
  const isly_1 = require("isly");
6
+ const zod_1 = require("./zod");
6
7
  var Amount;
7
8
  (function (Amount) {
8
9
  function toAmounts(amount) {
@@ -10,5 +11,6 @@ var Amount;
10
11
  }
11
12
  Amount.toAmounts = toAmounts;
12
13
  Amount.type = isly_1.isly.tuple(isly_1.isly.string(isoly_1.isoly.Currency.values), isly_1.isly.number());
14
+ Amount.typeZod = zod_1.zod.tuple([zod_1.zod.enum(isoly_1.isoly.Currency.values), zod_1.zod.number()]);
13
15
  })(Amount || (exports.Amount = Amount = {}));
14
16
  //# sourceMappingURL=Amount.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Amount.js","sourceRoot":"","sources":["../../Amount.ts"],"names":[],"mappings":";;;AAAA,iCAA6B;AAC7B,+BAA2B;AAK3B,IAAiB,MAAM,CAKtB;AALD,WAAiB,MAAM;IACtB,SAAgB,SAAS,CAAC,MAAe;QACxC,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,WAAW,CAAS,CAAC,MAAM,CAAC,CAAC,CAAA;IAC3D,CAAC;IAFe,gBAAS,YAExB,CAAA;IACY,WAAI,GAAG,WAAI,CAAC,KAAK,CAAS,WAAI,CAAC,MAAM,CAAC,aAAK,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE,WAAI,CAAC,MAAM,EAAE,CAAC,CAAA;AAC1F,CAAC,EALgB,MAAM,sBAAN,MAAM,QAKtB"}
1
+ {"version":3,"file":"Amount.js","sourceRoot":"","sources":["../../Amount.ts"],"names":[],"mappings":";;;AAAA,iCAA6B;AAC7B,+BAA2B;AAE3B,+BAA2B;AAI3B,IAAiB,MAAM,CAMtB;AAND,WAAiB,MAAM;IACtB,SAAgB,SAAS,CAAC,MAAe;QACxC,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,WAAW,CAAS,CAAC,MAAM,CAAC,CAAC,CAAA;IAC3D,CAAC;IAFe,gBAAS,YAExB,CAAA;IACY,WAAI,GAAG,WAAI,CAAC,KAAK,CAAS,WAAI,CAAC,MAAM,CAAC,aAAK,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE,WAAI,CAAC,MAAM,EAAE,CAAC,CAAA;IAC5E,cAAO,GAAG,SAAG,CAAC,KAAK,CAAC,CAAC,SAAG,CAAC,IAAI,CAAC,aAAK,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE,SAAG,CAAC,MAAM,EAAE,CAAC,CAAC,CAAA;AAClF,CAAC,EANgB,MAAM,sBAAN,MAAM,QAMtB"}
@@ -33,15 +33,41 @@ export declare namespace Balance {
33
33
  namespace Entry {
34
34
  const values: readonly ["actual", "incomingReserved", "outgoingReserved", "bufferReserved"];
35
35
  const type: isly.Type<"actual" | "incomingReserved" | "outgoingReserved" | "bufferReserved">;
36
+ const typeZod: zod.ZodEnum<{
37
+ actual: "actual";
38
+ incomingReserved: "incomingReserved";
39
+ outgoingReserved: "outgoingReserved";
40
+ bufferReserved: "bufferReserved";
41
+ }>;
36
42
  }
37
43
  const type: isly.Type<Partial<Record<"actual" | "incomingReserved" | "outgoingReserved" | "bufferReserved", number>>>;
44
+ const typeZod: zod.ZodRecord<zod.ZodEnum<{
45
+ actual: "actual";
46
+ incomingReserved: "incomingReserved";
47
+ outgoingReserved: "outgoingReserved";
48
+ bufferReserved: "bufferReserved";
49
+ }> & zod.z.core.$partial, zod.ZodNumber>;
38
50
  }
39
51
  type MaybeLegacy = Balance | Legacy;
40
52
  namespace MaybeLegacy {
41
53
  const legacyType: isly.Type<MaybeLegacy>;
42
54
  }
43
55
  type Extended = Balance & Legacy;
44
- const Extended: isly.Type<Extended>;
56
+ namespace Extended {
57
+ const type: isly.Type<Extended>;
58
+ const typeZod: zod.ZodObject<{
59
+ available: zod.ZodOptional<zod.ZodNumber>;
60
+ reserved: zod.ZodOptional<zod.ZodRecord<zod.ZodEnum<{
61
+ incoming: "incoming";
62
+ outgoing: "outgoing";
63
+ buffer: "buffer";
64
+ }> & zod.z.core.$partial, zod.ZodOptional<zod.ZodNumber>>>;
65
+ actual: zod.ZodOptional<zod.ZodNumber>;
66
+ incomingReserved: zod.ZodOptional<zod.ZodNumber>;
67
+ outgoingReserved: zod.ZodOptional<zod.ZodNumber>;
68
+ bufferReserved: zod.ZodOptional<zod.ZodNumber>;
69
+ }, zod.z.core.$strip>;
70
+ }
45
71
  function update(currency: isoly.Currency, balance: MaybeLegacy): Extended;
46
72
  function computeReserved(currency: isoly.Currency, balance: Balance): Amount;
47
73
  function computeActual(currency: isoly.Currency, balance: Balance): Amount;
@@ -26,14 +26,25 @@ var Balance;
26
26
  (function (Entry) {
27
27
  Entry.values = ["actual", "incomingReserved", "outgoingReserved", "bufferReserved"];
28
28
  Entry.type = isly_1.isly.string(Entry.values);
29
+ Entry.typeZod = zod_1.zod.enum(Entry.values);
29
30
  })(Entry = Legacy.Entry || (Legacy.Entry = {}));
30
31
  Legacy.type = isly_1.isly.record(Entry.type, isly_1.isly.number());
32
+ Legacy.typeZod = zod_1.zod.partialRecord(Entry.typeZod, zod_1.zod.number());
31
33
  })(Legacy = Balance.Legacy || (Balance.Legacy = {}));
32
34
  let MaybeLegacy;
33
35
  (function (MaybeLegacy) {
34
36
  MaybeLegacy.legacyType = isly_1.isly.union(Balance.type, Legacy.type);
35
37
  })(MaybeLegacy = Balance.MaybeLegacy || (Balance.MaybeLegacy = {}));
36
- Balance.Extended = isly_1.isly.intersection(Balance.type, Legacy.type);
38
+ let Extended;
39
+ (function (Extended) {
40
+ Extended.type = isly_1.isly.intersection(Balance.type, Legacy.type);
41
+ Extended.typeZod = Balance.typeZod.extend({
42
+ actual: zod_1.zod.number().optional(),
43
+ incomingReserved: zod_1.zod.number().optional(),
44
+ outgoingReserved: zod_1.zod.number().optional(),
45
+ bufferReserved: zod_1.zod.number().optional(),
46
+ });
47
+ })(Extended = Balance.Extended || (Balance.Extended = {}));
37
48
  function update(currency, balance) {
38
49
  const result = { ...balance };
39
50
  if (Legacy.type.is(balance)) {