@moovio/sdk 0.22.7 → 0.22.8

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 (89) hide show
  1. package/README.md +72 -51
  2. package/_speakeasy/.github/action-inputs-config.json +53 -0
  3. package/_speakeasy/.github/action-security-config.json +88 -0
  4. package/bin/mcp-server.js +40683 -21874
  5. package/bin/mcp-server.js.map +212 -37
  6. package/examples/package-lock.json +2 -2
  7. package/funcs/accountsConnect.d.ts +16 -0
  8. package/funcs/accountsConnect.d.ts.map +1 -0
  9. package/funcs/accountsConnect.js +138 -0
  10. package/funcs/accountsConnect.js.map +1 -0
  11. package/funcs/accountsListConnected.d.ts +21 -0
  12. package/funcs/accountsListConnected.d.ts.map +1 -0
  13. package/funcs/accountsListConnected.js +138 -0
  14. package/funcs/accountsListConnected.js.map +1 -0
  15. package/jsr.json +1 -1
  16. package/lib/config.d.ts +3 -3
  17. package/lib/config.js +3 -3
  18. package/mcp-server/mcp-server.js +1 -1
  19. package/mcp-server/prompts.d.ts +3 -3
  20. package/mcp-server/prompts.d.ts.map +1 -1
  21. package/mcp-server/prompts.js.map +1 -1
  22. package/mcp-server/resources.d.ts +3 -3
  23. package/mcp-server/resources.d.ts.map +1 -1
  24. package/mcp-server/resources.js.map +1 -1
  25. package/mcp-server/server.d.ts.map +1 -1
  26. package/mcp-server/server.js +5 -1
  27. package/mcp-server/server.js.map +1 -1
  28. package/mcp-server/tools/accountsConnect.d.ts +8 -0
  29. package/mcp-server/tools/accountsConnect.d.ts.map +1 -0
  30. package/mcp-server/tools/accountsConnect.js +62 -0
  31. package/mcp-server/tools/accountsConnect.js.map +1 -0
  32. package/mcp-server/tools/accountsListConnected.d.ts +8 -0
  33. package/mcp-server/tools/accountsListConnected.d.ts.map +1 -0
  34. package/mcp-server/tools/accountsListConnected.js +69 -0
  35. package/mcp-server/tools/accountsListConnected.js.map +1 -0
  36. package/mcp-server/tools.d.ts +3 -3
  37. package/mcp-server/tools.d.ts.map +1 -1
  38. package/mcp-server/tools.js.map +1 -1
  39. package/models/components/index.d.ts +1 -0
  40. package/models/components/index.d.ts.map +1 -1
  41. package/models/components/index.js +1 -0
  42. package/models/components/index.js.map +1 -1
  43. package/models/components/sharescopes.d.ts +29 -0
  44. package/models/components/sharescopes.d.ts.map +1 -0
  45. package/models/components/sharescopes.js +61 -0
  46. package/models/components/sharescopes.js.map +1 -0
  47. package/models/errors/connectaccountrequestvalidationerror.d.ts +33 -0
  48. package/models/errors/connectaccountrequestvalidationerror.d.ts.map +1 -0
  49. package/models/errors/connectaccountrequestvalidationerror.js +80 -0
  50. package/models/errors/connectaccountrequestvalidationerror.js.map +1 -0
  51. package/models/errors/index.d.ts +1 -0
  52. package/models/errors/index.d.ts.map +1 -1
  53. package/models/errors/index.js +1 -0
  54. package/models/errors/index.js.map +1 -1
  55. package/models/operations/connectaccount.d.ts +64 -0
  56. package/models/operations/connectaccount.d.ts.map +1 -0
  57. package/models/operations/connectaccount.js +118 -0
  58. package/models/operations/connectaccount.js.map +1 -0
  59. package/models/operations/index.d.ts +2 -0
  60. package/models/operations/index.d.ts.map +1 -1
  61. package/models/operations/index.js +2 -0
  62. package/models/operations/index.js.map +1 -1
  63. package/models/operations/listconnectedaccountsforaccount.d.ts +130 -0
  64. package/models/operations/listconnectedaccountsforaccount.d.ts.map +1 -0
  65. package/models/operations/listconnectedaccountsforaccount.js +130 -0
  66. package/models/operations/listconnectedaccountsforaccount.js.map +1 -0
  67. package/package.json +2 -2
  68. package/sdk/accounts.d.ts +16 -0
  69. package/sdk/accounts.d.ts.map +1 -1
  70. package/sdk/accounts.js +22 -0
  71. package/sdk/accounts.js.map +1 -1
  72. package/src/funcs/accountsConnect.ts +200 -0
  73. package/src/funcs/accountsListConnected.ts +202 -0
  74. package/src/lib/config.ts +3 -3
  75. package/src/mcp-server/mcp-server.ts +1 -1
  76. package/src/mcp-server/prompts.ts +7 -3
  77. package/src/mcp-server/resources.ts +7 -3
  78. package/src/mcp-server/server.ts +5 -1
  79. package/src/mcp-server/tools/accountsConnect.ts +35 -0
  80. package/src/mcp-server/tools/accountsListConnected.ts +42 -0
  81. package/src/mcp-server/tools.ts +7 -3
  82. package/src/models/components/index.ts +1 -0
  83. package/src/models/components/sharescopes.ts +65 -0
  84. package/src/models/errors/connectaccountrequestvalidationerror.ts +74 -0
  85. package/src/models/errors/index.ts +1 -0
  86. package/src/models/operations/connectaccount.ts +181 -0
  87. package/src/models/operations/index.ts +2 -0
  88. package/src/models/operations/listconnectedaccountsforaccount.ts +276 -0
  89. package/src/sdk/accounts.ts +38 -0
@@ -1 +1 @@
1
- {"version":3,"file":"accounts.js","sourceRoot":"","sources":["../src/sdk/accounts.ts"],"names":[],"mappings":";AAAA;;GAEG;;;AAEH,oFAA8E;AAC9E,kEAA4D;AAC5D,0EAAoE;AACpE,4DAAsD;AACtD,8EAAwE;AACxE,kHAA4G;AAC5G,kGAA4F;AAC5F,8DAAwD;AACxD,kEAA4D;AAC5D,4CAA2D;AAG3D,0CAA6C;AAE7C,MAAa,QAAS,SAAQ,mBAAS;IACrC;;;;;;;;;;;;;;;;OAgBG;IACH,KAAK,CAAC,MAAM,CACV,OAAiC,EACjC,OAAwB;QAExB,OAAO,IAAA,mBAAW,EAAC,IAAA,kCAAc,EAC/B,IAAI,EACJ,OAAO,EACP,OAAO,CACR,CAAC,CAAC;IACL,CAAC;IAED;;;;;;;;;OASG;IACH,KAAK,CAAC,IAAI,CACR,OAAuC,EACvC,OAAwB;QAExB,OAAO,IAAA,mBAAW,EAAC,IAAA,8BAAY,EAC7B,IAAI,EACJ,OAAO,EACP,OAAO,CACR,CAAC,CAAC;IACL,CAAC;IAED;;;;;OAKG;IACH,KAAK,CAAC,GAAG,CACP,OAAqC,EACrC,OAAwB;QAExB,OAAO,IAAA,mBAAW,EAAC,IAAA,4BAAW,EAC5B,IAAI,EACJ,OAAO,EACP,OAAO,CACR,CAAC,CAAC;IACL,CAAC;IAED;;;;;;;;;;;;;OAaG;IACH,KAAK,CAAC,MAAM,CACV,OAAwC,EACxC,OAAwB;QAExB,OAAO,IAAA,mBAAW,EAAC,IAAA,kCAAc,EAC/B,IAAI,EACJ,OAAO,EACP,OAAO,CACR,CAAC,CAAC;IACL,CAAC;IAED;;;;;;;OAOG;IACH,KAAK,CAAC,UAAU,CACd,OAA4C,EAC5C,OAAwB;QAExB,OAAO,IAAA,mBAAW,EAAC,IAAA,0CAAkB,EACnC,IAAI,EACJ,OAAO,EACP,OAAO,CACR,CAAC,CAAC;IACL,CAAC;IAED;;;;;OAKG;IACH,KAAK,CAAC,YAAY,CAChB,OAA8C,EAC9C,OAAwB;QAExB,OAAO,IAAA,mBAAW,EAAC,IAAA,8CAAoB,EACrC,IAAI,EACJ,OAAO,EACP,OAAO,CACR,CAAC,CAAC;IACL,CAAC;IAED;;;;;;;OAOG;IACH,KAAK,CAAC,eAAe,CACnB,OAAiD,EACjD,OAAwB;QAExB,OAAO,IAAA,mBAAW,EAAC,IAAA,oDAAuB,EACxC,IAAI,EACJ,OAAO,EACP,OAAO,CACR,CAAC,CAAC;IACL,CAAC;IAED;;;;;OAKG;IACH,KAAK,CAAC,8BAA8B,CAClC,OAAyD,EACzD,OAAwB;QAExB,OAAO,IAAA,mBAAW,EAAC,IAAA,kFAAsC,EACvD,IAAI,EACJ,OAAO,EACP,OAAO,CACR,CAAC,CAAC;IACL,CAAC;IAED;;;;;;OAMG;IACH,KAAK,CAAC,sBAAsB,CAC1B,OAAiD,EACjD,OAAwB;QAExB,OAAO,IAAA,mBAAW,EAAC,IAAA,kEAA8B,EAC/C,IAAI,EACJ,OAAO,EACP,OAAO,CACR,CAAC,CAAC;IACL,CAAC;CACF;AArLD,4BAqLC"}
1
+ {"version":3,"file":"accounts.js","sourceRoot":"","sources":["../src/sdk/accounts.ts"],"names":[],"mappings":";AAAA;;GAEG;;;AAEH,oFAA8E;AAC9E,oEAA8D;AAC9D,kEAA4D;AAC5D,0EAAoE;AACpE,4DAAsD;AACtD,8EAAwE;AACxE,kHAA4G;AAC5G,kGAA4F;AAC5F,8DAAwD;AACxD,gFAA0E;AAC1E,kEAA4D;AAC5D,4CAA2D;AAG3D,0CAA6C;AAE7C,MAAa,QAAS,SAAQ,mBAAS;IACrC;;;;;;;;;;;;;;;;OAgBG;IACH,KAAK,CAAC,MAAM,CACV,OAAiC,EACjC,OAAwB;QAExB,OAAO,IAAA,mBAAW,EAAC,IAAA,kCAAc,EAC/B,IAAI,EACJ,OAAO,EACP,OAAO,CACR,CAAC,CAAC;IACL,CAAC;IAED;;;;;;;;;OASG;IACH,KAAK,CAAC,IAAI,CACR,OAAuC,EACvC,OAAwB;QAExB,OAAO,IAAA,mBAAW,EAAC,IAAA,8BAAY,EAC7B,IAAI,EACJ,OAAO,EACP,OAAO,CACR,CAAC,CAAC;IACL,CAAC;IAED;;;;;OAKG;IACH,KAAK,CAAC,GAAG,CACP,OAAqC,EACrC,OAAwB;QAExB,OAAO,IAAA,mBAAW,EAAC,IAAA,4BAAW,EAC5B,IAAI,EACJ,OAAO,EACP,OAAO,CACR,CAAC,CAAC;IACL,CAAC;IAED;;;;;;;;;;;;;OAaG;IACH,KAAK,CAAC,MAAM,CACV,OAAwC,EACxC,OAAwB;QAExB,OAAO,IAAA,mBAAW,EAAC,IAAA,kCAAc,EAC/B,IAAI,EACJ,OAAO,EACP,OAAO,CACR,CAAC,CAAC;IACL,CAAC;IAED;;;;;;;OAOG;IACH,KAAK,CAAC,UAAU,CACd,OAA4C,EAC5C,OAAwB;QAExB,OAAO,IAAA,mBAAW,EAAC,IAAA,0CAAkB,EACnC,IAAI,EACJ,OAAO,EACP,OAAO,CACR,CAAC,CAAC;IACL,CAAC;IAED;;;;;;;;;OASG;IACH,KAAK,CAAC,aAAa,CACjB,OAA0D,EAC1D,OAAwB;QAExB,OAAO,IAAA,mBAAW,EAAC,IAAA,gDAAqB,EACtC,IAAI,EACJ,OAAO,EACP,OAAO,CACR,CAAC,CAAC;IACL,CAAC;IAED;;;OAGG;IACH,KAAK,CAAC,OAAO,CACX,OAAyC,EACzC,OAAwB;QAExB,OAAO,IAAA,mBAAW,EAAC,IAAA,oCAAe,EAChC,IAAI,EACJ,OAAO,EACP,OAAO,CACR,CAAC,CAAC;IACL,CAAC;IAED;;;;;OAKG;IACH,KAAK,CAAC,YAAY,CAChB,OAA8C,EAC9C,OAAwB;QAExB,OAAO,IAAA,mBAAW,EAAC,IAAA,8CAAoB,EACrC,IAAI,EACJ,OAAO,EACP,OAAO,CACR,CAAC,CAAC;IACL,CAAC;IAED;;;;;;;OAOG;IACH,KAAK,CAAC,eAAe,CACnB,OAAiD,EACjD,OAAwB;QAExB,OAAO,IAAA,mBAAW,EAAC,IAAA,oDAAuB,EACxC,IAAI,EACJ,OAAO,EACP,OAAO,CACR,CAAC,CAAC;IACL,CAAC;IAED;;;;;OAKG;IACH,KAAK,CAAC,8BAA8B,CAClC,OAAyD,EACzD,OAAwB;QAExB,OAAO,IAAA,mBAAW,EAAC,IAAA,kFAAsC,EACvD,IAAI,EACJ,OAAO,EACP,OAAO,CACR,CAAC,CAAC;IACL,CAAC;IAED;;;;;;OAMG;IACH,KAAK,CAAC,sBAAsB,CAC1B,OAAiD,EACjD,OAAwB;QAExB,OAAO,IAAA,mBAAW,EAAC,IAAA,kEAA8B,EAC/C,IAAI,EACJ,OAAO,EACP,OAAO,CACR,CAAC,CAAC;IACL,CAAC;CACF;AAzND,4BAyNC"}
@@ -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.7",
77
- genVersion: "2.788.4",
78
- userAgent: "speakeasy-sdk/typescript 0.22.7 2.788.4 latest @moovio/sdk",
76
+ sdkVersion: "0.22.8",
77
+ genVersion: "2.788.5",
78
+ userAgent: "speakeasy-sdk/typescript 0.22.8 2.788.5 latest @moovio/sdk",
79
79
  } as const;
@@ -19,7 +19,7 @@ const routes = buildRouteMap({
19
19
  export const app = buildApplication(routes, {
20
20
  name: "mcp",
21
21
  versionInfo: {
22
- currentVersion: "0.22.7",
22
+ currentVersion: "0.22.8",
23
23
  },
24
24
  });
25
25
 
@@ -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 { GetPromptResult } from "@modelcontextprotocol/sdk/types.js";
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 { ReadResourceResult } from "@modelcontextprotocol/sdk/types.js";
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 = {
@@ -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.7",
197
+ version: "0.22.8",
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
+ };
@@ -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 { CallToolResult } from "@modelcontextprotocol/sdk/types.js";
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
 
@@ -419,6 +419,7 @@ export * from "./sendfundsrtp.js";
419
419
  export * from "./sendfundsrtperror.js";
420
420
  export * from "./sentreceipt.js";
421
421
  export * from "./settings.js";
422
+ export * from "./sharescopes.js";
422
423
  export * from "./sourcedestinationoptions.js";
423
424
  export * from "./statement.js";
424
425
  export * from "./submissionintent.js";