@pax2pay/model-banking 0.1.657 → 0.1.659
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Account/Charge/Fx/index.ts +1 -0
- package/Account/Charge/Merchant/index.ts +5 -0
- package/Account/Charge/Preset/index.ts +4 -0
- package/Account/Charge/index.ts +5 -0
- package/Account/Creatable.ts +3 -0
- package/Account/Details.ts +11 -0
- package/Account/History.ts +7 -0
- package/Account/Status.ts +5 -0
- package/Account/index.ts +13 -0
- package/Acquirer/index.ts +8 -0
- package/Amount.ts +2 -0
- package/Balance.ts +17 -1
- package/Balances.ts +2 -0
- package/Card/Changeable.ts +5 -0
- package/Card/Creatable.ts +12 -0
- package/Card/Expiry.ts +2 -0
- package/Card/Meta.ts +3 -0
- package/Card/Operation/Authorization.ts +8 -0
- package/Card/Operation/Card.ts +7 -0
- package/Card/Operation/index.ts +2 -0
- package/Card/Preset.ts +2 -0
- package/Card/Restriction/Merchant.ts +2 -0
- package/Card/Restriction/index.ts +2 -0
- package/Card/Scheme.ts +2 -0
- package/Card/Stack.ts +4 -0
- package/Card/index.ts +26 -0
- package/Merchant/index.ts +11 -0
- package/Rail/Address/Card.ts +17 -0
- package/Rail/Address/Iban.ts +8 -0
- package/Rail/Address/PaxGiro.ts +2 -0
- package/Rail/Address/Scan.ts +8 -0
- package/Rail/Address/index.ts +9 -0
- package/Rail/Address/internal.ts +7 -0
- package/Supplier/index.ts +2 -0
- package/dist/cjs/Account/Charge/Fx/index.d.ts +21 -0
- package/dist/cjs/Account/Charge/Fx/index.js +1 -0
- package/dist/cjs/Account/Charge/Fx/index.js.map +1 -1
- package/dist/cjs/Account/Charge/Merchant/index.d.ts +217 -0
- package/dist/cjs/Account/Charge/Merchant/index.js +5 -0
- package/dist/cjs/Account/Charge/Merchant/index.js.map +1 -1
- package/dist/cjs/Account/Charge/Preset/index.d.ts +22 -0
- package/dist/cjs/Account/Charge/Preset/index.js +4 -0
- package/dist/cjs/Account/Charge/Preset/index.js.map +1 -1
- package/dist/cjs/Account/Charge/index.d.ts +240 -0
- package/dist/cjs/Account/Charge/index.js +5 -0
- package/dist/cjs/Account/Charge/index.js.map +1 -1
- package/dist/cjs/Account/Creatable.d.ts +12 -0
- package/dist/cjs/Account/Creatable.js +3 -0
- package/dist/cjs/Account/Creatable.js.map +1 -1
- package/dist/cjs/Account/Details.d.ts +432 -0
- package/dist/cjs/Account/Details.js +11 -0
- package/dist/cjs/Account/Details.js.map +1 -1
- package/dist/cjs/Account/History.d.ts +25 -0
- package/dist/cjs/Account/History.js +7 -0
- package/dist/cjs/Account/History.js.map +1 -1
- package/dist/cjs/Account/Status.d.ts +9 -0
- package/dist/cjs/Account/Status.js +5 -0
- package/dist/cjs/Account/Status.js.map +1 -1
- package/dist/cjs/Account/index.d.ts +752 -0
- package/dist/cjs/Account/index.js +13 -0
- package/dist/cjs/Account/index.js.map +1 -1
- package/dist/cjs/Acquirer/index.d.ts +8 -0
- package/dist/cjs/Acquirer/index.js +8 -0
- package/dist/cjs/Acquirer/index.js.map +1 -1
- package/dist/cjs/Amount.d.ts +182 -0
- package/dist/cjs/Amount.js +2 -0
- package/dist/cjs/Amount.js.map +1 -1
- package/dist/cjs/Balance.d.ts +41 -1
- package/dist/cjs/Balance.js +18 -1
- package/dist/cjs/Balance.js.map +1 -1
- package/dist/cjs/Balances.d.ts +193 -0
- package/dist/cjs/Balances.js +2 -0
- package/dist/cjs/Balances.js.map +1 -1
- package/dist/cjs/Card/Changeable.d.ts +185 -0
- package/dist/cjs/Card/Changeable.js +6 -0
- package/dist/cjs/Card/Changeable.js.map +1 -1
- package/dist/cjs/Card/Creatable.d.ts +406 -0
- package/dist/cjs/Card/Creatable.js +13 -0
- package/dist/cjs/Card/Creatable.js.map +1 -1
- package/dist/cjs/Card/Expiry.d.ts +2 -0
- package/dist/cjs/Card/Expiry.js +2 -0
- package/dist/cjs/Card/Expiry.js.map +1 -1
- package/dist/cjs/Card/Meta.d.ts +2 -0
- package/dist/cjs/Card/Meta.js +2 -0
- package/dist/cjs/Card/Meta.js.map +1 -1
- package/dist/cjs/Card/Operation/Authorization.d.ts +14 -0
- package/dist/cjs/Card/Operation/Authorization.js +8 -0
- package/dist/cjs/Card/Operation/Authorization.js.map +1 -1
- package/dist/cjs/Card/Operation/Card.d.ts +194 -0
- package/dist/cjs/Card/Operation/Card.js +7 -0
- package/dist/cjs/Card/Operation/Card.js.map +1 -1
- package/dist/cjs/Card/Operation/index.d.ts +206 -0
- package/dist/cjs/Card/Operation/index.js +2 -0
- package/dist/cjs/Card/Operation/index.js.map +1 -1
- package/dist/cjs/Card/Preset.d.ts +19 -0
- package/dist/cjs/Card/Preset.js +2 -0
- package/dist/cjs/Card/Preset.js.map +1 -1
- package/dist/cjs/Card/Restriction/Merchant.d.ts +192 -0
- package/dist/cjs/Card/Restriction/Merchant.js +2 -0
- package/dist/cjs/Card/Restriction/Merchant.js.map +1 -1
- package/dist/cjs/Card/Restriction/index.d.ts +194 -0
- package/dist/cjs/Card/Restriction/index.js +2 -0
- package/dist/cjs/Card/Restriction/index.js.map +1 -1
- package/dist/cjs/Card/Scheme.d.ts +6 -0
- package/dist/cjs/Card/Scheme.js +2 -0
- package/dist/cjs/Card/Scheme.js.map +1 -1
- package/dist/cjs/Card/Stack.d.ts +21 -0
- package/dist/cjs/Card/Stack.js +4 -0
- package/dist/cjs/Card/Stack.js.map +1 -1
- package/dist/cjs/Card/index.d.ts +812 -0
- package/dist/cjs/Card/index.js +27 -0
- package/dist/cjs/Card/index.js.map +1 -1
- package/dist/cjs/Merchant/index.d.ts +11 -0
- package/dist/cjs/Merchant/index.js +11 -0
- package/dist/cjs/Merchant/index.js.map +1 -1
- package/dist/cjs/Operation/Status.d.ts +1 -1
- package/dist/cjs/Rail/Address/Card.d.ts +36 -0
- package/dist/cjs/Rail/Address/Card.js +17 -0
- package/dist/cjs/Rail/Address/Card.js.map +1 -1
- package/dist/cjs/Rail/Address/Iban.d.ts +8 -0
- package/dist/cjs/Rail/Address/Iban.js +8 -0
- package/dist/cjs/Rail/Address/Iban.js.map +1 -1
- package/dist/cjs/Rail/Address/PaxGiro.d.ts +5 -0
- package/dist/cjs/Rail/Address/PaxGiro.js +2 -0
- package/dist/cjs/Rail/Address/PaxGiro.js.map +1 -1
- package/dist/cjs/Rail/Address/Scan.d.ts +8 -0
- package/dist/cjs/Rail/Address/Scan.js +8 -0
- package/dist/cjs/Rail/Address/Scan.js.map +1 -1
- package/dist/cjs/Rail/Address/index.d.ts +55 -0
- package/dist/cjs/Rail/Address/index.js +9 -0
- package/dist/cjs/Rail/Address/index.js.map +1 -1
- package/dist/cjs/Rail/Address/internal.d.ts +7 -0
- package/dist/cjs/Rail/Address/internal.js +7 -0
- package/dist/cjs/Rail/Address/internal.js.map +1 -1
- package/dist/cjs/Supplier/index.d.ts +6 -0
- package/dist/cjs/Supplier/index.js +2 -0
- package/dist/cjs/Supplier/index.js.map +1 -1
- package/dist/mjs/Account/Charge/Fx/index.d.ts +21 -0
- package/dist/mjs/Account/Charge/Fx/index.js +1 -0
- package/dist/mjs/Account/Charge/Fx/index.js.map +1 -1
- package/dist/mjs/Account/Charge/Merchant/index.d.ts +217 -0
- package/dist/mjs/Account/Charge/Merchant/index.js +5 -0
- package/dist/mjs/Account/Charge/Merchant/index.js.map +1 -1
- package/dist/mjs/Account/Charge/Preset/index.d.ts +22 -0
- package/dist/mjs/Account/Charge/Preset/index.js +4 -0
- package/dist/mjs/Account/Charge/Preset/index.js.map +1 -1
- package/dist/mjs/Account/Charge/index.d.ts +240 -0
- package/dist/mjs/Account/Charge/index.js +5 -0
- package/dist/mjs/Account/Charge/index.js.map +1 -1
- package/dist/mjs/Account/Creatable.d.ts +12 -0
- package/dist/mjs/Account/Creatable.js +3 -0
- package/dist/mjs/Account/Creatable.js.map +1 -1
- package/dist/mjs/Account/Details.d.ts +432 -0
- package/dist/mjs/Account/Details.js +11 -0
- package/dist/mjs/Account/Details.js.map +1 -1
- package/dist/mjs/Account/History.d.ts +25 -0
- package/dist/mjs/Account/History.js +7 -0
- package/dist/mjs/Account/History.js.map +1 -1
- package/dist/mjs/Account/Status.d.ts +9 -0
- package/dist/mjs/Account/Status.js +5 -0
- package/dist/mjs/Account/Status.js.map +1 -1
- package/dist/mjs/Account/index.d.ts +752 -0
- package/dist/mjs/Account/index.js +13 -0
- package/dist/mjs/Account/index.js.map +1 -1
- package/dist/mjs/Acquirer/index.d.ts +8 -0
- package/dist/mjs/Acquirer/index.js +8 -0
- package/dist/mjs/Acquirer/index.js.map +1 -1
- package/dist/mjs/Amount.d.ts +182 -0
- package/dist/mjs/Amount.js +2 -0
- package/dist/mjs/Amount.js.map +1 -1
- package/dist/mjs/Balance.d.ts +41 -1
- package/dist/mjs/Balance.js +18 -1
- package/dist/mjs/Balance.js.map +1 -1
- package/dist/mjs/Balances.d.ts +193 -0
- package/dist/mjs/Balances.js +2 -0
- package/dist/mjs/Balances.js.map +1 -1
- package/dist/mjs/Card/Changeable.d.ts +185 -0
- package/dist/mjs/Card/Changeable.js +6 -0
- package/dist/mjs/Card/Changeable.js.map +1 -1
- package/dist/mjs/Card/Creatable.d.ts +406 -0
- package/dist/mjs/Card/Creatable.js +13 -0
- package/dist/mjs/Card/Creatable.js.map +1 -1
- package/dist/mjs/Card/Expiry.d.ts +2 -0
- package/dist/mjs/Card/Expiry.js +2 -0
- package/dist/mjs/Card/Expiry.js.map +1 -1
- package/dist/mjs/Card/Meta.d.ts +2 -0
- package/dist/mjs/Card/Meta.js +2 -0
- package/dist/mjs/Card/Meta.js.map +1 -1
- package/dist/mjs/Card/Operation/Authorization.d.ts +14 -0
- package/dist/mjs/Card/Operation/Authorization.js +8 -0
- package/dist/mjs/Card/Operation/Authorization.js.map +1 -1
- package/dist/mjs/Card/Operation/Card.d.ts +194 -0
- package/dist/mjs/Card/Operation/Card.js +7 -0
- package/dist/mjs/Card/Operation/Card.js.map +1 -1
- package/dist/mjs/Card/Operation/index.d.ts +206 -0
- package/dist/mjs/Card/Operation/index.js +2 -0
- package/dist/mjs/Card/Operation/index.js.map +1 -1
- package/dist/mjs/Card/Preset.d.ts +19 -0
- package/dist/mjs/Card/Preset.js +2 -0
- package/dist/mjs/Card/Preset.js.map +1 -1
- package/dist/mjs/Card/Restriction/Merchant.d.ts +192 -0
- package/dist/mjs/Card/Restriction/Merchant.js +2 -0
- package/dist/mjs/Card/Restriction/Merchant.js.map +1 -1
- package/dist/mjs/Card/Restriction/index.d.ts +194 -0
- package/dist/mjs/Card/Restriction/index.js +2 -0
- package/dist/mjs/Card/Restriction/index.js.map +1 -1
- package/dist/mjs/Card/Scheme.d.ts +6 -0
- package/dist/mjs/Card/Scheme.js +2 -0
- package/dist/mjs/Card/Scheme.js.map +1 -1
- package/dist/mjs/Card/Stack.d.ts +21 -0
- package/dist/mjs/Card/Stack.js +4 -0
- package/dist/mjs/Card/Stack.js.map +1 -1
- package/dist/mjs/Card/index.d.ts +812 -0
- package/dist/mjs/Card/index.js +27 -0
- package/dist/mjs/Card/index.js.map +1 -1
- package/dist/mjs/Merchant/index.d.ts +11 -0
- package/dist/mjs/Merchant/index.js +11 -0
- package/dist/mjs/Merchant/index.js.map +1 -1
- package/dist/mjs/Operation/Status.d.ts +1 -1
- package/dist/mjs/Rail/Address/Card.d.ts +36 -0
- package/dist/mjs/Rail/Address/Card.js +17 -0
- package/dist/mjs/Rail/Address/Card.js.map +1 -1
- package/dist/mjs/Rail/Address/Iban.d.ts +8 -0
- package/dist/mjs/Rail/Address/Iban.js +8 -0
- package/dist/mjs/Rail/Address/Iban.js.map +1 -1
- package/dist/mjs/Rail/Address/PaxGiro.d.ts +5 -0
- package/dist/mjs/Rail/Address/PaxGiro.js +2 -0
- package/dist/mjs/Rail/Address/PaxGiro.js.map +1 -1
- package/dist/mjs/Rail/Address/Scan.d.ts +8 -0
- package/dist/mjs/Rail/Address/Scan.js +8 -0
- package/dist/mjs/Rail/Address/Scan.js.map +1 -1
- package/dist/mjs/Rail/Address/index.d.ts +55 -0
- package/dist/mjs/Rail/Address/index.js +9 -0
- package/dist/mjs/Rail/Address/index.js.map +1 -1
- package/dist/mjs/Rail/Address/internal.d.ts +7 -0
- package/dist/mjs/Rail/Address/internal.js +7 -0
- package/dist/mjs/Rail/Address/internal.js.map +1 -1
- package/dist/mjs/Supplier/index.d.ts +6 -0
- package/dist/mjs/Supplier/index.js +2 -0
- package/dist/mjs/Supplier/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -3,6 +3,7 @@ import { isly } from "isly"
|
|
|
3
3
|
import { Card } from "../../../Card"
|
|
4
4
|
import { Rail } from "../../../Rail"
|
|
5
5
|
import { Amount } from "../../../Transaction/Amount"
|
|
6
|
+
import { zod } from "../../../zod"
|
|
6
7
|
import { Preset } from "../Preset"
|
|
7
8
|
|
|
8
9
|
export interface Merchant {
|
|
@@ -16,6 +17,10 @@ export namespace Merchant {
|
|
|
16
17
|
}),
|
|
17
18
|
merchants: isly.record<Card.Restriction.Merchant, Preset>(Card.Restriction.Merchant.type, Preset.type),
|
|
18
19
|
})
|
|
20
|
+
export const typeZod = zod.object({
|
|
21
|
+
destination: zod.object({ account: zod.string() }),
|
|
22
|
+
merchants: zod.partialRecord(Card.Restriction.Merchant.typeZod, Preset.typeZod),
|
|
23
|
+
})
|
|
19
24
|
|
|
20
25
|
export function evaluate(
|
|
21
26
|
charge: Merchant,
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { isly } from "isly"
|
|
2
2
|
import { Card } from "../../../Card"
|
|
3
|
+
import { zod } from "../../../zod"
|
|
3
4
|
|
|
4
5
|
export type Preset = Partial<Record<Card.Preset, number>> & {
|
|
5
6
|
default: number
|
|
@@ -12,4 +13,7 @@ export namespace Preset {
|
|
|
12
13
|
return defaultType.is(value) && recordType.is((({ default: _, ...rest }) => rest)(value))
|
|
13
14
|
}
|
|
14
15
|
export const type = isly.fromIs("Preset", is)
|
|
16
|
+
export const typeZod = zod
|
|
17
|
+
.partialRecord(zod.enum([...Card.Preset.names, "default"]), zod.number())
|
|
18
|
+
.and(zod.object({ default: zod.number() }))
|
|
15
19
|
}
|
package/Account/Charge/index.ts
CHANGED
|
@@ -3,6 +3,7 @@ import { isly } from "isly"
|
|
|
3
3
|
import type { Card } from "../../Card"
|
|
4
4
|
import type { Rail } from "../../Rail"
|
|
5
5
|
import type { Transaction } from "../../Transaction"
|
|
6
|
+
import { zod } from "../../zod"
|
|
6
7
|
import { Fx as ChargeFx } from "./Fx"
|
|
7
8
|
import { Merchant as ChargeMerchant } from "./Merchant"
|
|
8
9
|
|
|
@@ -11,6 +12,10 @@ export namespace Charge {
|
|
|
11
12
|
export import Merchant = ChargeMerchant
|
|
12
13
|
export import Fx = ChargeFx
|
|
13
14
|
export const type = isly.object<Charge>({ merchant: ChargeMerchant.type.optional(), fx: ChargeFx.type.optional() })
|
|
15
|
+
export const typeZod = zod.object({
|
|
16
|
+
merchant: ChargeMerchant.typeZod.optional(),
|
|
17
|
+
fx: ChargeFx.typeZod.optional(),
|
|
18
|
+
})
|
|
14
19
|
export function evaluate(
|
|
15
20
|
counterpart: Rail.Address.Card.Counterpart,
|
|
16
21
|
currency: isoly.Currency,
|
package/Account/Creatable.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { DurableObjectLocationHint } from "@cloudflare/workers-types" // TODO: REMOVE
|
|
2
2
|
import { isly } from "isly"
|
|
3
|
+
import { zod } from "../zod"
|
|
3
4
|
|
|
4
5
|
export interface Creatable {
|
|
5
6
|
name: string
|
|
@@ -14,6 +15,8 @@ export namespace Creatable {
|
|
|
14
15
|
}
|
|
15
16
|
// All location hints: ["wnam", "enam", "sam", "weur", "eeur", "apac", "oc", "afr", "me"]
|
|
16
17
|
export const type = isly.string(values)
|
|
18
|
+
export const typeZod = zod.enum(values)
|
|
17
19
|
}
|
|
18
20
|
export const type = isly.object<Creatable>({ name: isly.string(), location: Location.type.optional() })
|
|
21
|
+
export const typeZod = zod.object({ name: zod.string(), location: Location.typeZod.optional() })
|
|
19
22
|
}
|
package/Account/Details.ts
CHANGED
|
@@ -2,6 +2,7 @@ import { isoly } from "isoly"
|
|
|
2
2
|
import { isly } from "isly"
|
|
3
3
|
import { Rail } from "../Rail"
|
|
4
4
|
import { Supplier } from "../Supplier"
|
|
5
|
+
import { zod } from "../zod"
|
|
5
6
|
|
|
6
7
|
export interface Details {
|
|
7
8
|
supplier: Supplier
|
|
@@ -16,6 +17,12 @@ export namespace Details {
|
|
|
16
17
|
reference: isly.string().optional(),
|
|
17
18
|
addresses: Rail.Address.type.array(),
|
|
18
19
|
})
|
|
20
|
+
export const typeZod = zod.object({
|
|
21
|
+
supplier: Supplier.typeZod,
|
|
22
|
+
currencies: zod.array(zod.enum(isoly.Currency.values)),
|
|
23
|
+
reference: zod.string().optional(),
|
|
24
|
+
addresses: zod.array(Rail.Address.typeZod),
|
|
25
|
+
})
|
|
19
26
|
export interface Creatable {
|
|
20
27
|
supplier: Supplier
|
|
21
28
|
currency: isoly.Currency
|
|
@@ -25,5 +32,9 @@ export namespace Details {
|
|
|
25
32
|
supplier: Supplier.type,
|
|
26
33
|
currency: isly.string(isoly.Currency.values),
|
|
27
34
|
})
|
|
35
|
+
export const typeZod = zod.object({
|
|
36
|
+
supplier: Supplier.typeZod,
|
|
37
|
+
currency: zod.enum(isoly.Currency.values),
|
|
38
|
+
})
|
|
28
39
|
}
|
|
29
40
|
}
|
package/Account/History.ts
CHANGED
|
@@ -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 type History = {
|
|
5
6
|
timestamp: isoly.DateTime
|
|
@@ -21,10 +22,16 @@ export namespace History {
|
|
|
21
22
|
"listeners",
|
|
22
23
|
] as const
|
|
23
24
|
export const type = isly.string<Property>(values)
|
|
25
|
+
export const typeZod = zod.enum(values)
|
|
24
26
|
}
|
|
25
27
|
export const type = isly.object<History>({
|
|
26
28
|
timestamp: isly.fromIs("isoly.DateTime", isoly.DateTime.is),
|
|
27
29
|
property: Property.type,
|
|
28
30
|
to: isly.any().optional(),
|
|
29
31
|
})
|
|
32
|
+
export const typeZod = zod.object({
|
|
33
|
+
timestamp: zod.string().refine(isoly.DateTime.is),
|
|
34
|
+
property: Property.typeZod,
|
|
35
|
+
to: zod.any().optional(),
|
|
36
|
+
})
|
|
30
37
|
}
|
package/Account/Status.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { isly } from "isly"
|
|
2
|
+
import { zod } from "../zod"
|
|
2
3
|
|
|
3
4
|
export type Status = {
|
|
4
5
|
mode: Status.Mode
|
|
@@ -17,4 +18,8 @@ export namespace Status {
|
|
|
17
18
|
mode: isly.string<Mode>(Mode.values),
|
|
18
19
|
reason: isly.string().optional(),
|
|
19
20
|
})
|
|
21
|
+
export const typeZod = zod.object({
|
|
22
|
+
mode: zod.enum(Mode.values),
|
|
23
|
+
reason: zod.string().optional(),
|
|
24
|
+
})
|
|
20
25
|
}
|
package/Account/index.ts
CHANGED
|
@@ -4,6 +4,7 @@ import { isly } from "isly"
|
|
|
4
4
|
import { Balances } from "../Balances"
|
|
5
5
|
import { Rail } from "../Rail"
|
|
6
6
|
import { Rule } from "../Rule"
|
|
7
|
+
import { zod } from "../zod"
|
|
7
8
|
import { Charge as AccountCharge } from "./Charge"
|
|
8
9
|
import { Creatable as AccountCreatable } from "./Creatable"
|
|
9
10
|
import { Details as AccountDetails } from "./Details"
|
|
@@ -42,6 +43,18 @@ export namespace Account {
|
|
|
42
43
|
status: AccountStatus.type,
|
|
43
44
|
type: Type.type,
|
|
44
45
|
})
|
|
46
|
+
export const typeZod = Creatable.typeZod.extend({
|
|
47
|
+
id: zod.string(),
|
|
48
|
+
created: zod.string().refine(isoly.DateTime.is),
|
|
49
|
+
organization: zod.string(),
|
|
50
|
+
balances: Balances.typeZod,
|
|
51
|
+
rails: zod.array(Rail.Address.typeZod),
|
|
52
|
+
details: Details.typeZod.optional(),
|
|
53
|
+
charges: AccountCharge.typeZod.optional(),
|
|
54
|
+
rules: zod.array(zod.never()).optional(),
|
|
55
|
+
status: AccountStatus.typeZod,
|
|
56
|
+
type: Type.typeZod,
|
|
57
|
+
})
|
|
45
58
|
export function isIdentifier(value: cryptly.Identifier | any): value is cryptly.Identifier {
|
|
46
59
|
return cryptly.Identifier.is(value, 8)
|
|
47
60
|
}
|
package/Acquirer/index.ts
CHANGED
|
@@ -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 Acquirer {
|
|
5
6
|
id: string
|
|
@@ -16,4 +17,11 @@ export namespace Acquirer {
|
|
|
16
17
|
retrievalReferenceNumber: isly.string().optional(),
|
|
17
18
|
systemTraceAuditNumber: isly.string().optional(),
|
|
18
19
|
})
|
|
20
|
+
export const typeZod = zod.object({
|
|
21
|
+
id: zod.string(),
|
|
22
|
+
number: zod.string(),
|
|
23
|
+
country: zod.string().refine(isoly.CountryCode.Alpha2.is).optional(),
|
|
24
|
+
retrievalReferenceNumber: zod.string().optional(),
|
|
25
|
+
systemTraceAuditNumber: zod.string().optional(),
|
|
26
|
+
})
|
|
19
27
|
}
|
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
|
@@ -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
|
|
|
5
6
|
export type Balance = { available?: number; reserved?: Balance.Reserved }
|
|
6
7
|
export namespace Balance {
|
|
@@ -8,27 +9,42 @@ export namespace Balance {
|
|
|
8
9
|
export namespace Reserve {
|
|
9
10
|
export const values = ["incoming", "outgoing", "buffer"] as const
|
|
10
11
|
export const type = isly.string<Reserve>(values)
|
|
12
|
+
export const typeZod = zod.enum(values)
|
|
11
13
|
}
|
|
12
14
|
export type Reserved = Partial<Record<Balance.Reserve, number>>
|
|
13
15
|
export const type = isly.object<Balance>({
|
|
14
16
|
available: isly.number().optional(),
|
|
15
17
|
reserved: isly.record<Reserved>(Balance.Reserve.type, isly.number().optional()).optional(),
|
|
16
18
|
})
|
|
19
|
+
export const typeZod = zod.object({
|
|
20
|
+
available: zod.number().optional(),
|
|
21
|
+
reserved: zod.partialRecord(Balance.Reserve.typeZod, zod.number().optional()).optional(),
|
|
22
|
+
})
|
|
17
23
|
export type Legacy = Partial<Record<Legacy.Entry, number>>
|
|
18
24
|
export namespace Legacy {
|
|
19
25
|
export type Entry = (typeof Entry.values)[number]
|
|
20
26
|
export namespace Entry {
|
|
21
27
|
export const values = ["actual", "incomingReserved", "outgoingReserved", "bufferReserved"] as const
|
|
22
28
|
export const type = isly.string<Entry>(values)
|
|
29
|
+
export const typeZod = zod.enum(values)
|
|
23
30
|
}
|
|
24
31
|
export const type = isly.record<Legacy>(Entry.type, isly.number())
|
|
32
|
+
export const typeZod = zod.partialRecord(Entry.typeZod, zod.number())
|
|
25
33
|
}
|
|
26
34
|
export type MaybeLegacy = Balance | Legacy
|
|
27
35
|
export namespace MaybeLegacy {
|
|
28
36
|
export const legacyType = isly.union<MaybeLegacy>(type, Legacy.type)
|
|
29
37
|
}
|
|
30
38
|
export type Extended = Balance & Legacy
|
|
31
|
-
export
|
|
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
|
+
}
|
|
32
48
|
export function update(currency: isoly.Currency, balance: MaybeLegacy): Extended {
|
|
33
49
|
const result: Extended = { ...balance }
|
|
34
50
|
if (Legacy.type.is(balance)) {
|
package/Balances.ts
CHANGED
|
@@ -2,12 +2,14 @@ import { isoly } from "isoly"
|
|
|
2
2
|
import { isly } from "isly"
|
|
3
3
|
import { Amounts } from "./Amounts"
|
|
4
4
|
import { Balance as BalancesBalance } from "./Balance"
|
|
5
|
+
import { zod } from "./zod"
|
|
5
6
|
|
|
6
7
|
export type Balances = Partial<Record<isoly.Currency, Balances.Balance.Extended>>
|
|
7
8
|
|
|
8
9
|
export namespace Balances {
|
|
9
10
|
export import Balance = BalancesBalance
|
|
10
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.Extended.typeZod)
|
|
11
13
|
export function update(balances: Balances): Balances {
|
|
12
14
|
const result: Balances = {}
|
|
13
15
|
for (const [currency, balance] of Object.entries(balances)) {
|
package/Card/Changeable.ts
CHANGED
|
@@ -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/Expiry.ts
CHANGED
|
@@ -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
|
const year = [23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40] as const
|
|
5
6
|
type Year = (typeof year)[number]
|
|
@@ -10,6 +11,7 @@ type Month = (typeof month)[number]
|
|
|
10
11
|
export type Expiry = [Year, Month]
|
|
11
12
|
export namespace Expiry {
|
|
12
13
|
export const type = isly.tuple<Expiry>(isly.number([...year]), isly.number([...month])) // Deconstructing to remove readonly.
|
|
14
|
+
export const typeZod = zod.tuple([zod.literal([...year]), zod.literal([...month])])
|
|
13
15
|
export function toDateTime(expiry: Expiry): isoly.DateTime {
|
|
14
16
|
return isoly.DateTime.nextMonth(
|
|
15
17
|
"20" + expiry[0].toString() + "-" + expiry[1].toString().padStart(2, "0") + "-01T00:00:01.000Z"
|
package/Card/Meta.ts
CHANGED
|
@@ -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
|
}
|
package/Card/Operation/Card.ts
CHANGED
|
@@ -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
|
}
|
package/Card/Operation/index.ts
CHANGED
|
@@ -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
|
}
|
package/Card/Preset.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
|
import { Stack } from "./Stack"
|
|
4
5
|
|
|
5
6
|
export type Preset = (typeof Preset.names)[number]
|
|
@@ -25,6 +26,7 @@ export namespace Preset {
|
|
|
25
26
|
"test-diners-175",
|
|
26
27
|
] as const
|
|
27
28
|
export const type = isly.string<Preset>(names)
|
|
29
|
+
export const typeZod = zod.enum(names)
|
|
28
30
|
export const forRealm: Record<Realm, Preset[]> = {
|
|
29
31
|
test: ["test-pg-150", "test-pg-200", "test-ta-mc-200", "test-ta-pg-200", "test-ta-pg-bc-200", "test-diners-175"],
|
|
30
32
|
uk: [
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { isly } from "isly"
|
|
2
2
|
import { typedly } from "typedly"
|
|
3
3
|
import { Rail } from "../../Rail"
|
|
4
|
+
import { zod } from "../../zod"
|
|
4
5
|
import { merchants } from "./merchants"
|
|
5
6
|
import { Merchant as Attribute } from "./merchants/Merchant"
|
|
6
7
|
|
|
@@ -8,6 +9,7 @@ export type Merchant = (typeof Merchant.values)[number]
|
|
|
8
9
|
export namespace Merchant {
|
|
9
10
|
export const values = typedly.Object.keys(merchants)
|
|
10
11
|
export const type = isly.string<Merchant>(values)
|
|
12
|
+
export const typeZod = zod.enum(values)
|
|
11
13
|
export function check(merchant: Merchant, counterpart: Rail.Address.Card.Counterpart): boolean {
|
|
12
14
|
const attribute: Attribute = merchants[merchant]
|
|
13
15
|
let result: boolean
|
|
@@ -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/Scheme.ts
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { isly } from "isly"
|
|
2
|
+
import { zod } from "../zod"
|
|
2
3
|
|
|
3
4
|
export type Scheme = (typeof Scheme.schemes)[number]
|
|
4
5
|
export namespace Scheme {
|
|
5
6
|
export const schemes = ["mastercard", "diners", "visa"] as const
|
|
6
7
|
export const type = isly.string<Scheme>(schemes)
|
|
8
|
+
export const typeZod = zod.enum(schemes)
|
|
7
9
|
}
|
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),
|
package/Merchant/index.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { isoly } from "isoly"
|
|
2
2
|
import { isly } from "isly"
|
|
3
|
+
import { zod } from "../zod"
|
|
3
4
|
import { Category as MerchantCategory } from "./Category"
|
|
4
5
|
|
|
5
6
|
export interface Merchant {
|
|
@@ -24,4 +25,14 @@ export namespace Merchant {
|
|
|
24
25
|
state: isly.string().optional(),
|
|
25
26
|
country: isly.string(),
|
|
26
27
|
})
|
|
28
|
+
export const typeZod = zod.object({
|
|
29
|
+
name: zod.string(),
|
|
30
|
+
id: zod.string(),
|
|
31
|
+
category: zod.string(),
|
|
32
|
+
address: zod.string(),
|
|
33
|
+
city: zod.string(),
|
|
34
|
+
zip: zod.string(),
|
|
35
|
+
state: zod.string().optional(),
|
|
36
|
+
country: zod.string(),
|
|
37
|
+
})
|
|
27
38
|
}
|
package/Rail/Address/Card.ts
CHANGED
|
@@ -3,6 +3,7 @@ import { Acquirer } from "../../Acquirer"
|
|
|
3
3
|
import { Card as ModelCard } from "../../Card"
|
|
4
4
|
import { Merchant } from "../../Merchant"
|
|
5
5
|
import type { Rule } from "../../Rule"
|
|
6
|
+
import { zod } from "../../zod"
|
|
6
7
|
|
|
7
8
|
export interface Card {
|
|
8
9
|
type: "card"
|
|
@@ -28,6 +29,13 @@ namespace CardCounterpart {
|
|
|
28
29
|
present: isly.boolean().optional(),
|
|
29
30
|
approvalCode: isly.string().optional(),
|
|
30
31
|
})
|
|
32
|
+
export const typeZod = zod.object({
|
|
33
|
+
type: zod.literal("card"),
|
|
34
|
+
acquirer: Acquirer.typeZod,
|
|
35
|
+
merchant: Merchant.typeZod,
|
|
36
|
+
present: zod.boolean().optional(),
|
|
37
|
+
approvalCode: zod.string().optional(),
|
|
38
|
+
})
|
|
31
39
|
}
|
|
32
40
|
export namespace Card {
|
|
33
41
|
export const currencies = ["EUR", "GBP", "SEK", "USD"] as const
|
|
@@ -40,6 +48,15 @@ export namespace Card {
|
|
|
40
48
|
expiry: ModelCard.Expiry.type,
|
|
41
49
|
holder: isly.string(),
|
|
42
50
|
})
|
|
51
|
+
export const typeZod = zod.object({
|
|
52
|
+
type: zod.literal("card"),
|
|
53
|
+
scheme: ModelCard.Scheme.typeZod,
|
|
54
|
+
id: zod.string(),
|
|
55
|
+
iin: zod.string(),
|
|
56
|
+
last4: zod.string(),
|
|
57
|
+
expiry: ModelCard.Expiry.typeZod,
|
|
58
|
+
holder: zod.string(),
|
|
59
|
+
})
|
|
43
60
|
|
|
44
61
|
export function from(card: ModelCard | Rule.State.Card): Card {
|
|
45
62
|
return {
|
package/Rail/Address/Iban.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { isly } from "isly"
|
|
2
|
+
import { zod } from "../../zod"
|
|
2
3
|
|
|
3
4
|
export interface Iban {
|
|
4
5
|
type: "iban"
|
|
@@ -17,4 +18,11 @@ export namespace Iban {
|
|
|
17
18
|
institution: isly.string().optional(),
|
|
18
19
|
transactor: isly.string().optional(),
|
|
19
20
|
})
|
|
21
|
+
export const typeZod = zod.object({
|
|
22
|
+
type: zod.literal("iban"),
|
|
23
|
+
iban: zod.string(),
|
|
24
|
+
holder: zod.string(),
|
|
25
|
+
institution: zod.string().optional(),
|
|
26
|
+
transactor: zod.string().optional(),
|
|
27
|
+
})
|
|
20
28
|
}
|
package/Rail/Address/PaxGiro.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { cryptly } from "cryptly"
|
|
2
2
|
import { isly } from "isly"
|
|
3
|
+
import { zod } from "../../zod"
|
|
3
4
|
|
|
4
5
|
export interface PaxGiro {
|
|
5
6
|
type: "paxgiro"
|
|
@@ -8,4 +9,5 @@ export interface PaxGiro {
|
|
|
8
9
|
export namespace PaxGiro {
|
|
9
10
|
export const currencies = ["EUR", "GBP", "SEK", "USD"] as const
|
|
10
11
|
export const type = isly.object<PaxGiro>({ type: isly.string("paxgiro"), identifier: isly.string() })
|
|
12
|
+
export const typeZod = zod.object({ type: zod.literal("paxgiro"), identifier: zod.string() })
|
|
11
13
|
}
|
package/Rail/Address/Scan.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { isly } from "isly"
|
|
2
|
+
import { zod } from "../../zod"
|
|
2
3
|
import { Iban } from "./Iban"
|
|
3
4
|
|
|
4
5
|
//SCAN: Sort Code Account Number
|
|
@@ -27,4 +28,11 @@ export namespace Scan {
|
|
|
27
28
|
holder: isly.string(),
|
|
28
29
|
institution: isly.string().optional(),
|
|
29
30
|
})
|
|
31
|
+
export const typeZod = zod.object({
|
|
32
|
+
type: zod.literal("scan"),
|
|
33
|
+
sort: zod.string(),
|
|
34
|
+
account: zod.string(),
|
|
35
|
+
holder: zod.string(),
|
|
36
|
+
institution: zod.string().optional(),
|
|
37
|
+
})
|
|
30
38
|
}
|
package/Rail/Address/index.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
|
import { Card as AddressCard } from "./Card"
|
|
4
5
|
import { Iban as AddressIban } from "./Iban"
|
|
5
6
|
import { Internal as AddressInternal } from "./internal"
|
|
@@ -85,6 +86,14 @@ export namespace Address {
|
|
|
85
86
|
AddressPaxGiro.type,
|
|
86
87
|
AddressScan.type
|
|
87
88
|
)
|
|
89
|
+
export const typeZod = zod.union([
|
|
90
|
+
AddressCard.typeZod,
|
|
91
|
+
AddressCard.Counterpart.typeZod,
|
|
92
|
+
AddressIban.typeZod,
|
|
93
|
+
AddressInternal.typeZod,
|
|
94
|
+
AddressPaxGiro.typeZod,
|
|
95
|
+
AddressScan.typeZod,
|
|
96
|
+
])
|
|
88
97
|
|
|
89
98
|
export import PaxGiro = AddressPaxGiro
|
|
90
99
|
export import Iban = AddressIban
|