@contember/engine-actions 2.1.0-beta.1 → 2.2.0-alpha.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/dist/development/index.cjs +10 -4
- package/dist/development/index.cjs.map +1 -1
- package/dist/development/index.js +10 -4
- package/dist/development/index.js.map +1 -1
- package/dist/development/src/ActionsExecutionContainerHookFactory.cjs +3 -2
- package/dist/development/src/ActionsExecutionContainerHookFactory.cjs.map +1 -1
- package/dist/development/src/ActionsExecutionContainerHookFactory.js +3 -2
- package/dist/development/src/ActionsExecutionContainerHookFactory.js.map +1 -1
- package/dist/development/src/ListenerStoreProvider.cjs.map +1 -1
- package/dist/development/src/ListenerStoreProvider.js.map +1 -1
- package/dist/development/src/authorization/ActionsPermissionsFactory.cjs.map +1 -1
- package/dist/development/src/authorization/ActionsPermissionsFactory.js.map +1 -1
- package/dist/development/src/dispatch/DispatchWorkerSupervisor.cjs.map +1 -1
- package/dist/development/src/dispatch/DispatchWorkerSupervisor.js.map +1 -1
- package/dist/development/src/dispatch/EventDispatcher.cjs.map +1 -1
- package/dist/development/src/dispatch/EventDispatcher.js.map +1 -1
- package/dist/development/src/dispatch/EventsRepository.cjs.map +1 -1
- package/dist/development/src/dispatch/EventsRepository.js.map +1 -1
- package/dist/development/src/dispatch/LazyDispatchWorker.cjs +67 -0
- package/dist/development/src/dispatch/LazyDispatchWorker.cjs.map +1 -0
- package/dist/development/src/dispatch/LazyDispatchWorker.js +67 -0
- package/dist/development/src/dispatch/LazyDispatchWorker.js.map +1 -0
- package/dist/development/src/dispatch/ProjectDispatcher.cjs.map +1 -1
- package/dist/development/src/dispatch/ProjectDispatcher.js.map +1 -1
- package/dist/development/src/dispatch/TargetHandlerResolver.cjs.map +1 -1
- package/dist/development/src/dispatch/TargetHandlerResolver.js.map +1 -1
- package/dist/development/src/dispatch/WebhookTargetHandler.cjs.map +1 -1
- package/dist/development/src/dispatch/WebhookTargetHandler.js.map +1 -1
- package/dist/development/src/graphql/http/ActionsApiMiddlewareFactory.cjs.map +1 -1
- package/dist/development/src/graphql/http/ActionsApiMiddlewareFactory.js.map +1 -1
- package/dist/development/src/graphql/http/ActionsContextResolver.cjs.map +1 -1
- package/dist/development/src/graphql/http/ActionsContextResolver.js.map +1 -1
- package/dist/development/src/graphql/http/ActionsGraphQLHandlerFactory.cjs.map +1 -1
- package/dist/development/src/graphql/http/ActionsGraphQLHandlerFactory.js.map +1 -1
- package/dist/development/src/graphql/http/ActionsWebsocketControllerFactory.cjs.map +1 -1
- package/dist/development/src/graphql/http/ActionsWebsocketControllerFactory.js.map +1 -1
- package/dist/development/src/graphql/resolvers/ResolversFactory.cjs.map +1 -1
- package/dist/development/src/graphql/resolvers/ResolversFactory.js.map +1 -1
- package/dist/development/src/graphql/resolvers/mutation/ProcessBatchMutationResolver.cjs.map +1 -1
- package/dist/development/src/graphql/resolvers/mutation/ProcessBatchMutationResolver.js.map +1 -1
- package/dist/development/src/graphql/resolvers/mutation/RetryEventMutationResolver.cjs.map +1 -1
- package/dist/development/src/graphql/resolvers/mutation/RetryEventMutationResolver.js.map +1 -1
- package/dist/development/src/graphql/resolvers/mutation/SetVariablesMutationResolver.cjs.map +1 -1
- package/dist/development/src/graphql/resolvers/mutation/SetVariablesMutationResolver.js.map +1 -1
- package/dist/development/src/graphql/resolvers/mutation/StopEventMutationResolver.cjs.map +1 -1
- package/dist/development/src/graphql/resolvers/mutation/StopEventMutationResolver.js.map +1 -1
- package/dist/development/src/graphql/resolvers/query/EventsQueryResolver.cjs.map +1 -1
- package/dist/development/src/graphql/resolvers/query/EventsQueryResolver.js.map +1 -1
- package/dist/development/src/graphql/resolvers/query/VariablesQueryResolver.cjs.map +1 -1
- package/dist/development/src/graphql/resolvers/query/VariablesQueryResolver.js.map +1 -1
- package/dist/development/src/migrations/index.cjs.map +1 -1
- package/dist/development/src/migrations/index.js.map +1 -1
- package/dist/development/src/model/EventByIdQuery.cjs.map +1 -1
- package/dist/development/src/model/EventByIdQuery.js.map +1 -1
- package/dist/development/src/model/EventsInProcessingQuery.cjs.map +1 -1
- package/dist/development/src/model/EventsInProcessingQuery.js.map +1 -1
- package/dist/development/src/model/EventsToProcessQuery.cjs.map +1 -1
- package/dist/development/src/model/EventsToProcessQuery.js.map +1 -1
- package/dist/development/src/model/FailedEventsQuery.cjs.map +1 -1
- package/dist/development/src/model/FailedEventsQuery.js.map +1 -1
- package/dist/development/src/model/VariablesManager.cjs.map +1 -1
- package/dist/development/src/model/VariablesManager.js.map +1 -1
- package/dist/development/src/triggers/TriggerHandler.cjs.map +1 -1
- package/dist/development/src/triggers/TriggerHandler.js.map +1 -1
- package/dist/development/src/triggers/TriggerIndirectChangesFetcher.cjs.map +1 -1
- package/dist/development/src/triggers/TriggerIndirectChangesFetcher.js.map +1 -1
- package/dist/development/src/triggers/TriggerListenersBuilder.cjs.map +1 -1
- package/dist/development/src/triggers/TriggerListenersBuilder.js.map +1 -1
- package/dist/development/src/triggers/TriggerListenersFactory.cjs.map +1 -1
- package/dist/development/src/triggers/TriggerListenersFactory.js.map +1 -1
- package/dist/development/src/triggers/TriggerListenersStore.cjs.map +1 -1
- package/dist/development/src/triggers/TriggerListenersStore.js.map +1 -1
- package/dist/development/src/triggers/TriggerPayloadBuilder.cjs.map +1 -1
- package/dist/development/src/triggers/TriggerPayloadBuilder.js.map +1 -1
- package/dist/development/src/triggers/TriggerPayloadManager.cjs.map +1 -1
- package/dist/development/src/triggers/TriggerPayloadManager.js.map +1 -1
- package/dist/development/src/triggers/TriggerPayloadPersister.cjs +32 -20
- package/dist/development/src/triggers/TriggerPayloadPersister.cjs.map +1 -1
- package/dist/development/src/triggers/TriggerPayloadPersister.js +32 -20
- package/dist/development/src/triggers/TriggerPayloadPersister.js.map +1 -1
- package/dist/production/index.cjs +10 -4
- package/dist/production/index.cjs.map +1 -1
- package/dist/production/index.js +10 -4
- package/dist/production/index.js.map +1 -1
- package/dist/production/src/ActionsExecutionContainerHookFactory.cjs +3 -2
- package/dist/production/src/ActionsExecutionContainerHookFactory.cjs.map +1 -1
- package/dist/production/src/ActionsExecutionContainerHookFactory.js +3 -2
- package/dist/production/src/ActionsExecutionContainerHookFactory.js.map +1 -1
- package/dist/production/src/ListenerStoreProvider.cjs.map +1 -1
- package/dist/production/src/ListenerStoreProvider.js.map +1 -1
- package/dist/production/src/authorization/ActionsPermissionsFactory.cjs.map +1 -1
- package/dist/production/src/authorization/ActionsPermissionsFactory.js.map +1 -1
- package/dist/production/src/dispatch/DispatchWorkerSupervisor.cjs.map +1 -1
- package/dist/production/src/dispatch/DispatchWorkerSupervisor.js.map +1 -1
- package/dist/production/src/dispatch/EventDispatcher.cjs.map +1 -1
- package/dist/production/src/dispatch/EventDispatcher.js.map +1 -1
- package/dist/production/src/dispatch/EventsRepository.cjs.map +1 -1
- package/dist/production/src/dispatch/EventsRepository.js.map +1 -1
- package/dist/production/src/dispatch/LazyDispatchWorker.cjs +67 -0
- package/dist/production/src/dispatch/LazyDispatchWorker.cjs.map +1 -0
- package/dist/production/src/dispatch/LazyDispatchWorker.js +67 -0
- package/dist/production/src/dispatch/LazyDispatchWorker.js.map +1 -0
- package/dist/production/src/dispatch/ProjectDispatcher.cjs.map +1 -1
- package/dist/production/src/dispatch/ProjectDispatcher.js.map +1 -1
- package/dist/production/src/dispatch/TargetHandlerResolver.cjs.map +1 -1
- package/dist/production/src/dispatch/TargetHandlerResolver.js.map +1 -1
- package/dist/production/src/dispatch/WebhookTargetHandler.cjs.map +1 -1
- package/dist/production/src/dispatch/WebhookTargetHandler.js.map +1 -1
- package/dist/production/src/graphql/http/ActionsApiMiddlewareFactory.cjs.map +1 -1
- package/dist/production/src/graphql/http/ActionsApiMiddlewareFactory.js.map +1 -1
- package/dist/production/src/graphql/http/ActionsContextResolver.cjs.map +1 -1
- package/dist/production/src/graphql/http/ActionsContextResolver.js.map +1 -1
- package/dist/production/src/graphql/http/ActionsGraphQLHandlerFactory.cjs.map +1 -1
- package/dist/production/src/graphql/http/ActionsGraphQLHandlerFactory.js.map +1 -1
- package/dist/production/src/graphql/http/ActionsWebsocketControllerFactory.cjs.map +1 -1
- package/dist/production/src/graphql/http/ActionsWebsocketControllerFactory.js.map +1 -1
- package/dist/production/src/graphql/resolvers/ResolversFactory.cjs.map +1 -1
- package/dist/production/src/graphql/resolvers/ResolversFactory.js.map +1 -1
- package/dist/production/src/graphql/resolvers/mutation/ProcessBatchMutationResolver.cjs.map +1 -1
- package/dist/production/src/graphql/resolvers/mutation/ProcessBatchMutationResolver.js.map +1 -1
- package/dist/production/src/graphql/resolvers/mutation/RetryEventMutationResolver.cjs.map +1 -1
- package/dist/production/src/graphql/resolvers/mutation/RetryEventMutationResolver.js.map +1 -1
- package/dist/production/src/graphql/resolvers/mutation/SetVariablesMutationResolver.cjs.map +1 -1
- package/dist/production/src/graphql/resolvers/mutation/SetVariablesMutationResolver.js.map +1 -1
- package/dist/production/src/graphql/resolvers/mutation/StopEventMutationResolver.cjs.map +1 -1
- package/dist/production/src/graphql/resolvers/mutation/StopEventMutationResolver.js.map +1 -1
- package/dist/production/src/graphql/resolvers/query/EventsQueryResolver.cjs.map +1 -1
- package/dist/production/src/graphql/resolvers/query/EventsQueryResolver.js.map +1 -1
- package/dist/production/src/graphql/resolvers/query/VariablesQueryResolver.cjs.map +1 -1
- package/dist/production/src/graphql/resolvers/query/VariablesQueryResolver.js.map +1 -1
- package/dist/production/src/migrations/index.cjs.map +1 -1
- package/dist/production/src/migrations/index.js.map +1 -1
- package/dist/production/src/model/EventByIdQuery.cjs.map +1 -1
- package/dist/production/src/model/EventByIdQuery.js.map +1 -1
- package/dist/production/src/model/EventsInProcessingQuery.cjs.map +1 -1
- package/dist/production/src/model/EventsInProcessingQuery.js.map +1 -1
- package/dist/production/src/model/EventsToProcessQuery.cjs.map +1 -1
- package/dist/production/src/model/EventsToProcessQuery.js.map +1 -1
- package/dist/production/src/model/FailedEventsQuery.cjs.map +1 -1
- package/dist/production/src/model/FailedEventsQuery.js.map +1 -1
- package/dist/production/src/model/VariablesManager.cjs.map +1 -1
- package/dist/production/src/model/VariablesManager.js.map +1 -1
- package/dist/production/src/triggers/TriggerHandler.cjs.map +1 -1
- package/dist/production/src/triggers/TriggerHandler.js.map +1 -1
- package/dist/production/src/triggers/TriggerIndirectChangesFetcher.cjs.map +1 -1
- package/dist/production/src/triggers/TriggerIndirectChangesFetcher.js.map +1 -1
- package/dist/production/src/triggers/TriggerListenersBuilder.cjs.map +1 -1
- package/dist/production/src/triggers/TriggerListenersBuilder.js.map +1 -1
- package/dist/production/src/triggers/TriggerListenersFactory.cjs.map +1 -1
- package/dist/production/src/triggers/TriggerListenersFactory.js.map +1 -1
- package/dist/production/src/triggers/TriggerListenersStore.cjs.map +1 -1
- package/dist/production/src/triggers/TriggerListenersStore.js.map +1 -1
- package/dist/production/src/triggers/TriggerPayloadBuilder.cjs.map +1 -1
- package/dist/production/src/triggers/TriggerPayloadBuilder.js.map +1 -1
- package/dist/production/src/triggers/TriggerPayloadManager.cjs.map +1 -1
- package/dist/production/src/triggers/TriggerPayloadManager.js.map +1 -1
- package/dist/production/src/triggers/TriggerPayloadPersister.cjs +32 -20
- package/dist/production/src/triggers/TriggerPayloadPersister.cjs.map +1 -1
- package/dist/production/src/triggers/TriggerPayloadPersister.js +32 -20
- package/dist/production/src/triggers/TriggerPayloadPersister.js.map +1 -1
- package/dist/tests/cases/unit/lazyDispatchWorker.test.d.ts +2 -0
- package/dist/tests/cases/unit/lazyDispatchWorker.test.d.ts.map +1 -0
- package/dist/tests/tsconfig.tsbuildinfo +1 -1
- package/dist/types/ActionsExecutionContainerHookFactory.d.ts +1 -1
- package/dist/types/ActionsExecutionContainerHookFactory.d.ts.map +1 -1
- package/dist/types/ListenerStoreProvider.d.ts +1 -1
- package/dist/types/ListenerStoreProvider.d.ts.map +1 -1
- package/dist/types/authorization/index.d.ts +3 -3
- package/dist/types/authorization/index.d.ts.map +1 -1
- package/dist/types/dispatch/DispatchWorkerSupervisor.d.ts +1 -1
- package/dist/types/dispatch/DispatchWorkerSupervisor.d.ts.map +1 -1
- package/dist/types/dispatch/EventDispatcher.d.ts +3 -3
- package/dist/types/dispatch/EventDispatcher.d.ts.map +1 -1
- package/dist/types/dispatch/EventsRepository.d.ts +1 -1
- package/dist/types/dispatch/EventsRepository.d.ts.map +1 -1
- package/dist/types/dispatch/LazyDispatchWorker.d.ts +11 -0
- package/dist/types/dispatch/LazyDispatchWorker.d.ts.map +1 -0
- package/dist/types/dispatch/ProjectDispatcher.d.ts +1 -1
- package/dist/types/dispatch/ProjectDispatcher.d.ts.map +1 -1
- package/dist/types/dispatch/TargetHandlerResolver.d.ts +2 -2
- package/dist/types/dispatch/TargetHandlerResolver.d.ts.map +1 -1
- package/dist/types/dispatch/WebhookTargetHandler.d.ts +2 -2
- package/dist/types/dispatch/WebhookTargetHandler.d.ts.map +1 -1
- package/dist/types/dispatch/types.d.ts +2 -2
- package/dist/types/dispatch/types.d.ts.map +1 -1
- package/dist/types/graphql/http/ActionsApiMiddlewareFactory.d.ts +3 -3
- package/dist/types/graphql/http/ActionsApiMiddlewareFactory.d.ts.map +1 -1
- package/dist/types/graphql/http/ActionsContextResolver.d.ts +1 -1
- package/dist/types/graphql/http/ActionsContextResolver.d.ts.map +1 -1
- package/dist/types/graphql/http/ActionsGraphQLHandlerFactory.d.ts +2 -2
- package/dist/types/graphql/http/ActionsGraphQLHandlerFactory.d.ts.map +1 -1
- package/dist/types/graphql/http/ActionsWebsocketControllerFactory.d.ts +2 -2
- package/dist/types/graphql/http/ActionsWebsocketControllerFactory.d.ts.map +1 -1
- package/dist/types/graphql/resolvers/ResolversFactory.d.ts +4 -4
- package/dist/types/graphql/resolvers/ResolversFactory.d.ts.map +1 -1
- package/dist/types/graphql/resolvers/index.d.ts +2 -2
- package/dist/types/graphql/resolvers/index.d.ts.map +1 -1
- package/dist/types/graphql/resolvers/mutation/ProcessBatchMutationResolver.d.ts +3 -3
- package/dist/types/graphql/resolvers/mutation/ProcessBatchMutationResolver.d.ts.map +1 -1
- package/dist/types/graphql/resolvers/mutation/RetryEventMutationResolver.d.ts +3 -3
- package/dist/types/graphql/resolvers/mutation/RetryEventMutationResolver.d.ts.map +1 -1
- package/dist/types/graphql/resolvers/mutation/SetVariablesMutationResolver.d.ts +3 -3
- package/dist/types/graphql/resolvers/mutation/SetVariablesMutationResolver.d.ts.map +1 -1
- package/dist/types/graphql/resolvers/mutation/StopEventMutationResolver.d.ts +3 -3
- package/dist/types/graphql/resolvers/mutation/StopEventMutationResolver.d.ts.map +1 -1
- package/dist/types/graphql/resolvers/mutation/index.d.ts +4 -4
- package/dist/types/graphql/resolvers/mutation/index.d.ts.map +1 -1
- package/dist/types/graphql/resolvers/query/EventsQueryResolver.d.ts +2 -2
- package/dist/types/graphql/resolvers/query/EventsQueryResolver.d.ts.map +1 -1
- package/dist/types/graphql/resolvers/query/VariablesQueryResolver.d.ts +3 -3
- package/dist/types/graphql/resolvers/query/VariablesQueryResolver.d.ts.map +1 -1
- package/dist/types/graphql/resolvers/query/index.d.ts +1 -1
- package/dist/types/graphql/resolvers/query/index.d.ts.map +1 -1
- package/dist/types/index.d.ts +3 -3
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/model/EventByIdQuery.d.ts +1 -1
- package/dist/types/model/EventByIdQuery.d.ts.map +1 -1
- package/dist/types/model/EventsInProcessingQuery.d.ts +2 -2
- package/dist/types/model/EventsInProcessingQuery.d.ts.map +1 -1
- package/dist/types/model/EventsToProcessQuery.d.ts +2 -2
- package/dist/types/model/EventsToProcessQuery.d.ts.map +1 -1
- package/dist/types/model/FailedEventsQuery.d.ts +2 -2
- package/dist/types/model/FailedEventsQuery.d.ts.map +1 -1
- package/dist/types/model/VariablesManager.d.ts +1 -1
- package/dist/types/model/VariablesManager.d.ts.map +1 -1
- package/dist/types/triggers/TriggerHandler.d.ts +3 -3
- package/dist/types/triggers/TriggerHandler.d.ts.map +1 -1
- package/dist/types/triggers/TriggerIndirectChangesFetcher.d.ts +1 -1
- package/dist/types/triggers/TriggerIndirectChangesFetcher.d.ts.map +1 -1
- package/dist/types/triggers/TriggerListeners.d.ts +1 -1
- package/dist/types/triggers/TriggerListeners.d.ts.map +1 -1
- package/dist/types/triggers/TriggerListenersBuilder.d.ts +1 -1
- package/dist/types/triggers/TriggerListenersBuilder.d.ts.map +1 -1
- package/dist/types/triggers/TriggerListenersFactory.d.ts +1 -1
- package/dist/types/triggers/TriggerListenersFactory.d.ts.map +1 -1
- package/dist/types/triggers/TriggerListenersStore.d.ts +1 -1
- package/dist/types/triggers/TriggerListenersStore.d.ts.map +1 -1
- package/dist/types/triggers/TriggerPayloadBuilder.d.ts +1 -1
- package/dist/types/triggers/TriggerPayloadBuilder.d.ts.map +1 -1
- package/dist/types/triggers/TriggerPayloadManager.d.ts +4 -4
- package/dist/types/triggers/TriggerPayloadManager.d.ts.map +1 -1
- package/dist/types/triggers/TriggerPayloadPersister.d.ts +3 -2
- package/dist/types/triggers/TriggerPayloadPersister.d.ts.map +1 -1
- package/dist/types/triggers/index.d.ts +7 -7
- package/dist/types/triggers/index.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +15 -15
- package/src/ActionsExecutionContainerHookFactory.ts +9 -5
- package/src/ListenerStoreProvider.ts +1 -1
- package/src/authorization/ActionsPermissionsFactory.ts +1 -1
- package/src/authorization/index.ts +3 -3
- package/src/dispatch/DispatchWorkerSupervisor.ts +2 -2
- package/src/dispatch/EventDispatcher.ts +4 -4
- package/src/dispatch/EventsRepository.ts +3 -3
- package/src/dispatch/LazyDispatchWorker.ts +72 -0
- package/src/dispatch/ProjectDispatcher.ts +2 -2
- package/src/dispatch/TargetHandlerResolver.ts +3 -3
- package/src/dispatch/WebhookTargetHandler.ts +3 -3
- package/src/dispatch/types.ts +2 -2
- package/src/graphql/http/ActionsApiMiddlewareFactory.ts +4 -4
- package/src/graphql/http/ActionsContextResolver.ts +1 -1
- package/src/graphql/http/ActionsGraphQLHandlerFactory.ts +3 -2
- package/src/graphql/http/ActionsWebsocketControllerFactory.ts +2 -2
- package/src/graphql/resolvers/ResolversFactory.ts +10 -5
- package/src/graphql/resolvers/index.ts +2 -2
- package/src/graphql/resolvers/mutation/ProcessBatchMutationResolver.ts +4 -4
- package/src/graphql/resolvers/mutation/RetryEventMutationResolver.ts +5 -5
- package/src/graphql/resolvers/mutation/SetVariablesMutationResolver.ts +4 -4
- package/src/graphql/resolvers/mutation/StopEventMutationResolver.ts +4 -4
- package/src/graphql/resolvers/mutation/index.ts +4 -4
- package/src/graphql/resolvers/query/EventsQueryResolver.ts +8 -8
- package/src/graphql/resolvers/query/VariablesQueryResolver.ts +4 -4
- package/src/graphql/resolvers/query/index.ts +1 -1
- package/src/index.ts +39 -27
- package/src/migrations/index.ts +3 -3
- package/src/model/EventByIdQuery.ts +1 -1
- package/src/model/EventsInProcessingQuery.ts +2 -2
- package/src/model/EventsToProcessQuery.ts +3 -3
- package/src/model/FailedEventsQuery.ts +2 -2
- package/src/model/VariablesManager.ts +3 -3
- package/src/triggers/TriggerHandler.ts +3 -3
- package/src/triggers/TriggerIndirectChangesFetcher.ts +1 -1
- package/src/triggers/TriggerListeners.ts +1 -1
- package/src/triggers/TriggerListenersBuilder.ts +4 -4
- package/src/triggers/TriggerListenersFactory.ts +2 -2
- package/src/triggers/TriggerListenersStore.ts +1 -1
- package/src/triggers/TriggerPayloadBuilder.ts +3 -3
- package/src/triggers/TriggerPayloadManager.ts +4 -4
- package/src/triggers/TriggerPayloadPersister.ts +22 -9
- package/src/triggers/index.ts +7 -7
- package/tests/cases/unit/generator.test.ts +1 -1
- package/tests/cases/unit/lazyDispatchWorker.test.ts +226 -0
- package/tests/cases/unit/webhookHandler.test.ts +5 -5
- package/vitest.config.ts +0 -3
package/package.json
CHANGED
|
@@ -22,20 +22,20 @@
|
|
|
22
22
|
}
|
|
23
23
|
},
|
|
24
24
|
"dependencies": {
|
|
25
|
-
"@contember/authorization": "2.1.0-beta.
|
|
26
|
-
"@contember/database": "2.1.0-beta.
|
|
27
|
-
"@contember/database-migrations": "2.1.0-beta.
|
|
28
|
-
"@contember/engine-common": "2.1.0-beta.
|
|
29
|
-
"@contember/engine-content-api": "2.1.0-beta.
|
|
30
|
-
"@contember/engine-http": "2.1.0-beta.
|
|
31
|
-
"@contember/engine-plugins": "2.1.0-beta.
|
|
32
|
-
"@contember/engine-system-api": "2.1.0-beta.
|
|
33
|
-
"@contember/engine-tenant-api": "2.1.0-beta.
|
|
34
|
-
"@contember/graphql-utils": "2.1.0-beta.
|
|
35
|
-
"@contember/logger": "2.1.0-beta.
|
|
36
|
-
"@contember/schema": "2.1.0-beta.
|
|
37
|
-
"@contember/schema-utils": "2.1.0-beta.
|
|
38
|
-
"@contember/typesafe": "2.1.0-beta.
|
|
25
|
+
"@contember/authorization": "2.1.0-beta.2",
|
|
26
|
+
"@contember/database": "2.1.0-beta.2",
|
|
27
|
+
"@contember/database-migrations": "2.1.0-beta.2",
|
|
28
|
+
"@contember/engine-common": "2.1.0-beta.2",
|
|
29
|
+
"@contember/engine-content-api": "2.1.0-beta.2",
|
|
30
|
+
"@contember/engine-http": "2.1.0-beta.2",
|
|
31
|
+
"@contember/engine-plugins": "2.1.0-beta.2",
|
|
32
|
+
"@contember/engine-system-api": "2.1.0-beta.2",
|
|
33
|
+
"@contember/engine-tenant-api": "2.1.0-beta.2",
|
|
34
|
+
"@contember/graphql-utils": "2.1.0-beta.2",
|
|
35
|
+
"@contember/logger": "2.1.0-beta.2",
|
|
36
|
+
"@contember/schema": "2.1.0-beta.2",
|
|
37
|
+
"@contember/schema-utils": "2.1.0-beta.2",
|
|
38
|
+
"@contember/typesafe": "2.1.0-beta.2",
|
|
39
39
|
"@graphql-tools/schema": "^10.0.31",
|
|
40
40
|
"graphql-tag": "^2.12.6"
|
|
41
41
|
},
|
|
@@ -49,7 +49,7 @@
|
|
|
49
49
|
"pg": "^8.20.0"
|
|
50
50
|
},
|
|
51
51
|
"type": "module",
|
|
52
|
-
"version": "2.
|
|
52
|
+
"version": "2.2.0-alpha.1",
|
|
53
53
|
"repository": {
|
|
54
54
|
"type": "git",
|
|
55
55
|
"url": "git+https://github.com/contember/contember.git",
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { TriggerHandler, TriggerIndirectChangesFetcher, TriggerPayloadManager } from './triggers'
|
|
2
|
-
import { ListenerStoreProvider } from './ListenerStoreProvider'
|
|
3
|
-
import { TriggerPayloadBuilder } from './triggers/TriggerPayloadBuilder'
|
|
4
|
-
import { TriggerPayloadPersister } from './triggers/TriggerPayloadPersister'
|
|
1
|
+
import { TriggerHandler, TriggerIndirectChangesFetcher, TriggerPayloadManager } from './triggers/index.js'
|
|
2
|
+
import { ListenerStoreProvider } from './ListenerStoreProvider.js'
|
|
3
|
+
import { TriggerPayloadBuilder } from './triggers/TriggerPayloadBuilder.js'
|
|
4
|
+
import { TriggerPayloadPersister } from './triggers/TriggerPayloadPersister.js'
|
|
5
5
|
import { ExecutionContainerHook } from '@contember/engine-content-api'
|
|
6
6
|
|
|
7
7
|
export class ActionsExecutionContainerHookFactory {
|
|
@@ -14,7 +14,10 @@ export class ActionsExecutionContainerHookFactory {
|
|
|
14
14
|
return builder => {
|
|
15
15
|
return builder.setupService(
|
|
16
16
|
'mapperFactory',
|
|
17
|
-
(
|
|
17
|
+
(
|
|
18
|
+
mapperFactory,
|
|
19
|
+
{ whereBuilder, schema, pathFactory, systemSchema, providers, stage, project, schemaMeta, joinBuilder, userInfo, triggeredActionsCollector },
|
|
20
|
+
) => {
|
|
18
21
|
mapperFactory.hooks.push(mapper => {
|
|
19
22
|
const triggerPayloadPersister = new TriggerPayloadPersister(
|
|
20
23
|
mapper,
|
|
@@ -25,6 +28,7 @@ export class ActionsExecutionContainerHookFactory {
|
|
|
25
28
|
schemaMeta.id,
|
|
26
29
|
mapper.identityId,
|
|
27
30
|
userInfo,
|
|
31
|
+
triggeredActionsCollector,
|
|
28
32
|
)
|
|
29
33
|
const triggerPayloadBuilder = new TriggerPayloadBuilder(mapper)
|
|
30
34
|
const payloadManager = new TriggerPayloadManager(triggerPayloadBuilder, triggerPayloadPersister)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Permissions } from '@contember/authorization'
|
|
2
2
|
import { ProjectRole } from '@contember/schema'
|
|
3
|
-
import { ActionsAuthorizationActions } from './ActionsAuthorizationActions'
|
|
3
|
+
import { ActionsAuthorizationActions } from './ActionsAuthorizationActions.js'
|
|
4
4
|
|
|
5
5
|
export class ActionsPermissionsFactory {
|
|
6
6
|
public create(): Permissions {
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export * from './Identity'
|
|
2
|
-
export * from './ActionsAuthorizationActions'
|
|
3
|
-
export * from './ActionsPermissionsFactory'
|
|
1
|
+
export * from './Identity.js'
|
|
2
|
+
export * from './ActionsAuthorizationActions.js'
|
|
3
|
+
export * from './ActionsPermissionsFactory.js'
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { ProjectContainer, ProjectGroupContainer } from '@contember/engine-http'
|
|
2
2
|
import { AcquiringListener } from '@contember/database'
|
|
3
3
|
import { Runnable, RunnableArgs, Running, Supervisor } from '@contember/engine-common'
|
|
4
|
-
import { ProjectDispatcherFactory } from './ProjectDispatcher'
|
|
4
|
+
import { ProjectDispatcherFactory } from './ProjectDispatcher.js'
|
|
5
5
|
import { Logger } from '@contember/logger'
|
|
6
|
-
import { ImplementationException } from '../ImplementationException'
|
|
6
|
+
import { ImplementationException } from '../ImplementationException.js'
|
|
7
7
|
|
|
8
8
|
export class DispatchWorkerSupervisorFactory {
|
|
9
9
|
constructor(
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { EventsRepository } from './EventsRepository'
|
|
2
|
-
import { TargetHandlerResolver } from './TargetHandlerResolver'
|
|
3
|
-
import { HandledEvent } from './types'
|
|
1
|
+
import { EventsRepository } from './EventsRepository.js'
|
|
2
|
+
import { TargetHandlerResolver } from './TargetHandlerResolver.js'
|
|
3
|
+
import { HandledEvent } from './types.js'
|
|
4
4
|
import { Logger } from '@contember/logger'
|
|
5
5
|
import { ContentSchemaResolver } from '@contember/engine-http'
|
|
6
6
|
import { DatabaseContext } from '@contember/engine-system-api'
|
|
7
|
-
import { VariablesManager } from '../model/VariablesManager'
|
|
7
|
+
import { VariablesManager } from '../model/VariablesManager.js'
|
|
8
8
|
|
|
9
9
|
type ProcessBatchArgs = {
|
|
10
10
|
db: DatabaseContext
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { Client, Connection, Literal, LockModifier, LockType, Operator, SelectBuilder, UpdateBuilder } from '@contember/database'
|
|
2
|
-
import { EventRow, HandledEvent } from './types'
|
|
2
|
+
import { EventRow, HandledEvent } from './types.js'
|
|
3
3
|
import { Actions } from '@contember/schema'
|
|
4
|
-
import { eventsToProcessSpecification, eventsToProcessStateSpecification } from '../model/EventsToProcessSpecification'
|
|
5
|
-
import { notify } from '../utils/notifyChannel'
|
|
4
|
+
import { eventsToProcessSpecification, eventsToProcessStateSpecification } from '../model/EventsToProcessSpecification.js'
|
|
5
|
+
import { notify } from '../utils/notifyChannel.js'
|
|
6
6
|
|
|
7
7
|
const ACK_TIMEOUT_MS = 1_000 * 60 * 10 // 10 minutes
|
|
8
8
|
const DEFAULT_REPEAT_INTERVAL_MS = 5_000 // 5 seconds
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { Runnable, RunnableArgs, Running, Supervisor, SupervisorOptions } from '@contember/engine-common'
|
|
2
|
+
import { ProjectGroupContainerResolver } from '@contember/engine-http'
|
|
3
|
+
import { DispatchWorkerSupervisorFactory } from './DispatchWorkerSupervisor.js'
|
|
4
|
+
|
|
5
|
+
export class LazyDispatchWorker implements Runnable {
|
|
6
|
+
constructor(
|
|
7
|
+
private readonly projectGroupContainerResolver: ProjectGroupContainerResolver,
|
|
8
|
+
private readonly supervisorFactory: DispatchWorkerSupervisorFactory,
|
|
9
|
+
private readonly supervisorOptions: SupervisorOptions = { startupMax: 10 },
|
|
10
|
+
) {
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
public async run({ logger, onError }: RunnableArgs): Promise<Running> {
|
|
14
|
+
const running = new Map<string | undefined, Promise<Running | undefined>>()
|
|
15
|
+
let aborted = false
|
|
16
|
+
|
|
17
|
+
const unlisten = this.projectGroupContainerResolver.on('create', ({ container, slug }) => {
|
|
18
|
+
const groupLabel = slug ?? '<default>'
|
|
19
|
+
const childLogger = logger.child({ projectGroup: groupLabel })
|
|
20
|
+
childLogger.debug(`Starting dispatch worker for project group ${groupLabel}`)
|
|
21
|
+
|
|
22
|
+
const supervised = new Supervisor(
|
|
23
|
+
this.supervisorFactory.create(container),
|
|
24
|
+
this.supervisorOptions,
|
|
25
|
+
)
|
|
26
|
+
const runningPromise: Promise<Running | undefined> = supervised.run({
|
|
27
|
+
logger: childLogger,
|
|
28
|
+
onError: e => {
|
|
29
|
+
if (aborted) {
|
|
30
|
+
return
|
|
31
|
+
}
|
|
32
|
+
childLogger.error(e, { message: `Dispatch worker for project group ${groupLabel} crashed` })
|
|
33
|
+
onError(e)
|
|
34
|
+
},
|
|
35
|
+
}).catch(e => {
|
|
36
|
+
if (!aborted) {
|
|
37
|
+
childLogger.error(e, { message: `Failed to start dispatch worker for project group ${groupLabel}` })
|
|
38
|
+
onError(e)
|
|
39
|
+
}
|
|
40
|
+
return undefined
|
|
41
|
+
})
|
|
42
|
+
running.set(slug, runningPromise)
|
|
43
|
+
|
|
44
|
+
return () => {
|
|
45
|
+
running.delete(slug)
|
|
46
|
+
;(async () => {
|
|
47
|
+
try {
|
|
48
|
+
const r = await runningPromise
|
|
49
|
+
await r?.end()
|
|
50
|
+
} catch {
|
|
51
|
+
}
|
|
52
|
+
})()
|
|
53
|
+
}
|
|
54
|
+
})
|
|
55
|
+
|
|
56
|
+
return {
|
|
57
|
+
end: async () => {
|
|
58
|
+
aborted = true
|
|
59
|
+
unlisten()
|
|
60
|
+
const all = [...running.values()]
|
|
61
|
+
running.clear()
|
|
62
|
+
await Promise.allSettled(all.map(async p => {
|
|
63
|
+
try {
|
|
64
|
+
const r = await p
|
|
65
|
+
await r?.end()
|
|
66
|
+
} catch {
|
|
67
|
+
}
|
|
68
|
+
}))
|
|
69
|
+
},
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { DatabaseContext } from '@contember/engine-system-api'
|
|
2
|
-
import { EventDispatcher } from './EventDispatcher'
|
|
2
|
+
import { EventDispatcher } from './EventDispatcher.js'
|
|
3
3
|
import { ContentSchemaResolver } from '@contember/engine-http'
|
|
4
4
|
import { Runnable, RunnableArgs, Running } from '@contember/engine-common'
|
|
5
5
|
import { Listener } from '@contember/database'
|
|
6
|
-
import { NOTIFY_CHANNEL_NAME } from '../utils/notifyChannel'
|
|
6
|
+
import { NOTIFY_CHANNEL_NAME } from '../utils/notifyChannel.js'
|
|
7
7
|
|
|
8
8
|
export class ProjectDispatcherFactory {
|
|
9
9
|
constructor(
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Actions } from '@contember/schema'
|
|
2
|
-
import { WebhookTargetHandler } from './WebhookTargetHandler'
|
|
3
|
-
import { ImplementationException } from '../ImplementationException'
|
|
4
|
-
import { InvokeHandler } from './types'
|
|
2
|
+
import { WebhookTargetHandler } from './WebhookTargetHandler.js'
|
|
3
|
+
import { ImplementationException } from '../ImplementationException.js'
|
|
4
|
+
import { InvokeHandler } from './types.js'
|
|
5
5
|
|
|
6
6
|
export class TargetHandlerResolver {
|
|
7
7
|
constructor(
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { Actions, ActionsPayload } from '@contember/schema'
|
|
2
|
-
import { EventRow, HandledEvent, InvokeHandler, InvokeHandlerArgs } from './types'
|
|
3
|
-
import { VariablesMap } from '../model/VariablesManager'
|
|
2
|
+
import { EventRow, HandledEvent, InvokeHandler, InvokeHandlerArgs } from './types.js'
|
|
3
|
+
import { VariablesMap } from '../model/VariablesManager.js'
|
|
4
4
|
import * as Typesafe from '@contember/typesafe'
|
|
5
|
-
import { FetcherResponse, WebhookFetcher } from './WebhookFetcher'
|
|
5
|
+
import { FetcherResponse, WebhookFetcher } from './WebhookFetcher.js'
|
|
6
6
|
|
|
7
7
|
const DEFAULT_TIMEOUT_MS = 30_000 // 30 seconds
|
|
8
8
|
|
package/src/dispatch/types.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Logger } from '@contember/logger'
|
|
2
2
|
import { Actions } from '@contember/schema'
|
|
3
|
-
import { EventRow } from '../model/types'
|
|
4
|
-
import { VariablesMap } from '../model/VariablesManager'
|
|
3
|
+
import { EventRow } from '../model/types.js'
|
|
4
|
+
import { VariablesMap } from '../model/VariablesManager.js'
|
|
5
5
|
|
|
6
6
|
export type { EventRow }
|
|
7
7
|
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { HttpController } from '@contember/engine-http'
|
|
2
|
-
import { ActionsGraphQLHandler } from './ActionsGraphQLHandlerFactory'
|
|
3
|
-
import { ActionsContext } from '../resolvers/ActionsContext'
|
|
4
|
-
import { ActionsContextResolver } from './ActionsContextResolver'
|
|
2
|
+
import { ActionsGraphQLHandler } from './ActionsGraphQLHandlerFactory.js'
|
|
3
|
+
import { ActionsContext } from '../resolvers/ActionsContext.js'
|
|
4
|
+
import { ActionsContextResolver } from './ActionsContextResolver.js'
|
|
5
5
|
import { AuthorizationScope, Authorizator } from '@contember/authorization'
|
|
6
|
-
import { Identity } from '../../authorization'
|
|
6
|
+
import { Identity } from '../../authorization/index.js'
|
|
7
7
|
import { ForbiddenError } from '@contember/graphql-utils'
|
|
8
8
|
|
|
9
9
|
export class ActionsApiMiddlewareFactory {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ApplicationContext, HttpErrorResponse, ProjectConfig, ProjectContainer, ProjectContextResolver } from '@contember/engine-http'
|
|
2
|
-
import { Identity } from '../../authorization'
|
|
2
|
+
import { Identity } from '../../authorization/index.js'
|
|
3
3
|
|
|
4
4
|
export interface ActionsContext {
|
|
5
5
|
projectContainer: ProjectContainer
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { makeExecutableSchema } from '@graphql-tools/schema'
|
|
2
2
|
import { createGraphQLQueryHandler, GraphQLQueryHandler } from '@contember/engine-http'
|
|
3
|
-
import { ResolversFactory } from '../resolvers/ResolversFactory'
|
|
3
|
+
import { ResolversFactory } from '../resolvers/ResolversFactory.js'
|
|
4
|
+
// biome-ignore lint/correctness/useImportExtensions: .graphql files are resolved by the bundler loader, not as JS modules
|
|
4
5
|
import { schema as graphqlDocument } from '../schema/actions.graphql'
|
|
5
|
-
import { ActionsContext } from '../resolvers/ActionsContext'
|
|
6
|
+
import { ActionsContext } from '../resolvers/ActionsContext.js'
|
|
6
7
|
|
|
7
8
|
export type ActionsGraphQLHandler = GraphQLQueryHandler<ActionsContext>
|
|
8
9
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { HttpErrorResponse, WebSocketController } from '@contember/engine-http'
|
|
2
|
-
import { ActionsContextResolver } from './ActionsContextResolver'
|
|
3
|
-
import { DispatchWorkerSupervisorFactory } from '../../dispatch/DispatchWorkerSupervisor'
|
|
2
|
+
import { ActionsContextResolver } from './ActionsContextResolver.js'
|
|
3
|
+
import { DispatchWorkerSupervisorFactory } from '../../dispatch/DispatchWorkerSupervisor.js'
|
|
4
4
|
import * as Typesafe from '@contember/typesafe'
|
|
5
5
|
import { TenantRole } from '@contember/engine-tenant-api'
|
|
6
6
|
import { Running } from '@contember/engine-common'
|
|
@@ -1,9 +1,14 @@
|
|
|
1
1
|
import { DateTimeType, JSONType, UuidType } from '@contember/graphql-utils'
|
|
2
|
-
import { Resolvers } from '../schema'
|
|
3
|
-
import { EventsQueryResolver } from './query'
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
|
|
2
|
+
import { Resolvers } from '../schema/index.js'
|
|
3
|
+
import { EventsQueryResolver } from './query/index.js'
|
|
4
|
+
import {
|
|
5
|
+
ProcessBatchMutationResolver,
|
|
6
|
+
RetryEventMutationResolver,
|
|
7
|
+
SetVariablesMutationResolver,
|
|
8
|
+
StopEventMutationResolver,
|
|
9
|
+
} from './mutation/index.js'
|
|
10
|
+
import { ActionsContext } from './ActionsContext.js'
|
|
11
|
+
import { VariablesQueryResolver } from './query/VariablesQueryResolver.js'
|
|
7
12
|
|
|
8
13
|
export class ResolversFactory {
|
|
9
14
|
constructor(
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export * from './mutation'
|
|
2
|
-
export * from './query'
|
|
1
|
+
export * from './mutation/index.js'
|
|
2
|
+
export * from './query/index.js'
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { MutationResolvers } from '../../schema'
|
|
2
|
-
import { ActionsContext } from '../ActionsContext'
|
|
3
|
-
import { EventDispatcher } from '../../../dispatch/EventDispatcher'
|
|
4
|
-
import { ActionsAuthorizationActions } from '../../../authorization'
|
|
1
|
+
import { MutationResolvers } from '../../schema/index.js'
|
|
2
|
+
import { ActionsContext } from '../ActionsContext.js'
|
|
3
|
+
import { EventDispatcher } from '../../../dispatch/EventDispatcher.js'
|
|
4
|
+
import { ActionsAuthorizationActions } from '../../../authorization/index.js'
|
|
5
5
|
|
|
6
6
|
export class ProcessBatchMutationResolver implements MutationResolvers<ActionsContext> {
|
|
7
7
|
constructor(
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { MutationResolvers, MutationRetryEventArgs } from '../../schema'
|
|
2
|
-
import { ActionsContext } from '../ActionsContext'
|
|
3
|
-
import { ActionsAuthorizationActions } from '../../../authorization'
|
|
4
|
-
import { EventsRepository } from '../../../dispatch/EventsRepository'
|
|
5
|
-
import { notify } from '../../../utils/notifyChannel'
|
|
1
|
+
import { MutationResolvers, MutationRetryEventArgs } from '../../schema/index.js'
|
|
2
|
+
import { ActionsContext } from '../ActionsContext.js'
|
|
3
|
+
import { ActionsAuthorizationActions } from '../../../authorization/index.js'
|
|
4
|
+
import { EventsRepository } from '../../../dispatch/EventsRepository.js'
|
|
5
|
+
import { notify } from '../../../utils/notifyChannel.js'
|
|
6
6
|
|
|
7
7
|
export class RetryEventMutationResolver implements MutationResolvers<ActionsContext> {
|
|
8
8
|
constructor(
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { MutationResolvers, MutationSetVariablesArgs } from '../../schema'
|
|
2
|
-
import { ActionsContext } from '../ActionsContext'
|
|
3
|
-
import { VariablesManager } from '../../../model/VariablesManager'
|
|
4
|
-
import { ActionsAuthorizationActions } from '../../../authorization'
|
|
1
|
+
import { MutationResolvers, MutationSetVariablesArgs } from '../../schema/index.js'
|
|
2
|
+
import { ActionsContext } from '../ActionsContext.js'
|
|
3
|
+
import { VariablesManager } from '../../../model/VariablesManager.js'
|
|
4
|
+
import { ActionsAuthorizationActions } from '../../../authorization/index.js'
|
|
5
5
|
|
|
6
6
|
export class SetVariablesMutationResolver implements MutationResolvers<ActionsContext> {
|
|
7
7
|
constructor(
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { MutationResolvers, MutationRetryEventArgs } from '../../schema'
|
|
2
|
-
import { ActionsContext } from '../ActionsContext'
|
|
3
|
-
import { ActionsAuthorizationActions } from '../../../authorization'
|
|
4
|
-
import { EventsRepository } from '../../../dispatch/EventsRepository'
|
|
1
|
+
import { MutationResolvers, MutationRetryEventArgs } from '../../schema/index.js'
|
|
2
|
+
import { ActionsContext } from '../ActionsContext.js'
|
|
3
|
+
import { ActionsAuthorizationActions } from '../../../authorization/index.js'
|
|
4
|
+
import { EventsRepository } from '../../../dispatch/EventsRepository.js'
|
|
5
5
|
|
|
6
6
|
export class StopEventMutationResolver implements MutationResolvers<ActionsContext> {
|
|
7
7
|
constructor(
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export * from './ProcessBatchMutationResolver'
|
|
2
|
-
export * from './SetVariablesMutationResolver'
|
|
3
|
-
export * from './RetryEventMutationResolver'
|
|
4
|
-
export * from './StopEventMutationResolver'
|
|
1
|
+
export * from './ProcessBatchMutationResolver.js'
|
|
2
|
+
export * from './SetVariablesMutationResolver.js'
|
|
3
|
+
export * from './RetryEventMutationResolver.js'
|
|
4
|
+
export * from './StopEventMutationResolver.js'
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { Event, QueryEventsInProcessingArgs, QueryEventsToProcessArgs, QueryFailedEventsArgs, QueryResolvers } from '../../schema'
|
|
2
|
-
import { ActionsContext } from '../ActionsContext'
|
|
3
|
-
import { EventsToProcessQuery } from '../../../model/EventsToProcessQuery'
|
|
4
|
-
import { EventRow } from '../../../model/types'
|
|
1
|
+
import { Event, QueryEventsInProcessingArgs, QueryEventsToProcessArgs, QueryFailedEventsArgs, QueryResolvers } from '../../schema/index.js'
|
|
2
|
+
import { ActionsContext } from '../ActionsContext.js'
|
|
3
|
+
import { EventsToProcessQuery } from '../../../model/EventsToProcessQuery.js'
|
|
4
|
+
import { EventRow } from '../../../model/types.js'
|
|
5
5
|
import { DatabaseContext, StagesQuery } from '@contember/engine-system-api'
|
|
6
6
|
import { Client, DatabaseQuery } from '@contember/database'
|
|
7
|
-
import { EventsInProcessingQuery } from '../../../model/EventsInProcessingQuery'
|
|
8
|
-
import { FailedEventsQuery } from '../../../model/FailedEventsQuery'
|
|
9
|
-
import { ActionsAuthorizationActions } from '../../../authorization'
|
|
10
|
-
import { EventByIdQuery } from '../../../model/EventByIdQuery'
|
|
7
|
+
import { EventsInProcessingQuery } from '../../../model/EventsInProcessingQuery.js'
|
|
8
|
+
import { FailedEventsQuery } from '../../../model/FailedEventsQuery.js'
|
|
9
|
+
import { ActionsAuthorizationActions } from '../../../authorization/index.js'
|
|
10
|
+
import { EventByIdQuery } from '../../../model/EventByIdQuery.js'
|
|
11
11
|
|
|
12
12
|
export class EventsQueryResolver implements QueryResolvers<ActionsContext> {
|
|
13
13
|
async eventsInProcessing(parent: unknown, { args }: QueryEventsInProcessingArgs, ctx: ActionsContext) {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { QueryResolvers } from '../../schema'
|
|
2
|
-
import { ActionsContext } from '../ActionsContext'
|
|
3
|
-
import { VariablesManager } from '../../../model/VariablesManager'
|
|
4
|
-
import { ActionsAuthorizationActions } from '../../../authorization'
|
|
1
|
+
import { QueryResolvers } from '../../schema/index.js'
|
|
2
|
+
import { ActionsContext } from '../ActionsContext.js'
|
|
3
|
+
import { VariablesManager } from '../../../model/VariablesManager.js'
|
|
4
|
+
import { ActionsAuthorizationActions } from '../../../authorization/index.js'
|
|
5
5
|
|
|
6
6
|
export class VariablesQueryResolver implements QueryResolvers<ActionsContext> {
|
|
7
7
|
constructor(
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from './EventsQueryResolver'
|
|
1
|
+
export * from './EventsQueryResolver.js'
|
package/src/index.ts
CHANGED
|
@@ -1,36 +1,43 @@
|
|
|
1
1
|
import { Plugin } from '@contember/engine-plugins'
|
|
2
|
-
import { migrationsGroup } from './migrations'
|
|
3
|
-
import { ActionsExecutionContainerHookFactory } from './ActionsExecutionContainerHookFactory'
|
|
4
|
-
import { ListenerStoreProvider } from './ListenerStoreProvider'
|
|
2
|
+
import { migrationsGroup } from './migrations/index.js'
|
|
3
|
+
import { ActionsExecutionContainerHookFactory } from './ActionsExecutionContainerHookFactory.js'
|
|
4
|
+
import { ListenerStoreProvider } from './ListenerStoreProvider.js'
|
|
5
5
|
import { MigrationGroup } from '@contember/database-migrations'
|
|
6
6
|
import { MasterContainerBuilder, MasterContainerHook } from '@contember/engine-http'
|
|
7
|
-
import { ActionsApiMiddlewareFactory } from './graphql/http/ActionsApiMiddlewareFactory'
|
|
8
|
-
import { ActionsGraphQLHandlerFactory } from './graphql/http/ActionsGraphQLHandlerFactory'
|
|
9
|
-
import { ResolversFactory } from './graphql/resolvers/ResolversFactory'
|
|
7
|
+
import { ActionsApiMiddlewareFactory } from './graphql/http/ActionsApiMiddlewareFactory.js'
|
|
8
|
+
import { ActionsGraphQLHandlerFactory } from './graphql/http/ActionsGraphQLHandlerFactory.js'
|
|
9
|
+
import { ResolversFactory } from './graphql/resolvers/ResolversFactory.js'
|
|
10
10
|
import {
|
|
11
11
|
EventsQueryResolver,
|
|
12
12
|
ProcessBatchMutationResolver,
|
|
13
13
|
RetryEventMutationResolver,
|
|
14
14
|
SetVariablesMutationResolver,
|
|
15
15
|
StopEventMutationResolver,
|
|
16
|
-
} from './graphql/resolvers'
|
|
17
|
-
import { EventDispatcher } from './dispatch/EventDispatcher'
|
|
18
|
-
import { EventsRepository } from './dispatch/EventsRepository'
|
|
19
|
-
import { TargetHandlerResolver } from './dispatch/TargetHandlerResolver'
|
|
20
|
-
import { WebhookTargetHandler } from './dispatch/WebhookTargetHandler'
|
|
21
|
-
import { ActionsContextResolver } from './graphql/http/ActionsContextResolver'
|
|
22
|
-
import { ActionsWebsocketControllerFactory } from './graphql/http/ActionsWebsocketControllerFactory'
|
|
23
|
-
import { DispatchWorkerSupervisorFactory } from './dispatch/DispatchWorkerSupervisor'
|
|
24
|
-
import {
|
|
25
|
-
import {
|
|
26
|
-
import {
|
|
16
|
+
} from './graphql/resolvers/index.js'
|
|
17
|
+
import { EventDispatcher } from './dispatch/EventDispatcher.js'
|
|
18
|
+
import { EventsRepository } from './dispatch/EventsRepository.js'
|
|
19
|
+
import { TargetHandlerResolver } from './dispatch/TargetHandlerResolver.js'
|
|
20
|
+
import { WebhookTargetHandler } from './dispatch/WebhookTargetHandler.js'
|
|
21
|
+
import { ActionsContextResolver } from './graphql/http/ActionsContextResolver.js'
|
|
22
|
+
import { ActionsWebsocketControllerFactory } from './graphql/http/ActionsWebsocketControllerFactory.js'
|
|
23
|
+
import { DispatchWorkerSupervisorFactory } from './dispatch/DispatchWorkerSupervisor.js'
|
|
24
|
+
import { LazyDispatchWorker } from './dispatch/LazyDispatchWorker.js'
|
|
25
|
+
import { ProjectDispatcherFactory } from './dispatch/ProjectDispatcher.js'
|
|
26
|
+
import { VariablesQueryResolver } from './graphql/resolvers/query/VariablesQueryResolver.js'
|
|
27
|
+
import { VariablesManager } from './model/VariablesManager.js'
|
|
27
28
|
import { AccessEvaluator, Authorizator } from '@contember/authorization'
|
|
28
|
-
import { ActionsPermissionsFactory } from './authorization'
|
|
29
|
-
import { WebhookFetcherNative } from './dispatch/WebhookFetcher'
|
|
29
|
+
import { ActionsPermissionsFactory } from './authorization/index.js'
|
|
30
|
+
import { WebhookFetcherNative } from './dispatch/WebhookFetcher.js'
|
|
30
31
|
|
|
31
|
-
export {
|
|
32
|
-
|
|
33
|
-
|
|
32
|
+
export {
|
|
33
|
+
TriggerHandler,
|
|
34
|
+
TriggerIndirectChangesFetcher,
|
|
35
|
+
TriggerListenersFactory,
|
|
36
|
+
TriggerListenersStore,
|
|
37
|
+
TriggerPayloadManager,
|
|
38
|
+
} from './triggers/index.js'
|
|
39
|
+
export { ActionsExecutionContainerHookFactory } from './ActionsExecutionContainerHookFactory.js'
|
|
40
|
+
export { ListenerStoreProvider } from './ListenerStoreProvider.js'
|
|
34
41
|
|
|
35
42
|
export default class ActionsPlugin implements Plugin {
|
|
36
43
|
name = 'contember/actions'
|
|
@@ -108,11 +115,16 @@ export default class ActionsPlugin implements Plugin {
|
|
|
108
115
|
it.addWebsocketRoute('actions', '/actions/_worker', actionsWebsocketMiddlewareFactory.create())
|
|
109
116
|
},
|
|
110
117
|
)
|
|
111
|
-
.setupService(
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
118
|
+
.setupService(
|
|
119
|
+
'applicationWorkers',
|
|
120
|
+
(it, { actions_dispatchWorkerSupervisorFactory, projectGroupContainer, projectGroupContainerResolver, serverConfig }) => {
|
|
121
|
+
if (!(serverConfig as any).projectGroup) {
|
|
122
|
+
it.registerWorker(this.name, actions_dispatchWorkerSupervisorFactory.create(projectGroupContainer))
|
|
123
|
+
} else {
|
|
124
|
+
it.registerWorker(this.name, new LazyDispatchWorker(projectGroupContainerResolver, actions_dispatchWorkerSupervisorFactory))
|
|
125
|
+
}
|
|
126
|
+
},
|
|
127
|
+
) as unknown as MasterContainerBuilder
|
|
116
128
|
}
|
|
117
129
|
return hook
|
|
118
130
|
}
|
package/src/migrations/index.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import snapshot from './snapshot'
|
|
1
|
+
import snapshot from './snapshot.js'
|
|
2
2
|
import { MigrationGroup } from '@contember/database-migrations'
|
|
3
|
-
import _20230310145000actionsvariables from './2023-03-10-145000-actions-variables'
|
|
4
|
-
import _20250528160000actioneventuser from './2025-05-28-160000-action-event-user'
|
|
3
|
+
import _20230310145000actionsvariables from './2023-03-10-145000-actions-variables.js'
|
|
4
|
+
import _20250528160000actioneventuser from './2025-05-28-160000-action-event-user.js'
|
|
5
5
|
|
|
6
6
|
export const migrationsGroup = new MigrationGroup(snapshot, {
|
|
7
7
|
'2023-03-10-145000-actions-variables': _20230310145000actionsvariables,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { DatabaseQuery, DatabaseQueryable, SelectBuilder } from '@contember/database'
|
|
2
|
-
import { EventRow } from './types'
|
|
3
|
-
import { EventArgs } from '../graphql/schema'
|
|
2
|
+
import { EventRow } from './types.js'
|
|
3
|
+
import { EventArgs } from '../graphql/schema/index.js'
|
|
4
4
|
|
|
5
5
|
export class EventsInProcessingQuery extends DatabaseQuery<EventRow[]> {
|
|
6
6
|
constructor(
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { DatabaseQuery, DatabaseQueryable, SelectBuilder } from '@contember/database'
|
|
2
|
-
import { EventRow } from './types'
|
|
3
|
-
import { EventArgs } from '../graphql/schema'
|
|
4
|
-
import { eventsToProcessSpecification } from './EventsToProcessSpecification'
|
|
2
|
+
import { EventRow } from './types.js'
|
|
3
|
+
import { EventArgs } from '../graphql/schema/index.js'
|
|
4
|
+
import { eventsToProcessSpecification } from './EventsToProcessSpecification.js'
|
|
5
5
|
|
|
6
6
|
export class EventsToProcessQuery extends DatabaseQuery<EventRow[]> {
|
|
7
7
|
constructor(
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { DatabaseQuery, DatabaseQueryable, SelectBuilder } from '@contember/database'
|
|
2
|
-
import { EventRow } from './types'
|
|
3
|
-
import { EventArgs } from '../graphql/schema'
|
|
2
|
+
import { EventRow } from './types.js'
|
|
3
|
+
import { EventArgs } from '../graphql/schema/index.js'
|
|
4
4
|
|
|
5
5
|
export class FailedEventsQuery extends DatabaseQuery<EventRow[]> {
|
|
6
6
|
constructor(
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { DatabaseContext } from '@contember/engine-system-api'
|
|
2
|
-
import { VariablesQuery } from './VariablesQuery'
|
|
3
|
-
import { SetVariablesArgs } from '../graphql/schema'
|
|
2
|
+
import { VariablesQuery } from './VariablesQuery.js'
|
|
3
|
+
import { SetVariablesArgs } from '../graphql/schema/index.js'
|
|
4
4
|
import { DeleteBuilder } from '@contember/database'
|
|
5
|
-
import { SetVariableCommand } from './SetVariableCommand'
|
|
5
|
+
import { SetVariableCommand } from './SetVariableCommand.js'
|
|
6
6
|
|
|
7
7
|
export type VariablesMap = Record<string, string>
|
|
8
8
|
|
|
@@ -7,9 +7,9 @@ import {
|
|
|
7
7
|
EventManager,
|
|
8
8
|
} from '@contember/engine-content-api'
|
|
9
9
|
import { Input } from '@contember/schema'
|
|
10
|
-
import { IndirectListener, JunctionListener, TriggerListenersStore } from './TriggerListenersStore'
|
|
11
|
-
import { TriggerPayloadManager } from './TriggerPayloadManager'
|
|
12
|
-
import { TriggerIndirectChangesFetcher } from './TriggerIndirectChangesFetcher'
|
|
10
|
+
import { IndirectListener, JunctionListener, TriggerListenersStore } from './TriggerListenersStore.js'
|
|
11
|
+
import { TriggerPayloadManager } from './TriggerPayloadManager.js'
|
|
12
|
+
import { TriggerIndirectChangesFetcher } from './TriggerIndirectChangesFetcher.js'
|
|
13
13
|
|
|
14
14
|
export type EventCause =
|
|
15
15
|
| BeforeUpdateEvent
|