@webiny/api-headless-cms-bulk-actions 6.4.12-beta.5 → 6.5.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/exports/api/cms/entry.d.ts +1 -0
- package/exports/api/cms/entry.js +1 -0
- package/features/DeleteEntriesBulkAction/DeleteEntriesBulkAction.d.ts +1 -1
- package/features/EntriesBulkAction/abstractions.d.ts +7 -7
- package/features/EntriesBulkAction/abstractions.js.map +1 -1
- package/features/EntriesBulkAction/internals/CreateTasksByModel.js +1 -1
- package/features/EntriesBulkAction/internals/CreateTasksByModel.js.map +1 -1
- package/features/EntriesBulkAction/internals/ProcessTask.d.ts +1 -1
- package/features/EntriesBulkAction/internals/ProcessTask.js +1 -1
- package/features/EntriesBulkAction/internals/ProcessTask.js.map +1 -1
- package/features/EntriesBulkAction/internals/ProcessTasksByModel.js +1 -1
- package/features/EntriesBulkAction/internals/ProcessTasksByModel.js.map +1 -1
- package/features/MoveToFolderBulkAction/MoveToFolderBulkAction.d.ts +1 -1
- package/features/MoveToTrashBulkAction/MoveToTrashBulkAction.d.ts +1 -1
- package/features/PublishEntriesBulkAction/PublishEntriesBulkAction.d.ts +1 -1
- package/features/RestoreEntriesBulkAction/RestoreEntriesBulkAction.d.ts +1 -1
- package/features/UnpublishEntriesBulkAction/UnpublishEntriesBulkAction.d.ts +1 -1
- package/package.json +16 -16
- package/tasks/EmptyTrashBinTaskDefinition.d.ts +1 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { EntriesBulkAction } from "../../../features/EntriesBulkAction/abstractions.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { EntriesBulkAction } from "../../../features/EntriesBulkAction/abstractions.js";
|
|
@@ -10,6 +10,6 @@ declare class DeleteEntriesBulkActionImpl implements EntriesBulkAction.Interface
|
|
|
10
10
|
processData(model: EntriesBulkAction.Model, params: EntriesBulkAction.ProcessParams): Promise<void>;
|
|
11
11
|
}
|
|
12
12
|
export declare const DeleteEntriesBulkAction: typeof DeleteEntriesBulkActionImpl & {
|
|
13
|
-
__abstraction: import("@webiny/di").Abstraction<import("~/features/EntriesBulkAction/abstractions.js").IEntriesBulkAction
|
|
13
|
+
__abstraction: import("@webiny/di").Abstraction<import("~/features/EntriesBulkAction/abstractions.js").IEntriesBulkAction<Record<string, any>>>;
|
|
14
14
|
};
|
|
15
15
|
export {};
|
|
@@ -9,24 +9,24 @@ export interface IBulkActionListResult {
|
|
|
9
9
|
entries: CmsEntry[];
|
|
10
10
|
meta: CmsEntryMeta;
|
|
11
11
|
}
|
|
12
|
-
export interface IBulkActionProcessParams {
|
|
12
|
+
export interface IBulkActionProcessParams<TData = Record<string, any>> {
|
|
13
13
|
id: string;
|
|
14
|
-
data?:
|
|
14
|
+
data?: TData;
|
|
15
15
|
}
|
|
16
|
-
export interface IEntriesBulkAction {
|
|
16
|
+
export interface IEntriesBulkAction<TData = Record<string, any>> {
|
|
17
17
|
readonly name: string;
|
|
18
18
|
readonly modelIds?: string[];
|
|
19
19
|
readonly batchSize?: number;
|
|
20
20
|
loadData(model: CmsModel, params: IBulkActionListParams): Promise<IBulkActionListResult>;
|
|
21
|
-
processData(model: CmsModel, params: IBulkActionProcessParams): Promise<void>;
|
|
21
|
+
processData(model: CmsModel, params: IBulkActionProcessParams<TData>): Promise<void>;
|
|
22
22
|
}
|
|
23
|
-
export declare const EntriesBulkAction: import("@webiny/di").Abstraction<IEntriesBulkAction
|
|
23
|
+
export declare const EntriesBulkAction: import("@webiny/di").Abstraction<IEntriesBulkAction<Record<string, any>>>;
|
|
24
24
|
export declare namespace EntriesBulkAction {
|
|
25
|
-
type Interface = IEntriesBulkAction
|
|
25
|
+
type Interface<TData = Record<string, any>> = IEntriesBulkAction<TData>;
|
|
26
26
|
type Model = CmsModel;
|
|
27
27
|
type LoadDataParams = IBulkActionListParams;
|
|
28
28
|
type LoadDataResult = IBulkActionListResult;
|
|
29
|
-
type ProcessParams = IBulkActionProcessParams
|
|
29
|
+
type ProcessParams<TData = Record<string, any>> = IBulkActionProcessParams<TData>;
|
|
30
30
|
}
|
|
31
31
|
interface IEntriesBulkActionConfig {
|
|
32
32
|
batchSize: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"features/EntriesBulkAction/abstractions.js","sources":["../../../src/features/EntriesBulkAction/abstractions.ts"],"sourcesContent":["import { createAbstraction } from \"@webiny/feature/api\";\nimport type { CmsEntry, CmsEntryMeta, CmsModel } from \"@webiny/api-headless-cms/types/index.js\";\n\nexport interface IBulkActionListParams {\n where?: Record<string, any>;\n search?: string;\n after?: string | null;\n limit?: number;\n}\n\nexport interface IBulkActionListResult {\n entries: CmsEntry[];\n meta: CmsEntryMeta;\n}\n\nexport interface IBulkActionProcessParams {\n id: string;\n data
|
|
1
|
+
{"version":3,"file":"features/EntriesBulkAction/abstractions.js","sources":["../../../src/features/EntriesBulkAction/abstractions.ts"],"sourcesContent":["import { createAbstraction } from \"@webiny/feature/api\";\nimport type { CmsEntry, CmsEntryMeta, CmsModel } from \"@webiny/api-headless-cms/types/index.js\";\n\nexport interface IBulkActionListParams {\n where?: Record<string, any>;\n search?: string;\n after?: string | null;\n limit?: number;\n}\n\nexport interface IBulkActionListResult {\n entries: CmsEntry[];\n meta: CmsEntryMeta;\n}\n\nexport interface IBulkActionProcessParams<TData = Record<string, any>> {\n id: string;\n // The `data` payload the Admin action sent along with the trigger. Type it by\n // parameterizing `EntriesBulkAction.Interface<TData>` on your implementation.\n data?: TData;\n}\n\nexport interface IEntriesBulkAction<TData = Record<string, any>> {\n readonly name: string;\n readonly modelIds?: string[]; // Optional: filter which models get GraphQL mutations\n readonly batchSize?: number;\n loadData(model: CmsModel, params: IBulkActionListParams): Promise<IBulkActionListResult>;\n processData(model: CmsModel, params: IBulkActionProcessParams<TData>): Promise<void>;\n}\n\nexport const EntriesBulkAction = createAbstraction<IEntriesBulkAction>(\"EntriesBulkAction\");\n\nexport namespace EntriesBulkAction {\n export type Interface<TData = Record<string, any>> = IEntriesBulkAction<TData>;\n export type Model = CmsModel;\n export type LoadDataParams = IBulkActionListParams;\n export type LoadDataResult = IBulkActionListResult;\n export type ProcessParams<TData = Record<string, any>> = IBulkActionProcessParams<TData>;\n}\n\ninterface IEntriesBulkActionConfig {\n batchSize: number;\n}\n\nexport const EntriesBulkActionConfig =\n createAbstraction<IEntriesBulkActionConfig>(\"EntriesBulkActionConfig\");\n\nexport namespace EntriesBulkActionConfig {\n export type Interface = IEntriesBulkActionConfig;\n}\n"],"names":["EntriesBulkAction","createAbstraction","EntriesBulkActionConfig"],"mappings":";AA8BO,MAAMA,oBAAoBC,kBAAsC;AAchE,MAAMC,0BACTD,kBAA4C"}
|
|
@@ -23,7 +23,7 @@ class CreateTasksByModel {
|
|
|
23
23
|
};
|
|
24
24
|
while(true){
|
|
25
25
|
if (controller.runtime.isAborted()) return controller.response.aborted();
|
|
26
|
-
|
|
26
|
+
if (controller.runtime.isCloseToTimeout()) {
|
|
27
27
|
await this.taskCache.triggerTask(this.context, controller.state.getTask());
|
|
28
28
|
return controller.response.continue({
|
|
29
29
|
...input,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"features/EntriesBulkAction/internals/CreateTasksByModel.js","sources":["../../../../src/features/EntriesBulkAction/internals/CreateTasksByModel.ts"],"sourcesContent":["import type { CmsEntryListParams } from \"@webiny/api-headless-cms/types/index.js\";\nimport { TaskCache } from \"./TaskCache.js\";\nimport type { IBulkActionOperationByModelTaskParams } from \"~/types.js\";\nimport { BulkActionOperationByModelAction } from \"~/types.js\";\nimport { EntriesBulkAction } from \"~/features/EntriesBulkAction/abstractions.js\";\nimport { BulkActionContext } from \"~/features/BulkActionContext/index.js\";\nimport { GetModelUseCase } from \"@webiny/api-headless-cms/features/contentModel/GetModel/index.js\";\n\nconst MAX_TASK_LIST_LENGTH = 10;\n\n/**\n * The `CreateTasksByModel` class handles the execution of a task to process entries in batches.\n */\nexport class CreateTasksByModel {\n private readonly taskCache: TaskCache;\n private readonly batchSize: number;\n private readonly bulkAction: EntriesBulkAction.Interface;\n private readonly context: BulkActionContext.Interface;\n private readonly getModel: GetModelUseCase.Interface;\n\n constructor(\n context: BulkActionContext.Interface,\n getModel: GetModelUseCase.Interface,\n bulkAction: EntriesBulkAction.Interface,\n taskDefinition: string,\n batchSize: number\n ) {\n this.getModel = getModel;\n this.taskCache = new TaskCache(taskDefinition);\n this.batchSize = batchSize;\n this.bulkAction = bulkAction;\n this.context = context;\n }\n\n async execute(params: IBulkActionOperationByModelTaskParams) {\n const { input, controller } = params;\n\n try {\n const modelResult = await this.getModel.execute(input.modelId);\n\n if (modelResult.isFail()) {\n return controller.response.error(`Model with ${input.modelId} not found!`);\n }\n\n const model = modelResult.value;\n\n const listEntriesParams: CmsEntryListParams = {\n where: input.where,\n search: input.search,\n after: input.after,\n limit: this.batchSize\n };\n\n while (true) {\n if (controller.runtime.isAborted()) {\n return controller.response.aborted();\n } else if (controller.runtime.isCloseToTimeout()) {\n await this.taskCache.triggerTask(this.context, controller.state.getTask());\n return controller.response.continue({\n ...input,\n action: BulkActionOperationByModelAction.PROCESS_SUBTASKS\n });\n }\n\n // List entries from the HCMS based on the provided query\n const { entries, meta } = await this.bulkAction.loadData(model, listEntriesParams);\n\n // End the task if no entries match the query\n if (meta.totalCount === 0) {\n return controller.response.continue({\n ...input,\n action: BulkActionOperationByModelAction.END_TASK\n });\n }\n\n // Continue processing if we are reached the task list length limit\n if (this.taskCache.getTasksLength() === MAX_TASK_LIST_LENGTH) {\n await this.taskCache.triggerTask(this.context, controller.state.getTask());\n return controller.response.continue({\n ...input,\n action: BulkActionOperationByModelAction.PROCESS_SUBTASKS\n });\n }\n\n // Continue processing if no entries are returned in the current batch\n if (entries.length === 0) {\n await this.taskCache.triggerTask(this.context, controller.state.getTask());\n return controller.response.continue({\n ...input,\n action: BulkActionOperationByModelAction.PROCESS_SUBTASKS\n });\n }\n\n // Extract entry IDs\n const ids: string[] = [];\n for (let i = 0; i < entries.length; i++) {\n ids.push(entries[i].id);\n }\n\n if (ids.length > 0) {\n // Cache the task with the entry IDs\n this.taskCache.cacheTask({\n modelId: input.modelId,\n identity: input.identity,\n data: input.data,\n ids\n });\n }\n\n // Continue processing if there are no more entries or pagination is complete\n if (!meta.hasMoreItems || !meta.cursor) {\n await this.taskCache.triggerTask(this.context, controller.state.getTask());\n\n return controller.response.continue({\n ...input,\n action: BulkActionOperationByModelAction.PROCESS_SUBTASKS\n });\n }\n\n listEntriesParams.after = meta.cursor;\n }\n } catch (ex) {\n return controller.response.error(ex.message ?? `Error while creating task.`);\n }\n }\n}\n"],"names":["MAX_TASK_LIST_LENGTH","CreateTasksByModel","context","getModel","bulkAction","taskDefinition","batchSize","TaskCache","params","input","controller","modelResult","model","listEntriesParams","BulkActionOperationByModelAction","entries","meta","ids","i","ex"],"mappings":";;AAQA,MAAMA,uBAAuB;AAKtB,MAAMC;IAOT,YACIC,OAAoC,EACpCC,QAAmC,EACnCC,UAAuC,EACvCC,cAAsB,EACtBC,SAAiB,CACnB;QACE,IAAI,CAAC,QAAQ,GAAGH;QAChB,IAAI,CAAC,SAAS,GAAG,IAAII,UAAUF;QAC/B,IAAI,CAAC,SAAS,GAAGC;QACjB,IAAI,CAAC,UAAU,GAAGF;QAClB,IAAI,CAAC,OAAO,GAAGF;IACnB;IAEA,MAAM,QAAQM,MAA6C,EAAE;QACzD,MAAM,EAAEC,KAAK,EAAEC,UAAU,EAAE,GAAGF;QAE9B,IAAI;YACA,MAAMG,cAAc,MAAM,IAAI,CAAC,QAAQ,CAAC,OAAO,CAACF,MAAM,OAAO;YAE7D,IAAIE,YAAY,MAAM,IAClB,OAAOD,WAAW,QAAQ,CAAC,KAAK,CAAC,CAAC,WAAW,EAAED,MAAM,OAAO,CAAC,WAAW,CAAC;YAG7E,MAAMG,QAAQD,YAAY,KAAK;YAE/B,MAAME,oBAAwC;gBAC1C,OAAOJ,MAAM,KAAK;gBAClB,QAAQA,MAAM,MAAM;gBACpB,OAAOA,MAAM,KAAK;gBAClB,OAAO,IAAI,CAAC,SAAS;YACzB;YAEA,MAAO,KAAM;gBACT,IAAIC,WAAW,OAAO,CAAC,SAAS,IAC5B,OAAOA,WAAW,QAAQ,CAAC,OAAO;
|
|
1
|
+
{"version":3,"file":"features/EntriesBulkAction/internals/CreateTasksByModel.js","sources":["../../../../src/features/EntriesBulkAction/internals/CreateTasksByModel.ts"],"sourcesContent":["import type { CmsEntryListParams } from \"@webiny/api-headless-cms/types/index.js\";\nimport { TaskCache } from \"./TaskCache.js\";\nimport type { IBulkActionOperationByModelTaskParams } from \"~/types.js\";\nimport { BulkActionOperationByModelAction } from \"~/types.js\";\nimport { EntriesBulkAction } from \"~/features/EntriesBulkAction/abstractions.js\";\nimport { BulkActionContext } from \"~/features/BulkActionContext/index.js\";\nimport { GetModelUseCase } from \"@webiny/api-headless-cms/features/contentModel/GetModel/index.js\";\n\nconst MAX_TASK_LIST_LENGTH = 10;\n\n/**\n * The `CreateTasksByModel` class handles the execution of a task to process entries in batches.\n */\nexport class CreateTasksByModel {\n private readonly taskCache: TaskCache;\n private readonly batchSize: number;\n private readonly bulkAction: EntriesBulkAction.Interface;\n private readonly context: BulkActionContext.Interface;\n private readonly getModel: GetModelUseCase.Interface;\n\n constructor(\n context: BulkActionContext.Interface,\n getModel: GetModelUseCase.Interface,\n bulkAction: EntriesBulkAction.Interface,\n taskDefinition: string,\n batchSize: number\n ) {\n this.getModel = getModel;\n this.taskCache = new TaskCache(taskDefinition);\n this.batchSize = batchSize;\n this.bulkAction = bulkAction;\n this.context = context;\n }\n\n async execute(params: IBulkActionOperationByModelTaskParams) {\n const { input, controller } = params;\n\n try {\n const modelResult = await this.getModel.execute(input.modelId);\n\n if (modelResult.isFail()) {\n return controller.response.error(`Model with ${input.modelId} not found!`);\n }\n\n const model = modelResult.value;\n\n const listEntriesParams: CmsEntryListParams = {\n where: input.where,\n search: input.search,\n after: input.after,\n limit: this.batchSize\n };\n\n while (true) {\n if (controller.runtime.isAborted()) {\n return controller.response.aborted();\n } else if (controller.runtime.isCloseToTimeout()) {\n await this.taskCache.triggerTask(this.context, controller.state.getTask());\n return controller.response.continue({\n ...input,\n action: BulkActionOperationByModelAction.PROCESS_SUBTASKS\n });\n }\n\n // List entries from the HCMS based on the provided query\n const { entries, meta } = await this.bulkAction.loadData(model, listEntriesParams);\n\n // End the task if no entries match the query\n if (meta.totalCount === 0) {\n return controller.response.continue({\n ...input,\n action: BulkActionOperationByModelAction.END_TASK\n });\n }\n\n // Continue processing if we are reached the task list length limit\n if (this.taskCache.getTasksLength() === MAX_TASK_LIST_LENGTH) {\n await this.taskCache.triggerTask(this.context, controller.state.getTask());\n return controller.response.continue({\n ...input,\n action: BulkActionOperationByModelAction.PROCESS_SUBTASKS\n });\n }\n\n // Continue processing if no entries are returned in the current batch\n if (entries.length === 0) {\n await this.taskCache.triggerTask(this.context, controller.state.getTask());\n return controller.response.continue({\n ...input,\n action: BulkActionOperationByModelAction.PROCESS_SUBTASKS\n });\n }\n\n // Extract entry IDs\n const ids: string[] = [];\n for (let i = 0; i < entries.length; i++) {\n ids.push(entries[i].id);\n }\n\n if (ids.length > 0) {\n // Cache the task with the entry IDs\n this.taskCache.cacheTask({\n modelId: input.modelId,\n identity: input.identity,\n data: input.data,\n ids\n });\n }\n\n // Continue processing if there are no more entries or pagination is complete\n if (!meta.hasMoreItems || !meta.cursor) {\n await this.taskCache.triggerTask(this.context, controller.state.getTask());\n\n return controller.response.continue({\n ...input,\n action: BulkActionOperationByModelAction.PROCESS_SUBTASKS\n });\n }\n\n listEntriesParams.after = meta.cursor;\n }\n } catch (ex) {\n return controller.response.error(ex.message ?? `Error while creating task.`);\n }\n }\n}\n"],"names":["MAX_TASK_LIST_LENGTH","CreateTasksByModel","context","getModel","bulkAction","taskDefinition","batchSize","TaskCache","params","input","controller","modelResult","model","listEntriesParams","BulkActionOperationByModelAction","entries","meta","ids","i","ex"],"mappings":"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"}
|
|
@@ -12,5 +12,5 @@ export declare class ProcessTask {
|
|
|
12
12
|
private getModel;
|
|
13
13
|
private readonly result;
|
|
14
14
|
constructor(bulkAction: EntriesBulkAction.Interface, getModel: GetModelUseCase.Interface);
|
|
15
|
-
execute({ input, controller }: IBulkActionOperationTaskParams): Promise<import("@webiny/api-core/features/task/TaskDefinition/abstractions.js").ITaskResultAborted | import("@webiny/api-core/features/task/TaskDefinition/abstractions.js").
|
|
15
|
+
execute({ input, controller }: IBulkActionOperationTaskParams): Promise<import("@webiny/api-core/features/task/TaskDefinition/abstractions.js").ITaskResultAborted | import("@webiny/api-core/features/task/TaskDefinition/abstractions.js").ITaskResultError | import("@webiny/api-core/features/task/TaskDefinition/abstractions.js").TaskDefinition.ResultContinue<import("~/types.js").IBulkActionOperationInput> | import("@webiny/api-core/features/task/TaskDefinition/abstractions.js").TaskDefinition.ResultDone<import("~/types.js").IBulkActionOperationOutput>>;
|
|
16
16
|
}
|
|
@@ -8,7 +8,7 @@ class ProcessTask {
|
|
|
8
8
|
async execute({ input, controller }) {
|
|
9
9
|
try {
|
|
10
10
|
if (controller.runtime.isAborted()) return controller.response.aborted();
|
|
11
|
-
|
|
11
|
+
if (controller.runtime.isCloseToTimeout()) return controller.response.continue({
|
|
12
12
|
...input
|
|
13
13
|
});
|
|
14
14
|
if (!input.modelId) return controller.response.error('Missing "modelId" in the input.');
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"features/EntriesBulkAction/internals/ProcessTask.js","sources":["../../../../src/features/EntriesBulkAction/internals/ProcessTask.ts"],"sourcesContent":["import { GetModelUseCase } from \"@webiny/api-headless-cms/features/contentModel/GetModel/index.js\";\nimport { EntriesBulkAction } from \"~/features/EntriesBulkAction/abstractions.js\";\nimport { ProcessTaskResult } from \"./ProcessTaskResult.js\";\nimport type { IBulkActionOperationTaskParams } from \"~/types.js\";\n\n/**\n * The `ProcessTask` class is responsible for processing a batch of entries\n * based on the provided parameters. It uses a gateway to perform the actual\n * processing and maintains the results of the operations, including successfully\n * processed and failed entries.\n */\nexport class ProcessTask {\n private readonly result: ProcessTaskResult;\n\n constructor(\n private bulkAction: EntriesBulkAction.Interface,\n private getModel: GetModelUseCase.Interface\n ) {\n this.result = new ProcessTaskResult();\n }\n\n async execute({ input, controller }: IBulkActionOperationTaskParams) {\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 });\n }\n\n // Check if the input contains a model ID.\n if (!input.modelId) {\n return controller.response.error(`Missing \"modelId\" in the input.`);\n }\n\n // Check if the model exists.\n const modelResult = await this.getModel.execute(input.modelId);\n\n if (modelResult.isFail()) {\n return controller.response.error(`Model with ${input.modelId} not found!`);\n }\n\n const model = modelResult.value;\n\n // Check if there are any IDs to process.\n if (!input.ids || input.ids.length === 0) {\n return controller.response.done(\n `Task done: no entries to process for \"${input.modelId}\" model.`,\n {\n done: [],\n failed: []\n }\n );\n }\n\n // Process each ID in the input.\n for (const id of input.ids) {\n try {\n // Execute the gateway operation for the current ID.\n await this.bulkAction.processData(model, {\n id,\n data: input.data\n });\n\n // Add the ID to the list of successfully processed entries.\n this.result.addDone(id);\n } catch (ex) {\n console.error(ex.message || `Failed to process entry with id \"${id}\".`);\n // Add the ID to the list of failed entries.\n this.result.addFailed(id);\n }\n }\n\n // Return a done response with the results of the processing.\n return controller.response.done(\n `Task done: all entries processed for \"${model.name}\" model.`,\n {\n done: this.result.getDone(),\n failed: this.result.getFailed()\n }\n );\n } catch (ex) {\n return controller.response.error(ex.message ?? `Error while processing task.`);\n }\n }\n}\n"],"names":["ProcessTask","bulkAction","getModel","ProcessTaskResult","input","controller","modelResult","model","id","ex","console"],"mappings":";AAWO,MAAMA;IAGT,YACYC,UAAuC,EACvCC,QAAmC,CAC7C;aAFUD,UAAU,GAAVA;aACAC,QAAQ,GAARA;QAER,IAAI,CAAC,MAAM,GAAG,IAAIC;IACtB;IAEA,MAAM,QAAQ,EAAEC,KAAK,EAAEC,UAAU,EAAkC,EAAE;QACjE,IAAI;YACA,IAAIA,WAAW,OAAO,CAAC,SAAS,IAC5B,OAAOA,WAAW,QAAQ,CAAC,OAAO;
|
|
1
|
+
{"version":3,"file":"features/EntriesBulkAction/internals/ProcessTask.js","sources":["../../../../src/features/EntriesBulkAction/internals/ProcessTask.ts"],"sourcesContent":["import { GetModelUseCase } from \"@webiny/api-headless-cms/features/contentModel/GetModel/index.js\";\nimport { EntriesBulkAction } from \"~/features/EntriesBulkAction/abstractions.js\";\nimport { ProcessTaskResult } from \"./ProcessTaskResult.js\";\nimport type { IBulkActionOperationTaskParams } from \"~/types.js\";\n\n/**\n * The `ProcessTask` class is responsible for processing a batch of entries\n * based on the provided parameters. It uses a gateway to perform the actual\n * processing and maintains the results of the operations, including successfully\n * processed and failed entries.\n */\nexport class ProcessTask {\n private readonly result: ProcessTaskResult;\n\n constructor(\n private bulkAction: EntriesBulkAction.Interface,\n private getModel: GetModelUseCase.Interface\n ) {\n this.result = new ProcessTaskResult();\n }\n\n async execute({ input, controller }: IBulkActionOperationTaskParams) {\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 });\n }\n\n // Check if the input contains a model ID.\n if (!input.modelId) {\n return controller.response.error(`Missing \"modelId\" in the input.`);\n }\n\n // Check if the model exists.\n const modelResult = await this.getModel.execute(input.modelId);\n\n if (modelResult.isFail()) {\n return controller.response.error(`Model with ${input.modelId} not found!`);\n }\n\n const model = modelResult.value;\n\n // Check if there are any IDs to process.\n if (!input.ids || input.ids.length === 0) {\n return controller.response.done(\n `Task done: no entries to process for \"${input.modelId}\" model.`,\n {\n done: [],\n failed: []\n }\n );\n }\n\n // Process each ID in the input.\n for (const id of input.ids) {\n try {\n // Execute the gateway operation for the current ID.\n await this.bulkAction.processData(model, {\n id,\n data: input.data\n });\n\n // Add the ID to the list of successfully processed entries.\n this.result.addDone(id);\n } catch (ex) {\n console.error(ex.message || `Failed to process entry with id \"${id}\".`);\n // Add the ID to the list of failed entries.\n this.result.addFailed(id);\n }\n }\n\n // Return a done response with the results of the processing.\n return controller.response.done(\n `Task done: all entries processed for \"${model.name}\" model.`,\n {\n done: this.result.getDone(),\n failed: this.result.getFailed()\n }\n );\n } catch (ex) {\n return controller.response.error(ex.message ?? `Error while processing task.`);\n }\n }\n}\n"],"names":["ProcessTask","bulkAction","getModel","ProcessTaskResult","input","controller","modelResult","model","id","ex","console"],"mappings":";AAWO,MAAMA;IAGT,YACYC,UAAuC,EACvCC,QAAmC,CAC7C;aAFUD,UAAU,GAAVA;aACAC,QAAQ,GAARA;QAER,IAAI,CAAC,MAAM,GAAG,IAAIC;IACtB;IAEA,MAAM,QAAQ,EAAEC,KAAK,EAAEC,UAAU,EAAkC,EAAE;QACjE,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;YACZ;YAIJ,IAAI,CAACA,MAAM,OAAO,EACd,OAAOC,WAAW,QAAQ,CAAC,KAAK,CAAC;YAIrC,MAAMC,cAAc,MAAM,IAAI,CAAC,QAAQ,CAAC,OAAO,CAACF,MAAM,OAAO;YAE7D,IAAIE,YAAY,MAAM,IAClB,OAAOD,WAAW,QAAQ,CAAC,KAAK,CAAC,CAAC,WAAW,EAAED,MAAM,OAAO,CAAC,WAAW,CAAC;YAG7E,MAAMG,QAAQD,YAAY,KAAK;YAG/B,IAAI,CAACF,MAAM,GAAG,IAAIA,AAAqB,MAArBA,MAAM,GAAG,CAAC,MAAM,EAC9B,OAAOC,WAAW,QAAQ,CAAC,IAAI,CAC3B,CAAC,sCAAsC,EAAED,MAAM,OAAO,CAAC,QAAQ,CAAC,EAChE;gBACI,MAAM,EAAE;gBACR,QAAQ,EAAE;YACd;YAKR,KAAK,MAAMI,MAAMJ,MAAM,GAAG,CACtB,IAAI;gBAEA,MAAM,IAAI,CAAC,UAAU,CAAC,WAAW,CAACG,OAAO;oBACrCC;oBACA,MAAMJ,MAAM,IAAI;gBACpB;gBAGA,IAAI,CAAC,MAAM,CAAC,OAAO,CAACI;YACxB,EAAE,OAAOC,IAAI;gBACTC,QAAQ,KAAK,CAACD,GAAG,OAAO,IAAI,CAAC,iCAAiC,EAAED,GAAG,EAAE,CAAC;gBAEtE,IAAI,CAAC,MAAM,CAAC,SAAS,CAACA;YAC1B;YAIJ,OAAOH,WAAW,QAAQ,CAAC,IAAI,CAC3B,CAAC,sCAAsC,EAAEE,MAAM,IAAI,CAAC,QAAQ,CAAC,EAC7D;gBACI,MAAM,IAAI,CAAC,MAAM,CAAC,OAAO;gBACzB,QAAQ,IAAI,CAAC,MAAM,CAAC,SAAS;YACjC;QAER,EAAE,OAAOE,IAAI;YACT,OAAOJ,WAAW,QAAQ,CAAC,KAAK,CAACI,GAAG,OAAO,IAAI;QACnD;IACJ;AACJ"}
|
|
@@ -8,7 +8,7 @@ class ProcessTasksByModel {
|
|
|
8
8
|
async execute({ input, controller }) {
|
|
9
9
|
try {
|
|
10
10
|
if (controller.runtime.isAborted()) return controller.response.aborted();
|
|
11
|
-
|
|
11
|
+
if (controller.runtime.isCloseToTimeout()) return controller.response.continue({
|
|
12
12
|
...input,
|
|
13
13
|
action: BulkActionOperationByModelAction.PROCESS_SUBTASKS
|
|
14
14
|
});
|
|
@@ -1 +1 @@
|
|
|
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;
|
|
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"}
|
|
@@ -10,6 +10,6 @@ declare class MoveToFolderBulkActionImpl implements EntriesBulkAction.Interface
|
|
|
10
10
|
processData(model: EntriesBulkAction.Model, params: EntriesBulkAction.ProcessParams): Promise<void>;
|
|
11
11
|
}
|
|
12
12
|
export declare const MoveToFolderBulkAction: typeof MoveToFolderBulkActionImpl & {
|
|
13
|
-
__abstraction: import("@webiny/di").Abstraction<import("~/features/EntriesBulkAction/abstractions.js").IEntriesBulkAction
|
|
13
|
+
__abstraction: import("@webiny/di").Abstraction<import("~/features/EntriesBulkAction/abstractions.js").IEntriesBulkAction<Record<string, any>>>;
|
|
14
14
|
};
|
|
15
15
|
export {};
|
|
@@ -10,6 +10,6 @@ declare class MoveToTrashBulkActionImpl implements EntriesBulkAction.Interface {
|
|
|
10
10
|
processData(model: EntriesBulkAction.Model, params: EntriesBulkAction.ProcessParams): Promise<void>;
|
|
11
11
|
}
|
|
12
12
|
export declare const MoveToTrashBulkAction: typeof MoveToTrashBulkActionImpl & {
|
|
13
|
-
__abstraction: import("@webiny/di").Abstraction<import("~/features/EntriesBulkAction/abstractions.js").IEntriesBulkAction
|
|
13
|
+
__abstraction: import("@webiny/di").Abstraction<import("~/features/EntriesBulkAction/abstractions.js").IEntriesBulkAction<Record<string, any>>>;
|
|
14
14
|
};
|
|
15
15
|
export {};
|
|
@@ -10,6 +10,6 @@ declare class PublishEntriesBulkActionImpl implements EntriesBulkAction.Interfac
|
|
|
10
10
|
processData(model: EntriesBulkAction.Model, params: EntriesBulkAction.ProcessParams): Promise<void>;
|
|
11
11
|
}
|
|
12
12
|
export declare const PublishEntriesBulkAction: typeof PublishEntriesBulkActionImpl & {
|
|
13
|
-
__abstraction: import("@webiny/di").Abstraction<import("~/features/EntriesBulkAction/abstractions.js").IEntriesBulkAction
|
|
13
|
+
__abstraction: import("@webiny/di").Abstraction<import("~/features/EntriesBulkAction/abstractions.js").IEntriesBulkAction<Record<string, any>>>;
|
|
14
14
|
};
|
|
15
15
|
export {};
|
|
@@ -10,6 +10,6 @@ declare class RestoreEntriesBulkActionImpl implements EntriesBulkAction.Interfac
|
|
|
10
10
|
processData(model: EntriesBulkAction.Model, params: EntriesBulkAction.ProcessParams): Promise<void>;
|
|
11
11
|
}
|
|
12
12
|
export declare const RestoreEntriesBulkAction: typeof RestoreEntriesBulkActionImpl & {
|
|
13
|
-
__abstraction: import("@webiny/di").Abstraction<import("~/features/EntriesBulkAction/abstractions.js").IEntriesBulkAction
|
|
13
|
+
__abstraction: import("@webiny/di").Abstraction<import("~/features/EntriesBulkAction/abstractions.js").IEntriesBulkAction<Record<string, any>>>;
|
|
14
14
|
};
|
|
15
15
|
export {};
|
|
@@ -10,6 +10,6 @@ declare class UnpublishEntriesBulkActionImpl implements EntriesBulkAction.Interf
|
|
|
10
10
|
processData(model: EntriesBulkAction.Model, params: EntriesBulkAction.ProcessParams): Promise<void>;
|
|
11
11
|
}
|
|
12
12
|
export declare const UnpublishEntriesBulkAction: typeof UnpublishEntriesBulkActionImpl & {
|
|
13
|
-
__abstraction: import("@webiny/di").Abstraction<import("~/features/EntriesBulkAction/abstractions.js").IEntriesBulkAction
|
|
13
|
+
__abstraction: import("@webiny/di").Abstraction<import("~/features/EntriesBulkAction/abstractions.js").IEntriesBulkAction<Record<string, any>>>;
|
|
14
14
|
};
|
|
15
15
|
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@webiny/api-headless-cms-bulk-actions",
|
|
3
|
-
"version": "6.
|
|
3
|
+
"version": "6.5.0-beta.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"exports": {
|
|
6
6
|
".": "./index.js",
|
|
@@ -17,24 +17,24 @@
|
|
|
17
17
|
},
|
|
18
18
|
"license": "MIT",
|
|
19
19
|
"dependencies": {
|
|
20
|
-
"@webiny/api-headless-cms": "6.
|
|
21
|
-
"@webiny/background-tasks": "6.
|
|
22
|
-
"@webiny/feature": "6.
|
|
23
|
-
"@webiny/handler": "6.
|
|
24
|
-
"@webiny/handler-aws": "6.
|
|
25
|
-
"@webiny/utils": "6.
|
|
20
|
+
"@webiny/api-headless-cms": "6.5.0-beta.1",
|
|
21
|
+
"@webiny/background-tasks": "6.5.0-beta.1",
|
|
22
|
+
"@webiny/feature": "6.5.0-beta.1",
|
|
23
|
+
"@webiny/handler": "6.5.0-beta.1",
|
|
24
|
+
"@webiny/handler-aws": "6.5.0-beta.1",
|
|
25
|
+
"@webiny/utils": "6.5.0-beta.1"
|
|
26
26
|
},
|
|
27
27
|
"devDependencies": {
|
|
28
|
-
"@webiny/api": "6.
|
|
29
|
-
"@webiny/api-core": "6.
|
|
30
|
-
"@webiny/build-tools": "6.
|
|
31
|
-
"@webiny/handler-graphql": "6.
|
|
32
|
-
"@webiny/plugins": "6.
|
|
33
|
-
"@webiny/project-utils": "6.
|
|
34
|
-
"@webiny/wcp": "6.
|
|
28
|
+
"@webiny/api": "6.5.0-beta.1",
|
|
29
|
+
"@webiny/api-core": "6.5.0-beta.1",
|
|
30
|
+
"@webiny/build-tools": "6.5.0-beta.1",
|
|
31
|
+
"@webiny/handler-graphql": "6.5.0-beta.1",
|
|
32
|
+
"@webiny/plugins": "6.5.0-beta.1",
|
|
33
|
+
"@webiny/project-utils": "6.5.0-beta.1",
|
|
34
|
+
"@webiny/wcp": "6.5.0-beta.1",
|
|
35
35
|
"graphql": "16.14.2",
|
|
36
|
-
"typescript": "
|
|
37
|
-
"vitest": "
|
|
36
|
+
"typescript": "7.0.2",
|
|
37
|
+
"vitest": "4.1.10"
|
|
38
38
|
},
|
|
39
39
|
"publishConfig": {
|
|
40
40
|
"access": "public"
|
|
@@ -17,7 +17,7 @@ declare class EmptyTrashBinTask implements TaskDefinition.Interface<IEmptyTrashB
|
|
|
17
17
|
readonly description = "Delete all entries in the trash bin for each model in the system.";
|
|
18
18
|
readonly maxIterations = 120;
|
|
19
19
|
readonly databaseLogs = false;
|
|
20
|
-
readonly selfCleanup: ("
|
|
20
|
+
readonly selfCleanup: ("onAbort" | "onSuccess")[];
|
|
21
21
|
constructor(tenantContext: TenantContext.Interface, listTenants: ListTenantsUseCase.Interface, listModels: ListModelsUseCase.Interface, listDeletedEntries: ListDeletedEntriesUseCase.Interface, deleteEntry: DeleteEntryUseCase.Interface);
|
|
22
22
|
run(params: TaskDefinition.RunParams<IEmptyTrashBinsInput, IEmptyTrashBinsOutput>): Promise<TaskDefinition.Result<IEmptyTrashBinsInput, IEmptyTrashBinsOutput>>;
|
|
23
23
|
}
|