@milaboratories/pl-model-middle-layer 1.7.36 → 1.7.38

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.
@@ -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 { PTableV4 } from './table';
5
+ import { PTableV4, PTableV5 } from './table';
6
6
  /** Read interface exposed by PFrames library */
7
7
  export interface PFrameReadAPIV6 {
8
8
  /**
@@ -25,4 +25,28 @@ export interface PFrameReadAPIV6 {
25
25
  /** Calculate set of unique values for a specific axis for the filtered set of records */
26
26
  getUniqueValues(request: UniqueValuesRequest, signal?: AbortSignal): Promise<UniqueValuesResponse>;
27
27
  }
28
+ /** Read interface exposed by PFrames library */
29
+ export interface PFrameReadAPIV7 {
30
+ /**
31
+ * Finds columns given filtering criteria on column name, annotations etc.
32
+ * and a set of qualified axes specs to find only columns with compatible
33
+ * axes spec.
34
+ *
35
+ * Only column specs are used, this method will work even for columns
36
+ * with no assigned data.
37
+ * */
38
+ findColumns(request: FindColumnsRequest): Promise<FindColumnsResponse>;
39
+ /** To be reviewed in the future */
40
+ deleteColumn(request: DeleteColumnFromColumnsRequest): Promise<DeleteColumnFromColumnsResponse>;
41
+ /** Retrieve single column spec */
42
+ getColumnSpec(columnId: PObjectId): Promise<PColumnSpec>;
43
+ /** Retrieve information about all columns currently added to the PFrame */
44
+ listColumns(): Promise<PColumnInfo[]>;
45
+ /** Calculates data for the table and returns an object to access it */
46
+ createTable(request: CreateTableRequestV3): PTableV5;
47
+ /** Calculate set of unique values for a specific axis for the filtered set of records */
48
+ getUniqueValues(request: UniqueValuesRequest, ops?: {
49
+ signal?: AbortSignal;
50
+ }): Promise<UniqueValuesResponse>;
51
+ }
28
52
  //# 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,OAAO,EACL,WAAW,EACX,WAAW,EACX,SAAS,EACT,mBAAmB,EACnB,oBAAoB,EACrB,MAAM,iCAAiC,CAAC;AACzC,OAAO,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;AACtD,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAEnC,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,EAAE,MAAM,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC,QAAQ,CAAC,CAAC;IAEpF,yFAAyF;IACzF,eAAe,CAAC,OAAO,EAAE,mBAAmB,EAAE,MAAM,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC,oBAAoB,CAAC,CAAC;CACpG"}
1
+ {"version":3,"file":"api_read.d.ts","sourceRoot":"","sources":["../../../src/pframe/internal_api/api_read.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kB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,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 { PFrameReadAPIV6 } from './api_read';
2
+ import { PFrameReadAPIV6, PFrameReadAPIV7 } from './api_read';
3
3
  export type Logger = (level: 'info' | 'warn' | 'error', message: string) => void;
4
4
  export interface PFrameV6 extends PFrameFactoryAPI, PFrameReadAPIV6 {
5
5
  }
6
+ export interface PFrameV7 extends PFrameFactoryAPI, PFrameReadAPIV7 {
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;AAElD,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"}
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"}
@@ -36,4 +36,50 @@ export interface PTableV4 {
36
36
  /** Deallocates all underlying resources */
37
37
  dispose(): void;
38
38
  }
39
+ /**
40
+ * Table view returned as a result of create table operation.
41
+ *
42
+ * PTable can be thought as having a composite primary key, consisting of axes,
43
+ * and a set of data columns derived from PColumn values.
44
+ * */
45
+ export interface PTableV5 {
46
+ /**
47
+ * Returns ordered array of table axes specs (primary key "columns" in SQL
48
+ * terms) and data column specs (regular "columns" in SQL terms).
49
+ *
50
+ * Data for a specific table column can be retrieved using unified indexing
51
+ * corresponding to elements in this array.
52
+ *
53
+ * Axes are always listed first.
54
+ * */
55
+ getSpec(): PTableColumnSpec[];
56
+ /** Transforms unified column identifiers into unified indices of columns. */
57
+ getColumnIndices(columnIds: PTableColumnId[]): number[];
58
+ /**
59
+ * Unified table shape
60
+ * Warning: This call materializes the join.
61
+ */
62
+ getShape(ops?: {
63
+ signal?: AbortSignal;
64
+ }): Promise<PTableShape>;
65
+ /**
66
+ * Retrieve the data from the table. To retrieve only data required, it can be
67
+ * sliced both horizontally ({@link columnIndices}) and vertically
68
+ * ({@link range}).
69
+ * This call materializes the join.
70
+ *
71
+ * @param columnIndices unified indices of columns to be retrieved
72
+ * @param range optionally limit the range of records to retrieve
73
+ * */
74
+ getData(columnIndices: number[], ops?: {
75
+ range?: TableRange;
76
+ signal?: AbortSignal;
77
+ }): Promise<PTableVector[]>;
78
+ /** Filters the table and returns new PTable instance */
79
+ filter(request: PTableRecordFilter[]): PTableV5;
80
+ /** Sorts the table and returns new PTable instance. */
81
+ sort(request: PTableSorting[]): PTableV5;
82
+ /** Deallocates all underlying resources */
83
+ dispose(): void;
84
+ }
39
85
  //# 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,0BAA0B;IAC1B,QAAQ,IAAI,WAAW,CAAC;IAExB;;;;;;;;SAQK;IACL,OAAO,IAAI,gBAAgB,EAAE,CAAC;IAE9B,6EAA6E;IAC7E,gBAAgB,CAAC,SAAS,EAAE,cAAc,EAAE,GAAG,MAAM,EAAE,CAAC;IAExD;;;;;;;SAOK;IACL,OAAO,CACL,aAAa,EAAE,MAAM,EAAE,EACvB,KAAK,EAAE,UAAU,GAAG,SAAS,EAC7B,MAAM,CAAC,EAAE,WAAW,GACnB,OAAO,CAAC,YAAY,EAAE,CAAC,CAAC;IAE3B,wDAAwD;IACxD,MAAM,CAAC,OAAO,EAAE,kBAAkB,EAAE,EAAE,MAAM,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC,QAAQ,CAAC,CAAC;IAE/E,uDAAuD;IACvD,IAAI,CAAC,OAAO,EAAE,aAAa,EAAE,EAAE,MAAM,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC,QAAQ,CAAC,CAAC;IAExE,2CAA2C;IAC3C,OAAO,IAAI,IAAI,CAAC;CACjB"}
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;;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,MAAM,CAAC,OAAO,EAAE,kBAAkB,EAAE,GAAG,QAAQ,CAAC;IAEhD,uDAAuD;IACvD,IAAI,CAAC,OAAO,EAAE,aAAa,EAAE,GAAG,QAAQ,CAAC;IAEzC,2CAA2C;IAC3C,OAAO,IAAI,IAAI,CAAC;CACjB"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@milaboratories/pl-model-middle-layer",
3
- "version": "1.7.36",
3
+ "version": "1.7.38",
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",
@@ -17,10 +17,10 @@
17
17
  "./src/**/*"
18
18
  ],
19
19
  "dependencies": {
20
- "remeda": "^2.21.2",
20
+ "remeda": "^2.22.6",
21
21
  "zod": "~3.23.8",
22
22
  "utility-types": "^3.11.0",
23
- "@milaboratories/pl-model-common": "^1.15.4"
23
+ "@milaboratories/pl-model-common": "^1.15.5"
24
24
  },
25
25
  "devDependencies": {
26
26
  "typescript": "~5.5.4",
@@ -8,7 +8,7 @@ import {
8
8
  UniqueValuesResponse
9
9
  } from '@milaboratories/pl-model-common';
10
10
  import { CreateTableRequestV3 } from './create_table';
11
- import { PTableV4 } from './table';
11
+ import { PTableV4, PTableV5 } from './table';
12
12
 
13
13
  /** Read interface exposed by PFrames library */
14
14
  export interface PFrameReadAPIV6 {
@@ -37,3 +37,36 @@ export interface PFrameReadAPIV6 {
37
37
  /** Calculate set of unique values for a specific axis for the filtered set of records */
38
38
  getUniqueValues(request: UniqueValuesRequest, signal?: AbortSignal): Promise<UniqueValuesResponse>;
39
39
  }
40
+
41
+ /** Read interface exposed by PFrames library */
42
+ export interface PFrameReadAPIV7 {
43
+ /**
44
+ * Finds columns given filtering criteria on column name, annotations etc.
45
+ * and a set of qualified axes specs to find only columns with compatible
46
+ * axes spec.
47
+ *
48
+ * Only column specs are used, this method will work even for columns
49
+ * with no assigned data.
50
+ * */
51
+ findColumns(request: FindColumnsRequest): Promise<FindColumnsResponse>;
52
+
53
+ /** To be reviewed in the future */
54
+ deleteColumn(request: DeleteColumnFromColumnsRequest): Promise<DeleteColumnFromColumnsResponse>;
55
+
56
+ /** Retrieve single column spec */
57
+ getColumnSpec(columnId: PObjectId): Promise<PColumnSpec>;
58
+
59
+ /** Retrieve information about all columns currently added to the PFrame */
60
+ listColumns(): Promise<PColumnInfo[]>;
61
+
62
+ /** Calculates data for the table and returns an object to access it */
63
+ createTable(request: CreateTableRequestV3): PTableV5;
64
+
65
+ /** Calculate set of unique values for a specific axis for the filtered set of records */
66
+ getUniqueValues(
67
+ request: UniqueValuesRequest,
68
+ ops?: {
69
+ signal?: AbortSignal,
70
+ }
71
+ ): Promise<UniqueValuesResponse>;
72
+ }
@@ -1,5 +1,5 @@
1
1
  import type { PFrameFactoryAPI } from './api_factory';
2
- import type { PFrameReadAPIV6 } from './api_read';
2
+ import type { PFrameReadAPIV6, PFrameReadAPIV7 } 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 PFrameV6 extends PFrameFactoryAPI, PFrameReadAPIV6 {}
10
+
11
+ export interface PFrameV7 extends PFrameFactoryAPI, PFrameReadAPIV7 {}
@@ -55,3 +55,59 @@ export interface PTableV4 {
55
55
  /** Deallocates all underlying resources */
56
56
  dispose(): void;
57
57
  }
58
+
59
+ /**
60
+ * Table view returned as a result of create table operation.
61
+ *
62
+ * PTable can be thought as having a composite primary key, consisting of axes,
63
+ * and a set of data columns derived from PColumn values.
64
+ * */
65
+ export interface PTableV5 {
66
+ /**
67
+ * Returns ordered array of table axes specs (primary key "columns" in SQL
68
+ * terms) and data column specs (regular "columns" in SQL terms).
69
+ *
70
+ * Data for a specific table column can be retrieved using unified indexing
71
+ * corresponding to elements in this array.
72
+ *
73
+ * Axes are always listed first.
74
+ * */
75
+ getSpec(): PTableColumnSpec[];
76
+
77
+ /** Transforms unified column identifiers into unified indices of columns. */
78
+ getColumnIndices(columnIds: PTableColumnId[]): number[];
79
+
80
+ /**
81
+ * Unified table shape
82
+ * Warning: This call materializes the join.
83
+ */
84
+ getShape(ops?: {
85
+ signal?: AbortSignal,
86
+ }): Promise<PTableShape>;
87
+
88
+ /**
89
+ * Retrieve the data from the table. To retrieve only data required, it can be
90
+ * sliced both horizontally ({@link columnIndices}) and vertically
91
+ * ({@link range}).
92
+ * This call materializes the join.
93
+ *
94
+ * @param columnIndices unified indices of columns to be retrieved
95
+ * @param range optionally limit the range of records to retrieve
96
+ * */
97
+ getData(
98
+ columnIndices: number[],
99
+ ops?: {
100
+ range?: TableRange,
101
+ signal?: AbortSignal,
102
+ },
103
+ ): Promise<PTableVector[]>;
104
+
105
+ /** Filters the table and returns new PTable instance */
106
+ filter(request: PTableRecordFilter[]): PTableV5;
107
+
108
+ /** Sorts the table and returns new PTable instance. */
109
+ sort(request: PTableSorting[]): PTableV5;
110
+
111
+ /** Deallocates all underlying resources */
112
+ dispose(): void;
113
+ }