@stndrds/schema 0.1.0-alpha.67 → 1.0.0-alpha.102

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 (155) hide show
  1. package/dist/attributes-D7yQuTJK.d.mts +665 -0
  2. package/dist/attributes-DcbQC-4b.d.ts +665 -0
  3. package/dist/chunk-3JINFUN3.js +81 -0
  4. package/dist/chunk-4KRLCWJM.mjs +8 -0
  5. package/dist/chunk-4TC27SMF.mjs +18 -0
  6. package/dist/chunk-56QI6UTK.js +32 -0
  7. package/dist/chunk-5JVVPJJW.mjs +208 -0
  8. package/dist/chunk-5XL3JP73.mjs +83 -0
  9. package/dist/chunk-7HFZ7MVR.mjs +28 -0
  10. package/dist/chunk-ACQ3TUFK.js +10 -0
  11. package/dist/chunk-AYCSVKI2.mjs +14 -0
  12. package/dist/chunk-BLXQGQLK.mjs +10 -0
  13. package/dist/chunk-D7WFIGXW.js +14 -0
  14. package/dist/chunk-FRCDMQER.js +47 -0
  15. package/dist/chunk-GCRHSPZN.js +16 -0
  16. package/dist/chunk-IRTRJH37.mjs +8 -0
  17. package/dist/chunk-ITTQ4FGR.mjs +14 -0
  18. package/dist/chunk-J5HRK3WD.js +10 -0
  19. package/dist/chunk-KNYZH2WD.mjs +18 -0
  20. package/dist/chunk-KWVCGQ7N.mjs +78 -0
  21. package/dist/chunk-MAKSIK3P.js +10 -0
  22. package/dist/chunk-N7T66JVY.js +86 -0
  23. package/dist/chunk-OAQWRMTP.js +10 -0
  24. package/dist/chunk-OLJLCVNY.mjs +8 -0
  25. package/dist/chunk-P2BE2A2G.js +64 -0
  26. package/dist/chunk-PGERPYDR.js +2 -0
  27. package/dist/chunk-QWZHR2OO.js +12 -0
  28. package/dist/chunk-QY6QFRRV.mjs +41 -0
  29. package/dist/chunk-QYNPB37W.js +221 -0
  30. package/dist/chunk-R4CJHCC4.mjs +60 -0
  31. package/dist/chunk-RJ4LOX7P.js +22 -0
  32. package/dist/chunk-ROAZLZA2.js +20 -0
  33. package/dist/chunk-RUYUFXNW.mjs +12 -0
  34. package/dist/chunk-SP3PNHYF.mjs +1 -0
  35. package/dist/chunk-SS2NR6DH.mjs +176 -0
  36. package/dist/chunk-T225DB55.js +33 -0
  37. package/dist/chunk-TKN73433.js +20 -0
  38. package/dist/chunk-TMYBEXBT.mjs +8 -0
  39. package/dist/chunk-UQVW4KPP.mjs +30 -0
  40. package/dist/chunk-V6DE3MXC.js +180 -0
  41. package/dist/chunk-VXOTYFEW.js +16 -0
  42. package/dist/chunk-WV4V64D5.mjs +20 -0
  43. package/dist/helpers-DD6JzYfI.d.mts +860 -0
  44. package/dist/helpers-kMS5R7KX.d.ts +860 -0
  45. package/dist/index.d.mts +3597 -1768
  46. package/dist/index.d.ts +3597 -1768
  47. package/dist/index.js +4957 -1955
  48. package/dist/index.mjs +3920 -1116
  49. package/dist/types-BAPgWlpX.d.mts +39 -0
  50. package/dist/types-mZPUEZl0.d.ts +39 -0
  51. package/dist/utils.d.mts +20 -55
  52. package/dist/utils.d.ts +20 -55
  53. package/dist/utils.js +26 -19
  54. package/dist/utils.mjs +1 -19
  55. package/dist/validation/all.d.mts +8 -0
  56. package/dist/validation/all.d.ts +8 -0
  57. package/dist/validation/all.js +56 -0
  58. package/dist/validation/all.mjs +19 -0
  59. package/dist/validation/complex/currency.d.mts +15 -0
  60. package/dist/validation/complex/currency.d.ts +15 -0
  61. package/dist/validation/complex/currency.js +11 -0
  62. package/dist/validation/complex/currency.mjs +2 -0
  63. package/dist/validation/complex/file.d.mts +13 -0
  64. package/dist/validation/complex/file.d.ts +13 -0
  65. package/dist/validation/complex/file.js +11 -0
  66. package/dist/validation/complex/file.mjs +2 -0
  67. package/dist/validation/complex/location.d.mts +22 -0
  68. package/dist/validation/complex/location.d.ts +22 -0
  69. package/dist/validation/complex/location.js +11 -0
  70. package/dist/validation/complex/location.mjs +2 -0
  71. package/dist/validation/complex/phone.d.mts +22 -0
  72. package/dist/validation/complex/phone.d.ts +22 -0
  73. package/dist/validation/complex/phone.js +11 -0
  74. package/dist/validation/complex/phone.mjs +2 -0
  75. package/dist/validation/complex/relation.d.mts +25 -0
  76. package/dist/validation/complex/relation.d.ts +25 -0
  77. package/dist/validation/complex/relation.js +19 -0
  78. package/dist/validation/complex/relation.mjs +2 -0
  79. package/dist/validation/complex/richtext.d.mts +13 -0
  80. package/dist/validation/complex/richtext.d.ts +13 -0
  81. package/dist/validation/complex/richtext.js +11 -0
  82. package/dist/validation/complex/richtext.mjs +2 -0
  83. package/dist/validation/complex/select.d.mts +20 -0
  84. package/dist/validation/complex/select.d.ts +20 -0
  85. package/dist/validation/complex/select.js +19 -0
  86. package/dist/validation/complex/select.mjs +2 -0
  87. package/dist/validation/complex/user.d.mts +13 -0
  88. package/dist/validation/complex/user.d.ts +13 -0
  89. package/dist/validation/complex/user.js +11 -0
  90. package/dist/validation/complex/user.mjs +2 -0
  91. package/dist/validation/computed/formula.d.mts +14 -0
  92. package/dist/validation/computed/formula.d.ts +14 -0
  93. package/dist/validation/computed/formula.js +11 -0
  94. package/dist/validation/computed/formula.mjs +2 -0
  95. package/dist/validation/computed/rollup.d.mts +14 -0
  96. package/dist/validation/computed/rollup.d.ts +14 -0
  97. package/dist/validation/computed/rollup.js +11 -0
  98. package/dist/validation/computed/rollup.mjs +2 -0
  99. package/dist/validation/config/index.d.mts +20 -0
  100. package/dist/validation/config/index.d.ts +20 -0
  101. package/dist/validation/config/index.js +18 -0
  102. package/dist/validation/config/index.mjs +1 -0
  103. package/dist/validation/core/index.d.mts +19 -0
  104. package/dist/validation/core/index.d.ts +19 -0
  105. package/dist/validation/core/index.js +14 -0
  106. package/dist/validation/core/index.mjs +1 -0
  107. package/dist/validation/object/index.d.mts +31 -0
  108. package/dist/validation/object/index.d.ts +31 -0
  109. package/dist/validation/object/index.js +70 -0
  110. package/dist/validation/object/index.mjs +17 -0
  111. package/dist/validation/primitives/checkbox.d.mts +12 -0
  112. package/dist/validation/primitives/checkbox.d.ts +12 -0
  113. package/dist/validation/primitives/checkbox.js +11 -0
  114. package/dist/validation/primitives/checkbox.mjs +2 -0
  115. package/dist/validation/primitives/date.d.mts +12 -0
  116. package/dist/validation/primitives/date.d.ts +12 -0
  117. package/dist/validation/primitives/date.js +11 -0
  118. package/dist/validation/primitives/date.mjs +2 -0
  119. package/dist/validation/primitives/number.d.mts +12 -0
  120. package/dist/validation/primitives/number.d.ts +12 -0
  121. package/dist/validation/primitives/number.js +11 -0
  122. package/dist/validation/primitives/number.mjs +2 -0
  123. package/dist/validation/primitives/rating.d.mts +12 -0
  124. package/dist/validation/primitives/rating.d.ts +12 -0
  125. package/dist/validation/primitives/rating.js +11 -0
  126. package/dist/validation/primitives/rating.mjs +2 -0
  127. package/dist/validation/primitives/text.d.mts +17 -0
  128. package/dist/validation/primitives/text.d.ts +17 -0
  129. package/dist/validation/primitives/text.js +15 -0
  130. package/dist/validation/primitives/text.mjs +2 -0
  131. package/package.json +108 -13
  132. package/dist/chunk-36UBIXJN.js +0 -82
  133. package/dist/chunk-3RG5ZIWI.js +0 -10
  134. package/dist/chunk-A6T4UUZ2.mjs +0 -18669
  135. package/dist/chunk-NEVERCM3.js +0 -41
  136. package/dist/chunk-SV4BCGQU.mjs +0 -617
  137. package/dist/chunk-TOTUS3YS.js +0 -18669
  138. package/dist/chunk-U4AB53AM.js +0 -617
  139. package/dist/chunk-V2RPPE2Y.mjs +0 -41
  140. package/dist/chunk-V5QXU2OK.mjs +0 -82
  141. package/dist/chunk-Y6FXYEAI.mjs +0 -10
  142. package/dist/default-roles-42X3TJI5.mjs +0 -21
  143. package/dist/default-roles-C3FYDYMN.js +0 -21
  144. package/dist/runtime-BgtwoMx5.d.ts +0 -12759
  145. package/dist/runtime-DQlTgVZJ.d.mts +0 -12759
  146. package/dist/runtime.d.mts +0 -6
  147. package/dist/runtime.d.ts +0 -6
  148. package/dist/runtime.js +0 -323
  149. package/dist/runtime.mjs +0 -323
  150. package/dist/validation/validators.d.mts +0 -4
  151. package/dist/validation/validators.d.ts +0 -4
  152. package/dist/validation/validators.js +0 -121
  153. package/dist/validation/validators.mjs +0 -121
  154. package/dist/validators-BROsLGn4.d.mts +0 -1556
  155. package/dist/validators-CEzdvxEq.d.ts +0 -1556
@@ -0,0 +1,39 @@
1
+ import { A as Attribute } from './attributes-D7yQuTJK.mjs';
2
+
3
+ /**
4
+ * Validation messages for Zod validators.
5
+ * All functions receive the full Attribute to access label, type, etc.
6
+ * Can be customized for i18n support.
7
+ */
8
+ interface ValidationMessages {
9
+ required: (attr: Attribute) => string;
10
+ invalidType: (attr: Attribute, expected: string) => string;
11
+ minLength: (attr: Attribute, min: number) => string;
12
+ maxLength: (attr: Attribute, max: number) => string;
13
+ invalidPattern: (attr: Attribute) => string;
14
+ minValue: (attr: Attribute, min: number) => string;
15
+ maxValue: (attr: Attribute, max: number) => string;
16
+ mustBeInteger: (attr: Attribute) => string;
17
+ invalidDate: (attr: Attribute) => string;
18
+ invalidOption: (attr: Attribute, options: string[]) => string;
19
+ invalidId: (attr: Attribute) => string;
20
+ minItems: (attr: Attribute, min: number) => string;
21
+ maxItems: (attr: Attribute, max: number) => string;
22
+ invalidRichtext: (attr: Attribute) => string;
23
+ invalidPhone: (attr: Attribute) => string;
24
+ invalidCurrency: (attr: Attribute) => string;
25
+ invalidLocation: (attr: Attribute) => string;
26
+ }
27
+ /**
28
+ * Validation result
29
+ */
30
+ interface ValidationResult {
31
+ success: boolean;
32
+ data?: Record<string, unknown>;
33
+ errors?: Array<{
34
+ path: string[];
35
+ message: string;
36
+ }>;
37
+ }
38
+
39
+ export type { ValidationMessages as V, ValidationResult as a };
@@ -0,0 +1,39 @@
1
+ import { A as Attribute } from './attributes-DcbQC-4b.js';
2
+
3
+ /**
4
+ * Validation messages for Zod validators.
5
+ * All functions receive the full Attribute to access label, type, etc.
6
+ * Can be customized for i18n support.
7
+ */
8
+ interface ValidationMessages {
9
+ required: (attr: Attribute) => string;
10
+ invalidType: (attr: Attribute, expected: string) => string;
11
+ minLength: (attr: Attribute, min: number) => string;
12
+ maxLength: (attr: Attribute, max: number) => string;
13
+ invalidPattern: (attr: Attribute) => string;
14
+ minValue: (attr: Attribute, min: number) => string;
15
+ maxValue: (attr: Attribute, max: number) => string;
16
+ mustBeInteger: (attr: Attribute) => string;
17
+ invalidDate: (attr: Attribute) => string;
18
+ invalidOption: (attr: Attribute, options: string[]) => string;
19
+ invalidId: (attr: Attribute) => string;
20
+ minItems: (attr: Attribute, min: number) => string;
21
+ maxItems: (attr: Attribute, max: number) => string;
22
+ invalidRichtext: (attr: Attribute) => string;
23
+ invalidPhone: (attr: Attribute) => string;
24
+ invalidCurrency: (attr: Attribute) => string;
25
+ invalidLocation: (attr: Attribute) => string;
26
+ }
27
+ /**
28
+ * Validation result
29
+ */
30
+ interface ValidationResult {
31
+ success: boolean;
32
+ data?: Record<string, unknown>;
33
+ errors?: Array<{
34
+ path: string[];
35
+ message: string;
36
+ }>;
37
+ }
38
+
39
+ export type { ValidationMessages as V, ValidationResult as a };
package/dist/utils.d.mts CHANGED
@@ -73,60 +73,6 @@ declare function asUserId(id: string): UserId;
73
73
  * ```
74
74
  */
75
75
  declare function generateId(): Uuid;
76
- /**
77
- * Generate a prefixed ID for better debugging and readability
78
- *
79
- * @param prefix - Prefix for the ID (e.g., "obj", "attr", "rec")
80
- * @returns A prefixed UUID string
81
- *
82
- * @example
83
- * ```typescript
84
- * const objectId = generatePrefixedId("obj");
85
- * // "obj_a1b2c3d4-e5f6-4a7b-8c9d-0e1f2a3b4c5d"
86
- *
87
- * const attrId = generatePrefixedId("attr");
88
- * // "attr_a1b2c3d4-e5f6-4a7b-8c9d-0e1f2a3b4c5d"
89
- * ```
90
- */
91
- declare function generatePrefixedId(prefix: string): Uuid;
92
- /**
93
- * Convert a string to a valid kebab-case slug.
94
- * Removes accents, special chars, and normalizes spaces.
95
- *
96
- * @param input - The string to slugify
97
- * @returns A kebab-case slug matching pattern ^[a-z][a-z0-9-]*$
98
- *
99
- * @example
100
- * ```typescript
101
- * slugify("Contrat de Vente");
102
- * // "contrat-de-vente"
103
- *
104
- * slugify("Éléphant café");
105
- * // "elephant-cafe"
106
- *
107
- * slugify(" Multiple Spaces ");
108
- * // "multiple-spaces"
109
- * ```
110
- */
111
- declare function slugify(input: string): string;
112
- /**
113
- * Generate a unique template name from a label.
114
- * Format: {slugified-label}-{8-char-suffix}
115
- * Matches DB constraint: ^[a-z][a-z0-9_-]*$
116
- *
117
- * @param label - The label to generate a name from
118
- * @returns A unique kebab-case name
119
- *
120
- * @example
121
- * ```typescript
122
- * generateTemplateName("Contrat de Vente");
123
- * // "contrat-de-vente-a1b2c3d4"
124
- *
125
- * generateTemplateName("");
126
- * // "template-a1b2c3d4"
127
- * ```
128
- */
129
- declare function generateTemplateName(label: string): string;
130
76
  /**
131
77
  * Create a Map indexed by a key extracted from each item.
132
78
  * This eliminates the repeated pattern: new Map(items.map(item => [keyFn(item), item]))
@@ -150,5 +96,24 @@ declare function generateTemplateName(label: string): string;
150
96
  * ```
151
97
  */
152
98
  declare function indexBy<T, K extends PropertyKey>(items: T[], keyFn: (item: T) => K): Map<K, T>;
99
+ /**
100
+ * Deep equality comparison for plain objects and arrays.
101
+ * Handles nested structures, arrays, primitives, null, and undefined.
102
+ *
103
+ * Time complexity: O(n) where n is total number of properties
104
+ *
105
+ * @param a - First value to compare
106
+ * @param b - Second value to compare
107
+ * @returns true if values are deeply equal
108
+ *
109
+ * @example
110
+ * ```typescript
111
+ * deepEqual({ a: 1, b: { c: 2 } }, { a: 1, b: { c: 2 } }); // true
112
+ * deepEqual({ a: 1, b: 2 }, { b: 2, a: 1 }); // true (order-independent)
113
+ * deepEqual([1, 2, 3], [1, 2, 3]); // true
114
+ * deepEqual([1, 2], [2, 1]); // false (arrays preserve order)
115
+ * ```
116
+ */
117
+ declare function deepEqual(a: unknown, b: unknown): boolean;
153
118
 
154
- export { type TenantId, type UserId, type Uuid, asTenantId, asUserId, generateId, generatePrefixedId, generateTemplateName, indexBy, slugify };
119
+ export { type TenantId, type UserId, type Uuid, asTenantId, asUserId, deepEqual, generateId, indexBy };
package/dist/utils.d.ts CHANGED
@@ -73,60 +73,6 @@ declare function asUserId(id: string): UserId;
73
73
  * ```
74
74
  */
75
75
  declare function generateId(): Uuid;
76
- /**
77
- * Generate a prefixed ID for better debugging and readability
78
- *
79
- * @param prefix - Prefix for the ID (e.g., "obj", "attr", "rec")
80
- * @returns A prefixed UUID string
81
- *
82
- * @example
83
- * ```typescript
84
- * const objectId = generatePrefixedId("obj");
85
- * // "obj_a1b2c3d4-e5f6-4a7b-8c9d-0e1f2a3b4c5d"
86
- *
87
- * const attrId = generatePrefixedId("attr");
88
- * // "attr_a1b2c3d4-e5f6-4a7b-8c9d-0e1f2a3b4c5d"
89
- * ```
90
- */
91
- declare function generatePrefixedId(prefix: string): Uuid;
92
- /**
93
- * Convert a string to a valid kebab-case slug.
94
- * Removes accents, special chars, and normalizes spaces.
95
- *
96
- * @param input - The string to slugify
97
- * @returns A kebab-case slug matching pattern ^[a-z][a-z0-9-]*$
98
- *
99
- * @example
100
- * ```typescript
101
- * slugify("Contrat de Vente");
102
- * // "contrat-de-vente"
103
- *
104
- * slugify("Éléphant café");
105
- * // "elephant-cafe"
106
- *
107
- * slugify(" Multiple Spaces ");
108
- * // "multiple-spaces"
109
- * ```
110
- */
111
- declare function slugify(input: string): string;
112
- /**
113
- * Generate a unique template name from a label.
114
- * Format: {slugified-label}-{8-char-suffix}
115
- * Matches DB constraint: ^[a-z][a-z0-9_-]*$
116
- *
117
- * @param label - The label to generate a name from
118
- * @returns A unique kebab-case name
119
- *
120
- * @example
121
- * ```typescript
122
- * generateTemplateName("Contrat de Vente");
123
- * // "contrat-de-vente-a1b2c3d4"
124
- *
125
- * generateTemplateName("");
126
- * // "template-a1b2c3d4"
127
- * ```
128
- */
129
- declare function generateTemplateName(label: string): string;
130
76
  /**
131
77
  * Create a Map indexed by a key extracted from each item.
132
78
  * This eliminates the repeated pattern: new Map(items.map(item => [keyFn(item), item]))
@@ -150,5 +96,24 @@ declare function generateTemplateName(label: string): string;
150
96
  * ```
151
97
  */
152
98
  declare function indexBy<T, K extends PropertyKey>(items: T[], keyFn: (item: T) => K): Map<K, T>;
99
+ /**
100
+ * Deep equality comparison for plain objects and arrays.
101
+ * Handles nested structures, arrays, primitives, null, and undefined.
102
+ *
103
+ * Time complexity: O(n) where n is total number of properties
104
+ *
105
+ * @param a - First value to compare
106
+ * @param b - Second value to compare
107
+ * @returns true if values are deeply equal
108
+ *
109
+ * @example
110
+ * ```typescript
111
+ * deepEqual({ a: 1, b: { c: 2 } }, { a: 1, b: { c: 2 } }); // true
112
+ * deepEqual({ a: 1, b: 2 }, { b: 2, a: 1 }); // true (order-independent)
113
+ * deepEqual([1, 2, 3], [1, 2, 3]); // true
114
+ * deepEqual([1, 2], [2, 1]); // false (arrays preserve order)
115
+ * ```
116
+ */
117
+ declare function deepEqual(a: unknown, b: unknown): boolean;
153
118
 
154
- export { type TenantId, type UserId, type Uuid, asTenantId, asUserId, generateId, generatePrefixedId, generateTemplateName, indexBy, slugify };
119
+ export { type TenantId, type UserId, type Uuid, asTenantId, asUserId, deepEqual, generateId, indexBy };
package/dist/utils.js CHANGED
@@ -1,19 +1,26 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
-
3
-
4
-
5
-
6
-
7
-
8
-
9
- var _chunkNEVERCM3js = require('./chunk-NEVERCM3.js');
10
- require('./chunk-3RG5ZIWI.js');
11
-
12
-
13
-
14
-
15
-
16
-
17
-
18
-
19
- exports.asTenantId = _chunkNEVERCM3js.asTenantId; exports.asUserId = _chunkNEVERCM3js.asUserId; exports.generateId = _chunkNEVERCM3js.generateId; exports.generatePrefixedId = _chunkNEVERCM3js.generatePrefixedId; exports.generateTemplateName = _chunkNEVERCM3js.generateTemplateName; exports.indexBy = _chunkNEVERCM3js.indexBy; exports.slugify = _chunkNEVERCM3js.slugify;
1
+ 'use strict';
2
+
3
+ var chunkFRCDMQER_js = require('./chunk-FRCDMQER.js');
4
+
5
+
6
+
7
+ Object.defineProperty(exports, "asTenantId", {
8
+ enumerable: true,
9
+ get: function () { return chunkFRCDMQER_js.asTenantId; }
10
+ });
11
+ Object.defineProperty(exports, "asUserId", {
12
+ enumerable: true,
13
+ get: function () { return chunkFRCDMQER_js.asUserId; }
14
+ });
15
+ Object.defineProperty(exports, "deepEqual", {
16
+ enumerable: true,
17
+ get: function () { return chunkFRCDMQER_js.deepEqual; }
18
+ });
19
+ Object.defineProperty(exports, "generateId", {
20
+ enumerable: true,
21
+ get: function () { return chunkFRCDMQER_js.generateId; }
22
+ });
23
+ Object.defineProperty(exports, "indexBy", {
24
+ enumerable: true,
25
+ get: function () { return chunkFRCDMQER_js.indexBy; }
26
+ });
package/dist/utils.mjs CHANGED
@@ -1,19 +1 @@
1
- import {
2
- asTenantId,
3
- asUserId,
4
- generateId,
5
- generatePrefixedId,
6
- generateTemplateName,
7
- indexBy,
8
- slugify
9
- } from "./chunk-V2RPPE2Y.mjs";
10
- import "./chunk-Y6FXYEAI.mjs";
11
- export {
12
- asTenantId,
13
- asUserId,
14
- generateId,
15
- generatePrefixedId,
16
- generateTemplateName,
17
- indexBy,
18
- slugify
19
- };
1
+ export { asTenantId, asUserId, deepEqual, generateId, indexBy } from './chunk-QY6QFRRV.mjs';
@@ -0,0 +1,8 @@
1
+ export { V as ValidationMessages } from '../types-BAPgWlpX.mjs';
2
+ export { DEFAULT_VALIDATION_MESSAGES, formatZodErrors } from './core/index.mjs';
3
+ export { parseAttributeConfig } from './config/index.mjs';
4
+ export { c as computeRecordStatus, a as createFormAttributeValidator, v as validateDraftOrThrow, b as validateObject, d as validateObjectOrThrow } from '../helpers-DD6JzYfI.mjs';
5
+ import '../attributes-D7yQuTJK.mjs';
6
+ import '@stndrds/constants';
7
+ import '../utils.mjs';
8
+ import 'zod';
@@ -0,0 +1,8 @@
1
+ export { V as ValidationMessages } from '../types-mZPUEZl0.js';
2
+ export { DEFAULT_VALIDATION_MESSAGES, formatZodErrors } from './core/index.js';
3
+ export { parseAttributeConfig } from './config/index.js';
4
+ export { c as computeRecordStatus, a as createFormAttributeValidator, v as validateDraftOrThrow, b as validateObject, d as validateObjectOrThrow } from '../helpers-kMS5R7KX.js';
5
+ import '../attributes-DcbQC-4b.js';
6
+ import '@stndrds/constants';
7
+ import '../utils.js';
8
+ import 'zod';
@@ -0,0 +1,56 @@
1
+ 'use strict';
2
+
3
+ require('../chunk-PGERPYDR.js');
4
+ var chunkV6DE3MXC_js = require('../chunk-V6DE3MXC.js');
5
+ var chunkQYNPB37W_js = require('../chunk-QYNPB37W.js');
6
+ require('../chunk-MAKSIK3P.js');
7
+ require('../chunk-J5HRK3WD.js');
8
+ require('../chunk-TKN73433.js');
9
+ require('../chunk-D7WFIGXW.js');
10
+ require('../chunk-3JINFUN3.js');
11
+ require('../chunk-QWZHR2OO.js');
12
+ require('../chunk-56QI6UTK.js');
13
+ require('../chunk-VXOTYFEW.js');
14
+ require('../chunk-OAQWRMTP.js');
15
+ require('../chunk-ACQ3TUFK.js');
16
+ require('../chunk-GCRHSPZN.js');
17
+ require('../chunk-ROAZLZA2.js');
18
+ require('../chunk-RJ4LOX7P.js');
19
+ require('../chunk-N7T66JVY.js');
20
+ require('../chunk-P2BE2A2G.js');
21
+ var chunkT225DB55_js = require('../chunk-T225DB55.js');
22
+
23
+
24
+
25
+ Object.defineProperty(exports, "parseAttributeConfig", {
26
+ enumerable: true,
27
+ get: function () { return chunkV6DE3MXC_js.parseAttributeConfig; }
28
+ });
29
+ Object.defineProperty(exports, "computeRecordStatus", {
30
+ enumerable: true,
31
+ get: function () { return chunkQYNPB37W_js.computeRecordStatus; }
32
+ });
33
+ Object.defineProperty(exports, "createFormAttributeValidator", {
34
+ enumerable: true,
35
+ get: function () { return chunkQYNPB37W_js.createFormAttributeValidator; }
36
+ });
37
+ Object.defineProperty(exports, "validateDraftOrThrow", {
38
+ enumerable: true,
39
+ get: function () { return chunkQYNPB37W_js.validateDraftOrThrow; }
40
+ });
41
+ Object.defineProperty(exports, "validateObject", {
42
+ enumerable: true,
43
+ get: function () { return chunkQYNPB37W_js.validateObject; }
44
+ });
45
+ Object.defineProperty(exports, "validateObjectOrThrow", {
46
+ enumerable: true,
47
+ get: function () { return chunkQYNPB37W_js.validateObjectOrThrow; }
48
+ });
49
+ Object.defineProperty(exports, "DEFAULT_VALIDATION_MESSAGES", {
50
+ enumerable: true,
51
+ get: function () { return chunkT225DB55_js.DEFAULT_VALIDATION_MESSAGES; }
52
+ });
53
+ Object.defineProperty(exports, "formatZodErrors", {
54
+ enumerable: true,
55
+ get: function () { return chunkT225DB55_js.formatZodErrors; }
56
+ });
@@ -0,0 +1,19 @@
1
+ import '../chunk-SP3PNHYF.mjs';
2
+ export { parseAttributeConfig } from '../chunk-SS2NR6DH.mjs';
3
+ export { computeRecordStatus, createFormAttributeValidator, validateDraftOrThrow, validateObject, validateObjectOrThrow } from '../chunk-5JVVPJJW.mjs';
4
+ import '../chunk-TMYBEXBT.mjs';
5
+ import '../chunk-4KRLCWJM.mjs';
6
+ import '../chunk-KNYZH2WD.mjs';
7
+ import '../chunk-RUYUFXNW.mjs';
8
+ import '../chunk-KWVCGQ7N.mjs';
9
+ import '../chunk-BLXQGQLK.mjs';
10
+ import '../chunk-7HFZ7MVR.mjs';
11
+ import '../chunk-ITTQ4FGR.mjs';
12
+ import '../chunk-IRTRJH37.mjs';
13
+ import '../chunk-OLJLCVNY.mjs';
14
+ import '../chunk-AYCSVKI2.mjs';
15
+ import '../chunk-4TC27SMF.mjs';
16
+ import '../chunk-WV4V64D5.mjs';
17
+ import '../chunk-5XL3JP73.mjs';
18
+ import '../chunk-R4CJHCC4.mjs';
19
+ export { DEFAULT_VALIDATION_MESSAGES, formatZodErrors } from '../chunk-UQVW4KPP.mjs';
@@ -0,0 +1,15 @@
1
+ import { z } from 'zod';
2
+ import { C as CurrencyAttribute } from '../../attributes-D7yQuTJK.mjs';
3
+ import { V as ValidationMessages } from '../../types-BAPgWlpX.mjs';
4
+ import '@stndrds/constants';
5
+ import '../../utils.mjs';
6
+
7
+ /**
8
+ * Create a Zod schema for a currency attribute
9
+ */
10
+ declare function createCurrencyValidator(attr: CurrencyAttribute, messages?: ValidationMessages): z.ZodType<{
11
+ code: string;
12
+ value: number;
13
+ }>;
14
+
15
+ export { createCurrencyValidator };
@@ -0,0 +1,15 @@
1
+ import { z } from 'zod';
2
+ import { C as CurrencyAttribute } from '../../attributes-DcbQC-4b.js';
3
+ import { V as ValidationMessages } from '../../types-mZPUEZl0.js';
4
+ import '@stndrds/constants';
5
+ import '../../utils.js';
6
+
7
+ /**
8
+ * Create a Zod schema for a currency attribute
9
+ */
10
+ declare function createCurrencyValidator(attr: CurrencyAttribute, messages?: ValidationMessages): z.ZodType<{
11
+ code: string;
12
+ value: number;
13
+ }>;
14
+
15
+ export { createCurrencyValidator };
@@ -0,0 +1,11 @@
1
+ 'use strict';
2
+
3
+ var chunkGCRHSPZN_js = require('../../chunk-GCRHSPZN.js');
4
+ require('../../chunk-T225DB55.js');
5
+
6
+
7
+
8
+ Object.defineProperty(exports, "createCurrencyValidator", {
9
+ enumerable: true,
10
+ get: function () { return chunkGCRHSPZN_js.createCurrencyValidator; }
11
+ });
@@ -0,0 +1,2 @@
1
+ export { createCurrencyValidator } from '../../chunk-AYCSVKI2.mjs';
2
+ import '../../chunk-UQVW4KPP.mjs';
@@ -0,0 +1,13 @@
1
+ import { z } from 'zod';
2
+ import { F as FileAttribute } from '../../attributes-D7yQuTJK.mjs';
3
+ import { V as ValidationMessages } from '../../types-BAPgWlpX.mjs';
4
+ import '@stndrds/constants';
5
+ import '../../utils.mjs';
6
+
7
+ /**
8
+ * Create a Zod schema for a file attribute
9
+ * Supports both single file (UUID) and multiple files (array of UUIDs)
10
+ */
11
+ declare function createFileValidator(attr: FileAttribute, messages?: ValidationMessages): z.ZodTypeAny;
12
+
13
+ export { createFileValidator };
@@ -0,0 +1,13 @@
1
+ import { z } from 'zod';
2
+ import { F as FileAttribute } from '../../attributes-DcbQC-4b.js';
3
+ import { V as ValidationMessages } from '../../types-mZPUEZl0.js';
4
+ import '@stndrds/constants';
5
+ import '../../utils.js';
6
+
7
+ /**
8
+ * Create a Zod schema for a file attribute
9
+ * Supports both single file (UUID) and multiple files (array of UUIDs)
10
+ */
11
+ declare function createFileValidator(attr: FileAttribute, messages?: ValidationMessages): z.ZodTypeAny;
12
+
13
+ export { createFileValidator };
@@ -0,0 +1,11 @@
1
+ 'use strict';
2
+
3
+ var chunkROAZLZA2_js = require('../../chunk-ROAZLZA2.js');
4
+ require('../../chunk-T225DB55.js');
5
+
6
+
7
+
8
+ Object.defineProperty(exports, "createFileValidator", {
9
+ enumerable: true,
10
+ get: function () { return chunkROAZLZA2_js.createFileValidator; }
11
+ });
@@ -0,0 +1,2 @@
1
+ export { createFileValidator } from '../../chunk-4TC27SMF.mjs';
2
+ import '../../chunk-UQVW4KPP.mjs';
@@ -0,0 +1,22 @@
1
+ import { z } from 'zod';
2
+ import { L as LocationAttribute } from '../../attributes-D7yQuTJK.mjs';
3
+ import { V as ValidationMessages } from '../../types-BAPgWlpX.mjs';
4
+ import '@stndrds/constants';
5
+ import '../../utils.mjs';
6
+
7
+ type LocationShape = {
8
+ address?: string;
9
+ address2?: string;
10
+ city?: string;
11
+ state?: string;
12
+ postalCode?: string;
13
+ country?: string;
14
+ latitude?: number;
15
+ longitude?: number;
16
+ };
17
+ /**
18
+ * Create a Zod schema for a location attribute
19
+ */
20
+ declare function createLocationValidator(attr: LocationAttribute, messages?: ValidationMessages): z.ZodType<LocationShape>;
21
+
22
+ export { createLocationValidator };
@@ -0,0 +1,22 @@
1
+ import { z } from 'zod';
2
+ import { L as LocationAttribute } from '../../attributes-DcbQC-4b.js';
3
+ import { V as ValidationMessages } from '../../types-mZPUEZl0.js';
4
+ import '@stndrds/constants';
5
+ import '../../utils.js';
6
+
7
+ type LocationShape = {
8
+ address?: string;
9
+ address2?: string;
10
+ city?: string;
11
+ state?: string;
12
+ postalCode?: string;
13
+ country?: string;
14
+ latitude?: number;
15
+ longitude?: number;
16
+ };
17
+ /**
18
+ * Create a Zod schema for a location attribute
19
+ */
20
+ declare function createLocationValidator(attr: LocationAttribute, messages?: ValidationMessages): z.ZodType<LocationShape>;
21
+
22
+ export { createLocationValidator };
@@ -0,0 +1,11 @@
1
+ 'use strict';
2
+
3
+ var chunkRJ4LOX7P_js = require('../../chunk-RJ4LOX7P.js');
4
+ require('../../chunk-T225DB55.js');
5
+
6
+
7
+
8
+ Object.defineProperty(exports, "createLocationValidator", {
9
+ enumerable: true,
10
+ get: function () { return chunkRJ4LOX7P_js.createLocationValidator; }
11
+ });
@@ -0,0 +1,2 @@
1
+ export { createLocationValidator } from '../../chunk-WV4V64D5.mjs';
2
+ import '../../chunk-UQVW4KPP.mjs';
@@ -0,0 +1,22 @@
1
+ import { z } from 'zod';
2
+ import { P as PhoneAttribute } from '../../attributes-D7yQuTJK.mjs';
3
+ import { V as ValidationMessages } from '../../types-BAPgWlpX.mjs';
4
+ import '@stndrds/constants';
5
+ import '../../utils.mjs';
6
+
7
+ /**
8
+ * Create a Zod schema for a phone attribute.
9
+ *
10
+ * Validates:
11
+ * - countryCode is a valid ISO3 country code
12
+ * - phoneNumber contains valid digits for the given country
13
+ *
14
+ * Transforms:
15
+ * - Normalizes phoneNumber to national digits without trunk prefix
16
+ */
17
+ declare function createPhoneValidator(attr: PhoneAttribute, messages?: ValidationMessages): z.ZodType<{
18
+ countryCode: string;
19
+ phoneNumber: string;
20
+ }>;
21
+
22
+ export { createPhoneValidator };
@@ -0,0 +1,22 @@
1
+ import { z } from 'zod';
2
+ import { P as PhoneAttribute } from '../../attributes-DcbQC-4b.js';
3
+ import { V as ValidationMessages } from '../../types-mZPUEZl0.js';
4
+ import '@stndrds/constants';
5
+ import '../../utils.js';
6
+
7
+ /**
8
+ * Create a Zod schema for a phone attribute.
9
+ *
10
+ * Validates:
11
+ * - countryCode is a valid ISO3 country code
12
+ * - phoneNumber contains valid digits for the given country
13
+ *
14
+ * Transforms:
15
+ * - Normalizes phoneNumber to national digits without trunk prefix
16
+ */
17
+ declare function createPhoneValidator(attr: PhoneAttribute, messages?: ValidationMessages): z.ZodType<{
18
+ countryCode: string;
19
+ phoneNumber: string;
20
+ }>;
21
+
22
+ export { createPhoneValidator };
@@ -0,0 +1,11 @@
1
+ 'use strict';
2
+
3
+ var chunkN7T66JVY_js = require('../../chunk-N7T66JVY.js');
4
+ require('../../chunk-T225DB55.js');
5
+
6
+
7
+
8
+ Object.defineProperty(exports, "createPhoneValidator", {
9
+ enumerable: true,
10
+ get: function () { return chunkN7T66JVY_js.createPhoneValidator; }
11
+ });
@@ -0,0 +1,2 @@
1
+ export { createPhoneValidator } from '../../chunk-5XL3JP73.mjs';
2
+ import '../../chunk-UQVW4KPP.mjs';
@@ -0,0 +1,25 @@
1
+ import { z } from 'zod';
2
+ import { M as MultiRelationAttribute, R as RelationAttribute, S as SingleRelationAttribute } from '../../attributes-D7yQuTJK.mjs';
3
+ import { V as ValidationMessages } from '../../types-BAPgWlpX.mjs';
4
+ import '@stndrds/constants';
5
+ import '../../utils.mjs';
6
+
7
+ /**
8
+ * Create a Zod schema for a single relation attribute (cardinality: "one")
9
+ * Supports hybrid format `{ id, props }` from qualified relations.
10
+ * IMPORTANT: Validates the ID but preserves the original format (keeps props).
11
+ */
12
+ declare function createSingleRelationValidator(attr: SingleRelationAttribute, messages?: ValidationMessages): z.ZodTypeAny;
13
+ /**
14
+ * Create a Zod schema for a multi relation attribute (cardinality: "many")
15
+ * Supports hybrid format arrays with `{ id, props }` items from qualified relations.
16
+ * IMPORTANT: Validates the IDs but preserves the original format (keeps props).
17
+ */
18
+ declare function createMultiRelationValidator(attr: MultiRelationAttribute, messages?: ValidationMessages): z.ZodTypeAny;
19
+ /**
20
+ * Create a Zod schema for a relation attribute
21
+ * Dispatches to single or multi validator based on cardinality
22
+ */
23
+ declare function createRelationValidator(attr: RelationAttribute, messages?: ValidationMessages): z.ZodTypeAny;
24
+
25
+ export { createMultiRelationValidator, createRelationValidator, createSingleRelationValidator };