@anuragpal02/zcl-contracts 0.32.0 → 0.34.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/dist/client.d.ts +24 -0
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +118 -0
- package/dist/frame-iterator.d.ts +421 -0
- package/dist/frame-iterator.d.ts.map +1 -0
- package/dist/frame-iterator.js +223 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -0
- package/dist/looks.d.ts +108 -0
- package/dist/looks.d.ts.map +1 -0
- package/dist/looks.js +55 -0
- package/package.json +1 -1
package/dist/client.d.ts
CHANGED
|
@@ -9,6 +9,8 @@ import { guidelineSetListResponseSchema, guidelineSetResponseSchema, type Attach
|
|
|
9
9
|
import { type CreateGenerationJobRequest, type CreatePanelSetRequest, type CreatePanelSetResponse, type CreateSmartVideoRequest, type CreateSmartVideoResponse, type CreateVideoLoopRequest, type CreateVideoUpscaleRequest, type EditGenerationJobRequest, type GenerationJobResponse, type GenerationJobStatus, type GenerationJobType, type ListGenerationJobsResponse } from './generation.js';
|
|
10
10
|
import { type DescribeImageRequest, type DescribeImageResponse } from './assistant.js';
|
|
11
11
|
import { type CreateLoopToolJobRequest, type CreateLoopToolSourceUploadRequest, type CreateLoopToolSourceUploadResponse, type FinalizeLoopToolSourceUploadRequest, type FinalizeLoopToolSourceUploadResponse, type LoopToolJobResponse } from './loop-tools.js';
|
|
12
|
+
import { type CreateFrameBatchRequest, type DeleteFrameResponse, type FrameBatch, type FrameReferenceUpload, type FrameVariant, type ListFramesQuery, type ListFramesResponse } from './frame-iterator.js';
|
|
13
|
+
import { type AdminCreateLookRequest, type AdminLookListResponse, type AdminLookResponse, type AdminLookTestRequest, type AdminLookTestResponse, type AdminLookThumbnailUploadRequest, type AdminUpdateLookRequest, type GetLookResponse, type ListLooksResponse } from './looks.js';
|
|
12
14
|
import { type AdminAdjustCreditsRequest, type AdminAdjustCreditsResponse, type AdminJobDetailResponse, type AdminJobStatus, type AdminMeResponse, type AdminUsageResponse, type AdminUserDetailResponse, type AdminWorkspaceDetailResponse, type ListAdminAuditResponse, type ListAdminJobsResponse, type ListAdminUsersResponse, type ListAdminWorkspacesResponse, type SetPlatformAdminRequest, type SetPlatformAdminResponse, type SetUserDisabledRequest, type SetUserDisabledResponse, type StepUpStartResponse, type StepUpVerifyResponse } from './admin.js';
|
|
13
15
|
type FetchLike = (request: Request) => Promise<Response>;
|
|
14
16
|
export type ZclApiClientOptions = {
|
|
@@ -41,6 +43,10 @@ export declare function createZclApiClient(options: ZclApiClientOptions): {
|
|
|
41
43
|
session: {
|
|
42
44
|
get(): Promise<SessionResponse>;
|
|
43
45
|
};
|
|
46
|
+
looks: {
|
|
47
|
+
list(): Promise<ListLooksResponse>;
|
|
48
|
+
get(lookId: string): Promise<GetLookResponse>;
|
|
49
|
+
};
|
|
44
50
|
workspaces: {
|
|
45
51
|
list(): Promise<WorkspaceListResponse>;
|
|
46
52
|
create(input: CreateWorkspaceRequest): Promise<{
|
|
@@ -139,6 +145,14 @@ export declare function createZclApiClient(options: ZclApiClientOptions): {
|
|
|
139
145
|
getJob(workspaceId: string, jobId: string): Promise<LoopToolJobResponse>;
|
|
140
146
|
contentUrl(workspaceId: string, assetId: string): string;
|
|
141
147
|
};
|
|
148
|
+
frameIterator: {
|
|
149
|
+
uploadReference(workspaceId: string, file: Blob, filename: string): Promise<FrameReferenceUpload>;
|
|
150
|
+
createBatch(workspaceId: string, input: CreateFrameBatchRequest, idempotencyKey: string): Promise<FrameBatch>;
|
|
151
|
+
getBatch(workspaceId: string, batchId: string): Promise<FrameBatch>;
|
|
152
|
+
listFrames(workspaceId: string, options?: ListFramesQuery): Promise<ListFramesResponse>;
|
|
153
|
+
download(workspaceId: string, iterationId: string, variant: FrameVariant): Promise<Response>;
|
|
154
|
+
delete(workspaceId: string, iterationId: string): Promise<DeleteFrameResponse>;
|
|
155
|
+
};
|
|
142
156
|
credits: {
|
|
143
157
|
get(workspaceId: string): Promise<CreditBalanceResponse>;
|
|
144
158
|
};
|
|
@@ -197,6 +211,16 @@ export declare function createZclApiClient(options: ZclApiClientOptions): {
|
|
|
197
211
|
getUsage(options?: {
|
|
198
212
|
periodDays?: number;
|
|
199
213
|
}): Promise<AdminUsageResponse>;
|
|
214
|
+
looks: {
|
|
215
|
+
list(): Promise<AdminLookListResponse>;
|
|
216
|
+
create(input: AdminCreateLookRequest): Promise<AdminLookResponse>;
|
|
217
|
+
update(lookId: string, input: AdminUpdateLookRequest): Promise<AdminLookResponse>;
|
|
218
|
+
remove(lookId: string): Promise<{
|
|
219
|
+
data: Record<string, never>;
|
|
220
|
+
}>;
|
|
221
|
+
uploadThumbnail(lookId: string, input: AdminLookThumbnailUploadRequest): Promise<AdminLookResponse>;
|
|
222
|
+
test(input: AdminLookTestRequest): Promise<AdminLookTestResponse>;
|
|
223
|
+
};
|
|
200
224
|
stepUp: {
|
|
201
225
|
start(): Promise<StepUpStartResponse>;
|
|
202
226
|
verify(code: string): Promise<StepUpVerifyResponse>;
|
package/dist/client.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AACvB,OAAO,EASL,KAAK,mBAAmB,EACxB,KAAK,2BAA2B,EAChC,KAAK,YAAY,EACjB,KAAK,cAAc,EACnB,KAAK,qBAAqB,EAC1B,KAAK,2BAA2B,EAChC,KAAK,eAAe,EACpB,KAAK,aAAa,EACnB,MAAM,WAAW,CAAA;AAClB,OAAO,EAA2C,KAAK,YAAY,EAAE,MAAM,aAAa,CAAA;AACxF,OAAO,EAA+B,KAAK,qBAAqB,EAAE,MAAM,cAAc,CAAA;AACtF,OAAO,EAOL,qBAAqB,EAIrB,KAAK,sBAAsB,EAC3B,KAAK,mBAAmB,EACxB,KAAK,oBAAoB,E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CAAC,sBAAsB,CAAC;2BAqBvB;YACP,WAAW,CAAC,EAAE,MAAM,CAAA;YACpB,MAAM,CAAC,EAAE,cAAc,CAAA;YACvB,IAAI,CAAC,EAAE,iBAAiB,CAAA;YACxB,MAAM,CAAC,EAAE,MAAM,CAAA;YACf,KAAK,CAAC,EAAE,MAAM,CAAA;YACd,MAAM,CAAC,EAAE,MAAM,CAAA;SAChB,GACA,OAAO,CAAC,qBAAqB,CAAC;sBAuBnB,MAAM,GAAG,OAAO,CAAC,sBAAsB,CAAC;2BAGpC;YAAE,UAAU,CAAC,EAAE,MAAM,CAAA;SAAE,GAAQ,OAAO,CAAC,kBAAkB,CAAC;;oBASlE,OAAO,CAAC,qBAAqB,CAAC;0BAGxB,sBAAsB,GAAG,OAAO,CAAC,iBAAiB,CAAC;2BAMlD,MAAM,SAAS,sBAAsB,GAAG,OAAO,CAAC,iBAAiB,CAAC;2BAMlE,MAAM,GAAG,OAAO,CAAC;gBAAE,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,CAAA;aAAE,CAAC;oCAMtD,MAAM,SACP,+BAA+B,GACrC,OAAO,CAAC,iBAAiB,CAAC;wBAOjB,oBAAoB,GAAG,OAAO,CAAC,qBAAqB,CAAC;;;qBAQxD,OAAO,CAAC,mBAAmB,CAAC;yBAGxB,MAAM,GAAG,OAAO,CAAC,oBAAoB,CAAC;;;EAS1D;AAED,MAAM,MAAM,YAAY,GAAG,UAAU,CAAC,OAAO,kBAAkB,CAAC,CAAA"}
|
package/dist/client.js
CHANGED
|
@@ -9,6 +9,8 @@ import { attachGuidelineSetLogoRequestSchema, createGuidelineSetRequestSchema, g
|
|
|
9
9
|
import { createGenerationJobRequestSchema, createPanelSetRequestSchema, createPanelSetResponseSchema, createSmartVideoRequestSchema, createSmartVideoResponseSchema, createVideoLoopRequestSchema, createVideoUpscaleRequestSchema, editGenerationJobRequestSchema, generationJobResponseSchema, listGenerationJobsResponseSchema } from './generation.js';
|
|
10
10
|
import { describeImageRequestSchema, describeImageResponseSchema } from './assistant.js';
|
|
11
11
|
import { createLoopToolJobRequestSchema, createLoopToolSourceUploadRequestSchema, createLoopToolSourceUploadResponseSchema, finalizeLoopToolSourceUploadRequestSchema, finalizeLoopToolSourceUploadResponseSchema, loopToolJobResponseSchema } from './loop-tools.js';
|
|
12
|
+
import { createFrameBatchRequestSchema, deleteFrameResponseSchema, frameBatchSchema, frameReferenceUploadSchema, frameVariantSchema, listFramesQuerySchema, listFramesResponseSchema } from './frame-iterator.js';
|
|
13
|
+
import { adminCreateLookRequestSchema, adminLookListResponseSchema, adminLookResponseSchema, adminLookTestRequestSchema, adminLookTestResponseSchema, adminLookThumbnailUploadRequestSchema, adminUpdateLookRequestSchema, getLookResponseSchema, listLooksResponseSchema } from './looks.js';
|
|
12
14
|
import { adminAdjustCreditsRequestSchema, adminAdjustCreditsResponseSchema, adminJobDetailResponseSchema, adminMeResponseSchema, adminUsageResponseSchema, adminUserDetailResponseSchema, adminWorkspaceDetailResponseSchema, listAdminAuditResponseSchema, listAdminJobsResponseSchema, listAdminUsersResponseSchema, listAdminWorkspacesResponseSchema, setPlatformAdminRequestSchema, setPlatformAdminResponseSchema, setUserDisabledRequestSchema, setUserDisabledResponseSchema, stepUpStartResponseSchema, stepUpVerifyRequestSchema, stepUpVerifyResponseSchema } from './admin.js';
|
|
13
15
|
const workspaceListResponseSchema = listResponseSchema(workspaceSchema.extend({
|
|
14
16
|
membership: workspaceMembershipSchema
|
|
@@ -80,6 +82,41 @@ export function createZclApiClient(options) {
|
|
|
80
82
|
}
|
|
81
83
|
return parseResponse(schema, responseBody, response.status);
|
|
82
84
|
}
|
|
85
|
+
async function requestFormData(path, schema, formData, init = {}) {
|
|
86
|
+
const headers = new Headers(init.headers);
|
|
87
|
+
const method = (init.method ?? 'POST').toUpperCase();
|
|
88
|
+
if (method !== 'GET' && method !== 'HEAD') {
|
|
89
|
+
headers.set('x-zcl-csrf', '1');
|
|
90
|
+
}
|
|
91
|
+
const response = await fetcher(new Request(joinUrl(options.baseUrl, path), {
|
|
92
|
+
...init,
|
|
93
|
+
method,
|
|
94
|
+
headers,
|
|
95
|
+
body: formData,
|
|
96
|
+
credentials: 'include'
|
|
97
|
+
}));
|
|
98
|
+
const responseBody = await readJson(response);
|
|
99
|
+
if (!response.ok) {
|
|
100
|
+
const error = errorResponseSchema.safeParse(responseBody);
|
|
101
|
+
if (error.success) {
|
|
102
|
+
throw new ZclApiError(error.data.error.code, error.data.error.message, response.status, error.data.error.requestId);
|
|
103
|
+
}
|
|
104
|
+
throw new ZclApiError('internal_error', 'API request failed', response.status);
|
|
105
|
+
}
|
|
106
|
+
return parseResponse(schema, responseBody, response.status);
|
|
107
|
+
}
|
|
108
|
+
async function requestDownload(path) {
|
|
109
|
+
const response = await fetcher(new Request(joinUrl(options.baseUrl, path), { credentials: 'include' }));
|
|
110
|
+
if (response.ok) {
|
|
111
|
+
return response;
|
|
112
|
+
}
|
|
113
|
+
const responseBody = await readJson(response);
|
|
114
|
+
const error = errorResponseSchema.safeParse(responseBody);
|
|
115
|
+
if (error.success) {
|
|
116
|
+
throw new ZclApiError(error.data.error.code, error.data.error.message, response.status, error.data.error.requestId);
|
|
117
|
+
}
|
|
118
|
+
throw new ZclApiError('internal_error', 'API request failed', response.status);
|
|
119
|
+
}
|
|
83
120
|
return {
|
|
84
121
|
auth: {
|
|
85
122
|
signup(input) {
|
|
@@ -115,6 +152,15 @@ export function createZclApiClient(options) {
|
|
|
115
152
|
return request('/session', sessionResponseSchema);
|
|
116
153
|
}
|
|
117
154
|
},
|
|
155
|
+
// Public looks catalog: the active look templates shown on the looks page.
|
|
156
|
+
looks: {
|
|
157
|
+
list() {
|
|
158
|
+
return request('/looks', listLooksResponseSchema);
|
|
159
|
+
},
|
|
160
|
+
get(lookId) {
|
|
161
|
+
return request(`/looks/${lookId}`, getLookResponseSchema);
|
|
162
|
+
}
|
|
163
|
+
},
|
|
118
164
|
workspaces: {
|
|
119
165
|
list() {
|
|
120
166
|
return request('/workspaces', workspaceListResponseSchema);
|
|
@@ -402,6 +448,43 @@ export function createZclApiClient(options) {
|
|
|
402
448
|
return joinUrl(options.baseUrl, `/workspaces/${workspaceId}/tools/loop/assets/${assetId}/content`);
|
|
403
449
|
}
|
|
404
450
|
},
|
|
451
|
+
frameIterator: {
|
|
452
|
+
uploadReference(workspaceId, file, filename) {
|
|
453
|
+
const formData = new FormData();
|
|
454
|
+
formData.append('file', file, filename);
|
|
455
|
+
return requestFormData(`/workspaces/${workspaceId}/tools/frame-iterator/references`, frameReferenceUploadSchema, formData, { method: 'POST' });
|
|
456
|
+
},
|
|
457
|
+
createBatch(workspaceId, input, idempotencyKey) {
|
|
458
|
+
return request(`/workspaces/${workspaceId}/tools/frame-iterator/batches`, frameBatchSchema, {
|
|
459
|
+
method: 'POST',
|
|
460
|
+
headers: { 'idempotency-key': idempotencyKey },
|
|
461
|
+
body: createFrameBatchRequestSchema.parse(input)
|
|
462
|
+
});
|
|
463
|
+
},
|
|
464
|
+
getBatch(workspaceId, batchId) {
|
|
465
|
+
return request(`/workspaces/${workspaceId}/tools/frame-iterator/batches/${batchId}`, frameBatchSchema);
|
|
466
|
+
},
|
|
467
|
+
listFrames(workspaceId, options = {}) {
|
|
468
|
+
const queryOptions = listFramesQuerySchema.parse(options);
|
|
469
|
+
const params = new URLSearchParams();
|
|
470
|
+
if (queryOptions.limit !== undefined) {
|
|
471
|
+
params.set('limit', String(queryOptions.limit));
|
|
472
|
+
}
|
|
473
|
+
if (queryOptions.cursor !== undefined) {
|
|
474
|
+
params.set('cursor', queryOptions.cursor);
|
|
475
|
+
}
|
|
476
|
+
const query = params.toString() ? `?${params.toString()}` : '';
|
|
477
|
+
return request(`/workspaces/${workspaceId}/tools/frame-iterator/frames${query}`, listFramesResponseSchema);
|
|
478
|
+
},
|
|
479
|
+
download(workspaceId, iterationId, variant) {
|
|
480
|
+
return requestDownload(`/workspaces/${workspaceId}/tools/frame-iterator/frames/${iterationId}/${frameVariantSchema.parse(variant)}`);
|
|
481
|
+
},
|
|
482
|
+
delete(workspaceId, iterationId) {
|
|
483
|
+
return request(`/workspaces/${workspaceId}/tools/frame-iterator/frames/${iterationId}`, deleteFrameResponseSchema, {
|
|
484
|
+
method: 'DELETE'
|
|
485
|
+
});
|
|
486
|
+
}
|
|
487
|
+
},
|
|
405
488
|
credits: {
|
|
406
489
|
get(workspaceId) {
|
|
407
490
|
return request(`/workspaces/${workspaceId}/credits`, creditBalanceResponseSchema);
|
|
@@ -582,6 +665,41 @@ export function createZclApiClient(options) {
|
|
|
582
665
|
const query = params.toString() ? `?${params.toString()}` : '';
|
|
583
666
|
return request(`/admin/usage${query}`, adminUsageResponseSchema);
|
|
584
667
|
},
|
|
668
|
+
looks: {
|
|
669
|
+
list() {
|
|
670
|
+
return request('/admin/looks', adminLookListResponseSchema);
|
|
671
|
+
},
|
|
672
|
+
create(input) {
|
|
673
|
+
return request('/admin/looks', adminLookResponseSchema, {
|
|
674
|
+
method: 'POST',
|
|
675
|
+
body: adminCreateLookRequestSchema.parse(input)
|
|
676
|
+
});
|
|
677
|
+
},
|
|
678
|
+
update(lookId, input) {
|
|
679
|
+
return request(`/admin/looks/${lookId}`, adminLookResponseSchema, {
|
|
680
|
+
method: 'PATCH',
|
|
681
|
+
body: adminUpdateLookRequestSchema.parse(input)
|
|
682
|
+
});
|
|
683
|
+
},
|
|
684
|
+
remove(lookId) {
|
|
685
|
+
return request(`/admin/looks/${lookId}`, z.object({ data: z.object({}) }), {
|
|
686
|
+
method: 'DELETE'
|
|
687
|
+
});
|
|
688
|
+
},
|
|
689
|
+
uploadThumbnail(lookId, input) {
|
|
690
|
+
return request(`/admin/looks/${lookId}/thumbnail`, adminLookResponseSchema, {
|
|
691
|
+
method: 'PUT',
|
|
692
|
+
body: adminLookThumbnailUploadRequestSchema.parse(input)
|
|
693
|
+
});
|
|
694
|
+
},
|
|
695
|
+
// Synchronously test-generates an image from a prompt (may be slow).
|
|
696
|
+
test(input) {
|
|
697
|
+
return request('/admin/looks/test', adminLookTestResponseSchema, {
|
|
698
|
+
method: 'POST',
|
|
699
|
+
body: adminLookTestRequestSchema.parse(input)
|
|
700
|
+
});
|
|
701
|
+
}
|
|
702
|
+
},
|
|
585
703
|
stepUp: {
|
|
586
704
|
start() {
|
|
587
705
|
return request('/admin/step-up/start', stepUpStartResponseSchema, { method: 'POST' });
|
|
@@ -0,0 +1,421 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const frameMaterialSchema: z.ZodEnum<{
|
|
3
|
+
custom: "custom";
|
|
4
|
+
metal: "metal";
|
|
5
|
+
wood: "wood";
|
|
6
|
+
neon: "neon";
|
|
7
|
+
marble: "marble";
|
|
8
|
+
glass: "glass";
|
|
9
|
+
fabric: "fabric";
|
|
10
|
+
organic: "organic";
|
|
11
|
+
}>;
|
|
12
|
+
export declare const frameThicknessSchema: z.ZodEnum<{
|
|
13
|
+
medium: "medium";
|
|
14
|
+
thin: "thin";
|
|
15
|
+
thick: "thick";
|
|
16
|
+
}>;
|
|
17
|
+
export declare const frameShapeSchema: z.ZodEnum<{
|
|
18
|
+
custom: "custom";
|
|
19
|
+
organic: "organic";
|
|
20
|
+
rectangle: "rectangle";
|
|
21
|
+
rounded: "rounded";
|
|
22
|
+
}>;
|
|
23
|
+
export declare const frameVariantSchema: z.ZodEnum<{
|
|
24
|
+
green: "green";
|
|
25
|
+
transparent: "transparent";
|
|
26
|
+
}>;
|
|
27
|
+
export declare const frameIterationStatusSchema: z.ZodEnum<{
|
|
28
|
+
deleted: "deleted";
|
|
29
|
+
queued: "queued";
|
|
30
|
+
running: "running";
|
|
31
|
+
succeeded: "succeeded";
|
|
32
|
+
failed: "failed";
|
|
33
|
+
retry_wait: "retry_wait";
|
|
34
|
+
deleting: "deleting";
|
|
35
|
+
}>;
|
|
36
|
+
export declare const frameIterationPhaseSchema: z.ZodEnum<{
|
|
37
|
+
dispatching: "dispatching";
|
|
38
|
+
generating: "generating";
|
|
39
|
+
normalizing: "normalizing";
|
|
40
|
+
deriving_transparency: "deriving_transparency";
|
|
41
|
+
storing: "storing";
|
|
42
|
+
finalizing: "finalizing";
|
|
43
|
+
}>;
|
|
44
|
+
export declare const frameFailureCodeSchema: z.ZodEnum<{
|
|
45
|
+
REFERENCE_INVALID: "REFERENCE_INVALID";
|
|
46
|
+
REFERENCE_TOO_LARGE: "REFERENCE_TOO_LARGE";
|
|
47
|
+
REFERENCE_EXPIRED: "REFERENCE_EXPIRED";
|
|
48
|
+
CHROMA_COLOR_CONFLICT: "CHROMA_COLOR_CONFLICT";
|
|
49
|
+
INSUFFICIENT_CREDITS: "INSUFFICIENT_CREDITS";
|
|
50
|
+
CONTENT_BLOCKED: "CONTENT_BLOCKED";
|
|
51
|
+
PROVIDER_RETRYING: "PROVIDER_RETRYING";
|
|
52
|
+
PROVIDER_UNAVAILABLE: "PROVIDER_UNAVAILABLE";
|
|
53
|
+
PROVIDER_OUTPUT_INVALID: "PROVIDER_OUTPUT_INVALID";
|
|
54
|
+
OPENING_INVALID: "OPENING_INVALID";
|
|
55
|
+
OUTPUT_STORAGE_FAILED: "OUTPUT_STORAGE_FAILED";
|
|
56
|
+
INTERNAL_FAILED: "INTERNAL_FAILED";
|
|
57
|
+
}>;
|
|
58
|
+
/** Whether a #RRGGBB frame colour would conflict with the removable green opening. */
|
|
59
|
+
export declare function isChromaConflictingColor(hex: string): boolean;
|
|
60
|
+
export declare const frameSettingsSchema: z.ZodObject<{
|
|
61
|
+
color: z.ZodString;
|
|
62
|
+
material: z.ZodEnum<{
|
|
63
|
+
custom: "custom";
|
|
64
|
+
metal: "metal";
|
|
65
|
+
wood: "wood";
|
|
66
|
+
neon: "neon";
|
|
67
|
+
marble: "marble";
|
|
68
|
+
glass: "glass";
|
|
69
|
+
fabric: "fabric";
|
|
70
|
+
organic: "organic";
|
|
71
|
+
}>;
|
|
72
|
+
customMaterial: z.ZodOptional<z.ZodString>;
|
|
73
|
+
thickness: z.ZodEnum<{
|
|
74
|
+
medium: "medium";
|
|
75
|
+
thin: "thin";
|
|
76
|
+
thick: "thick";
|
|
77
|
+
}>;
|
|
78
|
+
shape: z.ZodEnum<{
|
|
79
|
+
custom: "custom";
|
|
80
|
+
organic: "organic";
|
|
81
|
+
rectangle: "rectangle";
|
|
82
|
+
rounded: "rounded";
|
|
83
|
+
}>;
|
|
84
|
+
customShape: z.ZodOptional<z.ZodString>;
|
|
85
|
+
additionalDirection: z.ZodOptional<z.ZodString>;
|
|
86
|
+
}, z.core.$strict>;
|
|
87
|
+
export declare const createFrameBatchRequestSchema: z.ZodObject<{
|
|
88
|
+
referenceUploadId: z.ZodString;
|
|
89
|
+
iterationCount: z.ZodNumber;
|
|
90
|
+
settings: z.ZodObject<{
|
|
91
|
+
color: z.ZodString;
|
|
92
|
+
material: z.ZodEnum<{
|
|
93
|
+
custom: "custom";
|
|
94
|
+
metal: "metal";
|
|
95
|
+
wood: "wood";
|
|
96
|
+
neon: "neon";
|
|
97
|
+
marble: "marble";
|
|
98
|
+
glass: "glass";
|
|
99
|
+
fabric: "fabric";
|
|
100
|
+
organic: "organic";
|
|
101
|
+
}>;
|
|
102
|
+
customMaterial: z.ZodOptional<z.ZodString>;
|
|
103
|
+
thickness: z.ZodEnum<{
|
|
104
|
+
medium: "medium";
|
|
105
|
+
thin: "thin";
|
|
106
|
+
thick: "thick";
|
|
107
|
+
}>;
|
|
108
|
+
shape: z.ZodEnum<{
|
|
109
|
+
custom: "custom";
|
|
110
|
+
organic: "organic";
|
|
111
|
+
rectangle: "rectangle";
|
|
112
|
+
rounded: "rounded";
|
|
113
|
+
}>;
|
|
114
|
+
customShape: z.ZodOptional<z.ZodString>;
|
|
115
|
+
additionalDirection: z.ZodOptional<z.ZodString>;
|
|
116
|
+
}, z.core.$strict>;
|
|
117
|
+
}, z.core.$strict>;
|
|
118
|
+
export declare const frameReferenceUploadSchema: z.ZodObject<{
|
|
119
|
+
uploadId: z.ZodString;
|
|
120
|
+
expiresAt: z.ZodString;
|
|
121
|
+
original: z.ZodObject<{
|
|
122
|
+
mimeType: z.ZodEnum<{
|
|
123
|
+
"image/png": "image/png";
|
|
124
|
+
"image/jpeg": "image/jpeg";
|
|
125
|
+
"image/webp": "image/webp";
|
|
126
|
+
}>;
|
|
127
|
+
byteSize: z.ZodNumber;
|
|
128
|
+
width: z.ZodNumber;
|
|
129
|
+
height: z.ZodNumber;
|
|
130
|
+
}, z.core.$strict>;
|
|
131
|
+
}, z.core.$strict>;
|
|
132
|
+
export declare const frameIterationSchema: z.ZodObject<{
|
|
133
|
+
id: z.ZodString;
|
|
134
|
+
batchId: z.ZodString;
|
|
135
|
+
iterationIndex: z.ZodNumber;
|
|
136
|
+
status: z.ZodEnum<{
|
|
137
|
+
deleted: "deleted";
|
|
138
|
+
queued: "queued";
|
|
139
|
+
running: "running";
|
|
140
|
+
succeeded: "succeeded";
|
|
141
|
+
failed: "failed";
|
|
142
|
+
retry_wait: "retry_wait";
|
|
143
|
+
deleting: "deleting";
|
|
144
|
+
}>;
|
|
145
|
+
phase: z.ZodEnum<{
|
|
146
|
+
dispatching: "dispatching";
|
|
147
|
+
generating: "generating";
|
|
148
|
+
normalizing: "normalizing";
|
|
149
|
+
deriving_transparency: "deriving_transparency";
|
|
150
|
+
storing: "storing";
|
|
151
|
+
finalizing: "finalizing";
|
|
152
|
+
}>;
|
|
153
|
+
attemptCount: z.ZodNumber;
|
|
154
|
+
failureCode: z.ZodNullable<z.ZodEnum<{
|
|
155
|
+
REFERENCE_INVALID: "REFERENCE_INVALID";
|
|
156
|
+
REFERENCE_TOO_LARGE: "REFERENCE_TOO_LARGE";
|
|
157
|
+
REFERENCE_EXPIRED: "REFERENCE_EXPIRED";
|
|
158
|
+
CHROMA_COLOR_CONFLICT: "CHROMA_COLOR_CONFLICT";
|
|
159
|
+
INSUFFICIENT_CREDITS: "INSUFFICIENT_CREDITS";
|
|
160
|
+
CONTENT_BLOCKED: "CONTENT_BLOCKED";
|
|
161
|
+
PROVIDER_RETRYING: "PROVIDER_RETRYING";
|
|
162
|
+
PROVIDER_UNAVAILABLE: "PROVIDER_UNAVAILABLE";
|
|
163
|
+
PROVIDER_OUTPUT_INVALID: "PROVIDER_OUTPUT_INVALID";
|
|
164
|
+
OPENING_INVALID: "OPENING_INVALID";
|
|
165
|
+
OUTPUT_STORAGE_FAILED: "OUTPUT_STORAGE_FAILED";
|
|
166
|
+
INTERNAL_FAILED: "INTERNAL_FAILED";
|
|
167
|
+
}>>;
|
|
168
|
+
settings: z.ZodObject<{
|
|
169
|
+
color: z.ZodString;
|
|
170
|
+
material: z.ZodEnum<{
|
|
171
|
+
custom: "custom";
|
|
172
|
+
metal: "metal";
|
|
173
|
+
wood: "wood";
|
|
174
|
+
neon: "neon";
|
|
175
|
+
marble: "marble";
|
|
176
|
+
glass: "glass";
|
|
177
|
+
fabric: "fabric";
|
|
178
|
+
organic: "organic";
|
|
179
|
+
}>;
|
|
180
|
+
customMaterial: z.ZodOptional<z.ZodString>;
|
|
181
|
+
thickness: z.ZodEnum<{
|
|
182
|
+
medium: "medium";
|
|
183
|
+
thin: "thin";
|
|
184
|
+
thick: "thick";
|
|
185
|
+
}>;
|
|
186
|
+
shape: z.ZodEnum<{
|
|
187
|
+
custom: "custom";
|
|
188
|
+
organic: "organic";
|
|
189
|
+
rectangle: "rectangle";
|
|
190
|
+
rounded: "rounded";
|
|
191
|
+
}>;
|
|
192
|
+
customShape: z.ZodOptional<z.ZodString>;
|
|
193
|
+
additionalDirection: z.ZodOptional<z.ZodString>;
|
|
194
|
+
}, z.core.$strict>;
|
|
195
|
+
width: z.ZodNullable<z.ZodNumber>;
|
|
196
|
+
height: z.ZodNullable<z.ZodNumber>;
|
|
197
|
+
startedAt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
198
|
+
completedAt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
199
|
+
createdAt: z.ZodString;
|
|
200
|
+
updatedAt: z.ZodString;
|
|
201
|
+
downloads: z.ZodObject<{
|
|
202
|
+
green: z.ZodBoolean;
|
|
203
|
+
transparent: z.ZodBoolean;
|
|
204
|
+
}, z.core.$strict>;
|
|
205
|
+
}, z.core.$strict>;
|
|
206
|
+
export declare const frameBatchSchema: z.ZodObject<{
|
|
207
|
+
id: z.ZodString;
|
|
208
|
+
requestedCount: z.ZodNumber;
|
|
209
|
+
createdAt: z.ZodString;
|
|
210
|
+
iterations: z.ZodArray<z.ZodObject<{
|
|
211
|
+
id: z.ZodString;
|
|
212
|
+
batchId: z.ZodString;
|
|
213
|
+
iterationIndex: z.ZodNumber;
|
|
214
|
+
status: z.ZodEnum<{
|
|
215
|
+
deleted: "deleted";
|
|
216
|
+
queued: "queued";
|
|
217
|
+
running: "running";
|
|
218
|
+
succeeded: "succeeded";
|
|
219
|
+
failed: "failed";
|
|
220
|
+
retry_wait: "retry_wait";
|
|
221
|
+
deleting: "deleting";
|
|
222
|
+
}>;
|
|
223
|
+
phase: z.ZodEnum<{
|
|
224
|
+
dispatching: "dispatching";
|
|
225
|
+
generating: "generating";
|
|
226
|
+
normalizing: "normalizing";
|
|
227
|
+
deriving_transparency: "deriving_transparency";
|
|
228
|
+
storing: "storing";
|
|
229
|
+
finalizing: "finalizing";
|
|
230
|
+
}>;
|
|
231
|
+
attemptCount: z.ZodNumber;
|
|
232
|
+
failureCode: z.ZodNullable<z.ZodEnum<{
|
|
233
|
+
REFERENCE_INVALID: "REFERENCE_INVALID";
|
|
234
|
+
REFERENCE_TOO_LARGE: "REFERENCE_TOO_LARGE";
|
|
235
|
+
REFERENCE_EXPIRED: "REFERENCE_EXPIRED";
|
|
236
|
+
CHROMA_COLOR_CONFLICT: "CHROMA_COLOR_CONFLICT";
|
|
237
|
+
INSUFFICIENT_CREDITS: "INSUFFICIENT_CREDITS";
|
|
238
|
+
CONTENT_BLOCKED: "CONTENT_BLOCKED";
|
|
239
|
+
PROVIDER_RETRYING: "PROVIDER_RETRYING";
|
|
240
|
+
PROVIDER_UNAVAILABLE: "PROVIDER_UNAVAILABLE";
|
|
241
|
+
PROVIDER_OUTPUT_INVALID: "PROVIDER_OUTPUT_INVALID";
|
|
242
|
+
OPENING_INVALID: "OPENING_INVALID";
|
|
243
|
+
OUTPUT_STORAGE_FAILED: "OUTPUT_STORAGE_FAILED";
|
|
244
|
+
INTERNAL_FAILED: "INTERNAL_FAILED";
|
|
245
|
+
}>>;
|
|
246
|
+
settings: z.ZodObject<{
|
|
247
|
+
color: z.ZodString;
|
|
248
|
+
material: z.ZodEnum<{
|
|
249
|
+
custom: "custom";
|
|
250
|
+
metal: "metal";
|
|
251
|
+
wood: "wood";
|
|
252
|
+
neon: "neon";
|
|
253
|
+
marble: "marble";
|
|
254
|
+
glass: "glass";
|
|
255
|
+
fabric: "fabric";
|
|
256
|
+
organic: "organic";
|
|
257
|
+
}>;
|
|
258
|
+
customMaterial: z.ZodOptional<z.ZodString>;
|
|
259
|
+
thickness: z.ZodEnum<{
|
|
260
|
+
medium: "medium";
|
|
261
|
+
thin: "thin";
|
|
262
|
+
thick: "thick";
|
|
263
|
+
}>;
|
|
264
|
+
shape: z.ZodEnum<{
|
|
265
|
+
custom: "custom";
|
|
266
|
+
organic: "organic";
|
|
267
|
+
rectangle: "rectangle";
|
|
268
|
+
rounded: "rounded";
|
|
269
|
+
}>;
|
|
270
|
+
customShape: z.ZodOptional<z.ZodString>;
|
|
271
|
+
additionalDirection: z.ZodOptional<z.ZodString>;
|
|
272
|
+
}, z.core.$strict>;
|
|
273
|
+
width: z.ZodNullable<z.ZodNumber>;
|
|
274
|
+
height: z.ZodNullable<z.ZodNumber>;
|
|
275
|
+
startedAt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
276
|
+
completedAt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
277
|
+
createdAt: z.ZodString;
|
|
278
|
+
updatedAt: z.ZodString;
|
|
279
|
+
downloads: z.ZodObject<{
|
|
280
|
+
green: z.ZodBoolean;
|
|
281
|
+
transparent: z.ZodBoolean;
|
|
282
|
+
}, z.core.$strict>;
|
|
283
|
+
}, z.core.$strict>>;
|
|
284
|
+
}, z.core.$strict>;
|
|
285
|
+
export declare const savedFrameSchema: z.ZodObject<{
|
|
286
|
+
id: z.ZodString;
|
|
287
|
+
batchId: z.ZodString;
|
|
288
|
+
iterationIndex: z.ZodNumber;
|
|
289
|
+
phase: z.ZodEnum<{
|
|
290
|
+
dispatching: "dispatching";
|
|
291
|
+
generating: "generating";
|
|
292
|
+
normalizing: "normalizing";
|
|
293
|
+
deriving_transparency: "deriving_transparency";
|
|
294
|
+
storing: "storing";
|
|
295
|
+
finalizing: "finalizing";
|
|
296
|
+
}>;
|
|
297
|
+
attemptCount: z.ZodNumber;
|
|
298
|
+
settings: z.ZodObject<{
|
|
299
|
+
color: z.ZodString;
|
|
300
|
+
material: z.ZodEnum<{
|
|
301
|
+
custom: "custom";
|
|
302
|
+
metal: "metal";
|
|
303
|
+
wood: "wood";
|
|
304
|
+
neon: "neon";
|
|
305
|
+
marble: "marble";
|
|
306
|
+
glass: "glass";
|
|
307
|
+
fabric: "fabric";
|
|
308
|
+
organic: "organic";
|
|
309
|
+
}>;
|
|
310
|
+
customMaterial: z.ZodOptional<z.ZodString>;
|
|
311
|
+
thickness: z.ZodEnum<{
|
|
312
|
+
medium: "medium";
|
|
313
|
+
thin: "thin";
|
|
314
|
+
thick: "thick";
|
|
315
|
+
}>;
|
|
316
|
+
shape: z.ZodEnum<{
|
|
317
|
+
custom: "custom";
|
|
318
|
+
organic: "organic";
|
|
319
|
+
rectangle: "rectangle";
|
|
320
|
+
rounded: "rounded";
|
|
321
|
+
}>;
|
|
322
|
+
customShape: z.ZodOptional<z.ZodString>;
|
|
323
|
+
additionalDirection: z.ZodOptional<z.ZodString>;
|
|
324
|
+
}, z.core.$strict>;
|
|
325
|
+
startedAt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
326
|
+
completedAt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
327
|
+
createdAt: z.ZodString;
|
|
328
|
+
updatedAt: z.ZodString;
|
|
329
|
+
status: z.ZodLiteral<"succeeded">;
|
|
330
|
+
failureCode: z.ZodNull;
|
|
331
|
+
width: z.ZodNumber;
|
|
332
|
+
height: z.ZodNumber;
|
|
333
|
+
downloads: z.ZodObject<{
|
|
334
|
+
green: z.ZodLiteral<true>;
|
|
335
|
+
transparent: z.ZodLiteral<true>;
|
|
336
|
+
}, z.core.$strict>;
|
|
337
|
+
}, z.core.$strict>;
|
|
338
|
+
export declare const listFramesResponseSchema: z.ZodObject<{
|
|
339
|
+
items: z.ZodArray<z.ZodObject<{
|
|
340
|
+
id: z.ZodString;
|
|
341
|
+
batchId: z.ZodString;
|
|
342
|
+
iterationIndex: z.ZodNumber;
|
|
343
|
+
phase: z.ZodEnum<{
|
|
344
|
+
dispatching: "dispatching";
|
|
345
|
+
generating: "generating";
|
|
346
|
+
normalizing: "normalizing";
|
|
347
|
+
deriving_transparency: "deriving_transparency";
|
|
348
|
+
storing: "storing";
|
|
349
|
+
finalizing: "finalizing";
|
|
350
|
+
}>;
|
|
351
|
+
attemptCount: z.ZodNumber;
|
|
352
|
+
settings: z.ZodObject<{
|
|
353
|
+
color: z.ZodString;
|
|
354
|
+
material: z.ZodEnum<{
|
|
355
|
+
custom: "custom";
|
|
356
|
+
metal: "metal";
|
|
357
|
+
wood: "wood";
|
|
358
|
+
neon: "neon";
|
|
359
|
+
marble: "marble";
|
|
360
|
+
glass: "glass";
|
|
361
|
+
fabric: "fabric";
|
|
362
|
+
organic: "organic";
|
|
363
|
+
}>;
|
|
364
|
+
customMaterial: z.ZodOptional<z.ZodString>;
|
|
365
|
+
thickness: z.ZodEnum<{
|
|
366
|
+
medium: "medium";
|
|
367
|
+
thin: "thin";
|
|
368
|
+
thick: "thick";
|
|
369
|
+
}>;
|
|
370
|
+
shape: z.ZodEnum<{
|
|
371
|
+
custom: "custom";
|
|
372
|
+
organic: "organic";
|
|
373
|
+
rectangle: "rectangle";
|
|
374
|
+
rounded: "rounded";
|
|
375
|
+
}>;
|
|
376
|
+
customShape: z.ZodOptional<z.ZodString>;
|
|
377
|
+
additionalDirection: z.ZodOptional<z.ZodString>;
|
|
378
|
+
}, z.core.$strict>;
|
|
379
|
+
startedAt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
380
|
+
completedAt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
381
|
+
createdAt: z.ZodString;
|
|
382
|
+
updatedAt: z.ZodString;
|
|
383
|
+
status: z.ZodLiteral<"succeeded">;
|
|
384
|
+
failureCode: z.ZodNull;
|
|
385
|
+
width: z.ZodNumber;
|
|
386
|
+
height: z.ZodNumber;
|
|
387
|
+
downloads: z.ZodObject<{
|
|
388
|
+
green: z.ZodLiteral<true>;
|
|
389
|
+
transparent: z.ZodLiteral<true>;
|
|
390
|
+
}, z.core.$strict>;
|
|
391
|
+
}, z.core.$strict>>;
|
|
392
|
+
nextCursor: z.ZodNullable<z.ZodString>;
|
|
393
|
+
}, z.core.$strict>;
|
|
394
|
+
export declare const listFramesQuerySchema: z.ZodObject<{
|
|
395
|
+
cursor: z.ZodOptional<z.ZodString>;
|
|
396
|
+
limit: z.ZodOptional<z.ZodCoercedNumber<unknown>>;
|
|
397
|
+
}, z.core.$strict>;
|
|
398
|
+
export declare const deleteFrameResponseSchema: z.ZodObject<{
|
|
399
|
+
id: z.ZodString;
|
|
400
|
+
status: z.ZodEnum<{
|
|
401
|
+
deleted: "deleted";
|
|
402
|
+
deleting: "deleting";
|
|
403
|
+
}>;
|
|
404
|
+
}, z.core.$strict>;
|
|
405
|
+
export type FrameMaterial = z.infer<typeof frameMaterialSchema>;
|
|
406
|
+
export type FrameThickness = z.infer<typeof frameThicknessSchema>;
|
|
407
|
+
export type FrameShape = z.infer<typeof frameShapeSchema>;
|
|
408
|
+
export type FrameVariant = z.infer<typeof frameVariantSchema>;
|
|
409
|
+
export type FrameIterationStatus = z.infer<typeof frameIterationStatusSchema>;
|
|
410
|
+
export type FrameIterationPhase = z.infer<typeof frameIterationPhaseSchema>;
|
|
411
|
+
export type FrameFailureCode = z.infer<typeof frameFailureCodeSchema>;
|
|
412
|
+
export type FrameSettings = z.infer<typeof frameSettingsSchema>;
|
|
413
|
+
export type CreateFrameBatchRequest = z.infer<typeof createFrameBatchRequestSchema>;
|
|
414
|
+
export type FrameReferenceUpload = z.infer<typeof frameReferenceUploadSchema>;
|
|
415
|
+
export type FrameIteration = z.infer<typeof frameIterationSchema>;
|
|
416
|
+
export type FrameBatch = z.infer<typeof frameBatchSchema>;
|
|
417
|
+
export type SavedFrame = z.infer<typeof savedFrameSchema>;
|
|
418
|
+
export type ListFramesResponse = z.infer<typeof listFramesResponseSchema>;
|
|
419
|
+
export type ListFramesQuery = z.infer<typeof listFramesQuerySchema>;
|
|
420
|
+
export type DeleteFrameResponse = z.infer<typeof deleteFrameResponseSchema>;
|
|
421
|
+
//# sourceMappingURL=frame-iterator.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"frame-iterator.d.ts","sourceRoot":"","sources":["../src/frame-iterator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAGvB,eAAO,MAAM,mBAAmB;;;;;;;;;EAAsF,CAAA;AACtH,eAAO,MAAM,oBAAoB;;;;EAAsC,CAAA;AACvE,eAAO,MAAM,gBAAgB;;;;;EAAwD,CAAA;AACrF,eAAO,MAAM,kBAAkB;;;EAAmC,CAAA;AAClE,eAAO,MAAM,0BAA0B;;;;;;;;EAQrC,CAAA;AACF,eAAO,MAAM,yBAAyB;;;;;;;EAOpC,CAAA;AACF,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;EAajC,CAAA;AAMF,sFAAsF;AACtF,wBAAgB,wBAAwB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAS7D;AAED,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;kBAiD5B,CAAA;AAEJ,eAAO,MAAM,6BAA6B;;;;;;;;;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;AACrE,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAA;AAC/D,MAAM,MAAM,uBAAuB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,6BAA6B,CAAC,CAAA;AACnF,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,0BAA0B,CAAC,CAAA;AAC7E,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAA;AACjE,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAA;AACzD,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAA;AACzD,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAA;AACzE,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAA;AACnE,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,yBAAyB,CAAC,CAAA"}
|
|
@@ -0,0 +1,223 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { idSchema, isoDateSchema } from './common.js';
|
|
3
|
+
export const frameMaterialSchema = z.enum(['metal', 'wood', 'neon', 'marble', 'glass', 'fabric', 'organic', 'custom']);
|
|
4
|
+
export const frameThicknessSchema = z.enum(['thin', 'medium', 'thick']);
|
|
5
|
+
export const frameShapeSchema = z.enum(['rectangle', 'rounded', 'organic', 'custom']);
|
|
6
|
+
export const frameVariantSchema = z.enum(['green', 'transparent']);
|
|
7
|
+
export const frameIterationStatusSchema = z.enum([
|
|
8
|
+
'queued',
|
|
9
|
+
'running',
|
|
10
|
+
'retry_wait',
|
|
11
|
+
'succeeded',
|
|
12
|
+
'failed',
|
|
13
|
+
'deleting',
|
|
14
|
+
'deleted'
|
|
15
|
+
]);
|
|
16
|
+
export const frameIterationPhaseSchema = z.enum([
|
|
17
|
+
'dispatching',
|
|
18
|
+
'generating',
|
|
19
|
+
'normalizing',
|
|
20
|
+
'deriving_transparency',
|
|
21
|
+
'storing',
|
|
22
|
+
'finalizing'
|
|
23
|
+
]);
|
|
24
|
+
export const frameFailureCodeSchema = z.enum([
|
|
25
|
+
'REFERENCE_INVALID',
|
|
26
|
+
'REFERENCE_TOO_LARGE',
|
|
27
|
+
'REFERENCE_EXPIRED',
|
|
28
|
+
'CHROMA_COLOR_CONFLICT',
|
|
29
|
+
'INSUFFICIENT_CREDITS',
|
|
30
|
+
'CONTENT_BLOCKED',
|
|
31
|
+
'PROVIDER_RETRYING',
|
|
32
|
+
'PROVIDER_UNAVAILABLE',
|
|
33
|
+
'PROVIDER_OUTPUT_INVALID',
|
|
34
|
+
'OPENING_INVALID',
|
|
35
|
+
'OUTPUT_STORAGE_FAILED',
|
|
36
|
+
'INTERNAL_FAILED'
|
|
37
|
+
]);
|
|
38
|
+
const hexColorSchema = z.string().regex(/^#[0-9A-Fa-f]{6}$/);
|
|
39
|
+
const customDirectionSchema = z.string().trim().min(1).max(120);
|
|
40
|
+
const additionalDirectionSchema = z.string().trim().min(1).max(1000);
|
|
41
|
+
/** Whether a #RRGGBB frame colour would conflict with the removable green opening. */
|
|
42
|
+
export function isChromaConflictingColor(hex) {
|
|
43
|
+
if (!/^#[0-9A-Fa-f]{6}$/.test(hex)) {
|
|
44
|
+
return false;
|
|
45
|
+
}
|
|
46
|
+
const red = Number.parseInt(hex.slice(1, 3), 16);
|
|
47
|
+
const green = Number.parseInt(hex.slice(3, 5), 16);
|
|
48
|
+
const blue = Number.parseInt(hex.slice(5, 7), 16);
|
|
49
|
+
return green >= 160 && green - red >= 60 && green - blue >= 60;
|
|
50
|
+
}
|
|
51
|
+
export const frameSettingsSchema = z
|
|
52
|
+
.object({
|
|
53
|
+
color: hexColorSchema,
|
|
54
|
+
material: frameMaterialSchema,
|
|
55
|
+
customMaterial: customDirectionSchema.optional(),
|
|
56
|
+
thickness: frameThicknessSchema,
|
|
57
|
+
shape: frameShapeSchema,
|
|
58
|
+
customShape: customDirectionSchema.optional(),
|
|
59
|
+
additionalDirection: additionalDirectionSchema.optional()
|
|
60
|
+
})
|
|
61
|
+
.strict()
|
|
62
|
+
.superRefine((value, context) => {
|
|
63
|
+
if (isChromaConflictingColor(value.color)) {
|
|
64
|
+
context.addIssue({
|
|
65
|
+
code: 'custom',
|
|
66
|
+
path: ['color'],
|
|
67
|
+
message: 'Bright chroma green is reserved for the removable opening'
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
if (value.material === 'custom' && value.customMaterial === undefined) {
|
|
71
|
+
context.addIssue({
|
|
72
|
+
code: 'custom',
|
|
73
|
+
path: ['customMaterial'],
|
|
74
|
+
message: 'Custom material is required when material is custom'
|
|
75
|
+
});
|
|
76
|
+
}
|
|
77
|
+
if (value.material !== 'custom' && value.customMaterial !== undefined) {
|
|
78
|
+
context.addIssue({
|
|
79
|
+
code: 'custom',
|
|
80
|
+
path: ['customMaterial'],
|
|
81
|
+
message: 'Custom material is only allowed when material is custom'
|
|
82
|
+
});
|
|
83
|
+
}
|
|
84
|
+
if (value.shape === 'custom' && value.customShape === undefined) {
|
|
85
|
+
context.addIssue({
|
|
86
|
+
code: 'custom',
|
|
87
|
+
path: ['customShape'],
|
|
88
|
+
message: 'Custom shape is required when shape is custom'
|
|
89
|
+
});
|
|
90
|
+
}
|
|
91
|
+
if (value.shape !== 'custom' && value.customShape !== undefined) {
|
|
92
|
+
context.addIssue({
|
|
93
|
+
code: 'custom',
|
|
94
|
+
path: ['customShape'],
|
|
95
|
+
message: 'Custom shape is only allowed when shape is custom'
|
|
96
|
+
});
|
|
97
|
+
}
|
|
98
|
+
});
|
|
99
|
+
export const createFrameBatchRequestSchema = z
|
|
100
|
+
.object({
|
|
101
|
+
referenceUploadId: idSchema,
|
|
102
|
+
iterationCount: z.number().int().min(1).max(4),
|
|
103
|
+
settings: frameSettingsSchema
|
|
104
|
+
})
|
|
105
|
+
.strict();
|
|
106
|
+
export const frameReferenceUploadSchema = z
|
|
107
|
+
.object({
|
|
108
|
+
uploadId: idSchema,
|
|
109
|
+
expiresAt: isoDateSchema,
|
|
110
|
+
original: z
|
|
111
|
+
.object({
|
|
112
|
+
mimeType: z.enum(['image/png', 'image/jpeg', 'image/webp']),
|
|
113
|
+
byteSize: z.number().int().positive(),
|
|
114
|
+
width: z.number().int().positive(),
|
|
115
|
+
height: z.number().int().positive()
|
|
116
|
+
})
|
|
117
|
+
.strict()
|
|
118
|
+
})
|
|
119
|
+
.strict();
|
|
120
|
+
const frameDownloadsSchema = z.object({ green: z.boolean(), transparent: z.boolean() }).strict();
|
|
121
|
+
export const frameIterationSchema = z
|
|
122
|
+
.object({
|
|
123
|
+
id: idSchema,
|
|
124
|
+
batchId: idSchema,
|
|
125
|
+
iterationIndex: z.number().int().min(0).max(3),
|
|
126
|
+
status: frameIterationStatusSchema,
|
|
127
|
+
phase: frameIterationPhaseSchema,
|
|
128
|
+
attemptCount: z.number().int().nonnegative(),
|
|
129
|
+
failureCode: frameFailureCodeSchema.nullable(),
|
|
130
|
+
settings: frameSettingsSchema,
|
|
131
|
+
width: z.number().int().positive().nullable(),
|
|
132
|
+
height: z.number().int().positive().nullable(),
|
|
133
|
+
startedAt: isoDateSchema.nullable().optional(),
|
|
134
|
+
completedAt: isoDateSchema.nullable().optional(),
|
|
135
|
+
createdAt: isoDateSchema,
|
|
136
|
+
updatedAt: isoDateSchema,
|
|
137
|
+
downloads: frameDownloadsSchema
|
|
138
|
+
})
|
|
139
|
+
.strict()
|
|
140
|
+
.superRefine((value, context) => {
|
|
141
|
+
const downloadsAvailable = value.downloads.green || value.downloads.transparent;
|
|
142
|
+
const hasDimensions = value.width !== null || value.height !== null;
|
|
143
|
+
if (value.status === 'failed') {
|
|
144
|
+
if (value.failureCode === null) {
|
|
145
|
+
context.addIssue({ code: 'custom', path: ['failureCode'], message: 'Failed iterations require a failure code' });
|
|
146
|
+
}
|
|
147
|
+
if (hasDimensions) {
|
|
148
|
+
context.addIssue({ code: 'custom', path: ['width'], message: 'Failed iterations do not expose output dimensions' });
|
|
149
|
+
}
|
|
150
|
+
if (downloadsAvailable) {
|
|
151
|
+
context.addIssue({ code: 'custom', path: ['downloads'], message: 'Failed iterations are not downloadable' });
|
|
152
|
+
}
|
|
153
|
+
return;
|
|
154
|
+
}
|
|
155
|
+
if (value.status === 'succeeded') {
|
|
156
|
+
if (value.failureCode !== null) {
|
|
157
|
+
context.addIssue({ code: 'custom', path: ['failureCode'], message: 'Succeeded iterations do not have a failure code' });
|
|
158
|
+
}
|
|
159
|
+
if (value.width === null || value.height === null) {
|
|
160
|
+
context.addIssue({ code: 'custom', path: ['width'], message: 'Succeeded iterations require output dimensions' });
|
|
161
|
+
}
|
|
162
|
+
if (!value.downloads.green || !value.downloads.transparent) {
|
|
163
|
+
context.addIssue({ code: 'custom', path: ['downloads'], message: 'Succeeded iterations require both downloads' });
|
|
164
|
+
}
|
|
165
|
+
return;
|
|
166
|
+
}
|
|
167
|
+
if (value.status === 'deleting' || value.status === 'deleted') {
|
|
168
|
+
if (value.failureCode !== null) {
|
|
169
|
+
context.addIssue({ code: 'custom', path: ['failureCode'], message: 'Deleted iterations do not have a failure code' });
|
|
170
|
+
}
|
|
171
|
+
if (value.width === null || value.height === null) {
|
|
172
|
+
context.addIssue({ code: 'custom', path: ['width'], message: 'Deleted iterations retain decoded dimensions' });
|
|
173
|
+
}
|
|
174
|
+
if (downloadsAvailable) {
|
|
175
|
+
context.addIssue({ code: 'custom', path: ['downloads'], message: 'Deleted iterations are not downloadable' });
|
|
176
|
+
}
|
|
177
|
+
return;
|
|
178
|
+
}
|
|
179
|
+
if (value.failureCode !== null) {
|
|
180
|
+
context.addIssue({ code: 'custom', path: ['failureCode'], message: 'Non-terminal iterations do not have a failure code' });
|
|
181
|
+
}
|
|
182
|
+
if (hasDimensions) {
|
|
183
|
+
context.addIssue({ code: 'custom', path: ['width'], message: 'Non-terminal iterations do not expose output dimensions' });
|
|
184
|
+
}
|
|
185
|
+
if (downloadsAvailable) {
|
|
186
|
+
context.addIssue({ code: 'custom', path: ['downloads'], message: 'Non-terminal iterations are not downloadable' });
|
|
187
|
+
}
|
|
188
|
+
});
|
|
189
|
+
export const frameBatchSchema = z
|
|
190
|
+
.object({
|
|
191
|
+
id: idSchema,
|
|
192
|
+
requestedCount: z.number().int().min(1).max(4),
|
|
193
|
+
createdAt: isoDateSchema,
|
|
194
|
+
iterations: z.array(frameIterationSchema).min(1).max(4)
|
|
195
|
+
})
|
|
196
|
+
.strict();
|
|
197
|
+
export const savedFrameSchema = frameIterationSchema
|
|
198
|
+
.safeExtend({
|
|
199
|
+
status: z.literal('succeeded'),
|
|
200
|
+
failureCode: z.null(),
|
|
201
|
+
width: z.number().int().positive(),
|
|
202
|
+
height: z.number().int().positive(),
|
|
203
|
+
downloads: z.object({ green: z.literal(true), transparent: z.literal(true) }).strict()
|
|
204
|
+
})
|
|
205
|
+
.strict();
|
|
206
|
+
export const listFramesResponseSchema = z
|
|
207
|
+
.object({
|
|
208
|
+
items: z.array(savedFrameSchema),
|
|
209
|
+
nextCursor: z.string().min(1).nullable()
|
|
210
|
+
})
|
|
211
|
+
.strict();
|
|
212
|
+
export const listFramesQuerySchema = z
|
|
213
|
+
.object({
|
|
214
|
+
cursor: z.string().min(1).optional(),
|
|
215
|
+
limit: z.coerce.number().int().min(1).max(50).optional()
|
|
216
|
+
})
|
|
217
|
+
.strict();
|
|
218
|
+
export const deleteFrameResponseSchema = z
|
|
219
|
+
.object({
|
|
220
|
+
id: idSchema,
|
|
221
|
+
status: z.enum(['deleting', 'deleted'])
|
|
222
|
+
})
|
|
223
|
+
.strict();
|
package/dist/index.d.ts
CHANGED
|
@@ -5,8 +5,10 @@ export * from './auth.js';
|
|
|
5
5
|
export * from './client.js';
|
|
6
6
|
export * from './common.js';
|
|
7
7
|
export * from './credits.js';
|
|
8
|
+
export * from './frame-iterator.js';
|
|
8
9
|
export * from './generation.js';
|
|
9
10
|
export * from './guidelines.js';
|
|
11
|
+
export * from './looks.js';
|
|
10
12
|
export * from './loop-tools.js';
|
|
11
13
|
export * from './projects.js';
|
|
12
14
|
export * from './workspaces.js';
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAA;AAC1B,cAAc,aAAa,CAAA;AAC3B,cAAc,gBAAgB,CAAA;AAC9B,cAAc,WAAW,CAAA;AACzB,cAAc,aAAa,CAAA;AAC3B,cAAc,aAAa,CAAA;AAC3B,cAAc,cAAc,CAAA;AAC5B,cAAc,iBAAiB,CAAA;AAC/B,cAAc,iBAAiB,CAAA;AAC/B,cAAc,iBAAiB,CAAA;AAC/B,cAAc,eAAe,CAAA;AAC7B,cAAc,iBAAiB,CAAA"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAA;AAC1B,cAAc,aAAa,CAAA;AAC3B,cAAc,gBAAgB,CAAA;AAC9B,cAAc,WAAW,CAAA;AACzB,cAAc,aAAa,CAAA;AAC3B,cAAc,aAAa,CAAA;AAC3B,cAAc,cAAc,CAAA;AAC5B,cAAc,qBAAqB,CAAA;AACnC,cAAc,iBAAiB,CAAA;AAC/B,cAAc,iBAAiB,CAAA;AAC/B,cAAc,YAAY,CAAA;AAC1B,cAAc,iBAAiB,CAAA;AAC/B,cAAc,eAAe,CAAA;AAC7B,cAAc,iBAAiB,CAAA"}
|
package/dist/index.js
CHANGED
|
@@ -5,8 +5,10 @@ export * from './auth.js';
|
|
|
5
5
|
export * from './client.js';
|
|
6
6
|
export * from './common.js';
|
|
7
7
|
export * from './credits.js';
|
|
8
|
+
export * from './frame-iterator.js';
|
|
8
9
|
export * from './generation.js';
|
|
9
10
|
export * from './guidelines.js';
|
|
11
|
+
export * from './looks.js';
|
|
10
12
|
export * from './loop-tools.js';
|
|
11
13
|
export * from './projects.js';
|
|
12
14
|
export * from './workspaces.js';
|
package/dist/looks.d.ts
ADDED
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const lookSchema: z.ZodObject<{
|
|
3
|
+
id: z.ZodString;
|
|
4
|
+
name: z.ZodString;
|
|
5
|
+
category: z.ZodString;
|
|
6
|
+
prompt: z.ZodString;
|
|
7
|
+
thumbnailUrl: z.ZodNullable<z.ZodString>;
|
|
8
|
+
sortOrder: z.ZodNumber;
|
|
9
|
+
isActive: z.ZodBoolean;
|
|
10
|
+
createdAt: z.ZodString;
|
|
11
|
+
updatedAt: z.ZodString;
|
|
12
|
+
}, z.core.$strip>;
|
|
13
|
+
export declare const listLooksResponseSchema: z.ZodObject<{
|
|
14
|
+
items: z.ZodArray<z.ZodObject<{
|
|
15
|
+
id: z.ZodString;
|
|
16
|
+
name: z.ZodString;
|
|
17
|
+
category: z.ZodString;
|
|
18
|
+
prompt: z.ZodString;
|
|
19
|
+
thumbnailUrl: z.ZodNullable<z.ZodString>;
|
|
20
|
+
sortOrder: z.ZodNumber;
|
|
21
|
+
isActive: z.ZodBoolean;
|
|
22
|
+
createdAt: z.ZodString;
|
|
23
|
+
updatedAt: z.ZodString;
|
|
24
|
+
}, z.core.$strip>>;
|
|
25
|
+
}, z.core.$strip>;
|
|
26
|
+
export declare const getLookResponseSchema: z.ZodObject<{
|
|
27
|
+
data: z.ZodObject<{
|
|
28
|
+
id: z.ZodString;
|
|
29
|
+
name: z.ZodString;
|
|
30
|
+
category: z.ZodString;
|
|
31
|
+
prompt: z.ZodString;
|
|
32
|
+
thumbnailUrl: z.ZodNullable<z.ZodString>;
|
|
33
|
+
sortOrder: z.ZodNumber;
|
|
34
|
+
isActive: z.ZodBoolean;
|
|
35
|
+
createdAt: z.ZodString;
|
|
36
|
+
updatedAt: z.ZodString;
|
|
37
|
+
}, z.core.$strip>;
|
|
38
|
+
}, z.core.$strip>;
|
|
39
|
+
export declare const adminCreateLookRequestSchema: z.ZodObject<{
|
|
40
|
+
name: z.ZodString;
|
|
41
|
+
category: z.ZodString;
|
|
42
|
+
prompt: z.ZodString;
|
|
43
|
+
sortOrder: z.ZodOptional<z.ZodNumber>;
|
|
44
|
+
isActive: z.ZodOptional<z.ZodBoolean>;
|
|
45
|
+
}, z.core.$strip>;
|
|
46
|
+
export declare const adminUpdateLookRequestSchema: z.ZodObject<{
|
|
47
|
+
name: z.ZodOptional<z.ZodString>;
|
|
48
|
+
category: z.ZodOptional<z.ZodString>;
|
|
49
|
+
prompt: z.ZodOptional<z.ZodString>;
|
|
50
|
+
sortOrder: z.ZodOptional<z.ZodOptional<z.ZodNumber>>;
|
|
51
|
+
isActive: z.ZodOptional<z.ZodOptional<z.ZodBoolean>>;
|
|
52
|
+
}, z.core.$strip>;
|
|
53
|
+
export declare const adminLookListResponseSchema: z.ZodObject<{
|
|
54
|
+
items: z.ZodArray<z.ZodObject<{
|
|
55
|
+
id: z.ZodString;
|
|
56
|
+
name: z.ZodString;
|
|
57
|
+
category: z.ZodString;
|
|
58
|
+
prompt: z.ZodString;
|
|
59
|
+
thumbnailUrl: z.ZodNullable<z.ZodString>;
|
|
60
|
+
sortOrder: z.ZodNumber;
|
|
61
|
+
isActive: z.ZodBoolean;
|
|
62
|
+
createdAt: z.ZodString;
|
|
63
|
+
updatedAt: z.ZodString;
|
|
64
|
+
}, z.core.$strip>>;
|
|
65
|
+
}, z.core.$strip>;
|
|
66
|
+
export declare const adminLookResponseSchema: z.ZodObject<{
|
|
67
|
+
data: z.ZodObject<{
|
|
68
|
+
id: z.ZodString;
|
|
69
|
+
name: z.ZodString;
|
|
70
|
+
category: z.ZodString;
|
|
71
|
+
prompt: z.ZodString;
|
|
72
|
+
thumbnailUrl: z.ZodNullable<z.ZodString>;
|
|
73
|
+
sortOrder: z.ZodNumber;
|
|
74
|
+
isActive: z.ZodBoolean;
|
|
75
|
+
createdAt: z.ZodString;
|
|
76
|
+
updatedAt: z.ZodString;
|
|
77
|
+
}, z.core.$strip>;
|
|
78
|
+
}, z.core.$strip>;
|
|
79
|
+
export declare const adminLookThumbnailUploadRequestSchema: z.ZodObject<{
|
|
80
|
+
imageBase64: z.ZodString;
|
|
81
|
+
contentType: z.ZodEnum<{
|
|
82
|
+
"image/png": "image/png";
|
|
83
|
+
"image/jpeg": "image/jpeg";
|
|
84
|
+
"image/webp": "image/webp";
|
|
85
|
+
}>;
|
|
86
|
+
}, z.core.$strip>;
|
|
87
|
+
export declare const adminLookTestRequestSchema: z.ZodObject<{
|
|
88
|
+
prompt: z.ZodString;
|
|
89
|
+
aspect: z.ZodOptional<z.ZodEnum<{
|
|
90
|
+
"16:9": "16:9";
|
|
91
|
+
"9:16": "9:16";
|
|
92
|
+
}>>;
|
|
93
|
+
}, z.core.$strip>;
|
|
94
|
+
export declare const adminLookTestResponseSchema: z.ZodObject<{
|
|
95
|
+
imageBase64: z.ZodString;
|
|
96
|
+
contentType: z.ZodString;
|
|
97
|
+
}, z.core.$strip>;
|
|
98
|
+
export type Look = z.infer<typeof lookSchema>;
|
|
99
|
+
export type ListLooksResponse = z.infer<typeof listLooksResponseSchema>;
|
|
100
|
+
export type GetLookResponse = z.infer<typeof getLookResponseSchema>;
|
|
101
|
+
export type AdminCreateLookRequest = z.input<typeof adminCreateLookRequestSchema>;
|
|
102
|
+
export type AdminUpdateLookRequest = z.infer<typeof adminUpdateLookRequestSchema>;
|
|
103
|
+
export type AdminLookListResponse = z.infer<typeof adminLookListResponseSchema>;
|
|
104
|
+
export type AdminLookResponse = z.infer<typeof adminLookResponseSchema>;
|
|
105
|
+
export type AdminLookThumbnailUploadRequest = z.input<typeof adminLookThumbnailUploadRequestSchema>;
|
|
106
|
+
export type AdminLookTestRequest = z.input<typeof adminLookTestRequestSchema>;
|
|
107
|
+
export type AdminLookTestResponse = z.infer<typ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CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAA;AACvE,MAAM,MAAM,+BAA+B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qCAAqC,CAAC,CAAA;AACnG,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,0BAA0B,CAAC,CAAA;AAC7E,MAAM,MAAM,qBAAqB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,2BAA2B,CAAC,CAAA"}
|
package/dist/looks.js
ADDED
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { apiSuccessSchema, idSchema, isoDateSchema } from './common.js';
|
|
3
|
+
// An admin-managed look prompt template for the looks page: a named, categorized
|
|
4
|
+
// prompt (plus optional thumbnail) users pick as a starting point for generation.
|
|
5
|
+
// `isActive` gates visibility on the public list; `sortOrder` orders it.
|
|
6
|
+
export const lookSchema = z.object({
|
|
7
|
+
id: idSchema,
|
|
8
|
+
name: z.string(),
|
|
9
|
+
category: z.string(),
|
|
10
|
+
prompt: z.string(),
|
|
11
|
+
thumbnailUrl: z.string().nullable(),
|
|
12
|
+
sortOrder: z.number().int(),
|
|
13
|
+
isActive: z.boolean(),
|
|
14
|
+
createdAt: isoDateSchema,
|
|
15
|
+
updatedAt: isoDateSchema
|
|
16
|
+
});
|
|
17
|
+
// Public list of ACTIVE looks for the web app's looks page. Small bounded list —
|
|
18
|
+
// bare `items`, no pagination (same convention as listAssetsResponseSchema).
|
|
19
|
+
export const listLooksResponseSchema = z.object({
|
|
20
|
+
items: z.array(lookSchema)
|
|
21
|
+
});
|
|
22
|
+
export const getLookResponseSchema = apiSuccessSchema(lookSchema);
|
|
23
|
+
export const adminCreateLookRequestSchema = z.object({
|
|
24
|
+
name: z.string().min(1).max(120),
|
|
25
|
+
category: z.string().min(1).max(60),
|
|
26
|
+
prompt: z.string().min(1).max(4000),
|
|
27
|
+
sortOrder: z.number().int().min(0).optional(),
|
|
28
|
+
isActive: z.boolean().optional()
|
|
29
|
+
});
|
|
30
|
+
export const adminUpdateLookRequestSchema = adminCreateLookRequestSchema
|
|
31
|
+
.partial()
|
|
32
|
+
.refine((patch) => Object.values(patch).some((value) => value !== undefined), {
|
|
33
|
+
message: 'Patch must change at least one field'
|
|
34
|
+
});
|
|
35
|
+
// Admin list of ALL looks, including inactive ones (the panel manages both).
|
|
36
|
+
export const adminLookListResponseSchema = z.object({
|
|
37
|
+
items: z.array(lookSchema)
|
|
38
|
+
});
|
|
39
|
+
// Echoes back the saved look so the panel can re-render without a refetch.
|
|
40
|
+
// Used by create, update, and the thumbnail upload.
|
|
41
|
+
export const adminLookResponseSchema = apiSuccessSchema(lookSchema);
|
|
42
|
+
export const adminLookThumbnailUploadRequestSchema = z.object({
|
|
43
|
+
imageBase64: z.string().min(1),
|
|
44
|
+
contentType: z.enum(['image/png', 'image/jpeg', 'image/webp'])
|
|
45
|
+
});
|
|
46
|
+
export const adminLookTestRequestSchema = z.object({
|
|
47
|
+
prompt: z.string().min(1).max(4000),
|
|
48
|
+
aspect: z.enum(['16:9', '9:16']).optional()
|
|
49
|
+
});
|
|
50
|
+
// Synchronous test-generation result: the rendered image inline as base64.
|
|
51
|
+
// Bare payload (no `data` envelope), like the unpaginated list responses.
|
|
52
|
+
export const adminLookTestResponseSchema = z.object({
|
|
53
|
+
imageBase64: z.string(),
|
|
54
|
+
contentType: z.string()
|
|
55
|
+
});
|