@moovio/sdk 0.16.6 → 0.17.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 +60 -45
- package/bin/mcp-server.js +1158 -545
- package/bin/mcp-server.js.map +20 -9
- package/docs/sdks/images/README.md +190 -0
- package/examples/package-lock.json +1 -1
- package/funcs/imagesUpdate.d.ts +19 -0
- package/funcs/imagesUpdate.d.ts.map +1 -0
- package/funcs/imagesUpdate.js +170 -0
- package/funcs/imagesUpdate.js.map +1 -0
- package/funcs/imagesUpload.d.ts +16 -0
- package/funcs/imagesUpload.d.ts.map +1 -0
- package/funcs/imagesUpload.js +161 -0
- package/funcs/imagesUpload.js.map +1 -0
- package/jsr.json +1 -1
- package/lib/config.d.ts +3 -3
- package/lib/config.js +3 -3
- package/lib/config.js.map +1 -1
- package/mcp-server/mcp-server.js +1 -1
- package/mcp-server/server.d.ts.map +1 -1
- package/mcp-server/server.js +5 -1
- package/mcp-server/server.js.map +1 -1
- package/mcp-server/tools/imagesUpdate.d.ts +8 -0
- package/mcp-server/tools/imagesUpdate.d.ts.map +1 -0
- package/mcp-server/tools/imagesUpdate.js +66 -0
- package/mcp-server/tools/imagesUpdate.js.map +1 -0
- package/mcp-server/tools/imagesUpload.d.ts +8 -0
- package/mcp-server/tools/imagesUpload.d.ts.map +1 -0
- package/mcp-server/tools/imagesUpload.js +63 -0
- package/mcp-server/tools/imagesUpload.js.map +1 -0
- package/models/components/imagemetadatarequest.d.ts +35 -0
- package/models/components/imagemetadatarequest.d.ts.map +1 -0
- package/models/components/imagemetadatarequest.js +69 -0
- package/models/components/imagemetadatarequest.js.map +1 -0
- package/models/components/imagemetadatavalidationerror.d.ts +29 -0
- package/models/components/imagemetadatavalidationerror.d.ts.map +1 -0
- package/models/components/imagemetadatavalidationerror.js +69 -0
- package/models/components/imagemetadatavalidationerror.js.map +1 -0
- package/models/components/imageupdaterequestmultipart.d.ts +103 -0
- package/models/components/imageupdaterequestmultipart.d.ts.map +1 -0
- package/models/components/imageupdaterequestmultipart.js +139 -0
- package/models/components/imageupdaterequestmultipart.js.map +1 -0
- package/models/components/imageuploadrequestmultipart.d.ts +65 -0
- package/models/components/imageuploadrequestmultipart.d.ts.map +1 -0
- package/models/components/imageuploadrequestmultipart.js +113 -0
- package/models/components/imageuploadrequestmultipart.js.map +1 -0
- package/models/components/index.d.ts +4 -0
- package/models/components/index.d.ts.map +1 -1
- package/models/components/index.js +4 -0
- package/models/components/index.js.map +1 -1
- package/models/errors/imagerequestvalidationerror.d.ts +40 -0
- package/models/errors/imagerequestvalidationerror.d.ts.map +1 -0
- package/models/errors/imagerequestvalidationerror.js +91 -0
- package/models/errors/imagerequestvalidationerror.js.map +1 -0
- package/models/errors/index.d.ts +1 -0
- package/models/errors/index.d.ts.map +1 -1
- package/models/errors/index.js +1 -0
- package/models/errors/index.js.map +1 -1
- package/models/operations/index.d.ts +2 -0
- package/models/operations/index.d.ts.map +1 -1
- package/models/operations/index.js +2 -0
- package/models/operations/index.js.map +1 -1
- package/models/operations/updateimage.d.ts +103 -0
- package/models/operations/updateimage.d.ts.map +1 -0
- package/models/operations/updateimage.js +157 -0
- package/models/operations/updateimage.js.map +1 -0
- package/models/operations/uploadimage.d.ts +101 -0
- package/models/operations/uploadimage.d.ts.map +1 -0
- package/models/operations/uploadimage.js +155 -0
- package/models/operations/uploadimage.js.map +1 -0
- package/package.json +1 -1
- package/sdk/images.d.ts +13 -0
- package/sdk/images.d.ts.map +1 -1
- package/sdk/images.js +19 -0
- package/sdk/images.js.map +1 -1
- package/src/funcs/imagesUpdate.ts +258 -0
- package/src/funcs/imagesUpload.ts +249 -0
- package/src/lib/config.ts +3 -3
- package/src/mcp-server/mcp-server.ts +1 -1
- package/src/mcp-server/server.ts +5 -1
- package/src/mcp-server/tools/imagesUpdate.ts +39 -0
- package/src/mcp-server/tools/imagesUpload.ts +36 -0
- package/src/models/components/imagemetadatarequest.ts +72 -0
- package/src/models/components/imagemetadatavalidationerror.ts +68 -0
- package/src/models/components/imageupdaterequestmultipart.ts +224 -0
- package/src/models/components/imageuploadrequestmultipart.ts +150 -0
- package/src/models/components/index.ts +4 -0
- package/src/models/errors/imagerequestvalidationerror.ts +86 -0
- package/src/models/errors/index.ts +1 -0
- package/src/models/operations/index.ts +2 -0
- package/src/models/operations/updateimage.ts +237 -0
- package/src/models/operations/uploadimage.ts +233 -0
- package/src/sdk/images.ts +35 -0
|
@@ -0,0 +1,237 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod";
|
|
6
|
+
import { remap as remap$ } from "../../lib/primitives.js";
|
|
7
|
+
import { safeParse } from "../../lib/schemas.js";
|
|
8
|
+
import { Result as SafeParseResult } from "../../types/fp.js";
|
|
9
|
+
import * as components from "../components/index.js";
|
|
10
|
+
import { SDKValidationError } from "../errors/sdkvalidationerror.js";
|
|
11
|
+
|
|
12
|
+
export type UpdateImageGlobals = {
|
|
13
|
+
/**
|
|
14
|
+
* Specify an API version.
|
|
15
|
+
*
|
|
16
|
+
* @remarks
|
|
17
|
+
*
|
|
18
|
+
* API versioning follows the format `vYYYY.QQ.BB`, where
|
|
19
|
+
* - `YYYY` is the year
|
|
20
|
+
* - `QQ` is the two-digit month for the first month of the quarter (e.g., 01, 04, 07, 10)
|
|
21
|
+
* - `BB` is the build number, starting at `.01`, for subsequent builds in the same quarter.
|
|
22
|
+
* - For example, `v2024.01.00` is the initial release of the first quarter of 2024.
|
|
23
|
+
*
|
|
24
|
+
* The `latest` version represents the most recent development state. It may include breaking changes and should be treated as a beta release.
|
|
25
|
+
*/
|
|
26
|
+
xMoovVersion?: string | undefined;
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
export type UpdateImageRequest = {
|
|
30
|
+
accountID: string;
|
|
31
|
+
imageID: string;
|
|
32
|
+
imageUpdateRequestMultiPart: components.ImageUpdateRequestMultiPart;
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
export type UpdateImageResponse = {
|
|
36
|
+
headers: { [k: string]: Array<string> };
|
|
37
|
+
result: components.ImageMetadata;
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
/** @internal */
|
|
41
|
+
export const UpdateImageGlobals$inboundSchema: z.ZodType<
|
|
42
|
+
UpdateImageGlobals,
|
|
43
|
+
z.ZodTypeDef,
|
|
44
|
+
unknown
|
|
45
|
+
> = z.object({
|
|
46
|
+
"x-moov-version": z.string().default("v2024.01.00"),
|
|
47
|
+
}).transform((v) => {
|
|
48
|
+
return remap$(v, {
|
|
49
|
+
"x-moov-version": "xMoovVersion",
|
|
50
|
+
});
|
|
51
|
+
});
|
|
52
|
+
|
|
53
|
+
/** @internal */
|
|
54
|
+
export type UpdateImageGlobals$Outbound = {
|
|
55
|
+
"x-moov-version": string;
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
/** @internal */
|
|
59
|
+
export const UpdateImageGlobals$outboundSchema: z.ZodType<
|
|
60
|
+
UpdateImageGlobals$Outbound,
|
|
61
|
+
z.ZodTypeDef,
|
|
62
|
+
UpdateImageGlobals
|
|
63
|
+
> = z.object({
|
|
64
|
+
xMoovVersion: z.string().default("v2024.01.00"),
|
|
65
|
+
}).transform((v) => {
|
|
66
|
+
return remap$(v, {
|
|
67
|
+
xMoovVersion: "x-moov-version",
|
|
68
|
+
});
|
|
69
|
+
});
|
|
70
|
+
|
|
71
|
+
/**
|
|
72
|
+
* @internal
|
|
73
|
+
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
74
|
+
*/
|
|
75
|
+
export namespace UpdateImageGlobals$ {
|
|
76
|
+
/** @deprecated use `UpdateImageGlobals$inboundSchema` instead. */
|
|
77
|
+
export const inboundSchema = UpdateImageGlobals$inboundSchema;
|
|
78
|
+
/** @deprecated use `UpdateImageGlobals$outboundSchema` instead. */
|
|
79
|
+
export const outboundSchema = UpdateImageGlobals$outboundSchema;
|
|
80
|
+
/** @deprecated use `UpdateImageGlobals$Outbound` instead. */
|
|
81
|
+
export type Outbound = UpdateImageGlobals$Outbound;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
export function updateImageGlobalsToJSON(
|
|
85
|
+
updateImageGlobals: UpdateImageGlobals,
|
|
86
|
+
): string {
|
|
87
|
+
return JSON.stringify(
|
|
88
|
+
UpdateImageGlobals$outboundSchema.parse(updateImageGlobals),
|
|
89
|
+
);
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
export function updateImageGlobalsFromJSON(
|
|
93
|
+
jsonString: string,
|
|
94
|
+
): SafeParseResult<UpdateImageGlobals, SDKValidationError> {
|
|
95
|
+
return safeParse(
|
|
96
|
+
jsonString,
|
|
97
|
+
(x) => UpdateImageGlobals$inboundSchema.parse(JSON.parse(x)),
|
|
98
|
+
`Failed to parse 'UpdateImageGlobals' from JSON`,
|
|
99
|
+
);
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
/** @internal */
|
|
103
|
+
export const UpdateImageRequest$inboundSchema: z.ZodType<
|
|
104
|
+
UpdateImageRequest,
|
|
105
|
+
z.ZodTypeDef,
|
|
106
|
+
unknown
|
|
107
|
+
> = z.object({
|
|
108
|
+
accountID: z.string(),
|
|
109
|
+
imageID: z.string(),
|
|
110
|
+
ImageUpdateRequestMultiPart:
|
|
111
|
+
components.ImageUpdateRequestMultiPart$inboundSchema,
|
|
112
|
+
}).transform((v) => {
|
|
113
|
+
return remap$(v, {
|
|
114
|
+
"ImageUpdateRequestMultiPart": "imageUpdateRequestMultiPart",
|
|
115
|
+
});
|
|
116
|
+
});
|
|
117
|
+
|
|
118
|
+
/** @internal */
|
|
119
|
+
export type UpdateImageRequest$Outbound = {
|
|
120
|
+
accountID: string;
|
|
121
|
+
imageID: string;
|
|
122
|
+
ImageUpdateRequestMultiPart: components.ImageUpdateRequestMultiPart$Outbound;
|
|
123
|
+
};
|
|
124
|
+
|
|
125
|
+
/** @internal */
|
|
126
|
+
export const UpdateImageRequest$outboundSchema: z.ZodType<
|
|
127
|
+
UpdateImageRequest$Outbound,
|
|
128
|
+
z.ZodTypeDef,
|
|
129
|
+
UpdateImageRequest
|
|
130
|
+
> = z.object({
|
|
131
|
+
accountID: z.string(),
|
|
132
|
+
imageID: z.string(),
|
|
133
|
+
imageUpdateRequestMultiPart:
|
|
134
|
+
components.ImageUpdateRequestMultiPart$outboundSchema,
|
|
135
|
+
}).transform((v) => {
|
|
136
|
+
return remap$(v, {
|
|
137
|
+
imageUpdateRequestMultiPart: "ImageUpdateRequestMultiPart",
|
|
138
|
+
});
|
|
139
|
+
});
|
|
140
|
+
|
|
141
|
+
/**
|
|
142
|
+
* @internal
|
|
143
|
+
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
144
|
+
*/
|
|
145
|
+
export namespace UpdateImageRequest$ {
|
|
146
|
+
/** @deprecated use `UpdateImageRequest$inboundSchema` instead. */
|
|
147
|
+
export const inboundSchema = UpdateImageRequest$inboundSchema;
|
|
148
|
+
/** @deprecated use `UpdateImageRequest$outboundSchema` instead. */
|
|
149
|
+
export const outboundSchema = UpdateImageRequest$outboundSchema;
|
|
150
|
+
/** @deprecated use `UpdateImageRequest$Outbound` instead. */
|
|
151
|
+
export type Outbound = UpdateImageRequest$Outbound;
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
export function updateImageRequestToJSON(
|
|
155
|
+
updateImageRequest: UpdateImageRequest,
|
|
156
|
+
): string {
|
|
157
|
+
return JSON.stringify(
|
|
158
|
+
UpdateImageRequest$outboundSchema.parse(updateImageRequest),
|
|
159
|
+
);
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
export function updateImageRequestFromJSON(
|
|
163
|
+
jsonString: string,
|
|
164
|
+
): SafeParseResult<UpdateImageRequest, SDKValidationError> {
|
|
165
|
+
return safeParse(
|
|
166
|
+
jsonString,
|
|
167
|
+
(x) => UpdateImageRequest$inboundSchema.parse(JSON.parse(x)),
|
|
168
|
+
`Failed to parse 'UpdateImageRequest' from JSON`,
|
|
169
|
+
);
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
/** @internal */
|
|
173
|
+
export const UpdateImageResponse$inboundSchema: z.ZodType<
|
|
174
|
+
UpdateImageResponse,
|
|
175
|
+
z.ZodTypeDef,
|
|
176
|
+
unknown
|
|
177
|
+
> = z.object({
|
|
178
|
+
Headers: z.record(z.array(z.string())),
|
|
179
|
+
Result: components.ImageMetadata$inboundSchema,
|
|
180
|
+
}).transform((v) => {
|
|
181
|
+
return remap$(v, {
|
|
182
|
+
"Headers": "headers",
|
|
183
|
+
"Result": "result",
|
|
184
|
+
});
|
|
185
|
+
});
|
|
186
|
+
|
|
187
|
+
/** @internal */
|
|
188
|
+
export type UpdateImageResponse$Outbound = {
|
|
189
|
+
Headers: { [k: string]: Array<string> };
|
|
190
|
+
Result: components.ImageMetadata$Outbound;
|
|
191
|
+
};
|
|
192
|
+
|
|
193
|
+
/** @internal */
|
|
194
|
+
export const UpdateImageResponse$outboundSchema: z.ZodType<
|
|
195
|
+
UpdateImageResponse$Outbound,
|
|
196
|
+
z.ZodTypeDef,
|
|
197
|
+
UpdateImageResponse
|
|
198
|
+
> = z.object({
|
|
199
|
+
headers: z.record(z.array(z.string())),
|
|
200
|
+
result: components.ImageMetadata$outboundSchema,
|
|
201
|
+
}).transform((v) => {
|
|
202
|
+
return remap$(v, {
|
|
203
|
+
headers: "Headers",
|
|
204
|
+
result: "Result",
|
|
205
|
+
});
|
|
206
|
+
});
|
|
207
|
+
|
|
208
|
+
/**
|
|
209
|
+
* @internal
|
|
210
|
+
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
211
|
+
*/
|
|
212
|
+
export namespace UpdateImageResponse$ {
|
|
213
|
+
/** @deprecated use `UpdateImageResponse$inboundSchema` instead. */
|
|
214
|
+
export const inboundSchema = UpdateImageResponse$inboundSchema;
|
|
215
|
+
/** @deprecated use `UpdateImageResponse$outboundSchema` instead. */
|
|
216
|
+
export const outboundSchema = UpdateImageResponse$outboundSchema;
|
|
217
|
+
/** @deprecated use `UpdateImageResponse$Outbound` instead. */
|
|
218
|
+
export type Outbound = UpdateImageResponse$Outbound;
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
export function updateImageResponseToJSON(
|
|
222
|
+
updateImageResponse: UpdateImageResponse,
|
|
223
|
+
): string {
|
|
224
|
+
return JSON.stringify(
|
|
225
|
+
UpdateImageResponse$outboundSchema.parse(updateImageResponse),
|
|
226
|
+
);
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
export function updateImageResponseFromJSON(
|
|
230
|
+
jsonString: string,
|
|
231
|
+
): SafeParseResult<UpdateImageResponse, SDKValidationError> {
|
|
232
|
+
return safeParse(
|
|
233
|
+
jsonString,
|
|
234
|
+
(x) => UpdateImageResponse$inboundSchema.parse(JSON.parse(x)),
|
|
235
|
+
`Failed to parse 'UpdateImageResponse' from JSON`,
|
|
236
|
+
);
|
|
237
|
+
}
|
|
@@ -0,0 +1,233 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod";
|
|
6
|
+
import { remap as remap$ } from "../../lib/primitives.js";
|
|
7
|
+
import { safeParse } from "../../lib/schemas.js";
|
|
8
|
+
import { Result as SafeParseResult } from "../../types/fp.js";
|
|
9
|
+
import * as components from "../components/index.js";
|
|
10
|
+
import { SDKValidationError } from "../errors/sdkvalidationerror.js";
|
|
11
|
+
|
|
12
|
+
export type UploadImageGlobals = {
|
|
13
|
+
/**
|
|
14
|
+
* Specify an API version.
|
|
15
|
+
*
|
|
16
|
+
* @remarks
|
|
17
|
+
*
|
|
18
|
+
* API versioning follows the format `vYYYY.QQ.BB`, where
|
|
19
|
+
* - `YYYY` is the year
|
|
20
|
+
* - `QQ` is the two-digit month for the first month of the quarter (e.g., 01, 04, 07, 10)
|
|
21
|
+
* - `BB` is the build number, starting at `.01`, for subsequent builds in the same quarter.
|
|
22
|
+
* - For example, `v2024.01.00` is the initial release of the first quarter of 2024.
|
|
23
|
+
*
|
|
24
|
+
* The `latest` version represents the most recent development state. It may include breaking changes and should be treated as a beta release.
|
|
25
|
+
*/
|
|
26
|
+
xMoovVersion?: string | undefined;
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
export type UploadImageRequest = {
|
|
30
|
+
accountID: string;
|
|
31
|
+
imageUploadRequestMultiPart: components.ImageUploadRequestMultiPart;
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
export type UploadImageResponse = {
|
|
35
|
+
headers: { [k: string]: Array<string> };
|
|
36
|
+
result: components.ImageMetadata;
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
/** @internal */
|
|
40
|
+
export const UploadImageGlobals$inboundSchema: z.ZodType<
|
|
41
|
+
UploadImageGlobals,
|
|
42
|
+
z.ZodTypeDef,
|
|
43
|
+
unknown
|
|
44
|
+
> = z.object({
|
|
45
|
+
"x-moov-version": z.string().default("v2024.01.00"),
|
|
46
|
+
}).transform((v) => {
|
|
47
|
+
return remap$(v, {
|
|
48
|
+
"x-moov-version": "xMoovVersion",
|
|
49
|
+
});
|
|
50
|
+
});
|
|
51
|
+
|
|
52
|
+
/** @internal */
|
|
53
|
+
export type UploadImageGlobals$Outbound = {
|
|
54
|
+
"x-moov-version": string;
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
/** @internal */
|
|
58
|
+
export const UploadImageGlobals$outboundSchema: z.ZodType<
|
|
59
|
+
UploadImageGlobals$Outbound,
|
|
60
|
+
z.ZodTypeDef,
|
|
61
|
+
UploadImageGlobals
|
|
62
|
+
> = z.object({
|
|
63
|
+
xMoovVersion: z.string().default("v2024.01.00"),
|
|
64
|
+
}).transform((v) => {
|
|
65
|
+
return remap$(v, {
|
|
66
|
+
xMoovVersion: "x-moov-version",
|
|
67
|
+
});
|
|
68
|
+
});
|
|
69
|
+
|
|
70
|
+
/**
|
|
71
|
+
* @internal
|
|
72
|
+
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
73
|
+
*/
|
|
74
|
+
export namespace UploadImageGlobals$ {
|
|
75
|
+
/** @deprecated use `UploadImageGlobals$inboundSchema` instead. */
|
|
76
|
+
export const inboundSchema = UploadImageGlobals$inboundSchema;
|
|
77
|
+
/** @deprecated use `UploadImageGlobals$outboundSchema` instead. */
|
|
78
|
+
export const outboundSchema = UploadImageGlobals$outboundSchema;
|
|
79
|
+
/** @deprecated use `UploadImageGlobals$Outbound` instead. */
|
|
80
|
+
export type Outbound = UploadImageGlobals$Outbound;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
export function uploadImageGlobalsToJSON(
|
|
84
|
+
uploadImageGlobals: UploadImageGlobals,
|
|
85
|
+
): string {
|
|
86
|
+
return JSON.stringify(
|
|
87
|
+
UploadImageGlobals$outboundSchema.parse(uploadImageGlobals),
|
|
88
|
+
);
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
export function uploadImageGlobalsFromJSON(
|
|
92
|
+
jsonString: string,
|
|
93
|
+
): SafeParseResult<UploadImageGlobals, SDKValidationError> {
|
|
94
|
+
return safeParse(
|
|
95
|
+
jsonString,
|
|
96
|
+
(x) => UploadImageGlobals$inboundSchema.parse(JSON.parse(x)),
|
|
97
|
+
`Failed to parse 'UploadImageGlobals' from JSON`,
|
|
98
|
+
);
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
/** @internal */
|
|
102
|
+
export const UploadImageRequest$inboundSchema: z.ZodType<
|
|
103
|
+
UploadImageRequest,
|
|
104
|
+
z.ZodTypeDef,
|
|
105
|
+
unknown
|
|
106
|
+
> = z.object({
|
|
107
|
+
accountID: z.string(),
|
|
108
|
+
ImageUploadRequestMultiPart:
|
|
109
|
+
components.ImageUploadRequestMultiPart$inboundSchema,
|
|
110
|
+
}).transform((v) => {
|
|
111
|
+
return remap$(v, {
|
|
112
|
+
"ImageUploadRequestMultiPart": "imageUploadRequestMultiPart",
|
|
113
|
+
});
|
|
114
|
+
});
|
|
115
|
+
|
|
116
|
+
/** @internal */
|
|
117
|
+
export type UploadImageRequest$Outbound = {
|
|
118
|
+
accountID: string;
|
|
119
|
+
ImageUploadRequestMultiPart: components.ImageUploadRequestMultiPart$Outbound;
|
|
120
|
+
};
|
|
121
|
+
|
|
122
|
+
/** @internal */
|
|
123
|
+
export const UploadImageRequest$outboundSchema: z.ZodType<
|
|
124
|
+
UploadImageRequest$Outbound,
|
|
125
|
+
z.ZodTypeDef,
|
|
126
|
+
UploadImageRequest
|
|
127
|
+
> = z.object({
|
|
128
|
+
accountID: z.string(),
|
|
129
|
+
imageUploadRequestMultiPart:
|
|
130
|
+
components.ImageUploadRequestMultiPart$outboundSchema,
|
|
131
|
+
}).transform((v) => {
|
|
132
|
+
return remap$(v, {
|
|
133
|
+
imageUploadRequestMultiPart: "ImageUploadRequestMultiPart",
|
|
134
|
+
});
|
|
135
|
+
});
|
|
136
|
+
|
|
137
|
+
/**
|
|
138
|
+
* @internal
|
|
139
|
+
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
140
|
+
*/
|
|
141
|
+
export namespace UploadImageRequest$ {
|
|
142
|
+
/** @deprecated use `UploadImageRequest$inboundSchema` instead. */
|
|
143
|
+
export const inboundSchema = UploadImageRequest$inboundSchema;
|
|
144
|
+
/** @deprecated use `UploadImageRequest$outboundSchema` instead. */
|
|
145
|
+
export const outboundSchema = UploadImageRequest$outboundSchema;
|
|
146
|
+
/** @deprecated use `UploadImageRequest$Outbound` instead. */
|
|
147
|
+
export type Outbound = UploadImageRequest$Outbound;
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
export function uploadImageRequestToJSON(
|
|
151
|
+
uploadImageRequest: UploadImageRequest,
|
|
152
|
+
): string {
|
|
153
|
+
return JSON.stringify(
|
|
154
|
+
UploadImageRequest$outboundSchema.parse(uploadImageRequest),
|
|
155
|
+
);
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
export function uploadImageRequestFromJSON(
|
|
159
|
+
jsonString: string,
|
|
160
|
+
): SafeParseResult<UploadImageRequest, SDKValidationError> {
|
|
161
|
+
return safeParse(
|
|
162
|
+
jsonString,
|
|
163
|
+
(x) => UploadImageRequest$inboundSchema.parse(JSON.parse(x)),
|
|
164
|
+
`Failed to parse 'UploadImageRequest' from JSON`,
|
|
165
|
+
);
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
/** @internal */
|
|
169
|
+
export const UploadImageResponse$inboundSchema: z.ZodType<
|
|
170
|
+
UploadImageResponse,
|
|
171
|
+
z.ZodTypeDef,
|
|
172
|
+
unknown
|
|
173
|
+
> = z.object({
|
|
174
|
+
Headers: z.record(z.array(z.string())),
|
|
175
|
+
Result: components.ImageMetadata$inboundSchema,
|
|
176
|
+
}).transform((v) => {
|
|
177
|
+
return remap$(v, {
|
|
178
|
+
"Headers": "headers",
|
|
179
|
+
"Result": "result",
|
|
180
|
+
});
|
|
181
|
+
});
|
|
182
|
+
|
|
183
|
+
/** @internal */
|
|
184
|
+
export type UploadImageResponse$Outbound = {
|
|
185
|
+
Headers: { [k: string]: Array<string> };
|
|
186
|
+
Result: components.ImageMetadata$Outbound;
|
|
187
|
+
};
|
|
188
|
+
|
|
189
|
+
/** @internal */
|
|
190
|
+
export const UploadImageResponse$outboundSchema: z.ZodType<
|
|
191
|
+
UploadImageResponse$Outbound,
|
|
192
|
+
z.ZodTypeDef,
|
|
193
|
+
UploadImageResponse
|
|
194
|
+
> = z.object({
|
|
195
|
+
headers: z.record(z.array(z.string())),
|
|
196
|
+
result: components.ImageMetadata$outboundSchema,
|
|
197
|
+
}).transform((v) => {
|
|
198
|
+
return remap$(v, {
|
|
199
|
+
headers: "Headers",
|
|
200
|
+
result: "Result",
|
|
201
|
+
});
|
|
202
|
+
});
|
|
203
|
+
|
|
204
|
+
/**
|
|
205
|
+
* @internal
|
|
206
|
+
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
207
|
+
*/
|
|
208
|
+
export namespace UploadImageResponse$ {
|
|
209
|
+
/** @deprecated use `UploadImageResponse$inboundSchema` instead. */
|
|
210
|
+
export const inboundSchema = UploadImageResponse$inboundSchema;
|
|
211
|
+
/** @deprecated use `UploadImageResponse$outboundSchema` instead. */
|
|
212
|
+
export const outboundSchema = UploadImageResponse$outboundSchema;
|
|
213
|
+
/** @deprecated use `UploadImageResponse$Outbound` instead. */
|
|
214
|
+
export type Outbound = UploadImageResponse$Outbound;
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
export function uploadImageResponseToJSON(
|
|
218
|
+
uploadImageResponse: UploadImageResponse,
|
|
219
|
+
): string {
|
|
220
|
+
return JSON.stringify(
|
|
221
|
+
UploadImageResponse$outboundSchema.parse(uploadImageResponse),
|
|
222
|
+
);
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
export function uploadImageResponseFromJSON(
|
|
226
|
+
jsonString: string,
|
|
227
|
+
): SafeParseResult<UploadImageResponse, SDKValidationError> {
|
|
228
|
+
return safeParse(
|
|
229
|
+
jsonString,
|
|
230
|
+
(x) => UploadImageResponse$inboundSchema.parse(JSON.parse(x)),
|
|
231
|
+
`Failed to parse 'UploadImageResponse' from JSON`,
|
|
232
|
+
);
|
|
233
|
+
}
|
package/src/sdk/images.ts
CHANGED
|
@@ -9,6 +9,8 @@ import {
|
|
|
9
9
|
imagesGetPublic,
|
|
10
10
|
} from "../funcs/imagesGetPublic.js";
|
|
11
11
|
import { imagesList } from "../funcs/imagesList.js";
|
|
12
|
+
import { imagesUpdate } from "../funcs/imagesUpdate.js";
|
|
13
|
+
import { imagesUpload } from "../funcs/imagesUpload.js";
|
|
12
14
|
import { ClientSDK, RequestOptions } from "../lib/sdks.js";
|
|
13
15
|
import * as operations from "../models/operations/index.js";
|
|
14
16
|
import { unwrapAsync } from "../types/fp.js";
|
|
@@ -30,6 +32,21 @@ export class Images extends ClientSDK {
|
|
|
30
32
|
));
|
|
31
33
|
}
|
|
32
34
|
|
|
35
|
+
/**
|
|
36
|
+
* Upload a new PNG, JPEG, or WebP image with optional metadata.
|
|
37
|
+
* Duplicate images, and requests larger than 16MB will be rejected.
|
|
38
|
+
*/
|
|
39
|
+
async upload(
|
|
40
|
+
request: operations.UploadImageRequest,
|
|
41
|
+
options?: RequestOptions,
|
|
42
|
+
): Promise<operations.UploadImageResponse> {
|
|
43
|
+
return unwrapAsync(imagesUpload(
|
|
44
|
+
this,
|
|
45
|
+
request,
|
|
46
|
+
options,
|
|
47
|
+
));
|
|
48
|
+
}
|
|
49
|
+
|
|
33
50
|
/**
|
|
34
51
|
* Retrieve metadata for a specific image by its ID.
|
|
35
52
|
*/
|
|
@@ -44,6 +61,24 @@ export class Images extends ClientSDK {
|
|
|
44
61
|
));
|
|
45
62
|
}
|
|
46
63
|
|
|
64
|
+
/**
|
|
65
|
+
* Update an existing image and/or its metadata.
|
|
66
|
+
*
|
|
67
|
+
* Duplicate images, and requests larger than 16MB will be rejected. Omit any
|
|
68
|
+
* form parts you do not wish to update. Existing metadata can be cleared by
|
|
69
|
+
* sending `null` for the `metadata` form part.
|
|
70
|
+
*/
|
|
71
|
+
async update(
|
|
72
|
+
request: operations.UpdateImageRequest,
|
|
73
|
+
options?: RequestOptions,
|
|
74
|
+
): Promise<operations.UpdateImageResponse> {
|
|
75
|
+
return unwrapAsync(imagesUpdate(
|
|
76
|
+
this,
|
|
77
|
+
request,
|
|
78
|
+
options,
|
|
79
|
+
));
|
|
80
|
+
}
|
|
81
|
+
|
|
47
82
|
/**
|
|
48
83
|
* Permanently delete an image by its ID.
|
|
49
84
|
*/
|