@decaf-ts/integrations 0.10.5 → 0.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +77 -5
- package/dist/integrations.cjs +1 -1
- package/dist/integrations.cjs.map +1 -1
- package/dist/integrations.js +1 -1
- package/dist/integrations.js.map +1 -1
- package/docker/dragonfly-compose.yml +19 -0
- package/lib/cjs/blob/core/BlobStoreFactory.cjs +0 -4
- package/lib/cjs/blob/core/BlobStoreFactory.cjs.map +1 -1
- package/lib/cjs/feature-flags/EngineCapabilityFeatureFlag.service.cjs +214 -0
- package/lib/cjs/feature-flags/EngineCapabilityFeatureFlag.service.cjs.map +1 -0
- package/lib/cjs/feature-flags/index.cjs +1 -0
- package/lib/cjs/feature-flags/index.cjs.map +1 -1
- package/lib/cjs/index.cjs +3 -3
- package/lib/cjs/loader/ObjectLoader.cjs +95 -11
- package/lib/cjs/loader/ObjectLoader.cjs.map +1 -1
- package/lib/cjs/loader/assets.cjs +160 -0
- package/lib/cjs/loader/assets.cjs.map +1 -0
- package/lib/cjs/loader/config.cjs +241 -0
- package/lib/cjs/loader/config.cjs.map +1 -0
- package/lib/cjs/loader/families.cjs +27 -12
- package/lib/cjs/loader/families.cjs.map +1 -1
- package/lib/cjs/loader/index.cjs +3 -0
- package/lib/cjs/loader/index.cjs.map +1 -1
- package/lib/cjs/loader/nest.cjs +331 -0
- package/lib/cjs/loader/nest.cjs.map +1 -0
- package/lib/cjs/redis/RedisContextLock.cjs +185 -0
- package/lib/cjs/redis/RedisContextLock.cjs.map +1 -0
- package/lib/cjs/redis/RedisDispatch.cjs +132 -0
- package/lib/cjs/redis/RedisDispatch.cjs.map +1 -0
- package/lib/cjs/redis/RedisPaginator.cjs +95 -0
- package/lib/cjs/redis/RedisPaginator.cjs.map +1 -0
- package/lib/cjs/redis/RedisStatement.cjs +433 -0
- package/lib/cjs/redis/RedisStatement.cjs.map +1 -0
- package/lib/cjs/redis/adapter.cjs +709 -0
- package/lib/cjs/redis/adapter.cjs.map +1 -0
- package/lib/cjs/redis/constants.cjs +31 -0
- package/lib/cjs/redis/constants.cjs.map +1 -0
- package/lib/cjs/redis/handlers.cjs +27 -0
- package/lib/cjs/redis/handlers.cjs.map +1 -0
- package/lib/cjs/redis/index.cjs +36 -0
- package/lib/cjs/redis/index.cjs.map +1 -0
- package/lib/cjs/redis/serialization.cjs +63 -0
- package/lib/cjs/redis/serialization.cjs.map +1 -0
- package/lib/cjs/redis/types.cjs.map +1 -0
- package/lib/esm/blob/core/BlobStoreFactory.js +0 -4
- package/lib/esm/blob/core/BlobStoreFactory.js.map +1 -1
- package/lib/esm/feature-flags/EngineCapabilityFeatureFlag.service.js +203 -0
- package/lib/esm/feature-flags/EngineCapabilityFeatureFlag.service.js.map +1 -0
- package/lib/esm/feature-flags/index.js +1 -0
- package/lib/esm/feature-flags/index.js.map +1 -1
- package/lib/esm/index.js +3 -3
- package/lib/esm/loader/ObjectLoader.js +94 -11
- package/lib/esm/loader/ObjectLoader.js.map +1 -1
- package/lib/esm/loader/assets.js +155 -0
- package/lib/esm/loader/assets.js.map +1 -0
- package/lib/esm/loader/config.js +202 -0
- package/lib/esm/loader/config.js.map +1 -0
- package/lib/esm/loader/families.js +25 -10
- package/lib/esm/loader/families.js.map +1 -1
- package/lib/esm/loader/index.js +3 -0
- package/lib/esm/loader/index.js.map +1 -1
- package/lib/esm/loader/nest.js +292 -0
- package/lib/esm/loader/nest.js.map +1 -0
- package/lib/esm/redis/RedisContextLock.js +180 -0
- package/lib/esm/redis/RedisContextLock.js.map +1 -0
- package/lib/esm/redis/RedisDispatch.js +127 -0
- package/lib/esm/redis/RedisDispatch.js.map +1 -0
- package/lib/esm/redis/RedisPaginator.js +90 -0
- package/lib/esm/redis/RedisPaginator.js.map +1 -0
- package/lib/esm/redis/RedisStatement.js +428 -0
- package/lib/esm/redis/RedisStatement.js.map +1 -0
- package/lib/esm/redis/adapter.js +704 -0
- package/lib/esm/redis/adapter.js.map +1 -0
- package/lib/esm/redis/constants.js +27 -0
- package/lib/esm/redis/constants.js.map +1 -0
- package/lib/esm/redis/handlers.js +23 -0
- package/lib/esm/redis/handlers.js.map +1 -0
- package/lib/esm/redis/index.js +19 -0
- package/lib/esm/redis/index.js.map +1 -0
- package/lib/esm/redis/serialization.js +57 -0
- package/lib/esm/redis/serialization.js.map +1 -0
- package/lib/esm/{graph/engine → redis}/types.js.map +1 -1
- package/lib/types/blob/core/BlobTypes.d.cts +1 -14
- package/lib/types/blob/core/BlobTypes.d.mts +1 -14
- package/lib/types/feature-flags/EngineCapabilityFeatureFlag.service.d.cts +116 -0
- package/lib/types/feature-flags/EngineCapabilityFeatureFlag.service.d.mts +116 -0
- package/lib/types/feature-flags/index.d.cts +1 -0
- package/lib/types/feature-flags/index.d.mts +1 -0
- package/lib/types/index.d.cts +2 -2
- package/lib/types/index.d.mts +2 -2
- package/lib/types/loader/ObjectLoader.d.cts +46 -2
- package/lib/types/loader/ObjectLoader.d.mts +46 -2
- package/lib/types/loader/assets.d.cts +43 -0
- package/lib/types/loader/assets.d.mts +43 -0
- package/lib/types/loader/config.d.cts +84 -0
- package/lib/types/loader/config.d.mts +84 -0
- package/lib/types/loader/families.d.cts +19 -7
- package/lib/types/loader/families.d.mts +19 -7
- package/lib/types/loader/index.d.cts +3 -0
- package/lib/types/loader/index.d.mts +3 -0
- package/lib/types/loader/nest.d.cts +102 -0
- package/lib/types/loader/nest.d.mts +102 -0
- package/lib/types/loader/types.d.cts +27 -1
- package/lib/types/loader/types.d.mts +27 -1
- package/lib/types/redis/RedisContextLock.d.cts +106 -0
- package/lib/types/redis/RedisContextLock.d.mts +106 -0
- package/lib/types/redis/RedisDispatch.d.cts +56 -0
- package/lib/types/redis/RedisDispatch.d.mts +56 -0
- package/lib/types/redis/RedisPaginator.d.cts +58 -0
- package/lib/types/redis/RedisPaginator.d.mts +58 -0
- package/lib/types/redis/RedisStatement.d.cts +175 -0
- package/lib/types/redis/RedisStatement.d.mts +175 -0
- package/lib/types/redis/adapter.d.cts +288 -0
- package/lib/types/redis/adapter.d.mts +288 -0
- package/lib/types/redis/constants.d.cts +26 -0
- package/lib/types/redis/constants.d.mts +26 -0
- package/lib/types/redis/handlers.d.cts +20 -0
- package/lib/types/redis/handlers.d.mts +20 -0
- package/lib/types/redis/index.d.cts +17 -0
- package/lib/types/redis/index.d.mts +17 -0
- package/lib/types/redis/serialization.d.cts +35 -0
- package/lib/types/redis/serialization.d.mts +35 -0
- package/lib/types/redis/types.d.cts +72 -0
- package/lib/types/redis/types.d.mts +72 -0
- package/package.json +17 -33
- package/lib/cjs/blob/ipfs/IpfsBlobEnvironment.cjs +0 -30
- package/lib/cjs/blob/ipfs/IpfsBlobEnvironment.cjs.map +0 -1
- package/lib/cjs/blob/ipfs/IpfsBlobStoreService.cjs +0 -248
- package/lib/cjs/blob/ipfs/IpfsBlobStoreService.cjs.map +0 -1
- package/lib/cjs/blob/ipfs/IpfsKeyIndex.cjs +0 -27
- package/lib/cjs/blob/ipfs/IpfsKeyIndex.cjs.map +0 -1
- package/lib/cjs/blob/ipfs/LocalJsonIpfsKeyIndex.cjs +0 -35
- package/lib/cjs/blob/ipfs/LocalJsonIpfsKeyIndex.cjs.map +0 -1
- package/lib/cjs/blob/ipfs/MemoryIpfsKeyIndex.cjs +0 -45
- package/lib/cjs/blob/ipfs/MemoryIpfsKeyIndex.cjs.map +0 -1
- package/lib/cjs/blob/ipfs/PostgresIpfsKeyIndex.cjs +0 -35
- package/lib/cjs/blob/ipfs/PostgresIpfsKeyIndex.cjs.map +0 -1
- package/lib/cjs/blob/ipfs/index.cjs +0 -29
- package/lib/cjs/blob/ipfs/index.cjs.map +0 -1
- package/lib/cjs/graph/engine/catalog/GraphBuiltInRegistrations.cjs +0 -100
- package/lib/cjs/graph/engine/catalog/GraphBuiltInRegistrations.cjs.map +0 -1
- package/lib/cjs/graph/engine/catalog/GraphCatalogueErrors.cjs +0 -29
- package/lib/cjs/graph/engine/catalog/GraphCatalogueErrors.cjs.map +0 -1
- package/lib/cjs/graph/engine/catalog/GraphNodeCatalogue.cjs +0 -270
- package/lib/cjs/graph/engine/catalog/GraphNodeCatalogue.cjs.map +0 -1
- package/lib/cjs/graph/engine/catalog/GraphNodeManifestResolver.cjs +0 -169
- package/lib/cjs/graph/engine/catalog/GraphNodeManifestResolver.cjs.map +0 -1
- package/lib/cjs/graph/engine/catalog/GraphNodeMethodRegistry.cjs +0 -64
- package/lib/cjs/graph/engine/catalog/GraphNodeMethodRegistry.cjs.map +0 -1
- package/lib/cjs/graph/engine/catalog/GraphNodeRegistration.cjs +0 -17
- package/lib/cjs/graph/engine/catalog/GraphNodeRegistration.cjs.map +0 -1
- package/lib/cjs/graph/engine/catalog/index.cjs +0 -24
- package/lib/cjs/graph/engine/catalog/index.cjs.map +0 -1
- package/lib/cjs/graph/engine/constants.cjs +0 -58
- package/lib/cjs/graph/engine/constants.cjs.map +0 -1
- package/lib/cjs/graph/engine/decorators.cjs +0 -4
- package/lib/cjs/graph/engine/decorators.cjs.map +0 -1
- package/lib/cjs/graph/engine/errors/GraphBreakSignal.cjs +0 -37
- package/lib/cjs/graph/engine/errors/GraphBreakSignal.cjs.map +0 -1
- package/lib/cjs/graph/engine/errors/GraphCycleError.cjs +0 -20
- package/lib/cjs/graph/engine/errors/GraphCycleError.cjs.map +0 -1
- package/lib/cjs/graph/engine/errors/GraphExecutionError.cjs +0 -28
- package/lib/cjs/graph/engine/errors/GraphExecutionError.cjs.map +0 -1
- package/lib/cjs/graph/engine/errors/GraphInputError.cjs +0 -20
- package/lib/cjs/graph/engine/errors/GraphInputError.cjs.map +0 -1
- package/lib/cjs/graph/engine/errors/GraphLoopLimitError.cjs +0 -20
- package/lib/cjs/graph/engine/errors/GraphLoopLimitError.cjs.map +0 -1
- package/lib/cjs/graph/engine/errors/GraphPinningError.cjs +0 -20
- package/lib/cjs/graph/engine/errors/GraphPinningError.cjs.map +0 -1
- package/lib/cjs/graph/engine/errors/GraphPortError.cjs +0 -20
- package/lib/cjs/graph/engine/errors/GraphPortError.cjs.map +0 -1
- package/lib/cjs/graph/engine/errors/GraphRunCancelledError.cjs +0 -18
- package/lib/cjs/graph/engine/errors/GraphRunCancelledError.cjs.map +0 -1
- package/lib/cjs/graph/engine/errors/GraphStoreError.cjs +0 -20
- package/lib/cjs/graph/engine/errors/GraphStoreError.cjs.map +0 -1
- package/lib/cjs/graph/engine/errors/GraphTopologyError.cjs +0 -20
- package/lib/cjs/graph/engine/errors/GraphTopologyError.cjs.map +0 -1
- package/lib/cjs/graph/engine/errors/index.cjs +0 -33
- package/lib/cjs/graph/engine/errors/index.cjs.map +0 -1
- package/lib/cjs/graph/engine/events/GraphExecutionEventEmitter.cjs +0 -40
- package/lib/cjs/graph/engine/events/GraphExecutionEventEmitter.cjs.map +0 -1
- package/lib/cjs/graph/engine/events/GraphExecutionEventFactory.cjs +0 -37
- package/lib/cjs/graph/engine/events/GraphExecutionEventFactory.cjs.map +0 -1
- package/lib/cjs/graph/engine/events/GraphExecutionObserver.cjs +0 -4
- package/lib/cjs/graph/engine/events/GraphExecutionObserver.cjs.map +0 -1
- package/lib/cjs/graph/engine/events/index.cjs +0 -26
- package/lib/cjs/graph/engine/events/index.cjs.map +0 -1
- package/lib/cjs/graph/engine/execution/BreakGraphNodeExecutor.cjs +0 -24
- package/lib/cjs/graph/engine/execution/BreakGraphNodeExecutor.cjs.map +0 -1
- package/lib/cjs/graph/engine/execution/CodeGraphNodeExecutor.cjs +0 -103
- package/lib/cjs/graph/engine/execution/CodeGraphNodeExecutor.cjs.map +0 -1
- package/lib/cjs/graph/engine/execution/CodeSandboxEvaluator.cjs +0 -4
- package/lib/cjs/graph/engine/execution/CodeSandboxEvaluator.cjs.map +0 -1
- package/lib/cjs/graph/engine/execution/GraphExecutionContext.cjs +0 -112
- package/lib/cjs/graph/engine/execution/GraphExecutionContext.cjs.map +0 -1
- package/lib/cjs/graph/engine/execution/GraphExecutionEngine.cjs +0 -789
- package/lib/cjs/graph/engine/execution/GraphExecutionEngine.cjs.map +0 -1
- package/lib/cjs/graph/engine/execution/GraphExecutionFrame.cjs +0 -32
- package/lib/cjs/graph/engine/execution/GraphExecutionFrame.cjs.map +0 -1
- package/lib/cjs/graph/engine/execution/GraphExecutionResult.cjs +0 -30
- package/lib/cjs/graph/engine/execution/GraphExecutionResult.cjs.map +0 -1
- package/lib/cjs/graph/engine/execution/GraphNodeExecutor.cjs +0 -4
- package/lib/cjs/graph/engine/execution/GraphNodeExecutor.cjs.map +0 -1
- package/lib/cjs/graph/engine/execution/IsolatedVmCodeSandboxEvaluator.cjs +0 -481
- package/lib/cjs/graph/engine/execution/IsolatedVmCodeSandboxEvaluator.cjs.map +0 -1
- package/lib/cjs/graph/engine/execution/LogGraphNodeExecutor.cjs +0 -47
- package/lib/cjs/graph/engine/execution/LogGraphNodeExecutor.cjs.map +0 -1
- package/lib/cjs/graph/engine/execution/SwitchGraphNodeExecutor.cjs +0 -121
- package/lib/cjs/graph/engine/execution/SwitchGraphNodeExecutor.cjs.map +0 -1
- package/lib/cjs/graph/engine/execution/index.cjs +0 -34
- package/lib/cjs/graph/engine/execution/index.cjs.map +0 -1
- package/lib/cjs/graph/engine/index.cjs +0 -86
- package/lib/cjs/graph/engine/index.cjs.map +0 -1
- package/lib/cjs/graph/engine/loops/ConditionExpressionEvaluator.cjs +0 -87
- package/lib/cjs/graph/engine/loops/ConditionExpressionEvaluator.cjs.map +0 -1
- package/lib/cjs/graph/engine/loops/ForeachGraphNodeExecutor.cjs +0 -146
- package/lib/cjs/graph/engine/loops/ForeachGraphNodeExecutor.cjs.map +0 -1
- package/lib/cjs/graph/engine/loops/GraphConditionEvaluator.cjs +0 -85
- package/lib/cjs/graph/engine/loops/GraphConditionEvaluator.cjs.map +0 -1
- package/lib/cjs/graph/engine/loops/GraphLoopExecutionContext.cjs +0 -16
- package/lib/cjs/graph/engine/loops/GraphLoopExecutionContext.cjs.map +0 -1
- package/lib/cjs/graph/engine/loops/UntilGraphNodeExecutor.cjs +0 -102
- package/lib/cjs/graph/engine/loops/UntilGraphNodeExecutor.cjs.map +0 -1
- package/lib/cjs/graph/engine/loops/WhileGraphNodeExecutor.cjs +0 -103
- package/lib/cjs/graph/engine/loops/WhileGraphNodeExecutor.cjs.map +0 -1
- package/lib/cjs/graph/engine/loops/index.cjs +0 -29
- package/lib/cjs/graph/engine/loops/index.cjs.map +0 -1
- package/lib/cjs/graph/engine/pinning/GraphPinningDependencyResolver.cjs +0 -28
- package/lib/cjs/graph/engine/pinning/GraphPinningDependencyResolver.cjs.map +0 -1
- package/lib/cjs/graph/engine/pinning/GraphPinningMetadata.cjs +0 -20
- package/lib/cjs/graph/engine/pinning/GraphPinningMetadata.cjs.map +0 -1
- package/lib/cjs/graph/engine/pinning/GraphPinningPolicy.cjs +0 -34
- package/lib/cjs/graph/engine/pinning/GraphPinningPolicy.cjs.map +0 -1
- package/lib/cjs/graph/engine/pinning/GraphPinningService.cjs +0 -220
- package/lib/cjs/graph/engine/pinning/GraphPinningService.cjs.map +0 -1
- package/lib/cjs/graph/engine/pinning/index.cjs +0 -27
- package/lib/cjs/graph/engine/pinning/index.cjs.map +0 -1
- package/lib/cjs/graph/engine/planning/GraphExecutionPlan.cjs +0 -4
- package/lib/cjs/graph/engine/planning/GraphExecutionPlan.cjs.map +0 -1
- package/lib/cjs/graph/engine/planning/GraphExecutionPlanEdge.cjs +0 -4
- package/lib/cjs/graph/engine/planning/GraphExecutionPlanEdge.cjs.map +0 -1
- package/lib/cjs/graph/engine/planning/GraphExecutionPlanLayer.cjs +0 -4
- package/lib/cjs/graph/engine/planning/GraphExecutionPlanLayer.cjs.map +0 -1
- package/lib/cjs/graph/engine/planning/GraphExecutionPlanNode.cjs +0 -4
- package/lib/cjs/graph/engine/planning/GraphExecutionPlanNode.cjs.map +0 -1
- package/lib/cjs/graph/engine/planning/GraphExecutionPlanner.cjs +0 -188
- package/lib/cjs/graph/engine/planning/GraphExecutionPlanner.cjs.map +0 -1
- package/lib/cjs/graph/engine/planning/GraphTopology.cjs +0 -57
- package/lib/cjs/graph/engine/planning/GraphTopology.cjs.map +0 -1
- package/lib/cjs/graph/engine/planning/index.cjs +0 -29
- package/lib/cjs/graph/engine/planning/index.cjs.map +0 -1
- package/lib/cjs/graph/engine/registry/GraphNodeExecutorRegistry.cjs +0 -57
- package/lib/cjs/graph/engine/registry/GraphNodeExecutorRegistry.cjs.map +0 -1
- package/lib/cjs/graph/engine/registry/GraphNodeExecutorResolver.cjs +0 -27
- package/lib/cjs/graph/engine/registry/GraphNodeExecutorResolver.cjs.map +0 -1
- package/lib/cjs/graph/engine/registry/index.cjs +0 -25
- package/lib/cjs/graph/engine/registry/index.cjs.map +0 -1
- package/lib/cjs/graph/engine/runs/GraphRunEventPublisher.cjs +0 -69
- package/lib/cjs/graph/engine/runs/GraphRunEventPublisher.cjs.map +0 -1
- package/lib/cjs/graph/engine/runs/GraphRunExecutor.cjs +0 -291
- package/lib/cjs/graph/engine/runs/GraphRunExecutor.cjs.map +0 -1
- package/lib/cjs/graph/engine/runs/GraphRunFingerprint.cjs +0 -29
- package/lib/cjs/graph/engine/runs/GraphRunFingerprint.cjs.map +0 -1
- package/lib/cjs/graph/engine/runs/GraphRunService.cjs +0 -259
- package/lib/cjs/graph/engine/runs/GraphRunService.cjs.map +0 -1
- package/lib/cjs/graph/engine/runs/InMemoryGraphRunEventStore.cjs +0 -69
- package/lib/cjs/graph/engine/runs/InMemoryGraphRunEventStore.cjs.map +0 -1
- package/lib/cjs/graph/engine/runs/InMemoryGraphRunStore.cjs +0 -26
- package/lib/cjs/graph/engine/runs/InMemoryGraphRunStore.cjs.map +0 -1
- package/lib/cjs/graph/engine/runs/index.cjs +0 -26
- package/lib/cjs/graph/engine/runs/index.cjs.map +0 -1
- package/lib/cjs/graph/engine/runs/ownership.cjs +0 -34
- package/lib/cjs/graph/engine/runs/ownership.cjs.map +0 -1
- package/lib/cjs/graph/engine/runs/types.cjs.map +0 -1
- package/lib/cjs/graph/engine/snapshots/GraphExecutionSnapshotMapper.cjs +0 -53
- package/lib/cjs/graph/engine/snapshots/GraphExecutionSnapshotMapper.cjs.map +0 -1
- package/lib/cjs/graph/engine/snapshots/index.cjs +0 -24
- package/lib/cjs/graph/engine/snapshots/index.cjs.map +0 -1
- package/lib/cjs/graph/engine/store/GraphCachedValue.cjs +0 -4
- package/lib/cjs/graph/engine/store/GraphCachedValue.cjs.map +0 -1
- package/lib/cjs/graph/engine/store/GraphValueKey.cjs +0 -4
- package/lib/cjs/graph/engine/store/GraphValueKey.cjs.map +0 -1
- package/lib/cjs/graph/engine/store/GraphValueStore.cjs +0 -76
- package/lib/cjs/graph/engine/store/GraphValueStore.cjs.map +0 -1
- package/lib/cjs/graph/engine/store/GraphValueStoreAdapter.cjs +0 -4
- package/lib/cjs/graph/engine/store/GraphValueStoreAdapter.cjs.map +0 -1
- package/lib/cjs/graph/engine/store/InMemoryGraphValueStoreAdapter.cjs +0 -69
- package/lib/cjs/graph/engine/store/InMemoryGraphValueStoreAdapter.cjs.map +0 -1
- package/lib/cjs/graph/engine/store/index.cjs +0 -28
- package/lib/cjs/graph/engine/store/index.cjs.map +0 -1
- package/lib/cjs/graph/engine/types.cjs +0 -4
- package/lib/cjs/graph/engine/types.cjs.map +0 -1
- package/lib/cjs/graph/engine/validation/GraphConnectionPolicyValidator.cjs +0 -142
- package/lib/cjs/graph/engine/validation/GraphConnectionPolicyValidator.cjs.map +0 -1
- package/lib/cjs/graph/engine/validation/GraphCredentialReferenceValidator.cjs +0 -160
- package/lib/cjs/graph/engine/validation/GraphCredentialReferenceValidator.cjs.map +0 -1
- package/lib/cjs/graph/engine/validation/GraphDefinitionValidator.cjs +0 -29
- package/lib/cjs/graph/engine/validation/GraphDefinitionValidator.cjs.map +0 -1
- package/lib/cjs/graph/engine/validation/GraphEdgeInstanceValidator.cjs +0 -166
- package/lib/cjs/graph/engine/validation/GraphEdgeInstanceValidator.cjs.map +0 -1
- package/lib/cjs/graph/engine/validation/GraphNodeInstanceValidator.cjs +0 -86
- package/lib/cjs/graph/engine/validation/GraphNodeInstanceValidator.cjs.map +0 -1
- package/lib/cjs/graph/engine/validation/GraphParameterValidator.cjs +0 -423
- package/lib/cjs/graph/engine/validation/GraphParameterValidator.cjs.map +0 -1
- package/lib/cjs/graph/engine/validation/GraphPortSchemaResolver.cjs +0 -58
- package/lib/cjs/graph/engine/validation/GraphPortSchemaResolver.cjs.map +0 -1
- package/lib/cjs/graph/engine/validation/GraphResolvedWorkflow.cjs +0 -4
- package/lib/cjs/graph/engine/validation/GraphResolvedWorkflow.cjs.map +0 -1
- package/lib/cjs/graph/engine/validation/GraphValidationErrors.cjs +0 -50
- package/lib/cjs/graph/engine/validation/GraphValidationErrors.cjs.map +0 -1
- package/lib/cjs/graph/engine/validation/GraphValidationIssue.cjs +0 -4
- package/lib/cjs/graph/engine/validation/GraphValidationIssue.cjs.map +0 -1
- package/lib/cjs/graph/engine/validation/GraphValueValidator.cjs +0 -52
- package/lib/cjs/graph/engine/validation/GraphValueValidator.cjs.map +0 -1
- package/lib/cjs/graph/engine/validation/GraphWorkflowDocumentValidator.cjs +0 -478
- package/lib/cjs/graph/engine/validation/GraphWorkflowDocumentValidator.cjs.map +0 -1
- package/lib/cjs/graph/engine/validation/index.cjs +0 -37
- package/lib/cjs/graph/engine/validation/index.cjs.map +0 -1
- package/lib/cjs/graph/index.cjs +0 -30
- package/lib/cjs/graph/index.cjs.map +0 -1
- package/lib/cjs/graph/log/GraphRunLogger.cjs +0 -145
- package/lib/cjs/graph/log/GraphRunLogger.cjs.map +0 -1
- package/lib/cjs/graph/log/LogParameters.cjs +0 -73
- package/lib/cjs/graph/log/LogParameters.cjs.map +0 -1
- package/lib/cjs/nest/graph/GraphExecutionController.cjs +0 -266
- package/lib/cjs/nest/graph/GraphExecutionController.cjs.map +0 -1
- package/lib/cjs/nest/graph/GraphExecutionModule.cjs +0 -178
- package/lib/cjs/nest/graph/GraphExecutionModule.cjs.map +0 -1
- package/lib/cjs/nest/graph/GraphExecutionResultModel.cjs +0 -75
- package/lib/cjs/nest/graph/GraphExecutionResultModel.cjs.map +0 -1
- package/lib/cjs/nest/graph/GraphExecutorRegistryFactory.cjs +0 -102
- package/lib/cjs/nest/graph/GraphExecutorRegistryFactory.cjs.map +0 -1
- package/lib/cjs/nest/graph/GraphNodeCatalogueController.cjs +0 -270
- package/lib/cjs/nest/graph/GraphNodeCatalogueController.cjs.map +0 -1
- package/lib/cjs/nest/graph/GraphResultService.cjs +0 -69
- package/lib/cjs/nest/graph/GraphResultService.cjs.map +0 -1
- package/lib/cjs/nest/graph/GraphRunController.cjs +0 -279
- package/lib/cjs/nest/graph/GraphRunController.cjs.map +0 -1
- package/lib/cjs/nest/graph/GraphRunModel.cjs +0 -83
- package/lib/cjs/nest/graph/GraphRunModel.cjs.map +0 -1
- package/lib/cjs/nest/graph/GraphRunModelService.cjs +0 -121
- package/lib/cjs/nest/graph/GraphRunModelService.cjs.map +0 -1
- package/lib/cjs/nest/graph/GraphWorkflowBoundaryValidation.cjs +0 -169
- package/lib/cjs/nest/graph/GraphWorkflowBoundaryValidation.cjs.map +0 -1
- package/lib/cjs/nest/graph/GraphWorkflowController.cjs +0 -162
- package/lib/cjs/nest/graph/GraphWorkflowController.cjs.map +0 -1
- package/lib/cjs/nest/graph/GraphWorkflowDocumentLimits.cjs +0 -12
- package/lib/cjs/nest/graph/GraphWorkflowDocumentLimits.cjs.map +0 -1
- package/lib/cjs/nest/graph/GraphWorkflowErrors.cjs +0 -23
- package/lib/cjs/nest/graph/GraphWorkflowErrors.cjs.map +0 -1
- package/lib/cjs/nest/graph/GraphWorkflowModel.cjs +0 -66
- package/lib/cjs/nest/graph/GraphWorkflowModel.cjs.map +0 -1
- package/lib/cjs/nest/graph/GraphWorkflowService.cjs +0 -265
- package/lib/cjs/nest/graph/GraphWorkflowService.cjs.map +0 -1
- package/lib/cjs/nest/graph/index.cjs +0 -33
- package/lib/cjs/nest/graph/index.cjs.map +0 -1
- package/lib/cjs/nest/graph/main.cjs +0 -47
- package/lib/cjs/nest/graph/main.cjs.map +0 -1
- package/lib/esm/blob/ipfs/IpfsBlobEnvironment.js +0 -26
- package/lib/esm/blob/ipfs/IpfsBlobEnvironment.js.map +0 -1
- package/lib/esm/blob/ipfs/IpfsBlobStoreService.js +0 -240
- package/lib/esm/blob/ipfs/IpfsBlobStoreService.js.map +0 -1
- package/lib/esm/blob/ipfs/IpfsKeyIndex.js +0 -23
- package/lib/esm/blob/ipfs/IpfsKeyIndex.js.map +0 -1
- package/lib/esm/blob/ipfs/LocalJsonIpfsKeyIndex.js +0 -30
- package/lib/esm/blob/ipfs/LocalJsonIpfsKeyIndex.js.map +0 -1
- package/lib/esm/blob/ipfs/MemoryIpfsKeyIndex.js +0 -40
- package/lib/esm/blob/ipfs/MemoryIpfsKeyIndex.js.map +0 -1
- package/lib/esm/blob/ipfs/PostgresIpfsKeyIndex.js +0 -30
- package/lib/esm/blob/ipfs/PostgresIpfsKeyIndex.js.map +0 -1
- package/lib/esm/blob/ipfs/index.js +0 -12
- package/lib/esm/blob/ipfs/index.js.map +0 -1
- package/lib/esm/graph/engine/catalog/GraphBuiltInRegistrations.js +0 -95
- package/lib/esm/graph/engine/catalog/GraphBuiltInRegistrations.js.map +0 -1
- package/lib/esm/graph/engine/catalog/GraphCatalogueErrors.js +0 -22
- package/lib/esm/graph/engine/catalog/GraphCatalogueErrors.js.map +0 -1
- package/lib/esm/graph/engine/catalog/GraphNodeCatalogue.js +0 -265
- package/lib/esm/graph/engine/catalog/GraphNodeCatalogue.js.map +0 -1
- package/lib/esm/graph/engine/catalog/GraphNodeManifestResolver.js +0 -162
- package/lib/esm/graph/engine/catalog/GraphNodeManifestResolver.js.map +0 -1
- package/lib/esm/graph/engine/catalog/GraphNodeMethodRegistry.js +0 -59
- package/lib/esm/graph/engine/catalog/GraphNodeMethodRegistry.js.map +0 -1
- package/lib/esm/graph/engine/catalog/GraphNodeRegistration.js +0 -12
- package/lib/esm/graph/engine/catalog/GraphNodeRegistration.js.map +0 -1
- package/lib/esm/graph/engine/catalog/index.js +0 -7
- package/lib/esm/graph/engine/catalog/index.js.map +0 -1
- package/lib/esm/graph/engine/constants.js +0 -62
- package/lib/esm/graph/engine/constants.js.map +0 -1
- package/lib/esm/graph/engine/decorators.js +0 -2
- package/lib/esm/graph/engine/decorators.js.map +0 -1
- package/lib/esm/graph/engine/errors/GraphBreakSignal.js +0 -32
- package/lib/esm/graph/engine/errors/GraphBreakSignal.js.map +0 -1
- package/lib/esm/graph/engine/errors/GraphCycleError.js +0 -15
- package/lib/esm/graph/engine/errors/GraphCycleError.js.map +0 -1
- package/lib/esm/graph/engine/errors/GraphExecutionError.js +0 -23
- package/lib/esm/graph/engine/errors/GraphExecutionError.js.map +0 -1
- package/lib/esm/graph/engine/errors/GraphInputError.js +0 -15
- package/lib/esm/graph/engine/errors/GraphInputError.js.map +0 -1
- package/lib/esm/graph/engine/errors/GraphLoopLimitError.js +0 -15
- package/lib/esm/graph/engine/errors/GraphLoopLimitError.js.map +0 -1
- package/lib/esm/graph/engine/errors/GraphPinningError.js +0 -15
- package/lib/esm/graph/engine/errors/GraphPinningError.js.map +0 -1
- package/lib/esm/graph/engine/errors/GraphPortError.js +0 -15
- package/lib/esm/graph/engine/errors/GraphPortError.js.map +0 -1
- package/lib/esm/graph/engine/errors/GraphRunCancelledError.js +0 -13
- package/lib/esm/graph/engine/errors/GraphRunCancelledError.js.map +0 -1
- package/lib/esm/graph/engine/errors/GraphStoreError.js +0 -15
- package/lib/esm/graph/engine/errors/GraphStoreError.js.map +0 -1
- package/lib/esm/graph/engine/errors/GraphTopologyError.js +0 -15
- package/lib/esm/graph/engine/errors/GraphTopologyError.js.map +0 -1
- package/lib/esm/graph/engine/errors/index.js +0 -16
- package/lib/esm/graph/engine/errors/index.js.map +0 -1
- package/lib/esm/graph/engine/events/GraphExecutionEventEmitter.js +0 -35
- package/lib/esm/graph/engine/events/GraphExecutionEventEmitter.js.map +0 -1
- package/lib/esm/graph/engine/events/GraphExecutionEventFactory.js +0 -32
- package/lib/esm/graph/engine/events/GraphExecutionEventFactory.js.map +0 -1
- package/lib/esm/graph/engine/events/GraphExecutionObserver.js +0 -2
- package/lib/esm/graph/engine/events/GraphExecutionObserver.js.map +0 -1
- package/lib/esm/graph/engine/events/index.js +0 -9
- package/lib/esm/graph/engine/events/index.js.map +0 -1
- package/lib/esm/graph/engine/execution/BreakGraphNodeExecutor.js +0 -19
- package/lib/esm/graph/engine/execution/BreakGraphNodeExecutor.js.map +0 -1
- package/lib/esm/graph/engine/execution/CodeGraphNodeExecutor.js +0 -98
- package/lib/esm/graph/engine/execution/CodeGraphNodeExecutor.js.map +0 -1
- package/lib/esm/graph/engine/execution/CodeSandboxEvaluator.js +0 -18
- package/lib/esm/graph/engine/execution/CodeSandboxEvaluator.js.map +0 -1
- package/lib/esm/graph/engine/execution/GraphExecutionContext.js +0 -107
- package/lib/esm/graph/engine/execution/GraphExecutionContext.js.map +0 -1
- package/lib/esm/graph/engine/execution/GraphExecutionEngine.js +0 -784
- package/lib/esm/graph/engine/execution/GraphExecutionEngine.js.map +0 -1
- package/lib/esm/graph/engine/execution/GraphExecutionFrame.js +0 -27
- package/lib/esm/graph/engine/execution/GraphExecutionFrame.js.map +0 -1
- package/lib/esm/graph/engine/execution/GraphExecutionResult.js +0 -26
- package/lib/esm/graph/engine/execution/GraphExecutionResult.js.map +0 -1
- package/lib/esm/graph/engine/execution/GraphNodeExecutor.js +0 -2
- package/lib/esm/graph/engine/execution/GraphNodeExecutor.js.map +0 -1
- package/lib/esm/graph/engine/execution/IsolatedVmCodeSandboxEvaluator.js +0 -440
- package/lib/esm/graph/engine/execution/IsolatedVmCodeSandboxEvaluator.js.map +0 -1
- package/lib/esm/graph/engine/execution/LogGraphNodeExecutor.js +0 -42
- package/lib/esm/graph/engine/execution/LogGraphNodeExecutor.js.map +0 -1
- package/lib/esm/graph/engine/execution/SwitchGraphNodeExecutor.js +0 -116
- package/lib/esm/graph/engine/execution/SwitchGraphNodeExecutor.js.map +0 -1
- package/lib/esm/graph/engine/execution/index.js +0 -17
- package/lib/esm/graph/engine/execution/index.js.map +0 -1
- package/lib/esm/graph/engine/index.js +0 -69
- package/lib/esm/graph/engine/index.js.map +0 -1
- package/lib/esm/graph/engine/loops/ConditionExpressionEvaluator.js +0 -82
- package/lib/esm/graph/engine/loops/ConditionExpressionEvaluator.js.map +0 -1
- package/lib/esm/graph/engine/loops/ForeachGraphNodeExecutor.js +0 -141
- package/lib/esm/graph/engine/loops/ForeachGraphNodeExecutor.js.map +0 -1
- package/lib/esm/graph/engine/loops/GraphConditionEvaluator.js +0 -80
- package/lib/esm/graph/engine/loops/GraphConditionEvaluator.js.map +0 -1
- package/lib/esm/graph/engine/loops/GraphLoopExecutionContext.js +0 -11
- package/lib/esm/graph/engine/loops/GraphLoopExecutionContext.js.map +0 -1
- package/lib/esm/graph/engine/loops/UntilGraphNodeExecutor.js +0 -97
- package/lib/esm/graph/engine/loops/UntilGraphNodeExecutor.js.map +0 -1
- package/lib/esm/graph/engine/loops/WhileGraphNodeExecutor.js +0 -98
- package/lib/esm/graph/engine/loops/WhileGraphNodeExecutor.js.map +0 -1
- package/lib/esm/graph/engine/loops/index.js +0 -12
- package/lib/esm/graph/engine/loops/index.js.map +0 -1
- package/lib/esm/graph/engine/pinning/GraphPinningDependencyResolver.js +0 -23
- package/lib/esm/graph/engine/pinning/GraphPinningDependencyResolver.js.map +0 -1
- package/lib/esm/graph/engine/pinning/GraphPinningMetadata.js +0 -15
- package/lib/esm/graph/engine/pinning/GraphPinningMetadata.js.map +0 -1
- package/lib/esm/graph/engine/pinning/GraphPinningPolicy.js +0 -29
- package/lib/esm/graph/engine/pinning/GraphPinningPolicy.js.map +0 -1
- package/lib/esm/graph/engine/pinning/GraphPinningService.js +0 -215
- package/lib/esm/graph/engine/pinning/GraphPinningService.js.map +0 -1
- package/lib/esm/graph/engine/pinning/index.js +0 -10
- package/lib/esm/graph/engine/pinning/index.js.map +0 -1
- package/lib/esm/graph/engine/planning/GraphExecutionPlan.js +0 -2
- package/lib/esm/graph/engine/planning/GraphExecutionPlan.js.map +0 -1
- package/lib/esm/graph/engine/planning/GraphExecutionPlanEdge.js +0 -9
- package/lib/esm/graph/engine/planning/GraphExecutionPlanEdge.js.map +0 -1
- package/lib/esm/graph/engine/planning/GraphExecutionPlanLayer.js +0 -2
- package/lib/esm/graph/engine/planning/GraphExecutionPlanLayer.js.map +0 -1
- package/lib/esm/graph/engine/planning/GraphExecutionPlanNode.js +0 -2
- package/lib/esm/graph/engine/planning/GraphExecutionPlanNode.js.map +0 -1
- package/lib/esm/graph/engine/planning/GraphExecutionPlanner.js +0 -183
- package/lib/esm/graph/engine/planning/GraphExecutionPlanner.js.map +0 -1
- package/lib/esm/graph/engine/planning/GraphTopology.js +0 -52
- package/lib/esm/graph/engine/planning/GraphTopology.js.map +0 -1
- package/lib/esm/graph/engine/planning/index.js +0 -12
- package/lib/esm/graph/engine/planning/index.js.map +0 -1
- package/lib/esm/graph/engine/registry/GraphNodeExecutorRegistry.js +0 -52
- package/lib/esm/graph/engine/registry/GraphNodeExecutorRegistry.js.map +0 -1
- package/lib/esm/graph/engine/registry/GraphNodeExecutorResolver.js +0 -22
- package/lib/esm/graph/engine/registry/GraphNodeExecutorResolver.js.map +0 -1
- package/lib/esm/graph/engine/registry/index.js +0 -8
- package/lib/esm/graph/engine/registry/index.js.map +0 -1
- package/lib/esm/graph/engine/runs/GraphRunEventPublisher.js +0 -64
- package/lib/esm/graph/engine/runs/GraphRunEventPublisher.js.map +0 -1
- package/lib/esm/graph/engine/runs/GraphRunExecutor.js +0 -286
- package/lib/esm/graph/engine/runs/GraphRunExecutor.js.map +0 -1
- package/lib/esm/graph/engine/runs/GraphRunFingerprint.js +0 -25
- package/lib/esm/graph/engine/runs/GraphRunFingerprint.js.map +0 -1
- package/lib/esm/graph/engine/runs/GraphRunService.js +0 -254
- package/lib/esm/graph/engine/runs/GraphRunService.js.map +0 -1
- package/lib/esm/graph/engine/runs/InMemoryGraphRunEventStore.js +0 -64
- package/lib/esm/graph/engine/runs/InMemoryGraphRunEventStore.js.map +0 -1
- package/lib/esm/graph/engine/runs/InMemoryGraphRunStore.js +0 -21
- package/lib/esm/graph/engine/runs/InMemoryGraphRunStore.js.map +0 -1
- package/lib/esm/graph/engine/runs/index.js +0 -9
- package/lib/esm/graph/engine/runs/index.js.map +0 -1
- package/lib/esm/graph/engine/runs/ownership.js +0 -30
- package/lib/esm/graph/engine/runs/ownership.js.map +0 -1
- package/lib/esm/graph/engine/runs/types.js.map +0 -1
- package/lib/esm/graph/engine/snapshots/GraphExecutionSnapshotMapper.js +0 -48
- package/lib/esm/graph/engine/snapshots/GraphExecutionSnapshotMapper.js.map +0 -1
- package/lib/esm/graph/engine/snapshots/index.js +0 -7
- package/lib/esm/graph/engine/snapshots/index.js.map +0 -1
- package/lib/esm/graph/engine/store/GraphCachedValue.js +0 -2
- package/lib/esm/graph/engine/store/GraphCachedValue.js.map +0 -1
- package/lib/esm/graph/engine/store/GraphValueKey.js +0 -7
- package/lib/esm/graph/engine/store/GraphValueKey.js.map +0 -1
- package/lib/esm/graph/engine/store/GraphValueStore.js +0 -71
- package/lib/esm/graph/engine/store/GraphValueStore.js.map +0 -1
- package/lib/esm/graph/engine/store/GraphValueStoreAdapter.js +0 -2
- package/lib/esm/graph/engine/store/GraphValueStoreAdapter.js.map +0 -1
- package/lib/esm/graph/engine/store/InMemoryGraphValueStoreAdapter.js +0 -64
- package/lib/esm/graph/engine/store/InMemoryGraphValueStoreAdapter.js.map +0 -1
- package/lib/esm/graph/engine/store/index.js +0 -11
- package/lib/esm/graph/engine/store/index.js.map +0 -1
- package/lib/esm/graph/engine/types.js +0 -2
- package/lib/esm/graph/engine/validation/GraphConnectionPolicyValidator.js +0 -137
- package/lib/esm/graph/engine/validation/GraphConnectionPolicyValidator.js.map +0 -1
- package/lib/esm/graph/engine/validation/GraphCredentialReferenceValidator.js +0 -155
- package/lib/esm/graph/engine/validation/GraphCredentialReferenceValidator.js.map +0 -1
- package/lib/esm/graph/engine/validation/GraphDefinitionValidator.js +0 -24
- package/lib/esm/graph/engine/validation/GraphDefinitionValidator.js.map +0 -1
- package/lib/esm/graph/engine/validation/GraphEdgeInstanceValidator.js +0 -161
- package/lib/esm/graph/engine/validation/GraphEdgeInstanceValidator.js.map +0 -1
- package/lib/esm/graph/engine/validation/GraphNodeInstanceValidator.js +0 -81
- package/lib/esm/graph/engine/validation/GraphNodeInstanceValidator.js.map +0 -1
- package/lib/esm/graph/engine/validation/GraphParameterValidator.js +0 -416
- package/lib/esm/graph/engine/validation/GraphParameterValidator.js.map +0 -1
- package/lib/esm/graph/engine/validation/GraphPortSchemaResolver.js +0 -53
- package/lib/esm/graph/engine/validation/GraphPortSchemaResolver.js.map +0 -1
- package/lib/esm/graph/engine/validation/GraphResolvedWorkflow.js +0 -2
- package/lib/esm/graph/engine/validation/GraphResolvedWorkflow.js.map +0 -1
- package/lib/esm/graph/engine/validation/GraphValidationErrors.js +0 -43
- package/lib/esm/graph/engine/validation/GraphValidationErrors.js.map +0 -1
- package/lib/esm/graph/engine/validation/GraphValidationIssue.js +0 -2
- package/lib/esm/graph/engine/validation/GraphValidationIssue.js.map +0 -1
- package/lib/esm/graph/engine/validation/GraphValueValidator.js +0 -47
- package/lib/esm/graph/engine/validation/GraphValueValidator.js.map +0 -1
- package/lib/esm/graph/engine/validation/GraphWorkflowDocumentValidator.js +0 -472
- package/lib/esm/graph/engine/validation/GraphWorkflowDocumentValidator.js.map +0 -1
- package/lib/esm/graph/engine/validation/index.js +0 -20
- package/lib/esm/graph/engine/validation/index.js.map +0 -1
- package/lib/esm/graph/index.js +0 -13
- package/lib/esm/graph/index.js.map +0 -1
- package/lib/esm/graph/log/GraphRunLogger.js +0 -140
- package/lib/esm/graph/log/GraphRunLogger.js.map +0 -1
- package/lib/esm/graph/log/LogParameters.js +0 -69
- package/lib/esm/graph/log/LogParameters.js.map +0 -1
- package/lib/esm/nest/graph/GraphExecutionController.js +0 -257
- package/lib/esm/nest/graph/GraphExecutionController.js.map +0 -1
- package/lib/esm/nest/graph/GraphExecutionModule.js +0 -137
- package/lib/esm/nest/graph/GraphExecutionModule.js.map +0 -1
- package/lib/esm/nest/graph/GraphExecutionResultModel.js +0 -66
- package/lib/esm/nest/graph/GraphExecutionResultModel.js.map +0 -1
- package/lib/esm/nest/graph/GraphExecutorRegistryFactory.js +0 -95
- package/lib/esm/nest/graph/GraphExecutorRegistryFactory.js.map +0 -1
- package/lib/esm/nest/graph/GraphNodeCatalogueController.js +0 -261
- package/lib/esm/nest/graph/GraphNodeCatalogueController.js.map +0 -1
- package/lib/esm/nest/graph/GraphResultService.js +0 -60
- package/lib/esm/nest/graph/GraphResultService.js.map +0 -1
- package/lib/esm/nest/graph/GraphRunController.js +0 -270
- package/lib/esm/nest/graph/GraphRunController.js.map +0 -1
- package/lib/esm/nest/graph/GraphRunModel.js +0 -74
- package/lib/esm/nest/graph/GraphRunModel.js.map +0 -1
- package/lib/esm/nest/graph/GraphRunModelService.js +0 -112
- package/lib/esm/nest/graph/GraphRunModelService.js.map +0 -1
- package/lib/esm/nest/graph/GraphWorkflowBoundaryValidation.js +0 -164
- package/lib/esm/nest/graph/GraphWorkflowBoundaryValidation.js.map +0 -1
- package/lib/esm/nest/graph/GraphWorkflowController.js +0 -153
- package/lib/esm/nest/graph/GraphWorkflowController.js.map +0 -1
- package/lib/esm/nest/graph/GraphWorkflowDocumentLimits.js +0 -8
- package/lib/esm/nest/graph/GraphWorkflowDocumentLimits.js.map +0 -1
- package/lib/esm/nest/graph/GraphWorkflowErrors.js +0 -18
- package/lib/esm/nest/graph/GraphWorkflowErrors.js.map +0 -1
- package/lib/esm/nest/graph/GraphWorkflowModel.js +0 -57
- package/lib/esm/nest/graph/GraphWorkflowModel.js.map +0 -1
- package/lib/esm/nest/graph/GraphWorkflowService.js +0 -255
- package/lib/esm/nest/graph/GraphWorkflowService.js.map +0 -1
- package/lib/esm/nest/graph/index.js +0 -16
- package/lib/esm/nest/graph/index.js.map +0 -1
- package/lib/esm/nest/graph/main.js +0 -44
- package/lib/esm/nest/graph/main.js.map +0 -1
- package/lib/types/blob/ipfs/IpfsBlobEnvironment.d.cts +0 -24
- package/lib/types/blob/ipfs/IpfsBlobEnvironment.d.mts +0 -24
- package/lib/types/blob/ipfs/IpfsBlobStoreService.d.cts +0 -61
- package/lib/types/blob/ipfs/IpfsBlobStoreService.d.mts +0 -61
- package/lib/types/blob/ipfs/IpfsKeyIndex.d.cts +0 -9
- package/lib/types/blob/ipfs/IpfsKeyIndex.d.mts +0 -9
- package/lib/types/blob/ipfs/LocalJsonIpfsKeyIndex.d.cts +0 -11
- package/lib/types/blob/ipfs/LocalJsonIpfsKeyIndex.d.mts +0 -11
- package/lib/types/blob/ipfs/MemoryIpfsKeyIndex.d.cts +0 -15
- package/lib/types/blob/ipfs/MemoryIpfsKeyIndex.d.mts +0 -15
- package/lib/types/blob/ipfs/PostgresIpfsKeyIndex.d.cts +0 -11
- package/lib/types/blob/ipfs/PostgresIpfsKeyIndex.d.mts +0 -11
- package/lib/types/blob/ipfs/index.d.cts +0 -11
- package/lib/types/blob/ipfs/index.d.mts +0 -11
- package/lib/types/graph/engine/catalog/GraphBuiltInRegistrations.d.cts +0 -17
- package/lib/types/graph/engine/catalog/GraphBuiltInRegistrations.d.mts +0 -17
- package/lib/types/graph/engine/catalog/GraphCatalogueErrors.d.cts +0 -13
- package/lib/types/graph/engine/catalog/GraphCatalogueErrors.d.mts +0 -13
- package/lib/types/graph/engine/catalog/GraphNodeCatalogue.d.cts +0 -71
- package/lib/types/graph/engine/catalog/GraphNodeCatalogue.d.mts +0 -71
- package/lib/types/graph/engine/catalog/GraphNodeManifestResolver.d.cts +0 -42
- package/lib/types/graph/engine/catalog/GraphNodeManifestResolver.d.mts +0 -42
- package/lib/types/graph/engine/catalog/GraphNodeMethodRegistry.d.cts +0 -22
- package/lib/types/graph/engine/catalog/GraphNodeMethodRegistry.d.mts +0 -22
- package/lib/types/graph/engine/catalog/GraphNodeRegistration.d.cts +0 -68
- package/lib/types/graph/engine/catalog/GraphNodeRegistration.d.mts +0 -68
- package/lib/types/graph/engine/catalog/index.d.cts +0 -6
- package/lib/types/graph/engine/catalog/index.d.mts +0 -6
- package/lib/types/graph/engine/constants.d.cts +0 -59
- package/lib/types/graph/engine/constants.d.mts +0 -59
- package/lib/types/graph/engine/decorators.d.cts +0 -6
- package/lib/types/graph/engine/decorators.d.mts +0 -6
- package/lib/types/graph/engine/errors/GraphBreakSignal.d.cts +0 -28
- package/lib/types/graph/engine/errors/GraphBreakSignal.d.mts +0 -28
- package/lib/types/graph/engine/errors/GraphCycleError.d.cts +0 -12
- package/lib/types/graph/engine/errors/GraphCycleError.d.mts +0 -12
- package/lib/types/graph/engine/errors/GraphExecutionError.d.cts +0 -19
- package/lib/types/graph/engine/errors/GraphExecutionError.d.mts +0 -19
- package/lib/types/graph/engine/errors/GraphInputError.d.cts +0 -12
- package/lib/types/graph/engine/errors/GraphInputError.d.mts +0 -12
- package/lib/types/graph/engine/errors/GraphLoopLimitError.d.cts +0 -12
- package/lib/types/graph/engine/errors/GraphLoopLimitError.d.mts +0 -12
- package/lib/types/graph/engine/errors/GraphPinningError.d.cts +0 -12
- package/lib/types/graph/engine/errors/GraphPinningError.d.mts +0 -12
- package/lib/types/graph/engine/errors/GraphPortError.d.cts +0 -12
- package/lib/types/graph/engine/errors/GraphPortError.d.mts +0 -12
- package/lib/types/graph/engine/errors/GraphRunCancelledError.d.cts +0 -9
- package/lib/types/graph/engine/errors/GraphRunCancelledError.d.mts +0 -9
- package/lib/types/graph/engine/errors/GraphStoreError.d.cts +0 -12
- package/lib/types/graph/engine/errors/GraphStoreError.d.mts +0 -12
- package/lib/types/graph/engine/errors/GraphTopologyError.d.cts +0 -12
- package/lib/types/graph/engine/errors/GraphTopologyError.d.mts +0 -12
- package/lib/types/graph/engine/errors/index.d.cts +0 -15
- package/lib/types/graph/engine/errors/index.d.mts +0 -15
- package/lib/types/graph/engine/events/GraphExecutionEventEmitter.d.cts +0 -26
- package/lib/types/graph/engine/events/GraphExecutionEventEmitter.d.mts +0 -26
- package/lib/types/graph/engine/events/GraphExecutionEventFactory.d.cts +0 -25
- package/lib/types/graph/engine/events/GraphExecutionEventFactory.d.mts +0 -25
- package/lib/types/graph/engine/events/GraphExecutionObserver.d.cts +0 -17
- package/lib/types/graph/engine/events/GraphExecutionObserver.d.mts +0 -17
- package/lib/types/graph/engine/events/index.d.cts +0 -8
- package/lib/types/graph/engine/events/index.d.mts +0 -8
- package/lib/types/graph/engine/execution/BreakGraphNodeExecutor.d.cts +0 -22
- package/lib/types/graph/engine/execution/BreakGraphNodeExecutor.d.mts +0 -22
- package/lib/types/graph/engine/execution/CodeGraphNodeExecutor.d.cts +0 -65
- package/lib/types/graph/engine/execution/CodeGraphNodeExecutor.d.mts +0 -65
- package/lib/types/graph/engine/execution/CodeSandboxEvaluator.d.cts +0 -76
- package/lib/types/graph/engine/execution/CodeSandboxEvaluator.d.mts +0 -76
- package/lib/types/graph/engine/execution/GraphExecutionContext.d.cts +0 -74
- package/lib/types/graph/engine/execution/GraphExecutionContext.d.mts +0 -74
- package/lib/types/graph/engine/execution/GraphExecutionEngine.d.cts +0 -251
- package/lib/types/graph/engine/execution/GraphExecutionEngine.d.mts +0 -251
- package/lib/types/graph/engine/execution/GraphExecutionFrame.d.cts +0 -30
- package/lib/types/graph/engine/execution/GraphExecutionFrame.d.mts +0 -30
- package/lib/types/graph/engine/execution/GraphExecutionResult.d.cts +0 -13
- package/lib/types/graph/engine/execution/GraphExecutionResult.d.mts +0 -13
- package/lib/types/graph/engine/execution/GraphNodeExecutor.d.cts +0 -31
- package/lib/types/graph/engine/execution/GraphNodeExecutor.d.mts +0 -31
- package/lib/types/graph/engine/execution/IsolatedVmCodeSandboxEvaluator.d.cts +0 -63
- package/lib/types/graph/engine/execution/IsolatedVmCodeSandboxEvaluator.d.mts +0 -63
- package/lib/types/graph/engine/execution/LogGraphNodeExecutor.d.cts +0 -25
- package/lib/types/graph/engine/execution/LogGraphNodeExecutor.d.mts +0 -25
- package/lib/types/graph/engine/execution/SwitchGraphNodeExecutor.d.cts +0 -43
- package/lib/types/graph/engine/execution/SwitchGraphNodeExecutor.d.mts +0 -43
- package/lib/types/graph/engine/execution/index.d.cts +0 -16
- package/lib/types/graph/engine/execution/index.d.mts +0 -16
- package/lib/types/graph/engine/index.d.cts +0 -63
- package/lib/types/graph/engine/index.d.mts +0 -63
- package/lib/types/graph/engine/loops/ConditionExpressionEvaluator.d.cts +0 -36
- package/lib/types/graph/engine/loops/ConditionExpressionEvaluator.d.mts +0 -36
- package/lib/types/graph/engine/loops/ForeachGraphNodeExecutor.d.cts +0 -35
- package/lib/types/graph/engine/loops/ForeachGraphNodeExecutor.d.mts +0 -35
- package/lib/types/graph/engine/loops/GraphConditionEvaluator.d.cts +0 -40
- package/lib/types/graph/engine/loops/GraphConditionEvaluator.d.mts +0 -40
- package/lib/types/graph/engine/loops/GraphLoopExecutionContext.d.cts +0 -15
- package/lib/types/graph/engine/loops/GraphLoopExecutionContext.d.mts +0 -15
- package/lib/types/graph/engine/loops/UntilGraphNodeExecutor.d.cts +0 -22
- package/lib/types/graph/engine/loops/UntilGraphNodeExecutor.d.mts +0 -22
- package/lib/types/graph/engine/loops/WhileGraphNodeExecutor.d.cts +0 -26
- package/lib/types/graph/engine/loops/WhileGraphNodeExecutor.d.mts +0 -26
- package/lib/types/graph/engine/loops/index.d.cts +0 -11
- package/lib/types/graph/engine/loops/index.d.mts +0 -11
- package/lib/types/graph/engine/pinning/GraphPinningDependencyResolver.d.cts +0 -21
- package/lib/types/graph/engine/pinning/GraphPinningDependencyResolver.d.mts +0 -21
- package/lib/types/graph/engine/pinning/GraphPinningMetadata.d.cts +0 -14
- package/lib/types/graph/engine/pinning/GraphPinningMetadata.d.mts +0 -14
- package/lib/types/graph/engine/pinning/GraphPinningPolicy.d.cts +0 -20
- package/lib/types/graph/engine/pinning/GraphPinningPolicy.d.mts +0 -20
- package/lib/types/graph/engine/pinning/GraphPinningService.d.cts +0 -70
- package/lib/types/graph/engine/pinning/GraphPinningService.d.mts +0 -70
- package/lib/types/graph/engine/pinning/index.d.cts +0 -9
- package/lib/types/graph/engine/pinning/index.d.mts +0 -9
- package/lib/types/graph/engine/planning/GraphExecutionPlan.d.cts +0 -25
- package/lib/types/graph/engine/planning/GraphExecutionPlan.d.mts +0 -25
- package/lib/types/graph/engine/planning/GraphExecutionPlanEdge.d.cts +0 -26
- package/lib/types/graph/engine/planning/GraphExecutionPlanEdge.d.mts +0 -26
- package/lib/types/graph/engine/planning/GraphExecutionPlanLayer.d.cts +0 -13
- package/lib/types/graph/engine/planning/GraphExecutionPlanLayer.d.mts +0 -13
- package/lib/types/graph/engine/planning/GraphExecutionPlanNode.d.cts +0 -28
- package/lib/types/graph/engine/planning/GraphExecutionPlanNode.d.mts +0 -28
- package/lib/types/graph/engine/planning/GraphExecutionPlanner.d.cts +0 -48
- package/lib/types/graph/engine/planning/GraphExecutionPlanner.d.mts +0 -48
- package/lib/types/graph/engine/planning/GraphTopology.d.cts +0 -23
- package/lib/types/graph/engine/planning/GraphTopology.d.mts +0 -23
- package/lib/types/graph/engine/planning/index.d.cts +0 -11
- package/lib/types/graph/engine/planning/index.d.mts +0 -11
- package/lib/types/graph/engine/registry/GraphNodeExecutorRegistry.d.cts +0 -39
- package/lib/types/graph/engine/registry/GraphNodeExecutorRegistry.d.mts +0 -39
- package/lib/types/graph/engine/registry/GraphNodeExecutorResolver.d.cts +0 -21
- package/lib/types/graph/engine/registry/GraphNodeExecutorResolver.d.mts +0 -21
- package/lib/types/graph/engine/registry/index.d.cts +0 -7
- package/lib/types/graph/engine/registry/index.d.mts +0 -7
- package/lib/types/graph/engine/runs/GraphRunEventPublisher.d.cts +0 -26
- package/lib/types/graph/engine/runs/GraphRunEventPublisher.d.mts +0 -26
- package/lib/types/graph/engine/runs/GraphRunExecutor.d.cts +0 -75
- package/lib/types/graph/engine/runs/GraphRunExecutor.d.mts +0 -75
- package/lib/types/graph/engine/runs/GraphRunFingerprint.d.cts +0 -8
- package/lib/types/graph/engine/runs/GraphRunFingerprint.d.mts +0 -8
- package/lib/types/graph/engine/runs/GraphRunService.d.cts +0 -93
- package/lib/types/graph/engine/runs/GraphRunService.d.mts +0 -93
- package/lib/types/graph/engine/runs/InMemoryGraphRunEventStore.d.cts +0 -28
- package/lib/types/graph/engine/runs/InMemoryGraphRunEventStore.d.mts +0 -28
- package/lib/types/graph/engine/runs/InMemoryGraphRunStore.d.cts +0 -12
- package/lib/types/graph/engine/runs/InMemoryGraphRunStore.d.mts +0 -12
- package/lib/types/graph/engine/runs/index.d.cts +0 -8
- package/lib/types/graph/engine/runs/index.d.mts +0 -8
- package/lib/types/graph/engine/runs/ownership.d.cts +0 -25
- package/lib/types/graph/engine/runs/ownership.d.mts +0 -25
- package/lib/types/graph/engine/runs/types.d.cts +0 -83
- package/lib/types/graph/engine/runs/types.d.mts +0 -83
- package/lib/types/graph/engine/snapshots/GraphExecutionSnapshotMapper.d.cts +0 -10
- package/lib/types/graph/engine/snapshots/GraphExecutionSnapshotMapper.d.mts +0 -10
- package/lib/types/graph/engine/snapshots/index.d.cts +0 -6
- package/lib/types/graph/engine/snapshots/index.d.mts +0 -6
- package/lib/types/graph/engine/store/GraphCachedValue.d.cts +0 -20
- package/lib/types/graph/engine/store/GraphCachedValue.d.mts +0 -20
- package/lib/types/graph/engine/store/GraphValueKey.d.cts +0 -18
- package/lib/types/graph/engine/store/GraphValueKey.d.mts +0 -18
- package/lib/types/graph/engine/store/GraphValueStore.d.cts +0 -41
- package/lib/types/graph/engine/store/GraphValueStore.d.mts +0 -41
- package/lib/types/graph/engine/store/GraphValueStoreAdapter.d.cts +0 -32
- package/lib/types/graph/engine/store/GraphValueStoreAdapter.d.mts +0 -32
- package/lib/types/graph/engine/store/InMemoryGraphValueStoreAdapter.d.cts +0 -33
- package/lib/types/graph/engine/store/InMemoryGraphValueStoreAdapter.d.mts +0 -33
- package/lib/types/graph/engine/store/index.d.cts +0 -10
- package/lib/types/graph/engine/store/index.d.mts +0 -10
- package/lib/types/graph/engine/types.d.cts +0 -208
- package/lib/types/graph/engine/types.d.mts +0 -208
- package/lib/types/graph/engine/validation/GraphConnectionPolicyValidator.d.cts +0 -32
- package/lib/types/graph/engine/validation/GraphConnectionPolicyValidator.d.mts +0 -32
- package/lib/types/graph/engine/validation/GraphCredentialReferenceValidator.d.cts +0 -62
- package/lib/types/graph/engine/validation/GraphCredentialReferenceValidator.d.mts +0 -62
- package/lib/types/graph/engine/validation/GraphDefinitionValidator.d.cts +0 -23
- package/lib/types/graph/engine/validation/GraphDefinitionValidator.d.mts +0 -23
- package/lib/types/graph/engine/validation/GraphEdgeInstanceValidator.d.cts +0 -32
- package/lib/types/graph/engine/validation/GraphEdgeInstanceValidator.d.mts +0 -32
- package/lib/types/graph/engine/validation/GraphNodeInstanceValidator.d.cts +0 -37
- package/lib/types/graph/engine/validation/GraphNodeInstanceValidator.d.mts +0 -37
- package/lib/types/graph/engine/validation/GraphParameterValidator.d.cts +0 -92
- package/lib/types/graph/engine/validation/GraphParameterValidator.d.mts +0 -92
- package/lib/types/graph/engine/validation/GraphPortSchemaResolver.d.cts +0 -39
- package/lib/types/graph/engine/validation/GraphPortSchemaResolver.d.mts +0 -39
- package/lib/types/graph/engine/validation/GraphResolvedWorkflow.d.cts +0 -66
- package/lib/types/graph/engine/validation/GraphResolvedWorkflow.d.mts +0 -66
- package/lib/types/graph/engine/validation/GraphValidationErrors.d.cts +0 -34
- package/lib/types/graph/engine/validation/GraphValidationErrors.d.mts +0 -34
- package/lib/types/graph/engine/validation/GraphValidationIssue.d.cts +0 -39
- package/lib/types/graph/engine/validation/GraphValidationIssue.d.mts +0 -39
- package/lib/types/graph/engine/validation/GraphValueValidator.d.cts +0 -27
- package/lib/types/graph/engine/validation/GraphValueValidator.d.mts +0 -27
- package/lib/types/graph/engine/validation/GraphWorkflowDocumentValidator.d.cts +0 -162
- package/lib/types/graph/engine/validation/GraphWorkflowDocumentValidator.d.mts +0 -162
- package/lib/types/graph/engine/validation/index.d.cts +0 -19
- package/lib/types/graph/engine/validation/index.d.mts +0 -19
- package/lib/types/graph/index.d.cts +0 -12
- package/lib/types/graph/index.d.mts +0 -12
- package/lib/types/graph/log/GraphRunLogger.d.cts +0 -76
- package/lib/types/graph/log/GraphRunLogger.d.mts +0 -76
- package/lib/types/graph/log/LogParameters.d.cts +0 -7
- package/lib/types/graph/log/LogParameters.d.mts +0 -7
- package/lib/types/nest/graph/GraphExecutionController.d.cts +0 -110
- package/lib/types/nest/graph/GraphExecutionController.d.mts +0 -110
- package/lib/types/nest/graph/GraphExecutionModule.d.cts +0 -83
- package/lib/types/nest/graph/GraphExecutionModule.d.mts +0 -83
- package/lib/types/nest/graph/GraphExecutionResultModel.d.cts +0 -24
- package/lib/types/nest/graph/GraphExecutionResultModel.d.mts +0 -24
- package/lib/types/nest/graph/GraphExecutorRegistryFactory.d.cts +0 -66
- package/lib/types/nest/graph/GraphExecutorRegistryFactory.d.mts +0 -66
- package/lib/types/nest/graph/GraphNodeCatalogueController.d.cts +0 -70
- package/lib/types/nest/graph/GraphNodeCatalogueController.d.mts +0 -70
- package/lib/types/nest/graph/GraphResultService.d.cts +0 -20
- package/lib/types/nest/graph/GraphResultService.d.mts +0 -20
- package/lib/types/nest/graph/GraphRunController.d.cts +0 -87
- package/lib/types/nest/graph/GraphRunController.d.mts +0 -87
- package/lib/types/nest/graph/GraphRunModel.d.cts +0 -22
- package/lib/types/nest/graph/GraphRunModel.d.mts +0 -22
- package/lib/types/nest/graph/GraphRunModelService.d.cts +0 -21
- package/lib/types/nest/graph/GraphRunModelService.d.mts +0 -21
- package/lib/types/nest/graph/GraphWorkflowBoundaryValidation.d.cts +0 -28
- package/lib/types/nest/graph/GraphWorkflowBoundaryValidation.d.mts +0 -28
- package/lib/types/nest/graph/GraphWorkflowController.d.cts +0 -62
- package/lib/types/nest/graph/GraphWorkflowController.d.mts +0 -62
- package/lib/types/nest/graph/GraphWorkflowDocumentLimits.d.cts +0 -33
- package/lib/types/nest/graph/GraphWorkflowDocumentLimits.d.mts +0 -33
- package/lib/types/nest/graph/GraphWorkflowErrors.d.cts +0 -13
- package/lib/types/nest/graph/GraphWorkflowErrors.d.mts +0 -13
- package/lib/types/nest/graph/GraphWorkflowModel.d.cts +0 -24
- package/lib/types/nest/graph/GraphWorkflowModel.d.mts +0 -24
- package/lib/types/nest/graph/GraphWorkflowService.d.cts +0 -54
- package/lib/types/nest/graph/GraphWorkflowService.d.mts +0 -54
- package/lib/types/nest/graph/index.d.cts +0 -15
- package/lib/types/nest/graph/index.d.mts +0 -15
- package/lib/types/nest/graph/main.d.cts +0 -1
- package/lib/types/nest/graph/main.d.mts +0 -1
- /package/lib/cjs/{graph/engine/runs → redis}/types.cjs +0 -0
- /package/lib/esm/{graph/engine/runs → redis}/types.js +0 -0
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.RedisDispatch = void 0;
|
|
4
|
+
const core_1 = require("@decaf-ts/core");
|
|
5
|
+
const db_decorators_1 = require("@decaf-ts/db-decorators");
|
|
6
|
+
const decorator_validation_1 = require("@decaf-ts/decorator-validation");
|
|
7
|
+
const crypto_1 = require("crypto");
|
|
8
|
+
const constants_js_1 = require("./constants.cjs");
|
|
9
|
+
/**
|
|
10
|
+
* @description Dispatcher for Redis change events
|
|
11
|
+
* @summary Extends the core `Dispatch` to broadcast record changes over Redis
|
|
12
|
+
* pub/sub so that every process sharing the same database refreshes its observers.
|
|
13
|
+
* Local observer updates are still performed synchronously through the base class;
|
|
14
|
+
* the published message carries an `origin` id so a process ignores the echo of its
|
|
15
|
+
* own events and never notifies its observers twice.
|
|
16
|
+
* @class RedisDispatch
|
|
17
|
+
* @category Redis
|
|
18
|
+
*/
|
|
19
|
+
class RedisDispatch extends core_1.Dispatch {
|
|
20
|
+
constructor() {
|
|
21
|
+
super(...arguments);
|
|
22
|
+
this.origin = (0, crypto_1.randomUUID)();
|
|
23
|
+
/**
|
|
24
|
+
* @description Whether the pub/sub subscription is currently active
|
|
25
|
+
*/
|
|
26
|
+
this.active = false;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* @description Initializes the dispatcher and opens the pub/sub subscription
|
|
30
|
+
* @summary Proxies the adapter's CRUD methods through the base implementation,
|
|
31
|
+
* then opens a dedicated subscriber connection listening for change events.
|
|
32
|
+
* @param {...ContextualArgs} args - Contextual arguments
|
|
33
|
+
* @return {Promise<void>} A promise that resolves once initialization is complete
|
|
34
|
+
*/
|
|
35
|
+
async initialize(...args) {
|
|
36
|
+
await super.initialize(...args);
|
|
37
|
+
if (!this.adapter)
|
|
38
|
+
return;
|
|
39
|
+
try {
|
|
40
|
+
const subscriber = this.adapter.client.duplicate();
|
|
41
|
+
await subscriber.connect();
|
|
42
|
+
await subscriber.subscribe(constants_js_1.RedisEventsChannel, (message) => void this.changeHandler(message));
|
|
43
|
+
this.subscriber = subscriber;
|
|
44
|
+
this.active = true;
|
|
45
|
+
}
|
|
46
|
+
catch (e) {
|
|
47
|
+
this.log
|
|
48
|
+
.for(this.initialize)
|
|
49
|
+
.error(`Failed to subscribe to Redis change events: ${e}`);
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* @description Closes the dispatcher and releases the pub/sub subscription
|
|
54
|
+
* @param {...ContextualArgs} args - Contextual arguments
|
|
55
|
+
* @return {Promise<void>} A promise that resolves once the dispatcher is closed
|
|
56
|
+
*/
|
|
57
|
+
async close(...args) {
|
|
58
|
+
this.active = false;
|
|
59
|
+
const subscriber = this.subscriber;
|
|
60
|
+
this.subscriber = undefined;
|
|
61
|
+
if (subscriber) {
|
|
62
|
+
try {
|
|
63
|
+
await subscriber.unsubscribe(constants_js_1.RedisEventsChannel);
|
|
64
|
+
}
|
|
65
|
+
catch (e) {
|
|
66
|
+
this.log
|
|
67
|
+
.for(this.close)
|
|
68
|
+
.error(`Failed to unsubscribe from Redis change events: ${e}`);
|
|
69
|
+
}
|
|
70
|
+
try {
|
|
71
|
+
await subscriber.quit();
|
|
72
|
+
}
|
|
73
|
+
catch (e) {
|
|
74
|
+
this.log
|
|
75
|
+
.for(this.close)
|
|
76
|
+
.error(`Failed to close Redis change subscriber: ${e}`);
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
return super.close(...args);
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* @description Notifies local observers and broadcasts the event to other processes
|
|
83
|
+
* @summary Performs the base local refresh, then publishes the change to the
|
|
84
|
+
* Redis pub/sub channel. Remote processes receive the event and refresh their own
|
|
85
|
+
* observers; the originating process ignores its own message.
|
|
86
|
+
* @param {Constructor<any> | string} model - The model (or table name) that changed
|
|
87
|
+
* @param {OperationKeys | BulkCrudOperationKeys | string} event - The operation that occurred
|
|
88
|
+
* @param {any} id - The identifier(s) of the affected record(s)
|
|
89
|
+
* @param {...ContextualArgs} args - Contextual arguments
|
|
90
|
+
* @return {Promise<void>} A promise that resolves once observers are notified
|
|
91
|
+
*/
|
|
92
|
+
async updateObservers(model, event, id, ...args) {
|
|
93
|
+
await super.updateObservers(model, event, id, ...args);
|
|
94
|
+
if (!this.adapter)
|
|
95
|
+
return;
|
|
96
|
+
const table = model && typeof model === "string" ? model : decorator_validation_1.Model.tableName(model);
|
|
97
|
+
try {
|
|
98
|
+
await this.adapter.client.publish(constants_js_1.RedisEventsChannel, JSON.stringify({ origin: this.origin, table, event: String(event), id }));
|
|
99
|
+
}
|
|
100
|
+
catch (e) {
|
|
101
|
+
this.log
|
|
102
|
+
.for(this.updateObservers)
|
|
103
|
+
.error(`Failed to publish Redis change event: ${e}`);
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
/**
|
|
107
|
+
* @description Handles an incoming Redis change event
|
|
108
|
+
* @summary Ignores the echo of locally published events and refreshes the
|
|
109
|
+
* observers of this process for events published elsewhere.
|
|
110
|
+
* @param {string} message - The raw JSON pub/sub payload
|
|
111
|
+
* @return {Promise<void>} A promise that resolves once observers are notified
|
|
112
|
+
*/
|
|
113
|
+
async changeHandler(message) {
|
|
114
|
+
try {
|
|
115
|
+
const parsed = JSON.parse(message);
|
|
116
|
+
if (parsed.origin === this.origin)
|
|
117
|
+
return;
|
|
118
|
+
if (!this.adapter)
|
|
119
|
+
return;
|
|
120
|
+
const ctx = await this.adapter.context(db_decorators_1.OperationKeys.UPDATE, {}, decorator_validation_1.Model);
|
|
121
|
+
await super.updateObservers(parsed.table, parsed.event, parsed.id, ctx);
|
|
122
|
+
}
|
|
123
|
+
catch (e) {
|
|
124
|
+
this.log
|
|
125
|
+
.for(this.changeHandler)
|
|
126
|
+
.error(`Failed to process Redis change event: ${e}`);
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
exports.RedisDispatch = RedisDispatch;
|
|
131
|
+
//# sourceMappingURL=RedisDispatch.js.map
|
|
132
|
+
//# sourceMappingURL=RedisDispatch.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"redis/RedisDispatch.cjs","sourceRoot":"","sources":["redis/RedisDispatch.js"],"names":[],"mappings":";;;AAAA,yCAA0C;AAC1C,2DAAwD;AACxD,yEAAuD;AACvD,mCAAoC;AACpC,iDAAoD;AACpD;;;;;;;;;GASG;AACH,MAAa,aAAc,SAAQ,eAAQ;IACvC;QACI,KAAK,CAAC,GAAG,SAAS,CAAC,CAAC;QACpB,IAAI,CAAC,MAAM,GAAG,IAAA,mBAAU,GAAE,CAAC;QAC3B;;WAEG;QACH,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC;IACxB,CAAC;IACD;;;;;;OAMG;IACH,KAAK,CAAC,UAAU,CAAC,GAAG,IAAI;QACpB,MAAM,KAAK,CAAC,UAAU,CAAC,GAAG,IAAI,CAAC,CAAC;QAChC,IAAI,CAAC,IAAI,CAAC,OAAO;YACb,OAAO;QACX,IAAI,CAAC;YACD,MAAM,UAAU,GAAG,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,SAAS,EAAE,CAAC;YACnD,MAAM,UAAU,CAAC,OAAO,EAAE,CAAC;YAC3B,MAAM,UAAU,CAAC,SAAS,CAAC,iCAAkB,EAAE,CAAC,OAAO,EAAE,EAAE,CAAC,KAAK,IAAI,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC,CAAC;YAC9F,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;YAC7B,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC;QACvB,CAAC;QACD,OAAO,CAAC,EAAE,CAAC;YACP,IAAI,CAAC,GAAG;iBACH,GAAG,CAAC,IAAI,CAAC,UAAU,CAAC;iBACpB,KAAK,CAAC,+CAA+C,CAAC,EAAE,CAAC,CAAC;QACnE,CAAC;IACL,CAAC;IACD;;;;OAIG;IACH,KAAK,CAAC,KAAK,CAAC,GAAG,IAAI;QACf,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC;QACpB,MAAM,UAAU,GAAG,IAAI,CAAC,UAAU,CAAC;QACnC,IAAI,CAAC,UAAU,GAAG,SAAS,CAAC;QAC5B,IAAI,UAAU,EAAE,CAAC;YACb,IAAI,CAAC;gBACD,MAAM,UAAU,CAAC,WAAW,CAAC,iCAAkB,CAAC,CAAC;YACrD,CAAC;YACD,OAAO,CAAC,EAAE,CAAC;gBACP,IAAI,CAAC,GAAG;qBACH,GAAG,CAAC,IAAI,CAAC,KAAK,CAAC;qBACf,KAAK,CAAC,mDAAmD,CAAC,EAAE,CAAC,CAAC;YACvE,CAAC;YACD,IAAI,CAAC;gBACD,MAAM,UAAU,CAAC,IAAI,EAAE,CAAC;YAC5B,CAAC;YACD,OAAO,CAAC,EAAE,CAAC;gBACP,IAAI,CAAC,GAAG;qBACH,GAAG,CAAC,IAAI,CAAC,KAAK,CAAC;qBACf,KAAK,CAAC,4CAA4C,CAAC,EAAE,CAAC,CAAC;YAChE,CAAC;QACL,CAAC;QACD,OAAO,KAAK,CAAC,KAAK,CAAC,GAAG,IAAI,CAAC,CAAC;IAChC,CAAC;IACD;;;;;;;;;;OAUG;IACH,KAAK,CAAC,eAAe,CAAC,KAAK,EAAE,KAAK,EAAE,EAAE,EAAE,GAAG,IAAI;QAC3C,MAAM,KAAK,CAAC,eAAe,CAAC,KAAK,EAAE,KAAK,EAAE,EAAE,EAAE,GAAG,IAAI,CAAC,CAAC;QACvD,IAAI,CAAC,IAAI,CAAC,OAAO;YACb,OAAO;QACX,MAAM,KAAK,GAAG,KAAK,IAAI,OAAO,KAAK,KAAK,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,4BAAK,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC;QAClF,IAAI,CAAC;YACD,MAAM,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,OAAO,CAAC,iCAAkB,EAAE,IAAI,CAAC,SAAS,CAAC,EAAE,MAAM,EAAE,IAAI,CAAC,MAAM,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,CAAC,KAAK,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC,CAAC;QACpI,CAAC;QACD,OAAO,CAAC,EAAE,CAAC;YACP,IAAI,CAAC,GAAG;iBACH,GAAG,CAAC,IAAI,CAAC,eAAe,CAAC;iBACzB,KAAK,CAAC,yCAAyC,CAAC,EAAE,CAAC,CAAC;QAC7D,CAAC;IACL,CAAC;IACD;;;;;;OAMG;IACH,KAAK,CAAC,aAAa,CAAC,OAAO;QACvB,IAAI,CAAC;YACD,MAAM,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;YACnC,IAAI,MAAM,CAAC,MAAM,KAAK,IAAI,CAAC,MAAM;gBAC7B,OAAO;YACX,IAAI,CAAC,IAAI,CAAC,OAAO;gBACb,OAAO;YACX,MAAM,GAAG,GAAG,MAAM,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,6BAAa,CAAC,MAAM,EAAE,EAAE,EAAE,4BAAK,CAAC,CAAC;YACxE,MAAM,KAAK,CAAC,eAAe,CAAC,MAAM,CAAC,KAAK,EAAE,MAAM,CAAC,KAAK,EAAE,MAAM,CAAC,EAAE,EAAE,GAAG,CAAC,CAAC;QAC5E,CAAC;QACD,OAAO,CAAC,EAAE,CAAC;YACP,IAAI,CAAC,GAAG;iBACH,GAAG,CAAC,IAAI,CAAC,aAAa,CAAC;iBACvB,KAAK,CAAC,yCAAyC,CAAC,EAAE,CAAC,CAAC;QAC7D,CAAC;IACL,CAAC;CACJ;AA9GD,sCA8GC;AACD,yCAAyC"}
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.RedisPaginator = void 0;
|
|
4
|
+
const core_1 = require("@decaf-ts/core");
|
|
5
|
+
const decorator_validation_1 = require("@decaf-ts/decorator-validation");
|
|
6
|
+
/**
|
|
7
|
+
* @description Redis-specific paginator implementation
|
|
8
|
+
* @summary Extends the base Paginator class to provide pagination functionality for
|
|
9
|
+
* Redis adapter queries. This class handles the pagination of query results loaded
|
|
10
|
+
* from Redis, allowing for efficient retrieval of large result sets in smaller chunks.
|
|
11
|
+
* @template M - The model type being paginated
|
|
12
|
+
* @class RedisPaginator
|
|
13
|
+
* @category Redis
|
|
14
|
+
* @example
|
|
15
|
+
* ```typescript
|
|
16
|
+
* // Create a query for User model
|
|
17
|
+
* const query: RawRedisQuery<User> = {
|
|
18
|
+
* select: undefined, // Select all fields
|
|
19
|
+
* from: User,
|
|
20
|
+
* where: (user) => user.active === true
|
|
21
|
+
* };
|
|
22
|
+
*
|
|
23
|
+
* // Create a paginator with page size of 10
|
|
24
|
+
* const paginator = new RedisPaginator<User>(adapter, query, 10, User);
|
|
25
|
+
*
|
|
26
|
+
* // Get the first page of results
|
|
27
|
+
* const firstPage = await paginator.page(1);
|
|
28
|
+
*
|
|
29
|
+
* // Get the next page
|
|
30
|
+
* const secondPage = await paginator.page(2);
|
|
31
|
+
* ```
|
|
32
|
+
*/
|
|
33
|
+
class RedisPaginator extends core_1.Paginator {
|
|
34
|
+
/**
|
|
35
|
+
* @description Creates a paginator bound to the Redis adapter
|
|
36
|
+
* @param {Adapter<any, any, RawRedisQuery<M>, any>} adapter - The Redis adapter instance
|
|
37
|
+
* @param {RawRedisQuery<M>} query - The raw query to paginate
|
|
38
|
+
* @param {number} size - The number of records per page
|
|
39
|
+
* @param {Constructor<M>} clazz - The model constructor being paginated
|
|
40
|
+
*/
|
|
41
|
+
constructor(adapter, query, size, clazz) {
|
|
42
|
+
super(adapter, query, size, clazz);
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* @description Prepares a Redis query for pagination
|
|
46
|
+
* @summary Modifies the raw query statement to include pagination parameters.
|
|
47
|
+
* This protected method sets the limit parameter on the query to match the page size.
|
|
48
|
+
* @param {RawRedisQuery<M>} rawStatement - The original query statement
|
|
49
|
+
* @return {RawRedisQuery<M>} The modified query with pagination parameters
|
|
50
|
+
*/
|
|
51
|
+
prepare(rawStatement) {
|
|
52
|
+
const query = Object.assign({}, rawStatement);
|
|
53
|
+
query.limit = this.size;
|
|
54
|
+
return query;
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* @description Retrieves a specific page of results
|
|
58
|
+
* @summary Executes the query with pagination parameters to retrieve a specific page of results.
|
|
59
|
+
* This method calculates the appropriate skip value based on the page number and page size,
|
|
60
|
+
* executes the query, and updates the current page tracking.
|
|
61
|
+
* @param {number} [page=1] - The page number to retrieve (1-based)
|
|
62
|
+
* @return {Promise<R[]>} A promise that resolves to an array of results for the requested page
|
|
63
|
+
*/
|
|
64
|
+
async page(page = 1, ...args) {
|
|
65
|
+
const { ctx, ctxArgs } = this.adapter["logCtx"](args, this.page);
|
|
66
|
+
if (this.isPreparedStatement()) {
|
|
67
|
+
return this.pagePrepared(page, ...ctxArgs);
|
|
68
|
+
}
|
|
69
|
+
const statement = this.prepare(this.statement);
|
|
70
|
+
let results;
|
|
71
|
+
if (!this._recordCount || !this._totalPages) {
|
|
72
|
+
this._totalPages = this._recordCount = 0;
|
|
73
|
+
results = await this.adapter.raw({ ...statement, limit: Number.MAX_SAFE_INTEGER }, false, ctx);
|
|
74
|
+
this._recordCount = results.count || results.data.length;
|
|
75
|
+
if (this._recordCount > 0) {
|
|
76
|
+
const size = statement?.limit || this.size;
|
|
77
|
+
this._totalPages = Math.ceil(this._recordCount / size);
|
|
78
|
+
return await this.page(page, ...ctxArgs);
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
else {
|
|
82
|
+
page = this.validatePage(page);
|
|
83
|
+
statement.skip = (page - 1) * this.size;
|
|
84
|
+
results = await this.adapter.raw(statement, true, ...ctxArgs);
|
|
85
|
+
}
|
|
86
|
+
this._currentPage = page;
|
|
87
|
+
this._bookmark = results.length
|
|
88
|
+
? results[results.length - 1][decorator_validation_1.Model.pk(this.clazz)]
|
|
89
|
+
: undefined;
|
|
90
|
+
return results.data || results;
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
exports.RedisPaginator = RedisPaginator;
|
|
94
|
+
//# sourceMappingURL=RedisPaginator.js.map
|
|
95
|
+
//# sourceMappingURL=RedisPaginator.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"redis/RedisPaginator.cjs","sourceRoot":"","sources":["redis/RedisPaginator.js"],"names":[],"mappings":";;;AAAA,yCAA4C;AAC5C,yEAAuD;AACvD;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,MAAa,cAAe,SAAQ,gBAAS;IACzC;;;;;;OAMG;IACH,YAAY,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK;QACnC,KAAK,CAAC,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK,CAAC,CAAC;IACvC,CAAC;IACD;;;;;;OAMG;IACH,OAAO,CAAC,YAAY;QAChB,MAAM,KAAK,GAAG,MAAM,CAAC,MAAM,CAAC,EAAE,EAAE,YAAY,CAAC,CAAC;QAC9C,KAAK,CAAC,KAAK,GAAG,IAAI,CAAC,IAAI,CAAC;QACxB,OAAO,KAAK,CAAC;IACjB,CAAC;IACD;;;;;;;OAOG;IACH,KAAK,CAAC,IAAI,CAAC,IAAI,GAAG,CAAC,EAAE,GAAG,IAAI;QACxB,MAAM,EAAE,GAAG,EAAE,OAAO,EAAE,GAAG,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,IAAI,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC;QACjE,IAAI,IAAI,CAAC,mBAAmB,EAAE,EAAE,CAAC;YAC7B,OAAO,IAAI,CAAC,YAAY,CAAC,IAAI,EAAE,GAAG,OAAO,CAAC,CAAC;QAC/C,CAAC;QACD,MAAM,SAAS,GAAG,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;QAC/C,IAAI,OAAO,CAAC;QACZ,IAAI,CAAC,IAAI,CAAC,YAAY,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,CAAC;YAC1C,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC,YAAY,GAAG,CAAC,CAAC;YACzC,OAAO,GAAG,MAAM,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE,GAAG,SAAS,EAAE,KAAK,EAAE,MAAM,CAAC,gBAAgB,EAAE,EAAE,KAAK,EAAE,GAAG,CAAC,CAAC;YAC/F,IAAI,CAAC,YAAY,GAAG,OAAO,CAAC,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC;YACzD,IAAI,IAAI,CAAC,YAAY,GAAG,CAAC,EAAE,CAAC;gBACxB,MAAM,IAAI,GAAG,SAAS,EAAE,KAAK,IAAI,IAAI,CAAC,IAAI,CAAC;gBAC3C,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC,CAAC;gBACvD,OAAO,MAAM,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,GAAG,OAAO,CAAC,CAAC;YAC7C,CAAC;QACL,CAAC;aACI,CAAC;YACF,IAAI,GAAG,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC;YAC/B,SAAS,CAAC,IAAI,GAAG,CAAC,IAAI,GAAG,CAAC,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC;YACxC,OAAO,GAAG,MAAM,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,SAAS,EAAE,IAAI,EAAE,GAAG,OAAO,CAAC,CAAC;QAClE,CAAC;QACD,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC;QACzB,IAAI,CAAC,SAAS,GAAG,OAAO,CAAC,MAAM;YAC3B,CAAC,CAAC,OAAO,CAAC,OAAO,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,4BAAK,CAAC,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;YACnD,CAAC,CAAC,SAAS,CAAC;QAChB,OAAO,OAAO,CAAC,IAAI,IAAI,OAAO,CAAC;IACnC,CAAC;CACJ;AA3DD,wCA2DC;AACD,0CAA0C"}
|
|
@@ -0,0 +1,433 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.RedisStatement = void 0;
|
|
4
|
+
const core_1 = require("@decaf-ts/core");
|
|
5
|
+
const db_decorators_1 = require("@decaf-ts/db-decorators");
|
|
6
|
+
const decoration_1 = require("@decaf-ts/decoration");
|
|
7
|
+
/**
|
|
8
|
+
* @description Redis-specific query statement builder
|
|
9
|
+
* @summary Extends the base Statement class to provide query building functionality for the Redis adapter.
|
|
10
|
+
* This class translates high-level query operations into predicates that can filter and sort
|
|
11
|
+
* in-memory data structures (records reverted from the table hash).
|
|
12
|
+
* @template M - The model type being queried
|
|
13
|
+
* @template R - The result type returned by the query
|
|
14
|
+
* @class RedisStatement
|
|
15
|
+
* @category Redis
|
|
16
|
+
* @example
|
|
17
|
+
* ```typescript
|
|
18
|
+
* // Create a statement for querying User models
|
|
19
|
+
* const statement = redisAdapter.Statement<User>();
|
|
20
|
+
*
|
|
21
|
+
* // Build a query to find active users with age > 18
|
|
22
|
+
* const results = await statement
|
|
23
|
+
* .from(User)
|
|
24
|
+
* .where(Condition.and(
|
|
25
|
+
* Condition.eq('active', true),
|
|
26
|
+
* Condition.gt('age', 18)
|
|
27
|
+
* ))
|
|
28
|
+
* .orderBy('lastName', 'asc')
|
|
29
|
+
* .limit(10)
|
|
30
|
+
* .execute();
|
|
31
|
+
* ```
|
|
32
|
+
*/
|
|
33
|
+
class RedisStatement extends core_1.Statement {
|
|
34
|
+
/**
|
|
35
|
+
* @description Creates a statement bound to the Redis adapter
|
|
36
|
+
* @param {A} adapter - The Redis adapter instance to use for executing queries
|
|
37
|
+
* @param {Partial<AdapterFlags>} [overrides] - Optional adapter flag overrides
|
|
38
|
+
*/
|
|
39
|
+
constructor(adapter, overrides) {
|
|
40
|
+
super(adapter, overrides);
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* @description Creates a sort comparator function
|
|
44
|
+
* @summary Generates a function that compares two model instances based on the orderBy criteria.
|
|
45
|
+
* This method handles different data types (string, number, date) and sort directions (asc, desc).
|
|
46
|
+
* @return {function(Model, Model): number} A comparator function for sorting model instances
|
|
47
|
+
*/
|
|
48
|
+
getSort() {
|
|
49
|
+
const selectors = this.orderBySelectors;
|
|
50
|
+
return (el1, el2) => {
|
|
51
|
+
if (!selectors || !selectors.length)
|
|
52
|
+
throw new db_decorators_1.InternalError("orderBySelectors not set. Should be impossible");
|
|
53
|
+
for (const [key, direction] of selectors) {
|
|
54
|
+
const normalizedDirection = String(direction).toLowerCase();
|
|
55
|
+
const directionFactor = normalizedDirection === core_1.OrderDirection.ASC ? 1 : -1;
|
|
56
|
+
const comparison = this.compareByKey(el1, el2, key);
|
|
57
|
+
if (comparison !== 0)
|
|
58
|
+
return directionFactor * comparison;
|
|
59
|
+
}
|
|
60
|
+
return 0;
|
|
61
|
+
};
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* @description Compares two models by a single attribute
|
|
65
|
+
* @summary Resolves the attribute's design type and delegates to the matching
|
|
66
|
+
* type-specific comparator.
|
|
67
|
+
* @param {Model} el1 - The first model instance
|
|
68
|
+
* @param {Model} el2 - The second model instance
|
|
69
|
+
* @param {keyof Model} key - The attribute to compare
|
|
70
|
+
* @return {number} A negative number, zero or a positive number as per the comparison
|
|
71
|
+
*/
|
|
72
|
+
compareByKey(el1, el2, key) {
|
|
73
|
+
const value1 = el1[key];
|
|
74
|
+
const value2 = el2[key];
|
|
75
|
+
if (value1 === value2)
|
|
76
|
+
return 0;
|
|
77
|
+
if (value1 == null || value2 == null)
|
|
78
|
+
return value1 == null ? 1 : -1;
|
|
79
|
+
const { designType: type } = decoration_1.Metadata.getPropDesignTypes(el1.constructor, key);
|
|
80
|
+
const resolvedType = (type && type.name && type.name.toLowerCase()) || typeof value1;
|
|
81
|
+
switch (resolvedType) {
|
|
82
|
+
case "string":
|
|
83
|
+
return this.compareStrings(value1, value2);
|
|
84
|
+
case "number":
|
|
85
|
+
return this.compareNumbers(value1, value2);
|
|
86
|
+
case "bigint":
|
|
87
|
+
return this.compareBigInts(value1, value2);
|
|
88
|
+
case "boolean":
|
|
89
|
+
return this.compareBooleans(value1, value2);
|
|
90
|
+
case "date":
|
|
91
|
+
case "object":
|
|
92
|
+
if (value1 instanceof Date && value2 instanceof Date) {
|
|
93
|
+
return this.compareDates(value1, value2);
|
|
94
|
+
}
|
|
95
|
+
break;
|
|
96
|
+
default:
|
|
97
|
+
break;
|
|
98
|
+
}
|
|
99
|
+
throw new core_1.QueryError(`sorting not supported for type ${resolvedType}`);
|
|
100
|
+
}
|
|
101
|
+
/**
|
|
102
|
+
* @description Compares two boolean values
|
|
103
|
+
* @return {number} 0 when equal, 1 when `a` is true, -1 otherwise
|
|
104
|
+
*/
|
|
105
|
+
compareBooleans(a, b) {
|
|
106
|
+
return a === b ? 0 : a ? 1 : -1;
|
|
107
|
+
}
|
|
108
|
+
/**
|
|
109
|
+
* @description Compares two numeric values
|
|
110
|
+
* @return {number} The numeric difference between the values
|
|
111
|
+
*/
|
|
112
|
+
compareNumbers(a, b) {
|
|
113
|
+
return a - b;
|
|
114
|
+
}
|
|
115
|
+
/**
|
|
116
|
+
* @description Compares two bigint values
|
|
117
|
+
* @return {number} 0 when equal, 1 when `a` is greater, -1 otherwise
|
|
118
|
+
*/
|
|
119
|
+
compareBigInts(a, b) {
|
|
120
|
+
if (a === b)
|
|
121
|
+
return 0;
|
|
122
|
+
return a > b ? 1 : -1;
|
|
123
|
+
}
|
|
124
|
+
/**
|
|
125
|
+
* @description Compares two strings using locale-aware ordering
|
|
126
|
+
* @return {number} The locale compare result between the values
|
|
127
|
+
*/
|
|
128
|
+
compareStrings(a, b) {
|
|
129
|
+
return a.localeCompare(b);
|
|
130
|
+
}
|
|
131
|
+
/**
|
|
132
|
+
* @description Compares two dates by their epoch timestamps
|
|
133
|
+
* @return {number} The difference between the timestamps
|
|
134
|
+
*/
|
|
135
|
+
compareDates(a, b) {
|
|
136
|
+
return a.valueOf() - b.valueOf();
|
|
137
|
+
}
|
|
138
|
+
/**
|
|
139
|
+
* @description Builds a Redis query from the statement
|
|
140
|
+
* @summary Converts the statement's selectors and conditions into a RawRedisQuery object
|
|
141
|
+
* that can be executed by the Redis adapter. This method assembles all query components
|
|
142
|
+
* (select, from, where, limit, offset, sort) into the final query structure.
|
|
143
|
+
* @return {RawRedisQuery<M>} The constructed Redis query object
|
|
144
|
+
*/
|
|
145
|
+
build() {
|
|
146
|
+
if (this.minSelector)
|
|
147
|
+
this.ensureNumberOrDateSelector(this.minSelector, "MIN operation");
|
|
148
|
+
if (this.maxSelector)
|
|
149
|
+
this.ensureNumberOrDateSelector(this.maxSelector, "MAX operation");
|
|
150
|
+
if (this.sumSelector)
|
|
151
|
+
this.ensureNumericSelector(this.sumSelector, "SUM operation");
|
|
152
|
+
if (this.avgSelector)
|
|
153
|
+
this.ensureNumberOrDateSelector(this.avgSelector, "AVG operation");
|
|
154
|
+
const result = {
|
|
155
|
+
select: this.selectSelector,
|
|
156
|
+
from: this.fromSelector,
|
|
157
|
+
where: this.whereCondition
|
|
158
|
+
? this.parseCondition(this.whereCondition).where
|
|
159
|
+
: // eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
160
|
+
(el) => {
|
|
161
|
+
return true;
|
|
162
|
+
},
|
|
163
|
+
limit: this.limitSelector,
|
|
164
|
+
skip: this.offsetSelector,
|
|
165
|
+
groupBy: this.groupBySelectors,
|
|
166
|
+
};
|
|
167
|
+
if (typeof this.countSelector !== "undefined")
|
|
168
|
+
result.count = this.countSelector;
|
|
169
|
+
if (this.countDistinctSelector)
|
|
170
|
+
result.countDistinct = this.countDistinctSelector;
|
|
171
|
+
if (this.minSelector)
|
|
172
|
+
result.min = this.minSelector;
|
|
173
|
+
if (this.maxSelector)
|
|
174
|
+
result.max = this.maxSelector;
|
|
175
|
+
if (this.sumSelector)
|
|
176
|
+
result.sum = this.sumSelector;
|
|
177
|
+
if (this.avgSelector)
|
|
178
|
+
result.avg = this.avgSelector;
|
|
179
|
+
if (this.distinctSelector)
|
|
180
|
+
result.distinct = this.distinctSelector;
|
|
181
|
+
if (this.orderBySelectors?.length)
|
|
182
|
+
result.sort = this.getSort();
|
|
183
|
+
return result;
|
|
184
|
+
}
|
|
185
|
+
/**
|
|
186
|
+
* @description Parses a condition into a Redis query predicate
|
|
187
|
+
* @summary Converts a Condition object into a predicate function that can be used
|
|
188
|
+
* to filter model instances in memory. This method handles both simple conditions
|
|
189
|
+
* (equals, greater than, etc.) and complex conditions with logical operators (AND, OR).
|
|
190
|
+
* @template M - The model type for the condition
|
|
191
|
+
* @param {Condition<M>} condition - The condition to parse
|
|
192
|
+
* @return {RawRedisQuery<M>} A Redis query object with a where predicate function
|
|
193
|
+
* @mermaid
|
|
194
|
+
* sequenceDiagram
|
|
195
|
+
* participant Caller
|
|
196
|
+
* participant RedisStatement
|
|
197
|
+
* participant SimpleCondition
|
|
198
|
+
* participant ComplexCondition
|
|
199
|
+
*
|
|
200
|
+
* Caller->>RedisStatement: parseCondition(condition)
|
|
201
|
+
* alt Simple condition (eq, gt, lt, etc.)
|
|
202
|
+
* RedisStatement->>SimpleCondition: Extract attr1, operator, comparison
|
|
203
|
+
* SimpleCondition-->>RedisStatement: Return predicate function
|
|
204
|
+
* else Logical operator (AND, OR)
|
|
205
|
+
* RedisStatement->>ComplexCondition: Extract nested conditions
|
|
206
|
+
* RedisStatement->>RedisStatement: parseCondition(leftCondition)
|
|
207
|
+
* RedisStatement->>RedisStatement: parseCondition(rightCondition)
|
|
208
|
+
* ComplexCondition-->>RedisStatement: Combine predicates with logical operator
|
|
209
|
+
* end
|
|
210
|
+
* RedisStatement-->>Caller: Return query with where predicate
|
|
211
|
+
*/
|
|
212
|
+
parseCondition(condition) {
|
|
213
|
+
return {
|
|
214
|
+
where: (m) => {
|
|
215
|
+
const { attr1, operator, comparison } = condition;
|
|
216
|
+
if ([core_1.GroupOperator.AND, core_1.GroupOperator.OR, core_1.Operator.NOT].indexOf(operator) === -1) {
|
|
217
|
+
switch (operator) {
|
|
218
|
+
case core_1.Operator.BIGGER:
|
|
219
|
+
return m[attr1] > comparison;
|
|
220
|
+
case core_1.Operator.BIGGER_EQ:
|
|
221
|
+
return m[attr1] >= comparison;
|
|
222
|
+
case core_1.Operator.DIFFERENT:
|
|
223
|
+
return m[attr1] !== comparison;
|
|
224
|
+
case core_1.Operator.EQUAL:
|
|
225
|
+
return m[attr1] === comparison;
|
|
226
|
+
case core_1.Operator.REGEXP:
|
|
227
|
+
if (typeof m[attr1] !== "string")
|
|
228
|
+
throw new core_1.QueryError(`Invalid regexp comparison on a non string attribute: ${m[attr1]}`);
|
|
229
|
+
return !!m[attr1].match(new RegExp(comparison, "g"));
|
|
230
|
+
case core_1.Operator.STARTS_WITH: {
|
|
231
|
+
const attr = attr1;
|
|
232
|
+
const attrName = attr;
|
|
233
|
+
const attrValue = m[attr];
|
|
234
|
+
if (typeof attrValue !== "string") {
|
|
235
|
+
throw new core_1.QueryError(`Invalid startsWith comparison on a non string attribute "${attrName}"`);
|
|
236
|
+
}
|
|
237
|
+
if (typeof comparison !== "string") {
|
|
238
|
+
throw new core_1.QueryError(`STARTS_WITH operator requires a string comparison, got ${typeof comparison}`);
|
|
239
|
+
}
|
|
240
|
+
return attrValue.startsWith(comparison);
|
|
241
|
+
}
|
|
242
|
+
case core_1.Operator.ENDS_WITH: {
|
|
243
|
+
const attr = attr1;
|
|
244
|
+
const attrName = attr;
|
|
245
|
+
const attrValue = m[attr];
|
|
246
|
+
if (typeof attrValue !== "string") {
|
|
247
|
+
throw new core_1.QueryError(`Invalid endsWith comparison on a non string attribute "${attrName}"`);
|
|
248
|
+
}
|
|
249
|
+
if (typeof comparison !== "string") {
|
|
250
|
+
throw new core_1.QueryError(`ENDS_WITH operator requires a string comparison, got ${typeof comparison}`);
|
|
251
|
+
}
|
|
252
|
+
return attrValue.endsWith(comparison);
|
|
253
|
+
}
|
|
254
|
+
case core_1.Operator.SMALLER:
|
|
255
|
+
return m[attr1] < comparison;
|
|
256
|
+
case core_1.Operator.SMALLER_EQ:
|
|
257
|
+
return m[attr1] <= comparison;
|
|
258
|
+
case core_1.Operator.IN:
|
|
259
|
+
if (!Array.isArray(comparison))
|
|
260
|
+
throw new core_1.QueryError(`IN operator requires an array, got: ${typeof comparison}`);
|
|
261
|
+
return comparison.includes(m[attr1]);
|
|
262
|
+
case core_1.Operator.BETWEEN: {
|
|
263
|
+
if (!Array.isArray(comparison) || comparison.length !== 2)
|
|
264
|
+
throw new core_1.QueryError(`BETWEEN operator requires an array with 2 values [min, max], got: ${JSON.stringify(comparison)}`);
|
|
265
|
+
const attr = attr1;
|
|
266
|
+
const attrName = attr;
|
|
267
|
+
const attrType = this.determineAttributeType(m.constructor, attrName, "BETWEEN");
|
|
268
|
+
if (!this.isNumericType(attrType) && attrType !== "date") {
|
|
269
|
+
throw new core_1.QueryError(`BETWEEN operator requires numeric or date attributes, but "${attrName}" is ${attrType ||
|
|
270
|
+
"unknown"}`);
|
|
271
|
+
}
|
|
272
|
+
const [min, max] = comparison;
|
|
273
|
+
const value = m[attr];
|
|
274
|
+
const comparableValue = this.toComparableValue(value, attrType, attrName, "BETWEEN", { allowNull: true });
|
|
275
|
+
if (comparableValue === null)
|
|
276
|
+
return false;
|
|
277
|
+
const minComparable = this.toComparableValue(min, attrType, attrName, "BETWEEN min");
|
|
278
|
+
const maxComparable = this.toComparableValue(max, attrType, attrName, "BETWEEN max");
|
|
279
|
+
return (comparableValue >= minComparable && comparableValue <= maxComparable);
|
|
280
|
+
}
|
|
281
|
+
case core_1.Operator.EXISTS: {
|
|
282
|
+
const present = m[attr1] !== undefined &&
|
|
283
|
+
m[attr1] !== null;
|
|
284
|
+
return comparison === false ? !present : present;
|
|
285
|
+
}
|
|
286
|
+
default:
|
|
287
|
+
throw new db_decorators_1.InternalError(`Invalid operator for standard comparisons: ${operator}`);
|
|
288
|
+
}
|
|
289
|
+
}
|
|
290
|
+
else if (operator === core_1.Operator.NOT) {
|
|
291
|
+
if (!(attr1 instanceof core_1.Condition)) {
|
|
292
|
+
throw new db_decorators_1.InternalError("NOT operator requires a nested condition to negate");
|
|
293
|
+
}
|
|
294
|
+
const nested = this.parseCondition(attr1);
|
|
295
|
+
return !nested.where(m);
|
|
296
|
+
}
|
|
297
|
+
else {
|
|
298
|
+
const op1 = this.parseCondition(attr1);
|
|
299
|
+
const op2 = this.parseCondition(comparison);
|
|
300
|
+
switch (operator) {
|
|
301
|
+
case core_1.GroupOperator.AND:
|
|
302
|
+
return op1.where(m) && op2.where(m);
|
|
303
|
+
case core_1.GroupOperator.OR:
|
|
304
|
+
return op1.where(m) || op2.where(m);
|
|
305
|
+
default:
|
|
306
|
+
throw new db_decorators_1.InternalError(`Invalid operator for And/Or comparisons: ${operator}`);
|
|
307
|
+
}
|
|
308
|
+
}
|
|
309
|
+
},
|
|
310
|
+
};
|
|
311
|
+
}
|
|
312
|
+
/**
|
|
313
|
+
* @description Validates that an aggregation selector targets a numeric attribute
|
|
314
|
+
* @param {SelectSelector<M>} selector - The attribute selector to validate
|
|
315
|
+
* @param {string} context - The aggregation context used in error messages
|
|
316
|
+
* @return {void}
|
|
317
|
+
*/
|
|
318
|
+
ensureNumericSelector(selector, context) {
|
|
319
|
+
this.ensureSelectorType(selector, context, (type) => this.isNumericType(type), "numeric");
|
|
320
|
+
}
|
|
321
|
+
/**
|
|
322
|
+
* @description Validates that an aggregation selector targets a numeric or date attribute
|
|
323
|
+
* @param {SelectSelector<M>} selector - The attribute selector to validate
|
|
324
|
+
* @param {string} context - The aggregation context used in error messages
|
|
325
|
+
* @return {void}
|
|
326
|
+
*/
|
|
327
|
+
ensureNumberOrDateSelector(selector, context) {
|
|
328
|
+
this.ensureSelectorType(selector, context, (type) => this.isNumericType(type) || type === "date", "numeric or date");
|
|
329
|
+
}
|
|
330
|
+
/**
|
|
331
|
+
* @description Validates that a selector's attribute type satisfies a predicate
|
|
332
|
+
* @summary Resolves the attribute type from the model metadata and raises a
|
|
333
|
+
* `QueryError` when the type does not match the expected kind.
|
|
334
|
+
* @param {SelectSelector<M>} selector - The attribute selector to validate
|
|
335
|
+
* @param {string} context - The aggregation context used in error messages
|
|
336
|
+
* @param {function(string): boolean} predicate - Type acceptance predicate
|
|
337
|
+
* @param {string} description - Human readable description of the accepted types
|
|
338
|
+
* @return {void}
|
|
339
|
+
*/
|
|
340
|
+
ensureSelectorType(selector, context, predicate, description) {
|
|
341
|
+
if (!this.fromSelector) {
|
|
342
|
+
throw new db_decorators_1.InternalError(`${context} requires a target model. Call from() before aggregating.`);
|
|
343
|
+
}
|
|
344
|
+
const attr = selector;
|
|
345
|
+
const type = this.determineAttributeType(this.fromSelector, attr, context);
|
|
346
|
+
if (!predicate(type)) {
|
|
347
|
+
throw new core_1.QueryError(`${context} requires a ${description} attribute, but "${attr}" is ${type || "unknown"}`);
|
|
348
|
+
}
|
|
349
|
+
}
|
|
350
|
+
/**
|
|
351
|
+
* @description Resolves the attribute type from the model metadata
|
|
352
|
+
* @summary Reads the metadata or design type of the attribute and normalizes it
|
|
353
|
+
* to a lowercase type name.
|
|
354
|
+
* @param {Constructor<Model>} clazz - The model constructor
|
|
355
|
+
* @param {string} attr - The attribute name
|
|
356
|
+
* @param {string} context - The context used in error messages
|
|
357
|
+
* @return {string} The normalized attribute type
|
|
358
|
+
*/
|
|
359
|
+
determineAttributeType(clazz, attr, context) {
|
|
360
|
+
const propKey = attr;
|
|
361
|
+
const metaType = decoration_1.Metadata.type(clazz, propKey) ??
|
|
362
|
+
decoration_1.Metadata.getPropDesignTypes(clazz, propKey)?.designType;
|
|
363
|
+
const resolved = this.normalizeMetaType(metaType);
|
|
364
|
+
if (!resolved) {
|
|
365
|
+
throw new core_1.QueryError(`${context} could not resolve property type for "${attr}"`);
|
|
366
|
+
}
|
|
367
|
+
return resolved;
|
|
368
|
+
}
|
|
369
|
+
/**
|
|
370
|
+
* @description Normalizes a raw metadata type to a lowercase type name
|
|
371
|
+
* @param {any} metaType - The raw metadata type value
|
|
372
|
+
* @return {string | undefined} The normalized type name, when resolvable
|
|
373
|
+
*/
|
|
374
|
+
normalizeMetaType(metaType) {
|
|
375
|
+
if (!metaType)
|
|
376
|
+
return undefined;
|
|
377
|
+
if (typeof metaType === "string")
|
|
378
|
+
return metaType.toLowerCase();
|
|
379
|
+
if (typeof metaType === "function" && metaType.name)
|
|
380
|
+
return metaType.name.toLowerCase();
|
|
381
|
+
return undefined;
|
|
382
|
+
}
|
|
383
|
+
/**
|
|
384
|
+
* @description Whether the given type name is a numeric type
|
|
385
|
+
* @param {string} [type] - The normalized type name
|
|
386
|
+
* @return {boolean} True for "number" and "bigint"
|
|
387
|
+
*/
|
|
388
|
+
isNumericType(type) {
|
|
389
|
+
return type === "number" || type === "bigint";
|
|
390
|
+
}
|
|
391
|
+
/**
|
|
392
|
+
* @description Converts a value to a numeric comparable value
|
|
393
|
+
* @summary Maps date, number and bigint values to numbers for comparison and
|
|
394
|
+
* raises a `QueryError` for missing or incompatible values.
|
|
395
|
+
* @param {any} value - The value to convert
|
|
396
|
+
* @param {string} attrType - The normalized attribute type
|
|
397
|
+
* @param {string} attrName - The attribute name used in error messages
|
|
398
|
+
* @param {string} context - The context used in error messages
|
|
399
|
+
* @param {object} [options] - Conversion options
|
|
400
|
+
* @param {boolean} [options.allowNull] - Whether null/undefined values return null instead of raising
|
|
401
|
+
* @return {number | null} The numeric comparable value
|
|
402
|
+
*/
|
|
403
|
+
toComparableValue(value, attrType, attrName, context, options) {
|
|
404
|
+
if (value == null) {
|
|
405
|
+
if (options?.allowNull)
|
|
406
|
+
return null;
|
|
407
|
+
throw new core_1.QueryError(`${context} requires a value for "${attrName}"`);
|
|
408
|
+
}
|
|
409
|
+
switch (attrType) {
|
|
410
|
+
case "date":
|
|
411
|
+
if (!(value instanceof Date)) {
|
|
412
|
+
throw new core_1.QueryError(`${context} on date attribute "${attrName}" requires Date values`);
|
|
413
|
+
}
|
|
414
|
+
return value.getTime();
|
|
415
|
+
case "number":
|
|
416
|
+
if (typeof value !== "number") {
|
|
417
|
+
throw new core_1.QueryError(`${context} on numeric attribute "${attrName}" requires number values`);
|
|
418
|
+
}
|
|
419
|
+
return value;
|
|
420
|
+
case "bigint":
|
|
421
|
+
if (typeof value === "number")
|
|
422
|
+
return value;
|
|
423
|
+
if (typeof value === "bigint")
|
|
424
|
+
return Number(value);
|
|
425
|
+
throw new core_1.QueryError(`${context} on bigint attribute "${attrName}" requires numeric values`);
|
|
426
|
+
default:
|
|
427
|
+
throw new core_1.QueryError(`${context} unsupported type "${attrType}" for attribute "${attrName}"`);
|
|
428
|
+
}
|
|
429
|
+
}
|
|
430
|
+
}
|
|
431
|
+
exports.RedisStatement = RedisStatement;
|
|
432
|
+
//# sourceMappingURL=RedisStatement.js.map
|
|
433
|
+
//# sourceMappingURL=RedisStatement.cjs.map
|