@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.
- package/dist/Schema.d.ts +3 -6
- package/dist/Schema.d.ts.map +1 -1
- package/dist/Schema.js +9 -17
- package/dist/Schema.js.map +1 -1
- package/dist/SchemaDefinition.d.ts +24 -6
- package/dist/SchemaDefinition.d.ts.map +1 -1
- package/dist/SchemaDefinition.js +76 -44
- package/dist/SchemaDefinition.js.map +1 -1
- package/dist/SchemaView.d.ts +1 -1
- package/dist/SchemaView.d.ts.map +1 -1
- package/dist/axis/Axis.d.ts +1 -1
- package/dist/axis/Axis.d.ts.map +1 -1
- package/dist/axis/boundary/Boundaries.d.ts +5 -0
- package/dist/axis/boundary/Boundaries.d.ts.map +1 -1
- package/dist/axis/boundary/Boundaries.js.map +1 -1
- package/dist/axis/boundary/Boundary.d.ts +5 -4
- package/dist/axis/boundary/Boundary.d.ts.map +1 -1
- package/dist/axis/boundary/Boundary.js +4 -5
- package/dist/axis/boundary/Boundary.js.map +1 -1
- package/dist/axis/boundary/BoundaryAxis.js +2 -2
- package/dist/axis/boundary/BoundaryAxis.js.map +1 -1
- package/dist/axis/lifecycle/Lifecycle.d.ts +5 -3
- package/dist/axis/lifecycle/Lifecycle.d.ts.map +1 -1
- package/dist/axis/lifecycle/Lifecycle.js +5 -1
- package/dist/axis/lifecycle/Lifecycle.js.map +1 -1
- package/dist/axis/lifecycle/LifecycleAxis.js +6 -6
- package/dist/axis/lifecycle/LifecycleAxis.js.map +1 -1
- package/dist/axis/lifecycle/apply.d.ts +6 -6
- package/dist/axis/lifecycle/apply.d.ts.map +1 -1
- package/dist/axis/lifecycle/apply.js +10 -9
- package/dist/axis/lifecycle/apply.js.map +1 -1
- package/dist/axis/role/Role.d.ts +8 -5
- package/dist/axis/role/Role.d.ts.map +1 -1
- package/dist/axis/role/Role.js +7 -0
- package/dist/axis/role/Role.js.map +1 -1
- package/dist/axis/role/RoleAxis.js +9 -9
- package/dist/axis/role/RoleAxis.js.map +1 -1
- package/dist/axis/shape/Shape.d.ts +14 -0
- package/dist/axis/shape/Shape.d.ts.map +1 -1
- package/dist/axis/shape/Shape.js +43 -34
- package/dist/axis/shape/Shape.js.map +1 -1
- package/dist/entity/EntityAdapterSet.d.ts +2 -2
- package/dist/entity/EntityAdapterSet.d.ts.map +1 -1
- package/dist/entity/EntityAdapterSet.js +2 -2
- package/dist/entity/EntityAdapterSet.js.map +1 -1
- package/dist/entity.d.ts +2 -2
- package/dist/entity.js +2 -2
- package/dist/field/Field.d.ts.map +1 -1
- package/dist/field/Field.js +2 -1
- package/dist/field/Field.js.map +1 -1
- package/dist/field/FieldSet.d.ts +4 -7
- package/dist/field/FieldSet.d.ts.map +1 -1
- package/dist/field/FieldSet.js +4 -15
- package/dist/field/FieldSet.js.map +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/lib/validation.d.ts +32 -0
- package/dist/lib/validation.d.ts.map +1 -0
- package/dist/lib/validation.js +6 -0
- package/dist/lib/validation.js.map +1 -0
- package/dist/projection/Cases.d.ts +1 -1
- package/dist/projection/Cases.d.ts.map +1 -1
- package/dist/projection/Cases.js +11 -7
- package/dist/projection/Cases.js.map +1 -1
- package/dist/projection/Visibility.js +1 -1
- package/dist/projection/Visibility.js.map +1 -1
- package/dist/projection/card/Bundle.d.ts.map +1 -1
- package/dist/projection/card/Bundle.js +1 -4
- package/dist/projection/card/Bundle.js.map +1 -1
- package/dist/projection/card/Card.d.ts +7 -1
- package/dist/projection/card/Card.d.ts.map +1 -1
- package/dist/projection/card/Card.js +25 -133
- package/dist/projection/card/Card.js.map +1 -1
- package/dist/projection/card/Descriptor.d.ts +2 -2
- package/dist/projection/card/Descriptor.d.ts.map +1 -1
- package/dist/projection/card/admission.d.ts +12 -11
- package/dist/projection/card/admission.d.ts.map +1 -1
- package/dist/projection/card/admission.js +13 -11
- package/dist/projection/card/admission.js.map +1 -1
- package/dist/projection/card/diff.d.ts +7 -1
- package/dist/projection/card/diff.d.ts.map +1 -1
- package/dist/projection/card/diff.js +111 -1
- package/dist/projection/card/diff.js.map +1 -1
- package/dist/validator/FieldDeclarationValidator.d.ts +1 -1
- package/dist/validator/FieldDeclarationValidator.d.ts.map +1 -1
- package/dist/validator/FieldDeclarationValidator.js +4 -4
- package/dist/validator/FieldDeclarationValidator.js.map +1 -1
- package/dist/validator/FieldValueValidator.d.ts +6 -1
- package/dist/validator/FieldValueValidator.d.ts.map +1 -1
- package/dist/validator/FieldValueValidator.js +36 -7
- package/dist/validator/FieldValueValidator.js.map +1 -1
- package/dist/validator/InputValidator.d.ts +1 -1
- package/dist/validator/InputValidator.d.ts.map +1 -1
- package/dist/validator/InputValidator.js +8 -18
- package/dist/validator/InputValidator.js.map +1 -1
- package/dist/vocabulary/preset/created.d.ts +0 -5
- package/dist/vocabulary/preset/created.d.ts.map +1 -1
- package/dist/vocabulary/preset/created.js +0 -5
- package/dist/vocabulary/preset/created.js.map +1 -1
- package/dist/vocabulary/preset/email.d.ts +0 -5
- package/dist/vocabulary/preset/email.d.ts.map +1 -1
- package/dist/vocabulary/preset/email.js +0 -5
- package/dist/vocabulary/preset/email.js.map +1 -1
- package/dist/vocabulary/preset/updated.d.ts +0 -5
- package/dist/vocabulary/preset/updated.d.ts.map +1 -1
- package/dist/vocabulary/preset/updated.js +0 -5
- package/dist/vocabulary/preset/updated.js.map +1 -1
- package/dist/vocabulary/preset/url.d.ts +0 -5
- package/dist/vocabulary/preset/url.d.ts.map +1 -1
- package/dist/vocabulary/preset/url.js +0 -5
- package/dist/vocabulary/preset/url.js.map +1 -1
- package/dist/vocabulary/primitive/bool.d.ts +0 -5
- package/dist/vocabulary/primitive/bool.d.ts.map +1 -1
- package/dist/vocabulary/primitive/bool.js +0 -5
- package/dist/vocabulary/primitive/bool.js.map +1 -1
- package/dist/vocabulary/primitive/date.d.ts +3 -3
- package/dist/vocabulary/primitive/date.js +3 -3
- package/dist/vocabulary/primitive/json.js +3 -3
- package/dist/vocabulary/primitive/list.d.ts +3 -3
- package/dist/vocabulary/primitive/list.js +3 -3
- package/dist/vocabulary/primitive/many.d.ts +3 -3
- package/dist/vocabulary/primitive/many.js +3 -3
- package/dist/vocabulary/primitive/number.d.ts +0 -5
- package/dist/vocabulary/primitive/number.d.ts.map +1 -1
- package/dist/vocabulary/primitive/number.js +0 -5
- package/dist/vocabulary/primitive/number.js.map +1 -1
- package/dist/vocabulary/primitive/oneOf.js +3 -3
- package/dist/vocabulary/primitive/primary.js +3 -3
- package/dist/vocabulary/primitive/ref.d.ts +0 -5
- package/dist/vocabulary/primitive/ref.d.ts.map +1 -1
- package/dist/vocabulary/primitive/ref.js +0 -5
- package/dist/vocabulary/primitive/ref.js.map +1 -1
- package/dist/vocabulary/primitive/text.d.ts +0 -5
- package/dist/vocabulary/primitive/text.d.ts.map +1 -1
- package/dist/vocabulary/primitive/text.js +0 -5
- package/dist/vocabulary/primitive/text.js.map +1 -1
- package/dist/vocabulary/rule/immutable.d.ts +0 -5
- package/dist/vocabulary/rule/immutable.d.ts.map +1 -1
- package/dist/vocabulary/rule/immutable.js +0 -5
- package/dist/vocabulary/rule/immutable.js.map +1 -1
- package/dist/vocabulary/rule/indexed.d.ts +0 -5
- package/dist/vocabulary/rule/indexed.d.ts.map +1 -1
- package/dist/vocabulary/rule/indexed.js +0 -5
- package/dist/vocabulary/rule/indexed.js.map +1 -1
- package/dist/vocabulary/rule/nullable.d.ts +3 -3
- package/dist/vocabulary/rule/nullable.js +3 -3
- package/dist/vocabulary/rule/optional.d.ts +3 -3
- package/dist/vocabulary/rule/optional.js +3 -3
- package/dist/vocabulary/rule/readOnly.d.ts +3 -3
- package/dist/vocabulary/rule/readOnly.js +4 -4
- package/dist/vocabulary/rule/readOnly.js.map +1 -1
- package/dist/vocabulary/rule/unique.d.ts +0 -5
- package/dist/vocabulary/rule/unique.d.ts.map +1 -1
- package/dist/vocabulary/rule/unique.js +0 -5
- package/dist/vocabulary/rule/unique.js.map +1 -1
- package/dist/vocabulary/rule/writeOnly.d.ts +2 -2
- package/dist/vocabulary/rule/writeOnly.js +3 -3
- package/dist/vocabulary/rule/writeOnly.js.map +1 -1
- package/dist/vocabulary/vocabulary.d.ts +2 -2
- package/dist/vocabulary/vocabulary.js +5 -5
- package/package.json +1 -1
- package/src/Schema.ts +14 -20
- package/src/SchemaDefinition.ts +74 -48
- package/src/SchemaView.ts +1 -1
- package/src/axis/Axis.ts +1 -1
- package/src/axis/boundary/Boundaries.ts +5 -0
- package/src/axis/boundary/Boundary.ts +7 -9
- package/src/axis/boundary/BoundaryAxis.ts +2 -2
- package/src/axis/lifecycle/Lifecycle.ts +9 -4
- package/src/axis/lifecycle/LifecycleAxis.ts +7 -7
- package/src/axis/lifecycle/apply.ts +10 -9
- package/src/axis/role/Role.ts +14 -5
- package/src/axis/role/RoleAxis.ts +10 -10
- package/src/axis/shape/Shape.ts +61 -37
- package/src/entity/EntityAdapterSet.ts +2 -2
- package/src/entity.ts +2 -2
- package/src/field/Field.ts +2 -1
- package/src/field/FieldSet.ts +6 -20
- package/src/index.ts +2 -2
- package/src/lib/validation.ts +25 -0
- package/src/projection/Cases.ts +13 -8
- package/src/projection/Visibility.ts +1 -1
- package/src/projection/card/Bundle.ts +1 -4
- package/src/projection/card/Card.ts +26 -159
- package/src/projection/card/Descriptor.ts +2 -10
- package/src/projection/card/admission.ts +14 -12
- package/src/projection/card/diff.ts +142 -1
- package/src/validator/FieldDeclarationValidator.ts +5 -5
- package/src/validator/FieldValueValidator.ts +45 -12
- package/src/validator/InputValidator.ts +8 -18
- package/src/vocabulary/preset/created.ts +0 -5
- package/src/vocabulary/preset/email.ts +0 -5
- package/src/vocabulary/preset/updated.ts +0 -5
- package/src/vocabulary/preset/url.ts +0 -5
- package/src/vocabulary/primitive/bool.ts +0 -5
- package/src/vocabulary/primitive/date.ts +3 -3
- package/src/vocabulary/primitive/json.ts +3 -3
- package/src/vocabulary/primitive/list.ts +3 -3
- package/src/vocabulary/primitive/many.ts +3 -3
- package/src/vocabulary/primitive/number.ts +0 -5
- package/src/vocabulary/primitive/oneOf.ts +3 -3
- package/src/vocabulary/primitive/primary.ts +3 -3
- package/src/vocabulary/primitive/ref.ts +0 -5
- package/src/vocabulary/primitive/text.ts +0 -5
- package/src/vocabulary/rule/immutable.ts +0 -5
- package/src/vocabulary/rule/indexed.ts +0 -5
- package/src/vocabulary/rule/nullable.ts +3 -3
- package/src/vocabulary/rule/optional.ts +3 -3
- package/src/vocabulary/rule/readOnly.ts +4 -4
- package/src/vocabulary/rule/unique.ts +0 -5
- package/src/vocabulary/rule/writeOnly.ts +3 -3
- package/src/vocabulary/vocabulary.ts +5 -5
- package/dist/validation.d.ts +0 -17
- package/dist/validation.d.ts.map +0 -1
- package/dist/validation.js +0 -2
- package/dist/validation.js.map +0 -1
- 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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
-
*
|
|
4
|
-
* FR :
|
|
5
|
-
* `date()` → `{ type: 'string', format: 'date-time' }
|
|
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
|
-
*
|
|
4
|
-
* FR :
|
|
5
|
-
* `date()` → `{ type: 'string', format: 'date-time' }
|
|
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
|
-
*
|
|
5
|
-
* FR :
|
|
6
|
-
* `json(Address)` → the
|
|
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
|
-
*
|
|
8
|
-
* FR :
|
|
9
|
-
* `list(text(), { max: 5 })
|
|
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
|
-
*
|
|
4
|
-
* FR :
|
|
5
|
-
* `list(text(), { max: 5 })
|
|
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
|
-
*
|
|
5
|
-
* FR :
|
|
6
|
-
* `many(() => Post)` →
|
|
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
|
-
*
|
|
5
|
-
* FR :
|
|
6
|
-
* `many(() => Post)` →
|
|
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
|
|
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
|
|
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
|
-
*
|
|
4
|
-
* FR :
|
|
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
|
-
*
|
|
5
|
-
* FR : pour
|
|
6
|
-
* `primary()` → cuid2
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
-
*
|
|
4
|
-
* FR :
|
|
5
|
-
* `nullable(text())` → `{ type: ['string', 'null'] }`,
|
|
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
|
-
*
|
|
5
|
-
* FR :
|
|
6
|
-
* `nullable(text())` → `{ type: ['string', 'null'] }`,
|
|
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
|
-
*
|
|
4
|
-
* FR :
|
|
5
|
-
* `optional(text())` →
|
|
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
|
-
*
|
|
5
|
-
* FR :
|
|
6
|
-
* `optional(text())` →
|
|
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
|
-
*
|
|
4
|
-
* FR :
|
|
5
|
-
* `readOnly(text())` → `boundary.in` is `'closed'
|
|
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
|
-
*
|
|
5
|
-
* FR :
|
|
6
|
-
* `readOnly(text())` → `boundary.in` is `'closed'
|
|
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).
|
|
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,
|
|
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
|
|
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
|
}));
|