@workerstack/database 0.21.0 → 0.22.1
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 +243 -40
- package/docs/meta-contract.md +55 -1
- package/package.json +3 -7
- package/src/cli/args.ts +4 -2
- package/src/cli/codegen.ts +2 -2
- package/src/cli/comb-config.ts +8 -3
- package/src/cli/file-path.ts +25 -0
- package/src/cli/migrate-apply.ts +5 -21
- package/src/cli/migrate-d1.ts +5 -1
- package/src/cli/migrate-json.ts +48 -0
- package/src/cli/migrate.ts +26 -4
- 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/migrate/core/apply.ts +63 -22
- package/src/migrate/core/atlas-apply-runs.ts +15 -26
- package/src/migrate/core/cleanup.ts +22 -10
- package/src/migrate/core/d1-engine-child.mjs +27 -11
- package/src/migrate/core/d1-history.ts +23 -26
- package/src/migrate/core/d1-wrangler-error.ts +24 -1
- package/src/migrate/core/pg-replay-commit.ts +41 -38
- package/src/migrate/core/pg-replay-drops.ts +17 -32
- package/src/migrate/core/pg-replay-hidden.ts +75 -0
- package/src/migrate/core/pg-replay-roles.ts +2 -4
- package/src/migrate/core/pg-replay.ts +21 -19
- package/src/migrate/core/pg-server-snapshot.ts +4 -24
- package/src/migrate/core/proof-readers.ts +80 -0
- package/src/migrate/core/proof-run.ts +19 -5
- package/src/migrate/core/proof-scope.ts +27 -14
- package/src/migrate/core/sql-code.ts +36 -5
- package/src/migrate/core/sql-scan.ts +7 -1
- package/src/migrate/core/sqlite-keywords.ts +70 -0
- package/src/migrate/core/stopped.ts +70 -0
- package/src/migrate/core/trigger-write.d.mts +7 -0
- package/src/migrate/core/trigger-write.mjs +42 -0
- package/src/pg/columns.ts +6 -4
- package/src/query/cursor-mint.ts +11 -18
- package/src/query/cursor-refusals.ts +22 -11
- package/src/query/descriptions.ts +4 -9
- package/src/query/filter-parse.ts +80 -22
- package/src/query/filter-validate.ts +10 -13
- package/src/query/filter.ts +40 -18
- package/src/query/list-extras.ts +7 -10
- package/src/query/list-schema.ts +0 -2
- package/src/query/merged.ts +3 -2
- package/src/query/pagination.ts +30 -6
- package/src/query/rounded-key.ts +5 -8
- package/src/query/schema-params.ts +12 -5
- package/src/query/select-validate.ts +7 -4
- package/src/query/sqlite/cursor-fit.ts +10 -2
- package/src/query/trusted.ts +7 -2
- package/src/sqlite/columns.ts +6 -4
- package/src/sqlite/constraints.ts +120 -6
- package/types/cli/args.d.ts.map +1 -1
- package/types/cli/comb-config.d.ts +5 -2
- package/types/cli/comb-config.d.ts.map +1 -1
- package/types/cli/file-path.d.ts +11 -0
- package/types/cli/file-path.d.ts.map +1 -0
- package/types/cli/migrate-apply.d.ts +1 -0
- package/types/cli/migrate-apply.d.ts.map +1 -1
- package/types/cli/migrate-d1.d.ts.map +1 -1
- package/types/cli/migrate-json.d.ts +4 -0
- package/types/cli/migrate-json.d.ts.map +1 -0
- package/types/cli/migrate.d.ts.map +1 -1
- 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/migrate/core/apply.d.ts +3 -2
- package/types/migrate/core/apply.d.ts.map +1 -1
- package/types/migrate/core/atlas-apply-runs.d.ts +6 -0
- package/types/migrate/core/atlas-apply-runs.d.ts.map +1 -1
- package/types/migrate/core/cleanup.d.ts +16 -4
- package/types/migrate/core/cleanup.d.ts.map +1 -1
- package/types/migrate/core/d1-history.d.ts.map +1 -1
- package/types/migrate/core/d1-wrangler-error.d.ts +11 -0
- package/types/migrate/core/d1-wrangler-error.d.ts.map +1 -1
- package/types/migrate/core/pg-replay-commit.d.ts +14 -9
- package/types/migrate/core/pg-replay-commit.d.ts.map +1 -1
- package/types/migrate/core/pg-replay-drops.d.ts +7 -12
- package/types/migrate/core/pg-replay-drops.d.ts.map +1 -1
- package/types/migrate/core/pg-replay-hidden.d.ts +36 -0
- package/types/migrate/core/pg-replay-hidden.d.ts.map +1 -0
- package/types/migrate/core/pg-replay-roles.d.ts +2 -4
- package/types/migrate/core/pg-replay-roles.d.ts.map +1 -1
- package/types/migrate/core/pg-replay.d.ts.map +1 -1
- package/types/migrate/core/pg-server-snapshot.d.ts +4 -11
- package/types/migrate/core/pg-server-snapshot.d.ts.map +1 -1
- package/types/migrate/core/proof-readers.d.ts +19 -0
- package/types/migrate/core/proof-readers.d.ts.map +1 -0
- package/types/migrate/core/proof-run.d.ts.map +1 -1
- package/types/migrate/core/proof-scope.d.ts +15 -7
- package/types/migrate/core/proof-scope.d.ts.map +1 -1
- package/types/migrate/core/sql-code.d.ts +7 -3
- package/types/migrate/core/sql-code.d.ts.map +1 -1
- package/types/migrate/core/sql-scan.d.ts.map +1 -1
- package/types/migrate/core/sqlite-keywords.d.ts +11 -0
- package/types/migrate/core/sqlite-keywords.d.ts.map +1 -0
- package/types/migrate/core/stopped.d.ts +23 -0
- package/types/migrate/core/stopped.d.ts.map +1 -0
- package/types/pg/columns.d.ts +3 -3
- package/types/pg/columns.d.ts.map +1 -1
- package/types/query/cursor-mint.d.ts.map +1 -1
- package/types/query/cursor-refusals.d.ts +17 -1
- package/types/query/cursor-refusals.d.ts.map +1 -1
- package/types/query/descriptions.d.ts +1 -1
- package/types/query/descriptions.d.ts.map +1 -1
- package/types/query/filter-parse.d.ts +15 -4
- package/types/query/filter-parse.d.ts.map +1 -1
- package/types/query/filter-validate.d.ts +1 -1
- package/types/query/filter-validate.d.ts.map +1 -1
- package/types/query/filter.d.ts +9 -1
- package/types/query/filter.d.ts.map +1 -1
- package/types/query/list-extras.d.ts.map +1 -1
- package/types/query/list-schema.d.ts.map +1 -1
- package/types/query/merged.d.ts.map +1 -1
- package/types/query/pagination.d.ts +13 -1
- package/types/query/pagination.d.ts.map +1 -1
- package/types/query/rounded-key.d.ts +2 -11
- package/types/query/rounded-key.d.ts.map +1 -1
- package/types/query/schema-params.d.ts.map +1 -1
- package/types/query/select-validate.d.ts.map +1 -1
- package/types/query/sqlite/cursor-fit.d.ts.map +1 -1
- package/types/query/trusted.d.ts +1 -1
- package/types/query/trusted.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
|
@@ -92,6 +92,18 @@ declare const totalOf: (row: object) => number;
|
|
|
92
92
|
* public subset. No-op (minus `_total`) when parsedFields is null.
|
|
93
93
|
*/
|
|
94
94
|
declare function applySelect<T extends Record<string, unknown>>(row: T, parsedFields: ParsedFields | null): T;
|
|
95
|
+
/**
|
|
96
|
+
* What seals a served page's next cursor, or undefined for none, `check` measuring a row's cursor. On
|
|
97
|
+
* a page by cursor it runs on every row: its client walks the list one cursor at a time, so a row no
|
|
98
|
+
* cursor resumes after is refused on the page that serves it, whatever the page size. On a page by
|
|
99
|
+
* number it runs only on the last row of a page with more, the one the cursor is minted from, as
|
|
100
|
+
* 0.20.1 did; a row whose own value no cursor holds (UnmintableRow) mints none, and the page serves it,
|
|
101
|
+
* its `hasMore` still saying a next page by number exists. A refusal of the list's wiring throws on both
|
|
102
|
+
*/
|
|
103
|
+
declare function nextCursorOf<T>(page: readonly T[], { byCursor, hasMore }: {
|
|
104
|
+
byCursor: boolean;
|
|
105
|
+
hasMore: boolean;
|
|
106
|
+
}, check: (row: T) => (() => string) | undefined): (() => string) | undefined;
|
|
95
107
|
/**
|
|
96
108
|
* The page of `items`, read with `built`, and its pagination: count, whether there is more, and
|
|
97
109
|
* the next cursor, sealed under the builder's options; none for a list no cursor can resume
|
|
@@ -103,5 +115,5 @@ declare function paginate<T extends object>(items: readonly T[], built: {
|
|
|
103
115
|
merged: false;
|
|
104
116
|
};
|
|
105
117
|
}): readonly [Array<ListRow<T>>, PaginationResponse];
|
|
106
|
-
export { applySelect, COMB_ID, type ListExtra, type ListPagination, type ListRow, paginate, type PaginationFacts, type PaginationResponse, paginationOf, totalOf, };
|
|
118
|
+
export { applySelect, COMB_ID, nextCursorOf, type ListExtra, type ListPagination, type ListRow, paginate, type PaginationFacts, type PaginationResponse, paginationOf, totalOf, };
|
|
107
119
|
//# sourceMappingURL=pagination.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pagination.d.ts","sourceRoot":"","sources":["../../src/query/pagination.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,OAAO,EAAE,KAAK,aAAa,EAAgB,MAAM,aAAa,CAAA;AAC9D,OAAO,EAAE,KAAK,WAAW,EAAgB,KAAK,UAAU,EAAE,MAAM,kBAAkB,CAAA;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AK,kBAAkB,EACvB,YAAY,EACZ,OAAO,GACP,CAAA"}
|
|
@@ -1,14 +1,5 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* An integer sort key a driver read as a number past ±(2^53 − 1) is already rounded. A list that binds
|
|
3
|
-
* the key as read cannot page it: a derived list with no anchor row to read the exact key back from,
|
|
4
|
-
* and a merged list, whose shards' keys that round to one double compare equal.
|
|
5
|
-
* A SQLite REAL and a Postgres double precision are doubles, so one past 2^53 is exact: the key's class,
|
|
6
|
-
* which the builder selects as `_combKeyTypes`, decides, and only where none was
|
|
7
|
-
* selected does the value alone. A class is trusted only when it names a double, so one comb cannot
|
|
8
|
-
* place, such as a type no family covers, is refused as an integer is.
|
|
9
|
-
*/
|
|
10
|
-
import { CombError } from "../error.ts";
|
|
11
1
|
import type { SortField } from "./types.ts";
|
|
2
|
+
import { UnmintableRow } from "./cursor-refusals.ts";
|
|
12
3
|
/**
|
|
13
4
|
* The 500 for `row`'s first sort key the driver may have rounded, on a list that cannot page it:
|
|
14
5
|
* every key of a derived or a merged list, and of an anchored list the keys
|
|
@@ -24,6 +15,6 @@ import type { SortField } from "./types.ts";
|
|
|
24
15
|
*/
|
|
25
16
|
declare function roundedKey(row: Record<string, unknown>, sort: readonly SortField[], list: "derived" | "merged" | {
|
|
26
17
|
unread: (field: string) => boolean;
|
|
27
|
-
}):
|
|
18
|
+
}): UnmintableRow | undefined;
|
|
28
19
|
export { roundedKey };
|
|
29
20
|
//# sourceMappingURL=rounded-key.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rounded-key.d.ts","sourceRoot":"","sources":["../../src/query/rounded-key.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"rounded-key.d.ts","sourceRoot":"","sources":["../../src/query/rounded-key.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,YAAY,CAAA;AAC3C,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAA;A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"version":3,"file":"select-validate.d.ts","sourceRoot":"","sources":["../../src/query/select-validate.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,KAAK,KAAK,CAAC,MAAM,KAAK,CAAA;AAG7B,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAA;AACrD,OAAO,KAAK,EAAkB,YAAY,EAAE,MAAM,YAAY,CAAA;
|
|
1
|
+
{"version":3,"file":"select-validate.d.ts","sourceRoot":"","sources":["../../src/query/select-validate.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,KAAK,KAAK,CAAC,MAAM,KAAK,CAAA;AAG7B,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAA;AACrD,OAAO,KAAK,EAAkB,YAAY,EAAE,MAAM,YAAY,CAAA;AAgC9D,yGAAyG;AACzG,iBAAS,wBAAwB,CAChC,YAAY,EAAE,MAAM,GAAG,SAAS,EAChC,YAAY,EAAE,YAAY,EAC1B,GAAG,EAAE,CAAC,CAAC,aAAa,GAClB,YAAY,GAAG,IAAI,CAyBrB;AAED,OAAO,EAAE,wBAAwB,EAAE,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cursor-fit.d.ts","sourceRoot":"","sources":["../../../src/query/sqlite/cursor-fit.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,EAAmC,GAAG,EAAE,KAAK,UAAU,EAAO,MAAM,aAAa,CAAA;AAOxF,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAA;AA4CrD;;;GAGG;AACH,cAAM,OAAQ,YAAW,UAAU;IAClC,QAAQ,CAAC,UAAU,EAAE,UAAU,CAAA;IAE/B,YAAY,UAAU,EAAE,UAAU,EAEjC;IAED,MAAM,IAAI,GAAG,CAEZ;CACD;AA0CD;;;;GAIG;AACH,iBAAS,QAAQ,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAIzC;AAED;;;;GAIG;AACH,Q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EzD;;;GAGG;AACH,QAAA,MAAM,YAAY,YAAa,WAAW,WAAW,SAAS,UAAU,EAAE,UAAU,SAAS,OAAO,EAAE,KAAG,OAAO,EAG9G,CAAA;AAEF,4IAA4I;AAC5I,KAAK,KAAK,GAAG;IACZ,MAAM,CAAC,EAAE,CAAC,CAAC,KAAK,EAAE,MAAM,KAAK,OAAO,CAAC,GAAG,SAAS,CAAA;IACjD,OAAO,CAAC,EAAE,CAAC,CAAC,KAAK,EAAE,MAAM,KAAK,OAAO,CAAC,GAAG,SAAS,CAAA;IAClD,KAAK,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;CAC1B,CAAA;AAED;;;;;;GAMG;AACH,iBAAS,UAAU,CAAC,OAAO,EAAE,SAAS,UAAU,EAAE,EAAE,MAAM,EAAE,SAAS,OAAO,EAAE,EAAE,EAAE,GAAE,KAAU,GAAG,MAAM,CAKtG;AAED,gGAAgG;AAChG,iBAAS,gBAAgB,CAAC,OAAO,EAAE,SAAS,UAAU,EAAE,EAAE,MAAM,EAAE,SAAS,OAAO,EAAE,EAAE,EAAE,GAAE,KAAU,GAAG,IAAI,CAG1G;AAED,oIAAoI;AACpI,QAAA,MAAM,UAAU,WAAY,UAAU,GAAG,SAAS,SAAS,OAAO,KAAG,OACR,CAAA;AAE7D,OAAO,EACN,gBAAgB,EAChB,QAAQ,EACR,UAAU,EACV,UAAU,EACV,UAAU,EACV,WAAW,EACX,YAAY,EACZ,YAAY,EACZ,aAAa,EACb,OAAO,EACP,YAAY,EACZ,UAAU,GACV,CAAA"}
|
package/types/query/trusted.d.ts
CHANGED
|
@@ -38,6 +38,6 @@ declare function assertLimitWithin(parsed: {
|
|
|
38
38
|
/** The 400 for a page that is no whole number from 1, from a list schema or from a builder */
|
|
39
39
|
declare function invalidPage(page: unknown): CombError;
|
|
40
40
|
/** The 400 for a page past `maxPage`, from a list schema or from a list no schema bounded */
|
|
41
|
-
declare function pageTooDeep(page: number, maxPage: number): CombError;
|
|
41
|
+
declare function pageTooDeep(page: number | string, maxPage: number): CombError;
|
|
42
42
|
export { assertLimitWithin, assertPageWithin, assertSchemaParsed, invalidPage, pageTooDeep };
|
|
43
43
|
//# sourceMappingURL=trusted.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"trusted.d.ts","sourceRoot":"","sources":["../../src/query/trusted.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AAIvC,KAAK,MAAM,GAAG;IAAE,SAAS,CAAC,EAAE,OAAO,CAAC;IAAC,UAAU,EAAE,SAAS,OAAO,EAAE,CAAC;IAAC,SAAS,CAAC,EAAE,IAAI,GAAG,SAAS,CAAA;CAAE,CAAA;AAKnG,oFAAoF;AACpF,iBAAS,kBAAkB,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAgBhD;AAED;;;;;;GAMG;AACH,iBAAS,gBAAgB,CAAC,MAAM,EAAE;IACjC,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,CAAA;IAChC,SAAS,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;IAC9B,wFAAwF;IACxF,SAAS,CAAC,EAAE,IAAI,GAAG,SAAS,CAAA;CAC5B,GAAG,IAAI,CAKP;AAED;;;;GAIG;AACH,iBAAS,iBAAiB,CAAC,MAAM,EAAE;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,UAAU,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;CAAE,GAAG,IAAI,CAgB3F;AAED,8FAA8F;AAC9F,iBAAS,WAAW,CAAC,IAAI,EAAE,OAAO,GAAG,SAAS,CAM7C;
|
|
1
|
+
{"version":3,"file":"trusted.d.ts","sourceRoot":"","sources":["../../src/query/trusted.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AAIvC,KAAK,MAAM,GAAG;IAAE,SAAS,CAAC,EAAE,OAAO,CAAC;IAAC,UAAU,EAAE,SAAS,OAAO,EAAE,CAAC;IAAC,SAAS,CAAC,EAAE,IAAI,GAAG,SAAS,CAAA;CAAE,CAAA;AAKnG,oFAAoF;AACpF,iBAAS,kBAAkB,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAgBhD;AAED;;;;;;GAMG;AACH,iBAAS,gBAAgB,CAAC,MAAM,EAAE;IACjC,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,CAAA;IAChC,SAAS,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;IAC9B,wFAAwF;IACxF,SAAS,CAAC,EAAE,IAAI,GAAG,SAAS,CAAA;CAC5B,GAAG,IAAI,CAKP;AAED;;;;GAIG;AACH,iBAAS,iBAAiB,CAAC,MAAM,EAAE;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,UAAU,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;CAAE,GAAG,IAAI,CAgB3F;AAED,8FAA8F;AAC9F,iBAAS,WAAW,CAAC,IAAI,EAAE,OAAO,GAAG,SAAS,CAM7C;AAKD,6FAA6F;AAC7F,iBAAS,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,SAAS,CAQtE;AAED,OAAO,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,WAAW,EAAE,WAAW,EAAE,CAAA"}
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
import { type $Type, type HasDefault, type IsPrimaryKey, type NotNull } from "drizzle-orm";
|
|
7
7
|
import { type SQLiteBooleanBuilder, type SQLiteIntegerBuilder, type SQLiteRealBuilder, type SQLiteTextBuilder, type SQLiteTextJsonBuilder } from "drizzle-orm/sqlite-core";
|
|
8
8
|
import type * as z from "zod";
|
|
9
|
-
import type { EnumOptions, IntegerConstraints, JsonConstraints, TextConstraints, TimestampConstraints } from "./constraints.ts";
|
|
9
|
+
import type { EnumOptions, IntegerConstraints, JsonConstraints, RealConstraints, RefConstraints, TextConstraints, TimestampConstraints } from "./constraints.ts";
|
|
10
10
|
/** A SQLite TEXT column builder */
|
|
11
11
|
type Text = SQLiteTextBuilder<[string, ...string[]]>;
|
|
12
12
|
/** The names a creation timestamp may take, in either casing, so codegen recognizes it */
|
|
@@ -35,9 +35,9 @@ export type SqliteColumns = {
|
|
|
35
35
|
/** a JSON value stored as TEXT, typed and validated by `schema` in the generated DTOs */
|
|
36
36
|
json: <TSchema extends z.ZodTypeAny = z.ZodTypeAny>(name: string, _schema: TSchema, _constraints?: JsonConstraints) => $Type<SQLiteTextJsonBuilder, z.infer<TSchema>>;
|
|
37
37
|
/** a floating-point REAL */
|
|
38
|
-
real: (name: string, _constraints?:
|
|
38
|
+
real: (name: string, _constraints?: RealConstraints) => SQLiteRealBuilder;
|
|
39
39
|
/** a TEXT foreign key; chain `.references()` to name the column it points at */
|
|
40
|
-
ref: (name: string, _constraints?:
|
|
40
|
+
ref: (name: string, _constraints?: RefConstraints) => Text;
|
|
41
41
|
/** the auto-incrementing INTEGER primary key `id`, filled by the database */
|
|
42
42
|
serialId: () => IsPrimaryKey<HasDefault<NotNull<SQLiteIntegerBuilder>>>;
|
|
43
43
|
/** a TEXT column; a declared `max` also becomes its declared length */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"columns.d.ts","sourceRoot":"","sources":["../../src/sqlite/columns.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,KAAK,KAAK,EAAE,KAAK,UAAU,EAAE,KAAK,YAAY,EAAE,KAAK,OAAO,EAAO,MAAM,aAAa,CAAA;AAC/F,OAAO,EAGN,KAAK,oBAAoB,EACzB,KAAK,oBAAoB,EACzB,KAAK,iBAAiB,EACtB,KAAK,iBAAiB,EACtB,KAAK,qBAAqB,EAE1B,MAAM,yBAAyB,CAAA;AAChC,OAAO,KAAK,KAAK,CAAC,MAAM,KAAK,CAAA;AAE7B,OAAO,KAAK,EACX,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6EAA6E;IAC7E,QAAQ,EAAE,MAAM,YAAY,CAAC,UAAU,CAAC,OAAO,CAAC,oBAAoB,CAAC,CAAC,CAAC,CAAA;IACvE,uEAAuE;IACvE,IAAI,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,YAAY,CAAC,EAAE,eAAe,KAAK,IAAI,CAAA;IAC5D,kEAAkE;IAClE,SAAS,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,YAAY,CAAC,EAAE,oBAAoB,KAAK,oBAAoB,CAAA;IACtF,mIAAmI;IACnI,SAAS,EAAE,CACV,IAAI,EAAE,aAAa,EACnB,YAAY,CAAC,EAAE,oBAAoB,KAC/B,UAAU,CAAC,UAAU,CAAC,OAAO,CAAC,oBAAoB,CAAC,CAAC,CAAC,CAAA;CAC1D,CAAA;AAED;;;;GAIG;AACH,eAAO,MAAM,CAAC,EAAE,aA+Df,CAAA"}
|
|
@@ -2,6 +2,9 @@
|
|
|
2
2
|
* Type-safe column constraint definitions
|
|
3
3
|
* These exist only in the type system and are completely erased at runtime
|
|
4
4
|
*/
|
|
5
|
+
import type * as z from "zod";
|
|
6
|
+
import type { IntegerFormat, TextFormat } from "../formats/catalog.ts";
|
|
7
|
+
/** What every helper's constraints take: the DTO, mutation, privacy, relation and tenant flags */
|
|
5
8
|
type BaseConstraints = {
|
|
6
9
|
/** Field is filled by comb or the database: generated create and update DTOs leave it out */
|
|
7
10
|
autogenerate?: boolean | undefined;
|
|
@@ -77,12 +80,82 @@ type StringValidationConstraints = {
|
|
|
77
80
|
* Text column constraints
|
|
78
81
|
* Closed record - only these properties allowed
|
|
79
82
|
*/
|
|
80
|
-
export type TextConstraints = BaseConstraints & StringTransformConstraints & NumericRangeConstraints & StringValidationConstraints
|
|
83
|
+
export type TextConstraints = BaseConstraints & StringTransformConstraints & NumericRangeConstraints & StringValidationConstraints & {
|
|
84
|
+
/**
|
|
85
|
+
* The standard a written text holds: the generated DTOs run the format's trim and case, then hold the
|
|
86
|
+
* value to its pattern and, where it names one, its pinned registry, and publish the id as `x-comb-format`.
|
|
87
|
+
* A value it refuses is one zod `invalid_format` issue carrying the id, worded by zod's locale. One of:
|
|
88
|
+
* - `base64url`: RFC 4648 §5 base64url, unpadded; `dGVzdA`; pattern only
|
|
89
|
+
* - `bcp47`: BCP 47 language tag, RFC 5646 §2.1 well-formed; `zh-Hant-TW`; pattern only
|
|
90
|
+
* - `e164`: ITU-T E.164 phone number, + and up to 15 digits; `+385911234567`; pattern only
|
|
91
|
+
* - `iana-time-zone`: IANA time zone name, tzdata 2026f; `Europe/Zagreb`; registry
|
|
92
|
+
* - `ip`: IPv4 dotted quad or IPv6 address, RFC 4291 §2.2; `2001:db8::1`; pattern only
|
|
93
|
+
* - `ipv4`: IPv4 address, dotted quad without leading zeros; `192.0.2.1`; pattern only
|
|
94
|
+
* - `ipv6`: IPv6 address, RFC 4291 §2.2; `2001:db8::1`; pattern only
|
|
95
|
+
* - `iso3166-1-alpha-2`: ISO 3166-1 alpha-2 country code, Debian iso-codes v4.20.1; `HR`; registry
|
|
96
|
+
* - `iso3166-1-alpha-3`: ISO 3166-1 alpha-3 country code, Debian iso-codes v4.20.1; `HRV`; registry
|
|
97
|
+
* - `iso4217`: ISO 4217 alphabetic currency code, SIX list 2026-09-17; `EUR`; registry
|
|
98
|
+
* - `iso639-1`: ISO 639-1 language code, Debian iso-codes v4.20.1; `hr`; registry
|
|
99
|
+
* - `kebab-slug`: kebab-case slug, lowercase letters and digits joined by single hyphens; `spring-sale-2026`; pattern only
|
|
100
|
+
* - `pkce-s256-challenge`: RFC 7636 §4.2 PKCE SHA-256 code challenge; `E9Melhoa2OwvFrEMTJguCHaoeK1t8URWbuGJSstw-cM`; pattern only
|
|
101
|
+
* - `rfc1123-hostname`: RFC 1123 §2.1 host name; `api.example.com`; pattern only
|
|
102
|
+
* - `semver`: Semantic Versioning 2.0.0 version; `1.4.0-rc.1`; pattern only
|
|
103
|
+
* - `sha256-hex`: SHA-256 digest, FIPS 180-4, lowercase hex; `e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855`; pattern only
|
|
104
|
+
* - `sha512-hex`: SHA-512 digest, FIPS 180-4, lowercase hex; `cf83e1357eefb8bdf1542850d66d8007d620e4050b5715dc83f4a921d36ce9ce47d0d13c5d85f2b0ff8318d2877eec2f63b931bd47417a81a538327af927da3e`; pattern only
|
|
105
|
+
* - `srgb-hex`: sRGB color as #rrggbb, CSS Color 4; `#1e90ff`; pattern only
|
|
106
|
+
* - `srgb-hex-alpha`: sRGB color with alpha as #rrggbbaa, CSS Color 4; `#1e90ff80`; pattern only
|
|
107
|
+
* - `ulid`: ULID, Crockford base32 in lowercase; `01hzy3k8q2m4n5p6r7s8t9v0wx`; pattern only
|
|
108
|
+
* - `uts35-ca`: UTS #35 calendar (ca) key value, CLDR 49; `gregory`; pattern only
|
|
109
|
+
* - `uts35-fw`: UTS #35 first day of the week (fw) key value, CLDR 49; `mon`; pattern only
|
|
110
|
+
* - `uts35-hc`: UTS #35 hour cycle (hc) key value, CLDR 49; `h23`; pattern only
|
|
111
|
+
* - `uts35-ms`: UTS #35 measurement system (ms) key value, CLDR 49; `metric`; pattern only
|
|
112
|
+
* - `uts35-mu`: UTS #35 measurement unit (mu) key value, CLDR 49; `celsius`; pattern only
|
|
113
|
+
* - `uts35-nu`: UTS #35 numbering system (nu) key value, CLDR 49; `latn`; pattern only
|
|
114
|
+
* - `uuid`: RFC 9562 UUID, lowercase hex; `0f8fad5b-d9cb-469f-a165-70867728950e`; pattern only
|
|
115
|
+
* - `uuid-v4`: RFC 9562 UUID version 4, lowercase hex; `0f8fad5b-d9cb-469f-a165-70867728950e`; pattern only
|
|
116
|
+
* - `uuid-v7`: RFC 9562 UUID version 7, lowercase hex; `01890a5d-ac96-774b-bcce-b302099a8057`; pattern only
|
|
117
|
+
*/
|
|
118
|
+
format?: TextFormat | undefined;
|
|
119
|
+
/**
|
|
120
|
+
* An exported zod schema the generated DTOs pipe the value into after every other rule, on the
|
|
121
|
+
* transformed value; its issues reach the caller as zod yields them, and its input JSON Schema is
|
|
122
|
+
* published beside `x-comb-schema`. Codegen imports it as it imports a `c.json` schema, so export it
|
|
123
|
+
* from a module of its own, or above the table that names it
|
|
124
|
+
*/
|
|
125
|
+
schema?: z.ZodType<string, string> | undefined;
|
|
126
|
+
};
|
|
127
|
+
/**
|
|
128
|
+
* Floating-point column constraints: its bounds, and an exported zod schema its value is piped into
|
|
129
|
+
* Closed record - only these properties allowed
|
|
130
|
+
*/
|
|
131
|
+
export type RealConstraints = BaseConstraints & NumericRangeConstraints & {
|
|
132
|
+
/**
|
|
133
|
+
* An exported zod schema the generated DTOs pipe the value into after its bounds; its issues reach
|
|
134
|
+
* the caller as zod yields them, and its input JSON Schema is published beside `x-comb-schema`.
|
|
135
|
+
* Codegen imports it as it imports a `c.json` schema, so export it from a module of its own, or
|
|
136
|
+
* above the table that names it
|
|
137
|
+
*/
|
|
138
|
+
schema?: z.ZodType<number, number> | undefined;
|
|
139
|
+
};
|
|
81
140
|
/**
|
|
82
|
-
* Integer
|
|
141
|
+
* Integer column constraints: a real's, and the standard `format` that numbers its values
|
|
83
142
|
* Closed record - only these properties allowed
|
|
84
143
|
*/
|
|
85
|
-
export type IntegerConstraints =
|
|
144
|
+
export type IntegerConstraints = RealConstraints & {
|
|
145
|
+
/**
|
|
146
|
+
* The standard that numbers the value: its range bounds the generated DTOs, the tighter of it and a
|
|
147
|
+
* declared `min` or `max` winning, and they publish the id as `x-comb-format`. One of:
|
|
148
|
+
* - `iso8601-month`: ISO 8601 month number, 1 January to 12 December; `3`
|
|
149
|
+
* - `iso8601-weekday`: ISO 8601 §3.2.2 weekday number, 1 Monday to 7 Sunday; `1`
|
|
150
|
+
*/
|
|
151
|
+
format?: IntegerFormat | undefined;
|
|
152
|
+
};
|
|
153
|
+
/**
|
|
154
|
+
* Foreign key column constraints: a text's but `format` and `schema`, as the value is another
|
|
155
|
+
* table's key, held to that key's own rules
|
|
156
|
+
* Closed record - only these properties allowed
|
|
157
|
+
*/
|
|
158
|
+
export type RefConstraints = Omit<TextConstraints, "format" | "schema">;
|
|
86
159
|
/**
|
|
87
160
|
* JSON column constraints
|
|
88
161
|
* Closed record - only these properties allowed
|
|
@@ -113,7 +186,46 @@ export type EnumStates<TState extends string = string> = {
|
|
|
113
186
|
readonly [K in TState]?: readonly TState[] | undefined;
|
|
114
187
|
} | undefined;
|
|
115
188
|
};
|
|
116
|
-
/**
|
|
117
|
-
|
|
189
|
+
/**
|
|
190
|
+
* What `c.enum` takes beside its values: its state machine, the `nomutate`, `private` and `tenant`
|
|
191
|
+
* flags every helper takes, and the standard `format` its values are written in, which codegen holds
|
|
192
|
+
* each value to and publishes as `x-comb-format`
|
|
193
|
+
*/
|
|
194
|
+
export type EnumOptions<TState extends string = string> = EnumStates<TState> & Pick<BaseConstraints, "nomutate" | "private" | "tenant"> & {
|
|
195
|
+
/**
|
|
196
|
+
* The standard the values are written in: codegen refuses a value the format does not take as written,
|
|
197
|
+
* and the DTOs publish the id as `x-comb-format`; the values stay the rule. One of:
|
|
198
|
+
* - `base64url`: RFC 4648 §5 base64url, unpadded; `dGVzdA`; pattern only
|
|
199
|
+
* - `bcp47`: BCP 47 language tag, RFC 5646 §2.1 well-formed; `zh-Hant-TW`; pattern only
|
|
200
|
+
* - `e164`: ITU-T E.164 phone number, + and up to 15 digits; `+385911234567`; pattern only
|
|
201
|
+
* - `iana-time-zone`: IANA time zone name, tzdata 2026f; `Europe/Zagreb`; registry
|
|
202
|
+
* - `ip`: IPv4 dotted quad or IPv6 address, RFC 4291 §2.2; `2001:db8::1`; pattern only
|
|
203
|
+
* - `ipv4`: IPv4 address, dotted quad without leading zeros; `192.0.2.1`; pattern only
|
|
204
|
+
* - `ipv6`: IPv6 address, RFC 4291 §2.2; `2001:db8::1`; pattern only
|
|
205
|
+
* - `iso3166-1-alpha-2`: ISO 3166-1 alpha-2 country code, Debian iso-codes v4.20.1; `HR`; registry
|
|
206
|
+
* - `iso3166-1-alpha-3`: ISO 3166-1 alpha-3 country code, Debian iso-codes v4.20.1; `HRV`; registry
|
|
207
|
+
* - `iso4217`: ISO 4217 alphabetic currency code, SIX list 2026-09-17; `EUR`; registry
|
|
208
|
+
* - `iso639-1`: ISO 639-1 language code, Debian iso-codes v4.20.1; `hr`; registry
|
|
209
|
+
* - `kebab-slug`: kebab-case slug, lowercase letters and digits joined by single hyphens; `spring-sale-2026`; pattern only
|
|
210
|
+
* - `pkce-s256-challenge`: RFC 7636 §4.2 PKCE SHA-256 code challenge; `E9Melhoa2OwvFrEMTJguCHaoeK1t8URWbuGJSstw-cM`; pattern only
|
|
211
|
+
* - `rfc1123-hostname`: RFC 1123 §2.1 host name; `api.example.com`; pattern only
|
|
212
|
+
* - `semver`: Semantic Versioning 2.0.0 version; `1.4.0-rc.1`; pattern only
|
|
213
|
+
* - `sha256-hex`: SHA-256 digest, FIPS 180-4, lowercase hex; `e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855`; pattern only
|
|
214
|
+
* - `sha512-hex`: SHA-512 digest, FIPS 180-4, lowercase hex; `cf83e1357eefb8bdf1542850d66d8007d620e4050b5715dc83f4a921d36ce9ce47d0d13c5d85f2b0ff8318d2877eec2f63b931bd47417a81a538327af927da3e`; pattern only
|
|
215
|
+
* - `srgb-hex`: sRGB color as #rrggbb, CSS Color 4; `#1e90ff`; pattern only
|
|
216
|
+
* - `srgb-hex-alpha`: sRGB color with alpha as #rrggbbaa, CSS Color 4; `#1e90ff80`; pattern only
|
|
217
|
+
* - `ulid`: ULID, Crockford base32 in lowercase; `01hzy3k8q2m4n5p6r7s8t9v0wx`; pattern only
|
|
218
|
+
* - `uts35-ca`: UTS #35 calendar (ca) key value, CLDR 49; `gregory`; pattern only
|
|
219
|
+
* - `uts35-fw`: UTS #35 first day of the week (fw) key value, CLDR 49; `mon`; pattern only
|
|
220
|
+
* - `uts35-hc`: UTS #35 hour cycle (hc) key value, CLDR 49; `h23`; pattern only
|
|
221
|
+
* - `uts35-ms`: UTS #35 measurement system (ms) key value, CLDR 49; `metric`; pattern only
|
|
222
|
+
* - `uts35-mu`: UTS #35 measurement unit (mu) key value, CLDR 49; `celsius`; pattern only
|
|
223
|
+
* - `uts35-nu`: UTS #35 numbering system (nu) key value, CLDR 49; `latn`; pattern only
|
|
224
|
+
* - `uuid`: RFC 9562 UUID, lowercase hex; `0f8fad5b-d9cb-469f-a165-70867728950e`; pattern only
|
|
225
|
+
* - `uuid-v4`: RFC 9562 UUID version 4, lowercase hex; `0f8fad5b-d9cb-469f-a165-70867728950e`; pattern only
|
|
226
|
+
* - `uuid-v7`: RFC 9562 UUID version 7, lowercase hex; `01890a5d-ac96-774b-bcce-b302099a8057`; pattern only
|
|
227
|
+
*/
|
|
228
|
+
format?: TextFormat | undefined;
|
|
229
|
+
};
|
|
118
230
|
export {};
|
|
119
231
|
//# sourceMappingURL=constraints.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constraints.d.ts","sourceRoot":"","sources":["../../src/sqlite/constraints.ts"],"names":[],"mappings":"AAAA;;;GAGG;
|
|
1
|
+
{"version":3,"file":"constraints.d.ts","sourceRoot":"","sources":["../../src/sqlite/constraints.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,KAAK,KAAK,CAAC,MAAM,KAAK,CAAA;AAC7B,OAAO,KAAK,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAA;AAEtE,kGAAkG;AAClG,KAAK,eAAe,GAAG;IACtB,6FAA6F;IAC7F,YAAY,CAAC,EAAE,OAAO,GAAG,SAAS,CAAA;IAClC;;;;OAIG;IACH,OAAO,CAAC,EAAE,OAAO,GAAG,SAAS,CAAA;IAC7B,6CAA6C;IAC7C,QAAQ,CAAC,EAAE,OAAO,GAAG,SAAS,CAAA;IAC9B;;;OAGG;IACH,OAAO,CAAC,EAAE,OAAO,GAAG,SAAS,CAAA;IAC7B;;;;OAIG;IACH,QAAQ,CAAC,EAAE,MAA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CAAC,GAAG;IAC1D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAgCG;IACH,MAAM,CAAC,EAAE,UAAU,GAAG,SAAS,CAAA;CAC/B,CAAA"}
|
package/src/sqlite/patterns.ts
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Shared regex patterns for table field constraints.
|
|
3
|
-
* Used as `pattern` values in c.text() definitions.
|
|
4
|
-
*
|
|
5
|
-
* These are source-level strings read by the codegen parser —
|
|
6
|
-
* backslashes are doubled so the generated .regex() output is correct.
|
|
7
|
-
*/
|
|
8
|
-
const patterns = {
|
|
9
|
-
/** ISO 3166-1 alpha-2 country code (e.g. "US", "DE") */
|
|
10
|
-
COUNTRY_ALPHA2: "/^[A-Z]{2}$/",
|
|
11
|
-
/** E.164 international phone number (e.g. "+14155552671") */
|
|
12
|
-
E164_PHONE: "/^\\+[1-9][0-9]{7,14}$/",
|
|
13
|
-
/** IANA timezone (e.g. "America/New_York", "Europe/Berlin") */
|
|
14
|
-
IANA_TIMEZONE: "/^[A-Za-z_/]+$/",
|
|
15
|
-
/** BCP 47 language tag, base or with region (e.g. "en", "pt-BR") */
|
|
16
|
-
LOCALE: "/^[a-z]{2}(-[A-Z]{2})?$/",
|
|
17
|
-
} as const
|
|
18
|
-
|
|
19
|
-
export { patterns }
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Shared regex patterns for table field constraints.
|
|
3
|
-
* Used as `pattern` values in c.text() definitions.
|
|
4
|
-
*
|
|
5
|
-
* These are source-level strings read by the codegen parser —
|
|
6
|
-
* backslashes are doubled so the generated .regex() output is correct.
|
|
7
|
-
*/
|
|
8
|
-
declare const patterns: {
|
|
9
|
-
/** ISO 3166-1 alpha-2 country code (e.g. "US", "DE") */
|
|
10
|
-
readonly COUNTRY_ALPHA2: "/^[A-Z]{2}$/";
|
|
11
|
-
/** E.164 international phone number (e.g. "+14155552671") */
|
|
12
|
-
readonly E164_PHONE: "/^\\+[1-9][0-9]{7,14}$/";
|
|
13
|
-
/** IANA timezone (e.g. "America/New_York", "Europe/Berlin") */
|
|
14
|
-
readonly IANA_TIMEZONE: "/^[A-Za-z_/]+$/";
|
|
15
|
-
/** BCP 47 language tag, base or with region (e.g. "en", "pt-BR") */
|
|
16
|
-
readonly LOCALE: "/^[a-z]{2}(-[A-Z]{2})?$/";
|
|
17
|
-
};
|
|
18
|
-
export { patterns };
|
|
19
|
-
//# sourceMappingURL=patterns.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"patterns.d.ts","sourceRoot":"","sources":["../../src/sqlite/patterns.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,QAAA,MAAM,QAAQ;IACb,wDAAwD;aACxD,cAAc,EAAE,cAAc;IAC9B,6DAA6D;aAC7D,UAAU,EAAE,yBAAyB;IACrC,+DAA+D;aAC/D,aAAa,EAAE,iBAAiB;IAChC,oEAAoE;aACpE,MAAM,EAAE,0BAA0B;CACzB,CAAA;AAEV,OAAO,EAAE,QAAQ,EAAE,CAAA"}
|