@milaboratories/pl-model-common 1.34.0 → 1.34.1

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.
Files changed (49) hide show
  1. package/dist/drivers/index.cjs +1 -0
  2. package/dist/drivers/index.d.ts +8 -7
  3. package/dist/drivers/index.js +1 -0
  4. package/dist/drivers/pframe/driver.d.ts +1 -1
  5. package/dist/drivers/pframe/index.cjs +1 -0
  6. package/dist/drivers/pframe/index.d.ts +8 -7
  7. package/dist/drivers/pframe/index.js +1 -0
  8. package/dist/drivers/pframe/spec/anchored.cjs +2 -1
  9. package/dist/drivers/pframe/spec/anchored.cjs.map +1 -1
  10. package/dist/drivers/pframe/spec/anchored.d.ts +2 -1
  11. package/dist/drivers/pframe/spec/anchored.d.ts.map +1 -1
  12. package/dist/drivers/pframe/spec/anchored.js +2 -1
  13. package/dist/drivers/pframe/spec/anchored.js.map +1 -1
  14. package/dist/drivers/pframe/spec/discovered_column.cjs +32 -0
  15. package/dist/drivers/pframe/spec/discovered_column.cjs.map +1 -0
  16. package/dist/drivers/pframe/spec/discovered_column.d.ts +35 -0
  17. package/dist/drivers/pframe/spec/discovered_column.d.ts.map +1 -0
  18. package/dist/drivers/pframe/spec/discovered_column.js +27 -0
  19. package/dist/drivers/pframe/spec/discovered_column.js.map +1 -0
  20. package/dist/drivers/pframe/spec/ids.cjs.map +1 -1
  21. package/dist/drivers/pframe/spec/ids.d.ts +2 -1
  22. package/dist/drivers/pframe/spec/ids.d.ts.map +1 -1
  23. package/dist/drivers/pframe/spec/ids.js.map +1 -1
  24. package/dist/drivers/pframe/spec/index.cjs +1 -0
  25. package/dist/drivers/pframe/spec/index.d.ts +3 -2
  26. package/dist/drivers/pframe/spec/index.js +1 -0
  27. package/dist/drivers/pframe/spec/spec.cjs +2 -1
  28. package/dist/drivers/pframe/spec/spec.cjs.map +1 -1
  29. package/dist/drivers/pframe/spec/spec.d.ts +2 -0
  30. package/dist/drivers/pframe/spec/spec.d.ts.map +1 -1
  31. package/dist/drivers/pframe/spec/spec.js +2 -1
  32. package/dist/drivers/pframe/spec/spec.js.map +1 -1
  33. package/dist/drivers/pframe/spec_driver.d.ts +1 -1
  34. package/dist/drivers/pframe/table.d.ts +1 -1
  35. package/dist/drivers/pframe/table_calculate.d.ts +1 -1
  36. package/dist/index.cjs +6 -0
  37. package/dist/index.d.ts +10 -9
  38. package/dist/index.js +2 -1
  39. package/dist/services/service_types.cjs.map +1 -1
  40. package/dist/services/service_types.d.ts +5 -5
  41. package/dist/services/service_types.d.ts.map +1 -1
  42. package/dist/services/service_types.js.map +1 -1
  43. package/package.json +3 -3
  44. package/src/drivers/pframe/spec/anchored.ts +2 -1
  45. package/src/drivers/pframe/spec/discovered_column.ts +65 -0
  46. package/src/drivers/pframe/spec/ids.ts +3 -1
  47. package/src/drivers/pframe/spec/index.ts +1 -0
  48. package/src/drivers/pframe/spec/spec.ts +2 -0
  49. package/src/services/service_types.ts +9 -5
package/dist/index.js CHANGED
@@ -22,6 +22,7 @@ import { ensurePColumn, extractAllColumns, isPColumn, isPColumnResult, isPColumn
22
22
  import { executePSpecPredicate } from "./pool/query.js";
23
23
  import { isAnchoredPColumnId, legacyColumnSelectorsToPredicate, matchAxis, matchPColumn } from "./drivers/pframe/spec/selectors.js";
24
24
  import { deriveNativeId } from "./drivers/pframe/spec/native_id.js";
25
+ import { createDiscoveredPColumn, createDiscoveredPColumnId, isDiscoveredPColumn, parseDiscoveredPColumnId, stringifyDiscoveredPColumnId } from "./drivers/pframe/spec/discovered_column.js";
25
26
  import { LinkerMap } from "./drivers/pframe/linker_columns.js";
26
27
  import { ChunkedStreamReader } from "./drivers/ChunkedStreamReader.js";
27
28
  import "./drivers/index.js";
@@ -42,4 +43,4 @@ import { createUiServiceInjectors } from "./services/service_injector_factory.js
42
43
  import { SERVICE_METHOD_MAP, buildServiceInfo, resolveUiInjector } from "./services/service_injectors.js";
43
44
  import "./services/index.js";
44
45
  import { PoolEntryGuard } from "./pool_entry.js";
45
- export { AbortError, AllRequiresFeatureFlags, AllSupportsFeatureFlags, AnchoredIdDeriver, Annotation, AnnotationJson, ChunkedStreamReader, Code, DefaultNavigationState, Domain, DomainJson, IncompatibleFlagsError, LinkerMap, 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, createPlRef, createUiServiceInjectors, 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, getSetFromAxisTree, getTypeFromPColumnOrAxisSpec, hasAbortError, isAbortError, isAggregateError, isAnchoredPColumnId, isAnyLogHandle, isAxisId, isBlockUIURL, isBooleanExpression, isDataInfo, isDataInfoEntries, isFilteredPColumn, isFolderURL, isImportFileHandleIndex, isImportFileHandleUpload, isKnownServiceName, isLabelColumn, isLinkerColumn, isLiveLog, isNodeService, isPColumn, isPColumnResult, isPColumnSpec, isPColumnSpecResult, isPFrameDriverError, isPFrameError, isPFrameSpecDriverError, isPTableNA, isPartitionedDataInfoEntries, isPlRef, isServiceAlreadyRegisteredError, isServiceError, isServiceInjectionError, isServiceInvalidIdError, isServiceMethodNotFoundError, isServiceNotRegisteredError, legacyColumnSelectorsToPredicate, mapDataInfo, mapDataInfoEntries, mapJoinEntry, mapPObjectData, mapPTableDef, mapPTableDefV2, mapSpecQueryColumns, mapValueInVOE, matchAxis, matchAxisId, matchPColumn, newRangeBytesOpt, pTableValue, pTableValueBranded, parseColumnId, parseHttpAuth, parseJson, plId, plRefsEqual, readAnnotation, readAnnotationJson, readAnnotationJsonOrThrow, readDomain, readDomainJson, readDomainJsonOrThrow, readMetadata, readMetadataJson, readMetadataJsonOrThrow, registerServiceCapabilities, resolveAnchors, resolveAnnotationParents, resolveRequiredServices, resolveUiInjector, serializeError, serializeHttpAuth, serializeResult, service, serviceFnKey, sortJoinEntry, sortPTableDef, sortSpecQuery, stringifyColumnId, 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, 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, createPlRef, createUiServiceInjectors, 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, getSetFromAxisTree, getTypeFromPColumnOrAxisSpec, hasAbortError, isAbortError, isAggregateError, isAnchoredPColumnId, isAnyLogHandle, isAxisId, isBlockUIURL, isBooleanExpression, isDataInfo, isDataInfoEntries, isDiscoveredPColumn, isFilteredPColumn, isFolderURL, isImportFileHandleIndex, isImportFileHandleUpload, isKnownServiceName, isLabelColumn, isLinkerColumn, isLiveLog, isNodeService, isPColumn, isPColumnResult, isPColumnSpec, isPColumnSpecResult, isPFrameDriverError, isPFrameError, isPFrameSpecDriverError, isPTableNA, isPartitionedDataInfoEntries, isPlRef, isServiceAlreadyRegisteredError, isServiceError, isServiceInjectionError, isServiceInvalidIdError, isServiceMethodNotFoundError, isServiceNotRegisteredError, 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, resolveRequiredServices, resolveUiInjector, serializeError, serializeHttpAuth, serializeResult, service, serviceFnKey, sortJoinEntry, sortPTableDef, sortSpecQuery, stringifyColumnId, stringifyDiscoveredPColumnId, stringifyJson, traverseQuerySpec, uniqueBy, uniquePlId, unwrapResult, validateRangeBytes, visitDataInfo, withEnrichments, wrapAndSerialize, wrapAndSerializeAsync, wrapAsyncCallback, wrapCallback };
@@ -1 +1 @@
1
- {"version":3,"file":"service_types.cjs","names":["ServiceInvalidIdError","ServiceAlreadyRegisteredError"],"sources":["../../src/services/service_types.ts"],"sourcesContent":["import { UnionToIntersection } from \"@milaboratories/helpers\";\nimport type { Branded } from \"../branding\";\nimport { ServiceAlreadyRegisteredError, ServiceInvalidIdError } from \"../errors\";\nimport type { Services } from \"./service_declarations\";\n\nexport type ServiceTypesLike<\n Model = unknown,\n Ui = unknown,\n Kind extends ServiceType = ServiceType,\n> = {\n readonly __types?: { model: Model; ui: Ui; kind: Kind };\n};\n\nexport type InferServiceModel<S extends ServiceTypesLike> =\n S extends ServiceTypesLike<infer M, unknown, ServiceType> ? M : unknown;\n\nexport type InferServiceUi<S extends ServiceTypesLike> =\n S extends ServiceTypesLike<unknown, infer U, ServiceType> ? U : unknown;\n\nexport type InferServiceKind<S extends ServiceTypesLike> =\n S extends ServiceTypesLike<unknown, unknown, infer K> ? K : ServiceType;\n\nexport type ServiceName<S extends ServiceTypesLike = ServiceTypesLike> = Branded<string, S>;\n\nexport type ServiceType = \"node\" | \"wasm\";\n\nconst SERVICE_ID_PATTERN = /^[a-zA-Z][a-zA-Z0-9]*$/;\n\nexport const { service, isNodeService } = (() => {\n const typeMap = new Map<string, ServiceType>();\n return {\n service<Model, Ui>() {\n return <K extends ServiceType, N extends string>(options: {\n readonly type: K;\n readonly name: N;\n }): Branded<N, ServiceTypesLike<Model, Ui, K>> => {\n const { name, type } = options;\n if (!SERVICE_ID_PATTERN.test(name)) {\n throw new ServiceInvalidIdError(\n `Invalid service ID \"${name}\": must match ${SERVICE_ID_PATTERN}`,\n );\n }\n if (typeMap.has(name)) {\n throw new ServiceAlreadyRegisteredError(`Service \"${name}\" already registered`);\n }\n typeMap.set(name, type);\n return name as Branded<N, ServiceTypesLike<Model, Ui, K>>;\n };\n },\n isNodeService(id: ServiceName): boolean {\n return typeMap.get(id) === \"node\";\n },\n };\n})();\n\nexport function serviceFnKey(serviceId: string, method = \"\"): string {\n return `service:${serviceId}:${method}`;\n}\n\nexport type ServiceBrand<T> =\n T extends Branded<string, infer S extends ServiceTypesLike> ? S : never;\n\nexport type ModelServiceFactoryMap<SMap extends Record<string, ServiceName>> = {\n [K in keyof SMap]: (() => InferServiceModel<ServiceBrand<SMap[K]>>) | null;\n};\n\nexport type UiServiceFactoryMap<SMap extends Record<string, ServiceName>> = {\n [K in keyof SMap]: (() => InferServiceUi<ServiceBrand<SMap[K]>>) | null;\n};\n\n/** Contract between any service provider and any service consumer. */\nexport interface ServiceDispatch {\n getServiceNames(): ServiceName[];\n getServiceMethods(serviceId: ServiceName): string[];\n callServiceMethod(serviceId: ServiceName, method: string, ...args: unknown[]): unknown;\n}\n\n// Auto-derived types from the Services const in service_declarations.ts.\n// Adding a service to Services automatically updates all of these.\n\ntype SMap = typeof Services;\n\ntype ExtractServiceName<T> = T extends Branded<infer N extends string, any> ? N : never;\n\n/** Model-side service interfaces keyed by service name literal. */\nexport type ModelServices = {\n [K in keyof SMap as ExtractServiceName<SMap[K]>]: InferServiceModel<ServiceBrand<SMap[K]>>;\n};\n\n/** UI-side service interfaces keyed by service name literal. */\nexport type UiServices = {\n [K in keyof SMap as ExtractServiceName<SMap[K]>]: InferServiceUi<ServiceBrand<SMap[K]>>;\n};\n\n/** Map from Services keys to their unbranded string name literals. */\nexport type ServiceNameLiterals = {\n [K in keyof SMap]: ExtractServiceName<SMap[K]>;\n};\n\n/** Auto-derived requires* feature flags from Services keys. */\nexport type ServiceRequireFlags = {\n [K in keyof SMap as `requires${K & string}`]?: boolean;\n};\n\nexport type RequireServices<T extends ServiceName> = UnionToIntersection<\n T extends Branded<infer N extends string, infer S extends ServiceTypesLike>\n ? Record<N, InferServiceModel<S>>\n : never\n>;\n"],"mappings":";;AA0BA,MAAM,qBAAqB;AAE3B,MAAa,EAAE,SAAS,yBAAyB;CAC/C,MAAM,0BAAU,IAAI,KAA0B;AAC9C,QAAO;EACL,UAAqB;AACnB,WAAiD,YAGC;IAChD,MAAM,EAAE,MAAM,SAAS;AACvB,QAAI,CAAC,mBAAmB,KAAK,KAAK,CAChC,OAAM,IAAIA,eAAAA,sBACR,uBAAuB,KAAK,gBAAgB,qBAC7C;AAEH,QAAI,QAAQ,IAAI,KAAK,CACnB,OAAM,IAAIC,eAAAA,8BAA8B,YAAY,KAAK,sBAAsB;AAEjF,YAAQ,IAAI,MAAM,KAAK;AACvB,WAAO;;;EAGX,cAAc,IAA0B;AACtC,UAAO,QAAQ,IAAI,GAAG,KAAK;;EAE9B;IACC;AAEJ,SAAgB,aAAa,WAAmB,SAAS,IAAY;AACnE,QAAO,WAAW,UAAU,GAAG"}
1
+ {"version":3,"file":"service_types.cjs","names":["ServiceInvalidIdError","ServiceAlreadyRegisteredError"],"sources":["../../src/services/service_types.ts"],"sourcesContent":["import { UnionToIntersection } from \"@milaboratories/helpers\";\nimport type { Branded } from \"../branding\";\nimport { ServiceAlreadyRegisteredError, ServiceInvalidIdError } from \"../errors\";\nimport type { Services } from \"./service_declarations\";\n\nexport type ServiceTypesLike<\n Model = unknown,\n Ui = unknown,\n Kind extends ServiceType = ServiceType,\n> = {\n readonly __types?: { model: Model; ui: Ui; kind: Kind };\n};\n\nexport type InferServiceModel<S extends ServiceTypesLike> =\n S extends ServiceTypesLike<infer M, unknown, ServiceType> ? M : unknown;\n\nexport type InferServiceUi<S extends ServiceTypesLike> =\n S extends ServiceTypesLike<unknown, infer U, ServiceType> ? U : unknown;\n\nexport type InferServiceKind<S extends ServiceTypesLike> =\n S extends ServiceTypesLike<unknown, unknown, infer K> ? K : ServiceType;\n\nexport type ServiceName<S extends ServiceTypesLike = ServiceTypesLike> = Branded<string, S>;\n\nexport type ServiceType = \"node\" | \"wasm\";\n\nconst SERVICE_ID_PATTERN = /^[a-zA-Z][a-zA-Z0-9]*$/;\n\nexport const { service, isNodeService } = (() => {\n const typeMap = new Map<string, ServiceType>();\n return {\n service<Model, Ui>() {\n return <K extends ServiceType, N extends string>(options: {\n readonly type: K;\n readonly name: N;\n }): Branded<N, ServiceTypesLike<Model, Ui, K>> => {\n const { name, type } = options;\n if (!SERVICE_ID_PATTERN.test(name)) {\n throw new ServiceInvalidIdError(\n `Invalid service ID \"${name}\": must match ${SERVICE_ID_PATTERN}`,\n );\n }\n if (typeMap.has(name)) {\n throw new ServiceAlreadyRegisteredError(`Service \"${name}\" already registered`);\n }\n typeMap.set(name, type);\n return name as Branded<N, ServiceTypesLike<Model, Ui, K>>;\n };\n },\n isNodeService(id: ServiceName): boolean {\n return typeMap.get(id) === \"node\";\n },\n };\n})();\n\nexport function serviceFnKey(serviceId: string, method = \"\"): string {\n return `service:${serviceId}:${method}`;\n}\n\nexport type ServiceBrand<T> =\n T extends Branded<string, infer S extends ServiceTypesLike> ? S : never;\n\nexport type ModelServiceFactoryMap<SMap extends Record<string, ServiceName>> = {\n [K in keyof SMap]: (() => InferServiceModel<ServiceBrand<SMap[K]>>) | null;\n};\n\nexport type UiServiceFactoryMap<SMap extends Record<string, ServiceName>> = {\n [K in keyof SMap]: (() => InferServiceUi<ServiceBrand<SMap[K]>>) | null;\n};\n\n/** Contract between any service provider and any service consumer. */\nexport interface ServiceDispatch {\n getServiceNames(): ServiceName[];\n getServiceMethods(serviceId: ServiceName): string[];\n callServiceMethod(serviceId: ServiceName, method: string, ...args: unknown[]): unknown;\n}\n\n// Auto-derived types from the Services const in service_declarations.ts.\n// Adding a service to Services automatically updates all of these.\n\ntype TServices = typeof Services;\n\ntype ExtractServiceName<T> = T extends Branded<infer N extends string, any> ? N : never;\n\n/** Model-side service interfaces keyed by service name literal. */\nexport type ModelServices = {\n [K in keyof TServices as ExtractServiceName<TServices[K]>]: InferServiceModel<\n ServiceBrand<TServices[K]>\n >;\n};\n\n/** UI-side service interfaces keyed by service name literal. */\nexport type UiServices = {\n [K in keyof TServices as ExtractServiceName<TServices[K]>]: InferServiceUi<\n ServiceBrand<TServices[K]>\n >;\n};\n\n/** Map from Services keys to their unbranded string name literals. */\nexport type ServiceNameLiterals = {\n [K in keyof TServices]: ExtractServiceName<TServices[K]>;\n};\n\n/** Auto-derived requires* feature flags from Services keys. */\nexport type ServiceRequireFlags = {\n [K in keyof TServices as `requires${K & string}`]?: boolean;\n};\n\nexport type RequireServices<T extends ServiceName> = UnionToIntersection<\n T extends Branded<infer N extends string, infer S extends ServiceTypesLike>\n ? Record<N, InferServiceModel<S>>\n : never\n>;\n"],"mappings":";;AA0BA,MAAM,qBAAqB;AAE3B,MAAa,EAAE,SAAS,yBAAyB;CAC/C,MAAM,0BAAU,IAAI,KAA0B;AAC9C,QAAO;EACL,UAAqB;AACnB,WAAiD,YAGC;IAChD,MAAM,EAAE,MAAM,SAAS;AACvB,QAAI,CAAC,mBAAmB,KAAK,KAAK,CAChC,OAAM,IAAIA,eAAAA,sBACR,uBAAuB,KAAK,gBAAgB,qBAC7C;AAEH,QAAI,QAAQ,IAAI,KAAK,CACnB,OAAM,IAAIC,eAAAA,8BAA8B,YAAY,KAAK,sBAAsB;AAEjF,YAAQ,IAAI,MAAM,KAAK;AACvB,WAAO;;;EAGX,cAAc,IAA0B;AACtC,UAAO,QAAQ,IAAI,GAAG,KAAK;;EAE9B;IACC;AAEJ,SAAgB,aAAa,WAAmB,SAAS,IAAY;AACnE,QAAO,WAAW,UAAU,GAAG"}
@@ -29,16 +29,16 @@ interface ServiceDispatch {
29
29
  getServiceMethods(serviceId: ServiceName): string[];
30
30
  callServiceMethod(serviceId: ServiceName, method: string, ...args: unknown[]): unknown;
31
31
  }
32
- type SMap = typeof Services;
32
+ type TServices = typeof Services;
33
33
  type ExtractServiceName<T> = T extends Branded$1<infer N extends string, any> ? N : never;
34
34
  /** Model-side service interfaces keyed by service name literal. */
35
- type ModelServices = { [K in keyof SMap as ExtractServiceName<SMap[K]>]: InferServiceModel<ServiceBrand<SMap[K]>> };
35
+ type ModelServices = { [K in keyof TServices as ExtractServiceName<TServices[K]>]: InferServiceModel<ServiceBrand<TServices[K]>> };
36
36
  /** UI-side service interfaces keyed by service name literal. */
37
- type UiServices = { [K in keyof SMap as ExtractServiceName<SMap[K]>]: InferServiceUi<ServiceBrand<SMap[K]>> };
37
+ type UiServices = { [K in keyof TServices as ExtractServiceName<TServices[K]>]: InferServiceUi<ServiceBrand<TServices[K]>> };
38
38
  /** Map from Services keys to their unbranded string name literals. */
39
- type ServiceNameLiterals = { [K in keyof SMap]: ExtractServiceName<SMap[K]> };
39
+ type ServiceNameLiterals = { [K in keyof TServices]: ExtractServiceName<TServices[K]> };
40
40
  /** Auto-derived requires* feature flags from Services keys. */
41
- type ServiceRequireFlags = { [K in keyof SMap as `requires${K & string}`]?: boolean };
41
+ type ServiceRequireFlags = { [K in keyof TServices as `requires${K & string}`]?: boolean };
42
42
  type RequireServices<T extends ServiceName> = UnionToIntersection<T extends Branded$1<infer N extends string, infer S extends ServiceTypesLike> ? Record<N, InferServiceModel<S>> : never>;
43
43
  //#endregion
44
44
  export { InferServiceKind, InferServiceModel, InferServiceUi, ModelServiceFactoryMap, ModelServices, RequireServices, ServiceBrand, ServiceDispatch, ServiceName, ServiceNameLiterals, ServiceRequireFlags, ServiceType, ServiceTypesLike, UiServiceFactoryMap, UiServices, isNodeService, service, serviceFnKey };
@@ -1 +1 @@
1
- {"version":3,"file":"service_types.d.ts","names":[],"sources":["../../src/services/service_types.ts"],"mappings":";;;;;KAKY,gBAAA,6CAGG,WAAA,GAAc,WAAA;EAAA,SAElB,OAAA;IAAY,KAAA,EAAO,KAAA;IAAO,EAAA,EAAI,EAAA;IAAI,IAAA,EAAM,IAAA;EAAA;AAAA;AAAA,KAGvC,iBAAA,WAA4B,gBAAA,IACtC,CAAA,SAAU,gBAAA,mBAAmC,WAAA,IAAe,CAAA;AAAA,KAElD,cAAA,WAAyB,gBAAA,IACnC,CAAA,SAAU,gBAAA,mBAAmC,WAAA,IAAe,CAAA;AAAA,KAElD,gBAAA,WAA2B,gBAAA,IACrC,CAAA,SAAU,gBAAA,8BAA8C,CAAA,GAAI,WAAA;AAAA,KAElD,WAAA,WAAsB,gBAAA,GAAmB,gBAAA,IAAoB,SAAA,SAAgB,CAAA;AAAA,KAE7E,WAAA;AAAA,cAIG,OAAA,8BAIS,WAAA,oBAA6B,OAAA;IAAA,SACpC,IAAA,EAAM,CAAA;IAAA,SACN,IAAA,EAAM,CAAA;EAAA,MACb,SAAA,CAAQ,CAAA,EAAG,gBAAA,CAAiB,KAAA,EAAO,EAAA,EAAI,CAAA,IAAA,aAAA,GAPZ,EAAA,EAqBf,WAAA;AAAA,iBAMN,YAAA,CAAa,SAAA,UAAmB,MAAA;AAAA,KAIpC,YAAA,MACV,CAAA,SAAU,SAAA,yBAAgC,gBAAA,IAAoB,CAAA;AAAA,KAEpD,sBAAA,cAAoC,MAAA,SAAe,WAAA,mBACjD,IAAA,UAAc,iBAAA,CAAkB,YAAA,CAAa,IAAA,CAAK,CAAA;AAAA,KAGpD,mBAAA,cAAiC,MAAA,SAAe,WAAA,mBAC9C,IAAA,UAAc,cAAA,CAAe,YAAA,CAAa,IAAA,CAAK,CAAA;;UAI5C,eAAA;EACf,eAAA,IAAmB,WAAA;EACnB,iBAAA,CAAkB,SAAA,EAAW,WAAA;EAC7B,iBAAA,CAAkB,SAAA,EAAW,WAAA,EAAa,MAAA,aAAmB,IAAA;AAAA;AAAA,KAM1D,IAAA,UAAc,QAAA;AAAA,KAEd,kBAAA,MAAwB,CAAA,SAAU,SAAA,gCAAuC,CAAA;;KAGlE,aAAA,iBACE,IAAA,IAAQ,kBAAA,CAAmB,IAAA,CAAK,CAAA,KAAM,iBAAA,CAAkB,YAAA,CAAa,IAAA,CAAK,CAAA;;KAI5E,UAAA,iBACE,IAAA,IAAQ,kBAAA,CAAmB,IAAA,CAAK,CAAA,KAAM,cAAA,CAAe,YAAA,CAAa,IAAA,CAAK,CAAA;;KAIzE,mBAAA,iBACE,IAAA,GAAO,kBAAA,CAAmB,IAAA,CAAK,CAAA;AAhF7C;AAAA,KAoFY,mBAAA,iBACE,IAAA,eAAmB,CAAA;AAAA,KAGrB,eAAA,WAA0B,WAAA,IAAe,mBAAA,CACnD,CAAA,SAAU,SAAA,yCAAgD,gBAAA,IACtD,MAAA,CAAO,CAAA,EAAG,iBAAA,CAAkB,CAAA"}
1
+ {"version":3,"file":"service_types.d.ts","names":[],"sources":["../../src/services/service_types.ts"],"mappings":";;;;;KAKY,gBAAA,6CAGG,WAAA,GAAc,WAAA;EAAA,SAElB,OAAA;IAAY,KAAA,EAAO,KAAA;IAAO,EAAA,EAAI,EAAA;IAAI,IAAA,EAAM,IAAA;EAAA;AAAA;AAAA,KAGvC,iBAAA,WAA4B,gBAAA,IACtC,CAAA,SAAU,gBAAA,mBAAmC,WAAA,IAAe,CAAA;AAAA,KAElD,cAAA,WAAyB,gBAAA,IACnC,CAAA,SAAU,gBAAA,mBAAmC,WAAA,IAAe,CAAA;AAAA,KAElD,gBAAA,WAA2B,gBAAA,IACrC,CAAA,SAAU,gBAAA,8BAA8C,CAAA,GAAI,WAAA;AAAA,KAElD,WAAA,WAAsB,gBAAA,GAAmB,gBAAA,IAAoB,SAAA,SAAgB,CAAA;AAAA,KAE7E,WAAA;AAAA,cAIG,OAAA,8BAIS,WAAA,oBAA6B,OAAA;IAAA,SACpC,IAAA,EAAM,CAAA;IAAA,SACN,IAAA,EAAM,CAAA;EAAA,MACb,SAAA,CAAQ,CAAA,EAAG,gBAAA,CAAiB,KAAA,EAAO,EAAA,EAAI,CAAA,IAAA,aAAA,GAPZ,EAAA,EAqBf,WAAA;AAAA,iBAMN,YAAA,CAAa,SAAA,UAAmB,MAAA;AAAA,KAIpC,YAAA,MACV,CAAA,SAAU,SAAA,yBAAgC,gBAAA,IAAoB,CAAA;AAAA,KAEpD,sBAAA,cAAoC,MAAA,SAAe,WAAA,mBACjD,IAAA,UAAc,iBAAA,CAAkB,YAAA,CAAa,IAAA,CAAK,CAAA;AAAA,KAGpD,mBAAA,cAAiC,MAAA,SAAe,WAAA,mBAC9C,IAAA,UAAc,cAAA,CAAe,YAAA,CAAa,IAAA,CAAK,CAAA;;UAI5C,eAAA;EACf,eAAA,IAAmB,WAAA;EACnB,iBAAA,CAAkB,SAAA,EAAW,WAAA;EAC7B,iBAAA,CAAkB,SAAA,EAAW,WAAA,EAAa,MAAA,aAAmB,IAAA;AAAA;AAAA,KAM1D,SAAA,UAAmB,QAAA;AAAA,KAEnB,kBAAA,MAAwB,CAAA,SAAU,SAAA,gCAAuC,CAAA;;KAGlE,aAAA,iBACE,SAAA,IAAa,kBAAA,CAAmB,SAAA,CAAU,CAAA,KAAM,iBAAA,CAC1D,YAAA,CAAa,SAAA,CAAU,CAAA;;KAKf,UAAA,iBACE,SAAA,IAAa,kBAAA,CAAmB,SAAA,CAAU,CAAA,KAAM,cAAA,CAC1D,YAAA,CAAa,SAAA,CAAU,CAAA;;KAKf,mBAAA,iBACE,SAAA,GAAY,kBAAA,CAAmB,SAAA,CAAU,CAAA;AApFvD;AAAA,KAwFY,mBAAA,iBACE,SAAA,eAAwB,CAAA;AAAA,KAG1B,eAAA,WAA0B,WAAA,IAAe,mBAAA,CACnD,CAAA,SAAU,SAAA,yCAAgD,gBAAA,IACtD,MAAA,CAAO,CAAA,EAAG,iBAAA,CAAkB,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"service_types.js","names":[],"sources":["../../src/services/service_types.ts"],"sourcesContent":["import { UnionToIntersection } from \"@milaboratories/helpers\";\nimport type { Branded } from \"../branding\";\nimport { ServiceAlreadyRegisteredError, ServiceInvalidIdError } from \"../errors\";\nimport type { Services } from \"./service_declarations\";\n\nexport type ServiceTypesLike<\n Model = unknown,\n Ui = unknown,\n Kind extends ServiceType = ServiceType,\n> = {\n readonly __types?: { model: Model; ui: Ui; kind: Kind };\n};\n\nexport type InferServiceModel<S extends ServiceTypesLike> =\n S extends ServiceTypesLike<infer M, unknown, ServiceType> ? M : unknown;\n\nexport type InferServiceUi<S extends ServiceTypesLike> =\n S extends ServiceTypesLike<unknown, infer U, ServiceType> ? U : unknown;\n\nexport type InferServiceKind<S extends ServiceTypesLike> =\n S extends ServiceTypesLike<unknown, unknown, infer K> ? K : ServiceType;\n\nexport type ServiceName<S extends ServiceTypesLike = ServiceTypesLike> = Branded<string, S>;\n\nexport type ServiceType = \"node\" | \"wasm\";\n\nconst SERVICE_ID_PATTERN = /^[a-zA-Z][a-zA-Z0-9]*$/;\n\nexport const { service, isNodeService } = (() => {\n const typeMap = new Map<string, ServiceType>();\n return {\n service<Model, Ui>() {\n return <K extends ServiceType, N extends string>(options: {\n readonly type: K;\n readonly name: N;\n }): Branded<N, ServiceTypesLike<Model, Ui, K>> => {\n const { name, type } = options;\n if (!SERVICE_ID_PATTERN.test(name)) {\n throw new ServiceInvalidIdError(\n `Invalid service ID \"${name}\": must match ${SERVICE_ID_PATTERN}`,\n );\n }\n if (typeMap.has(name)) {\n throw new ServiceAlreadyRegisteredError(`Service \"${name}\" already registered`);\n }\n typeMap.set(name, type);\n return name as Branded<N, ServiceTypesLike<Model, Ui, K>>;\n };\n },\n isNodeService(id: ServiceName): boolean {\n return typeMap.get(id) === \"node\";\n },\n };\n})();\n\nexport function serviceFnKey(serviceId: string, method = \"\"): string {\n return `service:${serviceId}:${method}`;\n}\n\nexport type ServiceBrand<T> =\n T extends Branded<string, infer S extends ServiceTypesLike> ? S : never;\n\nexport type ModelServiceFactoryMap<SMap extends Record<string, ServiceName>> = {\n [K in keyof SMap]: (() => InferServiceModel<ServiceBrand<SMap[K]>>) | null;\n};\n\nexport type UiServiceFactoryMap<SMap extends Record<string, ServiceName>> = {\n [K in keyof SMap]: (() => InferServiceUi<ServiceBrand<SMap[K]>>) | null;\n};\n\n/** Contract between any service provider and any service consumer. */\nexport interface ServiceDispatch {\n getServiceNames(): ServiceName[];\n getServiceMethods(serviceId: ServiceName): string[];\n callServiceMethod(serviceId: ServiceName, method: string, ...args: unknown[]): unknown;\n}\n\n// Auto-derived types from the Services const in service_declarations.ts.\n// Adding a service to Services automatically updates all of these.\n\ntype SMap = typeof Services;\n\ntype ExtractServiceName<T> = T extends Branded<infer N extends string, any> ? N : never;\n\n/** Model-side service interfaces keyed by service name literal. */\nexport type ModelServices = {\n [K in keyof SMap as ExtractServiceName<SMap[K]>]: InferServiceModel<ServiceBrand<SMap[K]>>;\n};\n\n/** UI-side service interfaces keyed by service name literal. */\nexport type UiServices = {\n [K in keyof SMap as ExtractServiceName<SMap[K]>]: InferServiceUi<ServiceBrand<SMap[K]>>;\n};\n\n/** Map from Services keys to their unbranded string name literals. */\nexport type ServiceNameLiterals = {\n [K in keyof SMap]: ExtractServiceName<SMap[K]>;\n};\n\n/** Auto-derived requires* feature flags from Services keys. */\nexport type ServiceRequireFlags = {\n [K in keyof SMap as `requires${K & string}`]?: boolean;\n};\n\nexport type RequireServices<T extends ServiceName> = UnionToIntersection<\n T extends Branded<infer N extends string, infer S extends ServiceTypesLike>\n ? Record<N, InferServiceModel<S>>\n : never\n>;\n"],"mappings":";;AA0BA,MAAM,qBAAqB;AAE3B,MAAa,EAAE,SAAS,yBAAyB;CAC/C,MAAM,0BAAU,IAAI,KAA0B;AAC9C,QAAO;EACL,UAAqB;AACnB,WAAiD,YAGC;IAChD,MAAM,EAAE,MAAM,SAAS;AACvB,QAAI,CAAC,mBAAmB,KAAK,KAAK,CAChC,OAAM,IAAI,sBACR,uBAAuB,KAAK,gBAAgB,qBAC7C;AAEH,QAAI,QAAQ,IAAI,KAAK,CACnB,OAAM,IAAI,8BAA8B,YAAY,KAAK,sBAAsB;AAEjF,YAAQ,IAAI,MAAM,KAAK;AACvB,WAAO;;;EAGX,cAAc,IAA0B;AACtC,UAAO,QAAQ,IAAI,GAAG,KAAK;;EAE9B;IACC;AAEJ,SAAgB,aAAa,WAAmB,SAAS,IAAY;AACnE,QAAO,WAAW,UAAU,GAAG"}
1
+ {"version":3,"file":"service_types.js","names":[],"sources":["../../src/services/service_types.ts"],"sourcesContent":["import { UnionToIntersection } from \"@milaboratories/helpers\";\nimport type { Branded } from \"../branding\";\nimport { ServiceAlreadyRegisteredError, ServiceInvalidIdError } from \"../errors\";\nimport type { Services } from \"./service_declarations\";\n\nexport type ServiceTypesLike<\n Model = unknown,\n Ui = unknown,\n Kind extends ServiceType = ServiceType,\n> = {\n readonly __types?: { model: Model; ui: Ui; kind: Kind };\n};\n\nexport type InferServiceModel<S extends ServiceTypesLike> =\n S extends ServiceTypesLike<infer M, unknown, ServiceType> ? M : unknown;\n\nexport type InferServiceUi<S extends ServiceTypesLike> =\n S extends ServiceTypesLike<unknown, infer U, ServiceType> ? U : unknown;\n\nexport type InferServiceKind<S extends ServiceTypesLike> =\n S extends ServiceTypesLike<unknown, unknown, infer K> ? K : ServiceType;\n\nexport type ServiceName<S extends ServiceTypesLike = ServiceTypesLike> = Branded<string, S>;\n\nexport type ServiceType = \"node\" | \"wasm\";\n\nconst SERVICE_ID_PATTERN = /^[a-zA-Z][a-zA-Z0-9]*$/;\n\nexport const { service, isNodeService } = (() => {\n const typeMap = new Map<string, ServiceType>();\n return {\n service<Model, Ui>() {\n return <K extends ServiceType, N extends string>(options: {\n readonly type: K;\n readonly name: N;\n }): Branded<N, ServiceTypesLike<Model, Ui, K>> => {\n const { name, type } = options;\n if (!SERVICE_ID_PATTERN.test(name)) {\n throw new ServiceInvalidIdError(\n `Invalid service ID \"${name}\": must match ${SERVICE_ID_PATTERN}`,\n );\n }\n if (typeMap.has(name)) {\n throw new ServiceAlreadyRegisteredError(`Service \"${name}\" already registered`);\n }\n typeMap.set(name, type);\n return name as Branded<N, ServiceTypesLike<Model, Ui, K>>;\n };\n },\n isNodeService(id: ServiceName): boolean {\n return typeMap.get(id) === \"node\";\n },\n };\n})();\n\nexport function serviceFnKey(serviceId: string, method = \"\"): string {\n return `service:${serviceId}:${method}`;\n}\n\nexport type ServiceBrand<T> =\n T extends Branded<string, infer S extends ServiceTypesLike> ? S : never;\n\nexport type ModelServiceFactoryMap<SMap extends Record<string, ServiceName>> = {\n [K in keyof SMap]: (() => InferServiceModel<ServiceBrand<SMap[K]>>) | null;\n};\n\nexport type UiServiceFactoryMap<SMap extends Record<string, ServiceName>> = {\n [K in keyof SMap]: (() => InferServiceUi<ServiceBrand<SMap[K]>>) | null;\n};\n\n/** Contract between any service provider and any service consumer. */\nexport interface ServiceDispatch {\n getServiceNames(): ServiceName[];\n getServiceMethods(serviceId: ServiceName): string[];\n callServiceMethod(serviceId: ServiceName, method: string, ...args: unknown[]): unknown;\n}\n\n// Auto-derived types from the Services const in service_declarations.ts.\n// Adding a service to Services automatically updates all of these.\n\ntype TServices = typeof Services;\n\ntype ExtractServiceName<T> = T extends Branded<infer N extends string, any> ? N : never;\n\n/** Model-side service interfaces keyed by service name literal. */\nexport type ModelServices = {\n [K in keyof TServices as ExtractServiceName<TServices[K]>]: InferServiceModel<\n ServiceBrand<TServices[K]>\n >;\n};\n\n/** UI-side service interfaces keyed by service name literal. */\nexport type UiServices = {\n [K in keyof TServices as ExtractServiceName<TServices[K]>]: InferServiceUi<\n ServiceBrand<TServices[K]>\n >;\n};\n\n/** Map from Services keys to their unbranded string name literals. */\nexport type ServiceNameLiterals = {\n [K in keyof TServices]: ExtractServiceName<TServices[K]>;\n};\n\n/** Auto-derived requires* feature flags from Services keys. */\nexport type ServiceRequireFlags = {\n [K in keyof TServices as `requires${K & string}`]?: boolean;\n};\n\nexport type RequireServices<T extends ServiceName> = UnionToIntersection<\n T extends Branded<infer N extends string, infer S extends ServiceTypesLike>\n ? Record<N, InferServiceModel<S>>\n : never\n>;\n"],"mappings":";;AA0BA,MAAM,qBAAqB;AAE3B,MAAa,EAAE,SAAS,yBAAyB;CAC/C,MAAM,0BAAU,IAAI,KAA0B;AAC9C,QAAO;EACL,UAAqB;AACnB,WAAiD,YAGC;IAChD,MAAM,EAAE,MAAM,SAAS;AACvB,QAAI,CAAC,mBAAmB,KAAK,KAAK,CAChC,OAAM,IAAI,sBACR,uBAAuB,KAAK,gBAAgB,qBAC7C;AAEH,QAAI,QAAQ,IAAI,KAAK,CACnB,OAAM,IAAI,8BAA8B,YAAY,KAAK,sBAAsB;AAEjF,YAAQ,IAAI,MAAM,KAAK;AACvB,WAAO;;;EAGX,cAAc,IAA0B;AACtC,UAAO,QAAQ,IAAI,GAAG,KAAK;;EAE9B;IACC;AAEJ,SAAgB,aAAa,WAAmB,SAAS,IAAY;AACnE,QAAO,WAAW,UAAU,GAAG"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@milaboratories/pl-model-common",
3
- "version": "1.34.0",
3
+ "version": "1.34.1",
4
4
  "description": "Platforma SDK Model",
5
5
  "files": [
6
6
  "./dist/**/*",
@@ -26,9 +26,9 @@
26
26
  "@vitest/coverage-istanbul": "^4.1.3",
27
27
  "typescript": "~5.9.3",
28
28
  "vitest": "^4.1.3",
29
- "@milaboratories/ts-configs": "1.2.3",
30
29
  "@milaboratories/build-configs": "2.0.0",
31
- "@milaboratories/ts-builder": "1.3.2"
30
+ "@milaboratories/ts-builder": "1.3.2",
31
+ "@milaboratories/ts-configs": "1.2.3"
32
32
  },
33
33
  "scripts": {
34
34
  "build": "ts-builder build --target node",
@@ -31,9 +31,9 @@ function domainKey(key: string, value: string): string {
31
31
  * Maintains maps of known domain values and axes that can be referenced by anchors
32
32
  */
33
33
  export class AnchoredIdDeriver {
34
+ private readonly axes = new Map<string, AnchorAxisRefByIdx>();
34
35
  private readonly domains = new Map<string, string>();
35
36
  private readonly contextDomains = new Map<string, string>();
36
- private readonly axes = new Map<string, AnchorAxisRefByIdx>();
37
37
  /**
38
38
  * Domain packs are used to group domain keys that can be anchored to the same anchor
39
39
  * This is used to optimize the lookup of domain anchors
@@ -244,6 +244,7 @@ export type ResolveAnchorsOptions = {
244
244
  * @param matcher - An anchored column matcher (or id, which is subtype of it) containing references that need to be resolved
245
245
  * @param options - Options for resolving anchors
246
246
  * @returns A non-anchored column matcher with all references resolved to actual values
247
+ * @deprecated - This function by parent PColumnCollection
247
248
  */
248
249
  export function resolveAnchors(
249
250
  anchors: Record<string, Pick<PColumnSpec, "axesSpec" | "domain" | "contextDomain">>,
@@ -0,0 +1,65 @@
1
+ import { Branded, throwError } from "@milaboratories/helpers";
2
+ import { PObjectId } from "../../../pool";
3
+ import { AxisQualification } from "../spec_driver";
4
+ import { canonicalizeJson } from "../../../json";
5
+
6
+ export type DiscoveredPColumn = {
7
+ path: PathItem[];
8
+ column: PObjectId;
9
+ columnQualifications: AxisQualification[];
10
+ queriesQualifications: Record<PObjectId, AxisQualification[]>;
11
+ };
12
+
13
+ export type DiscoveredPColumnId = Branded<PObjectId, "DiscoveredPColumnId">; // CanonicalizedJson<DiscoveredPColumn>;
14
+
15
+ type PathItem = {
16
+ type: "linker";
17
+ column: PObjectId;
18
+ qualifications: AxisQualification[];
19
+ };
20
+
21
+ export function isDiscoveredPColumn(obj: unknown): obj is DiscoveredPColumn {
22
+ return (
23
+ typeof obj === "object" &&
24
+ obj !== null &&
25
+ "path" in obj &&
26
+ "column" in obj &&
27
+ "columnQualifications" in obj &&
28
+ "queriesQualifications" in obj
29
+ );
30
+ }
31
+
32
+ export function createDiscoveredPColumn(props: {
33
+ column: PObjectId;
34
+ path: PathItem[];
35
+ columnQualifications: AxisQualification[];
36
+ queriesQualifications: Record<PObjectId, AxisQualification[]>;
37
+ }): DiscoveredPColumn {
38
+ return JSON.parse(JSON.stringify(props));
39
+ }
40
+
41
+ export function createDiscoveredPColumnId(props: {
42
+ column: PObjectId;
43
+ path: PathItem[];
44
+ columnQualifications: AxisQualification[];
45
+ queriesQualifications: Record<PObjectId, AxisQualification[]>;
46
+ }): DiscoveredPColumnId {
47
+ return stringifyDiscoveredPColumnId(createDiscoveredPColumn(props));
48
+ }
49
+
50
+ export function parseDiscoveredPColumnId(id: DiscoveredPColumnId): DiscoveredPColumn {
51
+ try {
52
+ const parsed = JSON.parse(id);
53
+ return isDiscoveredPColumn(parsed)
54
+ ? parsed
55
+ : throwError("Parsed object is not a valid DiscoveredPColumn");
56
+ } catch {
57
+ throw new Error(
58
+ "Invalid DiscoveredPColumnId: not a valid JSON or does not conform to DiscoveredPColumn structure",
59
+ );
60
+ }
61
+ }
62
+
63
+ export function stringifyDiscoveredPColumnId(id: DiscoveredPColumn) {
64
+ return canonicalizeJson<DiscoveredPColumn>(id) as string as DiscoveredPColumnId;
65
+ }
@@ -3,10 +3,12 @@ import type { AnchoredPColumnId } from "./selectors";
3
3
  import type { FilteredPColumnId } from "./filtered_column";
4
4
  import canonicalize from "canonicalize";
5
5
  import type { PObjectId } from "../../../pool";
6
+ import { DiscoveredPColumn } from "./discovered_column";
7
+
6
8
  /**
7
9
  * Universal column identifier optionally anchored and optionally filtered.
8
10
  */
9
- export type UniversalPColumnId = AnchoredPColumnId | FilteredPColumnId;
11
+ export type UniversalPColumnId = AnchoredPColumnId | FilteredPColumnId | DiscoveredPColumn;
10
12
 
11
13
  /**
12
14
  * Canonically serialized {@link UniversalPColumnId}.
@@ -4,3 +4,4 @@ export * from "./filtered_column";
4
4
  export * from "./spec";
5
5
  export * from "./selectors";
6
6
  export * from "./native_id";
7
+ export * from "./discovered_column";
@@ -164,6 +164,7 @@ export const Annotation = {
164
164
  FontFamily: "pl7.app/table/fontFamily",
165
165
  OrderPriority: "pl7.app/table/orderPriority",
166
166
  Visibility: "pl7.app/table/visibility",
167
+ Info: "pl7.app/table/info",
167
168
  },
168
169
  Trace: "pl7.app/trace",
169
170
  VDJ: {
@@ -205,6 +206,7 @@ export type Annotation = Metadata &
205
206
  [Annotation.Table.FontFamily]: string;
206
207
  [Annotation.Table.OrderPriority]: StringifiedJson<number>;
207
208
  [Annotation.Table.Visibility]: "hidden" | "optional" | (string & {});
209
+ [Annotation.Table.Info]: string;
208
210
  [Annotation.Trace]: StringifiedJson<Trace>;
209
211
  [Annotation.VDJ.IsAssemblingFeature]: StringifiedJson<boolean>;
210
212
  }>;
@@ -78,28 +78,32 @@ export interface ServiceDispatch {
78
78
  // Auto-derived types from the Services const in service_declarations.ts.
79
79
  // Adding a service to Services automatically updates all of these.
80
80
 
81
- type SMap = typeof Services;
81
+ type TServices = typeof Services;
82
82
 
83
83
  type ExtractServiceName<T> = T extends Branded<infer N extends string, any> ? N : never;
84
84
 
85
85
  /** Model-side service interfaces keyed by service name literal. */
86
86
  export type ModelServices = {
87
- [K in keyof SMap as ExtractServiceName<SMap[K]>]: InferServiceModel<ServiceBrand<SMap[K]>>;
87
+ [K in keyof TServices as ExtractServiceName<TServices[K]>]: InferServiceModel<
88
+ ServiceBrand<TServices[K]>
89
+ >;
88
90
  };
89
91
 
90
92
  /** UI-side service interfaces keyed by service name literal. */
91
93
  export type UiServices = {
92
- [K in keyof SMap as ExtractServiceName<SMap[K]>]: InferServiceUi<ServiceBrand<SMap[K]>>;
94
+ [K in keyof TServices as ExtractServiceName<TServices[K]>]: InferServiceUi<
95
+ ServiceBrand<TServices[K]>
96
+ >;
93
97
  };
94
98
 
95
99
  /** Map from Services keys to their unbranded string name literals. */
96
100
  export type ServiceNameLiterals = {
97
- [K in keyof SMap]: ExtractServiceName<SMap[K]>;
101
+ [K in keyof TServices]: ExtractServiceName<TServices[K]>;
98
102
  };
99
103
 
100
104
  /** Auto-derived requires* feature flags from Services keys. */
101
105
  export type ServiceRequireFlags = {
102
- [K in keyof SMap as `requires${K & string}`]?: boolean;
106
+ [K in keyof TServices as `requires${K & string}`]?: boolean;
103
107
  };
104
108
 
105
109
  export type RequireServices<T extends ServiceName> = UnionToIntersection<