@moovio/sdk 0.21.13 → 0.21.15
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 +106 -49
- package/bin/mcp-server.js +2707 -977
- package/bin/mcp-server.js.map +56 -15
- package/examples/package-lock.json +1 -1
- package/funcs/feePlansListFeeRevenue.d.ts +17 -0
- package/funcs/feePlansListFeeRevenue.d.ts.map +1 -0
- package/funcs/feePlansListFeeRevenue.js +132 -0
- package/funcs/feePlansListFeeRevenue.js.map +1 -0
- package/funcs/feePlansRetrieveFees.d.ts +1 -1
- package/funcs/feePlansRetrieveFees.js +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 +2 -2
- package/lib/config.js +2 -2
- package/mcp-server/mcp-server.js +1 -1
- package/mcp-server/server.d.ts.map +1 -1
- package/mcp-server/server.js +13 -1
- package/mcp-server/server.js.map +1 -1
- package/mcp-server/tools/feePlansListFeeRevenue.d.ts +8 -0
- package/mcp-server/tools/feePlansListFeeRevenue.d.ts.map +1 -0
- package/mcp-server/tools/feePlansListFeeRevenue.js +65 -0
- package/mcp-server/tools/feePlansListFeeRevenue.js.map +1 -0
- package/mcp-server/tools/feePlansRetrieveFees.js +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/amountdecimalupdate.js +60 -0
- 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/index.d.ts +19 -0
- package/models/components/index.d.ts.map +1 -1
- package/models/components/index.js +19 -0
- package/models/components/index.js.map +1 -1
- package/models/components/instantbankcreditpaymentmethod.d.ts +40 -0
- package/models/components/instantbankcreditpaymentmethod.d.ts.map +1 -0
- package/models/components/instantbankcreditpaymentmethod.js +71 -0
- package/models/components/instantbankcreditpaymentmethod.js.map +1 -0
- 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/invoicelineitemoptionvalidationerror.js +65 -0
- 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/invoicelineitemvalidationerror.js +70 -0
- 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/paymentmethod.d.ts +5 -0
- package/models/components/paymentmethod.d.ts.map +1 -1
- package/models/components/paymentmethod.js +3 -0
- package/models/components/paymentmethod.js.map +1 -1
- package/models/components/paymentmethodtype.d.ts +1 -0
- package/models/components/paymentmethodtype.d.ts.map +1 -1
- package/models/components/paymentmethodtype.js +1 -0
- package/models/components/paymentmethodtype.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/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/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/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 +6 -0
- package/models/operations/index.d.ts.map +1 -1
- package/models/operations/index.js +6 -0
- package/models/operations/index.js.map +1 -1
- package/models/operations/listfeerevenue.d.ts +81 -0
- package/models/operations/listfeerevenue.d.ts.map +1 -0
- package/models/operations/listfeerevenue.js +120 -0
- package/models/operations/listfeerevenue.js.map +1 -0
- 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/feeplans.d.ts +8 -1
- package/sdk/feeplans.d.ts.map +1 -1
- package/sdk/feeplans.js +11 -1
- package/sdk/feeplans.js.map +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/feePlansListFeeRevenue.ts +187 -0
- package/src/funcs/feePlansRetrieveFees.ts +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 +2 -2
- package/src/mcp-server/mcp-server.ts +1 -1
- package/src/mcp-server/server.ts +13 -1
- package/src/mcp-server/tools/feePlansListFeeRevenue.ts +39 -0
- package/src/mcp-server/tools/feePlansRetrieveFees.ts +1 -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/index.ts +19 -0
- package/src/models/components/instantbankcreditpaymentmethod.ts +95 -0
- 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/invoicelineitemoptionvalidationerror.ts +72 -0
- 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/paymentmethod.ts +22 -0
- package/src/models/components/paymentmethodtype.ts +1 -0
- package/src/models/components/updateinvoice.ts +94 -0
- 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/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/operations/createinvoice.ts +187 -0
- package/src/models/operations/getinvoice.ts +179 -0
- package/src/models/operations/index.ts +6 -0
- package/src/models/operations/listfeerevenue.ts +200 -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/feeplans.ts +19 -1
- package/src/sdk/invoices.ts +100 -0
- package/src/sdk/sdk.ts +6 -0
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import { feePlansListFeeRevenue } from "../../funcs/feePlansListFeeRevenue.js";
|
|
6
|
+
import * as operations from "../../models/operations/index.js";
|
|
7
|
+
import { formatResult, ToolDefinition } from "../tools.js";
|
|
8
|
+
|
|
9
|
+
const args = {
|
|
10
|
+
request: operations.ListFeeRevenueRequest$inboundSchema,
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
export const tool$feePlansListFeeRevenue: ToolDefinition<typeof args> = {
|
|
14
|
+
name: "fee-plans-list-fee-revenue",
|
|
15
|
+
description:
|
|
16
|
+
`Used by a partner. Retrieve revenue generated from merchant fees.
|
|
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}/profile.read\` scope.`,
|
|
20
|
+
args,
|
|
21
|
+
tool: async (client, args, ctx) => {
|
|
22
|
+
const [result, apiCall] = await feePlansListFeeRevenue(
|
|
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
|
+
};
|
|
@@ -12,7 +12,7 @@ const args = {
|
|
|
12
12
|
|
|
13
13
|
export const tool$feePlansRetrieveFees: ToolDefinition<typeof args> = {
|
|
14
14
|
name: "fee-plans-retrieve-fees",
|
|
15
|
-
description: `Retrieve fees
|
|
15
|
+
description: `Retrieve fees assessed to an account.
|
|
16
16
|
|
|
17
17
|
To access this endpoint using an [access token](https://docs.moov.io/api/authentication/access-tokens/)
|
|
18
18
|
you'll need to specify the \`/accounts/{accountID}/transfers.read\` scope.`,
|
|
@@ -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
|
+
}
|
|
@@ -32,6 +32,7 @@ export * from "./addressupdate.js";
|
|
|
32
32
|
export * from "./adjustment.js";
|
|
33
33
|
export * from "./amount.js";
|
|
34
34
|
export * from "./amountdecimal.js";
|
|
35
|
+
export * from "./amountdecimalupdate.js";
|
|
35
36
|
export * from "./amountdecimalvalidationerror.js";
|
|
36
37
|
export * from "./amountupdate.js";
|
|
37
38
|
export * from "./amountvalidationerror.js";
|
|
@@ -141,6 +142,7 @@ export * from "./createevidencetext.js";
|
|
|
141
142
|
export * from "./createfeeplanagreement.js";
|
|
142
143
|
export * from "./createindividualerror.js";
|
|
143
144
|
export * from "./createindividualprofile.js";
|
|
145
|
+
export * from "./createinvoice.js";
|
|
144
146
|
export * from "./createpaymentlink.js";
|
|
145
147
|
export * from "./createproductoption.js";
|
|
146
148
|
export * from "./createproductoptiongroup.js";
|
|
@@ -230,8 +232,21 @@ export * from "./individualnameupdate.js";
|
|
|
230
232
|
export * from "./individualprofile.js";
|
|
231
233
|
export * from "./industrycodes.js";
|
|
232
234
|
export * from "./industrytaxonomy.js";
|
|
235
|
+
export * from "./instantbankcreditpaymentmethod.js";
|
|
233
236
|
export * from "./instantpaymentfees.js";
|
|
234
237
|
export * from "./institutionssearchresponse.js";
|
|
238
|
+
export * from "./invoice.js";
|
|
239
|
+
export * from "./invoiceexternalpayment.js";
|
|
240
|
+
export * from "./invoicelineitem.js";
|
|
241
|
+
export * from "./invoicelineitemoption.js";
|
|
242
|
+
export * from "./invoicelineitemoptionvalidationerror.js";
|
|
243
|
+
export * from "./invoicelineitems.js";
|
|
244
|
+
export * from "./invoicelineitemsupdate.js";
|
|
245
|
+
export * from "./invoicelineitemsvalidationerror.js";
|
|
246
|
+
export * from "./invoicelineitemvalidationerror.js";
|
|
247
|
+
export * from "./invoicepayment.js";
|
|
248
|
+
export * from "./invoicestatus.js";
|
|
249
|
+
export * from "./invoicetransferpayment.js";
|
|
235
250
|
export * from "./issuedcard.js";
|
|
236
251
|
export * from "./issuedcardauthorization.js";
|
|
237
252
|
export * from "./issuedcardauthorizationevent.js";
|
|
@@ -261,6 +276,7 @@ export * from "./linkedapplepaypaymentmethod.js";
|
|
|
261
276
|
export * from "./listfeesfetchrequest.js";
|
|
262
277
|
export * from "./manualtermsofservice.js";
|
|
263
278
|
export * from "./manualtermsofserviceupdate.js";
|
|
279
|
+
export * from "./markinvoicepaid.js";
|
|
264
280
|
export * from "./microdepositstatus.js";
|
|
265
281
|
export * from "./minimumcommitment.js";
|
|
266
282
|
export * from "./mode.js";
|
|
@@ -440,6 +456,7 @@ export * from "./updatecardexpiration.js";
|
|
|
440
456
|
export * from "./updatecolor.js";
|
|
441
457
|
export * from "./updatecolors.js";
|
|
442
458
|
export * from "./updateevidence.js";
|
|
459
|
+
export * from "./updateinvoice.js";
|
|
443
460
|
export * from "./updateissuedcard.js";
|
|
444
461
|
export * from "./updatepaymentlink.js";
|
|
445
462
|
export * from "./updaterepresentative.js";
|
|
@@ -480,6 +497,8 @@ export * from "./webhookdatacapabilityupdated.js";
|
|
|
480
497
|
export * from "./webhookdatacardautoupdated.js";
|
|
481
498
|
export * from "./webhookdatadisputecreated.js";
|
|
482
499
|
export * from "./webhookdatadisputeupdated.js";
|
|
500
|
+
export * from "./webhookdatainvoicecreated.js";
|
|
501
|
+
export * from "./webhookdatainvoiceupdated.js";
|
|
483
502
|
export * from "./webhookdatanetworkidupdated.js";
|
|
484
503
|
export * from "./webhookdatapaymentmethoddisabled.js";
|
|
485
504
|
export * from "./webhookdatapaymentmethodenabled.js";
|
|
@@ -0,0 +1,95 @@
|
|
|
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 { ClosedEnum } from "../../types/enums.js";
|
|
8
|
+
import { Result as SafeParseResult } from "../../types/fp.js";
|
|
9
|
+
import { SDKValidationError } from "../errors/sdkvalidationerror.js";
|
|
10
|
+
import {
|
|
11
|
+
PaymentMethodsBankAccount,
|
|
12
|
+
PaymentMethodsBankAccount$inboundSchema,
|
|
13
|
+
PaymentMethodsBankAccount$Outbound,
|
|
14
|
+
PaymentMethodsBankAccount$outboundSchema,
|
|
15
|
+
} from "./paymentmethodsbankaccount.js";
|
|
16
|
+
|
|
17
|
+
export const InstantBankCreditPaymentMethodPaymentMethodType = {
|
|
18
|
+
InstantBankCredit: "instant-bank-credit",
|
|
19
|
+
} as const;
|
|
20
|
+
export type InstantBankCreditPaymentMethodPaymentMethodType = ClosedEnum<
|
|
21
|
+
typeof InstantBankCreditPaymentMethodPaymentMethodType
|
|
22
|
+
>;
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* Instantly send funds to a bank account.
|
|
26
|
+
*/
|
|
27
|
+
export type InstantBankCreditPaymentMethod = {
|
|
28
|
+
/**
|
|
29
|
+
* ID of the payment method.
|
|
30
|
+
*/
|
|
31
|
+
paymentMethodID: string;
|
|
32
|
+
paymentMethodType: InstantBankCreditPaymentMethodPaymentMethodType;
|
|
33
|
+
/**
|
|
34
|
+
* A bank account as contained within a payment method.
|
|
35
|
+
*/
|
|
36
|
+
bankAccount: PaymentMethodsBankAccount;
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
/** @internal */
|
|
40
|
+
export const InstantBankCreditPaymentMethodPaymentMethodType$inboundSchema:
|
|
41
|
+
z.ZodNativeEnum<typeof InstantBankCreditPaymentMethodPaymentMethodType> = z
|
|
42
|
+
.nativeEnum(InstantBankCreditPaymentMethodPaymentMethodType);
|
|
43
|
+
/** @internal */
|
|
44
|
+
export const InstantBankCreditPaymentMethodPaymentMethodType$outboundSchema:
|
|
45
|
+
z.ZodNativeEnum<typeof InstantBankCreditPaymentMethodPaymentMethodType> =
|
|
46
|
+
InstantBankCreditPaymentMethodPaymentMethodType$inboundSchema;
|
|
47
|
+
|
|
48
|
+
/** @internal */
|
|
49
|
+
export const InstantBankCreditPaymentMethod$inboundSchema: z.ZodType<
|
|
50
|
+
InstantBankCreditPaymentMethod,
|
|
51
|
+
z.ZodTypeDef,
|
|
52
|
+
unknown
|
|
53
|
+
> = z.object({
|
|
54
|
+
paymentMethodID: z.string(),
|
|
55
|
+
paymentMethodType:
|
|
56
|
+
InstantBankCreditPaymentMethodPaymentMethodType$inboundSchema,
|
|
57
|
+
bankAccount: PaymentMethodsBankAccount$inboundSchema,
|
|
58
|
+
});
|
|
59
|
+
/** @internal */
|
|
60
|
+
export type InstantBankCreditPaymentMethod$Outbound = {
|
|
61
|
+
paymentMethodID: string;
|
|
62
|
+
paymentMethodType: string;
|
|
63
|
+
bankAccount: PaymentMethodsBankAccount$Outbound;
|
|
64
|
+
};
|
|
65
|
+
|
|
66
|
+
/** @internal */
|
|
67
|
+
export const InstantBankCreditPaymentMethod$outboundSchema: z.ZodType<
|
|
68
|
+
InstantBankCreditPaymentMethod$Outbound,
|
|
69
|
+
z.ZodTypeDef,
|
|
70
|
+
InstantBankCreditPaymentMethod
|
|
71
|
+
> = z.object({
|
|
72
|
+
paymentMethodID: z.string(),
|
|
73
|
+
paymentMethodType:
|
|
74
|
+
InstantBankCreditPaymentMethodPaymentMethodType$outboundSchema,
|
|
75
|
+
bankAccount: PaymentMethodsBankAccount$outboundSchema,
|
|
76
|
+
});
|
|
77
|
+
|
|
78
|
+
export function instantBankCreditPaymentMethodToJSON(
|
|
79
|
+
instantBankCreditPaymentMethod: InstantBankCreditPaymentMethod,
|
|
80
|
+
): string {
|
|
81
|
+
return JSON.stringify(
|
|
82
|
+
InstantBankCreditPaymentMethod$outboundSchema.parse(
|
|
83
|
+
instantBankCreditPaymentMethod,
|
|
84
|
+
),
|
|
85
|
+
);
|
|
86
|
+
}
|
|
87
|
+
export function instantBankCreditPaymentMethodFromJSON(
|
|
88
|
+
jsonString: string,
|
|
89
|
+
): SafeParseResult<InstantBankCreditPaymentMethod, SDKValidationError> {
|
|
90
|
+
return safeParse(
|
|
91
|
+
jsonString,
|
|
92
|
+
(x) => InstantBankCreditPaymentMethod$inboundSchema.parse(JSON.parse(x)),
|
|
93
|
+
`Failed to parse 'InstantBankCreditPaymentMethod' from JSON`,
|
|
94
|
+
);
|
|
95
|
+
}
|