@openframe-org/criteria-set-protocol 2.0.0-beta.6 → 2.0.0-beta.8

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.
@@ -12,7 +12,16 @@ export declare const colorSchema: z.ZodUnion<[z.ZodString, z.ZodObject<{
12
12
  green: number;
13
13
  blue: number;
14
14
  }>]>;
15
- export declare const elementDataSchema: z.ZodRecord<z.ZodString, z.ZodAny>;
15
+ export declare const elementDataSchema: z.ZodIntersection<z.ZodRecord<z.ZodString, z.ZodAny>, z.ZodObject<{
16
+ value: z.ZodOptional<z.ZodUnion<[z.ZodUnion<[z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>, z.ZodArray<z.ZodUnion<[z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>, "many">]>>;
17
+ text: z.ZodOptional<z.ZodOptional<z.ZodString>>;
18
+ }, "strip", z.ZodTypeAny, {
19
+ value?: string | number | boolean | (string | number | boolean | null)[] | null | undefined;
20
+ text?: string | undefined;
21
+ }, {
22
+ value?: string | number | boolean | (string | number | boolean | null)[] | null | undefined;
23
+ text?: string | undefined;
24
+ }>>;
16
25
  export declare const criteriaTreeElementTypeSchema: z.ZodEnum<["theme", "criterion", "task-group", "task", "task-item"]>;
17
26
  export declare const abstractElementSchema: z.ZodObject<{
18
27
  type: z.ZodEnum<["theme", "criterion", "task-group", "task", "task-item"]>;
@@ -68,13 +77,25 @@ export declare const abstractElementSchema: z.ZodObject<{
68
77
  label: string;
69
78
  text: string;
70
79
  }>]>, "many">>;
71
- data: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
80
+ data: z.ZodOptional<z.ZodIntersection<z.ZodRecord<z.ZodString, z.ZodAny>, z.ZodObject<{
81
+ value: z.ZodOptional<z.ZodUnion<[z.ZodUnion<[z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>, z.ZodArray<z.ZodUnion<[z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>, "many">]>>;
82
+ text: z.ZodOptional<z.ZodOptional<z.ZodString>>;
83
+ }, "strip", z.ZodTypeAny, {
84
+ value?: string | number | boolean | (string | number | boolean | null)[] | null | undefined;
85
+ text?: string | undefined;
86
+ }, {
87
+ value?: string | number | boolean | (string | number | boolean | null)[] | null | undefined;
88
+ text?: string | undefined;
89
+ }>>>;
72
90
  sortOrder: z.ZodOptional<z.ZodNumber>;
73
91
  }, "strip", z.ZodTypeAny, {
74
92
  type: "theme" | "criterion" | "task-group" | "task" | "task-item";
75
93
  code: string;
76
94
  title: string;
77
- data?: Record<string, any> | undefined;
95
+ data?: (Record<string, any> & {
96
+ value?: string | number | boolean | (string | number | boolean | null)[] | null | undefined;
97
+ text?: string | undefined;
98
+ }) | undefined;
78
99
  tags?: string[] | undefined;
79
100
  documentation?: ({
80
101
  type: "pdf";
@@ -96,7 +117,10 @@ export declare const abstractElementSchema: z.ZodObject<{
96
117
  type: "theme" | "criterion" | "task-group" | "task" | "task-item";
97
118
  code: string;
98
119
  title: string;
99
- data?: Record<string, any> | undefined;
120
+ data?: (Record<string, any> & {
121
+ value?: string | number | boolean | (string | number | boolean | null)[] | null | undefined;
122
+ text?: string | undefined;
123
+ }) | undefined;
100
124
  tags?: string[] | undefined;
101
125
  documentation?: ({
102
126
  type: "pdf";
@@ -2,6 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.abstractElementSchema = exports.criteriaTreeElementTypeSchema = exports.elementDataSchema = exports.colorSchema = void 0;
4
4
  const zod_1 = require("zod");
5
+ const task_item_1 = require("./task-item");
5
6
  const documentation_1 = require("./documentation");
6
7
  exports.colorSchema = zod_1.z.union([
7
8
  zod_1.z.string(),
@@ -11,7 +12,12 @@ exports.colorSchema = zod_1.z.union([
11
12
  blue: zod_1.z.number(),
12
13
  }),
13
14
  ]);
14
- exports.elementDataSchema = zod_1.z.record(zod_1.z.string(), zod_1.z.any());
15
+ exports.elementDataSchema = zod_1.z.intersection(zod_1.z.record(zod_1.z.string(), zod_1.z.any()), zod_1.z
16
+ .object({
17
+ value: task_item_1.taskItemValueSchema,
18
+ text: zod_1.z.string().optional(),
19
+ })
20
+ .partial());
15
21
  exports.criteriaTreeElementTypeSchema = zod_1.z.enum([
16
22
  "theme",
17
23
  "criterion",