ts-workflow-engine-lite 2.1.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/LICENSE +21 -0
- package/README.md +352 -0
- package/dist/src/api/ConsoleWebSocketManager.d.ts +57 -0
- package/dist/src/api/ConsoleWebSocketManager.js +206 -0
- package/dist/src/api/ConsoleWebSocketManager.js.map +1 -0
- package/dist/src/api/ErrorHandler.d.ts +52 -0
- package/dist/src/api/ErrorHandler.js +115 -0
- package/dist/src/api/ErrorHandler.js.map +1 -0
- package/dist/src/api/EventHistory.d.ts +73 -0
- package/dist/src/api/EventHistory.js +309 -0
- package/dist/src/api/EventHistory.js.map +1 -0
- package/dist/src/api/WebhookManager.d.ts +67 -0
- package/dist/src/api/WebhookManager.js +568 -0
- package/dist/src/api/WebhookManager.js.map +1 -0
- package/dist/src/api/docsPage.d.ts +1 -0
- package/dist/src/api/docsPage.js +321 -0
- package/dist/src/api/docsPage.js.map +1 -0
- package/dist/src/api/index.d.ts +8 -0
- package/dist/src/api/index.js +8 -0
- package/dist/src/api/index.js.map +1 -0
- package/dist/src/api/middleware/auth.d.ts +19 -0
- package/dist/src/api/middleware/auth.js +122 -0
- package/dist/src/api/middleware/auth.js.map +1 -0
- package/dist/src/api/middleware/index.d.ts +3 -0
- package/dist/src/api/middleware/index.js +3 -0
- package/dist/src/api/middleware/index.js.map +1 -0
- package/dist/src/api/middleware/rateLimit.d.ts +6 -0
- package/dist/src/api/middleware/rateLimit.js +69 -0
- package/dist/src/api/middleware/rateLimit.js.map +1 -0
- package/dist/src/api/middleware/rateLimitStore.d.ts +14 -0
- package/dist/src/api/middleware/rateLimitStore.js +44 -0
- package/dist/src/api/middleware/rateLimitStore.js.map +1 -0
- package/dist/src/api/middleware/rbac.d.ts +12 -0
- package/dist/src/api/middleware/rbac.js +120 -0
- package/dist/src/api/middleware/rbac.js.map +1 -0
- package/dist/src/api/openapi.d.ts +1917 -0
- package/dist/src/api/openapi.js +1758 -0
- package/dist/src/api/openapi.js.map +1 -0
- package/dist/src/api/playgroundPage.d.ts +1 -0
- package/dist/src/api/playgroundPage.js +765 -0
- package/dist/src/api/playgroundPage.js.map +1 -0
- package/dist/src/api/response.d.ts +22 -0
- package/dist/src/api/response.js +119 -0
- package/dist/src/api/response.js.map +1 -0
- package/dist/src/api/router.d.ts +17 -0
- package/dist/src/api/router.js +94 -0
- package/dist/src/api/router.js.map +1 -0
- package/dist/src/api/routes/analytics.d.ts +10 -0
- package/dist/src/api/routes/analytics.js +144 -0
- package/dist/src/api/routes/analytics.js.map +1 -0
- package/dist/src/api/routes/dlq.d.ts +3 -0
- package/dist/src/api/routes/dlq.js +248 -0
- package/dist/src/api/routes/dlq.js.map +1 -0
- package/dist/src/api/routes/eventHistory.d.ts +3 -0
- package/dist/src/api/routes/eventHistory.js +48 -0
- package/dist/src/api/routes/eventHistory.js.map +1 -0
- package/dist/src/api/routes/events.d.ts +3 -0
- package/dist/src/api/routes/events.js +205 -0
- package/dist/src/api/routes/events.js.map +1 -0
- package/dist/src/api/routes/functions.d.ts +3 -0
- package/dist/src/api/routes/functions.js +85 -0
- package/dist/src/api/routes/functions.js.map +1 -0
- package/dist/src/api/routes/instances.d.ts +3 -0
- package/dist/src/api/routes/instances.js +790 -0
- package/dist/src/api/routes/instances.js.map +1 -0
- package/dist/src/api/routes/templates.d.ts +3 -0
- package/dist/src/api/routes/templates.js +195 -0
- package/dist/src/api/routes/templates.js.map +1 -0
- package/dist/src/api/routes/webhooks.d.ts +3 -0
- package/dist/src/api/routes/webhooks.js +263 -0
- package/dist/src/api/routes/webhooks.js.map +1 -0
- package/dist/src/api/routes/workflows/analysis.d.ts +2 -0
- package/dist/src/api/routes/workflows/analysis.js +112 -0
- package/dist/src/api/routes/workflows/analysis.js.map +1 -0
- package/dist/src/api/routes/workflows/crud.d.ts +2 -0
- package/dist/src/api/routes/workflows/crud.js +140 -0
- package/dist/src/api/routes/workflows/crud.js.map +1 -0
- package/dist/src/api/routes/workflows/execution.d.ts +2 -0
- package/dist/src/api/routes/workflows/execution.js +204 -0
- package/dist/src/api/routes/workflows/execution.js.map +1 -0
- package/dist/src/api/routes/workflows/graph.d.ts +2 -0
- package/dist/src/api/routes/workflows/graph.js +51 -0
- package/dist/src/api/routes/workflows/graph.js.map +1 -0
- package/dist/src/api/routes/workflows/import.d.ts +2 -0
- package/dist/src/api/routes/workflows/import.js +238 -0
- package/dist/src/api/routes/workflows/import.js.map +1 -0
- package/dist/src/api/routes/workflows/index.d.ts +3 -0
- package/dist/src/api/routes/workflows/index.js +18 -0
- package/dist/src/api/routes/workflows/index.js.map +1 -0
- package/dist/src/api/routes/workflows/shared.d.ts +64 -0
- package/dist/src/api/routes/workflows/shared.js +304 -0
- package/dist/src/api/routes/workflows/shared.js.map +1 -0
- package/dist/src/api/routes/workflows/variables.d.ts +2 -0
- package/dist/src/api/routes/workflows/variables.js +34 -0
- package/dist/src/api/routes/workflows/variables.js.map +1 -0
- package/dist/src/api/routes/workflows/versioning.d.ts +2 -0
- package/dist/src/api/routes/workflows/versioning.js +235 -0
- package/dist/src/api/routes/workflows/versioning.js.map +1 -0
- package/dist/src/api/server.d.ts +13 -0
- package/dist/src/api/server.js +311 -0
- package/dist/src/api/server.js.map +1 -0
- package/dist/src/api/services/InstanceApplicationService.d.ts +74 -0
- package/dist/src/api/services/InstanceApplicationService.js +215 -0
- package/dist/src/api/services/InstanceApplicationService.js.map +1 -0
- package/dist/src/api/services/WorkflowApplicationService.d.ts +92 -0
- package/dist/src/api/services/WorkflowApplicationService.js +282 -0
- package/dist/src/api/services/WorkflowApplicationService.js.map +1 -0
- package/dist/src/api/services/index.d.ts +4 -0
- package/dist/src/api/services/index.js +3 -0
- package/dist/src/api/services/index.js.map +1 -0
- package/dist/src/api/types.d.ts +118 -0
- package/dist/src/api/types.js +2 -0
- package/dist/src/api/types.js.map +1 -0
- package/dist/src/api/utils/IdempotencyStore.d.ts +36 -0
- package/dist/src/api/utils/IdempotencyStore.js +121 -0
- package/dist/src/api/utils/IdempotencyStore.js.map +1 -0
- package/dist/src/api/utils/authConfig.d.ts +2 -0
- package/dist/src/api/utils/authConfig.js +25 -0
- package/dist/src/api/utils/authConfig.js.map +1 -0
- package/dist/src/api/utils/requestContext.d.ts +14 -0
- package/dist/src/api/utils/requestContext.js +31 -0
- package/dist/src/api/utils/requestContext.js.map +1 -0
- package/dist/src/api/utils/routeHelper.d.ts +25 -0
- package/dist/src/api/utils/routeHelper.js +30 -0
- package/dist/src/api/utils/routeHelper.js.map +1 -0
- package/dist/src/api/welcomePage.d.ts +1 -0
- package/dist/src/api/welcomePage.js +259 -0
- package/dist/src/api/welcomePage.js.map +1 -0
- package/dist/src/bootstrap.d.ts +20 -0
- package/dist/src/bootstrap.js +128 -0
- package/dist/src/bootstrap.js.map +1 -0
- package/dist/src/cli.d.ts +2 -0
- package/dist/src/cli.js +32 -0
- package/dist/src/cli.js.map +1 -0
- package/dist/src/config/AppConfig.d.ts +102 -0
- package/dist/src/config/AppConfig.js +452 -0
- package/dist/src/config/AppConfig.js.map +1 -0
- package/dist/src/config/redis.config.d.ts +6 -0
- package/dist/src/config/redis.config.js +9 -0
- package/dist/src/config/redis.config.js.map +1 -0
- package/dist/src/container.d.ts +29 -0
- package/dist/src/container.js +62 -0
- package/dist/src/container.js.map +1 -0
- package/dist/src/debug/BreakpointManager.d.ts +17 -0
- package/dist/src/debug/BreakpointManager.js +59 -0
- package/dist/src/debug/BreakpointManager.js.map +1 -0
- package/dist/src/debug/WorkflowDebugger.d.ts +34 -0
- package/dist/src/debug/WorkflowDebugger.js +117 -0
- package/dist/src/debug/WorkflowDebugger.js.map +1 -0
- package/dist/src/debug/index.d.ts +2 -0
- package/dist/src/debug/index.js +3 -0
- package/dist/src/debug/index.js.map +1 -0
- package/dist/src/demo/demoWorkflow.d.ts +3 -0
- package/dist/src/demo/demoWorkflow.js +82 -0
- package/dist/src/demo/demoWorkflow.js.map +1 -0
- package/dist/src/demo/exampleWorkflow.d.ts +36 -0
- package/dist/src/demo/exampleWorkflow.js +184 -0
- package/dist/src/demo/exampleWorkflow.js.map +1 -0
- package/dist/src/demo/index.d.ts +2 -0
- package/dist/src/demo/index.js +3 -0
- package/dist/src/demo/index.js.map +1 -0
- package/dist/src/dlq/DeadLetterQueue.d.ts +62 -0
- package/dist/src/dlq/DeadLetterQueue.js +342 -0
- package/dist/src/dlq/DeadLetterQueue.js.map +1 -0
- package/dist/src/dlq/index.d.ts +2 -0
- package/dist/src/dlq/index.js +2 -0
- package/dist/src/dlq/index.js.map +1 -0
- package/dist/src/dsl/DSLParser.d.ts +7 -0
- package/dist/src/dsl/DSLParser.js +252 -0
- package/dist/src/dsl/DSLParser.js.map +1 -0
- package/dist/src/dsl/WorkflowDSL.d.ts +40 -0
- package/dist/src/dsl/WorkflowDSL.js +2 -0
- package/dist/src/dsl/WorkflowDSL.js.map +1 -0
- package/dist/src/engine/CanaryReleaseManager.d.ts +39 -0
- package/dist/src/engine/CanaryReleaseManager.js +192 -0
- package/dist/src/engine/CanaryReleaseManager.js.map +1 -0
- package/dist/src/engine/ConcurrencyControl.d.ts +38 -0
- package/dist/src/engine/ConcurrencyControl.js +181 -0
- package/dist/src/engine/ConcurrencyControl.js.map +1 -0
- package/dist/src/engine/ContinueAsNewManager.d.ts +18 -0
- package/dist/src/engine/ContinueAsNewManager.js +29 -0
- package/dist/src/engine/ContinueAsNewManager.js.map +1 -0
- package/dist/src/engine/DataValidator.d.ts +15 -0
- package/dist/src/engine/DataValidator.js +121 -0
- package/dist/src/engine/DataValidator.js.map +1 -0
- package/dist/src/engine/DryRunExecutor.d.ts +48 -0
- package/dist/src/engine/DryRunExecutor.js +256 -0
- package/dist/src/engine/DryRunExecutor.js.map +1 -0
- package/dist/src/engine/ExecutionOrchestrator.d.ts +19 -0
- package/dist/src/engine/ExecutionOrchestrator.js +579 -0
- package/dist/src/engine/ExecutionOrchestrator.js.map +1 -0
- package/dist/src/engine/ExpressionEvaluator.d.ts +44 -0
- package/dist/src/engine/ExpressionEvaluator.js +1046 -0
- package/dist/src/engine/ExpressionEvaluator.js.map +1 -0
- package/dist/src/engine/HeartbeatManager.d.ts +42 -0
- package/dist/src/engine/HeartbeatManager.js +209 -0
- package/dist/src/engine/HeartbeatManager.js.map +1 -0
- package/dist/src/engine/InstanceManager.d.ts +21 -0
- package/dist/src/engine/InstanceManager.js +165 -0
- package/dist/src/engine/InstanceManager.js.map +1 -0
- package/dist/src/engine/InstanceSearch.d.ts +30 -0
- package/dist/src/engine/InstanceSearch.js +119 -0
- package/dist/src/engine/InstanceSearch.js.map +1 -0
- package/dist/src/engine/LifecycleManager.d.ts +18 -0
- package/dist/src/engine/LifecycleManager.js +82 -0
- package/dist/src/engine/LifecycleManager.js.map +1 -0
- package/dist/src/engine/ParallelExecutor.d.ts +26 -0
- package/dist/src/engine/ParallelExecutor.js +138 -0
- package/dist/src/engine/ParallelExecutor.js.map +1 -0
- package/dist/src/engine/SandboxEvaluator.d.ts +18 -0
- package/dist/src/engine/SandboxEvaluator.js +200 -0
- package/dist/src/engine/SandboxEvaluator.js.map +1 -0
- package/dist/src/engine/SchemaValidator.d.ts +30 -0
- package/dist/src/engine/SchemaValidator.js +630 -0
- package/dist/src/engine/SchemaValidator.js.map +1 -0
- package/dist/src/engine/SearchAttributeManager.d.ts +48 -0
- package/dist/src/engine/SearchAttributeManager.js +119 -0
- package/dist/src/engine/SearchAttributeManager.js.map +1 -0
- package/dist/src/engine/StateMachine.d.ts +13 -0
- package/dist/src/engine/StateMachine.js +66 -0
- package/dist/src/engine/StateMachine.js.map +1 -0
- package/dist/src/engine/StickyExecutionManager.d.ts +34 -0
- package/dist/src/engine/StickyExecutionManager.js +163 -0
- package/dist/src/engine/StickyExecutionManager.js.map +1 -0
- package/dist/src/engine/SubworkflowExecutor.d.ts +17 -0
- package/dist/src/engine/SubworkflowExecutor.js +157 -0
- package/dist/src/engine/SubworkflowExecutor.js.map +1 -0
- package/dist/src/engine/TaskExecutor.d.ts +12 -0
- package/dist/src/engine/TaskExecutor.js +124 -0
- package/dist/src/engine/TaskExecutor.js.map +1 -0
- package/dist/src/engine/TaskQueueManager.d.ts +42 -0
- package/dist/src/engine/TaskQueueManager.js +175 -0
- package/dist/src/engine/TaskQueueManager.js.map +1 -0
- package/dist/src/engine/WorkflowEngine.d.ts +117 -0
- package/dist/src/engine/WorkflowEngine.js +443 -0
- package/dist/src/engine/WorkflowEngine.js.map +1 -0
- package/dist/src/engine/WorkflowInstanceControl.d.ts +21 -0
- package/dist/src/engine/WorkflowInstanceControl.js +306 -0
- package/dist/src/engine/WorkflowInstanceControl.js.map +1 -0
- package/dist/src/engine/WorkflowPersistenceCoordinator.d.ts +12 -0
- package/dist/src/engine/WorkflowPersistenceCoordinator.js +93 -0
- package/dist/src/engine/WorkflowPersistenceCoordinator.js.map +1 -0
- package/dist/src/engine/WorkflowRegistry.d.ts +38 -0
- package/dist/src/engine/WorkflowRegistry.js +130 -0
- package/dist/src/engine/WorkflowRegistry.js.map +1 -0
- package/dist/src/engine/WorkflowVersionManager.d.ts +24 -0
- package/dist/src/engine/WorkflowVersionManager.js +121 -0
- package/dist/src/engine/WorkflowVersionManager.js.map +1 -0
- package/dist/src/engine/createEngine.d.ts +8 -0
- package/dist/src/engine/createEngine.js +21 -0
- package/dist/src/engine/createEngine.js.map +1 -0
- package/dist/src/engine/errors.d.ts +18 -0
- package/dist/src/engine/errors.js +37 -0
- package/dist/src/engine/errors.js.map +1 -0
- package/dist/src/engine/executors/ApprovalNodeExecutor.d.ts +12 -0
- package/dist/src/engine/executors/ApprovalNodeExecutor.js +68 -0
- package/dist/src/engine/executors/ApprovalNodeExecutor.js.map +1 -0
- package/dist/src/engine/executors/ConditionNodeExecutor.d.ts +16 -0
- package/dist/src/engine/executors/ConditionNodeExecutor.js +63 -0
- package/dist/src/engine/executors/ConditionNodeExecutor.js.map +1 -0
- package/dist/src/engine/executors/HttpNodeExecutor.d.ts +27 -0
- package/dist/src/engine/executors/HttpNodeExecutor.js +179 -0
- package/dist/src/engine/executors/HttpNodeExecutor.js.map +1 -0
- package/dist/src/engine/executors/JoinNodeExecutor.d.ts +13 -0
- package/dist/src/engine/executors/JoinNodeExecutor.js +37 -0
- package/dist/src/engine/executors/JoinNodeExecutor.js.map +1 -0
- package/dist/src/engine/executors/LoopNodeExecutor.d.ts +20 -0
- package/dist/src/engine/executors/LoopNodeExecutor.js +165 -0
- package/dist/src/engine/executors/LoopNodeExecutor.js.map +1 -0
- package/dist/src/engine/executors/NotificationNodeExecutor.d.ts +8 -0
- package/dist/src/engine/executors/NotificationNodeExecutor.js +33 -0
- package/dist/src/engine/executors/NotificationNodeExecutor.js.map +1 -0
- package/dist/src/engine/executors/QueueNodeExecutor.d.ts +23 -0
- package/dist/src/engine/executors/QueueNodeExecutor.js +87 -0
- package/dist/src/engine/executors/QueueNodeExecutor.js.map +1 -0
- package/dist/src/engine/executors/RouterNodeExecutor.d.ts +20 -0
- package/dist/src/engine/executors/RouterNodeExecutor.js +82 -0
- package/dist/src/engine/executors/RouterNodeExecutor.js.map +1 -0
- package/dist/src/engine/executors/SqlNodeExecutor.d.ts +27 -0
- package/dist/src/engine/executors/SqlNodeExecutor.js +74 -0
- package/dist/src/engine/executors/SqlNodeExecutor.js.map +1 -0
- package/dist/src/engine/executors/TransformNodeExecutor.d.ts +9 -0
- package/dist/src/engine/executors/TransformNodeExecutor.js +44 -0
- package/dist/src/engine/executors/TransformNodeExecutor.js.map +1 -0
- package/dist/src/engine/functions/collectionFunctions.d.ts +2 -0
- package/dist/src/engine/functions/collectionFunctions.js +129 -0
- package/dist/src/engine/functions/collectionFunctions.js.map +1 -0
- package/dist/src/engine/functions/customFunctions.d.ts +11 -0
- package/dist/src/engine/functions/customFunctions.js +42 -0
- package/dist/src/engine/functions/customFunctions.js.map +1 -0
- package/dist/src/engine/functions/dateFunctions.d.ts +2 -0
- package/dist/src/engine/functions/dateFunctions.js +71 -0
- package/dist/src/engine/functions/dateFunctions.js.map +1 -0
- package/dist/src/engine/functions/index.d.ts +14 -0
- package/dist/src/engine/functions/index.js +35 -0
- package/dist/src/engine/functions/index.js.map +1 -0
- package/dist/src/engine/functions/stringFunctions.d.ts +2 -0
- package/dist/src/engine/functions/stringFunctions.js +66 -0
- package/dist/src/engine/functions/stringFunctions.js.map +1 -0
- package/dist/src/engine/functions/typeFunctions.d.ts +2 -0
- package/dist/src/engine/functions/typeFunctions.js +70 -0
- package/dist/src/engine/functions/typeFunctions.js.map +1 -0
- package/dist/src/engine/functions/types.d.ts +6 -0
- package/dist/src/engine/functions/types.js +2 -0
- package/dist/src/engine/functions/types.js.map +1 -0
- package/dist/src/engine/index.d.ts +21 -0
- package/dist/src/engine/index.js +18 -0
- package/dist/src/engine/index.js.map +1 -0
- package/dist/src/engine/nodeDispatch/controlNodes.d.ts +2 -0
- package/dist/src/engine/nodeDispatch/controlNodes.js +208 -0
- package/dist/src/engine/nodeDispatch/controlNodes.js.map +1 -0
- package/dist/src/engine/nodeDispatch/helpers.d.ts +27 -0
- package/dist/src/engine/nodeDispatch/helpers.js +185 -0
- package/dist/src/engine/nodeDispatch/helpers.js.map +1 -0
- package/dist/src/engine/nodeDispatch/ioNodes.d.ts +2 -0
- package/dist/src/engine/nodeDispatch/ioNodes.js +89 -0
- package/dist/src/engine/nodeDispatch/ioNodes.js.map +1 -0
- package/dist/src/engine/nodeDispatch/types.d.ts +13 -0
- package/dist/src/engine/nodeDispatch/types.js +2 -0
- package/dist/src/engine/nodeDispatch/types.js.map +1 -0
- package/dist/src/engine/nodeDispatch/workflowNodes.d.ts +2 -0
- package/dist/src/engine/nodeDispatch/workflowNodes.js +33 -0
- package/dist/src/engine/nodeDispatch/workflowNodes.js.map +1 -0
- package/dist/src/engine/worker/ActionSandboxMessage.d.ts +29 -0
- package/dist/src/engine/worker/ActionSandboxMessage.js +7 -0
- package/dist/src/engine/worker/ActionSandboxMessage.js.map +1 -0
- package/dist/src/engine/worker/ActionSandboxPool.d.ts +34 -0
- package/dist/src/engine/worker/ActionSandboxPool.js +204 -0
- package/dist/src/engine/worker/ActionSandboxPool.js.map +1 -0
- package/dist/src/engine/worker/ActionSandboxWorker.d.ts +1 -0
- package/dist/src/engine/worker/ActionSandboxWorker.js +25 -0
- package/dist/src/engine/worker/ActionSandboxWorker.js.map +1 -0
- package/dist/src/engine/worker/WorkerMessage.d.ts +35 -0
- package/dist/src/engine/worker/WorkerMessage.js +7 -0
- package/dist/src/engine/worker/WorkerMessage.js.map +1 -0
- package/dist/src/engine/worker/WorkerPool.d.ts +42 -0
- package/dist/src/engine/worker/WorkerPool.js +273 -0
- package/dist/src/engine/worker/WorkerPool.js.map +1 -0
- package/dist/src/engine/worker/WorkerProcess.d.ts +1 -0
- package/dist/src/engine/worker/WorkerProcess.js +76 -0
- package/dist/src/engine/worker/WorkerProcess.js.map +1 -0
- package/dist/src/event/EventBus.d.ts +11 -0
- package/dist/src/event/EventBus.js +44 -0
- package/dist/src/event/EventBus.js.map +1 -0
- package/dist/src/event/EventCoordinator.d.ts +26 -0
- package/dist/src/event/EventCoordinator.js +205 -0
- package/dist/src/event/EventCoordinator.js.map +1 -0
- package/dist/src/event/EventDeduplicator.d.ts +31 -0
- package/dist/src/event/EventDeduplicator.js +100 -0
- package/dist/src/event/EventDeduplicator.js.map +1 -0
- package/dist/src/event/HookManager.d.ts +31 -0
- package/dist/src/event/HookManager.js +88 -0
- package/dist/src/event/HookManager.js.map +1 -0
- package/dist/src/event/MessageBus.d.ts +39 -0
- package/dist/src/event/MessageBus.js +131 -0
- package/dist/src/event/MessageBus.js.map +1 -0
- package/dist/src/event/index.d.ts +3 -0
- package/dist/src/event/index.js +4 -0
- package/dist/src/event/index.js.map +1 -0
- package/dist/src/index.d.ts +40 -0
- package/dist/src/index.js +33 -0
- package/dist/src/index.js.map +1 -0
- package/dist/src/lifecycle.d.ts +17 -0
- package/dist/src/lifecycle.js +84 -0
- package/dist/src/lifecycle.js.map +1 -0
- package/dist/src/metrics/AnalyticsCollector.d.ts +57 -0
- package/dist/src/metrics/AnalyticsCollector.js +140 -0
- package/dist/src/metrics/AnalyticsCollector.js.map +1 -0
- package/dist/src/metrics/AnomalyDetector.d.ts +21 -0
- package/dist/src/metrics/AnomalyDetector.js +120 -0
- package/dist/src/metrics/AnomalyDetector.js.map +1 -0
- package/dist/src/metrics/MetricsAggregator.d.ts +43 -0
- package/dist/src/metrics/MetricsAggregator.js +243 -0
- package/dist/src/metrics/MetricsAggregator.js.map +1 -0
- package/dist/src/metrics/SlaMonitor.d.ts +48 -0
- package/dist/src/metrics/SlaMonitor.js +130 -0
- package/dist/src/metrics/SlaMonitor.js.map +1 -0
- package/dist/src/metrics/index.d.ts +75 -0
- package/dist/src/metrics/index.js +293 -0
- package/dist/src/metrics/index.js.map +1 -0
- package/dist/src/model/Instance.d.ts +38 -0
- package/dist/src/model/Instance.js +12 -0
- package/dist/src/model/Instance.js.map +1 -0
- package/dist/src/model/RetryPolicy.d.ts +11 -0
- package/dist/src/model/RetryPolicy.js +30 -0
- package/dist/src/model/RetryPolicy.js.map +1 -0
- package/dist/src/model/Schedule.d.ts +34 -0
- package/dist/src/model/Schedule.js +50 -0
- package/dist/src/model/Schedule.js.map +1 -0
- package/dist/src/model/Workflow.d.ts +73 -0
- package/dist/src/model/Workflow.js +2 -0
- package/dist/src/model/Workflow.js.map +1 -0
- package/dist/src/model/WorkflowGraph.d.ts +32 -0
- package/dist/src/model/WorkflowGraph.js +267 -0
- package/dist/src/model/WorkflowGraph.js.map +1 -0
- package/dist/src/model/WorkflowSchema.d.ts +154 -0
- package/dist/src/model/WorkflowSchema.js +233 -0
- package/dist/src/model/WorkflowSchema.js.map +1 -0
- package/dist/src/model/WorkflowVariables.d.ts +15 -0
- package/dist/src/model/WorkflowVariables.js +77 -0
- package/dist/src/model/WorkflowVariables.js.map +1 -0
- package/dist/src/notification/NotificationChannel.d.ts +19 -0
- package/dist/src/notification/NotificationChannel.js +2 -0
- package/dist/src/notification/NotificationChannel.js.map +1 -0
- package/dist/src/notification/NotificationManager.d.ts +20 -0
- package/dist/src/notification/NotificationManager.js +59 -0
- package/dist/src/notification/NotificationManager.js.map +1 -0
- package/dist/src/notification/channels/DingtalkChannel.d.ts +7 -0
- package/dist/src/notification/channels/DingtalkChannel.js +18 -0
- package/dist/src/notification/channels/DingtalkChannel.js.map +1 -0
- package/dist/src/notification/channels/EmailChannel.d.ts +21 -0
- package/dist/src/notification/channels/EmailChannel.js +32 -0
- package/dist/src/notification/channels/EmailChannel.js.map +1 -0
- package/dist/src/notification/channels/FeishuChannel.d.ts +7 -0
- package/dist/src/notification/channels/FeishuChannel.js +18 -0
- package/dist/src/notification/channels/FeishuChannel.js.map +1 -0
- package/dist/src/notification/channels/SlackChannel.d.ts +7 -0
- package/dist/src/notification/channels/SlackChannel.js +18 -0
- package/dist/src/notification/channels/SlackChannel.js.map +1 -0
- package/dist/src/notification/channels/SmsChannel.d.ts +24 -0
- package/dist/src/notification/channels/SmsChannel.js +37 -0
- package/dist/src/notification/channels/SmsChannel.js.map +1 -0
- package/dist/src/notification/channels/WebhookChannel.d.ts +17 -0
- package/dist/src/notification/channels/WebhookChannel.js +61 -0
- package/dist/src/notification/channels/WebhookChannel.js.map +1 -0
- package/dist/src/notification/index.d.ts +24 -0
- package/dist/src/notification/index.js +61 -0
- package/dist/src/notification/index.js.map +1 -0
- package/dist/src/scheduler/CronScheduler.d.ts +20 -0
- package/dist/src/scheduler/CronScheduler.js +82 -0
- package/dist/src/scheduler/CronScheduler.js.map +1 -0
- package/dist/src/scheduler/EnhancedCronScheduler.d.ts +27 -0
- package/dist/src/scheduler/EnhancedCronScheduler.js +177 -0
- package/dist/src/scheduler/EnhancedCronScheduler.js.map +1 -0
- package/dist/src/storage/ArchiveManager.d.ts +21 -0
- package/dist/src/storage/ArchiveManager.js +140 -0
- package/dist/src/storage/ArchiveManager.js.map +1 -0
- package/dist/src/storage/LocalFileStorage.d.ts +64 -0
- package/dist/src/storage/LocalFileStorage.js +470 -0
- package/dist/src/storage/LocalFileStorage.js.map +1 -0
- package/dist/src/storage/MemoryStorage.d.ts +65 -0
- package/dist/src/storage/MemoryStorage.js +422 -0
- package/dist/src/storage/MemoryStorage.js.map +1 -0
- package/dist/src/storage/StorageProvider.d.ts +223 -0
- package/dist/src/storage/StorageProvider.js +2 -0
- package/dist/src/storage/StorageProvider.js.map +1 -0
- package/dist/src/storage/builtin-adapters.d.ts +1 -0
- package/dist/src/storage/builtin-adapters.js +20 -0
- package/dist/src/storage/builtin-adapters.js.map +1 -0
- package/dist/src/storage/index.d.ts +17 -0
- package/dist/src/storage/index.js +52 -0
- package/dist/src/storage/index.js.map +1 -0
- package/dist/src/storage/registry.d.ts +6 -0
- package/dist/src/storage/registry.js +23 -0
- package/dist/src/storage/registry.js.map +1 -0
- package/dist/src/telemetry/index.d.ts +53 -0
- package/dist/src/telemetry/index.js +73 -0
- package/dist/src/telemetry/index.js.map +1 -0
- package/dist/src/telemetry/spanRegistry.d.ts +9 -0
- package/dist/src/telemetry/spanRegistry.js +14 -0
- package/dist/src/telemetry/spanRegistry.js.map +1 -0
- package/dist/src/templates/AutoExtract.d.ts +2 -0
- package/dist/src/templates/AutoExtract.js +124 -0
- package/dist/src/templates/AutoExtract.js.map +1 -0
- package/dist/src/templates/TemplateGallery.d.ts +54 -0
- package/dist/src/templates/TemplateGallery.js +139 -0
- package/dist/src/templates/TemplateGallery.js.map +1 -0
- package/dist/src/templates/TemplateRegistry.d.ts +16 -0
- package/dist/src/templates/TemplateRegistry.js +92 -0
- package/dist/src/templates/TemplateRegistry.js.map +1 -0
- package/dist/src/templates/WorkflowTemplate.d.ts +24 -0
- package/dist/src/templates/WorkflowTemplate.js +2 -0
- package/dist/src/templates/WorkflowTemplate.js.map +1 -0
- package/dist/src/templates/builtin/HttpCallbackTemplate.d.ts +2 -0
- package/dist/src/templates/builtin/HttpCallbackTemplate.js +47 -0
- package/dist/src/templates/builtin/HttpCallbackTemplate.js.map +1 -0
- package/dist/src/templates/builtin/index.d.ts +3 -0
- package/dist/src/templates/builtin/index.js +11 -0
- package/dist/src/templates/builtin/index.js.map +1 -0
- package/dist/src/templates/index.d.ts +3 -0
- package/dist/src/templates/index.js +3 -0
- package/dist/src/templates/index.js.map +1 -0
- package/dist/src/testing/MutationTester.d.ts +27 -0
- package/dist/src/testing/MutationTester.js +157 -0
- package/dist/src/testing/MutationTester.js.map +1 -0
- package/dist/src/testing/TestGenerator.d.ts +31 -0
- package/dist/src/testing/TestGenerator.js +345 -0
- package/dist/src/testing/TestGenerator.js.map +1 -0
- package/dist/src/testing/index.d.ts +2 -0
- package/dist/src/testing/index.js +3 -0
- package/dist/src/testing/index.js.map +1 -0
- package/dist/src/testing/testWorkflow.d.ts +51 -0
- package/dist/src/testing/testWorkflow.js +167 -0
- package/dist/src/testing/testWorkflow.js.map +1 -0
- package/dist/src/utils/AuditLogger.d.ts +36 -0
- package/dist/src/utils/AuditLogger.js +148 -0
- package/dist/src/utils/AuditLogger.js.map +1 -0
- package/dist/src/utils/BoundedMap.d.ts +34 -0
- package/dist/src/utils/BoundedMap.js +125 -0
- package/dist/src/utils/BoundedMap.js.map +1 -0
- package/dist/src/utils/LeaseStore.d.ts +7 -0
- package/dist/src/utils/LeaseStore.js +102 -0
- package/dist/src/utils/LeaseStore.js.map +1 -0
- package/dist/src/utils/Logger.d.ts +26 -0
- package/dist/src/utils/Logger.js +279 -0
- package/dist/src/utils/Logger.js.map +1 -0
- package/dist/src/utils/SecretManager.d.ts +41 -0
- package/dist/src/utils/SecretManager.js +139 -0
- package/dist/src/utils/SecretManager.js.map +1 -0
- package/dist/src/utils/StructuredLogger.d.ts +45 -0
- package/dist/src/utils/StructuredLogger.js +118 -0
- package/dist/src/utils/StructuredLogger.js.map +1 -0
- package/dist/src/utils/concurrency.d.ts +3 -0
- package/dist/src/utils/concurrency.js +22 -0
- package/dist/src/utils/concurrency.js.map +1 -0
- package/dist/src/utils/env.d.ts +5 -0
- package/dist/src/utils/env.js +15 -0
- package/dist/src/utils/env.js.map +1 -0
- package/dist/src/utils/index.d.ts +5 -0
- package/dist/src/utils/index.js +4 -0
- package/dist/src/utils/index.js.map +1 -0
- package/dist/src/utils/secrets.d.ts +5 -0
- package/dist/src/utils/secrets.js +27 -0
- package/dist/src/utils/secrets.js.map +1 -0
- package/package.json +159 -0
|
@@ -0,0 +1,238 @@
|
|
|
1
|
+
import { body, param, query, validationResult } from "express-validator";
|
|
2
|
+
import { Logger } from "../../../utils/Logger.js";
|
|
3
|
+
import { sendError, sendSuccess } from "../../response.js";
|
|
4
|
+
import { WorkflowApplicationService } from "../../services/WorkflowApplicationService.js";
|
|
5
|
+
import { getRequestEngine, getRequestStorage, requireRequestEngine, } from "../../utils/requestContext.js";
|
|
6
|
+
import { asyncHandler } from "../../utils/routeHelper.js";
|
|
7
|
+
import { persistImportedWorkflow, schemaValidator, templateRegistry, workflowSchema, } from "./shared.js";
|
|
8
|
+
let _cachedService = null;
|
|
9
|
+
function getService(req) {
|
|
10
|
+
const storage = getRequestStorage(req) ?? null;
|
|
11
|
+
if (!_cachedService || storage !== null) {
|
|
12
|
+
_cachedService = new WorkflowApplicationService(storage);
|
|
13
|
+
}
|
|
14
|
+
return _cachedService;
|
|
15
|
+
}
|
|
16
|
+
export function registerImportRoutes(router) {
|
|
17
|
+
router.post("/import/dsl", body("dsl").isString().notEmpty().withMessage("DSL content is required"), body("name").optional().isString().withMessage("Name must be a string"), body("description")
|
|
18
|
+
.optional()
|
|
19
|
+
.isString()
|
|
20
|
+
.withMessage("Description must be a string"), body("tags").optional().isArray().withMessage("Tags must be an array"), body("overwrite")
|
|
21
|
+
.optional()
|
|
22
|
+
.isBoolean()
|
|
23
|
+
.withMessage("overwrite must be boolean"), asyncHandler(async (req, res) => {
|
|
24
|
+
const service = getService(req);
|
|
25
|
+
const { dsl, name, description, tags, overwrite } = req.body;
|
|
26
|
+
const result = await service.importDsl({
|
|
27
|
+
dsl,
|
|
28
|
+
name,
|
|
29
|
+
description,
|
|
30
|
+
tags,
|
|
31
|
+
overwrite,
|
|
32
|
+
});
|
|
33
|
+
const engine = getRequestEngine(req);
|
|
34
|
+
if (engine && typeof engine.register === "function") {
|
|
35
|
+
await engine.register(result.definition, {
|
|
36
|
+
version: result.version.toString(),
|
|
37
|
+
setActive: result.publishedVersion === result.version,
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
res.status(201).json({
|
|
41
|
+
success: true,
|
|
42
|
+
data: { workflow: result, source: "dsl" },
|
|
43
|
+
message: "Workflow imported from DSL",
|
|
44
|
+
});
|
|
45
|
+
}));
|
|
46
|
+
router.post("/import/template", body("templateId")
|
|
47
|
+
.isString()
|
|
48
|
+
.notEmpty()
|
|
49
|
+
.withMessage("templateId is required"), body("name").isString().notEmpty().withMessage("Name is required"), body("parameters")
|
|
50
|
+
.optional()
|
|
51
|
+
.isObject()
|
|
52
|
+
.withMessage("parameters must be an object"), body("description")
|
|
53
|
+
.optional()
|
|
54
|
+
.isString()
|
|
55
|
+
.withMessage("Description must be a string"), body("tags").optional().isArray().withMessage("Tags must be an array"), body("overwrite")
|
|
56
|
+
.optional()
|
|
57
|
+
.isBoolean()
|
|
58
|
+
.withMessage("overwrite must be boolean"), async (req, res) => {
|
|
59
|
+
const errors = validationResult(req);
|
|
60
|
+
if (!errors.isEmpty()) {
|
|
61
|
+
return sendError(res, 400, 400, errors.array()[0].msg);
|
|
62
|
+
}
|
|
63
|
+
try {
|
|
64
|
+
const storage = getRequestStorage(req);
|
|
65
|
+
const engine = getRequestEngine(req);
|
|
66
|
+
const { templateId, name, parameters, description, tags, overwrite } = req.body;
|
|
67
|
+
if (!storage) {
|
|
68
|
+
return sendError(res, 500, 500, "Workflow template import not supported");
|
|
69
|
+
}
|
|
70
|
+
const workflowDefinition = templateRegistry.instantiate({
|
|
71
|
+
templateId,
|
|
72
|
+
name,
|
|
73
|
+
parameters: parameters ?? {},
|
|
74
|
+
});
|
|
75
|
+
if (description) {
|
|
76
|
+
workflowDefinition.description = description;
|
|
77
|
+
}
|
|
78
|
+
const validation = schemaValidator.validate(workflowDefinition);
|
|
79
|
+
if (!validation.valid) {
|
|
80
|
+
return sendError(res, 400, 400, "Workflow definition validation failed", {
|
|
81
|
+
errors: validation.errors,
|
|
82
|
+
warnings: validation.warnings,
|
|
83
|
+
});
|
|
84
|
+
}
|
|
85
|
+
const storedWorkflow = await persistImportedWorkflow(storage, workflowDefinition, {
|
|
86
|
+
description: workflowDefinition.description,
|
|
87
|
+
tags,
|
|
88
|
+
overwrite,
|
|
89
|
+
});
|
|
90
|
+
if (storedWorkflow === "conflict") {
|
|
91
|
+
return sendError(res, 409, 409, `Workflow with ID ${workflowDefinition.id} already exists`);
|
|
92
|
+
}
|
|
93
|
+
if (engine && typeof engine.register === "function") {
|
|
94
|
+
await engine.register(storedWorkflow.definition, {
|
|
95
|
+
version: storedWorkflow.version.toString(),
|
|
96
|
+
setActive: storedWorkflow.publishedVersion === storedWorkflow.version,
|
|
97
|
+
});
|
|
98
|
+
}
|
|
99
|
+
return sendSuccess(res, 201, {
|
|
100
|
+
workflow: storedWorkflow,
|
|
101
|
+
source: "template",
|
|
102
|
+
templateId,
|
|
103
|
+
}, "Workflow imported from template");
|
|
104
|
+
}
|
|
105
|
+
catch (error) {
|
|
106
|
+
Logger.error("api", "workflows", `Error importing workflow from template: ${error?.message}`, error?.stack);
|
|
107
|
+
return sendError(res, 400, 400, error?.message || "Failed to import workflow from template");
|
|
108
|
+
}
|
|
109
|
+
});
|
|
110
|
+
router.post("/import", body("definition")
|
|
111
|
+
.isObject()
|
|
112
|
+
.withMessage("Workflow definition is required"), body("name").optional().isString().withMessage("Name must be a string"), body("description")
|
|
113
|
+
.optional()
|
|
114
|
+
.isString()
|
|
115
|
+
.withMessage("Description must be a string"), body("tags").optional().isArray().withMessage("Tags must be an array"), body("overwrite")
|
|
116
|
+
.optional()
|
|
117
|
+
.isBoolean()
|
|
118
|
+
.withMessage("overwrite must be boolean"), async (req, res) => {
|
|
119
|
+
const errors = validationResult(req);
|
|
120
|
+
if (!errors.isEmpty()) {
|
|
121
|
+
return sendError(res, 400, 400, errors.array()[0].msg);
|
|
122
|
+
}
|
|
123
|
+
try {
|
|
124
|
+
const storage = getRequestStorage(req);
|
|
125
|
+
const { definition, name, description, tags, overwrite } = req.body;
|
|
126
|
+
const workflowDefinition = definition;
|
|
127
|
+
const workflowId = workflowDefinition.id;
|
|
128
|
+
const workflowName = name ?? workflowDefinition.name;
|
|
129
|
+
if (!workflowId || !workflowName) {
|
|
130
|
+
return sendError(res, 400, 400, "Workflow id and name are required");
|
|
131
|
+
}
|
|
132
|
+
const validationResult = schemaValidator.validate(workflowDefinition);
|
|
133
|
+
if (!validationResult.valid) {
|
|
134
|
+
return sendError(res, 400, 400, "Workflow definition validation failed", {
|
|
135
|
+
errors: validationResult.errors,
|
|
136
|
+
warnings: validationResult.warnings,
|
|
137
|
+
});
|
|
138
|
+
}
|
|
139
|
+
if (!storage) {
|
|
140
|
+
return sendError(res, 500, 500, "Workflow import not supported");
|
|
141
|
+
}
|
|
142
|
+
const existing = await storage.loadWorkflowWithMetadata(workflowId);
|
|
143
|
+
const now = Date.now();
|
|
144
|
+
if (existing && !overwrite) {
|
|
145
|
+
return sendError(res, 409, 409, `Workflow with ID ${workflowId} already exists`);
|
|
146
|
+
}
|
|
147
|
+
const nextVersion = existing ? existing.version + 1 : 1;
|
|
148
|
+
const storedWorkflow = {
|
|
149
|
+
id: workflowId,
|
|
150
|
+
name: workflowName,
|
|
151
|
+
description: description ?? existing?.description,
|
|
152
|
+
definition: workflowDefinition,
|
|
153
|
+
version: nextVersion,
|
|
154
|
+
publishedVersion: existing?.publishedVersion ?? nextVersion,
|
|
155
|
+
lockedVersion: existing?.lockedVersion,
|
|
156
|
+
releasePolicy: existing?.releasePolicy,
|
|
157
|
+
createdAt: existing?.createdAt ?? now,
|
|
158
|
+
updatedAt: now,
|
|
159
|
+
tags: tags ?? existing?.tags,
|
|
160
|
+
};
|
|
161
|
+
await storage.saveWorkflowWithMetadata(storedWorkflow);
|
|
162
|
+
const workflowVersion = {
|
|
163
|
+
id: storedWorkflow.id,
|
|
164
|
+
name: storedWorkflow.name,
|
|
165
|
+
description: storedWorkflow.description,
|
|
166
|
+
definition: storedWorkflow.definition,
|
|
167
|
+
version: storedWorkflow.version,
|
|
168
|
+
createdAt: now,
|
|
169
|
+
tags: storedWorkflow.tags,
|
|
170
|
+
metadata: storedWorkflow.definition.metadata,
|
|
171
|
+
};
|
|
172
|
+
await storage.saveWorkflowVersion(workflowVersion);
|
|
173
|
+
const engine = getRequestEngine(req);
|
|
174
|
+
if (engine && typeof engine.register === "function") {
|
|
175
|
+
await engine.register(storedWorkflow.definition, {
|
|
176
|
+
version: storedWorkflow.version.toString(),
|
|
177
|
+
setActive: storedWorkflow.publishedVersion === storedWorkflow.version,
|
|
178
|
+
});
|
|
179
|
+
}
|
|
180
|
+
return sendSuccess(res, 201, storedWorkflow, "Workflow imported");
|
|
181
|
+
}
|
|
182
|
+
catch (error) {
|
|
183
|
+
Logger.error("api", "workflows", `Error importing workflow: ${error?.message}`, error?.stack);
|
|
184
|
+
return sendError(res, 500, 500, error?.message || "Failed to import workflow");
|
|
185
|
+
}
|
|
186
|
+
});
|
|
187
|
+
router.get("/:id/export", param("id").isString().notEmpty().withMessage("Workflow ID is required"), query("version")
|
|
188
|
+
.optional()
|
|
189
|
+
.isInt({ min: 1 })
|
|
190
|
+
.withMessage("Version must be a positive integer"), async (req, res) => {
|
|
191
|
+
const errors = validationResult(req);
|
|
192
|
+
if (!errors.isEmpty()) {
|
|
193
|
+
return sendError(res, 400, 400, errors.array()[0].msg);
|
|
194
|
+
}
|
|
195
|
+
try {
|
|
196
|
+
const storage = getRequestStorage(req);
|
|
197
|
+
const workflowId = req.params?.id;
|
|
198
|
+
const versionValue = req.query?.version;
|
|
199
|
+
if (storage) {
|
|
200
|
+
const versionNumber = versionValue
|
|
201
|
+
? Number.parseInt(versionValue, 10)
|
|
202
|
+
: undefined;
|
|
203
|
+
const workflow = versionNumber !== undefined
|
|
204
|
+
? await storage.loadWorkflowVersion(workflowId, versionNumber)
|
|
205
|
+
: await storage.loadWorkflowWithMetadata(workflowId);
|
|
206
|
+
if (!workflow) {
|
|
207
|
+
return sendError(res, 404, 404, `Workflow with ID ${workflowId} not found`);
|
|
208
|
+
}
|
|
209
|
+
const definition = "definition" in workflow ? workflow.definition : workflow;
|
|
210
|
+
const resolvedVersion = "version" in workflow ? workflow.version : versionNumber;
|
|
211
|
+
return sendSuccess(res, 200, {
|
|
212
|
+
workflowId,
|
|
213
|
+
version: resolvedVersion,
|
|
214
|
+
definition,
|
|
215
|
+
schema: workflowSchema,
|
|
216
|
+
}, "Workflow exported");
|
|
217
|
+
}
|
|
218
|
+
const engine = requireRequestEngine(req);
|
|
219
|
+
const workflow = typeof engine.getWorkflow === "function"
|
|
220
|
+
? engine.getWorkflow(workflowId, versionValue)
|
|
221
|
+
: undefined;
|
|
222
|
+
if (!workflow) {
|
|
223
|
+
return sendError(res, 404, 404, `Workflow with ID ${workflowId} not found`);
|
|
224
|
+
}
|
|
225
|
+
return sendSuccess(res, 200, {
|
|
226
|
+
workflowId,
|
|
227
|
+
version: workflow.version,
|
|
228
|
+
definition: workflow,
|
|
229
|
+
schema: workflowSchema,
|
|
230
|
+
}, "Workflow exported");
|
|
231
|
+
}
|
|
232
|
+
catch (error) {
|
|
233
|
+
Logger.error("api", "workflows", `Error exporting workflow ${req.params?.id}: ${error?.message}`, error?.stack);
|
|
234
|
+
return sendError(res, 500, 500, error?.message || "Failed to export workflow");
|
|
235
|
+
}
|
|
236
|
+
});
|
|
237
|
+
}
|
|
238
|
+
//# sourceMappingURL=import.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"import.js","sourceRoot":"","sources":["../../../../../src/api/routes/workflows/import.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAOzE,OAAO,EAAE,MAAM,EAAE,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,KAAK,EAAE,KAAK,CACb,CAAC;YAEF,OAAO,SAAS,CACd,GAAG,EACH,GAAG,EACH,GAAG,EACH,KAAK,EAAE,OAAO,IAAI,2BAA2B,CAC9C,CAAC;QACJ,CAAC;IACH,CAAC,CACF,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { Router } from "express";
|
|
2
|
+
import { registerAnalysisRoutes } from "./analysis.js";
|
|
3
|
+
import { registerCrudRoutes } from "./crud.js";
|
|
4
|
+
import { registerExecutionRoutes } from "./execution.js";
|
|
5
|
+
import { registerGraphRoutes } from "./graph.js";
|
|
6
|
+
import { registerImportRoutes } from "./import.js";
|
|
7
|
+
import { registerVariableRoutes } from "./variables.js";
|
|
8
|
+
import { registerVersioningRoutes } from "./versioning.js";
|
|
9
|
+
const router = Router();
|
|
10
|
+
registerCrudRoutes(router);
|
|
11
|
+
registerImportRoutes(router);
|
|
12
|
+
registerAnalysisRoutes(router);
|
|
13
|
+
registerVersioningRoutes(router);
|
|
14
|
+
registerExecutionRoutes(router);
|
|
15
|
+
registerGraphRoutes(router);
|
|
16
|
+
registerVariableRoutes(router);
|
|
17
|
+
export default router;
|
|
18
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/api/routes/workflows/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgC,MAAM,EAAE,MAAM,SAAS,CAAC;AAC/D,OAAO,EAAE,sBAAsB,EAAE,MAAM,YAAY,CAAC;AACpD,OAAO,EAAE,kBAAkB,EAAE,MAAM,QAAQ,CAAC;AAC5C,OAAO,EAAE,uBAAuB,EAAE,MAAM,aAAa,CAAC;AACtD,OAAO,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAC;AAC9C,OAAO,EAAE,oBAAoB,EAAE,MAAM,UAAU,CAAC;AAChD,OAAO,EAAE,sBAAsB,EAAE,MAAM,aAAa,CAAC;AACrD,OAAO,EAAE,wBAAwB,EAAE,MAAM,cAAc,CAAC;AAExD,MAAM,MAAM,GAAkB,MAAM,EAAE,CAAC;AAGvC,kBAAkB,CAAC,MAAM,CAAC,CAAC;AAC3B,oBAAoB,CAAC,MAAM,CAAC,CAAC;AAC7B,sBAAsB,CAAC,MAAM,CAAC,CAAC;AAC/B,wBAAwB,CAAC,MAAM,CAAC,CAAC;AACjC,uBAAuB,CAAC,MAAM,CAAC,CAAC;AAChC,mBAAmB,CAAC,MAAM,CAAC,CAAC;AAC5B,sBAAsB,CAAC,MAAM,CAAC,CAAC;AAE/B,eAAe,MAAM,CAAC"}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { SchemaValidator } from "../../../engine/SchemaValidator.js";
|
|
2
|
+
import type { TaskType, WorkflowDefinition } from "../../../model/Workflow.js";
|
|
3
|
+
import type { StorageProvider, StoredWorkflow } from "../../../storage/StorageProvider.js";
|
|
4
|
+
import { templateRegistry } from "../../../templates/index.js";
|
|
5
|
+
import type { requireRequestEngine } from "../../utils/requestContext.js";
|
|
6
|
+
export type WorkflowWithListInstances = {
|
|
7
|
+
listInstancesByWorkflow?: (workflowId: string) => Promise<unknown[]>;
|
|
8
|
+
};
|
|
9
|
+
export type WorkflowRegistrationEngine = ReturnType<typeof requireRequestEngine> & {
|
|
10
|
+
register?: (workflow: WorkflowDefinition, options?: {
|
|
11
|
+
version?: string;
|
|
12
|
+
setActive?: boolean;
|
|
13
|
+
}) => Promise<void>;
|
|
14
|
+
setReleasePolicy?: (workflowId: string, policy: unknown) => void;
|
|
15
|
+
};
|
|
16
|
+
export type WorkflowVersioningEngine = ReturnType<typeof requireRequestEngine> & {
|
|
17
|
+
listWorkflowVersions?: (workflowId: string) => string[];
|
|
18
|
+
getActiveWorkflowVersion?: (workflowId: string) => string | undefined;
|
|
19
|
+
getLockedWorkflowVersion?: (workflowId: string) => string | undefined;
|
|
20
|
+
getReleasePolicy?: (workflowId: string) => unknown;
|
|
21
|
+
setActiveWorkflowVersion?: (workflowId: string, version: string) => void;
|
|
22
|
+
setLockedWorkflowVersion?: (workflowId: string, version: string) => void;
|
|
23
|
+
clearLockedWorkflowVersion?: (workflowId: string) => void;
|
|
24
|
+
setReleasePolicy?: (workflowId: string, policy: unknown) => void;
|
|
25
|
+
startCanaryRelease?: (workflowId: string, version: number, percent: number, rules?: {
|
|
26
|
+
autoPromote?: boolean;
|
|
27
|
+
minInstances?: number;
|
|
28
|
+
maxErrorRate?: number;
|
|
29
|
+
evaluationWindowMs?: number;
|
|
30
|
+
}) => Promise<void>;
|
|
31
|
+
promoteCanary?: (workflowId: string) => Promise<void>;
|
|
32
|
+
getCanaryStatus?: (workflowId: string) => Promise<unknown>;
|
|
33
|
+
};
|
|
34
|
+
export type WorkflowDryRunEngine = WorkflowRegistrationEngine & {
|
|
35
|
+
dryRun?: (workflowId: string, context?: Record<string, unknown>, options?: Record<string, unknown>) => Promise<unknown>;
|
|
36
|
+
};
|
|
37
|
+
export declare function toWorkflowDefinition(definition: unknown): WorkflowDefinition;
|
|
38
|
+
export declare const schemaValidator: SchemaValidator;
|
|
39
|
+
export { templateRegistry };
|
|
40
|
+
export declare const workflowSchema: {
|
|
41
|
+
$id: string;
|
|
42
|
+
};
|
|
43
|
+
export declare const nodeTemplates: {
|
|
44
|
+
configSchema: Record<string, unknown> | null;
|
|
45
|
+
ports: import("../../../model/WorkflowGraph.js").GraphEdgeKind[];
|
|
46
|
+
type: TaskType;
|
|
47
|
+
label: string;
|
|
48
|
+
category: "core" | "io" | "control";
|
|
49
|
+
description: string;
|
|
50
|
+
example?: Record<string, unknown>;
|
|
51
|
+
}[];
|
|
52
|
+
export declare function persistImportedWorkflow(storage: StorageProvider, workflowDefinition: WorkflowDefinition, options: {
|
|
53
|
+
description?: string;
|
|
54
|
+
tags?: string[];
|
|
55
|
+
overwrite?: boolean;
|
|
56
|
+
}): Promise<StoredWorkflow | "conflict">;
|
|
57
|
+
export declare const sanitizeValue: (value: any) => any;
|
|
58
|
+
export declare const stableStringify: (value: any) => string;
|
|
59
|
+
export declare const getNodeSignature: (node: any) => string;
|
|
60
|
+
export declare const collectTargets: (node: any) => string[];
|
|
61
|
+
export declare const buildGraph: (definition: WorkflowDefinition) => Map<string, Set<string>>;
|
|
62
|
+
export declare const toEdgeSet: (graph: Map<string, Set<string>>) => Set<string>;
|
|
63
|
+
export declare const traverseGraph: (graph: Map<string, Set<string>>, startNodes: string[]) => Set<string>;
|
|
64
|
+
export declare const reverseGraph: (graph: Map<string, Set<string>>) => Map<string, Set<string>>;
|
|
@@ -0,0 +1,304 @@
|
|
|
1
|
+
import { SchemaValidator } from "../../../engine/SchemaValidator.js";
|
|
2
|
+
import { getSupportedEdgeKinds } from "../../../model/WorkflowGraph.js";
|
|
3
|
+
import { getNodeConfigJsonSchema, getWorkflowDefinitionJsonSchema, } from "../../../model/WorkflowSchema.js";
|
|
4
|
+
import { registerBuiltinTemplates, templateRegistry, } from "../../../templates/index.js";
|
|
5
|
+
export function toWorkflowDefinition(definition) {
|
|
6
|
+
return definition;
|
|
7
|
+
}
|
|
8
|
+
export const schemaValidator = new SchemaValidator();
|
|
9
|
+
schemaValidator.registerNodeType("http");
|
|
10
|
+
schemaValidator.registerNodeType("sql");
|
|
11
|
+
schemaValidator.registerNodeType("queue");
|
|
12
|
+
schemaValidator.registerNodeType("condition");
|
|
13
|
+
schemaValidator.registerNodeType("router");
|
|
14
|
+
schemaValidator.registerNodeType("loop");
|
|
15
|
+
registerBuiltinTemplates(templateRegistry);
|
|
16
|
+
export { templateRegistry };
|
|
17
|
+
export const workflowSchema = {
|
|
18
|
+
$id: "https://ts-workflow-engine.local/workflow.schema.json",
|
|
19
|
+
...getWorkflowDefinitionJsonSchema(),
|
|
20
|
+
};
|
|
21
|
+
const NODE_TYPE_CATALOG = [
|
|
22
|
+
{
|
|
23
|
+
type: "action",
|
|
24
|
+
label: "Action",
|
|
25
|
+
category: "core",
|
|
26
|
+
description: "Runs custom application code, registered as a JS function at register() time. Not editable from a form — config has no declarative schema.",
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
type: "wait",
|
|
30
|
+
label: "Wait",
|
|
31
|
+
category: "core",
|
|
32
|
+
description: "Pauses the instance for `config.durationMs`, until `config.until` (an absolute ISO timestamp), or the legacy `timeout` field.",
|
|
33
|
+
example: { durationMs: 5000 },
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
type: "event",
|
|
37
|
+
label: "Event",
|
|
38
|
+
category: "core",
|
|
39
|
+
description: "Waits for an external event named `onEvent` to resume.",
|
|
40
|
+
example: { onEvent: "order.paid" },
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
type: "rollback",
|
|
44
|
+
label: "Rollback",
|
|
45
|
+
category: "core",
|
|
46
|
+
description: "Executes compensation logic for a prior node.",
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
type: "subworkflow",
|
|
50
|
+
label: "Subworkflow",
|
|
51
|
+
category: "core",
|
|
52
|
+
description: "Starts another registered workflow (subworkflowId) and optionally waits for completion.",
|
|
53
|
+
example: { subworkflowId: "", waitForCompletion: true },
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
type: "http",
|
|
57
|
+
label: "HTTP Request",
|
|
58
|
+
category: "io",
|
|
59
|
+
description: "Calls an external HTTP endpoint.",
|
|
60
|
+
example: { method: "GET", url: "https://api.example.com/resource" },
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
type: "sql",
|
|
64
|
+
label: "SQL Query",
|
|
65
|
+
category: "io",
|
|
66
|
+
description: "Executes a SQL query against a configured connection.",
|
|
67
|
+
example: { connection: "default", query: "SELECT * FROM table" },
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
type: "queue",
|
|
71
|
+
label: "Queue",
|
|
72
|
+
category: "io",
|
|
73
|
+
description: "Publishes to or consumes from a message queue.",
|
|
74
|
+
example: {
|
|
75
|
+
operation: "publish",
|
|
76
|
+
queue: "default",
|
|
77
|
+
message: { text: "msg" },
|
|
78
|
+
},
|
|
79
|
+
},
|
|
80
|
+
{
|
|
81
|
+
type: "notification",
|
|
82
|
+
label: "Notification",
|
|
83
|
+
category: "io",
|
|
84
|
+
description: "Sends a notification via Slack/Feishu/DingTalk/email/webhook.",
|
|
85
|
+
example: { channel: "slack", target: "#alerts", template: "{{message}}" },
|
|
86
|
+
},
|
|
87
|
+
{
|
|
88
|
+
type: "condition",
|
|
89
|
+
label: "Condition",
|
|
90
|
+
category: "control",
|
|
91
|
+
description: "Branches to one of two nodes (trueBranch/falseBranch) based on a boolean expression.",
|
|
92
|
+
example: { condition: "${context.flag === true}" },
|
|
93
|
+
},
|
|
94
|
+
{
|
|
95
|
+
type: "router",
|
|
96
|
+
label: "Router",
|
|
97
|
+
category: "control",
|
|
98
|
+
description: "Branches to one of several nodes based on ordered route conditions, falling back to defaultTarget.",
|
|
99
|
+
example: {
|
|
100
|
+
routes: [{ condition: "${context.type === 'vip'}", target: "" }],
|
|
101
|
+
},
|
|
102
|
+
},
|
|
103
|
+
{
|
|
104
|
+
type: "loop",
|
|
105
|
+
label: "Loop",
|
|
106
|
+
category: "control",
|
|
107
|
+
description: "Iterates `collection`, executing a `body` node per item.",
|
|
108
|
+
example: { collection: "${context.items}", itemVariable: "item" },
|
|
109
|
+
},
|
|
110
|
+
{
|
|
111
|
+
type: "approval",
|
|
112
|
+
label: "Approval",
|
|
113
|
+
category: "control",
|
|
114
|
+
description: "Waits for an approve/reject signal before branching (approvedTarget/rejectedTarget).",
|
|
115
|
+
example: { prompt: "Approve this request?" },
|
|
116
|
+
},
|
|
117
|
+
{
|
|
118
|
+
type: "join",
|
|
119
|
+
label: "Join",
|
|
120
|
+
category: "control",
|
|
121
|
+
description: "Waits for multiple fan-out branches (waitFor) to complete before proceeding — mode 'all' (default) requires every branch, 'any' proceeds once one has.",
|
|
122
|
+
example: { waitFor: ["branchA", "branchB"], mode: "all" },
|
|
123
|
+
},
|
|
124
|
+
{
|
|
125
|
+
type: "transform",
|
|
126
|
+
label: "Transform",
|
|
127
|
+
category: "control",
|
|
128
|
+
description: "Reshapes prior node outputs into a new output object; each `output` field is an expression, evaluated (not string-interpolated) so numbers/arrays/objects keep their type.",
|
|
129
|
+
example: { output: { total: "${node1.output.price * node1.output.qty}" } },
|
|
130
|
+
},
|
|
131
|
+
];
|
|
132
|
+
export const nodeTemplates = NODE_TYPE_CATALOG.map((entry) => ({
|
|
133
|
+
...entry,
|
|
134
|
+
configSchema: getNodeConfigJsonSchema(entry.type),
|
|
135
|
+
ports: getSupportedEdgeKinds(entry.type),
|
|
136
|
+
}));
|
|
137
|
+
export async function persistImportedWorkflow(storage, workflowDefinition, options) {
|
|
138
|
+
const existing = await storage.loadWorkflowWithMetadata(workflowDefinition.id);
|
|
139
|
+
if (existing && !options.overwrite) {
|
|
140
|
+
return "conflict";
|
|
141
|
+
}
|
|
142
|
+
const now = Date.now();
|
|
143
|
+
const nextVersion = existing ? existing.version + 1 : 1;
|
|
144
|
+
const storedWorkflow = {
|
|
145
|
+
id: workflowDefinition.id,
|
|
146
|
+
name: workflowDefinition.name,
|
|
147
|
+
description: options.description ?? existing?.description,
|
|
148
|
+
definition: workflowDefinition,
|
|
149
|
+
version: nextVersion,
|
|
150
|
+
publishedVersion: existing?.publishedVersion ?? nextVersion,
|
|
151
|
+
lockedVersion: existing?.lockedVersion,
|
|
152
|
+
releasePolicy: existing?.releasePolicy,
|
|
153
|
+
createdAt: existing?.createdAt ?? now,
|
|
154
|
+
updatedAt: now,
|
|
155
|
+
tags: options.tags ?? existing?.tags,
|
|
156
|
+
};
|
|
157
|
+
await storage.saveWorkflowWithMetadata(storedWorkflow);
|
|
158
|
+
const workflowVersion = {
|
|
159
|
+
id: storedWorkflow.id,
|
|
160
|
+
name: storedWorkflow.name,
|
|
161
|
+
description: storedWorkflow.description,
|
|
162
|
+
definition: storedWorkflow.definition,
|
|
163
|
+
version: storedWorkflow.version,
|
|
164
|
+
createdAt: now,
|
|
165
|
+
tags: storedWorkflow.tags,
|
|
166
|
+
metadata: storedWorkflow.definition.metadata,
|
|
167
|
+
};
|
|
168
|
+
await storage.saveWorkflowVersion(workflowVersion);
|
|
169
|
+
return storedWorkflow;
|
|
170
|
+
}
|
|
171
|
+
export const sanitizeValue = (value) => {
|
|
172
|
+
if (value === null || value === undefined)
|
|
173
|
+
return value;
|
|
174
|
+
if (typeof value === "function")
|
|
175
|
+
return undefined;
|
|
176
|
+
if (Array.isArray(value)) {
|
|
177
|
+
const items = value
|
|
178
|
+
.map((item) => sanitizeValue(item))
|
|
179
|
+
.filter((item) => item !== undefined);
|
|
180
|
+
return items;
|
|
181
|
+
}
|
|
182
|
+
if (typeof value === "object") {
|
|
183
|
+
const result = {};
|
|
184
|
+
Object.entries(value).forEach(([key, item]) => {
|
|
185
|
+
if (typeof item === "function")
|
|
186
|
+
return;
|
|
187
|
+
const sanitized = sanitizeValue(item);
|
|
188
|
+
if (sanitized !== undefined) {
|
|
189
|
+
result[key] = sanitized;
|
|
190
|
+
}
|
|
191
|
+
});
|
|
192
|
+
return result;
|
|
193
|
+
}
|
|
194
|
+
return value;
|
|
195
|
+
};
|
|
196
|
+
export const stableStringify = (value) => {
|
|
197
|
+
if (value === null || value === undefined)
|
|
198
|
+
return JSON.stringify(value);
|
|
199
|
+
if (typeof value !== "object")
|
|
200
|
+
return JSON.stringify(value);
|
|
201
|
+
if (Array.isArray(value)) {
|
|
202
|
+
return `[${value.map((item) => stableStringify(item)).join(",")}]`;
|
|
203
|
+
}
|
|
204
|
+
const entries = Object.entries(value).sort(([a], [b]) => a.localeCompare(b));
|
|
205
|
+
return `{${entries
|
|
206
|
+
.map(([key, item]) => `${JSON.stringify(key)}:${stableStringify(item)}`)
|
|
207
|
+
.join(",")}}`;
|
|
208
|
+
};
|
|
209
|
+
export const getNodeSignature = (node) => {
|
|
210
|
+
return stableStringify(sanitizeValue(node));
|
|
211
|
+
};
|
|
212
|
+
export const collectTargets = (node) => {
|
|
213
|
+
const targets = new Set();
|
|
214
|
+
const addValue = (value) => {
|
|
215
|
+
if (!value)
|
|
216
|
+
return;
|
|
217
|
+
if (Array.isArray(value)) {
|
|
218
|
+
value.forEach((entry) => {
|
|
219
|
+
addValue(entry);
|
|
220
|
+
});
|
|
221
|
+
return;
|
|
222
|
+
}
|
|
223
|
+
if (typeof value === "string") {
|
|
224
|
+
targets.add(value);
|
|
225
|
+
return;
|
|
226
|
+
}
|
|
227
|
+
if (typeof value === "object" && value.target) {
|
|
228
|
+
targets.add(value.target);
|
|
229
|
+
}
|
|
230
|
+
};
|
|
231
|
+
addValue(node.next);
|
|
232
|
+
addValue(node.failureNext);
|
|
233
|
+
addValue(node.conditionalNext);
|
|
234
|
+
addValue(node.defaultNext);
|
|
235
|
+
addValue(node.rollbackTo);
|
|
236
|
+
addValue(node.onSuccess);
|
|
237
|
+
addValue(node.onFailure);
|
|
238
|
+
if (node.config) {
|
|
239
|
+
addValue(node.config.trueBranch);
|
|
240
|
+
addValue(node.config.falseBranch);
|
|
241
|
+
addValue(node.config.defaultTarget);
|
|
242
|
+
addValue(node.config.body);
|
|
243
|
+
if (Array.isArray(node.config.routes)) {
|
|
244
|
+
node.config.routes.forEach((route) => {
|
|
245
|
+
addValue(route?.target);
|
|
246
|
+
});
|
|
247
|
+
}
|
|
248
|
+
}
|
|
249
|
+
return Array.from(targets);
|
|
250
|
+
};
|
|
251
|
+
export const buildGraph = (definition) => {
|
|
252
|
+
const adjacency = new Map();
|
|
253
|
+
if (!definition?.nodes) {
|
|
254
|
+
return adjacency;
|
|
255
|
+
}
|
|
256
|
+
Object.entries(definition.nodes).forEach(([nodeId, node]) => {
|
|
257
|
+
const targets = collectTargets(node);
|
|
258
|
+
adjacency.set(nodeId, new Set(targets));
|
|
259
|
+
});
|
|
260
|
+
return adjacency;
|
|
261
|
+
};
|
|
262
|
+
export const toEdgeSet = (graph) => {
|
|
263
|
+
const edges = new Set();
|
|
264
|
+
for (const [source, targets] of graph.entries()) {
|
|
265
|
+
for (const target of targets) {
|
|
266
|
+
edges.add(`${source}->${target}`);
|
|
267
|
+
}
|
|
268
|
+
}
|
|
269
|
+
return edges;
|
|
270
|
+
};
|
|
271
|
+
export const traverseGraph = (graph, startNodes) => {
|
|
272
|
+
const visited = new Set();
|
|
273
|
+
const stack = [...startNodes];
|
|
274
|
+
while (stack.length > 0) {
|
|
275
|
+
const current = stack.pop();
|
|
276
|
+
if (visited.has(current))
|
|
277
|
+
continue;
|
|
278
|
+
visited.add(current);
|
|
279
|
+
const next = graph.get(current);
|
|
280
|
+
if (next) {
|
|
281
|
+
next.forEach((nodeId) => {
|
|
282
|
+
if (!visited.has(nodeId)) {
|
|
283
|
+
stack.push(nodeId);
|
|
284
|
+
}
|
|
285
|
+
});
|
|
286
|
+
}
|
|
287
|
+
}
|
|
288
|
+
return visited;
|
|
289
|
+
};
|
|
290
|
+
export const reverseGraph = (graph) => {
|
|
291
|
+
const reversed = new Map();
|
|
292
|
+
for (const [source, targets] of graph.entries()) {
|
|
293
|
+
if (!reversed.has(source)) {
|
|
294
|
+
reversed.set(source, new Set());
|
|
295
|
+
}
|
|
296
|
+
targets.forEach((target) => {
|
|
297
|
+
const set = reversed.get(target) || new Set();
|
|
298
|
+
set.add(source);
|
|
299
|
+
reversed.set(target, set);
|
|
300
|
+
});
|
|
301
|
+
}
|
|
302
|
+
return reversed;
|
|
303
|
+
};
|
|
304
|
+
//# sourceMappingURL=shared.js.map
|