Skip to content

Commit 7286167

Browse files
authored
Merge pull request #247 from swlodarski-sumoheavy/7.0.x
#220 Upgrade Zod to v4
2 parents 9913d72 + ae288b4 commit 7286167

File tree

9 files changed

+22
-23
lines changed

9 files changed

+22
-23
lines changed

package-lock.json

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@
5454
"bs58": "6.0.0",
5555
"elliptic": "6.6.1",
5656
"lodash": "4.17.21",
57-
"zod": "3.25.76"
57+
"zod": "4.1.8"
5858
},
5959
"devDependencies": {
6060
"@types/bs58": "4.0.4",

src/Model/Invoice/Invoice.zod.ts

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
import { z } from 'zod';
22
import { buyerInterfaceSchema } from './Buyer.zod';
3-
import { invoiceTransactionSchema } from './InvoiceTransaction.zod';
43
import { invoiceBuyerProvidedInfoSchema } from './InvoiceBuyerProvidedInfo.zod';
4+
import { invoiceRefundAddressesSchema } from './InvoiceRefundAddresses.zod';
5+
import { invoiceTransactionSchema } from './InvoiceTransaction.zod';
56
import { invoiceUniversalCodesSchema } from './InvoiceUniversalCodes.zod';
7+
import { minerFeesItemSchema } from './MinerFeesItem.zod';
68
import { refundInfoSchema } from './RefundInfo.zod';
79
import { shopperSchema } from './Shopper.zod';
8-
import { minerFeesItemSchema } from './MinerFeesItem.zod';
910
import { supportedTransactionCurrencySchema } from './SupportedTransactionCurrency.zod';
10-
import { invoiceRefundAddressesSchema } from './InvoiceRefundAddresses.zod';
1111

1212
export const invoiceSchema = z.object({
1313
buyer: buyerInterfaceSchema.optional(),
@@ -18,7 +18,6 @@ export const invoiceSchema = z.object({
1818
shopper: shopperSchema.optional(),
1919
refundInfo: refundInfoSchema.optional(),
2020
universalCodes: invoiceUniversalCodesSchema.optional(),
21-
2221
currency: z.string().optional(),
2322
guid: z.string().optional(),
2423
token: z.string().optional(),
@@ -56,17 +55,17 @@ export const invoiceSchema = z.object({
5655
transactionCurrency: z.string().optional(),
5756
amountPaid: z.number().optional(),
5857
displayAmountPaid: z.string().optional(),
59-
exchangeRates: z.record(z.record(z.number())).nullable(),
60-
paymentSubtotals: z.record(z.number()).nullable(),
61-
paymentTotals: z.record(z.number()).nullable(),
62-
paymentDisplayTotals: z.record(z.string()).nullable(),
63-
paymentDisplaySubTotals: z.record(z.string()).nullable(),
58+
exchangeRates: z.record(z.string(), z.record(z.string(), z.number())).nullable(),
59+
paymentSubtotals: z.record(z.string(), z.number()).nullable(),
60+
paymentTotals: z.record(z.string(), z.number()).nullable(),
61+
paymentDisplayTotals: z.record(z.string(), z.string()).nullable(),
62+
paymentDisplaySubTotals: z.record(z.string(), z.string()).nullable(),
6463
nonPayProPaymentReceived: z.boolean().optional(),
6564
jsonPayProRequired: z.boolean().optional(),
6665
merchantName: z.string().optional(),
6766
bitpayIdRequired: z.boolean().optional(),
6867
underpaidAmount: z.number().optional(),
6968
overpaidAmount: z.number().optional(),
70-
paymentCodes: z.record(z.record(z.string())).nullable(),
69+
paymentCodes: z.record(z.string(), z.record(z.string(), z.string())).nullable(),
7170
isCancelled: z.boolean().optional()
7271
});

src/Model/Invoice/RefundInfo.zod.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,5 @@ import { z } from 'zod';
33
export const refundInfoSchema = z.object({
44
supportRequest: z.string(),
55
currency: z.string(),
6-
amounts: z.record(z.number()).optional()
6+
amounts: z.record(z.string(), z.number()).optional()
77
});

src/Model/Payout/Payout.zod.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ export const payoutInterfaceSchema = z.object({
2323
status: z.string().optional(),
2424
groupId: z.string().optional(),
2525
requestDate: z.string().optional(),
26-
exchangeRates: z.record(z.record(z.number())).optional(),
26+
exchangeRates: z.record(z.string(), z.record(z.string(), z.number())).optional(),
2727
code: z.number().optional(),
2828
ignoreEmails: z.boolean().optional()
2929
});

src/Model/Settlement/InvoiceData.zod.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,5 @@ export const invoiceDataInterfaceSchema = z.object({
99
date: z.string().optional(),
1010
currency: z.string().optional(),
1111
transactionCurrency: z.string().optional(),
12-
payoutPercentage: z.record(z.number()).optional()
12+
payoutPercentage: z.record(z.string(), z.number()).optional()
1313
});

src/Model/Settlement/RefundInfo.zod.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,5 @@ export const refundInfoInterfaceSchema = z.object({
44
supportRequest: z.string().optional(),
55
currency: z.string(),
66
refundRequestEid: z.string().optional(),
7-
amounts: z.record(z.number()).optional()
7+
amounts: z.record(z.string(), z.number()).optional()
88
});

src/Model/Webhook/InvoiceWebhook.zod.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@ export const invoiceWebhookSchema = z.object({
1212
currencyTime: z.string().optional(),
1313
exceptionStatus: z.string().optional(),
1414
buyerFields: invoiceWebhookBuyerFieldsInterfaceSchema.optional(),
15-
paymentSubtotals: z.record(z.number()).nullable(),
16-
paymentTotals: z.record(z.number()).nullable(),
17-
exchangeRates: z.record(z.record(z.number())).nullable(),
15+
paymentSubtotals: z.record(z.string(), z.number()).nullable(),
16+
paymentTotals: z.record(z.string(), z.number()).nullable(),
17+
exchangeRates: z.record(z.string(), z.record(z.string(), z.number())).nullable(),
1818
amountPaid: z.number().optional(),
1919
orderId: z.string().optional(),
2020
transactionCurrency: z.string().optional(),

src/Model/Webhook/PayoutWebhook.zod.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ export const payoutWebhookSchema = z.object({
88
price: z.number().optional(),
99
currency: z.string().optional(),
1010
ledgerCurrency: z.string().optional(),
11-
exchangeRates: z.record(z.record(z.number())).optional(),
11+
exchangeRates: z.record(z.string(), z.record(z.string(), z.number())).optional(),
1212
email: z.string().optional(),
1313
reference: z.string().optional(),
1414
label: z.string().optional(),

0 commit comments

Comments
 (0)