@webiny/api-headless-cms-bulk-actions 6.4.0-beta.3 → 6.4.0-beta.5
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/features/EntriesBulkAction/internals/ChildTasksCleanup.d.ts +1 -1
- package/features/EntriesBulkAction/internals/ChildTasksCleanup.js +1 -1
- package/features/EntriesBulkAction/internals/ChildTasksCleanup.js.map +1 -1
- package/features/EntriesBulkAction/internals/ProcessTasksByModel.js +1 -1
- package/features/EntriesBulkAction/internals/ProcessTasksByModel.js.map +1 -1
- package/package.json +19 -18
- package/types.d.ts +1 -1
- package/types.js.map +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"features/EntriesBulkAction/internals/ChildTasksCleanup.js","sources":["../../../../src/features/EntriesBulkAction/internals/ChildTasksCleanup.ts"],"sourcesContent":["import type { ITask, Context } from \"@webiny/tasks\";\nimport { TaskLogItemType } from \"@webiny/tasks\";\nimport type { IUseCase } from \"~/abstractions/index.js\";\nimport type { HcmsBulkActionsContext } from \"~/types.js\";\n\nexport interface IChildTasksCleanupExecuteParams {\n context: Context;\n task: ITask;\n}\n\n/**\n * Cleanup of the child tasks.\n * This code will remove all the child tasks and their logs, which have no errors in them.\n */\nexport class ChildTasksCleanup implements IUseCase<IChildTasksCleanupExecuteParams, void> {\n public async execute(params: IChildTasksCleanupExecuteParams): Promise<void> {\n const { context, task } = params;\n\n const { items: childTasks } = await context.tasks.listTasks({\n where: {\n parentId: task.id\n },\n // Really doubtful there will be more than 10k of child tasks.\n limit: 10000\n });\n\n if (childTasks.length === 0) {\n return;\n }\n\n const childTaskIdList = childTasks.map(childTask => childTask.id);\n\n const { items: childLogs } = await context.tasks.listLogs({\n where: {\n task_in: childTaskIdList\n },\n limit: 10000\n });\n\n /**\n * No logs found. Proceed with deleting the child tasks.\n */\n if (childLogs.length === 0) {\n await this.deleteTasks(context, childTaskIdList);\n }\n\n const deletedChildTaskLogIdList: string[] = [];\n /**\n * First, we need to remove all the logs which have no errors.\n */\n for (const log of childLogs) {\n if (log.items.some(item => item.type === TaskLogItemType.ERROR)) {\n continue;\n }\n await context.tasks.deleteLog(log.id);\n if (deletedChildTaskLogIdList.includes(log.task)) {\n continue;\n }\n deletedChildTaskLogIdList.push(log.task);\n }\n /**\n * Now we can remove the tasks.\n */\n await this.deleteTasks(context, deletedChildTaskLogIdList);\n }\n\n /**\n * Helper method to delete tasks by ID.\n */\n private async deleteTasks(context: HcmsBulkActionsContext, taskIds: string[]): Promise<void> {\n for (const taskId of taskIds) {\n await context.tasks.deleteTask(taskId);\n }\n }\n}\n"],"names":["ChildTasksCleanup","params","context","task","childTasks","childTaskIdList","childTask","childLogs","deletedChildTaskLogIdList","log","item","TaskLogItemType","taskIds","taskId"],"mappings":";AAcO,MAAMA;IACT,MAAa,QAAQC,MAAuC,EAAiB;QACzE,MAAM,EAAEC,OAAO,EAAEC,IAAI,EAAE,GAAGF;QAE1B,MAAM,EAAE,OAAOG,UAAU,EAAE,GAAG,MAAMF,QAAQ,KAAK,CAAC,SAAS,CAAC;YACxD,OAAO;gBACH,UAAUC,KAAK,EAAE;YACrB;YAEA,OAAO;QACX;QAEA,IAAIC,AAAsB,MAAtBA,WAAW,MAAM,EACjB;QAGJ,MAAMC,kBAAkBD,WAAW,GAAG,CAACE,CAAAA,YAAaA,UAAU,EAAE;QAEhE,MAAM,EAAE,OAAOC,SAAS,EAAE,GAAG,MAAML,QAAQ,KAAK,CAAC,QAAQ,CAAC;YACtD,OAAO;gBACH,SAASG;YACb;YACA,OAAO;QACX;QAKA,IAAIE,AAAqB,MAArBA,UAAU,MAAM,EAChB,MAAM,IAAI,CAAC,WAAW,CAACL,SAASG;QAGpC,MAAMG,4BAAsC,EAAE;QAI9C,KAAK,MAAMC,OAAOF,UACd,KAAIE,IAAI,KAAK,CAAC,IAAI,CAACC,CAAAA,OAAQA,KAAK,IAAI,KAAKC,gBAAgB,KAAK;YAG9D,MAAMT,QAAQ,KAAK,CAAC,SAAS,CAACO,IAAI,EAAE;YACpC,KAAID,0BAA0B,QAAQ,CAACC,IAAI,IAAI,GAG/CD,0BAA0B,IAAI,CAACC,IAAI,IAAI;;QAK3C,MAAM,IAAI,CAAC,WAAW,CAACP,SAASM;IACpC;IAKA,MAAc,YAAYN,OAA+B,EAAEU,OAAiB,EAAiB;QACzF,KAAK,MAAMC,UAAUD,QACjB,MAAMV,QAAQ,KAAK,CAAC,UAAU,CAACW;IAEvC;AACJ"}
|
|
1
|
+
{"version":3,"file":"features/EntriesBulkAction/internals/ChildTasksCleanup.js","sources":["../../../../src/features/EntriesBulkAction/internals/ChildTasksCleanup.ts"],"sourcesContent":["import type { ITask, Context } from \"@webiny/background-tasks/api\";\nimport { TaskLogItemType } from \"@webiny/background-tasks/api\";\nimport type { IUseCase } from \"~/abstractions/index.js\";\nimport type { HcmsBulkActionsContext } from \"~/types.js\";\n\nexport interface IChildTasksCleanupExecuteParams {\n context: Context;\n task: ITask;\n}\n\n/**\n * Cleanup of the child tasks.\n * This code will remove all the child tasks and their logs, which have no errors in them.\n */\nexport class ChildTasksCleanup implements IUseCase<IChildTasksCleanupExecuteParams, void> {\n public async execute(params: IChildTasksCleanupExecuteParams): Promise<void> {\n const { context, task } = params;\n\n const { items: childTasks } = await context.tasks.listTasks({\n where: {\n parentId: task.id\n },\n // Really doubtful there will be more than 10k of child tasks.\n limit: 10000\n });\n\n if (childTasks.length === 0) {\n return;\n }\n\n const childTaskIdList = childTasks.map(childTask => childTask.id);\n\n const { items: childLogs } = await context.tasks.listLogs({\n where: {\n task_in: childTaskIdList\n },\n limit: 10000\n });\n\n /**\n * No logs found. Proceed with deleting the child tasks.\n */\n if (childLogs.length === 0) {\n await this.deleteTasks(context, childTaskIdList);\n }\n\n const deletedChildTaskLogIdList: string[] = [];\n /**\n * First, we need to remove all the logs which have no errors.\n */\n for (const log of childLogs) {\n if (log.items.some(item => item.type === TaskLogItemType.ERROR)) {\n continue;\n }\n await context.tasks.deleteLog(log.id);\n if (deletedChildTaskLogIdList.includes(log.task)) {\n continue;\n }\n deletedChildTaskLogIdList.push(log.task);\n }\n /**\n * Now we can remove the tasks.\n */\n await this.deleteTasks(context, deletedChildTaskLogIdList);\n }\n\n /**\n * Helper method to delete tasks by ID.\n */\n private async deleteTasks(context: HcmsBulkActionsContext, taskIds: string[]): Promise<void> {\n for (const taskId of taskIds) {\n await context.tasks.deleteTask(taskId);\n }\n }\n}\n"],"names":["ChildTasksCleanup","params","context","task","childTasks","childTaskIdList","childTask","childLogs","deletedChildTaskLogIdList","log","item","TaskLogItemType","taskIds","taskId"],"mappings":";AAcO,MAAMA;IACT,MAAa,QAAQC,MAAuC,EAAiB;QACzE,MAAM,EAAEC,OAAO,EAAEC,IAAI,EAAE,GAAGF;QAE1B,MAAM,EAAE,OAAOG,UAAU,EAAE,GAAG,MAAMF,QAAQ,KAAK,CAAC,SAAS,CAAC;YACxD,OAAO;gBACH,UAAUC,KAAK,EAAE;YACrB;YAEA,OAAO;QACX;QAEA,IAAIC,AAAsB,MAAtBA,WAAW,MAAM,EACjB;QAGJ,MAAMC,kBAAkBD,WAAW,GAAG,CAACE,CAAAA,YAAaA,UAAU,EAAE;QAEhE,MAAM,EAAE,OAAOC,SAAS,EAAE,GAAG,MAAML,QAAQ,KAAK,CAAC,QAAQ,CAAC;YACtD,OAAO;gBACH,SAASG;YACb;YACA,OAAO;QACX;QAKA,IAAIE,AAAqB,MAArBA,UAAU,MAAM,EAChB,MAAM,IAAI,CAAC,WAAW,CAACL,SAASG;QAGpC,MAAMG,4BAAsC,EAAE;QAI9C,KAAK,MAAMC,OAAOF,UACd,KAAIE,IAAI,KAAK,CAAC,IAAI,CAACC,CAAAA,OAAQA,KAAK,IAAI,KAAKC,gBAAgB,KAAK;YAG9D,MAAMT,QAAQ,KAAK,CAAC,SAAS,CAACO,IAAI,EAAE;YACpC,KAAID,0BAA0B,QAAQ,CAACC,IAAI,IAAI,GAG/CD,0BAA0B,IAAI,CAACC,IAAI,IAAI;;QAK3C,MAAM,IAAI,CAAC,WAAW,CAACP,SAASM;IACpC;IAKA,MAAc,YAAYN,OAA+B,EAAEU,OAAiB,EAAiB;QACzF,KAAK,MAAMC,UAAUD,QACjB,MAAMV,QAAQ,KAAK,CAAC,UAAU,CAACW;IAEvC;AACJ"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"features/EntriesBulkAction/internals/ProcessTasksByModel.js","sources":["../../../../src/features/EntriesBulkAction/internals/ProcessTasksByModel.ts"],"sourcesContent":["import { TaskDataStatus } from \"@webiny/tasks\";\nimport type { IBulkActionOperationByModelTaskParams } from \"~/types.js\";\nimport { BulkActionOperationByModelAction } from \"~/types.js\";\nimport { BulkActionContext } from \"~/features/BulkActionContext/index.js\";\n\n/**\n * The `ProcessTasksByModel` class is responsible for processing tasks for a specific model.\n * It checks for any running or pending tasks from the parent task and continues or completes\n * the task based on the status.\n */\nexport class ProcessTasksByModel {\n private context: BulkActionContext.Interface;\n private readonly taskDefinition: string;\n\n constructor(context: BulkActionContext.Interface, taskDefinition: string) {\n this.context = context;\n this.taskDefinition = taskDefinition;\n }\n\n async execute({ input, controller }: IBulkActionOperationByModelTaskParams) {\n try {\n if (controller.runtime.isAborted()) {\n return controller.response.aborted();\n } else if (controller.runtime.isCloseToTimeout()) {\n return controller.response.continue({\n ...input,\n action: BulkActionOperationByModelAction.PROCESS_SUBTASKS\n });\n }\n\n const { items } = await this.context.tasks.listTasks({\n where: {\n parentId: controller.state.getTask().id,\n definitionId: this.taskDefinition,\n taskStatus_in: [TaskDataStatus.RUNNING, TaskDataStatus.PENDING]\n },\n limit: 1\n });\n\n // If there are running or pending tasks, continue with a wait.\n if (items.length > 0) {\n return controller.response.continue(\n {\n ...input,\n action: BulkActionOperationByModelAction.PROCESS_SUBTASKS\n },\n {\n seconds: 120\n }\n );\n }\n\n return controller.response.continue({\n ...input,\n action: BulkActionOperationByModelAction.CHECK_MORE_SUBTASKS\n });\n } catch (ex) {\n return controller.response.error(\n ex.message ?? `Error while processing task \"${this.taskDefinition}\"`\n );\n }\n }\n}\n"],"names":["ProcessTasksByModel","context","taskDefinition","input","controller","BulkActionOperationByModelAction","items","TaskDataStatus","ex"],"mappings":";;AAUO,MAAMA;IAIT,YAAYC,OAAoC,EAAEC,cAAsB,CAAE;QACtE,IAAI,CAAC,OAAO,GAAGD;QACf,IAAI,CAAC,cAAc,GAAGC;IAC1B;IAEA,MAAM,QAAQ,EAAEC,KAAK,EAAEC,UAAU,EAAyC,EAAE;QACxE,IAAI;YACA,IAAIA,WAAW,OAAO,CAAC,SAAS,IAC5B,OAAOA,WAAW,QAAQ,CAAC,OAAO;YAC/B,IAAIA,WAAW,OAAO,CAAC,gBAAgB,IAC1C,OAAOA,WAAW,QAAQ,CAAC,QAAQ,CAAC;gBAChC,GAAGD,KAAK;gBACR,QAAQE,iCAAiC,gBAAgB;YAC7D;YAGJ,MAAM,EAAEC,KAAK,EAAE,GAAG,MAAM,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,SAAS,CAAC;gBACjD,OAAO;oBACH,UAAUF,WAAW,KAAK,CAAC,OAAO,GAAG,EAAE;oBACvC,cAAc,IAAI,CAAC,cAAc;oBACjC,eAAe;wBAACG,eAAe,OAAO;wBAAEA,eAAe,OAAO;qBAAC;gBACnE;gBACA,OAAO;YACX;YAGA,IAAID,MAAM,MAAM,GAAG,GACf,OAAOF,WAAW,QAAQ,CAAC,QAAQ,CAC/B;gBACI,GAAGD,KAAK;gBACR,QAAQE,iCAAiC,gBAAgB;YAC7D,GACA;gBACI,SAAS;YACb;YAIR,OAAOD,WAAW,QAAQ,CAAC,QAAQ,CAAC;gBAChC,GAAGD,KAAK;gBACR,QAAQE,iCAAiC,mBAAmB;YAChE;QACJ,EAAE,OAAOG,IAAI;YACT,OAAOJ,WAAW,QAAQ,CAAC,KAAK,CAC5BI,GAAG,OAAO,IAAI,CAAC,6BAA6B,EAAE,IAAI,CAAC,cAAc,CAAC,CAAC,CAAC;QAE5E;IACJ;AACJ"}
|
|
1
|
+
{"version":3,"file":"features/EntriesBulkAction/internals/ProcessTasksByModel.js","sources":["../../../../src/features/EntriesBulkAction/internals/ProcessTasksByModel.ts"],"sourcesContent":["import { TaskDataStatus } from \"@webiny/background-tasks/api\";\nimport type { IBulkActionOperationByModelTaskParams } from \"~/types.js\";\nimport { BulkActionOperationByModelAction } from \"~/types.js\";\nimport { BulkActionContext } from \"~/features/BulkActionContext/index.js\";\n\n/**\n * The `ProcessTasksByModel` class is responsible for processing tasks for a specific model.\n * It checks for any running or pending tasks from the parent task and continues or completes\n * the task based on the status.\n */\nexport class ProcessTasksByModel {\n private context: BulkActionContext.Interface;\n private readonly taskDefinition: string;\n\n constructor(context: BulkActionContext.Interface, taskDefinition: string) {\n this.context = context;\n this.taskDefinition = taskDefinition;\n }\n\n async execute({ input, controller }: IBulkActionOperationByModelTaskParams) {\n try {\n if (controller.runtime.isAborted()) {\n return controller.response.aborted();\n } else if (controller.runtime.isCloseToTimeout()) {\n return controller.response.continue({\n ...input,\n action: BulkActionOperationByModelAction.PROCESS_SUBTASKS\n });\n }\n\n const { items } = await this.context.tasks.listTasks({\n where: {\n parentId: controller.state.getTask().id,\n definitionId: this.taskDefinition,\n taskStatus_in: [TaskDataStatus.RUNNING, TaskDataStatus.PENDING]\n },\n limit: 1\n });\n\n // If there are running or pending tasks, continue with a wait.\n if (items.length > 0) {\n return controller.response.continue(\n {\n ...input,\n action: BulkActionOperationByModelAction.PROCESS_SUBTASKS\n },\n {\n seconds: 120\n }\n );\n }\n\n return controller.response.continue({\n ...input,\n action: BulkActionOperationByModelAction.CHECK_MORE_SUBTASKS\n });\n } catch (ex) {\n return controller.response.error(\n ex.message ?? `Error while processing task \"${this.taskDefinition}\"`\n );\n }\n }\n}\n"],"names":["ProcessTasksByModel","context","taskDefinition","input","controller","BulkActionOperationByModelAction","items","TaskDataStatus","ex"],"mappings":";;AAUO,MAAMA;IAIT,YAAYC,OAAoC,EAAEC,cAAsB,CAAE;QACtE,IAAI,CAAC,OAAO,GAAGD;QACf,IAAI,CAAC,cAAc,GAAGC;IAC1B;IAEA,MAAM,QAAQ,EAAEC,KAAK,EAAEC,UAAU,EAAyC,EAAE;QACxE,IAAI;YACA,IAAIA,WAAW,OAAO,CAAC,SAAS,IAC5B,OAAOA,WAAW,QAAQ,CAAC,OAAO;YAC/B,IAAIA,WAAW,OAAO,CAAC,gBAAgB,IAC1C,OAAOA,WAAW,QAAQ,CAAC,QAAQ,CAAC;gBAChC,GAAGD,KAAK;gBACR,QAAQE,iCAAiC,gBAAgB;YAC7D;YAGJ,MAAM,EAAEC,KAAK,EAAE,GAAG,MAAM,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,SAAS,CAAC;gBACjD,OAAO;oBACH,UAAUF,WAAW,KAAK,CAAC,OAAO,GAAG,EAAE;oBACvC,cAAc,IAAI,CAAC,cAAc;oBACjC,eAAe;wBAACG,eAAe,OAAO;wBAAEA,eAAe,OAAO;qBAAC;gBACnE;gBACA,OAAO;YACX;YAGA,IAAID,MAAM,MAAM,GAAG,GACf,OAAOF,WAAW,QAAQ,CAAC,QAAQ,CAC/B;gBACI,GAAGD,KAAK;gBACR,QAAQE,iCAAiC,gBAAgB;YAC7D,GACA;gBACI,SAAS;YACb;YAIR,OAAOD,WAAW,QAAQ,CAAC,QAAQ,CAAC;gBAChC,GAAGD,KAAK;gBACR,QAAQE,iCAAiC,mBAAmB;YAChE;QACJ,EAAE,OAAOG,IAAI;YACT,OAAOJ,WAAW,QAAQ,CAAC,KAAK,CAC5BI,GAAG,OAAO,IAAI,CAAC,6BAA6B,EAAE,IAAI,CAAC,cAAc,CAAC,CAAC,CAAC;QAE5E;IACJ;AACJ"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@webiny/api-headless-cms-bulk-actions",
|
|
3
|
-
"version": "6.4.0-beta.
|
|
3
|
+
"version": "6.4.0-beta.5",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"exports": {
|
|
6
6
|
".": "./index.js",
|
|
@@ -17,28 +17,29 @@
|
|
|
17
17
|
},
|
|
18
18
|
"license": "MIT",
|
|
19
19
|
"dependencies": {
|
|
20
|
-
"@webiny/api-headless-cms": "6.4.0-beta.
|
|
21
|
-
"@webiny/
|
|
22
|
-
"@webiny/
|
|
23
|
-
"@webiny/handler
|
|
24
|
-
"@webiny/
|
|
25
|
-
"@webiny/utils": "6.4.0-beta.
|
|
20
|
+
"@webiny/api-headless-cms": "6.4.0-beta.5",
|
|
21
|
+
"@webiny/background-tasks": "6.4.0-beta.5",
|
|
22
|
+
"@webiny/feature": "6.4.0-beta.5",
|
|
23
|
+
"@webiny/handler": "6.4.0-beta.5",
|
|
24
|
+
"@webiny/handler-aws": "6.4.0-beta.5",
|
|
25
|
+
"@webiny/utils": "6.4.0-beta.5"
|
|
26
26
|
},
|
|
27
27
|
"devDependencies": {
|
|
28
|
-
"@webiny/api": "6.4.0-beta.
|
|
29
|
-
"@webiny/api-core": "6.4.0-beta.
|
|
30
|
-
"@webiny/build-tools": "6.4.0-beta.
|
|
31
|
-
"@webiny/handler-graphql": "6.4.0-beta.
|
|
32
|
-
"@webiny/plugins": "6.4.0-beta.
|
|
33
|
-
"@webiny/project-utils": "6.4.0-beta.
|
|
34
|
-
"@webiny/wcp": "6.4.0-beta.
|
|
28
|
+
"@webiny/api": "6.4.0-beta.5",
|
|
29
|
+
"@webiny/api-core": "6.4.0-beta.5",
|
|
30
|
+
"@webiny/build-tools": "6.4.0-beta.5",
|
|
31
|
+
"@webiny/handler-graphql": "6.4.0-beta.5",
|
|
32
|
+
"@webiny/plugins": "6.4.0-beta.5",
|
|
33
|
+
"@webiny/project-utils": "6.4.0-beta.5",
|
|
34
|
+
"@webiny/wcp": "6.4.0-beta.5",
|
|
35
35
|
"graphql": "16.14.0",
|
|
36
36
|
"typescript": "6.0.3",
|
|
37
|
-
"vitest": "4.1.
|
|
37
|
+
"vitest": "4.1.7"
|
|
38
38
|
},
|
|
39
39
|
"publishConfig": {
|
|
40
|
-
"access": "public"
|
|
41
|
-
"directory": "dist"
|
|
40
|
+
"access": "public"
|
|
42
41
|
},
|
|
43
|
-
"
|
|
42
|
+
"webiny": {
|
|
43
|
+
"publishFrom": "dist"
|
|
44
|
+
}
|
|
44
45
|
}
|
package/types.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { CmsContext } from "@webiny/api-headless-cms/types/index.js";
|
|
2
2
|
import type { Context as BaseContext } from "@webiny/handler/types.js";
|
|
3
|
-
import type { Context as TasksContext, ITaskIdentity } from "@webiny/tasks/types.js";
|
|
3
|
+
import type { Context as TasksContext, ITaskIdentity } from "@webiny/background-tasks/api/types.js";
|
|
4
4
|
import { TaskDefinition } from "@webiny/api-core/features/task/TaskDefinition/index.js";
|
|
5
5
|
export interface HcmsBulkActionsContext extends BaseContext, CmsContext, TasksContext {
|
|
6
6
|
}
|
package/types.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sources":["../src/types.ts"],"sourcesContent":["import type { CmsContext } from \"@webiny/api-headless-cms/types/index.js\";\nimport type { Context as BaseContext } from \"@webiny/handler/types.js\";\nimport type { Context as TasksContext, ITaskIdentity } from \"@webiny/tasks/types.js\";\nimport { TaskDefinition } from \"@webiny/api-core/features/task/TaskDefinition/index.js\";\n\nexport interface HcmsBulkActionsContext extends BaseContext, CmsContext, TasksContext {}\n\n/**\n * Bulk Action Operation\n */\n\nexport interface IBulkActionOperationInput {\n modelId: string;\n ids: string[];\n data?: Record<string, any>;\n identity: ITaskIdentity;\n done?: string[];\n failed?: string[];\n}\n\nexport interface IBulkActionOperationOutput {\n done: string[];\n failed: string[];\n}\n\nexport type IBulkActionOperationTaskParams = TaskDefinition.RunParams<\n IBulkActionOperationInput,\n IBulkActionOperationOutput\n>;\n\n/**\n * Bulk Action Operation By Model\n */\n\nexport enum BulkActionOperationByModelAction {\n CREATE_SUBTASKS = \"CREATE_SUBTASKS\",\n CHECK_MORE_SUBTASKS = \"CHECK_MORE_SUBTASKS\",\n PROCESS_SUBTASKS = \"PROCESS_SUBTASKS\",\n END_TASK = \"END_TASK\"\n}\n\nexport interface IBulkActionOperationByModelInput {\n modelId: string;\n identity?: ITaskIdentity;\n where?: Record<string, any>;\n search?: string;\n after?: string | null;\n data?: Record<string, any>;\n action?: BulkActionOperationByModelAction;\n}\n\nexport interface IBulkActionOperationByModelOutput {\n done: string[];\n failed: string[];\n}\n\nexport type IBulkActionOperationByModelTaskParams = TaskDefinition.RunParams<\n IBulkActionOperationByModelInput,\n IBulkActionOperationByModelOutput\n>;\n\n/**\n * Empty Trash Bin\n */\n\nexport interface IEmptyTrashBinsInput {\n executedTenantIds?: string[] | null;\n}\n\nexport type IEmptyTrashBinsOutput = TaskDefinition.ResultDone;\n\nexport type IEmptyTrashBinsTaskParams = TaskDefinition.RunParams<\n IEmptyTrashBinsInput,\n IEmptyTrashBinsOutput\n>;\n"],"names":["BulkActionOperationByModelAction"],"mappings":"AAkCO,IAAKA,yCAAgCA,WAAAA,GAAAA,SAAhCA,gCAAgC;;;;;WAAhCA"}
|
|
1
|
+
{"version":3,"file":"types.js","sources":["../src/types.ts"],"sourcesContent":["import type { CmsContext } from \"@webiny/api-headless-cms/types/index.js\";\nimport type { Context as BaseContext } from \"@webiny/handler/types.js\";\nimport type { Context as TasksContext, ITaskIdentity } from \"@webiny/background-tasks/api/types.js\";\nimport { TaskDefinition } from \"@webiny/api-core/features/task/TaskDefinition/index.js\";\n\nexport interface HcmsBulkActionsContext extends BaseContext, CmsContext, TasksContext {}\n\n/**\n * Bulk Action Operation\n */\n\nexport interface IBulkActionOperationInput {\n modelId: string;\n ids: string[];\n data?: Record<string, any>;\n identity: ITaskIdentity;\n done?: string[];\n failed?: string[];\n}\n\nexport interface IBulkActionOperationOutput {\n done: string[];\n failed: string[];\n}\n\nexport type IBulkActionOperationTaskParams = TaskDefinition.RunParams<\n IBulkActionOperationInput,\n IBulkActionOperationOutput\n>;\n\n/**\n * Bulk Action Operation By Model\n */\n\nexport enum BulkActionOperationByModelAction {\n CREATE_SUBTASKS = \"CREATE_SUBTASKS\",\n CHECK_MORE_SUBTASKS = \"CHECK_MORE_SUBTASKS\",\n PROCESS_SUBTASKS = \"PROCESS_SUBTASKS\",\n END_TASK = \"END_TASK\"\n}\n\nexport interface IBulkActionOperationByModelInput {\n modelId: string;\n identity?: ITaskIdentity;\n where?: Record<string, any>;\n search?: string;\n after?: string | null;\n data?: Record<string, any>;\n action?: BulkActionOperationByModelAction;\n}\n\nexport interface IBulkActionOperationByModelOutput {\n done: string[];\n failed: string[];\n}\n\nexport type IBulkActionOperationByModelTaskParams = TaskDefinition.RunParams<\n IBulkActionOperationByModelInput,\n IBulkActionOperationByModelOutput\n>;\n\n/**\n * Empty Trash Bin\n */\n\nexport interface IEmptyTrashBinsInput {\n executedTenantIds?: string[] | null;\n}\n\nexport type IEmptyTrashBinsOutput = TaskDefinition.ResultDone;\n\nexport type IEmptyTrashBinsTaskParams = TaskDefinition.RunParams<\n IEmptyTrashBinsInput,\n IEmptyTrashBinsOutput\n>;\n"],"names":["BulkActionOperationByModelAction"],"mappings":"AAkCO,IAAKA,yCAAgCA,WAAAA,GAAAA,SAAhCA,gCAAgC;;;;;WAAhCA"}
|