@fougere/schema 0.1.0-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/LICENSE +21 -0
- package/README.md +32 -0
- package/dist/entity.d.ts +117 -0
- package/dist/entity.d.ts.map +1 -0
- package/dist/entity.js +285 -0
- package/dist/entity.js.map +1 -0
- package/dist/field/boundary.d.ts +75 -0
- package/dist/field/boundary.d.ts.map +1 -0
- package/dist/field/boundary.js +76 -0
- package/dist/field/boundary.js.map +1 -0
- package/dist/field/field.d.ts +64 -0
- package/dist/field/field.d.ts.map +1 -0
- package/dist/field/field.js +28 -0
- package/dist/field/field.js.map +1 -0
- package/dist/field/index.d.ts +7 -0
- package/dist/field/index.d.ts.map +1 -0
- package/dist/field/index.js +9 -0
- package/dist/field/index.js.map +1 -0
- package/dist/field/lifecycle.d.ts +40 -0
- package/dist/field/lifecycle.d.ts.map +1 -0
- package/dist/field/lifecycle.js +27 -0
- package/dist/field/lifecycle.js.map +1 -0
- package/dist/field/meta.d.ts +9 -0
- package/dist/field/meta.d.ts.map +1 -0
- package/dist/field/meta.js +7 -0
- package/dist/field/meta.js.map +1 -0
- package/dist/field/role.d.ts +54 -0
- package/dist/field/role.d.ts.map +1 -0
- package/dist/field/role.js +55 -0
- package/dist/field/role.js.map +1 -0
- package/dist/field/shape.d.ts +77 -0
- package/dist/field/shape.d.ts.map +1 -0
- package/dist/field/shape.js +49 -0
- package/dist/field/shape.js.map +1 -0
- package/dist/hints.d.ts +33 -0
- package/dist/hints.d.ts.map +1 -0
- package/dist/hints.js +2 -0
- package/dist/hints.js.map +1 -0
- package/dist/index.d.ts +36 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +46 -0
- package/dist/index.js.map +1 -0
- package/dist/projections/card.d.ts +117 -0
- package/dist/projections/card.d.ts.map +1 -0
- package/dist/projections/card.js +8 -0
- package/dist/projections/card.js.map +1 -0
- package/dist/projections/describe.d.ts +25 -0
- package/dist/projections/describe.d.ts.map +1 -0
- package/dist/projections/describe.js +129 -0
- package/dist/projections/describe.js.map +1 -0
- package/dist/projections/encode.d.ts +11 -0
- package/dist/projections/encode.d.ts.map +1 -0
- package/dist/projections/encode.js +26 -0
- package/dist/projections/encode.js.map +1 -0
- package/dist/projections/io.d.ts +30 -0
- package/dist/projections/io.d.ts.map +1 -0
- package/dist/projections/io.js +52 -0
- package/dist/projections/io.js.map +1 -0
- package/dist/projections/lifecycle.d.ts +43 -0
- package/dist/projections/lifecycle.d.ts.map +1 -0
- package/dist/projections/lifecycle.js +115 -0
- package/dist/projections/lifecycle.js.map +1 -0
- package/dist/projections/reconstruct.d.ts +36 -0
- package/dist/projections/reconstruct.d.ts.map +1 -0
- package/dist/projections/reconstruct.js +149 -0
- package/dist/projections/reconstruct.js.map +1 -0
- package/dist/projections/source.d.ts +41 -0
- package/dist/projections/source.d.ts.map +1 -0
- package/dist/projections/source.js +37 -0
- package/dist/projections/source.js.map +1 -0
- package/dist/projections/standard.d.ts +41 -0
- package/dist/projections/standard.d.ts.map +1 -0
- package/dist/projections/standard.js +10 -0
- package/dist/projections/standard.js.map +1 -0
- package/dist/projections/typescript.d.ts +53 -0
- package/dist/projections/typescript.d.ts.map +1 -0
- package/dist/projections/typescript.js +166 -0
- package/dist/projections/typescript.js.map +1 -0
- package/dist/projections/validation.d.ts +49 -0
- package/dist/projections/validation.d.ts.map +1 -0
- package/dist/projections/validation.js +140 -0
- package/dist/projections/validation.js.map +1 -0
- package/dist/unique.d.ts +65 -0
- package/dist/unique.d.ts.map +1 -0
- package/dist/unique.js +80 -0
- package/dist/unique.js.map +1 -0
- package/dist/vocabulary/auto.d.ts +8 -0
- package/dist/vocabulary/auto.d.ts.map +1 -0
- package/dist/vocabulary/auto.js +13 -0
- package/dist/vocabulary/auto.js.map +1 -0
- package/dist/vocabulary/bool.d.ts +6 -0
- package/dist/vocabulary/bool.d.ts.map +1 -0
- package/dist/vocabulary/bool.js +9 -0
- package/dist/vocabulary/bool.js.map +1 -0
- package/dist/vocabulary/date.d.ts +3 -0
- package/dist/vocabulary/date.d.ts.map +1 -0
- package/dist/vocabulary/date.js +5 -0
- package/dist/vocabulary/date.js.map +1 -0
- package/dist/vocabulary/email.d.ts +5 -0
- package/dist/vocabulary/email.d.ts.map +1 -0
- package/dist/vocabulary/email.js +6 -0
- package/dist/vocabulary/email.js.map +1 -0
- package/dist/vocabulary/immutable.d.ts +9 -0
- package/dist/vocabulary/immutable.d.ts.map +1 -0
- package/dist/vocabulary/immutable.js +11 -0
- package/dist/vocabulary/immutable.js.map +1 -0
- package/dist/vocabulary/indexed.d.ts +19 -0
- package/dist/vocabulary/indexed.d.ts.map +1 -0
- package/dist/vocabulary/indexed.js +21 -0
- package/dist/vocabulary/indexed.js.map +1 -0
- package/dist/vocabulary/json.d.ts +18 -0
- package/dist/vocabulary/json.d.ts.map +1 -0
- package/dist/vocabulary/json.js +16 -0
- package/dist/vocabulary/json.js.map +1 -0
- package/dist/vocabulary/list.d.ts +21 -0
- package/dist/vocabulary/list.d.ts.map +1 -0
- package/dist/vocabulary/list.js +21 -0
- package/dist/vocabulary/list.js.map +1 -0
- package/dist/vocabulary/many.d.ts +8 -0
- package/dist/vocabulary/many.d.ts.map +1 -0
- package/dist/vocabulary/many.js +12 -0
- package/dist/vocabulary/many.js.map +1 -0
- package/dist/vocabulary/nullable.d.ts +9 -0
- package/dist/vocabulary/nullable.d.ts.map +1 -0
- package/dist/vocabulary/nullable.js +13 -0
- package/dist/vocabulary/nullable.js.map +1 -0
- package/dist/vocabulary/number.d.ts +10 -0
- package/dist/vocabulary/number.d.ts.map +1 -0
- package/dist/vocabulary/number.js +9 -0
- package/dist/vocabulary/number.js.map +1 -0
- package/dist/vocabulary/oneOf.d.ts +16 -0
- package/dist/vocabulary/oneOf.d.ts.map +1 -0
- package/dist/vocabulary/oneOf.js +13 -0
- package/dist/vocabulary/oneOf.js.map +1 -0
- package/dist/vocabulary/optional.d.ts +10 -0
- package/dist/vocabulary/optional.d.ts.map +1 -0
- package/dist/vocabulary/optional.js +15 -0
- package/dist/vocabulary/optional.js.map +1 -0
- package/dist/vocabulary/primary.d.ts +22 -0
- package/dist/vocabulary/primary.d.ts.map +1 -0
- package/dist/vocabulary/primary.js +31 -0
- package/dist/vocabulary/primary.js.map +1 -0
- package/dist/vocabulary/readOnly.d.ts +10 -0
- package/dist/vocabulary/readOnly.d.ts.map +1 -0
- package/dist/vocabulary/readOnly.js +12 -0
- package/dist/vocabulary/readOnly.js.map +1 -0
- package/dist/vocabulary/ref.d.ts +12 -0
- package/dist/vocabulary/ref.d.ts.map +1 -0
- package/dist/vocabulary/ref.js +20 -0
- package/dist/vocabulary/ref.js.map +1 -0
- package/dist/vocabulary/text.d.ts +12 -0
- package/dist/vocabulary/text.d.ts.map +1 -0
- package/dist/vocabulary/text.js +9 -0
- package/dist/vocabulary/text.js.map +1 -0
- package/dist/vocabulary/unique.d.ts +23 -0
- package/dist/vocabulary/unique.d.ts.map +1 -0
- package/dist/vocabulary/unique.js +25 -0
- package/dist/vocabulary/unique.js.map +1 -0
- package/dist/vocabulary/updated.d.ts +8 -0
- package/dist/vocabulary/updated.d.ts.map +1 -0
- package/dist/vocabulary/updated.js +12 -0
- package/dist/vocabulary/updated.js.map +1 -0
- package/dist/vocabulary/url.d.ts +5 -0
- package/dist/vocabulary/url.d.ts.map +1 -0
- package/dist/vocabulary/url.js +6 -0
- package/dist/vocabulary/url.js.map +1 -0
- package/dist/vocabulary/writeOnly.d.ts +9 -0
- package/dist/vocabulary/writeOnly.d.ts.map +1 -0
- package/dist/vocabulary/writeOnly.js +11 -0
- package/dist/vocabulary/writeOnly.js.map +1 -0
- package/package.json +40 -0
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import type { Shape } from './shape.js';
|
|
2
|
+
import type { Role } from './role.js';
|
|
3
|
+
import type { Lifecycle } from './lifecycle.js';
|
|
4
|
+
import type { BoundaryRef } from './boundary.js';
|
|
5
|
+
import type { Meta } from './meta.js';
|
|
6
|
+
/**
|
|
7
|
+
* A field — the single source of truth, decomposed on four orthogonal axes
|
|
8
|
+
* plus one documentary compartment:
|
|
9
|
+
* `shape` (is the value valid? — nullability included, as the `[T,'null']` union),
|
|
10
|
+
* `role` (place in the entity graph), `lifecycle` (who writes the value, at which
|
|
11
|
+
* moment), `boundary` (how a value crosses wire↔domain), `meta` (human-facing,
|
|
12
|
+
* never decides). Adapters read the axes they care about; nothing reads all of
|
|
13
|
+
* them at once. `boundary` is usually absent — its default is derived from
|
|
14
|
+
* `shape` and the slot only overrides it.
|
|
15
|
+
*
|
|
16
|
+
* @typeParam T - the data type this field carries (phantom, TS inference only)
|
|
17
|
+
* @typeParam A - "auto-supplied at creation" (primary/auto/default/optional) →
|
|
18
|
+
* the field is optional in `new X(input)`. Phantom, type-level only.
|
|
19
|
+
*/
|
|
20
|
+
export interface Field<T = unknown, A extends boolean = false> {
|
|
21
|
+
readonly __brand: 'fougere_field';
|
|
22
|
+
readonly shape?: Shape;
|
|
23
|
+
readonly role?: Role;
|
|
24
|
+
readonly lifecycle?: Lifecycle;
|
|
25
|
+
readonly boundary?: BoundaryRef;
|
|
26
|
+
readonly meta?: Meta;
|
|
27
|
+
/** Phantom — data type, never read at runtime. */
|
|
28
|
+
readonly _type?: T;
|
|
29
|
+
/** Phantom — auto-at-creation flag, never read at runtime. */
|
|
30
|
+
readonly _auto?: A;
|
|
31
|
+
}
|
|
32
|
+
/** Any field, regardless of its T/A parameters — the correct generic bound. */
|
|
33
|
+
export type AnyField = Field<any, boolean>;
|
|
34
|
+
/** A record of fields — the input to `entity()` and every derivation. */
|
|
35
|
+
export type Fields = Record<string, AnyField>;
|
|
36
|
+
export interface FieldInit {
|
|
37
|
+
shape?: Shape;
|
|
38
|
+
role?: Role;
|
|
39
|
+
lifecycle?: Lifecycle;
|
|
40
|
+
boundary?: BoundaryRef;
|
|
41
|
+
meta?: Meta;
|
|
42
|
+
}
|
|
43
|
+
export declare function createField<T, A extends boolean = false>(init?: FieldInit): Field<T, A>;
|
|
44
|
+
/**
|
|
45
|
+
* Copy a field, overriding only the named axes — every OTHER axis is preserved.
|
|
46
|
+
* This is the invariant every field transform must hold: change what you mean,
|
|
47
|
+
* keep the rest. Enumerating axes by hand (the old `optional`/`primary`) silently
|
|
48
|
+
* drops whatever axis was added last — `codec` did exactly that. Spread + override,
|
|
49
|
+
* so a future 6th slot travels for free. (Spread props skip excess-property checks,
|
|
50
|
+
* so the field's `__brand`/phantoms ride along harmlessly and `createField` resets them.)
|
|
51
|
+
*/
|
|
52
|
+
export declare function cloneField(field: AnyField, overrides?: FieldInit): AnyField;
|
|
53
|
+
/** Duck type for anything with fields — Entity, SchemaConstructor. */
|
|
54
|
+
export interface SchemaLike {
|
|
55
|
+
getFields(): Fields;
|
|
56
|
+
/** The view's validation mode (patch…) — carried by SchemaConstructor, optional on bare wrappers. */
|
|
57
|
+
getOpts?(): {
|
|
58
|
+
patch?: boolean;
|
|
59
|
+
};
|
|
60
|
+
/** Field groups unique together — carried by SchemaConstructor, absent on bare wrappers. */
|
|
61
|
+
getUnique?(): ReadonlyArray<ReadonlyArray<string>> | undefined;
|
|
62
|
+
}
|
|
63
|
+
export declare function isField(value: unknown): value is AnyField;
|
|
64
|
+
//# sourceMappingURL=field.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"field.d.ts","sourceRoot":"","sources":["../../src/field/field.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AACxC,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACtC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAChD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AACjD,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAEtC;;;;;;;;;;;;;GAaG;AACH,MAAM,WAAW,KAAK,CAAC,CAAC,GAAG,OAA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OAAO,CAAA;KAAE,CAAC;IAChC,4FAA4F;IAC5F,SAAS,CAAC,IAAI,aAAa,CAAC,aAAa,CAAC,MAAM,CAAC,CAAC,GAAG,SAAS,CAAC;CAChE;AAED,wBAAgB,OAAO,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,QAAQ,CAOzD"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
export function createField(init = {}) {
|
|
2
|
+
return {
|
|
3
|
+
__brand: 'fougere_field',
|
|
4
|
+
shape: init.shape,
|
|
5
|
+
role: init.role,
|
|
6
|
+
lifecycle: init.lifecycle,
|
|
7
|
+
boundary: init.boundary,
|
|
8
|
+
meta: init.meta,
|
|
9
|
+
};
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Copy a field, overriding only the named axes — every OTHER axis is preserved.
|
|
13
|
+
* This is the invariant every field transform must hold: change what you mean,
|
|
14
|
+
* keep the rest. Enumerating axes by hand (the old `optional`/`primary`) silently
|
|
15
|
+
* drops whatever axis was added last — `codec` did exactly that. Spread + override,
|
|
16
|
+
* so a future 6th slot travels for free. (Spread props skip excess-property checks,
|
|
17
|
+
* so the field's `__brand`/phantoms ride along harmlessly and `createField` resets them.)
|
|
18
|
+
*/
|
|
19
|
+
export function cloneField(field, overrides = {}) {
|
|
20
|
+
return createField({ ...field, ...overrides });
|
|
21
|
+
}
|
|
22
|
+
export function isField(value) {
|
|
23
|
+
return (typeof value === 'object' &&
|
|
24
|
+
value !== null &&
|
|
25
|
+
'__brand' in value &&
|
|
26
|
+
value.__brand === 'fougere_field');
|
|
27
|
+
}
|
|
28
|
+
//# sourceMappingURL=field.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"field.js","sourceRoot":"","sources":["../../src/field/field.ts"],"names":[],"mappings":"AA+CA,MAAM,UAAU,WAAW,CAA+B,IAAI,GAAc,EAAE;IAC5E,OAAO;QACL,OAAO,EAAE,eAAe;QACxB,KAAK,EAAE,IAAI,CAAC,KAAK;QACjB,IAAI,EAAE,IAAI,CAAC,IAAI;QACf,SAAS,EAAE,IAAI,CAAC,SAAS;QACzB,QAAQ,EAAE,IAAI,CAAC,QAAQ;QACvB,IAAI,EAAE,IAAI,CAAC,IAAI;KAChB,CAAC;AACJ,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,UAAU,UAAU,CAAC,KAAe,EAAE,SAAS,GAAc,EAAE;IACnE,OAAO,WAAW,CAAC,EAAE,GAAG,KAAK,EAAE,GAAG,SAAS,EAAE,CAAC,CAAC;AACjD,CAAC;AAWD,MAAM,UAAU,OAAO,CAAC,KAAc;IACpC,OAAO,CACL,OAAO,KAAK,KAAK,QAAQ;QACzB,KAAK,KAAK,IAAI;QACd,SAAS,IAAI,KAAK;QACjB,KAAa,CAAC,OAAO,KAAK,eAAe,CAC3C,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export { type Shape, type ShapeType, type BaseShape, type ShapeAnatomy, type StringFormat, nullableShape, anatomy, isNullable, } from './shape.js';
|
|
2
|
+
export { type Role, type Relation, type EntityConstructor, toTargetThunk, uniqueMembers } from './role.js';
|
|
3
|
+
export { type Lifecycle, type GeneratorRef, registerGenerator, resolveCustomGenerator, } from './lifecycle.js';
|
|
4
|
+
export { type Boundary, type BoundaryRef, type Decoder, type Encoder, resolveBoundary, declaredBoundary, boundaryOf, registerDecoder, registerEncoder, registerBoundaryAlias, } from './boundary.js';
|
|
5
|
+
export { type Meta } from './meta.js';
|
|
6
|
+
export { type Field, type AnyField, type Fields, type FieldInit, type SchemaLike, createField, cloneField, isField, } from './field.js';
|
|
7
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/field/index.ts"],"names":[],"mappings":"AAGA,OAAO,EACL,KAAK,KAAK,EACV,KAAK,SAAS,EACd,KAAK,SAAS,EACd,KAAK,YAAY,EACjB,KAAK,YAAY,EACjB,aAAa,EACb,OAAO,EACP,UAAU,GACX,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,KAAK,IAAI,EAAE,KAAK,QAAQ,EAAE,KAAK,iBAAiB,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAC3G,OAAO,EACL,KAAK,SAAS,EACd,KAAK,YAAY,EACjB,iBAAiB,EACjB,sBAAsB,GACvB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EACL,KAAK,QAAQ,EACb,KAAK,WAAW,EAChB,KAAK,OAAO,EACZ,KAAK,OAAO,EACZ,eAAe,EACf,gBAAgB,EAChB,UAAU,EACV,eAAe,EACf,eAAe,EACf,qBAAqB,GACtB,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,KAAK,IAAI,EAAE,MAAM,WAAW,CAAC;AACtC,OAAO,EACL,KAAK,KAAK,EACV,KAAK,QAAQ,EACb,KAAK,MAAM,EACX,KAAK,SAAS,EACd,KAAK,UAAU,EACf,WAAW,EACX,UAAU,EACV,OAAO,GACR,MAAM,YAAY,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
// The primitive — a Field decomposed on four orthogonal axes plus the meta
|
|
2
|
+
// compartment. Each axis lives in its own file; this barrel is the
|
|
3
|
+
// package-internal (and index-level) view.
|
|
4
|
+
export { nullableShape, anatomy, isNullable, } from './shape.js';
|
|
5
|
+
export { toTargetThunk, uniqueMembers } from './role.js';
|
|
6
|
+
export { registerGenerator, resolveCustomGenerator, } from './lifecycle.js';
|
|
7
|
+
export { resolveBoundary, declaredBoundary, boundaryOf, registerDecoder, registerEncoder, registerBoundaryAlias, } from './boundary.js';
|
|
8
|
+
export { createField, cloneField, isField, } from './field.js';
|
|
9
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/field/index.ts"],"names":[],"mappings":"AAAA,2EAA2E;AAC3E,mEAAmE;AACnE,2CAA2C;AAC3C,OAAO,EAML,aAAa,EACb,OAAO,EACP,UAAU,GACX,MAAM,YAAY,CAAC;AACpB,OAAO,EAAoD,aAAa,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAC3G,OAAO,EAGL,iBAAiB,EACjB,sBAAsB,GACvB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAKL,eAAe,EACf,gBAAgB,EAChB,UAAU,EACV,eAAe,EACf,eAAe,EACf,qBAAqB,GACtB,MAAM,eAAe,CAAC;AAEvB,OAAO,EAML,WAAW,EACX,UAAU,EACV,OAAO,GACR,MAAM,YAAY,CAAC"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Generator TOKEN — a built-in preset or a name registered via
|
|
3
|
+
* {@link registerGenerator}. Never a closure: a function would silently vanish
|
|
4
|
+
* through describe/reconstruct (JSON.stringify drops it without an error) and
|
|
5
|
+
* the remote frond would pay. With a name, the failure is loud and local
|
|
6
|
+
* ("unknown generator") instead of silent and at the neighbour's.
|
|
7
|
+
*/
|
|
8
|
+
export type GeneratorRef = 'cuid2' | 'uuid' | 'nanoid' | (string & {});
|
|
9
|
+
export interface Lifecycle {
|
|
10
|
+
/**
|
|
11
|
+
* The CREATE rule — what happens when the input omits the value:
|
|
12
|
+
* - key absent → required, the caller must supply it
|
|
13
|
+
* - `{ value }` → filled with this literal (a `default`)
|
|
14
|
+
* - `'now'` → stamped `new Date()` (a managed creation timestamp)
|
|
15
|
+
* - `{ generate }` → the storage adapter stamps a fresh id at insert
|
|
16
|
+
* - `'optional'` → absence permitted, nothing produced
|
|
17
|
+
* A supplied value is always accepted (create); restricting WHAT a surface
|
|
18
|
+
* accepts is a derivation (`pick`), never a rule here.
|
|
19
|
+
*/
|
|
20
|
+
create?: {
|
|
21
|
+
value: unknown;
|
|
22
|
+
} | 'now' | {
|
|
23
|
+
generate: GeneratorRef;
|
|
24
|
+
} | 'optional';
|
|
25
|
+
/**
|
|
26
|
+
* The UPDATE rule — what happens on a patch:
|
|
27
|
+
* - key absent → the field is only written if the client supplies it
|
|
28
|
+
* - `'now'` → stamped `new Date()` at every update even when absent
|
|
29
|
+
* (the canonical `updatedAt`); a supplied value is accepted
|
|
30
|
+
* - `'forbidden'` → immutable: supplying the field in a patch is a
|
|
31
|
+
* validation error; absent, nothing happens
|
|
32
|
+
* The validation only JUDGES these rules; realising `'now'` (stamping) is the
|
|
33
|
+
* storage adapter's role at the point of persistence — same split as create.
|
|
34
|
+
*/
|
|
35
|
+
update?: 'now' | 'forbidden';
|
|
36
|
+
}
|
|
37
|
+
export declare function registerGenerator(name: string, fn: () => string): void;
|
|
38
|
+
/** A registered custom generator, or undefined (built-in presets live storage-side). */
|
|
39
|
+
export declare function resolveCustomGenerator(ref: GeneratorRef): (() => string) | undefined;
|
|
40
|
+
//# sourceMappingURL=lifecycle.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lifecycle.d.ts","sourceRoot":"","sources":["../../src/field/lifecycle.ts"],"names":[],"mappings":"AAQA;;;;;;GAMG;AACH,MAAM,MAAM,YAAY,GAAG,OAAO,GAAG,MAAM,GAAG,QAAQ,GAAG,CAAC,MAAM,GAAG,EAAE,CAAC,CAAC;AAEvE,MAAM,WAAW,SAAS;IACxB;;;;;;;;;OASG;IACH,MAAM,CAAC,EAAE;QAAE,KAAK,EAAE,OAAO,CAAA;KAAE,GAAG,KAAK,GAAG;QAAE,QAAQ,EAAE,YAAY,CAAA;KAAE,GAAG,UAAU,CAAC;IAC9E;;;;;;;;;OASG;IACH,MAAM,CAAC,EAAE,KAAK,GAAG,WAAW,CAAC;CAC9B;AAgBD,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,MAAM,GAAG,IAAI,CAEtE;AAED,wFAAwF;AACxF,wBAAgB,sBAAsB,CAAC,GAAG,EAAE,YAAY,GAAG,CAAC,MAAM,MAAM,CAAC,GAAG,SAAS,CAEpF"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
// ─── Axis 3 · lifecycle — WHO WRITES THE VALUE, AT WHICH MOMENT ────
|
|
2
|
+
// The normal form is indexed by the situation (the write moment); reading is a
|
|
3
|
+
// key access plus a switch on a named token — never an interpreter function.
|
|
4
|
+
// The interpretation happened ONCE, at declaration (the vocabulary translates
|
|
5
|
+
// its sugar into this form). Declarative, named only — never an opaque closure
|
|
6
|
+
// (a value mutation invisible to adapters is forbidden).
|
|
7
|
+
// (Coercion — converting a supplied value — is NOT here; that is the `boundary` axis.)
|
|
8
|
+
// ─── Generator registry (open, same spirit as the boundary registries) ──
|
|
9
|
+
// CUSTOM generators, declared once per module:
|
|
10
|
+
// registerGenerator('monId', () => …) → primary({ generate: 'monId' })
|
|
11
|
+
//
|
|
12
|
+
// The BUILT-IN presets (cuid2/uuid/nanoid) used to be resolved by each storage adapter,
|
|
13
|
+
// on the grounds that this package took no dependency. It took one already
|
|
14
|
+
// (`@cfworker/json-schema`, for the other projection), and the arrangement put the
|
|
15
|
+
// inversion in plain sight: a generator YOU invented reached every adapter, and the
|
|
16
|
+
// three the framework ships did not — so a second adapter honoured `cuid2` differently
|
|
17
|
+
// or not at all. They live with the realization now (`projections/lifecycle.ts`), which
|
|
18
|
+
// consults this registry first.
|
|
19
|
+
const generators = new Map();
|
|
20
|
+
export function registerGenerator(name, fn) {
|
|
21
|
+
generators.set(name, fn);
|
|
22
|
+
}
|
|
23
|
+
/** A registered custom generator, or undefined (built-in presets live storage-side). */
|
|
24
|
+
export function resolveCustomGenerator(ref) {
|
|
25
|
+
return generators.get(ref);
|
|
26
|
+
}
|
|
27
|
+
//# sourceMappingURL=lifecycle.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lifecycle.js","sourceRoot":"","sources":["../../src/field/lifecycle.ts"],"names":[],"mappings":"AAAA,sEAAsE;AACtE,+EAA+E;AAC/E,6EAA6E;AAC7E,8EAA8E;AAC9E,+EAA+E;AAC/E,yDAAyD;AACzD,uFAAuF;AAoCvF,2EAA2E;AAC3E,+CAA+C;AAC/C,2EAA2E;AAC3E,EAAE;AACF,wFAAwF;AACxF,2EAA2E;AAC3E,mFAAmF;AACnF,oFAAoF;AACpF,uFAAuF;AACvF,wFAAwF;AACxF,gCAAgC;AAEhC,MAAM,UAAU,GAAG,IAAI,GAAG,EAAwB,CAAC;AAEnD,MAAM,UAAU,iBAAiB,CAAC,IAAY,EAAE,EAAgB;IAC9D,UAAU,CAAC,GAAG,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;AAC3B,CAAC;AAED,wFAAwF;AACxF,MAAM,UAAU,sBAAsB,CAAC,GAAiB;IACtD,OAAO,UAAU,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;AAC7B,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export interface Meta {
|
|
2
|
+
/**
|
|
3
|
+
* Human-readable annotation. Read by CLI help (`cli/bridge.ts`) and carried by the
|
|
4
|
+
* portable card — that is the whole current reach. No OpenAPI generation exists in
|
|
5
|
+
* this repo, and `schema-graphql` never reads meta.
|
|
6
|
+
*/
|
|
7
|
+
description?: string;
|
|
8
|
+
}
|
|
9
|
+
//# sourceMappingURL=meta.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"meta.d.ts","sourceRoot":"","sources":["../../src/field/meta.ts"],"names":[],"mappings":"AAMA,MAAM,WAAW,IAAI;IACnB;;;;OAIG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
// ─── meta — the documentary compartment (NOT an axis) ────────────
|
|
2
|
+
// Universal, human-facing information. The contract is strict and holds: NO consumer
|
|
3
|
+
// ever DECIDES by reading meta — the axes govern behaviour, meta informs humans.
|
|
4
|
+
// Per-consumer specifics belong to `hints`, not here. Future candidates of the same
|
|
5
|
+
// nature: title, example, deprecated.
|
|
6
|
+
export {};
|
|
7
|
+
//# sourceMappingURL=meta.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"meta.js","sourceRoot":"","sources":["../../src/field/meta.ts"],"names":[],"mappings":"AAAA,oEAAoE;AACpE,qFAAqF;AACrF,iFAAiF;AACjF,oFAAoF;AACpF,sCAAsC"}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
export type EntityConstructor = abstract new (...args: any[]) => any;
|
|
2
|
+
/**
|
|
3
|
+
* Normalize a relation target to a lazy thunk. A target may be given as the entity
|
|
4
|
+
* class directly (`ref(Author)`) or as a thunk (`ref(() => Author)`) — the thunk
|
|
5
|
+
* form is needed for circular/forward references, where the class isn't defined yet
|
|
6
|
+
* when `entity({...})` is evaluated. An entity class is recognized by its static
|
|
7
|
+
* `getFields`; anything else is treated as the thunk itself.
|
|
8
|
+
*/
|
|
9
|
+
export declare function toTargetThunk<E extends EntityConstructor>(target: E | (() => E)): () => E;
|
|
10
|
+
export interface Relation {
|
|
11
|
+
to: () => EntityConstructor;
|
|
12
|
+
kind: 'one' | 'many';
|
|
13
|
+
onDelete?: 'cascade' | 'restrict' | 'set null';
|
|
14
|
+
}
|
|
15
|
+
export interface Role {
|
|
16
|
+
primary?: boolean;
|
|
17
|
+
/**
|
|
18
|
+
* The unique constraints this field is a member of — one member list per constraint.
|
|
19
|
+
*
|
|
20
|
+
* A constraint is a NAMED SET of fields, and a lone `unique(slug)` is the degenerate
|
|
21
|
+
* case: a set of one. So there is one shape, not two — `boolean` could say "unique on
|
|
22
|
+
* its own" and nothing else, neither "unique together with docId" nor "in two
|
|
23
|
+
* constraints at once".
|
|
24
|
+
*
|
|
25
|
+
* **An empty member list denotes the field carrying it.** `unique(text())` applies to a
|
|
26
|
+
* field that does not yet know its own key — `slug` exists only once `entity({...})`
|
|
27
|
+
* assembles the object — so the self-reference is written as `[]` and stays that way:
|
|
28
|
+
* nothing to resolve, nothing to remap when a view renames the key, and a reader that
|
|
29
|
+
* never went through `entity()` still reads something true. A group with named members
|
|
30
|
+
* comes from the entity's own declaration (`entity(fields, { unique: [[...]] })`), which
|
|
31
|
+
* is where a fact about a pair belongs — no field holds it alone.
|
|
32
|
+
*
|
|
33
|
+
* So NEVER read a group directly — {@link uniqueMembers} is the accessor.
|
|
34
|
+
*/
|
|
35
|
+
unique?: ReadonlyArray<ReadonlyArray<string>>;
|
|
36
|
+
index?: boolean;
|
|
37
|
+
relation?: Relation;
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* The constraint a member list denotes, resolved against the field carrying it — the
|
|
41
|
+
* accessor every reader of `role.unique` goes through.
|
|
42
|
+
*
|
|
43
|
+
* ```ts
|
|
44
|
+
* uniqueMembers([], 'slug') // ['slug'] — the self-reference
|
|
45
|
+
* uniqueMembers(['listId', 'docId'], 'docId') // ['listId','docId'] — already named
|
|
46
|
+
* ```
|
|
47
|
+
*
|
|
48
|
+
* `ownKey` is the half the field is missing, and only its holder can supply it: iterate
|
|
49
|
+
* `Object.entries(getFields())`, never the field alone. Two spellings for one constraint
|
|
50
|
+
* is the price of a self-reference that survives `rename()` untouched; this function is
|
|
51
|
+
* what makes them one, and it is why the two forms never need to be compared as data.
|
|
52
|
+
*/
|
|
53
|
+
export declare function uniqueMembers(group: ReadonlyArray<string>, ownKey: string): string[];
|
|
54
|
+
//# sourceMappingURL=role.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"role.d.ts","sourceRoot":"","sources":["../../src/field/role.ts"],"names":[],"mappings":"AA4BA,MAAM,MAAM,iBAAiB,GAAG,QAAQ,MAAM,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,GAAG,CAAC;AAErE;;;;;;GAMG;AACH,wBAAgB,aAAa,CAAC,CAAC,SAAS,iBAAiB,EAAE,MAAM,EAAE,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,GAAG,MAAM,CAAC,CAEzF;AAED,MAAM,WAAW,QAAQ;IACvB,EAAE,EAAE,MAAM,iBAAiB,CAAC;IAC5B,IAAI,EAAE,KAAK,GAAG,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,SAAS,GAAG,UAAU,GAAG,UAAU,CAAC;CAChD;AAED,MAAM,WAAW,IAAI;IACnB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB;;;;;;;;;;;;;;;;;OAiBG;IACH,MAAM,CAAC,EAAE,aAAa,CAAC,aAAa,CAAC,MAAM,CAAC,CAAC,CAAC;IAC9C,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,QAAQ,CAAC,EAAE,QAAQ,CAAC;CACrB;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE,aAAa,CAAC,MAAM,CAAC,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,CAEpF"}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
// ─── Axis 2 · role — place in the entity graph ────────────
|
|
2
|
+
// What no value validator expresses: identity and relations. Read by the storage and
|
|
3
|
+
// transport adapters, and ALSO by validation — `relation.kind === 'many'` decides that
|
|
4
|
+
// an absent collection defaults to `[]` and that a supplied one must be an array
|
|
5
|
+
// (`projections/validation.ts`). The earlier claim "never by validation" was false.
|
|
6
|
+
//
|
|
7
|
+
// `unique` and `index` are STORAGE facts, and the only axis member realized outside the
|
|
8
|
+
// framework: `unique(...)`/`indexed(...)` set them, the DDL emits the constraint and the
|
|
9
|
+
// index, and the database enforces uniqueness on every write — including ones Fougere
|
|
10
|
+
// never saw. A collision therefore surfaces as the driver's error, never as a
|
|
11
|
+
// `validate()` failure: judging one value can never see the other rows.
|
|
12
|
+
//
|
|
13
|
+
// ⚠️ READING `unique` — the one member of this axis that is not self-contained. A member
|
|
14
|
+
// list may be EMPTY, denoting the field that carries it, so a reader that walks the array
|
|
15
|
+
// literally sees a group of no fields. Every reader goes through `uniqueMembers(group,
|
|
16
|
+
// key)`, which needs the field's key — the half a field does not have (`slug` is named by
|
|
17
|
+
// the object literal `entity({...})` receives, one call up).
|
|
18
|
+
//
|
|
19
|
+
// for (const [key, field] of Object.entries(schema.getFields()))
|
|
20
|
+
// for (const group of field.role?.unique ?? [])
|
|
21
|
+
// uniqueMembers(group, key) // ← always. `[]` at key `slug` means `['slug']`.
|
|
22
|
+
//
|
|
23
|
+
// The in-repo readers do this (`schema-sql/src/table.ts`, `projections/describe.ts`). A
|
|
24
|
+
// consumer reading a CARD never meets the empty form: `describe` resolves it on the way
|
|
25
|
+
// out, so the wire always names its members — which is the point of resolving it there
|
|
26
|
+
// and not in `entity()`. Keeping it unresolved in memory is what makes `rename()` free:
|
|
27
|
+
// a self-reference names no key, so there is nothing to remap when the key moves.
|
|
28
|
+
/**
|
|
29
|
+
* Normalize a relation target to a lazy thunk. A target may be given as the entity
|
|
30
|
+
* class directly (`ref(Author)`) or as a thunk (`ref(() => Author)`) — the thunk
|
|
31
|
+
* form is needed for circular/forward references, where the class isn't defined yet
|
|
32
|
+
* when `entity({...})` is evaluated. An entity class is recognized by its static
|
|
33
|
+
* `getFields`; anything else is treated as the thunk itself.
|
|
34
|
+
*/
|
|
35
|
+
export function toTargetThunk(target) {
|
|
36
|
+
return 'getFields' in target ? () => target : target;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* The constraint a member list denotes, resolved against the field carrying it — the
|
|
40
|
+
* accessor every reader of `role.unique` goes through.
|
|
41
|
+
*
|
|
42
|
+
* ```ts
|
|
43
|
+
* uniqueMembers([], 'slug') // ['slug'] — the self-reference
|
|
44
|
+
* uniqueMembers(['listId', 'docId'], 'docId') // ['listId','docId'] — already named
|
|
45
|
+
* ```
|
|
46
|
+
*
|
|
47
|
+
* `ownKey` is the half the field is missing, and only its holder can supply it: iterate
|
|
48
|
+
* `Object.entries(getFields())`, never the field alone. Two spellings for one constraint
|
|
49
|
+
* is the price of a self-reference that survives `rename()` untouched; this function is
|
|
50
|
+
* what makes them one, and it is why the two forms never need to be compared as data.
|
|
51
|
+
*/
|
|
52
|
+
export function uniqueMembers(group, ownKey) {
|
|
53
|
+
return group.length === 0 ? [ownKey] : [...group];
|
|
54
|
+
}
|
|
55
|
+
//# sourceMappingURL=role.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"role.js","sourceRoot":"","sources":["../../src/field/role.ts"],"names":[],"mappings":"AAAA,6DAA6D;AAC7D,qFAAqF;AACrF,uFAAuF;AACvF,iFAAiF;AACjF,oFAAoF;AACpF,EAAE;AACF,wFAAwF;AACxF,yFAAyF;AACzF,sFAAsF;AACtF,8EAA8E;AAC9E,wEAAwE;AACxE,EAAE;AACF,yFAAyF;AACzF,0FAA0F;AAC1F,uFAAuF;AACvF,0FAA0F;AAC1F,6DAA6D;AAC7D,EAAE;AACF,mEAAmE;AACnE,oDAAoD;AACpD,wFAAwF;AACxF,EAAE;AACF,wFAAwF;AACxF,wFAAwF;AACxF,uFAAuF;AACvF,wFAAwF;AACxF,kFAAkF;AAIlF;;;;;;GAMG;AACH,MAAM,UAAU,aAAa,CAA8B,MAAqB;IAC9E,OAAO,WAAW,IAAI,MAAM,CAAC,CAAC,CAAC,GAAG,EAAE,CAAC,MAAW,CAAC,CAAC,CAAE,MAAkB,CAAC;AACzE,CAAC;AAiCD;;;;;;;;;;;;;GAaG;AACH,MAAM,UAAU,aAAa,CAAC,KAA4B,EAAE,MAAc;IACxE,OAAO,KAAK,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC,CAAC;AACpD,CAAC"}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
export type StringFormat = 'date-time' | 'date' | 'time' | 'email' | 'uuid' | 'uri';
|
|
2
|
+
/** A base type name, alone or in the nullable union form. */
|
|
3
|
+
type Nullably<T extends string> = T | readonly [T, 'null'];
|
|
4
|
+
interface StringConstraints {
|
|
5
|
+
minLength?: number;
|
|
6
|
+
maxLength?: number;
|
|
7
|
+
pattern?: string;
|
|
8
|
+
enum?: readonly (string | null)[];
|
|
9
|
+
format?: StringFormat;
|
|
10
|
+
}
|
|
11
|
+
interface NumericConstraints {
|
|
12
|
+
minimum?: number;
|
|
13
|
+
maximum?: number;
|
|
14
|
+
}
|
|
15
|
+
interface ArrayConstraints {
|
|
16
|
+
items: Shape;
|
|
17
|
+
minItems?: number;
|
|
18
|
+
maxItems?: number;
|
|
19
|
+
}
|
|
20
|
+
interface ObjectConstraints {
|
|
21
|
+
properties?: Record<string, unknown>;
|
|
22
|
+
required?: readonly string[];
|
|
23
|
+
}
|
|
24
|
+
export type Shape = ({
|
|
25
|
+
type: Nullably<'string'>;
|
|
26
|
+
} & StringConstraints) | ({
|
|
27
|
+
type: Nullably<'number'> | Nullably<'integer'>;
|
|
28
|
+
} & NumericConstraints) | {
|
|
29
|
+
type: Nullably<'boolean'>;
|
|
30
|
+
} | ({
|
|
31
|
+
type: Nullably<'array'>;
|
|
32
|
+
} & ArrayConstraints) | ({
|
|
33
|
+
type: Nullably<'object'>;
|
|
34
|
+
} & ObjectConstraints);
|
|
35
|
+
/** The BASE type names — what `anatomy(shape).base?.type` narrows to for a dispatch. */
|
|
36
|
+
export type ShapeType = 'string' | 'number' | 'integer' | 'boolean' | 'array' | 'object';
|
|
37
|
+
/**
|
|
38
|
+
* `Shape` with `type` guaranteed scalar — what `anatomy` returns as `base`, the
|
|
39
|
+
* ONLY form consumers dispatch on. A scalar literal is a real discriminant, so
|
|
40
|
+
* `switch (base?.type)` narrows; the raw `Shape` union can't (the `[T,'null']`
|
|
41
|
+
* tuple is not a unit type).
|
|
42
|
+
*/
|
|
43
|
+
export type BaseShape = ({
|
|
44
|
+
type: 'string';
|
|
45
|
+
} & StringConstraints) | ({
|
|
46
|
+
type: 'number' | 'integer';
|
|
47
|
+
} & NumericConstraints) | {
|
|
48
|
+
type: 'boolean';
|
|
49
|
+
} | ({
|
|
50
|
+
type: 'array';
|
|
51
|
+
} & ArrayConstraints) | ({
|
|
52
|
+
type: 'object';
|
|
53
|
+
} & ObjectConstraints);
|
|
54
|
+
/**
|
|
55
|
+
* Write side: make a shape's grammar accept `null` — the type becomes the union
|
|
56
|
+
* `[T, 'null']`, and `null` joins `enum` when present (an enum is a closed value
|
|
57
|
+
* set; null must be IN it to be legal). Idempotent.
|
|
58
|
+
*/
|
|
59
|
+
export declare function nullableShape(shape: Shape): Shape;
|
|
60
|
+
/** A shape split back into its base grammar and its nullability. */
|
|
61
|
+
export interface ShapeAnatomy {
|
|
62
|
+
/** The shape stripped of `null` (scalar `type`, `enum` without null) — dispatch on THIS. */
|
|
63
|
+
base?: BaseShape;
|
|
64
|
+
nullable: boolean;
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* Read side — the single customs post at the standard's border. Every consumer
|
|
68
|
+
* that dispatches on a shape's type MUST come through here: `shape.type` may be
|
|
69
|
+
* the union `[T, 'null']`, and a direct `shape.type === 'string'` comparison
|
|
70
|
+
* fails silently on it. Cached per shape reference (shapes are stable — the
|
|
71
|
+
* derivations copy field refs, they never rebuild shapes).
|
|
72
|
+
*/
|
|
73
|
+
export declare function anatomy(shape?: Shape): ShapeAnatomy;
|
|
74
|
+
/** Sugar for the most common read: does this shape's grammar accept `null`? */
|
|
75
|
+
export declare function isNullable(shape?: Shape): boolean;
|
|
76
|
+
export {};
|
|
77
|
+
//# sourceMappingURL=shape.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"shape.d.ts","sourceRoot":"","sources":["../../src/field/shape.ts"],"names":[],"mappings":"AAuBA,MAAM,MAAM,YAAY,GAAG,WAAW,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,MAAM,GAAG,KAAK,CAAC;AAEpF,6DAA6D;AAC7D,KAAK,QAAQ,CAAC,CAAC,SAAS,MAAM,IAAI,CAAC,GAAG,SAAS,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC;AAI3D,UAAU,iBAAiB;IAAG,SAAS,CAAC,EAAE,MAAM,CAAC;IAAC,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,CAAA;CAAE,GAAG,iBAAiB,CAAC,GACxC,CAAC;IAAE,IAAI,EAAE,QAAQ,GAAG,SAAS,CAAA;CAAE,GAAG,kBAAkB,CAAC,GACrD;IAAE,IAAI,EAAE,SAAS,CAAA;CAAE,GACnB,CAAC;IAAE,IAAI,EAAE,OAAO,CAAA;CAAE,GAAG,gBAAgB,CAAC,GACtC,CAAC;IAAE,IAAI,EAAE,QAAQ,CAAA;CAAE,GAAG,iBAAiB,CAAC,CAAC;AAI7C;;;;GAIG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE,KAAK,GAAG,KAAK,CAOjD;AAED,oEAAoE;AACpE,MAAM,WAAW,YAAY;IAC3B,4FAA4F;IAC5F,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,QAAQ,EAAE,OAAO,CAAC;CACnB;AAKD;;;;;;GAMG;AACH,wBAAgB,OAAO,CAAC,KAAK,CAAC,EAAE,KAAK,GAAG,YAAY,CAiBnD;AAED,+EAA+E;AAC/E,wBAAgB,UAAU,CAAC,KAAK,CAAC,EAAE,KAAK,GAAG,OAAO,CAEjD"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
// ─── nullableShape / anatomy — the two gates of the union ──────────
|
|
2
|
+
/**
|
|
3
|
+
* Write side: make a shape's grammar accept `null` — the type becomes the union
|
|
4
|
+
* `[T, 'null']`, and `null` joins `enum` when present (an enum is a closed value
|
|
5
|
+
* set; null must be IN it to be legal). Idempotent.
|
|
6
|
+
*/
|
|
7
|
+
export function nullableShape(shape) {
|
|
8
|
+
if (Array.isArray(shape.type))
|
|
9
|
+
return shape;
|
|
10
|
+
const out = { ...shape, type: [shape.type, 'null'] };
|
|
11
|
+
if ('enum' in out && out.enum && !out.enum.includes(null)) {
|
|
12
|
+
out.enum = [...out.enum, null];
|
|
13
|
+
}
|
|
14
|
+
return out;
|
|
15
|
+
}
|
|
16
|
+
const anatomies = new WeakMap();
|
|
17
|
+
const NO_SHAPE = { base: undefined, nullable: false };
|
|
18
|
+
/**
|
|
19
|
+
* Read side — the single customs post at the standard's border. Every consumer
|
|
20
|
+
* that dispatches on a shape's type MUST come through here: `shape.type` may be
|
|
21
|
+
* the union `[T, 'null']`, and a direct `shape.type === 'string'` comparison
|
|
22
|
+
* fails silently on it. Cached per shape reference (shapes are stable — the
|
|
23
|
+
* derivations copy field refs, they never rebuild shapes).
|
|
24
|
+
*/
|
|
25
|
+
export function anatomy(shape) {
|
|
26
|
+
if (!shape)
|
|
27
|
+
return NO_SHAPE;
|
|
28
|
+
let a = anatomies.get(shape);
|
|
29
|
+
if (!a) {
|
|
30
|
+
if (Array.isArray(shape.type)) {
|
|
31
|
+
const baseType = shape.type.find((t) => t !== 'null');
|
|
32
|
+
const base = { ...shape, type: baseType };
|
|
33
|
+
if ('enum' in base && base.enum) {
|
|
34
|
+
base.enum = base.enum.filter((v) => v !== null);
|
|
35
|
+
}
|
|
36
|
+
a = { base, nullable: true };
|
|
37
|
+
}
|
|
38
|
+
else {
|
|
39
|
+
a = { base: shape, nullable: false };
|
|
40
|
+
}
|
|
41
|
+
anatomies.set(shape, a);
|
|
42
|
+
}
|
|
43
|
+
return a;
|
|
44
|
+
}
|
|
45
|
+
/** Sugar for the most common read: does this shape's grammar accept `null`? */
|
|
46
|
+
export function isNullable(shape) {
|
|
47
|
+
return anatomy(shape).nullable;
|
|
48
|
+
}
|
|
49
|
+
//# sourceMappingURL=shape.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"shape.js","sourceRoot":"","sources":["../../src/field/shape.ts"],"names":[],"mappings":"AA+DA,sEAAsE;AAEtE;;;;GAIG;AACH,MAAM,UAAU,aAAa,CAAC,KAAY;IACxC,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC;QAAE,OAAO,KAAK,CAAC;IAC5C,MAAM,GAAG,GAAG,EAAE,GAAG,KAAK,EAAE,IAAI,EAAE,CAAC,KAAK,CAAC,IAAI,EAAE,MAAM,CAAC,EA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AAE,QAAQ,EAAE,KAAK,EAAE,CAAC;QACpD,CAAC;QACD,SAAS,CAAC,GAAG,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC;IAC1B,CAAC;IACD,OAAO,CAAC,CAAC;AACX,CAAC;AAED,+EAA+E;AAC/E,MAAM,UAAU,UAAU,CAAC,KAAa;IACtC,OAAO,OAAO,CAAC,KAAK,CAAC,CAAC,QAAQ,CAAC;AACjC,CAAC"}
|
package/dist/hints.d.ts
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import type { Fields } from "./field/index.js";
|
|
2
|
+
/**
|
|
3
|
+
* Open registry of per-consumer hints — the escape hatch for the irreducible
|
|
4
|
+
* bits a single neutral field can't carry (e.g. "store `body` as a `tsvector`
|
|
5
|
+
* with a GIN index", which validation and the API must ignore).
|
|
6
|
+
*
|
|
7
|
+
* EMPTY here on purpose: `@fougere/schema` names no adapter and depends on none.
|
|
8
|
+
* Each adapter augments this from its OWN package via declaration merging —
|
|
9
|
+
*
|
|
10
|
+
* ```ts
|
|
11
|
+
* declare module '@fougere/schema' {
|
|
12
|
+
* interface FougereHints<K extends string> {
|
|
13
|
+
* sql?: Partial<Record<K, { columnType?: string; index?: string }>>;
|
|
14
|
+
* }
|
|
15
|
+
* }
|
|
16
|
+
* ```
|
|
17
|
+
*
|
|
18
|
+
* `K` is the entity's field-key union, so a hint's inner keys are constrained to
|
|
19
|
+
* real fields. Until an adapter augments it the registry is `{}` — there is simply
|
|
20
|
+
* nothing to hint against, and the constraint materialises once an adapter is in
|
|
21
|
+
* the compilation. No dependency inversion: schema never names an adapter.
|
|
22
|
+
*/
|
|
23
|
+
export interface FougereHints<K extends string> {
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Per-consumer hints for an entity, keyed by registered adapter. Only adapters
|
|
27
|
+
* present in {@link FougereHints} are accepted; unknown adapters, unknown fields
|
|
28
|
+
* and unknown options are all rejected at the call site.
|
|
29
|
+
*/
|
|
30
|
+
export type Hints<TFields extends Fields> = {
|
|
31
|
+
[A in keyof FougereHints<Extract<keyof TFields, string>>]?: FougereHints<Extract<keyof TFields, string>>[A];
|
|
32
|
+
};
|
|
33
|
+
//# sourceMappingURL=hints.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hints.d.ts","sourceRoot":"","sources":["../src/hints.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAE/C;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,MAAM,WAAW,YAAY,CAAC,CAAC,SAAS,MAAM;CAAI;AAElD;;;;GAIG;AACH,MAAM,MAAM,KAAK,CAAC,OAAO,SAAS,MAAM,IAAI;KACzC,CAAC,IAAI,MAAM,YAAY,CAAC,OAAO,CAAC,MAAM,OAAO,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC,EAAE,YAAY,CACtE,OAAO,CAAC,MAAM,OAAO,EAAE,MAAM,CAAC,CAC/B,CAAC,CAAC,CAAC;CACL,CAAC"}
|
package/dist/hints.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hints.js","sourceRoot":"","sources":["../src/hints.ts"],"names":[],"mappings":""}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
export { type Field, type AnyField, type Fields, type Shape, type ShapeType, type BaseShape, type ShapeAnatomy, type StringFormat, type Role, type Relation, type Lifecycle, type GeneratorRef, type SchemaLike, type Boundary, type BoundaryRef, type Decoder, type Encoder, type Meta, isField, cloneField, nullableShape, anatomy, uniqueMembers, isNullable, registerGenerator, resolveCustomGenerator, resolveBoundary, declaredBoundary, boundaryOf, registerDecoder, registerEncoder, registerBoundaryAlias, type EntityConstructor, } from './field/index.js';
|
|
2
|
+
export { entity, compose, createSchemaConstructor, ANONYMOUS_SCHEMA_NAME, type SchemaConstructor, type SchemaViewInfer as InferView, type CtorInput, } from './entity.js';
|
|
3
|
+
export { type FougereHints, type Hints } from './hints.js';
|
|
4
|
+
export { type CompositeUnique, type EntityDeclarations } from './unique.js';
|
|
5
|
+
export { primary } from './vocabulary/primary.js';
|
|
6
|
+
export { text, type TextOptions } from './vocabulary/text.js';
|
|
7
|
+
export { email } from './vocabulary/email.js';
|
|
8
|
+
export { url } from './vocabulary/url.js';
|
|
9
|
+
export { list, type ListOptions } from './vocabulary/list.js';
|
|
10
|
+
export { number } from './vocabulary/number.js';
|
|
11
|
+
export { bool } from './vocabulary/bool.js';
|
|
12
|
+
export { date } from './vocabulary/date.js';
|
|
13
|
+
export { auto } from './vocabulary/auto.js';
|
|
14
|
+
export { updated } from './vocabulary/updated.js';
|
|
15
|
+
export { oneOf } from './vocabulary/oneOf.js';
|
|
16
|
+
export { ref } from './vocabulary/ref.js';
|
|
17
|
+
export { many } from './vocabulary/many.js';
|
|
18
|
+
export { optional } from './vocabulary/optional.js';
|
|
19
|
+
export { nullable } from './vocabulary/nullable.js';
|
|
20
|
+
export { immutable } from './vocabulary/immutable.js';
|
|
21
|
+
export { unique } from './vocabulary/unique.js';
|
|
22
|
+
export { indexed } from './vocabulary/indexed.js';
|
|
23
|
+
export { readOnly } from './vocabulary/readOnly.js';
|
|
24
|
+
export { writeOnly } from './vocabulary/writeOnly.js';
|
|
25
|
+
export { json } from './vocabulary/json.js';
|
|
26
|
+
export { applyCreate, applyUpdate } from './projections/lifecycle.js';
|
|
27
|
+
export { type ValidationResult, type ValidationError, type Checked, validateFields, checkValue } from './projections/validation.js';
|
|
28
|
+
export { encodeFields } from './projections/encode.js';
|
|
29
|
+
export { inputFields, outputFields } from './projections/io.js';
|
|
30
|
+
export { describe, describeSet, sourceNameOf } from './projections/describe.js';
|
|
31
|
+
export { reconstruct, reconstructSet } from './projections/reconstruct.js';
|
|
32
|
+
export { shapeTypeOf, entitySourceOf, facadeTypeSourceOf, type TypeSourceOptions, type OpDescriptor } from './projections/typescript.js';
|
|
33
|
+
export { type SchemaBundle, type SchemaDescriptor, type FieldDescriptor, type FieldExtension, type RoleDescriptor, type RelationDescriptor, type JsonSchemaType, } from './projections/card.js';
|
|
34
|
+
export { type SchemaSource, schemaOf, fieldsOf, uniqueOf } from './projections/source.js';
|
|
35
|
+
export type { StandardSchemaV1 } from './projections/standard.js';
|
|
36
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EACL,KAAK,KAAK,EACV,KAAK,QAAQ,EACb,KAAK,MAAM,EACX,KAAK,KAAK,EACV,KAAK,SAAS,EACd,KAAK,SAAS,EACd,KAAK,YAAY,EACjB,KAAK,YAAY,EACjB,KAAK,IAAI,EACT,KAAK,QAAQ,EACb,KAAK,SAAS,EACd,KAAK,YAAY,EACjB,KAAK,UAAU,EACf,KAAK,QAAQ,EACb,KAAK,WAAW,EAChB,KAAK,OAAO,EACZ,KAAK,OAAO,EACZ,KAAK,IAAI,EACT,OAAO,EACP,UAAU,EACV,aAAa,EACb,OAAO,EAEP,aAAa,EACb,UAAU,EACV,iBAAiB,EACjB,sBAAsB,EACtB,eAAe,EACf,gBAAgB,EAChB,UAAU,EACV,eAAe,EACf,eAAe,EACf,qBAAqB,EAKrB,KAAK,iBAAiB,GACvB,MAAM,kBAAkB,CAAC;AAG1B,OAAO,EACL,MAAM,EACN,OAAO,EACP,uBAAuB,EACvB,qBAAqB,EACrB,KAAK,iBAAiB,EACtB,KAAK,eAAe,IAAI,SAAS,EACjC,KAAK,SAAS,GACf,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,KAAK,YAAY,EAAE,KAAK,KAAK,EAAE,MAAM,YAAY,CAAC;AAC3D,OAAO,EAAE,KAAK,eAAe,EAAE,KAAK,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAG5E,OAAO,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAC;AAClD,OAAO,EAAE,IAAI,EAAE,KAAK,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