@echovisionlab/geul-common 0.4.0 → 0.5.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.
@@ -1,4 +1,4 @@
1
- import { z } from "zod";
1
+ import * as z from "zod/mini";
2
2
 
3
3
  export type RuntimeEntityType =
4
4
  | "post"
@@ -237,156 +237,161 @@ export const ogGenerationRuntimeStatusSchema = z.enum([
237
237
  ]);
238
238
 
239
239
  export const ogGenerationLifecycleRuntimePayloadSchema = z
240
- .object({
241
- generationId: z.string().min(1),
242
- runId: z.string().min(1),
240
+ .strictObject({
241
+ generationId: z.string().check(z.minLength(1)),
242
+ runId: z.string().check(z.minLength(1)),
243
243
  status: ogGenerationRuntimeStatusSchema,
244
- assetId: z.string().min(1).optional(),
245
- assetUrl: z.string().min(1).optional(),
246
- errorCode: z.string().min(1).optional(),
247
- error: z.string().min(1).optional(),
248
- replacementGenerationId: z.string().min(1).optional(),
244
+ assetId: z.optional(z.string().check(z.minLength(1))),
245
+ assetUrl: z.optional(z.string().check(z.minLength(1))),
246
+ errorCode: z.optional(z.string().check(z.minLength(1))),
247
+ error: z.optional(z.string().check(z.minLength(1))),
248
+ replacementGenerationId: z.optional(z.string().check(z.minLength(1))),
249
249
  })
250
- .strict()
251
- .superRefine((payload, ctx) => {
252
- if (payload.status === "ready" && !payload.assetId) {
253
- ctx.addIssue({
254
- code: z.ZodIssueCode.custom,
255
- path: ["assetId"],
256
- message: "ready OG lifecycle requires assetId",
257
- });
258
- }
259
- if (payload.status === "failed" && !payload.error) {
260
- ctx.addIssue({
261
- code: z.ZodIssueCode.custom,
262
- path: ["error"],
263
- message: "failed OG lifecycle requires error",
264
- });
265
- }
266
- if (payload.status === "superseded" && !payload.replacementGenerationId) {
267
- ctx.addIssue({
268
- code: z.ZodIssueCode.custom,
269
- path: ["replacementGenerationId"],
270
- message: "superseded OG lifecycle requires replacementGenerationId",
271
- });
272
- }
273
- if (payload.status !== "ready" && (payload.assetId || payload.assetUrl)) {
274
- ctx.addIssue({
275
- code: z.ZodIssueCode.custom,
276
- path: ["assetId"],
277
- message: "only ready OG lifecycle may include an asset",
278
- });
279
- }
280
- if (payload.status !== "superseded" && payload.replacementGenerationId) {
281
- ctx.addIssue({
282
- code: z.ZodIssueCode.custom,
283
- path: ["replacementGenerationId"],
284
- message: "only superseded OG lifecycle may include a replacement",
285
- });
286
- }
287
- });
288
-
289
- export const mediaProcessingRuntimeOutputsSchema = z
290
- .object({
291
- spectrogramAssetId: z.string().optional(),
292
- thumbnailAssetId: z.string().optional(),
293
- hlsGenerationId: z.string().optional(),
294
- durationSeconds: z.number().int().nonnegative().optional(),
295
- waveformAssetId: z.string().optional(),
296
- })
297
- .strict();
250
+ .check(
251
+ z.superRefine((payload, ctx) => {
252
+ if (payload.status === "ready" && !payload.assetId) {
253
+ ctx.addIssue({
254
+ code: "custom",
255
+ path: ["assetId"],
256
+ message: "ready OG lifecycle requires assetId",
257
+ });
258
+ }
259
+ if (payload.status === "failed" && !payload.error) {
260
+ ctx.addIssue({
261
+ code: "custom",
262
+ path: ["error"],
263
+ message: "failed OG lifecycle requires error",
264
+ });
265
+ }
266
+ if (payload.status === "superseded" && !payload.replacementGenerationId) {
267
+ ctx.addIssue({
268
+ code: "custom",
269
+ path: ["replacementGenerationId"],
270
+ message: "superseded OG lifecycle requires replacementGenerationId",
271
+ });
272
+ }
273
+ if (payload.status !== "ready" && (payload.assetId || payload.assetUrl)) {
274
+ ctx.addIssue({
275
+ code: "custom",
276
+ path: ["assetId"],
277
+ message: "only ready OG lifecycle may include an asset",
278
+ });
279
+ }
280
+ if (payload.status !== "superseded" && payload.replacementGenerationId) {
281
+ ctx.addIssue({
282
+ code: "custom",
283
+ path: ["replacementGenerationId"],
284
+ message: "only superseded OG lifecycle may include a replacement",
285
+ });
286
+ }
287
+ }),
288
+ );
289
+
290
+ export const mediaProcessingRuntimeOutputsSchema = z.strictObject({
291
+ spectrogramAssetId: z.optional(z.string()),
292
+ thumbnailAssetId: z.optional(z.string()),
293
+ hlsGenerationId: z.optional(z.string()),
294
+ durationSeconds: z.optional(z.int().check(z.nonnegative())),
295
+ waveformAssetId: z.optional(z.string()),
296
+ });
298
297
 
299
298
  export const mediaProcessingLifecycleRuntimePayloadSchema = z
300
- .object({
301
- fileId: z.string().min(1),
302
- slotId: z.string().optional(),
303
- attemptId: z.string().optional(),
299
+ .strictObject({
300
+ fileId: z.string().check(z.minLength(1)),
301
+ slotId: z.optional(z.string()),
302
+ attemptId: z.optional(z.string()),
304
303
  status: mediaProcessingRuntimeStatusSchema,
305
- percentage: z.number().int().min(0).max(100).optional(),
306
- outputs: mediaProcessingRuntimeOutputsSchema.optional(),
307
- error: z.string().optional(),
308
- trackId: z.string().optional(),
309
- releaseId: z.string().optional(),
310
- })
311
- .strict()
312
- .superRefine((payload, ctx) => {
313
- if (
314
- payload.status === "processing" &&
315
- typeof payload.percentage !== "number"
316
- ) {
317
- ctx.addIssue({
318
- code: z.ZodIssueCode.custom,
319
- path: ["percentage"],
320
- message: "processing media lifecycle requires percentage",
321
- });
322
- }
323
- if (payload.status === "processing" && payload.outputs) {
324
- ctx.addIssue({
325
- code: z.ZodIssueCode.custom,
326
- path: ["outputs"],
327
- message: "processing media lifecycle must not include ready outputs",
328
- });
329
- }
330
- if (payload.status === "ready" && !payload.outputs) {
331
- ctx.addIssue({
332
- code: z.ZodIssueCode.custom,
333
- path: ["outputs"],
334
- message: "ready media lifecycle requires outputs",
335
- });
336
- }
337
- if (payload.status === "ready" && typeof payload.percentage === "number") {
338
- ctx.addIssue({
339
- code: z.ZodIssueCode.custom,
340
- path: ["percentage"],
341
- message: "ready media lifecycle must not include processing percentage",
342
- });
343
- }
344
- if (payload.status === "failed" && payload.outputs) {
345
- ctx.addIssue({
346
- code: z.ZodIssueCode.custom,
347
- path: ["outputs"],
348
- message: "failed media lifecycle must not include ready outputs",
349
- });
350
- }
351
- if (payload.status === "failed" && typeof payload.percentage === "number") {
352
- ctx.addIssue({
353
- code: z.ZodIssueCode.custom,
354
- path: ["percentage"],
355
- message:
356
- "failed media lifecycle must not include processing percentage",
357
- });
358
- }
359
- });
360
-
361
- export const fileIngestLifecycleRuntimePayloadSchema = z
362
- .object({
363
- fileId: z.string().min(1),
364
- uploadId: z.string().optional(),
365
- mediaKind: z.string().optional(),
366
- slotId: z.string().optional(),
367
- attemptId: z.string().optional(),
368
- source: z.enum(["upload", "embed"]),
369
- stage: z.enum([
370
- "uploading",
371
- "downloading",
372
- "finalized",
373
- "attached",
374
- "completed",
375
- "expired",
376
- "failed",
377
- "unknown",
378
- ]),
379
- progress: z.number().int().min(0).max(100),
380
- bytesCompleted: z.number().int().nonnegative().optional(),
381
- bytesTotal: z.number().int().nonnegative().optional(),
382
- fileName: z.string().optional(),
383
- mimeType: z.string().optional(),
384
- fileSize: z.number().int().nonnegative().optional(),
385
- error: z.string().optional(),
386
- trackId: z.string().optional(),
387
- releaseId: z.string().optional(),
304
+ percentage: z.optional(z.int().check(z.minimum(0), z.maximum(100))),
305
+ outputs: z.optional(mediaProcessingRuntimeOutputsSchema),
306
+ error: z.optional(z.string()),
307
+ trackId: z.optional(z.string()),
308
+ releaseId: z.optional(z.string()),
388
309
  })
389
- .strict();
310
+ .check(
311
+ z.superRefine((payload, ctx) => {
312
+ if (
313
+ payload.status === "processing" &&
314
+ typeof payload.percentage !== "number"
315
+ ) {
316
+ ctx.addIssue({
317
+ code: "custom",
318
+ path: ["percentage"],
319
+ message: "processing media lifecycle requires percentage",
320
+ });
321
+ }
322
+ if (payload.status === "processing" && payload.outputs) {
323
+ ctx.addIssue({
324
+ code: "custom",
325
+ path: ["outputs"],
326
+ message: "processing media lifecycle must not include ready outputs",
327
+ });
328
+ }
329
+ if (payload.status === "ready" && !payload.outputs) {
330
+ ctx.addIssue({
331
+ code: "custom",
332
+ path: ["outputs"],
333
+ message: "ready media lifecycle requires outputs",
334
+ });
335
+ }
336
+ if (
337
+ payload.status === "ready" &&
338
+ typeof payload.percentage === "number"
339
+ ) {
340
+ ctx.addIssue({
341
+ code: "custom",
342
+ path: ["percentage"],
343
+ message:
344
+ "ready media lifecycle must not include processing percentage",
345
+ });
346
+ }
347
+ if (payload.status === "failed" && payload.outputs) {
348
+ ctx.addIssue({
349
+ code: "custom",
350
+ path: ["outputs"],
351
+ message: "failed media lifecycle must not include ready outputs",
352
+ });
353
+ }
354
+ if (
355
+ payload.status === "failed" &&
356
+ typeof payload.percentage === "number"
357
+ ) {
358
+ ctx.addIssue({
359
+ code: "custom",
360
+ path: ["percentage"],
361
+ message:
362
+ "failed media lifecycle must not include processing percentage",
363
+ });
364
+ }
365
+ }),
366
+ );
367
+
368
+ export const fileIngestLifecycleRuntimePayloadSchema = z.strictObject({
369
+ fileId: z.string().check(z.minLength(1)),
370
+ uploadId: z.optional(z.string()),
371
+ mediaKind: z.optional(z.string()),
372
+ slotId: z.optional(z.string()),
373
+ attemptId: z.optional(z.string()),
374
+ source: z.enum(["upload", "embed"]),
375
+ stage: z.enum([
376
+ "uploading",
377
+ "downloading",
378
+ "finalized",
379
+ "attached",
380
+ "completed",
381
+ "expired",
382
+ "failed",
383
+ "unknown",
384
+ ]),
385
+ progress: z.int().check(z.minimum(0), z.maximum(100)),
386
+ bytesCompleted: z.optional(z.int().check(z.nonnegative())),
387
+ bytesTotal: z.optional(z.int().check(z.nonnegative())),
388
+ fileName: z.optional(z.string()),
389
+ mimeType: z.optional(z.string()),
390
+ fileSize: z.optional(z.int().check(z.nonnegative())),
391
+ error: z.optional(z.string()),
392
+ trackId: z.optional(z.string()),
393
+ releaseId: z.optional(z.string()),
394
+ });
390
395
 
391
396
  const localeScopedOgEntityTypes = new Set<OgGenerationRuntimeEntityType>([
392
397
  "post",
@@ -397,138 +402,123 @@ const localeScopedOgEntityTypes = new Set<OgGenerationRuntimeEntityType>([
397
402
  ]);
398
403
 
399
404
  const ogGenerationLifecycleRuntimeEventSchema = z
400
- .object({
405
+ .strictObject({
401
406
  version: z.literal(1),
402
407
  kind: z.literal("og.lifecycle"),
403
408
  entityType: ogGenerationRuntimeEntityTypeSchema,
404
- entityId: z.string().min(1),
405
- locale: z.string().min(1).optional(),
406
- correlationId: z.string().min(1),
407
- sequence: z.number().int().optional(),
408
- timestampMs: z.number().int(),
409
+ entityId: z.string().check(z.minLength(1)),
410
+ locale: z.optional(z.string().check(z.minLength(1))),
411
+ correlationId: z.string().check(z.minLength(1)),
412
+ sequence: z.optional(z.int()),
413
+ timestampMs: z.int(),
409
414
  payload: ogGenerationLifecycleRuntimePayloadSchema,
410
415
  })
411
- .strict()
412
- .superRefine((event, ctx) => {
413
- const requiresLocale = localeScopedOgEntityTypes.has(event.entityType);
414
- if (requiresLocale && !event.locale) {
415
- ctx.addIssue({
416
- code: z.ZodIssueCode.custom,
417
- path: ["locale"],
418
- message: `${event.entityType} OG lifecycle requires a locale target`,
419
- });
420
- }
421
- if (!requiresLocale && event.locale) {
422
- ctx.addIssue({
423
- code: z.ZodIssueCode.custom,
424
- path: ["locale"],
425
- message: `${event.entityType} OG lifecycle requires an entity target`,
426
- });
427
- }
428
- if (event.correlationId !== event.payload.generationId) {
429
- ctx.addIssue({
430
- code: z.ZodIssueCode.custom,
431
- path: ["correlationId"],
432
- message: "OG lifecycle correlationId must equal payload.generationId",
433
- });
434
- }
435
- });
436
-
437
- export const translationLifecycleRuntimePayloadSchema = z
438
- .object({
439
- jobId: z.string().min(1),
440
- targetLocale: z.string().min(1),
441
- status: z.literal("failed"),
442
- error: z.string().optional(),
443
- })
444
- .strict();
416
+ .check(
417
+ z.superRefine((event, ctx) => {
418
+ const requiresLocale = localeScopedOgEntityTypes.has(event.entityType);
419
+ if (requiresLocale && !event.locale) {
420
+ ctx.addIssue({
421
+ code: "custom",
422
+ path: ["locale"],
423
+ message: `${event.entityType} OG lifecycle requires a locale target`,
424
+ });
425
+ }
426
+ if (!requiresLocale && event.locale) {
427
+ ctx.addIssue({
428
+ code: "custom",
429
+ path: ["locale"],
430
+ message: `${event.entityType} OG lifecycle requires an entity target`,
431
+ });
432
+ }
433
+ if (event.correlationId !== event.payload.generationId) {
434
+ ctx.addIssue({
435
+ code: "custom",
436
+ path: ["correlationId"],
437
+ message: "OG lifecycle correlationId must equal payload.generationId",
438
+ });
439
+ }
440
+ }),
441
+ );
442
+
443
+ export const translationLifecycleRuntimePayloadSchema = z.strictObject({
444
+ jobId: z.string().check(z.minLength(1)),
445
+ targetLocale: z.string().check(z.minLength(1)),
446
+ status: z.literal("failed"),
447
+ error: z.optional(z.string()),
448
+ });
445
449
 
446
450
  export const editorRuntimeEventSchema = z.discriminatedUnion("kind", [
447
451
  ogGenerationLifecycleRuntimeEventSchema,
448
- z
449
- .object({
450
- version: z.literal(1),
451
- kind: z.literal("render.complete"),
452
- entityType: runtimeEntityTypeSchema,
453
- entityId: z.string().min(1),
454
- locale: z.string().optional(),
455
- correlationId: z.string().optional(),
456
- sequence: z.number().int().optional(),
457
- timestampMs: z.number().int(),
458
- payload: z
459
- .object({
460
- contentHash: z.string(),
461
- success: z.boolean(),
462
- error: z.string().optional(),
463
- })
464
- .strict(),
465
- })
466
- .strict(),
467
- z
468
- .object({
469
- version: z.literal(1),
470
- kind: z.literal("media.processing.lifecycle"),
471
- entityType: runtimeEntityTypeSchema,
472
- entityId: z.string().min(1),
473
- locale: z.string().optional(),
474
- correlationId: z.string().optional(),
475
- sequence: z.number().int().optional(),
476
- timestampMs: z.number().int(),
477
- payload: mediaProcessingLifecycleRuntimePayloadSchema,
478
- })
479
- .strict(),
480
- z
481
- .object({
482
- version: z.literal(1),
483
- kind: z.literal("file.ingest.lifecycle"),
484
- entityType: runtimeEntityTypeSchema,
485
- entityId: z.string().min(1),
486
- locale: z.string().optional(),
487
- correlationId: z.string().optional(),
488
- sequence: z.number().int().optional(),
489
- timestampMs: z.number().int(),
490
- payload: fileIngestLifecycleRuntimePayloadSchema,
491
- })
492
- .strict(),
493
- z
494
- .object({
495
- version: z.literal(1),
496
- kind: z.literal("translation.lifecycle"),
497
- entityType: runtimeEntityTypeSchema,
498
- entityId: z.string().min(1),
499
- locale: z.string().optional(),
500
- correlationId: z.string().optional(),
501
- sequence: z.number().int().optional(),
502
- timestampMs: z.number().int(),
503
- payload: translationLifecycleRuntimePayloadSchema,
504
- })
505
- .strict(),
506
- z
507
- .object({
508
- version: z.literal(1),
509
- kind: z.literal("runtime.error"),
510
- entityType: runtimeEntityTypeSchema,
511
- entityId: z.string().min(1),
512
- locale: z.string().optional(),
513
- correlationId: z.string().optional(),
514
- sequence: z.number().int().optional(),
515
- timestampMs: z.number().int(),
516
- payload: z
517
- .object({
518
- code: z.string().min(1),
519
- message: z.string(),
520
- retryable: z.boolean().optional(),
521
- source: z.enum(["backend", "collab", "worker"]).optional(),
522
- details: z
523
- .record(
524
- z.string(),
525
- z.union([z.string(), z.number(), z.boolean(), z.null()]),
526
- )
527
- .optional(),
528
- })
529
- .strict(),
530
- })
531
- .strict(),
452
+ z.strictObject({
453
+ version: z.literal(1),
454
+ kind: z.literal("render.complete"),
455
+ entityType: runtimeEntityTypeSchema,
456
+ entityId: z.string().check(z.minLength(1)),
457
+ locale: z.optional(z.string()),
458
+ correlationId: z.optional(z.string()),
459
+ sequence: z.optional(z.int()),
460
+ timestampMs: z.int(),
461
+ payload: z.strictObject({
462
+ contentHash: z.string(),
463
+ success: z.boolean(),
464
+ error: z.optional(z.string()),
465
+ }),
466
+ }),
467
+ z.strictObject({
468
+ version: z.literal(1),
469
+ kind: z.literal("media.processing.lifecycle"),
470
+ entityType: runtimeEntityTypeSchema,
471
+ entityId: z.string().check(z.minLength(1)),
472
+ locale: z.optional(z.string()),
473
+ correlationId: z.optional(z.string()),
474
+ sequence: z.optional(z.int()),
475
+ timestampMs: z.int(),
476
+ payload: mediaProcessingLifecycleRuntimePayloadSchema,
477
+ }),
478
+ z.strictObject({
479
+ version: z.literal(1),
480
+ kind: z.literal("file.ingest.lifecycle"),
481
+ entityType: runtimeEntityTypeSchema,
482
+ entityId: z.string().check(z.minLength(1)),
483
+ locale: z.optional(z.string()),
484
+ correlationId: z.optional(z.string()),
485
+ sequence: z.optional(z.int()),
486
+ timestampMs: z.int(),
487
+ payload: fileIngestLifecycleRuntimePayloadSchema,
488
+ }),
489
+ z.strictObject({
490
+ version: z.literal(1),
491
+ kind: z.literal("translation.lifecycle"),
492
+ entityType: runtimeEntityTypeSchema,
493
+ entityId: z.string().check(z.minLength(1)),
494
+ locale: z.optional(z.string()),
495
+ correlationId: z.optional(z.string()),
496
+ sequence: z.optional(z.int()),
497
+ timestampMs: z.int(),
498
+ payload: translationLifecycleRuntimePayloadSchema,
499
+ }),
500
+ z.strictObject({
501
+ version: z.literal(1),
502
+ kind: z.literal("runtime.error"),
503
+ entityType: runtimeEntityTypeSchema,
504
+ entityId: z.string().check(z.minLength(1)),
505
+ locale: z.optional(z.string()),
506
+ correlationId: z.optional(z.string()),
507
+ sequence: z.optional(z.int()),
508
+ timestampMs: z.int(),
509
+ payload: z.strictObject({
510
+ code: z.string().check(z.minLength(1)),
511
+ message: z.string(),
512
+ retryable: z.optional(z.boolean()),
513
+ source: z.optional(z.enum(["backend", "collab", "worker"])),
514
+ details: z.optional(
515
+ z.record(
516
+ z.string(),
517
+ z.union([z.string(), z.number(), z.boolean(), z.null()]),
518
+ ),
519
+ ),
520
+ }),
521
+ }),
532
522
  ]);
533
523
 
534
524
  export function parseEditorRuntimeEventMessage(
@@ -1,35 +1,37 @@
1
- import { z } from "zod";
1
+ import * as z from "zod/mini";
2
2
 
3
- export const workCollabFieldsSchema = z
4
- .object({
5
- title: z.string().optional(),
6
- slug: z.string().nullable().optional(),
7
- type: z.string().optional(),
8
- summary: z.string().optional(),
9
- featured: z.boolean().optional(),
10
- year: z.number().int().min(1).max(9999).optional(),
11
- month: z.number().int().min(1).max(12).optional(),
12
- untilYear: z.number().int().min(1).max(9999).nullable().optional(),
13
- untilMonth: z.number().int().min(1).max(12).nullable().optional(),
14
- isPresent: z.boolean().optional(),
15
- metadata: z.record(z.string(), z.unknown()).optional(),
16
- featuredImageFileId: z.string().nullable().optional(),
17
- creditsVersion: z.number().optional(),
18
- creditOrder: z
19
- .array(
20
- z.discriminatedUnion("type", [
21
- z.object({ type: z.literal("group"), id: z.string() }),
22
- z.object({
23
- type: z.literal("credit"),
24
- id: z.string(),
25
- creditType: z.enum(["artist", "member", "name"]),
26
- }),
27
- ]),
28
- )
29
- .optional(),
30
- clients: z.array(z.string()).optional(), // Ordered list of client IDs
31
- })
32
- .strict();
3
+ export const workCollabFieldsSchema = z.strictObject({
4
+ title: z.optional(z.string()),
5
+ slug: z.optional(z.nullable(z.string())),
6
+ type: z.optional(z.string()),
7
+ summary: z.optional(z.string()),
8
+ featured: z.optional(z.boolean()),
9
+ year: z.optional(z.int().check(z.minimum(1), z.maximum(9999))),
10
+ month: z.optional(z.int().check(z.minimum(1), z.maximum(12))),
11
+ untilYear: z.optional(
12
+ z.nullable(z.int().check(z.minimum(1), z.maximum(9999))),
13
+ ),
14
+ untilMonth: z.optional(
15
+ z.nullable(z.int().check(z.minimum(1), z.maximum(12))),
16
+ ),
17
+ isPresent: z.optional(z.boolean()),
18
+ metadata: z.optional(z.record(z.string(), z.unknown())),
19
+ featuredImageFileId: z.optional(z.nullable(z.string())),
20
+ creditsVersion: z.optional(z.number()),
21
+ creditOrder: z.optional(
22
+ z.array(
23
+ z.discriminatedUnion("type", [
24
+ z.object({ type: z.literal("group"), id: z.string() }),
25
+ z.object({
26
+ type: z.literal("credit"),
27
+ id: z.string(),
28
+ creditType: z.enum(["artist", "member", "name"]),
29
+ }),
30
+ ]),
31
+ ),
32
+ ),
33
+ clients: z.optional(z.array(z.string())), // Ordered list of client IDs
34
+ });
33
35
 
34
36
  export const WORK_JSON_KEYS: ReadonlySet<
35
37
  keyof z.infer<typeof workCollabFieldsSchema>
package/src/page/types.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { z } from "zod";
1
+ import * as z from "zod/mini";
2
2
  import type { PageBlockType } from "./block-fixtures.ts";
3
3
 
4
4
  export interface InlineContent {
@@ -50,8 +50,6 @@ const pageContentSectionSchema = z.custom<Section>(
50
50
  value !== null && typeof value === "object" && !Array.isArray(value),
51
51
  );
52
52
 
53
- export const pageContentSchema: z.ZodType<PageContent> = z
54
- .object({
55
- sections: z.array(pageContentSectionSchema),
56
- })
57
- .strict();
53
+ export const pageContentSchema: z.ZodMiniType<PageContent> = z.strictObject({
54
+ sections: z.array(pageContentSectionSchema),
55
+ });
package/src/post/types.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { z } from "zod";
1
+ import * as z from "zod/mini";
2
2
  import type { Block } from "../page/types.ts";
3
3
 
4
4
  export type PostContent = Block[];
@@ -8,6 +8,6 @@ const postContentBlockSchema = z.custom<Block>(
8
8
  value !== null && typeof value === "object" && !Array.isArray(value),
9
9
  );
10
10
 
11
- export const postContentSchema: z.ZodType<PostContent> = z.array(
11
+ export const postContentSchema: z.ZodMiniType<PostContent> = z.array(
12
12
  postContentBlockSchema,
13
13
  );