@webda/content-mapper 0.0.0-stage → 4.0.0-beta.4
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/LICENSE +166 -0
- package/lib/coercions.d.ts +22 -0
- package/lib/coercions.d.ts.map +1 -0
- package/lib/coercions.js +10 -0
- package/lib/coercions.js.map +1 -0
- package/lib/context.d.ts +56 -0
- package/lib/context.d.ts.map +1 -0
- package/lib/context.js +111 -0
- package/lib/context.js.map +1 -0
- package/lib/defaults.d.ts +31 -0
- package/lib/defaults.d.ts.map +1 -0
- package/lib/defaults.js +33 -0
- package/lib/defaults.js.map +1 -0
- package/lib/generators/accessors.d.ts +15 -0
- package/lib/generators/accessors.d.ts.map +1 -0
- package/lib/generators/accessors.js +567 -0
- package/lib/generators/accessors.js.map +1 -0
- package/lib/generators/behaviors.d.ts +21 -0
- package/lib/generators/behaviors.d.ts.map +1 -0
- package/lib/generators/behaviors.js +292 -0
- package/lib/generators/behaviors.js.map +1 -0
- package/lib/generators/imports.d.ts +86 -0
- package/lib/generators/imports.d.ts.map +1 -0
- package/lib/generators/imports.js +205 -0
- package/lib/generators/imports.js.map +1 -0
- package/lib/generators/loadparameters.d.ts +7 -0
- package/lib/generators/loadparameters.d.ts.map +1 -0
- package/lib/generators/loadparameters.js +175 -0
- package/lib/generators/loadparameters.js.map +1 -0
- package/lib/generators/qlvalidator.d.ts +53 -0
- package/lib/generators/qlvalidator.d.ts.map +1 -0
- package/lib/generators/qlvalidator.js +238 -0
- package/lib/generators/qlvalidator.js.map +1 -0
- package/lib/index.d.ts +53 -0
- package/lib/index.d.ts.map +1 -0
- package/lib/index.js +36 -0
- package/lib/index.js.map +1 -0
- package/lib/module-discovery.d.ts +211 -0
- package/lib/module-discovery.d.ts.map +1 -0
- package/lib/module-discovery.js +662 -0
- package/lib/module-discovery.js.map +1 -0
- package/lib/module.d.ts +213 -0
- package/lib/module.d.ts.map +1 -0
- package/lib/module.js +1243 -0
- package/lib/module.js.map +1 -0
- package/lib/plan.d.ts +101 -0
- package/lib/plan.d.ts.map +1 -0
- package/lib/plan.js +61 -0
- package/lib/plan.js.map +1 -0
- package/lib/property-order.d.ts +37 -0
- package/lib/property-order.d.ts.map +1 -0
- package/lib/property-order.js +141 -0
- package/lib/property-order.js.map +1 -0
- package/lib/schema/action.d.ts +46 -0
- package/lib/schema/action.d.ts.map +1 -0
- package/lib/schema/action.js +190 -0
- package/lib/schema/action.js.map +1 -0
- package/lib/schema/annotations.d.ts +63 -0
- package/lib/schema/annotations.d.ts.map +1 -0
- package/lib/schema/annotations.js +116 -0
- package/lib/schema/annotations.js.map +1 -0
- package/lib/schema/converter.d.ts +363 -0
- package/lib/schema/converter.d.ts.map +1 -0
- package/lib/schema/converter.js +1377 -0
- package/lib/schema/converter.js.map +1 -0
- package/lib/schema/jsdoc.d.ts +34 -0
- package/lib/schema/jsdoc.d.ts.map +1 -0
- package/lib/schema/jsdoc.js +206 -0
- package/lib/schema/jsdoc.js.map +1 -0
- package/lib/schema/model.d.ts +27 -0
- package/lib/schema/model.d.ts.map +1 -0
- package/lib/schema/model.js +86 -0
- package/lib/schema/model.js.map +1 -0
- package/lib/schema/project.d.ts +34 -0
- package/lib/schema/project.d.ts.map +1 -0
- package/lib/schema/project.js +305 -0
- package/lib/schema/project.js.map +1 -0
- package/lib/schema/service.d.ts +62 -0
- package/lib/schema/service.d.ts.map +1 -0
- package/lib/schema/service.js +130 -0
- package/lib/schema/service.js.map +1 -0
- package/lib/schema/types.d.ts +61 -0
- package/lib/schema/types.d.ts.map +1 -0
- package/lib/schema/types.js +36 -0
- package/lib/schema/types.js.map +1 -0
- package/lib/schema/worker-cli.d.ts +3 -0
- package/lib/schema/worker-cli.d.ts.map +1 -0
- package/lib/schema/worker-cli.js +7 -0
- package/lib/schema/worker-cli.js.map +1 -0
- package/lib/schema/worker.d.ts +81 -0
- package/lib/schema/worker.d.ts.map +1 -0
- package/lib/schema/worker.js +186 -0
- package/lib/schema/worker.js.map +1 -0
- package/lib/server.d.ts +2 -0
- package/lib/server.d.ts.map +1 -0
- package/lib/server.js +133 -0
- package/lib/server.js.map +1 -0
- package/lib/session.d.ts +84 -0
- package/lib/session.d.ts.map +1 -0
- package/lib/session.js +141 -0
- package/lib/session.js.map +1 -0
- package/lib/spans.d.ts +46 -0
- package/lib/spans.d.ts.map +1 -0
- package/lib/spans.js +64 -0
- package/lib/spans.js.map +1 -0
- package/lib/twopass.d.ts +45 -0
- package/lib/twopass.d.ts.map +1 -0
- package/lib/twopass.js +87 -0
- package/lib/twopass.js.map +1 -0
- package/lib/vite.d.ts +20 -0
- package/lib/vite.d.ts.map +1 -0
- package/lib/vite.js +41 -0
- package/lib/vite.js.map +1 -0
- package/package.json +89 -3
- package/README.md +0 -3
|
@@ -0,0 +1,175 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `loadParameters` generator — the typed equivalent of
|
|
3
|
+
* `packages/compiler/src/morpher/loadparameters.ts`.
|
|
4
|
+
*
|
|
5
|
+
* For every class extending `Service<T>` that does not already declare
|
|
6
|
+
* `loadParameters`, generate:
|
|
7
|
+
*
|
|
8
|
+
* ```ts
|
|
9
|
+
* protected loadParameters(data: any): T {
|
|
10
|
+
* return new T().load(data);
|
|
11
|
+
* }
|
|
12
|
+
* ```
|
|
13
|
+
*
|
|
14
|
+
* `T` is resolved the same way the morpher resolves it: the explicit type
|
|
15
|
+
* argument on the `extends` clause, falling back to walking the base chain,
|
|
16
|
+
* then to the type parameter's default or constraint.
|
|
17
|
+
*
|
|
18
|
+
* Unlike the morpher this writes nothing to disk — the method is injected into
|
|
19
|
+
* the compiler's view of the file in pass 2.
|
|
20
|
+
*/
|
|
21
|
+
import { SymbolFlags, isTypeParameter } from "typescript/unstable/sync";
|
|
22
|
+
import { classesOf, memberName } from "../context.js";
|
|
23
|
+
/** Base class whose subclasses receive the generated method. */
|
|
24
|
+
const SERVICE_BASE = "Service";
|
|
25
|
+
/**
|
|
26
|
+
* Resolve the parameters type for a service class.
|
|
27
|
+
*
|
|
28
|
+
* Mirrors `getTypeArgumentName`: prefer the explicit `extends Service<T>` type
|
|
29
|
+
* argument; otherwise ask the checker for the base type's argument, which
|
|
30
|
+
* covers `class A extends B` where `B extends Service<T>`.
|
|
31
|
+
* @param ctx - analysis context
|
|
32
|
+
* @param sf - containing source file
|
|
33
|
+
* @param cls - the class declaration
|
|
34
|
+
* @returns the parameters type name, if resolvable
|
|
35
|
+
*/
|
|
36
|
+
function parametersTypeName(ctx, sf, cls) {
|
|
37
|
+
for (const clause of cls.heritageClauses ?? []) {
|
|
38
|
+
if (clause.token !== 95)
|
|
39
|
+
continue; // ExtendsKeyword
|
|
40
|
+
for (const t of clause.types) {
|
|
41
|
+
const args = t.typeArguments;
|
|
42
|
+
if (!args?.length)
|
|
43
|
+
continue;
|
|
44
|
+
const written = ctx.textOf(sf, args[0]);
|
|
45
|
+
// `class Svc<T> extends Service<T>` — `new T()` is not constructible.
|
|
46
|
+
// Mirror the morpher: fall back to the type parameter's default, then to
|
|
47
|
+
// its constraint. Without this, generic services emit TS2693.
|
|
48
|
+
const argType = ctx.checker.getTypeFromTypeNode(args[0]);
|
|
49
|
+
if (argType && isTypeParameter(argType)) {
|
|
50
|
+
const dflt = ctx.checker.getDefaultFromTypeParameter(argType);
|
|
51
|
+
if (dflt)
|
|
52
|
+
return ctx.checker.typeToString(dflt);
|
|
53
|
+
const constraint = ctx.checker.getConstraintOfTypeParameter(argType);
|
|
54
|
+
if (constraint)
|
|
55
|
+
return ctx.checker.typeToString(constraint);
|
|
56
|
+
return undefined; // unconstrained generic: not safely constructible
|
|
57
|
+
}
|
|
58
|
+
return written;
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
// No explicit argument — ask the checker for the instantiated base type.
|
|
62
|
+
try {
|
|
63
|
+
const symbol = ctx.checker.getSymbolAtLocation(cls.name);
|
|
64
|
+
if (!symbol)
|
|
65
|
+
return undefined;
|
|
66
|
+
const declared = ctx.checker.getDeclaredTypeOfSymbol(symbol);
|
|
67
|
+
const bases = ctx.checker.getBaseTypes?.(declared) ?? [];
|
|
68
|
+
for (const base of bases) {
|
|
69
|
+
const printed = ctx.checker.typeToString(base);
|
|
70
|
+
const m = /^Service<\s*(.+?)\s*>$/.exec(printed);
|
|
71
|
+
if (m)
|
|
72
|
+
return m[1];
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
catch {
|
|
76
|
+
// Best-effort: an unresolvable base simply means we skip the class.
|
|
77
|
+
}
|
|
78
|
+
return undefined;
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* Verify the resolved parameters type is actually usable in `new T().load(data)`
|
|
82
|
+
* *at this location*: resolvable as a value, constructible with no arguments,
|
|
83
|
+
* and exposing a `load` method.
|
|
84
|
+
*
|
|
85
|
+
* Without these checks the generator emits code that does not compile — on
|
|
86
|
+
* `packages/core` it produced TS2304 (name not in scope), TS2554 (constructor
|
|
87
|
+
* needs arguments) and TS2349 (no `load`). Skipping is always safe: the class
|
|
88
|
+
* simply keeps today's behaviour.
|
|
89
|
+
* @param ctx - analysis context
|
|
90
|
+
* @param typeName - the resolved parameters type name
|
|
91
|
+
* @param location - node used for scope resolution
|
|
92
|
+
* @returns true when the generated call would be valid
|
|
93
|
+
*/
|
|
94
|
+
function isUsable(ctx, typeName, location) {
|
|
95
|
+
// A qualified or generic name is beyond what this PoC verifies.
|
|
96
|
+
if (!/^[A-Za-z_$][\w$]*$/.test(typeName))
|
|
97
|
+
return false;
|
|
98
|
+
const symbol = ctx.checker.resolveName(typeName, SymbolFlags.Value, location);
|
|
99
|
+
if (!symbol)
|
|
100
|
+
return false;
|
|
101
|
+
const ctorType = ctx.checker.getTypeOfSymbol(symbol);
|
|
102
|
+
if (!ctorType)
|
|
103
|
+
return false;
|
|
104
|
+
// 1 === SignatureKind.Construct
|
|
105
|
+
const ctors = ctx.checker.getSignaturesOfType(ctorType, 1);
|
|
106
|
+
if (!ctors.length)
|
|
107
|
+
return false;
|
|
108
|
+
const zeroArgOk = ctors.some(sig => {
|
|
109
|
+
const params = sig.parameters ?? [];
|
|
110
|
+
const minArgs = sig.minArgumentCount ?? params.length;
|
|
111
|
+
return minArgs === 0;
|
|
112
|
+
});
|
|
113
|
+
if (!zeroArgOk)
|
|
114
|
+
return false;
|
|
115
|
+
const instance = ctx.checker.getDeclaredTypeOfSymbol(symbol);
|
|
116
|
+
return !!(instance && ctx.checker.getPropertyOfType(instance, "load"));
|
|
117
|
+
}
|
|
118
|
+
/**
|
|
119
|
+
* Indentation to use for a generated member, inferred from the class body.
|
|
120
|
+
* @param text - file text
|
|
121
|
+
* @param cls - the class declaration
|
|
122
|
+
* @returns leading whitespace
|
|
123
|
+
*/
|
|
124
|
+
function memberIndent(text, cls) {
|
|
125
|
+
const first = cls.members?.[0];
|
|
126
|
+
if (!first)
|
|
127
|
+
return " ";
|
|
128
|
+
const start = first.getStart?.() ?? first.pos;
|
|
129
|
+
const lineStart = text.lastIndexOf("\n", start - 1) + 1;
|
|
130
|
+
const prefix = text.slice(lineStart, start);
|
|
131
|
+
return /^[ \t]*$/.test(prefix) ? prefix : " ";
|
|
132
|
+
}
|
|
133
|
+
/**
|
|
134
|
+
* Create the loadParameters generator.
|
|
135
|
+
* @returns a generator
|
|
136
|
+
*/
|
|
137
|
+
export function loadParametersGenerator() {
|
|
138
|
+
return {
|
|
139
|
+
name: "loadParameters",
|
|
140
|
+
analyze(ctx) {
|
|
141
|
+
const out = [];
|
|
142
|
+
for (const sf of ctx.sourceFiles) {
|
|
143
|
+
const edits = [];
|
|
144
|
+
for (const cls of classesOf(sf)) {
|
|
145
|
+
if (!ctx.baseNames(sf, cls).includes(SERVICE_BASE))
|
|
146
|
+
continue;
|
|
147
|
+
// Respect a hand-written implementation.
|
|
148
|
+
if (cls.members.some((m) => memberName(m) === "loadParameters"))
|
|
149
|
+
continue;
|
|
150
|
+
const paramsType = parametersTypeName(ctx, sf, cls);
|
|
151
|
+
if (!paramsType)
|
|
152
|
+
continue;
|
|
153
|
+
if (!isUsable(ctx, paramsType, cls))
|
|
154
|
+
continue;
|
|
155
|
+
const indent = memberIndent(sf.text, cls);
|
|
156
|
+
const last = cls.members?.[cls.members.length - 1];
|
|
157
|
+
const insertAt = last ? last.end : cls.end - 1;
|
|
158
|
+
const text = [
|
|
159
|
+
``,
|
|
160
|
+
``,
|
|
161
|
+
`${indent}/** Generated by @webda/codegen. */`,
|
|
162
|
+
`${indent}protected loadParameters(data: any): ${paramsType} {`,
|
|
163
|
+
`${indent} return new ${paramsType}().load(data);`,
|
|
164
|
+
`${indent}}`
|
|
165
|
+
].join("\n");
|
|
166
|
+
edits.push({ start: insertAt, end: insertAt, text, source: "loadParameters" });
|
|
167
|
+
}
|
|
168
|
+
if (edits.length)
|
|
169
|
+
out.push({ fileName: sf.fileName, edits });
|
|
170
|
+
}
|
|
171
|
+
return out;
|
|
172
|
+
}
|
|
173
|
+
};
|
|
174
|
+
}
|
|
175
|
+
//# sourceMappingURL=loadparameters.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"loadparameters.js","sourceRoot":"","sources":["../../src/generators/loadparameters.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AACH,OAAO,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AACxE,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAGtD,gEAAgE;AAChE,MAAM,YAAY,GAAG,SAAS,CAAC;AAE/B;;;;;;;;;;GAUG;AACH,SAAS,kBAAkB,CAAC,GAAoB,EAAE,EAAO,EAAE,GAAQ;IACjE,KAAK,MAAM,MAAM,IAAI,GAAG,CAAC,eAAe,IAAI,EAAE,EAAE,CAAC;QAC/C,IAAI,MAAM,CAAC,KAAK,KAAK,EAAE;YAAE,SAAS,CAAC,iBAAiB;QACpD,KAAK,MAAM,CAAC,IAAI,MAAM,CAAC,KAAK,EAAE,CAAC;YAC7B,MAAM,IAAI,GA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C"}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* WebdaQL generator — the typed replacement for
|
|
3
|
+
* `@webda/ts-plugin/transforms/qlvalidator.ts`.
|
|
4
|
+
*
|
|
5
|
+
* Two jobs, and they use different output channels:
|
|
6
|
+
*
|
|
7
|
+
* - **Validation.** Arguments typed `WebdaQLString<T>` are parsed at compile
|
|
8
|
+
* time and reported through `FileEdits.diagnostics`, which the content mapper
|
|
9
|
+
* protocol carries in `TransformResult.diagnostics`. Positions refer to the
|
|
10
|
+
* authored file, so errors land on the query the developer wrote.
|
|
11
|
+
* - **Rewrite.** A template literal is turned into an `escape(parts, values)`
|
|
12
|
+
* call so interpolated values cannot break out of the query.
|
|
13
|
+
*
|
|
14
|
+
* The original builds the rewrite with `ts.factory`, removed in TypeScript 7;
|
|
15
|
+
* here it is text through the shared plan model.
|
|
16
|
+
*/
|
|
17
|
+
import type { SourceFile } from "typescript/unstable/ast";
|
|
18
|
+
import type { Generator } from "../plan.ts";
|
|
19
|
+
/** Options for the WebdaQL generator. */
|
|
20
|
+
export interface QlValidatorOptions {
|
|
21
|
+
/**
|
|
22
|
+
* Parse a query, throwing on a grammar error.
|
|
23
|
+
*
|
|
24
|
+
* Injected so the generator stays testable without pulling the ANTLR runtime
|
|
25
|
+
* into every unit test. Defaults to `parse` from `@webda/ql`.
|
|
26
|
+
*/
|
|
27
|
+
parse?: (query: string) => unknown;
|
|
28
|
+
/** Module specifier providing `escape`. */
|
|
29
|
+
qlModule?: string;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Attribute paths referenced by a query, as written.
|
|
33
|
+
*
|
|
34
|
+
* Deliberately syntactic: the compile-time check only needs the head of each
|
|
35
|
+
* comparison, and reusing the full query AST would tie this generator to the
|
|
36
|
+
* parser's shape.
|
|
37
|
+
* @param query - raw query text
|
|
38
|
+
* @returns referenced attribute heads
|
|
39
|
+
*/
|
|
40
|
+
export declare function referencedAttributes(query: string): string[];
|
|
41
|
+
/**
|
|
42
|
+
* Create the WebdaQL generator.
|
|
43
|
+
* @param options - generator options
|
|
44
|
+
* @returns a generator
|
|
45
|
+
*/
|
|
46
|
+
export declare function qlValidatorGenerator(options?: QlValidatorOptions): Generator;
|
|
47
|
+
/** Re-exported so hosts can label diagnostics consistently. */
|
|
48
|
+
export declare const WQL_CODES: {
|
|
49
|
+
UNKNOWN_ATTRIBUTE: number;
|
|
50
|
+
GRAMMAR_ERROR: number;
|
|
51
|
+
};
|
|
52
|
+
export type { SourceFile };
|
|
53
|
+
//# sourceMappingURL=qlvalidator.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"qlvalidator.d.ts","sourceRoot":"","sources":["../../src/generators/qlvalidator.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AACH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAE1D,OAAO,KAAK,EAAyD,SAAS,EAAE,MAAM,YAAY,CAAC;AAUnG,yCAAyC;AACzC,MAAM,WAAW,kBAAkB;IACjC;;;;;OAKG;IACH,KAAK,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,OAAO,CAAC;IACnC,2CAA2C;IAC3C,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AA4CD;;;;;;;;GAQG;AACH,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,EAAE,CAS5D;AA2CD;;;;GAIG;AACH,wBAAgB,oBAAoB,CAAC,OAAO,GAAE,kBAAuB,GAAG,SAAS,CAsIhF;AAED,+DAA+D;AAC/D,eAAO,MAAM,SAAS;;;CAAiF,CAAC;AAExG,YAAY,EAAE,UAAU,EAAE,CAAC"}
|
|
@@ -0,0 +1,238 @@
|
|
|
1
|
+
import * as is from "typescript/unstable/ast/is";
|
|
2
|
+
/** Module providing the runtime `escape` helper. */
|
|
3
|
+
const QL_MODULE = "@webda/ql";
|
|
4
|
+
/** Unknown attribute referenced by a query. */
|
|
5
|
+
const WQL_UNKNOWN_ATTRIBUTE = 9001;
|
|
6
|
+
/** Query text does not parse. */
|
|
7
|
+
const WQL_GRAMMAR_ERROR = 9002;
|
|
8
|
+
/**
|
|
9
|
+
* Unwrap `WebdaQLString<T>` to `T`.
|
|
10
|
+
*
|
|
11
|
+
* The brand is an alias, so the alias arguments are checked first; a value that
|
|
12
|
+
* has flowed through a union keeps the brand as a property, which is the
|
|
13
|
+
* fallback.
|
|
14
|
+
* @param ctx - analysis context
|
|
15
|
+
* @param type - the parameter type to unwrap
|
|
16
|
+
* @returns the target type, when the parameter is a branded query string
|
|
17
|
+
*/
|
|
18
|
+
function peelWebdaQLString(ctx, type) {
|
|
19
|
+
if (!type)
|
|
20
|
+
return undefined;
|
|
21
|
+
const aliasSymbol = type.getAliasSymbol?.() ?? type.aliasSymbol;
|
|
22
|
+
if (aliasSymbol?.name === "WebdaQLString") {
|
|
23
|
+
const args = type.getAliasTypeArguments?.() ?? type.aliasTypeArguments;
|
|
24
|
+
if (args?.[0])
|
|
25
|
+
return args[0];
|
|
26
|
+
}
|
|
27
|
+
if (type.isUnionOrIntersection?.()) {
|
|
28
|
+
for (const member of type.types ?? []) {
|
|
29
|
+
const peeled = peelWebdaQLString(ctx, member);
|
|
30
|
+
if (peeled)
|
|
31
|
+
return peeled;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
const brand = ctx.checker.getPropertyOfType(type, "__webdaQL");
|
|
35
|
+
return brand ? ctx.checker.getTypeOfSymbol(brand) : undefined;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Attribute names queryable on a type.
|
|
39
|
+
* @param ctx - analysis context
|
|
40
|
+
* @param type - the target type
|
|
41
|
+
* @returns property names
|
|
42
|
+
*/
|
|
43
|
+
function queryableAttributes(ctx, type) {
|
|
44
|
+
return (type?.getProperties?.() ?? [])
|
|
45
|
+
.map((property) => property.name)
|
|
46
|
+
.filter((name) => typeof name === "string" && !name.startsWith("__"));
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Attribute paths referenced by a query, as written.
|
|
50
|
+
*
|
|
51
|
+
* Deliberately syntactic: the compile-time check only needs the head of each
|
|
52
|
+
* comparison, and reusing the full query AST would tie this generator to the
|
|
53
|
+
* parser's shape.
|
|
54
|
+
* @param query - raw query text
|
|
55
|
+
* @returns referenced attribute heads
|
|
56
|
+
*/
|
|
57
|
+
export function referencedAttributes(query) {
|
|
58
|
+
const names = new Set();
|
|
59
|
+
for (const match of query.matchAll(/([A-Za-z_$][\w$]*(?:\.[A-Za-z_$][\w$]*)*)(?:\s*(?:=|!=|<|>|<=|>=|IN|LIKE)|\s+IS\s+(?:NOT\s+)?NULL\b)/gi)) {
|
|
60
|
+
const head = match[1].split(".")[0];
|
|
61
|
+
if (!/^(AND|OR|NOT|TRUE|FALSE|IN|LIKE|IS|NULL)$/i.test(head))
|
|
62
|
+
names.add(head);
|
|
63
|
+
}
|
|
64
|
+
return [...names];
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* Closest candidate by edit distance, for "did you mean".
|
|
68
|
+
* @param needle - the unknown name
|
|
69
|
+
* @param candidates - known attribute names
|
|
70
|
+
* @returns the nearest candidate, when one is close enough
|
|
71
|
+
*/
|
|
72
|
+
function nearestNeighbour(needle, candidates) {
|
|
73
|
+
let best;
|
|
74
|
+
// Matches the original's cutoff: within two edits, otherwise the suggestion
|
|
75
|
+
// is noise. A transposition such as `titel` for `title` costs two.
|
|
76
|
+
let bestDistance = 3;
|
|
77
|
+
for (const candidate of candidates) {
|
|
78
|
+
const distance = levenshtein(needle, candidate);
|
|
79
|
+
if (distance < bestDistance) {
|
|
80
|
+
bestDistance = distance;
|
|
81
|
+
best = candidate;
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
return best;
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* Levenshtein distance between two strings.
|
|
88
|
+
* @param a - first string
|
|
89
|
+
* @param b - second string
|
|
90
|
+
* @returns the edit distance
|
|
91
|
+
*/
|
|
92
|
+
function levenshtein(a, b) {
|
|
93
|
+
const row = Array.from({ length: b.length + 1 }, (_, i) => i);
|
|
94
|
+
for (let i = 1; i <= a.length; i++) {
|
|
95
|
+
let previous = row[0];
|
|
96
|
+
row[0] = i;
|
|
97
|
+
for (let j = 1; j <= b.length; j++) {
|
|
98
|
+
const current = row[j];
|
|
99
|
+
row[j] = Math.min(row[j] + 1, row[j - 1] + 1, previous + (a[i - 1] === b[j - 1] ? 0 : 1));
|
|
100
|
+
previous = current;
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
return row[b.length];
|
|
104
|
+
}
|
|
105
|
+
/**
|
|
106
|
+
* Create the WebdaQL generator.
|
|
107
|
+
* @param options - generator options
|
|
108
|
+
* @returns a generator
|
|
109
|
+
*/
|
|
110
|
+
export function qlValidatorGenerator(options = {}) {
|
|
111
|
+
const qlModule = options.qlModule ?? QL_MODULE;
|
|
112
|
+
return {
|
|
113
|
+
name: "qlvalidator",
|
|
114
|
+
analyze(ctx) {
|
|
115
|
+
const out = [];
|
|
116
|
+
for (const sf of ctx.sourceFiles) {
|
|
117
|
+
const edits = [];
|
|
118
|
+
const diagnostics = [];
|
|
119
|
+
let needsEscape = false;
|
|
120
|
+
visit(sf);
|
|
121
|
+
if (edits.length || diagnostics.length) {
|
|
122
|
+
if (needsEscape && !new RegExp(`\\bescape\\b`).test(sf.text)) {
|
|
123
|
+
edits.push({
|
|
124
|
+
start: 0,
|
|
125
|
+
end: 0,
|
|
126
|
+
text: `import { escape } from ${JSON.stringify(qlModule)};\n`,
|
|
127
|
+
source: "qlvalidator"
|
|
128
|
+
});
|
|
129
|
+
}
|
|
130
|
+
out.push({ fileName: sf.fileName, edits, diagnostics });
|
|
131
|
+
}
|
|
132
|
+
/**
|
|
133
|
+
* Walk the file for calls whose parameter is a branded query string.
|
|
134
|
+
*
|
|
135
|
+
* `Node.forEachChild` is a method on the node in TypeScript 7. Walking
|
|
136
|
+
* own properties instead follows `parent` back-references and recurses
|
|
137
|
+
* until the stack overflows.
|
|
138
|
+
* @param node - current node
|
|
139
|
+
*/
|
|
140
|
+
function visit(node) {
|
|
141
|
+
if (is.isCallExpression(node))
|
|
142
|
+
inspectCall(node);
|
|
143
|
+
node.forEachChild?.((child) => {
|
|
144
|
+
visit(child);
|
|
145
|
+
return undefined;
|
|
146
|
+
});
|
|
147
|
+
}
|
|
148
|
+
/**
|
|
149
|
+
* Validate and possibly rewrite one call's arguments.
|
|
150
|
+
* @param call - the call expression
|
|
151
|
+
*/
|
|
152
|
+
function inspectCall(call) {
|
|
153
|
+
const signature = ctx.checker.getResolvedSignature?.(call);
|
|
154
|
+
if (!signature)
|
|
155
|
+
return;
|
|
156
|
+
// `Signature.parameters` is a list of raw handles; `getParameterType`
|
|
157
|
+
// is the supported way to read a parameter's type.
|
|
158
|
+
call.arguments?.forEach((argument, index) => {
|
|
159
|
+
const parameterType = ctx.checker.getParameterType(signature, index);
|
|
160
|
+
const target = peelWebdaQLString(ctx, parameterType);
|
|
161
|
+
if (!target)
|
|
162
|
+
return;
|
|
163
|
+
inspectArgument(argument, target);
|
|
164
|
+
});
|
|
165
|
+
}
|
|
166
|
+
/**
|
|
167
|
+
* Validate a query argument, rewriting template literals.
|
|
168
|
+
* @param argument - the argument expression
|
|
169
|
+
* @param target - the type attributes are checked against
|
|
170
|
+
*/
|
|
171
|
+
function inspectArgument(argument, target) {
|
|
172
|
+
if (is.isStringLiteral(argument) || is.isNoSubstitutionTemplateLiteral(argument)) {
|
|
173
|
+
validateQuery(argument.text, argument, target);
|
|
174
|
+
return;
|
|
175
|
+
}
|
|
176
|
+
if (is.isTemplateExpression(argument)) {
|
|
177
|
+
// Static parts are validated with a placeholder standing in for each
|
|
178
|
+
// interpolation, so a hole cannot hide an unknown attribute.
|
|
179
|
+
const parts = [argument.head.text, ...argument.templateSpans.map((span) => span.literal.text)];
|
|
180
|
+
validateQuery(parts.join("?"), argument, target);
|
|
181
|
+
const values = argument.templateSpans.map((span) => ctx.textOf(sf, span.expression)).join(", ");
|
|
182
|
+
const partsLiteral = parts.map(part => JSON.stringify(part)).join(", ");
|
|
183
|
+
edits.push({
|
|
184
|
+
start: argument.getStart(),
|
|
185
|
+
end: argument.end,
|
|
186
|
+
text: `escape([${partsLiteral}], [${values}])`,
|
|
187
|
+
source: "qlvalidator"
|
|
188
|
+
});
|
|
189
|
+
needsEscape = true;
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
/**
|
|
193
|
+
* Parse a query and check its attributes against the target type.
|
|
194
|
+
* @param query - query text
|
|
195
|
+
* @param node - node used for diagnostic position
|
|
196
|
+
* @param target - the type attributes are checked against
|
|
197
|
+
*/
|
|
198
|
+
function validateQuery(query, node, target) {
|
|
199
|
+
const start = node.getStart();
|
|
200
|
+
const length = node.end - start;
|
|
201
|
+
if (options.parse) {
|
|
202
|
+
try {
|
|
203
|
+
options.parse(query);
|
|
204
|
+
}
|
|
205
|
+
catch (error) {
|
|
206
|
+
diagnostics.push({
|
|
207
|
+
start,
|
|
208
|
+
length,
|
|
209
|
+
code: WQL_GRAMMAR_ERROR,
|
|
210
|
+
messageText: `WebdaQL grammar error: ${String(error?.message ?? error)}`
|
|
211
|
+
});
|
|
212
|
+
return;
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
const known = queryableAttributes(ctx, target);
|
|
216
|
+
if (!known.length)
|
|
217
|
+
return;
|
|
218
|
+
for (const attribute of referencedAttributes(query)) {
|
|
219
|
+
if (known.includes(attribute))
|
|
220
|
+
continue;
|
|
221
|
+
const suggestion = nearestNeighbour(attribute, known);
|
|
222
|
+
diagnostics.push({
|
|
223
|
+
start,
|
|
224
|
+
length,
|
|
225
|
+
code: WQL_UNKNOWN_ATTRIBUTE,
|
|
226
|
+
messageText: `Unknown attribute '${attribute}' in WebdaQL query` +
|
|
227
|
+
(suggestion ? `. Did you mean '${suggestion}'?` : ".")
|
|
228
|
+
});
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
return out;
|
|
233
|
+
}
|
|
234
|
+
};
|
|
235
|
+
}
|
|
236
|
+
/** Re-exported so hosts can label diagnostics consistently. */
|
|
237
|
+
export const WQL_CODES = { UNKNOWN_ATTRIBUTE: WQL_UNKNOWN_ATTRIBUTE, GRAMMAR_ERROR: WQL_GRAMMAR_ERROR };
|
|
238
|
+
//# sourceMappingURL=qlvalidator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"qlvalidator.js","sourceRoot":"","sources":["../../src/generators/qlvalidator.ts"],"names":[],"mappings":"AAiBA,OAAO,KAAK,EAAE,MAAM,4BAA4B,CAAC;AAGjD,oDAAoD;AACpD,MAAM,SAAS,GAAG,WAAW,CAAC;AAE9B,+CAA+C;AAC/C,MAAM,qBAAqB,GAAG,IAAI,CAAC;AACnC,iCAAiC;AACjC,MAAM,iBAAiB,GAAG,IAAI,CAAC;AAe/B;;;;;;;;;GASG;AACH,SAAS,iBAAiB,CAAC,GAAoB,EAAE,IAAS;IACxD,IAAI,CAAC,IAAI;QAAE,OAAO,SAAS,CAAC;IAE5B,MAAM,WAAW,GAAG,IAAI,CAAC,cAAc,EAAE,EAAE,IAAI,IAAI,CAAC,WAAW,CAAC;IAChE,IAAI,WAAW,EAAE,IAAI,KAAK,eAAe,EAAE,CAAC;QAC1C,MAAM,IAAI,GAAG,IAAI,CAAC,qBAAqB,EAAE,EAAE,IAAI,IAAI,CAAC,kBAAkB,CAAC;QACvE,IAAI,IAAI,EAAE,CAAC,CAAC,CAAC;YAAE,OAAO,IAAI,CAAC,CAAC,CAAC,CAAC;IAChC,CAAC;IAED,IAAI,IAAI,CAAC,qBAAqB,EAAE,EAAE,EAAE,CAAC;QACnC,KAAK,MAAM,MAAM,IAAI,IAAI,CAAC,KAAK,IAAI,EAAE,EAAE,CAAC;YACtC,MAAM,MAAM,GAAG,iBAAiB,CAAC,GAAG,EAAE,MAAM,CAAC,CAAC;YA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CAAC,CAAC;4BACH,OAAO;wBACT,CAAC;oBACH,CAAC;oBAED,MAAM,KAAK,GAAG,mBAAmB,CAAC,GAAG,EAAE,MAAM,CAAC,CAAC;oBAC/C,IAAI,CAAC,KAAK,CAAC,MAAM;wBAAE,OAAO;oBAC1B,KAAK,MAAM,SAAS,IAAI,oBAAoB,CAAC,KAAK,CAAC,EAAE,CAAC;wBACpD,IAAI,KAAK,CAAC,QAAQ,CAAC,SAAS,CAAC;4BAAE,SAAS;wBACxC,MAAM,UAAU,GAAG,gBAAgB,CAAC,SAAS,EAAE,KAAK,CAAC,CAAC;wBACtD,WAAW,CAAC,IAAI,CAAC;4BACf,KAAK;4BACL,MAAM;4BACN,IAAI,EAAE,qBAAqB;4BAC3B,WAAW,EACT,sBAAsB,SAAS,oBAAoB;gCACnD,CAAC,UAAU,CAAC,CAAC,CAAC,mBAAmB,UAAU,IAAI,CAAC,CAAC,CAAC,GAAG,CAAC;yBACzD,CAAC,CAAC;oBACL,CAAC;gBACH,CAAC;YACH,CAAC;YAED,OAAO,GAAG,CAAC;QACb,CAAC;KACF,CAAC;AACJ,CAAC;AAED,+DAA+D;AAC/D,MAAM,CAAC,MAAM,SAAS,GAAG,EAAE,iBAAiB,EAAE,qBAAqB,EAAE,aAAa,EAAE,iBAAiB,EAAE,CAAC"}
|
package/lib/index.d.ts
ADDED
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Webda's compile-time code generation, as a TypeScript 7.1 content mapper.
|
|
3
|
+
*
|
|
4
|
+
* TypeScript 7 removed custom emit transformers, `ts-patch` and language-service
|
|
5
|
+
* plugins. This package replaces them with the supported mechanism: a content
|
|
6
|
+
* mapper process that rewrites model and service sources into ordinary
|
|
7
|
+
* TypeScript before the compiler sees them, plus span maps so diagnostics,
|
|
8
|
+
* hover and rename still land on the authored text.
|
|
9
|
+
*
|
|
10
|
+
* Two hosts share one implementation of the transform:
|
|
11
|
+
*
|
|
12
|
+
* - {@link WarmSession} — used by the mapper process ({@link ./server.ts}) to
|
|
13
|
+
* serve the editor and `tsc`.
|
|
14
|
+
* - {@link runTwoPass} — used by `@webda/compiler` to type-check and emit.
|
|
15
|
+
*
|
|
16
|
+
* See `docs/contribute/TypeScript 7 Content Mappers.md` for the rationale.
|
|
17
|
+
*/
|
|
18
|
+
export { DEFAULT_COERCIONS } from "./coercions.ts";
|
|
19
|
+
export type { CoercionRegistry, CoercionRule } from "./coercions.ts";
|
|
20
|
+
export { baseNames, classesOf, isStatic, memberName, openSession, textOf, triviaOf } from "./context.ts";
|
|
21
|
+
export type { Session } from "./context.ts";
|
|
22
|
+
export { applyEdits, mergePlan } from "./plan.ts";
|
|
23
|
+
export type { AnalysisContext, Edit, FileEdits, GeneratedDiagnostic, Generator } from "./plan.ts";
|
|
24
|
+
export { accessorsGenerator } from "./generators/accessors.ts";
|
|
25
|
+
export type { AccessorOptions } from "./generators/accessors.ts";
|
|
26
|
+
export { behaviorsGenerator, BEHAVIOR_PARENT_KEY } from "./generators/behaviors.ts";
|
|
27
|
+
export type { BehaviorOptions } from "./generators/behaviors.ts";
|
|
28
|
+
export { loadParametersGenerator } from "./generators/loadparameters.ts";
|
|
29
|
+
export { qlValidatorGenerator, WQL_CODES } from "./generators/qlvalidator.ts";
|
|
30
|
+
export type { QlValidatorOptions } from "./generators/qlvalidator.ts";
|
|
31
|
+
export { buildMappedText, SpanMapKind } from "./spans.ts";
|
|
32
|
+
export type { MappedText, SpanMapping } from "./spans.ts";
|
|
33
|
+
export { buildModelMetadata, buildRelations, discoverWebdaObjects, reflectAttributes } from "./module-discovery.ts";
|
|
34
|
+
export type { DiscoveredObject, DiscoveryOptions, ModelMetadata, ModelRelations, ReflectedAttribute, Section } from "./module-discovery.ts";
|
|
35
|
+
export { WarmSession } from "./session.ts";
|
|
36
|
+
export type { TransformOutcome, TransformTiming, WarmSessionOptions } from "./session.ts";
|
|
37
|
+
export { defaultGenerators } from "./defaults.ts";
|
|
38
|
+
export type { DefaultGeneratorOptions } from "./defaults.ts";
|
|
39
|
+
export { runTwoPass } from "./twopass.ts";
|
|
40
|
+
export type { TwoPassOptions, TwoPassResult } from "./twopass.ts";
|
|
41
|
+
export { SchemaConverter } from "./schema/converter.ts";
|
|
42
|
+
export type { BufferStrategy, ConverterOptions, SchemaMode } from "./schema/converter.ts";
|
|
43
|
+
export { generateActionInput, generateActionOutput, normalizeDefinitions } from "./schema/action.ts";
|
|
44
|
+
export type { ActionSchemaOptions } from "./schema/action.ts";
|
|
45
|
+
export { generateModelSchemas } from "./schema/model.ts";
|
|
46
|
+
export type { ModelSchemaOptions, ModelSchemas } from "./schema/model.ts";
|
|
47
|
+
export { generateTopLevelSchemas, namespaceOf } from "./schema/project.ts";
|
|
48
|
+
export type { TopLevelSchemaOptions } from "./schema/project.ts";
|
|
49
|
+
export { findParametersNode, generateServiceSchema } from "./schema/service.ts";
|
|
50
|
+
export type { ServiceSchemaOptions } from "./schema/service.ts";
|
|
51
|
+
export { SchemaConversionError } from "./schema/types.ts";
|
|
52
|
+
export type { JSONSchema7 } from "./schema/types.ts";
|
|
53
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AACH,OAAO,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AACnD,YAAY,EAAE,gBAAgB,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAErE,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,QAAQ,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AACzG,YAAY,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAE5C,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAClD,YAAY,EAAE,eAAe,EAAE,IAAI,EAAE,SAAS,EAAE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,CAAC;AAC1F,OAAO,EAAE,mBAAmB,EAAE,oBAAoB,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AACrG,YAAY,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AAC9D,OAAO,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AACzD,YAAY,EAAE,kBAAkB,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAC1E,OAAO,EAAE,uBAAuB,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAC3E,YAAY,EAAE,qBAAqB,EAAE,MAAM,qBAAqB,CAAC;AACjE,OAAO,EAAE,kBAAkB,EAAE,qBAAqB,EAAE,MAAM,qBAAqB,CAAC;AAChF,YAAY,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAChE,OAAO,EAAE,qBAAqB,EAAE,MAAM,mBAAmB,CAAC;AAC1D,YAAY,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC"}
|
package/lib/index.js
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Webda's compile-time code generation, as a TypeScript 7.1 content mapper.
|
|
3
|
+
*
|
|
4
|
+
* TypeScript 7 removed custom emit transformers, `ts-patch` and language-service
|
|
5
|
+
* plugins. This package replaces them with the supported mechanism: a content
|
|
6
|
+
* mapper process that rewrites model and service sources into ordinary
|
|
7
|
+
* TypeScript before the compiler sees them, plus span maps so diagnostics,
|
|
8
|
+
* hover and rename still land on the authored text.
|
|
9
|
+
*
|
|
10
|
+
* Two hosts share one implementation of the transform:
|
|
11
|
+
*
|
|
12
|
+
* - {@link WarmSession} — used by the mapper process ({@link ./server.ts}) to
|
|
13
|
+
* serve the editor and `tsc`.
|
|
14
|
+
* - {@link runTwoPass} — used by `@webda/compiler` to type-check and emit.
|
|
15
|
+
*
|
|
16
|
+
* See `docs/contribute/TypeScript 7 Content Mappers.md` for the rationale.
|
|
17
|
+
*/
|
|
18
|
+
export { DEFAULT_COERCIONS } from "./coercions.js";
|
|
19
|
+
export { baseNames, classesOf, isStatic, memberName, openSession, textOf, triviaOf } from "./context.js";
|
|
20
|
+
export { applyEdits, mergePlan } from "./plan.js";
|
|
21
|
+
export { accessorsGenerator } from "./generators/accessors.js";
|
|
22
|
+
export { behaviorsGenerator, BEHAVIOR_PARENT_KEY } from "./generators/behaviors.js";
|
|
23
|
+
export { loadParametersGenerator } from "./generators/loadparameters.js";
|
|
24
|
+
export { qlValidatorGenerator, WQL_CODES } from "./generators/qlvalidator.js";
|
|
25
|
+
export { buildMappedText, SpanMapKind } from "./spans.js";
|
|
26
|
+
export { buildModelMetadata, buildRelations, discoverWebdaObjects, reflectAttributes } from "./module-discovery.js";
|
|
27
|
+
export { WarmSession } from "./session.js";
|
|
28
|
+
export { defaultGenerators } from "./defaults.js";
|
|
29
|
+
export { runTwoPass } from "./twopass.js";
|
|
30
|
+
export { SchemaConverter } from "./schema/converter.js";
|
|
31
|
+
export { generateActionInput, generateActionOutput, normalizeDefinitions } from "./schema/action.js";
|
|
32
|
+
export { generateModelSchemas } from "./schema/model.js";
|
|
33
|
+
export { generateTopLevelSchemas, namespaceOf } from "./schema/project.js";
|
|
34
|
+
export { findParametersNode, generateServiceSchema } from "./schema/service.js";
|
|
35
|
+
export { SchemaConversionError } from "./schema/types.js";
|
|
36
|
+
//# sourceMappingURL=index.js.map
|
package/lib/index.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AACH,OAAO,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAGnD,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,QAAQ,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAGzG,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;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