@moovio/sdk 26.10.0-dev.0 → 26.10.0-dev.1
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 +121 -59
- package/bin/mcp-server.js +512 -185
- package/bin/mcp-server.js.map +32 -22
- package/funcs/avatarsDelete.d.ts +23 -0
- package/funcs/avatarsDelete.d.ts.map +1 -0
- package/funcs/avatarsDelete.js +135 -0
- package/funcs/avatarsDelete.js.map +1 -0
- package/funcs/avatarsUpload.d.ts +23 -0
- package/funcs/avatarsUpload.d.ts.map +1 -0
- package/funcs/avatarsUpload.js +155 -0
- package/funcs/avatarsUpload.js.map +1 -0
- package/funcs/productsList.js +1 -0
- package/funcs/productsList.js.map +1 -1
- package/funcs/productsListCategories.d.ts +14 -0
- package/funcs/productsListCategories.d.ts.map +1 -0
- package/funcs/productsListCategories.js +107 -0
- package/funcs/productsListCategories.js.map +1 -0
- package/hooks/oauth2scopes.d.ts +5 -0
- package/hooks/oauth2scopes.d.ts.map +1 -0
- package/hooks/oauth2scopes.js +6 -0
- package/hooks/oauth2scopes.js.map +1 -0
- package/jsr.json +1 -1
- package/lib/config.d.ts +3 -3
- package/lib/config.js +3 -3
- package/mcp-server/mcp-server.js +1 -1
- package/mcp-server/server.d.ts.map +1 -1
- package/mcp-server/server.js +3 -1
- package/mcp-server/server.js.map +1 -1
- package/mcp-server/tools/productsListCategories.d.ts +3 -0
- package/mcp-server/tools/productsListCategories.d.ts.map +1 -0
- package/mcp-server/tools/productsListCategories.js +24 -0
- package/mcp-server/tools/productsListCategories.js.map +1 -0
- package/models/components/avataruploadrequest.d.ts +35 -0
- package/models/components/avataruploadrequest.d.ts.map +1 -0
- package/models/components/avataruploadrequest.js +88 -0
- package/models/components/avataruploadrequest.js.map +1 -0
- package/models/components/capabilityid.d.ts +1 -0
- package/models/components/capabilityid.d.ts.map +1 -1
- package/models/components/capabilityid.js +1 -0
- package/models/components/capabilityid.js.map +1 -1
- package/models/components/createtransfer.d.ts +6 -0
- package/models/components/createtransfer.d.ts.map +1 -1
- package/models/components/createtransfer.js +3 -0
- package/models/components/createtransfer.js.map +1 -1
- package/models/components/feepaidby.d.ts +18 -0
- package/models/components/feepaidby.d.ts.map +1 -0
- package/models/components/feepaidby.js +52 -0
- package/models/components/feepaidby.js.map +1 -0
- package/models/components/incurredfee.d.ts +6 -0
- package/models/components/incurredfee.d.ts.map +1 -1
- package/models/components/incurredfee.js +3 -0
- package/models/components/incurredfee.js.map +1 -1
- package/models/components/index.d.ts +5 -0
- package/models/components/index.d.ts.map +1 -1
- package/models/components/index.js +5 -0
- package/models/components/index.js.map +1 -1
- package/models/components/issuingintervallimit.d.ts +2 -2
- package/models/components/issuingintervallimit.js +1 -1
- package/models/components/issuingvelocitylimit.d.ts +1 -1
- package/models/components/paymentlinkpayoutdetails.d.ts +14 -0
- package/models/components/paymentlinkpayoutdetails.d.ts.map +1 -1
- package/models/components/paymentlinkpayoutdetails.js +3 -0
- package/models/components/paymentlinkpayoutdetails.js.map +1 -1
- package/models/components/paymentlinkpayoutdetailsupdate.d.ts +14 -0
- package/models/components/paymentlinkpayoutdetailsupdate.d.ts.map +1 -1
- package/models/components/paymentlinkpayoutdetailsupdate.js +3 -0
- package/models/components/paymentlinkpayoutdetailsupdate.js.map +1 -1
- package/models/components/payoutdetailserror.d.ts +2 -0
- package/models/components/payoutdetailserror.d.ts.map +1 -1
- package/models/components/payoutdetailserror.js +2 -0
- package/models/components/payoutdetailserror.js.map +1 -1
- package/models/components/product.d.ts +6 -0
- package/models/components/product.d.ts.map +1 -1
- package/models/components/product.js +3 -0
- package/models/components/product.js.map +1 -1
- package/models/components/productcategories.d.ts +21 -0
- package/models/components/productcategories.d.ts.map +1 -0
- package/models/components/productcategories.js +59 -0
- package/models/components/productcategories.js.map +1 -0
- package/models/components/productcategory.d.ts +43 -0
- package/models/components/productcategory.d.ts.map +1 -0
- package/models/components/productcategory.js +67 -0
- package/models/components/productcategory.js.map +1 -0
- package/models/components/productrequest.d.ts +5 -0
- package/models/components/productrequest.d.ts.map +1 -1
- package/models/components/productrequest.js +2 -0
- package/models/components/productrequest.js.map +1 -1
- package/models/components/transferfeepaidby.d.ts +24 -0
- package/models/components/transferfeepaidby.d.ts.map +1 -0
- package/models/components/transferfeepaidby.js +60 -0
- package/models/components/transferfeepaidby.js.map +1 -0
- package/models/errors/productrequestvalidationerror.d.ts +3 -0
- package/models/errors/productrequestvalidationerror.d.ts.map +1 -1
- package/models/errors/productrequestvalidationerror.js +4 -0
- package/models/errors/productrequestvalidationerror.js.map +1 -1
- package/models/operations/deleteavatar.d.ts +52 -0
- package/models/operations/deleteavatar.d.ts.map +1 -0
- package/models/operations/deleteavatar.js +102 -0
- package/models/operations/deleteavatar.js.map +1 -0
- package/models/operations/index.d.ts +3 -0
- package/models/operations/index.d.ts.map +1 -1
- package/models/operations/index.js +3 -0
- package/models/operations/index.js.map +1 -1
- package/models/operations/listproductcategories.d.ts +24 -0
- package/models/operations/listproductcategories.d.ts.map +1 -0
- package/models/operations/listproductcategories.js +72 -0
- package/models/operations/listproductcategories.js.map +1 -0
- package/models/operations/listproducts.d.ts +9 -0
- package/models/operations/listproducts.d.ts.map +1 -1
- package/models/operations/listproducts.js +2 -0
- package/models/operations/listproducts.js.map +1 -1
- package/models/operations/uploadavatar.d.ts +55 -0
- package/models/operations/uploadavatar.d.ts.map +1 -0
- package/models/operations/uploadavatar.js +113 -0
- package/models/operations/uploadavatar.js.map +1 -0
- package/package.json +1 -1
- package/sdk/avatars.d.ts +24 -0
- package/sdk/avatars.d.ts.map +1 -1
- package/sdk/avatars.js +30 -0
- package/sdk/avatars.js.map +1 -1
- package/sdk/products.d.ts +4 -0
- package/sdk/products.d.ts.map +1 -1
- package/sdk/products.js +7 -0
- package/sdk/products.js.map +1 -1
- package/src/funcs/avatarsDelete.ts +194 -0
- package/src/funcs/avatarsUpload.ts +231 -0
- package/src/funcs/productsList.ts +1 -0
- package/src/funcs/productsListCategories.ts +149 -0
- package/src/hooks/oauth2scopes.ts +8 -0
- package/src/lib/config.ts +3 -3
- package/src/mcp-server/mcp-server.ts +1 -1
- package/src/mcp-server/server.ts +3 -1
- package/src/mcp-server/tools/productsListCategories.ts +29 -0
- package/src/models/components/avataruploadrequest.ts +113 -0
- package/src/models/components/capabilityid.ts +1 -0
- package/src/models/components/createtransfer.ts +13 -0
- package/src/models/components/feepaidby.ts +32 -0
- package/src/models/components/incurredfee.ts +12 -0
- package/src/models/components/index.ts +5 -0
- package/src/models/components/issuingintervallimit.ts +2 -2
- package/src/models/components/issuingvelocitylimit.ts +1 -1
- package/src/models/components/paymentlinkpayoutdetails.ts +16 -0
- package/src/models/components/paymentlinkpayoutdetailsupdate.ts +16 -0
- package/src/models/components/payoutdetailserror.ts +4 -0
- package/src/models/components/product.ts +13 -0
- package/src/models/components/productcategories.ts +60 -0
- package/src/models/components/productcategory.ts +84 -0
- package/src/models/components/productrequest.ts +7 -0
- package/src/models/components/transferfeepaidby.ts +63 -0
- package/src/models/errors/productrequestvalidationerror.ts +6 -0
- package/src/models/operations/deleteavatar.ts +154 -0
- package/src/models/operations/index.ts +3 -0
- package/src/models/operations/listproductcategories.ts +69 -0
- package/src/models/operations/listproducts.ts +11 -0
- package/src/models/operations/uploadavatar.ts +167 -0
- package/src/sdk/avatars.ts +50 -0
- package/src/sdk/products.ts +13 -0
|
@@ -0,0 +1,231 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import { MoovCore } from "../core.js";
|
|
6
|
+
import { appendForm, encodeSimple, normalizeBlob } from "../lib/encodings.js";
|
|
7
|
+
import {
|
|
8
|
+
bytesToBlob,
|
|
9
|
+
getContentTypeFromFileName,
|
|
10
|
+
readableStreamToArrayBuffer,
|
|
11
|
+
} from "../lib/files.js";
|
|
12
|
+
import { matchStatusCode } from "../lib/http.js";
|
|
13
|
+
import * as M from "../lib/matchers.js";
|
|
14
|
+
import { compactMap } from "../lib/primitives.js";
|
|
15
|
+
import { safeParse } from "../lib/schemas.js";
|
|
16
|
+
import { RequestOptions } from "../lib/sdks.js";
|
|
17
|
+
import { resolveSecurity } from "../lib/security.js";
|
|
18
|
+
import { pathToFunc } from "../lib/url.js";
|
|
19
|
+
import {
|
|
20
|
+
ConnectionError,
|
|
21
|
+
InvalidRequestError,
|
|
22
|
+
RequestAbortedError,
|
|
23
|
+
RequestTimeoutError,
|
|
24
|
+
UnexpectedClientError,
|
|
25
|
+
} from "../models/errors/httpclienterrors.js";
|
|
26
|
+
import * as errors from "../models/errors/index.js";
|
|
27
|
+
import { MoovError } from "../models/errors/mooverror.js";
|
|
28
|
+
import { ResponseValidationError } from "../models/errors/responsevalidationerror.js";
|
|
29
|
+
import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
|
|
30
|
+
import * as operations from "../models/operations/index.js";
|
|
31
|
+
import { APICall, APIPromise } from "../types/async.js";
|
|
32
|
+
import { isBlobLike } from "../types/blobs.js";
|
|
33
|
+
import { Result } from "../types/fp.js";
|
|
34
|
+
import * as types$ from "../types/primitives.js";
|
|
35
|
+
import { isReadableStream } from "../types/streams.js";
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* Upload a user avatar image for an account.
|
|
39
|
+
*
|
|
40
|
+
* The image will be normalized to 512x512 PNG format and stored separately from
|
|
41
|
+
* automatically discovered logos. User-uploaded avatars take precedence over enriched avatars at read time.
|
|
42
|
+
*
|
|
43
|
+
* This endpoint only accepts accountID values for the uniqueID parameter.
|
|
44
|
+
*
|
|
45
|
+
* To access this endpoint using an [access token](https://docs.moov.io/api/authentication/access-tokens/)
|
|
46
|
+
* you'll need to specify the `/accounts.write` scope.
|
|
47
|
+
*/
|
|
48
|
+
export function avatarsUpload(
|
|
49
|
+
client: MoovCore,
|
|
50
|
+
security: operations.UploadAvatarSecurity,
|
|
51
|
+
request: operations.UploadAvatarRequest,
|
|
52
|
+
options?: RequestOptions,
|
|
53
|
+
): APIPromise<
|
|
54
|
+
Result<
|
|
55
|
+
operations.UploadAvatarResponse | undefined,
|
|
56
|
+
| errors.GenericError
|
|
57
|
+
| MoovError
|
|
58
|
+
| ResponseValidationError
|
|
59
|
+
| ConnectionError
|
|
60
|
+
| RequestAbortedError
|
|
61
|
+
| RequestTimeoutError
|
|
62
|
+
| InvalidRequestError
|
|
63
|
+
| UnexpectedClientError
|
|
64
|
+
| SDKValidationError
|
|
65
|
+
>
|
|
66
|
+
> {
|
|
67
|
+
return new APIPromise($do(
|
|
68
|
+
client,
|
|
69
|
+
security,
|
|
70
|
+
request,
|
|
71
|
+
options,
|
|
72
|
+
));
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
async function $do(
|
|
76
|
+
client: MoovCore,
|
|
77
|
+
security: operations.UploadAvatarSecurity,
|
|
78
|
+
request: operations.UploadAvatarRequest,
|
|
79
|
+
options?: RequestOptions,
|
|
80
|
+
): Promise<
|
|
81
|
+
[
|
|
82
|
+
Result<
|
|
83
|
+
operations.UploadAvatarResponse | undefined,
|
|
84
|
+
| errors.GenericError
|
|
85
|
+
| MoovError
|
|
86
|
+
| ResponseValidationError
|
|
87
|
+
| ConnectionError
|
|
88
|
+
| RequestAbortedError
|
|
89
|
+
| RequestTimeoutError
|
|
90
|
+
| InvalidRequestError
|
|
91
|
+
| UnexpectedClientError
|
|
92
|
+
| SDKValidationError
|
|
93
|
+
>,
|
|
94
|
+
APICall,
|
|
95
|
+
]
|
|
96
|
+
> {
|
|
97
|
+
const parsed = safeParse(
|
|
98
|
+
request,
|
|
99
|
+
(value) => operations.UploadAvatarRequest$outboundSchema.parse(value),
|
|
100
|
+
"Input validation failed",
|
|
101
|
+
);
|
|
102
|
+
if (!parsed.ok) {
|
|
103
|
+
return [parsed, { status: "invalid" }];
|
|
104
|
+
}
|
|
105
|
+
const payload = parsed.value;
|
|
106
|
+
const body = new FormData();
|
|
107
|
+
|
|
108
|
+
if (isBlobLike(payload.AvatarUploadRequest.file)) {
|
|
109
|
+
const file = payload.AvatarUploadRequest.file;
|
|
110
|
+
const blob = await normalizeBlob(file);
|
|
111
|
+
const name = "name" in file ? (file.name as string) : undefined;
|
|
112
|
+
appendForm(body, "file", blob, name);
|
|
113
|
+
} else if (isReadableStream(payload.AvatarUploadRequest.file.content)) {
|
|
114
|
+
const buffer = await readableStreamToArrayBuffer(
|
|
115
|
+
payload.AvatarUploadRequest.file.content,
|
|
116
|
+
);
|
|
117
|
+
const contentType =
|
|
118
|
+
getContentTypeFromFileName(payload.AvatarUploadRequest.file.fileName)
|
|
119
|
+
|| "application/octet-stream";
|
|
120
|
+
appendForm(
|
|
121
|
+
body,
|
|
122
|
+
"file",
|
|
123
|
+
bytesToBlob(buffer, contentType),
|
|
124
|
+
payload.AvatarUploadRequest.file.fileName,
|
|
125
|
+
);
|
|
126
|
+
} else {
|
|
127
|
+
const contentType =
|
|
128
|
+
getContentTypeFromFileName(payload.AvatarUploadRequest.file.fileName)
|
|
129
|
+
|| "application/octet-stream";
|
|
130
|
+
appendForm(
|
|
131
|
+
body,
|
|
132
|
+
"file",
|
|
133
|
+
bytesToBlob(payload.AvatarUploadRequest.file.content, contentType),
|
|
134
|
+
payload.AvatarUploadRequest.file.fileName,
|
|
135
|
+
);
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
const pathParams = {
|
|
139
|
+
uniqueID: encodeSimple("uniqueID", payload.uniqueID, {
|
|
140
|
+
explode: false,
|
|
141
|
+
charEncoding: "percent",
|
|
142
|
+
}),
|
|
143
|
+
};
|
|
144
|
+
const path = pathToFunc("/avatars/{uniqueID}")(pathParams);
|
|
145
|
+
|
|
146
|
+
const headers = new Headers(compactMap({
|
|
147
|
+
Accept: "application/json",
|
|
148
|
+
}));
|
|
149
|
+
|
|
150
|
+
const requestSecurity = resolveSecurity(
|
|
151
|
+
[
|
|
152
|
+
{
|
|
153
|
+
type: "http:basic",
|
|
154
|
+
value: { username: security?.username, password: security?.password },
|
|
155
|
+
},
|
|
156
|
+
],
|
|
157
|
+
);
|
|
158
|
+
|
|
159
|
+
const context = {
|
|
160
|
+
options: client._options,
|
|
161
|
+
baseURL: options?.serverURL ?? client._baseURL ?? "",
|
|
162
|
+
operationID: "uploadAvatar",
|
|
163
|
+
oAuth2Scopes: ["/accounts.write"],
|
|
164
|
+
|
|
165
|
+
resolvedSecurity: requestSecurity,
|
|
166
|
+
|
|
167
|
+
securitySource: security,
|
|
168
|
+
retryConfig: options?.retries
|
|
169
|
+
|| client._options.retryConfig
|
|
170
|
+
|| { strategy: "none" },
|
|
171
|
+
retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
|
|
172
|
+
};
|
|
173
|
+
|
|
174
|
+
const requestRes = client._createRequest(context, {
|
|
175
|
+
security: requestSecurity,
|
|
176
|
+
method: "PUT",
|
|
177
|
+
baseURL: options?.serverURL,
|
|
178
|
+
path: path,
|
|
179
|
+
headers: headers,
|
|
180
|
+
body: body,
|
|
181
|
+
userAgent: client._options.userAgent,
|
|
182
|
+
timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
|
|
183
|
+
}, options);
|
|
184
|
+
if (!requestRes.ok) {
|
|
185
|
+
return [requestRes, { status: "invalid" }];
|
|
186
|
+
}
|
|
187
|
+
const req = requestRes.value;
|
|
188
|
+
|
|
189
|
+
const doResult = await client._do(req, {
|
|
190
|
+
context,
|
|
191
|
+
isErrorStatusCode: (statusCode: number) =>
|
|
192
|
+
matchStatusCode({ status: statusCode } as Response, ["4XX", "5XX"]),
|
|
193
|
+
retryConfig: context.retryConfig,
|
|
194
|
+
retryCodes: context.retryCodes,
|
|
195
|
+
});
|
|
196
|
+
if (!doResult.ok) {
|
|
197
|
+
return [doResult, { status: "request-error", request: req }];
|
|
198
|
+
}
|
|
199
|
+
const response = doResult.value;
|
|
200
|
+
|
|
201
|
+
const responseFields = {
|
|
202
|
+
HttpMeta: { Response: response, Request: req },
|
|
203
|
+
};
|
|
204
|
+
|
|
205
|
+
const [result] = await M.match<
|
|
206
|
+
operations.UploadAvatarResponse | undefined,
|
|
207
|
+
| errors.GenericError
|
|
208
|
+
| MoovError
|
|
209
|
+
| ResponseValidationError
|
|
210
|
+
| ConnectionError
|
|
211
|
+
| RequestAbortedError
|
|
212
|
+
| RequestTimeoutError
|
|
213
|
+
| InvalidRequestError
|
|
214
|
+
| UnexpectedClientError
|
|
215
|
+
| SDKValidationError
|
|
216
|
+
>(
|
|
217
|
+
M.nil(204, types$.optional(operations.UploadAvatarResponse$inboundSchema), {
|
|
218
|
+
hdrs: true,
|
|
219
|
+
}),
|
|
220
|
+
M.jsonErr(400, errors.GenericError$inboundSchema, { hdrs: true }),
|
|
221
|
+
M.fail([401, 403, 404, 413, 415, 429]),
|
|
222
|
+
M.fail([500, 504]),
|
|
223
|
+
M.fail("4XX"),
|
|
224
|
+
M.fail("5XX"),
|
|
225
|
+
)(response, req, { extraFields: responseFields });
|
|
226
|
+
if (!result.ok) {
|
|
227
|
+
return [result, { status: "complete", request: req, response }];
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
return [result, { status: "complete", request: req, response }];
|
|
231
|
+
}
|
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import { MoovCore } from "../core.js";
|
|
6
|
+
import { matchStatusCode } from "../lib/http.js";
|
|
7
|
+
import * as M from "../lib/matchers.js";
|
|
8
|
+
import { compactMap } from "../lib/primitives.js";
|
|
9
|
+
import { RequestOptions } from "../lib/sdks.js";
|
|
10
|
+
import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
|
|
11
|
+
import { pathToFunc } from "../lib/url.js";
|
|
12
|
+
import {
|
|
13
|
+
ConnectionError,
|
|
14
|
+
InvalidRequestError,
|
|
15
|
+
RequestAbortedError,
|
|
16
|
+
RequestTimeoutError,
|
|
17
|
+
UnexpectedClientError,
|
|
18
|
+
} from "../models/errors/httpclienterrors.js";
|
|
19
|
+
import { MoovError } from "../models/errors/mooverror.js";
|
|
20
|
+
import { ResponseValidationError } from "../models/errors/responsevalidationerror.js";
|
|
21
|
+
import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
|
|
22
|
+
import * as operations from "../models/operations/index.js";
|
|
23
|
+
import { APICall, APIPromise } from "../types/async.js";
|
|
24
|
+
import { Result } from "../types/fp.js";
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* Returns the full, read-only list of product categories from the product taxonomy.
|
|
28
|
+
*/
|
|
29
|
+
export function productsListCategories(
|
|
30
|
+
client: MoovCore,
|
|
31
|
+
options?: RequestOptions,
|
|
32
|
+
): APIPromise<
|
|
33
|
+
Result<
|
|
34
|
+
operations.ListProductCategoriesResponse,
|
|
35
|
+
| MoovError
|
|
36
|
+
| ResponseValidationError
|
|
37
|
+
| ConnectionError
|
|
38
|
+
| RequestAbortedError
|
|
39
|
+
| RequestTimeoutError
|
|
40
|
+
| InvalidRequestError
|
|
41
|
+
| UnexpectedClientError
|
|
42
|
+
| SDKValidationError
|
|
43
|
+
>
|
|
44
|
+
> {
|
|
45
|
+
return new APIPromise($do(
|
|
46
|
+
client,
|
|
47
|
+
options,
|
|
48
|
+
));
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
async function $do(
|
|
52
|
+
client: MoovCore,
|
|
53
|
+
options?: RequestOptions,
|
|
54
|
+
): Promise<
|
|
55
|
+
[
|
|
56
|
+
Result<
|
|
57
|
+
operations.ListProductCategoriesResponse,
|
|
58
|
+
| MoovError
|
|
59
|
+
| ResponseValidationError
|
|
60
|
+
| ConnectionError
|
|
61
|
+
| RequestAbortedError
|
|
62
|
+
| RequestTimeoutError
|
|
63
|
+
| InvalidRequestError
|
|
64
|
+
| UnexpectedClientError
|
|
65
|
+
| SDKValidationError
|
|
66
|
+
>,
|
|
67
|
+
APICall,
|
|
68
|
+
]
|
|
69
|
+
> {
|
|
70
|
+
const path = pathToFunc("/product-categories")();
|
|
71
|
+
|
|
72
|
+
const headers = new Headers(compactMap({
|
|
73
|
+
Accept: "application/json",
|
|
74
|
+
}));
|
|
75
|
+
|
|
76
|
+
const securityInput = await extractSecurity(client._options.security);
|
|
77
|
+
const requestSecurity = resolveGlobalSecurity(securityInput);
|
|
78
|
+
|
|
79
|
+
const context = {
|
|
80
|
+
options: client._options,
|
|
81
|
+
baseURL: options?.serverURL ?? client._baseURL ?? "",
|
|
82
|
+
operationID: "listProductCategories",
|
|
83
|
+
oAuth2Scopes: null,
|
|
84
|
+
|
|
85
|
+
resolvedSecurity: requestSecurity,
|
|
86
|
+
|
|
87
|
+
securitySource: client._options.security,
|
|
88
|
+
retryConfig: options?.retries
|
|
89
|
+
|| client._options.retryConfig
|
|
90
|
+
|| { strategy: "none" },
|
|
91
|
+
retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
|
|
92
|
+
};
|
|
93
|
+
|
|
94
|
+
const requestRes = client._createRequest(context, {
|
|
95
|
+
security: requestSecurity,
|
|
96
|
+
method: "GET",
|
|
97
|
+
baseURL: options?.serverURL,
|
|
98
|
+
path: path,
|
|
99
|
+
headers: headers,
|
|
100
|
+
userAgent: client._options.userAgent,
|
|
101
|
+
timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
|
|
102
|
+
}, options);
|
|
103
|
+
if (!requestRes.ok) {
|
|
104
|
+
return [requestRes, { status: "invalid" }];
|
|
105
|
+
}
|
|
106
|
+
const req = requestRes.value;
|
|
107
|
+
|
|
108
|
+
const doResult = await client._do(req, {
|
|
109
|
+
context,
|
|
110
|
+
isErrorStatusCode: (statusCode: number) =>
|
|
111
|
+
matchStatusCode({ status: statusCode } as Response, ["4XX", "5XX"]),
|
|
112
|
+
retryConfig: context.retryConfig,
|
|
113
|
+
retryCodes: context.retryCodes,
|
|
114
|
+
});
|
|
115
|
+
if (!doResult.ok) {
|
|
116
|
+
return [doResult, { status: "request-error", request: req }];
|
|
117
|
+
}
|
|
118
|
+
const response = doResult.value;
|
|
119
|
+
|
|
120
|
+
const responseFields = {
|
|
121
|
+
HttpMeta: { Response: response, Request: req },
|
|
122
|
+
};
|
|
123
|
+
|
|
124
|
+
const [result] = await M.match<
|
|
125
|
+
operations.ListProductCategoriesResponse,
|
|
126
|
+
| MoovError
|
|
127
|
+
| ResponseValidationError
|
|
128
|
+
| ConnectionError
|
|
129
|
+
| RequestAbortedError
|
|
130
|
+
| RequestTimeoutError
|
|
131
|
+
| InvalidRequestError
|
|
132
|
+
| UnexpectedClientError
|
|
133
|
+
| SDKValidationError
|
|
134
|
+
>(
|
|
135
|
+
M.json(200, operations.ListProductCategoriesResponse$inboundSchema, {
|
|
136
|
+
hdrs: true,
|
|
137
|
+
key: "Result",
|
|
138
|
+
}),
|
|
139
|
+
M.fail([401, 403, 429]),
|
|
140
|
+
M.fail([500, 504]),
|
|
141
|
+
M.fail("4XX"),
|
|
142
|
+
M.fail("5XX"),
|
|
143
|
+
)(response, req, { extraFields: responseFields });
|
|
144
|
+
if (!result.ok) {
|
|
145
|
+
return [result, { status: "complete", request: req, response }];
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
return [result, { status: "complete", request: req, response }];
|
|
149
|
+
}
|
package/src/lib/config.ts
CHANGED
|
@@ -73,8 +73,8 @@ export function serverURLFromOptions(options: SDKOptions): URL | null {
|
|
|
73
73
|
export const SDK_METADATA = {
|
|
74
74
|
language: "typescript",
|
|
75
75
|
openapiDocVersion: "v2026.10.00",
|
|
76
|
-
sdkVersion: "26.10.0-dev.
|
|
77
|
-
genVersion: "2.
|
|
76
|
+
sdkVersion: "26.10.0-dev.1",
|
|
77
|
+
genVersion: "2.924.0",
|
|
78
78
|
userAgent:
|
|
79
|
-
"speakeasy-sdk/typescript 26.10.0-dev.
|
|
79
|
+
"speakeasy-sdk/typescript 26.10.0-dev.1 2.924.0 v2026.10.00 @moovio/sdk",
|
|
80
80
|
} as const;
|
package/src/mcp-server/server.ts
CHANGED
|
@@ -134,6 +134,7 @@ import { tool$productsCreate } from "./tools/productsCreate.js";
|
|
|
134
134
|
import { tool$productsDisable } from "./tools/productsDisable.js";
|
|
135
135
|
import { tool$productsGet } from "./tools/productsGet.js";
|
|
136
136
|
import { tool$productsList } from "./tools/productsList.js";
|
|
137
|
+
import { tool$productsListCategories } from "./tools/productsListCategories.js";
|
|
137
138
|
import { tool$productsUpdate } from "./tools/productsUpdate.js";
|
|
138
139
|
import { tool$receiptsCreate } from "./tools/receiptsCreate.js";
|
|
139
140
|
import { tool$receiptsList } from "./tools/receiptsList.js";
|
|
@@ -216,7 +217,7 @@ export function createMCPServer(deps: {
|
|
|
216
217
|
}) {
|
|
217
218
|
const server = new McpServer({
|
|
218
219
|
name: "Moov",
|
|
219
|
-
version: "26.10.0-dev.
|
|
220
|
+
version: "26.10.0-dev.1",
|
|
220
221
|
});
|
|
221
222
|
|
|
222
223
|
const client = new MoovCore({
|
|
@@ -339,6 +340,7 @@ export function createMCPServer(deps: {
|
|
|
339
340
|
tool(tool$productsGet);
|
|
340
341
|
tool(tool$productsUpdate);
|
|
341
342
|
tool(tool$productsDisable);
|
|
343
|
+
tool(tool$productsListCategories);
|
|
342
344
|
tool(tool$representativesCreate);
|
|
343
345
|
tool(tool$representativesList);
|
|
344
346
|
tool(tool$representativesDelete);
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import { productsListCategories } from "../../funcs/productsListCategories.js";
|
|
6
|
+
import { formatResult, ToolDefinition } from "../tools.js";
|
|
7
|
+
|
|
8
|
+
export const tool$productsListCategories: ToolDefinition = {
|
|
9
|
+
name: "products-list-categories",
|
|
10
|
+
description:
|
|
11
|
+
`Returns the full, read-only list of product categories from the product taxonomy.`,
|
|
12
|
+
tool: async (client, ctx) => {
|
|
13
|
+
const [result, apiCall] = await productsListCategories(
|
|
14
|
+
client,
|
|
15
|
+
{ fetchOptions: { signal: ctx.signal } },
|
|
16
|
+
).$inspect();
|
|
17
|
+
|
|
18
|
+
if (!result.ok) {
|
|
19
|
+
return {
|
|
20
|
+
content: [{ type: "text", text: result.error.message }],
|
|
21
|
+
isError: true,
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
const value = result.value.result;
|
|
26
|
+
|
|
27
|
+
return formatResult(value, apiCall);
|
|
28
|
+
},
|
|
29
|
+
};
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod/v3";
|
|
6
|
+
import { safeParse } from "../../lib/schemas.js";
|
|
7
|
+
import { blobLikeSchema } from "../../types/blobs.js";
|
|
8
|
+
import { Result as SafeParseResult } from "../../types/fp.js";
|
|
9
|
+
import * as types from "../../types/primitives.js";
|
|
10
|
+
import { SDKValidationError } from "../errors/sdkvalidationerror.js";
|
|
11
|
+
|
|
12
|
+
export type AvatarUploadRequestFile = {
|
|
13
|
+
fileName: string;
|
|
14
|
+
content: ReadableStream<Uint8Array> | Blob | ArrayBuffer | Uint8Array;
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
export type AvatarUploadRequest = {
|
|
18
|
+
/**
|
|
19
|
+
* A JPEG, PNG, or WebP image file to upload as an avatar.
|
|
20
|
+
*/
|
|
21
|
+
file: AvatarUploadRequestFile | Blob;
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
/** @internal */
|
|
25
|
+
export const AvatarUploadRequestFile$inboundSchema: z.ZodType<
|
|
26
|
+
AvatarUploadRequestFile,
|
|
27
|
+
z.ZodTypeDef,
|
|
28
|
+
unknown
|
|
29
|
+
> = z.object({
|
|
30
|
+
fileName: types.string(),
|
|
31
|
+
content: z.union([
|
|
32
|
+
z.instanceof(ReadableStream<Uint8Array>),
|
|
33
|
+
z.instanceof(Blob),
|
|
34
|
+
z.instanceof(ArrayBuffer),
|
|
35
|
+
z.instanceof(Uint8Array),
|
|
36
|
+
]),
|
|
37
|
+
});
|
|
38
|
+
/** @internal */
|
|
39
|
+
export type AvatarUploadRequestFile$Outbound = {
|
|
40
|
+
fileName: string;
|
|
41
|
+
content: ReadableStream<Uint8Array> | Blob | ArrayBuffer | Uint8Array;
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
/** @internal */
|
|
45
|
+
export const AvatarUploadRequestFile$outboundSchema: z.ZodType<
|
|
46
|
+
AvatarUploadRequestFile$Outbound,
|
|
47
|
+
z.ZodTypeDef,
|
|
48
|
+
AvatarUploadRequestFile
|
|
49
|
+
> = z.object({
|
|
50
|
+
fileName: z.string(),
|
|
51
|
+
content: z.union([
|
|
52
|
+
z.instanceof(ReadableStream<Uint8Array>),
|
|
53
|
+
z.instanceof(Blob),
|
|
54
|
+
z.instanceof(ArrayBuffer),
|
|
55
|
+
z.instanceof(Uint8Array),
|
|
56
|
+
]),
|
|
57
|
+
});
|
|
58
|
+
|
|
59
|
+
export function avatarUploadRequestFileToJSON(
|
|
60
|
+
avatarUploadRequestFile: AvatarUploadRequestFile,
|
|
61
|
+
): string {
|
|
62
|
+
return JSON.stringify(
|
|
63
|
+
AvatarUploadRequestFile$outboundSchema.parse(avatarUploadRequestFile),
|
|
64
|
+
);
|
|
65
|
+
}
|
|
66
|
+
export function avatarUploadRequestFileFromJSON(
|
|
67
|
+
jsonString: string,
|
|
68
|
+
): SafeParseResult<AvatarUploadRequestFile, SDKValidationError> {
|
|
69
|
+
return safeParse(
|
|
70
|
+
jsonString,
|
|
71
|
+
(x) => AvatarUploadRequestFile$inboundSchema.parse(JSON.parse(x)),
|
|
72
|
+
`Failed to parse 'AvatarUploadRequestFile' from JSON`,
|
|
73
|
+
);
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
/** @internal */
|
|
77
|
+
export const AvatarUploadRequest$inboundSchema: z.ZodType<
|
|
78
|
+
AvatarUploadRequest,
|
|
79
|
+
z.ZodTypeDef,
|
|
80
|
+
unknown
|
|
81
|
+
> = z.object({
|
|
82
|
+
file: z.lazy(() => AvatarUploadRequestFile$inboundSchema),
|
|
83
|
+
});
|
|
84
|
+
/** @internal */
|
|
85
|
+
export type AvatarUploadRequest$Outbound = {
|
|
86
|
+
file: AvatarUploadRequestFile$Outbound | Blob;
|
|
87
|
+
};
|
|
88
|
+
|
|
89
|
+
/** @internal */
|
|
90
|
+
export const AvatarUploadRequest$outboundSchema: z.ZodType<
|
|
91
|
+
AvatarUploadRequest$Outbound,
|
|
92
|
+
z.ZodTypeDef,
|
|
93
|
+
AvatarUploadRequest
|
|
94
|
+
> = z.object({
|
|
95
|
+
file: z.lazy(() => AvatarUploadRequestFile$outboundSchema).or(blobLikeSchema),
|
|
96
|
+
});
|
|
97
|
+
|
|
98
|
+
export function avatarUploadRequestToJSON(
|
|
99
|
+
avatarUploadRequest: AvatarUploadRequest,
|
|
100
|
+
): string {
|
|
101
|
+
return JSON.stringify(
|
|
102
|
+
AvatarUploadRequest$outboundSchema.parse(avatarUploadRequest),
|
|
103
|
+
);
|
|
104
|
+
}
|
|
105
|
+
export function avatarUploadRequestFromJSON(
|
|
106
|
+
jsonString: string,
|
|
107
|
+
): SafeParseResult<AvatarUploadRequest, SDKValidationError> {
|
|
108
|
+
return safeParse(
|
|
109
|
+
jsonString,
|
|
110
|
+
(x) => AvatarUploadRequest$inboundSchema.parse(JSON.parse(x)),
|
|
111
|
+
`Failed to parse 'AvatarUploadRequest' from JSON`,
|
|
112
|
+
);
|
|
113
|
+
}
|
|
@@ -27,6 +27,7 @@ export const CapabilityID = {
|
|
|
27
27
|
SendFundsAch: "send-funds.ach",
|
|
28
28
|
SendFundsRtp: "send-funds.rtp",
|
|
29
29
|
SendFundsInstantBank: "send-funds.instant-bank",
|
|
30
|
+
SendFundsWire: "send-funds.wire",
|
|
30
31
|
CollectFunds: "collect-funds",
|
|
31
32
|
CollectFundsCardPayments: "collect-funds.card-payments",
|
|
32
33
|
MoneyTransferPullFromCard: "money-transfer.pull-from-card",
|
|
@@ -43,6 +43,12 @@ import {
|
|
|
43
43
|
FacilitatorFee$Outbound,
|
|
44
44
|
FacilitatorFee$outboundSchema,
|
|
45
45
|
} from "./facilitatorfee.js";
|
|
46
|
+
import {
|
|
47
|
+
TransferFeePaidBy,
|
|
48
|
+
TransferFeePaidBy$inboundSchema,
|
|
49
|
+
TransferFeePaidBy$Outbound,
|
|
50
|
+
TransferFeePaidBy$outboundSchema,
|
|
51
|
+
} from "./transferfeepaidby.js";
|
|
46
52
|
|
|
47
53
|
export type CreateTransfer = {
|
|
48
54
|
/**
|
|
@@ -78,6 +84,10 @@ export type CreateTransfer = {
|
|
|
78
84
|
*/
|
|
79
85
|
lineItems?: CreateTransferLineItems | undefined;
|
|
80
86
|
amountDetails?: CreateTransferAmountDetails | undefined;
|
|
87
|
+
/**
|
|
88
|
+
* Indicates which party bears fees for the transfer, keyed by fee type.
|
|
89
|
+
*/
|
|
90
|
+
feePaidBy?: TransferFeePaidBy | undefined;
|
|
81
91
|
};
|
|
82
92
|
|
|
83
93
|
/** @internal */
|
|
@@ -95,6 +105,7 @@ export const CreateTransfer$inboundSchema: z.ZodType<
|
|
|
95
105
|
foreignID: types.optional(types.string()),
|
|
96
106
|
lineItems: types.optional(CreateTransferLineItems$inboundSchema),
|
|
97
107
|
amountDetails: types.optional(CreateTransferAmountDetails$inboundSchema),
|
|
108
|
+
feePaidBy: types.optional(TransferFeePaidBy$inboundSchema),
|
|
98
109
|
});
|
|
99
110
|
/** @internal */
|
|
100
111
|
export type CreateTransfer$Outbound = {
|
|
@@ -107,6 +118,7 @@ export type CreateTransfer$Outbound = {
|
|
|
107
118
|
foreignID?: string | undefined;
|
|
108
119
|
lineItems?: CreateTransferLineItems$Outbound | undefined;
|
|
109
120
|
amountDetails?: CreateTransferAmountDetails$Outbound | undefined;
|
|
121
|
+
feePaidBy?: TransferFeePaidBy$Outbound | undefined;
|
|
110
122
|
};
|
|
111
123
|
|
|
112
124
|
/** @internal */
|
|
@@ -124,6 +136,7 @@ export const CreateTransfer$outboundSchema: z.ZodType<
|
|
|
124
136
|
foreignID: z.string().optional(),
|
|
125
137
|
lineItems: CreateTransferLineItems$outboundSchema.optional(),
|
|
126
138
|
amountDetails: CreateTransferAmountDetails$outboundSchema.optional(),
|
|
139
|
+
feePaidBy: TransferFeePaidBy$outboundSchema.optional(),
|
|
127
140
|
});
|
|
128
141
|
|
|
129
142
|
export function createTransferToJSON(createTransfer: CreateTransfer): string {
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod/v3";
|
|
6
|
+
import * as openEnums from "../../types/enums.js";
|
|
7
|
+
import { OpenEnum } from "../../types/enums.js";
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Indicates which party to a money movement bears an incurred fee.
|
|
11
|
+
*/
|
|
12
|
+
export const FeePaidBy = {
|
|
13
|
+
Source: "source",
|
|
14
|
+
Destination: "destination",
|
|
15
|
+
} as const;
|
|
16
|
+
/**
|
|
17
|
+
* Indicates which party to a money movement bears an incurred fee.
|
|
18
|
+
*/
|
|
19
|
+
export type FeePaidBy = OpenEnum<typeof FeePaidBy>;
|
|
20
|
+
|
|
21
|
+
/** @internal */
|
|
22
|
+
export const FeePaidBy$inboundSchema: z.ZodType<
|
|
23
|
+
FeePaidBy,
|
|
24
|
+
z.ZodTypeDef,
|
|
25
|
+
unknown
|
|
26
|
+
> = openEnums.inboundSchema(FeePaidBy);
|
|
27
|
+
/** @internal */
|
|
28
|
+
export const FeePaidBy$outboundSchema: z.ZodType<
|
|
29
|
+
string,
|
|
30
|
+
z.ZodTypeDef,
|
|
31
|
+
FeePaidBy
|
|
32
|
+
> = openEnums.outboundSchema(FeePaidBy);
|