@moovio/sdk 0.6.0 → 0.6.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/README.md +38 -8
- package/bin/mcp-server.js +1122 -258
- package/bin/mcp-server.js.map +28 -11
- package/docs/sdks/receipts/README.md +189 -0
- package/docs/sdks/transfers/README.md +185 -0
- package/funcs/receiptsCreate.d.ts +18 -0
- package/funcs/receiptsCreate.d.ts.map +1 -0
- package/funcs/receiptsCreate.js +133 -0
- package/funcs/receiptsCreate.js.map +1 -0
- package/funcs/receiptsList.d.ts +16 -0
- package/funcs/receiptsList.d.ts.map +1 -0
- package/funcs/receiptsList.js +121 -0
- package/funcs/receiptsList.js.map +1 -0
- package/funcs/transfersCreateCancellation.d.ts +17 -0
- package/funcs/transfersCreateCancellation.d.ts.map +1 -0
- package/funcs/transfersCreateCancellation.js +128 -0
- package/funcs/transfersCreateCancellation.js.map +1 -0
- package/funcs/transfersGetCancellation.d.ts +16 -0
- package/funcs/transfersGetCancellation.d.ts.map +1 -0
- package/funcs/transfersGetCancellation.js +131 -0
- package/funcs/transfersGetCancellation.js.map +1 -0
- package/jsr.json +1 -1
- package/lib/config.d.ts +3 -3
- package/lib/config.js +3 -3
- package/mcp-server/mcp-server.js +1 -1
- package/mcp-server/server.d.ts.map +1 -1
- package/mcp-server/server.js +9 -1
- package/mcp-server/server.js.map +1 -1
- package/mcp-server/tools/receiptsCreate.d.ts +9 -0
- package/mcp-server/tools/receiptsCreate.d.ts.map +1 -0
- package/mcp-server/tools/receiptsCreate.js +66 -0
- package/mcp-server/tools/receiptsCreate.js.map +1 -0
- package/mcp-server/tools/receiptsList.d.ts +8 -0
- package/mcp-server/tools/receiptsList.d.ts.map +1 -0
- package/mcp-server/tools/receiptsList.js +65 -0
- package/mcp-server/tools/receiptsList.js.map +1 -0
- package/mcp-server/tools/transfersCreateCancellation.d.ts +8 -0
- package/mcp-server/tools/transfersCreateCancellation.d.ts.map +1 -0
- package/mcp-server/tools/transfersCreateCancellation.js +65 -0
- package/mcp-server/tools/transfersCreateCancellation.js.map +1 -0
- package/mcp-server/tools/transfersGetCancellation.d.ts +8 -0
- package/mcp-server/tools/transfersGetCancellation.d.ts.map +1 -0
- package/mcp-server/tools/transfersGetCancellation.js +65 -0
- package/mcp-server/tools/transfersGetCancellation.js.map +1 -0
- package/models/components/index.d.ts +4 -0
- package/models/components/index.d.ts.map +1 -1
- package/models/components/index.js +4 -0
- package/models/components/index.js.map +1 -1
- package/models/components/receiptkind.d.ts +31 -0
- package/models/components/receiptkind.d.ts.map +1 -0
- package/models/components/receiptkind.js +63 -0
- package/models/components/receiptkind.js.map +1 -0
- package/models/components/receiptrequest.d.ts +76 -0
- package/models/components/receiptrequest.d.ts.map +1 -0
- package/models/components/receiptrequest.js +80 -0
- package/models/components/receiptrequest.js.map +1 -0
- package/models/components/receiptresponse.d.ts +94 -0
- package/models/components/receiptresponse.d.ts.map +1 -0
- package/models/components/receiptresponse.js +90 -0
- package/models/components/receiptresponse.js.map +1 -0
- package/models/components/sentreceipt.d.ts +42 -0
- package/models/components/sentreceipt.d.ts.map +1 -0
- package/models/components/sentreceipt.js +73 -0
- package/models/components/sentreceipt.js.map +1 -0
- package/models/components/transfer.d.ts +3 -0
- 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/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/receiptvalidationerror.d.ts +46 -0
- package/models/errors/receiptvalidationerror.d.ts.map +1 -0
- package/models/errors/receiptvalidationerror.js +98 -0
- package/models/errors/receiptvalidationerror.js.map +1 -0
- package/models/errors/transfer.d.ts +3 -0
- package/models/errors/transfer.d.ts.map +1 -1
- package/models/errors/transfer.js +4 -0
- package/models/errors/transfer.js.map +1 -1
- package/models/operations/createcancellation.d.ts +107 -0
- package/models/operations/createcancellation.d.ts.map +1 -0
- package/models/operations/createcancellation.js +147 -0
- package/models/operations/createcancellation.js.map +1 -0
- package/models/operations/createreceipts.d.ts +74 -0
- package/models/operations/createreceipts.d.ts.map +1 -0
- package/models/operations/createreceipts.js +118 -0
- package/models/operations/createreceipts.js.map +1 -0
- package/models/operations/getcancellation.d.ts +112 -0
- package/models/operations/getcancellation.d.ts.map +1 -0
- package/models/operations/getcancellation.js +149 -0
- package/models/operations/getcancellation.js.map +1 -0
- package/models/operations/index.d.ts +4 -0
- package/models/operations/index.d.ts.map +1 -1
- package/models/operations/index.js +4 -0
- package/models/operations/index.js.map +1 -1
- package/models/operations/listreceipts.d.ts +102 -0
- package/models/operations/listreceipts.d.ts.map +1 -0
- package/models/operations/listreceipts.js +145 -0
- package/models/operations/listreceipts.js.map +1 -0
- package/package.json +1 -1
- package/sdk/receipts.d.ts +20 -0
- package/sdk/receipts.d.ts.map +1 -0
- package/sdk/receipts.js +32 -0
- package/sdk/receipts.js.map +1 -0
- package/sdk/sdk.d.ts +3 -0
- package/sdk/sdk.d.ts.map +1 -1
- package/sdk/sdk.js +4 -0
- package/sdk/sdk.js.map +1 -1
- package/sdk/transfers.d.ts +14 -0
- package/sdk/transfers.d.ts.map +1 -1
- package/sdk/transfers.js +20 -0
- package/sdk/transfers.js.map +1 -1
- package/src/funcs/receiptsCreate.ts +190 -0
- package/src/funcs/receiptsList.ts +171 -0
- package/src/funcs/transfersCreateCancellation.ts +184 -0
- package/src/funcs/transfersGetCancellation.ts +183 -0
- package/src/lib/config.ts +3 -3
- package/src/mcp-server/mcp-server.ts +1 -1
- package/src/mcp-server/server.ts +9 -1
- package/src/mcp-server/tools/receiptsCreate.ts +39 -0
- package/src/mcp-server/tools/receiptsList.ts +38 -0
- package/src/mcp-server/tools/transfersCreateCancellation.ts +38 -0
- package/src/mcp-server/tools/transfersGetCancellation.ts +38 -0
- package/src/models/components/index.ts +4 -0
- package/src/models/components/receiptkind.ts +36 -0
- package/src/models/components/receiptrequest.ts +123 -0
- package/src/models/components/receiptresponse.ts +157 -0
- package/src/models/components/sentreceipt.ts +79 -0
- package/src/models/components/transfer.ts +10 -0
- package/src/models/errors/index.ts +1 -0
- package/src/models/errors/receiptvalidationerror.ts +99 -0
- package/src/models/errors/transfer.ts +6 -0
- package/src/models/operations/createcancellation.ts +229 -0
- package/src/models/operations/createreceipts.ts +161 -0
- package/src/models/operations/getcancellation.ts +236 -0
- package/src/models/operations/index.ts +4 -0
- package/src/models/operations/listreceipts.ts +222 -0
- package/src/sdk/receipts.ts +46 -0
- package/src/sdk/sdk.ts +6 -0
- package/src/sdk/transfers.ts +36 -0
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import { MoovCore } from "../core.js";
|
|
6
|
+
import { encodeFormQuery, encodeSimple } from "../lib/encodings.js";
|
|
7
|
+
import * as M from "../lib/matchers.js";
|
|
8
|
+
import { compactMap } from "../lib/primitives.js";
|
|
9
|
+
import { safeParse } from "../lib/schemas.js";
|
|
10
|
+
import { RequestOptions } from "../lib/sdks.js";
|
|
11
|
+
import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
|
|
12
|
+
import { pathToFunc } from "../lib/url.js";
|
|
13
|
+
import { APIError } from "../models/errors/apierror.js";
|
|
14
|
+
import {
|
|
15
|
+
ConnectionError,
|
|
16
|
+
InvalidRequestError,
|
|
17
|
+
RequestAbortedError,
|
|
18
|
+
RequestTimeoutError,
|
|
19
|
+
UnexpectedClientError,
|
|
20
|
+
} from "../models/errors/httpclienterrors.js";
|
|
21
|
+
import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
|
|
22
|
+
import * as operations from "../models/operations/index.js";
|
|
23
|
+
import { APICall, APIPromise } from "../types/async.js";
|
|
24
|
+
import { Result } from "../types/fp.js";
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* List receipts by trasnferID, scheduleID, or occurrenceID.
|
|
28
|
+
*
|
|
29
|
+
* To access this endpoint using an [access token](https://docs.moov.io/api/authentication/access-tokens/)
|
|
30
|
+
* you'll need to specify the `/accounts/{accountID}/transfers.read` scope.
|
|
31
|
+
*/
|
|
32
|
+
export function receiptsList(
|
|
33
|
+
client: MoovCore,
|
|
34
|
+
request: operations.ListReceiptsRequest,
|
|
35
|
+
options?: RequestOptions,
|
|
36
|
+
): APIPromise<
|
|
37
|
+
Result<
|
|
38
|
+
operations.ListReceiptsResponse,
|
|
39
|
+
| APIError
|
|
40
|
+
| SDKValidationError
|
|
41
|
+
| UnexpectedClientError
|
|
42
|
+
| InvalidRequestError
|
|
43
|
+
| RequestAbortedError
|
|
44
|
+
| RequestTimeoutError
|
|
45
|
+
| ConnectionError
|
|
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.ListReceiptsRequest,
|
|
58
|
+
options?: RequestOptions,
|
|
59
|
+
): Promise<
|
|
60
|
+
[
|
|
61
|
+
Result<
|
|
62
|
+
operations.ListReceiptsResponse,
|
|
63
|
+
| APIError
|
|
64
|
+
| SDKValidationError
|
|
65
|
+
| UnexpectedClientError
|
|
66
|
+
| InvalidRequestError
|
|
67
|
+
| RequestAbortedError
|
|
68
|
+
| RequestTimeoutError
|
|
69
|
+
| ConnectionError
|
|
70
|
+
>,
|
|
71
|
+
APICall,
|
|
72
|
+
]
|
|
73
|
+
> {
|
|
74
|
+
const parsed = safeParse(
|
|
75
|
+
request,
|
|
76
|
+
(value) => operations.ListReceiptsRequest$outboundSchema.parse(value),
|
|
77
|
+
"Input validation failed",
|
|
78
|
+
);
|
|
79
|
+
if (!parsed.ok) {
|
|
80
|
+
return [parsed, { status: "invalid" }];
|
|
81
|
+
}
|
|
82
|
+
const payload = parsed.value;
|
|
83
|
+
const body = null;
|
|
84
|
+
|
|
85
|
+
const path = pathToFunc("/receipts")();
|
|
86
|
+
|
|
87
|
+
const query = encodeFormQuery({
|
|
88
|
+
"id": payload.id,
|
|
89
|
+
}, { explode: false });
|
|
90
|
+
|
|
91
|
+
const headers = new Headers(compactMap({
|
|
92
|
+
Accept: "application/json",
|
|
93
|
+
"x-moov-version": encodeSimple(
|
|
94
|
+
"x-moov-version",
|
|
95
|
+
client._options.xMoovVersion,
|
|
96
|
+
{ explode: false, charEncoding: "none" },
|
|
97
|
+
),
|
|
98
|
+
}));
|
|
99
|
+
|
|
100
|
+
const securityInput = await extractSecurity(client._options.security);
|
|
101
|
+
const requestSecurity = resolveGlobalSecurity(securityInput);
|
|
102
|
+
|
|
103
|
+
const context = {
|
|
104
|
+
baseURL: options?.serverURL ?? client._baseURL ?? "",
|
|
105
|
+
operationID: "listReceipts",
|
|
106
|
+
oAuth2Scopes: [],
|
|
107
|
+
|
|
108
|
+
resolvedSecurity: requestSecurity,
|
|
109
|
+
|
|
110
|
+
securitySource: client._options.security,
|
|
111
|
+
retryConfig: options?.retries
|
|
112
|
+
|| client._options.retryConfig
|
|
113
|
+
|| { strategy: "none" },
|
|
114
|
+
retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
|
|
115
|
+
};
|
|
116
|
+
|
|
117
|
+
const requestRes = client._createRequest(context, {
|
|
118
|
+
security: requestSecurity,
|
|
119
|
+
method: "GET",
|
|
120
|
+
baseURL: options?.serverURL,
|
|
121
|
+
path: path,
|
|
122
|
+
headers: headers,
|
|
123
|
+
query: query,
|
|
124
|
+
body: body,
|
|
125
|
+
timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
|
|
126
|
+
}, options);
|
|
127
|
+
if (!requestRes.ok) {
|
|
128
|
+
return [requestRes, { status: "invalid" }];
|
|
129
|
+
}
|
|
130
|
+
const req = requestRes.value;
|
|
131
|
+
|
|
132
|
+
const doResult = await client._do(req, {
|
|
133
|
+
context,
|
|
134
|
+
errorCodes: ["401", "403", "429", "4XX", "500", "504", "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.ListReceiptsResponse,
|
|
149
|
+
| APIError
|
|
150
|
+
| SDKValidationError
|
|
151
|
+
| UnexpectedClientError
|
|
152
|
+
| InvalidRequestError
|
|
153
|
+
| RequestAbortedError
|
|
154
|
+
| RequestTimeoutError
|
|
155
|
+
| ConnectionError
|
|
156
|
+
>(
|
|
157
|
+
M.json(200, operations.ListReceiptsResponse$inboundSchema, {
|
|
158
|
+
hdrs: true,
|
|
159
|
+
key: "Result",
|
|
160
|
+
}),
|
|
161
|
+
M.fail([401, 403, 429]),
|
|
162
|
+
M.fail([500, 504]),
|
|
163
|
+
M.fail("4XX"),
|
|
164
|
+
M.fail("5XX"),
|
|
165
|
+
)(response, { extraFields: responseFields });
|
|
166
|
+
if (!result.ok) {
|
|
167
|
+
return [result, { status: "complete", request: req, response }];
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
return [result, { status: "complete", request: req, response }];
|
|
171
|
+
}
|
|
@@ -0,0 +1,184 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import { MoovCore } from "../core.js";
|
|
6
|
+
import { encodeSimple } from "../lib/encodings.js";
|
|
7
|
+
import * as M from "../lib/matchers.js";
|
|
8
|
+
import { compactMap } from "../lib/primitives.js";
|
|
9
|
+
import { safeParse } from "../lib/schemas.js";
|
|
10
|
+
import { RequestOptions } from "../lib/sdks.js";
|
|
11
|
+
import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
|
|
12
|
+
import { pathToFunc } from "../lib/url.js";
|
|
13
|
+
import { APIError } from "../models/errors/apierror.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 { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
|
|
23
|
+
import * as operations from "../models/operations/index.js";
|
|
24
|
+
import { APICall, APIPromise } from "../types/async.js";
|
|
25
|
+
import { Result } from "../types/fp.js";
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* Initiate a cancellation for a card, ACH, or queued transfer.
|
|
29
|
+
*
|
|
30
|
+
* To access this endpoint using a [token](https://docs.moov.io/api/authentication/access-tokens/) you'll need
|
|
31
|
+
* to specify the `/accounts/{accountID}/transfers.write` scope.
|
|
32
|
+
*/
|
|
33
|
+
export function transfersCreateCancellation(
|
|
34
|
+
client: MoovCore,
|
|
35
|
+
request: operations.CreateCancellationRequest,
|
|
36
|
+
options?: RequestOptions,
|
|
37
|
+
): APIPromise<
|
|
38
|
+
Result<
|
|
39
|
+
operations.CreateCancellationResponse,
|
|
40
|
+
| errors.GenericError
|
|
41
|
+
| APIError
|
|
42
|
+
| SDKValidationError
|
|
43
|
+
| UnexpectedClientError
|
|
44
|
+
| InvalidRequestError
|
|
45
|
+
| RequestAbortedError
|
|
46
|
+
| RequestTimeoutError
|
|
47
|
+
| ConnectionError
|
|
48
|
+
>
|
|
49
|
+
> {
|
|
50
|
+
return new APIPromise($do(
|
|
51
|
+
client,
|
|
52
|
+
request,
|
|
53
|
+
options,
|
|
54
|
+
));
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
async function $do(
|
|
58
|
+
client: MoovCore,
|
|
59
|
+
request: operations.CreateCancellationRequest,
|
|
60
|
+
options?: RequestOptions,
|
|
61
|
+
): Promise<
|
|
62
|
+
[
|
|
63
|
+
Result<
|
|
64
|
+
operations.CreateCancellationResponse,
|
|
65
|
+
| errors.GenericError
|
|
66
|
+
| APIError
|
|
67
|
+
| SDKValidationError
|
|
68
|
+
| UnexpectedClientError
|
|
69
|
+
| InvalidRequestError
|
|
70
|
+
| RequestAbortedError
|
|
71
|
+
| RequestTimeoutError
|
|
72
|
+
| ConnectionError
|
|
73
|
+
>,
|
|
74
|
+
APICall,
|
|
75
|
+
]
|
|
76
|
+
> {
|
|
77
|
+
const parsed = safeParse(
|
|
78
|
+
request,
|
|
79
|
+
(value) => operations.CreateCancellationRequest$outboundSchema.parse(value),
|
|
80
|
+
"Input validation failed",
|
|
81
|
+
);
|
|
82
|
+
if (!parsed.ok) {
|
|
83
|
+
return [parsed, { status: "invalid" }];
|
|
84
|
+
}
|
|
85
|
+
const payload = parsed.value;
|
|
86
|
+
const body = null;
|
|
87
|
+
|
|
88
|
+
const pathParams = {
|
|
89
|
+
accountID: encodeSimple("accountID", payload.accountID, {
|
|
90
|
+
explode: false,
|
|
91
|
+
charEncoding: "percent",
|
|
92
|
+
}),
|
|
93
|
+
transferID: encodeSimple("transferID", payload.transferID, {
|
|
94
|
+
explode: false,
|
|
95
|
+
charEncoding: "percent",
|
|
96
|
+
}),
|
|
97
|
+
};
|
|
98
|
+
|
|
99
|
+
const path = pathToFunc(
|
|
100
|
+
"/accounts/{accountID}/transfers/{transferID}/cancellations",
|
|
101
|
+
)(pathParams);
|
|
102
|
+
|
|
103
|
+
const headers = new Headers(compactMap({
|
|
104
|
+
Accept: "application/json",
|
|
105
|
+
"x-moov-version": encodeSimple(
|
|
106
|
+
"x-moov-version",
|
|
107
|
+
client._options.xMoovVersion,
|
|
108
|
+
{ explode: false, charEncoding: "none" },
|
|
109
|
+
),
|
|
110
|
+
}));
|
|
111
|
+
|
|
112
|
+
const securityInput = await extractSecurity(client._options.security);
|
|
113
|
+
const requestSecurity = resolveGlobalSecurity(securityInput);
|
|
114
|
+
|
|
115
|
+
const context = {
|
|
116
|
+
baseURL: options?.serverURL ?? client._baseURL ?? "",
|
|
117
|
+
operationID: "createCancellation",
|
|
118
|
+
oAuth2Scopes: [],
|
|
119
|
+
|
|
120
|
+
resolvedSecurity: requestSecurity,
|
|
121
|
+
|
|
122
|
+
securitySource: client._options.security,
|
|
123
|
+
retryConfig: options?.retries
|
|
124
|
+
|| client._options.retryConfig
|
|
125
|
+
|| { strategy: "none" },
|
|
126
|
+
retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
|
|
127
|
+
};
|
|
128
|
+
|
|
129
|
+
const requestRes = client._createRequest(context, {
|
|
130
|
+
security: requestSecurity,
|
|
131
|
+
method: "POST",
|
|
132
|
+
baseURL: options?.serverURL,
|
|
133
|
+
path: path,
|
|
134
|
+
headers: headers,
|
|
135
|
+
body: body,
|
|
136
|
+
timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
|
|
137
|
+
}, options);
|
|
138
|
+
if (!requestRes.ok) {
|
|
139
|
+
return [requestRes, { status: "invalid" }];
|
|
140
|
+
}
|
|
141
|
+
const req = requestRes.value;
|
|
142
|
+
|
|
143
|
+
const doResult = await client._do(req, {
|
|
144
|
+
context,
|
|
145
|
+
errorCodes: ["400", "401", "403", "404", "429", "4XX", "500", "504", "5XX"],
|
|
146
|
+
retryConfig: context.retryConfig,
|
|
147
|
+
retryCodes: context.retryCodes,
|
|
148
|
+
});
|
|
149
|
+
if (!doResult.ok) {
|
|
150
|
+
return [doResult, { status: "request-error", request: req }];
|
|
151
|
+
}
|
|
152
|
+
const response = doResult.value;
|
|
153
|
+
|
|
154
|
+
const responseFields = {
|
|
155
|
+
HttpMeta: { Response: response, Request: req },
|
|
156
|
+
};
|
|
157
|
+
|
|
158
|
+
const [result] = await M.match<
|
|
159
|
+
operations.CreateCancellationResponse,
|
|
160
|
+
| errors.GenericError
|
|
161
|
+
| APIError
|
|
162
|
+
| SDKValidationError
|
|
163
|
+
| UnexpectedClientError
|
|
164
|
+
| InvalidRequestError
|
|
165
|
+
| RequestAbortedError
|
|
166
|
+
| RequestTimeoutError
|
|
167
|
+
| ConnectionError
|
|
168
|
+
>(
|
|
169
|
+
M.json([200, 202], operations.CreateCancellationResponse$inboundSchema, {
|
|
170
|
+
hdrs: true,
|
|
171
|
+
key: "Result",
|
|
172
|
+
}),
|
|
173
|
+
M.jsonErr(400, errors.GenericError$inboundSchema, { hdrs: true }),
|
|
174
|
+
M.fail([401, 403, 404, 429]),
|
|
175
|
+
M.fail([500, 504]),
|
|
176
|
+
M.fail("4XX"),
|
|
177
|
+
M.fail("5XX"),
|
|
178
|
+
)(response, { extraFields: responseFields });
|
|
179
|
+
if (!result.ok) {
|
|
180
|
+
return [result, { status: "complete", request: req, response }];
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
return [result, { status: "complete", request: req, response }];
|
|
184
|
+
}
|
|
@@ -0,0 +1,183 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import { MoovCore } from "../core.js";
|
|
6
|
+
import { encodeSimple } from "../lib/encodings.js";
|
|
7
|
+
import * as M from "../lib/matchers.js";
|
|
8
|
+
import { compactMap } from "../lib/primitives.js";
|
|
9
|
+
import { safeParse } from "../lib/schemas.js";
|
|
10
|
+
import { RequestOptions } from "../lib/sdks.js";
|
|
11
|
+
import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
|
|
12
|
+
import { pathToFunc } from "../lib/url.js";
|
|
13
|
+
import { APIError } from "../models/errors/apierror.js";
|
|
14
|
+
import {
|
|
15
|
+
ConnectionError,
|
|
16
|
+
InvalidRequestError,
|
|
17
|
+
RequestAbortedError,
|
|
18
|
+
RequestTimeoutError,
|
|
19
|
+
UnexpectedClientError,
|
|
20
|
+
} from "../models/errors/httpclienterrors.js";
|
|
21
|
+
import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
|
|
22
|
+
import * as operations from "../models/operations/index.js";
|
|
23
|
+
import { APICall, APIPromise } from "../types/async.js";
|
|
24
|
+
import { Result } from "../types/fp.js";
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* Get details of a cancellation for a transfer.
|
|
28
|
+
*
|
|
29
|
+
* To access this endpoint using a [token](https://docs.moov.io/api/authentication/access-tokens/) you'll need
|
|
30
|
+
* to specify the `/accounts/{accountID}/transfers.read` scope.
|
|
31
|
+
*/
|
|
32
|
+
export function transfersGetCancellation(
|
|
33
|
+
client: MoovCore,
|
|
34
|
+
request: operations.GetCancellationRequest,
|
|
35
|
+
options?: RequestOptions,
|
|
36
|
+
): APIPromise<
|
|
37
|
+
Result<
|
|
38
|
+
operations.GetCancellationResponse,
|
|
39
|
+
| APIError
|
|
40
|
+
| SDKValidationError
|
|
41
|
+
| UnexpectedClientError
|
|
42
|
+
| InvalidRequestError
|
|
43
|
+
| RequestAbortedError
|
|
44
|
+
| RequestTimeoutError
|
|
45
|
+
| ConnectionError
|
|
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.GetCancellationRequest,
|
|
58
|
+
options?: RequestOptions,
|
|
59
|
+
): Promise<
|
|
60
|
+
[
|
|
61
|
+
Result<
|
|
62
|
+
operations.GetCancellationResponse,
|
|
63
|
+
| APIError
|
|
64
|
+
| SDKValidationError
|
|
65
|
+
| UnexpectedClientError
|
|
66
|
+
| InvalidRequestError
|
|
67
|
+
| RequestAbortedError
|
|
68
|
+
| RequestTimeoutError
|
|
69
|
+
| ConnectionError
|
|
70
|
+
>,
|
|
71
|
+
APICall,
|
|
72
|
+
]
|
|
73
|
+
> {
|
|
74
|
+
const parsed = safeParse(
|
|
75
|
+
request,
|
|
76
|
+
(value) => operations.GetCancellationRequest$outboundSchema.parse(value),
|
|
77
|
+
"Input validation failed",
|
|
78
|
+
);
|
|
79
|
+
if (!parsed.ok) {
|
|
80
|
+
return [parsed, { status: "invalid" }];
|
|
81
|
+
}
|
|
82
|
+
const payload = parsed.value;
|
|
83
|
+
const body = null;
|
|
84
|
+
|
|
85
|
+
const pathParams = {
|
|
86
|
+
accountID: encodeSimple("accountID", payload.accountID, {
|
|
87
|
+
explode: false,
|
|
88
|
+
charEncoding: "percent",
|
|
89
|
+
}),
|
|
90
|
+
cancellationID: encodeSimple("cancellationID", payload.cancellationID, {
|
|
91
|
+
explode: false,
|
|
92
|
+
charEncoding: "percent",
|
|
93
|
+
}),
|
|
94
|
+
transferID: encodeSimple("transferID", payload.transferID, {
|
|
95
|
+
explode: false,
|
|
96
|
+
charEncoding: "percent",
|
|
97
|
+
}),
|
|
98
|
+
};
|
|
99
|
+
|
|
100
|
+
const path = pathToFunc(
|
|
101
|
+
"/accounts/{accountID}/transfers/{transferID}/cancellations/{cancellationID}",
|
|
102
|
+
)(pathParams);
|
|
103
|
+
|
|
104
|
+
const headers = new Headers(compactMap({
|
|
105
|
+
Accept: "application/json",
|
|
106
|
+
"x-moov-version": encodeSimple(
|
|
107
|
+
"x-moov-version",
|
|
108
|
+
client._options.xMoovVersion,
|
|
109
|
+
{ explode: false, charEncoding: "none" },
|
|
110
|
+
),
|
|
111
|
+
}));
|
|
112
|
+
|
|
113
|
+
const securityInput = await extractSecurity(client._options.security);
|
|
114
|
+
const requestSecurity = resolveGlobalSecurity(securityInput);
|
|
115
|
+
|
|
116
|
+
const context = {
|
|
117
|
+
baseURL: options?.serverURL ?? client._baseURL ?? "",
|
|
118
|
+
operationID: "getCancellation",
|
|
119
|
+
oAuth2Scopes: [],
|
|
120
|
+
|
|
121
|
+
resolvedSecurity: requestSecurity,
|
|
122
|
+
|
|
123
|
+
securitySource: client._options.security,
|
|
124
|
+
retryConfig: options?.retries
|
|
125
|
+
|| client._options.retryConfig
|
|
126
|
+
|| { strategy: "none" },
|
|
127
|
+
retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
|
|
128
|
+
};
|
|
129
|
+
|
|
130
|
+
const requestRes = client._createRequest(context, {
|
|
131
|
+
security: requestSecurity,
|
|
132
|
+
method: "GET",
|
|
133
|
+
baseURL: options?.serverURL,
|
|
134
|
+
path: path,
|
|
135
|
+
headers: headers,
|
|
136
|
+
body: body,
|
|
137
|
+
timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
|
|
138
|
+
}, options);
|
|
139
|
+
if (!requestRes.ok) {
|
|
140
|
+
return [requestRes, { status: "invalid" }];
|
|
141
|
+
}
|
|
142
|
+
const req = requestRes.value;
|
|
143
|
+
|
|
144
|
+
const doResult = await client._do(req, {
|
|
145
|
+
context,
|
|
146
|
+
errorCodes: ["401", "403", "404", "429", "4XX", "500", "504", "5XX"],
|
|
147
|
+
retryConfig: context.retryConfig,
|
|
148
|
+
retryCodes: context.retryCodes,
|
|
149
|
+
});
|
|
150
|
+
if (!doResult.ok) {
|
|
151
|
+
return [doResult, { status: "request-error", request: req }];
|
|
152
|
+
}
|
|
153
|
+
const response = doResult.value;
|
|
154
|
+
|
|
155
|
+
const responseFields = {
|
|
156
|
+
HttpMeta: { Response: response, Request: req },
|
|
157
|
+
};
|
|
158
|
+
|
|
159
|
+
const [result] = await M.match<
|
|
160
|
+
operations.GetCancellationResponse,
|
|
161
|
+
| APIError
|
|
162
|
+
| SDKValidationError
|
|
163
|
+
| UnexpectedClientError
|
|
164
|
+
| InvalidRequestError
|
|
165
|
+
| RequestAbortedError
|
|
166
|
+
| RequestTimeoutError
|
|
167
|
+
| ConnectionError
|
|
168
|
+
>(
|
|
169
|
+
M.json(200, operations.GetCancellationResponse$inboundSchema, {
|
|
170
|
+
hdrs: true,
|
|
171
|
+
key: "Result",
|
|
172
|
+
}),
|
|
173
|
+
M.fail([401, 403, 404, 429]),
|
|
174
|
+
M.fail([500, 504]),
|
|
175
|
+
M.fail("4XX"),
|
|
176
|
+
M.fail("5XX"),
|
|
177
|
+
)(response, { extraFields: responseFields });
|
|
178
|
+
if (!result.ok) {
|
|
179
|
+
return [result, { status: "complete", request: req, response }];
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
return [result, { status: "complete", request: req, response }];
|
|
183
|
+
}
|
package/src/lib/config.ts
CHANGED
|
@@ -69,7 +69,7 @@ export function serverURLFromOptions(options: SDKOptions): URL | null {
|
|
|
69
69
|
export const SDK_METADATA = {
|
|
70
70
|
language: "typescript",
|
|
71
71
|
openapiDocVersion: "latest",
|
|
72
|
-
sdkVersion: "0.6.
|
|
73
|
-
genVersion: "2.
|
|
74
|
-
userAgent: "speakeasy-sdk/typescript 0.6.
|
|
72
|
+
sdkVersion: "0.6.2",
|
|
73
|
+
genVersion: "2.541.0",
|
|
74
|
+
userAgent: "speakeasy-sdk/typescript 0.6.2 2.541.0 latest @moovio/sdk",
|
|
75
75
|
} as const;
|
package/src/mcp-server/server.ts
CHANGED
|
@@ -99,6 +99,8 @@ import { tool$paymentLinksUpdate } from "./tools/paymentLinksUpdate.js";
|
|
|
99
99
|
import { tool$paymentMethodsGet } from "./tools/paymentMethodsGet.js";
|
|
100
100
|
import { tool$paymentMethodsList } from "./tools/paymentMethodsList.js";
|
|
101
101
|
import { tool$pingPing } from "./tools/pingPing.js";
|
|
102
|
+
import { tool$receiptsCreate } from "./tools/receiptsCreate.js";
|
|
103
|
+
import { tool$receiptsList } from "./tools/receiptsList.js";
|
|
102
104
|
import { tool$representativesCreate } from "./tools/representativesCreate.js";
|
|
103
105
|
import { tool$representativesDelete } from "./tools/representativesDelete.js";
|
|
104
106
|
import { tool$representativesGet } from "./tools/representativesGet.js";
|
|
@@ -121,9 +123,11 @@ import { tool$terminalApplicationsDelete } from "./tools/terminalApplicationsDel
|
|
|
121
123
|
import { tool$terminalApplicationsGet } from "./tools/terminalApplicationsGet.js";
|
|
122
124
|
import { tool$terminalApplicationsList } from "./tools/terminalApplicationsList.js";
|
|
123
125
|
import { tool$transfersCreate } from "./tools/transfersCreate.js";
|
|
126
|
+
import { tool$transfersCreateCancellation } from "./tools/transfersCreateCancellation.js";
|
|
124
127
|
import { tool$transfersCreateReversal } from "./tools/transfersCreateReversal.js";
|
|
125
128
|
import { tool$transfersGenerateOptions } from "./tools/transfersGenerateOptions.js";
|
|
126
129
|
import { tool$transfersGet } from "./tools/transfersGet.js";
|
|
130
|
+
import { tool$transfersGetCancellation } from "./tools/transfersGetCancellation.js";
|
|
127
131
|
import { tool$transfersGetRefund } from "./tools/transfersGetRefund.js";
|
|
128
132
|
import { tool$transfersInitiateRefund } from "./tools/transfersInitiateRefund.js";
|
|
129
133
|
import { tool$transfersList } from "./tools/transfersList.js";
|
|
@@ -147,7 +151,7 @@ export function createMCPServer(deps: {
|
|
|
147
151
|
}) {
|
|
148
152
|
const server = new McpServer({
|
|
149
153
|
name: "Moov",
|
|
150
|
-
version: "0.6.
|
|
154
|
+
version: "0.6.2",
|
|
151
155
|
});
|
|
152
156
|
|
|
153
157
|
const client = new MoovCore({
|
|
@@ -254,6 +258,8 @@ export function createMCPServer(deps: {
|
|
|
254
258
|
tool(tool$transfersList);
|
|
255
259
|
tool(tool$transfersGet);
|
|
256
260
|
tool(tool$transfersUpdate);
|
|
261
|
+
tool(tool$transfersCreateCancellation);
|
|
262
|
+
tool(tool$transfersGetCancellation);
|
|
257
263
|
tool(tool$transfersInitiateRefund);
|
|
258
264
|
tool(tool$transfersListRefunds);
|
|
259
265
|
tool(tool$transfersGetRefund);
|
|
@@ -289,6 +295,8 @@ export function createMCPServer(deps: {
|
|
|
289
295
|
tool(tool$onboardingGetInvite);
|
|
290
296
|
tool(tool$onboardingRevokeInvite);
|
|
291
297
|
tool(tool$pingPing);
|
|
298
|
+
tool(tool$receiptsCreate);
|
|
299
|
+
tool(tool$receiptsList);
|
|
292
300
|
tool(tool$terminalApplicationsCreate);
|
|
293
301
|
tool(tool$terminalApplicationsList);
|
|
294
302
|
tool(tool$terminalApplicationsGet);
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod";
|
|
6
|
+
import { receiptsCreate } from "../../funcs/receiptsCreate.js";
|
|
7
|
+
import * as components from "../../models/components/index.js";
|
|
8
|
+
import { formatResult, ToolDefinition } from "../tools.js";
|
|
9
|
+
|
|
10
|
+
const args = {
|
|
11
|
+
request: z.array(components.ReceiptRequest$inboundSchema),
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
export const tool$receiptsCreate: ToolDefinition<typeof args> = {
|
|
15
|
+
name: "receipts_create",
|
|
16
|
+
description: ` Create receipts for transfers and scheduled transfers.
|
|
17
|
+
|
|
18
|
+
To access this endpoint using an [access token](https://docs.moov.io/api/authentication/access-tokens/)
|
|
19
|
+
you'll need to specify the \`/accounts/{accountID}/transfers.write\` scope.`,
|
|
20
|
+
args,
|
|
21
|
+
tool: async (client, args, ctx) => {
|
|
22
|
+
const [result, apiCall] = await receiptsCreate(
|
|
23
|
+
client,
|
|
24
|
+
args.request,
|
|
25
|
+
{ fetchOptions: { signal: ctx.signal } },
|
|
26
|
+
).$inspect();
|
|
27
|
+
|
|
28
|
+
if (!result.ok) {
|
|
29
|
+
return {
|
|
30
|
+
content: [{ type: "text", text: result.error.message }],
|
|
31
|
+
isError: true,
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
const value = result.value.result;
|
|
36
|
+
|
|
37
|
+
return formatResult(value, apiCall);
|
|
38
|
+
},
|
|
39
|
+
};
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import { receiptsList } from "../../funcs/receiptsList.js";
|
|
6
|
+
import * as operations from "../../models/operations/index.js";
|
|
7
|
+
import { formatResult, ToolDefinition } from "../tools.js";
|
|
8
|
+
|
|
9
|
+
const args = {
|
|
10
|
+
request: operations.ListReceiptsRequest$inboundSchema,
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
export const tool$receiptsList: ToolDefinition<typeof args> = {
|
|
14
|
+
name: "receipts_list",
|
|
15
|
+
description: `List receipts by trasnferID, scheduleID, or occurrenceID.
|
|
16
|
+
|
|
17
|
+
To access this endpoint using an [access token](https://docs.moov.io/api/authentication/access-tokens/)
|
|
18
|
+
you'll need to specify the \`/accounts/{accountID}/transfers.read\` scope.`,
|
|
19
|
+
args,
|
|
20
|
+
tool: async (client, args, ctx) => {
|
|
21
|
+
const [result, apiCall] = await receiptsList(
|
|
22
|
+
client,
|
|
23
|
+
args.request,
|
|
24
|
+
{ fetchOptions: { signal: ctx.signal } },
|
|
25
|
+
).$inspect();
|
|
26
|
+
|
|
27
|
+
if (!result.ok) {
|
|
28
|
+
return {
|
|
29
|
+
content: [{ type: "text", text: result.error.message }],
|
|
30
|
+
isError: true,
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
const value = result.value.result;
|
|
35
|
+
|
|
36
|
+
return formatResult(value, apiCall);
|
|
37
|
+
},
|
|
38
|
+
};
|