@cms0/shared 0.0.1 → 0.0.2

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/CHANGELOG.md ADDED
@@ -0,0 +1,8 @@
1
+ # @cms0/shared
2
+
3
+ ## 0.0.2
4
+
5
+ ### Patch Changes
6
+
7
+ - bef5ec7: Ensure the admin server binary is executable in Docker images.
8
+ - 2ee81b6: Fix rich text editor transaction sync issues and stabilize localized field test behavior.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cms0/shared",
3
- "version": "0.0.1",
3
+ "version": "0.0.2",
4
4
  "private": false,
5
5
  "publishConfig": {
6
6
  "access": "restricted"
package/src/validation.ts CHANGED
@@ -7,7 +7,7 @@ const customTypeSchemas: Record<string, ZodType<any>> = {
7
7
  Url: z.string().url(),
8
8
  };
9
9
 
10
- export type PrimitiveType = "string" | "number" | "boolean";
10
+ export type PrimitiveType = "string" | "number" | "boolean" | "json";
11
11
  // Type definitions for descriptor elements
12
12
  export type FieldDescriptor =
13
13
  | {
@@ -15,6 +15,7 @@ export type FieldDescriptor =
15
15
  type: PrimitiveType;
16
16
  optional?: boolean;
17
17
  nullable?: boolean;
18
+ customType?: string;
18
19
  }
19
20
  | { kind: "modelRef"; model: string; optional?: boolean; nullable?: boolean }
20
21
  | {
@@ -23,6 +24,7 @@ export type FieldDescriptor =
23
24
  properties: Record<string, FieldDescriptor>;
24
25
  optional?: boolean;
25
26
  nullable?: boolean;
27
+ customType?: string;
26
28
  }
27
29
  | {
28
30
  kind?: "array";
@@ -30,6 +32,7 @@ export type FieldDescriptor =
30
32
  items: FieldDescriptor;
31
33
  optional?: boolean;
32
34
  nullable?: boolean;
35
+ customType?: string;
33
36
  };
34
37
 
35
38
  export type ModelDescriptor = {
@@ -42,6 +45,10 @@ export type RootDescriptor = FieldDescriptor;
42
45
  export type FullDescriptor = {
43
46
  models: Record<string, ModelDescriptor>;
44
47
  roots: Record<string, RootDescriptor>;
48
+ metadata?: {
49
+ locales?: string[];
50
+ defaultLocale?: string;
51
+ };
45
52
  };
46
53
 
47
54
  function convertDescriptorToZod(
@@ -64,6 +71,8 @@ function convertDescriptorToZod(
64
71
  return applyOptionality(z.number());
65
72
  case "boolean":
66
73
  return applyOptionality(z.boolean());
74
+ case "json":
75
+ return applyOptionality(z.any());
67
76
  }
68
77
  }
69
78