@memberjunction/codegen-lib 6.2.0-edge.2 → 6.2.0-edge.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.
Files changed (62) hide show
  1. package/README.md +13 -0
  2. package/dist/Angular/angular-codegen.d.ts +15 -0
  3. package/dist/Angular/angular-codegen.d.ts.map +1 -1
  4. package/dist/Angular/angular-codegen.js +57 -16
  5. package/dist/Angular/angular-codegen.js.map +1 -1
  6. package/dist/Config/config.d.ts +15 -24
  7. package/dist/Config/config.d.ts.map +1 -1
  8. package/dist/Config/config.js +2 -5
  9. package/dist/Config/config.js.map +1 -1
  10. package/dist/Config/integrity-check-schema.d.ts +22 -0
  11. package/dist/Config/integrity-check-schema.d.ts.map +1 -0
  12. package/dist/Config/integrity-check-schema.js +18 -0
  13. package/dist/Config/integrity-check-schema.js.map +1 -0
  14. package/dist/Database/json-check-validators.d.ts +98 -0
  15. package/dist/Database/json-check-validators.d.ts.map +1 -0
  16. package/dist/Database/json-check-validators.js +196 -0
  17. package/dist/Database/json-check-validators.js.map +1 -0
  18. package/dist/Database/manage-metadata.d.ts +121 -8
  19. package/dist/Database/manage-metadata.d.ts.map +1 -1
  20. package/dist/Database/manage-metadata.js +403 -59
  21. package/dist/Database/manage-metadata.js.map +1 -1
  22. package/dist/Manifest/GenerateClassRegistrationsManifest.d.ts.map +1 -1
  23. package/dist/Manifest/GenerateClassRegistrationsManifest.js +7 -4
  24. package/dist/Manifest/GenerateClassRegistrationsManifest.js.map +1 -1
  25. package/dist/Misc/advanced_generation.d.ts +42 -0
  26. package/dist/Misc/advanced_generation.d.ts.map +1 -1
  27. package/dist/Misc/advanced_generation.js +50 -0
  28. package/dist/Misc/advanced_generation.js.map +1 -1
  29. package/dist/Misc/entity_subclasses_codegen.d.ts +50 -0
  30. package/dist/Misc/entity_subclasses_codegen.d.ts.map +1 -1
  31. package/dist/Misc/entity_subclasses_codegen.js +185 -68
  32. package/dist/Misc/entity_subclasses_codegen.js.map +1 -1
  33. package/dist/Misc/graphql_server_codegen.d.ts.map +1 -1
  34. package/dist/Misc/graphql_server_codegen.js +3 -5
  35. package/dist/Misc/graphql_server_codegen.js.map +1 -1
  36. package/dist/Misc/json-type-model.d.ts +148 -0
  37. package/dist/Misc/json-type-model.d.ts.map +1 -0
  38. package/dist/Misc/json-type-model.js +421 -0
  39. package/dist/Misc/json-type-model.js.map +1 -0
  40. package/dist/Misc/json-type-rules.d.ts +90 -0
  41. package/dist/Misc/json-type-rules.d.ts.map +1 -0
  42. package/dist/Misc/json-type-rules.js +274 -0
  43. package/dist/Misc/json-type-rules.js.map +1 -0
  44. package/dist/Misc/json-type-zod.d.ts +41 -0
  45. package/dist/Misc/json-type-zod.d.ts.map +1 -0
  46. package/dist/Misc/json-type-zod.js +390 -0
  47. package/dist/Misc/json-type-zod.js.map +1 -0
  48. package/dist/Misc/runCommand.d.ts.map +1 -1
  49. package/dist/Misc/runCommand.js +13 -5
  50. package/dist/Misc/runCommand.js.map +1 -1
  51. package/dist/Misc/system_integrity.d.ts +27 -0
  52. package/dist/Misc/system_integrity.d.ts.map +1 -1
  53. package/dist/Misc/system_integrity.js +17 -0
  54. package/dist/Misc/system_integrity.js.map +1 -1
  55. package/dist/Misc/validator-text.d.ts +11 -0
  56. package/dist/Misc/validator-text.d.ts.map +1 -0
  57. package/dist/Misc/validator-text.js +15 -0
  58. package/dist/Misc/validator-text.js.map +1 -0
  59. package/dist/runCodeGen.d.ts.map +1 -1
  60. package/dist/runCodeGen.js +34 -13
  61. package/dist/runCodeGen.js.map +1 -1
  62. package/package.json +29 -29
@@ -0,0 +1,421 @@
1
+ /**
2
+ * @fileoverview Pure (no database, no MJ runtime) analysis of a JSONType definition.
3
+ *
4
+ * A JSONType field's `EntityField.JSONTypeDefinition` is TypeScript source declaring the interface(s)
5
+ * the JSON conforms to. CodeGen reads three things from it, all through the TypeScript AST:
6
+ *
7
+ * - **Opt-in.** A `@mjValidate` (optionally `@mjValidate warn`) JSDoc tag on the ROOT declaration —
8
+ * the one named by `EntityField.JSONType` — turns runtime validation on for the whole type.
9
+ * Decorators would be the natural spelling but are a parse error on interface members, and the
10
+ * existing definition validator would then silently demote the field to a plain string; JSDoc tags
11
+ * parse anywhere and are invisible to consumers of the interface.
12
+ * - **Rules.** Standard JSON-Schema-style tags (`@minimum`, `@maxLength`, …) feed the structural Zod
13
+ * schema ({@link GenerateJSONTypeZod}); `@CHECK` tags become behavioural rules
14
+ * ({@link CollectJSONCheckRules}).
15
+ * - **Rewriting.** Type names are prefixed with the owning entity's class name so two entities can
16
+ * declare the same JSONType name. {@link RewriteJSONTypeDefinition} does it via the AST so words
17
+ * inside JSDoc tag bodies are never touched.
18
+ *
19
+ * @module Misc/json-type-model
20
+ */
21
+ import * as crypto from 'crypto';
22
+ import ts from 'typescript';
23
+ /** Text of a tag's comment, tolerant of the several shapes the TypeScript API returns. */
24
+ function tagText(tag) {
25
+ return (ts.getTextOfJSDocComment(tag.comment) ?? '').trim();
26
+ }
27
+ /** Reads the JSDoc tags attached to a node (all JSDoc blocks, in order). */
28
+ export function ReadJSDocTags(node) {
29
+ return ts.getJSDocTags(node).map((tag) => ({ Name: tag.tagName.text, Text: tagText(tag) }));
30
+ }
31
+ /**
32
+ * Parses a JSONTypeDefinition and reads the opt-in from the root declaration.
33
+ *
34
+ * @param definition - raw TypeScript from `EntityField.JSONTypeDefinition`
35
+ * @param rootName - declared name of the type bound to the field
36
+ * @returns the model, or null when `rootName` is not declared as an interface / type alias
37
+ */
38
+ export function ParseJSONTypeDefinition(definition, rootName) {
39
+ const sourceFile = ts.createSourceFile('jsontype.ts', definition, ts.ScriptTarget.Latest, true, ts.ScriptKind.TS);
40
+ const declarations = new Map();
41
+ sourceFile.forEachChild((node) => {
42
+ if (ts.isInterfaceDeclaration(node) || ts.isTypeAliasDeclaration(node)) {
43
+ declarations.set(node.name.text, { Name: node.name.text, Node: node, Tags: ReadJSDocTags(node) });
44
+ }
45
+ });
46
+ const root = declarations.get(rootName);
47
+ if (!root) {
48
+ return null;
49
+ }
50
+ const optIn = root.Tags.find((t) => t.Name === 'mjValidate');
51
+ return {
52
+ SourceFile: sourceFile,
53
+ Declarations: declarations,
54
+ RootName: rootName,
55
+ OptedIn: optIn !== undefined,
56
+ Severity: optIn !== undefined && /^warn/i.test(optIn.Text) ? 'Warning' : 'Failure',
57
+ };
58
+ }
59
+ /** The properties of a declaration (interface members, or the literal of `type X = { ... }`), own only. */
60
+ export function GetOwnMembers(decl) {
61
+ const members = ts.isInterfaceDeclaration(decl.Node)
62
+ ? decl.Node.members
63
+ : ts.isTypeLiteralNode(decl.Node.type) ? decl.Node.type.members : [];
64
+ const result = [];
65
+ for (const member of members) {
66
+ if (ts.isPropertySignature(member) && member.type && (ts.isIdentifier(member.name) || ts.isStringLiteral(member.name))) {
67
+ result.push({
68
+ Name: member.name.text,
69
+ Optional: member.questionToken !== undefined,
70
+ TypeNode: member.type,
71
+ Tags: ReadJSDocTags(member),
72
+ });
73
+ }
74
+ }
75
+ return result;
76
+ }
77
+ /** Local declarations a declaration extends (`interface A extends B, C`), in order. Non-local bases are skipped. */
78
+ export function GetLocalBases(model, decl) {
79
+ if (!ts.isInterfaceDeclaration(decl.Node)) {
80
+ return [];
81
+ }
82
+ const bases = [];
83
+ for (const clause of decl.Node.heritageClauses ?? []) {
84
+ for (const expression of clause.types) {
85
+ if (ts.isIdentifier(expression.expression)) {
86
+ const base = model.Declarations.get(expression.expression.text);
87
+ if (base) {
88
+ bases.push(base);
89
+ }
90
+ }
91
+ }
92
+ }
93
+ return bases;
94
+ }
95
+ /** Every local ancestor (transitive) of a declaration, nearest first, without duplicates. */
96
+ export function GetAncestors(model, decl, seen = new Set()) {
97
+ const result = [];
98
+ for (const base of GetLocalBases(model, decl)) {
99
+ if (seen.has(base.Name)) {
100
+ continue;
101
+ }
102
+ seen.add(base.Name);
103
+ result.push(base, ...GetAncestors(model, base, seen));
104
+ }
105
+ return result;
106
+ }
107
+ /** Members of a declaration including those inherited from local bases (own members win). */
108
+ export function GetAllMembers(model, decl) {
109
+ const byName = new Map();
110
+ for (const ancestor of [...GetAncestors(model, decl)].reverse()) {
111
+ for (const member of GetOwnMembers(ancestor)) {
112
+ byName.set(member.Name, member);
113
+ }
114
+ }
115
+ for (const member of GetOwnMembers(decl)) {
116
+ byName.set(member.Name, member);
117
+ }
118
+ return [...byName.values()];
119
+ }
120
+ /** Tag names CodeGen reads; a comment carrying one of them that is attached to nothing is almost certainly a mistake. */
121
+ const RECOGNIZED_TAGS = ['mjValidate', 'CHECK', 'minimum', 'maximum', 'exclusiveMinimum', 'exclusiveMaximum', 'multipleOf', 'minLength', 'maxLength', 'pattern', 'minItems', 'maxItems', 'uniqueItems', 'format'];
122
+ /**
123
+ * JSDoc comments that carry a recognized tag but are attached to no declaration or member, so their
124
+ * tags are silently unread. TypeScript attaches a `/** *\/` comment to the node that follows it only
125
+ * when the comment starts on a line of its own (or follows a `;`/`,`); one written on the same line as
126
+ * the opening `{` belongs to that token instead. Returns a short excerpt of each such comment.
127
+ */
128
+ export function FindUnattachedTagComments(model) {
129
+ const attached = new Set();
130
+ const collect = (node) => {
131
+ const docs = node.jsDoc;
132
+ docs?.forEach((d) => attached.add(d.getStart(model.SourceFile)));
133
+ node.forEachChild(collect);
134
+ };
135
+ collect(model.SourceFile);
136
+ const orphans = [];
137
+ const pattern = /\/\*\*[\s\S]*?\*\//g;
138
+ let match;
139
+ while ((match = pattern.exec(model.SourceFile.text)) !== null) {
140
+ const carriesTag = RECOGNIZED_TAGS.some((t) => new RegExp(`@${t}\\b`).test(match[0]));
141
+ if (carriesTag && !attached.has(match.index)) {
142
+ orphans.push(match[0].replace(/\s+/g, ' ').slice(0, 80));
143
+ }
144
+ }
145
+ return orphans;
146
+ }
147
+ /**
148
+ * Names of the declarations reachable from the root through type references and `extends`,
149
+ * in declaration order. Unreachable declarations get no schema const: nothing would use it, and an
150
+ * unused module-level const fails a consumer's `noUnusedLocals`.
151
+ */
152
+ export function GetReachableDeclarations(model) {
153
+ const reachable = new Set();
154
+ const visit = (name) => {
155
+ if (reachable.has(name) || !model.Declarations.has(name)) {
156
+ return;
157
+ }
158
+ reachable.add(name);
159
+ const collect = (node) => {
160
+ if (ts.isTypeReferenceNode(node) && ts.isIdentifier(node.typeName)) {
161
+ visit(node.typeName.text);
162
+ }
163
+ else if (ts.isExpressionWithTypeArguments(node) && ts.isIdentifier(node.expression)) {
164
+ visit(node.expression.text);
165
+ }
166
+ node.forEachChild(collect);
167
+ };
168
+ collect(model.Declarations.get(name).Node);
169
+ };
170
+ visit(model.RootName);
171
+ return [...model.Declarations.values()].filter((d) => reachable.has(d.Name));
172
+ }
173
+ /* ------------------------------------------------------------------------------------------------
174
+ * Type-node helpers
175
+ * ---------------------------------------------------------------------------------------------- */
176
+ /** Strips parentheses and drops `null` / `undefined` union members. Returns the remaining node(s). */
177
+ export function StripNullish(node) {
178
+ const inner = ts.isParenthesizedTypeNode(node) ? node.type : node;
179
+ if (ts.isUnionTypeNode(inner)) {
180
+ return inner.types.flatMap((t) => StripNullish(t)).filter((t) => !IsNullishKeyword(t));
181
+ }
182
+ return IsNullishKeyword(inner) ? [] : [inner];
183
+ }
184
+ function IsNullishKeyword(node) {
185
+ if (node.kind === ts.SyntaxKind.UndefinedKeyword || node.kind === ts.SyntaxKind.NullKeyword) {
186
+ return true;
187
+ }
188
+ return ts.isLiteralTypeNode(node) && node.literal.kind === ts.SyntaxKind.NullKeyword;
189
+ }
190
+ /** True when a type node (ignoring null/undefined) is an array type; returns the element node too. */
191
+ export function GetArrayElementType(node) {
192
+ const parts = StripNullish(node);
193
+ if (parts.length !== 1) {
194
+ return null;
195
+ }
196
+ const part = parts[0];
197
+ if (ts.isArrayTypeNode(part)) {
198
+ return part.elementType;
199
+ }
200
+ if (ts.isTypeOperatorNode(part) && part.operator === ts.SyntaxKind.ReadonlyKeyword && ts.isArrayTypeNode(part.type)) {
201
+ return part.type.elementType;
202
+ }
203
+ if (ts.isTypeReferenceNode(part) && ts.isIdentifier(part.typeName)
204
+ && (part.typeName.text === 'Array' || part.typeName.text === 'ReadonlyArray') && part.typeArguments?.length === 1) {
205
+ return part.typeArguments[0];
206
+ }
207
+ return null;
208
+ }
209
+ /** Name of the single local declaration a type node refers to (through `| null`, `[]`, `Record<string, T>`), with its shape. */
210
+ export function ResolveLocalTarget(model, node) {
211
+ const element = GetArrayElementType(node);
212
+ if (element) {
213
+ const inner = ResolveLocalTarget(model, element);
214
+ return inner && inner.Shape === 'object' ? { Name: inner.Name, Shape: 'array' } : null;
215
+ }
216
+ const parts = StripNullish(node);
217
+ if (parts.length !== 1) {
218
+ return null;
219
+ }
220
+ const part = parts[0];
221
+ if (ts.isTypeReferenceNode(part) && ts.isIdentifier(part.typeName)) {
222
+ if (part.typeName.text === 'Record' && part.typeArguments?.length === 2) {
223
+ const inner = ResolveLocalTarget(model, part.typeArguments[1]);
224
+ return inner && inner.Shape === 'object' ? { Name: inner.Name, Shape: 'record' } : null;
225
+ }
226
+ if (!part.typeArguments && model.Declarations.has(part.typeName.text)) {
227
+ return { Name: part.typeName.text, Shape: 'object' };
228
+ }
229
+ }
230
+ return null;
231
+ }
232
+ /**
233
+ * Text of a type node with references to local declarations replaced by their prefixed names.
234
+ * Used wherever a type is spelled out in generated code (rule parameter types, `z.custom<T>()`).
235
+ */
236
+ export function PrefixedTypeText(model, node, prefix) {
237
+ const source = model.SourceFile.text;
238
+ const start = node.getStart(model.SourceFile);
239
+ // Every top-level declared name, not just `Declarations`: enums and classes are prefixed by
240
+ // RewriteJSONTypeDefinition too, so a reference to one must be spelled with the prefix here.
241
+ const declared = topLevelTypeNames(model.SourceFile);
242
+ const edits = [];
243
+ const visit = (n) => {
244
+ if (ts.isIdentifier(n) && declared.has(n.text) && isTypeNameReference(n)) {
245
+ edits.push({ Start: n.getStart(model.SourceFile), End: n.getEnd(), Text: `${prefix}_${n.text}` });
246
+ }
247
+ n.forEachChild(visit);
248
+ };
249
+ visit(node);
250
+ let text = source.slice(start, node.getEnd());
251
+ for (const edit of edits.sort((a, b) => b.Start - a.Start)) {
252
+ text = text.slice(0, edit.Start - start) + edit.Text + text.slice(edit.End - start);
253
+ }
254
+ return text;
255
+ }
256
+ function isTopLevelTypeDeclaration(node) {
257
+ return ts.isInterfaceDeclaration(node) || ts.isTypeAliasDeclaration(node) || ts.isEnumDeclaration(node) || ts.isClassDeclaration(node);
258
+ }
259
+ /** Names of the definition's top-level interfaces, type aliases, enums and classes — the names the prefix rewrite renames. */
260
+ function topLevelTypeNames(sourceFile) {
261
+ const declared = new Set();
262
+ sourceFile.forEachChild((node) => {
263
+ if (isTopLevelTypeDeclaration(node) && node.name) {
264
+ declared.add(node.name.text);
265
+ }
266
+ });
267
+ return declared;
268
+ }
269
+ /** True when the identifier names a type (a type reference, `extends`, `typeof`, or the left of `A.B`) rather than a member. */
270
+ function isTypeNameReference(id) {
271
+ const parent = id.parent;
272
+ return (ts.isTypeReferenceNode(parent) && parent.typeName === id)
273
+ || (ts.isExpressionWithTypeArguments(parent) && parent.expression === id)
274
+ || (ts.isTypeQueryNode(parent) && parent.exprName === id)
275
+ || (ts.isQualifiedName(parent) && parent.left === id);
276
+ }
277
+ /* ------------------------------------------------------------------------------------------------
278
+ * Prefix rewrite (AST based)
279
+ * ---------------------------------------------------------------------------------------------- */
280
+ /**
281
+ * Prefixes every top-level declared type name with `${prefix}_`, editing only identifiers — the
282
+ * declaration names and the places that refer to them (type references, `extends`, `typeof`). Text
283
+ * inside comments (JSDoc tag bodies, `@CHECK` expressions) and member names that merely coincide
284
+ * with a type name are left alone, unlike a `\b` regex over the whole text.
285
+ */
286
+ export function RewriteJSONTypeDefinition(definition, prefix) {
287
+ const sourceFile = ts.createSourceFile('jsontype-rewrite.ts', definition, ts.ScriptTarget.Latest, true, ts.ScriptKind.TS);
288
+ const declared = topLevelTypeNames(sourceFile);
289
+ const edits = [];
290
+ // Opted-in declarations are always exported: the generated, exported structural schema consts
291
+ // (`z.ZodType<Prefixed_X>`) name them, and an exported const may not use a private type name
292
+ // when the package emits declarations.
293
+ sourceFile.forEachChild((node) => {
294
+ const isDeclaration = isTopLevelTypeDeclaration(node);
295
+ const exported = ts.canHaveModifiers(node) && (ts.getModifiers(node) ?? []).some((m) => m.kind === ts.SyntaxKind.ExportKeyword);
296
+ if (isDeclaration && !exported) {
297
+ const start = node.getStart(sourceFile);
298
+ edits.push({ Start: start, End: start, Insert: 'export ' });
299
+ }
300
+ });
301
+ const isDeclarationName = (id) => {
302
+ const parent = id.parent;
303
+ return isTopLevelTypeDeclaration(parent) && parent.name === id;
304
+ };
305
+ const visit = (node) => {
306
+ if (ts.isIdentifier(node) && declared.has(node.text) && (isDeclarationName(node) || isTypeNameReference(node))) {
307
+ edits.push({ Start: node.getStart(sourceFile), End: node.getEnd() });
308
+ }
309
+ node.forEachChild(visit);
310
+ };
311
+ visit(sourceFile);
312
+ let text = definition;
313
+ for (const edit of edits.sort((a, b) => b.Start - a.Start)) {
314
+ const replacement = edit.Insert ?? `${prefix}_${text.slice(edit.Start, edit.End)}`;
315
+ text = `${text.slice(0, edit.Start)}${replacement}${text.slice(edit.End)}`;
316
+ }
317
+ return text;
318
+ }
319
+ /** Collapses runs of whitespace so re-flowing a tag does not look like an edit. */
320
+ export function NormalizeCheckText(text) {
321
+ return text.replace(/\s+/g, ' ').trim();
322
+ }
323
+ /**
324
+ * Cache key of a SQL `@CHECK`: JSONType name + path + normalized text + a hash of the SHAPE of the
325
+ * rule's `value` (its members' names, optionality and types). A type shared by several fields or
326
+ * entities translates once, and editing an unrelated member, a comment or whitespace does not
327
+ * regenerate; but two entities that declare a same-named type with different members do not share a
328
+ * translation compiled against the other's shape. A rule that reads `row.<Column>` also keys on the
329
+ * owning entity, whose columns it depends on.
330
+ */
331
+ export function BuildJSONCheckKey(model, rule, entityName) {
332
+ const shapeHash = crypto.createHash('sha256').update(JSONCheckValueShape(model, rule)).digest('hex').slice(0, 12);
333
+ const key = `${model.RootName}|${rule.Path}|${rule.NormalizedText}|${shapeHash}`;
334
+ return JSONCheckReadsRow(rule) ? `${key}|${entityName}` : key;
335
+ }
336
+ /** Canonical text of the members a rule's `value` has (or of its type, when it is not a local object type). */
337
+ export function JSONCheckValueShape(model, rule) {
338
+ const target = rule.ValueTypeNode ? ResolveLocalTarget(model, rule.ValueTypeNode)?.Name : rule.DeclarationName;
339
+ const decl = target ? model.Declarations.get(target) : undefined;
340
+ if (!decl) {
341
+ return NormalizeCheckText(rule.ValueTypeNode ? rule.ValueTypeNode.getText(model.SourceFile) : rule.DeclarationName);
342
+ }
343
+ return GetAllMembers(model, decl)
344
+ .map((m) => `${m.Name}${m.Optional ? '?' : ''}:${NormalizeCheckText(m.TypeNode.getText(model.SourceFile))}`)
345
+ .join(';');
346
+ }
347
+ /** True when a rule's text references the owning record (`row.<Column>`). */
348
+ export function JSONCheckReadsRow(rule) {
349
+ return /\brow\s*\./i.test(rule.NormalizedText);
350
+ }
351
+ function parseCheckTag(text) {
352
+ const trimmed = text.trim();
353
+ if (trimmed.length === 0) {
354
+ return null;
355
+ }
356
+ const tsMatch = /^ts\s*:\s*([\s\S]+)$/i.exec(trimmed);
357
+ if (tsMatch) {
358
+ return { Kind: 'ts', Expression: tsMatch[1].trim() };
359
+ }
360
+ return { Kind: 'sql', Expression: trimmed };
361
+ }
362
+ /**
363
+ * Collects every `@CHECK` tag reachable from the root, in a deterministic order (declaration order,
364
+ * interface-level tags before property-level tags).
365
+ *
366
+ * A tag on a base interface is inherited by every local interface that extends it, so the rule is
367
+ * attached (again) to each derived declaration — that is how the runtime type graph, which visits
368
+ * values by their declared type, finds it.
369
+ */
370
+ export function CollectJSONCheckRules(model) {
371
+ const rules = [];
372
+ for (const decl of model.Declarations.values()) {
373
+ const lineage = [decl, ...GetAncestors(model, decl)];
374
+ for (const source of lineage) {
375
+ addInterfaceRules(rules, decl, source);
376
+ }
377
+ for (const member of GetAllMembers(model, decl)) {
378
+ addPropertyRules(rules, decl, member);
379
+ }
380
+ }
381
+ return rules;
382
+ }
383
+ function addInterfaceRules(rules, target, source) {
384
+ for (const tag of source.Tags.filter((t) => t.Name === 'CHECK')) {
385
+ const parsed = parseCheckTag(tag.Text);
386
+ if (!parsed) {
387
+ continue;
388
+ }
389
+ // Path names the declaring type for SQL (cache key follows the text's home), the target for scope.
390
+ const normalized = NormalizeCheckText(parsed.Expression);
391
+ rules.push({
392
+ Kind: parsed.Kind,
393
+ Expression: parsed.Expression,
394
+ DeclarationName: target.Name,
395
+ PerElement: false,
396
+ ValueTypeNode: null,
397
+ NormalizedText: normalized,
398
+ Path: source.Name,
399
+ });
400
+ }
401
+ }
402
+ function addPropertyRules(rules, owner, member) {
403
+ for (const tag of member.Tags.filter((t) => t.Name === 'CHECK')) {
404
+ const parsed = parseCheckTag(tag.Text);
405
+ if (!parsed) {
406
+ continue;
407
+ }
408
+ const element = GetArrayElementType(member.TypeNode);
409
+ rules.push({
410
+ Kind: parsed.Kind,
411
+ Expression: parsed.Expression,
412
+ DeclarationName: owner.Name,
413
+ Property: member.Name,
414
+ PerElement: element !== null,
415
+ ValueTypeNode: element,
416
+ NormalizedText: NormalizeCheckText(parsed.Expression),
417
+ Path: `${owner.Name}.${member.Name}`,
418
+ });
419
+ }
420
+ }
421
+ //# sourceMappingURL=json-type-model.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"json-type-model.js","sourceRoot":"","sources":["../../src/Misc/json-type-model.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,KAAK,MAAM,MAAM,QAAQ,CAAC;AACjC,OAAO,EAAE,MAAM,YAAY,CAAC;AAsC5B,0FAA0F;AAC1F,SAAS,OAAO,CAAC,GAAgB;IAC7B,OAAO,CAAC,EAAE,CAAC,qBAAqB,CAAC,GAAG,CAAC,OAAO,CAAC,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC;AAChE,CAAC;AAED,4EAA4E;AAC5E,MAAM,UAAU,aAAa,CAAC,IAAa;IACvC,OAAO,EAAE,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AC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,OAAO,CAAC,EAAE,CAAC;QAC9D,MAAM,MAAM,GAAG,aAAa,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;QACvC,IAAI,CAAC,MAAM,EAAE,CAAC;YACV,SAAS;QACb,CAAC;QACD,MAAM,OAAO,GAAG,mBAAmB,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;QACrD,KAAK,CAAC,IAAI,CAAC;YACP,IAAI,EAAE,MAAM,CAAC,IAAI;YACjB,UAAU,EAAE,MAAM,CAAC,UAAU;YAC7B,eAAe,EAAE,KAAK,CAAC,IAAI;YAC3B,QAAQ,EAAE,MAAM,CAAC,IAAI;YACrB,UAAU,EAAE,OAAO,KAAK,IAAI;YAC5B,aAAa,EAAE,OAAO;YACtB,cAAc,EAAE,kBAAkB,CAAC,MAAM,CAAC,UAAU,CAAC;YACrD,IAAI,EAAE,GAAG,KAAK,CAAC,IAAI,IAAI,MAAM,CAAC,IAAI,EAAE;SACvC,CAAC,CAAC;IACP,CAAC;AACL,CAAC"}
@@ -0,0 +1,90 @@
1
+ /**
2
+ * @fileoverview Turns the `@CHECK` tags of an opted-in JSONType into the runtime rule set emitted
3
+ * into a generated entity's `Validate()`, and compile-checks rule code before it is allowed there.
4
+ *
5
+ * Two kinds of rule exist:
6
+ *
7
+ * - `@CHECK ts:(<expression>)` — a TypeScript boolean expression, used directly; no model involved.
8
+ * - `@CHECK (<SQL>)` — translated to TypeScript by an LLM exactly like a table CHECK constraint, then
9
+ * cached in `__mj.GeneratedCode`. This module never calls the model; it consumes results the
10
+ * caller looked up by {@link BuildJSONCheckKey}.
11
+ *
12
+ * Rule code is emitted only after the TypeScript compiler API has accepted it. A rule that fails is
13
+ * skipped with an error — CodeGen never writes code that would break the generated package's build.
14
+ *
15
+ * @module Misc/json-type-rules
16
+ */
17
+ import { JSONCheckRule, JSONTypeModel } from './json-type-model.js';
18
+ /** A cached / freshly generated translation of a SQL `@CHECK`, as this module needs it. */
19
+ export interface JSONCheckTranslation {
20
+ /** Plain-language statement of the rule; becomes the validation message. */
21
+ Description: string;
22
+ /** Function BODY taking `value` and `row` that returns true when the value is VALID. */
23
+ Body: string;
24
+ }
25
+ /** Everything {@link BuildJSONRuleSet} decided. */
26
+ export interface JSONRuleSetResult {
27
+ /** Object-literal source for `ValidateJSONField`'s `rules` argument; null when there are no emit-able rules. */
28
+ Source: string | null;
29
+ /** SQL rules that need a translation which was not supplied (skipped). */
30
+ Missing: JSONCheckRule[];
31
+ /** Human-readable problems (rules skipped because their code did not parse, …). */
32
+ Errors: string[];
33
+ /** SQL rules present in the type, in emission order — what a generator must supply translations for. */
34
+ SqlRules: JSONCheckRule[];
35
+ }
36
+ /** Syntax check of `return (<expression>);` inside a function; returns null when fine, else the first diagnostic. */
37
+ export declare function CheckTSExpressionSyntax(expression: string): string | null;
38
+ /**
39
+ * Compile-checks LLM-produced rule code: it must parse, contain a `return`, avoid `${` (generated
40
+ * code can travel through Flyway migrations, which read `${...}` as a placeholder), and — with the
41
+ * definition's own types in scope — type-check against `value`.
42
+ *
43
+ * `row` is typed as an open record here because the code is generated once per JSONType, not per
44
+ * owning entity; the emitted code is checked against the real entity class when the package builds.
45
+ *
46
+ * @param definition - the JSONTypeDefinition source (original, un-prefixed names)
47
+ * @param valueTypeText - the TypeScript type of `value` (original names)
48
+ * @param body - the function body under test
49
+ * @returns null when acceptable, otherwise the reason it was rejected
50
+ */
51
+ export declare function CompileCheckJSONRuleBody(definition: string, valueTypeText: string, body: string): string | null;
52
+ /** One self-check the model supplies with a translated SQL `@CHECK`: an input and the verdict it must get. */
53
+ export interface JSONRuleTestCase {
54
+ /** The `value` argument (JSON). */
55
+ Value: unknown;
56
+ /** The `row` argument (JSON); omitted means an empty record. */
57
+ Row?: unknown;
58
+ /** True when the rule must accept this input. */
59
+ Expected: boolean;
60
+ }
61
+ /**
62
+ * Executes a translated rule body against the model's own test cases, in a separate `vm` context
63
+ * with no host globals and a time limit (microtasks included). `vm` is NOT a security boundary — the
64
+ * same body is emitted into the generated entity class and runs in-process there anyway, so this
65
+ * guards correctness, not trust. This is a self-consistency guard, not proof of equivalence with
66
+ * the SQL: it catches a body that does not do what its own author says it does — most usefully
67
+ * the NULL-passes rule, because `requireAbsentCase` demands at least one case in which an
68
+ * optional/nullable member is absent or null.
69
+ *
70
+ * @param body - the function body (TypeScript)
71
+ * @param cases - test cases returned with the translation
72
+ * @param requireAbsentCase - true when the value type has optional/nullable members
73
+ * @param optionalMembers - names of those members, to recognise an "absent" case
74
+ * @returns null when every case passes, otherwise the reason the translation must be rejected
75
+ */
76
+ export declare function RunJSONRuleTestCases(body: string, cases: ReadonlyArray<JSONRuleTestCase> | undefined, requireAbsentCase: boolean, optionalMembers: ReadonlyArray<string>): string | null;
77
+ /** Original-name text of the type a rule's `value` parameter has. */
78
+ export declare function RuleValueTypeText(model: JSONTypeModel, rule: JSONCheckRule): string;
79
+ /**
80
+ * Builds the `rules` argument of `ValidateJSONField` for an opted-in JSONType.
81
+ *
82
+ * @param model - the parsed definition
83
+ * @param prefix - the entity-prefixed name stem (`<EntityClass>Entity`), giving `${prefix}_${Type}` type names
84
+ * @param entityClassName - the owning entity class, the type of `row`
85
+ * @param isArray - true when the field holds an array of the root type
86
+ * @param translations - SQL check key → translation, for the SQL rules that have one
87
+ * @param entityName - the owning entity's name (part of the key of a rule that reads `row.`)
88
+ */
89
+ export declare function BuildJSONRuleSet(model: JSONTypeModel, prefix: string, entityClassName: string, isArray: boolean, translations: ReadonlyMap<string, JSONCheckTranslation>, entityName: string): JSONRuleSetResult;
90
+ //# sourceMappingURL=json-type-rules.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"json-type-rules.d.ts","sourceRoot":"","sources":["../../src/Misc/json-type-rules.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAKH,OAAO,EAIH,aAAa,EACb,aAAa,EAGhB,MAAM,mBAAmB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