@moovio/sdk 0.21.14 → 0.21.16
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 +96 -47
- package/bin/mcp-server.js +2433 -819
- package/bin/mcp-server.js.map +63 -22
- package/examples/package-lock.json +1 -1
- package/funcs/invoicesCreateInvoice.d.ts +18 -0
- package/funcs/invoicesCreateInvoice.d.ts.map +1 -0
- package/funcs/invoicesCreateInvoice.js +139 -0
- package/funcs/invoicesCreateInvoice.js.map +1 -0
- package/funcs/invoicesGetInvoice.d.ts +17 -0
- package/funcs/invoicesGetInvoice.d.ts.map +1 -0
- package/funcs/invoicesGetInvoice.js +129 -0
- package/funcs/invoicesGetInvoice.js.map +1 -0
- package/funcs/invoicesListInvoices.d.ts +18 -0
- package/funcs/invoicesListInvoices.d.ts.map +1 -0
- package/funcs/invoicesListInvoices.js +135 -0
- package/funcs/invoicesListInvoices.js.map +1 -0
- package/funcs/invoicesMarkPaidInvoice.d.ts +19 -0
- package/funcs/invoicesMarkPaidInvoice.d.ts.map +1 -0
- package/funcs/invoicesMarkPaidInvoice.js +144 -0
- package/funcs/invoicesMarkPaidInvoice.js.map +1 -0
- package/funcs/invoicesUpdateInvoice.d.ts +18 -0
- package/funcs/invoicesUpdateInvoice.d.ts.map +1 -0
- package/funcs/invoicesUpdateInvoice.js +143 -0
- package/funcs/invoicesUpdateInvoice.js.map +1 -0
- package/jsr.json +1 -1
- package/lib/config.d.ts +3 -3
- package/lib/config.js +3 -3
- package/mcp-server/mcp-server.js +1 -1
- package/mcp-server/server.d.ts.map +1 -1
- package/mcp-server/server.js +11 -1
- package/mcp-server/server.js.map +1 -1
- package/mcp-server/tools/invoicesCreateInvoice.d.ts +8 -0
- package/mcp-server/tools/invoicesCreateInvoice.d.ts.map +1 -0
- package/mcp-server/tools/invoicesCreateInvoice.js +65 -0
- package/mcp-server/tools/invoicesCreateInvoice.js.map +1 -0
- package/mcp-server/tools/invoicesGetInvoice.d.ts +8 -0
- package/mcp-server/tools/invoicesGetInvoice.d.ts.map +1 -0
- package/mcp-server/tools/invoicesGetInvoice.js +65 -0
- package/mcp-server/tools/invoicesGetInvoice.js.map +1 -0
- package/mcp-server/tools/invoicesListInvoices.d.ts +8 -0
- package/mcp-server/tools/invoicesListInvoices.d.ts.map +1 -0
- package/mcp-server/tools/invoicesListInvoices.js +65 -0
- package/mcp-server/tools/invoicesListInvoices.js.map +1 -0
- package/mcp-server/tools/invoicesMarkPaidInvoice.d.ts +8 -0
- package/mcp-server/tools/invoicesMarkPaidInvoice.d.ts.map +1 -0
- package/mcp-server/tools/invoicesMarkPaidInvoice.js +66 -0
- package/mcp-server/tools/invoicesMarkPaidInvoice.js.map +1 -0
- package/mcp-server/tools/invoicesUpdateInvoice.d.ts +8 -0
- package/mcp-server/tools/invoicesUpdateInvoice.d.ts.map +1 -0
- package/mcp-server/tools/invoicesUpdateInvoice.js +65 -0
- package/mcp-server/tools/invoicesUpdateInvoice.js.map +1 -0
- package/models/components/amountdecimalupdate.d.ts +29 -0
- package/models/components/amountdecimalupdate.d.ts.map +1 -0
- package/models/components/{paymentlinklineitemsupdate.js → amountdecimalupdate.js} +14 -13
- package/models/components/amountdecimalupdate.js.map +1 -0
- package/models/components/createinvoice.d.ts +32 -0
- package/models/components/createinvoice.d.ts.map +1 -0
- package/models/components/createinvoice.js +72 -0
- package/models/components/createinvoice.js.map +1 -0
- package/models/components/createpaymentlink.d.ts +3 -3
- package/models/components/createpaymentlink.d.ts.map +1 -1
- package/models/components/createpaymentlink.js +3 -3
- package/models/components/createpaymentlink.js.map +1 -1
- package/models/components/createpaymentlinklineitem.d.ts +50 -0
- package/models/components/createpaymentlinklineitem.d.ts.map +1 -0
- package/models/components/createpaymentlinklineitem.js +70 -0
- package/models/components/createpaymentlinklineitem.js.map +1 -0
- package/models/components/createpaymentlinklineitemoption.d.ts +44 -0
- package/models/components/createpaymentlinklineitemoption.d.ts.map +1 -0
- package/models/components/createpaymentlinklineitemoption.js +67 -0
- package/models/components/createpaymentlinklineitemoption.js.map +1 -0
- package/models/components/createpaymentlinklineitemoptionvalidationerror.d.ts +24 -0
- package/models/components/createpaymentlinklineitemoptionvalidationerror.d.ts.map +1 -0
- package/models/components/createpaymentlinklineitemoptionvalidationerror.js +65 -0
- package/models/components/createpaymentlinklineitemoptionvalidationerror.js.map +1 -0
- package/models/components/createpaymentlinklineitems.d.ts +27 -0
- package/models/components/createpaymentlinklineitems.d.ts.map +1 -0
- package/models/components/{paymentlinklineitemsvalidationerror.js → createpaymentlinklineitems.js} +13 -13
- package/models/components/createpaymentlinklineitems.js.map +1 -0
- package/models/components/createpaymentlinklineitemsupdate.d.ts +27 -0
- package/models/components/createpaymentlinklineitemsupdate.d.ts.map +1 -0
- package/models/components/createpaymentlinklineitemsupdate.js +59 -0
- package/models/components/createpaymentlinklineitemsupdate.js.map +1 -0
- package/models/components/createpaymentlinklineitemsvalidationerror.d.ts +22 -0
- package/models/components/createpaymentlinklineitemsvalidationerror.d.ts.map +1 -0
- package/models/components/createpaymentlinklineitemsvalidationerror.js +61 -0
- package/models/components/createpaymentlinklineitemsvalidationerror.js.map +1 -0
- package/models/components/createpaymentlinklineitemvalidationerror.d.ts +31 -0
- package/models/components/createpaymentlinklineitemvalidationerror.d.ts.map +1 -0
- package/models/components/createpaymentlinklineitemvalidationerror.js +68 -0
- package/models/components/createpaymentlinklineitemvalidationerror.js.map +1 -0
- package/models/components/index.d.ts +26 -4
- package/models/components/index.d.ts.map +1 -1
- package/models/components/index.js +26 -4
- package/models/components/index.js.map +1 -1
- package/models/components/invoice.d.ts +81 -0
- package/models/components/invoice.d.ts.map +1 -0
- package/models/components/invoice.js +107 -0
- package/models/components/invoice.js.map +1 -0
- package/models/components/invoiceexternalpayment.d.ts +35 -0
- package/models/components/invoiceexternalpayment.d.ts.map +1 -0
- package/models/components/invoiceexternalpayment.js +75 -0
- package/models/components/invoiceexternalpayment.js.map +1 -0
- package/models/components/invoicelineitem.d.ts +45 -0
- package/models/components/invoicelineitem.d.ts.map +1 -0
- package/models/components/invoicelineitem.js +68 -0
- package/models/components/invoicelineitem.js.map +1 -0
- package/models/components/invoicelineitemoption.d.ts +39 -0
- package/models/components/invoicelineitemoption.d.ts.map +1 -0
- package/models/components/invoicelineitemoption.js +65 -0
- package/models/components/invoicelineitemoption.js.map +1 -0
- package/models/components/invoicelineitemoptionvalidationerror.d.ts +24 -0
- package/models/components/invoicelineitemoptionvalidationerror.d.ts.map +1 -0
- package/models/components/{paymentlinklineitemoptionvalidationerror.js → invoicelineitemoptionvalidationerror.js} +10 -10
- package/models/components/invoicelineitemoptionvalidationerror.js.map +1 -0
- package/models/components/invoicelineitems.d.ts +24 -0
- package/models/components/invoicelineitems.d.ts.map +1 -0
- package/models/components/invoicelineitems.js +59 -0
- package/models/components/invoicelineitems.js.map +1 -0
- package/models/components/invoicelineitemsupdate.d.ts +24 -0
- package/models/components/invoicelineitemsupdate.d.ts.map +1 -0
- package/models/components/invoicelineitemsupdate.js +59 -0
- package/models/components/invoicelineitemsupdate.js.map +1 -0
- package/models/components/invoicelineitemsvalidationerror.d.ts +22 -0
- package/models/components/invoicelineitemsvalidationerror.d.ts.map +1 -0
- package/models/components/invoicelineitemsvalidationerror.js +59 -0
- package/models/components/invoicelineitemsvalidationerror.js.map +1 -0
- package/models/components/invoicelineitemvalidationerror.d.ts +31 -0
- package/models/components/invoicelineitemvalidationerror.d.ts.map +1 -0
- package/models/components/{paymentlinklineitemvalidationerror.js → invoicelineitemvalidationerror.js} +13 -13
- package/models/components/invoicelineitemvalidationerror.js.map +1 -0
- package/models/components/invoicepayment.d.ts +23 -0
- package/models/components/invoicepayment.d.ts.map +1 -0
- package/models/components/invoicepayment.js +70 -0
- package/models/components/invoicepayment.js.map +1 -0
- package/models/components/invoicestatus.d.ts +16 -0
- package/models/components/invoicestatus.d.ts.map +1 -0
- package/models/components/invoicestatus.js +53 -0
- package/models/components/invoicestatus.js.map +1 -0
- package/models/components/invoicetransferpayment.d.ts +28 -0
- package/models/components/invoicetransferpayment.d.ts.map +1 -0
- package/models/components/invoicetransferpayment.js +68 -0
- package/models/components/invoicetransferpayment.js.map +1 -0
- package/models/components/markinvoicepaid.d.ts +21 -0
- package/models/components/markinvoicepaid.d.ts.map +1 -0
- package/models/components/markinvoicepaid.js +63 -0
- package/models/components/markinvoicepaid.js.map +1 -0
- package/models/components/paymentlinklineitem.d.ts +6 -0
- package/models/components/paymentlinklineitem.d.ts.map +1 -1
- package/models/components/paymentlinklineitem.js +3 -0
- package/models/components/paymentlinklineitem.js.map +1 -1
- package/models/components/paymentlinklineitemimagemetadata.d.ts +35 -0
- package/models/components/paymentlinklineitemimagemetadata.d.ts.map +1 -0
- package/models/components/paymentlinklineitemimagemetadata.js +64 -0
- package/models/components/paymentlinklineitemimagemetadata.js.map +1 -0
- package/models/components/paymentlinklineitemoption.d.ts +6 -0
- package/models/components/paymentlinklineitemoption.d.ts.map +1 -1
- package/models/components/paymentlinklineitemoption.js +3 -0
- package/models/components/paymentlinklineitemoption.js.map +1 -1
- package/models/components/updateinvoice.d.ts +36 -0
- package/models/components/updateinvoice.d.ts.map +1 -0
- package/models/components/updateinvoice.js +71 -0
- package/models/components/updateinvoice.js.map +1 -0
- package/models/components/updatepaymentlink.d.ts +3 -3
- package/models/components/updatepaymentlink.d.ts.map +1 -1
- package/models/components/updatepaymentlink.js +3 -3
- package/models/components/updatepaymentlink.js.map +1 -1
- package/models/components/webhookdata.d.ts +4 -2
- package/models/components/webhookdata.d.ts.map +1 -1
- package/models/components/webhookdata.js +6 -0
- package/models/components/webhookdata.js.map +1 -1
- package/models/components/webhookdatainvoicecreated.d.ts +19 -0
- package/models/components/webhookdatainvoicecreated.d.ts.map +1 -0
- package/models/components/webhookdatainvoicecreated.js +60 -0
- package/models/components/webhookdatainvoicecreated.js.map +1 -0
- package/models/components/webhookdatainvoiceupdated.d.ts +22 -0
- package/models/components/webhookdatainvoiceupdated.d.ts.map +1 -0
- package/models/components/webhookdatainvoiceupdated.js +63 -0
- package/models/components/webhookdatainvoiceupdated.js.map +1 -0
- package/models/components/webhookeventtype.d.ts +2 -0
- package/models/components/webhookeventtype.d.ts.map +1 -1
- package/models/components/webhookeventtype.js +2 -0
- package/models/components/webhookeventtype.js.map +1 -1
- package/models/errors/createinvoiceerror.d.ts +40 -0
- package/models/errors/createinvoiceerror.d.ts.map +1 -0
- package/models/errors/createinvoiceerror.js +100 -0
- package/models/errors/createinvoiceerror.js.map +1 -0
- package/models/errors/createpaymentlinkerror.d.ts +3 -3
- package/models/errors/createpaymentlinkerror.d.ts.map +1 -1
- package/models/errors/createpaymentlinkerror.js +3 -3
- package/models/errors/createpaymentlinkerror.js.map +1 -1
- package/models/errors/index.d.ts +4 -0
- package/models/errors/index.d.ts.map +1 -1
- package/models/errors/index.js +4 -0
- package/models/errors/index.js.map +1 -1
- package/models/errors/listinvoicesvalidationerror.d.ts +33 -0
- package/models/errors/listinvoicesvalidationerror.d.ts.map +1 -0
- package/models/errors/listinvoicesvalidationerror.js +88 -0
- package/models/errors/listinvoicesvalidationerror.js.map +1 -0
- package/models/errors/markinvoicepaiderror.d.ts +30 -0
- package/models/errors/markinvoicepaiderror.d.ts.map +1 -0
- package/models/errors/markinvoicepaiderror.js +83 -0
- package/models/errors/markinvoicepaiderror.js.map +1 -0
- package/models/errors/updateinvoiceerror.d.ts +40 -0
- package/models/errors/updateinvoiceerror.d.ts.map +1 -0
- package/models/errors/updateinvoiceerror.js +99 -0
- package/models/errors/updateinvoiceerror.js.map +1 -0
- package/models/errors/updatepaymentlinkerror.d.ts +3 -3
- package/models/errors/updatepaymentlinkerror.d.ts.map +1 -1
- package/models/errors/updatepaymentlinkerror.js +3 -3
- package/models/errors/updatepaymentlinkerror.js.map +1 -1
- package/models/operations/createinvoice.d.ts +66 -0
- package/models/operations/createinvoice.d.ts.map +1 -0
- package/models/operations/createinvoice.js +122 -0
- package/models/operations/createinvoice.js.map +1 -0
- package/models/operations/getinvoice.d.ts +66 -0
- package/models/operations/getinvoice.d.ts.map +1 -0
- package/models/operations/getinvoice.js +114 -0
- package/models/operations/getinvoice.js.map +1 -0
- package/models/operations/index.d.ts +5 -0
- package/models/operations/index.d.ts.map +1 -1
- package/models/operations/index.js +5 -0
- package/models/operations/index.js.map +1 -1
- package/models/operations/listinvoices.d.ts +72 -0
- package/models/operations/listinvoices.d.ts.map +1 -0
- package/models/operations/listinvoices.js +120 -0
- package/models/operations/listinvoices.js.map +1 -0
- package/models/operations/markpaidinvoice.d.ts +68 -0
- package/models/operations/markpaidinvoice.d.ts.map +1 -0
- package/models/operations/markpaidinvoice.js +124 -0
- package/models/operations/markpaidinvoice.js.map +1 -0
- package/models/operations/updateinvoice.d.ts +68 -0
- package/models/operations/updateinvoice.d.ts.map +1 -0
- package/models/operations/updateinvoice.js +124 -0
- package/models/operations/updateinvoice.js.map +1 -0
- package/package.json +1 -1
- package/sdk/invoices.d.ts +41 -0
- package/sdk/invoices.d.ts.map +1 -0
- package/sdk/invoices.js +63 -0
- package/sdk/invoices.js.map +1 -0
- package/sdk/sdk.d.ts +3 -0
- package/sdk/sdk.d.ts.map +1 -1
- package/sdk/sdk.js +4 -0
- package/sdk/sdk.js.map +1 -1
- package/src/funcs/invoicesCreateInvoice.ts +201 -0
- package/src/funcs/invoicesGetInvoice.ts +185 -0
- package/src/funcs/invoicesListInvoices.ts +194 -0
- package/src/funcs/invoicesMarkPaidInvoice.ts +208 -0
- package/src/funcs/invoicesUpdateInvoice.ts +207 -0
- package/src/lib/config.ts +3 -3
- package/src/mcp-server/mcp-server.ts +1 -1
- package/src/mcp-server/server.ts +11 -1
- package/src/mcp-server/tools/invoicesCreateInvoice.ts +38 -0
- package/src/mcp-server/tools/invoicesGetInvoice.ts +38 -0
- package/src/mcp-server/tools/invoicesListInvoices.ts +38 -0
- package/src/mcp-server/tools/invoicesMarkPaidInvoice.ts +39 -0
- package/src/mcp-server/tools/invoicesUpdateInvoice.ts +38 -0
- package/src/models/components/amountdecimalupdate.ts +65 -0
- package/src/models/components/createinvoice.ts +84 -0
- package/src/models/components/createpaymentlink.ts +10 -10
- package/src/models/components/createpaymentlinklineitem.ts +104 -0
- package/src/models/components/createpaymentlinklineitemoption.ts +93 -0
- package/src/models/components/createpaymentlinklineitemoptionvalidationerror.ts +80 -0
- package/src/models/components/createpaymentlinklineitems.ts +66 -0
- package/src/models/components/createpaymentlinklineitemsupdate.ts +68 -0
- package/src/models/components/createpaymentlinklineitemsvalidationerror.ts +71 -0
- package/src/models/components/createpaymentlinklineitemvalidationerror.ts +96 -0
- package/src/models/components/index.ts +26 -4
- package/src/models/components/invoice.ts +178 -0
- package/src/models/components/invoiceexternalpayment.ts +91 -0
- package/src/models/components/invoicelineitem.ts +95 -0
- package/src/models/components/invoicelineitemoption.ts +84 -0
- package/src/models/components/{paymentlinklineitemoptionvalidationerror.ts → invoicelineitemoptionvalidationerror.ts} +15 -21
- package/src/models/components/invoicelineitems.ts +63 -0
- package/src/models/components/invoicelineitemsupdate.ts +63 -0
- package/src/models/components/invoicelineitemsvalidationerror.ts +59 -0
- package/src/models/components/invoicelineitemvalidationerror.ts +85 -0
- package/src/models/components/invoicepayment.ts +77 -0
- package/src/models/components/invoicestatus.ts +25 -0
- package/src/models/components/invoicetransferpayment.ts +68 -0
- package/src/models/components/markinvoicepaid.ts +58 -0
- package/src/models/components/paymentlinklineitem.ts +13 -0
- package/src/models/components/paymentlinklineitemimagemetadata.ts +77 -0
- package/src/models/components/paymentlinklineitemoption.ts +13 -0
- package/src/models/components/updateinvoice.ts +94 -0
- package/src/models/components/updatepaymentlink.ts +10 -10
- package/src/models/components/webhookdata.ts +20 -0
- package/src/models/components/webhookdatainvoicecreated.ts +55 -0
- package/src/models/components/webhookdatainvoiceupdated.ts +64 -0
- package/src/models/components/webhookeventtype.ts +2 -0
- package/src/models/errors/createinvoiceerror.ts +102 -0
- package/src/models/errors/createpaymentlinkerror.ts +6 -6
- package/src/models/errors/index.ts +4 -0
- package/src/models/errors/listinvoicesvalidationerror.ts +86 -0
- package/src/models/errors/markinvoicepaiderror.ts +78 -0
- package/src/models/errors/updateinvoiceerror.ts +100 -0
- package/src/models/errors/updatepaymentlinkerror.ts +6 -6
- package/src/models/operations/createinvoice.ts +187 -0
- package/src/models/operations/getinvoice.ts +179 -0
- package/src/models/operations/index.ts +5 -0
- package/src/models/operations/listinvoices.ts +191 -0
- package/src/models/operations/markpaidinvoice.ts +191 -0
- package/src/models/operations/updateinvoice.ts +191 -0
- package/src/sdk/invoices.ts +100 -0
- package/src/sdk/sdk.ts +6 -0
- package/src/types/enums.ts +1 -21
- package/src/types/index.ts +2 -1
- package/src/types/unrecognized.ts +27 -0
- package/types/enums.d.ts +1 -8
- package/types/enums.d.ts.map +1 -1
- package/types/enums.js +3 -21
- package/types/enums.js.map +1 -1
- package/types/index.d.ts +2 -1
- package/types/index.d.ts.map +1 -1
- package/types/index.js +15 -0
- package/types/index.js.map +1 -1
- package/types/unrecognized.d.ts +10 -0
- package/types/unrecognized.d.ts.map +1 -0
- package/types/unrecognized.js +26 -0
- package/types/unrecognized.js.map +1 -0
- package/models/components/paymentlinklineitemoptionvalidationerror.d.ts +0 -24
- package/models/components/paymentlinklineitemoptionvalidationerror.d.ts.map +0 -1
- package/models/components/paymentlinklineitemoptionvalidationerror.js.map +0 -1
- package/models/components/paymentlinklineitemsupdate.d.ts +0 -27
- package/models/components/paymentlinklineitemsupdate.d.ts.map +0 -1
- package/models/components/paymentlinklineitemsupdate.js.map +0 -1
- package/models/components/paymentlinklineitemsvalidationerror.d.ts +0 -22
- package/models/components/paymentlinklineitemsvalidationerror.d.ts.map +0 -1
- package/models/components/paymentlinklineitemsvalidationerror.js.map +0 -1
- package/models/components/paymentlinklineitemvalidationerror.d.ts +0 -31
- package/models/components/paymentlinklineitemvalidationerror.d.ts.map +0 -1
- package/models/components/paymentlinklineitemvalidationerror.js.map +0 -1
- package/src/models/components/paymentlinklineitemsupdate.ts +0 -66
- package/src/models/components/paymentlinklineitemsvalidationerror.ts +0 -62
- package/src/models/components/paymentlinklineitemvalidationerror.ts +0 -88
|
@@ -0,0 +1,207 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import { MoovCore } from "../core.js";
|
|
6
|
+
import { encodeJSON, encodeSimple } from "../lib/encodings.js";
|
|
7
|
+
import * as M from "../lib/matchers.js";
|
|
8
|
+
import { compactMap } from "../lib/primitives.js";
|
|
9
|
+
import { safeParse } from "../lib/schemas.js";
|
|
10
|
+
import { RequestOptions } from "../lib/sdks.js";
|
|
11
|
+
import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
|
|
12
|
+
import { pathToFunc } from "../lib/url.js";
|
|
13
|
+
import {
|
|
14
|
+
ConnectionError,
|
|
15
|
+
InvalidRequestError,
|
|
16
|
+
RequestAbortedError,
|
|
17
|
+
RequestTimeoutError,
|
|
18
|
+
UnexpectedClientError,
|
|
19
|
+
} from "../models/errors/httpclienterrors.js";
|
|
20
|
+
import * as errors from "../models/errors/index.js";
|
|
21
|
+
import { MoovError } from "../models/errors/mooverror.js";
|
|
22
|
+
import { ResponseValidationError } from "../models/errors/responsevalidationerror.js";
|
|
23
|
+
import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
|
|
24
|
+
import * as operations from "../models/operations/index.js";
|
|
25
|
+
import { APICall, APIPromise } from "../types/async.js";
|
|
26
|
+
import { Result } from "../types/fp.js";
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* Updates an invoice.
|
|
30
|
+
*
|
|
31
|
+
* To access this endpoint using an [access token](https://docs.moov.io/api/authentication/access-tokens/)
|
|
32
|
+
* you'll need to specify the `/accounts/{accountID}/invoices.write` scope.
|
|
33
|
+
*/
|
|
34
|
+
export function invoicesUpdateInvoice(
|
|
35
|
+
client: MoovCore,
|
|
36
|
+
request: operations.UpdateInvoiceRequest,
|
|
37
|
+
options?: RequestOptions,
|
|
38
|
+
): APIPromise<
|
|
39
|
+
Result<
|
|
40
|
+
operations.UpdateInvoiceResponse,
|
|
41
|
+
| errors.GenericError
|
|
42
|
+
| errors.UpdateInvoiceError
|
|
43
|
+
| MoovError
|
|
44
|
+
| ResponseValidationError
|
|
45
|
+
| ConnectionError
|
|
46
|
+
| RequestAbortedError
|
|
47
|
+
| RequestTimeoutError
|
|
48
|
+
| InvalidRequestError
|
|
49
|
+
| UnexpectedClientError
|
|
50
|
+
| SDKValidationError
|
|
51
|
+
>
|
|
52
|
+
> {
|
|
53
|
+
return new APIPromise($do(
|
|
54
|
+
client,
|
|
55
|
+
request,
|
|
56
|
+
options,
|
|
57
|
+
));
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
async function $do(
|
|
61
|
+
client: MoovCore,
|
|
62
|
+
request: operations.UpdateInvoiceRequest,
|
|
63
|
+
options?: RequestOptions,
|
|
64
|
+
): Promise<
|
|
65
|
+
[
|
|
66
|
+
Result<
|
|
67
|
+
operations.UpdateInvoiceResponse,
|
|
68
|
+
| errors.GenericError
|
|
69
|
+
| errors.UpdateInvoiceError
|
|
70
|
+
| MoovError
|
|
71
|
+
| ResponseValidationError
|
|
72
|
+
| ConnectionError
|
|
73
|
+
| RequestAbortedError
|
|
74
|
+
| RequestTimeoutError
|
|
75
|
+
| InvalidRequestError
|
|
76
|
+
| UnexpectedClientError
|
|
77
|
+
| SDKValidationError
|
|
78
|
+
>,
|
|
79
|
+
APICall,
|
|
80
|
+
]
|
|
81
|
+
> {
|
|
82
|
+
const parsed = safeParse(
|
|
83
|
+
request,
|
|
84
|
+
(value) => operations.UpdateInvoiceRequest$outboundSchema.parse(value),
|
|
85
|
+
"Input validation failed",
|
|
86
|
+
);
|
|
87
|
+
if (!parsed.ok) {
|
|
88
|
+
return [parsed, { status: "invalid" }];
|
|
89
|
+
}
|
|
90
|
+
const payload = parsed.value;
|
|
91
|
+
const body = encodeJSON("body", payload.UpdateInvoice, { explode: true });
|
|
92
|
+
|
|
93
|
+
const pathParams = {
|
|
94
|
+
accountID: encodeSimple("accountID", payload.accountID, {
|
|
95
|
+
explode: false,
|
|
96
|
+
charEncoding: "percent",
|
|
97
|
+
}),
|
|
98
|
+
invoiceID: encodeSimple("invoiceID", payload.invoiceID, {
|
|
99
|
+
explode: false,
|
|
100
|
+
charEncoding: "percent",
|
|
101
|
+
}),
|
|
102
|
+
};
|
|
103
|
+
|
|
104
|
+
const path = pathToFunc("/accounts/{accountID}/invoices/{invoiceID}")(
|
|
105
|
+
pathParams,
|
|
106
|
+
);
|
|
107
|
+
|
|
108
|
+
const headers = new Headers(compactMap({
|
|
109
|
+
"Content-Type": "application/json",
|
|
110
|
+
Accept: "application/json",
|
|
111
|
+
"X-Moov-Version": encodeSimple(
|
|
112
|
+
"X-Moov-Version",
|
|
113
|
+
client._options.xMoovVersion,
|
|
114
|
+
{ explode: false, charEncoding: "none" },
|
|
115
|
+
),
|
|
116
|
+
}));
|
|
117
|
+
|
|
118
|
+
const securityInput = await extractSecurity(client._options.security);
|
|
119
|
+
const requestSecurity = resolveGlobalSecurity(securityInput);
|
|
120
|
+
|
|
121
|
+
const context = {
|
|
122
|
+
options: client._options,
|
|
123
|
+
baseURL: options?.serverURL ?? client._baseURL ?? "",
|
|
124
|
+
operationID: "updateInvoice",
|
|
125
|
+
oAuth2Scopes: null,
|
|
126
|
+
|
|
127
|
+
resolvedSecurity: requestSecurity,
|
|
128
|
+
|
|
129
|
+
securitySource: client._options.security,
|
|
130
|
+
retryConfig: options?.retries
|
|
131
|
+
|| client._options.retryConfig
|
|
132
|
+
|| { strategy: "none" },
|
|
133
|
+
retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
|
|
134
|
+
};
|
|
135
|
+
|
|
136
|
+
const requestRes = client._createRequest(context, {
|
|
137
|
+
security: requestSecurity,
|
|
138
|
+
method: "PATCH",
|
|
139
|
+
baseURL: options?.serverURL,
|
|
140
|
+
path: path,
|
|
141
|
+
headers: headers,
|
|
142
|
+
body: body,
|
|
143
|
+
userAgent: client._options.userAgent,
|
|
144
|
+
timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
|
|
145
|
+
}, options);
|
|
146
|
+
if (!requestRes.ok) {
|
|
147
|
+
return [requestRes, { status: "invalid" }];
|
|
148
|
+
}
|
|
149
|
+
const req = requestRes.value;
|
|
150
|
+
|
|
151
|
+
const doResult = await client._do(req, {
|
|
152
|
+
context,
|
|
153
|
+
errorCodes: [
|
|
154
|
+
"400",
|
|
155
|
+
"401",
|
|
156
|
+
"403",
|
|
157
|
+
"404",
|
|
158
|
+
"409",
|
|
159
|
+
"422",
|
|
160
|
+
"429",
|
|
161
|
+
"4XX",
|
|
162
|
+
"500",
|
|
163
|
+
"504",
|
|
164
|
+
"5XX",
|
|
165
|
+
],
|
|
166
|
+
retryConfig: context.retryConfig,
|
|
167
|
+
retryCodes: context.retryCodes,
|
|
168
|
+
});
|
|
169
|
+
if (!doResult.ok) {
|
|
170
|
+
return [doResult, { status: "request-error", request: req }];
|
|
171
|
+
}
|
|
172
|
+
const response = doResult.value;
|
|
173
|
+
|
|
174
|
+
const responseFields = {
|
|
175
|
+
HttpMeta: { Response: response, Request: req },
|
|
176
|
+
};
|
|
177
|
+
|
|
178
|
+
const [result] = await M.match<
|
|
179
|
+
operations.UpdateInvoiceResponse,
|
|
180
|
+
| errors.GenericError
|
|
181
|
+
| errors.UpdateInvoiceError
|
|
182
|
+
| MoovError
|
|
183
|
+
| ResponseValidationError
|
|
184
|
+
| ConnectionError
|
|
185
|
+
| RequestAbortedError
|
|
186
|
+
| RequestTimeoutError
|
|
187
|
+
| InvalidRequestError
|
|
188
|
+
| UnexpectedClientError
|
|
189
|
+
| SDKValidationError
|
|
190
|
+
>(
|
|
191
|
+
M.json(200, operations.UpdateInvoiceResponse$inboundSchema, {
|
|
192
|
+
hdrs: true,
|
|
193
|
+
key: "Result",
|
|
194
|
+
}),
|
|
195
|
+
M.jsonErr([400, 409], errors.GenericError$inboundSchema, { hdrs: true }),
|
|
196
|
+
M.jsonErr(422, errors.UpdateInvoiceError$inboundSchema, { hdrs: true }),
|
|
197
|
+
M.fail([401, 403, 404, 429]),
|
|
198
|
+
M.fail([500, 504]),
|
|
199
|
+
M.fail("4XX"),
|
|
200
|
+
M.fail("5XX"),
|
|
201
|
+
)(response, req, { extraFields: responseFields });
|
|
202
|
+
if (!result.ok) {
|
|
203
|
+
return [result, { status: "complete", request: req, response }];
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
return [result, { status: "complete", request: req, response }];
|
|
207
|
+
}
|
package/src/lib/config.ts
CHANGED
|
@@ -73,7 +73,7 @@ export function serverURLFromOptions(options: SDKOptions): URL | null {
|
|
|
73
73
|
export const SDK_METADATA = {
|
|
74
74
|
language: "typescript",
|
|
75
75
|
openapiDocVersion: "latest",
|
|
76
|
-
sdkVersion: "0.21.
|
|
77
|
-
genVersion: "2.
|
|
78
|
-
userAgent: "speakeasy-sdk/typescript 0.21.
|
|
76
|
+
sdkVersion: "0.21.16",
|
|
77
|
+
genVersion: "2.760.2",
|
|
78
|
+
userAgent: "speakeasy-sdk/typescript 0.21.16 2.760.2 latest @moovio/sdk",
|
|
79
79
|
} as const;
|
package/src/mcp-server/server.ts
CHANGED
|
@@ -102,6 +102,11 @@ import { tool$imagesUpload } from "./tools/imagesUpload.js";
|
|
|
102
102
|
import { tool$industriesList } from "./tools/industriesList.js";
|
|
103
103
|
import { tool$institutionsSearch } from "./tools/institutionsSearch.js";
|
|
104
104
|
import { tool$institutionsSearchInstitutions } from "./tools/institutionsSearchInstitutions.js";
|
|
105
|
+
import { tool$invoicesCreateInvoice } from "./tools/invoicesCreateInvoice.js";
|
|
106
|
+
import { tool$invoicesGetInvoice } from "./tools/invoicesGetInvoice.js";
|
|
107
|
+
import { tool$invoicesListInvoices } from "./tools/invoicesListInvoices.js";
|
|
108
|
+
import { tool$invoicesMarkPaidInvoice } from "./tools/invoicesMarkPaidInvoice.js";
|
|
109
|
+
import { tool$invoicesUpdateInvoice } from "./tools/invoicesUpdateInvoice.js";
|
|
105
110
|
import { tool$issuingTransactionsGet } from "./tools/issuingTransactionsGet.js";
|
|
106
111
|
import { tool$issuingTransactionsGetAuthorization } from "./tools/issuingTransactionsGetAuthorization.js";
|
|
107
112
|
import { tool$issuingTransactionsList } from "./tools/issuingTransactionsList.js";
|
|
@@ -188,7 +193,7 @@ export function createMCPServer(deps: {
|
|
|
188
193
|
}) {
|
|
189
194
|
const server = new McpServer({
|
|
190
195
|
name: "Moov",
|
|
191
|
-
version: "0.21.
|
|
196
|
+
version: "0.21.16",
|
|
192
197
|
});
|
|
193
198
|
|
|
194
199
|
const client = new MoovCore({
|
|
@@ -289,6 +294,11 @@ export function createMCPServer(deps: {
|
|
|
289
294
|
tool(tool$imagesDelete);
|
|
290
295
|
tool(tool$imagesUpdateMetadata);
|
|
291
296
|
tool(tool$imagesGetPublic);
|
|
297
|
+
tool(tool$invoicesCreateInvoice);
|
|
298
|
+
tool(tool$invoicesListInvoices);
|
|
299
|
+
tool(tool$invoicesGetInvoice);
|
|
300
|
+
tool(tool$invoicesUpdateInvoice);
|
|
301
|
+
tool(tool$invoicesMarkPaidInvoice);
|
|
292
302
|
tool(tool$paymentLinksCreate);
|
|
293
303
|
tool(tool$paymentLinksList);
|
|
294
304
|
tool(tool$paymentLinksGet);
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import { invoicesCreateInvoice } from "../../funcs/invoicesCreateInvoice.js";
|
|
6
|
+
import * as operations from "../../models/operations/index.js";
|
|
7
|
+
import { formatResult, ToolDefinition } from "../tools.js";
|
|
8
|
+
|
|
9
|
+
const args = {
|
|
10
|
+
request: operations.CreateInvoiceRequest$inboundSchema,
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
export const tool$invoicesCreateInvoice: ToolDefinition<typeof args> = {
|
|
14
|
+
name: "invoices-create-invoice",
|
|
15
|
+
description: `Create an invoice for a Moov account.
|
|
16
|
+
|
|
17
|
+
To access this endpoint using an [access token](https://docs.moov.io/api/authentication/access-tokens/)
|
|
18
|
+
you'll need to specify the \`/accounts/{accountID}/invoices.write\` scope.`,
|
|
19
|
+
args,
|
|
20
|
+
tool: async (client, args, ctx) => {
|
|
21
|
+
const [result, apiCall] = await invoicesCreateInvoice(
|
|
22
|
+
client,
|
|
23
|
+
args.request,
|
|
24
|
+
{ fetchOptions: { signal: ctx.signal } },
|
|
25
|
+
).$inspect();
|
|
26
|
+
|
|
27
|
+
if (!result.ok) {
|
|
28
|
+
return {
|
|
29
|
+
content: [{ type: "text", text: result.error.message }],
|
|
30
|
+
isError: true,
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
const value = result.value.result;
|
|
35
|
+
|
|
36
|
+
return formatResult(value, apiCall);
|
|
37
|
+
},
|
|
38
|
+
};
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import { invoicesGetInvoice } from "../../funcs/invoicesGetInvoice.js";
|
|
6
|
+
import * as operations from "../../models/operations/index.js";
|
|
7
|
+
import { formatResult, ToolDefinition } from "../tools.js";
|
|
8
|
+
|
|
9
|
+
const args = {
|
|
10
|
+
request: operations.GetInvoiceRequest$inboundSchema,
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
export const tool$invoicesGetInvoice: ToolDefinition<typeof args> = {
|
|
14
|
+
name: "invoices-get-invoice",
|
|
15
|
+
description: `Retrieve an invoice by ID.
|
|
16
|
+
|
|
17
|
+
To access this endpoint using an [access token](https://docs.moov.io/api/authentication/access-tokens/)
|
|
18
|
+
you'll need to specify the \`/accounts/{accountID}/invoices.read\` scope.`,
|
|
19
|
+
args,
|
|
20
|
+
tool: async (client, args, ctx) => {
|
|
21
|
+
const [result, apiCall] = await invoicesGetInvoice(
|
|
22
|
+
client,
|
|
23
|
+
args.request,
|
|
24
|
+
{ fetchOptions: { signal: ctx.signal } },
|
|
25
|
+
).$inspect();
|
|
26
|
+
|
|
27
|
+
if (!result.ok) {
|
|
28
|
+
return {
|
|
29
|
+
content: [{ type: "text", text: result.error.message }],
|
|
30
|
+
isError: true,
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
const value = result.value.result;
|
|
35
|
+
|
|
36
|
+
return formatResult(value, apiCall);
|
|
37
|
+
},
|
|
38
|
+
};
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import { invoicesListInvoices } from "../../funcs/invoicesListInvoices.js";
|
|
6
|
+
import * as operations from "../../models/operations/index.js";
|
|
7
|
+
import { formatResult, ToolDefinition } from "../tools.js";
|
|
8
|
+
|
|
9
|
+
const args = {
|
|
10
|
+
request: operations.ListInvoicesRequest$inboundSchema,
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
export const tool$invoicesListInvoices: ToolDefinition<typeof args> = {
|
|
14
|
+
name: "invoices-list-invoices",
|
|
15
|
+
description: `List all the invoices created under a Moov account.
|
|
16
|
+
|
|
17
|
+
To access this endpoint using an [access token](https://docs.moov.io/api/authentication/access-tokens/)
|
|
18
|
+
you'll need to specify the \`/accounts/{accountID}/invoices.read\` scope.`,
|
|
19
|
+
args,
|
|
20
|
+
tool: async (client, args, ctx) => {
|
|
21
|
+
const [result, apiCall] = await invoicesListInvoices(
|
|
22
|
+
client,
|
|
23
|
+
args.request,
|
|
24
|
+
{ fetchOptions: { signal: ctx.signal } },
|
|
25
|
+
).$inspect();
|
|
26
|
+
|
|
27
|
+
if (!result.ok) {
|
|
28
|
+
return {
|
|
29
|
+
content: [{ type: "text", text: result.error.message }],
|
|
30
|
+
isError: true,
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
const value = result.value.result;
|
|
35
|
+
|
|
36
|
+
return formatResult(value, apiCall);
|
|
37
|
+
},
|
|
38
|
+
};
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import { invoicesMarkPaidInvoice } from "../../funcs/invoicesMarkPaidInvoice.js";
|
|
6
|
+
import * as operations from "../../models/operations/index.js";
|
|
7
|
+
import { formatResult, ToolDefinition } from "../tools.js";
|
|
8
|
+
|
|
9
|
+
const args = {
|
|
10
|
+
request: operations.MarkPaidInvoiceRequest$inboundSchema,
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
export const tool$invoicesMarkPaidInvoice: ToolDefinition<typeof args> = {
|
|
14
|
+
name: "invoices-mark-paid-invoice",
|
|
15
|
+
description: `Marks an invoice as paid outside of the Moov platform.
|
|
16
|
+
If a payment link was created, the corresponding payment link is canceled, but a receipt is still sent.
|
|
17
|
+
|
|
18
|
+
To access this endpoint using an [access token](https://docs.moov.io/api/authentication/access-tokens/)
|
|
19
|
+
you'll need to specify the \`/accounts/{accountID}/invoices.write\` scope.`,
|
|
20
|
+
args,
|
|
21
|
+
tool: async (client, args, ctx) => {
|
|
22
|
+
const [result, apiCall] = await invoicesMarkPaidInvoice(
|
|
23
|
+
client,
|
|
24
|
+
args.request,
|
|
25
|
+
{ fetchOptions: { signal: ctx.signal } },
|
|
26
|
+
).$inspect();
|
|
27
|
+
|
|
28
|
+
if (!result.ok) {
|
|
29
|
+
return {
|
|
30
|
+
content: [{ type: "text", text: result.error.message }],
|
|
31
|
+
isError: true,
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
const value = result.value.result;
|
|
36
|
+
|
|
37
|
+
return formatResult(value, apiCall);
|
|
38
|
+
},
|
|
39
|
+
};
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import { invoicesUpdateInvoice } from "../../funcs/invoicesUpdateInvoice.js";
|
|
6
|
+
import * as operations from "../../models/operations/index.js";
|
|
7
|
+
import { formatResult, ToolDefinition } from "../tools.js";
|
|
8
|
+
|
|
9
|
+
const args = {
|
|
10
|
+
request: operations.UpdateInvoiceRequest$inboundSchema,
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
export const tool$invoicesUpdateInvoice: ToolDefinition<typeof args> = {
|
|
14
|
+
name: "invoices-update-invoice",
|
|
15
|
+
description: `Updates an invoice.
|
|
16
|
+
|
|
17
|
+
To access this endpoint using an [access token](https://docs.moov.io/api/authentication/access-tokens/)
|
|
18
|
+
you'll need to specify the \`/accounts/{accountID}/invoices.write\` scope.`,
|
|
19
|
+
args,
|
|
20
|
+
tool: async (client, args, ctx) => {
|
|
21
|
+
const [result, apiCall] = await invoicesUpdateInvoice(
|
|
22
|
+
client,
|
|
23
|
+
args.request,
|
|
24
|
+
{ fetchOptions: { signal: ctx.signal } },
|
|
25
|
+
).$inspect();
|
|
26
|
+
|
|
27
|
+
if (!result.ok) {
|
|
28
|
+
return {
|
|
29
|
+
content: [{ type: "text", text: result.error.message }],
|
|
30
|
+
isError: true,
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
const value = result.value.result;
|
|
35
|
+
|
|
36
|
+
return formatResult(value, apiCall);
|
|
37
|
+
},
|
|
38
|
+
};
|
|
@@ -0,0 +1,65 @@
|
|
|
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
|
+
|
|
10
|
+
export type AmountDecimalUpdate = {
|
|
11
|
+
/**
|
|
12
|
+
* A 3-letter ISO 4217 currency code.
|
|
13
|
+
*/
|
|
14
|
+
currency?: string | undefined;
|
|
15
|
+
/**
|
|
16
|
+
* A decimal-formatted numerical string that represents up to 9 decimal place precision.
|
|
17
|
+
*
|
|
18
|
+
* @remarks
|
|
19
|
+
*
|
|
20
|
+
* For example, $12.987654321 is '12.987654321'.
|
|
21
|
+
*/
|
|
22
|
+
valueDecimal?: string | undefined;
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
/** @internal */
|
|
26
|
+
export const AmountDecimalUpdate$inboundSchema: z.ZodType<
|
|
27
|
+
AmountDecimalUpdate,
|
|
28
|
+
z.ZodTypeDef,
|
|
29
|
+
unknown
|
|
30
|
+
> = z.object({
|
|
31
|
+
currency: z.string().optional(),
|
|
32
|
+
valueDecimal: z.string().optional(),
|
|
33
|
+
});
|
|
34
|
+
/** @internal */
|
|
35
|
+
export type AmountDecimalUpdate$Outbound = {
|
|
36
|
+
currency?: string | undefined;
|
|
37
|
+
valueDecimal?: string | undefined;
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
/** @internal */
|
|
41
|
+
export const AmountDecimalUpdate$outboundSchema: z.ZodType<
|
|
42
|
+
AmountDecimalUpdate$Outbound,
|
|
43
|
+
z.ZodTypeDef,
|
|
44
|
+
AmountDecimalUpdate
|
|
45
|
+
> = z.object({
|
|
46
|
+
currency: z.string().optional(),
|
|
47
|
+
valueDecimal: z.string().optional(),
|
|
48
|
+
});
|
|
49
|
+
|
|
50
|
+
export function amountDecimalUpdateToJSON(
|
|
51
|
+
amountDecimalUpdate: AmountDecimalUpdate,
|
|
52
|
+
): string {
|
|
53
|
+
return JSON.stringify(
|
|
54
|
+
AmountDecimalUpdate$outboundSchema.parse(amountDecimalUpdate),
|
|
55
|
+
);
|
|
56
|
+
}
|
|
57
|
+
export function amountDecimalUpdateFromJSON(
|
|
58
|
+
jsonString: string,
|
|
59
|
+
): SafeParseResult<AmountDecimalUpdate, SDKValidationError> {
|
|
60
|
+
return safeParse(
|
|
61
|
+
jsonString,
|
|
62
|
+
(x) => AmountDecimalUpdate$inboundSchema.parse(JSON.parse(x)),
|
|
63
|
+
`Failed to parse 'AmountDecimalUpdate' from JSON`,
|
|
64
|
+
);
|
|
65
|
+
}
|
|
@@ -0,0 +1,84 @@
|
|
|
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
|
+
InvoiceLineItems,
|
|
17
|
+
InvoiceLineItems$inboundSchema,
|
|
18
|
+
InvoiceLineItems$Outbound,
|
|
19
|
+
InvoiceLineItems$outboundSchema,
|
|
20
|
+
} from "./invoicelineitems.js";
|
|
21
|
+
|
|
22
|
+
export type CreateInvoice = {
|
|
23
|
+
customerAccountID: string;
|
|
24
|
+
description: string;
|
|
25
|
+
/**
|
|
26
|
+
* A collection of line items for an invoice.
|
|
27
|
+
*/
|
|
28
|
+
lineItems: InvoiceLineItems;
|
|
29
|
+
invoiceDate?: Date | undefined;
|
|
30
|
+
dueDate?: Date | undefined;
|
|
31
|
+
taxAmount?: AmountDecimal | undefined;
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
/** @internal */
|
|
35
|
+
export const CreateInvoice$inboundSchema: z.ZodType<
|
|
36
|
+
CreateInvoice,
|
|
37
|
+
z.ZodTypeDef,
|
|
38
|
+
unknown
|
|
39
|
+
> = z.object({
|
|
40
|
+
customerAccountID: z.string(),
|
|
41
|
+
description: z.string(),
|
|
42
|
+
lineItems: InvoiceLineItems$inboundSchema,
|
|
43
|
+
invoiceDate: z.string().datetime({ offset: true }).transform(v => new Date(v))
|
|
44
|
+
.optional(),
|
|
45
|
+
dueDate: z.string().datetime({ offset: true }).transform(v => new Date(v))
|
|
46
|
+
.optional(),
|
|
47
|
+
taxAmount: AmountDecimal$inboundSchema.optional(),
|
|
48
|
+
});
|
|
49
|
+
/** @internal */
|
|
50
|
+
export type CreateInvoice$Outbound = {
|
|
51
|
+
customerAccountID: string;
|
|
52
|
+
description: string;
|
|
53
|
+
lineItems: InvoiceLineItems$Outbound;
|
|
54
|
+
invoiceDate?: string | undefined;
|
|
55
|
+
dueDate?: string | undefined;
|
|
56
|
+
taxAmount?: AmountDecimal$Outbound | undefined;
|
|
57
|
+
};
|
|
58
|
+
|
|
59
|
+
/** @internal */
|
|
60
|
+
export const CreateInvoice$outboundSchema: z.ZodType<
|
|
61
|
+
CreateInvoice$Outbound,
|
|
62
|
+
z.ZodTypeDef,
|
|
63
|
+
CreateInvoice
|
|
64
|
+
> = z.object({
|
|
65
|
+
customerAccountID: z.string(),
|
|
66
|
+
description: z.string(),
|
|
67
|
+
lineItems: InvoiceLineItems$outboundSchema,
|
|
68
|
+
invoiceDate: z.date().transform(v => v.toISOString()).optional(),
|
|
69
|
+
dueDate: z.date().transform(v => v.toISOString()).optional(),
|
|
70
|
+
taxAmount: AmountDecimal$outboundSchema.optional(),
|
|
71
|
+
});
|
|
72
|
+
|
|
73
|
+
export function createInvoiceToJSON(createInvoice: CreateInvoice): string {
|
|
74
|
+
return JSON.stringify(CreateInvoice$outboundSchema.parse(createInvoice));
|
|
75
|
+
}
|
|
76
|
+
export function createInvoiceFromJSON(
|
|
77
|
+
jsonString: string,
|
|
78
|
+
): SafeParseResult<CreateInvoice, SDKValidationError> {
|
|
79
|
+
return safeParse(
|
|
80
|
+
jsonString,
|
|
81
|
+
(x) => CreateInvoice$inboundSchema.parse(JSON.parse(x)),
|
|
82
|
+
`Failed to parse 'CreateInvoice' from JSON`,
|
|
83
|
+
);
|
|
84
|
+
}
|
|
@@ -12,6 +12,12 @@ import {
|
|
|
12
12
|
Amount$Outbound,
|
|
13
13
|
Amount$outboundSchema,
|
|
14
14
|
} from "./amount.js";
|
|
15
|
+
import {
|
|
16
|
+
CreatePaymentLinkLineItems,
|
|
17
|
+
CreatePaymentLinkLineItems$inboundSchema,
|
|
18
|
+
CreatePaymentLinkLineItems$Outbound,
|
|
19
|
+
CreatePaymentLinkLineItems$outboundSchema,
|
|
20
|
+
} from "./createpaymentlinklineitems.js";
|
|
15
21
|
import {
|
|
16
22
|
PaymentLinkCustomerOptions,
|
|
17
23
|
PaymentLinkCustomerOptions$inboundSchema,
|
|
@@ -24,12 +30,6 @@ import {
|
|
|
24
30
|
PaymentLinkDisplayOptions$Outbound,
|
|
25
31
|
PaymentLinkDisplayOptions$outboundSchema,
|
|
26
32
|
} from "./paymentlinkdisplayoptions.js";
|
|
27
|
-
import {
|
|
28
|
-
PaymentLinkLineItems,
|
|
29
|
-
PaymentLinkLineItems$inboundSchema,
|
|
30
|
-
PaymentLinkLineItems$Outbound,
|
|
31
|
-
PaymentLinkLineItems$outboundSchema,
|
|
32
|
-
} from "./paymentlinklineitems.js";
|
|
33
33
|
import {
|
|
34
34
|
PaymentLinkPaymentDetails,
|
|
35
35
|
PaymentLinkPaymentDetails$inboundSchema,
|
|
@@ -92,7 +92,7 @@ export type CreatePaymentLink = {
|
|
|
92
92
|
* @remarks
|
|
93
93
|
* When line items are provided, their total plus sales tax must equal the payment link amount.
|
|
94
94
|
*/
|
|
95
|
-
lineItems?:
|
|
95
|
+
lineItems?: CreatePaymentLinkLineItems | undefined;
|
|
96
96
|
};
|
|
97
97
|
|
|
98
98
|
/** @internal */
|
|
@@ -111,7 +111,7 @@ export const CreatePaymentLink$inboundSchema: z.ZodType<
|
|
|
111
111
|
customer: PaymentLinkCustomerOptions$inboundSchema.optional(),
|
|
112
112
|
payment: PaymentLinkPaymentDetails$inboundSchema.optional(),
|
|
113
113
|
payout: PaymentLinkPayoutDetails$inboundSchema.optional(),
|
|
114
|
-
lineItems:
|
|
114
|
+
lineItems: CreatePaymentLinkLineItems$inboundSchema.optional(),
|
|
115
115
|
});
|
|
116
116
|
/** @internal */
|
|
117
117
|
export type CreatePaymentLink$Outbound = {
|
|
@@ -124,7 +124,7 @@ export type CreatePaymentLink$Outbound = {
|
|
|
124
124
|
customer?: PaymentLinkCustomerOptions$Outbound | undefined;
|
|
125
125
|
payment?: PaymentLinkPaymentDetails$Outbound | undefined;
|
|
126
126
|
payout?: PaymentLinkPayoutDetails$Outbound | undefined;
|
|
127
|
-
lineItems?:
|
|
127
|
+
lineItems?: CreatePaymentLinkLineItems$Outbound | undefined;
|
|
128
128
|
};
|
|
129
129
|
|
|
130
130
|
/** @internal */
|
|
@@ -142,7 +142,7 @@ export const CreatePaymentLink$outboundSchema: z.ZodType<
|
|
|
142
142
|
customer: PaymentLinkCustomerOptions$outboundSchema.optional(),
|
|
143
143
|
payment: PaymentLinkPaymentDetails$outboundSchema.optional(),
|
|
144
144
|
payout: PaymentLinkPayoutDetails$outboundSchema.optional(),
|
|
145
|
-
lineItems:
|
|
145
|
+
lineItems: CreatePaymentLinkLineItems$outboundSchema.optional(),
|
|
146
146
|
});
|
|
147
147
|
|
|
148
148
|
export function createPaymentLinkToJSON(
|