@moovio/sdk 0.21.16 → 0.22.0
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/README.md +44 -46
- package/bin/mcp-server.js +316 -313
- package/bin/mcp-server.js.map +64 -58
- package/examples/package-lock.json +1 -1
- package/funcs/imagesUpdate.d.ts +1 -2
- package/funcs/imagesUpdate.d.ts.map +1 -1
- package/funcs/imagesUpdate.js +12 -13
- package/funcs/imagesUpdate.js.map +1 -1
- package/jsr.json +1 -1
- package/lib/config.d.ts +3 -3
- package/lib/config.js +3 -3
- package/lib/config.js.map +1 -1
- package/lib/encodings.d.ts +1 -0
- package/lib/encodings.d.ts.map +1 -1
- package/lib/encodings.js +12 -1
- package/lib/encodings.js.map +1 -1
- package/mcp-server/mcp-server.js +1 -1
- package/mcp-server/mcp-server.js.map +1 -1
- package/mcp-server/server.js +1 -1
- package/mcp-server/server.js.map +1 -1
- package/mcp-server/tools/accountsUpdate.js +1 -1
- package/mcp-server/tools/applePayUpdateMerchantDomains.js +3 -3
- package/mcp-server/tools/brandingUpdate.js +1 -1
- package/mcp-server/tools/cardIssuingUpdate.js +1 -1
- package/mcp-server/tools/cardsUpdate.js +6 -6
- package/mcp-server/tools/imagesUpdate.d.ts.map +1 -1
- package/mcp-server/tools/imagesUpdate.js +1 -2
- package/mcp-server/tools/imagesUpdate.js.map +1 -1
- package/mcp-server/tools/paymentLinksUpdate.js +1 -1
- package/mcp-server/tools/representativesUpdate.js +2 -2
- package/mcp-server/tools/supportUpdateTicket.js +1 -1
- package/mcp-server/tools/sweepsUpdateConfig.js +1 -1
- package/mcp-server/tools/transfersUpdate.js +3 -3
- package/mcp-server/tools/walletsUpdate.js +1 -1
- package/models/components/achcreditsamedaypaymentmethod.d.ts +2 -11
- package/models/components/achcreditsamedaypaymentmethod.d.ts.map +1 -1
- package/models/components/achcreditsamedaypaymentmethod.js +3 -11
- package/models/components/achcreditsamedaypaymentmethod.js.map +1 -1
- package/models/components/achcreditstandardpaymentmethod.d.ts +2 -11
- package/models/components/achcreditstandardpaymentmethod.d.ts.map +1 -1
- package/models/components/achcreditstandardpaymentmethod.js +3 -11
- package/models/components/achcreditstandardpaymentmethod.js.map +1 -1
- package/models/components/achdebitcollectpaymentmethod.d.ts +2 -11
- package/models/components/achdebitcollectpaymentmethod.d.ts.map +1 -1
- package/models/components/achdebitcollectpaymentmethod.js +3 -11
- package/models/components/achdebitcollectpaymentmethod.js.map +1 -1
- package/models/components/achdebitfundpaymentmethod.d.ts +2 -11
- package/models/components/achdebitfundpaymentmethod.d.ts.map +1 -1
- package/models/components/achdebitfundpaymentmethod.js +3 -11
- package/models/components/achdebitfundpaymentmethod.js.map +1 -1
- package/models/components/applepaypaymentmethod.d.ts +2 -11
- package/models/components/applepaypaymentmethod.d.ts.map +1 -1
- package/models/components/applepaypaymentmethod.js +3 -10
- package/models/components/applepaypaymentmethod.js.map +1 -1
- package/models/components/cardpaymentpaymentmethod.d.ts +2 -11
- package/models/components/cardpaymentpaymentmethod.d.ts.map +1 -1
- package/models/components/cardpaymentpaymentmethod.js +3 -11
- package/models/components/cardpaymentpaymentmethod.js.map +1 -1
- package/models/components/cardpresentpaymentpaymentmethod.d.ts +2 -11
- package/models/components/cardpresentpaymentpaymentmethod.d.ts.map +1 -1
- package/models/components/cardpresentpaymentpaymentmethod.js +3 -11
- package/models/components/cardpresentpaymentpaymentmethod.js.map +1 -1
- package/models/components/createevidencefilemultipart.d.ts +1 -1
- package/models/components/createinvoice.d.ts +3 -3
- package/models/components/createinvoice.d.ts.map +1 -1
- package/models/components/createinvoice.js +3 -3
- package/models/components/createinvoice.js.map +1 -1
- package/models/components/createinvoicelineitem.d.ts +50 -0
- package/models/components/createinvoicelineitem.d.ts.map +1 -0
- package/models/components/createinvoicelineitem.js +70 -0
- package/models/components/createinvoicelineitem.js.map +1 -0
- package/models/components/createinvoicelineitemoption.d.ts +44 -0
- package/models/components/createinvoicelineitemoption.d.ts.map +1 -0
- package/models/components/createinvoicelineitemoption.js +67 -0
- package/models/components/createinvoicelineitemoption.js.map +1 -0
- package/models/components/createinvoicelineitemoptionvalidationerror.d.ts +24 -0
- package/models/components/createinvoicelineitemoptionvalidationerror.d.ts.map +1 -0
- package/models/components/createinvoicelineitemoptionvalidationerror.js +65 -0
- package/models/components/createinvoicelineitemoptionvalidationerror.js.map +1 -0
- package/models/components/createinvoicelineitems.d.ts +24 -0
- package/models/components/createinvoicelineitems.d.ts.map +1 -0
- package/models/components/{invoicelineitemsupdate.js → createinvoicelineitems.js} +13 -13
- package/models/components/createinvoicelineitems.js.map +1 -0
- package/models/components/createinvoicelineitemsupdate.d.ts +24 -0
- package/models/components/createinvoicelineitemsupdate.d.ts.map +1 -0
- package/models/components/createinvoicelineitemsupdate.js +59 -0
- package/models/components/createinvoicelineitemsupdate.js.map +1 -0
- package/models/components/createinvoicelineitemsvalidationerror.d.ts +22 -0
- package/models/components/createinvoicelineitemsvalidationerror.d.ts.map +1 -0
- package/models/components/createinvoicelineitemsvalidationerror.js +61 -0
- package/models/components/createinvoicelineitemsvalidationerror.js.map +1 -0
- package/models/components/createinvoicelineitemvalidationerror.d.ts +31 -0
- package/models/components/createinvoicelineitemvalidationerror.d.ts.map +1 -0
- package/models/components/createinvoicelineitemvalidationerror.js +70 -0
- package/models/components/createinvoicelineitemvalidationerror.js.map +1 -0
- package/models/components/createpaymentlink.d.ts +0 -2
- package/models/components/createpaymentlink.d.ts.map +1 -1
- package/models/components/createpaymentlink.js.map +1 -1
- package/models/components/fileuploadrequestmultipart.d.ts +1 -4
- package/models/components/fileuploadrequestmultipart.d.ts.map +1 -1
- package/models/components/fileuploadrequestmultipart.js.map +1 -1
- package/models/components/imageuploadrequestmultipart.d.ts +3 -3
- package/models/components/imageuploadrequestmultipart.d.ts.map +1 -1
- package/models/components/index.d.ts +8 -2
- package/models/components/index.d.ts.map +1 -1
- package/models/components/index.js +8 -2
- package/models/components/index.js.map +1 -1
- package/models/components/instantbankcreditpaymentmethod.d.ts +2 -11
- package/models/components/instantbankcreditpaymentmethod.d.ts.map +1 -1
- package/models/components/instantbankcreditpaymentmethod.js +3 -11
- package/models/components/instantbankcreditpaymentmethod.js.map +1 -1
- package/models/components/invoiceexternalpayment.d.ts +2 -11
- package/models/components/invoiceexternalpayment.d.ts.map +1 -1
- package/models/components/invoiceexternalpayment.js +3 -10
- package/models/components/invoiceexternalpayment.js.map +1 -1
- package/models/components/invoicelineitem.d.ts +9 -3
- package/models/components/invoicelineitem.d.ts.map +1 -1
- package/models/components/invoicelineitem.js +5 -2
- package/models/components/invoicelineitem.js.map +1 -1
- package/models/components/invoicelineitemimagemetadata.d.ts +35 -0
- package/models/components/invoicelineitemimagemetadata.d.ts.map +1 -0
- package/models/components/invoicelineitemimagemetadata.js +64 -0
- package/models/components/invoicelineitemimagemetadata.js.map +1 -0
- package/models/components/invoicepayment.d.ts +2 -10
- package/models/components/invoicepayment.d.ts.map +1 -1
- package/models/components/invoicepayment.js +4 -12
- package/models/components/invoicepayment.js.map +1 -1
- package/models/components/invoicetransferpayment.d.ts +2 -11
- package/models/components/invoicetransferpayment.d.ts.map +1 -1
- package/models/components/invoicetransferpayment.js +3 -11
- package/models/components/invoicetransferpayment.js.map +1 -1
- package/models/components/moovwalletpaymentmethod.d.ts +2 -11
- package/models/components/moovwalletpaymentmethod.d.ts.map +1 -1
- package/models/components/moovwalletpaymentmethod.js +3 -11
- package/models/components/moovwalletpaymentmethod.js.map +1 -1
- package/models/components/patchsweepconfig.d.ts +6 -60
- package/models/components/patchsweepconfig.d.ts.map +1 -1
- package/models/components/patchsweepconfig.js +7 -79
- package/models/components/patchsweepconfig.js.map +1 -1
- package/models/components/paymentmethod.d.ts +2 -50
- package/models/components/paymentmethod.d.ts.map +1 -1
- package/models/components/paymentmethod.js +24 -34
- package/models/components/paymentmethod.js.map +1 -1
- package/models/components/pullfromcardpaymentmethod.d.ts +2 -11
- package/models/components/pullfromcardpaymentmethod.d.ts.map +1 -1
- package/models/components/pullfromcardpaymentmethod.js +3 -11
- package/models/components/pullfromcardpaymentmethod.js.map +1 -1
- package/models/components/pushtocardpaymentmethod.d.ts +2 -11
- package/models/components/pushtocardpaymentmethod.d.ts.map +1 -1
- package/models/components/pushtocardpaymentmethod.js +3 -11
- package/models/components/pushtocardpaymentmethod.js.map +1 -1
- package/models/components/rtpcreditpaymentmethod.d.ts +2 -11
- package/models/components/rtpcreditpaymentmethod.d.ts.map +1 -1
- package/models/components/rtpcreditpaymentmethod.js +3 -11
- package/models/components/rtpcreditpaymentmethod.js.map +1 -1
- package/models/components/updateinvoice.d.ts +3 -3
- package/models/components/updateinvoice.d.ts.map +1 -1
- package/models/components/updateinvoice.js +3 -3
- package/models/components/updateinvoice.js.map +1 -1
- package/models/components/updaterepresentative.d.ts +2 -20
- package/models/components/updaterepresentative.d.ts.map +1 -1
- package/models/components/updaterepresentative.js +3 -32
- package/models/components/updaterepresentative.js.map +1 -1
- package/models/errors/createinvoiceerror.d.ts +3 -3
- package/models/errors/createinvoiceerror.d.ts.map +1 -1
- package/models/errors/createinvoiceerror.js +2 -2
- package/models/errors/createinvoiceerror.js.map +1 -1
- package/models/operations/createpaymentlink.d.ts +3 -0
- package/models/operations/createpaymentlink.d.ts.map +1 -1
- package/models/operations/createpaymentlink.js.map +1 -1
- package/models/operations/disablepaymentlink.d.ts +3 -0
- package/models/operations/disablepaymentlink.d.ts.map +1 -1
- package/models/operations/disablepaymentlink.js.map +1 -1
- package/models/operations/getpaymentlink.d.ts +3 -0
- package/models/operations/getpaymentlink.d.ts.map +1 -1
- package/models/operations/getpaymentlink.js.map +1 -1
- package/models/operations/getpaymentlinkqrcode.d.ts +3 -0
- package/models/operations/getpaymentlinkqrcode.d.ts.map +1 -1
- package/models/operations/getpaymentlinkqrcode.js.map +1 -1
- package/models/operations/listpaymentlinks.d.ts +3 -0
- package/models/operations/listpaymentlinks.d.ts.map +1 -1
- package/models/operations/listpaymentlinks.js.map +1 -1
- package/models/operations/updateimage.d.ts +2 -2
- package/models/operations/updateimage.js +4 -4
- package/models/operations/updatepaymentlink.d.ts +3 -0
- package/models/operations/updatepaymentlink.d.ts.map +1 -1
- package/models/operations/updatepaymentlink.js.map +1 -1
- package/package.json +1 -1
- package/sdk/images.d.ts +1 -2
- package/sdk/images.d.ts.map +1 -1
- package/sdk/images.js +1 -2
- package/sdk/images.js.map +1 -1
- package/src/funcs/imagesUpdate.ts +12 -13
- package/src/lib/config.ts +3 -3
- package/src/lib/encodings.ts +17 -3
- package/src/mcp-server/mcp-server.ts +1 -1
- package/src/mcp-server/server.ts +1 -1
- package/src/mcp-server/tools/accountsUpdate.ts +1 -1
- package/src/mcp-server/tools/applePayUpdateMerchantDomains.ts +3 -3
- package/src/mcp-server/tools/brandingUpdate.ts +1 -1
- package/src/mcp-server/tools/cardIssuingUpdate.ts +1 -1
- package/src/mcp-server/tools/cardsUpdate.ts +6 -6
- package/src/mcp-server/tools/imagesUpdate.ts +1 -2
- package/src/mcp-server/tools/paymentLinksUpdate.ts +1 -1
- package/src/mcp-server/tools/representativesUpdate.ts +2 -2
- package/src/mcp-server/tools/supportUpdateTicket.ts +1 -1
- package/src/mcp-server/tools/sweepsUpdateConfig.ts +1 -1
- package/src/mcp-server/tools/transfersUpdate.ts +3 -3
- package/src/mcp-server/tools/walletsUpdate.ts +1 -1
- package/src/models/components/achcreditsamedaypaymentmethod.ts +4 -23
- package/src/models/components/achcreditstandardpaymentmethod.ts +4 -23
- package/src/models/components/achdebitcollectpaymentmethod.ts +4 -23
- package/src/models/components/achdebitfundpaymentmethod.ts +4 -21
- package/src/models/components/applepaypaymentmethod.ts +4 -22
- package/src/models/components/cardpaymentpaymentmethod.ts +4 -21
- package/src/models/components/cardpresentpaymentpaymentmethod.ts +4 -23
- package/src/models/components/createevidencefilemultipart.ts +1 -1
- package/src/models/components/createinvoice.ts +9 -9
- package/src/models/components/createinvoicelineitem.ts +104 -0
- package/src/models/components/createinvoicelineitemoption.ts +93 -0
- package/src/models/components/createinvoicelineitemoptionvalidationerror.ts +77 -0
- package/src/models/components/createinvoicelineitems.ts +63 -0
- package/src/models/components/createinvoicelineitemsupdate.ts +65 -0
- package/src/models/components/createinvoicelineitemsvalidationerror.ts +64 -0
- package/src/models/components/createinvoicelineitemvalidationerror.ts +88 -0
- package/src/models/components/createpaymentlink.ts +0 -2
- package/src/models/components/fileuploadrequestmultipart.ts +1 -4
- package/src/models/components/imageuploadrequestmultipart.ts +3 -3
- package/src/models/components/index.ts +8 -2
- package/src/models/components/instantbankcreditpaymentmethod.ts +4 -23
- package/src/models/components/invoiceexternalpayment.ts +4 -21
- package/src/models/components/invoicelineitem.ts +18 -5
- package/src/models/components/invoicelineitemimagemetadata.ts +77 -0
- package/src/models/components/invoicepayment.ts +7 -25
- package/src/models/components/invoicetransferpayment.ts +4 -17
- package/src/models/components/moovwalletpaymentmethod.ts +4 -21
- package/src/models/components/patchsweepconfig.ts +12 -252
- package/src/models/components/paymentmethod.ts +48 -164
- package/src/models/components/pullfromcardpaymentmethod.ts +4 -21
- package/src/models/components/pushtocardpaymentmethod.ts +4 -21
- package/src/models/components/rtpcreditpaymentmethod.ts +4 -21
- package/src/models/components/updateinvoice.ts +9 -9
- package/src/models/components/updaterepresentative.ts +4 -59
- package/src/models/errors/createinvoiceerror.ts +7 -5
- package/src/models/operations/createpaymentlink.ts +3 -0
- package/src/models/operations/disablepaymentlink.ts +3 -0
- package/src/models/operations/getpaymentlink.ts +3 -0
- package/src/models/operations/getpaymentlinkqrcode.ts +3 -0
- package/src/models/operations/listpaymentlinks.ts +3 -0
- package/src/models/operations/updateimage.ts +8 -8
- package/src/models/operations/updatepaymentlink.ts +3 -0
- package/src/sdk/images.ts +1 -2
- package/src/types/unrecognized.ts +9 -1
- package/tsconfig.json +1 -2
- package/types/unrecognized.d.ts +7 -1
- package/types/unrecognized.d.ts.map +1 -1
- package/types/unrecognized.js +9 -1
- package/types/unrecognized.js.map +1 -1
- package/models/components/imageupdaterequestmultipart.d.ts +0 -67
- package/models/components/imageupdaterequestmultipart.d.ts.map +0 -1
- package/models/components/imageupdaterequestmultipart.js +0 -105
- package/models/components/imageupdaterequestmultipart.js.map +0 -1
- package/models/components/invoicelineitemsupdate.d.ts +0 -24
- package/models/components/invoicelineitemsupdate.d.ts.map +0 -1
- package/models/components/invoicelineitemsupdate.js.map +0 -1
- package/src/models/components/imageupdaterequestmultipart.ts +0 -178
- package/src/models/components/invoicelineitemsupdate.ts +0 -63
|
@@ -4,7 +4,6 @@
|
|
|
4
4
|
|
|
5
5
|
import * as z from "zod/v3";
|
|
6
6
|
import { safeParse } from "../../lib/schemas.js";
|
|
7
|
-
import { ClosedEnum } from "../../types/enums.js";
|
|
8
7
|
import { Result as SafeParseResult } from "../../types/fp.js";
|
|
9
8
|
import { SDKValidationError } from "../errors/sdkvalidationerror.js";
|
|
10
9
|
import {
|
|
@@ -14,34 +13,18 @@ import {
|
|
|
14
13
|
PaymentMethodsBankAccount$outboundSchema,
|
|
15
14
|
} from "./paymentmethodsbankaccount.js";
|
|
16
15
|
|
|
17
|
-
export const AchDebitFundPaymentMethodPaymentMethodType = {
|
|
18
|
-
AchDebitFund: "ach-debit-fund",
|
|
19
|
-
} as const;
|
|
20
|
-
export type AchDebitFundPaymentMethodPaymentMethodType = ClosedEnum<
|
|
21
|
-
typeof AchDebitFundPaymentMethodPaymentMethodType
|
|
22
|
-
>;
|
|
23
|
-
|
|
24
16
|
export type AchDebitFundPaymentMethod = {
|
|
25
17
|
/**
|
|
26
18
|
* ID of the payment method.
|
|
27
19
|
*/
|
|
28
20
|
paymentMethodID: string;
|
|
29
|
-
paymentMethodType:
|
|
21
|
+
paymentMethodType: "ach-debit-fund";
|
|
30
22
|
/**
|
|
31
23
|
* A bank account as contained within a payment method.
|
|
32
24
|
*/
|
|
33
25
|
bankAccount: PaymentMethodsBankAccount;
|
|
34
26
|
};
|
|
35
27
|
|
|
36
|
-
/** @internal */
|
|
37
|
-
export const AchDebitFundPaymentMethodPaymentMethodType$inboundSchema:
|
|
38
|
-
z.ZodNativeEnum<typeof AchDebitFundPaymentMethodPaymentMethodType> = z
|
|
39
|
-
.nativeEnum(AchDebitFundPaymentMethodPaymentMethodType);
|
|
40
|
-
/** @internal */
|
|
41
|
-
export const AchDebitFundPaymentMethodPaymentMethodType$outboundSchema:
|
|
42
|
-
z.ZodNativeEnum<typeof AchDebitFundPaymentMethodPaymentMethodType> =
|
|
43
|
-
AchDebitFundPaymentMethodPaymentMethodType$inboundSchema;
|
|
44
|
-
|
|
45
28
|
/** @internal */
|
|
46
29
|
export const AchDebitFundPaymentMethod$inboundSchema: z.ZodType<
|
|
47
30
|
AchDebitFundPaymentMethod,
|
|
@@ -49,13 +32,13 @@ export const AchDebitFundPaymentMethod$inboundSchema: z.ZodType<
|
|
|
49
32
|
unknown
|
|
50
33
|
> = z.object({
|
|
51
34
|
paymentMethodID: z.string(),
|
|
52
|
-
paymentMethodType:
|
|
35
|
+
paymentMethodType: z.literal("ach-debit-fund"),
|
|
53
36
|
bankAccount: PaymentMethodsBankAccount$inboundSchema,
|
|
54
37
|
});
|
|
55
38
|
/** @internal */
|
|
56
39
|
export type AchDebitFundPaymentMethod$Outbound = {
|
|
57
40
|
paymentMethodID: string;
|
|
58
|
-
paymentMethodType:
|
|
41
|
+
paymentMethodType: "ach-debit-fund";
|
|
59
42
|
bankAccount: PaymentMethodsBankAccount$Outbound;
|
|
60
43
|
};
|
|
61
44
|
|
|
@@ -66,7 +49,7 @@ export const AchDebitFundPaymentMethod$outboundSchema: z.ZodType<
|
|
|
66
49
|
AchDebitFundPaymentMethod
|
|
67
50
|
> = z.object({
|
|
68
51
|
paymentMethodID: z.string(),
|
|
69
|
-
paymentMethodType:
|
|
52
|
+
paymentMethodType: z.literal("ach-debit-fund"),
|
|
70
53
|
bankAccount: PaymentMethodsBankAccount$outboundSchema,
|
|
71
54
|
});
|
|
72
55
|
|
|
@@ -4,7 +4,6 @@
|
|
|
4
4
|
|
|
5
5
|
import * as z from "zod/v3";
|
|
6
6
|
import { safeParse } from "../../lib/schemas.js";
|
|
7
|
-
import { ClosedEnum } from "../../types/enums.js";
|
|
8
7
|
import { Result as SafeParseResult } from "../../types/fp.js";
|
|
9
8
|
import { SDKValidationError } from "../errors/sdkvalidationerror.js";
|
|
10
9
|
import {
|
|
@@ -14,35 +13,18 @@ import {
|
|
|
14
13
|
ApplePayResponse$outboundSchema,
|
|
15
14
|
} from "./applepayresponse.js";
|
|
16
15
|
|
|
17
|
-
export const ApplePayPaymentMethodPaymentMethodType = {
|
|
18
|
-
ApplePay: "apple-pay",
|
|
19
|
-
} as const;
|
|
20
|
-
export type ApplePayPaymentMethodPaymentMethodType = ClosedEnum<
|
|
21
|
-
typeof ApplePayPaymentMethodPaymentMethodType
|
|
22
|
-
>;
|
|
23
|
-
|
|
24
16
|
export type ApplePayPaymentMethod = {
|
|
25
17
|
/**
|
|
26
18
|
* ID of the payment method.
|
|
27
19
|
*/
|
|
28
20
|
paymentMethodID: string;
|
|
29
|
-
paymentMethodType:
|
|
21
|
+
paymentMethodType: "apple-pay";
|
|
30
22
|
/**
|
|
31
23
|
* Describes an Apple Pay token on a Moov account.
|
|
32
24
|
*/
|
|
33
25
|
applePay: ApplePayResponse;
|
|
34
26
|
};
|
|
35
27
|
|
|
36
|
-
/** @internal */
|
|
37
|
-
export const ApplePayPaymentMethodPaymentMethodType$inboundSchema:
|
|
38
|
-
z.ZodNativeEnum<typeof ApplePayPaymentMethodPaymentMethodType> = z.nativeEnum(
|
|
39
|
-
ApplePayPaymentMethodPaymentMethodType,
|
|
40
|
-
);
|
|
41
|
-
/** @internal */
|
|
42
|
-
export const ApplePayPaymentMethodPaymentMethodType$outboundSchema:
|
|
43
|
-
z.ZodNativeEnum<typeof ApplePayPaymentMethodPaymentMethodType> =
|
|
44
|
-
ApplePayPaymentMethodPaymentMethodType$inboundSchema;
|
|
45
|
-
|
|
46
28
|
/** @internal */
|
|
47
29
|
export const ApplePayPaymentMethod$inboundSchema: z.ZodType<
|
|
48
30
|
ApplePayPaymentMethod,
|
|
@@ -50,13 +32,13 @@ export const ApplePayPaymentMethod$inboundSchema: z.ZodType<
|
|
|
50
32
|
unknown
|
|
51
33
|
> = z.object({
|
|
52
34
|
paymentMethodID: z.string(),
|
|
53
|
-
paymentMethodType:
|
|
35
|
+
paymentMethodType: z.literal("apple-pay"),
|
|
54
36
|
applePay: ApplePayResponse$inboundSchema,
|
|
55
37
|
});
|
|
56
38
|
/** @internal */
|
|
57
39
|
export type ApplePayPaymentMethod$Outbound = {
|
|
58
40
|
paymentMethodID: string;
|
|
59
|
-
paymentMethodType:
|
|
41
|
+
paymentMethodType: "apple-pay";
|
|
60
42
|
applePay: ApplePayResponse$Outbound;
|
|
61
43
|
};
|
|
62
44
|
|
|
@@ -67,7 +49,7 @@ export const ApplePayPaymentMethod$outboundSchema: z.ZodType<
|
|
|
67
49
|
ApplePayPaymentMethod
|
|
68
50
|
> = z.object({
|
|
69
51
|
paymentMethodID: z.string(),
|
|
70
|
-
paymentMethodType:
|
|
52
|
+
paymentMethodType: z.literal("apple-pay"),
|
|
71
53
|
applePay: ApplePayResponse$outboundSchema,
|
|
72
54
|
});
|
|
73
55
|
|
|
@@ -4,7 +4,6 @@
|
|
|
4
4
|
|
|
5
5
|
import * as z from "zod/v3";
|
|
6
6
|
import { safeParse } from "../../lib/schemas.js";
|
|
7
|
-
import { ClosedEnum } from "../../types/enums.js";
|
|
8
7
|
import { Result as SafeParseResult } from "../../types/fp.js";
|
|
9
8
|
import { SDKValidationError } from "../errors/sdkvalidationerror.js";
|
|
10
9
|
import {
|
|
@@ -14,34 +13,18 @@ import {
|
|
|
14
13
|
PaymentMethodsCard$outboundSchema,
|
|
15
14
|
} from "./paymentmethodscard.js";
|
|
16
15
|
|
|
17
|
-
export const CardPaymentPaymentMethodPaymentMethodType = {
|
|
18
|
-
CardPayment: "card-payment",
|
|
19
|
-
} as const;
|
|
20
|
-
export type CardPaymentPaymentMethodPaymentMethodType = ClosedEnum<
|
|
21
|
-
typeof CardPaymentPaymentMethodPaymentMethodType
|
|
22
|
-
>;
|
|
23
|
-
|
|
24
16
|
export type CardPaymentPaymentMethod = {
|
|
25
17
|
/**
|
|
26
18
|
* ID of the payment method.
|
|
27
19
|
*/
|
|
28
20
|
paymentMethodID: string;
|
|
29
|
-
paymentMethodType:
|
|
21
|
+
paymentMethodType: "card-payment";
|
|
30
22
|
/**
|
|
31
23
|
* A card as contained within a payment method.
|
|
32
24
|
*/
|
|
33
25
|
card: PaymentMethodsCard;
|
|
34
26
|
};
|
|
35
27
|
|
|
36
|
-
/** @internal */
|
|
37
|
-
export const CardPaymentPaymentMethodPaymentMethodType$inboundSchema:
|
|
38
|
-
z.ZodNativeEnum<typeof CardPaymentPaymentMethodPaymentMethodType> = z
|
|
39
|
-
.nativeEnum(CardPaymentPaymentMethodPaymentMethodType);
|
|
40
|
-
/** @internal */
|
|
41
|
-
export const CardPaymentPaymentMethodPaymentMethodType$outboundSchema:
|
|
42
|
-
z.ZodNativeEnum<typeof CardPaymentPaymentMethodPaymentMethodType> =
|
|
43
|
-
CardPaymentPaymentMethodPaymentMethodType$inboundSchema;
|
|
44
|
-
|
|
45
28
|
/** @internal */
|
|
46
29
|
export const CardPaymentPaymentMethod$inboundSchema: z.ZodType<
|
|
47
30
|
CardPaymentPaymentMethod,
|
|
@@ -49,13 +32,13 @@ export const CardPaymentPaymentMethod$inboundSchema: z.ZodType<
|
|
|
49
32
|
unknown
|
|
50
33
|
> = z.object({
|
|
51
34
|
paymentMethodID: z.string(),
|
|
52
|
-
paymentMethodType:
|
|
35
|
+
paymentMethodType: z.literal("card-payment"),
|
|
53
36
|
card: PaymentMethodsCard$inboundSchema,
|
|
54
37
|
});
|
|
55
38
|
/** @internal */
|
|
56
39
|
export type CardPaymentPaymentMethod$Outbound = {
|
|
57
40
|
paymentMethodID: string;
|
|
58
|
-
paymentMethodType:
|
|
41
|
+
paymentMethodType: "card-payment";
|
|
59
42
|
card: PaymentMethodsCard$Outbound;
|
|
60
43
|
};
|
|
61
44
|
|
|
@@ -66,7 +49,7 @@ export const CardPaymentPaymentMethod$outboundSchema: z.ZodType<
|
|
|
66
49
|
CardPaymentPaymentMethod
|
|
67
50
|
> = z.object({
|
|
68
51
|
paymentMethodID: z.string(),
|
|
69
|
-
paymentMethodType:
|
|
52
|
+
paymentMethodType: z.literal("card-payment"),
|
|
70
53
|
card: PaymentMethodsCard$outboundSchema,
|
|
71
54
|
});
|
|
72
55
|
|
|
@@ -4,7 +4,6 @@
|
|
|
4
4
|
|
|
5
5
|
import * as z from "zod/v3";
|
|
6
6
|
import { safeParse } from "../../lib/schemas.js";
|
|
7
|
-
import { ClosedEnum } from "../../types/enums.js";
|
|
8
7
|
import { Result as SafeParseResult } from "../../types/fp.js";
|
|
9
8
|
import { SDKValidationError } from "../errors/sdkvalidationerror.js";
|
|
10
9
|
import {
|
|
@@ -14,13 +13,6 @@ import {
|
|
|
14
13
|
TerminalCard$outboundSchema,
|
|
15
14
|
} from "./terminalcard.js";
|
|
16
15
|
|
|
17
|
-
export const CardPresentPaymentPaymentMethodPaymentMethodType = {
|
|
18
|
-
CardPresentPayment: "card-present-payment",
|
|
19
|
-
} as const;
|
|
20
|
-
export type CardPresentPaymentPaymentMethodPaymentMethodType = ClosedEnum<
|
|
21
|
-
typeof CardPresentPaymentPaymentMethodPaymentMethodType
|
|
22
|
-
>;
|
|
23
|
-
|
|
24
16
|
/**
|
|
25
17
|
* A card used at point of sale terminal for a card present transaction as contained within a payment method.
|
|
26
18
|
*/
|
|
@@ -29,22 +21,13 @@ export type CardPresentPaymentPaymentMethod = {
|
|
|
29
21
|
* ID of the payment method.
|
|
30
22
|
*/
|
|
31
23
|
paymentMethodID: string;
|
|
32
|
-
paymentMethodType:
|
|
24
|
+
paymentMethodType: "card-present-payment";
|
|
33
25
|
/**
|
|
34
26
|
* Describes payment card details captured with tap or in-person payment.
|
|
35
27
|
*/
|
|
36
28
|
terminalCard?: TerminalCard | undefined;
|
|
37
29
|
};
|
|
38
30
|
|
|
39
|
-
/** @internal */
|
|
40
|
-
export const CardPresentPaymentPaymentMethodPaymentMethodType$inboundSchema:
|
|
41
|
-
z.ZodNativeEnum<typeof CardPresentPaymentPaymentMethodPaymentMethodType> = z
|
|
42
|
-
.nativeEnum(CardPresentPaymentPaymentMethodPaymentMethodType);
|
|
43
|
-
/** @internal */
|
|
44
|
-
export const CardPresentPaymentPaymentMethodPaymentMethodType$outboundSchema:
|
|
45
|
-
z.ZodNativeEnum<typeof CardPresentPaymentPaymentMethodPaymentMethodType> =
|
|
46
|
-
CardPresentPaymentPaymentMethodPaymentMethodType$inboundSchema;
|
|
47
|
-
|
|
48
31
|
/** @internal */
|
|
49
32
|
export const CardPresentPaymentPaymentMethod$inboundSchema: z.ZodType<
|
|
50
33
|
CardPresentPaymentPaymentMethod,
|
|
@@ -52,14 +35,13 @@ export const CardPresentPaymentPaymentMethod$inboundSchema: z.ZodType<
|
|
|
52
35
|
unknown
|
|
53
36
|
> = z.object({
|
|
54
37
|
paymentMethodID: z.string(),
|
|
55
|
-
paymentMethodType:
|
|
56
|
-
CardPresentPaymentPaymentMethodPaymentMethodType$inboundSchema,
|
|
38
|
+
paymentMethodType: z.literal("card-present-payment"),
|
|
57
39
|
terminalCard: TerminalCard$inboundSchema.optional(),
|
|
58
40
|
});
|
|
59
41
|
/** @internal */
|
|
60
42
|
export type CardPresentPaymentPaymentMethod$Outbound = {
|
|
61
43
|
paymentMethodID: string;
|
|
62
|
-
paymentMethodType:
|
|
44
|
+
paymentMethodType: "card-present-payment";
|
|
63
45
|
terminalCard?: TerminalCard$Outbound | undefined;
|
|
64
46
|
};
|
|
65
47
|
|
|
@@ -70,8 +52,7 @@ export const CardPresentPaymentPaymentMethod$outboundSchema: z.ZodType<
|
|
|
70
52
|
CardPresentPaymentPaymentMethod
|
|
71
53
|
> = z.object({
|
|
72
54
|
paymentMethodID: z.string(),
|
|
73
|
-
paymentMethodType:
|
|
74
|
-
CardPresentPaymentPaymentMethodPaymentMethodType$outboundSchema,
|
|
55
|
+
paymentMethodType: z.literal("card-present-payment"),
|
|
75
56
|
terminalCard: TerminalCard$outboundSchema.optional(),
|
|
76
57
|
});
|
|
77
58
|
|
|
@@ -24,7 +24,7 @@ export type CreateEvidenceFileMultiPart = {
|
|
|
24
24
|
*
|
|
25
25
|
* @remarks
|
|
26
26
|
*
|
|
27
|
-
*
|
|
27
|
+
* The `Content-Type` header for this form part must be one of the following:
|
|
28
28
|
* - `image/jpeg`
|
|
29
29
|
* - `image/tiff`
|
|
30
30
|
* - `application/pdf`
|
|
@@ -13,11 +13,11 @@ import {
|
|
|
13
13
|
AmountDecimal$outboundSchema,
|
|
14
14
|
} from "./amountdecimal.js";
|
|
15
15
|
import {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
} from "./
|
|
16
|
+
CreateInvoiceLineItems,
|
|
17
|
+
CreateInvoiceLineItems$inboundSchema,
|
|
18
|
+
CreateInvoiceLineItems$Outbound,
|
|
19
|
+
CreateInvoiceLineItems$outboundSchema,
|
|
20
|
+
} from "./createinvoicelineitems.js";
|
|
21
21
|
|
|
22
22
|
export type CreateInvoice = {
|
|
23
23
|
customerAccountID: string;
|
|
@@ -25,7 +25,7 @@ export type CreateInvoice = {
|
|
|
25
25
|
/**
|
|
26
26
|
* A collection of line items for an invoice.
|
|
27
27
|
*/
|
|
28
|
-
lineItems:
|
|
28
|
+
lineItems: CreateInvoiceLineItems;
|
|
29
29
|
invoiceDate?: Date | undefined;
|
|
30
30
|
dueDate?: Date | undefined;
|
|
31
31
|
taxAmount?: AmountDecimal | undefined;
|
|
@@ -39,7 +39,7 @@ export const CreateInvoice$inboundSchema: z.ZodType<
|
|
|
39
39
|
> = z.object({
|
|
40
40
|
customerAccountID: z.string(),
|
|
41
41
|
description: z.string(),
|
|
42
|
-
lineItems:
|
|
42
|
+
lineItems: CreateInvoiceLineItems$inboundSchema,
|
|
43
43
|
invoiceDate: z.string().datetime({ offset: true }).transform(v => new Date(v))
|
|
44
44
|
.optional(),
|
|
45
45
|
dueDate: z.string().datetime({ offset: true }).transform(v => new Date(v))
|
|
@@ -50,7 +50,7 @@ export const CreateInvoice$inboundSchema: z.ZodType<
|
|
|
50
50
|
export type CreateInvoice$Outbound = {
|
|
51
51
|
customerAccountID: string;
|
|
52
52
|
description: string;
|
|
53
|
-
lineItems:
|
|
53
|
+
lineItems: CreateInvoiceLineItems$Outbound;
|
|
54
54
|
invoiceDate?: string | undefined;
|
|
55
55
|
dueDate?: string | undefined;
|
|
56
56
|
taxAmount?: AmountDecimal$Outbound | undefined;
|
|
@@ -64,7 +64,7 @@ export const CreateInvoice$outboundSchema: z.ZodType<
|
|
|
64
64
|
> = z.object({
|
|
65
65
|
customerAccountID: z.string(),
|
|
66
66
|
description: z.string(),
|
|
67
|
-
lineItems:
|
|
67
|
+
lineItems: CreateInvoiceLineItems$outboundSchema,
|
|
68
68
|
invoiceDate: z.date().transform(v => v.toISOString()).optional(),
|
|
69
69
|
dueDate: z.date().transform(v => v.toISOString()).optional(),
|
|
70
70
|
taxAmount: AmountDecimal$outboundSchema.optional(),
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod/v3";
|
|
6
|
+
import { safeParse } from "../../lib/schemas.js";
|
|
7
|
+
import { Result as SafeParseResult } from "../../types/fp.js";
|
|
8
|
+
import { SDKValidationError } from "../errors/sdkvalidationerror.js";
|
|
9
|
+
import {
|
|
10
|
+
AmountDecimal,
|
|
11
|
+
AmountDecimal$inboundSchema,
|
|
12
|
+
AmountDecimal$Outbound,
|
|
13
|
+
AmountDecimal$outboundSchema,
|
|
14
|
+
} from "./amountdecimal.js";
|
|
15
|
+
import {
|
|
16
|
+
CreateInvoiceLineItemOption,
|
|
17
|
+
CreateInvoiceLineItemOption$inboundSchema,
|
|
18
|
+
CreateInvoiceLineItemOption$Outbound,
|
|
19
|
+
CreateInvoiceLineItemOption$outboundSchema,
|
|
20
|
+
} from "./createinvoicelineitemoption.js";
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* Represents a single item in an invoice, including optional modifiers and quantity.
|
|
24
|
+
*/
|
|
25
|
+
export type CreateInvoiceLineItem = {
|
|
26
|
+
/**
|
|
27
|
+
* The name of the item.
|
|
28
|
+
*/
|
|
29
|
+
name: string;
|
|
30
|
+
/**
|
|
31
|
+
* The base price of the item before applying option modifiers.
|
|
32
|
+
*/
|
|
33
|
+
basePrice: AmountDecimal;
|
|
34
|
+
/**
|
|
35
|
+
* The quantity of this item.
|
|
36
|
+
*/
|
|
37
|
+
quantity: number;
|
|
38
|
+
/**
|
|
39
|
+
* Optional unique identifier associating the line item with a product.
|
|
40
|
+
*/
|
|
41
|
+
productID?: string | undefined;
|
|
42
|
+
/**
|
|
43
|
+
* Optional list of modifiers applied to this item (e.g., toppings, upgrades, customizations).
|
|
44
|
+
*/
|
|
45
|
+
options?: Array<CreateInvoiceLineItemOption> | undefined;
|
|
46
|
+
/**
|
|
47
|
+
* Optional list of images associated with this line item.
|
|
48
|
+
*/
|
|
49
|
+
imageIDs?: Array<string> | undefined;
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
/** @internal */
|
|
53
|
+
export const CreateInvoiceLineItem$inboundSchema: z.ZodType<
|
|
54
|
+
CreateInvoiceLineItem,
|
|
55
|
+
z.ZodTypeDef,
|
|
56
|
+
unknown
|
|
57
|
+
> = z.object({
|
|
58
|
+
name: z.string(),
|
|
59
|
+
basePrice: AmountDecimal$inboundSchema,
|
|
60
|
+
quantity: z.number().int(),
|
|
61
|
+
productID: z.string().optional(),
|
|
62
|
+
options: z.array(CreateInvoiceLineItemOption$inboundSchema).optional(),
|
|
63
|
+
imageIDs: z.array(z.string()).optional(),
|
|
64
|
+
});
|
|
65
|
+
/** @internal */
|
|
66
|
+
export type CreateInvoiceLineItem$Outbound = {
|
|
67
|
+
name: string;
|
|
68
|
+
basePrice: AmountDecimal$Outbound;
|
|
69
|
+
quantity: number;
|
|
70
|
+
productID?: string | undefined;
|
|
71
|
+
options?: Array<CreateInvoiceLineItemOption$Outbound> | undefined;
|
|
72
|
+
imageIDs?: Array<string> | undefined;
|
|
73
|
+
};
|
|
74
|
+
|
|
75
|
+
/** @internal */
|
|
76
|
+
export const CreateInvoiceLineItem$outboundSchema: z.ZodType<
|
|
77
|
+
CreateInvoiceLineItem$Outbound,
|
|
78
|
+
z.ZodTypeDef,
|
|
79
|
+
CreateInvoiceLineItem
|
|
80
|
+
> = z.object({
|
|
81
|
+
name: z.string(),
|
|
82
|
+
basePrice: AmountDecimal$outboundSchema,
|
|
83
|
+
quantity: z.number().int(),
|
|
84
|
+
productID: z.string().optional(),
|
|
85
|
+
options: z.array(CreateInvoiceLineItemOption$outboundSchema).optional(),
|
|
86
|
+
imageIDs: z.array(z.string()).optional(),
|
|
87
|
+
});
|
|
88
|
+
|
|
89
|
+
export function createInvoiceLineItemToJSON(
|
|
90
|
+
createInvoiceLineItem: CreateInvoiceLineItem,
|
|
91
|
+
): string {
|
|
92
|
+
return JSON.stringify(
|
|
93
|
+
CreateInvoiceLineItem$outboundSchema.parse(createInvoiceLineItem),
|
|
94
|
+
);
|
|
95
|
+
}
|
|
96
|
+
export function createInvoiceLineItemFromJSON(
|
|
97
|
+
jsonString: string,
|
|
98
|
+
): SafeParseResult<CreateInvoiceLineItem, SDKValidationError> {
|
|
99
|
+
return safeParse(
|
|
100
|
+
jsonString,
|
|
101
|
+
(x) => CreateInvoiceLineItem$inboundSchema.parse(JSON.parse(x)),
|
|
102
|
+
`Failed to parse 'CreateInvoiceLineItem' from JSON`,
|
|
103
|
+
);
|
|
104
|
+
}
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod/v3";
|
|
6
|
+
import { safeParse } from "../../lib/schemas.js";
|
|
7
|
+
import { Result as SafeParseResult } from "../../types/fp.js";
|
|
8
|
+
import { SDKValidationError } from "../errors/sdkvalidationerror.js";
|
|
9
|
+
import {
|
|
10
|
+
AmountDecimal,
|
|
11
|
+
AmountDecimal$inboundSchema,
|
|
12
|
+
AmountDecimal$Outbound,
|
|
13
|
+
AmountDecimal$outboundSchema,
|
|
14
|
+
} from "./amountdecimal.js";
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Represents a modifier or option applied to a line item.
|
|
18
|
+
*/
|
|
19
|
+
export type CreateInvoiceLineItemOption = {
|
|
20
|
+
/**
|
|
21
|
+
* The name of the option or modifier.
|
|
22
|
+
*/
|
|
23
|
+
name: string;
|
|
24
|
+
/**
|
|
25
|
+
* The quantity of this option.
|
|
26
|
+
*/
|
|
27
|
+
quantity: number;
|
|
28
|
+
/**
|
|
29
|
+
* Optional price modification applied by this option. Can be positive, negative, or zero.
|
|
30
|
+
*/
|
|
31
|
+
priceModifier?: AmountDecimal | undefined;
|
|
32
|
+
/**
|
|
33
|
+
* Optional group identifier to categorize related options (e.g., 'toppings').
|
|
34
|
+
*/
|
|
35
|
+
group?: string | undefined;
|
|
36
|
+
/**
|
|
37
|
+
* Optional list of images associated with this line item.
|
|
38
|
+
*/
|
|
39
|
+
imageIDs?: Array<string> | undefined;
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
/** @internal */
|
|
43
|
+
export const CreateInvoiceLineItemOption$inboundSchema: z.ZodType<
|
|
44
|
+
CreateInvoiceLineItemOption,
|
|
45
|
+
z.ZodTypeDef,
|
|
46
|
+
unknown
|
|
47
|
+
> = z.object({
|
|
48
|
+
name: z.string(),
|
|
49
|
+
quantity: z.number().int(),
|
|
50
|
+
priceModifier: AmountDecimal$inboundSchema.optional(),
|
|
51
|
+
group: z.string().optional(),
|
|
52
|
+
imageIDs: z.array(z.string()).optional(),
|
|
53
|
+
});
|
|
54
|
+
/** @internal */
|
|
55
|
+
export type CreateInvoiceLineItemOption$Outbound = {
|
|
56
|
+
name: string;
|
|
57
|
+
quantity: number;
|
|
58
|
+
priceModifier?: AmountDecimal$Outbound | undefined;
|
|
59
|
+
group?: string | undefined;
|
|
60
|
+
imageIDs?: Array<string> | undefined;
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
/** @internal */
|
|
64
|
+
export const CreateInvoiceLineItemOption$outboundSchema: z.ZodType<
|
|
65
|
+
CreateInvoiceLineItemOption$Outbound,
|
|
66
|
+
z.ZodTypeDef,
|
|
67
|
+
CreateInvoiceLineItemOption
|
|
68
|
+
> = z.object({
|
|
69
|
+
name: z.string(),
|
|
70
|
+
quantity: z.number().int(),
|
|
71
|
+
priceModifier: AmountDecimal$outboundSchema.optional(),
|
|
72
|
+
group: z.string().optional(),
|
|
73
|
+
imageIDs: z.array(z.string()).optional(),
|
|
74
|
+
});
|
|
75
|
+
|
|
76
|
+
export function createInvoiceLineItemOptionToJSON(
|
|
77
|
+
createInvoiceLineItemOption: CreateInvoiceLineItemOption,
|
|
78
|
+
): string {
|
|
79
|
+
return JSON.stringify(
|
|
80
|
+
CreateInvoiceLineItemOption$outboundSchema.parse(
|
|
81
|
+
createInvoiceLineItemOption,
|
|
82
|
+
),
|
|
83
|
+
);
|
|
84
|
+
}
|
|
85
|
+
export function createInvoiceLineItemOptionFromJSON(
|
|
86
|
+
jsonString: string,
|
|
87
|
+
): SafeParseResult<CreateInvoiceLineItemOption, SDKValidationError> {
|
|
88
|
+
return safeParse(
|
|
89
|
+
jsonString,
|
|
90
|
+
(x) => CreateInvoiceLineItemOption$inboundSchema.parse(JSON.parse(x)),
|
|
91
|
+
`Failed to parse 'CreateInvoiceLineItemOption' from JSON`,
|
|
92
|
+
);
|
|
93
|
+
}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod/v3";
|
|
6
|
+
import { safeParse } from "../../lib/schemas.js";
|
|
7
|
+
import { Result as SafeParseResult } from "../../types/fp.js";
|
|
8
|
+
import { SDKValidationError } from "../errors/sdkvalidationerror.js";
|
|
9
|
+
import {
|
|
10
|
+
AmountDecimalValidationError,
|
|
11
|
+
AmountDecimalValidationError$inboundSchema,
|
|
12
|
+
AmountDecimalValidationError$Outbound,
|
|
13
|
+
AmountDecimalValidationError$outboundSchema,
|
|
14
|
+
} from "./amountdecimalvalidationerror.js";
|
|
15
|
+
|
|
16
|
+
export type CreateInvoiceLineItemOptionValidationError = {
|
|
17
|
+
name?: string | undefined;
|
|
18
|
+
group?: string | undefined;
|
|
19
|
+
priceModifier?: AmountDecimalValidationError | undefined;
|
|
20
|
+
quantity?: string | undefined;
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
/** @internal */
|
|
24
|
+
export const CreateInvoiceLineItemOptionValidationError$inboundSchema:
|
|
25
|
+
z.ZodType<CreateInvoiceLineItemOptionValidationError, z.ZodTypeDef, unknown> =
|
|
26
|
+
z.object({
|
|
27
|
+
name: z.string().optional(),
|
|
28
|
+
group: z.string().optional(),
|
|
29
|
+
priceModifier: AmountDecimalValidationError$inboundSchema.optional(),
|
|
30
|
+
quantity: z.string().optional(),
|
|
31
|
+
});
|
|
32
|
+
/** @internal */
|
|
33
|
+
export type CreateInvoiceLineItemOptionValidationError$Outbound = {
|
|
34
|
+
name?: string | undefined;
|
|
35
|
+
group?: string | undefined;
|
|
36
|
+
priceModifier?: AmountDecimalValidationError$Outbound | undefined;
|
|
37
|
+
quantity?: string | undefined;
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
/** @internal */
|
|
41
|
+
export const CreateInvoiceLineItemOptionValidationError$outboundSchema:
|
|
42
|
+
z.ZodType<
|
|
43
|
+
CreateInvoiceLineItemOptionValidationError$Outbound,
|
|
44
|
+
z.ZodTypeDef,
|
|
45
|
+
CreateInvoiceLineItemOptionValidationError
|
|
46
|
+
> = z.object({
|
|
47
|
+
name: z.string().optional(),
|
|
48
|
+
group: z.string().optional(),
|
|
49
|
+
priceModifier: AmountDecimalValidationError$outboundSchema.optional(),
|
|
50
|
+
quantity: z.string().optional(),
|
|
51
|
+
});
|
|
52
|
+
|
|
53
|
+
export function createInvoiceLineItemOptionValidationErrorToJSON(
|
|
54
|
+
createInvoiceLineItemOptionValidationError:
|
|
55
|
+
CreateInvoiceLineItemOptionValidationError,
|
|
56
|
+
): string {
|
|
57
|
+
return JSON.stringify(
|
|
58
|
+
CreateInvoiceLineItemOptionValidationError$outboundSchema.parse(
|
|
59
|
+
createInvoiceLineItemOptionValidationError,
|
|
60
|
+
),
|
|
61
|
+
);
|
|
62
|
+
}
|
|
63
|
+
export function createInvoiceLineItemOptionValidationErrorFromJSON(
|
|
64
|
+
jsonString: string,
|
|
65
|
+
): SafeParseResult<
|
|
66
|
+
CreateInvoiceLineItemOptionValidationError,
|
|
67
|
+
SDKValidationError
|
|
68
|
+
> {
|
|
69
|
+
return safeParse(
|
|
70
|
+
jsonString,
|
|
71
|
+
(x) =>
|
|
72
|
+
CreateInvoiceLineItemOptionValidationError$inboundSchema.parse(
|
|
73
|
+
JSON.parse(x),
|
|
74
|
+
),
|
|
75
|
+
`Failed to parse 'CreateInvoiceLineItemOptionValidationError' from JSON`,
|
|
76
|
+
);
|
|
77
|
+
}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod/v3";
|
|
6
|
+
import { safeParse } from "../../lib/schemas.js";
|
|
7
|
+
import { Result as SafeParseResult } from "../../types/fp.js";
|
|
8
|
+
import { SDKValidationError } from "../errors/sdkvalidationerror.js";
|
|
9
|
+
import {
|
|
10
|
+
CreateInvoiceLineItem,
|
|
11
|
+
CreateInvoiceLineItem$inboundSchema,
|
|
12
|
+
CreateInvoiceLineItem$Outbound,
|
|
13
|
+
CreateInvoiceLineItem$outboundSchema,
|
|
14
|
+
} from "./createinvoicelineitem.js";
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* A collection of line items for an invoice.
|
|
18
|
+
*/
|
|
19
|
+
export type CreateInvoiceLineItems = {
|
|
20
|
+
/**
|
|
21
|
+
* The list of line items.
|
|
22
|
+
*/
|
|
23
|
+
items: Array<CreateInvoiceLineItem>;
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
/** @internal */
|
|
27
|
+
export const CreateInvoiceLineItems$inboundSchema: z.ZodType<
|
|
28
|
+
CreateInvoiceLineItems,
|
|
29
|
+
z.ZodTypeDef,
|
|
30
|
+
unknown
|
|
31
|
+
> = z.object({
|
|
32
|
+
items: z.array(CreateInvoiceLineItem$inboundSchema),
|
|
33
|
+
});
|
|
34
|
+
/** @internal */
|
|
35
|
+
export type CreateInvoiceLineItems$Outbound = {
|
|
36
|
+
items: Array<CreateInvoiceLineItem$Outbound>;
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
/** @internal */
|
|
40
|
+
export const CreateInvoiceLineItems$outboundSchema: z.ZodType<
|
|
41
|
+
CreateInvoiceLineItems$Outbound,
|
|
42
|
+
z.ZodTypeDef,
|
|
43
|
+
CreateInvoiceLineItems
|
|
44
|
+
> = z.object({
|
|
45
|
+
items: z.array(CreateInvoiceLineItem$outboundSchema),
|
|
46
|
+
});
|
|
47
|
+
|
|
48
|
+
export function createInvoiceLineItemsToJSON(
|
|
49
|
+
createInvoiceLineItems: CreateInvoiceLineItems,
|
|
50
|
+
): string {
|
|
51
|
+
return JSON.stringify(
|
|
52
|
+
CreateInvoiceLineItems$outboundSchema.parse(createInvoiceLineItems),
|
|
53
|
+
);
|
|
54
|
+
}
|
|
55
|
+
export function createInvoiceLineItemsFromJSON(
|
|
56
|
+
jsonString: string,
|
|
57
|
+
): SafeParseResult<CreateInvoiceLineItems, SDKValidationError> {
|
|
58
|
+
return safeParse(
|
|
59
|
+
jsonString,
|
|
60
|
+
(x) => CreateInvoiceLineItems$inboundSchema.parse(JSON.parse(x)),
|
|
61
|
+
`Failed to parse 'CreateInvoiceLineItems' from JSON`,
|
|
62
|
+
);
|
|
63
|
+
}
|