@moovio/sdk 0.22.7 → 0.22.9
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 +72 -51
- package/_speakeasy/.github/action-inputs-config.json +53 -0
- package/_speakeasy/.github/action-security-config.json +88 -0
- package/bin/mcp-server.js +40342 -21443
- package/bin/mcp-server.js.map +224 -45
- package/examples/package-lock.json +2 -2
- package/funcs/accountsConnect.d.ts +16 -0
- package/funcs/accountsConnect.d.ts.map +1 -0
- package/funcs/accountsConnect.js +138 -0
- package/funcs/accountsConnect.js.map +1 -0
- package/funcs/accountsListConnected.d.ts +21 -0
- package/funcs/accountsListConnected.d.ts.map +1 -0
- package/funcs/accountsListConnected.js +138 -0
- package/funcs/accountsListConnected.js.map +1 -0
- package/funcs/invoicesMarkPaidInvoice.js +1 -1
- package/funcs/invoicesMarkPaidInvoice.js.map +1 -1
- 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/prompts.d.ts +3 -3
- package/mcp-server/prompts.d.ts.map +1 -1
- package/mcp-server/prompts.js.map +1 -1
- package/mcp-server/resources.d.ts +3 -3
- package/mcp-server/resources.d.ts.map +1 -1
- package/mcp-server/resources.js.map +1 -1
- package/mcp-server/server.d.ts.map +1 -1
- package/mcp-server/server.js +5 -1
- package/mcp-server/server.js.map +1 -1
- package/mcp-server/tools/accountsConnect.d.ts +8 -0
- package/mcp-server/tools/accountsConnect.d.ts.map +1 -0
- package/mcp-server/tools/accountsConnect.js +62 -0
- package/mcp-server/tools/accountsConnect.js.map +1 -0
- package/mcp-server/tools/accountsListConnected.d.ts +8 -0
- package/mcp-server/tools/accountsListConnected.d.ts.map +1 -0
- package/mcp-server/tools/accountsListConnected.js +69 -0
- package/mcp-server/tools/accountsListConnected.js.map +1 -0
- package/mcp-server/tools.d.ts +3 -3
- package/mcp-server/tools.d.ts.map +1 -1
- package/mcp-server/tools.js.map +1 -1
- package/models/components/createtransfer.d.ts +3 -3
- package/models/components/createtransfer.d.ts.map +1 -1
- package/models/components/createtransfer.js +3 -3
- package/models/components/createtransfer.js.map +1 -1
- package/models/components/createtransferlineitem.d.ts +50 -0
- package/models/components/createtransferlineitem.d.ts.map +1 -0
- package/models/components/createtransferlineitem.js +70 -0
- package/models/components/createtransferlineitem.js.map +1 -0
- package/models/components/createtransferlineitemoption.d.ts +44 -0
- package/models/components/createtransferlineitemoption.d.ts.map +1 -0
- package/models/components/createtransferlineitemoption.js +67 -0
- package/models/components/createtransferlineitemoption.js.map +1 -0
- package/models/components/createtransferlineitemoptionvalidationerror.d.ts +26 -0
- package/models/components/createtransferlineitemoptionvalidationerror.d.ts.map +1 -0
- package/models/components/{transferlineitemoptionvalidationerror.js → createtransferlineitemoptionvalidationerror.js} +12 -10
- package/models/components/createtransferlineitemoptionvalidationerror.js.map +1 -0
- package/models/components/createtransferlineitems.d.ts +27 -0
- package/models/components/createtransferlineitems.d.ts.map +1 -0
- package/models/components/{transferlineitemsvalidationerror.js → createtransferlineitems.js} +13 -13
- package/models/components/createtransferlineitems.js.map +1 -0
- package/models/components/createtransferlineitemsvalidationerror.d.ts +22 -0
- package/models/components/createtransferlineitemsvalidationerror.d.ts.map +1 -0
- package/models/components/createtransferlineitemsvalidationerror.js +61 -0
- package/models/components/createtransferlineitemsvalidationerror.js.map +1 -0
- package/models/components/createtransferlineitemvalidationerror.d.ts +33 -0
- package/models/components/createtransferlineitemvalidationerror.d.ts.map +1 -0
- package/models/components/{transferlineitemvalidationerror.js → createtransferlineitemvalidationerror.js} +15 -13
- package/models/components/createtransferlineitemvalidationerror.js.map +1 -0
- package/models/components/index.d.ts +8 -3
- package/models/components/index.d.ts.map +1 -1
- package/models/components/index.js +8 -3
- package/models/components/index.js.map +1 -1
- package/models/components/sharescopes.d.ts +29 -0
- package/models/components/sharescopes.d.ts.map +1 -0
- package/models/components/sharescopes.js +61 -0
- package/models/components/sharescopes.js.map +1 -0
- package/models/components/transferlineitem.d.ts +6 -0
- package/models/components/transferlineitem.d.ts.map +1 -1
- package/models/components/transferlineitem.js +3 -0
- package/models/components/transferlineitem.js.map +1 -1
- package/models/components/transferlineitemimagemetadata.d.ts +35 -0
- package/models/components/transferlineitemimagemetadata.d.ts.map +1 -0
- package/models/components/transferlineitemimagemetadata.js +64 -0
- package/models/components/transferlineitemimagemetadata.js.map +1 -0
- package/models/components/transferlineitemoption.d.ts +6 -0
- package/models/components/transferlineitemoption.d.ts.map +1 -1
- package/models/components/transferlineitemoption.js +3 -0
- package/models/components/transferlineitemoption.js.map +1 -1
- package/models/errors/connectaccountrequestvalidationerror.d.ts +33 -0
- package/models/errors/connectaccountrequestvalidationerror.d.ts.map +1 -0
- package/models/errors/connectaccountrequestvalidationerror.js +80 -0
- package/models/errors/connectaccountrequestvalidationerror.js.map +1 -0
- 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/transfervalidationerror.d.ts +3 -3
- package/models/errors/transfervalidationerror.d.ts.map +1 -1
- package/models/errors/transfervalidationerror.js +3 -3
- package/models/errors/transfervalidationerror.js.map +1 -1
- package/models/operations/connectaccount.d.ts +64 -0
- package/models/operations/connectaccount.d.ts.map +1 -0
- package/models/operations/connectaccount.js +118 -0
- package/models/operations/connectaccount.js.map +1 -0
- package/models/operations/index.d.ts +2 -0
- package/models/operations/index.d.ts.map +1 -1
- package/models/operations/index.js +2 -0
- package/models/operations/index.js.map +1 -1
- package/models/operations/listconnectedaccountsforaccount.d.ts +130 -0
- package/models/operations/listconnectedaccountsforaccount.d.ts.map +1 -0
- package/models/operations/listconnectedaccountsforaccount.js +130 -0
- package/models/operations/listconnectedaccountsforaccount.js.map +1 -0
- package/package.json +2 -2
- package/sdk/accounts.d.ts +16 -0
- package/sdk/accounts.d.ts.map +1 -1
- package/sdk/accounts.js +22 -0
- package/sdk/accounts.js.map +1 -1
- package/src/funcs/accountsConnect.ts +200 -0
- package/src/funcs/accountsListConnected.ts +202 -0
- package/src/funcs/invoicesMarkPaidInvoice.ts +1 -1
- package/src/lib/config.ts +3 -3
- package/src/mcp-server/mcp-server.ts +1 -1
- package/src/mcp-server/prompts.ts +7 -3
- package/src/mcp-server/resources.ts +7 -3
- package/src/mcp-server/server.ts +5 -1
- package/src/mcp-server/tools/accountsConnect.ts +35 -0
- package/src/mcp-server/tools/accountsListConnected.ts +42 -0
- package/src/mcp-server/tools.ts +7 -3
- package/src/models/components/createtransfer.ts +10 -10
- package/src/models/components/createtransferlineitem.ts +104 -0
- package/src/models/components/createtransferlineitemoption.ts +93 -0
- package/src/models/components/createtransferlineitemoptionvalidationerror.ts +84 -0
- package/src/models/components/createtransferlineitems.ts +66 -0
- package/src/models/components/createtransferlineitemsvalidationerror.ts +65 -0
- package/src/models/components/createtransferlineitemvalidationerror.ts +92 -0
- package/src/models/components/index.ts +8 -3
- package/src/models/components/sharescopes.ts +65 -0
- package/src/models/components/transferlineitem.ts +13 -0
- package/src/models/components/transferlineitemimagemetadata.ts +77 -0
- package/src/models/components/transferlineitemoption.ts +13 -0
- package/src/models/errors/connectaccountrequestvalidationerror.ts +74 -0
- package/src/models/errors/index.ts +1 -0
- package/src/models/errors/transfervalidationerror.ts +8 -6
- package/src/models/operations/connectaccount.ts +181 -0
- package/src/models/operations/index.ts +2 -0
- package/src/models/operations/listconnectedaccountsforaccount.ts +276 -0
- package/src/sdk/accounts.ts +38 -0
- package/models/components/transferlineitemoptionvalidationerror.d.ts +0 -24
- package/models/components/transferlineitemoptionvalidationerror.d.ts.map +0 -1
- package/models/components/transferlineitemoptionvalidationerror.js.map +0 -1
- package/models/components/transferlineitemsvalidationerror.d.ts +0 -22
- package/models/components/transferlineitemsvalidationerror.d.ts.map +0 -1
- package/models/components/transferlineitemsvalidationerror.js.map +0 -1
- package/models/components/transferlineitemvalidationerror.d.ts +0 -31
- package/models/components/transferlineitemvalidationerror.d.ts.map +0 -1
- package/models/components/transferlineitemvalidationerror.js.map +0 -1
- package/src/models/components/transferlineitemoptionvalidationerror.ts +0 -72
- package/src/models/components/transferlineitemsvalidationerror.ts +0 -59
- package/src/models/components/transferlineitemvalidationerror.ts +0 -85
|
@@ -0,0 +1,200 @@
|
|
|
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
|
+
* Shares access scopes from the account specified to the caller, establishing a connection
|
|
30
|
+
* between the two accounts with the specified permissions.
|
|
31
|
+
*/
|
|
32
|
+
export function accountsConnect(
|
|
33
|
+
client: MoovCore,
|
|
34
|
+
request: operations.ConnectAccountRequest,
|
|
35
|
+
options?: RequestOptions,
|
|
36
|
+
): APIPromise<
|
|
37
|
+
Result<
|
|
38
|
+
operations.ConnectAccountResponse | undefined,
|
|
39
|
+
| errors.GenericError
|
|
40
|
+
| errors.ConnectAccountRequestValidationError
|
|
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.ConnectAccountRequest,
|
|
61
|
+
options?: RequestOptions,
|
|
62
|
+
): Promise<
|
|
63
|
+
[
|
|
64
|
+
Result<
|
|
65
|
+
operations.ConnectAccountResponse | undefined,
|
|
66
|
+
| errors.GenericError
|
|
67
|
+
| errors.ConnectAccountRequestValidationError
|
|
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) => operations.ConnectAccountRequest$outboundSchema.parse(value),
|
|
83
|
+
"Input validation failed",
|
|
84
|
+
);
|
|
85
|
+
if (!parsed.ok) {
|
|
86
|
+
return [parsed, { status: "invalid" }];
|
|
87
|
+
}
|
|
88
|
+
const payload = parsed.value;
|
|
89
|
+
const body = encodeJSON("body", payload.ShareScopes, { explode: true });
|
|
90
|
+
|
|
91
|
+
const pathParams = {
|
|
92
|
+
accountID: encodeSimple("accountID", payload.accountID, {
|
|
93
|
+
explode: false,
|
|
94
|
+
charEncoding: "percent",
|
|
95
|
+
}),
|
|
96
|
+
};
|
|
97
|
+
|
|
98
|
+
const path = pathToFunc("/accounts/{accountID}/connections")(pathParams);
|
|
99
|
+
|
|
100
|
+
const headers = new Headers(compactMap({
|
|
101
|
+
"Content-Type": "application/json",
|
|
102
|
+
Accept: "application/json",
|
|
103
|
+
"X-Moov-Version": encodeSimple(
|
|
104
|
+
"X-Moov-Version",
|
|
105
|
+
client._options.xMoovVersion,
|
|
106
|
+
{ explode: false, charEncoding: "none" },
|
|
107
|
+
),
|
|
108
|
+
}));
|
|
109
|
+
|
|
110
|
+
const securityInput = await extractSecurity(client._options.security);
|
|
111
|
+
const requestSecurity = resolveGlobalSecurity(securityInput);
|
|
112
|
+
|
|
113
|
+
const context = {
|
|
114
|
+
options: client._options,
|
|
115
|
+
baseURL: options?.serverURL ?? client._baseURL ?? "",
|
|
116
|
+
operationID: "connectAccount",
|
|
117
|
+
oAuth2Scopes: null,
|
|
118
|
+
|
|
119
|
+
resolvedSecurity: requestSecurity,
|
|
120
|
+
|
|
121
|
+
securitySource: client._options.security,
|
|
122
|
+
retryConfig: options?.retries
|
|
123
|
+
|| client._options.retryConfig
|
|
124
|
+
|| { strategy: "none" },
|
|
125
|
+
retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
|
|
126
|
+
};
|
|
127
|
+
|
|
128
|
+
const requestRes = client._createRequest(context, {
|
|
129
|
+
security: requestSecurity,
|
|
130
|
+
method: "POST",
|
|
131
|
+
baseURL: options?.serverURL,
|
|
132
|
+
path: path,
|
|
133
|
+
headers: headers,
|
|
134
|
+
body: body,
|
|
135
|
+
userAgent: client._options.userAgent,
|
|
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: [
|
|
146
|
+
"400",
|
|
147
|
+
"401",
|
|
148
|
+
"403",
|
|
149
|
+
"404",
|
|
150
|
+
"409",
|
|
151
|
+
"422",
|
|
152
|
+
"429",
|
|
153
|
+
"4XX",
|
|
154
|
+
"500",
|
|
155
|
+
"504",
|
|
156
|
+
"5XX",
|
|
157
|
+
],
|
|
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.ConnectAccountResponse | undefined,
|
|
172
|
+
| errors.GenericError
|
|
173
|
+
| errors.ConnectAccountRequestValidationError
|
|
174
|
+
| MoovError
|
|
175
|
+
| ResponseValidationError
|
|
176
|
+
| ConnectionError
|
|
177
|
+
| RequestAbortedError
|
|
178
|
+
| RequestTimeoutError
|
|
179
|
+
| InvalidRequestError
|
|
180
|
+
| UnexpectedClientError
|
|
181
|
+
| SDKValidationError
|
|
182
|
+
>(
|
|
183
|
+
M.nil(201, operations.ConnectAccountResponse$inboundSchema.optional(), {
|
|
184
|
+
hdrs: true,
|
|
185
|
+
}),
|
|
186
|
+
M.jsonErr([400, 409], errors.GenericError$inboundSchema, { hdrs: true }),
|
|
187
|
+
M.jsonErr(422, errors.ConnectAccountRequestValidationError$inboundSchema, {
|
|
188
|
+
hdrs: true,
|
|
189
|
+
}),
|
|
190
|
+
M.fail([401, 403, 404, 429]),
|
|
191
|
+
M.fail([500, 504]),
|
|
192
|
+
M.fail("4XX"),
|
|
193
|
+
M.fail("5XX"),
|
|
194
|
+
)(response, req, { extraFields: responseFields });
|
|
195
|
+
if (!result.ok) {
|
|
196
|
+
return [result, { status: "complete", request: req, response }];
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
return [result, { status: "complete", request: req, response }];
|
|
200
|
+
}
|
|
@@ -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 { 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 {
|
|
14
|
+
ConnectionError,
|
|
15
|
+
InvalidRequestError,
|
|
16
|
+
RequestAbortedError,
|
|
17
|
+
RequestTimeoutError,
|
|
18
|
+
UnexpectedClientError,
|
|
19
|
+
} from "../models/errors/httpclienterrors.js";
|
|
20
|
+
import { MoovError } from "../models/errors/mooverror.js";
|
|
21
|
+
import { ResponseValidationError } from "../models/errors/responsevalidationerror.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
|
+
* List or search accounts to which the caller is connected.
|
|
29
|
+
*
|
|
30
|
+
* All supported query parameters are optional. If none are provided the response will include all connected accounts.
|
|
31
|
+
* Pagination is supported via the `skip` and `count` query parameters. Searching by name and email will overlap and
|
|
32
|
+
* return results based on relevance. Accounts with AccountType `guest` will not be included in the response.
|
|
33
|
+
*
|
|
34
|
+
* To access this endpoint using an [access token](https://docs.moov.io/api/authentication/access-tokens/) you'll need
|
|
35
|
+
* to specify the `/accounts.read` scope.
|
|
36
|
+
*/
|
|
37
|
+
export function accountsListConnected(
|
|
38
|
+
client: MoovCore,
|
|
39
|
+
request: operations.ListConnectedAccountsForAccountRequest,
|
|
40
|
+
options?: RequestOptions,
|
|
41
|
+
): APIPromise<
|
|
42
|
+
Result<
|
|
43
|
+
operations.ListConnectedAccountsForAccountResponse,
|
|
44
|
+
| MoovError
|
|
45
|
+
| ResponseValidationError
|
|
46
|
+
| ConnectionError
|
|
47
|
+
| RequestAbortedError
|
|
48
|
+
| RequestTimeoutError
|
|
49
|
+
| InvalidRequestError
|
|
50
|
+
| UnexpectedClientError
|
|
51
|
+
| SDKValidationError
|
|
52
|
+
>
|
|
53
|
+
> {
|
|
54
|
+
return new APIPromise($do(
|
|
55
|
+
client,
|
|
56
|
+
request,
|
|
57
|
+
options,
|
|
58
|
+
));
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
async function $do(
|
|
62
|
+
client: MoovCore,
|
|
63
|
+
request: operations.ListConnectedAccountsForAccountRequest,
|
|
64
|
+
options?: RequestOptions,
|
|
65
|
+
): Promise<
|
|
66
|
+
[
|
|
67
|
+
Result<
|
|
68
|
+
operations.ListConnectedAccountsForAccountResponse,
|
|
69
|
+
| MoovError
|
|
70
|
+
| ResponseValidationError
|
|
71
|
+
| ConnectionError
|
|
72
|
+
| RequestAbortedError
|
|
73
|
+
| RequestTimeoutError
|
|
74
|
+
| InvalidRequestError
|
|
75
|
+
| UnexpectedClientError
|
|
76
|
+
| SDKValidationError
|
|
77
|
+
>,
|
|
78
|
+
APICall,
|
|
79
|
+
]
|
|
80
|
+
> {
|
|
81
|
+
const parsed = safeParse(
|
|
82
|
+
request,
|
|
83
|
+
(value) =>
|
|
84
|
+
operations.ListConnectedAccountsForAccountRequest$outboundSchema.parse(
|
|
85
|
+
value,
|
|
86
|
+
),
|
|
87
|
+
"Input validation failed",
|
|
88
|
+
);
|
|
89
|
+
if (!parsed.ok) {
|
|
90
|
+
return [parsed, { status: "invalid" }];
|
|
91
|
+
}
|
|
92
|
+
const payload = parsed.value;
|
|
93
|
+
const body = null;
|
|
94
|
+
|
|
95
|
+
const pathParams = {
|
|
96
|
+
accountID: encodeSimple("accountID", payload.accountID, {
|
|
97
|
+
explode: false,
|
|
98
|
+
charEncoding: "percent",
|
|
99
|
+
}),
|
|
100
|
+
};
|
|
101
|
+
|
|
102
|
+
const path = pathToFunc("/accounts/{accountID}/connected-accounts")(
|
|
103
|
+
pathParams,
|
|
104
|
+
);
|
|
105
|
+
|
|
106
|
+
const query = encodeFormQuery({
|
|
107
|
+
"capability": payload.capability,
|
|
108
|
+
"capabilityStatus": payload.capabilityStatus,
|
|
109
|
+
"count": payload.count,
|
|
110
|
+
"email": payload.email,
|
|
111
|
+
"foreignID": payload.foreignID,
|
|
112
|
+
"includeDisconnected": payload.includeDisconnected,
|
|
113
|
+
"name": payload.name,
|
|
114
|
+
"skip": payload.skip,
|
|
115
|
+
"type": payload.type,
|
|
116
|
+
}, { explode: false });
|
|
117
|
+
|
|
118
|
+
const headers = new Headers(compactMap({
|
|
119
|
+
Accept: "application/json",
|
|
120
|
+
"X-Moov-Version": encodeSimple(
|
|
121
|
+
"X-Moov-Version",
|
|
122
|
+
client._options.xMoovVersion,
|
|
123
|
+
{ explode: false, charEncoding: "none" },
|
|
124
|
+
),
|
|
125
|
+
}));
|
|
126
|
+
|
|
127
|
+
const securityInput = await extractSecurity(client._options.security);
|
|
128
|
+
const requestSecurity = resolveGlobalSecurity(securityInput);
|
|
129
|
+
|
|
130
|
+
const context = {
|
|
131
|
+
options: client._options,
|
|
132
|
+
baseURL: options?.serverURL ?? client._baseURL ?? "",
|
|
133
|
+
operationID: "listConnectedAccountsForAccount",
|
|
134
|
+
oAuth2Scopes: null,
|
|
135
|
+
|
|
136
|
+
resolvedSecurity: requestSecurity,
|
|
137
|
+
|
|
138
|
+
securitySource: client._options.security,
|
|
139
|
+
retryConfig: options?.retries
|
|
140
|
+
|| client._options.retryConfig
|
|
141
|
+
|| { strategy: "none" },
|
|
142
|
+
retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
|
|
143
|
+
};
|
|
144
|
+
|
|
145
|
+
const requestRes = client._createRequest(context, {
|
|
146
|
+
security: requestSecurity,
|
|
147
|
+
method: "GET",
|
|
148
|
+
baseURL: options?.serverURL,
|
|
149
|
+
path: path,
|
|
150
|
+
headers: headers,
|
|
151
|
+
query: query,
|
|
152
|
+
body: body,
|
|
153
|
+
userAgent: client._options.userAgent,
|
|
154
|
+
timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
|
|
155
|
+
}, options);
|
|
156
|
+
if (!requestRes.ok) {
|
|
157
|
+
return [requestRes, { status: "invalid" }];
|
|
158
|
+
}
|
|
159
|
+
const req = requestRes.value;
|
|
160
|
+
|
|
161
|
+
const doResult = await client._do(req, {
|
|
162
|
+
context,
|
|
163
|
+
errorCodes: ["401", "403", "429", "4XX", "500", "504", "5XX"],
|
|
164
|
+
retryConfig: context.retryConfig,
|
|
165
|
+
retryCodes: context.retryCodes,
|
|
166
|
+
});
|
|
167
|
+
if (!doResult.ok) {
|
|
168
|
+
return [doResult, { status: "request-error", request: req }];
|
|
169
|
+
}
|
|
170
|
+
const response = doResult.value;
|
|
171
|
+
|
|
172
|
+
const responseFields = {
|
|
173
|
+
HttpMeta: { Response: response, Request: req },
|
|
174
|
+
};
|
|
175
|
+
|
|
176
|
+
const [result] = await M.match<
|
|
177
|
+
operations.ListConnectedAccountsForAccountResponse,
|
|
178
|
+
| MoovError
|
|
179
|
+
| ResponseValidationError
|
|
180
|
+
| ConnectionError
|
|
181
|
+
| RequestAbortedError
|
|
182
|
+
| RequestTimeoutError
|
|
183
|
+
| InvalidRequestError
|
|
184
|
+
| UnexpectedClientError
|
|
185
|
+
| SDKValidationError
|
|
186
|
+
>(
|
|
187
|
+
M.json(
|
|
188
|
+
200,
|
|
189
|
+
operations.ListConnectedAccountsForAccountResponse$inboundSchema,
|
|
190
|
+
{ hdrs: true, key: "Result" },
|
|
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.22.
|
|
77
|
-
genVersion: "2.788.
|
|
78
|
-
userAgent: "speakeasy-sdk/typescript 0.22.
|
|
76
|
+
sdkVersion: "0.22.9",
|
|
77
|
+
genVersion: "2.788.5",
|
|
78
|
+
userAgent: "speakeasy-sdk/typescript 0.22.9 2.788.5 latest @moovio/sdk",
|
|
79
79
|
} as const;
|
|
@@ -4,7 +4,11 @@
|
|
|
4
4
|
|
|
5
5
|
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
6
6
|
import { RequestHandlerExtra } from "@modelcontextprotocol/sdk/shared/protocol.js";
|
|
7
|
-
import {
|
|
7
|
+
import {
|
|
8
|
+
GetPromptResult,
|
|
9
|
+
ServerNotification,
|
|
10
|
+
ServerRequest,
|
|
11
|
+
} from "@modelcontextprotocol/sdk/types.js";
|
|
8
12
|
import {
|
|
9
13
|
objectOutputType,
|
|
10
14
|
ZodOptional,
|
|
@@ -33,7 +37,7 @@ export type PromptDefinition<
|
|
|
33
37
|
prompt: (
|
|
34
38
|
client: MoovCore,
|
|
35
39
|
args: objectOutputType<Args, ZodTypeAny>,
|
|
36
|
-
extra: RequestHandlerExtra,
|
|
40
|
+
extra: RequestHandlerExtra<ServerRequest, ServerNotification>,
|
|
37
41
|
) => GetPromptResult | Promise<GetPromptResult>;
|
|
38
42
|
}
|
|
39
43
|
: {
|
|
@@ -43,7 +47,7 @@ export type PromptDefinition<
|
|
|
43
47
|
args?: undefined;
|
|
44
48
|
prompt: (
|
|
45
49
|
client: MoovCore,
|
|
46
|
-
extra: RequestHandlerExtra,
|
|
50
|
+
extra: RequestHandlerExtra<ServerRequest, ServerNotification>,
|
|
47
51
|
) => GetPromptResult | Promise<GetPromptResult>;
|
|
48
52
|
};
|
|
49
53
|
|
|
@@ -9,7 +9,11 @@ import {
|
|
|
9
9
|
} from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
10
10
|
import { RequestHandlerExtra } from "@modelcontextprotocol/sdk/shared/protocol.js";
|
|
11
11
|
import { Variables } from "@modelcontextprotocol/sdk/shared/uriTemplate.js";
|
|
12
|
-
import {
|
|
12
|
+
import {
|
|
13
|
+
ReadResourceResult,
|
|
14
|
+
ServerNotification,
|
|
15
|
+
ServerRequest,
|
|
16
|
+
} from "@modelcontextprotocol/sdk/types.js";
|
|
13
17
|
import { MoovCore } from "../core.js";
|
|
14
18
|
import { ConsoleLogger } from "./console-logger.js";
|
|
15
19
|
import { MCPScope } from "./scopes.js";
|
|
@@ -18,7 +22,7 @@ import { isAsyncIterable, isBinaryData, valueToBase64 } from "./shared.js";
|
|
|
18
22
|
export type ReadResourceCallback = (
|
|
19
23
|
client: MoovCore,
|
|
20
24
|
uri: URL,
|
|
21
|
-
extra: RequestHandlerExtra,
|
|
25
|
+
extra: RequestHandlerExtra<ServerRequest, ServerNotification>,
|
|
22
26
|
) => ReadResourceResult | Promise<ReadResourceResult>;
|
|
23
27
|
|
|
24
28
|
export type ResourceDefinition = {
|
|
@@ -34,7 +38,7 @@ export type ReadResourceTemplateCallback = (
|
|
|
34
38
|
client: MoovCore,
|
|
35
39
|
uri: URL,
|
|
36
40
|
vars: Variables,
|
|
37
|
-
extra: RequestHandlerExtra,
|
|
41
|
+
extra: RequestHandlerExtra<ServerRequest, ServerNotification>,
|
|
38
42
|
) => ReadResourceResult | Promise<ReadResourceResult>;
|
|
39
43
|
|
|
40
44
|
export type ResourceTemplateDefinition = {
|
package/src/mcp-server/server.ts
CHANGED
|
@@ -14,6 +14,7 @@ import {
|
|
|
14
14
|
import { MCPScope } from "./scopes.js";
|
|
15
15
|
import { createRegisterTool } from "./tools.js";
|
|
16
16
|
import { tool$accountsAssignCountries } from "./tools/accountsAssignCountries.js";
|
|
17
|
+
import { tool$accountsConnect } from "./tools/accountsConnect.js";
|
|
17
18
|
import { tool$accountsCreate } from "./tools/accountsCreate.js";
|
|
18
19
|
import { tool$accountsDisconnect } from "./tools/accountsDisconnect.js";
|
|
19
20
|
import { tool$accountsGet } from "./tools/accountsGet.js";
|
|
@@ -21,6 +22,7 @@ import { tool$accountsGetCountries } from "./tools/accountsGetCountries.js";
|
|
|
21
22
|
import { tool$accountsGetMerchantProcessingAgreement } from "./tools/accountsGetMerchantProcessingAgreement.js";
|
|
22
23
|
import { tool$accountsGetTermsOfServiceToken } from "./tools/accountsGetTermsOfServiceToken.js";
|
|
23
24
|
import { tool$accountsList } from "./tools/accountsList.js";
|
|
25
|
+
import { tool$accountsListConnected } from "./tools/accountsListConnected.js";
|
|
24
26
|
import { tool$accountsUpdate } from "./tools/accountsUpdate.js";
|
|
25
27
|
import { tool$accountTerminalApplicationsGet } from "./tools/accountTerminalApplicationsGet.js";
|
|
26
28
|
import { tool$accountTerminalApplicationsGetConfiguration } from "./tools/accountTerminalApplicationsGetConfiguration.js";
|
|
@@ -192,7 +194,7 @@ export function createMCPServer(deps: {
|
|
|
192
194
|
}) {
|
|
193
195
|
const server = new McpServer({
|
|
194
196
|
name: "Moov",
|
|
195
|
-
version: "0.22.
|
|
197
|
+
version: "0.22.9",
|
|
196
198
|
});
|
|
197
199
|
|
|
198
200
|
const client = new MoovCore({
|
|
@@ -228,6 +230,8 @@ export function createMCPServer(deps: {
|
|
|
228
230
|
tool(tool$accountsGet);
|
|
229
231
|
tool(tool$accountsUpdate);
|
|
230
232
|
tool(tool$accountsDisconnect);
|
|
233
|
+
tool(tool$accountsListConnected);
|
|
234
|
+
tool(tool$accountsConnect);
|
|
231
235
|
tool(tool$accountsGetCountries);
|
|
232
236
|
tool(tool$accountsAssignCountries);
|
|
233
237
|
tool(tool$accountsGetMerchantProcessingAgreement);
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import { accountsConnect } from "../../funcs/accountsConnect.js";
|
|
6
|
+
import * as operations from "../../models/operations/index.js";
|
|
7
|
+
import { formatResult, ToolDefinition } from "../tools.js";
|
|
8
|
+
|
|
9
|
+
const args = {
|
|
10
|
+
request: operations.ConnectAccountRequest$inboundSchema,
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
export const tool$accountsConnect: ToolDefinition<typeof args> = {
|
|
14
|
+
name: "accounts-connect",
|
|
15
|
+
description:
|
|
16
|
+
`Shares access scopes from the account specified to the caller, establishing a connection
|
|
17
|
+
between the two accounts with the specified permissions.`,
|
|
18
|
+
args,
|
|
19
|
+
tool: async (client, args, ctx) => {
|
|
20
|
+
const [result, apiCall] = await accountsConnect(
|
|
21
|
+
client,
|
|
22
|
+
args.request,
|
|
23
|
+
{ fetchOptions: { signal: ctx.signal } },
|
|
24
|
+
).$inspect();
|
|
25
|
+
|
|
26
|
+
if (!result.ok) {
|
|
27
|
+
return {
|
|
28
|
+
content: [{ type: "text", text: result.error.message }],
|
|
29
|
+
isError: true,
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
return formatResult(void 0, apiCall);
|
|
34
|
+
},
|
|
35
|
+
};
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import { accountsListConnected } from "../../funcs/accountsListConnected.js";
|
|
6
|
+
import * as operations from "../../models/operations/index.js";
|
|
7
|
+
import { formatResult, ToolDefinition } from "../tools.js";
|
|
8
|
+
|
|
9
|
+
const args = {
|
|
10
|
+
request: operations.ListConnectedAccountsForAccountRequest$inboundSchema,
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
export const tool$accountsListConnected: ToolDefinition<typeof args> = {
|
|
14
|
+
name: "accounts-list-connected",
|
|
15
|
+
description: `List or search accounts to which the caller is connected.
|
|
16
|
+
|
|
17
|
+
All supported query parameters are optional. If none are provided the response will include all connected accounts.
|
|
18
|
+
Pagination is supported via the \`skip\` and \`count\` query parameters. Searching by name and email will overlap and
|
|
19
|
+
return results based on relevance. Accounts with AccountType \`guest\` will not be included in the response.
|
|
20
|
+
|
|
21
|
+
To access this endpoint using an [access token](https://docs.moov.io/api/authentication/access-tokens/) you'll need
|
|
22
|
+
to specify the \`/accounts.read\` scope.`,
|
|
23
|
+
args,
|
|
24
|
+
tool: async (client, args, ctx) => {
|
|
25
|
+
const [result, apiCall] = await accountsListConnected(
|
|
26
|
+
client,
|
|
27
|
+
args.request,
|
|
28
|
+
{ fetchOptions: { signal: ctx.signal } },
|
|
29
|
+
).$inspect();
|
|
30
|
+
|
|
31
|
+
if (!result.ok) {
|
|
32
|
+
return {
|
|
33
|
+
content: [{ type: "text", text: result.error.message }],
|
|
34
|
+
isError: true,
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
const value = result.value.result;
|
|
39
|
+
|
|
40
|
+
return formatResult(value, apiCall);
|
|
41
|
+
},
|
|
42
|
+
};
|
package/src/mcp-server/tools.ts
CHANGED
|
@@ -4,7 +4,11 @@
|
|
|
4
4
|
|
|
5
5
|
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
6
6
|
import { RequestHandlerExtra } from "@modelcontextprotocol/sdk/shared/protocol.js";
|
|
7
|
-
import {
|
|
7
|
+
import {
|
|
8
|
+
CallToolResult,
|
|
9
|
+
ServerNotification,
|
|
10
|
+
ServerRequest,
|
|
11
|
+
} from "@modelcontextprotocol/sdk/types.js";
|
|
8
12
|
import { objectOutputType, ZodRawShape, ZodTypeAny } from "zod/v3";
|
|
9
13
|
import { MoovCore } from "../core.js";
|
|
10
14
|
import { ConsoleLogger } from "./console-logger.js";
|
|
@@ -20,7 +24,7 @@ export type ToolDefinition<Args extends undefined | ZodRawShape = undefined> =
|
|
|
20
24
|
tool: (
|
|
21
25
|
client: MoovCore,
|
|
22
26
|
args: objectOutputType<Args, ZodTypeAny>,
|
|
23
|
-
extra: RequestHandlerExtra,
|
|
27
|
+
extra: RequestHandlerExtra<ServerRequest, ServerNotification>,
|
|
24
28
|
) => CallToolResult | Promise<CallToolResult>;
|
|
25
29
|
}
|
|
26
30
|
: {
|
|
@@ -30,7 +34,7 @@ export type ToolDefinition<Args extends undefined | ZodRawShape = undefined> =
|
|
|
30
34
|
args?: undefined;
|
|
31
35
|
tool: (
|
|
32
36
|
client: MoovCore,
|
|
33
|
-
extra: RequestHandlerExtra,
|
|
37
|
+
extra: RequestHandlerExtra<ServerRequest, ServerNotification>,
|
|
34
38
|
) => CallToolResult | Promise<CallToolResult>;
|
|
35
39
|
};
|
|
36
40
|
|