@moovio/sdk 0.12.5 → 0.13.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +48 -35
- package/bin/mcp-server.js +1194 -69
- package/bin/mcp-server.js.map +64 -24
- package/docs/sdks/underwriting/README.md +95 -0
- package/funcs/transfersList.js +1 -0
- package/funcs/transfersList.js.map +1 -1
- package/funcs/underwritingSave.d.ts +20 -0
- package/funcs/underwritingSave.d.ts.map +1 -0
- package/funcs/underwritingSave.js +145 -0
- package/funcs/underwritingSave.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 +3 -1
- package/mcp-server/server.js.map +1 -1
- package/mcp-server/tools/underwritingSave.d.ts +8 -0
- package/mcp-server/tools/underwritingSave.d.ts.map +1 -0
- package/mcp-server/tools/underwritingSave.js +67 -0
- package/mcp-server/tools/underwritingSave.js.map +1 -0
- package/models/components/businesspresence.d.ts +40 -0
- package/models/components/businesspresence.d.ts.map +1 -0
- package/models/components/businesspresence.js +64 -0
- package/models/components/businesspresence.js.map +1 -0
- package/models/components/capability.d.ts +1 -1
- package/models/components/capabilityid.d.ts +32 -2
- package/models/components/capabilityid.d.ts.map +1 -1
- package/models/components/capabilityid.js +11 -1
- package/models/components/capabilityid.js.map +1 -1
- package/models/components/cardacceptancemethods.d.ts +45 -0
- package/models/components/cardacceptancemethods.d.ts.map +1 -0
- package/models/components/cardacceptancemethods.js +73 -0
- package/models/components/cardacceptancemethods.js.map +1 -0
- package/models/components/cardacceptancemethodserror.d.ts +33 -0
- package/models/components/cardacceptancemethodserror.d.ts.map +1 -0
- package/models/components/cardacceptancemethodserror.js +73 -0
- package/models/components/cardacceptancemethodserror.js.map +1 -0
- package/models/components/collectfunds.d.ts +33 -0
- package/models/components/collectfunds.d.ts.map +1 -0
- package/models/components/collectfunds.js +73 -0
- package/models/components/collectfunds.js.map +1 -0
- package/models/components/collectfundsach.d.ts +30 -0
- package/models/components/collectfundsach.d.ts.map +1 -0
- package/models/components/collectfundsach.js +70 -0
- package/models/components/collectfundsach.js.map +1 -0
- package/models/components/collectfundsacherror.d.ts +30 -0
- package/models/components/collectfundsacherror.d.ts.map +1 -0
- package/models/components/collectfundsacherror.js +70 -0
- package/models/components/collectfundsacherror.js.map +1 -0
- package/models/components/collectfundscardpayments.d.ts +44 -0
- package/models/components/collectfundscardpayments.d.ts.map +1 -0
- package/models/components/collectfundscardpayments.js +81 -0
- package/models/components/collectfundscardpayments.js.map +1 -0
- package/models/components/collectfundscardpaymentserror.d.ts +40 -0
- package/models/components/collectfundscardpaymentserror.d.ts.map +1 -0
- package/models/components/collectfundscardpaymentserror.js +80 -0
- package/models/components/collectfundscardpaymentserror.js.map +1 -0
- package/models/components/collectfundserror.d.ts +33 -0
- package/models/components/collectfundserror.d.ts.map +1 -0
- package/models/components/collectfundserror.js +73 -0
- package/models/components/collectfundserror.js.map +1 -0
- package/models/components/createdtransfer.d.ts +5 -0
- package/models/components/createdtransfer.d.ts.map +1 -1
- package/models/components/createdtransfer.js +2 -0
- package/models/components/createdtransfer.js.map +1 -1
- package/models/components/createtransfer.d.ts +5 -0
- package/models/components/createtransfer.d.ts.map +1 -1
- package/models/components/createtransfer.js +2 -0
- package/models/components/createtransfer.js.map +1 -1
- package/models/components/estimatedactivity.d.ts +37 -0
- package/models/components/estimatedactivity.d.ts.map +1 -0
- package/models/components/estimatedactivity.js +74 -0
- package/models/components/estimatedactivity.js.map +1 -0
- package/models/components/estimatedactivityerror.d.ts +33 -0
- package/models/components/estimatedactivityerror.d.ts.map +1 -0
- package/models/components/estimatedactivityerror.js +73 -0
- package/models/components/estimatedactivityerror.js.map +1 -0
- package/models/components/fulfillment.d.ts +33 -0
- package/models/components/fulfillment.d.ts.map +1 -0
- package/models/components/fulfillment.js +73 -0
- package/models/components/fulfillment.js.map +1 -0
- package/models/components/fulfillmenterror.d.ts +31 -0
- package/models/components/fulfillmenterror.d.ts.map +1 -0
- package/models/components/fulfillmenterror.js +71 -0
- package/models/components/fulfillmenterror.js.map +1 -0
- package/models/components/fulfillmentmethod.d.ts +49 -0
- package/models/components/fulfillmentmethod.d.ts.map +1 -0
- package/models/components/fulfillmentmethod.js +67 -0
- package/models/components/fulfillmentmethod.js.map +1 -0
- package/models/components/fulfillmenttimeframe.d.ts +46 -0
- package/models/components/fulfillmenttimeframe.d.ts.map +1 -0
- package/models/components/fulfillmenttimeframe.js +66 -0
- package/models/components/fulfillmenttimeframe.js.map +1 -0
- package/models/components/geographicreach.d.ts +31 -0
- package/models/components/geographicreach.d.ts.map +1 -0
- package/models/components/geographicreach.js +61 -0
- package/models/components/geographicreach.js.map +1 -0
- package/models/components/index.d.ts +36 -0
- package/models/components/index.d.ts.map +1 -1
- package/models/components/index.js +36 -0
- package/models/components/index.js.map +1 -1
- package/models/components/moneytransfer.d.ts +33 -0
- package/models/components/moneytransfer.d.ts.map +1 -0
- package/models/components/moneytransfer.js +73 -0
- package/models/components/moneytransfer.js.map +1 -0
- package/models/components/moneytransfererror.d.ts +33 -0
- package/models/components/moneytransfererror.d.ts.map +1 -0
- package/models/components/moneytransfererror.js +73 -0
- package/models/components/moneytransfererror.js.map +1 -0
- package/models/components/moneytransferpullfromcard.d.ts +30 -0
- package/models/components/moneytransferpullfromcard.d.ts.map +1 -0
- package/models/components/moneytransferpullfromcard.js +70 -0
- package/models/components/moneytransferpullfromcard.js.map +1 -0
- package/models/components/moneytransferpullfromcarderror.d.ts +30 -0
- package/models/components/moneytransferpullfromcarderror.d.ts.map +1 -0
- package/models/components/moneytransferpullfromcarderror.js +70 -0
- package/models/components/moneytransferpullfromcarderror.js.map +1 -0
- package/models/components/moneytransferpushtocard.d.ts +30 -0
- package/models/components/moneytransferpushtocard.d.ts.map +1 -0
- package/models/components/moneytransferpushtocard.js +70 -0
- package/models/components/moneytransferpushtocard.js.map +1 -0
- package/models/components/moneytransferpushtocarderror.d.ts +30 -0
- package/models/components/moneytransferpushtocarderror.d.ts.map +1 -0
- package/models/components/moneytransferpushtocarderror.js +70 -0
- package/models/components/moneytransferpushtocarderror.js.map +1 -0
- package/models/components/monthlyvolumerange.d.ts +52 -0
- package/models/components/monthlyvolumerange.d.ts.map +1 -0
- package/models/components/monthlyvolumerange.js +69 -0
- package/models/components/monthlyvolumerange.js.map +1 -0
- package/models/components/pendinglitigation.d.ts +52 -0
- package/models/components/pendinglitigation.d.ts.map +1 -0
- package/models/components/pendinglitigation.js +68 -0
- package/models/components/pendinglitigation.js.map +1 -0
- package/models/components/refundpolicy.d.ts +49 -0
- package/models/components/refundpolicy.d.ts.map +1 -0
- package/models/components/refundpolicy.js +67 -0
- package/models/components/refundpolicy.js.map +1 -0
- package/models/components/sendfunds.d.ts +36 -0
- package/models/components/sendfunds.d.ts.map +1 -0
- package/models/components/sendfunds.js +76 -0
- package/models/components/sendfunds.js.map +1 -0
- package/models/components/sendfundsach.d.ts +30 -0
- package/models/components/sendfundsach.d.ts.map +1 -0
- package/models/components/sendfundsach.js +70 -0
- package/models/components/sendfundsach.js.map +1 -0
- package/models/components/sendfundsacherror.d.ts +30 -0
- package/models/components/sendfundsacherror.d.ts.map +1 -0
- package/models/components/sendfundsacherror.js +70 -0
- package/models/components/sendfundsacherror.js.map +1 -0
- package/models/components/sendfundserror.d.ts +36 -0
- package/models/components/sendfundserror.d.ts.map +1 -0
- package/models/components/sendfundserror.js +76 -0
- package/models/components/sendfundserror.js.map +1 -0
- package/models/components/sendfundspushtocard.d.ts +30 -0
- package/models/components/sendfundspushtocard.d.ts.map +1 -0
- package/models/components/sendfundspushtocard.js +70 -0
- package/models/components/sendfundspushtocard.js.map +1 -0
- package/models/components/sendfundspushtocarderror.d.ts +30 -0
- package/models/components/sendfundspushtocarderror.d.ts.map +1 -0
- package/models/components/sendfundspushtocarderror.js +70 -0
- package/models/components/sendfundspushtocarderror.js.map +1 -0
- package/models/components/sendfundsrtp.d.ts +30 -0
- package/models/components/sendfundsrtp.d.ts.map +1 -0
- package/models/components/sendfundsrtp.js +70 -0
- package/models/components/sendfundsrtp.js.map +1 -0
- package/models/components/sendfundsrtperror.d.ts +30 -0
- package/models/components/sendfundsrtperror.d.ts.map +1 -0
- package/models/components/sendfundsrtperror.js +70 -0
- package/models/components/sendfundsrtperror.js.map +1 -0
- package/models/components/transfer.d.ts +5 -0
- package/models/components/transfer.d.ts.map +1 -1
- package/models/components/transfer.js +2 -0
- package/models/components/transfer.js.map +1 -1
- package/models/components/underwriting.d.ts +35 -14
- package/models/components/underwriting.d.ts.map +1 -1
- package/models/components/underwriting.js +36 -14
- package/models/components/underwriting.js.map +1 -1
- package/models/components/upsertunderwriting.d.ts +48 -0
- package/models/components/upsertunderwriting.d.ts.map +1 -0
- package/models/components/upsertunderwriting.js +89 -0
- package/models/components/upsertunderwriting.js.map +1 -0
- package/models/components/volumesharebycustomertype.d.ts +33 -0
- package/models/components/volumesharebycustomertype.d.ts.map +1 -0
- package/models/components/volumesharebycustomertype.js +73 -0
- package/models/components/volumesharebycustomertype.js.map +1 -0
- package/models/components/volumesharebycustomertypeerror.d.ts +33 -0
- package/models/components/volumesharebycustomertypeerror.d.ts.map +1 -0
- package/models/components/volumesharebycustomertypeerror.js +73 -0
- package/models/components/volumesharebycustomertypeerror.js.map +1 -0
- package/models/components/webhookdatacapabilityrequested.d.ts +1 -1
- package/models/components/webhookdatacapabilityupdated.d.ts +1 -1
- package/models/components/webhookdatatransfercreated.d.ts +2 -0
- package/models/components/webhookdatatransfercreated.d.ts.map +1 -1
- package/models/components/webhookdatatransfercreated.js +2 -0
- package/models/components/webhookdatatransfercreated.js.map +1 -1
- package/models/components/webhookdatatransferupdated.d.ts +2 -0
- package/models/components/webhookdatatransferupdated.d.ts.map +1 -1
- package/models/components/webhookdatatransferupdated.js +2 -0
- package/models/components/webhookdatatransferupdated.js.map +1 -1
- package/models/errors/index.d.ts +1 -0
- package/models/errors/index.d.ts.map +1 -1
- package/models/errors/index.js +1 -0
- package/models/errors/index.js.map +1 -1
- package/models/errors/transfer.d.ts +9 -0
- package/models/errors/transfer.d.ts.map +1 -1
- package/models/errors/transfer.js +4 -0
- package/models/errors/transfer.js.map +1 -1
- package/models/errors/upsertunderwritingerror.d.ts +73 -0
- package/models/errors/upsertunderwritingerror.d.ts.map +1 -0
- package/models/errors/upsertunderwritingerror.js +150 -0
- package/models/errors/upsertunderwritingerror.js.map +1 -0
- package/models/operations/disablecapability.d.ts +1 -1
- package/models/operations/getcapability.d.ts +1 -1
- package/models/operations/index.d.ts +1 -0
- package/models/operations/index.d.ts.map +1 -1
- package/models/operations/index.js +1 -0
- package/models/operations/index.js.map +1 -1
- package/models/operations/listtransfers.d.ts +5 -0
- package/models/operations/listtransfers.d.ts.map +1 -1
- package/models/operations/listtransfers.js +2 -0
- package/models/operations/listtransfers.js.map +1 -1
- package/models/operations/saveunderwriting.d.ts +101 -0
- package/models/operations/saveunderwriting.d.ts.map +1 -0
- package/models/operations/saveunderwriting.js +155 -0
- package/models/operations/saveunderwriting.js.map +1 -0
- package/package.json +1 -1
- package/sdk/underwriting.d.ts +9 -0
- package/sdk/underwriting.d.ts.map +1 -1
- package/sdk/underwriting.js +12 -0
- package/sdk/underwriting.js.map +1 -1
- package/src/__tests__/mockserver/README.md +52 -0
- package/src/funcs/transfersList.ts +1 -0
- package/src/funcs/underwritingSave.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 +3 -1
- package/src/mcp-server/tools/underwritingSave.ts +40 -0
- package/src/models/components/businesspresence.ts +37 -0
- package/src/models/components/capability.ts +1 -1
- package/src/models/components/capabilityid.ts +12 -2
- package/src/models/components/cardacceptancemethods.ts +86 -0
- package/src/models/components/cardacceptancemethodserror.ts +74 -0
- package/src/models/components/collectfunds.ts +78 -0
- package/src/models/components/collectfundsach.ts +70 -0
- package/src/models/components/collectfundsacherror.ts +72 -0
- package/src/models/components/collectfundscardpayments.ts +108 -0
- package/src/models/components/collectfundscardpaymentserror.ts +102 -0
- package/src/models/components/collectfundserror.ts +82 -0
- package/src/models/components/createdtransfer.ts +7 -0
- package/src/models/components/createtransfer.ts +7 -0
- package/src/models/components/estimatedactivity.ts +82 -0
- package/src/models/components/estimatedactivityerror.ts +74 -0
- package/src/models/components/fulfillment.ts +76 -0
- package/src/models/components/fulfillmenterror.ts +70 -0
- package/src/models/components/fulfillmentmethod.ts +40 -0
- package/src/models/components/fulfillmenttimeframe.ts +39 -0
- package/src/models/components/geographicreach.ts +34 -0
- package/src/models/components/index.ts +36 -0
- package/src/models/components/moneytransfer.ts +78 -0
- package/src/models/components/moneytransfererror.ts +82 -0
- package/src/models/components/moneytransferpullfromcard.ts +72 -0
- package/src/models/components/moneytransferpullfromcarderror.ts +74 -0
- package/src/models/components/moneytransferpushtocard.ts +72 -0
- package/src/models/components/moneytransferpushtocarderror.ts +74 -0
- package/src/models/components/monthlyvolumerange.ts +45 -0
- package/src/models/components/pendinglitigation.ts +42 -0
- package/src/models/components/refundpolicy.ts +38 -0
- package/src/models/components/sendfunds.ts +88 -0
- package/src/models/components/sendfundsach.ts +68 -0
- package/src/models/components/sendfundsacherror.ts +72 -0
- package/src/models/components/sendfundserror.ts +88 -0
- package/src/models/components/sendfundspushtocard.ts +72 -0
- package/src/models/components/sendfundspushtocarderror.ts +72 -0
- package/src/models/components/sendfundsrtp.ts +68 -0
- package/src/models/components/sendfundsrtperror.ts +72 -0
- package/src/models/components/transfer.ts +7 -0
- package/src/models/components/underwriting.ts +96 -28
- package/src/models/components/upsertunderwriting.ts +130 -0
- package/src/models/components/volumesharebycustomertype.ts +74 -0
- package/src/models/components/volumesharebycustomertypeerror.ts +76 -0
- package/src/models/components/webhookdatacapabilityrequested.ts +1 -1
- package/src/models/components/webhookdatacapabilityupdated.ts +1 -1
- package/src/models/components/webhookdatatransfercreated.ts +4 -0
- package/src/models/components/webhookdatatransferupdated.ts +4 -0
- package/src/models/errors/index.ts +1 -0
- package/src/models/errors/transfer.ts +12 -0
- package/src/models/errors/upsertunderwritingerror.ts +185 -0
- package/src/models/operations/disablecapability.ts +1 -1
- package/src/models/operations/getcapability.ts +1 -1
- package/src/models/operations/index.ts +1 -0
- package/src/models/operations/listtransfers.ts +7 -0
- package/src/models/operations/saveunderwriting.ts +231 -0
- package/src/sdk/underwriting.ts +20 -0
|
@@ -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
|
+
* Create or update the account's underwriting.
|
|
30
|
+
*
|
|
31
|
+
* Read our [underwriting guide](https://docs.moov.io/guides/accounts/requirements/underwriting/) to learn more.
|
|
32
|
+
*
|
|
33
|
+
* To access this endpoint using an [access token](https://docs.moov.io/api/authentication/access-tokens/)
|
|
34
|
+
* you'll need to specify the `/accounts/{accountID}/profile.write` scope.
|
|
35
|
+
*/
|
|
36
|
+
export function underwritingSave(
|
|
37
|
+
client: MoovCore,
|
|
38
|
+
request: operations.SaveUnderwritingRequest,
|
|
39
|
+
options?: RequestOptions,
|
|
40
|
+
): APIPromise<
|
|
41
|
+
Result<
|
|
42
|
+
operations.SaveUnderwritingResponse,
|
|
43
|
+
| errors.GenericError
|
|
44
|
+
| errors.UpsertUnderwritingError
|
|
45
|
+
| MoovError
|
|
46
|
+
| ResponseValidationError
|
|
47
|
+
| ConnectionError
|
|
48
|
+
| RequestAbortedError
|
|
49
|
+
| RequestTimeoutError
|
|
50
|
+
| InvalidRequestError
|
|
51
|
+
| UnexpectedClientError
|
|
52
|
+
| SDKValidationError
|
|
53
|
+
>
|
|
54
|
+
> {
|
|
55
|
+
return new APIPromise($do(
|
|
56
|
+
client,
|
|
57
|
+
request,
|
|
58
|
+
options,
|
|
59
|
+
));
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
async function $do(
|
|
63
|
+
client: MoovCore,
|
|
64
|
+
request: operations.SaveUnderwritingRequest,
|
|
65
|
+
options?: RequestOptions,
|
|
66
|
+
): Promise<
|
|
67
|
+
[
|
|
68
|
+
Result<
|
|
69
|
+
operations.SaveUnderwritingResponse,
|
|
70
|
+
| errors.GenericError
|
|
71
|
+
| errors.UpsertUnderwritingError
|
|
72
|
+
| MoovError
|
|
73
|
+
| ResponseValidationError
|
|
74
|
+
| ConnectionError
|
|
75
|
+
| RequestAbortedError
|
|
76
|
+
| RequestTimeoutError
|
|
77
|
+
| InvalidRequestError
|
|
78
|
+
| UnexpectedClientError
|
|
79
|
+
| SDKValidationError
|
|
80
|
+
>,
|
|
81
|
+
APICall,
|
|
82
|
+
]
|
|
83
|
+
> {
|
|
84
|
+
const parsed = safeParse(
|
|
85
|
+
request,
|
|
86
|
+
(value) => operations.SaveUnderwritingRequest$outboundSchema.parse(value),
|
|
87
|
+
"Input validation failed",
|
|
88
|
+
);
|
|
89
|
+
if (!parsed.ok) {
|
|
90
|
+
return [parsed, { status: "invalid" }];
|
|
91
|
+
}
|
|
92
|
+
const payload = parsed.value;
|
|
93
|
+
const body = encodeJSON("body", payload.UpsertUnderwriting, {
|
|
94
|
+
explode: true,
|
|
95
|
+
});
|
|
96
|
+
|
|
97
|
+
const pathParams = {
|
|
98
|
+
accountID: encodeSimple("accountID", payload.accountID, {
|
|
99
|
+
explode: false,
|
|
100
|
+
charEncoding: "percent",
|
|
101
|
+
}),
|
|
102
|
+
};
|
|
103
|
+
|
|
104
|
+
const path = pathToFunc("/accounts/{accountID}/underwriting")(pathParams);
|
|
105
|
+
|
|
106
|
+
const headers = new Headers(compactMap({
|
|
107
|
+
"Content-Type": "application/json",
|
|
108
|
+
Accept: "application/json",
|
|
109
|
+
"x-moov-version": encodeSimple(
|
|
110
|
+
"x-moov-version",
|
|
111
|
+
client._options.xMoovVersion,
|
|
112
|
+
{ explode: false, charEncoding: "none" },
|
|
113
|
+
),
|
|
114
|
+
}));
|
|
115
|
+
|
|
116
|
+
const securityInput = await extractSecurity(client._options.security);
|
|
117
|
+
const requestSecurity = resolveGlobalSecurity(securityInput);
|
|
118
|
+
|
|
119
|
+
const context = {
|
|
120
|
+
options: client._options,
|
|
121
|
+
baseURL: options?.serverURL ?? client._baseURL ?? "",
|
|
122
|
+
operationID: "saveUnderwriting",
|
|
123
|
+
oAuth2Scopes: [],
|
|
124
|
+
|
|
125
|
+
resolvedSecurity: requestSecurity,
|
|
126
|
+
|
|
127
|
+
securitySource: client._options.security,
|
|
128
|
+
retryConfig: options?.retries
|
|
129
|
+
|| client._options.retryConfig
|
|
130
|
+
|| { strategy: "none" },
|
|
131
|
+
retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
|
|
132
|
+
};
|
|
133
|
+
|
|
134
|
+
const requestRes = client._createRequest(context, {
|
|
135
|
+
security: requestSecurity,
|
|
136
|
+
method: "POST",
|
|
137
|
+
baseURL: options?.serverURL,
|
|
138
|
+
path: path,
|
|
139
|
+
headers: headers,
|
|
140
|
+
body: body,
|
|
141
|
+
userAgent: client._options.userAgent,
|
|
142
|
+
timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
|
|
143
|
+
}, options);
|
|
144
|
+
if (!requestRes.ok) {
|
|
145
|
+
return [requestRes, { status: "invalid" }];
|
|
146
|
+
}
|
|
147
|
+
const req = requestRes.value;
|
|
148
|
+
|
|
149
|
+
const doResult = await client._do(req, {
|
|
150
|
+
context,
|
|
151
|
+
errorCodes: [
|
|
152
|
+
"400",
|
|
153
|
+
"401",
|
|
154
|
+
"403",
|
|
155
|
+
"404",
|
|
156
|
+
"409",
|
|
157
|
+
"422",
|
|
158
|
+
"429",
|
|
159
|
+
"4XX",
|
|
160
|
+
"500",
|
|
161
|
+
"504",
|
|
162
|
+
"5XX",
|
|
163
|
+
],
|
|
164
|
+
retryConfig: context.retryConfig,
|
|
165
|
+
retryCodes: context.retryCodes,
|
|
166
|
+
});
|
|
167
|
+
if (!doResult.ok) {
|
|
168
|
+
return [doResult, { status: "request-error", request: req }];
|
|
169
|
+
}
|
|
170
|
+
const response = doResult.value;
|
|
171
|
+
|
|
172
|
+
const responseFields = {
|
|
173
|
+
HttpMeta: { Response: response, Request: req },
|
|
174
|
+
};
|
|
175
|
+
|
|
176
|
+
const [result] = await M.match<
|
|
177
|
+
operations.SaveUnderwritingResponse,
|
|
178
|
+
| errors.GenericError
|
|
179
|
+
| errors.UpsertUnderwritingError
|
|
180
|
+
| MoovError
|
|
181
|
+
| ResponseValidationError
|
|
182
|
+
| ConnectionError
|
|
183
|
+
| RequestAbortedError
|
|
184
|
+
| RequestTimeoutError
|
|
185
|
+
| InvalidRequestError
|
|
186
|
+
| UnexpectedClientError
|
|
187
|
+
| SDKValidationError
|
|
188
|
+
>(
|
|
189
|
+
M.json(200, operations.SaveUnderwritingResponse$inboundSchema, {
|
|
190
|
+
hdrs: true,
|
|
191
|
+
key: "Result",
|
|
192
|
+
}),
|
|
193
|
+
M.jsonErr([400, 409], errors.GenericError$inboundSchema, { hdrs: true }),
|
|
194
|
+
M.jsonErr(422, errors.UpsertUnderwritingError$inboundSchema, {
|
|
195
|
+
hdrs: true,
|
|
196
|
+
}),
|
|
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.
|
|
77
|
-
genVersion: "2.
|
|
78
|
-
userAgent: "speakeasy-sdk/typescript 0.
|
|
76
|
+
sdkVersion: "0.13.0",
|
|
77
|
+
genVersion: "2.638.5",
|
|
78
|
+
userAgent: "speakeasy-sdk/typescript 0.13.0 2.638.5 latest @moovio/sdk",
|
|
79
79
|
} as const;
|
package/src/mcp-server/server.ts
CHANGED
|
@@ -145,6 +145,7 @@ import { tool$transfersList } from "./tools/transfersList.js";
|
|
|
145
145
|
import { tool$transfersListRefunds } from "./tools/transfersListRefunds.js";
|
|
146
146
|
import { tool$transfersUpdate } from "./tools/transfersUpdate.js";
|
|
147
147
|
import { tool$underwritingGet } from "./tools/underwritingGet.js";
|
|
148
|
+
import { tool$underwritingSave } from "./tools/underwritingSave.js";
|
|
148
149
|
import { tool$underwritingUpsert } from "./tools/underwritingUpsert.js";
|
|
149
150
|
import { tool$walletsGet } from "./tools/walletsGet.js";
|
|
150
151
|
import { tool$walletsList } from "./tools/walletsList.js";
|
|
@@ -162,7 +163,7 @@ export function createMCPServer(deps: {
|
|
|
162
163
|
}) {
|
|
163
164
|
const server = new McpServer({
|
|
164
165
|
name: "Moov",
|
|
165
|
-
version: "0.
|
|
166
|
+
version: "0.13.0",
|
|
166
167
|
});
|
|
167
168
|
|
|
168
169
|
const client = new MoovCore({
|
|
@@ -294,6 +295,7 @@ export function createMCPServer(deps: {
|
|
|
294
295
|
tool(tool$transfersCreateReversal);
|
|
295
296
|
tool(tool$transfersGenerateOptions);
|
|
296
297
|
tool(tool$underwritingGet);
|
|
298
|
+
tool(tool$underwritingSave);
|
|
297
299
|
tool(tool$underwritingUpsert);
|
|
298
300
|
tool(tool$walletsList);
|
|
299
301
|
tool(tool$walletsGet);
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import { underwritingSave } from "../../funcs/underwritingSave.js";
|
|
6
|
+
import * as operations from "../../models/operations/index.js";
|
|
7
|
+
import { formatResult, ToolDefinition } from "../tools.js";
|
|
8
|
+
|
|
9
|
+
const args = {
|
|
10
|
+
request: operations.SaveUnderwritingRequest$inboundSchema,
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
export const tool$underwritingSave: ToolDefinition<typeof args> = {
|
|
14
|
+
name: "underwriting-save",
|
|
15
|
+
description: `Create or update the account's underwriting.
|
|
16
|
+
|
|
17
|
+
Read our [underwriting guide](https://docs.moov.io/guides/accounts/requirements/underwriting/) to learn more.
|
|
18
|
+
|
|
19
|
+
To access this endpoint using an [access token](https://docs.moov.io/api/authentication/access-tokens/)
|
|
20
|
+
you'll need to specify the \`/accounts/{accountID}/profile.write\` scope.`,
|
|
21
|
+
args,
|
|
22
|
+
tool: async (client, args, ctx) => {
|
|
23
|
+
const [result, apiCall] = await underwritingSave(
|
|
24
|
+
client,
|
|
25
|
+
args.request,
|
|
26
|
+
{ fetchOptions: { signal: ctx.signal } },
|
|
27
|
+
).$inspect();
|
|
28
|
+
|
|
29
|
+
if (!result.ok) {
|
|
30
|
+
return {
|
|
31
|
+
content: [{ type: "text", text: result.error.message }],
|
|
32
|
+
isError: true,
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
const value = result.value.result;
|
|
37
|
+
|
|
38
|
+
return formatResult(value, apiCall);
|
|
39
|
+
},
|
|
40
|
+
};
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod";
|
|
6
|
+
import { ClosedEnum } from "../../types/enums.js";
|
|
7
|
+
|
|
8
|
+
export const BusinessPresence = {
|
|
9
|
+
CommercialOffice: "commercial-office",
|
|
10
|
+
HomeBased: "home-based",
|
|
11
|
+
MixedPresence: "mixed-presence",
|
|
12
|
+
MobileBusiness: "mobile-business",
|
|
13
|
+
OnlineOnly: "online-only",
|
|
14
|
+
RetailStorefront: "retail-storefront",
|
|
15
|
+
} as const;
|
|
16
|
+
export type BusinessPresence = ClosedEnum<typeof BusinessPresence>;
|
|
17
|
+
|
|
18
|
+
/** @internal */
|
|
19
|
+
export const BusinessPresence$inboundSchema: z.ZodNativeEnum<
|
|
20
|
+
typeof BusinessPresence
|
|
21
|
+
> = z.nativeEnum(BusinessPresence);
|
|
22
|
+
|
|
23
|
+
/** @internal */
|
|
24
|
+
export const BusinessPresence$outboundSchema: z.ZodNativeEnum<
|
|
25
|
+
typeof BusinessPresence
|
|
26
|
+
> = BusinessPresence$inboundSchema;
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* @internal
|
|
30
|
+
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
31
|
+
*/
|
|
32
|
+
export namespace BusinessPresence$ {
|
|
33
|
+
/** @deprecated use `BusinessPresence$inboundSchema` instead. */
|
|
34
|
+
export const inboundSchema = BusinessPresence$inboundSchema;
|
|
35
|
+
/** @deprecated use `BusinessPresence$outboundSchema` instead. */
|
|
36
|
+
export const outboundSchema = BusinessPresence$outboundSchema;
|
|
37
|
+
}
|
|
@@ -29,7 +29,7 @@ export type Capability = {
|
|
|
29
29
|
*
|
|
30
30
|
* @remarks
|
|
31
31
|
*
|
|
32
|
-
* The `production-app`
|
|
32
|
+
* The `production-app`, `platform.production-app`, and / or `platform.wallet-transfers` capabilities might appear in your list. These are read-only capabilities that Moov requests and uses for account verification purposes. These capabilities remains active with your account and require no additional action.
|
|
33
33
|
*/
|
|
34
34
|
capability: CapabilityID;
|
|
35
35
|
accountID: string;
|
|
@@ -10,22 +10,32 @@ import { ClosedEnum } from "../../types/enums.js";
|
|
|
10
10
|
*
|
|
11
11
|
* @remarks
|
|
12
12
|
*
|
|
13
|
-
* The `production-app`
|
|
13
|
+
* The `production-app`, `platform.production-app`, and / or `platform.wallet-transfers` capabilities might appear in your list. These are read-only capabilities that Moov requests and uses for account verification purposes. These capabilities remains active with your account and require no additional action.
|
|
14
14
|
*/
|
|
15
15
|
export const CapabilityID = {
|
|
16
16
|
Transfers: "transfers",
|
|
17
17
|
SendFunds: "send-funds",
|
|
18
|
+
SendFundsPushToCard: "send-funds.push-to-card",
|
|
19
|
+
MoneyTransferPushToCard: "money-transfer.push-to-card",
|
|
20
|
+
SendFundsAch: "send-funds.ach",
|
|
21
|
+
SendFundsRtp: "send-funds.rtp",
|
|
18
22
|
CollectFunds: "collect-funds",
|
|
23
|
+
CollectFundsCardPayments: "collect-funds.card-payments",
|
|
24
|
+
MoneyTransferPullFromCard: "money-transfer.pull-from-card",
|
|
25
|
+
CollectFundsAch: "collect-funds.ach",
|
|
19
26
|
Wallet: "wallet",
|
|
27
|
+
WalletBalance: "wallet.balance",
|
|
20
28
|
CardIssuing: "card-issuing",
|
|
21
29
|
ProductionApp: "production-app",
|
|
30
|
+
PlatformProductionApp: "platform.production-app",
|
|
31
|
+
PlatformWalletTransfers: "platform.wallet-transfers",
|
|
22
32
|
} as const;
|
|
23
33
|
/**
|
|
24
34
|
* Moov account capabilities.
|
|
25
35
|
*
|
|
26
36
|
* @remarks
|
|
27
37
|
*
|
|
28
|
-
* The `production-app`
|
|
38
|
+
* The `production-app`, `platform.production-app`, and / or `platform.wallet-transfers` capabilities might appear in your list. These are read-only capabilities that Moov requests and uses for account verification purposes. These capabilities remains active with your account and require no additional action.
|
|
29
39
|
*/
|
|
30
40
|
export type CapabilityID = ClosedEnum<typeof CapabilityID>;
|
|
31
41
|
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod";
|
|
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
|
+
/**
|
|
11
|
+
* Describes the distribution of card transactions by payment method.
|
|
12
|
+
*/
|
|
13
|
+
export type CardAcceptanceMethods = {
|
|
14
|
+
/**
|
|
15
|
+
* Percentage of card transactions that are in-person payments. Minimum value is 0, maximum is 100.
|
|
16
|
+
*/
|
|
17
|
+
inPersonPercentage?: number | undefined;
|
|
18
|
+
/**
|
|
19
|
+
* Percentage of card transactions that are mail or phone payments. Minimum value is 0, maximum is 100.
|
|
20
|
+
*/
|
|
21
|
+
mailOrPhonePercentage?: number | undefined;
|
|
22
|
+
/**
|
|
23
|
+
* Percentage of card transactions that are online payments. Minimum value is 0, maximum is 100.
|
|
24
|
+
*/
|
|
25
|
+
onlinePercentage?: number | undefined;
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
/** @internal */
|
|
29
|
+
export const CardAcceptanceMethods$inboundSchema: z.ZodType<
|
|
30
|
+
CardAcceptanceMethods,
|
|
31
|
+
z.ZodTypeDef,
|
|
32
|
+
unknown
|
|
33
|
+
> = z.object({
|
|
34
|
+
inPersonPercentage: z.number().int().optional(),
|
|
35
|
+
mailOrPhonePercentage: z.number().int().optional(),
|
|
36
|
+
onlinePercentage: z.number().int().optional(),
|
|
37
|
+
});
|
|
38
|
+
|
|
39
|
+
/** @internal */
|
|
40
|
+
export type CardAcceptanceMethods$Outbound = {
|
|
41
|
+
inPersonPercentage?: number | undefined;
|
|
42
|
+
mailOrPhonePercentage?: number | undefined;
|
|
43
|
+
onlinePercentage?: number | undefined;
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
/** @internal */
|
|
47
|
+
export const CardAcceptanceMethods$outboundSchema: z.ZodType<
|
|
48
|
+
CardAcceptanceMethods$Outbound,
|
|
49
|
+
z.ZodTypeDef,
|
|
50
|
+
CardAcceptanceMethods
|
|
51
|
+
> = z.object({
|
|
52
|
+
inPersonPercentage: z.number().int().optional(),
|
|
53
|
+
mailOrPhonePercentage: z.number().int().optional(),
|
|
54
|
+
onlinePercentage: z.number().int().optional(),
|
|
55
|
+
});
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* @internal
|
|
59
|
+
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
60
|
+
*/
|
|
61
|
+
export namespace CardAcceptanceMethods$ {
|
|
62
|
+
/** @deprecated use `CardAcceptanceMethods$inboundSchema` instead. */
|
|
63
|
+
export const inboundSchema = CardAcceptanceMethods$inboundSchema;
|
|
64
|
+
/** @deprecated use `CardAcceptanceMethods$outboundSchema` instead. */
|
|
65
|
+
export const outboundSchema = CardAcceptanceMethods$outboundSchema;
|
|
66
|
+
/** @deprecated use `CardAcceptanceMethods$Outbound` instead. */
|
|
67
|
+
export type Outbound = CardAcceptanceMethods$Outbound;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
export function cardAcceptanceMethodsToJSON(
|
|
71
|
+
cardAcceptanceMethods: CardAcceptanceMethods,
|
|
72
|
+
): string {
|
|
73
|
+
return JSON.stringify(
|
|
74
|
+
CardAcceptanceMethods$outboundSchema.parse(cardAcceptanceMethods),
|
|
75
|
+
);
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
export function cardAcceptanceMethodsFromJSON(
|
|
79
|
+
jsonString: string,
|
|
80
|
+
): SafeParseResult<CardAcceptanceMethods, SDKValidationError> {
|
|
81
|
+
return safeParse(
|
|
82
|
+
jsonString,
|
|
83
|
+
(x) => CardAcceptanceMethods$inboundSchema.parse(JSON.parse(x)),
|
|
84
|
+
`Failed to parse 'CardAcceptanceMethods' from JSON`,
|
|
85
|
+
);
|
|
86
|
+
}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod";
|
|
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 CardAcceptanceMethodsError = {
|
|
11
|
+
inPersonPercentage?: string | undefined;
|
|
12
|
+
mailOrPhonePercentage?: string | undefined;
|
|
13
|
+
onlinePercentage?: string | undefined;
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
/** @internal */
|
|
17
|
+
export const CardAcceptanceMethodsError$inboundSchema: z.ZodType<
|
|
18
|
+
CardAcceptanceMethodsError,
|
|
19
|
+
z.ZodTypeDef,
|
|
20
|
+
unknown
|
|
21
|
+
> = z.object({
|
|
22
|
+
inPersonPercentage: z.string().optional(),
|
|
23
|
+
mailOrPhonePercentage: z.string().optional(),
|
|
24
|
+
onlinePercentage: z.string().optional(),
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
/** @internal */
|
|
28
|
+
export type CardAcceptanceMethodsError$Outbound = {
|
|
29
|
+
inPersonPercentage?: string | undefined;
|
|
30
|
+
mailOrPhonePercentage?: string | undefined;
|
|
31
|
+
onlinePercentage?: string | undefined;
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
/** @internal */
|
|
35
|
+
export const CardAcceptanceMethodsError$outboundSchema: z.ZodType<
|
|
36
|
+
CardAcceptanceMethodsError$Outbound,
|
|
37
|
+
z.ZodTypeDef,
|
|
38
|
+
CardAcceptanceMethodsError
|
|
39
|
+
> = z.object({
|
|
40
|
+
inPersonPercentage: z.string().optional(),
|
|
41
|
+
mailOrPhonePercentage: z.string().optional(),
|
|
42
|
+
onlinePercentage: z.string().optional(),
|
|
43
|
+
});
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* @internal
|
|
47
|
+
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
48
|
+
*/
|
|
49
|
+
export namespace CardAcceptanceMethodsError$ {
|
|
50
|
+
/** @deprecated use `CardAcceptanceMethodsError$inboundSchema` instead. */
|
|
51
|
+
export const inboundSchema = CardAcceptanceMethodsError$inboundSchema;
|
|
52
|
+
/** @deprecated use `CardAcceptanceMethodsError$outboundSchema` instead. */
|
|
53
|
+
export const outboundSchema = CardAcceptanceMethodsError$outboundSchema;
|
|
54
|
+
/** @deprecated use `CardAcceptanceMethodsError$Outbound` instead. */
|
|
55
|
+
export type Outbound = CardAcceptanceMethodsError$Outbound;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
export function cardAcceptanceMethodsErrorToJSON(
|
|
59
|
+
cardAcceptanceMethodsError: CardAcceptanceMethodsError,
|
|
60
|
+
): string {
|
|
61
|
+
return JSON.stringify(
|
|
62
|
+
CardAcceptanceMethodsError$outboundSchema.parse(cardAcceptanceMethodsError),
|
|
63
|
+
);
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
export function cardAcceptanceMethodsErrorFromJSON(
|
|
67
|
+
jsonString: string,
|
|
68
|
+
): SafeParseResult<CardAcceptanceMethodsError, SDKValidationError> {
|
|
69
|
+
return safeParse(
|
|
70
|
+
jsonString,
|
|
71
|
+
(x) => CardAcceptanceMethodsError$inboundSchema.parse(JSON.parse(x)),
|
|
72
|
+
`Failed to parse 'CardAcceptanceMethodsError' from JSON`,
|
|
73
|
+
);
|
|
74
|
+
}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod";
|
|
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
|
+
CollectFundsAch,
|
|
11
|
+
CollectFundsAch$inboundSchema,
|
|
12
|
+
CollectFundsAch$Outbound,
|
|
13
|
+
CollectFundsAch$outboundSchema,
|
|
14
|
+
} from "./collectfundsach.js";
|
|
15
|
+
import {
|
|
16
|
+
CollectFundsCardPayments,
|
|
17
|
+
CollectFundsCardPayments$inboundSchema,
|
|
18
|
+
CollectFundsCardPayments$Outbound,
|
|
19
|
+
CollectFundsCardPayments$outboundSchema,
|
|
20
|
+
} from "./collectfundscardpayments.js";
|
|
21
|
+
|
|
22
|
+
export type CollectFunds = {
|
|
23
|
+
ach?: CollectFundsAch | undefined;
|
|
24
|
+
cardPayments?: CollectFundsCardPayments | undefined;
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
/** @internal */
|
|
28
|
+
export const CollectFunds$inboundSchema: z.ZodType<
|
|
29
|
+
CollectFunds,
|
|
30
|
+
z.ZodTypeDef,
|
|
31
|
+
unknown
|
|
32
|
+
> = z.object({
|
|
33
|
+
ach: CollectFundsAch$inboundSchema.optional(),
|
|
34
|
+
cardPayments: CollectFundsCardPayments$inboundSchema.optional(),
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
/** @internal */
|
|
38
|
+
export type CollectFunds$Outbound = {
|
|
39
|
+
ach?: CollectFundsAch$Outbound | undefined;
|
|
40
|
+
cardPayments?: CollectFundsCardPayments$Outbound | undefined;
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
/** @internal */
|
|
44
|
+
export const CollectFunds$outboundSchema: z.ZodType<
|
|
45
|
+
CollectFunds$Outbound,
|
|
46
|
+
z.ZodTypeDef,
|
|
47
|
+
CollectFunds
|
|
48
|
+
> = z.object({
|
|
49
|
+
ach: CollectFundsAch$outboundSchema.optional(),
|
|
50
|
+
cardPayments: CollectFundsCardPayments$outboundSchema.optional(),
|
|
51
|
+
});
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* @internal
|
|
55
|
+
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
56
|
+
*/
|
|
57
|
+
export namespace CollectFunds$ {
|
|
58
|
+
/** @deprecated use `CollectFunds$inboundSchema` instead. */
|
|
59
|
+
export const inboundSchema = CollectFunds$inboundSchema;
|
|
60
|
+
/** @deprecated use `CollectFunds$outboundSchema` instead. */
|
|
61
|
+
export const outboundSchema = CollectFunds$outboundSchema;
|
|
62
|
+
/** @deprecated use `CollectFunds$Outbound` instead. */
|
|
63
|
+
export type Outbound = CollectFunds$Outbound;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
export function collectFundsToJSON(collectFunds: CollectFunds): string {
|
|
67
|
+
return JSON.stringify(CollectFunds$outboundSchema.parse(collectFunds));
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
export function collectFundsFromJSON(
|
|
71
|
+
jsonString: string,
|
|
72
|
+
): SafeParseResult<CollectFunds, SDKValidationError> {
|
|
73
|
+
return safeParse(
|
|
74
|
+
jsonString,
|
|
75
|
+
(x) => CollectFunds$inboundSchema.parse(JSON.parse(x)),
|
|
76
|
+
`Failed to parse 'CollectFunds' from JSON`,
|
|
77
|
+
);
|
|
78
|
+
}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod";
|
|
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
|
+
EstimatedActivity,
|
|
11
|
+
EstimatedActivity$inboundSchema,
|
|
12
|
+
EstimatedActivity$Outbound,
|
|
13
|
+
EstimatedActivity$outboundSchema,
|
|
14
|
+
} from "./estimatedactivity.js";
|
|
15
|
+
|
|
16
|
+
export type CollectFundsAch = {
|
|
17
|
+
estimatedActivity?: EstimatedActivity | undefined;
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
/** @internal */
|
|
21
|
+
export const CollectFundsAch$inboundSchema: z.ZodType<
|
|
22
|
+
CollectFundsAch,
|
|
23
|
+
z.ZodTypeDef,
|
|
24
|
+
unknown
|
|
25
|
+
> = z.object({
|
|
26
|
+
estimatedActivity: EstimatedActivity$inboundSchema.optional(),
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
/** @internal */
|
|
30
|
+
export type CollectFundsAch$Outbound = {
|
|
31
|
+
estimatedActivity?: EstimatedActivity$Outbound | undefined;
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
/** @internal */
|
|
35
|
+
export const CollectFundsAch$outboundSchema: z.ZodType<
|
|
36
|
+
CollectFundsAch$Outbound,
|
|
37
|
+
z.ZodTypeDef,
|
|
38
|
+
CollectFundsAch
|
|
39
|
+
> = z.object({
|
|
40
|
+
estimatedActivity: EstimatedActivity$outboundSchema.optional(),
|
|
41
|
+
});
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* @internal
|
|
45
|
+
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
46
|
+
*/
|
|
47
|
+
export namespace CollectFundsAch$ {
|
|
48
|
+
/** @deprecated use `CollectFundsAch$inboundSchema` instead. */
|
|
49
|
+
export const inboundSchema = CollectFundsAch$inboundSchema;
|
|
50
|
+
/** @deprecated use `CollectFundsAch$outboundSchema` instead. */
|
|
51
|
+
export const outboundSchema = CollectFundsAch$outboundSchema;
|
|
52
|
+
/** @deprecated use `CollectFundsAch$Outbound` instead. */
|
|
53
|
+
export type Outbound = CollectFundsAch$Outbound;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
export function collectFundsAchToJSON(
|
|
57
|
+
collectFundsAch: CollectFundsAch,
|
|
58
|
+
): string {
|
|
59
|
+
return JSON.stringify(CollectFundsAch$outboundSchema.parse(collectFundsAch));
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
export function collectFundsAchFromJSON(
|
|
63
|
+
jsonString: string,
|
|
64
|
+
): SafeParseResult<CollectFundsAch, SDKValidationError> {
|
|
65
|
+
return safeParse(
|
|
66
|
+
jsonString,
|
|
67
|
+
(x) => CollectFundsAch$inboundSchema.parse(JSON.parse(x)),
|
|
68
|
+
`Failed to parse 'CollectFundsAch' from JSON`,
|
|
69
|
+
);
|
|
70
|
+
}
|