@anuragpal02/zcl-contracts 0.28.0 → 0.30.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 +9 -2
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +42 -2
- package/dist/generation.d.ts +95 -0
- package/dist/generation.d.ts.map +1 -1
- package/dist/generation.js +59 -1
- package/dist/projects.d.ts +260 -0
- package/dist/projects.d.ts.map +1 -1
- package/dist/projects.js +170 -1
- package/package.json +1 -1
package/dist/client.d.ts
CHANGED
|
@@ -4,7 +4,7 @@ import { type ApiErrorCode } from './common.js';
|
|
|
4
4
|
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
|
-
import { projectRunListResponseSchema, projectRunResponseSchema, type CreateProjectRequest, type CreateProjectRunRequest, type LedMapResponse, type ListProjectRunsQuery, type ListProjectsQuery, type Project, type UpdateLedMapRequest, type UpdateProjectRequest, type UpdateProjectRunRequest } from './projects.js';
|
|
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
8
|
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
9
|
import { type DescribeImageRequest, type DescribeImageResponse } from './assistant.js';
|
|
10
10
|
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';
|
|
@@ -82,8 +82,15 @@ export declare function createZclApiClient(options: ZclApiClientOptions): {
|
|
|
82
82
|
ledMaps: {
|
|
83
83
|
get(workspaceId: string, projectId: string): Promise<LedMapResponse>;
|
|
84
84
|
update(workspaceId: string, projectId: string, input: UpdateLedMapRequest): Promise<LedMapResponse>;
|
|
85
|
+
list(workspaceId: string, projectId: string, query?: ListLedMapsQuery): Promise<LedMapListResponse>;
|
|
86
|
+
create(workspaceId: string, projectId: string, input?: CreateLedMapRequest): Promise<LedMapResponse>;
|
|
85
87
|
getById(workspaceId: string, projectId: string, ledMapId: string): Promise<LedMapResponse>;
|
|
86
|
-
updateById(workspaceId: string, projectId: string, ledMapId: string, input: UpdateLedMapRequest): Promise<
|
|
88
|
+
updateById(workspaceId: string, projectId: string, ledMapId: string, input: UpdateLedMapRequest): Promise<LedMapUpdateResponse>;
|
|
89
|
+
usage(workspaceId: string, projectId: string, ledMapId: string): Promise<LedMapUsageResponse>;
|
|
90
|
+
updateMetadata(workspaceId: string, projectId: string, ledMapId: string, input: UpdateLedMapMetadataRequest): Promise<LedMapResponse>;
|
|
91
|
+
remove(workspaceId: string, projectId: string, ledMapId: string): Promise<{
|
|
92
|
+
data: Record<string, never>;
|
|
93
|
+
}>;
|
|
87
94
|
};
|
|
88
95
|
runs: {
|
|
89
96
|
list(workspaceId: string, projectId: string, query?: ListProjectRunsQuery): Promise<z.infer<typeof projectRunListResponseSchema>>;
|
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,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,
|
|
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,2BA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BvB;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;;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
|
@@ -4,7 +4,7 @@ import { errorResponseSchema, listResponseSchema } from './common.js';
|
|
|
4
4
|
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
|
-
import { createProjectRequestSchema, createProjectRunRequestSchema, ledMapResponseSchema, projectRunListResponseSchema, projectRunResponseSchema, projectSchema, updateLedMapRequestSchema, updateProjectRequestSchema, updateProjectRunRequestSchema } from './projects.js';
|
|
7
|
+
import { createLedMapRequestSchema, createProjectRequestSchema, createProjectRunRequestSchema, ledMapListResponseSchema, ledMapResponseSchema, ledMapUpdateResponseSchema, ledMapUsageResponseSchema, projectRunListResponseSchema, projectRunResponseSchema, projectSchema, updateLedMapMetadataRequestSchema, updateLedMapRequestSchema, updateProjectRequestSchema, updateProjectRunRequestSchema } from './projects.js';
|
|
8
8
|
import { createGenerationJobRequestSchema, createPanelSetRequestSchema, createPanelSetResponseSchema, createSmartVideoRequestSchema, createSmartVideoResponseSchema, createVideoLoopRequestSchema, createVideoUpscaleRequestSchema, editGenerationJobRequestSchema, generationJobResponseSchema, listGenerationJobsResponseSchema } from './generation.js';
|
|
9
9
|
import { describeImageRequestSchema, describeImageResponseSchema } from './assistant.js';
|
|
10
10
|
import { adminAdjustCreditsRequestSchema, adminAdjustCreditsResponseSchema, adminJobDetailResponseSchema, adminMeResponseSchema, adminUsageResponseSchema, adminUserDetailResponseSchema, adminWorkspaceDetailResponseSchema, listAdminAuditResponseSchema, listAdminJobsResponseSchema, listAdminUsersResponseSchema, listAdminWorkspacesResponseSchema, setPlatformAdminRequestSchema, setPlatformAdminResponseSchema, setUserDisabledRequestSchema, setUserDisabledResponseSchema, stepUpStartResponseSchema, stepUpVerifyRequestSchema, stepUpVerifyResponseSchema } from './admin.js';
|
|
@@ -207,19 +207,59 @@ export function createZclApiClient(options) {
|
|
|
207
207
|
get(workspaceId, projectId) {
|
|
208
208
|
return request(`/workspaces/${workspaceId}/projects/${projectId}/led-map`, ledMapResponseSchema);
|
|
209
209
|
},
|
|
210
|
+
// The project-level alias. Legacy: it resolves to the project's OLDEST map, which is
|
|
211
|
+
// how two creations end up silently editing one row. Phase B removes the need for it —
|
|
212
|
+
// prefer the by-id methods below. Its response stays on ledMapResponseSchema because
|
|
213
|
+
// the alias cannot branch (it has no creation to repoint).
|
|
210
214
|
update(workspaceId, projectId, input) {
|
|
211
215
|
return request(`/workspaces/${workspaceId}/projects/${projectId}/led-map`, ledMapResponseSchema, {
|
|
212
216
|
method: 'PATCH',
|
|
213
217
|
body: updateLedMapRequestSchema.parse(input)
|
|
214
218
|
});
|
|
215
219
|
},
|
|
220
|
+
// The project's maps, for the picker and the library listing. Keyset-paginated.
|
|
221
|
+
list(workspaceId, projectId, query = {}) {
|
|
222
|
+
const params = new URLSearchParams();
|
|
223
|
+
if (query.cursor !== undefined) {
|
|
224
|
+
params.set('cursor', query.cursor);
|
|
225
|
+
}
|
|
226
|
+
if (query.limit !== undefined) {
|
|
227
|
+
params.set('limit', String(query.limit));
|
|
228
|
+
}
|
|
229
|
+
const qs = params.toString() ? `?${params.toString()}` : '';
|
|
230
|
+
return request(`/workspaces/${workspaceId}/projects/${projectId}/led-maps${qs}`, ledMapListResponseSchema);
|
|
231
|
+
},
|
|
232
|
+
// "Start a new map". Omit `input` (or `copyFromLedMapId`) for an empty map the
|
|
233
|
+
// creation owns outright, rather than falling back to the project alias above.
|
|
234
|
+
create(workspaceId, projectId, input) {
|
|
235
|
+
return request(`/workspaces/${workspaceId}/projects/${projectId}/led-maps`, ledMapResponseSchema, {
|
|
236
|
+
method: 'POST',
|
|
237
|
+
body: createLedMapRequestSchema.parse(input ?? {})
|
|
238
|
+
});
|
|
239
|
+
},
|
|
216
240
|
// One specific map by id. The projectId in the path is the tenant gate, not a lookup
|
|
217
241
|
// key — the server filters on (id AND project_id) and 404s a map from another project.
|
|
218
242
|
getById(workspaceId, projectId, ledMapId) {
|
|
219
243
|
return request(`/workspaces/${workspaceId}/projects/${projectId}/led-maps/${ledMapId}`, ledMapResponseSchema);
|
|
220
244
|
},
|
|
245
|
+
// Geometry PATCH. Returns the FORK SIGNAL: when the server branches a shared map,
|
|
246
|
+
// `branchedFrom` is the id the edit started from and `data.id` is a NEW row the
|
|
247
|
+
// caller must repoint its creation at. See `ledMapUpdateResponseSchema`.
|
|
221
248
|
updateById(workspaceId, projectId, ledMapId, input) {
|
|
222
|
-
return request(`/workspaces/${workspaceId}/projects/${projectId}/led-maps/${ledMapId}`,
|
|
249
|
+
return request(`/workspaces/${workspaceId}/projects/${projectId}/led-maps/${ledMapId}`, ledMapUpdateResponseSchema, { method: 'PATCH', body: updateLedMapRequestSchema.parse(input) });
|
|
250
|
+
},
|
|
251
|
+
// The creations referencing this map — the shared badge and the delete refusal.
|
|
252
|
+
usage(workspaceId, projectId, ledMapId) {
|
|
253
|
+
return request(`/workspaces/${workspaceId}/projects/${projectId}/led-maps/${ledMapId}/usage`, ledMapUsageResponseSchema);
|
|
254
|
+
},
|
|
255
|
+
// Rename only. A separate route from the geometry PATCH because it must NOT bump
|
|
256
|
+
// `version` — see `updateLedMapMetadataRequestSchema`.
|
|
257
|
+
updateMetadata(workspaceId, projectId, ledMapId, input) {
|
|
258
|
+
return request(`/workspaces/${workspaceId}/projects/${projectId}/led-maps/${ledMapId}/metadata`, ledMapResponseSchema, { method: 'PATCH', body: updateLedMapMetadataRequestSchema.parse(input) });
|
|
259
|
+
},
|
|
260
|
+
// Refused with a 409 naming the creations when any creation still references the map.
|
|
261
|
+
remove(workspaceId, projectId, ledMapId) {
|
|
262
|
+
return request(`/workspaces/${workspaceId}/projects/${projectId}/led-maps/${ledMapId}`, z.object({ data: z.object({}) }), { method: 'DELETE' });
|
|
223
263
|
}
|
|
224
264
|
},
|
|
225
265
|
runs: {
|
package/dist/generation.d.ts
CHANGED
|
@@ -255,6 +255,40 @@ export declare const panelVideoDescriptorSchema: z.ZodDiscriminatedUnion<[z.ZodO
|
|
|
255
255
|
nativeH: z.ZodNumber;
|
|
256
256
|
mode: z.ZodLiteral<"mirror">;
|
|
257
257
|
}, z.core.$strip>], "mode">;
|
|
258
|
+
/**
|
|
259
|
+
* Why a job failed, in a form a client may map to human copy.
|
|
260
|
+
*
|
|
261
|
+
* A CLOSED set, deliberately. The server stores its failure reasons in two
|
|
262
|
+
* places and neither is safe to forward verbatim:
|
|
263
|
+
* - `generation_job_events.data.reason` — written by EVERY failure path, but
|
|
264
|
+
* heterogeneous: the image paths store short codes, while the video paths
|
|
265
|
+
* store `err.message.slice(0, 200)`, an arbitrary provider exception that
|
|
266
|
+
* can carry an endpoint URL or a request id.
|
|
267
|
+
* - `generation_job_steps.error` — short codes, but the IMAGE paths only; it
|
|
268
|
+
* covers no video failure and no reconciler-reaped job.
|
|
269
|
+
*
|
|
270
|
+
* Because something must map either way, the mapping lives at the API boundary
|
|
271
|
+
* and this enum makes it total: a value nobody mapped cannot reach a client, it
|
|
272
|
+
* degrades to `unknown`. That containment is structural rather than a matter of
|
|
273
|
+
* reviewer discipline — the next person to add a workflow cannot leak by
|
|
274
|
+
* default.
|
|
275
|
+
*
|
|
276
|
+
* Members name the USER'S SITUATION, not the system's fault, so client copy
|
|
277
|
+
* falls out of the code almost mechanically. The test: if a member's best copy
|
|
278
|
+
* is "something went wrong", it belongs in `internal_error`.
|
|
279
|
+
*/
|
|
280
|
+
export declare const generationFailureReasonSchema: z.ZodEnum<{
|
|
281
|
+
internal_error: "internal_error";
|
|
282
|
+
unknown: "unknown";
|
|
283
|
+
prompt_blocked: "prompt_blocked";
|
|
284
|
+
content_blocked: "content_blocked";
|
|
285
|
+
no_image: "no_image";
|
|
286
|
+
invalid_request: "invalid_request";
|
|
287
|
+
provider_unavailable: "provider_unavailable";
|
|
288
|
+
source_missing: "source_missing";
|
|
289
|
+
panel_geometry_missing: "panel_geometry_missing";
|
|
290
|
+
timed_out: "timed_out";
|
|
291
|
+
}>;
|
|
258
292
|
export declare const generationJobSchema: z.ZodObject<{
|
|
259
293
|
id: z.ZodString;
|
|
260
294
|
workspaceId: z.ZodString;
|
|
@@ -291,6 +325,18 @@ export declare const generationJobSchema: z.ZodObject<{
|
|
|
291
325
|
sourceAssetIds: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
292
326
|
parentJobId: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
293
327
|
variantGroupId: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
328
|
+
failureReason: z.ZodDefault<z.ZodNullable<z.ZodEnum<{
|
|
329
|
+
internal_error: "internal_error";
|
|
330
|
+
unknown: "unknown";
|
|
331
|
+
prompt_blocked: "prompt_blocked";
|
|
332
|
+
content_blocked: "content_blocked";
|
|
333
|
+
no_image: "no_image";
|
|
334
|
+
invalid_request: "invalid_request";
|
|
335
|
+
provider_unavailable: "provider_unavailable";
|
|
336
|
+
source_missing: "source_missing";
|
|
337
|
+
panel_geometry_missing: "panel_geometry_missing";
|
|
338
|
+
timed_out: "timed_out";
|
|
339
|
+
}>>>;
|
|
294
340
|
}, z.core.$strip>;
|
|
295
341
|
export declare const createGenerationJobRequestSchema: z.ZodObject<{
|
|
296
342
|
prompt: z.ZodString;
|
|
@@ -343,6 +389,18 @@ export declare const generationJobResponseSchema: z.ZodObject<{
|
|
|
343
389
|
sourceAssetIds: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
344
390
|
parentJobId: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
345
391
|
variantGroupId: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
392
|
+
failureReason: z.ZodDefault<z.ZodNullable<z.ZodEnum<{
|
|
393
|
+
internal_error: "internal_error";
|
|
394
|
+
unknown: "unknown";
|
|
395
|
+
prompt_blocked: "prompt_blocked";
|
|
396
|
+
content_blocked: "content_blocked";
|
|
397
|
+
no_image: "no_image";
|
|
398
|
+
invalid_request: "invalid_request";
|
|
399
|
+
provider_unavailable: "provider_unavailable";
|
|
400
|
+
source_missing: "source_missing";
|
|
401
|
+
panel_geometry_missing: "panel_geometry_missing";
|
|
402
|
+
timed_out: "timed_out";
|
|
403
|
+
}>>>;
|
|
346
404
|
}, z.core.$strip>;
|
|
347
405
|
}, z.core.$strip>;
|
|
348
406
|
export declare const createSmartVideoResponseSchema: z.ZodObject<{
|
|
@@ -383,6 +441,18 @@ export declare const createSmartVideoResponseSchema: z.ZodObject<{
|
|
|
383
441
|
sourceAssetIds: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
384
442
|
parentJobId: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
385
443
|
variantGroupId: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
444
|
+
failureReason: z.ZodDefault<z.ZodNullable<z.ZodEnum<{
|
|
445
|
+
internal_error: "internal_error";
|
|
446
|
+
unknown: "unknown";
|
|
447
|
+
prompt_blocked: "prompt_blocked";
|
|
448
|
+
content_blocked: "content_blocked";
|
|
449
|
+
no_image: "no_image";
|
|
450
|
+
invalid_request: "invalid_request";
|
|
451
|
+
provider_unavailable: "provider_unavailable";
|
|
452
|
+
source_missing: "source_missing";
|
|
453
|
+
panel_geometry_missing: "panel_geometry_missing";
|
|
454
|
+
timed_out: "timed_out";
|
|
455
|
+
}>>>;
|
|
386
456
|
}, z.core.$strip>;
|
|
387
457
|
videoPlan: z.ZodObject<{
|
|
388
458
|
jobs: z.ZodArray<z.ZodObject<{
|
|
@@ -502,6 +572,18 @@ export declare const createPanelSetResponseSchema: z.ZodObject<{
|
|
|
502
572
|
sourceAssetIds: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
503
573
|
parentJobId: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
504
574
|
variantGroupId: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
575
|
+
failureReason: z.ZodDefault<z.ZodNullable<z.ZodEnum<{
|
|
576
|
+
internal_error: "internal_error";
|
|
577
|
+
unknown: "unknown";
|
|
578
|
+
prompt_blocked: "prompt_blocked";
|
|
579
|
+
content_blocked: "content_blocked";
|
|
580
|
+
no_image: "no_image";
|
|
581
|
+
invalid_request: "invalid_request";
|
|
582
|
+
provider_unavailable: "provider_unavailable";
|
|
583
|
+
source_missing: "source_missing";
|
|
584
|
+
panel_geometry_missing: "panel_geometry_missing";
|
|
585
|
+
timed_out: "timed_out";
|
|
586
|
+
}>>>;
|
|
505
587
|
}, z.core.$strip>;
|
|
506
588
|
panels: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
507
589
|
jobId: z.ZodString;
|
|
@@ -579,6 +661,18 @@ export declare const listGenerationJobsResponseSchema: z.ZodObject<{
|
|
|
579
661
|
sourceAssetIds: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
580
662
|
parentJobId: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
581
663
|
variantGroupId: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
664
|
+
failureReason: z.ZodDefault<z.ZodNullable<z.ZodEnum<{
|
|
665
|
+
internal_error: "internal_error";
|
|
666
|
+
unknown: "unknown";
|
|
667
|
+
prompt_blocked: "prompt_blocked";
|
|
668
|
+
content_blocked: "content_blocked";
|
|
669
|
+
no_image: "no_image";
|
|
670
|
+
invalid_request: "invalid_request";
|
|
671
|
+
provider_unavailable: "provider_unavailable";
|
|
672
|
+
source_missing: "source_missing";
|
|
673
|
+
panel_geometry_missing: "panel_geometry_missing";
|
|
674
|
+
timed_out: "timed_out";
|
|
675
|
+
}>>>;
|
|
582
676
|
}, z.core.$strip>>;
|
|
583
677
|
pagination: z.ZodObject<{
|
|
584
678
|
nextCursor: z.ZodNullable<z.ZodString>;
|
|
@@ -602,6 +696,7 @@ export type PanelPlanEntry = z.infer<typeof panelPlanEntrySchema>;
|
|
|
602
696
|
export type VideoPlan = z.infer<typeof videoPlanSchema>;
|
|
603
697
|
export type PanelVideoDescriptor = z.infer<typeof panelVideoDescriptorSchema>;
|
|
604
698
|
export type CreateSmartVideoResponse = z.infer<typeof createSmartVideoResponseSchema>;
|
|
699
|
+
export type GenerationFailureReason = z.infer<typeof generationFailureReasonSchema>;
|
|
605
700
|
export type GenerationJob = z.infer<typeof generationJobSchema>;
|
|
606
701
|
export type CreateGenerationJobRequest = z.input<typeof createGenerationJobRequestSchema>;
|
|
607
702
|
export type ListGenerationJobsQuery = z.input<typeof listGenerationJobsQuerySchema>;
|
package/dist/generation.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generation.d.ts","sourceRoot":"","sources":["../src/generation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAIvB,eAAO,MAAM,yBAAyB;;;;;;EAAmE,CAAA;A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C,CAAA;AACnE,MAAM,MAAM,sBAAsB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,4BAA4B,CAAC,CAAA"}
|
package/dist/generation.js
CHANGED
|
@@ -153,6 +153,55 @@ export const panelVideoDescriptorSchema = z.discriminatedUnion('mode', [
|
|
|
153
153
|
z.object({ mode: z.literal('reuse'), ...panelVideoDescriptorBase, assetId: idSchema }),
|
|
154
154
|
z.object({ mode: z.literal('mirror'), ...panelVideoDescriptorBase, sourcePanelId: ledPanelIdSchema })
|
|
155
155
|
]);
|
|
156
|
+
/**
|
|
157
|
+
* Why a job failed, in a form a client may map to human copy.
|
|
158
|
+
*
|
|
159
|
+
* A CLOSED set, deliberately. The server stores its failure reasons in two
|
|
160
|
+
* places and neither is safe to forward verbatim:
|
|
161
|
+
* - `generation_job_events.data.reason` — written by EVERY failure path, but
|
|
162
|
+
* heterogeneous: the image paths store short codes, while the video paths
|
|
163
|
+
* store `err.message.slice(0, 200)`, an arbitrary provider exception that
|
|
164
|
+
* can carry an endpoint URL or a request id.
|
|
165
|
+
* - `generation_job_steps.error` — short codes, but the IMAGE paths only; it
|
|
166
|
+
* covers no video failure and no reconciler-reaped job.
|
|
167
|
+
*
|
|
168
|
+
* Because something must map either way, the mapping lives at the API boundary
|
|
169
|
+
* and this enum makes it total: a value nobody mapped cannot reach a client, it
|
|
170
|
+
* degrades to `unknown`. That containment is structural rather than a matter of
|
|
171
|
+
* reviewer discipline — the next person to add a workflow cannot leak by
|
|
172
|
+
* default.
|
|
173
|
+
*
|
|
174
|
+
* Members name the USER'S SITUATION, not the system's fault, so client copy
|
|
175
|
+
* falls out of the code almost mechanically. The test: if a member's best copy
|
|
176
|
+
* is "something went wrong", it belongs in `internal_error`.
|
|
177
|
+
*/
|
|
178
|
+
export const generationFailureReasonSchema = z.enum([
|
|
179
|
+
/** The prompt tripped a safety filter. Actionable: reword it. */
|
|
180
|
+
'prompt_blocked',
|
|
181
|
+
/** The OUTPUT tripped a safety filter. Actionable: reword or retry. */
|
|
182
|
+
'content_blocked',
|
|
183
|
+
/** The model answered without an image. Actionable: retry or reword. */
|
|
184
|
+
'no_image',
|
|
185
|
+
/** The request itself was rejected as invalid. Rarely user-actionable. */
|
|
186
|
+
'invalid_request',
|
|
187
|
+
/** Provider down / rate-limited / unreachable. Actionable: just retry. */
|
|
188
|
+
'provider_unavailable',
|
|
189
|
+
/** A required source image (edit parent, panel master) could not be read. */
|
|
190
|
+
'source_missing',
|
|
191
|
+
/**
|
|
192
|
+
* A panel job carried no pinned geometry. Kept DISTINCT from internal_error
|
|
193
|
+
* because the user can act on it — re-run the LED map step — and telling
|
|
194
|
+
* someone "something went wrong" when the fix is one click away is precisely
|
|
195
|
+
* the failure this field exists to end.
|
|
196
|
+
*/
|
|
197
|
+
'panel_geometry_missing',
|
|
198
|
+
/** Ours, and nothing the user can do. Misconfiguration, bugs, bad state. */
|
|
199
|
+
'internal_error',
|
|
200
|
+
/** Reaped for exceeding its budget without finishing. Actionable: retry. */
|
|
201
|
+
'timed_out',
|
|
202
|
+
/** Unmapped. The fallback that makes the set total; never leaks a raw value. */
|
|
203
|
+
'unknown'
|
|
204
|
+
]);
|
|
156
205
|
export const generationJobSchema = z.object({
|
|
157
206
|
id: idSchema,
|
|
158
207
|
workspaceId: idSchema,
|
|
@@ -180,7 +229,16 @@ export const generationJobSchema = z.object({
|
|
|
180
229
|
runId: idSchema.nullable().default(null),
|
|
181
230
|
sourceAssetIds: z.array(idSchema).default([]),
|
|
182
231
|
parentJobId: idSchema.nullable().default(null),
|
|
183
|
-
variantGroupId: idSchema.nullable().default(null)
|
|
232
|
+
variantGroupId: idSchema.nullable().default(null),
|
|
233
|
+
/**
|
|
234
|
+
* Why this job failed. Null on every non-failed job, and null on a failed job
|
|
235
|
+
* whose reason could not be determined. Defaults so pre-0.30 payloads parse —
|
|
236
|
+
* which, per the `z.infer` note above, makes it a REQUIRED output field and so
|
|
237
|
+
* a compile error in `mapJob` and the fixtures until they are updated. That is
|
|
238
|
+
* the point: the alternative is another field silently emitting null for
|
|
239
|
+
* months, as `ledMapId` did.
|
|
240
|
+
*/
|
|
241
|
+
failureReason: generationFailureReasonSchema.nullable().default(null)
|
|
184
242
|
});
|
|
185
243
|
export const createGenerationJobRequestSchema = imageGenerateParamsSchema;
|
|
186
244
|
export const generationJobResponseSchema = apiSuccessSchema(generationJobSchema);
|
package/dist/projects.d.ts
CHANGED
|
@@ -40,6 +40,19 @@ export declare const ledPanelsSchema: z.ZodArray<z.ZodObject<{
|
|
|
40
40
|
showLabel: z.ZodOptional<z.ZodBoolean>;
|
|
41
41
|
mirrorOf: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNull]>>;
|
|
42
42
|
}, z.core.$strip>>;
|
|
43
|
+
/**
|
|
44
|
+
* Library membership state of a map. 'draft' = private to one creation;
|
|
45
|
+
* 'library' = saved and reusable.
|
|
46
|
+
*
|
|
47
|
+
* NOTE for Phase B: this is NOT the picker's predicate. The picker filters on
|
|
48
|
+
* `jsonb_array_length(panels_json) > 0` and nothing else — `scripts/backfill-runs.ts`
|
|
49
|
+
* promoted exactly the non-empty set to 'library', but every map created since is
|
|
50
|
+
* 'draft' with panels, so filtering on this enum would hide all of them.
|
|
51
|
+
*/
|
|
52
|
+
export declare const ledMapLibraryStatusSchema: z.ZodEnum<{
|
|
53
|
+
draft: "draft";
|
|
54
|
+
library: "library";
|
|
55
|
+
}>;
|
|
43
56
|
export declare const ledMapSchema: z.ZodObject<{
|
|
44
57
|
id: z.ZodString;
|
|
45
58
|
projectId: z.ZodString;
|
|
@@ -122,6 +135,240 @@ export declare const ledMapResponseSchema: z.ZodObject<{
|
|
|
122
135
|
updatedAt: z.ZodString;
|
|
123
136
|
}, z.core.$strip>;
|
|
124
137
|
}, z.core.$strip>;
|
|
138
|
+
/**
|
|
139
|
+
* A creation that references a map. Powers two Phase B surfaces: the
|
|
140
|
+
* "Shared · used in Day 1 Opener, Day 2 Keynote" badge on a locked editor, and the
|
|
141
|
+
* named refusal when a delete is blocked (`project_runs.led_map_id` is
|
|
142
|
+
* ON DELETE restrict, so the database blocks it either way — this is what turns a
|
|
143
|
+
* bare FK error into a sentence).
|
|
144
|
+
*
|
|
145
|
+
* Deliberately its own aggregate rather than something derived client-side from
|
|
146
|
+
* `runs.list`: that listing is keyset-paginated with a default limit, so a map used
|
|
147
|
+
* by a creation on page 2 would be reported as unshared.
|
|
148
|
+
*/
|
|
149
|
+
export declare const ledMapUsageSchema: z.ZodObject<{
|
|
150
|
+
runId: z.ZodString;
|
|
151
|
+
name: z.ZodString;
|
|
152
|
+
}, z.core.$strip>;
|
|
153
|
+
/**
|
|
154
|
+
* Rename a map (or move it between library states) WITHOUT touching its geometry.
|
|
155
|
+
* `updateLedMapRequestSchema` replaces the whole panel array, so before this there
|
|
156
|
+
* was no way to rename a map at all.
|
|
157
|
+
*
|
|
158
|
+
* DELIBERATELY NO `expectedVersion`, AND THE SERVER MUST NOT BUMP `version` ON IT.
|
|
159
|
+
* This is not stylistic. `version` is not only the geometry concurrency token — it is
|
|
160
|
+
* half the free centre-panel reuse gate (zcl-api
|
|
161
|
+
* services/generation-service.ts:726-739, `if (master.ledMapVersion !== map.version)
|
|
162
|
+
* { return false }`). Bumping it on a rename would make RENAMING A MAP SILENTLY COST
|
|
163
|
+
* THE USER CREDITS on their next Generate All. zcl-web-next's editor already names
|
|
164
|
+
* this exact hazard for panel labels (rebuild-panel-set.ts:568-571: gating on the
|
|
165
|
+
* version counter "would permanently unrestore a user's wall because they renamed
|
|
166
|
+
* 'LED 3'").
|
|
167
|
+
*
|
|
168
|
+
* So a metadata PATCH stays outside the geometry concurrency protocol entirely: no
|
|
169
|
+
* CAS token in, no counter bump out. Concurrent renames are last-write-wins, which is
|
|
170
|
+
* the correct semantics for a scalar. Do not add `expectedVersion` here "for
|
|
171
|
+
* consistency" with the geometry PATCH — the asymmetry is the point.
|
|
172
|
+
*
|
|
173
|
+
* `name: null` clears the name (back to an unnamed working copy). `name: ''` and
|
|
174
|
+
* whitespace-only are rejected. Unknown keys — notably a smuggled `panels` or
|
|
175
|
+
* `expectedVersion` — are STRIPPED by zod rather than rejected, so they never reach
|
|
176
|
+
* the server; a patch whose only keys are unknown fails the refine below.
|
|
177
|
+
*
|
|
178
|
+
* Response reuses `ledMapResponseSchema` — a renamed map is just a map.
|
|
179
|
+
*/
|
|
180
|
+
export declare const updateLedMapMetadataRequestSchema: z.ZodObject<{
|
|
181
|
+
name: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
182
|
+
libraryStatus: z.ZodOptional<z.ZodEnum<{
|
|
183
|
+
draft: "draft";
|
|
184
|
+
library: "library";
|
|
185
|
+
}>>;
|
|
186
|
+
}, z.core.$strip>;
|
|
187
|
+
/**
|
|
188
|
+
* One row in the LED map picker / library listing.
|
|
189
|
+
*
|
|
190
|
+
* Carries `panelCount` and DELIBERATELY NOT the `panels` array: a picker listing N
|
|
191
|
+
* maps must not ship N full panel arrays (up to 200 panels each) just to render "4
|
|
192
|
+
* panels" and a thumbnail. Fetch `ledMaps.getById` when the geometry is actually
|
|
193
|
+
* needed.
|
|
194
|
+
*
|
|
195
|
+
* DELIBERATELY NO `superRefine`, unlike `ledMapSchema`. That schema enforces a
|
|
196
|
+
* panels⇄bounds biconditional (empty maps have null bounds; non-empty maps have
|
|
197
|
+
* bounds that match), and it CANNOT be checked here — `panelCount` is a count, and
|
|
198
|
+
* bounds cannot be recomputed from a count. A summary with `panelCount: 4` and
|
|
199
|
+
* `bounds: null` therefore parses cleanly. Do not "restore" the refinement.
|
|
200
|
+
*
|
|
201
|
+
* `name`, `libraryStatus` and `forkedFromLedMapId` all `.default()`, so — per the
|
|
202
|
+
* house rule spelled out on `ledMapSchema.id` — zcl-api's `z.infer` turns them into
|
|
203
|
+
* REQUIRED output fields. The mapper that will break at compile time until it emits
|
|
204
|
+
* them is the new summary mapper feeding the list route in
|
|
205
|
+
* services/postgres-services.ts (alongside `mapLedMap`), which must also compute
|
|
206
|
+
* `panelCount` and join `usage`. That compile error is the desired failure mode.
|
|
207
|
+
*/
|
|
208
|
+
export declare const ledMapSummarySchema: z.ZodObject<{
|
|
209
|
+
id: z.ZodString;
|
|
210
|
+
projectId: z.ZodString;
|
|
211
|
+
name: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
212
|
+
libraryStatus: z.ZodDefault<z.ZodEnum<{
|
|
213
|
+
draft: "draft";
|
|
214
|
+
library: "library";
|
|
215
|
+
}>>;
|
|
216
|
+
forkedFromLedMapId: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
217
|
+
version: z.ZodNumber;
|
|
218
|
+
panelCount: z.ZodNumber;
|
|
219
|
+
bounds: z.ZodNullable<z.ZodObject<{
|
|
220
|
+
minX: z.ZodNumber;
|
|
221
|
+
minY: z.ZodNumber;
|
|
222
|
+
maxX: z.ZodNumber;
|
|
223
|
+
maxY: z.ZodNumber;
|
|
224
|
+
width: z.ZodNumber;
|
|
225
|
+
height: z.ZodNumber;
|
|
226
|
+
aspectRatio: z.ZodNumber;
|
|
227
|
+
}, z.core.$strip>>;
|
|
228
|
+
usage: z.ZodArray<z.ZodObject<{
|
|
229
|
+
runId: z.ZodString;
|
|
230
|
+
name: z.ZodString;
|
|
231
|
+
}, z.core.$strip>>;
|
|
232
|
+
createdAt: z.ZodString;
|
|
233
|
+
updatedAt: z.ZodString;
|
|
234
|
+
}, z.core.$strip>;
|
|
235
|
+
/**
|
|
236
|
+
* LED maps list query. Keyset-paginated, mirroring `listProjectRunsQuerySchema`
|
|
237
|
+
* exactly (minus its `status` filter — the picker's predicate is server-side and
|
|
238
|
+
* not client-selectable).
|
|
239
|
+
*
|
|
240
|
+
* The response is `ledMapListResponseSchema` =
|
|
241
|
+
* { data: LedMapSummary[]; pagination: { nextCursor: string | null } }.
|
|
242
|
+
*/
|
|
243
|
+
export declare const listLedMapsQuerySchema: z.ZodObject<{
|
|
244
|
+
cursor: z.ZodOptional<z.ZodString>;
|
|
245
|
+
limit: z.ZodOptional<z.ZodCoercedNumber<unknown>>;
|
|
246
|
+
}, z.core.$strip>;
|
|
247
|
+
/**
|
|
248
|
+
* Create a map a creation owns outright — the picker's "Start a new map".
|
|
249
|
+
*
|
|
250
|
+
* THIS PATH DOES NOT EXIST TODAY, and neither of the two adjacent ones can stand in:
|
|
251
|
+
*
|
|
252
|
+
* - `createProjectRunRequestSchema.copyFromLedMapId` is `.optional()` where ABSENT
|
|
253
|
+
* means "copy the project's oldest map" (zcl-api
|
|
254
|
+
* services/project-run-service.ts:249-271). It therefore cannot distinguish
|
|
255
|
+
* "default" from "explicitly none".
|
|
256
|
+
* - `getLedMap`'s lazy insert fires only when a project has ZERO maps, so it can
|
|
257
|
+
* never mint a second one.
|
|
258
|
+
*
|
|
259
|
+
* Phase B establishes that no creation may carry `ledMapId = null`: null is not "no
|
|
260
|
+
* map", it is "share the project's oldest map by accident" — the silent-sharing
|
|
261
|
+
* defect where two creations edit one row through one alias and one silently reverts
|
|
262
|
+
* the other's work. An explicit create path is what lets a creation own an EMPTY map
|
|
263
|
+
* instead of falling back to that alias.
|
|
264
|
+
*
|
|
265
|
+
* Omit `copyFromLedMapId` for an empty map; supply it to seed from an existing map in
|
|
266
|
+
* the same project. Response reuses `ledMapResponseSchema` — a created map is just a
|
|
267
|
+
* map, so there is no new envelope.
|
|
268
|
+
*/
|
|
269
|
+
export declare const createLedMapRequestSchema: z.ZodObject<{
|
|
270
|
+
name: z.ZodOptional<z.ZodString>;
|
|
271
|
+
copyFromLedMapId: z.ZodOptional<z.ZodString>;
|
|
272
|
+
}, z.core.$strip>;
|
|
273
|
+
export declare const ledMapListResponseSchema: z.ZodObject<{
|
|
274
|
+
data: z.ZodArray<z.ZodObject<{
|
|
275
|
+
id: z.ZodString;
|
|
276
|
+
projectId: z.ZodString;
|
|
277
|
+
name: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
278
|
+
libraryStatus: z.ZodDefault<z.ZodEnum<{
|
|
279
|
+
draft: "draft";
|
|
280
|
+
library: "library";
|
|
281
|
+
}>>;
|
|
282
|
+
forkedFromLedMapId: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
283
|
+
version: z.ZodNumber;
|
|
284
|
+
panelCount: z.ZodNumber;
|
|
285
|
+
bounds: z.ZodNullable<z.ZodObject<{
|
|
286
|
+
minX: z.ZodNumber;
|
|
287
|
+
minY: z.ZodNumber;
|
|
288
|
+
maxX: z.ZodNumber;
|
|
289
|
+
maxY: z.ZodNumber;
|
|
290
|
+
width: z.ZodNumber;
|
|
291
|
+
height: z.ZodNumber;
|
|
292
|
+
aspectRatio: z.ZodNumber;
|
|
293
|
+
}, z.core.$strip>>;
|
|
294
|
+
usage: z.ZodArray<z.ZodObject<{
|
|
295
|
+
runId: z.ZodString;
|
|
296
|
+
name: z.ZodString;
|
|
297
|
+
}, z.core.$strip>>;
|
|
298
|
+
createdAt: z.ZodString;
|
|
299
|
+
updatedAt: z.ZodString;
|
|
300
|
+
}, z.core.$strip>>;
|
|
301
|
+
pagination: z.ZodObject<{
|
|
302
|
+
nextCursor: z.ZodNullable<z.ZodString>;
|
|
303
|
+
}, z.core.$strip>;
|
|
304
|
+
}, z.core.$strip>;
|
|
305
|
+
export declare const ledMapUsageResponseSchema: z.ZodObject<{
|
|
306
|
+
data: z.ZodArray<z.ZodObject<{
|
|
307
|
+
runId: z.ZodString;
|
|
308
|
+
name: z.ZodString;
|
|
309
|
+
}, z.core.$strip>>;
|
|
310
|
+
}, z.core.$strip>;
|
|
311
|
+
/**
|
|
312
|
+
* The by-id map PATCH response — and THE FORK SIGNAL.
|
|
313
|
+
*
|
|
314
|
+
* `data` is the map that now holds the geometry, which may be a NEW ROW: editing a
|
|
315
|
+
* map that two or more creations share branches it server-side, inside the PATCH
|
|
316
|
+
* (lazily, on the first geometry-significant change — never on a button click, so a
|
|
317
|
+
* user who opens a shared map and changes nothing keeps free centre-panel reuse).
|
|
318
|
+
*
|
|
319
|
+
* `branchedFrom` is the id the edit STARTED from when the server branched, and null
|
|
320
|
+
* when it edited in place. The client detects a branch with `branchedFrom !== null`
|
|
321
|
+
* and MUST repoint its creation at `data.id` — the id it sent is no longer the map it
|
|
322
|
+
* is editing.
|
|
323
|
+
*
|
|
324
|
+
* DO NOT signal a branch through the 409 instead. That 409's ambiguity across
|
|
325
|
+
* *wrong version / wrong project / no such map* is deliberate anti-tenant-probing
|
|
326
|
+
* (zcl-api services/postgres-services.ts:1662-1664) — it exists so a caller cannot
|
|
327
|
+
* learn whether a map id exists in someone else's tenant. A fork is a SUCCESS, and
|
|
328
|
+
* needs a success-shaped response, not a richer error.
|
|
329
|
+
*
|
|
330
|
+
* `branchedFrom` `.default()`s, so per the house rule on `ledMapSchema.id` it becomes
|
|
331
|
+
* a REQUIRED output field under `z.infer`: zcl-api's `updateLedMapById` route handler
|
|
332
|
+
* (led-map.routes.ts, currently parsing its outbound body through
|
|
333
|
+
* `ledMapResponseSchema`) breaks at compile time until it switches to this schema and
|
|
334
|
+
* emits the field. That is the desired failure mode.
|
|
335
|
+
*/
|
|
336
|
+
export declare const ledMapUpdateResponseSchema: z.ZodObject<{
|
|
337
|
+
data: z.ZodObject<{
|
|
338
|
+
id: z.ZodString;
|
|
339
|
+
projectId: z.ZodString;
|
|
340
|
+
name: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
341
|
+
libraryStatus: z.ZodDefault<z.ZodEnum<{
|
|
342
|
+
draft: "draft";
|
|
343
|
+
library: "library";
|
|
344
|
+
}>>;
|
|
345
|
+
forkedFromLedMapId: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
346
|
+
version: z.ZodNumber;
|
|
347
|
+
panels: z.ZodArray<z.ZodObject<{
|
|
348
|
+
id: z.ZodString;
|
|
349
|
+
name: z.ZodString;
|
|
350
|
+
width: z.ZodNumber;
|
|
351
|
+
height: z.ZodNumber;
|
|
352
|
+
x: z.ZodNumber;
|
|
353
|
+
y: z.ZodNumber;
|
|
354
|
+
color: z.ZodOptional<z.ZodString>;
|
|
355
|
+
showLabel: z.ZodOptional<z.ZodBoolean>;
|
|
356
|
+
mirrorOf: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNull]>>;
|
|
357
|
+
}, z.core.$strip>>;
|
|
358
|
+
bounds: z.ZodNullable<z.ZodObject<{
|
|
359
|
+
minX: z.ZodNumber;
|
|
360
|
+
minY: z.ZodNumber;
|
|
361
|
+
maxX: z.ZodNumber;
|
|
362
|
+
maxY: z.ZodNumber;
|
|
363
|
+
width: z.ZodNumber;
|
|
364
|
+
height: z.ZodNumber;
|
|
365
|
+
aspectRatio: z.ZodNumber;
|
|
366
|
+
}, z.core.$strip>>;
|
|
367
|
+
createdAt: z.ZodString;
|
|
368
|
+
updatedAt: z.ZodString;
|
|
369
|
+
}, z.core.$strip>;
|
|
370
|
+
branchedFrom: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
371
|
+
}, z.core.$strip>;
|
|
125
372
|
export declare const projectSchema: z.ZodObject<{
|
|
126
373
|
id: z.ZodString;
|
|
127
374
|
workspaceId: z.ZodString;
|
|
@@ -292,9 +539,22 @@ export type CreateProjectRequest = z.input<typeof createProjectRequestSchema>;
|
|
|
292
539
|
export type UpdateProjectRequest = z.infer<typeof updateProjectRequestSchema>;
|
|
293
540
|
export type LedBounds = z.infer<typeof ledBoundsSchema>;
|
|
294
541
|
export type LedMap = z.infer<typeof ledMapSchema>;
|
|
542
|
+
export type LedMapLibraryStatus = z.infer<typeof ledMapLibraryStatusSchema>;
|
|
295
543
|
export type LedMapResponse = z.infer<typeof ledMapResponseSchema>;
|
|
296
544
|
export type LedPanel = z.infer<typeof ledPanelSchema>;
|
|
545
|
+
export type LedMapSummary = z.infer<typeof ledMapSummarySchema>;
|
|
546
|
+
export type LedMapUsage = z.infer<typeof ledMapUsageSchema>;
|
|
547
|
+
export type LedMapListResponse = z.infer<typeof ledMapListResponseSchema>;
|
|
548
|
+
export type LedMapUsageResponse = z.infer<typeof ledMapUsageResponseSchema>;
|
|
549
|
+
export type LedMapUpdateResponse = z.infer<typeof ledMapUpdateResponseSchema>;
|
|
550
|
+
export type ListLedMapsQuery = z.infer<typeof listLedMapsQuerySchema>;
|
|
551
|
+
/**
|
|
552
|
+
* `z.infer`, not `z.input` (contrast `CreateProjectRequest`): neither field here
|
|
553
|
+
* `.default()`s, so input and output coincide and there is nothing to widen.
|
|
554
|
+
*/
|
|
555
|
+
export type CreateLedMapRequest = z.infer<typeof createLedMapRequestSchema>;
|
|
297
556
|
export type UpdateLedMapRequest = z.infer<typeof updateLedMapRequestSchema>;
|
|
557
|
+
export type UpdateLedMapMetadataRequest = z.infer<typeof updateLedMapMetadataRequestSchema>;
|
|
298
558
|
export type Project = z.infer<typeof projectSchema>;
|
|
299
559
|
export type ProjectStatus = z.infer<typeof projectStatusSchema>;
|
|
300
560
|
export type ProjectVisibility = z.infer<typeof projectVisibilitySchema>;
|
package/dist/projects.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"projects.d.ts","sourceRoot":"","sources":["../src/projects.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAGvB,eAAO,MAAM,uBAAuB;;;EAAmC,CAAA;AACvE,eAAO,MAAM,mBAAmB;;;;EAA4C,CAAA;AAE5E,eAAO,MAAM,gBAAgB,aAAmC,CAAA;AAEhE,eAAO,MAAM,cAAc;;;;;;;;;;iBA0CvB,CAAA;AAEJ,eAAO,MAAM,eAAe;;;;;;;;iBAQ1B,CAAA;AAMF,eAAO,MAAM,eAAe;;;;;;;;;;kBAGgC,CAAA;AAsB5D,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBA0ErB,CAAA;AAEJ,eAAO,MAAM,yBAAyB;;;;;;;;;;;;;iBAGpC,CAAA;AAEF,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAAiC,CAAA;AAElE,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;iBASx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abs(bounds.aspectRatio - aspectRatio) < 1e-9);
|
|
79
79
|
}
|
|
80
|
+
/**
|
|
81
|
+
* Library membership state of a map. 'draft' = private to one creation;
|
|
82
|
+
* 'library' = saved and reusable.
|
|
83
|
+
*
|
|
84
|
+
* NOTE for Phase B: this is NOT the picker's predicate. The picker filters on
|
|
85
|
+
* `jsonb_array_length(panels_json) > 0` and nothing else — `scripts/backfill-runs.ts`
|
|
86
|
+
* promoted exactly the non-empty set to 'library', but every map created since is
|
|
87
|
+
* 'draft' with panels, so filtering on this enum would hide all of them.
|
|
88
|
+
*/
|
|
89
|
+
export const ledMapLibraryStatusSchema = z.enum(['draft', 'library']);
|
|
80
90
|
export const ledMapSchema = z
|
|
81
91
|
.object({
|
|
82
92
|
/**
|
|
@@ -118,7 +128,7 @@ export const ledMapSchema = z
|
|
|
118
128
|
/** Library display name. Null while the map is an unnamed working copy. */
|
|
119
129
|
name: z.string().trim().min(1).max(120).nullable().default(null),
|
|
120
130
|
/** 'draft' = private to one creation; 'library' = saved and reusable. */
|
|
121
|
-
libraryStatus:
|
|
131
|
+
libraryStatus: ledMapLibraryStatusSchema.default('draft'),
|
|
122
132
|
/** The map this one was branched from, or null. */
|
|
123
133
|
forkedFromLedMapId: idSchema.nullable().default(null),
|
|
124
134
|
version: z.number().int().nonnegative(),
|
|
@@ -155,6 +165,165 @@ export const updateLedMapRequestSchema = z.object({
|
|
|
155
165
|
panels: ledPanelsSchema
|
|
156
166
|
});
|
|
157
167
|
export const ledMapResponseSchema = apiSuccessSchema(ledMapSchema);
|
|
168
|
+
/**
|
|
169
|
+
* A creation that references a map. Powers two Phase B surfaces: the
|
|
170
|
+
* "Shared · used in Day 1 Opener, Day 2 Keynote" badge on a locked editor, and the
|
|
171
|
+
* named refusal when a delete is blocked (`project_runs.led_map_id` is
|
|
172
|
+
* ON DELETE restrict, so the database blocks it either way — this is what turns a
|
|
173
|
+
* bare FK error into a sentence).
|
|
174
|
+
*
|
|
175
|
+
* Deliberately its own aggregate rather than something derived client-side from
|
|
176
|
+
* `runs.list`: that listing is keyset-paginated with a default limit, so a map used
|
|
177
|
+
* by a creation on page 2 would be reported as unshared.
|
|
178
|
+
*/
|
|
179
|
+
export const ledMapUsageSchema = z.object({
|
|
180
|
+
runId: idSchema,
|
|
181
|
+
name: z.string().min(1)
|
|
182
|
+
});
|
|
183
|
+
/**
|
|
184
|
+
* Rename a map (or move it between library states) WITHOUT touching its geometry.
|
|
185
|
+
* `updateLedMapRequestSchema` replaces the whole panel array, so before this there
|
|
186
|
+
* was no way to rename a map at all.
|
|
187
|
+
*
|
|
188
|
+
* DELIBERATELY NO `expectedVersion`, AND THE SERVER MUST NOT BUMP `version` ON IT.
|
|
189
|
+
* This is not stylistic. `version` is not only the geometry concurrency token — it is
|
|
190
|
+
* half the free centre-panel reuse gate (zcl-api
|
|
191
|
+
* services/generation-service.ts:726-739, `if (master.ledMapVersion !== map.version)
|
|
192
|
+
* { return false }`). Bumping it on a rename would make RENAMING A MAP SILENTLY COST
|
|
193
|
+
* THE USER CREDITS on their next Generate All. zcl-web-next's editor already names
|
|
194
|
+
* this exact hazard for panel labels (rebuild-panel-set.ts:568-571: gating on the
|
|
195
|
+
* version counter "would permanently unrestore a user's wall because they renamed
|
|
196
|
+
* 'LED 3'").
|
|
197
|
+
*
|
|
198
|
+
* So a metadata PATCH stays outside the geometry concurrency protocol entirely: no
|
|
199
|
+
* CAS token in, no counter bump out. Concurrent renames are last-write-wins, which is
|
|
200
|
+
* the correct semantics for a scalar. Do not add `expectedVersion` here "for
|
|
201
|
+
* consistency" with the geometry PATCH — the asymmetry is the point.
|
|
202
|
+
*
|
|
203
|
+
* `name: null` clears the name (back to an unnamed working copy). `name: ''` and
|
|
204
|
+
* whitespace-only are rejected. Unknown keys — notably a smuggled `panels` or
|
|
205
|
+
* `expectedVersion` — are STRIPPED by zod rather than rejected, so they never reach
|
|
206
|
+
* the server; a patch whose only keys are unknown fails the refine below.
|
|
207
|
+
*
|
|
208
|
+
* Response reuses `ledMapResponseSchema` — a renamed map is just a map.
|
|
209
|
+
*/
|
|
210
|
+
export const updateLedMapMetadataRequestSchema = z
|
|
211
|
+
.object({
|
|
212
|
+
name: z.string().trim().min(1).max(120).nullable().optional(),
|
|
213
|
+
libraryStatus: ledMapLibraryStatusSchema.optional()
|
|
214
|
+
})
|
|
215
|
+
.refine((input) => input.name !== undefined || input.libraryStatus !== undefined, 'At least one field is required');
|
|
216
|
+
/**
|
|
217
|
+
* One row in the LED map picker / library listing.
|
|
218
|
+
*
|
|
219
|
+
* Carries `panelCount` and DELIBERATELY NOT the `panels` array: a picker listing N
|
|
220
|
+
* maps must not ship N full panel arrays (up to 200 panels each) just to render "4
|
|
221
|
+
* panels" and a thumbnail. Fetch `ledMaps.getById` when the geometry is actually
|
|
222
|
+
* needed.
|
|
223
|
+
*
|
|
224
|
+
* DELIBERATELY NO `superRefine`, unlike `ledMapSchema`. That schema enforces a
|
|
225
|
+
* panels⇄bounds biconditional (empty maps have null bounds; non-empty maps have
|
|
226
|
+
* bounds that match), and it CANNOT be checked here — `panelCount` is a count, and
|
|
227
|
+
* bounds cannot be recomputed from a count. A summary with `panelCount: 4` and
|
|
228
|
+
* `bounds: null` therefore parses cleanly. Do not "restore" the refinement.
|
|
229
|
+
*
|
|
230
|
+
* `name`, `libraryStatus` and `forkedFromLedMapId` all `.default()`, so — per the
|
|
231
|
+
* house rule spelled out on `ledMapSchema.id` — zcl-api's `z.infer` turns them into
|
|
232
|
+
* REQUIRED output fields. The mapper that will break at compile time until it emits
|
|
233
|
+
* them is the new summary mapper feeding the list route in
|
|
234
|
+
* services/postgres-services.ts (alongside `mapLedMap`), which must also compute
|
|
235
|
+
* `panelCount` and join `usage`. That compile error is the desired failure mode.
|
|
236
|
+
*/
|
|
237
|
+
export const ledMapSummarySchema = z.object({
|
|
238
|
+
id: idSchema,
|
|
239
|
+
projectId: idSchema,
|
|
240
|
+
/** Library display name. Null while the map is an unnamed working copy. */
|
|
241
|
+
name: z.string().trim().min(1).max(120).nullable().default(null),
|
|
242
|
+
libraryStatus: ledMapLibraryStatusSchema.default('draft'),
|
|
243
|
+
/** The map this one was branched from, or null. */
|
|
244
|
+
forkedFromLedMapId: idSchema.nullable().default(null),
|
|
245
|
+
version: z.number().int().nonnegative(),
|
|
246
|
+
/** Panel count only — see the note above on why `panels` is absent. */
|
|
247
|
+
panelCount: z.number().int().nonnegative(),
|
|
248
|
+
bounds: ledBoundsSchema.nullable(),
|
|
249
|
+
/**
|
|
250
|
+
* The creations using this map. `[]` for an orphan map — orphans stay listed,
|
|
251
|
+
* because their creation may be archived and archived creations can be restored.
|
|
252
|
+
*/
|
|
253
|
+
usage: z.array(ledMapUsageSchema),
|
|
254
|
+
createdAt: isoDateSchema,
|
|
255
|
+
updatedAt: isoDateSchema
|
|
256
|
+
});
|
|
257
|
+
/**
|
|
258
|
+
* LED maps list query. Keyset-paginated, mirroring `listProjectRunsQuerySchema`
|
|
259
|
+
* exactly (minus its `status` filter — the picker's predicate is server-side and
|
|
260
|
+
* not client-selectable).
|
|
261
|
+
*
|
|
262
|
+
* The response is `ledMapListResponseSchema` =
|
|
263
|
+
* { data: LedMapSummary[]; pagination: { nextCursor: string | null } }.
|
|
264
|
+
*/
|
|
265
|
+
export const listLedMapsQuerySchema = z.object({
|
|
266
|
+
cursor: z.string().min(1).optional(),
|
|
267
|
+
limit: z.coerce.number().int().min(1).max(100).optional()
|
|
268
|
+
});
|
|
269
|
+
/**
|
|
270
|
+
* Create a map a creation owns outright — the picker's "Start a new map".
|
|
271
|
+
*
|
|
272
|
+
* THIS PATH DOES NOT EXIST TODAY, and neither of the two adjacent ones can stand in:
|
|
273
|
+
*
|
|
274
|
+
* - `createProjectRunRequestSchema.copyFromLedMapId` is `.optional()` where ABSENT
|
|
275
|
+
* means "copy the project's oldest map" (zcl-api
|
|
276
|
+
* services/project-run-service.ts:249-271). It therefore cannot distinguish
|
|
277
|
+
* "default" from "explicitly none".
|
|
278
|
+
* - `getLedMap`'s lazy insert fires only when a project has ZERO maps, so it can
|
|
279
|
+
* never mint a second one.
|
|
280
|
+
*
|
|
281
|
+
* Phase B establishes that no creation may carry `ledMapId = null`: null is not "no
|
|
282
|
+
* map", it is "share the project's oldest map by accident" — the silent-sharing
|
|
283
|
+
* defect where two creations edit one row through one alias and one silently reverts
|
|
284
|
+
* the other's work. An explicit create path is what lets a creation own an EMPTY map
|
|
285
|
+
* instead of falling back to that alias.
|
|
286
|
+
*
|
|
287
|
+
* Omit `copyFromLedMapId` for an empty map; supply it to seed from an existing map in
|
|
288
|
+
* the same project. Response reuses `ledMapResponseSchema` — a created map is just a
|
|
289
|
+
* map, so there is no new envelope.
|
|
290
|
+
*/
|
|
291
|
+
export const createLedMapRequestSchema = z.object({
|
|
292
|
+
name: z.string().trim().min(1).max(120).optional(),
|
|
293
|
+
/** Seed the new map by copying an existing one in the same project. Omit for an empty map. */
|
|
294
|
+
copyFromLedMapId: idSchema.optional()
|
|
295
|
+
});
|
|
296
|
+
export const ledMapListResponseSchema = listResponseSchema(ledMapSummarySchema);
|
|
297
|
+
export const ledMapUsageResponseSchema = apiSuccessSchema(z.array(ledMapUsageSchema));
|
|
298
|
+
/**
|
|
299
|
+
* The by-id map PATCH response — and THE FORK SIGNAL.
|
|
300
|
+
*
|
|
301
|
+
* `data` is the map that now holds the geometry, which may be a NEW ROW: editing a
|
|
302
|
+
* map that two or more creations share branches it server-side, inside the PATCH
|
|
303
|
+
* (lazily, on the first geometry-significant change — never on a button click, so a
|
|
304
|
+
* user who opens a shared map and changes nothing keeps free centre-panel reuse).
|
|
305
|
+
*
|
|
306
|
+
* `branchedFrom` is the id the edit STARTED from when the server branched, and null
|
|
307
|
+
* when it edited in place. The client detects a branch with `branchedFrom !== null`
|
|
308
|
+
* and MUST repoint its creation at `data.id` — the id it sent is no longer the map it
|
|
309
|
+
* is editing.
|
|
310
|
+
*
|
|
311
|
+
* DO NOT signal a branch through the 409 instead. That 409's ambiguity across
|
|
312
|
+
* *wrong version / wrong project / no such map* is deliberate anti-tenant-probing
|
|
313
|
+
* (zcl-api services/postgres-services.ts:1662-1664) — it exists so a caller cannot
|
|
314
|
+
* learn whether a map id exists in someone else's tenant. A fork is a SUCCESS, and
|
|
315
|
+
* needs a success-shaped response, not a richer error.
|
|
316
|
+
*
|
|
317
|
+
* `branchedFrom` `.default()`s, so per the house rule on `ledMapSchema.id` it becomes
|
|
318
|
+
* a REQUIRED output field under `z.infer`: zcl-api's `updateLedMapById` route handler
|
|
319
|
+
* (led-map.routes.ts, currently parsing its outbound body through
|
|
320
|
+
* `ledMapResponseSchema`) breaks at compile time until it switches to this schema and
|
|
321
|
+
* emits the field. That is the desired failure mode.
|
|
322
|
+
*/
|
|
323
|
+
export const ledMapUpdateResponseSchema = z.object({
|
|
324
|
+
data: ledMapSchema,
|
|
325
|
+
branchedFrom: idSchema.nullable().default(null)
|
|
326
|
+
});
|
|
158
327
|
export const projectSchema = z.object({
|
|
159
328
|
id: idSchema,
|
|
160
329
|
workspaceId: idSchema,
|