@milaboratories/pl-model-middle-layer 1.16.4 → 1.17.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.
- package/dist/pframe/internal_api/api_wasm.d.ts +61 -12
- package/dist/pframe/internal_api/api_wasm.d.ts.map +1 -1
- package/dist/pframe/internal_api/discover_columns.d.ts +10 -5
- package/dist/pframe/internal_api/discover_columns.d.ts.map +1 -1
- package/dist/pframe/internal_api/index.d.ts +3 -3
- package/package.json +4 -4
- package/src/pframe/internal_api/api_wasm.ts +72 -10
- package/src/pframe/internal_api/discover_columns.ts +9 -5
|
@@ -1,21 +1,23 @@
|
|
|
1
1
|
import { FindColumnsRequest, FindColumnsResponse } from "./find_columns.js";
|
|
2
2
|
import { DeleteColumnFromColumnsRequest, DeleteColumnFromColumnsResponse } from "./delete_column.js";
|
|
3
3
|
import { DiscoverColumnsRequestV2, DiscoverColumnsResponse } from "./discover_columns.js";
|
|
4
|
-
import { AxesId, AxesSpec, DataQuery, JoinEntry, PColumnSpec, PObjectId, PTableColumnId, PTableColumnSpec, PTableRecordFilter, PTableSorting, SingleAxisSelector, SpecQuery } from "@milaboratories/pl-model-common";
|
|
4
|
+
import { AxesId, AxesSpec, BuildQueryInput, DataQuery, JoinEntry, PColumnSpec, PObjectId, PTableColumnId, PTableColumnSpec, PTableRecordFilter, PTableSorting, SingleAxisSelector, SpecQuery, SpecQueryJoinEntry } from "@milaboratories/pl-model-common";
|
|
5
5
|
|
|
6
6
|
//#region src/pframe/internal_api/api_wasm.d.ts
|
|
7
7
|
/**
|
|
8
|
-
*
|
|
8
|
+
* V3 PFrame interface: adds {@link PFrameWasmV3.buildQuery} on top of V2.
|
|
9
9
|
*/
|
|
10
|
-
interface
|
|
10
|
+
interface PFrameWasmV3 extends Disposable {
|
|
11
11
|
/**
|
|
12
12
|
* Deletes columns from a columns specification.
|
|
13
13
|
*/
|
|
14
14
|
deleteColumns(request: DeleteColumnFromColumnsRequest): DeleteColumnFromColumnsResponse;
|
|
15
15
|
/**
|
|
16
|
-
* Discovers columns compatible with a given axes integration
|
|
17
|
-
*
|
|
18
|
-
*
|
|
16
|
+
* Discovers columns compatible with a given axes integration. Include and
|
|
17
|
+
* exclude filters are applied in order (exclude removes matches from the
|
|
18
|
+
* include set). Each hit carries its traversal `path`; feed the hit's
|
|
19
|
+
* column id and `path` into {@link buildQuery} to materialize it as a
|
|
20
|
+
* {@link SpecQueryJoinEntry}.
|
|
19
21
|
*/
|
|
20
22
|
discoverColumns(request: DiscoverColumnsRequestV2): DiscoverColumnsResponse;
|
|
21
23
|
/**
|
|
@@ -30,15 +32,30 @@ interface PFrameWasmV2 extends Disposable {
|
|
|
30
32
|
* Rewrites a legacy query format (V4) to the current SpecQuery format.
|
|
31
33
|
*/
|
|
32
34
|
rewriteLegacyQuery(request: LegacyQuery): SpecQuery;
|
|
35
|
+
/**
|
|
36
|
+
* Assembles a {@link SpecQueryJoinEntry} from a terminal column plus an
|
|
37
|
+
* ordered path of wrapping steps (linker hops, filter joins).
|
|
38
|
+
*
|
|
39
|
+
* Right-fold over `path` starting from `Column(column)`: each `linker` step
|
|
40
|
+
* wraps the current subquery as `linkerJoin`, each `filter` step as
|
|
41
|
+
* `innerJoin` with the filter column. `qualifications` annotate the
|
|
42
|
+
* outermost entry only.
|
|
43
|
+
*
|
|
44
|
+
* Pure over its input — column ids are resolved later in
|
|
45
|
+
* {@link evaluateQuery}. Throws only on malformed input: shape violations
|
|
46
|
+
* and unknown step tags (so v1 callers are shielded from step variants
|
|
47
|
+
* added in later versions).
|
|
48
|
+
*/
|
|
49
|
+
buildQuery(input: BuildQueryInput): SpecQueryJoinEntry;
|
|
33
50
|
}
|
|
34
51
|
/**
|
|
35
|
-
*
|
|
52
|
+
* V3 PFrame API factory with createPFrame returning {@link PFrameWasmV3}.
|
|
36
53
|
*/
|
|
37
|
-
interface
|
|
54
|
+
interface PFrameWasmAPIV3 {
|
|
38
55
|
/**
|
|
39
|
-
* Creates a new
|
|
56
|
+
* Creates a new V3 PFrame from a map of column IDs to column specifications.
|
|
40
57
|
*/
|
|
41
|
-
createPFrame(spec: Record<string, PColumnSpec>):
|
|
58
|
+
createPFrame(spec: Record<string, PColumnSpec>): PFrameWasmV3;
|
|
42
59
|
/**
|
|
43
60
|
* Expands an {@link AxesSpec} into {@link AxesId}s with parent information
|
|
44
61
|
* resolved.
|
|
@@ -59,6 +76,38 @@ interface PFrameWasmAPIV2 {
|
|
|
59
76
|
*/
|
|
60
77
|
findTableColumn(tableSpec: PTableColumnSpec[], selector: PTableColumnId): number;
|
|
61
78
|
}
|
|
79
|
+
/**
|
|
80
|
+
* V2 PFrame interface. Superseded by {@link PFrameWasmV3}, which adds
|
|
81
|
+
* {@link PFrameWasmV3.buildQuery}. Will be removed in a future PFrames update.
|
|
82
|
+
*/
|
|
83
|
+
interface PFrameWasmV2 extends Disposable {
|
|
84
|
+
/** @see PFrameWasmV3.deleteColumns */
|
|
85
|
+
deleteColumns(request: DeleteColumnFromColumnsRequest): DeleteColumnFromColumnsResponse;
|
|
86
|
+
/** @see PFrameWasmV3.discoverColumns */
|
|
87
|
+
discoverColumns(request: DiscoverColumnsRequestV2): DiscoverColumnsResponse;
|
|
88
|
+
/** @see PFrameWasmV3.findColumns */
|
|
89
|
+
findColumns(request: FindColumnsRequest): FindColumnsResponse;
|
|
90
|
+
/** @see PFrameWasmV3.evaluateQuery */
|
|
91
|
+
evaluateQuery(request: SpecQuery): EvaluateQueryResponse;
|
|
92
|
+
/** @see PFrameWasmV3.rewriteLegacyQuery */
|
|
93
|
+
rewriteLegacyQuery(request: LegacyQuery): SpecQuery;
|
|
94
|
+
}
|
|
95
|
+
/**
|
|
96
|
+
* V2 PFrame API factory. Superseded by {@link PFrameWasmAPIV3}; will be removed
|
|
97
|
+
* in a future PFrames update.
|
|
98
|
+
*/
|
|
99
|
+
interface PFrameWasmAPIV2 {
|
|
100
|
+
/** @see PFrameWasmAPIV3.createPFrame */
|
|
101
|
+
createPFrame(spec: Record<string, PColumnSpec>): PFrameWasmV2;
|
|
102
|
+
/** @see PFrameWasmAPIV3.expandAxes */
|
|
103
|
+
expandAxes(spec: AxesSpec): AxesId;
|
|
104
|
+
/** @see PFrameWasmAPIV3.collapseAxes */
|
|
105
|
+
collapseAxes(ids: AxesId): AxesSpec;
|
|
106
|
+
/** @see PFrameWasmAPIV3.findAxis */
|
|
107
|
+
findAxis(spec: AxesSpec, selector: SingleAxisSelector): number;
|
|
108
|
+
/** @see PFrameWasmAPIV3.findTableColumn */
|
|
109
|
+
findTableColumn(tableSpec: PTableColumnSpec[], selector: PTableColumnId): number;
|
|
110
|
+
}
|
|
62
111
|
/**
|
|
63
112
|
* Response from evaluating a query against a PFrame.
|
|
64
113
|
*/
|
|
@@ -77,7 +126,7 @@ type EvaluateQueryResponse = {
|
|
|
77
126
|
/**
|
|
78
127
|
* Represents a legacy (V4) query format used before the unified SpecQuery.
|
|
79
128
|
*
|
|
80
|
-
* This type is used with {@link
|
|
129
|
+
* This type is used with {@link PFrameWasmV3.rewriteLegacyQuery} to upgrade
|
|
81
130
|
* older query structures to the current {@link SpecQuery} format.
|
|
82
131
|
*/
|
|
83
132
|
type LegacyQuery = {
|
|
@@ -86,5 +135,5 @@ type LegacyQuery = {
|
|
|
86
135
|
sorting?: PTableSorting[];
|
|
87
136
|
};
|
|
88
137
|
//#endregion
|
|
89
|
-
export { EvaluateQueryResponse, LegacyQuery, PFrameWasmAPIV2, PFrameWasmV2 };
|
|
138
|
+
export { EvaluateQueryResponse, LegacyQuery, PFrameWasmAPIV2, PFrameWasmAPIV3, PFrameWasmV2, PFrameWasmV3 };
|
|
90
139
|
//# sourceMappingURL=api_wasm.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"api_wasm.d.ts","names":[],"sources":["../../../src/pframe/internal_api/api_wasm.ts"],"mappings":";;;;;;;;
|
|
1
|
+
{"version":3,"file":"api_wasm.d.ts","names":[],"sources":["../../../src/pframe/internal_api/api_wasm.ts"],"mappings":";;;;;;;;AA0BA;UAAiB,YAAA,SAAqB,UAAA;;;;EAIpC,aAAA,CAAc,OAAA,EAAS,8BAAA,GAAiC,+BAAA;EASJ;;;;;;;EAApD,eAAA,CAAgB,OAAA,EAAS,wBAAA,GAA2B,uBAAA;EA+BhB;;;EA1BpC,WAAA,CAAY,OAAA,EAAS,kBAAA,GAAqB,mBAAA;EAlBN;;;EAuBpC,aAAA,CAAc,OAAA,EAAS,SAAA,GAAY,qBAAA;EAnBqB;;;EAwBxD,kBAAA,CAAmB,OAAA,EAAS,WAAA,GAAc,SAAA;EAfU;;;;;;;;;;;;;;EA+BpD,UAAA,CAAW,KAAA,EAAO,eAAA,GAAkB,kBAAA;AAAA;;;;UAMrB,eAAA;EAAe;;;EAI9B,YAAA,CAAa,IAAA,EAAM,MAAA,SAAe,WAAA,IAAe,YAAA;EAAA;;;;EAMjD,UAAA,CAAW,IAAA,EAAM,QAAA,GAAW,MAAA;EAWb;;;EANf,YAAA,CAAa,GAAA,EAAK,MAAA,GAAS,QAAA;EAY4C;;;;EANvE,QAAA,CAAS,IAAA,EAAM,QAAA,EAAU,QAAA,EAAU,kBAAA;EAjBtB;;;;EAuBb,eAAA,CAAgB,SAAA,EAAW,gBAAA,IAAoB,QAAA,EAAU,cAAA;AAAA;;;;;UAO1C,YAAA,SAAqB,UAAA;EAbrB;EAef,aAAA,CAAc,OAAA,EAAS,8BAAA,GAAiC,+BAAA;EAfrB;EAkBnC,eAAA,CAAgB,OAAA,EAAS,wBAAA,GAA2B,uBAAA;EAZpD;EAeA,WAAA,CAAY,OAAA,EAAS,kBAAA,GAAqB,mBAAA;EAf1B;EAkBhB,aAAA,CAAc,OAAA,EAAS,SAAA,GAAY,qBAAA;EAlBY;EAqB/C,kBAAA,CAAmB,OAAA,EAAS,WAAA,GAAc,SAAA;AAAA;AAd5C;;;;AAAA,UAqBiB,eAAA;EAhBU;EAkBzB,YAAA,CAAa,IAAA,EAAM,MAAA,SAAe,WAAA,IAAe,YAAA;EAf5B;EAkBrB,UAAA,CAAW,IAAA,EAAM,QAAA,GAAW,MAAA;EAfL;EAkBvB,YAAA,CAAa,GAAA,EAAK,MAAA,GAAS,QAAA;EAfC;EAkB5B,QAAA,CAAS,IAAA,EAAM,QAAA,EAAU,QAAA,EAAU,kBAAA;EAhCC;EAmCpC,eAAA,CAAgB,SAAA,EAAW,gBAAA,IAAoB,QAAA,EAAU,cAAA;AAAA;;;;KAM/C,qBAAA;EAvC8C;;;;EA4CxD,SAAA,EAAW,gBAAA;EAtCX;;;;EA2CA,SAAA,EAAW,SAAA;AAAA;;;;;;;KASD,WAAA;EA9CyC,0EAgDnD,GAAA,EAAK,SAAA,CAAU,SAAA,GAzCe;EA2C9B,OAAA,GAAU,kBAAA,IAzCwB;EA2ClC,OAAA,GAAU,aAAA;AAAA"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { AxisQualification, ColumnAxesWithQualifications } from "./common.js";
|
|
2
|
-
import { AxisValueType, ColumnValueType,
|
|
2
|
+
import { AxisValueType, ColumnValueType, DiscoverColumnsStepInfo, PColumnIdAndSpec } from "@milaboratories/pl-model-common";
|
|
3
3
|
|
|
4
4
|
//#region src/pframe/internal_api/discover_columns.d.ts
|
|
5
5
|
/** Matches a string value either exactly or by regex pattern */
|
|
@@ -81,20 +81,25 @@ interface DiscoverColumnsMappingVariant {
|
|
|
81
81
|
/** Distinctive (minimal) qualifications needed for integration */
|
|
82
82
|
distinctiveQualifications: DiscoverColumnsResponseQualifications;
|
|
83
83
|
}
|
|
84
|
-
/**
|
|
84
|
+
/**
|
|
85
|
+
* A single hit in the discover columns response. Carries the matched column
|
|
86
|
+
* along with its integration metadata and the path traversed to reach it.
|
|
87
|
+
* To materialize the hit as an executable query, feed `hit.columnId` and
|
|
88
|
+
* `path` into the PFrame's `buildQuery`.
|
|
89
|
+
*/
|
|
85
90
|
interface DiscoverColumnsResponseHit {
|
|
86
91
|
/** The column that was found compatible */
|
|
87
92
|
hit: PColumnIdAndSpec;
|
|
88
93
|
/** Possible ways to integrate this column with the existing set */
|
|
89
94
|
mappingVariants: DiscoverColumnsMappingVariant[];
|
|
90
|
-
/**
|
|
95
|
+
/** Steps traversed to reach this hit; empty for direct matches */
|
|
91
96
|
path: DiscoverColumnsStepInfo[];
|
|
92
97
|
}
|
|
93
|
-
/** Response from discover columns */
|
|
98
|
+
/** Response from discover columns. */
|
|
94
99
|
interface DiscoverColumnsResponse {
|
|
95
100
|
/** Columns that could be integrated and possible ways to integrate them */
|
|
96
101
|
hits: DiscoverColumnsResponseHit[];
|
|
97
102
|
}
|
|
98
103
|
//#endregion
|
|
99
|
-
export { DiscoverColumnsConstraints,
|
|
104
|
+
export { DiscoverColumnsConstraints, DiscoverColumnsMappingVariant, DiscoverColumnsRequestV2, DiscoverColumnsResponse, DiscoverColumnsResponseHit, DiscoverColumnsResponseQualifications, type DiscoverColumnsStepInfo, MatcherMap, MultiAxisSelector, MultiColumnSelector, StringMatcher };
|
|
100
105
|
//# sourceMappingURL=discover_columns.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"discover_columns.d.ts","names":[],"sources":["../../../src/pframe/internal_api/discover_columns.ts"],"mappings":";;;;;
|
|
1
|
+
{"version":3,"file":"discover_columns.d.ts","names":[],"sources":["../../../src/pframe/internal_api/discover_columns.ts"],"mappings":";;;;;KAWY,aAAA;EAAkB,IAAA;EAAe,KAAA;AAAA;EAAoB,IAAA;EAAe,KAAA;AAAA;;KAGpE,UAAA,GAAa,MAAA,SAAe,aAAA;;UAGvB,iBAAA;EAHK;EAAA,SAKX,IAAA,GAAO,aAAA;EALO;EAAA,SAOd,IAAA,GAAO,aAAA;EAJD;EAAA,SAMN,MAAA,GAAS,UAAA;;WAET,aAAA,GAAgB,UAAA;EAJT;EAAA,SAMP,WAAA,GAAc,UAAA;AAAA;;;UAKR,mBAAA;EAbN;EAAA,SAeA,IAAA,GAAO,eAAA;EAbP;EAAA,SAeA,IAAA,GAAO,aAAA;EAbP;EAAA,SAeA,MAAA,GAAS,UAAA;EAbT;EAAA,SAeA,aAAA,GAAgB,UAAA;EAbhB;EAAA,SAeA,WAAA,GAAc,UAAA;EAfU;EAAA,SAiBxB,IAAA,GAAO,iBAAA;EAZD;EAAA,SAcN,gBAAA;AAAA;;UAIM,0BAAA;EAZG;EAclB,uBAAA;EAVuB;EAYvB,oBAAA;EAViC;EAYjC,yBAAA;EAtBS;EAwBT,sBAAA;AAAA;;UAIe,wBAAA;EAxBG;EA0BlB,cAAA,GAAiB,mBAAA;EAxBQ;EA0BzB,cAAA,GAAiB,mBAAA;EAxBM;EA0BvB,IAAA,EAAM,4BAAA;EAxBU;EA0BhB,OAAA;EAxByB;EA0BzB,WAAA,EAAa,0BAAA;AAAA;;UAIE,qCAAA;EA1B0B;EA4BzC,UAAA,EAAY,iBAAA;EAxBZ;EA0BA,MAAA,EAAQ,iBAAA;AAAA;;UAIO,6BAAA;EAtBA;EAwBf,cAAA,EAAgB,qCAAA;;EAEhB,yBAAA,EAA2B,qCAAA;AAAA;;;;;;;UASZ,0BAAA;EA/BE;EAiCjB,GAAA,EAAK,gBAAA;EA/BC;EAiCN,eAAA,EAAiB,6BAAA;EA7BjB;EA+BA,IAAA,EAAM,uBAAA;AAAA;;UAIS,uBAAA;EA/BqC;EAiCpD,IAAA,EAAM,0BAAA;AAAA"}
|
|
@@ -6,14 +6,14 @@ import { PTableV8 } from "./table.js";
|
|
|
6
6
|
import { PFrameReadAPIV11 } from "./api_read.js";
|
|
7
7
|
import { BaseObjectStore, FileRange, FsStoreOptions, HttpAuthorizationToken, HttpHelpers, HttpMethod, HttpRange, HttpServer, HttpServerInfo, HttpServerOptions, ObjectStore, ObjectStoreOptions, ObjectStoreResponse, ObjectStoreUrl, ParquetExtension, ParquetFileName, PemCertificate, RequestHandlerOptions } from "./http_helpers.js";
|
|
8
8
|
import { DataInfo, DataInfoExtension, FilePath, PFrameBlobId, PFrameDataSourceV2, PFrameFactoryAPIV4, SpecExtension } from "./api_factory.js";
|
|
9
|
-
import { DiscoverColumnsConstraints,
|
|
10
|
-
import { EvaluateQueryResponse, LegacyQuery, PFrameWasmAPIV2, PFrameWasmV2 } from "./api_wasm.js";
|
|
9
|
+
import { DiscoverColumnsConstraints, DiscoverColumnsMappingVariant, DiscoverColumnsRequestV2, DiscoverColumnsResponse, DiscoverColumnsResponseHit, DiscoverColumnsResponseQualifications, DiscoverColumnsStepInfo, MatcherMap, MultiAxisSelector, MultiColumnSelector, StringMatcher } from "./discover_columns.js";
|
|
10
|
+
import { EvaluateQueryResponse, LegacyQuery, PFrameWasmAPIV2, PFrameWasmAPIV3, PFrameWasmV2, PFrameWasmV3 } from "./api_wasm.js";
|
|
11
11
|
import { PFrameFactoryV4, PFrameOptionsV2, PFrameV13 } from "./pframe.js";
|
|
12
12
|
import { SingleAxisSelector as SingleAxisSelector$1 } from "@milaboratories/pl-model-common";
|
|
13
13
|
|
|
14
14
|
//#region src/pframe/internal_api/index.d.ts
|
|
15
15
|
declare namespace index_d_exports {
|
|
16
|
-
export { ArtificialColumnJoinEntry, AxisQualification, BaseObjectStore, ColumnAxesWithQualifications, ColumnJoinEntry, ConstantAxisFilter, CreateTableRequestV4, DataInfo, DataInfoExtension, DeleteColumnFromColumnsRequest, DeleteColumnFromColumnsResponse, DiscoverColumnsConstraints,
|
|
16
|
+
export { ArtificialColumnJoinEntry, AxisQualification, BaseObjectStore, ColumnAxesWithQualifications, ColumnJoinEntry, ConstantAxisFilter, CreateTableRequestV4, DataInfo, DataInfoExtension, DeleteColumnFromColumnsRequest, DeleteColumnFromColumnsResponse, DiscoverColumnsConstraints, DiscoverColumnsMappingVariant, DiscoverColumnsRequestV2, DiscoverColumnsResponse, DiscoverColumnsResponseHit, DiscoverColumnsResponseQualifications, DiscoverColumnsStepInfo, EvaluateQueryResponse, FilePath, FileRange, FindColumnResponseQualifications, FindColumnsMappingVariant, FindColumnsRequest, FindColumnsResponse, FindColumnsResponseHit, FsStoreOptions, FullJoinV4, HttpAuthorizationToken, HttpHelpers, HttpMethod, HttpRange, HttpServer, HttpServerInfo, HttpServerOptions, InlineColumnJoinEntry, InnerJoinV4, JoinEntryV4, LegacyQuery, Logger, MatcherMap, MultiAxisSelector, MultiColumnSelector, ObjectStore, ObjectStoreOptions, ObjectStoreResponse, ObjectStoreUrl, OuterJoinV4, PFrameBlobId, PFrameDataSourceV2, PFrameFactoryAPIV4, PFrameFactoryV4, PFrameId, PFrameOptionsV2, PFrameReadAPIV11, PFrameV13, PFrameWasmAPIV2, PFrameWasmAPIV3, PFrameWasmV2, PFrameWasmV3, PTableId, PTableV8, ParquetExtension, ParquetFileName, PemCertificate, RequestHandlerOptions, SingleAxisSelector$1 as SingleAxisSelector, SlicedColumnJoinEntry, SpecExtension, StringMatcher };
|
|
17
17
|
}
|
|
18
18
|
//#endregion
|
|
19
19
|
export { index_d_exports };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@milaboratories/pl-model-middle-layer",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.17.0",
|
|
4
4
|
"description": "Common model between middle layer and non-block UI code",
|
|
5
5
|
"files": [
|
|
6
6
|
"./dist/**/*",
|
|
@@ -21,14 +21,14 @@
|
|
|
21
21
|
"utility-types": "^3.11.0",
|
|
22
22
|
"zod": "~3.25.76",
|
|
23
23
|
"@milaboratories/helpers": "1.14.1",
|
|
24
|
-
"@milaboratories/pl-model-common": "1.
|
|
24
|
+
"@milaboratories/pl-model-common": "1.32.0"
|
|
25
25
|
},
|
|
26
26
|
"devDependencies": {
|
|
27
27
|
"@types/node": "~24.5.2",
|
|
28
28
|
"typescript": "~5.9.3",
|
|
29
|
-
"@milaboratories/
|
|
29
|
+
"@milaboratories/ts-builder": "1.3.2",
|
|
30
30
|
"@milaboratories/ts-configs": "1.2.3",
|
|
31
|
-
"@milaboratories/
|
|
31
|
+
"@milaboratories/build-configs": "2.0.0"
|
|
32
32
|
},
|
|
33
33
|
"scripts": {
|
|
34
34
|
"build": "ts-builder build --target node",
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type {
|
|
2
2
|
AxesId,
|
|
3
3
|
AxesSpec,
|
|
4
|
+
BuildQueryInput,
|
|
4
5
|
JoinEntry,
|
|
5
6
|
PColumnSpec,
|
|
6
7
|
PObjectId,
|
|
@@ -10,6 +11,7 @@ import type {
|
|
|
10
11
|
PTableSorting,
|
|
11
12
|
DataQuery,
|
|
12
13
|
SpecQuery,
|
|
14
|
+
SpecQueryJoinEntry,
|
|
13
15
|
SingleAxisSelector,
|
|
14
16
|
} from "@milaboratories/pl-model-common";
|
|
15
17
|
import type {
|
|
@@ -20,18 +22,20 @@ import type { DiscoverColumnsRequestV2, DiscoverColumnsResponse } from "./discov
|
|
|
20
22
|
import type { FindColumnsRequest, FindColumnsResponse } from "./find_columns";
|
|
21
23
|
|
|
22
24
|
/**
|
|
23
|
-
*
|
|
25
|
+
* V3 PFrame interface: adds {@link PFrameWasmV3.buildQuery} on top of V2.
|
|
24
26
|
*/
|
|
25
|
-
export interface
|
|
27
|
+
export interface PFrameWasmV3 extends Disposable {
|
|
26
28
|
/**
|
|
27
29
|
* Deletes columns from a columns specification.
|
|
28
30
|
*/
|
|
29
31
|
deleteColumns(request: DeleteColumnFromColumnsRequest): DeleteColumnFromColumnsResponse;
|
|
30
32
|
|
|
31
33
|
/**
|
|
32
|
-
* Discovers columns compatible with a given axes integration
|
|
33
|
-
*
|
|
34
|
-
*
|
|
34
|
+
* Discovers columns compatible with a given axes integration. Include and
|
|
35
|
+
* exclude filters are applied in order (exclude removes matches from the
|
|
36
|
+
* include set). Each hit carries its traversal `path`; feed the hit's
|
|
37
|
+
* column id and `path` into {@link buildQuery} to materialize it as a
|
|
38
|
+
* {@link SpecQueryJoinEntry}.
|
|
35
39
|
*/
|
|
36
40
|
discoverColumns(request: DiscoverColumnsRequestV2): DiscoverColumnsResponse;
|
|
37
41
|
|
|
@@ -49,16 +53,32 @@ export interface PFrameWasmV2 extends Disposable {
|
|
|
49
53
|
* Rewrites a legacy query format (V4) to the current SpecQuery format.
|
|
50
54
|
*/
|
|
51
55
|
rewriteLegacyQuery(request: LegacyQuery): SpecQuery;
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* Assembles a {@link SpecQueryJoinEntry} from a terminal column plus an
|
|
59
|
+
* ordered path of wrapping steps (linker hops, filter joins).
|
|
60
|
+
*
|
|
61
|
+
* Right-fold over `path` starting from `Column(column)`: each `linker` step
|
|
62
|
+
* wraps the current subquery as `linkerJoin`, each `filter` step as
|
|
63
|
+
* `innerJoin` with the filter column. `qualifications` annotate the
|
|
64
|
+
* outermost entry only.
|
|
65
|
+
*
|
|
66
|
+
* Pure over its input — column ids are resolved later in
|
|
67
|
+
* {@link evaluateQuery}. Throws only on malformed input: shape violations
|
|
68
|
+
* and unknown step tags (so v1 callers are shielded from step variants
|
|
69
|
+
* added in later versions).
|
|
70
|
+
*/
|
|
71
|
+
buildQuery(input: BuildQueryInput): SpecQueryJoinEntry;
|
|
52
72
|
}
|
|
53
73
|
|
|
54
74
|
/**
|
|
55
|
-
*
|
|
75
|
+
* V3 PFrame API factory with createPFrame returning {@link PFrameWasmV3}.
|
|
56
76
|
*/
|
|
57
|
-
export interface
|
|
77
|
+
export interface PFrameWasmAPIV3 {
|
|
58
78
|
/**
|
|
59
|
-
* Creates a new
|
|
79
|
+
* Creates a new V3 PFrame from a map of column IDs to column specifications.
|
|
60
80
|
*/
|
|
61
|
-
createPFrame(spec: Record<string, PColumnSpec>):
|
|
81
|
+
createPFrame(spec: Record<string, PColumnSpec>): PFrameWasmV3;
|
|
62
82
|
|
|
63
83
|
/**
|
|
64
84
|
* Expands an {@link AxesSpec} into {@link AxesId}s with parent information
|
|
@@ -84,6 +104,48 @@ export interface PFrameWasmAPIV2 {
|
|
|
84
104
|
findTableColumn(tableSpec: PTableColumnSpec[], selector: PTableColumnId): number;
|
|
85
105
|
}
|
|
86
106
|
|
|
107
|
+
/**
|
|
108
|
+
* V2 PFrame interface. Superseded by {@link PFrameWasmV3}, which adds
|
|
109
|
+
* {@link PFrameWasmV3.buildQuery}. Will be removed in a future PFrames update.
|
|
110
|
+
*/
|
|
111
|
+
export interface PFrameWasmV2 extends Disposable {
|
|
112
|
+
/** @see PFrameWasmV3.deleteColumns */
|
|
113
|
+
deleteColumns(request: DeleteColumnFromColumnsRequest): DeleteColumnFromColumnsResponse;
|
|
114
|
+
|
|
115
|
+
/** @see PFrameWasmV3.discoverColumns */
|
|
116
|
+
discoverColumns(request: DiscoverColumnsRequestV2): DiscoverColumnsResponse;
|
|
117
|
+
|
|
118
|
+
/** @see PFrameWasmV3.findColumns */
|
|
119
|
+
findColumns(request: FindColumnsRequest): FindColumnsResponse;
|
|
120
|
+
|
|
121
|
+
/** @see PFrameWasmV3.evaluateQuery */
|
|
122
|
+
evaluateQuery(request: SpecQuery): EvaluateQueryResponse;
|
|
123
|
+
|
|
124
|
+
/** @see PFrameWasmV3.rewriteLegacyQuery */
|
|
125
|
+
rewriteLegacyQuery(request: LegacyQuery): SpecQuery;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
/**
|
|
129
|
+
* V2 PFrame API factory. Superseded by {@link PFrameWasmAPIV3}; will be removed
|
|
130
|
+
* in a future PFrames update.
|
|
131
|
+
*/
|
|
132
|
+
export interface PFrameWasmAPIV2 {
|
|
133
|
+
/** @see PFrameWasmAPIV3.createPFrame */
|
|
134
|
+
createPFrame(spec: Record<string, PColumnSpec>): PFrameWasmV2;
|
|
135
|
+
|
|
136
|
+
/** @see PFrameWasmAPIV3.expandAxes */
|
|
137
|
+
expandAxes(spec: AxesSpec): AxesId;
|
|
138
|
+
|
|
139
|
+
/** @see PFrameWasmAPIV3.collapseAxes */
|
|
140
|
+
collapseAxes(ids: AxesId): AxesSpec;
|
|
141
|
+
|
|
142
|
+
/** @see PFrameWasmAPIV3.findAxis */
|
|
143
|
+
findAxis(spec: AxesSpec, selector: SingleAxisSelector): number;
|
|
144
|
+
|
|
145
|
+
/** @see PFrameWasmAPIV3.findTableColumn */
|
|
146
|
+
findTableColumn(tableSpec: PTableColumnSpec[], selector: PTableColumnId): number;
|
|
147
|
+
}
|
|
148
|
+
|
|
87
149
|
/**
|
|
88
150
|
* Response from evaluating a query against a PFrame.
|
|
89
151
|
*/
|
|
@@ -103,7 +165,7 @@ export type EvaluateQueryResponse = {
|
|
|
103
165
|
/**
|
|
104
166
|
* Represents a legacy (V4) query format used before the unified SpecQuery.
|
|
105
167
|
*
|
|
106
|
-
* This type is used with {@link
|
|
168
|
+
* This type is used with {@link PFrameWasmV3.rewriteLegacyQuery} to upgrade
|
|
107
169
|
* older query structures to the current {@link SpecQuery} format.
|
|
108
170
|
*/
|
|
109
171
|
export type LegacyQuery = {
|
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
import type {
|
|
2
2
|
AxisValueType,
|
|
3
3
|
ColumnValueType,
|
|
4
|
-
DiscoverColumnsLinkerStep,
|
|
5
4
|
DiscoverColumnsStepInfo,
|
|
6
5
|
PColumnIdAndSpec,
|
|
7
6
|
} from "@milaboratories/pl-model-common";
|
|
8
7
|
import type { AxisQualification, ColumnAxesWithQualifications } from "./common";
|
|
9
8
|
|
|
10
|
-
export type {
|
|
9
|
+
export type { DiscoverColumnsStepInfo };
|
|
11
10
|
|
|
12
11
|
/** Matches a string value either exactly or by regex pattern */
|
|
13
12
|
export type StringMatcher = { type: "exact"; value: string } | { type: "regex"; value: string };
|
|
@@ -90,17 +89,22 @@ export interface DiscoverColumnsMappingVariant {
|
|
|
90
89
|
distinctiveQualifications: DiscoverColumnsResponseQualifications;
|
|
91
90
|
}
|
|
92
91
|
|
|
93
|
-
/**
|
|
92
|
+
/**
|
|
93
|
+
* A single hit in the discover columns response. Carries the matched column
|
|
94
|
+
* along with its integration metadata and the path traversed to reach it.
|
|
95
|
+
* To materialize the hit as an executable query, feed `hit.columnId` and
|
|
96
|
+
* `path` into the PFrame's `buildQuery`.
|
|
97
|
+
*/
|
|
94
98
|
export interface DiscoverColumnsResponseHit {
|
|
95
99
|
/** The column that was found compatible */
|
|
96
100
|
hit: PColumnIdAndSpec;
|
|
97
101
|
/** Possible ways to integrate this column with the existing set */
|
|
98
102
|
mappingVariants: DiscoverColumnsMappingVariant[];
|
|
99
|
-
/**
|
|
103
|
+
/** Steps traversed to reach this hit; empty for direct matches */
|
|
100
104
|
path: DiscoverColumnsStepInfo[];
|
|
101
105
|
}
|
|
102
106
|
|
|
103
|
-
/** Response from discover columns */
|
|
107
|
+
/** Response from discover columns. */
|
|
104
108
|
export interface DiscoverColumnsResponse {
|
|
105
109
|
/** Columns that could be integrated and possible ways to integrate them */
|
|
106
110
|
hits: DiscoverColumnsResponseHit[];
|