@moovio/sdk 0.12.4 → 0.12.6
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 +54 -36
- package/bin/mcp-server.js +403 -163
- package/bin/mcp-server.js.map +26 -23
- package/docs/sdks/transfers/README.md +117 -2
- package/funcs/disputesUploadEvidenceFile.d.ts.map +1 -1
- package/funcs/disputesUploadEvidenceFile.js +5 -3
- package/funcs/disputesUploadEvidenceFile.js.map +1 -1
- package/funcs/filesUpload.d.ts.map +1 -1
- package/funcs/filesUpload.js +5 -3
- package/funcs/filesUpload.js.map +1 -1
- package/funcs/transfersGenerateOptions.d.ts +1 -1
- package/funcs/transfersGenerateOptions.js +1 -1
- package/funcs/transfersGenerateOptionsForAccount.d.ts +23 -0
- package/funcs/transfersGenerateOptionsForAccount.d.ts.map +1 -0
- package/funcs/transfersGenerateOptionsForAccount.js +133 -0
- package/funcs/transfersGenerateOptionsForAccount.js.map +1 -0
- package/jsr.json +1 -1
- package/lib/config.d.ts +3 -3
- package/lib/config.js +3 -3
- package/lib/files.d.ts +5 -0
- package/lib/files.d.ts.map +1 -1
- package/lib/files.js +41 -0
- package/lib/files.js.map +1 -1
- package/lib/security.d.ts +2 -2
- package/lib/security.d.ts.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 +3 -1
- package/mcp-server/server.js.map +1 -1
- package/mcp-server/tools/transfersGenerateOptions.js +1 -1
- package/mcp-server/tools/transfersGenerateOptions.js.map +1 -1
- package/mcp-server/tools/transfersGenerateOptionsForAccount.d.ts +8 -0
- package/mcp-server/tools/transfersGenerateOptionsForAccount.d.ts.map +1 -0
- package/mcp-server/tools/transfersGenerateOptionsForAccount.js +70 -0
- package/mcp-server/tools/transfersGenerateOptionsForAccount.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/createaccount.d.ts +4 -4
- package/models/components/createaccount.d.ts.map +1 -1
- package/models/components/createaccount.js +4 -4
- package/models/components/createaccount.js.map +1 -1
- package/models/components/createrefundresponse.d.ts +2 -2
- package/models/components/createrefundresponse.d.ts.map +1 -1
- package/models/components/createrefundresponse.js +2 -2
- package/models/components/createrefundresponse.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 +38 -38
- package/models/components/webhookdata.js.map +1 -1
- package/models/components/webhookdatacapabilityrequested.d.ts +1 -1
- package/models/components/webhookdatacapabilityupdated.d.ts +1 -1
- package/models/operations/createtransfer.d.ts +4 -4
- package/models/operations/createtransfer.d.ts.map +1 -1
- package/models/operations/createtransfer.js +8 -8
- package/models/operations/createtransfer.js.map +1 -1
- package/models/operations/createtransferoptionsforaccount.d.ts +104 -0
- package/models/operations/createtransferoptionsforaccount.d.ts.map +1 -0
- package/models/operations/createtransferoptionsforaccount.js +155 -0
- package/models/operations/createtransferoptionsforaccount.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/package.json +1 -1
- package/sdk/transfers.d.ts +13 -1
- package/sdk/transfers.d.ts.map +1 -1
- package/sdk/transfers.js +16 -1
- package/sdk/transfers.js.map +1 -1
- package/src/funcs/disputesUploadEvidenceFile.ts +20 -4
- package/src/funcs/filesUpload.ts +20 -4
- package/src/funcs/transfersGenerateOptions.ts +1 -1
- package/src/funcs/transfersGenerateOptionsForAccount.ts +202 -0
- package/src/lib/config.ts +3 -3
- package/src/lib/files.ts +42 -0
- package/src/lib/security.ts +2 -2
- package/src/mcp-server/mcp-server.ts +1 -1
- package/src/mcp-server/server.ts +3 -1
- package/src/mcp-server/tools/transfersGenerateOptions.ts +1 -1
- package/src/mcp-server/tools/transfersGenerateOptionsForAccount.ts +46 -0
- package/src/models/components/capability.ts +1 -1
- package/src/models/components/capabilityid.ts +12 -2
- package/src/models/components/createaccount.ts +10 -10
- package/src/models/components/createrefundresponse.ts +5 -5
- package/src/models/components/webhookdata.ts +76 -76
- package/src/models/components/webhookdatacapabilityrequested.ts +1 -1
- package/src/models/components/webhookdatacapabilityupdated.ts +1 -1
- package/src/models/operations/createtransfer.ts +16 -16
- package/src/models/operations/createtransferoptionsforaccount.ts +257 -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/sdk/transfers.ts +24 -1
- package/src/types/constdatetime.ts +1 -1
- package/types/constdatetime.js +1 -1
|
@@ -4,7 +4,10 @@
|
|
|
4
4
|
|
|
5
5
|
import { MoovCore } from "../core.js";
|
|
6
6
|
import { appendForm, encodeSimple } from "../lib/encodings.js";
|
|
7
|
-
import {
|
|
7
|
+
import {
|
|
8
|
+
getContentTypeFromFileName,
|
|
9
|
+
readableStreamToArrayBuffer,
|
|
10
|
+
} from "../lib/files.js";
|
|
8
11
|
import * as M from "../lib/matchers.js";
|
|
9
12
|
import { compactMap } from "../lib/primitives.js";
|
|
10
13
|
import { safeParse } from "../lib/schemas.js";
|
|
@@ -109,14 +112,27 @@ async function $do(
|
|
|
109
112
|
const buffer = await readableStreamToArrayBuffer(
|
|
110
113
|
payload.CreateEvidenceFileMultiPart.file.content,
|
|
111
114
|
);
|
|
112
|
-
const
|
|
113
|
-
|
|
115
|
+
const contentType =
|
|
116
|
+
getContentTypeFromFileName(
|
|
117
|
+
payload.CreateEvidenceFileMultiPart.file.fileName,
|
|
118
|
+
) || "application/octet-stream";
|
|
119
|
+
const blob = new Blob([buffer], { type: contentType });
|
|
120
|
+
appendForm(
|
|
121
|
+
body,
|
|
122
|
+
"file",
|
|
123
|
+
blob,
|
|
124
|
+
payload.CreateEvidenceFileMultiPart.file.fileName,
|
|
125
|
+
);
|
|
114
126
|
} else {
|
|
127
|
+
const contentType =
|
|
128
|
+
getContentTypeFromFileName(
|
|
129
|
+
payload.CreateEvidenceFileMultiPart.file.fileName,
|
|
130
|
+
) || "application/octet-stream";
|
|
115
131
|
appendForm(
|
|
116
132
|
body,
|
|
117
133
|
"file",
|
|
118
134
|
new Blob([payload.CreateEvidenceFileMultiPart.file.content], {
|
|
119
|
-
type:
|
|
135
|
+
type: contentType,
|
|
120
136
|
}),
|
|
121
137
|
payload.CreateEvidenceFileMultiPart.file.fileName,
|
|
122
138
|
);
|
package/src/funcs/filesUpload.ts
CHANGED
|
@@ -4,7 +4,10 @@
|
|
|
4
4
|
|
|
5
5
|
import { MoovCore } from "../core.js";
|
|
6
6
|
import { appendForm, encodeSimple } from "../lib/encodings.js";
|
|
7
|
-
import {
|
|
7
|
+
import {
|
|
8
|
+
getContentTypeFromFileName,
|
|
9
|
+
readableStreamToArrayBuffer,
|
|
10
|
+
} from "../lib/files.js";
|
|
8
11
|
import * as M from "../lib/matchers.js";
|
|
9
12
|
import { compactMap } from "../lib/primitives.js";
|
|
10
13
|
import { safeParse } from "../lib/schemas.js";
|
|
@@ -104,14 +107,27 @@ async function $do(
|
|
|
104
107
|
const buffer = await readableStreamToArrayBuffer(
|
|
105
108
|
payload.FileUploadRequestMultiPart.file.content,
|
|
106
109
|
);
|
|
107
|
-
const
|
|
108
|
-
|
|
110
|
+
const contentType =
|
|
111
|
+
getContentTypeFromFileName(
|
|
112
|
+
payload.FileUploadRequestMultiPart.file.fileName,
|
|
113
|
+
) || "application/octet-stream";
|
|
114
|
+
const blob = new Blob([buffer], { type: contentType });
|
|
115
|
+
appendForm(
|
|
116
|
+
body,
|
|
117
|
+
"file",
|
|
118
|
+
blob,
|
|
119
|
+
payload.FileUploadRequestMultiPart.file.fileName,
|
|
120
|
+
);
|
|
109
121
|
} else {
|
|
122
|
+
const contentType =
|
|
123
|
+
getContentTypeFromFileName(
|
|
124
|
+
payload.FileUploadRequestMultiPart.file.fileName,
|
|
125
|
+
) || "application/octet-stream";
|
|
110
126
|
appendForm(
|
|
111
127
|
body,
|
|
112
128
|
"file",
|
|
113
129
|
new Blob([payload.FileUploadRequestMultiPart.file.content], {
|
|
114
|
-
type:
|
|
130
|
+
type: contentType,
|
|
115
131
|
}),
|
|
116
132
|
payload.FileUploadRequestMultiPart.file.fileName,
|
|
117
133
|
);
|
|
@@ -33,7 +33,7 @@ import { Result } from "../types/fp.js";
|
|
|
33
33
|
* Read our [transfers overview guide](https://docs.moov.io/guides/money-movement/overview/) to learn more.
|
|
34
34
|
*
|
|
35
35
|
* To access this endpoint using an [access token](https://docs.moov.io/api/authentication/access-tokens/)
|
|
36
|
-
* you'll need to specify the `/accounts/{accountID}/transfers.
|
|
36
|
+
* you'll need to specify the `/accounts/{accountID}/transfers.write` scope.
|
|
37
37
|
*/
|
|
38
38
|
export function transfersGenerateOptions(
|
|
39
39
|
client: MoovCore,
|
|
@@ -0,0 +1,202 @@
|
|
|
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
|
+
* Generate available payment method options for one or multiple transfer participants depending on the accountID or paymentMethodID you
|
|
30
|
+
* supply in the request body.
|
|
31
|
+
*
|
|
32
|
+
* The accountID in the route should the partner's accountID.
|
|
33
|
+
*
|
|
34
|
+
* Read our [transfers overview guide](https://docs.moov.io/guides/money-movement/overview/) to learn more.
|
|
35
|
+
*
|
|
36
|
+
* To access this endpoint using an [access token](https://docs.moov.io/api/authentication/access-tokens/)
|
|
37
|
+
* you'll need to specify the `/accounts/{accountID}/transfers.write` scope.
|
|
38
|
+
*/
|
|
39
|
+
export function transfersGenerateOptionsForAccount(
|
|
40
|
+
client: MoovCore,
|
|
41
|
+
request: operations.CreateTransferOptionsForAccountRequest,
|
|
42
|
+
options?: RequestOptions,
|
|
43
|
+
): APIPromise<
|
|
44
|
+
Result<
|
|
45
|
+
operations.CreateTransferOptionsForAccountResponse,
|
|
46
|
+
| errors.GenericError
|
|
47
|
+
| errors.TransferOptionsValidationError
|
|
48
|
+
| MoovError
|
|
49
|
+
| ResponseValidationError
|
|
50
|
+
| ConnectionError
|
|
51
|
+
| RequestAbortedError
|
|
52
|
+
| RequestTimeoutError
|
|
53
|
+
| InvalidRequestError
|
|
54
|
+
| UnexpectedClientError
|
|
55
|
+
| SDKValidationError
|
|
56
|
+
>
|
|
57
|
+
> {
|
|
58
|
+
return new APIPromise($do(
|
|
59
|
+
client,
|
|
60
|
+
request,
|
|
61
|
+
options,
|
|
62
|
+
));
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
async function $do(
|
|
66
|
+
client: MoovCore,
|
|
67
|
+
request: operations.CreateTransferOptionsForAccountRequest,
|
|
68
|
+
options?: RequestOptions,
|
|
69
|
+
): Promise<
|
|
70
|
+
[
|
|
71
|
+
Result<
|
|
72
|
+
operations.CreateTransferOptionsForAccountResponse,
|
|
73
|
+
| errors.GenericError
|
|
74
|
+
| errors.TransferOptionsValidationError
|
|
75
|
+
| MoovError
|
|
76
|
+
| ResponseValidationError
|
|
77
|
+
| ConnectionError
|
|
78
|
+
| RequestAbortedError
|
|
79
|
+
| RequestTimeoutError
|
|
80
|
+
| InvalidRequestError
|
|
81
|
+
| UnexpectedClientError
|
|
82
|
+
| SDKValidationError
|
|
83
|
+
>,
|
|
84
|
+
APICall,
|
|
85
|
+
]
|
|
86
|
+
> {
|
|
87
|
+
const parsed = safeParse(
|
|
88
|
+
request,
|
|
89
|
+
(value) =>
|
|
90
|
+
operations.CreateTransferOptionsForAccountRequest$outboundSchema.parse(
|
|
91
|
+
value,
|
|
92
|
+
),
|
|
93
|
+
"Input validation failed",
|
|
94
|
+
);
|
|
95
|
+
if (!parsed.ok) {
|
|
96
|
+
return [parsed, { status: "invalid" }];
|
|
97
|
+
}
|
|
98
|
+
const payload = parsed.value;
|
|
99
|
+
const body = encodeJSON("body", payload.CreateTransferOptions, {
|
|
100
|
+
explode: true,
|
|
101
|
+
});
|
|
102
|
+
|
|
103
|
+
const pathParams = {
|
|
104
|
+
accountID: encodeSimple("accountID", payload.accountID, {
|
|
105
|
+
explode: false,
|
|
106
|
+
charEncoding: "percent",
|
|
107
|
+
}),
|
|
108
|
+
};
|
|
109
|
+
|
|
110
|
+
const path = pathToFunc("/accounts/{accountID}/transfer-options")(pathParams);
|
|
111
|
+
|
|
112
|
+
const headers = new Headers(compactMap({
|
|
113
|
+
"Content-Type": "application/json",
|
|
114
|
+
Accept: "application/json",
|
|
115
|
+
"x-moov-version": encodeSimple(
|
|
116
|
+
"x-moov-version",
|
|
117
|
+
client._options.xMoovVersion,
|
|
118
|
+
{ explode: false, charEncoding: "none" },
|
|
119
|
+
),
|
|
120
|
+
}));
|
|
121
|
+
|
|
122
|
+
const securityInput = await extractSecurity(client._options.security);
|
|
123
|
+
const requestSecurity = resolveGlobalSecurity(securityInput);
|
|
124
|
+
|
|
125
|
+
const context = {
|
|
126
|
+
options: client._options,
|
|
127
|
+
baseURL: options?.serverURL ?? client._baseURL ?? "",
|
|
128
|
+
operationID: "createTransferOptionsForAccount",
|
|
129
|
+
oAuth2Scopes: [],
|
|
130
|
+
|
|
131
|
+
resolvedSecurity: requestSecurity,
|
|
132
|
+
|
|
133
|
+
securitySource: client._options.security,
|
|
134
|
+
retryConfig: options?.retries
|
|
135
|
+
|| client._options.retryConfig
|
|
136
|
+
|| { strategy: "none" },
|
|
137
|
+
retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
|
|
138
|
+
};
|
|
139
|
+
|
|
140
|
+
const requestRes = client._createRequest(context, {
|
|
141
|
+
security: requestSecurity,
|
|
142
|
+
method: "POST",
|
|
143
|
+
baseURL: options?.serverURL,
|
|
144
|
+
path: path,
|
|
145
|
+
headers: headers,
|
|
146
|
+
body: body,
|
|
147
|
+
userAgent: client._options.userAgent,
|
|
148
|
+
timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
|
|
149
|
+
}, options);
|
|
150
|
+
if (!requestRes.ok) {
|
|
151
|
+
return [requestRes, { status: "invalid" }];
|
|
152
|
+
}
|
|
153
|
+
const req = requestRes.value;
|
|
154
|
+
|
|
155
|
+
const doResult = await client._do(req, {
|
|
156
|
+
context,
|
|
157
|
+
errorCodes: ["400", "401", "403", "422", "429", "4XX", "500", "504", "5XX"],
|
|
158
|
+
retryConfig: context.retryConfig,
|
|
159
|
+
retryCodes: context.retryCodes,
|
|
160
|
+
});
|
|
161
|
+
if (!doResult.ok) {
|
|
162
|
+
return [doResult, { status: "request-error", request: req }];
|
|
163
|
+
}
|
|
164
|
+
const response = doResult.value;
|
|
165
|
+
|
|
166
|
+
const responseFields = {
|
|
167
|
+
HttpMeta: { Response: response, Request: req },
|
|
168
|
+
};
|
|
169
|
+
|
|
170
|
+
const [result] = await M.match<
|
|
171
|
+
operations.CreateTransferOptionsForAccountResponse,
|
|
172
|
+
| errors.GenericError
|
|
173
|
+
| errors.TransferOptionsValidationError
|
|
174
|
+
| MoovError
|
|
175
|
+
| ResponseValidationError
|
|
176
|
+
| ConnectionError
|
|
177
|
+
| RequestAbortedError
|
|
178
|
+
| RequestTimeoutError
|
|
179
|
+
| InvalidRequestError
|
|
180
|
+
| UnexpectedClientError
|
|
181
|
+
| SDKValidationError
|
|
182
|
+
>(
|
|
183
|
+
M.json(
|
|
184
|
+
200,
|
|
185
|
+
operations.CreateTransferOptionsForAccountResponse$inboundSchema,
|
|
186
|
+
{ hdrs: true, key: "Result" },
|
|
187
|
+
),
|
|
188
|
+
M.jsonErr(400, errors.GenericError$inboundSchema, { hdrs: true }),
|
|
189
|
+
M.jsonErr(422, errors.TransferOptionsValidationError$inboundSchema, {
|
|
190
|
+
hdrs: true,
|
|
191
|
+
}),
|
|
192
|
+
M.fail([401, 403, 429]),
|
|
193
|
+
M.fail([500, 504]),
|
|
194
|
+
M.fail("4XX"),
|
|
195
|
+
M.fail("5XX"),
|
|
196
|
+
)(response, req, { extraFields: responseFields });
|
|
197
|
+
if (!result.ok) {
|
|
198
|
+
return [result, { status: "complete", request: req, response }];
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
return [result, { status: "complete", request: req, response }];
|
|
202
|
+
}
|
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.12.
|
|
77
|
-
genVersion: "2.
|
|
78
|
-
userAgent: "speakeasy-sdk/typescript 0.12.
|
|
76
|
+
sdkVersion: "0.12.6",
|
|
77
|
+
genVersion: "2.638.0",
|
|
78
|
+
userAgent: "speakeasy-sdk/typescript 0.12.6 2.638.0 latest @moovio/sdk",
|
|
79
79
|
} as const;
|
package/src/lib/files.ts
CHANGED
|
@@ -38,3 +38,45 @@ export async function readableStreamToArrayBuffer(
|
|
|
38
38
|
|
|
39
39
|
return concatenatedChunks.buffer as ArrayBuffer;
|
|
40
40
|
}
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* Determines the MIME content type based on a file's extension.
|
|
44
|
+
* Returns null if the extension is not recognized.
|
|
45
|
+
*/
|
|
46
|
+
export function getContentTypeFromFileName(fileName: string): string | null {
|
|
47
|
+
if (!fileName) return null;
|
|
48
|
+
|
|
49
|
+
const ext = fileName.toLowerCase().split(".").pop();
|
|
50
|
+
if (!ext) return null;
|
|
51
|
+
|
|
52
|
+
const mimeTypes: Record<string, string> = {
|
|
53
|
+
json: "application/json",
|
|
54
|
+
xml: "application/xml",
|
|
55
|
+
html: "text/html",
|
|
56
|
+
htm: "text/html",
|
|
57
|
+
txt: "text/plain",
|
|
58
|
+
csv: "text/csv",
|
|
59
|
+
pdf: "application/pdf",
|
|
60
|
+
png: "image/png",
|
|
61
|
+
jpg: "image/jpeg",
|
|
62
|
+
jpeg: "image/jpeg",
|
|
63
|
+
gif: "image/gif",
|
|
64
|
+
svg: "image/svg+xml",
|
|
65
|
+
js: "application/javascript",
|
|
66
|
+
css: "text/css",
|
|
67
|
+
zip: "application/zip",
|
|
68
|
+
tar: "application/x-tar",
|
|
69
|
+
gz: "application/gzip",
|
|
70
|
+
mp4: "video/mp4",
|
|
71
|
+
mp3: "audio/mpeg",
|
|
72
|
+
wav: "audio/wav",
|
|
73
|
+
webp: "image/webp",
|
|
74
|
+
ico: "image/x-icon",
|
|
75
|
+
woff: "font/woff",
|
|
76
|
+
woff2: "font/woff2",
|
|
77
|
+
ttf: "font/ttf",
|
|
78
|
+
otf: "font/otf",
|
|
79
|
+
};
|
|
80
|
+
|
|
81
|
+
return mimeTypes[ext] || null;
|
|
82
|
+
}
|
package/src/lib/security.ts
CHANGED
|
@@ -6,8 +6,8 @@ import * as components from "../models/components/index.js";
|
|
|
6
6
|
|
|
7
7
|
type OAuth2PasswordFlow = {
|
|
8
8
|
username: string;
|
|
9
|
-
password
|
|
10
|
-
clientID
|
|
9
|
+
password: string;
|
|
10
|
+
clientID?: string | undefined;
|
|
11
11
|
clientSecret?: string | undefined;
|
|
12
12
|
tokenURL: string;
|
|
13
13
|
};
|
package/src/mcp-server/server.ts
CHANGED
|
@@ -136,6 +136,7 @@ import { tool$transfersCreate } from "./tools/transfersCreate.js";
|
|
|
136
136
|
import { tool$transfersCreateCancellation } from "./tools/transfersCreateCancellation.js";
|
|
137
137
|
import { tool$transfersCreateReversal } from "./tools/transfersCreateReversal.js";
|
|
138
138
|
import { tool$transfersGenerateOptions } from "./tools/transfersGenerateOptions.js";
|
|
139
|
+
import { tool$transfersGenerateOptionsForAccount } from "./tools/transfersGenerateOptionsForAccount.js";
|
|
139
140
|
import { tool$transfersGet } from "./tools/transfersGet.js";
|
|
140
141
|
import { tool$transfersGetCancellation } from "./tools/transfersGetCancellation.js";
|
|
141
142
|
import { tool$transfersGetRefund } from "./tools/transfersGetRefund.js";
|
|
@@ -161,7 +162,7 @@ export function createMCPServer(deps: {
|
|
|
161
162
|
}) {
|
|
162
163
|
const server = new McpServer({
|
|
163
164
|
name: "Moov",
|
|
164
|
-
version: "0.12.
|
|
165
|
+
version: "0.12.6",
|
|
165
166
|
});
|
|
166
167
|
|
|
167
168
|
const client = new MoovCore({
|
|
@@ -280,6 +281,7 @@ export function createMCPServer(deps: {
|
|
|
280
281
|
tool(tool$accountTerminalApplicationsList);
|
|
281
282
|
tool(tool$accountTerminalApplicationsGet);
|
|
282
283
|
tool(tool$accountTerminalApplicationsGetConfiguration);
|
|
284
|
+
tool(tool$transfersGenerateOptionsForAccount);
|
|
283
285
|
tool(tool$transfersCreate);
|
|
284
286
|
tool(tool$transfersList);
|
|
285
287
|
tool(tool$transfersGet);
|
|
@@ -19,7 +19,7 @@ supply in the request.
|
|
|
19
19
|
Read our [transfers overview guide](https://docs.moov.io/guides/money-movement/overview/) to learn more.
|
|
20
20
|
|
|
21
21
|
To access this endpoint using an [access token](https://docs.moov.io/api/authentication/access-tokens/)
|
|
22
|
-
you'll need to specify the \`/accounts/{accountID}/transfers.
|
|
22
|
+
you'll need to specify the \`/accounts/{accountID}/transfers.write\` scope.`,
|
|
23
23
|
args,
|
|
24
24
|
tool: async (client, args, ctx) => {
|
|
25
25
|
const [result, apiCall] = await transfersGenerateOptions(
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import { transfersGenerateOptionsForAccount } from "../../funcs/transfersGenerateOptionsForAccount.js";
|
|
6
|
+
import * as operations from "../../models/operations/index.js";
|
|
7
|
+
import { formatResult, ToolDefinition } from "../tools.js";
|
|
8
|
+
|
|
9
|
+
const args = {
|
|
10
|
+
request: operations.CreateTransferOptionsForAccountRequest$inboundSchema,
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
export const tool$transfersGenerateOptionsForAccount: ToolDefinition<
|
|
14
|
+
typeof args
|
|
15
|
+
> = {
|
|
16
|
+
name: "transfers-generate-options-for-account",
|
|
17
|
+
description:
|
|
18
|
+
`Generate available payment method options for one or multiple transfer participants depending on the accountID or paymentMethodID you
|
|
19
|
+
supply in the request body.
|
|
20
|
+
|
|
21
|
+
The accountID in the route should the partner's accountID.
|
|
22
|
+
|
|
23
|
+
Read our [transfers overview guide](https://docs.moov.io/guides/money-movement/overview/) to learn more.
|
|
24
|
+
|
|
25
|
+
To access this endpoint using an [access token](https://docs.moov.io/api/authentication/access-tokens/)
|
|
26
|
+
you'll need to specify the \`/accounts/{accountID}/transfers.write\` scope.`,
|
|
27
|
+
args,
|
|
28
|
+
tool: async (client, args, ctx) => {
|
|
29
|
+
const [result, apiCall] = await transfersGenerateOptionsForAccount(
|
|
30
|
+
client,
|
|
31
|
+
args.request,
|
|
32
|
+
{ fetchOptions: { signal: ctx.signal } },
|
|
33
|
+
).$inspect();
|
|
34
|
+
|
|
35
|
+
if (!result.ok) {
|
|
36
|
+
return {
|
|
37
|
+
content: [{ type: "text", text: result.error.message }],
|
|
38
|
+
isError: true,
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
const value = result.value.result;
|
|
43
|
+
|
|
44
|
+
return formatResult(value, apiCall);
|
|
45
|
+
},
|
|
46
|
+
};
|
|
@@ -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
|
|
|
@@ -49,8 +49,8 @@ import {
|
|
|
49
49
|
} from "./termsofservicetoken.js";
|
|
50
50
|
|
|
51
51
|
export type CreateAccountTermsOfService =
|
|
52
|
-
|
|
|
53
|
-
|
|
|
52
|
+
| ManualTermsOfService
|
|
53
|
+
| TermsOfServiceToken;
|
|
54
54
|
|
|
55
55
|
export type CreateAccount = {
|
|
56
56
|
accountType: CreateAccountType;
|
|
@@ -59,7 +59,7 @@ export type CreateAccount = {
|
|
|
59
59
|
* Free-form key-value pair list. Useful for storing information that is not captured elsewhere.
|
|
60
60
|
*/
|
|
61
61
|
metadata?: { [k: string]: string } | undefined;
|
|
62
|
-
termsOfService?:
|
|
62
|
+
termsOfService?: ManualTermsOfService | TermsOfServiceToken | undefined;
|
|
63
63
|
/**
|
|
64
64
|
* Optional alias from a foreign/external system which can be used to reference this resource.
|
|
65
65
|
*/
|
|
@@ -88,14 +88,14 @@ export const CreateAccountTermsOfService$inboundSchema: z.ZodType<
|
|
|
88
88
|
z.ZodTypeDef,
|
|
89
89
|
unknown
|
|
90
90
|
> = z.union([
|
|
91
|
-
TermsOfServiceToken$inboundSchema,
|
|
92
91
|
ManualTermsOfService$inboundSchema,
|
|
92
|
+
TermsOfServiceToken$inboundSchema,
|
|
93
93
|
]);
|
|
94
94
|
|
|
95
95
|
/** @internal */
|
|
96
96
|
export type CreateAccountTermsOfService$Outbound =
|
|
97
|
-
|
|
|
98
|
-
|
|
|
97
|
+
| ManualTermsOfService$Outbound
|
|
98
|
+
| TermsOfServiceToken$Outbound;
|
|
99
99
|
|
|
100
100
|
/** @internal */
|
|
101
101
|
export const CreateAccountTermsOfService$outboundSchema: z.ZodType<
|
|
@@ -103,8 +103,8 @@ export const CreateAccountTermsOfService$outboundSchema: z.ZodType<
|
|
|
103
103
|
z.ZodTypeDef,
|
|
104
104
|
CreateAccountTermsOfService
|
|
105
105
|
> = z.union([
|
|
106
|
-
TermsOfServiceToken$outboundSchema,
|
|
107
106
|
ManualTermsOfService$outboundSchema,
|
|
107
|
+
TermsOfServiceToken$outboundSchema,
|
|
108
108
|
]);
|
|
109
109
|
|
|
110
110
|
/**
|
|
@@ -150,8 +150,8 @@ export const CreateAccount$inboundSchema: z.ZodType<
|
|
|
150
150
|
profile: CreateProfile$inboundSchema,
|
|
151
151
|
metadata: z.record(z.string()).optional(),
|
|
152
152
|
termsOfService: z.union([
|
|
153
|
-
TermsOfServiceToken$inboundSchema,
|
|
154
153
|
ManualTermsOfService$inboundSchema,
|
|
154
|
+
TermsOfServiceToken$inboundSchema,
|
|
155
155
|
]).optional(),
|
|
156
156
|
foreignID: z.string().optional(),
|
|
157
157
|
customerSupport: CustomerSupport$inboundSchema.optional(),
|
|
@@ -166,8 +166,8 @@ export type CreateAccount$Outbound = {
|
|
|
166
166
|
profile: CreateProfile$Outbound;
|
|
167
167
|
metadata?: { [k: string]: string } | undefined;
|
|
168
168
|
termsOfService?:
|
|
169
|
-
| TermsOfServiceToken$Outbound
|
|
170
169
|
| ManualTermsOfService$Outbound
|
|
170
|
+
| TermsOfServiceToken$Outbound
|
|
171
171
|
| undefined;
|
|
172
172
|
foreignID?: string | undefined;
|
|
173
173
|
customerSupport?: CustomerSupport$Outbound | undefined;
|
|
@@ -186,8 +186,8 @@ export const CreateAccount$outboundSchema: z.ZodType<
|
|
|
186
186
|
profile: CreateProfile$outboundSchema,
|
|
187
187
|
metadata: z.record(z.string()).optional(),
|
|
188
188
|
termsOfService: z.union([
|
|
189
|
-
TermsOfServiceToken$outboundSchema,
|
|
190
189
|
ManualTermsOfService$outboundSchema,
|
|
190
|
+
TermsOfServiceToken$outboundSchema,
|
|
191
191
|
]).optional(),
|
|
192
192
|
foreignID: z.string().optional(),
|
|
193
193
|
customerSupport: CustomerSupport$outboundSchema.optional(),
|
|
@@ -19,7 +19,7 @@ import {
|
|
|
19
19
|
CardAcquiringRefund$outboundSchema,
|
|
20
20
|
} from "./cardacquiringrefund.js";
|
|
21
21
|
|
|
22
|
-
export type CreateRefundResponse =
|
|
22
|
+
export type CreateRefundResponse = CardAcquiringRefund | AsyncCreatedRefund;
|
|
23
23
|
|
|
24
24
|
/** @internal */
|
|
25
25
|
export const CreateRefundResponse$inboundSchema: z.ZodType<
|
|
@@ -27,14 +27,14 @@ export const CreateRefundResponse$inboundSchema: z.ZodType<
|
|
|
27
27
|
z.ZodTypeDef,
|
|
28
28
|
unknown
|
|
29
29
|
> = z.union([
|
|
30
|
-
AsyncCreatedRefund$inboundSchema,
|
|
31
30
|
CardAcquiringRefund$inboundSchema,
|
|
31
|
+
AsyncCreatedRefund$inboundSchema,
|
|
32
32
|
]);
|
|
33
33
|
|
|
34
34
|
/** @internal */
|
|
35
35
|
export type CreateRefundResponse$Outbound =
|
|
36
|
-
|
|
|
37
|
-
|
|
|
36
|
+
| CardAcquiringRefund$Outbound
|
|
37
|
+
| AsyncCreatedRefund$Outbound;
|
|
38
38
|
|
|
39
39
|
/** @internal */
|
|
40
40
|
export const CreateRefundResponse$outboundSchema: z.ZodType<
|
|
@@ -42,8 +42,8 @@ export const CreateRefundResponse$outboundSchema: z.ZodType<
|
|
|
42
42
|
z.ZodTypeDef,
|
|
43
43
|
CreateRefundResponse
|
|
44
44
|
> = z.union([
|
|
45
|
-
AsyncCreatedRefund$outboundSchema,
|
|
46
45
|
CardAcquiringRefund$outboundSchema,
|
|
46
|
+
AsyncCreatedRefund$outboundSchema,
|
|
47
47
|
]);
|
|
48
48
|
|
|
49
49
|
/**
|