@webiny/api-headless-cms-scheduler 6.3.0 → 6.4.0-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/context.js +9 -10
- package/context.js.map +1 -1
- package/exports/api/cms/scheduler.js +0 -2
- package/features/CancelScheduledActionOnEntryChange/CancelScheduledActionOnEntryDeleteEventHandler.js +30 -44
- package/features/CancelScheduledActionOnEntryChange/CancelScheduledActionOnEntryDeleteEventHandler.js.map +1 -1
- package/features/CancelScheduledActionOnEntryChange/CancelScheduledActionOnPublishEventHandler.js +25 -39
- package/features/CancelScheduledActionOnEntryChange/CancelScheduledActionOnPublishEventHandler.js.map +1 -1
- package/features/CancelScheduledActionOnEntryChange/CancelScheduledActionOnRevisionDeleteEventHandler.js +24 -38
- package/features/CancelScheduledActionOnEntryChange/CancelScheduledActionOnRevisionDeleteEventHandler.js.map +1 -1
- package/features/CancelScheduledActionOnEntryChange/CancelScheduledActionOnUnpublishEventHandler.js +25 -39
- package/features/CancelScheduledActionOnEntryChange/CancelScheduledActionOnUnpublishEventHandler.js.map +1 -1
- package/features/CancelScheduledActionOnEntryChange/feature.js +9 -16
- package/features/CancelScheduledActionOnEntryChange/feature.js.map +1 -1
- package/features/NamespaceHandler/NamespaceHandler.js +33 -39
- package/features/NamespaceHandler/NamespaceHandler.js.map +1 -1
- package/features/PublishActionHandler/PublishEntryActionHandler.js +75 -97
- package/features/PublishActionHandler/PublishEntryActionHandler.js.map +1 -1
- package/features/SchedulePublishEntryUseCase/SchedulePublishEntryUseCase.js +33 -38
- package/features/SchedulePublishEntryUseCase/SchedulePublishEntryUseCase.js.map +1 -1
- package/features/SchedulePublishEntryUseCase/abstractions.js +3 -3
- package/features/SchedulePublishEntryUseCase/abstractions.js.map +1 -1
- package/features/ScheduleUnpublishEntryUseCase/ScheduleUnpublishEntryUseCase.js +33 -38
- package/features/ScheduleUnpublishEntryUseCase/ScheduleUnpublishEntryUseCase.js.map +1 -1
- package/features/ScheduleUnpublishEntryUseCase/abstractions.js +3 -3
- package/features/ScheduleUnpublishEntryUseCase/abstractions.js.map +1 -1
- package/features/UnpublishActionHandler/UnpublishEntryActionHandler.js +55 -83
- package/features/UnpublishActionHandler/UnpublishEntryActionHandler.js.map +1 -1
- package/index.js +4 -3
- package/index.js.map +1 -1
- package/package.json +16 -16
- package/types.js +0 -3
- package/utils/namespace.js +6 -9
- package/utils/namespace.js.map +1 -1
- package/exports/api/cms/scheduler.js.map +0 -1
- package/types.js.map +0 -1
|
@@ -4,94 +4,66 @@ import { GetEntryByIdUseCase } from "@webiny/api-headless-cms/features/contentEn
|
|
|
4
4
|
import { GetPublishedEntriesByIdsUseCase } from "@webiny/api-headless-cms/features/contentEntry/GetPublishedEntriesByIds";
|
|
5
5
|
import { UnpublishEntryUseCase } from "@webiny/api-headless-cms/features/contentEntry/UnpublishEntry";
|
|
6
6
|
import { extractModelIdFromNamespace } from "../../utils/namespace.js";
|
|
7
|
-
/**
|
|
8
|
-
* Handler for unpublishing CMS entries
|
|
9
|
-
*
|
|
10
|
-
* Handles the "Unpublish" action for CMS entries with namespace pattern: Cms/Entry/{modelId}
|
|
11
|
-
*
|
|
12
|
-
* Unpublishing logic:
|
|
13
|
-
* 1. If entry is not published -> nothing to do (warn)
|
|
14
|
-
* 2. If target entry is published (same revision) -> unpublish it
|
|
15
|
-
* 3. If a different revision is published -> unpublish it anyway
|
|
16
|
-
*/
|
|
17
7
|
class UnpublishEntryActionHandlerImpl {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
}
|
|
24
|
-
canHandle(namespace, actionType) {
|
|
25
|
-
const modelId = extractModelIdFromNamespace(namespace);
|
|
26
|
-
if (!modelId) {
|
|
27
|
-
return false;
|
|
8
|
+
constructor(getModelUseCase, getEntryByIdUseCase, getPublishedEntriesByIdsUseCase, unpublishEntryUseCase){
|
|
9
|
+
this.getModelUseCase = getModelUseCase;
|
|
10
|
+
this.getEntryByIdUseCase = getEntryByIdUseCase;
|
|
11
|
+
this.getPublishedEntriesByIdsUseCase = getPublishedEntriesByIdsUseCase;
|
|
12
|
+
this.unpublishEntryUseCase = unpublishEntryUseCase;
|
|
28
13
|
}
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
payload
|
|
34
|
-
} = action;
|
|
35
|
-
const modelId = payload.modelId;
|
|
36
|
-
|
|
37
|
-
// Fetch the model
|
|
38
|
-
const modelResult = await this.getModelUseCase.execute(modelId);
|
|
39
|
-
if (modelResult.isFail()) {
|
|
40
|
-
console.error(`Failed to get model "${modelId}" for scheduled unpublish action:`, modelResult.error);
|
|
41
|
-
throw new Error(`Model not found: ${modelId}`);
|
|
42
|
-
}
|
|
43
|
-
const model = modelResult.value;
|
|
44
|
-
|
|
45
|
-
// Fetch the target entry
|
|
46
|
-
const targetEntryResult = await this.getEntryByIdUseCase.execute(model, action.targetId);
|
|
47
|
-
if (targetEntryResult.isFail()) {
|
|
48
|
-
console.error(`Failed to get entry "${action.targetId}" for scheduled unpublish action:`, targetEntryResult.error);
|
|
49
|
-
throw new Error(`Entry not found: ${action.targetId}`);
|
|
50
|
-
}
|
|
51
|
-
const targetEntry = targetEntryResult.value;
|
|
52
|
-
|
|
53
|
-
// Get published entries
|
|
54
|
-
const publishedEntriesResult = await this.getPublishedEntriesByIdsUseCase.execute(model, [targetEntry.id]);
|
|
55
|
-
if (publishedEntriesResult.isFail()) {
|
|
56
|
-
console.error(`Failed to get published entries for "${targetEntry.id}":`, publishedEntriesResult.error);
|
|
57
|
-
throw new Error(`Failed to check published entries`);
|
|
14
|
+
canHandle(namespace, actionType) {
|
|
15
|
+
const modelId = extractModelIdFromNamespace(namespace);
|
|
16
|
+
if (!modelId) return false;
|
|
17
|
+
return actionType === ScheduledActionTypeUnpublish;
|
|
58
18
|
}
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
19
|
+
async handle(action) {
|
|
20
|
+
const { payload } = action;
|
|
21
|
+
const modelId = payload.modelId;
|
|
22
|
+
const modelResult = await this.getModelUseCase.execute(modelId);
|
|
23
|
+
if (modelResult.isFail()) {
|
|
24
|
+
console.error(`Failed to get model "${modelId}" for scheduled unpublish action:`, modelResult.error);
|
|
25
|
+
throw new Error(`Model not found: ${modelId}`);
|
|
26
|
+
}
|
|
27
|
+
const model = modelResult.value;
|
|
28
|
+
const targetEntryResult = await this.getEntryByIdUseCase.execute(model, action.targetId);
|
|
29
|
+
if (targetEntryResult.isFail()) {
|
|
30
|
+
console.error(`Failed to get entry "${action.targetId}" for scheduled unpublish action:`, targetEntryResult.error);
|
|
31
|
+
throw new Error(`Entry not found: ${action.targetId}`);
|
|
32
|
+
}
|
|
33
|
+
const targetEntry = targetEntryResult.value;
|
|
34
|
+
const publishedEntriesResult = await this.getPublishedEntriesByIdsUseCase.execute(model, [
|
|
35
|
+
targetEntry.id
|
|
36
|
+
]);
|
|
37
|
+
if (publishedEntriesResult.isFail()) {
|
|
38
|
+
console.error(`Failed to get published entries for "${targetEntry.id}":`, publishedEntriesResult.error);
|
|
39
|
+
throw new Error("Failed to check published entries");
|
|
40
|
+
}
|
|
41
|
+
const [publishedTargetEntry] = publishedEntriesResult.value;
|
|
42
|
+
if (!publishedTargetEntry) return void console.warn(`Entry "${action.targetId}" is not published, nothing to unpublish.`);
|
|
43
|
+
if (publishedTargetEntry.id === action.targetId) {
|
|
44
|
+
const unpublishResult = await this.unpublishEntryUseCase.execute(model, action.targetId);
|
|
45
|
+
if (unpublishResult.isFail()) {
|
|
46
|
+
console.error(`Failed to unpublish entry "${action.targetId}":`, unpublishResult.error);
|
|
47
|
+
throw new Error(`Failed to unpublish entry: ${action.targetId}`);
|
|
48
|
+
}
|
|
49
|
+
return;
|
|
50
|
+
}
|
|
51
|
+
const unpublishResult = await this.unpublishEntryUseCase.execute(model, publishedTargetEntry.id);
|
|
52
|
+
if (unpublishResult.isFail()) {
|
|
53
|
+
console.error(`Failed to unpublish published revision "${publishedTargetEntry.id}":`, unpublishResult.error);
|
|
54
|
+
throw new Error(`Failed to unpublish entry: ${publishedTargetEntry.id}`);
|
|
55
|
+
}
|
|
89
56
|
}
|
|
90
|
-
}
|
|
91
57
|
}
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
58
|
+
const UnpublishEntryActionHandler = ScheduledActionHandler.createImplementation({
|
|
59
|
+
implementation: UnpublishEntryActionHandlerImpl,
|
|
60
|
+
dependencies: [
|
|
61
|
+
GetModelUseCase,
|
|
62
|
+
GetEntryByIdUseCase,
|
|
63
|
+
GetPublishedEntriesByIdsUseCase,
|
|
64
|
+
UnpublishEntryUseCase
|
|
65
|
+
]
|
|
95
66
|
});
|
|
67
|
+
export { UnpublishEntryActionHandler };
|
|
96
68
|
|
|
97
69
|
//# sourceMappingURL=UnpublishEntryActionHandler.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"features/UnpublishActionHandler/UnpublishEntryActionHandler.js","sources":["../../../src/features/UnpublishActionHandler/UnpublishEntryActionHandler.ts"],"sourcesContent":["import {\n type IScheduledAction,\n ScheduledActionHandler,\n ScheduledActionTypeUnpublish\n} from \"@webiny/api-scheduler/exports/api/scheduler.js\";\nimport { GetModelUseCase } from \"@webiny/api-headless-cms/features/contentModel/GetModel\";\nimport { GetEntryByIdUseCase } from \"@webiny/api-headless-cms/features/contentEntry/GetEntryById\";\nimport { GetPublishedEntriesByIdsUseCase } from \"@webiny/api-headless-cms/features/contentEntry/GetPublishedEntriesByIds\";\nimport { UnpublishEntryUseCase } from \"@webiny/api-headless-cms/features/contentEntry/UnpublishEntry\";\nimport type { IScheduledActionPayload } from \"~/types.js\";\nimport { extractModelIdFromNamespace } from \"~/utils/namespace.js\";\nimport type { ScheduledActionType } from \"@webiny/api-scheduler/shared/abstractions.js\";\n\n/**\n * Handler for unpublishing CMS entries\n *\n * Handles the \"Unpublish\" action for CMS entries with namespace pattern: Cms/Entry/{modelId}\n *\n * Unpublishing logic:\n * 1. If entry is not published -> nothing to do (warn)\n * 2. If target entry is published (same revision) -> unpublish it\n * 3. If a different revision is published -> unpublish it anyway\n */\nclass UnpublishEntryActionHandlerImpl implements ScheduledActionHandler.Interface {\n constructor(\n private getModelUseCase: GetModelUseCase.Interface,\n private getEntryByIdUseCase: GetEntryByIdUseCase.Interface,\n private getPublishedEntriesByIdsUseCase: GetPublishedEntriesByIdsUseCase.Interface,\n private unpublishEntryUseCase: UnpublishEntryUseCase.Interface\n ) {}\n\n canHandle(namespace: string, actionType: ScheduledActionType): boolean {\n const modelId = extractModelIdFromNamespace(namespace);\n if (!modelId) {\n return false;\n }\n return actionType === ScheduledActionTypeUnpublish;\n }\n\n async handle(action: IScheduledAction<IScheduledActionPayload>): Promise<void> {\n const { payload } = action;\n\n const modelId = payload.modelId as string;\n\n // Fetch the model\n const modelResult = await this.getModelUseCase.execute(modelId);\n if (modelResult.isFail()) {\n console.error(\n `Failed to get model \"${modelId}\" for scheduled unpublish action:`,\n modelResult.error\n );\n throw new Error(`Model not found: ${modelId}`);\n }\n\n const model = modelResult.value;\n\n // Fetch the target entry\n const targetEntryResult = await this.getEntryByIdUseCase.execute<\n IScheduledAction<IScheduledActionPayload>\n >(model, action.targetId);\n if (targetEntryResult.isFail()) {\n console.error(\n `Failed to get entry \"${action.targetId}\" for scheduled unpublish action:`,\n targetEntryResult.error\n );\n throw new Error(`Entry not found: ${action.targetId}`);\n }\n\n const targetEntry = targetEntryResult.value;\n\n // Get published entries\n const publishedEntriesResult = await this.getPublishedEntriesByIdsUseCase.execute<\n IScheduledAction<IScheduledActionPayload>\n >(model, [targetEntry.id]);\n\n if (publishedEntriesResult.isFail()) {\n console.error(\n `Failed to get published entries for \"${targetEntry.id}\":`,\n publishedEntriesResult.error\n );\n throw new Error(`Failed to check published entries`);\n }\n\n const [publishedTargetEntry] = publishedEntriesResult.value;\n\n /**\n * Scenario 1: Entry is not published -> nothing to do\n */\n if (!publishedTargetEntry) {\n console.warn(`Entry \"${action.targetId}\" is not published, nothing to unpublish.`);\n return;\n }\n\n /**\n * Scenario 2: Target entry is published (same revision) -> unpublish it\n */\n if (publishedTargetEntry.id === action.targetId) {\n const unpublishResult = await this.unpublishEntryUseCase.execute<\n IScheduledAction<IScheduledActionPayload>\n >(model, action.targetId);\n if (unpublishResult.isFail()) {\n console.error(\n `Failed to unpublish entry \"${action.targetId}\":`,\n unpublishResult.error\n );\n throw new Error(`Failed to unpublish entry: ${action.targetId}`);\n }\n return;\n }\n\n /**\n * Scenario 3: A different revision is published -> unpublish it anyway\n * TODO: Determine if we really want to unpublish an entry which does not match the target ID\n */\n const unpublishResult = await this.unpublishEntryUseCase.execute<\n IScheduledAction<IScheduledActionPayload>\n >(model, publishedTargetEntry.id);\n if (unpublishResult.isFail()) {\n console.error(\n `Failed to unpublish published revision \"${publishedTargetEntry.id}\":`,\n unpublishResult.error\n );\n throw new Error(`Failed to unpublish entry: ${publishedTargetEntry.id}`);\n }\n }\n}\n\nexport const UnpublishEntryActionHandler = ScheduledActionHandler.createImplementation({\n implementation: UnpublishEntryActionHandlerImpl,\n dependencies: [\n GetModelUseCase,\n GetEntryByIdUseCase,\n GetPublishedEntriesByIdsUseCase,\n UnpublishEntryUseCase\n ]\n});\n"],"names":["UnpublishEntryActionHandlerImpl","getModelUseCase","getEntryByIdUseCase","getPublishedEntriesByIdsUseCase","unpublishEntryUseCase","namespace","actionType","modelId","extractModelIdFromNamespace","ScheduledActionTypeUnpublish","action","payload","modelResult","console","Error","model","targetEntryResult","targetEntry","publishedEntriesResult","publishedTargetEntry","unpublishResult","UnpublishEntryActionHandler","ScheduledActionHandler","GetModelUseCase","GetEntryByIdUseCase","GetPublishedEntriesByIdsUseCase","UnpublishEntryUseCase"],"mappings":";;;;;;AAuBA,MAAMA;IACF,YACYC,eAA0C,EAC1CC,mBAAkD,EAClDC,+BAA0E,EAC1EC,qBAAsD,CAChE;aAJUH,eAAe,GAAfA;aACAC,mBAAmB,GAAnBA;aACAC,+BAA+B,GAA/BA;aACAC,qBAAqB,GAArBA;IACT;IAEH,UAAUC,SAAiB,EAAEC,UAA+B,EAAW;QACnE,MAAMC,UAAUC,4BAA4BH;QAC5C,IAAI,CAACE,SACD,OAAO;QAEX,OAAOD,eAAeG;IAC1B;IAEA,MAAM,OAAOC,MAAiD,EAAiB;QAC3E,MAAM,EAAEC,OAAO,EAAE,GAAGD;QAEpB,MAAMH,UAAUI,QAAQ,OAAO;QAG/B,MAAMC,cAAc,MAAM,IAAI,CAAC,eAAe,CAAC,OAAO,CAACL;QACvD,IAAIK,YAAY,MAAM,IAAI;YACtBC,QAAQ,KAAK,CACT,CAAC,qBAAqB,EAAEN,QAAQ,iCAAiC,CAAC,EAClEK,YAAY,KAAK;YAErB,MAAM,IAAIE,MAAM,CAAC,iBAAiB,EAAEP,SAAS;QACjD;QAEA,MAAMQ,QAAQH,YAAY,KAAK;QAG/B,MAAMI,oBAAoB,MAAM,IAAI,CAAC,mBAAmB,CAAC,OAAO,CAE9DD,OAAOL,OAAO,QAAQ;QACxB,IAAIM,kBAAkB,MAAM,IAAI;YAC5BH,QAAQ,KAAK,CACT,CAAC,qBAAqB,EAAEH,OAAO,QAAQ,CAAC,iCAAiC,CAAC,EAC1EM,kBAAkB,KAAK;YAE3B,MAAM,IAAIF,MAAM,CAAC,iBAAiB,EAAEJ,OAAO,QAAQ,EAAE;QACzD;QAEA,MAAMO,cAAcD,kBAAkB,KAAK;QAG3C,MAAME,yBAAyB,MAAM,IAAI,CAAC,+BAA+B,CAAC,OAAO,CAE/EH,OAAO;YAACE,YAAY,EAAE;SAAC;QAEzB,IAAIC,uBAAuB,MAAM,IAAI;YACjCL,QAAQ,KAAK,CACT,CAAC,qCAAqC,EAAEI,YAAY,EAAE,CAAC,EAAE,CAAC,EAC1DC,uBAAuB,KAAK;YAEhC,MAAM,IAAIJ,MAAM;QACpB;QAEA,MAAM,CAACK,qBAAqB,GAAGD,uBAAuB,KAAK;QAK3D,IAAI,CAACC,sBAAsB,YACvBN,QAAQ,IAAI,CAAC,CAAC,OAAO,EAAEH,OAAO,QAAQ,CAAC,yCAAyC,CAAC;QAOrF,IAAIS,qBAAqB,EAAE,KAAKT,OAAO,QAAQ,EAAE;YAC7C,MAAMU,kBAAkB,MAAM,IAAI,CAAC,qBAAqB,CAAC,OAAO,CAE9DL,OAAOL,OAAO,QAAQ;YACxB,IAAIU,gBAAgB,MAAM,IAAI;gBAC1BP,QAAQ,KAAK,CACT,CAAC,2BAA2B,EAAEH,OAAO,QAAQ,CAAC,EAAE,CAAC,EACjDU,gBAAgB,KAAK;gBAEzB,MAAM,IAAIN,MAAM,CAAC,2BAA2B,EAAEJ,OAAO,QAAQ,EAAE;YACnE;YACA;QACJ;QAMA,MAAMU,kBAAkB,MAAM,IAAI,CAAC,qBAAqB,CAAC,OAAO,CAE9DL,OAAOI,qBAAqB,EAAE;QAChC,IAAIC,gBAAgB,MAAM,IAAI;YAC1BP,QAAQ,KAAK,CACT,CAAC,wCAAwC,EAAEM,qBAAqB,EAAE,CAAC,EAAE,CAAC,EACtEC,gBAAgB,KAAK;YAEzB,MAAM,IAAIN,MAAM,CAAC,2BAA2B,EAAEK,qBAAqB,EAAE,EAAE;QAC3E;IACJ;AACJ;AAEO,MAAME,8BAA8BC,uBAAuB,oBAAoB,CAAC;IACnF,gBAAgBtB;IAChB,cAAc;QACVuB;QACAC;QACAC;QACAC;KACH;AACL"}
|
package/index.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { createHeadlessCmsScheduleContext } from "./context.js";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
const createHeadlessCmsScheduler = ()=>[
|
|
3
|
+
createHeadlessCmsScheduleContext()
|
|
4
|
+
];
|
|
5
|
+
export { createHeadlessCmsScheduler };
|
|
5
6
|
|
|
6
7
|
//# sourceMappingURL=index.js.map
|
package/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../src/index.ts"],"sourcesContent":["import { createHeadlessCmsScheduleContext } from \"~/context.js\";\nimport { ContextPlugin } from \"@webiny/api\";\n\nexport const createHeadlessCmsScheduler = (): ContextPlugin[] => {\n return [createHeadlessCmsScheduleContext()];\n};\n"],"names":["createHeadlessCmsScheduler","createHeadlessCmsScheduleContext"],"mappings":";AAGO,MAAMA,6BAA6B,IAC/B;QAACC;KAAmC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@webiny/api-headless-cms-scheduler",
|
|
3
|
-
"version": "6.
|
|
3
|
+
"version": "6.4.0-beta.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"exports": {
|
|
6
6
|
".": "./index.js",
|
|
@@ -17,28 +17,28 @@
|
|
|
17
17
|
},
|
|
18
18
|
"license": "MIT",
|
|
19
19
|
"dependencies": {
|
|
20
|
-
"@webiny/api": "6.
|
|
21
|
-
"@webiny/api-headless-cms": "6.
|
|
22
|
-
"@webiny/api-scheduler": "6.
|
|
23
|
-
"@webiny/feature": "6.
|
|
24
|
-
"@webiny/handler-graphql": "6.
|
|
20
|
+
"@webiny/api": "6.4.0-beta.1",
|
|
21
|
+
"@webiny/api-headless-cms": "6.4.0-beta.1",
|
|
22
|
+
"@webiny/api-scheduler": "6.4.0-beta.1",
|
|
23
|
+
"@webiny/feature": "6.4.0-beta.1",
|
|
24
|
+
"@webiny/handler-graphql": "6.4.0-beta.1"
|
|
25
25
|
},
|
|
26
26
|
"devDependencies": {
|
|
27
|
-
"@webiny/api-core": "6.
|
|
28
|
-
"@webiny/aws-sdk": "6.
|
|
29
|
-
"@webiny/build-tools": "6.
|
|
30
|
-
"@webiny/handler": "6.
|
|
31
|
-
"@webiny/handler-aws": "6.
|
|
32
|
-
"@webiny/plugins": "6.
|
|
33
|
-
"@webiny/project-utils": "6.
|
|
34
|
-
"@webiny/wcp": "6.
|
|
27
|
+
"@webiny/api-core": "6.4.0-beta.1",
|
|
28
|
+
"@webiny/aws-sdk": "6.4.0-beta.1",
|
|
29
|
+
"@webiny/build-tools": "6.4.0-beta.1",
|
|
30
|
+
"@webiny/handler": "6.4.0-beta.1",
|
|
31
|
+
"@webiny/handler-aws": "6.4.0-beta.1",
|
|
32
|
+
"@webiny/plugins": "6.4.0-beta.1",
|
|
33
|
+
"@webiny/project-utils": "6.4.0-beta.1",
|
|
34
|
+
"@webiny/wcp": "6.4.0-beta.1",
|
|
35
35
|
"aws-sdk-client-mock": "4.1.0",
|
|
36
36
|
"typescript": "6.0.3",
|
|
37
|
-
"vitest": "4.1.
|
|
37
|
+
"vitest": "4.1.6"
|
|
38
38
|
},
|
|
39
39
|
"publishConfig": {
|
|
40
40
|
"access": "public",
|
|
41
41
|
"directory": "dist"
|
|
42
42
|
},
|
|
43
|
-
"gitHead": "
|
|
43
|
+
"gitHead": "73237b8243693038c072bae1c0b783387448cbbe"
|
|
44
44
|
}
|
package/types.js
CHANGED
package/utils/namespace.js
CHANGED
|
@@ -1,12 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
if (!namespace.startsWith(CMS_NAMESPACE)) {
|
|
7
|
-
return null;
|
|
8
|
-
}
|
|
9
|
-
return namespace.substring(CMS_NAMESPACE.length) || null;
|
|
1
|
+
const CMS_NAMESPACE = "Cms/Entry/";
|
|
2
|
+
const createNamespace = (model)=>`${CMS_NAMESPACE}${model.modelId}`;
|
|
3
|
+
const extractModelIdFromNamespace = (namespace)=>{
|
|
4
|
+
if (!namespace.startsWith(CMS_NAMESPACE)) return null;
|
|
5
|
+
return namespace.substring(CMS_NAMESPACE.length) || null;
|
|
10
6
|
};
|
|
7
|
+
export { CMS_NAMESPACE, createNamespace, extractModelIdFromNamespace };
|
|
11
8
|
|
|
12
9
|
//# sourceMappingURL=namespace.js.map
|
package/utils/namespace.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"utils/namespace.js","sources":["../../src/utils/namespace.ts"],"sourcesContent":["import type { CmsModel } from \"@webiny/api-headless-cms/types/index.js\";\n\nexport const CMS_NAMESPACE = \"Cms/Entry/\";\n\nexport const createNamespace = (model: Pick<CmsModel, \"modelId\">) => {\n return `${CMS_NAMESPACE}${model.modelId}`;\n};\n\nexport const extractModelIdFromNamespace = (namespace: string): string | null => {\n if (!namespace.startsWith(CMS_NAMESPACE)) {\n return null;\n }\n return namespace.substring(CMS_NAMESPACE.length) || null;\n};\n"],"names":["CMS_NAMESPACE","createNamespace","model","extractModelIdFromNamespace","namespace"],"mappings":"AAEO,MAAMA,gBAAgB;AAEtB,MAAMC,kBAAkB,CAACC,QACrB,GAAGF,gBAAgBE,MAAM,OAAO,EAAE;AAGtC,MAAMC,8BAA8B,CAACC;IACxC,IAAI,CAACA,UAAU,UAAU,CAACJ,gBACtB,OAAO;IAEX,OAAOI,UAAU,SAAS,CAACJ,cAAc,MAAM,KAAK;AACxD"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["SchedulePublishEntryUseCase","ScheduleUnpublishEntryUseCase"],"sources":["scheduler.ts"],"sourcesContent":["export { SchedulePublishEntryUseCase } from \"~/features/SchedulePublishEntryUseCase/abstractions.js\";\nexport { ScheduleUnpublishEntryUseCase } from \"~/features/ScheduleUnpublishEntryUseCase/abstractions.js\";\n"],"mappings":"AAAA,SAASA,2BAA2B;AACpC,SAASC,6BAA6B","ignoreList":[]}
|
package/types.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["types.ts"],"sourcesContent":["import type { INamespaceHandlerResult } from \"@webiny/api-scheduler/features/NamespaceHandler/abstractions.js\";\n\nexport interface IScheduledActionPayload extends INamespaceHandlerResult {\n modelId: string;\n}\n"],"mappings":"","ignoreList":[]}
|