@adrekic/zod-fieldsjson 0.0.2-schema-improvements.0 → 0.0.2-schema-improvements.1

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.
Files changed (45) hide show
  1. package/dist/conditions/base.d.ts +1 -1
  2. package/dist/conditions/boolean.d.ts +1 -1
  3. package/dist/conditions/checkbox-list.d.ts +1 -1
  4. package/dist/conditions/date.d.ts +1 -1
  5. package/dist/conditions/index.d.ts +17 -17
  6. package/dist/conditions/multi-select.d.ts +1 -1
  7. package/dist/conditions/multi-string.d.ts +1 -1
  8. package/dist/conditions/number.d.ts +1 -1
  9. package/dist/conditions/otp.d.ts +1 -1
  10. package/dist/conditions/pass-fail.d.ts +1 -1
  11. package/dist/conditions/radio.d.ts +1 -1
  12. package/dist/conditions/rating.d.ts +1 -1
  13. package/dist/conditions/scan.d.ts +1 -1
  14. package/dist/conditions/select.d.ts +1 -1
  15. package/dist/conditions/string.d.ts +1 -1
  16. package/dist/conditions/text.d.ts +1 -1
  17. package/dist/conditions/time.d.ts +1 -1
  18. package/dist/conditions/upload.d.ts +1 -1
  19. package/dist/conditions/url.d.ts +1 -1
  20. package/dist/elements/base.d.ts +1 -1
  21. package/dist/elements/index.d.ts +68 -68
  22. package/dist/elements/section.d.ts +60 -60
  23. package/dist/fields/base.d.ts +5 -5
  24. package/dist/fields/boolean.d.ts +1 -1
  25. package/dist/fields/checkbox-list.d.ts +1 -1
  26. package/dist/fields/date.d.ts +1 -1
  27. package/dist/fields/index.d.ts +25 -25
  28. package/dist/fields/multi-select.d.ts +1 -1
  29. package/dist/fields/multi-string.d.ts +3 -3
  30. package/dist/fields/number.d.ts +1 -1
  31. package/dist/fields/otp.d.ts +1 -1
  32. package/dist/fields/pass-fail.d.ts +1 -1
  33. package/dist/fields/radio.d.ts +1 -1
  34. package/dist/fields/rating.d.ts +1 -1
  35. package/dist/fields/scan.d.ts +1 -1
  36. package/dist/fields/select.d.ts +1 -1
  37. package/dist/fields/string.d.ts +3 -3
  38. package/dist/fields/text.d.ts +3 -3
  39. package/dist/fields/time.d.ts +1 -1
  40. package/dist/fields/upload.d.ts +3 -3
  41. package/dist/fields/url.d.ts +1 -1
  42. package/dist/index.cjs +1 -1
  43. package/dist/index.js +8 -8
  44. package/dist/schema.d.ts +43 -43
  45. package/package.json +3 -3
@@ -2,7 +2,7 @@ import * as z from "zod/v4";
2
2
  export declare const BaseJSONConditionSchema: <TType extends string, TConditionValue, TModifier extends string>(typeSchema: z.ZodLiteral<TType>, valueSchema: z.ZodType<TConditionValue>, modifierSchema: z.ZodLiteral<TModifier>) => z.ZodObject<{
3
3
  id: z.ZodString;
4
4
  type: z.ZodLiteral<TType>;
5
- fieldId: z.ZodString;
5
+ field: z.ZodString;
6
6
  value: z.ZodType<TConditionValue, unknown, z.core.$ZodTypeInternals<TConditionValue, unknown>>;
7
7
  modifier: z.ZodLiteral<TModifier>;
8
8
  }, z.core.$strip>;
@@ -6,7 +6,7 @@ export type JSONBooleanConditionModifierSchemaType = z.infer<typeof JSONBooleanC
6
6
  export declare const JSONBooleanConditionSchema: z.ZodObject<{
7
7
  id: z.ZodString;
8
8
  type: z.ZodLiteral<"boolean">;
9
- fieldId: z.ZodString;
9
+ field: z.ZodString;
10
10
  value: z.ZodType<boolean, unknown, z.core.$ZodTypeInternals<boolean, unknown>>;
11
11
  modifier: z.ZodLiteral<"equals" | "notEquals">;
12
12
  }, z.core.$strip>;
@@ -6,7 +6,7 @@ export type JSONCheckboxListConditionModifierSchemaType = z.infer<typeof JSONChe
6
6
  export declare const JSONCheckboxListConditionSchema: z.ZodObject<{
7
7
  id: z.ZodString;
8
8
  type: z.ZodLiteral<"checkbox-list">;
9
- fieldId: z.ZodString;
9
+ field: z.ZodString;
10
10
  value: z.ZodType<string[], unknown, z.core.$ZodTypeInternals<string[], unknown>>;
11
11
  modifier: z.ZodLiteral<"equals" | "notEquals" | "every" | "some" | "none">;
12
12
  }, z.core.$strip>;
@@ -6,7 +6,7 @@ export type JSONDateConditionModifierSchemaType = z.infer<typeof JSONDateConditi
6
6
  export declare const JSONDateConditionSchema: z.ZodObject<{
7
7
  id: z.ZodString;
8
8
  type: z.ZodLiteral<"date">;
9
- fieldId: z.ZodString;
9
+ field: z.ZodString;
10
10
  value: z.ZodType<string | {
11
11
  from: string | null;
12
12
  to: string | null;
@@ -22,19 +22,19 @@ export type JSONConditionTypeSchemaType = z.infer<typeof JSONConditionTypeSchema
22
22
  export declare const JSONConditionSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
23
23
  id: z.ZodString;
24
24
  type: z.ZodLiteral<"boolean">;
25
- fieldId: z.ZodString;
25
+ field: z.ZodString;
26
26
  value: z.ZodType<boolean, unknown, z.core.$ZodTypeInternals<boolean, unknown>>;
27
27
  modifier: z.ZodLiteral<"equals" | "notEquals">;
28
28
  }, z.core.$strip>, z.ZodObject<{
29
29
  id: z.ZodString;
30
30
  type: z.ZodLiteral<"checkbox-list">;
31
- fieldId: z.ZodString;
31
+ field: z.ZodString;
32
32
  value: z.ZodType<string[], unknown, z.core.$ZodTypeInternals<string[], unknown>>;
33
33
  modifier: z.ZodLiteral<"equals" | "notEquals" | "every" | "some" | "none">;
34
34
  }, z.core.$strip>, z.ZodObject<{
35
35
  id: z.ZodString;
36
36
  type: z.ZodLiteral<"date">;
37
- fieldId: z.ZodString;
37
+ field: z.ZodString;
38
38
  value: z.ZodType<string | {
39
39
  from: string | null;
40
40
  to: string | null;
@@ -46,19 +46,19 @@ export declare const JSONConditionSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
46
46
  }, z.core.$strip>, z.ZodObject<{
47
47
  id: z.ZodString;
48
48
  type: z.ZodLiteral<"multi-select">;
49
- fieldId: z.ZodString;
49
+ field: z.ZodString;
50
50
  value: z.ZodType<string[], unknown, z.core.$ZodTypeInternals<string[], unknown>>;
51
51
  modifier: z.ZodLiteral<"equals" | "notEquals" | "every" | "some" | "none">;
52
52
  }, z.core.$strip>, z.ZodObject<{
53
53
  id: z.ZodString;
54
54
  type: z.ZodLiteral<"multi-string">;
55
- fieldId: z.ZodString;
55
+ field: z.ZodString;
56
56
  value: z.ZodType<string[], unknown, z.core.$ZodTypeInternals<string[], unknown>>;
57
57
  modifier: z.ZodLiteral<"equals" | "notEquals" | "every" | "some" | "none">;
58
58
  }, z.core.$strip>, z.ZodObject<{
59
59
  id: z.ZodString;
60
60
  type: z.ZodLiteral<"number">;
61
- fieldId: z.ZodString;
61
+ field: z.ZodString;
62
62
  value: z.ZodType<number | {
63
63
  from: number | null;
64
64
  to: number | null;
@@ -70,25 +70,25 @@ export declare const JSONConditionSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
70
70
  }, z.core.$strip>, z.ZodObject<{
71
71
  id: z.ZodString;
72
72
  type: z.ZodLiteral<"otp">;
73
- fieldId: z.ZodString;
73
+ field: z.ZodString;
74
74
  value: z.ZodType<string, unknown, z.core.$ZodTypeInternals<string, unknown>>;
75
75
  modifier: z.ZodLiteral<"equals" | "notEquals" | "includes" | "excludes">;
76
76
  }, z.core.$strip>, z.ZodObject<{
77
77
  id: z.ZodString;
78
78
  type: z.ZodLiteral<"pass-fail">;
79
- fieldId: z.ZodString;
79
+ field: z.ZodString;
80
80
  value: z.ZodType<"pass" | "fail" | "na" | ("pass" | "fail" | "na")[], unknown, z.core.$ZodTypeInternals<"pass" | "fail" | "na" | ("pass" | "fail" | "na")[], unknown>>;
81
81
  modifier: z.ZodLiteral<"equals" | "notEquals" | "includes" | "excludes">;
82
82
  }, z.core.$strip>, z.ZodObject<{
83
83
  id: z.ZodString;
84
84
  type: z.ZodLiteral<"radio">;
85
- fieldId: z.ZodString;
85
+ field: z.ZodString;
86
86
  value: z.ZodType<string | string[], unknown, z.core.$ZodTypeInternals<string | string[], unknown>>;
87
87
  modifier: z.ZodLiteral<"equals" | "notEquals" | "includes" | "excludes">;
88
88
  }, z.core.$strip>, z.ZodObject<{
89
89
  id: z.ZodString;
90
90
  type: z.ZodLiteral<"rating">;
91
- fieldId: z.ZodString;
91
+ field: z.ZodString;
92
92
  value: z.ZodType<number | {
93
93
  from: number | null;
94
94
  to: number | null;
@@ -100,31 +100,31 @@ export declare const JSONConditionSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
100
100
  }, z.core.$strip>, z.ZodObject<{
101
101
  id: z.ZodString;
102
102
  type: z.ZodLiteral<"qr">;
103
- fieldId: z.ZodString;
103
+ field: z.ZodString;
104
104
  value: z.ZodType<string, unknown, z.core.$ZodTypeInternals<string, unknown>>;
105
105
  modifier: z.ZodLiteral<"equals" | "notEquals" | "includes" | "excludes">;
106
106
  }, z.core.$strip>, z.ZodObject<{
107
107
  id: z.ZodString;
108
108
  type: z.ZodLiteral<"select">;
109
- fieldId: z.ZodString;
109
+ field: z.ZodString;
110
110
  value: z.ZodType<string | string[], unknown, z.core.$ZodTypeInternals<string | string[], unknown>>;
111
111
  modifier: z.ZodLiteral<"equals" | "notEquals" | "includes" | "excludes">;
112
112
  }, z.core.$strip>, z.ZodObject<{
113
113
  id: z.ZodString;
114
114
  type: z.ZodLiteral<"string">;
115
- fieldId: z.ZodString;
115
+ field: z.ZodString;
116
116
  value: z.ZodType<string, unknown, z.core.$ZodTypeInternals<string, unknown>>;
117
117
  modifier: z.ZodLiteral<"equals" | "notEquals" | "includes" | "excludes">;
118
118
  }, z.core.$strip>, z.ZodObject<{
119
119
  id: z.ZodString;
120
120
  type: z.ZodLiteral<"text">;
121
- fieldId: z.ZodString;
121
+ field: z.ZodString;
122
122
  value: z.ZodType<string, unknown, z.core.$ZodTypeInternals<string, unknown>>;
123
123
  modifier: z.ZodLiteral<"equals" | "notEquals" | "includes" | "excludes">;
124
124
  }, z.core.$strip>, z.ZodObject<{
125
125
  id: z.ZodString;
126
126
  type: z.ZodLiteral<"time">;
127
- fieldId: z.ZodString;
127
+ field: z.ZodString;
128
128
  value: z.ZodType<`T${string}:${string}:00+${string}:${string}` | `T${string}:${string}:00-${string}:${string}` | {
129
129
  from: `T${string}:${string}:00+${string}:${string}` | `T${string}:${string}:00-${string}:${string}` | null;
130
130
  to: `T${string}:${string}:00+${string}:${string}` | `T${string}:${string}:00-${string}:${string}` | null;
@@ -136,13 +136,13 @@ export declare const JSONConditionSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
136
136
  }, z.core.$strip>, z.ZodObject<{
137
137
  id: z.ZodString;
138
138
  type: z.ZodLiteral<"upload">;
139
- fieldId: z.ZodString;
139
+ field: z.ZodString;
140
140
  value: z.ZodType<boolean, unknown, z.core.$ZodTypeInternals<boolean, unknown>>;
141
141
  modifier: z.ZodLiteral<"equals" | "notEquals">;
142
142
  }, z.core.$strip>, z.ZodObject<{
143
143
  id: z.ZodString;
144
144
  type: z.ZodLiteral<"url">;
145
- fieldId: z.ZodString;
145
+ field: z.ZodString;
146
146
  value: z.ZodType<string, unknown, z.core.$ZodTypeInternals<string, unknown>>;
147
147
  modifier: z.ZodLiteral<"equals" | "notEquals" | "includes" | "excludes">;
148
148
  }, z.core.$strip>], "type">;
@@ -6,7 +6,7 @@ export type JSONMultiSelectConditionModifierSchemaType = z.infer<typeof JSONMult
6
6
  export declare const JSONMultiSelectConditionSchema: z.ZodObject<{
7
7
  id: z.ZodString;
8
8
  type: z.ZodLiteral<"multi-select">;
9
- fieldId: z.ZodString;
9
+ field: z.ZodString;
10
10
  value: z.ZodType<string[], unknown, z.core.$ZodTypeInternals<string[], unknown>>;
11
11
  modifier: z.ZodLiteral<"equals" | "notEquals" | "every" | "some" | "none">;
12
12
  }, z.core.$strip>;
@@ -6,7 +6,7 @@ export type JSONMultiStringConditionModifierSchemaType = z.infer<typeof JSONMult
6
6
  export declare const JSONMultiStringConditionSchema: z.ZodObject<{
7
7
  id: z.ZodString;
8
8
  type: z.ZodLiteral<"multi-string">;
9
- fieldId: z.ZodString;
9
+ field: z.ZodString;
10
10
  value: z.ZodType<string[], unknown, z.core.$ZodTypeInternals<string[], unknown>>;
11
11
  modifier: z.ZodLiteral<"equals" | "notEquals" | "every" | "some" | "none">;
12
12
  }, z.core.$strip>;
@@ -6,7 +6,7 @@ export type JSONNumberConditionModifierSchemaType = z.infer<typeof JSONNumberCon
6
6
  export declare const JSONNumberConditionSchema: z.ZodObject<{
7
7
  id: z.ZodString;
8
8
  type: z.ZodLiteral<"number">;
9
- fieldId: z.ZodString;
9
+ field: z.ZodString;
10
10
  value: z.ZodType<number | {
11
11
  from: number | null;
12
12
  to: number | null;
@@ -6,7 +6,7 @@ export type JSONOTPConditionModifierSchemaType = z.infer<typeof JSONOTPCondition
6
6
  export declare const JSONOTPConditionSchema: z.ZodObject<{
7
7
  id: z.ZodString;
8
8
  type: z.ZodLiteral<"otp">;
9
- fieldId: z.ZodString;
9
+ field: z.ZodString;
10
10
  value: z.ZodType<string, unknown, z.core.$ZodTypeInternals<string, unknown>>;
11
11
  modifier: z.ZodLiteral<"equals" | "notEquals" | "includes" | "excludes">;
12
12
  }, z.core.$strip>;
@@ -6,7 +6,7 @@ export type JSONPassFailFieldConditionModifierSchemaType = z.infer<typeof JSONPa
6
6
  export declare const JSONPassFailFieldConditionSchema: z.ZodObject<{
7
7
  id: z.ZodString;
8
8
  type: z.ZodLiteral<"pass-fail">;
9
- fieldId: z.ZodString;
9
+ field: z.ZodString;
10
10
  value: z.ZodType<"pass" | "fail" | "na" | ("pass" | "fail" | "na")[], unknown, z.core.$ZodTypeInternals<"pass" | "fail" | "na" | ("pass" | "fail" | "na")[], unknown>>;
11
11
  modifier: z.ZodLiteral<"equals" | "notEquals" | "includes" | "excludes">;
12
12
  }, z.core.$strip>;
@@ -6,7 +6,7 @@ export type JSONRadioConditionModifierSchemaType = z.infer<typeof JSONRadioCondi
6
6
  export declare const JSONRadioConditionSchema: z.ZodObject<{
7
7
  id: z.ZodString;
8
8
  type: z.ZodLiteral<"radio">;
9
- fieldId: z.ZodString;
9
+ field: z.ZodString;
10
10
  value: z.ZodType<string | string[], unknown, z.core.$ZodTypeInternals<string | string[], unknown>>;
11
11
  modifier: z.ZodLiteral<"equals" | "notEquals" | "includes" | "excludes">;
12
12
  }, z.core.$strip>;
@@ -6,7 +6,7 @@ export type JSONRatingConditionModifierSchemaType = z.infer<typeof JSONRatingCon
6
6
  export declare const JSONRatingConditionSchema: z.ZodObject<{
7
7
  id: z.ZodString;
8
8
  type: z.ZodLiteral<"rating">;
9
- fieldId: z.ZodString;
9
+ field: z.ZodString;
10
10
  value: z.ZodType<number | {
11
11
  from: number | null;
12
12
  to: number | null;
@@ -6,7 +6,7 @@ export type JSONScanConditionModifierSchemaType = z.infer<typeof JSONScanConditi
6
6
  export declare const JSONScanConditionSchema: z.ZodObject<{
7
7
  id: z.ZodString;
8
8
  type: z.ZodLiteral<"qr">;
9
- fieldId: z.ZodString;
9
+ field: z.ZodString;
10
10
  value: z.ZodType<string, unknown, z.core.$ZodTypeInternals<string, unknown>>;
11
11
  modifier: z.ZodLiteral<"equals" | "notEquals" | "includes" | "excludes">;
12
12
  }, z.core.$strip>;
@@ -6,7 +6,7 @@ export type JSONSelectConditionModifierSchemaType = z.infer<typeof JSONSelectCon
6
6
  export declare const JSONSelectConditionSchema: z.ZodObject<{
7
7
  id: z.ZodString;
8
8
  type: z.ZodLiteral<"select">;
9
- fieldId: z.ZodString;
9
+ field: z.ZodString;
10
10
  value: z.ZodType<string | string[], unknown, z.core.$ZodTypeInternals<string | string[], unknown>>;
11
11
  modifier: z.ZodLiteral<"equals" | "notEquals" | "includes" | "excludes">;
12
12
  }, z.core.$strip>;
@@ -6,7 +6,7 @@ export type JSONStringConditionModifierSchemaType = z.infer<typeof JSONStringCon
6
6
  export declare const JSONStringConditionSchema: z.ZodObject<{
7
7
  id: z.ZodString;
8
8
  type: z.ZodLiteral<"string">;
9
- fieldId: z.ZodString;
9
+ field: z.ZodString;
10
10
  value: z.ZodType<string, unknown, z.core.$ZodTypeInternals<string, unknown>>;
11
11
  modifier: z.ZodLiteral<"equals" | "notEquals" | "includes" | "excludes">;
12
12
  }, z.core.$strip>;
@@ -6,7 +6,7 @@ export type JSONTextConditionModifierSchemaType = z.infer<typeof JSONTextConditi
6
6
  export declare const JSONTextConditionSchema: z.ZodObject<{
7
7
  id: z.ZodString;
8
8
  type: z.ZodLiteral<"text">;
9
- fieldId: z.ZodString;
9
+ field: z.ZodString;
10
10
  value: z.ZodType<string, unknown, z.core.$ZodTypeInternals<string, unknown>>;
11
11
  modifier: z.ZodLiteral<"equals" | "notEquals" | "includes" | "excludes">;
12
12
  }, z.core.$strip>;
@@ -6,7 +6,7 @@ export type JSONTimeConditionModifierSchemaType = z.infer<typeof JSONTimeConditi
6
6
  export declare const JSONTimeConditionSchema: z.ZodObject<{
7
7
  id: z.ZodString;
8
8
  type: z.ZodLiteral<"time">;
9
- fieldId: z.ZodString;
9
+ field: z.ZodString;
10
10
  value: z.ZodType<`T${string}:${string}:00+${string}:${string}` | `T${string}:${string}:00-${string}:${string}` | {
11
11
  from: `T${string}:${string}:00+${string}:${string}` | `T${string}:${string}:00-${string}:${string}` | null;
12
12
  to: `T${string}:${string}:00+${string}:${string}` | `T${string}:${string}:00-${string}:${string}` | null;
@@ -6,7 +6,7 @@ export type JSONUploadConditionModifierSchemaType = z.infer<typeof JSONUploadCon
6
6
  export declare const JSONUploadConditionSchema: z.ZodObject<{
7
7
  id: z.ZodString;
8
8
  type: z.ZodLiteral<"upload">;
9
- fieldId: z.ZodString;
9
+ field: z.ZodString;
10
10
  value: z.ZodType<boolean, unknown, z.core.$ZodTypeInternals<boolean, unknown>>;
11
11
  modifier: z.ZodLiteral<"equals" | "notEquals">;
12
12
  }, z.core.$strip>;
@@ -6,7 +6,7 @@ export type JSONURLConditionModifierSchemaType = z.infer<typeof JSONURLCondition
6
6
  export declare const JSONURLConditionSchema: z.ZodObject<{
7
7
  id: z.ZodString;
8
8
  type: z.ZodLiteral<"url">;
9
- fieldId: z.ZodString;
9
+ field: z.ZodString;
10
10
  value: z.ZodType<string, unknown, z.core.$ZodTypeInternals<string, unknown>>;
11
11
  modifier: z.ZodLiteral<"equals" | "notEquals" | "includes" | "excludes">;
12
12
  }, z.core.$strip>;
@@ -1,6 +1,6 @@
1
1
  import * as z from "zod/v4";
2
2
  export declare const BaseJSONFieldElementSchema: <TType extends string>(typeSchema: z.ZodLiteral<TType>) => z.ZodObject<{
3
- identifier: z.ZodString;
3
+ id: z.ZodString;
4
4
  type: z.ZodLiteral<TType>;
5
5
  }, z.core.$strip>;
6
6
  export type BaseJSONFieldElementSchemaType<TType extends string> = z.infer<ReturnType<typeof BaseJSONFieldElementSchema<TType>>>;