@fougere/schema 0.8.3-alpha.0 → 0.8.4-alpha.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.
Files changed (219) hide show
  1. package/dist/Schema.d.ts +3 -6
  2. package/dist/Schema.d.ts.map +1 -1
  3. package/dist/Schema.js +9 -17
  4. package/dist/Schema.js.map +1 -1
  5. package/dist/SchemaDefinition.d.ts +24 -6
  6. package/dist/SchemaDefinition.d.ts.map +1 -1
  7. package/dist/SchemaDefinition.js +76 -44
  8. package/dist/SchemaDefinition.js.map +1 -1
  9. package/dist/SchemaView.d.ts +1 -1
  10. package/dist/SchemaView.d.ts.map +1 -1
  11. package/dist/axis/Axis.d.ts +1 -1
  12. package/dist/axis/Axis.d.ts.map +1 -1
  13. package/dist/axis/boundary/Boundaries.d.ts +5 -0
  14. package/dist/axis/boundary/Boundaries.d.ts.map +1 -1
  15. package/dist/axis/boundary/Boundaries.js.map +1 -1
  16. package/dist/axis/boundary/Boundary.d.ts +5 -4
  17. package/dist/axis/boundary/Boundary.d.ts.map +1 -1
  18. package/dist/axis/boundary/Boundary.js +4 -5
  19. package/dist/axis/boundary/Boundary.js.map +1 -1
  20. package/dist/axis/boundary/BoundaryAxis.js +2 -2
  21. package/dist/axis/boundary/BoundaryAxis.js.map +1 -1
  22. package/dist/axis/lifecycle/Lifecycle.d.ts +5 -3
  23. package/dist/axis/lifecycle/Lifecycle.d.ts.map +1 -1
  24. package/dist/axis/lifecycle/Lifecycle.js +5 -1
  25. package/dist/axis/lifecycle/Lifecycle.js.map +1 -1
  26. package/dist/axis/lifecycle/LifecycleAxis.js +6 -6
  27. package/dist/axis/lifecycle/LifecycleAxis.js.map +1 -1
  28. package/dist/axis/lifecycle/apply.d.ts +6 -6
  29. package/dist/axis/lifecycle/apply.d.ts.map +1 -1
  30. package/dist/axis/lifecycle/apply.js +10 -9
  31. package/dist/axis/lifecycle/apply.js.map +1 -1
  32. package/dist/axis/role/Role.d.ts +8 -5
  33. package/dist/axis/role/Role.d.ts.map +1 -1
  34. package/dist/axis/role/Role.js +7 -0
  35. package/dist/axis/role/Role.js.map +1 -1
  36. package/dist/axis/role/RoleAxis.js +9 -9
  37. package/dist/axis/role/RoleAxis.js.map +1 -1
  38. package/dist/axis/shape/Shape.d.ts +14 -0
  39. package/dist/axis/shape/Shape.d.ts.map +1 -1
  40. package/dist/axis/shape/Shape.js +43 -34
  41. package/dist/axis/shape/Shape.js.map +1 -1
  42. package/dist/entity/EntityAdapterSet.d.ts +2 -2
  43. package/dist/entity/EntityAdapterSet.d.ts.map +1 -1
  44. package/dist/entity/EntityAdapterSet.js +2 -2
  45. package/dist/entity/EntityAdapterSet.js.map +1 -1
  46. package/dist/entity.d.ts +2 -2
  47. package/dist/entity.js +2 -2
  48. package/dist/field/Field.d.ts.map +1 -1
  49. package/dist/field/Field.js +2 -1
  50. package/dist/field/Field.js.map +1 -1
  51. package/dist/field/FieldSet.d.ts +4 -7
  52. package/dist/field/FieldSet.d.ts.map +1 -1
  53. package/dist/field/FieldSet.js +4 -15
  54. package/dist/field/FieldSet.js.map +1 -1
  55. package/dist/index.d.ts +2 -2
  56. package/dist/index.d.ts.map +1 -1
  57. package/dist/index.js +1 -0
  58. package/dist/index.js.map +1 -1
  59. package/dist/lib/validation.d.ts +32 -0
  60. package/dist/lib/validation.d.ts.map +1 -0
  61. package/dist/lib/validation.js +6 -0
  62. package/dist/lib/validation.js.map +1 -0
  63. package/dist/projection/Cases.d.ts +1 -1
  64. package/dist/projection/Cases.d.ts.map +1 -1
  65. package/dist/projection/Cases.js +11 -7
  66. package/dist/projection/Cases.js.map +1 -1
  67. package/dist/projection/Visibility.js +1 -1
  68. package/dist/projection/Visibility.js.map +1 -1
  69. package/dist/projection/card/Bundle.d.ts.map +1 -1
  70. package/dist/projection/card/Bundle.js +1 -4
  71. package/dist/projection/card/Bundle.js.map +1 -1
  72. package/dist/projection/card/Card.d.ts +7 -1
  73. package/dist/projection/card/Card.d.ts.map +1 -1
  74. package/dist/projection/card/Card.js +25 -133
  75. package/dist/projection/card/Card.js.map +1 -1
  76. package/dist/projection/card/Descriptor.d.ts +2 -2
  77. package/dist/projection/card/Descriptor.d.ts.map +1 -1
  78. package/dist/projection/card/admission.d.ts +12 -11
  79. package/dist/projection/card/admission.d.ts.map +1 -1
  80. package/dist/projection/card/admission.js +13 -11
  81. package/dist/projection/card/admission.js.map +1 -1
  82. package/dist/projection/card/diff.d.ts +7 -1
  83. package/dist/projection/card/diff.d.ts.map +1 -1
  84. package/dist/projection/card/diff.js +111 -1
  85. package/dist/projection/card/diff.js.map +1 -1
  86. package/dist/validator/FieldDeclarationValidator.d.ts +1 -1
  87. package/dist/validator/FieldDeclarationValidator.d.ts.map +1 -1
  88. package/dist/validator/FieldDeclarationValidator.js +4 -4
  89. package/dist/validator/FieldDeclarationValidator.js.map +1 -1
  90. package/dist/validator/FieldValueValidator.d.ts +6 -1
  91. package/dist/validator/FieldValueValidator.d.ts.map +1 -1
  92. package/dist/validator/FieldValueValidator.js +36 -7
  93. package/dist/validator/FieldValueValidator.js.map +1 -1
  94. package/dist/validator/InputValidator.d.ts +1 -1
  95. package/dist/validator/InputValidator.d.ts.map +1 -1
  96. package/dist/validator/InputValidator.js +8 -18
  97. package/dist/validator/InputValidator.js.map +1 -1
  98. package/dist/vocabulary/preset/created.d.ts +0 -5
  99. package/dist/vocabulary/preset/created.d.ts.map +1 -1
  100. package/dist/vocabulary/preset/created.js +0 -5
  101. package/dist/vocabulary/preset/created.js.map +1 -1
  102. package/dist/vocabulary/preset/email.d.ts +0 -5
  103. package/dist/vocabulary/preset/email.d.ts.map +1 -1
  104. package/dist/vocabulary/preset/email.js +0 -5
  105. package/dist/vocabulary/preset/email.js.map +1 -1
  106. package/dist/vocabulary/preset/updated.d.ts +0 -5
  107. package/dist/vocabulary/preset/updated.d.ts.map +1 -1
  108. package/dist/vocabulary/preset/updated.js +0 -5
  109. package/dist/vocabulary/preset/updated.js.map +1 -1
  110. package/dist/vocabulary/preset/url.d.ts +0 -5
  111. package/dist/vocabulary/preset/url.d.ts.map +1 -1
  112. package/dist/vocabulary/preset/url.js +0 -5
  113. package/dist/vocabulary/preset/url.js.map +1 -1
  114. package/dist/vocabulary/primitive/bool.d.ts +0 -5
  115. package/dist/vocabulary/primitive/bool.d.ts.map +1 -1
  116. package/dist/vocabulary/primitive/bool.js +0 -5
  117. package/dist/vocabulary/primitive/bool.js.map +1 -1
  118. package/dist/vocabulary/primitive/date.d.ts +3 -3
  119. package/dist/vocabulary/primitive/date.js +3 -3
  120. package/dist/vocabulary/primitive/json.js +3 -3
  121. package/dist/vocabulary/primitive/list.d.ts +3 -3
  122. package/dist/vocabulary/primitive/list.js +3 -3
  123. package/dist/vocabulary/primitive/many.d.ts +3 -3
  124. package/dist/vocabulary/primitive/many.js +3 -3
  125. package/dist/vocabulary/primitive/number.d.ts +0 -5
  126. package/dist/vocabulary/primitive/number.d.ts.map +1 -1
  127. package/dist/vocabulary/primitive/number.js +0 -5
  128. package/dist/vocabulary/primitive/number.js.map +1 -1
  129. package/dist/vocabulary/primitive/oneOf.js +3 -3
  130. package/dist/vocabulary/primitive/primary.js +3 -3
  131. package/dist/vocabulary/primitive/ref.d.ts +0 -5
  132. package/dist/vocabulary/primitive/ref.d.ts.map +1 -1
  133. package/dist/vocabulary/primitive/ref.js +0 -5
  134. package/dist/vocabulary/primitive/ref.js.map +1 -1
  135. package/dist/vocabulary/primitive/text.d.ts +0 -5
  136. package/dist/vocabulary/primitive/text.d.ts.map +1 -1
  137. package/dist/vocabulary/primitive/text.js +0 -5
  138. package/dist/vocabulary/primitive/text.js.map +1 -1
  139. package/dist/vocabulary/rule/immutable.d.ts +0 -5
  140. package/dist/vocabulary/rule/immutable.d.ts.map +1 -1
  141. package/dist/vocabulary/rule/immutable.js +0 -5
  142. package/dist/vocabulary/rule/immutable.js.map +1 -1
  143. package/dist/vocabulary/rule/indexed.d.ts +0 -5
  144. package/dist/vocabulary/rule/indexed.d.ts.map +1 -1
  145. package/dist/vocabulary/rule/indexed.js +0 -5
  146. package/dist/vocabulary/rule/indexed.js.map +1 -1
  147. package/dist/vocabulary/rule/nullable.d.ts +3 -3
  148. package/dist/vocabulary/rule/nullable.js +3 -3
  149. package/dist/vocabulary/rule/optional.d.ts +3 -3
  150. package/dist/vocabulary/rule/optional.js +3 -3
  151. package/dist/vocabulary/rule/readOnly.d.ts +3 -3
  152. package/dist/vocabulary/rule/readOnly.js +4 -4
  153. package/dist/vocabulary/rule/readOnly.js.map +1 -1
  154. package/dist/vocabulary/rule/unique.d.ts +0 -5
  155. package/dist/vocabulary/rule/unique.d.ts.map +1 -1
  156. package/dist/vocabulary/rule/unique.js +0 -5
  157. package/dist/vocabulary/rule/unique.js.map +1 -1
  158. package/dist/vocabulary/rule/writeOnly.d.ts +2 -2
  159. package/dist/vocabulary/rule/writeOnly.js +3 -3
  160. package/dist/vocabulary/rule/writeOnly.js.map +1 -1
  161. package/dist/vocabulary/vocabulary.d.ts +2 -2
  162. package/dist/vocabulary/vocabulary.js +5 -5
  163. package/package.json +1 -1
  164. package/src/Schema.ts +14 -20
  165. package/src/SchemaDefinition.ts +74 -48
  166. package/src/SchemaView.ts +1 -1
  167. package/src/axis/Axis.ts +1 -1
  168. package/src/axis/boundary/Boundaries.ts +5 -0
  169. package/src/axis/boundary/Boundary.ts +7 -9
  170. package/src/axis/boundary/BoundaryAxis.ts +2 -2
  171. package/src/axis/lifecycle/Lifecycle.ts +9 -4
  172. package/src/axis/lifecycle/LifecycleAxis.ts +7 -7
  173. package/src/axis/lifecycle/apply.ts +10 -9
  174. package/src/axis/role/Role.ts +14 -5
  175. package/src/axis/role/RoleAxis.ts +10 -10
  176. package/src/axis/shape/Shape.ts +61 -37
  177. package/src/entity/EntityAdapterSet.ts +2 -2
  178. package/src/entity.ts +2 -2
  179. package/src/field/Field.ts +2 -1
  180. package/src/field/FieldSet.ts +6 -20
  181. package/src/index.ts +2 -2
  182. package/src/lib/validation.ts +25 -0
  183. package/src/projection/Cases.ts +13 -8
  184. package/src/projection/Visibility.ts +1 -1
  185. package/src/projection/card/Bundle.ts +1 -4
  186. package/src/projection/card/Card.ts +26 -159
  187. package/src/projection/card/Descriptor.ts +2 -10
  188. package/src/projection/card/admission.ts +14 -12
  189. package/src/projection/card/diff.ts +142 -1
  190. package/src/validator/FieldDeclarationValidator.ts +5 -5
  191. package/src/validator/FieldValueValidator.ts +45 -12
  192. package/src/validator/InputValidator.ts +8 -18
  193. package/src/vocabulary/preset/created.ts +0 -5
  194. package/src/vocabulary/preset/email.ts +0 -5
  195. package/src/vocabulary/preset/updated.ts +0 -5
  196. package/src/vocabulary/preset/url.ts +0 -5
  197. package/src/vocabulary/primitive/bool.ts +0 -5
  198. package/src/vocabulary/primitive/date.ts +3 -3
  199. package/src/vocabulary/primitive/json.ts +3 -3
  200. package/src/vocabulary/primitive/list.ts +3 -3
  201. package/src/vocabulary/primitive/many.ts +3 -3
  202. package/src/vocabulary/primitive/number.ts +0 -5
  203. package/src/vocabulary/primitive/oneOf.ts +3 -3
  204. package/src/vocabulary/primitive/primary.ts +3 -3
  205. package/src/vocabulary/primitive/ref.ts +0 -5
  206. package/src/vocabulary/primitive/text.ts +0 -5
  207. package/src/vocabulary/rule/immutable.ts +0 -5
  208. package/src/vocabulary/rule/indexed.ts +0 -5
  209. package/src/vocabulary/rule/nullable.ts +3 -3
  210. package/src/vocabulary/rule/optional.ts +3 -3
  211. package/src/vocabulary/rule/readOnly.ts +4 -4
  212. package/src/vocabulary/rule/unique.ts +0 -5
  213. package/src/vocabulary/rule/writeOnly.ts +3 -3
  214. package/src/vocabulary/vocabulary.ts +5 -5
  215. package/dist/validation.d.ts +0 -17
  216. package/dist/validation.d.ts.map +0 -1
  217. package/dist/validation.js +0 -2
  218. package/dist/validation.js.map +0 -1
  219. package/src/validation.ts +0 -10
@@ -1,8 +1,3 @@
1
1
  import { Field } from '../../field/Field.js';
2
- /**
3
- * So a creation stamp is written by the storage and refused from a client.
4
- * FR : pour qu'un horodatage de création soit écrit par le storage et refusé au client.
5
- * `created()` → `create: 'now'`, `update: 'forbidden'`
6
- */
7
2
  export declare function created(): Field<Date>;
8
3
  //# sourceMappingURL=created.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"created.d.ts","sourceRoot":"","sources":["../../../src/vocabulary/preset/created.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAC;AAG7C;;;;GAIG;AACH,wBAAgB,OAAO,IAAI,KAAK,CAAC,IAAI,CAAC,CAIrC"}
1
+ {"version":3,"file":"created.d.ts","sourceRoot":"","sources":["../../../src/vocabulary/preset/created.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAC;AAG7C,wBAAgB,OAAO,IAAI,KAAK,CAAC,IAAI,CAAC,CAIrC"}
@@ -1,9 +1,4 @@
1
1
  import { date } from '../primitive/date.js';
2
- /**
3
- * So a creation stamp is written by the storage and refused from a client.
4
- * FR : pour qu'un horodatage de création soit écrit par le storage et refusé au client.
5
- * `created()` → `create: 'now'`, `update: 'forbidden'`
6
- */
7
2
  export function created() {
8
3
  return date().with({
9
4
  lifecycle: { create: 'now', update: 'forbidden' },
@@ -1 +1 @@
1
- {"version":3,"file":"created.js","sourceRoot":"","sources":["../../../src/vocabulary/preset/created.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAC;AAE5C;;;;GAIG;AACH,MAAM,UAAU,OAAO;IACrB,OAAO,IAAI,EAAE,CAAC,IAAI,CAAC;QACjB,SAAS,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,WAAW,EAAE;KAClD,CAAC,CAAC;AACL,CAAC"}
1
+ {"version":3,"file":"created.js","sourceRoot":"","sources":["../../../src/vocabulary/preset/created.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAC;AAE5C,MAAM,UAAU,OAAO;IACrB,OAAO,IAAI,EAAE,CAAC,IAAI,CAAC;QACjB,SAAS,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,WAAW,EAAE;KAClD,CAAC,CAAC;AACL,CAAC"}
@@ -1,9 +1,4 @@
1
1
  import { type TextOptions } from '../primitive/text.js';
2
2
  import type { Field } from '../../field/Field.js';
3
- /**
4
- * So the format is stated once, where everyone would otherwise write the same regex.
5
- * FR : pour que le format soit énoncé une fois, là où chacun réécrirait la même regex.
6
- * `email({ max: 254 })`
7
- */
8
3
  export declare function email(opts?: Omit<TextOptions, 'format'>): Field<string>;
9
4
  //# sourceMappingURL=email.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"email.d.ts","sourceRoot":"","sources":["../../../src/vocabulary/preset/email.ts"],"names":[],"mappings":"AAAA,OAAO,EAAQ,KAAK,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAC9D,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAC;AAElD;;;;GAIG;AACH,wBAAgB,KAAK,CAAC,IAAI,CAAC,EAAE,IAAI,CAAC,WAAW,EAAE,QAAQ,CAAC,GAAG,KAAK,CAAC,MAAM,CAAC,CAEvE"}
1
+ {"version":3,"file":"email.d.ts","sourceRoot":"","sources":["../../../src/vocabulary/preset/email.ts"],"names":[],"mappings":"AAAA,OAAO,EAAQ,KAAK,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAC9D,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAC;AAElD,wBAAgB,KAAK,CAAC,IAAI,CAAC,EAAE,IAAI,CAAC,WAAW,EAAE,QAAQ,CAAC,GAAG,KAAK,CAAC,MAAM,CAAC,CAEvE"}
@@ -1,9 +1,4 @@
1
1
  import { text } from '../primitive/text.js';
2
- /**
3
- * So the format is stated once, where everyone would otherwise write the same regex.
4
- * FR : pour que le format soit énoncé une fois, là où chacun réécrirait la même regex.
5
- * `email({ max: 254 })`
6
- */
7
2
  export function email(opts) {
8
3
  return text({ ...opts, format: 'email' });
9
4
  }
@@ -1 +1 @@
1
- {"version":3,"file":"email.js","sourceRoot":"","sources":["../../../src/vocabulary/preset/email.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAoB,MAAM,sBAAsB,CAAC;AAG9D;;;;GAIG;AACH,MAAM,UAAU,KAAK,CAAC,IAAkC;IACtD,OAAO,IAAI,CAAC,EAAE,GAAG,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC,CAAC;AAC5C,CAAC"}
1
+ {"version":3,"file":"email.js","sourceRoot":"","sources":["../../../src/vocabulary/preset/email.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAoB,MAAM,sBAAsB,CAAC;AAG9D,MAAM,UAAU,KAAK,CAAC,IAAkC;IACtD,OAAO,IAAI,CAAC,EAAE,GAAG,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC,CAAC;AAC5C,CAAC"}
@@ -1,8 +1,3 @@
1
1
  import { Field } from '../../field/Field.js';
2
- /**
3
- * So the dual of `created()` is re-stamped at every write, by the same hand.
4
- * FR : pour que le dual de `created()` soit ré-estampé à chaque écriture, par la même main.
5
- * `updated()` → `create: 'now'`, `update: 'now'`
6
- */
7
2
  export declare function updated(): Field<Date>;
8
3
  //# sourceMappingURL=updated.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"updated.d.ts","sourceRoot":"","sources":["../../../src/vocabulary/preset/updated.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAC;AAE7C;;;;GAIG;AACH,wBAAgB,OAAO,IAAI,KAAK,CAAC,IAAI,CAAC,CAGrC"}
1
+ {"version":3,"file":"updated.d.ts","sourceRoot":"","sources":["../../../src/vocabulary/preset/updated.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAC;AAE7C,wBAAgB,OAAO,IAAI,KAAK,CAAC,IAAI,CAAC,CAGrC"}
@@ -1,9 +1,4 @@
1
1
  import { created } from './created.js';
2
- /**
3
- * So the dual of `created()` is re-stamped at every write, by the same hand.
4
- * FR : pour que le dual de `created()` soit ré-estampé à chaque écriture, par la même main.
5
- * `updated()` → `create: 'now'`, `update: 'now'`
6
- */
7
2
  export function updated() {
8
3
  const base = created();
9
4
  return base.with({ lifecycle: { ...base.lifecycle, update: 'now' } });
@@ -1 +1 @@
1
- {"version":3,"file":"updated.js","sourceRoot":"","sources":["../../../src/vocabulary/preset/updated.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAGvC;;;;GAIG;AACH,MAAM,UAAU,OAAO;IACrB,MAAM,IAAI,GAAG,OAAO,EAAE,CAAC;IACvB,OAAO,IAAI,CAAC,IAAI,CAAC,EAAE,SAAS,EAAE,EAAE,GAAG,IAAI,CAAC,SAAS,EAAE,MAAM,EAAE,KAAK,EAAE,EAAE,CAAC,CAAC;AACxE,CAAC"}
1
+ {"version":3,"file":"updated.js","sourceRoot":"","sources":["../../../src/vocabulary/preset/updated.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAGvC,MAAM,UAAU,OAAO;IACrB,MAAM,IAAI,GAAG,OAAO,EAAE,CAAC;IACvB,OAAO,IAAI,CAAC,IAAI,CAAC,EAAE,SAAS,EAAE,EAAE,GAAG,IAAI,CAAC,SAAS,EAAE,MAAM,EAAE,KAAK,EAAE,EAAE,CAAC,CAAC;AACxE,CAAC"}
@@ -1,9 +1,4 @@
1
1
  import { type TextOptions } from '../primitive/text.js';
2
2
  import type { Field } from '../../field/Field.js';
3
- /**
4
- * So a URL is a text with a stated format, not a type of its own.
5
- * FR : pour qu'une URL soit un texte au format énoncé, pas un type à part.
6
- * `url()` → `{ type: 'string', format: 'uri' }`
7
- */
8
3
  export declare function url(opts?: Omit<TextOptions, 'format'>): Field<string>;
9
4
  //# sourceMappingURL=url.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"url.d.ts","sourceRoot":"","sources":["../../../src/vocabulary/preset/url.ts"],"names":[],"mappings":"AAAA,OAAO,EAAQ,KAAK,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAC9D,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAC;AAElD;;;;GAIG;AACH,wBAAgB,GAAG,CAAC,IAAI,CAAC,EAAE,IAAI,CAAC,WAAW,EAAE,QAAQ,CAAC,GAAG,KAAK,CAAC,MAAM,CAAC,CAErE"}
1
+ {"version":3,"file":"url.d.ts","sourceRoot":"","sources":["../../../src/vocabulary/preset/url.ts"],"names":[],"mappings":"AAAA,OAAO,EAAQ,KAAK,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAC9D,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAC;AAElD,wBAAgB,GAAG,CAAC,IAAI,CAAC,EAAE,IAAI,CAAC,WAAW,EAAE,QAAQ,CAAC,GAAG,KAAK,CAAC,MAAM,CAAC,CAErE"}
@@ -1,9 +1,4 @@
1
1
  import { text } from '../primitive/text.js';
2
- /**
3
- * So a URL is a text with a stated format, not a type of its own.
4
- * FR : pour qu'une URL soit un texte au format énoncé, pas un type à part.
5
- * `url()` → `{ type: 'string', format: 'uri' }`
6
- */
7
2
  export function url(opts) {
8
3
  return text({ ...opts, format: 'uri' });
9
4
  }
@@ -1 +1 @@
1
- {"version":3,"file":"url.js","sourceRoot":"","sources":["../../../src/vocabulary/preset/url.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAoB,MAAM,sBAAsB,CAAC;AAG9D;;;;GAIG;AACH,MAAM,UAAU,GAAG,CAAC,IAAkC;IACpD,OAAO,IAAI,CAAC,EAAE,GAAG,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC,CAAC;AAC1C,CAAC"}
1
+ {"version":3,"file":"url.js","sourceRoot":"","sources":["../../../src/vocabulary/preset/url.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAoB,MAAM,sBAAsB,CAAC;AAG9D,MAAM,UAAU,GAAG,CAAC,IAAkC;IACpD,OAAO,IAAI,CAAC,EAAE,GAAG,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC,CAAC;AAC1C,CAAC"}
@@ -1,9 +1,4 @@
1
1
  import { Field } from '../../field/Field.js';
2
- /**
3
- * So a default is a lifecycle rule, not a value the handler remembers to set.
4
- * FR : pour qu'un défaut soit une règle de cycle de vie, pas un oubli possible du handler.
5
- * `bool({ default: false })`
6
- */
7
2
  export declare function bool(opts?: {
8
3
  default?: boolean;
9
4
  description?: string;
@@ -1 +1 @@
1
- {"version":3,"file":"bool.d.ts","sourceRoot":"","sources":["../../../src/vocabulary/primitive/bool.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAC;AAE7C;;;;GAIG;AACH,wBAAgB,IAAI,CAAC,IAAI,CAAC,EAAE;IAAE,OAAO,CAAC,EAAE,OAAO,CAAC;IAAC,WAAW,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,KAAK,CAAC,OAAO,CAAC,CAOvF"}
1
+ {"version":3,"file":"bool.d.ts","sourceRoot":"","sources":["../../../src/vocabulary/primitive/bool.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAC;AAE7C,wBAAgB,IAAI,CAAC,IAAI,CAAC,EAAE;IAAE,OAAO,CAAC,EAAE,OAAO,CAAC;IAAC,WAAW,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,KAAK,CAAC,OAAO,CAAC,CAOvF"}
@@ -1,9 +1,4 @@
1
1
  import { Field } from '../../field/Field.js';
2
- /**
3
- * So a default is a lifecycle rule, not a value the handler remembers to set.
4
- * FR : pour qu'un défaut soit une règle de cycle de vie, pas un oubli possible du handler.
5
- * `bool({ default: false })`
6
- */
7
2
  export function bool(opts) {
8
3
  return new Field({
9
4
  shape: { type: 'boolean' },
@@ -1 +1 @@
1
- {"version":3,"file":"bool.js","sourceRoot":"","sources":["../../../src/vocabulary/primitive/bool.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAC;AAE7C;;;;GAIG;AACH,MAAM,UAAU,IAAI,CAAC,IAAkD;IACrE,OAAO,IAAI,KAAK,CAAU;QACxB,KAAK,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE;QAC1B,SAAS,EACP,IAAI,EAAE,OAAO,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,EAAE,KAAK,EAAE,IAAI,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC,CAAC,SAAS;QAC/E,IAAI,EAAE,IAAI,EAAE,WAAW,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,WAAW,EAAE,IAAI,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC,SAAS;KACtF,CAAC,CAAC;AACL,CAAC"}
1
+ {"version":3,"file":"bool.js","sourceRoot":"","sources":["../../../src/vocabulary/primitive/bool.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAC;AAE7C,MAAM,UAAU,IAAI,CAAC,IAAkD;IACrE,OAAO,IAAI,KAAK,CAAU;QACxB,KAAK,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE;QAC1B,SAAS,EACP,IAAI,EAAE,OAAO,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,EAAE,KAAK,EAAE,IAAI,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC,CAAC,SAAS;QAC/E,IAAI,EAAE,IAAI,EAAE,WAAW,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,WAAW,EAAE,IAAI,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC,SAAS;KACtF,CAAC,CAAC;AACL,CAAC"}
@@ -1,8 +1,8 @@
1
1
  import { Field } from '../../field/Field.js';
2
2
  /**
3
- * So a date is a string on the wire and a `Date` in a handler, with no word said.
4
- * FR : pour qu'une date soit une chaîne sur le fil et une `Date` dans un handler.
5
- * `date()` → `{ type: 'string', format: 'date-time' }`, decoded by the `isoDate` boundary
3
+ * A `Date` in a handler, an ISO string on the wire the `isoDate` boundary converts.
4
+ * FR : un `Date` dans un handler, une chaîne ISO sur le fil `isoDate` convertit.
5
+ * `date()` → `{ type: 'string', format: 'date-time' }`
6
6
  */
7
7
  export declare function date(): Field<Date>;
8
8
  //# sourceMappingURL=date.d.ts.map
@@ -1,8 +1,8 @@
1
1
  import { Field } from '../../field/Field.js';
2
2
  /**
3
- * So a date is a string on the wire and a `Date` in a handler, with no word said.
4
- * FR : pour qu'une date soit une chaîne sur le fil et une `Date` dans un handler.
5
- * `date()` → `{ type: 'string', format: 'date-time' }`, decoded by the `isoDate` boundary
3
+ * A `Date` in a handler, an ISO string on the wire the `isoDate` boundary converts.
4
+ * FR : un `Date` dans un handler, une chaîne ISO sur le fil `isoDate` convertit.
5
+ * `date()` → `{ type: 'string', format: 'date-time' }`
6
6
  */
7
7
  export function date() {
8
8
  return new Field({ shape: { type: 'string', format: 'date-time' } });
@@ -1,9 +1,9 @@
1
1
  import { Field } from '../../field/Field.js';
2
2
  import { InputValidator } from '../../validator/InputValidator.js';
3
3
  /**
4
- * So a stored object can carry a schema, instead of admitting any shape forever.
5
- * FR : pour qu'un objet stocké porte un schéma, au lieu d'admettre toute forme à jamais.
6
- * `json(Address)` → the object's properties and its required keys
4
+ * `json(Address)` where the object has a shape; `json()` alone admits any shape forever.
5
+ * FR : `json(Address)` quand l'objet a une forme ; `json()` seul admet tout, à jamais.
6
+ * `json(Address)` → the entity's properties, and its required keys
7
7
  */
8
8
  export function json(of) {
9
9
  if (!of)
@@ -4,9 +4,9 @@ export interface ListOptions {
4
4
  max?: number;
5
5
  }
6
6
  /**
7
- * So a list of values is told apart from a relation, which `many()` declares.
8
- * FR : pour qu'une liste de valeurs se distingue d'une relation, que `many()` déclare.
9
- * `list(text(), { max: 5 })`; `list(ref(User))`throws
7
+ * A list of VALUES. The other side of a relation is `many()`, and passing one here throws.
8
+ * FR : une liste de VALEURS. L'autre côté d'une relation est `many()`, et en passer une ici lève.
9
+ * `list(text(), { max: 5 })` → `{ type: 'array', items: { type: 'string' }, maxItems: 5 }`
10
10
  */
11
11
  export declare function list<T>(item: Field<T>, opts?: ListOptions): Field<T[]>;
12
12
  //# sourceMappingURL=list.d.ts.map
@@ -1,8 +1,8 @@
1
1
  import { Field } from '../../field/Field.js';
2
2
  /**
3
- * So a list of values is told apart from a relation, which `many()` declares.
4
- * FR : pour qu'une liste de valeurs se distingue d'une relation, que `many()` déclare.
5
- * `list(text(), { max: 5 })`; `list(ref(User))`throws
3
+ * A list of VALUES. The other side of a relation is `many()`, and passing one here throws.
4
+ * FR : une liste de VALEURS. L'autre côté d'une relation est `many()`, et en passer une ici lève.
5
+ * `list(text(), { max: 5 })` → `{ type: 'array', items: { type: 'string' }, maxItems: 5 }`
6
6
  */
7
7
  export function list(item, opts) {
8
8
  if (item.role?.relation)
@@ -1,9 +1,9 @@
1
1
  import { type EntityConstructor } from '../../axis/role/Relation.js';
2
2
  import { Field } from '../../field/Field.js';
3
3
  /**
4
- * So the other side of a reference is declared, and holds no column.
5
- * FR : pour que l'autre côté d'une référence soit déclaré, sans porter de colonne.
6
- * `many(() => Post)` → a collection, absent from the row a client sends
4
+ * The far side of a `ref()`: no column of its own, and absent from what a client sends.
5
+ * FR : l'autre côté d'un `ref()` : aucune colonne à lui, et absent de ce qu'un client envoie.
6
+ * `many(() => Post)` → `{ type: 'array' }` with `role.relation.kind` `'many'`
7
7
  */
8
8
  export declare function many<E extends EntityConstructor>(target: E | (() => E)): Field<InstanceType<E>[]>;
9
9
  //# sourceMappingURL=many.d.ts.map
@@ -1,9 +1,9 @@
1
1
  import { Relation } from '../../axis/role/Relation.js';
2
2
  import { Field } from '../../field/Field.js';
3
3
  /**
4
- * So the other side of a reference is declared, and holds no column.
5
- * FR : pour que l'autre côté d'une référence soit déclaré, sans porter de colonne.
6
- * `many(() => Post)` → a collection, absent from the row a client sends
4
+ * The far side of a `ref()`: no column of its own, and absent from what a client sends.
5
+ * FR : l'autre côté d'un `ref()` : aucune colonne à lui, et absent de ce qu'un client envoie.
6
+ * `many(() => Post)` → `{ type: 'array' }` with `role.relation.kind` `'many'`
7
7
  */
8
8
  export function many(target) {
9
9
  return new Field({
@@ -6,10 +6,5 @@ export interface NumberOptions {
6
6
  default?: number;
7
7
  description?: string;
8
8
  }
9
- /**
10
- * So `integer` is a shape, not a second word to remember.
11
- * FR : pour qu'`integer` soit une forme, pas un second mot à retenir.
12
- * `number({ integer: true, min: 0 })` → `{ type: 'integer', minimum: 0 }`
13
- */
14
9
  export declare function number(opts?: NumberOptions): Field<number>;
15
10
  //# sourceMappingURL=number.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"number.d.ts","sourceRoot":"","sources":["../../../src/vocabulary/primitive/number.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAC;AAE7C,MAAM,WAAW,aAAa;IAC5B,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED;;;;GAIG;AACH,wBAAgB,MAAM,CAAC,IAAI,CAAC,EAAE,aAAa,GAAG,KAAK,CAAC,MAAM,CAAC,CAW1D"}
1
+ {"version":3,"file":"number.d.ts","sourceRoot":"","sources":["../../../src/vocabulary/primitive/number.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAC;AAE7C,MAAM,WAAW,aAAa;IAC5B,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,wBAAgB,MAAM,CAAC,IAAI,CAAC,EAAE,aAAa,GAAG,KAAK,CAAC,MAAM,CAAC,CAW1D"}
@@ -1,9 +1,4 @@
1
1
  import { Field } from '../../field/Field.js';
2
- /**
3
- * So `integer` is a shape, not a second word to remember.
4
- * FR : pour qu'`integer` soit une forme, pas un second mot à retenir.
5
- * `number({ integer: true, min: 0 })` → `{ type: 'integer', minimum: 0 }`
6
- */
7
2
  export function number(opts) {
8
3
  return new Field({
9
4
  shape: {
@@ -1 +1 @@
1
- {"version":3,"file":"number.js","sourceRoot":"","sources":["../../../src/vocabulary/primitive/number.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAC;AAU7C;;;;GAIG;AACH,MAAM,UAAU,MAAM,CAAC,IAAoB;IACzC,OAAO,IAAI,KAAK,CAAS;QACvB,KAAK,EAAE;YACL,IAAI,EAAE,IAAI,EAAE,OAAO,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,QAAQ;YAC1C,OAAO,EAAE,IAAI,EAAE,GAAG;YAClB,OAAO,EAAE,IAAI,EAAE,GAAG;SACnB;QACD,SAAS,EACP,IAAI,EAAE,OAAO,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,EAAE,KAAK,EAAE,IAAI,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC,CAAC,SAAS;QAC/E,IAAI,EAAE,IAAI,EAAE,WAAW,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,WAAW,EAAE,IAAI,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC,SAAS;KACtF,CAAC,CAAC;AACL,CAAC"}
1
+ {"version":3,"file":"number.js","sourceRoot":"","sources":["../../../src/vocabulary/primitive/number.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAC;AAU7C,MAAM,UAAU,MAAM,CAAC,IAAoB;IACzC,OAAO,IAAI,KAAK,CAAS;QACvB,KAAK,EAAE;YACL,IAAI,EAAE,IAAI,EAAE,OAAO,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,QAAQ;YAC1C,OAAO,EAAE,IAAI,EAAE,GAAG;YAClB,OAAO,EAAE,IAAI,EAAE,GAAG;SACnB;QACD,SAAS,EACP,IAAI,EAAE,OAAO,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,EAAE,KAAK,EAAE,IAAI,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC,CAAC,SAAS;QAC/E,IAAI,EAAE,IAAI,EAAE,WAAW,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,WAAW,EAAE,IAAI,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC,SAAS;KACtF,CAAC,CAAC;AACL,CAAC"}
@@ -1,8 +1,8 @@
1
1
  import { Field } from '../../field/Field.js';
2
2
  /**
3
- * So the set is in the type and in the CHECK constraint, from one declaration.
4
- * FR : pour que l'ensemble soit dans le type et dans la contrainte CHECK, d'une déclaration.
5
- * `oneOf('draft', 'published', { default: 'draft' })`
3
+ * The set travels: GraphQL enum, form `select` and DDL `CHECK`, from this one declaration.
4
+ * FR : l'ensemble voyage : enum GraphQL, `select` du formulaire, `CHECK` du DDL.
5
+ * `oneOf('draft', 'published', { default: 'draft' })` → `{ type: 'string', enum: [...] }`
6
6
  */
7
7
  export function oneOf(...args) {
8
8
  const last = args[args.length - 1];
@@ -1,9 +1,9 @@
1
1
  import { Field } from '../../field/Field.js';
2
2
  import { Generators } from '../../axis/lifecycle/Generators.js';
3
3
  /**
4
- * So an id is generated and write-once by declaring nothing else.
5
- * FR : pour qu'un identifiant soit généré et écrit une fois sans rien déclarer d'autre.
6
- * `primary()` → cuid2, `update: 'forbidden'`; `primary(number())` → the same on a number
4
+ * `primary()` for a generated id; `primary(number())` to make a declared field the key.
5
+ * FR : `primary()` pour un identifiant généré ; `primary(number())` pour promouvoir un champ.
6
+ * `primary()` → `create: { generate: 'cuid2' }`, `update: 'forbidden'`
7
7
  */
8
8
  export function primary(fieldOrOptions) {
9
9
  if (Field.is(fieldOrOptions)) {
@@ -3,10 +3,5 @@ import { Field } from '../../field/Field.js';
3
3
  export interface RefOptions {
4
4
  cascade?: boolean;
5
5
  }
6
- /**
7
- * So a reference names the target entity, and the column type follows from it.
8
- * FR : pour qu'une référence nomme l'entité cible, la colonne en découlant.
9
- * `ref(() => User, { cascade: true })`
10
- */
11
6
  export declare function ref<E extends EntityConstructor>(target: E | (() => E), opts?: RefOptions): Field<string>;
12
7
  //# sourceMappingURL=ref.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ref.d.ts","sourceRoot":"","sources":["../../../src/vocabulary/primitive/ref.ts"],"names":[],"mappings":"AAAA,OAAO,EAAY,KAAK,iBAAiB,EAAE,MAAM,6BAA6B,CAAC;AAC/E,OAAO,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAC;AAE7C,MAAM,WAAW,UAAU;IACzB,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED;;;;GAIG;AACH,wBAAgB,GAAG,CAAC,CAAC,SAAS,iBAAiB,EAC7C,MAAM,EAAE,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,EACrB,IAAI,CAAC,EAAE,UAAU,GAChB,KAAK,CAAC,MAAM,CAAC,CAKf"}
1
+ {"version":3,"file":"ref.d.ts","sourceRoot":"","sources":["../../../src/vocabulary/primitive/ref.ts"],"names":[],"mappings":"AAAA,OAAO,EAAY,KAAK,iBAAiB,EAAE,MAAM,6BAA6B,CAAC;AAC/E,OAAO,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAC;AAE7C,MAAM,WAAW,UAAU;IACzB,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED,wBAAgB,GAAG,CAAC,CAAC,SAAS,iBAAiB,EAC7C,MAAM,EAAE,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,EACrB,IAAI,CAAC,EAAE,UAAU,GAChB,KAAK,CAAC,MAAM,CAAC,CAKf"}
@@ -1,10 +1,5 @@
1
1
  import { Relation } from '../../axis/role/Relation.js';
2
2
  import { Field } from '../../field/Field.js';
3
- /**
4
- * So a reference names the target entity, and the column type follows from it.
5
- * FR : pour qu'une référence nomme l'entité cible, la colonne en découlant.
6
- * `ref(() => User, { cascade: true })`
7
- */
8
3
  export function ref(target, opts) {
9
4
  return new Field({
10
5
  shape: { type: 'string' },
@@ -1 +1 @@
1
- {"version":3,"file":"ref.js","sourceRoot":"","sources":["../../../src/vocabulary/primitive/ref.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAA0B,MAAM,6BAA6B,CAAC;AAC/E,OAAO,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAC;AAM7C;;;;GAIG;AACH,MAAM,UAAU,GAAG,CACjB,MAAqB,EACrB,IAAiB;IAEjB,OAAO,IAAI,KAAK,CAAS;QACvB,KAAK,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;QACzB,IAAI,EAAE,EAAE,QAAQ,EAAE,QAAQ,CAAC,GAAG,CAAC,MAAM,EAAE,IAAI,EAAE,OAAO,CAAC,EAAE;KACxD,CAAC,CAAC;AACL,CAAC"}
1
+ {"version":3,"file":"ref.js","sourceRoot":"","sources":["../../../src/vocabulary/primitive/ref.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAA0B,MAAM,6BAA6B,CAAC;AAC/E,OAAO,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAC;AAM7C,MAAM,UAAU,GAAG,CACjB,MAAqB,EACrB,IAAiB;IAEjB,OAAO,IAAI,KAAK,CAAS;QACvB,KAAK,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;QACzB,IAAI,EAAE,EAAE,QAAQ,EAAE,QAAQ,CAAC,GAAG,CAAC,MAAM,EAAE,IAAI,EAAE,OAAO,CAAC,EAAE;KACxD,CAAC,CAAC;AACL,CAAC"}
@@ -8,10 +8,5 @@ export interface TextOptions {
8
8
  default?: string;
9
9
  description?: string;
10
10
  }
11
- /**
12
- * So a string field states its bounds where the DDL and the validator both read them.
13
- * FR : pour qu'un champ texte énonce ses bornes là où le DDL et le juge les lisent.
14
- * `text({ max: 200, format: 'email' })`
15
- */
16
11
  export declare function text(opts?: TextOptions): Field<string>;
17
12
  //# sourceMappingURL=text.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"text.d.ts","sourceRoot":"","sources":["../../../src/vocabulary/primitive/text.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAC;AAC7C,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAEhE,MAAM,WAAW,WAAW;IAC1B,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,MAAM,CAAC,EAAE,YAAY,CAAC;IACtB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED;;;;GAIG;AACH,wBAAgB,IAAI,CAAC,IAAI,CAAC,EAAE,WAAW,GAAG,KAAK,CAAC,MAAM,CAAC,CAatD"}
1
+ {"version":3,"file":"text.d.ts","sourceRoot":"","sources":["../../../src/vocabulary/primitive/text.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAC;AAC7C,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAEhE,MAAM,WAAW,WAAW;IAC1B,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,MAAM,CAAC,EAAE,YAAY,CAAC;IACtB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,wBAAgB,IAAI,CAAC,IAAI,CAAC,EAAE,WAAW,GAAG,KAAK,CAAC,MAAM,CAAC,CAatD"}
@@ -1,9 +1,4 @@
1
1
  import { Field } from '../../field/Field.js';
2
- /**
3
- * So a string field states its bounds where the DDL and the validator both read them.
4
- * FR : pour qu'un champ texte énonce ses bornes là où le DDL et le juge les lisent.
5
- * `text({ max: 200, format: 'email' })`
6
- */
7
2
  export function text(opts) {
8
3
  return new Field({
9
4
  shape: {
@@ -1 +1 @@
1
- {"version":3,"file":"text.js","sourceRoot":"","sources":["../../../src/vocabulary/primitive/text.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAC;AAY7C;;;;GAIG;AACH,MAAM,UAAU,IAAI,CAAC,IAAkB;IACrC,OAAO,IAAI,KAAK,CAAS;QACvB,KAAK,EAAE;YACL,IAAI,EAAE,QAAQ;YACd,SAAS,EAAE,IAAI,EAAE,GAAG;YACpB,SAAS,EAAE,IAAI,EAAE,GAAG;YACpB,OAAO,EAAE,IAAI,EAAE,OAAO;YACtB,MAAM,EAAE,IAAI,EAAE,MAAM;SACrB;QACD,SAAS,EACP,IAAI,EAAE,OAAO,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,EAAE,KAAK,EAAE,IAAI,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC,CAAC,SAAS;QAC/E,IAAI,EAAE,IAAI,EAAE,WAAW,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,WAAW,EAAE,IAAI,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC,SAAS;KACtF,CAAC,CAAC;AACL,CAAC"}
1
+ {"version":3,"file":"text.js","sourceRoot":"","sources":["../../../src/vocabulary/primitive/text.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAC;AAY7C,MAAM,UAAU,IAAI,CAAC,IAAkB;IACrC,OAAO,IAAI,KAAK,CAAS;QACvB,KAAK,EAAE;YACL,IAAI,EAAE,QAAQ;YACd,SAAS,EAAE,IAAI,EAAE,GAAG;YACpB,SAAS,EAAE,IAAI,EAAE,GAAG;YACpB,OAAO,EAAE,IAAI,EAAE,OAAO;YACtB,MAAM,EAAE,IAAI,EAAE,MAAM;SACrB;QACD,SAAS,EACP,IAAI,EAAE,OAAO,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,EAAE,KAAK,EAAE,IAAI,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC,CAAC,SAAS;QAC/E,IAAI,EAAE,IAAI,EAAE,WAAW,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,WAAW,EAAE,IAAI,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC,SAAS;KACtF,CAAC,CAAC;AACL,CAAC"}
@@ -1,8 +1,3 @@
1
1
  import { Field } from '../../field/Field.js';
2
- /**
3
- * So a write-once field is refused on a patch by the validator, not by the table.
4
- * FR : pour qu'un champ écrit une fois soit refusé par le juge sur une modification.
5
- * `immutable(text())` → `update: 'forbidden'`
6
- */
7
2
  export declare const immutable: <T>(field: Field<T>) => Field<T>;
8
3
  //# sourceMappingURL=immutable.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"immutable.d.ts","sourceRoot":"","sources":["../../../src/vocabulary/rule/immutable.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAC;AAE7C;;;;GAIG;AACH,eAAO,MAAM,SAAS,EAAE,CAAC,CAAC,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC,CAAC,KAAK,KAAK,CAAC,CAAC,CAKtD,CAAC"}
1
+ {"version":3,"file":"immutable.d.ts","sourceRoot":"","sources":["../../../src/vocabulary/rule/immutable.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAC;AAE7C,eAAO,MAAM,SAAS,EAAE,CAAC,CAAC,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC,CAAC,KAAK,KAAK,CAAC,CAAC,CAKtD,CAAC"}
@@ -1,9 +1,4 @@
1
1
  import { vocabulary } from '../vocabulary.js';
2
- /**
3
- * So a write-once field is refused on a patch by the validator, not by the table.
4
- * FR : pour qu'un champ écrit une fois soit refusé par le juge sur une modification.
5
- * `immutable(text())` → `update: 'forbidden'`
6
- */
7
2
  export const immutable = vocabulary('immutable', () => ({
8
3
  lifecycle: { update: 'forbidden' },
9
4
  }));
@@ -1 +1 @@
1
- {"version":3,"file":"immutable.js","sourceRoot":"","sources":["../../../src/vocabulary/rule/immutable.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAG9C;;;;GAIG;AACH,MAAM,CAAC,MAAM,SAAS,GAAqC,UAAU,CACnE,WAAW,EACX,GAAG,EAAE,CAAC,CAAC;IACL,SAAS,EAAE,EAAE,MAAM,EAAE,WAAW,EAAE;CACnC,CAAC,CACH,CAAC"}
1
+ {"version":3,"file":"immutable.js","sourceRoot":"","sources":["../../../src/vocabulary/rule/immutable.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAG9C,MAAM,CAAC,MAAM,SAAS,GAAqC,UAAU,CACnE,WAAW,EACX,GAAG,EAAE,CAAC,CAAC;IACL,SAAS,EAAE,EAAE,MAAM,EAAE,WAAW,EAAE;CACnC,CAAC,CACH,CAAC"}
@@ -1,8 +1,3 @@
1
1
  import { Field } from '../../field/Field.js';
2
- /**
3
- * So the entity states the index, and the DDL is the one that emits it.
4
- * FR : pour que l'entité énonce l'index, le DDL étant celui qui l'émet.
5
- * `indexed(text())` → `role.index` is `true`
6
- */
7
2
  export declare const indexed: <T>(field: Field<T>) => Field<T>;
8
3
  //# sourceMappingURL=indexed.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"indexed.d.ts","sourceRoot":"","sources":["../../../src/vocabulary/rule/indexed.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAC;AAE7C;;;;GAIG;AACH,eAAO,MAAM,OAAO,EAAE,CAAC,CAAC,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC,CAAC,KAAK,KAAK,CAAC,CAAC,CAElD,CAAC"}
1
+ {"version":3,"file":"indexed.d.ts","sourceRoot":"","sources":["../../../src/vocabulary/rule/indexed.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAC;AAE7C,eAAO,MAAM,OAAO,EAAE,CAAC,CAAC,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC,CAAC,KAAK,KAAK,CAAC,CAAC,CAElD,CAAC"}
@@ -1,9 +1,4 @@
1
1
  import { vocabulary } from '../vocabulary.js';
2
- /**
3
- * So the entity states the index, and the DDL is the one that emits it.
4
- * FR : pour que l'entité énonce l'index, le DDL étant celui qui l'émet.
5
- * `indexed(text())` → `role.index` is `true`
6
- */
7
2
  export const indexed = vocabulary('indexed', () => ({
8
3
  role: { index: true },
9
4
  }));
@@ -1 +1 @@
1
- {"version":3,"file":"indexed.js","sourceRoot":"","sources":["../../../src/vocabulary/rule/indexed.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAG9C;;;;GAIG;AACH,MAAM,CAAC,MAAM,OAAO,GAAqC,UAAU,CAAC,SAAS,EAAE,GAAG,EAAE,CAAC,CAAC;IACpF,IAAI,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE;CACtB,CAAC,CAAC,CAAC"}
1
+ {"version":3,"file":"indexed.js","sourceRoot":"","sources":["../../../src/vocabulary/rule/indexed.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAG9C,MAAM,CAAC,MAAM,OAAO,GAAqC,UAAU,CAAC,SAAS,EAAE,GAAG,EAAE,CAAC,CAAC;IACpF,IAAI,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE;CACtB,CAAC,CAAC,CAAC"}
@@ -1,8 +1,8 @@
1
1
  import { type Field } from '../../field/Field.js';
2
2
  /**
3
- * So `null` becomes a legal value, without touching whether the field is required.
4
- * FR : pour que `null` devienne légal, sans toucher au caractère obligatoire du champ.
5
- * `nullable(text())` → `{ type: ['string', 'null'] }`, still required at create
3
+ * Adds `null` and leaves the field REQUIRED `optional()` is the one permitting absence.
4
+ * FR : ajoute `null` en laissant le champ OBLIGATOIRE `optional()` permet l'absence.
5
+ * `nullable(text())` → `{ type: ['string', 'null'] }`, and `validate({})` still refuses
6
6
  */
7
7
  export declare const nullable: <T>(field: Field<T>) => Field<T | null>;
8
8
  //# sourceMappingURL=nullable.d.ts.map
@@ -1,9 +1,9 @@
1
1
  import { vocabulary } from '../vocabulary.js';
2
2
  import { Shapes } from '../../axis/shape/Shape.js';
3
3
  /**
4
- * So `null` becomes a legal value, without touching whether the field is required.
5
- * FR : pour que `null` devienne légal, sans toucher au caractère obligatoire du champ.
6
- * `nullable(text())` → `{ type: ['string', 'null'] }`, still required at create
4
+ * Adds `null` and leaves the field REQUIRED `optional()` is the one permitting absence.
5
+ * FR : ajoute `null` en laissant le champ OBLIGATOIRE `optional()` permet l'absence.
6
+ * `nullable(text())` → `{ type: ['string', 'null'] }`, and `validate({})` still refuses
7
7
  */
8
8
  export const nullable = vocabulary('nullable', (field) => ({
9
9
  shape: Shapes.nullable(field.shape),
@@ -1,8 +1,8 @@
1
1
  import { type Field } from '../../field/Field.js';
2
2
  /**
3
- * So the two questions are settled at once: `null` is legal, and absence is too.
4
- * FR : pour que les deux questions soient réglées d'un coup : `null` légal, absence permise.
5
- * `optional(text())` → nullable shape and `create: 'optional'`
3
+ * Adds `null` AND permits absence. A field that already states a `create` rule keeps it.
4
+ * FR : ajoute `null` ET permet l'absence. Un champ qui énonce déjà un `create` le garde.
5
+ * `optional(text())` → `{ type: ['string', 'null'] }` and `create: 'optional'`
6
6
  */
7
7
  export declare const optional: <T>(field: Field<T>) => Field<T | null>;
8
8
  //# sourceMappingURL=optional.d.ts.map
@@ -1,9 +1,9 @@
1
1
  import { vocabulary } from '../vocabulary.js';
2
2
  import { Shapes } from '../../axis/shape/Shape.js';
3
3
  /**
4
- * So the two questions are settled at once: `null` is legal, and absence is too.
5
- * FR : pour que les deux questions soient réglées d'un coup : `null` légal, absence permise.
6
- * `optional(text())` → nullable shape and `create: 'optional'`
4
+ * Adds `null` AND permits absence. A field that already states a `create` rule keeps it.
5
+ * FR : ajoute `null` ET permet l'absence. Un champ qui énonce déjà un `create` le garde.
6
+ * `optional(text())` → `{ type: ['string', 'null'] }` and `create: 'optional'`
7
7
  */
8
8
  export const optional = vocabulary('optional', (field) => ({
9
9
  shape: Shapes.nullable(field.shape),
@@ -1,8 +1,8 @@
1
1
  import { Field } from '../../field/Field.js';
2
2
  /**
3
- * So a field a client may read but never write says so once, on the field.
4
- * FR : pour qu'un champ lisible mais non écrivable le dise une fois, sur le champ.
5
- * `readOnly(text())` → `boundary.in` is `'closed'`, absent from every form
3
+ * Closes the way in, so the field leaves `Visibility.input` and every form derived from it.
4
+ * FR : ferme l'entrée : le champ quitte `Visibility.input` et tout formulaire qui en dérive.
5
+ * `readOnly(text())` → `boundary.in` is `'closed'`
6
6
  */
7
7
  export declare const readOnly: <T>(field: Field<T>) => Field<T>;
8
8
  //# sourceMappingURL=readOnly.d.ts.map
@@ -1,11 +1,11 @@
1
1
  import { vocabulary } from '../vocabulary.js';
2
2
  import { Boundary } from '../../axis/boundary/Boundary.js';
3
3
  /**
4
- * So a field a client may read but never write says so once, on the field.
5
- * FR : pour qu'un champ lisible mais non écrivable le dise une fois, sur le champ.
6
- * `readOnly(text())` → `boundary.in` is `'closed'`, absent from every form
4
+ * Closes the way in, so the field leaves `Visibility.input` and every form derived from it.
5
+ * FR : ferme l'entrée : le champ quitte `Visibility.input` et tout formulaire qui en dérive.
6
+ * `readOnly(text())` → `boundary.in` is `'closed'`
7
7
  */
8
8
  export const readOnly = vocabulary('readOnly', (field) => ({
9
- boundary: Boundary.declared(field).with({ in: 'closed' }),
9
+ boundary: Boundary.declared(field).declaring({ in: 'closed' }),
10
10
  }));
11
11
  //# sourceMappingURL=readOnly.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"readOnly.js","sourceRoot":"","sources":["../../../src/vocabulary/rule/readOnly.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,QAAQ,EAAE,MAAM,iCAAiC,CAAC;AAG3D;;;;GAIG;AACH,MAAM,CAAC,MAAM,QAAQ,GAAqC,UAAU,CAClE,UAAU,EACV,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;IACV,QAAQ,EAAE,QAAQ,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC,EAAE,EAAE,EAAE,QAAQ,EAAE,CAAC;CAC1D,CAAC,CACH,CAAC"}
1
+ {"version":3,"file":"readOnly.js","sourceRoot":"","sources":["../../../src/vocabulary/rule/readOnly.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,QAAQ,EAAE,MAAM,iCAAiC,CAAC;AAG3D;;;;GAIG;AACH,MAAM,CAAC,MAAM,QAAQ,GAAqC,UAAU,CAClE,UAAU,EACV,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;IACV,QAAQ,EAAE,QAAQ,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,SAAS,CAAC,EAAE,EAAE,EAAE,QAAQ,EAAE,CAAC;CAC/D,CAAC,CACH,CAAC"}
@@ -1,8 +1,3 @@
1
1
  import { Field } from '../../field/Field.js';
2
- /**
3
- * So a field is unique on its own, whatever key it ends up under.
4
- * FR : pour qu'un champ soit unique à lui seul, quelle que soit sa clé.
5
- * `unique(email)` → `role.unique` is true
6
- */
7
2
  export declare const unique: <T>(field: Field<T>) => Field<T>;
8
3
  //# sourceMappingURL=unique.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"unique.d.ts","sourceRoot":"","sources":["../../../src/vocabulary/rule/unique.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAC;AAE7C;;;;GAIG;AACH,eAAO,MAAM,MAAM,EAAE,CAAC,CAAC,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC,CAAC,KAAK,KAAK,CAAC,CAAC,CAEjD,CAAC"}
1
+ {"version":3,"file":"unique.d.ts","sourceRoot":"","sources":["../../../src/vocabulary/rule/unique.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAC;AAE7C,eAAO,MAAM,MAAM,EAAE,CAAC,CAAC,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC,CAAC,KAAK,KAAK,CAAC,CAAC,CAEjD,CAAC"}
@@ -1,9 +1,4 @@
1
1
  import { vocabulary } from '../vocabulary.js';
2
- /**
3
- * So a field is unique on its own, whatever key it ends up under.
4
- * FR : pour qu'un champ soit unique à lui seul, quelle que soit sa clé.
5
- * `unique(email)` → `role.unique` is true
6
- */
7
2
  export const unique = vocabulary('unique', () => ({
8
3
  role: { unique: true },
9
4
  }));