@anuragpal02/zcl-contracts 0.16.0 → 0.18.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/admin.d.ts +237 -0
- package/dist/admin.d.ts.map +1 -1
- package/dist/admin.js +101 -1
- package/dist/assets.d.ts +8 -8
- package/dist/client.d.ts +27 -2
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +75 -1
- package/dist/common.d.ts +2 -0
- package/dist/common.d.ts.map +1 -1
- package/dist/common.js +1 -0
- package/dist/generation.d.ts +6 -6
- package/dist/projects.d.ts +3 -3
- package/package.json +1 -1
package/dist/admin.d.ts
CHANGED
|
@@ -35,6 +35,7 @@ export declare const listAdminUsersResponseSchema: z.ZodObject<{
|
|
|
35
35
|
workspaceCount: z.ZodNumber;
|
|
36
36
|
isPlatformAdmin: z.ZodBoolean;
|
|
37
37
|
}, z.core.$strip>>;
|
|
38
|
+
nextCursor: z.ZodNullable<z.ZodString>;
|
|
38
39
|
}, z.core.$strip>;
|
|
39
40
|
}, z.core.$strip>;
|
|
40
41
|
export declare const adminWorkspaceCreditSchema: z.ZodObject<{
|
|
@@ -158,6 +159,231 @@ export declare const setPlatformAdminResponseSchema: z.ZodObject<{
|
|
|
158
159
|
isPlatformAdmin: z.ZodBoolean;
|
|
159
160
|
}, z.core.$strip>;
|
|
160
161
|
}, z.core.$strip>;
|
|
162
|
+
export declare const setUserDisabledRequestSchema: z.ZodObject<{
|
|
163
|
+
disabled: z.ZodBoolean;
|
|
164
|
+
}, z.core.$strip>;
|
|
165
|
+
export declare const setUserDisabledResponseSchema: z.ZodObject<{
|
|
166
|
+
data: z.ZodObject<{
|
|
167
|
+
id: z.ZodString;
|
|
168
|
+
email: z.ZodString;
|
|
169
|
+
name: z.ZodString;
|
|
170
|
+
disabledAt: z.ZodNullable<z.ZodString>;
|
|
171
|
+
createdAt: z.ZodString;
|
|
172
|
+
workspaceCount: z.ZodNumber;
|
|
173
|
+
isPlatformAdmin: z.ZodBoolean;
|
|
174
|
+
}, z.core.$strip>;
|
|
175
|
+
}, z.core.$strip>;
|
|
176
|
+
export declare const adminAuditEntrySchema: z.ZodObject<{
|
|
177
|
+
id: z.ZodString;
|
|
178
|
+
actorUserId: z.ZodString;
|
|
179
|
+
actorEmail: z.ZodNullable<z.ZodString>;
|
|
180
|
+
action: z.ZodString;
|
|
181
|
+
targetType: z.ZodString;
|
|
182
|
+
targetId: z.ZodNullable<z.ZodString>;
|
|
183
|
+
metadata: z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
184
|
+
requestId: z.ZodNullable<z.ZodString>;
|
|
185
|
+
createdAt: z.ZodString;
|
|
186
|
+
}, z.core.$strip>;
|
|
187
|
+
export declare const listAdminAuditResponseSchema: z.ZodObject<{
|
|
188
|
+
data: z.ZodObject<{
|
|
189
|
+
entries: z.ZodArray<z.ZodObject<{
|
|
190
|
+
id: z.ZodString;
|
|
191
|
+
actorUserId: z.ZodString;
|
|
192
|
+
actorEmail: z.ZodNullable<z.ZodString>;
|
|
193
|
+
action: z.ZodString;
|
|
194
|
+
targetType: z.ZodString;
|
|
195
|
+
targetId: z.ZodNullable<z.ZodString>;
|
|
196
|
+
metadata: z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
197
|
+
requestId: z.ZodNullable<z.ZodString>;
|
|
198
|
+
createdAt: z.ZodString;
|
|
199
|
+
}, z.core.$strip>>;
|
|
200
|
+
nextCursor: z.ZodNullable<z.ZodString>;
|
|
201
|
+
}, z.core.$strip>;
|
|
202
|
+
}, z.core.$strip>;
|
|
203
|
+
export declare const adminJobStatusSchema: z.ZodEnum<{
|
|
204
|
+
queued: "queued";
|
|
205
|
+
running: "running";
|
|
206
|
+
succeeded: "succeeded";
|
|
207
|
+
failed: "failed";
|
|
208
|
+
canceled: "canceled";
|
|
209
|
+
}>;
|
|
210
|
+
export declare const adminJobSummarySchema: z.ZodObject<{
|
|
211
|
+
id: z.ZodString;
|
|
212
|
+
workspaceId: z.ZodString;
|
|
213
|
+
projectId: z.ZodString;
|
|
214
|
+
type: z.ZodEnum<{
|
|
215
|
+
"image.generate": "image.generate";
|
|
216
|
+
"prompt.enhance": "prompt.enhance";
|
|
217
|
+
"image.edit": "image.edit";
|
|
218
|
+
"image.mask": "image.mask";
|
|
219
|
+
"image.export": "image.export";
|
|
220
|
+
"image.panel": "image.panel";
|
|
221
|
+
"video.loop": "video.loop";
|
|
222
|
+
"video.upscale": "video.upscale";
|
|
223
|
+
}>;
|
|
224
|
+
status: z.ZodEnum<{
|
|
225
|
+
queued: "queued";
|
|
226
|
+
running: "running";
|
|
227
|
+
succeeded: "succeeded";
|
|
228
|
+
failed: "failed";
|
|
229
|
+
canceled: "canceled";
|
|
230
|
+
}>;
|
|
231
|
+
provider: z.ZodString;
|
|
232
|
+
reservedCredits: z.ZodNumber;
|
|
233
|
+
createdByUserId: z.ZodString;
|
|
234
|
+
createdAt: z.ZodString;
|
|
235
|
+
}, z.core.$strip>;
|
|
236
|
+
export declare const listAdminJobsResponseSchema: z.ZodObject<{
|
|
237
|
+
data: z.ZodObject<{
|
|
238
|
+
jobs: z.ZodArray<z.ZodObject<{
|
|
239
|
+
id: z.ZodString;
|
|
240
|
+
workspaceId: z.ZodString;
|
|
241
|
+
projectId: z.ZodString;
|
|
242
|
+
type: z.ZodEnum<{
|
|
243
|
+
"image.generate": "image.generate";
|
|
244
|
+
"prompt.enhance": "prompt.enhance";
|
|
245
|
+
"image.edit": "image.edit";
|
|
246
|
+
"image.mask": "image.mask";
|
|
247
|
+
"image.export": "image.export";
|
|
248
|
+
"image.panel": "image.panel";
|
|
249
|
+
"video.loop": "video.loop";
|
|
250
|
+
"video.upscale": "video.upscale";
|
|
251
|
+
}>;
|
|
252
|
+
status: z.ZodEnum<{
|
|
253
|
+
queued: "queued";
|
|
254
|
+
running: "running";
|
|
255
|
+
succeeded: "succeeded";
|
|
256
|
+
failed: "failed";
|
|
257
|
+
canceled: "canceled";
|
|
258
|
+
}>;
|
|
259
|
+
provider: z.ZodString;
|
|
260
|
+
reservedCredits: z.ZodNumber;
|
|
261
|
+
createdByUserId: z.ZodString;
|
|
262
|
+
createdAt: z.ZodString;
|
|
263
|
+
}, z.core.$strip>>;
|
|
264
|
+
nextCursor: z.ZodNullable<z.ZodString>;
|
|
265
|
+
}, z.core.$strip>;
|
|
266
|
+
}, z.core.$strip>;
|
|
267
|
+
export declare const adminJobStepSchema: z.ZodObject<{
|
|
268
|
+
name: z.ZodString;
|
|
269
|
+
status: z.ZodString;
|
|
270
|
+
attempt: z.ZodNumber;
|
|
271
|
+
providerRequestId: z.ZodNullable<z.ZodString>;
|
|
272
|
+
providerJobId: z.ZodNullable<z.ZodString>;
|
|
273
|
+
error: z.ZodNullable<z.ZodString>;
|
|
274
|
+
createdAt: z.ZodString;
|
|
275
|
+
}, z.core.$strip>;
|
|
276
|
+
export declare const adminJobEventSchema: z.ZodObject<{
|
|
277
|
+
source: z.ZodString;
|
|
278
|
+
visibility: z.ZodString;
|
|
279
|
+
type: z.ZodString;
|
|
280
|
+
data: z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
281
|
+
createdAt: z.ZodString;
|
|
282
|
+
}, z.core.$strip>;
|
|
283
|
+
export declare const adminJobDetailResponseSchema: z.ZodObject<{
|
|
284
|
+
data: z.ZodObject<{
|
|
285
|
+
job: z.ZodObject<{
|
|
286
|
+
id: z.ZodString;
|
|
287
|
+
workspaceId: z.ZodString;
|
|
288
|
+
projectId: z.ZodString;
|
|
289
|
+
type: z.ZodEnum<{
|
|
290
|
+
"image.generate": "image.generate";
|
|
291
|
+
"prompt.enhance": "prompt.enhance";
|
|
292
|
+
"image.edit": "image.edit";
|
|
293
|
+
"image.mask": "image.mask";
|
|
294
|
+
"image.export": "image.export";
|
|
295
|
+
"image.panel": "image.panel";
|
|
296
|
+
"video.loop": "video.loop";
|
|
297
|
+
"video.upscale": "video.upscale";
|
|
298
|
+
}>;
|
|
299
|
+
status: z.ZodEnum<{
|
|
300
|
+
queued: "queued";
|
|
301
|
+
running: "running";
|
|
302
|
+
succeeded: "succeeded";
|
|
303
|
+
failed: "failed";
|
|
304
|
+
canceled: "canceled";
|
|
305
|
+
}>;
|
|
306
|
+
provider: z.ZodString;
|
|
307
|
+
reservedCredits: z.ZodNumber;
|
|
308
|
+
createdByUserId: z.ZodString;
|
|
309
|
+
createdAt: z.ZodString;
|
|
310
|
+
}, z.core.$strip>;
|
|
311
|
+
steps: z.ZodArray<z.ZodObject<{
|
|
312
|
+
name: z.ZodString;
|
|
313
|
+
status: z.ZodString;
|
|
314
|
+
attempt: z.ZodNumber;
|
|
315
|
+
providerRequestId: z.ZodNullable<z.ZodString>;
|
|
316
|
+
providerJobId: z.ZodNullable<z.ZodString>;
|
|
317
|
+
error: z.ZodNullable<z.ZodString>;
|
|
318
|
+
createdAt: z.ZodString;
|
|
319
|
+
}, z.core.$strip>>;
|
|
320
|
+
events: z.ZodArray<z.ZodObject<{
|
|
321
|
+
source: z.ZodString;
|
|
322
|
+
visibility: z.ZodString;
|
|
323
|
+
type: z.ZodString;
|
|
324
|
+
data: z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
325
|
+
createdAt: z.ZodString;
|
|
326
|
+
}, z.core.$strip>>;
|
|
327
|
+
}, z.core.$strip>;
|
|
328
|
+
}, z.core.$strip>;
|
|
329
|
+
export declare const adminUsageResponseSchema: z.ZodObject<{
|
|
330
|
+
data: z.ZodObject<{
|
|
331
|
+
periodDays: z.ZodNumber;
|
|
332
|
+
ledgerTotals: z.ZodObject<{
|
|
333
|
+
grant: z.ZodNumber;
|
|
334
|
+
reserve: z.ZodNumber;
|
|
335
|
+
capture: z.ZodNumber;
|
|
336
|
+
release: z.ZodNumber;
|
|
337
|
+
refund: z.ZodNumber;
|
|
338
|
+
adjustment: z.ZodNumber;
|
|
339
|
+
}, z.core.$strip>;
|
|
340
|
+
jobsByType: z.ZodArray<z.ZodObject<{
|
|
341
|
+
type: z.ZodEnum<{
|
|
342
|
+
"image.generate": "image.generate";
|
|
343
|
+
"prompt.enhance": "prompt.enhance";
|
|
344
|
+
"image.edit": "image.edit";
|
|
345
|
+
"image.mask": "image.mask";
|
|
346
|
+
"image.export": "image.export";
|
|
347
|
+
"image.panel": "image.panel";
|
|
348
|
+
"video.loop": "video.loop";
|
|
349
|
+
"video.upscale": "video.upscale";
|
|
350
|
+
}>;
|
|
351
|
+
count: z.ZodNumber;
|
|
352
|
+
}, z.core.$strip>>;
|
|
353
|
+
jobsByStatus: z.ZodArray<z.ZodObject<{
|
|
354
|
+
status: z.ZodEnum<{
|
|
355
|
+
queued: "queued";
|
|
356
|
+
running: "running";
|
|
357
|
+
succeeded: "succeeded";
|
|
358
|
+
failed: "failed";
|
|
359
|
+
canceled: "canceled";
|
|
360
|
+
}>;
|
|
361
|
+
count: z.ZodNumber;
|
|
362
|
+
}, z.core.$strip>>;
|
|
363
|
+
topWorkspacesBySpend: z.ZodArray<z.ZodObject<{
|
|
364
|
+
workspaceId: z.ZodString;
|
|
365
|
+
name: z.ZodString;
|
|
366
|
+
capturedCredits: z.ZodNumber;
|
|
367
|
+
}, z.core.$strip>>;
|
|
368
|
+
}, z.core.$strip>;
|
|
369
|
+
}, z.core.$strip>;
|
|
370
|
+
export declare const stepUpStartResponseSchema: z.ZodObject<{
|
|
371
|
+
data: z.ZodObject<{
|
|
372
|
+
sentTo: z.ZodString;
|
|
373
|
+
expiresAt: z.ZodString;
|
|
374
|
+
}, z.core.$strip>;
|
|
375
|
+
}, z.core.$strip>;
|
|
376
|
+
export declare const stepUpVerifyRequestSchema: z.ZodObject<{
|
|
377
|
+
code: z.ZodString;
|
|
378
|
+
}, z.core.$strip>;
|
|
379
|
+
export declare const stepUpVerifyResponseSchema: z.ZodObject<{
|
|
380
|
+
data: z.ZodObject<{
|
|
381
|
+
verifiedUntil: z.ZodString;
|
|
382
|
+
}, z.core.$strip>;
|
|
383
|
+
}, z.core.$strip>;
|
|
384
|
+
export type StepUpStartResponse = z.infer<typeof stepUpStartResponseSchema>;
|
|
385
|
+
export type StepUpVerifyRequest = z.input<typeof stepUpVerifyRequestSchema>;
|
|
386
|
+
export type StepUpVerifyResponse = z.infer<typeof stepUpVerifyResponseSchema>;
|
|
161
387
|
export type CreditLedgerType = z.infer<typeof creditLedgerTypeSchema>;
|
|
162
388
|
export type AdminMeResponse = z.infer<typeof adminMeResponseSchema>;
|
|
163
389
|
export type AdminUserSummary = z.infer<typeof adminUserSummarySchema>;
|
|
@@ -170,4 +396,15 @@ export type AdminAdjustCreditsRequest = z.input<typeof adminAdjustCreditsRequest
|
|
|
170
396
|
export type AdminAdjustCreditsResponse = z.infer<typeof adminAdjustCreditsResponseSchema>;
|
|
171
397
|
export type SetPlatformAdminRequest = z.input<typeof setPlatformAdminRequestSchema>;
|
|
172
398
|
export type SetPlatformAdminResponse = z.infer<typeof setPlatformAdminResponseSchema>;
|
|
399
|
+
export type SetUserDisabledRequest = z.input<typeof setUserDisabledRequestSchema>;
|
|
400
|
+
export type SetUserDisabledResponse = z.infer<typeof setUserDisabledResponseSchema>;
|
|
401
|
+
export type AdminAuditEntry = z.infer<typeof adminAuditEntrySchema>;
|
|
402
|
+
export type ListAdminAuditResponse = z.infer<typeof listAdminAuditResponseSchema>;
|
|
403
|
+
export type AdminJobStatus = z.infer<typeof adminJobStatusSchema>;
|
|
404
|
+
export type AdminJobSummary = z.infer<typeof adminJobSummarySchema>;
|
|
405
|
+
export type ListAdminJobsResponse = z.infer<typeof listAdminJobsResponseSchema>;
|
|
406
|
+
export type AdminJobStep = z.infer<typeof adminJobStepSchema>;
|
|
407
|
+
export type AdminJobEvent = z.infer<typeof adminJobEventSchema>;
|
|
408
|
+
export type AdminJobDetailResponse = z.infer<typeof adminJobDetailResponseSchema>;
|
|
409
|
+
export type AdminUsageResponse = z.infer<typeof adminUsageResponseSchema>;
|
|
173
410
|
//# sourceMappingURL=admin.d.ts.map
|
package/dist/admin.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"admin.d.ts","sourceRoot":"","sources":["../src/admin.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;
|
|
1
|
+
{"version":3,"file":"admin.d.ts","sourceRoot":"","sources":["../src/admin.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAOvB,eAAO,MAAM,sBAAsB;;;;;;;EAOjC,CAAA;AAGF,eAAO,MAAM,qBAAqB;;;;;;;iBAOjC,CAAA;AAED,eAAO,MAAM,sBAAsB;;;;;;;;iBAQjC,CAAA;AAEF,eAAO,MAAM,4BAA4B;;;;;;;;;;;;;iBAKxC,CAAA;AAGD,eAAO,MAAM,0BAA0B;;;;;;;;;;iBAKrC,CAAA;AAEF,eAAO,MAAM,6BAA6B;;;;;;;;;;;;;;;;;;;;iBAUzC,CAAA;AAED,eAAO,MAAM,sBAAsB;;;;;;;;;;;;iBAKjC,CAAA;AAEF,eAAO,MAAM,kCAAkC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAiB9C,CAAA;AAGD,eAAO,MAAM,+BAA+B;;;iBAG1C,CAAA;AAEF,eAAO,MAAM,gCAAgC;;;;;;;;;;;;;;;;;iBAK5C,CAAA;AAED,eAAO,MAAM,6BAA6B;;iBAExC,CAAA;AAEF,eAAO,MAAM,8BAA8B;;;;;;;;;;iBAA2C,CAAA;AAItF,eAAO,MAAM,4BAA4B;;iBAEvC,CAAA;AAEF,eAAO,MAAM,6BAA6B;;;;;;;;;;iBAA2C,CAAA;AAIrF,eAAO,MAAM,qBAAqB;;;;;;;;;;iBAUhC,CAAA;AAEF,eAAO,MAAM,4BAA4B;;;;;;;;;;;;;;;iBAKxC,CAAA;AAED,eAAO,MAAM,oBAAoB;;;;;;EAAmE,CAAA;AAGpG,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;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BAAmB,CAAC,CAAA;AAC/D,MAAM,MAAM,sBAAsB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,4BAA4B,CAAC,CAAA;AACjF,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAA"}
|
package/dist/admin.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
import { apiSuccessSchema, idSchema, isoDateSchema } from './common.js';
|
|
3
|
+
import { generationJobTypeSchema } from './generation.js';
|
|
3
4
|
import { workspaceMembershipStatusSchema, workspaceRoleSchema, workspaceTypeSchema } from './workspaces.js';
|
|
4
5
|
// The credit-ledger entry kinds: lifecycle of a workspace's credits.
|
|
5
6
|
// `adjustment` is the type recorded by an admin manual grant/deduct.
|
|
@@ -28,7 +29,8 @@ export const adminUserSummarySchema = z.object({
|
|
|
28
29
|
isPlatformAdmin: z.boolean()
|
|
29
30
|
});
|
|
30
31
|
export const listAdminUsersResponseSchema = apiSuccessSchema(z.object({
|
|
31
|
-
users: z.array(adminUserSummarySchema)
|
|
32
|
+
users: z.array(adminUserSummarySchema),
|
|
33
|
+
nextCursor: z.string().nullable()
|
|
32
34
|
}));
|
|
33
35
|
// A workspace the user belongs to, enriched with their role + the workspace's balance.
|
|
34
36
|
export const adminWorkspaceCreditSchema = z.object({
|
|
@@ -79,3 +81,101 @@ export const setPlatformAdminRequestSchema = z.object({
|
|
|
79
81
|
isPlatformAdmin: z.boolean()
|
|
80
82
|
});
|
|
81
83
|
export const setPlatformAdminResponseSchema = apiSuccessSchema(adminUserSummarySchema);
|
|
84
|
+
// Disable / re-enable a user (soft lock). Echoes back the updated summary so the panel
|
|
85
|
+
// can re-render the row without a refetch.
|
|
86
|
+
export const setUserDisabledRequestSchema = z.object({
|
|
87
|
+
disabled: z.boolean()
|
|
88
|
+
});
|
|
89
|
+
export const setUserDisabledResponseSchema = apiSuccessSchema(adminUserSummarySchema);
|
|
90
|
+
// One row of the platform-admin audit trail. `metadata` is the free-form action payload
|
|
91
|
+
// (e.g. the credit delta + reason); all the optional context columns are nullable.
|
|
92
|
+
export const adminAuditEntrySchema = z.object({
|
|
93
|
+
id: idSchema,
|
|
94
|
+
actorUserId: idSchema,
|
|
95
|
+
actorEmail: z.string().nullable(),
|
|
96
|
+
action: z.string(),
|
|
97
|
+
targetType: z.string(),
|
|
98
|
+
targetId: z.string().nullable(),
|
|
99
|
+
metadata: z.record(z.string(), z.unknown()).nullable(),
|
|
100
|
+
requestId: z.string().nullable(),
|
|
101
|
+
createdAt: isoDateSchema
|
|
102
|
+
});
|
|
103
|
+
export const listAdminAuditResponseSchema = apiSuccessSchema(z.object({
|
|
104
|
+
entries: z.array(adminAuditEntrySchema),
|
|
105
|
+
nextCursor: z.string().nullable()
|
|
106
|
+
}));
|
|
107
|
+
export const adminJobStatusSchema = z.enum(['queued', 'running', 'succeeded', 'failed', 'canceled']);
|
|
108
|
+
// `projectId` is NON-nullable — generation_jobs.project_id is NOT NULL.
|
|
109
|
+
export const adminJobSummarySchema = z.object({
|
|
110
|
+
id: idSchema,
|
|
111
|
+
workspaceId: idSchema,
|
|
112
|
+
projectId: idSchema,
|
|
113
|
+
type: generationJobTypeSchema,
|
|
114
|
+
status: adminJobStatusSchema,
|
|
115
|
+
provider: z.string(),
|
|
116
|
+
reservedCredits: z.number().int(),
|
|
117
|
+
createdByUserId: idSchema,
|
|
118
|
+
createdAt: isoDateSchema
|
|
119
|
+
});
|
|
120
|
+
export const listAdminJobsResponseSchema = apiSuccessSchema(z.object({
|
|
121
|
+
jobs: z.array(adminJobSummarySchema),
|
|
122
|
+
nextCursor: z.string().nullable()
|
|
123
|
+
}));
|
|
124
|
+
export const adminJobStepSchema = z.object({
|
|
125
|
+
name: z.string(),
|
|
126
|
+
status: z.string(),
|
|
127
|
+
attempt: z.number().int(),
|
|
128
|
+
providerRequestId: z.string().nullable(),
|
|
129
|
+
providerJobId: z.string().nullable(),
|
|
130
|
+
error: z.string().nullable(),
|
|
131
|
+
createdAt: isoDateSchema
|
|
132
|
+
});
|
|
133
|
+
export const adminJobEventSchema = z.object({
|
|
134
|
+
source: z.string(),
|
|
135
|
+
visibility: z.string(),
|
|
136
|
+
type: z.string(),
|
|
137
|
+
data: z.record(z.string(), z.unknown()).nullable(),
|
|
138
|
+
createdAt: isoDateSchema
|
|
139
|
+
});
|
|
140
|
+
export const adminJobDetailResponseSchema = apiSuccessSchema(z.object({
|
|
141
|
+
job: adminJobSummarySchema,
|
|
142
|
+
steps: z.array(adminJobStepSchema),
|
|
143
|
+
events: z.array(adminJobEventSchema)
|
|
144
|
+
}));
|
|
145
|
+
export const adminUsageResponseSchema = apiSuccessSchema(z.object({
|
|
146
|
+
periodDays: z.number().int(),
|
|
147
|
+
ledgerTotals: z.object({
|
|
148
|
+
grant: z.number().int(),
|
|
149
|
+
reserve: z.number().int(),
|
|
150
|
+
capture: z.number().int(),
|
|
151
|
+
release: z.number().int(),
|
|
152
|
+
refund: z.number().int(),
|
|
153
|
+
adjustment: z.number().int()
|
|
154
|
+
}),
|
|
155
|
+
jobsByType: z.array(z.object({
|
|
156
|
+
type: generationJobTypeSchema,
|
|
157
|
+
count: z.number().int()
|
|
158
|
+
})),
|
|
159
|
+
jobsByStatus: z.array(z.object({
|
|
160
|
+
status: adminJobStatusSchema,
|
|
161
|
+
count: z.number().int()
|
|
162
|
+
})),
|
|
163
|
+
topWorkspacesBySpend: z.array(z.object({
|
|
164
|
+
workspaceId: idSchema,
|
|
165
|
+
name: z.string(),
|
|
166
|
+
capturedCredits: z.number().int()
|
|
167
|
+
}))
|
|
168
|
+
}));
|
|
169
|
+
// Step-up verification schemas (MFA-style challenge before sensitive admin mutations).
|
|
170
|
+
// `start` sends a time-limited OTP to the admin's masked email address.
|
|
171
|
+
// `verify` accepts the OTP and returns a `verifiedUntil` timestamp the server checks.
|
|
172
|
+
export const stepUpStartResponseSchema = apiSuccessSchema(z.object({
|
|
173
|
+
sentTo: z.string(),
|
|
174
|
+
expiresAt: isoDateSchema
|
|
175
|
+
}));
|
|
176
|
+
export const stepUpVerifyRequestSchema = z.object({
|
|
177
|
+
code: z.string().min(4).max(8)
|
|
178
|
+
});
|
|
179
|
+
export const stepUpVerifyResponseSchema = apiSuccessSchema(z.object({
|
|
180
|
+
verifiedUntil: isoDateSchema
|
|
181
|
+
}));
|
package/dist/assets.d.ts
CHANGED
|
@@ -9,10 +9,10 @@ export declare const assetKindSchema: z.ZodEnum<{
|
|
|
9
9
|
export: "export";
|
|
10
10
|
}>;
|
|
11
11
|
export declare const assetStatusSchema: z.ZodEnum<{
|
|
12
|
+
deleted: "deleted";
|
|
13
|
+
failed: "failed";
|
|
12
14
|
pending_upload: "pending_upload";
|
|
13
15
|
available: "available";
|
|
14
|
-
failed: "failed";
|
|
15
|
-
deleted: "deleted";
|
|
16
16
|
}>;
|
|
17
17
|
export declare const uploadableAssetKindSchema: z.ZodEnum<{
|
|
18
18
|
reference: "reference";
|
|
@@ -38,10 +38,10 @@ export declare const assetSchema: z.ZodObject<{
|
|
|
38
38
|
export: "export";
|
|
39
39
|
}>;
|
|
40
40
|
status: z.ZodEnum<{
|
|
41
|
+
deleted: "deleted";
|
|
42
|
+
failed: "failed";
|
|
41
43
|
pending_upload: "pending_upload";
|
|
42
44
|
available: "available";
|
|
43
|
-
failed: "failed";
|
|
44
|
-
deleted: "deleted";
|
|
45
45
|
}>;
|
|
46
46
|
contentType: z.ZodEnum<{
|
|
47
47
|
"image/png": "image/png";
|
|
@@ -91,10 +91,10 @@ export declare const createAssetUploadResponseSchema: z.ZodObject<{
|
|
|
91
91
|
export: "export";
|
|
92
92
|
}>;
|
|
93
93
|
status: z.ZodEnum<{
|
|
94
|
+
deleted: "deleted";
|
|
95
|
+
failed: "failed";
|
|
94
96
|
pending_upload: "pending_upload";
|
|
95
97
|
available: "available";
|
|
96
|
-
failed: "failed";
|
|
97
|
-
deleted: "deleted";
|
|
98
98
|
}>;
|
|
99
99
|
contentType: z.ZodEnum<{
|
|
100
100
|
"image/png": "image/png";
|
|
@@ -136,10 +136,10 @@ export declare const listAssetsResponseSchema: z.ZodObject<{
|
|
|
136
136
|
export: "export";
|
|
137
137
|
}>;
|
|
138
138
|
status: z.ZodEnum<{
|
|
139
|
+
deleted: "deleted";
|
|
140
|
+
failed: "failed";
|
|
139
141
|
pending_upload: "pending_upload";
|
|
140
142
|
available: "available";
|
|
141
|
-
failed: "failed";
|
|
142
|
-
deleted: "deleted";
|
|
143
143
|
}>;
|
|
144
144
|
contentType: z.ZodEnum<{
|
|
145
145
|
"image/png": "image/png";
|
package/dist/client.d.ts
CHANGED
|
@@ -5,9 +5,9 @@ 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 } from './assets.js';
|
|
7
7
|
import { type CreateProjectRequest, type LedMapResponse, type Project, type UpdateLedMapRequest, type UpdateProjectRequest } from './projects.js';
|
|
8
|
-
import { type CreateGenerationJobRequest, type CreatePanelSetRequest, type CreatePanelSetResponse, type CreateVideoLoopRequest, type CreateVideoUpscaleRequest, type EditGenerationJobRequest, type GenerationJobResponse, type GenerationJobStatus, type ListGenerationJobsResponse } from './generation.js';
|
|
8
|
+
import { type CreateGenerationJobRequest, type CreatePanelSetRequest, type CreatePanelSetResponse, 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
|
-
import { type AdminAdjustCreditsRequest, type AdminAdjustCreditsResponse, type AdminMeResponse, type AdminUserDetailResponse, type AdminWorkspaceDetailResponse, type ListAdminUsersResponse, type SetPlatformAdminRequest, type SetPlatformAdminResponse } from './admin.js';
|
|
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 SetPlatformAdminRequest, type SetPlatformAdminResponse, type SetUserDisabledRequest, type SetUserDisabledResponse, type StepUpStartResponse, type StepUpVerifyResponse } from './admin.js';
|
|
11
11
|
type FetchLike = (request: Request) => Promise<Response>;
|
|
12
12
|
export type ZclApiClientOptions = {
|
|
13
13
|
baseUrl: string;
|
|
@@ -112,11 +112,36 @@ export declare function createZclApiClient(options: ZclApiClientOptions): {
|
|
|
112
112
|
listUsers(options?: {
|
|
113
113
|
q?: string;
|
|
114
114
|
limit?: number;
|
|
115
|
+
cursor?: string;
|
|
115
116
|
}): Promise<ListAdminUsersResponse>;
|
|
116
117
|
getUser(userId: string): Promise<AdminUserDetailResponse>;
|
|
117
118
|
getWorkspace(workspaceId: string): Promise<AdminWorkspaceDetailResponse>;
|
|
118
119
|
adjustCredits(workspaceId: string, input: AdminAdjustCreditsRequest): Promise<AdminAdjustCreditsResponse>;
|
|
119
120
|
setPlatformAdmin(userId: string, input: SetPlatformAdminRequest): Promise<SetPlatformAdminResponse>;
|
|
121
|
+
setUserDisabled(userId: string, input: SetUserDisabledRequest): Promise<SetUserDisabledResponse>;
|
|
122
|
+
listAuditLog(options?: {
|
|
123
|
+
action?: string;
|
|
124
|
+
actorId?: string;
|
|
125
|
+
targetId?: string;
|
|
126
|
+
limit?: number;
|
|
127
|
+
cursor?: string;
|
|
128
|
+
}): Promise<ListAdminAuditResponse>;
|
|
129
|
+
listJobs(options?: {
|
|
130
|
+
workspaceId?: string;
|
|
131
|
+
status?: AdminJobStatus;
|
|
132
|
+
type?: GenerationJobType;
|
|
133
|
+
userId?: string;
|
|
134
|
+
limit?: number;
|
|
135
|
+
cursor?: string;
|
|
136
|
+
}): Promise<ListAdminJobsResponse>;
|
|
137
|
+
getJob(jobId: string): Promise<AdminJobDetailResponse>;
|
|
138
|
+
getUsage(options?: {
|
|
139
|
+
periodDays?: number;
|
|
140
|
+
}): Promise<AdminUsageResponse>;
|
|
141
|
+
stepUp: {
|
|
142
|
+
start(): Promise<StepUpStartResponse>;
|
|
143
|
+
verify(code: string): Promise<StepUpVerifyResponse>;
|
|
144
|
+
};
|
|
120
145
|
};
|
|
121
146
|
};
|
|
122
147
|
export type ZclApiClient = ReturnType<typeof createZclApiClient>;
|
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,EAML,KAAK,KAAK,EACV,KAAK,WAAW,EAChB,KAAK,wBAAwB,EAC7B,KAAK,yBAAyB,EAC9B,KAAK,0BAA0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qBvB;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
|
@@ -7,7 +7,7 @@ import { assetSchema, createAssetUploadRequestSchema, createAssetUploadResponseS
|
|
|
7
7
|
import { createProjectRequestSchema, ledMapResponseSchema, projectSchema, updateLedMapRequestSchema, updateProjectRequestSchema } from './projects.js';
|
|
8
8
|
import { createGenerationJobRequestSchema, createPanelSetRequestSchema, createPanelSetResponseSchema, createVideoLoopRequestSchema, createVideoUpscaleRequestSchema, editGenerationJobRequestSchema, generationJobResponseSchema, listGenerationJobsResponseSchema } from './generation.js';
|
|
9
9
|
import { describeImageRequestSchema, describeImageResponseSchema } from './assistant.js';
|
|
10
|
-
import { adminAdjustCreditsRequestSchema, adminAdjustCreditsResponseSchema, adminMeResponseSchema, adminUserDetailResponseSchema, adminWorkspaceDetailResponseSchema, listAdminUsersResponseSchema, setPlatformAdminRequestSchema, setPlatformAdminResponseSchema } from './admin.js';
|
|
10
|
+
import { adminAdjustCreditsRequestSchema, adminAdjustCreditsResponseSchema, adminJobDetailResponseSchema, adminMeResponseSchema, adminUsageResponseSchema, adminUserDetailResponseSchema, adminWorkspaceDetailResponseSchema, listAdminAuditResponseSchema, listAdminJobsResponseSchema, listAdminUsersResponseSchema, setPlatformAdminRequestSchema, setPlatformAdminResponseSchema, setUserDisabledRequestSchema, setUserDisabledResponseSchema, stepUpStartResponseSchema, stepUpVerifyRequestSchema, stepUpVerifyResponseSchema } from './admin.js';
|
|
11
11
|
const workspaceListResponseSchema = listResponseSchema(workspaceSchema.extend({
|
|
12
12
|
membership: workspaceMembershipSchema
|
|
13
13
|
}));
|
|
@@ -286,6 +286,9 @@ export function createZclApiClient(options) {
|
|
|
286
286
|
if (options.limit !== undefined) {
|
|
287
287
|
params.set('limit', String(options.limit));
|
|
288
288
|
}
|
|
289
|
+
if (options.cursor !== undefined) {
|
|
290
|
+
params.set('cursor', options.cursor);
|
|
291
|
+
}
|
|
289
292
|
const query = params.toString() ? `?${params.toString()}` : '';
|
|
290
293
|
return request(`/admin/users${query}`, listAdminUsersResponseSchema);
|
|
291
294
|
},
|
|
@@ -306,6 +309,77 @@ export function createZclApiClient(options) {
|
|
|
306
309
|
method: 'POST',
|
|
307
310
|
body: setPlatformAdminRequestSchema.parse(input)
|
|
308
311
|
});
|
|
312
|
+
},
|
|
313
|
+
setUserDisabled(userId, input) {
|
|
314
|
+
return request(`/admin/users/${userId}/disable`, setUserDisabledResponseSchema, {
|
|
315
|
+
method: 'POST',
|
|
316
|
+
body: setUserDisabledRequestSchema.parse(input)
|
|
317
|
+
});
|
|
318
|
+
},
|
|
319
|
+
listAuditLog(options = {}) {
|
|
320
|
+
const params = new URLSearchParams();
|
|
321
|
+
if (options.action !== undefined) {
|
|
322
|
+
params.set('action', options.action);
|
|
323
|
+
}
|
|
324
|
+
if (options.actorId !== undefined) {
|
|
325
|
+
params.set('actorId', options.actorId);
|
|
326
|
+
}
|
|
327
|
+
if (options.targetId !== undefined) {
|
|
328
|
+
params.set('targetId', options.targetId);
|
|
329
|
+
}
|
|
330
|
+
if (options.limit !== undefined) {
|
|
331
|
+
params.set('limit', String(options.limit));
|
|
332
|
+
}
|
|
333
|
+
if (options.cursor !== undefined) {
|
|
334
|
+
params.set('cursor', options.cursor);
|
|
335
|
+
}
|
|
336
|
+
const query = params.toString() ? `?${params.toString()}` : '';
|
|
337
|
+
return request(`/admin/audit-log${query}`, listAdminAuditResponseSchema);
|
|
338
|
+
},
|
|
339
|
+
listJobs(options = {}) {
|
|
340
|
+
const params = new URLSearchParams();
|
|
341
|
+
if (options.workspaceId !== undefined) {
|
|
342
|
+
params.set('workspaceId', options.workspaceId);
|
|
343
|
+
}
|
|
344
|
+
if (options.status !== undefined) {
|
|
345
|
+
params.set('status', options.status);
|
|
346
|
+
}
|
|
347
|
+
if (options.type !== undefined) {
|
|
348
|
+
params.set('type', options.type);
|
|
349
|
+
}
|
|
350
|
+
if (options.userId !== undefined) {
|
|
351
|
+
params.set('userId', options.userId);
|
|
352
|
+
}
|
|
353
|
+
if (options.limit !== undefined) {
|
|
354
|
+
params.set('limit', String(options.limit));
|
|
355
|
+
}
|
|
356
|
+
if (options.cursor !== undefined) {
|
|
357
|
+
params.set('cursor', options.cursor);
|
|
358
|
+
}
|
|
359
|
+
const query = params.toString() ? `?${params.toString()}` : '';
|
|
360
|
+
return request(`/admin/jobs${query}`, listAdminJobsResponseSchema);
|
|
361
|
+
},
|
|
362
|
+
getJob(jobId) {
|
|
363
|
+
return request(`/admin/jobs/${jobId}`, adminJobDetailResponseSchema);
|
|
364
|
+
},
|
|
365
|
+
getUsage(options = {}) {
|
|
366
|
+
const params = new URLSearchParams();
|
|
367
|
+
if (options.periodDays !== undefined) {
|
|
368
|
+
params.set('periodDays', String(options.periodDays));
|
|
369
|
+
}
|
|
370
|
+
const query = params.toString() ? `?${params.toString()}` : '';
|
|
371
|
+
return request(`/admin/usage${query}`, adminUsageResponseSchema);
|
|
372
|
+
},
|
|
373
|
+
stepUp: {
|
|
374
|
+
start() {
|
|
375
|
+
return request('/admin/step-up/start', stepUpStartResponseSchema, { method: 'POST' });
|
|
376
|
+
},
|
|
377
|
+
verify(code) {
|
|
378
|
+
return request('/admin/step-up/verify', stepUpVerifyResponseSchema, {
|
|
379
|
+
method: 'POST',
|
|
380
|
+
body: stepUpVerifyRequestSchema.parse({ code })
|
|
381
|
+
});
|
|
382
|
+
}
|
|
309
383
|
}
|
|
310
384
|
}
|
|
311
385
|
};
|
package/dist/common.d.ts
CHANGED
|
@@ -10,6 +10,7 @@ export declare const apiErrorCodeSchema: z.ZodEnum<{
|
|
|
10
10
|
not_found: "not_found";
|
|
11
11
|
validation_failed: "validation_failed";
|
|
12
12
|
rate_limited: "rate_limited";
|
|
13
|
+
step_up_required: "step_up_required";
|
|
13
14
|
internal_error: "internal_error";
|
|
14
15
|
}>;
|
|
15
16
|
export declare const errorResponseSchema: z.ZodObject<{
|
|
@@ -23,6 +24,7 @@ export declare const errorResponseSchema: z.ZodObject<{
|
|
|
23
24
|
not_found: "not_found";
|
|
24
25
|
validation_failed: "validation_failed";
|
|
25
26
|
rate_limited: "rate_limited";
|
|
27
|
+
step_up_required: "step_up_required";
|
|
26
28
|
internal_error: "internal_error";
|
|
27
29
|
}>;
|
|
28
30
|
message: z.ZodString;
|
package/dist/common.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"common.d.ts","sourceRoot":"","sources":["../src/common.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAEvB,eAAO,MAAM,QAAQ,aAAoB,CAAA;AACzC,eAAO,MAAM,aAAa,aAAwB,CAAA;AAElD,eAAO,MAAM,kBAAkB
|
|
1
|
+
{"version":3,"file":"common.d.ts","sourceRoot":"","sources":["../src/common.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAEvB,eAAO,MAAM,QAAQ,aAAoB,CAAA;AACzC,eAAO,MAAM,aAAa,aAAwB,CAAA;AAElD,eAAO,MAAM,kBAAkB;;;;;;;;;;;EAW7B,CAAA;AAEF,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;iBAM9B,CAAA;AAEF,eAAO,MAAM,gBAAgB;;iBAE3B,CAAA;AAEF,wBAAgB,gBAAgB,CAAC,OAAO,SAAS,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO;;kBAE1E;AAED,wBAAgB,kBAAkB,CAAC,OAAO,SAAS,CAAC,CAAC,OAAO,EAAE,UAAU,EAAE,OAAO;;;;;kBAKhF;AAED,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAA;AAC7D,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAA;AAC/D,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAA"}
|
package/dist/common.js
CHANGED
package/dist/generation.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
export declare const generationJobStatusSchema: z.ZodEnum<{
|
|
3
|
-
failed: "failed";
|
|
4
3
|
queued: "queued";
|
|
5
4
|
running: "running";
|
|
6
5
|
succeeded: "succeeded";
|
|
6
|
+
failed: "failed";
|
|
7
7
|
canceled: "canceled";
|
|
8
8
|
}>;
|
|
9
9
|
export declare const generationJobTypeSchema: z.ZodEnum<{
|
|
@@ -79,10 +79,10 @@ export declare const generationJobSchema: z.ZodObject<{
|
|
|
79
79
|
"video.upscale": "video.upscale";
|
|
80
80
|
}>;
|
|
81
81
|
status: z.ZodEnum<{
|
|
82
|
-
failed: "failed";
|
|
83
82
|
queued: "queued";
|
|
84
83
|
running: "running";
|
|
85
84
|
succeeded: "succeeded";
|
|
85
|
+
failed: "failed";
|
|
86
86
|
canceled: "canceled";
|
|
87
87
|
}>;
|
|
88
88
|
provider: z.ZodString;
|
|
@@ -125,10 +125,10 @@ export declare const generationJobResponseSchema: z.ZodObject<{
|
|
|
125
125
|
"video.upscale": "video.upscale";
|
|
126
126
|
}>;
|
|
127
127
|
status: z.ZodEnum<{
|
|
128
|
-
failed: "failed";
|
|
129
128
|
queued: "queued";
|
|
130
129
|
running: "running";
|
|
131
130
|
succeeded: "succeeded";
|
|
131
|
+
failed: "failed";
|
|
132
132
|
canceled: "canceled";
|
|
133
133
|
}>;
|
|
134
134
|
provider: z.ZodString;
|
|
@@ -185,10 +185,10 @@ export declare const createPanelSetResponseSchema: z.ZodObject<{
|
|
|
185
185
|
"video.upscale": "video.upscale";
|
|
186
186
|
}>;
|
|
187
187
|
status: z.ZodEnum<{
|
|
188
|
-
failed: "failed";
|
|
189
188
|
queued: "queued";
|
|
190
189
|
running: "running";
|
|
191
190
|
succeeded: "succeeded";
|
|
191
|
+
failed: "failed";
|
|
192
192
|
canceled: "canceled";
|
|
193
193
|
}>;
|
|
194
194
|
provider: z.ZodString;
|
|
@@ -231,10 +231,10 @@ export declare const createPanelSetResponseSchema: z.ZodObject<{
|
|
|
231
231
|
}, z.core.$strip>;
|
|
232
232
|
export declare const listGenerationJobsQuerySchema: z.ZodObject<{
|
|
233
233
|
status: z.ZodOptional<z.ZodEnum<{
|
|
234
|
-
failed: "failed";
|
|
235
234
|
queued: "queued";
|
|
236
235
|
running: "running";
|
|
237
236
|
succeeded: "succeeded";
|
|
237
|
+
failed: "failed";
|
|
238
238
|
canceled: "canceled";
|
|
239
239
|
}>>;
|
|
240
240
|
variantGroupId: z.ZodOptional<z.ZodString>;
|
|
@@ -255,10 +255,10 @@ export declare const listGenerationJobsResponseSchema: z.ZodObject<{
|
|
|
255
255
|
"video.upscale": "video.upscale";
|
|
256
256
|
}>;
|
|
257
257
|
status: z.ZodEnum<{
|
|
258
|
-
failed: "failed";
|
|
259
258
|
queued: "queued";
|
|
260
259
|
running: "running";
|
|
261
260
|
succeeded: "succeeded";
|
|
261
|
+
failed: "failed";
|
|
262
262
|
canceled: "canceled";
|
|
263
263
|
}>;
|
|
264
264
|
provider: z.ZodString;
|
package/dist/projects.d.ts
CHANGED
|
@@ -5,8 +5,8 @@ export declare const projectVisibilitySchema: z.ZodEnum<{
|
|
|
5
5
|
}>;
|
|
6
6
|
export declare const projectStatusSchema: z.ZodEnum<{
|
|
7
7
|
active: "active";
|
|
8
|
-
deleted: "deleted";
|
|
9
8
|
archived: "archived";
|
|
9
|
+
deleted: "deleted";
|
|
10
10
|
}>;
|
|
11
11
|
export declare const ledPanelIdSchema: z.ZodString;
|
|
12
12
|
export declare const ledPanelSchema: z.ZodObject<{
|
|
@@ -114,8 +114,8 @@ export declare const projectSchema: z.ZodObject<{
|
|
|
114
114
|
}>;
|
|
115
115
|
status: z.ZodEnum<{
|
|
116
116
|
active: "active";
|
|
117
|
-
deleted: "deleted";
|
|
118
117
|
archived: "archived";
|
|
118
|
+
deleted: "deleted";
|
|
119
119
|
}>;
|
|
120
120
|
createdAt: z.ZodString;
|
|
121
121
|
updatedAt: z.ZodString;
|
|
@@ -135,8 +135,8 @@ export declare const updateProjectRequestSchema: z.ZodObject<{
|
|
|
135
135
|
}>>;
|
|
136
136
|
status: z.ZodOptional<z.ZodEnum<{
|
|
137
137
|
active: "active";
|
|
138
|
-
deleted: "deleted";
|
|
139
138
|
archived: "archived";
|
|
139
|
+
deleted: "deleted";
|
|
140
140
|
}>>;
|
|
141
141
|
}, z.core.$strip>;
|
|
142
142
|
export type CreateProjectRequest = z.input<typeof createProjectRequestSchema>;
|