@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/dist/drivers/blob.d.ts
CHANGED
|
@@ -13,6 +13,15 @@ export interface BlobHandleAndSize<H extends LocalBlobHandle | RemoteBlobHandle
|
|
|
13
13
|
/** Blob size in bytes. */
|
|
14
14
|
readonly size: number;
|
|
15
15
|
}
|
|
16
|
+
/** Range in bytes, from should be less or equal than to. */
|
|
17
|
+
export type RangeBytes = {
|
|
18
|
+
/** Included left border. */
|
|
19
|
+
from: number;
|
|
20
|
+
/** Excluded right border. */
|
|
21
|
+
to: number;
|
|
22
|
+
};
|
|
23
|
+
export declare function newRangeBytesOpt(from?: number, to?: number): RangeBytes | undefined;
|
|
24
|
+
export declare function validateRangeBytes(range: RangeBytes, errMsg: string): void;
|
|
16
25
|
/** Being configured inside the output structure provides information about
|
|
17
26
|
* locally downloaded blob and means to retrieve it's content when needed. This
|
|
18
27
|
* structure is created only after the blob's content is downloaded locally, and
|
|
@@ -27,6 +36,6 @@ export interface BlobDriver {
|
|
|
27
36
|
/** Given the blob handle returns its content. Depending on the handle type,
|
|
28
37
|
* content will be served from locally downloaded file, or directly from
|
|
29
38
|
* remote platforma storage. */
|
|
30
|
-
getContent(handle: LocalBlobHandle | RemoteBlobHandle): Promise<Uint8Array>;
|
|
39
|
+
getContent(handle: LocalBlobHandle | RemoteBlobHandle, range?: RangeBytes): Promise<Uint8Array>;
|
|
31
40
|
}
|
|
32
41
|
//# sourceMappingURL=blob.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"blob.d.ts","sourceRoot":"","sources":["../../src/drivers/blob.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAE3C;uEACuE;AACvE,MAAM,MAAM,eAAe,GAAG,OAAO,CAAC,MAAM,EAAE,iBAAiB,CAAC,CAAC;AAEjE;qCACqC;AACrC,MAAM,MAAM,gBAAgB,GAAG,OAAO,CAAC,MAAM,EAAE,kBAAkB,CAAC,CAAC;AAEnE;0DAC0D;AAC1D,MAAM,WAAW,iBAAiB,CAChC,CAAC,SAAS,eAAe,GAAG,gBAAgB,GAAK,eAAe,GAC9D,gBAAgB;IAElB,6EAA6E;IAC7E,QAAQ,CAAC,MAAM,EAAE,CAAC,CAAC;IAEnB,0BAA0B;IAC1B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;CACvB;AAED;;;6BAG6B;AAC7B,MAAM,MAAM,sBAAsB,GAAG,iBAAiB,CAAC,eAAe,CAAC,CAAC;AAExE;;0DAE0D;AAC1D,MAAM,MAAM,uBAAuB,GAAG,iBAAiB,CAAC,gBAAgB,CAAC,CAAC;AAE1E,uEAAuE;AACvE,MAAM,WAAW,UAAU;IACzB;;mCAE+B;IAC/B,UAAU,CAAC,MAAM,EAAE,eAAe,GAAG,gBAAgB,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"blob.d.ts","sourceRoot":"","sources":["../../src/drivers/blob.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAE3C;uEACuE;AACvE,MAAM,MAAM,eAAe,GAAG,OAAO,CAAC,MAAM,EAAE,iBAAiB,CAAC,CAAC;AAEjE;qCACqC;AACrC,MAAM,MAAM,gBAAgB,GAAG,OAAO,CAAC,MAAM,EAAE,kBAAkB,CAAC,CAAC;AAEnE;0DAC0D;AAC1D,MAAM,WAAW,iBAAiB,CAChC,CAAC,SAAS,eAAe,GAAG,gBAAgB,GAAK,eAAe,GAC9D,gBAAgB;IAElB,6EAA6E;IAC7E,QAAQ,CAAC,MAAM,EAAE,CAAC,CAAC;IAEnB,0BAA0B;IAC1B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;CACvB;AAED,4DAA4D;AAC5D,MAAM,MAAM,UAAU,GAAG;IACvB,4BAA4B;IAC5B,IAAI,EAAE,MAAM,CAAC;IAEb,6BAA6B;IAC7B,EAAE,EAAE,MAAM,CAAC;CACZ,CAAC;AAEF,wBAAgB,gBAAgB,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,EAAE,CAAC,EAAE,MAAM,GAAG,UAAU,GAAG,SAAS,CAMnF;AAED,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,QAInE;AAED;;;6BAG6B;AAC7B,MAAM,MAAM,sBAAsB,GAAG,iBAAiB,CAAC,eAAe,CAAC,CAAC;AAExE;;0DAE0D;AAC1D,MAAM,MAAM,uBAAuB,GAAG,iBAAiB,CAAC,gBAAgB,CAAC,CAAC;AAE1E,uEAAuE;AACvE,MAAM,WAAW,UAAU;IACzB;;mCAE+B;IAC/B,UAAU,CAAC,MAAM,EAAE,eAAe,GAAG,gBAAgB,EAAE,KAAK,CAAC,EAAE,UAAU,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC;CACjG"}
|
|
@@ -82,7 +82,7 @@ export interface PTableVector {
|
|
|
82
82
|
/** Used to read bit array with value absence information */
|
|
83
83
|
export declare function isValueAbsent(absent: Uint8Array, index: number): boolean;
|
|
84
84
|
export declare const PTableAbsent: {
|
|
85
|
-
type:
|
|
85
|
+
readonly type: "absent";
|
|
86
86
|
};
|
|
87
87
|
export type PTableAbsent = typeof PTableAbsent;
|
|
88
88
|
export declare const PTableNA: null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"data_types.d.ts","sourceRoot":"","sources":["../../../src/drivers/pframe/data_types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAE7C,eAAO,MAAM,WAAW,cAAc,CAAC;AACvC,eAAO,MAAM,YAAY,qBAAqB,CAAC;AAC/C,eAAO,MAAM,aAAa,QAAM,CAAC;AACjC,eAAO,MAAM,cAAc,QAAM,CAAC;AAClC,eAAO,MAAM,cAAc,MAAO,CAAC;AACnC,eAAO,MAAM,aAAa,MAAO,CAAC;AAElC,MAAM,MAAM,SAAS,GAAG,MAAM,CAAC;AAC/B,MAAM,MAAM,UAAU,GAAG,MAAM,GAAG,MAAM,CAAC;AACzC,MAAM,MAAM,WAAW,GAAG,MAAM,CAAC;AACjC,MAAM,MAAM,YAAY,GAAG,MAAM,CAAC;AAClC,MAAM,MAAM,YAAY,GAAG,MAAM,GAAG,IAAI,CAAC;AACzC,MAAM,MAAM,WAAW,GAAG,UAAU,GAAG,IAAI,CAAC;AAE5C,MAAM,MAAM,cAAc,GAAG,MAAM,CAAC;AACpC,MAAM,MAAM,eAAe,GAAG,MAAM,GAAG,MAAM,CAAC;AAC9C,MAAM,MAAM,gBAAgB,GAAG,MAAM,CAAC;AACtC,MAAM,MAAM,iBAAiB,GAAG,MAAM,CAAC;AACvC,MAAM,MAAM,iBAAiB,GAAG,MAAM,CAAC;AAEvC,MAAM,MAAM,WAAW,GAAG,MAAM,GAAG,MAAM,GAAG,MAAM,CAAC;AAEnD,MAAM,MAAM,MAAM,GACd,SAAS,GACT,UAAU,GAIV,YAAY,GACZ,WAAW,CAAC;AAEhB,wBAAgB,SAAS,CAAC,K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AQ,CAAC,IAAI,EAAE,WAAW,CAAC;IAE3B;;;SAGK;IACL,QAAQ,CAAC,MAAM,EAAE,UAAU,CAAC;CAC7B;AAED,4DAA4D;AAC5D,wBAAgB,aAAa,CAAC,MAAM,EAAE,UAAU,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAIxE;AAED,eAAO,MAAM,YAAY;;CAA8B,CAAC;AACxD,MAAM,MAAM,YAAY,GAAG,OAAO,YAAY,CAAC;AAC/C,eAAO,MAAM,QAAQ,MAAO,CAAC;AAC7B,MAAM,MAAM,QAAQ,GAAG,OAAO,QAAQ,CAAC;AAEvC,2BAA2B;AAC3B,MAAM,MAAM,WAAW,GAAG,YAAY,GAAG,QAAQ,GAAG,MAAM,GAAG,MAAM,CAAC;AAEpE,mCAAmC;AACnC,wBAAgB,cAAc,CAAC,KAAK,EAAE,WAAW,GAAG,KAAK,IAAI,YAAY,CAExE;AAED,MAAM,MAAM,eAAe,GAAG;IAC5B,EAAE,CAAC,EAAE,WAAW,CAAC;IACjB,MAAM,CAAC,EAAE,WAAW,CAAC;CACtB,CAAC;AAEF,2DAA2D;AAC3D,wBAAgB,WAAW,CACzB,MAAM,EAAE,YAAY,EACpB,GAAG,EAAE,MAAM,EACX,IAAI,GAAE,eAAoB,GACzB,WAAW,CAwBb;AAED,0DAA0D;AAC1D,MAAM,MAAM,UAAU,GAAG;IACvB,4CAA4C;IAC5C,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IAExB,mBAAmB;IACnB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;CACzB,CAAC;AAEF,4CAA4C;AAC5C,MAAM,MAAM,WAAW,GAAG;IACxB,6EAA6E;IAC7E,OAAO,EAAE,MAAM,CAAC;IAEhB,qBAAqB;IACrB,IAAI,EAAE,MAAM,CAAC;CACd,CAAC"}
|
|
@@ -22,7 +22,7 @@ export interface PFrameDriver {
|
|
|
22
22
|
/** Retrieve information about all columns currently added to the PFrame */
|
|
23
23
|
listColumns(handle: PFrameHandle): Promise<PColumnIdAndSpec[]>;
|
|
24
24
|
/** Calculates data for the table and returns complete data representation of it */
|
|
25
|
-
calculateTableData(handle: PFrameHandle, request: CalculateTableDataRequest<PObjectId
|
|
25
|
+
calculateTableData(handle: PFrameHandle, request: CalculateTableDataRequest<PObjectId>, range?: TableRange): Promise<CalculateTableDataResponse>;
|
|
26
26
|
/** Calculate set of unique values for a specific axis for the filtered set of records */
|
|
27
27
|
getUniqueValues(handle: PFrameHandle, request: UniqueValuesRequest): Promise<UniqueValuesResponse>;
|
|
28
28
|
/** Unified table shape */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"driver.d.ts","sourceRoot":"","sources":["../../../src/drivers/pframe/driver.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAI9C,OAAO,KAAK,EAAE,WAAW,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1E,OAAO,KAAK,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AAC9E,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAC5C,OAAO,KAAK,EAAE,gBAAgB,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AACjE,OAAO,KAAK,EACV,yBAAyB,EACzB,0BAA0B,EAC3B,MAAM,mBAAmB,CAAC;AAC3B,OAAO,KAAK,EAAE,mBAAmB,EAAE,oBAAoB,EAAE,MAAM,iBAAiB,CAAC;AACjF,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAEvD,oBAAoB;AACpB,MAAM,MAAM,YAAY,GAAG,OAAO,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;AAErD,oBAAoB;AACpB,MAAM,MAAM,YAAY,GAAG,OAAO,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;AAErD,6DAA6D;AAC7D,MAAM,WAAW,YAAY;IAK3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DAA6D;AAC7D,MAAM,WAAW,YAAY;IAK3B;;;SAGK;IACL,WAAW,CACT,MAAM,EAAE,YAAY,EACpB,OAAO,EAAE,kBAAkB,GAC1B,OAAO,CAAC,mBAAmB,CAAC,CAAC;IAEhC,kCAAkC;IAClC,aAAa,CACX,MAAM,EAAE,YAAY,EACpB,QAAQ,EAAE,SAAS,GAClB,OAAO,CAAC,WAAW,CAAC,CAAC;IAExB,2EAA2E;IAC3E,WAAW,CAAC,MAAM,EAAE,YAAY,GAAG,OAAO,CAAC,gBAAgB,EAAE,CAAC,CAAC;IAE/D,mFAAmF;IACnF,kBAAkB,CAChB,MAAM,EAAE,YAAY,EACpB,OAAO,EAAE,yBAAyB,CAAC,SAAS,CAAC,EAC7C,KAAK,CAAC,EAAE,UAAU,GACjB,OAAO,CAAC,0BAA0B,CAAC,CAAC;IAEvC,yFAAyF;IACzF,eAAe,CACb,MAAM,EAAE,YAAY,EACpB,OAAO,EAAE,mBAAmB,GAC3B,OAAO,CAAC,oBAAoB,CAAC,CAAC;IAMjC,0BAA0B;IAC1B,QAAQ,CAAC,MAAM,EAAE,YAAY,GAAG,OAAO,CAAC,WAAW,CAAC,CAAC;IAErD;;;;;;;;SAQK;IACL,OAAO,CAAC,MAAM,EAAE,YAAY,GAAG,OAAO,CAAC,gBAAgB,EAAE,CAAC,CAAC;IAE3D;;;;;;;SAOK;IACL,OAAO,CACL,MAAM,EAAE,YAAY,EACpB,aAAa,EAAE,MAAM,EAAE,EACvB,KAAK,CAAC,EAAE,UAAU,GACjB,OAAO,CAAC,YAAY,EAAE,CAAC,CAAC;CAC5B"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { PObjectId } from '../../pool';
|
|
2
|
+
import { TableRange } from './data_types';
|
|
2
3
|
import { FindColumnsRequest, FindColumnsResponse } from './find_columns';
|
|
3
4
|
import { PColumn, PColumnIdAndSpec, PColumnSpec } from './spec/spec';
|
|
4
5
|
import { CalculateTableDataRequest, CalculateTableDataResponse } from './table_calculate';
|
|
@@ -15,7 +16,7 @@ export interface PFrame {
|
|
|
15
16
|
/** Retrieve information about all columns currently added to the PFrame */
|
|
16
17
|
listColumns(): Promise<PColumnIdAndSpec[]>;
|
|
17
18
|
/** Calculates data for the table and returns complete data representation of it */
|
|
18
|
-
calculateTableData(request: CalculateTableDataRequest<PObjectId
|
|
19
|
+
calculateTableData(request: CalculateTableDataRequest<PObjectId>, range?: TableRange): Promise<CalculateTableDataResponse>;
|
|
19
20
|
/** Calculate set of unique values for a specific axis for the filtered set of records */
|
|
20
21
|
getUniqueValues(request: UniqueValuesRequest): Promise<UniqueValuesResponse>;
|
|
21
22
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pframe.d.ts","sourceRoot":"","sources":["../../../src/drivers/pframe/pframe.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAC5C,OAAO,KAAK,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AAC9E,OAAO,KAAK,EAAE,OAAO,EAAE,gBAAgB,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC1E,OAAO,KAAK,EACV,yBAAyB,EACzB,0BAA0B,EAC3B,MAAM,mBAAmB,CAAC;AAC3B,OAAO,KAAK,EAAE,mBAAmB,EAAE,oBAAoB,EAAE,MAAM,iBAAiB,CAAC;AAEjF,gDAAgD;AAChD,MAAM,WAAW,MAAM;IACrB;;;SAGK;IACL,WAAW,CAAC,OAAO,EAAE,kBAAkB,GAAG,OAAO,CAAC,mBAAmB,CAAC,CAAC;IAEvE,kCAAkC;IAClC,aAAa,CAAC,QAAQ,EAAE,SAAS,GAAG,OAAO,CAAC,WAAW,CAAC,CAAC;IAEzD,2EAA2E;IAC3E,WAAW,IAAI,OAAO,CAAC,gBAAgB,EAAE,CAAC,CAAC;IAE3C,mFAAmF;IACnF,kBAAkB,CAChB,OAAO,EAAE,yBAAyB,CAAC,SAAS,CAAC,
|
|
1
|
+
{"version":3,"file":"pframe.d.ts","sourceRoot":"","sources":["../../../src/drivers/pframe/pframe.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAC5C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC/C,OAAO,KAAK,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AAC9E,OAAO,KAAK,EAAE,OAAO,EAAE,gBAAgB,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC1E,OAAO,KAAK,EACV,yBAAyB,EACzB,0BAA0B,EAC3B,MAAM,mBAAmB,CAAC;AAC3B,OAAO,KAAK,EAAE,mBAAmB,EAAE,oBAAoB,EAAE,MAAM,iBAAiB,CAAC;AAEjF,gDAAgD;AAChD,MAAM,WAAW,MAAM;IACrB;;;SAGK;IACL,WAAW,CAAC,OAAO,EAAE,kBAAkB,GAAG,OAAO,CAAC,mBAAmB,CAAC,CAAC;IAEvE,kCAAkC;IAClC,aAAa,CAAC,QAAQ,EAAE,SAAS,GAAG,OAAO,CAAC,WAAW,CAAC,CAAC;IAEzD,2EAA2E;IAC3E,WAAW,IAAI,OAAO,CAAC,gBAAgB,EAAE,CAAC,CAAC;IAE3C,mFAAmF;IACnF,kBAAkB,CAChB,OAAO,EAAE,yBAAyB,CAAC,SAAS,CAAC,EAC7C,KAAK,CAAC,EAAE,UAAU,GACjB,OAAO,CAAC,0BAA0B,CAAC,CAAC;IAEvC,yFAAyF;IACzF,eAAe,CAAC,OAAO,EAAE,mBAAmB,GAAG,OAAO,CAAC,oBAAoB,CAAC,CAAC;CAC9E;AAED,oDAAoD;AACpD,MAAM,MAAM,SAAS,CAAC,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC,EAAE,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";var G=Object.defineProperty;var Q=(n,e,t)=>e in n?G(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t;var p=(n,e,t)=>Q(n,typeof e!="symbol"?e+"":e,t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const h=require("canonicalize"),m=require("zod");function Y(n){return n!==void 0&&n.startsWith("log+live://log/")}function x(n){throw new Error("Unexpected object: "+n)}const C="upload://upload/",V="index://index/";function J(n){return n.startsWith(C)}function D(n){return n.startsWith(V)}function O(n){if(D(n)){const e=n.slice(V.length);return JSON.parse(decodeURIComponent(e)).path}else if(J(n)){const e=n.slice(C.length);return JSON.parse(decodeURIComponent(e)).localPath}x(n)}function Z(n){return n.replace(/^.*[\\/]/,"")}function nn(n){return Z(O(n))}function en(n){if(!n||typeof n!="object")return!1;const e=n;if(!("type"in e))return!1;switch(e.type){case"Json":return typeof e.keyLength=="number"&&e.data!==void 0&&typeof e.data=="object";case"JsonPartitioned":return typeof e.partitionKeyLength=="number"&&e.parts!==void 0&&typeof e.parts=="object";case"BinaryPartitioned":return typeof e.partitionKeyLength=="number"&&e.parts!==void 0&&typeof e.parts=="object";default:return!1}}function tn(n,e){if(n!==void 0)switch(n.type){case"Json":return n;case"JsonPartitioned":{const t={};for(const[r,o]of Object.entries(n.parts))t[r]=e(o);return{...n,parts:t}}case"BinaryPartitioned":{const t={};for(const[r,o]of Object.entries(n.parts))t[r]={index:e(o.index),values:e(o.values)};return{...n,parts:t}}}}function L(n){if(!n||typeof n!="object")return!1;const e=n;if(!("type"in e))return!1;switch(e.type){case"Json":return typeof e.keyLength=="number"&&Array.isArray(e.data);case"JsonPartitioned":return typeof e.partitionKeyLength=="number"&&Array.isArray(e.parts);case"BinaryPartitioned":return typeof e.partitionKeyLength=="number"&&Array.isArray(e.parts);default:return!1}}function rn(n){return L(n)?n.type==="JsonPartitioned"||n.type==="BinaryPartitioned":!1}function on(n){switch(n.type){case"Json":{const e=Object.entries(n.data).map(([t,r])=>({key:JSON.parse(t),value:r}));return{type:"Json",keyLength:n.keyLength,data:e}}case"JsonPartitioned":{const e=Object.entries(n.parts).map(([t,r])=>({key:JSON.parse(t),value:r}));return{type:"JsonPartitioned",partitionKeyLength:n.partitionKeyLength,parts:e}}case"BinaryPartitioned":{const e=Object.entries(n.parts).map(([t,r])=>({key:JSON.parse(t),value:r}));return{type:"BinaryPartitioned",partitionKeyLength:n.partitionKeyLength,parts:e}}}}function an(n){switch(n.type){case"Json":{const e={};for(const t of n.data)e[JSON.stringify(t.key)]=t.value;return{type:"Json",keyLength:n.keyLength,data:e}}case"JsonPartitioned":{const e={};for(const t of n.parts)e[JSON.stringify(t.key)]=t.value;return{type:"JsonPartitioned",partitionKeyLength:n.partitionKeyLength,parts:e}}case"BinaryPartitioned":{const e={};for(const t of n.parts)e[JSON.stringify(t.key)]=t.value;return{type:"BinaryPartitioned",partitionKeyLength:n.partitionKeyLength,parts:e}}}}function sn(n,e){if(n!==void 0)switch(n.type){case"Json":return n;case"JsonPartitioned":{const t=n.parts.map(r=>({key:r.key,value:e(r.value)}));return{...n,parts:t}}case"BinaryPartitioned":{const t=n.parts.map(r=>({key:r.key,value:{index:e(r.value.index),values:e(r.value.values)}}));return{...n,parts:t}}}}const F=-2147483648,P=-9007199254740991n,un=NaN,cn=NaN,$=null,B=null;function g(n,e){switch(e){case"Int":return n===F;case"Long":return n===Number(P)||n===P;case"Float":return Number.isNaN(n);case"Double":return Number.isNaN(n);case"String":return n===$;case"Bytes":return n===B;default:throw Error(`unsupported data type: ${e}`)}}function fn(n){if(!j(n))throw new Error(`Expected not-NA PValue, got ${n}`);return n}function j(n,e){if(!e)return typeof n=="string"||typeof n=="number"&&isFinite(n)||typeof n=="bigint";if(g(n,e))return!1;switch(e){case"Int":return typeof n=="number";case"Long":return typeof n=="number"||typeof n=="bigint";case"Float":return typeof n=="number";case"Double":return typeof n=="number";case"String":return typeof n=="string";case"Bytes":throw Error("Bytes not yet supported");default:throw Error(`unsupported data type: ${e}`)}}function R(n,e){if(!e)return n===null||typeof n=="string"||typeof n=="number"||typeof n=="bigint";if(g(n,e))return!0;switch(e){case"Int":return typeof n=="number";case"Long":return typeof n=="number"||typeof n=="bigint";case"Float":return typeof n=="number";case"Double":return typeof n=="number";case"String":return typeof n=="string";case"Bytes":throw Error("Bytes not yet supported");default:throw Error(`unsupported data type: ${e}`)}}function dn(n){if(n===null||typeof n=="string"||typeof n=="number")return n;if(typeof n=="bigint")return{bigint:n.toString()};throw new Error(`Type ${typeof n} (value ${n}) not yet supported.`)}function T(n,e){if(n===null||typeof n=="string"||typeof n=="number"||typeof n=="bigint"){if(e&&!g(n,e)&&!R(n,e))throw new Error(`Unexpected value type, got ${typeof n}, expected ${e}`);return n}if(typeof n=="object"&&n!==null&&"bigint"in n&&typeof n.bigint=="string"){if(e&&e!=="Long")throw new Error(`Unexpected value type, got serialized bigint, expected ${e}`);return BigInt(n.bigint)}throw new Error(`Unsupported type ${typeof n} (value ${n}).`)}function ln(n){if(n=v(n),n===null)throw new Error("Value is null");return n}function v(n){if(n=T(n),n===null)return null;if(typeof n=="string")return n;if(typeof n=="number"){if(!isFinite(n))throw new Error(`Value is not finite (${n})`);return n}if(typeof n=="bigint")return Number(n);throw new Error(`Unexpected value type: ${typeof n}`)}function U(n,e){const t=Math.floor(e/8),r=1<<7-e%8;return(n[t]&r)>0}const K={type:"absent"},_=null;function mn(n){return typeof n=="object"&&n!==null&&n.type==="absent"}function pn(n,e,t={}){if(U(n.absent,e))return t.absent===void 0?K:t.absent;const r=n.data[e],o=n.type;if(g(r,o))return t.na===void 0?_:t.na;switch(o){case"Int":return r;case"Long":return Number(r);case"Float":return r;case"Double":return r;case"String":return r;case"Bytes":throw Error("Bytes not yet supported");default:throw Error(`unsupported data type: ${o}`)}}function yn(n){return{kind:n.kind,valueType:n.valueType,name:n.name,domain:n.domain,parentAxes:n.parentAxes,axesId:N(n.axesSpec)}}function hn(n){return{columnId:n.id,spec:n.spec}}function l(n){const{type:e,name:t,domain:r}=n;return{type:e,name:t,...r&&{domain:r}}}function N(n){return n.map(l)}function gn(n){return h(l(n))}function bn(n,e){if(n===void 0)return e===void 0;if(e===void 0)return!0;for(const t in e)if(n[t]!==e[t])return!1;return!0}function H(n,e){return n.name===e.name&&bn(n.domain,e.domain)}function Pn(n,e){return{...n,src:y(n.src,e)}}function y(n,e){switch(n.type){case"column":return{type:"column",column:e(n.column)};case"slicedColumn":return{type:"slicedColumn",column:e(n.column),newId:n.newId,axisFilters:n.axisFilters};case"inlineColumn":return n;case"inner":case"full":return{type:n.type,entries:n.entries.map(t=>y(t,e))};case"outer":return{type:"outer",primary:y(n.primary,e),secondary:n.secondary.map(t=>y(t,e))};default:x(n)}}function M(n){return h(n)}function wn(n){return JSON.parse(n)}function S(n){return h(l(n))}function E(n,e){return JSON.stringify([n,e])}class An{constructor(e){p(this,"domains",new Map);p(this,"axes",new Map);p(this,"domainPacks",[]);p(this,"domainPackToAnchor",new Map);this.anchors=e;const t=Object.entries(e);t.sort((r,o)=>r[0].localeCompare(o[0]));for(const[r,o]of t){for(let a=0;a<o.axesSpec.length;a++){const s=o.axesSpec[a],i=S(s);this.axes.set(i,{anchor:r,idx:a})}if(o.domain!==void 0){const a=Object.entries(o.domain);a.sort((s,i)=>s[0].localeCompare(i[0])),this.domainPackToAnchor.set(JSON.stringify(a),r),this.domainPacks.push(a.map(([s])=>s));for(const[s,i]of a){const u=E(s,i);this.domains.set(u,r)}}}}derive(e,t){const r={name:e.name,axes:[]};let o;if(e.domain!==void 0)n:for(const s of this.domainPacks){const i=[];for(const c of s){const d=e.domain[c];if(d!==void 0)i.push([c,d]);else break n}const u=this.domainPackToAnchor.get(JSON.stringify(i));if(u!==void 0){r.domainAnchor=u,o=new Set(s);break}}for(const[s,i]of Object.entries(e.domain??{})){if(o!==void 0&&o.has(s))continue;const u=E(s,i),c=this.domains.get(u);r.domain??(r.domain={}),r.domain[s]=c?{anchor:c}:i}if(r.axes=e.axesSpec.map(s=>{const i=S(s),u=this.axes.get(i);return u===void 0?l(s):u}),!t||t.length===0)return r;const a=[];for(const s of t){const[i,u]=s;if(typeof i=="number"){if(i<0||i>=e.axesSpec.length)throw new Error(`Axis index ${i} is out of bounds (0-${e.axesSpec.length-1})`);a.push([i,u])}else{const c=e.axesSpec.findIndex(d=>d.name===i);if(c===-1)throw new Error(`Axis with name "${i}" not found in the column specification`);a.push([c,u])}}return a.sort((s,i)=>s[0]-i[0]),{source:r,axisFilters:a}}deriveS(e,t){return M(this.derive(e,t))}}function xn(n,e,t){const r={...e},o=(t==null?void 0:t.ignoreMissingDomains)??!1;if(r.domainAnchor!==void 0){const a=n[r.domainAnchor];if(!a)throw new Error(`Anchor "${r.domainAnchor}" not found`);const s=a.domain||{};r.domain={...s,...r.domain},delete r.domainAnchor}if(r.domain){const a={};for(const[s,i]of Object.entries(r.domain))if(typeof i=="string")a[s]=i;else{const u=n[i.anchor];if(!u)throw new Error(`Anchor "${i.anchor}" not found for domain key "${s}"`);if(!u.domain||u.domain[s]===void 0){if(!o)throw new Error(`Domain key "${s}" not found in anchor "${i.anchor}"`);continue}a[s]=u.domain[s]}r.domain=a}return r.axes&&(r.axes=r.axes.map(a=>Nn(n,a))),r}function Nn(n,e){if(!kn(e))return e;const t=e.anchor,r=n[t];if(!r)throw new Error(`Anchor "${t}" not found for axis reference`);if("idx"in e){if(e.idx<0||e.idx>=r.axesSpec.length)throw new Error(`Axis index ${e.idx} out of bounds for anchor "${t}"`);return r.axesSpec[e.idx]}else if("name"in e){const o=r.axesSpec.filter(a=>a.name===e.name);if(o.length>1)throw new Error(`Multiple axes with name "${e.name}" found in anchor "${t}"`);if(o.length===0)throw new Error(`Axis with name "${e.name}" not found in anchor "${t}"`);return o[0]}else if("id"in e){const o=r.axesSpec.filter(a=>H(e.id,l(a)));if(o.length>1)throw new Error(`Multiple matching axes found for matcher in anchor "${t}"`);if(o.length===0)throw new Error(`No matching axis found for matcher in anchor "${t}"`);return o[0]}throw new Error("Unsupported axis reference type")}function kn(n){return typeof n=="object"&&"anchor"in n}function In(n){return typeof n=="object"&&n!==null&&"source"in n&&"axisFilters"in n}function f(n){return n.kind==="PColumn"}function z(n){return f(n.spec)}function Sn(n){return f(n.obj)}function En(n){return f(n.obj.spec)}function Cn(n){if(!z(n))throw new Error(`not a PColumn (kind = ${n.spec.kind})`);return n}function Vn(n,e){return n===void 0?void 0:{...n,data:e(n.data)}}function Jn(n){const e=new Map,t=r=>{switch(r.type){case"column":e.set(r.column.id,r.column);return;case"slicedColumn":e.set(r.column.id,r.column);return;case"inlineColumn":return;case"full":case"inner":for(const o of r.entries)t(o);return;case"outer":t(r.primary);for(const o of r.secondary)t(o);return;default:x(r)}};return t(n),[...e.values()]}function Dn(n){throw new Error("Unexpected object: "+n)}function b(n,e){switch(n.type){case"and":for(const t of n.operands)if(!b(t,e))return!1;return!0;case"or":for(const t of n.operands)if(b(t,e))return!0;return!1;case"not":return!b(n.operand,e);case"name":return f(e)&&e.name===n.name;case"name_pattern":return f(e)&&!!e.name.match(n.pattern);case"annotation":return f(e)&&e.annotations!==void 0&&e.annotations[n.annotation]===n.value;case"annotation_pattern":return f(e)&&e.annotations!==void 0&&e.annotations[n.annotation]!==void 0&&!!e.annotations[n.annotation].match(n.pattern);case"has_axes":return f(e)&&n.axes.every(t=>e.axesSpec.some(r=>(t.type===void 0||t.type===r.type)&&(t.name===void 0||t.name===r.name)&&(t.domain===void 0||Object.keys(t.domain).length===0||r.domain!==void 0&&Object.entries(t.domain).every(([o,a])=>r.domain[o]===a))));default:Dn(n)}}function w(n,e){if(n.name!==void 0&&n.name!==e.name)return!1;if(n.type!==void 0){if(Array.isArray(n.type)){if(!n.type.includes(e.type))return!1}else if(n.type!==e.type)return!1}if(n.domain!==void 0){const t=e.domain||{};for(const[r,o]of Object.entries(n.domain))if(t[r]!==o)return!1}return!0}function A(n,e){if(e.name!==void 0&&n.name!==e.name||e.namePattern!==void 0&&!new RegExp(e.namePattern).test(n.name))return!1;if(e.type!==void 0){if(Array.isArray(e.type)){if(!e.type.includes(n.valueType))return!1}else if(e.type!==n.valueType)return!1}if(e.domain!==void 0){const t=n.domain||{};for(const[r,o]of Object.entries(e.domain))if(t[r]!==o)return!1}if(e.axes!==void 0){const t=n.axesSpec.map(l);if(e.partialAxesMatch){for(const r of e.axes)if(!t.some(o=>w(r,o)))return!1}else{if(t.length!==e.axes.length)return!1;for(let r=0;r<e.axes.length;r++)if(!w(e.axes[r],t[r]))return!1}}if(e.annotations!==void 0){const t=n.annotations||{};for(const[r,o]of Object.entries(e.annotations))if(t[r]!==o)return!1}if(e.annotationPatterns!==void 0){const t=n.annotations||{};for(const[r,o]of Object.entries(e.annotationPatterns)){const a=t[r];if(a===void 0||!new RegExp(o).test(a))return!1}}return!0}function On(n){return Array.isArray(n)?e=>n.some(t=>f(e)&&A(e,t)):e=>f(e)&&A(e,n)}function Ln(n){const e={kind:n.kind,name:n.name};return n.domain!==void 0&&(e.domain=n.domain),f(n)&&(e.axesSpec=N(n.axesSpec)),h(e)}const Fn={href:"/"},$n=m.z.object({__isRef:m.z.literal(!0).describe("Crucial marker for the block dependency tree reconstruction"),blockId:m.z.string().describe("Upstream block id"),name:m.z.string().describe("Name of the output provided to the upstream block's output context"),requireEnrichments:m.z.literal(!0).optional().describe("True if current block that stores this reference in its args, may need enrichments for the references value originating from the blocks in between current and referenced block")}).describe("Universal reference type, allowing to set block connections. It is crucial that {@link __isRef} is present and equal to true, internal logic relies on this marker to build block dependency trees.").readonly();function Bn(n){return typeof n=="object"&&n!==null&&"__isRef"in n&&n.__isRef===!0&&"blockId"in n&&"name"in n}function jn(n,e,t=!1){return t?{__isRef:!0,blockId:n,name:e,requireEnrichments:!0}:{__isRef:!0,blockId:n,name:e}}function Rn(n,e=!0){if(e)return{...n,requireEnrichments:!0};{const{requireEnrichments:t,...r}=n;return r}}function Tn(n,e,t=!1){return n.blockId===e.blockId&&n.name===e.name&&(t||n.requireEnrichments===e.requireEnrichments)}function vn(n,e){return n.ok?{ok:!0,value:e(n.value)}:n}function Un(n){if(n instanceof Int8Array||n instanceof Uint8Array||n instanceof Uint8ClampedArray)return new DataView(n.buffer,n.byteOffset,n.byteLength);if(n instanceof ArrayBuffer)return new DataView(n);throw new TypeError("Expected `data` to be an ArrayBuffer, Buffer, Int8Array, Uint8Array or Uint8ClampedArray")}const Kn="ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",_n="0123456789ABCDEFGHIJKLMNOPQRSTUV",Hn="0123456789ABCDEFGHJKMNPQRSTVWXYZ";function q(n,e,t){t=t||{};let r,o;switch(e){case"RFC3548":case"RFC4648":r=Kn,o=!0;break;case"RFC4648-HEX":r=_n,o=!0;break;case"Crockford":r=Hn,o=!1;break;default:throw new Error("Unknown base32 variant: "+String(e))}const a=t.padding!==void 0?t.padding:o,s=Un(n);let i=0,u=0,c="";for(let d=0;d<s.byteLength;d++)for(u=u<<8|s.getUint8(d),i+=8;i>=5;)c+=r[u>>>i-5&31],i-=5;if(i>0&&(c+=r[u<<5-i&31]),a)for(;c.length%8!==0;)c+="=";return c}const k=15,W=24,I=m.z.string().length(W).regex(/[ABCDEFGHIJKLMNOPQRSTUVWXYZ234567]/).brand("PlId");function Mn(){const n=new Uint8Array(k);return crypto.getRandomValues(n),I.parse(q(n,"RFC4648"))}function X(n){if(n.length!==k)throw new Error(`Wrong number of bytes: ${n.length}`);return I.parse(q(n,"RFC4648"))}async function zn(n){const e=new TextEncoder,t=await crypto.subtle.digest("SHA-256",e.encode(n));return X(new Uint8Array(t.slice(0,15)))}function qn(n){return JSON.stringify(n)}function Wn(n){return h(n)}function Xn(n){return JSON.parse(n)}exports.AnchoredIdDeriver=An;exports.DefaultNavigationState=Fn;exports.PTableAbsent=K;exports.PTableNA=_;exports.PValueBytesNA=B;exports.PValueDoubleNA=cn;exports.PValueFloatNA=un;exports.PValueIntNA=F;exports.PValueLongNA=P;exports.PValueStringNA=$;exports.PlId=I;exports.PlIdBytes=k;exports.PlIdLength=W;exports.PlRef=$n;exports.canonicalizeAxisId=gn;exports.canonicalizeJson=Wn;exports.createPlRef=jn;exports.dataInfoToEntries=on;exports.deriveNativeId=Ln;exports.digestPlId=zn;exports.ensureNotNAPValue=fn;exports.ensurePColumn=Cn;exports.entriesToDataInfo=an;exports.executePSpecPredicate=b;exports.extractAllColumns=Jn;exports.getAxesId=N;exports.getAxisId=l;exports.getColumnIdAndSpec=hn;exports.getFileNameFromHandle=nn;exports.getFilePathFromHandle=O;exports.getPColumnSpecId=yn;exports.isDataInfo=en;exports.isDataInfoEntries=L;exports.isFilteredPColumn=In;exports.isImportFileHandleIndex=D;exports.isImportFileHandleUpload=J;exports.isLiveLog=Y;exports.isNotNAPValue=j;exports.isPColumn=z;exports.isPColumnResult=En;exports.isPColumnSpec=f;exports.isPColumnSpecResult=Sn;exports.isPTableAbsent=mn;exports.isPValue=R;exports.isPartitionedDataInfoEntries=rn;exports.isPlRef=Bn;exports.isValueAbsent=U;exports.isValueNA=g;exports.mapDataInfo=tn;exports.mapDataInfoEntries=sn;exports.mapJoinEntry=y;exports.mapPObjectData=Vn;exports.mapPTableDef=Pn;exports.mapValueInVOE=vn;exports.matchAxis=w;exports.matchAxisId=H;exports.matchPColumn=A;exports.pTableValue=pn;exports.pValueToStringOrNumber=ln;exports.pValueToStringOrNumberOrNull=v;exports.parseColumnId=wn;exports.parseJson=Xn;exports.plId=X;exports.plRefsEqual=Tn;exports.resolveAnchors=xn;exports.safeConvertToPValue=T;exports.selectorsToPredicate=On;exports.stringifyColumnId=M;exports.stringifyJson=qn;exports.toJsonSafePValue=dn;exports.uniquePlId=Mn;exports.withEnrichments=Rn;
|
|
1
|
+
"use strict";var G=Object.defineProperty;var Q=(n,e,t)=>e in n?G(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t;var p=(n,e,t)=>Q(n,typeof e!="symbol"?e+"":e,t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const h=require("canonicalize"),m=require("zod");function Y(n,e){if(!(n==null||e==null))return{from:n,to:e}}function Z(n,e){if(n.from<0||n.to<0||n.from>=n.to)throw new Error(`${e}: invalid bytes range: ${n}`)}function nn(n){return n!==void 0&&n.startsWith("log+live://log/")}function x(n){throw new Error("Unexpected object: "+n)}const C="upload://upload/",V="index://index/";function J(n){return n.startsWith(C)}function O(n){return n.startsWith(V)}function D(n){if(O(n)){const e=n.slice(V.length);return JSON.parse(decodeURIComponent(e)).path}else if(J(n)){const e=n.slice(C.length);return JSON.parse(decodeURIComponent(e)).localPath}x(n)}function en(n){return n.replace(/^.*[\\/]/,"")}function tn(n){return en(D(n))}function rn(n){if(!n||typeof n!="object")return!1;const e=n;if(!("type"in e))return!1;switch(e.type){case"Json":return typeof e.keyLength=="number"&&e.data!==void 0&&typeof e.data=="object";case"JsonPartitioned":return typeof e.partitionKeyLength=="number"&&e.parts!==void 0&&typeof e.parts=="object";case"BinaryPartitioned":return typeof e.partitionKeyLength=="number"&&e.parts!==void 0&&typeof e.parts=="object";default:return!1}}function on(n,e){if(n!==void 0)switch(n.type){case"Json":return n;case"JsonPartitioned":{const t={};for(const[r,o]of Object.entries(n.parts))t[r]=e(o);return{...n,parts:t}}case"BinaryPartitioned":{const t={};for(const[r,o]of Object.entries(n.parts))t[r]={index:e(o.index),values:e(o.values)};return{...n,parts:t}}}}function L(n){if(!n||typeof n!="object")return!1;const e=n;if(!("type"in e))return!1;switch(e.type){case"Json":return typeof e.keyLength=="number"&&Array.isArray(e.data);case"JsonPartitioned":return typeof e.partitionKeyLength=="number"&&Array.isArray(e.parts);case"BinaryPartitioned":return typeof e.partitionKeyLength=="number"&&Array.isArray(e.parts);default:return!1}}function an(n){return L(n)?n.type==="JsonPartitioned"||n.type==="BinaryPartitioned":!1}function sn(n){switch(n.type){case"Json":{const e=Object.entries(n.data).map(([t,r])=>({key:JSON.parse(t),value:r}));return{type:"Json",keyLength:n.keyLength,data:e}}case"JsonPartitioned":{const e=Object.entries(n.parts).map(([t,r])=>({key:JSON.parse(t),value:r}));return{type:"JsonPartitioned",partitionKeyLength:n.partitionKeyLength,parts:e}}case"BinaryPartitioned":{const e=Object.entries(n.parts).map(([t,r])=>({key:JSON.parse(t),value:r}));return{type:"BinaryPartitioned",partitionKeyLength:n.partitionKeyLength,parts:e}}}}function un(n){switch(n.type){case"Json":{const e={};for(const t of n.data)e[JSON.stringify(t.key)]=t.value;return{type:"Json",keyLength:n.keyLength,data:e}}case"JsonPartitioned":{const e={};for(const t of n.parts)e[JSON.stringify(t.key)]=t.value;return{type:"JsonPartitioned",partitionKeyLength:n.partitionKeyLength,parts:e}}case"BinaryPartitioned":{const e={};for(const t of n.parts)e[JSON.stringify(t.key)]=t.value;return{type:"BinaryPartitioned",partitionKeyLength:n.partitionKeyLength,parts:e}}}}function cn(n,e){if(n!==void 0)switch(n.type){case"Json":return n;case"JsonPartitioned":{const t=n.parts.map(r=>({key:r.key,value:e(r.value)}));return{...n,parts:t}}case"BinaryPartitioned":{const t=n.parts.map(r=>({key:r.key,value:{index:e(r.value.index),values:e(r.value.values)}}));return{...n,parts:t}}}}const $=-2147483648,P=-9007199254740991n,fn=NaN,dn=NaN,B=null,F=null;function g(n,e){switch(e){case"Int":return n===$;case"Long":return n===Number(P)||n===P;case"Float":return Number.isNaN(n);case"Double":return Number.isNaN(n);case"String":return n===B;case"Bytes":return n===F;default:throw Error(`unsupported data type: ${e}`)}}function ln(n){if(!v(n))throw new Error(`Expected not-NA PValue, got ${n}`);return n}function v(n,e){if(!e)return typeof n=="string"||typeof n=="number"&&isFinite(n)||typeof n=="bigint";if(g(n,e))return!1;switch(e){case"Int":return typeof n=="number";case"Long":return typeof n=="number"||typeof n=="bigint";case"Float":return typeof n=="number";case"Double":return typeof n=="number";case"String":return typeof n=="string";case"Bytes":throw Error("Bytes not yet supported");default:throw Error(`unsupported data type: ${e}`)}}function R(n,e){if(!e)return n===null||typeof n=="string"||typeof n=="number"||typeof n=="bigint";if(g(n,e))return!0;switch(e){case"Int":return typeof n=="number";case"Long":return typeof n=="number"||typeof n=="bigint";case"Float":return typeof n=="number";case"Double":return typeof n=="number";case"String":return typeof n=="string";case"Bytes":throw Error("Bytes not yet supported");default:throw Error(`unsupported data type: ${e}`)}}function mn(n){if(n===null||typeof n=="string"||typeof n=="number")return n;if(typeof n=="bigint")return{bigint:n.toString()};throw new Error(`Type ${typeof n} (value ${n}) not yet supported.`)}function j(n,e){if(n===null||typeof n=="string"||typeof n=="number"||typeof n=="bigint"){if(e&&!g(n,e)&&!R(n,e))throw new Error(`Unexpected value type, got ${typeof n}, expected ${e}`);return n}if(typeof n=="object"&&n!==null&&"bigint"in n&&typeof n.bigint=="string"){if(e&&e!=="Long")throw new Error(`Unexpected value type, got serialized bigint, expected ${e}`);return BigInt(n.bigint)}throw new Error(`Unsupported type ${typeof n} (value ${n}).`)}function pn(n){if(n=T(n),n===null)throw new Error("Value is null");return n}function T(n){if(n=j(n),n===null)return null;if(typeof n=="string")return n;if(typeof n=="number"){if(!isFinite(n))throw new Error(`Value is not finite (${n})`);return n}if(typeof n=="bigint")return Number(n);throw new Error(`Unexpected value type: ${typeof n}`)}function U(n,e){const t=Math.floor(e/8),r=1<<7-e%8;return(n[t]&r)>0}const K={type:"absent"},_=null;function yn(n){return typeof n=="object"&&n!==null&&n.type==="absent"}function hn(n,e,t={}){if(U(n.absent,e))return t.absent===void 0?K:t.absent;const r=n.data[e],o=n.type;if(g(r,o))return t.na===void 0?_:t.na;switch(o){case"Int":return r;case"Long":return Number(r);case"Float":return r;case"Double":return r;case"String":return r;case"Bytes":throw Error("Bytes not yet supported");default:throw Error(`unsupported data type: ${o}`)}}function gn(n){return{kind:n.kind,valueType:n.valueType,name:n.name,domain:n.domain,parentAxes:n.parentAxes,axesId:N(n.axesSpec)}}function bn(n){return{columnId:n.id,spec:n.spec}}function l(n){const{type:e,name:t,domain:r}=n;return{type:e,name:t,...r&&{domain:r}}}function N(n){return n.map(l)}function Pn(n){return h(l(n))}function wn(n,e){if(n===void 0)return e===void 0;if(e===void 0)return!0;for(const t in e)if(n[t]!==e[t])return!1;return!0}function H(n,e){return n.name===e.name&&wn(n.domain,e.domain)}function An(n,e){return{...n,src:y(n.src,e)}}function y(n,e){switch(n.type){case"column":return{type:"column",column:e(n.column)};case"slicedColumn":return{type:"slicedColumn",column:e(n.column),newId:n.newId,axisFilters:n.axisFilters};case"inlineColumn":return n;case"inner":case"full":return{type:n.type,entries:n.entries.map(t=>y(t,e))};case"outer":return{type:"outer",primary:y(n.primary,e),secondary:n.secondary.map(t=>y(t,e))};default:x(n)}}function M(n){return h(n)}function xn(n){return JSON.parse(n)}function S(n){return h(l(n))}function E(n,e){return JSON.stringify([n,e])}class Nn{constructor(e){p(this,"domains",new Map);p(this,"axes",new Map);p(this,"domainPacks",[]);p(this,"domainPackToAnchor",new Map);this.anchors=e;const t=Object.entries(e);t.sort((r,o)=>r[0].localeCompare(o[0]));for(const[r,o]of t){for(let a=0;a<o.axesSpec.length;a++){const s=o.axesSpec[a],i=S(s);this.axes.set(i,{anchor:r,idx:a})}if(o.domain!==void 0){const a=Object.entries(o.domain);a.sort((s,i)=>s[0].localeCompare(i[0])),this.domainPackToAnchor.set(JSON.stringify(a),r),this.domainPacks.push(a.map(([s])=>s));for(const[s,i]of a){const u=E(s,i);this.domains.set(u,r)}}}}derive(e,t){const r={name:e.name,axes:[]};let o;if(e.domain!==void 0)n:for(const s of this.domainPacks){const i=[];for(const c of s){const d=e.domain[c];if(d!==void 0)i.push([c,d]);else break n}const u=this.domainPackToAnchor.get(JSON.stringify(i));if(u!==void 0){r.domainAnchor=u,o=new Set(s);break}}for(const[s,i]of Object.entries(e.domain??{})){if(o!==void 0&&o.has(s))continue;const u=E(s,i),c=this.domains.get(u);r.domain??(r.domain={}),r.domain[s]=c?{anchor:c}:i}if(r.axes=e.axesSpec.map(s=>{const i=S(s),u=this.axes.get(i);return u===void 0?l(s):u}),!t||t.length===0)return r;const a=[];for(const s of t){const[i,u]=s;if(typeof i=="number"){if(i<0||i>=e.axesSpec.length)throw new Error(`Axis index ${i} is out of bounds (0-${e.axesSpec.length-1})`);a.push([i,u])}else{const c=e.axesSpec.findIndex(d=>d.name===i);if(c===-1)throw new Error(`Axis with name "${i}" not found in the column specification`);a.push([c,u])}}return a.sort((s,i)=>s[0]-i[0]),{source:r,axisFilters:a}}deriveS(e,t){return M(this.derive(e,t))}}function kn(n,e,t){const r={...e},o=(t==null?void 0:t.ignoreMissingDomains)??!1;if(r.domainAnchor!==void 0){const a=n[r.domainAnchor];if(!a)throw new Error(`Anchor "${r.domainAnchor}" not found`);const s=a.domain||{};r.domain={...s,...r.domain},delete r.domainAnchor}if(r.domain){const a={};for(const[s,i]of Object.entries(r.domain))if(typeof i=="string")a[s]=i;else{const u=n[i.anchor];if(!u)throw new Error(`Anchor "${i.anchor}" not found for domain key "${s}"`);if(!u.domain||u.domain[s]===void 0){if(!o)throw new Error(`Domain key "${s}" not found in anchor "${i.anchor}"`);continue}a[s]=u.domain[s]}r.domain=a}return r.axes&&(r.axes=r.axes.map(a=>In(n,a))),r}function In(n,e){if(!Sn(e))return e;const t=e.anchor,r=n[t];if(!r)throw new Error(`Anchor "${t}" not found for axis reference`);if("idx"in e){if(e.idx<0||e.idx>=r.axesSpec.length)throw new Error(`Axis index ${e.idx} out of bounds for anchor "${t}"`);return r.axesSpec[e.idx]}else if("name"in e){const o=r.axesSpec.filter(a=>a.name===e.name);if(o.length>1)throw new Error(`Multiple axes with name "${e.name}" found in anchor "${t}"`);if(o.length===0)throw new Error(`Axis with name "${e.name}" not found in anchor "${t}"`);return o[0]}else if("id"in e){const o=r.axesSpec.filter(a=>H(e.id,l(a)));if(o.length>1)throw new Error(`Multiple matching axes found for matcher in anchor "${t}"`);if(o.length===0)throw new Error(`No matching axis found for matcher in anchor "${t}"`);return o[0]}throw new Error("Unsupported axis reference type")}function Sn(n){return typeof n=="object"&&"anchor"in n}function En(n){return typeof n=="object"&&n!==null&&"source"in n&&"axisFilters"in n}function f(n){return n.kind==="PColumn"}function z(n){return f(n.spec)}function Cn(n){return f(n.obj)}function Vn(n){return f(n.obj.spec)}function Jn(n){if(!z(n))throw new Error(`not a PColumn (kind = ${n.spec.kind})`);return n}function On(n,e){return n===void 0?void 0:{...n,data:e(n.data)}}function Dn(n){const e=new Map,t=r=>{switch(r.type){case"column":e.set(r.column.id,r.column);return;case"slicedColumn":e.set(r.column.id,r.column);return;case"inlineColumn":return;case"full":case"inner":for(const o of r.entries)t(o);return;case"outer":t(r.primary);for(const o of r.secondary)t(o);return;default:x(r)}};return t(n),[...e.values()]}function Ln(n){throw new Error("Unexpected object: "+n)}function b(n,e){switch(n.type){case"and":for(const t of n.operands)if(!b(t,e))return!1;return!0;case"or":for(const t of n.operands)if(b(t,e))return!0;return!1;case"not":return!b(n.operand,e);case"name":return f(e)&&e.name===n.name;case"name_pattern":return f(e)&&!!e.name.match(n.pattern);case"annotation":return f(e)&&e.annotations!==void 0&&e.annotations[n.annotation]===n.value;case"annotation_pattern":return f(e)&&e.annotations!==void 0&&e.annotations[n.annotation]!==void 0&&!!e.annotations[n.annotation].match(n.pattern);case"has_axes":return f(e)&&n.axes.every(t=>e.axesSpec.some(r=>(t.type===void 0||t.type===r.type)&&(t.name===void 0||t.name===r.name)&&(t.domain===void 0||Object.keys(t.domain).length===0||r.domain!==void 0&&Object.entries(t.domain).every(([o,a])=>r.domain[o]===a))));default:Ln(n)}}function w(n,e){if(n.name!==void 0&&n.name!==e.name)return!1;if(n.type!==void 0){if(Array.isArray(n.type)){if(!n.type.includes(e.type))return!1}else if(n.type!==e.type)return!1}if(n.domain!==void 0){const t=e.domain||{};for(const[r,o]of Object.entries(n.domain))if(t[r]!==o)return!1}return!0}function A(n,e){if(e.name!==void 0&&n.name!==e.name||e.namePattern!==void 0&&!new RegExp(e.namePattern).test(n.name))return!1;if(e.type!==void 0){if(Array.isArray(e.type)){if(!e.type.includes(n.valueType))return!1}else if(e.type!==n.valueType)return!1}if(e.domain!==void 0){const t=n.domain||{};for(const[r,o]of Object.entries(e.domain))if(t[r]!==o)return!1}if(e.axes!==void 0){const t=n.axesSpec.map(l);if(e.partialAxesMatch){for(const r of e.axes)if(!t.some(o=>w(r,o)))return!1}else{if(t.length!==e.axes.length)return!1;for(let r=0;r<e.axes.length;r++)if(!w(e.axes[r],t[r]))return!1}}if(e.annotations!==void 0){const t=n.annotations||{};for(const[r,o]of Object.entries(e.annotations))if(t[r]!==o)return!1}if(e.annotationPatterns!==void 0){const t=n.annotations||{};for(const[r,o]of Object.entries(e.annotationPatterns)){const a=t[r];if(a===void 0||!new RegExp(o).test(a))return!1}}return!0}function $n(n){return Array.isArray(n)?e=>n.some(t=>f(e)&&A(e,t)):e=>f(e)&&A(e,n)}function Bn(n){const e={kind:n.kind,name:n.name};return n.domain!==void 0&&(e.domain=n.domain),f(n)&&(e.axesSpec=N(n.axesSpec)),h(e)}const Fn={href:"/"},vn=m.z.object({__isRef:m.z.literal(!0).describe("Crucial marker for the block dependency tree reconstruction"),blockId:m.z.string().describe("Upstream block id"),name:m.z.string().describe("Name of the output provided to the upstream block's output context"),requireEnrichments:m.z.literal(!0).optional().describe("True if current block that stores this reference in its args, may need enrichments for the references value originating from the blocks in between current and referenced block")}).describe("Universal reference type, allowing to set block connections. It is crucial that {@link __isRef} is present and equal to true, internal logic relies on this marker to build block dependency trees.").readonly();function Rn(n){return typeof n=="object"&&n!==null&&"__isRef"in n&&n.__isRef===!0&&"blockId"in n&&"name"in n}function jn(n,e,t=!1){return t?{__isRef:!0,blockId:n,name:e,requireEnrichments:!0}:{__isRef:!0,blockId:n,name:e}}function Tn(n,e=!0){if(e)return{...n,requireEnrichments:!0};{const{requireEnrichments:t,...r}=n;return r}}function Un(n,e,t=!1){return n.blockId===e.blockId&&n.name===e.name&&(t||n.requireEnrichments===e.requireEnrichments)}function Kn(n,e){return n.ok?{ok:!0,value:e(n.value)}:n}function _n(n){if(n instanceof Int8Array||n instanceof Uint8Array||n instanceof Uint8ClampedArray)return new DataView(n.buffer,n.byteOffset,n.byteLength);if(n instanceof ArrayBuffer)return new DataView(n);throw new TypeError("Expected `data` to be an ArrayBuffer, Buffer, Int8Array, Uint8Array or Uint8ClampedArray")}const Hn="ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",Mn="0123456789ABCDEFGHIJKLMNOPQRSTUV",zn="0123456789ABCDEFGHJKMNPQRSTVWXYZ";function q(n,e,t){t=t||{};let r,o;switch(e){case"RFC3548":case"RFC4648":r=Hn,o=!0;break;case"RFC4648-HEX":r=Mn,o=!0;break;case"Crockford":r=zn,o=!1;break;default:throw new Error("Unknown base32 variant: "+String(e))}const a=t.padding!==void 0?t.padding:o,s=_n(n);let i=0,u=0,c="";for(let d=0;d<s.byteLength;d++)for(u=u<<8|s.getUint8(d),i+=8;i>=5;)c+=r[u>>>i-5&31],i-=5;if(i>0&&(c+=r[u<<5-i&31]),a)for(;c.length%8!==0;)c+="=";return c}const k=15,W=24,I=m.z.string().length(W).regex(/[ABCDEFGHIJKLMNOPQRSTUVWXYZ234567]/).brand("PlId");function qn(){const n=new Uint8Array(k);return crypto.getRandomValues(n),I.parse(q(n,"RFC4648"))}function X(n){if(n.length!==k)throw new Error(`Wrong number of bytes: ${n.length}`);return I.parse(q(n,"RFC4648"))}async function Wn(n){const e=new TextEncoder,t=await crypto.subtle.digest("SHA-256",e.encode(n));return X(new Uint8Array(t.slice(0,15)))}function Xn(n){return JSON.stringify(n)}function Gn(n){return h(n)}function Qn(n){return JSON.parse(n)}exports.AnchoredIdDeriver=Nn;exports.DefaultNavigationState=Fn;exports.PTableAbsent=K;exports.PTableNA=_;exports.PValueBytesNA=F;exports.PValueDoubleNA=dn;exports.PValueFloatNA=fn;exports.PValueIntNA=$;exports.PValueLongNA=P;exports.PValueStringNA=B;exports.PlId=I;exports.PlIdBytes=k;exports.PlIdLength=W;exports.PlRef=vn;exports.canonicalizeAxisId=Pn;exports.canonicalizeJson=Gn;exports.createPlRef=jn;exports.dataInfoToEntries=sn;exports.deriveNativeId=Bn;exports.digestPlId=Wn;exports.ensureNotNAPValue=ln;exports.ensurePColumn=Jn;exports.entriesToDataInfo=un;exports.executePSpecPredicate=b;exports.extractAllColumns=Dn;exports.getAxesId=N;exports.getAxisId=l;exports.getColumnIdAndSpec=bn;exports.getFileNameFromHandle=tn;exports.getFilePathFromHandle=D;exports.getPColumnSpecId=gn;exports.isDataInfo=rn;exports.isDataInfoEntries=L;exports.isFilteredPColumn=En;exports.isImportFileHandleIndex=O;exports.isImportFileHandleUpload=J;exports.isLiveLog=nn;exports.isNotNAPValue=v;exports.isPColumn=z;exports.isPColumnResult=Vn;exports.isPColumnSpec=f;exports.isPColumnSpecResult=Cn;exports.isPTableAbsent=yn;exports.isPValue=R;exports.isPartitionedDataInfoEntries=an;exports.isPlRef=Rn;exports.isValueAbsent=U;exports.isValueNA=g;exports.mapDataInfo=on;exports.mapDataInfoEntries=cn;exports.mapJoinEntry=y;exports.mapPObjectData=On;exports.mapPTableDef=An;exports.mapValueInVOE=Kn;exports.matchAxis=w;exports.matchAxisId=H;exports.matchPColumn=A;exports.newRangeBytesOpt=Y;exports.pTableValue=hn;exports.pValueToStringOrNumber=pn;exports.pValueToStringOrNumberOrNull=T;exports.parseColumnId=xn;exports.parseJson=Qn;exports.plId=X;exports.plRefsEqual=Un;exports.resolveAnchors=kn;exports.safeConvertToPValue=j;exports.selectorsToPredicate=$n;exports.stringifyColumnId=M;exports.stringifyJson=Xn;exports.toJsonSafePValue=mn;exports.uniquePlId=qn;exports.validateRangeBytes=Z;exports.withEnrichments=Tn;
|
|
2
2
|
//# sourceMappingURL=index.js.map
|