@moovio/sdk 26.7.0-dev.6 → 26.7.0
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 +510 -183
- package/bin/mcp-server.js.map +35 -25
- 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.d.ts.map +1 -1
- package/lib/config.js +3 -3
- package/lib/config.js.map +1 -1
- package/mcp-server/mcp-server.js +1 -1
- package/mcp-server/mcp-server.js.map +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/filedetails.d.ts +1 -1
- package/models/components/filepurpose.d.ts +2 -2
- package/models/components/filepurpose.js +1 -1
- 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/onboardinginvite.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 -4
- 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/filedetails.ts +1 -1
- package/src/models/components/filepurpose.ts +2 -2
- 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/onboardinginvite.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,194 @@
|
|
|
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 { matchStatusCode } from "../lib/http.js";
|
|
8
|
+
import * as M from "../lib/matchers.js";
|
|
9
|
+
import { compactMap } from "../lib/primitives.js";
|
|
10
|
+
import { safeParse } from "../lib/schemas.js";
|
|
11
|
+
import { RequestOptions } from "../lib/sdks.js";
|
|
12
|
+
import { resolveSecurity } from "../lib/security.js";
|
|
13
|
+
import { pathToFunc } from "../lib/url.js";
|
|
14
|
+
import {
|
|
15
|
+
ConnectionError,
|
|
16
|
+
InvalidRequestError,
|
|
17
|
+
RequestAbortedError,
|
|
18
|
+
RequestTimeoutError,
|
|
19
|
+
UnexpectedClientError,
|
|
20
|
+
} from "../models/errors/httpclienterrors.js";
|
|
21
|
+
import * as errors from "../models/errors/index.js";
|
|
22
|
+
import { MoovError } from "../models/errors/mooverror.js";
|
|
23
|
+
import { ResponseValidationError } from "../models/errors/responsevalidationerror.js";
|
|
24
|
+
import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
|
|
25
|
+
import * as operations from "../models/operations/index.js";
|
|
26
|
+
import { APICall, APIPromise } from "../types/async.js";
|
|
27
|
+
import { Result } from "../types/fp.js";
|
|
28
|
+
import * as types$ from "../types/primitives.js";
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* Delete a user-uploaded avatar for an account.
|
|
32
|
+
*
|
|
33
|
+
* After deletion, the avatar endpoint will fall back to the enriched avatar
|
|
34
|
+
* or an account-type-aware fallback icon.
|
|
35
|
+
*
|
|
36
|
+
* This endpoint only accepts accountID values for the uniqueID parameter.
|
|
37
|
+
*
|
|
38
|
+
* To access this endpoint using an [access token](https://docs.moov.io/api/authentication/access-tokens/)
|
|
39
|
+
* you'll need to specify the `/accounts.write` scope.
|
|
40
|
+
*/
|
|
41
|
+
export function avatarsDelete(
|
|
42
|
+
client: MoovCore,
|
|
43
|
+
security: operations.DeleteAvatarSecurity,
|
|
44
|
+
request: operations.DeleteAvatarRequest,
|
|
45
|
+
options?: RequestOptions,
|
|
46
|
+
): APIPromise<
|
|
47
|
+
Result<
|
|
48
|
+
operations.DeleteAvatarResponse | undefined,
|
|
49
|
+
| errors.GenericError
|
|
50
|
+
| MoovError
|
|
51
|
+
| ResponseValidationError
|
|
52
|
+
| ConnectionError
|
|
53
|
+
| RequestAbortedError
|
|
54
|
+
| RequestTimeoutError
|
|
55
|
+
| InvalidRequestError
|
|
56
|
+
| UnexpectedClientError
|
|
57
|
+
| SDKValidationError
|
|
58
|
+
>
|
|
59
|
+
> {
|
|
60
|
+
return new APIPromise($do(
|
|
61
|
+
client,
|
|
62
|
+
security,
|
|
63
|
+
request,
|
|
64
|
+
options,
|
|
65
|
+
));
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
async function $do(
|
|
69
|
+
client: MoovCore,
|
|
70
|
+
security: operations.DeleteAvatarSecurity,
|
|
71
|
+
request: operations.DeleteAvatarRequest,
|
|
72
|
+
options?: RequestOptions,
|
|
73
|
+
): Promise<
|
|
74
|
+
[
|
|
75
|
+
Result<
|
|
76
|
+
operations.DeleteAvatarResponse | undefined,
|
|
77
|
+
| errors.GenericError
|
|
78
|
+
| MoovError
|
|
79
|
+
| ResponseValidationError
|
|
80
|
+
| ConnectionError
|
|
81
|
+
| RequestAbortedError
|
|
82
|
+
| RequestTimeoutError
|
|
83
|
+
| InvalidRequestError
|
|
84
|
+
| UnexpectedClientError
|
|
85
|
+
| SDKValidationError
|
|
86
|
+
>,
|
|
87
|
+
APICall,
|
|
88
|
+
]
|
|
89
|
+
> {
|
|
90
|
+
const parsed = safeParse(
|
|
91
|
+
request,
|
|
92
|
+
(value) => operations.DeleteAvatarRequest$outboundSchema.parse(value),
|
|
93
|
+
"Input validation failed",
|
|
94
|
+
);
|
|
95
|
+
if (!parsed.ok) {
|
|
96
|
+
return [parsed, { status: "invalid" }];
|
|
97
|
+
}
|
|
98
|
+
const payload = parsed.value;
|
|
99
|
+
const body = null;
|
|
100
|
+
|
|
101
|
+
const pathParams = {
|
|
102
|
+
uniqueID: encodeSimple("uniqueID", payload.uniqueID, {
|
|
103
|
+
explode: false,
|
|
104
|
+
charEncoding: "percent",
|
|
105
|
+
}),
|
|
106
|
+
};
|
|
107
|
+
const path = pathToFunc("/avatars/{uniqueID}")(pathParams);
|
|
108
|
+
|
|
109
|
+
const headers = new Headers(compactMap({
|
|
110
|
+
Accept: "application/json",
|
|
111
|
+
}));
|
|
112
|
+
|
|
113
|
+
const requestSecurity = resolveSecurity(
|
|
114
|
+
[
|
|
115
|
+
{
|
|
116
|
+
type: "http:basic",
|
|
117
|
+
value: { username: security?.username, password: security?.password },
|
|
118
|
+
},
|
|
119
|
+
],
|
|
120
|
+
);
|
|
121
|
+
|
|
122
|
+
const context = {
|
|
123
|
+
options: client._options,
|
|
124
|
+
baseURL: options?.serverURL ?? client._baseURL ?? "",
|
|
125
|
+
operationID: "deleteAvatar",
|
|
126
|
+
oAuth2Scopes: ["/accounts.write"],
|
|
127
|
+
|
|
128
|
+
resolvedSecurity: requestSecurity,
|
|
129
|
+
|
|
130
|
+
securitySource: security,
|
|
131
|
+
retryConfig: options?.retries
|
|
132
|
+
|| client._options.retryConfig
|
|
133
|
+
|| { strategy: "none" },
|
|
134
|
+
retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
|
|
135
|
+
};
|
|
136
|
+
|
|
137
|
+
const requestRes = client._createRequest(context, {
|
|
138
|
+
security: requestSecurity,
|
|
139
|
+
method: "DELETE",
|
|
140
|
+
baseURL: options?.serverURL,
|
|
141
|
+
path: path,
|
|
142
|
+
headers: headers,
|
|
143
|
+
body: body,
|
|
144
|
+
userAgent: client._options.userAgent,
|
|
145
|
+
timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
|
|
146
|
+
}, options);
|
|
147
|
+
if (!requestRes.ok) {
|
|
148
|
+
return [requestRes, { status: "invalid" }];
|
|
149
|
+
}
|
|
150
|
+
const req = requestRes.value;
|
|
151
|
+
|
|
152
|
+
const doResult = await client._do(req, {
|
|
153
|
+
context,
|
|
154
|
+
isErrorStatusCode: (statusCode: number) =>
|
|
155
|
+
matchStatusCode({ status: statusCode } as Response, ["4XX", "5XX"]),
|
|
156
|
+
retryConfig: context.retryConfig,
|
|
157
|
+
retryCodes: context.retryCodes,
|
|
158
|
+
});
|
|
159
|
+
if (!doResult.ok) {
|
|
160
|
+
return [doResult, { status: "request-error", request: req }];
|
|
161
|
+
}
|
|
162
|
+
const response = doResult.value;
|
|
163
|
+
|
|
164
|
+
const responseFields = {
|
|
165
|
+
HttpMeta: { Response: response, Request: req },
|
|
166
|
+
};
|
|
167
|
+
|
|
168
|
+
const [result] = await M.match<
|
|
169
|
+
operations.DeleteAvatarResponse | undefined,
|
|
170
|
+
| errors.GenericError
|
|
171
|
+
| MoovError
|
|
172
|
+
| ResponseValidationError
|
|
173
|
+
| ConnectionError
|
|
174
|
+
| RequestAbortedError
|
|
175
|
+
| RequestTimeoutError
|
|
176
|
+
| InvalidRequestError
|
|
177
|
+
| UnexpectedClientError
|
|
178
|
+
| SDKValidationError
|
|
179
|
+
>(
|
|
180
|
+
M.nil(204, types$.optional(operations.DeleteAvatarResponse$inboundSchema), {
|
|
181
|
+
hdrs: true,
|
|
182
|
+
}),
|
|
183
|
+
M.jsonErr(400, errors.GenericError$inboundSchema, { hdrs: true }),
|
|
184
|
+
M.fail([401, 403, 404, 429]),
|
|
185
|
+
M.fail([500, 504]),
|
|
186
|
+
M.fail("4XX"),
|
|
187
|
+
M.fail("5XX"),
|
|
188
|
+
)(response, req, { extraFields: responseFields });
|
|
189
|
+
if (!result.ok) {
|
|
190
|
+
return [result, { status: "complete", request: req, response }];
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
return [result, { status: "complete", request: req, response }];
|
|
194
|
+
}
|
|
@@ -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,7 @@ export function serverURLFromOptions(options: SDKOptions): URL | null {
|
|
|
73
73
|
export const SDK_METADATA = {
|
|
74
74
|
language: "typescript",
|
|
75
75
|
openapiDocVersion: "v2026.07.00",
|
|
76
|
-
sdkVersion: "26.7.0
|
|
77
|
-
genVersion: "2.
|
|
78
|
-
userAgent:
|
|
79
|
-
"speakeasy-sdk/typescript 26.7.0-dev.6 2.917.0 v2026.07.00 @moovio/sdk",
|
|
76
|
+
sdkVersion: "26.7.0",
|
|
77
|
+
genVersion: "2.924.0",
|
|
78
|
+
userAgent: "speakeasy-sdk/typescript 26.7.0 2.924.0 v2026.07.00 @moovio/sdk",
|
|
80
79
|
} 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";
|
|
@@ -215,7 +216,7 @@ export function createMCPServer(deps: {
|
|
|
215
216
|
}) {
|
|
216
217
|
const server = new McpServer({
|
|
217
218
|
name: "Moov",
|
|
218
|
-
version: "26.7.0
|
|
219
|
+
version: "26.7.0",
|
|
219
220
|
});
|
|
220
221
|
|
|
221
222
|
const client = new MoovCore({
|
|
@@ -338,6 +339,7 @@ export function createMCPServer(deps: {
|
|
|
338
339
|
tool(tool$productsGet);
|
|
339
340
|
tool(tool$productsUpdate);
|
|
340
341
|
tool(tool$productsDisable);
|
|
342
|
+
tool(tool$productsListCategories);
|
|
341
343
|
tool(tool$representativesCreate);
|
|
342
344
|
tool(tool$representativesList);
|
|
343
345
|
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
|
+
};
|