@panneau/protocol 5.0.0-alpha.4 → 5.0.0-alpha.6
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/conformance/index.d.ts.map +1 -1
- package/dist/conformance/index.js +121 -1
- package/dist/conformance/index.js.map +1 -1
- package/dist/constants.d.ts +2 -2
- package/dist/constants.d.ts.map +1 -1
- package/dist/constants.js +12 -2
- package/dist/constants.js.map +1 -1
- package/dist/index.js +5 -2
- package/dist/libraries.d.ts +16 -0
- package/dist/libraries.d.ts.map +1 -0
- package/dist/libraries.js +15 -0
- package/dist/libraries.js.map +1 -0
- package/dist/lint.d.ts +2 -2
- package/dist/lint.d.ts.map +1 -1
- package/dist/lint.js +15 -9
- package/dist/lint.js.map +1 -1
- package/dist/mock/example.d.ts.map +1 -1
- package/dist/mock/example.js +8 -0
- package/dist/mock/example.js.map +1 -1
- package/dist/mock/index.d.ts +15 -2
- package/dist/mock/index.d.ts.map +1 -1
- package/dist/mock/index.js +164 -13
- package/dist/mock/index.js.map +1 -1
- package/dist/openapi.d.ts.map +1 -1
- package/dist/openapi.js +45 -4
- package/dist/openapi.js.map +1 -1
- package/dist/rules.d.ts.map +1 -1
- package/dist/rules.js +26 -1
- package/dist/rules.js.map +1 -1
- package/dist/runtime/index.d.ts +3 -0
- package/dist/runtime/index.d.ts.map +1 -1
- package/dist/runtime/index.js +4 -1
- package/dist/schemas/action.d.ts +18 -1
- package/dist/schemas/action.d.ts.map +1 -1
- package/dist/schemas/api.d.ts +141 -0
- package/dist/schemas/api.d.ts.map +1 -1
- package/dist/schemas/api.js +54 -9
- package/dist/schemas/api.js.map +1 -1
- package/dist/schemas/definition.d.ts +40 -2
- package/dist/schemas/definition.d.ts.map +1 -1
- package/dist/schemas/definition.js +2 -1
- package/dist/schemas/definition.js.map +1 -1
- package/dist/schemas/field.d.ts +26 -1
- package/dist/schemas/field.d.ts.map +1 -1
- package/dist/schemas/field.js +27 -5
- package/dist/schemas/field.js.map +1 -1
- package/dist/schemas/index.d.ts +259 -6
- package/dist/schemas/index.d.ts.map +1 -1
- package/dist/schemas/index.js +8 -3
- package/dist/schemas/index.js.map +1 -1
- package/dist/schemas/resource.d.ts +38 -2
- package/dist/schemas/resource.d.ts.map +1 -1
- package/dist/schemas/resource.js +3 -1
- package/dist/schemas/resource.js.map +1 -1
- package/dist/search.d.ts +51 -0
- package/dist/search.d.ts.map +1 -0
- package/dist/search.js +53 -0
- package/dist/search.js.map +1 -0
- package/dist/transforms.d.ts +17 -0
- package/dist/transforms.d.ts.map +1 -0
- package/dist/transforms.js +34 -0
- package/dist/transforms.js.map +1 -0
- package/package.json +1 -1
- package/schema/boot.schema.json +82 -2
- package/schema/definition.schema.json +82 -2
- package/schema/openapi.json +507 -14
package/dist/schemas/api.d.ts
CHANGED
|
@@ -217,6 +217,11 @@ export declare const MediaTransform: z.ZodObject<{
|
|
|
217
217
|
x: z.ZodNumber;
|
|
218
218
|
y: z.ZodNumber;
|
|
219
219
|
}, z.core.$loose>>;
|
|
220
|
+
base: z.ZodOptional<z.ZodEnum<{
|
|
221
|
+
media: "media";
|
|
222
|
+
original: "original";
|
|
223
|
+
}>>;
|
|
224
|
+
baseTransform: z.ZodOptional<typeof MediaTransform>;
|
|
220
225
|
}, z.core.$loose>;
|
|
221
226
|
export declare const UploadReference: z.ZodObject<{
|
|
222
227
|
upload: z.ZodString;
|
|
@@ -282,7 +287,31 @@ export declare const MediaInfo: z.ZodObject<{
|
|
|
282
287
|
processing: "processing";
|
|
283
288
|
ready: "ready";
|
|
284
289
|
}>>;
|
|
290
|
+
error: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
291
|
+
code: z.ZodString;
|
|
292
|
+
message: z.ZodOptional<z.ZodString>;
|
|
293
|
+
}, z.core.$loose>>>;
|
|
285
294
|
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
295
|
+
transform: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
296
|
+
crop: z.ZodOptional<z.ZodObject<{
|
|
297
|
+
x: z.ZodNumber;
|
|
298
|
+
y: z.ZodNumber;
|
|
299
|
+
width: z.ZodNumber;
|
|
300
|
+
height: z.ZodNumber;
|
|
301
|
+
}, z.core.$loose>>;
|
|
302
|
+
rotate: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<0>, z.ZodLiteral<90>, z.ZodLiteral<180>, z.ZodLiteral<270>]>>;
|
|
303
|
+
flipX: z.ZodOptional<z.ZodBoolean>;
|
|
304
|
+
flipY: z.ZodOptional<z.ZodBoolean>;
|
|
305
|
+
focalPoint: z.ZodOptional<z.ZodObject<{
|
|
306
|
+
x: z.ZodNumber;
|
|
307
|
+
y: z.ZodNumber;
|
|
308
|
+
}, z.core.$loose>>;
|
|
309
|
+
base: z.ZodOptional<z.ZodEnum<{
|
|
310
|
+
media: "media";
|
|
311
|
+
original: "original";
|
|
312
|
+
}>>;
|
|
313
|
+
baseTransform: z.ZodOptional<typeof MediaTransform>;
|
|
314
|
+
}, z.core.$loose>>>;
|
|
286
315
|
}, z.core.$loose>;
|
|
287
316
|
export declare const MediaItem: z.ZodObject<{
|
|
288
317
|
id: z.ZodString;
|
|
@@ -308,11 +337,36 @@ export declare const MediaItem: z.ZodObject<{
|
|
|
308
337
|
processing: "processing";
|
|
309
338
|
ready: "ready";
|
|
310
339
|
}>>;
|
|
340
|
+
error: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
341
|
+
code: z.ZodString;
|
|
342
|
+
message: z.ZodOptional<z.ZodString>;
|
|
343
|
+
}, z.core.$loose>>>;
|
|
311
344
|
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
345
|
+
transform: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
346
|
+
crop: z.ZodOptional<z.ZodObject<{
|
|
347
|
+
x: z.ZodNumber;
|
|
348
|
+
y: z.ZodNumber;
|
|
349
|
+
width: z.ZodNumber;
|
|
350
|
+
height: z.ZodNumber;
|
|
351
|
+
}, z.core.$loose>>;
|
|
352
|
+
rotate: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<0>, z.ZodLiteral<90>, z.ZodLiteral<180>, z.ZodLiteral<270>]>>;
|
|
353
|
+
flipX: z.ZodOptional<z.ZodBoolean>;
|
|
354
|
+
flipY: z.ZodOptional<z.ZodBoolean>;
|
|
355
|
+
focalPoint: z.ZodOptional<z.ZodObject<{
|
|
356
|
+
x: z.ZodNumber;
|
|
357
|
+
y: z.ZodNumber;
|
|
358
|
+
}, z.core.$loose>>;
|
|
359
|
+
base: z.ZodOptional<z.ZodEnum<{
|
|
360
|
+
media: "media";
|
|
361
|
+
original: "original";
|
|
362
|
+
}>>;
|
|
363
|
+
baseTransform: z.ZodOptional<typeof MediaTransform>;
|
|
364
|
+
}, z.core.$loose>>>;
|
|
312
365
|
}, z.core.$loose>;
|
|
313
366
|
}, z.core.$loose>;
|
|
314
367
|
export declare const MediaReference: z.ZodObject<{
|
|
315
368
|
id: z.ZodString;
|
|
369
|
+
resource: z.ZodOptional<z.ZodString>;
|
|
316
370
|
label: z.ZodOptional<z.ZodString>;
|
|
317
371
|
media: z.ZodOptional<z.ZodObject<{
|
|
318
372
|
type: z.ZodString;
|
|
@@ -334,7 +388,31 @@ export declare const MediaReference: z.ZodObject<{
|
|
|
334
388
|
processing: "processing";
|
|
335
389
|
ready: "ready";
|
|
336
390
|
}>>;
|
|
391
|
+
error: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
392
|
+
code: z.ZodString;
|
|
393
|
+
message: z.ZodOptional<z.ZodString>;
|
|
394
|
+
}, z.core.$loose>>>;
|
|
337
395
|
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
396
|
+
transform: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
397
|
+
crop: z.ZodOptional<z.ZodObject<{
|
|
398
|
+
x: z.ZodNumber;
|
|
399
|
+
y: z.ZodNumber;
|
|
400
|
+
width: z.ZodNumber;
|
|
401
|
+
height: z.ZodNumber;
|
|
402
|
+
}, z.core.$loose>>;
|
|
403
|
+
rotate: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<0>, z.ZodLiteral<90>, z.ZodLiteral<180>, z.ZodLiteral<270>]>>;
|
|
404
|
+
flipX: z.ZodOptional<z.ZodBoolean>;
|
|
405
|
+
flipY: z.ZodOptional<z.ZodBoolean>;
|
|
406
|
+
focalPoint: z.ZodOptional<z.ZodObject<{
|
|
407
|
+
x: z.ZodNumber;
|
|
408
|
+
y: z.ZodNumber;
|
|
409
|
+
}, z.core.$loose>>;
|
|
410
|
+
base: z.ZodOptional<z.ZodEnum<{
|
|
411
|
+
media: "media";
|
|
412
|
+
original: "original";
|
|
413
|
+
}>>;
|
|
414
|
+
baseTransform: z.ZodOptional<typeof MediaTransform>;
|
|
415
|
+
}, z.core.$loose>>>;
|
|
338
416
|
}, z.core.$loose>>;
|
|
339
417
|
transform: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
340
418
|
crop: z.ZodOptional<z.ZodObject<{
|
|
@@ -350,8 +428,26 @@ export declare const MediaReference: z.ZodObject<{
|
|
|
350
428
|
x: z.ZodNumber;
|
|
351
429
|
y: z.ZodNumber;
|
|
352
430
|
}, z.core.$loose>>;
|
|
431
|
+
base: z.ZodOptional<z.ZodEnum<{
|
|
432
|
+
media: "media";
|
|
433
|
+
original: "original";
|
|
434
|
+
}>>;
|
|
435
|
+
baseTransform: z.ZodOptional<typeof MediaTransform>;
|
|
353
436
|
}, z.core.$loose>>>;
|
|
354
437
|
}, z.core.$loose>;
|
|
438
|
+
export declare const FieldCheckRequest: z.ZodObject<{
|
|
439
|
+
value: z.ZodString;
|
|
440
|
+
locale: z.ZodOptional<z.ZodString>;
|
|
441
|
+
id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
442
|
+
values: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
443
|
+
}, z.core.$loose>;
|
|
444
|
+
export declare const FieldCheckResponse: z.ZodObject<{
|
|
445
|
+
available: z.ZodBoolean;
|
|
446
|
+
suggestion: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
447
|
+
prefix: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
448
|
+
url: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
449
|
+
disabled: z.ZodOptional<z.ZodBoolean>;
|
|
450
|
+
}, z.core.$loose>;
|
|
355
451
|
export declare const Session: z.ZodObject<{
|
|
356
452
|
user: z.ZodObject<{
|
|
357
453
|
id: z.ZodString;
|
|
@@ -359,6 +455,7 @@ export declare const Session: z.ZodObject<{
|
|
|
359
455
|
email: z.ZodOptional<z.ZodString>;
|
|
360
456
|
avatarUrl: z.ZodOptional<z.ZodString>;
|
|
361
457
|
abilities: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodBoolean>>;
|
|
458
|
+
resource: z.ZodOptional<z.ZodString>;
|
|
362
459
|
}, z.core.$loose>;
|
|
363
460
|
}, z.core.$loose>;
|
|
364
461
|
export declare const SearchResponse: z.ZodObject<{
|
|
@@ -376,6 +473,45 @@ export declare const PreviewResponse: z.ZodObject<{
|
|
|
376
473
|
url: z.ZodString;
|
|
377
474
|
expiresAt: z.ZodOptional<z.ZodString>;
|
|
378
475
|
}, z.core.$loose>;
|
|
476
|
+
export declare const EmbedValue: z.ZodObject<{
|
|
477
|
+
url: z.ZodString;
|
|
478
|
+
type: z.ZodOptional<z.ZodEnum<{
|
|
479
|
+
link: "link";
|
|
480
|
+
video: "video";
|
|
481
|
+
audio: "audio";
|
|
482
|
+
photo: "photo";
|
|
483
|
+
rich: "rich";
|
|
484
|
+
}>>;
|
|
485
|
+
title: z.ZodOptional<z.ZodString>;
|
|
486
|
+
provider: z.ZodOptional<z.ZodString>;
|
|
487
|
+
thumbnailUrl: z.ZodOptional<z.ZodString>;
|
|
488
|
+
html: z.ZodOptional<z.ZodString>;
|
|
489
|
+
width: z.ZodOptional<z.ZodNumber>;
|
|
490
|
+
height: z.ZodOptional<z.ZodNumber>;
|
|
491
|
+
}, z.core.$loose>;
|
|
492
|
+
export declare const EmbedResponse: z.ZodObject<{
|
|
493
|
+
data: z.ZodObject<{
|
|
494
|
+
url: z.ZodString;
|
|
495
|
+
type: z.ZodOptional<z.ZodEnum<{
|
|
496
|
+
link: "link";
|
|
497
|
+
video: "video";
|
|
498
|
+
audio: "audio";
|
|
499
|
+
photo: "photo";
|
|
500
|
+
rich: "rich";
|
|
501
|
+
}>>;
|
|
502
|
+
title: z.ZodOptional<z.ZodString>;
|
|
503
|
+
provider: z.ZodOptional<z.ZodString>;
|
|
504
|
+
thumbnailUrl: z.ZodOptional<z.ZodString>;
|
|
505
|
+
html: z.ZodOptional<z.ZodString>;
|
|
506
|
+
width: z.ZodOptional<z.ZodNumber>;
|
|
507
|
+
height: z.ZodOptional<z.ZodNumber>;
|
|
508
|
+
}, z.core.$loose>;
|
|
509
|
+
}, z.core.$loose>;
|
|
510
|
+
export declare const LocationValue: z.ZodObject<{
|
|
511
|
+
lat: z.ZodNumber;
|
|
512
|
+
lng: z.ZodNumber;
|
|
513
|
+
address: z.ZodOptional<z.ZodString>;
|
|
514
|
+
}, z.core.$loose>;
|
|
379
515
|
export type Item = z.infer<typeof Item>;
|
|
380
516
|
export type Pagination = z.infer<typeof Pagination>;
|
|
381
517
|
export type ItemResponse = z.infer<typeof ItemResponse>;
|
|
@@ -394,10 +530,15 @@ export type Upload = z.infer<typeof Upload>;
|
|
|
394
530
|
export type UploadResponse = z.infer<typeof UploadResponse>;
|
|
395
531
|
export type UploadSignRequest = z.infer<typeof UploadSignRequest>;
|
|
396
532
|
export type UploadSignResponse = z.infer<typeof UploadSignResponse>;
|
|
533
|
+
export type FieldCheckRequest = z.infer<typeof FieldCheckRequest>;
|
|
534
|
+
export type FieldCheckResponse = z.infer<typeof FieldCheckResponse>;
|
|
397
535
|
export type MediaInfo = z.infer<typeof MediaInfo>;
|
|
398
536
|
export type MediaItem = z.infer<typeof MediaItem>;
|
|
399
537
|
export type MediaReference = z.infer<typeof MediaReference>;
|
|
400
538
|
export type Session = z.infer<typeof Session>;
|
|
401
539
|
export type SearchResponse = z.infer<typeof SearchResponse>;
|
|
402
540
|
export type PreviewResponse = z.infer<typeof PreviewResponse>;
|
|
541
|
+
export type EmbedValue = z.infer<typeof EmbedValue>;
|
|
542
|
+
export type EmbedResponse = z.infer<typeof EmbedResponse>;
|
|
543
|
+
export type LocationValue = z.infer<typeof LocationValue>;
|
|
403
544
|
//# sourceMappingURL=api.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"api.d.ts","sourceRoot":"","sources":["../../src/schemas/api.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAKxB,eAAO,MAAM,IAAI;;;;iBAUX,CAAC;AAEP,eAAO,MAAM,UAAU;;;;;iBAKrB,CAAC;AAEH,eAAO,MAAM,YAAY;;;;;;iBAAgC,CAAC;AAE1D,eAAO,MAAM,YAAY;;;;;;;;;;;;iBAA2D,CAAC;AAErF,eAAO,MAAM,OAAO;;;;;;;;;;;;iBAa6E,CAAC;AAElG,eAAO,MAAM,SAAS;;;;;;;;mBAYpB,CAAC;AAEH,eAAO,MAAM,aAAa;;;;;;;;;;;;iBASxB,CAAC;AAEH,eAAO,MAAM,gBAAgB;;;;;;;;iBAQ3B,CAAC;AAEH,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAuBvB,CAAC;AAEH,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAUpB,CAAC;AAEH,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAAoC,CAAC;AAEnE,eAAO,MAAM,cAAc
|
|
1
|
+
{"version":3,"file":"api.d.ts","sourceRoot":"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AAC;AAClD,MAAM,MAAM,SAAS,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,SAAS,CAAC,CAAC;AAClD,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,CAAC;AAC5D,MAAM,MAAM,OAAO,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,OAAO,CAAC,CAAC;AAC9C,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,CAAC;AAC5D,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,eAAe,CAAC,CAAC;AAC9D,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,UAAU,CAAC,CAAC;AACpD,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,aAAa,CAAC,CAAC;AAC1D,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,aAAa,CAAC,CAAC"}
|
package/dist/schemas/api.js
CHANGED
|
@@ -102,8 +102,12 @@ var MediaTransform = z.looseObject({
|
|
|
102
102
|
focalPoint: z.looseObject({
|
|
103
103
|
x: z.number().min(0).max(1),
|
|
104
104
|
y: z.number().min(0).max(1)
|
|
105
|
-
}).optional().meta({ description: "From 0 to 1, relative to the width and height of the upright original image, not of the crop: changing the crop does not move it. Renderers map it into the transformed image and clamp it to the crop." })
|
|
106
|
-
|
|
105
|
+
}).optional().meta({ description: "From 0 to 1, relative to the width and height of the upright original image, not of the crop: changing the crop does not move it. Renderers map it into the transformed image and clamp it to the crop." }),
|
|
106
|
+
base: z.enum(["media", "original"]).optional().meta({ description: "What a transform for one use starts from: the original file by default, or the media's own transform (`media`). With `media`, the crop and the focal point are relative to the media's version instead of the original (decision 0031)." }),
|
|
107
|
+
get baseTransform() {
|
|
108
|
+
return MediaTransform.optional().meta({ description: "With `base: \"media\"`: the media's own transform this one was made on. When the media's transform is no longer the same, clients ask to check the crop, and renderers clamp it." });
|
|
109
|
+
}
|
|
110
|
+
}).meta({ description: "Non-destructive edits of an image, applied in this order: crop, then rotate, then flip. Renderers ignore the keys they don't know, which editor tools can add." });
|
|
107
111
|
var UploadReference = z.looseObject({ upload: z.string().min(1) }).meta({ description: "A file uploaded directly to storage, by the id of its upload: in a file value, such as the `file` of a media, or an action parameter." });
|
|
108
112
|
var StoredFile = z.looseObject({
|
|
109
113
|
name: z.string().meta({ description: "The name of the file, as the user knows it." }),
|
|
@@ -158,26 +162,67 @@ var MediaInfo = z.looseObject({
|
|
|
158
162
|
"ready",
|
|
159
163
|
"failed"
|
|
160
164
|
]).optional().meta({ description: "Where the processing of the file is: `pending` and `processing` until its renditions are made, then `ready` or `failed`. Without it, the media is ready." }),
|
|
161
|
-
|
|
165
|
+
error: z.looseObject({
|
|
166
|
+
code: z.string().meta({ description: "The code of the step that failed, such as a transcoder task code (`timeout`, `input_unreadable`)." }),
|
|
167
|
+
message: z.string().optional().meta({ description: "Why it failed, for people." })
|
|
168
|
+
}).nullable().optional().meta({ description: "Why the processing failed, when `status` is `failed`, so that editors see it without the backend's monitoring." }),
|
|
169
|
+
metadata: z.record(z.string(), z.unknown()).optional(),
|
|
170
|
+
transform: MediaTransform.nullable().optional().meta({ description: "The media's own transform, from its library, which clients need to draw a transform for one use made over it (decision 0031)." })
|
|
162
171
|
}).meta({ description: "What the backend computed about the file of a media item: the `media` of the items of a `media` resource, and of the values of `media` fields. Read-only: the editable properties of a media are the fields of its resource." });
|
|
163
172
|
var MediaItem = Item.extend({ media: MediaInfo }).meta({ description: "An item of a resource of kind `media`: the values of its fields (`file`, the original, and those of the project), and the `media` the backend computed." });
|
|
164
173
|
var MediaReference = z.looseObject({
|
|
165
174
|
id: Id,
|
|
175
|
+
resource: z.string().optional().meta({ description: "The library of the media. Required for a field that allows several libraries, since ids are unique only within their resource (decision 0027)." }),
|
|
166
176
|
label: z.string().optional().meta({ description: "The `itemTitle` of the media." }),
|
|
167
177
|
media: MediaInfo.optional(),
|
|
168
|
-
transform: MediaTransform.nullable().optional().meta({ description: "The edits of the image for this use only, over
|
|
169
|
-
}).meta({ description: "The value of a `media` field in items: the media, with what lists and fields show, and its edits for this use. Requests send the id, or `{ id, transform }
|
|
178
|
+
transform: MediaTransform.nullable().optional().meta({ description: "The edits of the image for this use only: from the original file, or over the media's own transform with `base: \"media\"`." })
|
|
179
|
+
}).meta({ description: "The value of a `media` or `image` field in items: the media, with what lists and fields show, and its edits for this use. Requests send the id, or `{ id, resource, transform }`: `resource` is required when the field allows several libraries." });
|
|
180
|
+
var FieldCheckRequest = z.looseObject({
|
|
181
|
+
value: z.string().meta({ description: "The value to check, as it is typed." }),
|
|
182
|
+
locale: z.string().optional().meta({ description: "The locale of the value, for a localized field." }),
|
|
183
|
+
id: Id.nullable().optional().meta({ description: "The item being edited, or null when creating one." }),
|
|
184
|
+
values: z.record(z.string(), z.unknown()).optional().meta({ description: "The form's current values, as they would be sent to save, for what the check depends on (a page's parent)." })
|
|
185
|
+
}).meta({ description: "A value of a field with `check`, to check with the backend." });
|
|
186
|
+
var FieldCheckResponse = z.looseObject({
|
|
187
|
+
available: z.boolean().meta({ description: "Whether no other item of the resource, in its scope and the same locale, has the value." }),
|
|
188
|
+
suggestion: z.string().nullable().optional().meta({ description: "An available value close to the one checked, when it is taken." }),
|
|
189
|
+
prefix: z.string().nullable().optional().meta({ description: "What the field shows in front of the value: the start of its URL." }),
|
|
190
|
+
url: z.string().nullable().optional().meta({ description: "The URL the value gives the item, which the field links to." }),
|
|
191
|
+
disabled: z.boolean().optional().meta({ description: "The field doesn't apply to this item (the home page has no slug): the field is read-only." })
|
|
192
|
+
}).meta({ description: "What the backend says about a value: not authoritative, since saving still validates it." });
|
|
170
193
|
var Session = z.looseObject({ user: User });
|
|
171
194
|
var SearchResponse = z.looseObject({ data: z.array(z.looseObject({
|
|
172
|
-
resource: z.string(),
|
|
195
|
+
resource: z.string().meta({ description: "The id of the resource." }),
|
|
173
196
|
items: z.array(Item),
|
|
174
|
-
total: z.number().int().nonnegative().optional()
|
|
175
|
-
})) });
|
|
197
|
+
total: z.number().int().nonnegative().optional().meta({ description: "How many items of the resource match, when the backend counts them: the list of the resource, searched, shows them all." })
|
|
198
|
+
})) }).meta({ description: "The results of the global search: the resources with results, in the order of the definition." });
|
|
176
199
|
var PreviewResponse = z.looseObject({
|
|
177
200
|
url: z.string(),
|
|
178
201
|
expiresAt: z.string().optional()
|
|
179
202
|
});
|
|
203
|
+
var EmbedValue = z.looseObject({
|
|
204
|
+
url: z.string().meta({ description: "The URL of the video, sound or post." }),
|
|
205
|
+
type: z.enum([
|
|
206
|
+
"video",
|
|
207
|
+
"audio",
|
|
208
|
+
"photo",
|
|
209
|
+
"rich",
|
|
210
|
+
"link"
|
|
211
|
+
]).optional(),
|
|
212
|
+
title: z.string().optional(),
|
|
213
|
+
provider: z.string().optional().meta({ description: "The name of the provider." }),
|
|
214
|
+
thumbnailUrl: z.string().optional(),
|
|
215
|
+
html: z.string().optional().meta({ description: "The HTML that embeds it, from the oEmbed of its provider." }),
|
|
216
|
+
width: z.number().optional(),
|
|
217
|
+
height: z.number().optional()
|
|
218
|
+
}).meta({ description: "The value of an `embed` field: its URL, and what the backend got from its oEmbed." });
|
|
219
|
+
var EmbedResponse = z.looseObject({ data: EmbedValue });
|
|
220
|
+
var LocationValue = z.looseObject({
|
|
221
|
+
lat: z.number().min(-90).max(90),
|
|
222
|
+
lng: z.number().min(-180).max(180),
|
|
223
|
+
address: z.string().optional()
|
|
224
|
+
}).meta({ description: "The value of a `location` field: a point, and its address." });
|
|
180
225
|
//#endregion
|
|
181
|
-
export { ActionItemResult, ActionRequest, ActionResult, ActionRun, ActionRunResponse, Item, ItemResponse, ListResponse, MediaInfo, MediaItem, MediaReference, MediaTransform, Pagination, PreviewResponse, Problem, SearchResponse, Selection, Session, StoredFile, Upload, UploadReference, UploadResponse, UploadSignRequest, UploadSignResponse };
|
|
226
|
+
export { ActionItemResult, ActionRequest, ActionResult, ActionRun, ActionRunResponse, EmbedResponse, EmbedValue, FieldCheckRequest, FieldCheckResponse, Item, ItemResponse, ListResponse, LocationValue, MediaInfo, MediaItem, MediaReference, MediaTransform, Pagination, PreviewResponse, Problem, SearchResponse, Selection, Session, StoredFile, Upload, UploadReference, UploadResponse, UploadSignRequest, UploadSignResponse };
|
|
182
227
|
|
|
183
228
|
//# sourceMappingURL=api.js.map
|
package/dist/schemas/api.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"api.js","names":[],"sources":["../../src/schemas/api.ts"],"sourcesContent":["import { z } from 'zod';\n\nimport { Abilities, Id, RouteReference } from './common';\nimport { User } from './definition';\n\nexport const Item = z\n .looseObject({\n id: Id,\n version: z.string().nullable().meta({\n description: 'Changes on every update. `null` when the backend has no versions.',\n }),\n abilities: Abilities,\n })\n .meta({\n description: 'An item of a resource. Its other properties are the values of its fields.',\n });\n\nexport const Pagination = z.looseObject({\n page: z.number().int().positive(),\n perPage: z.number().int().positive(),\n total: z.number().int().nonnegative(),\n lastPage: z.number().int().positive(),\n});\n\nexport const ItemResponse = z.looseObject({ data: Item });\n\nexport const ListResponse = z.looseObject({ data: z.array(Item), meta: Pagination });\n\nexport const Problem = z\n .looseObject({\n type: z.string().meta({ description: 'A URI reference that identifies the problem type.' }),\n title: z.string(),\n status: z.number().int().min(400).max(599),\n detail: z.string().optional(),\n instance: z.string().optional(),\n errors: z\n .record(z.string(), z.array(z.string()))\n .optional()\n .meta({ description: '`422`: messages keyed by the dot path of the invalid value.' }),\n current: Item.optional().meta({ description: '`412`: the current version of the item.' }),\n })\n .meta({ description: 'An error, as RFC 9457 problem details (`application/problem+json`).' });\n\nexport const Selection = z.union([\n z.looseObject({ ids: z.array(Id).min(1) }),\n z.looseObject({\n query: z.looseObject({\n filter: z.record(z.string(), z.unknown()).optional().meta({\n description:\n 'The `filter` of the list query, by filter id: a value, a list of values, or the bounds of a range (`{ \"from\": \"2026-01-01\", \"to\": \"2026-01-31\" }`).',\n }),\n q: z.string().optional(),\n }),\n except: z.array(Id).optional(),\n }),\n]);\n\nexport const ActionRequest = z.looseObject({\n selection: Selection.optional().meta({\n description: 'Omitted for actions on the whole resource.',\n }),\n values: z.record(z.string(), z.unknown()).optional(),\n dryRun: z.boolean().optional().meta({\n description:\n 'Answer what the action would do without running it: a `200` action result whose `summary` counts the items that would succeed and those that would be skipped. Only for actions with `dryRun: true`.',\n }),\n});\n\nexport const ActionItemResult = z.looseObject({\n id: Id,\n status: z.enum(['failed', 'skipped']),\n message: z.string().optional(),\n reason: z\n .string()\n .optional()\n .meta({ description: '`skipped`: `forbidden`, `not_found` or `unchanged`.' }),\n});\n\nexport const ActionResult = z.looseObject({\n message: z.string().optional(),\n summary: z\n .looseObject({\n succeeded: z.number().int().nonnegative(),\n failed: z.number().int().nonnegative(),\n skipped: z.number().int().nonnegative(),\n })\n .optional(),\n results: z\n .array(ActionItemResult)\n .optional()\n .meta({ description: 'The items that did not succeed.' }),\n refresh: z.enum(['none', 'items', 'list']).optional(),\n redirect: z.union([z.string(), RouteReference]).nullable().optional(),\n download: z\n .looseObject({\n url: z.string(),\n filename: z.string().optional(),\n expiresAt: z.string().optional(),\n })\n .nullable()\n .optional(),\n});\n\nexport const ActionRun = z.looseObject({\n id: Id,\n action: z.string(),\n resource: z.string(),\n status: z.enum(['queued', 'running', 'succeeded', 'partial', 'failed', 'cancelled']),\n progress: z.number().int().nonnegative(),\n total: z.number().int().nonnegative().nullable(),\n result: ActionResult.optional().meta({ description: 'Set once the run has finished.' }),\n createdAt: z.string().optional(),\n finishedAt: z.string().nullable().optional(),\n});\n\nexport const ActionRunResponse = z.looseObject({ run: ActionRun });\n\nexport const MediaTransform = z\n .looseObject({\n crop: z\n .looseObject({\n x: z.number().int().nonnegative(),\n y: z.number().int().nonnegative(),\n width: z.number().int().positive(),\n height: z.number().int().positive(),\n })\n .optional()\n .meta({\n description:\n 'In whole pixels of the upright original image (after its EXIF orientation), from its top left corner.',\n }),\n rotate: z\n .union([z.literal(0), z.literal(90), z.literal(180), z.literal(270)])\n .optional()\n .meta({ description: 'Clockwise, in degrees.' }),\n flipX: z.boolean().optional().meta({ description: 'Mirrors left to right (horizontal).' }),\n flipY: z.boolean().optional().meta({ description: 'Mirrors top to bottom (vertical).' }),\n focalPoint: z\n .looseObject({ x: z.number().min(0).max(1), y: z.number().min(0).max(1) })\n .optional()\n .meta({\n description:\n 'From 0 to 1, relative to the width and height of the upright original image, not of the crop: changing the crop does not move it. Renderers map it into the transformed image and clamp it to the crop.',\n }),\n })\n .meta({\n description:\n 'Non-destructive edits of an image, applied in this order: crop, then rotate, then flip.',\n });\n\nexport const UploadReference = z.looseObject({ upload: z.string().min(1) }).meta({\n description:\n 'A file uploaded directly to storage, by the id of its upload: in a file value, such as the `file` of a media, or an action parameter.',\n});\n\nexport const StoredFile = z\n .looseObject({\n name: z.string().meta({ description: 'The name of the file, as the user knows it.' }),\n url: z.string().nullable().optional().meta({\n description: 'Where to download it. A private file gets a temporary URL.',\n }),\n mime: z.string().nullable().optional(),\n size: z.number().int().nonnegative().nullable().optional(),\n })\n .meta({\n description:\n 'A file stored by the backend: the value of a `file` field in items. Requests send it back to keep the file, `{ \"upload\" }` to replace it, or `null` to remove it.',\n });\n\nexport const Upload = z\n .looseObject({\n id: z.string().min(1).meta({ description: 'The id of the upload: `upl_…`.' }),\n key: z.string().optional().meta({ description: 'The key of the object in storage.' }),\n name: z.string().optional(),\n mime: z.string().optional(),\n size: z.number().int().nonnegative().optional(),\n })\n .meta({\n description:\n 'A file the browser uploaded to storage, before it becomes a media, an import or another value.',\n });\n\nexport const UploadResponse = z.looseObject({ data: Upload });\n\nexport const UploadSignRequest = z\n .looseObject({\n method: z.enum(['GET', 'POST', 'PUT', 'DELETE']),\n key: z.string().min(1),\n uploadId: z.string().optional().meta({ description: 'The S3 multipart upload.' }),\n partNumber: z.number().int().positive().optional(),\n contentType: z.string().optional(),\n expiresIn: z.number().int().positive().optional(),\n })\n .meta({\n description: \"A request of the browser's S3 client to sign (Uppy 6's `signRequest`).\",\n });\n\nexport const UploadSignResponse = z\n .looseObject({\n url: z.string(),\n key: z\n .string()\n .optional()\n .meta({ description: 'The key the backend chose, for the first request of a file.' }),\n headers: z.record(z.string(), z.string()).optional().meta({\n description: 'Headers the URL was signed with, which the browser sends.',\n }),\n upload: z\n .string()\n .optional()\n .meta({ description: 'The upload the first request of a file created: `upl_…`.' }),\n })\n .meta({ description: 'A presigned request.' });\n\nexport const MediaInfo = z\n .looseObject({\n type: z.string().meta({\n description:\n '`image`, `video`, `audio`, `document`, `font`, or another type the backend knows.',\n }),\n mime: z.string().nullable().optional(),\n size: z.number().int().nonnegative().nullable().optional(),\n url: z.string().nullable().optional().meta({\n description:\n 'The main file to show or play: a rendition, or the original until it exists.',\n }),\n thumbnailUrl: z.string().nullable().optional(),\n variants: z\n .record(\n z.string(),\n z.looseObject({\n url: z.string(),\n width: z.number().optional(),\n height: z.number().optional(),\n }),\n )\n .optional()\n .meta({ description: 'Named renditions: sizes of an image, qualities of a video.' }),\n width: z.number().nullable().optional(),\n height: z.number().nullable().optional(),\n duration: z.number().nullable().optional().meta({ description: 'In seconds.' }),\n status: z.enum(['pending', 'processing', 'ready', 'failed']).optional().meta({\n description:\n 'Where the processing of the file is: `pending` and `processing` until its renditions are made, then `ready` or `failed`. Without it, the media is ready.',\n }),\n metadata: z.record(z.string(), z.unknown()).optional(),\n })\n .meta({\n description:\n 'What the backend computed about the file of a media item: the `media` of the items of a `media` resource, and of the values of `media` fields. Read-only: the editable properties of a media are the fields of its resource.',\n });\n\nexport const MediaItem = Item.extend({\n media: MediaInfo,\n}).meta({\n description:\n 'An item of a resource of kind `media`: the values of its fields (`file`, the original, and those of the project), and the `media` the backend computed.',\n});\n\nexport const MediaReference = z\n .looseObject({\n id: Id,\n label: z.string().optional().meta({ description: 'The `itemTitle` of the media.' }),\n media: MediaInfo.optional(),\n transform: MediaTransform.nullable().optional().meta({\n description: 'The edits of the image for this use only, over those of the media.',\n }),\n })\n .meta({\n description:\n 'The value of a `media` field in items: the media, with what lists and fields show, and its edits for this use. Requests send the id, or `{ id, transform }`.',\n });\n\nexport const Session = z.looseObject({ user: User });\n\nexport const SearchResponse = z.looseObject({\n data: z.array(\n z.looseObject({\n resource: z.string(),\n items: z.array(Item),\n total: z.number().int().nonnegative().optional(),\n }),\n ),\n});\n\nexport const PreviewResponse = z.looseObject({ url: z.string(), expiresAt: z.string().optional() });\n\nexport type Item = z.infer<typeof Item>;\nexport type Pagination = z.infer<typeof Pagination>;\nexport type ItemResponse = z.infer<typeof ItemResponse>;\nexport type ListResponse = z.infer<typeof ListResponse>;\nexport type Problem = z.infer<typeof Problem>;\nexport type Selection = z.infer<typeof Selection>;\nexport type ActionRequest = z.infer<typeof ActionRequest>;\nexport type ActionItemResult = z.infer<typeof ActionItemResult>;\nexport type ActionResult = z.infer<typeof ActionResult>;\nexport type ActionRun = z.infer<typeof ActionRun>;\nexport type ActionRunResponse = z.infer<typeof ActionRunResponse>;\nexport type MediaTransform = z.infer<typeof MediaTransform>;\nexport type UploadReference = z.infer<typeof UploadReference>;\nexport type StoredFile = z.infer<typeof StoredFile>;\nexport type Upload = z.infer<typeof Upload>;\nexport type UploadResponse = z.infer<typeof UploadResponse>;\nexport type UploadSignRequest = z.infer<typeof UploadSignRequest>;\nexport type UploadSignResponse = z.infer<typeof UploadSignResponse>;\nexport type MediaInfo = z.infer<typeof MediaInfo>;\nexport type MediaItem = z.infer<typeof MediaItem>;\nexport type MediaReference = z.infer<typeof MediaReference>;\nexport type Session = z.infer<typeof Session>;\nexport type SearchResponse = z.infer<typeof SearchResponse>;\nexport type PreviewResponse = z.infer<typeof PreviewResponse>;\n"],"mappings":";;;;AAKA,IAAa,OAAO,EACf,YAAY;CACT,IAAI;CACJ,SAAS,EAAE,OAAO,CAAC,CAAC,SAAS,CAAC,CAAC,KAAK,EAChC,aAAa,oEACjB,CAAC;CACD,WAAW;AACf,CAAC,CAAC,CACD,K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iB,EACzB,YAAY;CACT,IAAI;CACJ,OAAO,EAAE,OAAO,CAAC,CAAC,SAAS,CAAC,CAAC,KAAK,EAAE,aAAa,gCAAgC,CAAC;CAClF,OAAO,UAAU,SAAS;CAC1B,WAAW,eAAe,SAAS,CAAC,CAAC,SAAS,CAAC,CAAC,KAAK,EACjD,aAAa,qEACjB,CAAC;AACL,CAAC,CAAC,CACD,KAAK,EACF,aACI,+JACR,CAAC;AAEL,IAAa,UAAU,EAAE,YAAY,EAAE,MAAM,KAAK,CAAC;AAEnD,IAAa,iBAAiB,EAAE,YAAY,EACxC,MAAM,EAAE,MACJ,EAAE,YAAY;CACV,UAAU,EAAE,OAAO;CACnB,OAAO,EAAE,MAAM,IAAI;CACnB,OAAO,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,YAAY,CAAC,CAAC,SAAS;AACnD,CAAC,CACL,EACJ,CAAC;AAED,IAAa,kBAAkB,EAAE,YAAY;CAAE,KAAK,EAAE,OAAO;CAAG,WAAW,EAAE,OAAO,CAAC,CAAC,SAAS;AAAE,CAAC"}
|
|
1
|
+
{"version":3,"file":"api.js","names":[],"sources":["../../src/schemas/api.ts"],"sourcesContent":["import { z } from 'zod';\n\nimport { Abilities, Id, RouteReference } from './common';\nimport { User } from './definition';\n\nexport const Item = z\n .looseObject({\n id: Id,\n version: z.string().nullable().meta({\n description: 'Changes on every update. `null` when the backend has no versions.',\n }),\n abilities: Abilities,\n })\n .meta({\n description: 'An item of a resource. Its other properties are the values of its fields.',\n });\n\nexport const Pagination = z.looseObject({\n page: z.number().int().positive(),\n perPage: z.number().int().positive(),\n total: z.number().int().nonnegative(),\n lastPage: z.number().int().positive(),\n});\n\nexport const ItemResponse = z.looseObject({ data: Item });\n\nexport const ListResponse = z.looseObject({ data: z.array(Item), meta: Pagination });\n\nexport const Problem = z\n .looseObject({\n type: z.string().meta({ description: 'A URI reference that identifies the problem type.' }),\n title: z.string(),\n status: z.number().int().min(400).max(599),\n detail: z.string().optional(),\n instance: z.string().optional(),\n errors: z\n .record(z.string(), z.array(z.string()))\n .optional()\n .meta({ description: '`422`: messages keyed by the dot path of the invalid value.' }),\n current: Item.optional().meta({ description: '`412`: the current version of the item.' }),\n })\n .meta({ description: 'An error, as RFC 9457 problem details (`application/problem+json`).' });\n\nexport const Selection = z.union([\n z.looseObject({ ids: z.array(Id).min(1) }),\n z.looseObject({\n query: z.looseObject({\n filter: z.record(z.string(), z.unknown()).optional().meta({\n description:\n 'The `filter` of the list query, by filter id: a value, a list of values, or the bounds of a range (`{ \"from\": \"2026-01-01\", \"to\": \"2026-01-31\" }`).',\n }),\n q: z.string().optional(),\n }),\n except: z.array(Id).optional(),\n }),\n]);\n\nexport const ActionRequest = z.looseObject({\n selection: Selection.optional().meta({\n description: 'Omitted for actions on the whole resource.',\n }),\n values: z.record(z.string(), z.unknown()).optional(),\n dryRun: z.boolean().optional().meta({\n description:\n 'Answer what the action would do without running it: a `200` action result whose `summary` counts the items that would succeed and those that would be skipped. Only for actions with `dryRun: true`.',\n }),\n});\n\nexport const ActionItemResult = z.looseObject({\n id: Id,\n status: z.enum(['failed', 'skipped']),\n message: z.string().optional(),\n reason: z\n .string()\n .optional()\n .meta({ description: '`skipped`: `forbidden`, `not_found` or `unchanged`.' }),\n});\n\nexport const ActionResult = z.looseObject({\n message: z.string().optional(),\n summary: z\n .looseObject({\n succeeded: z.number().int().nonnegative(),\n failed: z.number().int().nonnegative(),\n skipped: z.number().int().nonnegative(),\n })\n .optional(),\n results: z\n .array(ActionItemResult)\n .optional()\n .meta({ description: 'The items that did not succeed.' }),\n refresh: z.enum(['none', 'items', 'list']).optional(),\n redirect: z.union([z.string(), RouteReference]).nullable().optional(),\n download: z\n .looseObject({\n url: z.string(),\n filename: z.string().optional(),\n expiresAt: z.string().optional(),\n })\n .nullable()\n .optional(),\n});\n\nexport const ActionRun = z.looseObject({\n id: Id,\n action: z.string(),\n resource: z.string(),\n status: z.enum(['queued', 'running', 'succeeded', 'partial', 'failed', 'cancelled']),\n progress: z.number().int().nonnegative(),\n total: z.number().int().nonnegative().nullable(),\n result: ActionResult.optional().meta({ description: 'Set once the run has finished.' }),\n createdAt: z.string().optional(),\n finishedAt: z.string().nullable().optional(),\n});\n\nexport const ActionRunResponse = z.looseObject({ run: ActionRun });\n\nexport const MediaTransform = z\n .looseObject({\n crop: z\n .looseObject({\n x: z.number().int().nonnegative(),\n y: z.number().int().nonnegative(),\n width: z.number().int().positive(),\n height: z.number().int().positive(),\n })\n .optional()\n .meta({\n description:\n 'In whole pixels of the upright original image (after its EXIF orientation), from its top left corner.',\n }),\n rotate: z\n .union([z.literal(0), z.literal(90), z.literal(180), z.literal(270)])\n .optional()\n .meta({ description: 'Clockwise, in degrees.' }),\n flipX: z.boolean().optional().meta({ description: 'Mirrors left to right (horizontal).' }),\n flipY: z.boolean().optional().meta({ description: 'Mirrors top to bottom (vertical).' }),\n focalPoint: z\n .looseObject({ x: z.number().min(0).max(1), y: z.number().min(0).max(1) })\n .optional()\n .meta({\n description:\n 'From 0 to 1, relative to the width and height of the upright original image, not of the crop: changing the crop does not move it. Renderers map it into the transformed image and clamp it to the crop.',\n }),\n base: z.enum(['media', 'original']).optional().meta({\n description:\n \"What a transform for one use starts from: the original file by default, or the media's own transform (`media`). With `media`, the crop and the focal point are relative to the media's version instead of the original (decision 0031).\",\n }),\n // Return types are written out so that declaration files keep the recursion.\n get baseTransform(): z.ZodOptional<typeof MediaTransform> {\n return MediaTransform.optional().meta({\n description:\n 'With `base: \"media\"`: the media\\'s own transform this one was made on. When the media\\'s transform is no longer the same, clients ask to check the crop, and renderers clamp it.',\n });\n },\n })\n .meta({\n description:\n \"Non-destructive edits of an image, applied in this order: crop, then rotate, then flip. Renderers ignore the keys they don't know, which editor tools can add.\",\n });\n\nexport const UploadReference = z.looseObject({ upload: z.string().min(1) }).meta({\n description:\n 'A file uploaded directly to storage, by the id of its upload: in a file value, such as the `file` of a media, or an action parameter.',\n});\n\nexport const StoredFile = z\n .looseObject({\n name: z.string().meta({ description: 'The name of the file, as the user knows it.' }),\n url: z.string().nullable().optional().meta({\n description: 'Where to download it. A private file gets a temporary URL.',\n }),\n mime: z.string().nullable().optional(),\n size: z.number().int().nonnegative().nullable().optional(),\n })\n .meta({\n description:\n 'A file stored by the backend: the value of a `file` field in items. Requests send it back to keep the file, `{ \"upload\" }` to replace it, or `null` to remove it.',\n });\n\nexport const Upload = z\n .looseObject({\n id: z.string().min(1).meta({ description: 'The id of the upload: `upl_…`.' }),\n key: z.string().optional().meta({ description: 'The key of the object in storage.' }),\n name: z.string().optional(),\n mime: z.string().optional(),\n size: z.number().int().nonnegative().optional(),\n })\n .meta({\n description:\n 'A file the browser uploaded to storage, before it becomes a media, an import or another value.',\n });\n\nexport const UploadResponse = z.looseObject({ data: Upload });\n\nexport const UploadSignRequest = z\n .looseObject({\n method: z.enum(['GET', 'POST', 'PUT', 'DELETE']),\n key: z.string().min(1),\n uploadId: z.string().optional().meta({ description: 'The S3 multipart upload.' }),\n partNumber: z.number().int().positive().optional(),\n contentType: z.string().optional(),\n expiresIn: z.number().int().positive().optional(),\n })\n .meta({\n description: \"A request of the browser's S3 client to sign (Uppy 6's `signRequest`).\",\n });\n\nexport const UploadSignResponse = z\n .looseObject({\n url: z.string(),\n key: z\n .string()\n .optional()\n .meta({ description: 'The key the backend chose, for the first request of a file.' }),\n headers: z.record(z.string(), z.string()).optional().meta({\n description: 'Headers the URL was signed with, which the browser sends.',\n }),\n upload: z\n .string()\n .optional()\n .meta({ description: 'The upload the first request of a file created: `upl_…`.' }),\n })\n .meta({ description: 'A presigned request.' });\n\nexport const MediaInfo = z\n .looseObject({\n type: z.string().meta({\n description:\n '`image`, `video`, `audio`, `document`, `font`, or another type the backend knows.',\n }),\n mime: z.string().nullable().optional(),\n size: z.number().int().nonnegative().nullable().optional(),\n url: z.string().nullable().optional().meta({\n description:\n 'The main file to show or play: a rendition, or the original until it exists.',\n }),\n thumbnailUrl: z.string().nullable().optional(),\n variants: z\n .record(\n z.string(),\n z.looseObject({\n url: z.string(),\n width: z.number().optional(),\n height: z.number().optional(),\n }),\n )\n .optional()\n .meta({ description: 'Named renditions: sizes of an image, qualities of a video.' }),\n width: z.number().nullable().optional(),\n height: z.number().nullable().optional(),\n duration: z.number().nullable().optional().meta({ description: 'In seconds.' }),\n status: z.enum(['pending', 'processing', 'ready', 'failed']).optional().meta({\n description:\n 'Where the processing of the file is: `pending` and `processing` until its renditions are made, then `ready` or `failed`. Without it, the media is ready.',\n }),\n error: z\n .looseObject({\n code: z.string().meta({\n description:\n 'The code of the step that failed, such as a transcoder task code (`timeout`, `input_unreadable`).',\n }),\n message: z.string().optional().meta({ description: 'Why it failed, for people.' }),\n })\n .nullable()\n .optional()\n .meta({\n description:\n \"Why the processing failed, when `status` is `failed`, so that editors see it without the backend's monitoring.\",\n }),\n metadata: z.record(z.string(), z.unknown()).optional(),\n transform: MediaTransform.nullable().optional().meta({\n description:\n \"The media's own transform, from its library, which clients need to draw a transform for one use made over it (decision 0031).\",\n }),\n })\n .meta({\n description:\n 'What the backend computed about the file of a media item: the `media` of the items of a `media` resource, and of the values of `media` fields. Read-only: the editable properties of a media are the fields of its resource.',\n });\n\nexport const MediaItem = Item.extend({\n media: MediaInfo,\n}).meta({\n description:\n 'An item of a resource of kind `media`: the values of its fields (`file`, the original, and those of the project), and the `media` the backend computed.',\n});\n\nexport const MediaReference = z\n .looseObject({\n id: Id,\n resource: z.string().optional().meta({\n description:\n 'The library of the media. Required for a field that allows several libraries, since ids are unique only within their resource (decision 0027).',\n }),\n label: z.string().optional().meta({ description: 'The `itemTitle` of the media.' }),\n media: MediaInfo.optional(),\n transform: MediaTransform.nullable().optional().meta({\n description:\n 'The edits of the image for this use only: from the original file, or over the media\\'s own transform with `base: \"media\"`.',\n }),\n })\n .meta({\n description:\n 'The value of a `media` or `image` field in items: the media, with what lists and fields show, and its edits for this use. Requests send the id, or `{ id, resource, transform }`: `resource` is required when the field allows several libraries.',\n });\n\nexport const FieldCheckRequest = z\n .looseObject({\n value: z.string().meta({ description: 'The value to check, as it is typed.' }),\n locale: z\n .string()\n .optional()\n .meta({ description: 'The locale of the value, for a localized field.' }),\n id: Id.nullable()\n .optional()\n .meta({ description: 'The item being edited, or null when creating one.' }),\n values: z.record(z.string(), z.unknown()).optional().meta({\n description:\n \"The form's current values, as they would be sent to save, for what the check depends on (a page's parent).\",\n }),\n })\n .meta({ description: 'A value of a field with `check`, to check with the backend.' });\n\nexport const FieldCheckResponse = z\n .looseObject({\n available: z.boolean().meta({\n description:\n 'Whether no other item of the resource, in its scope and the same locale, has the value.',\n }),\n suggestion: z.string().nullable().optional().meta({\n description: 'An available value close to the one checked, when it is taken.',\n }),\n prefix: z.string().nullable().optional().meta({\n description: 'What the field shows in front of the value: the start of its URL.',\n }),\n url: z\n .string()\n .nullable()\n .optional()\n .meta({ description: 'The URL the value gives the item, which the field links to.' }),\n disabled: z.boolean().optional().meta({\n description:\n \"The field doesn't apply to this item (the home page has no slug): the field is read-only.\",\n }),\n })\n .meta({\n description:\n 'What the backend says about a value: not authoritative, since saving still validates it.',\n });\n\nexport const Session = z.looseObject({ user: User });\n\nexport const SearchResponse = z\n .looseObject({\n data: z.array(\n z.looseObject({\n resource: z.string().meta({ description: 'The id of the resource.' }),\n items: z.array(Item),\n total: z.number().int().nonnegative().optional().meta({\n description:\n 'How many items of the resource match, when the backend counts them: the list of the resource, searched, shows them all.',\n }),\n }),\n ),\n })\n .meta({\n description:\n 'The results of the global search: the resources with results, in the order of the definition.',\n });\n\nexport const PreviewResponse = z.looseObject({ url: z.string(), expiresAt: z.string().optional() });\n\nexport const EmbedValue = z\n .looseObject({\n url: z.string().meta({ description: 'The URL of the video, sound or post.' }),\n type: z.enum(['video', 'audio', 'photo', 'rich', 'link']).optional(),\n title: z.string().optional(),\n provider: z.string().optional().meta({ description: 'The name of the provider.' }),\n thumbnailUrl: z.string().optional(),\n html: z\n .string()\n .optional()\n .meta({ description: 'The HTML that embeds it, from the oEmbed of its provider.' }),\n width: z.number().optional(),\n height: z.number().optional(),\n })\n .meta({\n description:\n 'The value of an `embed` field: its URL, and what the backend got from its oEmbed.',\n });\n\nexport const EmbedResponse = z.looseObject({ data: EmbedValue });\n\nexport const LocationValue = z\n .looseObject({\n lat: z.number().min(-90).max(90),\n lng: z.number().min(-180).max(180),\n address: z.string().optional(),\n })\n .meta({ description: 'The value of a `location` field: a point, and its address.' });\n\nexport type Item = z.infer<typeof Item>;\nexport type Pagination = z.infer<typeof Pagination>;\nexport type ItemResponse = z.infer<typeof ItemResponse>;\nexport type ListResponse = z.infer<typeof ListResponse>;\nexport type Problem = z.infer<typeof Problem>;\nexport type Selection = z.infer<typeof Selection>;\nexport type ActionRequest = z.infer<typeof ActionRequest>;\nexport type ActionItemResult = z.infer<typeof ActionItemResult>;\nexport type ActionResult = z.infer<typeof ActionResult>;\nexport type ActionRun = z.infer<typeof ActionRun>;\nexport type ActionRunResponse = z.infer<typeof ActionRunResponse>;\nexport type MediaTransform = z.infer<typeof MediaTransform>;\nexport type UploadReference = z.infer<typeof UploadReference>;\nexport type StoredFile = z.infer<typeof StoredFile>;\nexport type Upload = z.infer<typeof Upload>;\nexport type UploadResponse = z.infer<typeof UploadResponse>;\nexport type UploadSignRequest = z.infer<typeof UploadSignRequest>;\nexport type UploadSignResponse = z.infer<typeof UploadSignResponse>;\nexport type FieldCheckRequest = z.infer<typeof FieldCheckRequest>;\nexport type FieldCheckResponse = z.infer<typeof FieldCheckResponse>;\nexport type MediaInfo = z.infer<typeof MediaInfo>;\nexport type MediaItem = z.infer<typeof MediaItem>;\nexport type MediaReference = z.infer<typeof MediaReference>;\nexport type Session = z.infer<typeof Session>;\nexport type SearchResponse = z.infer<typeof SearchResponse>;\nexport type PreviewResponse = z.infer<typeof PreviewResponse>;\nexport type EmbedValue = z.infer<typeof EmbedValue>;\nexport type EmbedResponse = z.infer<typeof EmbedResponse>;\nexport type LocationValue = z.infer<typeof LocationValue>;\n"],"mappings":";;;;AAKA,IAAa,OAAO,EAC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AAE,OAAO;CAAG,WAAW,EAAE,OAAO,CAAC,CAAC,SAAS;AAAE,CAAC;AAElG,IAAa,aAAa,EACrB,YAAY;CACT,KAAK,EAAE,OAAO,CAAC,CAAC,KAAK,EAAE,aAAa,uCAAuC,CAAC;CAC5E,MAAM,EAAE,KAAK;EAAC;EAAS;EAAS;EAAS;EAAQ;CAAM,CAAC,CAAC,CAAC,SAAS;CACnE,OAAO,EAAE,OAAO,CAAC,CAAC,SAAS;CAC3B,UAAU,EAAE,OAAO,CAAC,CAAC,SAAS,CAAC,CAAC,KAAK,EAAE,aAAa,4BAA4B,CAAC;CACjF,cAAc,EAAE,OAAO,CAAC,CAAC,SAAS;CAClC,MAAM,EACD,OAAO,CAAC,CACR,SAAS,CAAC,CACV,KAAK,EAAE,aAAa,4DAA4D,CAAC;CACtF,OAAO,EAAE,OAAO,CAAC,CAAC,SAAS;CAC3B,QAAQ,EAAE,OAAO,CAAC,CAAC,SAAS;AAChC,CAAC,CAAC,CACD,KAAK,EACF,aACI,oFACR,CAAC;AAEL,IAAa,gBAAgB,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAE/D,IAAa,gBAAgB,EACxB,YAAY;CACT,KAAK,EAAE,OAAO,CAAC,CAAC,IAAI,GAAG,CAAC,CAAC,IAAI,EAAE;CAC/B,KAAK,EAAE,OAAO,CAAC,CAAC,IAAI,IAAI,CAAC,CAAC,IAAI,GAAG;CACjC,SAAS,EAAE,OAAO,CAAC,CAAC,SAAS;AACjC,CAAC,CAAC,CACD,KAAK,EAAE,aAAa,6DAA6D,CAAC"}
|
|
@@ -5,6 +5,7 @@ export declare const User: z.ZodObject<{
|
|
|
5
5
|
email: z.ZodOptional<z.ZodString>;
|
|
6
6
|
avatarUrl: z.ZodOptional<z.ZodString>;
|
|
7
7
|
abilities: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodBoolean>>;
|
|
8
|
+
resource: z.ZodOptional<z.ZodString>;
|
|
8
9
|
}, z.core.$loose>;
|
|
9
10
|
export declare const AuthProvider: z.ZodObject<{
|
|
10
11
|
id: z.ZodString;
|
|
@@ -80,6 +81,8 @@ export declare const Definition: z.ZodObject<{
|
|
|
80
81
|
description: z.ZodOptional<z.ZodString>;
|
|
81
82
|
icon: z.ZodOptional<z.ZodString>;
|
|
82
83
|
itemTitle: z.ZodOptional<z.ZodString>;
|
|
84
|
+
itemSubtitle: z.ZodOptional<z.ZodString>;
|
|
85
|
+
itemImage: z.ZodOptional<z.ZodString>;
|
|
83
86
|
fields: z.ZodArray<z.ZodObject<{
|
|
84
87
|
name: z.ZodString;
|
|
85
88
|
type: z.ZodString;
|
|
@@ -110,6 +113,7 @@ export declare const Definition: z.ZodObject<{
|
|
|
110
113
|
rule: z.ZodEnum<{
|
|
111
114
|
email: "email";
|
|
112
115
|
url: "url";
|
|
116
|
+
json: "json";
|
|
113
117
|
}>;
|
|
114
118
|
message: z.ZodOptional<z.ZodString>;
|
|
115
119
|
}, z.core.$loose>, z.ZodObject<{
|
|
@@ -133,6 +137,13 @@ export declare const Definition: z.ZodObject<{
|
|
|
133
137
|
field: z.ZodString;
|
|
134
138
|
}, z.core.$loose>]>;
|
|
135
139
|
message: z.ZodOptional<z.ZodString>;
|
|
140
|
+
}, z.core.$loose>, z.ZodObject<{
|
|
141
|
+
rule: z.ZodLiteral<"crop">;
|
|
142
|
+
value: z.ZodObject<{
|
|
143
|
+
ratios: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
144
|
+
required: z.ZodOptional<z.ZodBoolean>;
|
|
145
|
+
}, z.core.$loose>;
|
|
146
|
+
message: z.ZodOptional<z.ZodString>;
|
|
136
147
|
}, z.core.$loose>, z.ZodObject<{
|
|
137
148
|
rule: z.ZodString;
|
|
138
149
|
message: z.ZodOptional<z.ZodString>;
|
|
@@ -153,9 +164,18 @@ export declare const Definition: z.ZodObject<{
|
|
|
153
164
|
disabled: z.ZodOptional<z.ZodBoolean>;
|
|
154
165
|
}, z.core.$loose>>>;
|
|
155
166
|
multiple: z.ZodOptional<z.ZodBoolean>;
|
|
156
|
-
resource: z.ZodOptional<z.ZodString
|
|
167
|
+
resource: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>>;
|
|
157
168
|
accept: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
169
|
+
ratios: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
170
|
+
rotate: z.ZodOptional<z.ZodBoolean>;
|
|
171
|
+
focalPoint: z.ZodOptional<z.ZodBoolean>;
|
|
172
|
+
transformBase: z.ZodOptional<z.ZodEnum<{
|
|
173
|
+
media: "media";
|
|
174
|
+
original: "original";
|
|
175
|
+
choose: "choose";
|
|
176
|
+
}>>;
|
|
158
177
|
from: z.ZodOptional<z.ZodString>;
|
|
178
|
+
check: z.ZodOptional<z.ZodBoolean>;
|
|
159
179
|
display: z.ZodOptional<z.ZodString>;
|
|
160
180
|
fields: z.ZodOptional<z.ZodArray<typeof import("./field").Field>>;
|
|
161
181
|
types: z.ZodOptional<z.ZodArray<typeof import("./field").BlockType>>;
|
|
@@ -279,6 +299,7 @@ export declare const Definition: z.ZodObject<{
|
|
|
279
299
|
rule: z.ZodEnum<{
|
|
280
300
|
email: "email";
|
|
281
301
|
url: "url";
|
|
302
|
+
json: "json";
|
|
282
303
|
}>;
|
|
283
304
|
message: z.ZodOptional<z.ZodString>;
|
|
284
305
|
}, z.core.$loose>, z.ZodObject<{
|
|
@@ -302,6 +323,13 @@ export declare const Definition: z.ZodObject<{
|
|
|
302
323
|
field: z.ZodString;
|
|
303
324
|
}, z.core.$loose>]>;
|
|
304
325
|
message: z.ZodOptional<z.ZodString>;
|
|
326
|
+
}, z.core.$loose>, z.ZodObject<{
|
|
327
|
+
rule: z.ZodLiteral<"crop">;
|
|
328
|
+
value: z.ZodObject<{
|
|
329
|
+
ratios: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
330
|
+
required: z.ZodOptional<z.ZodBoolean>;
|
|
331
|
+
}, z.core.$loose>;
|
|
332
|
+
message: z.ZodOptional<z.ZodString>;
|
|
305
333
|
}, z.core.$loose>, z.ZodObject<{
|
|
306
334
|
rule: z.ZodString;
|
|
307
335
|
message: z.ZodOptional<z.ZodString>;
|
|
@@ -322,9 +350,18 @@ export declare const Definition: z.ZodObject<{
|
|
|
322
350
|
disabled: z.ZodOptional<z.ZodBoolean>;
|
|
323
351
|
}, z.core.$loose>>>;
|
|
324
352
|
multiple: z.ZodOptional<z.ZodBoolean>;
|
|
325
|
-
resource: z.ZodOptional<z.ZodString
|
|
353
|
+
resource: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>>;
|
|
326
354
|
accept: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
355
|
+
ratios: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
356
|
+
rotate: z.ZodOptional<z.ZodBoolean>;
|
|
357
|
+
focalPoint: z.ZodOptional<z.ZodBoolean>;
|
|
358
|
+
transformBase: z.ZodOptional<z.ZodEnum<{
|
|
359
|
+
media: "media";
|
|
360
|
+
original: "original";
|
|
361
|
+
choose: "choose";
|
|
362
|
+
}>>;
|
|
327
363
|
from: z.ZodOptional<z.ZodString>;
|
|
364
|
+
check: z.ZodOptional<z.ZodBoolean>;
|
|
328
365
|
display: z.ZodOptional<z.ZodString>;
|
|
329
366
|
fields: z.ZodOptional<z.ZodArray<typeof import("./field").Field>>;
|
|
330
367
|
types: z.ZodOptional<z.ZodArray<typeof import("./field").BlockType>>;
|
|
@@ -502,6 +539,7 @@ export declare const Definition: z.ZodObject<{
|
|
|
502
539
|
email: z.ZodOptional<z.ZodString>;
|
|
503
540
|
avatarUrl: z.ZodOptional<z.ZodString>;
|
|
504
541
|
abilities: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodBoolean>>;
|
|
542
|
+
resource: z.ZodOptional<z.ZodString>;
|
|
505
543
|
}, z.core.$loose>>>;
|
|
506
544
|
}, z.core.$loose>;
|
|
507
545
|
export type User = z.infer<typeof User>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"definition.d.ts","sourceRoot":"","sources":["../../src/schemas/definition.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAOxB,eAAO,MAAM,IAAI
|
|
1
|
+
{"version":3,"file":"definition.d.ts","sourceRoot":"","sources":["../../src/schemas/definition.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAOxB,eAAO,MAAM,IAAI;;;;;;;iBAUf,CAAC;AAEH,eAAO,MAAM,YAAY;;;;;iBAKvB,CAAC;AAEH,eAAO,MAAM,IAAI;;;;;;;;;;;;;;;;;iBAef,CAAC;AAEH,eAAO,MAAM,QAAQ;;;;;;;;cAYG,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,QAAQ,CAAC,OAAO,QAAQ,CAAC,CAAC;iBAIjB,CAAC;AAElD,eAAO,MAAM,IAAI;;;;;iBAQf,CAAC;AAEH,eAAO,MAAM,MAAM;;;;;;iBAQjB,CAAC;AAEH,eAAO,MAAM,OAAO;;;;;;;;iBAUlB,CAAC;AAEH,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAtCC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,QAAQ,CAAC,OAAO,QAAQ,CAAC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBA6EiC,CAAC;AAEpG,MAAM,MAAM,IAAI,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,IAAI,CAAC,CAAC;AACxC,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,YAAY,CAAC,CAAC;AACxD,MAAM,MAAM,IAAI,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,IAAI,CAAC,CAAC;AACxC,MAAM,MAAM,QAAQ,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,QAAQ,CAAC,CAAC;AAChD,MAAM,MAAM,IAAI,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,IAAI,CAAC,CAAC;AACxC,MAAM,MAAM,MAAM,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,MAAM,CAAC,CAAC;AAC5C,MAAM,MAAM,OAAO,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,OAAO,CAAC,CAAC;AAC9C,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,UAAU,CAAC,CAAC;AACpD,wEAAwE;AACxE,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,UAAU,CAAC,CAAC"}
|
|
@@ -9,7 +9,8 @@ var User = z.looseObject({
|
|
|
9
9
|
name: z.string(),
|
|
10
10
|
email: z.string().optional(),
|
|
11
11
|
avatarUrl: z.string().optional(),
|
|
12
|
-
abilities: Abilities.optional()
|
|
12
|
+
abilities: Abilities.optional(),
|
|
13
|
+
resource: z.string().optional().meta({ description: "The resource of users: its item with this `id` is the profile of the user. Without it, clients look for a resource `users`." })
|
|
13
14
|
});
|
|
14
15
|
var AuthProvider = z.looseObject({
|
|
15
16
|
id: z.string().min(1),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"definition.js","names":[],"sources":["../../src/schemas/definition.ts"],"sourcesContent":["import { z } from 'zod';\n\nimport { PROTOCOL_VERSION } from '../version';\nimport { Abilities, Id } from './common';\nimport { Resource } from './resource';\nimport { DefinitionTheme } from './theme';\n\nexport const User = z.looseObject({\n id: Id,\n name: z.string(),\n email: z.string().optional(),\n avatarUrl: z.string().optional(),\n abilities: Abilities.optional(),\n});\n\nexport const AuthProvider = z.looseObject({\n id: z.string().min(1),\n label: z.string(),\n url: z.string().optional().meta({ description: 'Where the login with this provider starts.' }),\n icon: z.string().optional(),\n});\n\nexport const Auth = z.looseObject({\n mode: z.enum(['panneau', 'external']).meta({\n description: \"`panneau`: Panneau's own login pages. `external`: the site handles login.\",\n }),\n loginUrl: z\n .string()\n .nullable()\n .optional()\n .meta({ description: '`external`: where unauthenticated users are sent.' }),\n password: z.boolean().optional(),\n providers: z.array(AuthProvider).optional(),\n passwordReset: z.boolean().optional(),\n twoFactor: z.boolean().optional(),\n passkeys: z.boolean().optional(),\n emailVerification: z.boolean().optional(),\n});\n\nexport const MenuItem = z\n .looseObject({\n type: z.string().min(1).meta({\n description: 'Built-in: `resources`, `resource`, `page`, `link`, `separator`, `group`.',\n }),\n label: z.string().optional(),\n icon: z.string().optional(),\n resource: z.string().optional(),\n page: z.string().optional(),\n url: z.string().optional(),\n external: z.boolean().optional(),\n // The return type is written out so that declaration files keep the recursion.\n get children(): z.ZodOptional<z.ZodArray<typeof MenuItem>> {\n return z.array(MenuItem).optional();\n },\n })\n .meta({ description: 'An entry of a menu.' });\n\nexport const Page = z.looseObject({\n component: z\n .string()\n .min(1)\n .meta({ description: 'A page provided by a plugin, or a built-in page.' }),\n path: z.string().optional().meta({ description: 'Path of a custom page.' }),\n label: z.string().optional(),\n props: z.record(z.string(), z.unknown()).optional(),\n});\n\nexport const Widget = z.looseObject({\n id: z.string().min(1),\n type: z.string().min(1).meta({\n description: 'Built-in: `stat`, `chart`, `recent-items`, `shortcuts`, `welcome`.',\n }),\n label: z.string().optional(),\n width: z.number().int().min(1).max(12).optional(),\n settings: z.record(z.string(), z.unknown()).optional(),\n});\n\nexport const Uploads = z.looseObject({\n mode: z.enum(['multipart', 'tus', 'presigned']).meta({\n description:\n '`multipart`: files go through `POST /media` and the requests that take them. `presigned`: the browser also sends files to storage itself, with URLs that `POST /uploads/sign` signs, then `POST /uploads/{upload}/complete` gives an upload that values reference.',\n }),\n endpoint: z.string().optional().meta({\n description:\n '`presigned`: the base URL of the upload routes, when they are not `{api.baseUrl}/uploads`.',\n }),\n maxSize: z.number().int().positive().optional(),\n});\n\nexport const Definition = z\n .looseObject({\n protocol: z.literal(PROTOCOL_VERSION),\n name: z.string(),\n locale: z\n .string()\n .min(2)\n .meta({ description: 'BCP 47 locale of the labels and messages.' }),\n locales: z\n .array(z.string().min(2))\n .min(1)\n .meta({ description: 'Locales of localized content fields.' }),\n api: z.looseObject({ baseUrl: z.string() }),\n resources: z.array(Resource),\n pages: z.record(z.string(), Page).optional(),\n menus: z.record(z.string(), z.array(MenuItem)).optional(),\n routes: z.record(z.string(), z.string()).optional().meta({\n description: 'Named paths of the frontend, for `link` actions and redirects.',\n }),\n auth: Auth.optional(),\n dashboard: z.looseObject({ widgets: z.array(Widget) }).optional(),\n search: z.looseObject({ enabled: z.boolean() }).optional(),\n uploads: Uploads.optional(),\n theme: DefinitionTheme.optional(),\n user: User.nullable().optional(),\n })\n .superRefine((definition, context) => {\n const ids = new Set<string>();\n definition.resources.forEach((resource, index) => {\n if (ids.has(resource.id)) {\n context.addIssue({\n code: 'custom',\n message: `Duplicate resource id \\`${resource.id}\\`.`,\n path: ['resources', index, 'id'],\n });\n }\n ids.add(resource.id);\n });\n })\n .meta({ description: 'Everything a frontend needs to render the admin for the current user.' });\n\nexport type User = z.infer<typeof User>;\nexport type AuthProvider = z.infer<typeof AuthProvider>;\nexport type Auth = z.infer<typeof Auth>;\nexport type MenuItem = z.infer<typeof MenuItem>;\nexport type Page = z.infer<typeof Page>;\nexport type Widget = z.infer<typeof Widget>;\nexport type Uploads = z.infer<typeof Uploads>;\nexport type Definition = z.infer<typeof Definition>;\n/** A definition as a backend writes it, before defaults are applied. */\nexport type DefinitionInput = z.input<typeof Definition>;\n"],"mappings":";;;;;;AAOA,IAAa,OAAO,EAAE,YAAY;CAC9B,IAAI;CACJ,MAAM,EAAE,OAAO;CACf,OAAO,EAAE,OAAO,CAAC,CAAC,SAAS;CAC3B,WAAW,EAAE,OAAO,CAAC,CAAC,SAAS;CAC/B,WAAW,UAAU,SAAS;
|
|
1
|
+
{"version":3,"file":"definition.js","names":[],"sources":["../../src/schemas/definition.ts"],"sourcesContent":["import { z } from 'zod';\n\nimport { PROTOCOL_VERSION } from '../version';\nimport { Abilities, Id } from './common';\nimport { Resource } from './resource';\nimport { DefinitionTheme } from './theme';\n\nexport const User = z.looseObject({\n id: Id,\n name: z.string(),\n email: z.string().optional(),\n avatarUrl: z.string().optional(),\n abilities: Abilities.optional(),\n resource: z.string().optional().meta({\n description:\n 'The resource of users: its item with this `id` is the profile of the user. Without it, clients look for a resource `users`.',\n }),\n});\n\nexport const AuthProvider = z.looseObject({\n id: z.string().min(1),\n label: z.string(),\n url: z.string().optional().meta({ description: 'Where the login with this provider starts.' }),\n icon: z.string().optional(),\n});\n\nexport const Auth = z.looseObject({\n mode: z.enum(['panneau', 'external']).meta({\n description: \"`panneau`: Panneau's own login pages. `external`: the site handles login.\",\n }),\n loginUrl: z\n .string()\n .nullable()\n .optional()\n .meta({ description: '`external`: where unauthenticated users are sent.' }),\n password: z.boolean().optional(),\n providers: z.array(AuthProvider).optional(),\n passwordReset: z.boolean().optional(),\n twoFactor: z.boolean().optional(),\n passkeys: z.boolean().optional(),\n emailVerification: z.boolean().optional(),\n});\n\nexport const MenuItem = z\n .looseObject({\n type: z.string().min(1).meta({\n description: 'Built-in: `resources`, `resource`, `page`, `link`, `separator`, `group`.',\n }),\n label: z.string().optional(),\n icon: z.string().optional(),\n resource: z.string().optional(),\n page: z.string().optional(),\n url: z.string().optional(),\n external: z.boolean().optional(),\n // The return type is written out so that declaration files keep the recursion.\n get children(): z.ZodOptional<z.ZodArray<typeof MenuItem>> {\n return z.array(MenuItem).optional();\n },\n })\n .meta({ description: 'An entry of a menu.' });\n\nexport const Page = z.looseObject({\n component: z\n .string()\n .min(1)\n .meta({ description: 'A page provided by a plugin, or a built-in page.' }),\n path: z.string().optional().meta({ description: 'Path of a custom page.' }),\n label: z.string().optional(),\n props: z.record(z.string(), z.unknown()).optional(),\n});\n\nexport const Widget = z.looseObject({\n id: z.string().min(1),\n type: z.string().min(1).meta({\n description: 'Built-in: `stat`, `chart`, `recent-items`, `shortcuts`, `welcome`.',\n }),\n label: z.string().optional(),\n width: z.number().int().min(1).max(12).optional(),\n settings: z.record(z.string(), z.unknown()).optional(),\n});\n\nexport const Uploads = z.looseObject({\n mode: z.enum(['multipart', 'tus', 'presigned']).meta({\n description:\n '`multipart`: files go through `POST /media` and the requests that take them. `presigned`: the browser also sends files to storage itself, with URLs that `POST /uploads/sign` signs, then `POST /uploads/{upload}/complete` gives an upload that values reference.',\n }),\n endpoint: z.string().optional().meta({\n description:\n '`presigned`: the base URL of the upload routes, when they are not `{api.baseUrl}/uploads`.',\n }),\n maxSize: z.number().int().positive().optional(),\n});\n\nexport const Definition = z\n .looseObject({\n protocol: z.literal(PROTOCOL_VERSION),\n name: z.string(),\n locale: z\n .string()\n .min(2)\n .meta({ description: 'BCP 47 locale of the labels and messages.' }),\n locales: z\n .array(z.string().min(2))\n .min(1)\n .meta({ description: 'Locales of localized content fields.' }),\n api: z.looseObject({ baseUrl: z.string() }),\n resources: z.array(Resource),\n pages: z.record(z.string(), Page).optional(),\n menus: z.record(z.string(), z.array(MenuItem)).optional(),\n routes: z.record(z.string(), z.string()).optional().meta({\n description: 'Named paths of the frontend, for `link` actions and redirects.',\n }),\n auth: Auth.optional(),\n dashboard: z.looseObject({ widgets: z.array(Widget) }).optional(),\n search: z.looseObject({ enabled: z.boolean() }).optional(),\n uploads: Uploads.optional(),\n theme: DefinitionTheme.optional(),\n user: User.nullable().optional(),\n })\n .superRefine((definition, context) => {\n const ids = new Set<string>();\n definition.resources.forEach((resource, index) => {\n if (ids.has(resource.id)) {\n context.addIssue({\n code: 'custom',\n message: `Duplicate resource id \\`${resource.id}\\`.`,\n path: ['resources', index, 'id'],\n });\n }\n ids.add(resource.id);\n });\n })\n .meta({ description: 'Everything a frontend needs to render the admin for the current user.' });\n\nexport type User = z.infer<typeof User>;\nexport type AuthProvider = z.infer<typeof AuthProvider>;\nexport type Auth = z.infer<typeof Auth>;\nexport type MenuItem = z.infer<typeof MenuItem>;\nexport type Page = z.infer<typeof Page>;\nexport type Widget = z.infer<typeof Widget>;\nexport type Uploads = z.infer<typeof Uploads>;\nexport type Definition = z.infer<typeof Definition>;\n/** A definition as a backend writes it, before defaults are applied. */\nexport type DefinitionInput = z.input<typeof Definition>;\n"],"mappings":";;;;;;AAOA,IAAa,OAAO,EAAE,YAAY;CAC9B,IAAI;CACJ,MAAM,EAAE,OAAO;CACf,OAAO,EAAE,OAAO,CAAC,CAAC,SAAS;CAC3B,WAAW,EAAE,OAAO,CAAC,CAAC,SAAS;CAC/B,WAAW,UAAU,SAAS;CAC9B,UAAU,EAAE,OAAO,CAAC,CAAC,SAAS,CAAC,CAAC,KAAK,EACjC,aACI,8HACR,CAAC;AACL,CAAC;AAED,IAAa,eAAe,EAAE,YAAY;CACtC,IAAI,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC;CACpB,OAAO,EAAE,OAAO;CAChB,KAAK,EAAE,OAAO,CAAC,CAAC,SAAS,CAAC,CAAC,KAAK,EAAE,aAAa,6CAA6C,CAAC;CAC7F,MAAM,EAAE,OAAO,CAAC,CAAC,SAAS;AAC9B,CAAC;AAED,IAAa,OAAO,EAAE,YAAY;CAC9B,MAAM,EAAE,KAAK,CAAC,WAAW,UAAU,CAAC,CAAC,CAAC,KAAK,EACvC,a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