js.documents 14.4.56 → 14.4.58
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/codecs/read.cjs +2 -2
- package/dist/codecs/read.js +1 -1
- package/dist/composition-plan-CfvhXeOC.cjs +627 -0
- package/dist/composition-plan-DU9nPPN7.d.cts +102 -0
- package/dist/composition-plan-f0zaExUW.js +508 -0
- package/dist/composition-plan-l6QPO4FX.d.ts +102 -0
- package/dist/convert/composition-plan.cjs +7 -0
- package/dist/convert/composition-plan.d.cts +2 -0
- package/dist/convert/composition-plan.d.ts +2 -0
- package/dist/convert/composition-plan.js +2 -0
- package/dist/convert/composition-to-pdf.cjs +12 -12
- package/dist/convert/composition-to-pdf.d.cts +1 -1
- package/dist/convert/composition-to-pdf.d.ts +1 -1
- package/dist/convert/composition-to-pdf.js +2 -2
- package/dist/convert/composition.cjs +16 -511
- package/dist/convert/composition.d.cts +2 -85
- package/dist/convert/composition.d.ts +2 -85
- package/dist/convert/composition.js +2 -502
- package/dist/convert/convert.cjs +2 -2
- package/dist/convert/convert.js +1 -1
- package/dist/convert/from-package.cjs +3 -3
- package/dist/convert/from-package.js +2 -2
- package/dist/convert/from-pdf.cjs +18 -18
- package/dist/convert/from-pdf.js +2 -2
- package/dist/convert/local.cjs +3 -3
- package/dist/convert/local.js +1 -1
- package/dist/edit/odp/slide.cjs +4 -4
- package/dist/edit/odp/slide.d.cts +1 -1
- package/dist/edit/odp/slide.d.ts +1 -1
- package/dist/edit/odp/slide.js +1 -1
- package/dist/edit/odt/content.d.cts +1 -1
- package/dist/edit/odt/content.d.ts +1 -1
- package/dist/edit/odt/editor.cjs +4 -4
- package/dist/edit/odt/editor.d.cts +1 -1
- package/dist/edit/odt/editor.d.ts +1 -1
- package/dist/edit/odt/editor.js +1 -1
- package/dist/edit/odt/table-grid.cjs +23 -0
- package/dist/edit/odt/table-grid.d.cts +54 -0
- package/dist/edit/odt/table-grid.d.ts +54 -0
- package/dist/edit/odt/table-grid.js +2 -0
- package/dist/edit/odt/table.cjs +12 -653
- package/dist/edit/odt/table.d.cts +2 -2
- package/dist/edit/odt/table.d.ts +2 -2
- package/dist/edit/odt/table.js +2 -647
- package/dist/{evaluate-BbOsgdmN.d.cts → evaluate-BSEUxiUK.d.cts} +3 -1
- package/dist/evaluate-CEzsBx3w.cjs +564 -0
- package/dist/{evaluate-C7fmk69X.d.ts → evaluate-D8fG2ZeB.d.ts} +3 -1
- package/dist/evaluate-IK-3aMv5.js +445 -0
- package/dist/evaluate-columns-CyqKHkIW.d.cts +41 -0
- package/dist/evaluate-columns-cOo8fOfT.d.ts +41 -0
- package/dist/index.cjs +24 -24
- package/dist/index.d.cts +6 -5
- package/dist/index.d.ts +6 -5
- package/dist/index.js +8 -8
- package/dist/latex/lint.cjs +2 -2
- package/dist/latex/lint.js +1 -1
- package/dist/latex/lower-fold.cjs +6 -0
- package/dist/latex/lower-fold.d.cts +17 -0
- package/dist/latex/lower-fold.d.ts +17 -0
- package/dist/latex/lower-fold.js +2 -0
- package/dist/latex/lower.cjs +11 -617
- package/dist/latex/lower.d.cts +18 -1
- package/dist/latex/lower.d.ts +18 -1
- package/dist/latex/lower.js +2 -616
- package/dist/latex/symbols.d.cts +1 -15
- package/dist/latex/symbols.d.ts +1 -15
- package/dist/latex/temml.d.cts +1 -24
- package/dist/latex/temml.d.ts +1 -24
- package/dist/layout/engine.cjs +2 -2
- package/dist/layout/engine.js +1 -1
- package/dist/layout/reconstruct-lines.cjs +315 -0
- package/dist/layout/reconstruct-lines.d.cts +2 -0
- package/dist/layout/reconstruct-lines.d.ts +2 -0
- package/dist/layout/reconstruct-lines.js +297 -0
- package/dist/layout/reconstruct-presentations-prod.cjs +9 -0
- package/dist/layout/reconstruct-presentations-prod.d.cts +26 -0
- package/dist/layout/reconstruct-presentations-prod.d.ts +26 -0
- package/dist/layout/reconstruct-presentations-prod.js +2 -0
- package/dist/layout/reconstruct-tables.cjs +5 -0
- package/dist/layout/reconstruct-tables.d.cts +22 -0
- package/dist/layout/reconstruct-tables.d.ts +22 -0
- package/dist/layout/reconstruct-tables.js +2 -0
- package/dist/layout/reconstruct.cjs +11 -1545
- package/dist/layout/reconstruct.d.cts +2 -14
- package/dist/layout/reconstruct.d.ts +2 -14
- package/dist/layout/reconstruct.js +2 -1542
- package/dist/layout/shared.cjs +2 -2
- package/dist/layout/shared.js +1 -1
- package/dist/layout/sheets-render.cjs +19 -0
- package/dist/layout/sheets-render.d.cts +41 -0
- package/dist/layout/sheets-render.d.ts +41 -0
- package/dist/layout/sheets-render.js +2 -0
- package/dist/layout/sheets.cjs +10 -544
- package/dist/layout/sheets.d.cts +13 -2
- package/dist/layout/sheets.d.ts +13 -2
- package/dist/layout/sheets.js +2 -543
- package/dist/layout/slides.cjs +2 -2
- package/dist/layout/slides.js +1 -1
- package/dist/layout-DIJzJk4x.js +526 -0
- package/dist/layout-iuiyl_Fk.cjs +621 -0
- package/dist/layout-types-oSbHvZid.d.cts +13 -0
- package/dist/layout-types-oSbHvZid.d.ts +13 -0
- package/dist/lower-DCs3rWI7.js +618 -0
- package/dist/lower-DzOb13w4.cjs +701 -0
- package/dist/markdown/math.cjs +2 -2
- package/dist/markdown/math.js +1 -1
- package/dist/mathml/layout-stretch.cjs +16 -0
- package/dist/mathml/layout-stretch.d.cts +24 -0
- package/dist/mathml/layout-stretch.d.ts +24 -0
- package/dist/mathml/layout-stretch.js +2 -0
- package/dist/mathml/layout-types.d.cts +1 -12
- package/dist/mathml/layout-types.d.ts +1 -12
- package/dist/mathml/layout.cjs +3 -525
- package/dist/mathml/layout.d.cts +2 -2
- package/dist/mathml/layout.d.ts +2 -2
- package/dist/mathml/layout.js +1 -523
- package/dist/odb/formula/evaluate.d.cts +1 -1
- package/dist/odb/formula/evaluate.d.ts +1 -1
- package/dist/odb/report/render.d.cts +1 -1
- package/dist/odb/report/render.d.ts +1 -1
- package/dist/odb/report/source.cjs +2 -2
- package/dist/odb/report/source.d.cts +1 -1
- package/dist/odb/report/source.d.ts +1 -1
- package/dist/odb/report/source.js +1 -1
- package/dist/odb/sql/evaluate-columns.cjs +122 -0
- package/dist/odb/sql/evaluate-columns.d.cts +2 -0
- package/dist/odb/sql/evaluate-columns.d.ts +2 -0
- package/dist/odb/sql/evaluate-columns.js +114 -0
- package/dist/odb/sql/evaluate-predicates.cjs +16 -0
- package/dist/odb/sql/evaluate-predicates.d.cts +23 -0
- package/dist/odb/sql/evaluate-predicates.d.ts +23 -0
- package/dist/odb/sql/evaluate-predicates.js +2 -0
- package/dist/odb/sql/evaluate.cjs +7 -556
- package/dist/odb/sql/evaluate.d.cts +2 -2
- package/dist/odb/sql/evaluate.d.ts +2 -2
- package/dist/odb/sql/evaluate.js +2 -552
- package/dist/read-BSH--XB4.js +682 -0
- package/dist/read-CahCZMwG.cjs +759 -0
- package/dist/reconstruct-BKOCAedo.d.ts +29 -0
- package/dist/reconstruct-D4TEteZ6.d.cts +29 -0
- package/dist/reconstruct-lines-B7t66ICm.d.cts +33 -0
- package/dist/reconstruct-lines-B7t66ICm.d.ts +33 -0
- package/dist/reconstruct-presentations-prod-B5fkPiRZ.js +1256 -0
- package/dist/reconstruct-presentations-prod-X315aBmI.cjs +1375 -0
- package/dist/sheets-BQCpNXsE.cjs +700 -0
- package/dist/sheets-DWDvGN-g.js +545 -0
- package/dist/svg/read-geometry.cjs +10 -0
- package/dist/svg/read-geometry.d.cts +24 -0
- package/dist/svg/read-geometry.d.ts +24 -0
- package/dist/svg/read-geometry.js +2 -0
- package/dist/svg/read.cjs +6 -680
- package/dist/svg/read.d.cts +17 -2
- package/dist/svg/read.d.ts +17 -2
- package/dist/svg/read.js +2 -679
- package/dist/symbols-BlzXfLEe.d.cts +16 -0
- package/dist/symbols-CKm2r4D0.d.ts +16 -0
- package/dist/table-B5gSMY7w.js +649 -0
- package/dist/{table-DrE6jEWv.d.cts → table-BK_Ao-Y6.d.cts} +9 -1
- package/dist/{table-B5htMG3g.d.ts → table-CxY85YUj.d.ts} +9 -1
- package/dist/table-DqUIOSPV.cjs +840 -0
- package/dist/temml-1-I9N9DD.d.cts +25 -0
- package/dist/temml-1-I9N9DD.d.ts +25 -0
- package/package.json +2 -2
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
+
const require_odb_sql_errors = require("./errors.cjs");
|
|
3
|
+
//#region src/odb/sql/evaluate-columns.ts
|
|
4
|
+
function tryResolveName(candidates, ref, what, sql) {
|
|
5
|
+
const exact = candidates.find((candidate) => candidate === ref.name);
|
|
6
|
+
if (exact !== void 0) return exact;
|
|
7
|
+
if (!ref.quoted) {
|
|
8
|
+
const folded = candidates.filter((candidate) => candidate.toUpperCase() === ref.name);
|
|
9
|
+
if (folded.length > 1) throw new require_odb_sql_errors.HsqldbSqlEvaluationError(`${what} "${ref.name}" is ambiguous—it matches ${folded.join(", ")} case-insensitively`, sql);
|
|
10
|
+
return folded[0];
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
function resolveName(candidates, ref, what, sql) {
|
|
14
|
+
const found = tryResolveName(candidates, ref, what, sql);
|
|
15
|
+
if (found !== void 0) return found;
|
|
16
|
+
throw new require_odb_sql_errors.HsqldbSqlEvaluationError(`${what} "${ref.name}" not found—available: ${candidates.length === 0 ? "(none)" : candidates.join(", ")}`, sql);
|
|
17
|
+
}
|
|
18
|
+
function resolveTable(tables, ref, sql) {
|
|
19
|
+
const resolvedName = resolveName(tables.map((table) => table.tableName), ref, "table", sql);
|
|
20
|
+
const table = tables.find((candidate) => candidate.tableName === resolvedName);
|
|
21
|
+
if (table === void 0) throw new require_odb_sql_errors.HsqldbSqlEvaluationError(`table "${resolvedName}" not found`, sql);
|
|
22
|
+
return table;
|
|
23
|
+
}
|
|
24
|
+
function columnAt(columns, index, sql) {
|
|
25
|
+
const column = columns[index];
|
|
26
|
+
if (column === void 0) throw new require_odb_sql_errors.HsqldbSqlEvaluationError(`column index ${String(index)} is outside the joined column list`, sql);
|
|
27
|
+
return column;
|
|
28
|
+
}
|
|
29
|
+
function valueAtIndex(row, index, sql) {
|
|
30
|
+
const value = row[index];
|
|
31
|
+
if (value === void 0) throw new require_odb_sql_errors.HsqldbSqlEvaluationError(`malformed joined row: it carries ${String(row.length)} values but index ${String(index)} was expected`, sql);
|
|
32
|
+
return value;
|
|
33
|
+
}
|
|
34
|
+
function tryResolveColumnIndex(columns, candidateIndices, ref, sql) {
|
|
35
|
+
let firstExact;
|
|
36
|
+
let exactCount = 0;
|
|
37
|
+
for (const index of candidateIndices) if (columns[index]?.columnName === ref.name) {
|
|
38
|
+
exactCount += 1;
|
|
39
|
+
firstExact ??= index;
|
|
40
|
+
}
|
|
41
|
+
if (exactCount > 1) throw new require_odb_sql_errors.HsqldbSqlEvaluationError(`column "${ref.name}" is ambiguous—it matches more than one joined column named "${ref.name}"`, sql);
|
|
42
|
+
if (firstExact !== void 0) return firstExact;
|
|
43
|
+
if (!ref.quoted) {
|
|
44
|
+
let firstFolded;
|
|
45
|
+
const foldedNames = [];
|
|
46
|
+
for (const index of candidateIndices) {
|
|
47
|
+
const name = columns[index]?.columnName;
|
|
48
|
+
if (name?.toUpperCase() !== ref.name) continue;
|
|
49
|
+
foldedNames.push(name);
|
|
50
|
+
firstFolded ??= index;
|
|
51
|
+
}
|
|
52
|
+
if (foldedNames.length > 1) throw new require_odb_sql_errors.HsqldbSqlEvaluationError(`column "${ref.name}" is ambiguous—it matches ${foldedNames.join(", ")} case-insensitively`, sql);
|
|
53
|
+
return firstFolded;
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
function resolveColumnIndex(columns, candidateIndices, ref, sql) {
|
|
57
|
+
const index = tryResolveColumnIndex(columns, candidateIndices, ref, sql);
|
|
58
|
+
if (index !== void 0) return index;
|
|
59
|
+
throw new require_odb_sql_errors.HsqldbSqlEvaluationError(`column "${ref.name}" not found—available: ${candidateIndices.length === 0 ? "(none)" : candidateIndices.map((candidate) => columns[candidate]?.columnName ?? "?").join(", ")}`, sql);
|
|
60
|
+
}
|
|
61
|
+
var ColumnResolver = class {
|
|
62
|
+
sql;
|
|
63
|
+
outer;
|
|
64
|
+
cache = /* @__PURE__ */ new Map();
|
|
65
|
+
columns;
|
|
66
|
+
qualifierNames;
|
|
67
|
+
constructor(columns, sql, outer) {
|
|
68
|
+
this.sql = sql;
|
|
69
|
+
this.outer = outer;
|
|
70
|
+
this.columns = columns;
|
|
71
|
+
this.qualifierNames = [...new Set(columns.flatMap((column) => column.qualifiers))];
|
|
72
|
+
}
|
|
73
|
+
get columnCount() {
|
|
74
|
+
return this.columns.length;
|
|
75
|
+
}
|
|
76
|
+
nameAt(index) {
|
|
77
|
+
return columnAt(this.columns, index, this.sql).columnName;
|
|
78
|
+
}
|
|
79
|
+
indexOf(ref) {
|
|
80
|
+
const cached = this.cache.get(ref);
|
|
81
|
+
if (cached !== void 0) return cached;
|
|
82
|
+
const qualifierName = ref.qualifier === void 0 ? void 0 : resolveName(this.qualifierNames, ref.qualifier, "table qualifier", this.sql);
|
|
83
|
+
const index = resolveColumnIndex(this.columns, this.candidateIndicesFor(qualifierName), ref.column, this.sql);
|
|
84
|
+
this.cache.set(ref, index);
|
|
85
|
+
return index;
|
|
86
|
+
}
|
|
87
|
+
tryLocalIndexOf(ref) {
|
|
88
|
+
const cached = this.cache.get(ref);
|
|
89
|
+
if (cached !== void 0) return cached;
|
|
90
|
+
let qualifierName;
|
|
91
|
+
if (ref.qualifier !== void 0) {
|
|
92
|
+
qualifierName = tryResolveName(this.qualifierNames, ref.qualifier, "table qualifier", this.sql);
|
|
93
|
+
if (qualifierName === void 0) return;
|
|
94
|
+
}
|
|
95
|
+
const index = tryResolveColumnIndex(this.columns, this.candidateIndicesFor(qualifierName), ref.column, this.sql);
|
|
96
|
+
if (index === void 0) return;
|
|
97
|
+
this.cache.set(ref, index);
|
|
98
|
+
return index;
|
|
99
|
+
}
|
|
100
|
+
candidateIndicesFor(qualifierName) {
|
|
101
|
+
if (qualifierName === void 0) return this.columns.map((_column, index) => index);
|
|
102
|
+
return this.columns.map((column, index) => column.qualifiers.includes(qualifierName) ? index : -1).filter((index) => index >= 0);
|
|
103
|
+
}
|
|
104
|
+
valueAt(index, row) {
|
|
105
|
+
return valueAtIndex(row, index, this.sql);
|
|
106
|
+
}
|
|
107
|
+
valueOf(ref, row) {
|
|
108
|
+
const localIndex = this.tryLocalIndexOf(ref);
|
|
109
|
+
if (localIndex !== void 0) return this.valueAt(localIndex, row);
|
|
110
|
+
if (this.outer !== void 0) return this.outer.resolver.valueOf(ref, this.outer.row);
|
|
111
|
+
return this.valueAt(this.indexOf(ref), row);
|
|
112
|
+
}
|
|
113
|
+
};
|
|
114
|
+
//#endregion
|
|
115
|
+
exports.ColumnResolver = ColumnResolver;
|
|
116
|
+
exports.columnAt = columnAt;
|
|
117
|
+
exports.resolveColumnIndex = resolveColumnIndex;
|
|
118
|
+
exports.resolveName = resolveName;
|
|
119
|
+
exports.resolveTable = resolveTable;
|
|
120
|
+
exports.tryResolveColumnIndex = tryResolveColumnIndex;
|
|
121
|
+
exports.tryResolveName = tryResolveName;
|
|
122
|
+
exports.valueAtIndex = valueAtIndex;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { a as columnAt, c as resolveTable, d as valueAtIndex, i as SharedColumnPair, l as tryResolveColumnIndex, n as OuterScope, o as resolveColumnIndex, r as ResolvedColumn, s as resolveName, t as ColumnResolver, u as tryResolveName } from "../../evaluate-columns-CyqKHkIW.cjs";
|
|
2
|
+
export { ColumnResolver, OuterScope, ResolvedColumn, SharedColumnPair, columnAt, resolveColumnIndex, resolveName, resolveTable, tryResolveColumnIndex, tryResolveName, valueAtIndex };
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { a as columnAt, c as resolveTable, d as valueAtIndex, i as SharedColumnPair, l as tryResolveColumnIndex, n as OuterScope, o as resolveColumnIndex, r as ResolvedColumn, s as resolveName, t as ColumnResolver, u as tryResolveName } from "../../evaluate-columns-cOo8fOfT.js";
|
|
2
|
+
export { ColumnResolver, OuterScope, ResolvedColumn, SharedColumnPair, columnAt, resolveColumnIndex, resolveName, resolveTable, tryResolveColumnIndex, tryResolveName, valueAtIndex };
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
import { HsqldbSqlEvaluationError } from "./errors.js";
|
|
2
|
+
//#region src/odb/sql/evaluate-columns.ts
|
|
3
|
+
function tryResolveName(candidates, ref, what, sql) {
|
|
4
|
+
const exact = candidates.find((candidate) => candidate === ref.name);
|
|
5
|
+
if (exact !== void 0) return exact;
|
|
6
|
+
if (!ref.quoted) {
|
|
7
|
+
const folded = candidates.filter((candidate) => candidate.toUpperCase() === ref.name);
|
|
8
|
+
if (folded.length > 1) throw new HsqldbSqlEvaluationError(`${what} "${ref.name}" is ambiguous—it matches ${folded.join(", ")} case-insensitively`, sql);
|
|
9
|
+
return folded[0];
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
function resolveName(candidates, ref, what, sql) {
|
|
13
|
+
const found = tryResolveName(candidates, ref, what, sql);
|
|
14
|
+
if (found !== void 0) return found;
|
|
15
|
+
throw new HsqldbSqlEvaluationError(`${what} "${ref.name}" not found—available: ${candidates.length === 0 ? "(none)" : candidates.join(", ")}`, sql);
|
|
16
|
+
}
|
|
17
|
+
function resolveTable(tables, ref, sql) {
|
|
18
|
+
const resolvedName = resolveName(tables.map((table) => table.tableName), ref, "table", sql);
|
|
19
|
+
const table = tables.find((candidate) => candidate.tableName === resolvedName);
|
|
20
|
+
if (table === void 0) throw new HsqldbSqlEvaluationError(`table "${resolvedName}" not found`, sql);
|
|
21
|
+
return table;
|
|
22
|
+
}
|
|
23
|
+
function columnAt(columns, index, sql) {
|
|
24
|
+
const column = columns[index];
|
|
25
|
+
if (column === void 0) throw new HsqldbSqlEvaluationError(`column index ${String(index)} is outside the joined column list`, sql);
|
|
26
|
+
return column;
|
|
27
|
+
}
|
|
28
|
+
function valueAtIndex(row, index, sql) {
|
|
29
|
+
const value = row[index];
|
|
30
|
+
if (value === void 0) throw new HsqldbSqlEvaluationError(`malformed joined row: it carries ${String(row.length)} values but index ${String(index)} was expected`, sql);
|
|
31
|
+
return value;
|
|
32
|
+
}
|
|
33
|
+
function tryResolveColumnIndex(columns, candidateIndices, ref, sql) {
|
|
34
|
+
let firstExact;
|
|
35
|
+
let exactCount = 0;
|
|
36
|
+
for (const index of candidateIndices) if (columns[index]?.columnName === ref.name) {
|
|
37
|
+
exactCount += 1;
|
|
38
|
+
firstExact ??= index;
|
|
39
|
+
}
|
|
40
|
+
if (exactCount > 1) throw new HsqldbSqlEvaluationError(`column "${ref.name}" is ambiguous—it matches more than one joined column named "${ref.name}"`, sql);
|
|
41
|
+
if (firstExact !== void 0) return firstExact;
|
|
42
|
+
if (!ref.quoted) {
|
|
43
|
+
let firstFolded;
|
|
44
|
+
const foldedNames = [];
|
|
45
|
+
for (const index of candidateIndices) {
|
|
46
|
+
const name = columns[index]?.columnName;
|
|
47
|
+
if (name?.toUpperCase() !== ref.name) continue;
|
|
48
|
+
foldedNames.push(name);
|
|
49
|
+
firstFolded ??= index;
|
|
50
|
+
}
|
|
51
|
+
if (foldedNames.length > 1) throw new HsqldbSqlEvaluationError(`column "${ref.name}" is ambiguous—it matches ${foldedNames.join(", ")} case-insensitively`, sql);
|
|
52
|
+
return firstFolded;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
function resolveColumnIndex(columns, candidateIndices, ref, sql) {
|
|
56
|
+
const index = tryResolveColumnIndex(columns, candidateIndices, ref, sql);
|
|
57
|
+
if (index !== void 0) return index;
|
|
58
|
+
throw new HsqldbSqlEvaluationError(`column "${ref.name}" not found—available: ${candidateIndices.length === 0 ? "(none)" : candidateIndices.map((candidate) => columns[candidate]?.columnName ?? "?").join(", ")}`, sql);
|
|
59
|
+
}
|
|
60
|
+
var ColumnResolver = class {
|
|
61
|
+
sql;
|
|
62
|
+
outer;
|
|
63
|
+
cache = /* @__PURE__ */ new Map();
|
|
64
|
+
columns;
|
|
65
|
+
qualifierNames;
|
|
66
|
+
constructor(columns, sql, outer) {
|
|
67
|
+
this.sql = sql;
|
|
68
|
+
this.outer = outer;
|
|
69
|
+
this.columns = columns;
|
|
70
|
+
this.qualifierNames = [...new Set(columns.flatMap((column) => column.qualifiers))];
|
|
71
|
+
}
|
|
72
|
+
get columnCount() {
|
|
73
|
+
return this.columns.length;
|
|
74
|
+
}
|
|
75
|
+
nameAt(index) {
|
|
76
|
+
return columnAt(this.columns, index, this.sql).columnName;
|
|
77
|
+
}
|
|
78
|
+
indexOf(ref) {
|
|
79
|
+
const cached = this.cache.get(ref);
|
|
80
|
+
if (cached !== void 0) return cached;
|
|
81
|
+
const qualifierName = ref.qualifier === void 0 ? void 0 : resolveName(this.qualifierNames, ref.qualifier, "table qualifier", this.sql);
|
|
82
|
+
const index = resolveColumnIndex(this.columns, this.candidateIndicesFor(qualifierName), ref.column, this.sql);
|
|
83
|
+
this.cache.set(ref, index);
|
|
84
|
+
return index;
|
|
85
|
+
}
|
|
86
|
+
tryLocalIndexOf(ref) {
|
|
87
|
+
const cached = this.cache.get(ref);
|
|
88
|
+
if (cached !== void 0) return cached;
|
|
89
|
+
let qualifierName;
|
|
90
|
+
if (ref.qualifier !== void 0) {
|
|
91
|
+
qualifierName = tryResolveName(this.qualifierNames, ref.qualifier, "table qualifier", this.sql);
|
|
92
|
+
if (qualifierName === void 0) return;
|
|
93
|
+
}
|
|
94
|
+
const index = tryResolveColumnIndex(this.columns, this.candidateIndicesFor(qualifierName), ref.column, this.sql);
|
|
95
|
+
if (index === void 0) return;
|
|
96
|
+
this.cache.set(ref, index);
|
|
97
|
+
return index;
|
|
98
|
+
}
|
|
99
|
+
candidateIndicesFor(qualifierName) {
|
|
100
|
+
if (qualifierName === void 0) return this.columns.map((_column, index) => index);
|
|
101
|
+
return this.columns.map((column, index) => column.qualifiers.includes(qualifierName) ? index : -1).filter((index) => index >= 0);
|
|
102
|
+
}
|
|
103
|
+
valueAt(index, row) {
|
|
104
|
+
return valueAtIndex(row, index, this.sql);
|
|
105
|
+
}
|
|
106
|
+
valueOf(ref, row) {
|
|
107
|
+
const localIndex = this.tryLocalIndexOf(ref);
|
|
108
|
+
if (localIndex !== void 0) return this.valueAt(localIndex, row);
|
|
109
|
+
if (this.outer !== void 0) return this.outer.resolver.valueOf(ref, this.outer.row);
|
|
110
|
+
return this.valueAt(this.indexOf(ref), row);
|
|
111
|
+
}
|
|
112
|
+
};
|
|
113
|
+
//#endregion
|
|
114
|
+
export { ColumnResolver, columnAt, resolveColumnIndex, resolveName, resolveTable, tryResolveColumnIndex, tryResolveName, valueAtIndex };
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
+
const require_evaluate = require("../../evaluate-CEzsBx3w.cjs");
|
|
3
|
+
exports.andTruth = require_evaluate.andTruth;
|
|
4
|
+
exports.compareValues = require_evaluate.compareValues;
|
|
5
|
+
exports.evaluateExists = require_evaluate.evaluateExists;
|
|
6
|
+
exports.evaluateIn = require_evaluate.evaluateIn;
|
|
7
|
+
exports.evaluateInSubquery = require_evaluate.evaluateInSubquery;
|
|
8
|
+
exports.evaluateLike = require_evaluate.evaluateLike;
|
|
9
|
+
exports.evaluatePredicate = require_evaluate.evaluatePredicate;
|
|
10
|
+
exports.likePatternToRegExp = require_evaluate.likePatternToRegExp;
|
|
11
|
+
exports.literalToValue = require_evaluate.literalToValue;
|
|
12
|
+
exports.notTruth = require_evaluate.notTruth;
|
|
13
|
+
exports.operandValue = require_evaluate.operandValue;
|
|
14
|
+
exports.orTruth = require_evaluate.orTruth;
|
|
15
|
+
exports.sqlFailure = require_evaluate.sqlFailure;
|
|
16
|
+
exports.truthOfComparison = require_evaluate.truthOfComparison;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { r as HsqldbTable } from "../../script-pkZ2Kor4.cjs";
|
|
2
|
+
import { t as SqlComparisonOperator } from "../../lexer-DgsW7jMA.cjs";
|
|
3
|
+
import { d as SqlOperand, h as SqlSelectStatement, l as SqlLiteral, p as SqlPredicate } from "../../parser-BTA1wXPd.cjs";
|
|
4
|
+
import { t as ColumnResolver } from "../../evaluate-columns-CyqKHkIW.cjs";
|
|
5
|
+
import { ContentCellValue } from "document-schema.js";
|
|
6
|
+
//#region src/odb/sql/evaluate-predicates.d.ts
|
|
7
|
+
type Truth = "true" | "false" | "unknown";
|
|
8
|
+
declare function sqlFailure(sql: string): (message: string) => Error;
|
|
9
|
+
declare function compareValues(left: ContentCellValue, right: ContentCellValue, sql: string): number;
|
|
10
|
+
declare function truthOfComparison(ordering: number, operator: SqlComparisonOperator): Truth;
|
|
11
|
+
declare function notTruth(truth: Truth): Truth;
|
|
12
|
+
declare function andTruth(left: Truth, right: Truth): Truth;
|
|
13
|
+
declare function orTruth(left: Truth, right: Truth): Truth;
|
|
14
|
+
declare function literalToValue(literal: SqlLiteral): ContentCellValue;
|
|
15
|
+
declare function likePatternToRegExp(pattern: string): RegExp;
|
|
16
|
+
declare function operandValue(operand: SqlOperand, row: readonly ContentCellValue[], resolver: ColumnResolver): ContentCellValue;
|
|
17
|
+
declare function evaluateLike(value: ContentCellValue, pattern: string, sql: string): Truth;
|
|
18
|
+
declare function evaluateIn(value: ContentCellValue, values: readonly SqlLiteral[], sql: string): Truth;
|
|
19
|
+
declare function evaluatePredicate(predicate: SqlPredicate, row: readonly ContentCellValue[], resolver: ColumnResolver, tables: readonly HsqldbTable[], sql: string): Truth;
|
|
20
|
+
declare function evaluateInSubquery(value: ContentCellValue, query: SqlSelectStatement, tables: readonly HsqldbTable[], outerResolver: ColumnResolver, outerRow: readonly ContentCellValue[], sql: string): Truth;
|
|
21
|
+
declare function evaluateExists(query: SqlSelectStatement, tables: readonly HsqldbTable[], outerResolver: ColumnResolver, outerRow: readonly ContentCellValue[]): Truth;
|
|
22
|
+
//#endregion
|
|
23
|
+
export { Truth, andTruth, compareValues, evaluateExists, evaluateIn, evaluateInSubquery, evaluateLike, evaluatePredicate, likePatternToRegExp, literalToValue, notTruth, operandValue, orTruth, sqlFailure, truthOfComparison };
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { r as HsqldbTable } from "../../script-pkZ2Kor4.js";
|
|
2
|
+
import { t as SqlComparisonOperator } from "../../lexer-DgsW7jMA.js";
|
|
3
|
+
import { d as SqlOperand, h as SqlSelectStatement, l as SqlLiteral, p as SqlPredicate } from "../../parser-CoIi0l9I.js";
|
|
4
|
+
import { t as ColumnResolver } from "../../evaluate-columns-cOo8fOfT.js";
|
|
5
|
+
import { ContentCellValue } from "document-schema.js";
|
|
6
|
+
//#region src/odb/sql/evaluate-predicates.d.ts
|
|
7
|
+
type Truth = "true" | "false" | "unknown";
|
|
8
|
+
declare function sqlFailure(sql: string): (message: string) => Error;
|
|
9
|
+
declare function compareValues(left: ContentCellValue, right: ContentCellValue, sql: string): number;
|
|
10
|
+
declare function truthOfComparison(ordering: number, operator: SqlComparisonOperator): Truth;
|
|
11
|
+
declare function notTruth(truth: Truth): Truth;
|
|
12
|
+
declare function andTruth(left: Truth, right: Truth): Truth;
|
|
13
|
+
declare function orTruth(left: Truth, right: Truth): Truth;
|
|
14
|
+
declare function literalToValue(literal: SqlLiteral): ContentCellValue;
|
|
15
|
+
declare function likePatternToRegExp(pattern: string): RegExp;
|
|
16
|
+
declare function operandValue(operand: SqlOperand, row: readonly ContentCellValue[], resolver: ColumnResolver): ContentCellValue;
|
|
17
|
+
declare function evaluateLike(value: ContentCellValue, pattern: string, sql: string): Truth;
|
|
18
|
+
declare function evaluateIn(value: ContentCellValue, values: readonly SqlLiteral[], sql: string): Truth;
|
|
19
|
+
declare function evaluatePredicate(predicate: SqlPredicate, row: readonly ContentCellValue[], resolver: ColumnResolver, tables: readonly HsqldbTable[], sql: string): Truth;
|
|
20
|
+
declare function evaluateInSubquery(value: ContentCellValue, query: SqlSelectStatement, tables: readonly HsqldbTable[], outerResolver: ColumnResolver, outerRow: readonly ContentCellValue[], sql: string): Truth;
|
|
21
|
+
declare function evaluateExists(query: SqlSelectStatement, tables: readonly HsqldbTable[], outerResolver: ColumnResolver, outerRow: readonly ContentCellValue[]): Truth;
|
|
22
|
+
//#endregion
|
|
23
|
+
export { Truth, andTruth, compareValues, evaluateExists, evaluateIn, evaluateInSubquery, evaluateLike, evaluatePredicate, likePatternToRegExp, literalToValue, notTruth, operandValue, orTruth, sqlFailure, truthOfComparison };
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { _ as operandValue, b as truthOfComparison, c as compareValues, d as evaluateInSubquery, f as evaluateLike, g as notTruth, h as literalToValue, l as evaluateExists, m as likePatternToRegExp, p as evaluatePredicate, s as andTruth, u as evaluateIn, v as orTruth, y as sqlFailure } from "../../evaluate-IK-3aMv5.js";
|
|
2
|
+
export { andTruth, compareValues, evaluateExists, evaluateIn, evaluateInSubquery, evaluateLike, evaluatePredicate, likePatternToRegExp, literalToValue, notTruth, operandValue, orTruth, sqlFailure, truthOfComparison };
|