@milaboratories/pl-model-middle-layer 1.7.43 → 1.7.45
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_description.d.ts +10 -0
- package/dist/block_meta/block_description.d.ts.map +1 -1
- package/dist/block_meta/block_manifest.d.ts +9 -0
- package/dist/block_meta/block_manifest.d.ts.map +1 -1
- package/dist/block_registry/overview.d.ts +16 -0
- package/dist/block_registry/overview.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +144 -141
- package/dist/index.mjs.map +1 -1
- package/dist/pframe/internal_api/api_read.d.ts +25 -1
- package/dist/pframe/internal_api/api_read.d.ts.map +1 -1
- package/dist/pframe/internal_api/pframe.d.ts +3 -1
- package/dist/pframe/internal_api/pframe.d.ts.map +1 -1
- package/dist/pframe/internal_api/table.d.ts +54 -0
- package/dist/pframe/internal_api/table.d.ts.map +1 -1
- package/dist/project_overview.d.ts +13 -1
- package/dist/project_overview.d.ts.map +1 -1
- package/package.json +2 -2
- package/src/block_meta/block_description.ts +6 -1
- package/src/block_registry/overview.ts +3 -1
- package/src/pframe/internal_api/api_read.ts +34 -1
- package/src/pframe/internal_api/pframe.ts +3 -1
- package/src/pframe/internal_api/table.ts +65 -0
- package/src/project_overview.ts +15 -1
|
@@ -2,7 +2,7 @@ import { FindColumnsRequest, FindColumnsResponse } from './find_columns';
|
|
|
2
2
|
import { DeleteColumnFromColumnsRequest, DeleteColumnFromColumnsResponse } from './delete_column';
|
|
3
3
|
import { PColumnInfo, PColumnSpec, PObjectId, UniqueValuesRequest, UniqueValuesResponse } from '@milaboratories/pl-model-common';
|
|
4
4
|
import { CreateTableRequestV3 } from './create_table';
|
|
5
|
-
import { PTableV5 } from './table';
|
|
5
|
+
import { PTableV5, PTableV6 } from './table';
|
|
6
6
|
/** Read interface exposed by PFrames library */
|
|
7
7
|
export interface PFrameReadAPIV7 {
|
|
8
8
|
/**
|
|
@@ -27,4 +27,28 @@ export interface PFrameReadAPIV7 {
|
|
|
27
27
|
signal?: AbortSignal;
|
|
28
28
|
}): Promise<UniqueValuesResponse>;
|
|
29
29
|
}
|
|
30
|
+
/** Read interface exposed by PFrames library */
|
|
31
|
+
export interface PFrameReadAPIV8 {
|
|
32
|
+
/**
|
|
33
|
+
* Finds columns given filtering criteria on column name, annotations etc.
|
|
34
|
+
* and a set of qualified axes specs to find only columns with compatible
|
|
35
|
+
* axes spec.
|
|
36
|
+
*
|
|
37
|
+
* Only column specs are used, this method will work even for columns
|
|
38
|
+
* with no assigned data.
|
|
39
|
+
* */
|
|
40
|
+
findColumns(request: FindColumnsRequest): Promise<FindColumnsResponse>;
|
|
41
|
+
/** To be reviewed in the future */
|
|
42
|
+
deleteColumn(request: DeleteColumnFromColumnsRequest): Promise<DeleteColumnFromColumnsResponse>;
|
|
43
|
+
/** Retrieve single column spec */
|
|
44
|
+
getColumnSpec(columnId: PObjectId): Promise<PColumnSpec>;
|
|
45
|
+
/** Retrieve information about all columns currently added to the PFrame */
|
|
46
|
+
listColumns(): Promise<PColumnInfo[]>;
|
|
47
|
+
/** Calculates data for the table and returns an object to access it */
|
|
48
|
+
createTable(request: CreateTableRequestV3): PTableV6;
|
|
49
|
+
/** Calculate set of unique values for a specific axis for the filtered set of records */
|
|
50
|
+
getUniqueValues(request: UniqueValuesRequest, ops?: {
|
|
51
|
+
signal?: AbortSignal;
|
|
52
|
+
}): Promise<UniqueValuesResponse>;
|
|
53
|
+
}
|
|
30
54
|
//# sourceMappingURL=api_read.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"api_read.d.ts","sourceRoot":"","sources":["../../../src/pframe/internal_api/api_read.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AACzE,OAAO,EAAE,8BAA8B,EAAE,+BAA+B,EAAE,MAAM,iBAAiB,CAAC;AAClG,O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oBAAoB,CAAC,CAAC;CAClC;AAED,gDAAgD;AAChD,MAAM,WAAW,eAAe;IAC9B;;;;;;;SAOK;IACL,WAAW,CAAC,OAAO,EAAE,kBAAkB,GAAG,OAAO,CAAC,mBAAmB,CAAC,CAAC;IAEvE,mCAAmC;IACnC,YAAY,CAAC,OAAO,EAAE,8BAA8B,GAAG,OAAO,CAAC,+BAA+B,CAAC,CAAC;IAEhG,kCAAkC;IAClC,aAAa,CAAC,QAAQ,EAAE,SAAS,GAAG,OAAO,CAAC,WAAW,CAAC,CAAC;IAEzD,2EAA2E;IAC3E,WAAW,IAAI,OAAO,CAAC,WAAW,EAAE,CAAC,CAAC;IAEtC,uEAAuE;IACvE,WAAW,CAAC,OAAO,EAAE,oBAAoB,GAAG,QAAQ,CAAC;IAErD,yFAAyF;IACzF,eAAe,CACb,OAAO,EAAE,mBAAmB,EAC5B,GAAG,CAAC,EAAE;QACJ,MAAM,CAAC,EAAE,WAAW,CAAC;KACtB,GACA,OAAO,CAAC,oBAAoB,CAAC,CAAC;CAClC"}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { PFrameFactoryAPI } from './api_factory';
|
|
2
|
-
import { PFrameReadAPIV7 } from './api_read';
|
|
2
|
+
import { PFrameReadAPIV7, PFrameReadAPIV8 } from './api_read';
|
|
3
3
|
export type Logger = (level: 'info' | 'warn' | 'error', message: string) => void;
|
|
4
4
|
export interface PFrameV7 extends PFrameFactoryAPI, PFrameReadAPIV7 {
|
|
5
5
|
}
|
|
6
|
+
export interface PFrameV8 extends PFrameFactoryAPI, PFrameReadAPIV8 {
|
|
7
|
+
}
|
|
6
8
|
//# sourceMappingURL=pframe.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pframe.d.ts","sourceRoot":"","sources":["../../../src/pframe/internal_api/pframe.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AACtD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"pframe.d.ts","sourceRoot":"","sources":["../../../src/pframe/internal_api/pframe.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AACtD,OAAO,KAAK,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAEnE,MAAM,MAAM,MAAM,GAAG,CACnB,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,EAChC,OAAO,EAAE,MAAM,KACZ,IAAI,CAAC;AAEV,MAAM,WAAW,QAAS,SAAQ,gBAAgB,EAAE,eAAe;CAAG;AAEtE,MAAM,WAAW,QAAS,SAAQ,gBAAgB,EAAE,eAAe;CAAG"}
|
|
@@ -45,4 +45,58 @@ export interface PTableV5 {
|
|
|
45
45
|
/** Deallocates all underlying resources */
|
|
46
46
|
dispose(): void;
|
|
47
47
|
}
|
|
48
|
+
/**
|
|
49
|
+
* Table view returned as a result of create table operation.
|
|
50
|
+
*
|
|
51
|
+
* PTable can be thought as having a composite primary key, consisting of axes,
|
|
52
|
+
* and a set of data columns derived from PColumn values.
|
|
53
|
+
* */
|
|
54
|
+
export interface PTableV6 {
|
|
55
|
+
/**
|
|
56
|
+
* Returns ordered array of table axes specs (primary key "columns" in SQL
|
|
57
|
+
* terms) and data column specs (regular "columns" in SQL terms).
|
|
58
|
+
*
|
|
59
|
+
* Data for a specific table column can be retrieved using unified indexing
|
|
60
|
+
* corresponding to elements in this array.
|
|
61
|
+
*
|
|
62
|
+
* Axes are always listed first.
|
|
63
|
+
* */
|
|
64
|
+
getSpec(): PTableColumnSpec[];
|
|
65
|
+
/** Transforms unified column identifiers into unified indices of columns. */
|
|
66
|
+
getColumnIndices(columnIds: PTableColumnId[]): number[];
|
|
67
|
+
/**
|
|
68
|
+
* Get PTable disk footprint in bytes
|
|
69
|
+
* Warning: This call materializes the join.
|
|
70
|
+
*/
|
|
71
|
+
getFootprint(ops?: {
|
|
72
|
+
withPredecessors?: boolean;
|
|
73
|
+
signal?: AbortSignal;
|
|
74
|
+
}): Promise<number>;
|
|
75
|
+
/**
|
|
76
|
+
* Unified table shape
|
|
77
|
+
* Warning: This call materializes the join.
|
|
78
|
+
*/
|
|
79
|
+
getShape(ops?: {
|
|
80
|
+
signal?: AbortSignal;
|
|
81
|
+
}): Promise<PTableShape>;
|
|
82
|
+
/**
|
|
83
|
+
* Retrieve the data from the table. To retrieve only data required, it can be
|
|
84
|
+
* sliced both horizontally ({@link columnIndices}) and vertically
|
|
85
|
+
* ({@link range}).
|
|
86
|
+
* This call materializes the join.
|
|
87
|
+
*
|
|
88
|
+
* @param columnIndices unified indices of columns to be retrieved
|
|
89
|
+
* @param range optionally limit the range of records to retrieve
|
|
90
|
+
* */
|
|
91
|
+
getData(columnIndices: number[], ops?: {
|
|
92
|
+
range?: TableRange;
|
|
93
|
+
signal?: AbortSignal;
|
|
94
|
+
}): Promise<PTableVector[]>;
|
|
95
|
+
/** Filters the table and returns new PTable instance */
|
|
96
|
+
filter(request: PTableRecordFilter[]): PTableV6;
|
|
97
|
+
/** Sorts the table and returns new PTable instance. */
|
|
98
|
+
sort(request: PTableSorting[]): PTableV6;
|
|
99
|
+
/** Deallocates all underlying resources */
|
|
100
|
+
dispose(): void;
|
|
101
|
+
}
|
|
48
102
|
//# sourceMappingURL=table.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"table.d.ts","sourceRoot":"","sources":["../../../src/pframe/internal_api/table.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,cAAc,EACd,gBAAgB,EAChB,kBAAkB,EAClB,WAAW,EACX,aAAa,EACb,YAAY,EACZ,UAAU,EACX,MAAM,iCAAiC,CAAC;AAEzC;;;;;KAKK;AACL,MAAM,WAAW,QAAQ;IACvB;;;;;;;;SAQK;IACL,OAAO,IAAI,gBAAgB,EAAE,CAAC;IAE9B,6EAA6E;IAC7E,gBAAgB,CAAC,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jectMeta } from './project';
|
|
2
2
|
import { BlockPackSpec } from './block_registry/block_pack_spec';
|
|
3
|
-
import { BlockRenderingMode, BlockSection, NavigationState } from '@milaboratories/pl-model-common';
|
|
3
|
+
import { BlockCodeFeatureFlags, BlockRenderingMode, BlockSection, NavigationState } from '@milaboratories/pl-model-common';
|
|
4
4
|
import { AuthorMarker } from './author_marker';
|
|
5
5
|
import { UpdateSuggestions } from './update_info';
|
|
6
6
|
import { BlockSettings } from './block_settings';
|
|
@@ -104,6 +104,18 @@ export type BlockStateOverview = {
|
|
|
104
104
|
* Udefined when block-pack for this block is not yet materialized.
|
|
105
105
|
* */
|
|
106
106
|
sdkVersion: string | undefined;
|
|
107
|
+
/**
|
|
108
|
+
* Feature flags the block was compiled with.
|
|
109
|
+
* Udefined when block-pack for this block is not yet materialized.
|
|
110
|
+
* */
|
|
111
|
+
featureFlags: BlockCodeFeatureFlags | undefined;
|
|
112
|
+
/**
|
|
113
|
+
* True if block is incompatible with the runtime.
|
|
114
|
+
* Other properties of this block overview will be filled with best effort.
|
|
115
|
+
* This block should not be openable; the only available action for it is deletion.
|
|
116
|
+
* Undefined when block-pack for this block is not yet materialized.
|
|
117
|
+
* */
|
|
118
|
+
isIncompatibleWithRuntime: boolean | undefined;
|
|
107
119
|
/** Information on where the block pack for this block came from */
|
|
108
120
|
currentBlockPack: BlockPackSpec | undefined;
|
|
109
121
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"project_overview.d.ts","sourceRoot":"","sources":["../src/project_overview.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AACxC,OAAO,EAAE,aAAa,EAAE,MAAM,kCAAkC,CAAC;AACjE,OAAO,EAAE,kBAAkB,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,iCAAiC,CAAC;
|
|
1
|
+
{"version":3,"file":"project_overview.d.ts","sourceRoot":"","sources":["../src/project_overview.ts"],"names":[],"mappings":"AAAA,OA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;;;SAGK;IACL,YAAY,CAAC,EAAE,MAAM,CAAC;IAEtB,2CAA2C;IAC3C,iBAAiB,EAAE,sBAAsB,CAAC;IAE1C;;;SAGK;IACL,SAAS,EAAE,MAAM,EAAE,CAAC;IAEpB;;;SAGK;IACL,WAAW,EAAE,MAAM,EAAE,CAAC;IAEtB;;;SAGK;IACL,QAAQ,EAAE,YAAY,EAAE,GAAG,SAAS,CAAC;IAErC;;;SAGK;IACL,WAAW,EAAE,OAAO,GAAG,SAAS,CAAC;IAEjC;;;SAGK;IACL,MAAM,EAAE,OAAO,CAAC;IAEhB;;;SAGK;IACL,UAAU,EAAE,MAAM,GAAG,SAAS,CAAC;IAE/B;;;SAGK;IACL,YAAY,EAAE,qBAAqB,GAAG,SAAS,CAAC;IAEhD;;;;;SAKK;IACL,yBAAyB,EAAE,OAAO,GAAG,SAAS,CAAC;IAE/C,mEAAmE;IACnE,gBAAgB,EAAE,aAAa,GAAG,SAAS,CAAC;IAE5C;;;SAGK;IACL,gBAAgB,EAAE,aAAa,GAAG,SAAS,CAAC;IAE5C,6BAA6B;IAC7B,QAAQ,EAAE,aAAa,CAAC;IAExB,8BAA8B;IAC9B,iBAAiB,EAAE,iBAAiB,CAAC;IAErC,4CAA4C;IAC5C,eAAe,EAAE,eAAe,CAAC;CAClC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@milaboratories/pl-model-middle-layer",
|
|
3
|
-
"version": "1.7.
|
|
3
|
+
"version": "1.7.45",
|
|
4
4
|
"description": "Common model between middle layer and non-block UI code",
|
|
5
5
|
"types": "./dist/index.d.ts",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
"remeda": "^2.22.6",
|
|
21
21
|
"zod": "~3.23.8",
|
|
22
22
|
"utility-types": "^3.11.0",
|
|
23
|
-
"@milaboratories/pl-model-common": "^1.
|
|
23
|
+
"@milaboratories/pl-model-common": "^1.16.0"
|
|
24
24
|
},
|
|
25
25
|
"devDependencies": {
|
|
26
26
|
"typescript": "~5.6.3",
|
|
@@ -3,6 +3,7 @@ import { BlockComponentsDescriptionRaw } from './block_components';
|
|
|
3
3
|
import { BlockPackMetaDescriptionRaw } from './block_meta';
|
|
4
4
|
import { BlockPackId } from './block_id';
|
|
5
5
|
import * as R from 'remeda';
|
|
6
|
+
import { BlockCodeKnownFeatureFlags } from '@milaboratories/pl-model-common';
|
|
6
7
|
|
|
7
8
|
/** Description, as appears in root block package.json file,
|
|
8
9
|
* `file:` references are parsed into relative content of corresponding type, depending on the context,
|
|
@@ -12,6 +13,9 @@ export const BlockPackDescriptionFromPackageJsonRaw = z.object({
|
|
|
12
13
|
meta: BlockPackMetaDescriptionRaw
|
|
13
14
|
});
|
|
14
15
|
|
|
16
|
+
export const FeatureFlags = z.record(z.string(), z.union([z.boolean(), z.number()]))
|
|
17
|
+
.transform((flags) => flags as BlockCodeKnownFeatureFlags);
|
|
18
|
+
|
|
15
19
|
export function CreateBlockPackDescriptionSchema<
|
|
16
20
|
Components extends ZodTypeAny,
|
|
17
21
|
Meta extends ZodTypeAny
|
|
@@ -19,7 +23,8 @@ export function CreateBlockPackDescriptionSchema<
|
|
|
19
23
|
return z.object({
|
|
20
24
|
id: BlockPackId,
|
|
21
25
|
components,
|
|
22
|
-
meta
|
|
26
|
+
meta,
|
|
27
|
+
featureFlags: FeatureFlags.optional()
|
|
23
28
|
});
|
|
24
29
|
}
|
|
25
30
|
|
|
@@ -3,6 +3,7 @@ import {
|
|
|
3
3
|
BlockPackId,
|
|
4
4
|
BlockPackIdNoVersion,
|
|
5
5
|
BlockPackMetaEmbeddedBytes,
|
|
6
|
+
FeatureFlags,
|
|
6
7
|
SemVer
|
|
7
8
|
} from '../block_meta';
|
|
8
9
|
import { BlockPackFromRegistryV2, BlockPackSpec } from './block_pack_spec';
|
|
@@ -34,7 +35,8 @@ export const VersionWithChannels = z.object({
|
|
|
34
35
|
export const SingleBlockPackOverview = z.object({
|
|
35
36
|
id: BlockPackId,
|
|
36
37
|
meta: BlockPackMetaEmbeddedBytes,
|
|
37
|
-
|
|
38
|
+
featureFlags: FeatureFlags.optional(),
|
|
39
|
+
spec: BlockPackSpec,
|
|
38
40
|
});
|
|
39
41
|
export type SingleBlockPackOverview = z.infer<typeof SingleBlockPackOverview>;
|
|
40
42
|
|
|
@@ -8,7 +8,7 @@ import {
|
|
|
8
8
|
UniqueValuesResponse
|
|
9
9
|
} from '@milaboratories/pl-model-common';
|
|
10
10
|
import { CreateTableRequestV3 } from './create_table';
|
|
11
|
-
import { PTableV5 } from './table';
|
|
11
|
+
import { PTableV5, PTableV6 } from './table';
|
|
12
12
|
|
|
13
13
|
/** Read interface exposed by PFrames library */
|
|
14
14
|
export interface PFrameReadAPIV7 {
|
|
@@ -42,3 +42,36 @@ export interface PFrameReadAPIV7 {
|
|
|
42
42
|
}
|
|
43
43
|
): Promise<UniqueValuesResponse>;
|
|
44
44
|
}
|
|
45
|
+
|
|
46
|
+
/** Read interface exposed by PFrames library */
|
|
47
|
+
export interface PFrameReadAPIV8 {
|
|
48
|
+
/**
|
|
49
|
+
* Finds columns given filtering criteria on column name, annotations etc.
|
|
50
|
+
* and a set of qualified axes specs to find only columns with compatible
|
|
51
|
+
* axes spec.
|
|
52
|
+
*
|
|
53
|
+
* Only column specs are used, this method will work even for columns
|
|
54
|
+
* with no assigned data.
|
|
55
|
+
* */
|
|
56
|
+
findColumns(request: FindColumnsRequest): Promise<FindColumnsResponse>;
|
|
57
|
+
|
|
58
|
+
/** To be reviewed in the future */
|
|
59
|
+
deleteColumn(request: DeleteColumnFromColumnsRequest): Promise<DeleteColumnFromColumnsResponse>;
|
|
60
|
+
|
|
61
|
+
/** Retrieve single column spec */
|
|
62
|
+
getColumnSpec(columnId: PObjectId): Promise<PColumnSpec>;
|
|
63
|
+
|
|
64
|
+
/** Retrieve information about all columns currently added to the PFrame */
|
|
65
|
+
listColumns(): Promise<PColumnInfo[]>;
|
|
66
|
+
|
|
67
|
+
/** Calculates data for the table and returns an object to access it */
|
|
68
|
+
createTable(request: CreateTableRequestV3): PTableV6;
|
|
69
|
+
|
|
70
|
+
/** Calculate set of unique values for a specific axis for the filtered set of records */
|
|
71
|
+
getUniqueValues(
|
|
72
|
+
request: UniqueValuesRequest,
|
|
73
|
+
ops?: {
|
|
74
|
+
signal?: AbortSignal,
|
|
75
|
+
}
|
|
76
|
+
): Promise<UniqueValuesResponse>;
|
|
77
|
+
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { PFrameFactoryAPI } from './api_factory';
|
|
2
|
-
import type { PFrameReadAPIV7 } from './api_read';
|
|
2
|
+
import type { PFrameReadAPIV7, PFrameReadAPIV8 } from './api_read';
|
|
3
3
|
|
|
4
4
|
export type Logger = (
|
|
5
5
|
level: 'info' | 'warn' | 'error',
|
|
@@ -7,3 +7,5 @@ export type Logger = (
|
|
|
7
7
|
) => void;
|
|
8
8
|
|
|
9
9
|
export interface PFrameV7 extends PFrameFactoryAPI, PFrameReadAPIV7 {}
|
|
10
|
+
|
|
11
|
+
export interface PFrameV8 extends PFrameFactoryAPI, PFrameReadAPIV8 {}
|
|
@@ -63,3 +63,68 @@ export interface PTableV5 {
|
|
|
63
63
|
/** Deallocates all underlying resources */
|
|
64
64
|
dispose(): void;
|
|
65
65
|
}
|
|
66
|
+
|
|
67
|
+
/**
|
|
68
|
+
* Table view returned as a result of create table operation.
|
|
69
|
+
*
|
|
70
|
+
* PTable can be thought as having a composite primary key, consisting of axes,
|
|
71
|
+
* and a set of data columns derived from PColumn values.
|
|
72
|
+
* */
|
|
73
|
+
export interface PTableV6 {
|
|
74
|
+
/**
|
|
75
|
+
* Returns ordered array of table axes specs (primary key "columns" in SQL
|
|
76
|
+
* terms) and data column specs (regular "columns" in SQL terms).
|
|
77
|
+
*
|
|
78
|
+
* Data for a specific table column can be retrieved using unified indexing
|
|
79
|
+
* corresponding to elements in this array.
|
|
80
|
+
*
|
|
81
|
+
* Axes are always listed first.
|
|
82
|
+
* */
|
|
83
|
+
getSpec(): PTableColumnSpec[];
|
|
84
|
+
|
|
85
|
+
/** Transforms unified column identifiers into unified indices of columns. */
|
|
86
|
+
getColumnIndices(columnIds: PTableColumnId[]): number[];
|
|
87
|
+
|
|
88
|
+
/**
|
|
89
|
+
* Get PTable disk footprint in bytes
|
|
90
|
+
* Warning: This call materializes the join.
|
|
91
|
+
*/
|
|
92
|
+
getFootprint(ops?: {
|
|
93
|
+
withPredecessors?: boolean,
|
|
94
|
+
signal?: AbortSignal,
|
|
95
|
+
}): Promise<number>;
|
|
96
|
+
|
|
97
|
+
/**
|
|
98
|
+
* Unified table shape
|
|
99
|
+
* Warning: This call materializes the join.
|
|
100
|
+
*/
|
|
101
|
+
getShape(ops?: {
|
|
102
|
+
signal?: AbortSignal,
|
|
103
|
+
}): Promise<PTableShape>;
|
|
104
|
+
|
|
105
|
+
/**
|
|
106
|
+
* Retrieve the data from the table. To retrieve only data required, it can be
|
|
107
|
+
* sliced both horizontally ({@link columnIndices}) and vertically
|
|
108
|
+
* ({@link range}).
|
|
109
|
+
* This call materializes the join.
|
|
110
|
+
*
|
|
111
|
+
* @param columnIndices unified indices of columns to be retrieved
|
|
112
|
+
* @param range optionally limit the range of records to retrieve
|
|
113
|
+
* */
|
|
114
|
+
getData(
|
|
115
|
+
columnIndices: number[],
|
|
116
|
+
ops?: {
|
|
117
|
+
range?: TableRange,
|
|
118
|
+
signal?: AbortSignal,
|
|
119
|
+
},
|
|
120
|
+
): Promise<PTableVector[]>;
|
|
121
|
+
|
|
122
|
+
/** Filters the table and returns new PTable instance */
|
|
123
|
+
filter(request: PTableRecordFilter[]): PTableV6;
|
|
124
|
+
|
|
125
|
+
/** Sorts the table and returns new PTable instance. */
|
|
126
|
+
sort(request: PTableSorting[]): PTableV6;
|
|
127
|
+
|
|
128
|
+
/** Deallocates all underlying resources */
|
|
129
|
+
dispose(): void;
|
|
130
|
+
}
|
package/src/project_overview.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ProjectMeta } from './project';
|
|
2
2
|
import { BlockPackSpec } from './block_registry/block_pack_spec';
|
|
3
|
-
import { BlockRenderingMode, BlockSection, NavigationState } from '@milaboratories/pl-model-common';
|
|
3
|
+
import { BlockCodeFeatureFlags, BlockRenderingMode, BlockSection, NavigationState } from '@milaboratories/pl-model-common';
|
|
4
4
|
import { AuthorMarker } from './author_marker';
|
|
5
5
|
import { UpdateSuggestions } from './update_info';
|
|
6
6
|
import { BlockSettings } from './block_settings';
|
|
@@ -128,6 +128,20 @@ export type BlockStateOverview = {
|
|
|
128
128
|
* */
|
|
129
129
|
sdkVersion: string | undefined;
|
|
130
130
|
|
|
131
|
+
/**
|
|
132
|
+
* Feature flags the block was compiled with.
|
|
133
|
+
* Udefined when block-pack for this block is not yet materialized.
|
|
134
|
+
* */
|
|
135
|
+
featureFlags: BlockCodeFeatureFlags | undefined;
|
|
136
|
+
|
|
137
|
+
/**
|
|
138
|
+
* True if block is incompatible with the runtime.
|
|
139
|
+
* Other properties of this block overview will be filled with best effort.
|
|
140
|
+
* This block should not be openable; the only available action for it is deletion.
|
|
141
|
+
* Undefined when block-pack for this block is not yet materialized.
|
|
142
|
+
* */
|
|
143
|
+
isIncompatibleWithRuntime: boolean | undefined;
|
|
144
|
+
|
|
131
145
|
/** Information on where the block pack for this block came from */
|
|
132
146
|
currentBlockPack: BlockPackSpec | undefined;
|
|
133
147
|
|