@webiny/api-headless-cms-tasks 6.3.0-beta.2 → 6.3.0-beta.3
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.
|
@@ -11,6 +11,7 @@ declare class DeleteModelTaskDefinition implements TaskDefinition.Interface<IDel
|
|
|
11
11
|
isPrivate: boolean;
|
|
12
12
|
databaseLogs: boolean;
|
|
13
13
|
description: string;
|
|
14
|
+
readonly selfCleanup: ("onSuccess" | "onAbort")[];
|
|
14
15
|
constructor(context: CmsContext.Interface);
|
|
15
16
|
run(params: IRunParams): Promise<TaskDefinition.Result<IDeleteModelTaskInput, IDeleteModelTaskOutput>>;
|
|
16
17
|
createInputValidation({ validator }: TaskDefinition.CreateInputValidationParams): {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["TaskDefinition","CmsContext","DELETE_MODEL_TASK","DeleteModelTaskDefinition","id","title","maxIterations","isPrivate","databaseLogs","description","constructor","context","run","params","DeleteModel","runner","ex","controller","response","error","createInputValidation","validator","modelId","string","lastDeletedId","optional","DeleteModelTask","createImplementation","implementation","dependencies"],"sources":["DeleteModelTask.ts"],"sourcesContent":["import type { IDeleteModelTaskInput } from \"./types.js\";\nimport type { IDeleteModelTaskOutput } from \"./types.js\";\nimport { TaskDefinition } from \"@webiny/api-core/features/task/TaskDefinition/index.js\";\nimport { CmsContext } from \"@webiny/api-headless-cms/features/shared/abstractions.js\";\nimport { DELETE_MODEL_TASK } from \"~/constants.js\";\n\ntype IRunParams = TaskDefinition.RunParams<IDeleteModelTaskInput, IDeleteModelTaskOutput>;\n\nclass DeleteModelTaskDefinition implements TaskDefinition.Interface<\n IDeleteModelTaskInput,\n IDeleteModelTaskOutput\n> {\n id = DELETE_MODEL_TASK;\n title = \"Delete model and all of the entries\";\n maxIterations = 50;\n isPrivate = true;\n databaseLogs = false;\n description = \"Delete a content model and all associated entries.\";\n\n constructor(private context: CmsContext.Interface) {}\n\n async run(params: IRunParams) {\n const { DeleteModel } = await import(\n /* webpackChunkName: \"createDeleteModel\" */ \"./DeleteModel.js\"\n );\n\n try {\n const runner = new DeleteModel(this.context);\n return await runner.run(params);\n } catch (ex) {\n return params.controller.response.error(ex);\n }\n }\n\n createInputValidation({ validator }: TaskDefinition.CreateInputValidationParams) {\n return {\n modelId: validator.string(),\n lastDeletedId: validator.string().optional()\n };\n }\n}\n\nexport const DeleteModelTask = TaskDefinition.createImplementation({\n implementation: DeleteModelTaskDefinition,\n dependencies: [CmsContext]\n});\n"],"mappings":"AAEA,SAASA,cAAc,QAAQ,wDAAwD;AACvF,SAASC,UAAU,QAAQ,0DAA0D;AACrF,SAASC,iBAAiB;AAI1B,MAAMC,yBAAyB,CAG7B;EACEC,EAAE,GAAGF,iBAAiB;EACtBG,KAAK,GAAG,qCAAqC;EAC7CC,aAAa,GAAG,EAAE;EAClBC,SAAS,GAAG,IAAI;EAChBC,YAAY,GAAG,KAAK;EACpBC,WAAW,GAAG,oDAAoD;
|
|
1
|
+
{"version":3,"names":["TaskDefinition","CmsContext","DELETE_MODEL_TASK","DeleteModelTaskDefinition","id","title","maxIterations","isPrivate","databaseLogs","description","selfCleanup","constructor","context","run","params","DeleteModel","runner","ex","controller","response","error","createInputValidation","validator","modelId","string","lastDeletedId","optional","DeleteModelTask","createImplementation","implementation","dependencies"],"sources":["DeleteModelTask.ts"],"sourcesContent":["import type { IDeleteModelTaskInput } from \"./types.js\";\nimport type { IDeleteModelTaskOutput } from \"./types.js\";\nimport { TaskDefinition } from \"@webiny/api-core/features/task/TaskDefinition/index.js\";\nimport { CmsContext } from \"@webiny/api-headless-cms/features/shared/abstractions.js\";\nimport { DELETE_MODEL_TASK } from \"~/constants.js\";\n\ntype IRunParams = TaskDefinition.RunParams<IDeleteModelTaskInput, IDeleteModelTaskOutput>;\n\nclass DeleteModelTaskDefinition implements TaskDefinition.Interface<\n IDeleteModelTaskInput,\n IDeleteModelTaskOutput\n> {\n id = DELETE_MODEL_TASK;\n title = \"Delete model and all of the entries\";\n maxIterations = 50;\n isPrivate = true;\n databaseLogs = false;\n description = \"Delete a content model and all associated entries.\";\n\n public readonly selfCleanup = [\"onSuccess\" as const, \"onAbort\" as const];\n\n constructor(private context: CmsContext.Interface) {}\n\n async run(params: IRunParams) {\n const { DeleteModel } = await import(\n /* webpackChunkName: \"createDeleteModel\" */ \"./DeleteModel.js\"\n );\n\n try {\n const runner = new DeleteModel(this.context);\n return await runner.run(params);\n } catch (ex) {\n return params.controller.response.error(ex);\n }\n }\n\n createInputValidation({ validator }: TaskDefinition.CreateInputValidationParams) {\n return {\n modelId: validator.string(),\n lastDeletedId: validator.string().optional()\n };\n }\n}\n\nexport const DeleteModelTask = TaskDefinition.createImplementation({\n implementation: DeleteModelTaskDefinition,\n dependencies: [CmsContext]\n});\n"],"mappings":"AAEA,SAASA,cAAc,QAAQ,wDAAwD;AACvF,SAASC,UAAU,QAAQ,0DAA0D;AACrF,SAASC,iBAAiB;AAI1B,MAAMC,yBAAyB,CAG7B;EACEC,EAAE,GAAGF,iBAAiB;EACtBG,KAAK,GAAG,qCAAqC;EAC7CC,aAAa,GAAG,EAAE;EAClBC,SAAS,GAAG,IAAI;EAChBC,YAAY,GAAG,KAAK;EACpBC,WAAW,GAAG,oDAAoD;EAElDC,WAAW,GAAG,CAAC,WAAW,EAAW,SAAS,CAAU;EAExEC,WAAWA,CAASC,OAA6B,EAAE;IAAA,KAA/BA,OAA6B,GAA7BA,OAA6B;EAAG;EAEpD,MAAMC,GAAGA,CAACC,MAAkB,EAAE;IAC1B,MAAM;MAAEC;IAAY,CAAC,GAAG,MAAM,MAAM,CAChC,6DACJ,CAAC;IAED,IAAI;MACA,MAAMC,MAAM,GAAG,IAAID,WAAW,CAAC,IAAI,CAACH,OAAO,CAAC;MAC5C,OAAO,MAAMI,MAAM,CAACH,GAAG,CAACC,MAAM,CAAC;IACnC,CAAC,CAAC,OAAOG,EAAE,EAAE;MACT,OAAOH,MAAM,CAACI,UAAU,CAACC,QAAQ,CAACC,KAAK,CAACH,EAAE,CAAC;IAC/C;EACJ;EAEAI,qBAAqBA,CAAC;IAAEC;EAAsD,CAAC,EAAE;IAC7E,OAAO;MACHC,OAAO,EAAED,SAAS,CAACE,MAAM,CAAC,CAAC;MAC3BC,aAAa,EAAEH,SAAS,CAACE,MAAM,CAAC,CAAC,CAACE,QAAQ,CAAC;IAC/C,CAAC;EACL;AACJ;AAEA,OAAO,MAAMC,eAAe,GAAG3B,cAAc,CAAC4B,oBAAoB,CAAC;EAC/DC,cAAc,EAAE1B,yBAAyB;EACzC2B,YAAY,EAAE,CAAC7B,UAAU;AAC7B,CAAC,CAAC","ignoreList":[]}
|
package/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export declare const createDeleteModelTask: () => import("@webiny/api").ContextPlugin<import("./types").HcmsTasksContext>[];
|
|
2
|
-
export declare const createHcmsTasks: () => (import("@webiny/api").ContextPlugin<import("@webiny/api/types").Context> | (import("@webiny/api").ContextPlugin<import("@webiny/api/types").Context> | (import("@webiny/handler-aws/eventBridge").EventBridgeEventHandler<"WebinyEmptyTrashBin", Record<string, any>, any> | import("@webiny/handler/index").HandlerOnRequestPlugin<import("@webiny/handler/types").Context>)[] | import("@webiny/handler/index").BeforeHandlerPlugin<import("@webiny/api-headless-cms-bulk-actions/types").HcmsBulkActionsContext>)[]
|
|
2
|
+
export declare const createHcmsTasks: () => (import("@webiny/api").ContextPlugin<import("@webiny/api/types").Context> | (import("@webiny/api").ContextPlugin<import("@webiny/api/types").Context> | (import("@webiny/handler-aws/eventBridge").EventBridgeEventHandler<"WebinyEmptyTrashBin", Record<string, any>, any> | import("@webiny/handler/index").HandlerOnRequestPlugin<import("@webiny/handler/types").Context>)[] | import("@webiny/handler/index").BeforeHandlerPlugin<import("@webiny/api-headless-cms-bulk-actions/types").HcmsBulkActionsContext>)[])[];
|
package/index.js
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { createEmptyTrashBinsTask, createHcmsBulkActions } from "@webiny/api-headless-cms-bulk-actions";
|
|
2
|
-
import { createHeadlessCmsImportExport } from "@webiny/api-headless-cms-import-export";
|
|
3
2
|
import { createContextPlugin } from "@webiny/api";
|
|
4
3
|
import { DeleteModelTaskFeature } from "./features/DeleteModelTask/feature.js";
|
|
5
4
|
import { createDeleteModelCrud } from "./graphql/deleteModel/crud.js";
|
|
@@ -11,6 +10,6 @@ export const createDeleteModelTask = () => {
|
|
|
11
10
|
};
|
|
12
11
|
export const createHcmsTasks = () => [createHcmsBulkActions({
|
|
13
12
|
batchSize: 100
|
|
14
|
-
}), createEmptyTrashBinsTask(),
|
|
13
|
+
}), createEmptyTrashBinsTask(), createDeleteModelTask()];
|
|
15
14
|
|
|
16
15
|
//# sourceMappingURL=index.js.map
|
package/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["createEmptyTrashBinsTask","createHcmsBulkActions","
|
|
1
|
+
{"version":3,"names":["createEmptyTrashBinsTask","createHcmsBulkActions","createContextPlugin","DeleteModelTaskFeature","createDeleteModelCrud","createDeleteModelGraphQl","createDeleteModelTask","context","register","container","createHcmsTasks","batchSize"],"sources":["index.ts"],"sourcesContent":["import {\n createEmptyTrashBinsTask,\n createHcmsBulkActions\n} from \"@webiny/api-headless-cms-bulk-actions\";\nimport { createContextPlugin } from \"@webiny/api\";\nimport { DeleteModelTaskFeature } from \"~/features/DeleteModelTask/feature.js\";\nimport { createDeleteModelCrud } from \"~/graphql/deleteModel/crud.js\";\nimport { createDeleteModelGraphQl } from \"~/graphql/deleteModel/index.js\";\n\nexport const createDeleteModelTask = () => {\n return [\n createDeleteModelCrud(),\n createDeleteModelGraphQl(),\n createContextPlugin(context => {\n DeleteModelTaskFeature.register(context.container);\n })\n ];\n};\n\nexport const createHcmsTasks = () => [\n createHcmsBulkActions({ batchSize: 100 }),\n createEmptyTrashBinsTask(),\n createDeleteModelTask()\n];\n"],"mappings":"AAAA,SACIA,wBAAwB,EACxBC,qBAAqB,QAClB,uCAAuC;AAC9C,SAASC,mBAAmB,QAAQ,aAAa;AACjD,SAASC,sBAAsB;AAC/B,SAASC,qBAAqB;AAC9B,SAASC,wBAAwB;AAEjC,OAAO,MAAMC,qBAAqB,GAAGA,CAAA,KAAM;EACvC,OAAO,CACHF,qBAAqB,CAAC,CAAC,EACvBC,wBAAwB,CAAC,CAAC,EAC1BH,mBAAmB,CAACK,OAAO,IAAI;IAC3BJ,sBAAsB,CAACK,QAAQ,CAACD,OAAO,CAACE,SAAS,CAAC;EACtD,CAAC,CAAC,CACL;AACL,CAAC;AAED,OAAO,MAAMC,eAAe,GAAGA,CAAA,KAAM,CACjCT,qBAAqB,CAAC;EAAEU,SAAS,EAAE;AAAI,CAAC,CAAC,EACzCX,wBAAwB,CAAC,CAAC,EAC1BM,qBAAqB,CAAC,CAAC,CAC1B","ignoreList":[]}
|
package/package.json
CHANGED
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@webiny/api-headless-cms-tasks",
|
|
3
|
-
"version": "6.3.0-beta.
|
|
3
|
+
"version": "6.3.0-beta.3",
|
|
4
4
|
"type": "module",
|
|
5
|
-
"
|
|
5
|
+
"exports": {
|
|
6
|
+
".": "./index.js",
|
|
7
|
+
"./*": "./*"
|
|
8
|
+
},
|
|
6
9
|
"description": "Background tasks for Webiny Headless CMS",
|
|
7
10
|
"keywords": [
|
|
8
11
|
"api-headless-cms-tasks:base"
|
|
@@ -14,27 +17,26 @@
|
|
|
14
17
|
},
|
|
15
18
|
"license": "MIT",
|
|
16
19
|
"dependencies": {
|
|
17
|
-
"@webiny/api": "6.3.0-beta.
|
|
18
|
-
"@webiny/api-aco": "6.3.0-beta.
|
|
19
|
-
"@webiny/api-headless-cms": "6.3.0-beta.
|
|
20
|
-
"@webiny/api-headless-cms-bulk-actions": "6.3.0-beta.
|
|
21
|
-
"@webiny/
|
|
22
|
-
"@webiny/
|
|
23
|
-
"@webiny/
|
|
24
|
-
"@webiny/
|
|
25
|
-
"@webiny/
|
|
26
|
-
"@webiny/
|
|
27
|
-
"@webiny/utils": "6.3.0-beta.2",
|
|
20
|
+
"@webiny/api": "6.3.0-beta.3",
|
|
21
|
+
"@webiny/api-aco": "6.3.0-beta.3",
|
|
22
|
+
"@webiny/api-headless-cms": "6.3.0-beta.3",
|
|
23
|
+
"@webiny/api-headless-cms-bulk-actions": "6.3.0-beta.3",
|
|
24
|
+
"@webiny/db": "6.3.0-beta.3",
|
|
25
|
+
"@webiny/error": "6.3.0-beta.3",
|
|
26
|
+
"@webiny/feature": "6.3.0-beta.3",
|
|
27
|
+
"@webiny/handler-graphql": "6.3.0-beta.3",
|
|
28
|
+
"@webiny/tasks": "6.3.0-beta.3",
|
|
29
|
+
"@webiny/utils": "6.3.0-beta.3",
|
|
28
30
|
"zod": "4.3.6"
|
|
29
31
|
},
|
|
30
32
|
"devDependencies": {
|
|
31
|
-
"@webiny/api-core": "6.3.0-beta.
|
|
32
|
-
"@webiny/build-tools": "6.3.0-beta.
|
|
33
|
-
"@webiny/handler": "6.3.0-beta.
|
|
34
|
-
"@webiny/handler-aws": "6.3.0-beta.
|
|
35
|
-
"@webiny/plugins": "6.3.0-beta.
|
|
36
|
-
"@webiny/project-utils": "6.3.0-beta.
|
|
37
|
-
"@webiny/wcp": "6.3.0-beta.
|
|
33
|
+
"@webiny/api-core": "6.3.0-beta.3",
|
|
34
|
+
"@webiny/build-tools": "6.3.0-beta.3",
|
|
35
|
+
"@webiny/handler": "6.3.0-beta.3",
|
|
36
|
+
"@webiny/handler-aws": "6.3.0-beta.3",
|
|
37
|
+
"@webiny/plugins": "6.3.0-beta.3",
|
|
38
|
+
"@webiny/project-utils": "6.3.0-beta.3",
|
|
39
|
+
"@webiny/wcp": "6.3.0-beta.3",
|
|
38
40
|
"typescript": "6.0.3",
|
|
39
41
|
"vitest": "4.1.5"
|
|
40
42
|
},
|
|
@@ -42,5 +44,5 @@
|
|
|
42
44
|
"access": "public",
|
|
43
45
|
"directory": "dist"
|
|
44
46
|
},
|
|
45
|
-
"gitHead": "
|
|
47
|
+
"gitHead": "e154ec3326903876c357d35422dc60d29e061419"
|
|
46
48
|
}
|