@anuragpal02/zcl-contracts 0.16.0 → 0.17.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 +217 -0
- package/dist/admin.d.ts.map +1 -1
- package/dist/admin.js +84 -0
- package/dist/assets.d.ts +8 -8
- package/dist/client.d.ts +20 -2
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +55 -1
- 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
|
@@ -158,6 +158,212 @@ export declare const setPlatformAdminResponseSchema: z.ZodObject<{
|
|
|
158
158
|
isPlatformAdmin: z.ZodBoolean;
|
|
159
159
|
}, z.core.$strip>;
|
|
160
160
|
}, z.core.$strip>;
|
|
161
|
+
export declare const setUserDisabledRequestSchema: z.ZodObject<{
|
|
162
|
+
disabled: z.ZodBoolean;
|
|
163
|
+
}, z.core.$strip>;
|
|
164
|
+
export declare const setUserDisabledResponseSchema: z.ZodObject<{
|
|
165
|
+
data: z.ZodObject<{
|
|
166
|
+
id: z.ZodString;
|
|
167
|
+
email: z.ZodString;
|
|
168
|
+
name: z.ZodString;
|
|
169
|
+
disabledAt: z.ZodNullable<z.ZodString>;
|
|
170
|
+
createdAt: z.ZodString;
|
|
171
|
+
workspaceCount: z.ZodNumber;
|
|
172
|
+
isPlatformAdmin: z.ZodBoolean;
|
|
173
|
+
}, z.core.$strip>;
|
|
174
|
+
}, z.core.$strip>;
|
|
175
|
+
export declare const adminAuditEntrySchema: z.ZodObject<{
|
|
176
|
+
id: z.ZodString;
|
|
177
|
+
actorUserId: z.ZodString;
|
|
178
|
+
actorEmail: z.ZodNullable<z.ZodString>;
|
|
179
|
+
action: z.ZodString;
|
|
180
|
+
targetType: z.ZodString;
|
|
181
|
+
targetId: z.ZodNullable<z.ZodString>;
|
|
182
|
+
metadata: z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
183
|
+
requestId: z.ZodNullable<z.ZodString>;
|
|
184
|
+
createdAt: z.ZodString;
|
|
185
|
+
}, z.core.$strip>;
|
|
186
|
+
export declare const listAdminAuditResponseSchema: z.ZodObject<{
|
|
187
|
+
data: z.ZodObject<{
|
|
188
|
+
entries: z.ZodArray<z.ZodObject<{
|
|
189
|
+
id: z.ZodString;
|
|
190
|
+
actorUserId: z.ZodString;
|
|
191
|
+
actorEmail: z.ZodNullable<z.ZodString>;
|
|
192
|
+
action: z.ZodString;
|
|
193
|
+
targetType: z.ZodString;
|
|
194
|
+
targetId: z.ZodNullable<z.ZodString>;
|
|
195
|
+
metadata: z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
196
|
+
requestId: z.ZodNullable<z.ZodString>;
|
|
197
|
+
createdAt: z.ZodString;
|
|
198
|
+
}, z.core.$strip>>;
|
|
199
|
+
}, z.core.$strip>;
|
|
200
|
+
}, z.core.$strip>;
|
|
201
|
+
export declare const adminJobStatusSchema: z.ZodEnum<{
|
|
202
|
+
queued: "queued";
|
|
203
|
+
running: "running";
|
|
204
|
+
succeeded: "succeeded";
|
|
205
|
+
failed: "failed";
|
|
206
|
+
canceled: "canceled";
|
|
207
|
+
}>;
|
|
208
|
+
export declare const adminJobSummarySchema: z.ZodObject<{
|
|
209
|
+
id: z.ZodString;
|
|
210
|
+
workspaceId: z.ZodString;
|
|
211
|
+
projectId: z.ZodString;
|
|
212
|
+
type: z.ZodEnum<{
|
|
213
|
+
"image.generate": "image.generate";
|
|
214
|
+
"prompt.enhance": "prompt.enhance";
|
|
215
|
+
"image.edit": "image.edit";
|
|
216
|
+
"image.mask": "image.mask";
|
|
217
|
+
"image.export": "image.export";
|
|
218
|
+
"image.panel": "image.panel";
|
|
219
|
+
"video.loop": "video.loop";
|
|
220
|
+
"video.upscale": "video.upscale";
|
|
221
|
+
}>;
|
|
222
|
+
status: z.ZodEnum<{
|
|
223
|
+
queued: "queued";
|
|
224
|
+
running: "running";
|
|
225
|
+
succeeded: "succeeded";
|
|
226
|
+
failed: "failed";
|
|
227
|
+
canceled: "canceled";
|
|
228
|
+
}>;
|
|
229
|
+
provider: z.ZodString;
|
|
230
|
+
reservedCredits: z.ZodNumber;
|
|
231
|
+
createdByUserId: z.ZodString;
|
|
232
|
+
createdAt: z.ZodString;
|
|
233
|
+
}, z.core.$strip>;
|
|
234
|
+
export declare const listAdminJobsResponseSchema: z.ZodObject<{
|
|
235
|
+
data: z.ZodObject<{
|
|
236
|
+
jobs: z.ZodArray<z.ZodObject<{
|
|
237
|
+
id: z.ZodString;
|
|
238
|
+
workspaceId: z.ZodString;
|
|
239
|
+
projectId: z.ZodString;
|
|
240
|
+
type: z.ZodEnum<{
|
|
241
|
+
"image.generate": "image.generate";
|
|
242
|
+
"prompt.enhance": "prompt.enhance";
|
|
243
|
+
"image.edit": "image.edit";
|
|
244
|
+
"image.mask": "image.mask";
|
|
245
|
+
"image.export": "image.export";
|
|
246
|
+
"image.panel": "image.panel";
|
|
247
|
+
"video.loop": "video.loop";
|
|
248
|
+
"video.upscale": "video.upscale";
|
|
249
|
+
}>;
|
|
250
|
+
status: z.ZodEnum<{
|
|
251
|
+
queued: "queued";
|
|
252
|
+
running: "running";
|
|
253
|
+
succeeded: "succeeded";
|
|
254
|
+
failed: "failed";
|
|
255
|
+
canceled: "canceled";
|
|
256
|
+
}>;
|
|
257
|
+
provider: z.ZodString;
|
|
258
|
+
reservedCredits: z.ZodNumber;
|
|
259
|
+
createdByUserId: z.ZodString;
|
|
260
|
+
createdAt: z.ZodString;
|
|
261
|
+
}, z.core.$strip>>;
|
|
262
|
+
}, z.core.$strip>;
|
|
263
|
+
}, z.core.$strip>;
|
|
264
|
+
export declare const adminJobStepSchema: z.ZodObject<{
|
|
265
|
+
name: z.ZodString;
|
|
266
|
+
status: z.ZodString;
|
|
267
|
+
attempt: z.ZodNumber;
|
|
268
|
+
providerRequestId: z.ZodNullable<z.ZodString>;
|
|
269
|
+
providerJobId: z.ZodNullable<z.ZodString>;
|
|
270
|
+
error: z.ZodNullable<z.ZodString>;
|
|
271
|
+
createdAt: z.ZodString;
|
|
272
|
+
}, z.core.$strip>;
|
|
273
|
+
export declare const adminJobEventSchema: z.ZodObject<{
|
|
274
|
+
source: z.ZodString;
|
|
275
|
+
visibility: z.ZodString;
|
|
276
|
+
type: z.ZodString;
|
|
277
|
+
data: z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
278
|
+
createdAt: z.ZodString;
|
|
279
|
+
}, z.core.$strip>;
|
|
280
|
+
export declare const adminJobDetailResponseSchema: z.ZodObject<{
|
|
281
|
+
data: z.ZodObject<{
|
|
282
|
+
job: z.ZodObject<{
|
|
283
|
+
id: z.ZodString;
|
|
284
|
+
workspaceId: z.ZodString;
|
|
285
|
+
projectId: z.ZodString;
|
|
286
|
+
type: z.ZodEnum<{
|
|
287
|
+
"image.generate": "image.generate";
|
|
288
|
+
"prompt.enhance": "prompt.enhance";
|
|
289
|
+
"image.edit": "image.edit";
|
|
290
|
+
"image.mask": "image.mask";
|
|
291
|
+
"image.export": "image.export";
|
|
292
|
+
"image.panel": "image.panel";
|
|
293
|
+
"video.loop": "video.loop";
|
|
294
|
+
"video.upscale": "video.upscale";
|
|
295
|
+
}>;
|
|
296
|
+
status: z.ZodEnum<{
|
|
297
|
+
queued: "queued";
|
|
298
|
+
running: "running";
|
|
299
|
+
succeeded: "succeeded";
|
|
300
|
+
failed: "failed";
|
|
301
|
+
canceled: "canceled";
|
|
302
|
+
}>;
|
|
303
|
+
provider: z.ZodString;
|
|
304
|
+
reservedCredits: z.ZodNumber;
|
|
305
|
+
createdByUserId: z.ZodString;
|
|
306
|
+
createdAt: z.ZodString;
|
|
307
|
+
}, z.core.$strip>;
|
|
308
|
+
steps: z.ZodArray<z.ZodObject<{
|
|
309
|
+
name: z.ZodString;
|
|
310
|
+
status: z.ZodString;
|
|
311
|
+
attempt: z.ZodNumber;
|
|
312
|
+
providerRequestId: z.ZodNullable<z.ZodString>;
|
|
313
|
+
providerJobId: z.ZodNullable<z.ZodString>;
|
|
314
|
+
error: z.ZodNullable<z.ZodString>;
|
|
315
|
+
createdAt: z.ZodString;
|
|
316
|
+
}, z.core.$strip>>;
|
|
317
|
+
events: z.ZodArray<z.ZodObject<{
|
|
318
|
+
source: z.ZodString;
|
|
319
|
+
visibility: z.ZodString;
|
|
320
|
+
type: z.ZodString;
|
|
321
|
+
data: z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
322
|
+
createdAt: z.ZodString;
|
|
323
|
+
}, z.core.$strip>>;
|
|
324
|
+
}, z.core.$strip>;
|
|
325
|
+
}, z.core.$strip>;
|
|
326
|
+
export declare const adminUsageResponseSchema: z.ZodObject<{
|
|
327
|
+
data: z.ZodObject<{
|
|
328
|
+
periodDays: z.ZodNumber;
|
|
329
|
+
ledgerTotals: z.ZodObject<{
|
|
330
|
+
grant: z.ZodNumber;
|
|
331
|
+
reserve: z.ZodNumber;
|
|
332
|
+
capture: z.ZodNumber;
|
|
333
|
+
release: z.ZodNumber;
|
|
334
|
+
refund: z.ZodNumber;
|
|
335
|
+
adjustment: z.ZodNumber;
|
|
336
|
+
}, z.core.$strip>;
|
|
337
|
+
jobsByType: z.ZodArray<z.ZodObject<{
|
|
338
|
+
type: z.ZodEnum<{
|
|
339
|
+
"image.generate": "image.generate";
|
|
340
|
+
"prompt.enhance": "prompt.enhance";
|
|
341
|
+
"image.edit": "image.edit";
|
|
342
|
+
"image.mask": "image.mask";
|
|
343
|
+
"image.export": "image.export";
|
|
344
|
+
"image.panel": "image.panel";
|
|
345
|
+
"video.loop": "video.loop";
|
|
346
|
+
"video.upscale": "video.upscale";
|
|
347
|
+
}>;
|
|
348
|
+
count: z.ZodNumber;
|
|
349
|
+
}, z.core.$strip>>;
|
|
350
|
+
jobsByStatus: z.ZodArray<z.ZodObject<{
|
|
351
|
+
status: z.ZodEnum<{
|
|
352
|
+
queued: "queued";
|
|
353
|
+
running: "running";
|
|
354
|
+
succeeded: "succeeded";
|
|
355
|
+
failed: "failed";
|
|
356
|
+
canceled: "canceled";
|
|
357
|
+
}>;
|
|
358
|
+
count: z.ZodNumber;
|
|
359
|
+
}, z.core.$strip>>;
|
|
360
|
+
topWorkspacesBySpend: z.ZodArray<z.ZodObject<{
|
|
361
|
+
workspaceId: z.ZodString;
|
|
362
|
+
name: z.ZodString;
|
|
363
|
+
capturedCredits: z.ZodNumber;
|
|
364
|
+
}, z.core.$strip>>;
|
|
365
|
+
}, z.core.$strip>;
|
|
366
|
+
}, z.core.$strip>;
|
|
161
367
|
export type CreditLedgerType = z.infer<typeof creditLedgerTypeSchema>;
|
|
162
368
|
export type AdminMeResponse = z.infer<typeof adminMeResponseSchema>;
|
|
163
369
|
export type AdminUserSummary = z.infer<typeof adminUserSummarySchema>;
|
|
@@ -170,4 +376,15 @@ export type AdminAdjustCreditsRequest = z.input<typeof adminAdjustCreditsRequest
|
|
|
170
376
|
export type AdminAdjustCreditsResponse = z.infer<typeof adminAdjustCreditsResponseSchema>;
|
|
171
377
|
export type SetPlatformAdminRequest = z.input<typeof setPlatformAdminRequestSchema>;
|
|
172
378
|
export type SetPlatformAdminResponse = z.infer<typeof setPlatformAdminResponseSchema>;
|
|
379
|
+
export type SetUserDisabledRequest = z.input<typeof setUserDisabledRequestSchema>;
|
|
380
|
+
export type SetUserDisabledResponse = z.infer<typeof setUserDisabledResponseSchema>;
|
|
381
|
+
export type AdminAuditEntry = z.infer<typeof adminAuditEntrySchema>;
|
|
382
|
+
export type ListAdminAuditResponse = z.infer<typeof listAdminAuditResponseSchema>;
|
|
383
|
+
export type AdminJobStatus = z.infer<typeof adminJobStatusSchema>;
|
|
384
|
+
export type AdminJobSummary = z.infer<typeof adminJobSummarySchema>;
|
|
385
|
+
export type ListAdminJobsResponse = z.infer<typeof listAdminJobsResponseSchema>;
|
|
386
|
+
export type AdminJobStep = z.infer<typeof adminJobStepSchema>;
|
|
387
|
+
export type AdminJobEvent = z.infer<typeof adminJobEventSchema>;
|
|
388
|
+
export type AdminJobDetailResponse = z.infer<typeof adminJobDetailResponseSchema>;
|
|
389
|
+
export type AdminUsageResponse = z.infer<typeof adminUsageResponseSchema>;
|
|
173
390
|
//# 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;;;;;;;;;;;;iBAIxC,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;;;;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HANGED
|
@@ -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.
|
|
@@ -79,3 +80,86 @@ export const setPlatformAdminRequestSchema = z.object({
|
|
|
79
80
|
isPlatformAdmin: z.boolean()
|
|
80
81
|
});
|
|
81
82
|
export const setPlatformAdminResponseSchema = apiSuccessSchema(adminUserSummarySchema);
|
|
83
|
+
// Disable / re-enable a user (soft lock). Echoes back the updated summary so the panel
|
|
84
|
+
// can re-render the row without a refetch.
|
|
85
|
+
export const setUserDisabledRequestSchema = z.object({
|
|
86
|
+
disabled: z.boolean()
|
|
87
|
+
});
|
|
88
|
+
export const setUserDisabledResponseSchema = apiSuccessSchema(adminUserSummarySchema);
|
|
89
|
+
// One row of the platform-admin audit trail. `metadata` is the free-form action payload
|
|
90
|
+
// (e.g. the credit delta + reason); all the optional context columns are nullable.
|
|
91
|
+
export const adminAuditEntrySchema = z.object({
|
|
92
|
+
id: idSchema,
|
|
93
|
+
actorUserId: idSchema,
|
|
94
|
+
actorEmail: z.string().nullable(),
|
|
95
|
+
action: z.string(),
|
|
96
|
+
targetType: z.string(),
|
|
97
|
+
targetId: z.string().nullable(),
|
|
98
|
+
metadata: z.record(z.string(), z.unknown()).nullable(),
|
|
99
|
+
requestId: z.string().nullable(),
|
|
100
|
+
createdAt: isoDateSchema
|
|
101
|
+
});
|
|
102
|
+
export const listAdminAuditResponseSchema = apiSuccessSchema(z.object({
|
|
103
|
+
entries: z.array(adminAuditEntrySchema)
|
|
104
|
+
}));
|
|
105
|
+
export const adminJobStatusSchema = z.enum(['queued', 'running', 'succeeded', 'failed', 'canceled']);
|
|
106
|
+
// `projectId` is NON-nullable — generation_jobs.project_id is NOT NULL.
|
|
107
|
+
export const adminJobSummarySchema = z.object({
|
|
108
|
+
id: idSchema,
|
|
109
|
+
workspaceId: idSchema,
|
|
110
|
+
projectId: idSchema,
|
|
111
|
+
type: generationJobTypeSchema,
|
|
112
|
+
status: adminJobStatusSchema,
|
|
113
|
+
provider: z.string(),
|
|
114
|
+
reservedCredits: z.number().int(),
|
|
115
|
+
createdByUserId: idSchema,
|
|
116
|
+
createdAt: isoDateSchema
|
|
117
|
+
});
|
|
118
|
+
export const listAdminJobsResponseSchema = apiSuccessSchema(z.object({
|
|
119
|
+
jobs: z.array(adminJobSummarySchema)
|
|
120
|
+
}));
|
|
121
|
+
export const adminJobStepSchema = z.object({
|
|
122
|
+
name: z.string(),
|
|
123
|
+
status: z.string(),
|
|
124
|
+
attempt: z.number().int(),
|
|
125
|
+
providerRequestId: z.string().nullable(),
|
|
126
|
+
providerJobId: z.string().nullable(),
|
|
127
|
+
error: z.string().nullable(),
|
|
128
|
+
createdAt: isoDateSchema
|
|
129
|
+
});
|
|
130
|
+
export const adminJobEventSchema = z.object({
|
|
131
|
+
source: z.string(),
|
|
132
|
+
visibility: z.string(),
|
|
133
|
+
type: z.string(),
|
|
134
|
+
data: z.record(z.string(), z.unknown()).nullable(),
|
|
135
|
+
createdAt: isoDateSchema
|
|
136
|
+
});
|
|
137
|
+
export const adminJobDetailResponseSchema = apiSuccessSchema(z.object({
|
|
138
|
+
job: adminJobSummarySchema,
|
|
139
|
+
steps: z.array(adminJobStepSchema),
|
|
140
|
+
events: z.array(adminJobEventSchema)
|
|
141
|
+
}));
|
|
142
|
+
export const adminUsageResponseSchema = apiSuccessSchema(z.object({
|
|
143
|
+
periodDays: z.number().int(),
|
|
144
|
+
ledgerTotals: z.object({
|
|
145
|
+
grant: z.number().int(),
|
|
146
|
+
reserve: z.number().int(),
|
|
147
|
+
capture: z.number().int(),
|
|
148
|
+
release: z.number().int(),
|
|
149
|
+
refund: z.number().int(),
|
|
150
|
+
adjustment: z.number().int()
|
|
151
|
+
}),
|
|
152
|
+
jobsByType: z.array(z.object({
|
|
153
|
+
type: generationJobTypeSchema,
|
|
154
|
+
count: z.number().int()
|
|
155
|
+
})),
|
|
156
|
+
jobsByStatus: z.array(z.object({
|
|
157
|
+
status: adminJobStatusSchema,
|
|
158
|
+
count: z.number().int()
|
|
159
|
+
})),
|
|
160
|
+
topWorkspacesBySpend: z.array(z.object({
|
|
161
|
+
workspaceId: idSchema,
|
|
162
|
+
name: z.string(),
|
|
163
|
+
capturedCredits: z.number().int()
|
|
164
|
+
}))
|
|
165
|
+
}));
|
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 } from './admin.js';
|
|
11
11
|
type FetchLike = (request: Request) => Promise<Response>;
|
|
12
12
|
export type ZclApiClientOptions = {
|
|
13
13
|
baseUrl: string;
|
|
@@ -117,6 +117,24 @@ export declare function createZclApiClient(options: ZclApiClientOptions): {
|
|
|
117
117
|
getWorkspace(workspaceId: string): Promise<AdminWorkspaceDetailResponse>;
|
|
118
118
|
adjustCredits(workspaceId: string, input: AdminAdjustCreditsRequest): Promise<AdminAdjustCreditsResponse>;
|
|
119
119
|
setPlatformAdmin(userId: string, input: SetPlatformAdminRequest): Promise<SetPlatformAdminResponse>;
|
|
120
|
+
setUserDisabled(userId: string, input: SetUserDisabledRequest): Promise<SetUserDisabledResponse>;
|
|
121
|
+
listAuditLog(options?: {
|
|
122
|
+
action?: string;
|
|
123
|
+
actorId?: string;
|
|
124
|
+
targetId?: string;
|
|
125
|
+
limit?: number;
|
|
126
|
+
}): Promise<ListAdminAuditResponse>;
|
|
127
|
+
listJobs(options?: {
|
|
128
|
+
workspaceId?: string;
|
|
129
|
+
status?: AdminJobStatus;
|
|
130
|
+
type?: GenerationJobType;
|
|
131
|
+
userId?: string;
|
|
132
|
+
limit?: number;
|
|
133
|
+
}): Promise<ListAdminJobsResponse>;
|
|
134
|
+
getJob(jobId: string): Promise<AdminJobDetailResponse>;
|
|
135
|
+
getUsage(options?: {
|
|
136
|
+
periodDays?: number;
|
|
137
|
+
}): Promise<AdminUsageResponse>;
|
|
120
138
|
};
|
|
121
139
|
};
|
|
122
140
|
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,0BAA0B,EAC/B,KAAK,kBAAkB,EACxB,MAAM,aAAa,CAAA;AACpB,OAAO,EAML,KAAK,oBAAoB,EACzB,KAAK,cAAc,EACnB,KAAK,OAAO,EACZ,KAAK,mBAAmB,EACxB,KAAK,oBAAoB,EAC1B,MAAM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E,UAAU,CAAC,EAAE,MAAM,CAAA;SAAE,GAAQ,OAAO,CAAC,kBAAkB,CAAC;;EAUjF;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 } from './admin.js';
|
|
11
11
|
const workspaceListResponseSchema = listResponseSchema(workspaceSchema.extend({
|
|
12
12
|
membership: workspaceMembershipSchema
|
|
13
13
|
}));
|
|
@@ -306,6 +306,60 @@ export function createZclApiClient(options) {
|
|
|
306
306
|
method: 'POST',
|
|
307
307
|
body: setPlatformAdminRequestSchema.parse(input)
|
|
308
308
|
});
|
|
309
|
+
},
|
|
310
|
+
setUserDisabled(userId, input) {
|
|
311
|
+
return request(`/admin/users/${userId}/disable`, setUserDisabledResponseSchema, {
|
|
312
|
+
method: 'POST',
|
|
313
|
+
body: setUserDisabledRequestSchema.parse(input)
|
|
314
|
+
});
|
|
315
|
+
},
|
|
316
|
+
listAuditLog(options = {}) {
|
|
317
|
+
const params = new URLSearchParams();
|
|
318
|
+
if (options.action !== undefined) {
|
|
319
|
+
params.set('action', options.action);
|
|
320
|
+
}
|
|
321
|
+
if (options.actorId !== undefined) {
|
|
322
|
+
params.set('actorId', options.actorId);
|
|
323
|
+
}
|
|
324
|
+
if (options.targetId !== undefined) {
|
|
325
|
+
params.set('targetId', options.targetId);
|
|
326
|
+
}
|
|
327
|
+
if (options.limit !== undefined) {
|
|
328
|
+
params.set('limit', String(options.limit));
|
|
329
|
+
}
|
|
330
|
+
const query = params.toString() ? `?${params.toString()}` : '';
|
|
331
|
+
return request(`/admin/audit-log${query}`, listAdminAuditResponseSchema);
|
|
332
|
+
},
|
|
333
|
+
listJobs(options = {}) {
|
|
334
|
+
const params = new URLSearchParams();
|
|
335
|
+
if (options.workspaceId !== undefined) {
|
|
336
|
+
params.set('workspaceId', options.workspaceId);
|
|
337
|
+
}
|
|
338
|
+
if (options.status !== undefined) {
|
|
339
|
+
params.set('status', options.status);
|
|
340
|
+
}
|
|
341
|
+
if (options.type !== undefined) {
|
|
342
|
+
params.set('type', options.type);
|
|
343
|
+
}
|
|
344
|
+
if (options.userId !== undefined) {
|
|
345
|
+
params.set('userId', options.userId);
|
|
346
|
+
}
|
|
347
|
+
if (options.limit !== undefined) {
|
|
348
|
+
params.set('limit', String(options.limit));
|
|
349
|
+
}
|
|
350
|
+
const query = params.toString() ? `?${params.toString()}` : '';
|
|
351
|
+
return request(`/admin/jobs${query}`, listAdminJobsResponseSchema);
|
|
352
|
+
},
|
|
353
|
+
getJob(jobId) {
|
|
354
|
+
return request(`/admin/jobs/${jobId}`, adminJobDetailResponseSchema);
|
|
355
|
+
},
|
|
356
|
+
getUsage(options = {}) {
|
|
357
|
+
const params = new URLSearchParams();
|
|
358
|
+
if (options.periodDays !== undefined) {
|
|
359
|
+
params.set('periodDays', String(options.periodDays));
|
|
360
|
+
}
|
|
361
|
+
const query = params.toString() ? `?${params.toString()}` : '';
|
|
362
|
+
return request(`/admin/usage${query}`, adminUsageResponseSchema);
|
|
309
363
|
}
|
|
310
364
|
}
|
|
311
365
|
};
|
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>;
|