@platforma-sdk/model 1.84.20 → 1.85.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/PlDatasetSelector/build_dataset_options.cjs +1 -1
- package/dist/components/PlDatasetSelector/build_dataset_options.cjs.map +1 -1
- package/dist/components/PlDatasetSelector/build_dataset_options.d.ts +6 -0
- package/dist/components/PlDatasetSelector/build_dataset_options.d.ts.map +1 -1
- package/dist/components/PlDatasetSelector/build_dataset_options.js +1 -1
- package/dist/components/PlDatasetSelector/build_dataset_options.js.map +1 -1
- package/dist/package.cjs +1 -1
- package/dist/package.js +1 -1
- package/package.json +6 -6
- package/src/components/PlDatasetSelector/build_dataset_options.ts +9 -1
|
@@ -18,7 +18,7 @@ function toPredicate(opt) {
|
|
|
18
18
|
function buildDatasetOptions(ctx, opts) {
|
|
19
19
|
const primaryPredicate = toPredicate(opts?.primary);
|
|
20
20
|
const filterPredicate = toPredicate(opts?.filter);
|
|
21
|
-
const options = ctx.resultPool.getOptions(primaryPredicate, { refsWithEnrichments: true });
|
|
21
|
+
const options = ctx.resultPool.getOptions(primaryPredicate, { refsWithEnrichments: opts?.requireEnrichments ?? true });
|
|
22
22
|
if (options.length === 0) return [];
|
|
23
23
|
const refMap = require_filter_discovery.buildRefMap(ctx.resultPool.getSpecs().entries);
|
|
24
24
|
const withEnrichments = opts?.withEnrichments ?? false;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"build_dataset_options.cjs","names":["buildRefMap","ColumnsProvider","getCtxProviders","findFilterColumns","filterMatchesToOptions","findEnrichmentColumns","enrichmentVariantsToRefs"],"sources":["../../../src/components/PlDatasetSelector/build_dataset_options.ts"],"sourcesContent":["import type { MultiColumnSelector, Option, PObjectSpec } from \"@milaboratories/pl-model-common\";\nimport { multiColumnSelectorsToPredicate } from \"@milaboratories/pl-model-common\";\nimport type { DeriveLabelsOptions } from \"../../labels/derive_distinct_labels\";\nimport type { RenderCtxBase } from \"../../render\";\nimport type { DatasetOption } from \"./dataset_selection\";\nimport { buildRefMap, filterMatchesToOptions, findFilterColumns } from \"./filter_discovery\";\nimport { enrichmentVariantsToRefs, findEnrichmentColumns } from \"./enrichment_discovery\";\nimport { ColumnsProvider, getCtxProviders } from \"../../columns\";\n\ntype SpecPredicateOption =\n | MultiColumnSelector\n | MultiColumnSelector[]\n | ((spec: PObjectSpec) => boolean);\n\nfunction toPredicate(opt: SpecPredicateOption | undefined): (spec: PObjectSpec) => boolean {\n if (opt === undefined) return () => true;\n return typeof opt === \"function\" ? opt : multiColumnSelectorsToPredicate(opt);\n}\n\nexport type BuildDatasetOptions = {\n /** Which result pool columns qualify as datasets. Defaults to all. */\n primary?: SpecPredicateOption;\n /**\n * Restricts which result pool columns are considered as filters. Intersected\n * with the built-in `pl7.app/isSubset: \"true\"` constraint. Defaults to\n * accept-all.\n */\n filter?: SpecPredicateOption;\n /**\n * Formatting options forwarded to label derivation for both filter and\n * enrichment rows. `formatters.native` on the filter path is overridden\n * — see `FilterMatchOptions.labelOptions`.\n */\n labelOptions?: DeriveLabelsOptions;\n /**\n * Enables enrichment discovery and filters hits attached to\n * `DatasetOption.enrichments`. Use `() => true` to accept all; omit to disable.\n */\n withEnrichments?: SpecPredicateOption;\n /** Maximum linker hops considered. Only used when `withEnrichments` is set. */\n enrichmentMaxHops?: number;\n};\n\n/**\n * Usage:\n * ```ts\n * .output(\"datasetOptions\", (ctx) => buildDatasetOptions(ctx))\n * ```\n */\nexport function buildDatasetOptions(\n ctx: RenderCtxBase,\n opts?: BuildDatasetOptions,\n): DatasetOption[] | undefined {\n const primaryPredicate = toPredicate(opts?.primary);\n const filterPredicate = toPredicate(opts?.filter);\n\n const options = ctx.resultPool.getOptions(primaryPredicate, {
|
|
1
|
+
{"version":3,"file":"build_dataset_options.cjs","names":["buildRefMap","ColumnsProvider","getCtxProviders","findFilterColumns","filterMatchesToOptions","findEnrichmentColumns","enrichmentVariantsToRefs"],"sources":["../../../src/components/PlDatasetSelector/build_dataset_options.ts"],"sourcesContent":["import type { MultiColumnSelector, Option, PObjectSpec } from \"@milaboratories/pl-model-common\";\nimport { multiColumnSelectorsToPredicate } from \"@milaboratories/pl-model-common\";\nimport type { DeriveLabelsOptions } from \"../../labels/derive_distinct_labels\";\nimport type { RenderCtxBase } from \"../../render\";\nimport type { DatasetOption } from \"./dataset_selection\";\nimport { buildRefMap, filterMatchesToOptions, findFilterColumns } from \"./filter_discovery\";\nimport { enrichmentVariantsToRefs, findEnrichmentColumns } from \"./enrichment_discovery\";\nimport { ColumnsProvider, getCtxProviders } from \"../../columns\";\n\ntype SpecPredicateOption =\n | MultiColumnSelector\n | MultiColumnSelector[]\n | ((spec: PObjectSpec) => boolean);\n\nfunction toPredicate(opt: SpecPredicateOption | undefined): (spec: PObjectSpec) => boolean {\n if (opt === undefined) return () => true;\n return typeof opt === \"function\" ? opt : multiColumnSelectorsToPredicate(opt);\n}\n\nexport type BuildDatasetOptions = {\n /** Which result pool columns qualify as datasets. Defaults to all. */\n primary?: SpecPredicateOption;\n /**\n * Restricts which result pool columns are considered as filters. Intersected\n * with the built-in `pl7.app/isSubset: \"true\"` constraint. Defaults to\n * accept-all.\n */\n filter?: SpecPredicateOption;\n /**\n * Formatting options forwarded to label derivation for both filter and\n * enrichment rows. `formatters.native` on the filter path is overridden\n * — see `FilterMatchOptions.labelOptions`.\n */\n labelOptions?: DeriveLabelsOptions;\n /**\n * Enables enrichment discovery and filters hits attached to\n * `DatasetOption.enrichments`. Use `() => true` to accept all; omit to disable.\n */\n withEnrichments?: SpecPredicateOption;\n /** Maximum linker hops considered. Only used when `withEnrichments` is set. */\n enrichmentMaxHops?: number;\n /**\n * Whether the dataset refs in the returned options carry `requireEnrichments: true`.\n * A block that stores such a ref depends on every block that enriches the dataset.\n * Set `false` for a block that only needs the dataset and its filters. Defaults to `true`.\n */\n requireEnrichments?: boolean;\n};\n\n/**\n * Usage:\n * ```ts\n * .output(\"datasetOptions\", (ctx) => buildDatasetOptions(ctx))\n * ```\n */\nexport function buildDatasetOptions(\n ctx: RenderCtxBase,\n opts?: BuildDatasetOptions,\n): DatasetOption[] | undefined {\n const primaryPredicate = toPredicate(opts?.primary);\n const filterPredicate = toPredicate(opts?.filter);\n\n const options = ctx.resultPool.getOptions(primaryPredicate, {\n refsWithEnrichments: opts?.requireEnrichments ?? true,\n });\n if (options.length === 0) return [];\n\n const refMap = buildRefMap(ctx.resultPool.getSpecs().entries);\n\n const withEnrichments = opts?.withEnrichments ?? false;\n const filterSource = ColumnsProvider(ctx.ctx.getUpstreamBlockCtx());\n // Hoist providers once: getCtxProviders walks the full output tree, so\n // calling it per dataset option would be O(N × tree).\n const enrichmentSources = withEnrichments ? getCtxProviders(ctx) : undefined;\n\n return options.map((primary: Option): DatasetOption => {\n const datasetSpec = ctx.resultPool.getPColumnSpecByRef(primary.ref);\n if (!datasetSpec) return { primary };\n\n const filterMatches = findFilterColumns({\n sources: [filterSource],\n anchorSpec: datasetSpec,\n }).filter((m) => filterPredicate(m.getSpec()!));\n\n const filters =\n filterMatches.length === 0\n ? undefined\n : filterMatchesToOptions(filterMatches, {\n refsByObjectId: refMap,\n datasetSpec,\n labelOptions: opts?.labelOptions,\n });\n\n let enrichments;\n if (enrichmentSources && withEnrichments) {\n const enrichmentVariants = findEnrichmentColumns({\n sources: enrichmentSources,\n anchorSpec: datasetSpec,\n maxHops: opts?.enrichmentMaxHops,\n ...(typeof withEnrichments === \"function\"\n ? { predicate: withEnrichments }\n : { include: withEnrichments }),\n });\n if (enrichmentVariants.length > 0) {\n enrichments = enrichmentVariantsToRefs(enrichmentVariants, opts?.labelOptions);\n }\n }\n\n return {\n primary,\n ...(filters !== undefined && filters.length > 0 ? { filters } : {}),\n ...(enrichments !== undefined && enrichments.length > 0 ? { enrichments } : {}),\n };\n });\n}\n"],"mappings":";;;;;;;AAcA,SAAS,YAAY,KAAsE;CACzF,IAAI,QAAQ,KAAA,GAAW,aAAa;CACpC,OAAO,OAAO,QAAQ,aAAa,OAAA,GAAA,gCAAA,gCAAA,CAAsC,GAAG;AAC9E;;;;;;;AAsCA,SAAgB,oBACd,KACA,MAC6B;CAC7B,MAAM,mBAAmB,YAAY,MAAM,OAAO;CAClD,MAAM,kBAAkB,YAAY,MAAM,MAAM;CAEhD,MAAM,UAAU,IAAI,WAAW,WAAW,kBAAkB,EAC1D,qBAAqB,MAAM,sBAAsB,KACnD,CAAC;CACD,IAAI,QAAQ,WAAW,GAAG,OAAO,CAAC;CAElC,MAAM,SAASA,yBAAAA,YAAY,IAAI,WAAW,SAAS,CAAC,CAAC,OAAO;CAE5D,MAAM,kBAAkB,MAAM,mBAAmB;CACjD,MAAM,eAAeC,kBAAAA,gBAAgB,IAAI,IAAI,oBAAoB,CAAC;CAGlE,MAAM,oBAAoB,kBAAkBC,cAAAA,gBAAgB,GAAG,IAAI,KAAA;CAEnE,OAAO,QAAQ,KAAK,YAAmC;EACrD,MAAM,cAAc,IAAI,WAAW,oBAAoB,QAAQ,GAAG;EAClE,IAAI,CAAC,aAAa,OAAO,EAAE,QAAQ;EAEnC,MAAM,gBAAgBC,yBAAAA,kBAAkB;GACtC,SAAS,CAAC,YAAY;GACtB,YAAY;EACd,CAAC,CAAC,CAAC,QAAQ,MAAM,gBAAgB,EAAE,QAAQ,CAAE,CAAC;EAE9C,MAAM,UACJ,cAAc,WAAW,IACrB,KAAA,IACAC,yBAAAA,uBAAuB,eAAe;GACpC,gBAAgB;GAChB;GACA,cAAc,MAAM;EACtB,CAAC;EAEP,IAAI;EACJ,IAAI,qBAAqB,iBAAiB;GACxC,MAAM,qBAAqBC,6BAAAA,sBAAsB;IAC/C,SAAS;IACT,YAAY;IACZ,SAAS,MAAM;IACf,GAAI,OAAO,oBAAoB,aAC3B,EAAE,WAAW,gBAAgB,IAC7B,EAAE,SAAS,gBAAgB;GACjC,CAAC;GACD,IAAI,mBAAmB,SAAS,GAC9B,cAAcC,6BAAAA,yBAAyB,oBAAoB,MAAM,YAAY;EAEjF;EAEA,OAAO;GACL;GACA,GAAI,YAAY,KAAA,KAAa,QAAQ,SAAS,IAAI,EAAE,QAAQ,IAAI,CAAC;GACjE,GAAI,gBAAgB,KAAA,KAAa,YAAY,SAAS,IAAI,EAAE,YAAY,IAAI,CAAC;EAC/E;CACF,CAAC;AACH"}
|
|
@@ -27,6 +27,12 @@ export type BuildDatasetOptions = {
|
|
|
27
27
|
withEnrichments?: SpecPredicateOption;
|
|
28
28
|
/** Maximum linker hops considered. Only used when `withEnrichments` is set. */
|
|
29
29
|
enrichmentMaxHops?: number;
|
|
30
|
+
/**
|
|
31
|
+
* Whether the dataset refs in the returned options carry `requireEnrichments: true`.
|
|
32
|
+
* A block that stores such a ref depends on every block that enriches the dataset.
|
|
33
|
+
* Set `false` for a block that only needs the dataset and its filters. Defaults to `true`.
|
|
34
|
+
*/
|
|
35
|
+
requireEnrichments?: boolean;
|
|
30
36
|
};
|
|
31
37
|
/**
|
|
32
38
|
* Usage:
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"build_dataset_options.d.ts","names":[],"sources":["../../../src/components/PlDatasetSelector/build_dataset_options.ts"],"mappings":";;;;;;KASK,sBACD,sBACA,0BACE,MAAM;YAOA;;EAEV,UAAU;;;;;;EAMV,SAAS;;;;;;EAMT,eAAe;;;;;EAKf,kBAAkB;;EAElB;;;;;;;;wBASc,oBACd,KAAK,eACL,OAAO,sBACN"}
|
|
1
|
+
{"version":3,"file":"build_dataset_options.d.ts","names":[],"sources":["../../../src/components/PlDatasetSelector/build_dataset_options.ts"],"mappings":";;;;;;KASK,sBACD,sBACA,0BACE,MAAM;YAOA;;EAEV,UAAU;;;;;;EAMV,SAAS;;;;;;EAMT,eAAe;;;;;EAKf,kBAAkB;;EAElB;;;;;;EAMA;;;;;;;;wBASc,oBACd,KAAK,eACL,OAAO,sBACN"}
|
|
@@ -18,7 +18,7 @@ function toPredicate(opt) {
|
|
|
18
18
|
function buildDatasetOptions(ctx, opts) {
|
|
19
19
|
const primaryPredicate = toPredicate(opts?.primary);
|
|
20
20
|
const filterPredicate = toPredicate(opts?.filter);
|
|
21
|
-
const options = ctx.resultPool.getOptions(primaryPredicate, { refsWithEnrichments: true });
|
|
21
|
+
const options = ctx.resultPool.getOptions(primaryPredicate, { refsWithEnrichments: opts?.requireEnrichments ?? true });
|
|
22
22
|
if (options.length === 0) return [];
|
|
23
23
|
const refMap = buildRefMap(ctx.resultPool.getSpecs().entries);
|
|
24
24
|
const withEnrichments = opts?.withEnrichments ?? false;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"build_dataset_options.js","names":[],"sources":["../../../src/components/PlDatasetSelector/build_dataset_options.ts"],"sourcesContent":["import type { MultiColumnSelector, Option, PObjectSpec } from \"@milaboratories/pl-model-common\";\nimport { multiColumnSelectorsToPredicate } from \"@milaboratories/pl-model-common\";\nimport type { DeriveLabelsOptions } from \"../../labels/derive_distinct_labels\";\nimport type { RenderCtxBase } from \"../../render\";\nimport type { DatasetOption } from \"./dataset_selection\";\nimport { buildRefMap, filterMatchesToOptions, findFilterColumns } from \"./filter_discovery\";\nimport { enrichmentVariantsToRefs, findEnrichmentColumns } from \"./enrichment_discovery\";\nimport { ColumnsProvider, getCtxProviders } from \"../../columns\";\n\ntype SpecPredicateOption =\n | MultiColumnSelector\n | MultiColumnSelector[]\n | ((spec: PObjectSpec) => boolean);\n\nfunction toPredicate(opt: SpecPredicateOption | undefined): (spec: PObjectSpec) => boolean {\n if (opt === undefined) return () => true;\n return typeof opt === \"function\" ? opt : multiColumnSelectorsToPredicate(opt);\n}\n\nexport type BuildDatasetOptions = {\n /** Which result pool columns qualify as datasets. Defaults to all. */\n primary?: SpecPredicateOption;\n /**\n * Restricts which result pool columns are considered as filters. Intersected\n * with the built-in `pl7.app/isSubset: \"true\"` constraint. Defaults to\n * accept-all.\n */\n filter?: SpecPredicateOption;\n /**\n * Formatting options forwarded to label derivation for both filter and\n * enrichment rows. `formatters.native` on the filter path is overridden\n * — see `FilterMatchOptions.labelOptions`.\n */\n labelOptions?: DeriveLabelsOptions;\n /**\n * Enables enrichment discovery and filters hits attached to\n * `DatasetOption.enrichments`. Use `() => true` to accept all; omit to disable.\n */\n withEnrichments?: SpecPredicateOption;\n /** Maximum linker hops considered. Only used when `withEnrichments` is set. */\n enrichmentMaxHops?: number;\n};\n\n/**\n * Usage:\n * ```ts\n * .output(\"datasetOptions\", (ctx) => buildDatasetOptions(ctx))\n * ```\n */\nexport function buildDatasetOptions(\n ctx: RenderCtxBase,\n opts?: BuildDatasetOptions,\n): DatasetOption[] | undefined {\n const primaryPredicate = toPredicate(opts?.primary);\n const filterPredicate = toPredicate(opts?.filter);\n\n const options = ctx.resultPool.getOptions(primaryPredicate, {
|
|
1
|
+
{"version":3,"file":"build_dataset_options.js","names":[],"sources":["../../../src/components/PlDatasetSelector/build_dataset_options.ts"],"sourcesContent":["import type { MultiColumnSelector, Option, PObjectSpec } from \"@milaboratories/pl-model-common\";\nimport { multiColumnSelectorsToPredicate } from \"@milaboratories/pl-model-common\";\nimport type { DeriveLabelsOptions } from \"../../labels/derive_distinct_labels\";\nimport type { RenderCtxBase } from \"../../render\";\nimport type { DatasetOption } from \"./dataset_selection\";\nimport { buildRefMap, filterMatchesToOptions, findFilterColumns } from \"./filter_discovery\";\nimport { enrichmentVariantsToRefs, findEnrichmentColumns } from \"./enrichment_discovery\";\nimport { ColumnsProvider, getCtxProviders } from \"../../columns\";\n\ntype SpecPredicateOption =\n | MultiColumnSelector\n | MultiColumnSelector[]\n | ((spec: PObjectSpec) => boolean);\n\nfunction toPredicate(opt: SpecPredicateOption | undefined): (spec: PObjectSpec) => boolean {\n if (opt === undefined) return () => true;\n return typeof opt === \"function\" ? opt : multiColumnSelectorsToPredicate(opt);\n}\n\nexport type BuildDatasetOptions = {\n /** Which result pool columns qualify as datasets. Defaults to all. */\n primary?: SpecPredicateOption;\n /**\n * Restricts which result pool columns are considered as filters. Intersected\n * with the built-in `pl7.app/isSubset: \"true\"` constraint. Defaults to\n * accept-all.\n */\n filter?: SpecPredicateOption;\n /**\n * Formatting options forwarded to label derivation for both filter and\n * enrichment rows. `formatters.native` on the filter path is overridden\n * — see `FilterMatchOptions.labelOptions`.\n */\n labelOptions?: DeriveLabelsOptions;\n /**\n * Enables enrichment discovery and filters hits attached to\n * `DatasetOption.enrichments`. Use `() => true` to accept all; omit to disable.\n */\n withEnrichments?: SpecPredicateOption;\n /** Maximum linker hops considered. Only used when `withEnrichments` is set. */\n enrichmentMaxHops?: number;\n /**\n * Whether the dataset refs in the returned options carry `requireEnrichments: true`.\n * A block that stores such a ref depends on every block that enriches the dataset.\n * Set `false` for a block that only needs the dataset and its filters. Defaults to `true`.\n */\n requireEnrichments?: boolean;\n};\n\n/**\n * Usage:\n * ```ts\n * .output(\"datasetOptions\", (ctx) => buildDatasetOptions(ctx))\n * ```\n */\nexport function buildDatasetOptions(\n ctx: RenderCtxBase,\n opts?: BuildDatasetOptions,\n): DatasetOption[] | undefined {\n const primaryPredicate = toPredicate(opts?.primary);\n const filterPredicate = toPredicate(opts?.filter);\n\n const options = ctx.resultPool.getOptions(primaryPredicate, {\n refsWithEnrichments: opts?.requireEnrichments ?? true,\n });\n if (options.length === 0) return [];\n\n const refMap = buildRefMap(ctx.resultPool.getSpecs().entries);\n\n const withEnrichments = opts?.withEnrichments ?? false;\n const filterSource = ColumnsProvider(ctx.ctx.getUpstreamBlockCtx());\n // Hoist providers once: getCtxProviders walks the full output tree, so\n // calling it per dataset option would be O(N × tree).\n const enrichmentSources = withEnrichments ? getCtxProviders(ctx) : undefined;\n\n return options.map((primary: Option): DatasetOption => {\n const datasetSpec = ctx.resultPool.getPColumnSpecByRef(primary.ref);\n if (!datasetSpec) return { primary };\n\n const filterMatches = findFilterColumns({\n sources: [filterSource],\n anchorSpec: datasetSpec,\n }).filter((m) => filterPredicate(m.getSpec()!));\n\n const filters =\n filterMatches.length === 0\n ? undefined\n : filterMatchesToOptions(filterMatches, {\n refsByObjectId: refMap,\n datasetSpec,\n labelOptions: opts?.labelOptions,\n });\n\n let enrichments;\n if (enrichmentSources && withEnrichments) {\n const enrichmentVariants = findEnrichmentColumns({\n sources: enrichmentSources,\n anchorSpec: datasetSpec,\n maxHops: opts?.enrichmentMaxHops,\n ...(typeof withEnrichments === \"function\"\n ? { predicate: withEnrichments }\n : { include: withEnrichments }),\n });\n if (enrichmentVariants.length > 0) {\n enrichments = enrichmentVariantsToRefs(enrichmentVariants, opts?.labelOptions);\n }\n }\n\n return {\n primary,\n ...(filters !== undefined && filters.length > 0 ? { filters } : {}),\n ...(enrichments !== undefined && enrichments.length > 0 ? { enrichments } : {}),\n };\n });\n}\n"],"mappings":";;;;;;;AAcA,SAAS,YAAY,KAAsE;CACzF,IAAI,QAAQ,KAAA,GAAW,aAAa;CACpC,OAAO,OAAO,QAAQ,aAAa,MAAM,gCAAgC,GAAG;AAC9E;;;;;;;AAsCA,SAAgB,oBACd,KACA,MAC6B;CAC7B,MAAM,mBAAmB,YAAY,MAAM,OAAO;CAClD,MAAM,kBAAkB,YAAY,MAAM,MAAM;CAEhD,MAAM,UAAU,IAAI,WAAW,WAAW,kBAAkB,EAC1D,qBAAqB,MAAM,sBAAsB,KACnD,CAAC;CACD,IAAI,QAAQ,WAAW,GAAG,OAAO,CAAC;CAElC,MAAM,SAAS,YAAY,IAAI,WAAW,SAAS,CAAC,CAAC,OAAO;CAE5D,MAAM,kBAAkB,MAAM,mBAAmB;CACjD,MAAM,eAAe,gBAAgB,IAAI,IAAI,oBAAoB,CAAC;CAGlE,MAAM,oBAAoB,kBAAkB,gBAAgB,GAAG,IAAI,KAAA;CAEnE,OAAO,QAAQ,KAAK,YAAmC;EACrD,MAAM,cAAc,IAAI,WAAW,oBAAoB,QAAQ,GAAG;EAClE,IAAI,CAAC,aAAa,OAAO,EAAE,QAAQ;EAEnC,MAAM,gBAAgB,kBAAkB;GACtC,SAAS,CAAC,YAAY;GACtB,YAAY;EACd,CAAC,CAAC,CAAC,QAAQ,MAAM,gBAAgB,EAAE,QAAQ,CAAE,CAAC;EAE9C,MAAM,UACJ,cAAc,WAAW,IACrB,KAAA,IACA,uBAAuB,eAAe;GACpC,gBAAgB;GAChB;GACA,cAAc,MAAM;EACtB,CAAC;EAEP,IAAI;EACJ,IAAI,qBAAqB,iBAAiB;GACxC,MAAM,qBAAqB,sBAAsB;IAC/C,SAAS;IACT,YAAY;IACZ,SAAS,MAAM;IACf,GAAI,OAAO,oBAAoB,aAC3B,EAAE,WAAW,gBAAgB,IAC7B,EAAE,SAAS,gBAAgB;GACjC,CAAC;GACD,IAAI,mBAAmB,SAAS,GAC9B,cAAc,yBAAyB,oBAAoB,MAAM,YAAY;EAEjF;EAEA,OAAO;GACL;GACA,GAAI,YAAY,KAAA,KAAa,QAAQ,SAAS,IAAI,EAAE,QAAQ,IAAI,CAAC;GACjE,GAAI,gBAAgB,KAAA,KAAa,YAAY,SAAS,IAAI,EAAE,YAAY,IAAI,CAAC;EAC/E;CACF,CAAC;AACH"}
|
package/dist/package.cjs
CHANGED
package/dist/package.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@platforma-sdk/model",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.85.2",
|
|
4
4
|
"description": "Platforma.bio SDK / Block Model",
|
|
5
5
|
"files": [
|
|
6
6
|
"./dist/**/*",
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
"zod": "~3.25.76",
|
|
34
34
|
"@milaboratories/helpers": "1.14.5",
|
|
35
35
|
"@milaboratories/pl-error-like": "1.12.10",
|
|
36
|
-
"@milaboratories/pl-model-middle-layer": "1.34.
|
|
36
|
+
"@milaboratories/pl-model-middle-layer": "1.34.3",
|
|
37
37
|
"@milaboratories/ptabler-expression-js": "1.2.43",
|
|
38
38
|
"@milaboratories/pl-model-common": "1.53.0"
|
|
39
39
|
},
|
|
@@ -43,12 +43,12 @@
|
|
|
43
43
|
"typescript": "7.0.2",
|
|
44
44
|
"vitest": "^4.1.3",
|
|
45
45
|
"@milaboratories/build-configs": "2.0.2",
|
|
46
|
-
"@milaboratories/
|
|
46
|
+
"@milaboratories/columns-collection-driver": "0.2.9",
|
|
47
|
+
"@milaboratories/pf-driver": "1.9.9",
|
|
48
|
+
"@milaboratories/pf-spec-driver": "1.5.9",
|
|
47
49
|
"@milaboratories/ts-configs": "1.4.0",
|
|
48
50
|
"@milaboratories/ts-builder": "1.7.2",
|
|
49
|
-
"@platforma-sdk/block-kind": "1.1.0"
|
|
50
|
-
"@milaboratories/columns-collection-driver": "0.2.9",
|
|
51
|
-
"@milaboratories/pf-driver": "1.9.8"
|
|
51
|
+
"@platforma-sdk/block-kind": "1.1.0"
|
|
52
52
|
},
|
|
53
53
|
"scripts": {
|
|
54
54
|
"build": "ts-builder build --target node",
|
|
@@ -39,6 +39,12 @@ export type BuildDatasetOptions = {
|
|
|
39
39
|
withEnrichments?: SpecPredicateOption;
|
|
40
40
|
/** Maximum linker hops considered. Only used when `withEnrichments` is set. */
|
|
41
41
|
enrichmentMaxHops?: number;
|
|
42
|
+
/**
|
|
43
|
+
* Whether the dataset refs in the returned options carry `requireEnrichments: true`.
|
|
44
|
+
* A block that stores such a ref depends on every block that enriches the dataset.
|
|
45
|
+
* Set `false` for a block that only needs the dataset and its filters. Defaults to `true`.
|
|
46
|
+
*/
|
|
47
|
+
requireEnrichments?: boolean;
|
|
42
48
|
};
|
|
43
49
|
|
|
44
50
|
/**
|
|
@@ -54,7 +60,9 @@ export function buildDatasetOptions(
|
|
|
54
60
|
const primaryPredicate = toPredicate(opts?.primary);
|
|
55
61
|
const filterPredicate = toPredicate(opts?.filter);
|
|
56
62
|
|
|
57
|
-
const options = ctx.resultPool.getOptions(primaryPredicate, {
|
|
63
|
+
const options = ctx.resultPool.getOptions(primaryPredicate, {
|
|
64
|
+
refsWithEnrichments: opts?.requireEnrichments ?? true,
|
|
65
|
+
});
|
|
58
66
|
if (options.length === 0) return [];
|
|
59
67
|
|
|
60
68
|
const refMap = buildRefMap(ctx.resultPool.getSpecs().entries);
|