@moovio/sdk 0.15.5 → 0.15.7

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 +54 -43
  2. package/bin/mcp-server.js +1399 -647
  3. package/bin/mcp-server.js.map +24 -11
  4. package/docs/sdks/images/README.md +328 -0
  5. package/examples/package-lock.json +1 -1
  6. package/funcs/imagesDelete.d.ts +15 -0
  7. package/funcs/imagesDelete.d.ts.map +1 -0
  8. package/funcs/imagesDelete.js +137 -0
  9. package/funcs/imagesDelete.js.map +1 -0
  10. package/funcs/imagesGetMetadata.d.ts +14 -0
  11. package/funcs/imagesGetMetadata.d.ts.map +1 -0
  12. package/funcs/imagesGetMetadata.js +126 -0
  13. package/funcs/imagesGetMetadata.js.map +1 -0
  14. package/funcs/imagesGetPublic.d.ts +21 -0
  15. package/funcs/imagesGetPublic.d.ts.map +1 -0
  16. package/funcs/imagesGetPublic.js +144 -0
  17. package/funcs/imagesGetPublic.js.map +1 -0
  18. package/funcs/imagesList.d.ts +14 -0
  19. package/funcs/imagesList.d.ts.map +1 -0
  20. package/funcs/imagesList.js +122 -0
  21. package/funcs/imagesList.js.map +1 -0
  22. package/jsr.json +1 -1
  23. package/lib/config.d.ts +3 -3
  24. package/lib/config.js +3 -3
  25. package/lib/config.js.map +1 -1
  26. package/mcp-server/mcp-server.js +1 -1
  27. package/mcp-server/server.d.ts.map +1 -1
  28. package/mcp-server/server.js +9 -1
  29. package/mcp-server/server.js.map +1 -1
  30. package/mcp-server/tools/imagesDelete.d.ts +8 -0
  31. package/mcp-server/tools/imagesDelete.d.ts.map +1 -0
  32. package/mcp-server/tools/imagesDelete.js +61 -0
  33. package/mcp-server/tools/imagesDelete.js.map +1 -0
  34. package/mcp-server/tools/imagesGetMetadata.d.ts +8 -0
  35. package/mcp-server/tools/imagesGetMetadata.d.ts.map +1 -0
  36. package/mcp-server/tools/imagesGetMetadata.js +62 -0
  37. package/mcp-server/tools/imagesGetMetadata.js.map +1 -0
  38. package/mcp-server/tools/imagesGetPublic.d.ts +8 -0
  39. package/mcp-server/tools/imagesGetPublic.d.ts.map +1 -0
  40. package/mcp-server/tools/imagesGetPublic.js +62 -0
  41. package/mcp-server/tools/imagesGetPublic.js.map +1 -0
  42. package/mcp-server/tools/imagesList.d.ts +8 -0
  43. package/mcp-server/tools/imagesList.d.ts.map +1 -0
  44. package/mcp-server/tools/imagesList.js +62 -0
  45. package/mcp-server/tools/imagesList.js.map +1 -0
  46. package/models/components/imagemetadata.d.ts +49 -0
  47. package/models/components/imagemetadata.d.ts.map +1 -0
  48. package/models/components/imagemetadata.js +77 -0
  49. package/models/components/imagemetadata.js.map +1 -0
  50. package/models/components/index.d.ts +1 -0
  51. package/models/components/index.d.ts.map +1 -1
  52. package/models/components/index.js +1 -0
  53. package/models/components/index.js.map +1 -1
  54. package/models/components/paymentmethodswallet.d.ts +12 -0
  55. package/models/components/paymentmethodswallet.d.ts.map +1 -1
  56. package/models/components/paymentmethodswallet.js +5 -0
  57. package/models/components/paymentmethodswallet.js.map +1 -1
  58. package/models/components/security.d.ts +4 -4
  59. package/models/components/security.d.ts.map +1 -1
  60. package/models/components/security.js +4 -4
  61. package/models/components/security.js.map +1 -1
  62. package/models/operations/deleteimage.d.ts +98 -0
  63. package/models/operations/deleteimage.d.ts.map +1 -0
  64. package/models/operations/deleteimage.js +142 -0
  65. package/models/operations/deleteimage.js.map +1 -0
  66. package/models/operations/getimagemetadata.d.ts +101 -0
  67. package/models/operations/getimagemetadata.d.ts.map +1 -0
  68. package/models/operations/getimagemetadata.js +147 -0
  69. package/models/operations/getimagemetadata.js.map +1 -0
  70. package/models/operations/getpublicimage.d.ts +94 -0
  71. package/models/operations/getpublicimage.d.ts.map +1 -0
  72. package/models/operations/getpublicimage.js +160 -0
  73. package/models/operations/getpublicimage.js.map +1 -0
  74. package/models/operations/index.d.ts +4 -0
  75. package/models/operations/index.d.ts.map +1 -1
  76. package/models/operations/index.js +4 -0
  77. package/models/operations/index.js.map +1 -1
  78. package/models/operations/listimagemetadata.d.ts +99 -0
  79. package/models/operations/listimagemetadata.d.ts.map +1 -0
  80. package/models/operations/listimagemetadata.js +145 -0
  81. package/models/operations/listimagemetadata.js.map +1 -0
  82. package/package.json +1 -1
  83. package/sdk/images.d.ts +25 -0
  84. package/sdk/images.d.ts.map +1 -0
  85. package/sdk/images.js +42 -0
  86. package/sdk/images.js.map +1 -0
  87. package/sdk/sdk.d.ts +3 -0
  88. package/sdk/sdk.d.ts.map +1 -1
  89. package/sdk/sdk.js +4 -0
  90. package/sdk/sdk.js.map +1 -1
  91. package/src/funcs/imagesDelete.ts +195 -0
  92. package/src/funcs/imagesGetMetadata.ts +180 -0
  93. package/src/funcs/imagesGetPublic.ts +196 -0
  94. package/src/funcs/imagesList.ts +176 -0
  95. package/src/lib/config.ts +3 -3
  96. package/src/mcp-server/mcp-server.ts +1 -1
  97. package/src/mcp-server/server.ts +9 -1
  98. package/src/mcp-server/tools/imagesDelete.ts +33 -0
  99. package/src/mcp-server/tools/imagesGetMetadata.ts +35 -0
  100. package/src/mcp-server/tools/imagesGetPublic.ts +35 -0
  101. package/src/mcp-server/tools/imagesList.ts +35 -0
  102. package/src/models/components/imagemetadata.ts +90 -0
  103. package/src/models/components/index.ts +1 -0
  104. package/src/models/components/paymentmethodswallet.ts +20 -0
  105. package/src/models/components/security.ts +8 -8
  106. package/src/models/operations/deleteimage.ts +216 -0
  107. package/src/models/operations/getimagemetadata.ts +223 -0
  108. package/src/models/operations/getpublicimage.ts +244 -0
  109. package/src/models/operations/index.ts +4 -0
  110. package/src/models/operations/listimagemetadata.ts +219 -0
  111. package/src/sdk/images.ts +74 -0
  112. package/src/sdk/sdk.ts +6 -0
@@ -0,0 +1,196 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import { MoovCore } from "../core.js";
6
+ import { encodeFormQuery, encodeSimple } from "../lib/encodings.js";
7
+ import * as M from "../lib/matchers.js";
8
+ import { compactMap } from "../lib/primitives.js";
9
+ import { safeParse } from "../lib/schemas.js";
10
+ import { RequestOptions } from "../lib/sdks.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
+ export enum GetPublicAcceptEnum {
27
+ imageJpeg = "image/jpeg",
28
+ imagePng = "image/png",
29
+ imageWebp = "image/webp",
30
+ }
31
+
32
+ /**
33
+ * Get an image by its public ID.
34
+ */
35
+ export function imagesGetPublic(
36
+ client: MoovCore,
37
+ request: operations.GetPublicImageRequest,
38
+ options?: RequestOptions & { acceptHeaderOverride?: GetPublicAcceptEnum },
39
+ ): APIPromise<
40
+ Result<
41
+ operations.GetPublicImageResponse | undefined,
42
+ | MoovError
43
+ | ResponseValidationError
44
+ | ConnectionError
45
+ | RequestAbortedError
46
+ | RequestTimeoutError
47
+ | InvalidRequestError
48
+ | UnexpectedClientError
49
+ | SDKValidationError
50
+ >
51
+ > {
52
+ return new APIPromise($do(
53
+ client,
54
+ request,
55
+ options,
56
+ ));
57
+ }
58
+
59
+ async function $do(
60
+ client: MoovCore,
61
+ request: operations.GetPublicImageRequest,
62
+ options?: RequestOptions & { acceptHeaderOverride?: GetPublicAcceptEnum },
63
+ ): Promise<
64
+ [
65
+ Result<
66
+ operations.GetPublicImageResponse | undefined,
67
+ | MoovError
68
+ | ResponseValidationError
69
+ | ConnectionError
70
+ | RequestAbortedError
71
+ | RequestTimeoutError
72
+ | InvalidRequestError
73
+ | UnexpectedClientError
74
+ | SDKValidationError
75
+ >,
76
+ APICall,
77
+ ]
78
+ > {
79
+ const parsed = safeParse(
80
+ request,
81
+ (value) => operations.GetPublicImageRequest$outboundSchema.parse(value),
82
+ "Input validation failed",
83
+ );
84
+ if (!parsed.ok) {
85
+ return [parsed, { status: "invalid" }];
86
+ }
87
+ const payload = parsed.value;
88
+ const body = null;
89
+
90
+ const pathParams = {
91
+ publicID: encodeSimple("publicID", payload.publicID, {
92
+ explode: false,
93
+ charEncoding: "percent",
94
+ }),
95
+ };
96
+
97
+ const path = pathToFunc("/images/{publicID}")(pathParams);
98
+
99
+ const query = encodeFormQuery({
100
+ "size": payload.size,
101
+ }, { explode: false });
102
+
103
+ const headers = new Headers(compactMap({
104
+ Accept: options?.acceptHeaderOverride
105
+ || "image/jpeg;q=1, image/png;q=0.7, image/webp;q=0",
106
+ "if-none-match": encodeSimple("if-none-match", payload["if-none-match"], {
107
+ explode: false,
108
+ charEncoding: "none",
109
+ }),
110
+ }));
111
+
112
+ const context = {
113
+ options: client._options,
114
+ baseURL: options?.serverURL ?? client._baseURL ?? "",
115
+ operationID: "getPublicImage",
116
+ oAuth2Scopes: [],
117
+
118
+ resolvedSecurity: null,
119
+
120
+ securitySource: null,
121
+ retryConfig: options?.retries
122
+ || client._options.retryConfig
123
+ || { strategy: "none" },
124
+ retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
125
+ };
126
+
127
+ const requestRes = client._createRequest(context, {
128
+ method: "GET",
129
+ baseURL: options?.serverURL,
130
+ path: path,
131
+ headers: headers,
132
+ query: query,
133
+ body: body,
134
+ userAgent: client._options.userAgent,
135
+ timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
136
+ }, options);
137
+ if (!requestRes.ok) {
138
+ return [requestRes, { status: "invalid" }];
139
+ }
140
+ const req = requestRes.value;
141
+
142
+ const doResult = await client._do(req, {
143
+ context,
144
+ errorCodes: ["404", "429", "4XX", "500", "502", "504", "5XX"],
145
+ retryConfig: context.retryConfig,
146
+ retryCodes: context.retryCodes,
147
+ });
148
+ if (!doResult.ok) {
149
+ return [doResult, { status: "request-error", request: req }];
150
+ }
151
+ const response = doResult.value;
152
+
153
+ const responseFields = {
154
+ HttpMeta: { Response: response, Request: req },
155
+ };
156
+
157
+ const [result] = await M.match<
158
+ operations.GetPublicImageResponse | undefined,
159
+ | MoovError
160
+ | ResponseValidationError
161
+ | ConnectionError
162
+ | RequestAbortedError
163
+ | RequestTimeoutError
164
+ | InvalidRequestError
165
+ | UnexpectedClientError
166
+ | SDKValidationError
167
+ >(
168
+ M.stream(200, operations.GetPublicImageResponse$inboundSchema.optional(), {
169
+ ctype: "image/webp",
170
+ hdrs: true,
171
+ key: "Result",
172
+ }),
173
+ M.stream(200, operations.GetPublicImageResponse$inboundSchema.optional(), {
174
+ ctype: "image/png",
175
+ hdrs: true,
176
+ key: "Result",
177
+ }),
178
+ M.stream(200, operations.GetPublicImageResponse$inboundSchema.optional(), {
179
+ ctype: "image/jpeg",
180
+ hdrs: true,
181
+ key: "Result",
182
+ }),
183
+ M.nil(304, operations.GetPublicImageResponse$inboundSchema.optional(), {
184
+ hdrs: true,
185
+ }),
186
+ M.fail([404, 429]),
187
+ M.fail([500, 502, 504]),
188
+ M.fail("4XX"),
189
+ M.fail("5XX"),
190
+ )(response, req, { extraFields: responseFields });
191
+ if (!result.ok) {
192
+ return [result, { status: "complete", request: req, response }];
193
+ }
194
+
195
+ return [result, { status: "complete", request: req, response }];
196
+ }
@@ -0,0 +1,176 @@
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 * as M from "../lib/matchers.js";
8
+ import { compactMap } from "../lib/primitives.js";
9
+ import { safeParse } from "../lib/schemas.js";
10
+ import { RequestOptions } from "../lib/sdks.js";
11
+ import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
12
+ import { pathToFunc } from "../lib/url.js";
13
+ import {
14
+ ConnectionError,
15
+ InvalidRequestError,
16
+ RequestAbortedError,
17
+ RequestTimeoutError,
18
+ UnexpectedClientError,
19
+ } from "../models/errors/httpclienterrors.js";
20
+ import { MoovError } from "../models/errors/mooverror.js";
21
+ import { ResponseValidationError } from "../models/errors/responsevalidationerror.js";
22
+ import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
23
+ import * as operations from "../models/operations/index.js";
24
+ import { APICall, APIPromise } from "../types/async.js";
25
+ import { Result } from "../types/fp.js";
26
+
27
+ /**
28
+ * List metadata for all images in the specified account.
29
+ */
30
+ export function imagesList(
31
+ client: MoovCore,
32
+ request: operations.ListImageMetadataRequest,
33
+ options?: RequestOptions,
34
+ ): APIPromise<
35
+ Result<
36
+ operations.ListImageMetadataResponse,
37
+ | MoovError
38
+ | ResponseValidationError
39
+ | ConnectionError
40
+ | RequestAbortedError
41
+ | RequestTimeoutError
42
+ | InvalidRequestError
43
+ | UnexpectedClientError
44
+ | SDKValidationError
45
+ >
46
+ > {
47
+ return new APIPromise($do(
48
+ client,
49
+ request,
50
+ options,
51
+ ));
52
+ }
53
+
54
+ async function $do(
55
+ client: MoovCore,
56
+ request: operations.ListImageMetadataRequest,
57
+ options?: RequestOptions,
58
+ ): Promise<
59
+ [
60
+ Result<
61
+ operations.ListImageMetadataResponse,
62
+ | MoovError
63
+ | ResponseValidationError
64
+ | ConnectionError
65
+ | RequestAbortedError
66
+ | RequestTimeoutError
67
+ | InvalidRequestError
68
+ | UnexpectedClientError
69
+ | SDKValidationError
70
+ >,
71
+ APICall,
72
+ ]
73
+ > {
74
+ const parsed = safeParse(
75
+ request,
76
+ (value) => operations.ListImageMetadataRequest$outboundSchema.parse(value),
77
+ "Input validation failed",
78
+ );
79
+ if (!parsed.ok) {
80
+ return [parsed, { status: "invalid" }];
81
+ }
82
+ const payload = parsed.value;
83
+ const body = null;
84
+
85
+ const pathParams = {
86
+ accountID: encodeSimple("accountID", payload.accountID, {
87
+ explode: false,
88
+ charEncoding: "percent",
89
+ }),
90
+ };
91
+
92
+ const path = pathToFunc("/accounts/{accountID}/images")(pathParams);
93
+
94
+ const headers = new Headers(compactMap({
95
+ Accept: "application/json",
96
+ "x-moov-version": encodeSimple(
97
+ "x-moov-version",
98
+ client._options.xMoovVersion,
99
+ { explode: false, charEncoding: "none" },
100
+ ),
101
+ }));
102
+
103
+ const securityInput = await extractSecurity(client._options.security);
104
+ const requestSecurity = resolveGlobalSecurity(securityInput);
105
+
106
+ const context = {
107
+ options: client._options,
108
+ baseURL: options?.serverURL ?? client._baseURL ?? "",
109
+ operationID: "listImageMetadata",
110
+ oAuth2Scopes: [],
111
+
112
+ resolvedSecurity: requestSecurity,
113
+
114
+ securitySource: client._options.security,
115
+ retryConfig: options?.retries
116
+ || client._options.retryConfig
117
+ || { strategy: "none" },
118
+ retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
119
+ };
120
+
121
+ const requestRes = client._createRequest(context, {
122
+ security: requestSecurity,
123
+ method: "GET",
124
+ baseURL: options?.serverURL,
125
+ path: path,
126
+ headers: headers,
127
+ body: body,
128
+ userAgent: client._options.userAgent,
129
+ timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
130
+ }, options);
131
+ if (!requestRes.ok) {
132
+ return [requestRes, { status: "invalid" }];
133
+ }
134
+ const req = requestRes.value;
135
+
136
+ const doResult = await client._do(req, {
137
+ context,
138
+ errorCodes: ["401", "403", "429", "4XX", "500", "504", "5XX"],
139
+ retryConfig: context.retryConfig,
140
+ retryCodes: context.retryCodes,
141
+ });
142
+ if (!doResult.ok) {
143
+ return [doResult, { status: "request-error", request: req }];
144
+ }
145
+ const response = doResult.value;
146
+
147
+ const responseFields = {
148
+ HttpMeta: { Response: response, Request: req },
149
+ };
150
+
151
+ const [result] = await M.match<
152
+ operations.ListImageMetadataResponse,
153
+ | MoovError
154
+ | ResponseValidationError
155
+ | ConnectionError
156
+ | RequestAbortedError
157
+ | RequestTimeoutError
158
+ | InvalidRequestError
159
+ | UnexpectedClientError
160
+ | SDKValidationError
161
+ >(
162
+ M.json(200, operations.ListImageMetadataResponse$inboundSchema, {
163
+ hdrs: true,
164
+ key: "Result",
165
+ }),
166
+ M.fail([401, 403, 429]),
167
+ M.fail([500, 504]),
168
+ M.fail("4XX"),
169
+ M.fail("5XX"),
170
+ )(response, req, { extraFields: responseFields });
171
+ if (!result.ok) {
172
+ return [result, { status: "complete", request: req, response }];
173
+ }
174
+
175
+ return [result, { status: "complete", request: req, response }];
176
+ }
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.15.5",
77
- genVersion: "2.716.16",
78
- userAgent: "speakeasy-sdk/typescript 0.15.5 2.716.16 latest @moovio/sdk",
76
+ sdkVersion: "0.15.7",
77
+ genVersion: "2.720.1",
78
+ userAgent: "speakeasy-sdk/typescript 0.15.7 2.720.1 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.15.5",
22
+ currentVersion: "0.15.7",
23
23
  },
24
24
  });
25
25
 
@@ -88,6 +88,10 @@ import { tool$feePlansRetrieveFees } from "./tools/feePlansRetrieveFees.js";
88
88
  import { tool$filesGet } from "./tools/filesGet.js";
89
89
  import { tool$filesList } from "./tools/filesList.js";
90
90
  import { tool$filesUpload } from "./tools/filesUpload.js";
91
+ import { tool$imagesDelete } from "./tools/imagesDelete.js";
92
+ import { tool$imagesGetMetadata } from "./tools/imagesGetMetadata.js";
93
+ import { tool$imagesGetPublic } from "./tools/imagesGetPublic.js";
94
+ import { tool$imagesList } from "./tools/imagesList.js";
91
95
  import { tool$industriesList } from "./tools/industriesList.js";
92
96
  import { tool$institutionsSearch } from "./tools/institutionsSearch.js";
93
97
  import { tool$institutionsSearchInstitutions } from "./tools/institutionsSearchInstitutions.js";
@@ -172,7 +176,7 @@ export function createMCPServer(deps: {
172
176
  }) {
173
177
  const server = new McpServer({
174
178
  name: "Moov",
175
- version: "0.15.5",
179
+ version: "0.15.7",
176
180
  });
177
181
 
178
182
  const client = new MoovCore({
@@ -262,6 +266,10 @@ export function createMCPServer(deps: {
262
266
  tool(tool$filesUpload);
263
267
  tool(tool$filesList);
264
268
  tool(tool$filesGet);
269
+ tool(tool$imagesList);
270
+ tool(tool$imagesGetMetadata);
271
+ tool(tool$imagesDelete);
272
+ tool(tool$imagesGetPublic);
265
273
  tool(tool$paymentLinksCreate);
266
274
  tool(tool$paymentLinksList);
267
275
  tool(tool$paymentLinksGet);
@@ -0,0 +1,33 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import { imagesDelete } from "../../funcs/imagesDelete.js";
6
+ import * as operations from "../../models/operations/index.js";
7
+ import { formatResult, ToolDefinition } from "../tools.js";
8
+
9
+ const args = {
10
+ request: operations.DeleteImageRequest$inboundSchema,
11
+ };
12
+
13
+ export const tool$imagesDelete: ToolDefinition<typeof args> = {
14
+ name: "images-delete",
15
+ description: `Permanently delete an image by its ID.`,
16
+ args,
17
+ tool: async (client, args, ctx) => {
18
+ const [result, apiCall] = await imagesDelete(
19
+ client,
20
+ args.request,
21
+ { fetchOptions: { signal: ctx.signal } },
22
+ ).$inspect();
23
+
24
+ if (!result.ok) {
25
+ return {
26
+ content: [{ type: "text", text: result.error.message }],
27
+ isError: true,
28
+ };
29
+ }
30
+
31
+ return formatResult(void 0, apiCall);
32
+ },
33
+ };
@@ -0,0 +1,35 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import { imagesGetMetadata } from "../../funcs/imagesGetMetadata.js";
6
+ import * as operations from "../../models/operations/index.js";
7
+ import { formatResult, ToolDefinition } from "../tools.js";
8
+
9
+ const args = {
10
+ request: operations.GetImageMetadataRequest$inboundSchema,
11
+ };
12
+
13
+ export const tool$imagesGetMetadata: ToolDefinition<typeof args> = {
14
+ name: "images-get-metadata",
15
+ description: `Retrieve metadata for a specific image by its ID.`,
16
+ args,
17
+ tool: async (client, args, ctx) => {
18
+ const [result, apiCall] = await imagesGetMetadata(
19
+ client,
20
+ args.request,
21
+ { fetchOptions: { signal: ctx.signal } },
22
+ ).$inspect();
23
+
24
+ if (!result.ok) {
25
+ return {
26
+ content: [{ type: "text", text: result.error.message }],
27
+ isError: true,
28
+ };
29
+ }
30
+
31
+ const value = result.value.result;
32
+
33
+ return formatResult(value, apiCall);
34
+ },
35
+ };
@@ -0,0 +1,35 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import { imagesGetPublic } from "../../funcs/imagesGetPublic.js";
6
+ import * as operations from "../../models/operations/index.js";
7
+ import { formatResult, ToolDefinition } from "../tools.js";
8
+
9
+ const args = {
10
+ request: operations.GetPublicImageRequest$inboundSchema,
11
+ };
12
+
13
+ export const tool$imagesGetPublic: ToolDefinition<typeof args> = {
14
+ name: "images-get-public",
15
+ description: `Get an image by its public ID.`,
16
+ args,
17
+ tool: async (client, args, ctx) => {
18
+ const [result, apiCall] = await imagesGetPublic(
19
+ client,
20
+ args.request,
21
+ { fetchOptions: { signal: ctx.signal } },
22
+ ).$inspect();
23
+
24
+ if (!result.ok) {
25
+ return {
26
+ content: [{ type: "text", text: result.error.message }],
27
+ isError: true,
28
+ };
29
+ }
30
+
31
+ const value = result.value?.result;
32
+
33
+ return formatResult(value, apiCall);
34
+ },
35
+ };
@@ -0,0 +1,35 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import { imagesList } from "../../funcs/imagesList.js";
6
+ import * as operations from "../../models/operations/index.js";
7
+ import { formatResult, ToolDefinition } from "../tools.js";
8
+
9
+ const args = {
10
+ request: operations.ListImageMetadataRequest$inboundSchema,
11
+ };
12
+
13
+ export const tool$imagesList: ToolDefinition<typeof args> = {
14
+ name: "images-list",
15
+ description: `List metadata for all images in the specified account.`,
16
+ args,
17
+ tool: async (client, args, ctx) => {
18
+ const [result, apiCall] = await imagesList(
19
+ client,
20
+ args.request,
21
+ { fetchOptions: { signal: ctx.signal } },
22
+ ).$inspect();
23
+
24
+ if (!result.ok) {
25
+ return {
26
+ content: [{ type: "text", text: result.error.message }],
27
+ isError: true,
28
+ };
29
+ }
30
+
31
+ const value = result.value.result;
32
+
33
+ return formatResult(value, apiCall);
34
+ },
35
+ };
@@ -0,0 +1,90 @@
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
+ * Metadata about an uploaded image.
12
+ */
13
+ export type ImageMetadata = {
14
+ imageID: string;
15
+ /**
16
+ * Alternative text for the image.
17
+ */
18
+ altText?: string | undefined;
19
+ /**
20
+ * A public URL to access the image. An optional `size={width}x{height}`
21
+ *
22
+ * @remarks
23
+ * query parameter can be provided to resize the image.
24
+ */
25
+ link: string;
26
+ createdOn: Date;
27
+ updatedOn: Date;
28
+ };
29
+
30
+ /** @internal */
31
+ export const ImageMetadata$inboundSchema: z.ZodType<
32
+ ImageMetadata,
33
+ z.ZodTypeDef,
34
+ unknown
35
+ > = z.object({
36
+ imageID: z.string(),
37
+ altText: z.string().optional(),
38
+ link: z.string(),
39
+ createdOn: z.string().datetime({ offset: true }).transform(v => new Date(v)),
40
+ updatedOn: z.string().datetime({ offset: true }).transform(v => new Date(v)),
41
+ });
42
+
43
+ /** @internal */
44
+ export type ImageMetadata$Outbound = {
45
+ imageID: string;
46
+ altText?: string | undefined;
47
+ link: string;
48
+ createdOn: string;
49
+ updatedOn: string;
50
+ };
51
+
52
+ /** @internal */
53
+ export const ImageMetadata$outboundSchema: z.ZodType<
54
+ ImageMetadata$Outbound,
55
+ z.ZodTypeDef,
56
+ ImageMetadata
57
+ > = z.object({
58
+ imageID: z.string(),
59
+ altText: z.string().optional(),
60
+ link: z.string(),
61
+ createdOn: z.date().transform(v => v.toISOString()),
62
+ updatedOn: z.date().transform(v => v.toISOString()),
63
+ });
64
+
65
+ /**
66
+ * @internal
67
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
68
+ */
69
+ export namespace ImageMetadata$ {
70
+ /** @deprecated use `ImageMetadata$inboundSchema` instead. */
71
+ export const inboundSchema = ImageMetadata$inboundSchema;
72
+ /** @deprecated use `ImageMetadata$outboundSchema` instead. */
73
+ export const outboundSchema = ImageMetadata$outboundSchema;
74
+ /** @deprecated use `ImageMetadata$Outbound` instead. */
75
+ export type Outbound = ImageMetadata$Outbound;
76
+ }
77
+
78
+ export function imageMetadataToJSON(imageMetadata: ImageMetadata): string {
79
+ return JSON.stringify(ImageMetadata$outboundSchema.parse(imageMetadata));
80
+ }
81
+
82
+ export function imageMetadataFromJSON(
83
+ jsonString: string,
84
+ ): SafeParseResult<ImageMetadata, SDKValidationError> {
85
+ return safeParse(
86
+ jsonString,
87
+ (x) => ImageMetadata$inboundSchema.parse(JSON.parse(x)),
88
+ `Failed to parse 'ImageMetadata' from JSON`,
89
+ );
90
+ }
@@ -218,6 +218,7 @@ export * from "./governmentid.js";
218
218
  export * from "./governmentiderror.js";
219
219
  export * from "./granttype.js";
220
220
  export * from "./guestprofile.js";
221
+ export * from "./imagemetadata.js";
221
222
  export * from "./incurredfee.js";
222
223
  export * from "./individualname.js";
223
224
  export * from "./individualnameerror.js";