@webiny/tasks 6.4.0-beta.0 → 6.4.0-beta.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/context.js +13 -7
- package/context.js.map +1 -1
- package/package.json +15 -15
package/context.js
CHANGED
|
@@ -14,10 +14,9 @@ import { GetTaskDefinitionFeature } from "./features/GetTaskDefinition/feature.j
|
|
|
14
14
|
import { ListTaskDefinitionsFeature } from "./features/ListTaskDefinitions/feature.js";
|
|
15
15
|
import { CleanupTaskSubtreeUseCase, CleanupTaskSubtreeUseCaseImpl } from "./features/CleanupTaskSubtree/index.js";
|
|
16
16
|
import { TestingRunTaskDefinition } from "./tasks/testingRunTask.js";
|
|
17
|
+
import { createRegisterExtensionPlugin } from "@webiny/handler";
|
|
17
18
|
const createTasksCrud = ()=>{
|
|
18
|
-
const
|
|
19
|
-
context.container.register(TaskPrivateModel);
|
|
20
|
-
context.container.register(TaskLogPrivateModel);
|
|
19
|
+
const tasksCrudPlugin = new ContextPlugin(async (context)=>{
|
|
21
20
|
context.container.registerDecorator(RunnableTaskDecorator);
|
|
22
21
|
context.container.registerDecorator(SelfCleaningTaskDecorator);
|
|
23
22
|
GetTaskDefinitionFeature.register(context.container);
|
|
@@ -29,13 +28,20 @@ const createTasksCrud = ()=>{
|
|
|
29
28
|
};
|
|
30
29
|
context.container.registerInstance(CleanupTaskSubtreeUseCase, new CleanupTaskSubtreeUseCaseImpl(context));
|
|
31
30
|
});
|
|
32
|
-
|
|
33
|
-
return
|
|
31
|
+
tasksCrudPlugin.name = "tasks.context";
|
|
32
|
+
return tasksCrudPlugin;
|
|
34
33
|
};
|
|
35
|
-
const createTasksContext = ()=>
|
|
34
|
+
const createTasksContext = ()=>{
|
|
35
|
+
const modelsPlugin = createRegisterExtensionPlugin((context)=>{
|
|
36
|
+
context.container.register(TaskPrivateModel);
|
|
37
|
+
context.container.register(TaskLogPrivateModel);
|
|
38
|
+
});
|
|
39
|
+
return [
|
|
36
40
|
...createServicePlugins(),
|
|
37
|
-
createTasksCrud()
|
|
41
|
+
createTasksCrud(),
|
|
42
|
+
modelsPlugin
|
|
38
43
|
];
|
|
44
|
+
};
|
|
39
45
|
const createBackgroundTaskContext = ()=>[
|
|
40
46
|
...createTasksContext(),
|
|
41
47
|
new ContextPlugin((context)=>{
|
package/context.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context.js","sources":["../src/context.ts"],"sourcesContent":["import type { Plugin } from \"@webiny/plugins\";\nimport { ContextPlugin } from \"@webiny/api\";\nimport { TaskService } from \"@webiny/api-core/features/task/TaskService/index.js\";\nimport { RunnableTaskDecorator } from \"./decorators/RunnableTaskDecorator.js\";\nimport { SelfCleaningTaskDecorator } from \"./decorators/SelfCleaningTaskDecorator.js\";\nimport { TaskController } from \"./features/TaskController/index.js\";\nimport type { Context } from \"~/types.js\";\nimport { TaskPrivateModel } from \"./crud/TaskPrivateModel.js\";\nimport { TaskLogPrivateModel } from \"./crud/TaskLogPrivateModel.js\";\nimport { createDefinitionCrud } from \"./crud/definition.tasks.js\";\nimport { createServiceCrud } from \"~/crud/service.tasks.js\";\nimport { createTaskCrud } from \"./crud/crud.tasks.js\";\nimport { createServicePlugins } from \"~/service/index.js\";\nimport { TaskExecutionContextFeature } from \"~/features/TaskExecutionContext/feature.js\";\nimport { GetTaskDefinitionFeature } from \"~/features/GetTaskDefinition/feature.js\";\nimport { ListTaskDefinitionsFeature } from \"~/features/ListTaskDefinitions/feature.js\";\nimport {\n CleanupTaskSubtreeUseCase,\n CleanupTaskSubtreeUseCaseImpl\n} from \"~/features/CleanupTaskSubtree/index.js\";\nimport { TestingRunTaskDefinition } from \"~/tasks/testingRunTask.js\";\n\nconst createTasksCrud = () => {\n const
|
|
1
|
+
{"version":3,"file":"context.js","sources":["../src/context.ts"],"sourcesContent":["import type { Plugin } from \"@webiny/plugins\";\nimport { ContextPlugin } from \"@webiny/api\";\nimport { TaskService } from \"@webiny/api-core/features/task/TaskService/index.js\";\nimport { RunnableTaskDecorator } from \"./decorators/RunnableTaskDecorator.js\";\nimport { SelfCleaningTaskDecorator } from \"./decorators/SelfCleaningTaskDecorator.js\";\nimport { TaskController } from \"./features/TaskController/index.js\";\nimport type { Context } from \"~/types.js\";\nimport { TaskPrivateModel } from \"./crud/TaskPrivateModel.js\";\nimport { TaskLogPrivateModel } from \"./crud/TaskLogPrivateModel.js\";\nimport { createDefinitionCrud } from \"./crud/definition.tasks.js\";\nimport { createServiceCrud } from \"~/crud/service.tasks.js\";\nimport { createTaskCrud } from \"./crud/crud.tasks.js\";\nimport { createServicePlugins } from \"~/service/index.js\";\nimport { TaskExecutionContextFeature } from \"~/features/TaskExecutionContext/feature.js\";\nimport { GetTaskDefinitionFeature } from \"~/features/GetTaskDefinition/feature.js\";\nimport { ListTaskDefinitionsFeature } from \"~/features/ListTaskDefinitions/feature.js\";\nimport {\n CleanupTaskSubtreeUseCase,\n CleanupTaskSubtreeUseCaseImpl\n} from \"~/features/CleanupTaskSubtree/index.js\";\nimport { TestingRunTaskDefinition } from \"~/tasks/testingRunTask.js\";\nimport { createRegisterExtensionPlugin } from \"@webiny/handler\";\n\nconst createTasksCrud = () => {\n const tasksCrudPlugin = new ContextPlugin<Context>(async context => {\n // Register the RunnableTaskDecorator to wrap all TaskDefinition instances\n context.container.registerDecorator(RunnableTaskDecorator);\n context.container.registerDecorator(SelfCleaningTaskDecorator);\n\n // Register task definition use cases\n GetTaskDefinitionFeature.register(context.container);\n ListTaskDefinitionsFeature.register(context.container);\n\n context.tasks = {\n ...createDefinitionCrud(context),\n ...createTaskCrud(context),\n ...createServiceCrud(context)\n };\n\n // The cleanup use case is a thin wrapper around `context.tasks.cleanupTaskSubtree`,\n // so it must register AFTER the CRUD is wired onto the context.\n context.container.registerInstance(\n CleanupTaskSubtreeUseCase,\n new CleanupTaskSubtreeUseCaseImpl(context)\n );\n });\n\n tasksCrudPlugin.name = \"tasks.context\";\n\n return tasksCrudPlugin;\n};\n\nconst createTasksContext = (): Plugin[] => {\n const modelsPlugin = createRegisterExtensionPlugin(context => {\n context.container.register(TaskPrivateModel);\n context.container.register(TaskLogPrivateModel);\n });\n\n return [...createServicePlugins(), createTasksCrud(), modelsPlugin];\n};\n\nexport const createBackgroundTaskContext = (): Plugin[] => {\n return [\n ...createTasksContext(),\n new ContextPlugin<Context>(context => {\n // Register legacy tasks context via a new abstraction\n context.container.registerInstance(TaskService, context.tasks);\n\n // Register TaskExecutionContext EARLY (singleton, empty)\n TaskExecutionContextFeature.register(context.container);\n\n // Register TaskController (depends on TaskExecutionContext)\n context.container.register(TaskController);\n\n // Register a test task\n context.container.register(TestingRunTaskDefinition);\n })\n ];\n};\n"],"names":["createTasksCrud","tasksCrudPlugin","ContextPlugin","context","RunnableTaskDecorator","SelfCleaningTaskDecorator","GetTaskDefinitionFeature","ListTaskDefinitionsFeature","createDefinitionCrud","createTaskCrud","createServiceCrud","CleanupTaskSubtreeUseCase","CleanupTaskSubtreeUseCaseImpl","createTasksContext","modelsPlugin","createRegisterExtensionPlugin","TaskPrivateModel","TaskLogPrivateModel","createServicePlugins","createBackgroundTaskContext","TaskService","TaskExecutionContextFeature","TaskController","TestingRunTaskDefinition"],"mappings":";;;;;;;;;;;;;;;;;AAuBA,MAAMA,kBAAkB;IACpB,MAAMC,kBAAkB,IAAIC,cAAuB,OAAMC;QAErDA,QAAQ,SAAS,CAAC,iBAAiB,CAACC;QACpCD,QAAQ,SAAS,CAAC,iBAAiB,CAACE;QAGpCC,yBAAyB,QAAQ,CAACH,QAAQ,SAAS;QACnDI,2BAA2B,QAAQ,CAACJ,QAAQ,SAAS;QAErDA,QAAQ,KAAK,GAAG;YACZ,GAAGK,qBAAqBL,QAAQ;YAChC,GAAGM,eAAeN,QAAQ;YAC1B,GAAGO,kBAAkBP,QAAQ;QACjC;QAIAA,QAAQ,SAAS,CAAC,gBAAgB,CAC9BQ,2BACA,IAAIC,8BAA8BT;IAE1C;IAEAF,gBAAgB,IAAI,GAAG;IAEvB,OAAOA;AACX;AAEA,MAAMY,qBAAqB;IACvB,MAAMC,eAAeC,8BAA8BZ,CAAAA;QAC/CA,QAAQ,SAAS,CAAC,QAAQ,CAACa;QAC3Bb,QAAQ,SAAS,CAAC,QAAQ,CAACc;IAC/B;IAEA,OAAO;WAAIC;QAAwBlB;QAAmBc;KAAa;AACvE;AAEO,MAAMK,8BAA8B,IAChC;WACAN;QACH,IAAIX,cAAuBC,CAAAA;YAEvBA,QAAQ,SAAS,CAAC,gBAAgB,CAACiB,aAAajB,QAAQ,KAAK;YAG7DkB,4BAA4B,QAAQ,CAAClB,QAAQ,SAAS;YAGtDA,QAAQ,SAAS,CAAC,QAAQ,CAACmB;YAG3BnB,QAAQ,SAAS,CAAC,QAAQ,CAACoB;QAC/B;KACH"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@webiny/tasks",
|
|
3
|
-
"version": "6.4.0-beta.
|
|
3
|
+
"version": "6.4.0-beta.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"exports": {
|
|
6
6
|
".": "./index.js",
|
|
@@ -16,17 +16,17 @@
|
|
|
16
16
|
],
|
|
17
17
|
"license": "MIT",
|
|
18
18
|
"dependencies": {
|
|
19
|
-
"@webiny/api": "6.4.0-beta.
|
|
20
|
-
"@webiny/api-core": "6.4.0-beta.
|
|
21
|
-
"@webiny/api-headless-cms": "6.4.0-beta.
|
|
22
|
-
"@webiny/aws-sdk": "6.4.0-beta.
|
|
23
|
-
"@webiny/error": "6.4.0-beta.
|
|
24
|
-
"@webiny/feature": "6.4.0-beta.
|
|
25
|
-
"@webiny/handler": "6.4.0-beta.
|
|
26
|
-
"@webiny/handler-aws": "6.4.0-beta.
|
|
27
|
-
"@webiny/handler-graphql": "6.4.0-beta.
|
|
28
|
-
"@webiny/plugins": "6.4.0-beta.
|
|
29
|
-
"@webiny/utils": "6.4.0-beta.
|
|
19
|
+
"@webiny/api": "6.4.0-beta.1",
|
|
20
|
+
"@webiny/api-core": "6.4.0-beta.1",
|
|
21
|
+
"@webiny/api-headless-cms": "6.4.0-beta.1",
|
|
22
|
+
"@webiny/aws-sdk": "6.4.0-beta.1",
|
|
23
|
+
"@webiny/error": "6.4.0-beta.1",
|
|
24
|
+
"@webiny/feature": "6.4.0-beta.1",
|
|
25
|
+
"@webiny/handler": "6.4.0-beta.1",
|
|
26
|
+
"@webiny/handler-aws": "6.4.0-beta.1",
|
|
27
|
+
"@webiny/handler-graphql": "6.4.0-beta.1",
|
|
28
|
+
"@webiny/plugins": "6.4.0-beta.1",
|
|
29
|
+
"@webiny/utils": "6.4.0-beta.1",
|
|
30
30
|
"deep-equal": "2.2.3",
|
|
31
31
|
"lodash": "4.18.1",
|
|
32
32
|
"object-merge-advanced": "14.1.3",
|
|
@@ -34,8 +34,8 @@
|
|
|
34
34
|
"zod": "4.4.3"
|
|
35
35
|
},
|
|
36
36
|
"devDependencies": {
|
|
37
|
-
"@webiny/build-tools": "6.4.0-beta.
|
|
38
|
-
"@webiny/project-utils": "6.4.0-beta.
|
|
37
|
+
"@webiny/build-tools": "6.4.0-beta.1",
|
|
38
|
+
"@webiny/project-utils": "6.4.0-beta.1",
|
|
39
39
|
"rimraf": "6.1.3",
|
|
40
40
|
"type-fest": "5.6.0",
|
|
41
41
|
"typescript": "6.0.3",
|
|
@@ -45,5 +45,5 @@
|
|
|
45
45
|
"access": "public",
|
|
46
46
|
"directory": "dist"
|
|
47
47
|
},
|
|
48
|
-
"gitHead": "
|
|
48
|
+
"gitHead": "73237b8243693038c072bae1c0b783387448cbbe"
|
|
49
49
|
}
|