@anuragpal02/zcl-contracts 0.31.0 → 0.33.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/assets.d.ts CHANGED
@@ -1,6 +1,27 @@
1
1
  import { z } from 'zod';
2
+ /**
3
+ * ⚠️ WIDENING THIS ENUM IS A READER BREAK, NOT AN ADDITIVE CHANGE.
4
+ *
5
+ * `z.enum` REJECTS an unrecognised value — it does not strip it the way an object
6
+ * schema strips an unknown key. zcl-api parses its OWN outbound asset responses
7
+ * through `assetSchema`, so the moment a row with a new kind exists, every asset-list
8
+ * response containing it throws — on the API side, and on every client still pinned
9
+ * to the older contracts version.
10
+ *
11
+ * So any new member must be published and picked up by every reader BEFORE a row
12
+ * carrying it can be written. For `logo` that order was:
13
+ * 1. publish these contracts
14
+ * 2. bump + deploy zcl-web-next (so it can READ a logo row)
15
+ * 3. bump + deploy zcl-api (so it can EMIT one)
16
+ * 4. only then widen `media_assets_kind_check` and open the upload path
17
+ * Steps 2 and 3 are not interchangeable.
18
+ *
19
+ * (A caret on a 0.x range pins the MINOR, so `^0.31.0` never picks up 0.32.0 —
20
+ * both consumers need their range moved by hand.)
21
+ */
2
22
  export declare const assetKindSchema: z.ZodEnum<{
3
23
  reference: "reference";
24
+ logo: "logo";
4
25
  raw_image: "raw_image";
5
26
  display_image: "display_image";
6
27
  final_image: "final_image";
@@ -15,9 +36,25 @@ export declare const assetStatusSchema: z.ZodEnum<{
15
36
  pending_upload: "pending_upload";
16
37
  available: "available";
17
38
  }>;
39
+ /**
40
+ * The kinds a USER may upload. Every other member of `assetKindSchema` is produced by
41
+ * the pipeline and must never be settable from a request body.
42
+ *
43
+ * `logo` joins `reference` here for the Guidelines tab. A logo is reference-only —
44
+ * it is stored, associated with a guideline set and displayed, and is NEVER composed
45
+ * into any prompt.
46
+ */
18
47
  export declare const uploadableAssetKindSchema: z.ZodEnum<{
19
48
  reference: "reference";
49
+ logo: "logo";
20
50
  }>;
51
+ /**
52
+ * UNCHANGED by the logo work, deliberately. PNG carries an alpha channel, so a
53
+ * transparent logo needs no new content type at all. SVG is out of v1: it is not an
54
+ * inert image format (it can carry `<script>`, event handlers and external refs), so
55
+ * accepting it is a security decision with sanitisation work attached, not a
56
+ * content-type decision.
57
+ */
21
58
  export declare const assetContentTypeSchema: z.ZodEnum<{
22
59
  "image/png": "image/png";
23
60
  "image/jpeg": "image/jpeg";
@@ -31,6 +68,7 @@ export declare const assetSchema: z.ZodObject<{
31
68
  createdByUserId: z.ZodString;
32
69
  kind: z.ZodEnum<{
33
70
  reference: "reference";
71
+ logo: "logo";
34
72
  raw_image: "raw_image";
35
73
  display_image: "display_image";
36
74
  final_image: "final_image";
@@ -61,6 +99,7 @@ export declare const assetSchema: z.ZodObject<{
61
99
  export declare const createAssetUploadRequestSchema: z.ZodObject<{
62
100
  kind: z.ZodEnum<{
63
101
  reference: "reference";
102
+ logo: "logo";
64
103
  }>;
65
104
  filename: z.ZodString;
66
105
  contentType: z.ZodEnum<{
@@ -85,6 +124,7 @@ export declare const createAssetUploadResponseSchema: z.ZodObject<{
85
124
  createdByUserId: z.ZodString;
86
125
  kind: z.ZodEnum<{
87
126
  reference: "reference";
127
+ logo: "logo";
88
128
  raw_image: "raw_image";
89
129
  display_image: "display_image";
90
130
  final_image: "final_image";
@@ -131,6 +171,7 @@ export declare const listAssetsResponseSchema: z.ZodObject<{
131
171
  createdByUserId: z.ZodString;
132
172
  kind: z.ZodEnum<{
133
173
  reference: "reference";
174
+ logo: "logo";
134
175
  raw_image: "raw_image";
135
176
  display_image: "display_image";
136
177
  final_image: "final_image";
@@ -187,6 +228,7 @@ export declare const listWorkspaceAssetsResponseSchema: z.ZodObject<{
187
228
  createdByUserId: z.ZodString;
188
229
  kind: z.ZodEnum<{
189
230
  reference: "reference";
231
+ logo: "logo";
190
232
  raw_image: "raw_image";
191
233
  display_image: "display_image";
192
234
  final_image: "final_image";
@@ -221,6 +263,8 @@ export declare const listWorkspaceAssetsResponseSchema: z.ZodObject<{
221
263
  export type Asset = z.infer<typeof assetSchema>;
222
264
  export type AssetKind = z.infer<typeof assetKindSchema>;
223
265
  export type AssetStatus = z.infer<typeof assetStatusSchema>;
266
+ /** The kinds a user may upload — currently `reference` and `logo`. */
267
+ export type UploadableAssetKind = z.infer<typeof uploadableAssetKindSchema>;
224
268
  export type AssetUpload = z.infer<typeof assetUploadSchema>;
225
269
  export type CreateAssetUploadRequest = z.infer<typeof createAssetUploadRequestSchema>;
226
270
  export type CreateAssetUploadResponse = z.infer<typeof createAssetUploadResponseSchema>;
@@ -1 +1 @@
1
- {"version":3,"file":"assets.d.ts","sourceRoot":"","sources":["../src/assets.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAGvB,eAAO,MAAM,eAAe;;;;;;;;;EAS1B,CAAA;AAEF,eAAO,MAAM,iBAAiB;;;;;EAA+D,CAAA;AAC7F,eAAO,MAAM,yBAAyB;;EAAwB,CAAA;AAC9D,eAAO,MAAM,sBAAsB;;;;;EAAiE,CAAA;AAEpG,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAiBtB,CAAA;AAEF,eAAO,MAAM,8BAA8B;;;;;;;;;;;;iBAKzC,CAAA;AAEF,eAAO,MAAM,iBAAiB;;;;;iBAK5B,CAAA;AAEF,eAAO,MAAM,+BAA+B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAG1C,CAAA;AAEF,eAAO,MAAM,gCAAgC;;;iBAO3C,CAAA;AAEF,eAAO,MAAM,wBAAwB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAEnC,CAAA;AAEF;;;;;;;;;;GAUG;AACH,eAAO,MAAM,8BAA8B;;;;;;;;iBAIzC,CAAA;AAEF,eAAO,MAAM,iCAAiC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAK5C,CAAA;AAEF,MAA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,CAAA;AACzF,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAA;AACzE,MAAM,MAAM,wBAAwB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,8BAA8B,CAAC,CAAA;AACrF,MAAM,MAAM,2BAA2B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iCAAiC,CAAC,CAAA;AAC3F,MAAM,MAAM,oBAAoB,GAAG,wBAAwB,CAAC,QAAQ,CAAC,CAAA"}
package/dist/assets.js CHANGED
@@ -1,7 +1,28 @@
1
1
  import { z } from 'zod';
2
2
  import { idSchema, isoDateSchema } from './common.js';
3
+ /**
4
+ * ⚠️ WIDENING THIS ENUM IS A READER BREAK, NOT AN ADDITIVE CHANGE.
5
+ *
6
+ * `z.enum` REJECTS an unrecognised value — it does not strip it the way an object
7
+ * schema strips an unknown key. zcl-api parses its OWN outbound asset responses
8
+ * through `assetSchema`, so the moment a row with a new kind exists, every asset-list
9
+ * response containing it throws — on the API side, and on every client still pinned
10
+ * to the older contracts version.
11
+ *
12
+ * So any new member must be published and picked up by every reader BEFORE a row
13
+ * carrying it can be written. For `logo` that order was:
14
+ * 1. publish these contracts
15
+ * 2. bump + deploy zcl-web-next (so it can READ a logo row)
16
+ * 3. bump + deploy zcl-api (so it can EMIT one)
17
+ * 4. only then widen `media_assets_kind_check` and open the upload path
18
+ * Steps 2 and 3 are not interchangeable.
19
+ *
20
+ * (A caret on a 0.x range pins the MINOR, so `^0.31.0` never picks up 0.32.0 —
21
+ * both consumers need their range moved by hand.)
22
+ */
3
23
  export const assetKindSchema = z.enum([
4
24
  'reference',
25
+ 'logo',
5
26
  'raw_image',
6
27
  'display_image',
7
28
  'final_image',
@@ -11,7 +32,22 @@ export const assetKindSchema = z.enum([
11
32
  'export'
12
33
  ]);
13
34
  export const assetStatusSchema = z.enum(['pending_upload', 'available', 'failed', 'deleted']);
14
- export const uploadableAssetKindSchema = z.enum(['reference']);
35
+ /**
36
+ * The kinds a USER may upload. Every other member of `assetKindSchema` is produced by
37
+ * the pipeline and must never be settable from a request body.
38
+ *
39
+ * `logo` joins `reference` here for the Guidelines tab. A logo is reference-only —
40
+ * it is stored, associated with a guideline set and displayed, and is NEVER composed
41
+ * into any prompt.
42
+ */
43
+ export const uploadableAssetKindSchema = z.enum(['reference', 'logo']);
44
+ /**
45
+ * UNCHANGED by the logo work, deliberately. PNG carries an alpha channel, so a
46
+ * transparent logo needs no new content type at all. SVG is out of v1: it is not an
47
+ * inert image format (it can carry `<script>`, event handlers and external refs), so
48
+ * accepting it is a security decision with sanitisation work attached, not a
49
+ * content-type decision.
50
+ */
15
51
  export const assetContentTypeSchema = z.enum(['image/png', 'image/jpeg', 'image/webp', 'video/mp4']);
16
52
  export const assetSchema = z.object({
17
53
  id: idSchema,
package/dist/client.d.ts CHANGED
@@ -5,9 +5,11 @@ import { type CreditBalanceResponse } from './credits.js';
5
5
  import { workspaceMemberSchema, type CreateWorkspaceRequest, type InviteMemberRequest, type InviteMemberResponse, type ListMembersResponse, type UpdateMemberRoleRequest, type UpdateWorkspaceRequest, type Workspace, type WorkspaceMembership } from './workspaces.js';
6
6
  import { type Asset, type AssetUpload, type CreateAssetUploadRequest, type CreateAssetUploadResponse, type FinalizeAssetUploadRequest, type ListAssetsResponse, type ListWorkspaceAssetsResponse, type WorkspaceAssetFilter } from './assets.js';
7
7
  import { projectRunListResponseSchema, projectRunResponseSchema, type CreateLedMapRequest, type CreateProjectRequest, type CreateProjectRunRequest, type LedMapListResponse, type LedMapResponse, type LedMapUpdateResponse, type LedMapUsageResponse, type ListLedMapsQuery, type ListProjectRunsQuery, type ListProjectsQuery, type Project, type UpdateLedMapMetadataRequest, type UpdateLedMapRequest, type UpdateProjectRequest, type UpdateProjectRunRequest } from './projects.js';
8
+ import { guidelineSetListResponseSchema, guidelineSetResponseSchema, type AttachGuidelineSetLogoRequest, type CreateGuidelineSetRequest, type GuidelineSetLogoListResponse, type GuidelineSetLogoResponse, type UpdateGuidelineSetRequest } from './guidelines.js';
8
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';
9
10
  import { type DescribeImageRequest, type DescribeImageResponse } from './assistant.js';
10
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';
11
13
  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';
12
14
  type FetchLike = (request: Request) => Promise<Response>;
13
15
  export type ZclApiClientOptions = {
@@ -99,6 +101,26 @@ export declare function createZclApiClient(options: ZclApiClientOptions): {
99
101
  create(workspaceId: string, projectId: string, input: CreateProjectRunRequest): Promise<z.infer<typeof projectRunResponseSchema>>;
100
102
  update(workspaceId: string, projectId: string, runId: string, input: UpdateProjectRunRequest): Promise<z.infer<typeof projectRunResponseSchema>>;
101
103
  };
104
+ /**
105
+ * Guideline sets. Project-nested on purpose — there is deliberately NO bare
106
+ * `/guideline-sets/:id` upstream, because the (workspace, project) pair in the path
107
+ * is what the server authorizes against AND re-filters the row on. A top-level route
108
+ * would have only the set id to go on.
109
+ *
110
+ * There is no `remove`: v1 has no DELETE for a set (a set referenced by creations has
111
+ * nowhere safe to go). `detachLogo` below deletes an ASSOCIATION row, never an asset.
112
+ */
113
+ guidelineSets: {
114
+ list(workspaceId: string, projectId: string): Promise<z.infer<typeof guidelineSetListResponseSchema>>;
115
+ get(workspaceId: string, projectId: string, setId: string): Promise<z.infer<typeof guidelineSetResponseSchema>>;
116
+ create(workspaceId: string, projectId: string, input: CreateGuidelineSetRequest): Promise<z.infer<typeof guidelineSetResponseSchema>>;
117
+ update(workspaceId: string, projectId: string, setId: string, input: UpdateGuidelineSetRequest): Promise<z.infer<typeof guidelineSetResponseSchema>>;
118
+ listLogos(workspaceId: string, projectId: string, setId: string): Promise<GuidelineSetLogoListResponse>;
119
+ attachLogo(workspaceId: string, projectId: string, setId: string, input: AttachGuidelineSetLogoRequest): Promise<GuidelineSetLogoResponse>;
120
+ detachLogo(workspaceId: string, projectId: string, setId: string, assetId: string): Promise<{
121
+ data: Record<string, never>;
122
+ }>;
123
+ };
102
124
  assets: {
103
125
  createUpload(workspaceId: string, projectId: string, input: CreateAssetUploadRequest): Promise<CreateAssetUploadResponse>;
104
126
  uploadObject(upload: AssetUpload, body: BodyInit): Promise<void>;
@@ -118,6 +140,14 @@ export declare function createZclApiClient(options: ZclApiClientOptions): {
118
140
  getJob(workspaceId: string, jobId: string): Promise<LoopToolJobResponse>;
119
141
  contentUrl(workspaceId: string, assetId: string): string;
120
142
  };
143
+ frameIterator: {
144
+ uploadReference(workspaceId: string, file: Blob, filename: string): Promise<FrameReferenceUpload>;
145
+ createBatch(workspaceId: string, input: CreateFrameBatchRequest, idempotencyKey: string): Promise<FrameBatch>;
146
+ getBatch(workspaceId: string, batchId: string): Promise<FrameBatch>;
147
+ listFrames(workspaceId: string, options?: ListFramesQuery): Promise<ListFramesResponse>;
148
+ download(workspaceId: string, iterationId: string, variant: FrameVariant): Promise<Response>;
149
+ delete(workspaceId: string, iterationId: string): Promise<DeleteFrameResponse>;
150
+ };
121
151
  credits: {
122
152
  get(workspaceId: string): Promise<CreditBalanceResponse>;
123
153
  };
@@ -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,EACzB,KAAK,mBAAmB,EACxB,KAAK,uBAAuB,EAC5B,KAAK,sBAAsB,EAC3B,KAAK,SAAS,EACd,KAAK,mBAAmB,EACzB,MAAM,iBAAiB,CAAA;AACxB,OAAO,EAOL,KAAK,KAAK,EACV,KAAK,WAAW,EAChB,KAAK,wBAAwB,EAC7B,KAAK,yBAAyB,EAC9B,KAAK,0BAA0B,EAC/B,KAAK,kBAAkB,EACvB,KAAK,2BAA2B,EAChC,KAAK,oBAAoB,EAC1B,MAAM,aAAa,CAAA;AACpB,OAAO,EAQL,4BAA4B,EAC5B,wBAAwB,EAMxB,KAAK,mBAAmB,EACxB,KAAK,oBAAoB,EACzB,KAAK,uBAAuB,EAC5B,KAAK,kBAAkB,EACvB,KAAK,cAAc,EACnB,KAAK,oBAAoB,EACzB,KAAK,mBAAmB,EACxB,KAAK,gBAAgB,EACrB,KAAK,oBAAoB,EACzB,KAAK,iBAAiB,EACtB,KAAK,OAAO,EACZ,KAAK,2BAA2B,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YAAE,UAAU,CAAC,EAAE,MAAM,CAAA;SAAE,GAAQ,OAAO,CAAC,kBAAkB,CAAC;;qBASjE,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
@@ -5,9 +5,11 @@ import { creditBalanceResponseSchema } from './credits.js';
5
5
  import { createWorkspaceRequestSchema, inviteMemberRequestSchema, inviteMemberResponseSchema, listMembersResponseSchema, updateMemberRoleRequestSchema, updateWorkspaceRequestSchema, workspaceMemberSchema, workspaceMembershipSchema, workspaceResponseSchema, workspaceSchema } from './workspaces.js';
6
6
  import { assetSchema, createAssetUploadRequestSchema, createAssetUploadResponseSchema, finalizeAssetUploadRequestSchema, listAssetsResponseSchema, listWorkspaceAssetsResponseSchema } from './assets.js';
7
7
  import { createLedMapRequestSchema, createProjectRequestSchema, createProjectRunRequestSchema, ledMapListResponseSchema, ledMapResponseSchema, ledMapUpdateResponseSchema, ledMapUsageResponseSchema, projectRunListResponseSchema, projectRunResponseSchema, projectSchema, updateLedMapMetadataRequestSchema, updateLedMapRequestSchema, updateProjectRequestSchema, updateProjectRunRequestSchema } from './projects.js';
8
+ import { attachGuidelineSetLogoRequestSchema, createGuidelineSetRequestSchema, guidelineSetListResponseSchema, guidelineSetLogoListResponseSchema, guidelineSetLogoResponseSchema, guidelineSetResponseSchema, updateGuidelineSetRequestSchema } from './guidelines.js';
8
9
  import { createGenerationJobRequestSchema, createPanelSetRequestSchema, createPanelSetResponseSchema, createSmartVideoRequestSchema, createSmartVideoResponseSchema, createVideoLoopRequestSchema, createVideoUpscaleRequestSchema, editGenerationJobRequestSchema, generationJobResponseSchema, listGenerationJobsResponseSchema } from './generation.js';
9
10
  import { describeImageRequestSchema, describeImageResponseSchema } from './assistant.js';
10
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';
11
13
  import { adminAdjustCreditsRequestSchema, adminAdjustCreditsResponseSchema, adminJobDetailResponseSchema, adminMeResponseSchema, adminUsageResponseSchema, adminUserDetailResponseSchema, adminWorkspaceDetailResponseSchema, listAdminAuditResponseSchema, listAdminJobsResponseSchema, listAdminUsersResponseSchema, listAdminWorkspacesResponseSchema, setPlatformAdminRequestSchema, setPlatformAdminResponseSchema, setUserDisabledRequestSchema, setUserDisabledResponseSchema, stepUpStartResponseSchema, stepUpVerifyRequestSchema, stepUpVerifyResponseSchema } from './admin.js';
12
14
  const workspaceListResponseSchema = listResponseSchema(workspaceSchema.extend({
13
15
  membership: workspaceMembershipSchema
@@ -79,6 +81,41 @@ export function createZclApiClient(options) {
79
81
  }
80
82
  return parseResponse(schema, responseBody, response.status);
81
83
  }
84
+ async function requestFormData(path, schema, formData, init = {}) {
85
+ const headers = new Headers(init.headers);
86
+ const method = (init.method ?? 'POST').toUpperCase();
87
+ if (method !== 'GET' && method !== 'HEAD') {
88
+ headers.set('x-zcl-csrf', '1');
89
+ }
90
+ const response = await fetcher(new Request(joinUrl(options.baseUrl, path), {
91
+ ...init,
92
+ method,
93
+ headers,
94
+ body: formData,
95
+ credentials: 'include'
96
+ }));
97
+ const responseBody = await readJson(response);
98
+ if (!response.ok) {
99
+ const error = errorResponseSchema.safeParse(responseBody);
100
+ if (error.success) {
101
+ throw new ZclApiError(error.data.error.code, error.data.error.message, response.status, error.data.error.requestId);
102
+ }
103
+ throw new ZclApiError('internal_error', 'API request failed', response.status);
104
+ }
105
+ return parseResponse(schema, responseBody, response.status);
106
+ }
107
+ async function requestDownload(path) {
108
+ const response = await fetcher(new Request(joinUrl(options.baseUrl, path), { credentials: 'include' }));
109
+ if (response.ok) {
110
+ return response;
111
+ }
112
+ const responseBody = await readJson(response);
113
+ const error = errorResponseSchema.safeParse(responseBody);
114
+ if (error.success) {
115
+ throw new ZclApiError(error.data.error.code, error.data.error.message, response.status, error.data.error.requestId);
116
+ }
117
+ throw new ZclApiError('internal_error', 'API request failed', response.status);
118
+ }
82
119
  return {
83
120
  auth: {
84
121
  signup(input) {
@@ -294,6 +331,44 @@ export function createZclApiClient(options) {
294
331
  });
295
332
  }
296
333
  },
334
+ /**
335
+ * Guideline sets. Project-nested on purpose — there is deliberately NO bare
336
+ * `/guideline-sets/:id` upstream, because the (workspace, project) pair in the path
337
+ * is what the server authorizes against AND re-filters the row on. A top-level route
338
+ * would have only the set id to go on.
339
+ *
340
+ * There is no `remove`: v1 has no DELETE for a set (a set referenced by creations has
341
+ * nowhere safe to go). `detachLogo` below deletes an ASSOCIATION row, never an asset.
342
+ */
343
+ guidelineSets: {
344
+ list(workspaceId, projectId) {
345
+ return request(`/workspaces/${workspaceId}/projects/${projectId}/guideline-sets`, guidelineSetListResponseSchema);
346
+ },
347
+ get(workspaceId, projectId, setId) {
348
+ return request(`/workspaces/${workspaceId}/projects/${projectId}/guideline-sets/${setId}`, guidelineSetResponseSchema);
349
+ },
350
+ create(workspaceId, projectId, input) {
351
+ return request(`/workspaces/${workspaceId}/projects/${projectId}/guideline-sets`, guidelineSetResponseSchema, { method: 'POST', body: createGuidelineSetRequestSchema.parse(input) });
352
+ },
353
+ // `expectedRevision` is a real compare-and-set in the UPDATE's own WHERE clause
354
+ // upstream, and a lost race comes back as a 409. Parsing the body here is what makes
355
+ // a no-op patch fail locally instead of costing a round-trip and a revision bump.
356
+ update(workspaceId, projectId, setId, input) {
357
+ return request(`/workspaces/${workspaceId}/projects/${projectId}/guideline-sets/${setId}`, guidelineSetResponseSchema, { method: 'PATCH', body: updateGuidelineSetRequestSchema.parse(input) });
358
+ },
359
+ // ── Logos: reference-only. Nothing here reaches the image model. ──
360
+ listLogos(workspaceId, projectId, setId) {
361
+ return request(`/workspaces/${workspaceId}/projects/${projectId}/guideline-sets/${setId}/logos`, guidelineSetLogoListResponseSchema);
362
+ },
363
+ attachLogo(workspaceId, projectId, setId, input) {
364
+ return request(`/workspaces/${workspaceId}/projects/${projectId}/guideline-sets/${setId}/logos`, guidelineSetLogoResponseSchema, { method: 'POST', body: attachGuidelineSetLogoRequestSchema.parse(input) });
365
+ },
366
+ // Deletes the ASSOCIATION, not the asset. The asset keeps its own lifecycle so a
367
+ // logo shared by two sets cannot be destroyed by detaching it from one of them.
368
+ detachLogo(workspaceId, projectId, setId, assetId) {
369
+ return request(`/workspaces/${workspaceId}/projects/${projectId}/guideline-sets/${setId}/logos/${assetId}`, z.object({ data: z.object({}) }), { method: 'DELETE' });
370
+ }
371
+ },
297
372
  assets: {
298
373
  createUpload(workspaceId, projectId, input) {
299
374
  return request(`/workspaces/${workspaceId}/projects/${projectId}/assets/uploads`, createAssetUploadResponseSchema, {
@@ -363,6 +438,43 @@ export function createZclApiClient(options) {
363
438
  return joinUrl(options.baseUrl, `/workspaces/${workspaceId}/tools/loop/assets/${assetId}/content`);
364
439
  }
365
440
  },
441
+ frameIterator: {
442
+ uploadReference(workspaceId, file, filename) {
443
+ const formData = new FormData();
444
+ formData.append('file', file, filename);
445
+ return requestFormData(`/workspaces/${workspaceId}/tools/frame-iterator/references`, frameReferenceUploadSchema, formData, { method: 'POST' });
446
+ },
447
+ createBatch(workspaceId, input, idempotencyKey) {
448
+ return request(`/workspaces/${workspaceId}/tools/frame-iterator/batches`, frameBatchSchema, {
449
+ method: 'POST',
450
+ headers: { 'idempotency-key': idempotencyKey },
451
+ body: createFrameBatchRequestSchema.parse(input)
452
+ });
453
+ },
454
+ getBatch(workspaceId, batchId) {
455
+ return request(`/workspaces/${workspaceId}/tools/frame-iterator/batches/${batchId}`, frameBatchSchema);
456
+ },
457
+ listFrames(workspaceId, options = {}) {
458
+ const queryOptions = listFramesQuerySchema.parse(options);
459
+ const params = new URLSearchParams();
460
+ if (queryOptions.limit !== undefined) {
461
+ params.set('limit', String(queryOptions.limit));
462
+ }
463
+ if (queryOptions.cursor !== undefined) {
464
+ params.set('cursor', queryOptions.cursor);
465
+ }
466
+ const query = params.toString() ? `?${params.toString()}` : '';
467
+ return request(`/workspaces/${workspaceId}/tools/frame-iterator/frames${query}`, listFramesResponseSchema);
468
+ },
469
+ download(workspaceId, iterationId, variant) {
470
+ return requestDownload(`/workspaces/${workspaceId}/tools/frame-iterator/frames/${iterationId}/${frameVariantSchema.parse(variant)}`);
471
+ },
472
+ delete(workspaceId, iterationId) {
473
+ return request(`/workspaces/${workspaceId}/tools/frame-iterator/frames/${iterationId}`, deleteFrameResponseSchema, {
474
+ method: 'DELETE'
475
+ });
476
+ }
477
+ },
366
478
  credits: {
367
479
  get(workspaceId) {
368
480
  return request(`/workspaces/${workspaceId}/credits`, creditBalanceResponseSchema);
@@ -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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAM/B,CAAA;AAEX,eAAO,MAAM,0BAA0B;;;;;;;;;;;;;kBAa5B,CAAA;AAIX,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAuE7B,CAAA;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AAO,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();
@@ -75,7 +75,106 @@ export declare const guidelineSetListResponseSchema: z.ZodObject<{
75
75
  nextCursor: z.ZodNullable<z.ZodString>;
76
76
  }, z.core.$strip>;
77
77
  }, z.core.$strip>;
78
+ /**
79
+ * ⚠️ A LOGO IS NEVER SENT TO THE MODEL.
80
+ *
81
+ * Nothing above this line changes because of logos, and nothing in the prompt
82
+ * composer reads them. They live in the guideline set because that is where a brand
83
+ * lives for a human, not because they steer generation — the Guidelines tab shows
84
+ * them under "Reference only — not sent to the model" for exactly that reason.
85
+ *
86
+ * A logo is an ordinary `media_assets` row of kind `logo`, uploaded through the
87
+ * unchanged three-step upload flow and then ASSOCIATED with a set. The association
88
+ * is a join row, so one set can hold several logos (primary, reversed, mono) and
89
+ * detaching one never destroys the asset.
90
+ */
91
+ export declare const guidelineSetLogoListResponseSchema: z.ZodObject<{
92
+ items: z.ZodArray<z.ZodObject<{
93
+ id: z.ZodString;
94
+ workspaceId: z.ZodString;
95
+ projectId: z.ZodString;
96
+ createdByUserId: z.ZodString;
97
+ kind: z.ZodEnum<{
98
+ reference: "reference";
99
+ logo: "logo";
100
+ raw_image: "raw_image";
101
+ display_image: "display_image";
102
+ final_image: "final_image";
103
+ video_preview: "video_preview";
104
+ video_final: "video_final";
105
+ panel_video: "panel_video";
106
+ export: "export";
107
+ }>;
108
+ status: z.ZodEnum<{
109
+ deleted: "deleted";
110
+ failed: "failed";
111
+ pending_upload: "pending_upload";
112
+ available: "available";
113
+ }>;
114
+ contentType: z.ZodEnum<{
115
+ "image/png": "image/png";
116
+ "image/jpeg": "image/jpeg";
117
+ "image/webp": "image/webp";
118
+ "video/mp4": "video/mp4";
119
+ }>;
120
+ byteSize: z.ZodNullable<z.ZodNumber>;
121
+ checksumSha256: z.ZodNullable<z.ZodString>;
122
+ originalFilename: z.ZodNullable<z.ZodString>;
123
+ r2Key: z.ZodString;
124
+ createdAt: z.ZodString;
125
+ updatedAt: z.ZodString;
126
+ }, z.core.$strip>>;
127
+ }, z.core.$strip>;
128
+ /**
129
+ * Attach by asset id and nothing else. The workspace and project come from the URL
130
+ * the caller was already authorized against; a body-supplied tenant would be a second
131
+ * source of truth for the predicate that is the whole security story here, so any
132
+ * such key is stripped rather than honoured.
133
+ */
134
+ export declare const attachGuidelineSetLogoRequestSchema: z.ZodObject<{
135
+ assetId: z.ZodString;
136
+ }, z.core.$strip>;
137
+ export declare const guidelineSetLogoResponseSchema: z.ZodObject<{
138
+ data: z.ZodObject<{
139
+ id: z.ZodString;
140
+ workspaceId: z.ZodString;
141
+ projectId: z.ZodString;
142
+ createdByUserId: z.ZodString;
143
+ kind: z.ZodEnum<{
144
+ reference: "reference";
145
+ logo: "logo";
146
+ raw_image: "raw_image";
147
+ display_image: "display_image";
148
+ final_image: "final_image";
149
+ video_preview: "video_preview";
150
+ video_final: "video_final";
151
+ panel_video: "panel_video";
152
+ export: "export";
153
+ }>;
154
+ status: z.ZodEnum<{
155
+ deleted: "deleted";
156
+ failed: "failed";
157
+ pending_upload: "pending_upload";
158
+ available: "available";
159
+ }>;
160
+ contentType: z.ZodEnum<{
161
+ "image/png": "image/png";
162
+ "image/jpeg": "image/jpeg";
163
+ "image/webp": "image/webp";
164
+ "video/mp4": "video/mp4";
165
+ }>;
166
+ byteSize: z.ZodNullable<z.ZodNumber>;
167
+ checksumSha256: z.ZodNullable<z.ZodString>;
168
+ originalFilename: z.ZodNullable<z.ZodString>;
169
+ r2Key: z.ZodString;
170
+ createdAt: z.ZodString;
171
+ updatedAt: z.ZodString;
172
+ }, z.core.$strip>;
173
+ }, z.core.$strip>;
78
174
  export type GuidelineSet = z.infer<typeof guidelineSetSchema>;
79
175
  export type CreateGuidelineSetRequest = z.input<typeof createGuidelineSetRequestSchema>;
80
176
  export type UpdateGuidelineSetRequest = z.infer<typeof updateGuidelineSetRequestSchema>;
177
+ export type GuidelineSetLogoListResponse = z.infer<typeof guidelineSetLogoListResponseSchema>;
178
+ export type AttachGuidelineSetLogoRequest = z.infer<typeof attachGuidelineSetLogoRequestSchema>;
179
+ export type GuidelineSetLogoResponse = z.infer<typeof guidelineSetLogoResponseSchema>;
81
180
  //# sourceMappingURL=guidelines.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"guidelines.d.ts","sourceRoot":"","sources":["../src/guidelines.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAGvB;;;;;GAKG;AACH,eAAO,MAAM,2BAA2B,MAAM,CAAA;AAI9C,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;iBAgB7B,CAAA;AAEF,eAAO,MAAM,+BAA+B;;;;;;;iBAO1C,CAAA;AAEF,eAAO,MAAM,+BAA+B;;;;;;;;iBAMzC,CAAA;AAEH,eAAO,MAAM,0BAA0B;;;;;;;;;;;;;;;;iBAAuC,CAAA;AAC9E,eAAO,MAAM,8BAA8B;;;;;;;;;;;;;;;;;;;iBAAyC,CAAA;AAEpF,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAA;AAC7D,MAAM,MAAM,yBAAyB,GAAG,CAAC,CAAC,KAAK,C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AAA;AAC/F,MAAM,MAAM,wBAAwB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,8BAA8B,CAAC,CAAA"}
@@ -1,4 +1,5 @@
1
1
  import { z } from 'zod';
2
+ import { assetSchema } from './assets.js';
2
3
  import { apiSuccessSchema, idSchema, isoDateSchema, listResponseSchema } from './common.js';
3
4
  /**
4
5
  * Hard cap on the free text that is appended to EVERY generation in a project.
@@ -11,7 +12,15 @@ const hexColorSchema = z.string().regex(/^#[0-9a-fA-F]{6}$/, 'Colour must be a #
11
12
  export const guidelineSetSchema = z.object({
12
13
  id: idSchema,
13
14
  workspaceId: idSchema,
14
- /** Exactly one of projectId / workspace-level is set; workspace-level lands later. */
15
+ /**
16
+ * A set is ALWAYS workspace-scoped and OPTIONALLY also project-scoped.
17
+ *
18
+ * (An earlier version of this comment said "exactly one of projectId /
19
+ * workspace-level is set". The schema never implemented that: `workspace_id` is
20
+ * NOT NULL and `project_id` is nullable, with no exactly-one CHECK, so the two
21
+ * COEXIST. `projectId === null` means a workspace-level default — not built in v1,
22
+ * which is what keeps workspace/project precedence genuinely deferred.)
23
+ */
15
24
  projectId: idSchema.nullable().default(null),
16
25
  createdByUserId: idSchema,
17
26
  name: z.string().min(1),
@@ -39,3 +48,32 @@ export const updateGuidelineSetRequestSchema = createGuidelineSetRequestSchema
39
48
  .refine((patch) => Object.entries(patch).some(([key, value]) => key !== 'expectedRevision' && value !== undefined), { message: 'Patch must change at least one field' });
40
49
  export const guidelineSetResponseSchema = apiSuccessSchema(guidelineSetSchema);
41
50
  export const guidelineSetListResponseSchema = listResponseSchema(guidelineSetSchema);
51
+ // ---------------------------------------------------------------------------
52
+ // Logos — storage, association and display ONLY
53
+ // ---------------------------------------------------------------------------
54
+ /**
55
+ * ⚠️ A LOGO IS NEVER SENT TO THE MODEL.
56
+ *
57
+ * Nothing above this line changes because of logos, and nothing in the prompt
58
+ * composer reads them. They live in the guideline set because that is where a brand
59
+ * lives for a human, not because they steer generation — the Guidelines tab shows
60
+ * them under "Reference only — not sent to the model" for exactly that reason.
61
+ *
62
+ * A logo is an ordinary `media_assets` row of kind `logo`, uploaded through the
63
+ * unchanged three-step upload flow and then ASSOCIATED with a set. The association
64
+ * is a join row, so one set can hold several logos (primary, reversed, mono) and
65
+ * detaching one never destroys the asset.
66
+ */
67
+ export const guidelineSetLogoListResponseSchema = z.object({
68
+ items: z.array(assetSchema)
69
+ });
70
+ /**
71
+ * Attach by asset id and nothing else. The workspace and project come from the URL
72
+ * the caller was already authorized against; a body-supplied tenant would be a second
73
+ * source of truth for the predicate that is the whole security story here, so any
74
+ * such key is stripped rather than honoured.
75
+ */
76
+ export const attachGuidelineSetLogoRequestSchema = z.object({
77
+ assetId: idSchema
78
+ });
79
+ export const guidelineSetLogoResponseSchema = apiSuccessSchema(assetSchema);
package/dist/index.d.ts CHANGED
@@ -5,6 +5,7 @@ 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';
10
11
  export * from './loop-tools.js';
@@ -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,iBAAiB,CAAA;AAC/B,cAAc,eAAe,CAAA;AAC7B,cAAc,iBAAiB,CAAA"}
package/dist/index.js CHANGED
@@ -5,6 +5,7 @@ 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';
10
11
  export * from './loop-tools.js';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@anuragpal02/zcl-contracts",
3
- "version": "0.31.0",
3
+ "version": "0.33.0",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",