@exellix/exellix-runtime 3.5.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.
- package/README.md +422 -0
- package/dist/catalox-inventory/catalox-execution-matrix-inventory-cli.d.ts +4 -0
- package/dist/catalox-inventory/catalox-execution-matrix-inventory-cli.d.ts.map +1 -0
- package/dist/catalox-inventory/catalox-execution-matrix-inventory-cli.js +311 -0
- package/dist/catalox-inventory/catalox-execution-matrix-inventory-cli.js.map +1 -0
- package/dist/catalox-inventory/catalox-execution-matrix-inventory.d.ts +64 -0
- package/dist/catalox-inventory/catalox-execution-matrix-inventory.d.ts.map +1 -0
- package/dist/catalox-inventory/catalox-execution-matrix-inventory.js +226 -0
- package/dist/catalox-inventory/catalox-execution-matrix-inventory.js.map +1 -0
- package/dist/catalox-inventory/catalox-xmemory-entity-count-report.d.ts +145 -0
- package/dist/catalox-inventory/catalox-xmemory-entity-count-report.d.ts.map +1 -0
- package/dist/catalox-inventory/catalox-xmemory-entity-count-report.js +477 -0
- package/dist/catalox-inventory/catalox-xmemory-entity-count-report.js.map +1 -0
- package/dist/catalox-inventory/catalox-xmemory-entity-count-report.spec.d.ts +2 -0
- package/dist/catalox-inventory/catalox-xmemory-entity-count-report.spec.d.ts.map +1 -0
- package/dist/catalox-inventory/catalox-xmemory-entity-count-report.spec.js +34 -0
- package/dist/catalox-inventory/catalox-xmemory-entity-count-report.spec.js.map +1 -0
- package/dist/cli/argv.d.ts +5 -0
- package/dist/cli/argv.d.ts.map +1 -0
- package/dist/cli/argv.js +32 -0
- package/dist/cli/argv.js.map +1 -0
- package/dist/cli/commands/health.d.ts +2 -0
- package/dist/cli/commands/health.d.ts.map +1 -0
- package/dist/cli/commands/health.js +23 -0
- package/dist/cli/commands/health.js.map +1 -0
- package/dist/cli/commands/matrix-link.d.ts +2 -0
- package/dist/cli/commands/matrix-link.d.ts.map +1 -0
- package/dist/cli/commands/matrix-link.js +56 -0
- package/dist/cli/commands/matrix-link.js.map +1 -0
- package/dist/cli/commands/matrix-read.d.ts +2 -0
- package/dist/cli/commands/matrix-read.d.ts.map +1 -0
- package/dist/cli/commands/matrix-read.js +73 -0
- package/dist/cli/commands/matrix-read.js.map +1 -0
- package/dist/cli/env.d.ts +6 -0
- package/dist/cli/env.d.ts.map +1 -0
- package/dist/cli/env.js +39 -0
- package/dist/cli/env.js.map +1 -0
- package/dist/cli/exellix-runtime-cli.d.ts +3 -0
- package/dist/cli/exellix-runtime-cli.d.ts.map +1 -0
- package/dist/cli/exellix-runtime-cli.js +55 -0
- package/dist/cli/exellix-runtime-cli.js.map +1 -0
- package/dist/cli/help.d.ts +19 -0
- package/dist/cli/help.d.ts.map +1 -0
- package/dist/cli/help.js +94 -0
- package/dist/cli/help.js.map +1 -0
- package/dist/client-toolbox/bundle.d.ts +17 -0
- package/dist/client-toolbox/bundle.d.ts.map +1 -0
- package/dist/client-toolbox/bundle.js +17 -0
- package/dist/client-toolbox/bundle.js.map +1 -0
- package/dist/client-toolbox/client-toolbox.spec.d.ts +2 -0
- package/dist/client-toolbox/client-toolbox.spec.d.ts.map +1 -0
- package/dist/client-toolbox/client-toolbox.spec.js +145 -0
- package/dist/client-toolbox/client-toolbox.spec.js.map +1 -0
- package/dist/client-toolbox/index.d.ts +4 -0
- package/dist/client-toolbox/index.d.ts.map +1 -0
- package/dist/client-toolbox/index.js +4 -0
- package/dist/client-toolbox/index.js.map +1 -0
- package/dist/client-toolbox/matrix-config.d.ts +67 -0
- package/dist/client-toolbox/matrix-config.d.ts.map +1 -0
- package/dist/client-toolbox/matrix-config.js +140 -0
- package/dist/client-toolbox/matrix-config.js.map +1 -0
- package/dist/client-toolbox/matrix-materialize.d.ts +56 -0
- package/dist/client-toolbox/matrix-materialize.d.ts.map +1 -0
- package/dist/client-toolbox/matrix-materialize.js +130 -0
- package/dist/client-toolbox/matrix-materialize.js.map +1 -0
- package/dist/dev/matrix-read-dashboard-smoke.d.ts +2 -0
- package/dist/dev/matrix-read-dashboard-smoke.d.ts.map +1 -0
- package/dist/dev/matrix-read-dashboard-smoke.js +12 -0
- package/dist/dev/matrix-read-dashboard-smoke.js.map +1 -0
- package/dist/dev/runtime-real-dev-server.d.ts +2 -0
- package/dist/dev/runtime-real-dev-server.d.ts.map +1 -0
- package/dist/dev/runtime-real-dev-server.js +90 -0
- package/dist/dev/runtime-real-dev-server.js.map +1 -0
- package/dist/execution-matrix/catalox-loader.d.ts +55 -0
- package/dist/execution-matrix/catalox-loader.d.ts.map +1 -0
- package/dist/execution-matrix/catalox-loader.js +199 -0
- package/dist/execution-matrix/catalox-loader.js.map +1 -0
- package/dist/execution-matrix/catalox-matrix-host.d.ts +20 -0
- package/dist/execution-matrix/catalox-matrix-host.d.ts.map +1 -0
- package/dist/execution-matrix/catalox-matrix-host.js +19 -0
- package/dist/execution-matrix/catalox-matrix-host.js.map +1 -0
- package/dist/execution-matrix/collections.d.ts +16 -0
- package/dist/execution-matrix/collections.d.ts.map +1 -0
- package/dist/execution-matrix/collections.js +75 -0
- package/dist/execution-matrix/collections.js.map +1 -0
- package/dist/execution-matrix/config-store.d.ts +104 -0
- package/dist/execution-matrix/config-store.d.ts.map +1 -0
- package/dist/execution-matrix/config-store.js +273 -0
- package/dist/execution-matrix/config-store.js.map +1 -0
- package/dist/execution-matrix/constants.d.ts +19 -0
- package/dist/execution-matrix/constants.d.ts.map +1 -0
- package/dist/execution-matrix/constants.js +19 -0
- package/dist/execution-matrix/constants.js.map +1 -0
- package/dist/execution-matrix/contracts.d.ts +568 -0
- package/dist/execution-matrix/contracts.d.ts.map +1 -0
- package/dist/execution-matrix/contracts.js +44 -0
- package/dist/execution-matrix/contracts.js.map +1 -0
- package/dist/execution-matrix/data-source.d.ts +43 -0
- package/dist/execution-matrix/data-source.d.ts.map +1 -0
- package/dist/execution-matrix/data-source.js +307 -0
- package/dist/execution-matrix/data-source.js.map +1 -0
- package/dist/execution-matrix/eligibility.d.ts +48 -0
- package/dist/execution-matrix/eligibility.d.ts.map +1 -0
- package/dist/execution-matrix/eligibility.js +89 -0
- package/dist/execution-matrix/eligibility.js.map +1 -0
- package/dist/execution-matrix/execution-matrix-claim-pause.d.ts +20 -0
- package/dist/execution-matrix/execution-matrix-claim-pause.d.ts.map +1 -0
- package/dist/execution-matrix/execution-matrix-claim-pause.js +18 -0
- package/dist/execution-matrix/execution-matrix-claim-pause.js.map +1 -0
- package/dist/execution-matrix/execution-matrix-claim-pause.spec.d.ts +2 -0
- package/dist/execution-matrix/execution-matrix-claim-pause.spec.d.ts.map +1 -0
- package/dist/execution-matrix/execution-matrix-claim-pause.spec.js +23 -0
- package/dist/execution-matrix/execution-matrix-claim-pause.spec.js.map +1 -0
- package/dist/execution-matrix/execution-matrix.live.spec.d.ts +2 -0
- package/dist/execution-matrix/execution-matrix.live.spec.d.ts.map +1 -0
- package/dist/execution-matrix/execution-matrix.live.spec.js +152 -0
- package/dist/execution-matrix/execution-matrix.live.spec.js.map +1 -0
- package/dist/execution-matrix/execution-matrix.live.xmemory.spec.d.ts +2 -0
- package/dist/execution-matrix/execution-matrix.live.xmemory.spec.d.ts.map +1 -0
- package/dist/execution-matrix/execution-matrix.live.xmemory.spec.js +346 -0
- package/dist/execution-matrix/execution-matrix.live.xmemory.spec.js.map +1 -0
- package/dist/execution-matrix/execution-matrix.spec.d.ts +2 -0
- package/dist/execution-matrix/execution-matrix.spec.d.ts.map +1 -0
- package/dist/execution-matrix/execution-matrix.spec.js +1786 -0
- package/dist/execution-matrix/execution-matrix.spec.js.map +1 -0
- package/dist/execution-matrix/execution-mode.d.ts +34 -0
- package/dist/execution-matrix/execution-mode.d.ts.map +1 -0
- package/dist/execution-matrix/execution-mode.js +72 -0
- package/dist/execution-matrix/execution-mode.js.map +1 -0
- package/dist/execution-matrix/factory.d.ts +72 -0
- package/dist/execution-matrix/factory.d.ts.map +1 -0
- package/dist/execution-matrix/factory.js +77 -0
- package/dist/execution-matrix/factory.js.map +1 -0
- package/dist/execution-matrix/graph-engine-datafilters-reexport.spec.d.ts +2 -0
- package/dist/execution-matrix/graph-engine-datafilters-reexport.spec.d.ts.map +1 -0
- package/dist/execution-matrix/graph-engine-datafilters-reexport.spec.js +48 -0
- package/dist/execution-matrix/graph-engine-datafilters-reexport.spec.js.map +1 -0
- package/dist/execution-matrix/graph-entry-xmemory-load.d.ts +130 -0
- package/dist/execution-matrix/graph-entry-xmemory-load.d.ts.map +1 -0
- package/dist/execution-matrix/graph-entry-xmemory-load.js +146 -0
- package/dist/execution-matrix/graph-entry-xmemory-load.js.map +1 -0
- package/dist/execution-matrix/graph-entry-xmemory-load.spec.d.ts +2 -0
- package/dist/execution-matrix/graph-entry-xmemory-load.spec.d.ts.map +1 -0
- package/dist/execution-matrix/graph-entry-xmemory-load.spec.js +66 -0
- package/dist/execution-matrix/graph-entry-xmemory-load.spec.js.map +1 -0
- package/dist/execution-matrix/graph-operational-aggregates.d.ts +47 -0
- package/dist/execution-matrix/graph-operational-aggregates.d.ts.map +1 -0
- package/dist/execution-matrix/graph-operational-aggregates.js +137 -0
- package/dist/execution-matrix/graph-operational-aggregates.js.map +1 -0
- package/dist/execution-matrix/graph-operational-lifecycle.d.ts +43 -0
- package/dist/execution-matrix/graph-operational-lifecycle.d.ts.map +1 -0
- package/dist/execution-matrix/graph-operational-lifecycle.js +88 -0
- package/dist/execution-matrix/graph-operational-lifecycle.js.map +1 -0
- package/dist/execution-matrix/graph-operational.spec.d.ts +2 -0
- package/dist/execution-matrix/graph-operational.spec.d.ts.map +1 -0
- package/dist/execution-matrix/graph-operational.spec.js +203 -0
- package/dist/execution-matrix/graph-operational.spec.js.map +1 -0
- package/dist/execution-matrix/index.d.ts +73 -0
- package/dist/execution-matrix/index.d.ts.map +1 -0
- package/dist/execution-matrix/index.js +57 -0
- package/dist/execution-matrix/index.js.map +1 -0
- package/dist/execution-matrix/live-tier-open.d.ts +6 -0
- package/dist/execution-matrix/live-tier-open.d.ts.map +1 -0
- package/dist/execution-matrix/live-tier-open.js +6 -0
- package/dist/execution-matrix/live-tier-open.js.map +1 -0
- package/dist/execution-matrix/materializer.d.ts +99 -0
- package/dist/execution-matrix/materializer.d.ts.map +1 -0
- package/dist/execution-matrix/materializer.js +210 -0
- package/dist/execution-matrix/materializer.js.map +1 -0
- package/dist/execution-matrix/matrix-activix.d.ts +24 -0
- package/dist/execution-matrix/matrix-activix.d.ts.map +1 -0
- package/dist/execution-matrix/matrix-activix.js +34 -0
- package/dist/execution-matrix/matrix-activix.js.map +1 -0
- package/dist/execution-matrix/matrix-data-tier.d.ts +55 -0
- package/dist/execution-matrix/matrix-data-tier.d.ts.map +1 -0
- package/dist/execution-matrix/matrix-data-tier.js +74 -0
- package/dist/execution-matrix/matrix-data-tier.js.map +1 -0
- package/dist/execution-matrix/matrix-execute-graph-adapter.d.ts +43 -0
- package/dist/execution-matrix/matrix-execute-graph-adapter.d.ts.map +1 -0
- package/dist/execution-matrix/matrix-execute-graph-adapter.js +62 -0
- package/dist/execution-matrix/matrix-execute-graph-adapter.js.map +1 -0
- package/dist/execution-matrix/matrix-execute-graph-adapter.spec.d.ts +2 -0
- package/dist/execution-matrix/matrix-execute-graph-adapter.spec.d.ts.map +1 -0
- package/dist/execution-matrix/matrix-execute-graph-adapter.spec.js +60 -0
- package/dist/execution-matrix/matrix-execute-graph-adapter.spec.js.map +1 -0
- package/dist/execution-matrix/matrix-logxer.d.ts +15 -0
- package/dist/execution-matrix/matrix-logxer.d.ts.map +1 -0
- package/dist/execution-matrix/matrix-logxer.js +65 -0
- package/dist/execution-matrix/matrix-logxer.js.map +1 -0
- package/dist/execution-matrix/matrix-read-tier.d.ts +41 -0
- package/dist/execution-matrix/matrix-read-tier.d.ts.map +1 -0
- package/dist/execution-matrix/matrix-read-tier.js +41 -0
- package/dist/execution-matrix/matrix-read-tier.js.map +1 -0
- package/dist/execution-matrix/memorix-entity-type-helpers.d.ts +25 -0
- package/dist/execution-matrix/memorix-entity-type-helpers.d.ts.map +1 -0
- package/dist/execution-matrix/memorix-entity-type-helpers.js +32 -0
- package/dist/execution-matrix/memorix-entity-type-helpers.js.map +1 -0
- package/dist/execution-matrix/memorix-entity-type-helpers.spec.d.ts +2 -0
- package/dist/execution-matrix/memorix-entity-type-helpers.spec.d.ts.map +1 -0
- package/dist/execution-matrix/memorix-entity-type-helpers.spec.js +83 -0
- package/dist/execution-matrix/memorix-entity-type-helpers.spec.js.map +1 -0
- package/dist/execution-matrix/memorix-inference-persister.d.ts +73 -0
- package/dist/execution-matrix/memorix-inference-persister.d.ts.map +1 -0
- package/dist/execution-matrix/memorix-inference-persister.js +126 -0
- package/dist/execution-matrix/memorix-inference-persister.js.map +1 -0
- package/dist/execution-matrix/memorix-inference-persister.spec.d.ts +2 -0
- package/dist/execution-matrix/memorix-inference-persister.spec.d.ts.map +1 -0
- package/dist/execution-matrix/memorix-inference-persister.spec.js +117 -0
- package/dist/execution-matrix/memorix-inference-persister.spec.js.map +1 -0
- package/dist/execution-matrix/memorix-matrix-entity-facet.d.ts +71 -0
- package/dist/execution-matrix/memorix-matrix-entity-facet.d.ts.map +1 -0
- package/dist/execution-matrix/memorix-matrix-entity-facet.js +91 -0
- package/dist/execution-matrix/memorix-matrix-entity-facet.js.map +1 -0
- package/dist/execution-matrix/memorix-matrix-entity-facet.spec.d.ts +2 -0
- package/dist/execution-matrix/memorix-matrix-entity-facet.spec.d.ts.map +1 -0
- package/dist/execution-matrix/memorix-matrix-entity-facet.spec.js +151 -0
- package/dist/execution-matrix/memorix-matrix-entity-facet.spec.js.map +1 -0
- package/dist/execution-matrix/memorix-runtime-tier.d.ts +153 -0
- package/dist/execution-matrix/memorix-runtime-tier.d.ts.map +1 -0
- package/dist/execution-matrix/memorix-runtime-tier.js +185 -0
- package/dist/execution-matrix/memorix-runtime-tier.js.map +1 -0
- package/dist/execution-matrix/memorix-tier-statistics.d.ts +103 -0
- package/dist/execution-matrix/memorix-tier-statistics.d.ts.map +1 -0
- package/dist/execution-matrix/memorix-tier-statistics.js +164 -0
- package/dist/execution-matrix/memorix-tier-statistics.js.map +1 -0
- package/dist/execution-matrix/memory-store.d.ts +20 -0
- package/dist/execution-matrix/memory-store.d.ts.map +1 -0
- package/dist/execution-matrix/memory-store.js +185 -0
- package/dist/execution-matrix/memory-store.js.map +1 -0
- package/dist/execution-matrix/navigator.d.ts +97 -0
- package/dist/execution-matrix/navigator.d.ts.map +1 -0
- package/dist/execution-matrix/navigator.js +119 -0
- package/dist/execution-matrix/navigator.js.map +1 -0
- package/dist/execution-matrix/orchestrator.d.ts +204 -0
- package/dist/execution-matrix/orchestrator.d.ts.map +1 -0
- package/dist/execution-matrix/orchestrator.js +656 -0
- package/dist/execution-matrix/orchestrator.js.map +1 -0
- package/dist/execution-matrix/records-eligibility.d.ts +34 -0
- package/dist/execution-matrix/records-eligibility.d.ts.map +1 -0
- package/dist/execution-matrix/records-eligibility.js +110 -0
- package/dist/execution-matrix/records-eligibility.js.map +1 -0
- package/dist/execution-matrix/records-eligibility.spec.d.ts +2 -0
- package/dist/execution-matrix/records-eligibility.spec.d.ts.map +1 -0
- package/dist/execution-matrix/records-eligibility.spec.js +154 -0
- package/dist/execution-matrix/records-eligibility.spec.js.map +1 -0
- package/dist/execution-matrix/run-loop.d.ts +140 -0
- package/dist/execution-matrix/run-loop.d.ts.map +1 -0
- package/dist/execution-matrix/run-loop.js +350 -0
- package/dist/execution-matrix/run-loop.js.map +1 -0
- package/dist/execution-matrix/runtime-connectivity-health.d.ts +128 -0
- package/dist/execution-matrix/runtime-connectivity-health.d.ts.map +1 -0
- package/dist/execution-matrix/runtime-connectivity-health.js +253 -0
- package/dist/execution-matrix/runtime-connectivity-health.js.map +1 -0
- package/dist/execution-matrix/runtime-connectivity-health.spec.d.ts +2 -0
- package/dist/execution-matrix/runtime-connectivity-health.spec.d.ts.map +1 -0
- package/dist/execution-matrix/runtime-connectivity-health.spec.js +23 -0
- package/dist/execution-matrix/runtime-connectivity-health.spec.js.map +1 -0
- package/dist/execution-matrix/runtime-objects.d.ts +16 -0
- package/dist/execution-matrix/runtime-objects.d.ts.map +1 -0
- package/dist/execution-matrix/runtime-objects.js +20 -0
- package/dist/execution-matrix/runtime-objects.js.map +1 -0
- package/dist/execution-matrix/runtime-store.d.ts +114 -0
- package/dist/execution-matrix/runtime-store.d.ts.map +1 -0
- package/dist/execution-matrix/runtime-store.js +506 -0
- package/dist/execution-matrix/runtime-store.js.map +1 -0
- package/dist/execution-matrix/snapshot-runner.d.ts +50 -0
- package/dist/execution-matrix/snapshot-runner.d.ts.map +1 -0
- package/dist/execution-matrix/snapshot-runner.js +111 -0
- package/dist/execution-matrix/snapshot-runner.js.map +1 -0
- package/dist/execution-matrix/source-resolver-factories.d.ts +31 -0
- package/dist/execution-matrix/source-resolver-factories.d.ts.map +1 -0
- package/dist/execution-matrix/source-resolver-factories.js +71 -0
- package/dist/execution-matrix/source-resolver-factories.js.map +1 -0
- package/dist/execution-matrix/source-resolver-factories.spec.d.ts +2 -0
- package/dist/execution-matrix/source-resolver-factories.spec.d.ts.map +1 -0
- package/dist/execution-matrix/source-resolver-factories.spec.js +127 -0
- package/dist/execution-matrix/source-resolver-factories.spec.js.map +1 -0
- package/dist/execution-matrix/source-resolver.d.ts +31 -0
- package/dist/execution-matrix/source-resolver.d.ts.map +1 -0
- package/dist/execution-matrix/source-resolver.js +26 -0
- package/dist/execution-matrix/source-resolver.js.map +1 -0
- package/dist/execution-matrix/status.d.ts +7 -0
- package/dist/execution-matrix/status.d.ts.map +1 -0
- package/dist/execution-matrix/status.js +33 -0
- package/dist/execution-matrix/status.js.map +1 -0
- package/dist/execution-matrix/xmemory-entity-collections.d.ts +69 -0
- package/dist/execution-matrix/xmemory-entity-collections.d.ts.map +1 -0
- package/dist/execution-matrix/xmemory-entity-collections.js +120 -0
- package/dist/execution-matrix/xmemory-entity-collections.js.map +1 -0
- package/dist/execution-matrix/xmemory-entity-collections.spec.d.ts +2 -0
- package/dist/execution-matrix/xmemory-entity-collections.spec.d.ts.map +1 -0
- package/dist/execution-matrix/xmemory-entity-collections.spec.js +112 -0
- package/dist/execution-matrix/xmemory-entity-collections.spec.js.map +1 -0
- package/dist/execution-matrix/xmemory-op-tier.d.ts +172 -0
- package/dist/execution-matrix/xmemory-op-tier.d.ts.map +1 -0
- package/dist/execution-matrix/xmemory-op-tier.js +339 -0
- package/dist/execution-matrix/xmemory-op-tier.js.map +1 -0
- package/dist/execution-matrix/xmemory-op-tier.spec.d.ts +2 -0
- package/dist/execution-matrix/xmemory-op-tier.spec.d.ts.map +1 -0
- package/dist/execution-matrix/xmemory-op-tier.spec.js +198 -0
- package/dist/execution-matrix/xmemory-op-tier.spec.js.map +1 -0
- package/dist/execution-matrix/xronox-matrix-factory.d.ts +38 -0
- package/dist/execution-matrix/xronox-matrix-factory.d.ts.map +1 -0
- package/dist/execution-matrix/xronox-matrix-factory.js +77 -0
- package/dist/execution-matrix/xronox-matrix-factory.js.map +1 -0
- package/dist/execution-matrix/xronox-store-native-driver-hooks.d.ts +15 -0
- package/dist/execution-matrix/xronox-store-native-driver-hooks.d.ts.map +1 -0
- package/dist/execution-matrix/xronox-store-native-driver-hooks.js +41 -0
- package/dist/execution-matrix/xronox-store-native-driver-hooks.js.map +1 -0
- package/dist/test-fixtures/exellix-test-matrix-ids.d.ts +16 -0
- package/dist/test-fixtures/exellix-test-matrix-ids.d.ts.map +1 -0
- package/dist/test-fixtures/exellix-test-matrix-ids.js +16 -0
- package/dist/test-fixtures/exellix-test-matrix-ids.js.map +1 -0
- package/dist/test-fixtures/seed-exellix-test-matrix-config.d.ts +26 -0
- package/dist/test-fixtures/seed-exellix-test-matrix-config.d.ts.map +1 -0
- package/dist/test-fixtures/seed-exellix-test-matrix-config.js +82 -0
- package/dist/test-fixtures/seed-exellix-test-matrix-config.js.map +1 -0
- package/package.json +67 -0
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* XMemory entity-collection registry: Catalox catalog listing plus resolved entity queries.
|
|
3
|
+
*
|
|
4
|
+
* The **registry** is a normal Catalox catalog (default id {@link DEFAULT_XMEMORY_ENTITY_COLLECTIONS_CATALOG_ID})
|
|
5
|
+
* whose items describe where entity rows live. Each registry item’s `data` should include either:
|
|
6
|
+
* - `entitiesCatalogId` (or `entityCatalogId` / `itemsCatalogId`) — Catalox catalog to list via {@link Catalox.listCatalogItems}, or
|
|
7
|
+
* - `recordCollectionRef` (or `xronoxCollectionRef` / `collectionRef`) — logical collection ref for {@link XronoxCollection.readMany}.
|
|
8
|
+
*/
|
|
9
|
+
import { compactCatalogFilter, } from '@x12i/catalox';
|
|
10
|
+
import { DEFAULT_XMEMORY_ENTITY_COLLECTIONS_CATALOG_ID } from './constants.js';
|
|
11
|
+
/** Env: overrides default registry catalog id when non-empty after trim. */
|
|
12
|
+
export const EXELLIX_XMEMORY_ENTITY_COLLECTIONS_CATALOG_ID_ENV = 'EXELLIX_XMEMORY_ENTITY_COLLECTIONS_CATALOG_ID';
|
|
13
|
+
export function resolveXmemoryEntityCollectionsRuntimeConfig(overrides) {
|
|
14
|
+
const envRaw = typeof process !== 'undefined'
|
|
15
|
+
? process.env?.[EXELLIX_XMEMORY_ENTITY_COLLECTIONS_CATALOG_ID_ENV]
|
|
16
|
+
: undefined;
|
|
17
|
+
const envId = typeof envRaw === 'string' ? envRaw.trim() : '';
|
|
18
|
+
return {
|
|
19
|
+
entityCollectionsCatalogId: overrides?.entityCollectionsCatalogId ??
|
|
20
|
+
(envId.length > 0 ? envId : DEFAULT_XMEMORY_ENTITY_COLLECTIONS_CATALOG_ID),
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
function normalizeCatalogQueryOptions(query) {
|
|
24
|
+
if (!query)
|
|
25
|
+
return undefined;
|
|
26
|
+
const compacted = compactCatalogFilter(query.filter);
|
|
27
|
+
const next = { ...query };
|
|
28
|
+
if (query.filter !== undefined) {
|
|
29
|
+
next.filter = Object.keys(compacted).length > 0 ? compacted : undefined;
|
|
30
|
+
}
|
|
31
|
+
return next;
|
|
32
|
+
}
|
|
33
|
+
/** Read Catalox backing catalog id from a registry catalog item (`data.*`). */
|
|
34
|
+
export function resolveEntitiesCatalogIdFromRegistryItem(item) {
|
|
35
|
+
const data = item.data;
|
|
36
|
+
if (!data || typeof data !== 'object')
|
|
37
|
+
return undefined;
|
|
38
|
+
const rec = data;
|
|
39
|
+
for (const key of ['entitiesCatalogId', 'entityCatalogId', 'itemsCatalogId']) {
|
|
40
|
+
const v = rec[key];
|
|
41
|
+
if (typeof v === 'string' && v.trim())
|
|
42
|
+
return v.trim();
|
|
43
|
+
}
|
|
44
|
+
return undefined;
|
|
45
|
+
}
|
|
46
|
+
/** Read xronox logical collection ref from a registry catalog item (`data.*`). */
|
|
47
|
+
export function resolveRecordCollectionRefFromRegistryItem(item) {
|
|
48
|
+
const data = item.data;
|
|
49
|
+
if (!data || typeof data !== 'object')
|
|
50
|
+
return undefined;
|
|
51
|
+
const rec = data;
|
|
52
|
+
for (const key of ['recordCollectionRef', 'xronoxCollectionRef', 'collectionRef']) {
|
|
53
|
+
const v = rec[key];
|
|
54
|
+
if (typeof v === 'string' && v.trim())
|
|
55
|
+
return v.trim();
|
|
56
|
+
}
|
|
57
|
+
return undefined;
|
|
58
|
+
}
|
|
59
|
+
async function loadRegistryItem(catalox, context, registryItemId, resolvedConfig) {
|
|
60
|
+
const got = await catalox.getCatalogItem(context, resolvedConfig.entityCollectionsCatalogId, registryItemId);
|
|
61
|
+
if (got.outcome === 'not_found') {
|
|
62
|
+
throw new Error(`listXmemoryEntityCollection*: registry item '${registryItemId}' not found in catalog '${resolvedConfig.entityCollectionsCatalogId}'`);
|
|
63
|
+
}
|
|
64
|
+
if (got.outcome === 'mapping_blocked') {
|
|
65
|
+
throw new Error(`listXmemoryEntityCollection*: registry item '${registryItemId}' mapping_blocked in catalog '${resolvedConfig.entityCollectionsCatalogId}'`);
|
|
66
|
+
}
|
|
67
|
+
return got.item;
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* List registry items from the configured entity-collections catalog (default {@link DEFAULT_XMEMORY_ENTITY_COLLECTIONS_CATALOG_ID}).
|
|
71
|
+
* Forwards `query` to {@link Catalox.listCatalogItems} (`limit`, `offset`, `filter`, `sort`, `scope`).
|
|
72
|
+
*/
|
|
73
|
+
export async function listXmemoryEntityCollectionRegistryItems(catalox, context, query, config) {
|
|
74
|
+
const resolved = resolveXmemoryEntityCollectionsRuntimeConfig(config);
|
|
75
|
+
return catalox.listCatalogItems(context, resolved.entityCollectionsCatalogId, normalizeCatalogQueryOptions(query));
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* List entity rows exposed as a **Catalox catalog** (native or mapped).
|
|
79
|
+
*
|
|
80
|
+
* Resolve order: `entitiesCatalogId` override → registry item `data.entitiesCatalogId` / aliases.
|
|
81
|
+
* Throws if neither yields a catalog id.
|
|
82
|
+
*/
|
|
83
|
+
export async function listXmemoryEntityCollectionCatalogEntities(catalox, context, input, config) {
|
|
84
|
+
const resolvedConfig = resolveXmemoryEntityCollectionsRuntimeConfig(config);
|
|
85
|
+
let catalogId = input.entitiesCatalogId?.trim();
|
|
86
|
+
if (!catalogId && input.registryItemId) {
|
|
87
|
+
const item = await loadRegistryItem(catalox, context, input.registryItemId, resolvedConfig);
|
|
88
|
+
catalogId = resolveEntitiesCatalogIdFromRegistryItem(item);
|
|
89
|
+
}
|
|
90
|
+
if (!catalogId) {
|
|
91
|
+
throw new Error('listXmemoryEntityCollectionCatalogEntities: provide entitiesCatalogId or a registry item whose data includes entitiesCatalogId (or entityCatalogId / itemsCatalogId)');
|
|
92
|
+
}
|
|
93
|
+
return catalox.listCatalogItems(context, catalogId, normalizeCatalogQueryOptions(input.query));
|
|
94
|
+
}
|
|
95
|
+
/**
|
|
96
|
+
* List raw documents for an entity collection backed by **xronox** (Mongo-shaped rows).
|
|
97
|
+
*
|
|
98
|
+
* Pagination: use `limit` + tight `filter`. Deep paging without skip is a known xronox read constraint;
|
|
99
|
+
* prefer Catalox-mapped catalogs for offset-style paging via {@link listXmemoryEntityCollectionCatalogEntities}.
|
|
100
|
+
*/
|
|
101
|
+
export async function listXmemoryEntityCollectionDocuments(catalox, context, input, deps, config) {
|
|
102
|
+
const resolvedConfig = resolveXmemoryEntityCollectionsRuntimeConfig(config);
|
|
103
|
+
const item = await loadRegistryItem(catalox, context, input.registryItemId, resolvedConfig);
|
|
104
|
+
const ref = resolveRecordCollectionRefFromRegistryItem(item);
|
|
105
|
+
if (!ref) {
|
|
106
|
+
throw new Error(`listXmemoryEntityCollectionDocuments: registry item '${input.registryItemId}' missing recordCollectionRef (or xronoxCollectionRef / collectionRef) in data`);
|
|
107
|
+
}
|
|
108
|
+
const coll = deps.resolveCollection(ref);
|
|
109
|
+
const filter = input.filter ?? {};
|
|
110
|
+
const readOpts = {
|
|
111
|
+
limit: input.limit,
|
|
112
|
+
sort: input.sort,
|
|
113
|
+
mergeCache: input.mergeCache ?? true,
|
|
114
|
+
};
|
|
115
|
+
const rowsP = coll.readMany(filter, readOpts);
|
|
116
|
+
const totalP = input.includeTotal ? coll.countMatching(filter) : Promise.resolve(undefined);
|
|
117
|
+
const [rows, total] = await Promise.all([rowsP, totalP]);
|
|
118
|
+
return total !== undefined ? { rows, total } : { rows };
|
|
119
|
+
}
|
|
120
|
+
//# sourceMappingURL=xmemory-entity-collections.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"xmemory-entity-collections.js","sourceRoot":"","sources":["../../src/execution-matrix/xmemory-entity-collections.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EACL,oBAAoB,GAQrB,MAAM,eAAe,CAAC;AAEvB,OAAO,EAAE,6CAA6C,EAAE,MAAM,gBAAgB,CAAC;AAE/E,4EAA4E;AAC5E,MAAM,CAAC,MAAM,iDAAiD,GAC5D,+CAAwD,CAAC;AAO3D,MAAM,UAAU,4CAA4C,CAC1D,SAA0D;IAE1D,MAAM,MAAM,GACV,OAAO,OAAO,KAAK,WAAW;QAC5B,CAAC,CAAC,OAAO,CAAC,GA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,GAAG,GAAG,0CAA0C,CAAC,IAAI,CAAC,CAAC;IAC7D,IAAI,CAAC,GAAG,EAAE,CAAC;QACT,MAAM,IAAI,KAAK,CACb,wDAAwD,KAAK,CAAC,cAAc,gFAAgF,CAC7J,CAAC;IACJ,CAAC;IAED,MAAM,IAAI,GAAG,IAAI,CAAC,iBAAiB,CAAC,GAAG,CAAC,CAAC;IACzC,MAAM,MAAM,GAAG,KAAK,CAAC,MAAM,IAAI,EAAE,CAAC;IAClC,MAAM,QAAQ,GAAG;QACf,KAAK,EAAE,KAAK,CAAC,KAAK;QAClB,IAAI,EAAE,KAAK,CAAC,IAAI;QAChB,UAAU,EAAE,KAAK,CAAC,UAAU,IAAI,IAAI;KACrC,CAAC;IAEF,MAAM,KAAK,GAAG,IAAI,CAAC,QAAQ,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;IAC9C,MAAM,MAAM,GAAG,KAAK,CAAC,YAAY,CAAC,CAAC,CAAC,IAAI,CAAC,aAAa,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;IAC5F,MAAM,CAAC,IAAI,EAAE,KAAK,CAAC,GAAG,MAAM,OAAO,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC,CAAC;IACzD,OAAO,KAAK,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC;AAC1D,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"xmemory-entity-collections.spec.d.ts","sourceRoot":"","sources":["../../src/execution-matrix/xmemory-entity-collections.spec.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
import { describe, expect, it, vi } from 'vitest';
|
|
2
|
+
import { MemoryMatrixCollection } from './memory-store.js';
|
|
3
|
+
import { EXELLIX_XMEMORY_ENTITY_COLLECTIONS_CATALOG_ID_ENV, listXmemoryEntityCollectionCatalogEntities, listXmemoryEntityCollectionDocuments, listXmemoryEntityCollectionRegistryItems, resolveEntitiesCatalogIdFromRegistryItem, resolveRecordCollectionRefFromRegistryItem, resolveXmemoryEntityCollectionsRuntimeConfig, } from './xmemory-entity-collections.js';
|
|
4
|
+
import { DEFAULT_XMEMORY_ENTITY_COLLECTIONS_CATALOG_ID } from './constants.js';
|
|
5
|
+
const ctx = { appId: 'app_test' };
|
|
6
|
+
describe('resolveXmemoryEntityCollectionsRuntimeConfig', () => {
|
|
7
|
+
it('defaults to package constant', () => {
|
|
8
|
+
const prev = process.env[EXELLIX_XMEMORY_ENTITY_COLLECTIONS_CATALOG_ID_ENV];
|
|
9
|
+
delete process.env[EXELLIX_XMEMORY_ENTITY_COLLECTIONS_CATALOG_ID_ENV];
|
|
10
|
+
expect(resolveXmemoryEntityCollectionsRuntimeConfig().entityCollectionsCatalogId).toBe(DEFAULT_XMEMORY_ENTITY_COLLECTIONS_CATALOG_ID);
|
|
11
|
+
if (prev !== undefined)
|
|
12
|
+
process.env[EXELLIX_XMEMORY_ENTITY_COLLECTIONS_CATALOG_ID_ENV] = prev;
|
|
13
|
+
});
|
|
14
|
+
it('respects overrides over env', () => {
|
|
15
|
+
process.env[EXELLIX_XMEMORY_ENTITY_COLLECTIONS_CATALOG_ID_ENV] = 'from-env';
|
|
16
|
+
expect(resolveXmemoryEntityCollectionsRuntimeConfig({ entityCollectionsCatalogId: 'override' })
|
|
17
|
+
.entityCollectionsCatalogId).toBe('override');
|
|
18
|
+
delete process.env[EXELLIX_XMEMORY_ENTITY_COLLECTIONS_CATALOG_ID_ENV];
|
|
19
|
+
});
|
|
20
|
+
});
|
|
21
|
+
describe('registry item data helpers', () => {
|
|
22
|
+
const base = (data) => ({
|
|
23
|
+
itemId: 'reg1',
|
|
24
|
+
catalogId: DEFAULT_XMEMORY_ENTITY_COLLECTIONS_CATALOG_ID,
|
|
25
|
+
sourceMode: 'native',
|
|
26
|
+
data,
|
|
27
|
+
metadata: {},
|
|
28
|
+
});
|
|
29
|
+
it('resolveEntitiesCatalogIdFromRegistryItem picks known keys', () => {
|
|
30
|
+
expect(resolveEntitiesCatalogIdFromRegistryItem(base({ entitiesCatalogId: ' cats ' }))).toBe('cats');
|
|
31
|
+
expect(resolveEntitiesCatalogIdFromRegistryItem(base({ entityCatalogId: 'e' }))).toBe('e');
|
|
32
|
+
expect(resolveEntitiesCatalogIdFromRegistryItem(base({ itemsCatalogId: 'i' }))).toBe('i');
|
|
33
|
+
expect(resolveEntitiesCatalogIdFromRegistryItem(base({}))).toBeUndefined();
|
|
34
|
+
});
|
|
35
|
+
it('resolveRecordCollectionRefFromRegistryItem picks known keys', () => {
|
|
36
|
+
expect(resolveRecordCollectionRefFromRegistryItem(base({ recordCollectionRef: ' r ' }))).toBe('r');
|
|
37
|
+
expect(resolveRecordCollectionRefFromRegistryItem(base({ xronoxCollectionRef: 'x' }))).toBe('x');
|
|
38
|
+
expect(resolveRecordCollectionRefFromRegistryItem(base({ collectionRef: 'c' }))).toBe('c');
|
|
39
|
+
});
|
|
40
|
+
});
|
|
41
|
+
describe('listXmemoryEntityCollectionRegistryItems', () => {
|
|
42
|
+
it('lists against resolved catalog id', async () => {
|
|
43
|
+
const listCatalogItems = vi.fn().mockResolvedValue({
|
|
44
|
+
listOutcome: 'ok',
|
|
45
|
+
items: [],
|
|
46
|
+
});
|
|
47
|
+
const catalox = { listCatalogItems };
|
|
48
|
+
await listXmemoryEntityCollectionRegistryItems(catalox, ctx, { limit: 5 }, {
|
|
49
|
+
entityCollectionsCatalogId: 'my-registry',
|
|
50
|
+
});
|
|
51
|
+
expect(listCatalogItems).toHaveBeenCalledWith(ctx, 'my-registry', { limit: 5 });
|
|
52
|
+
});
|
|
53
|
+
});
|
|
54
|
+
describe('listXmemoryEntityCollectionCatalogEntities', () => {
|
|
55
|
+
it('uses entitiesCatalogId override without getCatalogItem', async () => {
|
|
56
|
+
const listCatalogItems = vi.fn().mockResolvedValue({ listOutcome: 'ok', items: [{ itemId: 'a' }] });
|
|
57
|
+
const getCatalogItem = vi.fn();
|
|
58
|
+
const catalox = { listCatalogItems, getCatalogItem };
|
|
59
|
+
const res = await listXmemoryEntityCollectionCatalogEntities(catalox, ctx, { entitiesCatalogId: 'entities', query: { filter: { x: '' }, limit: 10 } });
|
|
60
|
+
expect(getCatalogItem).not.toHaveBeenCalled();
|
|
61
|
+
expect(listCatalogItems).toHaveBeenCalledWith(ctx, 'entities', { filter: undefined, limit: 10 });
|
|
62
|
+
expect(res.items).toHaveLength(1);
|
|
63
|
+
});
|
|
64
|
+
it('loads registry item then lists entities catalog', async () => {
|
|
65
|
+
const item = {
|
|
66
|
+
itemId: 'r1',
|
|
67
|
+
catalogId: DEFAULT_XMEMORY_ENTITY_COLLECTIONS_CATALOG_ID,
|
|
68
|
+
sourceMode: 'native',
|
|
69
|
+
data: { entitiesCatalogId: 'pet-catalog' },
|
|
70
|
+
metadata: {},
|
|
71
|
+
};
|
|
72
|
+
const getCatalogItem = vi.fn().mockResolvedValue({ outcome: 'found', item });
|
|
73
|
+
const listCatalogItems = vi.fn().mockResolvedValue({ listOutcome: 'ok', items: [] });
|
|
74
|
+
const catalox = { getCatalogItem, listCatalogItems };
|
|
75
|
+
await listXmemoryEntityCollectionCatalogEntities(catalox, ctx, { registryItemId: 'r1' });
|
|
76
|
+
expect(getCatalogItem).toHaveBeenCalledWith(ctx, DEFAULT_XMEMORY_ENTITY_COLLECTIONS_CATALOG_ID, 'r1');
|
|
77
|
+
expect(listCatalogItems).toHaveBeenCalledWith(ctx, 'pet-catalog', undefined);
|
|
78
|
+
});
|
|
79
|
+
});
|
|
80
|
+
describe('listXmemoryEntityCollectionDocuments', () => {
|
|
81
|
+
it('reads xronox collection via resolveCollection', async () => {
|
|
82
|
+
const item = {
|
|
83
|
+
itemId: 'r2',
|
|
84
|
+
catalogId: DEFAULT_XMEMORY_ENTITY_COLLECTIONS_CATALOG_ID,
|
|
85
|
+
sourceMode: 'native',
|
|
86
|
+
data: { recordCollectionRef: 'things' },
|
|
87
|
+
metadata: {},
|
|
88
|
+
};
|
|
89
|
+
const getCatalogItem = vi.fn().mockResolvedValue({ outcome: 'found', item });
|
|
90
|
+
const catalox = { getCatalogItem };
|
|
91
|
+
const mem = new MemoryMatrixCollection('_id');
|
|
92
|
+
await mem.insert({ _id: '1', kind: 'dog' });
|
|
93
|
+
const res = await listXmemoryEntityCollectionDocuments(catalox, ctx, { registryItemId: 'r2', filter: {}, limit: 10 }, {
|
|
94
|
+
resolveCollection: (ref) => {
|
|
95
|
+
expect(ref).toBe('things');
|
|
96
|
+
return mem.asCollection();
|
|
97
|
+
},
|
|
98
|
+
});
|
|
99
|
+
expect(res.rows).toHaveLength(1);
|
|
100
|
+
expect(res.total).toBeUndefined();
|
|
101
|
+
const mockColl = {
|
|
102
|
+
readMany: vi.fn().mockResolvedValue([{ _id: '1' }]),
|
|
103
|
+
countMatching: vi.fn().mockResolvedValue(42),
|
|
104
|
+
};
|
|
105
|
+
const withTotal = await listXmemoryEntityCollectionDocuments(catalox, ctx, { registryItemId: 'r2', filter: { a: 1 }, includeTotal: true }, {
|
|
106
|
+
resolveCollection: () => mockColl,
|
|
107
|
+
});
|
|
108
|
+
expect(withTotal.total).toBe(42);
|
|
109
|
+
expect(mockColl.countMatching).toHaveBeenCalledWith({ a: 1 });
|
|
110
|
+
});
|
|
111
|
+
});
|
|
112
|
+
//# sourceMappingURL=xmemory-entity-collections.spec.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"xmemory-entity-collections.spec.js","sourceRoot":"","sources":["../../src/execution-matrix/xmemory-entity-collections.spec.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE,EAAE,EAAE,MAAM,QAAQ,CAAC;AAKlD,OAAO,EAAE,sBAAsB,EAAE,MAAM,mBAAmB,CAAC;AAC3D,OAAO,EACL,iDAAiD,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IAAI,EAAE,EAC9D;YACE,iBAAiB,EAAE,GAAG,EAAE,CAAC,QAAgE;SAC1F,CACF,CAAC;QACF,MAAM,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;QACjC,MAAM,CAAC,QAAQ,CAAC,aAAa,CAAC,CAAC,oBAAoB,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC;IAChE,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Read helpers for the XMemory **operational** Mongo tier (`tier.env.opDb`, typically **`xmemory-op`**
|
|
3
|
+
* — align with deployment **`XMEMORY_OP_DB`** and `@x12i/xmemory-store` tier defaults).
|
|
4
|
+
*
|
|
5
|
+
* `@x12i/xmemory-store` registers {@link tier.opStore} with **scoped views** (`tier.env.viewsCollection`,
|
|
6
|
+
* default `scoped_views`). Use {@link listXmemoryOpScopedViews} for xronox-shaped reads (visibility / cache merge)
|
|
7
|
+
* and {@link listXmemoryOpScopedViewsPaged} when you need **`skip` / offset** paging via the tier
|
|
8
|
+
* {@link XmemoryMongoClient}.
|
|
9
|
+
*
|
|
10
|
+
* **Scoped data / snapshots** live in the same op DB but are **not** first-class xronox collections on the tier
|
|
11
|
+
* adapter — reads use {@link tier.mongoClient} (`findMany` / `countMany`), typically with **`fallbackMongoClient`**
|
|
12
|
+
* wired at tier creation. Collection names come from {@link MemorixRuntimeTier.env} (`scopedDataCollection` default
|
|
13
|
+
* **`x-scoped-data`**, `snapshotsCollection` default **`x-snapshots`**), overridable via **`SCOPED_DATA_COLLECTION`**
|
|
14
|
+
* / **`SNAPSHOTS_COLLECTION`** (see {@link resolveMemorixRuntimeTierEnv}).
|
|
15
|
+
*/
|
|
16
|
+
import type { XmemoryDataTier } from './memorix-runtime-tier.js';
|
|
17
|
+
import type { XronoxCollection } from '@x12i/xronox-store';
|
|
18
|
+
export { COLLECTION_DEFAULTS, DEFAULT_SCOPED_DATA_COLLECTION, DEFAULT_SNAPSHOTS_COLLECTION, FIND_MANY_DEFAULT_LIMIT_WITH_SKIP, FIND_MANY_MAX_SKIP, FIND_MANY_MAX_WINDOW, } from './memorix-runtime-tier.js';
|
|
19
|
+
/** xronox collection handle for scoped view rows on {@link XmemoryDataTier.opStore}. */
|
|
20
|
+
export declare function getXmemoryOpScopedViewsCollection(tier: XmemoryDataTier): XronoxCollection<Record<string, unknown>>;
|
|
21
|
+
/** xronox collection handle for **things** on {@link XmemoryDataTier.corpusStore} (`tier.env.thingsCollection`). */
|
|
22
|
+
export declare function getXmemoryTierThingsCollection(tier: XmemoryDataTier): XronoxCollection<Record<string, unknown>>;
|
|
23
|
+
/**
|
|
24
|
+
* Recommended **`groupByPaths.scoped_data`** for {@link getXmemoryTierStatistics} so entity-type buckets align with
|
|
25
|
+
* {@link buildXScopedDataEntityTypeFilter} (camelCase and snake_case documents).
|
|
26
|
+
*/
|
|
27
|
+
export declare const RECOMMENDED_TIER_STATS_SCOPED_DATA_GROUP_PATHS: readonly ["$entityType", "$entity_type"];
|
|
28
|
+
export type ListXmemoryTierThingsOptions = {
|
|
29
|
+
filter?: Record<string, unknown>;
|
|
30
|
+
limit?: number;
|
|
31
|
+
sort?: Record<string, 1 | -1>;
|
|
32
|
+
mergeCache?: boolean;
|
|
33
|
+
includeHidden?: boolean;
|
|
34
|
+
};
|
|
35
|
+
/**
|
|
36
|
+
* List thing documents via xronox {@link XronoxCollection.readMany} on the corpus store.
|
|
37
|
+
* No `skip` — use {@link listXmemoryTierThingsPaged} for offset paging.
|
|
38
|
+
*/
|
|
39
|
+
export declare function listXmemoryTierThings(tier: XmemoryDataTier, options?: ListXmemoryTierThingsOptions): Promise<Record<string, unknown>[]>;
|
|
40
|
+
export declare function countXmemoryTierThings(tier: XmemoryDataTier, filter?: Record<string, unknown>, includeHidden?: boolean): Promise<number>;
|
|
41
|
+
/**
|
|
42
|
+
* Paged things read via {@link XmemoryMongoClient.findMany} on **`thingsDb`** / **`thingsCollection`**.
|
|
43
|
+
*/
|
|
44
|
+
export declare function listXmemoryTierThingsPaged(tier: XmemoryDataTier, query?: ListXmemoryOpPagedQuery): Promise<Record<string, unknown>[]>;
|
|
45
|
+
export declare function countXmemoryTierThingsMongo(tier: XmemoryDataTier, filter?: Record<string, unknown>): Promise<number>;
|
|
46
|
+
export type FetchAllXmemoryTierThingsOptions = {
|
|
47
|
+
filter?: Record<string, unknown>;
|
|
48
|
+
pageSize?: number;
|
|
49
|
+
maxRows?: number;
|
|
50
|
+
};
|
|
51
|
+
/**
|
|
52
|
+
* Walk things with repeated paged reads until empty or limits hit.
|
|
53
|
+
*/
|
|
54
|
+
export declare function fetchAllXmemoryTierThings(tier: XmemoryDataTier, options?: FetchAllXmemoryTierThingsOptions): Promise<Record<string, unknown>[]>;
|
|
55
|
+
export type ListXmemoryOpScopedViewsOptions = {
|
|
56
|
+
filter?: Record<string, unknown>;
|
|
57
|
+
limit?: number;
|
|
58
|
+
sort?: Record<string, 1 | -1>;
|
|
59
|
+
mergeCache?: boolean;
|
|
60
|
+
includeHidden?: boolean;
|
|
61
|
+
};
|
|
62
|
+
/**
|
|
63
|
+
* List scoped view documents via xronox {@link XronoxCollection.readMany} (same path as scoper tier wiring).
|
|
64
|
+
* Does **not** support `skip`; use {@link listXmemoryOpScopedViewsPaged} for offset paging.
|
|
65
|
+
*/
|
|
66
|
+
export declare function listXmemoryOpScopedViews(tier: XmemoryDataTier, options?: ListXmemoryOpScopedViewsOptions): Promise<Record<string, unknown>[]>;
|
|
67
|
+
/** Match semantics align with {@link listXmemoryOpScopedViews} / xronox visibility rules on scoped views. */
|
|
68
|
+
export declare function countXmemoryOpScopedViews(tier: XmemoryDataTier, filter?: Record<string, unknown>, includeHidden?: boolean): Promise<number>;
|
|
69
|
+
export type ListXmemoryOpPagedQuery = {
|
|
70
|
+
filter?: Record<string, unknown>;
|
|
71
|
+
limit?: number;
|
|
72
|
+
skip?: number;
|
|
73
|
+
projection?: Record<string, 0 | 1>;
|
|
74
|
+
};
|
|
75
|
+
/**
|
|
76
|
+
* Paged read using {@link XmemoryMongoClient.findMany} — supports **`skip`** for walking large corpora.
|
|
77
|
+
* Prefer {@link listXmemoryOpScopedViews} when you only need the first `limit` rows and want cache-merged reads.
|
|
78
|
+
*/
|
|
79
|
+
export declare function listXmemoryOpScopedViewsPaged(tier: XmemoryDataTier, query?: ListXmemoryOpPagedQuery): Promise<Record<string, unknown>[]>;
|
|
80
|
+
/**
|
|
81
|
+
* Document count for scoped views using {@link XmemoryMongoClient.countMany} when present; otherwise falls back
|
|
82
|
+
* to {@link countXmemoryOpScopedViews} (xronox path).
|
|
83
|
+
*/
|
|
84
|
+
export declare function countXmemoryOpScopedViewsMongo(tier: XmemoryDataTier, filter?: Record<string, unknown>): Promise<number>;
|
|
85
|
+
export type FetchAllXmemoryOpScopedViewsOptions = {
|
|
86
|
+
filter?: Record<string, unknown>;
|
|
87
|
+
/** Page size for each {@link listXmemoryOpScopedViewsPaged} call. */
|
|
88
|
+
pageSize?: number;
|
|
89
|
+
/** Hard cap on rows returned (defaults to {@link FIND_MANY_MAX_WINDOW}). */
|
|
90
|
+
maxRows?: number;
|
|
91
|
+
};
|
|
92
|
+
/**
|
|
93
|
+
* Walk scoped views with repeated paged reads until a batch is empty or limits hit.
|
|
94
|
+
* Intended for exports / batch jobs — prefer bounded filters in production.
|
|
95
|
+
*/
|
|
96
|
+
export declare function fetchAllXmemoryOpScopedViews(tier: XmemoryDataTier, options?: FetchAllXmemoryOpScopedViewsOptions): Promise<Record<string, unknown>[]>;
|
|
97
|
+
/**
|
|
98
|
+
* Count documents in any collection under {@link XmemoryDataTier.env.opDb}.
|
|
99
|
+
* Uses xronox {@link XronoxCollection.countMatching} when `collectionName` is the scoped-views collection.
|
|
100
|
+
*/
|
|
101
|
+
export declare function countXmemoryOpCollectionDocuments(tier: XmemoryDataTier, collectionName: string, filter?: Record<string, unknown>, includeHidden?: boolean): Promise<number>;
|
|
102
|
+
/**
|
|
103
|
+
* List documents from any collection in `tier.env.opDb` via {@link XmemoryMongoClient.findMany} (`skip` / `limit` / `projection`).
|
|
104
|
+
*/
|
|
105
|
+
export declare function listXmemoryOpCollectionDocumentsPaged(tier: XmemoryDataTier, collectionName: string, query?: ListXmemoryOpPagedQuery): Promise<Record<string, unknown>[]>;
|
|
106
|
+
export type FetchAllXmemoryOpCollectionOptions = FetchAllXmemoryOpScopedViewsOptions;
|
|
107
|
+
/**
|
|
108
|
+
* Same as {@link fetchAllXmemoryOpScopedViews} but for an arbitrary collection name in the op database.
|
|
109
|
+
*/
|
|
110
|
+
export declare function fetchAllXmemoryOpCollectionDocuments(tier: XmemoryDataTier, collectionName: string, options?: FetchAllXmemoryOpCollectionOptions): Promise<Record<string, unknown>[]>;
|
|
111
|
+
/** Resolved scoped-data collection on the op DB ({@link XmemoryDataTier.env.scopedDataCollection}). */
|
|
112
|
+
export declare function getXmemoryTierScopedDataCollectionName(tier: XmemoryDataTier): string;
|
|
113
|
+
/** Resolved Memorix snapshots collection on the op DB ({@link XmemoryDataTier.env.snapshotsCollection}). */
|
|
114
|
+
export declare function getXmemoryTierSnapshotsCollectionName(tier: XmemoryDataTier): string;
|
|
115
|
+
/**
|
|
116
|
+
* {@link countXmemoryOpCollectionDocuments} for {@link XmemoryDataTier.env.scopedDataCollection}.
|
|
117
|
+
*/
|
|
118
|
+
export declare function countXmemoryTierScopedDataDocuments(tier: XmemoryDataTier, filter?: Record<string, unknown>, includeHidden?: boolean): Promise<number>;
|
|
119
|
+
/**
|
|
120
|
+
* {@link listXmemoryOpCollectionDocumentsPaged} for {@link XmemoryDataTier.env.scopedDataCollection}.
|
|
121
|
+
*/
|
|
122
|
+
export declare function listXmemoryTierScopedDataPaged(tier: XmemoryDataTier, query?: ListXmemoryOpPagedQuery): Promise<Record<string, unknown>[]>;
|
|
123
|
+
/**
|
|
124
|
+
* {@link fetchAllXmemoryOpCollectionDocuments} for {@link XmemoryDataTier.env.scopedDataCollection}.
|
|
125
|
+
*/
|
|
126
|
+
export declare function fetchAllXmemoryTierScopedDataDocuments(tier: XmemoryDataTier, options?: FetchAllXmemoryOpCollectionOptions): Promise<Record<string, unknown>[]>;
|
|
127
|
+
/**
|
|
128
|
+
* {@link countXmemoryOpCollectionDocuments} for {@link XmemoryDataTier.env.snapshotsCollection}.
|
|
129
|
+
*/
|
|
130
|
+
export declare function countXmemoryTierSnapshotDocuments(tier: XmemoryDataTier, filter?: Record<string, unknown>, includeHidden?: boolean): Promise<number>;
|
|
131
|
+
/**
|
|
132
|
+
* {@link listXmemoryOpCollectionDocumentsPaged} for {@link XmemoryDataTier.env.snapshotsCollection}.
|
|
133
|
+
*/
|
|
134
|
+
export declare function listXmemoryTierSnapshotsPaged(tier: XmemoryDataTier, query?: ListXmemoryOpPagedQuery): Promise<Record<string, unknown>[]>;
|
|
135
|
+
/**
|
|
136
|
+
* {@link fetchAllXmemoryOpCollectionDocuments} for {@link XmemoryDataTier.env.snapshotsCollection}.
|
|
137
|
+
*/
|
|
138
|
+
export declare function fetchAllXmemoryTierSnapshotDocuments(tier: XmemoryDataTier, options?: FetchAllXmemoryOpCollectionOptions): Promise<Record<string, unknown>[]>;
|
|
139
|
+
/**
|
|
140
|
+
* Thin delegate for {@link XmemoryDataTier.runMongoAggregate} — native aggregation on **`mapsDb`**, **`thingsDb`**, or **`opDb`**.
|
|
141
|
+
*/
|
|
142
|
+
export declare function runXmemoryTierMongoAggregate(tier: XmemoryDataTier, params: {
|
|
143
|
+
database: string;
|
|
144
|
+
collection: string;
|
|
145
|
+
pipeline: Record<string, unknown>[];
|
|
146
|
+
}): Promise<unknown[]>;
|
|
147
|
+
/**
|
|
148
|
+
* Canonical Mongo filter for Memorix **scoped data** (`tier.env.scopedDataCollection`, default **`x-scoped-data`**;
|
|
149
|
+
* legacy deployments often use **`x_scoped_data`** via **`SCOPED_DATA_COLLECTION`**) keyed by entity discriminator.
|
|
150
|
+
* Matches either camelCase or snake_case field names used across pipelines.
|
|
151
|
+
*
|
|
152
|
+
* Pair with {@link countXmemoryTierScopedDataDocuments}, {@link countXmemoryOpCollectionDocuments}, {@link runXmemoryTierMongoAggregate},
|
|
153
|
+
* or your host’s direct Mongo count — keep **`database`** aligned with {@link XmemoryDataTier.env.opDb}. When the tier path fails,
|
|
154
|
+
* **surface** errors instead of silently falling back (hosts such as Graphs Studio should not swallow {@link countXmemoryOpCollectionDocuments}
|
|
155
|
+
* failures — it throws if `mongoClient.countMany` is missing for non–views collections).
|
|
156
|
+
*/
|
|
157
|
+
export declare function buildXScopedDataEntityTypeFilter(catalogId: string): Record<string, unknown>;
|
|
158
|
+
/**
|
|
159
|
+
* Mongo filter for Memorix **scoped views** (`tier.env.viewsCollection`) by entity / thing type.
|
|
160
|
+
* Aligns with default {@link getXmemoryTierStatistics} paths for **`scoped_views`** (`aboutThingType`, nested metadata).
|
|
161
|
+
*/
|
|
162
|
+
export declare function buildXScopedViewEntityTypeFilter(entityType: string): Record<string, unknown>;
|
|
163
|
+
/**
|
|
164
|
+
* Mongo filter for Memorix **x-snapshots** (`tier.env.snapshotsCollection`) by embedded snapshot entity type.
|
|
165
|
+
* Aligns with default tier statistics path `$_snapshot.entityType`; includes snake_case variant when present on docs.
|
|
166
|
+
*/
|
|
167
|
+
export declare function buildXMemorixSnapshotEntityTypeFilter(entityType: string): Record<string, unknown>;
|
|
168
|
+
/**
|
|
169
|
+
* Mongo filter for **things** matching tier statistics default buckets (`thingType` / header layout).
|
|
170
|
+
*/
|
|
171
|
+
export declare function buildXThingEntityTypeFilter(entityType: string): Record<string, unknown>;
|
|
172
|
+
//# sourceMappingURL=xmemory-op-tier.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"xmemory-op-tier.d.ts","sourceRoot":"","sources":["../../src/execution-matrix/xmemory-op-tier.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,KAAK,EAAsB,eAAe,EAAE,MAAM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