@moovio/sdk 26.4.0 → 26.4.2
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/FUNCTIONS.md +2 -2
- package/README.md +73 -59
- package/bin/mcp-server.js +1107 -271
- package/bin/mcp-server.js.map +55 -31
- package/funcs/filesUpload.d.ts.map +1 -1
- package/funcs/filesUpload.js +3 -1
- package/funcs/filesUpload.js.map +1 -1
- package/funcs/googlePayLinkToken.d.ts +3 -1
- package/funcs/googlePayLinkToken.d.ts.map +1 -1
- package/funcs/googlePayLinkToken.js +3 -1
- package/funcs/googlePayLinkToken.js.map +1 -1
- package/funcs/transferConfigCreate.d.ts +15 -0
- package/funcs/transferConfigCreate.d.ts.map +1 -0
- package/funcs/transferConfigCreate.js +128 -0
- package/funcs/transferConfigCreate.js.map +1 -0
- package/funcs/transferConfigGet.d.ts +14 -0
- package/funcs/transferConfigGet.d.ts.map +1 -0
- package/funcs/transferConfigGet.js +122 -0
- package/funcs/transferConfigGet.js.map +1 -0
- package/funcs/transferConfigUpdate.d.ts +15 -0
- package/funcs/transferConfigUpdate.d.ts.map +1 -0
- package/funcs/transferConfigUpdate.js +126 -0
- package/funcs/transferConfigUpdate.js.map +1 -0
- package/jsr.json +1 -1
- package/lib/config.d.ts +3 -3
- package/lib/config.js +3 -3
- package/lib/config.js.map +1 -1
- package/mcp-server/mcp-server.js +1 -1
- package/mcp-server/server.d.ts.map +1 -1
- package/mcp-server/server.js +7 -1
- package/mcp-server/server.js.map +1 -1
- package/mcp-server/tools/googlePayLinkToken.d.ts.map +1 -1
- package/mcp-server/tools/googlePayLinkToken.js +3 -1
- package/mcp-server/tools/googlePayLinkToken.js.map +1 -1
- package/mcp-server/tools/transferConfigCreate.d.ts +8 -0
- package/mcp-server/tools/transferConfigCreate.d.ts.map +1 -0
- package/mcp-server/tools/transferConfigCreate.js +62 -0
- package/mcp-server/tools/transferConfigCreate.js.map +1 -0
- package/mcp-server/tools/transferConfigGet.d.ts +8 -0
- package/mcp-server/tools/transferConfigGet.d.ts.map +1 -0
- package/mcp-server/tools/transferConfigGet.js +62 -0
- package/mcp-server/tools/transferConfigGet.js.map +1 -0
- package/mcp-server/tools/transferConfigUpdate.d.ts +8 -0
- package/mcp-server/tools/transferConfigUpdate.d.ts.map +1 -0
- package/mcp-server/tools/transferConfigUpdate.js +62 -0
- package/mcp-server/tools/transferConfigUpdate.js.map +1 -0
- package/models/components/createdtransfer.d.ts +4 -1
- package/models/components/createdtransfer.d.ts.map +1 -1
- package/models/components/createdtransfer.js +3 -0
- package/models/components/createdtransfer.js.map +1 -1
- package/models/components/createpaymentlink.d.ts +13 -0
- package/models/components/createpaymentlink.d.ts.map +1 -1
- package/models/components/createpaymentlink.js.map +1 -1
- package/models/components/createtippresets.d.ts +36 -0
- package/models/components/createtippresets.d.ts.map +1 -0
- package/models/components/createtippresets.js +64 -0
- package/models/components/createtippresets.js.map +1 -0
- package/models/components/createtransfer.d.ts +3 -3
- package/models/components/createtransfer.d.ts.map +1 -1
- package/models/components/createtransfer.js +3 -0
- package/models/components/createtransfer.js.map +1 -1
- package/models/components/createtransferamountdetails.d.ts +21 -0
- package/models/components/createtransferamountdetails.d.ts.map +1 -0
- package/models/components/createtransferamountdetails.js +59 -0
- package/models/components/createtransferamountdetails.js.map +1 -0
- package/models/components/createtransferamountdetailsvalidationerror.d.ts +17 -0
- package/models/components/createtransferamountdetailsvalidationerror.d.ts.map +1 -0
- package/models/components/createtransferamountdetailsvalidationerror.js +58 -0
- package/models/components/createtransferamountdetailsvalidationerror.js.map +1 -0
- package/models/components/createtransferconfig.d.ts +18 -0
- package/models/components/createtransferconfig.d.ts.map +1 -0
- package/models/components/{googlepayintermediatesigningkey.js → createtransferconfig.js} +13 -14
- package/models/components/createtransferconfig.js.map +1 -0
- package/models/components/fileuploadmetadata.d.ts +28 -0
- package/models/components/fileuploadmetadata.d.ts.map +1 -0
- package/models/components/fileuploadmetadata.js +69 -0
- package/models/components/fileuploadmetadata.js.map +1 -0
- package/models/components/fileuploadrequestmultipart.d.ts +5 -8
- package/models/components/fileuploadrequestmultipart.d.ts.map +1 -1
- package/models/components/fileuploadrequestmultipart.js +3 -2
- package/models/components/fileuploadrequestmultipart.js.map +1 -1
- package/models/components/googlepayassurancedetails.d.ts +28 -0
- package/models/components/googlepayassurancedetails.d.ts.map +1 -0
- package/models/components/googlepayassurancedetails.js +60 -0
- package/models/components/googlepayassurancedetails.js.map +1 -0
- package/models/components/googlepaybillingaddress.d.ts +73 -0
- package/models/components/googlepaybillingaddress.d.ts.map +1 -0
- package/models/components/googlepaybillingaddress.js +76 -0
- package/models/components/googlepaybillingaddress.js.map +1 -0
- package/models/components/googlepaycardinfo.d.ts +91 -0
- package/models/components/googlepaycardinfo.d.ts.map +1 -0
- package/models/components/googlepaycardinfo.js +98 -0
- package/models/components/googlepaycardinfo.js.map +1 -0
- package/models/components/googlepaypaymentmethoddata.d.ts +65 -0
- package/models/components/googlepaypaymentmethoddata.d.ts.map +1 -0
- package/models/components/googlepaypaymentmethoddata.js +76 -0
- package/models/components/googlepaypaymentmethoddata.js.map +1 -0
- package/models/components/googlepaytokenizationdata.d.ts +47 -0
- package/models/components/googlepaytokenizationdata.d.ts.map +1 -0
- package/models/components/googlepaytokenizationdata.js +70 -0
- package/models/components/googlepaytokenizationdata.js.map +1 -0
- package/models/components/index.d.ts +16 -2
- package/models/components/index.d.ts.map +1 -1
- package/models/components/index.js +16 -2
- package/models/components/index.js.map +1 -1
- package/models/components/linkedgooglepaypaymentmethod.d.ts +5 -10
- package/models/components/linkedgooglepaypaymentmethod.d.ts.map +1 -1
- package/models/components/linkedgooglepaypaymentmethod.js +4 -11
- package/models/components/linkedgooglepaypaymentmethod.js.map +1 -1
- package/models/components/linkgooglepay.d.ts +17 -9
- package/models/components/linkgooglepay.d.ts.map +1 -1
- package/models/components/linkgooglepay.js +5 -3
- package/models/components/linkgooglepay.js.map +1 -1
- package/models/components/paymentlink.d.ts +10 -0
- package/models/components/paymentlink.d.ts.map +1 -1
- package/models/components/paymentlink.js.map +1 -1
- package/models/components/paymentlinkcustomeroptions.d.ts +5 -0
- package/models/components/paymentlinkcustomeroptions.d.ts.map +1 -1
- package/models/components/paymentlinkcustomeroptions.js +2 -0
- package/models/components/paymentlinkcustomeroptions.js.map +1 -1
- package/models/components/puttippresets.d.ts +36 -0
- package/models/components/puttippresets.d.ts.map +1 -0
- package/models/components/puttippresets.js +64 -0
- package/models/components/puttippresets.js.map +1 -0
- package/models/components/puttransferconfig.d.ts +18 -0
- package/models/components/puttransferconfig.d.ts.map +1 -0
- package/models/components/puttransferconfig.js +59 -0
- package/models/components/puttransferconfig.js.map +1 -0
- package/models/components/tipcalculationbasis.d.ts +26 -0
- package/models/components/tipcalculationbasis.d.ts.map +1 -0
- package/models/components/tipcalculationbasis.js +56 -0
- package/models/components/tipcalculationbasis.js.map +1 -0
- package/models/components/tippresets.d.ts +39 -0
- package/models/components/tippresets.d.ts.map +1 -0
- package/models/components/tippresets.js +64 -0
- package/models/components/tippresets.js.map +1 -0
- package/models/components/transfer.d.ts +3 -3
- package/models/components/transfer.d.ts.map +1 -1
- package/models/components/transfer.js +3 -0
- package/models/components/transfer.js.map +1 -1
- package/models/components/transferamountdetails.d.ts +21 -0
- package/models/components/transferamountdetails.d.ts.map +1 -0
- package/models/components/transferamountdetails.js +59 -0
- package/models/components/transferamountdetails.js.map +1 -0
- package/models/components/transferconfig.d.ts +24 -0
- package/models/components/transferconfig.d.ts.map +1 -0
- package/models/components/{googlepaytoken.js → transferconfig.js} +13 -19
- package/models/components/transferconfig.js.map +1 -0
- package/models/components/transferdestination.d.ts +6 -0
- package/models/components/transferdestination.d.ts.map +1 -1
- package/models/components/transferdestination.js +3 -0
- package/models/components/transferdestination.js.map +1 -1
- package/models/components/transfersource.d.ts +6 -0
- package/models/components/transfersource.d.ts.map +1 -1
- package/models/components/transfersource.js +3 -0
- package/models/components/transfersource.js.map +1 -1
- package/models/components/webhookdata.d.ts +2 -2
- package/models/components/webhookdata.d.ts.map +1 -1
- package/models/components/webhookdata.js +2 -2
- package/models/components/webhookdata.js.map +1 -1
- package/models/components/webhookdatabankaccountcreated.d.ts +3 -0
- package/models/components/webhookdatabankaccountcreated.d.ts.map +1 -1
- package/models/components/webhookdatabankaccountcreated.js +3 -0
- package/models/components/webhookdatabankaccountcreated.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/linkgooglepayerror.d.ts +14 -5
- package/models/errors/linkgooglepayerror.d.ts.map +1 -1
- package/models/errors/linkgooglepayerror.js +10 -4
- package/models/errors/linkgooglepayerror.js.map +1 -1
- package/models/errors/transfer.d.ts +3 -6
- 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/transferconfigvalidationerror.d.ts +43 -0
- package/models/errors/transferconfigvalidationerror.d.ts.map +1 -0
- package/models/errors/transferconfigvalidationerror.js +99 -0
- package/models/errors/transferconfigvalidationerror.js.map +1 -0
- package/models/errors/transfervalidationerror.d.ts +3 -0
- package/models/errors/transfervalidationerror.d.ts.map +1 -1
- package/models/errors/transfervalidationerror.js +6 -0
- package/models/errors/transfervalidationerror.js.map +1 -1
- package/models/operations/createtransferconfig.d.ts +42 -0
- package/models/operations/createtransferconfig.d.ts.map +1 -0
- package/models/operations/createtransferconfig.js +98 -0
- package/models/operations/createtransferconfig.js.map +1 -0
- package/models/operations/gettransferconfig.d.ts +37 -0
- package/models/operations/gettransferconfig.d.ts.map +1 -0
- package/models/operations/gettransferconfig.js +88 -0
- package/models/operations/gettransferconfig.js.map +1 -0
- package/models/operations/index.d.ts +3 -0
- package/models/operations/index.d.ts.map +1 -1
- package/models/operations/index.js +3 -0
- package/models/operations/index.js.map +1 -1
- package/models/operations/updatetransferconfig.d.ts +39 -0
- package/models/operations/updatetransferconfig.d.ts.map +1 -0
- package/models/operations/updatetransferconfig.js +98 -0
- package/models/operations/updatetransferconfig.js.map +1 -0
- package/package.json +1 -1
- package/sdk/googlepay.d.ts +3 -1
- package/sdk/googlepay.d.ts.map +1 -1
- package/sdk/googlepay.js +3 -1
- package/sdk/googlepay.js.map +1 -1
- 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/sdk/transferconfig.d.ts +17 -0
- package/sdk/transferconfig.d.ts.map +1 -0
- package/sdk/transferconfig.js +33 -0
- package/sdk/transferconfig.js.map +1 -0
- package/src/funcs/filesUpload.ts +13 -2
- package/src/funcs/googlePayLinkToken.ts +3 -1
- package/src/funcs/transferConfigCreate.ts +187 -0
- package/src/funcs/transferConfigGet.ts +172 -0
- package/src/funcs/transferConfigUpdate.ts +185 -0
- package/src/lib/config.ts +3 -3
- package/src/mcp-server/mcp-server.ts +1 -1
- package/src/mcp-server/server.ts +7 -1
- package/src/mcp-server/tools/googlePayLinkToken.ts +3 -1
- package/src/mcp-server/tools/transferConfigCreate.ts +35 -0
- package/src/mcp-server/tools/transferConfigGet.ts +35 -0
- package/src/mcp-server/tools/transferConfigUpdate.ts +35 -0
- package/src/models/components/createdtransfer.ts +11 -1
- package/src/models/components/createpaymentlink.ts +13 -0
- package/src/models/components/createtippresets.ts +83 -0
- package/src/models/components/createtransfer.ts +10 -3
- package/src/models/components/createtransferamountdetails.ts +62 -0
- package/src/models/components/createtransferamountdetailsvalidationerror.ts +59 -0
- package/src/models/components/createtransferconfig.ts +57 -0
- package/src/models/components/fileuploadmetadata.ts +73 -0
- package/src/models/components/fileuploadrequestmultipart.ts +12 -10
- package/src/models/components/googlepayassurancedetails.ts +64 -0
- package/src/models/components/googlepaybillingaddress.ts +125 -0
- package/src/models/components/googlepaycardinfo.ts +153 -0
- package/src/models/components/googlepaypaymentmethoddata.ts +120 -0
- package/src/models/components/googlepaytokenizationdata.ts +91 -0
- package/src/models/components/index.ts +16 -2
- package/src/models/components/linkedgooglepaypaymentmethod.ts +11 -22
- package/src/models/components/linkgooglepay.ts +25 -15
- package/src/models/components/paymentlink.ts +10 -0
- package/src/models/components/paymentlinkcustomeroptions.ts +7 -0
- package/src/models/components/puttippresets.ts +79 -0
- package/src/models/components/puttransferconfig.ts +57 -0
- package/src/models/components/tipcalculationbasis.ts +35 -0
- package/src/models/components/tippresets.ts +82 -0
- package/src/models/components/transfer.ts +10 -3
- package/src/models/components/transferamountdetails.ts +60 -0
- package/src/models/components/transferconfig.ts +59 -0
- package/src/models/components/transferdestination.ts +13 -0
- package/src/models/components/transfersource.ts +13 -0
- package/src/models/components/webhookdata.ts +4 -4
- package/src/models/components/webhookdatabankaccountcreated.ts +9 -0
- package/src/models/errors/index.ts +1 -0
- package/src/models/errors/linkgooglepayerror.ts +24 -8
- package/src/models/errors/transfer.ts +6 -6
- package/src/models/errors/transferconfigvalidationerror.ts +110 -0
- package/src/models/errors/transfervalidationerror.ts +14 -0
- package/src/models/operations/createtransferconfig.ts +129 -0
- package/src/models/operations/gettransferconfig.ts +110 -0
- package/src/models/operations/index.ts +3 -0
- package/src/models/operations/updatetransferconfig.ts +126 -0
- package/src/sdk/googlepay.ts +3 -1
- package/src/sdk/sdk.ts +6 -0
- package/src/sdk/transferconfig.ts +54 -0
- package/models/components/googlepayintermediatesigningkey.d.ts +0 -28
- package/models/components/googlepayintermediatesigningkey.d.ts.map +0 -1
- package/models/components/googlepayintermediatesigningkey.js.map +0 -1
- package/models/components/googlepaytoken.d.ts +0 -44
- package/models/components/googlepaytoken.d.ts.map +0 -1
- package/models/components/googlepaytoken.js.map +0 -1
- package/src/models/components/googlepayintermediatesigningkey.ts +0 -66
- package/src/models/components/googlepaytoken.ts +0 -85
|
@@ -0,0 +1,172 @@
|
|
|
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 { matchStatusCode } from "../lib/http.js";
|
|
8
|
+
import * as M from "../lib/matchers.js";
|
|
9
|
+
import { compactMap } from "../lib/primitives.js";
|
|
10
|
+
import { safeParse } from "../lib/schemas.js";
|
|
11
|
+
import { RequestOptions } from "../lib/sdks.js";
|
|
12
|
+
import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
|
|
13
|
+
import { pathToFunc } from "../lib/url.js";
|
|
14
|
+
import {
|
|
15
|
+
ConnectionError,
|
|
16
|
+
InvalidRequestError,
|
|
17
|
+
RequestAbortedError,
|
|
18
|
+
RequestTimeoutError,
|
|
19
|
+
UnexpectedClientError,
|
|
20
|
+
} from "../models/errors/httpclienterrors.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
|
+
* Get the transfer config for an account.
|
|
30
|
+
*/
|
|
31
|
+
export function transferConfigGet(
|
|
32
|
+
client: MoovCore,
|
|
33
|
+
request: operations.GetTransferConfigRequest,
|
|
34
|
+
options?: RequestOptions,
|
|
35
|
+
): APIPromise<
|
|
36
|
+
Result<
|
|
37
|
+
operations.GetTransferConfigResponse,
|
|
38
|
+
| MoovError
|
|
39
|
+
| ResponseValidationError
|
|
40
|
+
| ConnectionError
|
|
41
|
+
| RequestAbortedError
|
|
42
|
+
| RequestTimeoutError
|
|
43
|
+
| InvalidRequestError
|
|
44
|
+
| UnexpectedClientError
|
|
45
|
+
| SDKValidationError
|
|
46
|
+
>
|
|
47
|
+
> {
|
|
48
|
+
return new APIPromise($do(
|
|
49
|
+
client,
|
|
50
|
+
request,
|
|
51
|
+
options,
|
|
52
|
+
));
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
async function $do(
|
|
56
|
+
client: MoovCore,
|
|
57
|
+
request: operations.GetTransferConfigRequest,
|
|
58
|
+
options?: RequestOptions,
|
|
59
|
+
): Promise<
|
|
60
|
+
[
|
|
61
|
+
Result<
|
|
62
|
+
operations.GetTransferConfigResponse,
|
|
63
|
+
| MoovError
|
|
64
|
+
| ResponseValidationError
|
|
65
|
+
| ConnectionError
|
|
66
|
+
| RequestAbortedError
|
|
67
|
+
| RequestTimeoutError
|
|
68
|
+
| InvalidRequestError
|
|
69
|
+
| UnexpectedClientError
|
|
70
|
+
| SDKValidationError
|
|
71
|
+
>,
|
|
72
|
+
APICall,
|
|
73
|
+
]
|
|
74
|
+
> {
|
|
75
|
+
const parsed = safeParse(
|
|
76
|
+
request,
|
|
77
|
+
(value) => operations.GetTransferConfigRequest$outboundSchema.parse(value),
|
|
78
|
+
"Input validation failed",
|
|
79
|
+
);
|
|
80
|
+
if (!parsed.ok) {
|
|
81
|
+
return [parsed, { status: "invalid" }];
|
|
82
|
+
}
|
|
83
|
+
const payload = parsed.value;
|
|
84
|
+
const body = null;
|
|
85
|
+
|
|
86
|
+
const pathParams = {
|
|
87
|
+
accountID: encodeSimple("accountID", payload.accountID, {
|
|
88
|
+
explode: false,
|
|
89
|
+
charEncoding: "percent",
|
|
90
|
+
}),
|
|
91
|
+
};
|
|
92
|
+
const path = pathToFunc("/accounts/{accountID}/transfer-config")(pathParams);
|
|
93
|
+
|
|
94
|
+
const headers = new Headers(compactMap({
|
|
95
|
+
Accept: "application/json",
|
|
96
|
+
}));
|
|
97
|
+
|
|
98
|
+
const securityInput = await extractSecurity(client._options.security);
|
|
99
|
+
const requestSecurity = resolveGlobalSecurity(securityInput);
|
|
100
|
+
|
|
101
|
+
const context = {
|
|
102
|
+
options: client._options,
|
|
103
|
+
baseURL: options?.serverURL ?? client._baseURL ?? "",
|
|
104
|
+
operationID: "getTransferConfig",
|
|
105
|
+
oAuth2Scopes: null,
|
|
106
|
+
|
|
107
|
+
resolvedSecurity: requestSecurity,
|
|
108
|
+
|
|
109
|
+
securitySource: client._options.security,
|
|
110
|
+
retryConfig: options?.retries
|
|
111
|
+
|| client._options.retryConfig
|
|
112
|
+
|| { strategy: "none" },
|
|
113
|
+
retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
|
|
114
|
+
};
|
|
115
|
+
|
|
116
|
+
const requestRes = client._createRequest(context, {
|
|
117
|
+
security: requestSecurity,
|
|
118
|
+
method: "GET",
|
|
119
|
+
baseURL: options?.serverURL,
|
|
120
|
+
path: path,
|
|
121
|
+
headers: headers,
|
|
122
|
+
body: body,
|
|
123
|
+
userAgent: client._options.userAgent,
|
|
124
|
+
timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
|
|
125
|
+
}, options);
|
|
126
|
+
if (!requestRes.ok) {
|
|
127
|
+
return [requestRes, { status: "invalid" }];
|
|
128
|
+
}
|
|
129
|
+
const req = requestRes.value;
|
|
130
|
+
|
|
131
|
+
const doResult = await client._do(req, {
|
|
132
|
+
context,
|
|
133
|
+
isErrorStatusCode: (statusCode: number) =>
|
|
134
|
+
matchStatusCode({ status: statusCode } as Response, ["4XX", "5XX"]),
|
|
135
|
+
retryConfig: context.retryConfig,
|
|
136
|
+
retryCodes: context.retryCodes,
|
|
137
|
+
});
|
|
138
|
+
if (!doResult.ok) {
|
|
139
|
+
return [doResult, { status: "request-error", request: req }];
|
|
140
|
+
}
|
|
141
|
+
const response = doResult.value;
|
|
142
|
+
|
|
143
|
+
const responseFields = {
|
|
144
|
+
HttpMeta: { Response: response, Request: req },
|
|
145
|
+
};
|
|
146
|
+
|
|
147
|
+
const [result] = await M.match<
|
|
148
|
+
operations.GetTransferConfigResponse,
|
|
149
|
+
| MoovError
|
|
150
|
+
| ResponseValidationError
|
|
151
|
+
| ConnectionError
|
|
152
|
+
| RequestAbortedError
|
|
153
|
+
| RequestTimeoutError
|
|
154
|
+
| InvalidRequestError
|
|
155
|
+
| UnexpectedClientError
|
|
156
|
+
| SDKValidationError
|
|
157
|
+
>(
|
|
158
|
+
M.json(200, operations.GetTransferConfigResponse$inboundSchema, {
|
|
159
|
+
hdrs: true,
|
|
160
|
+
key: "Result",
|
|
161
|
+
}),
|
|
162
|
+
M.fail([401, 403, 404, 429]),
|
|
163
|
+
M.fail([500, 504]),
|
|
164
|
+
M.fail("4XX"),
|
|
165
|
+
M.fail("5XX"),
|
|
166
|
+
)(response, req, { extraFields: responseFields });
|
|
167
|
+
if (!result.ok) {
|
|
168
|
+
return [result, { status: "complete", request: req, response }];
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
return [result, { status: "complete", request: req, response }];
|
|
172
|
+
}
|
|
@@ -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 { encodeJSON, encodeSimple } from "../lib/encodings.js";
|
|
7
|
+
import { matchStatusCode } from "../lib/http.js";
|
|
8
|
+
import * as M from "../lib/matchers.js";
|
|
9
|
+
import { compactMap } from "../lib/primitives.js";
|
|
10
|
+
import { safeParse } from "../lib/schemas.js";
|
|
11
|
+
import { RequestOptions } from "../lib/sdks.js";
|
|
12
|
+
import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
|
|
13
|
+
import { pathToFunc } from "../lib/url.js";
|
|
14
|
+
import {
|
|
15
|
+
ConnectionError,
|
|
16
|
+
InvalidRequestError,
|
|
17
|
+
RequestAbortedError,
|
|
18
|
+
RequestTimeoutError,
|
|
19
|
+
UnexpectedClientError,
|
|
20
|
+
} from "../models/errors/httpclienterrors.js";
|
|
21
|
+
import * as errors from "../models/errors/index.js";
|
|
22
|
+
import { MoovError } from "../models/errors/mooverror.js";
|
|
23
|
+
import { ResponseValidationError } from "../models/errors/responsevalidationerror.js";
|
|
24
|
+
import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
|
|
25
|
+
import * as operations from "../models/operations/index.js";
|
|
26
|
+
import { APICall, APIPromise } from "../types/async.js";
|
|
27
|
+
import { Result } from "../types/fp.js";
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Update the transfer config for an account.
|
|
31
|
+
*/
|
|
32
|
+
export function transferConfigUpdate(
|
|
33
|
+
client: MoovCore,
|
|
34
|
+
request: operations.UpdateTransferConfigRequest,
|
|
35
|
+
options?: RequestOptions,
|
|
36
|
+
): APIPromise<
|
|
37
|
+
Result<
|
|
38
|
+
operations.UpdateTransferConfigResponse,
|
|
39
|
+
| errors.GenericError
|
|
40
|
+
| errors.TransferConfigValidationError
|
|
41
|
+
| MoovError
|
|
42
|
+
| ResponseValidationError
|
|
43
|
+
| ConnectionError
|
|
44
|
+
| RequestAbortedError
|
|
45
|
+
| RequestTimeoutError
|
|
46
|
+
| InvalidRequestError
|
|
47
|
+
| UnexpectedClientError
|
|
48
|
+
| SDKValidationError
|
|
49
|
+
>
|
|
50
|
+
> {
|
|
51
|
+
return new APIPromise($do(
|
|
52
|
+
client,
|
|
53
|
+
request,
|
|
54
|
+
options,
|
|
55
|
+
));
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
async function $do(
|
|
59
|
+
client: MoovCore,
|
|
60
|
+
request: operations.UpdateTransferConfigRequest,
|
|
61
|
+
options?: RequestOptions,
|
|
62
|
+
): Promise<
|
|
63
|
+
[
|
|
64
|
+
Result<
|
|
65
|
+
operations.UpdateTransferConfigResponse,
|
|
66
|
+
| errors.GenericError
|
|
67
|
+
| errors.TransferConfigValidationError
|
|
68
|
+
| MoovError
|
|
69
|
+
| ResponseValidationError
|
|
70
|
+
| ConnectionError
|
|
71
|
+
| RequestAbortedError
|
|
72
|
+
| RequestTimeoutError
|
|
73
|
+
| InvalidRequestError
|
|
74
|
+
| UnexpectedClientError
|
|
75
|
+
| SDKValidationError
|
|
76
|
+
>,
|
|
77
|
+
APICall,
|
|
78
|
+
]
|
|
79
|
+
> {
|
|
80
|
+
const parsed = safeParse(
|
|
81
|
+
request,
|
|
82
|
+
(value) =>
|
|
83
|
+
operations.UpdateTransferConfigRequest$outboundSchema.parse(value),
|
|
84
|
+
"Input validation failed",
|
|
85
|
+
);
|
|
86
|
+
if (!parsed.ok) {
|
|
87
|
+
return [parsed, { status: "invalid" }];
|
|
88
|
+
}
|
|
89
|
+
const payload = parsed.value;
|
|
90
|
+
const body = encodeJSON("body", payload.PutTransferConfig, { explode: true });
|
|
91
|
+
|
|
92
|
+
const pathParams = {
|
|
93
|
+
accountID: encodeSimple("accountID", payload.accountID, {
|
|
94
|
+
explode: false,
|
|
95
|
+
charEncoding: "percent",
|
|
96
|
+
}),
|
|
97
|
+
};
|
|
98
|
+
const path = pathToFunc("/accounts/{accountID}/transfer-config")(pathParams);
|
|
99
|
+
|
|
100
|
+
const headers = new Headers(compactMap({
|
|
101
|
+
"Content-Type": "application/json",
|
|
102
|
+
Accept: "application/json",
|
|
103
|
+
}));
|
|
104
|
+
|
|
105
|
+
const securityInput = await extractSecurity(client._options.security);
|
|
106
|
+
const requestSecurity = resolveGlobalSecurity(securityInput);
|
|
107
|
+
|
|
108
|
+
const context = {
|
|
109
|
+
options: client._options,
|
|
110
|
+
baseURL: options?.serverURL ?? client._baseURL ?? "",
|
|
111
|
+
operationID: "updateTransferConfig",
|
|
112
|
+
oAuth2Scopes: null,
|
|
113
|
+
|
|
114
|
+
resolvedSecurity: requestSecurity,
|
|
115
|
+
|
|
116
|
+
securitySource: client._options.security,
|
|
117
|
+
retryConfig: options?.retries
|
|
118
|
+
|| client._options.retryConfig
|
|
119
|
+
|| { strategy: "none" },
|
|
120
|
+
retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
|
|
121
|
+
};
|
|
122
|
+
|
|
123
|
+
const requestRes = client._createRequest(context, {
|
|
124
|
+
security: requestSecurity,
|
|
125
|
+
method: "PUT",
|
|
126
|
+
baseURL: options?.serverURL,
|
|
127
|
+
path: path,
|
|
128
|
+
headers: headers,
|
|
129
|
+
body: body,
|
|
130
|
+
userAgent: client._options.userAgent,
|
|
131
|
+
timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
|
|
132
|
+
}, options);
|
|
133
|
+
if (!requestRes.ok) {
|
|
134
|
+
return [requestRes, { status: "invalid" }];
|
|
135
|
+
}
|
|
136
|
+
const req = requestRes.value;
|
|
137
|
+
|
|
138
|
+
const doResult = await client._do(req, {
|
|
139
|
+
context,
|
|
140
|
+
isErrorStatusCode: (statusCode: number) =>
|
|
141
|
+
matchStatusCode({ status: statusCode } as Response, ["4XX", "5XX"]),
|
|
142
|
+
retryConfig: context.retryConfig,
|
|
143
|
+
retryCodes: context.retryCodes,
|
|
144
|
+
});
|
|
145
|
+
if (!doResult.ok) {
|
|
146
|
+
return [doResult, { status: "request-error", request: req }];
|
|
147
|
+
}
|
|
148
|
+
const response = doResult.value;
|
|
149
|
+
|
|
150
|
+
const responseFields = {
|
|
151
|
+
HttpMeta: { Response: response, Request: req },
|
|
152
|
+
};
|
|
153
|
+
|
|
154
|
+
const [result] = await M.match<
|
|
155
|
+
operations.UpdateTransferConfigResponse,
|
|
156
|
+
| errors.GenericError
|
|
157
|
+
| errors.TransferConfigValidationError
|
|
158
|
+
| MoovError
|
|
159
|
+
| ResponseValidationError
|
|
160
|
+
| ConnectionError
|
|
161
|
+
| RequestAbortedError
|
|
162
|
+
| RequestTimeoutError
|
|
163
|
+
| InvalidRequestError
|
|
164
|
+
| UnexpectedClientError
|
|
165
|
+
| SDKValidationError
|
|
166
|
+
>(
|
|
167
|
+
M.json(200, operations.UpdateTransferConfigResponse$inboundSchema, {
|
|
168
|
+
hdrs: true,
|
|
169
|
+
key: "Result",
|
|
170
|
+
}),
|
|
171
|
+
M.jsonErr(400, errors.GenericError$inboundSchema, { hdrs: true }),
|
|
172
|
+
M.jsonErr(422, errors.TransferConfigValidationError$inboundSchema, {
|
|
173
|
+
hdrs: true,
|
|
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
|
+
}
|
package/src/lib/config.ts
CHANGED
|
@@ -68,7 +68,7 @@ export function serverURLFromOptions(options: SDKOptions): URL | null {
|
|
|
68
68
|
export const SDK_METADATA = {
|
|
69
69
|
language: "typescript",
|
|
70
70
|
openapiDocVersion: "v2026.04.00",
|
|
71
|
-
sdkVersion: "26.4.
|
|
72
|
-
genVersion: "2.881.
|
|
73
|
-
userAgent: "speakeasy-sdk/typescript 26.4.
|
|
71
|
+
sdkVersion: "26.4.2",
|
|
72
|
+
genVersion: "2.881.17",
|
|
73
|
+
userAgent: "speakeasy-sdk/typescript 26.4.2 2.881.17 v2026.04.00 @moovio/sdk",
|
|
74
74
|
} as const;
|
package/src/mcp-server/server.ts
CHANGED
|
@@ -168,6 +168,9 @@ import { tool$terminalApplicationsCreateVersion } from "./tools/terminalApplicat
|
|
|
168
168
|
import { tool$terminalApplicationsDelete } from "./tools/terminalApplicationsDelete.js";
|
|
169
169
|
import { tool$terminalApplicationsGet } from "./tools/terminalApplicationsGet.js";
|
|
170
170
|
import { tool$terminalApplicationsList } from "./tools/terminalApplicationsList.js";
|
|
171
|
+
import { tool$transferConfigCreate } from "./tools/transferConfigCreate.js";
|
|
172
|
+
import { tool$transferConfigGet } from "./tools/transferConfigGet.js";
|
|
173
|
+
import { tool$transferConfigUpdate } from "./tools/transferConfigUpdate.js";
|
|
171
174
|
import { tool$transfersBatchGetTransfers } from "./tools/transfersBatchGetTransfers.js";
|
|
172
175
|
import { tool$transfersCreate } from "./tools/transfersCreate.js";
|
|
173
176
|
import { tool$transfersCreateCancellation } from "./tools/transfersCreateCancellation.js";
|
|
@@ -208,7 +211,7 @@ export function createMCPServer(deps: {
|
|
|
208
211
|
}) {
|
|
209
212
|
const server = new McpServer({
|
|
210
213
|
name: "Moov",
|
|
211
|
-
version: "26.4.
|
|
214
|
+
version: "26.4.2",
|
|
212
215
|
});
|
|
213
216
|
|
|
214
217
|
const client = new MoovCore({
|
|
@@ -361,6 +364,9 @@ export function createMCPServer(deps: {
|
|
|
361
364
|
tool(tool$supportGetTicket);
|
|
362
365
|
tool(tool$supportUpdateTicket);
|
|
363
366
|
tool(tool$supportListTicketMessages);
|
|
367
|
+
tool(tool$transferConfigCreate);
|
|
368
|
+
tool(tool$transferConfigGet);
|
|
369
|
+
tool(tool$transferConfigUpdate);
|
|
364
370
|
tool(tool$transfersGenerateOptions);
|
|
365
371
|
tool(tool$transfersCreate);
|
|
366
372
|
tool(tool$transfersList);
|
|
@@ -14,7 +14,9 @@ export const tool$googlePayLinkToken: ToolDefinition<typeof args> = {
|
|
|
14
14
|
name: "google-pay-link-token",
|
|
15
15
|
description: `Connect a Google Pay token to the specified account.
|
|
16
16
|
|
|
17
|
-
The \`
|
|
17
|
+
The \`paymentMethodData\` field should contain the \`paymentMethodData\` property from Google Pay's
|
|
18
|
+
[PaymentData](https://developers.google.com/pay/api/web/reference/response-objects#PaymentData) response,
|
|
19
|
+
passed through unmodified.
|
|
18
20
|
|
|
19
21
|
To access this endpoint using an [access token](https://docs.moov.io/api/authentication/access-tokens/)
|
|
20
22
|
you'll need to specify the \`/accounts/{accountID}/cards.write\` scope.`,
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import { transferConfigCreate } from "../../funcs/transferConfigCreate.js";
|
|
6
|
+
import * as operations from "../../models/operations/index.js";
|
|
7
|
+
import { formatResult, ToolDefinition } from "../tools.js";
|
|
8
|
+
|
|
9
|
+
const args = {
|
|
10
|
+
request: operations.CreateTransferConfigRequest$inboundSchema,
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
export const tool$transferConfigCreate: ToolDefinition<typeof args> = {
|
|
14
|
+
name: "transfer-config-create",
|
|
15
|
+
description: `Create a transfer config for an account.`,
|
|
16
|
+
args,
|
|
17
|
+
tool: async (client, args, ctx) => {
|
|
18
|
+
const [result, apiCall] = await transferConfigCreate(
|
|
19
|
+
client,
|
|
20
|
+
args.request,
|
|
21
|
+
{ fetchOptions: { signal: ctx.signal } },
|
|
22
|
+
).$inspect();
|
|
23
|
+
|
|
24
|
+
if (!result.ok) {
|
|
25
|
+
return {
|
|
26
|
+
content: [{ type: "text", text: result.error.message }],
|
|
27
|
+
isError: true,
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
const value = result.value.result;
|
|
32
|
+
|
|
33
|
+
return formatResult(value, apiCall);
|
|
34
|
+
},
|
|
35
|
+
};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import { transferConfigGet } from "../../funcs/transferConfigGet.js";
|
|
6
|
+
import * as operations from "../../models/operations/index.js";
|
|
7
|
+
import { formatResult, ToolDefinition } from "../tools.js";
|
|
8
|
+
|
|
9
|
+
const args = {
|
|
10
|
+
request: operations.GetTransferConfigRequest$inboundSchema,
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
export const tool$transferConfigGet: ToolDefinition<typeof args> = {
|
|
14
|
+
name: "transfer-config-get",
|
|
15
|
+
description: `Get the transfer config for an account.`,
|
|
16
|
+
args,
|
|
17
|
+
tool: async (client, args, ctx) => {
|
|
18
|
+
const [result, apiCall] = await transferConfigGet(
|
|
19
|
+
client,
|
|
20
|
+
args.request,
|
|
21
|
+
{ fetchOptions: { signal: ctx.signal } },
|
|
22
|
+
).$inspect();
|
|
23
|
+
|
|
24
|
+
if (!result.ok) {
|
|
25
|
+
return {
|
|
26
|
+
content: [{ type: "text", text: result.error.message }],
|
|
27
|
+
isError: true,
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
const value = result.value.result;
|
|
32
|
+
|
|
33
|
+
return formatResult(value, apiCall);
|
|
34
|
+
},
|
|
35
|
+
};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import { transferConfigUpdate } from "../../funcs/transferConfigUpdate.js";
|
|
6
|
+
import * as operations from "../../models/operations/index.js";
|
|
7
|
+
import { formatResult, ToolDefinition } from "../tools.js";
|
|
8
|
+
|
|
9
|
+
const args = {
|
|
10
|
+
request: operations.UpdateTransferConfigRequest$inboundSchema,
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
export const tool$transferConfigUpdate: ToolDefinition<typeof args> = {
|
|
14
|
+
name: "transfer-config-update",
|
|
15
|
+
description: `Update the transfer config for an account.`,
|
|
16
|
+
args,
|
|
17
|
+
tool: async (client, args, ctx) => {
|
|
18
|
+
const [result, apiCall] = await transferConfigUpdate(
|
|
19
|
+
client,
|
|
20
|
+
args.request,
|
|
21
|
+
{ fetchOptions: { signal: ctx.signal } },
|
|
22
|
+
).$inspect();
|
|
23
|
+
|
|
24
|
+
if (!result.ok) {
|
|
25
|
+
return {
|
|
26
|
+
content: [{ type: "text", text: result.error.message }],
|
|
27
|
+
isError: true,
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
const value = result.value.result;
|
|
32
|
+
|
|
33
|
+
return formatResult(value, apiCall);
|
|
34
|
+
},
|
|
35
|
+
};
|
|
@@ -42,6 +42,12 @@ import {
|
|
|
42
42
|
MoovFeeDetails$Outbound,
|
|
43
43
|
MoovFeeDetails$outboundSchema,
|
|
44
44
|
} from "./moovfeedetails.js";
|
|
45
|
+
import {
|
|
46
|
+
TransferAmountDetails,
|
|
47
|
+
TransferAmountDetails$inboundSchema,
|
|
48
|
+
TransferAmountDetails$Outbound,
|
|
49
|
+
TransferAmountDetails$outboundSchema,
|
|
50
|
+
} from "./transferamountdetails.js";
|
|
45
51
|
import {
|
|
46
52
|
TransferDestination,
|
|
47
53
|
TransferDestination$inboundSchema,
|
|
@@ -121,7 +127,7 @@ export type CreatedTransfer = {
|
|
|
121
127
|
occurrenceID?: string | undefined;
|
|
122
128
|
paymentLinkCode?: string | undefined;
|
|
123
129
|
/**
|
|
124
|
-
* Optional sales tax amount.
|
|
130
|
+
* Optional sales tax amount.
|
|
125
131
|
*/
|
|
126
132
|
salesTaxAmount?: Amount | undefined;
|
|
127
133
|
/**
|
|
@@ -135,6 +141,7 @@ export type CreatedTransfer = {
|
|
|
135
141
|
* When line items are provided, their total plus sales tax must equal the transfer amount.
|
|
136
142
|
*/
|
|
137
143
|
lineItems?: TransferLineItems | undefined;
|
|
144
|
+
amountDetails?: TransferAmountDetails | undefined;
|
|
138
145
|
};
|
|
139
146
|
|
|
140
147
|
/** @internal */
|
|
@@ -171,6 +178,7 @@ export const CreatedTransfer$inboundSchema: z.ZodType<
|
|
|
171
178
|
salesTaxAmount: Amount$inboundSchema.optional(),
|
|
172
179
|
foreignID: z.string().optional(),
|
|
173
180
|
lineItems: TransferLineItems$inboundSchema.optional(),
|
|
181
|
+
amountDetails: TransferAmountDetails$inboundSchema.optional(),
|
|
174
182
|
});
|
|
175
183
|
/** @internal */
|
|
176
184
|
export type CreatedTransfer$Outbound = {
|
|
@@ -201,6 +209,7 @@ export type CreatedTransfer$Outbound = {
|
|
|
201
209
|
salesTaxAmount?: Amount$Outbound | undefined;
|
|
202
210
|
foreignID?: string | undefined;
|
|
203
211
|
lineItems?: TransferLineItems$Outbound | undefined;
|
|
212
|
+
amountDetails?: TransferAmountDetails$Outbound | undefined;
|
|
204
213
|
};
|
|
205
214
|
|
|
206
215
|
/** @internal */
|
|
@@ -236,6 +245,7 @@ export const CreatedTransfer$outboundSchema: z.ZodType<
|
|
|
236
245
|
salesTaxAmount: Amount$outboundSchema.optional(),
|
|
237
246
|
foreignID: z.string().optional(),
|
|
238
247
|
lineItems: TransferLineItems$outboundSchema.optional(),
|
|
248
|
+
amountDetails: TransferAmountDetails$outboundSchema.optional(),
|
|
239
249
|
});
|
|
240
250
|
|
|
241
251
|
export function createdTransferToJSON(
|
|
@@ -61,7 +61,20 @@ export type CreatePaymentLink = {
|
|
|
61
61
|
* The merchant's preferred payment method ID. Must be a wallet payment method.
|
|
62
62
|
*/
|
|
63
63
|
merchantPaymentMethodID: string;
|
|
64
|
+
/**
|
|
65
|
+
* The fixed amount of the payment link.
|
|
66
|
+
*
|
|
67
|
+
* @remarks
|
|
68
|
+
*
|
|
69
|
+
* In API versions before `2026.07.00`, this was a required field.
|
|
70
|
+
*
|
|
71
|
+
* In API version `2026.07.00` and beyond, this field is required for `fixed` payment amount types and omitted
|
|
72
|
+
* for `open` payment amount types.
|
|
73
|
+
*/
|
|
64
74
|
amount: Amount;
|
|
75
|
+
/**
|
|
76
|
+
* Optional sales tax amount.
|
|
77
|
+
*/
|
|
65
78
|
salesTaxAmount?: Amount | undefined;
|
|
66
79
|
/**
|
|
67
80
|
* An optional limit on the number of times this payment link can be used.
|
|
@@ -0,0 +1,83 @@
|
|
|
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
|
+
TipCalculationBasis,
|
|
17
|
+
TipCalculationBasis$inboundSchema,
|
|
18
|
+
TipCalculationBasis$outboundSchema,
|
|
19
|
+
} from "./tipcalculationbasis.js";
|
|
20
|
+
|
|
21
|
+
export type CreateTipPresets = {
|
|
22
|
+
/**
|
|
23
|
+
* Defines which amount should be used when calculating the final payment total. This calculation applies for percentage tip values.
|
|
24
|
+
*
|
|
25
|
+
* @remarks
|
|
26
|
+
* - `pre-tax`: Tip amounts are calculated using the subtotal amount before taxes
|
|
27
|
+
* - `post-tax`: Tip amounts are calculated using the subtotal amount + taxes
|
|
28
|
+
*/
|
|
29
|
+
calculationBasis?: TipCalculationBasis | undefined;
|
|
30
|
+
/**
|
|
31
|
+
* Defines the set of suggested tip preset values presented to customers. Percentages must be between 0 and 100 (exclusive) and must be unique. A maximum of 3 values are allowed.
|
|
32
|
+
*/
|
|
33
|
+
percentageOptions?: Array<number> | undefined;
|
|
34
|
+
/**
|
|
35
|
+
* Defines the set of suggested tip preset values presented to customers. Fixed amounts must be positive and unique. A maximum of 3 values are allowed.
|
|
36
|
+
*/
|
|
37
|
+
fixedAmountOptions?: Array<AmountDecimal> | undefined;
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
/** @internal */
|
|
41
|
+
export const CreateTipPresets$inboundSchema: z.ZodType<
|
|
42
|
+
CreateTipPresets,
|
|
43
|
+
z.ZodTypeDef,
|
|
44
|
+
unknown
|
|
45
|
+
> = z.object({
|
|
46
|
+
calculationBasis: TipCalculationBasis$inboundSchema.optional(),
|
|
47
|
+
percentageOptions: z.array(z.number().int()).optional(),
|
|
48
|
+
fixedAmountOptions: z.array(AmountDecimal$inboundSchema).optional(),
|
|
49
|
+
});
|
|
50
|
+
/** @internal */
|
|
51
|
+
export type CreateTipPresets$Outbound = {
|
|
52
|
+
calculationBasis?: string | undefined;
|
|
53
|
+
percentageOptions?: Array<number> | undefined;
|
|
54
|
+
fixedAmountOptions?: Array<AmountDecimal$Outbound> | undefined;
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
/** @internal */
|
|
58
|
+
export const CreateTipPresets$outboundSchema: z.ZodType<
|
|
59
|
+
CreateTipPresets$Outbound,
|
|
60
|
+
z.ZodTypeDef,
|
|
61
|
+
CreateTipPresets
|
|
62
|
+
> = z.object({
|
|
63
|
+
calculationBasis: TipCalculationBasis$outboundSchema.optional(),
|
|
64
|
+
percentageOptions: z.array(z.number().int()).optional(),
|
|
65
|
+
fixedAmountOptions: z.array(AmountDecimal$outboundSchema).optional(),
|
|
66
|
+
});
|
|
67
|
+
|
|
68
|
+
export function createTipPresetsToJSON(
|
|
69
|
+
createTipPresets: CreateTipPresets,
|
|
70
|
+
): string {
|
|
71
|
+
return JSON.stringify(
|
|
72
|
+
CreateTipPresets$outboundSchema.parse(createTipPresets),
|
|
73
|
+
);
|
|
74
|
+
}
|
|
75
|
+
export function createTipPresetsFromJSON(
|
|
76
|
+
jsonString: string,
|
|
77
|
+
): SafeParseResult<CreateTipPresets, SDKValidationError> {
|
|
78
|
+
return safeParse(
|
|
79
|
+
jsonString,
|
|
80
|
+
(x) => CreateTipPresets$inboundSchema.parse(JSON.parse(x)),
|
|
81
|
+
`Failed to parse 'CreateTipPresets' from JSON`,
|
|
82
|
+
);
|
|
83
|
+
}
|