@webiny/api-scheduler 0.0.0-unstable.0156a4c312
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/LICENSE +21 -0
- package/README.md +11 -0
- package/ScheduledActionLambdaHandler.d.ts +18 -0
- package/ScheduledActionLambdaHandler.js +41 -0
- package/ScheduledActionLambdaHandler.js.map +1 -0
- package/SchedulerFeature.d.ts +5 -0
- package/SchedulerFeature.js +21 -0
- package/SchedulerFeature.js.map +1 -0
- package/constants.d.ts +13 -0
- package/constants.js +13 -0
- package/constants.js.map +1 -0
- package/domain/SchedulePrivateModel.d.ts +8 -0
- package/domain/SchedulePrivateModel.js +33 -0
- package/domain/SchedulePrivateModel.js.map +1 -0
- package/domain/ScheduledActionId.d.ts +8 -0
- package/domain/ScheduledActionId.js +17 -0
- package/domain/ScheduledActionId.js.map +1 -0
- package/domain/ScheduledActionIdWithVersion.d.ts +3 -0
- package/domain/ScheduledActionIdWithVersion.js +9 -0
- package/domain/ScheduledActionIdWithVersion.js.map +1 -0
- package/domain/ScheduledActionMapper.d.ts +16 -0
- package/domain/ScheduledActionMapper.js +42 -0
- package/domain/ScheduledActionMapper.js.map +1 -0
- package/domain/errors.d.ts +55 -0
- package/domain/errors.js +61 -0
- package/domain/errors.js.map +1 -0
- package/domain/isValidDate.d.ts +6 -0
- package/domain/isValidDate.js +8 -0
- package/domain/isValidDate.js.map +1 -0
- package/exports/api/scheduler.d.ts +10 -0
- package/exports/api/scheduler.js +8 -0
- package/features/CancelScheduledAction/CancelScheduledActionUseCase.d.ts +28 -0
- package/features/CancelScheduledAction/CancelScheduledActionUseCase.js +59 -0
- package/features/CancelScheduledAction/CancelScheduledActionUseCase.js.map +1 -0
- package/features/CancelScheduledAction/abstractions.d.ts +32 -0
- package/features/CancelScheduledAction/abstractions.js +5 -0
- package/features/CancelScheduledAction/abstractions.js.map +1 -0
- package/features/CancelScheduledAction/feature.d.ts +10 -0
- package/features/CancelScheduledAction/feature.js +11 -0
- package/features/CancelScheduledAction/feature.js.map +1 -0
- package/features/CancelScheduledAction/index.d.ts +1 -0
- package/features/CancelScheduledAction/index.js +1 -0
- package/features/ExecuteScheduledAction/ExecuteScheduledActionUseCase.d.ts +33 -0
- package/features/ExecuteScheduledAction/ExecuteScheduledActionUseCase.js +91 -0
- package/features/ExecuteScheduledAction/ExecuteScheduledActionUseCase.js.map +1 -0
- package/features/ExecuteScheduledAction/ScheduledActionHandlerComposite.d.ts +19 -0
- package/features/ExecuteScheduledAction/ScheduledActionHandlerComposite.js +28 -0
- package/features/ExecuteScheduledAction/ScheduledActionHandlerComposite.js.map +1 -0
- package/features/ExecuteScheduledAction/abstractions.d.ts +54 -0
- package/features/ExecuteScheduledAction/abstractions.js +17 -0
- package/features/ExecuteScheduledAction/abstractions.js.map +1 -0
- package/features/ExecuteScheduledAction/feature.d.ts +10 -0
- package/features/ExecuteScheduledAction/feature.js +13 -0
- package/features/ExecuteScheduledAction/feature.js.map +1 -0
- package/features/ExecuteScheduledAction/index.d.ts +1 -0
- package/features/ExecuteScheduledAction/index.js +1 -0
- package/features/GetScheduledAction/GetScheduledActionUseCase.d.ts +28 -0
- package/features/GetScheduledAction/GetScheduledActionUseCase.js +49 -0
- package/features/GetScheduledAction/GetScheduledActionUseCase.js.map +1 -0
- package/features/GetScheduledAction/abstractions.d.ts +33 -0
- package/features/GetScheduledAction/abstractions.js +5 -0
- package/features/GetScheduledAction/abstractions.js.map +1 -0
- package/features/GetScheduledAction/feature.d.ts +10 -0
- package/features/GetScheduledAction/feature.js +11 -0
- package/features/GetScheduledAction/feature.js.map +1 -0
- package/features/GetScheduledAction/index.d.ts +1 -0
- package/features/GetScheduledAction/index.js +1 -0
- package/features/GetTargetScheduledAction/GetTargetScheduledActionUseCase.d.ts +32 -0
- package/features/GetTargetScheduledAction/GetTargetScheduledActionUseCase.js +65 -0
- package/features/GetTargetScheduledAction/GetTargetScheduledActionUseCase.js.map +1 -0
- package/features/GetTargetScheduledAction/abstractions.d.ts +24 -0
- package/features/GetTargetScheduledAction/abstractions.js +5 -0
- package/features/GetTargetScheduledAction/abstractions.js.map +1 -0
- package/features/GetTargetScheduledAction/feature.d.ts +10 -0
- package/features/GetTargetScheduledAction/feature.js +11 -0
- package/features/GetTargetScheduledAction/feature.js.map +1 -0
- package/features/GetTargetScheduledAction/index.d.ts +1 -0
- package/features/GetTargetScheduledAction/index.js +1 -0
- package/features/ListScheduledActions/ListScheduledActionsUseCase.d.ts +31 -0
- package/features/ListScheduledActions/ListScheduledActionsUseCase.js +65 -0
- package/features/ListScheduledActions/ListScheduledActionsUseCase.js.map +1 -0
- package/features/ListScheduledActions/abstractions.d.ts +57 -0
- package/features/ListScheduledActions/abstractions.js +5 -0
- package/features/ListScheduledActions/abstractions.js.map +1 -0
- package/features/ListScheduledActions/feature.d.ts +10 -0
- package/features/ListScheduledActions/feature.js +11 -0
- package/features/ListScheduledActions/feature.js.map +1 -0
- package/features/ListScheduledActions/index.d.ts +1 -0
- package/features/ListScheduledActions/index.js +1 -0
- package/features/NamespaceHandler/NamespaceHandlerExecutioner.d.ts +11 -0
- package/features/NamespaceHandler/NamespaceHandlerExecutioner.js +26 -0
- package/features/NamespaceHandler/NamespaceHandlerExecutioner.js.map +1 -0
- package/features/NamespaceHandler/abstractions.d.ts +50 -0
- package/features/NamespaceHandler/abstractions.js +6 -0
- package/features/NamespaceHandler/abstractions.js.map +1 -0
- package/features/NamespaceHandler/feature.d.ts +4 -0
- package/features/NamespaceHandler/feature.js +11 -0
- package/features/NamespaceHandler/feature.js.map +1 -0
- package/features/NamespaceHandler/index.d.ts +1 -0
- package/features/NamespaceHandler/index.js +1 -0
- package/features/ScheduleAction/ScheduleActionUseCase.d.ts +45 -0
- package/features/ScheduleAction/ScheduleActionUseCase.js +175 -0
- package/features/ScheduleAction/ScheduleActionUseCase.js.map +1 -0
- package/features/ScheduleAction/abstractions.d.ts +36 -0
- package/features/ScheduleAction/abstractions.js +5 -0
- package/features/ScheduleAction/abstractions.js.map +1 -0
- package/features/ScheduleAction/feature.d.ts +10 -0
- package/features/ScheduleAction/feature.js +11 -0
- package/features/ScheduleAction/feature.js.map +1 -0
- package/features/ScheduleAction/index.d.ts +1 -0
- package/features/ScheduleAction/index.js +1 -0
- package/features/ScheduledActionModelProvider.d.ts +26 -0
- package/features/ScheduledActionModelProvider.js +22 -0
- package/features/ScheduledActionModelProvider.js.map +1 -0
- package/features/SchedulerFeature.d.ts +11 -0
- package/features/SchedulerFeature.js +21 -0
- package/features/SchedulerFeature.js.map +1 -0
- package/features/SchedulerService/VoidSchedulerService.d.ts +15 -0
- package/features/SchedulerService/VoidSchedulerService.js +24 -0
- package/features/SchedulerService/VoidSchedulerService.js.map +1 -0
- package/features/permissions/SchedulerPermissionsResolver.d.ts +12 -0
- package/features/permissions/SchedulerPermissionsResolver.js +42 -0
- package/features/permissions/SchedulerPermissionsResolver.js.map +1 -0
- package/features/permissions/abstractions.d.ts +20 -0
- package/features/permissions/abstractions.js +6 -0
- package/features/permissions/abstractions.js.map +1 -0
- package/graphql/SchedulerGraphQLFactory.d.ts +9 -0
- package/graphql/SchedulerGraphQLFactory.js +223 -0
- package/graphql/SchedulerGraphQLFactory.js.map +1 -0
- package/graphql/feature.d.ts +4 -0
- package/graphql/feature.js +11 -0
- package/graphql/feature.js.map +1 -0
- package/graphql/index.d.ts +1 -0
- package/graphql/index.js +1 -0
- package/index.d.ts +5 -0
- package/index.js +4 -0
- package/package.json +43 -0
- package/shared/abstractions.d.ts +113 -0
- package/shared/abstractions.js +7 -0
- package/shared/abstractions.js.map +1 -0
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { Result } from "@webiny/feature/api";
|
|
2
|
+
import { GetTargetScheduledActionUseCase as UseCaseAbstraction } from "./abstractions.js";
|
|
3
|
+
import type { IScheduledAction } from "../../shared/abstractions.js";
|
|
4
|
+
import { ScheduledActionModelProvider } from "../../shared/abstractions.js";
|
|
5
|
+
import { GetEntryByIdUseCase } from "@webiny/api-headless-cms/features/contentEntry/GetEntryById/index.js";
|
|
6
|
+
import type { GenericRecord } from "@webiny/api/types.js";
|
|
7
|
+
import { SchedulerPermissionsResolver } from "../../features/permissions/abstractions.js";
|
|
8
|
+
import { IdentityContext } from "@webiny/api-core/exports/api/security.js";
|
|
9
|
+
/**
|
|
10
|
+
* Retrieves a scheduled action by its ID
|
|
11
|
+
*
|
|
12
|
+
* Flow:
|
|
13
|
+
* 1. Fetch schedule entry from CMS storage by ID
|
|
14
|
+
* 2. Return null if not found
|
|
15
|
+
* 3. Transform CMS entry to IScheduledAction format
|
|
16
|
+
*/
|
|
17
|
+
declare class GetTargetScheduledActionUseCaseImpl implements UseCaseAbstraction.Interface {
|
|
18
|
+
private getEntryByIdUseCase;
|
|
19
|
+
private modelProvider;
|
|
20
|
+
private permissionsResolver;
|
|
21
|
+
private identityContext;
|
|
22
|
+
constructor(getEntryByIdUseCase: GetEntryByIdUseCase.Interface, modelProvider: ScheduledActionModelProvider.Interface, permissionsResolver: SchedulerPermissionsResolver.Interface, identityContext: IdentityContext.Interface);
|
|
23
|
+
execute<T extends GenericRecord>(params: UseCaseAbstraction.Params): Promise<Result<IScheduledAction<T>, UseCaseAbstraction.Error>>;
|
|
24
|
+
/**
|
|
25
|
+
* We always need to fetch both publish and unpublish actions because we don't know the type of the action that is being searched for.
|
|
26
|
+
*/
|
|
27
|
+
private getRecord;
|
|
28
|
+
}
|
|
29
|
+
export declare const GetTargetScheduledActionUseCase: typeof GetTargetScheduledActionUseCaseImpl & {
|
|
30
|
+
__abstraction: import("@webiny/di").Abstraction<import("./abstractions.js").IGetTargetScheduledActionUseCase>;
|
|
31
|
+
};
|
|
32
|
+
export {};
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { Result } from "@webiny/feature/api";
|
|
2
|
+
import { GetTargetScheduledActionUseCase } from "./abstractions.js";
|
|
3
|
+
import { ScheduledActionModelProvider } from "../../shared/abstractions.js";
|
|
4
|
+
import { NotAuthorizedError, ScheduledActionNotFoundError, ScheduledActionPersistenceError } from "../../domain/errors.js";
|
|
5
|
+
import { GetEntryByIdUseCase } from "@webiny/api-headless-cms/features/contentEntry/GetEntryById/index.js";
|
|
6
|
+
import { SchedulerPermissionsResolver } from "../permissions/abstractions.js";
|
|
7
|
+
import { IdentityContext } from "@webiny/api-core/exports/api/security.js";
|
|
8
|
+
import { ScheduledActionMapper } from "../../domain/ScheduledActionMapper.js";
|
|
9
|
+
import { ScheduledActionId } from "../../domain/ScheduledActionId.js";
|
|
10
|
+
import { ScheduledActionIdWithVersion } from "../../domain/ScheduledActionIdWithVersion.js";
|
|
11
|
+
import { SCHEDULED_ACTION_PUBLISH, SCHEDULED_ACTION_UNPUBLISH } from "../../constants.js";
|
|
12
|
+
class GetTargetScheduledActionUseCaseImpl {
|
|
13
|
+
constructor(getEntryByIdUseCase, modelProvider, permissionsResolver, identityContext){
|
|
14
|
+
this.getEntryByIdUseCase = getEntryByIdUseCase;
|
|
15
|
+
this.modelProvider = modelProvider;
|
|
16
|
+
this.permissionsResolver = permissionsResolver;
|
|
17
|
+
this.identityContext = identityContext;
|
|
18
|
+
}
|
|
19
|
+
async execute(params) {
|
|
20
|
+
const { id, namespace } = params;
|
|
21
|
+
const permissions = this.permissionsResolver.forNamespace(namespace);
|
|
22
|
+
if (!await permissions.canRead()) return Result.fail(new NotAuthorizedError());
|
|
23
|
+
const entryResult = await this.getRecord(params);
|
|
24
|
+
if (entryResult.isFail()) {
|
|
25
|
+
if ("Cms/Entry/NotFound" === entryResult.error.code) return Result.fail(new ScheduledActionNotFoundError(id));
|
|
26
|
+
return Result.fail(new ScheduledActionPersistenceError(entryResult.error));
|
|
27
|
+
}
|
|
28
|
+
const ownRecordsOnly = await permissions.onlyOwnRecords();
|
|
29
|
+
if (ownRecordsOnly) {
|
|
30
|
+
if (entryResult.value.createdBy.id !== this.identityContext.getIdentity().id) return Result.fail(new NotAuthorizedError());
|
|
31
|
+
}
|
|
32
|
+
const entry = entryResult.value;
|
|
33
|
+
if (entry.values.namespace !== namespace) return Result.fail(new ScheduledActionNotFoundError(id));
|
|
34
|
+
const action = ScheduledActionMapper.toAction(entry);
|
|
35
|
+
return Result.ok(action);
|
|
36
|
+
}
|
|
37
|
+
async getRecord(params) {
|
|
38
|
+
const model = await this.modelProvider.get();
|
|
39
|
+
const schedulePublishId = ScheduledActionId.from({
|
|
40
|
+
namespace: params.namespace,
|
|
41
|
+
targetId: params.id,
|
|
42
|
+
actionType: SCHEDULED_ACTION_PUBLISH
|
|
43
|
+
});
|
|
44
|
+
const publishResult = await this.getEntryByIdUseCase.execute(model, ScheduledActionIdWithVersion.from(schedulePublishId));
|
|
45
|
+
if (publishResult.isOk()) return publishResult;
|
|
46
|
+
const scheduleUnpublishId = ScheduledActionId.from({
|
|
47
|
+
namespace: params.namespace,
|
|
48
|
+
targetId: params.id,
|
|
49
|
+
actionType: SCHEDULED_ACTION_UNPUBLISH
|
|
50
|
+
});
|
|
51
|
+
return this.getEntryByIdUseCase.execute(model, ScheduledActionIdWithVersion.from(scheduleUnpublishId));
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
const GetTargetScheduledActionUseCase_GetTargetScheduledActionUseCase = GetTargetScheduledActionUseCase.createImplementation({
|
|
55
|
+
implementation: GetTargetScheduledActionUseCaseImpl,
|
|
56
|
+
dependencies: [
|
|
57
|
+
GetEntryByIdUseCase,
|
|
58
|
+
ScheduledActionModelProvider,
|
|
59
|
+
SchedulerPermissionsResolver,
|
|
60
|
+
IdentityContext
|
|
61
|
+
]
|
|
62
|
+
});
|
|
63
|
+
export { GetTargetScheduledActionUseCase_GetTargetScheduledActionUseCase as GetTargetScheduledActionUseCase };
|
|
64
|
+
|
|
65
|
+
//# sourceMappingURL=GetTargetScheduledActionUseCase.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"features/GetTargetScheduledAction/GetTargetScheduledActionUseCase.js","sources":["../../../src/features/GetTargetScheduledAction/GetTargetScheduledActionUseCase.ts"],"sourcesContent":["import { Result } from \"@webiny/feature/api\";\nimport { GetTargetScheduledActionUseCase as UseCaseAbstraction } from \"./abstractions.js\";\nimport type { IScheduledAction, IScheduledActionEntryValues } from \"~/shared/abstractions.js\";\nimport { ScheduledActionModelProvider } from \"~/shared/abstractions.js\";\nimport {\n NotAuthorizedError,\n ScheduledActionNotFoundError,\n ScheduledActionPersistenceError\n} from \"~/domain/errors.js\";\nimport { GetEntryByIdUseCase } from \"@webiny/api-headless-cms/features/contentEntry/GetEntryById/index.js\";\nimport type { GenericRecord } from \"@webiny/api/types.js\";\nimport { SchedulerPermissionsResolver } from \"~/features/permissions/abstractions.js\";\nimport { IdentityContext } from \"@webiny/api-core/exports/api/security.js\";\nimport { ScheduledActionMapper } from \"~/domain/ScheduledActionMapper.js\";\nimport { ScheduledActionId } from \"~/domain/ScheduledActionId.js\";\nimport { ScheduledActionIdWithVersion } from \"~/domain/ScheduledActionIdWithVersion.js\";\nimport { SCHEDULED_ACTION_PUBLISH, SCHEDULED_ACTION_UNPUBLISH } from \"~/constants.js\";\n\n/**\n * Retrieves a scheduled action by its ID\n *\n * Flow:\n * 1. Fetch schedule entry from CMS storage by ID\n * 2. Return null if not found\n * 3. Transform CMS entry to IScheduledAction format\n */\nclass GetTargetScheduledActionUseCaseImpl implements UseCaseAbstraction.Interface {\n constructor(\n private getEntryByIdUseCase: GetEntryByIdUseCase.Interface,\n private modelProvider: ScheduledActionModelProvider.Interface,\n private permissionsResolver: SchedulerPermissionsResolver.Interface,\n private identityContext: IdentityContext.Interface\n ) {}\n\n async execute<T extends GenericRecord>(\n params: UseCaseAbstraction.Params\n ): Promise<Result<IScheduledAction<T>, UseCaseAbstraction.Error>> {\n const { id, namespace } = params;\n const permissions = this.permissionsResolver.forNamespace(namespace);\n if (!(await permissions.canRead())) {\n return Result.fail(new NotAuthorizedError());\n }\n\n const entryResult = await this.getRecord<T>(params);\n\n if (entryResult.isFail()) {\n if (entryResult.error.code === \"Cms/Entry/NotFound\") {\n return Result.fail(new ScheduledActionNotFoundError(id));\n }\n\n return Result.fail(new ScheduledActionPersistenceError(entryResult.error));\n }\n\n const ownRecordsOnly = await permissions.onlyOwnRecords();\n if (ownRecordsOnly) {\n if (entryResult.value.createdBy.id !== this.identityContext.getIdentity().id) {\n return Result.fail(new NotAuthorizedError());\n }\n }\n\n const entry = entryResult.value;\n /**\n * Always check if the namespace is correct because entry is loaded directly, not via filtering.\n */\n if (entry.values.namespace !== namespace) {\n return Result.fail(new ScheduledActionNotFoundError(id));\n }\n const action = ScheduledActionMapper.toAction<T>(entry);\n return Result.ok(action);\n }\n /**\n * We always need to fetch both publish and unpublish actions because we don't know the type of the action that is being searched for.\n */\n private async getRecord<T extends GenericRecord>(params: UseCaseAbstraction.Params) {\n const model = await this.modelProvider.get();\n const schedulePublishId = ScheduledActionId.from({\n namespace: params.namespace,\n targetId: params.id,\n actionType: SCHEDULED_ACTION_PUBLISH\n });\n const publishResult = await this.getEntryByIdUseCase.execute<\n IScheduledActionEntryValues<T>\n >(model, ScheduledActionIdWithVersion.from(schedulePublishId));\n if (publishResult.isOk()) {\n return publishResult;\n }\n const scheduleUnpublishId = ScheduledActionId.from({\n namespace: params.namespace,\n targetId: params.id,\n actionType: SCHEDULED_ACTION_UNPUBLISH\n });\n return this.getEntryByIdUseCase.execute<IScheduledActionEntryValues<T>>(\n model,\n ScheduledActionIdWithVersion.from(scheduleUnpublishId)\n );\n }\n}\n\nexport const GetTargetScheduledActionUseCase = UseCaseAbstraction.createImplementation({\n implementation: GetTargetScheduledActionUseCaseImpl,\n dependencies: [\n GetEntryByIdUseCase,\n ScheduledActionModelProvider,\n SchedulerPermissionsResolver,\n IdentityContext\n ]\n});\n"],"names":["GetTargetScheduledActionUseCaseImpl","getEntryByIdUseCase","modelProvider","permissionsResolver","identityContext","params","id","namespace","permissions","Result","NotAuthorizedError","entryResult","ScheduledActionNotFoundError","ScheduledActionPersistenceError","ownRecordsOnly","entry","action","ScheduledActionMapper","model","schedulePublishId","ScheduledActionId","SCHEDULED_ACTION_PUBLISH","publishResult","ScheduledActionIdWithVersion","scheduleUnpublishId","SCHEDULED_ACTION_UNPUBLISH","GetTargetScheduledActionUseCase","UseCaseAbstraction","GetEntryByIdUseCase","ScheduledActionModelProvider","SchedulerPermissionsResolver","IdentityContext"],"mappings":";;;;;;;;;;;AA0BA,MAAMA;IACF,YACYC,mBAAkD,EAClDC,aAAqD,EACrDC,mBAA2D,EAC3DC,eAA0C,CACpD;aAJUH,mBAAmB,GAAnBA;aACAC,aAAa,GAAbA;aACAC,mBAAmB,GAAnBA;aACAC,eAAe,GAAfA;IACT;IAEH,MAAM,QACFC,MAAiC,EAC6B;QAC9D,MAAM,EAAEC,EAAE,EAAEC,SAAS,EAAE,GAAGF;QAC1B,MAAMG,cAAc,IAAI,CAAC,mBAAmB,CAAC,YAAY,CAACD;QAC1D,IAAI,CAAE,MAAMC,YAAY,OAAO,IAC3B,OAAOC,OAAO,IAAI,CAAC,IAAIC;QAG3B,MAAMC,cAAc,MAAM,IAAI,CAAC,SAAS,CAAIN;QAE5C,IAAIM,YAAY,MAAM,IAAI;YACtB,IAAIA,AAA2B,yBAA3BA,YAAY,KAAK,CAAC,IAAI,EACtB,OAAOF,OAAO,IAAI,CAAC,IAAIG,6BAA6BN;YAGxD,OAAOG,OAAO,IAAI,CAAC,IAAII,gCAAgCF,YAAY,KAAK;QAC5E;QAEA,MAAMG,iBAAiB,MAAMN,YAAY,cAAc;QACvD,IAAIM,gBACA;YAAA,IAAIH,YAAY,KAAK,CAAC,SAAS,CAAC,EAAE,KAAK,IAAI,CAAC,eAAe,CAAC,WAAW,GAAG,EAAE,EACxE,OAAOF,OAAO,IAAI,CAAC,IAAIC;QAC3B;QAGJ,MAAMK,QAAQJ,YAAY,KAAK;QAI/B,IAAII,MAAM,MAAM,CAAC,SAAS,KAAKR,WAC3B,OAAOE,OAAO,IAAI,CAAC,IAAIG,6BAA6BN;QAExD,MAAMU,SAASC,sBAAsB,QAAQ,CAAIF;QACjD,OAAON,OAAO,EAAE,CAACO;IACrB;IAIA,MAAc,UAAmCX,MAAiC,EAAE;QAChF,MAAMa,QAAQ,MAAM,IAAI,CAAC,aAAa,CAAC,GAAG;QAC1C,MAAMC,oBAAoBC,kBAAkB,IAAI,CAAC;YAC7C,WAAWf,OAAO,SAAS;YAC3B,UAAUA,OAAO,EAAE;YACnB,YAAYgB;QAChB;QACA,MAAMC,gBAAgB,MAAM,IAAI,CAAC,mBAAmB,CAAC,OAAO,CAE1DJ,OAAOK,6BAA6B,IAAI,CAACJ;QAC3C,IAAIG,cAAc,IAAI,IAClB,OAAOA;QAEX,MAAME,sBAAsBJ,kBAAkB,IAAI,CAAC;YAC/C,WAAWf,OAAO,SAAS;YAC3B,UAAUA,OAAO,EAAE;YACnB,YAAYoB;QAChB;QACA,OAAO,IAAI,CAAC,mBAAmB,CAAC,OAAO,CACnCP,OACAK,6BAA6B,IAAI,CAACC;IAE1C;AACJ;AAEO,MAAME,kEAAkCC,gCAAAA,oBAAuC,CAAC;IACnF,gBAAgB3B;IAChB,cAAc;QACV4B;QACAC;QACAC;QACAC;KACH;AACL"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { Result } from "@webiny/feature/api";
|
|
2
|
+
import type { IScheduledAction } from "../../shared/abstractions.js";
|
|
3
|
+
import { ScheduledActionNotFoundError, ScheduledActionPersistenceError, NotAuthorizedError } from "../../domain/errors.js";
|
|
4
|
+
import type { GenericRecord } from "@webiny/api/types.js";
|
|
5
|
+
export interface IGetTargetScheduledActionErrors {
|
|
6
|
+
persistence: ScheduledActionPersistenceError;
|
|
7
|
+
notFound: ScheduledActionNotFoundError;
|
|
8
|
+
unauthorized: NotAuthorizedError;
|
|
9
|
+
}
|
|
10
|
+
type GetTargetScheduledActionError = IGetTargetScheduledActionErrors[keyof IGetTargetScheduledActionErrors];
|
|
11
|
+
export interface IGetTargetScheduledActionUseCaseParams {
|
|
12
|
+
namespace: string;
|
|
13
|
+
id: string;
|
|
14
|
+
}
|
|
15
|
+
export interface IGetTargetScheduledActionUseCase {
|
|
16
|
+
execute<T extends GenericRecord>(params: IGetTargetScheduledActionUseCaseParams): Promise<Result<IScheduledAction<T>, GetTargetScheduledActionError>>;
|
|
17
|
+
}
|
|
18
|
+
export declare const GetTargetScheduledActionUseCase: import("@webiny/di").Abstraction<IGetTargetScheduledActionUseCase>;
|
|
19
|
+
export declare namespace GetTargetScheduledActionUseCase {
|
|
20
|
+
type Interface = IGetTargetScheduledActionUseCase;
|
|
21
|
+
type Error = GetTargetScheduledActionError;
|
|
22
|
+
type Params = IGetTargetScheduledActionUseCaseParams;
|
|
23
|
+
}
|
|
24
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"features/GetTargetScheduledAction/abstractions.js","sources":["../../../src/features/GetTargetScheduledAction/abstractions.ts"],"sourcesContent":["import { createAbstraction, Result } from \"@webiny/feature/api\";\nimport type { IScheduledAction } from \"~/shared/abstractions.js\";\nimport {\n ScheduledActionNotFoundError,\n ScheduledActionPersistenceError,\n NotAuthorizedError\n} from \"~/domain/errors.js\";\nimport type { GenericRecord } from \"@webiny/api/types.js\";\n\nexport interface IGetTargetScheduledActionErrors {\n persistence: ScheduledActionPersistenceError;\n notFound: ScheduledActionNotFoundError;\n unauthorized: NotAuthorizedError;\n}\n\ntype GetTargetScheduledActionError =\n IGetTargetScheduledActionErrors[keyof IGetTargetScheduledActionErrors];\n\nexport interface IGetTargetScheduledActionUseCaseParams {\n namespace: string;\n id: string;\n}\n\nexport interface IGetTargetScheduledActionUseCase {\n execute<T extends GenericRecord>(\n params: IGetTargetScheduledActionUseCaseParams\n ): Promise<Result<IScheduledAction<T>, GetTargetScheduledActionError>>;\n}\n\nexport const GetTargetScheduledActionUseCase = createAbstraction<IGetTargetScheduledActionUseCase>(\n \"Scheduler/GetTargetScheduledActionUseCase\"\n);\n\nexport namespace GetTargetScheduledActionUseCase {\n export type Interface = IGetTargetScheduledActionUseCase;\n export type Error = GetTargetScheduledActionError;\n export type Params = IGetTargetScheduledActionUseCaseParams;\n}\n"],"names":["GetTargetScheduledActionUseCase","createAbstraction"],"mappings":";AA6BO,MAAMA,kCAAkCC,kBAC3C"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* GetTargetScheduledAction Feature
|
|
3
|
+
*
|
|
4
|
+
* Provides the ability to retrieve a target scheduled action by ID.
|
|
5
|
+
* Used for checking if schedules exist and displaying schedule details.
|
|
6
|
+
*/
|
|
7
|
+
export declare const GetTargetScheduledActionFeature: {
|
|
8
|
+
name: string;
|
|
9
|
+
register(container: import("@webiny/di").Container): void;
|
|
10
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { createFeature } from "@webiny/feature/api";
|
|
2
|
+
import { GetTargetScheduledActionUseCase } from "./GetTargetScheduledActionUseCase.js";
|
|
3
|
+
const GetTargetScheduledActionFeature = createFeature({
|
|
4
|
+
name: "GetTargetScheduledAction",
|
|
5
|
+
register (container) {
|
|
6
|
+
container.register(GetTargetScheduledActionUseCase);
|
|
7
|
+
}
|
|
8
|
+
});
|
|
9
|
+
export { GetTargetScheduledActionFeature };
|
|
10
|
+
|
|
11
|
+
//# sourceMappingURL=feature.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"features/GetTargetScheduledAction/feature.js","sources":["../../../src/features/GetTargetScheduledAction/feature.ts"],"sourcesContent":["import { createFeature } from \"@webiny/feature/api\";\nimport { GetTargetScheduledActionUseCase } from \"./GetTargetScheduledActionUseCase.js\";\n\n/**\n * GetTargetScheduledAction Feature\n *\n * Provides the ability to retrieve a target scheduled action by ID.\n * Used for checking if schedules exist and displaying schedule details.\n */\nexport const GetTargetScheduledActionFeature = createFeature({\n name: \"GetTargetScheduledAction\",\n register(container) {\n container.register(GetTargetScheduledActionUseCase);\n }\n});\n"],"names":["GetTargetScheduledActionFeature","createFeature","container","GetTargetScheduledActionUseCase"],"mappings":";;AASO,MAAMA,kCAAkCC,cAAc;IACzD,MAAM;IACN,UAASC,SAAS;QACdA,UAAU,QAAQ,CAACC;IACvB;AACJ"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./abstractions.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./abstractions.js";
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { Result } from "@webiny/feature/api";
|
|
2
|
+
import { ListLatestEntriesUseCase } from "@webiny/api-headless-cms/features/contentEntry/ListEntries/abstractions.js";
|
|
3
|
+
import { IListScheduledActionsParams, IListScheduledActionsResponse, ListScheduledActionsUseCase as UseCaseAbstraction } from "./abstractions.js";
|
|
4
|
+
import { ScheduledActionModelProvider } from "../../shared/abstractions.js";
|
|
5
|
+
import { CmsSortMapper, CmsWhereMapper } from "@webiny/api-headless-cms";
|
|
6
|
+
import type { GenericRecord } from "@webiny/api/types.js";
|
|
7
|
+
import { SchedulerPermissionsResolver } from "../../features/permissions/abstractions.js";
|
|
8
|
+
import { IdentityContext } from "@webiny/api-core/exports/api/security.js";
|
|
9
|
+
/**
|
|
10
|
+
* Lists scheduled actions with optional filtering
|
|
11
|
+
*
|
|
12
|
+
* Flow:
|
|
13
|
+
* 1. Build query filters based on where params (namespace, actionType, targetId, etc.)
|
|
14
|
+
* 2. Fetch entries from CMS storage with pagination and sorting
|
|
15
|
+
* 3. Transform CMS entries to IScheduledAction format
|
|
16
|
+
* 4. Return paginated results with metadata
|
|
17
|
+
*/
|
|
18
|
+
declare class ListScheduledActionsUseCaseImpl implements UseCaseAbstraction.Interface {
|
|
19
|
+
private listEntriesUseCase;
|
|
20
|
+
private modelProvider;
|
|
21
|
+
private cmsWhereMapper;
|
|
22
|
+
private cmsSortMapper;
|
|
23
|
+
private permissionsResolver;
|
|
24
|
+
private identityContext;
|
|
25
|
+
constructor(listEntriesUseCase: ListLatestEntriesUseCase.Interface, modelProvider: ScheduledActionModelProvider.Interface, cmsWhereMapper: CmsWhereMapper.Interface, cmsSortMapper: CmsSortMapper.Interface, permissionsResolver: SchedulerPermissionsResolver.Interface, identityContext: IdentityContext.Interface);
|
|
26
|
+
execute<T extends GenericRecord>(params: IListScheduledActionsParams): Promise<Result<IListScheduledActionsResponse<T>, UseCaseAbstraction.Error>>;
|
|
27
|
+
}
|
|
28
|
+
export declare const ListScheduledActionsUseCase: typeof ListScheduledActionsUseCaseImpl & {
|
|
29
|
+
__abstraction: import("@webiny/di").Abstraction<import("./abstractions.js").IListScheduledActionsUseCase>;
|
|
30
|
+
};
|
|
31
|
+
export {};
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { Result } from "@webiny/feature/api";
|
|
2
|
+
import { ListLatestEntriesUseCase } from "@webiny/api-headless-cms/features/contentEntry/ListEntries/abstractions.js";
|
|
3
|
+
import { ListScheduledActionsUseCase } from "./abstractions.js";
|
|
4
|
+
import { ScheduledActionModelProvider } from "../../shared/abstractions.js";
|
|
5
|
+
import { NotAuthorizedError, ScheduledActionPersistenceError } from "../../domain/errors.js";
|
|
6
|
+
import { CmsSortMapper, CmsWhereMapper } from "@webiny/api-headless-cms";
|
|
7
|
+
import { SchedulerPermissionsResolver } from "../permissions/abstractions.js";
|
|
8
|
+
import { IdentityContext } from "@webiny/api-core/exports/api/security.js";
|
|
9
|
+
import { ScheduledActionMapper } from "../../domain/ScheduledActionMapper.js";
|
|
10
|
+
class ListScheduledActionsUseCaseImpl {
|
|
11
|
+
constructor(listEntriesUseCase, modelProvider, cmsWhereMapper, cmsSortMapper, permissionsResolver, identityContext){
|
|
12
|
+
this.listEntriesUseCase = listEntriesUseCase;
|
|
13
|
+
this.modelProvider = modelProvider;
|
|
14
|
+
this.cmsWhereMapper = cmsWhereMapper;
|
|
15
|
+
this.cmsSortMapper = cmsSortMapper;
|
|
16
|
+
this.permissionsResolver = permissionsResolver;
|
|
17
|
+
this.identityContext = identityContext;
|
|
18
|
+
}
|
|
19
|
+
async execute(params) {
|
|
20
|
+
const namespace = params.where?.namespace || params.where?.namespace_startsWith;
|
|
21
|
+
const permissions = this.permissionsResolver.forNamespace(namespace);
|
|
22
|
+
if (!await permissions.canRead()) return Result.fail(new NotAuthorizedError());
|
|
23
|
+
const ownRecordsOnly = await permissions.onlyOwnRecords();
|
|
24
|
+
const { where: initialWhere, sort: sortInput, limit, after } = params;
|
|
25
|
+
const model = await this.modelProvider.get();
|
|
26
|
+
const where = this.cmsWhereMapper.map({
|
|
27
|
+
input: initialWhere || {},
|
|
28
|
+
fields: model.fields
|
|
29
|
+
});
|
|
30
|
+
if (ownRecordsOnly) {
|
|
31
|
+
const identity = this.identityContext.getIdentity();
|
|
32
|
+
where.createdBy = identity.id;
|
|
33
|
+
}
|
|
34
|
+
const sort = this.cmsSortMapper.map({
|
|
35
|
+
input: sortInput,
|
|
36
|
+
fields: model.fields
|
|
37
|
+
});
|
|
38
|
+
const listResult = await this.listEntriesUseCase.execute(model, {
|
|
39
|
+
where,
|
|
40
|
+
sort,
|
|
41
|
+
limit,
|
|
42
|
+
after
|
|
43
|
+
});
|
|
44
|
+
if (listResult.isFail()) return Result.fail(new ScheduledActionPersistenceError(listResult.error));
|
|
45
|
+
const { entries, meta } = listResult.value;
|
|
46
|
+
return Result.ok({
|
|
47
|
+
items: ScheduledActionMapper.toActions(entries),
|
|
48
|
+
meta
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
const ListScheduledActionsUseCase_ListScheduledActionsUseCase = ListScheduledActionsUseCase.createImplementation({
|
|
53
|
+
implementation: ListScheduledActionsUseCaseImpl,
|
|
54
|
+
dependencies: [
|
|
55
|
+
ListLatestEntriesUseCase,
|
|
56
|
+
ScheduledActionModelProvider,
|
|
57
|
+
CmsWhereMapper,
|
|
58
|
+
CmsSortMapper,
|
|
59
|
+
SchedulerPermissionsResolver,
|
|
60
|
+
IdentityContext
|
|
61
|
+
]
|
|
62
|
+
});
|
|
63
|
+
export { ListScheduledActionsUseCase_ListScheduledActionsUseCase as ListScheduledActionsUseCase };
|
|
64
|
+
|
|
65
|
+
//# sourceMappingURL=ListScheduledActionsUseCase.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"features/ListScheduledActions/ListScheduledActionsUseCase.js","sources":["../../../src/features/ListScheduledActions/ListScheduledActionsUseCase.ts"],"sourcesContent":["import { Result } from \"@webiny/feature/api\";\nimport { ListLatestEntriesUseCase } from \"@webiny/api-headless-cms/features/contentEntry/ListEntries/abstractions.js\";\nimport {\n IListScheduledActionsParams,\n IListScheduledActionsResponse,\n ListScheduledActionsUseCase as UseCaseAbstraction\n} from \"./abstractions.js\";\nimport type { IScheduledActionEntryValues } from \"~/shared/abstractions.js\";\nimport { ScheduledActionModelProvider } from \"~/shared/abstractions.js\";\nimport { NotAuthorizedError, ScheduledActionPersistenceError } from \"~/domain/errors.js\";\nimport { CmsSortMapper, CmsWhereMapper } from \"@webiny/api-headless-cms\";\nimport type { GenericRecord } from \"@webiny/api/types.js\";\nimport { SchedulerPermissionsResolver } from \"~/features/permissions/abstractions.js\";\nimport { IdentityContext } from \"@webiny/api-core/exports/api/security.js\";\nimport { ScheduledActionMapper } from \"~/domain/ScheduledActionMapper.js\";\n\n/**\n * Lists scheduled actions with optional filtering\n *\n * Flow:\n * 1. Build query filters based on where params (namespace, actionType, targetId, etc.)\n * 2. Fetch entries from CMS storage with pagination and sorting\n * 3. Transform CMS entries to IScheduledAction format\n * 4. Return paginated results with metadata\n */\nclass ListScheduledActionsUseCaseImpl implements UseCaseAbstraction.Interface {\n constructor(\n private listEntriesUseCase: ListLatestEntriesUseCase.Interface,\n private modelProvider: ScheduledActionModelProvider.Interface,\n private cmsWhereMapper: CmsWhereMapper.Interface,\n private cmsSortMapper: CmsSortMapper.Interface,\n private permissionsResolver: SchedulerPermissionsResolver.Interface,\n private identityContext: IdentityContext.Interface\n ) {}\n\n async execute<T extends GenericRecord>(\n params: IListScheduledActionsParams\n ): Promise<Result<IListScheduledActionsResponse<T>, UseCaseAbstraction.Error>> {\n const namespace = params.where?.namespace || params.where?.namespace_startsWith;\n const permissions = this.permissionsResolver.forNamespace(namespace);\n\n if (!(await permissions.canRead())) {\n return Result.fail(new NotAuthorizedError());\n }\n\n const ownRecordsOnly = await permissions.onlyOwnRecords();\n\n const { where: initialWhere, sort: sortInput, limit, after } = params;\n const model = await this.modelProvider.get();\n\n const where = this.cmsWhereMapper.map({\n input: initialWhere || {},\n fields: model.fields\n });\n\n if (ownRecordsOnly) {\n const identity = this.identityContext.getIdentity();\n where!.createdBy = identity.id;\n }\n\n const sort = this.cmsSortMapper.map({\n input: sortInput,\n fields: model.fields\n });\n // List entries from CMS\n const listResult = await this.listEntriesUseCase.execute<IScheduledActionEntryValues<T>>(\n model,\n {\n where,\n sort,\n limit,\n after\n }\n );\n\n if (listResult.isFail()) {\n return Result.fail(new ScheduledActionPersistenceError(listResult.error));\n }\n\n const { entries, meta } = listResult.value;\n\n return Result.ok({\n items: ScheduledActionMapper.toActions<T>(entries),\n meta\n });\n }\n}\n\nexport const ListScheduledActionsUseCase = UseCaseAbstraction.createImplementation({\n implementation: ListScheduledActionsUseCaseImpl,\n dependencies: [\n ListLatestEntriesUseCase,\n ScheduledActionModelProvider,\n CmsWhereMapper,\n CmsSortMapper,\n SchedulerPermissionsResolver,\n IdentityContext\n ]\n});\n"],"names":["ListScheduledActionsUseCaseImpl","listEntriesUseCase","modelProvider","cmsWhereMapper","cmsSortMapper","permissionsResolver","identityContext","params","namespace","permissions","Result","NotAuthorizedError","ownRecordsOnly","initialWhere","sortInput","limit","after","model","where","identity","sort","listResult","ScheduledActionPersistenceError","entries","meta","ScheduledActionMapper","ListScheduledActionsUseCase","UseCaseAbstraction","ListLatestEntriesUseCase","ScheduledActionModelProvider","CmsWhereMapper","CmsSortMapper","SchedulerPermissionsResolver","IdentityContext"],"mappings":";;;;;;;;;AAyBA,MAAMA;IACF,YACYC,kBAAsD,EACtDC,aAAqD,EACrDC,cAAwC,EACxCC,aAAsC,EACtCC,mBAA2D,EAC3DC,eAA0C,CACpD;aANUL,kBAAkB,GAAlBA;aACAC,aAAa,GAAbA;aACAC,cAAc,GAAdA;aACAC,aAAa,GAAbA;aACAC,mBAAmB,GAAnBA;aACAC,eAAe,GAAfA;IACT;IAEH,MAAM,QACFC,MAAmC,EACwC;QAC3E,MAAMC,YAAYD,OAAO,KAAK,EAAE,aAAaA,OAAO,KAAK,EAAE;QAC3D,MAAME,cAAc,IAAI,CAAC,mBAAmB,CAAC,YAAY,CAACD;QAE1D,IAAI,CAAE,MAAMC,YAAY,OAAO,IAC3B,OAAOC,OAAO,IAAI,CAAC,IAAIC;QAG3B,MAAMC,iBAAiB,MAAMH,YAAY,cAAc;QAEvD,MAAM,EAAE,OAAOI,YAAY,EAAE,MAAMC,SAAS,EAAEC,KAAK,EAAEC,KAAK,EAAE,GAAGT;QAC/D,MAAMU,QAAQ,MAAM,IAAI,CAAC,aAAa,CAAC,GAAG;QAE1C,MAAMC,QAAQ,IAAI,CAAC,cAAc,CAAC,GAAG,CAAC;YAClC,OAAOL,gBAAgB,CAAC;YACxB,QAAQI,MAAM,MAAM;QACxB;QAEA,IAAIL,gBAAgB;YAChB,MAAMO,WAAW,IAAI,CAAC,eAAe,CAAC,WAAW;YACjDD,MAAO,SAAS,GAAGC,SAAS,EAAE;QAClC;QAEA,MAAMC,OAAO,IAAI,CAAC,aAAa,CAAC,GAAG,CAAC;YAChC,OAAON;YACP,QAAQG,MAAM,MAAM;QACxB;QAEA,MAAMI,aAAa,MAAM,IAAI,CAAC,kBAAkB,CAAC,OAAO,CACpDJ,OACA;YACIC;YACAE;YACAL;YACAC;QACJ;QAGJ,IAAIK,WAAW,MAAM,IACjB,OAAOX,OAAO,IAAI,CAAC,IAAIY,gCAAgCD,WAAW,KAAK;QAG3E,MAAM,EAAEE,OAAO,EAAEC,IAAI,EAAE,GAAGH,WAAW,KAAK;QAE1C,OAAOX,OAAO,EAAE,CAAC;YACb,OAAOe,sBAAsB,SAAS,CAAIF;YAC1CC;QACJ;IACJ;AACJ;AAEO,MAAME,0DAA8BC,4BAAAA,oBAAuC,CAAC;IAC/E,gBAAgB3B;IAChB,cAAc;QACV4B;QACAC;QACAC;QACAC;QACAC;QACAC;KACH;AACL"}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { Result } from "@webiny/feature/api";
|
|
2
|
+
import type { IScheduledAction, ScheduledActionType } from "../../shared/abstractions.js";
|
|
3
|
+
import { ScheduledActionPersistenceError, NotAuthorizedError } from "../../domain/errors.js";
|
|
4
|
+
import type { CmsEntryListSort, CmsEntryMeta } from "@webiny/api-headless-cms/types/index.js";
|
|
5
|
+
import type { GenericRecord } from "@webiny/api/types.js";
|
|
6
|
+
/**
|
|
7
|
+
* ListScheduledActionsUseCase - List scheduled actions with optional filtering
|
|
8
|
+
*
|
|
9
|
+
* Used to retrieve all scheduled actions for a namespace (e.g., all actions for Article model)
|
|
10
|
+
* or all actions of a specific type across namespaces.
|
|
11
|
+
*
|
|
12
|
+
* This is critical for CMS CRUD views where we need to show ALL scheduled actions
|
|
13
|
+
* (publish, unpublish, delete) for a specific content model.
|
|
14
|
+
*/
|
|
15
|
+
export type DateISOString = `${number}-${number}-${number}T${number}:${number}:${number}.${number}Z`;
|
|
16
|
+
export interface IListScheduledActionsWhere {
|
|
17
|
+
namespace?: string;
|
|
18
|
+
namespace_startsWith?: string;
|
|
19
|
+
actionType?: ScheduledActionType;
|
|
20
|
+
targetId?: string;
|
|
21
|
+
targetId_startsWith?: string;
|
|
22
|
+
scheduledBy?: string;
|
|
23
|
+
scheduledFor?: DateISOString;
|
|
24
|
+
scheduledFor_gte?: DateISOString;
|
|
25
|
+
scheduledFor_lte?: DateISOString;
|
|
26
|
+
}
|
|
27
|
+
export type IListScheduledActionsMeta = CmsEntryMeta;
|
|
28
|
+
export interface IListScheduledActionsParams {
|
|
29
|
+
where: IListScheduledActionsWhere;
|
|
30
|
+
sort?: CmsEntryListSort;
|
|
31
|
+
limit?: number;
|
|
32
|
+
after?: string;
|
|
33
|
+
}
|
|
34
|
+
export interface IListScheduledActionsResponse<T extends GenericRecord> {
|
|
35
|
+
items: IScheduledAction<T>[];
|
|
36
|
+
meta: CmsEntryMeta;
|
|
37
|
+
}
|
|
38
|
+
export interface IListScheduledActionsErrors {
|
|
39
|
+
persistence: ScheduledActionPersistenceError;
|
|
40
|
+
unauthorized: NotAuthorizedError;
|
|
41
|
+
}
|
|
42
|
+
type ListScheduledActionsError = IListScheduledActionsErrors[keyof IListScheduledActionsErrors];
|
|
43
|
+
export interface IListScheduledActionsUseCase {
|
|
44
|
+
execute<T extends GenericRecord>(params: IListScheduledActionsParams): Promise<Result<IListScheduledActionsResponse<T>, ListScheduledActionsError>>;
|
|
45
|
+
}
|
|
46
|
+
/** List scheduled actions. */
|
|
47
|
+
export declare const ListScheduledActionsUseCase: import("@webiny/di").Abstraction<IListScheduledActionsUseCase>;
|
|
48
|
+
export declare namespace ListScheduledActionsUseCase {
|
|
49
|
+
type Interface = IListScheduledActionsUseCase;
|
|
50
|
+
type Error = ListScheduledActionsError;
|
|
51
|
+
type Params = IListScheduledActionsParams;
|
|
52
|
+
type Where = IListScheduledActionsWhere;
|
|
53
|
+
type Sort = CmsEntryListSort;
|
|
54
|
+
type Meta = IListScheduledActionsMeta;
|
|
55
|
+
type Response<T extends GenericRecord> = IListScheduledActionsResponse<T>;
|
|
56
|
+
}
|
|
57
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"features/ListScheduledActions/abstractions.js","sources":["../../../src/features/ListScheduledActions/abstractions.ts"],"sourcesContent":["import { createAbstraction } from \"@webiny/feature/api\";\nimport { Result } from \"@webiny/feature/api\";\nimport type { IScheduledAction, ScheduledActionType } from \"~/shared/abstractions.js\";\nimport { ScheduledActionPersistenceError, NotAuthorizedError } from \"~/domain/errors.js\";\nimport type { CmsEntryListSort, CmsEntryMeta } from \"@webiny/api-headless-cms/types/index.js\";\nimport type { GenericRecord } from \"@webiny/api/types.js\";\n\n/**\n * ListScheduledActionsUseCase - List scheduled actions with optional filtering\n *\n * Used to retrieve all scheduled actions for a namespace (e.g., all actions for Article model)\n * or all actions of a specific type across namespaces.\n *\n * This is critical for CMS CRUD views where we need to show ALL scheduled actions\n * (publish, unpublish, delete) for a specific content model.\n */\n\nexport type DateISOString =\n `${number}-${number}-${number}T${number}:${number}:${number}.${number}Z`;\n\nexport interface IListScheduledActionsWhere {\n namespace?: string;\n namespace_startsWith?: string;\n actionType?: ScheduledActionType;\n targetId?: string;\n targetId_startsWith?: string;\n scheduledBy?: string;\n scheduledFor?: DateISOString;\n scheduledFor_gte?: DateISOString;\n scheduledFor_lte?: DateISOString;\n}\n\nexport type IListScheduledActionsMeta = CmsEntryMeta;\n\nexport interface IListScheduledActionsParams {\n where: IListScheduledActionsWhere;\n sort?: CmsEntryListSort;\n limit?: number;\n after?: string;\n}\n\nexport interface IListScheduledActionsResponse<T extends GenericRecord> {\n items: IScheduledAction<T>[];\n meta: CmsEntryMeta;\n}\n\nexport interface IListScheduledActionsErrors {\n persistence: ScheduledActionPersistenceError;\n unauthorized: NotAuthorizedError;\n}\n\ntype ListScheduledActionsError = IListScheduledActionsErrors[keyof IListScheduledActionsErrors];\n\nexport interface IListScheduledActionsUseCase {\n execute<T extends GenericRecord>(\n params: IListScheduledActionsParams\n ): Promise<Result<IListScheduledActionsResponse<T>, ListScheduledActionsError>>;\n}\n\n/** List scheduled actions. */\nexport const ListScheduledActionsUseCase = createAbstraction<IListScheduledActionsUseCase>(\n \"Scheduler/ListScheduledActionsUseCase\"\n);\n\nexport namespace ListScheduledActionsUseCase {\n export type Interface = IListScheduledActionsUseCase;\n export type Error = ListScheduledActionsError;\n export type Params = IListScheduledActionsParams;\n export type Where = IListScheduledActionsWhere;\n export type Sort = CmsEntryListSort;\n export type Meta = IListScheduledActionsMeta;\n export type Response<T extends GenericRecord> = IListScheduledActionsResponse<T>;\n}\n"],"names":["ListScheduledActionsUseCase","createAbstraction"],"mappings":";AA4DO,MAAMA,8BAA8BC,kBACvC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ListScheduledActions Feature
|
|
3
|
+
*
|
|
4
|
+
* Provides the ability to list scheduled actions with optional filtering by namespace or actionType.
|
|
5
|
+
* Critical for CMS CRUD views showing all scheduled actions for a content model.
|
|
6
|
+
*/
|
|
7
|
+
export declare const ListScheduledActionsFeature: {
|
|
8
|
+
name: string;
|
|
9
|
+
register(container: import("@webiny/di").Container): void;
|
|
10
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { createFeature } from "@webiny/feature/api";
|
|
2
|
+
import { ListScheduledActionsUseCase } from "./ListScheduledActionsUseCase.js";
|
|
3
|
+
const ListScheduledActionsFeature = createFeature({
|
|
4
|
+
name: "ListScheduledActions",
|
|
5
|
+
register (container) {
|
|
6
|
+
container.register(ListScheduledActionsUseCase);
|
|
7
|
+
}
|
|
8
|
+
});
|
|
9
|
+
export { ListScheduledActionsFeature };
|
|
10
|
+
|
|
11
|
+
//# sourceMappingURL=feature.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"features/ListScheduledActions/feature.js","sources":["../../../src/features/ListScheduledActions/feature.ts"],"sourcesContent":["import { createFeature } from \"@webiny/feature/api\";\nimport { ListScheduledActionsUseCase } from \"./ListScheduledActionsUseCase.js\";\n\n/**\n * ListScheduledActions Feature\n *\n * Provides the ability to list scheduled actions with optional filtering by namespace or actionType.\n * Critical for CMS CRUD views showing all scheduled actions for a content model.\n */\nexport const ListScheduledActionsFeature = createFeature({\n name: \"ListScheduledActions\",\n register(container) {\n container.register(ListScheduledActionsUseCase);\n }\n});\n"],"names":["ListScheduledActionsFeature","createFeature","container","ListScheduledActionsUseCase"],"mappings":";;AASO,MAAMA,8BAA8BC,cAAc;IACrD,MAAM;IACN,UAASC,SAAS;QACdA,UAAU,QAAQ,CAACC;IACvB;AACJ"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./abstractions.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./abstractions.js";
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { NamespaceHandler, NamespaceHandlerExecutioner as NamespaceHandlerExecutionerAbstraction } from "./abstractions.js";
|
|
2
|
+
import type { GenericRecord } from "@webiny/api/types.js";
|
|
3
|
+
declare class NamespaceHandlerExecutionerImpl implements NamespaceHandlerExecutionerAbstraction.Interface {
|
|
4
|
+
private readonly namespaceHandlers;
|
|
5
|
+
constructor(namespaceHandlers: NamespaceHandler.Interface<GenericRecord>[]);
|
|
6
|
+
execute(params: NamespaceHandlerExecutionerAbstraction.Params): NamespaceHandlerExecutionerAbstraction.Response;
|
|
7
|
+
}
|
|
8
|
+
export declare const NamespaceHandlerExecutioner: typeof NamespaceHandlerExecutionerImpl & {
|
|
9
|
+
__abstraction: import("@webiny/di").Abstraction<import("./abstractions.js").INamespaceHandlerExecutioner>;
|
|
10
|
+
};
|
|
11
|
+
export {};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { NamespaceHandler, NamespaceHandlerExecutioner } from "./abstractions.js";
|
|
2
|
+
import { Result } from "@webiny/feature/exports/api.js";
|
|
3
|
+
import { NamespaceHandlerNotFoundError } from "../../domain/errors.js";
|
|
4
|
+
class NamespaceHandlerExecutionerImpl {
|
|
5
|
+
constructor(namespaceHandlers){
|
|
6
|
+
this.namespaceHandlers = namespaceHandlers;
|
|
7
|
+
}
|
|
8
|
+
async execute(params) {
|
|
9
|
+
for (const handler of this.namespaceHandlers)if (false !== handler.canHandle(params.namespace)) return handler.execute(params);
|
|
10
|
+
return Result.fail(new NamespaceHandlerNotFoundError(params.namespace));
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
const NamespaceHandlerExecutioner_NamespaceHandlerExecutioner = NamespaceHandlerExecutioner.createImplementation({
|
|
14
|
+
implementation: NamespaceHandlerExecutionerImpl,
|
|
15
|
+
dependencies: [
|
|
16
|
+
[
|
|
17
|
+
NamespaceHandler,
|
|
18
|
+
{
|
|
19
|
+
multiple: true
|
|
20
|
+
}
|
|
21
|
+
]
|
|
22
|
+
]
|
|
23
|
+
});
|
|
24
|
+
export { NamespaceHandlerExecutioner_NamespaceHandlerExecutioner as NamespaceHandlerExecutioner };
|
|
25
|
+
|
|
26
|
+
//# sourceMappingURL=NamespaceHandlerExecutioner.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"features/NamespaceHandler/NamespaceHandlerExecutioner.js","sources":["../../../src/features/NamespaceHandler/NamespaceHandlerExecutioner.ts"],"sourcesContent":["import {\n NamespaceHandler,\n NamespaceHandlerExecutioner as NamespaceHandlerExecutionerAbstraction\n} from \"./abstractions.js\";\nimport { Result } from \"@webiny/feature/exports/api.js\";\nimport { NamespaceHandlerNotFoundError } from \"~/domain/errors.js\";\nimport type { GenericRecord } from \"@webiny/api/types.js\";\n\nclass NamespaceHandlerExecutionerImpl implements NamespaceHandlerExecutionerAbstraction.Interface {\n public constructor(\n private readonly namespaceHandlers: NamespaceHandler.Interface<GenericRecord>[]\n ) {}\n\n public async execute(\n params: NamespaceHandlerExecutionerAbstraction.Params\n ): NamespaceHandlerExecutionerAbstraction.Response {\n for (const handler of this.namespaceHandlers) {\n if (handler.canHandle(params.namespace) === false) {\n continue;\n }\n return handler.execute(params);\n }\n\n return Result.fail(new NamespaceHandlerNotFoundError(params.namespace));\n }\n}\n\nexport const NamespaceHandlerExecutioner =\n NamespaceHandlerExecutionerAbstraction.createImplementation({\n implementation: NamespaceHandlerExecutionerImpl,\n dependencies: [\n [\n NamespaceHandler,\n {\n multiple: true\n }\n ]\n ]\n });\n"],"names":["NamespaceHandlerExecutionerImpl","namespaceHandlers","params","handler","Result","NamespaceHandlerNotFoundError","NamespaceHandlerExecutioner","NamespaceHandlerExecutionerAbstraction","NamespaceHandler"],"mappings":";;;AAQA,MAAMA;IACF,YACqBC,iBAA8D,CACjF;aADmBA,iBAAiB,GAAjBA;IAClB;IAEH,MAAa,QACTC,MAAqD,EACN;QAC/C,KAAK,MAAMC,WAAW,IAAI,CAAC,iBAAiB,CACxC,IAAIA,AAAwC,UAAxCA,QAAQ,SAAS,CAACD,OAAO,SAAS,GAGtC,OAAOC,QAAQ,OAAO,CAACD;QAG3B,OAAOE,OAAO,IAAI,CAAC,IAAIC,8BAA8BH,OAAO,SAAS;IACzE;AACJ;AAEO,MAAMI,0DACTC,4BAAAA,oBAA2D,CAAC;IACxD,gBAAgBP;IAChB,cAAc;QACV;YACIQ;YACA;gBACI,UAAU;YACd;SACH;KACJ;AACL"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { Result } from "@webiny/feature/api";
|
|
2
|
+
import type { GenericRecord } from "@webiny/api/types.js";
|
|
3
|
+
import type { ScheduledActionType } from "../../shared/abstractions.js";
|
|
4
|
+
import { NamespaceHandlerNotFoundError } from "../../domain/errors.js";
|
|
5
|
+
export interface INamespaceHandlerErrors {
|
|
6
|
+
notFound: NamespaceHandlerNotFoundError;
|
|
7
|
+
}
|
|
8
|
+
type NamespaceHandlerError = INamespaceHandlerErrors[keyof INamespaceHandlerErrors];
|
|
9
|
+
/**
|
|
10
|
+
* Handling of specific app.
|
|
11
|
+
*/
|
|
12
|
+
export interface INamespaceHandlerParams {
|
|
13
|
+
scheduleId: string;
|
|
14
|
+
targetId: string;
|
|
15
|
+
actionType: ScheduledActionType;
|
|
16
|
+
namespace: string;
|
|
17
|
+
immediately: boolean | undefined;
|
|
18
|
+
scheduleFor: Date;
|
|
19
|
+
}
|
|
20
|
+
export type INamespaceHandlerResult<T extends GenericRecord = GenericRecord> = T & {
|
|
21
|
+
title: string;
|
|
22
|
+
targetId: string;
|
|
23
|
+
actionType: ScheduledActionType;
|
|
24
|
+
namespace: string;
|
|
25
|
+
scheduleId: string;
|
|
26
|
+
};
|
|
27
|
+
export interface INamespaceHandler<T extends GenericRecord = GenericRecord> {
|
|
28
|
+
canHandle(namespace: string): boolean;
|
|
29
|
+
execute(params: INamespaceHandlerParams): Promise<Result<INamespaceHandlerResult<T>, NamespaceHandlerError>>;
|
|
30
|
+
}
|
|
31
|
+
/** Handle namespace-specific scheduled action logic. */
|
|
32
|
+
export declare const NamespaceHandler: import("@webiny/di").Abstraction<INamespaceHandler<GenericRecord>>;
|
|
33
|
+
export declare namespace NamespaceHandler {
|
|
34
|
+
type Interface<T extends GenericRecord> = INamespaceHandler<T>;
|
|
35
|
+
type Response<T extends GenericRecord> = Promise<Result<INamespaceHandlerResult<T>, NamespaceHandlerError>>;
|
|
36
|
+
type Params = INamespaceHandlerParams;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Executioner of the app handlers.
|
|
40
|
+
*/
|
|
41
|
+
export interface INamespaceHandlerExecutioner {
|
|
42
|
+
execute<T extends GenericRecord = GenericRecord>(params: INamespaceHandlerParams): Promise<Result<INamespaceHandlerResult<T>, NamespaceHandlerError>>;
|
|
43
|
+
}
|
|
44
|
+
export declare const NamespaceHandlerExecutioner: import("@webiny/di").Abstraction<INamespaceHandlerExecutioner>;
|
|
45
|
+
export declare namespace NamespaceHandlerExecutioner {
|
|
46
|
+
type Interface = INamespaceHandlerExecutioner;
|
|
47
|
+
type Response = Promise<Result<INamespaceHandlerResult, NamespaceHandlerError>>;
|
|
48
|
+
type Params = INamespaceHandlerParams;
|
|
49
|
+
}
|
|
50
|
+
export {};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { createAbstraction } from "@webiny/feature/api";
|
|
2
|
+
const NamespaceHandler = createAbstraction("Scheduler/NamespaceHandler");
|
|
3
|
+
const NamespaceHandlerExecutioner = createAbstraction("Scheduler/NamespaceHandlerExecutioner");
|
|
4
|
+
export { NamespaceHandler, NamespaceHandlerExecutioner };
|
|
5
|
+
|
|
6
|
+
//# sourceMappingURL=abstractions.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"features/NamespaceHandler/abstractions.js","sources":["../../../src/features/NamespaceHandler/abstractions.ts"],"sourcesContent":["import { createAbstraction, Result } from \"@webiny/feature/api\";\nimport type { GenericRecord } from \"@webiny/api/types.js\";\nimport type { ScheduledActionType } from \"~/shared/abstractions.js\";\nimport { NamespaceHandlerNotFoundError } from \"~/domain/errors.js\";\n\nexport interface INamespaceHandlerErrors {\n notFound: NamespaceHandlerNotFoundError;\n}\n\ntype NamespaceHandlerError = INamespaceHandlerErrors[keyof INamespaceHandlerErrors];\n/**\n * Handling of specific app.\n */\nexport interface INamespaceHandlerParams {\n scheduleId: string;\n targetId: string;\n actionType: ScheduledActionType;\n namespace: string;\n immediately: boolean | undefined;\n scheduleFor: Date;\n}\n\nexport type INamespaceHandlerResult<T extends GenericRecord = GenericRecord> = T & {\n title: string;\n targetId: string;\n actionType: ScheduledActionType;\n namespace: string;\n scheduleId: string;\n};\n\nexport interface INamespaceHandler<T extends GenericRecord = GenericRecord> {\n canHandle(namespace: string): boolean;\n execute(\n params: INamespaceHandlerParams\n ): Promise<Result<INamespaceHandlerResult<T>, NamespaceHandlerError>>;\n}\n\n/** Handle namespace-specific scheduled action logic. */\nexport const NamespaceHandler = createAbstraction<INamespaceHandler>(\"Scheduler/NamespaceHandler\");\n\nexport namespace NamespaceHandler {\n export type Interface<T extends GenericRecord> = INamespaceHandler<T>;\n export type Response<T extends GenericRecord> = Promise<\n Result<INamespaceHandlerResult<T>, NamespaceHandlerError>\n >;\n export type Params = INamespaceHandlerParams;\n}\n\n/**\n * Executioner of the app handlers.\n */\n\nexport interface INamespaceHandlerExecutioner {\n execute<T extends GenericRecord = GenericRecord>(\n params: INamespaceHandlerParams\n ): Promise<Result<INamespaceHandlerResult<T>, NamespaceHandlerError>>;\n}\n\nexport const NamespaceHandlerExecutioner = createAbstraction<INamespaceHandlerExecutioner>(\n \"Scheduler/NamespaceHandlerExecutioner\"\n);\n\nexport namespace NamespaceHandlerExecutioner {\n export type Interface = INamespaceHandlerExecutioner;\n export type Response = Promise<Result<INamespaceHandlerResult, NamespaceHandlerError>>;\n export type Params = INamespaceHandlerParams;\n}\n"],"names":["NamespaceHandler","createAbstraction","NamespaceHandlerExecutioner"],"mappings":";AAsCO,MAAMA,mBAAmBC,kBAAqC;AAoB9D,MAAMC,8BAA8BD,kBACvC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { createFeature } from "@webiny/feature/api";
|
|
2
|
+
import { NamespaceHandlerExecutioner } from "./NamespaceHandlerExecutioner.js";
|
|
3
|
+
const NamespaceHandlerExecutionerFeature = createFeature({
|
|
4
|
+
name: "NamespaceHandlerExecutioner",
|
|
5
|
+
register (container) {
|
|
6
|
+
container.register(NamespaceHandlerExecutioner);
|
|
7
|
+
}
|
|
8
|
+
});
|
|
9
|
+
export { NamespaceHandlerExecutionerFeature };
|
|
10
|
+
|
|
11
|
+
//# sourceMappingURL=feature.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"features/NamespaceHandler/feature.js","sources":["../../../src/features/NamespaceHandler/feature.ts"],"sourcesContent":["import { createFeature } from \"@webiny/feature/api\";\nimport { NamespaceHandlerExecutioner } from \"./NamespaceHandlerExecutioner.js\";\n\nexport const NamespaceHandlerExecutionerFeature = createFeature({\n name: \"NamespaceHandlerExecutioner\",\n register(container) {\n container.register(NamespaceHandlerExecutioner);\n }\n});\n"],"names":["NamespaceHandlerExecutionerFeature","createFeature","container","NamespaceHandlerExecutioner"],"mappings":";;AAGO,MAAMA,qCAAqCC,cAAc;IAC5D,MAAM;IACN,UAASC,SAAS;QACdA,UAAU,QAAQ,CAACC;IACvB;AACJ"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { NamespaceHandler } from "./abstractions.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { NamespaceHandler } from "./abstractions.js";
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { Result } from "@webiny/feature/api";
|
|
2
|
+
import { IdentityContext } from "@webiny/api-core/features/security/IdentityContext/index.js";
|
|
3
|
+
import { CreateEntryUseCase } from "@webiny/api-headless-cms/features/contentEntry/CreateEntry/index.js";
|
|
4
|
+
import { UpdateEntryUseCase } from "@webiny/api-headless-cms/features/contentEntry/UpdateEntry/index.js";
|
|
5
|
+
import { DeleteEntryUseCase } from "@webiny/api-headless-cms/features/contentEntry/DeleteEntry/index.js";
|
|
6
|
+
import { ScheduleActionUseCase as UseCaseAbstraction } from "./abstractions.js";
|
|
7
|
+
import { GetScheduledActionUseCase } from "../../features/GetScheduledAction/abstractions.js";
|
|
8
|
+
import type { IScheduledAction } from "../../shared/abstractions.js";
|
|
9
|
+
import { ScheduledActionModelProvider, SchedulerService } from "../../shared/abstractions.js";
|
|
10
|
+
import type { GenericRecord } from "@webiny/api/types.js";
|
|
11
|
+
import { NamespaceHandlerExecutioner } from "../../features/NamespaceHandler/abstractions.js";
|
|
12
|
+
/**
|
|
13
|
+
* Schedules an action for future execution
|
|
14
|
+
*
|
|
15
|
+
* Flow:
|
|
16
|
+
* 1. Generate unique schedule ID from namespace+actionType+targetId
|
|
17
|
+
* 2. Check if schedule already exists (for rescheduling logic)
|
|
18
|
+
* 3. If exists: UPDATE schedule entry + scheduler timer
|
|
19
|
+
* 4. If new: CREATE schedule entry + scheduler timer
|
|
20
|
+
* 5. Rollback schedule entry if the scheduler fails
|
|
21
|
+
*/
|
|
22
|
+
declare class ScheduleActionUseCaseImpl implements UseCaseAbstraction.Interface {
|
|
23
|
+
private identityContext;
|
|
24
|
+
private modelProvider;
|
|
25
|
+
private schedulerService;
|
|
26
|
+
private getScheduledAction;
|
|
27
|
+
private createEntryUseCase;
|
|
28
|
+
private updateEntryUseCase;
|
|
29
|
+
private deleteEntryUseCase;
|
|
30
|
+
private namespaceHandlerExecutioner;
|
|
31
|
+
constructor(identityContext: IdentityContext.Interface, modelProvider: ScheduledActionModelProvider.Interface, schedulerService: SchedulerService.Interface, getScheduledAction: GetScheduledActionUseCase.Interface, createEntryUseCase: CreateEntryUseCase.Interface, updateEntryUseCase: UpdateEntryUseCase.Interface, deleteEntryUseCase: DeleteEntryUseCase.Interface, namespaceHandlerExecutioner: NamespaceHandlerExecutioner.Interface);
|
|
32
|
+
execute<T extends GenericRecord>(params: UseCaseAbstraction.Params): Promise<Result<IScheduledAction<T>, UseCaseAbstraction.Error>>;
|
|
33
|
+
/**
|
|
34
|
+
* Creates a new schedule
|
|
35
|
+
*/
|
|
36
|
+
private createSchedule;
|
|
37
|
+
/**
|
|
38
|
+
* Updates an existing schedule (reschedule)
|
|
39
|
+
*/
|
|
40
|
+
private reschedule;
|
|
41
|
+
}
|
|
42
|
+
export declare const ScheduleActionUseCase: typeof ScheduleActionUseCaseImpl & {
|
|
43
|
+
__abstraction: import("@webiny/di").Abstraction<import("./abstractions.js").IScheduleActionUseCase>;
|
|
44
|
+
};
|
|
45
|
+
export {};
|