@moovio/sdk 0.0.0-dev.5 → 0.0.0-dev.7

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 (210) hide show
  1. package/README.md +115 -55
  2. package/bin/mcp-server.js +1792 -876
  3. package/bin/mcp-server.js.map +43 -27
  4. package/funcs/disputesUploadEvidenceFile.js +6 -0
  5. package/funcs/disputesUploadEvidenceFile.js.map +1 -1
  6. package/funcs/filesUpload.js +6 -0
  7. package/funcs/filesUpload.js.map +1 -1
  8. package/funcs/imagesUpdate.js +7 -0
  9. package/funcs/imagesUpdate.js.map +1 -1
  10. package/funcs/imagesUpload.js +7 -0
  11. package/funcs/imagesUpload.js.map +1 -1
  12. package/funcs/invoicesDelete.d.ts +24 -0
  13. package/funcs/invoicesDelete.d.ts.map +1 -0
  14. package/funcs/invoicesDelete.js +146 -0
  15. package/funcs/invoicesDelete.js.map +1 -0
  16. package/funcs/resolutionLinksCreate.d.ts +20 -0
  17. package/funcs/resolutionLinksCreate.d.ts.map +1 -0
  18. package/funcs/resolutionLinksCreate.js +145 -0
  19. package/funcs/resolutionLinksCreate.js.map +1 -0
  20. package/funcs/resolutionLinksDisable.d.ts +18 -0
  21. package/funcs/resolutionLinksDisable.d.ts.map +1 -0
  22. package/funcs/resolutionLinksDisable.js +135 -0
  23. package/funcs/resolutionLinksDisable.js.map +1 -0
  24. package/funcs/resolutionLinksGet.d.ts +17 -0
  25. package/funcs/resolutionLinksGet.d.ts.map +1 -0
  26. package/funcs/resolutionLinksGet.js +126 -0
  27. package/funcs/resolutionLinksGet.js.map +1 -0
  28. package/funcs/resolutionLinksList.d.ts +17 -0
  29. package/funcs/resolutionLinksList.d.ts.map +1 -0
  30. package/funcs/resolutionLinksList.js +125 -0
  31. package/funcs/resolutionLinksList.js.map +1 -0
  32. package/hooks/moov-version-hook.d.ts +3 -4
  33. package/hooks/moov-version-hook.d.ts.map +1 -1
  34. package/hooks/moov-version-hook.js +5 -4
  35. package/hooks/moov-version-hook.js.map +1 -1
  36. package/hooks/registration.js +1 -1
  37. package/hooks/registration.js.map +1 -1
  38. package/jsr.json +1 -1
  39. package/lib/config.d.ts +3 -3
  40. package/lib/config.js +3 -3
  41. package/lib/config.js.map +1 -1
  42. package/lib/matchers.d.ts.map +1 -1
  43. package/lib/matchers.js +0 -1
  44. package/lib/matchers.js.map +1 -1
  45. package/lib/security.d.ts.map +1 -1
  46. package/lib/security.js +1 -2
  47. package/lib/security.js.map +1 -1
  48. package/mcp-server/mcp-server.js +1 -1
  49. package/mcp-server/server.d.ts.map +1 -1
  50. package/mcp-server/server.js +11 -1
  51. package/mcp-server/server.js.map +1 -1
  52. package/mcp-server/shared.js +1 -1
  53. package/mcp-server/shared.js.map +1 -1
  54. package/mcp-server/tools/invoicesDelete.d.ts +8 -0
  55. package/mcp-server/tools/invoicesDelete.d.ts.map +1 -0
  56. package/mcp-server/tools/invoicesDelete.js +70 -0
  57. package/mcp-server/tools/invoicesDelete.js.map +1 -0
  58. package/mcp-server/tools/resolutionLinksCreate.d.ts +8 -0
  59. package/mcp-server/tools/resolutionLinksCreate.d.ts.map +1 -0
  60. package/mcp-server/tools/resolutionLinksCreate.js +67 -0
  61. package/mcp-server/tools/resolutionLinksCreate.js.map +1 -0
  62. package/mcp-server/tools/resolutionLinksDisable.d.ts +8 -0
  63. package/mcp-server/tools/resolutionLinksDisable.d.ts.map +1 -0
  64. package/mcp-server/tools/resolutionLinksDisable.js +64 -0
  65. package/mcp-server/tools/resolutionLinksDisable.js.map +1 -0
  66. package/mcp-server/tools/resolutionLinksGet.d.ts +8 -0
  67. package/mcp-server/tools/resolutionLinksGet.d.ts.map +1 -0
  68. package/mcp-server/tools/resolutionLinksGet.js +65 -0
  69. package/mcp-server/tools/resolutionLinksGet.js.map +1 -0
  70. package/mcp-server/tools/resolutionLinksList.d.ts +8 -0
  71. package/mcp-server/tools/resolutionLinksList.d.ts.map +1 -0
  72. package/mcp-server/tools/resolutionLinksList.js +65 -0
  73. package/mcp-server/tools/resolutionLinksList.js.map +1 -0
  74. package/models/components/createinvoicelineitem.d.ts +2 -1
  75. package/models/components/createinvoicelineitem.d.ts.map +1 -1
  76. package/models/components/createinvoicelineitem.js.map +1 -1
  77. package/models/components/createpaymentlinklineitem.d.ts +2 -1
  78. package/models/components/createpaymentlinklineitem.d.ts.map +1 -1
  79. package/models/components/createpaymentlinklineitem.js.map +1 -1
  80. package/models/components/createresolutionlink.d.ts +24 -0
  81. package/models/components/createresolutionlink.d.ts.map +1 -0
  82. package/models/components/{rtpfailurecode.js → createresolutionlink.js} +18 -19
  83. package/models/components/createresolutionlink.js.map +1 -0
  84. package/models/components/index.d.ts +3 -3
  85. package/models/components/index.d.ts.map +1 -1
  86. package/models/components/index.js +3 -3
  87. package/models/components/index.js.map +1 -1
  88. package/models/components/invoice.d.ts +12 -0
  89. package/models/components/invoice.d.ts.map +1 -1
  90. package/models/components/invoice.js +6 -0
  91. package/models/components/invoice.js.map +1 -1
  92. package/models/components/invoicelineitem.d.ts +2 -1
  93. package/models/components/invoicelineitem.d.ts.map +1 -1
  94. package/models/components/invoicelineitem.js.map +1 -1
  95. package/models/components/resolutionlink.d.ts +63 -0
  96. package/models/components/resolutionlink.d.ts.map +1 -0
  97. package/models/components/resolutionlink.js +75 -0
  98. package/models/components/resolutionlink.js.map +1 -0
  99. package/models/components/resolutionlinkrecipient.d.ts +29 -0
  100. package/models/components/resolutionlinkrecipient.d.ts.map +1 -0
  101. package/models/components/{rtptransactionstatus.js → resolutionlinkrecipient.js} +20 -13
  102. package/models/components/resolutionlinkrecipient.js.map +1 -0
  103. package/models/components/transferdestination.d.ts +0 -6
  104. package/models/components/transferdestination.d.ts.map +1 -1
  105. package/models/components/transferdestination.js +0 -3
  106. package/models/components/transferdestination.js.map +1 -1
  107. package/models/components/updateinvoice.d.ts +4 -1
  108. package/models/components/updateinvoice.d.ts.map +1 -1
  109. package/models/components/updateinvoice.js.map +1 -1
  110. package/models/errors/createresolutionlinkerror.d.ts +45 -0
  111. package/models/errors/createresolutionlinkerror.d.ts.map +1 -0
  112. package/models/errors/createresolutionlinkerror.js +82 -0
  113. package/models/errors/createresolutionlinkerror.js.map +1 -0
  114. package/models/errors/index.d.ts +1 -0
  115. package/models/errors/index.d.ts.map +1 -1
  116. package/models/errors/index.js +1 -0
  117. package/models/errors/index.js.map +1 -1
  118. package/models/operations/createresolutionlink.d.ts +66 -0
  119. package/models/operations/createresolutionlink.d.ts.map +1 -0
  120. package/models/operations/createresolutionlink.js +122 -0
  121. package/models/operations/createresolutionlink.js.map +1 -0
  122. package/models/operations/deleteinvoice.d.ts +63 -0
  123. package/models/operations/deleteinvoice.d.ts.map +1 -0
  124. package/models/operations/deleteinvoice.js +109 -0
  125. package/models/operations/deleteinvoice.js.map +1 -0
  126. package/models/operations/disableresolutionlink.d.ts +63 -0
  127. package/models/operations/disableresolutionlink.d.ts.map +1 -0
  128. package/models/operations/disableresolutionlink.js +109 -0
  129. package/models/operations/disableresolutionlink.js.map +1 -0
  130. package/models/operations/getresolutionlink.d.ts +66 -0
  131. package/models/operations/getresolutionlink.d.ts.map +1 -0
  132. package/models/operations/getresolutionlink.js +114 -0
  133. package/models/operations/getresolutionlink.js.map +1 -0
  134. package/models/operations/index.d.ts +5 -0
  135. package/models/operations/index.d.ts.map +1 -1
  136. package/models/operations/index.js +5 -0
  137. package/models/operations/index.js.map +1 -1
  138. package/models/operations/listresolutionlinks.d.ts +64 -0
  139. package/models/operations/listresolutionlinks.d.ts.map +1 -0
  140. package/models/operations/listresolutionlinks.js +112 -0
  141. package/models/operations/listresolutionlinks.js.map +1 -0
  142. package/package.json +1 -1
  143. package/sdk/invoices.d.ts +13 -0
  144. package/sdk/invoices.d.ts.map +1 -1
  145. package/sdk/invoices.js +16 -0
  146. package/sdk/invoices.js.map +1 -1
  147. package/sdk/resolutionlinks.d.ts +35 -0
  148. package/sdk/resolutionlinks.d.ts.map +1 -0
  149. package/sdk/resolutionlinks.js +54 -0
  150. package/sdk/resolutionlinks.js.map +1 -0
  151. package/sdk/sdk.d.ts +3 -0
  152. package/sdk/sdk.d.ts.map +1 -1
  153. package/sdk/sdk.js +4 -0
  154. package/sdk/sdk.js.map +1 -1
  155. package/src/funcs/disputesUploadEvidenceFile.ts +15 -0
  156. package/src/funcs/filesUpload.ts +15 -0
  157. package/src/funcs/imagesUpdate.ts +16 -0
  158. package/src/funcs/imagesUpload.ts +16 -0
  159. package/src/funcs/invoicesDelete.ts +206 -0
  160. package/src/funcs/resolutionLinksCreate.ts +208 -0
  161. package/src/funcs/resolutionLinksDisable.ts +204 -0
  162. package/src/funcs/resolutionLinksGet.ts +186 -0
  163. package/src/funcs/resolutionLinksList.ts +180 -0
  164. package/src/hooks/moov-version-hook.ts +10 -6
  165. package/src/hooks/registration.ts +1 -1
  166. package/src/lib/config.ts +3 -3
  167. package/src/lib/matchers.ts +3 -2
  168. package/src/lib/security.ts +1 -2
  169. package/src/mcp-server/mcp-server.ts +1 -1
  170. package/src/mcp-server/server.ts +11 -1
  171. package/src/mcp-server/shared.ts +2 -2
  172. package/src/mcp-server/tools/invoicesDelete.ts +43 -0
  173. package/src/mcp-server/tools/resolutionLinksCreate.ts +41 -0
  174. package/src/mcp-server/tools/resolutionLinksDisable.ts +37 -0
  175. package/src/mcp-server/tools/resolutionLinksGet.ts +38 -0
  176. package/src/mcp-server/tools/resolutionLinksList.ts +38 -0
  177. package/src/models/components/createinvoicelineitem.ts +2 -1
  178. package/src/models/components/createpaymentlinklineitem.ts +2 -1
  179. package/src/models/components/createresolutionlink.ts +63 -0
  180. package/src/models/components/index.ts +3 -3
  181. package/src/models/components/invoice.ts +20 -0
  182. package/src/models/components/invoicelineitem.ts +2 -1
  183. package/src/models/components/resolutionlink.ts +110 -0
  184. package/src/models/components/resolutionlinkrecipient.ts +70 -0
  185. package/src/models/components/transferdestination.ts +0 -13
  186. package/src/models/components/updateinvoice.ts +4 -1
  187. package/src/models/errors/createresolutionlinkerror.ts +90 -0
  188. package/src/models/errors/index.ts +1 -0
  189. package/src/models/operations/createresolutionlink.ts +193 -0
  190. package/src/models/operations/deleteinvoice.ts +172 -0
  191. package/src/models/operations/disableresolutionlink.ts +178 -0
  192. package/src/models/operations/getresolutionlink.ts +179 -0
  193. package/src/models/operations/index.ts +5 -0
  194. package/src/models/operations/listresolutionlinks.ts +177 -0
  195. package/src/sdk/invoices.ts +24 -0
  196. package/src/sdk/resolutionlinks.ts +83 -0
  197. package/src/sdk/sdk.ts +6 -0
  198. package/models/components/rtpfailurecode.d.ts +0 -26
  199. package/models/components/rtpfailurecode.d.ts.map +0 -1
  200. package/models/components/rtpfailurecode.js.map +0 -1
  201. package/models/components/rtptransactiondetails.d.ts +0 -43
  202. package/models/components/rtptransactiondetails.d.ts.map +0 -1
  203. package/models/components/rtptransactiondetails.js +0 -75
  204. package/models/components/rtptransactiondetails.js.map +0 -1
  205. package/models/components/rtptransactionstatus.d.ts +0 -20
  206. package/models/components/rtptransactionstatus.d.ts.map +0 -1
  207. package/models/components/rtptransactionstatus.js.map +0 -1
  208. package/src/models/components/rtpfailurecode.ts +0 -35
  209. package/src/models/components/rtptransactiondetails.ts +0 -102
  210. package/src/models/components/rtptransactionstatus.ts +0 -29
@@ -0,0 +1,186 @@
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 {
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
+ * Get a resolution link by code.
29
+ *
30
+ * To access this endpoint using an [access token](https://docs.moov.io/api/authentication/access-tokens/)
31
+ * you'll need to specify the `/accounts/{accountID}/profile.read` scope.
32
+ */
33
+ export function resolutionLinksGet(
34
+ client: MoovCore,
35
+ request: operations.GetResolutionLinkRequest,
36
+ options?: RequestOptions,
37
+ ): APIPromise<
38
+ Result<
39
+ operations.GetResolutionLinkResponse,
40
+ | MoovError
41
+ | ResponseValidationError
42
+ | ConnectionError
43
+ | RequestAbortedError
44
+ | RequestTimeoutError
45
+ | InvalidRequestError
46
+ | UnexpectedClientError
47
+ | SDKValidationError
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.GetResolutionLinkRequest,
60
+ options?: RequestOptions,
61
+ ): Promise<
62
+ [
63
+ Result<
64
+ operations.GetResolutionLinkResponse,
65
+ | MoovError
66
+ | ResponseValidationError
67
+ | ConnectionError
68
+ | RequestAbortedError
69
+ | RequestTimeoutError
70
+ | InvalidRequestError
71
+ | UnexpectedClientError
72
+ | SDKValidationError
73
+ >,
74
+ APICall,
75
+ ]
76
+ > {
77
+ const parsed = safeParse(
78
+ request,
79
+ (value) => operations.GetResolutionLinkRequest$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
+ resolutionLinkCode: encodeSimple(
94
+ "resolutionLinkCode",
95
+ payload.resolutionLinkCode,
96
+ { explode: false, charEncoding: "percent" },
97
+ ),
98
+ };
99
+
100
+ const path = pathToFunc(
101
+ "/accounts/{accountID}/resolution-links/{resolutionLinkCode}",
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
+ options: client._options,
118
+ baseURL: options?.serverURL ?? client._baseURL ?? "",
119
+ operationID: "getResolutionLink",
120
+ oAuth2Scopes: null,
121
+
122
+ resolvedSecurity: requestSecurity,
123
+
124
+ securitySource: client._options.security,
125
+ retryConfig: options?.retries
126
+ || client._options.retryConfig
127
+ || { strategy: "none" },
128
+ retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
129
+ };
130
+
131
+ const requestRes = client._createRequest(context, {
132
+ security: requestSecurity,
133
+ method: "GET",
134
+ baseURL: options?.serverURL,
135
+ path: path,
136
+ headers: headers,
137
+ body: body,
138
+ userAgent: client._options.userAgent,
139
+ timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
140
+ }, options);
141
+ if (!requestRes.ok) {
142
+ return [requestRes, { status: "invalid" }];
143
+ }
144
+ const req = requestRes.value;
145
+
146
+ const doResult = await client._do(req, {
147
+ context,
148
+ errorCodes: ["401", "403", "404", "429", "4XX", "500", "504", "5XX"],
149
+ retryConfig: context.retryConfig,
150
+ retryCodes: context.retryCodes,
151
+ });
152
+ if (!doResult.ok) {
153
+ return [doResult, { status: "request-error", request: req }];
154
+ }
155
+ const response = doResult.value;
156
+
157
+ const responseFields = {
158
+ HttpMeta: { Response: response, Request: req },
159
+ };
160
+
161
+ const [result] = await M.match<
162
+ operations.GetResolutionLinkResponse,
163
+ | MoovError
164
+ | ResponseValidationError
165
+ | ConnectionError
166
+ | RequestAbortedError
167
+ | RequestTimeoutError
168
+ | InvalidRequestError
169
+ | UnexpectedClientError
170
+ | SDKValidationError
171
+ >(
172
+ M.json(200, operations.GetResolutionLinkResponse$inboundSchema, {
173
+ hdrs: true,
174
+ key: "Result",
175
+ }),
176
+ M.fail([401, 403, 404, 429]),
177
+ M.fail([500, 504]),
178
+ M.fail("4XX"),
179
+ M.fail("5XX"),
180
+ )(response, req, { extraFields: responseFields });
181
+ if (!result.ok) {
182
+ return [result, { status: "complete", request: req, response }];
183
+ }
184
+
185
+ return [result, { status: "complete", request: req, response }];
186
+ }
@@ -0,0 +1,180 @@
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 {
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 resolution links for the specified account.
29
+ *
30
+ * To access this endpoint using an [access token](https://docs.moov.io/api/authentication/access-tokens/)
31
+ * you'll need to specify the `/accounts/{accountID}/profile.read` scope.
32
+ */
33
+ export function resolutionLinksList(
34
+ client: MoovCore,
35
+ request: operations.ListResolutionLinksRequest,
36
+ options?: RequestOptions,
37
+ ): APIPromise<
38
+ Result<
39
+ operations.ListResolutionLinksResponse,
40
+ | MoovError
41
+ | ResponseValidationError
42
+ | ConnectionError
43
+ | RequestAbortedError
44
+ | RequestTimeoutError
45
+ | InvalidRequestError
46
+ | UnexpectedClientError
47
+ | SDKValidationError
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.ListResolutionLinksRequest,
60
+ options?: RequestOptions,
61
+ ): Promise<
62
+ [
63
+ Result<
64
+ operations.ListResolutionLinksResponse,
65
+ | MoovError
66
+ | ResponseValidationError
67
+ | ConnectionError
68
+ | RequestAbortedError
69
+ | RequestTimeoutError
70
+ | InvalidRequestError
71
+ | UnexpectedClientError
72
+ | SDKValidationError
73
+ >,
74
+ APICall,
75
+ ]
76
+ > {
77
+ const parsed = safeParse(
78
+ request,
79
+ (value) =>
80
+ operations.ListResolutionLinksRequest$outboundSchema.parse(value),
81
+ "Input validation failed",
82
+ );
83
+ if (!parsed.ok) {
84
+ return [parsed, { status: "invalid" }];
85
+ }
86
+ const payload = parsed.value;
87
+ const body = null;
88
+
89
+ const pathParams = {
90
+ accountID: encodeSimple("accountID", payload.accountID, {
91
+ explode: false,
92
+ charEncoding: "percent",
93
+ }),
94
+ };
95
+
96
+ const path = pathToFunc("/accounts/{accountID}/resolution-links")(pathParams);
97
+
98
+ const headers = new Headers(compactMap({
99
+ Accept: "application/json",
100
+ "X-Moov-Version": encodeSimple(
101
+ "X-Moov-Version",
102
+ client._options.xMoovVersion,
103
+ { explode: false, charEncoding: "none" },
104
+ ),
105
+ }));
106
+
107
+ const securityInput = await extractSecurity(client._options.security);
108
+ const requestSecurity = resolveGlobalSecurity(securityInput);
109
+
110
+ const context = {
111
+ options: client._options,
112
+ baseURL: options?.serverURL ?? client._baseURL ?? "",
113
+ operationID: "listResolutionLinks",
114
+ oAuth2Scopes: null,
115
+
116
+ resolvedSecurity: requestSecurity,
117
+
118
+ securitySource: client._options.security,
119
+ retryConfig: options?.retries
120
+ || client._options.retryConfig
121
+ || { strategy: "none" },
122
+ retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
123
+ };
124
+
125
+ const requestRes = client._createRequest(context, {
126
+ security: requestSecurity,
127
+ method: "GET",
128
+ baseURL: options?.serverURL,
129
+ path: path,
130
+ headers: headers,
131
+ body: body,
132
+ userAgent: client._options.userAgent,
133
+ timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
134
+ }, options);
135
+ if (!requestRes.ok) {
136
+ return [requestRes, { status: "invalid" }];
137
+ }
138
+ const req = requestRes.value;
139
+
140
+ const doResult = await client._do(req, {
141
+ context,
142
+ errorCodes: ["401", "403", "429", "4XX", "500", "504", "5XX"],
143
+ retryConfig: context.retryConfig,
144
+ retryCodes: context.retryCodes,
145
+ });
146
+ if (!doResult.ok) {
147
+ return [doResult, { status: "request-error", request: req }];
148
+ }
149
+ const response = doResult.value;
150
+
151
+ const responseFields = {
152
+ HttpMeta: { Response: response, Request: req },
153
+ };
154
+
155
+ const [result] = await M.match<
156
+ operations.ListResolutionLinksResponse,
157
+ | MoovError
158
+ | ResponseValidationError
159
+ | ConnectionError
160
+ | RequestAbortedError
161
+ | RequestTimeoutError
162
+ | InvalidRequestError
163
+ | UnexpectedClientError
164
+ | SDKValidationError
165
+ >(
166
+ M.json(200, operations.ListResolutionLinksResponse$inboundSchema, {
167
+ hdrs: true,
168
+ key: "Result",
169
+ }),
170
+ M.fail([401, 403, 429]),
171
+ M.fail([500, 504]),
172
+ M.fail("4XX"),
173
+ M.fail("5XX"),
174
+ )(response, req, { extraFields: responseFields });
175
+ if (!result.ok) {
176
+ return [result, { status: "complete", request: req, response }];
177
+ }
178
+
179
+ return [result, { status: "complete", request: req, response }];
180
+ }
@@ -1,9 +1,13 @@
1
- import { SDK_METADATA, SDKOptions } from "../lib/config";
2
- import { SDKInitHook } from "./types";
1
+ import { SDK_METADATA } from "../lib/config.js";
2
+ import { BeforeRequestContext, BeforeRequestHook } from "./types.js";
3
3
 
4
- export class MoovVersionHook implements SDKInitHook {
5
- sdkInit(opts: SDKOptions): SDKOptions {
6
- opts.xMoovVersion = SDK_METADATA.openapiDocVersion;
7
- return opts;
4
+ export class MoovVersionHook implements BeforeRequestHook {
5
+ beforeRequest(
6
+ _hookCtx: BeforeRequestContext,
7
+ request: Request,
8
+ ): Request {
9
+ const newRequest = new Request(request);
10
+ newRequest.headers.set("X-Moov-Version", SDK_METADATA.openapiDocVersion);
11
+ return newRequest;
8
12
  }
9
13
  }
@@ -13,5 +13,5 @@ export function initHooks(hooks: Hooks) {
13
13
  // Hooks are registered per SDK instance, and are valid for the lifetime of the SDK instance
14
14
 
15
15
  const versionHook = new MoovVersionHook();
16
- hooks.registerSDKInitHook(versionHook);
16
+ hooks.registerBeforeRequestHook(versionHook);
17
17
  }
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: "dev",
76
- sdkVersion: "0.0.0-dev.5",
77
- genVersion: "2.845.15",
78
- userAgent: "speakeasy-sdk/typescript 0.0.0-dev.5 2.845.15 dev @moovio/sdk",
76
+ sdkVersion: "0.0.0-dev.7",
77
+ genVersion: "2.859.2",
78
+ userAgent: "speakeasy-sdk/typescript 0.0.0-dev.7 2.859.2 dev @moovio/sdk",
79
79
  } as const;
@@ -248,8 +248,9 @@ export function match<T, E>(
248
248
  raw = body;
249
249
  break;
250
250
  default:
251
- encoding satisfies never;
252
- throw new Error(`Unsupported response type: ${encoding}`);
251
+ throw new Error(
252
+ `Unsupported response type: ${encoding satisfies never}`,
253
+ );
253
254
  }
254
255
 
255
256
  if (matcher.enc === "fail") {
@@ -197,8 +197,7 @@ export function resolveSecurity(
197
197
  applyBearer(state, spec);
198
198
  break;
199
199
  default:
200
- spec satisfies never;
201
- throw SecurityError.unrecognizedType(type);
200
+ throw SecurityError.unrecognizedType((spec satisfies never, type));
202
201
  }
203
202
  });
204
203
 
@@ -19,7 +19,7 @@ const routes = buildRouteMap({
19
19
  export const app = buildApplication(routes, {
20
20
  name: "mcp",
21
21
  versionInfo: {
22
- currentVersion: "0.0.0-dev.5",
22
+ currentVersion: "0.0.0-dev.7",
23
23
  },
24
24
  });
25
25
 
@@ -104,6 +104,7 @@ import { tool$institutionsSearch } from "./tools/institutionsSearch.js";
104
104
  import { tool$institutionsSearchInstitutions } from "./tools/institutionsSearchInstitutions.js";
105
105
  import { tool$invoicesCreateInvoice } from "./tools/invoicesCreateInvoice.js";
106
106
  import { tool$invoicesCreateInvoicePayment } from "./tools/invoicesCreateInvoicePayment.js";
107
+ import { tool$invoicesDelete } from "./tools/invoicesDelete.js";
107
108
  import { tool$invoicesGetInvoice } from "./tools/invoicesGetInvoice.js";
108
109
  import { tool$invoicesListInvoicePayments } from "./tools/invoicesListInvoicePayments.js";
109
110
  import { tool$invoicesListInvoices } from "./tools/invoicesListInvoices.js";
@@ -138,6 +139,10 @@ import { tool$representativesDelete } from "./tools/representativesDelete.js";
138
139
  import { tool$representativesGet } from "./tools/representativesGet.js";
139
140
  import { tool$representativesList } from "./tools/representativesList.js";
140
141
  import { tool$representativesUpdate } from "./tools/representativesUpdate.js";
142
+ import { tool$resolutionLinksCreate } from "./tools/resolutionLinksCreate.js";
143
+ import { tool$resolutionLinksDisable } from "./tools/resolutionLinksDisable.js";
144
+ import { tool$resolutionLinksGet } from "./tools/resolutionLinksGet.js";
145
+ import { tool$resolutionLinksList } from "./tools/resolutionLinksList.js";
141
146
  import { tool$schedulingCancel } from "./tools/schedulingCancel.js";
142
147
  import { tool$schedulingCreate } from "./tools/schedulingCreate.js";
143
148
  import { tool$schedulingGet } from "./tools/schedulingGet.js";
@@ -202,7 +207,7 @@ export function createMCPServer(deps: {
202
207
  }) {
203
208
  const server = new McpServer({
204
209
  name: "Moov",
205
- version: "0.0.0-dev.5",
210
+ version: "0.0.0-dev.7",
206
211
  });
207
212
 
208
213
  const client = new MoovCore({
@@ -307,6 +312,7 @@ export function createMCPServer(deps: {
307
312
  tool(tool$invoicesListInvoices);
308
313
  tool(tool$invoicesGetInvoice);
309
314
  tool(tool$invoicesUpdateInvoice);
315
+ tool(tool$invoicesDelete);
310
316
  tool(tool$invoicesCreateInvoicePayment);
311
317
  tool(tool$invoicesListInvoicePayments);
312
318
  tool(tool$paymentLinksCreate);
@@ -327,6 +333,10 @@ export function createMCPServer(deps: {
327
333
  tool(tool$representativesDelete);
328
334
  tool(tool$representativesGet);
329
335
  tool(tool$representativesUpdate);
336
+ tool(tool$resolutionLinksCreate);
337
+ tool(tool$resolutionLinksList);
338
+ tool(tool$resolutionLinksGet);
339
+ tool(tool$resolutionLinksDisable);
330
340
  tool(tool$schedulingCreate);
331
341
  tool(tool$schedulingList);
332
342
  tool(tool$schedulingUpdate);
@@ -16,12 +16,12 @@ export async function consumeStream(
16
16
  stream: ReadableStream<Uint8Array>,
17
17
  ): Promise<Uint8Array> {
18
18
  const reader = stream.getReader();
19
- const chunks: Uint8Array[] = [];
19
+ const chunks: ArrayBuffer[] = [];
20
20
 
21
21
  try {
22
22
  while (true) {
23
23
  const { done, value } = await reader.read();
24
- if (value != null) chunks.push(value);
24
+ if (value != null) chunks.push(new Uint8Array(value).buffer);
25
25
  if (done) break;
26
26
  }
27
27
  } finally {
@@ -0,0 +1,43 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import { invoicesDelete } from "../../funcs/invoicesDelete.js";
6
+ import * as operations from "../../models/operations/index.js";
7
+ import { formatResult, ToolDefinition } from "../tools.js";
8
+
9
+ const args = {
10
+ request: operations.DeleteInvoiceRequest$inboundSchema,
11
+ };
12
+
13
+ export const tool$invoicesDelete: ToolDefinition<typeof args> = {
14
+ name: "invoices-delete",
15
+ description:
16
+ `Delete an invoice. Only invoices in \`draft\` status can be deleted.
17
+
18
+ Deleting an invoice indicates it was created by mistake and should be completely disregarded.
19
+ Deleted invoices are hidden from list results by default, but can still be retrieved
20
+ individually through the get invoice endpoint. If you need to void an invoice that was
21
+ already sent or is otherwise part of the invoice history, cancel it instead by updating
22
+ its status to \`canceled\`.
23
+
24
+ To access this endpoint using an [access token](https://docs.moov.io/api/authentication/access-tokens/)
25
+ you'll need to specify the \`/accounts/{accountID}/invoices.write\` scope.`,
26
+ args,
27
+ tool: async (client, args, ctx) => {
28
+ const [result, apiCall] = await invoicesDelete(
29
+ client,
30
+ args.request,
31
+ { fetchOptions: { signal: ctx.signal } },
32
+ ).$inspect();
33
+
34
+ if (!result.ok) {
35
+ return {
36
+ content: [{ type: "text", text: result.error.message }],
37
+ isError: true,
38
+ };
39
+ }
40
+
41
+ return formatResult(void 0, apiCall);
42
+ },
43
+ };
@@ -0,0 +1,41 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import { resolutionLinksCreate } from "../../funcs/resolutionLinksCreate.js";
6
+ import * as operations from "../../models/operations/index.js";
7
+ import { formatResult, ToolDefinition } from "../tools.js";
8
+
9
+ const args = {
10
+ request: operations.CreateResolutionLinkRequest$inboundSchema,
11
+ };
12
+
13
+ export const tool$resolutionLinksCreate: ToolDefinition<typeof args> = {
14
+ name: "resolution-links-create",
15
+ description:
16
+ `Create a resolution link for the specified account. Resolution links are temporary, secure links
17
+ sent to merchants to resolve account requirements such as KYC verification or document uploads. Only one active resolution link
18
+ is allowed per connected account.
19
+
20
+ To access this endpoint using an [access token](https://docs.moov.io/api/authentication/access-tokens/)
21
+ you'll need to specify the \`/accounts/{accountID}/profile.write\`, \`/accounts/{accountID}/representatives.write\` and \`/accounts/{accountID}/files.write\` scopes.`,
22
+ args,
23
+ tool: async (client, args, ctx) => {
24
+ const [result, apiCall] = await resolutionLinksCreate(
25
+ client,
26
+ args.request,
27
+ { fetchOptions: { signal: ctx.signal } },
28
+ ).$inspect();
29
+
30
+ if (!result.ok) {
31
+ return {
32
+ content: [{ type: "text", text: result.error.message }],
33
+ isError: true,
34
+ };
35
+ }
36
+
37
+ const value = result.value.result;
38
+
39
+ return formatResult(value, apiCall);
40
+ },
41
+ };
@@ -0,0 +1,37 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import { resolutionLinksDisable } from "../../funcs/resolutionLinksDisable.js";
6
+ import * as operations from "../../models/operations/index.js";
7
+ import { formatResult, ToolDefinition } from "../tools.js";
8
+
9
+ const args = {
10
+ request: operations.DisableResolutionLinkRequest$inboundSchema,
11
+ };
12
+
13
+ export const tool$resolutionLinksDisable: ToolDefinition<typeof args> = {
14
+ name: "resolution-links-disable",
15
+ description:
16
+ `Disable a resolution link. Disabled resolution links can no longer be used by merchants.
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}/profile.write\` scope.`,
20
+ args,
21
+ tool: async (client, args, ctx) => {
22
+ const [result, apiCall] = await resolutionLinksDisable(
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
+ return formatResult(void 0, apiCall);
36
+ },
37
+ };
@@ -0,0 +1,38 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import { resolutionLinksGet } from "../../funcs/resolutionLinksGet.js";
6
+ import * as operations from "../../models/operations/index.js";
7
+ import { formatResult, ToolDefinition } from "../tools.js";
8
+
9
+ const args = {
10
+ request: operations.GetResolutionLinkRequest$inboundSchema,
11
+ };
12
+
13
+ export const tool$resolutionLinksGet: ToolDefinition<typeof args> = {
14
+ name: "resolution-links-get",
15
+ description: `Get a resolution link by code.
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}/profile.read\` scope.`,
19
+ args,
20
+ tool: async (client, args, ctx) => {
21
+ const [result, apiCall] = await resolutionLinksGet(
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
+ };