@milaboratories/pl-model-common 1.46.2 → 1.46.3
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/author_marker.d.ts.map +1 -1
- package/dist/base32_encode.cjs.map +1 -1
- package/dist/base32_encode.js.map +1 -1
- package/dist/base64.cjs.map +1 -1
- package/dist/base64.d.ts.map +1 -1
- package/dist/base64.js.map +1 -1
- package/dist/bmodel/block_config.cjs.map +1 -1
- package/dist/bmodel/block_config.d.ts.map +1 -1
- package/dist/bmodel/block_config.js.map +1 -1
- package/dist/bmodel/code.cjs +0 -1
- package/dist/bmodel/code.cjs.map +1 -1
- package/dist/bmodel/code.d.ts.map +1 -1
- package/dist/bmodel/code.js.map +1 -1
- package/dist/bmodel/index.cjs +6 -3
- package/dist/bmodel/index.d.ts +2 -1
- package/dist/bmodel/index.js +4 -3
- package/dist/bmodel/normalization.cjs +2 -1
- package/dist/bmodel/normalization.cjs.map +1 -1
- package/dist/bmodel/normalization.d.ts.map +1 -1
- package/dist/bmodel/normalization.js +2 -1
- package/dist/bmodel/normalization.js.map +1 -1
- package/dist/branding.d.ts.map +1 -1
- package/dist/common_types.d.ts.map +1 -1
- package/dist/dialog/index.d.ts.map +1 -1
- package/dist/drivers/ChunkedStreamReader.cjs.map +1 -1
- package/dist/drivers/ChunkedStreamReader.d.ts.map +1 -1
- package/dist/drivers/ChunkedStreamReader.js.map +1 -1
- package/dist/drivers/blob.cjs +2 -1
- package/dist/drivers/blob.cjs.map +1 -1
- package/dist/drivers/blob.d.ts.map +1 -1
- package/dist/drivers/blob.js +2 -0
- package/dist/drivers/blob.js.map +1 -1
- package/dist/drivers/index.cjs +106 -18
- package/dist/drivers/index.d.ts +2 -1
- package/dist/drivers/index.js +19 -18
- package/dist/drivers/interfaces.d.ts.map +1 -1
- package/dist/drivers/log.cjs.map +1 -1
- package/dist/drivers/log.d.ts.map +1 -1
- package/dist/drivers/log.js.map +1 -1
- package/dist/drivers/ls.cjs.map +1 -1
- package/dist/drivers/ls.d.ts.map +1 -1
- package/dist/drivers/ls.js.map +1 -1
- package/dist/drivers/pframe/data_info.cjs.map +1 -1
- package/dist/drivers/pframe/data_info.d.ts.map +1 -1
- package/dist/drivers/pframe/data_info.js.map +1 -1
- package/dist/drivers/pframe/data_types.cjs.map +1 -1
- package/dist/drivers/pframe/data_types.d.ts.map +1 -1
- package/dist/drivers/pframe/data_types.js.map +1 -1
- package/dist/drivers/pframe/driver.d.ts.map +1 -1
- package/dist/drivers/pframe/filter_spec.d.ts.map +1 -1
- package/dist/drivers/pframe/find_columns.d.ts.map +1 -1
- package/dist/drivers/pframe/index.cjs +89 -14
- package/dist/drivers/pframe/index.d.ts +2 -1
- package/dist/drivers/pframe/index.js +14 -14
- package/dist/drivers/pframe/linker_columns.cjs +2 -2
- package/dist/drivers/pframe/linker_columns.cjs.map +1 -1
- package/dist/drivers/pframe/linker_columns.d.ts.map +1 -1
- package/dist/drivers/pframe/linker_columns.js +2 -2
- package/dist/drivers/pframe/linker_columns.js.map +1 -1
- package/dist/drivers/pframe/pframe.d.ts.map +1 -1
- package/dist/drivers/pframe/query/index.cjs +6 -1
- package/dist/drivers/pframe/query/index.d.ts +2 -1
- package/dist/drivers/pframe/query/index.js +2 -1
- package/dist/drivers/pframe/query/query_common.d.ts +1 -1
- package/dist/drivers/pframe/query/query_common.d.ts.map +1 -1
- package/dist/drivers/pframe/query/query_data.d.ts.map +1 -1
- package/dist/drivers/pframe/query/query_spec.d.ts.map +1 -1
- package/dist/drivers/pframe/query/utils.cjs +1 -1
- package/dist/drivers/pframe/query/utils.cjs.map +1 -1
- package/dist/drivers/pframe/query/utils.d.ts.map +1 -1
- package/dist/drivers/pframe/query/utils.js +1 -1
- package/dist/drivers/pframe/query/utils.js.map +1 -1
- package/dist/drivers/pframe/spec/anchored.cjs +2 -1
- package/dist/drivers/pframe/spec/anchored.cjs.map +1 -1
- package/dist/drivers/pframe/spec/anchored.d.ts.map +1 -1
- package/dist/drivers/pframe/spec/anchored.js +1 -0
- package/dist/drivers/pframe/spec/anchored.js.map +1 -1
- package/dist/drivers/pframe/spec/discovered_column.cjs +0 -1
- package/dist/drivers/pframe/spec/discovered_column.cjs.map +1 -1
- package/dist/drivers/pframe/spec/discovered_column.d.ts.map +1 -1
- package/dist/drivers/pframe/spec/discovered_column.js.map +1 -1
- package/dist/drivers/pframe/spec/filtered_column.cjs.map +1 -1
- package/dist/drivers/pframe/spec/filtered_column.d.ts.map +1 -1
- package/dist/drivers/pframe/spec/filtered_column.js.map +1 -1
- package/dist/drivers/pframe/spec/ids.cjs +1 -1
- package/dist/drivers/pframe/spec/ids.cjs.map +1 -1
- package/dist/drivers/pframe/spec/ids.d.ts.map +1 -1
- package/dist/drivers/pframe/spec/ids.js.map +1 -1
- package/dist/drivers/pframe/spec/index.cjs +57 -7
- package/dist/drivers/pframe/spec/index.d.ts +2 -1
- package/dist/drivers/pframe/spec/index.js +8 -7
- package/dist/drivers/pframe/spec/native_id.cjs +1 -1
- package/dist/drivers/pframe/spec/native_id.cjs.map +1 -1
- package/dist/drivers/pframe/spec/native_id.d.ts.map +1 -1
- package/dist/drivers/pframe/spec/native_id.js.map +1 -1
- package/dist/drivers/pframe/spec/selectors.cjs.map +1 -1
- package/dist/drivers/pframe/spec/selectors.d.ts.map +1 -1
- package/dist/drivers/pframe/spec/selectors.js.map +1 -1
- package/dist/drivers/pframe/spec/spec.cjs +1 -2
- package/dist/drivers/pframe/spec/spec.cjs.map +1 -1
- package/dist/drivers/pframe/spec/spec.d.ts.map +1 -1
- package/dist/drivers/pframe/spec/spec.js +1 -1
- package/dist/drivers/pframe/spec/spec.js.map +1 -1
- package/dist/drivers/pframe/spec_driver.d.ts.map +1 -1
- package/dist/drivers/pframe/table_calculate.cjs.map +1 -1
- package/dist/drivers/pframe/table_calculate.d.ts.map +1 -1
- package/dist/drivers/pframe/table_calculate.js.map +1 -1
- package/dist/drivers/pframe/table_common.cjs.map +1 -1
- package/dist/drivers/pframe/table_common.d.ts.map +1 -1
- package/dist/drivers/pframe/table_common.js.map +1 -1
- package/dist/drivers/pframe/unique_values.d.ts.map +1 -1
- package/dist/drivers/upload.d.ts.map +1 -1
- package/dist/drivers/urls.cjs.map +1 -1
- package/dist/drivers/urls.d.ts.map +1 -1
- package/dist/drivers/urls.js.map +1 -1
- package/dist/errors.cjs.map +1 -1
- package/dist/errors.d.ts.map +1 -1
- package/dist/errors.js.map +1 -1
- package/dist/flags/block_flags.cjs.map +1 -1
- package/dist/flags/block_flags.d.ts.map +1 -1
- package/dist/flags/block_flags.js.map +1 -1
- package/dist/flags/flag_utils.cjs +1 -0
- package/dist/flags/flag_utils.cjs.map +1 -1
- package/dist/flags/flag_utils.d.ts.map +1 -1
- package/dist/flags/flag_utils.js +1 -0
- package/dist/flags/flag_utils.js.map +1 -1
- package/dist/flags/index.d.ts +2 -1
- package/dist/flags/type_utils.d.ts.map +1 -1
- package/dist/httpAuth.cjs.map +1 -1
- package/dist/httpAuth.d.ts.map +1 -1
- package/dist/httpAuth.js.map +1 -1
- package/dist/json.cjs +1 -1
- package/dist/json.cjs.map +1 -1
- package/dist/json.d.ts.map +1 -1
- package/dist/json.js.map +1 -1
- package/dist/navigation.cjs.map +1 -1
- package/dist/navigation.d.ts.map +1 -1
- package/dist/navigation.js.map +1 -1
- package/dist/plid.cjs +1 -2
- package/dist/plid.cjs.map +1 -1
- package/dist/plid.d.ts.map +1 -1
- package/dist/plid.js +1 -1
- package/dist/plid.js.map +1 -1
- package/dist/pool/entry.d.ts.map +1 -1
- package/dist/pool/index.d.ts +2 -1
- package/dist/pool/query.cjs.map +1 -1
- package/dist/pool/query.d.ts.map +1 -1
- package/dist/pool/query.js.map +1 -1
- package/dist/pool/spec.cjs.map +1 -1
- package/dist/pool/spec.d.ts.map +1 -1
- package/dist/pool/spec.js.map +1 -1
- package/dist/pool_entry.cjs +1 -0
- package/dist/pool_entry.cjs.map +1 -1
- package/dist/pool_entry.d.ts.map +1 -1
- package/dist/pool_entry.js +1 -0
- package/dist/pool_entry.js.map +1 -1
- package/dist/project_id.d.ts.map +1 -1
- package/dist/ref.cjs +0 -1
- package/dist/ref.cjs.map +1 -1
- package/dist/ref.d.ts.map +1 -1
- package/dist/ref.js.map +1 -1
- package/dist/resource_types.cjs +4 -1
- package/dist/resource_types.cjs.map +1 -1
- package/dist/resource_types.d.ts +3 -0
- package/dist/resource_types.d.ts.map +1 -1
- package/dist/resource_types.js +4 -1
- package/dist/resource_types.js.map +1 -1
- package/dist/services/index.cjs +28 -6
- package/dist/services/index.d.ts +2 -1
- package/dist/services/index.js +7 -6
- package/dist/services/node_service_handlers.cjs.map +1 -1
- package/dist/services/node_service_handlers.d.ts.map +1 -1
- package/dist/services/node_service_handlers.js.map +1 -1
- package/dist/services/service_capabilities.cjs +4 -1
- package/dist/services/service_capabilities.cjs.map +1 -1
- package/dist/services/service_capabilities.d.ts.map +1 -1
- package/dist/services/service_capabilities.js +4 -1
- package/dist/services/service_capabilities.js.map +1 -1
- package/dist/services/service_declarations.cjs.map +1 -1
- package/dist/services/service_declarations.js.map +1 -1
- package/dist/services/service_injectors.cjs +1 -0
- package/dist/services/service_injectors.cjs.map +1 -1
- package/dist/services/service_injectors.d.ts +1 -1
- package/dist/services/service_injectors.d.ts.map +1 -1
- package/dist/services/service_injectors.js +1 -1
- package/dist/services/service_injectors.js.map +1 -1
- package/dist/services/service_registry.cjs.map +1 -1
- package/dist/services/service_registry.d.ts.map +1 -1
- package/dist/services/service_registry.js.map +1 -1
- package/dist/services/service_types.cjs.map +1 -1
- package/dist/services/service_types.d.ts.map +1 -1
- package/dist/services/service_types.js.map +1 -1
- package/dist/utag.d.ts.map +1 -1
- package/dist/util.cjs.map +1 -1
- package/dist/util.d.ts.map +1 -1
- package/dist/util.js.map +1 -1
- package/dist/value_or_error.cjs.map +1 -1
- package/dist/value_or_error.d.ts.map +1 -1
- package/dist/value_or_error.js.map +1 -1
- package/package.json +5 -5
- package/src/resource_types.ts +3 -0
- package/dist/drivers/pframe/driver.cjs +0 -6
- package/dist/drivers/pframe/driver.cjs.map +0 -1
- package/dist/drivers/pframe/driver.js +0 -6
- package/dist/drivers/pframe/driver.js.map +0 -1
package/dist/drivers/index.cjs
CHANGED
|
@@ -1,19 +1,107 @@
|
|
|
1
|
-
require("./urls.cjs");
|
|
2
|
-
require("./blob.cjs");
|
|
3
|
-
require("./log.cjs");
|
|
4
|
-
require("./ls.cjs");
|
|
5
|
-
require("./pframe/data_info.cjs");
|
|
6
|
-
require("./pframe/spec/spec.cjs");
|
|
7
|
-
require("./pframe/data_types.cjs");
|
|
8
|
-
require("./pframe/query/utils.cjs");
|
|
9
|
-
require("./pframe/table_calculate.cjs");
|
|
10
|
-
require("./pframe/table_common.cjs");
|
|
11
|
-
require("./pframe/spec/ids.cjs");
|
|
12
|
-
require("./pframe/spec/anchored.cjs");
|
|
13
|
-
require("./pframe/spec/filtered_column.cjs");
|
|
14
|
-
require("./pframe/spec/selectors.cjs");
|
|
15
|
-
require("./pframe/spec/native_id.cjs");
|
|
16
|
-
require("./pframe/spec/discovered_column.cjs");
|
|
17
|
-
require("./pframe/linker_columns.cjs");
|
|
1
|
+
const require_urls = require("./urls.cjs");
|
|
2
|
+
const require_blob = require("./blob.cjs");
|
|
3
|
+
const require_log = require("./log.cjs");
|
|
4
|
+
const require_ls = require("./ls.cjs");
|
|
5
|
+
const require_data_info = require("./pframe/data_info.cjs");
|
|
6
|
+
const require_spec = require("./pframe/spec/spec.cjs");
|
|
7
|
+
const require_data_types = require("./pframe/data_types.cjs");
|
|
8
|
+
const require_utils = require("./pframe/query/utils.cjs");
|
|
9
|
+
const require_table_calculate = require("./pframe/table_calculate.cjs");
|
|
10
|
+
const require_table_common = require("./pframe/table_common.cjs");
|
|
11
|
+
const require_ids = require("./pframe/spec/ids.cjs");
|
|
12
|
+
const require_anchored = require("./pframe/spec/anchored.cjs");
|
|
13
|
+
const require_filtered_column = require("./pframe/spec/filtered_column.cjs");
|
|
14
|
+
const require_selectors = require("./pframe/spec/selectors.cjs");
|
|
15
|
+
const require_native_id = require("./pframe/spec/native_id.cjs");
|
|
16
|
+
const require_discovered_column = require("./pframe/spec/discovered_column.cjs");
|
|
17
|
+
const require_linker_columns = require("./pframe/linker_columns.cjs");
|
|
18
18
|
require("./pframe/index.cjs");
|
|
19
|
-
require("./ChunkedStreamReader.cjs");
|
|
19
|
+
const require_ChunkedStreamReader = require("./ChunkedStreamReader.cjs");
|
|
20
|
+
exports.AnchoredIdDeriver = require_anchored.AnchoredIdDeriver;
|
|
21
|
+
exports.Annotation = require_spec.Annotation;
|
|
22
|
+
exports.AnnotationJson = require_spec.AnnotationJson;
|
|
23
|
+
exports.ChunkedStreamReader = require_ChunkedStreamReader.ChunkedStreamReader;
|
|
24
|
+
exports.Domain = require_spec.Domain;
|
|
25
|
+
exports.DomainJson = require_spec.DomainJson;
|
|
26
|
+
exports.LinkerMap = require_linker_columns.LinkerMap;
|
|
27
|
+
exports.PAxisName = require_spec.PAxisName;
|
|
28
|
+
exports.PColumnName = require_spec.PColumnName;
|
|
29
|
+
exports.PTableNA = require_data_types.PTableNA;
|
|
30
|
+
exports.RangeBytes = require_blob.RangeBytes;
|
|
31
|
+
exports.ValueType = require_spec.ValueType;
|
|
32
|
+
exports.XLSX_MAX_ROWS_PER_SHEET = require_data_types.XLSX_MAX_ROWS_PER_SHEET;
|
|
33
|
+
exports.canonicalizeAxisId = require_spec.canonicalizeAxisId;
|
|
34
|
+
exports.canonicalizeAxisWithParents = require_spec.canonicalizeAxisWithParents;
|
|
35
|
+
exports.collectSpecQueryColumns = require_utils.collectSpecQueryColumns;
|
|
36
|
+
exports.createDiscoveredPColumnId = require_discovered_column.createDiscoveredPColumnId;
|
|
37
|
+
exports.dataInfoToEntries = require_data_info.dataInfoToEntries;
|
|
38
|
+
exports.deriveNativeId = require_native_id.deriveNativeId;
|
|
39
|
+
exports.distillDiscoveredPColumn = require_discovered_column.distillDiscoveredPColumn;
|
|
40
|
+
exports.entriesToDataInfo = require_data_info.entriesToDataInfo;
|
|
41
|
+
exports.getArrayFromAxisTree = require_spec.getArrayFromAxisTree;
|
|
42
|
+
exports.getAxesId = require_spec.getAxesId;
|
|
43
|
+
exports.getAxesTree = require_spec.getAxesTree;
|
|
44
|
+
exports.getAxisId = require_spec.getAxisId;
|
|
45
|
+
exports.getColumnIdAndSpec = require_spec.getColumnIdAndSpec;
|
|
46
|
+
exports.getDenormalizedAxesList = require_spec.getDenormalizedAxesList;
|
|
47
|
+
exports.getFileNameFromHandle = require_ls.getFileNameFromHandle;
|
|
48
|
+
exports.getFilePathFromHandle = require_ls.getFilePathFromHandle;
|
|
49
|
+
exports.getNormalizedAxesList = require_spec.getNormalizedAxesList;
|
|
50
|
+
exports.getPColumnSpecId = require_spec.getPColumnSpecId;
|
|
51
|
+
exports.getPTableColumnId = require_table_common.getPTableColumnId;
|
|
52
|
+
exports.getSetFromAxisTree = require_spec.getSetFromAxisTree;
|
|
53
|
+
exports.getTypeFromPColumnOrAxisSpec = require_spec.getTypeFromPColumnOrAxisSpec;
|
|
54
|
+
exports.isAnchoredPColumnId = require_selectors.isAnchoredPColumnId;
|
|
55
|
+
exports.isAnyLogHandle = require_log.isAnyLogHandle;
|
|
56
|
+
exports.isAxisId = require_spec.isAxisId;
|
|
57
|
+
exports.isBlockUIURL = require_urls.isBlockUIURL;
|
|
58
|
+
exports.isBooleanExpression = require_utils.isBooleanExpression;
|
|
59
|
+
exports.isDataInfo = require_data_info.isDataInfo;
|
|
60
|
+
exports.isDataInfoEntries = require_data_info.isDataInfoEntries;
|
|
61
|
+
exports.isDiscoveredPColumn = require_discovered_column.isDiscoveredPColumn;
|
|
62
|
+
exports.isFilteredPColumn = require_filtered_column.isFilteredPColumn;
|
|
63
|
+
exports.isFolderURL = require_urls.isFolderURL;
|
|
64
|
+
exports.isImportFileHandleIndex = require_ls.isImportFileHandleIndex;
|
|
65
|
+
exports.isImportFileHandleUpload = require_ls.isImportFileHandleUpload;
|
|
66
|
+
exports.isLabelColumn = require_spec.isLabelColumn;
|
|
67
|
+
exports.isLinkerColumn = require_spec.isLinkerColumn;
|
|
68
|
+
exports.isLiveLog = require_log.isLiveLog;
|
|
69
|
+
exports.isPTableNA = require_data_types.isPTableNA;
|
|
70
|
+
exports.isPartitionedDataInfoEntries = require_data_info.isPartitionedDataInfoEntries;
|
|
71
|
+
exports.isValueNA = require_data_types.isValueNA;
|
|
72
|
+
exports.legacyColumnSelectorsToPredicate = require_selectors.legacyColumnSelectorsToPredicate;
|
|
73
|
+
exports.mapDataInfo = require_data_info.mapDataInfo;
|
|
74
|
+
exports.mapDataInfoEntries = require_data_info.mapDataInfoEntries;
|
|
75
|
+
exports.mapJoinEntry = require_table_calculate.mapJoinEntry;
|
|
76
|
+
exports.mapPTableDef = require_table_calculate.mapPTableDef;
|
|
77
|
+
exports.mapPTableDefV2 = require_table_calculate.mapPTableDefV2;
|
|
78
|
+
exports.mapSpecQueryColumns = require_utils.mapSpecQueryColumns;
|
|
79
|
+
exports.matchAxis = require_selectors.matchAxis;
|
|
80
|
+
exports.matchAxisId = require_spec.matchAxisId;
|
|
81
|
+
exports.matchMultiColumnSelector = require_selectors.matchMultiColumnSelector;
|
|
82
|
+
exports.matchPColumn = require_selectors.matchPColumn;
|
|
83
|
+
exports.multiColumnSelectorsToPredicate = require_selectors.multiColumnSelectorsToPredicate;
|
|
84
|
+
exports.newRangeBytesOpt = require_blob.newRangeBytesOpt;
|
|
85
|
+
exports.pTableValue = require_data_types.pTableValue;
|
|
86
|
+
exports.pTableValueBranded = require_data_types.pTableValueBranded;
|
|
87
|
+
exports.parseColumnId = require_ids.parseColumnId;
|
|
88
|
+
exports.parseDiscoveredPColumnId = require_discovered_column.parseDiscoveredPColumnId;
|
|
89
|
+
exports.readAnnotation = require_spec.readAnnotation;
|
|
90
|
+
exports.readAnnotationJson = require_spec.readAnnotationJson;
|
|
91
|
+
exports.readAnnotationJsonOrThrow = require_spec.readAnnotationJsonOrThrow;
|
|
92
|
+
exports.readDomain = require_spec.readDomain;
|
|
93
|
+
exports.readDomainJson = require_spec.readDomainJson;
|
|
94
|
+
exports.readDomainJsonOrThrow = require_spec.readDomainJsonOrThrow;
|
|
95
|
+
exports.readMetadata = require_spec.readMetadata;
|
|
96
|
+
exports.readMetadataJson = require_spec.readMetadataJson;
|
|
97
|
+
exports.readMetadataJsonOrThrow = require_spec.readMetadataJsonOrThrow;
|
|
98
|
+
exports.resolveAnchors = require_anchored.resolveAnchors;
|
|
99
|
+
exports.resolveAnnotationParents = require_spec.resolveAnnotationParents;
|
|
100
|
+
exports.sortJoinEntry = require_table_calculate.sortJoinEntry;
|
|
101
|
+
exports.sortPTableDef = require_table_calculate.sortPTableDef;
|
|
102
|
+
exports.sortSpecQuery = require_utils.sortSpecQuery;
|
|
103
|
+
exports.stringifyColumnId = require_ids.stringifyColumnId;
|
|
104
|
+
exports.stringifyDiscoveredPColumnId = require_discovered_column.stringifyDiscoveredPColumnId;
|
|
105
|
+
exports.traverseQuerySpec = require_utils.traverseQuerySpec;
|
|
106
|
+
exports.validateRangeBytes = require_blob.validateRangeBytes;
|
|
107
|
+
exports.visitDataInfo = require_data_info.visitDataInfo;
|
package/dist/drivers/index.d.ts
CHANGED
|
@@ -27,4 +27,5 @@ import { CompositeLinkerMap, LinkerMap } from "./pframe/linker_columns.js";
|
|
|
27
27
|
import { FileRange, ImportFileHandle, ImportFileHandleIndex, ImportFileHandleUpload, ListFilesResult, LocalImportFileHandle, LsDriver, LsEntry, OpenDialogFilter, OpenDialogOps, OpenMultipleFilesResponse, OpenSingleFileResponse, StorageEntry, StorageHandle, StorageHandleLocal, StorageHandleRemote, getFileNameFromHandle, getFilePathFromHandle, isImportFileHandleIndex, isImportFileHandleUpload } from "./ls.js";
|
|
28
28
|
import { ChunkedStreamReader, ChunkedStreamReaderOptions, ErrorHandlerStatus } from "./ChunkedStreamReader.js";
|
|
29
29
|
import { PFrame, PFrameDef } from "./pframe/pframe.js";
|
|
30
|
-
import { PFrameDriver, PFrameHandle, PFrameModelDriver, PTableHandle } from "./pframe/driver.js";
|
|
30
|
+
import { PFrameDriver, PFrameHandle, PFrameModelDriver, PTableHandle } from "./pframe/driver.js";
|
|
31
|
+
export { AAxisSelector, ADomain, AnchorAxisIdOrRefBasic, AnchorAxisRef, AnchorAxisRefByIdx, AnchorAxisRefByMatcher, AnchorAxisRefByName, AnchorDomainRef, AnchoredColumnMatchStrategy, AnchoredIdDeriver, AnchoredPColumnId, AnchoredPColumnSelector, Annotation, AnnotationDataStatus, AnnotationJson, AnyLogHandle, ArchiveFormat, ArtificialColumnJoinEntry, AxesId, AxesSpec, AxisFilter, AxisFilterByIdx, AxisFilterByName, AxisFilterValue, AxisId, AxisQualification, AxisSpec, AxisSpecNormalized, AxisTree, AxisValueType, BinaryChunk, BinaryPartitionedDataInfo, BinaryPartitionedDataInfoEntries, BlobDriver, BlobDriverMetrics, BlobHandleAndSize, BlobLike, BlobToURLDriver, BlockUIURL, BuildQueryInput, CalculateTableDataRequest, CalculateTableDataResponse, ChunkedStreamReader, ChunkedStreamReaderOptions, ColumnAxesWithQualifications, ColumnFilter, ColumnJoinEntry, ColumnValueType, CompositeLinkerMap, ConstantAxisFilter, ContentHandler, DataExprAxisRef, DataExprColumnRef, DataInfo, DataInfoEntries, DataQuery, DataQueryBooleanExpression, DataQueryColumn, DataQueryExpression, DataQueryFilter, DataQueryInlineColumn, DataQueryJoinEntry, DataQueryLinkerJoin, DataQueryLinkerJoinLinker, DataQueryOuterJoin, DataQuerySliceAxes, DataQuerySort, DataQuerySparseToDenseColumn, DataQuerySymmetricJoin, DataQueryTransformColumns, DeleteColumnRequest, DeleteColumnResponse, DiscoverColumnsConstraints, DiscoverColumnsFilterStep, DiscoverColumnsLinkerStep, DiscoverColumnsMappingVariant, DiscoverColumnsRequest, DiscoverColumnsResponse, DiscoverColumnsResponseHit, DiscoverColumnsResponseQualifications, DiscoverColumnsStepInfo, DiscoveredPColumn, DiscoveredPColumnId, Domain, DomainJson, ErrorHandlerStatus, EvaluateQueryResponse, ExportPTableOptions, FileLike, FileRange, FilterSpec, FilterSpecLeaf, FilterSpecNode, FilterSpecOfType, FilterSpecType, FilteredPColumn, FilteredPColumnId, FindColumnsRequest, FindColumnsResponse, FolderURL, FrontendDriver, FullJoin, FullPTableColumnData, GetContentOptions, ImportFileHandle, ImportFileHandleIndex, ImportFileHandleUpload, ImportProgress, ImportStatus, InferFilterSpecCommonLeaf, InferFilterSpecCommonNode, InferFilterSpecLeaf, InferFilterSpecLeafColumn, InlineColumnJoinEntry, InnerJoin, JoinEntry, JsonDataInfo, JsonDataInfoEntries, JsonPartitionedDataInfo, JsonPartitionedDataInfoEntries, LegacyAxisSelector, LinkerMap, ListFilesResult, LiveLogHandle, LocalBlobHandle, LocalBlobHandleAndSize, LocalImportFileHandle, LogsDriver, LsDriver, LsEntry, MatcherMap, Metadata, MetadataJson, MultiAxisSelector, MultiColumnSelector, NativePObjectId, OpenDialogFilter, OpenDialogOps, OpenMultipleFilesResponse, OpenSingleFileResponse, OuterJoin, PAxisName, PColumn, PColumnDataEntry, PColumnIdAndSpec, PColumnKey, PColumnLazy, PColumnName, PColumnSelector, PColumnSpec, PColumnSpecId, PColumnValue, PColumnValues, PColumnValuesEntry, PDataColumnSpec, PFrame, PFrameDef, PFrameDriver, PFrameHandle, PFrameModelDriver, PFrameSpecDriver, PTable, PTableColumnId, PTableColumnIdAxis, PTableColumnIdColumn, PTableColumnSpec, PTableColumnSpecAxis, PTableColumnSpecColumn, PTableDef, PTableDefV2, PTableDownloadCompression, PTableDownloadFormat, PTableHandle, PTableNA, PTableRecordFilter, PTableRecordSingleValueFilterV2, PTableShape, PTableSorting, PTableValue, PTableValueAxis, PTableValueBranded, PTableValueData, PTableValueDataBranded, PTableValueDouble, PTableValueFloat, PTableValueInt, PTableValueLong, PTableValueString, PTableVector, PTableVectorTyped, PUniversalColumnSpec, PVectorData, PVectorDataBytes, PVectorDataDouble, PVectorDataFloat, PVectorDataInt, PVectorDataLong, PVectorDataString, PVectorDataTyped, ParquetChunk, ParquetChunkMapping, ParquetChunkMappingAxis, ParquetChunkMappingColumn, ParquetChunkMetadata, ParquetChunkStats, ParquetPartitionedDataInfo, ParquetPartitionedDataInfoEntries, PartitionedDataInfoEntries, ProgressLogWithInfo, RangeBytes, ReadyLogHandle, RemoteBlobHandle, RemoteBlobHandleAndSize, ResolveAnchorsOptions, RootFilterSpec, SUniversalPColumnId, SingleAxisSelector, SingleValueAndPredicateV2, SingleValueEqualPredicate, SingleValueGreaterOrEqualPredicate, SingleValueGreaterPredicate, SingleValueIEqualPredicate, SingleValueInSetPredicate, SingleValueIsNAPredicate, SingleValueLessOrEqualPredicate, SingleValueLessPredicate, SingleValueMatchesPredicate, SingleValueNotPredicateV2, SingleValueOrPredicateV2, SingleValuePredicateV2, SingleValueStringContainsFuzzyPredicate, SingleValueStringContainsPredicate, SingleValueStringIContainsFuzzyPredicate, SingleValueStringIContainsPredicate, SlicedColumnJoinEntry, SpecExprAxisRef, SpecExprColumnRef, SpecFrameHandle, SpecQuery, SpecQueryBooleanExpression, SpecQueryColumn, SpecQueryExpression, SpecQueryFilter, SpecQueryInlineColumn, SpecQueryJoinEntry, SpecQueryLinkerJoin, SpecQueryLinkerJoinLinker, SpecQueryOuterJoin, SpecQuerySliceAxes, SpecQuerySort, SpecQuerySparseToDenseColumn, SpecQuerySymmetricJoin, SpecQueryTransformColumns, StorageEntry, StorageHandle, StorageHandleLocal, StorageHandleRemote, StreamingApiResponse, StreamingApiResponseHandleOutdated, StreamingApiResponseOk, StringMatcher, TableRange, Trace, TraceEntry, UniqueValuesRequest, UniqueValuesResponse, UniversalPColumnId, ValueType, ValueTypeSupported, WritePTableToFsOptions, WritePTableToFsResult, XLSX_MAX_ROWS_PER_SHEET, canonicalizeAxisId, canonicalizeAxisWithParents, collectSpecQueryColumns, createDiscoveredPColumnId, dataInfoToEntries, deriveNativeId, distillDiscoveredPColumn, entriesToDataInfo, getArrayFromAxisTree, getAxesId, getAxesTree, getAxisId, getColumnIdAndSpec, getDenormalizedAxesList, getFileNameFromHandle, getFilePathFromHandle, getNormalizedAxesList, getPColumnSpecId, getPTableColumnId, getSetFromAxisTree, getTypeFromPColumnOrAxisSpec, isAnchoredPColumnId, isAnyLogHandle, isAxisId, isBlockUIURL, isBooleanExpression, isDataInfo, isDataInfoEntries, isDiscoveredPColumn, isFilteredPColumn, isFolderURL, isImportFileHandleIndex, isImportFileHandleUpload, isLabelColumn, isLinkerColumn, isLiveLog, isPTableNA, isPartitionedDataInfoEntries, isValueNA, legacyColumnSelectorsToPredicate, mapDataInfo, mapDataInfoEntries, mapJoinEntry, mapPTableDef, mapPTableDefV2, mapSpecQueryColumns, matchAxis, matchAxisId, matchMultiColumnSelector, matchPColumn, multiColumnSelectorsToPredicate, newRangeBytesOpt, pTableValue, pTableValueBranded, parseColumnId, parseDiscoveredPColumnId, readAnnotation, readAnnotationJson, readAnnotationJsonOrThrow, readDomain, readDomainJson, readDomainJsonOrThrow, readMetadata, readMetadataJson, readMetadataJsonOrThrow, resolveAnchors, resolveAnnotationParents, sortJoinEntry, sortPTableDef, sortSpecQuery, stringifyColumnId, stringifyDiscoveredPColumnId, traverseQuerySpec, validateRangeBytes, visitDataInfo };
|
package/dist/drivers/index.js
CHANGED
|
@@ -1,19 +1,20 @@
|
|
|
1
|
-
import "./urls.js";
|
|
2
|
-
import "./blob.js";
|
|
3
|
-
import "./log.js";
|
|
4
|
-
import "./ls.js";
|
|
5
|
-
import "./pframe/data_info.js";
|
|
6
|
-
import "./pframe/spec/spec.js";
|
|
7
|
-
import "./pframe/data_types.js";
|
|
8
|
-
import "./pframe/query/utils.js";
|
|
9
|
-
import "./pframe/table_calculate.js";
|
|
10
|
-
import "./pframe/table_common.js";
|
|
11
|
-
import "./pframe/spec/ids.js";
|
|
12
|
-
import "./pframe/spec/anchored.js";
|
|
13
|
-
import "./pframe/spec/filtered_column.js";
|
|
14
|
-
import "./pframe/spec/selectors.js";
|
|
15
|
-
import "./pframe/spec/native_id.js";
|
|
16
|
-
import "./pframe/spec/discovered_column.js";
|
|
17
|
-
import "./pframe/linker_columns.js";
|
|
1
|
+
import { isBlockUIURL, isFolderURL } from "./urls.js";
|
|
2
|
+
import { RangeBytes, newRangeBytesOpt, validateRangeBytes } from "./blob.js";
|
|
3
|
+
import { isAnyLogHandle, isLiveLog } from "./log.js";
|
|
4
|
+
import { getFileNameFromHandle, getFilePathFromHandle, isImportFileHandleIndex, isImportFileHandleUpload } from "./ls.js";
|
|
5
|
+
import { dataInfoToEntries, entriesToDataInfo, isDataInfo, isDataInfoEntries, isPartitionedDataInfoEntries, mapDataInfo, mapDataInfoEntries, visitDataInfo } from "./pframe/data_info.js";
|
|
6
|
+
import { Annotation, AnnotationJson, Domain, DomainJson, PAxisName, PColumnName, ValueType, canonicalizeAxisId, canonicalizeAxisWithParents, getArrayFromAxisTree, getAxesId, getAxesTree, getAxisId, getColumnIdAndSpec, getDenormalizedAxesList, getNormalizedAxesList, getPColumnSpecId, getSetFromAxisTree, getTypeFromPColumnOrAxisSpec, isAxisId, isLabelColumn, isLinkerColumn, matchAxisId, readAnnotation, readAnnotationJson, readAnnotationJsonOrThrow, readDomain, readDomainJson, readDomainJsonOrThrow, readMetadata, readMetadataJson, readMetadataJsonOrThrow, resolveAnnotationParents } from "./pframe/spec/spec.js";
|
|
7
|
+
import { PTableNA, XLSX_MAX_ROWS_PER_SHEET, isPTableNA, isValueNA, pTableValue, pTableValueBranded } from "./pframe/data_types.js";
|
|
8
|
+
import { collectSpecQueryColumns, isBooleanExpression, mapSpecQueryColumns, sortSpecQuery, traverseQuerySpec } from "./pframe/query/utils.js";
|
|
9
|
+
import { mapJoinEntry, mapPTableDef, mapPTableDefV2, sortJoinEntry, sortPTableDef } from "./pframe/table_calculate.js";
|
|
10
|
+
import { getPTableColumnId } from "./pframe/table_common.js";
|
|
11
|
+
import { parseColumnId, stringifyColumnId } from "./pframe/spec/ids.js";
|
|
12
|
+
import { AnchoredIdDeriver, resolveAnchors } from "./pframe/spec/anchored.js";
|
|
13
|
+
import { isFilteredPColumn } from "./pframe/spec/filtered_column.js";
|
|
14
|
+
import { isAnchoredPColumnId, legacyColumnSelectorsToPredicate, matchAxis, matchMultiColumnSelector, matchPColumn, multiColumnSelectorsToPredicate } from "./pframe/spec/selectors.js";
|
|
15
|
+
import { deriveNativeId } from "./pframe/spec/native_id.js";
|
|
16
|
+
import { createDiscoveredPColumnId, distillDiscoveredPColumn, isDiscoveredPColumn, parseDiscoveredPColumnId, stringifyDiscoveredPColumnId } from "./pframe/spec/discovered_column.js";
|
|
17
|
+
import { LinkerMap } from "./pframe/linker_columns.js";
|
|
18
18
|
import "./pframe/index.js";
|
|
19
|
-
import "./ChunkedStreamReader.js";
|
|
19
|
+
import { ChunkedStreamReader } from "./ChunkedStreamReader.js";
|
|
20
|
+
export { AnchoredIdDeriver, Annotation, AnnotationJson, ChunkedStreamReader, Domain, DomainJson, LinkerMap, PAxisName, PColumnName, PTableNA, RangeBytes, ValueType, XLSX_MAX_ROWS_PER_SHEET, canonicalizeAxisId, canonicalizeAxisWithParents, collectSpecQueryColumns, createDiscoveredPColumnId, dataInfoToEntries, deriveNativeId, distillDiscoveredPColumn, entriesToDataInfo, getArrayFromAxisTree, getAxesId, getAxesTree, getAxisId, getColumnIdAndSpec, getDenormalizedAxesList, getFileNameFromHandle, getFilePathFromHandle, getNormalizedAxesList, getPColumnSpecId, getPTableColumnId, getSetFromAxisTree, getTypeFromPColumnOrAxisSpec, isAnchoredPColumnId, isAnyLogHandle, isAxisId, isBlockUIURL, isBooleanExpression, isDataInfo, isDataInfoEntries, isDiscoveredPColumn, isFilteredPColumn, isFolderURL, isImportFileHandleIndex, isImportFileHandleUpload, isLabelColumn, isLinkerColumn, isLiveLog, isPTableNA, isPartitionedDataInfoEntries, isValueNA, legacyColumnSelectorsToPredicate, mapDataInfo, mapDataInfoEntries, mapJoinEntry, mapPTableDef, mapPTableDefV2, mapSpecQueryColumns, matchAxis, matchAxisId, matchMultiColumnSelector, matchPColumn, multiColumnSelectorsToPredicate, newRangeBytesOpt, pTableValue, pTableValueBranded, parseColumnId, parseDiscoveredPColumnId, readAnnotation, readAnnotationJson, readAnnotationJsonOrThrow, readDomain, readDomainJson, readDomainJsonOrThrow, readMetadata, readMetadataJson, readMetadataJsonOrThrow, resolveAnchors, resolveAnnotationParents, sortJoinEntry, sortPTableDef, sortSpecQuery, stringifyColumnId, stringifyDiscoveredPColumnId, traverseQuerySpec, validateRangeBytes, visitDataInfo };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"interfaces.d.ts","names":[],"sources":["../../src/drivers/interfaces.ts"],"mappings":";;AAGA;;UAAiB,QAAA;EAQ8B;EAAA,SANpC,IAAA;EAEA;EAAA,SAAA,IAAA;EAED;EAAR,IAAA,IAAQ,OAAA;EAEF;EAAN,KAAA,CAAM,KAAA,WAAgB,GAAA,YAAe,
|
|
1
|
+
{"version":3,"file":"interfaces.d.ts","names":[],"sources":["../../src/drivers/interfaces.ts"],"mappings":";;AAGA;;UAAiB,QAAA;EAQ8B;EAAA,SANpC,IAAA;EAEA;EAAA,SAAA,IAAA;EAED;EAAR,IAAA,IAAQ,OAAA;EAEF;EAAN,KAAA,CAAM,KAAA,WAAgB,GAAA,YAAe,QAAQ;AAAA;;AAAA;AAO/C;UAAiB,QAAA,SAAiB,QAAQ;;WAE/B,YAAA;EAFuB;EAAA,SAIvB,IAAA;AAAA"}
|
package/dist/drivers/log.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"log.cjs","names":[],"sources":["../../src/drivers/log.ts"],"sourcesContent":["import type { Branded } from \"../branding\";\n\n/** Prefix constants — single source of truth for handle format. */\nconst LIVE_LOG_PREFIX = \"log+live://log/\";\nconst READY_LOG_PREFIX = \"log+ready://log/\";\n\n/** Handle of the live logs of a program.\n * The resource that represents a log can be deleted,\n * in this case the handle should be refreshed. */\nexport type LiveLogHandle = Branded<`${typeof LIVE_LOG_PREFIX}${string}`, \"LiveLogHandle\">;\n\n/** Handle of the ready logs of a program. */\nexport type ReadyLogHandle = Branded<`${typeof READY_LOG_PREFIX}${string}`, \"ReadyLogHandle\">;\n\n/** Handle of logs. This handle should be passed\n * to the driver for retrieving logs. */\nexport type AnyLogHandle = LiveLogHandle | ReadyLogHandle;\n\n/** Type guard to check if a value is any kind of log handle. */\nexport function isAnyLogHandle(value: unknown): value is AnyLogHandle {\n return (\n typeof value === \"string\" &&\n (value.startsWith(LIVE_LOG_PREFIX) || value.startsWith(READY_LOG_PREFIX))\n );\n}\n\n/** Type guard to check if log is live, and corresponding process is not finished. */\nexport function isLiveLog(handle: AnyLogHandle | undefined): handle is LiveLogHandle {\n return handle !== undefined && handle.startsWith(LIVE_LOG_PREFIX);\n}\n\n/** Driver to retrieve logs given log handle */\nexport interface LogsDriver {\n lastLines(\n /** A handle that was issued previously. */\n handle: AnyLogHandle,\n\n /** Allows client to limit total data sent from server. */\n lineCount: number,\n\n /** Makes streamer to perform seek operation to given offset before sending the contents.\n * Client can just use the <new_offset> value of the last response from server to continue streaming after reconnection.\n * If undefined, then starts from the end. */\n offsetBytes?: number,\n\n /** Is substring for line search pattern.\n * This option makes controller to send to the client only lines, that\n * have given substring. */\n searchStr?: string,\n ): Promise<StreamingApiResponse>;\n\n readText(\n /** A handle that was issued previously. */\n handle: AnyLogHandle,\n\n /** Allows client to limit total data sent from server. */\n lineCount: number,\n\n /** Makes streamer to perform seek operation to given offset before sending the contents.\n * Client can just use the <new_offset> value of the last response from server to continue streaming after reconnection.\n * If undefined of 0, then starts from the beginning. */\n offsetBytes?: number,\n\n /** Is substring for line search pattern.\n * This option makes controller to send to the client only lines, that\n * have given substring. */\n searchStr?: string,\n ): Promise<StreamingApiResponse>;\n}\n\n/** Response of the driver.\n * The caller should give a handle to retrieve it.\n * It can be OK or outdated, in which case the handle\n * should be issued again. */\nexport type StreamingApiResponse = StreamingApiResponseOk | StreamingApiResponseHandleOutdated;\n\nexport type StreamingApiResponseOk = {\n /** The handle don't have to be updated,\n * the response is OK. */\n shouldUpdateHandle: false;\n\n /** Whether the log can still grow or it's in a final state. */\n live: boolean;\n\n /** Data of the response, in bytes. */\n data: Uint8Array;\n /** Current size of the file. It can grow if it's still live. */\n size: number;\n /** Offset in bytes from the beginning of a file. */\n newOffset: number;\n};\n\n/** The handle should be issued again, this one is done. */\nexport type StreamingApiResponseHandleOutdated = {\n shouldUpdateHandle: true;\n};\n\nexport type ProgressLogWithInfo = {\n progressLine?: string;\n live: boolean;\n};\n"],"mappings":";;AAGA,MAAM,kBAAkB;AACxB,MAAM,mBAAmB;;AAezB,SAAgB,eAAe,OAAuC;
|
|
1
|
+
{"version":3,"file":"log.cjs","names":[],"sources":["../../src/drivers/log.ts"],"sourcesContent":["import type { Branded } from \"../branding\";\n\n/** Prefix constants — single source of truth for handle format. */\nconst LIVE_LOG_PREFIX = \"log+live://log/\";\nconst READY_LOG_PREFIX = \"log+ready://log/\";\n\n/** Handle of the live logs of a program.\n * The resource that represents a log can be deleted,\n * in this case the handle should be refreshed. */\nexport type LiveLogHandle = Branded<`${typeof LIVE_LOG_PREFIX}${string}`, \"LiveLogHandle\">;\n\n/** Handle of the ready logs of a program. */\nexport type ReadyLogHandle = Branded<`${typeof READY_LOG_PREFIX}${string}`, \"ReadyLogHandle\">;\n\n/** Handle of logs. This handle should be passed\n * to the driver for retrieving logs. */\nexport type AnyLogHandle = LiveLogHandle | ReadyLogHandle;\n\n/** Type guard to check if a value is any kind of log handle. */\nexport function isAnyLogHandle(value: unknown): value is AnyLogHandle {\n return (\n typeof value === \"string\" &&\n (value.startsWith(LIVE_LOG_PREFIX) || value.startsWith(READY_LOG_PREFIX))\n );\n}\n\n/** Type guard to check if log is live, and corresponding process is not finished. */\nexport function isLiveLog(handle: AnyLogHandle | undefined): handle is LiveLogHandle {\n return handle !== undefined && handle.startsWith(LIVE_LOG_PREFIX);\n}\n\n/** Driver to retrieve logs given log handle */\nexport interface LogsDriver {\n lastLines(\n /** A handle that was issued previously. */\n handle: AnyLogHandle,\n\n /** Allows client to limit total data sent from server. */\n lineCount: number,\n\n /** Makes streamer to perform seek operation to given offset before sending the contents.\n * Client can just use the <new_offset> value of the last response from server to continue streaming after reconnection.\n * If undefined, then starts from the end. */\n offsetBytes?: number,\n\n /** Is substring for line search pattern.\n * This option makes controller to send to the client only lines, that\n * have given substring. */\n searchStr?: string,\n ): Promise<StreamingApiResponse>;\n\n readText(\n /** A handle that was issued previously. */\n handle: AnyLogHandle,\n\n /** Allows client to limit total data sent from server. */\n lineCount: number,\n\n /** Makes streamer to perform seek operation to given offset before sending the contents.\n * Client can just use the <new_offset> value of the last response from server to continue streaming after reconnection.\n * If undefined of 0, then starts from the beginning. */\n offsetBytes?: number,\n\n /** Is substring for line search pattern.\n * This option makes controller to send to the client only lines, that\n * have given substring. */\n searchStr?: string,\n ): Promise<StreamingApiResponse>;\n}\n\n/** Response of the driver.\n * The caller should give a handle to retrieve it.\n * It can be OK or outdated, in which case the handle\n * should be issued again. */\nexport type StreamingApiResponse = StreamingApiResponseOk | StreamingApiResponseHandleOutdated;\n\nexport type StreamingApiResponseOk = {\n /** The handle don't have to be updated,\n * the response is OK. */\n shouldUpdateHandle: false;\n\n /** Whether the log can still grow or it's in a final state. */\n live: boolean;\n\n /** Data of the response, in bytes. */\n data: Uint8Array;\n /** Current size of the file. It can grow if it's still live. */\n size: number;\n /** Offset in bytes from the beginning of a file. */\n newOffset: number;\n};\n\n/** The handle should be issued again, this one is done. */\nexport type StreamingApiResponseHandleOutdated = {\n shouldUpdateHandle: true;\n};\n\nexport type ProgressLogWithInfo = {\n progressLine?: string;\n live: boolean;\n};\n"],"mappings":";;AAGA,MAAM,kBAAkB;AACxB,MAAM,mBAAmB;;AAezB,SAAgB,eAAe,OAAuC;CACpE,OACE,OAAO,UAAU,aAChB,MAAM,WAAW,eAAe,KAAK,MAAM,WAAW,gBAAgB;AAE3E;;AAGA,SAAgB,UAAU,QAA2D;CACnF,OAAO,WAAW,KAAA,KAAa,OAAO,WAAW,eAAe;AAClE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"log.d.ts","names":[],"sources":["../../src/drivers/log.ts"],"mappings":";;;;cAGM,eAAA;AAAA,cACA,gBAAA;;;;KAKM,aAAA,GAAgB,
|
|
1
|
+
{"version":3,"file":"log.d.ts","names":[],"sources":["../../src/drivers/log.ts"],"mappings":";;;;cAGM,eAAA;AAAA,cACA,gBAAA;;;;KAKM,aAAA,GAAgB,OAAO,WAAW,eAAA;AANzB;AAAA,KAST,cAAA,GAAiB,OAAO,WAAW,gBAAA;;;KAInC,YAAA,GAAe,aAAA,GAAgB,cAAc;AAPzD;AAAA,iBAUgB,cAAA,CAAe,KAAA,YAAiB,KAAA,IAAS,YAAY;;iBAQrD,SAAA,CAAU,MAAA,EAAQ,YAAA,eAA2B,MAAA,IAAU,aAAa;AAlBvB;AAAA,UAuB5C,UAAA;EACf,SAAA;;EAEE,MAAA,EAAQ,YAAA,EAvBmD;;EA0B3D,SAAA;EAtBoB;;;;EA2BpB,WAAA;EAxBY;;;;EA6BZ,SAAA,YACC,OAAA,CAAQ,oBAAA;EAEX,QAAA,CAhC8C;;EAkC5C,MAAA,EAAQ,YAAA,EAlCyD;;EAqCjE,SAAA;EA7BY;;;;EAkCZ,WAAA;EAlC8B;;;;EAuC9B,SAAA,YACC,OAAA,CAAQ,oBAAA;AAAA;AAxCuE;AAKpF;;;AALoF,KA+CxE,oBAAA,GAAuB,sBAAA,GAAyB,kCAAkC;AAAA,KAElF,sBAAA;EA3BP;;EA8BH,kBAAA,SAZG;EAeH,IAAA,WAfU;EAkBV,IAAA,EAAM,UAAU,EAlDN;EAoDV,IAAA,UAjDE;EAmDF,SAAA;AAAA;;KAIU,kCAAA;EACV,kBAAkB;AAAA;AAAA,KAGR,mBAAA;EACV,YAAA;EACA,IAAI;AAAA"}
|
package/dist/drivers/log.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"log.js","names":[],"sources":["../../src/drivers/log.ts"],"sourcesContent":["import type { Branded } from \"../branding\";\n\n/** Prefix constants — single source of truth for handle format. */\nconst LIVE_LOG_PREFIX = \"log+live://log/\";\nconst READY_LOG_PREFIX = \"log+ready://log/\";\n\n/** Handle of the live logs of a program.\n * The resource that represents a log can be deleted,\n * in this case the handle should be refreshed. */\nexport type LiveLogHandle = Branded<`${typeof LIVE_LOG_PREFIX}${string}`, \"LiveLogHandle\">;\n\n/** Handle of the ready logs of a program. */\nexport type ReadyLogHandle = Branded<`${typeof READY_LOG_PREFIX}${string}`, \"ReadyLogHandle\">;\n\n/** Handle of logs. This handle should be passed\n * to the driver for retrieving logs. */\nexport type AnyLogHandle = LiveLogHandle | ReadyLogHandle;\n\n/** Type guard to check if a value is any kind of log handle. */\nexport function isAnyLogHandle(value: unknown): value is AnyLogHandle {\n return (\n typeof value === \"string\" &&\n (value.startsWith(LIVE_LOG_PREFIX) || value.startsWith(READY_LOG_PREFIX))\n );\n}\n\n/** Type guard to check if log is live, and corresponding process is not finished. */\nexport function isLiveLog(handle: AnyLogHandle | undefined): handle is LiveLogHandle {\n return handle !== undefined && handle.startsWith(LIVE_LOG_PREFIX);\n}\n\n/** Driver to retrieve logs given log handle */\nexport interface LogsDriver {\n lastLines(\n /** A handle that was issued previously. */\n handle: AnyLogHandle,\n\n /** Allows client to limit total data sent from server. */\n lineCount: number,\n\n /** Makes streamer to perform seek operation to given offset before sending the contents.\n * Client can just use the <new_offset> value of the last response from server to continue streaming after reconnection.\n * If undefined, then starts from the end. */\n offsetBytes?: number,\n\n /** Is substring for line search pattern.\n * This option makes controller to send to the client only lines, that\n * have given substring. */\n searchStr?: string,\n ): Promise<StreamingApiResponse>;\n\n readText(\n /** A handle that was issued previously. */\n handle: AnyLogHandle,\n\n /** Allows client to limit total data sent from server. */\n lineCount: number,\n\n /** Makes streamer to perform seek operation to given offset before sending the contents.\n * Client can just use the <new_offset> value of the last response from server to continue streaming after reconnection.\n * If undefined of 0, then starts from the beginning. */\n offsetBytes?: number,\n\n /** Is substring for line search pattern.\n * This option makes controller to send to the client only lines, that\n * have given substring. */\n searchStr?: string,\n ): Promise<StreamingApiResponse>;\n}\n\n/** Response of the driver.\n * The caller should give a handle to retrieve it.\n * It can be OK or outdated, in which case the handle\n * should be issued again. */\nexport type StreamingApiResponse = StreamingApiResponseOk | StreamingApiResponseHandleOutdated;\n\nexport type StreamingApiResponseOk = {\n /** The handle don't have to be updated,\n * the response is OK. */\n shouldUpdateHandle: false;\n\n /** Whether the log can still grow or it's in a final state. */\n live: boolean;\n\n /** Data of the response, in bytes. */\n data: Uint8Array;\n /** Current size of the file. It can grow if it's still live. */\n size: number;\n /** Offset in bytes from the beginning of a file. */\n newOffset: number;\n};\n\n/** The handle should be issued again, this one is done. */\nexport type StreamingApiResponseHandleOutdated = {\n shouldUpdateHandle: true;\n};\n\nexport type ProgressLogWithInfo = {\n progressLine?: string;\n live: boolean;\n};\n"],"mappings":";;AAGA,MAAM,kBAAkB;AACxB,MAAM,mBAAmB;;AAezB,SAAgB,eAAe,OAAuC;
|
|
1
|
+
{"version":3,"file":"log.js","names":[],"sources":["../../src/drivers/log.ts"],"sourcesContent":["import type { Branded } from \"../branding\";\n\n/** Prefix constants — single source of truth for handle format. */\nconst LIVE_LOG_PREFIX = \"log+live://log/\";\nconst READY_LOG_PREFIX = \"log+ready://log/\";\n\n/** Handle of the live logs of a program.\n * The resource that represents a log can be deleted,\n * in this case the handle should be refreshed. */\nexport type LiveLogHandle = Branded<`${typeof LIVE_LOG_PREFIX}${string}`, \"LiveLogHandle\">;\n\n/** Handle of the ready logs of a program. */\nexport type ReadyLogHandle = Branded<`${typeof READY_LOG_PREFIX}${string}`, \"ReadyLogHandle\">;\n\n/** Handle of logs. This handle should be passed\n * to the driver for retrieving logs. */\nexport type AnyLogHandle = LiveLogHandle | ReadyLogHandle;\n\n/** Type guard to check if a value is any kind of log handle. */\nexport function isAnyLogHandle(value: unknown): value is AnyLogHandle {\n return (\n typeof value === \"string\" &&\n (value.startsWith(LIVE_LOG_PREFIX) || value.startsWith(READY_LOG_PREFIX))\n );\n}\n\n/** Type guard to check if log is live, and corresponding process is not finished. */\nexport function isLiveLog(handle: AnyLogHandle | undefined): handle is LiveLogHandle {\n return handle !== undefined && handle.startsWith(LIVE_LOG_PREFIX);\n}\n\n/** Driver to retrieve logs given log handle */\nexport interface LogsDriver {\n lastLines(\n /** A handle that was issued previously. */\n handle: AnyLogHandle,\n\n /** Allows client to limit total data sent from server. */\n lineCount: number,\n\n /** Makes streamer to perform seek operation to given offset before sending the contents.\n * Client can just use the <new_offset> value of the last response from server to continue streaming after reconnection.\n * If undefined, then starts from the end. */\n offsetBytes?: number,\n\n /** Is substring for line search pattern.\n * This option makes controller to send to the client only lines, that\n * have given substring. */\n searchStr?: string,\n ): Promise<StreamingApiResponse>;\n\n readText(\n /** A handle that was issued previously. */\n handle: AnyLogHandle,\n\n /** Allows client to limit total data sent from server. */\n lineCount: number,\n\n /** Makes streamer to perform seek operation to given offset before sending the contents.\n * Client can just use the <new_offset> value of the last response from server to continue streaming after reconnection.\n * If undefined of 0, then starts from the beginning. */\n offsetBytes?: number,\n\n /** Is substring for line search pattern.\n * This option makes controller to send to the client only lines, that\n * have given substring. */\n searchStr?: string,\n ): Promise<StreamingApiResponse>;\n}\n\n/** Response of the driver.\n * The caller should give a handle to retrieve it.\n * It can be OK or outdated, in which case the handle\n * should be issued again. */\nexport type StreamingApiResponse = StreamingApiResponseOk | StreamingApiResponseHandleOutdated;\n\nexport type StreamingApiResponseOk = {\n /** The handle don't have to be updated,\n * the response is OK. */\n shouldUpdateHandle: false;\n\n /** Whether the log can still grow or it's in a final state. */\n live: boolean;\n\n /** Data of the response, in bytes. */\n data: Uint8Array;\n /** Current size of the file. It can grow if it's still live. */\n size: number;\n /** Offset in bytes from the beginning of a file. */\n newOffset: number;\n};\n\n/** The handle should be issued again, this one is done. */\nexport type StreamingApiResponseHandleOutdated = {\n shouldUpdateHandle: true;\n};\n\nexport type ProgressLogWithInfo = {\n progressLine?: string;\n live: boolean;\n};\n"],"mappings":";;AAGA,MAAM,kBAAkB;AACxB,MAAM,mBAAmB;;AAezB,SAAgB,eAAe,OAAuC;CACpE,OACE,OAAO,UAAU,aAChB,MAAM,WAAW,eAAe,KAAK,MAAM,WAAW,gBAAgB;AAE3E;;AAGA,SAAgB,UAAU,QAA2D;CACnF,OAAO,WAAW,KAAA,KAAa,OAAO,WAAW,eAAe;AAClE"}
|
package/dist/drivers/ls.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ls.cjs","names":[],"sources":["../../src/drivers/ls.ts"],"sourcesContent":["import { assertNever } from \"../util\";\nimport type { Branded } from \"../branding\";\nimport type { TableRange } from \"./pframe\";\nimport type { FileLike } from \"./interfaces\";\n\nconst uploadPrefix = \"upload://upload/\";\nconst indexPrefix = \"index://index/\";\n\nexport type ImportFileHandleUpload = `upload://upload/${string}`;\nexport type ImportFileHandleIndex = `index://index/${string}`;\n\nexport type ImportFileHandle = ImportFileHandleUpload | ImportFileHandleIndex;\n\nexport type LocalImportFileHandle = Branded<ImportFileHandle, \"Local\">;\n\nexport function isImportFileHandleUpload(\n handle: ImportFileHandle,\n): handle is ImportFileHandleUpload {\n return handle.startsWith(uploadPrefix);\n}\n\nexport function isImportFileHandleIndex(handle: ImportFileHandle): handle is ImportFileHandleIndex {\n return handle.startsWith(indexPrefix);\n}\n\n/** Results in upload */\nexport type StorageHandleLocal = `local://${string}`;\n\n/** Results in index */\nexport type StorageHandleRemote = `remote://${string}`;\n\nexport type StorageHandle = StorageHandleLocal | StorageHandleRemote;\n\nexport type StorageEntry = {\n /** Stable machine identifier (e.g. \"library\", \"root\", \"local\"). Used for filtering. */\n id: string;\n /** Human-readable display name. */\n name: string;\n handle: StorageHandle;\n initialFullPath: string;\n};\n\nexport type ListFilesResult = {\n parent?: string;\n entries: LsEntry[];\n};\n\nexport type LsEntry =\n | {\n type: \"dir\";\n name: string;\n fullPath: string;\n }\n | {\n type: \"file\";\n name: string;\n fullPath: string;\n\n /** This handle should be set to args... */\n handle: ImportFileHandle;\n };\n\nexport type OpenDialogFilter = {\n /** Human-readable file type name */\n readonly name: string;\n /** File extensions */\n readonly extensions: string[];\n};\n\nexport type OpenDialogOps = {\n /** Open dialog window title */\n readonly title?: string;\n /** Custom label for the confirmation button, when left empty the default label will be used. */\n readonly buttonLabel?: string;\n /** Limits of file types user can select */\n readonly filters?: OpenDialogFilter[];\n};\n\nexport type OpenSingleFileResponse = {\n /** Contains local file handle, allowing file importing or content reading. If user canceled\n * the dialog, field will be undefined. */\n readonly file?: LocalImportFileHandle;\n};\n\nexport type OpenMultipleFilesResponse = {\n /** Contains local file handles, allowing file importing or content reading. If user canceled\n * the dialog, field will be undefined. */\n readonly files?: LocalImportFileHandle[];\n};\n\n/** Can be used to limit request for local file content to a certain bytes range */\nexport type FileRange = {\n /** From byte index (inclusive) */\n readonly from: number;\n /** To byte index (exclusive) */\n readonly to: number;\n};\n\nexport interface LsDriver {\n /** remote and local storages */\n getStorageList(): Promise<StorageEntry[]>;\n\n listFiles(storage: StorageHandle, fullPath: string): Promise<ListFilesResult>;\n\n /** Opens system file open dialog allowing to select single file and awaits user action */\n showOpenSingleFileDialog(ops: OpenDialogOps): Promise<OpenSingleFileResponse>;\n\n /** Opens system file open dialog allowing to multiple files and awaits user action */\n showOpenMultipleFilesDialog(ops: OpenDialogOps): Promise<OpenMultipleFilesResponse>;\n\n /** Given a handle to a local file, allows to get file size */\n getLocalFileSize(file: LocalImportFileHandle): Promise<number>;\n\n /** Given a handle to a local file, allows to get its content */\n getLocalFileContent(file: LocalImportFileHandle, range?: TableRange): Promise<Uint8Array>;\n\n /**\n * Resolves browser's File object into platforma's import file handle.\n *\n * This method is useful among other things for implementation of UI\n * components, that handle file Drag&Drop.\n * */\n fileToImportHandle(file: FileLike): Promise<ImportFileHandle>;\n\n /** Saves currently opened block webview as a PDF. */\n exportToPdf?(): Promise<void>;\n}\n\n/** Gets a file path from an import handle. */\nexport function getFilePathFromHandle(handle: ImportFileHandle): string {\n if (isImportFileHandleIndex(handle)) {\n const trimmed = handle.slice(indexPrefix.length);\n const data = JSON.parse(decodeURIComponent(trimmed)) as { path: string };\n return data.path;\n } else if (isImportFileHandleUpload(handle)) {\n const trimmed = handle.slice(uploadPrefix.length);\n const data = JSON.parse(decodeURIComponent(trimmed)) as { localPath: string };\n return data.localPath;\n }\n\n assertNever(handle);\n}\n\nfunction extractFileName(filePath: string) {\n return filePath.replace(/^.*[\\\\/]/, \"\");\n}\n\n/** Gets a file name from an import handle. */\nexport function getFileNameFromHandle(handle: ImportFileHandle): string {\n return extractFileName(getFilePathFromHandle(handle));\n}\n"],"mappings":";;AAKA,MAAM,eAAe;AACrB,MAAM,cAAc;AASpB,SAAgB,yBACd,QACkC;
|
|
1
|
+
{"version":3,"file":"ls.cjs","names":[],"sources":["../../src/drivers/ls.ts"],"sourcesContent":["import { assertNever } from \"../util\";\nimport type { Branded } from \"../branding\";\nimport type { TableRange } from \"./pframe\";\nimport type { FileLike } from \"./interfaces\";\n\nconst uploadPrefix = \"upload://upload/\";\nconst indexPrefix = \"index://index/\";\n\nexport type ImportFileHandleUpload = `upload://upload/${string}`;\nexport type ImportFileHandleIndex = `index://index/${string}`;\n\nexport type ImportFileHandle = ImportFileHandleUpload | ImportFileHandleIndex;\n\nexport type LocalImportFileHandle = Branded<ImportFileHandle, \"Local\">;\n\nexport function isImportFileHandleUpload(\n handle: ImportFileHandle,\n): handle is ImportFileHandleUpload {\n return handle.startsWith(uploadPrefix);\n}\n\nexport function isImportFileHandleIndex(handle: ImportFileHandle): handle is ImportFileHandleIndex {\n return handle.startsWith(indexPrefix);\n}\n\n/** Results in upload */\nexport type StorageHandleLocal = `local://${string}`;\n\n/** Results in index */\nexport type StorageHandleRemote = `remote://${string}`;\n\nexport type StorageHandle = StorageHandleLocal | StorageHandleRemote;\n\nexport type StorageEntry = {\n /** Stable machine identifier (e.g. \"library\", \"root\", \"local\"). Used for filtering. */\n id: string;\n /** Human-readable display name. */\n name: string;\n handle: StorageHandle;\n initialFullPath: string;\n};\n\nexport type ListFilesResult = {\n parent?: string;\n entries: LsEntry[];\n};\n\nexport type LsEntry =\n | {\n type: \"dir\";\n name: string;\n fullPath: string;\n }\n | {\n type: \"file\";\n name: string;\n fullPath: string;\n\n /** This handle should be set to args... */\n handle: ImportFileHandle;\n };\n\nexport type OpenDialogFilter = {\n /** Human-readable file type name */\n readonly name: string;\n /** File extensions */\n readonly extensions: string[];\n};\n\nexport type OpenDialogOps = {\n /** Open dialog window title */\n readonly title?: string;\n /** Custom label for the confirmation button, when left empty the default label will be used. */\n readonly buttonLabel?: string;\n /** Limits of file types user can select */\n readonly filters?: OpenDialogFilter[];\n};\n\nexport type OpenSingleFileResponse = {\n /** Contains local file handle, allowing file importing or content reading. If user canceled\n * the dialog, field will be undefined. */\n readonly file?: LocalImportFileHandle;\n};\n\nexport type OpenMultipleFilesResponse = {\n /** Contains local file handles, allowing file importing or content reading. If user canceled\n * the dialog, field will be undefined. */\n readonly files?: LocalImportFileHandle[];\n};\n\n/** Can be used to limit request for local file content to a certain bytes range */\nexport type FileRange = {\n /** From byte index (inclusive) */\n readonly from: number;\n /** To byte index (exclusive) */\n readonly to: number;\n};\n\nexport interface LsDriver {\n /** remote and local storages */\n getStorageList(): Promise<StorageEntry[]>;\n\n listFiles(storage: StorageHandle, fullPath: string): Promise<ListFilesResult>;\n\n /** Opens system file open dialog allowing to select single file and awaits user action */\n showOpenSingleFileDialog(ops: OpenDialogOps): Promise<OpenSingleFileResponse>;\n\n /** Opens system file open dialog allowing to multiple files and awaits user action */\n showOpenMultipleFilesDialog(ops: OpenDialogOps): Promise<OpenMultipleFilesResponse>;\n\n /** Given a handle to a local file, allows to get file size */\n getLocalFileSize(file: LocalImportFileHandle): Promise<number>;\n\n /** Given a handle to a local file, allows to get its content */\n getLocalFileContent(file: LocalImportFileHandle, range?: TableRange): Promise<Uint8Array>;\n\n /**\n * Resolves browser's File object into platforma's import file handle.\n *\n * This method is useful among other things for implementation of UI\n * components, that handle file Drag&Drop.\n * */\n fileToImportHandle(file: FileLike): Promise<ImportFileHandle>;\n\n /** Saves currently opened block webview as a PDF. */\n exportToPdf?(): Promise<void>;\n}\n\n/** Gets a file path from an import handle. */\nexport function getFilePathFromHandle(handle: ImportFileHandle): string {\n if (isImportFileHandleIndex(handle)) {\n const trimmed = handle.slice(indexPrefix.length);\n const data = JSON.parse(decodeURIComponent(trimmed)) as { path: string };\n return data.path;\n } else if (isImportFileHandleUpload(handle)) {\n const trimmed = handle.slice(uploadPrefix.length);\n const data = JSON.parse(decodeURIComponent(trimmed)) as { localPath: string };\n return data.localPath;\n }\n\n assertNever(handle);\n}\n\nfunction extractFileName(filePath: string) {\n return filePath.replace(/^.*[\\\\/]/, \"\");\n}\n\n/** Gets a file name from an import handle. */\nexport function getFileNameFromHandle(handle: ImportFileHandle): string {\n return extractFileName(getFilePathFromHandle(handle));\n}\n"],"mappings":";;AAKA,MAAM,eAAe;AACrB,MAAM,cAAc;AASpB,SAAgB,yBACd,QACkC;CAClC,OAAO,OAAO,WAAW,YAAY;AACvC;AAEA,SAAgB,wBAAwB,QAA2D;CACjG,OAAO,OAAO,WAAW,WAAW;AACtC;;AA0GA,SAAgB,sBAAsB,QAAkC;CACtE,IAAI,wBAAwB,MAAM,GAAG;EACnC,MAAM,UAAU,OAAO,MAAM,EAAkB;EAE/C,OADa,KAAK,MAAM,mBAAmB,OAAO,CACxC,CAAC,CAAC;CACd,OAAO,IAAI,yBAAyB,MAAM,GAAG;EAC3C,MAAM,UAAU,OAAO,MAAM,EAAmB;EAEhD,OADa,KAAK,MAAM,mBAAmB,OAAO,CACxC,CAAC,CAAC;CACd;CAEA,aAAA,YAAY,MAAM;AACpB;AAEA,SAAS,gBAAgB,UAAkB;CACzC,OAAO,SAAS,QAAQ,YAAY,EAAE;AACxC;;AAGA,SAAgB,sBAAsB,QAAkC;CACtE,OAAO,gBAAgB,sBAAsB,MAAM,CAAC;AACtD"}
|
package/dist/drivers/ls.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ls.d.ts","names":[],"sources":["../../src/drivers/ls.ts"],"mappings":";;;;KAQY,sBAAA;AAAA,KACA,qBAAA;AAAA,KAEA,gBAAA,GAAmB,sBAAA,GAAyB,
|
|
1
|
+
{"version":3,"file":"ls.d.ts","names":[],"sources":["../../src/drivers/ls.ts"],"mappings":";;;;KAQY,sBAAA;AAAA,KACA,qBAAA;AAAA,KAEA,gBAAA,GAAmB,sBAAA,GAAyB,qBAAqB;AAAA,KAEjE,qBAAA,GAAwB,OAAO,CAAC,gBAAA;AAAA,iBAE5B,wBAAA,CACd,MAAA,EAAQ,gBAAA,GACP,MAAA,IAAU,sBAAsB;AAAA,iBAInB,uBAAA,CAAwB,MAAA,EAAQ,gBAAA,GAAmB,MAAA,IAAU,qBAAqB;;KAKtF,kBAAA;AAjBZ;AAAA,KAoBY,mBAAA;AAAA,KAEA,aAAA,GAAgB,kBAAA,GAAqB,mBAAmB;AAAA,KAExD,YAAA;EAxBqB,uFA0B/B,EAAA,UAxB0B;EA0B1B,IAAA;EACA,MAAA,EAAQ,aAAa;EACrB,eAAA;AAAA;AAAA,KAGU,eAAA;EACV,MAAA;EACA,OAAA,EAAS,OAAO;AAAA;AAAA,KAGN,OAAA;EAEN,IAAA;EACA,IAAA;EACA,QAAA;AAAA;EAGA,IAAA;EACA,IAAA;EACA,QAAA,UAvC6B;EA0C7B,MAAA,EAAQ,gBAAgB;AAAA;AAAA,KAGlB,gBAAA;+CAED,IAAA,UA3CqC;EAAA,SA6CrC,UAAU;AAAA;AAAA,KAGT,aAAA;EAhDsF,wCAkDvF,KAAA,WA7CC;EAAA,SA+CD,WAAA;WAEA,OAAA,GAAU,gBAAgB;AAAA;AAAA,KAGzB,sBAAA;EAjDmB;;EAAA,SAoDpB,IAAA,GAAO,qBAAqB;AAAA;AAAA,KAG3B,yBAAA;EArDa;;EAAA,SAwDd,KAAA,GAAQ,qBAAqB;AAAA;AAtDxC;AAAA,KA0DY,SAAA;6CAED,IAAA,UA1DT;EAAA,SA4DS,EAAE;AAAA;AAAA,UAGI,QAAA;EA3Df;EA6DA,cAAA,IAAkB,OAAA,CAAQ,YAAA;EAE1B,SAAA,CAAU,OAAA,EAAS,aAAA,EAAe,QAAA,WAAmB,OAAA,CAAQ,eAAA;EA5DnD;EA+DV,wBAAA,CAAyB,GAAA,EAAK,aAAA,GAAgB,OAAA,CAAQ,sBAAA;;EAGtD,2BAAA,CAA4B,GAAA,EAAK,aAAA,GAAgB,OAAA,CAAQ,yBAAA;EAjEzD;EAoEA,gBAAA,CAAiB,IAAA,EAAM,qBAAA,GAAwB,OAAA;EAnEtC;EAsET,mBAAA,CAAoB,IAAA,EAAM,qBAAA,EAAuB,KAAA,GAAQ,UAAA,GAAa,OAAA,CAAQ,UAAA;EAtE9D;AAGlB;;;;;EA2EE,kBAAA,CAAmB,IAAA,EAAM,QAAA,GAAW,OAAA,CAAQ,gBAAA;EAvExC;EA0EJ,WAAA,KAAgB,OAAA;AAAA;;iBAIF,qBAAA,CAAsB,MAAwB,EAAhB,gBAAgB;;iBAmB9C,qBAAA,CAAsB,MAAwB,EAAhB,gBAAgB"}
|
package/dist/drivers/ls.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ls.js","names":[],"sources":["../../src/drivers/ls.ts"],"sourcesContent":["import { assertNever } from \"../util\";\nimport type { Branded } from \"../branding\";\nimport type { TableRange } from \"./pframe\";\nimport type { FileLike } from \"./interfaces\";\n\nconst uploadPrefix = \"upload://upload/\";\nconst indexPrefix = \"index://index/\";\n\nexport type ImportFileHandleUpload = `upload://upload/${string}`;\nexport type ImportFileHandleIndex = `index://index/${string}`;\n\nexport type ImportFileHandle = ImportFileHandleUpload | ImportFileHandleIndex;\n\nexport type LocalImportFileHandle = Branded<ImportFileHandle, \"Local\">;\n\nexport function isImportFileHandleUpload(\n handle: ImportFileHandle,\n): handle is ImportFileHandleUpload {\n return handle.startsWith(uploadPrefix);\n}\n\nexport function isImportFileHandleIndex(handle: ImportFileHandle): handle is ImportFileHandleIndex {\n return handle.startsWith(indexPrefix);\n}\n\n/** Results in upload */\nexport type StorageHandleLocal = `local://${string}`;\n\n/** Results in index */\nexport type StorageHandleRemote = `remote://${string}`;\n\nexport type StorageHandle = StorageHandleLocal | StorageHandleRemote;\n\nexport type StorageEntry = {\n /** Stable machine identifier (e.g. \"library\", \"root\", \"local\"). Used for filtering. */\n id: string;\n /** Human-readable display name. */\n name: string;\n handle: StorageHandle;\n initialFullPath: string;\n};\n\nexport type ListFilesResult = {\n parent?: string;\n entries: LsEntry[];\n};\n\nexport type LsEntry =\n | {\n type: \"dir\";\n name: string;\n fullPath: string;\n }\n | {\n type: \"file\";\n name: string;\n fullPath: string;\n\n /** This handle should be set to args... */\n handle: ImportFileHandle;\n };\n\nexport type OpenDialogFilter = {\n /** Human-readable file type name */\n readonly name: string;\n /** File extensions */\n readonly extensions: string[];\n};\n\nexport type OpenDialogOps = {\n /** Open dialog window title */\n readonly title?: string;\n /** Custom label for the confirmation button, when left empty the default label will be used. */\n readonly buttonLabel?: string;\n /** Limits of file types user can select */\n readonly filters?: OpenDialogFilter[];\n};\n\nexport type OpenSingleFileResponse = {\n /** Contains local file handle, allowing file importing or content reading. If user canceled\n * the dialog, field will be undefined. */\n readonly file?: LocalImportFileHandle;\n};\n\nexport type OpenMultipleFilesResponse = {\n /** Contains local file handles, allowing file importing or content reading. If user canceled\n * the dialog, field will be undefined. */\n readonly files?: LocalImportFileHandle[];\n};\n\n/** Can be used to limit request for local file content to a certain bytes range */\nexport type FileRange = {\n /** From byte index (inclusive) */\n readonly from: number;\n /** To byte index (exclusive) */\n readonly to: number;\n};\n\nexport interface LsDriver {\n /** remote and local storages */\n getStorageList(): Promise<StorageEntry[]>;\n\n listFiles(storage: StorageHandle, fullPath: string): Promise<ListFilesResult>;\n\n /** Opens system file open dialog allowing to select single file and awaits user action */\n showOpenSingleFileDialog(ops: OpenDialogOps): Promise<OpenSingleFileResponse>;\n\n /** Opens system file open dialog allowing to multiple files and awaits user action */\n showOpenMultipleFilesDialog(ops: OpenDialogOps): Promise<OpenMultipleFilesResponse>;\n\n /** Given a handle to a local file, allows to get file size */\n getLocalFileSize(file: LocalImportFileHandle): Promise<number>;\n\n /** Given a handle to a local file, allows to get its content */\n getLocalFileContent(file: LocalImportFileHandle, range?: TableRange): Promise<Uint8Array>;\n\n /**\n * Resolves browser's File object into platforma's import file handle.\n *\n * This method is useful among other things for implementation of UI\n * components, that handle file Drag&Drop.\n * */\n fileToImportHandle(file: FileLike): Promise<ImportFileHandle>;\n\n /** Saves currently opened block webview as a PDF. */\n exportToPdf?(): Promise<void>;\n}\n\n/** Gets a file path from an import handle. */\nexport function getFilePathFromHandle(handle: ImportFileHandle): string {\n if (isImportFileHandleIndex(handle)) {\n const trimmed = handle.slice(indexPrefix.length);\n const data = JSON.parse(decodeURIComponent(trimmed)) as { path: string };\n return data.path;\n } else if (isImportFileHandleUpload(handle)) {\n const trimmed = handle.slice(uploadPrefix.length);\n const data = JSON.parse(decodeURIComponent(trimmed)) as { localPath: string };\n return data.localPath;\n }\n\n assertNever(handle);\n}\n\nfunction extractFileName(filePath: string) {\n return filePath.replace(/^.*[\\\\/]/, \"\");\n}\n\n/** Gets a file name from an import handle. */\nexport function getFileNameFromHandle(handle: ImportFileHandle): string {\n return extractFileName(getFilePathFromHandle(handle));\n}\n"],"mappings":";;AAKA,MAAM,eAAe;AACrB,MAAM,cAAc;AASpB,SAAgB,yBACd,QACkC;
|
|
1
|
+
{"version":3,"file":"ls.js","names":[],"sources":["../../src/drivers/ls.ts"],"sourcesContent":["import { assertNever } from \"../util\";\nimport type { Branded } from \"../branding\";\nimport type { TableRange } from \"./pframe\";\nimport type { FileLike } from \"./interfaces\";\n\nconst uploadPrefix = \"upload://upload/\";\nconst indexPrefix = \"index://index/\";\n\nexport type ImportFileHandleUpload = `upload://upload/${string}`;\nexport type ImportFileHandleIndex = `index://index/${string}`;\n\nexport type ImportFileHandle = ImportFileHandleUpload | ImportFileHandleIndex;\n\nexport type LocalImportFileHandle = Branded<ImportFileHandle, \"Local\">;\n\nexport function isImportFileHandleUpload(\n handle: ImportFileHandle,\n): handle is ImportFileHandleUpload {\n return handle.startsWith(uploadPrefix);\n}\n\nexport function isImportFileHandleIndex(handle: ImportFileHandle): handle is ImportFileHandleIndex {\n return handle.startsWith(indexPrefix);\n}\n\n/** Results in upload */\nexport type StorageHandleLocal = `local://${string}`;\n\n/** Results in index */\nexport type StorageHandleRemote = `remote://${string}`;\n\nexport type StorageHandle = StorageHandleLocal | StorageHandleRemote;\n\nexport type StorageEntry = {\n /** Stable machine identifier (e.g. \"library\", \"root\", \"local\"). Used for filtering. */\n id: string;\n /** Human-readable display name. */\n name: string;\n handle: StorageHandle;\n initialFullPath: string;\n};\n\nexport type ListFilesResult = {\n parent?: string;\n entries: LsEntry[];\n};\n\nexport type LsEntry =\n | {\n type: \"dir\";\n name: string;\n fullPath: string;\n }\n | {\n type: \"file\";\n name: string;\n fullPath: string;\n\n /** This handle should be set to args... */\n handle: ImportFileHandle;\n };\n\nexport type OpenDialogFilter = {\n /** Human-readable file type name */\n readonly name: string;\n /** File extensions */\n readonly extensions: string[];\n};\n\nexport type OpenDialogOps = {\n /** Open dialog window title */\n readonly title?: string;\n /** Custom label for the confirmation button, when left empty the default label will be used. */\n readonly buttonLabel?: string;\n /** Limits of file types user can select */\n readonly filters?: OpenDialogFilter[];\n};\n\nexport type OpenSingleFileResponse = {\n /** Contains local file handle, allowing file importing or content reading. If user canceled\n * the dialog, field will be undefined. */\n readonly file?: LocalImportFileHandle;\n};\n\nexport type OpenMultipleFilesResponse = {\n /** Contains local file handles, allowing file importing or content reading. If user canceled\n * the dialog, field will be undefined. */\n readonly files?: LocalImportFileHandle[];\n};\n\n/** Can be used to limit request for local file content to a certain bytes range */\nexport type FileRange = {\n /** From byte index (inclusive) */\n readonly from: number;\n /** To byte index (exclusive) */\n readonly to: number;\n};\n\nexport interface LsDriver {\n /** remote and local storages */\n getStorageList(): Promise<StorageEntry[]>;\n\n listFiles(storage: StorageHandle, fullPath: string): Promise<ListFilesResult>;\n\n /** Opens system file open dialog allowing to select single file and awaits user action */\n showOpenSingleFileDialog(ops: OpenDialogOps): Promise<OpenSingleFileResponse>;\n\n /** Opens system file open dialog allowing to multiple files and awaits user action */\n showOpenMultipleFilesDialog(ops: OpenDialogOps): Promise<OpenMultipleFilesResponse>;\n\n /** Given a handle to a local file, allows to get file size */\n getLocalFileSize(file: LocalImportFileHandle): Promise<number>;\n\n /** Given a handle to a local file, allows to get its content */\n getLocalFileContent(file: LocalImportFileHandle, range?: TableRange): Promise<Uint8Array>;\n\n /**\n * Resolves browser's File object into platforma's import file handle.\n *\n * This method is useful among other things for implementation of UI\n * components, that handle file Drag&Drop.\n * */\n fileToImportHandle(file: FileLike): Promise<ImportFileHandle>;\n\n /** Saves currently opened block webview as a PDF. */\n exportToPdf?(): Promise<void>;\n}\n\n/** Gets a file path from an import handle. */\nexport function getFilePathFromHandle(handle: ImportFileHandle): string {\n if (isImportFileHandleIndex(handle)) {\n const trimmed = handle.slice(indexPrefix.length);\n const data = JSON.parse(decodeURIComponent(trimmed)) as { path: string };\n return data.path;\n } else if (isImportFileHandleUpload(handle)) {\n const trimmed = handle.slice(uploadPrefix.length);\n const data = JSON.parse(decodeURIComponent(trimmed)) as { localPath: string };\n return data.localPath;\n }\n\n assertNever(handle);\n}\n\nfunction extractFileName(filePath: string) {\n return filePath.replace(/^.*[\\\\/]/, \"\");\n}\n\n/** Gets a file name from an import handle. */\nexport function getFileNameFromHandle(handle: ImportFileHandle): string {\n return extractFileName(getFilePathFromHandle(handle));\n}\n"],"mappings":";;AAKA,MAAM,eAAe;AACrB,MAAM,cAAc;AASpB,SAAgB,yBACd,QACkC;CAClC,OAAO,OAAO,WAAW,YAAY;AACvC;AAEA,SAAgB,wBAAwB,QAA2D;CACjG,OAAO,OAAO,WAAW,WAAW;AACtC;;AA0GA,SAAgB,sBAAsB,QAAkC;CACtE,IAAI,wBAAwB,MAAM,GAAG;EACnC,MAAM,UAAU,OAAO,MAAM,EAAkB;EAE/C,OADa,KAAK,MAAM,mBAAmB,OAAO,CACxC,CAAC,CAAC;CACd,OAAO,IAAI,yBAAyB,MAAM,GAAG;EAC3C,MAAM,UAAU,OAAO,MAAM,EAAmB;EAEhD,OADa,KAAK,MAAM,mBAAmB,OAAO,CACxC,CAAC,CAAC;CACd;CAEA,YAAY,MAAM;AACpB;AAEA,SAAS,gBAAgB,UAAkB;CACzC,OAAO,SAAS,QAAQ,YAAY,EAAE;AACxC;;AAGA,SAAgB,sBAAsB,QAAkC;CACtE,OAAO,gBAAgB,sBAAsB,MAAM,CAAC;AACtD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"data_info.cjs","names":[],"sources":["../../../src/drivers/pframe/data_info.ts"],"sourcesContent":["import { assertNever } from \"../../util\";\n\n/**\n * Represents a JavaScript representation of a value in a PColumn. Can be null, a number, or a string.\n * These are the primitive types that can be stored directly in PColumns.\n *\n * Note: Actual columns can hold more value types, which are converted to these JavaScript types\n * once they enter the JavaScript runtime.\n */\nexport type PColumnValue = null | number | string;\n\n/**\n * Represents a key for a PColumn value.\n * Can be an array of strings or numbers.\n */\nexport type PColumnKey = (number | string)[];\n\n/**\n * Represents a single entry in a PColumn's data structure.\n * Contains a key and a value.\n */\nexport type PColumnDataEntry<T> = {\n /** Key for the value */\n key: PColumnKey;\n\n /** Value / blob at the given key */\n value: T;\n};\n\n/**\n * Represents column data stored as a simple JSON structure.\n * Used for small datasets that can be efficiently stored directly in memory.\n */\nexport type JsonDataInfo = {\n /** Identifier for this data format ('Json') */\n type: \"Json\";\n\n /** Number of axes that make up the complete key (tuple length) */\n keyLength: number;\n\n /**\n * Key-value pairs where keys are stringified tuples of axis values\n * and values are the column values for those coordinates\n */\n data: Record<string, PColumnValue>;\n};\n\n/**\n * Represents column data partitioned across multiple JSON blobs.\n * Used for larger datasets that need to be split into manageable chunks.\n */\nexport type JsonPartitionedDataInfo<Blob> = {\n /** Identifier for this data format ('JsonPartitioned') */\n type: \"JsonPartitioned\";\n\n /** Number of leading axes used for partitioning */\n partitionKeyLength: number;\n\n /** Map of stringified partition keys to blob references */\n parts: Record<string, Blob>;\n};\n\n/**\n * Represents a binary format chunk containing index and values as separate blobs.\n * Used for efficient storage and retrieval of column data in binary format.\n */\nexport type BinaryChunk<Blob> = {\n /** Binary blob containing structured index information */\n index: Blob;\n\n /** Binary blob containing the actual values */\n values: Blob;\n};\n\n/**\n * Represents column data partitioned across multiple binary chunks.\n * Optimized for efficient storage and retrieval of large datasets.\n */\nexport type BinaryPartitionedDataInfo<Blob> = {\n /** Identifier for this data format ('BinaryPartitioned') */\n type: \"BinaryPartitioned\";\n\n /** Number of leading axes used for partitioning */\n partitionKeyLength: number;\n\n /** Map of stringified partition keys to binary chunks */\n parts: Record<string, BinaryChunk<Blob>>;\n};\n\nexport type ParquetChunkMappingAxis = {\n /** Data type (matches PColumn axis types) */\n type: \"Int\" | \"Long\" | \"String\";\n\n /** Field name in the Parquet file */\n id: string;\n};\n\nexport type ParquetChunkMappingColumn = {\n /** Data type (matches PColumn value type) */\n type: \"Int\" | \"Long\" | \"Float\" | \"Double\" | \"String\";\n\n /** Field name in the Parquet file */\n id: string;\n};\n\nexport type ParquetChunkMapping = {\n /** Axes mappings - Parquet file is sorted by these fields in this order */\n axes: ParquetChunkMappingAxis[];\n\n /** Column mapping */\n column: ParquetChunkMappingColumn;\n};\n\nexport type ParquetChunkStats = {\n /** Number of rows in the chunk */\n numberOfRows: number;\n /** Byte size information for storage optimization and query planning */\n size: {\n /** Byte sizes for each axis column in the same order as axes mapping */\n axes: number[];\n /** Byte size for the data column */\n column: number;\n };\n};\n\nexport type ParquetChunkMetadata = {\n /** Content hash calculated for the specific axes and data this chunk represents */\n dataDigest: string;\n\n /** Pre-computed statistics for optimization without blob download */\n stats: Partial<ParquetChunkStats>;\n};\n\nexport type ParquetChunk<Blob> = {\n /** Parquet file (PTable) containing column data */\n data: Blob;\n} & ParquetChunkMapping &\n Partial<ParquetChunkMetadata>;\n\nexport type ParquetPartitionedDataInfo<Blob> = {\n /** Identifier for this data format ('ParquetPartitioned') */\n type: \"ParquetPartitioned\";\n\n /** Number of leading axes used for partitioning */\n partitionKeyLength: number;\n\n /** Map of stringified partition keys to parquet files */\n parts: Record<string, Blob>;\n};\n\n/**\n * Union type representing all possible data storage formats for PColumn data.\n * The specific format used depends on data size, access patterns, and performance requirements.\n *\n * @template Blob - Type parameter representing the storage reference type (could be ResourceInfo, PFrameBlobId, etc.)\n */\nexport type DataInfo<Blob> =\n | JsonDataInfo\n | JsonPartitionedDataInfo<Blob>\n | BinaryPartitionedDataInfo<Blob>\n | ParquetPartitionedDataInfo<Blob>;\n\n/**\n * Type guard function that checks if the given value is a valid DataInfo.\n *\n * @param value - The value to check\n * @returns True if the value is a valid DataInfo, false otherwise\n */\nexport function isDataInfo<Blob>(value: unknown): value is DataInfo<Blob> {\n if (!value || typeof value !== \"object\") {\n return false;\n }\n\n const data = value as Record<string, unknown>;\n if (!(\"type\" in data)) {\n return false;\n }\n\n switch (data.type) {\n case \"Json\":\n return (\n typeof data.keyLength === \"number\" &&\n data.data !== undefined &&\n typeof data.data === \"object\"\n );\n case \"JsonPartitioned\":\n case \"BinaryPartitioned\":\n case \"ParquetPartitioned\":\n return (\n typeof data.partitionKeyLength === \"number\" &&\n data.parts !== undefined &&\n typeof data.parts === \"object\"\n );\n default:\n return false;\n }\n}\n\n/**\n * Maps blob references in a DataInfo object from one type to another using a mapping function.\n *\n * @template B1 - Source blob type\n * @template B2 - Target blob type\n * @param dataInfo - The source DataInfo object\n * @param mapFn - Function to transform blobs from type B1 to type B2\n * @returns A new DataInfo object with transformed blob references\n */\nexport function mapDataInfo<B1, B2>(\n dataInfo: ParquetPartitionedDataInfo<B1>,\n mapFn: (blob: B1) => B2,\n): ParquetPartitionedDataInfo<B2>;\nexport function mapDataInfo<B1, B2>(\n dataInfo: Exclude<DataInfo<B1>, ParquetPartitionedDataInfo<B1>>,\n mapFn: (blob: B1) => B2,\n): Exclude<DataInfo<B2>, ParquetPartitionedDataInfo<B2>>;\nexport function mapDataInfo<B1, B2>(dataInfo: DataInfo<B1>, mapFn: (blob: B1) => B2): DataInfo<B2>;\nexport function mapDataInfo<B1, B2>(\n dataInfo: DataInfo<B1> | undefined,\n mapFn: (blob: B1) => B2,\n): DataInfo<B2> | undefined {\n if (dataInfo === undefined) {\n return undefined;\n }\n\n switch (dataInfo.type) {\n case \"Json\":\n // Json type doesn't contain blobs, so return as is\n return dataInfo;\n case \"JsonPartitioned\": {\n // Map each blob in parts\n const newParts: Record<string, B2> = {};\n for (const [key, blob] of Object.entries(dataInfo.parts)) {\n newParts[key] = mapFn(blob);\n }\n return {\n ...dataInfo,\n parts: newParts,\n };\n }\n case \"BinaryPartitioned\": {\n // Map each index and values blob in parts\n const newParts: Record<string, BinaryChunk<B2>> = {};\n for (const [key, chunk] of Object.entries(dataInfo.parts)) {\n newParts[key] = {\n index: mapFn(chunk.index),\n values: mapFn(chunk.values),\n };\n }\n return {\n ...dataInfo,\n parts: newParts,\n };\n }\n case \"ParquetPartitioned\": {\n // Map each blob in parts\n const newParts: Record<string, B2> = {};\n for (const [key, blob] of Object.entries(dataInfo.parts)) {\n newParts[key] = mapFn(blob);\n }\n return {\n ...dataInfo,\n parts: newParts,\n };\n }\n }\n}\n\n/**\n * @param dataInfo - The source DataInfo object\n * @param cb - Callback, function that have access to every blob to visit them all\n * @returns Nothing\n */\nexport function visitDataInfo<B>(dataInfo: DataInfo<B>, cb: (blob: B) => void): void {\n switch (dataInfo.type) {\n case \"Json\":\n // Json type doesn't contain blobs, so return as is\n break;\n case \"JsonPartitioned\": {\n // Visit each blob in parts\n Object.values(dataInfo.parts).forEach(cb);\n break;\n }\n case \"BinaryPartitioned\": {\n // Visit each index and values blob in parts\n Object.values(dataInfo.parts).forEach((chunk) => {\n cb(chunk.index);\n cb(chunk.values);\n });\n break;\n }\n case \"ParquetPartitioned\": {\n // Visit each blob in parts\n Object.values(dataInfo.parts).forEach(cb);\n break;\n }\n }\n}\n\n//\n// Lightway representation for ExplicitJsonData\n//\n\n/**\n * Represents a single key-value entry in a column's explicit data structure.\n * Used when directly instantiating PColumns with explicit data.\n */\nexport type PColumnValuesEntry = {\n key: PColumnKey;\n val: PColumnValue;\n};\n\n/**\n * Array of key-value entries representing explicit column data.\n * Used for lightweight explicit instantiation of PColumns.\n */\nexport type PColumnValues = PColumnValuesEntry[];\n\n/**\n * Entry-based representation of JsonDataInfo\n */\nexport interface JsonDataInfoEntries {\n type: \"Json\";\n keyLength: number;\n data: PColumnDataEntry<PColumnValue>[];\n}\n\n/**\n * Entry-based representation of JsonPartitionedDataInfo\n */\nexport interface JsonPartitionedDataInfoEntries<Blob> {\n type: \"JsonPartitioned\";\n partitionKeyLength: number;\n parts: PColumnDataEntry<Blob>[];\n}\n\n/**\n * Entry-based representation of BinaryPartitionedDataInfo\n */\nexport interface BinaryPartitionedDataInfoEntries<Blob> {\n type: \"BinaryPartitioned\";\n partitionKeyLength: number;\n parts: PColumnDataEntry<BinaryChunk<Blob>>[];\n}\n\n/**\n * Entry-based representation of ParquetPartitionedDataInfo\n */\nexport interface ParquetPartitionedDataInfoEntries<Blob> {\n type: \"ParquetPartitioned\";\n partitionKeyLength: number;\n parts: PColumnDataEntry<Blob>[];\n}\n/**\n * Union type representing all possible entry-based partitioned data storage formats\n */\nexport type PartitionedDataInfoEntries<Blob> =\n | JsonPartitionedDataInfoEntries<Blob>\n | BinaryPartitionedDataInfoEntries<Blob>\n | ParquetPartitionedDataInfoEntries<Blob>;\n\n/**\n * Union type representing all possible entry-based data storage formats\n */\nexport type DataInfoEntries<Blob> = JsonDataInfoEntries | PartitionedDataInfoEntries<Blob>;\n\n/**\n * Type guard function that checks if the given value is a valid DataInfoEntries.\n *\n * @param value - The value to check\n * @returns True if the value is a valid DataInfoEntries, false otherwise\n */\nexport function isDataInfoEntries<Blob>(value: unknown): value is DataInfoEntries<Blob> {\n if (!value || typeof value !== \"object\") {\n return false;\n }\n\n const data = value as Record<string, unknown>;\n if (!(\"type\" in data)) {\n return false;\n }\n\n switch (data.type) {\n case \"Json\":\n return typeof data.keyLength === \"number\" && Array.isArray(data.data);\n case \"JsonPartitioned\":\n case \"BinaryPartitioned\":\n case \"ParquetPartitioned\":\n return typeof data.partitionKeyLength === \"number\" && Array.isArray(data.parts);\n default:\n return false;\n }\n}\n\n/**\n * Type guard function that checks if the given value is a valid PartitionedDataInfoEntries.\n *\n * @template Blob - Type parameter representing the storage reference type\n * @param value - The value to check\n * @returns True if the value is a valid PartitionedDataInfoEntries, false otherwise\n */\nexport function isPartitionedDataInfoEntries<Blob>(\n value: unknown,\n): value is PartitionedDataInfoEntries<Blob> {\n if (!isDataInfoEntries(value)) return false;\n switch (value.type) {\n case \"JsonPartitioned\":\n case \"BinaryPartitioned\":\n case \"ParquetPartitioned\":\n return true;\n default:\n return false;\n }\n}\n\n/**\n * Converts DataInfo to DataInfoEntries\n *\n * @param dataInfo - The record-based DataInfo object\n * @returns The equivalent entry-based DataInfoEntries object\n */\nexport function dataInfoToEntries<Blob>(dataInfo: DataInfo<Blob>): DataInfoEntries<Blob> {\n switch (dataInfo.type) {\n case \"Json\":\n return {\n type: \"Json\",\n keyLength: dataInfo.keyLength,\n data: Object.entries(dataInfo.data).map(([keyStr, value]) => {\n const key = JSON.parse(keyStr) as PColumnKey;\n return { key, value } as PColumnDataEntry<PColumnValue>;\n }),\n };\n case \"JsonPartitioned\":\n return {\n type: \"JsonPartitioned\",\n partitionKeyLength: dataInfo.partitionKeyLength,\n parts: Object.entries(dataInfo.parts).map(([keyStr, blob]) => {\n const key = JSON.parse(keyStr) as PColumnKey;\n return { key, value: blob } as PColumnDataEntry<Blob>;\n }),\n };\n case \"BinaryPartitioned\":\n return {\n type: \"BinaryPartitioned\",\n partitionKeyLength: dataInfo.partitionKeyLength,\n parts: Object.entries(dataInfo.parts).map(([keyStr, chunk]) => {\n const key = JSON.parse(keyStr) as PColumnKey;\n return { key, value: chunk } as PColumnDataEntry<BinaryChunk<Blob>>;\n }),\n };\n case \"ParquetPartitioned\":\n return {\n type: \"ParquetPartitioned\",\n partitionKeyLength: dataInfo.partitionKeyLength,\n parts: Object.entries(dataInfo.parts).map(([keyStr, blob]) => {\n const key = JSON.parse(keyStr) as PColumnKey;\n return { key, value: blob } as PColumnDataEntry<Blob>;\n }),\n };\n default:\n assertNever(dataInfo);\n }\n}\n\n/**\n * Converts DataInfoEntries to DataInfo\n *\n * @param dataInfoEntries - The entry-based DataInfoEntries object\n * @returns The equivalent record-based DataInfo object\n */\nexport function entriesToDataInfo<Blob>(dataInfoEntries: DataInfoEntries<Blob>): DataInfo<Blob> {\n switch (dataInfoEntries.type) {\n case \"Json\":\n return {\n type: \"Json\",\n keyLength: dataInfoEntries.keyLength,\n data: Object.fromEntries(\n dataInfoEntries.data.map(({ key, value }) => [JSON.stringify(key), value]),\n ),\n };\n case \"JsonPartitioned\":\n return {\n type: \"JsonPartitioned\",\n partitionKeyLength: dataInfoEntries.partitionKeyLength,\n parts: Object.fromEntries(\n dataInfoEntries.parts.map(({ key, value }) => [JSON.stringify(key), value]),\n ),\n };\n case \"BinaryPartitioned\":\n return {\n type: \"BinaryPartitioned\",\n partitionKeyLength: dataInfoEntries.partitionKeyLength,\n parts: Object.fromEntries(\n dataInfoEntries.parts.map(({ key, value }) => [JSON.stringify(key), value]),\n ),\n };\n case \"ParquetPartitioned\":\n return {\n type: \"ParquetPartitioned\",\n partitionKeyLength: dataInfoEntries.partitionKeyLength,\n parts: Object.fromEntries(\n dataInfoEntries.parts.map(({ key, value }) => [JSON.stringify(key), value]),\n ),\n };\n default:\n assertNever(dataInfoEntries);\n }\n}\n\n/**\n * Maps blob references in a DataInfoEntries object from one type to another using a mapping function.\n *\n * @template B1 - Source blob type\n * @template B2 - Target blob type\n * @param dataInfoEntries - The source DataInfoEntries object\n * @param mapFn - Function to transform blobs from type B1 to type B2\n * @returns A new DataInfoEntries object with transformed blob references\n */\nexport function mapDataInfoEntries<B1, B2>(\n dataInfoEntries: DataInfoEntries<B1>,\n mapFn: (blob: B1) => B2,\n): DataInfoEntries<B2>;\nexport function mapDataInfoEntries<B1, B2>(\n dataInfoEntries: DataInfoEntries<B1> | undefined,\n mapFn: (blob: B1) => B2,\n): DataInfoEntries<B2> | undefined {\n if (dataInfoEntries === undefined) {\n return undefined;\n }\n\n switch (dataInfoEntries.type) {\n case \"Json\":\n // Json type doesn't contain blobs, so return as is\n return dataInfoEntries;\n case \"JsonPartitioned\":\n return {\n ...dataInfoEntries,\n parts: dataInfoEntries.parts.map((entry) => ({\n key: entry.key,\n value: mapFn(entry.value),\n })),\n };\n case \"BinaryPartitioned\":\n return {\n ...dataInfoEntries,\n parts: dataInfoEntries.parts.map((entry) => ({\n key: entry.key,\n value: {\n index: mapFn(entry.value.index),\n values: mapFn(entry.value.values),\n },\n })),\n };\n case \"ParquetPartitioned\":\n return {\n ...dataInfoEntries,\n parts: dataInfoEntries.parts.map((entry) => ({\n key: entry.key,\n value: mapFn(entry.value),\n })),\n };\n }\n}\n"],"mappings":";;;;;;;;AAwKA,SAAgB,WAAiB,OAAyC;AACxE,KAAI,CAAC,SAAS,OAAO,UAAU,SAC7B,QAAO;CAGT,MAAM,OAAO;AACb,KAAI,EAAE,UAAU,MACd,QAAO;AAGT,SAAQ,KAAK,MAAb;EACE,KAAK,OACH,QACE,OAAO,KAAK,cAAc,YAC1B,KAAK,SAAS,KAAA,KACd,OAAO,KAAK,SAAS;EAEzB,KAAK;EACL,KAAK;EACL,KAAK,qBACH,QACE,OAAO,KAAK,uBAAuB,YACnC,KAAK,UAAU,KAAA,KACf,OAAO,KAAK,UAAU;EAE1B,QACE,QAAO;;;AAsBb,SAAgB,YACd,UACA,OAC0B;AAC1B,KAAI,aAAa,KAAA,EACf;AAG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,MAAM,MAAM,MAAM;IAC1B,EAAE;GACJ"}
|
|
1
|
+
{"version":3,"file":"data_info.cjs","names":[],"sources":["../../../src/drivers/pframe/data_info.ts"],"sourcesContent":["import { assertNever } from \"../../util\";\n\n/**\n * Represents a JavaScript representation of a value in a PColumn. Can be null, a number, or a string.\n * These are the primitive types that can be stored directly in PColumns.\n *\n * Note: Actual columns can hold more value types, which are converted to these JavaScript types\n * once they enter the JavaScript runtime.\n */\nexport type PColumnValue = null | number | string;\n\n/**\n * Represents a key for a PColumn value.\n * Can be an array of strings or numbers.\n */\nexport type PColumnKey = (number | string)[];\n\n/**\n * Represents a single entry in a PColumn's data structure.\n * Contains a key and a value.\n */\nexport type PColumnDataEntry<T> = {\n /** Key for the value */\n key: PColumnKey;\n\n /** Value / blob at the given key */\n value: T;\n};\n\n/**\n * Represents column data stored as a simple JSON structure.\n * Used for small datasets that can be efficiently stored directly in memory.\n */\nexport type JsonDataInfo = {\n /** Identifier for this data format ('Json') */\n type: \"Json\";\n\n /** Number of axes that make up the complete key (tuple length) */\n keyLength: number;\n\n /**\n * Key-value pairs where keys are stringified tuples of axis values\n * and values are the column values for those coordinates\n */\n data: Record<string, PColumnValue>;\n};\n\n/**\n * Represents column data partitioned across multiple JSON blobs.\n * Used for larger datasets that need to be split into manageable chunks.\n */\nexport type JsonPartitionedDataInfo<Blob> = {\n /** Identifier for this data format ('JsonPartitioned') */\n type: \"JsonPartitioned\";\n\n /** Number of leading axes used for partitioning */\n partitionKeyLength: number;\n\n /** Map of stringified partition keys to blob references */\n parts: Record<string, Blob>;\n};\n\n/**\n * Represents a binary format chunk containing index and values as separate blobs.\n * Used for efficient storage and retrieval of column data in binary format.\n */\nexport type BinaryChunk<Blob> = {\n /** Binary blob containing structured index information */\n index: Blob;\n\n /** Binary blob containing the actual values */\n values: Blob;\n};\n\n/**\n * Represents column data partitioned across multiple binary chunks.\n * Optimized for efficient storage and retrieval of large datasets.\n */\nexport type BinaryPartitionedDataInfo<Blob> = {\n /** Identifier for this data format ('BinaryPartitioned') */\n type: \"BinaryPartitioned\";\n\n /** Number of leading axes used for partitioning */\n partitionKeyLength: number;\n\n /** Map of stringified partition keys to binary chunks */\n parts: Record<string, BinaryChunk<Blob>>;\n};\n\nexport type ParquetChunkMappingAxis = {\n /** Data type (matches PColumn axis types) */\n type: \"Int\" | \"Long\" | \"String\";\n\n /** Field name in the Parquet file */\n id: string;\n};\n\nexport type ParquetChunkMappingColumn = {\n /** Data type (matches PColumn value type) */\n type: \"Int\" | \"Long\" | \"Float\" | \"Double\" | \"String\";\n\n /** Field name in the Parquet file */\n id: string;\n};\n\nexport type ParquetChunkMapping = {\n /** Axes mappings - Parquet file is sorted by these fields in this order */\n axes: ParquetChunkMappingAxis[];\n\n /** Column mapping */\n column: ParquetChunkMappingColumn;\n};\n\nexport type ParquetChunkStats = {\n /** Number of rows in the chunk */\n numberOfRows: number;\n /** Byte size information for storage optimization and query planning */\n size: {\n /** Byte sizes for each axis column in the same order as axes mapping */\n axes: number[];\n /** Byte size for the data column */\n column: number;\n };\n};\n\nexport type ParquetChunkMetadata = {\n /** Content hash calculated for the specific axes and data this chunk represents */\n dataDigest: string;\n\n /** Pre-computed statistics for optimization without blob download */\n stats: Partial<ParquetChunkStats>;\n};\n\nexport type ParquetChunk<Blob> = {\n /** Parquet file (PTable) containing column data */\n data: Blob;\n} & ParquetChunkMapping &\n Partial<ParquetChunkMetadata>;\n\nexport type ParquetPartitionedDataInfo<Blob> = {\n /** Identifier for this data format ('ParquetPartitioned') */\n type: \"ParquetPartitioned\";\n\n /** Number of leading axes used for partitioning */\n partitionKeyLength: number;\n\n /** Map of stringified partition keys to parquet files */\n parts: Record<string, Blob>;\n};\n\n/**\n * Union type representing all possible data storage formats for PColumn data.\n * The specific format used depends on data size, access patterns, and performance requirements.\n *\n * @template Blob - Type parameter representing the storage reference type (could be ResourceInfo, PFrameBlobId, etc.)\n */\nexport type DataInfo<Blob> =\n | JsonDataInfo\n | JsonPartitionedDataInfo<Blob>\n | BinaryPartitionedDataInfo<Blob>\n | ParquetPartitionedDataInfo<Blob>;\n\n/**\n * Type guard function that checks if the given value is a valid DataInfo.\n *\n * @param value - The value to check\n * @returns True if the value is a valid DataInfo, false otherwise\n */\nexport function isDataInfo<Blob>(value: unknown): value is DataInfo<Blob> {\n if (!value || typeof value !== \"object\") {\n return false;\n }\n\n const data = value as Record<string, unknown>;\n if (!(\"type\" in data)) {\n return false;\n }\n\n switch (data.type) {\n case \"Json\":\n return (\n typeof data.keyLength === \"number\" &&\n data.data !== undefined &&\n typeof data.data === \"object\"\n );\n case \"JsonPartitioned\":\n case \"BinaryPartitioned\":\n case \"ParquetPartitioned\":\n return (\n typeof data.partitionKeyLength === \"number\" &&\n data.parts !== undefined &&\n typeof data.parts === \"object\"\n );\n default:\n return false;\n }\n}\n\n/**\n * Maps blob references in a DataInfo object from one type to another using a mapping function.\n *\n * @template B1 - Source blob type\n * @template B2 - Target blob type\n * @param dataInfo - The source DataInfo object\n * @param mapFn - Function to transform blobs from type B1 to type B2\n * @returns A new DataInfo object with transformed blob references\n */\nexport function mapDataInfo<B1, B2>(\n dataInfo: ParquetPartitionedDataInfo<B1>,\n mapFn: (blob: B1) => B2,\n): ParquetPartitionedDataInfo<B2>;\nexport function mapDataInfo<B1, B2>(\n dataInfo: Exclude<DataInfo<B1>, ParquetPartitionedDataInfo<B1>>,\n mapFn: (blob: B1) => B2,\n): Exclude<DataInfo<B2>, ParquetPartitionedDataInfo<B2>>;\nexport function mapDataInfo<B1, B2>(dataInfo: DataInfo<B1>, mapFn: (blob: B1) => B2): DataInfo<B2>;\nexport function mapDataInfo<B1, B2>(\n dataInfo: DataInfo<B1> | undefined,\n mapFn: (blob: B1) => B2,\n): DataInfo<B2> | undefined {\n if (dataInfo === undefined) {\n return undefined;\n }\n\n switch (dataInfo.type) {\n case \"Json\":\n // Json type doesn't contain blobs, so return as is\n return dataInfo;\n case \"JsonPartitioned\": {\n // Map each blob in parts\n const newParts: Record<string, B2> = {};\n for (const [key, blob] of Object.entries(dataInfo.parts)) {\n newParts[key] = mapFn(blob);\n }\n return {\n ...dataInfo,\n parts: newParts,\n };\n }\n case \"BinaryPartitioned\": {\n // Map each index and values blob in parts\n const newParts: Record<string, BinaryChunk<B2>> = {};\n for (const [key, chunk] of Object.entries(dataInfo.parts)) {\n newParts[key] = {\n index: mapFn(chunk.index),\n values: mapFn(chunk.values),\n };\n }\n return {\n ...dataInfo,\n parts: newParts,\n };\n }\n case \"ParquetPartitioned\": {\n // Map each blob in parts\n const newParts: Record<string, B2> = {};\n for (const [key, blob] of Object.entries(dataInfo.parts)) {\n newParts[key] = mapFn(blob);\n }\n return {\n ...dataInfo,\n parts: newParts,\n };\n }\n }\n}\n\n/**\n * @param dataInfo - The source DataInfo object\n * @param cb - Callback, function that have access to every blob to visit them all\n * @returns Nothing\n */\nexport function visitDataInfo<B>(dataInfo: DataInfo<B>, cb: (blob: B) => void): void {\n switch (dataInfo.type) {\n case \"Json\":\n // Json type doesn't contain blobs, so return as is\n break;\n case \"JsonPartitioned\": {\n // Visit each blob in parts\n Object.values(dataInfo.parts).forEach(cb);\n break;\n }\n case \"BinaryPartitioned\": {\n // Visit each index and values blob in parts\n Object.values(dataInfo.parts).forEach((chunk) => {\n cb(chunk.index);\n cb(chunk.values);\n });\n break;\n }\n case \"ParquetPartitioned\": {\n // Visit each blob in parts\n Object.values(dataInfo.parts).forEach(cb);\n break;\n }\n }\n}\n\n//\n// Lightway representation for ExplicitJsonData\n//\n\n/**\n * Represents a single key-value entry in a column's explicit data structure.\n * Used when directly instantiating PColumns with explicit data.\n */\nexport type PColumnValuesEntry = {\n key: PColumnKey;\n val: PColumnValue;\n};\n\n/**\n * Array of key-value entries representing explicit column data.\n * Used for lightweight explicit instantiation of PColumns.\n */\nexport type PColumnValues = PColumnValuesEntry[];\n\n/**\n * Entry-based representation of JsonDataInfo\n */\nexport interface JsonDataInfoEntries {\n type: \"Json\";\n keyLength: number;\n data: PColumnDataEntry<PColumnValue>[];\n}\n\n/**\n * Entry-based representation of JsonPartitionedDataInfo\n */\nexport interface JsonPartitionedDataInfoEntries<Blob> {\n type: \"JsonPartitioned\";\n partitionKeyLength: number;\n parts: PColumnDataEntry<Blob>[];\n}\n\n/**\n * Entry-based representation of BinaryPartitionedDataInfo\n */\nexport interface BinaryPartitionedDataInfoEntries<Blob> {\n type: \"BinaryPartitioned\";\n partitionKeyLength: number;\n parts: PColumnDataEntry<BinaryChunk<Blob>>[];\n}\n\n/**\n * Entry-based representation of ParquetPartitionedDataInfo\n */\nexport interface ParquetPartitionedDataInfoEntries<Blob> {\n type: \"ParquetPartitioned\";\n partitionKeyLength: number;\n parts: PColumnDataEntry<Blob>[];\n}\n/**\n * Union type representing all possible entry-based partitioned data storage formats\n */\nexport type PartitionedDataInfoEntries<Blob> =\n | JsonPartitionedDataInfoEntries<Blob>\n | BinaryPartitionedDataInfoEntries<Blob>\n | ParquetPartitionedDataInfoEntries<Blob>;\n\n/**\n * Union type representing all possible entry-based data storage formats\n */\nexport type DataInfoEntries<Blob> = JsonDataInfoEntries | PartitionedDataInfoEntries<Blob>;\n\n/**\n * Type guard function that checks if the given value is a valid DataInfoEntries.\n *\n * @param value - The value to check\n * @returns True if the value is a valid DataInfoEntries, false otherwise\n */\nexport function isDataInfoEntries<Blob>(value: unknown): value is DataInfoEntries<Blob> {\n if (!value || typeof value !== \"object\") {\n return false;\n }\n\n const data = value as Record<string, unknown>;\n if (!(\"type\" in data)) {\n return false;\n }\n\n switch (data.type) {\n case \"Json\":\n return typeof data.keyLength === \"number\" && Array.isArray(data.data);\n case \"JsonPartitioned\":\n case \"BinaryPartitioned\":\n case \"ParquetPartitioned\":\n return typeof data.partitionKeyLength === \"number\" && Array.isArray(data.parts);\n default:\n return false;\n }\n}\n\n/**\n * Type guard function that checks if the given value is a valid PartitionedDataInfoEntries.\n *\n * @template Blob - Type parameter representing the storage reference type\n * @param value - The value to check\n * @returns True if the value is a valid PartitionedDataInfoEntries, false otherwise\n */\nexport function isPartitionedDataInfoEntries<Blob>(\n value: unknown,\n): value is PartitionedDataInfoEntries<Blob> {\n if (!isDataInfoEntries(value)) return false;\n switch (value.type) {\n case \"JsonPartitioned\":\n case \"BinaryPartitioned\":\n case \"ParquetPartitioned\":\n return true;\n default:\n return false;\n }\n}\n\n/**\n * Converts DataInfo to DataInfoEntries\n *\n * @param dataInfo - The record-based DataInfo object\n * @returns The equivalent entry-based DataInfoEntries object\n */\nexport function dataInfoToEntries<Blob>(dataInfo: DataInfo<Blob>): DataInfoEntries<Blob> {\n switch (dataInfo.type) {\n case \"Json\":\n return {\n type: \"Json\",\n keyLength: dataInfo.keyLength,\n data: Object.entries(dataInfo.data).map(([keyStr, value]) => {\n const key = JSON.parse(keyStr) as PColumnKey;\n return { key, value } as PColumnDataEntry<PColumnValue>;\n }),\n };\n case \"JsonPartitioned\":\n return {\n type: \"JsonPartitioned\",\n partitionKeyLength: dataInfo.partitionKeyLength,\n parts: Object.entries(dataInfo.parts).map(([keyStr, blob]) => {\n const key = JSON.parse(keyStr) as PColumnKey;\n return { key, value: blob } as PColumnDataEntry<Blob>;\n }),\n };\n case \"BinaryPartitioned\":\n return {\n type: \"BinaryPartitioned\",\n partitionKeyLength: dataInfo.partitionKeyLength,\n parts: Object.entries(dataInfo.parts).map(([keyStr, chunk]) => {\n const key = JSON.parse(keyStr) as PColumnKey;\n return { key, value: chunk } as PColumnDataEntry<BinaryChunk<Blob>>;\n }),\n };\n case \"ParquetPartitioned\":\n return {\n type: \"ParquetPartitioned\",\n partitionKeyLength: dataInfo.partitionKeyLength,\n parts: Object.entries(dataInfo.parts).map(([keyStr, blob]) => {\n const key = JSON.parse(keyStr) as PColumnKey;\n return { key, value: blob } as PColumnDataEntry<Blob>;\n }),\n };\n default:\n assertNever(dataInfo);\n }\n}\n\n/**\n * Converts DataInfoEntries to DataInfo\n *\n * @param dataInfoEntries - The entry-based DataInfoEntries object\n * @returns The equivalent record-based DataInfo object\n */\nexport function entriesToDataInfo<Blob>(dataInfoEntries: DataInfoEntries<Blob>): DataInfo<Blob> {\n switch (dataInfoEntries.type) {\n case \"Json\":\n return {\n type: \"Json\",\n keyLength: dataInfoEntries.keyLength,\n data: Object.fromEntries(\n dataInfoEntries.data.map(({ key, value }) => [JSON.stringify(key), value]),\n ),\n };\n case \"JsonPartitioned\":\n return {\n type: \"JsonPartitioned\",\n partitionKeyLength: dataInfoEntries.partitionKeyLength,\n parts: Object.fromEntries(\n dataInfoEntries.parts.map(({ key, value }) => [JSON.stringify(key), value]),\n ),\n };\n case \"BinaryPartitioned\":\n return {\n type: \"BinaryPartitioned\",\n partitionKeyLength: dataInfoEntries.partitionKeyLength,\n parts: Object.fromEntries(\n dataInfoEntries.parts.map(({ key, value }) => [JSON.stringify(key), value]),\n ),\n };\n case \"ParquetPartitioned\":\n return {\n type: \"ParquetPartitioned\",\n partitionKeyLength: dataInfoEntries.partitionKeyLength,\n parts: Object.fromEntries(\n dataInfoEntries.parts.map(({ key, value }) => [JSON.stringify(key), value]),\n ),\n };\n default:\n assertNever(dataInfoEntries);\n }\n}\n\n/**\n * Maps blob references in a DataInfoEntries object from one type to another using a mapping function.\n *\n * @template B1 - Source blob type\n * @template B2 - Target blob type\n * @param dataInfoEntries - The source DataInfoEntries object\n * @param mapFn - Function to transform blobs from type B1 to type B2\n * @returns A new DataInfoEntries object with transformed blob references\n */\nexport function mapDataInfoEntries<B1, B2>(\n dataInfoEntries: DataInfoEntries<B1>,\n mapFn: (blob: B1) => B2,\n): DataInfoEntries<B2>;\nexport function mapDataInfoEntries<B1, B2>(\n dataInfoEntries: DataInfoEntries<B1> | undefined,\n mapFn: (blob: B1) => B2,\n): DataInfoEntries<B2> | undefined {\n if (dataInfoEntries === undefined) {\n return undefined;\n }\n\n switch (dataInfoEntries.type) {\n case \"Json\":\n // Json type doesn't contain blobs, so return as is\n return dataInfoEntries;\n case \"JsonPartitioned\":\n return {\n ...dataInfoEntries,\n parts: dataInfoEntries.parts.map((entry) => ({\n key: entry.key,\n value: mapFn(entry.value),\n })),\n };\n case \"BinaryPartitioned\":\n return {\n ...dataInfoEntries,\n parts: dataInfoEntries.parts.map((entry) => ({\n key: entry.key,\n value: {\n index: mapFn(entry.value.index),\n values: mapFn(entry.value.values),\n },\n })),\n };\n case \"ParquetPartitioned\":\n return {\n ...dataInfoEntries,\n parts: dataInfoEntries.parts.map((entry) => ({\n key: entry.key,\n value: mapFn(entry.value),\n })),\n };\n }\n}\n"],"mappings":";;;;;;;;AAwKA,SAAgB,WAAiB,OAAyC;CACxE,IAAI,CAAC,SAAS,OAAO,UAAU,UAC7B,OAAO;CAGT,MAAM,OAAO;CACb,IAAI,EAAE,UAAU,OACd,OAAO;CAGT,QAAQ,KAAK,MAAb;EACE,KAAK,QACH,OACE,OAAO,KAAK,cAAc,YAC1B,KAAK,SAAS,KAAA,KACd,OAAO,KAAK,SAAS;EAEzB,KAAK;EACL,KAAK;EACL,KAAK,sBACH,OACE,OAAO,KAAK,uBAAuB,YACnC,KAAK,UAAU,KAAA,KACf,OAAO,KAAK,UAAU;EAE1B,SACE,OAAO;CACX;AACF;AAoBA,SAAgB,YACd,UACA,OAC0B;CAC1B,IAAI,aAAa,KAAA,GACf;CAGF,QAAQ,SAAS,MAAjB;EACE,KAAK,QAEH,OAAO;EACT,KAAK,mBAAmB;GAEtB,MAAM,WAA+B,CAAC;GACtC,KAAK,MAAM,CAAC,KAAK,SAAS,OAAO,QAAQ,SAAS,KAAK,GACrD,SAAS,OAAO,MAAM,IAAI;GAE5B,OAAO;IACL,GAAG;IACH,OAAO;GACT;EACF;EACA,KAAK,qBAAqB;GAExB,MAAM,WAA4C,CAAC;GACnD,KAAK,MAAM,CAAC,KAAK,UAAU,OAAO,QAAQ,SAAS,KAAK,GACtD,SAAS,OAAO;IACd,OAAO,MAAM,MAAM,KAAK;IACxB,QAAQ,MAAM,MAAM,MAAM;GAC5B;GAEF,OAAO;IACL,GAAG;IACH,OAAO;GACT;EACF;EACA,KAAK,sBAAsB;GAEzB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,OAAO,YACZ,gBAAgB,MAAM,KAAK,EAAE,KAAK,YAAY,CAAC,KAAK,UAAU,GAAG,GAAG,KAAK,CAAC,CAC5E;EACF;EACF,KAAK,sBACH,OAAO;GACL,MAAM;GACN,oBAAoB,gBAAgB;GACpC,OAAO,OAAO,YACZ,gBAAgB,MAAM,KAAK,EAAE,KAAK,YAAY,CAAC,KAAK,UAAU,GAAG,GAAG,KAAK,CAAC,CAC5E;EACF;EACF,SACE,aAAA,YAAY,eAAe;CAC/B;AACF;AAeA,SAAgB,mBACd,iBACA,OACiC;CACjC,IAAI,oBAAoB,KAAA,GACtB;CAGF,QAAQ,gBAAgB,MAAxB;EACE,KAAK,QAEH,OAAO;EACT,KAAK,mBACH,OAAO;GACL,GAAG;GACH,OAAO,gBAAgB,MAAM,KAAK,WAAW;IAC3C,KAAK,MAAM;IACX,OAAO,MAAM,MAAM,KAAK;GAC1B,EAAE;EACJ;EACF,KAAK,qBACH,OAAO;GACL,GAAG;GACH,OAAO,gBAAgB,MAAM,KAAK,WAAW;IAC3C,KAAK,MAAM;IACX,OAAO;KACL,OAAO,MAAM,MAAM,MAAM,KAAK;KAC9B,QAAQ,MAAM,MAAM,MAAM,MAAM;IAClC;GACF,EAAE;EACJ;EACF,KAAK,sBACH,OAAO;GACL,GAAG;GACH,OAAO,gBAAgB,MAAM,KAAK,WAAW;IAC3C,KAAK,MAAM;IACX,OAAO,MAAM,MAAM,KAAK;GAC1B,EAAE;EACJ;CACJ;AACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"data_info.d.ts","names":[],"sources":["../../../src/drivers/pframe/data_info.ts"],"mappings":";;AASA
|
|
1
|
+
{"version":3,"file":"data_info.d.ts","names":[],"sources":["../../../src/drivers/pframe/data_info.ts"],"mappings":";;AASA;;;;AAAwB;AAMxB;KANY,YAAA;;;AAMU;AAMtB;KANY,UAAA;;;;;KAMA,gBAAA;EAKV,wBAHA,GAAA,EAAK,UAAA,EAGG;EAAR,KAAA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A2B,IAAA;;;;;;;iBAQrE,iBAAA,OAAwB,KAAA,YAAiB,KAAA,IAAS,eAAe,CAAC,IAAA;;;;;;;;iBA6BlE,4BAAA,OACd,KAAA,YACC,KAAA,IAAS,0BAA0B,CAAC,IAAA;;;;;;;iBAkBvB,iBAAA,OAAwB,QAAA,EAAU,QAAA,CAAS,IAAA,IAAQ,eAAA,CAAgB,IAAA;;;;;;;iBAiDnE,iBAAA,OAAwB,eAAA,EAAiB,eAAA,CAAgB,IAAA,IAAQ,QAAA,CAAS,IAAA;;AA/PpC;AACtD;;;;;;;iBA8SgB,kBAAA,SACd,eAAA,EAAiB,eAAA,CAAgB,EAAA,GACjC,KAAA,GAAQ,IAAA,EAAM,EAAA,KAAO,EAAA,GACpB,eAAA,CAAgB,EAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"data_info.js","names":[],"sources":["../../../src/drivers/pframe/data_info.ts"],"sourcesContent":["import { assertNever } from \"../../util\";\n\n/**\n * Represents a JavaScript representation of a value in a PColumn. Can be null, a number, or a string.\n * These are the primitive types that can be stored directly in PColumns.\n *\n * Note: Actual columns can hold more value types, which are converted to these JavaScript types\n * once they enter the JavaScript runtime.\n */\nexport type PColumnValue = null | number | string;\n\n/**\n * Represents a key for a PColumn value.\n * Can be an array of strings or numbers.\n */\nexport type PColumnKey = (number | string)[];\n\n/**\n * Represents a single entry in a PColumn's data structure.\n * Contains a key and a value.\n */\nexport type PColumnDataEntry<T> = {\n /** Key for the value */\n key: PColumnKey;\n\n /** Value / blob at the given key */\n value: T;\n};\n\n/**\n * Represents column data stored as a simple JSON structure.\n * Used for small datasets that can be efficiently stored directly in memory.\n */\nexport type JsonDataInfo = {\n /** Identifier for this data format ('Json') */\n type: \"Json\";\n\n /** Number of axes that make up the complete key (tuple length) */\n keyLength: number;\n\n /**\n * Key-value pairs where keys are stringified tuples of axis values\n * and values are the column values for those coordinates\n */\n data: Record<string, PColumnValue>;\n};\n\n/**\n * Represents column data partitioned across multiple JSON blobs.\n * Used for larger datasets that need to be split into manageable chunks.\n */\nexport type JsonPartitionedDataInfo<Blob> = {\n /** Identifier for this data format ('JsonPartitioned') */\n type: \"JsonPartitioned\";\n\n /** Number of leading axes used for partitioning */\n partitionKeyLength: number;\n\n /** Map of stringified partition keys to blob references */\n parts: Record<string, Blob>;\n};\n\n/**\n * Represents a binary format chunk containing index and values as separate blobs.\n * Used for efficient storage and retrieval of column data in binary format.\n */\nexport type BinaryChunk<Blob> = {\n /** Binary blob containing structured index information */\n index: Blob;\n\n /** Binary blob containing the actual values */\n values: Blob;\n};\n\n/**\n * Represents column data partitioned across multiple binary chunks.\n * Optimized for efficient storage and retrieval of large datasets.\n */\nexport type BinaryPartitionedDataInfo<Blob> = {\n /** Identifier for this data format ('BinaryPartitioned') */\n type: \"BinaryPartitioned\";\n\n /** Number of leading axes used for partitioning */\n partitionKeyLength: number;\n\n /** Map of stringified partition keys to binary chunks */\n parts: Record<string, BinaryChunk<Blob>>;\n};\n\nexport type ParquetChunkMappingAxis = {\n /** Data type (matches PColumn axis types) */\n type: \"Int\" | \"Long\" | \"String\";\n\n /** Field name in the Parquet file */\n id: string;\n};\n\nexport type ParquetChunkMappingColumn = {\n /** Data type (matches PColumn value type) */\n type: \"Int\" | \"Long\" | \"Float\" | \"Double\" | \"String\";\n\n /** Field name in the Parquet file */\n id: string;\n};\n\nexport type ParquetChunkMapping = {\n /** Axes mappings - Parquet file is sorted by these fields in this order */\n axes: ParquetChunkMappingAxis[];\n\n /** Column mapping */\n column: ParquetChunkMappingColumn;\n};\n\nexport type ParquetChunkStats = {\n /** Number of rows in the chunk */\n numberOfRows: number;\n /** Byte size information for storage optimization and query planning */\n size: {\n /** Byte sizes for each axis column in the same order as axes mapping */\n axes: number[];\n /** Byte size for the data column */\n column: number;\n };\n};\n\nexport type ParquetChunkMetadata = {\n /** Content hash calculated for the specific axes and data this chunk represents */\n dataDigest: string;\n\n /** Pre-computed statistics for optimization without blob download */\n stats: Partial<ParquetChunkStats>;\n};\n\nexport type ParquetChunk<Blob> = {\n /** Parquet file (PTable) containing column data */\n data: Blob;\n} & ParquetChunkMapping &\n Partial<ParquetChunkMetadata>;\n\nexport type ParquetPartitionedDataInfo<Blob> = {\n /** Identifier for this data format ('ParquetPartitioned') */\n type: \"ParquetPartitioned\";\n\n /** Number of leading axes used for partitioning */\n partitionKeyLength: number;\n\n /** Map of stringified partition keys to parquet files */\n parts: Record<string, Blob>;\n};\n\n/**\n * Union type representing all possible data storage formats for PColumn data.\n * The specific format used depends on data size, access patterns, and performance requirements.\n *\n * @template Blob - Type parameter representing the storage reference type (could be ResourceInfo, PFrameBlobId, etc.)\n */\nexport type DataInfo<Blob> =\n | JsonDataInfo\n | JsonPartitionedDataInfo<Blob>\n | BinaryPartitionedDataInfo<Blob>\n | ParquetPartitionedDataInfo<Blob>;\n\n/**\n * Type guard function that checks if the given value is a valid DataInfo.\n *\n * @param value - The value to check\n * @returns True if the value is a valid DataInfo, false otherwise\n */\nexport function isDataInfo<Blob>(value: unknown): value is DataInfo<Blob> {\n if (!value || typeof value !== \"object\") {\n return false;\n }\n\n const data = value as Record<string, unknown>;\n if (!(\"type\" in data)) {\n return false;\n }\n\n switch (data.type) {\n case \"Json\":\n return (\n typeof data.keyLength === \"number\" &&\n data.data !== undefined &&\n typeof data.data === \"object\"\n );\n case \"JsonPartitioned\":\n case \"BinaryPartitioned\":\n case \"ParquetPartitioned\":\n return (\n typeof data.partitionKeyLength === \"number\" &&\n data.parts !== undefined &&\n typeof data.parts === \"object\"\n );\n default:\n return false;\n }\n}\n\n/**\n * Maps blob references in a DataInfo object from one type to another using a mapping function.\n *\n * @template B1 - Source blob type\n * @template B2 - Target blob type\n * @param dataInfo - The source DataInfo object\n * @param mapFn - Function to transform blobs from type B1 to type B2\n * @returns A new DataInfo object with transformed blob references\n */\nexport function mapDataInfo<B1, B2>(\n dataInfo: ParquetPartitionedDataInfo<B1>,\n mapFn: (blob: B1) => B2,\n): ParquetPartitionedDataInfo<B2>;\nexport function mapDataInfo<B1, B2>(\n dataInfo: Exclude<DataInfo<B1>, ParquetPartitionedDataInfo<B1>>,\n mapFn: (blob: B1) => B2,\n): Exclude<DataInfo<B2>, ParquetPartitionedDataInfo<B2>>;\nexport function mapDataInfo<B1, B2>(dataInfo: DataInfo<B1>, mapFn: (blob: B1) => B2): DataInfo<B2>;\nexport function mapDataInfo<B1, B2>(\n dataInfo: DataInfo<B1> | undefined,\n mapFn: (blob: B1) => B2,\n): DataInfo<B2> | undefined {\n if (dataInfo === undefined) {\n return undefined;\n }\n\n switch (dataInfo.type) {\n case \"Json\":\n // Json type doesn't contain blobs, so return as is\n return dataInfo;\n case \"JsonPartitioned\": {\n // Map each blob in parts\n const newParts: Record<string, B2> = {};\n for (const [key, blob] of Object.entries(dataInfo.parts)) {\n newParts[key] = mapFn(blob);\n }\n return {\n ...dataInfo,\n parts: newParts,\n };\n }\n case \"BinaryPartitioned\": {\n // Map each index and values blob in parts\n const newParts: Record<string, BinaryChunk<B2>> = {};\n for (const [key, chunk] of Object.entries(dataInfo.parts)) {\n newParts[key] = {\n index: mapFn(chunk.index),\n values: mapFn(chunk.values),\n };\n }\n return {\n ...dataInfo,\n parts: newParts,\n };\n }\n case \"ParquetPartitioned\": {\n // Map each blob in parts\n const newParts: Record<string, B2> = {};\n for (const [key, blob] of Object.entries(dataInfo.parts)) {\n newParts[key] = mapFn(blob);\n }\n return {\n ...dataInfo,\n parts: newParts,\n };\n }\n }\n}\n\n/**\n * @param dataInfo - The source DataInfo object\n * @param cb - Callback, function that have access to every blob to visit them all\n * @returns Nothing\n */\nexport function visitDataInfo<B>(dataInfo: DataInfo<B>, cb: (blob: B) => void): void {\n switch (dataInfo.type) {\n case \"Json\":\n // Json type doesn't contain blobs, so return as is\n break;\n case \"JsonPartitioned\": {\n // Visit each blob in parts\n Object.values(dataInfo.parts).forEach(cb);\n break;\n }\n case \"BinaryPartitioned\": {\n // Visit each index and values blob in parts\n Object.values(dataInfo.parts).forEach((chunk) => {\n cb(chunk.index);\n cb(chunk.values);\n });\n break;\n }\n case \"ParquetPartitioned\": {\n // Visit each blob in parts\n Object.values(dataInfo.parts).forEach(cb);\n break;\n }\n }\n}\n\n//\n// Lightway representation for ExplicitJsonData\n//\n\n/**\n * Represents a single key-value entry in a column's explicit data structure.\n * Used when directly instantiating PColumns with explicit data.\n */\nexport type PColumnValuesEntry = {\n key: PColumnKey;\n val: PColumnValue;\n};\n\n/**\n * Array of key-value entries representing explicit column data.\n * Used for lightweight explicit instantiation of PColumns.\n */\nexport type PColumnValues = PColumnValuesEntry[];\n\n/**\n * Entry-based representation of JsonDataInfo\n */\nexport interface JsonDataInfoEntries {\n type: \"Json\";\n keyLength: number;\n data: PColumnDataEntry<PColumnValue>[];\n}\n\n/**\n * Entry-based representation of JsonPartitionedDataInfo\n */\nexport interface JsonPartitionedDataInfoEntries<Blob> {\n type: \"JsonPartitioned\";\n partitionKeyLength: number;\n parts: PColumnDataEntry<Blob>[];\n}\n\n/**\n * Entry-based representation of BinaryPartitionedDataInfo\n */\nexport interface BinaryPartitionedDataInfoEntries<Blob> {\n type: \"BinaryPartitioned\";\n partitionKeyLength: number;\n parts: PColumnDataEntry<BinaryChunk<Blob>>[];\n}\n\n/**\n * Entry-based representation of ParquetPartitionedDataInfo\n */\nexport interface ParquetPartitionedDataInfoEntries<Blob> {\n type: \"ParquetPartitioned\";\n partitionKeyLength: number;\n parts: PColumnDataEntry<Blob>[];\n}\n/**\n * Union type representing all possible entry-based partitioned data storage formats\n */\nexport type PartitionedDataInfoEntries<Blob> =\n | JsonPartitionedDataInfoEntries<Blob>\n | BinaryPartitionedDataInfoEntries<Blob>\n | ParquetPartitionedDataInfoEntries<Blob>;\n\n/**\n * Union type representing all possible entry-based data storage formats\n */\nexport type DataInfoEntries<Blob> = JsonDataInfoEntries | PartitionedDataInfoEntries<Blob>;\n\n/**\n * Type guard function that checks if the given value is a valid DataInfoEntries.\n *\n * @param value - The value to check\n * @returns True if the value is a valid DataInfoEntries, false otherwise\n */\nexport function isDataInfoEntries<Blob>(value: unknown): value is DataInfoEntries<Blob> {\n if (!value || typeof value !== \"object\") {\n return false;\n }\n\n const data = value as Record<string, unknown>;\n if (!(\"type\" in data)) {\n return false;\n }\n\n switch (data.type) {\n case \"Json\":\n return typeof data.keyLength === \"number\" && Array.isArray(data.data);\n case \"JsonPartitioned\":\n case \"BinaryPartitioned\":\n case \"ParquetPartitioned\":\n return typeof data.partitionKeyLength === \"number\" && Array.isArray(data.parts);\n default:\n return false;\n }\n}\n\n/**\n * Type guard function that checks if the given value is a valid PartitionedDataInfoEntries.\n *\n * @template Blob - Type parameter representing the storage reference type\n * @param value - The value to check\n * @returns True if the value is a valid PartitionedDataInfoEntries, false otherwise\n */\nexport function isPartitionedDataInfoEntries<Blob>(\n value: unknown,\n): value is PartitionedDataInfoEntries<Blob> {\n if (!isDataInfoEntries(value)) return false;\n switch (value.type) {\n case \"JsonPartitioned\":\n case \"BinaryPartitioned\":\n case \"ParquetPartitioned\":\n return true;\n default:\n return false;\n }\n}\n\n/**\n * Converts DataInfo to DataInfoEntries\n *\n * @param dataInfo - The record-based DataInfo object\n * @returns The equivalent entry-based DataInfoEntries object\n */\nexport function dataInfoToEntries<Blob>(dataInfo: DataInfo<Blob>): DataInfoEntries<Blob> {\n switch (dataInfo.type) {\n case \"Json\":\n return {\n type: \"Json\",\n keyLength: dataInfo.keyLength,\n data: Object.entries(dataInfo.data).map(([keyStr, value]) => {\n const key = JSON.parse(keyStr) as PColumnKey;\n return { key, value } as PColumnDataEntry<PColumnValue>;\n }),\n };\n case \"JsonPartitioned\":\n return {\n type: \"JsonPartitioned\",\n partitionKeyLength: dataInfo.partitionKeyLength,\n parts: Object.entries(dataInfo.parts).map(([keyStr, blob]) => {\n const key = JSON.parse(keyStr) as PColumnKey;\n return { key, value: blob } as PColumnDataEntry<Blob>;\n }),\n };\n case \"BinaryPartitioned\":\n return {\n type: \"BinaryPartitioned\",\n partitionKeyLength: dataInfo.partitionKeyLength,\n parts: Object.entries(dataInfo.parts).map(([keyStr, chunk]) => {\n const key = JSON.parse(keyStr) as PColumnKey;\n return { key, value: chunk } as PColumnDataEntry<BinaryChunk<Blob>>;\n }),\n };\n case \"ParquetPartitioned\":\n return {\n type: \"ParquetPartitioned\",\n partitionKeyLength: dataInfo.partitionKeyLength,\n parts: Object.entries(dataInfo.parts).map(([keyStr, blob]) => {\n const key = JSON.parse(keyStr) as PColumnKey;\n return { key, value: blob } as PColumnDataEntry<Blob>;\n }),\n };\n default:\n assertNever(dataInfo);\n }\n}\n\n/**\n * Converts DataInfoEntries to DataInfo\n *\n * @param dataInfoEntries - The entry-based DataInfoEntries object\n * @returns The equivalent record-based DataInfo object\n */\nexport function entriesToDataInfo<Blob>(dataInfoEntries: DataInfoEntries<Blob>): DataInfo<Blob> {\n switch (dataInfoEntries.type) {\n case \"Json\":\n return {\n type: \"Json\",\n keyLength: dataInfoEntries.keyLength,\n data: Object.fromEntries(\n dataInfoEntries.data.map(({ key, value }) => [JSON.stringify(key), value]),\n ),\n };\n case \"JsonPartitioned\":\n return {\n type: \"JsonPartitioned\",\n partitionKeyLength: dataInfoEntries.partitionKeyLength,\n parts: Object.fromEntries(\n dataInfoEntries.parts.map(({ key, value }) => [JSON.stringify(key), value]),\n ),\n };\n case \"BinaryPartitioned\":\n return {\n type: \"BinaryPartitioned\",\n partitionKeyLength: dataInfoEntries.partitionKeyLength,\n parts: Object.fromEntries(\n dataInfoEntries.parts.map(({ key, value }) => [JSON.stringify(key), value]),\n ),\n };\n case \"ParquetPartitioned\":\n return {\n type: \"ParquetPartitioned\",\n partitionKeyLength: dataInfoEntries.partitionKeyLength,\n parts: Object.fromEntries(\n dataInfoEntries.parts.map(({ key, value }) => [JSON.stringify(key), value]),\n ),\n };\n default:\n assertNever(dataInfoEntries);\n }\n}\n\n/**\n * Maps blob references in a DataInfoEntries object from one type to another using a mapping function.\n *\n * @template B1 - Source blob type\n * @template B2 - Target blob type\n * @param dataInfoEntries - The source DataInfoEntries object\n * @param mapFn - Function to transform blobs from type B1 to type B2\n * @returns A new DataInfoEntries object with transformed blob references\n */\nexport function mapDataInfoEntries<B1, B2>(\n dataInfoEntries: DataInfoEntries<B1>,\n mapFn: (blob: B1) => B2,\n): DataInfoEntries<B2>;\nexport function mapDataInfoEntries<B1, B2>(\n dataInfoEntries: DataInfoEntries<B1> | undefined,\n mapFn: (blob: B1) => B2,\n): DataInfoEntries<B2> | undefined {\n if (dataInfoEntries === undefined) {\n return undefined;\n }\n\n switch (dataInfoEntries.type) {\n case \"Json\":\n // Json type doesn't contain blobs, so return as is\n return dataInfoEntries;\n case \"JsonPartitioned\":\n return {\n ...dataInfoEntries,\n parts: dataInfoEntries.parts.map((entry) => ({\n key: entry.key,\n value: mapFn(entry.value),\n })),\n };\n case \"BinaryPartitioned\":\n return {\n ...dataInfoEntries,\n parts: dataInfoEntries.parts.map((entry) => ({\n key: entry.key,\n value: {\n index: mapFn(entry.value.index),\n values: mapFn(entry.value.values),\n },\n })),\n };\n case \"ParquetPartitioned\":\n return {\n ...dataInfoEntries,\n parts: dataInfoEntries.parts.map((entry) => ({\n key: entry.key,\n value: mapFn(entry.value),\n })),\n };\n }\n}\n"],"mappings":";;;;;;;;AAwKA,SAAgB,WAAiB,OAAyC;AACxE,KAAI,CAAC,SAAS,OAAO,UAAU,SAC7B,QAAO;CAGT,MAAM,OAAO;AACb,KAAI,EAAE,UAAU,MACd,QAAO;AAGT,SAAQ,KAAK,MAAb;EACE,KAAK,OACH,QACE,OAAO,KAAK,cAAc,YAC1B,KAAK,SAAS,KAAA,KACd,OAAO,KAAK,SAAS;EAEzB,KAAK;EACL,KAAK;EACL,KAAK,qBACH,QACE,OAAO,KAAK,uBAAuB,YACnC,KAAK,UAAU,KAAA,KACf,OAAO,KAAK,UAAU;EAE1B,QACE,QAAO;;;AAsBb,SAAgB,YACd,UACA,OAC0B;AAC1B,KAAI,aAAa,KAAA,EACf;AAGF,SAAQ,SAAS,MAAjB;EACE,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
|
|
1
|
+
{"version":3,"file":"data_info.js","names":[],"sources":["../../../src/drivers/pframe/data_info.ts"],"sourcesContent":["import { assertNever } from \"../../util\";\n\n/**\n * Represents a JavaScript representation of a value in a PColumn. Can be null, a number, or a string.\n * These are the primitive types that can be stored directly in PColumns.\n *\n * Note: Actual columns can hold more value types, which are converted to these JavaScript types\n * once they enter the JavaScript runtime.\n */\nexport type PColumnValue = null | number | string;\n\n/**\n * Represents a key for a PColumn value.\n * Can be an array of strings or numbers.\n */\nexport type PColumnKey = (number | string)[];\n\n/**\n * Represents a single entry in a PColumn's data structure.\n * Contains a key and a value.\n */\nexport type PColumnDataEntry<T> = {\n /** Key for the value */\n key: PColumnKey;\n\n /** Value / blob at the given key */\n value: T;\n};\n\n/**\n * Represents column data stored as a simple JSON structure.\n * Used for small datasets that can be efficiently stored directly in memory.\n */\nexport type JsonDataInfo = {\n /** Identifier for this data format ('Json') */\n type: \"Json\";\n\n /** Number of axes that make up the complete key (tuple length) */\n keyLength: number;\n\n /**\n * Key-value pairs where keys are stringified tuples of axis values\n * and values are the column values for those coordinates\n */\n data: Record<string, PColumnValue>;\n};\n\n/**\n * Represents column data partitioned across multiple JSON blobs.\n * Used for larger datasets that need to be split into manageable chunks.\n */\nexport type JsonPartitionedDataInfo<Blob> = {\n /** Identifier for this data format ('JsonPartitioned') */\n type: \"JsonPartitioned\";\n\n /** Number of leading axes used for partitioning */\n partitionKeyLength: number;\n\n /** Map of stringified partition keys to blob references */\n parts: Record<string, Blob>;\n};\n\n/**\n * Represents a binary format chunk containing index and values as separate blobs.\n * Used for efficient storage and retrieval of column data in binary format.\n */\nexport type BinaryChunk<Blob> = {\n /** Binary blob containing structured index information */\n index: Blob;\n\n /** Binary blob containing the actual values */\n values: Blob;\n};\n\n/**\n * Represents column data partitioned across multiple binary chunks.\n * Optimized for efficient storage and retrieval of large datasets.\n */\nexport type BinaryPartitionedDataInfo<Blob> = {\n /** Identifier for this data format ('BinaryPartitioned') */\n type: \"BinaryPartitioned\";\n\n /** Number of leading axes used for partitioning */\n partitionKeyLength: number;\n\n /** Map of stringified partition keys to binary chunks */\n parts: Record<string, BinaryChunk<Blob>>;\n};\n\nexport type ParquetChunkMappingAxis = {\n /** Data type (matches PColumn axis types) */\n type: \"Int\" | \"Long\" | \"String\";\n\n /** Field name in the Parquet file */\n id: string;\n};\n\nexport type ParquetChunkMappingColumn = {\n /** Data type (matches PColumn value type) */\n type: \"Int\" | \"Long\" | \"Float\" | \"Double\" | \"String\";\n\n /** Field name in the Parquet file */\n id: string;\n};\n\nexport type ParquetChunkMapping = {\n /** Axes mappings - Parquet file is sorted by these fields in this order */\n axes: ParquetChunkMappingAxis[];\n\n /** Column mapping */\n column: ParquetChunkMappingColumn;\n};\n\nexport type ParquetChunkStats = {\n /** Number of rows in the chunk */\n numberOfRows: number;\n /** Byte size information for storage optimization and query planning */\n size: {\n /** Byte sizes for each axis column in the same order as axes mapping */\n axes: number[];\n /** Byte size for the data column */\n column: number;\n };\n};\n\nexport type ParquetChunkMetadata = {\n /** Content hash calculated for the specific axes and data this chunk represents */\n dataDigest: string;\n\n /** Pre-computed statistics for optimization without blob download */\n stats: Partial<ParquetChunkStats>;\n};\n\nexport type ParquetChunk<Blob> = {\n /** Parquet file (PTable) containing column data */\n data: Blob;\n} & ParquetChunkMapping &\n Partial<ParquetChunkMetadata>;\n\nexport type ParquetPartitionedDataInfo<Blob> = {\n /** Identifier for this data format ('ParquetPartitioned') */\n type: \"ParquetPartitioned\";\n\n /** Number of leading axes used for partitioning */\n partitionKeyLength: number;\n\n /** Map of stringified partition keys to parquet files */\n parts: Record<string, Blob>;\n};\n\n/**\n * Union type representing all possible data storage formats for PColumn data.\n * The specific format used depends on data size, access patterns, and performance requirements.\n *\n * @template Blob - Type parameter representing the storage reference type (could be ResourceInfo, PFrameBlobId, etc.)\n */\nexport type DataInfo<Blob> =\n | JsonDataInfo\n | JsonPartitionedDataInfo<Blob>\n | BinaryPartitionedDataInfo<Blob>\n | ParquetPartitionedDataInfo<Blob>;\n\n/**\n * Type guard function that checks if the given value is a valid DataInfo.\n *\n * @param value - The value to check\n * @returns True if the value is a valid DataInfo, false otherwise\n */\nexport function isDataInfo<Blob>(value: unknown): value is DataInfo<Blob> {\n if (!value || typeof value !== \"object\") {\n return false;\n }\n\n const data = value as Record<string, unknown>;\n if (!(\"type\" in data)) {\n return false;\n }\n\n switch (data.type) {\n case \"Json\":\n return (\n typeof data.keyLength === \"number\" &&\n data.data !== undefined &&\n typeof data.data === \"object\"\n );\n case \"JsonPartitioned\":\n case \"BinaryPartitioned\":\n case \"ParquetPartitioned\":\n return (\n typeof data.partitionKeyLength === \"number\" &&\n data.parts !== undefined &&\n typeof data.parts === \"object\"\n );\n default:\n return false;\n }\n}\n\n/**\n * Maps blob references in a DataInfo object from one type to another using a mapping function.\n *\n * @template B1 - Source blob type\n * @template B2 - Target blob type\n * @param dataInfo - The source DataInfo object\n * @param mapFn - Function to transform blobs from type B1 to type B2\n * @returns A new DataInfo object with transformed blob references\n */\nexport function mapDataInfo<B1, B2>(\n dataInfo: ParquetPartitionedDataInfo<B1>,\n mapFn: (blob: B1) => B2,\n): ParquetPartitionedDataInfo<B2>;\nexport function mapDataInfo<B1, B2>(\n dataInfo: Exclude<DataInfo<B1>, ParquetPartitionedDataInfo<B1>>,\n mapFn: (blob: B1) => B2,\n): Exclude<DataInfo<B2>, ParquetPartitionedDataInfo<B2>>;\nexport function mapDataInfo<B1, B2>(dataInfo: DataInfo<B1>, mapFn: (blob: B1) => B2): DataInfo<B2>;\nexport function mapDataInfo<B1, B2>(\n dataInfo: DataInfo<B1> | undefined,\n mapFn: (blob: B1) => B2,\n): DataInfo<B2> | undefined {\n if (dataInfo === undefined) {\n return undefined;\n }\n\n switch (dataInfo.type) {\n case \"Json\":\n // Json type doesn't contain blobs, so return as is\n return dataInfo;\n case \"JsonPartitioned\": {\n // Map each blob in parts\n const newParts: Record<string, B2> = {};\n for (const [key, blob] of Object.entries(dataInfo.parts)) {\n newParts[key] = mapFn(blob);\n }\n return {\n ...dataInfo,\n parts: newParts,\n };\n }\n case \"BinaryPartitioned\": {\n // Map each index and values blob in parts\n const newParts: Record<string, BinaryChunk<B2>> = {};\n for (const [key, chunk] of Object.entries(dataInfo.parts)) {\n newParts[key] = {\n index: mapFn(chunk.index),\n values: mapFn(chunk.values),\n };\n }\n return {\n ...dataInfo,\n parts: newParts,\n };\n }\n case \"ParquetPartitioned\": {\n // Map each blob in parts\n const newParts: Record<string, B2> = {};\n for (const [key, blob] of Object.entries(dataInfo.parts)) {\n newParts[key] = mapFn(blob);\n }\n return {\n ...dataInfo,\n parts: newParts,\n };\n }\n }\n}\n\n/**\n * @param dataInfo - The source DataInfo object\n * @param cb - Callback, function that have access to every blob to visit them all\n * @returns Nothing\n */\nexport function visitDataInfo<B>(dataInfo: DataInfo<B>, cb: (blob: B) => void): void {\n switch (dataInfo.type) {\n case \"Json\":\n // Json type doesn't contain blobs, so return as is\n break;\n case \"JsonPartitioned\": {\n // Visit each blob in parts\n Object.values(dataInfo.parts).forEach(cb);\n break;\n }\n case \"BinaryPartitioned\": {\n // Visit each index and values blob in parts\n Object.values(dataInfo.parts).forEach((chunk) => {\n cb(chunk.index);\n cb(chunk.values);\n });\n break;\n }\n case \"ParquetPartitioned\": {\n // Visit each blob in parts\n Object.values(dataInfo.parts).forEach(cb);\n break;\n }\n }\n}\n\n//\n// Lightway representation for ExplicitJsonData\n//\n\n/**\n * Represents a single key-value entry in a column's explicit data structure.\n * Used when directly instantiating PColumns with explicit data.\n */\nexport type PColumnValuesEntry = {\n key: PColumnKey;\n val: PColumnValue;\n};\n\n/**\n * Array of key-value entries representing explicit column data.\n * Used for lightweight explicit instantiation of PColumns.\n */\nexport type PColumnValues = PColumnValuesEntry[];\n\n/**\n * Entry-based representation of JsonDataInfo\n */\nexport interface JsonDataInfoEntries {\n type: \"Json\";\n keyLength: number;\n data: PColumnDataEntry<PColumnValue>[];\n}\n\n/**\n * Entry-based representation of JsonPartitionedDataInfo\n */\nexport interface JsonPartitionedDataInfoEntries<Blob> {\n type: \"JsonPartitioned\";\n partitionKeyLength: number;\n parts: PColumnDataEntry<Blob>[];\n}\n\n/**\n * Entry-based representation of BinaryPartitionedDataInfo\n */\nexport interface BinaryPartitionedDataInfoEntries<Blob> {\n type: \"BinaryPartitioned\";\n partitionKeyLength: number;\n parts: PColumnDataEntry<BinaryChunk<Blob>>[];\n}\n\n/**\n * Entry-based representation of ParquetPartitionedDataInfo\n */\nexport interface ParquetPartitionedDataInfoEntries<Blob> {\n type: \"ParquetPartitioned\";\n partitionKeyLength: number;\n parts: PColumnDataEntry<Blob>[];\n}\n/**\n * Union type representing all possible entry-based partitioned data storage formats\n */\nexport type PartitionedDataInfoEntries<Blob> =\n | JsonPartitionedDataInfoEntries<Blob>\n | BinaryPartitionedDataInfoEntries<Blob>\n | ParquetPartitionedDataInfoEntries<Blob>;\n\n/**\n * Union type representing all possible entry-based data storage formats\n */\nexport type DataInfoEntries<Blob> = JsonDataInfoEntries | PartitionedDataInfoEntries<Blob>;\n\n/**\n * Type guard function that checks if the given value is a valid DataInfoEntries.\n *\n * @param value - The value to check\n * @returns True if the value is a valid DataInfoEntries, false otherwise\n */\nexport function isDataInfoEntries<Blob>(value: unknown): value is DataInfoEntries<Blob> {\n if (!value || typeof value !== \"object\") {\n return false;\n }\n\n const data = value as Record<string, unknown>;\n if (!(\"type\" in data)) {\n return false;\n }\n\n switch (data.type) {\n case \"Json\":\n return typeof data.keyLength === \"number\" && Array.isArray(data.data);\n case \"JsonPartitioned\":\n case \"BinaryPartitioned\":\n case \"ParquetPartitioned\":\n return typeof data.partitionKeyLength === \"number\" && Array.isArray(data.parts);\n default:\n return false;\n }\n}\n\n/**\n * Type guard function that checks if the given value is a valid PartitionedDataInfoEntries.\n *\n * @template Blob - Type parameter representing the storage reference type\n * @param value - The value to check\n * @returns True if the value is a valid PartitionedDataInfoEntries, false otherwise\n */\nexport function isPartitionedDataInfoEntries<Blob>(\n value: unknown,\n): value is PartitionedDataInfoEntries<Blob> {\n if (!isDataInfoEntries(value)) return false;\n switch (value.type) {\n case \"JsonPartitioned\":\n case \"BinaryPartitioned\":\n case \"ParquetPartitioned\":\n return true;\n default:\n return false;\n }\n}\n\n/**\n * Converts DataInfo to DataInfoEntries\n *\n * @param dataInfo - The record-based DataInfo object\n * @returns The equivalent entry-based DataInfoEntries object\n */\nexport function dataInfoToEntries<Blob>(dataInfo: DataInfo<Blob>): DataInfoEntries<Blob> {\n switch (dataInfo.type) {\n case \"Json\":\n return {\n type: \"Json\",\n keyLength: dataInfo.keyLength,\n data: Object.entries(dataInfo.data).map(([keyStr, value]) => {\n const key = JSON.parse(keyStr) as PColumnKey;\n return { key, value } as PColumnDataEntry<PColumnValue>;\n }),\n };\n case \"JsonPartitioned\":\n return {\n type: \"JsonPartitioned\",\n partitionKeyLength: dataInfo.partitionKeyLength,\n parts: Object.entries(dataInfo.parts).map(([keyStr, blob]) => {\n const key = JSON.parse(keyStr) as PColumnKey;\n return { key, value: blob } as PColumnDataEntry<Blob>;\n }),\n };\n case \"BinaryPartitioned\":\n return {\n type: \"BinaryPartitioned\",\n partitionKeyLength: dataInfo.partitionKeyLength,\n parts: Object.entries(dataInfo.parts).map(([keyStr, chunk]) => {\n const key = JSON.parse(keyStr) as PColumnKey;\n return { key, value: chunk } as PColumnDataEntry<BinaryChunk<Blob>>;\n }),\n };\n case \"ParquetPartitioned\":\n return {\n type: \"ParquetPartitioned\",\n partitionKeyLength: dataInfo.partitionKeyLength,\n parts: Object.entries(dataInfo.parts).map(([keyStr, blob]) => {\n const key = JSON.parse(keyStr) as PColumnKey;\n return { key, value: blob } as PColumnDataEntry<Blob>;\n }),\n };\n default:\n assertNever(dataInfo);\n }\n}\n\n/**\n * Converts DataInfoEntries to DataInfo\n *\n * @param dataInfoEntries - The entry-based DataInfoEntries object\n * @returns The equivalent record-based DataInfo object\n */\nexport function entriesToDataInfo<Blob>(dataInfoEntries: DataInfoEntries<Blob>): DataInfo<Blob> {\n switch (dataInfoEntries.type) {\n case \"Json\":\n return {\n type: \"Json\",\n keyLength: dataInfoEntries.keyLength,\n data: Object.fromEntries(\n dataInfoEntries.data.map(({ key, value }) => [JSON.stringify(key), value]),\n ),\n };\n case \"JsonPartitioned\":\n return {\n type: \"JsonPartitioned\",\n partitionKeyLength: dataInfoEntries.partitionKeyLength,\n parts: Object.fromEntries(\n dataInfoEntries.parts.map(({ key, value }) => [JSON.stringify(key), value]),\n ),\n };\n case \"BinaryPartitioned\":\n return {\n type: \"BinaryPartitioned\",\n partitionKeyLength: dataInfoEntries.partitionKeyLength,\n parts: Object.fromEntries(\n dataInfoEntries.parts.map(({ key, value }) => [JSON.stringify(key), value]),\n ),\n };\n case \"ParquetPartitioned\":\n return {\n type: \"ParquetPartitioned\",\n partitionKeyLength: dataInfoEntries.partitionKeyLength,\n parts: Object.fromEntries(\n dataInfoEntries.parts.map(({ key, value }) => [JSON.stringify(key), value]),\n ),\n };\n default:\n assertNever(dataInfoEntries);\n }\n}\n\n/**\n * Maps blob references in a DataInfoEntries object from one type to another using a mapping function.\n *\n * @template B1 - Source blob type\n * @template B2 - Target blob type\n * @param dataInfoEntries - The source DataInfoEntries object\n * @param mapFn - Function to transform blobs from type B1 to type B2\n * @returns A new DataInfoEntries object with transformed blob references\n */\nexport function mapDataInfoEntries<B1, B2>(\n dataInfoEntries: DataInfoEntries<B1>,\n mapFn: (blob: B1) => B2,\n): DataInfoEntries<B2>;\nexport function mapDataInfoEntries<B1, B2>(\n dataInfoEntries: DataInfoEntries<B1> | undefined,\n mapFn: (blob: B1) => B2,\n): DataInfoEntries<B2> | undefined {\n if (dataInfoEntries === undefined) {\n return undefined;\n }\n\n switch (dataInfoEntries.type) {\n case \"Json\":\n // Json type doesn't contain blobs, so return as is\n return dataInfoEntries;\n case \"JsonPartitioned\":\n return {\n ...dataInfoEntries,\n parts: dataInfoEntries.parts.map((entry) => ({\n key: entry.key,\n value: mapFn(entry.value),\n })),\n };\n case \"BinaryPartitioned\":\n return {\n ...dataInfoEntries,\n parts: dataInfoEntries.parts.map((entry) => ({\n key: entry.key,\n value: {\n index: mapFn(entry.value.index),\n values: mapFn(entry.value.values),\n },\n })),\n };\n case \"ParquetPartitioned\":\n return {\n ...dataInfoEntries,\n parts: dataInfoEntries.parts.map((entry) => ({\n key: entry.key,\n value: mapFn(entry.value),\n })),\n };\n }\n}\n"],"mappings":";;;;;;;;AAwKA,SAAgB,WAAiB,OAAyC;CACxE,IAAI,CAAC,SAAS,OAAO,UAAU,UAC7B,OAAO;CAGT,MAAM,OAAO;CACb,IAAI,EAAE,UAAU,OACd,OAAO;CAGT,QAAQ,KAAK,MAAb;EACE,KAAK,QACH,OACE,OAAO,KAAK,cAAc,YAC1B,KAAK,SAAS,KAAA,KACd,OAAO,KAAK,SAAS;EAEzB,KAAK;EACL,KAAK;EACL,KAAK,sBACH,OACE,OAAO,KAAK,uBAAuB,YACnC,KAAK,UAAU,KAAA,KACf,OAAO,KAAK,UAAU;EAE1B,SACE,OAAO;CACX;AACF;AAoBA,SAAgB,YACd,UACA,OAC0B;CAC1B,IAAI,aAAa,KAAA,GACf;CAGF,QAAQ,SAAS,MAAjB;EACE,KAAK,QAEH,OAAO;EACT,KAAK,mBAAmB;GAEtB,MAAM,WAA+B,CAAC;GACtC,KAAK,MAAM,CAAC,KAAK,SAAS,OAAO,QAAQ,SAAS,KAAK,GACrD,SAAS,OAAO,MAAM,IAAI;GAE5B,OAAO;IACL,GAAG;IACH,OAAO;GACT;EACF;EACA,KAAK,qBAAqB;GAExB,MAAM,WAA4C,CAAC;GACnD,KAAK,MAAM,CAAC,KAAK,UAAU,OAAO,QAAQ,SAAS,KAAK,GACtD,SAAS,OAAO;IACd,OAAO,MAAM,MAAM,KAAK;IACxB,QAAQ,MAAM,MAAM,MAAM;GAC5B;GAEF,OAAO;IACL,GAAG;IACH,OAAO;GACT;EACF;EACA,KAAK,sBAAsB;GAEzB,MAAM,WAA+B,CAAC;GACtC,KAAK,MAAM,CAA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