@webiny/background-tasks 6.6.0-alpha.1 → 6.6.0-alpha.11
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/api/BackgroundTasksFeature.js +42 -24
- package/api/BackgroundTasksFeature.js.map +1 -1
- package/api/crud/TaskLogPrivateModel.js +2 -1
- package/api/crud/TaskLogPrivateModel.js.map +1 -1
- package/api/crud/TaskPrivateModel.js +2 -1
- package/api/crud/TaskPrivateModel.js.map +1 -1
- package/api/decorators/SelfCleaningTaskHandlerDecorator.d.ts +33 -0
- package/api/decorators/{SelfCleaningTaskDecorator.js → SelfCleaningTaskHandlerDecorator.js} +15 -39
- package/api/decorators/SelfCleaningTaskHandlerDecorator.js.map +1 -0
- package/api/decorators/TaskDefinitionDefaultsDecorator.d.ts +27 -0
- package/api/decorators/{RunnableTaskDecorator.js → TaskDefinitionDefaultsDecorator.js} +11 -32
- package/api/decorators/TaskDefinitionDefaultsDecorator.js.map +1 -0
- package/api/domain/errors.d.ts +14 -10
- package/api/domain/errors.js +27 -12
- package/api/domain/errors.js.map +1 -1
- package/api/domain/task/TaskLogModelProvider.d.ts +12 -0
- package/api/domain/task/TaskLogModelProvider.js +23 -0
- package/api/domain/task/TaskLogModelProvider.js.map +1 -0
- package/api/domain/task/TaskLogsRepository.d.ts +34 -0
- package/api/domain/task/TaskLogsRepository.js +146 -0
- package/api/domain/task/TaskLogsRepository.js.map +1 -0
- package/api/domain/task/TaskModelProvider.d.ts +12 -0
- package/api/domain/task/TaskModelProvider.js +23 -0
- package/api/domain/task/TaskModelProvider.js.map +1 -0
- package/api/domain/task/TasksRepository.d.ts +37 -0
- package/api/domain/task/TasksRepository.js +126 -0
- package/api/domain/task/TasksRepository.js.map +1 -0
- package/api/domain/task/abstractions.d.ts +50 -0
- package/api/domain/task/abstractions.js +8 -0
- package/api/domain/task/abstractions.js.map +1 -0
- package/api/domain/task/createRevisionId.d.ts +1 -0
- package/api/domain/task/createRevisionId.js +8 -0
- package/api/domain/task/createRevisionId.js.map +1 -0
- package/api/domain/task/entryToTask.d.ts +3 -0
- package/api/domain/task/entryToTask.js +20 -0
- package/api/domain/task/entryToTask.js.map +1 -0
- package/api/domain/task/entryToTaskLog.d.ts +3 -0
- package/api/domain/task/entryToTaskLog.js +12 -0
- package/api/domain/task/entryToTaskLog.js.map +1 -0
- package/api/features/AbortTask/abstractions.d.ts +4 -0
- package/api/features/AbortTask/abstractions.js.map +1 -1
- package/api/features/CleanupTaskSubtree/CleanupTaskSubtreeUseCase.d.ts +25 -5
- package/api/features/CleanupTaskSubtree/CleanupTaskSubtreeUseCase.js +111 -5
- package/api/features/CleanupTaskSubtree/CleanupTaskSubtreeUseCase.js.map +1 -1
- package/api/features/CleanupTaskSubtree/feature.d.ts +4 -0
- package/api/features/CleanupTaskSubtree/feature.js +11 -0
- package/api/features/CleanupTaskSubtree/feature.js.map +1 -0
- package/api/features/CleanupTaskSubtree/index.d.ts +1 -1
- package/api/features/CleanupTaskSubtree/index.js +1 -1
- package/api/features/CreateTask/CreateTaskUseCase.d.ts +17 -0
- package/api/features/CreateTask/CreateTaskUseCase.js +56 -0
- package/api/features/CreateTask/CreateTaskUseCase.js.map +1 -0
- package/api/features/CreateTask/abstractions.d.ts +21 -0
- package/api/features/CreateTask/abstractions.js +5 -0
- package/api/features/CreateTask/abstractions.js.map +1 -0
- package/api/features/{GetTaskDefinition → CreateTask}/feature.d.ts +1 -1
- package/api/features/CreateTask/feature.js +11 -0
- package/api/features/CreateTask/feature.js.map +1 -0
- package/api/features/CreateTask/index.d.ts +2 -0
- package/api/features/CreateTask/index.js +2 -0
- package/api/features/CreateTaskLog/CreateTaskLogUseCase.d.ts +13 -0
- package/api/features/CreateTaskLog/CreateTaskLogUseCase.js +19 -0
- package/api/features/CreateTaskLog/CreateTaskLogUseCase.js.map +1 -0
- package/api/features/CreateTaskLog/abstractions.d.ts +16 -0
- package/api/features/CreateTaskLog/abstractions.js +5 -0
- package/api/features/CreateTaskLog/abstractions.js.map +1 -0
- package/api/features/CreateTaskLog/feature.d.ts +4 -0
- package/api/features/CreateTaskLog/feature.js +11 -0
- package/api/features/CreateTaskLog/feature.js.map +1 -0
- package/api/features/CreateTaskLog/index.d.ts +2 -0
- package/api/features/CreateTaskLog/index.js +2 -0
- package/api/features/DeleteTask/DeleteTaskUseCase.d.ts +14 -0
- package/api/features/DeleteTask/DeleteTaskUseCase.js +34 -0
- package/api/features/DeleteTask/DeleteTaskUseCase.js.map +1 -0
- package/api/features/DeleteTask/abstractions.d.ts +17 -0
- package/api/features/DeleteTask/abstractions.js +5 -0
- package/api/features/DeleteTask/abstractions.js.map +1 -0
- package/api/features/DeleteTask/feature.d.ts +4 -0
- package/api/features/DeleteTask/feature.js +11 -0
- package/api/features/DeleteTask/feature.js.map +1 -0
- package/api/features/DeleteTask/index.d.ts +2 -0
- package/api/features/DeleteTask/index.js +2 -0
- package/api/features/DeleteTaskLog/DeleteTaskLogUseCase.d.ts +11 -0
- package/api/features/DeleteTaskLog/DeleteTaskLogUseCase.js +19 -0
- package/api/features/DeleteTaskLog/DeleteTaskLogUseCase.js.map +1 -0
- package/api/features/DeleteTaskLog/abstractions.d.ts +14 -0
- package/api/features/DeleteTaskLog/abstractions.js +5 -0
- package/api/features/DeleteTaskLog/abstractions.js.map +1 -0
- package/api/features/DeleteTaskLog/feature.d.ts +4 -0
- package/api/features/DeleteTaskLog/feature.js +11 -0
- package/api/features/DeleteTaskLog/feature.js.map +1 -0
- package/api/features/DeleteTaskLog/index.d.ts +2 -0
- package/api/features/DeleteTaskLog/index.js +2 -0
- package/api/features/GetLatestTaskLog/GetLatestTaskLogUseCase.d.ts +11 -0
- package/api/features/GetLatestTaskLog/GetLatestTaskLogUseCase.js +19 -0
- package/api/features/GetLatestTaskLog/GetLatestTaskLogUseCase.js.map +1 -0
- package/api/features/GetLatestTaskLog/abstractions.d.ts +15 -0
- package/api/features/GetLatestTaskLog/abstractions.js +5 -0
- package/api/features/GetLatestTaskLog/abstractions.js.map +1 -0
- package/api/features/GetLatestTaskLog/feature.d.ts +4 -0
- package/api/features/GetLatestTaskLog/feature.js +11 -0
- package/api/features/GetLatestTaskLog/feature.js.map +1 -0
- package/api/features/GetLatestTaskLog/index.d.ts +2 -0
- package/api/features/GetLatestTaskLog/index.js +2 -0
- package/api/features/{GetTaskDefinition/GetTaskDefinitionUseCase.d.ts → GetRunnableTaskDefinition/GetRunnableTaskDefinitionUseCase.d.ts} +5 -7
- package/api/features/GetRunnableTaskDefinition/GetRunnableTaskDefinitionUseCase.js +51 -0
- package/api/features/GetRunnableTaskDefinition/GetRunnableTaskDefinitionUseCase.js.map +1 -0
- package/api/features/{GetTaskDefinition → GetRunnableTaskDefinition}/abstractions.d.ts +7 -8
- package/api/features/GetRunnableTaskDefinition/abstractions.js +5 -0
- package/api/features/GetRunnableTaskDefinition/abstractions.js.map +1 -0
- package/api/features/GetRunnableTaskDefinition/feature.d.ts +4 -0
- package/api/features/GetRunnableTaskDefinition/feature.js +11 -0
- package/api/features/GetRunnableTaskDefinition/feature.js.map +1 -0
- package/api/features/GetRunnableTaskDefinition/index.d.ts +2 -0
- package/api/features/GetRunnableTaskDefinition/index.js +2 -0
- package/api/features/GetTask/GetTaskUseCase.d.ts +9 -5
- package/api/features/GetTask/GetTaskUseCase.js +12 -4
- package/api/features/GetTask/GetTaskUseCase.js.map +1 -1
- package/api/features/GetTask/abstractions.d.ts +9 -2
- package/api/features/GetTask/abstractions.js.map +1 -1
- package/api/features/GetTask/feature.js +2 -4
- package/api/features/GetTask/feature.js.map +1 -1
- package/api/features/ListTaskLogs/ListTaskLogsUseCase.d.ts +12 -0
- package/api/features/ListTaskLogs/ListTaskLogsUseCase.js +19 -0
- package/api/features/ListTaskLogs/ListTaskLogsUseCase.js.map +1 -0
- package/api/features/ListTaskLogs/abstractions.d.ts +15 -0
- package/api/features/ListTaskLogs/abstractions.js +5 -0
- package/api/features/ListTaskLogs/abstractions.js.map +1 -0
- package/api/features/ListTaskLogs/feature.d.ts +4 -0
- package/api/features/ListTaskLogs/feature.js +11 -0
- package/api/features/ListTaskLogs/feature.js.map +1 -0
- package/api/features/ListTaskLogs/index.d.ts +2 -0
- package/api/features/ListTaskLogs/index.js +2 -0
- package/api/features/ListTasks/ListTasksUseCase.d.ts +9 -6
- package/api/features/ListTasks/ListTasksUseCase.js +12 -4
- package/api/features/ListTasks/ListTasksUseCase.js.map +1 -1
- package/api/features/ListTasks/abstractions.d.ts +9 -3
- package/api/features/ListTasks/abstractions.js.map +1 -1
- package/api/features/ListTasks/feature.js +2 -4
- package/api/features/ListTasks/feature.js.map +1 -1
- package/api/features/ListVisibleTaskDefinitions/ListVisibleTaskDefinitionsUseCase.d.ts +11 -0
- package/api/features/ListVisibleTaskDefinitions/ListVisibleTaskDefinitionsUseCase.js +19 -0
- package/api/features/ListVisibleTaskDefinitions/ListVisibleTaskDefinitionsUseCase.js.map +1 -0
- package/api/features/ListVisibleTaskDefinitions/abstractions.d.ts +9 -0
- package/api/features/ListVisibleTaskDefinitions/abstractions.js +5 -0
- package/api/features/ListVisibleTaskDefinitions/abstractions.js.map +1 -0
- package/api/features/ListVisibleTaskDefinitions/feature.d.ts +4 -0
- package/api/features/ListVisibleTaskDefinitions/feature.js +11 -0
- package/api/features/ListVisibleTaskDefinitions/feature.js.map +1 -0
- package/api/features/ListVisibleTaskDefinitions/index.d.ts +2 -0
- package/api/features/ListVisibleTaskDefinitions/index.js +2 -0
- package/api/features/TaskService/BackgroundTaskService.d.ts +42 -0
- package/api/features/TaskService/BackgroundTaskService.js +211 -0
- package/api/features/TaskService/BackgroundTaskService.js.map +1 -0
- package/api/features/TaskService/feature.d.ts +4 -0
- package/api/features/TaskService/feature.js +11 -0
- package/api/features/TaskService/feature.js.map +1 -0
- package/api/features/TaskService/index.d.ts +1 -0
- package/api/features/TaskService/index.js +1 -0
- package/api/features/TriggerTask/abstractions.d.ts +6 -0
- package/api/features/TriggerTask/abstractions.js.map +1 -1
- package/api/features/TriggerVisibleTask/TriggerVisibleTaskUseCase.d.ts +15 -0
- package/api/features/TriggerVisibleTask/TriggerVisibleTaskUseCase.js +26 -0
- package/api/features/TriggerVisibleTask/TriggerVisibleTaskUseCase.js.map +1 -0
- package/api/features/TriggerVisibleTask/abstractions.d.ts +17 -0
- package/api/features/TriggerVisibleTask/abstractions.js +5 -0
- package/api/features/TriggerVisibleTask/abstractions.js.map +1 -0
- package/api/features/TriggerVisibleTask/feature.d.ts +4 -0
- package/api/features/TriggerVisibleTask/feature.js +11 -0
- package/api/features/TriggerVisibleTask/feature.js.map +1 -0
- package/api/features/TriggerVisibleTask/index.d.ts +2 -0
- package/api/features/TriggerVisibleTask/index.js +2 -0
- package/api/features/UpdateBackgroundTaskSettings/UpdateBackgroundTaskSettingsRepository.js +3 -1
- package/api/features/UpdateBackgroundTaskSettings/UpdateBackgroundTaskSettingsRepository.js.map +1 -1
- package/api/features/UpdateTask/UpdateTaskUseCase.d.ts +17 -0
- package/api/features/UpdateTask/UpdateTaskUseCase.js +36 -0
- package/api/features/UpdateTask/UpdateTaskUseCase.js.map +1 -0
- package/api/features/UpdateTask/abstractions.d.ts +22 -0
- package/api/features/UpdateTask/abstractions.js +5 -0
- package/api/features/UpdateTask/abstractions.js.map +1 -0
- package/api/features/UpdateTask/feature.d.ts +4 -0
- package/api/features/UpdateTask/feature.js +11 -0
- package/api/features/UpdateTask/feature.js.map +1 -0
- package/api/features/UpdateTask/index.d.ts +2 -0
- package/api/features/UpdateTask/index.js +2 -0
- package/api/features/UpdateTaskLog/UpdateTaskLogUseCase.d.ts +12 -0
- package/api/features/UpdateTaskLog/UpdateTaskLogUseCase.js +19 -0
- package/api/features/UpdateTaskLog/UpdateTaskLogUseCase.js.map +1 -0
- package/api/features/UpdateTaskLog/abstractions.d.ts +16 -0
- package/api/features/UpdateTaskLog/abstractions.js +5 -0
- package/api/features/UpdateTaskLog/abstractions.js.map +1 -0
- package/api/features/UpdateTaskLog/feature.d.ts +4 -0
- package/api/features/UpdateTaskLog/feature.js +11 -0
- package/api/features/UpdateTaskLog/feature.js.map +1 -0
- package/api/features/UpdateTaskLog/index.d.ts +2 -0
- package/api/features/UpdateTaskLog/index.js +2 -0
- package/api/graphql/BackgroundTasksGraphQLSchema.d.ts +29 -0
- package/api/graphql/BackgroundTasksGraphQLSchema.js +462 -0
- package/api/graphql/BackgroundTasksGraphQLSchema.js.map +1 -0
- package/api/index.d.ts +11 -2
- package/api/index.js +11 -2
- package/api/runner/TaskControl.d.ts +14 -4
- package/api/runner/TaskControl.js +29 -29
- package/api/runner/TaskControl.js.map +1 -1
- package/api/runner/TaskManager.js +3 -3
- package/api/runner/TaskManager.js.map +1 -1
- package/api/runner/TaskManagerStore.d.ts +14 -5
- package/api/runner/TaskManagerStore.js +23 -7
- package/api/runner/TaskManagerStore.js.map +1 -1
- package/api/runner/TaskRunner.js +14 -4
- package/api/runner/TaskRunner.js.map +1 -1
- package/api/types.d.ts +1 -48
- package/api/types.js.map +1 -1
- package/package.json +28 -30
- package/api/TasksCrud.d.ts +0 -10
- package/api/TasksCrud.js +0 -5
- package/api/TasksCrud.js.map +0 -1
- package/api/crud/cleanupTaskSubtree.d.ts +0 -8
- package/api/crud/cleanupTaskSubtree.js +0 -63
- package/api/crud/cleanupTaskSubtree.js.map +0 -1
- package/api/crud/crud.tasks.d.ts +0 -3
- package/api/crud/crud.tasks.js +0 -318
- package/api/crud/crud.tasks.js.map +0 -1
- package/api/crud/definition.tasks.d.ts +0 -3
- package/api/crud/definition.tasks.js +0 -17
- package/api/crud/definition.tasks.js.map +0 -1
- package/api/crud/service.tasks.d.ts +0 -3
- package/api/crud/service.tasks.js +0 -134
- package/api/crud/service.tasks.js.map +0 -1
- package/api/decorators/RunnableTaskDecorator.d.ts +0 -33
- package/api/decorators/RunnableTaskDecorator.js.map +0 -1
- package/api/decorators/SelfCleaningTaskDecorator.d.ts +0 -33
- package/api/decorators/SelfCleaningTaskDecorator.js.map +0 -1
- package/api/features/GetTaskDefinition/GetTaskDefinitionUseCase.js +0 -88
- package/api/features/GetTaskDefinition/GetTaskDefinitionUseCase.js.map +0 -1
- package/api/features/GetTaskDefinition/abstractions.js +0 -5
- package/api/features/GetTaskDefinition/abstractions.js.map +0 -1
- package/api/features/GetTaskDefinition/feature.js +0 -11
- package/api/features/GetTaskDefinition/feature.js.map +0 -1
- package/api/features/GetTaskDefinition/index.d.ts +0 -2
- package/api/features/GetTaskDefinition/index.js +0 -2
- package/api/graphql/BackgroundTasksContextualSchema.d.ts +0 -21
- package/api/graphql/BackgroundTasksContextualSchema.js +0 -369
- package/api/graphql/BackgroundTasksContextualSchema.js.map +0 -1
- package/api/service/createService.d.ts +0 -6
- package/api/service/createService.js +0 -11
- package/api/service/createService.js.map +0 -1
- package/api/service/index.d.ts +0 -1
- package/api/service/index.js +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"api/features/DeleteTask/DeleteTaskUseCase.js","sources":["../../../../src/api/features/DeleteTask/DeleteTaskUseCase.ts"],"sourcesContent":["import { Result } from \"@webiny/feature/api\";\nimport { EventPublisher } from \"@webiny/api-core/features/eventPublisher/index.js\";\nimport { DeleteTaskUseCase as UseCaseAbstraction } from \"./abstractions.js\";\nimport { TasksRepository } from \"~/api/domain/task/abstractions.js\";\nimport { TaskAfterDeleteEvent, TaskBeforeDeleteEvent } from \"~/api/events/index.js\";\n\nclass DeleteTaskUseCaseImpl implements UseCaseAbstraction.Interface {\n constructor(\n private readonly eventPublisher: EventPublisher.Interface,\n private readonly repository: TasksRepository.Interface\n ) {}\n\n async execute(id: string): Promise<Result<void, UseCaseAbstraction.Error>> {\n const task = await this.repository.get(id);\n if (task.isFail()) {\n return Result.fail(task.error);\n }\n\n await this.eventPublisher.publish(new TaskBeforeDeleteEvent({ task: task.value }));\n\n const result = await this.repository.delete(id);\n if (result.isFail()) {\n return Result.fail(result.error);\n }\n\n await this.eventPublisher.publish(new TaskAfterDeleteEvent({ task: task.value }));\n\n return Result.ok();\n }\n}\n\nexport const DeleteTaskUseCase = UseCaseAbstraction.createImplementation({\n implementation: DeleteTaskUseCaseImpl,\n dependencies: [EventPublisher, TasksRepository]\n});\n"],"names":["DeleteTaskUseCaseImpl","eventPublisher","repository","id","task","Result","TaskBeforeDeleteEvent","result","TaskAfterDeleteEvent","DeleteTaskUseCase","UseCaseAbstraction","EventPublisher","TasksRepository"],"mappings":";;;;;AAMA,MAAMA;IACF,YACqBC,cAAwC,EACxCC,UAAqC,CACxD;aAFmBD,cAAc,GAAdA;aACAC,UAAU,GAAVA;IAClB;IAEH,MAAM,QAAQC,EAAU,EAAmD;QACvE,MAAMC,OAAO,MAAM,IAAI,CAAC,UAAU,CAAC,GAAG,CAACD;QACvC,IAAIC,KAAK,MAAM,IACX,OAAOC,OAAO,IAAI,CAACD,KAAK,KAAK;QAGjC,MAAM,IAAI,CAAC,cAAc,CAAC,OAAO,CAAC,IAAIE,sBAAsB;YAAE,MAAMF,KAAK,KAAK;QAAC;QAE/E,MAAMG,SAAS,MAAM,IAAI,CAAC,UAAU,CAAC,MAAM,CAACJ;QAC5C,IAAII,OAAO,MAAM,IACb,OAAOF,OAAO,IAAI,CAACE,OAAO,KAAK;QAGnC,MAAM,IAAI,CAAC,cAAc,CAAC,OAAO,CAAC,IAAIC,qBAAqB;YAAE,MAAMJ,KAAK,KAAK;QAAC;QAE9E,OAAOC,OAAO,EAAE;IACpB;AACJ;AAEO,MAAMI,sCAAoBC,kBAAAA,oBAAuC,CAAC;IACrE,gBAAgBV;IAChB,cAAc;QAACW;QAAgBC;KAAgB;AACnD"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { type Result } from "@webiny/feature/api";
|
|
2
|
+
import type { BackgroundTaskPersistenceError, TaskNotFoundError } from "../../../api/domain/errors.js";
|
|
3
|
+
export interface IDeleteTaskUseCase {
|
|
4
|
+
execute(id: string): Promise<Result<void, UseCaseError>>;
|
|
5
|
+
}
|
|
6
|
+
export interface IDeleteTaskUseCaseErrors {
|
|
7
|
+
notFound: TaskNotFoundError;
|
|
8
|
+
persistence: BackgroundTaskPersistenceError;
|
|
9
|
+
}
|
|
10
|
+
type UseCaseError = IDeleteTaskUseCaseErrors[keyof IDeleteTaskUseCaseErrors];
|
|
11
|
+
/** Delete a single stored task. Its logs and child tasks stay; see CleanupTaskSubtreeUseCase. */
|
|
12
|
+
export declare const DeleteTaskUseCase: import("@webiny/di").Abstraction<IDeleteTaskUseCase>;
|
|
13
|
+
export declare namespace DeleteTaskUseCase {
|
|
14
|
+
type Interface = IDeleteTaskUseCase;
|
|
15
|
+
type Error = UseCaseError;
|
|
16
|
+
}
|
|
17
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"api/features/DeleteTask/abstractions.js","sources":["../../../../src/api/features/DeleteTask/abstractions.ts"],"sourcesContent":["import { createAbstraction, type Result } from \"@webiny/feature/api\";\nimport type { BackgroundTaskPersistenceError, TaskNotFoundError } from \"~/api/domain/errors.js\";\n\nexport interface IDeleteTaskUseCase {\n execute(id: string): Promise<Result<void, UseCaseError>>;\n}\n\nexport interface IDeleteTaskUseCaseErrors {\n notFound: TaskNotFoundError;\n persistence: BackgroundTaskPersistenceError;\n}\n\ntype UseCaseError = IDeleteTaskUseCaseErrors[keyof IDeleteTaskUseCaseErrors];\n\n/** Delete a single stored task. Its logs and child tasks stay; see CleanupTaskSubtreeUseCase. */\nexport const DeleteTaskUseCase = createAbstraction<IDeleteTaskUseCase>(\"Tasks/DeleteTaskUseCase\");\n\nexport namespace DeleteTaskUseCase {\n export type Interface = IDeleteTaskUseCase;\n export type Error = UseCaseError;\n}\n"],"names":["DeleteTaskUseCase","createAbstraction"],"mappings":";AAeO,MAAMA,oBAAoBC,kBAAsC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { createFeature } from "@webiny/feature/api";
|
|
2
|
+
import { DeleteTaskUseCase } from "./DeleteTaskUseCase.js";
|
|
3
|
+
const DeleteTaskFeature = createFeature({
|
|
4
|
+
name: "DeleteTask",
|
|
5
|
+
register (container) {
|
|
6
|
+
container.register(DeleteTaskUseCase);
|
|
7
|
+
}
|
|
8
|
+
});
|
|
9
|
+
export { DeleteTaskFeature };
|
|
10
|
+
|
|
11
|
+
//# sourceMappingURL=feature.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"api/features/DeleteTask/feature.js","sources":["../../../../src/api/features/DeleteTask/feature.ts"],"sourcesContent":["import { createFeature } from \"@webiny/feature/api\";\nimport { DeleteTaskUseCase } from \"./DeleteTaskUseCase.js\";\n\nexport const DeleteTaskFeature = createFeature({\n name: \"DeleteTask\",\n register(container) {\n container.register(DeleteTaskUseCase);\n }\n});\n"],"names":["DeleteTaskFeature","createFeature","container","DeleteTaskUseCase"],"mappings":";;AAGO,MAAMA,oBAAoBC,cAAc;IAC3C,MAAM;IACN,UAASC,SAAS;QACdA,UAAU,QAAQ,CAACC;IACvB;AACJ"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { DeleteTaskLogUseCase as UseCaseAbstraction } from "./abstractions.js";
|
|
2
|
+
import { TaskLogsRepository } from "../../../api/domain/task/abstractions.js";
|
|
3
|
+
declare class DeleteTaskLogUseCaseImpl implements UseCaseAbstraction.Interface {
|
|
4
|
+
private readonly repository;
|
|
5
|
+
constructor(repository: TaskLogsRepository.Interface);
|
|
6
|
+
execute(id: string): Promise<import("@webiny/feature/api/Result.js").Result<void, import("../../domain/errors.js").BackgroundTaskPersistenceError | import("../../domain/errors.js").TaskLogNotFoundError>>;
|
|
7
|
+
}
|
|
8
|
+
export declare const DeleteTaskLogUseCase: typeof DeleteTaskLogUseCaseImpl & {
|
|
9
|
+
__abstraction: import("@webiny/di").Abstraction<import("./abstractions.js").IDeleteTaskLogUseCase>;
|
|
10
|
+
};
|
|
11
|
+
export {};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { DeleteTaskLogUseCase } from "./abstractions.js";
|
|
2
|
+
import { TaskLogsRepository } from "../../domain/task/abstractions.js";
|
|
3
|
+
class DeleteTaskLogUseCaseImpl {
|
|
4
|
+
constructor(repository){
|
|
5
|
+
this.repository = repository;
|
|
6
|
+
}
|
|
7
|
+
execute(id) {
|
|
8
|
+
return this.repository.delete(id);
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
const DeleteTaskLogUseCase_DeleteTaskLogUseCase = DeleteTaskLogUseCase.createImplementation({
|
|
12
|
+
implementation: DeleteTaskLogUseCaseImpl,
|
|
13
|
+
dependencies: [
|
|
14
|
+
TaskLogsRepository
|
|
15
|
+
]
|
|
16
|
+
});
|
|
17
|
+
export { DeleteTaskLogUseCase_DeleteTaskLogUseCase as DeleteTaskLogUseCase };
|
|
18
|
+
|
|
19
|
+
//# sourceMappingURL=DeleteTaskLogUseCase.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"api/features/DeleteTaskLog/DeleteTaskLogUseCase.js","sources":["../../../../src/api/features/DeleteTaskLog/DeleteTaskLogUseCase.ts"],"sourcesContent":["import { DeleteTaskLogUseCase as UseCaseAbstraction } from \"./abstractions.js\";\nimport { TaskLogsRepository } from \"~/api/domain/task/abstractions.js\";\n\nclass DeleteTaskLogUseCaseImpl implements UseCaseAbstraction.Interface {\n constructor(private readonly repository: TaskLogsRepository.Interface) {}\n\n execute(id: string) {\n return this.repository.delete(id);\n }\n}\n\nexport const DeleteTaskLogUseCase = UseCaseAbstraction.createImplementation({\n implementation: DeleteTaskLogUseCaseImpl,\n dependencies: [TaskLogsRepository]\n});\n"],"names":["DeleteTaskLogUseCaseImpl","repository","id","DeleteTaskLogUseCase","UseCaseAbstraction","TaskLogsRepository"],"mappings":";;AAGA,MAAMA;IACF,YAA6BC,UAAwC,CAAE;aAA1CA,UAAU,GAAVA;IAA2C;IAExE,QAAQC,EAAU,EAAE;QAChB,OAAO,IAAI,CAAC,UAAU,CAAC,MAAM,CAACA;IAClC;AACJ;AAEO,MAAMC,4CAAuBC,qBAAAA,oBAAuC,CAAC;IACxE,gBAAgBJ;IAChB,cAAc;QAACK;KAAmB;AACtC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { Result } from "@webiny/feature/api";
|
|
2
|
+
import type { BackgroundTaskPersistenceError } from "../../../api/domain/errors.js";
|
|
3
|
+
import type { TaskLogNotFoundError } from "../../../api/domain/errors.js";
|
|
4
|
+
type UseCaseError = TaskLogNotFoundError | BackgroundTaskPersistenceError;
|
|
5
|
+
export interface IDeleteTaskLogUseCase {
|
|
6
|
+
execute(id: string): Promise<Result<void, UseCaseError>>;
|
|
7
|
+
}
|
|
8
|
+
/** Delete a task log. */
|
|
9
|
+
export declare const DeleteTaskLogUseCase: import("@webiny/di").Abstraction<IDeleteTaskLogUseCase>;
|
|
10
|
+
export declare namespace DeleteTaskLogUseCase {
|
|
11
|
+
type Interface = IDeleteTaskLogUseCase;
|
|
12
|
+
type Error = UseCaseError;
|
|
13
|
+
}
|
|
14
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"api/features/DeleteTaskLog/abstractions.js","sources":["../../../../src/api/features/DeleteTaskLog/abstractions.ts"],"sourcesContent":["import { createAbstraction } from \"@webiny/feature/api\";\nimport type { Result } from \"@webiny/feature/api\";\n\nimport type { BackgroundTaskPersistenceError } from \"~/api/domain/errors.js\";\nimport type { TaskLogNotFoundError } from \"~/api/domain/errors.js\";\n\ntype UseCaseError = TaskLogNotFoundError | BackgroundTaskPersistenceError;\n\nexport interface IDeleteTaskLogUseCase {\n execute(id: string): Promise<Result<void, UseCaseError>>;\n}\n\n/** Delete a task log. */\nexport const DeleteTaskLogUseCase = createAbstraction<IDeleteTaskLogUseCase>(\n \"Tasks/DeleteTaskLogUseCase\"\n);\n\nexport namespace DeleteTaskLogUseCase {\n export type Interface = IDeleteTaskLogUseCase;\n export type Error = UseCaseError;\n}\n"],"names":["DeleteTaskLogUseCase","createAbstraction"],"mappings":";AAaO,MAAMA,uBAAuBC,kBAChC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { createFeature } from "@webiny/feature/api";
|
|
2
|
+
import { DeleteTaskLogUseCase } from "./DeleteTaskLogUseCase.js";
|
|
3
|
+
const DeleteTaskLogFeature = createFeature({
|
|
4
|
+
name: "DeleteTaskLog",
|
|
5
|
+
register (container) {
|
|
6
|
+
container.register(DeleteTaskLogUseCase);
|
|
7
|
+
}
|
|
8
|
+
});
|
|
9
|
+
export { DeleteTaskLogFeature };
|
|
10
|
+
|
|
11
|
+
//# sourceMappingURL=feature.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"api/features/DeleteTaskLog/feature.js","sources":["../../../../src/api/features/DeleteTaskLog/feature.ts"],"sourcesContent":["import { createFeature } from \"@webiny/feature/api\";\nimport { DeleteTaskLogUseCase } from \"./DeleteTaskLogUseCase.js\";\n\nexport const DeleteTaskLogFeature = createFeature({\n name: \"DeleteTaskLog\",\n register(container) {\n container.register(DeleteTaskLogUseCase);\n }\n});\n"],"names":["DeleteTaskLogFeature","createFeature","container","DeleteTaskLogUseCase"],"mappings":";;AAGO,MAAMA,uBAAuBC,cAAc;IAC9C,MAAM;IACN,UAASC,SAAS;QACdA,UAAU,QAAQ,CAACC;IACvB;AACJ"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { GetLatestTaskLogUseCase as UseCaseAbstraction } from "./abstractions.js";
|
|
2
|
+
import { TaskLogsRepository } from "../../../api/domain/task/abstractions.js";
|
|
3
|
+
declare class GetLatestTaskLogUseCaseImpl implements UseCaseAbstraction.Interface {
|
|
4
|
+
private readonly repository;
|
|
5
|
+
constructor(repository: TaskLogsRepository.Interface);
|
|
6
|
+
execute(taskId: string): Promise<import("@webiny/feature/api/Result.js").Result<import("../../types.js").ITaskLog, import("../../domain/errors.js").BackgroundTaskPersistenceError | import("../../domain/errors.js").TaskLogNotFoundError>>;
|
|
7
|
+
}
|
|
8
|
+
export declare const GetLatestTaskLogUseCase: typeof GetLatestTaskLogUseCaseImpl & {
|
|
9
|
+
__abstraction: import("@webiny/di").Abstraction<import("./abstractions.js").IGetLatestTaskLogUseCase>;
|
|
10
|
+
};
|
|
11
|
+
export {};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { GetLatestTaskLogUseCase } from "./abstractions.js";
|
|
2
|
+
import { TaskLogsRepository } from "../../domain/task/abstractions.js";
|
|
3
|
+
class GetLatestTaskLogUseCaseImpl {
|
|
4
|
+
constructor(repository){
|
|
5
|
+
this.repository = repository;
|
|
6
|
+
}
|
|
7
|
+
execute(taskId) {
|
|
8
|
+
return this.repository.getLatest(taskId);
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
const GetLatestTaskLogUseCase_GetLatestTaskLogUseCase = GetLatestTaskLogUseCase.createImplementation({
|
|
12
|
+
implementation: GetLatestTaskLogUseCaseImpl,
|
|
13
|
+
dependencies: [
|
|
14
|
+
TaskLogsRepository
|
|
15
|
+
]
|
|
16
|
+
});
|
|
17
|
+
export { GetLatestTaskLogUseCase_GetLatestTaskLogUseCase as GetLatestTaskLogUseCase };
|
|
18
|
+
|
|
19
|
+
//# sourceMappingURL=GetLatestTaskLogUseCase.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"api/features/GetLatestTaskLog/GetLatestTaskLogUseCase.js","sources":["../../../../src/api/features/GetLatestTaskLog/GetLatestTaskLogUseCase.ts"],"sourcesContent":["import { GetLatestTaskLogUseCase as UseCaseAbstraction } from \"./abstractions.js\";\nimport { TaskLogsRepository } from \"~/api/domain/task/abstractions.js\";\n\nclass GetLatestTaskLogUseCaseImpl implements UseCaseAbstraction.Interface {\n constructor(private readonly repository: TaskLogsRepository.Interface) {}\n\n execute(taskId: string) {\n return this.repository.getLatest(taskId);\n }\n}\n\nexport const GetLatestTaskLogUseCase = UseCaseAbstraction.createImplementation({\n implementation: GetLatestTaskLogUseCaseImpl,\n dependencies: [TaskLogsRepository]\n});\n"],"names":["GetLatestTaskLogUseCaseImpl","repository","taskId","GetLatestTaskLogUseCase","UseCaseAbstraction","TaskLogsRepository"],"mappings":";;AAGA,MAAMA;IACF,YAA6BC,UAAwC,CAAE;aAA1CA,UAAU,GAAVA;IAA2C;IAExE,QAAQC,MAAc,EAAE;QACpB,OAAO,IAAI,CAAC,UAAU,CAAC,SAAS,CAACA;IACrC;AACJ;AAEO,MAAMC,kDAA0BC,wBAAAA,oBAAuC,CAAC;IAC3E,gBAAgBJ;IAChB,cAAc;QAACK;KAAmB;AACtC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { Result } from "@webiny/feature/api";
|
|
2
|
+
import type { ITaskLog } from "../../../api/types.js";
|
|
3
|
+
import type { BackgroundTaskPersistenceError } from "../../../api/domain/errors.js";
|
|
4
|
+
import type { TaskLogNotFoundError } from "../../../api/domain/errors.js";
|
|
5
|
+
type UseCaseError = TaskLogNotFoundError | BackgroundTaskPersistenceError;
|
|
6
|
+
export interface IGetLatestTaskLogUseCase {
|
|
7
|
+
execute(taskId: string): Promise<Result<ITaskLog, UseCaseError>>;
|
|
8
|
+
}
|
|
9
|
+
/** Get the most recent log of a task. Fails with TaskLogNotFoundError when the task has none yet. */
|
|
10
|
+
export declare const GetLatestTaskLogUseCase: import("@webiny/di").Abstraction<IGetLatestTaskLogUseCase>;
|
|
11
|
+
export declare namespace GetLatestTaskLogUseCase {
|
|
12
|
+
type Interface = IGetLatestTaskLogUseCase;
|
|
13
|
+
type Error = UseCaseError;
|
|
14
|
+
}
|
|
15
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"api/features/GetLatestTaskLog/abstractions.js","sources":["../../../../src/api/features/GetLatestTaskLog/abstractions.ts"],"sourcesContent":["import { createAbstraction } from \"@webiny/feature/api\";\nimport type { Result } from \"@webiny/feature/api\";\nimport type { ITaskLog } from \"~/api/types.js\";\nimport type { BackgroundTaskPersistenceError } from \"~/api/domain/errors.js\";\nimport type { TaskLogNotFoundError } from \"~/api/domain/errors.js\";\n\ntype UseCaseError = TaskLogNotFoundError | BackgroundTaskPersistenceError;\n\nexport interface IGetLatestTaskLogUseCase {\n execute(taskId: string): Promise<Result<ITaskLog, UseCaseError>>;\n}\n\n/** Get the most recent log of a task. Fails with TaskLogNotFoundError when the task has none yet. */\nexport const GetLatestTaskLogUseCase = createAbstraction<IGetLatestTaskLogUseCase>(\n \"Tasks/GetLatestTaskLogUseCase\"\n);\n\nexport namespace GetLatestTaskLogUseCase {\n export type Interface = IGetLatestTaskLogUseCase;\n export type Error = UseCaseError;\n}\n"],"names":["GetLatestTaskLogUseCase","createAbstraction"],"mappings":";AAaO,MAAMA,0BAA0BC,kBACnC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { createFeature } from "@webiny/feature/api";
|
|
2
|
+
import { GetLatestTaskLogUseCase } from "./GetLatestTaskLogUseCase.js";
|
|
3
|
+
const GetLatestTaskLogFeature = createFeature({
|
|
4
|
+
name: "GetLatestTaskLog",
|
|
5
|
+
register (container) {
|
|
6
|
+
container.register(GetLatestTaskLogUseCase);
|
|
7
|
+
}
|
|
8
|
+
});
|
|
9
|
+
export { GetLatestTaskLogFeature };
|
|
10
|
+
|
|
11
|
+
//# sourceMappingURL=feature.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"api/features/GetLatestTaskLog/feature.js","sources":["../../../../src/api/features/GetLatestTaskLog/feature.ts"],"sourcesContent":["import { createFeature } from \"@webiny/feature/api\";\nimport { GetLatestTaskLogUseCase } from \"./GetLatestTaskLogUseCase.js\";\n\nexport const GetLatestTaskLogFeature = createFeature({\n name: \"GetLatestTaskLog\",\n register(container) {\n container.register(GetLatestTaskLogUseCase);\n }\n});\n"],"names":["GetLatestTaskLogFeature","createFeature","container","GetLatestTaskLogUseCase"],"mappings":";;AAGO,MAAMA,0BAA0BC,cAAc;IACjD,MAAM;IACN,UAASC,SAAS;QACdA,UAAU,QAAQ,CAACC;IACvB;AACJ"}
|
|
@@ -1,15 +1,13 @@
|
|
|
1
1
|
import { Result } from "@webiny/feature/api";
|
|
2
|
-
import {
|
|
2
|
+
import { GetRunnableTaskDefinitionUseCase as UseCaseAbstraction } from "./abstractions.js";
|
|
3
3
|
import { TaskDefinition } from "@webiny/api-core/features/task/TaskDefinition/index.js";
|
|
4
4
|
import { TaskHandlerResolver } from "../../../api/features/TaskHandlerResolver/index.js";
|
|
5
|
-
|
|
6
|
-
export declare class GetTaskDefinitionUseCaseImpl implements UseCaseAbstraction.Interface {
|
|
5
|
+
export declare class GetRunnableTaskDefinitionUseCaseImpl implements UseCaseAbstraction.Interface {
|
|
7
6
|
private definitions;
|
|
8
7
|
private handlerResolver;
|
|
9
|
-
|
|
10
|
-
constructor(definitions: TaskDefinition.Interface[], handlerResolver: TaskHandlerResolver.Interface, logger: Logger.Interface);
|
|
8
|
+
constructor(definitions: TaskDefinition.Interface[], handlerResolver: TaskHandlerResolver.Interface);
|
|
11
9
|
execute<I extends TaskDefinition.TaskInput = TaskDefinition.TaskInput, O extends TaskDefinition.TaskOutput = TaskDefinition.TaskOutput>(id: string): Result<TaskDefinition.Runnable<I, O>, UseCaseAbstraction.Error>;
|
|
12
10
|
}
|
|
13
|
-
export declare const
|
|
14
|
-
__abstraction: import("@webiny/di").Abstraction<import("./abstractions.js").
|
|
11
|
+
export declare const GetRunnableTaskDefinitionUseCase: typeof GetRunnableTaskDefinitionUseCaseImpl & {
|
|
12
|
+
__abstraction: import("@webiny/di").Abstraction<import("./abstractions.js").IGetRunnableTaskDefinitionUseCase>;
|
|
15
13
|
};
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { Result } from "@webiny/feature/api";
|
|
2
|
+
import { GetRunnableTaskDefinitionUseCase } from "./abstractions.js";
|
|
3
|
+
import { TaskDefinition } from "@webiny/api-core/features/task/TaskDefinition/index.js";
|
|
4
|
+
import { TaskHandlerResolver } from "../TaskHandlerResolver/index.js";
|
|
5
|
+
import { TaskDefinitionNotFoundError } from "../../domain/errors.js";
|
|
6
|
+
class GetRunnableTaskDefinitionUseCaseImpl {
|
|
7
|
+
constructor(definitions, handlerResolver){
|
|
8
|
+
this.definitions = definitions;
|
|
9
|
+
this.handlerResolver = handlerResolver;
|
|
10
|
+
}
|
|
11
|
+
execute(id) {
|
|
12
|
+
for (const definition of this.definitions){
|
|
13
|
+
if (definition.id !== id) continue;
|
|
14
|
+
const handlerClass = definition.handler;
|
|
15
|
+
const handler = this.handlerResolver.resolve(handlerClass);
|
|
16
|
+
const runnable = {
|
|
17
|
+
id: definition.id,
|
|
18
|
+
title: definition.title,
|
|
19
|
+
description: definition.description,
|
|
20
|
+
isPrivate: definition.isPrivate,
|
|
21
|
+
databaseLogs: definition.databaseLogs,
|
|
22
|
+
maxIterations: definition.maxIterations,
|
|
23
|
+
selfCleanup: definition.selfCleanup,
|
|
24
|
+
run: handler.run.bind(handler),
|
|
25
|
+
onBeforeTrigger: handler.onBeforeTrigger?.bind(handler),
|
|
26
|
+
onDone: handler.onDone?.bind(handler),
|
|
27
|
+
onError: handler.onError?.bind(handler),
|
|
28
|
+
onAbort: handler.onAbort?.bind(handler),
|
|
29
|
+
onMaxIterations: handler.onMaxIterations?.bind(handler),
|
|
30
|
+
createInputValidation: handler.createInputValidation?.bind(handler)
|
|
31
|
+
};
|
|
32
|
+
return Result.ok(runnable);
|
|
33
|
+
}
|
|
34
|
+
return Result.fail(new TaskDefinitionNotFoundError(id));
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
const GetRunnableTaskDefinitionUseCase_GetRunnableTaskDefinitionUseCase = GetRunnableTaskDefinitionUseCase.createImplementation({
|
|
38
|
+
implementation: GetRunnableTaskDefinitionUseCaseImpl,
|
|
39
|
+
dependencies: [
|
|
40
|
+
[
|
|
41
|
+
TaskDefinition,
|
|
42
|
+
{
|
|
43
|
+
multiple: true
|
|
44
|
+
}
|
|
45
|
+
],
|
|
46
|
+
TaskHandlerResolver
|
|
47
|
+
]
|
|
48
|
+
});
|
|
49
|
+
export { GetRunnableTaskDefinitionUseCaseImpl, GetRunnableTaskDefinitionUseCase_GetRunnableTaskDefinitionUseCase as GetRunnableTaskDefinitionUseCase };
|
|
50
|
+
|
|
51
|
+
//# sourceMappingURL=GetRunnableTaskDefinitionUseCase.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"api/features/GetRunnableTaskDefinition/GetRunnableTaskDefinitionUseCase.js","sources":["../../../../src/api/features/GetRunnableTaskDefinition/GetRunnableTaskDefinitionUseCase.ts"],"sourcesContent":["import { Result } from \"@webiny/feature/api\";\nimport type { Constructor } from \"@webiny/di\";\nimport { GetRunnableTaskDefinitionUseCase as UseCaseAbstraction } from \"./abstractions.js\";\nimport { TaskDefinition } from \"@webiny/api-core/features/task/TaskDefinition/index.js\";\nimport { TaskHandlerResolver } from \"~/api/features/TaskHandlerResolver/index.js\";\nimport { TaskDefinitionNotFoundError } from \"~/api/domain/errors.js\";\n\nexport class GetRunnableTaskDefinitionUseCaseImpl implements UseCaseAbstraction.Interface {\n public constructor(\n private definitions: TaskDefinition.Interface[],\n private handlerResolver: TaskHandlerResolver.Interface\n ) {}\n\n public execute<\n I extends TaskDefinition.TaskInput = TaskDefinition.TaskInput,\n O extends TaskDefinition.TaskOutput = TaskDefinition.TaskOutput\n >(id: string): Result<TaskDefinition.Runnable<I, O>, UseCaseAbstraction.Error> {\n for (const definition of this.definitions) {\n if (definition.id !== id) {\n continue;\n }\n\n // Every definition is free to build, so reaching this point cost nothing. The handler is\n // the expensive half and it is built only now, for the one task that was asked for.\n //\n // The registered definition is stored under the abstraction's default generics, so its\n // handler cannot be proven assignable to the caller's narrower <I, O>.\n const handlerClass = definition.handler as Constructor<TaskDefinition.Handler<I, O>>;\n const handler = this.handlerResolver.resolve(handlerClass);\n\n // Present the two halves as the single object the runner and\n // `context.tasks.getDefinition()` expect. Metadata from the definition, behaviour from\n // the handler, bound so `this` inside a hook is still the instance that owns the\n // injected dependencies.\n const runnable: TaskDefinition.Runnable<I, O> = {\n id: definition.id,\n title: definition.title,\n description: definition.description,\n isPrivate: definition.isPrivate as boolean,\n databaseLogs: definition.databaseLogs as boolean,\n maxIterations: definition.maxIterations as number,\n selfCleanup: definition.selfCleanup,\n\n run: handler.run.bind(handler),\n onBeforeTrigger: handler.onBeforeTrigger?.bind(handler),\n onDone: handler.onDone?.bind(handler),\n onError: handler.onError?.bind(handler),\n onAbort: handler.onAbort?.bind(handler),\n onMaxIterations: handler.onMaxIterations?.bind(handler),\n createInputValidation: handler.createInputValidation?.bind(handler)\n };\n\n return Result.ok(runnable);\n }\n\n return Result.fail(new TaskDefinitionNotFoundError(id));\n }\n}\n\nexport const GetRunnableTaskDefinitionUseCase = UseCaseAbstraction.createImplementation({\n implementation: GetRunnableTaskDefinitionUseCaseImpl,\n dependencies: [[TaskDefinition, { multiple: true }], TaskHandlerResolver]\n});\n"],"names":["GetRunnableTaskDefinitionUseCaseImpl","definitions","handlerResolver","id","definition","handlerClass","handler","runnable","Result","TaskDefinitionNotFoundError","GetRunnableTaskDefinitionUseCase","UseCaseAbstraction","TaskDefinition","TaskHandlerResolver"],"mappings":";;;;;AAOO,MAAMA;IACT,YACYC,WAAuC,EACvCC,eAA8C,CACxD;aAFUD,WAAW,GAAXA;aACAC,eAAe,GAAfA;IACT;IAEI,QAGLC,EAAU,EAAmE;QAC3E,KAAK,MAAMC,cAAc,IAAI,CAAC,WAAW,CAAE;YACvC,IAAIA,WAAW,EAAE,KAAKD,IAClB;YAQJ,MAAME,eAAeD,WAAW,OAAO;YACvC,MAAME,UAAU,IAAI,CAAC,eAAe,CAAC,OAAO,CAACD;YAM7C,MAAME,WAA0C;gBAC5C,IAAIH,WAAW,EAAE;gBACjB,OAAOA,WAAW,KAAK;gBACvB,aAAaA,WAAW,WAAW;gBACnC,WAAWA,WAAW,SAAS;gBAC/B,cAAcA,WAAW,YAAY;gBACrC,eAAeA,WAAW,aAAa;gBACvC,aAAaA,WAAW,WAAW;gBAEnC,KAAKE,QAAQ,GAAG,CAAC,IAAI,CAACA;gBACtB,iBAAiBA,QAAQ,eAAe,EAAE,KAAKA;gBAC/C,QAAQA,QAAQ,MAAM,EAAE,KAAKA;gBAC7B,SAASA,QAAQ,OAAO,EAAE,KAAKA;gBAC/B,SAASA,QAAQ,OAAO,EAAE,KAAKA;gBAC/B,iBAAiBA,QAAQ,eAAe,EAAE,KAAKA;gBAC/C,uBAAuBA,QAAQ,qBAAqB,EAAE,KAAKA;YAC/D;YAEA,OAAOE,OAAO,EAAE,CAACD;QACrB;QAEA,OAAOC,OAAO,IAAI,CAAC,IAAIC,4BAA4BN;IACvD;AACJ;AAEO,MAAMO,oEAAmCC,iCAAAA,oBAAuC,CAAC;IACpF,gBAAgBX;IAChB,cAAc;QAAC;YAACY;YAAgB;gBAAE,UAAU;YAAK;SAAE;QAAEC;KAAoB;AAC7E"}
|
|
@@ -1,17 +1,16 @@
|
|
|
1
1
|
import type { Result } from "@webiny/feature/api";
|
|
2
2
|
import type { TaskDefinition } from "@webiny/api-core/features/task/TaskDefinition/index.js";
|
|
3
|
-
import type { TaskDefinitionNotFoundError
|
|
4
|
-
export interface
|
|
3
|
+
import type { TaskDefinitionNotFoundError } from "../../../api/domain/errors.js";
|
|
4
|
+
export interface IGetRunnableTaskDefinitionUseCase {
|
|
5
5
|
execute<I extends TaskDefinition.TaskInput = TaskDefinition.TaskInput, O extends TaskDefinition.TaskOutput = TaskDefinition.TaskOutput>(id: string): Result<TaskDefinition.Runnable<I, O>, UseCaseError>;
|
|
6
6
|
}
|
|
7
|
-
export interface
|
|
7
|
+
export interface IGetRunnableTaskDefinitionUseCaseErrors {
|
|
8
8
|
notFound: TaskDefinitionNotFoundError;
|
|
9
|
-
notRunnable: TaskDefinitionNotRunnableError;
|
|
10
9
|
}
|
|
11
|
-
type UseCaseError =
|
|
12
|
-
export declare const
|
|
13
|
-
export declare namespace
|
|
14
|
-
type Interface =
|
|
10
|
+
type UseCaseError = IGetRunnableTaskDefinitionUseCaseErrors[keyof IGetRunnableTaskDefinitionUseCaseErrors];
|
|
11
|
+
export declare const GetRunnableTaskDefinitionUseCase: import("@webiny/di").Abstraction<IGetRunnableTaskDefinitionUseCase>;
|
|
12
|
+
export declare namespace GetRunnableTaskDefinitionUseCase {
|
|
13
|
+
type Interface = IGetRunnableTaskDefinitionUseCase;
|
|
15
14
|
type Error = UseCaseError;
|
|
16
15
|
type Return<I extends TaskDefinition.TaskInput = TaskDefinition.TaskInput, O extends TaskDefinition.TaskOutput = TaskDefinition.TaskOutput> = Result<TaskDefinition.Runnable<I, O>, UseCaseError>;
|
|
17
16
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"api/features/GetRunnableTaskDefinition/abstractions.js","sources":["../../../../src/api/features/GetRunnableTaskDefinition/abstractions.ts"],"sourcesContent":["import { createAbstraction } from \"@webiny/feature/api\";\nimport type { Result } from \"@webiny/feature/api\";\nimport type { TaskDefinition } from \"@webiny/api-core/features/task/TaskDefinition/index.js\";\nimport type { TaskDefinitionNotFoundError } from \"~/api/domain/errors.js\";\n\nexport interface IGetRunnableTaskDefinitionUseCase {\n execute<\n I extends TaskDefinition.TaskInput = TaskDefinition.TaskInput,\n O extends TaskDefinition.TaskOutput = TaskDefinition.TaskOutput\n >(\n id: string\n ): Result<TaskDefinition.Runnable<I, O>, UseCaseError>;\n}\n\nexport interface IGetRunnableTaskDefinitionUseCaseErrors {\n notFound: TaskDefinitionNotFoundError;\n}\n\ntype UseCaseError =\n IGetRunnableTaskDefinitionUseCaseErrors[keyof IGetRunnableTaskDefinitionUseCaseErrors];\n\nexport const GetRunnableTaskDefinitionUseCase =\n createAbstraction<IGetRunnableTaskDefinitionUseCase>(\"Tasks/GetRunnableTaskDefinitionUseCase\");\n\nexport namespace GetRunnableTaskDefinitionUseCase {\n export type Interface = IGetRunnableTaskDefinitionUseCase;\n\n export type Error = UseCaseError;\n export type Return<\n I extends TaskDefinition.TaskInput = TaskDefinition.TaskInput,\n O extends TaskDefinition.TaskOutput = TaskDefinition.TaskOutput\n > = Result<TaskDefinition.Runnable<I, O>, UseCaseError>;\n}\n"],"names":["GetRunnableTaskDefinitionUseCase","createAbstraction"],"mappings":";AAqBO,MAAMA,mCACTC,kBAAqD"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { createFeature } from "@webiny/feature/api";
|
|
2
|
+
import { GetRunnableTaskDefinitionUseCase } from "./GetRunnableTaskDefinitionUseCase.js";
|
|
3
|
+
const GetRunnableTaskDefinitionFeature = createFeature({
|
|
4
|
+
name: "GetRunnableTaskDefinition",
|
|
5
|
+
register (container) {
|
|
6
|
+
container.register(GetRunnableTaskDefinitionUseCase);
|
|
7
|
+
}
|
|
8
|
+
});
|
|
9
|
+
export { GetRunnableTaskDefinitionFeature };
|
|
10
|
+
|
|
11
|
+
//# sourceMappingURL=feature.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"api/features/GetRunnableTaskDefinition/feature.js","sources":["../../../../src/api/features/GetRunnableTaskDefinition/feature.ts"],"sourcesContent":["import { createFeature } from \"@webiny/feature/api\";\nimport { GetRunnableTaskDefinitionUseCase } from \"./GetRunnableTaskDefinitionUseCase.js\";\n\nexport const GetRunnableTaskDefinitionFeature = createFeature({\n name: \"GetRunnableTaskDefinition\",\n register(container) {\n container.register(GetRunnableTaskDefinitionUseCase);\n }\n});\n"],"names":["GetRunnableTaskDefinitionFeature","createFeature","container","GetRunnableTaskDefinitionUseCase"],"mappings":";;AAGO,MAAMA,mCAAmCC,cAAc;IAC1D,MAAM;IACN,UAASC,SAAS;QACdA,UAAU,QAAQ,CAACC;IACvB;AACJ"}
|
|
@@ -1,9 +1,13 @@
|
|
|
1
1
|
import { GetTaskUseCase as UseCaseAbstraction } from "./abstractions.js";
|
|
2
2
|
import { TaskDefinition } from "@webiny/api-core/features/task/TaskDefinition/index.js";
|
|
3
3
|
import { TaskService } from "@webiny/api-core/features/task/TaskService/index.js";
|
|
4
|
-
import
|
|
5
|
-
|
|
6
|
-
private
|
|
7
|
-
constructor(
|
|
8
|
-
execute<I extends TaskDefinition.TaskInput = TaskDefinition.TaskInput, O extends TaskService.GenericOutput = TaskService.GenericOutput>(id: string):
|
|
4
|
+
import { TasksRepository } from "../../../api/domain/task/abstractions.js";
|
|
5
|
+
declare class GetTaskUseCaseImpl implements UseCaseAbstraction.Interface {
|
|
6
|
+
private readonly repository;
|
|
7
|
+
constructor(repository: TasksRepository.Interface);
|
|
8
|
+
execute<I extends TaskDefinition.TaskInput = TaskDefinition.TaskInput, O extends TaskService.GenericOutput = TaskService.GenericOutput>(id: string): UseCaseAbstraction.Return<I, O>;
|
|
9
9
|
}
|
|
10
|
+
export declare const GetTaskUseCase: typeof GetTaskUseCaseImpl & {
|
|
11
|
+
__abstraction: import("@webiny/di").Abstraction<import("./abstractions.js").IGetTaskUseCase>;
|
|
12
|
+
};
|
|
13
|
+
export {};
|
|
@@ -1,11 +1,19 @@
|
|
|
1
|
+
import { GetTaskUseCase } from "./abstractions.js";
|
|
2
|
+
import { TasksRepository } from "../../domain/task/abstractions.js";
|
|
1
3
|
class GetTaskUseCaseImpl {
|
|
2
|
-
constructor(
|
|
3
|
-
this.
|
|
4
|
+
constructor(repository){
|
|
5
|
+
this.repository = repository;
|
|
4
6
|
}
|
|
5
7
|
async execute(id) {
|
|
6
|
-
return
|
|
8
|
+
return this.repository.get(id);
|
|
7
9
|
}
|
|
8
10
|
}
|
|
9
|
-
|
|
11
|
+
const GetTaskUseCase_GetTaskUseCase = GetTaskUseCase.createImplementation({
|
|
12
|
+
implementation: GetTaskUseCaseImpl,
|
|
13
|
+
dependencies: [
|
|
14
|
+
TasksRepository
|
|
15
|
+
]
|
|
16
|
+
});
|
|
17
|
+
export { GetTaskUseCase_GetTaskUseCase as GetTaskUseCase };
|
|
10
18
|
|
|
11
19
|
//# sourceMappingURL=GetTaskUseCase.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"api/features/GetTask/GetTaskUseCase.js","sources":["../../../../src/api/features/GetTask/GetTaskUseCase.ts"],"sourcesContent":["import { GetTaskUseCase as UseCaseAbstraction } from \"./abstractions.js\";\nimport { TaskDefinition } from \"@webiny/api-core/features/task/TaskDefinition/index.js\";\nimport { TaskService } from \"@webiny/api-core/features/task/TaskService/index.js\";\nimport
|
|
1
|
+
{"version":3,"file":"api/features/GetTask/GetTaskUseCase.js","sources":["../../../../src/api/features/GetTask/GetTaskUseCase.ts"],"sourcesContent":["import { GetTaskUseCase as UseCaseAbstraction } from \"./abstractions.js\";\nimport { TaskDefinition } from \"@webiny/api-core/features/task/TaskDefinition/index.js\";\nimport { TaskService } from \"@webiny/api-core/features/task/TaskService/index.js\";\nimport { TasksRepository } from \"~/api/domain/task/abstractions.js\";\n\nclass GetTaskUseCaseImpl implements UseCaseAbstraction.Interface {\n public constructor(private readonly repository: TasksRepository.Interface) {}\n\n async execute<\n I extends TaskDefinition.TaskInput = TaskDefinition.TaskInput,\n O extends TaskService.GenericOutput = TaskService.GenericOutput\n >(id: string): UseCaseAbstraction.Return<I, O> {\n return this.repository.get<I, O>(id);\n }\n}\n\nexport const GetTaskUseCase = UseCaseAbstraction.createImplementation({\n implementation: GetTaskUseCaseImpl,\n dependencies: [TasksRepository]\n});\n"],"names":["GetTaskUseCaseImpl","repository","id","GetTaskUseCase","UseCaseAbstraction","TasksRepository"],"mappings":";;AAKA,MAAMA;IACF,YAAoCC,UAAqC,CAAE;aAAvCA,UAAU,GAAVA;IAAwC;IAE5E,MAAM,QAGJC,EAAU,EAAmC;QAC3C,OAAO,IAAI,CAAC,UAAU,CAAC,GAAG,CAAOA;IACrC;AACJ;AAEO,MAAMC,gCAAiBC,eAAAA,oBAAuC,CAAC;IAClE,gBAAgBJ;IAChB,cAAc;QAACK;KAAgB;AACnC"}
|
|
@@ -1,10 +1,17 @@
|
|
|
1
|
+
import type { Result } from "@webiny/feature/api";
|
|
1
2
|
import { TaskService } from "@webiny/api-core/features/task/TaskService/index.js";
|
|
2
3
|
import { TaskDefinition } from "@webiny/api-core/features/task/TaskDefinition/index.js";
|
|
4
|
+
import type { BackgroundTaskPersistenceError } from "../../../api/domain/errors.js";
|
|
5
|
+
import type { TaskNotFoundError } from "../../../api/domain/errors.js";
|
|
6
|
+
type UseCaseError = TaskNotFoundError | BackgroundTaskPersistenceError;
|
|
3
7
|
export interface IGetTaskUseCase {
|
|
4
|
-
execute<I extends TaskDefinition.TaskInput = TaskDefinition.TaskInput, O extends TaskService.GenericOutput = TaskService.GenericOutput>(id: string): Promise<TaskService.Task<I, O
|
|
8
|
+
execute<I extends TaskDefinition.TaskInput = TaskDefinition.TaskInput, O extends TaskService.GenericOutput = TaskService.GenericOutput>(id: string): Promise<Result<TaskService.Task<I, O>, UseCaseError>>;
|
|
5
9
|
}
|
|
10
|
+
/** Get a single task. Fails with TaskNotFoundError when it doesn't exist. */
|
|
6
11
|
export declare const GetTaskUseCase: import("@webiny/di").Abstraction<IGetTaskUseCase>;
|
|
7
12
|
export declare namespace GetTaskUseCase {
|
|
8
13
|
type Interface = IGetTaskUseCase;
|
|
9
|
-
type
|
|
14
|
+
type Error = UseCaseError;
|
|
15
|
+
type Return<I extends TaskDefinition.TaskInput = TaskDefinition.TaskInput, O extends TaskService.GenericOutput = TaskService.GenericOutput> = Promise<Result<TaskService.Task<I, O>, UseCaseError>>;
|
|
10
16
|
}
|
|
17
|
+
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"api/features/GetTask/abstractions.js","sources":["../../../../src/api/features/GetTask/abstractions.ts"],"sourcesContent":["import { createAbstraction } from \"@webiny/feature/api\";\nimport { TaskService } from \"@webiny/api-core/features/task/TaskService/index.js\";\nimport { TaskDefinition } from \"@webiny/api-core/features/task/TaskDefinition/index.js\";\n\nexport interface IGetTaskUseCase {\n execute<\n I extends TaskDefinition.TaskInput = TaskDefinition.TaskInput,\n O extends TaskService.GenericOutput = TaskService.GenericOutput\n >(\n id: string\n ): Promise<TaskService.Task<I, O
|
|
1
|
+
{"version":3,"file":"api/features/GetTask/abstractions.js","sources":["../../../../src/api/features/GetTask/abstractions.ts"],"sourcesContent":["import { createAbstraction } from \"@webiny/feature/api\";\nimport type { Result } from \"@webiny/feature/api\";\nimport { TaskService } from \"@webiny/api-core/features/task/TaskService/index.js\";\nimport { TaskDefinition } from \"@webiny/api-core/features/task/TaskDefinition/index.js\";\nimport type { BackgroundTaskPersistenceError } from \"~/api/domain/errors.js\";\nimport type { TaskNotFoundError } from \"~/api/domain/errors.js\";\n\ntype UseCaseError = TaskNotFoundError | BackgroundTaskPersistenceError;\n\nexport interface IGetTaskUseCase {\n execute<\n I extends TaskDefinition.TaskInput = TaskDefinition.TaskInput,\n O extends TaskService.GenericOutput = TaskService.GenericOutput\n >(\n id: string\n ): Promise<Result<TaskService.Task<I, O>, UseCaseError>>;\n}\n\n/** Get a single task. Fails with TaskNotFoundError when it doesn't exist. */\nexport const GetTaskUseCase = createAbstraction<IGetTaskUseCase>(\"Tasks/GetTaskUseCase\");\n\nexport namespace GetTaskUseCase {\n export type Interface = IGetTaskUseCase;\n export type Error = UseCaseError;\n\n export type Return<\n I extends TaskDefinition.TaskInput = TaskDefinition.TaskInput,\n O extends TaskService.GenericOutput = TaskService.GenericOutput\n > = Promise<Result<TaskService.Task<I, O>, UseCaseError>>;\n}\n"],"names":["GetTaskUseCase","createAbstraction"],"mappings":";AAmBO,MAAMA,iBAAiBC,kBAAmC"}
|
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
import { createFeature } from "@webiny/feature/api";
|
|
2
|
-
import {
|
|
3
|
-
import { GetTaskUseCase } from "./abstractions.js";
|
|
4
|
-
import { TasksCrud } from "../../TasksCrud.js";
|
|
2
|
+
import { GetTaskUseCase } from "./GetTaskUseCase.js";
|
|
5
3
|
const GetTaskFeature = createFeature({
|
|
6
4
|
name: "GetTask",
|
|
7
5
|
register (container) {
|
|
8
|
-
container.
|
|
6
|
+
container.register(GetTaskUseCase);
|
|
9
7
|
}
|
|
10
8
|
});
|
|
11
9
|
export { GetTaskFeature };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"api/features/GetTask/feature.js","sources":["../../../../src/api/features/GetTask/feature.ts"],"sourcesContent":["import { createFeature } from \"@webiny/feature/api\";\nimport {
|
|
1
|
+
{"version":3,"file":"api/features/GetTask/feature.js","sources":["../../../../src/api/features/GetTask/feature.ts"],"sourcesContent":["import { createFeature } from \"@webiny/feature/api\";\nimport { GetTaskUseCase } from \"./GetTaskUseCase.js\";\n\nexport const GetTaskFeature = createFeature({\n name: \"GetTask\",\n register(container) {\n container.register(GetTaskUseCase);\n }\n});\n"],"names":["GetTaskFeature","createFeature","container","GetTaskUseCase"],"mappings":";;AAGO,MAAMA,iBAAiBC,cAAc;IACxC,MAAM;IACN,UAASC,SAAS;QACdA,UAAU,QAAQ,CAACC;IACvB;AACJ"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { ListTaskLogsUseCase as UseCaseAbstraction } from "./abstractions.js";
|
|
2
|
+
import { TaskLogsRepository } from "../../../api/domain/task/abstractions.js";
|
|
3
|
+
import type { IListTaskLogParams } from "../../../api/types.js";
|
|
4
|
+
declare class ListTaskLogsUseCaseImpl implements UseCaseAbstraction.Interface {
|
|
5
|
+
private readonly repository;
|
|
6
|
+
constructor(repository: TaskLogsRepository.Interface);
|
|
7
|
+
execute(params: IListTaskLogParams): Promise<import("@webiny/feature/api/Result.js").Result<import("~/api/types.js").IListTaskLogsResponse, import("../../domain/errors.js").BackgroundTaskPersistenceError>>;
|
|
8
|
+
}
|
|
9
|
+
export declare const ListTaskLogsUseCase: typeof ListTaskLogsUseCaseImpl & {
|
|
10
|
+
__abstraction: import("@webiny/di").Abstraction<import("./abstractions.js").IListTaskLogsUseCase>;
|
|
11
|
+
};
|
|
12
|
+
export {};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { ListTaskLogsUseCase } from "./abstractions.js";
|
|
2
|
+
import { TaskLogsRepository } from "../../domain/task/abstractions.js";
|
|
3
|
+
class ListTaskLogsUseCaseImpl {
|
|
4
|
+
constructor(repository){
|
|
5
|
+
this.repository = repository;
|
|
6
|
+
}
|
|
7
|
+
execute(params) {
|
|
8
|
+
return this.repository.list(params);
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
const ListTaskLogsUseCase_ListTaskLogsUseCase = ListTaskLogsUseCase.createImplementation({
|
|
12
|
+
implementation: ListTaskLogsUseCaseImpl,
|
|
13
|
+
dependencies: [
|
|
14
|
+
TaskLogsRepository
|
|
15
|
+
]
|
|
16
|
+
});
|
|
17
|
+
export { ListTaskLogsUseCase_ListTaskLogsUseCase as ListTaskLogsUseCase };
|
|
18
|
+
|
|
19
|
+
//# sourceMappingURL=ListTaskLogsUseCase.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"api/features/ListTaskLogs/ListTaskLogsUseCase.js","sources":["../../../../src/api/features/ListTaskLogs/ListTaskLogsUseCase.ts"],"sourcesContent":["import { ListTaskLogsUseCase as UseCaseAbstraction } from \"./abstractions.js\";\nimport { TaskLogsRepository } from \"~/api/domain/task/abstractions.js\";\nimport type { IListTaskLogParams } from \"~/api/types.js\";\n\nclass ListTaskLogsUseCaseImpl implements UseCaseAbstraction.Interface {\n constructor(private readonly repository: TaskLogsRepository.Interface) {}\n\n execute(params: IListTaskLogParams) {\n return this.repository.list(params);\n }\n}\n\nexport const ListTaskLogsUseCase = UseCaseAbstraction.createImplementation({\n implementation: ListTaskLogsUseCaseImpl,\n dependencies: [TaskLogsRepository]\n});\n"],"names":["ListTaskLogsUseCaseImpl","repository","params","ListTaskLogsUseCase","UseCaseAbstraction","TaskLogsRepository"],"mappings":";;AAIA,MAAMA;IACF,YAA6BC,UAAwC,CAAE;aAA1CA,UAAU,GAAVA;IAA2C;IAExE,QAAQC,MAA0B,EAAE;QAChC,OAAO,IAAI,CAAC,UAAU,CAAC,IAAI,CAACA;IAChC;AACJ;AAEO,MAAMC,0CAAsBC,oBAAAA,oBAAuC,CAAC;IACvE,gBAAgBJ;IAChB,cAAc;QAACK;KAAmB;AACtC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { Result } from "@webiny/feature/api";
|
|
2
|
+
import type { IListTaskLogParams } from "../../../api/types.js";
|
|
3
|
+
import type { IListTaskLogsResponse } from "../../../api/types.js";
|
|
4
|
+
import type { BackgroundTaskPersistenceError } from "../../../api/domain/errors.js";
|
|
5
|
+
type UseCaseError = BackgroundTaskPersistenceError;
|
|
6
|
+
export interface IListTaskLogsUseCase {
|
|
7
|
+
execute(params: IListTaskLogParams): Promise<Result<IListTaskLogsResponse, UseCaseError>>;
|
|
8
|
+
}
|
|
9
|
+
/** List task logs. */
|
|
10
|
+
export declare const ListTaskLogsUseCase: import("@webiny/di").Abstraction<IListTaskLogsUseCase>;
|
|
11
|
+
export declare namespace ListTaskLogsUseCase {
|
|
12
|
+
type Interface = IListTaskLogsUseCase;
|
|
13
|
+
type Error = UseCaseError;
|
|
14
|
+
}
|
|
15
|
+
export {};
|