@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,187 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import { MoovCore } from "../core.js";
|
|
6
|
+
import { encodeFormQuery, 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 { MoovError } from "../models/errors/mooverror.js";
|
|
21
|
+
import { ResponseValidationError } from "../models/errors/responsevalidationerror.js";
|
|
22
|
+
import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
|
|
23
|
+
import * as operations from "../models/operations/index.js";
|
|
24
|
+
import { APICall, APIPromise } from "../types/async.js";
|
|
25
|
+
import { Result } from "../types/fp.js";
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* Used by a partner. Retrieve revenue generated from merchant fees.
|
|
29
|
+
*
|
|
30
|
+
* To access this endpoint using an [access token](https://docs.moov.io/api/authentication/access-tokens/)
|
|
31
|
+
* you'll need to specify the `/accounts/{accountID}/profile.read` scope.
|
|
32
|
+
*/
|
|
33
|
+
export function feePlansListFeeRevenue(
|
|
34
|
+
client: MoovCore,
|
|
35
|
+
request: operations.ListFeeRevenueRequest,
|
|
36
|
+
options?: RequestOptions,
|
|
37
|
+
): APIPromise<
|
|
38
|
+
Result<
|
|
39
|
+
operations.ListFeeRevenueResponse,
|
|
40
|
+
| MoovError
|
|
41
|
+
| ResponseValidationError
|
|
42
|
+
| ConnectionError
|
|
43
|
+
| RequestAbortedError
|
|
44
|
+
| RequestTimeoutError
|
|
45
|
+
| InvalidRequestError
|
|
46
|
+
| UnexpectedClientError
|
|
47
|
+
| SDKValidationError
|
|
48
|
+
>
|
|
49
|
+
> {
|
|
50
|
+
return new APIPromise($do(
|
|
51
|
+
client,
|
|
52
|
+
request,
|
|
53
|
+
options,
|
|
54
|
+
));
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
async function $do(
|
|
58
|
+
client: MoovCore,
|
|
59
|
+
request: operations.ListFeeRevenueRequest,
|
|
60
|
+
options?: RequestOptions,
|
|
61
|
+
): Promise<
|
|
62
|
+
[
|
|
63
|
+
Result<
|
|
64
|
+
operations.ListFeeRevenueResponse,
|
|
65
|
+
| MoovError
|
|
66
|
+
| ResponseValidationError
|
|
67
|
+
| ConnectionError
|
|
68
|
+
| RequestAbortedError
|
|
69
|
+
| RequestTimeoutError
|
|
70
|
+
| InvalidRequestError
|
|
71
|
+
| UnexpectedClientError
|
|
72
|
+
| SDKValidationError
|
|
73
|
+
>,
|
|
74
|
+
APICall,
|
|
75
|
+
]
|
|
76
|
+
> {
|
|
77
|
+
const parsed = safeParse(
|
|
78
|
+
request,
|
|
79
|
+
(value) => operations.ListFeeRevenueRequest$outboundSchema.parse(value),
|
|
80
|
+
"Input validation failed",
|
|
81
|
+
);
|
|
82
|
+
if (!parsed.ok) {
|
|
83
|
+
return [parsed, { status: "invalid" }];
|
|
84
|
+
}
|
|
85
|
+
const payload = parsed.value;
|
|
86
|
+
const body = null;
|
|
87
|
+
|
|
88
|
+
const pathParams = {
|
|
89
|
+
accountID: encodeSimple("accountID", payload.accountID, {
|
|
90
|
+
explode: false,
|
|
91
|
+
charEncoding: "percent",
|
|
92
|
+
}),
|
|
93
|
+
};
|
|
94
|
+
|
|
95
|
+
const path = pathToFunc("/accounts/{accountID}/fee-revenue")(pathParams);
|
|
96
|
+
|
|
97
|
+
const query = encodeFormQuery({
|
|
98
|
+
"count": payload.count,
|
|
99
|
+
"endDateTime": payload.endDateTime,
|
|
100
|
+
"skip": payload.skip,
|
|
101
|
+
"startDateTime": payload.startDateTime,
|
|
102
|
+
}, { explode: false });
|
|
103
|
+
|
|
104
|
+
const headers = new Headers(compactMap({
|
|
105
|
+
Accept: "application/json",
|
|
106
|
+
"X-Moov-Version": encodeSimple(
|
|
107
|
+
"X-Moov-Version",
|
|
108
|
+
client._options.xMoovVersion,
|
|
109
|
+
{ explode: false, charEncoding: "none" },
|
|
110
|
+
),
|
|
111
|
+
}));
|
|
112
|
+
|
|
113
|
+
const securityInput = await extractSecurity(client._options.security);
|
|
114
|
+
const requestSecurity = resolveGlobalSecurity(securityInput);
|
|
115
|
+
|
|
116
|
+
const context = {
|
|
117
|
+
options: client._options,
|
|
118
|
+
baseURL: options?.serverURL ?? client._baseURL ?? "",
|
|
119
|
+
operationID: "listFeeRevenue",
|
|
120
|
+
oAuth2Scopes: null,
|
|
121
|
+
|
|
122
|
+
resolvedSecurity: requestSecurity,
|
|
123
|
+
|
|
124
|
+
securitySource: client._options.security,
|
|
125
|
+
retryConfig: options?.retries
|
|
126
|
+
|| client._options.retryConfig
|
|
127
|
+
|| { strategy: "none" },
|
|
128
|
+
retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
|
|
129
|
+
};
|
|
130
|
+
|
|
131
|
+
const requestRes = client._createRequest(context, {
|
|
132
|
+
security: requestSecurity,
|
|
133
|
+
method: "GET",
|
|
134
|
+
baseURL: options?.serverURL,
|
|
135
|
+
path: path,
|
|
136
|
+
headers: headers,
|
|
137
|
+
query: query,
|
|
138
|
+
body: body,
|
|
139
|
+
userAgent: client._options.userAgent,
|
|
140
|
+
timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
|
|
141
|
+
}, options);
|
|
142
|
+
if (!requestRes.ok) {
|
|
143
|
+
return [requestRes, { status: "invalid" }];
|
|
144
|
+
}
|
|
145
|
+
const req = requestRes.value;
|
|
146
|
+
|
|
147
|
+
const doResult = await client._do(req, {
|
|
148
|
+
context,
|
|
149
|
+
errorCodes: ["401", "403", "429", "4XX", "500", "504", "5XX"],
|
|
150
|
+
retryConfig: context.retryConfig,
|
|
151
|
+
retryCodes: context.retryCodes,
|
|
152
|
+
});
|
|
153
|
+
if (!doResult.ok) {
|
|
154
|
+
return [doResult, { status: "request-error", request: req }];
|
|
155
|
+
}
|
|
156
|
+
const response = doResult.value;
|
|
157
|
+
|
|
158
|
+
const responseFields = {
|
|
159
|
+
HttpMeta: { Response: response, Request: req },
|
|
160
|
+
};
|
|
161
|
+
|
|
162
|
+
const [result] = await M.match<
|
|
163
|
+
operations.ListFeeRevenueResponse,
|
|
164
|
+
| MoovError
|
|
165
|
+
| ResponseValidationError
|
|
166
|
+
| ConnectionError
|
|
167
|
+
| RequestAbortedError
|
|
168
|
+
| RequestTimeoutError
|
|
169
|
+
| InvalidRequestError
|
|
170
|
+
| UnexpectedClientError
|
|
171
|
+
| SDKValidationError
|
|
172
|
+
>(
|
|
173
|
+
M.json(200, operations.ListFeeRevenueResponse$inboundSchema, {
|
|
174
|
+
hdrs: true,
|
|
175
|
+
key: "Result",
|
|
176
|
+
}),
|
|
177
|
+
M.fail([401, 403, 429]),
|
|
178
|
+
M.fail([500, 504]),
|
|
179
|
+
M.fail("4XX"),
|
|
180
|
+
M.fail("5XX"),
|
|
181
|
+
)(response, req, { extraFields: responseFields });
|
|
182
|
+
if (!result.ok) {
|
|
183
|
+
return [result, { status: "complete", request: req, response }];
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
return [result, { status: "complete", request: req, response }];
|
|
187
|
+
}
|
|
@@ -25,7 +25,7 @@ import { APICall, APIPromise } from "../types/async.js";
|
|
|
25
25
|
import { Result } from "../types/fp.js";
|
|
26
26
|
|
|
27
27
|
/**
|
|
28
|
-
* Retrieve fees
|
|
28
|
+
* Retrieve fees assessed to an account.
|
|
29
29
|
*
|
|
30
30
|
* To access this endpoint using an [access token](https://docs.moov.io/api/authentication/access-tokens/)
|
|
31
31
|
* you'll need to specify the `/accounts/{accountID}/transfers.read` scope.
|
|
@@ -0,0 +1,201 @@
|
|
|
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
|
+
* Create an invoice for a Moov account.
|
|
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 invoicesCreateInvoice(
|
|
35
|
+
client: MoovCore,
|
|
36
|
+
request: operations.CreateInvoiceRequest,
|
|
37
|
+
options?: RequestOptions,
|
|
38
|
+
): APIPromise<
|
|
39
|
+
Result<
|
|
40
|
+
operations.CreateInvoiceResponse,
|
|
41
|
+
| errors.GenericError
|
|
42
|
+
| errors.CreateInvoiceError
|
|
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.CreateInvoiceRequest,
|
|
63
|
+
options?: RequestOptions,
|
|
64
|
+
): Promise<
|
|
65
|
+
[
|
|
66
|
+
Result<
|
|
67
|
+
operations.CreateInvoiceResponse,
|
|
68
|
+
| errors.GenericError
|
|
69
|
+
| errors.CreateInvoiceError
|
|
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.CreateInvoiceRequest$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.CreateInvoice, { explode: true });
|
|
92
|
+
|
|
93
|
+
const pathParams = {
|
|
94
|
+
accountID: encodeSimple("accountID", payload.accountID, {
|
|
95
|
+
explode: false,
|
|
96
|
+
charEncoding: "percent",
|
|
97
|
+
}),
|
|
98
|
+
};
|
|
99
|
+
|
|
100
|
+
const path = pathToFunc("/accounts/{accountID}/invoices")(pathParams);
|
|
101
|
+
|
|
102
|
+
const headers = new Headers(compactMap({
|
|
103
|
+
"Content-Type": "application/json",
|
|
104
|
+
Accept: "application/json",
|
|
105
|
+
"X-Moov-Version": encodeSimple(
|
|
106
|
+
"X-Moov-Version",
|
|
107
|
+
client._options.xMoovVersion,
|
|
108
|
+
{ explode: false, charEncoding: "none" },
|
|
109
|
+
),
|
|
110
|
+
}));
|
|
111
|
+
|
|
112
|
+
const securityInput = await extractSecurity(client._options.security);
|
|
113
|
+
const requestSecurity = resolveGlobalSecurity(securityInput);
|
|
114
|
+
|
|
115
|
+
const context = {
|
|
116
|
+
options: client._options,
|
|
117
|
+
baseURL: options?.serverURL ?? client._baseURL ?? "",
|
|
118
|
+
operationID: "createInvoice",
|
|
119
|
+
oAuth2Scopes: null,
|
|
120
|
+
|
|
121
|
+
resolvedSecurity: requestSecurity,
|
|
122
|
+
|
|
123
|
+
securitySource: client._options.security,
|
|
124
|
+
retryConfig: options?.retries
|
|
125
|
+
|| client._options.retryConfig
|
|
126
|
+
|| { strategy: "none" },
|
|
127
|
+
retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
|
|
128
|
+
};
|
|
129
|
+
|
|
130
|
+
const requestRes = client._createRequest(context, {
|
|
131
|
+
security: requestSecurity,
|
|
132
|
+
method: "POST",
|
|
133
|
+
baseURL: options?.serverURL,
|
|
134
|
+
path: path,
|
|
135
|
+
headers: headers,
|
|
136
|
+
body: body,
|
|
137
|
+
userAgent: client._options.userAgent,
|
|
138
|
+
timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
|
|
139
|
+
}, options);
|
|
140
|
+
if (!requestRes.ok) {
|
|
141
|
+
return [requestRes, { status: "invalid" }];
|
|
142
|
+
}
|
|
143
|
+
const req = requestRes.value;
|
|
144
|
+
|
|
145
|
+
const doResult = await client._do(req, {
|
|
146
|
+
context,
|
|
147
|
+
errorCodes: [
|
|
148
|
+
"400",
|
|
149
|
+
"401",
|
|
150
|
+
"403",
|
|
151
|
+
"404",
|
|
152
|
+
"409",
|
|
153
|
+
"422",
|
|
154
|
+
"429",
|
|
155
|
+
"4XX",
|
|
156
|
+
"500",
|
|
157
|
+
"504",
|
|
158
|
+
"5XX",
|
|
159
|
+
],
|
|
160
|
+
retryConfig: context.retryConfig,
|
|
161
|
+
retryCodes: context.retryCodes,
|
|
162
|
+
});
|
|
163
|
+
if (!doResult.ok) {
|
|
164
|
+
return [doResult, { status: "request-error", request: req }];
|
|
165
|
+
}
|
|
166
|
+
const response = doResult.value;
|
|
167
|
+
|
|
168
|
+
const responseFields = {
|
|
169
|
+
HttpMeta: { Response: response, Request: req },
|
|
170
|
+
};
|
|
171
|
+
|
|
172
|
+
const [result] = await M.match<
|
|
173
|
+
operations.CreateInvoiceResponse,
|
|
174
|
+
| errors.GenericError
|
|
175
|
+
| errors.CreateInvoiceError
|
|
176
|
+
| MoovError
|
|
177
|
+
| ResponseValidationError
|
|
178
|
+
| ConnectionError
|
|
179
|
+
| RequestAbortedError
|
|
180
|
+
| RequestTimeoutError
|
|
181
|
+
| InvalidRequestError
|
|
182
|
+
| UnexpectedClientError
|
|
183
|
+
| SDKValidationError
|
|
184
|
+
>(
|
|
185
|
+
M.json(201, operations.CreateInvoiceResponse$inboundSchema, {
|
|
186
|
+
hdrs: true,
|
|
187
|
+
key: "Result",
|
|
188
|
+
}),
|
|
189
|
+
M.jsonErr([400, 409], errors.GenericError$inboundSchema, { hdrs: true }),
|
|
190
|
+
M.jsonErr(422, errors.CreateInvoiceError$inboundSchema, { hdrs: true }),
|
|
191
|
+
M.fail([401, 403, 404, 429]),
|
|
192
|
+
M.fail([500, 504]),
|
|
193
|
+
M.fail("4XX"),
|
|
194
|
+
M.fail("5XX"),
|
|
195
|
+
)(response, req, { extraFields: responseFields });
|
|
196
|
+
if (!result.ok) {
|
|
197
|
+
return [result, { status: "complete", request: req, response }];
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
return [result, { status: "complete", request: req, response }];
|
|
201
|
+
}
|
|
@@ -0,0 +1,185 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import { MoovCore } from "../core.js";
|
|
6
|
+
import { 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 { MoovError } from "../models/errors/mooverror.js";
|
|
21
|
+
import { ResponseValidationError } from "../models/errors/responsevalidationerror.js";
|
|
22
|
+
import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
|
|
23
|
+
import * as operations from "../models/operations/index.js";
|
|
24
|
+
import { APICall, APIPromise } from "../types/async.js";
|
|
25
|
+
import { Result } from "../types/fp.js";
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* Retrieve an invoice by ID.
|
|
29
|
+
*
|
|
30
|
+
* To access this endpoint using an [access token](https://docs.moov.io/api/authentication/access-tokens/)
|
|
31
|
+
* you'll need to specify the `/accounts/{accountID}/invoices.read` scope.
|
|
32
|
+
*/
|
|
33
|
+
export function invoicesGetInvoice(
|
|
34
|
+
client: MoovCore,
|
|
35
|
+
request: operations.GetInvoiceRequest,
|
|
36
|
+
options?: RequestOptions,
|
|
37
|
+
): APIPromise<
|
|
38
|
+
Result<
|
|
39
|
+
operations.GetInvoiceResponse,
|
|
40
|
+
| MoovError
|
|
41
|
+
| ResponseValidationError
|
|
42
|
+
| ConnectionError
|
|
43
|
+
| RequestAbortedError
|
|
44
|
+
| RequestTimeoutError
|
|
45
|
+
| InvalidRequestError
|
|
46
|
+
| UnexpectedClientError
|
|
47
|
+
| SDKValidationError
|
|
48
|
+
>
|
|
49
|
+
> {
|
|
50
|
+
return new APIPromise($do(
|
|
51
|
+
client,
|
|
52
|
+
request,
|
|
53
|
+
options,
|
|
54
|
+
));
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
async function $do(
|
|
58
|
+
client: MoovCore,
|
|
59
|
+
request: operations.GetInvoiceRequest,
|
|
60
|
+
options?: RequestOptions,
|
|
61
|
+
): Promise<
|
|
62
|
+
[
|
|
63
|
+
Result<
|
|
64
|
+
operations.GetInvoiceResponse,
|
|
65
|
+
| MoovError
|
|
66
|
+
| ResponseValidationError
|
|
67
|
+
| ConnectionError
|
|
68
|
+
| RequestAbortedError
|
|
69
|
+
| RequestTimeoutError
|
|
70
|
+
| InvalidRequestError
|
|
71
|
+
| UnexpectedClientError
|
|
72
|
+
| SDKValidationError
|
|
73
|
+
>,
|
|
74
|
+
APICall,
|
|
75
|
+
]
|
|
76
|
+
> {
|
|
77
|
+
const parsed = safeParse(
|
|
78
|
+
request,
|
|
79
|
+
(value) => operations.GetInvoiceRequest$outboundSchema.parse(value),
|
|
80
|
+
"Input validation failed",
|
|
81
|
+
);
|
|
82
|
+
if (!parsed.ok) {
|
|
83
|
+
return [parsed, { status: "invalid" }];
|
|
84
|
+
}
|
|
85
|
+
const payload = parsed.value;
|
|
86
|
+
const body = null;
|
|
87
|
+
|
|
88
|
+
const pathParams = {
|
|
89
|
+
accountID: encodeSimple("accountID", payload.accountID, {
|
|
90
|
+
explode: false,
|
|
91
|
+
charEncoding: "percent",
|
|
92
|
+
}),
|
|
93
|
+
invoiceID: encodeSimple("invoiceID", payload.invoiceID, {
|
|
94
|
+
explode: false,
|
|
95
|
+
charEncoding: "percent",
|
|
96
|
+
}),
|
|
97
|
+
};
|
|
98
|
+
|
|
99
|
+
const path = pathToFunc("/accounts/{accountID}/invoices/{invoiceID}")(
|
|
100
|
+
pathParams,
|
|
101
|
+
);
|
|
102
|
+
|
|
103
|
+
const headers = new Headers(compactMap({
|
|
104
|
+
Accept: "application/json",
|
|
105
|
+
"X-Moov-Version": encodeSimple(
|
|
106
|
+
"X-Moov-Version",
|
|
107
|
+
client._options.xMoovVersion,
|
|
108
|
+
{ explode: false, charEncoding: "none" },
|
|
109
|
+
),
|
|
110
|
+
}));
|
|
111
|
+
|
|
112
|
+
const securityInput = await extractSecurity(client._options.security);
|
|
113
|
+
const requestSecurity = resolveGlobalSecurity(securityInput);
|
|
114
|
+
|
|
115
|
+
const context = {
|
|
116
|
+
options: client._options,
|
|
117
|
+
baseURL: options?.serverURL ?? client._baseURL ?? "",
|
|
118
|
+
operationID: "getInvoice",
|
|
119
|
+
oAuth2Scopes: null,
|
|
120
|
+
|
|
121
|
+
resolvedSecurity: requestSecurity,
|
|
122
|
+
|
|
123
|
+
securitySource: client._options.security,
|
|
124
|
+
retryConfig: options?.retries
|
|
125
|
+
|| client._options.retryConfig
|
|
126
|
+
|| { strategy: "none" },
|
|
127
|
+
retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
|
|
128
|
+
};
|
|
129
|
+
|
|
130
|
+
const requestRes = client._createRequest(context, {
|
|
131
|
+
security: requestSecurity,
|
|
132
|
+
method: "GET",
|
|
133
|
+
baseURL: options?.serverURL,
|
|
134
|
+
path: path,
|
|
135
|
+
headers: headers,
|
|
136
|
+
body: body,
|
|
137
|
+
userAgent: client._options.userAgent,
|
|
138
|
+
timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
|
|
139
|
+
}, options);
|
|
140
|
+
if (!requestRes.ok) {
|
|
141
|
+
return [requestRes, { status: "invalid" }];
|
|
142
|
+
}
|
|
143
|
+
const req = requestRes.value;
|
|
144
|
+
|
|
145
|
+
const doResult = await client._do(req, {
|
|
146
|
+
context,
|
|
147
|
+
errorCodes: ["401", "403", "404", "429", "4XX", "500", "504", "5XX"],
|
|
148
|
+
retryConfig: context.retryConfig,
|
|
149
|
+
retryCodes: context.retryCodes,
|
|
150
|
+
});
|
|
151
|
+
if (!doResult.ok) {
|
|
152
|
+
return [doResult, { status: "request-error", request: req }];
|
|
153
|
+
}
|
|
154
|
+
const response = doResult.value;
|
|
155
|
+
|
|
156
|
+
const responseFields = {
|
|
157
|
+
HttpMeta: { Response: response, Request: req },
|
|
158
|
+
};
|
|
159
|
+
|
|
160
|
+
const [result] = await M.match<
|
|
161
|
+
operations.GetInvoiceResponse,
|
|
162
|
+
| MoovError
|
|
163
|
+
| ResponseValidationError
|
|
164
|
+
| ConnectionError
|
|
165
|
+
| RequestAbortedError
|
|
166
|
+
| RequestTimeoutError
|
|
167
|
+
| InvalidRequestError
|
|
168
|
+
| UnexpectedClientError
|
|
169
|
+
| SDKValidationError
|
|
170
|
+
>(
|
|
171
|
+
M.json(200, operations.GetInvoiceResponse$inboundSchema, {
|
|
172
|
+
hdrs: true,
|
|
173
|
+
key: "Result",
|
|
174
|
+
}),
|
|
175
|
+
M.fail([401, 403, 404, 429]),
|
|
176
|
+
M.fail([500, 504]),
|
|
177
|
+
M.fail("4XX"),
|
|
178
|
+
M.fail("5XX"),
|
|
179
|
+
)(response, req, { extraFields: responseFields });
|
|
180
|
+
if (!result.ok) {
|
|
181
|
+
return [result, { status: "complete", request: req, response }];
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
return [result, { status: "complete", request: req, response }];
|
|
185
|
+
}
|