@webiny/api-apw 0.0.0-unstable.1e66d121db → 0.0.0-unstable.2696f9d9e8
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/ApwChangeRequestNotification.d.ts +27 -0
- package/ApwChangeRequestNotification.js +28 -0
- package/ApwChangeRequestNotification.js.map +1 -0
- package/ApwCommentNotification.d.ts +27 -0
- package/ApwCommentNotification.js +28 -0
- package/ApwCommentNotification.js.map +1 -0
- package/ApwContentReviewNotification.d.ts +26 -0
- package/ApwContentReviewNotification.js +28 -0
- package/ApwContentReviewNotification.js.map +1 -0
- package/ApwContentUrlPlugin.d.ts +19 -0
- package/ApwContentUrlPlugin.js +28 -0
- package/ApwContentUrlPlugin.js.map +1 -0
- package/ContentApwSettingsPlugin.js +5 -9
- package/ContentApwSettingsPlugin.js.map +1 -1
- package/README.md +3 -3
- package/crud/createChangeRequestMethods.js +7 -12
- package/crud/createChangeRequestMethods.js.map +1 -1
- package/crud/createCommentMethods.js +7 -13
- package/crud/createCommentMethods.js.map +1 -1
- package/crud/createContentReviewMethods.js +83 -111
- package/crud/createContentReviewMethods.js.map +1 -1
- package/crud/createReviewerMethods.js +7 -13
- package/crud/createReviewerMethods.js.map +1 -1
- package/crud/createWorkflowMethods.js +7 -18
- package/crud/createWorkflowMethods.js.map +1 -1
- package/crud/index.js +5 -29
- package/crud/index.js.map +1 -1
- package/crud/utils.js +6 -33
- package/crud/utils.js.map +1 -1
- package/index.d.ts +2 -3
- package/index.js +6 -16
- package/index.js.map +1 -1
- package/package.json +40 -47
- package/plugins/cms/CmsEntryApwSettingsGetterPlugin.js +4 -19
- package/plugins/cms/CmsEntryApwSettingsGetterPlugin.js.map +1 -1
- package/plugins/cms/apwEntryPlugins.js +8 -13
- package/plugins/cms/apwEntryPlugins.js.map +1 -1
- package/plugins/cms/index.js +7 -10
- package/plugins/cms/index.js.map +1 -1
- package/plugins/cms/linkContentReviewToEntry.js +4 -20
- package/plugins/cms/linkContentReviewToEntry.js.map +1 -1
- package/plugins/cms/linkWorkflowToEntry.js +17 -45
- package/plugins/cms/linkWorkflowToEntry.js.map +1 -1
- package/plugins/cms/notifications/changeRequestNotification.d.ts +1 -0
- package/plugins/cms/notifications/changeRequestNotification.js +33 -0
- package/plugins/cms/notifications/changeRequestNotification.js.map +1 -0
- package/plugins/cms/notifications/commentNotification.d.ts +1 -0
- package/plugins/cms/notifications/commentNotification.js +33 -0
- package/plugins/cms/notifications/commentNotification.js.map +1 -0
- package/plugins/cms/notifications/contentReviewNotification.d.ts +1 -0
- package/plugins/cms/notifications/contentReviewNotification.js +33 -0
- package/plugins/cms/notifications/contentReviewNotification.js.map +1 -0
- package/plugins/cms/notifications/contentUrl.d.ts +8 -0
- package/plugins/cms/notifications/contentUrl.js +55 -0
- package/plugins/cms/notifications/contentUrl.js.map +1 -0
- package/plugins/cms/triggerContentReview.js +5 -18
- package/plugins/cms/triggerContentReview.js.map +1 -1
- package/plugins/cms/updateContentReviewStatus.js +14 -30
- package/plugins/cms/updateContentReviewStatus.js.map +1 -1
- package/plugins/cms/utils.d.ts +3 -2
- package/plugins/cms/utils.js +23 -60
- package/plugins/cms/utils.js.map +1 -1
- package/plugins/context.d.ts +0 -1
- package/plugins/context.js +2 -45
- package/plugins/context.js.map +1 -1
- package/plugins/graphql/changeRequest.gql.js +16 -19
- package/plugins/graphql/changeRequest.gql.js.map +1 -1
- package/plugins/graphql/comment.gql.js +41 -42
- package/plugins/graphql/comment.gql.js.map +1 -1
- package/plugins/graphql/contentReview.gql.js +25 -34
- package/plugins/graphql/contentReview.gql.js.map +1 -1
- package/plugins/graphql/reviewer.gql.js +17 -19
- package/plugins/graphql/reviewer.gql.js.map +1 -1
- package/plugins/graphql/utils.d.ts +2 -0
- package/plugins/graphql/utils.js +12 -0
- package/plugins/graphql/utils.js.map +1 -0
- package/plugins/graphql/workflow.gql.js +15 -19
- package/plugins/graphql/workflow.gql.js.map +1 -1
- package/plugins/graphql.js +5 -18
- package/plugins/graphql.js.map +1 -1
- package/plugins/hooks/createReviewerFromIdentity.js +28 -15
- package/plugins/hooks/createReviewerFromIdentity.js.map +1 -1
- package/plugins/hooks/deleteChangeRequestsAfterContentReview.js +3 -9
- package/plugins/hooks/deleteChangeRequestsAfterContentReview.js.map +1 -1
- package/plugins/hooks/deleteCommentsAfterChangeRequest.js +3 -8
- package/plugins/hooks/deleteCommentsAfterChangeRequest.js.map +1 -1
- package/plugins/hooks/index.js +4 -13
- package/plugins/hooks/index.js.map +1 -1
- package/plugins/hooks/initializeContentReviewSteps.js +15 -20
- package/plugins/hooks/initializeContentReviewSteps.js.map +1 -1
- package/plugins/hooks/initializeNotifications.d.ts +2 -0
- package/plugins/hooks/initializeNotifications.js +17 -0
- package/plugins/hooks/initializeNotifications.js.map +1 -0
- package/plugins/hooks/listContentReviews.d.ts +1 -1
- package/plugins/hooks/listContentReviews.js +11 -33
- package/plugins/hooks/listContentReviews.js.map +1 -1
- package/plugins/hooks/notifications/appUrl.d.ts +2 -0
- package/plugins/hooks/notifications/appUrl.js +20 -0
- package/plugins/hooks/notifications/appUrl.js.map +1 -0
- package/plugins/hooks/notifications/changeRequestAfterCreate.d.ts +2 -0
- package/plugins/hooks/notifications/changeRequestAfterCreate.js +113 -0
- package/plugins/hooks/notifications/changeRequestAfterCreate.js.map +1 -0
- package/plugins/hooks/notifications/changeRequestUrl.d.ts +8 -0
- package/plugins/hooks/notifications/changeRequestUrl.js +29 -0
- package/plugins/hooks/notifications/changeRequestUrl.js.map +1 -0
- package/plugins/hooks/notifications/commentAfterCreate.d.ts +2 -0
- package/plugins/hooks/notifications/commentAfterCreate.js +124 -0
- package/plugins/hooks/notifications/commentAfterCreate.js.map +1 -0
- package/plugins/hooks/notifications/commentUrl.d.ts +8 -0
- package/plugins/hooks/notifications/commentUrl.js +29 -0
- package/plugins/hooks/notifications/commentUrl.js.map +1 -0
- package/plugins/hooks/notifications/contentReviewAfterCreate.d.ts +2 -0
- package/plugins/hooks/notifications/contentReviewAfterCreate.js +96 -0
- package/plugins/hooks/notifications/contentReviewAfterCreate.js.map +1 -0
- package/plugins/hooks/notifications/contentReviewUrl.d.ts +7 -0
- package/plugins/hooks/notifications/contentReviewUrl.js +28 -0
- package/plugins/hooks/notifications/contentReviewUrl.js.map +1 -0
- package/plugins/hooks/notifications/contentUrl.d.ts +7 -0
- package/plugins/hooks/notifications/contentUrl.js +26 -0
- package/plugins/hooks/notifications/contentUrl.js.map +1 -0
- package/plugins/hooks/notifications/lastChangeRequestNotificationPlugin.d.ts +11 -0
- package/plugins/hooks/notifications/lastChangeRequestNotificationPlugin.js +23 -0
- package/plugins/hooks/notifications/lastChangeRequestNotificationPlugin.js.map +1 -0
- package/plugins/hooks/notifications/lastCommentNotificationPlugin.d.ts +11 -0
- package/plugins/hooks/notifications/lastCommentNotificationPlugin.js +23 -0
- package/plugins/hooks/notifications/lastCommentNotificationPlugin.js.map +1 -0
- package/plugins/hooks/notifications/lastContentReviewNotificationPlugin.d.ts +11 -0
- package/plugins/hooks/notifications/lastContentReviewNotificationPlugin.js +23 -0
- package/plugins/hooks/notifications/lastContentReviewNotificationPlugin.js.map +1 -0
- package/plugins/hooks/notifications/reviewers.d.ts +15 -0
- package/plugins/hooks/notifications/reviewers.js +47 -0
- package/plugins/hooks/notifications/reviewers.js.map +1 -0
- package/plugins/hooks/notifications/sendChangeRequestNotification.d.ts +2 -0
- package/plugins/hooks/notifications/sendChangeRequestNotification.js +43 -0
- package/plugins/hooks/notifications/sendChangeRequestNotification.js.map +1 -0
- package/plugins/hooks/notifications/sendCommentNotification.d.ts +2 -0
- package/plugins/hooks/notifications/sendCommentNotification.js +43 -0
- package/plugins/hooks/notifications/sendCommentNotification.js.map +1 -0
- package/plugins/hooks/notifications/sendContentReviewNotification.d.ts +2 -0
- package/plugins/hooks/notifications/sendContentReviewNotification.js +43 -0
- package/plugins/hooks/notifications/sendContentReviewNotification.js.map +1 -0
- package/plugins/hooks/updatePendingChangeRequests.js +7 -13
- package/plugins/hooks/updatePendingChangeRequests.js.map +1 -1
- package/plugins/hooks/updateTotalComments.js +21 -23
- package/plugins/hooks/updateTotalComments.js.map +1 -1
- package/plugins/hooks/validateChangeRequest.js +27 -16
- package/plugins/hooks/validateChangeRequest.js.map +1 -1
- package/plugins/hooks/validateComment.js +13 -12
- package/plugins/hooks/validateComment.js.map +1 -1
- package/plugins/hooks/validateContentReview.js +2 -6
- package/plugins/hooks/validateContentReview.js.map +1 -1
- package/plugins/pageBuilder/PageApwSettingsGetterPlugin.js +4 -19
- package/plugins/pageBuilder/PageApwSettingsGetterPlugin.js.map +1 -1
- package/plugins/pageBuilder/apwContentPagePlugins.js +2 -4
- package/plugins/pageBuilder/apwContentPagePlugins.js.map +1 -1
- package/plugins/pageBuilder/extendPbPageSettingsSchema.js +3 -6
- package/plugins/pageBuilder/extendPbPageSettingsSchema.js.map +1 -1
- package/plugins/pageBuilder/index.js +7 -8
- package/plugins/pageBuilder/index.js.map +1 -1
- package/plugins/pageBuilder/linkContentReviewToPage.js +15 -27
- package/plugins/pageBuilder/linkContentReviewToPage.js.map +1 -1
- package/plugins/pageBuilder/linkWorkflowToPage.js +3 -31
- package/plugins/pageBuilder/linkWorkflowToPage.js.map +1 -1
- package/plugins/pageBuilder/notifications/changeRequestNotification.d.ts +1 -0
- package/plugins/pageBuilder/notifications/changeRequestNotification.js +33 -0
- package/plugins/pageBuilder/notifications/changeRequestNotification.js.map +1 -0
- package/plugins/pageBuilder/notifications/commentNotification.d.ts +1 -0
- package/plugins/pageBuilder/notifications/commentNotification.js +33 -0
- package/plugins/pageBuilder/notifications/commentNotification.js.map +1 -0
- package/plugins/pageBuilder/notifications/contentReviewNotification.d.ts +1 -0
- package/plugins/pageBuilder/notifications/contentReviewNotification.js +33 -0
- package/plugins/pageBuilder/notifications/contentReviewNotification.js.map +1 -0
- package/plugins/pageBuilder/notifications/contentUrl.d.ts +1 -0
- package/plugins/pageBuilder/notifications/contentUrl.js +49 -0
- package/plugins/pageBuilder/notifications/contentUrl.js.map +1 -0
- package/plugins/pageBuilder/triggerContentReview.js +2 -11
- package/plugins/pageBuilder/triggerContentReview.js.map +1 -1
- package/plugins/pageBuilder/updateContentReviewStatus.js +10 -17
- package/plugins/pageBuilder/updateContentReviewStatus.js.map +1 -1
- package/plugins/pageBuilder/utils.d.ts +2 -2
- package/plugins/pageBuilder/utils.js +3 -35
- package/plugins/pageBuilder/utils.js.map +1 -1
- package/plugins/utils.d.ts +1 -2
- package/plugins/utils.js +6 -52
- package/plugins/utils.js.map +1 -1
- package/scheduler/createScheduleActionMethods.js +45 -50
- package/scheduler/createScheduleActionMethods.js.map +1 -1
- package/scheduler/handlers/executeAction/index.d.ts +1 -1
- package/scheduler/handlers/executeAction/index.js +47 -40
- package/scheduler/handlers/executeAction/index.js.map +1 -1
- package/scheduler/handlers/executeAction/plugins/ApplicationGraphQL.d.ts +6 -0
- package/scheduler/handlers/executeAction/plugins/ApplicationGraphQL.js +19 -9
- package/scheduler/handlers/executeAction/plugins/ApplicationGraphQL.js.map +1 -1
- package/scheduler/handlers/executeAction/plugins/HeadlessCMSGraphQL.d.ts +2 -3
- package/scheduler/handlers/executeAction/plugins/HeadlessCMSGraphQL.js +11 -28
- package/scheduler/handlers/executeAction/plugins/HeadlessCMSGraphQL.js.map +1 -1
- package/scheduler/handlers/executeAction/plugins/PageBuilderGraphQL.d.ts +2 -2
- package/scheduler/handlers/executeAction/plugins/PageBuilderGraphQL.js +10 -92
- package/scheduler/handlers/executeAction/plugins/PageBuilderGraphQL.js.map +1 -1
- package/scheduler/handlers/executeAction/security.js +2 -11
- package/scheduler/handlers/executeAction/security.js.map +1 -1
- package/scheduler/handlers/scheduleAction/index.d.ts +1 -1
- package/scheduler/handlers/scheduleAction/index.js +24 -37
- package/scheduler/handlers/scheduleAction/index.js.map +1 -1
- package/scheduler/handlers/scheduleAction/scheduleAction.utils.js +20 -36
- package/scheduler/handlers/scheduleAction/scheduleAction.utils.js.map +1 -1
- package/scheduler/handlers/utils.d.ts +2 -4
- package/scheduler/handlers/utils.js +8 -47
- package/scheduler/handlers/utils.js.map +1 -1
- package/scheduler/index.js +2 -3
- package/scheduler/index.js.map +1 -1
- package/scheduler/types.d.ts +12 -28
- package/scheduler/types.js +13 -22
- package/scheduler/types.js.map +1 -1
- package/storageOperations/changeRequestStorageOperations.js +59 -45
- package/storageOperations/changeRequestStorageOperations.js.map +1 -1
- package/storageOperations/commentStorageOperations.js +35 -50
- package/storageOperations/commentStorageOperations.js.map +1 -1
- package/storageOperations/contentReviewStorageOperations.d.ts +1 -1
- package/storageOperations/contentReviewStorageOperations.js +34 -43
- package/storageOperations/contentReviewStorageOperations.js.map +1 -1
- package/storageOperations/index.d.ts +1 -7
- package/storageOperations/index.js +10 -29
- package/storageOperations/index.js.map +1 -1
- package/storageOperations/models/changeRequest.model.d.ts +1 -2
- package/storageOperations/models/changeRequest.model.js +6 -15
- package/storageOperations/models/changeRequest.model.js.map +1 -1
- package/storageOperations/models/comment.model.d.ts +1 -2
- package/storageOperations/models/comment.model.js +6 -14
- package/storageOperations/models/comment.model.js.map +1 -1
- package/storageOperations/models/contentReview.model.d.ts +1 -2
- package/storageOperations/models/contentReview.model.js +13 -37
- package/storageOperations/models/contentReview.model.js.map +1 -1
- package/storageOperations/models/index.js +6 -50
- package/storageOperations/models/index.js.map +1 -1
- package/storageOperations/models/reviewer.model.d.ts +1 -2
- package/storageOperations/models/reviewer.model.js +22 -14
- package/storageOperations/models/reviewer.model.js.map +1 -1
- package/storageOperations/models/utils.js +2 -4
- package/storageOperations/models/utils.js.map +1 -1
- package/storageOperations/models/workflow.model.d.ts +1 -2
- package/storageOperations/models/workflow.model.js +19 -42
- package/storageOperations/models/workflow.model.js.map +1 -1
- package/storageOperations/reviewerStorageOperations.d.ts +1 -1
- package/storageOperations/reviewerStorageOperations.js +34 -40
- package/storageOperations/reviewerStorageOperations.js.map +1 -1
- package/storageOperations/types.js +3 -1
- package/storageOperations/workflowStorageOperations.js +40 -47
- package/storageOperations/workflowStorageOperations.js.map +1 -1
- package/types.d.ts +39 -25
- package/types.js +126 -42
- package/types.js.map +1 -1
- package/utils/contentApwSettingsPlugin.js +2 -6
- package/utils/contentApwSettingsPlugin.js.map +1 -1
- package/utils/errors.js +2 -17
- package/utils/errors.js.map +1 -1
- package/utils/fieldResolver.js +8 -18
- package/utils/fieldResolver.js.map +1 -1
- package/utils/pickEntryFieldValues.d.ts +3 -0
- package/utils/pickEntryFieldValues.js +31 -0
- package/utils/pickEntryFieldValues.js.map +1 -0
- package/utils/resolve.d.ts +1 -1
- package/utils/resolve.js +2 -3
- package/utils/resolve.js.map +1 -1
- package/storageOperations/models/contentModelPluginFactory.d.ts +0 -15
- package/storageOperations/models/contentModelPluginFactory.js +0 -28
- package/storageOperations/models/contentModelPluginFactory.js.map +0 -1
@@ -1,18 +1,13 @@
|
|
1
1
|
"use strict";
|
2
2
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
4
|
-
|
5
4
|
Object.defineProperty(exports, "__esModule", {
|
6
5
|
value: true
|
7
6
|
});
|
8
7
|
exports.linkContentReviewToEntry = void 0;
|
9
|
-
|
10
8
|
var _types = require("../../types");
|
11
|
-
|
12
9
|
var _utils = require("./utils");
|
13
|
-
|
14
10
|
var _error = _interopRequireDefault(require("@webiny/error"));
|
15
|
-
|
16
11
|
const linkContentReviewToEntry = params => {
|
17
12
|
const {
|
18
13
|
apw,
|
@@ -24,11 +19,9 @@ const linkContentReviewToEntry = params => {
|
|
24
19
|
const {
|
25
20
|
content
|
26
21
|
} = contentReview;
|
27
|
-
|
28
22
|
if (content.type !== _types.ApwContentTypes.CMS_ENTRY) {
|
29
23
|
return;
|
30
24
|
}
|
31
|
-
|
32
25
|
const model = await (0, _utils.fetchModel)(cms, content.id, content.settings);
|
33
26
|
await (0, _utils.updateEntryMeta)({
|
34
27
|
cms,
|
@@ -47,11 +40,9 @@ const linkContentReviewToEntry = params => {
|
|
47
40
|
const {
|
48
41
|
content
|
49
42
|
} = contentReview;
|
50
|
-
|
51
43
|
if (content.type !== _types.ApwContentTypes.CMS_ENTRY) {
|
52
44
|
return;
|
53
45
|
}
|
54
|
-
|
55
46
|
const model = await (0, _utils.fetchModel)(cms, content.id, content.settings);
|
56
47
|
await (0, _utils.updateEntryMeta)({
|
57
48
|
cms,
|
@@ -68,20 +59,14 @@ const linkContentReviewToEntry = params => {
|
|
68
59
|
entry,
|
69
60
|
model
|
70
61
|
}) => {
|
71
|
-
|
72
|
-
|
73
|
-
if ((0, _utils.isAwpModel)(model)) {
|
62
|
+
if ((0, _utils.isApwDisabledOnModel)(model)) {
|
74
63
|
return;
|
75
64
|
}
|
76
|
-
|
77
|
-
const contentReviewId = (_entry$meta = entry.meta) === null || _entry$meta === void 0 ? void 0 : (_entry$meta$apw = _entry$meta.apw) === null || _entry$meta$apw === void 0 ? void 0 : _entry$meta$apw.contentReviewId;
|
78
|
-
|
65
|
+
const contentReviewId = entry.meta?.apw?.contentReviewId;
|
79
66
|
if (!contentReviewId) {
|
80
67
|
return;
|
81
68
|
}
|
82
|
-
|
83
69
|
let contentReview;
|
84
|
-
|
85
70
|
try {
|
86
71
|
contentReview = await apw.contentReview.get(contentReviewId);
|
87
72
|
} catch (ex) {
|
@@ -93,16 +78,15 @@ const linkContentReviewToEntry = params => {
|
|
93
78
|
throw ex;
|
94
79
|
}
|
95
80
|
}
|
96
|
-
|
97
81
|
if (!contentReview) {
|
98
82
|
return;
|
99
83
|
}
|
100
|
-
|
101
84
|
throw new _error.default(`Cannot delete the entry because a peer review has been requested. Please delete the review first.`, "CANNOT_DELETE_REVIEW_EXIST", {
|
102
85
|
contentReviewId,
|
103
86
|
entry
|
104
87
|
});
|
105
88
|
});
|
106
89
|
};
|
90
|
+
exports.linkContentReviewToEntry = linkContentReviewToEntry;
|
107
91
|
|
108
|
-
|
92
|
+
//# sourceMappingURL=linkContentReviewToEntry.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["linkContentReviewToEntry","params","apw","cms","contentReview","onContentReviewAfterCreate","subscribe","content","type","ApwContentTypes","CMS_ENTRY","model","fetchModel","id","settings","updateEntryMeta","meta","contentReviewId","entryId","onContentReviewAfterDelete","onEntryBeforeDelete","entry","
|
1
|
+
{"version":3,"names":["_types","require","_utils","_error","_interopRequireDefault","linkContentReviewToEntry","params","apw","cms","contentReview","onContentReviewAfterCreate","subscribe","content","type","ApwContentTypes","CMS_ENTRY","model","fetchModel","id","settings","updateEntryMeta","meta","contentReviewId","entryId","onContentReviewAfterDelete","onEntryBeforeDelete","entry","isApwDisabledOnModel","get","ex","code","Error","exports"],"sources":["linkContentReviewToEntry.ts"],"sourcesContent":["import { AdvancedPublishingWorkflow, ApwContentTypes } from \"~/types\";\nimport { fetchModel, isApwDisabledOnModel, updateEntryMeta } from \"~/plugins/cms/utils\";\nimport Error from \"@webiny/error\";\nimport { HeadlessCms } from \"@webiny/api-headless-cms/types\";\n\ninterface LinkContentReviewToEntryParams {\n apw: AdvancedPublishingWorkflow;\n cms: HeadlessCms;\n}\nexport const linkContentReviewToEntry = (params: LinkContentReviewToEntryParams) => {\n const { apw, cms } = params;\n\n apw.contentReview.onContentReviewAfterCreate.subscribe(async ({ contentReview }) => {\n const { content } = contentReview;\n\n if (content.type !== ApwContentTypes.CMS_ENTRY) {\n return;\n }\n\n const model = await fetchModel(cms, content.id, content.settings);\n\n await updateEntryMeta({\n cms,\n model,\n meta: {\n apw: {\n contentReviewId: contentReview.id\n }\n },\n entryId: content.id\n });\n });\n\n apw.contentReview.onContentReviewAfterDelete.subscribe(async ({ contentReview }) => {\n const { content } = contentReview;\n if (content.type !== ApwContentTypes.CMS_ENTRY) {\n return;\n }\n\n const model = await fetchModel(cms, content.id, content.settings);\n\n await updateEntryMeta({\n cms,\n model,\n meta: {\n apw: {\n contentReviewId: null\n }\n },\n entryId: content.id\n });\n });\n\n cms.onEntryBeforeDelete.subscribe(async ({ entry, model }) => {\n if (isApwDisabledOnModel(model)) {\n return;\n }\n const contentReviewId = entry.meta?.apw?.contentReviewId;\n\n if (!contentReviewId) {\n return;\n }\n let contentReview;\n try {\n contentReview = await apw.contentReview.get(contentReviewId);\n } catch (ex) {\n /**\n * We're handling the case whereby \"contentReviewId\" is still linked to page;\n * even when the contentReview entry has been deleted. In that case, we'll allow page deletion.\n */\n if (ex.code !== \"NOT_FOUND\") {\n throw ex;\n }\n }\n\n if (!contentReview) {\n return;\n }\n throw new Error(\n `Cannot delete the entry because a peer review has been requested. Please delete the review first.`,\n \"CANNOT_DELETE_REVIEW_EXIST\",\n {\n contentReviewId,\n entry\n }\n );\n });\n};\n"],"mappings":";;;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,MAAA,GAAAD,OAAA;AACA,IAAAE,MAAA,GAAAC,sBAAA,CAAAH,OAAA;AAOO,MAAMI,wBAAwB,GAAIC,MAAsC,IAAK;EAChF,MAAM;IAAEC,GAAG;IAAEC;EAAI,CAAC,GAAGF,MAAM;EAE3BC,GAAG,CAACE,aAAa,CAACC,0BAA0B,CAACC,SAAS,CAAC,OAAO;IAAEF;EAAc,CAAC,KAAK;IAChF,MAAM;MAAEG;IAAQ,CAAC,GAAGH,aAAa;IAEjC,IAAIG,OAAO,CAACC,IAAI,KAAKC,sBAAe,CAACC,SAAS,EAAE;MAC5C;IACJ;IAEA,MAAMC,KAAK,GAAG,MAAM,IAAAC,iBAAU,EAACT,GAAG,EAAEI,OAAO,CAACM,EAAE,EAAEN,OAAO,CAACO,QAAQ,CAAC;IAEjE,MAAM,IAAAC,sBAAe,EAAC;MAClBZ,GAAG;MACHQ,KAAK;MACLK,IAAI,EAAE;QACFd,GAAG,EAAE;UACDe,eAAe,EAAEb,aAAa,CAACS;QACnC;MACJ,CAAC;MACDK,OAAO,EAAEX,OAAO,CAACM;IACrB,CAAC,CAAC;EACN,CAAC,CAAC;EAEFX,GAAG,CAACE,aAAa,CAACe,0BAA0B,CAACb,SAAS,CAAC,OAAO;IAAEF;EAAc,CAAC,KAAK;IAChF,MAAM;MAAEG;IAAQ,CAAC,GAAGH,aAAa;IACjC,IAAIG,OAAO,CAACC,IAAI,KAAKC,sBAAe,CAACC,SAAS,EAAE;MAC5C;IACJ;IAEA,MAAMC,KAAK,GAAG,MAAM,IAAAC,iBAAU,EAACT,GAAG,EAAEI,OAAO,CAACM,EAAE,EAAEN,OAAO,CAACO,QAAQ,CAAC;IAEjE,MAAM,IAAAC,sBAAe,EAAC;MAClBZ,GAAG;MACHQ,KAAK;MACLK,IAAI,EAAE;QACFd,GAAG,EAAE;UACDe,eAAe,EAAE;QACrB;MACJ,CAAC;MACDC,OAAO,EAAEX,OAAO,CAACM;IACrB,CAAC,CAAC;EACN,CAAC,CAAC;EAEFV,GAAG,CAACiB,mBAAmB,CAACd,SAAS,CAAC,OAAO;IAAEe,KAAK;IAAEV;EAAM,CAAC,KAAK;IAC1D,IAAI,IAAAW,2BAAoB,EAACX,KAAK,CAAC,EAAE;MAC7B;IACJ;IACA,MAAMM,eAAe,GAAGI,KAAK,CAACL,IAAI,EAAEd,GAAG,EAAEe,eAAe;IAExD,IAAI,CAACA,eAAe,EAAE;MAClB;IACJ;IACA,IAAIb,aAAa;IACjB,IAAI;MACAA,aAAa,GAAG,MAAMF,GAAG,CAACE,aAAa,CAACmB,GAAG,CAACN,eAAe,CAAC;IAChE,CAAC,CAAC,OAAOO,EAAE,EAAE;MACT;AACZ;AACA;AACA;MACY,IAAIA,EAAE,CAACC,IAAI,KAAK,WAAW,EAAE;QACzB,MAAMD,EAAE;MACZ;IACJ;IAEA,IAAI,CAACpB,aAAa,EAAE;MAChB;IACJ;IACA,MAAM,IAAIsB,cAAK,CACV,mGAAkG,EACnG,4BAA4B,EAC5B;MACIT,eAAe;MACfI;IACJ,CACJ,CAAC;EACL,CAAC,CAAC;AACN,CAAC;AAACM,OAAA,CAAA3B,wBAAA,GAAAA,wBAAA"}
|
@@ -1,16 +1,12 @@
|
|
1
1
|
"use strict";
|
2
2
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
4
|
-
|
5
4
|
Object.defineProperty(exports, "__esModule", {
|
6
5
|
value: true
|
7
6
|
});
|
8
7
|
exports.linkWorkflowToEntry = void 0;
|
9
|
-
|
10
8
|
var _set = _interopRequireDefault(require("lodash/set"));
|
11
|
-
|
12
9
|
var _utils = require("./utils");
|
13
|
-
|
14
10
|
const linkWorkflowToEntry = params => {
|
15
11
|
const {
|
16
12
|
apw,
|
@@ -20,13 +16,13 @@ const linkWorkflowToEntry = params => {
|
|
20
16
|
entry,
|
21
17
|
model
|
22
18
|
}) => {
|
23
|
-
if ((0, _utils.
|
19
|
+
if ((0, _utils.isApwDisabledOnModel)(model)) {
|
24
20
|
return;
|
25
21
|
}
|
26
|
-
|
27
22
|
await (0, _utils.assignWorkflowToEntry)({
|
28
23
|
apw,
|
29
|
-
entry
|
24
|
+
entry,
|
25
|
+
model
|
30
26
|
});
|
31
27
|
});
|
32
28
|
cms.onEntryRevisionBeforeCreate.subscribe(async ({
|
@@ -34,41 +30,33 @@ const linkWorkflowToEntry = params => {
|
|
34
30
|
original,
|
35
31
|
model
|
36
32
|
}) => {
|
37
|
-
|
38
|
-
|
39
|
-
if ((0, _utils.isAwpModel)(model)) {
|
33
|
+
if ((0, _utils.isApwDisabledOnModel)(model)) {
|
40
34
|
return;
|
41
35
|
}
|
42
36
|
/**
|
43
37
|
* If the previous revision(original) already had the "contentReviewId",
|
44
38
|
* we need to unlink it so that new "contentReview" can be request for the new revision.
|
45
39
|
*/
|
46
|
-
|
47
|
-
|
48
|
-
const previousContentReviewId = (_original$meta = original.meta) === null || _original$meta === void 0 ? void 0 : (_original$meta$apw = _original$meta.apw) === null || _original$meta$apw === void 0 ? void 0 : _original$meta$apw.contentReviewId;
|
49
|
-
|
40
|
+
const previousContentReviewId = original.meta?.apw?.contentReviewId;
|
50
41
|
if (previousContentReviewId) {
|
51
42
|
entry.meta = (0, _set.default)(entry.meta || {}, "apw.contentReviewId", null);
|
52
43
|
}
|
44
|
+
|
53
45
|
/**
|
54
46
|
* If the previous revision(original) already had the "workflowId",
|
55
47
|
* we don't need to do anything we'll just let it be copied over.
|
56
48
|
*/
|
57
|
-
|
58
|
-
|
59
|
-
const previousWorkflowId = (_original$meta2 = original.meta) === null || _original$meta2 === void 0 ? void 0 : (_original$meta2$apw = _original$meta2.apw) === null || _original$meta2$apw === void 0 ? void 0 : _original$meta2$apw.workflowId;
|
60
|
-
|
49
|
+
const previousWorkflowId = original.meta?.apw?.workflowId;
|
61
50
|
if (previousWorkflowId) {
|
62
51
|
return;
|
63
52
|
}
|
64
53
|
/**
|
65
54
|
* Lookup and assign "workflowId".
|
66
55
|
*/
|
67
|
-
|
68
|
-
|
69
56
|
await (0, _utils.assignWorkflowToEntry)({
|
70
57
|
apw,
|
71
|
-
entry
|
58
|
+
entry,
|
59
|
+
model
|
72
60
|
});
|
73
61
|
});
|
74
62
|
cms.onEntryBeforeUpdate.subscribe(async ({
|
@@ -76,20 +64,16 @@ const linkWorkflowToEntry = params => {
|
|
76
64
|
original,
|
77
65
|
model
|
78
66
|
}) => {
|
79
|
-
|
80
|
-
|
81
|
-
if ((0, _utils.isAwpModel)(model)) {
|
67
|
+
if ((0, _utils.isApwDisabledOnModel)(model)) {
|
82
68
|
return;
|
83
69
|
}
|
84
|
-
|
85
|
-
const
|
86
|
-
const currentApwWorkflowId = (_entry$meta = entry.meta) === null || _entry$meta === void 0 ? void 0 : (_entry$meta$apw = _entry$meta.apw) === null || _entry$meta$apw === void 0 ? void 0 : _entry$meta$apw.workflowId;
|
70
|
+
const prevApwWorkflowId = original.meta?.apw?.workflowId;
|
71
|
+
const currentApwWorkflowId = entry.meta?.apw?.workflowId;
|
87
72
|
/**
|
88
73
|
* Make sure the apw property doesn't get lost between updates.
|
89
74
|
* It can happen because we run modal validation in "onBeforePageUpdate" event,
|
90
75
|
* which doesn't have the "apw" property.
|
91
76
|
*/
|
92
|
-
|
93
77
|
if (prevApwWorkflowId && !currentApwWorkflowId) {
|
94
78
|
entry.meta = (0, _set.default)(entry.meta || {}, "apw", (original.meta || {}).apw || {});
|
95
79
|
}
|
@@ -97,58 +81,45 @@ const linkWorkflowToEntry = params => {
|
|
97
81
|
* If there is a linked "contentReview" for this page and the page "title" has changed.
|
98
82
|
* Let's update the "title" field in "contentReview".
|
99
83
|
*/
|
100
|
-
|
101
|
-
|
102
|
-
const linkedContentReviewId = (_entry$meta2 = entry.meta) === null || _entry$meta2 === void 0 ? void 0 : (_entry$meta2$apw = _entry$meta2.apw) === null || _entry$meta2$apw === void 0 ? void 0 : _entry$meta2$apw.contentReviewId;
|
84
|
+
const linkedContentReviewId = entry.meta?.apw?.contentReviewId;
|
103
85
|
const prevTitle = (0, _utils.getEntryTitle)(model, original);
|
104
86
|
const newTitle = (0, _utils.getEntryTitle)(model, entry);
|
105
|
-
|
106
87
|
if (!linkedContentReviewId || prevTitle === newTitle) {
|
107
88
|
return;
|
108
89
|
}
|
109
|
-
|
110
90
|
await apw.contentReview.update(linkedContentReviewId, {
|
111
91
|
title: newTitle
|
112
92
|
});
|
113
93
|
});
|
94
|
+
|
114
95
|
/**
|
115
96
|
* Link created workflow to associated entries.
|
116
97
|
*/
|
117
|
-
|
118
98
|
apw.workflow.onWorkflowAfterCreate.subscribe(async ({
|
119
99
|
workflow
|
120
100
|
}) => {
|
121
|
-
var _scope$data;
|
122
|
-
|
123
101
|
const {
|
124
102
|
scope
|
125
103
|
} = workflow;
|
126
104
|
/**
|
127
105
|
* If the workflow has entries in it's scope, we'll link that workflow for each of those entries.
|
128
106
|
*/
|
129
|
-
|
130
107
|
if ((0, _utils.hasEntries)(workflow) === false) {
|
131
108
|
return;
|
132
109
|
}
|
133
|
-
|
134
110
|
const models = await cms.listModels();
|
135
|
-
const values =
|
136
|
-
|
111
|
+
const values = scope.data?.entries;
|
137
112
|
if (!values || Array.isArray(values) === false || values.length === 0) {
|
138
113
|
return;
|
139
114
|
}
|
140
|
-
|
141
115
|
for (const value of values) {
|
142
116
|
if (!value || !value.modelId || !value.id) {
|
143
117
|
continue;
|
144
118
|
}
|
145
|
-
|
146
119
|
const model = models.find(m => m.modelId === value.modelId);
|
147
|
-
|
148
120
|
if (!model) {
|
149
121
|
continue;
|
150
122
|
}
|
151
|
-
|
152
123
|
await (0, _utils.updateEntryMeta)({
|
153
124
|
cms,
|
154
125
|
model,
|
@@ -162,5 +133,6 @@ const linkWorkflowToEntry = params => {
|
|
162
133
|
}
|
163
134
|
});
|
164
135
|
};
|
136
|
+
exports.linkWorkflowToEntry = linkWorkflowToEntry;
|
165
137
|
|
166
|
-
|
138
|
+
//# sourceMappingURL=linkWorkflowToEntry.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["linkWorkflowToEntry","params","apw","cms","onEntryBeforeCreate","subscribe","entry","model","
|
1
|
+
{"version":3,"names":["_set","_interopRequireDefault","require","_utils","linkWorkflowToEntry","params","apw","cms","onEntryBeforeCreate","subscribe","entry","model","isApwDisabledOnModel","assignWorkflowToEntry","onEntryRevisionBeforeCreate","original","previousContentReviewId","meta","contentReviewId","set","previousWorkflowId","workflowId","onEntryBeforeUpdate","prevApwWorkflowId","currentApwWorkflowId","linkedContentReviewId","prevTitle","getEntryTitle","newTitle","contentReview","update","title","workflow","onWorkflowAfterCreate","scope","hasEntries","models","listModels","values","data","entries","Array","isArray","length","value","modelId","id","find","m","updateEntryMeta","entryId","exports"],"sources":["linkWorkflowToEntry.ts"],"sourcesContent":["import set from \"lodash/set\";\nimport { AdvancedPublishingWorkflow } from \"~/types\";\nimport {\n assignWorkflowToEntry,\n getEntryTitle,\n hasEntries,\n isApwDisabledOnModel,\n updateEntryMeta\n} from \"~/plugins/cms/utils\";\nimport { HeadlessCms } from \"@webiny/api-headless-cms/types\";\n\ninterface Value {\n id: string;\n modelId: string;\n}\n\ninterface LinkWorkflowToEntryParams {\n apw: AdvancedPublishingWorkflow;\n cms: HeadlessCms;\n}\nexport const linkWorkflowToEntry = (params: LinkWorkflowToEntryParams) => {\n const { apw, cms } = params;\n\n cms.onEntryBeforeCreate.subscribe(async ({ entry, model }) => {\n if (isApwDisabledOnModel(model)) {\n return;\n }\n await assignWorkflowToEntry({\n apw,\n entry,\n model\n });\n });\n\n cms.onEntryRevisionBeforeCreate.subscribe(async ({ entry, original, model }) => {\n if (isApwDisabledOnModel(model)) {\n return;\n }\n /**\n * If the previous revision(original) already had the \"contentReviewId\",\n * we need to unlink it so that new \"contentReview\" can be request for the new revision.\n */\n const previousContentReviewId = original.meta?.apw?.contentReviewId;\n if (previousContentReviewId) {\n entry.meta = set(entry.meta || {}, \"apw.contentReviewId\", null);\n }\n\n /**\n * If the previous revision(original) already had the \"workflowId\",\n * we don't need to do anything we'll just let it be copied over.\n */\n const previousWorkflowId = original.meta?.apw?.workflowId;\n if (previousWorkflowId) {\n return;\n }\n /**\n * Lookup and assign \"workflowId\".\n */\n await assignWorkflowToEntry({\n apw,\n entry,\n model\n });\n });\n\n cms.onEntryBeforeUpdate.subscribe(async ({ entry, original, model }) => {\n if (isApwDisabledOnModel(model)) {\n return;\n }\n const prevApwWorkflowId = original.meta?.apw?.workflowId;\n const currentApwWorkflowId = entry.meta?.apw?.workflowId;\n /**\n * Make sure the apw property doesn't get lost between updates.\n * It can happen because we run modal validation in \"onBeforePageUpdate\" event,\n * which doesn't have the \"apw\" property.\n */\n if (prevApwWorkflowId && !currentApwWorkflowId) {\n entry.meta = set(entry.meta || {}, \"apw\", (original.meta || {}).apw || {});\n }\n /*\n * If there is a linked \"contentReview\" for this page and the page \"title\" has changed.\n * Let's update the \"title\" field in \"contentReview\".\n */\n const linkedContentReviewId = entry.meta?.apw?.contentReviewId;\n const prevTitle = getEntryTitle(model, original);\n const newTitle = getEntryTitle(model, entry);\n\n if (!linkedContentReviewId || prevTitle === newTitle) {\n return;\n }\n await apw.contentReview.update(linkedContentReviewId, {\n title: newTitle\n });\n });\n\n /**\n * Link created workflow to associated entries.\n */\n apw.workflow.onWorkflowAfterCreate.subscribe(async ({ workflow }) => {\n const { scope } = workflow;\n /**\n * If the workflow has entries in it's scope, we'll link that workflow for each of those entries.\n */\n if (hasEntries(workflow) === false) {\n return;\n }\n\n const models = await cms.listModels();\n\n const values: Value[] | undefined = scope.data?.entries;\n if (!values || Array.isArray(values) === false || values.length === 0) {\n return;\n }\n\n for (const value of values) {\n if (!value || !value.modelId || !value.id) {\n continue;\n }\n const model = models.find(m => m.modelId === value.modelId);\n if (!model) {\n continue;\n }\n await updateEntryMeta({\n cms,\n model,\n entryId: value.id,\n meta: {\n apw: {\n workflowId: workflow.id\n }\n }\n });\n }\n });\n};\n"],"mappings":"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"}
|
@@ -0,0 +1 @@
|
|
1
|
+
export declare const createChangeRequestNotification: () => import("../../../ApwChangeRequestNotification").ApwChangeRequestNotification;
|
@@ -0,0 +1,33 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
4
|
+
value: true
|
5
|
+
});
|
6
|
+
exports.createChangeRequestNotification = void 0;
|
7
|
+
var _types = require("../../../types");
|
8
|
+
var _ApwChangeRequestNotification = require("../../../ApwChangeRequestNotification");
|
9
|
+
const createChangeRequestNotification = () => {
|
10
|
+
const plugin = (0, _ApwChangeRequestNotification.createApwChangeRequestNotification)(_types.ApwContentTypes.CMS_ENTRY, params => {
|
11
|
+
const {
|
12
|
+
changeRequestUrl,
|
13
|
+
contentUrl
|
14
|
+
} = params;
|
15
|
+
return {
|
16
|
+
text: `
|
17
|
+
Hi,<br /><br />
|
18
|
+
|
19
|
+
You have received a <a href="${changeRequestUrl}">change request</a>, for <a href="${contentUrl}">this</a> content entry.<br /><br />
|
20
|
+
|
21
|
+
Here are the full URLs:<br /><br />
|
22
|
+
|
23
|
+
Change Request: ${changeRequestUrl}<br />
|
24
|
+
Content Entry: ${contentUrl}
|
25
|
+
`
|
26
|
+
};
|
27
|
+
});
|
28
|
+
plugin.name = `${plugin.type}.${_types.ApwContentTypes.CMS_ENTRY}.default`;
|
29
|
+
return plugin;
|
30
|
+
};
|
31
|
+
exports.createChangeRequestNotification = createChangeRequestNotification;
|
32
|
+
|
33
|
+
//# sourceMappingURL=changeRequestNotification.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"names":["_types","require","_ApwChangeRequestNotification","createChangeRequestNotification","plugin","createApwChangeRequestNotification","ApwContentTypes","CMS_ENTRY","params","changeRequestUrl","contentUrl","text","name","type","exports"],"sources":["changeRequestNotification.ts"],"sourcesContent":["import { ApwContentTypes } from \"~/types\";\nimport { createApwChangeRequestNotification } from \"~/ApwChangeRequestNotification\";\n\nexport const createChangeRequestNotification = () => {\n const plugin = createApwChangeRequestNotification(ApwContentTypes.CMS_ENTRY, params => {\n const { changeRequestUrl, contentUrl } = params;\n\n return {\n text: `\n Hi,<br /><br />\n \n You have received a <a href=\"${changeRequestUrl}\">change request</a>, for <a href=\"${contentUrl}\">this</a> content entry.<br /><br />\n \n Here are the full URLs:<br /><br />\n \n Change Request: ${changeRequestUrl}<br />\n Content Entry: ${contentUrl}\n `\n };\n });\n\n plugin.name = `${plugin.type}.${ApwContentTypes.CMS_ENTRY}.default`;\n\n return plugin;\n};\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,6BAAA,GAAAD,OAAA;AAEO,MAAME,+BAA+B,GAAGA,CAAA,KAAM;EACjD,MAAMC,MAAM,GAAG,IAAAC,gEAAkC,EAACC,sBAAe,CAACC,SAAS,EAAEC,MAAM,IAAI;IACnF,MAAM;MAAEC,gBAAgB;MAAEC;IAAW,CAAC,GAAGF,MAAM;IAE/C,OAAO;MACHG,IAAI,EAAG;AACnB;AACA;AACA,+CAA+CF,gBAAiB,sCAAqCC,UAAW;AAChH;AACA;AACA;AACA,kCAAkCD,gBAAiB;AACnD,iCAAiCC,UAAW;AAC5C;IACQ,CAAC;EACL,CAAC,CAAC;EAEFN,MAAM,CAACQ,IAAI,GAAI,GAAER,MAAM,CAACS,IAAK,IAAGP,sBAAe,CAACC,SAAU,UAAS;EAEnE,OAAOH,MAAM;AACjB,CAAC;AAACU,OAAA,CAAAX,+BAAA,GAAAA,+BAAA"}
|
@@ -0,0 +1 @@
|
|
1
|
+
export declare const createCommentNotification: () => import("../../../ApwCommentNotification").ApwCommentNotification;
|
@@ -0,0 +1,33 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
4
|
+
value: true
|
5
|
+
});
|
6
|
+
exports.createCommentNotification = void 0;
|
7
|
+
var _ApwCommentNotification = require("../../../ApwCommentNotification");
|
8
|
+
var _types = require("../../../types");
|
9
|
+
const createCommentNotification = () => {
|
10
|
+
const plugin = (0, _ApwCommentNotification.createApwCommentNotification)(_types.ApwContentTypes.CMS_ENTRY, params => {
|
11
|
+
const {
|
12
|
+
commentUrl,
|
13
|
+
contentUrl
|
14
|
+
} = params;
|
15
|
+
return {
|
16
|
+
text: `
|
17
|
+
Hi,<br /><br />
|
18
|
+
|
19
|
+
You have received a <a href="${commentUrl}">comment</a>, on a change request, for <a href="${contentUrl}">this</a> content entry.<br />
|
20
|
+
|
21
|
+
Here are the full URLs:<br /><br />
|
22
|
+
|
23
|
+
Comment: ${commentUrl}<br />
|
24
|
+
Content Entry: ${contentUrl}
|
25
|
+
`
|
26
|
+
};
|
27
|
+
});
|
28
|
+
plugin.name = `${plugin.type}.${_types.ApwContentTypes.CMS_ENTRY}.default`;
|
29
|
+
return plugin;
|
30
|
+
};
|
31
|
+
exports.createCommentNotification = createCommentNotification;
|
32
|
+
|
33
|
+
//# sourceMappingURL=commentNotification.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"names":["_ApwCommentNotification","require","_types","createCommentNotification","plugin","createApwCommentNotification","ApwContentTypes","CMS_ENTRY","params","commentUrl","contentUrl","text","name","type","exports"],"sources":["commentNotification.ts"],"sourcesContent":["import { createApwCommentNotification } from \"~/ApwCommentNotification\";\nimport { ApwContentTypes } from \"~/types\";\n\nexport const createCommentNotification = () => {\n const plugin = createApwCommentNotification(ApwContentTypes.CMS_ENTRY, params => {\n const { commentUrl, contentUrl } = params;\n\n return {\n text: `\n Hi,<br /><br />\n \n You have received a <a href=\"${commentUrl}\">comment</a>, on a change request, for <a href=\"${contentUrl}\">this</a> content entry.<br />\n \n Here are the full URLs:<br /><br />\n \n Comment: ${commentUrl}<br />\n Content Entry: ${contentUrl}\n `\n };\n });\n\n plugin.name = `${plugin.type}.${ApwContentTypes.CMS_ENTRY}.default`;\n\n return plugin;\n};\n"],"mappings":";;;;;;AAAA,IAAAA,uBAAA,GAAAC,OAAA;AACA,IAAAC,MAAA,GAAAD,OAAA;AAEO,MAAME,yBAAyB,GAAGA,CAAA,KAAM;EAC3C,MAAMC,MAAM,GAAG,IAAAC,oDAA4B,EAACC,sBAAe,CAACC,SAAS,EAAEC,MAAM,IAAI;IAC7E,MAAM;MAAEC,UAAU;MAAEC;IAAW,CAAC,GAAGF,MAAM;IAEzC,OAAO;MACHG,IAAI,EAAG;AACnB;AACA;AACA,+CAA+CF,UAAW,oDAAmDC,UAAW;AACxH;AACA;AACA;AACA,2BAA2BD,UAAW;AACtC,iCAAiCC,UAAW;AAC5C;IACQ,CAAC;EACL,CAAC,CAAC;EAEFN,MAAM,CAACQ,IAAI,GAAI,GAAER,MAAM,CAACS,IAAK,IAAGP,sBAAe,CAACC,SAAU,UAAS;EAEnE,OAAOH,MAAM;AACjB,CAAC;AAACU,OAAA,CAAAX,yBAAA,GAAAA,yBAAA"}
|
@@ -0,0 +1 @@
|
|
1
|
+
export declare const createContentReviewNotification: () => import("../../../ApwContentReviewNotification").ApwContentReviewNotification;
|
@@ -0,0 +1,33 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
4
|
+
value: true
|
5
|
+
});
|
6
|
+
exports.createContentReviewNotification = void 0;
|
7
|
+
var _types = require("../../../types");
|
8
|
+
var _ApwContentReviewNotification = require("../../../ApwContentReviewNotification");
|
9
|
+
const createContentReviewNotification = () => {
|
10
|
+
const plugin = (0, _ApwContentReviewNotification.createApwContentReviewNotification)(_types.ApwContentTypes.CMS_ENTRY, params => {
|
11
|
+
const {
|
12
|
+
contentReviewUrl,
|
13
|
+
contentUrl
|
14
|
+
} = params;
|
15
|
+
return {
|
16
|
+
text: `
|
17
|
+
Hi,<br /><br />
|
18
|
+
|
19
|
+
You have received a <a href="${contentReviewUrl}">content review</a>, for <a href="${contentUrl}">this</a> content entry.<br />
|
20
|
+
|
21
|
+
Here are the full URLs:<br /><br />
|
22
|
+
|
23
|
+
Content Review: ${contentReviewUrl}<br />
|
24
|
+
Content Entry: ${contentUrl}
|
25
|
+
`
|
26
|
+
};
|
27
|
+
});
|
28
|
+
plugin.name = `${plugin.type}.${_types.ApwContentTypes.CMS_ENTRY}.default`;
|
29
|
+
return plugin;
|
30
|
+
};
|
31
|
+
exports.createContentReviewNotification = createContentReviewNotification;
|
32
|
+
|
33
|
+
//# sourceMappingURL=contentReviewNotification.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"names":["_types","require","_ApwContentReviewNotification","createContentReviewNotification","plugin","createApwContentReviewNotification","ApwContentTypes","CMS_ENTRY","params","contentReviewUrl","contentUrl","text","name","type","exports"],"sources":["contentReviewNotification.ts"],"sourcesContent":["import { ApwContentTypes } from \"~/types\";\nimport { createApwContentReviewNotification } from \"~/ApwContentReviewNotification\";\n\nexport const createContentReviewNotification = () => {\n const plugin = createApwContentReviewNotification(ApwContentTypes.CMS_ENTRY, params => {\n const { contentReviewUrl, contentUrl } = params;\n\n return {\n text: `\n Hi,<br /><br />\n \n You have received a <a href=\"${contentReviewUrl}\">content review</a>, for <a href=\"${contentUrl}\">this</a> content entry.<br />\n \n Here are the full URLs:<br /><br />\n \n Content Review: ${contentReviewUrl}<br />\n Content Entry: ${contentUrl}\n `\n };\n });\n\n plugin.name = `${plugin.type}.${ApwContentTypes.CMS_ENTRY}.default`;\n\n return plugin;\n};\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,6BAAA,GAAAD,OAAA;AAEO,MAAME,+BAA+B,GAAGA,CAAA,KAAM;EACjD,MAAMC,MAAM,GAAG,IAAAC,gEAAkC,EAACC,sBAAe,CAACC,SAAS,EAAEC,MAAM,IAAI;IACnF,MAAM;MAAEC,gBAAgB;MAAEC;IAAW,CAAC,GAAGF,MAAM;IAE/C,OAAO;MACHG,IAAI,EAAG;AACnB;AACA;AACA,+CAA+CF,gBAAiB,sCAAqCC,UAAW;AAChH;AACA;AACA;AACA,kCAAkCD,gBAAiB;AACnD,iCAAiCC,UAAW;AAC5C;IACQ,CAAC;EACL,CAAC,CAAC;EAEFN,MAAM,CAACQ,IAAI,GAAI,GAAER,MAAM,CAACS,IAAK,IAAGP,sBAAe,CAACC,SAAU,UAAS;EAEnE,OAAOH,MAAM;AACjB,CAAC;AAACU,OAAA,CAAAX,+BAAA,GAAAA,+BAAA"}
|
@@ -0,0 +1,8 @@
|
|
1
|
+
interface CreateContentEntryUrlParams {
|
2
|
+
baseUrl?: string;
|
3
|
+
modelId?: string;
|
4
|
+
id: string;
|
5
|
+
}
|
6
|
+
export declare const createContentEntryUrl: (params: CreateContentEntryUrlParams) => string | null;
|
7
|
+
export declare const createContentUrlPlugin: () => import("../../../ApwContentUrlPlugin").ApwContentUrlPlugin;
|
8
|
+
export {};
|
@@ -0,0 +1,55 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
4
|
+
value: true
|
5
|
+
});
|
6
|
+
exports.createContentUrlPlugin = exports.createContentEntryUrl = void 0;
|
7
|
+
var _ApwContentUrlPlugin = require("../../../ApwContentUrlPlugin");
|
8
|
+
var _types = require("../../../types");
|
9
|
+
/**
|
10
|
+
* In this file we create a plugin which in turn creates a content entry url when requested by the code which sends notifications.
|
11
|
+
* Due to multiple content types for the APW, everything needs to be pluginable.
|
12
|
+
*/
|
13
|
+
|
14
|
+
const createContentEntryUrl = params => {
|
15
|
+
/**
|
16
|
+
* All variables must exist for URL to be created.
|
17
|
+
* We go through all vars and throw a log if it does not exist.
|
18
|
+
*/
|
19
|
+
for (const key in params) {
|
20
|
+
if (!!key) {
|
21
|
+
continue;
|
22
|
+
}
|
23
|
+
console.log(`Missing variable "${key}", which we use to create a content entry URL.`);
|
24
|
+
return null;
|
25
|
+
}
|
26
|
+
const {
|
27
|
+
baseUrl,
|
28
|
+
modelId,
|
29
|
+
id
|
30
|
+
} = params;
|
31
|
+
return `${baseUrl}/cms/content-entries/${modelId}?id=${id}`;
|
32
|
+
};
|
33
|
+
exports.createContentEntryUrl = createContentEntryUrl;
|
34
|
+
const createContentUrlPlugin = () => {
|
35
|
+
return (0, _ApwContentUrlPlugin.createApwContentUrlPlugin)(_types.ApwContentTypes.CMS_ENTRY, params => {
|
36
|
+
const {
|
37
|
+
baseUrl,
|
38
|
+
contentReview
|
39
|
+
} = params;
|
40
|
+
const {
|
41
|
+
id
|
42
|
+
} = contentReview.content;
|
43
|
+
const {
|
44
|
+
modelId
|
45
|
+
} = contentReview.content.settings;
|
46
|
+
return createContentEntryUrl({
|
47
|
+
baseUrl,
|
48
|
+
modelId,
|
49
|
+
id
|
50
|
+
});
|
51
|
+
});
|
52
|
+
};
|
53
|
+
exports.createContentUrlPlugin = createContentUrlPlugin;
|
54
|
+
|
55
|
+
//# sourceMappingURL=contentUrl.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"names":["_ApwContentUrlPlugin","require","_types","createContentEntryUrl","params","key","console","log","baseUrl","modelId","id","exports","createContentUrlPlugin","createApwContentUrlPlugin","ApwContentTypes","CMS_ENTRY","contentReview","content","settings"],"sources":["contentUrl.ts"],"sourcesContent":["/**\n * In this file we create a plugin which in turn creates a content entry url when requested by the code which sends notifications.\n * Due to multiple content types for the APW, everything needs to be pluginable.\n */\nimport { createApwContentUrlPlugin } from \"~/ApwContentUrlPlugin\";\nimport { ApwContentTypes } from \"~/types\";\n\ninterface CreateContentEntryUrlParams {\n baseUrl?: string;\n modelId?: string;\n id: string;\n}\nexport const createContentEntryUrl = (params: CreateContentEntryUrlParams): string | null => {\n /**\n * All variables must exist for URL to be created.\n * We go through all vars and throw a log if it does not exist.\n */\n for (const key in params) {\n if (!!key) {\n continue;\n }\n console.log(`Missing variable \"${key}\", which we use to create a content entry URL.`);\n return null;\n }\n const { baseUrl, modelId, id } = params;\n return `${baseUrl}/cms/content-entries/${modelId}?id=${id}`;\n};\n\nexport const createContentUrlPlugin = () => {\n return createApwContentUrlPlugin(ApwContentTypes.CMS_ENTRY, params => {\n const { baseUrl, contentReview } = params;\n const { id } = contentReview.content;\n const { modelId } = contentReview.content.settings;\n return createContentEntryUrl({\n baseUrl,\n modelId,\n id\n });\n });\n};\n"],"mappings":";;;;;;AAIA,IAAAA,oBAAA,GAAAC,OAAA;AACA,IAAAC,MAAA,GAAAD,OAAA;AALA;AACA;AACA;AACA;;AASO,MAAME,qBAAqB,GAAIC,MAAmC,IAAoB;EACzF;AACJ;AACA;AACA;EACI,KAAK,MAAMC,GAAG,IAAID,MAAM,EAAE;IACtB,IAAI,CAAC,CAACC,GAAG,EAAE;MACP;IACJ;IACAC,OAAO,CAACC,GAAG,CAAE,qBAAoBF,GAAI,gDAA+C,CAAC;IACrF,OAAO,IAAI;EACf;EACA,MAAM;IAAEG,OAAO;IAAEC,OAAO;IAAEC;EAAG,CAAC,GAAGN,MAAM;EACvC,OAAQ,GAAEI,OAAQ,wBAAuBC,OAAQ,OAAMC,EAAG,EAAC;AAC/D,CAAC;AAACC,OAAA,CAAAR,qBAAA,GAAAA,qBAAA;AAEK,MAAMS,sBAAsB,GAAGA,CAAA,KAAM;EACxC,OAAO,IAAAC,8CAAyB,EAACC,sBAAe,CAACC,SAAS,EAAEX,MAAM,IAAI;IAClE,MAAM;MAAEI,OAAO;MAAEQ;IAAc,CAAC,GAAGZ,MAAM;IACzC,MAAM;MAAEM;IAAG,CAAC,GAAGM,aAAa,CAACC,OAAO;IACpC,MAAM;MAAER;IAAQ,CAAC,GAAGO,aAAa,CAACC,OAAO,CAACC,QAAQ;IAClD,OAAOf,qBAAqB,CAAC;MACzBK,OAAO;MACPC,OAAO;MACPC;IACJ,CAAC,CAAC;EACN,CAAC,CAAC;AACN,CAAC;AAACC,OAAA,CAAAC,sBAAA,GAAAA,sBAAA"}
|
@@ -1,18 +1,13 @@
|
|
1
1
|
"use strict";
|
2
2
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
4
|
-
|
5
4
|
Object.defineProperty(exports, "__esModule", {
|
6
5
|
value: true
|
7
6
|
});
|
8
7
|
exports.triggerContentReview = void 0;
|
9
|
-
|
10
8
|
var _error = _interopRequireDefault(require("@webiny/error"));
|
11
|
-
|
12
9
|
var _types = require("../../types");
|
13
|
-
|
14
10
|
var _utils = require("./utils");
|
15
|
-
|
16
11
|
const triggerContentReview = params => {
|
17
12
|
const {
|
18
13
|
cms,
|
@@ -22,38 +17,30 @@ const triggerContentReview = params => {
|
|
22
17
|
entry,
|
23
18
|
model
|
24
19
|
}) => {
|
25
|
-
|
26
|
-
|
27
|
-
if ((0, _utils.isAwpModel)(model)) {
|
20
|
+
if ((0, _utils.isApwDisabledOnModel)(model)) {
|
28
21
|
return;
|
29
22
|
}
|
30
|
-
|
31
|
-
const contentReviewId = (_entry$meta = entry.meta) === null || _entry$meta === void 0 ? void 0 : (_entry$meta$apw = _entry$meta.apw) === null || _entry$meta$apw === void 0 ? void 0 : _entry$meta$apw.contentReviewId;
|
32
|
-
|
23
|
+
const contentReviewId = entry.meta?.apw?.contentReviewId;
|
33
24
|
if (contentReviewId) {
|
34
25
|
const contentReview = await apw.contentReview.get(contentReviewId);
|
35
|
-
|
36
26
|
if (contentReview.reviewStatus !== _types.ApwContentReviewStatus.UNDER_REVIEW) {
|
37
27
|
return;
|
38
28
|
}
|
39
|
-
|
40
29
|
throw new _error.default(`A peer review for this content has been already requested.`, "REVIEW_ALREADY_EXIST", {
|
41
30
|
contentReviewId,
|
42
31
|
entry
|
43
32
|
});
|
44
33
|
}
|
45
|
-
|
46
|
-
const workflowId = (_entry$meta2 = entry.meta) === null || _entry$meta2 === void 0 ? void 0 : (_entry$meta2$apw = _entry$meta2.apw) === null || _entry$meta2$apw === void 0 ? void 0 : _entry$meta2$apw.workflowId;
|
47
|
-
|
34
|
+
const workflowId = entry.meta?.apw?.workflowId;
|
48
35
|
if (!workflowId) {
|
49
36
|
return;
|
50
37
|
}
|
51
|
-
|
52
38
|
throw new _error.default("This content requires peer review approval before it can be published.", "REVIEW_REQUIRED", {
|
53
39
|
workflowId,
|
54
40
|
entry
|
55
41
|
});
|
56
42
|
});
|
57
43
|
};
|
44
|
+
exports.triggerContentReview = triggerContentReview;
|
58
45
|
|
59
|
-
|
46
|
+
//# sourceMappingURL=triggerContentReview.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["triggerContentReview","params","cms","apw","onEntryBeforePublish","subscribe","entry","model","
|
1
|
+
{"version":3,"names":["_error","_interopRequireDefault","require","_types","_utils","triggerContentReview","params","cms","apw","onEntryBeforePublish","subscribe","entry","model","isApwDisabledOnModel","contentReviewId","meta","contentReview","get","reviewStatus","ApwContentReviewStatus","UNDER_REVIEW","Error","workflowId","exports"],"sources":["triggerContentReview.ts"],"sourcesContent":["import Error from \"@webiny/error\";\nimport {\n AdvancedPublishingWorkflow,\n ApwContentReviewStatus,\n OnCmsEntryBeforePublishTopicParams\n} from \"~/types\";\nimport { HeadlessCms } from \"@webiny/api-headless-cms/types\";\nimport { isApwDisabledOnModel } from \"~/plugins/cms/utils\";\n\ninterface TriggerContentReviewParams {\n apw: AdvancedPublishingWorkflow;\n cms: HeadlessCms;\n}\nexport const triggerContentReview = (params: TriggerContentReviewParams) => {\n const { cms, apw } = params;\n\n cms.onEntryBeforePublish.subscribe<OnCmsEntryBeforePublishTopicParams>(\n async ({ entry, model }) => {\n if (isApwDisabledOnModel(model)) {\n return;\n }\n const contentReviewId = entry.meta?.apw?.contentReviewId;\n if (contentReviewId) {\n const contentReview = await apw.contentReview.get(contentReviewId);\n\n if (contentReview.reviewStatus !== ApwContentReviewStatus.UNDER_REVIEW) {\n return;\n }\n throw new Error(\n `A peer review for this content has been already requested.`,\n \"REVIEW_ALREADY_EXIST\",\n {\n contentReviewId,\n entry\n }\n );\n }\n\n const workflowId = entry.meta?.apw?.workflowId;\n\n if (!workflowId) {\n return;\n }\n throw new Error(\n \"This content requires peer review approval before it can be published.\",\n \"REVIEW_REQUIRED\",\n {\n workflowId,\n entry\n }\n );\n }\n );\n};\n"],"mappings":";;;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,MAAA,GAAAD,OAAA;AAMA,IAAAE,MAAA,GAAAF,OAAA;AAMO,MAAMG,oBAAoB,GAAIC,MAAkC,IAAK;EACxE,MAAM;IAAEC,GAAG;IAAEC;EAAI,CAAC,GAAGF,MAAM;EAE3BC,GAAG,CAACE,oBAAoB,CAACC,SAAS,CAC9B,OAAO;IAAEC,KAAK;IAAEC;EAAM,CAAC,KAAK;IACxB,IAAI,IAAAC,2BAAoB,EAACD,KAAK,CAAC,EAAE;MAC7B;IACJ;IACA,MAAME,eAAe,GAAGH,KAAK,CAACI,IAAI,EAAEP,GAAG,EAAEM,eAAe;IACxD,IAAIA,eAAe,EAAE;MACjB,MAAME,aAAa,GAAG,MAAMR,GAAG,CAACQ,aAAa,CAACC,GAAG,CAACH,eAAe,CAAC;MAElE,IAAIE,aAAa,CAACE,YAAY,KAAKC,6BAAsB,CAACC,YAAY,EAAE;QACpE;MACJ;MACA,MAAM,IAAIC,cAAK,CACV,4DAA2D,EAC5D,sBAAsB,EACtB;QACIP,eAAe;QACfH;MACJ,CACJ,CAAC;IACL;IAEA,MAAMW,UAAU,GAAGX,KAAK,CAACI,IAAI,EAAEP,GAAG,EAAEc,UAAU;IAE9C,IAAI,CAACA,UAAU,EAAE;MACb;IACJ;IACA,MAAM,IAAID,cAAK,CACX,wEAAwE,EACxE,iBAAiB,EACjB;MACIC,UAAU;MACVX;IACJ,CACJ,CAAC;EACL,CACJ,CAAC;AACL,CAAC;AAACY,OAAA,CAAAlB,oBAAA,GAAAA,oBAAA"}
|