@workerstack/database 0.21.0 → 0.22.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/README.md +197 -33
- package/docs/meta-contract.md +55 -1
- package/package.json +1 -6
- package/src/codegen/analyzer-types.ts +6 -1
- package/src/codegen/annotations.ts +66 -9
- package/src/codegen/format-constraints.ts +114 -0
- package/src/codegen/generators/dtos/entity-file.ts +2 -1
- package/src/codegen/generators/dtos/example-meta.ts +22 -2
- package/src/codegen/generators/dtos/field-schema.ts +31 -8
- package/src/codegen/generators/dtos/ip-patterns.ts +25 -11
- package/src/codegen/generators/dtos/number-range.ts +22 -3
- package/src/codegen/generators/dtos/schema-aliases.ts +5 -3
- package/src/codegen/generators/dtos/text-format.ts +63 -0
- package/src/codegen/generators/dtos/text-schema.ts +49 -2
- package/src/codegen/generators/manifest.ts +9 -1
- package/src/codegen/runtime/read-comb.ts +71 -3
- package/src/codegen/runtime/read-tables.ts +31 -19
- package/src/codegen/runtime/snapshot-types.ts +3 -1
- package/src/codegen/runtime/to-meta.ts +6 -3
- package/src/formats/catalog.ts +255 -0
- package/src/formats/iana-time-zone.ts +117 -0
- package/src/formats/iso3166-1.ts +78 -0
- package/src/formats/iso4217.ts +42 -0
- package/src/formats/iso639-1.ts +41 -0
- package/src/formats/uts35.ts +143 -0
- package/src/index.ts +5 -0
- package/src/meta/column.ts +22 -9
- package/src/pg/columns.ts +6 -4
- package/src/sqlite/columns.ts +6 -4
- package/src/sqlite/constraints.ts +120 -6
- package/types/codegen/analyzer-types.d.ts +6 -1
- package/types/codegen/analyzer-types.d.ts.map +1 -1
- package/types/codegen/annotations.d.ts +12 -7
- package/types/codegen/annotations.d.ts.map +1 -1
- package/types/codegen/format-constraints.d.ts +22 -0
- package/types/codegen/format-constraints.d.ts.map +1 -0
- package/types/codegen/generators/dtos/entity-file.d.ts.map +1 -1
- package/types/codegen/generators/dtos/example-meta.d.ts.map +1 -1
- package/types/codegen/generators/dtos/field-schema.d.ts.map +1 -1
- package/types/codegen/generators/dtos/ip-patterns.d.ts +7 -0
- package/types/codegen/generators/dtos/ip-patterns.d.ts.map +1 -1
- package/types/codegen/generators/dtos/number-range.d.ts +8 -0
- package/types/codegen/generators/dtos/number-range.d.ts.map +1 -1
- package/types/codegen/generators/dtos/schema-aliases.d.ts +1 -1
- package/types/codegen/generators/dtos/schema-aliases.d.ts.map +1 -1
- package/types/codegen/generators/dtos/text-format.d.ts +31 -0
- package/types/codegen/generators/dtos/text-format.d.ts.map +1 -0
- package/types/codegen/generators/dtos/text-schema.d.ts +8 -1
- package/types/codegen/generators/dtos/text-schema.d.ts.map +1 -1
- package/types/codegen/generators/manifest.d.ts +5 -0
- package/types/codegen/generators/manifest.d.ts.map +1 -1
- package/types/codegen/runtime/read-comb.d.ts +17 -3
- package/types/codegen/runtime/read-comb.d.ts.map +1 -1
- package/types/codegen/runtime/read-tables.d.ts.map +1 -1
- package/types/codegen/runtime/snapshot-types.d.ts +3 -1
- package/types/codegen/runtime/snapshot-types.d.ts.map +1 -1
- package/types/codegen/runtime/to-meta.d.ts.map +1 -1
- package/types/formats/catalog.d.ts +51 -0
- package/types/formats/catalog.d.ts.map +1 -0
- package/types/formats/iana-time-zone.d.ts +7 -0
- package/types/formats/iana-time-zone.d.ts.map +1 -0
- package/types/formats/iso3166-1.d.ts +12 -0
- package/types/formats/iso3166-1.d.ts.map +1 -0
- package/types/formats/iso4217.d.ts +7 -0
- package/types/formats/iso4217.d.ts.map +1 -0
- package/types/formats/iso639-1.d.ts +6 -0
- package/types/formats/iso639-1.d.ts.map +1 -0
- package/types/formats/uts35.d.ts +13 -0
- package/types/formats/uts35.d.ts.map +1 -0
- package/types/index.d.ts +5 -0
- package/types/index.d.ts.map +1 -1
- package/types/meta/column.d.ts +7 -1
- package/types/meta/column.d.ts.map +1 -1
- package/types/pg/columns.d.ts +3 -3
- package/types/pg/columns.d.ts.map +1 -1
- package/types/sqlite/columns.d.ts +3 -3
- package/types/sqlite/columns.d.ts.map +1 -1
- package/types/sqlite/constraints.d.ts +117 -5
- package/types/sqlite/constraints.d.ts.map +1 -1
- package/src/sqlite/patterns.ts +0 -19
- package/types/sqlite/patterns.d.ts +0 -19
- package/types/sqlite/patterns.d.ts.map +0 -1
|
@@ -8,9 +8,12 @@ import type { ConstantValue, FieldConstraintsMeta } from "./analyzer-types.ts";
|
|
|
8
8
|
/** Field constraints extracted from type arguments */
|
|
9
9
|
export type FieldConstraints = FieldConstraintsMeta;
|
|
10
10
|
export declare const NUMBER_KEYS: readonly ["autogenerate", "max", "min", "mutable", "nomutate", "private", "relation", "tenant"];
|
|
11
|
+
export declare const REAL_KEYS: readonly ["autogenerate", "max", "min", "mutable", "nomutate", "private", "relation", "schema", "tenant"];
|
|
12
|
+
export declare const INTEGER_KEYS: readonly ["autogenerate", "format", "max", "min", "mutable", "nomutate", "private", "relation", "schema", "tenant"];
|
|
11
13
|
export declare const JSON_KEYS: readonly ["autogenerate", "maxBytes", "mutable", "nomutate", "private", "relation", "tenant"];
|
|
12
|
-
export declare const ENUM_KEYS: readonly ["nomutate", "private", "tenant"];
|
|
13
|
-
export declare const
|
|
14
|
+
export declare const ENUM_KEYS: readonly ["format", "nomutate", "private", "tenant"];
|
|
15
|
+
export declare const REF_KEYS: readonly ["autogenerate", "email", "imageUri", "lowercase", "max", "min", "mutable", "name", "nomutate", "password", "pattern", "private", "relation", "tenant", "trim", "uppercase", "url"];
|
|
16
|
+
export declare const TEXT_KEYS: readonly ["autogenerate", "email", "format", "imageUri", "lowercase", "max", "min", "mutable", "name", "nomutate", "password", "pattern", "private", "relation", "schema", "tenant", "trim", "uppercase", "url"];
|
|
14
17
|
type Keys = typeof NUMBER_KEYS;
|
|
15
18
|
type None = readonly [];
|
|
16
19
|
/** The constraint keys each c helper takes, its constraint type's; a state machine is c.enum's own */
|
|
@@ -20,10 +23,10 @@ export type ConstraintKeys = {
|
|
|
20
23
|
readonly deletedAt: Keys;
|
|
21
24
|
readonly enum: typeof ENUM_KEYS;
|
|
22
25
|
readonly id: None;
|
|
23
|
-
readonly integer:
|
|
26
|
+
readonly integer: typeof INTEGER_KEYS;
|
|
24
27
|
readonly json: typeof JSON_KEYS;
|
|
25
|
-
readonly real:
|
|
26
|
-
readonly ref: typeof
|
|
28
|
+
readonly real: typeof REAL_KEYS;
|
|
29
|
+
readonly ref: typeof REF_KEYS;
|
|
27
30
|
readonly serialId: None;
|
|
28
31
|
readonly text: typeof TEXT_KEYS;
|
|
29
32
|
readonly timestamp: Keys;
|
|
@@ -33,9 +36,9 @@ export declare const CONSTRAINT_KEYS: ConstraintKeys;
|
|
|
33
36
|
/**
|
|
34
37
|
* A column's declared constraints, checked and with comb's defaults applied. Throws on a key the
|
|
35
38
|
* helper does not take, a value of the wrong type, two keys that contradict, or bounds no value
|
|
36
|
-
* meets, each message prefixed with `place`
|
|
39
|
+
* meets, or a format the helper cannot hold, each message prefixed with `place`
|
|
37
40
|
*/
|
|
38
|
-
export declare function fieldConstraintsOf(constraints: Readonly<Record<string, ConstantValue>>, { fieldName, filled, helper, measure, place, }: {
|
|
41
|
+
export declare function fieldConstraintsOf(constraints: Readonly<Record<string, ConstantValue>>, { fieldName, filled, helper, measure, place, values, }: {
|
|
39
42
|
/** the column's property name; one starting with `_` is private */
|
|
40
43
|
fieldName: string;
|
|
41
44
|
/** whether something other than the caller fills the column, a `c.createdAt`, `c.updatedAt` or `c.deletedAt` column, or a timestamp key's default or update hook, which turns `autogenerate` on unless it is declared false */
|
|
@@ -46,6 +49,8 @@ export declare function fieldConstraintsOf(constraints: Readonly<Record<string,
|
|
|
46
49
|
measure: "length" | "value";
|
|
47
50
|
/** where the column is declared, as each error message names it */
|
|
48
51
|
place: string;
|
|
52
|
+
/** the column's enum values, each of which a c.enum's format must take; null when it has none */
|
|
53
|
+
values: readonly string[] | null;
|
|
49
54
|
}): FieldConstraints;
|
|
50
55
|
export {};
|
|
51
56
|
//# sourceMappingURL=annotations.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"annotations.d.ts","sourceRoot":"","sources":["../../src/codegen/annotations.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAA;AACvD,OAAO,KAAK,EAAE,aAAa,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAA;
|
|
1
|
+
{"version":3,"file":"annotations.d.ts","sourceRoot":"","sources":["../../src/codegen/annotations.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAA;AACvD,OAAO,KAAK,EAAE,aAAa,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAA;AAI9E,sDAAsD;AACtD,MAAM,MAAM,gBAAgB,GAAG,oBAAoB,CAAA;AAInD,eAAO,MAAM,WAAW,YACvB,cAAc,EACd,KAAK,EACL,KAAK,EACL,SAAS,EACT,UAAU,EACV,SAAS,EACT,UAAU,EACV,QAAQ,CACC,CAAA;AAEV,eAAO,MAAM,SAAS,YACrB,cAAc,EACd,KAAK,EACL,KAAK,EACL,SAAS,EACT,UAAU,EACV,SAAS,EACT,UAAU,EACV,QAAQ,EACR,QAAQ,CACC,CAAA;AAEV,eAAO,MAAM,YAAY,YACxB,cAAc,EACd,QAAQ,EACR,KAAK,EACL,KAAK,EACL,SAAS,EACT,UAAU,EACV,SAAS,EACT,UAAU,EACV,QAAQ,EACR,QAAQ,CACC,CAAA;AACV,eAAO,MAAM,SAAS,YAAI,cAAc,EAAE,UAAU,EAAE,SAAS,EAAE,UAAU,EAAE,SAAS,EAAE,UAAU,EAAE,QAAQ,CAAU,CAAA;AACtH,eAAO,MAAM,SAAS,YAAI,QAAQ,EAAE,UAAU,EAAE,SAAS,EAAE,QAAQ,CAAU,CAAA;AAE7E,eAAO,MAAM,QAAQ,YACpB,cAAc,EACd,OAAO,EACP,UAAU,EACV,WAAW,EACX,KAAK,EACL,KAAK,EACL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AAC,MAAM,CAAC,MAAM,EAAE,aAAa,CAAC,CAAC,EACpD,EACC,SAAS,EACT,MAAM,EACN,MAAM,EACN,OAAO,EACP,KAAK,EACL,MAAM,GACN,EAAE;IACF,mEAAmE;IACnE,SAAS,EAAE,MAAM,CAAA;IACjB,+NAA+N;IAC/N,MAAM,EAAE,OAAO,CAAA;IACf,qIAAqI;IACrI,MAAM,EAAE,cAAc,GAAG,IAAI,CAAA;IAC7B,uEAAuE;IACvE,OAAO,EAAE,QAAQ,GAAG,OAAO,CAAA;IAC3B,mEAAmE;IACnE,KAAK,EAAE,MAAM,CAAA;IACb,iGAAiG;IACjG,MAAM,EAAE,SAAS,MAAM,EAAE,GAAG,IAAI,CAAA;CAChC,GACC,gBAAgB,CA4BlB"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A column's `format` checked against its helper and its other keys: a format sets a text's
|
|
3
|
+
* pattern, case, trim and length and an integer's range, so a transform or a bound it already
|
|
4
|
+
* holds beside it is a second rule a reader of the tables file believes; an enum's values are
|
|
5
|
+
* checked against it here, at codegen, since the DTO is the enum itself.
|
|
6
|
+
*/
|
|
7
|
+
import { type IntegerFormat, type TextFormat } from "../formats/catalog.ts";
|
|
8
|
+
import type { CombColumnKind } from "../meta/column.ts";
|
|
9
|
+
import type { ConstantValue } from "./analyzer-types.ts";
|
|
10
|
+
/**
|
|
11
|
+
* The format a column declares, checked against its helper: an id the helper's kind knows (an
|
|
12
|
+
* integer format on c.integer, a text format on c.text and c.enum), no transform or bound the
|
|
13
|
+
* format already sets or that leaves it no value, and every c.enum value one the format takes as
|
|
14
|
+
* written. Null when none is declared; an error at `place` otherwise. The helper key check refuses a
|
|
15
|
+
* format on any other helper first, and a text's kind check one beside a kind
|
|
16
|
+
*/
|
|
17
|
+
export declare function formatOf(constraints: Readonly<Record<string, ConstantValue>>, { helper, place, values }: {
|
|
18
|
+
helper: CombColumnKind | null;
|
|
19
|
+
place: string;
|
|
20
|
+
values: readonly string[] | null;
|
|
21
|
+
}): IntegerFormat | TextFormat | null;
|
|
22
|
+
//# sourceMappingURL=format-constraints.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"format-constraints.d.ts","sourceRoot":"","sources":["../../src/codegen/format-constraints.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,EAKN,KAAK,aAAa,EAElB,KAAK,UAAU,EACf,MAAM,uBAAuB,CAAA;AAC9B,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAA;AACvD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAA;AA8DxD;;;;;;GAMG;AACH,wBAAgB,QAAQ,CACvB,WAAW,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,aAAa,CAAC,CAAC,EACpD,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,EAAE;IAAE,MAAM,EAAE,cAAc,GAAG,IAAI,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,SAAS,MAAM,EAAE,GAAG,IAAI,CAAA;CAAE,GAC3G,aAAa,GAAG,UAAU,GAAG,IAAI,CAyBnC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"entity-file.d.ts","sourceRoot":"","sources":["../../../../src/codegen/generators/dtos/entity-file.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAA;AAGxD,OAAO,KAAK,EAAa,UAAU,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAA;AAGpF,OAAO,EAAE,KAAK,WAAW,EAAwB,MAAM,sBAAsB,CAAA;AAE7E,eAAO,MAAM,MAAM,EAAE,MAAM,CAAC,UAAU,EAAE,MAAM,CAK7C,CAAA;AAQD,MAAM,MAAM,iBAAiB,GAAG;IAC/B,qFAAqF;IACrF,SAAS,EAAE,MAAM,CAAA;IACjB,UAAU,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C1B,aAAa,EAAE,GAAG,CAAC,MAAM,EAAE,YAAY,CAAC,CAAA;CACxC,CAAA;AAuDD,6FAA6F;AAC7F,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,SAAS,EAAE,EAAE,SAAS,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,WAAW,GAAG,SAAS,GAAG,MAAM,EAAE,CAkBjH;AAiGD,+DAA+D;AAC/D,eAAO,MAAM,eAAe,UAAW,SAAS,UAAU,GAAG,CAAC,MAAM,EAAE,YAAY,CAAC,KAAG,MAAM,EAC9C,CAAA;AAE9C;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,SAAS,EAAE,OAAO,EAAE,iBAAiB,GAAG,MAAM,CAcvF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"example-meta.d.ts","sourceRoot":"","sources":["../../../../src/codegen/generators/dtos/example-meta.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAA;
|
|
1
|
+
{"version":3,"file":"example-meta.d.ts","sourceRoot":"","sources":["../../../../src/codegen/generators/dtos/example-meta.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAA;AAQxD;;;GAGG;AACH,eAAO,MAAM,gBAAgB,YAC5B,SAAS,EACT,OAAO,EACP,SAAS,EACT,MAAM,EACN,UAAU,EACV,QAAQ,EACR,WAAW,EACX,KAAK,CACI,CAAA;AACV,KAAK,aAAa,GAAG,CAAC,OAAO,gBAAgB,CAAC,CAAC,MAAM,CAAC,CAAA;AAEtD,eAAO,MAAM,kBAAkB,EAAE,MAAM,CAAC,aAAa,EAAE,MAAM,CAS5D,CAAA;AAED;;;GAGG;AACH,eAAO,MAAM,cAAc;aAC1B,OAAO,EAAE,8BAA8B;aACvC,IAAI,EAAE,0BAA0B;CACvB,CAAA;AAEV,MAAM,MAAM,aAAa,GAAG;IAC3B,8EAA8E;IAC9E,IAAI,EAAE,MAAM,CAAA;IACZ,gFAAgF;IAChF,eAAe,EAAE,OAAO,CAAA;CACxB,CAAA;AA2HD;;;GAGG;AACH,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,SAAS,GAAG,aAAa,GAAG,IAAI,CAO1E"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"field-schema.d.ts","sourceRoot":"","sources":["../../../../src/codegen/generators/dtos/field-schema.ts"],"names":[],"mappings":"AAAA,mGAAmG;AACnG,OAAO,KAAK,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAA;AAIrE,OAAO,EAAa,KAAK,KAAK,EAAwB,MAAM,kBAAkB,CAAA;AAC9E,OAAO,KAAK,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAA;
|
|
1
|
+
{"version":3,"file":"field-schema.d.ts","sourceRoot":"","sources":["../../../../src/codegen/generators/dtos/field-schema.ts"],"names":[],"mappings":"AAAA,mGAAmG;AACnG,OAAO,KAAK,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAA;AAIrE,OAAO,EAAa,KAAK,KAAK,EAAwB,MAAM,kBAAkB,CAAA;AAC9E,OAAO,KAAK,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAA;AAuL5D,KAAK,kBAAkB,GAAG;IAAE,OAAO,CAAC,EAAE,UAAU,GAAG,QAAQ,GAAG,SAAS,CAAC;IAAC,OAAO,EAAE,WAAW,CAAA;CAAE,CAAA;AAE/F;;;;GAIG;AACH,wBAAgB,aAAa,CAC5B,KAAK,EAAE,SAAS,EAChB,UAAU,EAAE,UAAU,EACtB,EAAE,OAAkB,EAAE,OAAO,EAAE,EAAE,kBAAkB,GACjD;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,SAAS,UAAU,EAAE,CAAA;CAAE,GAAG,IAAI,CAgBtD;AAED,+FAA+F;AAC/F,eAAO,MAAM,mBAAmB,UACxB,SAAS,cACJ,UAAU,WACb,kBAAkB,KACzB,MAAM,GAAG,IAA+D,CAAA;AA4B3E,4FAA4F;AAC5F,MAAM,MAAM,UAAU,GAAG;IAAE,GAAG,EAAE,MAAM,GAAG,IAAI,CAAC;IAAC,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IAAC,GAAG,EAAE,MAAM,GAAG,IAAI,CAAC;IAAC,QAAQ,EAAE,MAAM,EAAE,CAAA;CAAE,CAAA;AAKhH;;;;;GAKG;AACH,wBAAgB,UAAU,CAAC,KAAK,EAAE,SAAS,EAAE,OAAO,EAAE,KAAK,CAAC,SAAS,CAAC,GAAG,UAAU,CASlF"}
|
|
@@ -4,4 +4,11 @@ export declare const ipv6Rule: () => string;
|
|
|
4
4
|
export declare const cidrv6Rule: () => string;
|
|
5
5
|
/** A plain inet's rule: a host address, its netmask optional */
|
|
6
6
|
export declare const inetRule: () => string;
|
|
7
|
+
/**
|
|
8
|
+
* An IPv6 address as RFC 4291 §2.2 writes one, unanchored: Postgres's rule but an IPv4 tail of four
|
|
9
|
+
* octets, never two or three, so `::ffff:1.2` is refused. The `ipv6` and `ip` text formats' source
|
|
10
|
+
*/
|
|
11
|
+
export declare const strictIpv6Source: () => string;
|
|
12
|
+
/** An IPv4 address as a dotted quad, unanchored: the `ipv4` and `ip` text formats' source */
|
|
13
|
+
export declare const ipv4Source: () => string;
|
|
7
14
|
//# sourceMappingURL=ip-patterns.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ip-patterns.d.ts","sourceRoot":"","sources":["../../../../src/codegen/generators/dtos/ip-patterns.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ip-patterns.d.ts","sourceRoot":"","sources":["../../../../src/codegen/generators/dtos/ip-patterns.ts"],"names":[],"mappings":"AA6CA,oDAAoD;AACpD,eAAO,MAAM,QAAQ,QAAO,MAA0E,CAAA;AAEtG,8FAA8F;AAC9F,eAAO,MAAM,UAAU,QAAO,MAAwF,CAAA;AAEtH,gEAAgE;AAChE,eAAO,MAAM,QAAQ,QAAO,MAC0E,CAAA;AAEtG;;;GAGG;AACH,eAAO,MAAM,gBAAgB,QAAO,MAA8B,CAAA;AAElE,6FAA6F;AAC7F,eAAO,MAAM,UAAU,QAAO,MAAc,CAAA"}
|
|
@@ -15,6 +15,14 @@ export declare const SAFE: Range;
|
|
|
15
15
|
export declare const boundCode: (bound: number) => string;
|
|
16
16
|
/** The range an integer column holds, by what the dialect stores it in */
|
|
17
17
|
export declare function integerRange(field: FieldMeta, dialect: Build["dialect"]): Range;
|
|
18
|
+
/**
|
|
19
|
+
* The bounds a written number is declared to: its own, joined with its integer format's range, the
|
|
20
|
+
* tighter of each pair winning
|
|
21
|
+
*/
|
|
22
|
+
export declare function declaredBounds({ format, max, min }: FieldConstraints): {
|
|
23
|
+
max: number | null;
|
|
24
|
+
min: number | null;
|
|
25
|
+
};
|
|
18
26
|
/** A declared bound clamped to the column's, the column's where none is declared */
|
|
19
27
|
export declare const clamp: (declared: number | null, bound: number, pick: (a: number, b: number) => number) => number;
|
|
20
28
|
/** Refuses an integer's bounds, clamped to what the column holds, that leave no integer: every write would be refused */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"number-range.d.ts","sourceRoot":"","sources":["../../../../src/codegen/generators/dtos/number-range.ts"],"names":[],"mappings":"AAAA,wHAAwH;AACxH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAA;AACxD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAA;
|
|
1
|
+
{"version":3,"file":"number-range.d.ts","sourceRoot":"","sources":["../../../../src/codegen/generators/dtos/number-range.ts"],"names":[],"mappings":"AAAA,wHAAwH;AACxH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAA;AACxD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAA;A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
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { AnalysisResult } from "../../analyzer-types.ts";
|
|
2
2
|
/**
|
|
3
|
-
* The analysis with each
|
|
3
|
+
* The analysis with each column schema import under a local name of its own in every file it is
|
|
4
4
|
* imported into; `root` the project's, which a module's path is taken from
|
|
5
5
|
*/
|
|
6
6
|
declare function aliasSchemaImports(analysis: AnalysisResult, root: string): AnalysisResult;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema-aliases.d.ts","sourceRoot":"","sources":["../../../../src/codegen/generators/dtos/schema-aliases.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"schema-aliases.d.ts","sourceRoot":"","sources":["../../../../src/codegen/generators/dtos/schema-aliases.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,cAAc,EAAa,MAAM,yBAAyB,CAAA;AA6BxE;;;GAGG;AACH,iBAAS,kBAAkB,CAAC,QAAQ,EAAE,cAAc,EAAE,IAAI,EAAE,MAAM,GAAG,cAAc,CAkDlF;AAED,OAAO,EAAE,kBAAkB,EAAE,CAAA"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A text column's standard format in its DTO: one check that pushes zod's `invalid_format` issue
|
|
3
|
+
* with the format's id and no message, so zod's locale or the consumer's error map words it, and
|
|
4
|
+
* the source and length bounds it holds the value to, published as the format's own. Every format
|
|
5
|
+
* is read from the catalog's spec map alone.
|
|
6
|
+
*/
|
|
7
|
+
import type { FieldConstraints } from "../../annotations.ts";
|
|
8
|
+
import { type FormatSpec, type TextFormat } from "../../../formats/catalog.ts";
|
|
9
|
+
/** A declared text format: its id beside its spec */
|
|
10
|
+
export type DeclaredFormat = {
|
|
11
|
+
id: TextFormat;
|
|
12
|
+
spec: FormatSpec;
|
|
13
|
+
};
|
|
14
|
+
/** The format a text declares; null when it declares none */
|
|
15
|
+
export declare function textFormatOf({ format }: FieldConstraints): DeclaredFormat | null;
|
|
16
|
+
/** A format's source as the regex literal comb builds from it under u, as the manifest states a pattern */
|
|
17
|
+
export declare const sourceLiteral: (source: string) => string;
|
|
18
|
+
/**
|
|
19
|
+
* The format's check and what it publishes: its source as `pattern`, or, beside a declared pattern
|
|
20
|
+
* zod publishes as `pattern` itself (`declaresPattern`), in an `allOf`, and its length bounds
|
|
21
|
+
*/
|
|
22
|
+
export declare function formatCheck({ id, spec }: DeclaredFormat, declaresPattern: boolean): string;
|
|
23
|
+
/** The bounds of `range` the format's own leave to a check of zod's: those tighter than its */
|
|
24
|
+
export declare const tighterBounds: ({ max, min }: {
|
|
25
|
+
max: number | null;
|
|
26
|
+
min: number | null;
|
|
27
|
+
}, spec: FormatSpec) => {
|
|
28
|
+
max: number | null;
|
|
29
|
+
min: number | null;
|
|
30
|
+
};
|
|
31
|
+
//# sourceMappingURL=text-format.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"text-format.d.ts","sourceRoot":"","sources":["../../../../src/codegen/generators/dtos/text-format.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAA;AAC5D,OAAO,EAAW,KAAK,UAAU,EAAE,KAAK,UAAU,EAAE,MAAM,6BAA6B,CAAA;AAIvF,qDAAqD;AACrD,MAAM,MAAM,cAAc,GAAG;IAAE,EAAE,EAAE,UAAU,CAAC;IAAC,IAAI,EAAE,UAAU,CAAA;CAAE,CAAA;AAMjE,6DAA6D;AAC7D,wBAAgB,YAAY,CAAC,EAAE,MAAM,EAAE,EAAE,gBAAgB,GAAG,cAAc,GAAG,IAAI,CAEhF;AAED,2GAA2G;AAC3G,eAAO,MAAM,aAAa,WAAY,MAAM,KAAG,MAAgD,CAAA;AAqB/F;;;GAGG;AACH,wBAAgB,WAAW,CAAC,EAAE,EAAE,EAAE,IAAI,EAAE,EAAE,cAAc,EAAE,eAAe,EAAE,OAAO,GAAG,MAAM,CAI1F;AAED,+FAA+F;AAC/F,eAAO,MAAM,aAAa,iBACX;IAAE,GAAG,EAAE,MAAM,GAAG,IAAI,CAAC;IAAC,GAAG,EAAE,MAAM,GAAG,IAAI,CAAA;CAAE,QAClD,UAAU,KACd;IAAE,GAAG,EAAE,MAAM,GAAG,IAAI,CAAC;IAAC,GAAG,EAAE,MAAM,GAAG,IAAI,CAAA;CAGzC,CAAA"}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/** The Zod expression of a text column: its kind, transforms and bounds, by schema type. */
|
|
2
1
|
import type { FieldConstraints } from "../../annotations.ts";
|
|
3
2
|
import type { FieldMeta } from "../../analyzer-types.ts";
|
|
4
3
|
import { type Base, type Build } from "./build-types.ts";
|
|
@@ -40,5 +39,13 @@ export type TextRules = TextRange & {
|
|
|
40
39
|
* them. An email's own check is its format, which the manifest's textKind names
|
|
41
40
|
*/
|
|
42
41
|
export declare function textRules(annotations: FieldConstraints, field: FieldMeta): TextRules;
|
|
42
|
+
/**
|
|
43
|
+
* The `allOf` a written text's own chain publishes: the pattern of each of two or more regexes, as
|
|
44
|
+
* zod writes them in the order they are checked, z.email()'s first, or a format's source beside a
|
|
45
|
+
* declared pattern. A schema's `allOf`, written over the chain's, carries these first
|
|
46
|
+
*/
|
|
47
|
+
export declare function chainAllOf(build: Build): Array<{
|
|
48
|
+
pattern: string;
|
|
49
|
+
}>;
|
|
43
50
|
export {};
|
|
44
51
|
//# sourceMappingURL=text-schema.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"text-schema.d.ts","sourceRoot":"","sources":["../../../../src/codegen/generators/dtos/text-schema.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"text-schema.d.ts","sourceRoot":"","sources":["../../../../src/codegen/generators/dtos/text-schema.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAA;AAC5D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAA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4 +1,5 @@
|
|
|
1
1
|
import type { TableMeta } from "../analyzer-types.ts";
|
|
2
|
+
import type { IntegerFormat, TextFormat } from "../../formats/catalog.ts";
|
|
2
3
|
import type { GeneratorContext } from "./context-types.ts";
|
|
3
4
|
/**
|
|
4
5
|
* Manifest format version.
|
|
@@ -42,6 +43,10 @@ type ManifestColumn = {
|
|
|
42
43
|
min: number | null;
|
|
43
44
|
/** Every regex a written text must match, its kind's and the declared one, as JavaScript regex literals; a plain Postgres type's rule is its `kind` and `sqlType`'s */
|
|
44
45
|
patterns: string[];
|
|
46
|
+
/** The standard format a written value is checked against (`iso4217`, `iso8601-weekday`), by its id; null when the column declares none */
|
|
47
|
+
format: TextFormat | IntegerFormat | null;
|
|
48
|
+
/** The export name of the zod schema a text or number column declares, which a write runs after the column's own rules; null when none, and on a c.json column, whose schema is its value's shape rather than a rule beside it */
|
|
49
|
+
schema: string | null;
|
|
45
50
|
/** A text column's format, null for any other */
|
|
46
51
|
textKind: "email" | "imageUri" | "name" | "password" | "url" | null;
|
|
47
52
|
/** The rewrites a written value takes before `min`, `max` and `patterns` bind it, in order: the DTO's own list (meta-contract §2.1) */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"manifest.d.ts","sourceRoot":"","sources":["../../../src/codegen/generators/manifest.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"manifest.d.ts","sourceRoot":"","sources":["../../../src/codegen/generators/manifest.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAwB,SAAS,EAAE,MAAM,sBAAsB,CAAA;AAC3E,OAAO,KAAK,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAA;AAEzE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAA;AAK1D;;;;;;GAMG;AACH,QAAA,MAAM,gBAAgB,IAAI,CAAA;AAE1B,0EAA0E;AAC1E,KAAK,cAAc,GAAG;IACrB,2DAA2D;IAC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MAAM,CAAA;QACZ,mDAAmD;QACnD,OAAO,EAAE,MAAM,EAAE,CAAA;QACjB,oDAAoD;QACpD,KAAK,EAAE,MAAM,CAAA;KACb,EAAE,CAAA;IACH,oCAAoC;IACpC,gBAAgB,EAAE;QACjB,6DAA6D;QAC7D,IAAI,EAAE,MAAM,CAAA;QACZ,gDAAgD;QAChD,UAAU,EAAE,MAAM,CAAA;KAClB,EAAE,CAAA;CACH,CAAA;AAED,+DAA+D;AAC/D,KAAK,QAAQ,GAAG;IACf,8HAA8H;IAC9H,CAAC,EAAE,MAAM,CAAA;IACT,6IAA6I;IAC7I,QAAQ,EAAE,MAAM,CAAA;IAChB,0FAA0F;IAC1F,QAAQ,EAAE,cAAc,EAAE,CAAA;CAC1B,CAAA;AAED,0CAA0C;AAC1C,KAAK,cAAc,GAAG;IACrB,uEAAuE;IACvE,MAAM,EAAE,MAAM,CAAA;CACd,CAAA;AAmFD;;;;;;GAMG;AACH,iBAAS,aAAa,CAAC,MAAM,EAAE,SAAS,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,gBAAgB,CAAC,SAAS,CAAC,GAAG,QAAQ,CAS1G;AAED,2DAA2D;AAC3D,iBAAS,gBAAgB,CAAC,GAAG,EAAE,gBAAgB,EAAE,MAAM,EAAE,cAAc,GAAG,IAAI,CAQ7E;AAED,OAAO,EACN,aAAa,EACb,gBAAgB,EAChB,KAAK,QAAQ,EACb,KAAK,cAAc,EACnB,KAAK,cAAc,EACnB,KAAK,cAAc,EACnB,KAAK,gBAAgB,EACrB,gBAAgB,GAChB,CAAA"}
|
|
@@ -1,8 +1,22 @@
|
|
|
1
|
-
|
|
2
|
-
import type { SnapshotComb } from "./snapshot-types.ts";
|
|
1
|
+
import type { CombColumnMeta } from "../../meta/column.ts";
|
|
2
|
+
import type { ModuleExport, SnapshotComb } from "./snapshot-types.ts";
|
|
3
3
|
declare const STRING_LIST: (value: unknown) => value is string[];
|
|
4
4
|
/** A c helper's constraints as JSON, every value a primitive; an error naming the column otherwise */
|
|
5
5
|
declare function constraintsOf(raw: unknown, at: string): Record<string, boolean | number | string>;
|
|
6
|
+
/** The packages a schema found nowhere might have been in, as its error names them; empty when every module loaded */
|
|
7
|
+
declare const skipped: (unloaded: readonly string[]) => string;
|
|
8
|
+
/**
|
|
9
|
+
* A helper's constraints with its `schema` key read: on a text or number column, taken out for the
|
|
10
|
+
* export that holds it and its input JSON Schema; on any other helper, kept as `true` for the
|
|
11
|
+
* constraint check to refuse. An error naming the column for a value that is no zod schema, and
|
|
12
|
+
* for one no module exports, naming the modules that would not load (`unloaded`)
|
|
13
|
+
*/
|
|
14
|
+
declare function columnSchemaOf(meta: CombColumnMeta, at: string, { locate, unloaded }: {
|
|
15
|
+
locate: (value: unknown) => ModuleExport | null;
|
|
16
|
+
unloaded: readonly string[];
|
|
17
|
+
}): Pick<SnapshotComb, "schema" | "schemaJson"> & {
|
|
18
|
+
constraints: Record<string, unknown>;
|
|
19
|
+
};
|
|
6
20
|
/** What fills a column a write leaves out: a value or SQL default, a default function, an update function */
|
|
7
21
|
type Fill = {
|
|
8
22
|
default?: unknown;
|
|
@@ -27,5 +41,5 @@ declare function refuseJsonDocument(schema: unknown, at: string, { filled, notNu
|
|
|
27
41
|
filled: boolean;
|
|
28
42
|
notNull: boolean;
|
|
29
43
|
}): void;
|
|
30
|
-
export { constraintsOf, refuseJsonDocument, statesOf, STRING_LIST };
|
|
44
|
+
export { columnSchemaOf, constraintsOf, refuseJsonDocument, skipped, statesOf, STRING_LIST };
|
|
31
45
|
//# sourceMappingURL=read-comb.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"read-comb.d.ts","sourceRoot":"","sources":["../../../src/codegen/runtime/read-comb.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"read-comb.d.ts","sourceRoot":"","sources":["../../../src/codegen/runtime/read-comb.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM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,OAAO,CAAC;IAAC,OAAO,EAAE,OAAO,CAAA;CAAE,GACxD,IAAI,CAeN;AAED,OAAO,EAAE,cAAc,EAAE,aAAa,EAAE,kBAAkB,EAAE,OAAO,EAAE,QAAQ,EAAE,WAAW,EAAE,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"read-tables.d.ts","sourceRoot":"","sources":["../../../src/codegen/runtime/read-tables.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAA;AACtD,OAAO,KAAK,EACX,YAAY,EACZ,QAAQ,EAKR,MAAM,qBAAqB,CAAA;AAE5B,KAAK,SAAS,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;AACxC,KAAK,MAAM,GAAG;IAAE,QAAQ,EAAE,OAAO,CAAC;IAAC,MAAM,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,SAAS,CAAA;CAAE,CAAA;AAEzE,2HAA2H;AAC3H,iBAAS,cAAc,CAAC,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE,SAAS,MAAM,EAAE,EAAE,UAAU,EAAE,MAAM,GAAG,YAAY,EAAE,CAcrG;
|
|
1
|
+
{"version":3,"file":"read-tables.d.ts","sourceRoot":"","sources":["../../../src/codegen/runtime/read-tables.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAA;AACtD,OAAO,KAAK,EACX,YAAY,EACZ,QAAQ,EAKR,MAAM,qBAAqB,CAAA;AAE5B,KAAK,SAAS,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;AACxC,KAAK,MAAM,GAAG;IAAE,QAAQ,EAAE,OAAO,CAAC;IAAC,MAAM,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,SAAS,CAAA;CAAE,CAAA;AAEzE,2HAA2H;AAC3H,iBAAS,cAAc,CAAC,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE,SAAS,MAAM,EAAE,EAAE,UAAU,EAAE,MAAM,GAAG,YAAY,EAAE,CAcrG;AAwMD;;;GAGG;AACH,iBAAS,UAAU,CAAC,MAAM,EAAE,SAAS,MAAM,EAAE,EAAE,YAAY,EAAE,YAAY,EAAE,QAAQ,GAAE,SAAS,MAAM,EAAO,GAAG,QAAQ,CAerH;AAqBD,OAAO,EAAE,cAAc,EAAE,UAAU,EAAE,KAAK,MAAM,EAAE,KAAK,SAAS,EAAE,CAAA"}
|
|
@@ -16,8 +16,10 @@ type SnapshotComb = {
|
|
|
16
16
|
constraints: Record<string, boolean | number | string>;
|
|
17
17
|
kind: string;
|
|
18
18
|
prefix: string | null;
|
|
19
|
-
/** where the exact zod schema a c.json column was given is exported; null when
|
|
19
|
+
/** where the exact zod schema a c.json column, or a text or number column's `schema` key, was given is exported; null when none was given */
|
|
20
20
|
schema: ModuleExport | null;
|
|
21
|
+
/** a text or number column's schema as its input JSON Schema, self-contained (each `$defs` entry inlined) and `$schema` dropped; null on c.json and when undeclared */
|
|
22
|
+
schemaJson: Readonly<Record<string, unknown>> | null;
|
|
21
23
|
states: {
|
|
22
24
|
initial: string | null;
|
|
23
25
|
terminal: string[] | null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"snapshot-types.d.ts","sourceRoot":"","sources":["../../../src/codegen/runtime/snapshot-types.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;GAGG;AACH,KAAK,YAAY,GAAG;IAAE,QAAQ,EAAE,OAAO,CAAC;IAAC,MAAM,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,CAAA;AAEvE,wGAAwG;AACxG,KAAK,YAAY,GAAG;IACnB,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,GAAG,MAAM,GAAG,MAAM,CAAC,CAAA;IACtD,IAAI,EAAE,MAAM,CAAA;IACZ,MAAM,EAAE,MAAM,GAAG,IAAI,CAAA;IACrB,
|
|
1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AC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC,CAAA;IACnD,OAAO,EAAE,cAAc,EAAE,CAAA;IACzB,8DAA8D;IAC9D,YAAY,EAAE,MAAM,EAAE,CAAA;IACtB,OAAO,EAAE,UAAU,GAAG,QAAQ,CAAA;IAC9B,UAAU,EAAE,MAAM,CAAA;IAClB,OAAO,EAAE,aAAa,EAAE,CAAA;IACxB,yEAAyE;IACzE,MAAM,EAAE,MAAM,GAAG,IAAI,CAAA;IACrB,OAAO,EAAE,MAAM,CAAA;IACf,OAAO,EAAE,KAAK,CAAC;QAAE,OAAO,EAAE,MAAM,EAAE,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC,CAAA;CACnD,CAAA;AAED,KAAK,QAAQ,GAAG;IAAE,MAAM,EAAE,aAAa,EAAE,CAAA;CAAE,CAAA;AAE3C,YAAY,EAAE,YAAY,EAAE,QAAQ,EAAE,cAAc,EAAE,YAAY,EAAE,kBAAkB,EAAE,aAAa,EAAE,aAAa,EAAE,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"to-meta.d.ts","sourceRoot":"","sources":["../../../src/codegen/runtime/to-meta.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EACX,cAAc,EAOd,MAAM,sBAAsB,CAAA;AAI7B,OAAO,KAAK,EAAgB,QAAQ,EAAiC,MAAM,qBAAqB,CAAA;
|
|
1
|
+
{"version":3,"file":"to-meta.d.ts","sourceRoot":"","sources":["../../../src/codegen/runtime/to-meta.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EACX,cAAc,EAOd,MAAM,sBAAsB,CAAA;AAI7B,OAAO,KAAK,EAAgB,QAAQ,EAAiC,MAAM,qBAAqB,CAAA;AAmOhG,6HAA6H;AAC7H,iBAAS,UAAU,CAAC,QAAQ,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,GAAG,cAAc,CAoB1E;AAED,OAAO,EAAE,UAAU,EAAE,CAAA"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
/** The ids `c.text` and `c.enum` take as `format`, sorted by code unit */
|
|
2
|
+
export declare const TEXT_FORMATS: readonly ["base64url", "bcp47", "e164", "iana-time-zone", "ip", "ipv4", "ipv6", "iso3166-1-alpha-2", "iso3166-1-alpha-3", "iso4217", "iso639-1", "kebab-slug", "pkce-s256-challenge", "rfc1123-hostname", "semver", "sha256-hex", "sha512-hex", "srgb-hex", "srgb-hex-alpha", "ulid", "uts35-ca", "uts35-fw", "uts35-hc", "uts35-ms", "uts35-mu", "uts35-nu", "uuid", "uuid-v4", "uuid-v7"];
|
|
3
|
+
/** The ids `c.integer` takes as `format`, sorted by code unit */
|
|
4
|
+
export declare const INTEGER_FORMATS: readonly ["iso8601-month", "iso8601-weekday"];
|
|
5
|
+
/** A text format's id */
|
|
6
|
+
export type TextFormat = (typeof TEXT_FORMATS)[number];
|
|
7
|
+
/** An integer format's id */
|
|
8
|
+
export type IntegerFormat = (typeof INTEGER_FORMATS)[number];
|
|
9
|
+
/** The registry predicate a text format's value must also satisfy */
|
|
10
|
+
type Member = "isIanaTimeZone" | "isIso3166Alpha2" | "isIso3166Alpha3" | "isIso4217" | "isIso639Alpha2";
|
|
11
|
+
/** What a text format checks, after its transforms, on the value its DTO is given */
|
|
12
|
+
export type FormatSpec = {
|
|
13
|
+
/** The standard and the release it follows, as a person reads it */
|
|
14
|
+
readonly standard: string;
|
|
15
|
+
/** The anchored pattern the value matches, portable to RE2 and JavaScript's `u` flag */
|
|
16
|
+
readonly source: string;
|
|
17
|
+
/** The fewest characters a value has */
|
|
18
|
+
readonly min: number;
|
|
19
|
+
/** The most characters a value has, or null when the format sets no cap and a column declares one */
|
|
20
|
+
readonly max: number | null;
|
|
21
|
+
/** The transforms that run, in order, before the check */
|
|
22
|
+
readonly transform: readonly ("lowercase" | "trim" | "uppercase")[];
|
|
23
|
+
/** The pinned registry the value must belong to, by its predicate's name, or null when the source is the whole rule */
|
|
24
|
+
readonly member: Member | null;
|
|
25
|
+
/** A value of the format as written, which the format takes and a generated DTO publishes as its example */
|
|
26
|
+
readonly example: string;
|
|
27
|
+
};
|
|
28
|
+
/** The range an integer format's value lies in */
|
|
29
|
+
export type IntegerSpec = {
|
|
30
|
+
/** The standard that numbers the values, as a person reads it */
|
|
31
|
+
readonly standard: string;
|
|
32
|
+
/** The least value */
|
|
33
|
+
readonly min: number;
|
|
34
|
+
/** The greatest value */
|
|
35
|
+
readonly max: number;
|
|
36
|
+
};
|
|
37
|
+
/** Every text format's spec, by id */
|
|
38
|
+
export declare const FORMATS: {
|
|
39
|
+
readonly [F in TextFormat]: FormatSpec;
|
|
40
|
+
};
|
|
41
|
+
/** Every integer format's range, by id */
|
|
42
|
+
export declare const INTEGER_SPECS: {
|
|
43
|
+
readonly [F in IntegerFormat]: IntegerSpec;
|
|
44
|
+
};
|
|
45
|
+
/**
|
|
46
|
+
* Whether `format` takes `value` exactly as written, its transforms not run: within the format's
|
|
47
|
+
* length bounds, matching its source, and a member of its registry when it names one. Never throws.
|
|
48
|
+
*/
|
|
49
|
+
export declare function formatTakes(format: TextFormat, value: string): boolean;
|
|
50
|
+
export {};
|
|
51
|
+
//# sourceMappingURL=catalog.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"catalog.d.ts","sourceRoot":"","sources":["../../src/formats/catalog.ts"],"names":[],"mappings":"AAoBA,0EAA0E;AAC1E,eAAO,MAAM,YAAY,YACxB,WAAW,EACX,OAAO,EACP,MAAM,EACN,gBAAgB,EAChB,IAAI,EACJ,MAAM,EACN,MAAM,EACN,mBAAmB,EACnB,mBAAmB,EACnB,SAAS,EACT,UAAU,EACV,YAAY,EACZ,qBAAqB,EACrB,kBAAkB,EAClB,QAAQ,EACR,YAAY,EACZ,YAAY,EACZ,UAAU,EACV,gBAAgB,EAChB,MAAM,EACN,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,MAAM,EACN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EAAE,CAAC,IAAI,UAAU,GAAG,UAAU;CAA4B,CAAA;AAE1F,0CAA0C;AAC1C,eAAO,MAAM,aAAa,EAAE;IAAE,QAAQ,EAAE,CAAC,IAAI,aAAa,GAAG,WAAW;CAGvE,CAAA;AAUD;;;GAGG;AACH,wBAAgB,WAAW,CAAC,MAAM,EAAE,UAAU,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAKtE"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Whether `value` names a time zone of IANA tzdata 2026f, exactly as written: a zone or a link to one, such as
|
|
3
|
+
* Europe/Zagreb, America/Argentina/Buenos_Aires, Etc/GMT+5, UTC or US/Pacific. Case counts, and Factory, a
|
|
4
|
+
* placeholder, is no zone. Any string is taken; this never throws.
|
|
5
|
+
*/
|
|
6
|
+
export declare function isIanaTimeZone(value: string): boolean;
|
|
7
|
+
//# sourceMappingURL=iana-time-zone.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"iana-time-zone.d.ts","sourceRoot":"","sources":["../../src/formats/iana-time-zone.ts"],"names":[],"mappings":"AA6GA;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAErD"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Whether `value` is an officially assigned ISO 3166-1 alpha-2 country code, exactly as written: uppercase, such as
|
|
3
|
+
* HR or GB (UK is reserved, not assigned). The codes are those of Debian iso-codes v4.20.1. Any string is taken;
|
|
4
|
+
* this never throws.
|
|
5
|
+
*/
|
|
6
|
+
export declare function isIso3166Alpha2(value: string): boolean;
|
|
7
|
+
/**
|
|
8
|
+
* Whether `value` is an officially assigned ISO 3166-1 alpha-3 country code, exactly as written: uppercase, such as
|
|
9
|
+
* HRV or GBR. The codes are those of Debian iso-codes v4.20.1. Any string is taken; this never throws.
|
|
10
|
+
*/
|
|
11
|
+
export declare function isIso3166Alpha3(value: string): boolean;
|
|
12
|
+
//# sourceMappingURL=iso3166-1.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"iso3166-1.d.ts","sourceRoot":"","sources":["../../src/formats/iso3166-1.ts"],"names":[],"mappings":"AA8DA;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAEtD;AAED;;;GAGG;AACH,wBAAgB,eAAe,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAEtD"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Whether `value` is a current ISO 4217 alphabetic currency code, exactly as written: uppercase, such as EUR or USD.
|
|
3
|
+
* The codes are those of the list published 2026-09-17, fund and precious metal codes such as XAU included;
|
|
4
|
+
* a withdrawn code such as HRK is not one. Any string is taken; this never throws.
|
|
5
|
+
*/
|
|
6
|
+
export declare function isIso4217(value: string): boolean;
|
|
7
|
+
//# sourceMappingURL=iso4217.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"iso4217.d.ts","sourceRoot":"","sources":["../../src/formats/iso4217.ts"],"names":[],"mappings":"AAkCA;;;;GAIG;AACH,wBAAgB,SAAS,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAEhD"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Whether `value` is an ISO 639-1 two-letter language code, exactly as written: lowercase, such as hr or en. The
|
|
3
|
+
* codes are those of Debian iso-codes v4.20.1. Any string is taken; this never throws.
|
|
4
|
+
*/
|
|
5
|
+
export declare function isIso639Alpha2(value: string): boolean;
|
|
6
|
+
//# sourceMappingURL=iso639-1.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"iso639-1.d.ts","sourceRoot":"","sources":["../../src/formats/iso639-1.ts"],"names":[],"mappings":"AAkCA;;;GAGG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAErD"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/** The 18 values of the `ca` (calendar) key of a Unicode locale extension, deprecated ones dropped. */
|
|
2
|
+
export declare const CALENDARS: readonly string[];
|
|
3
|
+
/** The 7 values of the `fw` (first day of the week) key of a Unicode locale extension, deprecated ones dropped. */
|
|
4
|
+
export declare const FIRST_DAYS: readonly string[];
|
|
5
|
+
/** The 6 values of the `hc` (hour cycle) key of a Unicode locale extension, deprecated ones dropped. */
|
|
6
|
+
export declare const HOUR_CYCLES: readonly string[];
|
|
7
|
+
/** The 3 values of the `ms` (measurement system) key of a Unicode locale extension, deprecated ones dropped. */
|
|
8
|
+
export declare const MEASUREMENT_SYSTEMS: readonly string[];
|
|
9
|
+
/** The 3 values of the `mu` (temperature unit) key of a Unicode locale extension, deprecated ones dropped. */
|
|
10
|
+
export declare const MEASUREMENT_UNITS: readonly string[];
|
|
11
|
+
/** The 100 values of the `nu` (numbering system) key of a Unicode locale extension, deprecated ones dropped. */
|
|
12
|
+
export declare const NUMBERING_SYSTEMS: readonly string[];
|
|
13
|
+
//# sourceMappingURL=uts35.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"uts35.d.ts","sourceRoot":"","sources":["../../src/formats/uts35.ts"],"names":[],"mappings":"AAMA,uGAAuG;AACvG,eAAO,MAAM,SAAS,EAAE,SAAS,MAAM,EAmBtC,CAAA;AAED,mHAAmH;AACnH,eAAO,MAAM,UAAU,EAAE,SAAS,MAAM,EAAsD,CAAA;AAE9F,wGAAwG;AACxG,eAAO,MAAM,WAAW,EAAE,SAAS,MAAM,EAA+C,CAAA;AAExF,gHAAgH;AAChH,eAAO,MAAM,mBAAmB,EAAE,SAAS,MAAM,EAAuC,CAAA;AAExF,8GAA8G;AAC9G,eAAO,MAAM,iBAAiB,EAAE,SAAS,MAAM,EAAsC,CAAA;AAErF,gHAAgH;AAChH,eAAO,MAAM,iBAAiB,EAAE,SAAS,MAAM,EAqG9C,CAAA"}
|
package/types/index.d.ts
CHANGED
|
@@ -1,4 +1,9 @@
|
|
|
1
1
|
export { isCidr } from "./cidr.ts";
|
|
2
|
+
export type { IntegerFormat, TextFormat } from "./formats/catalog.ts";
|
|
3
|
+
export { isIanaTimeZone } from "./formats/iana-time-zone.ts";
|
|
4
|
+
export { isIso3166Alpha2, isIso3166Alpha3 } from "./formats/iso3166-1.ts";
|
|
5
|
+
export { isIso4217 } from "./formats/iso4217.ts";
|
|
6
|
+
export { isIso639Alpha2 } from "./formats/iso639-1.ts";
|
|
2
7
|
export { jsonValue } from "./json-value.ts";
|
|
3
8
|
export { CombError } from "./error.ts";
|
|
4
9
|
export { type PasswordHash, passwordText, type PasswordTextOptions, type TypedPasswordOptions, } from "./password-text.ts";
|
package/types/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAA;AAClC,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAA;AAC3C,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAA;AACtC,OAAO,EACN,KAAK,YAAY,EACjB,YAAY,EACZ,KAAK,mBAAmB,EACxB,KAAK,oBAAoB,GACzB,MAAM,oBAAoB,CAAA;AAC3B,OAAO,EAAE,cAAc,EAAE,kBAAkB,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAA;AACrF,OAAO,EACN,aAAa,EACb,mBAAmB,EACnB,aAAa,EACb,iBAAiB,EACjB,QAAQ,EACR,KAAK,cAAc,EACnB,KAAK,mBAAmB,EACxB,KAAK,iBAAiB,EACtB,KAAK,QAAQ,EACb,KAAK,aAAa,EAClB,KAAK,YAAY,EACjB,KAAK,aAAa,EAClB,KAAK,eAAe,EACpB,KAAK,aAAa,EAClB,KAAK,kBAAkB,EACvB,kBAAkB,EAClB,Y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AAK,mBAAmB,EACxB,KAAK,iBAAiB,EACtB,KAAK,QAAQ,EACb,KAAK,aAAa,EAClB,KAAK,YAAY,EACjB,KAAK,aAAa,EAClB,KAAK,eAAe,EACpB,KAAK,aAAa,EAClB,KAAK,kBAAkB,EACvB,kBAAkB,EAClB,YAAY,EACZ,iBAAiB,GACjB,MAAM,WAAW,CAAA;AAClB,OAAO,EAAE,iBAAiB,EAAE,UAAU,EAAE,YAAY,EAAE,KAAK,kBAAkB,EAAE,MAAM,SAAS,CAAA;AAC9F,OAAO,EAAE,QAAQ,EAAE,KAAK,OAAO,EAAE,MAAM,UAAU,CAAA;AACjD,OAAO,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAA;AAC1D,OAAO,EACN,KAAK,oBAAoB,EACzB,KAAK,YAAY,EACjB,qBAAqB,EACrB,KAAK,aAAa,EAClB,KAAK,kBAAkB,EACvB,aAAa,EACb,KAAK,oBAAoB,EACzB,KAAK,SAAS,EACd,eAAe,GACf,MAAM,YAAY,CAAA"}
|
package/types/meta/column.d.ts
CHANGED
|
@@ -20,10 +20,16 @@ declare function withCombColumn<B>(builder: B, meta: {
|
|
|
20
20
|
}): B;
|
|
21
21
|
/** The comb metadata a built column (or its builder) carries; undefined for a column no `c` helper built */
|
|
22
22
|
declare function combColumnMeta(column: unknown): CombColumnMeta | undefined;
|
|
23
|
-
/**
|
|
23
|
+
/**
|
|
24
|
+
* A c.enum's options as its column's record: its constraints (the flags, its `format`, and a `schema`
|
|
25
|
+
* a JavaScript caller passes, kept for codegen to refuse by name), the rest its state machine, none
|
|
26
|
+
* when it names no state
|
|
27
|
+
*/
|
|
24
28
|
declare function enumMeta(values: readonly string[], options?: {
|
|
29
|
+
format?: string | undefined;
|
|
25
30
|
nomutate?: boolean | undefined;
|
|
26
31
|
private?: boolean | undefined;
|
|
32
|
+
schema?: unknown;
|
|
27
33
|
tenant?: boolean | undefined;
|
|
28
34
|
}): {
|
|
29
35
|
[K in keyof CombColumnMeta]: CombColumnMeta[K] | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"column.d.ts","sourceRoot":"","sources":["../../src/meta/column.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,+BAA+B;AAC/B,KAAK,cAAc,GAChB,SAAS,GACT,WAAW,GACX,WAAW,GACX,MAAM,GACN,IAAI,GACJ,SAAS,GACT,MAAM,GACN,MAAM,GACN,KAAK,GACL,UAAU,GACV,MAAM,GACN,WAAW,GACX,WAAW,CAAA;AAEd,+GAA+G;AAC/G,KAAK,cAAc,GAAG;IACrB,WAAW,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,GAAG,SAAS,CAAA;IAC3D,IAAI,EAAE,cAAc,CAAA;IACpB,MAAM,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;IAC3B,MAAM,CAAC,EAAE,OAAO,CAAA;IAChB,MAAM,CAAC,EAAE,OAAO,CAAA;IAChB,MAAM,CAAC,EAAE,SAAS,MAAM,EAAE,GAAG,SAAS,CAAA;CACtC,CAAA;AAID,oGAAoG;AACpG,iBAAS,cAAc,CAAC,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE;KAAG,CAAC,IAAI,MAAM,cAAc,GAAG,cAAc,CAAC,CAAC,CAAC,GAAG,SAAS;CAAE,GAAG,CAAC,CAI9G;AAED,4GAA4G;AAC5G,iBAAS,cAAc,CAAC,MAAM,EAAE,OAAO,GAAG,cAAc,GAAG,SAAS,CAGnE;
|
|
1
|
+
{"version":3,"file":"column.d.ts","sourceRoot":"","sources":["../../src/meta/column.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,+BAA+B;AAC/B,KAAK,cAAc,GAChB,SAAS,GACT,WAAW,GACX,WAAW,GACX,MAAM,GACN,IAAI,GACJ,SAAS,GACT,MAAM,GACN,MAAM,GACN,KAAK,GACL,UAAU,GACV,MAAM,GACN,WAAW,GACX,WAAW,CAAA;AAEd,+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leanBuilder, type PgDoublePrecisionBuilder, type PgIntegerBuilder, type PgJsonbBuilder, type PgSerialBuilder, type PgTextBuilder, type Set$Type, type SetHasDefault, type SetIsPrimaryKey, type SetNotNull } from "drizzle-orm/pg-core";
|
|
2
|
-
import type { EnumOptions, IntegerConstraints, JsonConstraints, TextConstraints, TimestampConstraints } from "../sqlite/constraints.ts";
|
|
2
|
+
import type { EnumOptions, IntegerConstraints, JsonConstraints, RealConstraints, RefConstraints, TextConstraints, TimestampConstraints } from "../sqlite/constraints.ts";
|
|
3
3
|
import type * as z from "zod";
|
|
4
4
|
/** A Postgres text column builder */
|
|
5
5
|
type Text = PgTextBuilder<[string, ...string[]]>;
|
|
@@ -46,9 +46,9 @@ export type PgColumns = {
|
|
|
46
46
|
*/
|
|
47
47
|
json: <TSchema extends z.ZodTypeAny = z.ZodTypeAny>(name: string, _schema: TSchema, _constraints?: JsonConstraints) => Set$Type<PgJsonbBuilder, z.infer<TSchema>>;
|
|
48
48
|
/** a floating-point number, stored as double precision */
|
|
49
|
-
real: (name: string, _constraints?:
|
|
49
|
+
real: (name: string, _constraints?: RealConstraints) => PgDoublePrecisionBuilder;
|
|
50
50
|
/** a text foreign key; chain `.references()` to name the column it points at */
|
|
51
|
-
ref: (name: string, _constraints?:
|
|
51
|
+
ref: (name: string, _constraints?: RefConstraints) => Text;
|
|
52
52
|
/** the auto-incrementing 4-byte `serial` primary key `id`, filled by the database */
|
|
53
53
|
serialId: () => SetIsPrimaryKey<PgSerialBuilder>;
|
|
54
54
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"columns.d.ts","sourceRoot":"","sources":["../../src/pg/columns.ts"],"names":[],"mappings":"AAMA,OAAO,EAMN,KAAK,iBAAiB,EACtB,KAAK,gBAAgB,EACrB,KAAK,wBAAwB,EAC7B,KAAK,gBAAgB,EACrB,KAAK,cAAc,EACnB,KAAK,eAAe,EACpB,KAAK,aAAa,EAElB,KAAK,QAAQ,EACb,KAAK,aAAa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