@mynthio/sdk 0.0.15 → 0.0.17
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 +85 -58
- package/dist/constants.d.ts +1 -0
- package/dist/constants.d.ts.map +1 -1
- package/dist/image-generation-result.d.ts +12 -14
- package/dist/image-generation-result.d.ts.map +1 -1
- package/dist/image-rate-result.d.ts +9 -5
- package/dist/image-rate-result.d.ts.map +1 -1
- package/dist/index.d.ts +33 -54
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/task-async.d.ts.map +1 -1
- package/dist/types.d.ts +98 -157
- package/dist/types.d.ts.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -48,7 +48,7 @@ console.log(task.urls);
|
|
|
48
48
|
console.log(task.result?.model);
|
|
49
49
|
```
|
|
50
50
|
|
|
51
|
-
If you omit `model` and `size`, Mynth resolves them automatically.
|
|
51
|
+
If you omit `model` and `size`, Mynth resolves them automatically. `generate()` waits for completion and returns a completed task.
|
|
52
52
|
|
|
53
53
|
## Client Options
|
|
54
54
|
|
|
@@ -64,11 +64,11 @@ const mynth = new Mynth({
|
|
|
64
64
|
- `apiKey`: optional if `MYNTH_API_KEY` is set
|
|
65
65
|
- `baseUrl`: optional override for proxies or tests
|
|
66
66
|
|
|
67
|
-
##
|
|
67
|
+
## Generate vs Generate Async
|
|
68
68
|
|
|
69
|
-
###
|
|
69
|
+
### Generate
|
|
70
70
|
|
|
71
|
-
|
|
71
|
+
`generate()` polls until the task is completed.
|
|
72
72
|
|
|
73
73
|
```ts
|
|
74
74
|
const task = await mynth.image.generate({
|
|
@@ -80,18 +80,15 @@ console.log(task.status); // "completed"
|
|
|
80
80
|
console.log(task.urls);
|
|
81
81
|
```
|
|
82
82
|
|
|
83
|
-
### Async
|
|
83
|
+
### Generate Async
|
|
84
84
|
|
|
85
|
-
Use
|
|
85
|
+
Use `generateAsync()` when you want to trigger work now and fetch the final task later.
|
|
86
86
|
|
|
87
87
|
```ts
|
|
88
|
-
const taskAsync = await mynth.image.
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
},
|
|
93
|
-
{ mode: "async" },
|
|
94
|
-
);
|
|
88
|
+
const taskAsync = await mynth.image.generateAsync({
|
|
89
|
+
prompt: "A cinematic fantasy castle on a cliff",
|
|
90
|
+
model: "google/gemini-3.1-flash-image",
|
|
91
|
+
});
|
|
95
92
|
|
|
96
93
|
console.log(taskAsync.id);
|
|
97
94
|
console.log(taskAsync.access.publicAccessToken);
|
|
@@ -105,18 +102,15 @@ console.log(completedTask.urls);
|
|
|
105
102
|
You can use it as a Bearer token against:
|
|
106
103
|
|
|
107
104
|
- `GET /tasks/:id/status`
|
|
108
|
-
- `GET /tasks/:id/
|
|
105
|
+
- `GET /tasks/:id/result`
|
|
109
106
|
|
|
110
107
|
Example:
|
|
111
108
|
|
|
112
109
|
```ts
|
|
113
|
-
const taskAsync = await mynth.image.
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
},
|
|
118
|
-
{ mode: "async" },
|
|
119
|
-
);
|
|
110
|
+
const taskAsync = await mynth.image.generateAsync({
|
|
111
|
+
prompt: "A cinematic fantasy castle on a cliff",
|
|
112
|
+
model: "google/gemini-3.1-flash-image",
|
|
113
|
+
});
|
|
120
114
|
|
|
121
115
|
const taskId = taskAsync.id;
|
|
122
116
|
const pat = taskAsync.access.publicAccessToken;
|
|
@@ -125,16 +119,20 @@ const status = await fetch(`https://api.mynth.io/tasks/${taskId}/status`, {
|
|
|
125
119
|
headers: {
|
|
126
120
|
Authorization: `Bearer ${pat}`,
|
|
127
121
|
},
|
|
128
|
-
})
|
|
122
|
+
})
|
|
123
|
+
.then((res) => res.json())
|
|
124
|
+
.then((body) => body.data);
|
|
129
125
|
|
|
130
126
|
if (status.status === "completed") {
|
|
131
|
-
const
|
|
127
|
+
const taskResult = await fetch(`https://api.mynth.io/tasks/${taskId}/result`, {
|
|
132
128
|
headers: {
|
|
133
129
|
Authorization: `Bearer ${pat}`,
|
|
134
130
|
},
|
|
135
|
-
})
|
|
131
|
+
})
|
|
132
|
+
.then((res) => res.json())
|
|
133
|
+
.then((body) => body.data);
|
|
136
134
|
|
|
137
|
-
console.log(
|
|
135
|
+
console.log(taskResult.result.images);
|
|
138
136
|
}
|
|
139
137
|
```
|
|
140
138
|
|
|
@@ -152,11 +150,9 @@ You can also pass structured options:
|
|
|
152
150
|
|
|
153
151
|
```ts
|
|
154
152
|
const task = await mynth.image.generate({
|
|
155
|
-
prompt:
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
enhance: "prefer_magic",
|
|
159
|
-
},
|
|
153
|
+
prompt: "Studio portrait of a futuristic fashion model",
|
|
154
|
+
negative_prompt: "blurry, low detail",
|
|
155
|
+
magic_prompt: true,
|
|
160
156
|
model: "google/gemini-3-pro-image-preview",
|
|
161
157
|
size: {
|
|
162
158
|
type: "aspect_ratio",
|
|
@@ -168,7 +164,7 @@ const task = await mynth.image.generate({
|
|
|
168
164
|
quality: 80,
|
|
169
165
|
},
|
|
170
166
|
webhook: {
|
|
171
|
-
|
|
167
|
+
dashboard: false,
|
|
172
168
|
custom: [{ url: "https://your-app.com/api/mynth-webhook" }],
|
|
173
169
|
},
|
|
174
170
|
access: {
|
|
@@ -176,8 +172,8 @@ const task = await mynth.image.generate({
|
|
|
176
172
|
enabled: true,
|
|
177
173
|
},
|
|
178
174
|
},
|
|
179
|
-
|
|
180
|
-
|
|
175
|
+
rating: {
|
|
176
|
+
mode: "custom",
|
|
181
177
|
levels: [
|
|
182
178
|
{ value: "safe", description: "Safe for all audiences" },
|
|
183
179
|
{ value: "sensitive", description: "Contains mature or suggestive content" },
|
|
@@ -205,25 +201,16 @@ const task = await mynth.image.generate({
|
|
|
205
201
|
|
|
206
202
|
## Prompt Options
|
|
207
203
|
|
|
208
|
-
`prompt`
|
|
209
|
-
|
|
210
|
-
- a string
|
|
211
|
-
- a structured object with `positive`, optional `negative`, and `enhance`
|
|
204
|
+
`prompt` is the positive text prompt. Use `negative_prompt` for exclusions and `magic_prompt: true` to ask Mynth to enhance the prompt before generation.
|
|
212
205
|
|
|
213
206
|
```ts
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
}
|
|
207
|
+
await mynth.image.generate({
|
|
208
|
+
prompt: "A luxury watch on a marble pedestal",
|
|
209
|
+
negative_prompt: "text, watermark",
|
|
210
|
+
magic_prompt: true,
|
|
211
|
+
});
|
|
219
212
|
```
|
|
220
213
|
|
|
221
|
-
`enhance` accepts:
|
|
222
|
-
|
|
223
|
-
- `false`
|
|
224
|
-
- `"prefer_magic"`
|
|
225
|
-
- `"prefer_native"`
|
|
226
|
-
|
|
227
214
|
## Size Options
|
|
228
215
|
|
|
229
216
|
`size` supports:
|
|
@@ -257,16 +244,16 @@ size: "landscape";
|
|
|
257
244
|
size: "auto";
|
|
258
245
|
size: { type: "aspect_ratio", aspectRatio: "16:9" };
|
|
259
246
|
size: { type: "aspect_ratio", aspectRatio: "4:5", scale: "4k" };
|
|
260
|
-
size: { type: "auto",
|
|
247
|
+
size: { type: "auto", provider: "native" };
|
|
261
248
|
```
|
|
262
249
|
|
|
263
250
|
## Input Images
|
|
264
251
|
|
|
265
|
-
Use `inputs` to send reference
|
|
252
|
+
Use `inputs` to send reference or init images:
|
|
266
253
|
|
|
267
254
|
```ts
|
|
268
255
|
inputs: [
|
|
269
|
-
"https://example.com/
|
|
256
|
+
"https://example.com/input-image.jpg",
|
|
270
257
|
{
|
|
271
258
|
type: "image",
|
|
272
259
|
role: "reference",
|
|
@@ -278,7 +265,50 @@ inputs: [
|
|
|
278
265
|
];
|
|
279
266
|
```
|
|
280
267
|
|
|
281
|
-
String URLs are a shorthand for image inputs. Structured inputs let you control the role explicitly with `"
|
|
268
|
+
String URLs are a shorthand for image inputs. Structured inputs let you control the role explicitly with `"auto"`, `"init"`, or `"reference"`.
|
|
269
|
+
|
|
270
|
+
## Rating
|
|
271
|
+
|
|
272
|
+
Enable per-image content rating during generation with `rating`.
|
|
273
|
+
|
|
274
|
+
```ts
|
|
275
|
+
const task = await mynth.image.generate({
|
|
276
|
+
prompt: "A fashion editorial image",
|
|
277
|
+
rating: true, // same result levels as { mode: "nsfw_sfw" }
|
|
278
|
+
});
|
|
279
|
+
|
|
280
|
+
console.log(task.getImages()[0]?.rating?.level); // "sfw" | "nsfw"
|
|
281
|
+
```
|
|
282
|
+
|
|
283
|
+
For custom labels, pass at least two and at most seven levels:
|
|
284
|
+
|
|
285
|
+
```ts
|
|
286
|
+
const task = await mynth.image.generate({
|
|
287
|
+
prompt: "A movie poster",
|
|
288
|
+
rating: {
|
|
289
|
+
mode: "custom",
|
|
290
|
+
levels: [
|
|
291
|
+
{ value: "general", description: "Appropriate for all audiences" },
|
|
292
|
+
{ value: "teen", description: "Mild mature themes" },
|
|
293
|
+
{ value: "adult", description: "Adult-oriented content" },
|
|
294
|
+
] as const,
|
|
295
|
+
},
|
|
296
|
+
});
|
|
297
|
+
|
|
298
|
+
console.log(task.getImages()[0]?.rating?.level); // "general" | "teen" | "adult"
|
|
299
|
+
```
|
|
300
|
+
|
|
301
|
+
You can also rate existing image URLs:
|
|
302
|
+
|
|
303
|
+
```ts
|
|
304
|
+
const result = await mynth.image.rate({
|
|
305
|
+
mode: "nsfw_sfw",
|
|
306
|
+
urls: ["https://example.com/image.webp"],
|
|
307
|
+
});
|
|
308
|
+
|
|
309
|
+
console.log(result.task.id);
|
|
310
|
+
console.log(result.getRatings());
|
|
311
|
+
```
|
|
282
312
|
|
|
283
313
|
## Working With Results
|
|
284
314
|
|
|
@@ -297,7 +327,7 @@ console.log(task.urls);
|
|
|
297
327
|
console.log(task.getImages());
|
|
298
328
|
console.log(task.getImages({ includeFailed: true }));
|
|
299
329
|
console.log(task.getMetadata());
|
|
300
|
-
console.log(task.result?.
|
|
330
|
+
console.log(task.result?.magic_prompt);
|
|
301
331
|
```
|
|
302
332
|
|
|
303
333
|
`task.urls` and `task.getImages()` return only successful images by default. `task.result?.images` may also include failed image entries.
|
|
@@ -379,7 +409,7 @@ Set `MYNTH_WEBHOOK_SECRET` in your environment, or pass `webhookSecret` explicit
|
|
|
379
409
|
|
|
380
410
|
## Error Handling
|
|
381
411
|
|
|
382
|
-
`generate()` may throw `MynthAPIError` if the initial request fails.
|
|
412
|
+
`generate()` and `generateAsync()` may throw `MynthAPIError` if the initial request fails. Polling can also throw task-specific errors:
|
|
383
413
|
|
|
384
414
|
```ts
|
|
385
415
|
import {
|
|
@@ -392,10 +422,7 @@ import {
|
|
|
392
422
|
} from "@mynthio/sdk";
|
|
393
423
|
|
|
394
424
|
try {
|
|
395
|
-
const taskAsync = await mynth.image.
|
|
396
|
-
{ prompt: "A watercolor landscape" },
|
|
397
|
-
{ mode: "async" },
|
|
398
|
-
);
|
|
425
|
+
const taskAsync = await mynth.image.generateAsync({ prompt: "A watercolor landscape" });
|
|
399
426
|
|
|
400
427
|
const task = await taskAsync.wait();
|
|
401
428
|
console.log(task.urls);
|
package/dist/constants.d.ts
CHANGED
|
@@ -8,6 +8,7 @@ export declare const GENERATE_IMAGE_PATH = "/image/generate";
|
|
|
8
8
|
export declare const RATE_IMAGE_PATH = "/image/rate";
|
|
9
9
|
export declare const TASK_PATH = "/tasks";
|
|
10
10
|
export declare const TASK_DETAILS_PATH: (id: string) => string;
|
|
11
|
+
export declare const TASK_RESULT_PATH: (id: string) => string;
|
|
11
12
|
export declare const TASK_STATUS_PATH: (id: string) => string;
|
|
12
13
|
/**
|
|
13
14
|
* Model capabilities that affect available generation options.
|
package/dist/constants.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAAA,iCAAiC;AACjC,eAAO,MAAM,OAAO,yBAAyB,CAAC;AAE9C,gDAAgD;AAChD,eAAO,MAAM,eAAe,kBAAkB,CAAC;AAE/C,2EAA2E;AAC3E,eAAO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AM,MAAM,eAAe,GACvB,QAAQ,GACR,oBAAoB,GACpB,iBAAiB,GACjB,IAAI,GACJ,uBAAuB,GACvB,kBAAkB,CAAC;AAEvB;;GAEG;AACH,MAAM,MAAM,cAAc,GAAG;IAC3B,mDAAmD;IACnD,EAAE,EAAE,MAAM,CAAC;IACX,kCAAkC;IAClC,KAAK,EAAE,MAAM,CAAC;IACd,qCAAqC;IACrC,YAAY,EAAE,SAAS,eAAe,EAAE,CAAC;CAC1C,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,gBAAgB,EAAE,SAAS,cAAc,EA+GrD,CAAC"}
|
|
@@ -1,24 +1,22 @@
|
|
|
1
1
|
import type { MynthSDKTypes } from "./types";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
content_rating?: ContentRatingT;
|
|
2
|
+
type TypedImageResultImageSuccess<RatingT> = Omit<MynthSDKTypes.ImageResultImageSuccess, "rating"> & {
|
|
3
|
+
rating?: RatingT;
|
|
5
4
|
};
|
|
6
5
|
type TypedImageResultImageFailure = MynthSDKTypes.ImageResultImageFailure;
|
|
7
|
-
type TypedImageResultImage<
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
images: TypedImageResultImage<ContentRatingT>[];
|
|
6
|
+
type TypedImageResultImage<RatingT> = TypedImageResultImageSuccess<RatingT> | TypedImageResultImageFailure;
|
|
7
|
+
type TypedImageResult<RatingT> = Omit<MynthSDKTypes.ImageResult, "images"> & {
|
|
8
|
+
images: TypedImageResultImage<RatingT>[];
|
|
11
9
|
};
|
|
12
10
|
/**
|
|
13
11
|
* Represents a completed image generation task.
|
|
14
12
|
*
|
|
15
13
|
* @template MetadataT - Type of the metadata attached to the request
|
|
16
|
-
* @template
|
|
14
|
+
* @template RatingT - Type of the rating response
|
|
17
15
|
*/
|
|
18
|
-
export declare class ImageGenerationResult<MetadataT = Record<string, unknown> | undefined,
|
|
16
|
+
export declare class ImageGenerationResult<MetadataT = Record<string, unknown> | undefined, RatingT = MynthSDKTypes.ImageResultRating | undefined> {
|
|
19
17
|
/** Raw task data from the API */
|
|
20
|
-
readonly data: MynthSDKTypes.
|
|
21
|
-
constructor(data: MynthSDKTypes.
|
|
18
|
+
readonly data: MynthSDKTypes.ImageGenerationTaskData;
|
|
19
|
+
constructor(data: MynthSDKTypes.ImageGenerationTaskData);
|
|
22
20
|
/** Unique identifier for this task */
|
|
23
21
|
get id(): string;
|
|
24
22
|
/** Current status of the task */
|
|
@@ -27,7 +25,7 @@ export declare class ImageGenerationResult<MetadataT = Record<string, unknown> |
|
|
|
27
25
|
* The generation result containing images, cost, and model info.
|
|
28
26
|
* Returns `null` if the task hasn't completed yet.
|
|
29
27
|
*/
|
|
30
|
-
get result(): TypedImageResult<
|
|
28
|
+
get result(): TypedImageResult<RatingT> | null;
|
|
31
29
|
/** Whether the task completed successfully */
|
|
32
30
|
get isCompleted(): boolean;
|
|
33
31
|
/** Whether the task failed */
|
|
@@ -47,10 +45,10 @@ export declare class ImageGenerationResult<MetadataT = Record<string, unknown> |
|
|
|
47
45
|
*/
|
|
48
46
|
getImages(options: {
|
|
49
47
|
includeFailed: true;
|
|
50
|
-
}): TypedImageResultImage<
|
|
48
|
+
}): TypedImageResultImage<RatingT>[];
|
|
51
49
|
getImages(options?: {
|
|
52
50
|
includeFailed?: false;
|
|
53
|
-
}): TypedImageResultImageSuccess<
|
|
51
|
+
}): TypedImageResultImageSuccess<RatingT>[];
|
|
54
52
|
/**
|
|
55
53
|
* Get the metadata that was attached to the generation request.
|
|
56
54
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"image-generation-result.d.ts","sourceRoot":"","sources":["../src/image-generation-result.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAE7C,
|
|
1
|
+
{"version":3,"file":"image-generation-result.d.ts","sourceRoot":"","sources":["../src/image-generation-result.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,S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EAAE;QAAE,aAAa,CAAC,EAAE,KAAK,CAAA;KAAE,GAAG,4BAA4B,CAAC,OAAO,CAAC,EAAE;IAWvF;;OAEG;IACH,WAAW,IAAI,SAAS;CAGzB"}
|
|
@@ -1,14 +1,16 @@
|
|
|
1
1
|
import type { MynthSDKTypes } from "./types";
|
|
2
2
|
/** A successfully rated image */
|
|
3
3
|
type ImageRateResultItemSuccess<LevelT extends string> = {
|
|
4
|
-
|
|
4
|
+
status: "success";
|
|
5
5
|
url: string;
|
|
6
|
-
|
|
7
|
-
rating: LevelT;
|
|
6
|
+
level: LevelT;
|
|
8
7
|
};
|
|
9
|
-
/** An image that could not be rated */
|
|
10
8
|
type ImageRateResultItemError = {
|
|
11
|
-
|
|
9
|
+
status: "failed";
|
|
10
|
+
url: string;
|
|
11
|
+
error: {
|
|
12
|
+
code: string;
|
|
13
|
+
};
|
|
12
14
|
};
|
|
13
15
|
/** Individual rating result — success or error */
|
|
14
16
|
export type ImageRateResultItem<LevelT extends string = string> = ImageRateResultItemSuccess<LevelT> | ImageRateResultItemError;
|
|
@@ -20,6 +22,8 @@ export type ImageRateResultItem<LevelT extends string = string> = ImageRateResul
|
|
|
20
22
|
export declare class ImageRateResult<LevelT extends string = "sfw" | "nsfw"> {
|
|
21
23
|
/** The task ID created for this rating request */
|
|
22
24
|
readonly taskId: string;
|
|
25
|
+
/** Task metadata returned by the API */
|
|
26
|
+
readonly task: MynthSDKTypes.ImageRateResponse<LevelT>["task"];
|
|
23
27
|
/** Raw results array from the API */
|
|
24
28
|
readonly results: ImageRateResultItem<LevelT>[];
|
|
25
29
|
constructor(data: MynthSDKTypes.ImageRateResponse<LevelT>);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"image-rate-result.d.ts","sourceRoot":"","sources":["../src/image-rate-result.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAE7C,iCAAiC;AACjC,KAAK,0BAA0B,CAAC,MAAM,SAAS,MAAM,IAAI;IACvD,
|
|
1
|
+
{"version":3,"file":"image-rate-result.d.ts","sourceRoot":"","sources":["../src/image-rate-result.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAE7C,iCAAiC;AACjC,KAAK,0BAA0B,CAAC,MAAM,SAAS,MAAM,IAAI;IACvD,MAAM,EAAE,SAAS,CAAC;IAClB,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,KAAK,wBAAwB,GAAG;IAC9B,MAAM,EAAE,QAAQ,CAAC;IACjB,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE;QACL,IAAI,EAAE,MAAM,CAAC;KACd,CAAC;CACH,CAAC;AAEF,kDAAkD;AAClD,MAAM,MAAM,mBAAmB,CAAC,MAAM,SAAS,MAAM,GAAG,MAAM,IAC1D,0BAA0B,CAAC,MAAM,CAAC,GAClC,wBAAwB,CAAC;AAE7B;;;;GAIG;AACH,qBAAa,eAAe,CAAC,MAAM,SAAS,MAAM,GAAG,KAAK,GAAG,MAAM;IACjE,kDAAkD;IAClD,SAAgB,MAAM,EAAE,MAAM,CAAC;IAE/B,wCAAwC;IACxC,SAAgB,IAAI,EAAE,aAAa,CAAC,iBAAiB,CAAC,MAAM,CAAC,CAAC,MAAM,CAAC,CAAC;IAEtE,qCAAqC;IACrC,SAAgB,OAAO,EAAE,mBAAmB,CAAC,MAAM,CAAC,EAAE,CAAC;gBAE3C,IAAI,EAAE,aAAa,CAAC,iBAAiB,CAAC,MAAM,CAAC;IAMzD;;OAEG;IACH,UAAU,IAAI,0BAA0B,CAAC,MAAM,CAAC,EAAE;IAMlD;;OAEG;IACH,SAAS,IAAI,wBAAwB,EAAE;CAGxC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -6,13 +6,6 @@ import { ImageRateResult } from "./image-rate-result";
|
|
|
6
6
|
import type { TaskAsyncAccess } from "./task-async";
|
|
7
7
|
import { TaskAsync, TaskAsyncFetchError, TaskAsyncTaskFailedError, TaskAsyncTaskFetchError, TaskAsyncTimeoutError, TaskAsyncUnauthorizedError } from "./task-async";
|
|
8
8
|
import type { MynthSDKTypes } from "./types";
|
|
9
|
-
/**
|
|
10
|
-
* Options for the generate method.
|
|
11
|
-
*/
|
|
12
|
-
type GenerateOptions = {
|
|
13
|
-
/** Whether to wait for completion ("sync") or return immediately ("async") */
|
|
14
|
-
mode?: "sync" | "async";
|
|
15
|
-
};
|
|
16
9
|
/**
|
|
17
10
|
* Configuration options for the Mynth client.
|
|
18
11
|
*/
|
|
@@ -33,32 +26,34 @@ type MynthOptions = {
|
|
|
33
26
|
destination?: string;
|
|
34
27
|
};
|
|
35
28
|
type ExtractMetadata<T extends MynthSDKTypes.ImageGenerationRequest> = T["metadata"];
|
|
36
|
-
type
|
|
37
|
-
type
|
|
29
|
+
type ExtractRatingConfig<T extends MynthSDKTypes.ImageGenerationRequest> = T["rating"];
|
|
30
|
+
type ExtractRatingLevels<T extends MynthSDKTypes.ImageGenerationRequest> = ExtractRatingConfig<T> extends {
|
|
38
31
|
levels: readonly (infer L)[];
|
|
39
|
-
} ? L :
|
|
32
|
+
} ? L : ExtractRatingConfig<T> extends {
|
|
40
33
|
levels: (infer L)[];
|
|
41
34
|
} ? L : never;
|
|
42
|
-
type
|
|
35
|
+
type ExtractRatingLevelValues<T extends MynthSDKTypes.ImageGenerationRequest> = ExtractRatingLevels<T> extends {
|
|
43
36
|
value: infer V;
|
|
44
37
|
} ? (V extends string ? V : never) : never;
|
|
45
|
-
type
|
|
38
|
+
type IsRatingCustom<T extends MynthSDKTypes.ImageGenerationRequest> = ExtractRatingConfig<T> extends {
|
|
39
|
+
mode: "custom";
|
|
46
40
|
levels: readonly any[] | any[];
|
|
47
41
|
} ? true : false;
|
|
48
|
-
type
|
|
49
|
-
|
|
50
|
-
level:
|
|
51
|
-
} :
|
|
52
|
-
|
|
42
|
+
type ExtractRatingResponse<T extends MynthSDKTypes.ImageGenerationRequest> = IsRatingCustom<T> extends true ? {
|
|
43
|
+
status: "success";
|
|
44
|
+
level: ExtractRatingLevelValues<T>;
|
|
45
|
+
} | MynthSDKTypes.ImageResultRatingFailure : ExtractRatingConfig<T> extends true | {
|
|
46
|
+
mode: "nsfw_sfw";
|
|
53
47
|
} ? {
|
|
54
|
-
|
|
55
|
-
level: MynthSDKTypes.
|
|
56
|
-
} : MynthSDKTypes.
|
|
57
|
-
type ExtractRateLevelValues<T extends MynthSDKTypes.ImageRateRequest> = T
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
}[]
|
|
48
|
+
status: "success";
|
|
49
|
+
level: MynthSDKTypes.ImageResultRatingDefaultLevel;
|
|
50
|
+
} | MynthSDKTypes.ImageResultRatingFailure : MynthSDKTypes.ImageResultRating | undefined;
|
|
51
|
+
type ExtractRateLevelValues<T extends MynthSDKTypes.ImageRateRequest> = T extends {
|
|
52
|
+
mode: "custom";
|
|
53
|
+
levels: readonly {
|
|
54
|
+
value: infer V;
|
|
55
|
+
}[];
|
|
56
|
+
} ? V extends string ? V : string : MynthSDKTypes.ImageResultRatingDefaultLevel;
|
|
62
57
|
/**
|
|
63
58
|
* Client for interacting with the Mynth image generation and rating APIs.
|
|
64
59
|
*
|
|
@@ -107,41 +102,24 @@ declare class MynthImage {
|
|
|
107
102
|
* console.log(result.urls);
|
|
108
103
|
* ```
|
|
109
104
|
*/
|
|
110
|
-
generate<const T extends MynthSDKTypes.ImageGenerationRequest>(request: T): Promise<ImageGenerationResult<ExtractMetadata<T>,
|
|
105
|
+
generate<const T extends MynthSDKTypes.ImageGenerationRequest>(request: T): Promise<ImageGenerationResult<ExtractMetadata<T>, ExtractRatingResponse<T>>>;
|
|
111
106
|
/**
|
|
112
|
-
*
|
|
107
|
+
* Start image generation without waiting for completion.
|
|
113
108
|
*
|
|
114
109
|
* @param request - Image generation request parameters
|
|
115
|
-
* @param opts - Options with mode set to "async"
|
|
116
110
|
* @returns A TaskAsync that can be polled for completion via `.wait()`
|
|
117
111
|
*
|
|
118
112
|
* @example
|
|
119
113
|
* ```typescript
|
|
120
|
-
* const taskAsync = await image.
|
|
121
|
-
*
|
|
122
|
-
*
|
|
123
|
-
* );
|
|
114
|
+
* const taskAsync = await image.generateAsync({
|
|
115
|
+
* prompt: "A futuristic cityscape",
|
|
116
|
+
* });
|
|
124
117
|
*
|
|
125
|
-
* // Return task ID for client-side polling
|
|
126
118
|
* return { id: taskAsync.id, access: taskAsync.access };
|
|
127
|
-
*
|
|
128
|
-
* // Or wait for completion later
|
|
129
|
-
* const result = await taskAsync.wait();
|
|
130
119
|
* ```
|
|
131
120
|
*/
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
}): Promise<TaskAsync<ImageGenerationResult<ExtractMetadata<T>, ExtractContentRatingResponse<T>>>>;
|
|
135
|
-
/**
|
|
136
|
-
* Generate images synchronously, waiting for completion.
|
|
137
|
-
*
|
|
138
|
-
* @param request - Image generation request parameters
|
|
139
|
-
* @param opts - Options with mode set to "sync"
|
|
140
|
-
* @returns A completed ImageGenerationResult with the generation results
|
|
141
|
-
*/
|
|
142
|
-
generate<const T extends MynthSDKTypes.ImageGenerationRequest>(request: T, opts: {
|
|
143
|
-
mode: "sync";
|
|
144
|
-
}): Promise<ImageGenerationResult<ExtractMetadata<T>, ExtractContentRatingResponse<T>>>;
|
|
121
|
+
generateAsync<const T extends MynthSDKTypes.ImageGenerationRequest>(request: T): Promise<TaskAsync<ImageGenerationResult<ExtractMetadata<T>, ExtractRatingResponse<T>>>>;
|
|
122
|
+
private createGenerationTask;
|
|
145
123
|
/**
|
|
146
124
|
* Rate the content of one or more images.
|
|
147
125
|
*
|
|
@@ -155,19 +133,20 @@ declare class MynthImage {
|
|
|
155
133
|
* @example
|
|
156
134
|
* ```typescript
|
|
157
135
|
* // Default sfw/nsfw
|
|
158
|
-
* const result = await image.rate({ urls: ["https://..."] });
|
|
159
|
-
* console.log(result.getRatings()); // [{ url: "...",
|
|
136
|
+
* const result = await image.rate({ urls: ["https://..."], mode: "nsfw_sfw" });
|
|
137
|
+
* console.log(result.getRatings()); // [{ status: "success", url: "...", level: "sfw" }]
|
|
160
138
|
*
|
|
161
139
|
* // Custom levels
|
|
162
140
|
* const result = await image.rate({
|
|
163
141
|
* urls: ["https://..."],
|
|
142
|
+
* mode: "custom",
|
|
164
143
|
* levels: [
|
|
165
144
|
* { value: "safe", description: "No explicit content" },
|
|
166
145
|
* { value: "mature", description: "Adult themes, no nudity" },
|
|
167
146
|
* { value: "explicit", description: "Contains nudity or graphic content" },
|
|
168
147
|
* ] as const,
|
|
169
148
|
* });
|
|
170
|
-
* result.getRatings(); // [{ url: "...",
|
|
149
|
+
* result.getRatings(); // [{ status: "success", url: "...", level: "safe" | "mature" | "explicit" }]
|
|
171
150
|
* ```
|
|
172
151
|
*/
|
|
173
152
|
rate<const T extends MynthSDKTypes.ImageRateRequest>(request: T): Promise<ImageRateResult<ExtractRateLevelValues<T>>>;
|
|
@@ -197,7 +176,7 @@ declare class Mynth {
|
|
|
197
176
|
*/
|
|
198
177
|
constructor(options?: MynthOptions);
|
|
199
178
|
}
|
|
200
|
-
export { AVAILABLE_MODELS, ImageGenerationResult, ImageRateResult, Mynth, MynthImage, MynthAPIError, TaskAsyncFetchError, TaskAsyncTaskFailedError, TaskAsyncTaskFetchError, TaskAsyncTimeoutError, TaskAsyncUnauthorizedError, };
|
|
201
|
-
export type { AvailableModel,
|
|
179
|
+
export { AVAILABLE_MODELS, ImageGenerationResult, ImageRateResult, Mynth, MynthImage, TaskAsync, MynthAPIError, TaskAsyncFetchError, TaskAsyncTaskFailedError, TaskAsyncTaskFetchError, TaskAsyncTimeoutError, TaskAsyncUnauthorizedError, };
|
|
180
|
+
export type { AvailableModel, ModelCapability, MynthOptions, MynthSDKTypes, TaskAsyncAccess };
|
|
202
181
|
export default Mynth;
|
|
203
182
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAe,MAAM,UAAU,CAAC;AACtD,OAAO,KAAK,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AACnE,OAAO,EAEL,gBAAgB,EAIjB,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,qBAAqB,EAAE,MAAM,2BAA2B,CAAC;AAClE,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AACtD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AACpD,OAAO,EACL,SAAS,EACT,mBAAmB,EACnB,wBAAwB,EACxB,uBAAuB,EACvB,qBAAqB,EACrB,0BAA0B,EAC3B,MAAM,cAAc,CAAC;AACtB,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAE7C;;GAEG;AACH,KAAK,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAe,MAAM,UAAU,CAAC;AACtD,OAAO,KAAK,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AACnE,OAAO,EAEL,gBAAgB,EAIjB,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,qBAAqB,EAAE,MAAM,2BAA2B,CAAC;AAClE,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AACtD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AACpD,OAAO,EACL,SAAS,EACT,mBAAmB,EACnB,wBAAwB,EACxB,uBAAuB,EACvB,qBAAqB,EACrB,0BAA0B,EAC3B,MAAM,cAAc,CAAC;AACtB,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAE7C;;GAEG;AACH,KAAK,YAAY,GAAG;IAClB;;OAEG;I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5E,oBAAoB;IA4BlC;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA4BG;IACU,IAAI,CAAC,KAAK,CAAC,CAAC,SAAS,aAAa,CAAC,gBAAgB,EAC9D,OAAO,EAAE,CAAC,GACT,OAAO,CAAC,eAAe,CAAC,sBAAsB,CAAC,CAAC,CAAC,CAAC,CAAC;CASvD;AAED;;;;;;;;;;;;GAYG;AACH,cAAM,KAAK;IACT,yCAAyC;IACzC,QAAQ,CAAC,KAAK,EAAE,UAAU,CAAC;IAE3B;;;;;;OAMG;gBACS,OAAO,GAAE,YAAiB;CAGvC;AAED,OAAO,EACL,gBAAgB,EAChB,qBAAqB,EACrB,eAAe,EACf,KAAK,EACL,UAAU,EACV,SAAS,EAET,aAAa,EACb,mBAAmB,EACnB,wBAAwB,EACxB,uBAAuB,EACvB,qBAAqB,EACrB,0BAA0B,GAC3B,CAAC;AACF,YAAY,EAAE,cAAc,EAAE,eAAe,EAAE,YAAY,EAAE,aAAa,EAAE,eAAe,EAAE,CAAC;AAC9F,eAAe,KAAK,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
var
|
|
2
|
+
var q="https://api.mynth.io",X="MYNTH_API_KEY",v="MYNTH_DESTINATION",G="/image/generate",K="/image/rate";var O=(J)=>`/tasks/${J}`;var F=(J)=>`/tasks/${J}/status`,_=[{id:"auto",label:"Auto",capabilities:[]},{id:"alibaba/qwen-image-2.0",label:"Qwen Image 2.0",capabilities:["inputs","native_enhance_prompt"]},{id:"alibaba/qwen-image-2.0-pro",label:"Qwen Image 2.0 Pro",capabilities:["inputs","native_enhance_prompt"]},{id:"bytedance/seedream-5.0-lite",label:"Seedream 5.0 Lite",capabilities:["inputs"]},{id:"black-forest-labs/flux.1-dev",label:"FLUX.1 Dev",capabilities:["mynth_magic_prompt"]},{id:"black-forest-labs/flux-1-schnell",label:"FLUX.1 Schnell",capabilities:["mynth_magic_prompt"]},{id:"tongyi-mai/z-image-turbo",label:"Z Image Turbo",capabilities:["mynth_magic_prompt"]},{id:"black-forest-labs/flux.2-dev",label:"FLUX.2 Dev",capabilities:["inputs","mynth_magic_prompt"]},{id:"black-forest-labs/flux.2-pro",label:"FLUX.2 Pro",capabilities:["inputs"]},{id:"black-forest-labs/flux.2-flex",label:"FLUX.2 Flex",capabilities:["inputs"]},{id:"black-forest-labs/flux.2-max",label:"FLUX.2 Max",capabilities:["inputs"]},{id:"black-forest-labs/flux.2-klein-4b",label:"FLUX.2 Klein 4B",capabilities:["inputs"]},{id:"john6666/bismuth-illustrious-mix",label:"Bismuth Illustrious Mix",capabilities:["mynth_magic_prompt","negative_prompt"]},{id:"purplesmartai/pony-diffusion-v6-xl",label:"Pony Diffusion V6 XL",capabilities:["negative_prompt"]},{id:"recraft/recraft-v4",label:"Recraft V4",capabilities:[]},{id:"recraft/recraft-v4-pro",label:"Recraft V4 Pro",capabilities:[]},{id:"google/gemini-3.1-flash-image",label:"Nano Banana 2",capabilities:["inputs","4k","native_enhance_prompt","native_auto_size"]},{id:"google/gemini-3-pro-image-preview",label:"Nano Banana Pro",capabilities:["4k","native_enhance_prompt"]},{id:"imagineart/imagineart-1.5-pro",label:"ImagineArt 1.5 Pro",capabilities:["4k"]},{id:"openai/gpt-image-2",label:"GPT Image 2",capabilities:["inputs"]},{id:"wan/wan2.6-image",label:"Wan 2.6 Image",capabilities:[]},{id:"xai/grok-imagine-image",label:"Grok Imagine Image",capabilities:["inputs","native_auto_size"]}];class j extends Error{status;code;constructor(J,Q,Z){super(J);this.name="MynthAPIError",this.status=Q,this.code=Z}}class w{apiKey;baseUrl;constructor(J){this.apiKey=J.apiKey,this.baseUrl=J.baseUrl?J.baseUrl.endsWith("/")?J.baseUrl.slice(0,-1):J.baseUrl:q}getAuthHeaders(J){return{Authorization:`Bearer ${J?.accessToken??this.apiKey}`}}getUrl(J){return`${this.baseUrl}${J}`}async post(J,Q){let Z=await fetch(this.getUrl(J),{method:"POST",headers:{"Content-Type":"application/json",...this.getAuthHeaders()},body:JSON.stringify(Q)}),$=await Z.json();if(!Z.ok){let x=$,B=x.error||x.message||`Request failed with status ${Z.status}`;throw new j(B,Z.status,x.code)}return $}async get(J,{headers:Q,accessToken:Z}={}){let $=await fetch(this.getUrl(J),{headers:{...this.getAuthHeaders({accessToken:Z}),...Q}});return{data:await $.json(),status:$.status,ok:$.ok}}}class H{data;constructor(J){this.data=J}get id(){return this.data.id}get status(){return this.data.status}get result(){return this.data.result}get isCompleted(){return this.data.status==="completed"}get isFailed(){return this.data.status==="failed"}get urls(){return this.data.result?.images.filter((J)=>J.status==="success").map((J)=>J.url).filter((J)=>J!==null)??[]}getImages(J={}){if(J.includeFailed)return this.data.result?.images??[];return this.data.result?.images.filter((Q)=>Q.status==="success")??[]}getMetadata(){return this.data.request?.metadata}}class Y{taskId;task;results;constructor(J){this.task=J.task,this.taskId=J.task.id,this.results=J.results}getRatings(){return this.results.filter((J)=>J.status==="success")}getErrors(){return this.results.filter((J)=>J.status==="failed")}}var z=300000,m=12000,h=2500,k=5000,E=7;class D extends Error{constructor(J){super(`Task ${J} polling timed out after ${z}ms`);this.name="TaskAsyncTimeoutError"}}class W extends Error{constructor(J){super(`Unauthorized access to task ${J}`);this.name="TaskAsyncUnauthorizedError"}}class f extends Error{constructor(J,Q){super(`Failed to fetch status for task ${J} after multiple retries`);this.name="TaskAsyncFetchError",this.cause=Q}}class V extends Error{constructor(J,Q){let Z=Q?` (status ${Q})`:"";super(`Failed to fetch task ${J}${Z}`);this.name="TaskAsyncTaskFetchError"}}class C extends Error{constructor(J){super(`Task ${J} failed during generation`);this.name="TaskAsyncTaskFailedError"}}class b{id;client;_access;resultFactory;_completionPromise=null;constructor(J,Q){this.id=J,this.client=Q.client,this._access={publicAccessToken:Q.pat},this.resultFactory=Q.resultFactory}get access(){return this._access}toString(){return this.id}async wait(){if(!this._completionPromise)this._completionPromise=this.pollUntilCompleted();return this._completionPromise}async pollUntilCompleted(){let J=Date.now(),Q=0,Z=!1,$;while(!0){let x=Date.now()-J;if(x>=z)throw new D(this.id);let B=await this.fetchStatus(Z);if(B.ok){if(Q=0,B.status==="completed"){let M=await this.fetchTask();return this.resultFactory(M)}if(B.status==="failed")throw new C(this.id)}else{if(B.unauthorized){if(this._access.publicAccessToken&&!Z){Z=!0;continue}throw new W(this.id)}if(B.retryable){if(Q++,$=B.error,Q>=E)throw new f(this.id,$)}}let N=x<m?h:k,P=Math.random()*500,R=N+P,L=z-x,g=Math.min(R,L);await this.sleep(g)}}async fetchStatus(J){let Q=J||!this._access.publicAccessToken?void 0:this._access.publicAccessToken;try{let Z=await this.client.get(F(this.id),{accessToken:Q});if(Z.ok)return{ok:!0,status:Z.data.data.status};if(Z.status===401||Z.status===403)return{ok:!1,unauthorized:!0,retryable:!1};if(Z.status===404)return{ok:!1,unauthorized:!0,retryable:!1};if(Z.status>=500)return{ok:!1,unauthorized:!1,retryable:!0};return{ok:!1,unauthorized:!1,retryable:!1}}catch(Z){return{ok:!1,unauthorized:!1,retryable:!0,error:Z instanceof Error?Z:Error(String(Z))}}}async fetchTask(){let J=await this.client.get(O(this.id));if(J.ok)return J.data.data;if(J.status===401||J.status===403)throw new W(this.id);if(J.status===404)throw new W(this.id);throw new V(this.id,J.status)}sleep(J){return new Promise((Q)=>setTimeout(Q,J))}}function I(){if(typeof process<"u"&&process.env)return process.env[X];return}function y(){if(typeof process<"u"&&process.env)return process.env[v];return}class S{client;defaultDestination;constructor(J={}){let Q=J.apiKey??I();if(!Q)throw Error(`Mynth API key is required. Either pass it as an option or set the ${X} environment variable.`);this.defaultDestination=J.destination??y(),this.client=new w({apiKey:Q,baseUrl:J.baseUrl})}async generate(J){return(await this.createGenerationTask(J)).wait()}async generateAsync(J){return this.createGenerationTask(J)}async createGenerationTask(J){let Z=(await this.client.post(G,{...J,destination:J.destination??this.defaultDestination})).data;return new b(Z.taskId,{client:this.client,pat:Z.access?.publicAccessToken,resultFactory:(x)=>new H(x)})}async rate(J){let Q=await this.client.post(K,J);return new Y(Q.data)}}class U{image;constructor(J={}){this.image=new S(J)}}var e=U;export{e as default,W as TaskAsyncUnauthorizedError,D as TaskAsyncTimeoutError,V as TaskAsyncTaskFetchError,C as TaskAsyncTaskFailedError,f as TaskAsyncFetchError,b as TaskAsync,S as MynthImage,j as MynthAPIError,U as Mynth,Y as ImageRateResult,H as ImageGenerationResult,_ as AVAILABLE_MODELS};
|
package/dist/task-async.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"task-async.d.ts","sourceRoot":"","sources":["../src/task-async.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAE5C,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAQ7C;;GAEG;AACH,qBAAa,qBAAsB,SAAQ,KAAK;gBAClC,MAAM,EAAE,MAAM;CAI3B;AAED;;GAEG;AACH,qBAAa,0BAA2B,SAAQ,KAAK;gBACvC,MAAM,EAAE,MAAM;CAI3B;AAED;;GAEG;AACH,qBAAa,mBAAoB,SAAQ,KAAK;gBAChC,MAAM,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,KAAK;CAK1C;AAED;;GAEG;AACH,qBAAa,uBAAwB,SAAQ,KAAK;gBACpC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM;CAK5C;AAED;;GAEG;AACH,qBAAa,wBAAyB,SAAQ,KAAK;gBACrC,MAAM,EAAE,MAAM;CAI3B;AAMD;;GAEG;AACH,MAAM,MAAM,eAAe,GAAG;IAC5B,yDAAyD;IACzD,iBAAiB,CAAC,EAAE,MAAM,CAAC;CAC5B,CAAC;AAEF;;;;;GAKG;AACH,qBAAa,SAAS,CAAC,OAAO;IAC5B,0CAA0C;IAC1C,SAAgB,EAAE,EAAE,MAAM,CAAC;IAE3B,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAc;IAErC,OAAO,CAAC,QAAQ,CAAC,O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,CAAC,OAAO;IAC5B,0CAA0C;IAC1C,SAAgB,EAAE,EAAE,MAAM,CAAC;IAE3B,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAc;IAErC,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAkB;IAE1C,OAAO,CAAC,QAAQ,CAAC,aAAa,CAA4C;IAE1E,OAAO,CAAC,kBAAkB,CAAiC;gBAGzD,EAAE,EAAE,MAAM,EACV,OAAO,EAAE;QACP,MAAM,EAAE,WAAW,CAAC;QACpB,GAAG,CAAC,EAAE,MAAM,CAAC;QACb,aAAa,EAAE,CAAC,IAAI,EAAE,aAAa,CAAC,QAAQ,KAAK,OAAO,CAAC;KAC1D;IAQH;;;OAGG;IACH,IAAI,MAAM,IAAI,eAAe,CAE5B;IAED,QAAQ,IAAI,MAAM;IAIlB;;;;;;;;OAQG;IACU,IAAI,IAAI,OAAO,CAAC,OAAO,CAAC;YASvB,kBAAkB;YA6DlB,WAAW;YA6CX,SAAS;IAoBvB,OAAO,CAAC,KAAK;CAGd"}
|
package/dist/types.d.ts
CHANGED
|
@@ -3,108 +3,74 @@
|
|
|
3
3
|
* Import as `import type { MynthSDKTypes } from "@mynthio/sdk"`.
|
|
4
4
|
*/
|
|
5
5
|
export declare namespace MynthSDKTypes {
|
|
6
|
-
|
|
6
|
+
type ApiResponse<DataT> = {
|
|
7
|
+
data: DataT;
|
|
8
|
+
};
|
|
7
9
|
type TaskStatus = "pending" | "completed" | "failed";
|
|
8
|
-
/** Type of task */
|
|
9
10
|
type TaskType = "image.generate" | "image.rate";
|
|
10
|
-
|
|
11
|
-
type TaskData = {
|
|
12
|
-
/** Unique task identifier */
|
|
11
|
+
type TaskBase = {
|
|
13
12
|
id: string;
|
|
14
|
-
/** Current status of the task */
|
|
15
13
|
status: TaskStatus;
|
|
16
|
-
/** Type of task */
|
|
17
|
-
type: TaskType;
|
|
18
|
-
/** ID of the API key used (null for public access) */
|
|
19
14
|
apiKeyId: string | null;
|
|
20
|
-
/** ID of the user who created the task */
|
|
21
15
|
userId: string;
|
|
22
|
-
/** Total cost in string format (null if not yet calculated) */
|
|
23
16
|
cost: string | null;
|
|
24
|
-
/** Generation result (null if not completed) */
|
|
25
|
-
result: ImageResult | null;
|
|
26
|
-
/** Original generation request (null if not available) */
|
|
27
|
-
request: ImageGenerationRequest;
|
|
28
|
-
/** ISO 8601 timestamp of creation */
|
|
29
17
|
createdAt: string;
|
|
30
|
-
/** ISO 8601 timestamp of last update */
|
|
31
18
|
updatedAt: string;
|
|
19
|
+
errors?: TaskError[];
|
|
32
20
|
};
|
|
33
|
-
|
|
21
|
+
type TaskError = {
|
|
22
|
+
code: string;
|
|
23
|
+
};
|
|
24
|
+
type TaskData = (TaskBase & {
|
|
25
|
+
type: "image.generate";
|
|
26
|
+
request: ImageGenerationRequest;
|
|
27
|
+
result: ImageResult | null;
|
|
28
|
+
}) | (TaskBase & {
|
|
29
|
+
type: "image.rate";
|
|
30
|
+
request: ImageRateRequest;
|
|
31
|
+
result: ImageRateTaskResult | null;
|
|
32
|
+
});
|
|
33
|
+
type ImageGenerationTaskData = Extract<TaskData, {
|
|
34
|
+
type: "image.generate";
|
|
35
|
+
}>;
|
|
34
36
|
type ImageGenerationModelId = "alibaba/qwen-image-2.0" | "alibaba/qwen-image-2.0-pro" | "bytedance/seedream-5.0-lite" | "black-forest-labs/flux.1-dev" | "black-forest-labs/flux-1-schnell" | "black-forest-labs/flux.2-dev" | "black-forest-labs/flux.2-pro" | "black-forest-labs/flux.2-flex" | "black-forest-labs/flux.2-max" | "black-forest-labs/flux.2-klein-4b" | "google/gemini-3.1-flash-image" | "google/gemini-3-pro-image-preview" | "imagineart/imagineart-1.5-pro" | "openai/gpt-image-2" | "tongyi-mai/z-image-turbo" | "john6666/bismuth-illustrious-mix" | "purplesmartai/pony-diffusion-v6-xl" | "recraft/recraft-v4" | "recraft/recraft-v4-pro" | "wan/wan2.6-image" | "xai/grok-imagine-image";
|
|
35
|
-
/** Model to use for generation ("auto" lets the system choose) */
|
|
36
37
|
type ImageGenerationModel = ImageGenerationModelId | "auto";
|
|
37
|
-
/** Prompt enhancement mode for structured prompts */
|
|
38
|
-
type ImageGenerationRequestEnhance = false | "prefer_magic" | "prefer_native";
|
|
39
|
-
/** Structured prompt with positive and optional negative text */
|
|
40
|
-
type PromptStructured = {
|
|
41
|
-
/** Main prompt describing what to generate */
|
|
42
|
-
positive: string;
|
|
43
|
-
/** Elements to exclude from the generation */
|
|
44
|
-
negative?: string;
|
|
45
|
-
/** Prompt enhancement mode */
|
|
46
|
-
enhance: ImageGenerationRequestEnhance;
|
|
47
|
-
};
|
|
48
38
|
type GenerateImageOptionsIn = {
|
|
49
|
-
prompt: string
|
|
39
|
+
prompt: string;
|
|
50
40
|
};
|
|
51
41
|
type GenerateImageOptions = {
|
|
52
|
-
prompt:
|
|
42
|
+
prompt: string;
|
|
53
43
|
};
|
|
54
|
-
/**
|
|
55
|
-
* Prompt input for image generation.
|
|
56
|
-
* Can be a simple string or structured with positive/negative prompts.
|
|
57
|
-
*/
|
|
58
44
|
type ImageGenerationRequestPrompt = GenerateImageOptionsIn["prompt"];
|
|
59
|
-
/** Output image format */
|
|
60
45
|
type ImageGenerationRequestOutputFormat = "png" | "jpg" | "webp";
|
|
61
|
-
/** Output configuration for generated images */
|
|
62
46
|
type ImageGenerationRequestOutput = {
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
/** Quality 0-100 (default: 80) */
|
|
66
|
-
quality?: number;
|
|
47
|
+
format: ImageGenerationRequestOutputFormat;
|
|
48
|
+
quality: number;
|
|
67
49
|
};
|
|
68
|
-
/** Custom webhook endpoint configuration */
|
|
69
50
|
type ImageGenerationRequestCustomWebhook = {
|
|
70
|
-
/** URL to receive webhook notifications */
|
|
71
51
|
url: string;
|
|
72
|
-
};
|
|
73
|
-
/** Public Access Token configuration */
|
|
52
|
+
}[];
|
|
74
53
|
type ImageGenerationRequestAccessPat = {
|
|
75
|
-
/** Include a short-lived Public Access Token in the create-task response */
|
|
76
54
|
enabled?: boolean;
|
|
77
55
|
};
|
|
78
|
-
/** Access-token configuration returned from the create-task response */
|
|
79
56
|
type ImageGenerationRequestAccess = {
|
|
80
|
-
/** Controls whether the response includes a task-scoped Public Access Token */
|
|
81
57
|
pat: ImageGenerationRequestAccessPat;
|
|
82
58
|
};
|
|
83
|
-
/** Webhook configuration */
|
|
84
59
|
type ImageGenerationRequestWebhook = {
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
/** Additional custom webhook endpoints */
|
|
88
|
-
custom?: ImageGenerationRequestCustomWebhook[];
|
|
60
|
+
dashboard?: false;
|
|
61
|
+
custom?: ImageGenerationRequestCustomWebhook;
|
|
89
62
|
};
|
|
90
|
-
|
|
91
|
-
type ImageGenerationRequestContentRatingLevel<T extends string = string> = {
|
|
92
|
-
/** Level identifier returned in the result */
|
|
63
|
+
type ImageGenerationRequestRatingLevel<T extends string = string> = {
|
|
93
64
|
value: T;
|
|
94
|
-
/** Human-readable description for the AI classifier */
|
|
95
65
|
description: string;
|
|
96
66
|
};
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
enabled?: boolean;
|
|
101
|
-
/** Custom rating levels (uses default sfw/nsfw if not provided) */
|
|
102
|
-
levels?: readonly ImageGenerationRequestContentRatingLevel[];
|
|
67
|
+
type ImageGenerationRequestRating = true | ImageRateRequestRatingDefault | {
|
|
68
|
+
mode: "custom";
|
|
69
|
+
levels: readonly ImageGenerationRequestRatingLevel[];
|
|
103
70
|
};
|
|
104
71
|
/** Available shorthand size presets */
|
|
105
|
-
type ImageGenerationRequestSizePreset = "square" | "portrait" | "landscape" | "portrait_tall" | "landscape_wide" | "1:1" | "2:3" | "3:2" | "3:4" | "4:3" | "4:5" | "5:4" | "9:16" | "16:9" | "21:9" | "2:1" | "1:2" | "1:1_4k" | "2:3_4k" | "3:2_4k" | "3:4_4k" | "4:3_4k" | "4:5_4k" | "5:4_4k" | "9:16_4k" | "16:9_4k" | "21:9_4k" | "2:1_4k" | "1:2_4k";
|
|
106
|
-
|
|
107
|
-
type ImageGenerationRequestSizeScale = "4k";
|
|
72
|
+
type ImageGenerationRequestSizePreset = "square" | "portrait" | "landscape" | "portrait_tall" | "landscape_wide" | "square_4k" | "portrait_4k" | "landscape_4k" | "portrait_tall_4k" | "landscape_wide_4k" | "1:1" | "2:3" | "3:2" | "3:4" | "4:3" | "4:5" | "5:4" | "9:16" | "16:9" | "21:9" | "2:1" | "1:2" | "1:1_4k" | "2:3_4k" | "3:2_4k" | "3:4_4k" | "4:3_4k" | "4:5_4k" | "5:4_4k" | "9:16_4k" | "16:9_4k" | "21:9_4k" | "2:1_4k" | "1:2_4k";
|
|
73
|
+
type ImageGenerationRequestSizeScale = "base" | "4k";
|
|
108
74
|
/** Supported aspect ratio strings */
|
|
109
75
|
type ImageGenerationRequestAspectRatio = "1:1" | "2:3" | "3:2" | "3:4" | "4:3" | "4:5" | "5:4" | "9:16" | "16:9" | "21:9" | "2:1" | "1:2";
|
|
110
76
|
/** Structured aspect ratio size configuration */
|
|
@@ -116,15 +82,14 @@ export declare namespace MynthSDKTypes {
|
|
|
116
82
|
/** Structured auto size configuration */
|
|
117
83
|
type ImageGenerationRequestSizeAuto = {
|
|
118
84
|
type: "auto";
|
|
119
|
-
|
|
85
|
+
provider?: "mynth" | "native";
|
|
120
86
|
};
|
|
121
87
|
/** Image input source */
|
|
122
88
|
type ImageGenerationRequestInputSource = {
|
|
123
89
|
type: "url";
|
|
124
90
|
url: string;
|
|
125
91
|
};
|
|
126
|
-
|
|
127
|
-
type ImageGenerationRequestInputRole = "context" | "init" | "reference";
|
|
92
|
+
type ImageGenerationRequestInputRole = "auto" | "init" | "reference";
|
|
128
93
|
/** Structured image input */
|
|
129
94
|
type ImageGenerationRequestInput = {
|
|
130
95
|
type: "image";
|
|
@@ -140,112 +105,72 @@ export declare namespace MynthSDKTypes {
|
|
|
140
105
|
* Image generation request parameters.
|
|
141
106
|
*/
|
|
142
107
|
type ImageGenerationRequest = {
|
|
143
|
-
/** Text prompt or structured prompt object */
|
|
144
108
|
prompt: ImageGenerationRequestPrompt;
|
|
145
|
-
|
|
109
|
+
negative_prompt?: string;
|
|
110
|
+
magic_prompt?: true;
|
|
146
111
|
model?: ImageGenerationModel;
|
|
147
|
-
/** Image size/dimensions (default: "auto") */
|
|
148
112
|
size?: ImageGenerationRequestSize;
|
|
149
|
-
/** Number of images to generate (default: 1) */
|
|
150
113
|
count?: number;
|
|
151
|
-
/** Output format and quality settings */
|
|
152
114
|
output?: ImageGenerationRequestOutput;
|
|
153
|
-
/** Webhook notification settings */
|
|
154
115
|
webhook?: ImageGenerationRequestWebhook;
|
|
155
|
-
|
|
156
|
-
content_rating?: ImageGenerationRequestContentRating;
|
|
157
|
-
/** Public Access Token response configuration */
|
|
116
|
+
rating?: ImageGenerationRequestRating;
|
|
158
117
|
access?: ImageGenerationRequestAccess;
|
|
159
|
-
/** Optional input images as URL shortcuts or structured objects */
|
|
160
118
|
inputs?: (string | ImageGenerationRequestInput)[];
|
|
161
|
-
/** Custom metadata to attach (returned in results and webhooks). Max 2KB. */
|
|
162
119
|
metadata?: Record<string, unknown>;
|
|
163
|
-
/** Name (slug) of a user-configured destination to deliver the result to */
|
|
164
120
|
destination?: string;
|
|
165
121
|
};
|
|
166
|
-
|
|
167
|
-
type
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
122
|
+
type ImageResultRatingDefaultLevel = "sfw" | "nsfw";
|
|
123
|
+
type ImageResultRatingFailure = {
|
|
124
|
+
status: "failed";
|
|
125
|
+
error: {
|
|
126
|
+
code: string;
|
|
127
|
+
};
|
|
128
|
+
};
|
|
129
|
+
type ImageResultRating = {
|
|
130
|
+
status: "success";
|
|
131
|
+
level: ImageResultRatingDefaultLevel;
|
|
172
132
|
} | {
|
|
173
|
-
|
|
133
|
+
status: "success";
|
|
174
134
|
level: string;
|
|
135
|
+
} | ImageResultRatingFailure;
|
|
136
|
+
type ImageResultDestination = {
|
|
137
|
+
status: "success";
|
|
138
|
+
name: string;
|
|
139
|
+
} | {
|
|
140
|
+
status: "failed";
|
|
141
|
+
name: string;
|
|
142
|
+
error: {
|
|
143
|
+
code: string;
|
|
144
|
+
message?: string;
|
|
145
|
+
provider_response?: string;
|
|
146
|
+
};
|
|
175
147
|
};
|
|
176
|
-
/** Successfully generated image */
|
|
177
148
|
type ImageResultImageSuccess = {
|
|
178
|
-
status: "
|
|
179
|
-
/** Image ID */
|
|
149
|
+
status: "success";
|
|
180
150
|
id: string;
|
|
181
|
-
/**
|
|
182
|
-
* Delivery URL of the generated image.
|
|
183
|
-
* `null` when the image was delivered only to a user destination and no public URL is exposed.
|
|
184
|
-
*/
|
|
185
151
|
url: string | null;
|
|
186
|
-
/** Mynth CDN URL of the generated image (always present on success) */
|
|
187
152
|
mynth_url: string;
|
|
188
|
-
|
|
189
|
-
size?: string;
|
|
190
|
-
/** Cost for this image in string format */
|
|
153
|
+
size: string;
|
|
191
154
|
cost: string;
|
|
192
|
-
|
|
193
|
-
|
|
155
|
+
destination?: ImageResultDestination;
|
|
156
|
+
rating?: ImageResultRating;
|
|
194
157
|
};
|
|
195
|
-
/** Failed image generation */
|
|
196
158
|
type ImageResultImageFailure = {
|
|
197
159
|
status: "failed";
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
160
|
+
error: {
|
|
161
|
+
code: string;
|
|
162
|
+
message?: string;
|
|
163
|
+
};
|
|
202
164
|
};
|
|
203
|
-
/** Individual image result (success or failure) */
|
|
204
165
|
type ImageResultImage = ImageResultImageSuccess | ImageResultImageFailure;
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
/** Cost of image generation */
|
|
208
|
-
images: string;
|
|
209
|
-
/** Total task cost */
|
|
210
|
-
total: string;
|
|
211
|
-
/** Reserved for future prompt-enhancement pricing metadata */
|
|
212
|
-
magic_prompt?: string;
|
|
213
|
-
};
|
|
214
|
-
/** Auto size resolution info (when size was determined automatically) */
|
|
215
|
-
type ImageResultSizeAuto = {
|
|
216
|
-
/** Source that determined the size */
|
|
217
|
-
source: "native" | "mynth";
|
|
218
|
-
/** Resolved size value (e.g. "1024x1024") */
|
|
219
|
-
value?: string;
|
|
220
|
-
};
|
|
221
|
-
/** Prompt enhancement info (when prompt was enhanced) */
|
|
222
|
-
type ImageResultPromptEnhance = {
|
|
223
|
-
/** Source that performed the enhancement */
|
|
224
|
-
source: "native" | "mynth";
|
|
225
|
-
/** Enhanced positive prompt */
|
|
226
|
-
positive?: string;
|
|
227
|
-
/** Enhanced negative prompt */
|
|
166
|
+
type ImageResultMagicPrompt = {
|
|
167
|
+
positive: string;
|
|
228
168
|
negative?: string;
|
|
229
169
|
};
|
|
230
|
-
/** Destination delivery info (present when a destination was used) */
|
|
231
|
-
type ImageResultDestination = {
|
|
232
|
-
/** Destination name (slug) that images were delivered to */
|
|
233
|
-
name: string;
|
|
234
|
-
};
|
|
235
|
-
/** Complete generation result */
|
|
236
170
|
type ImageResult = {
|
|
237
|
-
/** Array of generated images (may include failures) */
|
|
238
|
-
images: ImageResultImage[];
|
|
239
|
-
/** Destination info, present when generation was delivered to a user destination */
|
|
240
|
-
destination?: ImageResultDestination;
|
|
241
|
-
/** Cost breakdown */
|
|
242
|
-
cost: ImageResultCost;
|
|
243
|
-
/** Model that was used */
|
|
244
171
|
model: ImageGenerationModelId;
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
/** Prompt enhancement info (present when prompt was enhanced) */
|
|
248
|
-
prompt_enhance?: ImageResultPromptEnhance;
|
|
172
|
+
images: ImageResultImage[];
|
|
173
|
+
magic_prompt?: ImageResultMagicPrompt;
|
|
249
174
|
};
|
|
250
175
|
/**
|
|
251
176
|
* Webhook payload for task completion
|
|
@@ -280,28 +205,44 @@ export declare namespace MynthSDKTypes {
|
|
|
280
205
|
description: string;
|
|
281
206
|
};
|
|
282
207
|
/** Request body for the image rate endpoint */
|
|
283
|
-
type
|
|
208
|
+
type ImageRateRequestBase = {
|
|
284
209
|
/** Image URLs to rate (1–10) */
|
|
285
210
|
urls: string[];
|
|
286
|
-
/** Custom rating levels (uses default sfw/nsfw if not provided) */
|
|
287
|
-
levels?: readonly ImageRateRequestLevel[];
|
|
288
211
|
};
|
|
212
|
+
type ImageRateRequestRatingDefault = {
|
|
213
|
+
/** Default sfw/nsfw classifier */
|
|
214
|
+
mode: "nsfw_sfw";
|
|
215
|
+
};
|
|
216
|
+
type ImageRateRequestRatingCustom = {
|
|
217
|
+
/** Custom classifier levels */
|
|
218
|
+
mode: "custom";
|
|
219
|
+
levels: readonly ImageRateRequestLevel[];
|
|
220
|
+
};
|
|
221
|
+
type ImageRateRequest = ImageRateRequestBase & (ImageRateRequestRatingDefault | ImageRateRequestRatingCustom);
|
|
289
222
|
/** A successfully rated image */
|
|
290
223
|
type ImageRateResponseItemSuccess<LevelT extends string = string> = {
|
|
291
|
-
|
|
224
|
+
status: "success";
|
|
292
225
|
url: string;
|
|
293
|
-
|
|
294
|
-
rating: LevelT;
|
|
226
|
+
level: LevelT;
|
|
295
227
|
};
|
|
296
|
-
/** An image that could not be rated */
|
|
297
228
|
type ImageRateResponseItemError = {
|
|
298
|
-
|
|
229
|
+
status: "failed";
|
|
230
|
+
url: string;
|
|
231
|
+
error: {
|
|
232
|
+
code: string;
|
|
233
|
+
};
|
|
299
234
|
};
|
|
300
235
|
/** Individual rating result item */
|
|
301
236
|
type ImageRateResponseItem<LevelT extends string = string> = ImageRateResponseItemSuccess<LevelT> | ImageRateResponseItemError;
|
|
302
237
|
/** API response from the image rate endpoint */
|
|
303
238
|
type ImageRateResponse<LevelT extends string = string> = {
|
|
304
|
-
|
|
239
|
+
task: {
|
|
240
|
+
id: string;
|
|
241
|
+
cost: string;
|
|
242
|
+
};
|
|
243
|
+
results: ImageRateResponseItem<LevelT>[];
|
|
244
|
+
};
|
|
245
|
+
type ImageRateTaskResult<LevelT extends string = string> = {
|
|
305
246
|
results: ImageRateResponseItem<LevelT>[];
|
|
306
247
|
};
|
|
307
248
|
}
|
package/dist/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,yBAAiB,aAAa,CAAC;IAC7B,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,yBAAiB,aAAa,CAAC;IAC7B,KAAY,WAAW,CAAC,KAAK,IAAI;QAC/B,IAAI,EAAE,KAAK,CAAC;KACb,CAAC;IAEF,KAAY,UAAU,GAAG,SAAS,GAAG,WAAW,GAAG,QAAQ,CAAC;IAE5D,KAAY,QAAQ,GAAG,gBAAgB,GAAG,YAAY,CAAC;IAEvD,KAAY,QAAQ,GAAG;QACrB,EAAE,EAAE,MAAM,CAAC;QACX,MAAM,EAAE,UAAU,CAAC;QACnB,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;QACxB,MAAM,EAAE,MAAM,CAAC;QACf,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;QACpB,SAAS,EAAE,MAAM,CAAC;QAClB,SAAS,EAAE,MAAM,CAAC;QAClB,MAAM,CAAC,EAAE,SAAS,EAAE,CAAC;KACtB,CAAC;IAEF,KAAY,SAAS,GAAG;QACtB,IAAI,EAAE,MAAM,CAAC;KACd,CAAC;IAEF,KAAY,QAAQ,GAChB,CAAC,QAAQ,GAAG;QACV,IAAI,EAAE,gBAAgB,CAAC;QACvB,OAAO,EAAE,sBAAsB,CAAC;QAChC,MAAM,EAAE,WAAW,GAAG,IAAI,CAAC;KAC5B,CAAC,GACF,CAAC,QAAQ,GAAG;QACV,IAAI,EAAE,YAAY,CAAC;QACnB,OAAO,EAAE,gBAAgB,CAAC;QAC1B,MAAM,EAAE,mBAAmB,GAAG,IAAI,CAAC;KACpC,CAAC,CAAC;IAEP,KAAY,uBAAuB,GAAG,OAAO,CAAC,QAAQ,EAAE;QAAE,IAAI,EAAE,gBAA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