@codemation/host 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +75 -0
- package/dist/CodemationConfig-XCkSV2dj.d.ts +168 -0
- package/dist/CodemationConsumerConfigLoader-Dmm2TzAA.d.ts +61 -0
- package/dist/CodemationConsumerConfigLoader-scS_RQMy.js +334 -0
- package/dist/CodemationConsumerConfigLoader-scS_RQMy.js.map +1 -0
- package/dist/CodemationFrontendBootstrapRequest-CE6DjOWJ.js +5768 -0
- package/dist/CodemationFrontendBootstrapRequest-CE6DjOWJ.js.map +1 -0
- package/dist/CodemationPluginListMerger-BNmaoXQL.js +49 -0
- package/dist/CodemationPluginListMerger-BNmaoXQL.js.map +1 -0
- package/dist/CodemationPluginListMerger-BRYqEk0y.d.ts +793 -0
- package/dist/CodemationWhitelabelConfig-DgbjgtrR.d.ts +48 -0
- package/dist/ConsoleLogger-ClPU7jtc.js +35 -0
- package/dist/ConsoleLogger-ClPU7jtc.js.map +1 -0
- package/dist/CredentialServices-BKBGe7l3.js +1030 -0
- package/dist/CredentialServices-BKBGe7l3.js.map +1 -0
- package/dist/CredentialServices-DpDpm8mL.d.ts +291 -0
- package/dist/LogLevelPolicy-4cq9z0TI.d.ts +37 -0
- package/dist/PrismaMigrationDeployer-B1E_gYz7.js +8212 -0
- package/dist/PrismaMigrationDeployer-B1E_gYz7.js.map +1 -0
- package/dist/ServerLoggerFactory-BRHxIDS7.js +340 -0
- package/dist/ServerLoggerFactory-BRHxIDS7.js.map +1 -0
- package/dist/WorkflowViewContracts-DCLpTn25.d.ts +47 -0
- package/dist/chunk-7V6ThxGB.js +39 -0
- package/dist/client-Yh7-CQud.d.ts +21995 -0
- package/dist/client.d.ts +12 -0
- package/dist/client.js +15 -0
- package/dist/client.js.map +1 -0
- package/dist/consumer.d.ts +5 -0
- package/dist/consumer.js +7 -0
- package/dist/credentials.d.ts +50 -0
- package/dist/credentials.js +11 -0
- package/dist/credentials.js.map +1 -0
- package/dist/decorate-B-N_5S4p.js +10 -0
- package/dist/decorateParam-BTcc3KNk.js +15 -0
- package/dist/devServerSidecar.d.ts +52 -0
- package/dist/devServerSidecar.js +131 -0
- package/dist/devServerSidecar.js.map +1 -0
- package/dist/index-Bs4F1IsC.d.ts +1044 -0
- package/dist/index.d.ts +19 -0
- package/dist/index.js +14 -0
- package/dist/nextServer.d.ts +89 -0
- package/dist/nextServer.js +127 -0
- package/dist/nextServer.js.map +1 -0
- package/dist/persistenceServer-K5eqlZm3.d.ts +36 -0
- package/dist/persistenceServer-W9uRw0dJ.js +19 -0
- package/dist/persistenceServer-W9uRw0dJ.js.map +1 -0
- package/dist/persistenceServer.d.ts +6 -0
- package/dist/persistenceServer.js +6 -0
- package/dist/server-BBdsATju.d.ts +132 -0
- package/dist/server-BiHSuA13.js +175 -0
- package/dist/server-BiHSuA13.js.map +1 -0
- package/dist/server.d.ts +9 -0
- package/dist/server.js +13 -0
- package/package.json +152 -0
- package/playwright.config.ts +74 -0
- package/prisma/migrations/20260315063514_init/migration.sql +16 -0
- package/prisma/migrations/20260316090000_workflow_debugger_overlay/migration.sql +9 -0
- package/prisma/migrations/20260317120000_trigger_state_store/migration.sql +3 -0
- package/prisma/migrations/20260317153000_trigger_setup_state/migration.sql +8 -0
- package/prisma/migrations/20260318110000_credentials_v2/migration.sql +49 -0
- package/prisma/migrations/20260319110000_credential_oauth2_material/migration.sql +28 -0
- package/prisma/migrations/20260319200000_codemation_auth_tables/migration.sql +56 -0
- package/prisma/migrations/20260320140000_user_invites_account_status/migration.sql +20 -0
- package/prisma/migrations/20260325120000_workflow_activation/migration.sql +8 -0
- package/prisma/migrations/migration_lock.toml +3 -0
- package/prisma/schema.prisma +179 -0
- package/prisma.config.ts +12 -0
- package/scripts/ensure-prisma-runtime-sourcemaps.mjs +42 -0
- package/scripts/integration-database-global-setup.mjs +30 -0
- package/src/application/ApplicationRequestError.ts +12 -0
- package/src/application/auth/AuthenticatedPrincipal.ts +5 -0
- package/src/application/auth/SessionVerifier.ts +5 -0
- package/src/application/binary/OverlayPinnedBinaryUploadService.ts +119 -0
- package/src/application/binary/RunBinaryAttachmentLookupService.ts +139 -0
- package/src/application/binary/RunStateBinaryStorageKeysCollector.ts +57 -0
- package/src/application/bus/Command.ts +3 -0
- package/src/application/bus/CommandBus.ts +5 -0
- package/src/application/bus/CommandHandler.ts +5 -0
- package/src/application/bus/DomainEvent.ts +1 -0
- package/src/application/bus/DomainEventBus.ts +5 -0
- package/src/application/bus/DomainEventHandler.ts +5 -0
- package/src/application/bus/Query.ts +3 -0
- package/src/application/bus/QueryBus.ts +5 -0
- package/src/application/bus/QueryHandler.ts +5 -0
- package/src/application/commands/AcceptUserInviteCommand.ts +10 -0
- package/src/application/commands/AcceptUserInviteCommandHandler.ts +19 -0
- package/src/application/commands/CopyRunToWorkflowDebuggerCommand.ts +14 -0
- package/src/application/commands/CopyRunToWorkflowDebuggerCommandHandler.ts +56 -0
- package/src/application/commands/CreateCredentialInstanceCommand.ts +9 -0
- package/src/application/commands/CreateCredentialInstanceCommandHandler.ts +28 -0
- package/src/application/commands/CredentialCommandHandlers.ts +10 -0
- package/src/application/commands/DeleteCredentialInstanceCommand.ts +7 -0
- package/src/application/commands/DeleteCredentialInstanceCommandHandler.ts +27 -0
- package/src/application/commands/HandleWebhookInvocationCommand.ts +12 -0
- package/src/application/commands/HandleWebhookInvocationCommandHandler.ts +42 -0
- package/src/application/commands/InviteUserCommand.ts +12 -0
- package/src/application/commands/InviteUserCommandHandler.ts +22 -0
- package/src/application/commands/RegenerateUserInviteCommand.ts +12 -0
- package/src/application/commands/RegenerateUserInviteCommandHandler.ts +24 -0
- package/src/application/commands/ReplaceMutableRunWorkflowSnapshotCommand.ts +12 -0
- package/src/application/commands/ReplaceMutableRunWorkflowSnapshotCommandHandler.ts +47 -0
- package/src/application/commands/ReplaceWorkflowDebuggerOverlayCommand.ts +14 -0
- package/src/application/commands/ReplaceWorkflowDebuggerOverlayCommandHandler.ts +35 -0
- package/src/application/commands/ReplayWorkflowNodeCommand.ts +12 -0
- package/src/application/commands/ReplayWorkflowNodeCommandHandler.ts +164 -0
- package/src/application/commands/SetPinnedNodeInputCommand.ts +13 -0
- package/src/application/commands/SetPinnedNodeInputCommandHandler.ts +50 -0
- package/src/application/commands/SetWorkflowActivationCommand.ts +10 -0
- package/src/application/commands/SetWorkflowActivationCommandHandler.ts +39 -0
- package/src/application/commands/StartWorkflowRunCommand.ts +8 -0
- package/src/application/commands/StartWorkflowRunCommandHandler.ts +286 -0
- package/src/application/commands/TestCredentialInstanceCommand.ts +9 -0
- package/src/application/commands/TestCredentialInstanceCommandHandler.ts +28 -0
- package/src/application/commands/UpdateCredentialInstanceCommand.ts +12 -0
- package/src/application/commands/UpdateCredentialInstanceCommandHandler.ts +28 -0
- package/src/application/commands/UpdateUserAccountStatusCommand.ts +12 -0
- package/src/application/commands/UpdateUserAccountStatusCommandHandler.ts +24 -0
- package/src/application/commands/UploadOverlayPinnedBinaryCommand.ts +16 -0
- package/src/application/commands/UploadOverlayPinnedBinaryCommandHandler.ts +31 -0
- package/src/application/commands/UpsertCredentialBindingCommand.ts +11 -0
- package/src/application/commands/UpsertCredentialBindingCommandHandler.ts +28 -0
- package/src/application/commands/UpsertLocalBootstrapUserCommand.ts +12 -0
- package/src/application/commands/UpsertLocalBootstrapUserCommandHandler.ts +24 -0
- package/src/application/commands/UserAccountCommandHandlers.ts +10 -0
- package/src/application/contracts/CredentialContractsRegistry.ts +88 -0
- package/src/application/contracts/RunContracts.ts +41 -0
- package/src/application/contracts/WorkflowDebuggerContracts.ts +12 -0
- package/src/application/contracts/WorkflowViewContracts.ts +40 -0
- package/src/application/contracts/WorkflowWebsocketMessage.ts +8 -0
- package/src/application/contracts/userDirectoryContracts.types.ts +60 -0
- package/src/application/dev/BootRuntimeSnapshotHolder.ts +19 -0
- package/src/application/dev/BootRuntimeSummary.types.ts +11 -0
- package/src/application/dev/DevBootstrapSummaryAssembler.ts +84 -0
- package/src/application/dev/DevBootstrapSummaryJson.types.ts +9 -0
- package/src/application/logging/LogFilter.ts +7 -0
- package/src/application/logging/Logger.ts +10 -0
- package/src/application/mapping/DataMapper.ts +3 -0
- package/src/application/mapping/WorkflowDefinitionMapper.ts +171 -0
- package/src/application/mapping/WorkflowPolicyUiPresentationFactory.ts +39 -0
- package/src/application/queries/CredentialQueryHandlers.ts +12 -0
- package/src/application/queries/GetCredentialFieldEnvStatusQuery.ts +5 -0
- package/src/application/queries/GetCredentialFieldEnvStatusQueryHandler.ts +52 -0
- package/src/application/queries/GetCredentialInstanceQuery.ts +9 -0
- package/src/application/queries/GetCredentialInstanceQueryHandler.ts +27 -0
- package/src/application/queries/GetCredentialInstanceWithSecretsQuery.ts +9 -0
- package/src/application/queries/GetCredentialInstanceWithSecretsQueryHandler.ts +27 -0
- package/src/application/queries/GetRunBinaryAttachmentQuery.ts +11 -0
- package/src/application/queries/GetRunBinaryAttachmentQueryHandler.ts +23 -0
- package/src/application/queries/GetRunStateQuery.ts +8 -0
- package/src/application/queries/GetRunStateQueryHandler.ts +21 -0
- package/src/application/queries/GetWorkflowCredentialHealthQuery.ts +9 -0
- package/src/application/queries/GetWorkflowCredentialHealthQueryHandler.ts +27 -0
- package/src/application/queries/GetWorkflowDebuggerOverlayQuery.ts +8 -0
- package/src/application/queries/GetWorkflowDebuggerOverlayQueryHandler.ts +28 -0
- package/src/application/queries/GetWorkflowDetailQuery.ts +8 -0
- package/src/application/queries/GetWorkflowDetailQueryHandler.ts +24 -0
- package/src/application/queries/GetWorkflowOverlayBinaryAttachmentQuery.ts +11 -0
- package/src/application/queries/GetWorkflowOverlayBinaryAttachmentQueryHandler.ts +23 -0
- package/src/application/queries/GetWorkflowSummariesQuery.ts +4 -0
- package/src/application/queries/GetWorkflowSummariesQueryHandler.ts +23 -0
- package/src/application/queries/ListCredentialInstancesQuery.ts +5 -0
- package/src/application/queries/ListCredentialInstancesQueryHandler.ts +27 -0
- package/src/application/queries/ListCredentialTypesQuery.ts +5 -0
- package/src/application/queries/ListCredentialTypesQueryHandler.ts +28 -0
- package/src/application/queries/ListUserAccountsQuery.ts +5 -0
- package/src/application/queries/ListUserAccountsQueryHandler.ts +22 -0
- package/src/application/queries/ListWorkflowRunsQuery.ts +8 -0
- package/src/application/queries/ListWorkflowRunsQueryHandler.ts +21 -0
- package/src/application/queries/UserAccountQueryHandlers.ts +4 -0
- package/src/application/queries/VerifyUserInviteQuery.ts +9 -0
- package/src/application/queries/VerifyUserInviteQueryHandler.ts +21 -0
- package/src/application/runs/WorkflowRunRetentionPruneScheduler.ts +98 -0
- package/src/application/websocket/WorkflowRunEventWebsocketRelay.ts +36 -0
- package/src/application/websocket/WorkflowWebsocketPublisher.ts +5 -0
- package/src/application/workflows/WebhookEndpointPathValidator.ts +35 -0
- package/src/application/workflows/WorkflowDebuggerOverlayStateFactory.ts +122 -0
- package/src/applicationTokens.ts +72 -0
- package/src/bootstrap/CodemationBootstrapRequest.ts +27 -0
- package/src/bootstrap/CodemationContainerFactory.ts +310 -0
- package/src/bootstrap/CodemationContainerRegistration.ts +23 -0
- package/src/bootstrap/CodemationContainerRegistrationRegistrar.ts +42 -0
- package/src/bootstrap/CodemationFrontendBootstrapRequest.ts +16 -0
- package/src/bootstrap/CodemationWorkerBootstrapRequest.ts +19 -0
- package/src/bootstrap/PreparedCodemationRuntime.ts +37 -0
- package/src/bootstrap/PreparedCodemationRuntimeFactory.ts +308 -0
- package/src/bootstrap/boot/CliRuntimeBootService.ts +27 -0
- package/src/bootstrap/boot/FrontendRuntimeBootService.ts +86 -0
- package/src/bootstrap/boot/WorkerRuntimeBootService.ts +64 -0
- package/src/bootstrap/runtime/AppConfigFactory.ts +57 -0
- package/src/bootstrap/runtime/ResolvedImplementationSelectionFactory.ts +118 -0
- package/src/client.ts +3 -0
- package/src/codemationApplication.ts +311 -0
- package/src/consumer.ts +4 -0
- package/src/credentials.ts +24 -0
- package/src/devServerSidecar.ts +10 -0
- package/src/domain/credentials/CredentialBindingService.ts +139 -0
- package/src/domain/credentials/CredentialFieldEnvOverlayService.ts +60 -0
- package/src/domain/credentials/CredentialInstanceService.ts +391 -0
- package/src/domain/credentials/CredentialMaterialResolver.ts +55 -0
- package/src/domain/credentials/CredentialRuntimeMaterialService.ts +39 -0
- package/src/domain/credentials/CredentialSecretCipher.ts +70 -0
- package/src/domain/credentials/CredentialServices.ts +145 -0
- package/src/domain/credentials/CredentialSessionServiceImpl.ts +119 -0
- package/src/domain/credentials/CredentialTestService.ts +73 -0
- package/src/domain/credentials/CredentialTypeRegistryImpl.ts +29 -0
- package/src/domain/credentials/OAuth2ConnectServiceFactory.ts +396 -0
- package/src/domain/credentials/OAuth2ProviderRegistry.ts +75 -0
- package/src/domain/credentials/WorkflowCredentialNodeResolver.ts +246 -0
- package/src/domain/runs/WorkflowRunRepository.ts +11 -0
- package/src/domain/users/UserAccountServiceRegistry.ts +315 -0
- package/src/domain/users/userLoginMethodLabels.types.ts +29 -0
- package/src/domain/workflows/WorkflowActivationPreflight.ts +32 -0
- package/src/domain/workflows/WorkflowActivationPreflightRules.ts +77 -0
- package/src/domain/workflows/WorkflowActivationRepository.ts +9 -0
- package/src/domain/workflows/WorkflowDebuggerOverlayRepository.ts +7 -0
- package/src/domain/workflows/WorkflowDebuggerOverlayState.ts +8 -0
- package/src/domain/workflows/WorkflowDefinitionRepository.ts +11 -0
- package/src/index.ts +58 -0
- package/src/infrastructure/auth/AuthJsSessionVerifier.ts +26 -0
- package/src/infrastructure/auth/DevelopmentSessionBypassVerifier.ts +12 -0
- package/src/infrastructure/binary/BinaryBodyNodeReadableFactory.ts +22 -0
- package/src/infrastructure/binary/CountingSha256Transform.ts +26 -0
- package/src/infrastructure/binary/LocalFilesystemBinaryStorageRegistry.ts +86 -0
- package/src/infrastructure/config/CodemationPluginRegistrar.ts +44 -0
- package/src/infrastructure/credentials/FrameworkBuiltinCredentialTypesRegistrar.ts +21 -0
- package/src/infrastructure/credentials/OpenAiApiKeyCredentialHealthTester.ts +89 -0
- package/src/infrastructure/credentials/OpenAiApiKeyCredentialShapes.types.ts +15 -0
- package/src/infrastructure/credentials/OpenAiApiKeyCredentialTypeFactory.ts +47 -0
- package/src/infrastructure/di/HandlesCommandRegistry.ts +24 -0
- package/src/infrastructure/di/HandlesDomainEventRegistry.ts +24 -0
- package/src/infrastructure/di/HandlesQueryRegistry.ts +24 -0
- package/src/infrastructure/di/InMemoryCommandBus.ts +47 -0
- package/src/infrastructure/di/InMemoryDomainEventBus.ts +47 -0
- package/src/infrastructure/di/InMemoryQueryBus.ts +45 -0
- package/src/infrastructure/ids/CodemationIdFactory.ts +12 -0
- package/src/infrastructure/logging/BrowserLogger.ts +1 -0
- package/src/infrastructure/logging/BrowserLoggerFactory.ts +14 -0
- package/src/infrastructure/logging/ConsoleLogger.ts +41 -0
- package/src/infrastructure/logging/FilteringLogger.ts +38 -0
- package/src/infrastructure/logging/LogLevelPolicy.ts +148 -0
- package/src/infrastructure/logging/LogLevelPolicyFactory.ts +16 -0
- package/src/infrastructure/logging/PerformanceLogPolicy.ts +10 -0
- package/src/infrastructure/logging/PerformanceLogPolicyFactory.ts +14 -0
- package/src/infrastructure/logging/ServerLogger.ts +1 -0
- package/src/infrastructure/logging/ServerLoggerFactory.ts +28 -0
- package/src/infrastructure/persistence/CodemationPostgresPrismaClientFactory.ts +9 -0
- package/src/infrastructure/persistence/CredentialPersistenceStore.ts +139 -0
- package/src/infrastructure/persistence/DatabasePersistenceResolver.ts +91 -0
- package/src/infrastructure/persistence/InMemoryTriggerSetupStateRepository.ts +23 -0
- package/src/infrastructure/persistence/InMemoryWorkflowActivationRepository.ts +18 -0
- package/src/infrastructure/persistence/InMemoryWorkflowDebuggerOverlayRepository.ts +16 -0
- package/src/infrastructure/persistence/InMemoryWorkflowRunRepository.ts +94 -0
- package/src/infrastructure/persistence/PrismaClientFactory.ts +26 -0
- package/src/infrastructure/persistence/PrismaCredentialStore.ts +368 -0
- package/src/infrastructure/persistence/PrismaMigrationDeployer.ts +184 -0
- package/src/infrastructure/persistence/PrismaTriggerSetupStateRepository.ts +68 -0
- package/src/infrastructure/persistence/PrismaWorkflowActivationRepository.ts +36 -0
- package/src/infrastructure/persistence/PrismaWorkflowDebuggerOverlayRepository.ts +65 -0
- package/src/infrastructure/persistence/PrismaWorkflowRunRepository.ts +243 -0
- package/src/infrastructure/persistence/RuntimeWorkflowActivationPolicy.ts +27 -0
- package/src/infrastructure/persistence/SchedulerPersistenceCompatibilityValidator.ts +20 -0
- package/src/infrastructure/persistence/WorkflowDefinitionRepositoryAdapter.ts +31 -0
- package/src/infrastructure/persistence/WorkflowRunRepository.ts +46 -0
- package/src/infrastructure/persistence/generated/prisma/client.d.ts +1 -0
- package/src/infrastructure/persistence/generated/prisma/default.d.ts +1 -0
- package/src/infrastructure/persistence/generated/prisma/edge.d.ts +1 -0
- package/src/infrastructure/persistence/generated/prisma/index.d.ts +4766 -0
- package/src/infrastructure/persistence/generated/prisma/package.json +144 -0
- package/src/infrastructure/persistence/generated/prisma/query_compiler_fast_bg.wasm +0 -0
- package/src/infrastructure/persistence/generated/prisma/runtime/client.d.ts +3358 -0
- package/src/infrastructure/persistence/generated/prisma/runtime/index-browser.d.ts +90 -0
- package/src/infrastructure/persistence/generated/prisma/schema.prisma +35 -0
- package/src/infrastructure/persistence/generated/prisma/wasm-edge-light-loader.mjs +5 -0
- package/src/infrastructure/persistence/generated/prisma/wasm-worker-loader.mjs +5 -0
- package/src/infrastructure/persistence/generated/prisma-client/client.d.ts +1 -0
- package/src/infrastructure/persistence/generated/prisma-client/client.js +5 -0
- package/src/infrastructure/persistence/generated/prisma-client/default.d.ts +1 -0
- package/src/infrastructure/persistence/generated/prisma-client/default.js +5 -0
- package/src/infrastructure/persistence/generated/prisma-client/edge.d.ts +1 -0
- package/src/infrastructure/persistence/generated/prisma-client/edge.js +299 -0
- package/src/infrastructure/persistence/generated/prisma-client/index-browser.js +325 -0
- package/src/infrastructure/persistence/generated/prisma-client/index.d.ts +21623 -0
- package/src/infrastructure/persistence/generated/prisma-client/index.js +299 -0
- package/src/infrastructure/persistence/generated/prisma-client/package.json +144 -0
- package/src/infrastructure/persistence/generated/prisma-client/query_compiler_fast_bg.js +2 -0
- package/src/infrastructure/persistence/generated/prisma-client/query_compiler_fast_bg.wasm +0 -0
- package/src/infrastructure/persistence/generated/prisma-client/query_compiler_fast_bg.wasm-base64.js +2 -0
- package/src/infrastructure/persistence/generated/prisma-client/runtime/client.d.ts +3358 -0
- package/src/infrastructure/persistence/generated/prisma-client/runtime/client.js +86 -0
- package/src/infrastructure/persistence/generated/prisma-client/runtime/client.js.map +1 -0
- package/src/infrastructure/persistence/generated/prisma-client/runtime/index-browser.d.ts +90 -0
- package/src/infrastructure/persistence/generated/prisma-client/runtime/index-browser.js +6 -0
- package/src/infrastructure/persistence/generated/prisma-client/runtime/index-browser.js.map +1 -0
- package/src/infrastructure/persistence/generated/prisma-client/runtime/wasm-compiler-edge.js +76 -0
- package/src/infrastructure/persistence/generated/prisma-client/runtime/wasm-compiler-edge.js.map +1 -0
- package/src/infrastructure/persistence/generated/prisma-client/schema.prisma +179 -0
- package/src/infrastructure/persistence/generated/prisma-client/wasm-edge-light-loader.mjs +5 -0
- package/src/infrastructure/persistence/generated/prisma-client/wasm-worker-loader.mjs +5 -0
- package/src/infrastructure/runtime/LiveWorkflowRepository.ts +14 -0
- package/src/infrastructure/runtime/WorkerRuntimeScheduler.ts +35 -0
- package/src/infrastructure/server/http/ServerHttpRouteParams.ts +1 -0
- package/src/infrastructure/webhooks/RequestToWebhookItemMapper.ts +128 -0
- package/src/nextServer.ts +31 -0
- package/src/persistenceServer.ts +5 -0
- package/src/presentation/config/AppConfig.ts +25 -0
- package/src/presentation/config/CodemationAppContext.ts +19 -0
- package/src/presentation/config/CodemationApplicationFacade.ts +5 -0
- package/src/presentation/config/CodemationAuthConfig.ts +31 -0
- package/src/presentation/config/CodemationClassToken.ts +3 -0
- package/src/presentation/config/CodemationConfig.ts +86 -0
- package/src/presentation/config/CodemationConfigNormalizer.ts +179 -0
- package/src/presentation/config/CodemationLogConfig.ts +22 -0
- package/src/presentation/config/CodemationPackageManifest.ts +9 -0
- package/src/presentation/config/CodemationPlugin.ts +20 -0
- package/src/presentation/config/CodemationPluginListMerger.ts +46 -0
- package/src/presentation/config/CodemationWhitelabelConfig.ts +9 -0
- package/src/presentation/config/CodemationWorkflowDiscovery.ts +3 -0
- package/src/presentation/http/ApiPaths.ts +165 -0
- package/src/presentation/http/CodemationServerGatewayFactory.ts +120 -0
- package/src/presentation/http/HttpRequestJsonBodyReader.ts +12 -0
- package/src/presentation/http/ServerHttpErrorResponseFactory.ts +33 -0
- package/src/presentation/http/ServerHttpRouteParams.ts +1 -0
- package/src/presentation/http/hono/CodemationHonoApiAppFactory.ts +64 -0
- package/src/presentation/http/hono/HonoApiRouteRegistrar.ts +5 -0
- package/src/presentation/http/hono/HonoHttpAnonymousRoutePolicyRegistry.ts +27 -0
- package/src/presentation/http/hono/registrars/BinaryHonoApiRouteRegistrar.ts +21 -0
- package/src/presentation/http/hono/registrars/CredentialHonoApiRouteRegistrar.ts +34 -0
- package/src/presentation/http/hono/registrars/DevHonoApiRouteRegistrar.ts +17 -0
- package/src/presentation/http/hono/registrars/OAuth2HonoApiRouteRegistrar.ts +18 -0
- package/src/presentation/http/hono/registrars/RunHonoApiRouteRegistrar.ts +31 -0
- package/src/presentation/http/hono/registrars/UserHonoApiRouteRegistrar.ts +24 -0
- package/src/presentation/http/hono/registrars/WebhookHonoApiRouteRegistrar.ts +23 -0
- package/src/presentation/http/hono/registrars/WhitelabelHonoApiRouteRegistrar.ts +18 -0
- package/src/presentation/http/hono/registrars/WorkflowHonoApiRouteRegistrar.ts +33 -0
- package/src/presentation/http/routeHandlers/BinaryHttpRouteHandlerFactory.ts +101 -0
- package/src/presentation/http/routeHandlers/CredentialHttpRouteHandler.ts +129 -0
- package/src/presentation/http/routeHandlers/DevBootstrapSummaryHttpRouteHandler.ts +21 -0
- package/src/presentation/http/routeHandlers/OAuth2HttpRouteHandlerFactory.ts +129 -0
- package/src/presentation/http/routeHandlers/RunHttpRouteHandler.ts +82 -0
- package/src/presentation/http/routeHandlers/UserHttpRouteHandlerFactory.ts +109 -0
- package/src/presentation/http/routeHandlers/WebhookHttpRouteHandler.ts +42 -0
- package/src/presentation/http/routeHandlers/WhitelabelLogoHttpRouteHandler.ts +96 -0
- package/src/presentation/http/routeHandlers/WorkflowHttpRouteHandler.ts +104 -0
- package/src/presentation/server/CodemationConsumerAppResolver.ts +82 -0
- package/src/presentation/server/CodemationConsumerConfigExportsResolver.ts +33 -0
- package/src/presentation/server/CodemationConsumerConfigLoader.ts +270 -0
- package/src/presentation/server/CodemationPluginDiscovery.ts +151 -0
- package/src/presentation/server/CodemationTsyringeParamInfoReader.ts +26 -0
- package/src/presentation/server/CodemationTsyringeTypeInfoRegistrar.ts +121 -0
- package/src/presentation/server/DevelopmentRuntimeRouteGuard.ts +59 -0
- package/src/presentation/server/DiscoveredWorkflowsEmptyMessageFactory.ts +11 -0
- package/src/presentation/server/WorkflowDefinitionExportsResolver.ts +24 -0
- package/src/presentation/server/WorkflowDiscoveryPathSegmentsComputer.ts +53 -0
- package/src/presentation/server/WorkflowModulePathFinder.ts +47 -0
- package/src/presentation/websocket/WorkflowWebsocketServer.ts +169 -0
- package/src/server.ts +14 -0
- package/tsconfig.json +10 -0
- package/vitest.shared.ts +45 -0
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { i as CodemationLogRule, n as CodemationLogConfig, r as CodemationLogLevelName, t as CodemationWhitelabelConfig } from "./CodemationWhitelabelConfig-DgbjgtrR.js";
|
|
2
|
+
import "./LogLevelPolicy-4cq9z0TI.js";
|
|
3
|
+
import { s as AnyCredentialType } from "./index-Bs4F1IsC.js";
|
|
4
|
+
import { C as CodemationAuthOidcProviderConfig, S as CodemationAuthOAuthProviderConfig, _ as CodemationRegistrationContextBase, a as CodemationConfig, b as CodemationAuthConfig, c as CodemationEngineExecutionLimitsConfig, d as CodemationSchedulerConfig, f as CodemationSchedulerKind, g as CodemationAppContext, h as CodemationPluginContext, i as CodemationApplicationRuntimeConfig, l as CodemationEventBusConfig, m as CodemationPlugin, n as CodemationAppSchedulerConfig, o as CodemationDatabaseConfig, p as CodemationWorkflowDiscovery, r as CodemationAppSchedulerKind, s as CodemationDatabaseKind, t as CodemationAppDefinition, u as CodemationEventBusKind, v as CodemationClassToken, x as CodemationAuthKind, y as AppConfig } from "./CodemationConfig-XCkSV2dj.js";
|
|
5
|
+
import { t as CodemationConsumerConfigLoader } from "./CodemationConsumerConfigLoader-Dmm2TzAA.js";
|
|
6
|
+
import "./CredentialServices-DpDpm8mL.js";
|
|
7
|
+
import { A as CommandBus, D as ListUserAccountsQuery, E as UpsertLocalBootstrapUserCommand, O as UpsertLocalBootstrapUserResultDto, a as CodemationApplicationConfig, c as CodemationFrontendBootstrapRequest, i as CodemationApplication, k as QueryBus, l as CodemationBootstrapRequest, n as ApplicationTokens, o as CodemationStopHandle, s as CodemationWorkerBootstrapRequest, t as CodemationPluginListMerger } from "./CodemationPluginListMerger-BRYqEk0y.js";
|
|
8
|
+
import { t as PrismaClient } from "./client-Yh7-CQud.js";
|
|
9
|
+
import "./WorkflowViewContracts-DCLpTn25.js";
|
|
10
|
+
import { c as CodemationPackageManifest, l as CodemationPluginPackageManifest, o as CodemationServerGateway, s as ApiPaths } from "./server-BBdsATju.js";
|
|
11
|
+
import { n as CodemationPostgresPrismaClientFactory } from "./persistenceServer-K5eqlZm3.js";
|
|
12
|
+
|
|
13
|
+
//#region src/presentation/config/CodemationApplicationFacade.d.ts
|
|
14
|
+
interface CodemationApplicationFacade {
|
|
15
|
+
registerCredentialType(type: AnyCredentialType): void;
|
|
16
|
+
}
|
|
17
|
+
//#endregion
|
|
18
|
+
export { ApiPaths, type AppConfig, ApplicationTokens, type CodemationAppContext, type CodemationAppDefinition, type CodemationAppSchedulerConfig, type CodemationAppSchedulerKind, CodemationApplication, type CodemationApplicationConfig, type CodemationApplicationFacade, type CodemationApplicationRuntimeConfig, type CodemationAuthConfig, type CodemationAuthKind, type CodemationAuthOAuthProviderConfig, type CodemationAuthOidcProviderConfig, CodemationBootstrapRequest, type CodemationClassToken, type CodemationConfig, CodemationConsumerConfigLoader, type CodemationDatabaseConfig, type CodemationDatabaseKind, type CodemationEngineExecutionLimitsConfig, type CodemationEventBusConfig, type CodemationEventBusKind, CodemationFrontendBootstrapRequest, type CodemationLogConfig, type CodemationLogLevelName, type CodemationLogRule, type CodemationPackageManifest, type CodemationPlugin, type CodemationPluginContext, CodemationPluginListMerger, type CodemationPluginPackageManifest, CodemationPostgresPrismaClientFactory, type CodemationRegistrationContextBase, type CodemationSchedulerConfig, type CodemationSchedulerKind, CodemationServerGateway, type CodemationStopHandle, type CodemationWhitelabelConfig, CodemationWorkerBootstrapRequest, type CodemationWorkflowDiscovery, type CommandBus, ListUserAccountsQuery, PrismaClient, type QueryBus, UpsertLocalBootstrapUserCommand, type UpsertLocalBootstrapUserResultDto };
|
|
19
|
+
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import "./ConsoleLogger-ClPU7jtc.js";
|
|
2
|
+
import "./ServerLoggerFactory-BRHxIDS7.js";
|
|
3
|
+
import { t as CodemationConsumerConfigLoader } from "./CodemationConsumerConfigLoader-scS_RQMy.js";
|
|
4
|
+
import "./decorateParam-BTcc3KNk.js";
|
|
5
|
+
import "./decorate-B-N_5S4p.js";
|
|
6
|
+
import { u as ApplicationTokens } from "./CredentialServices-BKBGe7l3.js";
|
|
7
|
+
import { b as ListUserAccountsQuery, n as CodemationBootstrapRequest, o as ApiPaths, r as CodemationApplication, t as CodemationFrontendBootstrapRequest, y as UpsertLocalBootstrapUserCommand } from "./CodemationFrontendBootstrapRequest-CE6DjOWJ.js";
|
|
8
|
+
import "./PrismaMigrationDeployer-B1E_gYz7.js";
|
|
9
|
+
import { n as CodemationWorkerBootstrapRequest, t as CodemationPluginListMerger } from "./CodemationPluginListMerger-BNmaoXQL.js";
|
|
10
|
+
import { n as CodemationPostgresPrismaClientFactory, t as import_client } from "./persistenceServer-W9uRw0dJ.js";
|
|
11
|
+
import { n as CodemationServerGateway } from "./server-BiHSuA13.js";
|
|
12
|
+
|
|
13
|
+
var PrismaClient = import_client.PrismaClient;
|
|
14
|
+
export { ApiPaths, ApplicationTokens, CodemationApplication, CodemationBootstrapRequest, CodemationConsumerConfigLoader, CodemationFrontendBootstrapRequest, CodemationPluginListMerger, CodemationPostgresPrismaClientFactory, CodemationServerGateway, CodemationWorkerBootstrapRequest, ListUserAccountsQuery, PrismaClient, UpsertLocalBootstrapUserCommand };
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import { a as Logger, o as LoggerFactory } from "./CodemationWhitelabelConfig-DgbjgtrR.js";
|
|
2
|
+
import "./LogLevelPolicy-4cq9z0TI.js";
|
|
3
|
+
import { N as BinaryStorage, W as Clock } from "./index-Bs4F1IsC.js";
|
|
4
|
+
import { y as AppConfig } from "./CodemationConfig-XCkSV2dj.js";
|
|
5
|
+
import { a as CredentialInstanceService, i as CredentialBindingService } from "./CredentialServices-DpDpm8mL.js";
|
|
6
|
+
import { C as BinaryHttpRouteHandler, S as HonoApiRouteRegistrar, T as WorkflowRunRepository, _ as OAuth2HttpRouteHandler, b as logLevelPolicyFactory, c as CodemationFrontendBootstrapRequest, d as WorkflowHttpRouteHandler, f as WorkflowDefinitionMapper, g as RunHttpRouteHandler, h as RequestToWebhookItemMapper, i as CodemationApplication, l as CodemationBootstrapRequest, m as WebhookHttpRouteHandler, n as ApplicationTokens, p as WorkflowPolicyUiPresentationFactory, r as SessionVerifier, s as CodemationWorkerBootstrapRequest, t as CodemationPluginListMerger, u as WorkflowWebsocketServer, v as DevBootstrapSummaryJson, w as RunBinaryAttachmentLookupService, x as CredentialHttpRouteHandler, y as LogLevelPolicyFactory } from "./CodemationPluginListMerger-BRYqEk0y.js";
|
|
7
|
+
import "./client-Yh7-CQud.js";
|
|
8
|
+
import "./WorkflowViewContracts-DCLpTn25.js";
|
|
9
|
+
import { Hono } from "hono";
|
|
10
|
+
|
|
11
|
+
//#region src/application/logging/LogFilter.d.ts
|
|
12
|
+
type LogFilter = (entry: Readonly<{
|
|
13
|
+
scope: string;
|
|
14
|
+
level: "info" | "warn" | "error" | "debug";
|
|
15
|
+
message: string;
|
|
16
|
+
}>) => boolean;
|
|
17
|
+
//#endregion
|
|
18
|
+
//#region src/infrastructure/logging/FilteringLogger.d.ts
|
|
19
|
+
declare class FilteringLogger implements Logger {
|
|
20
|
+
private readonly inner;
|
|
21
|
+
private readonly scope;
|
|
22
|
+
private readonly filter;
|
|
23
|
+
constructor(inner: Logger, scope: string, filter: LogFilter);
|
|
24
|
+
info(message: string, exception?: Error): void;
|
|
25
|
+
warn(message: string, exception?: Error): void;
|
|
26
|
+
error(message: string, exception?: Error): void;
|
|
27
|
+
debug(message: string, exception?: Error): void;
|
|
28
|
+
}
|
|
29
|
+
//#endregion
|
|
30
|
+
//#region src/infrastructure/logging/PerformanceLogPolicy.d.ts
|
|
31
|
+
/**
|
|
32
|
+
* Opt-in detailed timing / diagnostics lines (used with `ServerLoggerFactory#createPerformanceDiagnostics`).
|
|
33
|
+
*
|
|
34
|
+
* Set `CODEMATION_PERFORMANCE_LOGGING=true` to enable. Otherwise those loggers are silent regardless of level.
|
|
35
|
+
*/
|
|
36
|
+
declare class PerformanceLogPolicy {
|
|
37
|
+
shouldEmitDetailedTiming(): boolean;
|
|
38
|
+
}
|
|
39
|
+
//#endregion
|
|
40
|
+
//#region src/infrastructure/logging/PerformanceLogPolicyFactory.d.ts
|
|
41
|
+
/**
|
|
42
|
+
* Process-wide {@link PerformanceLogPolicy} singleton (same pattern as {@link LogLevelPolicyFactory}).
|
|
43
|
+
*/
|
|
44
|
+
declare class PerformanceLogPolicyFactory {
|
|
45
|
+
private readonly policy;
|
|
46
|
+
create(): PerformanceLogPolicy;
|
|
47
|
+
}
|
|
48
|
+
declare const performanceLogPolicyFactory: PerformanceLogPolicyFactory;
|
|
49
|
+
//#endregion
|
|
50
|
+
//#region src/infrastructure/logging/ServerLoggerFactory.d.ts
|
|
51
|
+
declare class ServerLoggerFactory implements LoggerFactory {
|
|
52
|
+
private readonly logLevelPolicyFactory;
|
|
53
|
+
constructor(logLevelPolicyFactory: LogLevelPolicyFactory);
|
|
54
|
+
create(scope: string): Logger;
|
|
55
|
+
createFiltered(scope: string, filter: LogFilter): Logger;
|
|
56
|
+
createPerformanceDiagnostics(scope: string): Logger;
|
|
57
|
+
}
|
|
58
|
+
//#endregion
|
|
59
|
+
//#region src/application/runs/WorkflowRunRetentionPruneScheduler.d.ts
|
|
60
|
+
/**
|
|
61
|
+
* Periodically deletes terminal workflow runs whose age exceeds the effective retention
|
|
62
|
+
* (`policySnapshot.retentionSeconds` or `CODEMATION_RUN_RETENTION_DEFAULT_SECONDS`),
|
|
63
|
+
* and removes binary blobs referenced from run state via {@link BinaryStorage}.
|
|
64
|
+
*/
|
|
65
|
+
declare class WorkflowRunRetentionPruneScheduler {
|
|
66
|
+
private readonly clock;
|
|
67
|
+
private readonly runs;
|
|
68
|
+
private readonly binaryStorage;
|
|
69
|
+
private readonly appConfig;
|
|
70
|
+
private timer;
|
|
71
|
+
private readonly logger;
|
|
72
|
+
private readonly binaryKeysCollector;
|
|
73
|
+
constructor(clock: Clock, runs: WorkflowRunRepository, binaryStorage: BinaryStorage, appConfig: AppConfig, loggerFactory: ServerLoggerFactory);
|
|
74
|
+
start(): void;
|
|
75
|
+
stop(): void;
|
|
76
|
+
/** Exposed for tests; production path is the interval started by {@link start}. */
|
|
77
|
+
runOnce(): Promise<void>;
|
|
78
|
+
}
|
|
79
|
+
//#endregion
|
|
80
|
+
//#region src/presentation/http/hono/CodemationHonoApiAppFactory.d.ts
|
|
81
|
+
declare class CodemationHonoApiApp {
|
|
82
|
+
private readonly app;
|
|
83
|
+
constructor(sessionVerifier: SessionVerifier, registrars: ReadonlyArray<HonoApiRouteRegistrar>, binaryHttpRouteHandler: BinaryHttpRouteHandler);
|
|
84
|
+
getHono(): Hono;
|
|
85
|
+
fetch(request: Request): Response | Promise<Response>;
|
|
86
|
+
}
|
|
87
|
+
//#endregion
|
|
88
|
+
export { ApplicationTokens, BinaryHttpRouteHandler, CodemationApplication, CodemationBootstrapRequest, CodemationFrontendBootstrapRequest, CodemationHonoApiApp, CodemationPluginListMerger, CodemationWorkerBootstrapRequest, CredentialBindingService, CredentialHttpRouteHandler, CredentialInstanceService, type DevBootstrapSummaryJson, FilteringLogger, type LogFilter, LogLevelPolicyFactory, type Logger, type LoggerFactory, OAuth2HttpRouteHandler, PerformanceLogPolicy, PerformanceLogPolicyFactory, RequestToWebhookItemMapper, RunBinaryAttachmentLookupService, RunHttpRouteHandler, ServerLoggerFactory, WebhookHttpRouteHandler, WorkflowDefinitionMapper, WorkflowHttpRouteHandler, WorkflowPolicyUiPresentationFactory, WorkflowRunRetentionPruneScheduler, WorkflowWebsocketServer, logLevelPolicyFactory, performanceLogPolicyFactory };
|
|
89
|
+
//# sourceMappingURL=nextServer.d.ts.map
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
import "./ConsoleLogger-ClPU7jtc.js";
|
|
2
|
+
import { a as FilteringLogger, i as PerformanceLogPolicy, n as PerformanceLogPolicyFactory, o as LogLevelPolicyFactory, r as performanceLogPolicyFactory, s as logLevelPolicyFactory, t as ServerLoggerFactory } from "./ServerLoggerFactory-BRHxIDS7.js";
|
|
3
|
+
import { n as __decorateMetadata, t as __decorateParam } from "./decorateParam-BTcc3KNk.js";
|
|
4
|
+
import { t as __decorate } from "./decorate-B-N_5S4p.js";
|
|
5
|
+
import { a as CredentialInstanceService, i as CredentialBindingService, u as ApplicationTokens } from "./CredentialServices-BKBGe7l3.js";
|
|
6
|
+
import { a as WorkflowWebsocketServer, c as WorkflowDefinitionMapper, d as RequestToWebhookItemMapper, f as RunHttpRouteHandler, h as BinaryHttpRouteHandler, i as CodemationHonoApiApp, l as WorkflowPolicyUiPresentationFactory, m as CredentialHttpRouteHandler, n as CodemationBootstrapRequest, p as OAuth2HttpRouteHandler, r as CodemationApplication, s as WorkflowHttpRouteHandler, t as CodemationFrontendBootstrapRequest, u as WebhookHttpRouteHandler, v as RunBinaryAttachmentLookupService } from "./CodemationFrontendBootstrapRequest-CE6DjOWJ.js";
|
|
7
|
+
import "./PrismaMigrationDeployer-B1E_gYz7.js";
|
|
8
|
+
import { n as CodemationWorkerBootstrapRequest, t as CodemationPluginListMerger } from "./CodemationPluginListMerger-BNmaoXQL.js";
|
|
9
|
+
import { CoreTokens, RunFinishedAtFactory, inject, injectable } from "@codemation/core";
|
|
10
|
+
|
|
11
|
+
//#region src/application/binary/RunStateBinaryStorageKeysCollector.ts
|
|
12
|
+
/**
|
|
13
|
+
* Collects every `storageKey` referenced by binary attachments embedded in persisted run state
|
|
14
|
+
* (outputs, node snapshots, mutable debugger state).
|
|
15
|
+
*/
|
|
16
|
+
var RunStateBinaryStorageKeysCollector = class {
|
|
17
|
+
collectFromRunState(state) {
|
|
18
|
+
const keys = /* @__PURE__ */ new Set();
|
|
19
|
+
this.addFromOutputsByNode(state.outputsByNode, keys);
|
|
20
|
+
this.addFromNodeSnapshots(state, keys);
|
|
21
|
+
this.addFromMutableState(state.mutableState, keys);
|
|
22
|
+
return keys;
|
|
23
|
+
}
|
|
24
|
+
addFromOutputsByNode(outputsByNode, keys) {
|
|
25
|
+
for (const outputs of Object.values(outputsByNode)) for (const items of Object.values(outputs)) this.addFromItems(items, keys);
|
|
26
|
+
}
|
|
27
|
+
addFromNodeSnapshots(state, keys) {
|
|
28
|
+
for (const snapshot of Object.values(state.nodeSnapshotsByNodeId)) {
|
|
29
|
+
this.addFromPortMap(snapshot.inputsByPort, keys);
|
|
30
|
+
this.addFromPortMap(snapshot.outputs, keys);
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
addFromMutableState(mutableState, keys) {
|
|
34
|
+
for (const nodeState of Object.values(mutableState?.nodesById ?? {})) {
|
|
35
|
+
this.addFromPortMap(nodeState.pinnedOutputsByPort, keys);
|
|
36
|
+
this.addFromItems(nodeState.lastDebugInput, keys);
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
addFromPortMap(itemMap, keys) {
|
|
40
|
+
for (const items of Object.values(itemMap ?? {})) this.addFromItems(items, keys);
|
|
41
|
+
}
|
|
42
|
+
addFromItems(items, keys) {
|
|
43
|
+
for (const item of items ?? []) for (const attachment of Object.values(item.binary ?? {})) this.addAttachment(attachment, keys);
|
|
44
|
+
}
|
|
45
|
+
addAttachment(attachment, keys) {
|
|
46
|
+
if (attachment.storageKey.length > 0) keys.add(attachment.storageKey);
|
|
47
|
+
}
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
//#endregion
|
|
51
|
+
//#region src/application/runs/WorkflowRunRetentionPruneScheduler.ts
|
|
52
|
+
var _ref;
|
|
53
|
+
let WorkflowRunRetentionPruneScheduler = class WorkflowRunRetentionPruneScheduler$1 {
|
|
54
|
+
timer;
|
|
55
|
+
logger;
|
|
56
|
+
binaryKeysCollector = new RunStateBinaryStorageKeysCollector();
|
|
57
|
+
constructor(clock, runs, binaryStorage, appConfig, loggerFactory) {
|
|
58
|
+
this.clock = clock;
|
|
59
|
+
this.runs = runs;
|
|
60
|
+
this.binaryStorage = binaryStorage;
|
|
61
|
+
this.appConfig = appConfig;
|
|
62
|
+
this.logger = loggerFactory.create("codemation.runRetentionPrune");
|
|
63
|
+
}
|
|
64
|
+
start() {
|
|
65
|
+
if (this.appConfig.env.CODEMATION_RUN_PRUNE_ENABLED === "false") return;
|
|
66
|
+
if (this.timer) return;
|
|
67
|
+
const intervalMs = Number(this.appConfig.env.CODEMATION_RUN_PRUNE_INTERVAL_MS ?? 6e4);
|
|
68
|
+
this.timer = setInterval(() => {
|
|
69
|
+
this.runOnce().catch((error) => {
|
|
70
|
+
this.logger.warn(`Run retention prune tick failed: ${error instanceof Error ? error.message : String(error)}`);
|
|
71
|
+
});
|
|
72
|
+
}, intervalMs);
|
|
73
|
+
}
|
|
74
|
+
stop() {
|
|
75
|
+
if (this.timer) {
|
|
76
|
+
clearInterval(this.timer);
|
|
77
|
+
this.timer = void 0;
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
/** Exposed for tests; production path is the interval started by {@link start}. */
|
|
81
|
+
async runOnce() {
|
|
82
|
+
this.logger.debug("Run retention prune: starting check");
|
|
83
|
+
const defaultRetentionSec = Number(this.appConfig.env.CODEMATION_RUN_RETENTION_DEFAULT_SECONDS ?? 86400);
|
|
84
|
+
const summaries = await this.runs.listRuns({ limit: 500 });
|
|
85
|
+
const nowMs = this.clock.now().getTime();
|
|
86
|
+
let foundCount = 0;
|
|
87
|
+
let prunedCount = 0;
|
|
88
|
+
for (const s of summaries) {
|
|
89
|
+
if (s.status !== "completed" && s.status !== "failed") continue;
|
|
90
|
+
const state = await this.runs.load(s.runId);
|
|
91
|
+
if (!state) continue;
|
|
92
|
+
const retentionSec = state.policySnapshot?.retentionSeconds ?? defaultRetentionSec;
|
|
93
|
+
const finishedAt = RunFinishedAtFactory.resolveIso(state) ?? s.finishedAt;
|
|
94
|
+
if (!finishedAt) continue;
|
|
95
|
+
if (nowMs - Date.parse(finishedAt) <= retentionSec * 1e3) continue;
|
|
96
|
+
const runId = s.runId;
|
|
97
|
+
const workflowId = s.workflowId;
|
|
98
|
+
foundCount += 1;
|
|
99
|
+
const storageKeys = this.binaryKeysCollector.collectFromRunState(state);
|
|
100
|
+
for (const key of storageKeys) await this.binaryStorage.delete(key);
|
|
101
|
+
await this.runs.deleteRun(runId);
|
|
102
|
+
prunedCount += 1;
|
|
103
|
+
this.logger.debug(`Run retention prune: pruned run ${runId} for workflow ${workflowId}`);
|
|
104
|
+
}
|
|
105
|
+
this.logger.info(`Run retention prune: found ${foundCount} run(s) to prune`);
|
|
106
|
+
this.logger.info(`Run retention prune: pruned ${prunedCount} run(s)`);
|
|
107
|
+
}
|
|
108
|
+
};
|
|
109
|
+
WorkflowRunRetentionPruneScheduler = __decorate([
|
|
110
|
+
injectable(),
|
|
111
|
+
__decorateParam(0, inject(ApplicationTokens.Clock)),
|
|
112
|
+
__decorateParam(1, inject(ApplicationTokens.WorkflowRunRepository)),
|
|
113
|
+
__decorateParam(2, inject(CoreTokens.BinaryStorage)),
|
|
114
|
+
__decorateParam(3, inject(ApplicationTokens.AppConfig)),
|
|
115
|
+
__decorateParam(4, inject(ServerLoggerFactory)),
|
|
116
|
+
__decorateMetadata("design:paramtypes", [
|
|
117
|
+
Object,
|
|
118
|
+
Object,
|
|
119
|
+
Object,
|
|
120
|
+
Object,
|
|
121
|
+
typeof (_ref = typeof ServerLoggerFactory !== "undefined" && ServerLoggerFactory) === "function" ? _ref : Object
|
|
122
|
+
])
|
|
123
|
+
], WorkflowRunRetentionPruneScheduler);
|
|
124
|
+
|
|
125
|
+
//#endregion
|
|
126
|
+
export { ApplicationTokens, BinaryHttpRouteHandler, CodemationApplication, CodemationBootstrapRequest, CodemationFrontendBootstrapRequest, CodemationHonoApiApp, CodemationPluginListMerger, CodemationWorkerBootstrapRequest, CredentialBindingService, CredentialHttpRouteHandler, CredentialInstanceService, FilteringLogger, LogLevelPolicyFactory, OAuth2HttpRouteHandler, PerformanceLogPolicy, PerformanceLogPolicyFactory, RequestToWebhookItemMapper, RunBinaryAttachmentLookupService, RunHttpRouteHandler, ServerLoggerFactory, WebhookHttpRouteHandler, WorkflowDefinitionMapper, WorkflowHttpRouteHandler, WorkflowPolicyUiPresentationFactory, WorkflowRunRetentionPruneScheduler, WorkflowWebsocketServer, logLevelPolicyFactory, performanceLogPolicyFactory };
|
|
127
|
+
//# sourceMappingURL=nextServer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"nextServer.js","names":["WorkflowRunRetentionPruneScheduler","clock: Clock","runs: WorkflowRunRepository","binaryStorage: BinaryStorage","appConfig: AppConfig","loggerFactory: ServerLoggerFactory"],"sources":["../src/application/binary/RunStateBinaryStorageKeysCollector.ts","../src/application/runs/WorkflowRunRetentionPruneScheduler.ts"],"sourcesContent":["import type { BinaryAttachment, Items, PersistedRunState } from \"@codemation/core\";\n\n/**\n * Collects every `storageKey` referenced by binary attachments embedded in persisted run state\n * (outputs, node snapshots, mutable debugger state).\n */\nexport class RunStateBinaryStorageKeysCollector {\n collectFromRunState(state: PersistedRunState): ReadonlySet<string> {\n const keys = new Set<string>();\n this.addFromOutputsByNode(state.outputsByNode, keys);\n this.addFromNodeSnapshots(state, keys);\n this.addFromMutableState(state.mutableState, keys);\n return keys;\n }\n\n private addFromOutputsByNode(outputsByNode: PersistedRunState[\"outputsByNode\"], keys: Set<string>): void {\n for (const outputs of Object.values(outputsByNode)) {\n for (const items of Object.values(outputs)) {\n this.addFromItems(items, keys);\n }\n }\n }\n\n private addFromNodeSnapshots(state: PersistedRunState, keys: Set<string>): void {\n for (const snapshot of Object.values(state.nodeSnapshotsByNodeId)) {\n this.addFromPortMap(snapshot.inputsByPort, keys);\n this.addFromPortMap(snapshot.outputs, keys);\n }\n }\n\n private addFromMutableState(mutableState: PersistedRunState[\"mutableState\"], keys: Set<string>): void {\n for (const nodeState of Object.values(mutableState?.nodesById ?? {})) {\n this.addFromPortMap(nodeState.pinnedOutputsByPort, keys);\n this.addFromItems(nodeState.lastDebugInput, keys);\n }\n }\n\n private addFromPortMap(itemMap: Readonly<Partial<Record<string, Items>>> | undefined, keys: Set<string>): void {\n for (const items of Object.values(itemMap ?? {})) {\n this.addFromItems(items, keys);\n }\n }\n\n private addFromItems(items: Items | undefined, keys: Set<string>): void {\n for (const item of items ?? []) {\n for (const attachment of Object.values(item.binary ?? {})) {\n this.addAttachment(attachment, keys);\n }\n }\n }\n\n private addAttachment(attachment: BinaryAttachment, keys: Set<string>): void {\n if (attachment.storageKey.length > 0) {\n keys.add(attachment.storageKey);\n }\n }\n}\n","import type { BinaryStorage, Clock, RunId, WorkflowId } from \"@codemation/core\";\nimport { CoreTokens, RunFinishedAtFactory } from \"@codemation/core\";\nimport { inject, injectable } from \"@codemation/core\";\nimport type { Logger } from \"../logging/Logger\";\nimport { RunStateBinaryStorageKeysCollector } from \"../binary/RunStateBinaryStorageKeysCollector\";\nimport { ApplicationTokens } from \"../../applicationTokens\";\nimport type { AppConfig } from \"../../presentation/config/AppConfig\";\nimport type { WorkflowRunRepository } from \"../../domain/runs/WorkflowRunRepository\";\nimport { ServerLoggerFactory } from \"../../infrastructure/logging/ServerLoggerFactory\";\n\n/**\n * Periodically deletes terminal workflow runs whose age exceeds the effective retention\n * (`policySnapshot.retentionSeconds` or `CODEMATION_RUN_RETENTION_DEFAULT_SECONDS`),\n * and removes binary blobs referenced from run state via {@link BinaryStorage}.\n */\n@injectable()\nexport class WorkflowRunRetentionPruneScheduler {\n private timer: ReturnType<typeof setInterval> | undefined;\n private readonly logger: Logger;\n private readonly binaryKeysCollector = new RunStateBinaryStorageKeysCollector();\n\n constructor(\n @inject(ApplicationTokens.Clock) private readonly clock: Clock,\n @inject(ApplicationTokens.WorkflowRunRepository) private readonly runs: WorkflowRunRepository,\n @inject(CoreTokens.BinaryStorage) private readonly binaryStorage: BinaryStorage,\n @inject(ApplicationTokens.AppConfig) private readonly appConfig: AppConfig,\n @inject(ServerLoggerFactory) loggerFactory: ServerLoggerFactory,\n ) {\n this.logger = loggerFactory.create(\"codemation.runRetentionPrune\");\n }\n\n start(): void {\n if (this.appConfig.env.CODEMATION_RUN_PRUNE_ENABLED === \"false\") {\n return;\n }\n if (this.timer) {\n return;\n }\n const intervalMs = Number(this.appConfig.env.CODEMATION_RUN_PRUNE_INTERVAL_MS ?? 60_000);\n this.timer = setInterval(() => {\n void this.runOnce().catch((error: unknown) => {\n this.logger.warn(`Run retention prune tick failed: ${error instanceof Error ? error.message : String(error)}`);\n });\n }, intervalMs);\n }\n\n stop(): void {\n if (this.timer) {\n clearInterval(this.timer);\n this.timer = undefined;\n }\n }\n\n /** Exposed for tests; production path is the interval started by {@link start}. */\n async runOnce(): Promise<void> {\n this.logger.debug(\"Run retention prune: starting check\");\n\n const defaultRetentionSec = Number(this.appConfig.env.CODEMATION_RUN_RETENTION_DEFAULT_SECONDS ?? 86_400);\n const summaries = await this.runs.listRuns({ limit: 500 });\n const nowMs = this.clock.now().getTime();\n\n let foundCount = 0;\n let prunedCount = 0;\n for (const s of summaries) {\n if (s.status !== \"completed\" && s.status !== \"failed\") {\n continue;\n }\n const state = await this.runs.load(s.runId);\n if (!state) {\n continue;\n }\n const retentionSec = state.policySnapshot?.retentionSeconds ?? defaultRetentionSec;\n const finishedAt = RunFinishedAtFactory.resolveIso(state) ?? s.finishedAt;\n if (!finishedAt) {\n continue;\n }\n const ageMs = nowMs - Date.parse(finishedAt);\n if (ageMs <= retentionSec * 1000) {\n continue;\n }\n\n const runId = s.runId as RunId;\n const workflowId = s.workflowId as WorkflowId;\n foundCount += 1;\n\n const storageKeys = this.binaryKeysCollector.collectFromRunState(state);\n for (const key of storageKeys) {\n await this.binaryStorage.delete(key);\n }\n await this.runs.deleteRun(runId);\n prunedCount += 1;\n this.logger.debug(`Run retention prune: pruned run ${runId} for workflow ${workflowId}`);\n }\n\n this.logger.info(`Run retention prune: found ${foundCount} run(s) to prune`);\n this.logger.info(`Run retention prune: pruned ${prunedCount} run(s)`);\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;AAMA,IAAa,qCAAb,MAAgD;CAC9C,oBAAoB,OAA+C;EACjE,MAAM,uBAAO,IAAI,KAAa;AAC9B,OAAK,qBAAqB,MAAM,eAAe,KAAK;AACpD,OAAK,qBAAqB,OAAO,KAAK;AACtC,OAAK,oBAAoB,MAAM,cAAc,KAAK;AAClD,SAAO;;CAGT,AAAQ,qBAAqB,eAAmD,MAAyB;AACvG,OAAK,MAAM,WAAW,OAAO,OAAO,cAAc,CAChD,MAAK,MAAM,SAAS,OAAO,OAAO,QAAQ,CACxC,MAAK,aAAa,OAAO,KAAK;;CAKpC,AAAQ,qBAAqB,OAA0B,MAAyB;AAC9E,OAAK,MAAM,YAAY,OAAO,OAAO,MAAM,sBAAsB,EAAE;AACjE,QAAK,eAAe,SAAS,cAAc,KAAK;AAChD,QAAK,eAAe,SAAS,SAAS,KAAK;;;CAI/C,AAAQ,oBAAoB,cAAiD,MAAyB;AACpG,OAAK,MAAM,aAAa,OAAO,OAAO,cAAc,aAAa,EAAE,CAAC,EAAE;AACpE,QAAK,eAAe,UAAU,qBAAqB,KAAK;AACxD,QAAK,aAAa,UAAU,gBAAgB,KAAK;;;CAIrD,AAAQ,eAAe,SAA+D,MAAyB;AAC7G,OAAK,MAAM,SAAS,OAAO,OAAO,WAAW,EAAE,CAAC,CAC9C,MAAK,aAAa,OAAO,KAAK;;CAIlC,AAAQ,aAAa,OAA0B,MAAyB;AACtE,OAAK,MAAM,QAAQ,SAAS,EAAE,CAC5B,MAAK,MAAM,cAAc,OAAO,OAAO,KAAK,UAAU,EAAE,CAAC,CACvD,MAAK,cAAc,YAAY,KAAK;;CAK1C,AAAQ,cAAc,YAA8B,MAAyB;AAC3E,MAAI,WAAW,WAAW,SAAS,EACjC,MAAK,IAAI,WAAW,WAAW;;;;;;;ACrC9B,+CAAMA,qCAAmC;CAC9C,AAAQ;CACR,AAAiB;CACjB,AAAiB,sBAAsB,IAAI,oCAAoC;CAE/E,YACE,AAAkDC,OAClD,AAAkEC,MAClE,AAAmDC,eACnD,AAAsDC,WACtD,AAA6BC,eAC7B;EALkD;EACgB;EACf;EACG;AAGtD,OAAK,SAAS,cAAc,OAAO,+BAA+B;;CAGpE,QAAc;AACZ,MAAI,KAAK,UAAU,IAAI,iCAAiC,QACtD;AAEF,MAAI,KAAK,MACP;EAEF,MAAM,aAAa,OAAO,KAAK,UAAU,IAAI,oCAAoC,IAAO;AACxF,OAAK,QAAQ,kBAAkB;AAC7B,GAAK,KAAK,SAAS,CAAC,OAAO,UAAmB;AAC5C,SAAK,OAAO,KAAK,oCAAoC,iBAAiB,QAAQ,MAAM,UAAU,OAAO,MAAM,GAAG;KAC9G;KACD,WAAW;;CAGhB,OAAa;AACX,MAAI,KAAK,OAAO;AACd,iBAAc,KAAK,MAAM;AACzB,QAAK,QAAQ;;;;CAKjB,MAAM,UAAyB;AAC7B,OAAK,OAAO,MAAM,sCAAsC;EAExD,MAAM,sBAAsB,OAAO,KAAK,UAAU,IAAI,4CAA4C,MAAO;EACzG,MAAM,YAAY,MAAM,KAAK,KAAK,SAAS,EAAE,OAAO,KAAK,CAAC;EAC1D,MAAM,QAAQ,KAAK,MAAM,KAAK,CAAC,SAAS;EAExC,IAAI,aAAa;EACjB,IAAI,cAAc;AAClB,OAAK,MAAM,KAAK,WAAW;AACzB,OAAI,EAAE,WAAW,eAAe,EAAE,WAAW,SAC3C;GAEF,MAAM,QAAQ,MAAM,KAAK,KAAK,KAAK,EAAE,MAAM;AAC3C,OAAI,CAAC,MACH;GAEF,MAAM,eAAe,MAAM,gBAAgB,oBAAoB;GAC/D,MAAM,aAAa,qBAAqB,WAAW,MAAM,IAAI,EAAE;AAC/D,OAAI,CAAC,WACH;AAGF,OADc,QAAQ,KAAK,MAAM,WAAW,IAC/B,eAAe,IAC1B;GAGF,MAAM,QAAQ,EAAE;GAChB,MAAM,aAAa,EAAE;AACrB,iBAAc;GAEd,MAAM,cAAc,KAAK,oBAAoB,oBAAoB,MAAM;AACvE,QAAK,MAAM,OAAO,YAChB,OAAM,KAAK,cAAc,OAAO,IAAI;AAEtC,SAAM,KAAK,KAAK,UAAU,MAAM;AAChC,kBAAe;AACf,QAAK,OAAO,MAAM,mCAAmC,MAAM,gBAAgB,aAAa;;AAG1F,OAAK,OAAO,KAAK,8BAA8B,WAAW,kBAAkB;AAC5E,OAAK,OAAO,KAAK,+BAA+B,YAAY,SAAS;;;;CAhFxE,YAAY;oBAOR,OAAO,kBAAkB,MAAM;oBAC/B,OAAO,kBAAkB,sBAAsB;oBAC/C,OAAO,WAAW,cAAc;oBAChC,OAAO,kBAAkB,UAAU;oBACnC,OAAO,oBAAoB"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { r as ResolvedDatabasePersistence, t as PrismaClient } from "./client-Yh7-CQud.js";
|
|
2
|
+
|
|
3
|
+
//#region src/infrastructure/persistence/CodemationPostgresPrismaClientFactory.d.ts
|
|
4
|
+
declare class CodemationPostgresPrismaClientFactory {
|
|
5
|
+
static create(databaseUrl: string): PrismaClient;
|
|
6
|
+
}
|
|
7
|
+
//#endregion
|
|
8
|
+
//#region src/infrastructure/persistence/PrismaMigrationDeployer.d.ts
|
|
9
|
+
/**
|
|
10
|
+
* Runs `prisma migrate deploy` against TCP PostgreSQL or against a PGlite data directory
|
|
11
|
+
* by temporarily exposing PGlite on a local Postgres protocol socket (see `@electric-sql/pglite-socket`).
|
|
12
|
+
*/
|
|
13
|
+
declare class PrismaMigrationDeployer {
|
|
14
|
+
private readonly require;
|
|
15
|
+
deployPersistence(persistence: ResolvedDatabasePersistence, env?: Readonly<NodeJS.ProcessEnv>): Promise<void>;
|
|
16
|
+
deploy(args: Readonly<{
|
|
17
|
+
databaseUrl: string;
|
|
18
|
+
env?: Readonly<NodeJS.ProcessEnv>;
|
|
19
|
+
}>): Promise<void>;
|
|
20
|
+
private deployPgliteViaPrismaCli;
|
|
21
|
+
private deployPostgres;
|
|
22
|
+
/**
|
|
23
|
+
* {@link PGLiteSocketServer.getServerConn} returns `host:port` or a unix socket path — Prisma requires a `postgresql://` URL.
|
|
24
|
+
* The query engine expects `sslmode=disable` on this loopback socket and a user (PGlite accepts `postgres`).
|
|
25
|
+
*/
|
|
26
|
+
private pgliteSocketConnectionToPostgresUrl;
|
|
27
|
+
private createProcessEnvironment;
|
|
28
|
+
private resolvePrismaCliPath;
|
|
29
|
+
private resolvePrismaConfigPath;
|
|
30
|
+
resolvePackageRoot(): string;
|
|
31
|
+
private createPgliteOpenFailureError;
|
|
32
|
+
private createDeployError;
|
|
33
|
+
}
|
|
34
|
+
//#endregion
|
|
35
|
+
export { CodemationPostgresPrismaClientFactory as n, PrismaMigrationDeployer as t };
|
|
36
|
+
//# sourceMappingURL=persistenceServer-K5eqlZm3.d.ts.map
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { i as __toESM } from "./chunk-7V6ThxGB.js";
|
|
2
|
+
import { r as require_client } from "./PrismaMigrationDeployer-B1E_gYz7.js";
|
|
3
|
+
import { PrismaPg } from "@prisma/adapter-pg";
|
|
4
|
+
|
|
5
|
+
//#region src/infrastructure/persistence/CodemationPostgresPrismaClientFactory.ts
|
|
6
|
+
var import_client$1 = /* @__PURE__ */ __toESM(require_client(), 1);
|
|
7
|
+
var CodemationPostgresPrismaClientFactory = class {
|
|
8
|
+
static create(databaseUrl) {
|
|
9
|
+
return new import_client$1.PrismaClient({ adapter: new PrismaPg({ connectionString: databaseUrl }) });
|
|
10
|
+
}
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
//#endregion
|
|
14
|
+
//#region src/persistenceServer.ts
|
|
15
|
+
var import_client = /* @__PURE__ */ __toESM(require_client(), 1);
|
|
16
|
+
|
|
17
|
+
//#endregion
|
|
18
|
+
export { CodemationPostgresPrismaClientFactory as n, import_client as t };
|
|
19
|
+
//# sourceMappingURL=persistenceServer-W9uRw0dJ.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"persistenceServer-W9uRw0dJ.js","names":["PrismaClient"],"sources":["../src/infrastructure/persistence/CodemationPostgresPrismaClientFactory.ts","../src/persistenceServer.ts"],"sourcesContent":["import { PrismaPg } from \"@prisma/adapter-pg\";\nimport { PrismaClient } from \"./generated/prisma-client/client.js\";\n\nexport class CodemationPostgresPrismaClientFactory {\n static create(databaseUrl: string): PrismaClient {\n const adapter = new PrismaPg({ connectionString: databaseUrl });\n return new PrismaClient({ adapter });\n }\n}\n","export { CodemationPostgresPrismaClientFactory } from \"./infrastructure/persistence/CodemationPostgresPrismaClientFactory\";\nexport { DatabasePersistenceResolver } from \"./infrastructure/persistence/DatabasePersistenceResolver\";\nexport type { ResolvedDatabasePersistence } from \"./infrastructure/persistence/DatabasePersistenceResolver\";\nexport { PrismaMigrationDeployer } from \"./infrastructure/persistence/PrismaMigrationDeployer\";\nexport { PrismaClient } from \"./infrastructure/persistence/generated/prisma-client/client.js\";\n"],"mappings":";;;;;;AAGA,IAAa,wCAAb,MAAmD;CACjD,OAAO,OAAO,aAAmC;AAE/C,SAAO,IAAIA,6BAAa,EAAE,SADV,IAAI,SAAS,EAAE,kBAAkB,aAAa,CAAC,EAC5B,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import "./CodemationWhitelabelConfig-DgbjgtrR.js";
|
|
2
|
+
import "./index-Bs4F1IsC.js";
|
|
3
|
+
import "./CodemationConfig-XCkSV2dj.js";
|
|
4
|
+
import { n as DatabasePersistenceResolver, r as ResolvedDatabasePersistence, t as PrismaClient } from "./client-Yh7-CQud.js";
|
|
5
|
+
import { n as CodemationPostgresPrismaClientFactory, t as PrismaMigrationDeployer } from "./persistenceServer-K5eqlZm3.js";
|
|
6
|
+
export { CodemationPostgresPrismaClientFactory, DatabasePersistenceResolver, PrismaClient, PrismaMigrationDeployer, ResolvedDatabasePersistence };
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import "./decorate-B-N_5S4p.js";
|
|
2
|
+
import { n as DatabasePersistenceResolver, t as PrismaMigrationDeployer } from "./PrismaMigrationDeployer-B1E_gYz7.js";
|
|
3
|
+
import { n as CodemationPostgresPrismaClientFactory, t as import_client } from "./persistenceServer-W9uRw0dJ.js";
|
|
4
|
+
|
|
5
|
+
var PrismaClient = import_client.PrismaClient;
|
|
6
|
+
export { CodemationPostgresPrismaClientFactory, DatabasePersistenceResolver, PrismaClient, PrismaMigrationDeployer };
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
import { a as CodemationConfig, m as CodemationPlugin } from "./CodemationConfig-XCkSV2dj.js";
|
|
2
|
+
import { n as WorkflowSummary, t as WorkflowDto } from "./WorkflowViewContracts-DCLpTn25.js";
|
|
3
|
+
|
|
4
|
+
//#region src/presentation/config/CodemationPackageManifest.d.ts
|
|
5
|
+
interface CodemationPluginPackageManifest {
|
|
6
|
+
readonly kind: "plugin";
|
|
7
|
+
readonly entry: string;
|
|
8
|
+
readonly exportName?: string;
|
|
9
|
+
}
|
|
10
|
+
interface CodemationPackageManifest {
|
|
11
|
+
readonly plugin?: CodemationPluginPackageManifest;
|
|
12
|
+
}
|
|
13
|
+
//#endregion
|
|
14
|
+
//#region src/presentation/http/ApiPaths.d.ts
|
|
15
|
+
declare class ApiPaths {
|
|
16
|
+
private static readonly apiBasePath;
|
|
17
|
+
private static readonly workflowsBasePath;
|
|
18
|
+
private static readonly runsBasePath;
|
|
19
|
+
private static readonly credentialsBasePath;
|
|
20
|
+
private static readonly oauth2BasePath;
|
|
21
|
+
private static readonly webhooksBasePath;
|
|
22
|
+
private static readonly usersBasePath;
|
|
23
|
+
private static readonly whitelabelBasePath;
|
|
24
|
+
static workflows(): string;
|
|
25
|
+
static workflow(workflowId: string): string;
|
|
26
|
+
static workflowActivation(workflowId: string): string;
|
|
27
|
+
static workflowRuns(workflowId: string): string;
|
|
28
|
+
static workflowCredentialHealth(workflowId: string): string;
|
|
29
|
+
static workflowDebuggerOverlay(workflowId: string): string;
|
|
30
|
+
static workflowDebuggerOverlayCopyRun(workflowId: string): string;
|
|
31
|
+
static workflowDebuggerOverlayBinaryUpload(workflowId: string): string;
|
|
32
|
+
static workflowOverlayBinaryContent(workflowId: string, binaryId: string): string;
|
|
33
|
+
static runs(): string;
|
|
34
|
+
static run(): string;
|
|
35
|
+
static credentialTypes(): string;
|
|
36
|
+
static credentialsEnvStatus(): string;
|
|
37
|
+
static credentialInstances(): string;
|
|
38
|
+
static credentialInstance(instanceId: string, withSecrets?: boolean): string;
|
|
39
|
+
static credentialInstanceTest(instanceId: string): string;
|
|
40
|
+
static credentialBindings(): string;
|
|
41
|
+
static oauth2Auth(instanceId: string): string;
|
|
42
|
+
static oauth2RedirectUri(): string;
|
|
43
|
+
static oauth2Disconnect(instanceId: string): string;
|
|
44
|
+
static workflowWebsocket(): string;
|
|
45
|
+
/** Dev gateway: stable browser WebSocket for build lifecycle (CLI → gateway → browser). */
|
|
46
|
+
static devGatewaySocket(): string;
|
|
47
|
+
/** Dev gateway: HTTP notify endpoint used by the Codemation CLI during consumer rebuilds. */
|
|
48
|
+
static devGatewayNotify(): string;
|
|
49
|
+
static webhooks(): string;
|
|
50
|
+
static users(): string;
|
|
51
|
+
static userInviteVerify(): string;
|
|
52
|
+
static userInviteAccept(): string;
|
|
53
|
+
static userInvites(): string;
|
|
54
|
+
static userInviteRegenerate(userId: string): string;
|
|
55
|
+
static userStatus(userId: string): string;
|
|
56
|
+
static runState(runId: string): string;
|
|
57
|
+
static runWorkflowSnapshot(runId: string): string;
|
|
58
|
+
static runNodePin(runId: string, nodeId: string): string;
|
|
59
|
+
static runNode(runId: string, nodeId: string): string;
|
|
60
|
+
static runBinaryContent(runId: string, binaryId: string): string;
|
|
61
|
+
/** Anonymous: consumer logo from `codemation.config.ts` whitelabel.logoPath. */
|
|
62
|
+
static whitelabelLogo(): string;
|
|
63
|
+
}
|
|
64
|
+
//#endregion
|
|
65
|
+
//#region src/presentation/http/CodemationServerGatewayFactory.d.ts
|
|
66
|
+
declare class CodemationServerGateway {
|
|
67
|
+
private readonly config;
|
|
68
|
+
private readonly consumerRoot;
|
|
69
|
+
private readonly configSource?;
|
|
70
|
+
private readonly workflowSources;
|
|
71
|
+
private readonly env?;
|
|
72
|
+
private static readonly contextsByConfig;
|
|
73
|
+
constructor(config: CodemationConfig, consumerRoot: string, configSource?: string | undefined, workflowSources?: ReadonlyArray<string>, env?: Readonly<NodeJS.ProcessEnv> | undefined);
|
|
74
|
+
dispatch(request: Request): Promise<Response>;
|
|
75
|
+
prepare(): Promise<void>;
|
|
76
|
+
close(): Promise<void>;
|
|
77
|
+
loadWorkflowSummaries(): Promise<ReadonlyArray<WorkflowSummary>>;
|
|
78
|
+
loadWorkflowDetail(workflowId: string): Promise<WorkflowDto>;
|
|
79
|
+
private getContext;
|
|
80
|
+
private createContext;
|
|
81
|
+
private resolveWorkflowSources;
|
|
82
|
+
private detectWorkspaceRoot;
|
|
83
|
+
}
|
|
84
|
+
//#endregion
|
|
85
|
+
//#region src/presentation/server/CodemationPluginDiscovery.d.ts
|
|
86
|
+
type CodemationDiscoveredPluginPackage = Readonly<{
|
|
87
|
+
packageName: string;
|
|
88
|
+
packageRoot: string;
|
|
89
|
+
manifest: NonNullable<CodemationPackageManifest["plugin"]>;
|
|
90
|
+
developmentEntry?: string;
|
|
91
|
+
}>;
|
|
92
|
+
type CodemationResolvedPluginPackage = Readonly<CodemationDiscoveredPluginPackage & {
|
|
93
|
+
plugin: CodemationPlugin;
|
|
94
|
+
}>;
|
|
95
|
+
declare class CodemationPluginDiscovery {
|
|
96
|
+
discover(consumerRoot: string): Promise<ReadonlyArray<CodemationDiscoveredPluginPackage>>;
|
|
97
|
+
resolvePlugins(consumerRoot: string): Promise<ReadonlyArray<CodemationResolvedPluginPackage>>;
|
|
98
|
+
resolveDiscoveredPackages(discoveredPackages: ReadonlyArray<CodemationDiscoveredPluginPackage>): Promise<ReadonlyArray<CodemationResolvedPluginPackage>>;
|
|
99
|
+
private collectPackageRoots;
|
|
100
|
+
private readPackageJson;
|
|
101
|
+
private loadPlugin;
|
|
102
|
+
private resolvePluginValue;
|
|
103
|
+
private isPlugin;
|
|
104
|
+
private isPluginConstructor;
|
|
105
|
+
private resolvePluginEntry;
|
|
106
|
+
private resolveDevelopmentPluginEntry;
|
|
107
|
+
}
|
|
108
|
+
//#endregion
|
|
109
|
+
//#region src/presentation/server/WorkflowModulePathFinder.d.ts
|
|
110
|
+
declare class WorkflowModulePathFinder {
|
|
111
|
+
static readonly defaultWorkflowDirectories: readonly ["src/workflows", "workflows"];
|
|
112
|
+
private readonly workflowExtensions;
|
|
113
|
+
discoverModulePaths(args: Readonly<{
|
|
114
|
+
consumerRoot: string;
|
|
115
|
+
workflowDirectories: ReadonlyArray<string> | undefined;
|
|
116
|
+
exists: (absolutePath: string) => Promise<boolean>;
|
|
117
|
+
}>): Promise<ReadonlyArray<string>>;
|
|
118
|
+
private collectWorkflowModulePaths;
|
|
119
|
+
private isWorkflowModulePath;
|
|
120
|
+
}
|
|
121
|
+
//#endregion
|
|
122
|
+
//#region src/presentation/server/WorkflowDiscoveryPathSegmentsComputer.d.ts
|
|
123
|
+
declare class WorkflowDiscoveryPathSegmentsComputer {
|
|
124
|
+
compute(args: Readonly<{
|
|
125
|
+
consumerRoot: string;
|
|
126
|
+
workflowDiscoveryDirectories: ReadonlyArray<string>;
|
|
127
|
+
absoluteWorkflowModulePath: string;
|
|
128
|
+
}>): readonly string[] | undefined;
|
|
129
|
+
}
|
|
130
|
+
//#endregion
|
|
131
|
+
export { CodemationResolvedPluginPackage as a, CodemationPackageManifest as c, CodemationPluginDiscovery as i, CodemationPluginPackageManifest as l, WorkflowModulePathFinder as n, CodemationServerGateway as o, CodemationDiscoveredPluginPackage as r, ApiPaths as s, WorkflowDiscoveryPathSegmentsComputer as t };
|
|
132
|
+
//# sourceMappingURL=server-BBdsATju.d.ts.map
|