@moovio/sdk 0.16.6 → 0.17.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.
Files changed (112) hide show
  1. package/README.md +60 -45
  2. package/bin/mcp-server.js +1162 -585
  3. package/bin/mcp-server.js.map +24 -13
  4. package/docs/sdks/images/README.md +190 -0
  5. package/examples/package-lock.json +1 -1
  6. package/funcs/imagesUpdate.d.ts +19 -0
  7. package/funcs/imagesUpdate.d.ts.map +1 -0
  8. package/funcs/imagesUpdate.js +170 -0
  9. package/funcs/imagesUpdate.js.map +1 -0
  10. package/funcs/imagesUpload.d.ts +16 -0
  11. package/funcs/imagesUpload.d.ts.map +1 -0
  12. package/funcs/imagesUpload.js +161 -0
  13. package/funcs/imagesUpload.js.map +1 -0
  14. package/jsr.json +1 -1
  15. package/lib/config.d.ts +3 -3
  16. package/lib/config.js +3 -3
  17. package/lib/config.js.map +1 -1
  18. package/mcp-server/mcp-server.js +1 -1
  19. package/mcp-server/server.d.ts.map +1 -1
  20. package/mcp-server/server.js +5 -1
  21. package/mcp-server/server.js.map +1 -1
  22. package/mcp-server/tools/imagesUpdate.d.ts +8 -0
  23. package/mcp-server/tools/imagesUpdate.d.ts.map +1 -0
  24. package/mcp-server/tools/imagesUpdate.js +66 -0
  25. package/mcp-server/tools/imagesUpdate.js.map +1 -0
  26. package/mcp-server/tools/imagesUpload.d.ts +8 -0
  27. package/mcp-server/tools/imagesUpload.d.ts.map +1 -0
  28. package/mcp-server/tools/imagesUpload.js +63 -0
  29. package/mcp-server/tools/imagesUpload.js.map +1 -0
  30. package/models/components/generatedbyaccountid.d.ts +1 -1
  31. package/models/components/generatedbyaccountid.d.ts.map +1 -1
  32. package/models/components/generatedbyaccountid.js +1 -10
  33. package/models/components/generatedbyaccountid.js.map +1 -1
  34. package/models/components/generatedbybankaccountid.d.ts +1 -1
  35. package/models/components/generatedbybankaccountid.d.ts.map +1 -1
  36. package/models/components/generatedbybankaccountid.js +1 -10
  37. package/models/components/generatedbybankaccountid.js.map +1 -1
  38. package/models/components/generatedbycardid.d.ts +1 -1
  39. package/models/components/generatedbycardid.d.ts.map +1 -1
  40. package/models/components/generatedbycardid.js +1 -10
  41. package/models/components/generatedbycardid.js.map +1 -1
  42. package/models/components/generatedbydisputeid.d.ts +1 -1
  43. package/models/components/generatedbydisputeid.d.ts.map +1 -1
  44. package/models/components/generatedbydisputeid.js +1 -10
  45. package/models/components/generatedbydisputeid.js.map +1 -1
  46. package/models/components/imagemetadatarequest.d.ts +35 -0
  47. package/models/components/imagemetadatarequest.d.ts.map +1 -0
  48. package/models/components/imagemetadatarequest.js +69 -0
  49. package/models/components/imagemetadatarequest.js.map +1 -0
  50. package/models/components/imagemetadatavalidationerror.d.ts +29 -0
  51. package/models/components/imagemetadatavalidationerror.d.ts.map +1 -0
  52. package/models/components/imagemetadatavalidationerror.js +69 -0
  53. package/models/components/imagemetadatavalidationerror.js.map +1 -0
  54. package/models/components/imageupdaterequestmultipart.d.ts +103 -0
  55. package/models/components/imageupdaterequestmultipart.d.ts.map +1 -0
  56. package/models/components/imageupdaterequestmultipart.js +139 -0
  57. package/models/components/imageupdaterequestmultipart.js.map +1 -0
  58. package/models/components/imageuploadrequestmultipart.d.ts +65 -0
  59. package/models/components/imageuploadrequestmultipart.d.ts.map +1 -0
  60. package/models/components/imageuploadrequestmultipart.js +113 -0
  61. package/models/components/imageuploadrequestmultipart.js.map +1 -0
  62. package/models/components/index.d.ts +4 -0
  63. package/models/components/index.d.ts.map +1 -1
  64. package/models/components/index.js +4 -0
  65. package/models/components/index.js.map +1 -1
  66. package/models/errors/imagerequestvalidationerror.d.ts +40 -0
  67. package/models/errors/imagerequestvalidationerror.d.ts.map +1 -0
  68. package/models/errors/imagerequestvalidationerror.js +91 -0
  69. package/models/errors/imagerequestvalidationerror.js.map +1 -0
  70. package/models/errors/index.d.ts +1 -0
  71. package/models/errors/index.d.ts.map +1 -1
  72. package/models/errors/index.js +1 -0
  73. package/models/errors/index.js.map +1 -1
  74. package/models/operations/index.d.ts +2 -0
  75. package/models/operations/index.d.ts.map +1 -1
  76. package/models/operations/index.js +2 -0
  77. package/models/operations/index.js.map +1 -1
  78. package/models/operations/updateimage.d.ts +103 -0
  79. package/models/operations/updateimage.d.ts.map +1 -0
  80. package/models/operations/updateimage.js +157 -0
  81. package/models/operations/updateimage.js.map +1 -0
  82. package/models/operations/uploadimage.d.ts +101 -0
  83. package/models/operations/uploadimage.d.ts.map +1 -0
  84. package/models/operations/uploadimage.js +155 -0
  85. package/models/operations/uploadimage.js.map +1 -0
  86. package/package.json +1 -1
  87. package/sdk/images.d.ts +13 -0
  88. package/sdk/images.d.ts.map +1 -1
  89. package/sdk/images.js +19 -0
  90. package/sdk/images.js.map +1 -1
  91. package/src/funcs/imagesUpdate.ts +258 -0
  92. package/src/funcs/imagesUpload.ts +249 -0
  93. package/src/lib/config.ts +3 -3
  94. package/src/mcp-server/mcp-server.ts +1 -1
  95. package/src/mcp-server/server.ts +5 -1
  96. package/src/mcp-server/tools/imagesUpdate.ts +39 -0
  97. package/src/mcp-server/tools/imagesUpload.ts +36 -0
  98. package/src/models/components/generatedbyaccountid.ts +2 -11
  99. package/src/models/components/generatedbybankaccountid.ts +2 -11
  100. package/src/models/components/generatedbycardid.ts +2 -11
  101. package/src/models/components/generatedbydisputeid.ts +2 -11
  102. package/src/models/components/imagemetadatarequest.ts +72 -0
  103. package/src/models/components/imagemetadatavalidationerror.ts +68 -0
  104. package/src/models/components/imageupdaterequestmultipart.ts +224 -0
  105. package/src/models/components/imageuploadrequestmultipart.ts +150 -0
  106. package/src/models/components/index.ts +4 -0
  107. package/src/models/errors/imagerequestvalidationerror.ts +86 -0
  108. package/src/models/errors/index.ts +1 -0
  109. package/src/models/operations/index.ts +2 -0
  110. package/src/models/operations/updateimage.ts +237 -0
  111. package/src/models/operations/uploadimage.ts +233 -0
  112. package/src/sdk/images.ts +35 -0
@@ -0,0 +1,249 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import { MoovCore } from "../core.js";
6
+ import { appendForm, encodeJSON, encodeSimple } from "../lib/encodings.js";
7
+ import {
8
+ getContentTypeFromFileName,
9
+ readableStreamToArrayBuffer,
10
+ } from "../lib/files.js";
11
+ import * as M from "../lib/matchers.js";
12
+ import { compactMap } from "../lib/primitives.js";
13
+ import { safeParse } from "../lib/schemas.js";
14
+ import { RequestOptions } from "../lib/sdks.js";
15
+ import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
16
+ import { pathToFunc } from "../lib/url.js";
17
+ import {
18
+ ConnectionError,
19
+ InvalidRequestError,
20
+ RequestAbortedError,
21
+ RequestTimeoutError,
22
+ UnexpectedClientError,
23
+ } from "../models/errors/httpclienterrors.js";
24
+ import * as errors from "../models/errors/index.js";
25
+ import { MoovError } from "../models/errors/mooverror.js";
26
+ import { ResponseValidationError } from "../models/errors/responsevalidationerror.js";
27
+ import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
28
+ import * as operations from "../models/operations/index.js";
29
+ import { APICall, APIPromise } from "../types/async.js";
30
+ import { isBlobLike } from "../types/blobs.js";
31
+ import { Result } from "../types/fp.js";
32
+ import { isReadableStream } from "../types/streams.js";
33
+
34
+ /**
35
+ * Upload a new PNG, JPEG, or WebP image with optional metadata.
36
+ * Duplicate images, and requests larger than 16MB will be rejected.
37
+ */
38
+ export function imagesUpload(
39
+ client: MoovCore,
40
+ request: operations.UploadImageRequest,
41
+ options?: RequestOptions,
42
+ ): APIPromise<
43
+ Result<
44
+ operations.UploadImageResponse,
45
+ | errors.GenericError
46
+ | errors.ImageRequestValidationError
47
+ | MoovError
48
+ | ResponseValidationError
49
+ | ConnectionError
50
+ | RequestAbortedError
51
+ | RequestTimeoutError
52
+ | InvalidRequestError
53
+ | UnexpectedClientError
54
+ | SDKValidationError
55
+ >
56
+ > {
57
+ return new APIPromise($do(
58
+ client,
59
+ request,
60
+ options,
61
+ ));
62
+ }
63
+
64
+ async function $do(
65
+ client: MoovCore,
66
+ request: operations.UploadImageRequest,
67
+ options?: RequestOptions,
68
+ ): Promise<
69
+ [
70
+ Result<
71
+ operations.UploadImageResponse,
72
+ | errors.GenericError
73
+ | errors.ImageRequestValidationError
74
+ | MoovError
75
+ | ResponseValidationError
76
+ | ConnectionError
77
+ | RequestAbortedError
78
+ | RequestTimeoutError
79
+ | InvalidRequestError
80
+ | UnexpectedClientError
81
+ | SDKValidationError
82
+ >,
83
+ APICall,
84
+ ]
85
+ > {
86
+ const parsed = safeParse(
87
+ request,
88
+ (value) => operations.UploadImageRequest$outboundSchema.parse(value),
89
+ "Input validation failed",
90
+ );
91
+ if (!parsed.ok) {
92
+ return [parsed, { status: "invalid" }];
93
+ }
94
+ const payload = parsed.value;
95
+ const body = new FormData();
96
+
97
+ if (isBlobLike(payload.ImageUploadRequestMultiPart.image)) {
98
+ appendForm(body, "image", payload.ImageUploadRequestMultiPart.image);
99
+ } else if (
100
+ isReadableStream(payload.ImageUploadRequestMultiPart.image.content)
101
+ ) {
102
+ const buffer = await readableStreamToArrayBuffer(
103
+ payload.ImageUploadRequestMultiPart.image.content,
104
+ );
105
+ const contentType =
106
+ getContentTypeFromFileName(
107
+ payload.ImageUploadRequestMultiPart.image.fileName,
108
+ ) || "application/octet-stream";
109
+ const blob = new Blob([buffer], { type: contentType });
110
+ appendForm(
111
+ body,
112
+ "image",
113
+ blob,
114
+ payload.ImageUploadRequestMultiPart.image.fileName,
115
+ );
116
+ } else {
117
+ const contentType =
118
+ getContentTypeFromFileName(
119
+ payload.ImageUploadRequestMultiPart.image.fileName,
120
+ ) || "application/octet-stream";
121
+ appendForm(
122
+ body,
123
+ "image",
124
+ new Blob([payload.ImageUploadRequestMultiPart.image.content], {
125
+ type: contentType,
126
+ }),
127
+ payload.ImageUploadRequestMultiPart.image.fileName,
128
+ );
129
+ }
130
+ if (payload.ImageUploadRequestMultiPart.metadata !== undefined) {
131
+ appendForm(
132
+ body,
133
+ "metadata",
134
+ encodeJSON("metadata", payload.ImageUploadRequestMultiPart.metadata, {
135
+ explode: true,
136
+ }),
137
+ );
138
+ }
139
+
140
+ const pathParams = {
141
+ accountID: encodeSimple("accountID", payload.accountID, {
142
+ explode: false,
143
+ charEncoding: "percent",
144
+ }),
145
+ };
146
+
147
+ const path = pathToFunc("/accounts/{accountID}/images")(pathParams);
148
+
149
+ const headers = new Headers(compactMap({
150
+ Accept: "application/json",
151
+ "x-moov-version": encodeSimple(
152
+ "x-moov-version",
153
+ client._options.xMoovVersion,
154
+ { explode: false, charEncoding: "none" },
155
+ ),
156
+ }));
157
+
158
+ const securityInput = await extractSecurity(client._options.security);
159
+ const requestSecurity = resolveGlobalSecurity(securityInput);
160
+
161
+ const context = {
162
+ options: client._options,
163
+ baseURL: options?.serverURL ?? client._baseURL ?? "",
164
+ operationID: "uploadImage",
165
+ oAuth2Scopes: null,
166
+
167
+ resolvedSecurity: requestSecurity,
168
+
169
+ securitySource: client._options.security,
170
+ retryConfig: options?.retries
171
+ || client._options.retryConfig
172
+ || { strategy: "none" },
173
+ retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
174
+ };
175
+
176
+ const requestRes = client._createRequest(context, {
177
+ security: requestSecurity,
178
+ method: "POST",
179
+ baseURL: options?.serverURL,
180
+ path: path,
181
+ headers: headers,
182
+ body: body,
183
+ userAgent: client._options.userAgent,
184
+ timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
185
+ }, options);
186
+ if (!requestRes.ok) {
187
+ return [requestRes, { status: "invalid" }];
188
+ }
189
+ const req = requestRes.value;
190
+
191
+ const doResult = await client._do(req, {
192
+ context,
193
+ errorCodes: [
194
+ "400",
195
+ "401",
196
+ "403",
197
+ "404",
198
+ "409",
199
+ "422",
200
+ "429",
201
+ "4XX",
202
+ "500",
203
+ "504",
204
+ "5XX",
205
+ ],
206
+ retryConfig: context.retryConfig,
207
+ retryCodes: context.retryCodes,
208
+ });
209
+ if (!doResult.ok) {
210
+ return [doResult, { status: "request-error", request: req }];
211
+ }
212
+ const response = doResult.value;
213
+
214
+ const responseFields = {
215
+ HttpMeta: { Response: response, Request: req },
216
+ };
217
+
218
+ const [result] = await M.match<
219
+ operations.UploadImageResponse,
220
+ | errors.GenericError
221
+ | errors.ImageRequestValidationError
222
+ | MoovError
223
+ | ResponseValidationError
224
+ | ConnectionError
225
+ | RequestAbortedError
226
+ | RequestTimeoutError
227
+ | InvalidRequestError
228
+ | UnexpectedClientError
229
+ | SDKValidationError
230
+ >(
231
+ M.json(201, operations.UploadImageResponse$inboundSchema, {
232
+ hdrs: true,
233
+ key: "Result",
234
+ }),
235
+ M.jsonErr([400, 409], errors.GenericError$inboundSchema, { hdrs: true }),
236
+ M.jsonErr(422, errors.ImageRequestValidationError$inboundSchema, {
237
+ hdrs: true,
238
+ }),
239
+ M.fail([401, 403, 404, 429]),
240
+ M.fail([500, 504]),
241
+ M.fail("4XX"),
242
+ M.fail("5XX"),
243
+ )(response, req, { extraFields: responseFields });
244
+ if (!result.ok) {
245
+ return [result, { status: "complete", request: req, response }];
246
+ }
247
+
248
+ return [result, { status: "complete", request: req, response }];
249
+ }
package/src/lib/config.ts CHANGED
@@ -73,7 +73,7 @@ export function serverURLFromOptions(options: SDKOptions): URL | null {
73
73
  export const SDK_METADATA = {
74
74
  language: "typescript",
75
75
  openapiDocVersion: "latest",
76
- sdkVersion: "0.16.6",
77
- genVersion: "2.723.11",
78
- userAgent: "speakeasy-sdk/typescript 0.16.6 2.723.11 latest @moovio/sdk",
76
+ sdkVersion: "0.17.1",
77
+ genVersion: "2.727.9",
78
+ userAgent: "speakeasy-sdk/typescript 0.17.1 2.727.9 latest @moovio/sdk",
79
79
  } as const;
@@ -19,7 +19,7 @@ const routes = buildRouteMap({
19
19
  export const app = buildApplication(routes, {
20
20
  name: "mcp",
21
21
  versionInfo: {
22
- currentVersion: "0.16.6",
22
+ currentVersion: "0.17.1",
23
23
  },
24
24
  });
25
25
 
@@ -92,6 +92,8 @@ import { tool$imagesDelete } from "./tools/imagesDelete.js";
92
92
  import { tool$imagesGetMetadata } from "./tools/imagesGetMetadata.js";
93
93
  import { tool$imagesGetPublic } from "./tools/imagesGetPublic.js";
94
94
  import { tool$imagesList } from "./tools/imagesList.js";
95
+ import { tool$imagesUpdate } from "./tools/imagesUpdate.js";
96
+ import { tool$imagesUpload } from "./tools/imagesUpload.js";
95
97
  import { tool$industriesList } from "./tools/industriesList.js";
96
98
  import { tool$institutionsSearch } from "./tools/institutionsSearch.js";
97
99
  import { tool$institutionsSearchInstitutions } from "./tools/institutionsSearchInstitutions.js";
@@ -181,7 +183,7 @@ export function createMCPServer(deps: {
181
183
  }) {
182
184
  const server = new McpServer({
183
185
  name: "Moov",
184
- version: "0.16.6",
186
+ version: "0.17.1",
185
187
  });
186
188
 
187
189
  const client = new MoovCore({
@@ -272,7 +274,9 @@ export function createMCPServer(deps: {
272
274
  tool(tool$filesList);
273
275
  tool(tool$filesGet);
274
276
  tool(tool$imagesList);
277
+ tool(tool$imagesUpload);
275
278
  tool(tool$imagesGetMetadata);
279
+ tool(tool$imagesUpdate);
276
280
  tool(tool$imagesDelete);
277
281
  tool(tool$imagesGetPublic);
278
282
  tool(tool$paymentLinksCreate);
@@ -0,0 +1,39 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import { imagesUpdate } from "../../funcs/imagesUpdate.js";
6
+ import * as operations from "../../models/operations/index.js";
7
+ import { formatResult, ToolDefinition } from "../tools.js";
8
+
9
+ const args = {
10
+ request: operations.UpdateImageRequest$inboundSchema,
11
+ };
12
+
13
+ export const tool$imagesUpdate: ToolDefinition<typeof args> = {
14
+ name: "images-update",
15
+ description: `Update an existing image and/or its metadata.
16
+
17
+ Duplicate images, and requests larger than 16MB will be rejected. Omit any
18
+ form parts you do not wish to update. Existing metadata can be cleared by
19
+ sending \`null\` for the \`metadata\` form part.`,
20
+ args,
21
+ tool: async (client, args, ctx) => {
22
+ const [result, apiCall] = await imagesUpdate(
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
+ const value = result.value.result;
36
+
37
+ return formatResult(value, apiCall);
38
+ },
39
+ };
@@ -0,0 +1,36 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import { imagesUpload } from "../../funcs/imagesUpload.js";
6
+ import * as operations from "../../models/operations/index.js";
7
+ import { formatResult, ToolDefinition } from "../tools.js";
8
+
9
+ const args = {
10
+ request: operations.UploadImageRequest$inboundSchema,
11
+ };
12
+
13
+ export const tool$imagesUpload: ToolDefinition<typeof args> = {
14
+ name: "images-upload",
15
+ description: ` Upload a new PNG, JPEG, or WebP image with optional metadata.
16
+ Duplicate images, and requests larger than 16MB will be rejected.`,
17
+ args,
18
+ tool: async (client, args, ctx) => {
19
+ const [result, apiCall] = await imagesUpload(
20
+ client,
21
+ args.request,
22
+ { fetchOptions: { signal: ctx.signal } },
23
+ ).$inspect();
24
+
25
+ if (!result.ok) {
26
+ return {
27
+ content: [{ type: "text", text: result.error.message }],
28
+ isError: true,
29
+ };
30
+ }
31
+
32
+ const value = result.value.result;
33
+
34
+ return formatResult(value, apiCall);
35
+ },
36
+ };
@@ -3,7 +3,6 @@
3
3
  */
4
4
 
5
5
  import * as z from "zod";
6
- import { remap as remap$ } from "../../lib/primitives.js";
7
6
  import { safeParse } from "../../lib/schemas.js";
8
7
  import { Result as SafeParseResult } from "../../types/fp.js";
9
8
  import { SDKValidationError } from "../errors/sdkvalidationerror.js";
@@ -18,16 +17,12 @@ export const GeneratedByAccountID$inboundSchema: z.ZodType<
18
17
  z.ZodTypeDef,
19
18
  unknown
20
19
  > = z.object({
21
- AccountID: z.string().optional(),
22
- }).transform((v) => {
23
- return remap$(v, {
24
- "AccountID": "accountID",
25
- });
20
+ accountID: z.string().optional(),
26
21
  });
27
22
 
28
23
  /** @internal */
29
24
  export type GeneratedByAccountID$Outbound = {
30
- AccountID?: string | undefined;
25
+ accountID?: string | undefined;
31
26
  };
32
27
 
33
28
  /** @internal */
@@ -37,10 +32,6 @@ export const GeneratedByAccountID$outboundSchema: z.ZodType<
37
32
  GeneratedByAccountID
38
33
  > = z.object({
39
34
  accountID: z.string().optional(),
40
- }).transform((v) => {
41
- return remap$(v, {
42
- accountID: "AccountID",
43
- });
44
35
  });
45
36
 
46
37
  /**
@@ -3,7 +3,6 @@
3
3
  */
4
4
 
5
5
  import * as z from "zod";
6
- import { remap as remap$ } from "../../lib/primitives.js";
7
6
  import { safeParse } from "../../lib/schemas.js";
8
7
  import { Result as SafeParseResult } from "../../types/fp.js";
9
8
  import { SDKValidationError } from "../errors/sdkvalidationerror.js";
@@ -18,16 +17,12 @@ export const GeneratedByBankAccountID$inboundSchema: z.ZodType<
18
17
  z.ZodTypeDef,
19
18
  unknown
20
19
  > = z.object({
21
- BankAccountID: z.string().optional(),
22
- }).transform((v) => {
23
- return remap$(v, {
24
- "BankAccountID": "bankAccountID",
25
- });
20
+ bankAccountID: z.string().optional(),
26
21
  });
27
22
 
28
23
  /** @internal */
29
24
  export type GeneratedByBankAccountID$Outbound = {
30
- BankAccountID?: string | undefined;
25
+ bankAccountID?: string | undefined;
31
26
  };
32
27
 
33
28
  /** @internal */
@@ -37,10 +32,6 @@ export const GeneratedByBankAccountID$outboundSchema: z.ZodType<
37
32
  GeneratedByBankAccountID
38
33
  > = z.object({
39
34
  bankAccountID: z.string().optional(),
40
- }).transform((v) => {
41
- return remap$(v, {
42
- bankAccountID: "BankAccountID",
43
- });
44
35
  });
45
36
 
46
37
  /**
@@ -3,7 +3,6 @@
3
3
  */
4
4
 
5
5
  import * as z from "zod";
6
- import { remap as remap$ } from "../../lib/primitives.js";
7
6
  import { safeParse } from "../../lib/schemas.js";
8
7
  import { Result as SafeParseResult } from "../../types/fp.js";
9
8
  import { SDKValidationError } from "../errors/sdkvalidationerror.js";
@@ -18,16 +17,12 @@ export const GeneratedByCardID$inboundSchema: z.ZodType<
18
17
  z.ZodTypeDef,
19
18
  unknown
20
19
  > = z.object({
21
- CardID: z.string().optional(),
22
- }).transform((v) => {
23
- return remap$(v, {
24
- "CardID": "cardID",
25
- });
20
+ cardID: z.string().optional(),
26
21
  });
27
22
 
28
23
  /** @internal */
29
24
  export type GeneratedByCardID$Outbound = {
30
- CardID?: string | undefined;
25
+ cardID?: string | undefined;
31
26
  };
32
27
 
33
28
  /** @internal */
@@ -37,10 +32,6 @@ export const GeneratedByCardID$outboundSchema: z.ZodType<
37
32
  GeneratedByCardID
38
33
  > = z.object({
39
34
  cardID: z.string().optional(),
40
- }).transform((v) => {
41
- return remap$(v, {
42
- cardID: "CardID",
43
- });
44
35
  });
45
36
 
46
37
  /**
@@ -3,7 +3,6 @@
3
3
  */
4
4
 
5
5
  import * as z from "zod";
6
- import { remap as remap$ } from "../../lib/primitives.js";
7
6
  import { safeParse } from "../../lib/schemas.js";
8
7
  import { Result as SafeParseResult } from "../../types/fp.js";
9
8
  import { SDKValidationError } from "../errors/sdkvalidationerror.js";
@@ -18,16 +17,12 @@ export const GeneratedByDisputeID$inboundSchema: z.ZodType<
18
17
  z.ZodTypeDef,
19
18
  unknown
20
19
  > = z.object({
21
- DisputeID: z.string().optional(),
22
- }).transform((v) => {
23
- return remap$(v, {
24
- "DisputeID": "disputeID",
25
- });
20
+ disputeID: z.string().optional(),
26
21
  });
27
22
 
28
23
  /** @internal */
29
24
  export type GeneratedByDisputeID$Outbound = {
30
- DisputeID?: string | undefined;
25
+ disputeID?: string | undefined;
31
26
  };
32
27
 
33
28
  /** @internal */
@@ -37,10 +32,6 @@ export const GeneratedByDisputeID$outboundSchema: z.ZodType<
37
32
  GeneratedByDisputeID
38
33
  > = z.object({
39
34
  disputeID: z.string().optional(),
40
- }).transform((v) => {
41
- return remap$(v, {
42
- disputeID: "DisputeID",
43
- });
44
35
  });
45
36
 
46
37
  /**
@@ -0,0 +1,72 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import * as z from "zod";
6
+ import { safeParse } from "../../lib/schemas.js";
7
+ import { Result as SafeParseResult } from "../../types/fp.js";
8
+ import { SDKValidationError } from "../errors/sdkvalidationerror.js";
9
+
10
+ /**
11
+ * Request body for creating or updating image metadata.
12
+ */
13
+ export type ImageMetadataRequest = {
14
+ /**
15
+ * Alternative text for the image.
16
+ */
17
+ altText?: string | undefined;
18
+ };
19
+
20
+ /** @internal */
21
+ export const ImageMetadataRequest$inboundSchema: z.ZodType<
22
+ ImageMetadataRequest,
23
+ z.ZodTypeDef,
24
+ unknown
25
+ > = z.object({
26
+ altText: z.string().optional(),
27
+ });
28
+
29
+ /** @internal */
30
+ export type ImageMetadataRequest$Outbound = {
31
+ altText?: string | undefined;
32
+ };
33
+
34
+ /** @internal */
35
+ export const ImageMetadataRequest$outboundSchema: z.ZodType<
36
+ ImageMetadataRequest$Outbound,
37
+ z.ZodTypeDef,
38
+ ImageMetadataRequest
39
+ > = z.object({
40
+ altText: z.string().optional(),
41
+ });
42
+
43
+ /**
44
+ * @internal
45
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
46
+ */
47
+ export namespace ImageMetadataRequest$ {
48
+ /** @deprecated use `ImageMetadataRequest$inboundSchema` instead. */
49
+ export const inboundSchema = ImageMetadataRequest$inboundSchema;
50
+ /** @deprecated use `ImageMetadataRequest$outboundSchema` instead. */
51
+ export const outboundSchema = ImageMetadataRequest$outboundSchema;
52
+ /** @deprecated use `ImageMetadataRequest$Outbound` instead. */
53
+ export type Outbound = ImageMetadataRequest$Outbound;
54
+ }
55
+
56
+ export function imageMetadataRequestToJSON(
57
+ imageMetadataRequest: ImageMetadataRequest,
58
+ ): string {
59
+ return JSON.stringify(
60
+ ImageMetadataRequest$outboundSchema.parse(imageMetadataRequest),
61
+ );
62
+ }
63
+
64
+ export function imageMetadataRequestFromJSON(
65
+ jsonString: string,
66
+ ): SafeParseResult<ImageMetadataRequest, SDKValidationError> {
67
+ return safeParse(
68
+ jsonString,
69
+ (x) => ImageMetadataRequest$inboundSchema.parse(JSON.parse(x)),
70
+ `Failed to parse 'ImageMetadataRequest' from JSON`,
71
+ );
72
+ }
@@ -0,0 +1,68 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import * as z from "zod";
6
+ import { safeParse } from "../../lib/schemas.js";
7
+ import { Result as SafeParseResult } from "../../types/fp.js";
8
+ import { SDKValidationError } from "../errors/sdkvalidationerror.js";
9
+
10
+ export type ImageMetadataValidationError = {
11
+ altText?: string | undefined;
12
+ };
13
+
14
+ /** @internal */
15
+ export const ImageMetadataValidationError$inboundSchema: z.ZodType<
16
+ ImageMetadataValidationError,
17
+ z.ZodTypeDef,
18
+ unknown
19
+ > = z.object({
20
+ altText: z.string().optional(),
21
+ });
22
+
23
+ /** @internal */
24
+ export type ImageMetadataValidationError$Outbound = {
25
+ altText?: string | undefined;
26
+ };
27
+
28
+ /** @internal */
29
+ export const ImageMetadataValidationError$outboundSchema: z.ZodType<
30
+ ImageMetadataValidationError$Outbound,
31
+ z.ZodTypeDef,
32
+ ImageMetadataValidationError
33
+ > = z.object({
34
+ altText: z.string().optional(),
35
+ });
36
+
37
+ /**
38
+ * @internal
39
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
40
+ */
41
+ export namespace ImageMetadataValidationError$ {
42
+ /** @deprecated use `ImageMetadataValidationError$inboundSchema` instead. */
43
+ export const inboundSchema = ImageMetadataValidationError$inboundSchema;
44
+ /** @deprecated use `ImageMetadataValidationError$outboundSchema` instead. */
45
+ export const outboundSchema = ImageMetadataValidationError$outboundSchema;
46
+ /** @deprecated use `ImageMetadataValidationError$Outbound` instead. */
47
+ export type Outbound = ImageMetadataValidationError$Outbound;
48
+ }
49
+
50
+ export function imageMetadataValidationErrorToJSON(
51
+ imageMetadataValidationError: ImageMetadataValidationError,
52
+ ): string {
53
+ return JSON.stringify(
54
+ ImageMetadataValidationError$outboundSchema.parse(
55
+ imageMetadataValidationError,
56
+ ),
57
+ );
58
+ }
59
+
60
+ export function imageMetadataValidationErrorFromJSON(
61
+ jsonString: string,
62
+ ): SafeParseResult<ImageMetadataValidationError, SDKValidationError> {
63
+ return safeParse(
64
+ jsonString,
65
+ (x) => ImageMetadataValidationError$inboundSchema.parse(JSON.parse(x)),
66
+ `Failed to parse 'ImageMetadataValidationError' from JSON`,
67
+ );
68
+ }