@moovio/sdk 0.14.4 → 0.14.5

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.
Files changed (61) hide show
  1. package/README.md +38 -52
  2. package/bin/mcp-server.js +140 -297
  3. package/bin/mcp-server.js.map +11 -14
  4. package/docs/sdks/transfers/README.md +11 -116
  5. package/examples/package-lock.json +1 -1
  6. package/funcs/transfersGenerateOptions.d.ts +4 -3
  7. package/funcs/transfersGenerateOptions.d.ts.map +1 -1
  8. package/funcs/transfersGenerateOptions.js +14 -5
  9. package/funcs/transfersGenerateOptions.js.map +1 -1
  10. package/jsr.json +1 -1
  11. package/lib/config.d.ts +3 -3
  12. package/lib/config.js +3 -3
  13. package/mcp-server/mcp-server.js +1 -1
  14. package/mcp-server/server.d.ts.map +1 -1
  15. package/mcp-server/server.js +2 -4
  16. package/mcp-server/server.js.map +1 -1
  17. package/mcp-server/tools/transfersGenerateOptions.d.ts +2 -2
  18. package/mcp-server/tools/transfersGenerateOptions.d.ts.map +1 -1
  19. package/mcp-server/tools/transfersGenerateOptions.js +5 -3
  20. package/mcp-server/tools/transfersGenerateOptions.js.map +1 -1
  21. package/models/components/terminalcard.d.ts +10 -0
  22. package/models/components/terminalcard.d.ts.map +1 -1
  23. package/models/components/terminalcard.js +4 -0
  24. package/models/components/terminalcard.js.map +1 -1
  25. package/models/operations/createtransferoptions.d.ts +30 -0
  26. package/models/operations/createtransferoptions.d.ts.map +1 -1
  27. package/models/operations/createtransferoptions.js +38 -1
  28. package/models/operations/createtransferoptions.js.map +1 -1
  29. package/models/operations/index.d.ts +0 -1
  30. package/models/operations/index.d.ts.map +1 -1
  31. package/models/operations/index.js +0 -1
  32. package/models/operations/index.js.map +1 -1
  33. package/package.json +1 -1
  34. package/sdk/transfers.d.ts +1 -12
  35. package/sdk/transfers.d.ts.map +1 -1
  36. package/sdk/transfers.js +2 -15
  37. package/sdk/transfers.js.map +1 -1
  38. package/src/funcs/transfersGenerateOptions.ts +18 -7
  39. package/src/lib/config.ts +3 -3
  40. package/src/mcp-server/mcp-server.ts +1 -1
  41. package/src/mcp-server/server.ts +2 -4
  42. package/src/mcp-server/tools/transfersGenerateOptions.ts +5 -3
  43. package/src/models/components/terminalcard.ts +14 -0
  44. package/src/models/operations/createtransferoptions.ts +75 -0
  45. package/src/models/operations/index.ts +0 -1
  46. package/src/sdk/transfers.ts +4 -26
  47. package/funcs/transfersGenerateOptionsForAccount.d.ts +0 -23
  48. package/funcs/transfersGenerateOptionsForAccount.d.ts.map +0 -1
  49. package/funcs/transfersGenerateOptionsForAccount.js +0 -133
  50. package/funcs/transfersGenerateOptionsForAccount.js.map +0 -1
  51. package/mcp-server/tools/transfersGenerateOptionsForAccount.d.ts +0 -8
  52. package/mcp-server/tools/transfersGenerateOptionsForAccount.d.ts.map +0 -1
  53. package/mcp-server/tools/transfersGenerateOptionsForAccount.js +0 -70
  54. package/mcp-server/tools/transfersGenerateOptionsForAccount.js.map +0 -1
  55. package/models/operations/createtransferoptionsforaccount.d.ts +0 -104
  56. package/models/operations/createtransferoptionsforaccount.d.ts.map +0 -1
  57. package/models/operations/createtransferoptionsforaccount.js +0 -155
  58. package/models/operations/createtransferoptionsforaccount.js.map +0 -1
  59. package/src/funcs/transfersGenerateOptionsForAccount.ts +0 -202
  60. package/src/mcp-server/tools/transfersGenerateOptionsForAccount.ts +0 -46
  61. package/src/models/operations/createtransferoptionsforaccount.ts +0 -257
@@ -1,202 +0,0 @@
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
- }
@@ -1,46 +0,0 @@
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
- };
@@ -1,257 +0,0 @@
1
- /*
2
- * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
- */
4
-
5
- import * as z from "zod";
6
- import { remap as remap$ } from "../../lib/primitives.js";
7
- import { safeParse } from "../../lib/schemas.js";
8
- import { Result as SafeParseResult } from "../../types/fp.js";
9
- import * as components from "../components/index.js";
10
- import { SDKValidationError } from "../errors/sdkvalidationerror.js";
11
-
12
- export type CreateTransferOptionsForAccountGlobals = {
13
- /**
14
- * Specify an API version.
15
- *
16
- * @remarks
17
- *
18
- * API versioning follows the format `vYYYY.QQ.BB`, where
19
- * - `YYYY` is the year
20
- * - `QQ` is the two-digit month for the first month of the quarter (e.g., 01, 04, 07, 10)
21
- * - `BB` is the build number, starting at `.01`, for subsequent builds in the same quarter.
22
- * - For example, `v2024.01.00` is the initial release of the first quarter of 2024.
23
- *
24
- * The `latest` version represents the most recent development state. It may include breaking changes and should be treated as a beta release.
25
- */
26
- xMoovVersion?: string | undefined;
27
- };
28
-
29
- export type CreateTransferOptionsForAccountRequest = {
30
- /**
31
- * The partner's Moov account ID.
32
- */
33
- accountID: string;
34
- createTransferOptions: components.CreateTransferOptions;
35
- };
36
-
37
- export type CreateTransferOptionsForAccountResponse = {
38
- headers: { [k: string]: Array<string> };
39
- result: components.TransferOptions;
40
- };
41
-
42
- /** @internal */
43
- export const CreateTransferOptionsForAccountGlobals$inboundSchema: z.ZodType<
44
- CreateTransferOptionsForAccountGlobals,
45
- z.ZodTypeDef,
46
- unknown
47
- > = z.object({
48
- "x-moov-version": z.string().default("v2024.01.00"),
49
- }).transform((v) => {
50
- return remap$(v, {
51
- "x-moov-version": "xMoovVersion",
52
- });
53
- });
54
-
55
- /** @internal */
56
- export type CreateTransferOptionsForAccountGlobals$Outbound = {
57
- "x-moov-version": string;
58
- };
59
-
60
- /** @internal */
61
- export const CreateTransferOptionsForAccountGlobals$outboundSchema: z.ZodType<
62
- CreateTransferOptionsForAccountGlobals$Outbound,
63
- z.ZodTypeDef,
64
- CreateTransferOptionsForAccountGlobals
65
- > = z.object({
66
- xMoovVersion: z.string().default("v2024.01.00"),
67
- }).transform((v) => {
68
- return remap$(v, {
69
- xMoovVersion: "x-moov-version",
70
- });
71
- });
72
-
73
- /**
74
- * @internal
75
- * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
76
- */
77
- export namespace CreateTransferOptionsForAccountGlobals$ {
78
- /** @deprecated use `CreateTransferOptionsForAccountGlobals$inboundSchema` instead. */
79
- export const inboundSchema =
80
- CreateTransferOptionsForAccountGlobals$inboundSchema;
81
- /** @deprecated use `CreateTransferOptionsForAccountGlobals$outboundSchema` instead. */
82
- export const outboundSchema =
83
- CreateTransferOptionsForAccountGlobals$outboundSchema;
84
- /** @deprecated use `CreateTransferOptionsForAccountGlobals$Outbound` instead. */
85
- export type Outbound = CreateTransferOptionsForAccountGlobals$Outbound;
86
- }
87
-
88
- export function createTransferOptionsForAccountGlobalsToJSON(
89
- createTransferOptionsForAccountGlobals:
90
- CreateTransferOptionsForAccountGlobals,
91
- ): string {
92
- return JSON.stringify(
93
- CreateTransferOptionsForAccountGlobals$outboundSchema.parse(
94
- createTransferOptionsForAccountGlobals,
95
- ),
96
- );
97
- }
98
-
99
- export function createTransferOptionsForAccountGlobalsFromJSON(
100
- jsonString: string,
101
- ): SafeParseResult<CreateTransferOptionsForAccountGlobals, SDKValidationError> {
102
- return safeParse(
103
- jsonString,
104
- (x) =>
105
- CreateTransferOptionsForAccountGlobals$inboundSchema.parse(JSON.parse(x)),
106
- `Failed to parse 'CreateTransferOptionsForAccountGlobals' from JSON`,
107
- );
108
- }
109
-
110
- /** @internal */
111
- export const CreateTransferOptionsForAccountRequest$inboundSchema: z.ZodType<
112
- CreateTransferOptionsForAccountRequest,
113
- z.ZodTypeDef,
114
- unknown
115
- > = z.object({
116
- accountID: z.string(),
117
- CreateTransferOptions: components.CreateTransferOptions$inboundSchema,
118
- }).transform((v) => {
119
- return remap$(v, {
120
- "CreateTransferOptions": "createTransferOptions",
121
- });
122
- });
123
-
124
- /** @internal */
125
- export type CreateTransferOptionsForAccountRequest$Outbound = {
126
- accountID: string;
127
- CreateTransferOptions: components.CreateTransferOptions$Outbound;
128
- };
129
-
130
- /** @internal */
131
- export const CreateTransferOptionsForAccountRequest$outboundSchema: z.ZodType<
132
- CreateTransferOptionsForAccountRequest$Outbound,
133
- z.ZodTypeDef,
134
- CreateTransferOptionsForAccountRequest
135
- > = z.object({
136
- accountID: z.string(),
137
- createTransferOptions: components.CreateTransferOptions$outboundSchema,
138
- }).transform((v) => {
139
- return remap$(v, {
140
- createTransferOptions: "CreateTransferOptions",
141
- });
142
- });
143
-
144
- /**
145
- * @internal
146
- * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
147
- */
148
- export namespace CreateTransferOptionsForAccountRequest$ {
149
- /** @deprecated use `CreateTransferOptionsForAccountRequest$inboundSchema` instead. */
150
- export const inboundSchema =
151
- CreateTransferOptionsForAccountRequest$inboundSchema;
152
- /** @deprecated use `CreateTransferOptionsForAccountRequest$outboundSchema` instead. */
153
- export const outboundSchema =
154
- CreateTransferOptionsForAccountRequest$outboundSchema;
155
- /** @deprecated use `CreateTransferOptionsForAccountRequest$Outbound` instead. */
156
- export type Outbound = CreateTransferOptionsForAccountRequest$Outbound;
157
- }
158
-
159
- export function createTransferOptionsForAccountRequestToJSON(
160
- createTransferOptionsForAccountRequest:
161
- CreateTransferOptionsForAccountRequest,
162
- ): string {
163
- return JSON.stringify(
164
- CreateTransferOptionsForAccountRequest$outboundSchema.parse(
165
- createTransferOptionsForAccountRequest,
166
- ),
167
- );
168
- }
169
-
170
- export function createTransferOptionsForAccountRequestFromJSON(
171
- jsonString: string,
172
- ): SafeParseResult<CreateTransferOptionsForAccountRequest, SDKValidationError> {
173
- return safeParse(
174
- jsonString,
175
- (x) =>
176
- CreateTransferOptionsForAccountRequest$inboundSchema.parse(JSON.parse(x)),
177
- `Failed to parse 'CreateTransferOptionsForAccountRequest' from JSON`,
178
- );
179
- }
180
-
181
- /** @internal */
182
- export const CreateTransferOptionsForAccountResponse$inboundSchema: z.ZodType<
183
- CreateTransferOptionsForAccountResponse,
184
- z.ZodTypeDef,
185
- unknown
186
- > = z.object({
187
- Headers: z.record(z.array(z.string())),
188
- Result: components.TransferOptions$inboundSchema,
189
- }).transform((v) => {
190
- return remap$(v, {
191
- "Headers": "headers",
192
- "Result": "result",
193
- });
194
- });
195
-
196
- /** @internal */
197
- export type CreateTransferOptionsForAccountResponse$Outbound = {
198
- Headers: { [k: string]: Array<string> };
199
- Result: components.TransferOptions$Outbound;
200
- };
201
-
202
- /** @internal */
203
- export const CreateTransferOptionsForAccountResponse$outboundSchema: z.ZodType<
204
- CreateTransferOptionsForAccountResponse$Outbound,
205
- z.ZodTypeDef,
206
- CreateTransferOptionsForAccountResponse
207
- > = z.object({
208
- headers: z.record(z.array(z.string())),
209
- result: components.TransferOptions$outboundSchema,
210
- }).transform((v) => {
211
- return remap$(v, {
212
- headers: "Headers",
213
- result: "Result",
214
- });
215
- });
216
-
217
- /**
218
- * @internal
219
- * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
220
- */
221
- export namespace CreateTransferOptionsForAccountResponse$ {
222
- /** @deprecated use `CreateTransferOptionsForAccountResponse$inboundSchema` instead. */
223
- export const inboundSchema =
224
- CreateTransferOptionsForAccountResponse$inboundSchema;
225
- /** @deprecated use `CreateTransferOptionsForAccountResponse$outboundSchema` instead. */
226
- export const outboundSchema =
227
- CreateTransferOptionsForAccountResponse$outboundSchema;
228
- /** @deprecated use `CreateTransferOptionsForAccountResponse$Outbound` instead. */
229
- export type Outbound = CreateTransferOptionsForAccountResponse$Outbound;
230
- }
231
-
232
- export function createTransferOptionsForAccountResponseToJSON(
233
- createTransferOptionsForAccountResponse:
234
- CreateTransferOptionsForAccountResponse,
235
- ): string {
236
- return JSON.stringify(
237
- CreateTransferOptionsForAccountResponse$outboundSchema.parse(
238
- createTransferOptionsForAccountResponse,
239
- ),
240
- );
241
- }
242
-
243
- export function createTransferOptionsForAccountResponseFromJSON(
244
- jsonString: string,
245
- ): SafeParseResult<
246
- CreateTransferOptionsForAccountResponse,
247
- SDKValidationError
248
- > {
249
- return safeParse(
250
- jsonString,
251
- (x) =>
252
- CreateTransferOptionsForAccountResponse$inboundSchema.parse(
253
- JSON.parse(x),
254
- ),
255
- `Failed to parse 'CreateTransferOptionsForAccountResponse' from JSON`,
256
- );
257
- }