@echovisionlab/geul-common 0.4.0 → 0.6.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,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
  );