@milaboratories/pl-model-middle-layer 1.6.1 → 1.6.2

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 { CreateTableRequest } from './create_table';
5
- import { PTable } from './table';
5
+ import { PTable, PTableV2 } from './table';
6
6
  /** Read interface exposed by PFrames library */
7
7
  export interface PFrameReadAPI {
8
8
  /**
@@ -25,4 +25,26 @@ export interface PFrameReadAPI {
25
25
  /** Calculate set of unique values for a specific axis for the filtered set of records */
26
26
  getUniqueValues(request: UniqueValuesRequest): Promise<UniqueValuesResponse>;
27
27
  }
28
+ /** Read interface exposed by PFrames library */
29
+ export interface PFrameReadAPIV2 {
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: CreateTableRequest): Promise<PTableV2>;
47
+ /** Calculate set of unique values for a specific axis for the filtered set of records */
48
+ getUniqueValues(request: UniqueValuesRequest): Promise<UniqueValuesResponse>;
49
+ }
28
50
  //# 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,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AACpD,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AAEjC,gDAAgD;AAChD,MAAM,WAAW,aAAa;IAC5B;;;;;;;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,kBAAkB,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;IAE1D,yFAAyF;IACzF,eAAe,CAAC,OAAO,EAAE,mBAAmB,GAAG,OAAO,CAAC,oBAAoB,CAAC,CAAC;CAC9E"}
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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AAO,CAAC,QAAQ,CAAC,CAAC;IAE5D,yFAAyF;IACzF,eAAe,CAAC,OAAO,EAAE,mBAAmB,GAAG,OAAO,CAAC,oBAAoB,CAAC,CAAC;CAC9E"}
@@ -1,4 +1,6 @@
1
- import { PFrameReadAPI, PFrameFactoryAPI } from './index';
1
+ import { PFrameReadAPI, PFrameFactoryAPI, PFrameReadAPIV2 } from './index';
2
2
  export interface PFrame extends PFrameFactoryAPI, PFrameReadAPI {
3
3
  }
4
+ export interface PFrameV2 extends PFrameFactoryAPI, PFrameReadAPIV2 {
5
+ }
4
6
  //# 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,EAAE,aAAa,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAE1D,MAAM,WAAW,MAAO,SAAQ,gBAAgB,EAAE,aAAa;CAC9D"}
1
+ {"version":3,"file":"pframe.d.ts","sourceRoot":"","sources":["../../../src/pframe/internal_api/pframe.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,gBAAgB,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAE3E,MAAM,WAAW,MAAO,SAAQ,gBAAgB,EAAE,aAAa;CAC9D;AAED,MAAM,WAAW,QAAS,SAAQ,gBAAgB,EAAE,eAAe;CAClE"}
@@ -34,8 +34,41 @@ export interface PTable {
34
34
  /** Deallocates all underlying resources */
35
35
  dispose(): void;
36
36
  }
37
- export interface PTableV2 extends PTable {
37
+ /**
38
+ * Table view returned as a result of create table operation.
39
+ *
40
+ * PTable can be thought as having a composite primary key, consisting of axes,
41
+ * and a set of data columns derived from PColumn values.
42
+ * */
43
+ export interface PTableV2 {
44
+ /** Unified table shape */
45
+ getShape(): PTableShape;
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
+ * Retrieve the data from the table. To retrieve only data required, it can be
60
+ * sliced both horizontally ({@link columnIndices}) and vertically
61
+ * ({@link range}).
62
+ *
63
+ * @param columnIndices unified indices of columns to be retrieved
64
+ * @param range optionally limit the range of records to retrieve
65
+ * */
66
+ getData(columnIndices: number[], range?: TableRange): Promise<PTableVector[]>;
38
67
  /** Filters the table and returns new PTable instance */
39
- filter(request: PTableRecordFilter[]): Promise<PTable>;
68
+ filter(request: PTableRecordFilter[]): Promise<PTableV2>;
69
+ /** Sorts the table and returns new PTable instance. */
70
+ sort(request: PTableSorting[]): Promise<PTableV2>;
71
+ /** Deallocates all underlying resources */
72
+ dispose(): void;
40
73
  }
41
74
  //# 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,MAAM;IACrB,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,CAAC,aAAa,EAAE,MAAM,EAAE,EAAE,KAAK,CAAC,EAAE,UAAU,GAAG,OAAO,CAAC,YAAY,EAAE,CAAC,CAAC;IAE9E,uD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OK;IACL,OAAO,CAAC,aAAa,EAAE,MAAM,EAAE,EAAE,KAAK,CAAC,EAAE,UAAU,GAAG,OAAO,CAAC,YAAY,EAAE,CAAC,CAAC;IAE9E,wDAAwD;IACxD,MAAM,CAAC,OAAO,EAAE,kBAAkB,EAAE,GAAG,OAAO,CAAC,QAAQ,CAAC,CAAC;IAEzD,uDAAuD;IACvD,IAAI,CAAC,OAAO,EAAE,aAAa,EAAE,GAAG,OAAO,CAAC,QAAQ,CAAC,CAAC;IAElD,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.6.1",
3
+ "version": "1.6.2",
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",
@@ -8,7 +8,7 @@ import {
8
8
  UniqueValuesResponse
9
9
  } from '@milaboratories/pl-model-common';
10
10
  import { CreateTableRequest } from './create_table';
11
- import { PTable } from './table';
11
+ import { PTable, PTableV2 } from './table';
12
12
 
13
13
  /** Read interface exposed by PFrames library */
14
14
  export interface PFrameReadAPI {
@@ -37,3 +37,31 @@ export interface PFrameReadAPI {
37
37
  /** Calculate set of unique values for a specific axis for the filtered set of records */
38
38
  getUniqueValues(request: UniqueValuesRequest): Promise<UniqueValuesResponse>;
39
39
  }
40
+
41
+ /** Read interface exposed by PFrames library */
42
+ export interface PFrameReadAPIV2 {
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: CreateTableRequest): Promise<PTableV2>;
64
+
65
+ /** Calculate set of unique values for a specific axis for the filtered set of records */
66
+ getUniqueValues(request: UniqueValuesRequest): Promise<UniqueValuesResponse>;
67
+ }
@@ -1,4 +1,7 @@
1
- import { PFrameReadAPI, PFrameFactoryAPI } from './index';
1
+ import { PFrameReadAPI, PFrameFactoryAPI, PFrameReadAPIV2 } from './index';
2
2
 
3
3
  export interface PFrame extends PFrameFactoryAPI, PFrameReadAPI {
4
4
  }
5
+
6
+ export interface PFrameV2 extends PFrameFactoryAPI, PFrameReadAPIV2 {
7
+ }
@@ -49,7 +49,46 @@ export interface PTable {
49
49
  dispose(): void;
50
50
  }
51
51
 
52
- export interface PTableV2 extends PTable {
52
+ /**
53
+ * Table view returned as a result of create table operation.
54
+ *
55
+ * PTable can be thought as having a composite primary key, consisting of axes,
56
+ * and a set of data columns derived from PColumn values.
57
+ * */
58
+ export interface PTableV2 {
59
+ /** Unified table shape */
60
+ getShape(): PTableShape;
61
+
62
+ /**
63
+ * Returns ordered array of table axes specs (primary key "columns" in SQL
64
+ * terms) and data column specs (regular "columns" in SQL terms).
65
+ *
66
+ * Data for a specific table column can be retrieved using unified indexing
67
+ * corresponding to elements in this array.
68
+ *
69
+ * Axes are always listed first.
70
+ * */
71
+ getSpec(): PTableColumnSpec[];
72
+
73
+ /** Transforms unified column identifiers into unified indices of columns. */
74
+ getColumnIndices(columnIds: PTableColumnId[]): number[];
75
+
76
+ /**
77
+ * Retrieve the data from the table. To retrieve only data required, it can be
78
+ * sliced both horizontally ({@link columnIndices}) and vertically
79
+ * ({@link range}).
80
+ *
81
+ * @param columnIndices unified indices of columns to be retrieved
82
+ * @param range optionally limit the range of records to retrieve
83
+ * */
84
+ getData(columnIndices: number[], range?: TableRange): Promise<PTableVector[]>;
85
+
53
86
  /** Filters the table and returns new PTable instance */
54
- filter(request: PTableRecordFilter[]): Promise<PTable>;
87
+ filter(request: PTableRecordFilter[]): Promise<PTableV2>;
88
+
89
+ /** Sorts the table and returns new PTable instance. */
90
+ sort(request: PTableSorting[]): Promise<PTableV2>;
91
+
92
+ /** Deallocates all underlying resources */
93
+ dispose(): void;
55
94
  }