@milaboratories/pl-model-common 1.15.0 → 1.15.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.
- package/dist/drivers/blob.d.ts +10 -1
- package/dist/drivers/blob.d.ts.map +1 -1
- package/dist/drivers/pframe/data_types.d.ts +1 -1
- package/dist/drivers/pframe/data_types.d.ts.map +1 -1
- package/dist/drivers/pframe/driver.d.ts +1 -1
- package/dist/drivers/pframe/driver.d.ts.map +1 -1
- package/dist/drivers/pframe/pframe.d.ts +2 -1
- package/dist/drivers/pframe/pframe.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +109 -99
- package/dist/index.mjs.map +1 -1
- package/package.json +4 -4
- package/src/drivers/blob.ts +24 -1
- package/src/drivers/pframe/data_types.ts +1 -1
- package/src/drivers/pframe/driver.ts +2 -1
- package/src/drivers/pframe/pframe.ts +3 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@milaboratories/pl-model-common",
|
|
3
|
-
"version": "1.15.
|
|
3
|
+
"version": "1.15.2",
|
|
4
4
|
"description": "Platforma SDK Model",
|
|
5
5
|
"types": "./dist/index.d.ts",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -25,9 +25,9 @@
|
|
|
25
25
|
"eslint": "^9.25.1",
|
|
26
26
|
"typescript": "~5.5.4",
|
|
27
27
|
"vite": "^5.4.11",
|
|
28
|
-
"vitest": "^2.1.
|
|
29
|
-
"@platforma-
|
|
30
|
-
"@
|
|
28
|
+
"vitest": "^2.1.9",
|
|
29
|
+
"@milaboratories/platforma-build-configs": "1.0.3",
|
|
30
|
+
"@platforma-sdk/eslint-config": "1.0.3"
|
|
31
31
|
},
|
|
32
32
|
"scripts": {
|
|
33
33
|
"type-check": "tsc --noEmit --composite false",
|
package/src/drivers/blob.ts
CHANGED
|
@@ -21,6 +21,29 @@ export interface BlobHandleAndSize<
|
|
|
21
21
|
readonly size: number;
|
|
22
22
|
}
|
|
23
23
|
|
|
24
|
+
/** Range in bytes, from should be less or equal than to. */
|
|
25
|
+
export type RangeBytes = {
|
|
26
|
+
/** Included left border. */
|
|
27
|
+
from: number;
|
|
28
|
+
|
|
29
|
+
/** Excluded right border. */
|
|
30
|
+
to: number;
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
export function newRangeBytesOpt(from?: number, to?: number): RangeBytes | undefined {
|
|
34
|
+
if (from == undefined || to == undefined) {
|
|
35
|
+
return undefined;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
return { from, to };
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export function validateRangeBytes(range: RangeBytes, errMsg: string) {
|
|
42
|
+
if (range.from < 0 || range.to < 0 || range.from >= range.to) {
|
|
43
|
+
throw new Error(`${errMsg}: invalid bytes range: ${range}`);
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
|
|
24
47
|
/** Being configured inside the output structure provides information about
|
|
25
48
|
* locally downloaded blob and means to retrieve it's content when needed. This
|
|
26
49
|
* structure is created only after the blob's content is downloaded locally, and
|
|
@@ -37,5 +60,5 @@ export interface BlobDriver {
|
|
|
37
60
|
/** Given the blob handle returns its content. Depending on the handle type,
|
|
38
61
|
* content will be served from locally downloaded file, or directly from
|
|
39
62
|
* remote platforma storage. */
|
|
40
|
-
getContent(handle: LocalBlobHandle | RemoteBlobHandle): Promise<Uint8Array>;
|
|
63
|
+
getContent(handle: LocalBlobHandle | RemoteBlobHandle, range?: RangeBytes): Promise<Uint8Array>;
|
|
41
64
|
}
|
|
@@ -241,7 +241,7 @@ export function isValueAbsent(absent: Uint8Array, index: number): boolean {
|
|
|
241
241
|
return (absent[chunkIndex] & mask) > 0;
|
|
242
242
|
}
|
|
243
243
|
|
|
244
|
-
export const PTableAbsent = { type: 'absent' };
|
|
244
|
+
export const PTableAbsent = { type: 'absent' } as const;
|
|
245
245
|
export type PTableAbsent = typeof PTableAbsent;
|
|
246
246
|
export const PTableNA = null;
|
|
247
247
|
export type PTableNA = typeof PTableNA;
|
|
@@ -46,7 +46,8 @@ export interface PFrameDriver {
|
|
|
46
46
|
/** Calculates data for the table and returns complete data representation of it */
|
|
47
47
|
calculateTableData(
|
|
48
48
|
handle: PFrameHandle,
|
|
49
|
-
request: CalculateTableDataRequest<PObjectId
|
|
49
|
+
request: CalculateTableDataRequest<PObjectId>,
|
|
50
|
+
range?: TableRange,
|
|
50
51
|
): Promise<CalculateTableDataResponse>;
|
|
51
52
|
|
|
52
53
|
/** Calculate set of unique values for a specific axis for the filtered set of records */
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { PObjectId } from '../../pool';
|
|
2
|
+
import type { TableRange } from './data_types';
|
|
2
3
|
import type { FindColumnsRequest, FindColumnsResponse } from './find_columns';
|
|
3
4
|
import type { PColumn, PColumnIdAndSpec, PColumnSpec } from './spec/spec';
|
|
4
5
|
import type {
|
|
@@ -23,7 +24,8 @@ export interface PFrame {
|
|
|
23
24
|
|
|
24
25
|
/** Calculates data for the table and returns complete data representation of it */
|
|
25
26
|
calculateTableData(
|
|
26
|
-
request: CalculateTableDataRequest<PObjectId
|
|
27
|
+
request: CalculateTableDataRequest<PObjectId>,
|
|
28
|
+
range?: TableRange,
|
|
27
29
|
): Promise<CalculateTableDataResponse>;
|
|
28
30
|
|
|
29
31
|
/** Calculate set of unique values for a specific axis for the filtered set of records */
|