@prisma-next/sql-relational-core 0.3.0-dev.5 → 0.3.0-dev.50
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 +18 -2
- package/dist/errors-7_V3El9I.mjs +3 -0
- package/dist/errors-DVufq9PT.d.mts +2 -0
- package/dist/exports/ast.d.mts +192 -0
- package/dist/exports/ast.d.mts.map +1 -0
- package/dist/exports/ast.mjs +361 -0
- package/dist/exports/ast.mjs.map +1 -0
- package/dist/exports/errors.d.mts +2 -0
- package/dist/exports/errors.mjs +3 -0
- package/dist/exports/guards.d.mts +5 -0
- package/dist/exports/guards.mjs +3 -0
- package/dist/exports/operations-registry.d.mts +5 -0
- package/dist/exports/operations-registry.mjs +3 -0
- package/dist/exports/param.d.mts +5 -0
- package/dist/exports/param.mjs +3 -0
- package/dist/exports/plan.d.mts +2 -0
- package/dist/exports/plan.mjs +17 -0
- package/dist/exports/plan.mjs.map +1 -0
- package/dist/exports/query-lane-context.d.mts +2 -0
- package/dist/exports/query-lane-context.mjs +1 -0
- package/dist/exports/schema.d.mts +5 -0
- package/dist/exports/schema.mjs +4 -0
- package/dist/exports/types.d.mts +4 -0
- package/dist/exports/types.mjs +3 -0
- package/dist/exports/utils/guards.d.mts +5 -0
- package/dist/exports/utils/guards.mjs +4 -0
- package/dist/guards-0ycyntYX.mjs +132 -0
- package/dist/guards-0ycyntYX.mjs.map +1 -0
- package/dist/guards-DCCpAlOL.d.mts +87 -0
- package/dist/guards-DCCpAlOL.d.mts.map +1 -0
- package/dist/index.d.mts +12 -0
- package/dist/index.mjs +12 -0
- package/dist/operations-registry-DPZ5aElH.mjs +152 -0
- package/dist/operations-registry-DPZ5aElH.mjs.map +1 -0
- package/dist/operations-registry-wVEaiLyt.d.mts +9 -0
- package/dist/operations-registry-wVEaiLyt.d.mts.map +1 -0
- package/dist/param-C4n0OW59.d.mts +8 -0
- package/dist/param-C4n0OW59.d.mts.map +1 -0
- package/dist/param-DMU3OWfI.mjs +14 -0
- package/dist/param-DMU3OWfI.mjs.map +1 -0
- package/dist/plan-BhSWuTfw.d.mts +194 -0
- package/dist/plan-BhSWuTfw.d.mts.map +1 -0
- package/dist/query-lane-context-CgkPuKaR.d.mts +259 -0
- package/dist/query-lane-context-CgkPuKaR.d.mts.map +1 -0
- package/dist/schema-Bi5p4aAc.mjs +175 -0
- package/dist/schema-Bi5p4aAc.mjs.map +1 -0
- package/dist/schema-CgrEMqEd.d.mts +86 -0
- package/dist/schema-CgrEMqEd.d.mts.map +1 -0
- package/dist/types-CEUzDuDC.d.mts +447 -0
- package/dist/types-CEUzDuDC.d.mts.map +1 -0
- package/dist/types-Cdi4Whda.mjs +18 -0
- package/dist/types-Cdi4Whda.mjs.map +1 -0
- package/package.json +39 -56
- package/src/ast/codec-types.ts +77 -8
- package/src/ast/delete.ts +2 -2
- package/src/ast/driver-types.ts +20 -3
- package/src/ast/predicate.ts +14 -4
- package/src/ast/select.ts +4 -3
- package/src/ast/sql-codecs.ts +67 -0
- package/src/ast/types.ts +89 -19
- package/src/ast/update.ts +2 -2
- package/src/exports/ast.ts +1 -0
- package/src/exports/guards.ts +5 -0
- package/src/exports/utils/guards.ts +1 -0
- package/src/operations-registry.ts +112 -73
- package/src/query-lane-context.ts +77 -1
- package/src/schema.ts +91 -33
- package/src/types.ts +327 -75
- package/src/utils/guards.ts +88 -18
- package/dist/ast/adapter-types.d.ts +0 -28
- package/dist/ast/adapter-types.d.ts.map +0 -1
- package/dist/ast/codec-types.d.ts +0 -141
- package/dist/ast/codec-types.d.ts.map +0 -1
- package/dist/ast/common.d.ts +0 -7
- package/dist/ast/common.d.ts.map +0 -1
- package/dist/ast/delete.d.ts +0 -8
- package/dist/ast/delete.d.ts.map +0 -1
- package/dist/ast/driver-types.d.ts +0 -20
- package/dist/ast/driver-types.d.ts.map +0 -1
- package/dist/ast/insert.d.ts +0 -8
- package/dist/ast/insert.d.ts.map +0 -1
- package/dist/ast/join.d.ts +0 -6
- package/dist/ast/join.d.ts.map +0 -1
- package/dist/ast/order.d.ts +0 -6
- package/dist/ast/order.d.ts.map +0 -1
- package/dist/ast/predicate.d.ts +0 -4
- package/dist/ast/predicate.d.ts.map +0 -1
- package/dist/ast/select.d.ts +0 -18
- package/dist/ast/select.d.ts.map +0 -1
- package/dist/ast/types.d.ts +0 -118
- package/dist/ast/types.d.ts.map +0 -1
- package/dist/ast/update.d.ts +0 -9
- package/dist/ast/update.d.ts.map +0 -1
- package/dist/ast/util.d.ts +0 -2
- package/dist/ast/util.d.ts.map +0 -1
- package/dist/chunk-2F7DSEOU.js +0 -8
- package/dist/chunk-2F7DSEOU.js.map +0 -1
- package/dist/chunk-36WJWNHT.js +0 -1
- package/dist/chunk-36WJWNHT.js.map +0 -1
- package/dist/chunk-5N34PNVZ.js +0 -62
- package/dist/chunk-5N34PNVZ.js.map +0 -1
- package/dist/chunk-7I3EMQID.js +0 -16
- package/dist/chunk-7I3EMQID.js.map +0 -1
- package/dist/chunk-CBTYMOX2.js +0 -152
- package/dist/chunk-CBTYMOX2.js.map +0 -1
- package/dist/chunk-G52ENULI.js +0 -1
- package/dist/chunk-G52ENULI.js.map +0 -1
- package/dist/chunk-KYSP7L5C.js +0 -16
- package/dist/chunk-KYSP7L5C.js.map +0 -1
- package/dist/chunk-M23L3JHG.js +0 -159
- package/dist/chunk-M23L3JHG.js.map +0 -1
- package/dist/chunk-MM74SVJ4.js +0 -13
- package/dist/chunk-MM74SVJ4.js.map +0 -1
- package/dist/chunk-U7AXAUJA.js +0 -1
- package/dist/chunk-U7AXAUJA.js.map +0 -1
- package/dist/chunk-WZBPVEZI.js +0 -320
- package/dist/chunk-WZBPVEZI.js.map +0 -1
- package/dist/errors.d.ts +0 -2
- package/dist/errors.d.ts.map +0 -1
- package/dist/exports/ast.d.ts +0 -14
- package/dist/exports/ast.d.ts.map +0 -1
- package/dist/exports/ast.js +0 -46
- package/dist/exports/ast.js.map +0 -1
- package/dist/exports/errors.d.ts +0 -2
- package/dist/exports/errors.d.ts.map +0 -1
- package/dist/exports/errors.js +0 -9
- package/dist/exports/errors.js.map +0 -1
- package/dist/exports/guards.d.ts +0 -2
- package/dist/exports/guards.d.ts.map +0 -1
- package/dist/exports/guards.js +0 -21
- package/dist/exports/guards.js.map +0 -1
- package/dist/exports/operations-registry.d.ts +0 -2
- package/dist/exports/operations-registry.d.ts.map +0 -1
- package/dist/exports/operations-registry.js +0 -9
- package/dist/exports/operations-registry.js.map +0 -1
- package/dist/exports/param.d.ts +0 -3
- package/dist/exports/param.d.ts.map +0 -1
- package/dist/exports/param.js +0 -7
- package/dist/exports/param.js.map +0 -1
- package/dist/exports/plan.d.ts +0 -2
- package/dist/exports/plan.d.ts.map +0 -1
- package/dist/exports/plan.js +0 -7
- package/dist/exports/plan.js.map +0 -1
- package/dist/exports/query-lane-context.d.ts +0 -2
- package/dist/exports/query-lane-context.d.ts.map +0 -1
- package/dist/exports/query-lane-context.js +0 -2
- package/dist/exports/query-lane-context.js.map +0 -1
- package/dist/exports/schema.d.ts +0 -3
- package/dist/exports/schema.d.ts.map +0 -1
- package/dist/exports/schema.js +0 -14
- package/dist/exports/schema.js.map +0 -1
- package/dist/exports/types.d.ts +0 -2
- package/dist/exports/types.d.ts.map +0 -1
- package/dist/exports/types.js +0 -10
- package/dist/exports/types.js.map +0 -1
- package/dist/index.d.ts +0 -9
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js +0 -81
- package/dist/index.js.map +0 -1
- package/dist/operations-registry.d.ts +0 -5
- package/dist/operations-registry.d.ts.map +0 -1
- package/dist/param.d.ts +0 -4
- package/dist/param.d.ts.map +0 -1
- package/dist/plan.d.ts +0 -23
- package/dist/plan.d.ts.map +0 -1
- package/dist/query-lane-context.d.ts +0 -16
- package/dist/query-lane-context.d.ts.map +0 -1
- package/dist/schema.d.ts +0 -63
- package/dist/schema.d.ts.map +0 -1
- package/dist/types.d.ts +0 -332
- package/dist/types.d.ts.map +0 -1
- package/dist/utils/guards.d.ts +0 -55
- package/dist/utils/guards.d.ts.map +0 -1
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
import { d as isParamPlaceholder } from "./guards-0ycyntYX.mjs";
|
|
2
|
+
import { planInvalid } from "@prisma-next/plan";
|
|
3
|
+
import { hasAllCapabilities } from "@prisma-next/operations";
|
|
4
|
+
|
|
5
|
+
//#region src/operations-registry.ts
|
|
6
|
+
/**
|
|
7
|
+
* Type guard to check if a value is an ExpressionSource (has toExpr method).
|
|
8
|
+
*/
|
|
9
|
+
function isExpressionSource(value) {
|
|
10
|
+
return typeof value === "object" && value !== null && "toExpr" in value && typeof value.toExpr === "function";
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Executes an operation and returns an ExpressionBuilder.
|
|
14
|
+
* This is the canonical entrypoint for operation invocation, enabling
|
|
15
|
+
* future enhancements like telemetry, caching, or tracing.
|
|
16
|
+
*
|
|
17
|
+
* The returned ExpressionBuilder:
|
|
18
|
+
* - Has `kind: 'expression'` to distinguish it from ColumnBuilder
|
|
19
|
+
* - Contains the operation expression in `expr`
|
|
20
|
+
* - Provides `toExpr()` method to get the Expression
|
|
21
|
+
* - Provides comparison and ordering methods for chaining
|
|
22
|
+
*
|
|
23
|
+
* @param signature - The operation signature from the registry
|
|
24
|
+
* @param selfBuilder - The expression source that the operation is called on
|
|
25
|
+
* @param args - The arguments passed to the operation
|
|
26
|
+
* @param columnMeta - The metadata of the column the operation is called on
|
|
27
|
+
* @returns An ExpressionBuilder containing the operation expression
|
|
28
|
+
*/
|
|
29
|
+
function executeOperation(signature, selfBuilder, args, columnMeta, operationRegistry, contractCapabilities) {
|
|
30
|
+
if (args.length !== signature.args.length) throw planInvalid(`Operation ${signature.method} expects ${signature.args.length} arguments, got ${args.length}`);
|
|
31
|
+
const selfExpr = selfBuilder.toExpr();
|
|
32
|
+
const operationArgs = [];
|
|
33
|
+
for (let i = 0; i < args.length; i++) {
|
|
34
|
+
const arg = args[i];
|
|
35
|
+
const argSpec = signature.args[i];
|
|
36
|
+
if (!argSpec) throw planInvalid(`Missing argument spec for argument ${i}`);
|
|
37
|
+
if (argSpec.kind === "param") {
|
|
38
|
+
if (!isParamPlaceholder(arg)) throw planInvalid(`Argument ${i} must be a parameter placeholder`);
|
|
39
|
+
operationArgs.push({
|
|
40
|
+
kind: "param",
|
|
41
|
+
index: 0,
|
|
42
|
+
name: arg.name
|
|
43
|
+
});
|
|
44
|
+
} else if (argSpec.kind === "typeId") {
|
|
45
|
+
if (!isExpressionSource(arg)) throw planInvalid(`Argument ${i} must be an ExpressionSource (ColumnBuilder or ExpressionBuilder)`);
|
|
46
|
+
operationArgs.push(arg.toExpr());
|
|
47
|
+
} else if (argSpec.kind === "literal") operationArgs.push({
|
|
48
|
+
kind: "literal",
|
|
49
|
+
value: arg
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
const operationExpr = {
|
|
53
|
+
kind: "operation",
|
|
54
|
+
method: signature.method,
|
|
55
|
+
forTypeId: signature.forTypeId,
|
|
56
|
+
self: selfExpr,
|
|
57
|
+
args: operationArgs,
|
|
58
|
+
returns: signature.returns,
|
|
59
|
+
lowering: signature.lowering
|
|
60
|
+
};
|
|
61
|
+
const returnTypeId = signature.returns.kind === "typeId" ? signature.returns.type : void 0;
|
|
62
|
+
const returnColumnMeta = returnTypeId ? {
|
|
63
|
+
...columnMeta,
|
|
64
|
+
codecId: returnTypeId
|
|
65
|
+
} : columnMeta;
|
|
66
|
+
const createComparisonMethod = (op) => (value) => Object.freeze({
|
|
67
|
+
kind: "binary",
|
|
68
|
+
op,
|
|
69
|
+
left: operationExpr,
|
|
70
|
+
right: value
|
|
71
|
+
});
|
|
72
|
+
const baseResult = {
|
|
73
|
+
kind: "expression",
|
|
74
|
+
expr: operationExpr,
|
|
75
|
+
get columnMeta() {
|
|
76
|
+
return returnColumnMeta;
|
|
77
|
+
},
|
|
78
|
+
eq: createComparisonMethod("eq"),
|
|
79
|
+
neq: createComparisonMethod("neq"),
|
|
80
|
+
gt: createComparisonMethod("gt"),
|
|
81
|
+
lt: createComparisonMethod("lt"),
|
|
82
|
+
gte: createComparisonMethod("gte"),
|
|
83
|
+
lte: createComparisonMethod("lte"),
|
|
84
|
+
asc() {
|
|
85
|
+
return Object.freeze({
|
|
86
|
+
kind: "order",
|
|
87
|
+
expr: operationExpr,
|
|
88
|
+
dir: "asc"
|
|
89
|
+
});
|
|
90
|
+
},
|
|
91
|
+
desc() {
|
|
92
|
+
return Object.freeze({
|
|
93
|
+
kind: "order",
|
|
94
|
+
expr: operationExpr,
|
|
95
|
+
dir: "desc"
|
|
96
|
+
});
|
|
97
|
+
},
|
|
98
|
+
toExpr() {
|
|
99
|
+
return operationExpr;
|
|
100
|
+
},
|
|
101
|
+
get __jsType() {}
|
|
102
|
+
};
|
|
103
|
+
if (returnTypeId && operationRegistry) {
|
|
104
|
+
const resultWithOps = attachOperationsToExpressionBuilder(baseResult, returnColumnMeta, operationRegistry, contractCapabilities);
|
|
105
|
+
return Object.freeze(resultWithOps);
|
|
106
|
+
}
|
|
107
|
+
return Object.freeze(baseResult);
|
|
108
|
+
}
|
|
109
|
+
/**
|
|
110
|
+
* Attaches operation methods to an ExpressionBuilder for chained operations.
|
|
111
|
+
* When an operation returns a typeId, the result ExpressionBuilder needs
|
|
112
|
+
* operation methods for that type.
|
|
113
|
+
*/
|
|
114
|
+
function attachOperationsToExpressionBuilder(expressionBuilder, columnMeta, registry, contractCapabilities) {
|
|
115
|
+
const codecId = columnMeta.codecId;
|
|
116
|
+
if (!codecId) return expressionBuilder;
|
|
117
|
+
const operations = registry.byType(codecId);
|
|
118
|
+
if (operations.length === 0) return expressionBuilder;
|
|
119
|
+
const builderWithOps = expressionBuilder;
|
|
120
|
+
for (const operation of operations) {
|
|
121
|
+
if (operation.capabilities && operation.capabilities.length > 0) {
|
|
122
|
+
if (!contractCapabilities) continue;
|
|
123
|
+
if (!hasAllCapabilities(operation.capabilities, contractCapabilities)) continue;
|
|
124
|
+
}
|
|
125
|
+
builderWithOps[operation.method] = function(...args) {
|
|
126
|
+
return executeOperation(operation, this, args, columnMeta, registry, contractCapabilities);
|
|
127
|
+
};
|
|
128
|
+
}
|
|
129
|
+
return builderWithOps;
|
|
130
|
+
}
|
|
131
|
+
function attachOperationsToColumnBuilder(columnBuilder, columnMeta, registry, contractCapabilities) {
|
|
132
|
+
if (!registry) return columnBuilder;
|
|
133
|
+
const codecId = columnMeta.codecId;
|
|
134
|
+
if (!codecId) return columnBuilder;
|
|
135
|
+
const operations = registry.byType(codecId);
|
|
136
|
+
if (operations.length === 0) return columnBuilder;
|
|
137
|
+
const builderWithOps = columnBuilder;
|
|
138
|
+
for (const operation of operations) {
|
|
139
|
+
if (operation.capabilities && operation.capabilities.length > 0) {
|
|
140
|
+
if (!contractCapabilities) continue;
|
|
141
|
+
if (!hasAllCapabilities(operation.capabilities, contractCapabilities)) continue;
|
|
142
|
+
}
|
|
143
|
+
builderWithOps[operation.method] = function(...args) {
|
|
144
|
+
return executeOperation(operation, this, args, columnMeta, registry, contractCapabilities);
|
|
145
|
+
};
|
|
146
|
+
}
|
|
147
|
+
return builderWithOps;
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
//#endregion
|
|
151
|
+
export { attachOperationsToColumnBuilder as t };
|
|
152
|
+
//# sourceMappingURL=operations-registry-DPZ5aElH.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"operations-registry-DPZ5aElH.mjs","names":["selfExpr: Expression","operationArgs: Array<Expression | ParamRef | LiteralExpr>","operationExpr: OperationExpr","returnColumnMeta: StorageColumn","baseResult: ExpressionBuilder"],"sources":["../src/operations-registry.ts"],"sourcesContent":["import type { OperationRegistry } from '@prisma-next/operations';\nimport { hasAllCapabilities } from '@prisma-next/operations';\nimport { planInvalid } from '@prisma-next/plan';\nimport type { StorageColumn } from '@prisma-next/sql-contract/types';\nimport type { SqlOperationSignature } from '@prisma-next/sql-operations';\nimport type {\n BinaryOp,\n Expression,\n ExpressionSource,\n LiteralExpr,\n OperationExpr,\n ParamRef,\n} from './ast/types';\nimport type {\n AnyBinaryBuilder,\n AnyOrderBuilder,\n ColumnBuilder,\n ExpressionBuilder,\n OperationTypes,\n ParamPlaceholder,\n} from './types';\nimport { isParamPlaceholder } from './utils/guards';\n\n/**\n * Type guard to check if a value is an ExpressionSource (has toExpr method).\n */\nfunction isExpressionSource(value: unknown): value is ExpressionSource {\n return (\n typeof value === 'object' &&\n value !== null &&\n 'toExpr' in value &&\n typeof (value as ExpressionSource).toExpr === 'function'\n );\n}\n\n/**\n * Executes an operation and returns an ExpressionBuilder.\n * This is the canonical entrypoint for operation invocation, enabling\n * future enhancements like telemetry, caching, or tracing.\n *\n * The returned ExpressionBuilder:\n * - Has `kind: 'expression'` to distinguish it from ColumnBuilder\n * - Contains the operation expression in `expr`\n * - Provides `toExpr()` method to get the Expression\n * - Provides comparison and ordering methods for chaining\n *\n * @param signature - The operation signature from the registry\n * @param selfBuilder - The expression source that the operation is called on\n * @param args - The arguments passed to the operation\n * @param columnMeta - The metadata of the column the operation is called on\n * @returns An ExpressionBuilder containing the operation expression\n */\nfunction executeOperation(\n signature: SqlOperationSignature,\n selfBuilder: ExpressionSource,\n args: unknown[],\n columnMeta: StorageColumn,\n operationRegistry?: OperationRegistry,\n contractCapabilities?: Record<string, Record<string, boolean>>,\n): ExpressionBuilder {\n if (args.length !== signature.args.length) {\n throw planInvalid(\n `Operation ${signature.method} expects ${signature.args.length} arguments, got ${args.length}`,\n );\n }\n\n // Get the Expression from the self builder using toExpr()\n const selfExpr: Expression = selfBuilder.toExpr();\n\n const operationArgs: Array<Expression | ParamRef | LiteralExpr> = [];\n for (let i = 0; i < args.length; i++) {\n const arg = args[i];\n const argSpec = signature.args[i];\n if (!argSpec) {\n throw planInvalid(`Missing argument spec for argument ${i}`);\n }\n\n if (argSpec.kind === 'param') {\n if (!isParamPlaceholder(arg)) {\n throw planInvalid(`Argument ${i} must be a parameter placeholder`);\n }\n operationArgs.push({\n kind: 'param',\n index: 0,\n name: arg.name,\n });\n } else if (argSpec.kind === 'typeId') {\n // Accept ExpressionSource (ColumnBuilder or ExpressionBuilder)\n if (!isExpressionSource(arg)) {\n throw planInvalid(\n `Argument ${i} must be an ExpressionSource (ColumnBuilder or ExpressionBuilder)`,\n );\n }\n // Use toExpr() to get the Expression\n operationArgs.push(arg.toExpr());\n } else if (argSpec.kind === 'literal') {\n operationArgs.push({\n kind: 'literal',\n value: arg,\n });\n }\n }\n\n const operationExpr: OperationExpr = {\n kind: 'operation',\n method: signature.method,\n forTypeId: signature.forTypeId,\n self: selfExpr,\n args: operationArgs,\n returns: signature.returns,\n lowering: signature.lowering,\n };\n\n const returnTypeId = signature.returns.kind === 'typeId' ? signature.returns.type : undefined;\n const returnColumnMeta: StorageColumn = returnTypeId\n ? {\n ...columnMeta,\n codecId: returnTypeId,\n }\n : columnMeta;\n\n const createComparisonMethod =\n (op: BinaryOp) =>\n (value: ParamPlaceholder | ExpressionSource): AnyBinaryBuilder =>\n Object.freeze({\n kind: 'binary' as const,\n op,\n left: operationExpr,\n right: value,\n }) as AnyBinaryBuilder;\n\n const baseResult: ExpressionBuilder = {\n kind: 'expression' as const,\n expr: operationExpr,\n get columnMeta() {\n return returnColumnMeta;\n },\n eq: createComparisonMethod('eq'),\n neq: createComparisonMethod('neq'),\n gt: createComparisonMethod('gt'),\n lt: createComparisonMethod('lt'),\n gte: createComparisonMethod('gte'),\n lte: createComparisonMethod('lte'),\n asc(): AnyOrderBuilder {\n return Object.freeze({\n kind: 'order' as const,\n expr: operationExpr,\n dir: 'asc' as const,\n });\n },\n desc(): AnyOrderBuilder {\n return Object.freeze({\n kind: 'order' as const,\n expr: operationExpr,\n dir: 'desc' as const,\n });\n },\n toExpr(): OperationExpr {\n return operationExpr;\n },\n get __jsType(): unknown {\n return undefined;\n },\n };\n\n // If the return type is a typeId, attach operations for that type\n if (returnTypeId && operationRegistry) {\n const resultWithOps = attachOperationsToExpressionBuilder(\n baseResult,\n returnColumnMeta,\n operationRegistry,\n contractCapabilities,\n );\n return Object.freeze(resultWithOps);\n }\n\n return Object.freeze(baseResult);\n}\n\n/**\n * Attaches operation methods to an ExpressionBuilder for chained operations.\n * When an operation returns a typeId, the result ExpressionBuilder needs\n * operation methods for that type.\n */\nfunction attachOperationsToExpressionBuilder(\n expressionBuilder: ExpressionBuilder,\n columnMeta: StorageColumn,\n registry: OperationRegistry,\n contractCapabilities?: Record<string, Record<string, boolean>>,\n): ExpressionBuilder {\n const codecId = columnMeta.codecId;\n if (!codecId) {\n return expressionBuilder;\n }\n\n const operations = registry.byType(codecId) as SqlOperationSignature[];\n if (operations.length === 0) {\n return expressionBuilder;\n }\n\n const builderWithOps = expressionBuilder as ExpressionBuilder & Record<string, unknown>;\n\n for (const operation of operations) {\n if (operation.capabilities && operation.capabilities.length > 0) {\n if (!contractCapabilities) {\n continue;\n }\n\n if (!hasAllCapabilities(operation.capabilities, contractCapabilities)) {\n continue;\n }\n }\n // Method sugar: attach operation as a method on the expression builder\n builderWithOps[operation.method] = function (this: ExpressionBuilder, ...args: unknown[]) {\n return executeOperation(operation, this, args, columnMeta, registry, contractCapabilities);\n };\n }\n\n return builderWithOps;\n}\n\nexport function attachOperationsToColumnBuilder<\n ColumnName extends string,\n ColumnMeta extends StorageColumn,\n JsType = unknown,\n Operations extends OperationTypes = Record<string, never>,\n>(\n columnBuilder: ColumnBuilder<ColumnName, ColumnMeta, JsType, Record<string, never>>,\n columnMeta: ColumnMeta,\n registry: OperationRegistry | undefined,\n contractCapabilities?: Record<string, Record<string, boolean>>,\n): ColumnBuilder<ColumnName, ColumnMeta, JsType, Operations> {\n if (!registry) {\n return columnBuilder as ColumnBuilder<ColumnName, ColumnMeta, JsType, Operations>;\n }\n\n // Use codecId to look up operations registered for this column's type\n const codecId = columnMeta.codecId;\n if (!codecId) {\n return columnBuilder as ColumnBuilder<ColumnName, ColumnMeta, JsType, Operations>;\n }\n\n const operations = registry.byType(codecId) as SqlOperationSignature[];\n if (operations.length === 0) {\n return columnBuilder as ColumnBuilder<ColumnName, ColumnMeta, JsType, Operations>;\n }\n\n const builderWithOps = columnBuilder as unknown as ColumnBuilder<\n ColumnName,\n ColumnMeta,\n JsType,\n Operations\n >;\n\n for (const operation of operations) {\n if (operation.capabilities && operation.capabilities.length > 0) {\n if (!contractCapabilities) {\n continue;\n }\n\n if (!hasAllCapabilities(operation.capabilities, contractCapabilities)) {\n continue;\n }\n }\n // Method sugar: attach operation as a method on the column builder\n // Operations return ExpressionBuilder, not ColumnBuilder\n (builderWithOps as Record<string, unknown>)[operation.method] = function (\n this: ColumnBuilder<ColumnName, ColumnMeta, JsType, Record<string, never>>,\n ...args: unknown[]\n ) {\n return executeOperation(operation, this, args, columnMeta, registry, contractCapabilities);\n };\n }\n\n return builderWithOps;\n}\n"],"mappings":";;;;;;;;AA0BA,SAAS,mBAAmB,OAA2C;AACrE,QACE,OAAO,UAAU,YACjB,UAAU,QACV,YAAY,SACZ,OAAQ,MAA2B,WAAW;;;;;;;;;;;;;;;;;;;AAqBlD,SAAS,iBACP,WACA,aACA,MACA,YACA,mBACA,sBACmB;AACnB,KAAI,KAAK,WAAW,UAAU,KAAK,OACjC,OAAM,YACJ,aAAa,UAAU,OAAO,WAAW,UAAU,KAAK,OAAO,kBAAkB,KAAK,SACvF;CAIH,MAAMA,WAAuB,YAAY,QAAQ;CAEjD,MAAMC,gBAA4D,EAAE;AACpE,MAAK,IAAI,IAAI,GAAG,IAAI,KAAK,QAAQ,KAAK;EACpC,MAAM,MAAM,KAAK;EACjB,MAAM,UAAU,UAAU,KAAK;AAC/B,MAAI,CAAC,QACH,OAAM,YAAY,sCAAsC,IAAI;AAG9D,MAAI,QAAQ,SAAS,SAAS;AAC5B,OAAI,CAAC,mBAAmB,IAAI,CAC1B,OAAM,YAAY,YAAY,EAAE,kCAAkC;AAEpE,iBAAc,KAAK;IACjB,MAAM;IACN,OAAO;IACP,MAAM,IAAI;IACX,CAAC;aACO,QAAQ,SAAS,UAAU;AAEpC,OA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AS,OAAO,QAAQ;AAC3C,KAAI,WAAW,WAAW,EACxB,QAAO;CAGT,MAAM,iBAAiB;AAEvB,MAAK,MAAM,aAAa,YAAY;AAClC,MAAI,UAAU,gBAAgB,UAAU,aAAa,SAAS,GAAG;AAC/D,OAAI,CAAC,qBACH;AAGF,OAAI,CAAC,mBAAmB,UAAU,cAAc,qBAAqB,CACnE;;AAIJ,iBAAe,UAAU,UAAU,SAAmC,GAAG,MAAiB;AACxF,UAAO,iBAAiB,WAAW,MAAM,MAAM,YAAY,UAAU,qBAAqB;;;AAI9F,QAAO;;AAGT,SAAgB,gCAMd,eACA,YACA,UACA,sBAC2D;AAC3D,KAAI,CAAC,SACH,QAAO;CAIT,MAAM,UAAU,WAAW;AAC3B,KAAI,CAAC,QACH,QAAO;CAGT,MAAM,aAAa,SAAS,OAAO,QAAQ;AAC3C,KAAI,WAAW,WAAW,EACxB,QAAO;CAGT,MAAM,iBAAiB;AAOvB,MAAK,MAAM,aAAa,YAAY;AAClC,MAAI,UAAU,gBAAgB,UAAU,aAAa,SAAS,GAAG;AAC/D,OAAI,CAAC,qBACH;AAGF,OAAI,CAAC,mBAAmB,UAAU,cAAc,qBAAqB,CACnE;;AAKJ,EAAC,eAA2C,UAAU,UAAU,SAE9D,GAAG,MACH;AACA,UAAO,iBAAiB,WAAW,MAAM,MAAM,YAAY,UAAU,qBAAqB;;;AAI9F,QAAO"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { A as OperationTypes, d as ColumnBuilder } from "./types-CEUzDuDC.mjs";
|
|
2
|
+
import { OperationRegistry } from "@prisma-next/operations";
|
|
3
|
+
import { StorageColumn } from "@prisma-next/sql-contract/types";
|
|
4
|
+
|
|
5
|
+
//#region src/operations-registry.d.ts
|
|
6
|
+
declare function attachOperationsToColumnBuilder<ColumnName extends string, ColumnMeta extends StorageColumn, JsType = unknown, Operations extends OperationTypes = Record<string, never>>(columnBuilder: ColumnBuilder<ColumnName, ColumnMeta, JsType, Record<string, never>>, columnMeta: ColumnMeta, registry: OperationRegistry | undefined, contractCapabilities?: Record<string, Record<string, boolean>>): ColumnBuilder<ColumnName, ColumnMeta, JsType, Operations>;
|
|
7
|
+
//#endregion
|
|
8
|
+
export { attachOperationsToColumnBuilder as t };
|
|
9
|
+
//# sourceMappingURL=operations-registry-wVEaiLyt.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"operations-registry-wVEaiLyt.d.mts","names":[],"sources":["../src/operations-registry.ts"],"sourcesContent":[],"mappings":";;;;;iBA6NgB,8EAEK,oDAEA,iBAAiB,sCAErB,cAAc,YAAY,YAAY,QAAQ,oCACjD,sBACF,sDACa,eAAe,2BACrC,cAAc,YAAY,YAAY,QAAQ"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { N as ParamPlaceholder } from "./types-CEUzDuDC.mjs";
|
|
2
|
+
|
|
3
|
+
//#region src/param.d.ts
|
|
4
|
+
type Parameter = ParamPlaceholder;
|
|
5
|
+
declare function param(name: string): Parameter;
|
|
6
|
+
//#endregion
|
|
7
|
+
export { param as n, Parameter as t };
|
|
8
|
+
//# sourceMappingURL=param-C4n0OW59.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"param-C4n0OW59.d.mts","names":[],"sources":["../src/param.ts"],"sourcesContent":[],"mappings":";;;KAGY,SAAA,GAAY;iBAER,KAAA,gBAAqB"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { planInvalid } from "@prisma-next/plan";
|
|
2
|
+
|
|
3
|
+
//#region src/param.ts
|
|
4
|
+
function param(name) {
|
|
5
|
+
if (typeof name !== "string" || name.length === 0) throw planInvalid("Parameter name must be a non-empty string");
|
|
6
|
+
return Object.freeze({
|
|
7
|
+
kind: "param-placeholder",
|
|
8
|
+
name
|
|
9
|
+
});
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
//#endregion
|
|
13
|
+
export { param as t };
|
|
14
|
+
//# sourceMappingURL=param-DMU3OWfI.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"param-DMU3OWfI.mjs","names":[],"sources":["../src/param.ts"],"sourcesContent":["import { planInvalid } from '@prisma-next/plan';\nimport type { ParamPlaceholder } from './types';\n\nexport type Parameter = ParamPlaceholder;\n\nexport function param(name: string): Parameter {\n if (typeof name !== 'string' || name.length === 0) {\n throw planInvalid('Parameter name must be a non-empty string');\n }\n\n return Object.freeze({\n kind: 'param-placeholder' as const,\n name,\n }) satisfies Parameter;\n}\n"],"mappings":";;;AAKA,SAAgB,MAAM,MAAyB;AAC7C,KAAI,OAAO,SAAS,YAAY,KAAK,WAAW,EAC9C,OAAM,YAAY,4CAA4C;AAGhE,QAAO,OAAO,OAAO;EACnB,MAAM;EACN;EACD,CAAC"}
|
|
@@ -0,0 +1,194 @@
|
|
|
1
|
+
import { ReturnSpec } from "@prisma-next/operations";
|
|
2
|
+
import { ExecutionPlan, ParamDescriptor } from "@prisma-next/contract/types";
|
|
3
|
+
import { SqlLoweringSpec } from "@prisma-next/sql-operations";
|
|
4
|
+
import { StorageColumn } from "@prisma-next/sql-contract/types";
|
|
5
|
+
|
|
6
|
+
//#region src/ast/types.d.ts
|
|
7
|
+
type Direction = 'asc' | 'desc';
|
|
8
|
+
interface TableRef {
|
|
9
|
+
readonly kind: 'table';
|
|
10
|
+
readonly name: string;
|
|
11
|
+
}
|
|
12
|
+
interface ColumnRef {
|
|
13
|
+
readonly kind: 'col';
|
|
14
|
+
readonly table: string;
|
|
15
|
+
readonly column: string;
|
|
16
|
+
}
|
|
17
|
+
interface ParamRef {
|
|
18
|
+
readonly kind: 'param';
|
|
19
|
+
readonly index: number;
|
|
20
|
+
readonly name?: string;
|
|
21
|
+
}
|
|
22
|
+
interface LiteralExpr {
|
|
23
|
+
readonly kind: 'literal';
|
|
24
|
+
readonly value: unknown;
|
|
25
|
+
}
|
|
26
|
+
interface OperationExpr {
|
|
27
|
+
readonly kind: 'operation';
|
|
28
|
+
readonly method: string;
|
|
29
|
+
readonly forTypeId: string;
|
|
30
|
+
readonly self: Expression;
|
|
31
|
+
readonly args: ReadonlyArray<Expression | ParamRef | LiteralExpr>;
|
|
32
|
+
readonly returns: ReturnSpec;
|
|
33
|
+
readonly lowering: SqlLoweringSpec;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Unified expression type - the canonical AST representation for column references
|
|
37
|
+
* and operation expressions. This is what all builders convert to via toExpr().
|
|
38
|
+
*/
|
|
39
|
+
type Expression = ColumnRef | OperationExpr;
|
|
40
|
+
/**
|
|
41
|
+
* Interface for any builder that can produce an Expression.
|
|
42
|
+
* Implemented by ColumnBuilder and ExpressionBuilder.
|
|
43
|
+
*/
|
|
44
|
+
interface ExpressionSource {
|
|
45
|
+
toExpr(): Expression;
|
|
46
|
+
}
|
|
47
|
+
declare function isOperationExpr(expr: Expression): expr is OperationExpr;
|
|
48
|
+
type BinaryOp = 'eq' | 'neq' | 'gt' | 'lt' | 'gte' | 'lte' | 'like' | 'ilike' | 'in' | 'notIn';
|
|
49
|
+
interface BinaryExpr {
|
|
50
|
+
readonly kind: 'bin';
|
|
51
|
+
readonly op: BinaryOp;
|
|
52
|
+
readonly left: Expression;
|
|
53
|
+
readonly right: Expression | ParamRef | LiteralExpr | ListLiteralExpr;
|
|
54
|
+
}
|
|
55
|
+
interface ListLiteralExpr {
|
|
56
|
+
readonly kind: 'listLiteral';
|
|
57
|
+
readonly values: ReadonlyArray<ParamRef | LiteralExpr>;
|
|
58
|
+
}
|
|
59
|
+
interface AndExpr {
|
|
60
|
+
readonly kind: 'and';
|
|
61
|
+
readonly exprs: ReadonlyArray<WhereExpr>;
|
|
62
|
+
}
|
|
63
|
+
interface OrExpr {
|
|
64
|
+
readonly kind: 'or';
|
|
65
|
+
readonly exprs: ReadonlyArray<WhereExpr>;
|
|
66
|
+
}
|
|
67
|
+
interface ExistsExpr {
|
|
68
|
+
readonly kind: 'exists';
|
|
69
|
+
readonly not: boolean;
|
|
70
|
+
readonly subquery: SelectAst;
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* Unary expression for IS NULL / IS NOT NULL checks.
|
|
74
|
+
* Used in WHERE clauses to check for null values.
|
|
75
|
+
*/
|
|
76
|
+
interface NullCheckExpr {
|
|
77
|
+
readonly kind: 'nullCheck';
|
|
78
|
+
readonly expr: Expression;
|
|
79
|
+
readonly isNull: boolean;
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* Union type for WHERE clause expressions.
|
|
83
|
+
*/
|
|
84
|
+
type WhereExpr = BinaryExpr | ExistsExpr | NullCheckExpr | AndExpr | OrExpr;
|
|
85
|
+
interface BoundWhereExpr {
|
|
86
|
+
readonly expr: WhereExpr;
|
|
87
|
+
readonly params: readonly unknown[];
|
|
88
|
+
readonly paramDescriptors: ReadonlyArray<ParamDescriptor>;
|
|
89
|
+
}
|
|
90
|
+
interface ToWhereExpr {
|
|
91
|
+
toWhereExpr(): BoundWhereExpr;
|
|
92
|
+
}
|
|
93
|
+
type WhereArg = WhereExpr | ToWhereExpr;
|
|
94
|
+
type JoinOnExpr = {
|
|
95
|
+
readonly kind: 'eqCol';
|
|
96
|
+
readonly left: ColumnRef;
|
|
97
|
+
readonly right: ColumnRef;
|
|
98
|
+
} | WhereExpr;
|
|
99
|
+
interface JoinAst {
|
|
100
|
+
readonly kind: 'join';
|
|
101
|
+
readonly joinType: 'inner' | 'left' | 'right' | 'full';
|
|
102
|
+
readonly table: TableRef;
|
|
103
|
+
readonly on: JoinOnExpr;
|
|
104
|
+
}
|
|
105
|
+
interface IncludeRef {
|
|
106
|
+
readonly kind: 'includeRef';
|
|
107
|
+
readonly alias: string;
|
|
108
|
+
}
|
|
109
|
+
interface IncludeAst {
|
|
110
|
+
readonly kind: 'includeMany';
|
|
111
|
+
readonly alias: string;
|
|
112
|
+
readonly child: {
|
|
113
|
+
readonly table: TableRef;
|
|
114
|
+
readonly on: JoinOnExpr;
|
|
115
|
+
readonly where?: WhereExpr;
|
|
116
|
+
readonly orderBy?: ReadonlyArray<{
|
|
117
|
+
expr: Expression;
|
|
118
|
+
dir: Direction;
|
|
119
|
+
}>;
|
|
120
|
+
readonly limit?: number;
|
|
121
|
+
readonly project: ReadonlyArray<{
|
|
122
|
+
alias: string;
|
|
123
|
+
expr: Expression;
|
|
124
|
+
}>;
|
|
125
|
+
};
|
|
126
|
+
}
|
|
127
|
+
interface SelectAst {
|
|
128
|
+
readonly kind: 'select';
|
|
129
|
+
readonly from: TableRef;
|
|
130
|
+
readonly joins?: ReadonlyArray<JoinAst>;
|
|
131
|
+
readonly includes?: ReadonlyArray<IncludeAst>;
|
|
132
|
+
readonly project: ReadonlyArray<{
|
|
133
|
+
alias: string;
|
|
134
|
+
expr: Expression | IncludeRef | LiteralExpr;
|
|
135
|
+
}>;
|
|
136
|
+
readonly where?: WhereExpr;
|
|
137
|
+
readonly orderBy?: ReadonlyArray<{
|
|
138
|
+
expr: Expression;
|
|
139
|
+
dir: Direction;
|
|
140
|
+
}>;
|
|
141
|
+
readonly limit?: number;
|
|
142
|
+
readonly selectAllIntent?: {
|
|
143
|
+
table?: string;
|
|
144
|
+
};
|
|
145
|
+
}
|
|
146
|
+
interface InsertAst {
|
|
147
|
+
readonly kind: 'insert';
|
|
148
|
+
readonly table: TableRef;
|
|
149
|
+
readonly values: Record<string, ColumnRef | ParamRef>;
|
|
150
|
+
readonly returning?: ReadonlyArray<ColumnRef>;
|
|
151
|
+
}
|
|
152
|
+
interface UpdateAst {
|
|
153
|
+
readonly kind: 'update';
|
|
154
|
+
readonly table: TableRef;
|
|
155
|
+
readonly set: Record<string, ColumnRef | ParamRef>;
|
|
156
|
+
readonly where?: WhereExpr;
|
|
157
|
+
readonly returning?: ReadonlyArray<ColumnRef>;
|
|
158
|
+
}
|
|
159
|
+
interface DeleteAst {
|
|
160
|
+
readonly kind: 'delete';
|
|
161
|
+
readonly table: TableRef;
|
|
162
|
+
readonly where?: WhereExpr;
|
|
163
|
+
readonly returning?: ReadonlyArray<ColumnRef>;
|
|
164
|
+
}
|
|
165
|
+
type QueryAst = SelectAst | InsertAst | UpdateAst | DeleteAst;
|
|
166
|
+
interface LoweredStatement {
|
|
167
|
+
readonly sql: string;
|
|
168
|
+
readonly params: readonly unknown[];
|
|
169
|
+
readonly annotations?: Record<string, unknown>;
|
|
170
|
+
}
|
|
171
|
+
//#endregion
|
|
172
|
+
//#region src/plan.d.ts
|
|
173
|
+
/**
|
|
174
|
+
* SQL query plan produced by lanes before lowering.
|
|
175
|
+
*
|
|
176
|
+
* Lanes build ASTs and metadata but do not perform SQL lowering.
|
|
177
|
+
* The `sql` field is absent - lowering happens in the runtime executor.
|
|
178
|
+
*
|
|
179
|
+
* Structurally aligns with ExecutionPlan<Row, QueryAst> (without sql field) to maintain
|
|
180
|
+
* compatibility with ExecutionPlan/Plan-based utilities.
|
|
181
|
+
* The generic parameter `_Row` is preserved for type extraction via ResultType.
|
|
182
|
+
*/
|
|
183
|
+
interface SqlQueryPlan<_Row = unknown> extends Pick<ExecutionPlan<_Row, QueryAst>, 'params' | 'meta'> {
|
|
184
|
+
readonly ast: QueryAst;
|
|
185
|
+
readonly _Row?: _Row;
|
|
186
|
+
}
|
|
187
|
+
/**
|
|
188
|
+
* Augments the last ParamDescriptor in the array with codecId and nativeType from columnMeta.
|
|
189
|
+
* This is used when building WHERE expressions to ensure param descriptors have type information.
|
|
190
|
+
*/
|
|
191
|
+
declare function augmentDescriptorWithColumnMeta(descriptors: ParamDescriptor[], columnMeta: StorageColumn | undefined): void;
|
|
192
|
+
//#endregion
|
|
193
|
+
export { WhereArg as A, OrExpr as C, TableRef as D, SelectAst as E, isOperationExpr as M, ToWhereExpr as O, OperationExpr as S, QueryAst as T, JoinOnExpr as _, BinaryOp as a, LoweredStatement as b, DeleteAst as c, Expression as d, ExpressionSource as f, JoinAst as g, InsertAst as h, BinaryExpr as i, WhereExpr as j, UpdateAst as k, Direction as l, IncludeRef as m, augmentDescriptorWithColumnMeta as n, BoundWhereExpr as o, IncludeAst as p, AndExpr as r, ColumnRef as s, SqlQueryPlan as t, ExistsExpr as u, ListLiteralExpr as v, ParamRef as w, NullCheckExpr as x, LiteralExpr as y };
|
|
194
|
+
//# sourceMappingURL=plan-BhSWuTfw.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plan-BhSWuTfw.d.mts","names":[],"sources":["../src/ast/types.ts","../src/plan.ts"],"sourcesContent":[],"mappings":";;;;;;KAOY,SAAA;UAEK,QAAA;;EAFL,SAAA,IAAS,EAAA,MAAA;AAErB;AAKiB,UAAA,SAAA,CAAS;EAMT,SAAA,IAAQ,EAAA,KAAA;EAMR,SAAA,KAAW,EAAA,MAAA;EAKX,SAAA,MAAA,EAAa,MAAA;;AAKC,UAhBd,QAAA,CAgBc;EAAa,SAAA,IAAA,EAAA,OAAA;EAAW,SAAA,KAAA,EAAA,MAAA;EAAtC,SAAA,IAAA,CAAA,EAAA,MAAA;;AAEI,UAZJ,WAAA,CAYI;EAAe,SAAA,IAAA,EAAA,SAAA;EAOxB,SAAA,KAAU,EAAA,OAAA;AAMtB;AAIgB,UAxBC,aAAA,CAwBc;EAInB,SAAA,IAAQ,EAAA,WAAA;EAYH,SAAA,MAAU,EAAA,MAAA;EAEZ,SAAA,SAAA,EAAA,MAAA;EACE,SAAA,IAAA,EAvCA,UAuCA;EACC,SAAA,IAAA,EAvCD,aAuCC,CAvCa,UAuCb,GAvC0B,QAuC1B,GAvCqC,WAuCrC,CAAA;EAAa,SAAA,OAAA,EAtCX,UAsCW;EAAW,SAAA,QAAA,EArCrB,eAqCqB;;;AAG1C;;;AAEmB,KAnCP,UAAA,GAAa,SAmCN,GAnCkB,aAmClB;;AAGnB;AAKA;AAKA;AAUiB,UApDA,gBAAA,CAsDA;EAOL,MAAA,EAAA,EA5DA,UA4DS;;AAAgB,iBAzDrB,eAAA,CAyDqB,IAAA,EAzDC,UAyDD,CAAA,EAAA,IAAA,IAzDsB,aAy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