@decaf-ts/integrations 0.3.0 → 0.3.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/integrations.cjs +1 -1
- package/lib/cjs/graph/constants.cjs +94 -0
- package/lib/cjs/graph/constants.cjs.map +1 -0
- package/lib/cjs/graph/decorators.cjs +4 -0
- package/lib/cjs/graph/decorators.cjs.map +1 -0
- package/lib/cjs/graph/errors/GraphCycleError.cjs +20 -0
- package/lib/cjs/graph/errors/GraphCycleError.cjs.map +1 -0
- package/lib/cjs/graph/errors/GraphExecutionError.cjs +27 -0
- package/lib/cjs/graph/errors/GraphExecutionError.cjs.map +1 -0
- package/lib/cjs/graph/errors/GraphInputError.cjs +20 -0
- package/lib/cjs/graph/errors/GraphInputError.cjs.map +1 -0
- package/lib/cjs/graph/errors/GraphLoopLimitError.cjs +20 -0
- package/lib/cjs/graph/errors/GraphLoopLimitError.cjs.map +1 -0
- package/lib/cjs/graph/errors/GraphPinningError.cjs +20 -0
- package/lib/cjs/graph/errors/GraphPinningError.cjs.map +1 -0
- package/lib/cjs/graph/errors/GraphPortError.cjs +20 -0
- package/lib/cjs/graph/errors/GraphPortError.cjs.map +1 -0
- package/lib/cjs/graph/errors/GraphStoreError.cjs +20 -0
- package/lib/cjs/graph/errors/GraphStoreError.cjs.map +1 -0
- package/lib/cjs/graph/errors/GraphTopologyError.cjs +20 -0
- package/lib/cjs/graph/errors/GraphTopologyError.cjs.map +1 -0
- package/lib/cjs/graph/errors/index.cjs +31 -0
- package/lib/cjs/graph/errors/index.cjs.map +1 -0
- package/lib/cjs/graph/events/GraphExecutionEvent.cjs +4 -0
- package/lib/cjs/graph/events/GraphExecutionEvent.cjs.map +1 -0
- package/lib/cjs/graph/events/GraphExecutionEventEmitter.cjs +40 -0
- package/lib/cjs/graph/events/GraphExecutionEventEmitter.cjs.map +1 -0
- package/lib/cjs/graph/events/GraphExecutionEventFactory.cjs +37 -0
- package/lib/cjs/graph/events/GraphExecutionEventFactory.cjs.map +1 -0
- package/lib/cjs/graph/events/GraphExecutionObserver.cjs +4 -0
- package/lib/cjs/graph/events/GraphExecutionObserver.cjs.map +1 -0
- package/lib/cjs/graph/events/index.cjs +27 -0
- package/lib/cjs/graph/events/index.cjs.map +1 -0
- package/lib/cjs/graph/execution/GraphExecutionContext.cjs +79 -0
- package/lib/cjs/graph/execution/GraphExecutionContext.cjs.map +1 -0
- package/lib/cjs/graph/execution/GraphExecutionEngine.cjs +405 -0
- package/lib/cjs/graph/execution/GraphExecutionEngine.cjs.map +1 -0
- package/lib/cjs/graph/execution/GraphExecutionFrame.cjs +32 -0
- package/lib/cjs/graph/execution/GraphExecutionFrame.cjs.map +1 -0
- package/lib/cjs/graph/execution/GraphExecutionResult.cjs +30 -0
- package/lib/cjs/graph/execution/GraphExecutionResult.cjs.map +1 -0
- package/lib/cjs/graph/execution/GraphNodeExecutor.cjs +4 -0
- package/lib/cjs/graph/execution/GraphNodeExecutor.cjs.map +1 -0
- package/lib/cjs/graph/execution/index.cjs +28 -0
- package/lib/cjs/graph/execution/index.cjs.map +1 -0
- package/lib/cjs/graph/index.cjs +74 -0
- package/lib/cjs/graph/index.cjs.map +1 -0
- package/lib/cjs/graph/loops/ForeachGraphNodeExecutor.cjs +84 -0
- package/lib/cjs/graph/loops/ForeachGraphNodeExecutor.cjs.map +1 -0
- package/lib/cjs/graph/loops/GraphConditionEvaluator.cjs +63 -0
- package/lib/cjs/graph/loops/GraphConditionEvaluator.cjs.map +1 -0
- package/lib/cjs/graph/loops/GraphLoopExecutionContext.cjs +16 -0
- package/lib/cjs/graph/loops/GraphLoopExecutionContext.cjs.map +1 -0
- package/lib/cjs/graph/loops/UntilGraphNodeExecutor.cjs +76 -0
- package/lib/cjs/graph/loops/UntilGraphNodeExecutor.cjs.map +1 -0
- package/lib/cjs/graph/loops/WhileGraphNodeExecutor.cjs +77 -0
- package/lib/cjs/graph/loops/WhileGraphNodeExecutor.cjs.map +1 -0
- package/lib/cjs/graph/loops/index.cjs +28 -0
- package/lib/cjs/graph/loops/index.cjs.map +1 -0
- package/lib/cjs/graph/pinning/GraphPinningDependencyResolver.cjs +28 -0
- package/lib/cjs/graph/pinning/GraphPinningDependencyResolver.cjs.map +1 -0
- package/lib/cjs/graph/pinning/GraphPinningMetadata.cjs +20 -0
- package/lib/cjs/graph/pinning/GraphPinningMetadata.cjs.map +1 -0
- package/lib/cjs/graph/pinning/GraphPinningPolicy.cjs +34 -0
- package/lib/cjs/graph/pinning/GraphPinningPolicy.cjs.map +1 -0
- package/lib/cjs/graph/pinning/GraphPinningService.cjs +191 -0
- package/lib/cjs/graph/pinning/GraphPinningService.cjs.map +1 -0
- package/lib/cjs/graph/pinning/index.cjs +27 -0
- package/lib/cjs/graph/pinning/index.cjs.map +1 -0
- package/lib/cjs/graph/planning/GraphExecutionPlan.cjs +4 -0
- package/lib/cjs/graph/planning/GraphExecutionPlan.cjs.map +1 -0
- package/lib/cjs/graph/planning/GraphExecutionPlanEdge.cjs +4 -0
- package/lib/cjs/graph/planning/GraphExecutionPlanEdge.cjs.map +1 -0
- package/lib/cjs/graph/planning/GraphExecutionPlanLayer.cjs +4 -0
- package/lib/cjs/graph/planning/GraphExecutionPlanLayer.cjs.map +1 -0
- package/lib/cjs/graph/planning/GraphExecutionPlanNode.cjs +4 -0
- package/lib/cjs/graph/planning/GraphExecutionPlanNode.cjs.map +1 -0
- package/lib/cjs/graph/planning/GraphExecutionPlanner.cjs +197 -0
- package/lib/cjs/graph/planning/GraphExecutionPlanner.cjs.map +1 -0
- package/lib/cjs/graph/planning/GraphRelationResolver.cjs +172 -0
- package/lib/cjs/graph/planning/GraphRelationResolver.cjs.map +1 -0
- package/lib/cjs/graph/planning/GraphTopology.cjs +57 -0
- package/lib/cjs/graph/planning/GraphTopology.cjs.map +1 -0
- package/lib/cjs/graph/planning/index.cjs +30 -0
- package/lib/cjs/graph/planning/index.cjs.map +1 -0
- package/lib/cjs/graph/registry/GraphNodeExecutorRegistry.cjs +44 -0
- package/lib/cjs/graph/registry/GraphNodeExecutorRegistry.cjs.map +1 -0
- package/lib/cjs/graph/registry/GraphNodeExecutorResolver.cjs +27 -0
- package/lib/cjs/graph/registry/GraphNodeExecutorResolver.cjs.map +1 -0
- package/lib/cjs/graph/registry/index.cjs +25 -0
- package/lib/cjs/graph/registry/index.cjs.map +1 -0
- package/lib/cjs/graph/snapshots/GraphExecutionSnapshotMapper.cjs +53 -0
- package/lib/cjs/graph/snapshots/GraphExecutionSnapshotMapper.cjs.map +1 -0
- package/lib/cjs/graph/snapshots/index.cjs +24 -0
- package/lib/cjs/graph/snapshots/index.cjs.map +1 -0
- package/lib/cjs/graph/store/GraphCachedValue.cjs +4 -0
- package/lib/cjs/graph/store/GraphCachedValue.cjs.map +1 -0
- package/lib/cjs/graph/store/GraphValueKey.cjs +4 -0
- package/lib/cjs/graph/store/GraphValueKey.cjs.map +1 -0
- package/lib/cjs/graph/store/GraphValueStore.cjs +76 -0
- package/lib/cjs/graph/store/GraphValueStore.cjs.map +1 -0
- package/lib/cjs/graph/store/GraphValueStoreAdapter.cjs +4 -0
- package/lib/cjs/graph/store/GraphValueStoreAdapter.cjs.map +1 -0
- package/lib/cjs/graph/store/InMemoryGraphValueStoreAdapter.cjs +69 -0
- package/lib/cjs/graph/store/InMemoryGraphValueStoreAdapter.cjs.map +1 -0
- package/lib/cjs/graph/store/index.cjs +28 -0
- package/lib/cjs/graph/store/index.cjs.map +1 -0
- package/lib/cjs/graph/types.cjs +4 -0
- package/lib/cjs/graph/types.cjs.map +1 -0
- package/lib/cjs/graph/validation/GraphDefinitionValidator.cjs +33 -0
- package/lib/cjs/graph/validation/GraphDefinitionValidator.cjs.map +1 -0
- package/lib/cjs/graph/validation/GraphPortSchemaResolver.cjs +58 -0
- package/lib/cjs/graph/validation/GraphPortSchemaResolver.cjs.map +1 -0
- package/lib/cjs/graph/validation/GraphValueValidator.cjs +52 -0
- package/lib/cjs/graph/validation/GraphValueValidator.cjs.map +1 -0
- package/lib/cjs/graph/validation/index.cjs +26 -0
- package/lib/cjs/graph/validation/index.cjs.map +1 -0
- package/lib/cjs/index.cjs +3 -3
- package/lib/cjs/keycloak/services/KeycloakAuthService.cjs +2 -5
- package/lib/cjs/keycloak/services/KeycloakAuthService.cjs.map +1 -1
- package/lib/cjs/keycloak/services/KeycloakClientService.cjs +2 -5
- package/lib/cjs/keycloak/services/KeycloakClientService.cjs.map +1 -1
- package/lib/cjs/keycloak/services/KeycloakIdentityProviderService.cjs +2 -5
- package/lib/cjs/keycloak/services/KeycloakIdentityProviderService.cjs.map +1 -1
- package/lib/cjs/keycloak/services/KeycloakRealmService.cjs +5 -18
- package/lib/cjs/keycloak/services/KeycloakRealmService.cjs.map +1 -1
- package/lib/cjs/keycloak/services/KeycloakRoleService.cjs +2 -5
- package/lib/cjs/keycloak/services/KeycloakRoleService.cjs.map +1 -1
- package/lib/cjs/keycloak/services/KeycloakService.cjs +1 -1
- package/lib/cjs/keycloak/services/KeycloakService.cjs.map +1 -1
- package/lib/cjs/keycloak/services/KeycloakUserService.cjs +2 -5
- package/lib/cjs/keycloak/services/KeycloakUserService.cjs.map +1 -1
- package/lib/cjs/kibana/services/KibanaAuthService.cjs +3 -6
- package/lib/cjs/kibana/services/KibanaAuthService.cjs.map +1 -1
- package/lib/cjs/kibana/services/KibanaDashboardService.cjs +6 -18
- package/lib/cjs/kibana/services/KibanaDashboardService.cjs.map +1 -1
- package/lib/cjs/kibana/services/KibanaDataViewService.cjs +4 -16
- package/lib/cjs/kibana/services/KibanaDataViewService.cjs.map +1 -1
- package/lib/cjs/kibana/services/KibanaRoleService.cjs +2 -5
- package/lib/cjs/kibana/services/KibanaRoleService.cjs.map +1 -1
- package/lib/cjs/kibana/services/KibanaSpaceService.cjs +2 -5
- package/lib/cjs/kibana/services/KibanaSpaceService.cjs.map +1 -1
- package/lib/cjs/kibana/services/KibanaUserService.cjs +2 -5
- package/lib/cjs/kibana/services/KibanaUserService.cjs.map +1 -1
- package/lib/cjs/shared/runtime.cjs +26 -0
- package/lib/cjs/shared/runtime.cjs.map +1 -0
- package/lib/esm/graph/constants.js +106 -0
- package/lib/esm/graph/constants.js.map +1 -0
- package/lib/esm/graph/decorators.js +2 -0
- package/lib/esm/graph/decorators.js.map +1 -0
- package/lib/esm/graph/errors/GraphCycleError.js +15 -0
- package/lib/esm/graph/errors/GraphCycleError.js.map +1 -0
- package/lib/esm/graph/errors/GraphExecutionError.js +22 -0
- package/lib/esm/graph/errors/GraphExecutionError.js.map +1 -0
- package/lib/esm/graph/errors/GraphInputError.js +15 -0
- package/lib/esm/graph/errors/GraphInputError.js.map +1 -0
- package/lib/esm/graph/errors/GraphLoopLimitError.js +15 -0
- package/lib/esm/graph/errors/GraphLoopLimitError.js.map +1 -0
- package/lib/esm/graph/errors/GraphPinningError.js +15 -0
- package/lib/esm/graph/errors/GraphPinningError.js.map +1 -0
- package/lib/esm/graph/errors/GraphPortError.js +15 -0
- package/lib/esm/graph/errors/GraphPortError.js.map +1 -0
- package/lib/esm/graph/errors/GraphStoreError.js +15 -0
- package/lib/esm/graph/errors/GraphStoreError.js.map +1 -0
- package/lib/esm/graph/errors/GraphTopologyError.js +15 -0
- package/lib/esm/graph/errors/GraphTopologyError.js.map +1 -0
- package/lib/esm/graph/errors/index.js +14 -0
- package/lib/esm/graph/errors/index.js.map +1 -0
- package/lib/esm/graph/events/GraphExecutionEvent.js +2 -0
- package/lib/esm/graph/events/GraphExecutionEvent.js.map +1 -0
- package/lib/esm/graph/events/GraphExecutionEventEmitter.js +35 -0
- package/lib/esm/graph/events/GraphExecutionEventEmitter.js.map +1 -0
- package/lib/esm/graph/events/GraphExecutionEventFactory.js +32 -0
- package/lib/esm/graph/events/GraphExecutionEventFactory.js.map +1 -0
- package/lib/esm/graph/events/GraphExecutionObserver.js +2 -0
- package/lib/esm/graph/events/GraphExecutionObserver.js.map +1 -0
- package/lib/esm/graph/events/index.js +10 -0
- package/lib/esm/graph/events/index.js.map +1 -0
- package/lib/esm/graph/execution/GraphExecutionContext.js +74 -0
- package/lib/esm/graph/execution/GraphExecutionContext.js.map +1 -0
- package/lib/esm/graph/execution/GraphExecutionEngine.js +400 -0
- package/lib/esm/graph/execution/GraphExecutionEngine.js.map +1 -0
- package/lib/esm/graph/execution/GraphExecutionFrame.js +27 -0
- package/lib/esm/graph/execution/GraphExecutionFrame.js.map +1 -0
- package/lib/esm/graph/execution/GraphExecutionResult.js +26 -0
- package/lib/esm/graph/execution/GraphExecutionResult.js.map +1 -0
- package/lib/esm/graph/execution/GraphNodeExecutor.js +2 -0
- package/lib/esm/graph/execution/GraphNodeExecutor.js.map +1 -0
- package/lib/esm/graph/execution/index.js +11 -0
- package/lib/esm/graph/execution/index.js.map +1 -0
- package/lib/esm/graph/index.js +57 -0
- package/lib/esm/graph/index.js.map +1 -0
- package/lib/esm/graph/loops/ForeachGraphNodeExecutor.js +79 -0
- package/lib/esm/graph/loops/ForeachGraphNodeExecutor.js.map +1 -0
- package/lib/esm/graph/loops/GraphConditionEvaluator.js +58 -0
- package/lib/esm/graph/loops/GraphConditionEvaluator.js.map +1 -0
- package/lib/esm/graph/loops/GraphLoopExecutionContext.js +11 -0
- package/lib/esm/graph/loops/GraphLoopExecutionContext.js.map +1 -0
- package/lib/esm/graph/loops/UntilGraphNodeExecutor.js +71 -0
- package/lib/esm/graph/loops/UntilGraphNodeExecutor.js.map +1 -0
- package/lib/esm/graph/loops/WhileGraphNodeExecutor.js +72 -0
- package/lib/esm/graph/loops/WhileGraphNodeExecutor.js.map +1 -0
- package/lib/esm/graph/loops/index.js +11 -0
- package/lib/esm/graph/loops/index.js.map +1 -0
- package/lib/esm/graph/pinning/GraphPinningDependencyResolver.js +23 -0
- package/lib/esm/graph/pinning/GraphPinningDependencyResolver.js.map +1 -0
- package/lib/esm/graph/pinning/GraphPinningMetadata.js +15 -0
- package/lib/esm/graph/pinning/GraphPinningMetadata.js.map +1 -0
- package/lib/esm/graph/pinning/GraphPinningPolicy.js +29 -0
- package/lib/esm/graph/pinning/GraphPinningPolicy.js.map +1 -0
- package/lib/esm/graph/pinning/GraphPinningService.js +186 -0
- package/lib/esm/graph/pinning/GraphPinningService.js.map +1 -0
- package/lib/esm/graph/pinning/index.js +10 -0
- package/lib/esm/graph/pinning/index.js.map +1 -0
- package/lib/esm/graph/planning/GraphExecutionPlan.js +2 -0
- package/lib/esm/graph/planning/GraphExecutionPlan.js.map +1 -0
- package/lib/esm/graph/planning/GraphExecutionPlanEdge.js +7 -0
- package/lib/esm/graph/planning/GraphExecutionPlanEdge.js.map +1 -0
- package/lib/esm/graph/planning/GraphExecutionPlanLayer.js +2 -0
- package/lib/esm/graph/planning/GraphExecutionPlanLayer.js.map +1 -0
- package/lib/esm/graph/planning/GraphExecutionPlanNode.js +2 -0
- package/lib/esm/graph/planning/GraphExecutionPlanNode.js.map +1 -0
- package/lib/esm/graph/planning/GraphExecutionPlanner.js +192 -0
- package/lib/esm/graph/planning/GraphExecutionPlanner.js.map +1 -0
- package/lib/esm/graph/planning/GraphRelationResolver.js +167 -0
- package/lib/esm/graph/planning/GraphRelationResolver.js.map +1 -0
- package/lib/esm/graph/planning/GraphTopology.js +52 -0
- package/lib/esm/graph/planning/GraphTopology.js.map +1 -0
- package/lib/esm/graph/planning/index.js +13 -0
- package/lib/esm/graph/planning/index.js.map +1 -0
- package/lib/esm/graph/registry/GraphNodeExecutorRegistry.js +39 -0
- package/lib/esm/graph/registry/GraphNodeExecutorRegistry.js.map +1 -0
- package/lib/esm/graph/registry/GraphNodeExecutorResolver.js +22 -0
- package/lib/esm/graph/registry/GraphNodeExecutorResolver.js.map +1 -0
- package/lib/esm/graph/registry/index.js +8 -0
- package/lib/esm/graph/registry/index.js.map +1 -0
- package/lib/esm/graph/snapshots/GraphExecutionSnapshotMapper.js +48 -0
- package/lib/esm/graph/snapshots/GraphExecutionSnapshotMapper.js.map +1 -0
- package/lib/esm/graph/snapshots/index.js +7 -0
- package/lib/esm/graph/snapshots/index.js.map +1 -0
- package/lib/esm/graph/store/GraphCachedValue.js +2 -0
- package/lib/esm/graph/store/GraphCachedValue.js.map +1 -0
- package/lib/esm/graph/store/GraphValueKey.js +7 -0
- package/lib/esm/graph/store/GraphValueKey.js.map +1 -0
- package/lib/esm/graph/store/GraphValueStore.js +71 -0
- package/lib/esm/graph/store/GraphValueStore.js.map +1 -0
- package/lib/esm/graph/store/GraphValueStoreAdapter.js +2 -0
- package/lib/esm/graph/store/GraphValueStoreAdapter.js.map +1 -0
- package/lib/esm/graph/store/InMemoryGraphValueStoreAdapter.js +64 -0
- package/lib/esm/graph/store/InMemoryGraphValueStoreAdapter.js.map +1 -0
- package/lib/esm/graph/store/index.js +11 -0
- package/lib/esm/graph/store/index.js.map +1 -0
- package/lib/esm/graph/types.js +2 -0
- package/lib/esm/graph/types.js.map +1 -0
- package/lib/esm/graph/validation/GraphDefinitionValidator.js +28 -0
- package/lib/esm/graph/validation/GraphDefinitionValidator.js.map +1 -0
- package/lib/esm/graph/validation/GraphPortSchemaResolver.js +53 -0
- package/lib/esm/graph/validation/GraphPortSchemaResolver.js.map +1 -0
- package/lib/esm/graph/validation/GraphValueValidator.js +47 -0
- package/lib/esm/graph/validation/GraphValueValidator.js.map +1 -0
- package/lib/esm/graph/validation/index.js +9 -0
- package/lib/esm/graph/validation/index.js.map +1 -0
- package/lib/esm/index.js +3 -3
- package/lib/esm/keycloak/services/KeycloakAuthService.js +2 -5
- package/lib/esm/keycloak/services/KeycloakAuthService.js.map +1 -1
- package/lib/esm/keycloak/services/KeycloakClientService.js +2 -5
- package/lib/esm/keycloak/services/KeycloakClientService.js.map +1 -1
- package/lib/esm/keycloak/services/KeycloakIdentityProviderService.js +2 -5
- package/lib/esm/keycloak/services/KeycloakIdentityProviderService.js.map +1 -1
- package/lib/esm/keycloak/services/KeycloakRealmService.js +5 -18
- package/lib/esm/keycloak/services/KeycloakRealmService.js.map +1 -1
- package/lib/esm/keycloak/services/KeycloakRoleService.js +2 -5
- package/lib/esm/keycloak/services/KeycloakRoleService.js.map +1 -1
- package/lib/esm/keycloak/services/KeycloakService.js +1 -1
- package/lib/esm/keycloak/services/KeycloakService.js.map +1 -1
- package/lib/esm/keycloak/services/KeycloakUserService.js +2 -5
- package/lib/esm/keycloak/services/KeycloakUserService.js.map +1 -1
- package/lib/esm/kibana/services/KibanaAuthService.js +3 -6
- package/lib/esm/kibana/services/KibanaAuthService.js.map +1 -1
- package/lib/esm/kibana/services/KibanaDashboardService.js +6 -18
- package/lib/esm/kibana/services/KibanaDashboardService.js.map +1 -1
- package/lib/esm/kibana/services/KibanaDataViewService.js +4 -16
- package/lib/esm/kibana/services/KibanaDataViewService.js.map +1 -1
- package/lib/esm/kibana/services/KibanaRoleService.js +2 -5
- package/lib/esm/kibana/services/KibanaRoleService.js.map +1 -1
- package/lib/esm/kibana/services/KibanaSpaceService.js +2 -5
- package/lib/esm/kibana/services/KibanaSpaceService.js.map +1 -1
- package/lib/esm/kibana/services/KibanaUserService.js +2 -5
- package/lib/esm/kibana/services/KibanaUserService.js.map +1 -1
- package/lib/esm/shared/runtime.js +21 -0
- package/lib/esm/shared/runtime.js.map +1 -0
- package/lib/types/graph/constants.d.cts +101 -0
- package/lib/types/graph/constants.d.mts +101 -0
- package/lib/types/graph/decorators.d.cts +6 -0
- package/lib/types/graph/decorators.d.mts +6 -0
- package/lib/types/graph/errors/GraphCycleError.d.cts +12 -0
- package/lib/types/graph/errors/GraphCycleError.d.mts +12 -0
- package/lib/types/graph/errors/GraphExecutionError.d.cts +19 -0
- package/lib/types/graph/errors/GraphExecutionError.d.mts +19 -0
- package/lib/types/graph/errors/GraphInputError.d.cts +12 -0
- package/lib/types/graph/errors/GraphInputError.d.mts +12 -0
- package/lib/types/graph/errors/GraphLoopLimitError.d.cts +12 -0
- package/lib/types/graph/errors/GraphLoopLimitError.d.mts +12 -0
- package/lib/types/graph/errors/GraphPinningError.d.cts +12 -0
- package/lib/types/graph/errors/GraphPinningError.d.mts +12 -0
- package/lib/types/graph/errors/GraphPortError.d.cts +12 -0
- package/lib/types/graph/errors/GraphPortError.d.mts +12 -0
- package/lib/types/graph/errors/GraphStoreError.d.cts +12 -0
- package/lib/types/graph/errors/GraphStoreError.d.mts +12 -0
- package/lib/types/graph/errors/GraphTopologyError.d.cts +12 -0
- package/lib/types/graph/errors/GraphTopologyError.d.mts +12 -0
- package/lib/types/graph/errors/index.d.cts +13 -0
- package/lib/types/graph/errors/index.d.mts +13 -0
- package/lib/types/graph/events/GraphExecutionEvent.d.cts +6 -0
- package/lib/types/graph/events/GraphExecutionEvent.d.mts +6 -0
- package/lib/types/graph/events/GraphExecutionEventEmitter.d.cts +26 -0
- package/lib/types/graph/events/GraphExecutionEventEmitter.d.mts +26 -0
- package/lib/types/graph/events/GraphExecutionEventFactory.d.cts +25 -0
- package/lib/types/graph/events/GraphExecutionEventFactory.d.mts +25 -0
- package/lib/types/graph/events/GraphExecutionObserver.d.cts +17 -0
- package/lib/types/graph/events/GraphExecutionObserver.d.mts +17 -0
- package/lib/types/graph/events/index.d.cts +9 -0
- package/lib/types/graph/events/index.d.mts +9 -0
- package/lib/types/graph/execution/GraphExecutionContext.d.cts +50 -0
- package/lib/types/graph/execution/GraphExecutionContext.d.mts +50 -0
- package/lib/types/graph/execution/GraphExecutionEngine.d.cts +112 -0
- package/lib/types/graph/execution/GraphExecutionEngine.d.mts +112 -0
- package/lib/types/graph/execution/GraphExecutionFrame.d.cts +29 -0
- package/lib/types/graph/execution/GraphExecutionFrame.d.mts +29 -0
- package/lib/types/graph/execution/GraphExecutionResult.d.cts +13 -0
- package/lib/types/graph/execution/GraphExecutionResult.d.mts +13 -0
- package/lib/types/graph/execution/GraphNodeExecutor.d.cts +23 -0
- package/lib/types/graph/execution/GraphNodeExecutor.d.mts +23 -0
- package/lib/types/graph/execution/index.d.cts +10 -0
- package/lib/types/graph/execution/index.d.mts +10 -0
- package/lib/types/graph/index.d.cts +52 -0
- package/lib/types/graph/index.d.mts +52 -0
- package/lib/types/graph/loops/ForeachGraphNodeExecutor.d.cts +27 -0
- package/lib/types/graph/loops/ForeachGraphNodeExecutor.d.mts +27 -0
- package/lib/types/graph/loops/GraphConditionEvaluator.d.cts +23 -0
- package/lib/types/graph/loops/GraphConditionEvaluator.d.mts +23 -0
- package/lib/types/graph/loops/GraphLoopExecutionContext.d.cts +15 -0
- package/lib/types/graph/loops/GraphLoopExecutionContext.d.mts +15 -0
- package/lib/types/graph/loops/UntilGraphNodeExecutor.d.cts +22 -0
- package/lib/types/graph/loops/UntilGraphNodeExecutor.d.mts +22 -0
- package/lib/types/graph/loops/WhileGraphNodeExecutor.d.cts +26 -0
- package/lib/types/graph/loops/WhileGraphNodeExecutor.d.mts +26 -0
- package/lib/types/graph/loops/index.d.cts +10 -0
- package/lib/types/graph/loops/index.d.mts +10 -0
- package/lib/types/graph/pinning/GraphPinningDependencyResolver.d.cts +21 -0
- package/lib/types/graph/pinning/GraphPinningDependencyResolver.d.mts +21 -0
- package/lib/types/graph/pinning/GraphPinningMetadata.d.cts +14 -0
- package/lib/types/graph/pinning/GraphPinningMetadata.d.mts +14 -0
- package/lib/types/graph/pinning/GraphPinningPolicy.d.cts +20 -0
- package/lib/types/graph/pinning/GraphPinningPolicy.d.mts +20 -0
- package/lib/types/graph/pinning/GraphPinningService.d.cts +59 -0
- package/lib/types/graph/pinning/GraphPinningService.d.mts +59 -0
- package/lib/types/graph/pinning/index.d.cts +9 -0
- package/lib/types/graph/pinning/index.d.mts +9 -0
- package/lib/types/graph/planning/GraphExecutionPlan.d.cts +21 -0
- package/lib/types/graph/planning/GraphExecutionPlan.d.mts +21 -0
- package/lib/types/graph/planning/GraphExecutionPlanEdge.d.cts +21 -0
- package/lib/types/graph/planning/GraphExecutionPlanEdge.d.mts +21 -0
- package/lib/types/graph/planning/GraphExecutionPlanLayer.d.cts +13 -0
- package/lib/types/graph/planning/GraphExecutionPlanLayer.d.mts +13 -0
- package/lib/types/graph/planning/GraphExecutionPlanNode.d.cts +20 -0
- package/lib/types/graph/planning/GraphExecutionPlanNode.d.mts +20 -0
- package/lib/types/graph/planning/GraphExecutionPlanner.d.cts +60 -0
- package/lib/types/graph/planning/GraphExecutionPlanner.d.mts +60 -0
- package/lib/types/graph/planning/GraphRelationResolver.d.cts +62 -0
- package/lib/types/graph/planning/GraphRelationResolver.d.mts +62 -0
- package/lib/types/graph/planning/GraphTopology.d.cts +23 -0
- package/lib/types/graph/planning/GraphTopology.d.mts +23 -0
- package/lib/types/graph/planning/index.d.cts +12 -0
- package/lib/types/graph/planning/index.d.mts +12 -0
- package/lib/types/graph/registry/GraphNodeExecutorRegistry.d.cts +25 -0
- package/lib/types/graph/registry/GraphNodeExecutorRegistry.d.mts +25 -0
- package/lib/types/graph/registry/GraphNodeExecutorResolver.d.cts +21 -0
- package/lib/types/graph/registry/GraphNodeExecutorResolver.d.mts +21 -0
- package/lib/types/graph/registry/index.d.cts +7 -0
- package/lib/types/graph/registry/index.d.mts +7 -0
- package/lib/types/graph/snapshots/GraphExecutionSnapshotMapper.d.cts +10 -0
- package/lib/types/graph/snapshots/GraphExecutionSnapshotMapper.d.mts +10 -0
- package/lib/types/graph/snapshots/index.d.cts +6 -0
- package/lib/types/graph/snapshots/index.d.mts +6 -0
- package/lib/types/graph/store/GraphCachedValue.d.cts +20 -0
- package/lib/types/graph/store/GraphCachedValue.d.mts +20 -0
- package/lib/types/graph/store/GraphValueKey.d.cts +18 -0
- package/lib/types/graph/store/GraphValueKey.d.mts +18 -0
- package/lib/types/graph/store/GraphValueStore.d.cts +41 -0
- package/lib/types/graph/store/GraphValueStore.d.mts +41 -0
- package/lib/types/graph/store/GraphValueStoreAdapter.d.cts +32 -0
- package/lib/types/graph/store/GraphValueStoreAdapter.d.mts +32 -0
- package/lib/types/graph/store/InMemoryGraphValueStoreAdapter.d.cts +33 -0
- package/lib/types/graph/store/InMemoryGraphValueStoreAdapter.d.mts +33 -0
- package/lib/types/graph/store/index.d.cts +10 -0
- package/lib/types/graph/store/index.d.mts +10 -0
- package/lib/types/graph/types.d.cts +197 -0
- package/lib/types/graph/types.d.mts +197 -0
- package/lib/types/graph/validation/GraphDefinitionValidator.d.cts +21 -0
- package/lib/types/graph/validation/GraphDefinitionValidator.d.mts +21 -0
- package/lib/types/graph/validation/GraphPortSchemaResolver.d.cts +39 -0
- package/lib/types/graph/validation/GraphPortSchemaResolver.d.mts +39 -0
- package/lib/types/graph/validation/GraphValueValidator.d.cts +27 -0
- package/lib/types/graph/validation/GraphValueValidator.d.mts +27 -0
- package/lib/types/graph/validation/index.d.cts +8 -0
- package/lib/types/graph/validation/index.d.mts +8 -0
- package/lib/types/index.d.cts +2 -2
- package/lib/types/index.d.mts +2 -2
- package/lib/types/keycloak/services/KeycloakAuthService.d.cts +0 -1
- package/lib/types/keycloak/services/KeycloakAuthService.d.mts +0 -1
- package/lib/types/keycloak/services/KeycloakClientService.d.cts +0 -1
- package/lib/types/keycloak/services/KeycloakClientService.d.mts +0 -1
- package/lib/types/keycloak/services/KeycloakIdentityProviderService.d.cts +0 -1
- package/lib/types/keycloak/services/KeycloakIdentityProviderService.d.mts +0 -1
- package/lib/types/keycloak/services/KeycloakRealmService.d.cts +0 -2
- package/lib/types/keycloak/services/KeycloakRealmService.d.mts +0 -2
- package/lib/types/keycloak/services/KeycloakRoleService.d.cts +0 -1
- package/lib/types/keycloak/services/KeycloakRoleService.d.mts +0 -1
- package/lib/types/keycloak/services/KeycloakUserService.d.cts +0 -1
- package/lib/types/keycloak/services/KeycloakUserService.d.mts +0 -1
- package/lib/types/keycloak/types.d.cts +4 -1
- package/lib/types/keycloak/types.d.mts +4 -1
- package/lib/types/kibana/services/KibanaAuthService.d.cts +0 -1
- package/lib/types/kibana/services/KibanaAuthService.d.mts +0 -1
- package/lib/types/kibana/services/KibanaDashboardService.d.cts +0 -2
- package/lib/types/kibana/services/KibanaDashboardService.d.mts +0 -2
- package/lib/types/kibana/services/KibanaDataViewService.d.cts +0 -2
- package/lib/types/kibana/services/KibanaDataViewService.d.mts +0 -2
- package/lib/types/kibana/services/KibanaRoleService.d.cts +0 -1
- package/lib/types/kibana/services/KibanaRoleService.d.mts +0 -1
- package/lib/types/kibana/services/KibanaSpaceService.d.cts +0 -1
- package/lib/types/kibana/services/KibanaSpaceService.d.mts +0 -1
- package/lib/types/kibana/services/KibanaUserService.d.cts +0 -1
- package/lib/types/kibana/services/KibanaUserService.d.mts +0 -1
- package/lib/types/kibana/types.d.cts +4 -1
- package/lib/types/kibana/types.d.mts +4 -1
- package/lib/types/shared/runtime.d.cts +2 -0
- package/lib/types/shared/runtime.d.mts +2 -0
- package/package.json +21 -7
|
@@ -0,0 +1,191 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.GraphPinningService = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* @module integrations/graph/pinning/GraphPinningService
|
|
6
|
+
* @summary Service for pinning and unpinning graph node values.
|
|
7
|
+
* @description Computes stable fingerprints, pins/unpins nodes and their upstream dependencies, reads pinned values, and emits pinning events. Pinning is all-or-nothing: if any upstream dependency is not pinnable, the operation fails.
|
|
8
|
+
*/
|
|
9
|
+
const constants_js_1 = require("./../constants.cjs");
|
|
10
|
+
const GraphPinningError_js_1 = require("./../errors/GraphPinningError.cjs");
|
|
11
|
+
const GraphTopology_js_1 = require("./../planning/GraphTopology.cjs");
|
|
12
|
+
/**
|
|
13
|
+
* Service that manages pinning and unpinning of graph node values.
|
|
14
|
+
*/
|
|
15
|
+
class GraphPinningService {
|
|
16
|
+
constructor(store, policy, dependencyResolver) {
|
|
17
|
+
this.store = store;
|
|
18
|
+
this.policy = policy;
|
|
19
|
+
this.dependencyResolver = dependencyResolver;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Pins a node and all its upstream dependencies.
|
|
23
|
+
*
|
|
24
|
+
* @throws {GraphPinningError} when the node or any dependency is not pinnable.
|
|
25
|
+
*/
|
|
26
|
+
async pinNode(options) {
|
|
27
|
+
const plan = options.plan;
|
|
28
|
+
const includeDependencies = options.includeDependencies ?? true;
|
|
29
|
+
const pinSet = includeDependencies
|
|
30
|
+
? this.dependencyResolver.getPinSet(plan, options.nodeId)
|
|
31
|
+
: new Set([options.nodeId]);
|
|
32
|
+
// Validate all-or-nothing
|
|
33
|
+
for (const nodeId of pinSet) {
|
|
34
|
+
const node = plan.nodes.find((n) => n.id === nodeId);
|
|
35
|
+
if (!node) {
|
|
36
|
+
throw new GraphPinningError_js_1.GraphPinningError(`Node '${nodeId}' not found in plan`);
|
|
37
|
+
}
|
|
38
|
+
if (!this.policy.canPin(node)) {
|
|
39
|
+
throw new GraphPinningError_js_1.GraphPinningError(`Node '${nodeId}' is not pinnable`, { nodeId });
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
// Pin dependencies first, then the selected node
|
|
43
|
+
const ordered = this.topologicalOrder(plan, pinSet);
|
|
44
|
+
for (const nodeId of ordered) {
|
|
45
|
+
const node = plan.nodes.find((n) => n.id === nodeId);
|
|
46
|
+
const result = options.result.nodeResults[nodeId];
|
|
47
|
+
if (!result || !result.outputs) {
|
|
48
|
+
throw new GraphPinningError_js_1.GraphPinningError(`Node '${nodeId}' has no completed output to pin`);
|
|
49
|
+
}
|
|
50
|
+
const inputs = result.inputs ?? {};
|
|
51
|
+
const depFingerprints = this.dependencyFingerprints(plan, nodeId, options.result);
|
|
52
|
+
const key = this.createValueKey(options.workflow, node, inputs, depFingerprints, options.namespace);
|
|
53
|
+
const now = new Date().toISOString();
|
|
54
|
+
const cached = {
|
|
55
|
+
key,
|
|
56
|
+
outputs: result.outputs,
|
|
57
|
+
pinned: true,
|
|
58
|
+
createdAt: now,
|
|
59
|
+
updatedAt: now,
|
|
60
|
+
metadata: { ...options.result.metadata, nodeId },
|
|
61
|
+
};
|
|
62
|
+
await this.store.writeCached(key, cached);
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* Unpins a single node (does not unpin dependents in v1).
|
|
67
|
+
*/
|
|
68
|
+
async unpinNode(options) {
|
|
69
|
+
const key = {
|
|
70
|
+
workflowId: options.workflow.name,
|
|
71
|
+
nodeId: options.nodeId,
|
|
72
|
+
fingerprint: options.fingerprint,
|
|
73
|
+
namespace: options.namespace,
|
|
74
|
+
};
|
|
75
|
+
await this.store.deleteCached(key);
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* Reads a pinned value for a node, returning `undefined` when no valid
|
|
79
|
+
* pinned value exists.
|
|
80
|
+
*/
|
|
81
|
+
async readPinnedValue(workflow, node, inputs, dependencyFingerprints, namespace) {
|
|
82
|
+
const key = this.createValueKey(workflow, node, inputs, dependencyFingerprints, namespace);
|
|
83
|
+
const cached = await this.store.readCached(key);
|
|
84
|
+
if (cached && cached.pinned) {
|
|
85
|
+
if (cached.expiresAt && new Date(cached.expiresAt) < new Date()) {
|
|
86
|
+
return undefined;
|
|
87
|
+
}
|
|
88
|
+
return cached;
|
|
89
|
+
}
|
|
90
|
+
return undefined;
|
|
91
|
+
}
|
|
92
|
+
/**
|
|
93
|
+
* Creates a stable value key for a node.
|
|
94
|
+
*/
|
|
95
|
+
createValueKey(workflow, node, inputs, dependencyFingerprints, namespace) {
|
|
96
|
+
return {
|
|
97
|
+
workflowId: workflow.name,
|
|
98
|
+
nodeId: node.id,
|
|
99
|
+
fingerprint: this.computeFingerprint(workflow, node, inputs, dependencyFingerprints),
|
|
100
|
+
namespace,
|
|
101
|
+
};
|
|
102
|
+
}
|
|
103
|
+
/**
|
|
104
|
+
* Computes a stable fingerprint for a node's inputs and dependencies.
|
|
105
|
+
*/
|
|
106
|
+
computeFingerprint(workflow, node, inputs, dependencyFingerprints) {
|
|
107
|
+
const data = {
|
|
108
|
+
workflowId: workflow.name,
|
|
109
|
+
nodeId: node.id,
|
|
110
|
+
nodeKind: node.kind,
|
|
111
|
+
nodeDefinitionVersion: node.definition?.graph?.metadata?.version,
|
|
112
|
+
inputs: this.stableSerialize(inputs),
|
|
113
|
+
dependencyFingerprints: this.stableSerialize(dependencyFingerprints),
|
|
114
|
+
};
|
|
115
|
+
const json = this.stableSerialize(data);
|
|
116
|
+
// Use a deterministic non-cryptographic hash that works in both browser
|
|
117
|
+
// and Node environments without requiring `node:crypto`.
|
|
118
|
+
return this.simpleHash(json);
|
|
119
|
+
}
|
|
120
|
+
/**
|
|
121
|
+
* Returns a topological ordering of the given node set.
|
|
122
|
+
*/
|
|
123
|
+
topologicalOrder(plan, nodeSet) {
|
|
124
|
+
const result = [];
|
|
125
|
+
const visited = new Set();
|
|
126
|
+
const visit = (nodeId) => {
|
|
127
|
+
if (visited.has(nodeId))
|
|
128
|
+
return;
|
|
129
|
+
visited.add(nodeId);
|
|
130
|
+
const deps = GraphTopology_js_1.GraphTopology.upstreamNodes(nodeId, plan.incomingByNode, false);
|
|
131
|
+
for (const dep of deps) {
|
|
132
|
+
if (nodeSet.has(dep))
|
|
133
|
+
visit(dep);
|
|
134
|
+
}
|
|
135
|
+
result.push(nodeId);
|
|
136
|
+
};
|
|
137
|
+
for (const nodeId of nodeSet)
|
|
138
|
+
visit(nodeId);
|
|
139
|
+
return result;
|
|
140
|
+
}
|
|
141
|
+
/**
|
|
142
|
+
* Computes fingerprints for all upstream dependencies of a node.
|
|
143
|
+
*/
|
|
144
|
+
dependencyFingerprints(plan, nodeId, result) {
|
|
145
|
+
const deps = this.dependencyResolver.getDependencies(plan, nodeId);
|
|
146
|
+
const fingerprints = {};
|
|
147
|
+
for (const dep of deps) {
|
|
148
|
+
const node = plan.nodes.find((n) => n.id === dep);
|
|
149
|
+
if (node) {
|
|
150
|
+
const depResult = result.nodeResults[dep];
|
|
151
|
+
const inputs = depResult?.inputs ?? {};
|
|
152
|
+
const nestedDeps = this.dependencyFingerprints(plan, dep, result);
|
|
153
|
+
fingerprints[dep] = this.computeFingerprint(plan.workflow, node, inputs, nestedDeps);
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
return fingerprints;
|
|
157
|
+
}
|
|
158
|
+
/**
|
|
159
|
+
* Serializes a value with recursively sorted keys for stable hashing.
|
|
160
|
+
*/
|
|
161
|
+
stableSerialize(value) {
|
|
162
|
+
if (value === null || typeof value !== "object") {
|
|
163
|
+
return JSON.stringify(value);
|
|
164
|
+
}
|
|
165
|
+
if (Array.isArray(value)) {
|
|
166
|
+
return `[${value.map((v) => this.stableSerialize(v)).join(",")}]`;
|
|
167
|
+
}
|
|
168
|
+
const keys = Object.keys(value).sort();
|
|
169
|
+
const pairs = keys.map((k) => `${JSON.stringify(k)}:${this.stableSerialize(value[k])}`);
|
|
170
|
+
return `{${pairs.join(",")}}`;
|
|
171
|
+
}
|
|
172
|
+
/**
|
|
173
|
+
* Simple non-cryptographic hash for browser environments where
|
|
174
|
+
* `node:crypto` is unavailable. Produces a deterministic hex-like string
|
|
175
|
+
* from the input. This is NOT cryptographically secure but is sufficient
|
|
176
|
+
* for fingerprint-based cache keys.
|
|
177
|
+
*/
|
|
178
|
+
simpleHash(str) {
|
|
179
|
+
let hash = 0;
|
|
180
|
+
for (let i = 0; i < str.length; i++) {
|
|
181
|
+
const char = str.charCodeAt(i);
|
|
182
|
+
hash = (hash << 5) - hash + char;
|
|
183
|
+
hash |= 0;
|
|
184
|
+
}
|
|
185
|
+
return `fp_${Math.abs(hash).toString(16).padStart(8, "0")}_${str.length}`;
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
exports.GraphPinningService = GraphPinningService;
|
|
189
|
+
void constants_js_1.GRAPH_PINNING_METADATA_KEY;
|
|
190
|
+
//# sourceMappingURL=GraphPinningService.js.map
|
|
191
|
+
//# sourceMappingURL=GraphPinningService.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"graph/pinning/GraphPinningService.cjs","sourceRoot":"","sources":["graph/pinning/GraphPinningService.js"],"names":[],"mappings":";;;AAAA;;;;GAIG;AACH,oDAA+D;AAC/D,2EAAqE;AACrE,qEAA+D;AAC/D;;GAEG;AACH,MAAa,mBAAmB;IAC5B,YAAY,KAAK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I,IAAI,CAAC,eAAe,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;QACxF,OAAO,IAAI,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC;IAClC,CAAC;IACD;;;;;OAKG;IACH,UAAU,CAAC,GAAG;QACV,IAAI,IAAI,GAAG,CAAC,CAAC;QACb,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,GAAG,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;YAClC,MAAM,IAAI,GAAG,GAAG,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC;YAC/B,IAAI,GAAG,CAAC,IAAI,IAAI,CAAC,CAAC,GAAG,IAAI,GAAG,IAAI,CAAC;YACjC,IAAI,IAAI,CAAC,CAAC;QACd,CAAC;QACD,OAAO,MAAM,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC,IAAI,GAAG,CAAC,MAAM,EAAE,CAAC;IAC9E,CAAC;CACJ;AA5KD,kDA4KC;AACD,KAAK,yCAA0B,CAAC;AAChC,+CAA+C"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
/**
|
|
18
|
+
* @module integrations/graph/pinning
|
|
19
|
+
* @summary Graph pinning subsystem.
|
|
20
|
+
* @description Re-exports the pinning metadata, policy, dependency resolver, and service.
|
|
21
|
+
*/
|
|
22
|
+
__exportStar(require("./GraphPinningMetadata.cjs"), exports);
|
|
23
|
+
__exportStar(require("./GraphPinningPolicy.cjs"), exports);
|
|
24
|
+
__exportStar(require("./GraphPinningDependencyResolver.cjs"), exports);
|
|
25
|
+
__exportStar(require("./GraphPinningService.cjs"), exports);
|
|
26
|
+
//# sourceMappingURL=index.js.map
|
|
27
|
+
//# sourceMappingURL=index.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"graph/pinning/index.cjs","sourceRoot":"","sources":["graph/pinning/index.js"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA;;;;GAIG;AACH,4DAA0C;AAC1C,0DAAwC;AACxC,sEAAoD;AACpD,2DAAyC;AACzC,iCAAiC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"graph/planning/GraphExecutionPlan.cjs","sourceRoot":"","sources":["graph/planning/GraphExecutionPlan.js"],"names":[],"mappings":";;AACA,8CAA8C"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"graph/planning/GraphExecutionPlanEdge.cjs","sourceRoot":"","sources":["graph/planning/GraphExecutionPlanEdge.js"],"names":[],"mappings":";;AAMA,kDAAkD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"graph/planning/GraphExecutionPlanLayer.cjs","sourceRoot":"","sources":["graph/planning/GraphExecutionPlanLayer.js"],"names":[],"mappings":";;AACA,mDAAmD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"graph/planning/GraphExecutionPlanNode.cjs","sourceRoot":"","sources":["graph/planning/GraphExecutionPlanNode.js"],"names":[],"mappings":";;AACA,kDAAkD"}
|
|
@@ -0,0 +1,197 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.GraphExecutionPlanner = void 0;
|
|
4
|
+
const graph_1 = require("@decaf-ts/ui-decorators/graph");
|
|
5
|
+
const constants_js_1 = require("./../constants.cjs");
|
|
6
|
+
const GraphCycleError_js_1 = require("./../errors/GraphCycleError.cjs");
|
|
7
|
+
const GraphTopologyError_js_1 = require("./../errors/GraphTopologyError.cjs");
|
|
8
|
+
const GraphRelationResolver_js_1 = require("./GraphRelationResolver.cjs");
|
|
9
|
+
/**
|
|
10
|
+
* Planner that turns a {@link GraphWorkflowDefinition} into a
|
|
11
|
+
* {@link GraphExecutionPlan} with topological layers.
|
|
12
|
+
*/
|
|
13
|
+
class GraphExecutionPlanner {
|
|
14
|
+
constructor(resolver) {
|
|
15
|
+
this.resolver = resolver ?? new GraphRelationResolver_js_1.GraphRelationResolver();
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Plans a workflow for execution.
|
|
19
|
+
*
|
|
20
|
+
* @param workflow - The workflow definition to plan.
|
|
21
|
+
* @returns The execution plan with nodes, edges, layers, and maps.
|
|
22
|
+
* @throws {GraphTopologyError} when node IDs are not unique.
|
|
23
|
+
* @throws {GraphCycleError} when the workflow contains an unsupported cycle.
|
|
24
|
+
*/
|
|
25
|
+
plan(workflow) {
|
|
26
|
+
this.validateUniqueNodeIds(workflow);
|
|
27
|
+
const nodes = this.resolveNodes(workflow);
|
|
28
|
+
const edges = this.resolver.resolve(workflow);
|
|
29
|
+
const incomingByNode = this.buildIncomingMap(edges);
|
|
30
|
+
const outgoingByNode = this.buildOutgoingMap(edges);
|
|
31
|
+
const layers = this.topologicalLayers(nodes, edges);
|
|
32
|
+
return {
|
|
33
|
+
workflow,
|
|
34
|
+
workflowId: workflow.name,
|
|
35
|
+
nodes,
|
|
36
|
+
edges,
|
|
37
|
+
layers,
|
|
38
|
+
incomingByNode,
|
|
39
|
+
outgoingByNode,
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Validates that all workflow node IDs are unique.
|
|
44
|
+
*/
|
|
45
|
+
validateUniqueNodeIds(workflow) {
|
|
46
|
+
const seen = new Set();
|
|
47
|
+
for (const node of workflow.nodes ?? []) {
|
|
48
|
+
if (seen.has(node.id)) {
|
|
49
|
+
throw new GraphTopologyError_js_1.GraphTopologyError(`Duplicate node id '${node.id}' in workflow '${workflow.name}'`, { nodeId: node.id, workflowId: workflow.name });
|
|
50
|
+
}
|
|
51
|
+
seen.add(node.id);
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Resolves workflow node metadata into plan nodes with full definitions.
|
|
56
|
+
*/
|
|
57
|
+
resolveNodes(workflow) {
|
|
58
|
+
const result = [];
|
|
59
|
+
for (const nodeMeta of workflow.nodes ?? []) {
|
|
60
|
+
const definition = this.resolveDefinition(nodeMeta);
|
|
61
|
+
const inputPorts = (definition.ports ?? [])
|
|
62
|
+
.filter((p) => p.direction === "input")
|
|
63
|
+
.map((p) => p.name);
|
|
64
|
+
const outputPorts = (definition.ports ?? [])
|
|
65
|
+
.filter((p) => p.direction === "output")
|
|
66
|
+
.map((p) => p.name);
|
|
67
|
+
result.push({
|
|
68
|
+
id: nodeMeta.id,
|
|
69
|
+
kind: nodeMeta.kind ?? definition.kind ?? nodeMeta.id,
|
|
70
|
+
label: nodeMeta.label,
|
|
71
|
+
source: nodeMeta,
|
|
72
|
+
definition,
|
|
73
|
+
inputPorts,
|
|
74
|
+
outputPorts,
|
|
75
|
+
metadata: nodeMeta.metadata,
|
|
76
|
+
});
|
|
77
|
+
}
|
|
78
|
+
return result;
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* Attempts to resolve the full graph node definition from metadata.
|
|
82
|
+
*
|
|
83
|
+
* Accepts either a decorated Model class/instance (resolved via
|
|
84
|
+
* `graphDefinitionOf`) or a plain `GraphNodeDefinition`-shaped object
|
|
85
|
+
* (useful for serialized workflows that inline node definitions).
|
|
86
|
+
*/
|
|
87
|
+
resolveDefinition(nodeMeta) {
|
|
88
|
+
if (nodeMeta.node) {
|
|
89
|
+
if (this.isRawDefinition(nodeMeta.node)) {
|
|
90
|
+
return nodeMeta.node;
|
|
91
|
+
}
|
|
92
|
+
try {
|
|
93
|
+
return (0, graph_1.graphDefinitionOf)(nodeMeta.node);
|
|
94
|
+
}
|
|
95
|
+
catch {
|
|
96
|
+
// fall through to stub
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
// Return a minimal stub definition so planning can proceed
|
|
100
|
+
return {
|
|
101
|
+
name: nodeMeta.id,
|
|
102
|
+
tag: nodeMeta.id,
|
|
103
|
+
kind: nodeMeta.kind ?? nodeMeta.id,
|
|
104
|
+
labels: [],
|
|
105
|
+
ports: [],
|
|
106
|
+
};
|
|
107
|
+
}
|
|
108
|
+
/**
|
|
109
|
+
* Returns `true` when a value looks like a raw {@link GraphNodeDefinition}
|
|
110
|
+
* (a plain object with a `ports` array and a `name` string).
|
|
111
|
+
*/
|
|
112
|
+
isRawDefinition(value) {
|
|
113
|
+
return (typeof value === "object" &&
|
|
114
|
+
value !== null &&
|
|
115
|
+
!Array.isArray(value) &&
|
|
116
|
+
typeof value.name === "string" &&
|
|
117
|
+
Array.isArray(value.ports));
|
|
118
|
+
}
|
|
119
|
+
/**
|
|
120
|
+
* Builds a map of node id -> incoming edges.
|
|
121
|
+
*/
|
|
122
|
+
buildIncomingMap(edges) {
|
|
123
|
+
const map = new Map();
|
|
124
|
+
for (const edge of edges) {
|
|
125
|
+
const list = map.get(edge.targetNodeId) ?? [];
|
|
126
|
+
list.push(edge);
|
|
127
|
+
map.set(edge.targetNodeId, list);
|
|
128
|
+
}
|
|
129
|
+
return map;
|
|
130
|
+
}
|
|
131
|
+
/**
|
|
132
|
+
* Builds a map of node id -> outgoing edges.
|
|
133
|
+
*/
|
|
134
|
+
buildOutgoingMap(edges) {
|
|
135
|
+
const map = new Map();
|
|
136
|
+
for (const edge of edges) {
|
|
137
|
+
const list = map.get(edge.sourceNodeId) ?? [];
|
|
138
|
+
list.push(edge);
|
|
139
|
+
map.set(edge.sourceNodeId, list);
|
|
140
|
+
}
|
|
141
|
+
return map;
|
|
142
|
+
}
|
|
143
|
+
/**
|
|
144
|
+
* Produces topological layers using Kahn's algorithm.
|
|
145
|
+
*
|
|
146
|
+
* Workflow boundary edges do not count as executable-node dependencies.
|
|
147
|
+
*/
|
|
148
|
+
topologicalLayers(nodes, edges) {
|
|
149
|
+
const executableNodes = nodes.filter((n) => n.id !== constants_js_1.GRAPH_WORKFLOW_BOUNDARY);
|
|
150
|
+
const nodeIds = new Set(executableNodes.map((n) => n.id));
|
|
151
|
+
// Only edges between two executable nodes count as dependencies
|
|
152
|
+
const execEdges = edges.filter((e) => nodeIds.has(e.sourceNodeId) && nodeIds.has(e.targetNodeId));
|
|
153
|
+
// Compute in-degree
|
|
154
|
+
const indegree = new Map();
|
|
155
|
+
for (const node of executableNodes)
|
|
156
|
+
indegree.set(node.id, 0);
|
|
157
|
+
for (const edge of execEdges) {
|
|
158
|
+
indegree.set(edge.targetNodeId, (indegree.get(edge.targetNodeId) ?? 0) + 1);
|
|
159
|
+
}
|
|
160
|
+
const layers = [];
|
|
161
|
+
const planned = new Set();
|
|
162
|
+
let ready = executableNodes.filter((n) => (indegree.get(n.id) ?? 0) === 0);
|
|
163
|
+
let layerIndex = 0;
|
|
164
|
+
while (ready.length > 0) {
|
|
165
|
+
const layer = { index: layerIndex++, nodes: ready };
|
|
166
|
+
layers.push(layer);
|
|
167
|
+
const nextReady = [];
|
|
168
|
+
for (const node of ready) {
|
|
169
|
+
planned.add(node.id);
|
|
170
|
+
const outgoing = execEdges.filter((e) => e.sourceNodeId === node.id);
|
|
171
|
+
for (const edge of outgoing) {
|
|
172
|
+
const deg = (indegree.get(edge.targetNodeId) ?? 1) - 1;
|
|
173
|
+
indegree.set(edge.targetNodeId, deg);
|
|
174
|
+
if (deg === 0 && !planned.has(edge.targetNodeId)) {
|
|
175
|
+
const next = executableNodes.find((n) => n.id === edge.targetNodeId);
|
|
176
|
+
if (next)
|
|
177
|
+
nextReady.push(next);
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
ready = nextReady;
|
|
182
|
+
}
|
|
183
|
+
if (planned.size !== executableNodes.length) {
|
|
184
|
+
const unplanned = executableNodes
|
|
185
|
+
.filter((n) => !planned.has(n.id))
|
|
186
|
+
.map((n) => n.id);
|
|
187
|
+
throw new GraphCycleError_js_1.GraphCycleError({
|
|
188
|
+
unplannedNodes: unplanned,
|
|
189
|
+
workflowId: nodes[0]?.definition?.name,
|
|
190
|
+
});
|
|
191
|
+
}
|
|
192
|
+
return layers;
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
exports.GraphExecutionPlanner = GraphExecutionPlanner;
|
|
196
|
+
//# sourceMappingURL=GraphExecutionPlanner.js.map
|
|
197
|
+
//# sourceMappingURL=GraphExecutionPlanner.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"graph/planning/GraphExecutionPlanner.cjs","sourceRoot":"","sources":["graph/planning/GraphExecutionPlanner.js"],"names":[],"mappings":";;;AAAA,yDAAkE;AAClE,oDAA4D;AAC5D,uEAAiE;AACjE,6EAAuE;AACvE,yEAAmE;AACnE;;;GAGG;AACH,MAAa,qBAAqB;IAC9B,YAAY,QAAQ;QAChB,IAAI,CAAC,QAAQ,GAAG,QAAQ,IAAI,IAAI,gDAAqB,EAAE,CAAC;IAC5D,CAAC;IACD;;;;;;;OAOG;IACH,IAAI,CAAC,QAAQ;QACT,IAAI,CAAC,qBAAqB,CAAC,QAAQ,CAAC,CAAC;QACrC,MAAM,KAAK,GAAG,IAAI,CAAC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AAC,CAAC,CAAC,EAAE,CAAC,CAAC;iBACjC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;YACtB,MAAM,IAAI,oCAAe,CAAC;gBACtB,cAAc,EAAE,SAAS;gBACzB,UAAU,EAAE,KAAK,CAAC,CAAC,CAAC,EAAE,UAAU,EAAE,IAAI;aACzC,CAAC,CAAC;QACP,CAAC;QACD,OAAO,MAAM,CAAC;IAClB,CAAC;CACJ;AArLD,sDAqLC;AACD,iDAAiD"}
|
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.GraphRelationResolver = void 0;
|
|
4
|
+
const graph_1 = require("@decaf-ts/ui-decorators/graph");
|
|
5
|
+
const constants_js_1 = require("./../constants.cjs");
|
|
6
|
+
const GraphPortError_js_1 = require("./../errors/GraphPortError.cjs");
|
|
7
|
+
const GraphTopologyError_js_1 = require("./../errors/GraphTopologyError.cjs");
|
|
8
|
+
/**
|
|
9
|
+
* Resolves raw workflow relation metadata into normalized execution edges.
|
|
10
|
+
*/
|
|
11
|
+
class GraphRelationResolver {
|
|
12
|
+
/**
|
|
13
|
+
* Resolves all relations of a workflow into execution edges.
|
|
14
|
+
*
|
|
15
|
+
* @param workflow - The workflow definition.
|
|
16
|
+
* @returns Array of normalized edges.
|
|
17
|
+
* @throws {GraphTopologyError} when an endpoint is unknown or ambiguous.
|
|
18
|
+
* @throws {GraphPortError} when a referenced port is missing or unknown.
|
|
19
|
+
*/
|
|
20
|
+
resolve(workflow) {
|
|
21
|
+
const nodeIds = new Set(workflow.nodes.map((n) => n.id));
|
|
22
|
+
const boundaryAliases = this.boundaryAliases(workflow);
|
|
23
|
+
const inputPorts = this.portNames(workflow.inputs);
|
|
24
|
+
const outputPorts = this.portNames(workflow.outputs);
|
|
25
|
+
const nodePortMap = this.buildNodePortMap(workflow);
|
|
26
|
+
const edges = [];
|
|
27
|
+
for (const relation of workflow.relations ?? []) {
|
|
28
|
+
const edge = this.resolveRelation(relation, nodeIds, boundaryAliases, inputPorts, outputPorts, nodePortMap);
|
|
29
|
+
edges.push(edge);
|
|
30
|
+
}
|
|
31
|
+
return edges;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Resolves a single relation into an edge.
|
|
35
|
+
*/
|
|
36
|
+
resolveRelation(relation, nodeIds, boundaryAliases, inputPorts, outputPorts, nodePortMap) {
|
|
37
|
+
const sourceNodeId = this.resolveEndpoint(relation.source, nodeIds, boundaryAliases);
|
|
38
|
+
const targetNodeId = this.resolveEndpoint(relation.target, nodeIds, boundaryAliases);
|
|
39
|
+
const sourcePort = relation.sourcePort;
|
|
40
|
+
const targetPort = relation.targetPort;
|
|
41
|
+
if (!sourcePort) {
|
|
42
|
+
throw new GraphPortError_js_1.GraphPortError(`Relation is missing sourcePort (source: ${String(relation.source)}, target: ${String(relation.target)})`, { relation });
|
|
43
|
+
}
|
|
44
|
+
if (!targetPort) {
|
|
45
|
+
throw new GraphPortError_js_1.GraphPortError(`Relation is missing targetPort (source: ${String(relation.source)}, target: ${String(relation.target)})`, { relation });
|
|
46
|
+
}
|
|
47
|
+
this.validatePort(sourceNodeId, sourcePort, true, boundaryAliases, inputPorts, outputPorts, nodePortMap);
|
|
48
|
+
this.validatePort(targetNodeId, targetPort, false, boundaryAliases, inputPorts, outputPorts, nodePortMap);
|
|
49
|
+
return {
|
|
50
|
+
id: this.createEdgeId(sourceNodeId, sourcePort, targetNodeId, targetPort),
|
|
51
|
+
sourceNodeId,
|
|
52
|
+
sourcePort,
|
|
53
|
+
targetNodeId,
|
|
54
|
+
targetPort,
|
|
55
|
+
label: relation.label,
|
|
56
|
+
metadata: relation.metadata,
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Resolves an endpoint (source or target) to a node id or the workflow boundary.
|
|
61
|
+
*/
|
|
62
|
+
resolveEndpoint(endpoint, nodeIds, boundaryAliases) {
|
|
63
|
+
const name = String(endpoint);
|
|
64
|
+
if (boundaryAliases.has(name))
|
|
65
|
+
return constants_js_1.GRAPH_WORKFLOW_BOUNDARY;
|
|
66
|
+
if (nodeIds.has(name))
|
|
67
|
+
return name;
|
|
68
|
+
throw new GraphTopologyError_js_1.GraphTopologyError(`Unknown endpoint '${name}'`, { endpoint: name, knownNodes: Array.from(nodeIds) });
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* Validates that a port exists on the given node or boundary.
|
|
72
|
+
*/
|
|
73
|
+
validatePort(nodeId, port, isSource, boundaryAliases, inputPorts, outputPorts, nodePortMap) {
|
|
74
|
+
if (nodeId === constants_js_1.GRAPH_WORKFLOW_BOUNDARY) {
|
|
75
|
+
const ports = isSource ? inputPorts : outputPorts;
|
|
76
|
+
if (!ports.has(port)) {
|
|
77
|
+
throw new GraphPortError_js_1.GraphPortError(`Unknown ${isSource ? "input" : "output"} port '${port}' on workflow boundary`, { nodeId, port, isSource, available: Array.from(ports) });
|
|
78
|
+
}
|
|
79
|
+
return;
|
|
80
|
+
}
|
|
81
|
+
const nodePorts = nodePortMap.get(nodeId);
|
|
82
|
+
if (!nodePorts) {
|
|
83
|
+
throw new GraphTopologyError_js_1.GraphTopologyError(`No port map for node '${nodeId}'`, {
|
|
84
|
+
nodeId,
|
|
85
|
+
});
|
|
86
|
+
}
|
|
87
|
+
const ports = isSource ? nodePorts.output : nodePorts.input;
|
|
88
|
+
if (!ports.has(port)) {
|
|
89
|
+
throw new GraphPortError_js_1.GraphPortError(`Unknown ${isSource ? "output" : "input"} port '${port}' on node '${nodeId}'`, { nodeId, port, isSource, available: Array.from(ports) });
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
/**
|
|
93
|
+
* Builds the set of boundary aliases for a workflow.
|
|
94
|
+
*/
|
|
95
|
+
boundaryAliases(workflow) {
|
|
96
|
+
return new Set([
|
|
97
|
+
constants_js_1.GRAPH_WORKFLOW_BOUNDARY,
|
|
98
|
+
"workflow",
|
|
99
|
+
"graph",
|
|
100
|
+
workflow.name,
|
|
101
|
+
]);
|
|
102
|
+
}
|
|
103
|
+
/**
|
|
104
|
+
* Extracts port names from a list of port definitions.
|
|
105
|
+
*/
|
|
106
|
+
portNames(ports) {
|
|
107
|
+
return new Set((ports ?? []).map((p) => p.name));
|
|
108
|
+
}
|
|
109
|
+
/**
|
|
110
|
+
* Builds a map of node id -> { input ports, output ports }.
|
|
111
|
+
*/
|
|
112
|
+
buildNodePortMap(workflow) {
|
|
113
|
+
const map = new Map();
|
|
114
|
+
for (const nodeMeta of workflow.nodes ?? []) {
|
|
115
|
+
const input = new Set();
|
|
116
|
+
const output = new Set();
|
|
117
|
+
const def = this.resolveNodeDefinition(nodeMeta);
|
|
118
|
+
if (def) {
|
|
119
|
+
for (const port of def.ports ?? []) {
|
|
120
|
+
if (port.direction === "input")
|
|
121
|
+
input.add(port.name);
|
|
122
|
+
else
|
|
123
|
+
output.add(port.name);
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
map.set(nodeMeta.id, { input, output });
|
|
127
|
+
}
|
|
128
|
+
return map;
|
|
129
|
+
}
|
|
130
|
+
/**
|
|
131
|
+
* Attempts to resolve a node's full definition from its metadata.
|
|
132
|
+
*
|
|
133
|
+
* Accepts either a decorated Model class/instance (resolved via
|
|
134
|
+
* `graphDefinitionOf`) or a plain `GraphNodeDefinition`-shaped object
|
|
135
|
+
* (useful for serialized workflows that inline node definitions).
|
|
136
|
+
*/
|
|
137
|
+
resolveNodeDefinition(nodeMeta) {
|
|
138
|
+
if (nodeMeta.node) {
|
|
139
|
+
if (this.isRawDefinition(nodeMeta.node)) {
|
|
140
|
+
return nodeMeta.node;
|
|
141
|
+
}
|
|
142
|
+
try {
|
|
143
|
+
const def = (0, graph_1.graphDefinitionOf)(nodeMeta.node);
|
|
144
|
+
return def;
|
|
145
|
+
}
|
|
146
|
+
catch {
|
|
147
|
+
return undefined;
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
return undefined;
|
|
151
|
+
}
|
|
152
|
+
/**
|
|
153
|
+
* Returns `true` when a value looks like a raw {@link GraphNodeDefinition}
|
|
154
|
+
* (a plain object with a `ports` array and a `name` string).
|
|
155
|
+
*/
|
|
156
|
+
isRawDefinition(value) {
|
|
157
|
+
return (typeof value === "object" &&
|
|
158
|
+
value !== null &&
|
|
159
|
+
!Array.isArray(value) &&
|
|
160
|
+
typeof value.name === "string" &&
|
|
161
|
+
Array.isArray(value.ports));
|
|
162
|
+
}
|
|
163
|
+
/**
|
|
164
|
+
* Creates a stable edge id from its endpoints and ports.
|
|
165
|
+
*/
|
|
166
|
+
createEdgeId(sourceNodeId, sourcePort, targetNodeId, targetPort) {
|
|
167
|
+
return `${sourceNodeId}:${sourcePort}->${targetNodeId}:${targetPort}`;
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
exports.GraphRelationResolver = GraphRelationResolver;
|
|
171
|
+
//# sourceMappingURL=GraphRelationResolver.js.map
|
|
172
|
+
//# sourceMappingURL=GraphRelationResolver.cjs.map
|