@milaboratories/pl-model-common 1.36.2 → 1.38.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/drivers/index.d.ts +12 -12
- package/dist/drivers/pframe/driver.d.ts +1 -1
- package/dist/drivers/pframe/index.d.ts +7 -7
- package/dist/drivers/pframe/query/query_spec.d.ts +1 -1
- package/dist/drivers/pframe/spec/anchored.d.ts +2 -2
- package/dist/drivers/pframe/spec/discovered_column.cjs.map +1 -1
- package/dist/drivers/pframe/spec/discovered_column.d.ts +1 -2
- 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/ids.d.ts +1 -1
- package/dist/drivers/pframe/spec/index.d.ts +4 -4
- package/dist/drivers/pframe/spec/selectors.cjs +47 -0
- package/dist/drivers/pframe/spec/selectors.cjs.map +1 -1
- package/dist/drivers/pframe/spec/selectors.d.ts +16 -1
- package/dist/drivers/pframe/spec/selectors.d.ts.map +1 -1
- package/dist/drivers/pframe/spec/selectors.js +46 -1
- package/dist/drivers/pframe/spec/selectors.js.map +1 -1
- package/dist/drivers/pframe/spec/spec.cjs +1 -0
- package/dist/drivers/pframe/spec/spec.cjs.map +1 -1
- package/dist/drivers/pframe/spec/spec.d.ts +4 -1
- package/dist/drivers/pframe/spec/spec.d.ts.map +1 -1
- package/dist/drivers/pframe/spec/spec.js +1 -0
- package/dist/drivers/pframe/spec/spec.js.map +1 -1
- package/dist/drivers/pframe/spec_driver.d.ts +3 -12
- package/dist/drivers/pframe/spec_driver.d.ts.map +1 -1
- package/dist/drivers/pframe/table_calculate.d.ts +1 -1
- package/dist/index.cjs +4 -0
- package/dist/index.d.ts +16 -16
- package/dist/index.js +3 -3
- package/dist/pool/index.d.ts +1 -1
- package/dist/pool/spec.d.ts +2 -1
- package/dist/pool/spec.d.ts.map +1 -1
- package/dist/ref.cjs +14 -0
- package/dist/ref.cjs.map +1 -1
- package/dist/ref.d.ts +35 -4
- package/dist/ref.d.ts.map +1 -1
- package/dist/ref.js +13 -1
- package/dist/ref.js.map +1 -1
- package/package.json +1 -1
- package/src/drivers/pframe/spec/discovered_column.ts +1 -2
- package/src/drivers/pframe/spec/selectors.ts +85 -0
- package/src/drivers/pframe/spec/spec.ts +4 -0
- package/src/drivers/pframe/spec_driver.ts +1 -10
- package/src/ref.test.ts +73 -1
- package/src/ref.ts +59 -3
package/dist/index.d.ts
CHANGED
|
@@ -5,28 +5,26 @@ import { CanonicalizedJson, JsonCompatible, JsonSerializable, StringifiedJson, b
|
|
|
5
5
|
import { BlockState, BlockStateV3 } from "./block_state.js";
|
|
6
6
|
import { Branded } from "./branding.js";
|
|
7
7
|
import { DialogService, FileFilter, ShowSaveDialogOptions, ShowSaveDialogResult } from "./dialog/index.js";
|
|
8
|
-
import { DatasetInput, DatasetOption, Option, PlRef, PrimaryRef, Ref, createPlRef, createPrimaryRef, isPlRef, isPrimaryRef, plRefsEqual, withEnrichments } from "./ref.js";
|
|
9
|
-
import { ResultCollection, ResultPoolEntry } from "./pool/entry.js";
|
|
10
|
-
import { BlobLike, FileLike } from "./drivers/interfaces.js";
|
|
11
|
-
import { ArchiveFormat, BlobToURLDriver, BlockUIURL, FolderURL, FrontendDriver, isBlockUIURL, isFolderURL } from "./drivers/urls.js";
|
|
12
|
-
import { BlobDriver, BlobHandleAndSize, ContentHandler, GetContentOptions, LocalBlobHandle, LocalBlobHandleAndSize, RangeBytes, RemoteBlobHandle, RemoteBlobHandleAndSize, newRangeBytesOpt, validateRangeBytes } from "./drivers/blob.js";
|
|
13
|
-
import { ImportProgress, ImportStatus } from "./drivers/upload.js";
|
|
14
|
-
import { AnyLogHandle, LiveLogHandle, LogsDriver, ProgressLogWithInfo, ReadyLogHandle, StreamingApiResponse, StreamingApiResponseHandleOutdated, StreamingApiResponseOk, isAnyLogHandle, isLiveLog } from "./drivers/log.js";
|
|
15
|
-
import { Annotation, AnnotationJson, AxesId, AxesSpec, AxisId, AxisSpec, AxisSpecNormalized, AxisTree, AxisValueType, ColumnValueType, Domain, DomainJson, Metadata, MetadataJson, PAxisName, PColumn, PColumnIdAndSpec, PColumnInfo, PColumnLazy, PColumnName, PColumnSpec, PColumnSpecId, PDataColumnSpec, PUniversalColumnSpec, Trace, TraceEntry, 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 "./drivers/pframe/spec/spec.js";
|
|
16
|
-
import { ColumnFilter } from "./drivers/pframe/column_filter.js";
|
|
17
|
-
import { BinaryChunk, BinaryPartitionedDataInfo, BinaryPartitionedDataInfoEntries, DataInfo, DataInfoEntries, JsonDataInfo, JsonDataInfoEntries, JsonPartitionedDataInfo, JsonPartitionedDataInfoEntries, PColumnDataEntry, PColumnKey, PColumnValue, PColumnValues, PColumnValuesEntry, ParquetChunk, ParquetChunkMapping, ParquetChunkMappingAxis, ParquetChunkMappingColumn, ParquetChunkMetadata, ParquetChunkStats, ParquetPartitionedDataInfo, ParquetPartitionedDataInfoEntries, PartitionedDataInfoEntries, dataInfoToEntries, entriesToDataInfo, isDataInfo, isDataInfoEntries, isPartitionedDataInfoEntries, mapDataInfo, mapDataInfoEntries, visitDataInfo } from "./drivers/pframe/data_info.js";
|
|
18
|
-
import { AAxisSelector, ADomain, AnchorAxisIdOrRefBasic, AnchorAxisRef, AnchorAxisRefByIdx, AnchorAxisRefByMatcher, AnchorAxisRefByName, AnchorDomainRef, AnchoredColumnMatchStrategy, AnchoredPColumnId, AnchoredPColumnSelector, LegacyAxisSelector, PColumnSelector, SingleAxisSelector, isAnchoredPColumnId, legacyColumnSelectorsToPredicate, matchAxis, matchPColumn } from "./drivers/pframe/spec/selectors.js";
|
|
19
|
-
import { AxisFilter, AxisFilterByIdx, AxisFilterByName, AxisFilterValue, FilteredPColumn, FilteredPColumnId, isFilteredPColumn } from "./drivers/pframe/spec/filtered_column.js";
|
|
20
8
|
import { PoolEntry, PoolEntryGuard } from "./pool_entry.js";
|
|
9
|
+
import { AxisFilter, AxisFilterByIdx, AxisFilterByName, AxisFilterValue, FilteredPColumn, FilteredPColumnId, isFilteredPColumn } from "./drivers/pframe/spec/filtered_column.js";
|
|
10
|
+
import { DiscoveredPColumn, DiscoveredPColumnId, createDiscoveredPColumn, createDiscoveredPColumnId, isDiscoveredPColumn, parseDiscoveredPColumnId, stringifyDiscoveredPColumnId } from "./drivers/pframe/spec/discovered_column.js";
|
|
11
|
+
import { SUniversalPColumnId, UniversalPColumnId, parseColumnId, stringifyColumnId } from "./drivers/pframe/spec/ids.js";
|
|
12
|
+
import { Annotation, AnnotationDataStatus, AnnotationJson, AxesId, AxesSpec, AxisId, AxisSpec, AxisSpecNormalized, AxisTree, AxisValueType, ColumnValueType, Domain, DomainJson, Metadata, MetadataJson, PAxisName, PColumn, PColumnIdAndSpec, PColumnInfo, PColumnLazy, PColumnName, PColumnSpec, PColumnSpecId, PDataColumnSpec, PUniversalColumnSpec, Trace, TraceEntry, 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 "./drivers/pframe/spec/spec.js";
|
|
21
13
|
import { AnchoredIdDeriver, ResolveAnchorsOptions, resolveAnchors } from "./drivers/pframe/spec/anchored.js";
|
|
22
14
|
import { NativePObjectId, deriveNativeId } from "./drivers/pframe/spec/native_id.js";
|
|
23
15
|
import { PTableColumnId, PTableColumnIdAxis, PTableColumnIdColumn, PTableColumnSpec, PTableColumnSpecAxis, PTableColumnSpecColumn, getPTableColumnId } from "./drivers/pframe/table_common.js";
|
|
16
|
+
import { BinaryChunk, BinaryPartitionedDataInfo, BinaryPartitionedDataInfoEntries, DataInfo, DataInfoEntries, JsonDataInfo, JsonDataInfoEntries, JsonPartitionedDataInfo, JsonPartitionedDataInfoEntries, PColumnDataEntry, PColumnKey, PColumnValue, PColumnValues, PColumnValuesEntry, ParquetChunk, ParquetChunkMapping, ParquetChunkMappingAxis, ParquetChunkMappingColumn, ParquetChunkMetadata, ParquetChunkStats, ParquetPartitionedDataInfo, ParquetPartitionedDataInfoEntries, PartitionedDataInfoEntries, dataInfoToEntries, entriesToDataInfo, isDataInfo, isDataInfoEntries, isPartitionedDataInfoEntries, mapDataInfo, mapDataInfoEntries, visitDataInfo } from "./drivers/pframe/data_info.js";
|
|
24
17
|
import { SpecExprAxisRef, SpecExprColumnRef, SpecQuery, SpecQueryBooleanExpression, SpecQueryColumn, SpecQueryExpression, SpecQueryFilter, SpecQueryInlineColumn, SpecQueryJoinEntry, SpecQueryLinkerJoin, SpecQueryLinkerJoinLinker, SpecQueryOuterJoin, SpecQuerySliceAxes, SpecQuerySort, SpecQuerySparseToDenseColumn, SpecQuerySymmetricJoin } from "./drivers/pframe/query/query_spec.js";
|
|
25
18
|
import { DataExprAxisRef, DataExprColumnRef, DataQuery, DataQueryBooleanExpression, DataQueryColumn, DataQueryExpression, DataQueryFilter, DataQueryInlineColumn, DataQueryJoinEntry, DataQueryLinkerJoin, DataQueryLinkerJoinLinker, DataQueryOuterJoin, DataQuerySliceAxes, DataQuerySort, DataQuerySparseToDenseColumn, DataQuerySymmetricJoin } from "./drivers/pframe/query/query_data.js";
|
|
26
19
|
import { collectSpecQueryColumns, isBooleanExpression, mapSpecQueryColumns, sortSpecQuery, traverseQuerySpec } from "./drivers/pframe/query/utils.js";
|
|
27
|
-
import {
|
|
28
|
-
import {
|
|
29
|
-
import {
|
|
20
|
+
import { BuildQueryInput, ColumnAxesWithQualifications, DeleteColumnRequest, DeleteColumnResponse, DiscoverColumnsConstraints, DiscoverColumnsFilterStep, DiscoverColumnsLinkerStep, DiscoverColumnsMappingVariant, DiscoverColumnsRequest, DiscoverColumnsResponse, DiscoverColumnsResponseHit, DiscoverColumnsResponseQualifications, DiscoverColumnsStepInfo, EvaluateQueryResponse, MatcherMap, MultiAxisSelector, MultiColumnSelector, PFrameSpecDriver, SpecFrameHandle, StringMatcher } from "./drivers/pframe/spec_driver.js";
|
|
21
|
+
import { AAxisSelector, ADomain, AnchorAxisIdOrRefBasic, AnchorAxisRef, AnchorAxisRefByIdx, AnchorAxisRefByMatcher, AnchorAxisRefByName, AnchorDomainRef, AnchoredColumnMatchStrategy, AnchoredPColumnId, AnchoredPColumnSelector, AxisQualification, LegacyAxisSelector, PColumnSelector, SingleAxisSelector, isAnchoredPColumnId, legacyColumnSelectorsToPredicate, matchAxis, matchMultiColumnSelector, matchPColumn, multiColumnSelectorsToPredicate } from "./drivers/pframe/spec/selectors.js";
|
|
22
|
+
import { BlobLike, FileLike } from "./drivers/interfaces.js";
|
|
23
|
+
import { ArchiveFormat, BlobToURLDriver, BlockUIURL, FolderURL, FrontendDriver, isBlockUIURL, isFolderURL } from "./drivers/urls.js";
|
|
24
|
+
import { BlobDriver, BlobHandleAndSize, ContentHandler, GetContentOptions, LocalBlobHandle, LocalBlobHandleAndSize, RangeBytes, RemoteBlobHandle, RemoteBlobHandleAndSize, newRangeBytesOpt, validateRangeBytes } from "./drivers/blob.js";
|
|
25
|
+
import { ImportProgress, ImportStatus } from "./drivers/upload.js";
|
|
26
|
+
import { AnyLogHandle, LiveLogHandle, LogsDriver, ProgressLogWithInfo, ReadyLogHandle, StreamingApiResponse, StreamingApiResponseHandleOutdated, StreamingApiResponseOk, isAnyLogHandle, isLiveLog } from "./drivers/log.js";
|
|
27
|
+
import { ColumnFilter } from "./drivers/pframe/column_filter.js";
|
|
30
28
|
import { FilterSpec, FilterSpecLeaf, FilterSpecNode, FilterSpecOfType, FilterSpecType, InferFilterSpecCommonLeaf, InferFilterSpecCommonNode, InferFilterSpecLeaf, InferFilterSpecLeafColumn, RootFilterSpec } from "./drivers/pframe/filter_spec.js";
|
|
31
29
|
import { PTableDownloadCompression, PTableDownloadFormat, PTableNA, PTableShape, PTableValue, PTableValueAxis, PTableValueBranded, PTableValueData, PTableValueDataBranded, PTableValueDouble, PTableValueFloat, PTableValueInt, PTableValueLong, PTableValueString, PTableVector, PTableVectorTyped, PVectorData, PVectorDataBytes, PVectorDataDouble, PVectorDataFloat, PVectorDataInt, PVectorDataLong, PVectorDataString, PVectorDataTyped, TableRange, ValueTypeSupported, WritePTableToFsOptions, WritePTableToFsResult, isPTableNA, isValueNA, pTableValue, pTableValueBranded } from "./drivers/pframe/data_types.js";
|
|
32
30
|
import { FindColumnsRequest, FindColumnsResponse } from "./drivers/pframe/find_columns.js";
|
|
@@ -37,6 +35,8 @@ import { CompositeLinkerMap, LinkerMap } from "./drivers/pframe/linker_columns.j
|
|
|
37
35
|
import { FileRange, ImportFileHandle, ImportFileHandleIndex, ImportFileHandleUpload, ListFilesResult, LocalImportFileHandle, LsDriver, LsEntry, OpenDialogFilter, OpenDialogOps, OpenMultipleFilesResponse, OpenSingleFileResponse, StorageEntry, StorageHandle, StorageHandleLocal, StorageHandleRemote, getFileNameFromHandle, getFilePathFromHandle, isImportFileHandleIndex, isImportFileHandleUpload } from "./drivers/ls.js";
|
|
38
36
|
import { ChunkedStreamReader, ChunkedStreamReaderOptions, ErrorHandlerStatus } from "./drivers/ChunkedStreamReader.js";
|
|
39
37
|
import { PObject, PObjectId, PObjectSpec, ensurePColumn, extractAllColumns, isPColumn, isPColumnResult, isPColumnSpec, isPColumnSpecResult, mapPObjectData } from "./pool/spec.js";
|
|
38
|
+
import { CreateEnrichmentRefOptions, DatasetInput, EnrichmentLinkerStep, EnrichmentRef, EnrichmentStep, LabeledEnrichmentRef, LabeledEnrichmentRefs, Option, PlRef, PrimaryRef, Ref, createEnrichmentRef, createPlRef, createPrimaryRef, isEnrichmentRef, isPlRef, isPrimaryRef, plRefsEqual, withEnrichments } from "./ref.js";
|
|
39
|
+
import { ResultCollection, ResultPoolEntry } from "./pool/entry.js";
|
|
40
40
|
import { PSpecPredicate, executePSpecPredicate } from "./pool/query.js";
|
|
41
41
|
import { PFrame, PFrameDef } from "./drivers/pframe/pframe.js";
|
|
42
42
|
import { PFrameDriver, PFrameHandle, PFrameModelDriver, PTableHandle } from "./drivers/pframe/driver.js";
|
|
@@ -63,4 +63,4 @@ import { Base64Compatible, Base64Encoded, base64Decode, base64Encode } from "./b
|
|
|
63
63
|
import { assertNever, uniqueBy } from "./util.js";
|
|
64
64
|
import { BasicHttpAuth, HttpAuth, parseHttpAuth, serializeHttpAuth } from "./httpAuth.js";
|
|
65
65
|
import { ResourceTypeName, ResourceTypePrefix } from "./resource_types.js";
|
|
66
|
-
export { AAxisSelector, ADomain, AbortError, AllRequiresFeatureFlags, AllSupportsFeatureFlags, AnchorAxisIdOrRefBasic, AnchorAxisRef, AnchorAxisRefByIdx, AnchorAxisRefByMatcher, AnchorAxisRefByName, AnchorDomainRef, AnchoredColumnMatchStrategy, AnchoredIdDeriver, AnchoredPColumnId, AnchoredPColumnSelector, Annotation, AnnotationJson, AnyFunction, AnyLogHandle, ArchiveFormat, ArrayTypeUnion, ArtificialColumnJoinEntry, Assert, AssertKeysEqual, AuthorMarker, AxesId, AxesSpec, AxisFilter, AxisFilterByIdx, AxisFilterByName, AxisFilterValue, AxisId, AxisQualification, AxisSpec, AxisSpecNormalized, AxisTree, AxisValueType, Base64Compatible, Base64Encoded, BasicHttpAuth, BinaryChunk, BinaryPartitionedDataInfo, BinaryPartitionedDataInfoEntries, BlobDriver, BlobHandleAndSize, BlobLike, BlobToURLDriver, BlockCodeFeatureFlags, BlockCodeKnownFeatureFlags, BlockCodeWithInfo, BlockConfigContainer, BlockConfigGeneric, BlockConfigV3Generic, BlockConfigV4Generic, BlockOutputsBase, BlockRenderingMode, BlockSection, BlockSectionDelimiter, BlockSectionLink, BlockSectionLinkAppearance, BlockState, BlockStateV3, BlockUIURL, Branded, BuildQueryInput, CalculateTableDataRequest, CalculateTableDataResponse, CanonicalizedJson, ChunkedStreamReader, ChunkedStreamReaderOptions, Code, 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, DatasetInput,
|
|
66
|
+
export { AAxisSelector, ADomain, AbortError, AllRequiresFeatureFlags, AllSupportsFeatureFlags, AnchorAxisIdOrRefBasic, AnchorAxisRef, AnchorAxisRefByIdx, AnchorAxisRefByMatcher, AnchorAxisRefByName, AnchorDomainRef, AnchoredColumnMatchStrategy, AnchoredIdDeriver, AnchoredPColumnId, AnchoredPColumnSelector, Annotation, AnnotationDataStatus, AnnotationJson, AnyFunction, AnyLogHandle, ArchiveFormat, ArrayTypeUnion, ArtificialColumnJoinEntry, Assert, AssertKeysEqual, AuthorMarker, AxesId, AxesSpec, AxisFilter, AxisFilterByIdx, AxisFilterByName, AxisFilterValue, AxisId, AxisQualification, AxisSpec, AxisSpecNormalized, AxisTree, AxisValueType, Base64Compatible, Base64Encoded, BasicHttpAuth, BinaryChunk, BinaryPartitionedDataInfo, BinaryPartitionedDataInfoEntries, BlobDriver, BlobHandleAndSize, BlobLike, BlobToURLDriver, BlockCodeFeatureFlags, BlockCodeKnownFeatureFlags, BlockCodeWithInfo, BlockConfigContainer, BlockConfigGeneric, BlockConfigV3Generic, BlockConfigV4Generic, BlockOutputsBase, BlockRenderingMode, BlockSection, BlockSectionDelimiter, BlockSectionLink, BlockSectionLinkAppearance, BlockState, BlockStateV3, BlockUIURL, Branded, BuildQueryInput, CalculateTableDataRequest, CalculateTableDataResponse, CanonicalizedJson, ChunkedStreamReader, ChunkedStreamReaderOptions, Code, ColumnAxesWithQualifications, ColumnFilter, ColumnJoinEntry, ColumnValueType, CompositeLinkerMap, ConstantAxisFilter, ContentHandler, CreateEnrichmentRefOptions, DataExprAxisRef, DataExprColumnRef, DataInfo, DataInfoEntries, DataQuery, DataQueryBooleanExpression, DataQueryColumn, DataQueryExpression, DataQueryFilter, DataQueryInlineColumn, DataQueryJoinEntry, DataQueryLinkerJoin, DataQueryLinkerJoinLinker, DataQueryOuterJoin, DataQuerySliceAxes, DataQuerySort, DataQuerySparseToDenseColumn, DataQuerySymmetricJoin, DatasetInput, DefaultNavigationState, DeleteColumnRequest, DeleteColumnResponse, DialogService, DiscoverColumnsConstraints, DiscoverColumnsFilterStep, DiscoverColumnsLinkerStep, DiscoverColumnsMappingVariant, DiscoverColumnsRequest, DiscoverColumnsResponse, DiscoverColumnsResponseHit, DiscoverColumnsResponseQualifications, DiscoverColumnsStepInfo, DiscoveredPColumn, DiscoveredPColumnId, Domain, DomainJson, DriverKit, EnrichmentLinkerStep, EnrichmentRef, EnrichmentStep, ErrorHandlerStatus, EvaluateQueryResponse, FileFilter, FileLike, FileRange, FilterKeysByPrefix, FilterSpec, FilterSpecLeaf, FilterSpecNode, FilterSpecOfType, FilterSpecType, FilteredPColumn, FilteredPColumnId, FindColumnsRequest, FindColumnsResponse, FolderURL, FrontendDriver, FullJoin, FullPTableColumnData, GetContentOptions, HttpAuth, ImportFileHandle, ImportFileHandleIndex, ImportFileHandleUpload, ImportProgress, ImportStatus, IncompatibleFlagsError, InferFilterSpecCommonLeaf, InferFilterSpecCommonNode, InferFilterSpecLeaf, InferFilterSpecLeafColumn, InferServiceKind, InferServiceModel, InferServiceUi, InlineColumnJoinEntry, InnerJoin, Is, IsSubtypeOf, JoinEntry, JsonCompatible, JsonDataInfo, JsonDataInfoEntries, JsonPartitionedDataInfo, JsonPartitionedDataInfoEntries, JsonSerializable, KnownServiceName, LabeledEnrichmentRef, LabeledEnrichmentRefs, LegacyAxisSelector, LinkerMap, ListFilesResult, ListOptionBase, LiveLogHandle, LocalBlobHandle, LocalBlobHandleAndSize, LocalImportFileHandle, LogsDriver, LsDriver, LsEntry, MODEL_SERVICE_METHOD_MAP, MatcherMap, Metadata, MetadataJson, ModelServiceFactoryMap, ModelServiceRegistry, ModelServices, MultiAxisSelector, MultiColumnSelector, NativePObjectId, NavigationState, NodeServiceHandlerMap, OpenDialogFilter, OpenDialogOps, OpenMultipleFilesResponse, OpenSingleFileResponse, Option, OuterJoin, OutputWithStatus, PAxisName, PColumn, PColumnDataEntry, PColumnIdAndSpec, PColumnInfo, PColumnKey, PColumnLazy, PColumnName, PColumnSelector, PColumnSpec, PColumnSpecId, PColumnValue, PColumnValues, PColumnValuesEntry, PDataColumnSpec, PFrame, PFrameDef, PFrameDriver, PFrameDriverError, PFrameError, PFrameHandle, PFrameModelDriver, PFrameSpecDriver, PFrameSpecDriverError, PObject, PObjectId, PObjectSpec, PSpecPredicate, 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, PlId, PlIdBytes, PlIdLength, PlRef, PoolEntry, PoolEntryGuard, PrimaryRef, ProgressLogWithInfo, RangeBytes, ReadyLogHandle, Ref, RemoteBlobHandle, RemoteBlobHandleAndSize, RequireServices, ResolveAnchorsOptions, ResourceTypeName, ResourceTypePrefix, ResultCollection, ResultOrError, ResultPoolEntry, RootFilterSpec, RuntimeCapabilities, SERVICE_CAPABILITY_FLAGS, SERVICE_FEATURE_FLAGS, SERVICE_METHOD_MAP, SUniversalPColumnId, SerializedError, ServiceAlreadyRegisteredError, ServiceBrand, ServiceDispatch, ServiceError, ServiceInjectionError, ServiceInvalidIdError, ServiceMethodNotFoundError, ServiceName, ServiceNameLiterals, ServiceNotRegisteredError, ServiceRequireFlags, ServiceType, ServiceTypesLike, Services, ShowSaveDialogOptions, ShowSaveDialogResult, 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, StorageEntry, StorageHandle, StorageHandleLocal, StorageHandleRemote, StreamingApiResponse, StreamingApiResponseHandleOutdated, StreamingApiResponseOk, StringMatcher, StringifiedJson, SupportedRequirement, TableRange, Trace, TraceEntry, UiError, UiServiceFactoryMap, UiServiceRegistry, UiServices, UniqueValuesRequest, UniqueValuesResponse, UniversalPColumnId, ValueOrError, ValueType, ValueTypeSupported, ValueWithUTag, ValueWithUTagAndAuthor, WritePTableToFsOptions, WritePTableToFsResult, assertNever, base64Decode, base64Encode, bigintReplacer, buildServiceInfo, canonicalizeAxisId, canonicalizeAxisWithParents, canonicalizeJson, checkBlockFlag, collectSpecQueryColumns, createDiscoveredPColumn, createDiscoveredPColumnId, createEnrichmentRef, createNodeServiceHandlers, createPlRef, createPrimaryRef, dataInfoToEntries, deriveNativeId, deserializeError, deserializeResult, digestPlId, ensureError, ensurePColumn, entriesToDataInfo, executePSpecPredicate, extractAllColumns, extractAllRequirements, extractAllSupports, extractCodeWithInfo, extractConfigGeneric, getArrayFromAxisTree, getAxesId, getAxesTree, getAxisId, getColumnIdAndSpec, getDenormalizedAxesList, getFileNameFromHandle, getFilePathFromHandle, getMethodNames, getNormalizedAxesList, getPColumnSpecId, getPTableColumnId, getServiceKind, getServiceModelMethods, getServiceUiMethods, getSetFromAxisTree, getTypeFromPColumnOrAxisSpec, hasAbortError, isAbortError, isAggregateError, isAnchoredPColumnId, isAnyLogHandle, isAxisId, isBlockUIURL, isBooleanExpression, isDataInfo, isDataInfoEntries, isDiscoveredPColumn, isEnrichmentRef, isFilteredPColumn, isFolderURL, isImportFileHandleIndex, isImportFileHandleUpload, isKnownServiceName, isLabelColumn, isLinkerColumn, isLiveLog, isMainService, isNodeService, isPColumn, isPColumnResult, isPColumnSpec, isPColumnSpecResult, isPFrameDriverError, isPFrameError, isPFrameSpecDriverError, isPTableNA, isPartitionedDataInfoEntries, isPlRef, isPrimaryRef, isServiceAlreadyRegisteredError, isServiceError, isServiceInjectionError, isServiceInvalidIdError, isServiceMethodNotFoundError, isServiceNotRegisteredError, isValueNA, isWasmService, legacyColumnSelectorsToPredicate, mapDataInfo, mapDataInfoEntries, mapJoinEntry, mapPObjectData, mapPTableDef, mapPTableDefV2, mapSpecQueryColumns, mapValueInVOE, matchAxis, matchAxisId, matchMultiColumnSelector, matchPColumn, multiColumnSelectorsToPredicate, newRangeBytesOpt, pTableValue, pTableValueBranded, parseColumnId, parseDiscoveredPColumnId, parseHttpAuth, parseJson, plId, plRefsEqual, readAnnotation, readAnnotationJson, readAnnotationJsonOrThrow, readDomain, readDomainJson, readDomainJsonOrThrow, readMetadata, readMetadataJson, readMetadataJsonOrThrow, registerServiceCapabilities, resolveAnchors, resolveAnnotationParents, resolveNodeServiceHandler, resolveRequiredServices, serializeError, serializeHttpAuth, serializeResult, service, serviceFnKey, sortJoinEntry, sortPTableDef, sortSpecQuery, stringifyColumnId, stringifyDiscoveredPColumnId, stringifyJson, traverseQuerySpec, uniqueBy, uniquePlId, unwrapResult, validateRangeBytes, visitDataInfo, withEnrichments, wrapAndSerialize, wrapAndSerializeAsync, wrapAsyncCallback, wrapCallback };
|
package/dist/index.js
CHANGED
|
@@ -20,7 +20,7 @@ import { AnchoredIdDeriver, resolveAnchors } from "./drivers/pframe/spec/anchore
|
|
|
20
20
|
import { isFilteredPColumn } from "./drivers/pframe/spec/filtered_column.js";
|
|
21
21
|
import { ensurePColumn, extractAllColumns, isPColumn, isPColumnResult, isPColumnSpec, isPColumnSpecResult, mapPObjectData } from "./pool/spec.js";
|
|
22
22
|
import { executePSpecPredicate } from "./pool/query.js";
|
|
23
|
-
import { isAnchoredPColumnId, legacyColumnSelectorsToPredicate, matchAxis, matchPColumn } from "./drivers/pframe/spec/selectors.js";
|
|
23
|
+
import { isAnchoredPColumnId, legacyColumnSelectorsToPredicate, matchAxis, matchMultiColumnSelector, matchPColumn, multiColumnSelectorsToPredicate } from "./drivers/pframe/spec/selectors.js";
|
|
24
24
|
import { deriveNativeId } from "./drivers/pframe/spec/native_id.js";
|
|
25
25
|
import { createDiscoveredPColumn, createDiscoveredPColumnId, isDiscoveredPColumn, parseDiscoveredPColumnId, stringifyDiscoveredPColumnId } from "./drivers/pframe/spec/discovered_column.js";
|
|
26
26
|
import { LinkerMap } from "./drivers/pframe/linker_columns.js";
|
|
@@ -30,7 +30,7 @@ import { AllRequiresFeatureFlags, AllSupportsFeatureFlags } from "./flags/block_
|
|
|
30
30
|
import { IncompatibleFlagsError, RuntimeCapabilities, checkBlockFlag, extractAllRequirements, extractAllSupports } from "./flags/flag_utils.js";
|
|
31
31
|
import { DefaultNavigationState } from "./navigation.js";
|
|
32
32
|
import { PlId, PlIdBytes, PlIdLength, digestPlId, plId, uniquePlId } from "./plid.js";
|
|
33
|
-
import { PlRef, createPlRef, createPrimaryRef, isPlRef, isPrimaryRef, plRefsEqual, withEnrichments } from "./ref.js";
|
|
33
|
+
import { PlRef, createEnrichmentRef, createPlRef, createPrimaryRef, isEnrichmentRef, isPlRef, isPrimaryRef, plRefsEqual, withEnrichments } from "./ref.js";
|
|
34
34
|
import { mapValueInVOE } from "./value_or_error.js";
|
|
35
35
|
import { base64Decode, base64Encode } from "./base64.js";
|
|
36
36
|
import { parseHttpAuth, serializeHttpAuth } from "./httpAuth.js";
|
|
@@ -43,4 +43,4 @@ import { createNodeServiceHandlers } from "./services/node_service_handlers.js";
|
|
|
43
43
|
import { MODEL_SERVICE_METHOD_MAP, SERVICE_METHOD_MAP, buildServiceInfo, resolveNodeServiceHandler } from "./services/service_injectors.js";
|
|
44
44
|
import "./services/index.js";
|
|
45
45
|
import { PoolEntryGuard } from "./pool_entry.js";
|
|
46
|
-
export { AbortError, AllRequiresFeatureFlags, AllSupportsFeatureFlags, AnchoredIdDeriver, Annotation, AnnotationJson, ChunkedStreamReader, Code, DefaultNavigationState, Domain, DomainJson, IncompatibleFlagsError, LinkerMap, MODEL_SERVICE_METHOD_MAP, ModelServiceRegistry, PAxisName, PColumnName, PFrameDriverError, PFrameError, PFrameSpecDriverError, PTableNA, PlId, PlIdBytes, PlIdLength, PlRef, PoolEntryGuard, RangeBytes, ResourceTypeName, ResourceTypePrefix, RuntimeCapabilities, SERVICE_CAPABILITY_FLAGS, SERVICE_FEATURE_FLAGS, SERVICE_METHOD_MAP, ServiceAlreadyRegisteredError, ServiceError, ServiceInjectionError, ServiceInvalidIdError, ServiceMethodNotFoundError, ServiceNotRegisteredError, Services, UiError, UiServiceRegistry, ValueType, assertNever, base64Decode, base64Encode, bigintReplacer, buildServiceInfo, canonicalizeAxisId, canonicalizeAxisWithParents, canonicalizeJson, checkBlockFlag, collectSpecQueryColumns, createDiscoveredPColumn, createDiscoveredPColumnId, createNodeServiceHandlers, createPlRef, createPrimaryRef, dataInfoToEntries, deriveNativeId, deserializeError, deserializeResult, digestPlId, ensureError, ensurePColumn, entriesToDataInfo, executePSpecPredicate, extractAllColumns, extractAllRequirements, extractAllSupports, extractCodeWithInfo, extractConfigGeneric, getArrayFromAxisTree, getAxesId, getAxesTree, getAxisId, getColumnIdAndSpec, getDenormalizedAxesList, getFileNameFromHandle, getFilePathFromHandle, getMethodNames, getNormalizedAxesList, getPColumnSpecId, getPTableColumnId, getServiceKind, getServiceModelMethods, getServiceUiMethods, getSetFromAxisTree, getTypeFromPColumnOrAxisSpec, hasAbortError, isAbortError, isAggregateError, isAnchoredPColumnId, isAnyLogHandle, isAxisId, isBlockUIURL, isBooleanExpression, isDataInfo, isDataInfoEntries, isDiscoveredPColumn, isFilteredPColumn, isFolderURL, isImportFileHandleIndex, isImportFileHandleUpload, isKnownServiceName, isLabelColumn, isLinkerColumn, isLiveLog, isMainService, isNodeService, isPColumn, isPColumnResult, isPColumnSpec, isPColumnSpecResult, isPFrameDriverError, isPFrameError, isPFrameSpecDriverError, isPTableNA, isPartitionedDataInfoEntries, isPlRef, isPrimaryRef, isServiceAlreadyRegisteredError, isServiceError, isServiceInjectionError, isServiceInvalidIdError, isServiceMethodNotFoundError, isServiceNotRegisteredError, isValueNA, isWasmService, legacyColumnSelectorsToPredicate, mapDataInfo, mapDataInfoEntries, mapJoinEntry, mapPObjectData, mapPTableDef, mapPTableDefV2, mapSpecQueryColumns, mapValueInVOE, matchAxis, matchAxisId, matchPColumn, newRangeBytesOpt, pTableValue, pTableValueBranded, parseColumnId, parseDiscoveredPColumnId, parseHttpAuth, parseJson, plId, plRefsEqual, readAnnotation, readAnnotationJson, readAnnotationJsonOrThrow, readDomain, readDomainJson, readDomainJsonOrThrow, readMetadata, readMetadataJson, readMetadataJsonOrThrow, registerServiceCapabilities, resolveAnchors, resolveAnnotationParents, resolveNodeServiceHandler, resolveRequiredServices, serializeError, serializeHttpAuth, serializeResult, service, serviceFnKey, sortJoinEntry, sortPTableDef, sortSpecQuery, stringifyColumnId, stringifyDiscoveredPColumnId, stringifyJson, traverseQuerySpec, uniqueBy, uniquePlId, unwrapResult, validateRangeBytes, visitDataInfo, withEnrichments, wrapAndSerialize, wrapAndSerializeAsync, wrapAsyncCallback, wrapCallback };
|
|
46
|
+
export { AbortError, AllRequiresFeatureFlags, AllSupportsFeatureFlags, AnchoredIdDeriver, Annotation, AnnotationJson, ChunkedStreamReader, Code, DefaultNavigationState, Domain, DomainJson, IncompatibleFlagsError, LinkerMap, MODEL_SERVICE_METHOD_MAP, ModelServiceRegistry, PAxisName, PColumnName, PFrameDriverError, PFrameError, PFrameSpecDriverError, PTableNA, PlId, PlIdBytes, PlIdLength, PlRef, PoolEntryGuard, RangeBytes, ResourceTypeName, ResourceTypePrefix, RuntimeCapabilities, SERVICE_CAPABILITY_FLAGS, SERVICE_FEATURE_FLAGS, SERVICE_METHOD_MAP, ServiceAlreadyRegisteredError, ServiceError, ServiceInjectionError, ServiceInvalidIdError, ServiceMethodNotFoundError, ServiceNotRegisteredError, Services, UiError, UiServiceRegistry, ValueType, assertNever, base64Decode, base64Encode, bigintReplacer, buildServiceInfo, canonicalizeAxisId, canonicalizeAxisWithParents, canonicalizeJson, checkBlockFlag, collectSpecQueryColumns, createDiscoveredPColumn, createDiscoveredPColumnId, createEnrichmentRef, createNodeServiceHandlers, createPlRef, createPrimaryRef, dataInfoToEntries, deriveNativeId, deserializeError, deserializeResult, digestPlId, ensureError, ensurePColumn, entriesToDataInfo, executePSpecPredicate, extractAllColumns, extractAllRequirements, extractAllSupports, extractCodeWithInfo, extractConfigGeneric, getArrayFromAxisTree, getAxesId, getAxesTree, getAxisId, getColumnIdAndSpec, getDenormalizedAxesList, getFileNameFromHandle, getFilePathFromHandle, getMethodNames, getNormalizedAxesList, getPColumnSpecId, getPTableColumnId, getServiceKind, getServiceModelMethods, getServiceUiMethods, getSetFromAxisTree, getTypeFromPColumnOrAxisSpec, hasAbortError, isAbortError, isAggregateError, isAnchoredPColumnId, isAnyLogHandle, isAxisId, isBlockUIURL, isBooleanExpression, isDataInfo, isDataInfoEntries, isDiscoveredPColumn, isEnrichmentRef, isFilteredPColumn, isFolderURL, isImportFileHandleIndex, isImportFileHandleUpload, isKnownServiceName, isLabelColumn, isLinkerColumn, isLiveLog, isMainService, isNodeService, isPColumn, isPColumnResult, isPColumnSpec, isPColumnSpecResult, isPFrameDriverError, isPFrameError, isPFrameSpecDriverError, isPTableNA, isPartitionedDataInfoEntries, isPlRef, isPrimaryRef, isServiceAlreadyRegisteredError, isServiceError, isServiceInjectionError, isServiceInvalidIdError, isServiceMethodNotFoundError, isServiceNotRegisteredError, isValueNA, isWasmService, legacyColumnSelectorsToPredicate, mapDataInfo, mapDataInfoEntries, mapJoinEntry, mapPObjectData, mapPTableDef, mapPTableDefV2, mapSpecQueryColumns, mapValueInVOE, matchAxis, matchAxisId, matchMultiColumnSelector, matchPColumn, multiColumnSelectorsToPredicate, newRangeBytesOpt, pTableValue, pTableValueBranded, parseColumnId, parseDiscoveredPColumnId, parseHttpAuth, parseJson, plId, plRefsEqual, readAnnotation, readAnnotationJson, readAnnotationJsonOrThrow, readDomain, readDomainJson, readDomainJsonOrThrow, readMetadata, readMetadataJson, readMetadataJsonOrThrow, registerServiceCapabilities, resolveAnchors, resolveAnnotationParents, resolveNodeServiceHandler, resolveRequiredServices, serializeError, serializeHttpAuth, serializeResult, service, serviceFnKey, sortJoinEntry, sortPTableDef, sortSpecQuery, stringifyColumnId, stringifyDiscoveredPColumnId, stringifyJson, traverseQuerySpec, uniqueBy, uniquePlId, unwrapResult, validateRangeBytes, visitDataInfo, withEnrichments, wrapAndSerialize, wrapAndSerializeAsync, wrapAsyncCallback, wrapCallback };
|
package/dist/pool/index.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { ResultCollection, ResultPoolEntry } from "./entry.js";
|
|
2
1
|
import { PObject, PObjectId, PObjectSpec, ensurePColumn, extractAllColumns, isPColumn, isPColumnResult, isPColumnSpec, isPColumnSpecResult, mapPObjectData } from "./spec.js";
|
|
2
|
+
import { ResultCollection, ResultPoolEntry } from "./entry.js";
|
|
3
3
|
import { PSpecPredicate, executePSpecPredicate } from "./query.js";
|
package/dist/pool/spec.d.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { Branded } from "../branding.js";
|
|
2
|
-
import { ResultPoolEntry } from "./entry.js";
|
|
3
2
|
import { PColumn, PColumnLazy, PColumnSpec } from "../drivers/pframe/spec/spec.js";
|
|
4
3
|
import { JoinEntry } from "../drivers/pframe/table_calculate.js";
|
|
4
|
+
import { ResultPoolEntry } from "./entry.js";
|
|
5
|
+
|
|
5
6
|
//#region src/pool/spec.d.ts
|
|
6
7
|
/** Any object exported into the result pool by the block always have spec attached to it */
|
|
7
8
|
type PObjectSpec = {
|
package/dist/pool/spec.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"spec.d.ts","names":[],"sources":["../../src/pool/spec.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"spec.d.ts","names":[],"sources":["../../src/pool/spec.ts"],"mappings":";;;;;;;KAMY,WAAA;4CAED,IAAA,UAFC;EAAA,SAKD,IAAA;WAGA,MAAA,GAAS,MAAA;EAIO;;EAAA,SAAhB,aAAA,GAAgB,MAAA,kBAGI;EAAA,SAApB,WAAA,GAAc,MAAA;AAAA;;KAIb,SAAA,GAAY,OAAA;;;;;;UAOP,OAAA;EAPL;EAAA,SASD,EAAA,EAAI,SAAA;;WAGJ,IAAA,EAAM,WAAA;EAZc;EAAA,SAepB,IAAA,EAAM,IAAA;AAAA;AAAA,iBAGD,aAAA,CAAc,IAAA,EAAM,WAAA,GAAc,IAAA,IAAQ,WAAA;AAAA,iBAI1C,SAAA,GAAA,CAAa,GAAA,EAAK,OAAA,CAAQ,CAAA,IAAK,GAAA,IAAO,OAAA,CAAQ,CAAA;AAAA,iBAI9C,mBAAA,CACd,CAAA,EAAG,eAAA,CAAgB,WAAA,IAClB,CAAA,IAAK,eAAA,CAAgB,WAAA;AAAA,iBAIR,eAAA,GAAA,CACd,CAAA,EAAG,eAAA,CAAgB,OAAA,CAAQ,CAAA,KAC1B,CAAA,IAAK,eAAA,CAAgB,OAAA,CAAQ,CAAA;AAAA,iBAIhB,aAAA,GAAA,CAAiB,GAAA,EAAK,OAAA,CAAQ,CAAA,IAAK,OAAA,CAAQ,CAAA;AAAA,iBAK3C,cAAA,QAAA,CACd,IAAA,EAAM,OAAA,CAAQ,EAAA,IAAM,WAAA,CAAY,EAAA,GAChC,EAAA,GAAK,CAAA,EAAG,EAAA,KAAO,EAAA,GACd,OAAA,CAAQ,EAAA;AAAA,iBACK,cAAA,QAAA,CAAuB,IAAA,EAAM,OAAA,CAAQ,EAAA,GAAK,EAAA,GAAK,CAAA,EAAG,EAAA,KAAO,EAAA,GAAK,OAAA,CAAQ,EAAA;AAAA,iBACtE,cAAA,QAAA,CACd,IAAA,EAAM,OAAA,CAAQ,EAAA,eACd,EAAA,GAAK,CAAA,EAAG,EAAA,KAAO,EAAA,GACd,OAAA,CAAQ,EAAA;AAAA,iBACK,cAAA,QAAA,CAAuB,IAAA,EAAM,OAAA,CAAQ,EAAA,GAAK,EAAA,GAAK,CAAA,EAAG,EAAA,KAAO,EAAA,GAAK,OAAA,CAAQ,EAAA;AAAA,iBACtE,cAAA,QAAA,CACd,IAAA,EAAM,OAAA,CAAQ,EAAA,eACd,EAAA,GAAK,CAAA,EAAG,EAAA,KAAO,EAAA,GACd,OAAA,CAAQ,EAAA;AAAA,iBAaK,iBAAA,GAAA,CAAqB,KAAA,EAAO,SAAA,CAAU,OAAA,CAAQ,CAAA,KAAM,OAAA,CAAQ,CAAA"}
|
package/dist/ref.cjs
CHANGED
|
@@ -69,14 +69,28 @@ function createPrimaryRef(column, filter) {
|
|
|
69
69
|
column
|
|
70
70
|
};
|
|
71
71
|
}
|
|
72
|
+
function isEnrichmentRef(value) {
|
|
73
|
+
return typeof value === "object" && value !== null && value.__isEnrichment === "v1" && "hit" in value;
|
|
74
|
+
}
|
|
75
|
+
function createEnrichmentRef(hit, options = {}) {
|
|
76
|
+
const { path, qualifications } = options;
|
|
77
|
+
return {
|
|
78
|
+
__isEnrichment: "v1",
|
|
79
|
+
hit,
|
|
80
|
+
...path !== void 0 && path.length > 0 ? { path } : {},
|
|
81
|
+
...qualifications !== void 0 && qualifications.length > 0 ? { qualifications } : {}
|
|
82
|
+
};
|
|
83
|
+
}
|
|
72
84
|
/** Compare two PlRefs and returns true if they are qual */
|
|
73
85
|
function plRefsEqual(ref1, ref2, ignoreEnrichments = false) {
|
|
74
86
|
return ref1.blockId === ref2.blockId && ref1.name === ref2.name && (ignoreEnrichments || ref1.requireEnrichments === ref2.requireEnrichments);
|
|
75
87
|
}
|
|
76
88
|
//#endregion
|
|
77
89
|
exports.PlRef = PlRef;
|
|
90
|
+
exports.createEnrichmentRef = createEnrichmentRef;
|
|
78
91
|
exports.createPlRef = createPlRef;
|
|
79
92
|
exports.createPrimaryRef = createPrimaryRef;
|
|
93
|
+
exports.isEnrichmentRef = isEnrichmentRef;
|
|
80
94
|
exports.isPlRef = isPlRef;
|
|
81
95
|
exports.isPrimaryRef = isPrimaryRef;
|
|
82
96
|
exports.plRefsEqual = plRefsEqual;
|
package/dist/ref.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ref.cjs","names":["z"],"sources":["../src/ref.ts"],"sourcesContent":["import { z } from \"zod\";\n\nexport const PlRef = z\n .object({\n __isRef: z\n .literal(true)\n .describe(\"Crucial marker for the block dependency tree reconstruction\"),\n blockId: z.string().describe(\"Upstream block id\"),\n name: z.string().describe(\"Name of the output provided to the upstream block's output context\"),\n requireEnrichments: z\n .literal(true)\n .optional()\n .describe(\n \"True if current block that stores this reference in its args, may need enrichments \" +\n \"for the references value originating from the blocks in between current and referenced block\",\n ),\n })\n .describe(\n \"Universal reference type, allowing to set block connections. It is crucial that \" +\n \"{@link __isRef} is present and equal to true, internal logic relies on this marker \" +\n \"to build block dependency trees.\",\n )\n .readonly();\nexport type PlRef = z.infer<typeof PlRef>;\n/** @deprecated use {@link PlRef} */\nexport type Ref = PlRef;\n\n/**\n * Type guard to check if a value is a PlRef.\n *\n * @param value - The value to check.\n * @returns True if the value is a PlRef, false otherwise.\n */\nexport function isPlRef(value: unknown): value is PlRef {\n return (\n typeof value === \"object\" &&\n value !== null &&\n \"__isRef\" in value &&\n (value as { __isRef: unknown }).__isRef === true &&\n \"blockId\" in value &&\n \"name\" in value\n );\n}\n\n/** Standard way how to communicate possible connections given specific\n * requirements for incoming data. */\nexport type Option = {\n /** Fully rendered reference to be assigned for the intended field in block's\n * args */\n readonly ref: PlRef;\n\n /** Label to be present for the user in i.e. drop-down list */\n readonly label: string;\n};\n\n/**\n * Creates a PlRef with the given blockId and name.\n *\n * @param blockId - The blockId of the reference.\n * @param name - The name of the reference.\n * @param requireEnrichments - Whether the reference requires enrichments.\n */\nexport function createPlRef(\n blockId: string,\n name: string,\n requireEnrichments: boolean = false,\n): PlRef {\n if (requireEnrichments)\n return {\n __isRef: true,\n blockId,\n name,\n requireEnrichments: true,\n };\n else\n return {\n __isRef: true,\n blockId,\n name,\n };\n}\n\n/**\n * Creates a new PlRef based on an existing one, explicitly setting (default) or removing the\n * requireEnrichments property.\n *\n * @param ref - The original PlRef object.\n * @param requireEnrichments - If true, the `requireEnrichments: true` property is added\n * to the returned PlRef. If false, the `requireEnrichments` property is removed. Defaults to true.\n * @returns A new PlRef object with the `requireEnrichments` property set or removed accordingly.\n */\nexport function withEnrichments(ref: PlRef, requireEnrichments: boolean = true): PlRef {\n if (requireEnrichments)\n return {\n ...ref,\n requireEnrichments: true,\n };\n else {\n const { requireEnrichments: _, ...rest } = ref;\n return rest;\n }\n}\n\n/** Primary dataset reference with an optional filter. */\nexport type PrimaryRef = {\n readonly __isPrimaryRef: \"v1\";\n readonly column: PlRef;\n readonly filter?: PlRef;\n};\n\nexport function isPrimaryRef(value: unknown): value is PrimaryRef {\n return (\n typeof value === \"object\" &&\n value !== null &&\n (value as { __isPrimaryRef?: unknown }).__isPrimaryRef === \"v1\" &&\n \"column\" in value\n );\n}\n\nexport function createPrimaryRef(column: PlRef, filter?: PlRef): PrimaryRef {\n if (filter !== undefined) return { __isPrimaryRef: \"v1\", column, filter };\n else return { __isPrimaryRef: \"v1\", column };\n}\n\n/** Block args accept either form — backward compatible. */\nexport type DatasetInput = PlRef | PrimaryRef;\n\n/**
|
|
1
|
+
{"version":3,"file":"ref.cjs","names":["z"],"sources":["../src/ref.ts"],"sourcesContent":["import { z } from \"zod\";\nimport type { AxisQualification } from \"./drivers/pframe/spec/selectors\";\nimport type { PObjectId } from \"./pool/spec\";\n\nexport const PlRef = z\n .object({\n __isRef: z\n .literal(true)\n .describe(\"Crucial marker for the block dependency tree reconstruction\"),\n blockId: z.string().describe(\"Upstream block id\"),\n name: z.string().describe(\"Name of the output provided to the upstream block's output context\"),\n requireEnrichments: z\n .literal(true)\n .optional()\n .describe(\n \"True if current block that stores this reference in its args, may need enrichments \" +\n \"for the references value originating from the blocks in between current and referenced block\",\n ),\n })\n .describe(\n \"Universal reference type, allowing to set block connections. It is crucial that \" +\n \"{@link __isRef} is present and equal to true, internal logic relies on this marker \" +\n \"to build block dependency trees.\",\n )\n .readonly();\nexport type PlRef = z.infer<typeof PlRef>;\n/** @deprecated use {@link PlRef} */\nexport type Ref = PlRef;\n\n/**\n * Type guard to check if a value is a PlRef.\n *\n * @param value - The value to check.\n * @returns True if the value is a PlRef, false otherwise.\n */\nexport function isPlRef(value: unknown): value is PlRef {\n return (\n typeof value === \"object\" &&\n value !== null &&\n \"__isRef\" in value &&\n (value as { __isRef: unknown }).__isRef === true &&\n \"blockId\" in value &&\n \"name\" in value\n );\n}\n\n/** Standard way how to communicate possible connections given specific\n * requirements for incoming data. */\nexport type Option = {\n /** Fully rendered reference to be assigned for the intended field in block's\n * args */\n readonly ref: PlRef;\n\n /** Label to be present for the user in i.e. drop-down list */\n readonly label: string;\n};\n\n/**\n * Creates a PlRef with the given blockId and name.\n *\n * @param blockId - The blockId of the reference.\n * @param name - The name of the reference.\n * @param requireEnrichments - Whether the reference requires enrichments.\n */\nexport function createPlRef(\n blockId: string,\n name: string,\n requireEnrichments: boolean = false,\n): PlRef {\n if (requireEnrichments)\n return {\n __isRef: true,\n blockId,\n name,\n requireEnrichments: true,\n };\n else\n return {\n __isRef: true,\n blockId,\n name,\n };\n}\n\n/**\n * Creates a new PlRef based on an existing one, explicitly setting (default) or removing the\n * requireEnrichments property.\n *\n * @param ref - The original PlRef object.\n * @param requireEnrichments - If true, the `requireEnrichments: true` property is added\n * to the returned PlRef. If false, the `requireEnrichments` property is removed. Defaults to true.\n * @returns A new PlRef object with the `requireEnrichments` property set or removed accordingly.\n */\nexport function withEnrichments(ref: PlRef, requireEnrichments: boolean = true): PlRef {\n if (requireEnrichments)\n return {\n ...ref,\n requireEnrichments: true,\n };\n else {\n const { requireEnrichments: _, ...rest } = ref;\n return rest;\n }\n}\n\n/** Primary dataset reference with an optional filter. */\nexport type PrimaryRef = {\n readonly __isPrimaryRef: \"v1\";\n readonly column: PlRef;\n readonly filter?: PlRef;\n};\n\nexport function isPrimaryRef(value: unknown): value is PrimaryRef {\n return (\n typeof value === \"object\" &&\n value !== null &&\n (value as { __isPrimaryRef?: unknown }).__isPrimaryRef === \"v1\" &&\n \"column\" in value\n );\n}\n\nexport function createPrimaryRef(column: PlRef, filter?: PlRef): PrimaryRef {\n if (filter !== undefined) return { __isPrimaryRef: \"v1\", column, filter };\n else return { __isPrimaryRef: \"v1\", column };\n}\n\n/** Block args accept either form — backward compatible. */\nexport type DatasetInput = PlRef | PrimaryRef;\n\n/** Many-to-one linker hop. */\nexport type EnrichmentLinkerStep = {\n readonly type: \"linker\";\n readonly linker: PObjectId;\n};\n\n/** Step from primary to hit. `path[0]` applied first. */\nexport type EnrichmentStep = EnrichmentLinkerStep;\n\n/**\n * Enrichment column reached via {@link path} linker hops; omitted means zero-hop.\n * `hit` and `path[].linker` are global-form {@link PObjectId}s\n * (`canonicalize({ __isRef: true, blockId, name })`) which the workflow decodes\n * to a PlRef before resolving. For a prerun-sourced hop, supply a resolved\n * `{spec, data}` map in place of the id — `tableBuilder` accepts both.\n */\nexport type EnrichmentRef = {\n readonly __isEnrichment: \"v1\";\n readonly hit: PObjectId;\n readonly path?: readonly EnrichmentStep[];\n readonly qualifications?: readonly AxisQualification[];\n};\n\nexport function isEnrichmentRef(value: unknown): value is EnrichmentRef {\n return (\n typeof value === \"object\" &&\n value !== null &&\n (value as { __isEnrichment?: unknown }).__isEnrichment === \"v1\" &&\n \"hit\" in value\n );\n}\n\nexport type CreateEnrichmentRefOptions = {\n readonly path?: readonly EnrichmentStep[];\n readonly qualifications?: readonly AxisQualification[];\n};\n\nexport function createEnrichmentRef(\n hit: PObjectId,\n options: CreateEnrichmentRefOptions = {},\n): EnrichmentRef {\n const { path, qualifications } = options;\n return {\n __isEnrichment: \"v1\",\n hit,\n ...(path !== undefined && path.length > 0 ? { path } : {}),\n ...(qualifications !== undefined && qualifications.length > 0 ? { qualifications } : {}),\n };\n}\n\n/** {@link EnrichmentRef} plus the export header label. */\nexport type LabeledEnrichmentRef = {\n readonly ref: EnrichmentRef;\n readonly label: string;\n};\n\n/** Auto-attached enrichment payload; not user-picked. */\nexport type LabeledEnrichmentRefs = readonly LabeledEnrichmentRef[];\n\n/** Compare two PlRefs and returns true if they are qual */\nexport function plRefsEqual(ref1: PlRef, ref2: PlRef, ignoreEnrichments: boolean = false) {\n return (\n ref1.blockId === ref2.blockId &&\n ref1.name === ref2.name &&\n (ignoreEnrichments || ref1.requireEnrichments === ref2.requireEnrichments)\n );\n}\n"],"mappings":";;;AAIA,MAAa,QAAQA,IAAAA,EAClB,OAAO;CACN,SAASA,IAAAA,EACN,QAAQ,KAAK,CACb,SAAS,8DAA8D;CAC1E,SAASA,IAAAA,EAAE,QAAQ,CAAC,SAAS,oBAAoB;CACjD,MAAMA,IAAAA,EAAE,QAAQ,CAAC,SAAS,qEAAqE;CAC/F,oBAAoBA,IAAAA,EACjB,QAAQ,KAAK,CACb,UAAU,CACV,SACC,kLAED;CACJ,CAAC,CACD,SACC,sMAGD,CACA,UAAU;;;;;;;AAWb,SAAgB,QAAQ,OAAgC;AACtD,QACE,OAAO,UAAU,YACjB,UAAU,QACV,aAAa,SACZ,MAA+B,YAAY,QAC5C,aAAa,SACb,UAAU;;;;;;;;;AAsBd,SAAgB,YACd,SACA,MACA,qBAA8B,OACvB;AACP,KAAI,mBACF,QAAO;EACL,SAAS;EACT;EACA;EACA,oBAAoB;EACrB;KAED,QAAO;EACL,SAAS;EACT;EACA;EACD;;;;;;;;;;;AAYL,SAAgB,gBAAgB,KAAY,qBAA8B,MAAa;AACrF,KAAI,mBACF,QAAO;EACL,GAAG;EACH,oBAAoB;EACrB;MACE;EACH,MAAM,EAAE,oBAAoB,GAAG,GAAG,SAAS;AAC3C,SAAO;;;AAWX,SAAgB,aAAa,OAAqC;AAChE,QACE,OAAO,UAAU,YACjB,UAAU,QACT,MAAuC,mBAAmB,QAC3D,YAAY;;AAIhB,SAAgB,iBAAiB,QAAe,QAA4B;AAC1E,KAAI,WAAW,KAAA,EAAW,QAAO;EAAE,gBAAgB;EAAM;EAAQ;EAAQ;KACpE,QAAO;EAAE,gBAAgB;EAAM;EAAQ;;AA6B9C,SAAgB,gBAAgB,OAAwC;AACtE,QACE,OAAO,UAAU,YACjB,UAAU,QACT,MAAuC,mBAAmB,QAC3D,SAAS;;AASb,SAAgB,oBACd,KACA,UAAsC,EAAE,EACzB;CACf,MAAM,EAAE,MAAM,mBAAmB;AACjC,QAAO;EACL,gBAAgB;EAChB;EACA,GAAI,SAAS,KAAA,KAAa,KAAK,SAAS,IAAI,EAAE,MAAM,GAAG,EAAE;EACzD,GAAI,mBAAmB,KAAA,KAAa,eAAe,SAAS,IAAI,EAAE,gBAAgB,GAAG,EAAE;EACxF;;;AAaH,SAAgB,YAAY,MAAa,MAAa,oBAA6B,OAAO;AACxF,QACE,KAAK,YAAY,KAAK,WACtB,KAAK,SAAS,KAAK,SAClB,qBAAqB,KAAK,uBAAuB,KAAK"}
|
package/dist/ref.d.ts
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { AxisQualification } from "./drivers/pframe/spec/selectors.js";
|
|
2
|
+
import { PObjectId } from "./pool/spec.js";
|
|
1
3
|
import { z } from "zod";
|
|
2
4
|
|
|
3
5
|
//#region src/ref.d.ts
|
|
@@ -63,12 +65,41 @@ declare function isPrimaryRef(value: unknown): value is PrimaryRef;
|
|
|
63
65
|
declare function createPrimaryRef(column: PlRef, filter?: PlRef): PrimaryRef;
|
|
64
66
|
/** Block args accept either form — backward compatible. */
|
|
65
67
|
type DatasetInput = PlRef | PrimaryRef;
|
|
66
|
-
/**
|
|
67
|
-
type
|
|
68
|
-
readonly
|
|
68
|
+
/** Many-to-one linker hop. */
|
|
69
|
+
type EnrichmentLinkerStep = {
|
|
70
|
+
readonly type: "linker";
|
|
71
|
+
readonly linker: PObjectId;
|
|
69
72
|
};
|
|
73
|
+
/** Step from primary to hit. `path[0]` applied first. */
|
|
74
|
+
type EnrichmentStep = EnrichmentLinkerStep;
|
|
75
|
+
/**
|
|
76
|
+
* Enrichment column reached via {@link path} linker hops; omitted means zero-hop.
|
|
77
|
+
* `hit` and `path[].linker` are global-form {@link PObjectId}s
|
|
78
|
+
* (`canonicalize({ __isRef: true, blockId, name })`) which the workflow decodes
|
|
79
|
+
* to a PlRef before resolving. For a prerun-sourced hop, supply a resolved
|
|
80
|
+
* `{spec, data}` map in place of the id — `tableBuilder` accepts both.
|
|
81
|
+
*/
|
|
82
|
+
type EnrichmentRef = {
|
|
83
|
+
readonly __isEnrichment: "v1";
|
|
84
|
+
readonly hit: PObjectId;
|
|
85
|
+
readonly path?: readonly EnrichmentStep[];
|
|
86
|
+
readonly qualifications?: readonly AxisQualification[];
|
|
87
|
+
};
|
|
88
|
+
declare function isEnrichmentRef(value: unknown): value is EnrichmentRef;
|
|
89
|
+
type CreateEnrichmentRefOptions = {
|
|
90
|
+
readonly path?: readonly EnrichmentStep[];
|
|
91
|
+
readonly qualifications?: readonly AxisQualification[];
|
|
92
|
+
};
|
|
93
|
+
declare function createEnrichmentRef(hit: PObjectId, options?: CreateEnrichmentRefOptions): EnrichmentRef;
|
|
94
|
+
/** {@link EnrichmentRef} plus the export header label. */
|
|
95
|
+
type LabeledEnrichmentRef = {
|
|
96
|
+
readonly ref: EnrichmentRef;
|
|
97
|
+
readonly label: string;
|
|
98
|
+
};
|
|
99
|
+
/** Auto-attached enrichment payload; not user-picked. */
|
|
100
|
+
type LabeledEnrichmentRefs = readonly LabeledEnrichmentRef[];
|
|
70
101
|
/** Compare two PlRefs and returns true if they are qual */
|
|
71
102
|
declare function plRefsEqual(ref1: PlRef, ref2: PlRef, ignoreEnrichments?: boolean): boolean;
|
|
72
103
|
//#endregion
|
|
73
|
-
export { DatasetInput,
|
|
104
|
+
export { CreateEnrichmentRefOptions, DatasetInput, EnrichmentLinkerStep, EnrichmentRef, EnrichmentStep, LabeledEnrichmentRef, LabeledEnrichmentRefs, Option, PlRef, PrimaryRef, Ref, createEnrichmentRef, createPlRef, createPrimaryRef, isEnrichmentRef, isPlRef, isPrimaryRef, plRefsEqual, withEnrichments };
|
|
74
105
|
//# sourceMappingURL=ref.d.ts.map
|
package/dist/ref.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ref.d.ts","names":[],"sources":["../src/ref.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"ref.d.ts","names":[],"sources":["../src/ref.ts"],"mappings":";;;;;cAIa,KAAA,EAAK,CAAA,CAAA,WAAA,CAAA,CAAA,CAAA,SAAA;;;;;;;;;;;;;;;;KAqBN,KAAA,GAAQ,CAAA,CAAE,KAAA,QAAa,KAAA;;KAEvB,GAAA,GAAM,KAAA;;;;;;;iBAQF,OAAA,CAAQ,KAAA,YAAiB,KAAA,IAAS,KAAA;;;KAatC,MAAA;;;WAGD,GAAA,EAAK,KAAA;WAGL,KAAA;AAAA;;;;;;;;iBAUK,WAAA,CACd,OAAA,UACA,IAAA,UACA,kBAAA,aACC,KAAA;;;AA3CH;;;;;;;iBAoEgB,eAAA,CAAgB,GAAA,EAAK,KAAA,EAAO,kBAAA,aAAqC,KAAA;;KAarE,UAAA;EAAA,SACD,cAAA;EAAA,SACA,MAAA,EAAQ,KAAA;EAAA,SACR,MAAA,GAAS,KAAA;AAAA;AAAA,iBAGJ,YAAA,CAAa,KAAA,YAAiB,KAAA,IAAS,UAAA;AAAA,iBASvC,gBAAA,CAAiB,MAAA,EAAQ,KAAA,EAAO,MAAA,GAAS,KAAA,GAAQ,UAAA;;KAMrD,YAAA,GAAe,KAAA,GAAQ,UAAA;;KAGvB,oBAAA;EAAA,SACD,IAAA;EAAA,SACA,MAAA,EAAQ,SAAA;AAAA;AApFnB;AAAA,KAwFY,cAAA,GAAiB,oBAAA;;;;;;;;KASjB,aAAA;EAAA,SACD,cAAA;EAAA,SACA,GAAA,EAAK,SAAA;EAAA,SACL,IAAA,YAAgB,cAAA;EAAA,SAChB,cAAA,YAA0B,iBAAA;AAAA;AAAA,iBAGrB,eAAA,CAAgB,KAAA,YAAiB,KAAA,IAAS,aAAA;AAAA,KAS9C,0BAAA;EAAA,SACD,IAAA,YAAgB,cAAA;EAAA,SAChB,cAAA,YAA0B,iBAAA;AAAA;AAAA,iBAGrB,mBAAA,CACd,GAAA,EAAK,SAAA,EACL,OAAA,GAAS,0BAAA,GACR,aAAA;;KAWS,oBAAA;EAAA,SACD,GAAA,EAAK,aAAA;EAAA,SACL,KAAA;AAAA;;KAIC,qBAAA,YAAiC,oBAAA;;iBAG7B,WAAA,CAAY,IAAA,EAAM,KAAA,EAAO,IAAA,EAAM,KAAA,EAAO,iBAAA"}
|
package/dist/ref.js
CHANGED
|
@@ -68,11 +68,23 @@ function createPrimaryRef(column, filter) {
|
|
|
68
68
|
column
|
|
69
69
|
};
|
|
70
70
|
}
|
|
71
|
+
function isEnrichmentRef(value) {
|
|
72
|
+
return typeof value === "object" && value !== null && value.__isEnrichment === "v1" && "hit" in value;
|
|
73
|
+
}
|
|
74
|
+
function createEnrichmentRef(hit, options = {}) {
|
|
75
|
+
const { path, qualifications } = options;
|
|
76
|
+
return {
|
|
77
|
+
__isEnrichment: "v1",
|
|
78
|
+
hit,
|
|
79
|
+
...path !== void 0 && path.length > 0 ? { path } : {},
|
|
80
|
+
...qualifications !== void 0 && qualifications.length > 0 ? { qualifications } : {}
|
|
81
|
+
};
|
|
82
|
+
}
|
|
71
83
|
/** Compare two PlRefs and returns true if they are qual */
|
|
72
84
|
function plRefsEqual(ref1, ref2, ignoreEnrichments = false) {
|
|
73
85
|
return ref1.blockId === ref2.blockId && ref1.name === ref2.name && (ignoreEnrichments || ref1.requireEnrichments === ref2.requireEnrichments);
|
|
74
86
|
}
|
|
75
87
|
//#endregion
|
|
76
|
-
export { PlRef, createPlRef, createPrimaryRef, isPlRef, isPrimaryRef, plRefsEqual, withEnrichments };
|
|
88
|
+
export { PlRef, createEnrichmentRef, createPlRef, createPrimaryRef, isEnrichmentRef, isPlRef, isPrimaryRef, plRefsEqual, withEnrichments };
|
|
77
89
|
|
|
78
90
|
//# sourceMappingURL=ref.js.map
|
package/dist/ref.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ref.js","names":[],"sources":["../src/ref.ts"],"sourcesContent":["import { z } from \"zod\";\n\nexport const PlRef = z\n .object({\n __isRef: z\n .literal(true)\n .describe(\"Crucial marker for the block dependency tree reconstruction\"),\n blockId: z.string().describe(\"Upstream block id\"),\n name: z.string().describe(\"Name of the output provided to the upstream block's output context\"),\n requireEnrichments: z\n .literal(true)\n .optional()\n .describe(\n \"True if current block that stores this reference in its args, may need enrichments \" +\n \"for the references value originating from the blocks in between current and referenced block\",\n ),\n })\n .describe(\n \"Universal reference type, allowing to set block connections. It is crucial that \" +\n \"{@link __isRef} is present and equal to true, internal logic relies on this marker \" +\n \"to build block dependency trees.\",\n )\n .readonly();\nexport type PlRef = z.infer<typeof PlRef>;\n/** @deprecated use {@link PlRef} */\nexport type Ref = PlRef;\n\n/**\n * Type guard to check if a value is a PlRef.\n *\n * @param value - The value to check.\n * @returns True if the value is a PlRef, false otherwise.\n */\nexport function isPlRef(value: unknown): value is PlRef {\n return (\n typeof value === \"object\" &&\n value !== null &&\n \"__isRef\" in value &&\n (value as { __isRef: unknown }).__isRef === true &&\n \"blockId\" in value &&\n \"name\" in value\n );\n}\n\n/** Standard way how to communicate possible connections given specific\n * requirements for incoming data. */\nexport type Option = {\n /** Fully rendered reference to be assigned for the intended field in block's\n * args */\n readonly ref: PlRef;\n\n /** Label to be present for the user in i.e. drop-down list */\n readonly label: string;\n};\n\n/**\n * Creates a PlRef with the given blockId and name.\n *\n * @param blockId - The blockId of the reference.\n * @param name - The name of the reference.\n * @param requireEnrichments - Whether the reference requires enrichments.\n */\nexport function createPlRef(\n blockId: string,\n name: string,\n requireEnrichments: boolean = false,\n): PlRef {\n if (requireEnrichments)\n return {\n __isRef: true,\n blockId,\n name,\n requireEnrichments: true,\n };\n else\n return {\n __isRef: true,\n blockId,\n name,\n };\n}\n\n/**\n * Creates a new PlRef based on an existing one, explicitly setting (default) or removing the\n * requireEnrichments property.\n *\n * @param ref - The original PlRef object.\n * @param requireEnrichments - If true, the `requireEnrichments: true` property is added\n * to the returned PlRef. If false, the `requireEnrichments` property is removed. Defaults to true.\n * @returns A new PlRef object with the `requireEnrichments` property set or removed accordingly.\n */\nexport function withEnrichments(ref: PlRef, requireEnrichments: boolean = true): PlRef {\n if (requireEnrichments)\n return {\n ...ref,\n requireEnrichments: true,\n };\n else {\n const { requireEnrichments: _, ...rest } = ref;\n return rest;\n }\n}\n\n/** Primary dataset reference with an optional filter. */\nexport type PrimaryRef = {\n readonly __isPrimaryRef: \"v1\";\n readonly column: PlRef;\n readonly filter?: PlRef;\n};\n\nexport function isPrimaryRef(value: unknown): value is PrimaryRef {\n return (\n typeof value === \"object\" &&\n value !== null &&\n (value as { __isPrimaryRef?: unknown }).__isPrimaryRef === \"v1\" &&\n \"column\" in value\n );\n}\n\nexport function createPrimaryRef(column: PlRef, filter?: PlRef): PrimaryRef {\n if (filter !== undefined) return { __isPrimaryRef: \"v1\", column, filter };\n else return { __isPrimaryRef: \"v1\", column };\n}\n\n/** Block args accept either form — backward compatible. */\nexport type DatasetInput = PlRef | PrimaryRef;\n\n/**
|
|
1
|
+
{"version":3,"file":"ref.js","names":[],"sources":["../src/ref.ts"],"sourcesContent":["import { z } from \"zod\";\nimport type { AxisQualification } from \"./drivers/pframe/spec/selectors\";\nimport type { PObjectId } from \"./pool/spec\";\n\nexport const PlRef = z\n .object({\n __isRef: z\n .literal(true)\n .describe(\"Crucial marker for the block dependency tree reconstruction\"),\n blockId: z.string().describe(\"Upstream block id\"),\n name: z.string().describe(\"Name of the output provided to the upstream block's output context\"),\n requireEnrichments: z\n .literal(true)\n .optional()\n .describe(\n \"True if current block that stores this reference in its args, may need enrichments \" +\n \"for the references value originating from the blocks in between current and referenced block\",\n ),\n })\n .describe(\n \"Universal reference type, allowing to set block connections. It is crucial that \" +\n \"{@link __isRef} is present and equal to true, internal logic relies on this marker \" +\n \"to build block dependency trees.\",\n )\n .readonly();\nexport type PlRef = z.infer<typeof PlRef>;\n/** @deprecated use {@link PlRef} */\nexport type Ref = PlRef;\n\n/**\n * Type guard to check if a value is a PlRef.\n *\n * @param value - The value to check.\n * @returns True if the value is a PlRef, false otherwise.\n */\nexport function isPlRef(value: unknown): value is PlRef {\n return (\n typeof value === \"object\" &&\n value !== null &&\n \"__isRef\" in value &&\n (value as { __isRef: unknown }).__isRef === true &&\n \"blockId\" in value &&\n \"name\" in value\n );\n}\n\n/** Standard way how to communicate possible connections given specific\n * requirements for incoming data. */\nexport type Option = {\n /** Fully rendered reference to be assigned for the intended field in block's\n * args */\n readonly ref: PlRef;\n\n /** Label to be present for the user in i.e. drop-down list */\n readonly label: string;\n};\n\n/**\n * Creates a PlRef with the given blockId and name.\n *\n * @param blockId - The blockId of the reference.\n * @param name - The name of the reference.\n * @param requireEnrichments - Whether the reference requires enrichments.\n */\nexport function createPlRef(\n blockId: string,\n name: string,\n requireEnrichments: boolean = false,\n): PlRef {\n if (requireEnrichments)\n return {\n __isRef: true,\n blockId,\n name,\n requireEnrichments: true,\n };\n else\n return {\n __isRef: true,\n blockId,\n name,\n };\n}\n\n/**\n * Creates a new PlRef based on an existing one, explicitly setting (default) or removing the\n * requireEnrichments property.\n *\n * @param ref - The original PlRef object.\n * @param requireEnrichments - If true, the `requireEnrichments: true` property is added\n * to the returned PlRef. If false, the `requireEnrichments` property is removed. Defaults to true.\n * @returns A new PlRef object with the `requireEnrichments` property set or removed accordingly.\n */\nexport function withEnrichments(ref: PlRef, requireEnrichments: boolean = true): PlRef {\n if (requireEnrichments)\n return {\n ...ref,\n requireEnrichments: true,\n };\n else {\n const { requireEnrichments: _, ...rest } = ref;\n return rest;\n }\n}\n\n/** Primary dataset reference with an optional filter. */\nexport type PrimaryRef = {\n readonly __isPrimaryRef: \"v1\";\n readonly column: PlRef;\n readonly filter?: PlRef;\n};\n\nexport function isPrimaryRef(value: unknown): value is PrimaryRef {\n return (\n typeof value === \"object\" &&\n value !== null &&\n (value as { __isPrimaryRef?: unknown }).__isPrimaryRef === \"v1\" &&\n \"column\" in value\n );\n}\n\nexport function createPrimaryRef(column: PlRef, filter?: PlRef): PrimaryRef {\n if (filter !== undefined) return { __isPrimaryRef: \"v1\", column, filter };\n else return { __isPrimaryRef: \"v1\", column };\n}\n\n/** Block args accept either form — backward compatible. */\nexport type DatasetInput = PlRef | PrimaryRef;\n\n/** Many-to-one linker hop. */\nexport type EnrichmentLinkerStep = {\n readonly type: \"linker\";\n readonly linker: PObjectId;\n};\n\n/** Step from primary to hit. `path[0]` applied first. */\nexport type EnrichmentStep = EnrichmentLinkerStep;\n\n/**\n * Enrichment column reached via {@link path} linker hops; omitted means zero-hop.\n * `hit` and `path[].linker` are global-form {@link PObjectId}s\n * (`canonicalize({ __isRef: true, blockId, name })`) which the workflow decodes\n * to a PlRef before resolving. For a prerun-sourced hop, supply a resolved\n * `{spec, data}` map in place of the id — `tableBuilder` accepts both.\n */\nexport type EnrichmentRef = {\n readonly __isEnrichment: \"v1\";\n readonly hit: PObjectId;\n readonly path?: readonly EnrichmentStep[];\n readonly qualifications?: readonly AxisQualification[];\n};\n\nexport function isEnrichmentRef(value: unknown): value is EnrichmentRef {\n return (\n typeof value === \"object\" &&\n value !== null &&\n (value as { __isEnrichment?: unknown }).__isEnrichment === \"v1\" &&\n \"hit\" in value\n );\n}\n\nexport type CreateEnrichmentRefOptions = {\n readonly path?: readonly EnrichmentStep[];\n readonly qualifications?: readonly AxisQualification[];\n};\n\nexport function createEnrichmentRef(\n hit: PObjectId,\n options: CreateEnrichmentRefOptions = {},\n): EnrichmentRef {\n const { path, qualifications } = options;\n return {\n __isEnrichment: \"v1\",\n hit,\n ...(path !== undefined && path.length > 0 ? { path } : {}),\n ...(qualifications !== undefined && qualifications.length > 0 ? { qualifications } : {}),\n };\n}\n\n/** {@link EnrichmentRef} plus the export header label. */\nexport type LabeledEnrichmentRef = {\n readonly ref: EnrichmentRef;\n readonly label: string;\n};\n\n/** Auto-attached enrichment payload; not user-picked. */\nexport type LabeledEnrichmentRefs = readonly LabeledEnrichmentRef[];\n\n/** Compare two PlRefs and returns true if they are qual */\nexport function plRefsEqual(ref1: PlRef, ref2: PlRef, ignoreEnrichments: boolean = false) {\n return (\n ref1.blockId === ref2.blockId &&\n ref1.name === ref2.name &&\n (ignoreEnrichments || ref1.requireEnrichments === ref2.requireEnrichments)\n );\n}\n"],"mappings":";;AAIA,MAAa,QAAQ,EAClB,OAAO;CACN,SAAS,EACN,QAAQ,KAAK,CACb,SAAS,8DAA8D;CAC1E,SAAS,EAAE,QAAQ,CAAC,SAAS,oBAAoB;CACjD,MAAM,EAAE,QAAQ,CAAC,SAAS,qEAAqE;CAC/F,oBAAoB,EACjB,QAAQ,KAAK,CACb,UAAU,CACV,SACC,kLAED;CACJ,CAAC,CACD,SACC,sMAGD,CACA,UAAU;;;;;;;AAWb,SAAgB,QAAQ,OAAgC;AACtD,QACE,OAAO,UAAU,YACjB,UAAU,QACV,aAAa,SACZ,MAA+B,YAAY,QAC5C,aAAa,SACb,UAAU;;;;;;;;;AAsBd,SAAgB,YACd,SACA,MACA,qBAA8B,OACvB;AACP,KAAI,mBACF,QAAO;EACL,SAAS;EACT;EACA;EACA,oBAAoB;EACrB;KAED,QAAO;EACL,SAAS;EACT;EACA;EACD;;;;;;;;;;;AAYL,SAAgB,gBAAgB,KAAY,qBAA8B,MAAa;AACrF,KAAI,mBACF,QAAO;EACL,GAAG;EACH,oBAAoB;EACrB;MACE;EACH,MAAM,EAAE,oBAAoB,GAAG,GAAG,SAAS;AAC3C,SAAO;;;AAWX,SAAgB,aAAa,OAAqC;AAChE,QACE,OAAO,UAAU,YACjB,UAAU,QACT,MAAuC,mBAAmB,QAC3D,YAAY;;AAIhB,SAAgB,iBAAiB,QAAe,QAA4B;AAC1E,KAAI,WAAW,KAAA,EAAW,QAAO;EAAE,gBAAgB;EAAM;EAAQ;EAAQ;KACpE,QAAO;EAAE,gBAAgB;EAAM;EAAQ;;AA6B9C,SAAgB,gBAAgB,OAAwC;AACtE,QACE,OAAO,UAAU,YACjB,UAAU,QACT,MAAuC,mBAAmB,QAC3D,SAAS;;AASb,SAAgB,oBACd,KACA,UAAsC,EAAE,EACzB;CACf,MAAM,EAAE,MAAM,mBAAmB;AACjC,QAAO;EACL,gBAAgB;EAChB;EACA,GAAI,SAAS,KAAA,KAAa,KAAK,SAAS,IAAI,EAAE,MAAM,GAAG,EAAE;EACzD,GAAI,mBAAmB,KAAA,KAAa,eAAe,SAAS,IAAI,EAAE,gBAAgB,GAAG,EAAE;EACxF;;;AAaH,SAAgB,YAAY,MAAa,MAAa,oBAA6B,OAAO;AACxF,QACE,KAAK,YAAY,KAAK,WACtB,KAAK,SAAS,KAAK,SAClB,qBAAqB,KAAK,uBAAuB,KAAK"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Branded, throwError } from "@milaboratories/helpers";
|
|
2
2
|
import { PObjectId } from "../../../pool";
|
|
3
|
-
import { AxisQualification } from "
|
|
3
|
+
import { AxisQualification } from "./selectors";
|
|
4
4
|
import { canonicalizeJson } from "../../../json";
|
|
5
5
|
|
|
6
6
|
export type DiscoveredPColumn = {
|
|
@@ -15,7 +15,6 @@ export type DiscoveredPColumnId = Branded<PObjectId, "DiscoveredPColumnId">; //
|
|
|
15
15
|
type PathItem = {
|
|
16
16
|
type: "linker";
|
|
17
17
|
column: PObjectId;
|
|
18
|
-
qualifications: AxisQualification[];
|
|
19
18
|
};
|
|
20
19
|
|
|
21
20
|
export function isDiscoveredPColumn(obj: unknown): obj is DiscoveredPColumn {
|
|
@@ -1,4 +1,10 @@
|
|
|
1
1
|
import { isPColumnSpec, type PObjectSpec } from "../../../pool";
|
|
2
|
+
import type {
|
|
3
|
+
MatcherMap,
|
|
4
|
+
MultiAxisSelector,
|
|
5
|
+
MultiColumnSelector,
|
|
6
|
+
StringMatcher,
|
|
7
|
+
} from "../spec_driver";
|
|
2
8
|
import type { AxisId, AxisValueType, Domain, PColumnSpec, ValueType } from "./spec";
|
|
3
9
|
import { getAxisId } from "./spec";
|
|
4
10
|
|
|
@@ -62,6 +68,14 @@ export interface SingleAxisSelector {
|
|
|
62
68
|
parentAxes?: SingleAxisSelector[];
|
|
63
69
|
}
|
|
64
70
|
|
|
71
|
+
/** Qualification applied to a single axis to make it compatible during integration. */
|
|
72
|
+
export interface AxisQualification {
|
|
73
|
+
/** Axis selector identifying which axis is qualified. */
|
|
74
|
+
readonly axis: SingleAxisSelector;
|
|
75
|
+
/** Additional context domain entries applied to the axis. */
|
|
76
|
+
readonly contextDomain: Record<string, string>;
|
|
77
|
+
}
|
|
78
|
+
|
|
65
79
|
/**
|
|
66
80
|
* Reference to an axis by its numerical index within the anchor column's axes array
|
|
67
81
|
* Format: [anchorId, axisIndex]
|
|
@@ -312,3 +326,74 @@ export function legacyColumnSelectorsToPredicate(
|
|
|
312
326
|
predicateOrSelectors.some((selector) => isPColumnSpec(spec) && matchPColumn(spec, selector));
|
|
313
327
|
else return (spec) => isPColumnSpec(spec) && matchPColumn(spec, predicateOrSelectors);
|
|
314
328
|
}
|
|
329
|
+
|
|
330
|
+
function matchString(matcher: StringMatcher, value: string): boolean {
|
|
331
|
+
return matcher.type === "exact" ? value === matcher.value : new RegExp(matcher.value).test(value);
|
|
332
|
+
}
|
|
333
|
+
|
|
334
|
+
function matchMatcherMap(map: MatcherMap, target: Record<string, string> | undefined): boolean {
|
|
335
|
+
const t = target ?? {};
|
|
336
|
+
for (const [key, matchers] of Object.entries(map)) {
|
|
337
|
+
const v = t[key];
|
|
338
|
+
if (v === undefined) return false;
|
|
339
|
+
if (!matchers.some((m) => matchString(m, v))) return false;
|
|
340
|
+
}
|
|
341
|
+
return true;
|
|
342
|
+
}
|
|
343
|
+
|
|
344
|
+
function matchMultiAxis(selector: MultiAxisSelector, axis: AxisId): boolean {
|
|
345
|
+
if (selector.type !== undefined && !selector.type.includes(axis.type)) return false;
|
|
346
|
+
if (selector.name !== undefined && !selector.name.some((m) => matchString(m, axis.name)))
|
|
347
|
+
return false;
|
|
348
|
+
if (selector.domain !== undefined && !matchMatcherMap(selector.domain, axis.domain)) return false;
|
|
349
|
+
if (
|
|
350
|
+
selector.contextDomain !== undefined &&
|
|
351
|
+
!matchMatcherMap(selector.contextDomain, axis.contextDomain)
|
|
352
|
+
)
|
|
353
|
+
return false;
|
|
354
|
+
return true;
|
|
355
|
+
}
|
|
356
|
+
|
|
357
|
+
/** Match a {@link PColumnSpec} against a {@link MultiColumnSelector}. */
|
|
358
|
+
export function matchMultiColumnSelector(
|
|
359
|
+
spec: PColumnSpec,
|
|
360
|
+
selector: MultiColumnSelector,
|
|
361
|
+
): boolean {
|
|
362
|
+
if (selector.type !== undefined && !selector.type.includes(spec.valueType)) return false;
|
|
363
|
+
if (selector.name !== undefined && !selector.name.some((m) => matchString(m, spec.name)))
|
|
364
|
+
return false;
|
|
365
|
+
if (selector.domain !== undefined && !matchMatcherMap(selector.domain, spec.domain)) return false;
|
|
366
|
+
if (
|
|
367
|
+
selector.contextDomain !== undefined &&
|
|
368
|
+
!matchMatcherMap(selector.contextDomain, spec.contextDomain)
|
|
369
|
+
)
|
|
370
|
+
return false;
|
|
371
|
+
if (
|
|
372
|
+
selector.annotations !== undefined &&
|
|
373
|
+
!matchMatcherMap(selector.annotations, spec.annotations)
|
|
374
|
+
)
|
|
375
|
+
return false;
|
|
376
|
+
if (selector.axes !== undefined) {
|
|
377
|
+
const columnAxes = spec.axesSpec.map(getAxisId);
|
|
378
|
+
if (selector.partialAxesMatch ?? true) {
|
|
379
|
+
for (const axisSelector of selector.axes)
|
|
380
|
+
if (!columnAxes.some((axis) => matchMultiAxis(axisSelector, axis))) return false;
|
|
381
|
+
} else {
|
|
382
|
+
if (columnAxes.length !== selector.axes.length) return false;
|
|
383
|
+
for (let i = 0; i < selector.axes.length; i++)
|
|
384
|
+
if (!matchMultiAxis(selector.axes[i], columnAxes[i])) return false;
|
|
385
|
+
}
|
|
386
|
+
}
|
|
387
|
+
return true;
|
|
388
|
+
}
|
|
389
|
+
|
|
390
|
+
/**
|
|
391
|
+
* Convert a {@link MultiColumnSelector} (or array; selectors OR-ed) to a predicate.
|
|
392
|
+
* Non-PColumn specs always return false.
|
|
393
|
+
*/
|
|
394
|
+
export function multiColumnSelectorsToPredicate(
|
|
395
|
+
selectors: MultiColumnSelector | MultiColumnSelector[],
|
|
396
|
+
): (spec: PObjectSpec) => boolean {
|
|
397
|
+
const arr = Array.isArray(selectors) ? selectors : [selectors];
|
|
398
|
+
return (spec) => isPColumnSpec(spec) && arr.some((sel) => matchMultiColumnSelector(spec, sel));
|
|
399
|
+
}
|
|
@@ -122,6 +122,7 @@ export const Annotation = {
|
|
|
122
122
|
AxisNature: "pl7.app/axisNature",
|
|
123
123
|
Alphabet: "pl7.app/alphabet",
|
|
124
124
|
Description: "pl7.app/description",
|
|
125
|
+
DataStatus: "pl7.app/dataStatus",
|
|
125
126
|
DiscreteValues: "pl7.app/discreteValues",
|
|
126
127
|
Format: "pl7.app/format",
|
|
127
128
|
Graph: {
|
|
@@ -173,11 +174,14 @@ export const Annotation = {
|
|
|
173
174
|
},
|
|
174
175
|
} as const;
|
|
175
176
|
|
|
177
|
+
export type AnnotationDataStatus = "computing" | "ready" | "error" | "absent";
|
|
178
|
+
|
|
176
179
|
export type Annotation = Metadata &
|
|
177
180
|
Partial<{
|
|
178
181
|
[Annotation.Alphabet]: "nucleotide" | "aminoacid" | (string & {});
|
|
179
182
|
[Annotation.AxisNature]: "homogeneous" | "heterogeneous" | "scaleCompatible" | (string & {});
|
|
180
183
|
[Annotation.Description]: string;
|
|
184
|
+
[Annotation.DataStatus]: AnnotationDataStatus;
|
|
181
185
|
[Annotation.DiscreteValues]: StringifiedJson<number[]> | StringifiedJson<string[]>;
|
|
182
186
|
[Annotation.Format]: string;
|
|
183
187
|
[Annotation.Graph.Axis.HighCardinality]: StringifiedJson<boolean>;
|
|
@@ -9,6 +9,7 @@ import type {
|
|
|
9
9
|
PColumnInfo,
|
|
10
10
|
PColumnSpec,
|
|
11
11
|
SingleAxisSelector,
|
|
12
|
+
AxisQualification,
|
|
12
13
|
AxisValueType,
|
|
13
14
|
ColumnValueType,
|
|
14
15
|
} from "./spec";
|
|
@@ -62,14 +63,6 @@ export interface MultiColumnSelector {
|
|
|
62
63
|
readonly partialAxesMatch?: boolean;
|
|
63
64
|
}
|
|
64
65
|
|
|
65
|
-
/** Qualification applied to a single axis to make it compatible during integration. */
|
|
66
|
-
export interface AxisQualification {
|
|
67
|
-
/** Axis selector identifying which axis is qualified. */
|
|
68
|
-
readonly axis: SingleAxisSelector;
|
|
69
|
-
/** Additional context domain entries applied to the axis. */
|
|
70
|
-
readonly contextDomain: Record<string, string>;
|
|
71
|
-
}
|
|
72
|
-
|
|
73
66
|
/** Qualifications needed for both query (already-integrated) columns and the hit column. */
|
|
74
67
|
export interface ColumnAxesWithQualifications {
|
|
75
68
|
/** Already integrated (query) columns with their qualifications. */
|
|
@@ -109,8 +102,6 @@ export interface DiscoverColumnsLinkerStep {
|
|
|
109
102
|
type: "linker";
|
|
110
103
|
/** The linker column traversed in this step */
|
|
111
104
|
linker: PColumnIdAndSpec;
|
|
112
|
-
/** Axis qualifications produced when matching the linker's many-side axes */
|
|
113
|
-
qualifications: AxisQualification[];
|
|
114
105
|
}
|
|
115
106
|
|
|
116
107
|
/**
|