@milaboratories/pl-model-common 1.24.2 → 1.24.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/dist/base32_encode.cjs +11 -11
- package/dist/base32_encode.cjs.map +1 -1
- package/dist/base32_encode.d.ts +1 -1
- package/dist/base32_encode.js +11 -11
- package/dist/base32_encode.js.map +1 -1
- package/dist/base64.cjs +2 -2
- package/dist/base64.cjs.map +1 -1
- package/dist/base64.d.ts +1 -1
- package/dist/base64.d.ts.map +1 -1
- package/dist/base64.js +2 -2
- package/dist/base64.js.map +1 -1
- package/dist/block_state.d.ts +3 -3
- package/dist/bmodel/block_config.cjs +1 -1
- package/dist/bmodel/block_config.cjs.map +1 -1
- package/dist/bmodel/block_config.d.ts +3 -3
- package/dist/bmodel/block_config.d.ts.map +1 -1
- package/dist/bmodel/block_config.js +1 -1
- package/dist/bmodel/block_config.js.map +1 -1
- package/dist/bmodel/code.cjs +1 -1
- package/dist/bmodel/code.cjs.map +1 -1
- package/dist/bmodel/code.d.ts +2 -2
- package/dist/bmodel/code.js +1 -1
- package/dist/bmodel/code.js.map +1 -1
- package/dist/bmodel/container.d.ts +5 -5
- package/dist/bmodel/index.d.ts +5 -5
- package/dist/bmodel/normalization.cjs +17 -17
- package/dist/bmodel/normalization.cjs.map +1 -1
- package/dist/bmodel/normalization.d.ts +2 -2
- package/dist/bmodel/normalization.d.ts.map +1 -1
- package/dist/bmodel/normalization.js +17 -17
- package/dist/bmodel/normalization.js.map +1 -1
- package/dist/bmodel/types.d.ts +1 -1
- package/dist/branding.d.ts +2 -2
- package/dist/common_types.d.ts +1 -1
- package/dist/driver_kit.d.ts +1 -1
- package/dist/drivers/ChunkedStreamReader.cjs +13 -12
- package/dist/drivers/ChunkedStreamReader.cjs.map +1 -1
- package/dist/drivers/ChunkedStreamReader.d.ts +2 -2
- package/dist/drivers/ChunkedStreamReader.d.ts.map +1 -1
- package/dist/drivers/ChunkedStreamReader.js +13 -12
- package/dist/drivers/ChunkedStreamReader.js.map +1 -1
- package/dist/drivers/blob.cjs +1 -1
- package/dist/drivers/blob.cjs.map +1 -1
- package/dist/drivers/blob.d.ts +4 -4
- package/dist/drivers/blob.d.ts.map +1 -1
- package/dist/drivers/blob.js +1 -1
- package/dist/drivers/blob.js.map +1 -1
- package/dist/drivers/index.d.ts +8 -8
- package/dist/drivers/log.cjs +1 -1
- package/dist/drivers/log.cjs.map +1 -1
- package/dist/drivers/log.js +1 -1
- package/dist/drivers/log.js.map +1 -1
- package/dist/drivers/ls.cjs +3 -3
- package/dist/drivers/ls.cjs.map +1 -1
- package/dist/drivers/ls.d.ts +6 -6
- package/dist/drivers/ls.d.ts.map +1 -1
- package/dist/drivers/ls.js +3 -3
- package/dist/drivers/ls.js.map +1 -1
- package/dist/drivers/pframe/column_filter.d.ts +1 -1
- package/dist/drivers/pframe/data_info.cjs +119 -110
- package/dist/drivers/pframe/data_info.cjs.map +1 -1
- package/dist/drivers/pframe/data_info.d.ts +10 -10
- package/dist/drivers/pframe/data_info.d.ts.map +1 -1
- package/dist/drivers/pframe/data_info.js +119 -110
- package/dist/drivers/pframe/data_info.js.map +1 -1
- package/dist/drivers/pframe/data_types.cjs +7 -4
- package/dist/drivers/pframe/data_types.cjs.map +1 -1
- package/dist/drivers/pframe/data_types.d.ts +2 -2
- package/dist/drivers/pframe/data_types.d.ts.map +1 -1
- package/dist/drivers/pframe/data_types.js +7 -4
- package/dist/drivers/pframe/data_types.js.map +1 -1
- package/dist/drivers/pframe/driver.d.ts +10 -10
- package/dist/drivers/pframe/driver.d.ts.map +1 -1
- package/dist/drivers/pframe/find_columns.d.ts +2 -2
- package/dist/drivers/pframe/index.d.ts +14 -14
- package/dist/drivers/pframe/linker_columns.cjs +13 -5
- package/dist/drivers/pframe/linker_columns.cjs.map +1 -1
- package/dist/drivers/pframe/linker_columns.d.ts +2 -2
- package/dist/drivers/pframe/linker_columns.d.ts.map +1 -1
- package/dist/drivers/pframe/linker_columns.js +13 -5
- package/dist/drivers/pframe/linker_columns.js.map +1 -1
- package/dist/drivers/pframe/pframe.d.ts +6 -6
- package/dist/drivers/pframe/pframe.d.ts.map +1 -1
- package/dist/drivers/pframe/query/index.d.ts +2 -2
- package/dist/drivers/pframe/query/query_common.d.ts +40 -40
- package/dist/drivers/pframe/query/query_common.d.ts.map +1 -1
- package/dist/drivers/pframe/query/query_data.d.ts +2 -2
- package/dist/drivers/pframe/query/query_data.d.ts.map +1 -1
- package/dist/drivers/pframe/query/query_spec.d.ts +3 -3
- package/dist/drivers/pframe/query/query_spec.d.ts.map +1 -1
- package/dist/drivers/pframe/spec/anchored.cjs +6 -6
- package/dist/drivers/pframe/spec/anchored.cjs.map +1 -1
- package/dist/drivers/pframe/spec/anchored.d.ts +4 -4
- package/dist/drivers/pframe/spec/anchored.d.ts.map +1 -1
- package/dist/drivers/pframe/spec/anchored.js +6 -6
- package/dist/drivers/pframe/spec/anchored.js.map +1 -1
- package/dist/drivers/pframe/spec/filtered_column.cjs +1 -1
- package/dist/drivers/pframe/spec/filtered_column.cjs.map +1 -1
- package/dist/drivers/pframe/spec/filtered_column.d.ts +1 -1
- package/dist/drivers/pframe/spec/filtered_column.js +1 -1
- package/dist/drivers/pframe/spec/filtered_column.js.map +1 -1
- package/dist/drivers/pframe/spec/ids.cjs.map +1 -1
- package/dist/drivers/pframe/spec/ids.d.ts +5 -5
- package/dist/drivers/pframe/spec/ids.js.map +1 -1
- package/dist/drivers/pframe/spec/index.d.ts +6 -6
- package/dist/drivers/pframe/spec/native_id.cjs.map +1 -1
- package/dist/drivers/pframe/spec/native_id.d.ts +3 -3
- package/dist/drivers/pframe/spec/native_id.d.ts.map +1 -1
- package/dist/drivers/pframe/spec/native_id.js.map +1 -1
- package/dist/drivers/pframe/spec/selectors.cjs +1 -1
- package/dist/drivers/pframe/spec/selectors.cjs.map +1 -1
- package/dist/drivers/pframe/spec/selectors.d.ts +4 -4
- package/dist/drivers/pframe/spec/selectors.d.ts.map +1 -1
- package/dist/drivers/pframe/spec/selectors.js +1 -1
- package/dist/drivers/pframe/spec/selectors.js.map +1 -1
- package/dist/drivers/pframe/spec/spec.cjs +64 -59
- package/dist/drivers/pframe/spec/spec.cjs.map +1 -1
- package/dist/drivers/pframe/spec/spec.d.ts +15 -15
- package/dist/drivers/pframe/spec/spec.d.ts.map +1 -1
- package/dist/drivers/pframe/spec/spec.js +64 -59
- package/dist/drivers/pframe/spec/spec.js.map +1 -1
- package/dist/drivers/pframe/table.d.ts +2 -2
- package/dist/drivers/pframe/table_calculate.cjs +11 -11
- package/dist/drivers/pframe/table_calculate.cjs.map +1 -1
- package/dist/drivers/pframe/table_calculate.d.ts +30 -30
- package/dist/drivers/pframe/table_calculate.d.ts.map +1 -1
- package/dist/drivers/pframe/table_calculate.js +11 -11
- package/dist/drivers/pframe/table_calculate.js.map +1 -1
- package/dist/drivers/pframe/table_common.cjs +4 -4
- package/dist/drivers/pframe/table_common.cjs.map +1 -1
- package/dist/drivers/pframe/table_common.d.ts +6 -6
- package/dist/drivers/pframe/table_common.js +4 -4
- package/dist/drivers/pframe/table_common.js.map +1 -1
- package/dist/drivers/pframe/type_util.d.ts.map +1 -1
- package/dist/drivers/pframe/unique_values.d.ts +4 -4
- package/dist/drivers/urls.cjs +2 -2
- package/dist/drivers/urls.cjs.map +1 -1
- package/dist/drivers/urls.d.ts +1 -1
- package/dist/drivers/urls.js +2 -2
- package/dist/drivers/urls.js.map +1 -1
- package/dist/errors.cjs +12 -12
- package/dist/errors.cjs.map +1 -1
- package/dist/errors.d.ts +1 -1
- package/dist/errors.d.ts.map +1 -1
- package/dist/errors.js +12 -12
- package/dist/errors.js.map +1 -1
- package/dist/flags/block_flags.cjs +2 -2
- package/dist/flags/block_flags.cjs.map +1 -1
- package/dist/flags/block_flags.d.ts.map +1 -1
- package/dist/flags/block_flags.js +2 -2
- package/dist/flags/block_flags.js.map +1 -1
- package/dist/flags/flag_utils.cjs +31 -29
- package/dist/flags/flag_utils.cjs.map +1 -1
- package/dist/flags/flag_utils.d.ts +33 -33
- package/dist/flags/flag_utils.d.ts.map +1 -1
- package/dist/flags/flag_utils.js +31 -29
- package/dist/flags/flag_utils.js.map +1 -1
- package/dist/flags/index.d.ts +3 -3
- package/dist/flags/type_utils.d.ts +1 -1
- package/dist/flags/type_utils.d.ts.map +1 -1
- package/dist/httpAuth.cjs +4 -5
- package/dist/httpAuth.cjs.map +1 -1
- package/dist/httpAuth.d.ts +1 -1
- package/dist/httpAuth.d.ts.map +1 -1
- package/dist/httpAuth.js +4 -5
- package/dist/httpAuth.js.map +1 -1
- package/dist/index.d.ts +19 -19
- package/dist/json.cjs +1 -1
- package/dist/json.cjs.map +1 -1
- package/dist/json.d.ts.map +1 -1
- package/dist/json.js +1 -1
- package/dist/json.js.map +1 -1
- package/dist/navigation.cjs +1 -1
- package/dist/navigation.cjs.map +1 -1
- package/dist/navigation.d.ts +3 -3
- package/dist/navigation.js +1 -1
- package/dist/navigation.js.map +1 -1
- package/dist/plid.cjs +4 -4
- package/dist/plid.cjs.map +1 -1
- package/dist/plid.d.ts +1 -1
- package/dist/plid.js +4 -4
- package/dist/plid.js.map +1 -1
- package/dist/pool/entry.d.ts +1 -1
- package/dist/pool/index.d.ts +3 -3
- package/dist/pool/query.cjs +23 -23
- package/dist/pool/query.cjs.map +1 -1
- package/dist/pool/query.d.ts +9 -9
- package/dist/pool/query.d.ts.map +1 -1
- package/dist/pool/query.js +23 -23
- package/dist/pool/query.js.map +1 -1
- package/dist/pool/spec.cjs +9 -9
- package/dist/pool/spec.cjs.map +1 -1
- package/dist/pool/spec.d.ts +4 -4
- package/dist/pool/spec.d.ts.map +1 -1
- package/dist/pool/spec.js +9 -9
- package/dist/pool/spec.js.map +1 -1
- package/dist/ref.cjs +20 -18
- package/dist/ref.cjs.map +1 -1
- package/dist/ref.d.ts +1 -1
- package/dist/ref.d.ts.map +1 -1
- package/dist/ref.js +20 -18
- package/dist/ref.js.map +1 -1
- package/dist/utag.d.ts +1 -1
- package/dist/util.cjs +1 -1
- package/dist/util.cjs.map +1 -1
- package/dist/util.js +1 -1
- package/dist/util.js.map +1 -1
- package/dist/value_or_error.cjs.map +1 -1
- package/dist/value_or_error.d.ts.map +1 -1
- package/dist/value_or_error.js.map +1 -1
- package/package.json +18 -17
- package/src/base32_encode.ts +12 -12
- package/src/base64.ts +12 -8
- package/src/block_state.ts +3 -3
- package/src/bmodel/block_config.ts +12 -6
- package/src/bmodel/code.ts +3 -3
- package/src/bmodel/container.ts +5 -5
- package/src/bmodel/index.ts +5 -5
- package/src/bmodel/normalization.ts +33 -25
- package/src/bmodel/types.ts +1 -1
- package/src/branding.ts +2 -2
- package/src/common_types.ts +1 -1
- package/src/driver_kit.ts +1 -1
- package/src/drivers/ChunkedStreamReader.ts +16 -14
- package/src/drivers/blob.ts +7 -11
- package/src/drivers/index.ts +8 -8
- package/src/drivers/log.ts +3 -3
- package/src/drivers/ls.ts +18 -18
- package/src/drivers/pframe/column_filter.ts +1 -1
- package/src/drivers/pframe/data_info.ts +146 -146
- package/src/drivers/pframe/data_types.ts +56 -36
- package/src/drivers/pframe/driver.ts +20 -36
- package/src/drivers/pframe/find_columns.ts +2 -2
- package/src/drivers/pframe/index.ts +14 -14
- package/src/drivers/pframe/linker_columns.test.ts +280 -273
- package/src/drivers/pframe/linker_columns.ts +65 -39
- package/src/drivers/pframe/pframe.ts +6 -9
- package/src/drivers/pframe/query/index.ts +2 -2
- package/src/drivers/pframe/query/query_common.ts +50 -40
- package/src/drivers/pframe/query/query_data.ts +17 -10
- package/src/drivers/pframe/query/query_spec.ts +18 -10
- package/src/drivers/pframe/spec/anchored.ts +44 -33
- package/src/drivers/pframe/spec/filtered_column.ts +2 -2
- package/src/drivers/pframe/spec/ids.ts +6 -6
- package/src/drivers/pframe/spec/index.ts +6 -6
- package/src/drivers/pframe/spec/native_id.ts +7 -9
- package/src/drivers/pframe/spec/selectors.test.ts +170 -146
- package/src/drivers/pframe/spec/selectors.ts +22 -31
- package/src/drivers/pframe/spec/spec.test.ts +163 -176
- package/src/drivers/pframe/spec/spec.ts +132 -117
- package/src/drivers/pframe/table.ts +2 -2
- package/src/drivers/pframe/table_calculate.ts +44 -50
- package/src/drivers/pframe/table_common.ts +10 -10
- package/src/drivers/pframe/type_util.ts +2 -7
- package/src/drivers/pframe/unique_values.ts +4 -4
- package/src/drivers/urls.ts +3 -3
- package/src/errors.test.ts +20 -20
- package/src/errors.ts +24 -20
- package/src/flags/block_flags.ts +8 -7
- package/src/flags/flag_utils.test.ts +94 -73
- package/src/flags/flag_utils.ts +73 -50
- package/src/flags/index.ts +3 -3
- package/src/flags/type_utils.ts +10 -7
- package/src/httpAuth.ts +5 -6
- package/src/index.ts +19 -19
- package/src/json.ts +28 -17
- package/src/navigation.ts +4 -4
- package/src/plid.ts +6 -6
- package/src/pool/entry.ts +1 -1
- package/src/pool/index.ts +3 -3
- package/src/pool/query.ts +52 -56
- package/src/pool/spec.ts +20 -17
- package/src/ref.ts +25 -19
- package/src/utag.ts +1 -1
- package/src/util.ts +1 -1
- package/src/value_or_error.ts +6 -6
|
@@ -1,8 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
canonicalizeJson,
|
|
3
|
-
parseJson,
|
|
4
|
-
type CanonicalizedJson,
|
|
5
|
-
} from '../../json';
|
|
1
|
+
import { canonicalizeJson, parseJson, type CanonicalizedJson } from "../../json";
|
|
6
2
|
import {
|
|
7
3
|
Annotation,
|
|
8
4
|
readAnnotationJson,
|
|
@@ -14,7 +10,7 @@ import {
|
|
|
14
10
|
getNormalizedAxesList,
|
|
15
11
|
getArrayFromAxisTree,
|
|
16
12
|
getAxesTree,
|
|
17
|
-
} from
|
|
13
|
+
} from "./spec/spec";
|
|
18
14
|
|
|
19
15
|
type LinkerKey = CanonicalizedJson<AxisId[]>;
|
|
20
16
|
export type CompositeLinkerMap = Map<
|
|
@@ -46,7 +42,9 @@ export class LinkerMap implements LinkersData {
|
|
|
46
42
|
|
|
47
43
|
static fromColumns(columns: PColumnIdAndSpec[]) {
|
|
48
44
|
const result: CompositeLinkerMap = new Map();
|
|
49
|
-
for (const linker of columns.filter(
|
|
45
|
+
for (const linker of columns.filter(
|
|
46
|
+
(l) => !!readAnnotationJson(l.spec, Annotation.IsLinkerColumn),
|
|
47
|
+
)) {
|
|
50
48
|
const groups = LinkerMap.getAxesGroups(getNormalizedAxesList(linker.spec.axesSpec)); // split input axes into groups by parent links from annotation
|
|
51
49
|
|
|
52
50
|
if (groups.length !== 2) {
|
|
@@ -63,12 +61,16 @@ export class LinkerMap implements LinkersData {
|
|
|
63
61
|
// \_ B _ D
|
|
64
62
|
// and
|
|
65
63
|
// E - B - D
|
|
66
|
-
const leftKeyVariants: [LinkerKey, AxisSpecNormalized[]][] = LinkerMap.getAxesRoots(left).map(
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
64
|
+
const leftKeyVariants: [LinkerKey, AxisSpecNormalized[]][] = LinkerMap.getAxesRoots(left).map(
|
|
65
|
+
(axis) => {
|
|
66
|
+
const axes = getArrayFromAxisTree(getAxesTree(axis));
|
|
67
|
+
const key = canonicalizeJson(axes.map(getAxisId));
|
|
68
|
+
return [key, axes];
|
|
69
|
+
},
|
|
70
|
+
);
|
|
71
|
+
const rightKeyVariants: [LinkerKey, AxisSpecNormalized[]][] = LinkerMap.getAxesRoots(
|
|
72
|
+
right,
|
|
73
|
+
).map((axis) => {
|
|
72
74
|
const axes = getArrayFromAxisTree(getAxesTree(axis));
|
|
73
75
|
const key = canonicalizeJson(axes.map(getAxisId));
|
|
74
76
|
return [key, axes];
|
|
@@ -157,7 +159,7 @@ export class LinkerMap implements LinkersData {
|
|
|
157
159
|
to: AxisSpecNormalized[];
|
|
158
160
|
throwWhenNoLinkExists?: boolean;
|
|
159
161
|
}): PColumnIdAndSpec[] {
|
|
160
|
-
|
|
162
|
+
// start keys - all possible keys in linker map using sourceAxes (for example, all axes of block's columns or all axes of columns in data-inputs)
|
|
161
163
|
const startKeys: LinkerKey[] = sourceAxes.map(LinkerMap.getLinkerKeyFromAxisSpec);
|
|
162
164
|
|
|
163
165
|
return Array.from(
|
|
@@ -167,8 +169,13 @@ export class LinkerMap implements LinkersData {
|
|
|
167
169
|
.flatMap((targetKey) => {
|
|
168
170
|
const linkers = startKeys
|
|
169
171
|
.map((startKey) => this.searchLinkerPath(startKey, targetKey))
|
|
170
|
-
.reduce(
|
|
171
|
-
|
|
172
|
+
.reduce(
|
|
173
|
+
(shortestPath, path) =>
|
|
174
|
+
(shortestPath.length && shortestPath.length < path.length) || !path.length
|
|
175
|
+
? shortestPath
|
|
176
|
+
: path,
|
|
177
|
+
[] as PColumnIdAndSpec[],
|
|
178
|
+
)
|
|
172
179
|
.map((linker) => [linker.columnId, linker] as const);
|
|
173
180
|
if (!linkers.length && throwWhenNoLinkExists) {
|
|
174
181
|
throw Error(`Unable to find linker column for ${targetKey}`);
|
|
@@ -183,7 +190,8 @@ export class LinkerMap implements LinkersData {
|
|
|
183
190
|
getAxesListFromKeysList(keys: LinkerKey[]): AxisSpecNormalized[] {
|
|
184
191
|
return Array.from(
|
|
185
192
|
new Map(
|
|
186
|
-
keys
|
|
193
|
+
keys
|
|
194
|
+
.flatMap((key) => this.data.get(key)?.keyAxesSpec ?? [])
|
|
187
195
|
.map((axis) => [canonicalizeJson(getAxisId(axis)), axis]),
|
|
188
196
|
).values(),
|
|
189
197
|
);
|
|
@@ -205,7 +213,12 @@ export class LinkerMap implements LinkersData {
|
|
|
205
213
|
const targetKey = targetKeys[idx];
|
|
206
214
|
return !startKeys.some((startKey) => this.searchLinkerPath(startKey, targetKey).length);
|
|
207
215
|
})
|
|
208
|
-
.flatMap((axis) =>
|
|
216
|
+
.flatMap((axis) =>
|
|
217
|
+
getArrayFromAxisTree(getAxesTree(axis)).map((axis) => [
|
|
218
|
+
canonicalizeJson(getAxisId(axis)),
|
|
219
|
+
axis,
|
|
220
|
+
]),
|
|
221
|
+
),
|
|
209
222
|
).values(),
|
|
210
223
|
);
|
|
211
224
|
return axes;
|
|
@@ -219,11 +232,13 @@ export class LinkerMap implements LinkersData {
|
|
|
219
232
|
let startKeys: CanonicalizedJson<AxisId[]>[] = [];
|
|
220
233
|
|
|
221
234
|
if (matchAxisIdFn) {
|
|
222
|
-
const sourceAxisIdsGrouped: AxisId[][] = sourceAxes.map((axis) =>
|
|
235
|
+
const sourceAxisIdsGrouped: AxisId[][] = sourceAxes.map((axis) =>
|
|
236
|
+
getArrayFromAxisTree(getAxesTree(axis)).map(getAxisId),
|
|
237
|
+
);
|
|
223
238
|
for (const sourceAxisIdsGroup of sourceAxisIdsGrouped) {
|
|
224
|
-
const matched = this.keyAxesIds.find(
|
|
225
|
-
(
|
|
226
|
-
|
|
239
|
+
const matched = this.keyAxesIds.find((keyIds: AxisId[]) =>
|
|
240
|
+
keyIds.every((linkerKeyAxisId) =>
|
|
241
|
+
sourceAxisIdsGroup.find((sourceAxisId) => matchAxisIdFn(linkerKeyAxisId, sourceAxisId)),
|
|
227
242
|
),
|
|
228
243
|
);
|
|
229
244
|
if (matched) {
|
|
@@ -242,7 +257,10 @@ export class LinkerMap implements LinkersData {
|
|
|
242
257
|
sourceAxes: AxisSpec[],
|
|
243
258
|
matchAxisIdFn?: (axisIdOfLinker: AxisId, axisIdOfSource: AxisId) => boolean,
|
|
244
259
|
): AxisSpecNormalized[] {
|
|
245
|
-
return this.getReachableByLinkersAxesFromAxesNormalized(
|
|
260
|
+
return this.getReachableByLinkersAxesFromAxesNormalized(
|
|
261
|
+
getNormalizedAxesList(sourceAxes),
|
|
262
|
+
matchAxisIdFn,
|
|
263
|
+
);
|
|
246
264
|
}
|
|
247
265
|
|
|
248
266
|
static getLinkerKeyFromAxisSpec(axis: AxisSpecNormalized): LinkerKey {
|
|
@@ -253,24 +271,30 @@ export class LinkerMap implements LinkersData {
|
|
|
253
271
|
There are no order inside every group. */
|
|
254
272
|
static getAxesGroups(axesSpec: AxisSpecNormalized[]): AxisSpecNormalized[][] {
|
|
255
273
|
switch (axesSpec.length) {
|
|
256
|
-
case 0:
|
|
257
|
-
|
|
258
|
-
|
|
274
|
+
case 0:
|
|
275
|
+
return [];
|
|
276
|
+
case 1:
|
|
277
|
+
return [[axesSpec[0]]];
|
|
278
|
+
default:
|
|
279
|
+
break;
|
|
259
280
|
}
|
|
260
281
|
|
|
261
282
|
const axisKeys = axesSpec.map((spec) => canonicalizeJson(getAxisId(spec)));
|
|
262
283
|
const axisParentsIdxs = axesSpec.map(
|
|
263
|
-
(spec) =>
|
|
264
|
-
|
|
265
|
-
.
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
284
|
+
(spec) =>
|
|
285
|
+
new Set(
|
|
286
|
+
spec.parentAxesSpec
|
|
287
|
+
.map((spec) => canonicalizeJson(getAxisId(spec)))
|
|
288
|
+
.map((el) => {
|
|
289
|
+
const idx = axisKeys.indexOf(el);
|
|
290
|
+
if (idx === -1) {
|
|
291
|
+
throw new Error(
|
|
292
|
+
`malformed axesSpec: ${JSON.stringify(axesSpec)}, unable to locate parent ${el}`,
|
|
293
|
+
);
|
|
294
|
+
}
|
|
295
|
+
return idx;
|
|
296
|
+
}),
|
|
297
|
+
),
|
|
274
298
|
);
|
|
275
299
|
|
|
276
300
|
const allIdxs = [...axesSpec.keys()];
|
|
@@ -304,14 +328,16 @@ export class LinkerMap implements LinkersData {
|
|
|
304
328
|
|
|
305
329
|
groups.push([...currentGroup]);
|
|
306
330
|
nextFreeEl = allIdxs.find((idx) => !usedIdxs.has(idx));
|
|
307
|
-
}
|
|
331
|
+
}
|
|
308
332
|
|
|
309
333
|
return groups.map((group) => group.map((idx) => axesSpec[idx]));
|
|
310
334
|
}
|
|
311
335
|
|
|
312
336
|
/** Get all axes that are not parents of any other axis */
|
|
313
337
|
static getAxesRoots(axes: AxisSpecNormalized[]): AxisSpecNormalized[] {
|
|
314
|
-
const parentsSet = new Set(
|
|
338
|
+
const parentsSet = new Set(
|
|
339
|
+
axes.flatMap((axis) => axis.parentAxesSpec).map((spec) => canonicalizeJson(getAxisId(spec))),
|
|
340
|
+
);
|
|
315
341
|
return axes.filter((axis) => !parentsSet.has(canonicalizeJson(getAxisId(axis))));
|
|
316
342
|
}
|
|
317
343
|
}
|
|
@@ -1,12 +1,9 @@
|
|
|
1
|
-
import type { PObjectId } from
|
|
2
|
-
import type { TableRange } from
|
|
3
|
-
import type { FindColumnsRequest, FindColumnsResponse } from
|
|
4
|
-
import type { PColumnIdAndSpec, PColumnSpec } from
|
|
5
|
-
import type {
|
|
6
|
-
|
|
7
|
-
CalculateTableDataResponse,
|
|
8
|
-
} from './table_calculate';
|
|
9
|
-
import type { UniqueValuesRequest, UniqueValuesResponse } from './unique_values';
|
|
1
|
+
import type { PObjectId } from "../../pool";
|
|
2
|
+
import type { TableRange } from "./data_types";
|
|
3
|
+
import type { FindColumnsRequest, FindColumnsResponse } from "./find_columns";
|
|
4
|
+
import type { PColumnIdAndSpec, PColumnSpec } from "./spec/spec";
|
|
5
|
+
import type { CalculateTableDataRequest, CalculateTableDataResponse } from "./table_calculate";
|
|
6
|
+
import type { UniqueValuesRequest, UniqueValuesResponse } from "./unique_values";
|
|
10
7
|
|
|
11
8
|
/** Read interface exposed by PFrames library */
|
|
12
9
|
export interface PFrame {
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export * from
|
|
2
|
-
export * from
|
|
1
|
+
export * from "./query_spec";
|
|
2
|
+
export * from "./query_data";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type { PObjectId } from
|
|
2
|
-
import type { JsonDataInfo } from
|
|
3
|
-
import type { AxisValueType, ColumnValueType } from
|
|
1
|
+
import type { PObjectId } from "../../../pool";
|
|
2
|
+
import type { JsonDataInfo } from "../data_info";
|
|
3
|
+
import type { AxisValueType, ColumnValueType } from "../spec";
|
|
4
4
|
|
|
5
5
|
// ============ Type Spec Types ============
|
|
6
6
|
|
|
@@ -37,7 +37,17 @@ export type TypeSpec = {
|
|
|
37
37
|
* - `exp` - Exponential function (e^x)
|
|
38
38
|
* - `negate` - Negation (-x)
|
|
39
39
|
*/
|
|
40
|
-
export type NumericUnaryOperand =
|
|
40
|
+
export type NumericUnaryOperand =
|
|
41
|
+
| "abs"
|
|
42
|
+
| "ceil"
|
|
43
|
+
| "floor"
|
|
44
|
+
| "round"
|
|
45
|
+
| "sqrt"
|
|
46
|
+
| "log"
|
|
47
|
+
| "log2"
|
|
48
|
+
| "log10"
|
|
49
|
+
| "exp"
|
|
50
|
+
| "negate";
|
|
41
51
|
|
|
42
52
|
/**
|
|
43
53
|
* Binary mathematical operation kinds.
|
|
@@ -52,7 +62,7 @@ export type NumericUnaryOperand = 'abs' | 'ceil' | 'floor' | 'round' | 'sqrt' |
|
|
|
52
62
|
* - `div` - Division: left / right (division by zero returns Infinity or NaN)
|
|
53
63
|
* - `mod` - Modulo: left % right
|
|
54
64
|
*/
|
|
55
|
-
export type NumericBinaryOperand =
|
|
65
|
+
export type NumericBinaryOperand = "add" | "sub" | "mul" | "div" | "mod";
|
|
56
66
|
|
|
57
67
|
/**
|
|
58
68
|
* Numeric comparison operation kinds.
|
|
@@ -68,7 +78,7 @@ export type NumericBinaryOperand = 'add' | 'sub' | 'mul' | 'div' | 'mod';
|
|
|
68
78
|
* - `gt` - Greater than: left > right
|
|
69
79
|
* - `ge` - Greater or equal: left >= right
|
|
70
80
|
*/
|
|
71
|
-
export type NumericComparisonOperand =
|
|
81
|
+
export type NumericComparisonOperand = "eq" | "ne" | "lt" | "le" | "gt" | "ge";
|
|
72
82
|
|
|
73
83
|
// ============ Geometric Types ============
|
|
74
84
|
|
|
@@ -103,7 +113,7 @@ export type Point2D = {
|
|
|
103
113
|
* { type: 'constant', value: true }
|
|
104
114
|
*/
|
|
105
115
|
export type ExprConstant = {
|
|
106
|
-
type:
|
|
116
|
+
type: "constant";
|
|
107
117
|
value: string | number | boolean;
|
|
108
118
|
};
|
|
109
119
|
|
|
@@ -130,7 +140,7 @@ export type ExprConstant = {
|
|
|
130
140
|
* @see NumericUnaryOperand for available operations
|
|
131
141
|
*/
|
|
132
142
|
export interface ExprNumericUnary<I> {
|
|
133
|
-
type:
|
|
143
|
+
type: "numericUnary";
|
|
134
144
|
/** The mathematical operation to apply */
|
|
135
145
|
operand: NumericUnaryOperand;
|
|
136
146
|
/** Input expression (must evaluate to numeric) */
|
|
@@ -157,7 +167,7 @@ export interface ExprNumericUnary<I> {
|
|
|
157
167
|
* @see NumericBinaryOperand for available operations
|
|
158
168
|
*/
|
|
159
169
|
export interface ExprNumericBinary<I> {
|
|
160
|
-
type:
|
|
170
|
+
type: "numericBinary";
|
|
161
171
|
/** The arithmetic operation to apply */
|
|
162
172
|
operand: NumericBinaryOperand;
|
|
163
173
|
/** Left operand expression */
|
|
@@ -192,7 +202,7 @@ export interface ExprNumericBinary<I> {
|
|
|
192
202
|
* @see NumericComparisonOperand for available operations
|
|
193
203
|
*/
|
|
194
204
|
export interface ExprNumericComparison<I> {
|
|
195
|
-
type:
|
|
205
|
+
type: "numericComparison";
|
|
196
206
|
/** The comparison operation to apply */
|
|
197
207
|
operand: NumericComparisonOperand;
|
|
198
208
|
/** Left operand expression */
|
|
@@ -222,7 +232,7 @@ export interface ExprNumericComparison<I> {
|
|
|
222
232
|
* { type: 'stringEquals', input: nameColumn, value: 'John', caseInsensitive: true }
|
|
223
233
|
*/
|
|
224
234
|
export interface ExprStringEquals<I> {
|
|
225
|
-
type:
|
|
235
|
+
type: "stringEquals";
|
|
226
236
|
/** Input expression (must evaluate to string) */
|
|
227
237
|
input: I;
|
|
228
238
|
/** Reference string to compare against */
|
|
@@ -251,7 +261,7 @@ export interface ExprStringEquals<I> {
|
|
|
251
261
|
* @see {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_expressions | MDN Regular Expressions Guide}
|
|
252
262
|
*/
|
|
253
263
|
export interface ExprStringRegex<I> {
|
|
254
|
-
type:
|
|
264
|
+
type: "stringRegex";
|
|
255
265
|
/** Input expression (must evaluate to string) */
|
|
256
266
|
input: I;
|
|
257
267
|
/** Regular expression pattern */
|
|
@@ -276,7 +286,7 @@ export interface ExprStringRegex<I> {
|
|
|
276
286
|
* { type: 'stringContains', input: descColumn, value: 'ERROR', caseInsensitive: true }
|
|
277
287
|
*/
|
|
278
288
|
export interface ExprStringContains<I> {
|
|
279
|
-
type:
|
|
289
|
+
type: "stringContains";
|
|
280
290
|
/** Input expression (must evaluate to string) */
|
|
281
291
|
input: I;
|
|
282
292
|
/** Substring to search for */
|
|
@@ -320,7 +330,7 @@ export interface ExprStringContains<I> {
|
|
|
320
330
|
* }
|
|
321
331
|
*/
|
|
322
332
|
export interface ExprStringContainsFuzzy<I> {
|
|
323
|
-
type:
|
|
333
|
+
type: "stringContainsFuzzy";
|
|
324
334
|
/** Input expression (must evaluate to string) */
|
|
325
335
|
input: I;
|
|
326
336
|
/** Pattern to match against */
|
|
@@ -360,7 +370,7 @@ export interface ExprStringContainsFuzzy<I> {
|
|
|
360
370
|
* { type: 'not', input: comparisonExpr }
|
|
361
371
|
*/
|
|
362
372
|
export interface ExprLogicalUnary<I> {
|
|
363
|
-
type:
|
|
373
|
+
type: "not";
|
|
364
374
|
/** Input boolean expression to negate */
|
|
365
375
|
input: I;
|
|
366
376
|
}
|
|
@@ -387,7 +397,7 @@ export interface ExprLogicalUnary<I> {
|
|
|
387
397
|
*/
|
|
388
398
|
export interface ExprLogicalVariadic<I> {
|
|
389
399
|
/** Logical operation: 'and' or 'or' */
|
|
390
|
-
type:
|
|
400
|
+
type: "and" | "or";
|
|
391
401
|
/** Array of boolean expressions to combine (minimum 2 elements) */
|
|
392
402
|
input: I[];
|
|
393
403
|
}
|
|
@@ -412,7 +422,7 @@ export interface ExprLogicalVariadic<I> {
|
|
|
412
422
|
* }
|
|
413
423
|
*/
|
|
414
424
|
export interface ExprIsIn<I, T extends string | number> {
|
|
415
|
-
type:
|
|
425
|
+
type: "isIn";
|
|
416
426
|
/** Input expression to test */
|
|
417
427
|
input: I;
|
|
418
428
|
/** Set of allowed values */
|
|
@@ -437,7 +447,7 @@ export interface ExprIsIn<I, T extends string | number> {
|
|
|
437
447
|
* { type: 'axisRef', value: 0 }
|
|
438
448
|
*/
|
|
439
449
|
export interface ExprAxisRef<A> {
|
|
440
|
-
type:
|
|
450
|
+
type: "axisRef";
|
|
441
451
|
/** Axis identifier (selector or index depending on context) */
|
|
442
452
|
value: A;
|
|
443
453
|
}
|
|
@@ -458,20 +468,20 @@ export interface ExprAxisRef<A> {
|
|
|
458
468
|
* { type: 'columnRef', value: 0 }
|
|
459
469
|
*/
|
|
460
470
|
export interface ExprColumnRef<C> {
|
|
461
|
-
type:
|
|
471
|
+
type: "columnRef";
|
|
462
472
|
/** Column identifier (ID or index depending on context) */
|
|
463
473
|
value: C;
|
|
464
474
|
}
|
|
465
475
|
|
|
466
476
|
export type InferBooleanExpressionUnion<E> = [
|
|
467
|
-
E extends ExprNumericComparison<unknown> ? Extract<E, { type:
|
|
468
|
-
E extends ExprStringEquals<unknown> ? Extract<E, { type:
|
|
469
|
-
E extends ExprStringContains<unknown> ? Extract<E, { type:
|
|
470
|
-
E extends ExprStringContainsFuzzy<unknown> ? Extract<E, { type:
|
|
471
|
-
E extends ExprStringRegex<unknown> ? Extract<E, { type:
|
|
472
|
-
E extends ExprLogicalUnary<unknown> ? Extract<E, { type:
|
|
473
|
-
E extends ExprLogicalVariadic<unknown> ? Extract<E, { type:
|
|
474
|
-
E extends ExprIsIn<unknown, string | number> ? Extract<E, { type:
|
|
477
|
+
E extends ExprNumericComparison<unknown> ? Extract<E, { type: "numericComparison" }> : never,
|
|
478
|
+
E extends ExprStringEquals<unknown> ? Extract<E, { type: "stringEquals" }> : never,
|
|
479
|
+
E extends ExprStringContains<unknown> ? Extract<E, { type: "stringContains" }> : never,
|
|
480
|
+
E extends ExprStringContainsFuzzy<unknown> ? Extract<E, { type: "stringContainsFuzzy" }> : never,
|
|
481
|
+
E extends ExprStringRegex<unknown> ? Extract<E, { type: "stringRegex" }> : never,
|
|
482
|
+
E extends ExprLogicalUnary<unknown> ? Extract<E, { type: "not" }> : never,
|
|
483
|
+
E extends ExprLogicalVariadic<unknown> ? Extract<E, { type: "and" | "or" }> : never,
|
|
484
|
+
E extends ExprIsIn<unknown, string | number> ? Extract<E, { type: "isIn" }> : never,
|
|
475
485
|
][number];
|
|
476
486
|
|
|
477
487
|
// ============ Generic Query Types ============
|
|
@@ -496,7 +506,7 @@ export type InferBooleanExpressionUnion<E> = [
|
|
|
496
506
|
* { type: 'axis', id: 0 }
|
|
497
507
|
*/
|
|
498
508
|
export interface QueryAxisSelector<A> {
|
|
499
|
-
type:
|
|
509
|
+
type: "axis";
|
|
500
510
|
/** Axis identifier (name or index depending on context) */
|
|
501
511
|
id: A;
|
|
502
512
|
}
|
|
@@ -519,7 +529,7 @@ export interface QueryAxisSelector<A> {
|
|
|
519
529
|
* { type: 'column', id: 0 }
|
|
520
530
|
*/
|
|
521
531
|
export interface QueryColumnSelector<C> {
|
|
522
|
-
type:
|
|
532
|
+
type: "column";
|
|
523
533
|
/** Column identifier (name or index depending on context) */
|
|
524
534
|
id: C;
|
|
525
535
|
}
|
|
@@ -551,7 +561,7 @@ export interface QueryColumnSelector<C> {
|
|
|
551
561
|
* // Result has all samples; annotations/metadata are null where not available
|
|
552
562
|
*/
|
|
553
563
|
export interface QueryOuterJoin<JE extends QueryJoinEntry<unknown>> {
|
|
554
|
-
type:
|
|
564
|
+
type: "outerJoin";
|
|
555
565
|
/** Primary query - all its records are preserved */
|
|
556
566
|
primary: JE;
|
|
557
567
|
/** Secondary queries - joined where keys match, null where they don't */
|
|
@@ -584,7 +594,7 @@ export interface QueryOuterJoin<JE extends QueryJoinEntry<unknown>> {
|
|
|
584
594
|
* }
|
|
585
595
|
*/
|
|
586
596
|
export interface QuerySliceAxes<Q, A extends QueryAxisSelector<unknown>> {
|
|
587
|
-
type:
|
|
597
|
+
type: "sliceAxes";
|
|
588
598
|
/** Input query to slice */
|
|
589
599
|
input: Q;
|
|
590
600
|
/** List of axis filters to apply (at least one required) */
|
|
@@ -617,18 +627,18 @@ export interface QuerySliceAxes<Q, A extends QueryAxisSelector<unknown>> {
|
|
|
617
627
|
* type: 'sort',
|
|
618
628
|
* input: dataQuery,
|
|
619
629
|
* sortBy: [
|
|
620
|
-
* {
|
|
621
|
-
* {
|
|
630
|
+
* { expression: { type: 'columnRef', value: 'score' }, ascending: false, nullsFirst: null },
|
|
631
|
+
* { expression: { type: 'axisRef', value: { name: 'name' } }, ascending: true, nullsFirst: null }
|
|
622
632
|
* ]
|
|
623
633
|
* }
|
|
624
634
|
*/
|
|
625
635
|
export interface QuerySort<Q, E> {
|
|
626
|
-
type:
|
|
636
|
+
type: "sort";
|
|
627
637
|
/** Input query to sort */
|
|
628
638
|
input: Q;
|
|
629
639
|
/** Sort criteria in priority order (at least one required) */
|
|
630
640
|
sortBy: {
|
|
631
|
-
|
|
641
|
+
expression: E;
|
|
632
642
|
/** If true, sort ascending (A-Z, 0-9); if false, descending */
|
|
633
643
|
ascending: boolean;
|
|
634
644
|
/**
|
|
@@ -674,7 +684,7 @@ export interface QuerySort<Q, E> {
|
|
|
674
684
|
* }
|
|
675
685
|
*/
|
|
676
686
|
export interface QueryFilter<Q, E> {
|
|
677
|
-
type:
|
|
687
|
+
type: "filter";
|
|
678
688
|
/** Input query to filter */
|
|
679
689
|
input: Q;
|
|
680
690
|
/** Boolean predicate expression - only true records pass */
|
|
@@ -695,7 +705,7 @@ export interface QueryFilter<Q, E> {
|
|
|
695
705
|
* { type: 'column', columnId: 'col_abc123' }
|
|
696
706
|
*/
|
|
697
707
|
export interface QueryColumn {
|
|
698
|
-
type:
|
|
708
|
+
type: "column";
|
|
699
709
|
/** Unique identifier of the column to reference */
|
|
700
710
|
columnId: PObjectId;
|
|
701
711
|
}
|
|
@@ -720,7 +730,7 @@ export interface QueryColumn {
|
|
|
720
730
|
* }
|
|
721
731
|
*/
|
|
722
732
|
export interface QueryInlineColumn<T> {
|
|
723
|
-
type:
|
|
733
|
+
type: "inlineColumn";
|
|
724
734
|
/** Type specification defining axes and column types */
|
|
725
735
|
spec: T;
|
|
726
736
|
/** Data information containing or referencing the actual values */
|
|
@@ -753,7 +763,7 @@ export interface QueryInlineColumn<T> {
|
|
|
753
763
|
* }
|
|
754
764
|
*/
|
|
755
765
|
export interface QuerySparseToDenseColumn<SO> {
|
|
756
|
-
type:
|
|
766
|
+
type: "sparseToDenseColumn";
|
|
757
767
|
/** ID of the column to cross-join */
|
|
758
768
|
columnId: PObjectId;
|
|
759
769
|
/** Optional override for the column specification */
|
|
@@ -797,7 +807,7 @@ export interface QuerySparseToDenseColumn<SO> {
|
|
|
797
807
|
*/
|
|
798
808
|
export interface QuerySymmetricJoin<JE extends QueryJoinEntry<unknown>> {
|
|
799
809
|
/** 'innerJoin' for intersection, 'fullJoin' for union with nulls */
|
|
800
|
-
type:
|
|
810
|
+
type: "innerJoin" | "fullJoin";
|
|
801
811
|
/** Queries to join (at least one required) */
|
|
802
812
|
entries: JE[];
|
|
803
813
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { PObjectId } from
|
|
1
|
+
import type { PObjectId } from "../../../pool";
|
|
2
2
|
import type {
|
|
3
3
|
ExprAxisRef,
|
|
4
4
|
ExprColumnRef,
|
|
@@ -13,7 +13,8 @@ import type {
|
|
|
13
13
|
ExprStringRegex,
|
|
14
14
|
ExprNumericUnary,
|
|
15
15
|
QueryAxisSelector,
|
|
16
|
-
QueryColumn,
|
|
16
|
+
QueryColumn,
|
|
17
|
+
QuerySparseToDenseColumn,
|
|
17
18
|
QueryFilter,
|
|
18
19
|
QueryInlineColumn,
|
|
19
20
|
QueryJoinEntry,
|
|
@@ -23,7 +24,7 @@ import type {
|
|
|
23
24
|
QuerySymmetricJoin,
|
|
24
25
|
TypeSpec,
|
|
25
26
|
InferBooleanExpressionUnion,
|
|
26
|
-
} from
|
|
27
|
+
} from "./query_common";
|
|
27
28
|
|
|
28
29
|
/**
|
|
29
30
|
* Column identifier with type specification.
|
|
@@ -99,12 +100,18 @@ export type ExprAxisRefData = ExprAxisRef<number>;
|
|
|
99
100
|
export type ExprColumnRefData = ExprColumnRef<number>;
|
|
100
101
|
|
|
101
102
|
export type QueryExpressionData =
|
|
102
|
-
| ExprColumnRefData
|
|
103
|
-
|
|
|
104
|
-
|
|
|
105
|
-
|
|
|
106
|
-
|
|
|
107
|
-
|
|
|
108
|
-
|
|
103
|
+
| ExprColumnRefData
|
|
104
|
+
| ExprAxisRefData
|
|
105
|
+
| ExprConstant
|
|
106
|
+
| ExprNumericBinary<QueryExpressionData>
|
|
107
|
+
| ExprNumericUnary<QueryExpressionData>
|
|
108
|
+
| ExprStringEquals<QueryExpressionData>
|
|
109
|
+
| ExprStringContains<QueryExpressionData>
|
|
110
|
+
| ExprStringRegex<QueryExpressionData>
|
|
111
|
+
| ExprStringContainsFuzzy<QueryExpressionData>
|
|
112
|
+
| ExprLogicalUnary<QueryExpressionData>
|
|
113
|
+
| ExprLogicalVariadic<QueryExpressionData>
|
|
114
|
+
| ExprIsIn<QueryExpressionData, string>
|
|
115
|
+
| ExprIsIn<QueryExpressionData, number>;
|
|
109
116
|
|
|
110
117
|
export type QueryBooleanExpressionData = InferBooleanExpressionUnion<QueryExpressionData>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { PObjectId } from
|
|
1
|
+
import type { PObjectId } from "../../../pool";
|
|
2
2
|
import type {
|
|
3
3
|
ExprAxisRef,
|
|
4
4
|
ExprColumnRef,
|
|
@@ -13,7 +13,8 @@ import type {
|
|
|
13
13
|
ExprStringRegex,
|
|
14
14
|
ExprNumericUnary,
|
|
15
15
|
QueryAxisSelector,
|
|
16
|
-
QueryColumn,
|
|
16
|
+
QueryColumn,
|
|
17
|
+
QuerySparseToDenseColumn,
|
|
17
18
|
QueryFilter,
|
|
18
19
|
QueryInlineColumn,
|
|
19
20
|
QueryJoinEntry,
|
|
@@ -22,8 +23,8 @@ import type {
|
|
|
22
23
|
QuerySort,
|
|
23
24
|
QuerySymmetricJoin,
|
|
24
25
|
InferBooleanExpressionUnion,
|
|
25
|
-
} from
|
|
26
|
-
import type { Domain, PColumnIdAndSpec, PColumnSpec, SingleAxisSelector } from
|
|
26
|
+
} from "./query_common";
|
|
27
|
+
import type { Domain, PColumnIdAndSpec, PColumnSpec, SingleAxisSelector } from "../spec";
|
|
27
28
|
|
|
28
29
|
/**
|
|
29
30
|
* Column identifier with specification.
|
|
@@ -108,11 +109,18 @@ export type ExprAxisRefSpec = ExprAxisRef<SingleAxisSelector>;
|
|
|
108
109
|
export type ExprColumnRefSpec = ExprColumnRef<PObjectId>;
|
|
109
110
|
|
|
110
111
|
export type QueryExpressionSpec =
|
|
111
|
-
| ExprColumnRefSpec
|
|
112
|
-
|
|
|
113
|
-
|
|
|
114
|
-
|
|
|
115
|
-
|
|
|
116
|
-
|
|
|
112
|
+
| ExprColumnRefSpec
|
|
113
|
+
| ExprAxisRefSpec
|
|
114
|
+
| ExprConstant
|
|
115
|
+
| ExprNumericBinary<QueryExpressionSpec>
|
|
116
|
+
| ExprNumericUnary<QueryExpressionSpec>
|
|
117
|
+
| ExprStringEquals<QueryExpressionSpec>
|
|
118
|
+
| ExprStringContains<QueryExpressionSpec>
|
|
119
|
+
| ExprStringRegex<QueryExpressionSpec>
|
|
120
|
+
| ExprStringContainsFuzzy<QueryExpressionSpec>
|
|
121
|
+
| ExprLogicalUnary<QueryExpressionSpec>
|
|
122
|
+
| ExprLogicalVariadic<QueryExpressionSpec>
|
|
123
|
+
| ExprIsIn<QueryExpressionSpec, string>
|
|
124
|
+
| ExprIsIn<QueryExpressionSpec, number>;
|
|
117
125
|
|
|
118
126
|
export type QueryBooleanExpressionSpec = InferBooleanExpressionUnion<QueryExpressionSpec>;
|