@solidxai/core 0.1.12 → 0.1.13-beta.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/controllers/view-metadata.controller.d.ts +1 -1
- package/dist/controllers/workflow-definition.controller.d.ts +38 -0
- package/dist/controllers/workflow-definition.controller.d.ts.map +1 -0
- package/dist/controllers/workflow-definition.controller.js +272 -0
- package/dist/controllers/workflow-definition.controller.js.map +1 -0
- package/dist/controllers/workflow-execution-artifact.controller.d.ts +24 -0
- package/dist/controllers/workflow-execution-artifact.controller.d.ts.map +1 -0
- package/dist/controllers/workflow-execution-artifact.controller.js +179 -0
- package/dist/controllers/workflow-execution-artifact.controller.js.map +1 -0
- package/dist/controllers/workflow-execution-log.controller.d.ts +24 -0
- package/dist/controllers/workflow-execution-log.controller.d.ts.map +1 -0
- package/dist/controllers/workflow-execution-log.controller.js +179 -0
- package/dist/controllers/workflow-execution-log.controller.js.map +1 -0
- package/dist/controllers/workflow-execution.controller.d.ts +29 -0
- package/dist/controllers/workflow-execution.controller.d.ts.map +1 -0
- package/dist/controllers/workflow-execution.controller.js +227 -0
- package/dist/controllers/workflow-execution.controller.js.map +1 -0
- package/dist/controllers/workflow-secret.controller.d.ts +24 -0
- package/dist/controllers/workflow-secret.controller.d.ts.map +1 -0
- package/dist/controllers/workflow-secret.controller.js +179 -0
- package/dist/controllers/workflow-secret.controller.js.map +1 -0
- package/dist/controllers/workflow-step-execution.controller.d.ts +24 -0
- package/dist/controllers/workflow-step-execution.controller.d.ts.map +1 -0
- package/dist/controllers/workflow-step-execution.controller.js +179 -0
- package/dist/controllers/workflow-step-execution.controller.js.map +1 -0
- package/dist/controllers/workflow-trigger-execution.controller.d.ts +24 -0
- package/dist/controllers/workflow-trigger-execution.controller.d.ts.map +1 -0
- package/dist/controllers/workflow-trigger-execution.controller.js +179 -0
- package/dist/controllers/workflow-trigger-execution.controller.js.map +1 -0
- package/dist/decorators/workflow-field-data-provider.decorator.d.ts +3 -0
- package/dist/decorators/workflow-field-data-provider.decorator.d.ts.map +1 -0
- package/dist/decorators/workflow-field-data-provider.decorator.js +11 -0
- package/dist/decorators/workflow-field-data-provider.decorator.js.map +1 -0
- package/dist/decorators/workflow-node-provider.decorator.d.ts +4 -0
- package/dist/decorators/workflow-node-provider.decorator.d.ts.map +1 -0
- package/dist/decorators/workflow-node-provider.decorator.js +13 -0
- package/dist/decorators/workflow-node-provider.decorator.js.map +1 -0
- package/dist/dtos/create-workflow-definition.dto.d.ts +14 -0
- package/dist/dtos/create-workflow-definition.dto.d.ts.map +1 -0
- package/dist/dtos/create-workflow-definition.dto.js +92 -0
- package/dist/dtos/create-workflow-definition.dto.js.map +1 -0
- package/dist/dtos/create-workflow-execution-artifact.dto.d.ts +22 -0
- package/dist/dtos/create-workflow-execution-artifact.dto.d.ts.map +1 -0
- package/dist/dtos/create-workflow-execution-artifact.dto.js +139 -0
- package/dist/dtos/create-workflow-execution-artifact.dto.js.map +1 -0
- package/dist/dtos/create-workflow-execution-log.dto.d.ts +18 -0
- package/dist/dtos/create-workflow-execution-log.dto.d.ts.map +1 -0
- package/dist/dtos/create-workflow-execution-log.dto.js +116 -0
- package/dist/dtos/create-workflow-execution-log.dto.js.map +1 -0
- package/dist/dtos/create-workflow-execution.dto.d.ts +33 -0
- package/dist/dtos/create-workflow-execution.dto.d.ts.map +1 -0
- package/dist/dtos/create-workflow-execution.dto.js +186 -0
- package/dist/dtos/create-workflow-execution.dto.js.map +1 -0
- package/dist/dtos/create-workflow-secret.dto.d.ts +11 -0
- package/dist/dtos/create-workflow-secret.dto.d.ts.map +1 -0
- package/dist/dtos/create-workflow-secret.dto.js +74 -0
- package/dist/dtos/create-workflow-secret.dto.js.map +1 -0
- package/dist/dtos/create-workflow-step-execution.dto.d.ts +27 -0
- package/dist/dtos/create-workflow-step-execution.dto.d.ts.map +1 -0
- package/dist/dtos/create-workflow-step-execution.dto.js +171 -0
- package/dist/dtos/create-workflow-step-execution.dto.js.map +1 -0
- package/dist/dtos/create-workflow-trigger-execution.dto.d.ts +25 -0
- package/dist/dtos/create-workflow-trigger-execution.dto.d.ts.map +1 -0
- package/dist/dtos/create-workflow-trigger-execution.dto.js +158 -0
- package/dist/dtos/create-workflow-trigger-execution.dto.js.map +1 -0
- package/dist/dtos/execute-workflow.dto.d.ts +7 -0
- package/dist/dtos/execute-workflow.dto.d.ts.map +1 -0
- package/dist/dtos/execute-workflow.dto.js +11 -0
- package/dist/dtos/execute-workflow.dto.js.map +1 -0
- package/dist/dtos/update-workflow-definition.dto.d.ts +15 -0
- package/dist/dtos/update-workflow-definition.dto.d.ts.map +1 -0
- package/dist/dtos/update-workflow-definition.dto.js +97 -0
- package/dist/dtos/update-workflow-definition.dto.js.map +1 -0
- package/dist/dtos/update-workflow-execution-artifact.dto.d.ts +23 -0
- package/dist/dtos/update-workflow-execution-artifact.dto.d.ts.map +1 -0
- package/dist/dtos/update-workflow-execution-artifact.dto.js +143 -0
- package/dist/dtos/update-workflow-execution-artifact.dto.js.map +1 -0
- package/dist/dtos/update-workflow-execution-log.dto.d.ts +19 -0
- package/dist/dtos/update-workflow-execution-log.dto.d.ts.map +1 -0
- package/dist/dtos/update-workflow-execution-log.dto.js +121 -0
- package/dist/dtos/update-workflow-execution-log.dto.js.map +1 -0
- package/dist/dtos/update-workflow-execution.dto.d.ts +34 -0
- package/dist/dtos/update-workflow-execution.dto.d.ts.map +1 -0
- package/dist/dtos/update-workflow-execution.dto.js +190 -0
- package/dist/dtos/update-workflow-execution.dto.js.map +1 -0
- package/dist/dtos/update-workflow-secret.dto.d.ts +12 -0
- package/dist/dtos/update-workflow-secret.dto.d.ts.map +1 -0
- package/dist/dtos/update-workflow-secret.dto.js +80 -0
- package/dist/dtos/update-workflow-secret.dto.js.map +1 -0
- package/dist/dtos/update-workflow-step-execution.dto.d.ts +28 -0
- package/dist/dtos/update-workflow-step-execution.dto.d.ts.map +1 -0
- package/dist/dtos/update-workflow-step-execution.dto.js +175 -0
- package/dist/dtos/update-workflow-step-execution.dto.js.map +1 -0
- package/dist/dtos/update-workflow-trigger-execution.dto.d.ts +26 -0
- package/dist/dtos/update-workflow-trigger-execution.dto.d.ts.map +1 -0
- package/dist/dtos/update-workflow-trigger-execution.dto.js +163 -0
- package/dist/dtos/update-workflow-trigger-execution.dto.js.map +1 -0
- package/dist/dtos/validate-workflow-definition.dto.d.ts +4 -0
- package/dist/dtos/validate-workflow-definition.dto.d.ts.map +1 -0
- package/dist/dtos/validate-workflow-definition.dto.js +11 -0
- package/dist/dtos/validate-workflow-definition.dto.js.map +1 -0
- package/dist/entities/saved-filters.entity.js +3 -3
- package/dist/entities/saved-filters.entity.js.map +1 -1
- package/dist/entities/workflow-definition.entity.d.ts +15 -0
- package/dist/entities/workflow-definition.entity.d.ts.map +1 -0
- package/dist/entities/workflow-definition.entity.js +77 -0
- package/dist/entities/workflow-definition.entity.js.map +1 -0
- package/dist/entities/workflow-execution-artifact.entity.d.ts +23 -0
- package/dist/entities/workflow-execution-artifact.entity.d.ts.map +1 -0
- package/dist/entities/workflow-execution-artifact.entity.js +113 -0
- package/dist/entities/workflow-execution-artifact.entity.js.map +1 -0
- package/dist/entities/workflow-execution-log.entity.d.ts +19 -0
- package/dist/entities/workflow-execution-log.entity.d.ts.map +1 -0
- package/dist/entities/workflow-execution-log.entity.js +95 -0
- package/dist/entities/workflow-execution-log.entity.js.map +1 -0
- package/dist/entities/workflow-execution.entity.d.ts +28 -0
- package/dist/entities/workflow-execution.entity.d.ts.map +1 -0
- package/dist/entities/workflow-execution.entity.js +124 -0
- package/dist/entities/workflow-execution.entity.js.map +1 -0
- package/dist/entities/workflow-secret.entity.d.ts +12 -0
- package/dist/entities/workflow-secret.entity.d.ts.map +1 -0
- package/dist/entities/workflow-secret.entity.js +66 -0
- package/dist/entities/workflow-secret.entity.js.map +1 -0
- package/dist/entities/workflow-step-execution.entity.d.ts +28 -0
- package/dist/entities/workflow-step-execution.entity.d.ts.map +1 -0
- package/dist/entities/workflow-step-execution.entity.js +138 -0
- package/dist/entities/workflow-step-execution.entity.js.map +1 -0
- package/dist/entities/workflow-trigger-execution.entity.d.ts +26 -0
- package/dist/entities/workflow-trigger-execution.entity.d.ts.map +1 -0
- package/dist/entities/workflow-trigger-execution.entity.js +127 -0
- package/dist/entities/workflow-trigger-execution.entity.js.map +1 -0
- package/dist/factories/sms.factory.d.ts.map +1 -1
- package/dist/factories/sms.factory.js +4 -1
- package/dist/factories/sms.factory.js.map +1 -1
- package/dist/helpers/solid-registry.d.ts +5 -1
- package/dist/helpers/solid-registry.d.ts.map +1 -1
- package/dist/helpers/solid-registry.js +17 -0
- package/dist/helpers/solid-registry.js.map +1 -1
- package/dist/index.d.ts +55 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +55 -0
- package/dist/index.js.map +1 -1
- package/dist/interfaces/workflow-node-handler.interface.d.ts +5 -0
- package/dist/interfaces/workflow-node-handler.interface.d.ts.map +1 -0
- package/dist/interfaces/workflow-node-handler.interface.js +3 -0
- package/dist/interfaces/workflow-node-handler.interface.js.map +1 -0
- package/dist/interfaces.d.ts +24 -0
- package/dist/interfaces.d.ts.map +1 -1
- package/dist/interfaces.js.map +1 -1
- package/dist/jobs/database/workflow-execution-publisher-database.service.d.ts +12 -0
- package/dist/jobs/database/workflow-execution-publisher-database.service.d.ts.map +1 -0
- package/dist/jobs/database/workflow-execution-publisher-database.service.js +39 -0
- package/dist/jobs/database/workflow-execution-publisher-database.service.js.map +1 -0
- package/dist/jobs/database/workflow-execution-queue-options-database.d.ts +8 -0
- package/dist/jobs/database/workflow-execution-queue-options-database.d.ts.map +1 -0
- package/dist/jobs/database/workflow-execution-queue-options-database.js +10 -0
- package/dist/jobs/database/workflow-execution-queue-options-database.js.map +1 -0
- package/dist/jobs/database/workflow-execution-subscriber-database.service.d.ts +19 -0
- package/dist/jobs/database/workflow-execution-subscriber-database.service.d.ts.map +1 -0
- package/dist/jobs/database/workflow-execution-subscriber-database.service.js +55 -0
- package/dist/jobs/database/workflow-execution-subscriber-database.service.js.map +1 -0
- package/dist/jobs/rabbitmq/workflow-execution-publisher.service.d.ts +12 -0
- package/dist/jobs/rabbitmq/workflow-execution-publisher.service.d.ts.map +1 -0
- package/dist/jobs/rabbitmq/workflow-execution-publisher.service.js +39 -0
- package/dist/jobs/rabbitmq/workflow-execution-publisher.service.js.map +1 -0
- package/dist/jobs/rabbitmq/workflow-execution-queue-options.d.ts +8 -0
- package/dist/jobs/rabbitmq/workflow-execution-queue-options.d.ts.map +1 -0
- package/dist/jobs/rabbitmq/workflow-execution-queue-options.js +10 -0
- package/dist/jobs/rabbitmq/workflow-execution-queue-options.js.map +1 -0
- package/dist/jobs/rabbitmq/workflow-execution-subscriber.service.d.ts +17 -0
- package/dist/jobs/rabbitmq/workflow-execution-subscriber.service.d.ts.map +1 -0
- package/dist/jobs/rabbitmq/workflow-execution-subscriber.service.js +52 -0
- package/dist/jobs/rabbitmq/workflow-execution-subscriber.service.js.map +1 -0
- package/dist/jobs/redis/workflow-execution-publisher-redis.service.d.ts +12 -0
- package/dist/jobs/redis/workflow-execution-publisher-redis.service.d.ts.map +1 -0
- package/dist/jobs/redis/workflow-execution-publisher-redis.service.js +39 -0
- package/dist/jobs/redis/workflow-execution-publisher-redis.service.js.map +1 -0
- package/dist/jobs/redis/workflow-execution-queue-options-redis.d.ts +8 -0
- package/dist/jobs/redis/workflow-execution-queue-options-redis.d.ts.map +1 -0
- package/dist/jobs/redis/workflow-execution-queue-options-redis.js +10 -0
- package/dist/jobs/redis/workflow-execution-queue-options-redis.js.map +1 -0
- package/dist/jobs/redis/workflow-execution-subscriber-redis.service.d.ts +17 -0
- package/dist/jobs/redis/workflow-execution-subscriber-redis.service.d.ts.map +1 -0
- package/dist/jobs/redis/workflow-execution-subscriber-redis.service.js +52 -0
- package/dist/jobs/redis/workflow-execution-subscriber-redis.service.js.map +1 -0
- package/dist/repository/security-rule.repository.d.ts +1 -0
- package/dist/repository/security-rule.repository.d.ts.map +1 -1
- package/dist/repository/security-rule.repository.js +28 -7
- package/dist/repository/security-rule.repository.js.map +1 -1
- package/dist/repository/workflow-definition.repository.d.ts +12 -0
- package/dist/repository/workflow-definition.repository.d.ts.map +1 -0
- package/dist/repository/workflow-definition.repository.js +39 -0
- package/dist/repository/workflow-definition.repository.js.map +1 -0
- package/dist/repository/workflow-execution-artifact.repository.d.ts +12 -0
- package/dist/repository/workflow-execution-artifact.repository.d.ts.map +1 -0
- package/dist/repository/workflow-execution-artifact.repository.js +39 -0
- package/dist/repository/workflow-execution-artifact.repository.js.map +1 -0
- package/dist/repository/workflow-execution-log.repository.d.ts +12 -0
- package/dist/repository/workflow-execution-log.repository.d.ts.map +1 -0
- package/dist/repository/workflow-execution-log.repository.js +39 -0
- package/dist/repository/workflow-execution-log.repository.js.map +1 -0
- package/dist/repository/workflow-execution.repository.d.ts +12 -0
- package/dist/repository/workflow-execution.repository.d.ts.map +1 -0
- package/dist/repository/workflow-execution.repository.js +39 -0
- package/dist/repository/workflow-execution.repository.js.map +1 -0
- package/dist/repository/workflow-secret.repository.d.ts +12 -0
- package/dist/repository/workflow-secret.repository.d.ts.map +1 -0
- package/dist/repository/workflow-secret.repository.js +39 -0
- package/dist/repository/workflow-secret.repository.js.map +1 -0
- package/dist/repository/workflow-step-execution.repository.d.ts +12 -0
- package/dist/repository/workflow-step-execution.repository.d.ts.map +1 -0
- package/dist/repository/workflow-step-execution.repository.js +39 -0
- package/dist/repository/workflow-step-execution.repository.js.map +1 -0
- package/dist/repository/workflow-trigger-execution.repository.d.ts +12 -0
- package/dist/repository/workflow-trigger-execution.repository.d.ts.map +1 -0
- package/dist/repository/workflow-trigger-execution.repository.js +39 -0
- package/dist/repository/workflow-trigger-execution.repository.js.map +1 -0
- package/dist/seeders/module-metadata-seeder.service.d.ts +6 -0
- package/dist/seeders/module-metadata-seeder.service.d.ts.map +1 -1
- package/dist/seeders/module-metadata-seeder.service.js +141 -0
- package/dist/seeders/module-metadata-seeder.service.js.map +1 -1
- package/dist/seeders/seed-data/solid-core-metadata.json +11437 -5567
- package/dist/services/chatter-message.service.d.ts.map +1 -1
- package/dist/services/chatter-message.service.js +1 -1
- package/dist/services/chatter-message.service.js.map +1 -1
- package/dist/services/crud-helper.service.d.ts +16 -1
- package/dist/services/crud-helper.service.d.ts.map +1 -1
- package/dist/services/crud-helper.service.js +99 -22
- package/dist/services/crud-helper.service.js.map +1 -1
- package/dist/services/crud.service.d.ts +1 -0
- package/dist/services/crud.service.d.ts.map +1 -1
- package/dist/services/crud.service.js +15 -0
- package/dist/services/crud.service.js.map +1 -1
- package/dist/services/solid-introspect.service.d.ts +1 -0
- package/dist/services/solid-introspect.service.d.ts.map +1 -1
- package/dist/services/solid-introspect.service.js +12 -0
- package/dist/services/solid-introspect.service.js.map +1 -1
- package/dist/services/view-metadata.service.d.ts +5 -1
- package/dist/services/view-metadata.service.d.ts.map +1 -1
- package/dist/services/view-metadata.service.js +63 -14
- package/dist/services/view-metadata.service.js.map +1 -1
- package/dist/services/workflow/nodes/for-each.node.d.ts +6 -0
- package/dist/services/workflow/nodes/for-each.node.d.ts.map +1 -0
- package/dist/services/workflow/nodes/for-each.node.js +95 -0
- package/dist/services/workflow/nodes/for-each.node.js.map +1 -0
- package/dist/services/workflow/nodes/http-request.node.d.ts +13 -0
- package/dist/services/workflow/nodes/http-request.node.d.ts.map +1 -0
- package/dist/services/workflow/nodes/http-request.node.js +549 -0
- package/dist/services/workflow/nodes/http-request.node.js.map +1 -0
- package/dist/services/workflow/nodes/if.node.d.ts +6 -0
- package/dist/services/workflow/nodes/if.node.d.ts.map +1 -0
- package/dist/services/workflow/nodes/if.node.js +93 -0
- package/dist/services/workflow/nodes/if.node.js.map +1 -0
- package/dist/services/workflow/nodes/log-write.node.d.ts +6 -0
- package/dist/services/workflow/nodes/log-write.node.d.ts.map +1 -0
- package/dist/services/workflow/nodes/log-write.node.js +229 -0
- package/dist/services/workflow/nodes/log-write.node.js.map +1 -0
- package/dist/services/workflow/nodes/parallel.node.d.ts +6 -0
- package/dist/services/workflow/nodes/parallel.node.d.ts.map +1 -0
- package/dist/services/workflow/nodes/parallel.node.js +76 -0
- package/dist/services/workflow/nodes/parallel.node.js.map +1 -0
- package/dist/services/workflow/nodes/runtime-python.node.d.ts +13 -0
- package/dist/services/workflow/nodes/runtime-python.node.d.ts.map +1 -0
- package/dist/services/workflow/nodes/runtime-python.node.js +522 -0
- package/dist/services/workflow/nodes/runtime-python.node.js.map +1 -0
- package/dist/services/workflow/nodes/sequential.node.d.ts +6 -0
- package/dist/services/workflow/nodes/sequential.node.d.ts.map +1 -0
- package/dist/services/workflow/nodes/sequential.node.js +61 -0
- package/dist/services/workflow/nodes/sequential.node.js.map +1 -0
- package/dist/services/workflow/nodes/solidx-api.helpers.d.ts +25 -0
- package/dist/services/workflow/nodes/solidx-api.helpers.d.ts.map +1 -0
- package/dist/services/workflow/nodes/solidx-api.helpers.js +143 -0
- package/dist/services/workflow/nodes/solidx-api.helpers.js.map +1 -0
- package/dist/services/workflow/nodes/solidx-crud.nodes.d.ts +48 -0
- package/dist/services/workflow/nodes/solidx-crud.nodes.d.ts.map +1 -0
- package/dist/services/workflow/nodes/solidx-crud.nodes.js +475 -0
- package/dist/services/workflow/nodes/solidx-crud.nodes.js.map +1 -0
- package/dist/services/workflow/nodes/solidx-login.node.d.ts +6 -0
- package/dist/services/workflow/nodes/solidx-login.node.d.ts.map +1 -0
- package/dist/services/workflow/nodes/solidx-login.node.js +208 -0
- package/dist/services/workflow/nodes/solidx-login.node.js.map +1 -0
- package/dist/services/workflow/nodes/solidx-send-email.node.d.ts +11 -0
- package/dist/services/workflow/nodes/solidx-send-email.node.d.ts.map +1 -0
- package/dist/services/workflow/nodes/solidx-send-email.node.js +437 -0
- package/dist/services/workflow/nodes/solidx-send-email.node.js.map +1 -0
- package/dist/services/workflow/nodes/solidx-send-sms.node.d.ts +10 -0
- package/dist/services/workflow/nodes/solidx-send-sms.node.d.ts.map +1 -0
- package/dist/services/workflow/nodes/solidx-send-sms.node.js +347 -0
- package/dist/services/workflow/nodes/solidx-send-sms.node.js.map +1 -0
- package/dist/services/workflow/nodes/switch.node.d.ts +7 -0
- package/dist/services/workflow/nodes/switch.node.d.ts.map +1 -0
- package/dist/services/workflow/nodes/switch.node.js +113 -0
- package/dist/services/workflow/nodes/switch.node.js.map +1 -0
- package/dist/services/workflow/workflow-definition-metadata-sync.service.d.ts +19 -0
- package/dist/services/workflow/workflow-definition-metadata-sync.service.d.ts.map +1 -0
- package/dist/services/workflow/workflow-definition-metadata-sync.service.js +187 -0
- package/dist/services/workflow/workflow-definition-metadata-sync.service.js.map +1 -0
- package/dist/services/workflow/workflow-definition-validator.service.d.ts +13 -0
- package/dist/services/workflow/workflow-definition-validator.service.d.ts.map +1 -0
- package/dist/services/workflow/workflow-definition-validator.service.js +163 -0
- package/dist/services/workflow/workflow-definition-validator.service.js.map +1 -0
- package/dist/services/workflow/workflow-execution-writer.service.d.ts +26 -0
- package/dist/services/workflow/workflow-execution-writer.service.d.ts.map +1 -0
- package/dist/services/workflow/workflow-execution-writer.service.js +191 -0
- package/dist/services/workflow/workflow-execution-writer.service.js.map +1 -0
- package/dist/services/workflow/workflow-expression.service.d.ts +14 -0
- package/dist/services/workflow/workflow-expression.service.d.ts.map +1 -0
- package/dist/services/workflow/workflow-expression.service.js +152 -0
- package/dist/services/workflow/workflow-expression.service.js.map +1 -0
- package/dist/services/workflow/workflow-invocation.service.d.ts +11 -0
- package/dist/services/workflow/workflow-invocation.service.d.ts.map +1 -0
- package/dist/services/workflow/workflow-invocation.service.js +37 -0
- package/dist/services/workflow/workflow-invocation.service.js.map +1 -0
- package/dist/services/workflow/workflow-node-registry.service.d.ts +18 -0
- package/dist/services/workflow/workflow-node-registry.service.d.ts.map +1 -0
- package/dist/services/workflow/workflow-node-registry.service.js +110 -0
- package/dist/services/workflow/workflow-node-registry.service.js.map +1 -0
- package/dist/services/workflow/workflow-runtime.service.d.ts +53 -0
- package/dist/services/workflow/workflow-runtime.service.d.ts.map +1 -0
- package/dist/services/workflow/workflow-runtime.service.js +541 -0
- package/dist/services/workflow/workflow-runtime.service.js.map +1 -0
- package/dist/services/workflow/workflow-scheduled-trigger.job.d.ts +10 -0
- package/dist/services/workflow/workflow-scheduled-trigger.job.d.ts.map +1 -0
- package/dist/services/workflow/workflow-scheduled-trigger.job.js +37 -0
- package/dist/services/workflow/workflow-scheduled-trigger.job.js.map +1 -0
- package/dist/services/workflow-definition.service.d.ts +52 -0
- package/dist/services/workflow-definition.service.d.ts.map +1 -0
- package/dist/services/workflow-definition.service.js +251 -0
- package/dist/services/workflow-definition.service.js.map +1 -0
- package/dist/services/workflow-execution-artifact.service.d.ts +12 -0
- package/dist/services/workflow-execution-artifact.service.d.ts.map +1 -0
- package/dist/services/workflow-execution-artifact.service.js +38 -0
- package/dist/services/workflow-execution-artifact.service.js.map +1 -0
- package/dist/services/workflow-execution-log.service.d.ts +12 -0
- package/dist/services/workflow-execution-log.service.d.ts.map +1 -0
- package/dist/services/workflow-execution-log.service.js +38 -0
- package/dist/services/workflow-execution-log.service.js.map +1 -0
- package/dist/services/workflow-execution.service.d.ts +12 -0
- package/dist/services/workflow-execution.service.d.ts.map +1 -0
- package/dist/services/workflow-execution.service.js +38 -0
- package/dist/services/workflow-execution.service.js.map +1 -0
- package/dist/services/workflow-secret.service.d.ts +25 -0
- package/dist/services/workflow-secret.service.d.ts.map +1 -0
- package/dist/services/workflow-secret.service.js +152 -0
- package/dist/services/workflow-secret.service.js.map +1 -0
- package/dist/services/workflow-step-execution.service.d.ts +12 -0
- package/dist/services/workflow-step-execution.service.d.ts.map +1 -0
- package/dist/services/workflow-step-execution.service.js +38 -0
- package/dist/services/workflow-step-execution.service.js.map +1 -0
- package/dist/services/workflow-trigger-execution.service.d.ts +12 -0
- package/dist/services/workflow-trigger-execution.service.d.ts.map +1 -0
- package/dist/services/workflow-trigger-execution.service.js +38 -0
- package/dist/services/workflow-trigger-execution.service.js.map +1 -0
- package/dist/solid-core.module.d.ts.map +1 -1
- package/dist/solid-core.module.js +117 -0
- package/dist/solid-core.module.js.map +1 -1
- package/dist/transformers/empty-string-to-null-transformer.d.ts +4 -0
- package/dist/transformers/empty-string-to-null-transformer.d.ts.map +1 -0
- package/dist/transformers/empty-string-to-null-transformer.js +12 -0
- package/dist/transformers/empty-string-to-null-transformer.js.map +1 -0
- package/dist/types/workflow-dsl.types.d.ts +277 -0
- package/dist/types/workflow-dsl.types.d.ts.map +1 -0
- package/dist/types/workflow-dsl.types.js +3 -0
- package/dist/types/workflow-dsl.types.js.map +1 -0
- package/dist/types/workflow-execution-queue.types.d.ts +4 -0
- package/dist/types/workflow-execution-queue.types.d.ts.map +1 -0
- package/dist/types/workflow-execution-queue.types.js +3 -0
- package/dist/types/workflow-execution-queue.types.js.map +1 -0
- package/package.json +3 -2
- package/src/controllers/workflow-definition.controller.ts +141 -0
- package/src/controllers/workflow-execution-artifact.controller.ts +93 -0
- package/src/controllers/workflow-execution-log.controller.ts +93 -0
- package/src/controllers/workflow-execution.controller.ts +126 -0
- package/src/controllers/workflow-secret.controller.ts +90 -0
- package/src/controllers/workflow-step-execution.controller.ts +93 -0
- package/src/controllers/workflow-trigger-execution.controller.ts +93 -0
- package/src/decorators/workflow-field-data-provider.decorator.ts +7 -0
- package/src/decorators/workflow-node-provider.decorator.ts +14 -0
- package/src/dtos/create-workflow-definition.dto.ts +60 -0
- package/src/dtos/create-workflow-execution-artifact.dto.ts +99 -0
- package/src/dtos/create-workflow-execution-log.dto.ts +80 -0
- package/src/dtos/create-workflow-execution.dto.ts +137 -0
- package/src/dtos/create-workflow-secret.dto.ts +44 -0
- package/src/dtos/create-workflow-step-execution.dto.ts +123 -0
- package/src/dtos/create-workflow-trigger-execution.dto.ts +114 -0
- package/src/dtos/execute-workflow.dto.ts +6 -0
- package/src/dtos/update-workflow-definition.dto.ts +67 -0
- package/src/dtos/update-workflow-execution-artifact.dto.ts +105 -0
- package/src/dtos/update-workflow-execution-log.dto.ts +87 -0
- package/src/dtos/update-workflow-execution.dto.ts +144 -0
- package/src/dtos/update-workflow-secret.dto.ts +53 -0
- package/src/dtos/update-workflow-step-execution.dto.ts +132 -0
- package/src/dtos/update-workflow-trigger-execution.dto.ts +122 -0
- package/src/dtos/validate-workflow-definition.dto.ts +3 -0
- package/src/entities/saved-filters.entity.ts +3 -3
- package/src/entities/workflow-definition.entity.ts +43 -0
- package/src/entities/workflow-execution-artifact.entity.ts +72 -0
- package/src/entities/workflow-execution-log.entity.ts +58 -0
- package/src/entities/workflow-execution.entity.ts +82 -0
- package/src/entities/workflow-secret.entity.ts +33 -0
- package/src/entities/workflow-step-execution.entity.ts +88 -0
- package/src/entities/workflow-trigger-execution.entity.ts +82 -0
- package/src/factories/sms.factory.ts +4 -1
- package/src/helpers/solid-registry.ts +21 -1
- package/src/index.ts +55 -0
- package/src/interfaces/workflow-node-handler.interface.ts +10 -0
- package/src/interfaces.ts +29 -0
- package/src/jobs/database/workflow-execution-publisher-database.service.ts +24 -0
- package/src/jobs/database/workflow-execution-queue-options-database.ts +9 -0
- package/src/jobs/database/workflow-execution-subscriber-database.service.ts +44 -0
- package/src/jobs/rabbitmq/workflow-execution-publisher.service.ts +24 -0
- package/src/jobs/rabbitmq/workflow-execution-queue-options.ts +9 -0
- package/src/jobs/rabbitmq/workflow-execution-subscriber.service.ts +42 -0
- package/src/jobs/redis/workflow-execution-publisher-redis.service.ts +24 -0
- package/src/jobs/redis/workflow-execution-queue-options-redis.ts +9 -0
- package/src/jobs/redis/workflow-execution-subscriber-redis.service.ts +42 -0
- package/src/repository/security-rule.repository.ts +52 -10
- package/src/repository/workflow-definition.repository.ts +19 -0
- package/src/repository/workflow-execution-artifact.repository.ts +19 -0
- package/src/repository/workflow-execution-log.repository.ts +19 -0
- package/src/repository/workflow-execution.repository.ts +19 -0
- package/src/repository/workflow-secret.repository.ts +19 -0
- package/src/repository/workflow-step-execution.repository.ts +19 -0
- package/src/repository/workflow-trigger-execution.repository.ts +19 -0
- package/src/seeders/module-metadata-seeder.service.ts +166 -4
- package/src/seeders/seed-data/solid-core-metadata.json +11437 -5567
- package/src/services/chatter-message.service.ts +5 -1
- package/src/services/crud-helper.service.ts +220 -22
- package/src/services/crud.service.ts +30 -0
- package/src/services/solid-introspect.service.ts +19 -0
- package/src/services/view-metadata.service.ts +87 -21
- package/src/services/workflow/nodes/for-each.node.ts +97 -0
- package/src/services/workflow/nodes/http-request.node.ts +624 -0
- package/src/services/workflow/nodes/if.node.ts +93 -0
- package/src/services/workflow/nodes/log-write.node.ts +232 -0
- package/src/services/workflow/nodes/parallel.node.ts +81 -0
- package/src/services/workflow/nodes/runtime-python.node.ts +571 -0
- package/src/services/workflow/nodes/sequential.node.ts +58 -0
- package/src/services/workflow/nodes/solidx-api.helpers.ts +205 -0
- package/src/services/workflow/nodes/solidx-crud.nodes.ts +511 -0
- package/src/services/workflow/nodes/solidx-login.node.ts +222 -0
- package/src/services/workflow/nodes/solidx-send-email.node.ts +489 -0
- package/src/services/workflow/nodes/solidx-send-sms.node.ts +377 -0
- package/src/services/workflow/nodes/switch.node.ts +125 -0
- package/src/services/workflow/workflow-definition-metadata-sync.service.ts +196 -0
- package/src/services/workflow/workflow-definition-validator.service.ts +223 -0
- package/src/services/workflow/workflow-execution-writer.service.ts +244 -0
- package/src/services/workflow/workflow-expression.service.ts +175 -0
- package/src/services/workflow/workflow-invocation.service.ts +39 -0
- package/src/services/workflow/workflow-node-registry.service.ts +141 -0
- package/src/services/workflow/workflow-runtime.service.ts +699 -0
- package/src/services/workflow/workflow-scheduled-trigger.job.ts +33 -0
- package/src/services/workflow-definition.service.ts +293 -0
- package/src/services/workflow-execution-artifact.service.ts +20 -0
- package/src/services/workflow-execution-log.service.ts +20 -0
- package/src/services/workflow-execution.service.ts +20 -0
- package/src/services/workflow-secret.service.ts +161 -0
- package/src/services/workflow-step-execution.service.ts +20 -0
- package/src/services/workflow-trigger-execution.service.ts +20 -0
- package/src/solid-core.module.ts +124 -0
- package/src/transformers/empty-string-to-null-transformer.ts +11 -0
- package/src/types/workflow-dsl.types.ts +987 -0
- package/src/types/workflow-execution-queue.types.ts +3 -0
|
@@ -0,0 +1,522 @@
|
|
|
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 __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
19
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
20
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
21
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
22
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
23
|
+
};
|
|
24
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
25
|
+
var ownKeys = function(o) {
|
|
26
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
27
|
+
var ar = [];
|
|
28
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
29
|
+
return ar;
|
|
30
|
+
};
|
|
31
|
+
return ownKeys(o);
|
|
32
|
+
};
|
|
33
|
+
return function (mod) {
|
|
34
|
+
if (mod && mod.__esModule) return mod;
|
|
35
|
+
var result = {};
|
|
36
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
37
|
+
__setModuleDefault(result, mod);
|
|
38
|
+
return result;
|
|
39
|
+
};
|
|
40
|
+
})();
|
|
41
|
+
var RuntimePythonNode_1;
|
|
42
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
43
|
+
exports.RuntimePythonNode = void 0;
|
|
44
|
+
const common_1 = require("@nestjs/common");
|
|
45
|
+
const child_process_1 = require("child_process");
|
|
46
|
+
const fs = __importStar(require("fs/promises"));
|
|
47
|
+
const os = __importStar(require("os"));
|
|
48
|
+
const path = __importStar(require("path"));
|
|
49
|
+
const workflow_node_provider_decorator_1 = require("../../../decorators/workflow-node-provider.decorator");
|
|
50
|
+
const fullWidthField = {
|
|
51
|
+
layout: {
|
|
52
|
+
width: 'full',
|
|
53
|
+
},
|
|
54
|
+
};
|
|
55
|
+
let RuntimePythonNode = RuntimePythonNode_1 = class RuntimePythonNode {
|
|
56
|
+
constructor() {
|
|
57
|
+
this.logger = new common_1.Logger(RuntimePythonNode_1.name);
|
|
58
|
+
}
|
|
59
|
+
async execute(context) {
|
|
60
|
+
const configuration = context.expression.interpolate(context.node.configuration ?? {}, context);
|
|
61
|
+
const script = String(configuration.script ?? '').trim();
|
|
62
|
+
if (!script) {
|
|
63
|
+
throw new common_1.BadRequestException('runtime.python requires configuration.script.');
|
|
64
|
+
}
|
|
65
|
+
const image = String(configuration.image ?? 'python:3.11-slim').trim();
|
|
66
|
+
const networkMode = this.normalizeNetworkMode(configuration.networkMode);
|
|
67
|
+
const timeoutMs = Number(configuration.timeoutMs ?? context.node.timeoutMs ?? 120000);
|
|
68
|
+
const argumentsValue = configuration.arguments &&
|
|
69
|
+
typeof configuration.arguments === 'object' &&
|
|
70
|
+
!Array.isArray(configuration.arguments)
|
|
71
|
+
? configuration.arguments
|
|
72
|
+
: {};
|
|
73
|
+
const workspacePath = await fs.mkdtemp(path.join(os.tmpdir(), 'solidx-runtime-python-'));
|
|
74
|
+
const hasRequirements = String(configuration.requirementsTxt ?? '').trim().length > 0;
|
|
75
|
+
await context.emitLog({
|
|
76
|
+
level: 'debug',
|
|
77
|
+
eventType: 'node.runtime.python.workspace.created',
|
|
78
|
+
source: 'runtime.python',
|
|
79
|
+
message: `Prepared temporary Python runtime workspace.`,
|
|
80
|
+
metadata: {
|
|
81
|
+
workspacePath,
|
|
82
|
+
image,
|
|
83
|
+
networkMode,
|
|
84
|
+
timeoutMs,
|
|
85
|
+
argumentKeys: Object.keys(argumentsValue),
|
|
86
|
+
hasRequirements,
|
|
87
|
+
scriptBytes: this.byteLength(script),
|
|
88
|
+
requirementsBytes: hasRequirements
|
|
89
|
+
? this.byteLength(String(configuration.requirementsTxt))
|
|
90
|
+
: 0,
|
|
91
|
+
},
|
|
92
|
+
});
|
|
93
|
+
try {
|
|
94
|
+
await this.writeRuntimeFiles(workspacePath, {
|
|
95
|
+
script,
|
|
96
|
+
requirementsTxt: configuration.requirementsTxt,
|
|
97
|
+
argumentsValue,
|
|
98
|
+
});
|
|
99
|
+
await context.emitLog({
|
|
100
|
+
level: 'debug',
|
|
101
|
+
eventType: 'node.runtime.python.files.written',
|
|
102
|
+
source: 'runtime.python',
|
|
103
|
+
message: `Wrote Python runtime files.`,
|
|
104
|
+
metadata: {
|
|
105
|
+
files: [
|
|
106
|
+
'script.py',
|
|
107
|
+
'arguments.json',
|
|
108
|
+
...(hasRequirements ? ['requirements.txt'] : []),
|
|
109
|
+
],
|
|
110
|
+
argumentKeys: Object.keys(argumentsValue),
|
|
111
|
+
},
|
|
112
|
+
});
|
|
113
|
+
await context.emitLog({
|
|
114
|
+
level: 'info',
|
|
115
|
+
eventType: 'node.runtime.python.started',
|
|
116
|
+
source: 'runtime.python',
|
|
117
|
+
message: `Starting Docker container for Python runtime using ${image}.`,
|
|
118
|
+
metadata: {
|
|
119
|
+
image,
|
|
120
|
+
networkMode,
|
|
121
|
+
timeoutMs,
|
|
122
|
+
hasRequirements,
|
|
123
|
+
},
|
|
124
|
+
});
|
|
125
|
+
this.logger.log(`Starting runtime.python Docker container for node ${context.node.id} using image ${image} (network=${networkMode}, timeoutMs=${timeoutMs}).`);
|
|
126
|
+
const runResult = await this.runDockerPython({
|
|
127
|
+
workspacePath,
|
|
128
|
+
image,
|
|
129
|
+
networkMode,
|
|
130
|
+
timeoutMs,
|
|
131
|
+
onStarted: async (pid) => {
|
|
132
|
+
await context.emitLog({
|
|
133
|
+
level: 'debug',
|
|
134
|
+
eventType: 'node.runtime.python.docker.started',
|
|
135
|
+
source: 'runtime.python',
|
|
136
|
+
message: `Docker process started for Python runtime.`,
|
|
137
|
+
metadata: {
|
|
138
|
+
pid,
|
|
139
|
+
image,
|
|
140
|
+
networkMode,
|
|
141
|
+
},
|
|
142
|
+
});
|
|
143
|
+
},
|
|
144
|
+
});
|
|
145
|
+
const parsedResult = this.parseJsonOutput(runResult.stdout);
|
|
146
|
+
const ok = runResult.exitCode === 0 && !runResult.timedOut;
|
|
147
|
+
await context.emitLog({
|
|
148
|
+
level: ok ? 'info' : 'warn',
|
|
149
|
+
eventType: 'node.runtime.python.completed',
|
|
150
|
+
source: 'runtime.python',
|
|
151
|
+
message: `Python runtime exited with code ${runResult.exitCode ?? 'unknown'}.`,
|
|
152
|
+
metadata: {
|
|
153
|
+
exitCode: runResult.exitCode,
|
|
154
|
+
timedOut: runResult.timedOut,
|
|
155
|
+
stdoutBytes: this.byteLength(runResult.stdout),
|
|
156
|
+
stderrBytes: this.byteLength(runResult.stderr),
|
|
157
|
+
parsedJsonOutput: parsedResult !== null,
|
|
158
|
+
stderrPreview: ok ? undefined : this.preview(runResult.stderr),
|
|
159
|
+
},
|
|
160
|
+
});
|
|
161
|
+
if (!ok) {
|
|
162
|
+
this.logger.warn(`runtime.python node ${context.node.id} exited unsuccessfully: code=${runResult.exitCode} timedOut=${runResult.timedOut} stderrBytes=${this.byteLength(runResult.stderr)}.`);
|
|
163
|
+
throw new common_1.BadRequestException(runResult.timedOut
|
|
164
|
+
? `runtime.python timed out after ${timeoutMs} ms.`
|
|
165
|
+
: `runtime.python failed with exit code ${runResult.exitCode}.`);
|
|
166
|
+
}
|
|
167
|
+
this.logger.log(`runtime.python node ${context.node.id} completed successfully: stdoutBytes=${this.byteLength(runResult.stdout)} stderrBytes=${this.byteLength(runResult.stderr)}.`);
|
|
168
|
+
return {
|
|
169
|
+
output: {
|
|
170
|
+
ok,
|
|
171
|
+
exitCode: runResult.exitCode,
|
|
172
|
+
stdout: runResult.stdout,
|
|
173
|
+
stderr: runResult.stderr,
|
|
174
|
+
result: parsedResult,
|
|
175
|
+
arguments: argumentsValue,
|
|
176
|
+
image,
|
|
177
|
+
timedOut: runResult.timedOut,
|
|
178
|
+
},
|
|
179
|
+
};
|
|
180
|
+
}
|
|
181
|
+
finally {
|
|
182
|
+
await fs.rm(workspacePath, { recursive: true, force: true });
|
|
183
|
+
await context.emitLog({
|
|
184
|
+
level: 'debug',
|
|
185
|
+
eventType: 'node.runtime.python.workspace.removed',
|
|
186
|
+
source: 'runtime.python',
|
|
187
|
+
message: `Removed temporary Python runtime workspace.`,
|
|
188
|
+
metadata: {
|
|
189
|
+
workspacePath,
|
|
190
|
+
},
|
|
191
|
+
});
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
async writeRuntimeFiles(workspacePath, options) {
|
|
195
|
+
await fs.writeFile(path.join(workspacePath, 'script.py'), options.script, 'utf8');
|
|
196
|
+
await fs.writeFile(path.join(workspacePath, 'arguments.json'), JSON.stringify(options.argumentsValue, null, 2), 'utf8');
|
|
197
|
+
if (String(options.requirementsTxt ?? '').trim()) {
|
|
198
|
+
await fs.writeFile(path.join(workspacePath, 'requirements.txt'), String(options.requirementsTxt), 'utf8');
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
runDockerPython(options) {
|
|
202
|
+
return new Promise((resolve, reject) => {
|
|
203
|
+
const command = 'if [ -s requirements.txt ]; then python -m pip install --disable-pip-version-check -q -r requirements.txt; fi; python script.py';
|
|
204
|
+
const child = (0, child_process_1.spawn)('docker', [
|
|
205
|
+
'run',
|
|
206
|
+
'--rm',
|
|
207
|
+
'--network',
|
|
208
|
+
options.networkMode,
|
|
209
|
+
'-v',
|
|
210
|
+
`${options.workspacePath}:/workspace`,
|
|
211
|
+
'-w',
|
|
212
|
+
'/workspace',
|
|
213
|
+
options.image,
|
|
214
|
+
'sh',
|
|
215
|
+
'-lc',
|
|
216
|
+
command,
|
|
217
|
+
]);
|
|
218
|
+
void Promise.resolve(options.onStarted?.(child.pid)).catch((error) => {
|
|
219
|
+
this.logger.warn(`Unable to emit runtime.python Docker start log: ${error instanceof Error ? error.message : String(error)}`);
|
|
220
|
+
});
|
|
221
|
+
let stdout = '';
|
|
222
|
+
let stderr = '';
|
|
223
|
+
let settled = false;
|
|
224
|
+
let timedOut = false;
|
|
225
|
+
const timer = setTimeout(() => {
|
|
226
|
+
timedOut = true;
|
|
227
|
+
child.kill('SIGKILL');
|
|
228
|
+
}, options.timeoutMs);
|
|
229
|
+
child.stdout.on('data', (chunk) => {
|
|
230
|
+
stdout += chunk.toString();
|
|
231
|
+
});
|
|
232
|
+
child.stderr.on('data', (chunk) => {
|
|
233
|
+
stderr += chunk.toString();
|
|
234
|
+
});
|
|
235
|
+
child.on('error', (error) => {
|
|
236
|
+
if (settled) {
|
|
237
|
+
return;
|
|
238
|
+
}
|
|
239
|
+
settled = true;
|
|
240
|
+
clearTimeout(timer);
|
|
241
|
+
reject(new common_1.BadRequestException(error?.code === 'ENOENT'
|
|
242
|
+
? 'runtime.python requires Docker to be installed and available on PATH.'
|
|
243
|
+
: error?.message ?? 'Unable to start runtime.python Docker process.'));
|
|
244
|
+
});
|
|
245
|
+
child.on('close', (exitCode) => {
|
|
246
|
+
if (settled) {
|
|
247
|
+
return;
|
|
248
|
+
}
|
|
249
|
+
settled = true;
|
|
250
|
+
clearTimeout(timer);
|
|
251
|
+
resolve({
|
|
252
|
+
exitCode,
|
|
253
|
+
stdout,
|
|
254
|
+
stderr,
|
|
255
|
+
timedOut,
|
|
256
|
+
});
|
|
257
|
+
});
|
|
258
|
+
});
|
|
259
|
+
}
|
|
260
|
+
normalizeNetworkMode(value) {
|
|
261
|
+
const networkMode = String(value ?? 'bridge').trim() || 'bridge';
|
|
262
|
+
if (!['bridge', 'none', 'host'].includes(networkMode)) {
|
|
263
|
+
throw new common_1.BadRequestException('runtime.python networkMode must be bridge, none, or host.');
|
|
264
|
+
}
|
|
265
|
+
return networkMode;
|
|
266
|
+
}
|
|
267
|
+
parseJsonOutput(stdout) {
|
|
268
|
+
const trimmed = stdout.trim();
|
|
269
|
+
if (!trimmed) {
|
|
270
|
+
return null;
|
|
271
|
+
}
|
|
272
|
+
try {
|
|
273
|
+
return JSON.parse(trimmed);
|
|
274
|
+
}
|
|
275
|
+
catch {
|
|
276
|
+
return null;
|
|
277
|
+
}
|
|
278
|
+
}
|
|
279
|
+
byteLength(value) {
|
|
280
|
+
return Buffer.byteLength(value ?? '', 'utf8');
|
|
281
|
+
}
|
|
282
|
+
preview(value, maxLength = 2000) {
|
|
283
|
+
const trimmed = String(value ?? '').trim();
|
|
284
|
+
if (!trimmed) {
|
|
285
|
+
return '';
|
|
286
|
+
}
|
|
287
|
+
return trimmed.length > maxLength
|
|
288
|
+
? `${trimmed.slice(0, maxLength)}...`
|
|
289
|
+
: trimmed;
|
|
290
|
+
}
|
|
291
|
+
};
|
|
292
|
+
exports.RuntimePythonNode = RuntimePythonNode;
|
|
293
|
+
exports.RuntimePythonNode = RuntimePythonNode = RuntimePythonNode_1 = __decorate([
|
|
294
|
+
(0, workflow_node_provider_decorator_1.WorkflowNodeProvider)({
|
|
295
|
+
type: 'runtime.python',
|
|
296
|
+
kind: 'task',
|
|
297
|
+
version: '1.0.0',
|
|
298
|
+
category: 'runtime',
|
|
299
|
+
subcategory: 'python',
|
|
300
|
+
label: 'Runtime Python',
|
|
301
|
+
description: 'Runs arbitrary Python code inside a transient Docker container and exposes stdout, stderr, exit code, and parsed JSON output.',
|
|
302
|
+
tags: ['runtime', 'python', 'docker', 'script'],
|
|
303
|
+
aliases: ['python.run', 'python.script'],
|
|
304
|
+
configSchema: {
|
|
305
|
+
type: 'object',
|
|
306
|
+
required: ['script'],
|
|
307
|
+
properties: {
|
|
308
|
+
image: { type: 'string', default: 'python:3.11-slim' },
|
|
309
|
+
script: { type: 'string' },
|
|
310
|
+
requirementsTxt: { type: 'string' },
|
|
311
|
+
arguments: { type: 'object', default: {} },
|
|
312
|
+
timeoutMs: { type: 'number', default: 120000 },
|
|
313
|
+
networkMode: { type: 'string', default: 'bridge' },
|
|
314
|
+
},
|
|
315
|
+
},
|
|
316
|
+
outputSchema: {
|
|
317
|
+
type: 'object',
|
|
318
|
+
properties: {
|
|
319
|
+
ok: { type: 'boolean' },
|
|
320
|
+
exitCode: { type: 'number' },
|
|
321
|
+
stdout: { type: 'string' },
|
|
322
|
+
stderr: { type: 'string' },
|
|
323
|
+
result: {},
|
|
324
|
+
arguments: { type: 'object' },
|
|
325
|
+
image: { type: 'string' },
|
|
326
|
+
timedOut: { type: 'boolean' },
|
|
327
|
+
},
|
|
328
|
+
},
|
|
329
|
+
examples: [
|
|
330
|
+
{
|
|
331
|
+
key: 'parse-json-stdout',
|
|
332
|
+
label: 'Return JSON from Python',
|
|
333
|
+
language: 'yaml',
|
|
334
|
+
configurationOnly: true,
|
|
335
|
+
snippet: 'image: python:3.11-slim\narguments:\n name: "{{ inputs.name }}"\nscript: |\n import json\n from pathlib import Path\n\n args = json.loads(Path("arguments.json").read_text())\n print(json.dumps({"message": f"Hello {args[\'name\']}"}))\n',
|
|
336
|
+
},
|
|
337
|
+
{
|
|
338
|
+
key: 'download-csv-with-pandas',
|
|
339
|
+
label: 'Download and parse CSV',
|
|
340
|
+
language: 'yaml',
|
|
341
|
+
configurationOnly: true,
|
|
342
|
+
snippet: 'image: python:3.11-slim\nrequirementsTxt: |\n pandas==2.2.2\n requests==2.32.3\narguments:\n fileUrl: "{{ inputs.fileUrl }}"\nscript: |\n import json\n import pandas as pd\n from pathlib import Path\n\n args = json.loads(Path("arguments.json").read_text())\n rows = pd.read_csv(args["fileUrl"]).fillna("").to_dict(orient="records")\n print(json.dumps({"rows": rows}))\n',
|
|
343
|
+
},
|
|
344
|
+
],
|
|
345
|
+
authoring: {
|
|
346
|
+
defaultConfiguration: {
|
|
347
|
+
image: 'python:3.11-slim',
|
|
348
|
+
arguments: {},
|
|
349
|
+
timeoutMs: 120000,
|
|
350
|
+
networkMode: 'bridge',
|
|
351
|
+
},
|
|
352
|
+
configurationLayout: {
|
|
353
|
+
type: 'tabs',
|
|
354
|
+
tabs: [
|
|
355
|
+
{
|
|
356
|
+
key: 'runtime',
|
|
357
|
+
label: 'Runtime',
|
|
358
|
+
groups: ['Runtime'],
|
|
359
|
+
},
|
|
360
|
+
{
|
|
361
|
+
key: 'arguments',
|
|
362
|
+
label: 'Arguments',
|
|
363
|
+
groups: ['Inputs'],
|
|
364
|
+
},
|
|
365
|
+
{
|
|
366
|
+
key: 'script',
|
|
367
|
+
label: 'Script',
|
|
368
|
+
fields: ['script'],
|
|
369
|
+
},
|
|
370
|
+
{
|
|
371
|
+
key: 'requirements',
|
|
372
|
+
label: 'Requirements',
|
|
373
|
+
fields: ['requirementsTxt'],
|
|
374
|
+
},
|
|
375
|
+
],
|
|
376
|
+
},
|
|
377
|
+
configurationFields: [
|
|
378
|
+
{
|
|
379
|
+
key: 'image',
|
|
380
|
+
label: 'Docker Image',
|
|
381
|
+
description: 'Python Docker image used for execution.',
|
|
382
|
+
valueType: 'string',
|
|
383
|
+
defaultValue: 'python:3.11-slim',
|
|
384
|
+
expressionAllowed: true,
|
|
385
|
+
group: 'Runtime',
|
|
386
|
+
uiSchema: fullWidthField,
|
|
387
|
+
},
|
|
388
|
+
{
|
|
389
|
+
key: 'script',
|
|
390
|
+
label: 'Python Script',
|
|
391
|
+
description: 'Python code to run. The node writes interpolated arguments to arguments.json in the container working directory.',
|
|
392
|
+
valueType: 'string',
|
|
393
|
+
required: true,
|
|
394
|
+
expressionAllowed: true,
|
|
395
|
+
group: 'Script',
|
|
396
|
+
widgetHint: 'raw-editor',
|
|
397
|
+
uiSchema: {
|
|
398
|
+
...fullWidthField,
|
|
399
|
+
editor: {
|
|
400
|
+
language: 'python',
|
|
401
|
+
height: 'min(560px, calc(90vh - 330px))',
|
|
402
|
+
},
|
|
403
|
+
},
|
|
404
|
+
},
|
|
405
|
+
{
|
|
406
|
+
key: 'requirementsTxt',
|
|
407
|
+
label: 'requirements.txt',
|
|
408
|
+
description: 'Optional pip requirements installed before the script runs.',
|
|
409
|
+
valueType: 'string',
|
|
410
|
+
group: 'Script',
|
|
411
|
+
widgetHint: 'raw-editor',
|
|
412
|
+
uiSchema: {
|
|
413
|
+
...fullWidthField,
|
|
414
|
+
editor: {
|
|
415
|
+
language: 'text',
|
|
416
|
+
height: 'min(420px, calc(90vh - 330px))',
|
|
417
|
+
},
|
|
418
|
+
},
|
|
419
|
+
},
|
|
420
|
+
{
|
|
421
|
+
key: 'arguments',
|
|
422
|
+
label: 'Arguments',
|
|
423
|
+
description: 'Optional JSON object. Expressions are interpolated before being written to arguments.json.',
|
|
424
|
+
valueType: 'object',
|
|
425
|
+
expressionAllowed: true,
|
|
426
|
+
group: 'Inputs',
|
|
427
|
+
widgetHint: 'json-editor',
|
|
428
|
+
uiSchema: {
|
|
429
|
+
...fullWidthField,
|
|
430
|
+
editor: {
|
|
431
|
+
height: 'min(420px, calc(90vh - 330px))',
|
|
432
|
+
},
|
|
433
|
+
},
|
|
434
|
+
},
|
|
435
|
+
{
|
|
436
|
+
key: 'timeoutMs',
|
|
437
|
+
label: 'Timeout (ms)',
|
|
438
|
+
description: 'Maximum runtime before the Docker container is stopped.',
|
|
439
|
+
valueType: 'number',
|
|
440
|
+
defaultValue: 120000,
|
|
441
|
+
group: 'Runtime',
|
|
442
|
+
uiSchema: fullWidthField,
|
|
443
|
+
},
|
|
444
|
+
{
|
|
445
|
+
key: 'networkMode',
|
|
446
|
+
label: 'Network Mode',
|
|
447
|
+
description: 'Docker network mode. Use bridge for remote downloads; use none to block network access.',
|
|
448
|
+
valueType: 'string',
|
|
449
|
+
defaultValue: 'bridge',
|
|
450
|
+
enumValues: ['bridge', 'none', 'host'],
|
|
451
|
+
group: 'Runtime',
|
|
452
|
+
uiSchema: fullWidthField,
|
|
453
|
+
},
|
|
454
|
+
],
|
|
455
|
+
outputs: [
|
|
456
|
+
{
|
|
457
|
+
key: 'ok',
|
|
458
|
+
label: 'OK',
|
|
459
|
+
valueType: 'boolean',
|
|
460
|
+
path: 'ok',
|
|
461
|
+
},
|
|
462
|
+
{
|
|
463
|
+
key: 'result',
|
|
464
|
+
label: 'Parsed JSON Result',
|
|
465
|
+
description: 'Parsed stdout when the script prints valid JSON. Otherwise null.',
|
|
466
|
+
valueType: 'any',
|
|
467
|
+
path: 'result',
|
|
468
|
+
},
|
|
469
|
+
{
|
|
470
|
+
key: 'stdout',
|
|
471
|
+
label: 'stdout',
|
|
472
|
+
valueType: 'string',
|
|
473
|
+
path: 'stdout',
|
|
474
|
+
},
|
|
475
|
+
{
|
|
476
|
+
key: 'stderr',
|
|
477
|
+
label: 'stderr',
|
|
478
|
+
valueType: 'string',
|
|
479
|
+
path: 'stderr',
|
|
480
|
+
},
|
|
481
|
+
{
|
|
482
|
+
key: 'exitCode',
|
|
483
|
+
label: 'Exit Code',
|
|
484
|
+
valueType: 'integer',
|
|
485
|
+
path: 'exitCode',
|
|
486
|
+
},
|
|
487
|
+
],
|
|
488
|
+
supportsExpressions: true,
|
|
489
|
+
supportsRetryPolicy: true,
|
|
490
|
+
supportsTimeoutMs: true,
|
|
491
|
+
supportsOnError: true,
|
|
492
|
+
supportsDisableToggle: true,
|
|
493
|
+
supportsName: true,
|
|
494
|
+
supportsDescription: true,
|
|
495
|
+
searchableText: ['runtime', 'python', 'docker', 'script', 'pandas', 'csv'],
|
|
496
|
+
},
|
|
497
|
+
runtime: {
|
|
498
|
+
emitsLogs: true,
|
|
499
|
+
emitsArtifacts: false,
|
|
500
|
+
deterministicOutputs: false,
|
|
501
|
+
executionMode: 'task',
|
|
502
|
+
successStatuses: ['success'],
|
|
503
|
+
},
|
|
504
|
+
documentation: {
|
|
505
|
+
summary: 'Executes Python code in Docker. Scripts can read arguments.json and should print JSON when downstream nodes need structured output.',
|
|
506
|
+
},
|
|
507
|
+
ui: {
|
|
508
|
+
icon: 'si-code',
|
|
509
|
+
iconColor: '#2563eb',
|
|
510
|
+
iconBackgroundColor: '#dbeafe',
|
|
511
|
+
iconBorderColor: '#bfdbfe',
|
|
512
|
+
defaultEditorMode: 'schema',
|
|
513
|
+
modalSize: 'xl',
|
|
514
|
+
layoutHints: {
|
|
515
|
+
preferredPanel: 'flow',
|
|
516
|
+
groupOrder: ['Runtime', 'Inputs', 'Script'],
|
|
517
|
+
stickySummary: true,
|
|
518
|
+
},
|
|
519
|
+
},
|
|
520
|
+
})
|
|
521
|
+
], RuntimePythonNode);
|
|
522
|
+
//# sourceMappingURL=runtime-python.node.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"runtime-python.node.js","sourceRoot":"","sources":["../../../../src/services/workflow/nodes/runtime-python.node.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,2CAA6D;AAC7D,iDAAsC;AACtC,gDAAkC;AAClC,uCAAyB;AACzB,2CAA6B;AAC7B,2GAA4F;AAO5F,MAAM,cAAc,GAAG;IACrB,MAAM,EAAE;QACN,KAAK,EAAE,MAAM;KACd;CACF,CAAC;AAqPK,IAAM,iBAAiB,yBAAvB,MAAM,iBAAiB;IAAvB;QACY,WAAM,GAAG,IAAI,eAAM,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qB,EAAE,IAAI;YAC3B,YAAY,EAAE,IAAI;YAClB,mBAAmB,EAAE,IAAI;YACzB,cAAc,EAAE,CAAC,SAAS,EAAE,QAAQ,EAAE,QAAQ,EAAE,QAAQ,EAAE,QAAQ,EAAE,KAAK,CAAC;SAC3E;QACD,OAAO,EAAE;YACP,SAAS,EAAE,IAAI;YACf,cAAc,EAAE,KAAK;YACrB,oBAAoB,EAAE,KAAK;YAC3B,aAAa,EAAE,MAAM;YACrB,eAAe,EAAE,CAAC,SAAS,CAAC;SAC7B;QACD,aAAa,EAAE;YACb,OAAO,EACL,qIAAqI;SACxI;QACD,EAAE,EAAE;YACF,IAAI,EAAE,SAAS;YACf,SAAS,EAAE,SAAS;YACpB,mBAAmB,EAAE,SAAS;YAC9B,eAAe,EAAE,SAAS;YAC1B,iBAAiB,EAAE,QAAQ;YAC3B,SAAS,EAAE,IAAI;YACf,WAAW,EAAE;gBACX,cAAc,EAAE,MAAM;gBACtB,UAAU,EAAE,CAAC,SAAS,EAAE,QAAQ,EAAE,QAAQ,CAAC;gBAC3C,aAAa,EAAE,IAAI;aACpB;SACF;KACF,CAAC;GACW,iBAAiB,CAqT7B","sourcesContent":["import { BadRequestException, Logger } from '@nestjs/common';\nimport { spawn } from 'child_process';\nimport * as fs from 'fs/promises';\nimport * as os from 'os';\nimport * as path from 'path';\nimport { WorkflowNodeProvider } from '../../../decorators/workflow-node-provider.decorator';\nimport { WorkflowNodeHandler } from '../../../interfaces/workflow-node-handler.interface';\nimport {\n WorkflowNodeExecutionContext,\n WorkflowNodeHandlerResult,\n} from '../../../types/workflow-dsl.types';\n\nconst fullWidthField = {\n layout: {\n width: 'full',\n },\n};\n\ntype DockerRunResult = {\n exitCode: number | null;\n stdout: string;\n stderr: string;\n timedOut: boolean;\n};\n\n@WorkflowNodeProvider({\n type: 'runtime.python',\n kind: 'task',\n version: '1.0.0',\n category: 'runtime',\n subcategory: 'python',\n label: 'Runtime Python',\n description:\n 'Runs arbitrary Python code inside a transient Docker container and exposes stdout, stderr, exit code, and parsed JSON output.',\n tags: ['runtime', 'python', 'docker', 'script'],\n aliases: ['python.run', 'python.script'],\n configSchema: {\n type: 'object',\n required: ['script'],\n properties: {\n image: { type: 'string', default: 'python:3.11-slim' },\n script: { type: 'string' },\n requirementsTxt: { type: 'string' },\n arguments: { type: 'object', default: {} },\n timeoutMs: { type: 'number', default: 120000 },\n networkMode: { type: 'string', default: 'bridge' },\n },\n },\n outputSchema: {\n type: 'object',\n properties: {\n ok: { type: 'boolean' },\n exitCode: { type: 'number' },\n stdout: { type: 'string' },\n stderr: { type: 'string' },\n result: {},\n arguments: { type: 'object' },\n image: { type: 'string' },\n timedOut: { type: 'boolean' },\n },\n },\n examples: [\n {\n key: 'parse-json-stdout',\n label: 'Return JSON from Python',\n language: 'yaml',\n configurationOnly: true,\n snippet:\n 'image: python:3.11-slim\\narguments:\\n name: \"{{ inputs.name }}\"\\nscript: |\\n import json\\n from pathlib import Path\\n\\n args = json.loads(Path(\"arguments.json\").read_text())\\n print(json.dumps({\"message\": f\"Hello {args[\\'name\\']}\"}))\\n',\n },\n {\n key: 'download-csv-with-pandas',\n label: 'Download and parse CSV',\n language: 'yaml',\n configurationOnly: true,\n snippet:\n 'image: python:3.11-slim\\nrequirementsTxt: |\\n pandas==2.2.2\\n requests==2.32.3\\narguments:\\n fileUrl: \"{{ inputs.fileUrl }}\"\\nscript: |\\n import json\\n import pandas as pd\\n from pathlib import Path\\n\\n args = json.loads(Path(\"arguments.json\").read_text())\\n rows = pd.read_csv(args[\"fileUrl\"]).fillna(\"\").to_dict(orient=\"records\")\\n print(json.dumps({\"rows\": rows}))\\n',\n },\n ],\n authoring: {\n defaultConfiguration: {\n image: 'python:3.11-slim',\n arguments: {},\n timeoutMs: 120000,\n networkMode: 'bridge',\n },\n configurationLayout: {\n type: 'tabs',\n tabs: [\n {\n key: 'runtime',\n label: 'Runtime',\n groups: ['Runtime'],\n },\n {\n key: 'arguments',\n label: 'Arguments',\n groups: ['Inputs'],\n },\n {\n key: 'script',\n label: 'Script',\n fields: ['script'],\n },\n {\n key: 'requirements',\n label: 'Requirements',\n fields: ['requirementsTxt'],\n },\n ],\n },\n configurationFields: [\n {\n key: 'image',\n label: 'Docker Image',\n description: 'Python Docker image used for execution.',\n valueType: 'string',\n defaultValue: 'python:3.11-slim',\n expressionAllowed: true,\n group: 'Runtime',\n uiSchema: fullWidthField,\n },\n {\n key: 'script',\n label: 'Python Script',\n description:\n 'Python code to run. The node writes interpolated arguments to arguments.json in the container working directory.',\n valueType: 'string',\n required: true,\n expressionAllowed: true,\n group: 'Script',\n widgetHint: 'raw-editor',\n uiSchema: {\n ...fullWidthField,\n editor: {\n language: 'python',\n height: 'min(560px, calc(90vh - 330px))',\n },\n },\n },\n {\n key: 'requirementsTxt',\n label: 'requirements.txt',\n description:\n 'Optional pip requirements installed before the script runs.',\n valueType: 'string',\n group: 'Script',\n widgetHint: 'raw-editor',\n uiSchema: {\n ...fullWidthField,\n editor: {\n language: 'text',\n height: 'min(420px, calc(90vh - 330px))',\n },\n },\n },\n {\n key: 'arguments',\n label: 'Arguments',\n description:\n 'Optional JSON object. Expressions are interpolated before being written to arguments.json.',\n valueType: 'object',\n expressionAllowed: true,\n group: 'Inputs',\n widgetHint: 'json-editor',\n uiSchema: {\n ...fullWidthField,\n editor: {\n height: 'min(420px, calc(90vh - 330px))',\n },\n },\n },\n {\n key: 'timeoutMs',\n label: 'Timeout (ms)',\n description: 'Maximum runtime before the Docker container is stopped.',\n valueType: 'number',\n defaultValue: 120000,\n group: 'Runtime',\n uiSchema: fullWidthField,\n },\n {\n key: 'networkMode',\n label: 'Network Mode',\n description:\n 'Docker network mode. Use bridge for remote downloads; use none to block network access.',\n valueType: 'string',\n defaultValue: 'bridge',\n enumValues: ['bridge', 'none', 'host'],\n group: 'Runtime',\n uiSchema: fullWidthField,\n },\n ],\n outputs: [\n {\n key: 'ok',\n label: 'OK',\n valueType: 'boolean',\n path: 'ok',\n },\n {\n key: 'result',\n label: 'Parsed JSON Result',\n description:\n 'Parsed stdout when the script prints valid JSON. Otherwise null.',\n valueType: 'any',\n path: 'result',\n },\n {\n key: 'stdout',\n label: 'stdout',\n valueType: 'string',\n path: 'stdout',\n },\n {\n key: 'stderr',\n label: 'stderr',\n valueType: 'string',\n path: 'stderr',\n },\n {\n key: 'exitCode',\n label: 'Exit Code',\n valueType: 'integer',\n path: 'exitCode',\n },\n ],\n supportsExpressions: true,\n supportsRetryPolicy: true,\n supportsTimeoutMs: true,\n supportsOnError: true,\n supportsDisableToggle: true,\n supportsName: true,\n supportsDescription: true,\n searchableText: ['runtime', 'python', 'docker', 'script', 'pandas', 'csv'],\n },\n runtime: {\n emitsLogs: true,\n emitsArtifacts: false,\n deterministicOutputs: false,\n executionMode: 'task',\n successStatuses: ['success'],\n },\n documentation: {\n summary:\n 'Executes Python code in Docker. Scripts can read arguments.json and should print JSON when downstream nodes need structured output.',\n },\n ui: {\n icon: 'si-code',\n iconColor: '#2563eb',\n iconBackgroundColor: '#dbeafe',\n iconBorderColor: '#bfdbfe',\n defaultEditorMode: 'schema',\n modalSize: 'xl',\n layoutHints: {\n preferredPanel: 'flow',\n groupOrder: ['Runtime', 'Inputs', 'Script'],\n stickySummary: true,\n },\n },\n})\nexport class RuntimePythonNode implements WorkflowNodeHandler {\n private readonly logger = new Logger(RuntimePythonNode.name);\n\n async execute(\n context: WorkflowNodeExecutionContext,\n ): Promise<WorkflowNodeHandlerResult> {\n const configuration = context.expression.interpolate(\n context.node.configuration ?? {},\n context,\n );\n\n const script = String(configuration.script ?? '').trim();\n if (!script) {\n throw new BadRequestException('runtime.python requires configuration.script.');\n }\n\n const image = String(configuration.image ?? 'python:3.11-slim').trim();\n const networkMode = this.normalizeNetworkMode(configuration.networkMode);\n const timeoutMs = Number(configuration.timeoutMs ?? context.node.timeoutMs ?? 120000);\n const argumentsValue =\n configuration.arguments &&\n typeof configuration.arguments === 'object' &&\n !Array.isArray(configuration.arguments)\n ? configuration.arguments\n : {};\n\n const workspacePath = await fs.mkdtemp(\n path.join(os.tmpdir(), 'solidx-runtime-python-'),\n );\n const hasRequirements = String(configuration.requirementsTxt ?? '').trim().length > 0;\n\n await context.emitLog({\n level: 'debug',\n eventType: 'node.runtime.python.workspace.created',\n source: 'runtime.python',\n message: `Prepared temporary Python runtime workspace.`,\n metadata: {\n workspacePath,\n image,\n networkMode,\n timeoutMs,\n argumentKeys: Object.keys(argumentsValue),\n hasRequirements,\n scriptBytes: this.byteLength(script),\n requirementsBytes: hasRequirements\n ? this.byteLength(String(configuration.requirementsTxt))\n : 0,\n },\n });\n\n try {\n await this.writeRuntimeFiles(workspacePath, {\n script,\n requirementsTxt: configuration.requirementsTxt,\n argumentsValue,\n });\n\n await context.emitLog({\n level: 'debug',\n eventType: 'node.runtime.python.files.written',\n source: 'runtime.python',\n message: `Wrote Python runtime files.`,\n metadata: {\n files: [\n 'script.py',\n 'arguments.json',\n ...(hasRequirements ? ['requirements.txt'] : []),\n ],\n argumentKeys: Object.keys(argumentsValue),\n },\n });\n\n await context.emitLog({\n level: 'info',\n eventType: 'node.runtime.python.started',\n source: 'runtime.python',\n message: `Starting Docker container for Python runtime using ${image}.`,\n metadata: {\n image,\n networkMode,\n timeoutMs,\n hasRequirements,\n },\n });\n\n this.logger.log(\n `Starting runtime.python Docker container for node ${context.node.id} using image ${image} (network=${networkMode}, timeoutMs=${timeoutMs}).`,\n );\n const runResult = await this.runDockerPython({\n workspacePath,\n image,\n networkMode,\n timeoutMs,\n onStarted: async (pid) => {\n await context.emitLog({\n level: 'debug',\n eventType: 'node.runtime.python.docker.started',\n source: 'runtime.python',\n message: `Docker process started for Python runtime.`,\n metadata: {\n pid,\n image,\n networkMode,\n },\n });\n },\n });\n\n const parsedResult = this.parseJsonOutput(runResult.stdout);\n const ok = runResult.exitCode === 0 && !runResult.timedOut;\n\n await context.emitLog({\n level: ok ? 'info' : 'warn',\n eventType: 'node.runtime.python.completed',\n source: 'runtime.python',\n message: `Python runtime exited with code ${runResult.exitCode ?? 'unknown'}.`,\n metadata: {\n exitCode: runResult.exitCode,\n timedOut: runResult.timedOut,\n stdoutBytes: this.byteLength(runResult.stdout),\n stderrBytes: this.byteLength(runResult.stderr),\n parsedJsonOutput: parsedResult !== null,\n stderrPreview: ok ? undefined : this.preview(runResult.stderr),\n },\n });\n\n if (!ok) {\n this.logger.warn(\n `runtime.python node ${context.node.id} exited unsuccessfully: code=${runResult.exitCode} timedOut=${runResult.timedOut} stderrBytes=${this.byteLength(runResult.stderr)}.`,\n );\n throw new BadRequestException(\n runResult.timedOut\n ? `runtime.python timed out after ${timeoutMs} ms.`\n : `runtime.python failed with exit code ${runResult.exitCode}.`,\n );\n }\n\n this.logger.log(\n `runtime.python node ${context.node.id} completed successfully: stdoutBytes=${this.byteLength(runResult.stdout)} stderrBytes=${this.byteLength(runResult.stderr)}.`,\n );\n\n return {\n output: {\n ok,\n exitCode: runResult.exitCode,\n stdout: runResult.stdout,\n stderr: runResult.stderr,\n result: parsedResult,\n arguments: argumentsValue,\n image,\n timedOut: runResult.timedOut,\n },\n };\n } finally {\n await fs.rm(workspacePath, { recursive: true, force: true });\n await context.emitLog({\n level: 'debug',\n eventType: 'node.runtime.python.workspace.removed',\n source: 'runtime.python',\n message: `Removed temporary Python runtime workspace.`,\n metadata: {\n workspacePath,\n },\n });\n }\n }\n\n private async writeRuntimeFiles(\n workspacePath: string,\n options: {\n script: string;\n requirementsTxt?: string;\n argumentsValue: Record<string, any>;\n },\n ) {\n await fs.writeFile(path.join(workspacePath, 'script.py'), options.script, 'utf8');\n await fs.writeFile(\n path.join(workspacePath, 'arguments.json'),\n JSON.stringify(options.argumentsValue, null, 2),\n 'utf8',\n );\n\n if (String(options.requirementsTxt ?? '').trim()) {\n await fs.writeFile(\n path.join(workspacePath, 'requirements.txt'),\n String(options.requirementsTxt),\n 'utf8',\n );\n }\n }\n\n private runDockerPython(options: {\n workspacePath: string;\n image: string;\n networkMode: string;\n timeoutMs: number;\n onStarted?: (pid?: number) => void | Promise<void>;\n }): Promise<DockerRunResult> {\n return new Promise((resolve, reject) => {\n const command =\n 'if [ -s requirements.txt ]; then python -m pip install --disable-pip-version-check -q -r requirements.txt; fi; python script.py';\n\n const child = spawn('docker', [\n 'run',\n '--rm',\n '--network',\n options.networkMode,\n '-v',\n `${options.workspacePath}:/workspace`,\n '-w',\n '/workspace',\n options.image,\n 'sh',\n '-lc',\n command,\n ]);\n\n void Promise.resolve(options.onStarted?.(child.pid)).catch((error) => {\n this.logger.warn(\n `Unable to emit runtime.python Docker start log: ${error instanceof Error ? error.message : String(error)}`,\n );\n });\n\n let stdout = '';\n let stderr = '';\n let settled = false;\n let timedOut = false;\n\n const timer = setTimeout(() => {\n timedOut = true;\n child.kill('SIGKILL');\n }, options.timeoutMs);\n\n child.stdout.on('data', (chunk) => {\n stdout += chunk.toString();\n });\n\n child.stderr.on('data', (chunk) => {\n stderr += chunk.toString();\n });\n\n child.on('error', (error: any) => {\n if (settled) {\n return;\n }\n settled = true;\n clearTimeout(timer);\n reject(\n new BadRequestException(\n error?.code === 'ENOENT'\n ? 'runtime.python requires Docker to be installed and available on PATH.'\n : error?.message ?? 'Unable to start runtime.python Docker process.',\n ),\n );\n });\n\n child.on('close', (exitCode) => {\n if (settled) {\n return;\n }\n settled = true;\n clearTimeout(timer);\n resolve({\n exitCode,\n stdout,\n stderr,\n timedOut,\n });\n });\n });\n }\n\n private normalizeNetworkMode(value: any) {\n const networkMode = String(value ?? 'bridge').trim() || 'bridge';\n if (!['bridge', 'none', 'host'].includes(networkMode)) {\n throw new BadRequestException(\n 'runtime.python networkMode must be bridge, none, or host.',\n );\n }\n return networkMode;\n }\n\n private parseJsonOutput(stdout: string) {\n const trimmed = stdout.trim();\n if (!trimmed) {\n return null;\n }\n\n try {\n return JSON.parse(trimmed);\n } catch {\n return null;\n }\n }\n\n private byteLength(value: string) {\n return Buffer.byteLength(value ?? '', 'utf8');\n }\n\n private preview(value: string, maxLength = 2000) {\n const trimmed = String(value ?? '').trim();\n if (!trimmed) {\n return '';\n }\n\n return trimmed.length > maxLength\n ? `${trimmed.slice(0, maxLength)}...`\n : trimmed;\n }\n}\n"]}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { WorkflowNodeHandler } from '../../../interfaces/workflow-node-handler.interface';
|
|
2
|
+
import { WorkflowNodeExecutionContext, WorkflowNodeHandlerResult } from '../../../types/workflow-dsl.types';
|
|
3
|
+
export declare class SequentialNode implements WorkflowNodeHandler {
|
|
4
|
+
execute(context: WorkflowNodeExecutionContext): Promise<WorkflowNodeHandlerResult>;
|
|
5
|
+
}
|
|
6
|
+
//# sourceMappingURL=sequential.node.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sequential.node.d.ts","sourceRoot":"","sources":["../../../../src/services/workflow/nodes/sequential.node.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,mBAAmB,EAAE,MAAM,qDAAqD,CAAC;AAC1F,OAAO,EACL,4BAA4B,EAC5B,yBAAyB,EAC1B,MAAM,mCAAmC,CAAC;AAE3C,qBAiCa,cAAe,YAAW,mBAAmB;IAClD,OAAO,CACX,OAAO,EAAE,4BAA4B,GACpC,OAAO,CAAC,yBAAyB,CAAC;CActC"}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
+
exports.SequentialNode = void 0;
|
|
10
|
+
const workflow_node_provider_decorator_1 = require("../../../decorators/workflow-node-provider.decorator");
|
|
11
|
+
let SequentialNode = class SequentialNode {
|
|
12
|
+
async execute(context) {
|
|
13
|
+
const childTasks = context.node.tasks ?? [];
|
|
14
|
+
const outputs = {};
|
|
15
|
+
await context.runNodes(childTasks, {
|
|
16
|
+
outputs,
|
|
17
|
+
});
|
|
18
|
+
return {
|
|
19
|
+
output: {
|
|
20
|
+
tasks: outputs,
|
|
21
|
+
},
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
};
|
|
25
|
+
exports.SequentialNode = SequentialNode;
|
|
26
|
+
exports.SequentialNode = SequentialNode = __decorate([
|
|
27
|
+
(0, workflow_node_provider_decorator_1.WorkflowNodeProvider)({
|
|
28
|
+
type: 'sequential',
|
|
29
|
+
kind: 'control',
|
|
30
|
+
category: 'control-flow',
|
|
31
|
+
label: 'Sequential',
|
|
32
|
+
description: 'Runs child tasks in order and returns their outputs.',
|
|
33
|
+
tags: ['sequential', 'flowable', 'ordered'],
|
|
34
|
+
authoring: {
|
|
35
|
+
defaultConfiguration: {},
|
|
36
|
+
childSlots: [
|
|
37
|
+
{
|
|
38
|
+
key: 'tasks',
|
|
39
|
+
label: 'Tasks',
|
|
40
|
+
description: 'Child tasks that run one after another.',
|
|
41
|
+
kind: 'sequence',
|
|
42
|
+
layout: 'sequential',
|
|
43
|
+
required: true,
|
|
44
|
+
},
|
|
45
|
+
],
|
|
46
|
+
supportsDescription: true,
|
|
47
|
+
supportsName: true,
|
|
48
|
+
},
|
|
49
|
+
documentation: {
|
|
50
|
+
summary: 'Runs child tasks one after another in the order they are defined.',
|
|
51
|
+
},
|
|
52
|
+
ui: {
|
|
53
|
+
icon: 'si-list-numbers',
|
|
54
|
+
iconColor: '#0891b2',
|
|
55
|
+
iconBackgroundColor: '#cffafe',
|
|
56
|
+
iconBorderColor: '#a5f3fc',
|
|
57
|
+
modalSize: 'lg',
|
|
58
|
+
},
|
|
59
|
+
})
|
|
60
|
+
], SequentialNode);
|
|
61
|
+
//# sourceMappingURL=sequential.node.js.map
|