@milaboratories/pl-model-middle-layer 1.8.41 → 1.8.42

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.
Files changed (104) hide show
  1. package/dist/block_meta/block_components.cjs +4 -4
  2. package/dist/block_meta/block_components.cjs.map +1 -1
  3. package/dist/block_meta/block_components.d.ts +0 -1
  4. package/dist/block_meta/block_components.d.ts.map +1 -1
  5. package/dist/block_meta/block_components.js +4 -4
  6. package/dist/block_meta/block_components.js.map +1 -1
  7. package/dist/block_meta/block_description.cjs +2 -2
  8. package/dist/block_meta/block_description.cjs.map +1 -1
  9. package/dist/block_meta/block_description.d.ts +116 -115
  10. package/dist/block_meta/block_description.d.ts.map +1 -1
  11. package/dist/block_meta/block_description.js +2 -2
  12. package/dist/block_meta/block_description.js.map +1 -1
  13. package/dist/block_meta/block_id.cjs +1 -1
  14. package/dist/block_meta/block_id.cjs.map +1 -1
  15. package/dist/block_meta/block_id.js +1 -1
  16. package/dist/block_meta/block_id.js.map +1 -1
  17. package/dist/block_meta/block_manifest.cjs +2 -2
  18. package/dist/block_meta/block_manifest.cjs.map +1 -1
  19. package/dist/block_meta/block_manifest.d.ts +1 -1
  20. package/dist/block_meta/block_manifest.d.ts.map +1 -1
  21. package/dist/block_meta/block_manifest.js +2 -2
  22. package/dist/block_meta/block_manifest.js.map +1 -1
  23. package/dist/block_meta/block_meta.cjs +3 -3
  24. package/dist/block_meta/block_meta.cjs.map +1 -1
  25. package/dist/block_meta/block_meta.js +3 -3
  26. package/dist/block_meta/block_meta.js.map +1 -1
  27. package/dist/block_meta/content_conversion.cjs.map +1 -1
  28. package/dist/block_meta/content_conversion.d.ts +1 -1
  29. package/dist/block_meta/content_conversion.d.ts.map +1 -1
  30. package/dist/block_meta/content_conversion.js.map +1 -1
  31. package/dist/block_meta/content_types.cjs +23 -23
  32. package/dist/block_meta/content_types.cjs.map +1 -1
  33. package/dist/block_meta/content_types.js +23 -23
  34. package/dist/block_meta/content_types.js.map +1 -1
  35. package/dist/block_meta/semver.cjs.map +1 -1
  36. package/dist/block_meta/semver.js.map +1 -1
  37. package/dist/block_registry/block_pack_spec.cjs +5 -5
  38. package/dist/block_registry/block_pack_spec.cjs.map +1 -1
  39. package/dist/block_registry/block_pack_spec.js +5 -5
  40. package/dist/block_registry/block_pack_spec.js.map +1 -1
  41. package/dist/block_registry/overview.cjs +6 -6
  42. package/dist/block_registry/overview.cjs.map +1 -1
  43. package/dist/block_registry/overview.d.ts.map +1 -1
  44. package/dist/block_registry/overview.js +6 -6
  45. package/dist/block_registry/overview.js.map +1 -1
  46. package/dist/block_registry/registry_spec.cjs +5 -5
  47. package/dist/block_registry/registry_spec.cjs.map +1 -1
  48. package/dist/block_registry/registry_spec.js +5 -5
  49. package/dist/block_registry/registry_spec.js.map +1 -1
  50. package/dist/block_state.d.ts +2 -2
  51. package/dist/block_state.d.ts.map +1 -1
  52. package/dist/pframe/internal_api/api_factory.cjs.map +1 -1
  53. package/dist/pframe/internal_api/api_factory.d.ts +2 -2
  54. package/dist/pframe/internal_api/api_factory.d.ts.map +1 -1
  55. package/dist/pframe/internal_api/api_factory.js.map +1 -1
  56. package/dist/pframe/internal_api/api_read.d.ts +34 -6
  57. package/dist/pframe/internal_api/api_read.d.ts.map +1 -1
  58. package/dist/pframe/internal_api/common.d.ts +3 -1
  59. package/dist/pframe/internal_api/common.d.ts.map +1 -1
  60. package/dist/pframe/internal_api/create_table.d.ts +2 -2
  61. package/dist/pframe/internal_api/create_table.d.ts.map +1 -1
  62. package/dist/pframe/internal_api/delete_column.d.ts +1 -1
  63. package/dist/pframe/internal_api/delete_column.d.ts.map +1 -1
  64. package/dist/pframe/internal_api/find_columns.d.ts +2 -2
  65. package/dist/pframe/internal_api/find_columns.d.ts.map +1 -1
  66. package/dist/pframe/internal_api/http_helpers.cjs.map +1 -1
  67. package/dist/pframe/internal_api/http_helpers.d.ts +27 -27
  68. package/dist/pframe/internal_api/http_helpers.d.ts.map +1 -1
  69. package/dist/pframe/internal_api/http_helpers.js.map +1 -1
  70. package/dist/pframe/internal_api/pframe.d.ts +28 -1
  71. package/dist/pframe/internal_api/pframe.d.ts.map +1 -1
  72. package/dist/pframe/internal_api/table.d.ts +55 -2
  73. package/dist/pframe/internal_api/table.d.ts.map +1 -1
  74. package/dist/project_list.d.ts +1 -1
  75. package/dist/project_list.d.ts.map +1 -1
  76. package/dist/project_overview.d.ts +5 -5
  77. package/dist/project_overview.d.ts.map +1 -1
  78. package/dist/update_info.d.ts +1 -1
  79. package/dist/update_info.d.ts.map +1 -1
  80. package/package.json +7 -4
  81. package/src/block_meta/block_components.ts +6 -8
  82. package/src/block_meta/block_description.ts +8 -7
  83. package/src/block_meta/block_id.ts +4 -4
  84. package/src/block_meta/block_manifest.ts +5 -5
  85. package/src/block_meta/block_meta.ts +8 -8
  86. package/src/block_meta/content_conversion.ts +4 -4
  87. package/src/block_meta/content_types.ts +24 -24
  88. package/src/block_meta/semver.ts +1 -1
  89. package/src/block_registry/block_pack_spec.ts +5 -5
  90. package/src/block_registry/overview.ts +10 -9
  91. package/src/block_registry/registry_spec.ts +5 -5
  92. package/src/block_state.ts +3 -3
  93. package/src/pframe/internal_api/api_factory.ts +3 -6
  94. package/src/pframe/internal_api/api_read.ts +49 -8
  95. package/src/pframe/internal_api/common.ts +11 -2
  96. package/src/pframe/internal_api/create_table.ts +3 -3
  97. package/src/pframe/internal_api/delete_column.ts +1 -1
  98. package/src/pframe/internal_api/find_columns.ts +2 -2
  99. package/src/pframe/internal_api/http_helpers.ts +44 -44
  100. package/src/pframe/internal_api/pframe.ts +36 -2
  101. package/src/pframe/internal_api/table.ts +75 -7
  102. package/src/project_list.ts +1 -1
  103. package/src/project_overview.ts +5 -5
  104. package/src/update_info.ts +1 -1
@@ -2,35 +2,35 @@ import { z } from 'zod';
2
2
 
3
3
  export const LocalDevFolder = z.object({
4
4
  type: z.literal('local-dev'),
5
- path: z.string()
5
+ path: z.string(),
6
6
  });
7
7
  export type LocalDevFolder = z.infer<typeof LocalDevFolder>;
8
8
 
9
9
  /** @deprecated don't use */
10
10
  export const RemoteRegistryV1Spec = z.object({
11
11
  type: z.literal('remote-v1'),
12
- url: z.string().url()
12
+ url: z.string().url(),
13
13
  });
14
14
  /** @deprecated don't use */
15
15
  export type RemoteRegistryV1Spec = z.infer<typeof RemoteRegistryV1Spec>;
16
16
 
17
17
  export const RemoteRegistryV2Spec = z.object({
18
18
  type: z.literal('remote-v2'),
19
- url: z.string().url()
19
+ url: z.string().url(),
20
20
  });
21
21
  export type RemoteRegistryV2Spec = z.infer<typeof RemoteRegistryV2Spec>;
22
22
 
23
23
  export const RegistrySpec = z.discriminatedUnion('type', [
24
24
  RemoteRegistryV1Spec,
25
25
  RemoteRegistryV2Spec,
26
- LocalDevFolder
26
+ LocalDevFolder,
27
27
  ]);
28
28
  export type RegistrySpec = z.infer<typeof RegistrySpec>;
29
29
 
30
30
  export const RegistryEntry = z.object({
31
31
  id: z.string(),
32
32
  title: z.string().optional(),
33
- spec: RegistrySpec
33
+ spec: RegistrySpec,
34
34
  });
35
35
  export type RegistryEntry = z.infer<typeof RegistryEntry>;
36
36
 
@@ -1,9 +1,9 @@
1
- import { BlockOutputsBase, BlockState } from '@milaboratories/pl-model-common';
2
- import { Optional } from 'utility-types';
1
+ import type { BlockOutputsBase, BlockState } from '@milaboratories/pl-model-common';
2
+ import type { Optional } from 'utility-types';
3
3
 
4
4
  export type BlockStateInternal<
5
5
  Args = unknown,
6
6
  Outputs extends BlockOutputsBase = BlockOutputsBase,
7
7
  UiState = unknown,
8
- Href extends `/${string}` = `/${string}`
8
+ Href extends `/${string}` = `/${string}`,
9
9
  > = Optional<Readonly<BlockState<Args, Outputs, UiState, Href>>, 'outputs'>;
@@ -1,4 +1,4 @@
1
- import {
1
+ import type {
2
2
  BinaryPartitionedDataInfo,
3
3
  Branded,
4
4
  JsonDataInfo,
@@ -8,10 +8,7 @@ import {
8
8
  PColumnSpec,
9
9
  PObjectId,
10
10
  } from '@milaboratories/pl-model-common';
11
- import {
12
- HttpHelpers,
13
- HttpServerInfo,
14
- } from './http_helpers';
11
+ import type { HttpServerInfo } from './http_helpers';
15
12
 
16
13
  /** PColumn spec file extension */
17
14
  export const SpecExtension = '.spec' as const;
@@ -74,7 +71,7 @@ export interface PFrameFactoryAPIV4 extends Disposable {
74
71
  columnId: PObjectId,
75
72
  dataInfo: DataInfo<PFrameBlobId>,
76
73
  options?: {
77
- signal?: AbortSignal,
74
+ signal?: AbortSignal;
78
75
  }
79
76
  ): Promise<void>;
80
77
 
@@ -1,14 +1,17 @@
1
- import { FindColumnsRequest, FindColumnsResponse } from './find_columns';
2
- import { DeleteColumnFromColumnsRequest, DeleteColumnFromColumnsResponse } from './delete_column';
3
- import {
1
+ import type { FindColumnsRequest, FindColumnsResponse } from './find_columns';
2
+ import type { DeleteColumnFromColumnsRequest, DeleteColumnFromColumnsResponse } from './delete_column';
3
+ import type {
4
4
  PColumnInfo,
5
5
  PColumnSpec,
6
6
  PObjectId,
7
7
  UniqueValuesRequest,
8
- UniqueValuesResponse
8
+ UniqueValuesResponse,
9
9
  } from '@milaboratories/pl-model-common';
10
- import { CreateTableRequestV4 } from './create_table';
11
- import { PTableV7 } from './table';
10
+ import type { CreateTableRequestV4 } from './create_table';
11
+ import type { PTableV7, PTableV8 } from './table';
12
+ import type { PTableId } from './common';
13
+
14
+ // REMOVE AFTER MIGRATION BEGIN...
12
15
 
13
16
  /** Read interface exposed by PFrames library */
14
17
  export interface PFrameReadAPIV10 {
@@ -29,7 +32,7 @@ export interface PFrameReadAPIV10 {
29
32
  deleteColumn(request: DeleteColumnFromColumnsRequest): Promise<DeleteColumnFromColumnsResponse>;
30
33
 
31
34
  /** Retrieve single column spec */
32
- getColumnSpec(columnId: PObjectId): Promise<PColumnSpec>;
35
+ getColumnSpec(columnId: PObjectId): Promise<PColumnSpec | null>;
33
36
 
34
37
  /** Retrieve information about all columns currently added to the PFrame */
35
38
  listColumns(): Promise<PColumnInfo[]>;
@@ -41,7 +44,45 @@ export interface PFrameReadAPIV10 {
41
44
  getUniqueValues(
42
45
  request: UniqueValuesRequest,
43
46
  ops?: {
44
- signal?: AbortSignal,
47
+ signal?: AbortSignal;
48
+ }
49
+ ): Promise<UniqueValuesResponse>;
50
+ }
51
+
52
+ // ...REMOVE AFTER MIGRATION END
53
+
54
+ /** Read interface exposed by PFrames library */
55
+ export interface PFrameReadAPIV11 {
56
+ /**
57
+ * Finds columns given filtering criteria on column name, annotations etc.
58
+ * and a set of qualified axes specs to find only columns with compatible
59
+ * axes spec.
60
+ *
61
+ * Only column specs are used, this method will work even for columns
62
+ * with no assigned data.
63
+ * */
64
+ findColumns(request: FindColumnsRequest): Promise<FindColumnsResponse>;
65
+
66
+ /**
67
+ * Construct new axes integration with some entry removed but integration qualificaitons preserved.
68
+ * Removes more then one entry in case the removal will create several disjoint sets of axes.
69
+ */
70
+ deleteColumn(request: DeleteColumnFromColumnsRequest): Promise<DeleteColumnFromColumnsResponse>;
71
+
72
+ /** Retrieve single column spec */
73
+ getColumnSpec(columnId: PObjectId): Promise<PColumnSpec | null>;
74
+
75
+ /** Retrieve information about all columns currently added to the PFrame */
76
+ listColumns(): Promise<PColumnInfo[]>;
77
+
78
+ /** Calculates data for the table and returns an object to access it */
79
+ createTable(tableId: PTableId, request: CreateTableRequestV4): PTableV8;
80
+
81
+ /** Calculate set of unique values for a specific axis for the filtered set of records */
82
+ getUniqueValues(
83
+ request: UniqueValuesRequest,
84
+ ops?: {
85
+ signal?: AbortSignal;
45
86
  }
46
87
  ): Promise<UniqueValuesResponse>;
47
88
  }
@@ -1,10 +1,19 @@
1
- import { AxisSpec, ValueType } from '@milaboratories/pl-model-common';
1
+ import type {
2
+ AxisSpec,
3
+ PFrameHandle,
4
+ PTableHandle,
5
+ ValueType,
6
+ } from '@milaboratories/pl-model-common';
2
7
 
3
8
  export type Logger = (
4
9
  level: 'info' | 'warn' | 'error',
5
10
  message: string
6
11
  ) => void;
7
12
 
13
+ export type PFrameId = PFrameHandle;
14
+
15
+ export type PTableId = PTableHandle;
16
+
8
17
  export interface SingleAxisSelector {
9
18
  name: string;
10
19
  type?: ValueType;
@@ -25,4 +34,4 @@ export type ConstantAxisFilter = {
25
34
  type: 'constant';
26
35
  axisIndex: number;
27
36
  constant: string | number;
28
- }
37
+ };
@@ -1,5 +1,5 @@
1
- import { ConstantAxisFilter } from './common';
2
- import { JsonDataInfo, PColumnSpec, PObjectId, PTableRecordFilter } from '@milaboratories/pl-model-common';
1
+ import type { ConstantAxisFilter } from './common';
2
+ import type { JsonDataInfo, PColumnSpec, PObjectId, PTableRecordFilter } from '@milaboratories/pl-model-common';
3
3
 
4
4
  export interface ColumnJoinEntry {
5
5
  type: 'column';
@@ -43,7 +43,7 @@ export interface OuterJoinV4 {
43
43
  secondary: JoinEntryV4[];
44
44
  }
45
45
 
46
- export type JoinEntryV4 =
46
+ export type JoinEntryV4 =
47
47
  | ColumnJoinEntry
48
48
  | SlicedColumnJoinEntry
49
49
  | ArtificialColumnJoinEntry
@@ -1,4 +1,4 @@
1
- import { ColumnAxesWithQualifications } from './common';
1
+ import type { ColumnAxesWithQualifications } from './common';
2
2
 
3
3
  export interface DeleteColumnFromColumnsRequest {
4
4
  columns: ColumnAxesWithQualifications[];
@@ -1,5 +1,5 @@
1
- import { ColumnFilter, PColumnIdAndSpec } from '@milaboratories/pl-model-common';
2
- import { AxisQualification, ColumnAxesWithQualifications } from './common';
1
+ import type { ColumnFilter, PColumnIdAndSpec } from '@milaboratories/pl-model-common';
2
+ import type { AxisQualification, ColumnAxesWithQualifications } from './common';
3
3
 
4
4
  export interface FindColumnsRequest {
5
5
  columnFilter: ColumnFilter;
@@ -14,54 +14,54 @@ export type FileRange = {
14
14
  start: number;
15
15
  /** End byte position (inclusive) */
16
16
  end: number;
17
- }
17
+ };
18
18
 
19
19
  /** HTTP range as of RFC 9110 <https://datatracker.ietf.org/doc/html/rfc9110#name-range> */
20
20
  export type HttpRange =
21
21
  | {
22
- /**
22
+ /**
23
23
  * Get file content in the specified byte range
24
- *
24
+ *
25
25
  * @example
26
26
  * ```
27
27
  * GET /file.parquet HTTP/1.1
28
28
  * Range: bytes=0-1023
29
29
  * ```
30
30
  */
31
- type: 'bounded';
32
- /** Start byte position (inclusive) */
33
- start: number;
34
- /** End byte position (inclusive) */
35
- end: number;
36
- }
31
+ type: 'bounded';
32
+ /** Start byte position (inclusive) */
33
+ start: number;
34
+ /** End byte position (inclusive) */
35
+ end: number;
36
+ }
37
37
  | {
38
- /**
38
+ /**
39
39
  * Get byte range starting from the specified offset
40
- *
40
+ *
41
41
  * @example
42
42
  * ```
43
43
  * GET /file.parquet HTTP/1.1
44
44
  * Range: bytes=1024-
45
45
  * ```
46
46
  */
47
- type: 'offset';
48
- /** Start byte position (inclusive) */
49
- offset: number;
50
- }
47
+ type: 'offset';
48
+ /** Start byte position (inclusive) */
49
+ offset: number;
50
+ }
51
51
  | {
52
- /**
52
+ /**
53
53
  * Get byte range starting from the specified suffix
54
- *
54
+ *
55
55
  * @example
56
56
  * ```
57
57
  * GET /file.parquet HTTP/1.1
58
58
  * Range: bytes=-1024
59
59
  * ```
60
60
  */
61
- type: 'suffix';
62
- /** End byte position (inclusive) */
63
- suffix: number;
64
- };
61
+ type: 'suffix';
62
+ /** End byte position (inclusive) */
63
+ suffix: number;
64
+ };
65
65
 
66
66
  /** HTTP method passed to object store */
67
67
  export type HttpMethod = 'GET' | 'HEAD';
@@ -69,32 +69,32 @@ export type HttpMethod = 'GET' | 'HEAD';
69
69
  /** HTTP response from object store */
70
70
  export type ObjectStoreResponse =
71
71
  | {
72
- /**
72
+ /**
73
73
  * Will be translated to 500 Internal Server Error by the handler
74
74
  * or 408 Request Timeout if the request was aborted
75
75
  */
76
- type: 'InternalError';
77
- }
76
+ type: 'InternalError';
77
+ }
78
78
  | {
79
- /** Will be translated to 404 Not Found by the handler */
80
- type: 'NotFound';
81
- }
79
+ /** Will be translated to 404 Not Found by the handler */
80
+ type: 'NotFound';
81
+ }
82
82
  | {
83
- /** Will be translated to 416 Range Not Satisfiable by the handler */
84
- type: 'RangeNotSatisfiable';
85
- /** Total file size in bytes */
86
- size: number;
87
- }
83
+ /** Will be translated to 416 Range Not Satisfiable by the handler */
84
+ type: 'RangeNotSatisfiable';
85
+ /** Total file size in bytes */
86
+ size: number;
87
+ }
88
88
  | {
89
- /** Will be translated to 200 OK or 206 Partial Content by the handler */
90
- type: 'Ok';
91
- /** Total file size in bytes */
92
- size: number;
93
- /** File range translated from HTTP range */
94
- range: FileRange;
95
- /** Stream of file content, undefined for HEAD requests */
96
- data?: Readable;
97
- }
89
+ /** Will be translated to 200 OK or 206 Partial Content by the handler */
90
+ type: 'Ok';
91
+ /** Total file size in bytes */
92
+ size: number;
93
+ /** File range translated from HTTP range */
94
+ range: FileRange;
95
+ /** Stream of file content, undefined for HEAD requests */
96
+ data?: Readable;
97
+ };
98
98
 
99
99
  /** Common options for object store creation */
100
100
  export interface ObjectStoreOptions {
@@ -173,7 +173,7 @@ export type RequestHandlerOptions = {
173
173
  /** Object store to serve files from, @see HttpHelpers.createFsStore */
174
174
  store: ObjectStore;
175
175
  /** Here will go caching options... */
176
- }
176
+ };
177
177
 
178
178
  /** Server configuration options */
179
179
  export type HttpServerOptions = {
@@ -189,7 +189,7 @@ export type HttpServerOptions = {
189
189
 
190
190
  /**
191
191
  * Long unique opaque string for use in Bearer authorization header
192
- *
192
+ *
193
193
  * @example
194
194
  * ```ts
195
195
  * request.setHeader('Authorization', `Bearer ${authToken}`);
@@ -199,7 +199,7 @@ export type HttpAuthorizationToken = Branded<string, 'PFrameInternal.HttpAuthori
199
199
 
200
200
  /**
201
201
  * TLS certificate in PEM format
202
- *
202
+ *
203
203
  * @example
204
204
  * ```txt
205
205
  * -----BEGIN CERTIFICATE-----
@@ -1,6 +1,9 @@
1
1
  import type { PFrameFactoryAPIV4 } from './api_factory';
2
- import type { PFrameReadAPIV10 } from './api_read';
2
+ import type { PFrameReadAPIV10, PFrameReadAPIV11 } from './api_read';
3
3
  import type { Logger } from './common';
4
+ import type { PFrameId } from './common';
5
+
6
+ // REMOVE AFTER MIGRATION BEGIN...
4
7
 
5
8
  export interface PFrameV12 extends PFrameFactoryAPIV4, PFrameReadAPIV10 {}
6
9
 
@@ -9,7 +12,7 @@ export type PFrameOptions = {
9
12
  spillPath: string;
10
13
  /** Logger instance, no logging is performed when not provided */
11
14
  logger?: Logger;
12
- }
15
+ };
13
16
 
14
17
  /** List of PFrame management functions exposed by PFrame module */
15
18
  export interface PFrameFactoryV3 {
@@ -28,3 +31,34 @@ export interface PFrameFactoryV3 {
28
31
  */
29
32
  pprofDump: () => Promise<Uint8Array>;
30
33
  };
34
+
35
+ // ...REMOVE AFTER MIGRATION END
36
+
37
+ export interface PFrameV13 extends PFrameFactoryAPIV4, PFrameReadAPIV11 {}
38
+
39
+ export type PFrameOptionsV2 = {
40
+ /** PFrame ID for logging purposes */
41
+ frameId: PFrameId;
42
+ /** Path to directory where PFrame can create temporary files */
43
+ spillPath: string;
44
+ /** Logger instance, no logging is performed when not provided */
45
+ logger?: Logger;
46
+ };
47
+
48
+ /** List of PFrame management functions exposed by PFrame module */
49
+ export interface PFrameFactoryV4 {
50
+ /**
51
+ * Create a new PFrame instance.
52
+ * @warning Use concurrency limiting to avoid OOM crashes when multiple instances are simultaneously in use.
53
+ */
54
+ createPFrame(options: PFrameOptionsV2): PFrameV13;
55
+
56
+ /**
57
+ * Dump active allocations from all PFrames instances in pprof format.
58
+ * The result of this function should be saved as `profile.pb.gz`.
59
+ * Use {@link https://pprof.me/} or {@link https://www.speedscope.app/}
60
+ * to view the allocation flamechart.
61
+ * @warning This method will always reject on Windows!
62
+ */
63
+ pprofDump: () => Promise<Uint8Array>;
64
+ };
@@ -1,12 +1,15 @@
1
- import {
1
+ import type {
2
2
  PTableColumnId,
3
3
  PTableColumnSpec,
4
4
  PTableRecordFilter,
5
5
  PTableShape,
6
6
  PTableSorting,
7
7
  PTableVector,
8
- TableRange
8
+ TableRange,
9
9
  } from '@milaboratories/pl-model-common';
10
+ import type { PTableId } from './common';
11
+
12
+ // REMOVE AFTER MIGRATION BEGIN...
10
13
 
11
14
  /**
12
15
  * Table view returned as a result of create table operation.
@@ -34,8 +37,7 @@ export interface PTableV7 extends Disposable {
34
37
  * Warning: This call materializes the join.
35
38
  */
36
39
  getFootprint(ops?: {
37
- withPredecessors?: boolean,
38
- signal?: AbortSignal,
40
+ signal?: AbortSignal;
39
41
  }): Promise<number>;
40
42
 
41
43
  /**
@@ -43,7 +45,7 @@ export interface PTableV7 extends Disposable {
43
45
  * Warning: This call materializes the join.
44
46
  */
45
47
  getShape(ops?: {
46
- signal?: AbortSignal,
48
+ signal?: AbortSignal;
47
49
  }): Promise<PTableShape>;
48
50
 
49
51
  /**
@@ -58,8 +60,8 @@ export interface PTableV7 extends Disposable {
58
60
  getData(
59
61
  columnIndices: number[],
60
62
  ops?: {
61
- range?: TableRange,
62
- signal?: AbortSignal,
63
+ range?: TableRange;
64
+ signal?: AbortSignal;
63
65
  },
64
66
  ): Promise<PTableVector[]>;
65
67
 
@@ -72,3 +74,69 @@ export interface PTableV7 extends Disposable {
72
74
  /** Deallocates all underlying resources */
73
75
  dispose(): void;
74
76
  }
77
+
78
+ // ...REMOVE AFTER MIGRATION END
79
+
80
+ /**
81
+ * Table view returned as a result of create table operation.
82
+ *
83
+ * PTable can be thought as having a composite primary key, consisting of axes,
84
+ * and a set of data columns derived from PColumn values.
85
+ * */
86
+ export interface PTableV8 extends Disposable {
87
+ /**
88
+ * Returns ordered array of table axes specs (primary key "columns" in SQL
89
+ * terms) and data column specs (regular "columns" in SQL terms).
90
+ *
91
+ * Data for a specific table column can be retrieved using unified indexing
92
+ * corresponding to elements in this array.
93
+ *
94
+ * Axes are always listed first.
95
+ * */
96
+ getSpec(): PTableColumnSpec[];
97
+
98
+ /** Transforms unified column identifiers into unified indices of columns. */
99
+ getColumnIndices(columnIds: PTableColumnId[]): number[];
100
+
101
+ /**
102
+ * Get PTable disk footprint in bytes
103
+ * Warning: This call materializes the join.
104
+ */
105
+ getFootprint(ops?: {
106
+ signal?: AbortSignal;
107
+ }): Promise<number>;
108
+
109
+ /**
110
+ * Unified table shape
111
+ * Warning: This call materializes the join.
112
+ */
113
+ getShape(ops?: {
114
+ signal?: AbortSignal;
115
+ }): Promise<PTableShape>;
116
+
117
+ /**
118
+ * Retrieve the data from the table. To retrieve only data required, it can be
119
+ * sliced both horizontally ({@link columnIndices}) and vertically
120
+ * ({@link range}).
121
+ * This call materializes the join.
122
+ *
123
+ * @param columnIndices unified indices of columns to be retrieved
124
+ * @param range optionally limit the range of records to retrieve
125
+ * */
126
+ getData(
127
+ columnIndices: number[],
128
+ ops?: {
129
+ range?: TableRange;
130
+ signal?: AbortSignal;
131
+ },
132
+ ): Promise<PTableVector[]>;
133
+
134
+ /** Filters the table and returns new PTable instance */
135
+ filter(tableId: PTableId, request: PTableRecordFilter[]): PTableV8;
136
+
137
+ /** Sorts the table and returns new PTable instance. */
138
+ sort(tableId: PTableId, request: PTableSorting[]): PTableV8;
139
+
140
+ /** Deallocates all underlying resources */
141
+ dispose(): void;
142
+ }
@@ -1,4 +1,4 @@
1
- import { ProjectMeta } from './project';
1
+ import type { ProjectMeta } from './project';
2
2
 
3
3
  /** Represents single entry in the list of projects owned by current user */
4
4
  export interface ProjectListEntry {
@@ -1,8 +1,8 @@
1
- import { ProjectMeta } from './project';
2
- import { BlockPackSpec } from './block_registry/block_pack_spec';
3
- import { BlockCodeFeatureFlags, BlockRenderingMode, BlockSection, NavigationState, AuthorMarker } from '@milaboratories/pl-model-common';
4
- import { UpdateSuggestions } from './update_info';
5
- import { BlockSettings } from './block_settings';
1
+ import type { ProjectMeta } from './project';
2
+ import type { BlockPackSpec } from './block_registry/block_pack_spec';
3
+ import type { BlockCodeFeatureFlags, BlockRenderingMode, BlockSection, NavigationState, AuthorMarker } from '@milaboratories/pl-model-common';
4
+ import type { UpdateSuggestions } from './update_info';
5
+ import type { BlockSettings } from './block_settings';
6
6
 
7
7
  /** Generalized block status, to be used in block item "styling". */
8
8
  export type BlockCalculationStatus = 'NotCalculated' | 'Running' | 'Done' | 'Limbo';
@@ -1,4 +1,4 @@
1
- import { BlockPackSpec } from './block_registry';
1
+ import type { BlockPackSpec } from './block_registry';
2
2
 
3
3
  /** Communicates possible block update option */
4
4
  export type UpdateSuggestion<V = BlockPackSpec> = {