@platforma-sdk/model 1.58.5 → 1.58.11
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/_virtual/_rolldown/runtime.cjs +43 -0
- package/dist/_virtual/_rolldown/runtime.js +18 -0
- package/dist/annotations/converter.cjs +15 -20
- package/dist/annotations/converter.cjs.map +1 -1
- package/dist/annotations/converter.d.ts +6 -2
- package/dist/annotations/converter.js +14 -18
- package/dist/annotations/converter.js.map +1 -1
- package/dist/annotations/index.cjs +1 -0
- package/dist/annotations/index.d.ts +2 -3
- package/dist/annotations/index.js +1 -0
- package/dist/annotations/types.d.ts +21 -16
- package/dist/bconfig/index.cjs +2 -0
- package/dist/bconfig/index.d.ts +5 -6
- package/dist/bconfig/index.js +2 -0
- package/dist/bconfig/lambdas.d.ts +52 -52
- package/dist/bconfig/normalization.cjs +13 -18
- package/dist/bconfig/normalization.cjs.map +1 -1
- package/dist/bconfig/normalization.d.ts +10 -6
- package/dist/bconfig/normalization.js +12 -16
- package/dist/bconfig/normalization.js.map +1 -1
- package/dist/bconfig/types.cjs +4 -3
- package/dist/bconfig/types.cjs.map +1 -1
- package/dist/bconfig/types.d.ts +10 -5
- package/dist/bconfig/types.js +4 -2
- package/dist/bconfig/types.js.map +1 -1
- package/dist/bconfig/util.d.ts +7 -4
- package/dist/bconfig/v3.d.ts +10 -6
- package/dist/block_api_v1.d.ts +62 -58
- package/dist/block_api_v2.d.ts +51 -47
- package/dist/block_api_v3.d.ts +33 -29
- package/dist/block_migrations.cjs +481 -413
- package/dist/block_migrations.cjs.map +1 -1
- package/dist/block_migrations.d.ts +258 -204
- package/dist/block_migrations.js +482 -408
- package/dist/block_migrations.js.map +1 -1
- package/dist/block_model.cjs +312 -343
- package/dist/block_model.cjs.map +1 -1
- package/dist/block_model.d.ts +143 -147
- package/dist/block_model.js +312 -341
- package/dist/block_model.js.map +1 -1
- package/dist/block_model_legacy.cjs +231 -255
- package/dist/block_model_legacy.cjs.map +1 -1
- package/dist/block_model_legacy.d.ts +108 -106
- package/dist/block_model_legacy.js +231 -253
- package/dist/block_model_legacy.js.map +1 -1
- package/dist/block_state_patch.d.ts +10 -10
- package/dist/block_state_util.cjs +15 -19
- package/dist/block_state_util.cjs.map +1 -1
- package/dist/block_state_util.d.ts +14 -13
- package/dist/block_state_util.js +15 -18
- package/dist/block_state_util.js.map +1 -1
- package/dist/block_storage.cjs +233 -238
- package/dist/block_storage.cjs.map +1 -1
- package/dist/block_storage.d.ts +62 -78
- package/dist/block_storage.js +234 -237
- package/dist/block_storage.js.map +1 -1
- package/dist/block_storage_callbacks.cjs +156 -195
- package/dist/block_storage_callbacks.cjs.map +1 -1
- package/dist/block_storage_callbacks.js +156 -192
- package/dist/block_storage_callbacks.js.map +1 -1
- package/dist/block_storage_facade.cjs +29 -85
- package/dist/block_storage_facade.cjs.map +1 -1
- package/dist/block_storage_facade.d.ts +83 -126
- package/dist/block_storage_facade.js +29 -83
- package/dist/block_storage_facade.js.map +1 -1
- package/dist/components/PFrameForGraphs.cjs +26 -24
- package/dist/components/PFrameForGraphs.cjs.map +1 -1
- package/dist/components/PFrameForGraphs.d.ts +12 -7
- package/dist/components/PFrameForGraphs.js +25 -22
- package/dist/components/PFrameForGraphs.js.map +1 -1
- package/dist/components/PlAnnotations/filter.d.ts +62 -79
- package/dist/components/PlAnnotations/filters_ui.cjs +135 -171
- package/dist/components/PlAnnotations/filters_ui.cjs.map +1 -1
- package/dist/components/PlAnnotations/filters_ui.d.ts +48 -46
- package/dist/components/PlAnnotations/filters_ui.js +135 -170
- package/dist/components/PlAnnotations/filters_ui.js.map +1 -1
- package/dist/components/PlAnnotations/index.d.ts +2 -3
- package/dist/components/PlDataTable/index.cjs +2 -0
- package/dist/components/PlDataTable/index.d.ts +3 -5
- package/dist/components/PlDataTable/index.js +2 -0
- package/dist/components/PlDataTable/labels.cjs +59 -81
- package/dist/components/PlDataTable/labels.cjs.map +1 -1
- package/dist/components/PlDataTable/labels.js +58 -79
- package/dist/components/PlDataTable/labels.js.map +1 -1
- package/dist/components/PlDataTable/state-migration.cjs +186 -144
- package/dist/components/PlDataTable/state-migration.cjs.map +1 -1
- package/dist/components/PlDataTable/state-migration.d.ts +85 -82
- package/dist/components/PlDataTable/state-migration.js +185 -142
- package/dist/components/PlDataTable/state-migration.js.map +1 -1
- package/dist/components/PlDataTable/table.cjs +172 -194
- package/dist/components/PlDataTable/table.cjs.map +1 -1
- package/dist/components/PlDataTable/table.d.ts +16 -12
- package/dist/components/PlDataTable/table.js +171 -192
- package/dist/components/PlDataTable/table.js.map +1 -1
- package/dist/components/PlDataTable/v4.d.ts +84 -119
- package/dist/components/PlDataTable/v5.d.ts +80 -103
- package/dist/components/PlMultiSequenceAlignment.cjs +27 -29
- package/dist/components/PlMultiSequenceAlignment.cjs.map +1 -1
- package/dist/components/PlMultiSequenceAlignment.d.ts +36 -27
- package/dist/components/PlMultiSequenceAlignment.js +26 -27
- package/dist/components/PlMultiSequenceAlignment.js.map +1 -1
- package/dist/components/PlSelectionModel.cjs +7 -6
- package/dist/components/PlSelectionModel.cjs.map +1 -1
- package/dist/components/PlSelectionModel.d.ts +10 -8
- package/dist/components/PlSelectionModel.js +7 -5
- package/dist/components/PlSelectionModel.js.map +1 -1
- package/dist/components/index.cjs +8 -0
- package/dist/components/index.d.ts +11 -6
- package/dist/components/index.js +8 -0
- package/dist/config/actions.cjs +138 -171
- package/dist/config/actions.cjs.map +1 -1
- package/dist/config/actions.d.ts +47 -47
- package/dist/config/actions.js +146 -178
- package/dist/config/actions.js.map +1 -1
- package/dist/config/actions_kinds.d.ts +114 -121
- package/dist/config/index.cjs +1 -0
- package/dist/config/index.d.ts +6 -7
- package/dist/config/index.js +1 -0
- package/dist/config/model.d.ts +131 -127
- package/dist/config/model_meta.d.ts +4 -1
- package/dist/config/type_engine.d.ts +22 -21
- package/dist/config/type_util.d.ts +12 -10
- package/dist/env_value.cjs +5 -6
- package/dist/env_value.cjs.map +1 -1
- package/dist/env_value.d.ts +4 -1
- package/dist/env_value.js +5 -5
- package/dist/env_value.js.map +1 -1
- package/dist/filters/converters/filterToQuery.cjs +273 -239
- package/dist/filters/converters/filterToQuery.cjs.map +1 -1
- package/dist/filters/converters/filterToQuery.d.ts +6 -2
- package/dist/filters/converters/filterToQuery.js +272 -237
- package/dist/filters/converters/filterToQuery.js.map +1 -1
- package/dist/filters/converters/filterUiToExpressionImpl.cjs +56 -85
- package/dist/filters/converters/filterUiToExpressionImpl.cjs.map +1 -1
- package/dist/filters/converters/filterUiToExpressionImpl.d.ts +8 -4
- package/dist/filters/converters/filterUiToExpressionImpl.js +55 -83
- package/dist/filters/converters/filterUiToExpressionImpl.js.map +1 -1
- package/dist/filters/converters/index.cjs +2 -0
- package/dist/filters/converters/index.d.ts +2 -3
- package/dist/filters/converters/index.js +2 -0
- package/dist/filters/distill.cjs +59 -60
- package/dist/filters/distill.cjs.map +1 -1
- package/dist/filters/distill.d.ts +6 -3
- package/dist/filters/distill.js +58 -58
- package/dist/filters/distill.js.map +1 -1
- package/dist/filters/index.cjs +4 -0
- package/dist/filters/index.d.ts +5 -4
- package/dist/filters/index.js +4 -0
- package/dist/filters/traverse.cjs +31 -40
- package/dist/filters/traverse.cjs.map +1 -1
- package/dist/filters/traverse.js +31 -39
- package/dist/filters/traverse.js.map +1 -1
- package/dist/filters/types.d.ts +10 -7
- package/dist/index.cjs +193 -187
- package/dist/index.d.ts +61 -28
- package/dist/index.js +49 -41
- package/dist/internal.cjs +48 -62
- package/dist/internal.cjs.map +1 -1
- package/dist/internal.js +49 -60
- package/dist/internal.js.map +1 -1
- package/dist/package.cjs +12 -0
- package/dist/package.cjs.map +1 -0
- package/dist/package.js +6 -0
- package/dist/package.js.map +1 -0
- package/dist/pframe.cjs +32 -37
- package/dist/pframe.cjs.map +1 -1
- package/dist/pframe.d.ts +14 -10
- package/dist/pframe.js +32 -35
- package/dist/pframe.js.map +1 -1
- package/dist/pframe_utils/axes.cjs +81 -114
- package/dist/pframe_utils/axes.cjs.map +1 -1
- package/dist/pframe_utils/axes.d.ts +10 -13
- package/dist/pframe_utils/axes.js +80 -112
- package/dist/pframe_utils/axes.js.map +1 -1
- package/dist/pframe_utils/columns.cjs +61 -81
- package/dist/pframe_utils/columns.cjs.map +1 -1
- package/dist/pframe_utils/columns.d.ts +15 -6
- package/dist/pframe_utils/columns.js +60 -79
- package/dist/pframe_utils/columns.js.map +1 -1
- package/dist/pframe_utils/index.cjs +232 -253
- package/dist/pframe_utils/index.cjs.map +1 -1
- package/dist/pframe_utils/index.d.ts +39 -35
- package/dist/pframe_utils/index.js +231 -251
- package/dist/pframe_utils/index.js.map +1 -1
- package/dist/platforma.d.ts +48 -46
- package/dist/plugin_handle.cjs +6 -14
- package/dist/plugin_handle.cjs.map +1 -1
- package/dist/plugin_handle.d.ts +20 -25
- package/dist/plugin_handle.js +6 -13
- package/dist/plugin_handle.js.map +1 -1
- package/dist/plugin_model.cjs +364 -163
- package/dist/plugin_model.cjs.map +1 -1
- package/dist/plugin_model.d.ts +280 -129
- package/dist/plugin_model.js +362 -163
- package/dist/plugin_model.js.map +1 -1
- package/dist/raw_globals.cjs +10 -22
- package/dist/raw_globals.cjs.map +1 -1
- package/dist/raw_globals.d.ts +8 -5
- package/dist/raw_globals.js +10 -20
- package/dist/raw_globals.js.map +1 -1
- package/dist/ref_util.cjs +14 -13
- package/dist/ref_util.cjs.map +1 -1
- package/dist/ref_util.d.ts +18 -12
- package/dist/ref_util.js +14 -11
- package/dist/ref_util.js.map +1 -1
- package/dist/render/accessor.cjs +213 -226
- package/dist/render/accessor.cjs.map +1 -1
- package/dist/render/accessor.d.ts +115 -120
- package/dist/render/accessor.js +212 -224
- package/dist/render/accessor.js.map +1 -1
- package/dist/render/api.cjs +478 -580
- package/dist/render/api.cjs.map +1 -1
- package/dist/render/api.d.ts +207 -209
- package/dist/render/api.js +476 -578
- package/dist/render/api.js.map +1 -1
- package/dist/render/future.cjs +28 -32
- package/dist/render/future.cjs.map +1 -1
- package/dist/render/future.d.ts +15 -11
- package/dist/render/future.js +28 -30
- package/dist/render/future.js.map +1 -1
- package/dist/render/index.cjs +8 -0
- package/dist/render/index.d.ts +10 -8
- package/dist/render/index.js +8 -0
- package/dist/render/internal.cjs +33 -29
- package/dist/render/internal.cjs.map +1 -1
- package/dist/render/internal.d.ts +78 -72
- package/dist/render/internal.js +29 -26
- package/dist/render/internal.js.map +1 -1
- package/dist/render/traversal_ops.d.ts +42 -43
- package/dist/render/util/axis_filtering.cjs +63 -86
- package/dist/render/util/axis_filtering.cjs.map +1 -1
- package/dist/render/util/axis_filtering.d.ts +10 -7
- package/dist/render/util/axis_filtering.js +63 -85
- package/dist/render/util/axis_filtering.js.map +1 -1
- package/dist/render/util/column_collection.cjs +266 -321
- package/dist/render/util/column_collection.cjs.map +1 -1
- package/dist/render/util/column_collection.d.ts +47 -47
- package/dist/render/util/column_collection.js +264 -319
- package/dist/render/util/column_collection.js.map +1 -1
- package/dist/render/util/index.cjs +4 -0
- package/dist/render/util/index.d.ts +4 -5
- package/dist/render/util/index.js +4 -0
- package/dist/render/util/label.cjs +129 -163
- package/dist/render/util/label.cjs.map +1 -1
- package/dist/render/util/label.d.ts +45 -46
- package/dist/render/util/label.js +128 -161
- package/dist/render/util/label.js.map +1 -1
- package/dist/render/util/pcolumn_data.cjs +315 -375
- package/dist/render/util/pcolumn_data.cjs.map +1 -1
- package/dist/render/util/pcolumn_data.d.ts +33 -32
- package/dist/render/util/pcolumn_data.js +314 -373
- package/dist/render/util/pcolumn_data.js.map +1 -1
- package/dist/render/util/pframe_upgraders.cjs +37 -42
- package/dist/render/util/pframe_upgraders.cjs.map +1 -1
- package/dist/render/util/pframe_upgraders.js +37 -41
- package/dist/render/util/pframe_upgraders.js.map +1 -1
- package/dist/render/util/split_selectors.d.ts +13 -9
- package/dist/version.cjs +6 -8
- package/dist/version.cjs.map +1 -1
- package/dist/version.d.ts +7 -4
- package/dist/version.js +5 -5
- package/dist/version.js.map +1 -1
- package/package.json +15 -9
- package/src/block_migrations.test.ts +184 -14
- package/src/block_migrations.ts +185 -30
- package/src/block_model.ts +111 -66
- package/src/block_storage.test.ts +147 -3
- package/src/block_storage.ts +43 -8
- package/src/block_storage_callbacks.ts +9 -4
- package/src/env_value.ts +0 -2
- package/src/index.ts +12 -11
- package/src/internal.ts +0 -1
- package/src/platforma.ts +4 -4
- package/src/plugin_handle.ts +1 -1
- package/src/plugin_model.test.ts +217 -21
- package/src/plugin_model.ts +450 -55
- package/src/raw_globals.ts +0 -1
- package/dist/annotations/converter.d.ts.map +0 -1
- package/dist/annotations/index.d.ts.map +0 -1
- package/dist/annotations/types.d.ts.map +0 -1
- package/dist/bconfig/index.d.ts.map +0 -1
- package/dist/bconfig/lambdas.d.ts.map +0 -1
- package/dist/bconfig/normalization.d.ts.map +0 -1
- package/dist/bconfig/types.d.ts.map +0 -1
- package/dist/bconfig/util.d.ts.map +0 -1
- package/dist/bconfig/v3.d.ts.map +0 -1
- package/dist/block_api_v1.d.ts.map +0 -1
- package/dist/block_api_v2.d.ts.map +0 -1
- package/dist/block_api_v3.d.ts.map +0 -1
- package/dist/block_migrations.d.ts.map +0 -1
- package/dist/block_model.d.ts.map +0 -1
- package/dist/block_model_legacy.d.ts.map +0 -1
- package/dist/block_state_patch.d.ts.map +0 -1
- package/dist/block_state_util.d.ts.map +0 -1
- package/dist/block_storage.d.ts.map +0 -1
- package/dist/block_storage_callbacks.d.ts +0 -115
- package/dist/block_storage_callbacks.d.ts.map +0 -1
- package/dist/block_storage_facade.d.ts.map +0 -1
- package/dist/components/PFrameForGraphs.d.ts.map +0 -1
- package/dist/components/PlAnnotations/filter.d.ts.map +0 -1
- package/dist/components/PlAnnotations/filters_ui.d.ts.map +0 -1
- package/dist/components/PlAnnotations/index.d.ts.map +0 -1
- package/dist/components/PlAnnotations/types.d.ts +0 -3
- package/dist/components/PlAnnotations/types.d.ts.map +0 -1
- package/dist/components/PlDataTable/index.d.ts.map +0 -1
- package/dist/components/PlDataTable/labels.d.ts +0 -7
- package/dist/components/PlDataTable/labels.d.ts.map +0 -1
- package/dist/components/PlDataTable/state-migration.d.ts.map +0 -1
- package/dist/components/PlDataTable/table.d.ts.map +0 -1
- package/dist/components/PlDataTable/v4.d.ts.map +0 -1
- package/dist/components/PlDataTable/v5.d.ts.map +0 -1
- package/dist/components/PlMultiSequenceAlignment.d.ts.map +0 -1
- package/dist/components/PlSelectionModel.d.ts.map +0 -1
- package/dist/components/index.d.ts.map +0 -1
- package/dist/config/actions.d.ts.map +0 -1
- package/dist/config/actions_kinds.d.ts.map +0 -1
- package/dist/config/index.d.ts.map +0 -1
- package/dist/config/model.d.ts.map +0 -1
- package/dist/config/model_meta.d.ts.map +0 -1
- package/dist/config/type_engine.d.ts.map +0 -1
- package/dist/config/type_util.d.ts.map +0 -1
- package/dist/env_value.d.ts.map +0 -1
- package/dist/filters/converters/filterToQuery.d.ts.map +0 -1
- package/dist/filters/converters/filterUiToExpressionImpl.d.ts.map +0 -1
- package/dist/filters/converters/index.d.ts.map +0 -1
- package/dist/filters/distill.d.ts.map +0 -1
- package/dist/filters/index.d.ts.map +0 -1
- package/dist/filters/traverse.d.ts +0 -27
- package/dist/filters/traverse.d.ts.map +0 -1
- package/dist/filters/types.d.ts.map +0 -1
- package/dist/index.cjs.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/internal.d.ts +0 -36
- package/dist/internal.d.ts.map +0 -1
- package/dist/package.json.cjs +0 -6
- package/dist/package.json.cjs.map +0 -1
- package/dist/package.json.js +0 -4
- package/dist/package.json.js.map +0 -1
- package/dist/pframe.d.ts.map +0 -1
- package/dist/pframe_utils/axes.d.ts.map +0 -1
- package/dist/pframe_utils/columns.d.ts.map +0 -1
- package/dist/pframe_utils/index.d.ts.map +0 -1
- package/dist/pframe_utils/querySpec.d.ts +0 -2
- package/dist/pframe_utils/querySpec.d.ts.map +0 -1
- package/dist/platforma.d.ts.map +0 -1
- package/dist/plugin_handle.d.ts.map +0 -1
- package/dist/plugin_model.d.ts.map +0 -1
- package/dist/raw_globals.d.ts.map +0 -1
- package/dist/ref_util.d.ts.map +0 -1
- package/dist/render/accessor.d.ts.map +0 -1
- package/dist/render/api.d.ts.map +0 -1
- package/dist/render/future.d.ts.map +0 -1
- package/dist/render/index.d.ts.map +0 -1
- package/dist/render/internal.d.ts.map +0 -1
- package/dist/render/traversal_ops.d.ts.map +0 -1
- package/dist/render/util/axis_filtering.d.ts.map +0 -1
- package/dist/render/util/column_collection.d.ts.map +0 -1
- package/dist/render/util/index.d.ts.map +0 -1
- package/dist/render/util/label.d.ts.map +0 -1
- package/dist/render/util/pcolumn_data.d.ts.map +0 -1
- package/dist/render/util/pframe_upgraders.d.ts +0 -3
- package/dist/render/util/pframe_upgraders.d.ts.map +0 -1
- package/dist/render/util/split_selectors.d.ts.map +0 -1
- package/dist/version.d.ts.map +0 -1
|
@@ -1,77 +1,83 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
export
|
|
9
|
-
export type FutureHandle = Branded<string, "FutureHandle">;
|
|
10
|
-
export type PColumnDataUniversal<TreeEntry = TreeNodeAccessor> = TreeEntry | DataInfo<TreeEntry> | PColumnValues;
|
|
11
|
-
export interface GlobalCfgRenderCtxMethods<AHandle = AccessorHandle, FHandle = FutureHandle> {
|
|
12
|
-
getAccessorHandleByName(name: string): AHandle | undefined;
|
|
13
|
-
resolveWithCommon(handle: AHandle, commonOptions: CommonFieldTraverseOps, ...steps: (FieldTraversalStep | string)[]): AHandle | undefined;
|
|
14
|
-
getResourceType(handle: AHandle): ResourceType;
|
|
15
|
-
getInputsLocked(handle: AHandle): boolean;
|
|
16
|
-
getOutputsLocked(handle: AHandle): boolean;
|
|
17
|
-
getIsReadyOrError(handle: AHandle): boolean;
|
|
18
|
-
getIsFinal(handle: AHandle): boolean;
|
|
19
|
-
getError(handle: AHandle): AHandle | undefined;
|
|
20
|
-
listInputFields(handle: AHandle): string[];
|
|
21
|
-
listOutputFields(handle: AHandle): string[];
|
|
22
|
-
listDynamicFields(handle: AHandle): string[];
|
|
23
|
-
getKeyValueBase64(handle: AHandle, key: string): string | undefined;
|
|
24
|
-
getKeyValueAsString(handle: AHandle, key: string): string | undefined;
|
|
25
|
-
getDataBase64(handle: AHandle): string | undefined;
|
|
26
|
-
getDataAsString(handle: AHandle): string | undefined;
|
|
27
|
-
/** If not final returns undefined */
|
|
28
|
-
parsePObjectCollection(handle: AHandle, errorOnUnknownField: boolean, prefix: string, ...resolvePath: string[]): Record<string, PObject<AHandle>> | undefined;
|
|
29
|
-
getBlobContentAsBase64(handle: AHandle, range?: RangeBytes): FHandle;
|
|
30
|
-
getBlobContentAsString(handle: AHandle, range?: RangeBytes): FHandle;
|
|
31
|
-
getDownloadedBlobContentHandle(handle: AHandle): FHandle;
|
|
32
|
-
getOnDemandBlobContentHandle(handle: AHandle): FHandle;
|
|
33
|
-
extractArchiveAndGetURL(handle: AHandle, format: ArchiveFormat): FHandle;
|
|
34
|
-
getImportProgress(handle: AHandle): FHandle;
|
|
35
|
-
getLastLogs(handle: AHandle, nLines: number): FHandle;
|
|
36
|
-
getProgressLog(handle: AHandle, patternToSearch: string): FHandle;
|
|
37
|
-
getProgressLogWithInfo(handle: AHandle, patternToSearch: string): FHandle;
|
|
38
|
-
getLogHandle(handle: AHandle): FHandle;
|
|
39
|
-
/** @deprecated at some point will stop working and will return dummy values */
|
|
40
|
-
getBlockLabel(blockId: string): string;
|
|
41
|
-
getDataFromResultPool(): ResultCollection<PObject<AHandle>>;
|
|
42
|
-
getDataWithErrorsFromResultPool(): ResultCollection<Optional<PObject<ValueOrError<AHandle, Error>>, "id">>;
|
|
43
|
-
getSpecsFromResultPool(): ResultCollection<PObjectSpec>;
|
|
44
|
-
getSpecFromResultPoolByRef(blockId: string, exportName: string): PObjectSpec | undefined;
|
|
45
|
-
getDataFromResultPoolByRef(blockId: string, exportName: string): PObject<AHandle> | undefined;
|
|
46
|
-
calculateOptions(predicate: PSpecPredicate): Option[];
|
|
47
|
-
createPFrame(def: PFrameDef<PColumn<AHandle | PColumnValues | DataInfo<AHandle>>>): PFrameHandle;
|
|
48
|
-
createPTable(def: PTableDef<PColumn<AHandle | PColumnValues | DataInfo<AHandle>>>): PTableHandle;
|
|
49
|
-
createPTableV2(def: PTableDefV2<PColumn<AHandle | PColumnValues | DataInfo<AHandle>>>): PTableHandle;
|
|
50
|
-
getCurrentUnstableMarker(): string | undefined;
|
|
51
|
-
logInfo(message: string): void;
|
|
52
|
-
logWarn(message: string): void;
|
|
53
|
-
logError(message: string): void;
|
|
1
|
+
import { CommonFieldTraverseOps, FieldTraversalStep, ResourceType } from "./traversal_ops.js";
|
|
2
|
+
import { TreeNodeAccessor } from "./accessor.js";
|
|
3
|
+
import { AnyFunction, ArchiveFormat, Branded, DataInfo, Option, PColumn, PColumnValues, PFrameDef, PFrameHandle, PObject, PObjectSpec, PSpecPredicate, PTableDef, PTableDefV2, PTableHandle, RangeBytes, ResultCollection, StringifiedJson, ValueOrError } from "@milaboratories/pl-model-common";
|
|
4
|
+
import { Optional } from "utility-types";
|
|
5
|
+
|
|
6
|
+
//#region src/render/internal.d.ts
|
|
7
|
+
declare namespace internal_d_exports {
|
|
8
|
+
export { AccessorHandle, FutureAwait, FutureHandle, GlobalCfgRenderCtx, GlobalCfgRenderCtxFeatureFlags, GlobalCfgRenderCtxMethods, MainAccessorName, PColumnDataUniversal, StagingAccessorName, getAllFutureAwaits, isFutureAwait };
|
|
54
9
|
}
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
10
|
+
declare const StagingAccessorName = "staging";
|
|
11
|
+
declare const MainAccessorName = "main";
|
|
12
|
+
type AccessorHandle = Branded<string, "AccessorHandle">;
|
|
13
|
+
type FutureHandle = Branded<string, "FutureHandle">;
|
|
14
|
+
type PColumnDataUniversal<TreeEntry = TreeNodeAccessor> = TreeEntry | DataInfo<TreeEntry> | PColumnValues;
|
|
15
|
+
interface GlobalCfgRenderCtxMethods<AHandle = AccessorHandle, FHandle = FutureHandle> {
|
|
16
|
+
getAccessorHandleByName(name: string): AHandle | undefined;
|
|
17
|
+
resolveWithCommon(handle: AHandle, commonOptions: CommonFieldTraverseOps, ...steps: (FieldTraversalStep | string)[]): AHandle | undefined;
|
|
18
|
+
getResourceType(handle: AHandle): ResourceType;
|
|
19
|
+
getInputsLocked(handle: AHandle): boolean;
|
|
20
|
+
getOutputsLocked(handle: AHandle): boolean;
|
|
21
|
+
getIsReadyOrError(handle: AHandle): boolean;
|
|
22
|
+
getIsFinal(handle: AHandle): boolean;
|
|
23
|
+
getError(handle: AHandle): AHandle | undefined;
|
|
24
|
+
listInputFields(handle: AHandle): string[];
|
|
25
|
+
listOutputFields(handle: AHandle): string[];
|
|
26
|
+
listDynamicFields(handle: AHandle): string[];
|
|
27
|
+
getKeyValueBase64(handle: AHandle, key: string): string | undefined;
|
|
28
|
+
getKeyValueAsString(handle: AHandle, key: string): string | undefined;
|
|
29
|
+
getDataBase64(handle: AHandle): string | undefined;
|
|
30
|
+
getDataAsString(handle: AHandle): string | undefined;
|
|
31
|
+
/** If not final returns undefined */
|
|
32
|
+
parsePObjectCollection(handle: AHandle, errorOnUnknownField: boolean, prefix: string, ...resolvePath: string[]): Record<string, PObject<AHandle>> | undefined;
|
|
33
|
+
getBlobContentAsBase64(handle: AHandle, range?: RangeBytes): FHandle;
|
|
34
|
+
getBlobContentAsString(handle: AHandle, range?: RangeBytes): FHandle;
|
|
35
|
+
getDownloadedBlobContentHandle(handle: AHandle): FHandle;
|
|
36
|
+
getOnDemandBlobContentHandle(handle: AHandle): FHandle;
|
|
37
|
+
extractArchiveAndGetURL(handle: AHandle, format: ArchiveFormat): FHandle;
|
|
38
|
+
getImportProgress(handle: AHandle): FHandle;
|
|
39
|
+
getLastLogs(handle: AHandle, nLines: number): FHandle;
|
|
40
|
+
getProgressLog(handle: AHandle, patternToSearch: string): FHandle;
|
|
41
|
+
getProgressLogWithInfo(handle: AHandle, patternToSearch: string): FHandle;
|
|
42
|
+
getLogHandle(handle: AHandle): FHandle;
|
|
43
|
+
/** @deprecated at some point will stop working and will return dummy values */
|
|
44
|
+
getBlockLabel(blockId: string): string;
|
|
45
|
+
getDataFromResultPool(): ResultCollection<PObject<AHandle>>;
|
|
46
|
+
getDataWithErrorsFromResultPool(): ResultCollection<Optional<PObject<ValueOrError<AHandle, Error>>, "id">>;
|
|
47
|
+
getSpecsFromResultPool(): ResultCollection<PObjectSpec>;
|
|
48
|
+
getSpecFromResultPoolByRef(blockId: string, exportName: string): PObjectSpec | undefined;
|
|
49
|
+
getDataFromResultPoolByRef(blockId: string, exportName: string): PObject<AHandle> | undefined;
|
|
50
|
+
calculateOptions(predicate: PSpecPredicate): Option[];
|
|
51
|
+
createPFrame(def: PFrameDef<PColumn<AHandle | PColumnValues | DataInfo<AHandle>>>): PFrameHandle;
|
|
52
|
+
createPTable(def: PTableDef<PColumn<AHandle | PColumnValues | DataInfo<AHandle>>>): PTableHandle;
|
|
53
|
+
createPTableV2(def: PTableDefV2<PColumn<AHandle | PColumnValues | DataInfo<AHandle>>>): PTableHandle;
|
|
54
|
+
getCurrentUnstableMarker(): string | undefined;
|
|
55
|
+
logInfo(message: string): void;
|
|
56
|
+
logWarn(message: string): void;
|
|
57
|
+
logError(message: string): void;
|
|
58
|
+
}
|
|
59
|
+
declare const GlobalCfgRenderCtxFeatureFlags: {
|
|
60
|
+
explicitColumnsSupport: true;
|
|
61
|
+
inlineColumnsSupport: true;
|
|
62
|
+
activeArgs: true;
|
|
63
|
+
pTablePartitionFiltersSupport: true;
|
|
64
|
+
pFrameInSetFilterSupport: true;
|
|
61
65
|
};
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
66
|
+
interface GlobalCfgRenderCtx extends GlobalCfgRenderCtxMethods {
|
|
67
|
+
readonly args: string | (() => string);
|
|
68
|
+
/** @deprecated Use `data` instead. Optional for backward compatibility - falls back to `data` if not injected. */
|
|
69
|
+
readonly uiState?: string | (() => string);
|
|
70
|
+
readonly data: string | (() => string);
|
|
71
|
+
readonly activeArgs: undefined | string | (() => string | undefined);
|
|
72
|
+
readonly blockStorage: () => StringifiedJson;
|
|
73
|
+
readonly callbackRegistry: Record<string, AnyFunction>;
|
|
74
|
+
readonly featureFlags?: typeof GlobalCfgRenderCtxFeatureFlags;
|
|
71
75
|
}
|
|
72
|
-
|
|
73
|
-
|
|
76
|
+
type FutureAwait = {
|
|
77
|
+
__awaited_futures__: FutureHandle[];
|
|
74
78
|
};
|
|
75
|
-
|
|
76
|
-
|
|
79
|
+
declare function isFutureAwait(obj: unknown): obj is FutureAwait;
|
|
80
|
+
declare function getAllFutureAwaits(obj: unknown): Set<string>;
|
|
81
|
+
//#endregion
|
|
82
|
+
export { AccessorHandle, FutureAwait, FutureHandle, GlobalCfgRenderCtx, PColumnDataUniversal, internal_d_exports };
|
|
77
83
|
//# sourceMappingURL=internal.d.ts.map
|
package/dist/render/internal.js
CHANGED
|
@@ -1,37 +1,40 @@
|
|
|
1
|
+
import { __exportAll } from "../_virtual/_rolldown/runtime.js";
|
|
2
|
+
|
|
3
|
+
//#region src/render/internal.ts
|
|
4
|
+
var internal_exports = /* @__PURE__ */ __exportAll({
|
|
5
|
+
GlobalCfgRenderCtxFeatureFlags: () => GlobalCfgRenderCtxFeatureFlags,
|
|
6
|
+
MainAccessorName: () => MainAccessorName,
|
|
7
|
+
StagingAccessorName: () => StagingAccessorName,
|
|
8
|
+
getAllFutureAwaits: () => getAllFutureAwaits,
|
|
9
|
+
isFutureAwait: () => isFutureAwait
|
|
10
|
+
});
|
|
1
11
|
const StagingAccessorName = "staging";
|
|
2
12
|
const MainAccessorName = "main";
|
|
3
13
|
const GlobalCfgRenderCtxFeatureFlags = {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
14
|
+
explicitColumnsSupport: true,
|
|
15
|
+
inlineColumnsSupport: true,
|
|
16
|
+
activeArgs: true,
|
|
17
|
+
pTablePartitionFiltersSupport: true,
|
|
18
|
+
pFrameInSetFilterSupport: true
|
|
9
19
|
};
|
|
10
20
|
function isFutureAwait(obj) {
|
|
11
|
-
|
|
21
|
+
return typeof obj === "object" && obj !== null && "__awaited_futures__" in obj;
|
|
12
22
|
}
|
|
13
23
|
function addAllFutureAwaits(set, visited, node) {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
else if (Array.isArray(node))
|
|
22
|
-
for (const nested of node)
|
|
23
|
-
addAllFutureAwaits(set, visited, nested);
|
|
24
|
-
else
|
|
25
|
-
for (const [, nested] of Object.entries(node))
|
|
26
|
-
if (nested !== node)
|
|
27
|
-
addAllFutureAwaits(set, visited, nested);
|
|
28
|
-
}
|
|
24
|
+
if (visited.has(node)) return;
|
|
25
|
+
visited.add(node);
|
|
26
|
+
if (typeof node === "object") {
|
|
27
|
+
if (isFutureAwait(node)) node.__awaited_futures__.forEach((a) => set.add(a));
|
|
28
|
+
else if (Array.isArray(node)) for (const nested of node) addAllFutureAwaits(set, visited, nested);
|
|
29
|
+
else for (const [, nested] of Object.entries(node)) if (nested !== node) addAllFutureAwaits(set, visited, nested);
|
|
30
|
+
}
|
|
29
31
|
}
|
|
30
32
|
function getAllFutureAwaits(obj) {
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
33
|
+
const set = /* @__PURE__ */ new Set();
|
|
34
|
+
addAllFutureAwaits(set, /* @__PURE__ */ new Set(), obj);
|
|
35
|
+
return set;
|
|
34
36
|
}
|
|
35
37
|
|
|
36
|
-
|
|
37
|
-
|
|
38
|
+
//#endregion
|
|
39
|
+
export { MainAccessorName, StagingAccessorName, internal_exports };
|
|
40
|
+
//# sourceMappingURL=internal.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"internal.js","sources":["../../src/render/internal.ts"],"sourcesContent":["import type { Optional } from \"utility-types\";\nimport type { Branded, StringifiedJson } from \"@milaboratories/pl-model-common\";\nimport type { CommonFieldTraverseOps, FieldTraversalStep, ResourceType } from \"./traversal_ops\";\nimport type {\n ArchiveFormat,\n AnyFunction,\n Option,\n PColumn,\n PColumnValues,\n PFrameDef,\n PFrameHandle,\n PObject,\n PObjectSpec,\n PSpecPredicate,\n PTableDef,\n PTableDefV2,\n PTableHandle,\n ResultCollection,\n ValueOrError,\n DataInfo,\n RangeBytes,\n} from \"@milaboratories/pl-model-common\";\nimport type { TreeNodeAccessor } from \"./accessor\";\n\nexport const StagingAccessorName = \"staging\";\nexport const MainAccessorName = \"main\";\n\nexport type AccessorHandle = Branded<string, \"AccessorHandle\">;\nexport type FutureHandle = Branded<string, \"FutureHandle\">;\n\nexport type PColumnDataUniversal<TreeEntry = TreeNodeAccessor> =\n | TreeEntry\n | DataInfo<TreeEntry>\n | PColumnValues;\n\nexport interface GlobalCfgRenderCtxMethods<AHandle = AccessorHandle, FHandle = FutureHandle> {\n //\n // Root accessor creation\n //\n\n getAccessorHandleByName(name: string): AHandle | undefined;\n\n //\n // Basic resource accessor actions\n //\n\n resolveWithCommon(\n handle: AHandle,\n commonOptions: CommonFieldTraverseOps,\n ...steps: (FieldTraversalStep | string)[]\n ): AHandle | undefined;\n\n getResourceType(handle: AHandle): ResourceType;\n\n getInputsLocked(handle: AHandle): boolean;\n\n getOutputsLocked(handle: AHandle): boolean;\n\n getIsReadyOrError(handle: AHandle): boolean;\n\n getIsFinal(handle: AHandle): boolean;\n\n getError(handle: AHandle): AHandle | undefined;\n\n listInputFields(handle: AHandle): string[];\n\n listOutputFields(handle: AHandle): string[];\n\n listDynamicFields(handle: AHandle): string[];\n\n getKeyValueBase64(handle: AHandle, key: string): string | undefined;\n\n getKeyValueAsString(handle: AHandle, key: string): string | undefined;\n\n getDataBase64(handle: AHandle): string | undefined;\n\n getDataAsString(handle: AHandle): string | undefined;\n\n /** If not final returns undefined */\n parsePObjectCollection(\n handle: AHandle,\n errorOnUnknownField: boolean,\n prefix: string,\n ...resolvePath: string[]\n ): Record<string, PObject<AHandle>> | undefined;\n\n //\n // Blob\n //\n\n getBlobContentAsBase64(handle: AHandle, range?: RangeBytes): FHandle; // string | undefined\n\n getBlobContentAsString(handle: AHandle, range?: RangeBytes): FHandle; // string | undefined\n\n getDownloadedBlobContentHandle(handle: AHandle): FHandle; // LocalBlobHandleAndSize | undefined;\n\n getOnDemandBlobContentHandle(handle: AHandle): FHandle; // RemoteBlobHandleAndSize | undefined;\n\n //\n // Blobs to URLs\n //\n\n extractArchiveAndGetURL(handle: AHandle, format: ArchiveFormat): FHandle;\n\n //\n // Import progress\n //\n\n getImportProgress(handle: AHandle): FHandle; // ImportProgress;\n\n //\n // Logs\n //\n\n getLastLogs(handle: AHandle, nLines: number): FHandle; // string | undefined;\n\n getProgressLog(handle: AHandle, patternToSearch: string): FHandle; // string | undefined;\n\n getProgressLogWithInfo(handle: AHandle, patternToSearch: string): FHandle; // ProgressLogWithInfo | undefined;\n\n getLogHandle(handle: AHandle): FHandle; // AnyLogHandle | undefined;\n\n //\n // Blocks\n //\n\n /** @deprecated at some point will stop working and will return dummy values */\n getBlockLabel(blockId: string): string;\n\n //\n // Result Pool\n //\n\n getDataFromResultPool(): ResultCollection<PObject<AHandle>>;\n\n getDataWithErrorsFromResultPool(): ResultCollection<\n Optional<PObject<ValueOrError<AHandle, Error>>, \"id\">\n >;\n\n getSpecsFromResultPool(): ResultCollection<PObjectSpec>;\n\n getSpecFromResultPoolByRef(blockId: string, exportName: string): PObjectSpec | undefined;\n\n getDataFromResultPoolByRef(blockId: string, exportName: string): PObject<AHandle> | undefined;\n\n calculateOptions(predicate: PSpecPredicate): Option[];\n\n //\n // PFrame / PTable\n //\n\n createPFrame(def: PFrameDef<PColumn<AHandle | PColumnValues | DataInfo<AHandle>>>): PFrameHandle;\n\n createPTable(def: PTableDef<PColumn<AHandle | PColumnValues | DataInfo<AHandle>>>): PTableHandle;\n\n createPTableV2(\n def: PTableDefV2<PColumn<AHandle | PColumnValues | DataInfo<AHandle>>>,\n ): PTableHandle;\n\n //\n // Computable\n //\n\n getCurrentUnstableMarker(): string | undefined;\n\n //\n // Logging\n //\n\n logInfo(message: string): void;\n\n logWarn(message: string): void;\n\n logError(message: string): void;\n}\n\nexport const GlobalCfgRenderCtxFeatureFlags = {\n explicitColumnsSupport: true as const,\n inlineColumnsSupport: true as const,\n activeArgs: true as const,\n pTablePartitionFiltersSupport: true as const,\n pFrameInSetFilterSupport: true as const,\n};\n\nexport interface GlobalCfgRenderCtx extends GlobalCfgRenderCtxMethods {\n //\n // State: Args, UI State, Active Args\n //\n // Old runtime injects these values as strings, new runtime injects them as functions\n // that return strings, if block declares supportsLazyState flag.\n // If function not called in lazy state API, then resulting output will not depend on these values,\n // and thus will not be recalculated on corresponding state change.\n //\n\n readonly args: string | (() => string);\n /** @deprecated Use `data` instead. Optional for backward compatibility - falls back to `data` if not injected. */\n readonly uiState?: string | (() => string);\n readonly data: string | (() => string);\n readonly activeArgs: undefined | string | (() => string | undefined);\n\n readonly blockStorage: () => StringifiedJson;\n\n // Note: strings below are used because, anyway, using strings is the only way\n // to get data inside the QuickJS context, as it is implemented now. With this\n // approach deserialization can be lazily postponed until it is actually needed.\n readonly callbackRegistry: Record<string, AnyFunction>;\n readonly featureFlags?: typeof GlobalCfgRenderCtxFeatureFlags;\n}\n\nexport type FutureAwait = {\n __awaited_futures__: FutureHandle[];\n};\n\nexport function isFutureAwait(obj: unknown): obj is FutureAwait {\n return typeof obj === \"object\" && obj !== null && \"__awaited_futures__\" in obj;\n}\n\nfunction addAllFutureAwaits(set: Set<string>, visited: Set<unknown>, node: unknown) {\n if (visited.has(node)) return;\n visited.add(node);\n\n const type = typeof node;\n if (type === \"object\") {\n if (isFutureAwait(node)) node.__awaited_futures__.forEach((a) => set.add(a));\n else if (Array.isArray(node))\n for (const nested of node) addAllFutureAwaits(set, visited, nested);\n else\n for (const [, nested] of Object.entries(node as object))\n if (nested !== node) addAllFutureAwaits(set, visited, nested);\n }\n}\n\nexport function getAllFutureAwaits(obj: unknown): Set<string> {\n const set = new Set<string>();\n addAllFutureAwaits(set, new Set(), obj);\n return set;\n}\n"],"
|
|
1
|
+
{"version":3,"file":"internal.js","names":[],"sources":["../../src/render/internal.ts"],"sourcesContent":["import type { Optional } from \"utility-types\";\nimport type { Branded, StringifiedJson } from \"@milaboratories/pl-model-common\";\nimport type { CommonFieldTraverseOps, FieldTraversalStep, ResourceType } from \"./traversal_ops\";\nimport type {\n ArchiveFormat,\n AnyFunction,\n Option,\n PColumn,\n PColumnValues,\n PFrameDef,\n PFrameHandle,\n PObject,\n PObjectSpec,\n PSpecPredicate,\n PTableDef,\n PTableDefV2,\n PTableHandle,\n ResultCollection,\n ValueOrError,\n DataInfo,\n RangeBytes,\n} from \"@milaboratories/pl-model-common\";\nimport type { TreeNodeAccessor } from \"./accessor\";\n\nexport const StagingAccessorName = \"staging\";\nexport const MainAccessorName = \"main\";\n\nexport type AccessorHandle = Branded<string, \"AccessorHandle\">;\nexport type FutureHandle = Branded<string, \"FutureHandle\">;\n\nexport type PColumnDataUniversal<TreeEntry = TreeNodeAccessor> =\n | TreeEntry\n | DataInfo<TreeEntry>\n | PColumnValues;\n\nexport interface GlobalCfgRenderCtxMethods<AHandle = AccessorHandle, FHandle = FutureHandle> {\n //\n // Root accessor creation\n //\n\n getAccessorHandleByName(name: string): AHandle | undefined;\n\n //\n // Basic resource accessor actions\n //\n\n resolveWithCommon(\n handle: AHandle,\n commonOptions: CommonFieldTraverseOps,\n ...steps: (FieldTraversalStep | string)[]\n ): AHandle | undefined;\n\n getResourceType(handle: AHandle): ResourceType;\n\n getInputsLocked(handle: AHandle): boolean;\n\n getOutputsLocked(handle: AHandle): boolean;\n\n getIsReadyOrError(handle: AHandle): boolean;\n\n getIsFinal(handle: AHandle): boolean;\n\n getError(handle: AHandle): AHandle | undefined;\n\n listInputFields(handle: AHandle): string[];\n\n listOutputFields(handle: AHandle): string[];\n\n listDynamicFields(handle: AHandle): string[];\n\n getKeyValueBase64(handle: AHandle, key: string): string | undefined;\n\n getKeyValueAsString(handle: AHandle, key: string): string | undefined;\n\n getDataBase64(handle: AHandle): string | undefined;\n\n getDataAsString(handle: AHandle): string | undefined;\n\n /** If not final returns undefined */\n parsePObjectCollection(\n handle: AHandle,\n errorOnUnknownField: boolean,\n prefix: string,\n ...resolvePath: string[]\n ): Record<string, PObject<AHandle>> | undefined;\n\n //\n // Blob\n //\n\n getBlobContentAsBase64(handle: AHandle, range?: RangeBytes): FHandle; // string | undefined\n\n getBlobContentAsString(handle: AHandle, range?: RangeBytes): FHandle; // string | undefined\n\n getDownloadedBlobContentHandle(handle: AHandle): FHandle; // LocalBlobHandleAndSize | undefined;\n\n getOnDemandBlobContentHandle(handle: AHandle): FHandle; // RemoteBlobHandleAndSize | undefined;\n\n //\n // Blobs to URLs\n //\n\n extractArchiveAndGetURL(handle: AHandle, format: ArchiveFormat): FHandle;\n\n //\n // Import progress\n //\n\n getImportProgress(handle: AHandle): FHandle; // ImportProgress;\n\n //\n // Logs\n //\n\n getLastLogs(handle: AHandle, nLines: number): FHandle; // string | undefined;\n\n getProgressLog(handle: AHandle, patternToSearch: string): FHandle; // string | undefined;\n\n getProgressLogWithInfo(handle: AHandle, patternToSearch: string): FHandle; // ProgressLogWithInfo | undefined;\n\n getLogHandle(handle: AHandle): FHandle; // AnyLogHandle | undefined;\n\n //\n // Blocks\n //\n\n /** @deprecated at some point will stop working and will return dummy values */\n getBlockLabel(blockId: string): string;\n\n //\n // Result Pool\n //\n\n getDataFromResultPool(): ResultCollection<PObject<AHandle>>;\n\n getDataWithErrorsFromResultPool(): ResultCollection<\n Optional<PObject<ValueOrError<AHandle, Error>>, \"id\">\n >;\n\n getSpecsFromResultPool(): ResultCollection<PObjectSpec>;\n\n getSpecFromResultPoolByRef(blockId: string, exportName: string): PObjectSpec | undefined;\n\n getDataFromResultPoolByRef(blockId: string, exportName: string): PObject<AHandle> | undefined;\n\n calculateOptions(predicate: PSpecPredicate): Option[];\n\n //\n // PFrame / PTable\n //\n\n createPFrame(def: PFrameDef<PColumn<AHandle | PColumnValues | DataInfo<AHandle>>>): PFrameHandle;\n\n createPTable(def: PTableDef<PColumn<AHandle | PColumnValues | DataInfo<AHandle>>>): PTableHandle;\n\n createPTableV2(\n def: PTableDefV2<PColumn<AHandle | PColumnValues | DataInfo<AHandle>>>,\n ): PTableHandle;\n\n //\n // Computable\n //\n\n getCurrentUnstableMarker(): string | undefined;\n\n //\n // Logging\n //\n\n logInfo(message: string): void;\n\n logWarn(message: string): void;\n\n logError(message: string): void;\n}\n\nexport const GlobalCfgRenderCtxFeatureFlags = {\n explicitColumnsSupport: true as const,\n inlineColumnsSupport: true as const,\n activeArgs: true as const,\n pTablePartitionFiltersSupport: true as const,\n pFrameInSetFilterSupport: true as const,\n};\n\nexport interface GlobalCfgRenderCtx extends GlobalCfgRenderCtxMethods {\n //\n // State: Args, UI State, Active Args\n //\n // Old runtime injects these values as strings, new runtime injects them as functions\n // that return strings, if block declares supportsLazyState flag.\n // If function not called in lazy state API, then resulting output will not depend on these values,\n // and thus will not be recalculated on corresponding state change.\n //\n\n readonly args: string | (() => string);\n /** @deprecated Use `data` instead. Optional for backward compatibility - falls back to `data` if not injected. */\n readonly uiState?: string | (() => string);\n readonly data: string | (() => string);\n readonly activeArgs: undefined | string | (() => string | undefined);\n\n readonly blockStorage: () => StringifiedJson;\n\n // Note: strings below are used because, anyway, using strings is the only way\n // to get data inside the QuickJS context, as it is implemented now. With this\n // approach deserialization can be lazily postponed until it is actually needed.\n readonly callbackRegistry: Record<string, AnyFunction>;\n readonly featureFlags?: typeof GlobalCfgRenderCtxFeatureFlags;\n}\n\nexport type FutureAwait = {\n __awaited_futures__: FutureHandle[];\n};\n\nexport function isFutureAwait(obj: unknown): obj is FutureAwait {\n return typeof obj === \"object\" && obj !== null && \"__awaited_futures__\" in obj;\n}\n\nfunction addAllFutureAwaits(set: Set<string>, visited: Set<unknown>, node: unknown) {\n if (visited.has(node)) return;\n visited.add(node);\n\n const type = typeof node;\n if (type === \"object\") {\n if (isFutureAwait(node)) node.__awaited_futures__.forEach((a) => set.add(a));\n else if (Array.isArray(node))\n for (const nested of node) addAllFutureAwaits(set, visited, nested);\n else\n for (const [, nested] of Object.entries(node as object))\n if (nested !== node) addAllFutureAwaits(set, visited, nested);\n }\n}\n\nexport function getAllFutureAwaits(obj: unknown): Set<string> {\n const set = new Set<string>();\n addAllFutureAwaits(set, new Set(), obj);\n return set;\n}\n"],"mappings":";;;;;;;;;;AAwBA,MAAa,sBAAsB;AACnC,MAAa,mBAAmB;AAuJhC,MAAa,iCAAiC;CAC5C,wBAAwB;CACxB,sBAAsB;CACtB,YAAY;CACZ,+BAA+B;CAC/B,0BAA0B;CAC3B;AA+BD,SAAgB,cAAc,KAAkC;AAC9D,QAAO,OAAO,QAAQ,YAAY,QAAQ,QAAQ,yBAAyB;;AAG7E,SAAS,mBAAmB,KAAkB,SAAuB,MAAe;AAClF,KAAI,QAAQ,IAAI,KAAK,CAAE;AACvB,SAAQ,IAAI,KAAK;AAGjB,KADa,OAAO,SACP,UACX;MAAI,cAAc,KAAK,CAAE,MAAK,oBAAoB,SAAS,MAAM,IAAI,IAAI,EAAE,CAAC;WACnE,MAAM,QAAQ,KAAK,CAC1B,MAAK,MAAM,UAAU,KAAM,oBAAmB,KAAK,SAAS,OAAO;MAEnE,MAAK,MAAM,GAAG,WAAW,OAAO,QAAQ,KAAe,CACrD,KAAI,WAAW,KAAM,oBAAmB,KAAK,SAAS,OAAO;;;AAIrE,SAAgB,mBAAmB,KAA2B;CAC5D,MAAM,sBAAM,IAAI,KAAa;AAC7B,oBAAmB,qBAAK,IAAI,KAAK,EAAE,IAAI;AACvC,QAAO"}
|
|
@@ -1,49 +1,48 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
1
|
+
//#region src/render/traversal_ops.d.ts
|
|
2
|
+
type CommonTraversalOps = {
|
|
3
|
+
/**
|
|
4
|
+
* Don't terminate chain if current resource or field has an error associated
|
|
5
|
+
* with, by default resource or field error will be thrown. If field has error
|
|
6
|
+
* and no value, error will be thrown anyway, because this is the reason
|
|
7
|
+
* traversal is terminated.
|
|
8
|
+
* */
|
|
9
|
+
ignoreError?: true;
|
|
9
10
|
};
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
stableIfNotFound?: true;
|
|
11
|
+
type CommonFieldTraverseOps = {
|
|
12
|
+
/**
|
|
13
|
+
* Valid only if {@link assertFieldType} is defined and equal to 'Input',
|
|
14
|
+
* 'Service' or 'Output'. By default, if field is not found, and corresponding
|
|
15
|
+
* field list is locked, call will fail with exception.
|
|
16
|
+
* */
|
|
17
|
+
allowPermanentAbsence?: true; /** Will not mark current context as unstable, if field is not found. */
|
|
18
|
+
stableIfNotFound?: true;
|
|
19
19
|
};
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
20
|
+
type FieldType = "Input" | "Output" | "Service" | "OTW" | "Dynamic" | "MTW";
|
|
21
|
+
interface ResourceType {
|
|
22
|
+
readonly name: string;
|
|
23
|
+
readonly version: string;
|
|
24
24
|
}
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
25
|
+
type ResourceTraversalOps = CommonTraversalOps & {
|
|
26
|
+
/**
|
|
27
|
+
* Assert resource type of the resource the fields points to. Call will fail
|
|
28
|
+
* with exception if this assertion is not fulfilled.
|
|
29
|
+
* */
|
|
30
|
+
assertResourceType?: ResourceType | ResourceType[];
|
|
31
31
|
};
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
* ide to specify it.
|
|
45
|
-
* */
|
|
46
|
-
assertFieldType?: FieldType;
|
|
32
|
+
type GetFieldStep = CommonFieldTraverseOps & {
|
|
33
|
+
/** Field name */field: string; /** Field must exist, if this option is set, instead error will be thrown */
|
|
34
|
+
errorIfFieldNotFound?: true; /** Field must be assigned a value, if this option is set, instead error will be thrown */
|
|
35
|
+
errorIfFieldNotSet?: true;
|
|
36
|
+
/**
|
|
37
|
+
* Assert field type.
|
|
38
|
+
* Call will fail with exception if this assertion is not fulfilled.
|
|
39
|
+
* The information about expectedFieldType is also used for stability
|
|
40
|
+
* calculation and field absence error generation, so it is always a good
|
|
41
|
+
* ide to specify it.
|
|
42
|
+
* */
|
|
43
|
+
assertFieldType?: FieldType;
|
|
47
44
|
};
|
|
48
|
-
|
|
45
|
+
type FieldTraversalStep = GetFieldStep & ResourceTraversalOps;
|
|
46
|
+
//#endregion
|
|
47
|
+
export { CommonFieldTraverseOps, CommonTraversalOps, FieldTraversalStep, FieldType, GetFieldStep, ResourceTraversalOps, ResourceType };
|
|
49
48
|
//# sourceMappingURL=traversal_ops.d.ts.map
|
|
@@ -1,91 +1,68 @@
|
|
|
1
|
-
'use strict';
|
|
2
1
|
|
|
2
|
+
//#region src/render/util/axis_filtering.ts
|
|
3
3
|
function filterDataInfoEntries(dataInfoEntries, axisFilters) {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
};
|
|
65
|
-
case "BinaryPartitioned":
|
|
66
|
-
return {
|
|
67
|
-
type: "BinaryPartitioned",
|
|
68
|
-
partitionKeyLength: dataInfoEntries.partitionKeyLength - axisFilters.length,
|
|
69
|
-
parts: dataInfoEntries.parts
|
|
70
|
-
.filter((entry) => keyMatchesFilters(entry.key))
|
|
71
|
-
.map((entry) => ({
|
|
72
|
-
key: removeFilteredAxes(entry.key),
|
|
73
|
-
value: entry.value,
|
|
74
|
-
})),
|
|
75
|
-
};
|
|
76
|
-
case "ParquetPartitioned":
|
|
77
|
-
return {
|
|
78
|
-
type: "ParquetPartitioned",
|
|
79
|
-
partitionKeyLength: dataInfoEntries.partitionKeyLength - axisFilters.length,
|
|
80
|
-
parts: dataInfoEntries.parts
|
|
81
|
-
.filter((entry) => keyMatchesFilters(entry.key))
|
|
82
|
-
.map((entry) => ({
|
|
83
|
-
key: removeFilteredAxes(entry.key),
|
|
84
|
-
value: entry.value,
|
|
85
|
-
})),
|
|
86
|
-
};
|
|
87
|
-
}
|
|
4
|
+
const sortedFilters = [...axisFilters].sort((a, b) => b[0] - a[0]);
|
|
5
|
+
const { type } = dataInfoEntries;
|
|
6
|
+
switch (type) {
|
|
7
|
+
case "Json": {
|
|
8
|
+
const { keyLength } = dataInfoEntries;
|
|
9
|
+
for (const [axisIdx] of axisFilters) if (axisIdx >= keyLength) throw new Error(`Can't filter on non-data axis ${axisIdx}. Must be >= ${keyLength}`);
|
|
10
|
+
break;
|
|
11
|
+
}
|
|
12
|
+
case "JsonPartitioned":
|
|
13
|
+
case "BinaryPartitioned":
|
|
14
|
+
case "ParquetPartitioned": {
|
|
15
|
+
const { partitionKeyLength } = dataInfoEntries;
|
|
16
|
+
for (const [axisIdx] of axisFilters) if (axisIdx >= partitionKeyLength) throw new Error(`Can't filter on non-partitioned axis ${axisIdx}. Must be >= ${partitionKeyLength}`);
|
|
17
|
+
break;
|
|
18
|
+
}
|
|
19
|
+
default: throw new Error(`Unsupported data info type: ${type}`);
|
|
20
|
+
}
|
|
21
|
+
const keyMatchesFilters = (key) => {
|
|
22
|
+
for (const [axisIdx, axisValue] of sortedFilters) if (key[axisIdx] !== axisValue) return false;
|
|
23
|
+
return true;
|
|
24
|
+
};
|
|
25
|
+
const removeFilteredAxes = (key) => {
|
|
26
|
+
const newKey = [...key];
|
|
27
|
+
for (const [axisIdx] of sortedFilters) newKey.splice(axisIdx, 1);
|
|
28
|
+
return newKey;
|
|
29
|
+
};
|
|
30
|
+
switch (dataInfoEntries.type) {
|
|
31
|
+
case "Json": return {
|
|
32
|
+
type: "Json",
|
|
33
|
+
keyLength: dataInfoEntries.keyLength - axisFilters.length,
|
|
34
|
+
data: dataInfoEntries.data.filter((entry) => keyMatchesFilters(entry.key)).map((entry) => ({
|
|
35
|
+
key: removeFilteredAxes(entry.key),
|
|
36
|
+
value: entry.value
|
|
37
|
+
}))
|
|
38
|
+
};
|
|
39
|
+
case "JsonPartitioned": return {
|
|
40
|
+
type: "JsonPartitioned",
|
|
41
|
+
partitionKeyLength: dataInfoEntries.partitionKeyLength - axisFilters.length,
|
|
42
|
+
parts: dataInfoEntries.parts.filter((entry) => keyMatchesFilters(entry.key)).map((entry) => ({
|
|
43
|
+
key: removeFilteredAxes(entry.key),
|
|
44
|
+
value: entry.value
|
|
45
|
+
}))
|
|
46
|
+
};
|
|
47
|
+
case "BinaryPartitioned": return {
|
|
48
|
+
type: "BinaryPartitioned",
|
|
49
|
+
partitionKeyLength: dataInfoEntries.partitionKeyLength - axisFilters.length,
|
|
50
|
+
parts: dataInfoEntries.parts.filter((entry) => keyMatchesFilters(entry.key)).map((entry) => ({
|
|
51
|
+
key: removeFilteredAxes(entry.key),
|
|
52
|
+
value: entry.value
|
|
53
|
+
}))
|
|
54
|
+
};
|
|
55
|
+
case "ParquetPartitioned": return {
|
|
56
|
+
type: "ParquetPartitioned",
|
|
57
|
+
partitionKeyLength: dataInfoEntries.partitionKeyLength - axisFilters.length,
|
|
58
|
+
parts: dataInfoEntries.parts.filter((entry) => keyMatchesFilters(entry.key)).map((entry) => ({
|
|
59
|
+
key: removeFilteredAxes(entry.key),
|
|
60
|
+
value: entry.value
|
|
61
|
+
}))
|
|
62
|
+
};
|
|
63
|
+
}
|
|
88
64
|
}
|
|
89
65
|
|
|
66
|
+
//#endregion
|
|
90
67
|
exports.filterDataInfoEntries = filterDataInfoEntries;
|
|
91
|
-
//# sourceMappingURL=axis_filtering.cjs.map
|
|
68
|
+
//# sourceMappingURL=axis_filtering.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"axis_filtering.cjs","sources":["../../../src/render/util/axis_filtering.ts"],"sourcesContent":["import type {\n BinaryChunk,\n DataInfoEntries,\n PColumnDataEntry,\n PColumnKey,\n PColumnValue,\n JsonDataInfoEntries,\n JsonPartitionedDataInfoEntries,\n BinaryPartitionedDataInfoEntries,\n ParquetPartitionedDataInfoEntries,\n PartitionedDataInfoEntries,\n} from \"@milaboratories/pl-model-common\";\nimport type { AxisFilterByIdx } from \"@milaboratories/pl-model-common\";\n\n/**\n * Filters DataInfoEntries using axis filters, removing specified axes from keys and\n * only keeping entries that match the filter values.\n *\n * @param dataInfoEntries - The data info object to filter\n * @param axisFilters - Array of axis filters (index, value pairs)\n * @throws Error if any filter axis is outside the partitioning axes or data axes for Json data\n */\nexport function filterDataInfoEntries<Blob>(\n dataInfoEntries: ParquetPartitionedDataInfoEntries<Blob>,\n axisFilters: AxisFilterByIdx[],\n): ParquetPartitionedDataInfoEntries<Blob>;\nexport function filterDataInfoEntries<Blob>(\n dataInfoEntries: BinaryPartitionedDataInfoEntries<Blob>,\n axisFilters: AxisFilterByIdx[],\n): BinaryPartitionedDataInfoEntries<Blob>;\nexport function filterDataInfoEntries<Blob>(\n dataInfoEntries: JsonPartitionedDataInfoEntries<Blob>,\n axisFilters: AxisFilterByIdx[],\n): JsonPartitionedDataInfoEntries<Blob>;\nexport function filterDataInfoEntries<Blob>(\n dataInfoEntries: PartitionedDataInfoEntries<Blob>,\n axisFilters: AxisFilterByIdx[],\n): PartitionedDataInfoEntries<Blob>;\nexport function filterDataInfoEntries(\n dataInfoEntries: JsonDataInfoEntries,\n axisFilters: AxisFilterByIdx[],\n): JsonDataInfoEntries;\nexport function filterDataInfoEntries<Blob>(\n dataInfoEntries: DataInfoEntries<Blob>,\n axisFilters: AxisFilterByIdx[],\n): DataInfoEntries<Blob> {\n // Sort filters by axis index in descending order to safely remove elements from arrays\n const sortedFilters = [...axisFilters].sort((a, b) => b[0] - a[0]);\n\n // Check for invalid filter axes\n const { type } = dataInfoEntries;\n switch (type) {\n case \"Json\": {\n const { keyLength } = dataInfoEntries;\n for (const [axisIdx] of axisFilters)\n if (axisIdx >= keyLength)\n throw new Error(`Can't filter on non-data axis ${axisIdx}. Must be >= ${keyLength}`);\n break;\n }\n case \"JsonPartitioned\":\n case \"BinaryPartitioned\":\n case \"ParquetPartitioned\": {\n const { partitionKeyLength } = dataInfoEntries;\n for (const [axisIdx] of axisFilters)\n if (axisIdx >= partitionKeyLength)\n throw new Error(\n `Can't filter on non-partitioned axis ${axisIdx}. Must be >= ${partitionKeyLength}`,\n );\n break;\n }\n default:\n // eslint-disable-next-line @typescript-eslint/restrict-template-expressions\n throw new Error(`Unsupported data info type: ${type satisfies never}`);\n }\n\n const keyMatchesFilters = (key: PColumnKey): boolean => {\n for (const [axisIdx, axisValue] of sortedFilters) if (key[axisIdx] !== axisValue) return false;\n return true;\n };\n\n const removeFilteredAxes = (key: PColumnKey): PColumnKey => {\n const newKey = [...key];\n\n // Remove axes in descending order to maintain correct indices\n for (const [axisIdx] of sortedFilters) newKey.splice(axisIdx, 1);\n\n return newKey;\n };\n\n switch (dataInfoEntries.type) {\n case \"Json\":\n return {\n type: \"Json\",\n keyLength: dataInfoEntries.keyLength - axisFilters.length,\n data: dataInfoEntries.data\n .filter((entry) => keyMatchesFilters(entry.key))\n .map(\n (entry) =>\n ({\n key: removeFilteredAxes(entry.key),\n value: entry.value,\n }) satisfies PColumnDataEntry<PColumnValue>,\n ),\n };\n case \"JsonPartitioned\":\n return {\n type: \"JsonPartitioned\",\n partitionKeyLength: dataInfoEntries.partitionKeyLength - axisFilters.length,\n parts: dataInfoEntries.parts\n .filter((entry) => keyMatchesFilters(entry.key))\n .map(\n (entry) =>\n ({\n key: removeFilteredAxes(entry.key),\n value: entry.value,\n }) satisfies PColumnDataEntry<Blob>,\n ),\n };\n case \"BinaryPartitioned\":\n return {\n type: \"BinaryPartitioned\",\n partitionKeyLength: dataInfoEntries.partitionKeyLength - axisFilters.length,\n parts: dataInfoEntries.parts\n .filter((entry) => keyMatchesFilters(entry.key))\n .map(\n (entry) =>\n ({\n key: removeFilteredAxes(entry.key),\n value: entry.value,\n }) satisfies PColumnDataEntry<BinaryChunk<Blob>>,\n ),\n };\n case \"ParquetPartitioned\":\n return {\n type: \"ParquetPartitioned\",\n partitionKeyLength: dataInfoEntries.partitionKeyLength - axisFilters.length,\n parts: dataInfoEntries.parts\n .filter((entry) => keyMatchesFilters(entry.key))\n .map(\n (entry) =>\n ({\n key: removeFilteredAxes(entry.key),\n value: entry.value,\n }) satisfies PColumnDataEntry<Blob>,\n ),\n };\n }\n}\n"],"
|
|
1
|
+
{"version":3,"file":"axis_filtering.cjs","names":[],"sources":["../../../src/render/util/axis_filtering.ts"],"sourcesContent":["import type {\n BinaryChunk,\n DataInfoEntries,\n PColumnDataEntry,\n PColumnKey,\n PColumnValue,\n JsonDataInfoEntries,\n JsonPartitionedDataInfoEntries,\n BinaryPartitionedDataInfoEntries,\n ParquetPartitionedDataInfoEntries,\n PartitionedDataInfoEntries,\n} from \"@milaboratories/pl-model-common\";\nimport type { AxisFilterByIdx } from \"@milaboratories/pl-model-common\";\n\n/**\n * Filters DataInfoEntries using axis filters, removing specified axes from keys and\n * only keeping entries that match the filter values.\n *\n * @param dataInfoEntries - The data info object to filter\n * @param axisFilters - Array of axis filters (index, value pairs)\n * @throws Error if any filter axis is outside the partitioning axes or data axes for Json data\n */\nexport function filterDataInfoEntries<Blob>(\n dataInfoEntries: ParquetPartitionedDataInfoEntries<Blob>,\n axisFilters: AxisFilterByIdx[],\n): ParquetPartitionedDataInfoEntries<Blob>;\nexport function filterDataInfoEntries<Blob>(\n dataInfoEntries: BinaryPartitionedDataInfoEntries<Blob>,\n axisFilters: AxisFilterByIdx[],\n): BinaryPartitionedDataInfoEntries<Blob>;\nexport function filterDataInfoEntries<Blob>(\n dataInfoEntries: JsonPartitionedDataInfoEntries<Blob>,\n axisFilters: AxisFilterByIdx[],\n): JsonPartitionedDataInfoEntries<Blob>;\nexport function filterDataInfoEntries<Blob>(\n dataInfoEntries: PartitionedDataInfoEntries<Blob>,\n axisFilters: AxisFilterByIdx[],\n): PartitionedDataInfoEntries<Blob>;\nexport function filterDataInfoEntries(\n dataInfoEntries: JsonDataInfoEntries,\n axisFilters: AxisFilterByIdx[],\n): JsonDataInfoEntries;\nexport function filterDataInfoEntries<Blob>(\n dataInfoEntries: DataInfoEntries<Blob>,\n axisFilters: AxisFilterByIdx[],\n): DataInfoEntries<Blob> {\n // Sort filters by axis index in descending order to safely remove elements from arrays\n const sortedFilters = [...axisFilters].sort((a, b) => b[0] - a[0]);\n\n // Check for invalid filter axes\n const { type } = dataInfoEntries;\n switch (type) {\n case \"Json\": {\n const { keyLength } = dataInfoEntries;\n for (const [axisIdx] of axisFilters)\n if (axisIdx >= keyLength)\n throw new Error(`Can't filter on non-data axis ${axisIdx}. Must be >= ${keyLength}`);\n break;\n }\n case \"JsonPartitioned\":\n case \"BinaryPartitioned\":\n case \"ParquetPartitioned\": {\n const { partitionKeyLength } = dataInfoEntries;\n for (const [axisIdx] of axisFilters)\n if (axisIdx >= partitionKeyLength)\n throw new Error(\n `Can't filter on non-partitioned axis ${axisIdx}. Must be >= ${partitionKeyLength}`,\n );\n break;\n }\n default:\n // eslint-disable-next-line @typescript-eslint/restrict-template-expressions\n throw new Error(`Unsupported data info type: ${type satisfies never}`);\n }\n\n const keyMatchesFilters = (key: PColumnKey): boolean => {\n for (const [axisIdx, axisValue] of sortedFilters) if (key[axisIdx] !== axisValue) return false;\n return true;\n };\n\n const removeFilteredAxes = (key: PColumnKey): PColumnKey => {\n const newKey = [...key];\n\n // Remove axes in descending order to maintain correct indices\n for (const [axisIdx] of sortedFilters) newKey.splice(axisIdx, 1);\n\n return newKey;\n };\n\n switch (dataInfoEntries.type) {\n case \"Json\":\n return {\n type: \"Json\",\n keyLength: dataInfoEntries.keyLength - axisFilters.length,\n data: dataInfoEntries.data\n .filter((entry) => keyMatchesFilters(entry.key))\n .map(\n (entry) =>\n ({\n key: removeFilteredAxes(entry.key),\n value: entry.value,\n }) satisfies PColumnDataEntry<PColumnValue>,\n ),\n };\n case \"JsonPartitioned\":\n return {\n type: \"JsonPartitioned\",\n partitionKeyLength: dataInfoEntries.partitionKeyLength - axisFilters.length,\n parts: dataInfoEntries.parts\n .filter((entry) => keyMatchesFilters(entry.key))\n .map(\n (entry) =>\n ({\n key: removeFilteredAxes(entry.key),\n value: entry.value,\n }) satisfies PColumnDataEntry<Blob>,\n ),\n };\n case \"BinaryPartitioned\":\n return {\n type: \"BinaryPartitioned\",\n partitionKeyLength: dataInfoEntries.partitionKeyLength - axisFilters.length,\n parts: dataInfoEntries.parts\n .filter((entry) => keyMatchesFilters(entry.key))\n .map(\n (entry) =>\n ({\n key: removeFilteredAxes(entry.key),\n value: entry.value,\n }) satisfies PColumnDataEntry<BinaryChunk<Blob>>,\n ),\n };\n case \"ParquetPartitioned\":\n return {\n type: \"ParquetPartitioned\",\n partitionKeyLength: dataInfoEntries.partitionKeyLength - axisFilters.length,\n parts: dataInfoEntries.parts\n .filter((entry) => keyMatchesFilters(entry.key))\n .map(\n (entry) =>\n ({\n key: removeFilteredAxes(entry.key),\n value: entry.value,\n }) satisfies PColumnDataEntry<Blob>,\n ),\n };\n }\n}\n"],"mappings":";;AA0CA,SAAgB,sBACd,iBACA,aACuB;CAEvB,MAAM,gBAAgB,CAAC,GAAG,YAAY,CAAC,MAAM,GAAG,MAAM,EAAE,KAAK,EAAE,GAAG;CAGlE,MAAM,EAAE,SAAS;AACjB,SAAQ,MAAR;EACE,KAAK,QAAQ;GACX,MAAM,EAAE,cAAc;AACtB,QAAK,MAAM,CAAC,YAAY,YACtB,KAAI,WAAW,UACb,OAAM,IAAI,MAAM,iCAAiC,QAAQ,eAAe,YAAY;AACxF;;EAEF,KAAK;EACL,KAAK;EACL,KAAK,sBAAsB;GACzB,MAAM,EAAE,uBAAuB;AAC/B,QAAK,MAAM,CAAC,YAAY,YACtB,KAAI,WAAW,mBACb,OAAM,IAAI,MACR,wCAAwC,QAAQ,eAAe,qBAChE;AACL;;EAEF,QAEE,OAAM,IAAI,MAAM,+BAA+B,OAAuB;;CAG1E,MAAM,qBAAqB,QAA6B;AACtD,OAAK,MAAM,CAAC,SAAS,cAAc,cAAe,KAAI,IAAI,aAAa,UAAW,QAAO;AACzF,SAAO;;CAGT,MAAM,sBAAsB,QAAgC;EAC1D,MAAM,SAAS,CAAC,GAAG,IAAI;AAGvB,OAAK,MAAM,CAAC,YAAY,cAAe,QAAO,OAAO,SAAS,EAAE;AAEhE,SAAO;;AAGT,SAAQ,gBAAgB,MAAxB;EACE,KAAK,OACH,QAAO;GACL,MAAM;GACN,WAAW,gBAAgB,YAAY,YAAY;GACnD,MAAM,gBAAgB,KACnB,QAAQ,UAAU,kBAAkB,MAAM,IAAI,CAAC,CAC/C,KACE,WACE;IACC,KAAK,mBAAmB,MAAM,IAAI;IAClC,OAAO,MAAM;IACd,EACJ;GACJ;EACH,KAAK,kBACH,QAAO;GACL,MAAM;GACN,oBAAoB,gBAAgB,qBAAqB,YAAY;GACrE,OAAO,gBAAgB,MACpB,QAAQ,UAAU,kBAAkB,MAAM,IAAI,CAAC,CAC/C,KACE,WACE;IACC,KAAK,mBAAmB,MAAM,IAAI;IAClC,OAAO,MAAM;IACd,EACJ;GACJ;EACH,KAAK,oBACH,QAAO;GACL,MAAM;GACN,oBAAoB,gBAAgB,qBAAqB,YAAY;GACrE,OAAO,gBAAgB,MACpB,QAAQ,UAAU,kBAAkB,MAAM,IAAI,CAAC,CAC/C,KACE,WACE;IACC,KAAK,mBAAmB,MAAM,IAAI;IAClC,OAAO,MAAM;IACd,EACJ;GACJ;EACH,KAAK,qBACH,QAAO;GACL,MAAM;GACN,oBAAoB,gBAAgB,qBAAqB,YAAY;GACrE,OAAO,gBAAgB,MACpB,QAAQ,UAAU,kBAAkB,MAAM,IAAI,CAAC,CAC/C,KACE,WACE;IACC,KAAK,mBAAmB,MAAM,IAAI;IAClC,OAAO,MAAM;IACd,EACJ;GACJ"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
1
|
+
import { AxisFilterByIdx, BinaryPartitionedDataInfoEntries, JsonDataInfoEntries, JsonPartitionedDataInfoEntries, ParquetPartitionedDataInfoEntries, PartitionedDataInfoEntries } from "@milaboratories/pl-model-common";
|
|
2
|
+
|
|
3
|
+
//#region src/render/util/axis_filtering.d.ts
|
|
3
4
|
/**
|
|
4
5
|
* Filters DataInfoEntries using axis filters, removing specified axes from keys and
|
|
5
6
|
* only keeping entries that match the filter values.
|
|
@@ -8,9 +9,11 @@ import type { AxisFilterByIdx } from "@milaboratories/pl-model-common";
|
|
|
8
9
|
* @param axisFilters - Array of axis filters (index, value pairs)
|
|
9
10
|
* @throws Error if any filter axis is outside the partitioning axes or data axes for Json data
|
|
10
11
|
*/
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
12
|
+
declare function filterDataInfoEntries<Blob>(dataInfoEntries: ParquetPartitionedDataInfoEntries<Blob>, axisFilters: AxisFilterByIdx[]): ParquetPartitionedDataInfoEntries<Blob>;
|
|
13
|
+
declare function filterDataInfoEntries<Blob>(dataInfoEntries: BinaryPartitionedDataInfoEntries<Blob>, axisFilters: AxisFilterByIdx[]): BinaryPartitionedDataInfoEntries<Blob>;
|
|
14
|
+
declare function filterDataInfoEntries<Blob>(dataInfoEntries: JsonPartitionedDataInfoEntries<Blob>, axisFilters: AxisFilterByIdx[]): JsonPartitionedDataInfoEntries<Blob>;
|
|
15
|
+
declare function filterDataInfoEntries<Blob>(dataInfoEntries: PartitionedDataInfoEntries<Blob>, axisFilters: AxisFilterByIdx[]): PartitionedDataInfoEntries<Blob>;
|
|
16
|
+
declare function filterDataInfoEntries(dataInfoEntries: JsonDataInfoEntries, axisFilters: AxisFilterByIdx[]): JsonDataInfoEntries;
|
|
17
|
+
//#endregion
|
|
18
|
+
export { filterDataInfoEntries };
|
|
16
19
|
//# sourceMappingURL=axis_filtering.d.ts.map
|