@pax2pay/model-banking 0.1.670 → 0.1.672
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/Creatable.ts +3 -1
- package/Account/Details.ts +12 -11
- package/Account/Type.ts +1 -1
- package/Account/index.ts +15 -13
- package/Acquirer/index.ts +3 -3
- package/Amount.ts +2 -3
- package/Amounts.ts +4 -3
- package/Balance.ts +18 -12
- package/Balances.ts +4 -3
- package/Card/Creatable.ts +12 -15
- package/Card/Preset.ts +1 -1
- package/Card/Restriction/Merchant.ts +1 -1
- package/Card/Restriction/index.ts +3 -1
- package/Card/Scheme.ts +1 -1
- package/Card/index.ts +28 -26
- package/Merchant/index.ts +2 -2
- package/Operation/Change.ts +8 -6
- package/Operation/Changes.ts +1 -1
- package/Operation/Creatable.ts +10 -8
- package/Operation/Status.ts +1 -1
- package/Operation/index.ts +9 -7
- package/Organization/Changeable.ts +3 -4
- package/Organization/Contact/Address/{General.ts → Default.ts} +10 -9
- package/Organization/Contact/Address/GB.ts +9 -8
- package/Organization/Contact/Address/SE.ts +3 -6
- package/Organization/Contact/Address/index.ts +4 -3
- package/Organization/Contact/Addresses.ts +8 -6
- package/Organization/Contact/Creatable.ts +9 -7
- package/Organization/Contact/Name.ts +1 -1
- package/Organization/Contact/Phone.ts +3 -3
- package/Organization/Contact/index.ts +2 -2
- package/Organization/Creatable.ts +9 -15
- package/Organization/Risk.ts +1 -2
- package/Organization/index.ts +15 -13
- package/Rail/Address/index.ts +11 -10
- package/Rule/index.ts +1 -1
- package/Settlement/Amount.ts +3 -4
- package/Settlement/Creatable.ts +9 -7
- package/Settlement/Entry/Creatable.ts +3 -1
- package/Settlement/Entry/index.ts +1 -1
- package/Settlement/Status.ts +3 -5
- package/Settlement/Total.ts +8 -6
- package/Settlement/Totals.ts +4 -2
- package/Settlement/index.ts +10 -8
- package/Supplier/index.ts +1 -1
- package/Transaction/Creatable.ts +20 -16
- package/Transaction/Exchange.ts +8 -6
- package/Transaction/Incoming.ts +2 -2
- package/Transaction/Note.ts +11 -10
- package/Transaction/PreTransaction/Base.ts +2 -2
- package/Transaction/PreTransaction/Incoming.ts +2 -2
- package/Transaction/Status.ts +3 -1
- package/Transaction/index.ts +33 -31
- package/Treasury/Snapshot/Account.ts +2 -2
- package/Treasury/Snapshot/Check/Base.ts +1 -4
- package/Treasury/Snapshot/Check/Checks.ts +1 -1
- package/Treasury/Snapshot/Check/index.ts +11 -9
- package/Treasury/Snapshot/Emoney.ts +2 -2
- package/Treasury/Snapshot/funding.ts +2 -2
- package/Treasury/Snapshot/index.ts +19 -20
- package/Treasury/Transaction/Creatable.ts +2 -2
- package/Warning/Issue.ts +2 -2
- package/Warning/Settlement/NegativeAmount.ts +2 -2
- package/Warning/Snapshot/DeltaFiat.ts +2 -2
- package/Warning/Snapshot/MissingBuffer.ts +2 -2
- package/Warning/Snapshot/MissingEmoney.ts +2 -2
- package/Warning/Snapshot/MissingFiat.ts +2 -2
- package/Warning/Snapshot/MissingTransaction.ts +2 -2
- package/Warning/Snapshot/Overdraft.ts +2 -2
- package/Warning/Snapshot/Reconciliation.ts +2 -2
- package/Warning/Snapshot/StaleFiat.ts +2 -2
- package/dist/cjs/Account/Creatable.js +3 -1
- package/dist/cjs/Account/Creatable.js.map +1 -1
- package/dist/cjs/Account/Details.d.ts +2 -688
- package/dist/cjs/Account/Details.js +9 -8
- package/dist/cjs/Account/Details.js.map +1 -1
- package/dist/cjs/Account/Type.js +1 -1
- package/dist/cjs/Account/Type.js.map +1 -1
- package/dist/cjs/Account/index.d.ts +5 -701
- package/dist/cjs/Account/index.js +7 -6
- package/dist/cjs/Account/index.js.map +1 -1
- package/dist/cjs/Acquirer/index.d.ts +1 -7
- package/dist/cjs/Acquirer/index.js +1 -1
- package/dist/cjs/Acquirer/index.js.map +1 -1
- package/dist/cjs/Amount.d.ts +1 -181
- package/dist/cjs/Amount.js +1 -1
- package/dist/cjs/Amount.js.map +1 -1
- package/dist/cjs/Amounts.js +3 -1
- package/dist/cjs/Amounts.js.map +1 -1
- package/dist/cjs/Backup/Rule.d.ts +1 -1
- package/dist/cjs/Balance.d.ts +9 -14
- package/dist/cjs/Balance.js +25 -15
- package/dist/cjs/Balance.js.map +1 -1
- package/dist/cjs/Balances.d.ts +1 -192
- package/dist/cjs/Balances.js +3 -1
- package/dist/cjs/Balances.js.map +1 -1
- package/dist/cjs/Card/Changeable.d.ts +1 -181
- package/dist/cjs/Card/Creatable.d.ts +1 -407
- package/dist/cjs/Card/Creatable.js +4 -5
- package/dist/cjs/Card/Creatable.js.map +1 -1
- package/dist/cjs/Card/Expiry.d.ts +1 -1
- package/dist/cjs/Card/Operation/Card.d.ts +1 -181
- package/dist/cjs/Card/Operation/index.d.ts +1 -181
- package/dist/cjs/Card/Preset.js +1 -1
- package/dist/cjs/Card/Preset.js.map +1 -1
- package/dist/cjs/Card/Restriction/Merchant.js +1 -1
- package/dist/cjs/Card/Restriction/Merchant.js.map +1 -1
- package/dist/cjs/Card/Restriction/index.d.ts +1 -193
- package/dist/cjs/Card/Restriction/index.js +3 -1
- package/dist/cjs/Card/Restriction/index.js.map +1 -1
- package/dist/cjs/Card/Scheme.js +1 -1
- package/dist/cjs/Card/Scheme.js.map +1 -1
- package/dist/cjs/Card/index.d.ts +1 -811
- package/dist/cjs/Card/index.js +7 -5
- package/dist/cjs/Card/index.js.map +1 -1
- package/dist/cjs/Merchant/index.js +1 -2
- package/dist/cjs/Merchant/index.js.map +1 -1
- package/dist/cjs/Operation/Change.js +4 -2
- package/dist/cjs/Operation/Change.js.map +1 -1
- package/dist/cjs/Operation/Changes.js +1 -1
- package/dist/cjs/Operation/Changes.js.map +1 -1
- package/dist/cjs/Operation/Creatable.js +5 -3
- package/dist/cjs/Operation/Creatable.js.map +1 -1
- package/dist/cjs/Operation/Status.js +1 -1
- package/dist/cjs/Operation/Status.js.map +1 -1
- package/dist/cjs/Operation/index.js +4 -2
- package/dist/cjs/Operation/index.js.map +1 -1
- package/dist/cjs/Organization/Changeable.d.ts +4 -90
- package/dist/cjs/Organization/Changeable.js +3 -4
- package/dist/cjs/Organization/Changeable.js.map +1 -1
- package/dist/cjs/Organization/Contact/Address/{General.d.ts → Default.d.ts} +1 -8
- package/dist/cjs/Organization/Contact/Address/{General.js → Default.js} +5 -3
- package/dist/cjs/Organization/Contact/Address/Default.js.map +1 -0
- package/dist/cjs/Organization/Contact/Address/GB.d.ts +1 -7
- package/dist/cjs/Organization/Contact/Address/GB.js +4 -2
- package/dist/cjs/Organization/Contact/Address/GB.js.map +1 -1
- package/dist/cjs/Organization/Contact/Address/SE.d.ts +1 -6
- package/dist/cjs/Organization/Contact/Address/SE.js +3 -6
- package/dist/cjs/Organization/Contact/Address/SE.js.map +1 -1
- package/dist/cjs/Organization/Contact/Address/index.d.ts +3 -21
- package/dist/cjs/Organization/Contact/Address/index.js +5 -3
- package/dist/cjs/Organization/Contact/Address/index.js.map +1 -1
- package/dist/cjs/Organization/Contact/Addresses.d.ts +1 -78
- package/dist/cjs/Organization/Contact/Addresses.js +4 -2
- package/dist/cjs/Organization/Contact/Addresses.js.map +1 -1
- package/dist/cjs/Organization/Contact/Creatable.d.ts +4 -90
- package/dist/cjs/Organization/Contact/Creatable.js +5 -3
- package/dist/cjs/Organization/Contact/Creatable.js.map +1 -1
- package/dist/cjs/Organization/Contact/Name.d.ts +1 -4
- package/dist/cjs/Organization/Contact/Name.js.map +1 -1
- package/dist/cjs/Organization/Contact/Phone.d.ts +1 -4
- package/dist/cjs/Organization/Contact/Phone.js +1 -1
- package/dist/cjs/Organization/Contact/Phone.js.map +1 -1
- package/dist/cjs/Organization/Contact/index.d.ts +1 -93
- package/dist/cjs/Organization/Contact/index.js +1 -1
- package/dist/cjs/Organization/Contact/index.js.map +1 -1
- package/dist/cjs/Organization/Creatable.d.ts +2 -112
- package/dist/cjs/Organization/Creatable.js +4 -7
- package/dist/cjs/Organization/Creatable.js.map +1 -1
- package/dist/cjs/Organization/Risk.js +1 -1
- package/dist/cjs/Organization/Risk.js.map +1 -1
- package/dist/cjs/Organization/index.d.ts +1 -121
- package/dist/cjs/Organization/index.js +7 -5
- package/dist/cjs/Organization/index.js.map +1 -1
- package/dist/cjs/Rail/Address/Card.d.ts +2 -8
- package/dist/cjs/Rail/Address/index.d.ts +2 -8
- package/dist/cjs/Rail/Address/index.js +4 -2
- package/dist/cjs/Rail/Address/index.js.map +1 -1
- package/dist/cjs/Rule/index.d.ts +1 -1
- package/dist/cjs/Settlement/Amount.js +3 -4
- package/dist/cjs/Settlement/Amount.js.map +1 -1
- package/dist/cjs/Settlement/Creatable.js +4 -2
- package/dist/cjs/Settlement/Creatable.js.map +1 -1
- package/dist/cjs/Settlement/Entry/Creatable.d.ts +3 -554
- package/dist/cjs/Settlement/Entry/Creatable.js +3 -1
- package/dist/cjs/Settlement/Entry/Creatable.js.map +1 -1
- package/dist/cjs/Settlement/Entry/index.js +1 -1
- package/dist/cjs/Settlement/Entry/index.js.map +1 -1
- package/dist/cjs/Settlement/Status.js +3 -4
- package/dist/cjs/Settlement/Status.js.map +1 -1
- package/dist/cjs/Settlement/Total.js +4 -2
- package/dist/cjs/Settlement/Total.js.map +1 -1
- package/dist/cjs/Settlement/Totals.js +3 -1
- package/dist/cjs/Settlement/Totals.js.map +1 -1
- package/dist/cjs/Settlement/index.js +4 -2
- package/dist/cjs/Settlement/index.js.map +1 -1
- package/dist/cjs/Supplier/index.js +1 -1
- package/dist/cjs/Supplier/index.js.map +1 -1
- package/dist/cjs/Transaction/Amount/index.d.ts +1 -366
- package/dist/cjs/Transaction/Creatable.d.ts +6 -748
- package/dist/cjs/Transaction/Creatable.js +9 -5
- package/dist/cjs/Transaction/Creatable.js.map +1 -1
- package/dist/cjs/Transaction/Exchange.d.ts +1 -366
- package/dist/cjs/Transaction/Exchange.js +4 -2
- package/dist/cjs/Transaction/Exchange.js.map +1 -1
- package/dist/cjs/Transaction/Note.js +7 -6
- package/dist/cjs/Transaction/Note.js.map +1 -1
- package/dist/cjs/Transaction/PreTransaction/Authorization.d.ts +3 -374
- package/dist/cjs/Transaction/PreTransaction/Base.d.ts +3 -374
- package/dist/cjs/Transaction/PreTransaction/Base.js +1 -1
- package/dist/cjs/Transaction/PreTransaction/Base.js.map +1 -1
- package/dist/cjs/Transaction/PreTransaction/Incoming.d.ts +5 -382
- package/dist/cjs/Transaction/PreTransaction/Incoming.js +1 -1
- package/dist/cjs/Transaction/PreTransaction/Incoming.js.map +1 -1
- package/dist/cjs/Transaction/PreTransaction/Outgoing.d.ts +3 -374
- package/dist/cjs/Transaction/PreTransaction/index.d.ts +11 -1130
- package/dist/cjs/Transaction/Status.js +3 -1
- package/dist/cjs/Transaction/Status.js.map +1 -1
- package/dist/cjs/Transaction/index.d.ts +23 -1160
- package/dist/cjs/Transaction/index.js +9 -7
- package/dist/cjs/Transaction/index.js.map +1 -1
- package/dist/cjs/Treasury/Snapshot/Account.js +1 -1
- package/dist/cjs/Treasury/Snapshot/Account.js.map +1 -1
- package/dist/cjs/Treasury/Snapshot/Check/Base.js +1 -4
- package/dist/cjs/Treasury/Snapshot/Check/Base.js.map +1 -1
- package/dist/cjs/Treasury/Snapshot/Check/Checks.js +1 -1
- package/dist/cjs/Treasury/Snapshot/Check/Checks.js.map +1 -1
- package/dist/cjs/Treasury/Snapshot/Check/index.js +4 -2
- package/dist/cjs/Treasury/Snapshot/Check/index.js.map +1 -1
- package/dist/cjs/Treasury/Snapshot/Emoney.js +1 -1
- package/dist/cjs/Treasury/Snapshot/Emoney.js.map +1 -1
- package/dist/cjs/Treasury/Snapshot/funding.js +1 -1
- package/dist/cjs/Treasury/Snapshot/funding.js.map +1 -1
- package/dist/cjs/Treasury/Snapshot/index.js +6 -7
- package/dist/cjs/Treasury/Snapshot/index.js.map +1 -1
- package/dist/cjs/Treasury/Transaction/Creatable.d.ts +2 -8
- package/dist/cjs/Treasury/Transaction/Creatable.js +1 -1
- package/dist/cjs/Treasury/Transaction/Creatable.js.map +1 -1
- package/dist/cjs/Warning/Issue.js +1 -1
- package/dist/cjs/Warning/Issue.js.map +1 -1
- package/dist/cjs/Warning/Settlement/NegativeAmount.js +1 -1
- package/dist/cjs/Warning/Settlement/NegativeAmount.js.map +1 -1
- package/dist/cjs/Warning/Snapshot/DeltaFiat.js +1 -2
- package/dist/cjs/Warning/Snapshot/DeltaFiat.js.map +1 -1
- package/dist/cjs/Warning/Snapshot/MissingBuffer.js +1 -1
- package/dist/cjs/Warning/Snapshot/MissingBuffer.js.map +1 -1
- package/dist/cjs/Warning/Snapshot/MissingEmoney.js +1 -2
- package/dist/cjs/Warning/Snapshot/MissingEmoney.js.map +1 -1
- package/dist/cjs/Warning/Snapshot/MissingFiat.js +1 -2
- package/dist/cjs/Warning/Snapshot/MissingFiat.js.map +1 -1
- package/dist/cjs/Warning/Snapshot/MissingTransaction.js +1 -2
- package/dist/cjs/Warning/Snapshot/MissingTransaction.js.map +1 -1
- package/dist/cjs/Warning/Snapshot/Overdraft.js +1 -1
- package/dist/cjs/Warning/Snapshot/Overdraft.js.map +1 -1
- package/dist/cjs/Warning/Snapshot/Reconciliation.js +1 -2
- package/dist/cjs/Warning/Snapshot/Reconciliation.js.map +1 -1
- package/dist/cjs/Warning/Snapshot/StaleFiat.js +1 -1
- package/dist/cjs/Warning/Snapshot/StaleFiat.js.map +1 -1
- package/dist/cjs/policy/Mcc/Action.js +1 -1
- package/dist/cjs/policy/Mcc/Action.js.map +1 -1
- package/dist/cjs/policy/Mcc/Creatable.js +4 -2
- package/dist/cjs/policy/Mcc/Creatable.js.map +1 -1
- package/dist/cjs/policy/Mcc/Group.js +6 -8
- package/dist/cjs/policy/Mcc/Group.js.map +1 -1
- package/dist/cjs/policy/Mcc/Updatable.js +3 -1
- package/dist/cjs/policy/Mcc/Updatable.js.map +1 -1
- package/dist/cjs/policy/Mcc/index.js +4 -2
- package/dist/cjs/policy/Mcc/index.js.map +1 -1
- package/dist/cjs/zod.d.ts +664 -0
- package/dist/cjs/zod.js +4 -0
- package/dist/cjs/zod.js.map +1 -1
- package/dist/mjs/Account/Creatable.js +3 -1
- package/dist/mjs/Account/Creatable.js.map +1 -1
- package/dist/mjs/Account/Details.d.ts +2 -688
- package/dist/mjs/Account/Details.js +10 -9
- package/dist/mjs/Account/Details.js.map +1 -1
- package/dist/mjs/Account/Type.js +1 -1
- package/dist/mjs/Account/Type.js.map +1 -1
- package/dist/mjs/Account/index.d.ts +5 -701
- package/dist/mjs/Account/index.js +7 -6
- package/dist/mjs/Account/index.js.map +1 -1
- package/dist/mjs/Acquirer/index.d.ts +1 -7
- package/dist/mjs/Acquirer/index.js +2 -2
- package/dist/mjs/Acquirer/index.js.map +1 -1
- package/dist/mjs/Amount.d.ts +1 -181
- package/dist/mjs/Amount.js +2 -2
- package/dist/mjs/Amount.js.map +1 -1
- package/dist/mjs/Amounts.js +4 -2
- package/dist/mjs/Amounts.js.map +1 -1
- package/dist/mjs/Backup/Rule.d.ts +1 -1
- package/dist/mjs/Balance.d.ts +9 -14
- package/dist/mjs/Balance.js +15 -8
- package/dist/mjs/Balance.js.map +1 -1
- package/dist/mjs/Balances.d.ts +1 -192
- package/dist/mjs/Balances.js +4 -2
- package/dist/mjs/Balances.js.map +1 -1
- package/dist/mjs/Card/Changeable.d.ts +1 -181
- package/dist/mjs/Card/Creatable.d.ts +1 -407
- package/dist/mjs/Card/Creatable.js +4 -5
- package/dist/mjs/Card/Creatable.js.map +1 -1
- package/dist/mjs/Card/Expiry.d.ts +1 -1
- package/dist/mjs/Card/Operation/Card.d.ts +1 -181
- package/dist/mjs/Card/Operation/index.d.ts +1 -181
- package/dist/mjs/Card/Preset.js +1 -1
- package/dist/mjs/Card/Preset.js.map +1 -1
- package/dist/mjs/Card/Restriction/Merchant.js +1 -1
- package/dist/mjs/Card/Restriction/Merchant.js.map +1 -1
- package/dist/mjs/Card/Restriction/index.d.ts +1 -193
- package/dist/mjs/Card/Restriction/index.js +3 -1
- package/dist/mjs/Card/Restriction/index.js.map +1 -1
- package/dist/mjs/Card/Scheme.js +1 -1
- package/dist/mjs/Card/Scheme.js.map +1 -1
- package/dist/mjs/Card/index.d.ts +1 -811
- package/dist/mjs/Card/index.js +7 -5
- package/dist/mjs/Card/index.js.map +1 -1
- package/dist/mjs/Merchant/index.js +2 -3
- package/dist/mjs/Merchant/index.js.map +1 -1
- package/dist/mjs/Operation/Change.js +4 -2
- package/dist/mjs/Operation/Change.js.map +1 -1
- package/dist/mjs/Operation/Changes.js +1 -1
- package/dist/mjs/Operation/Changes.js.map +1 -1
- package/dist/mjs/Operation/Creatable.js +6 -4
- package/dist/mjs/Operation/Creatable.js.map +1 -1
- package/dist/mjs/Operation/Status.js +1 -1
- package/dist/mjs/Operation/Status.js.map +1 -1
- package/dist/mjs/Operation/index.js +4 -2
- package/dist/mjs/Operation/index.js.map +1 -1
- package/dist/mjs/Organization/Changeable.d.ts +4 -90
- package/dist/mjs/Organization/Changeable.js +3 -4
- package/dist/mjs/Organization/Changeable.js.map +1 -1
- package/dist/mjs/Organization/Contact/Address/{General.d.ts → Default.d.ts} +1 -8
- package/dist/mjs/Organization/Contact/Address/{General.js → Default.js} +5 -3
- package/dist/mjs/Organization/Contact/Address/Default.js.map +1 -0
- package/dist/mjs/Organization/Contact/Address/GB.d.ts +1 -7
- package/dist/mjs/Organization/Contact/Address/GB.js +4 -2
- package/dist/mjs/Organization/Contact/Address/GB.js.map +1 -1
- package/dist/mjs/Organization/Contact/Address/SE.d.ts +1 -6
- package/dist/mjs/Organization/Contact/Address/SE.js +3 -6
- package/dist/mjs/Organization/Contact/Address/SE.js.map +1 -1
- package/dist/mjs/Organization/Contact/Address/index.d.ts +3 -21
- package/dist/mjs/Organization/Contact/Address/index.js +4 -2
- package/dist/mjs/Organization/Contact/Address/index.js.map +1 -1
- package/dist/mjs/Organization/Contact/Addresses.d.ts +1 -78
- package/dist/mjs/Organization/Contact/Addresses.js +4 -2
- package/dist/mjs/Organization/Contact/Addresses.js.map +1 -1
- package/dist/mjs/Organization/Contact/Creatable.d.ts +4 -90
- package/dist/mjs/Organization/Contact/Creatable.js +5 -3
- package/dist/mjs/Organization/Contact/Creatable.js.map +1 -1
- package/dist/mjs/Organization/Contact/Name.d.ts +1 -4
- package/dist/mjs/Organization/Contact/Name.js.map +1 -1
- package/dist/mjs/Organization/Contact/Phone.d.ts +1 -4
- package/dist/mjs/Organization/Contact/Phone.js +2 -2
- package/dist/mjs/Organization/Contact/Phone.js.map +1 -1
- package/dist/mjs/Organization/Contact/index.d.ts +1 -93
- package/dist/mjs/Organization/Contact/index.js +1 -1
- package/dist/mjs/Organization/Contact/index.js.map +1 -1
- package/dist/mjs/Organization/Creatable.d.ts +2 -112
- package/dist/mjs/Organization/Creatable.js +4 -7
- package/dist/mjs/Organization/Creatable.js.map +1 -1
- package/dist/mjs/Organization/Risk.js +1 -1
- package/dist/mjs/Organization/Risk.js.map +1 -1
- package/dist/mjs/Organization/index.d.ts +1 -121
- package/dist/mjs/Organization/index.js +7 -5
- package/dist/mjs/Organization/index.js.map +1 -1
- package/dist/mjs/Rail/Address/Card.d.ts +2 -8
- package/dist/mjs/Rail/Address/index.d.ts +2 -8
- package/dist/mjs/Rail/Address/index.js +4 -2
- package/dist/mjs/Rail/Address/index.js.map +1 -1
- package/dist/mjs/Rule/index.d.ts +1 -1
- package/dist/mjs/Settlement/Amount.js +3 -4
- package/dist/mjs/Settlement/Amount.js.map +1 -1
- package/dist/mjs/Settlement/Creatable.js +4 -2
- package/dist/mjs/Settlement/Creatable.js.map +1 -1
- package/dist/mjs/Settlement/Entry/Creatable.d.ts +3 -554
- package/dist/mjs/Settlement/Entry/Creatable.js +3 -1
- package/dist/mjs/Settlement/Entry/Creatable.js.map +1 -1
- package/dist/mjs/Settlement/Entry/index.js +1 -1
- package/dist/mjs/Settlement/Entry/index.js.map +1 -1
- package/dist/mjs/Settlement/Status.js +3 -4
- package/dist/mjs/Settlement/Status.js.map +1 -1
- package/dist/mjs/Settlement/Total.js +4 -2
- package/dist/mjs/Settlement/Total.js.map +1 -1
- package/dist/mjs/Settlement/Totals.js +4 -2
- package/dist/mjs/Settlement/Totals.js.map +1 -1
- package/dist/mjs/Settlement/index.js +4 -2
- package/dist/mjs/Settlement/index.js.map +1 -1
- package/dist/mjs/Supplier/index.js +1 -1
- package/dist/mjs/Supplier/index.js.map +1 -1
- package/dist/mjs/Transaction/Amount/index.d.ts +1 -366
- package/dist/mjs/Transaction/Creatable.d.ts +6 -748
- package/dist/mjs/Transaction/Creatable.js +10 -6
- package/dist/mjs/Transaction/Creatable.js.map +1 -1
- package/dist/mjs/Transaction/Exchange.d.ts +1 -366
- package/dist/mjs/Transaction/Exchange.js +4 -2
- package/dist/mjs/Transaction/Exchange.js.map +1 -1
- package/dist/mjs/Transaction/Note.js +7 -6
- package/dist/mjs/Transaction/Note.js.map +1 -1
- package/dist/mjs/Transaction/PreTransaction/Authorization.d.ts +3 -374
- package/dist/mjs/Transaction/PreTransaction/Base.d.ts +3 -374
- package/dist/mjs/Transaction/PreTransaction/Base.js +2 -2
- package/dist/mjs/Transaction/PreTransaction/Base.js.map +1 -1
- package/dist/mjs/Transaction/PreTransaction/Incoming.d.ts +5 -382
- package/dist/mjs/Transaction/PreTransaction/Incoming.js +2 -2
- package/dist/mjs/Transaction/PreTransaction/Incoming.js.map +1 -1
- package/dist/mjs/Transaction/PreTransaction/Outgoing.d.ts +3 -374
- package/dist/mjs/Transaction/PreTransaction/index.d.ts +11 -1130
- package/dist/mjs/Transaction/Status.js +3 -1
- package/dist/mjs/Transaction/Status.js.map +1 -1
- package/dist/mjs/Transaction/index.d.ts +23 -1160
- package/dist/mjs/Transaction/index.js +10 -8
- package/dist/mjs/Transaction/index.js.map +1 -1
- package/dist/mjs/Treasury/Snapshot/Account.js +2 -2
- package/dist/mjs/Treasury/Snapshot/Account.js.map +1 -1
- package/dist/mjs/Treasury/Snapshot/Check/Base.js +1 -4
- package/dist/mjs/Treasury/Snapshot/Check/Base.js.map +1 -1
- package/dist/mjs/Treasury/Snapshot/Check/Checks.js +1 -1
- package/dist/mjs/Treasury/Snapshot/Check/Checks.js.map +1 -1
- package/dist/mjs/Treasury/Snapshot/Check/index.js +4 -2
- package/dist/mjs/Treasury/Snapshot/Check/index.js.map +1 -1
- package/dist/mjs/Treasury/Snapshot/Emoney.js +2 -2
- package/dist/mjs/Treasury/Snapshot/Emoney.js.map +1 -1
- package/dist/mjs/Treasury/Snapshot/funding.js +2 -2
- package/dist/mjs/Treasury/Snapshot/funding.js.map +1 -1
- package/dist/mjs/Treasury/Snapshot/index.js +7 -8
- package/dist/mjs/Treasury/Snapshot/index.js.map +1 -1
- package/dist/mjs/Treasury/Transaction/Creatable.d.ts +2 -8
- package/dist/mjs/Treasury/Transaction/Creatable.js +2 -2
- package/dist/mjs/Treasury/Transaction/Creatable.js.map +1 -1
- package/dist/mjs/Warning/Issue.js +2 -2
- package/dist/mjs/Warning/Issue.js.map +1 -1
- package/dist/mjs/Warning/Settlement/NegativeAmount.js +2 -2
- package/dist/mjs/Warning/Settlement/NegativeAmount.js.map +1 -1
- package/dist/mjs/Warning/Snapshot/DeltaFiat.js +2 -3
- package/dist/mjs/Warning/Snapshot/DeltaFiat.js.map +1 -1
- package/dist/mjs/Warning/Snapshot/MissingBuffer.js +2 -2
- package/dist/mjs/Warning/Snapshot/MissingBuffer.js.map +1 -1
- package/dist/mjs/Warning/Snapshot/MissingEmoney.js +2 -3
- package/dist/mjs/Warning/Snapshot/MissingEmoney.js.map +1 -1
- package/dist/mjs/Warning/Snapshot/MissingFiat.js +2 -3
- package/dist/mjs/Warning/Snapshot/MissingFiat.js.map +1 -1
- package/dist/mjs/Warning/Snapshot/MissingTransaction.js +2 -3
- package/dist/mjs/Warning/Snapshot/MissingTransaction.js.map +1 -1
- package/dist/mjs/Warning/Snapshot/Overdraft.js +2 -2
- package/dist/mjs/Warning/Snapshot/Overdraft.js.map +1 -1
- package/dist/mjs/Warning/Snapshot/Reconciliation.js +2 -3
- package/dist/mjs/Warning/Snapshot/Reconciliation.js.map +1 -1
- package/dist/mjs/Warning/Snapshot/StaleFiat.js +2 -2
- package/dist/mjs/Warning/Snapshot/StaleFiat.js.map +1 -1
- package/dist/mjs/policy/Mcc/Action.js +1 -1
- package/dist/mjs/policy/Mcc/Action.js.map +1 -1
- package/dist/mjs/policy/Mcc/Creatable.js +4 -2
- package/dist/mjs/policy/Mcc/Creatable.js.map +1 -1
- package/dist/mjs/policy/Mcc/Group.js +6 -8
- package/dist/mjs/policy/Mcc/Group.js.map +1 -1
- package/dist/mjs/policy/Mcc/Updatable.js +3 -1
- package/dist/mjs/policy/Mcc/Updatable.js.map +1 -1
- package/dist/mjs/policy/Mcc/index.js +4 -2
- package/dist/mjs/policy/Mcc/index.js.map +1 -1
- package/dist/mjs/zod.d.ts +664 -0
- package/dist/mjs/zod.js +4 -0
- package/dist/mjs/zod.js.map +1 -1
- package/package.json +1 -1
- package/policy/Mcc/Action.ts +1 -1
- package/policy/Mcc/Creatable.ts +10 -8
- package/policy/Mcc/Group.ts +6 -8
- package/policy/Mcc/Updatable.ts +3 -1
- package/policy/Mcc/index.ts +8 -6
- package/zod.ts +4 -0
- package/dist/cjs/Organization/Contact/Address/General.js.map +0 -1
- package/dist/mjs/Organization/Contact/Address/General.js.map +0 -1
package/Account/Creatable.ts
CHANGED
|
@@ -18,5 +18,7 @@ export namespace Creatable {
|
|
|
18
18
|
export const typeZod = zod.enum(values)
|
|
19
19
|
}
|
|
20
20
|
export const type = isly.object<Creatable>({ name: isly.string(), location: Location.type.optional() })
|
|
21
|
-
export const typeZod = zod
|
|
21
|
+
export const typeZod = zod
|
|
22
|
+
.object({ name: zod.string(), location: Location.typeZod.optional() })
|
|
23
|
+
.meta({ id: "Account.Creatable" })
|
|
22
24
|
}
|
package/Account/Details.ts
CHANGED
|
@@ -2,7 +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
|
+
import { zod, zodHelper } from "../zod"
|
|
6
6
|
|
|
7
7
|
export interface Details {
|
|
8
8
|
supplier: Supplier
|
|
@@ -17,12 +17,14 @@ export namespace Details {
|
|
|
17
17
|
reference: isly.string().optional(),
|
|
18
18
|
addresses: Rail.Address.type.array(),
|
|
19
19
|
})
|
|
20
|
-
export const typeZod = zod
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
20
|
+
export const typeZod: zod.ZodType<Details> = zod
|
|
21
|
+
.object({
|
|
22
|
+
supplier: Supplier.typeZod,
|
|
23
|
+
currencies: zodHelper.currency.array(),
|
|
24
|
+
reference: zod.string().optional(),
|
|
25
|
+
addresses: Rail.Address.typeZod.array(),
|
|
26
|
+
})
|
|
27
|
+
.meta({ id: "Account.Details" })
|
|
26
28
|
export interface Creatable {
|
|
27
29
|
supplier: Supplier
|
|
28
30
|
currency: isoly.Currency
|
|
@@ -32,9 +34,8 @@ export namespace Details {
|
|
|
32
34
|
supplier: Supplier.type,
|
|
33
35
|
currency: isly.string(isoly.Currency.values),
|
|
34
36
|
})
|
|
35
|
-
export const typeZod = zod
|
|
36
|
-
supplier: Supplier.typeZod,
|
|
37
|
-
|
|
38
|
-
})
|
|
37
|
+
export const typeZod: zod.ZodType<Creatable> = zod
|
|
38
|
+
.object({ supplier: Supplier.typeZod, currency: zodHelper.currency })
|
|
39
|
+
.meta({ id: "Account.Details.Creatable" })
|
|
39
40
|
}
|
|
40
41
|
}
|
package/Account/Type.ts
CHANGED
|
@@ -5,5 +5,5 @@ export type Type = (typeof Type.values)[number]
|
|
|
5
5
|
export namespace Type {
|
|
6
6
|
export const values = ["own funds", "emoney"] as const
|
|
7
7
|
export const type = isly.string<Type>(values)
|
|
8
|
-
export const typeZod = zod.enum(values)
|
|
8
|
+
export const typeZod = zod.enum(values).meta({ id: "Account.Type" })
|
|
9
9
|
}
|
package/Account/index.ts
CHANGED
|
@@ -39,22 +39,24 @@ export namespace Account {
|
|
|
39
39
|
rails: Rail.Address.type.array(),
|
|
40
40
|
details: Details.type.optional(),
|
|
41
41
|
charges: AccountCharge.type.optional(),
|
|
42
|
-
rules:
|
|
42
|
+
rules: isly.any().array().optional(),
|
|
43
43
|
status: AccountStatus.type,
|
|
44
44
|
type: Type.type,
|
|
45
45
|
})
|
|
46
|
-
export const typeZod = Creatable.typeZod
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
46
|
+
export const typeZod = Creatable.typeZod
|
|
47
|
+
.extend({
|
|
48
|
+
id: zod.string(),
|
|
49
|
+
created: zod.string().refine(isoly.DateTime.is),
|
|
50
|
+
organization: zod.string(),
|
|
51
|
+
balances: Balances.typeZod,
|
|
52
|
+
rails: Rail.Address.typeZod.array(),
|
|
53
|
+
details: Details.typeZod.optional(),
|
|
54
|
+
charges: AccountCharge.typeZod.optional(),
|
|
55
|
+
rules: zod.any().array().optional(),
|
|
56
|
+
status: AccountStatus.typeZod,
|
|
57
|
+
type: Type.typeZod,
|
|
58
|
+
})
|
|
59
|
+
.meta({ id: "Account" })
|
|
58
60
|
export function isIdentifier(value: cryptly.Identifier | any): value is cryptly.Identifier {
|
|
59
61
|
return cryptly.Identifier.is(value, 8)
|
|
60
62
|
}
|
package/Acquirer/index.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { isoly } from "isoly"
|
|
2
2
|
import { isly } from "isly"
|
|
3
|
-
import { zod } from "../zod"
|
|
3
|
+
import { zod, zodHelper } from "../zod"
|
|
4
4
|
|
|
5
5
|
export interface Acquirer {
|
|
6
6
|
id: string
|
|
@@ -17,10 +17,10 @@ export namespace Acquirer {
|
|
|
17
17
|
retrievalReferenceNumber: isly.string().optional(),
|
|
18
18
|
systemTraceAuditNumber: isly.string().optional(),
|
|
19
19
|
})
|
|
20
|
-
export const typeZod = zod.object({
|
|
20
|
+
export const typeZod: zod.ZodType<Acquirer> = zod.object({
|
|
21
21
|
id: zod.string(),
|
|
22
22
|
number: zod.string(),
|
|
23
|
-
country:
|
|
23
|
+
country: zodHelper.countryCode.optional(),
|
|
24
24
|
retrievalReferenceNumber: zod.string().optional(),
|
|
25
25
|
systemTraceAuditNumber: zod.string().optional(),
|
|
26
26
|
})
|
package/Amount.ts
CHANGED
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
import { isoly } from "isoly"
|
|
2
2
|
import { isly } from "isly"
|
|
3
3
|
import { Amounts } from "./Amounts"
|
|
4
|
-
import { zod } from "./zod"
|
|
4
|
+
import { zod, zodHelper } from "./zod"
|
|
5
5
|
|
|
6
6
|
export type Amount = [isoly.Currency, number]
|
|
7
|
-
|
|
8
7
|
export namespace Amount {
|
|
9
8
|
export function toAmounts(amount?: Amount): Amounts {
|
|
10
9
|
return !amount ? {} : Object.fromEntries<number>([amount])
|
|
11
10
|
}
|
|
12
11
|
export const type = isly.tuple<Amount>(isly.string(isoly.Currency.values), isly.number())
|
|
13
|
-
export const typeZod = zod.tuple([
|
|
12
|
+
export const typeZod: zod.ZodType<Amount> = zod.tuple([zodHelper.currency, zod.number()]).meta({ id: "Amount" })
|
|
14
13
|
}
|
package/Amounts.ts
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import { isoly } from "isoly"
|
|
2
2
|
import { isly } from "isly"
|
|
3
|
-
import { zod } from "./zod"
|
|
3
|
+
import { zod, zodHelper } from "./zod"
|
|
4
4
|
|
|
5
5
|
export type Amounts = Partial<Record<isoly.Currency, number>>
|
|
6
|
-
|
|
7
6
|
export namespace Amounts {
|
|
8
7
|
export function add(addendee: Amounts, addend: Amounts): Amounts {
|
|
9
8
|
return (Object.entries(addend) as [isoly.Currency, number][]).reduce(
|
|
@@ -20,5 +19,7 @@ export namespace Amounts {
|
|
|
20
19
|
)
|
|
21
20
|
}
|
|
22
21
|
export const type = isly.record<Amounts>(isly.string(isoly.Currency.values), isly.number())
|
|
23
|
-
export const typeZod: zod.ZodType<Amounts> = zod
|
|
22
|
+
export const typeZod: zod.ZodType<Amounts> = zod
|
|
23
|
+
.partialRecord(zodHelper.currency, zod.number())
|
|
24
|
+
.meta({ id: "Amounts" })
|
|
24
25
|
}
|
package/Balance.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { isoly } from "isoly"
|
|
2
2
|
import { isly } from "isly"
|
|
3
|
+
import zod from "zod"
|
|
3
4
|
import { Amount } from "./Amount"
|
|
4
|
-
import { zod } from "./zod"
|
|
5
5
|
|
|
6
6
|
export type Balance = { available?: number; reserved?: Balance.Reserved }
|
|
7
7
|
export namespace Balance {
|
|
@@ -12,14 +12,18 @@ export namespace Balance {
|
|
|
12
12
|
export const typeZod = zod.enum(values)
|
|
13
13
|
}
|
|
14
14
|
export type Reserved = Partial<Record<Balance.Reserve, number>>
|
|
15
|
+
export namespace Reserved {
|
|
16
|
+
export const typeZod: zod.ZodType<Reserved> = zod
|
|
17
|
+
.partialRecord(Reserve.typeZod, zod.number())
|
|
18
|
+
.meta({ id: "Balance.Reserved" })
|
|
19
|
+
}
|
|
15
20
|
export const type = isly.object<Balance>({
|
|
16
21
|
available: isly.number().optional(),
|
|
17
|
-
reserved: isly.record<Reserved>(
|
|
18
|
-
})
|
|
19
|
-
export const typeZod = zod.object({
|
|
20
|
-
available: zod.number().optional(),
|
|
21
|
-
reserved: zod.partialRecord(Balance.Reserve.typeZod, zod.number().optional()).optional(),
|
|
22
|
+
reserved: isly.record<Reserved>(Reserve.type, isly.number().optional()).optional(),
|
|
22
23
|
})
|
|
24
|
+
export const typeZod = zod
|
|
25
|
+
.object({ available: zod.number().optional(), reserved: Reserved.typeZod.optional() })
|
|
26
|
+
.meta({ id: "Balance" })
|
|
23
27
|
export type Legacy = Partial<Record<Legacy.Entry, number>>
|
|
24
28
|
export namespace Legacy {
|
|
25
29
|
export type Entry = (typeof Entry.values)[number]
|
|
@@ -38,12 +42,14 @@ export namespace Balance {
|
|
|
38
42
|
export type Extended = Balance & Legacy
|
|
39
43
|
export namespace Extended {
|
|
40
44
|
export const type = isly.intersection<Extended, Balance, Legacy>(Balance.type, Legacy.type)
|
|
41
|
-
export const typeZod = Balance.typeZod
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
45
|
+
export const typeZod = Balance.typeZod
|
|
46
|
+
.extend({
|
|
47
|
+
actual: zod.number().optional(),
|
|
48
|
+
incomingReserved: zod.number().optional(),
|
|
49
|
+
outgoingReserved: zod.number().optional(),
|
|
50
|
+
bufferReserved: zod.number().optional(),
|
|
51
|
+
})
|
|
52
|
+
.meta({ id: "Balance.Extended" })
|
|
47
53
|
}
|
|
48
54
|
export function update(currency: isoly.Currency, balance: MaybeLegacy): Extended {
|
|
49
55
|
const result: Extended = { ...balance }
|
package/Balances.ts
CHANGED
|
@@ -2,14 +2,15 @@ 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
|
+
import { zod, zodHelper } from "./zod"
|
|
6
6
|
|
|
7
7
|
export type Balances = Partial<Record<isoly.Currency, Balances.Balance.Extended>>
|
|
8
|
-
|
|
9
8
|
export namespace Balances {
|
|
10
9
|
export import Balance = BalancesBalance
|
|
11
10
|
export const type = isly.record<Balances>(isly.fromIs("isoly.Currency", isoly.Currency.is), Balances.Balance.type)
|
|
12
|
-
export const typeZod = zod
|
|
11
|
+
export const typeZod: zod.ZodType<Balances> = zod
|
|
12
|
+
.partialRecord(zodHelper.currency, Balances.Balance.Extended.typeZod)
|
|
13
|
+
.meta({ id: "Balances" })
|
|
13
14
|
export function update(balances: Balances): Balances {
|
|
14
15
|
const result: Balances = {}
|
|
15
16
|
for (const [currency, balance] of Object.entries(balances)) {
|
package/Card/Creatable.ts
CHANGED
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import { isoly } from "isoly"
|
|
2
2
|
import { isly } from "isly"
|
|
3
3
|
import { Amount } from "../Amount"
|
|
4
|
-
import type { Rule } from "../Rule"
|
|
5
|
-
import { type as ruleType } from "../Rule/type"
|
|
6
4
|
import { zod } from "../zod"
|
|
7
5
|
import { Expiry } from "./Expiry"
|
|
8
6
|
import { Meta } from "./Meta"
|
|
@@ -18,7 +16,6 @@ export interface Creatable {
|
|
|
18
16
|
holder: string
|
|
19
17
|
}
|
|
20
18
|
limit: Amount
|
|
21
|
-
rules?: Rule[]
|
|
22
19
|
meta?: Meta
|
|
23
20
|
key?: isoly.Date | string
|
|
24
21
|
restricted?: { to?: Restriction }
|
|
@@ -31,20 +28,20 @@ export namespace Creatable {
|
|
|
31
28
|
preset: Preset.type,
|
|
32
29
|
details: isly.object({ expiry: Expiry.type, holder: isly.string() }),
|
|
33
30
|
limit: isly.tuple(isly.fromIs("isoly.Currency", isoly.Currency.is), isly.number()),
|
|
34
|
-
rules: ruleType.array().optional(),
|
|
35
31
|
meta: isly.fromIs("Card.Meta", Meta.is).optional(),
|
|
36
32
|
key: isly.string().optional(),
|
|
37
33
|
restricted: isly.object<Required<Creatable>["restricted"]>({ to: Restriction.type.optional() }).optional(),
|
|
38
34
|
})
|
|
39
|
-
export const typeZod = zod
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
35
|
+
export const typeZod: zod.ZodType<Creatable> = zod
|
|
36
|
+
.object({
|
|
37
|
+
account: zod.string(),
|
|
38
|
+
number: zod.string().optional(),
|
|
39
|
+
preset: Preset.typeZod,
|
|
40
|
+
details: zod.object({ expiry: Expiry.typeZod, holder: zod.string() }),
|
|
41
|
+
limit: Amount.typeZod,
|
|
42
|
+
meta: Meta.typeZod.optional(),
|
|
43
|
+
key: zod.string().optional(),
|
|
44
|
+
restricted: zod.object({ to: Restriction.typeZod.optional() }).optional(),
|
|
45
|
+
})
|
|
46
|
+
.meta({ id: "Card.Creatable" })
|
|
50
47
|
}
|
package/Card/Preset.ts
CHANGED
|
@@ -26,7 +26,7 @@ export namespace Preset {
|
|
|
26
26
|
"test-diners-175",
|
|
27
27
|
] as const
|
|
28
28
|
export const type = isly.string<Preset>(names)
|
|
29
|
-
export const typeZod = zod.enum(names)
|
|
29
|
+
export const typeZod = zod.enum(names).meta({ id: "Card.Preset" })
|
|
30
30
|
export const forRealm: Record<Realm, Preset[]> = {
|
|
31
31
|
test: ["test-pg-150", "test-pg-200", "test-ta-mc-200", "test-ta-pg-200", "test-ta-pg-bc-200", "test-diners-175"],
|
|
32
32
|
uk: [
|
|
@@ -9,7 +9,7 @@ export type Merchant = (typeof Merchant.values)[number]
|
|
|
9
9
|
export namespace Merchant {
|
|
10
10
|
export const values = typedly.Object.keys(merchants)
|
|
11
11
|
export const type = isly.string<Merchant>(values)
|
|
12
|
-
export const typeZod = zod.enum(values)
|
|
12
|
+
export const typeZod = zod.enum(values).meta({ id: "Card.Restriction.Merchant" })
|
|
13
13
|
export function check(merchant: Merchant, counterpart: Rail.Address.Card.Counterpart): boolean {
|
|
14
14
|
const attribute: Attribute = merchants[merchant]
|
|
15
15
|
let result: boolean
|
|
@@ -9,7 +9,9 @@ export interface Restriction {
|
|
|
9
9
|
export namespace Restriction {
|
|
10
10
|
export import Merchant = RestrictionsMerchant
|
|
11
11
|
export const type = isly.object<Restriction>({ merchants: Merchant.type.array().optional() })
|
|
12
|
-
export const typeZod
|
|
12
|
+
export const typeZod: zod.ZodType<Restriction> = zod
|
|
13
|
+
.object({ merchants: Merchant.typeZod.array().optional() })
|
|
14
|
+
.meta({ id: "Card.Restriction" })
|
|
13
15
|
export function check(
|
|
14
16
|
restrictions: Restriction,
|
|
15
17
|
transaction: Transaction.Creatable.CardTransaction | Transaction.PreTransaction.Authorization
|
package/Card/Scheme.ts
CHANGED
|
@@ -5,5 +5,5 @@ export type Scheme = (typeof Scheme.schemes)[number]
|
|
|
5
5
|
export namespace Scheme {
|
|
6
6
|
export const schemes = ["mastercard", "diners", "visa"] as const
|
|
7
7
|
export const type = isly.string<Scheme>(schemes)
|
|
8
|
-
export const typeZod = zod.enum(schemes)
|
|
8
|
+
export const typeZod = zod.enum(schemes).meta({ id: "Card.Scheme" })
|
|
9
9
|
}
|
package/Card/index.ts
CHANGED
|
@@ -71,36 +71,38 @@ export namespace Card {
|
|
|
71
71
|
limit: isly.tuple(isly.fromIs("isoly.Currency", isoly.Currency.is), isly.number()),
|
|
72
72
|
spent: isly.tuple(isly.fromIs("isoly.Currency", isoly.Currency.is), isly.number()),
|
|
73
73
|
status: isly.union(isly.string("active"), isly.string("cancelled")),
|
|
74
|
-
history:
|
|
74
|
+
history: CardOperation.type.array(),
|
|
75
75
|
rules: ruleType.array(),
|
|
76
76
|
meta: isly.fromIs("Card.Meta", CardMeta.is).optional(),
|
|
77
77
|
restricted: isly.object<Required<Card>["restricted"]>({ to: CardRestriction.type.optional() }).optional(),
|
|
78
78
|
})
|
|
79
|
-
export const typeZod = zod
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
79
|
+
export const typeZod: zod.ZodType<Card> = zod
|
|
80
|
+
.object({
|
|
81
|
+
id: zod.string(),
|
|
82
|
+
number: zod.string().optional(),
|
|
83
|
+
created: zod.string().refine(isoly.DateTime.is),
|
|
84
|
+
organization: zod.string(),
|
|
85
|
+
realm: Realm.typeZod,
|
|
86
|
+
account: zod.string(),
|
|
87
|
+
preset: CardPreset.typeZod,
|
|
88
|
+
scheme: CardScheme.typeZod,
|
|
89
|
+
reference: zod.string(),
|
|
90
|
+
details: zod.object({
|
|
91
|
+
iin: zod.string(),
|
|
92
|
+
last4: zod.string(),
|
|
93
|
+
expiry: CardExpiry.typeZod,
|
|
94
|
+
holder: zod.string(),
|
|
95
|
+
token: zod.string().optional(),
|
|
96
|
+
}),
|
|
97
|
+
limit: Amount.typeZod,
|
|
98
|
+
spent: Amount.typeZod,
|
|
99
|
+
status: zod.enum(["active", "cancelled"]),
|
|
100
|
+
history: CardOperation.typeZod.array(),
|
|
101
|
+
rules: zod.any().array(),
|
|
102
|
+
meta: CardMeta.typeZod.optional(),
|
|
103
|
+
restricted: zod.object({ to: CardRestriction.typeZod.optional() }).optional(),
|
|
104
|
+
})
|
|
105
|
+
.meta({ id: "Card" })
|
|
104
106
|
const csvMap: Record<string, (card: Card) => string | number | undefined> = {
|
|
105
107
|
id: card => card.id,
|
|
106
108
|
created: card => readableDate(card.created),
|
package/Merchant/index.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { isoly } from "isoly"
|
|
2
2
|
import { isly } from "isly"
|
|
3
|
-
import { zod } from "../zod"
|
|
3
|
+
import { zod, zodHelper } from "../zod"
|
|
4
4
|
import { Category as MerchantCategory } from "./Category"
|
|
5
5
|
|
|
6
6
|
export interface Merchant {
|
|
@@ -33,6 +33,6 @@ export namespace Merchant {
|
|
|
33
33
|
city: zod.string(),
|
|
34
34
|
zip: zod.string(),
|
|
35
35
|
state: zod.string().optional(),
|
|
36
|
-
country:
|
|
36
|
+
country: zodHelper.countryCode,
|
|
37
37
|
})
|
|
38
38
|
}
|
package/Operation/Change.ts
CHANGED
|
@@ -18,12 +18,14 @@ export namespace Change {
|
|
|
18
18
|
status: Status.type,
|
|
19
19
|
result: isly.number().optional(),
|
|
20
20
|
})
|
|
21
|
-
export const typeZod = zod
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
21
|
+
export const typeZod = zod
|
|
22
|
+
.object({
|
|
23
|
+
type: zod.enum(operand),
|
|
24
|
+
amount: zod.number(),
|
|
25
|
+
status: Status.typeZod,
|
|
26
|
+
result: zod.number().optional(),
|
|
27
|
+
})
|
|
28
|
+
.meta({ id: "Operation.Change" })
|
|
27
29
|
export namespace Add {
|
|
28
30
|
export const type = Change.type.extend<Change<"add">>({
|
|
29
31
|
type: isly.string("add"),
|
package/Operation/Changes.ts
CHANGED
|
@@ -48,7 +48,7 @@ export namespace Changes {
|
|
|
48
48
|
export type Sum = Partial<Record<Changes.Entry.Balance, number>>
|
|
49
49
|
export type MaybeLegacy = Changes | Legacy
|
|
50
50
|
export const type = isly.record<Changes>(isly.string(), Change.type)
|
|
51
|
-
export const typeZod = zod.record(zod.string(), Change.typeZod)
|
|
51
|
+
export const typeZod = zod.record(zod.string(), Change.typeZod).meta({ id: "Operation.Changes" })
|
|
52
52
|
export type Legacy = Partial<Record<AccountBalance.Legacy.Entry, Change>>
|
|
53
53
|
export namespace Legacy {
|
|
54
54
|
export const type = isly.record<Legacy>(isly.string(), Change.type)
|
package/Operation/Creatable.ts
CHANGED
|
@@ -2,7 +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
|
+
import { zod, zodHelper } from "../zod"
|
|
6
6
|
import { Changes } from "./Changes"
|
|
7
7
|
|
|
8
8
|
export interface Creatable {
|
|
@@ -38,13 +38,15 @@ export namespace Creatable {
|
|
|
38
38
|
type: isly.string(types),
|
|
39
39
|
counterbalance: isly.string().optional(),
|
|
40
40
|
})
|
|
41
|
-
export const typeZod = zod
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
41
|
+
export const typeZod = zod
|
|
42
|
+
.object({
|
|
43
|
+
account: zod.string(),
|
|
44
|
+
currency: zodHelper.currency,
|
|
45
|
+
changes: Changes.typeZod,
|
|
46
|
+
type: zod.enum(types),
|
|
47
|
+
counterbalance: zod.string().optional(),
|
|
48
|
+
})
|
|
49
|
+
.meta({ id: "Operation.Creatable" })
|
|
48
50
|
export function fromRefund(account: string, settlement: string, entry: Settlement.Entry.Creatable.Refund): Creatable {
|
|
49
51
|
// The Entry.Refund.Creatable has negative amount and fee
|
|
50
52
|
// The operation amounts should always be positive
|
package/Operation/Status.ts
CHANGED
|
@@ -6,5 +6,5 @@ export type Status = (typeof Status.values)[number]
|
|
|
6
6
|
export namespace Status {
|
|
7
7
|
export const values = ["pending", "success", "failed"] as const
|
|
8
8
|
export const type = isly.string(values)
|
|
9
|
-
export const typeZod = zod.enum(values)
|
|
9
|
+
export const typeZod = zod.enum(values).meta({ id: "Operation.Status" })
|
|
10
10
|
}
|
package/Operation/index.ts
CHANGED
|
@@ -35,13 +35,15 @@ export namespace Operation {
|
|
|
35
35
|
export import Creatable = OperationCreatable
|
|
36
36
|
export import Changes = OperationChanges
|
|
37
37
|
export import Change = OperationChange
|
|
38
|
-
export const typeZod = Creatable.typeZod
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
38
|
+
export const typeZod = Creatable.typeZod
|
|
39
|
+
.extend({
|
|
40
|
+
transaction: zod.string(),
|
|
41
|
+
counter: zod.number(),
|
|
42
|
+
created: zod.string().refine(isoly.DateTime.is),
|
|
43
|
+
signature: zod.string().optional(),
|
|
44
|
+
previous: zod.string().optional(),
|
|
45
|
+
})
|
|
46
|
+
.meta({ id: "Operation" })
|
|
45
47
|
export const type = OperationCreatable.type.extend<Operation>({
|
|
46
48
|
transaction: isly.string(),
|
|
47
49
|
counter: isly.number(),
|
|
@@ -11,8 +11,7 @@ export namespace Changeable {
|
|
|
11
11
|
name: isly.string().optional(),
|
|
12
12
|
contact: Contact.Creatable.type.optional(),
|
|
13
13
|
})
|
|
14
|
-
export const typeZod = zod
|
|
15
|
-
name: zod.string().optional(),
|
|
16
|
-
|
|
17
|
-
})
|
|
14
|
+
export const typeZod = zod
|
|
15
|
+
.object({ name: zod.string().optional(), contact: Contact.Creatable.typeZod.optional() })
|
|
16
|
+
.meta({ id: "Organization.Changeable" })
|
|
18
17
|
}
|
|
@@ -10,7 +10,6 @@ export interface Default {
|
|
|
10
10
|
zipCode: string
|
|
11
11
|
street: string
|
|
12
12
|
}
|
|
13
|
-
|
|
14
13
|
export namespace Default {
|
|
15
14
|
export const type = isly.object<Default>({
|
|
16
15
|
countryCode: isly.string(),
|
|
@@ -20,12 +19,14 @@ export namespace Default {
|
|
|
20
19
|
street: isly.string(),
|
|
21
20
|
zipCode: isly.string(),
|
|
22
21
|
})
|
|
23
|
-
export const typeZod = zod
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
22
|
+
export const typeZod: zod.ZodType<Default> = zod
|
|
23
|
+
.object({
|
|
24
|
+
countryCode: zod.string() as any,
|
|
25
|
+
state: zod.string().optional(),
|
|
26
|
+
county: zod.string().optional(),
|
|
27
|
+
city: zod.string(),
|
|
28
|
+
zipCode: zod.string(),
|
|
29
|
+
street: zod.string(),
|
|
30
|
+
})
|
|
31
|
+
.meta({ id: "Organization.Contact.Address.Default" })
|
|
31
32
|
}
|
|
@@ -9,7 +9,6 @@ export interface GB {
|
|
|
9
9
|
building: string
|
|
10
10
|
zipCode: string
|
|
11
11
|
}
|
|
12
|
-
|
|
13
12
|
export namespace GB {
|
|
14
13
|
export const name = isoly.CountryCode.Name.en.from("GB")
|
|
15
14
|
export const type = isly.object<GB>({
|
|
@@ -19,11 +18,13 @@ export namespace GB {
|
|
|
19
18
|
building: isly.string(),
|
|
20
19
|
zipCode: isly.string(),
|
|
21
20
|
})
|
|
22
|
-
export const typeZod = zod
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
21
|
+
export const typeZod: zod.ZodType<GB> = zod
|
|
22
|
+
.object({
|
|
23
|
+
countryCode: zod.literal("GB"),
|
|
24
|
+
city: zod.string(),
|
|
25
|
+
street: zod.string(),
|
|
26
|
+
building: zod.string(),
|
|
27
|
+
zipCode: zod.string(),
|
|
28
|
+
})
|
|
29
|
+
.meta({ id: "Organization.Contact.Address.GB" })
|
|
29
30
|
}
|
|
@@ -14,10 +14,7 @@ export namespace SE {
|
|
|
14
14
|
city: isly.string(),
|
|
15
15
|
street: isly.string(),
|
|
16
16
|
})
|
|
17
|
-
export const typeZod = zod
|
|
18
|
-
countryCode: zod.literal("SE"),
|
|
19
|
-
|
|
20
|
-
city: zod.string(),
|
|
21
|
-
street: zod.string(),
|
|
22
|
-
})
|
|
17
|
+
export const typeZod: zod.ZodType<SE> = zod
|
|
18
|
+
.object({ countryCode: zod.literal("SE"), zipCode: zod.string(), city: zod.string(), street: zod.string() })
|
|
19
|
+
.meta({ id: "Organization.Contact.Address.SE" })
|
|
23
20
|
}
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import { isly } from "isly"
|
|
2
2
|
import { zod } from "../../../zod"
|
|
3
|
+
import { Default } from "./Default"
|
|
3
4
|
import { GB } from "./GB"
|
|
4
|
-
import { Default } from "./General"
|
|
5
5
|
import { SE } from "./SE"
|
|
6
6
|
|
|
7
7
|
export type Address = GB | SE | Default
|
|
8
|
-
|
|
9
8
|
export namespace Address {
|
|
10
9
|
export const type = isly.union(GB.type, SE.type, Default.type)
|
|
11
|
-
export const typeZod
|
|
10
|
+
export const typeZod: zod.ZodType<Address> = zod
|
|
11
|
+
.union([GB.typeZod, SE.typeZod, Default.typeZod])
|
|
12
|
+
.meta({ id: "Organization.Contact.Address" })
|
|
12
13
|
}
|
|
@@ -15,10 +15,12 @@ export namespace Addresses {
|
|
|
15
15
|
delivery: Address.type.optional(),
|
|
16
16
|
visit: Address.type.optional(),
|
|
17
17
|
})
|
|
18
|
-
export const typeZod = zod
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
18
|
+
export const typeZod: zod.ZodType<Addresses> = zod
|
|
19
|
+
.object({
|
|
20
|
+
primary: Address.typeZod,
|
|
21
|
+
billing: Address.typeZod.optional(),
|
|
22
|
+
delivery: Address.typeZod.optional(),
|
|
23
|
+
visit: Address.typeZod.optional(),
|
|
24
|
+
})
|
|
25
|
+
.meta({ id: "Organization.Contact.Addresses" })
|
|
24
26
|
}
|