@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
|
@@ -13,10 +13,13 @@ type Report = (message: string) => void
|
|
|
13
13
|
/** A relation by name, and the config that declares its fields */
|
|
14
14
|
type Relation = { fieldsConfig: FieldsConfig; name: string }
|
|
15
15
|
|
|
16
|
-
/**
|
|
16
|
+
/**
|
|
17
|
+
* Report every name in `scalars` that `allowed` lacks; computed `@` fields are the handler's, and `*`
|
|
18
|
+
* is no name: it expands to `allowed` after this check, so a name beside it is held to `allowed` too
|
|
19
|
+
*/
|
|
17
20
|
function checkScalars(scalars: readonly string[], allowed: ReadonlySet<string>, report: Report): void {
|
|
18
21
|
for (const field of scalars) {
|
|
19
|
-
if (!allowed.has(field) && !field.startsWith("@")) report(field)
|
|
22
|
+
if (field !== "*" && !allowed.has(field) && !field.startsWith("@")) report(field)
|
|
20
23
|
}
|
|
21
24
|
}
|
|
22
25
|
|
|
@@ -30,9 +33,9 @@ function checkRelation(selection: FieldSelection, { fieldsConfig, name }: Relati
|
|
|
30
33
|
|
|
31
34
|
const relationFields = fieldsConfig.relationFields ?? {}
|
|
32
35
|
const allowed = new Set(Object.hasOwn(relationFields, name) ? relationFields[name] : [])
|
|
36
|
+
checkScalars(selection.scalars, allowed, (field) => report(`Unknown ${name} field: ${field}`))
|
|
33
37
|
/* expand nested wildcard to all allowed fields */
|
|
34
38
|
if (selection.scalars.includes("*")) selection.scalars = [...allowed]
|
|
35
|
-
checkScalars(selection.scalars, allowed, (field) => report(`Unknown ${name} field: ${field}`))
|
|
36
39
|
}
|
|
37
40
|
|
|
38
41
|
/** The parsed selection, checked against `fieldsConfig`; null when there is none or it does not parse */
|
|
@@ -54,9 +57,9 @@ function validateSelectWithConfig(
|
|
|
54
57
|
return null
|
|
55
58
|
}
|
|
56
59
|
|
|
60
|
+
checkScalars(parsed.root.scalars, new Set(fieldsConfig.scalars), (field) => report(`Unknown field: ${field}`))
|
|
57
61
|
/* Handle * wildcard at top level — expand to all scalars */
|
|
58
62
|
if (parsed.root.scalars.includes("*")) parsed.root.scalars = [...fieldsConfig.scalars]
|
|
59
|
-
checkScalars(parsed.root.scalars, new Set(fieldsConfig.scalars), (field) => report(`Unknown field: ${field}`))
|
|
60
63
|
|
|
61
64
|
const relations = new Set(fieldsConfig.relations ?? [])
|
|
62
65
|
/* parseSelect stores a selection for every embed, never null */
|
|
@@ -141,6 +141,14 @@ const NUMERIC_TEXT = /^(?:-?\d+(?:\.\d+)?|NaN|-?Infinity)$/
|
|
|
141
141
|
const carriesOpaque = (column: SQLWrapper | undefined): boolean =>
|
|
142
142
|
is(column, Column) && column.dataType === "custom" && !is(column, SQLiteColumn)
|
|
143
143
|
|
|
144
|
+
/**
|
|
145
|
+
* `cast` as an operand of no affinity, as a bound parameter is: a CAST has its type's affinity, which
|
|
146
|
+
* SQLite applies to a column of none or BLOB's before it compares, so `k > cast(? as real)` read a
|
|
147
|
+
* stored TEXT '10' as 10 and paged it out of the column's own order. The unary `+` drops the affinity
|
|
148
|
+
* and keeps the index search
|
|
149
|
+
*/
|
|
150
|
+
const affinityFree = (cast: SQL): SQL => sql`+${cast}`
|
|
151
|
+
|
|
144
152
|
/**
|
|
145
153
|
* A cursor value as its key binds it. Stored text the list carried (`carried`, the cursor's flag)
|
|
146
154
|
* binds as itself, past the column's mapper: cast to numeric on a key that reads rounded, and on a
|
|
@@ -150,12 +158,12 @@ const carriesOpaque = (column: SQLWrapper | undefined): boolean =>
|
|
|
150
158
|
*/
|
|
151
159
|
function boundCarried(column: SQLWrapper | undefined, value: unknown, carried: boolean): unknown {
|
|
152
160
|
/* one SQLite parse of the text the list checked reads back as the key, on every driver */
|
|
153
|
-
if (value instanceof RealText) return sql`cast(${value.text} as real)`
|
|
161
|
+
if (value instanceof RealText) return affinityFree(sql`cast(${value.text} as real)`)
|
|
154
162
|
if (carriedText(column, value, { asRead: false, carried })) return sql`${value}`
|
|
155
163
|
/* a mode's mapper binds the value as another (a boolean's as 0 or 1); D1 binds no bigint, so one past 2^53 goes as its digits */
|
|
156
164
|
if (carriedStored(column, value, { asRead: false, carried }))
|
|
157
165
|
return typeof value === "bigint" && !Number.isSafeInteger(Number(value))
|
|
158
|
-
? sql`cast(${String(value)} as integer)`
|
|
166
|
+
? affinityFree(sql`cast(${String(value)} as integer)`)
|
|
159
167
|
: sql`${bindable(value)}`
|
|
160
168
|
if (!carried || typeof value !== "string" || !NUMERIC_TEXT.test(value)) return value
|
|
161
169
|
if (readsRounded(column)) return sql`${value}::numeric`
|
package/src/query/trusted.ts
CHANGED
|
@@ -84,10 +84,15 @@ function invalidPage(page: unknown): CombError {
|
|
|
84
84
|
})
|
|
85
85
|
}
|
|
86
86
|
|
|
87
|
+
/** The most digits of a page past `maxPage` its message names */
|
|
88
|
+
const PAGE_SHOWN = 24
|
|
89
|
+
|
|
87
90
|
/** The 400 for a page past `maxPage`, from a list schema or from a list no schema bounded */
|
|
88
|
-
function pageTooDeep(page: number, maxPage: number): CombError {
|
|
91
|
+
function pageTooDeep(page: number | string, maxPage: number): CombError {
|
|
92
|
+
/* a page of any size reaches here as digits, so the message keeps the front of it, not all */
|
|
93
|
+
const shown = String(page)
|
|
89
94
|
return new CombError({
|
|
90
|
-
cause: `page ${
|
|
95
|
+
cause: `page ${shown.length > PAGE_SHOWN ? `${shown.slice(0, PAGE_SHOWN)}…` : shown} is past ${maxPage}; page further by cursor`,
|
|
91
96
|
errorKey: combErrorKeys.PAGE_TOO_DEEP,
|
|
92
97
|
status: "bad_request",
|
|
93
98
|
})
|
package/src/sqlite/columns.ts
CHANGED
|
@@ -21,6 +21,8 @@ import type {
|
|
|
21
21
|
EnumOptions,
|
|
22
22
|
IntegerConstraints,
|
|
23
23
|
JsonConstraints,
|
|
24
|
+
RealConstraints,
|
|
25
|
+
RefConstraints,
|
|
24
26
|
TextConstraints,
|
|
25
27
|
TimestampConstraints,
|
|
26
28
|
} from "./constraints.ts"
|
|
@@ -67,9 +69,9 @@ export type SqliteColumns = {
|
|
|
67
69
|
_constraints?: JsonConstraints,
|
|
68
70
|
) => $Type<SQLiteTextJsonBuilder, z.infer<TSchema>>
|
|
69
71
|
/** a floating-point REAL */
|
|
70
|
-
real: (name: string, _constraints?:
|
|
72
|
+
real: (name: string, _constraints?: RealConstraints) => SQLiteRealBuilder
|
|
71
73
|
/** a TEXT foreign key; chain `.references()` to name the column it points at */
|
|
72
|
-
ref: (name: string, _constraints?:
|
|
74
|
+
ref: (name: string, _constraints?: RefConstraints) => Text
|
|
73
75
|
/** the auto-incrementing INTEGER primary key `id`, filled by the database */
|
|
74
76
|
serialId: () => IsPrimaryKey<HasDefault<NotNull<SQLiteIntegerBuilder>>>
|
|
75
77
|
/** a TEXT column; a declared `max` also becomes its declared length */
|
|
@@ -122,10 +124,10 @@ export const c: SqliteColumns = {
|
|
|
122
124
|
withCombColumn(text(name, { mode: "json" }).$type<z.infer<TSchema>>(), { constraints, kind: "json", schema }),
|
|
123
125
|
|
|
124
126
|
/* Floating point */
|
|
125
|
-
real: (name: string, constraints?:
|
|
127
|
+
real: (name: string, constraints?: RealConstraints) => withCombColumn(real(name), { constraints, kind: "real" }),
|
|
126
128
|
|
|
127
129
|
/* Foreign key reference - use with .references() */
|
|
128
|
-
ref: (name: string, constraints?:
|
|
130
|
+
ref: (name: string, constraints?: RefConstraints) => withCombColumn(text(name), { constraints, kind: "ref" }),
|
|
129
131
|
|
|
130
132
|
/* Auto-increment integer primary key */
|
|
131
133
|
serialId: () =>
|
|
@@ -2,8 +2,10 @@
|
|
|
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"
|
|
5
7
|
|
|
6
|
-
|
|
8
|
+
/** What every helper's constraints take: the DTO, mutation, privacy, relation and tenant flags */
|
|
7
9
|
type BaseConstraints = {
|
|
8
10
|
/** Field is filled by comb or the database: generated create and update DTOs leave it out */
|
|
9
11
|
autogenerate?: boolean | undefined
|
|
@@ -86,13 +88,86 @@ type StringValidationConstraints = {
|
|
|
86
88
|
export type TextConstraints = BaseConstraints &
|
|
87
89
|
StringTransformConstraints &
|
|
88
90
|
NumericRangeConstraints &
|
|
89
|
-
StringValidationConstraints
|
|
91
|
+
StringValidationConstraints & {
|
|
92
|
+
/**
|
|
93
|
+
* The standard a written text holds: the generated DTOs run the format's trim and case, then hold the
|
|
94
|
+
* value to its pattern and, where it names one, its pinned registry, and publish the id as `x-comb-format`.
|
|
95
|
+
* A value it refuses is one zod `invalid_format` issue carrying the id, worded by zod's locale. One of:
|
|
96
|
+
* - `base64url`: RFC 4648 §5 base64url, unpadded; `dGVzdA`; pattern only
|
|
97
|
+
* - `bcp47`: BCP 47 language tag, RFC 5646 §2.1 well-formed; `zh-Hant-TW`; pattern only
|
|
98
|
+
* - `e164`: ITU-T E.164 phone number, + and up to 15 digits; `+385911234567`; pattern only
|
|
99
|
+
* - `iana-time-zone`: IANA time zone name, tzdata 2026f; `Europe/Zagreb`; registry
|
|
100
|
+
* - `ip`: IPv4 dotted quad or IPv6 address, RFC 4291 §2.2; `2001:db8::1`; pattern only
|
|
101
|
+
* - `ipv4`: IPv4 address, dotted quad without leading zeros; `192.0.2.1`; pattern only
|
|
102
|
+
* - `ipv6`: IPv6 address, RFC 4291 §2.2; `2001:db8::1`; pattern only
|
|
103
|
+
* - `iso3166-1-alpha-2`: ISO 3166-1 alpha-2 country code, Debian iso-codes v4.20.1; `HR`; registry
|
|
104
|
+
* - `iso3166-1-alpha-3`: ISO 3166-1 alpha-3 country code, Debian iso-codes v4.20.1; `HRV`; registry
|
|
105
|
+
* - `iso4217`: ISO 4217 alphabetic currency code, SIX list 2026-09-17; `EUR`; registry
|
|
106
|
+
* - `iso639-1`: ISO 639-1 language code, Debian iso-codes v4.20.1; `hr`; registry
|
|
107
|
+
* - `kebab-slug`: kebab-case slug, lowercase letters and digits joined by single hyphens; `spring-sale-2026`; pattern only
|
|
108
|
+
* - `pkce-s256-challenge`: RFC 7636 §4.2 PKCE SHA-256 code challenge; `E9Melhoa2OwvFrEMTJguCHaoeK1t8URWbuGJSstw-cM`; pattern only
|
|
109
|
+
* - `rfc1123-hostname`: RFC 1123 §2.1 host name; `api.example.com`; pattern only
|
|
110
|
+
* - `semver`: Semantic Versioning 2.0.0 version; `1.4.0-rc.1`; pattern only
|
|
111
|
+
* - `sha256-hex`: SHA-256 digest, FIPS 180-4, lowercase hex; `e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855`; pattern only
|
|
112
|
+
* - `sha512-hex`: SHA-512 digest, FIPS 180-4, lowercase hex; `cf83e1357eefb8bdf1542850d66d8007d620e4050b5715dc83f4a921d36ce9ce47d0d13c5d85f2b0ff8318d2877eec2f63b931bd47417a81a538327af927da3e`; pattern only
|
|
113
|
+
* - `srgb-hex`: sRGB color as #rrggbb, CSS Color 4; `#1e90ff`; pattern only
|
|
114
|
+
* - `srgb-hex-alpha`: sRGB color with alpha as #rrggbbaa, CSS Color 4; `#1e90ff80`; pattern only
|
|
115
|
+
* - `ulid`: ULID, Crockford base32 in lowercase; `01hzy3k8q2m4n5p6r7s8t9v0wx`; pattern only
|
|
116
|
+
* - `uts35-ca`: UTS #35 calendar (ca) key value, CLDR 49; `gregory`; pattern only
|
|
117
|
+
* - `uts35-fw`: UTS #35 first day of the week (fw) key value, CLDR 49; `mon`; pattern only
|
|
118
|
+
* - `uts35-hc`: UTS #35 hour cycle (hc) key value, CLDR 49; `h23`; pattern only
|
|
119
|
+
* - `uts35-ms`: UTS #35 measurement system (ms) key value, CLDR 49; `metric`; pattern only
|
|
120
|
+
* - `uts35-mu`: UTS #35 measurement unit (mu) key value, CLDR 49; `celsius`; pattern only
|
|
121
|
+
* - `uts35-nu`: UTS #35 numbering system (nu) key value, CLDR 49; `latn`; pattern only
|
|
122
|
+
* - `uuid`: RFC 9562 UUID, lowercase hex; `0f8fad5b-d9cb-469f-a165-70867728950e`; pattern only
|
|
123
|
+
* - `uuid-v4`: RFC 9562 UUID version 4, lowercase hex; `0f8fad5b-d9cb-469f-a165-70867728950e`; pattern only
|
|
124
|
+
* - `uuid-v7`: RFC 9562 UUID version 7, lowercase hex; `01890a5d-ac96-774b-bcce-b302099a8057`; pattern only
|
|
125
|
+
*/
|
|
126
|
+
format?: TextFormat | undefined
|
|
127
|
+
/**
|
|
128
|
+
* An exported zod schema the generated DTOs pipe the value into after every other rule, on the
|
|
129
|
+
* transformed value; its issues reach the caller as zod yields them, and its input JSON Schema is
|
|
130
|
+
* published beside `x-comb-schema`. Codegen imports it as it imports a `c.json` schema, so export it
|
|
131
|
+
* from a module of its own, or above the table that names it
|
|
132
|
+
*/
|
|
133
|
+
schema?: z.ZodType<string, string> | undefined
|
|
134
|
+
}
|
|
90
135
|
|
|
91
136
|
/**
|
|
92
|
-
*
|
|
137
|
+
* Floating-point column constraints: its bounds, and an exported zod schema its value is piped into
|
|
93
138
|
* Closed record - only these properties allowed
|
|
94
139
|
*/
|
|
95
|
-
export type
|
|
140
|
+
export type RealConstraints = BaseConstraints &
|
|
141
|
+
NumericRangeConstraints & {
|
|
142
|
+
/**
|
|
143
|
+
* An exported zod schema the generated DTOs pipe the value into after its bounds; its issues reach
|
|
144
|
+
* the caller as zod yields them, and its input JSON Schema is published beside `x-comb-schema`.
|
|
145
|
+
* Codegen imports it as it imports a `c.json` schema, so export it from a module of its own, or
|
|
146
|
+
* above the table that names it
|
|
147
|
+
*/
|
|
148
|
+
schema?: z.ZodType<number, number> | undefined
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
/**
|
|
152
|
+
* Integer column constraints: a real's, and the standard `format` that numbers its values
|
|
153
|
+
* Closed record - only these properties allowed
|
|
154
|
+
*/
|
|
155
|
+
export type IntegerConstraints = RealConstraints & {
|
|
156
|
+
/**
|
|
157
|
+
* The standard that numbers the value: its range bounds the generated DTOs, the tighter of it and a
|
|
158
|
+
* declared `min` or `max` winning, and they publish the id as `x-comb-format`. One of:
|
|
159
|
+
* - `iso8601-month`: ISO 8601 month number, 1 January to 12 December; `3`
|
|
160
|
+
* - `iso8601-weekday`: ISO 8601 §3.2.2 weekday number, 1 Monday to 7 Sunday; `1`
|
|
161
|
+
*/
|
|
162
|
+
format?: IntegerFormat | undefined
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
/**
|
|
166
|
+
* Foreign key column constraints: a text's but `format` and `schema`, as the value is another
|
|
167
|
+
* table's key, held to that key's own rules
|
|
168
|
+
* Closed record - only these properties allowed
|
|
169
|
+
*/
|
|
170
|
+
export type RefConstraints = Omit<TextConstraints, "format" | "schema">
|
|
96
171
|
|
|
97
172
|
/**
|
|
98
173
|
* JSON column constraints
|
|
@@ -126,6 +201,45 @@ export type EnumStates<TState extends string = string> = {
|
|
|
126
201
|
transitions?: { readonly [K in TState]?: readonly TState[] | undefined } | undefined
|
|
127
202
|
}
|
|
128
203
|
|
|
129
|
-
/**
|
|
204
|
+
/**
|
|
205
|
+
* What `c.enum` takes beside its values: its state machine, the `nomutate`, `private` and `tenant`
|
|
206
|
+
* flags every helper takes, and the standard `format` its values are written in, which codegen holds
|
|
207
|
+
* each value to and publishes as `x-comb-format`
|
|
208
|
+
*/
|
|
130
209
|
export type EnumOptions<TState extends string = string> = EnumStates<TState> &
|
|
131
|
-
Pick<BaseConstraints, "nomutate" | "private" | "tenant">
|
|
210
|
+
Pick<BaseConstraints, "nomutate" | "private" | "tenant"> & {
|
|
211
|
+
/**
|
|
212
|
+
* The standard the values are written in: codegen refuses a value the format does not take as written,
|
|
213
|
+
* and the DTOs publish the id as `x-comb-format`; the values stay the rule. One of:
|
|
214
|
+
* - `base64url`: RFC 4648 §5 base64url, unpadded; `dGVzdA`; pattern only
|
|
215
|
+
* - `bcp47`: BCP 47 language tag, RFC 5646 §2.1 well-formed; `zh-Hant-TW`; pattern only
|
|
216
|
+
* - `e164`: ITU-T E.164 phone number, + and up to 15 digits; `+385911234567`; pattern only
|
|
217
|
+
* - `iana-time-zone`: IANA time zone name, tzdata 2026f; `Europe/Zagreb`; registry
|
|
218
|
+
* - `ip`: IPv4 dotted quad or IPv6 address, RFC 4291 §2.2; `2001:db8::1`; pattern only
|
|
219
|
+
* - `ipv4`: IPv4 address, dotted quad without leading zeros; `192.0.2.1`; pattern only
|
|
220
|
+
* - `ipv6`: IPv6 address, RFC 4291 §2.2; `2001:db8::1`; pattern only
|
|
221
|
+
* - `iso3166-1-alpha-2`: ISO 3166-1 alpha-2 country code, Debian iso-codes v4.20.1; `HR`; registry
|
|
222
|
+
* - `iso3166-1-alpha-3`: ISO 3166-1 alpha-3 country code, Debian iso-codes v4.20.1; `HRV`; registry
|
|
223
|
+
* - `iso4217`: ISO 4217 alphabetic currency code, SIX list 2026-09-17; `EUR`; registry
|
|
224
|
+
* - `iso639-1`: ISO 639-1 language code, Debian iso-codes v4.20.1; `hr`; registry
|
|
225
|
+
* - `kebab-slug`: kebab-case slug, lowercase letters and digits joined by single hyphens; `spring-sale-2026`; pattern only
|
|
226
|
+
* - `pkce-s256-challenge`: RFC 7636 §4.2 PKCE SHA-256 code challenge; `E9Melhoa2OwvFrEMTJguCHaoeK1t8URWbuGJSstw-cM`; pattern only
|
|
227
|
+
* - `rfc1123-hostname`: RFC 1123 §2.1 host name; `api.example.com`; pattern only
|
|
228
|
+
* - `semver`: Semantic Versioning 2.0.0 version; `1.4.0-rc.1`; pattern only
|
|
229
|
+
* - `sha256-hex`: SHA-256 digest, FIPS 180-4, lowercase hex; `e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855`; pattern only
|
|
230
|
+
* - `sha512-hex`: SHA-512 digest, FIPS 180-4, lowercase hex; `cf83e1357eefb8bdf1542850d66d8007d620e4050b5715dc83f4a921d36ce9ce47d0d13c5d85f2b0ff8318d2877eec2f63b931bd47417a81a538327af927da3e`; pattern only
|
|
231
|
+
* - `srgb-hex`: sRGB color as #rrggbb, CSS Color 4; `#1e90ff`; pattern only
|
|
232
|
+
* - `srgb-hex-alpha`: sRGB color with alpha as #rrggbbaa, CSS Color 4; `#1e90ff80`; pattern only
|
|
233
|
+
* - `ulid`: ULID, Crockford base32 in lowercase; `01hzy3k8q2m4n5p6r7s8t9v0wx`; pattern only
|
|
234
|
+
* - `uts35-ca`: UTS #35 calendar (ca) key value, CLDR 49; `gregory`; pattern only
|
|
235
|
+
* - `uts35-fw`: UTS #35 first day of the week (fw) key value, CLDR 49; `mon`; pattern only
|
|
236
|
+
* - `uts35-hc`: UTS #35 hour cycle (hc) key value, CLDR 49; `h23`; pattern only
|
|
237
|
+
* - `uts35-ms`: UTS #35 measurement system (ms) key value, CLDR 49; `metric`; pattern only
|
|
238
|
+
* - `uts35-mu`: UTS #35 measurement unit (mu) key value, CLDR 49; `celsius`; pattern only
|
|
239
|
+
* - `uts35-nu`: UTS #35 numbering system (nu) key value, CLDR 49; `latn`; pattern only
|
|
240
|
+
* - `uuid`: RFC 9562 UUID, lowercase hex; `0f8fad5b-d9cb-469f-a165-70867728950e`; pattern only
|
|
241
|
+
* - `uuid-v4`: RFC 9562 UUID version 4, lowercase hex; `0f8fad5b-d9cb-469f-a165-70867728950e`; pattern only
|
|
242
|
+
* - `uuid-v7`: RFC 9562 UUID version 7, lowercase hex; `01890a5d-ac96-774b-bcce-b302099a8057`; pattern only
|
|
243
|
+
*/
|
|
244
|
+
format?: TextFormat | undefined
|
|
245
|
+
}
|
package/types/cli/args.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"args.d.ts","sourceRoot":"","sources":["../../src/cli/args.ts"],"names":[],"mappings":"AAMA,MAAM,MAAM,OAAO,GAChB,SAAS,GACT,eAAe,GACf,kBAAkB,GAClB,eAAe,GACf,cAAc,GACd,cAAc,GACd,gBAAgB,CAAA;AAEnB,MAAM,MAAM,UAAU,GAAG;IACxB,kFAAkF;IAClF,KAAK,CAAC,EAAE,IAAI,GAAG,SAAS,CAAA;IACxB,gCAAgC;IAChC,QAAQ,EAAE,SAAS,OAAO,EAAE,CAAA;IAC5B,WAAW,EAAE,MAAM,CAAA;IACnB,IAAI,EAAE,KAAK,MAAM,EAAE,CAAA;IACnB,KAAK,CAAC,EAAE,IAAI,MAAM,EAAE,GAAG,SAAS,CAAA;IAChC,iDAAiD;IACjD,KAAK,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;CAC1B,CAAA;AAED,eAAO,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B,WAAW,CAAC,OAAO,EAAE,OAAO,GAAG,MAAM,CAGpD"}
|
|
@@ -14,8 +14,11 @@ export declare function findCombConfig(cwd: string): Promise<CodegenConfig | und
|
|
|
14
14
|
export declare function loadCombConfig(cwd: string): Promise<CodegenConfig>;
|
|
15
15
|
/** The database `name` declares, or a CliError naming the ones it does, and `hint` when the caller has one */
|
|
16
16
|
export declare function databaseIn(config: CodegenConfig, name: string, hint?: string): DatabaseCodegen;
|
|
17
|
-
/**
|
|
18
|
-
|
|
17
|
+
/**
|
|
18
|
+
* The tables file `tables` names, resolved against `cwd`, as `what` gave it (--tables, or
|
|
19
|
+
* comb.config.ts `tables`); a CliError when it is missing or not a file
|
|
20
|
+
*/
|
|
21
|
+
export declare function tablesFile(cwd: string, tables: string, what: "--tables" | "tables"): string;
|
|
19
22
|
/** A database comb.config.ts declares FTS on: its tables file and the FTS of each table */
|
|
20
23
|
export type DeclaredFts = {
|
|
21
24
|
fts: Record<string, FtsTableConfig>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"comb-config.d.ts","sourceRoot":"","sources":["../../src/cli/comb-config.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAA;AAC1E,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kCAAkC,CAAA;
|
|
1
|
+
{"version":3,"file":"comb-config.d.ts","sourceRoot":"","sources":["../../src/cli/comb-config.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAA;AAC1E,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kCAAkC,CAAA;AAGtE,OAAO,EAAY,KAAK,KAAK,EAAE,MAAM,aAAa,CAAA;AAElD,YAAY,EAAE,aAAa,EAAE,eAAe,EAAE,CAAA;AAS9C;;;GAGG;AACH,wBAAsB,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC;IAAE,OAAO,CAAC,EAAE,OAAO,CAAA;CAAE,CAAC,CAS7E;AAED,2EAA2E;AAC3E,wBAAsB,cAAc,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,GAAG,SAAS,CAAC,CASpF;AAED,wBAAsB,cAAc,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,CAAC,CAIxE;AAED,8GAA8G;AAC9G,wBAAgB,UAAU,CAAC,MAAM,EAAE,aAAa,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,GAAG,eAAe,CAK9F;AAED;;;GAGG;AACH,wBAAgB,UAAU,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,UAAU,GAAG,QAAQ,GAAG,MAAM,CAK3F;AAED,2FAA2F;AAC3F,MAAM,MAAM,WAAW,GAAG;IAAE,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,cAAc,CAAC,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAAA;AAEjF;;;;GAIG;AACH,wBAAsB,WAAW,CAChC,GAAG,EAAE,MAAM,EACX,EAAE,IAAI,EAAE,IAAI,EAAE,EAAE;IAAE,IAAI,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAAC,IAAI,EAAE,MAAM,GAAG,SAAS,CAAA;CAAE,GACrE,OAAO,CAAC,WAAW,GAAG,SAAS,CAAC,CAKlC;AAED,kGAAkG;AAClG,wBAAsB,MAAM,CAAC,GAAG,EAAE,MAAM,EAAE,QAAQ,EAAE,WAAW,EAAE,EAAE,EAAE,KAAK,GAAG,OAAO,CAAC,MAAM,CAAC,CAK3F"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Refuse `file`, which `what` names (an option or a config field), when it exists as other than a
|
|
3
|
+
* file, saying what it is, then `fix`; a missing one is left to the caller, which refuses it its own way
|
|
4
|
+
*/
|
|
5
|
+
export declare function refuseNotFile(file: string, what: string, fix: string): void;
|
|
6
|
+
/**
|
|
7
|
+
* Refuse a name a file is made from, `what` naming it, when it would name a path: one holding a
|
|
8
|
+
* separator, or `.` or `..` alone; then `usage`
|
|
9
|
+
*/
|
|
10
|
+
export declare function refusePathName(name: string, what: string, usage: string): void;
|
|
11
|
+
//# sourceMappingURL=file-path.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"file-path.d.ts","sourceRoot":"","sources":["../../src/cli/file-path.ts"],"names":[],"mappings":"AAOA;;;GAGG;AACH,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,IAAI,CAI3E;AAED;;;GAGG;AACH,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,IAAI,CAG9E"}
|
|
@@ -2,6 +2,7 @@ import { type Peers } from "../migrate/core/optional-peer.ts";
|
|
|
2
2
|
import type { Command, Provider } from "../migrate/core/peer-needs.ts";
|
|
3
3
|
import { type CliContext } from "./output.ts";
|
|
4
4
|
type Mode = "apply" | "baseline" | "check" | "status";
|
|
5
|
+
/** `migrate apply|baseline|check|status`, with --json as one JSON object (migrate-json.ts) */
|
|
5
6
|
export declare function migrateApply(mode: Mode, argv: readonly string[], io: CliContext): Promise<void>;
|
|
6
7
|
/**
|
|
7
8
|
* Every peer `command` on `provider` needs, Atlas's version read through `io` among them, refused
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"migrate-apply.d.ts","sourceRoot":"","sources":["../../src/cli/migrate-apply.ts"],"names":[],"mappings":"AA2BA,OAAO,EAAS,KAAK,KAAK,EAAgB,MAAM,kCAAkC,CAAA;AAClF,OAAO,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,+BAA+B,CAAA;AAQtE,OAAO,EAAyB,KAAK,UAAU,
|
|
1
|
+
{"version":3,"file":"migrate-apply.d.ts","sourceRoot":"","sources":["../../src/cli/migrate-apply.ts"],"names":[],"mappings":"AA2BA,OAAO,EAAS,KAAK,KAAK,EAAgB,MAAM,kCAAkC,CAAA;AAClF,OAAO,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,+BAA+B,CAAA;AAQtE,OAAO,EAAyB,KAAK,UAAU,EAAuB,MAAM,aAAa,CAAA;AAEzF,KAAK,IAAI,GAAG,OAAO,GAAG,UAAU,GAAG,OAAO,GAAG,QAAQ,CAAA;AA+LrD,8FAA8F;AAC9F,wBAAsB,YAAY,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,SAAS,MAAM,EAAE,EAAE,EAAE,EAAE,UAAU,GAAG,OAAO,CAAC,IAAI,CAAC,CAIrG;AAED;;;GAGG;AACH,wBAAsB,SAAS,CAC9B,EAAE,EAAE,UAAU,EACd,OAAO,EAAE,OAAO,EAChB,EAAE,GAAG,EAAE,QAAQ,EAAE,EAAE;IAAE,GAAG,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IAAC,QAAQ,EAAE,QAAQ,CAAA;CAAE,GAClE,OAAO,CAAC,KAAK,CAAC,CAGhB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"migrate-d1.d.ts","sourceRoot":"","sources":["../../src/cli/migrate-d1.ts"],"names":[],"mappings":"AAWA,OAAO,EAAE,KAAK,UAAU,EAAqB,MAAM,4BAA4B,CAAA;AAE/E,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAA;AAC3D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,WAAW,CAAA;AAC3C,OAAO,EAAE,KAAK,aAAa,EAAe,MAAM,qBAAqB,CAAA;
|
|
1
|
+
{"version":3,"file":"migrate-d1.d.ts","sourceRoot":"","sources":["../../src/cli/migrate-d1.ts"],"names":[],"mappings":"AAWA,OAAO,EAAE,KAAK,UAAU,EAAqB,MAAM,4BAA4B,CAAA;AAE/E,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAA;AAC3D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,WAAW,CAAA;AAC3C,OAAO,EAAE,KAAK,aAAa,EAAe,MAAM,qBAAqB,CAAA;AAErE,OAAO,EAAyB,KAAK,UAAU,EAAE,KAAK,cAAc,EAAE,MAAM,aAAa,CAAA;AAEzF,KAAK,MAAM,GAAG,OAAO,GAAG,UAAU,GAAG,OAAO,GAAG,QAAQ,CAAA;AAEvD,8DAA8D;AAC9D,KAAK,SAAS,GAAG;IAAE,IAAI,EAAE,UAAU,CAAC;IAAC,EAAE,EAAE,MAAM,CAAC;IAAC,EAAE,EAAE,UAAU,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,CAAA;AAE/E,gGAAgG;AAChG,iBAAS,QAAQ,CAAC,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,aAAa,GAAG,SAAS,GAAG;IAAE,MAAM,EAAE,gBAAgB,CAAC;IAAC,GAAG,EAAE,MAAM,CAAA;CAAE,CAkBpH;AAED,qHAAqH;AACrH,OAAO,EAAE,QAAQ,EAAE,CAAA;AAEnB,wBAAsB,SAAS,CAC9B,OAAO,EAAE,SAAS,EAClB,QAAQ,EAAE,aAAa,GAAG,SAAS,EACnC,QAAQ,EAAE,UAAU,GAClB,OAAO,CAAC,cAAc,CAAC,CAmDzB"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { type CliContext, type MigrateOutcome } from "./output.ts";
|
|
2
|
+
/** `run` on `db`, its human lines on stderr and its one JSON object on `io.out` */
|
|
3
|
+
export declare function asJson(db: string, io: CliContext, run: (io: CliContext) => Promise<MigrateOutcome>): Promise<void>;
|
|
4
|
+
//# sourceMappingURL=migrate-json.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"migrate-json.d.ts","sourceRoot":"","sources":["../../src/cli/migrate-json.ts"],"names":[],"mappings":"AAWA,OAAO,EAAE,KAAK,UAAU,EAAE,KAAK,cAAc,EAAY,MAAM,aAAa,CAAA;AAK5E,mFAAmF;AACnF,wBAAsB,MAAM,CAC3B,EAAE,EAAE,MAAM,EACV,EAAE,EAAE,UAAU,EACd,GAAG,EAAE,CAAC,EAAE,EAAE,UAAU,KAAK,OAAO,CAAC,cAAc,CAAC,GAC9C,OAAO,CAAC,IAAI,CAAC,CA0Bf"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"migrate.d.ts","sourceRoot":"","sources":["../../src/cli/migrate.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"migrate.d.ts","sourceRoot":"","sources":["../../src/cli/migrate.ts"],"names":[],"mappings":"AAiBA,OAAO,EAAY,KAAK,UAAU,EAAY,MAAM,aAAa,CAAA;AA+OjE,wBAAsB,UAAU,CAAC,IAAI,EAAE,SAAS,MAAM,EAAE,EAAE,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CA2BrG"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { IntegerFormat, TextFormat } from "../formats/catalog.ts";
|
|
1
2
|
import type { CombColumnKind } from "../meta/column.ts";
|
|
2
3
|
/**
|
|
3
4
|
* TableMeta — serializable intermediate format produced by TableAnalyzer.
|
|
@@ -9,6 +10,8 @@ type FieldConstraintsMeta = {
|
|
|
9
10
|
autogenerate: boolean;
|
|
10
11
|
/** the generated DTOs take only an email address */
|
|
11
12
|
email: boolean;
|
|
13
|
+
/** the standard the value is held to: a text's or an enum's text format, an integer's integer format; null when none is declared */
|
|
14
|
+
format: TextFormat | IntegerFormat | null;
|
|
12
15
|
/** an https URL or a data:image/ URI */
|
|
13
16
|
imageUri: boolean;
|
|
14
17
|
/** the generated DTOs lowercase the text before they check it */
|
|
@@ -120,8 +123,10 @@ type FieldMeta = {
|
|
|
120
123
|
isPrimaryKey: boolean;
|
|
121
124
|
/** the name the generated DTO imports a c.json column's schema under, null for any other column */
|
|
122
125
|
jsonSchemaName: string | null;
|
|
123
|
-
/** the names the field's generated schema uses and must import
|
|
126
|
+
/** the names the field's generated schema uses and must import: a c.json schema, or the zod schema a text or number column's `schema` key names */
|
|
124
127
|
schemaImports: ImportRef[];
|
|
128
|
+
/** the input JSON Schema of the zod schema a text or number column's `schema` key names, self-contained and without `$schema`, which the generated DTOs publish beside it; null for any other column. The schema's import is the field's one `schemaImports` entry */
|
|
129
|
+
schemaJson: Readonly<Record<string, unknown>> | null;
|
|
125
130
|
/** a Postgres array's declared dimensions; 0 or absent for a column of one value */
|
|
126
131
|
dimensions?: number | undefined;
|
|
127
132
|
/** whether a Postgres array's elements may be null, as its drizzle type declares; false or absent otherwise */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"analyzer-types.d.ts","sourceRoot":"","sources":["../../src/codegen/analyzer-types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAA;AACvD;;;GAGG;AAEH,8DAA8D;AAC9D,KAAK,oBAAoB,GAAG;IAC3B,uQAAuQ;IACvQ,YAAY,EAAE,OAAO,CAAA;IACrB,oDAAoD;IACpD,KAAK,EAAE,OAAO,CAAA;IACd,wCAAwC;IACxC,QAAQ,EAAE,OAAO,CAAA;IACjB,iEAAiE;IACjE,SAAS,EAAE,OAAO,CAAA;IAClB,uKAAuK;IACvK,GAAG,EAAE,MAAM,GAAG,IAAI,CAAA;IAClB,mFAAmF;IACnF,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAA;IACvB,4FAA4F;IAC5F,GAAG,EAAE,MAAM,GAAG,IAAI,CAAA;IAClB,8DAA8D;IAC9D,IAAI,EAAE,OAAO,CAAA;IACb,wIAAwI;IACxI,OAAO,EAAE,OAAO,CAAA;IAChB,gFAAgF;IAChF,QAAQ,EAAE,OAAO,CAAA;IACjB,wLAAwL;IACxL,QAAQ,EAAE,OAAO,CAAA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,EACX,gBAAgB,EAChB,SAAS,EACT,cAAc,EACd,sBAAsB,EACtB,eAAe,GACf,CAAA"}
|
|
@@ -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,SAAS,EACT,MAAM,EACN,UAAU,EACV,UAAU,EACV,SAAS,EACT,SAAS,EACT,UAAU,EACV,QAAQ,EACR,MAA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AO,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,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;IAC/B,cAAc,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;IACnC,2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,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;AAE5D,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAA;AAiB7C,uGAAuG;AACvG,eAAO,MAAM,S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
|
-
* 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"}
|