@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,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
|
+
};
|
|
@@ -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
|
+
}
|
|
@@ -0,0 +1,224 @@
|
|
|
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 { blobLikeSchema } from "../../types/blobs.js";
|
|
8
|
+
import { Result as SafeParseResult } from "../../types/fp.js";
|
|
9
|
+
import { SDKValidationError } from "../errors/sdkvalidationerror.js";
|
|
10
|
+
|
|
11
|
+
export type ImageUpdateRequestMultiPartImage = {
|
|
12
|
+
fileName: string;
|
|
13
|
+
content: ReadableStream<Uint8Array> | Blob | ArrayBuffer | Uint8Array;
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* JSON-encoded metadata to update for the image.
|
|
18
|
+
*
|
|
19
|
+
* @remarks
|
|
20
|
+
*
|
|
21
|
+
* Omit this field if not updating metadata, or send `null` to clear existing metadata.
|
|
22
|
+
*/
|
|
23
|
+
export type Metadata = {
|
|
24
|
+
/**
|
|
25
|
+
* Alternative text for the image.
|
|
26
|
+
*/
|
|
27
|
+
altText?: string | undefined;
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* Multipart request body for updating an image and/or its metadata.
|
|
32
|
+
*/
|
|
33
|
+
export type ImageUpdateRequestMultiPart = {
|
|
34
|
+
image?: ImageUpdateRequestMultiPartImage | Blob | undefined;
|
|
35
|
+
/**
|
|
36
|
+
* JSON-encoded metadata to update for the image.
|
|
37
|
+
*
|
|
38
|
+
* @remarks
|
|
39
|
+
*
|
|
40
|
+
* Omit this field if not updating metadata, or send `null` to clear existing metadata.
|
|
41
|
+
*/
|
|
42
|
+
metadata?: Metadata | null | undefined;
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
/** @internal */
|
|
46
|
+
export const ImageUpdateRequestMultiPartImage$inboundSchema: z.ZodType<
|
|
47
|
+
ImageUpdateRequestMultiPartImage,
|
|
48
|
+
z.ZodTypeDef,
|
|
49
|
+
unknown
|
|
50
|
+
> = z.object({
|
|
51
|
+
fileName: z.string(),
|
|
52
|
+
content: z.union([
|
|
53
|
+
z.instanceof(ReadableStream<Uint8Array>),
|
|
54
|
+
z.instanceof(Blob),
|
|
55
|
+
z.instanceof(ArrayBuffer),
|
|
56
|
+
z.instanceof(Uint8Array),
|
|
57
|
+
]),
|
|
58
|
+
});
|
|
59
|
+
|
|
60
|
+
/** @internal */
|
|
61
|
+
export type ImageUpdateRequestMultiPartImage$Outbound = {
|
|
62
|
+
fileName: string;
|
|
63
|
+
content: ReadableStream<Uint8Array> | Blob | ArrayBuffer | Uint8Array;
|
|
64
|
+
};
|
|
65
|
+
|
|
66
|
+
/** @internal */
|
|
67
|
+
export const ImageUpdateRequestMultiPartImage$outboundSchema: z.ZodType<
|
|
68
|
+
ImageUpdateRequestMultiPartImage$Outbound,
|
|
69
|
+
z.ZodTypeDef,
|
|
70
|
+
ImageUpdateRequestMultiPartImage
|
|
71
|
+
> = z.object({
|
|
72
|
+
fileName: z.string(),
|
|
73
|
+
content: z.union([
|
|
74
|
+
z.instanceof(ReadableStream<Uint8Array>),
|
|
75
|
+
z.instanceof(Blob),
|
|
76
|
+
z.instanceof(ArrayBuffer),
|
|
77
|
+
z.instanceof(Uint8Array),
|
|
78
|
+
]),
|
|
79
|
+
});
|
|
80
|
+
|
|
81
|
+
/**
|
|
82
|
+
* @internal
|
|
83
|
+
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
84
|
+
*/
|
|
85
|
+
export namespace ImageUpdateRequestMultiPartImage$ {
|
|
86
|
+
/** @deprecated use `ImageUpdateRequestMultiPartImage$inboundSchema` instead. */
|
|
87
|
+
export const inboundSchema = ImageUpdateRequestMultiPartImage$inboundSchema;
|
|
88
|
+
/** @deprecated use `ImageUpdateRequestMultiPartImage$outboundSchema` instead. */
|
|
89
|
+
export const outboundSchema = ImageUpdateRequestMultiPartImage$outboundSchema;
|
|
90
|
+
/** @deprecated use `ImageUpdateRequestMultiPartImage$Outbound` instead. */
|
|
91
|
+
export type Outbound = ImageUpdateRequestMultiPartImage$Outbound;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
export function imageUpdateRequestMultiPartImageToJSON(
|
|
95
|
+
imageUpdateRequestMultiPartImage: ImageUpdateRequestMultiPartImage,
|
|
96
|
+
): string {
|
|
97
|
+
return JSON.stringify(
|
|
98
|
+
ImageUpdateRequestMultiPartImage$outboundSchema.parse(
|
|
99
|
+
imageUpdateRequestMultiPartImage,
|
|
100
|
+
),
|
|
101
|
+
);
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
export function imageUpdateRequestMultiPartImageFromJSON(
|
|
105
|
+
jsonString: string,
|
|
106
|
+
): SafeParseResult<ImageUpdateRequestMultiPartImage, SDKValidationError> {
|
|
107
|
+
return safeParse(
|
|
108
|
+
jsonString,
|
|
109
|
+
(x) => ImageUpdateRequestMultiPartImage$inboundSchema.parse(JSON.parse(x)),
|
|
110
|
+
`Failed to parse 'ImageUpdateRequestMultiPartImage' from JSON`,
|
|
111
|
+
);
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
/** @internal */
|
|
115
|
+
export const Metadata$inboundSchema: z.ZodType<
|
|
116
|
+
Metadata,
|
|
117
|
+
z.ZodTypeDef,
|
|
118
|
+
unknown
|
|
119
|
+
> = z.object({
|
|
120
|
+
altText: z.string().optional(),
|
|
121
|
+
});
|
|
122
|
+
|
|
123
|
+
/** @internal */
|
|
124
|
+
export type Metadata$Outbound = {
|
|
125
|
+
altText?: string | undefined;
|
|
126
|
+
};
|
|
127
|
+
|
|
128
|
+
/** @internal */
|
|
129
|
+
export const Metadata$outboundSchema: z.ZodType<
|
|
130
|
+
Metadata$Outbound,
|
|
131
|
+
z.ZodTypeDef,
|
|
132
|
+
Metadata
|
|
133
|
+
> = z.object({
|
|
134
|
+
altText: z.string().optional(),
|
|
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 Metadata$ {
|
|
142
|
+
/** @deprecated use `Metadata$inboundSchema` instead. */
|
|
143
|
+
export const inboundSchema = Metadata$inboundSchema;
|
|
144
|
+
/** @deprecated use `Metadata$outboundSchema` instead. */
|
|
145
|
+
export const outboundSchema = Metadata$outboundSchema;
|
|
146
|
+
/** @deprecated use `Metadata$Outbound` instead. */
|
|
147
|
+
export type Outbound = Metadata$Outbound;
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
export function metadataToJSON(metadata: Metadata): string {
|
|
151
|
+
return JSON.stringify(Metadata$outboundSchema.parse(metadata));
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
export function metadataFromJSON(
|
|
155
|
+
jsonString: string,
|
|
156
|
+
): SafeParseResult<Metadata, SDKValidationError> {
|
|
157
|
+
return safeParse(
|
|
158
|
+
jsonString,
|
|
159
|
+
(x) => Metadata$inboundSchema.parse(JSON.parse(x)),
|
|
160
|
+
`Failed to parse 'Metadata' from JSON`,
|
|
161
|
+
);
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
/** @internal */
|
|
165
|
+
export const ImageUpdateRequestMultiPart$inboundSchema: z.ZodType<
|
|
166
|
+
ImageUpdateRequestMultiPart,
|
|
167
|
+
z.ZodTypeDef,
|
|
168
|
+
unknown
|
|
169
|
+
> = z.object({
|
|
170
|
+
image: z.lazy(() => ImageUpdateRequestMultiPartImage$inboundSchema)
|
|
171
|
+
.optional(),
|
|
172
|
+
metadata: z.nullable(z.lazy(() => Metadata$inboundSchema)).optional(),
|
|
173
|
+
});
|
|
174
|
+
|
|
175
|
+
/** @internal */
|
|
176
|
+
export type ImageUpdateRequestMultiPart$Outbound = {
|
|
177
|
+
image?: ImageUpdateRequestMultiPartImage$Outbound | Blob | undefined;
|
|
178
|
+
metadata?: Metadata$Outbound | null | undefined;
|
|
179
|
+
};
|
|
180
|
+
|
|
181
|
+
/** @internal */
|
|
182
|
+
export const ImageUpdateRequestMultiPart$outboundSchema: z.ZodType<
|
|
183
|
+
ImageUpdateRequestMultiPart$Outbound,
|
|
184
|
+
z.ZodTypeDef,
|
|
185
|
+
ImageUpdateRequestMultiPart
|
|
186
|
+
> = z.object({
|
|
187
|
+
image: z.lazy(() => ImageUpdateRequestMultiPartImage$outboundSchema).or(
|
|
188
|
+
blobLikeSchema,
|
|
189
|
+
).optional(),
|
|
190
|
+
metadata: z.nullable(z.lazy(() => Metadata$outboundSchema)).optional(),
|
|
191
|
+
});
|
|
192
|
+
|
|
193
|
+
/**
|
|
194
|
+
* @internal
|
|
195
|
+
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
196
|
+
*/
|
|
197
|
+
export namespace ImageUpdateRequestMultiPart$ {
|
|
198
|
+
/** @deprecated use `ImageUpdateRequestMultiPart$inboundSchema` instead. */
|
|
199
|
+
export const inboundSchema = ImageUpdateRequestMultiPart$inboundSchema;
|
|
200
|
+
/** @deprecated use `ImageUpdateRequestMultiPart$outboundSchema` instead. */
|
|
201
|
+
export const outboundSchema = ImageUpdateRequestMultiPart$outboundSchema;
|
|
202
|
+
/** @deprecated use `ImageUpdateRequestMultiPart$Outbound` instead. */
|
|
203
|
+
export type Outbound = ImageUpdateRequestMultiPart$Outbound;
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
export function imageUpdateRequestMultiPartToJSON(
|
|
207
|
+
imageUpdateRequestMultiPart: ImageUpdateRequestMultiPart,
|
|
208
|
+
): string {
|
|
209
|
+
return JSON.stringify(
|
|
210
|
+
ImageUpdateRequestMultiPart$outboundSchema.parse(
|
|
211
|
+
imageUpdateRequestMultiPart,
|
|
212
|
+
),
|
|
213
|
+
);
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
export function imageUpdateRequestMultiPartFromJSON(
|
|
217
|
+
jsonString: string,
|
|
218
|
+
): SafeParseResult<ImageUpdateRequestMultiPart, SDKValidationError> {
|
|
219
|
+
return safeParse(
|
|
220
|
+
jsonString,
|
|
221
|
+
(x) => ImageUpdateRequestMultiPart$inboundSchema.parse(JSON.parse(x)),
|
|
222
|
+
`Failed to parse 'ImageUpdateRequestMultiPart' from JSON`,
|
|
223
|
+
);
|
|
224
|
+
}
|
|
@@ -0,0 +1,150 @@
|
|
|
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 { blobLikeSchema } from "../../types/blobs.js";
|
|
8
|
+
import { Result as SafeParseResult } from "../../types/fp.js";
|
|
9
|
+
import { SDKValidationError } from "../errors/sdkvalidationerror.js";
|
|
10
|
+
import {
|
|
11
|
+
ImageMetadataRequest,
|
|
12
|
+
ImageMetadataRequest$inboundSchema,
|
|
13
|
+
ImageMetadataRequest$Outbound,
|
|
14
|
+
ImageMetadataRequest$outboundSchema,
|
|
15
|
+
} from "./imagemetadatarequest.js";
|
|
16
|
+
|
|
17
|
+
export type Image = {
|
|
18
|
+
fileName: string;
|
|
19
|
+
content: ReadableStream<Uint8Array> | Blob | ArrayBuffer | Uint8Array;
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* Multipart request body for uploading an image with optional metadata.
|
|
24
|
+
*/
|
|
25
|
+
export type ImageUploadRequestMultiPart = {
|
|
26
|
+
image: Image | Blob;
|
|
27
|
+
/**
|
|
28
|
+
* Optional, json-encoded metadata to associate with the uploaded image.
|
|
29
|
+
*/
|
|
30
|
+
metadata?: ImageMetadataRequest | undefined;
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
/** @internal */
|
|
34
|
+
export const Image$inboundSchema: z.ZodType<Image, z.ZodTypeDef, unknown> = z
|
|
35
|
+
.object({
|
|
36
|
+
fileName: z.string(),
|
|
37
|
+
content: z.union([
|
|
38
|
+
z.instanceof(ReadableStream<Uint8Array>),
|
|
39
|
+
z.instanceof(Blob),
|
|
40
|
+
z.instanceof(ArrayBuffer),
|
|
41
|
+
z.instanceof(Uint8Array),
|
|
42
|
+
]),
|
|
43
|
+
});
|
|
44
|
+
|
|
45
|
+
/** @internal */
|
|
46
|
+
export type Image$Outbound = {
|
|
47
|
+
fileName: string;
|
|
48
|
+
content: ReadableStream<Uint8Array> | Blob | ArrayBuffer | Uint8Array;
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
/** @internal */
|
|
52
|
+
export const Image$outboundSchema: z.ZodType<
|
|
53
|
+
Image$Outbound,
|
|
54
|
+
z.ZodTypeDef,
|
|
55
|
+
Image
|
|
56
|
+
> = z.object({
|
|
57
|
+
fileName: z.string(),
|
|
58
|
+
content: z.union([
|
|
59
|
+
z.instanceof(ReadableStream<Uint8Array>),
|
|
60
|
+
z.instanceof(Blob),
|
|
61
|
+
z.instanceof(ArrayBuffer),
|
|
62
|
+
z.instanceof(Uint8Array),
|
|
63
|
+
]),
|
|
64
|
+
});
|
|
65
|
+
|
|
66
|
+
/**
|
|
67
|
+
* @internal
|
|
68
|
+
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
69
|
+
*/
|
|
70
|
+
export namespace Image$ {
|
|
71
|
+
/** @deprecated use `Image$inboundSchema` instead. */
|
|
72
|
+
export const inboundSchema = Image$inboundSchema;
|
|
73
|
+
/** @deprecated use `Image$outboundSchema` instead. */
|
|
74
|
+
export const outboundSchema = Image$outboundSchema;
|
|
75
|
+
/** @deprecated use `Image$Outbound` instead. */
|
|
76
|
+
export type Outbound = Image$Outbound;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
export function imageToJSON(image: Image): string {
|
|
80
|
+
return JSON.stringify(Image$outboundSchema.parse(image));
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
export function imageFromJSON(
|
|
84
|
+
jsonString: string,
|
|
85
|
+
): SafeParseResult<Image, SDKValidationError> {
|
|
86
|
+
return safeParse(
|
|
87
|
+
jsonString,
|
|
88
|
+
(x) => Image$inboundSchema.parse(JSON.parse(x)),
|
|
89
|
+
`Failed to parse 'Image' from JSON`,
|
|
90
|
+
);
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
/** @internal */
|
|
94
|
+
export const ImageUploadRequestMultiPart$inboundSchema: z.ZodType<
|
|
95
|
+
ImageUploadRequestMultiPart,
|
|
96
|
+
z.ZodTypeDef,
|
|
97
|
+
unknown
|
|
98
|
+
> = z.object({
|
|
99
|
+
image: z.lazy(() => Image$inboundSchema),
|
|
100
|
+
metadata: ImageMetadataRequest$inboundSchema.optional(),
|
|
101
|
+
});
|
|
102
|
+
|
|
103
|
+
/** @internal */
|
|
104
|
+
export type ImageUploadRequestMultiPart$Outbound = {
|
|
105
|
+
image: Image$Outbound | Blob;
|
|
106
|
+
metadata?: ImageMetadataRequest$Outbound | undefined;
|
|
107
|
+
};
|
|
108
|
+
|
|
109
|
+
/** @internal */
|
|
110
|
+
export const ImageUploadRequestMultiPart$outboundSchema: z.ZodType<
|
|
111
|
+
ImageUploadRequestMultiPart$Outbound,
|
|
112
|
+
z.ZodTypeDef,
|
|
113
|
+
ImageUploadRequestMultiPart
|
|
114
|
+
> = z.object({
|
|
115
|
+
image: z.lazy(() => Image$outboundSchema).or(blobLikeSchema),
|
|
116
|
+
metadata: ImageMetadataRequest$outboundSchema.optional(),
|
|
117
|
+
});
|
|
118
|
+
|
|
119
|
+
/**
|
|
120
|
+
* @internal
|
|
121
|
+
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
122
|
+
*/
|
|
123
|
+
export namespace ImageUploadRequestMultiPart$ {
|
|
124
|
+
/** @deprecated use `ImageUploadRequestMultiPart$inboundSchema` instead. */
|
|
125
|
+
export const inboundSchema = ImageUploadRequestMultiPart$inboundSchema;
|
|
126
|
+
/** @deprecated use `ImageUploadRequestMultiPart$outboundSchema` instead. */
|
|
127
|
+
export const outboundSchema = ImageUploadRequestMultiPart$outboundSchema;
|
|
128
|
+
/** @deprecated use `ImageUploadRequestMultiPart$Outbound` instead. */
|
|
129
|
+
export type Outbound = ImageUploadRequestMultiPart$Outbound;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
export function imageUploadRequestMultiPartToJSON(
|
|
133
|
+
imageUploadRequestMultiPart: ImageUploadRequestMultiPart,
|
|
134
|
+
): string {
|
|
135
|
+
return JSON.stringify(
|
|
136
|
+
ImageUploadRequestMultiPart$outboundSchema.parse(
|
|
137
|
+
imageUploadRequestMultiPart,
|
|
138
|
+
),
|
|
139
|
+
);
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
export function imageUploadRequestMultiPartFromJSON(
|
|
143
|
+
jsonString: string,
|
|
144
|
+
): SafeParseResult<ImageUploadRequestMultiPart, SDKValidationError> {
|
|
145
|
+
return safeParse(
|
|
146
|
+
jsonString,
|
|
147
|
+
(x) => ImageUploadRequestMultiPart$inboundSchema.parse(JSON.parse(x)),
|
|
148
|
+
`Failed to parse 'ImageUploadRequestMultiPart' from JSON`,
|
|
149
|
+
);
|
|
150
|
+
}
|
|
@@ -224,6 +224,10 @@ export * from "./governmentiderror.js";
|
|
|
224
224
|
export * from "./granttype.js";
|
|
225
225
|
export * from "./guestprofile.js";
|
|
226
226
|
export * from "./imagemetadata.js";
|
|
227
|
+
export * from "./imagemetadatarequest.js";
|
|
228
|
+
export * from "./imagemetadatavalidationerror.js";
|
|
229
|
+
export * from "./imageupdaterequestmultipart.js";
|
|
230
|
+
export * from "./imageuploadrequestmultipart.js";
|
|
227
231
|
export * from "./incurredfee.js";
|
|
228
232
|
export * from "./individualname.js";
|
|
229
233
|
export * from "./individualnameerror.js";
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod";
|
|
6
|
+
import * as components from "../components/index.js";
|
|
7
|
+
import { MoovError } from "./mooverror.js";
|
|
8
|
+
|
|
9
|
+
export type ImageRequestValidationErrorData = {
|
|
10
|
+
image?: string | undefined;
|
|
11
|
+
metadata?: components.ImageMetadataValidationError | undefined;
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
export class ImageRequestValidationError extends MoovError {
|
|
15
|
+
image?: string | undefined;
|
|
16
|
+
metadata?: components.ImageMetadataValidationError | undefined;
|
|
17
|
+
|
|
18
|
+
/** The original data that was passed to this error instance. */
|
|
19
|
+
data$: ImageRequestValidationErrorData;
|
|
20
|
+
|
|
21
|
+
constructor(
|
|
22
|
+
err: ImageRequestValidationErrorData,
|
|
23
|
+
httpMeta: { response: Response; request: Request; body: string },
|
|
24
|
+
) {
|
|
25
|
+
const message = "message" in err && typeof err.message === "string"
|
|
26
|
+
? err.message
|
|
27
|
+
: `API error occurred: ${JSON.stringify(err)}`;
|
|
28
|
+
super(message, httpMeta);
|
|
29
|
+
this.data$ = err;
|
|
30
|
+
if (err.image != null) this.image = err.image;
|
|
31
|
+
if (err.metadata != null) this.metadata = err.metadata;
|
|
32
|
+
|
|
33
|
+
this.name = "ImageRequestValidationError";
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
/** @internal */
|
|
38
|
+
export const ImageRequestValidationError$inboundSchema: z.ZodType<
|
|
39
|
+
ImageRequestValidationError,
|
|
40
|
+
z.ZodTypeDef,
|
|
41
|
+
unknown
|
|
42
|
+
> = z.object({
|
|
43
|
+
image: z.string().optional(),
|
|
44
|
+
metadata: components.ImageMetadataValidationError$inboundSchema.optional(),
|
|
45
|
+
request$: z.instanceof(Request),
|
|
46
|
+
response$: z.instanceof(Response),
|
|
47
|
+
body$: z.string(),
|
|
48
|
+
})
|
|
49
|
+
.transform((v) => {
|
|
50
|
+
return new ImageRequestValidationError(v, {
|
|
51
|
+
request: v.request$,
|
|
52
|
+
response: v.response$,
|
|
53
|
+
body: v.body$,
|
|
54
|
+
});
|
|
55
|
+
});
|
|
56
|
+
|
|
57
|
+
/** @internal */
|
|
58
|
+
export type ImageRequestValidationError$Outbound = {
|
|
59
|
+
image?: string | undefined;
|
|
60
|
+
metadata?: components.ImageMetadataValidationError$Outbound | undefined;
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
/** @internal */
|
|
64
|
+
export const ImageRequestValidationError$outboundSchema: z.ZodType<
|
|
65
|
+
ImageRequestValidationError$Outbound,
|
|
66
|
+
z.ZodTypeDef,
|
|
67
|
+
ImageRequestValidationError
|
|
68
|
+
> = z.instanceof(ImageRequestValidationError)
|
|
69
|
+
.transform(v => v.data$)
|
|
70
|
+
.pipe(z.object({
|
|
71
|
+
image: z.string().optional(),
|
|
72
|
+
metadata: components.ImageMetadataValidationError$outboundSchema.optional(),
|
|
73
|
+
}));
|
|
74
|
+
|
|
75
|
+
/**
|
|
76
|
+
* @internal
|
|
77
|
+
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
78
|
+
*/
|
|
79
|
+
export namespace ImageRequestValidationError$ {
|
|
80
|
+
/** @deprecated use `ImageRequestValidationError$inboundSchema` instead. */
|
|
81
|
+
export const inboundSchema = ImageRequestValidationError$inboundSchema;
|
|
82
|
+
/** @deprecated use `ImageRequestValidationError$outboundSchema` instead. */
|
|
83
|
+
export const outboundSchema = ImageRequestValidationError$outboundSchema;
|
|
84
|
+
/** @deprecated use `ImageRequestValidationError$Outbound` instead. */
|
|
85
|
+
export type Outbound = ImageRequestValidationError$Outbound;
|
|
86
|
+
}
|
|
@@ -20,6 +20,7 @@ export * from "./fileuploadvalidationerror.js";
|
|
|
20
20
|
export * from "./filevalidationerror.js";
|
|
21
21
|
export * from "./genericerror.js";
|
|
22
22
|
export * from "./httpclienterrors.js";
|
|
23
|
+
export * from "./imagerequestvalidationerror.js";
|
|
23
24
|
export * from "./linkapplepayerror.js";
|
|
24
25
|
export * from "./linkcarderror.js";
|
|
25
26
|
export * from "./listtransfersvalidationerror.js";
|
|
@@ -144,6 +144,7 @@ export * from "./updateapplepaymerchantdomains.js";
|
|
|
144
144
|
export * from "./updatebrand.js";
|
|
145
145
|
export * from "./updatecard.js";
|
|
146
146
|
export * from "./updatedisputeevidence.js";
|
|
147
|
+
export * from "./updateimage.js";
|
|
147
148
|
export * from "./updateissuedcard.js";
|
|
148
149
|
export * from "./updatepaymentlink.js";
|
|
149
150
|
export * from "./updateproduct.js";
|
|
@@ -156,5 +157,6 @@ export * from "./updatewallet.js";
|
|
|
156
157
|
export * from "./uploaddisputeevidencefile.js";
|
|
157
158
|
export * from "./uploaddisputeevidencetext.js";
|
|
158
159
|
export * from "./uploadfile.js";
|
|
160
|
+
export * from "./uploadimage.js";
|
|
159
161
|
export * from "./upsertbrand.js";
|
|
160
162
|
export * from "./upsertunderwriting.js";
|