@milaboratories/pl-model-middle-layer 1.20.0 → 1.22.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/block_meta/block_components.cjs +19 -26
- package/dist/block_meta/block_components.cjs.map +1 -1
- package/dist/block_meta/block_components.d.ts +46 -428
- package/dist/block_meta/block_components.d.ts.map +1 -1
- package/dist/block_meta/block_components.js +19 -23
- package/dist/block_meta/block_components.js.map +1 -1
- package/dist/block_meta/block_description.cjs +5 -3
- package/dist/block_meta/block_description.cjs.map +1 -1
- package/dist/block_meta/block_description.d.ts +277 -789
- package/dist/block_meta/block_description.d.ts.map +1 -1
- package/dist/block_meta/block_description.js +5 -3
- package/dist/block_meta/block_description.js.map +1 -1
- package/dist/block_meta/block_manifest.cjs +10 -1
- package/dist/block_meta/block_manifest.cjs.map +1 -1
- package/dist/block_meta/block_manifest.d.ts +700 -1278
- package/dist/block_meta/block_manifest.d.ts.map +1 -1
- package/dist/block_meta/block_manifest.js +11 -2
- package/dist/block_meta/block_manifest.js.map +1 -1
- package/dist/block_meta/block_meta.cjs.map +1 -1
- package/dist/block_meta/block_meta.d.ts +92 -174
- package/dist/block_meta/block_meta.d.ts.map +1 -1
- package/dist/block_meta/block_meta.js.map +1 -1
- package/dist/block_meta/content_types.cjs +25 -77
- package/dist/block_meta/content_types.cjs.map +1 -1
- package/dist/block_meta/content_types.d.ts +67 -383
- package/dist/block_meta/content_types.d.ts.map +1 -1
- package/dist/block_meta/content_types.js +26 -64
- package/dist/block_meta/content_types.js.map +1 -1
- package/dist/block_meta/index.d.ts +3 -3
- package/dist/block_registry/block_pack_spec.d.ts +8 -8
- package/dist/block_registry/overview.d.ts +200 -200
- package/dist/block_registry/registry_spec.d.ts +20 -20
- package/dist/index.cjs +1 -18
- package/dist/index.d.ts +4 -4
- package/dist/index.js +3 -3
- package/dist/pframe/internal_api/api_factory.cjs.map +1 -1
- package/dist/pframe/internal_api/api_factory.d.ts +36 -2
- package/dist/pframe/internal_api/api_factory.d.ts.map +1 -1
- package/dist/pframe/internal_api/api_factory.js.map +1 -1
- package/dist/pframe/internal_api/api_read.d.ts +40 -3
- package/dist/pframe/internal_api/api_read.d.ts.map +1 -1
- package/dist/pframe/internal_api/index.d.ts +5 -5
- package/dist/pframe/internal_api/pframe.d.ts +21 -3
- package/dist/pframe/internal_api/pframe.d.ts.map +1 -1
- package/dist/pframe/internal_api/table.d.ts +51 -1
- package/dist/pframe/internal_api/table.d.ts.map +1 -1
- package/package.json +3 -3
- package/src/block_meta/block_components.ts +67 -42
- package/src/block_meta/block_description.ts +18 -3
- package/src/block_meta/block_manifest.ts +14 -3
- package/src/block_meta/block_meta.ts +40 -6
- package/src/block_meta/content_types.ts +149 -207
- package/src/pframe/internal_api/api_factory.ts +44 -0
- package/src/pframe/internal_api/api_read.ts +48 -1
- package/src/pframe/internal_api/pframe.ts +23 -2
- package/src/pframe/internal_api/table.ts +54 -0
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import type {
|
|
2
|
+
AxisValueType,
|
|
2
3
|
BinaryPartitionedDataInfo,
|
|
3
4
|
Branded,
|
|
5
|
+
ColumnValueType,
|
|
4
6
|
JsonDataInfo,
|
|
5
7
|
JsonPartitionedDataInfo,
|
|
6
8
|
ParquetChunk,
|
|
@@ -79,3 +81,45 @@ export interface PFrameFactoryAPIV4 extends Disposable {
|
|
|
79
81
|
* any interactions with disposed PFrame will result in exception */
|
|
80
82
|
dispose(): void;
|
|
81
83
|
}
|
|
84
|
+
|
|
85
|
+
/**
|
|
86
|
+
* Structural type information needed by the data side: axis value
|
|
87
|
+
* types and column value types, in their canonical order. Mirrors
|
|
88
|
+
* the bridge-side `TypeSpec`.
|
|
89
|
+
*/
|
|
90
|
+
export interface PColumnValueTypeSpec {
|
|
91
|
+
readonly axes: AxisValueType[];
|
|
92
|
+
readonly columns: ColumnValueType[];
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
/** Single column entry for {@link PFrameFactoryAPIV5.addColumns}. */
|
|
96
|
+
export interface AddColumnEntry {
|
|
97
|
+
/** Unique column identifier within the PFrame. */
|
|
98
|
+
readonly id: PObjectId;
|
|
99
|
+
/** Structural type info (axes / column value types). */
|
|
100
|
+
readonly typeSpec: PColumnValueTypeSpec;
|
|
101
|
+
/** Data info for the column. */
|
|
102
|
+
readonly data: DataInfo<PFrameBlobId>;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
/** API for populating a PFrame with columns and a data source. */
|
|
106
|
+
export interface PFrameFactoryAPIV5 extends Disposable {
|
|
107
|
+
/** Associates data source with this PFrame. */
|
|
108
|
+
setDataSource(dataSource: PFrameDataSourceV2): void;
|
|
109
|
+
|
|
110
|
+
/**
|
|
111
|
+
* Registers all PColumns at once: specs are recorded and data info
|
|
112
|
+
* is attached atomically. For parquet data info, schema resolution
|
|
113
|
+
* via network is performed during this call.
|
|
114
|
+
*/
|
|
115
|
+
addColumns(
|
|
116
|
+
columns: AddColumnEntry[],
|
|
117
|
+
options?: {
|
|
118
|
+
signal?: AbortSignal;
|
|
119
|
+
},
|
|
120
|
+
): Promise<void>;
|
|
121
|
+
|
|
122
|
+
/** Releases all the data previously added to PFrame using methods above,
|
|
123
|
+
* any interactions with disposed PFrame will result in exception */
|
|
124
|
+
dispose(): void;
|
|
125
|
+
}
|
|
@@ -10,10 +10,11 @@ import type {
|
|
|
10
10
|
UniqueValuesRequest,
|
|
11
11
|
UniqueValuesResponse,
|
|
12
12
|
DataQuery,
|
|
13
|
+
DataQueryBooleanExpression,
|
|
13
14
|
PTableColumnSpec,
|
|
14
15
|
} from "@milaboratories/pl-model-common";
|
|
15
16
|
import type { CreateTableRequestV4 } from "./create_table";
|
|
16
|
-
import type { PTableV8 } from "./table";
|
|
17
|
+
import type { PTableV8, PTableV9 } from "./table";
|
|
17
18
|
import type { PTableId } from "./common";
|
|
18
19
|
|
|
19
20
|
/** Read interface exposed by PFrames library */
|
|
@@ -60,3 +61,49 @@ export interface PFrameReadAPIV11 {
|
|
|
60
61
|
},
|
|
61
62
|
): Promise<UniqueValuesResponse>;
|
|
62
63
|
}
|
|
64
|
+
|
|
65
|
+
/**
|
|
66
|
+
* V2 unique-values request. Axis and filter references are
|
|
67
|
+
* pre-resolved to numeric indices; no selector ids cross the API
|
|
68
|
+
* boundary. Each filter is a boolean predicate that must evaluate to
|
|
69
|
+
* true for the row to be included.
|
|
70
|
+
*/
|
|
71
|
+
export interface UniqueValuesRequestV2 {
|
|
72
|
+
/** Target column. */
|
|
73
|
+
readonly columnId: PObjectId;
|
|
74
|
+
|
|
75
|
+
/**
|
|
76
|
+
* Target axis (pre-resolved index into the column's axes).
|
|
77
|
+
* When omitted, unique values are collected from the column itself.
|
|
78
|
+
*/
|
|
79
|
+
readonly axisIndex?: number;
|
|
80
|
+
|
|
81
|
+
/** Pre-resolved boolean predicates applied before collecting values. */
|
|
82
|
+
readonly filters: DataQueryBooleanExpression[];
|
|
83
|
+
|
|
84
|
+
/** Max number of values to return. Overflow is reported in the response. */
|
|
85
|
+
readonly limit: number;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
/**
|
|
89
|
+
* Read interface exposed by PFrames library.
|
|
90
|
+
*
|
|
91
|
+
* Spec-side operations (finding columns, listing columns, retrieving
|
|
92
|
+
* column specs, computing axis integrations) are not part of this
|
|
93
|
+
* surface — callers cache column specs themselves or route through
|
|
94
|
+
* WASM-spec. The data-side `createTableV2` accepts a pre-lowered
|
|
95
|
+
* `DataQuery`; `getUniqueValues` takes pre-resolved indices via
|
|
96
|
+
* {@link UniqueValuesRequestV2}.
|
|
97
|
+
*/
|
|
98
|
+
export interface PFrameReadAPIV12 {
|
|
99
|
+
/** Creates table from a pre-lowered data query. */
|
|
100
|
+
createTableV2(tableId: PTableId, dataQuery: DataQuery): PTableV9;
|
|
101
|
+
|
|
102
|
+
/** Calculate set of unique values for a specific axis for the filtered set of records. */
|
|
103
|
+
getUniqueValues(
|
|
104
|
+
request: UniqueValuesRequestV2,
|
|
105
|
+
ops?: {
|
|
106
|
+
signal?: AbortSignal;
|
|
107
|
+
},
|
|
108
|
+
): Promise<UniqueValuesResponse>;
|
|
109
|
+
}
|
|
@@ -1,10 +1,13 @@
|
|
|
1
|
-
import type { PFrameFactoryAPIV4 } from "./api_factory";
|
|
2
|
-
import type { PFrameReadAPIV11 } from "./api_read";
|
|
1
|
+
import type { PFrameFactoryAPIV4, PFrameFactoryAPIV5 } from "./api_factory";
|
|
2
|
+
import type { PFrameReadAPIV11, PFrameReadAPIV12 } from "./api_read";
|
|
3
3
|
import type { Logger } from "./common";
|
|
4
4
|
import type { PFrameId } from "./common";
|
|
5
5
|
|
|
6
6
|
export interface PFrameV13 extends PFrameFactoryAPIV4, PFrameReadAPIV11 {}
|
|
7
7
|
|
|
8
|
+
/** Full PFrame surface — factory operations plus data-side reads. */
|
|
9
|
+
export interface PFrameV14 extends PFrameFactoryAPIV5, PFrameReadAPIV12 {}
|
|
10
|
+
|
|
8
11
|
export type PFrameOptionsV2 = {
|
|
9
12
|
/** PFrame ID for logging purposes */
|
|
10
13
|
frameId: PFrameId;
|
|
@@ -31,3 +34,21 @@ export interface PFrameFactoryV4 {
|
|
|
31
34
|
*/
|
|
32
35
|
pprofDump: () => Promise<Uint8Array>;
|
|
33
36
|
}
|
|
37
|
+
|
|
38
|
+
/** PFrame management functions exposed by the PFrame module. */
|
|
39
|
+
export interface PFrameFactoryV5 {
|
|
40
|
+
/**
|
|
41
|
+
* Create a new PFrame instance.
|
|
42
|
+
* @warning Use concurrency limiting to avoid OOM crashes when multiple instances are simultaneously in use.
|
|
43
|
+
*/
|
|
44
|
+
createPFrame(options: PFrameOptionsV2): PFrameV14;
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* Dump active allocations from all PFrames instances in pprof format.
|
|
48
|
+
* The result of this function should be saved as `profile.pb.gz`.
|
|
49
|
+
* Use {@link https://pprof.me/} or {@link https://www.speedscope.app/}
|
|
50
|
+
* to view the allocation flamechart.
|
|
51
|
+
* @warning This method will always reject on Windows!
|
|
52
|
+
*/
|
|
53
|
+
pprofDump: () => Promise<Uint8Array>;
|
|
54
|
+
}
|
|
@@ -68,3 +68,57 @@ export interface PTableV8 extends Disposable {
|
|
|
68
68
|
/** Deallocates all underlying resources */
|
|
69
69
|
dispose(): void;
|
|
70
70
|
}
|
|
71
|
+
|
|
72
|
+
/**
|
|
73
|
+
* Table view returned by `createTableV2`, `filter`, and `sort`.
|
|
74
|
+
*
|
|
75
|
+
* PTable can be thought as having a composite primary key, consisting
|
|
76
|
+
* of axes, and a set of data columns derived from PColumn values.
|
|
77
|
+
* The table's column spec is owned by the caller — selector → index
|
|
78
|
+
* resolution runs on the caller side via WASM-spec.
|
|
79
|
+
*/
|
|
80
|
+
export interface PTableV9 extends Disposable {
|
|
81
|
+
/**
|
|
82
|
+
* Get PTable disk footprint in bytes.
|
|
83
|
+
*
|
|
84
|
+
* @param ops.withPredecessors When true, the footprint includes
|
|
85
|
+
* every registered predecessor table reachable through the
|
|
86
|
+
* query lineage. When false or omitted, only this table's own
|
|
87
|
+
* materialised data is counted.
|
|
88
|
+
*
|
|
89
|
+
* Warning: This call materializes the join.
|
|
90
|
+
*/
|
|
91
|
+
getFootprint(ops?: { withPredecessors?: boolean; signal?: AbortSignal }): Promise<number>;
|
|
92
|
+
|
|
93
|
+
/**
|
|
94
|
+
* Unified table shape
|
|
95
|
+
* Warning: This call materializes the join.
|
|
96
|
+
*/
|
|
97
|
+
getShape(ops?: { signal?: AbortSignal }): Promise<PTableShape>;
|
|
98
|
+
|
|
99
|
+
/**
|
|
100
|
+
* Retrieve the data from the table. To retrieve only data required, it can be
|
|
101
|
+
* sliced both horizontally ({@link columnIndices}) and vertically
|
|
102
|
+
* ({@link range}).
|
|
103
|
+
* This call materializes the join.
|
|
104
|
+
*
|
|
105
|
+
* @param columnIndices unified indices of columns to be retrieved
|
|
106
|
+
* @param range optionally limit the range of records to retrieve
|
|
107
|
+
* */
|
|
108
|
+
getData(
|
|
109
|
+
columnIndices: number[],
|
|
110
|
+
ops?: {
|
|
111
|
+
range?: TableRange;
|
|
112
|
+
signal?: AbortSignal;
|
|
113
|
+
},
|
|
114
|
+
): Promise<PTableVector[]>;
|
|
115
|
+
|
|
116
|
+
/** Filters the table and returns new PTable instance */
|
|
117
|
+
filter(tableId: PTableId, request: PTableRecordFilter[]): PTableV9;
|
|
118
|
+
|
|
119
|
+
/** Sorts the table and returns new PTable instance. */
|
|
120
|
+
sort(tableId: PTableId, request: PTableSorting[]): PTableV9;
|
|
121
|
+
|
|
122
|
+
/** Deallocates all underlying resources */
|
|
123
|
+
dispose(): void;
|
|
124
|
+
}
|