@tellaro/tql 0.1.17 → 0.2.0

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.
@@ -1,5 +1,4 @@
1
1
  import { ComplexityMetrics, ComplexityResult, ComplexityThresholds, ComplexityWarning } from './types';
2
-
3
2
  export declare class ComplexityAnalyzer {
4
3
  private thresholds;
5
4
  constructor(thresholds?: ComplexityThresholds);
@@ -1,29 +1,26 @@
1
- var d = Object.defineProperty;
2
- var p = (i, e, t) => e in i ? d(i, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : i[e] = t;
3
- var h = (i, e, t) => p(i, typeof e != "symbol" ? e + "" : e, t);
4
- import { parseTql as g } from "./parser.js";
5
- const c = {
1
+ import { parseTql as u } from "./parser.js";
2
+ const d = {
6
3
  maxDepth: 5,
7
4
  maxRegex: 3,
8
5
  maxInListSize: 100,
9
6
  maxOrChainLength: 10,
10
7
  maxLeadingWildcards: 2
11
- }, u = /* @__PURE__ */ new Set([
8
+ }, h = /* @__PURE__ */ new Set([
12
9
  "geoip_lookup",
13
10
  "geoip",
14
11
  "geo",
15
12
  "nslookup"
16
- ]), y = /\*/g, f = /^\*/;
17
- class x {
13
+ ]), p = /\*/g, g = /^\*/;
14
+ class c {
15
+ thresholds;
18
16
  constructor(e) {
19
- h(this, "thresholds");
20
- this.thresholds = { ...c, ...e };
17
+ this.thresholds = { ...d, ...e };
21
18
  }
22
19
  /**
23
20
  * Analyze a TQL query for complexity
24
21
  */
25
22
  analyze(e) {
26
- const t = g(e), a = {
23
+ const t = u(e), a = {
27
24
  depth: 0,
28
25
  operatorCount: 0,
29
26
  wildcardCount: 0,
@@ -72,8 +69,8 @@ class x {
72
69
  }
73
70
  analyzeUnaryExpression(e, t, a, n, s) {
74
71
  t.operatorCount++;
75
- const o = e.operator === "NOT" ? s + 1 : s;
76
- this.analyzeExpression(e.operand, t, a, n + 1, o);
72
+ const i = e.operator === "NOT" ? s + 1 : s;
73
+ this.analyzeExpression(e.operand, t, a, n + 1, i);
77
74
  }
78
75
  analyzeGroupExpression(e, t, a, n, s) {
79
76
  this.analyzeExpression(e.expression, t, a, n + 1, s);
@@ -82,7 +79,7 @@ class x {
82
79
  t.operatorCount++;
83
80
  const n = e.field;
84
81
  if (n.type === "mutator")
85
- t.mutatorCount++, u.has(n.mutator) && (t.postProcessingMutatorCount++, a.push({
82
+ t.mutatorCount++, h.has(n.mutator) && (t.postProcessingMutatorCount++, a.push({
86
83
  type: "post_processing_mutator",
87
84
  message: `Mutator '${n.mutator}' requires post-processing and may be slow`,
88
85
  severity: "warning",
@@ -90,28 +87,28 @@ class x {
90
87
  }));
91
88
  else if (n.type === "field" && n.mutators) {
92
89
  t.mutatorCount += n.mutators.length;
93
- for (const o of n.mutators)
94
- u.has(o) && (t.postProcessingMutatorCount++, a.push({
90
+ for (const i of n.mutators)
91
+ h.has(i) && (t.postProcessingMutatorCount++, a.push({
95
92
  type: "post_processing_mutator",
96
- message: `Mutator '${o}' requires post-processing and may be slow`,
93
+ message: `Mutator '${i}' requires post-processing and may be slow`,
97
94
  severity: "warning",
98
95
  location: { start: n.start, end: n.end }
99
96
  }));
100
97
  }
101
98
  const s = e.operator.toLowerCase();
102
99
  if ((s === "regexp" || s === "regex" || s === "matches" || s === "not_regexp" || s === "not_matches") && t.regexCount++, this.analyzeValue(e.value, t, a, e), (s === "in" || s === "not_in") && Array.isArray(e.value)) {
103
- const o = e.value.length;
104
- t.inListMaxSize = Math.max(t.inListMaxSize, o);
100
+ const i = e.value.length;
101
+ t.inListMaxSize = Math.max(t.inListMaxSize, i);
105
102
  }
106
103
  }
107
104
  analyzeValue(e, t, a, n) {
108
105
  const s = Array.isArray(e) ? e : [e];
109
- for (const o of s)
110
- if (o.valueType === "string" && typeof o.value == "string") {
111
- const l = o.value.match(y);
112
- l && (t.wildcardCount += l.length, f.test(o.value) && (t.leadingWildcardCount++, t.leadingWildcardCount <= this.thresholds.maxLeadingWildcards && a.push({
106
+ for (const i of s)
107
+ if (i.valueType === "string" && typeof i.value == "string") {
108
+ const l = i.value.match(p);
109
+ l && (t.wildcardCount += l.length, g.test(i.value) && (t.leadingWildcardCount++, t.leadingWildcardCount <= this.thresholds.maxLeadingWildcards && a.push({
113
110
  type: "leading_wildcard",
114
- message: `Leading wildcard in '${o.value}' is expensive - consider using 'endswith' if possible`,
111
+ message: `Leading wildcard in '${i.value}' is expensive - consider using 'endswith' if possible`,
115
112
  severity: "warning",
116
113
  location: { start: n.start, end: n.end }
117
114
  })));
@@ -188,22 +185,22 @@ class x {
188
185
  return a += n * 2, a >= 4 ? "high" : a >= 2 ? "medium" : "low";
189
186
  }
190
187
  }
191
- function r(i, e) {
192
- return new x(e).analyze(i);
188
+ function r(o, e) {
189
+ return new c(e).analyze(o);
193
190
  }
194
- function L(i, e) {
195
- return r(i, e).score === "high";
191
+ function f(o, e) {
192
+ return r(o, e).score === "high";
196
193
  }
197
- function z(i, e) {
198
- return r(i, e).warnings;
194
+ function x(o, e) {
195
+ return r(o, e).warnings;
199
196
  }
200
- function _(i) {
201
- return r(i).metrics;
197
+ function C(o) {
198
+ return r(o).metrics;
202
199
  }
203
200
  export {
204
- x as ComplexityAnalyzer,
201
+ c as ComplexityAnalyzer,
205
202
  r as analyzeComplexity,
206
- _ as getComplexityMetrics,
207
- z as getComplexityWarnings,
208
- L as isHighComplexity
203
+ C as getComplexityMetrics,
204
+ x as getComplexityWarnings,
205
+ f as isHighComplexity
209
206
  };
@@ -1,5 +1,4 @@
1
1
  import { TqlParseError, TqlParseResult } from './types';
2
-
3
2
  export declare class TqlParser {
4
3
  private tokens;
5
4
  private allTokens;
@@ -1,19 +1,15 @@
1
- var c = Object.defineProperty;
2
- var d = (r, e, t) => e in r ? c(r, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : r[e] = t;
3
- var o = (r, e, t) => d(r, typeof e != "symbol" ? e + "" : e, t);
4
- import { tokenizeTql as p, COMPARISON_OPERATORS as v, ENRICHMENT_MUTATORS as ENRICHMENT_MUTATORS, MUTATORS as ALL_MUTATORS } from "./tokenizer.js";
5
- import { suggestOperator as suggestOp, suggestMutator as suggestMut } from "./validator.js";
6
- const f = 50, k = /* @__PURE__ */ new Set(["logicalOp", "paren"]);
7
- class y {
1
+ import { tokenizeTql as u, COMPARISON_OPERATORS as c } from "./tokenizer.js";
2
+ const d = 50, p = /* @__PURE__ */ new Set(["logicalOp", "paren"]);
3
+ class v {
4
+ tokens;
5
+ allTokens;
6
+ // Including whitespace for highlighting
7
+ current;
8
+ errors;
9
+ warnings;
10
+ depth;
8
11
  constructor(e) {
9
- o(this, "tokens");
10
- o(this, "allTokens");
11
- // Including whitespace for highlighting
12
- o(this, "current");
13
- o(this, "errors");
14
- o(this, "warnings");
15
- o(this, "depth");
16
- this.allTokens = p(e), this.tokens = this.allTokens.filter((t) => t.type !== "whitespace"), this.current = 0, this.errors = [], this.warnings = [], this.depth = 0;
12
+ this.allTokens = u(e), this.tokens = this.allTokens.filter((t) => t.type !== "whitespace"), this.current = 0, this.errors = [], this.warnings = [], this.depth = 0;
17
13
  }
18
14
  /**
19
15
  * Parse the input and return the result
@@ -62,7 +58,7 @@ class y {
62
58
  * Parse a full expression (lowest precedence)
63
59
  */
64
60
  parseExpression() {
65
- if (this.depth++, this.depth > f)
61
+ if (this.depth++, this.depth > d)
66
62
  throw new Error("Maximum query depth exceeded");
67
63
  try {
68
64
  return this.parseOr();
@@ -84,14 +80,14 @@ class y {
84
80
  "MISSING_OPERAND",
85
81
  "Add a condition after 'OR'"
86
82
  ), e;
87
- const n = this.parseAnd();
83
+ const r = this.parseAnd();
88
84
  e = {
89
85
  type: "binary",
90
86
  operator: "OR",
91
87
  left: e,
92
- right: n,
88
+ right: r,
93
89
  start: e.start,
94
- end: n.end
90
+ end: r.end
95
91
  };
96
92
  }
97
93
  return e;
@@ -110,14 +106,14 @@ class y {
110
106
  "MISSING_OPERAND",
111
107
  "Add a condition after 'AND'"
112
108
  ), e;
113
- const n = this.parseUnary();
109
+ const r = this.parseUnary();
114
110
  e = {
115
111
  type: "binary",
116
112
  operator: "AND",
117
113
  left: e,
118
- right: n,
114
+ right: r,
119
115
  start: e.start,
120
- end: n.end
116
+ end: r.end
121
117
  };
122
118
  }
123
119
  return e;
@@ -198,16 +194,14 @@ class y {
198
194
  "Valid types: string, int, float, date, bool, array"
199
195
  );
200
196
  }
201
- const n = [];
197
+ const r = [];
202
198
  for (; this.check("pipe"); )
203
199
  if (this.advance(), this.check("mutator")) {
204
200
  const s = this.advance();
205
- n.push(s.value.toLowerCase());
201
+ r.push(s.value.toLowerCase());
206
202
  } else if (this.check("field")) {
207
203
  const s = this.advance();
208
- n.push(s.value.toLowerCase());
209
- const suggestion = suggestMut(s.value);
210
- this.addWarning(`Unknown mutator '${s.value}'`, s, suggestion ? `Did you mean: ${suggestion}?` : "Valid mutators: lowercase, uppercase, trim, geo, nslookup, etc.");
204
+ r.push(s.value.toLowerCase()), this.addWarning(`Unknown mutator '${s.value}'`, s, "Check the mutator name spelling");
211
205
  } else {
212
206
  const s = this.isAtEnd() ? this.previous() : this.peek();
213
207
  this.addError(
@@ -218,30 +212,14 @@ class y {
218
212
  );
219
213
  break;
220
214
  }
221
- if (n.length > 0 && (t = {
215
+ if (r.length > 0 && (t = {
222
216
  ...t,
223
- mutators: n,
217
+ mutators: r,
224
218
  end: this.previous().end
225
219
  }), !this.check("operator")) {
226
- // Check if the last mutator is an enrichment mutator (geo, nslookup, etc.)
227
- // Enrichment mutators don't require an operator - they transform the field into enriched data
228
- const lastMutator = n.length > 0 ? n[n.length - 1] : null;
229
- const isEnrichmentMutator = lastMutator && ENRICHMENT_MUTATORS.includes(lastMutator);
230
-
231
- if (isEnrichmentMutator) {
232
- // Return a valid enrichment expression without error
233
- return {
234
- type: "enrichment",
235
- field: t,
236
- mutator: lastMutator,
237
- start: t.start,
238
- end: t.end
239
- };
240
- }
241
-
242
- const s = this.isAtEnd() ? this.previous() : this.peek(), h = n.length > 0 ? `'${e.value}' with mutator` : `'${e.value}'`;
220
+ const s = this.isAtEnd() ? this.previous() : this.peek(), o = r.length > 0 ? `'${e.value}' with mutator` : `'${e.value}'`;
243
221
  return this.addError(
244
- `Expected operator after field ${h}`,
222
+ `Expected operator after field ${o}`,
245
223
  s,
246
224
  "MISSING_OPERATOR",
247
225
  "Add an operator like 'eq', 'contains', '==', etc."
@@ -260,35 +238,28 @@ class y {
260
238
  end: t.end
261
239
  };
262
240
  }
263
- const i = this.advance();
264
- let a = this.normalizeOperator(i.value);
265
- // Handle unknown operator with suggestions
266
- if (typeof a === 'object' && a.unknown) {
267
- const suggestionMsg = a.suggestion ? `Did you mean: ${a.suggestion}?` : "Valid operators: eq, ne, contains, startswith, gt, lt, etc.";
268
- this.addWarning(`Unknown operator '${a.value}'`, i, suggestionMsg);
269
- a = a.value; // Use the original value
270
- }
271
- if (a === "exists" || a === "not_exists")
241
+ const a = this.advance(), n = this.normalizeOperator(a.value);
242
+ if (n === "exists" || n === "not_exists")
272
243
  return {
273
244
  type: "comparison",
274
245
  field: t,
275
- operator: a,
246
+ operator: n,
276
247
  value: {
277
248
  type: "literal",
278
249
  valueType: "boolean",
279
250
  value: !0,
280
- start: i.end,
281
- end: i.end
251
+ start: a.end,
252
+ end: a.end
282
253
  },
283
254
  start: t.start,
284
- end: i.end
255
+ end: a.end
285
256
  };
286
- if ((a === "is" || a === "is_not") && this.check("null")) {
257
+ if ((n === "is" || n === "is_not") && this.check("null")) {
287
258
  const s = this.advance();
288
259
  return {
289
260
  type: "comparison",
290
261
  field: t,
291
- operator: a,
262
+ operator: n,
292
263
  value: {
293
264
  type: "literal",
294
265
  valueType: "null",
@@ -300,18 +271,18 @@ class y {
300
271
  end: s.end
301
272
  };
302
273
  }
303
- if (a === "in" || a === "not_in") {
274
+ if (n === "in" || n === "not_in") {
304
275
  const s = this.parseValueList();
305
276
  return {
306
277
  type: "comparison",
307
278
  field: t,
308
- operator: a,
279
+ operator: n,
309
280
  value: s,
310
281
  start: t.start,
311
282
  end: this.previous().end
312
283
  };
313
284
  }
314
- if (a === "between" || a === "not_between") {
285
+ if (n === "between" || n === "not_between") {
315
286
  const s = this.parseValue();
316
287
  this.matchLogical("AND") || this.addError(
317
288
  "Expected 'AND' between values in 'between' operator",
@@ -319,44 +290,44 @@ class y {
319
290
  "INVALID_SYNTAX",
320
291
  "Use format: field between value1 AND value2"
321
292
  );
322
- const h = this.parseValue();
293
+ const o = this.parseValue();
323
294
  return {
324
295
  type: "comparison",
325
296
  field: t,
326
- operator: a,
327
- value: [s, h],
297
+ operator: n,
298
+ value: [s, o],
328
299
  start: t.start,
329
- end: h.end
300
+ end: o.end
330
301
  };
331
302
  }
332
303
  if (this.isAtEnd())
333
304
  return this.addError(
334
- `Expected a value after operator '${a}'`,
335
- i,
305
+ `Expected a value after operator '${n}'`,
306
+ a,
336
307
  "MISSING_VALUE",
337
308
  'Add a value like "text", 123, or true'
338
309
  ), {
339
310
  type: "comparison",
340
311
  field: t,
341
- operator: a,
312
+ operator: n,
342
313
  value: {
343
314
  type: "literal",
344
315
  valueType: "string",
345
316
  value: "",
346
- start: i.end,
347
- end: i.end
317
+ start: a.end,
318
+ end: a.end
348
319
  },
349
320
  start: t.start,
350
- end: i.end
321
+ end: a.end
351
322
  };
352
- const l = this.parseValue();
323
+ const h = this.parseValue();
353
324
  return {
354
325
  type: "comparison",
355
326
  field: t,
356
- operator: a,
357
- value: l,
327
+ operator: n,
328
+ value: h,
358
329
  start: t.start,
359
- end: l.end
330
+ end: h.end
360
331
  };
361
332
  }
362
333
  /**
@@ -447,7 +418,7 @@ class y {
447
418
  };
448
419
  }
449
420
  normalizeOperator(e) {
450
- const t = e.toLowerCase(), n = {
421
+ const t = e.toLowerCase(), r = {
451
422
  "==": "eq",
452
423
  "=": "eq",
453
424
  "!=": "ne",
@@ -456,9 +427,9 @@ class y {
456
427
  "<": "lt",
457
428
  "<=": "lte"
458
429
  };
459
- if (e in n)
460
- return n[e];
461
- const i = {
430
+ if (e in r)
431
+ return r[e];
432
+ const a = {
462
433
  "!in": "not_in",
463
434
  "!contains": "not_contains",
464
435
  "!startswith": "not_startswith",
@@ -473,22 +444,14 @@ class y {
473
444
  "!all": "not_all",
474
445
  "!none": "not_none"
475
446
  };
476
- if (t in i)
477
- return i[t];
478
- const a = {
447
+ if (t in a)
448
+ return a[t];
449
+ const n = {
479
450
  regex: "regexp",
480
451
  starts_with: "startswith",
481
452
  ends_with: "endswith"
482
453
  };
483
- if (t in a) return a[t];
484
- // Check if this is a valid operator, if not add a warning with suggestions
485
- if (!v.includes(t)) {
486
- const suggestion = suggestOp(t);
487
- // Return the original value but note that it might be invalid
488
- // The warning will be added by the caller if needed
489
- return { value: t, unknown: true, suggestion };
490
- }
491
- return t;
454
+ return t in n ? n[t] : (c.includes(t), t);
492
455
  }
493
456
  isAtEnd() {
494
457
  return this.current >= this.tokens.length;
@@ -514,7 +477,7 @@ class y {
514
477
  matchLogical(e) {
515
478
  return this.check("logicalOp") && this.peek().value.toUpperCase() === e ? (this.advance(), !0) : !1;
516
479
  }
517
- addError(e, t, n, i) {
480
+ addError(e, t, r, a) {
518
481
  this.errors.push({
519
482
  message: e,
520
483
  start: t.start,
@@ -522,11 +485,11 @@ class y {
522
485
  line: t.line,
523
486
  column: t.column,
524
487
  severity: "error",
525
- code: n,
526
- suggestion: i
488
+ code: r,
489
+ suggestion: a
527
490
  });
528
491
  }
529
- addWarning(e, t, n) {
492
+ addWarning(e, t, r) {
530
493
  this.warnings.push({
531
494
  message: e,
532
495
  start: t.start,
@@ -535,7 +498,7 @@ class y {
535
498
  column: t.column,
536
499
  severity: "warning",
537
500
  code: "TYPE_MISMATCH",
538
- suggestion: n
501
+ suggestion: r
539
502
  });
540
503
  }
541
504
  /**
@@ -544,7 +507,7 @@ class y {
544
507
  */
545
508
  synchronize() {
546
509
  for (this.advance(); !this.isAtEnd(); ) {
547
- if (k.has(this.peek().type) || this.peek().type === "paren" && this.peek().value === ")")
510
+ if (p.has(this.peek().type) || this.peek().type === "paren" && this.peek().value === ")")
548
511
  return;
549
512
  this.advance();
550
513
  }
@@ -576,23 +539,23 @@ class y {
576
539
  };
577
540
  }
578
541
  }
579
- function u(r) {
580
- return new y(r).parse();
542
+ function l(i) {
543
+ return new v(i).parse();
581
544
  }
582
- function g(r) {
583
- return u(r).success;
545
+ function k(i) {
546
+ return l(i).success;
584
547
  }
585
- function A(r) {
586
- return u(r).errors;
548
+ function y(i) {
549
+ return l(i).errors;
587
550
  }
588
- function T(r) {
589
- let e = `Error at line ${r.line}, column ${r.column}: ${r.message}`;
590
- return r.suggestion && (e += ` (${r.suggestion})`), e;
551
+ function E(i) {
552
+ let e = `Error at line ${i.line}, column ${i.column}: ${i.message}`;
553
+ return i.suggestion && (e += ` (${i.suggestion})`), e;
591
554
  }
592
555
  export {
593
- y as TqlParser,
594
- T as formatParseError,
595
- A as getTqlErrors,
596
- g as isValidTql,
597
- u as parseTql
556
+ v as TqlParser,
557
+ E as formatParseError,
558
+ y as getTqlErrors,
559
+ k as isValidTql,
560
+ l as parseTql
598
561
  };
@@ -1,5 +1,4 @@
1
1
  import { TqlFieldSchema, TqlFieldType } from './types';
2
-
3
2
  /**
4
3
  * Cached schema data with O(1) lookups
5
4
  */
@@ -1,10 +1,5 @@
1
- var f = Object.defineProperty;
2
- var m = (s, e, t) => e in s ? f(s, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : s[e] = t;
3
- var d = (s, e, t) => m(s, typeof e != "symbol" ? e + "" : e, t);
4
- class p {
5
- constructor() {
6
- d(this, "cache", null);
7
- }
1
+ class d {
2
+ cache = null;
8
3
  /**
9
4
  * Get cached schema data, rebuilding if schema has changed.
10
5
  * Returns null if no schema provided.
@@ -31,33 +26,31 @@ class p {
31
26
  * Get field by name with O(1) lookup
32
27
  */
33
28
  getField(e, t) {
34
- const n = this.get(e);
35
- return n == null ? void 0 : n.fieldMap.get(t);
29
+ return this.get(e)?.fieldMap.get(t);
36
30
  }
37
31
  /**
38
32
  * Get field type by name with O(1) lookup
39
33
  */
40
34
  getFieldType(e, t) {
41
- const n = this.get(e);
42
- return n == null ? void 0 : n.typeMap.get(t);
35
+ return this.get(e)?.typeMap.get(t);
43
36
  }
44
37
  /**
45
38
  * Build the cache from a schema
46
39
  */
47
40
  buildCache(e, t) {
48
- const n = /* @__PURE__ */ new Map(), h = /* @__PURE__ */ new Map(), i = [], c = (a, o) => {
49
- const r = o ? `${o}.${a.name}` : a.name;
50
- if (n.set(r, a), h.set(r, a.type), i.push(r), a.nested)
51
- for (const g of a.nested)
52
- c(g, r);
41
+ const a = /* @__PURE__ */ new Map(), i = /* @__PURE__ */ new Map(), n = [], h = (c, o) => {
42
+ const r = o ? `${o}.${c.name}` : c.name;
43
+ if (a.set(r, c), i.set(r, c.type), n.push(r), c.nested)
44
+ for (const p of c.nested)
45
+ h(p, r);
53
46
  };
54
- for (const a of e)
55
- c(a);
47
+ for (const c of e)
48
+ h(c);
56
49
  return {
57
50
  fields: e,
58
- fieldMap: n,
59
- typeMap: h,
60
- allFieldNames: i,
51
+ fieldMap: a,
52
+ typeMap: i,
53
+ allFieldNames: n,
61
54
  hash: t,
62
55
  timestamp: Date.now()
63
56
  };
@@ -67,38 +60,37 @@ class p {
67
60
  * Uses a simple string-based hash for performance.
68
61
  */
69
62
  computeHash(e) {
70
- const t = (i) => i.map((c) => {
71
- let a = `${c.name}:${c.type}`;
72
- return c.nested && (a += `[${t(c.nested)}]`), a;
73
- }).join(","), n = t(e);
74
- let h = 5381;
75
- for (let i = 0; i < n.length; i++)
76
- h = h * 33 ^ n.charCodeAt(i);
77
- return (h >>> 0).toString(36);
63
+ const t = (n) => n.map((h) => {
64
+ let c = `${h.name}:${h.type}`;
65
+ return h.nested && (c += `[${t(h.nested)}]`), c;
66
+ }).join(","), a = t(e);
67
+ let i = 5381;
68
+ for (let n = 0; n < a.length; n++)
69
+ i = i * 33 ^ a.charCodeAt(n);
70
+ return (i >>> 0).toString(36);
78
71
  }
79
72
  }
80
73
  let l = null;
81
74
  function u() {
82
- return l || (l = new p()), l;
75
+ return l || (l = new d()), l;
83
76
  }
84
- function C() {
85
- return new p();
77
+ function g() {
78
+ return new d();
86
79
  }
87
- function y(s) {
88
- const e = u().get(s);
89
- return (e == null ? void 0 : e.allFieldNames) ?? [];
80
+ function f(s) {
81
+ return u().get(s)?.allFieldNames ?? [];
90
82
  }
91
- function M(s, e) {
83
+ function m(s, e) {
92
84
  return u().getFieldType(s, e);
93
85
  }
94
- function w(s, e) {
86
+ function F(s, e) {
95
87
  return u().getField(s, e);
96
88
  }
97
89
  export {
98
- p as SchemaCache,
99
- C as createSchemaCache,
100
- w as getCachedField,
101
- y as getCachedFieldNames,
102
- M as getCachedFieldType,
90
+ d as SchemaCache,
91
+ g as createSchemaCache,
92
+ F as getCachedField,
93
+ f as getCachedFieldNames,
94
+ m as getCachedFieldType,
103
95
  u as getSchemaCache
104
96
  };
@@ -1,5 +1,4 @@
1
1
  import { FieldUsage, LogicTreeNode, PreviewResult } from './types';
2
-
3
2
  export declare class SemanticPreview {
4
3
  /**
5
4
  * Generate a complete preview for a TQL query