@nextlyhq/adapter-drizzle 0.0.2-alpha.67 → 0.0.2-alpha.69
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/adapter-BypoOEEN.d.cts +1166 -0
- package/dist/adapter-CSP-Ek-L.d.ts +1166 -0
- package/dist/index-BYb6cDli.d.ts +1168 -0
- package/dist/index-C4HJsfwA.d.cts +1168 -0
- package/dist/index.cjs +2258 -2183
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +5 -10
- package/dist/index.d.ts +5 -10
- package/dist/index.mjs +2257 -2181
- package/dist/index.mjs.map +1 -1
- package/dist/migrations.cjs +345 -146
- package/dist/migrations.cjs.map +1 -1
- package/dist/migrations.d.cts +93 -110
- package/dist/migrations.d.ts +93 -110
- package/dist/migrations.mjs +344 -144
- package/dist/migrations.mjs.map +1 -1
- package/dist/schema/index.cjs +21 -6
- package/dist/schema/index.cjs.map +1 -1
- package/dist/schema/index.d.cts +5 -116
- package/dist/schema/index.d.ts +5 -116
- package/dist/schema/index.mjs +20 -4
- package/dist/schema/index.mjs.map +1 -1
- package/dist/schema-Bkkr3JMC.d.cts +264 -0
- package/dist/schema-Bkkr3JMC.d.ts +264 -0
- package/dist/schema-name.cjs +34 -12
- package/dist/schema-name.cjs.map +1 -1
- package/dist/schema-name.d.cts +3 -15
- package/dist/schema-name.d.ts +3 -15
- package/dist/schema-name.mjs +33 -10
- package/dist/schema-name.mjs.map +1 -1
- package/dist/text-match.cjs +42 -8
- package/dist/text-match.cjs.map +1 -1
- package/dist/text-match.d.cts +4 -16
- package/dist/text-match.d.ts +4 -16
- package/dist/text-match.mjs +41 -6
- package/dist/text-match.mjs.map +1 -1
- package/dist/types/index.cjs +8 -69
- package/dist/types/index.d.cts +3 -225
- package/dist/types/index.d.ts +3 -225
- package/dist/types/index.mjs +1 -64
- package/dist/types-CNyA1oIm.cjs +185 -0
- package/dist/types-CNyA1oIm.cjs.map +1 -0
- package/dist/types-CaF_5jNk.mjs +150 -0
- package/dist/types-CaF_5jNk.mjs.map +1 -0
- package/dist/version-check.cjs +116 -133
- package/dist/version-check.cjs.map +1 -1
- package/dist/version-check.d.cts +46 -47
- package/dist/version-check.d.ts +46 -47
- package/dist/version-check.mjs +115 -131
- package/dist/version-check.mjs.map +1 -1
- package/package.json +12 -16
- package/dist/adapter-bUAaPzjV.d.cts +0 -1143
- package/dist/adapter-iJ5hbUvL.d.ts +0 -1143
- package/dist/core-CVO7WYDj.d.cts +0 -74
- package/dist/core-CVO7WYDj.d.ts +0 -74
- package/dist/error-BrdknH2s.d.cts +0 -122
- package/dist/error-BrdknH2s.d.ts +0 -122
- package/dist/migration-BqHebSwM.d.ts +0 -831
- package/dist/migration-Bu0WLdX4.d.cts +0 -831
- package/dist/schema-BDn8WfSL.d.cts +0 -200
- package/dist/schema-BIQ0YQZ_.d.ts +0 -200
- package/dist/types/index.cjs.map +0 -1
- package/dist/types/index.mjs.map +0 -1
|
@@ -0,0 +1,185 @@
|
|
|
1
|
+
// src/types/query.ts
|
|
2
|
+
/**
|
|
3
|
+
* Every WHERE clause operator this package DECLARES, as a value.
|
|
4
|
+
*
|
|
5
|
+
* @remarks
|
|
6
|
+
* Declared, not guaranteed executable. Membership here means a `WhereCondition`
|
|
7
|
+
* carrying the operator type-checks — it does NOT mean the adapter can run it.
|
|
8
|
+
* `OVERLAPS` is declared and unimplemented, and throws at build time, so a
|
|
9
|
+
* validator written against this list will admit input the query layer then
|
|
10
|
+
* rejects. Validate against it to catch a misspelled operator; do not read
|
|
11
|
+
* acceptance here as a capability.
|
|
12
|
+
*
|
|
13
|
+
* - Standard comparison: =, !=, <, >, <=, >=
|
|
14
|
+
* - Set operations: IN, NOT IN
|
|
15
|
+
* - Pattern matching: LIKE, ILIKE (case-insensitive, PostgreSQL/emulated)
|
|
16
|
+
* - NULL checks: IS NULL, IS NOT NULL
|
|
17
|
+
* - Range: BETWEEN, NOT BETWEEN
|
|
18
|
+
* - Substring: CONTAINS — a LITERAL match on a TEXT column; see below
|
|
19
|
+
* - Declared but NOT implemented: OVERLAPS, which throws
|
|
20
|
+
*
|
|
21
|
+
* This list is the source of truth and {@link WhereOperator} is derived from it,
|
|
22
|
+
* rather than the two being written out separately. A guard that has to enumerate
|
|
23
|
+
* the operators — a validator over caller input, or a test asserting the builder
|
|
24
|
+
* handles or refuses each one — can only do that from a runtime value, and a
|
|
25
|
+
* hand-kept copy of the union would agree with it on the day it was written and
|
|
26
|
+
* silently stop agreeing the next time a member is added.
|
|
27
|
+
*
|
|
28
|
+
* @public
|
|
29
|
+
*/
|
|
30
|
+
const WHERE_OPERATORS = [
|
|
31
|
+
"=",
|
|
32
|
+
"!=",
|
|
33
|
+
"<",
|
|
34
|
+
">",
|
|
35
|
+
"<=",
|
|
36
|
+
">=",
|
|
37
|
+
"IN",
|
|
38
|
+
"NOT IN",
|
|
39
|
+
"LIKE",
|
|
40
|
+
"ILIKE",
|
|
41
|
+
"IS NULL",
|
|
42
|
+
"IS NOT NULL",
|
|
43
|
+
"BETWEEN",
|
|
44
|
+
"NOT BETWEEN",
|
|
45
|
+
"CONTAINS",
|
|
46
|
+
"ICONTAINS",
|
|
47
|
+
"OVERLAPS"
|
|
48
|
+
];
|
|
49
|
+
// src/types/error.ts
|
|
50
|
+
/**
|
|
51
|
+
* Type guard for DatabaseError.
|
|
52
|
+
*
|
|
53
|
+
* @remarks
|
|
54
|
+
* Checks if an error is a DatabaseError with proper typing.
|
|
55
|
+
*
|
|
56
|
+
* @param error - Error to check
|
|
57
|
+
* @returns True if error is a DatabaseError
|
|
58
|
+
*
|
|
59
|
+
* @public
|
|
60
|
+
*/
|
|
61
|
+
function isDatabaseError(error) {
|
|
62
|
+
return typeof error === "object" && error !== null && "kind" in error && typeof error.kind === "string";
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* The brand every Nextly application error carries.
|
|
66
|
+
*
|
|
67
|
+
* Read through the global symbol registry rather than imported, because the
|
|
68
|
+
* adapters must not depend on the package that defines the error: `Symbol.for`
|
|
69
|
+
* resolves to the same symbol in every module instance, which is why the brand
|
|
70
|
+
* exists in that form to begin with.
|
|
71
|
+
*
|
|
72
|
+
* @internal
|
|
73
|
+
*/
|
|
74
|
+
const APPLICATION_ERROR_BRAND = Symbol.for("nextly/NextlyError");
|
|
75
|
+
/**
|
|
76
|
+
* Whether an error is the application's verdict rather than the database's
|
|
77
|
+
* failure.
|
|
78
|
+
*
|
|
79
|
+
* Work running inside a transaction may throw to roll the write back — a
|
|
80
|
+
* refused value, a permission denial — and such an error is not something the
|
|
81
|
+
* driver produced. Classifying it as a database error replaces its code and its
|
|
82
|
+
* payload with a generic one, so a caller that asked for a refusal is handed an
|
|
83
|
+
* unexplained failure instead, and per-field validation detail is lost on the
|
|
84
|
+
* way out.
|
|
85
|
+
*
|
|
86
|
+
* @param error - Error to check
|
|
87
|
+
* @returns True if the error was raised by application code
|
|
88
|
+
*
|
|
89
|
+
* @public
|
|
90
|
+
*/
|
|
91
|
+
function isApplicationError(error) {
|
|
92
|
+
if (error === null || typeof error !== "object" && typeof error !== "function") return false;
|
|
93
|
+
return error[APPLICATION_ERROR_BRAND] === true;
|
|
94
|
+
}
|
|
95
|
+
/**
|
|
96
|
+
* Create a DatabaseError instance.
|
|
97
|
+
*
|
|
98
|
+
* @remarks
|
|
99
|
+
* Helper function to create properly structured DatabaseError objects.
|
|
100
|
+
*
|
|
101
|
+
* @param options - Error options
|
|
102
|
+
* @returns DatabaseError instance
|
|
103
|
+
*
|
|
104
|
+
* @public
|
|
105
|
+
*/
|
|
106
|
+
function createDatabaseError(options) {
|
|
107
|
+
const error = new Error(options.message);
|
|
108
|
+
error.name = "DatabaseError";
|
|
109
|
+
error.kind = options.kind;
|
|
110
|
+
if (options.code !== void 0) error.code = options.code;
|
|
111
|
+
if (options.constraint !== void 0) error.constraint = options.constraint;
|
|
112
|
+
if (options.table !== void 0) error.table = options.table;
|
|
113
|
+
if (options.column !== void 0) error.column = options.column;
|
|
114
|
+
if (options.detail !== void 0) error.detail = options.detail;
|
|
115
|
+
if (options.hint !== void 0) error.hint = options.hint;
|
|
116
|
+
if (options.cause !== void 0) error.cause = options.cause;
|
|
117
|
+
return error;
|
|
118
|
+
}
|
|
119
|
+
/**
|
|
120
|
+
* The code an adapter gives the error it raises when a request has waited
|
|
121
|
+
* longer than `pool.connectionTimeoutMs` for a database connection.
|
|
122
|
+
*
|
|
123
|
+
* A code of the adapters' own rather than the driver's wording, because the
|
|
124
|
+
* drivers disagree: pg-pool raises a plain `Error` with no code, mysql2 has no
|
|
125
|
+
* such wait to time out, and better-sqlite3 has no pool. Core reads this one
|
|
126
|
+
* code to answer with its retryable "database busy" error.
|
|
127
|
+
*
|
|
128
|
+
* @public
|
|
129
|
+
*/
|
|
130
|
+
const POOL_WAIT_TIMEOUT_CODE = "NEXTLY_POOL_WAIT_TIMEOUT";
|
|
131
|
+
/**
|
|
132
|
+
* The error for a request that waited `boundMs` for a database connection and
|
|
133
|
+
* was given none.
|
|
134
|
+
*
|
|
135
|
+
* @param boundMs - The bound it waited, `pool.connectionTimeoutMs`
|
|
136
|
+
* @param cause - The driver's own error, when the driver raised one
|
|
137
|
+
*
|
|
138
|
+
* @public
|
|
139
|
+
*/
|
|
140
|
+
function poolWaitTimeoutError(boundMs, cause) {
|
|
141
|
+
return createDatabaseError({
|
|
142
|
+
kind: "timeout",
|
|
143
|
+
code: POOL_WAIT_TIMEOUT_CODE,
|
|
144
|
+
message: `Waited ${boundMs} ms for a database connection, and none was free`,
|
|
145
|
+
cause
|
|
146
|
+
});
|
|
147
|
+
}
|
|
148
|
+
Object.defineProperty(exports, "POOL_WAIT_TIMEOUT_CODE", {
|
|
149
|
+
enumerable: true,
|
|
150
|
+
get: function() {
|
|
151
|
+
return POOL_WAIT_TIMEOUT_CODE;
|
|
152
|
+
}
|
|
153
|
+
});
|
|
154
|
+
Object.defineProperty(exports, "WHERE_OPERATORS", {
|
|
155
|
+
enumerable: true,
|
|
156
|
+
get: function() {
|
|
157
|
+
return WHERE_OPERATORS;
|
|
158
|
+
}
|
|
159
|
+
});
|
|
160
|
+
Object.defineProperty(exports, "createDatabaseError", {
|
|
161
|
+
enumerable: true,
|
|
162
|
+
get: function() {
|
|
163
|
+
return createDatabaseError;
|
|
164
|
+
}
|
|
165
|
+
});
|
|
166
|
+
Object.defineProperty(exports, "isApplicationError", {
|
|
167
|
+
enumerable: true,
|
|
168
|
+
get: function() {
|
|
169
|
+
return isApplicationError;
|
|
170
|
+
}
|
|
171
|
+
});
|
|
172
|
+
Object.defineProperty(exports, "isDatabaseError", {
|
|
173
|
+
enumerable: true,
|
|
174
|
+
get: function() {
|
|
175
|
+
return isDatabaseError;
|
|
176
|
+
}
|
|
177
|
+
});
|
|
178
|
+
Object.defineProperty(exports, "poolWaitTimeoutError", {
|
|
179
|
+
enumerable: true,
|
|
180
|
+
get: function() {
|
|
181
|
+
return poolWaitTimeoutError;
|
|
182
|
+
}
|
|
183
|
+
});
|
|
184
|
+
|
|
185
|
+
//# sourceMappingURL=types-CNyA1oIm.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types-CNyA1oIm.cjs","names":[],"sources":["../src/types/query.ts","../src/types/error.ts"],"sourcesContent":["/**\n * Query building type definitions for database-agnostic queries.\n *\n * @packageDocumentation\n */\n\nimport type { SqlParam } from \"./core\";\n\n/**\n * Every WHERE clause operator this package DECLARES, as a value.\n *\n * @remarks\n * Declared, not guaranteed executable. Membership here means a `WhereCondition`\n * carrying the operator type-checks — it does NOT mean the adapter can run it.\n * `OVERLAPS` is declared and unimplemented, and throws at build time, so a\n * validator written against this list will admit input the query layer then\n * rejects. Validate against it to catch a misspelled operator; do not read\n * acceptance here as a capability.\n *\n * - Standard comparison: =, !=, <, >, <=, >=\n * - Set operations: IN, NOT IN\n * - Pattern matching: LIKE, ILIKE (case-insensitive, PostgreSQL/emulated)\n * - NULL checks: IS NULL, IS NOT NULL\n * - Range: BETWEEN, NOT BETWEEN\n * - Substring: CONTAINS — a LITERAL match on a TEXT column; see below\n * - Declared but NOT implemented: OVERLAPS, which throws\n *\n * This list is the source of truth and {@link WhereOperator} is derived from it,\n * rather than the two being written out separately. A guard that has to enumerate\n * the operators — a validator over caller input, or a test asserting the builder\n * handles or refuses each one — can only do that from a runtime value, and a\n * hand-kept copy of the union would agree with it on the day it was written and\n * silently stop agreeing the next time a member is added.\n *\n * @public\n */\nexport const WHERE_OPERATORS = [\n \"=\",\n \"!=\",\n \"<\",\n \">\",\n \"<=\",\n \">=\",\n \"IN\",\n \"NOT IN\",\n \"LIKE\",\n \"ILIKE\",\n \"IS NULL\",\n \"IS NOT NULL\",\n \"BETWEEN\",\n \"NOT BETWEEN\",\n // Substring match on a TEXT column, with the value taken literally. Despite the name it is\n // not JSON containment, and it is not safe to point at a JSON column: the builder emits a\n // bare `LIKE` with no cast, so on PostgreSQL a `json`/`jsonb` column has no matching operator\n // and the statement ERRORS (`operator does not exist: jsonb ~~ text`). MySQL and SQLite\n // coerce, and there it searches the serialized text — which hits a key name as readily as a\n // value. Text columns only, and a search rather than a containment check.\n \"CONTAINS\",\n // CONTAINS without regard to case: a substring match on a TEXT column with the value taken\n // literally (`%` and `_` are characters to find, not wildcards), ignoring case on every\n // dialect even where the column's collation is case-sensitive. Which letters fold is the\n // database's `lower()` under the column's collation: the collation's Unicode version on\n // MySQL; non-ASCII too under a linguistic PostgreSQL collation; ASCII letters only on\n // SQLite and under PostgreSQL's `C` or `POSIX`.\n \"ICONTAINS\",\n // Declared, never implemented — the builder throws `Unsupported operator: OVERLAPS`. Kept in\n // the union because removing it would be a breaking change to a published type; the refusal\n // is pinned by a test so implementing it has to come through here.\n \"OVERLAPS\",\n] as const;\n\n/**\n * Every WHERE clause operator this package declares. Derived from\n * {@link WHERE_OPERATORS}, and carrying the same caveat: a value of this type\n * type-checks, which is not the same as the adapter being able to execute it.\n *\n * @public\n */\nexport type WhereOperator = (typeof WHERE_OPERATORS)[number];\n\n/**\n * Individual WHERE condition.\n *\n * @remarks\n * Represents a single condition in a WHERE clause. For IS NULL and IS NOT NULL\n * operators, the value field is optional.\n *\n * @public\n */\nexport interface WhereCondition {\n /** Column name to filter on */\n column: string;\n\n /** Comparison operator */\n op: WhereOperator;\n\n /** Value(s) to compare against (optional for IS NULL/IS NOT NULL) */\n value?: SqlParam | SqlParam[];\n\n /** Second value for BETWEEN operator */\n valueTo?: SqlParam;\n}\n\n/**\n * Complex WHERE clause with logical operators.\n *\n * @remarks\n * Supports nested conditions with AND, OR, and NOT logical operators.\n * Can be recursively nested for complex queries.\n *\n * @example\n * ```typescript\n * const where: WhereClause = {\n * and: [\n * { column: \"status\", op: \"=\", value: \"published\" },\n * {\n * or: [\n * { column: \"author\", op: \"=\", value: \"john\" },\n * { column: \"author\", op: \"=\", value: \"jane\" }\n * ]\n * }\n * ]\n * };\n * ```\n *\n * @public\n */\nexport interface WhereClause {\n /** All conditions must be true (AND) */\n and?: (WhereCondition | WhereClause)[];\n\n /** At least one condition must be true (OR) */\n or?: (WhereCondition | WhereClause)[];\n\n /** Negate a condition (NOT) */\n not?: WhereCondition | WhereClause;\n}\n\n/**\n * ORDER BY specification for query results.\n *\n * @remarks\n * Controls the sorting of query results. NULL handling varies by database\n * but can be explicitly controlled with the nulls field.\n *\n * @public\n */\nexport interface OrderBySpec {\n /** Column name to sort by */\n column: string;\n\n /** Sort direction (default: asc) */\n direction?: \"asc\" | \"desc\";\n\n /** NULL value ordering (database-specific defaults vary) */\n nulls?: \"first\" | \"last\";\n}\n\n/**\n * JOIN specification for table joins.\n *\n * @remarks\n * Supports different types of JOINs. Note that complex joins may require\n * dialect-specific handling.\n *\n * @public\n */\nexport interface JoinSpec {\n /** Type of join */\n type: \"inner\" | \"left\" | \"right\" | \"full\";\n\n /** Table name to join */\n table: string;\n\n /** Join condition */\n on: {\n /** Column from the left table */\n leftColumn: string;\n /** Column from the right table */\n rightColumn: string;\n };\n\n /** Optional alias for the joined table */\n alias?: string;\n}\n","/**\n * Database error type definitions.\n *\n * @packageDocumentation\n */\n\n/**\n * Database error classification.\n *\n * @remarks\n * Categorizes database errors for consistent error handling across adapters.\n * Each adapter translates database-specific error codes to these kinds.\n *\n * @public\n */\nexport type DatabaseErrorKind =\n | \"connection\" // Connection/network errors\n | \"query\" // Syntax or execution errors\n | \"constraint\" // Generic constraint violation\n | \"unique_violation\" // Unique constraint violation\n | \"foreign_key_violation\" // Foreign key constraint violation\n | \"check_violation\" // Check constraint violation\n | \"not_null_violation\" // NOT NULL constraint violation\n | \"deadlock\" // Transaction deadlock\n | \"timeout\" // Query or connection timeout\n | \"serialization_failure\" // Serializable transaction conflict\n | \"unsupported_version\" // F17: DB version below minimum or unparseable at connect\n | \"unknown\"; // Unclassified error\n\n/**\n * Enhanced database error interface.\n *\n * @remarks\n * Extends the standard Error interface with database-specific context.\n * Adapters should throw errors implementing this interface for consistent\n * error handling.\n *\n * @example\n * ```typescript\n * try {\n * await adapter.insert('users', { email: 'duplicate@example.com' });\n * } catch (error) {\n * if (isDatabaseError(error) && error.kind === 'unique_violation') {\n * console.log(`Duplicate ${error.column} in ${error.table}`);\n * }\n * }\n * ```\n *\n * @public\n */\nexport interface DatabaseError extends Error {\n /** Error classification */\n kind: DatabaseErrorKind;\n\n /** Database-specific error code (e.g., \"23505\" for PostgreSQL unique violation) */\n code?: string;\n\n /** Constraint name that was violated (if applicable) */\n constraint?: string;\n\n /** Table name involved in the error */\n table?: string;\n\n /** Column name involved in the error */\n column?: string;\n\n /** Detailed error description from the database */\n detail?: string;\n\n /** Hint for resolving the error */\n hint?: string;\n\n /** Original error from the database driver */\n cause?: Error;\n}\n\n/**\n * Type guard for DatabaseError.\n *\n * @remarks\n * Checks if an error is a DatabaseError with proper typing.\n *\n * @param error - Error to check\n * @returns True if error is a DatabaseError\n *\n * @public\n */\nexport function isDatabaseError(error: unknown): error is DatabaseError {\n return (\n typeof error === \"object\" &&\n error !== null &&\n \"kind\" in error &&\n typeof (error as DatabaseError).kind === \"string\"\n );\n}\n\n/**\n * The brand every Nextly application error carries.\n *\n * Read through the global symbol registry rather than imported, because the\n * adapters must not depend on the package that defines the error: `Symbol.for`\n * resolves to the same symbol in every module instance, which is why the brand\n * exists in that form to begin with.\n *\n * @internal\n */\nconst APPLICATION_ERROR_BRAND: unique symbol = Symbol.for(\"nextly/NextlyError\");\n\n/**\n * Whether an error is the application's verdict rather than the database's\n * failure.\n *\n * Work running inside a transaction may throw to roll the write back — a\n * refused value, a permission denial — and such an error is not something the\n * driver produced. Classifying it as a database error replaces its code and its\n * payload with a generic one, so a caller that asked for a refusal is handed an\n * unexplained failure instead, and per-field validation detail is lost on the\n * way out.\n *\n * @param error - Error to check\n * @returns True if the error was raised by application code\n *\n * @public\n */\nexport function isApplicationError(error: unknown): boolean {\n if (\n error === null ||\n (typeof error !== \"object\" && typeof error !== \"function\")\n ) {\n return false;\n }\n return (error as Record<symbol, unknown>)[APPLICATION_ERROR_BRAND] === true;\n}\n\n/**\n * Database error constructor options.\n *\n * @public\n */\nexport interface DatabaseErrorOptions {\n /** Error classification */\n kind: DatabaseErrorKind;\n\n /** Error message */\n message: string;\n\n /** Database-specific error code */\n code?: string;\n\n /** Constraint name */\n constraint?: string;\n\n /** Table name */\n table?: string;\n\n /** Column name */\n column?: string;\n\n /** Detailed description */\n detail?: string;\n\n /** Resolution hint */\n hint?: string;\n\n /** Original error */\n cause?: Error;\n}\n\n/**\n * Create a DatabaseError instance.\n *\n * @remarks\n * Helper function to create properly structured DatabaseError objects.\n *\n * @param options - Error options\n * @returns DatabaseError instance\n *\n * @public\n */\nexport function createDatabaseError(\n options: DatabaseErrorOptions\n): DatabaseError {\n const error = new Error(options.message) as DatabaseError;\n error.name = \"DatabaseError\";\n error.kind = options.kind;\n\n if (options.code !== undefined) error.code = options.code;\n if (options.constraint !== undefined) error.constraint = options.constraint;\n if (options.table !== undefined) error.table = options.table;\n if (options.column !== undefined) error.column = options.column;\n if (options.detail !== undefined) error.detail = options.detail;\n if (options.hint !== undefined) error.hint = options.hint;\n if (options.cause !== undefined) error.cause = options.cause;\n\n return error;\n}\n\n/**\n * The code an adapter gives the error it raises when a request has waited\n * longer than `pool.connectionTimeoutMs` for a database connection.\n *\n * A code of the adapters' own rather than the driver's wording, because the\n * drivers disagree: pg-pool raises a plain `Error` with no code, mysql2 has no\n * such wait to time out, and better-sqlite3 has no pool. Core reads this one\n * code to answer with its retryable \"database busy\" error.\n *\n * @public\n */\nexport const POOL_WAIT_TIMEOUT_CODE = \"NEXTLY_POOL_WAIT_TIMEOUT\";\n\n/**\n * The error for a request that waited `boundMs` for a database connection and\n * was given none.\n *\n * @param boundMs - The bound it waited, `pool.connectionTimeoutMs`\n * @param cause - The driver's own error, when the driver raised one\n *\n * @public\n */\nexport function poolWaitTimeoutError(\n boundMs: number,\n cause?: Error\n): DatabaseError {\n return createDatabaseError({\n kind: \"timeout\",\n code: POOL_WAIT_TIMEOUT_CODE,\n message: `Waited ${boundMs} ms for a database connection, and none was free`,\n cause,\n });\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAoCA,MAAa,kBAAkB;CAC7B;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CAOA;CAOA;CAIA;AACF;;;;;;;;;;;;;ACkBA,SAAgB,gBAAgB,OAAwC;CACtE,OACE,OAAO,UAAU,YACjB,UAAU,QACV,UAAU,SACV,OAAQ,MAAwB,SAAS;AAE7C;;;;;;;;;;;AAYA,MAAM,0BAAyC,OAAO,IAAI,oBAAoB;;;;;;;;;;;;;;;;;AAkB9E,SAAgB,mBAAmB,OAAyB;CAC1D,IACE,UAAU,QACT,OAAO,UAAU,YAAY,OAAO,UAAU,YAE/C,OAAO;CAET,OAAQ,MAAkC,6BAA6B;AACzE;;;;;;;;;;;;AA+CA,SAAgB,oBACd,SACe;CACf,MAAM,QAAQ,IAAI,MAAM,QAAQ,OAAO;CACvC,MAAM,OAAO;CACb,MAAM,OAAO,QAAQ;CAErB,IAAI,QAAQ,SAAS,KAAA,GAAW,MAAM,OAAO,QAAQ;CACrD,IAAI,QAAQ,eAAe,KAAA,GAAW,MAAM,aAAa,QAAQ;CACjE,IAAI,QAAQ,UAAU,KAAA,GAAW,MAAM,QAAQ,QAAQ;CACvD,IAAI,QAAQ,WAAW,KAAA,GAAW,MAAM,SAAS,QAAQ;CACzD,IAAI,QAAQ,WAAW,KAAA,GAAW,MAAM,SAAS,QAAQ;CACzD,IAAI,QAAQ,SAAS,KAAA,GAAW,MAAM,OAAO,QAAQ;CACrD,IAAI,QAAQ,UAAU,KAAA,GAAW,MAAM,QAAQ,QAAQ;CAEvD,OAAO;AACT;;;;;;;;;;;;AAaA,MAAa,yBAAyB;;;;;;;;;;AAWtC,SAAgB,qBACd,SACA,OACe;CACf,OAAO,oBAAoB;EACzB,MAAM;EACN,MAAM;EACN,SAAS,UAAU,QAAQ;EAC3B;CACF,CAAC;AACH"}
|
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
// src/types/query.ts
|
|
2
|
+
/**
|
|
3
|
+
* Every WHERE clause operator this package DECLARES, as a value.
|
|
4
|
+
*
|
|
5
|
+
* @remarks
|
|
6
|
+
* Declared, not guaranteed executable. Membership here means a `WhereCondition`
|
|
7
|
+
* carrying the operator type-checks — it does NOT mean the adapter can run it.
|
|
8
|
+
* `OVERLAPS` is declared and unimplemented, and throws at build time, so a
|
|
9
|
+
* validator written against this list will admit input the query layer then
|
|
10
|
+
* rejects. Validate against it to catch a misspelled operator; do not read
|
|
11
|
+
* acceptance here as a capability.
|
|
12
|
+
*
|
|
13
|
+
* - Standard comparison: =, !=, <, >, <=, >=
|
|
14
|
+
* - Set operations: IN, NOT IN
|
|
15
|
+
* - Pattern matching: LIKE, ILIKE (case-insensitive, PostgreSQL/emulated)
|
|
16
|
+
* - NULL checks: IS NULL, IS NOT NULL
|
|
17
|
+
* - Range: BETWEEN, NOT BETWEEN
|
|
18
|
+
* - Substring: CONTAINS — a LITERAL match on a TEXT column; see below
|
|
19
|
+
* - Declared but NOT implemented: OVERLAPS, which throws
|
|
20
|
+
*
|
|
21
|
+
* This list is the source of truth and {@link WhereOperator} is derived from it,
|
|
22
|
+
* rather than the two being written out separately. A guard that has to enumerate
|
|
23
|
+
* the operators — a validator over caller input, or a test asserting the builder
|
|
24
|
+
* handles or refuses each one — can only do that from a runtime value, and a
|
|
25
|
+
* hand-kept copy of the union would agree with it on the day it was written and
|
|
26
|
+
* silently stop agreeing the next time a member is added.
|
|
27
|
+
*
|
|
28
|
+
* @public
|
|
29
|
+
*/
|
|
30
|
+
const WHERE_OPERATORS = [
|
|
31
|
+
"=",
|
|
32
|
+
"!=",
|
|
33
|
+
"<",
|
|
34
|
+
">",
|
|
35
|
+
"<=",
|
|
36
|
+
">=",
|
|
37
|
+
"IN",
|
|
38
|
+
"NOT IN",
|
|
39
|
+
"LIKE",
|
|
40
|
+
"ILIKE",
|
|
41
|
+
"IS NULL",
|
|
42
|
+
"IS NOT NULL",
|
|
43
|
+
"BETWEEN",
|
|
44
|
+
"NOT BETWEEN",
|
|
45
|
+
"CONTAINS",
|
|
46
|
+
"ICONTAINS",
|
|
47
|
+
"OVERLAPS"
|
|
48
|
+
];
|
|
49
|
+
// src/types/error.ts
|
|
50
|
+
/**
|
|
51
|
+
* Type guard for DatabaseError.
|
|
52
|
+
*
|
|
53
|
+
* @remarks
|
|
54
|
+
* Checks if an error is a DatabaseError with proper typing.
|
|
55
|
+
*
|
|
56
|
+
* @param error - Error to check
|
|
57
|
+
* @returns True if error is a DatabaseError
|
|
58
|
+
*
|
|
59
|
+
* @public
|
|
60
|
+
*/
|
|
61
|
+
function isDatabaseError(error) {
|
|
62
|
+
return typeof error === "object" && error !== null && "kind" in error && typeof error.kind === "string";
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* The brand every Nextly application error carries.
|
|
66
|
+
*
|
|
67
|
+
* Read through the global symbol registry rather than imported, because the
|
|
68
|
+
* adapters must not depend on the package that defines the error: `Symbol.for`
|
|
69
|
+
* resolves to the same symbol in every module instance, which is why the brand
|
|
70
|
+
* exists in that form to begin with.
|
|
71
|
+
*
|
|
72
|
+
* @internal
|
|
73
|
+
*/
|
|
74
|
+
const APPLICATION_ERROR_BRAND = Symbol.for("nextly/NextlyError");
|
|
75
|
+
/**
|
|
76
|
+
* Whether an error is the application's verdict rather than the database's
|
|
77
|
+
* failure.
|
|
78
|
+
*
|
|
79
|
+
* Work running inside a transaction may throw to roll the write back — a
|
|
80
|
+
* refused value, a permission denial — and such an error is not something the
|
|
81
|
+
* driver produced. Classifying it as a database error replaces its code and its
|
|
82
|
+
* payload with a generic one, so a caller that asked for a refusal is handed an
|
|
83
|
+
* unexplained failure instead, and per-field validation detail is lost on the
|
|
84
|
+
* way out.
|
|
85
|
+
*
|
|
86
|
+
* @param error - Error to check
|
|
87
|
+
* @returns True if the error was raised by application code
|
|
88
|
+
*
|
|
89
|
+
* @public
|
|
90
|
+
*/
|
|
91
|
+
function isApplicationError(error) {
|
|
92
|
+
if (error === null || typeof error !== "object" && typeof error !== "function") return false;
|
|
93
|
+
return error[APPLICATION_ERROR_BRAND] === true;
|
|
94
|
+
}
|
|
95
|
+
/**
|
|
96
|
+
* Create a DatabaseError instance.
|
|
97
|
+
*
|
|
98
|
+
* @remarks
|
|
99
|
+
* Helper function to create properly structured DatabaseError objects.
|
|
100
|
+
*
|
|
101
|
+
* @param options - Error options
|
|
102
|
+
* @returns DatabaseError instance
|
|
103
|
+
*
|
|
104
|
+
* @public
|
|
105
|
+
*/
|
|
106
|
+
function createDatabaseError(options) {
|
|
107
|
+
const error = new Error(options.message);
|
|
108
|
+
error.name = "DatabaseError";
|
|
109
|
+
error.kind = options.kind;
|
|
110
|
+
if (options.code !== void 0) error.code = options.code;
|
|
111
|
+
if (options.constraint !== void 0) error.constraint = options.constraint;
|
|
112
|
+
if (options.table !== void 0) error.table = options.table;
|
|
113
|
+
if (options.column !== void 0) error.column = options.column;
|
|
114
|
+
if (options.detail !== void 0) error.detail = options.detail;
|
|
115
|
+
if (options.hint !== void 0) error.hint = options.hint;
|
|
116
|
+
if (options.cause !== void 0) error.cause = options.cause;
|
|
117
|
+
return error;
|
|
118
|
+
}
|
|
119
|
+
/**
|
|
120
|
+
* The code an adapter gives the error it raises when a request has waited
|
|
121
|
+
* longer than `pool.connectionTimeoutMs` for a database connection.
|
|
122
|
+
*
|
|
123
|
+
* A code of the adapters' own rather than the driver's wording, because the
|
|
124
|
+
* drivers disagree: pg-pool raises a plain `Error` with no code, mysql2 has no
|
|
125
|
+
* such wait to time out, and better-sqlite3 has no pool. Core reads this one
|
|
126
|
+
* code to answer with its retryable "database busy" error.
|
|
127
|
+
*
|
|
128
|
+
* @public
|
|
129
|
+
*/
|
|
130
|
+
const POOL_WAIT_TIMEOUT_CODE = "NEXTLY_POOL_WAIT_TIMEOUT";
|
|
131
|
+
/**
|
|
132
|
+
* The error for a request that waited `boundMs` for a database connection and
|
|
133
|
+
* was given none.
|
|
134
|
+
*
|
|
135
|
+
* @param boundMs - The bound it waited, `pool.connectionTimeoutMs`
|
|
136
|
+
* @param cause - The driver's own error, when the driver raised one
|
|
137
|
+
*
|
|
138
|
+
* @public
|
|
139
|
+
*/
|
|
140
|
+
function poolWaitTimeoutError(boundMs, cause) {
|
|
141
|
+
return createDatabaseError({
|
|
142
|
+
kind: "timeout",
|
|
143
|
+
code: POOL_WAIT_TIMEOUT_CODE,
|
|
144
|
+
message: `Waited ${boundMs} ms for a database connection, and none was free`,
|
|
145
|
+
cause
|
|
146
|
+
});
|
|
147
|
+
}
|
|
148
|
+
export { poolWaitTimeoutError as a, isDatabaseError as i, createDatabaseError as n, WHERE_OPERATORS as o, isApplicationError as r, POOL_WAIT_TIMEOUT_CODE as t };
|
|
149
|
+
|
|
150
|
+
//# sourceMappingURL=types-CaF_5jNk.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types-CaF_5jNk.mjs","names":[],"sources":["../src/types/query.ts","../src/types/error.ts"],"sourcesContent":["/**\n * Query building type definitions for database-agnostic queries.\n *\n * @packageDocumentation\n */\n\nimport type { SqlParam } from \"./core\";\n\n/**\n * Every WHERE clause operator this package DECLARES, as a value.\n *\n * @remarks\n * Declared, not guaranteed executable. Membership here means a `WhereCondition`\n * carrying the operator type-checks — it does NOT mean the adapter can run it.\n * `OVERLAPS` is declared and unimplemented, and throws at build time, so a\n * validator written against this list will admit input the query layer then\n * rejects. Validate against it to catch a misspelled operator; do not read\n * acceptance here as a capability.\n *\n * - Standard comparison: =, !=, <, >, <=, >=\n * - Set operations: IN, NOT IN\n * - Pattern matching: LIKE, ILIKE (case-insensitive, PostgreSQL/emulated)\n * - NULL checks: IS NULL, IS NOT NULL\n * - Range: BETWEEN, NOT BETWEEN\n * - Substring: CONTAINS — a LITERAL match on a TEXT column; see below\n * - Declared but NOT implemented: OVERLAPS, which throws\n *\n * This list is the source of truth and {@link WhereOperator} is derived from it,\n * rather than the two being written out separately. A guard that has to enumerate\n * the operators — a validator over caller input, or a test asserting the builder\n * handles or refuses each one — can only do that from a runtime value, and a\n * hand-kept copy of the union would agree with it on the day it was written and\n * silently stop agreeing the next time a member is added.\n *\n * @public\n */\nexport const WHERE_OPERATORS = [\n \"=\",\n \"!=\",\n \"<\",\n \">\",\n \"<=\",\n \">=\",\n \"IN\",\n \"NOT IN\",\n \"LIKE\",\n \"ILIKE\",\n \"IS NULL\",\n \"IS NOT NULL\",\n \"BETWEEN\",\n \"NOT BETWEEN\",\n // Substring match on a TEXT column, with the value taken literally. Despite the name it is\n // not JSON containment, and it is not safe to point at a JSON column: the builder emits a\n // bare `LIKE` with no cast, so on PostgreSQL a `json`/`jsonb` column has no matching operator\n // and the statement ERRORS (`operator does not exist: jsonb ~~ text`). MySQL and SQLite\n // coerce, and there it searches the serialized text — which hits a key name as readily as a\n // value. Text columns only, and a search rather than a containment check.\n \"CONTAINS\",\n // CONTAINS without regard to case: a substring match on a TEXT column with the value taken\n // literally (`%` and `_` are characters to find, not wildcards), ignoring case on every\n // dialect even where the column's collation is case-sensitive. Which letters fold is the\n // database's `lower()` under the column's collation: the collation's Unicode version on\n // MySQL; non-ASCII too under a linguistic PostgreSQL collation; ASCII letters only on\n // SQLite and under PostgreSQL's `C` or `POSIX`.\n \"ICONTAINS\",\n // Declared, never implemented — the builder throws `Unsupported operator: OVERLAPS`. Kept in\n // the union because removing it would be a breaking change to a published type; the refusal\n // is pinned by a test so implementing it has to come through here.\n \"OVERLAPS\",\n] as const;\n\n/**\n * Every WHERE clause operator this package declares. Derived from\n * {@link WHERE_OPERATORS}, and carrying the same caveat: a value of this type\n * type-checks, which is not the same as the adapter being able to execute it.\n *\n * @public\n */\nexport type WhereOperator = (typeof WHERE_OPERATORS)[number];\n\n/**\n * Individual WHERE condition.\n *\n * @remarks\n * Represents a single condition in a WHERE clause. For IS NULL and IS NOT NULL\n * operators, the value field is optional.\n *\n * @public\n */\nexport interface WhereCondition {\n /** Column name to filter on */\n column: string;\n\n /** Comparison operator */\n op: WhereOperator;\n\n /** Value(s) to compare against (optional for IS NULL/IS NOT NULL) */\n value?: SqlParam | SqlParam[];\n\n /** Second value for BETWEEN operator */\n valueTo?: SqlParam;\n}\n\n/**\n * Complex WHERE clause with logical operators.\n *\n * @remarks\n * Supports nested conditions with AND, OR, and NOT logical operators.\n * Can be recursively nested for complex queries.\n *\n * @example\n * ```typescript\n * const where: WhereClause = {\n * and: [\n * { column: \"status\", op: \"=\", value: \"published\" },\n * {\n * or: [\n * { column: \"author\", op: \"=\", value: \"john\" },\n * { column: \"author\", op: \"=\", value: \"jane\" }\n * ]\n * }\n * ]\n * };\n * ```\n *\n * @public\n */\nexport interface WhereClause {\n /** All conditions must be true (AND) */\n and?: (WhereCondition | WhereClause)[];\n\n /** At least one condition must be true (OR) */\n or?: (WhereCondition | WhereClause)[];\n\n /** Negate a condition (NOT) */\n not?: WhereCondition | WhereClause;\n}\n\n/**\n * ORDER BY specification for query results.\n *\n * @remarks\n * Controls the sorting of query results. NULL handling varies by database\n * but can be explicitly controlled with the nulls field.\n *\n * @public\n */\nexport interface OrderBySpec {\n /** Column name to sort by */\n column: string;\n\n /** Sort direction (default: asc) */\n direction?: \"asc\" | \"desc\";\n\n /** NULL value ordering (database-specific defaults vary) */\n nulls?: \"first\" | \"last\";\n}\n\n/**\n * JOIN specification for table joins.\n *\n * @remarks\n * Supports different types of JOINs. Note that complex joins may require\n * dialect-specific handling.\n *\n * @public\n */\nexport interface JoinSpec {\n /** Type of join */\n type: \"inner\" | \"left\" | \"right\" | \"full\";\n\n /** Table name to join */\n table: string;\n\n /** Join condition */\n on: {\n /** Column from the left table */\n leftColumn: string;\n /** Column from the right table */\n rightColumn: string;\n };\n\n /** Optional alias for the joined table */\n alias?: string;\n}\n","/**\n * Database error type definitions.\n *\n * @packageDocumentation\n */\n\n/**\n * Database error classification.\n *\n * @remarks\n * Categorizes database errors for consistent error handling across adapters.\n * Each adapter translates database-specific error codes to these kinds.\n *\n * @public\n */\nexport type DatabaseErrorKind =\n | \"connection\" // Connection/network errors\n | \"query\" // Syntax or execution errors\n | \"constraint\" // Generic constraint violation\n | \"unique_violation\" // Unique constraint violation\n | \"foreign_key_violation\" // Foreign key constraint violation\n | \"check_violation\" // Check constraint violation\n | \"not_null_violation\" // NOT NULL constraint violation\n | \"deadlock\" // Transaction deadlock\n | \"timeout\" // Query or connection timeout\n | \"serialization_failure\" // Serializable transaction conflict\n | \"unsupported_version\" // F17: DB version below minimum or unparseable at connect\n | \"unknown\"; // Unclassified error\n\n/**\n * Enhanced database error interface.\n *\n * @remarks\n * Extends the standard Error interface with database-specific context.\n * Adapters should throw errors implementing this interface for consistent\n * error handling.\n *\n * @example\n * ```typescript\n * try {\n * await adapter.insert('users', { email: 'duplicate@example.com' });\n * } catch (error) {\n * if (isDatabaseError(error) && error.kind === 'unique_violation') {\n * console.log(`Duplicate ${error.column} in ${error.table}`);\n * }\n * }\n * ```\n *\n * @public\n */\nexport interface DatabaseError extends Error {\n /** Error classification */\n kind: DatabaseErrorKind;\n\n /** Database-specific error code (e.g., \"23505\" for PostgreSQL unique violation) */\n code?: string;\n\n /** Constraint name that was violated (if applicable) */\n constraint?: string;\n\n /** Table name involved in the error */\n table?: string;\n\n /** Column name involved in the error */\n column?: string;\n\n /** Detailed error description from the database */\n detail?: string;\n\n /** Hint for resolving the error */\n hint?: string;\n\n /** Original error from the database driver */\n cause?: Error;\n}\n\n/**\n * Type guard for DatabaseError.\n *\n * @remarks\n * Checks if an error is a DatabaseError with proper typing.\n *\n * @param error - Error to check\n * @returns True if error is a DatabaseError\n *\n * @public\n */\nexport function isDatabaseError(error: unknown): error is DatabaseError {\n return (\n typeof error === \"object\" &&\n error !== null &&\n \"kind\" in error &&\n typeof (error as DatabaseError).kind === \"string\"\n );\n}\n\n/**\n * The brand every Nextly application error carries.\n *\n * Read through the global symbol registry rather than imported, because the\n * adapters must not depend on the package that defines the error: `Symbol.for`\n * resolves to the same symbol in every module instance, which is why the brand\n * exists in that form to begin with.\n *\n * @internal\n */\nconst APPLICATION_ERROR_BRAND: unique symbol = Symbol.for(\"nextly/NextlyError\");\n\n/**\n * Whether an error is the application's verdict rather than the database's\n * failure.\n *\n * Work running inside a transaction may throw to roll the write back — a\n * refused value, a permission denial — and such an error is not something the\n * driver produced. Classifying it as a database error replaces its code and its\n * payload with a generic one, so a caller that asked for a refusal is handed an\n * unexplained failure instead, and per-field validation detail is lost on the\n * way out.\n *\n * @param error - Error to check\n * @returns True if the error was raised by application code\n *\n * @public\n */\nexport function isApplicationError(error: unknown): boolean {\n if (\n error === null ||\n (typeof error !== \"object\" && typeof error !== \"function\")\n ) {\n return false;\n }\n return (error as Record<symbol, unknown>)[APPLICATION_ERROR_BRAND] === true;\n}\n\n/**\n * Database error constructor options.\n *\n * @public\n */\nexport interface DatabaseErrorOptions {\n /** Error classification */\n kind: DatabaseErrorKind;\n\n /** Error message */\n message: string;\n\n /** Database-specific error code */\n code?: string;\n\n /** Constraint name */\n constraint?: string;\n\n /** Table name */\n table?: string;\n\n /** Column name */\n column?: string;\n\n /** Detailed description */\n detail?: string;\n\n /** Resolution hint */\n hint?: string;\n\n /** Original error */\n cause?: Error;\n}\n\n/**\n * Create a DatabaseError instance.\n *\n * @remarks\n * Helper function to create properly structured DatabaseError objects.\n *\n * @param options - Error options\n * @returns DatabaseError instance\n *\n * @public\n */\nexport function createDatabaseError(\n options: DatabaseErrorOptions\n): DatabaseError {\n const error = new Error(options.message) as DatabaseError;\n error.name = \"DatabaseError\";\n error.kind = options.kind;\n\n if (options.code !== undefined) error.code = options.code;\n if (options.constraint !== undefined) error.constraint = options.constraint;\n if (options.table !== undefined) error.table = options.table;\n if (options.column !== undefined) error.column = options.column;\n if (options.detail !== undefined) error.detail = options.detail;\n if (options.hint !== undefined) error.hint = options.hint;\n if (options.cause !== undefined) error.cause = options.cause;\n\n return error;\n}\n\n/**\n * The code an adapter gives the error it raises when a request has waited\n * longer than `pool.connectionTimeoutMs` for a database connection.\n *\n * A code of the adapters' own rather than the driver's wording, because the\n * drivers disagree: pg-pool raises a plain `Error` with no code, mysql2 has no\n * such wait to time out, and better-sqlite3 has no pool. Core reads this one\n * code to answer with its retryable \"database busy\" error.\n *\n * @public\n */\nexport const POOL_WAIT_TIMEOUT_CODE = \"NEXTLY_POOL_WAIT_TIMEOUT\";\n\n/**\n * The error for a request that waited `boundMs` for a database connection and\n * was given none.\n *\n * @param boundMs - The bound it waited, `pool.connectionTimeoutMs`\n * @param cause - The driver's own error, when the driver raised one\n *\n * @public\n */\nexport function poolWaitTimeoutError(\n boundMs: number,\n cause?: Error\n): DatabaseError {\n return createDatabaseError({\n kind: \"timeout\",\n code: POOL_WAIT_TIMEOUT_CODE,\n message: `Waited ${boundMs} ms for a database connection, and none was free`,\n cause,\n });\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAoCA,MAAa,kBAAkB;CAC7B;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CAOA;CAOA;CAIA;AACF;;;;;;;;;;;;;ACkBA,SAAgB,gBAAgB,OAAwC;CACtE,OACE,OAAO,UAAU,YACjB,UAAU,QACV,UAAU,SACV,OAAQ,MAAwB,SAAS;AAE7C;;;;;;;;;;;AAYA,MAAM,0BAAyC,OAAO,IAAI,oBAAoB;;;;;;;;;;;;;;;;;AAkB9E,SAAgB,mBAAmB,OAAyB;CAC1D,IACE,UAAU,QACT,OAAO,UAAU,YAAY,OAAO,UAAU,YAE/C,OAAO;CAET,OAAQ,MAAkC,6BAA6B;AACzE;;;;;;;;;;;;AA+CA,SAAgB,oBACd,SACe;CACf,MAAM,QAAQ,IAAI,MAAM,QAAQ,OAAO;CACvC,MAAM,OAAO;CACb,MAAM,OAAO,QAAQ;CAErB,IAAI,QAAQ,SAAS,KAAA,GAAW,MAAM,OAAO,QAAQ;CACrD,IAAI,QAAQ,eAAe,KAAA,GAAW,MAAM,aAAa,QAAQ;CACjE,IAAI,QAAQ,UAAU,KAAA,GAAW,MAAM,QAAQ,QAAQ;CACvD,IAAI,QAAQ,WAAW,KAAA,GAAW,MAAM,SAAS,QAAQ;CACzD,IAAI,QAAQ,WAAW,KAAA,GAAW,MAAM,SAAS,QAAQ;CACzD,IAAI,QAAQ,SAAS,KAAA,GAAW,MAAM,OAAO,QAAQ;CACrD,IAAI,QAAQ,UAAU,KAAA,GAAW,MAAM,QAAQ,QAAQ;CAEvD,OAAO;AACT;;;;;;;;;;;;AAaA,MAAa,yBAAyB;;;;;;;;;;AAWtC,SAAgB,qBACd,SACA,OACe;CACf,OAAO,oBAAoB;EACzB,MAAM;EACN,MAAM;EACN,SAAS,UAAU,QAAQ;EAC3B;CACF,CAAC;AACH"}
|