@webiny/api-apw 0.0.0-ee-vpcs.549378cf03
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 +40 -0
- package/ApwChangeRequestNotification.js.map +1 -0
- package/ApwCommentNotification.d.ts +27 -0
- package/ApwCommentNotification.js +40 -0
- package/ApwCommentNotification.js.map +1 -0
- package/ApwContentReviewNotification.d.ts +26 -0
- package/ApwContentReviewNotification.js +40 -0
- package/ApwContentReviewNotification.js.map +1 -0
- package/ApwContentUrlPlugin.d.ts +19 -0
- package/ApwContentUrlPlugin.js +40 -0
- package/ApwContentUrlPlugin.js.map +1 -0
- package/ContentApwSettingsPlugin.d.ts +10 -0
- package/ContentApwSettingsPlugin.js +17 -0
- package/ContentApwSettingsPlugin.js.map +1 -0
- package/LICENSE +21 -0
- package/README.md +34 -0
- package/crud/createChangeRequestMethods.d.ts +2 -0
- package/crud/createChangeRequestMethods.js +98 -0
- package/crud/createChangeRequestMethods.js.map +1 -0
- package/crud/createCommentMethods.d.ts +2 -0
- package/crud/createCommentMethods.js +99 -0
- package/crud/createCommentMethods.js.map +1 -0
- package/crud/createContentReviewMethods.d.ts +10 -0
- package/crud/createContentReviewMethods.js +562 -0
- package/crud/createContentReviewMethods.js.map +1 -0
- package/crud/createReviewerMethods.d.ts +2 -0
- package/crud/createReviewerMethods.js +99 -0
- package/crud/createReviewerMethods.js.map +1 -0
- package/crud/createWorkflowMethods.d.ts +2 -0
- package/crud/createWorkflowMethods.js +118 -0
- package/crud/createWorkflowMethods.js.map +1 -0
- package/crud/index.d.ts +2 -0
- package/crud/index.js +96 -0
- package/crud/index.js.map +1 -0
- package/crud/utils.d.ts +21 -0
- package/crud/utils.js +138 -0
- package/crud/utils.js.map +1 -0
- package/index.d.ts +4 -0
- package/index.js +38 -0
- package/index.js.map +1 -0
- package/package.json +76 -0
- package/plugins/cms/CmsEntryApwSettingsGetterPlugin.d.ts +10 -0
- package/plugins/cms/CmsEntryApwSettingsGetterPlugin.js +51 -0
- package/plugins/cms/CmsEntryApwSettingsGetterPlugin.js.map +1 -0
- package/plugins/cms/README.md +49 -0
- package/plugins/cms/apwEntryPlugins.d.ts +8 -0
- package/plugins/cms/apwEntryPlugins.js +46 -0
- package/plugins/cms/apwEntryPlugins.js.map +1 -0
- package/plugins/cms/index.d.ts +12 -0
- package/plugins/cms/index.js +45 -0
- package/plugins/cms/index.js.map +1 -0
- package/plugins/cms/linkContentReviewToEntry.d.ts +8 -0
- package/plugins/cms/linkContentReviewToEntry.js +108 -0
- package/plugins/cms/linkContentReviewToEntry.js.map +1 -0
- package/plugins/cms/linkWorkflowToEntry.d.ts +8 -0
- package/plugins/cms/linkWorkflowToEntry.js +166 -0
- package/plugins/cms/linkWorkflowToEntry.js.map +1 -0
- package/plugins/cms/notifications/changeRequestNotification.d.ts +1 -0
- package/plugins/cms/notifications/changeRequestNotification.js +35 -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 +35 -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 +35 -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 +60 -0
- package/plugins/cms/notifications/contentUrl.js.map +1 -0
- package/plugins/cms/triggerContentReview.d.ts +8 -0
- package/plugins/cms/triggerContentReview.js +59 -0
- package/plugins/cms/triggerContentReview.js.map +1 -0
- package/plugins/cms/updateContentReviewStatus.d.ts +10 -0
- package/plugins/cms/updateContentReviewStatus.js +97 -0
- package/plugins/cms/updateContentReviewStatus.js.map +1 -0
- package/plugins/cms/utils.d.ts +27 -0
- package/plugins/cms/utils.js +207 -0
- package/plugins/cms/utils.js.map +1 -0
- package/plugins/context.d.ts +5 -0
- package/plugins/context.js +146 -0
- package/plugins/context.js.map +1 -0
- package/plugins/graphql/changeRequest.gql.d.ts +4 -0
- package/plugins/graphql/changeRequest.gql.js +155 -0
- package/plugins/graphql/changeRequest.gql.js.map +1 -0
- package/plugins/graphql/comment.gql.d.ts +4 -0
- package/plugins/graphql/comment.gql.js +160 -0
- package/plugins/graphql/comment.gql.js.map +1 -0
- package/plugins/graphql/contentReview.gql.d.ts +4 -0
- package/plugins/graphql/contentReview.gql.js +382 -0
- package/plugins/graphql/contentReview.gql.js.map +1 -0
- package/plugins/graphql/reviewer.gql.d.ts +4 -0
- package/plugins/graphql/reviewer.gql.js +116 -0
- package/plugins/graphql/reviewer.gql.js.map +1 -0
- package/plugins/graphql/workflow.gql.d.ts +4 -0
- package/plugins/graphql/workflow.gql.js +205 -0
- package/plugins/graphql/workflow.gql.js.map +1 -0
- package/plugins/graphql.d.ts +4 -0
- package/plugins/graphql.js +95 -0
- package/plugins/graphql.js.map +1 -0
- package/plugins/hooks/createReviewerFromIdentity.d.ts +2 -0
- package/plugins/hooks/createReviewerFromIdentity.js +82 -0
- package/plugins/hooks/createReviewerFromIdentity.js.map +1 -0
- package/plugins/hooks/deleteChangeRequestsAfterContentReview.d.ts +2 -0
- package/plugins/hooks/deleteChangeRequestsAfterContentReview.js +67 -0
- package/plugins/hooks/deleteChangeRequestsAfterContentReview.js.map +1 -0
- package/plugins/hooks/deleteCommentsAfterChangeRequest.d.ts +2 -0
- package/plugins/hooks/deleteCommentsAfterChangeRequest.js +59 -0
- package/plugins/hooks/deleteCommentsAfterChangeRequest.js.map +1 -0
- package/plugins/hooks/index.d.ts +3 -0
- package/plugins/hooks/index.js +74 -0
- package/plugins/hooks/index.js.map +1 -0
- package/plugins/hooks/initializeContentReviewSteps.d.ts +2 -0
- package/plugins/hooks/initializeContentReviewSteps.js +86 -0
- package/plugins/hooks/initializeContentReviewSteps.js.map +1 -0
- package/plugins/hooks/initializeNotifications.d.ts +2 -0
- package/plugins/hooks/initializeNotifications.js +20 -0
- package/plugins/hooks/initializeNotifications.js.map +1 -0
- package/plugins/hooks/listContentReviews.d.ts +10 -0
- package/plugins/hooks/listContentReviews.js +68 -0
- package/plugins/hooks/listContentReviews.js.map +1 -0
- package/plugins/hooks/notifications/appUrl.d.ts +2 -0
- package/plugins/hooks/notifications/appUrl.js +22 -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 +144 -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 +31 -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 +157 -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 +31 -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 +122 -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 +30 -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 +29 -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 +25 -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 +25 -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 +25 -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 +51 -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 +52 -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 +52 -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 +52 -0
- package/plugins/hooks/notifications/sendContentReviewNotification.js.map +1 -0
- package/plugins/hooks/updatePendingChangeRequests.d.ts +2 -0
- package/plugins/hooks/updatePendingChangeRequests.js +94 -0
- package/plugins/hooks/updatePendingChangeRequests.js.map +1 -0
- package/plugins/hooks/updateTotalComments.d.ts +3 -0
- package/plugins/hooks/updateTotalComments.js +153 -0
- package/plugins/hooks/updateTotalComments.js.map +1 -0
- package/plugins/hooks/validateChangeRequest.d.ts +2 -0
- package/plugins/hooks/validateChangeRequest.js +89 -0
- package/plugins/hooks/validateChangeRequest.js.map +1 -0
- package/plugins/hooks/validateComment.d.ts +2 -0
- package/plugins/hooks/validateComment.js +57 -0
- package/plugins/hooks/validateComment.js.map +1 -0
- package/plugins/hooks/validateContentReview.d.ts +2 -0
- package/plugins/hooks/validateContentReview.js +38 -0
- package/plugins/hooks/validateContentReview.js.map +1 -0
- package/plugins/pageBuilder/PageApwSettingsGetterPlugin.d.ts +9 -0
- package/plugins/pageBuilder/PageApwSettingsGetterPlugin.js +51 -0
- package/plugins/pageBuilder/PageApwSettingsGetterPlugin.js.map +1 -0
- package/plugins/pageBuilder/apwContentPagePlugins.d.ts +3 -0
- package/plugins/pageBuilder/apwContentPagePlugins.js +30 -0
- package/plugins/pageBuilder/apwContentPagePlugins.js.map +1 -0
- package/plugins/pageBuilder/extendPbPageSettingsSchema.d.ts +3 -0
- package/plugins/pageBuilder/extendPbPageSettingsSchema.js +25 -0
- package/plugins/pageBuilder/extendPbPageSettingsSchema.js.map +1 -0
- package/plugins/pageBuilder/index.d.ts +11 -0
- package/plugins/pageBuilder/index.js +53 -0
- package/plugins/pageBuilder/index.js.map +1 -0
- package/plugins/pageBuilder/linkContentReviewToPage.d.ts +8 -0
- package/plugins/pageBuilder/linkContentReviewToPage.js +105 -0
- package/plugins/pageBuilder/linkContentReviewToPage.js.map +1 -0
- package/plugins/pageBuilder/linkWorkflowToPage.d.ts +8 -0
- package/plugins/pageBuilder/linkWorkflowToPage.js +194 -0
- package/plugins/pageBuilder/linkWorkflowToPage.js.map +1 -0
- package/plugins/pageBuilder/notifications/changeRequestNotification.d.ts +1 -0
- package/plugins/pageBuilder/notifications/changeRequestNotification.js +35 -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 +35 -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 +35 -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 +53 -0
- package/plugins/pageBuilder/notifications/contentUrl.js.map +1 -0
- package/plugins/pageBuilder/triggerContentReview.d.ts +8 -0
- package/plugins/pageBuilder/triggerContentReview.js +50 -0
- package/plugins/pageBuilder/triggerContentReview.js.map +1 -0
- package/plugins/pageBuilder/updateContentReviewStatus.d.ts +10 -0
- package/plugins/pageBuilder/updateContentReviewStatus.js +79 -0
- package/plugins/pageBuilder/updateContentReviewStatus.js.map +1 -0
- package/plugins/pageBuilder/utils.d.ts +22 -0
- package/plugins/pageBuilder/utils.js +184 -0
- package/plugins/pageBuilder/utils.js.map +1 -0
- package/plugins/utils.d.ts +35 -0
- package/plugins/utils.js +187 -0
- package/plugins/utils.js.map +1 -0
- package/scheduler/createScheduleActionMethods.d.ts +2 -0
- package/scheduler/createScheduleActionMethods.js +149 -0
- package/scheduler/createScheduleActionMethods.js.map +1 -0
- package/scheduler/handlers/executeAction/index.d.ts +13 -0
- package/scheduler/handlers/executeAction/index.js +172 -0
- package/scheduler/handlers/executeAction/index.js.map +1 -0
- package/scheduler/handlers/executeAction/plugins/ApplicationGraphQL.d.ts +13 -0
- package/scheduler/handlers/executeAction/plugins/ApplicationGraphQL.js +17 -0
- package/scheduler/handlers/executeAction/plugins/ApplicationGraphQL.js.map +1 -0
- package/scheduler/handlers/executeAction/plugins/HeadlessCMSGraphQL.d.ts +11 -0
- package/scheduler/handlers/executeAction/plugins/HeadlessCMSGraphQL.js +126 -0
- package/scheduler/handlers/executeAction/plugins/HeadlessCMSGraphQL.js.map +1 -0
- package/scheduler/handlers/executeAction/plugins/PageBuilderGraphQL.d.ts +11 -0
- package/scheduler/handlers/executeAction/plugins/PageBuilderGraphQL.js +163 -0
- package/scheduler/handlers/executeAction/plugins/PageBuilderGraphQL.js.map +1 -0
- package/scheduler/handlers/executeAction/security.d.ts +4 -0
- package/scheduler/handlers/executeAction/security.js +68 -0
- package/scheduler/handlers/executeAction/security.js.map +1 -0
- package/scheduler/handlers/scheduleAction/index.d.ts +22 -0
- package/scheduler/handlers/scheduleAction/index.js +164 -0
- package/scheduler/handlers/scheduleAction/index.js.map +1 -0
- package/scheduler/handlers/scheduleAction/scheduleAction.utils.d.ts +24 -0
- package/scheduler/handlers/scheduleAction/scheduleAction.utils.js +172 -0
- package/scheduler/handlers/scheduleAction/scheduleAction.utils.js.map +1 -0
- package/scheduler/handlers/utils.d.ts +33 -0
- package/scheduler/handlers/utils.js +168 -0
- package/scheduler/handlers/utils.js.map +1 -0
- package/scheduler/index.d.ts +2 -0
- package/scheduler/index.js +27 -0
- package/scheduler/index.js.map +1 -0
- package/scheduler/types.d.ts +171 -0
- package/scheduler/types.js +34 -0
- package/scheduler/types.js.map +1 -0
- package/storageOperations/changeRequestStorageOperations.d.ts +3 -0
- package/storageOperations/changeRequestStorageOperations.js +122 -0
- package/storageOperations/changeRequestStorageOperations.js.map +1 -0
- package/storageOperations/commentStorageOperations.d.ts +3 -0
- package/storageOperations/commentStorageOperations.js +138 -0
- package/storageOperations/commentStorageOperations.js.map +1 -0
- package/storageOperations/contentReviewStorageOperations.d.ts +3 -0
- package/storageOperations/contentReviewStorageOperations.js +93 -0
- package/storageOperations/contentReviewStorageOperations.js.map +1 -0
- package/storageOperations/index.d.ts +15 -0
- package/storageOperations/index.js +48 -0
- package/storageOperations/index.js.map +1 -0
- package/storageOperations/models/changeRequest.model.d.ts +3 -0
- package/storageOperations/models/changeRequest.model.js +59 -0
- package/storageOperations/models/changeRequest.model.js.map +1 -0
- package/storageOperations/models/comment.model.d.ts +7 -0
- package/storageOperations/models/comment.model.js +60 -0
- package/storageOperations/models/comment.model.js.map +1 -0
- package/storageOperations/models/contentModelPluginFactory.d.ts +15 -0
- package/storageOperations/models/contentModelPluginFactory.js +28 -0
- package/storageOperations/models/contentModelPluginFactory.js.map +1 -0
- package/storageOperations/models/contentReview.model.d.ts +7 -0
- package/storageOperations/models/contentReview.model.js +258 -0
- package/storageOperations/models/contentReview.model.js.map +1 -0
- package/storageOperations/models/index.d.ts +2 -0
- package/storageOperations/models/index.js +115 -0
- package/storageOperations/models/index.js.map +1 -0
- package/storageOperations/models/reviewer.model.d.ts +3 -0
- package/storageOperations/models/reviewer.model.js +71 -0
- package/storageOperations/models/reviewer.model.js.map +1 -0
- package/storageOperations/models/utils.d.ts +3 -0
- package/storageOperations/models/utils.js +37 -0
- package/storageOperations/models/utils.js.map +1 -0
- package/storageOperations/models/workflow.model.d.ts +12 -0
- package/storageOperations/models/workflow.model.js +208 -0
- package/storageOperations/models/workflow.model.js.map +1 -0
- package/storageOperations/reviewerStorageOperations.d.ts +3 -0
- package/storageOperations/reviewerStorageOperations.js +97 -0
- package/storageOperations/reviewerStorageOperations.js.map +1 -0
- package/storageOperations/types.d.ts +34 -0
- package/storageOperations/types.js +5 -0
- package/storageOperations/types.js.map +1 -0
- package/storageOperations/workflowStorageOperations.d.ts +3 -0
- package/storageOperations/workflowStorageOperations.js +111 -0
- package/storageOperations/workflowStorageOperations.js.map +1 -0
- package/types.d.ts +752 -0
- package/types.js +69 -0
- package/types.js.map +1 -0
- package/utils/contentApwSettingsPlugin.d.ts +9 -0
- package/utils/contentApwSettingsPlugin.js +26 -0
- package/utils/contentApwSettingsPlugin.js.map +1 -0
- package/utils/errors.d.ts +16 -0
- package/utils/errors.js +75 -0
- package/utils/errors.js.map +1 -0
- package/utils/fieldResolver.d.ts +16 -0
- package/utils/fieldResolver.js +54 -0
- package/utils/fieldResolver.js.map +1 -0
- package/utils/resolve.d.ts +3 -0
- package/utils/resolve.js +18 -0
- package/utils/resolve.js.map +1 -0
@@ -0,0 +1,30 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
4
|
+
value: true
|
5
|
+
});
|
6
|
+
exports.apwContentPagePlugins = void 0;
|
7
|
+
|
8
|
+
var _api = require("@webiny/api");
|
9
|
+
|
10
|
+
var _types = require("../../types");
|
11
|
+
|
12
|
+
const apwContentPagePlugins = () => new _api.ContextPlugin(async context => {
|
13
|
+
const {
|
14
|
+
apw,
|
15
|
+
pageBuilder
|
16
|
+
} = context;
|
17
|
+
apw.addContentGetter(_types.ApwContentTypes.PAGE, async id => {
|
18
|
+
return pageBuilder.getPage(id);
|
19
|
+
});
|
20
|
+
apw.addContentPublisher(_types.ApwContentTypes.PAGE, async id => {
|
21
|
+
await pageBuilder.publishPage(id);
|
22
|
+
return true;
|
23
|
+
});
|
24
|
+
apw.addContentUnPublisher(_types.ApwContentTypes.PAGE, async id => {
|
25
|
+
await pageBuilder.unpublishPage(id);
|
26
|
+
return true;
|
27
|
+
});
|
28
|
+
});
|
29
|
+
|
30
|
+
exports.apwContentPagePlugins = apwContentPagePlugins;
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"names":["apwContentPagePlugins","ContextPlugin","context","apw","pageBuilder","addContentGetter","ApwContentTypes","PAGE","id","getPage","addContentPublisher","publishPage","addContentUnPublisher","unpublishPage"],"sources":["apwContentPagePlugins.ts"],"sourcesContent":["import { ContextPlugin } from \"@webiny/api\";\nimport { ApwContentTypes, ApwContext, PageWithWorkflow } from \"~/types\";\n\nexport const apwContentPagePlugins = () =>\n new ContextPlugin<ApwContext>(async context => {\n const { apw, pageBuilder } = context;\n\n apw.addContentGetter(ApwContentTypes.PAGE, async id => {\n return pageBuilder.getPage<PageWithWorkflow>(id);\n });\n\n apw.addContentPublisher(ApwContentTypes.PAGE, async id => {\n await pageBuilder.publishPage<PageWithWorkflow>(id);\n return true;\n });\n\n apw.addContentUnPublisher(ApwContentTypes.PAGE, async id => {\n await pageBuilder.unpublishPage<PageWithWorkflow>(id);\n return true;\n });\n });\n"],"mappings":";;;;;;;AAAA;;AACA;;AAEO,MAAMA,qBAAqB,GAAG,MACjC,IAAIC,kBAAJ,CAA8B,MAAMC,OAAN,IAAiB;EAC3C,MAAM;IAAEC,GAAF;IAAOC;EAAP,IAAuBF,OAA7B;EAEAC,GAAG,CAACE,gBAAJ,CAAqBC,sBAAA,CAAgBC,IAArC,EAA2C,MAAMC,EAAN,IAAY;IACnD,OAAOJ,WAAW,CAACK,OAAZ,CAAsCD,EAAtC,CAAP;EACH,CAFD;EAIAL,GAAG,CAACO,mBAAJ,CAAwBJ,sBAAA,CAAgBC,IAAxC,EAA8C,MAAMC,EAAN,IAAY;IACtD,MAAMJ,WAAW,CAACO,WAAZ,CAA0CH,EAA1C,CAAN;IACA,OAAO,IAAP;EACH,CAHD;EAKAL,GAAG,CAACS,qBAAJ,CAA0BN,sBAAA,CAAgBC,IAA1C,EAAgD,MAAMC,EAAN,IAAY;IACxD,MAAMJ,WAAW,CAACS,aAAZ,CAA4CL,EAA5C,CAAN;IACA,OAAO,IAAP;EACH,CAHD;AAIH,CAhBD,CADG"}
|
@@ -0,0 +1,25 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
4
|
+
value: true
|
5
|
+
});
|
6
|
+
exports.extendPbPageSettingsSchema = void 0;
|
7
|
+
|
8
|
+
var _plugins = require("@webiny/handler-graphql/plugins");
|
9
|
+
|
10
|
+
const extendPbPageSettingsSchema = () => new _plugins.GraphQLSchemaPlugin({
|
11
|
+
typeDefs:
|
12
|
+
/* GraphQL */
|
13
|
+
`
|
14
|
+
type PbApwPageSettings {
|
15
|
+
workflowId: ID
|
16
|
+
contentReviewId: ID
|
17
|
+
}
|
18
|
+
|
19
|
+
extend type PbPageSettings {
|
20
|
+
apw: PbApwPageSettings
|
21
|
+
}
|
22
|
+
`
|
23
|
+
});
|
24
|
+
|
25
|
+
exports.extendPbPageSettingsSchema = extendPbPageSettingsSchema;
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"names":["extendPbPageSettingsSchema","GraphQLSchemaPlugin","typeDefs"],"sources":["extendPbPageSettingsSchema.ts"],"sourcesContent":["import { GraphQLSchemaPlugin } from \"@webiny/handler-graphql/plugins\";\nimport { ApwContext } from \"~/types\";\n\nexport const extendPbPageSettingsSchema = () =>\n new GraphQLSchemaPlugin<ApwContext>({\n typeDefs: /* GraphQL */ `\n type PbApwPageSettings {\n workflowId: ID\n contentReviewId: ID\n }\n\n extend type PbPageSettings {\n apw: PbApwPageSettings\n }\n `\n });\n"],"mappings":";;;;;;;AAAA;;AAGO,MAAMA,0BAA0B,GAAG,MACtC,IAAIC,4BAAJ,CAAoC;EAChCC,QAAQ;EAAE;EAAe;AACjC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAVwC,CAApC,CADG"}
|
@@ -0,0 +1,11 @@
|
|
1
|
+
import { Security } from "@webiny/api-security/types";
|
2
|
+
import { PageBuilderContextObject } from "@webiny/api-page-builder/graphql/types";
|
3
|
+
import { AdvancedPublishingWorkflow } from "../../types";
|
4
|
+
import { PluginsContainer } from "@webiny/plugins";
|
5
|
+
export interface ApwPageBuilderPluginsParams {
|
6
|
+
pageBuilder: PageBuilderContextObject;
|
7
|
+
apw: AdvancedPublishingWorkflow;
|
8
|
+
security: Security;
|
9
|
+
plugins: PluginsContainer;
|
10
|
+
}
|
11
|
+
export declare const apwPageBuilderHooks: (params: ApwPageBuilderPluginsParams) => void;
|
@@ -0,0 +1,53 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
4
|
+
value: true
|
5
|
+
});
|
6
|
+
exports.apwPageBuilderHooks = void 0;
|
7
|
+
|
8
|
+
var _triggerContentReview = require("./triggerContentReview");
|
9
|
+
|
10
|
+
var _linkContentReviewToPage = require("./linkContentReviewToPage");
|
11
|
+
|
12
|
+
var _updateContentReviewStatus = require("./updateContentReviewStatus");
|
13
|
+
|
14
|
+
var _linkWorkflowToPage = require("./linkWorkflowToPage");
|
15
|
+
|
16
|
+
var _PageApwSettingsGetterPlugin = require("./PageApwSettingsGetterPlugin");
|
17
|
+
|
18
|
+
var _commentNotification = require("./notifications/commentNotification");
|
19
|
+
|
20
|
+
var _contentUrl = require("./notifications/contentUrl");
|
21
|
+
|
22
|
+
var _changeRequestNotification = require("./notifications/changeRequestNotification");
|
23
|
+
|
24
|
+
var _contentReviewNotification = require("./notifications/contentReviewNotification");
|
25
|
+
|
26
|
+
const apwPageBuilderHooks = params => {
|
27
|
+
const {
|
28
|
+
pageBuilder,
|
29
|
+
apw,
|
30
|
+
security,
|
31
|
+
plugins
|
32
|
+
} = params;
|
33
|
+
plugins.register([new _PageApwSettingsGetterPlugin.PageApwSettingsGetterPlugin(), (0, _commentNotification.createCommentNotification)(), (0, _changeRequestNotification.createChangeRequestNotification)(), (0, _contentUrl.createContentUrlPlugin)(), (0, _contentReviewNotification.createContentReviewNotification)()]);
|
34
|
+
(0, _triggerContentReview.triggerContentReview)({
|
35
|
+
apw,
|
36
|
+
pageBuilder
|
37
|
+
});
|
38
|
+
(0, _linkContentReviewToPage.linkContentReviewToPage)({
|
39
|
+
apw,
|
40
|
+
pageBuilder
|
41
|
+
});
|
42
|
+
(0, _updateContentReviewStatus.updateContentReviewStatus)({
|
43
|
+
apw,
|
44
|
+
pageBuilder,
|
45
|
+
security
|
46
|
+
});
|
47
|
+
(0, _linkWorkflowToPage.linkWorkflowToPage)({
|
48
|
+
apw,
|
49
|
+
pageBuilder
|
50
|
+
});
|
51
|
+
};
|
52
|
+
|
53
|
+
exports.apwPageBuilderHooks = apwPageBuilderHooks;
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"names":["apwPageBuilderHooks","params","pageBuilder","apw","security","plugins","register","PageApwSettingsGetterPlugin","createCommentNotification","createChangeRequestNotification","createContentUrlPlugin","createContentReviewNotification","triggerContentReview","linkContentReviewToPage","updateContentReviewStatus","linkWorkflowToPage"],"sources":["index.ts"],"sourcesContent":["import { Security } from \"@webiny/api-security/types\";\nimport { PageBuilderContextObject } from \"@webiny/api-page-builder/graphql/types\";\nimport { AdvancedPublishingWorkflow } from \"~/types\";\nimport { triggerContentReview } from \"./triggerContentReview\";\nimport { linkContentReviewToPage } from \"./linkContentReviewToPage\";\nimport { updateContentReviewStatus } from \"./updateContentReviewStatus\";\nimport { linkWorkflowToPage } from \"./linkWorkflowToPage\";\nimport { PluginsContainer } from \"@webiny/plugins\";\nimport { PageApwSettingsGetterPlugin } from \"~/plugins/pageBuilder/PageApwSettingsGetterPlugin\";\nimport { createCommentNotification } from \"./notifications/commentNotification\";\nimport { createContentUrlPlugin } from \"./notifications/contentUrl\";\nimport { createChangeRequestNotification } from \"./notifications/changeRequestNotification\";\nimport { createContentReviewNotification } from \"./notifications/contentReviewNotification\";\n\nexport interface ApwPageBuilderPluginsParams {\n pageBuilder: PageBuilderContextObject;\n apw: AdvancedPublishingWorkflow;\n security: Security;\n plugins: PluginsContainer;\n}\n\nexport const apwPageBuilderHooks = (params: ApwPageBuilderPluginsParams) => {\n const { pageBuilder, apw, security, plugins } = params;\n\n plugins.register([\n new PageApwSettingsGetterPlugin(),\n createCommentNotification(),\n createChangeRequestNotification(),\n createContentUrlPlugin(),\n createContentReviewNotification()\n ]);\n\n triggerContentReview({\n apw,\n pageBuilder\n });\n linkContentReviewToPage({\n apw,\n pageBuilder\n });\n updateContentReviewStatus({\n apw,\n pageBuilder,\n security\n });\n linkWorkflowToPage({\n apw,\n pageBuilder\n });\n};\n"],"mappings":";;;;;;;AAGA;;AACA;;AACA;;AACA;;AAEA;;AACA;;AACA;;AACA;;AACA;;AASO,MAAMA,mBAAmB,GAAIC,MAAD,IAAyC;EACxE,MAAM;IAAEC,WAAF;IAAeC,GAAf;IAAoBC,QAApB;IAA8BC;EAA9B,IAA0CJ,MAAhD;EAEAI,OAAO,CAACC,QAAR,CAAiB,CACb,IAAIC,wDAAJ,EADa,EAEb,IAAAC,8CAAA,GAFa,EAGb,IAAAC,0DAAA,GAHa,EAIb,IAAAC,kCAAA,GAJa,EAKb,IAAAC,0DAAA,GALa,CAAjB;EAQA,IAAAC,0CAAA,EAAqB;IACjBT,GADiB;IAEjBD;EAFiB,CAArB;EAIA,IAAAW,gDAAA,EAAwB;IACpBV,GADoB;IAEpBD;EAFoB,CAAxB;EAIA,IAAAY,oDAAA,EAA0B;IACtBX,GADsB;IAEtBD,WAFsB;IAGtBE;EAHsB,CAA1B;EAKA,IAAAW,sCAAA,EAAmB;IACfZ,GADe;IAEfD;EAFe,CAAnB;AAIH,CA5BM"}
|
@@ -0,0 +1,8 @@
|
|
1
|
+
import { AdvancedPublishingWorkflow } from "../../types";
|
2
|
+
import { PageBuilderContextObject } from "@webiny/api-page-builder/graphql/types";
|
3
|
+
interface LinkContentReviewToPageParams {
|
4
|
+
apw: AdvancedPublishingWorkflow;
|
5
|
+
pageBuilder: PageBuilderContextObject;
|
6
|
+
}
|
7
|
+
export declare const linkContentReviewToPage: (params: LinkContentReviewToPageParams) => void;
|
8
|
+
export {};
|
@@ -0,0 +1,105 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
4
|
+
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
6
|
+
value: true
|
7
|
+
});
|
8
|
+
exports.linkContentReviewToPage = void 0;
|
9
|
+
|
10
|
+
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
|
11
|
+
|
12
|
+
var _error = _interopRequireDefault(require("@webiny/error"));
|
13
|
+
|
14
|
+
var _types = require("../../types");
|
15
|
+
|
16
|
+
var _utils = require("./utils");
|
17
|
+
|
18
|
+
const linkContentReviewToPage = params => {
|
19
|
+
const {
|
20
|
+
apw,
|
21
|
+
pageBuilder
|
22
|
+
} = params;
|
23
|
+
apw.contentReview.onContentReviewAfterCreate.subscribe(async ({
|
24
|
+
contentReview
|
25
|
+
}) => {
|
26
|
+
const {
|
27
|
+
content
|
28
|
+
} = contentReview;
|
29
|
+
|
30
|
+
if (content.type !== _types.ApwContentTypes.PAGE) {
|
31
|
+
return;
|
32
|
+
}
|
33
|
+
|
34
|
+
await (0, _utils.updatePageSettings)({
|
35
|
+
getPage: pageBuilder.getPage,
|
36
|
+
updatePage: pageBuilder.updatePage,
|
37
|
+
uniquePageId: content.id,
|
38
|
+
getNewSettings: settings => {
|
39
|
+
return (0, _objectSpread2.default)((0, _objectSpread2.default)({}, settings), {}, {
|
40
|
+
apw: (0, _objectSpread2.default)((0, _objectSpread2.default)({}, settings.apw || {}), {}, {
|
41
|
+
contentReviewId: contentReview.id
|
42
|
+
})
|
43
|
+
});
|
44
|
+
}
|
45
|
+
});
|
46
|
+
});
|
47
|
+
apw.contentReview.onContentReviewAfterDelete.subscribe(async ({
|
48
|
+
contentReview
|
49
|
+
}) => {
|
50
|
+
const {
|
51
|
+
content
|
52
|
+
} = contentReview;
|
53
|
+
|
54
|
+
if (content.type !== _types.ApwContentTypes.PAGE) {
|
55
|
+
return;
|
56
|
+
}
|
57
|
+
|
58
|
+
await (0, _utils.updatePageSettings)({
|
59
|
+
getPage: pageBuilder.getPage,
|
60
|
+
updatePage: pageBuilder.updatePage,
|
61
|
+
uniquePageId: content.id,
|
62
|
+
getNewSettings: settings => {
|
63
|
+
return (0, _objectSpread2.default)((0, _objectSpread2.default)({}, settings), {}, {
|
64
|
+
apw: (0, _objectSpread2.default)((0, _objectSpread2.default)({}, settings.apw || {}), {}, {
|
65
|
+
contentReviewId: null
|
66
|
+
})
|
67
|
+
});
|
68
|
+
}
|
69
|
+
});
|
70
|
+
});
|
71
|
+
pageBuilder.onPageBeforeDelete.subscribe(async ({
|
72
|
+
page
|
73
|
+
}) => {
|
74
|
+
var _page$settings, _page$settings$apw;
|
75
|
+
|
76
|
+
const contentReviewId = (_page$settings = page.settings) === null || _page$settings === void 0 ? void 0 : (_page$settings$apw = _page$settings.apw) === null || _page$settings$apw === void 0 ? void 0 : _page$settings$apw.contentReviewId;
|
77
|
+
|
78
|
+
if (!contentReviewId) {
|
79
|
+
return;
|
80
|
+
}
|
81
|
+
|
82
|
+
let contentReview;
|
83
|
+
|
84
|
+
try {
|
85
|
+
contentReview = await apw.contentReview.get(contentReviewId);
|
86
|
+
} catch (ex) {
|
87
|
+
/**
|
88
|
+
* We're handling the case whereby "contentReviewId" is still linked to page;
|
89
|
+
* even when the contentReview entry has been deleted. In that case, we'll allow page deletion.
|
90
|
+
*/
|
91
|
+
if (ex.code !== "NOT_FOUND") {
|
92
|
+
throw ex;
|
93
|
+
}
|
94
|
+
}
|
95
|
+
|
96
|
+
if (contentReview) {
|
97
|
+
throw new _error.default(`Cannot delete the page because a peer review has been requested. Please delete the review first.`, "CANNOT_DELETE_REVIEW_EXIST", {
|
98
|
+
contentReviewId,
|
99
|
+
page
|
100
|
+
});
|
101
|
+
}
|
102
|
+
});
|
103
|
+
};
|
104
|
+
|
105
|
+
exports.linkContentReviewToPage = linkContentReviewToPage;
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"names":["linkContentReviewToPage","params","apw","pageBuilder","contentReview","onContentReviewAfterCreate","subscribe","content","type","ApwContentTypes","PAGE","updatePageSettings","getPage","updatePage","uniquePageId","id","getNewSettings","settings","contentReviewId","onContentReviewAfterDelete","onPageBeforeDelete","page","get","ex","code","Error"],"sources":["linkContentReviewToPage.ts"],"sourcesContent":["import Error from \"@webiny/error\";\nimport { AdvancedPublishingWorkflow, ApwContentTypes } from \"~/types\";\nimport { updatePageSettings } from \"./utils\";\nimport { PageBuilderContextObject } from \"@webiny/api-page-builder/graphql/types\";\n\ninterface LinkContentReviewToPageParams {\n apw: AdvancedPublishingWorkflow;\n pageBuilder: PageBuilderContextObject;\n}\n\nexport const linkContentReviewToPage = (params: LinkContentReviewToPageParams) => {\n const { apw, pageBuilder } = params;\n\n apw.contentReview.onContentReviewAfterCreate.subscribe(async ({ contentReview }) => {\n const { content } = contentReview;\n\n if (content.type !== ApwContentTypes.PAGE) {\n return;\n }\n await updatePageSettings({\n getPage: pageBuilder.getPage,\n updatePage: pageBuilder.updatePage,\n uniquePageId: content.id,\n getNewSettings: settings => {\n return {\n ...settings,\n apw: {\n ...(settings.apw || {}),\n contentReviewId: contentReview.id\n }\n };\n }\n });\n });\n\n apw.contentReview.onContentReviewAfterDelete.subscribe(async ({ contentReview }) => {\n const { content } = contentReview;\n\n if (content.type !== ApwContentTypes.PAGE) {\n return;\n }\n await updatePageSettings({\n getPage: pageBuilder.getPage,\n updatePage: pageBuilder.updatePage,\n uniquePageId: content.id,\n getNewSettings: settings => {\n return {\n ...settings,\n apw: {\n ...(settings.apw || {}),\n contentReviewId: null\n }\n };\n }\n });\n });\n\n pageBuilder.onPageBeforeDelete.subscribe(async ({ page }) => {\n const contentReviewId = page.settings?.apw?.contentReviewId;\n if (!contentReviewId) {\n return;\n }\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 throw new Error(\n `Cannot delete the page because a peer review has been requested. Please delete the review first.`,\n \"CANNOT_DELETE_REVIEW_EXIST\",\n {\n contentReviewId,\n page\n }\n );\n }\n });\n};\n"],"mappings":";;;;;;;;;;;AAAA;;AACA;;AACA;;AAQO,MAAMA,uBAAuB,GAAIC,MAAD,IAA2C;EAC9E,MAAM;IAAEC,GAAF;IAAOC;EAAP,IAAuBF,MAA7B;EAEAC,GAAG,CAACE,aAAJ,CAAkBC,0BAAlB,CAA6CC,SAA7C,CAAuD,OAAO;IAAEF;EAAF,CAAP,KAA6B;IAChF,MAAM;MAAEG;IAAF,IAAcH,aAApB;;IAEA,IAAIG,OAAO,CAACC,IAAR,KAAiBC,sBAAA,CAAgBC,IAArC,EAA2C;MACvC;IACH;;IACD,MAAM,IAAAC,yBAAA,EAAmB;MACrBC,OAAO,EAAET,WAAW,CAACS,OADA;MAErBC,UAAU,EAAEV,WAAW,CAACU,UAFH;MAGrBC,YAAY,EAAEP,OAAO,CAACQ,EAHD;MAIrBC,cAAc,EAAEC,QAAQ,IAAI;QACxB,mEACOA,QADP;UAEIf,GAAG,8DACKe,QAAQ,CAACf,GAAT,IAAgB,EADrB;YAECgB,eAAe,EAAEd,aAAa,CAACW;UAFhC;QAFP;MAOH;IAZoB,CAAnB,CAAN;EAcH,CApBD;EAsBAb,GAAG,CAACE,aAAJ,CAAkBe,0BAAlB,CAA6Cb,SAA7C,CAAuD,OAAO;IAAEF;EAAF,CAAP,KAA6B;IAChF,MAAM;MAAEG;IAAF,IAAcH,aAApB;;IAEA,IAAIG,OAAO,CAACC,IAAR,KAAiBC,sBAAA,CAAgBC,IAArC,EAA2C;MACvC;IACH;;IACD,MAAM,IAAAC,yBAAA,EAAmB;MACrBC,OAAO,EAAET,WAAW,CAACS,OADA;MAErBC,UAAU,EAAEV,WAAW,CAACU,UAFH;MAGrBC,YAAY,EAAEP,OAAO,CAACQ,EAHD;MAIrBC,cAAc,EAAEC,QAAQ,IAAI;QACxB,mEACOA,QADP;UAEIf,GAAG,8DACKe,QAAQ,CAACf,GAAT,IAAgB,EADrB;YAECgB,eAAe,EAAE;UAFlB;QAFP;MAOH;IAZoB,CAAnB,CAAN;EAcH,CApBD;EAsBAf,WAAW,CAACiB,kBAAZ,CAA+Bd,SAA/B,CAAyC,OAAO;IAAEe;EAAF,CAAP,KAAoB;IAAA;;IACzD,MAAMH,eAAe,qBAAGG,IAAI,CAACJ,QAAR,yEAAG,eAAef,GAAlB,uDAAG,mBAAoBgB,eAA5C;;IACA,IAAI,CAACA,eAAL,EAAsB;MAClB;IACH;;IAED,IAAId,aAAJ;;IACA,IAAI;MACAA,aAAa,GAAG,MAAMF,GAAG,CAACE,aAAJ,CAAkBkB,GAAlB,CAAsBJ,eAAtB,CAAtB;IACH,CAFD,CAEE,OAAOK,EAAP,EAAW;MACT;AACZ;AACA;AACA;MACY,IAAIA,EAAE,CAACC,IAAH,KAAY,WAAhB,EAA6B;QACzB,MAAMD,EAAN;MACH;IACJ;;IAED,IAAInB,aAAJ,EAAmB;MACf,MAAM,IAAIqB,cAAJ,CACD,kGADC,EAEF,4BAFE,EAGF;QACIP,eADJ;QAEIG;MAFJ,CAHE,CAAN;IAQH;EACJ,CA7BD;AA8BH,CA7EM"}
|
@@ -0,0 +1,8 @@
|
|
1
|
+
import { AdvancedPublishingWorkflow } from "../../types";
|
2
|
+
import { PageBuilderContextObject } from "@webiny/api-page-builder/graphql/types";
|
3
|
+
interface LinkWorkflowToPageParams {
|
4
|
+
apw: AdvancedPublishingWorkflow;
|
5
|
+
pageBuilder: PageBuilderContextObject;
|
6
|
+
}
|
7
|
+
export declare const linkWorkflowToPage: (params: LinkWorkflowToPageParams) => void;
|
8
|
+
export {};
|
@@ -0,0 +1,194 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
4
|
+
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
6
|
+
value: true
|
7
|
+
});
|
8
|
+
exports.linkWorkflowToPage = void 0;
|
9
|
+
|
10
|
+
var _get = _interopRequireDefault(require("lodash/get"));
|
11
|
+
|
12
|
+
var _set = _interopRequireDefault(require("lodash/set"));
|
13
|
+
|
14
|
+
var _types = require("../../types");
|
15
|
+
|
16
|
+
var _utils = require("./utils");
|
17
|
+
|
18
|
+
const linkWorkflowToPage = params => {
|
19
|
+
const {
|
20
|
+
apw,
|
21
|
+
pageBuilder
|
22
|
+
} = params;
|
23
|
+
pageBuilder.onPageBeforeCreate.subscribe(async ({
|
24
|
+
page
|
25
|
+
}) => {
|
26
|
+
await (0, _utils.assignWorkflowToPage)({
|
27
|
+
listWorkflow: apw.workflow.list,
|
28
|
+
page
|
29
|
+
});
|
30
|
+
});
|
31
|
+
pageBuilder.onPageBeforeCreateFrom.subscribe(async params => {
|
32
|
+
const {
|
33
|
+
page,
|
34
|
+
original
|
35
|
+
} = params;
|
36
|
+
/**
|
37
|
+
* If the previous revision(original) already had the "contentReviewId",
|
38
|
+
* we need to unlink it so that new "contentReview" can be request for the new revision.
|
39
|
+
*/
|
40
|
+
|
41
|
+
const previousContentReviewId = (0, _get.default)(original, "settings.apw.contentReviewId");
|
42
|
+
|
43
|
+
if (previousContentReviewId) {
|
44
|
+
page.settings.apw.contentReviewId = null;
|
45
|
+
}
|
46
|
+
/**
|
47
|
+
* If the previous revision(original) already had the "workflowId",
|
48
|
+
* we don't need to do anything we'll just let it be copied over.
|
49
|
+
*/
|
50
|
+
|
51
|
+
|
52
|
+
const previousWorkflowId = (0, _get.default)(original, "settings.apw.workflowId");
|
53
|
+
|
54
|
+
if (previousWorkflowId) {
|
55
|
+
return;
|
56
|
+
}
|
57
|
+
/**
|
58
|
+
* Lookup and assign "workflowId".
|
59
|
+
*/
|
60
|
+
|
61
|
+
|
62
|
+
await (0, _utils.assignWorkflowToPage)({
|
63
|
+
listWorkflow: apw.workflow.list,
|
64
|
+
page
|
65
|
+
});
|
66
|
+
});
|
67
|
+
pageBuilder.onPageBeforeUpdate.subscribe(async params => {
|
68
|
+
const {
|
69
|
+
page,
|
70
|
+
original
|
71
|
+
} = params;
|
72
|
+
const prevApwWorkflowId = (0, _get.default)(original, "settings.apw");
|
73
|
+
const currentApwWorkflowId = (0, _get.default)(page, "settings.apw");
|
74
|
+
/**
|
75
|
+
* Make sure the apw property doesn't get lost between updates.
|
76
|
+
* It can happen because we run modal validation in "onBeforePageUpdate" event,
|
77
|
+
* which doesn't have the "apw" property.
|
78
|
+
*/
|
79
|
+
|
80
|
+
if (prevApwWorkflowId && !currentApwWorkflowId) {
|
81
|
+
page.settings.apw = original.settings.apw;
|
82
|
+
}
|
83
|
+
/*
|
84
|
+
* If there is a linked "contentReview" for this page and the page "title" has changed.
|
85
|
+
* Let's update the "title" field in "contentReview".
|
86
|
+
*/
|
87
|
+
|
88
|
+
|
89
|
+
const linkedContentReviewId = (0, _get.default)(page, "settings.apw.contentReviewId");
|
90
|
+
const prevTitle = (0, _get.default)(original, "title");
|
91
|
+
const newTitle = (0, _get.default)(page, "title");
|
92
|
+
|
93
|
+
if (linkedContentReviewId && prevTitle !== newTitle) {
|
94
|
+
await apw.contentReview.update(linkedContentReviewId, {
|
95
|
+
title: newTitle
|
96
|
+
});
|
97
|
+
}
|
98
|
+
});
|
99
|
+
/**
|
100
|
+
* Link created workflow to associated pages.
|
101
|
+
*/
|
102
|
+
|
103
|
+
apw.workflow.onWorkflowAfterCreate.subscribe(async ({
|
104
|
+
workflow
|
105
|
+
}) => {
|
106
|
+
const {
|
107
|
+
scope
|
108
|
+
} = workflow;
|
109
|
+
|
110
|
+
if (workflow.app !== _types.ApwWorkflowApplications.PB) {
|
111
|
+
return;
|
112
|
+
}
|
113
|
+
/**
|
114
|
+
* If the workflow has pages in it's scope, we'll link that workflow for each of those pages.
|
115
|
+
*/
|
116
|
+
|
117
|
+
|
118
|
+
if ((0, _utils.hasPages)(workflow) === false) {
|
119
|
+
return;
|
120
|
+
}
|
121
|
+
|
122
|
+
const pages = (0, _get.default)(scope, "data.pages");
|
123
|
+
|
124
|
+
for (const pid of pages) {
|
125
|
+
await (0, _utils.updatePageSettings)({
|
126
|
+
getPage: pageBuilder.getPage,
|
127
|
+
updatePage: pageBuilder.updatePage,
|
128
|
+
uniquePageId: pid,
|
129
|
+
getNewSettings: settings => {
|
130
|
+
return (0, _set.default)(settings, "apw.workflowId", workflow.id);
|
131
|
+
}
|
132
|
+
});
|
133
|
+
}
|
134
|
+
});
|
135
|
+
/**
|
136
|
+
* Link updated workflow to associated pages.
|
137
|
+
*/
|
138
|
+
|
139
|
+
apw.workflow.onWorkflowAfterUpdate.subscribe(async ({
|
140
|
+
workflow,
|
141
|
+
original
|
142
|
+
}) => {
|
143
|
+
const {
|
144
|
+
scope
|
145
|
+
} = workflow;
|
146
|
+
|
147
|
+
if (workflow.app !== _types.ApwWorkflowApplications.PB) {
|
148
|
+
return;
|
149
|
+
}
|
150
|
+
|
151
|
+
const {
|
152
|
+
scope: prevScope
|
153
|
+
} = original;
|
154
|
+
/**
|
155
|
+
* If the workflow has pages in it's scope and there is a change in that page list,
|
156
|
+
* we'll update the workflow link for corresponding pages.
|
157
|
+
*/
|
158
|
+
|
159
|
+
if ((0, _utils.hasPages)(workflow) === false || (0, _utils.shouldUpdatePages)(scope, prevScope) === false) {
|
160
|
+
return;
|
161
|
+
}
|
162
|
+
|
163
|
+
const previousPages = (0, _get.default)(prevScope, "data.pages", []);
|
164
|
+
const currentPages = (0, _get.default)(scope, "data.pages", []);
|
165
|
+
const {
|
166
|
+
removedPages,
|
167
|
+
addedPages
|
168
|
+
} = (0, _utils.getPagesDiff)(currentPages, previousPages);
|
169
|
+
|
170
|
+
for (const pid of addedPages) {
|
171
|
+
await (0, _utils.updatePageSettings)({
|
172
|
+
getPage: pageBuilder.getPage,
|
173
|
+
updatePage: pageBuilder.updatePage,
|
174
|
+
uniquePageId: pid,
|
175
|
+
getNewSettings: settings => {
|
176
|
+
return (0, _set.default)(settings, "apw.workflowId", workflow.id);
|
177
|
+
}
|
178
|
+
});
|
179
|
+
}
|
180
|
+
|
181
|
+
for (const pid of removedPages) {
|
182
|
+
await (0, _utils.updatePageSettings)({
|
183
|
+
getPage: pageBuilder.getPage,
|
184
|
+
updatePage: pageBuilder.updatePage,
|
185
|
+
uniquePageId: pid,
|
186
|
+
getNewSettings: settings => {
|
187
|
+
return (0, _set.default)(settings, "apw.workflowId", null);
|
188
|
+
}
|
189
|
+
});
|
190
|
+
}
|
191
|
+
});
|
192
|
+
};
|
193
|
+
|
194
|
+
exports.linkWorkflowToPage = linkWorkflowToPage;
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"names":["linkWorkflowToPage","params","apw","pageBuilder","onPageBeforeCreate","subscribe","page","assignWorkflowToPage","listWorkflow","workflow","list","onPageBeforeCreateFrom","original","previousContentReviewId","get","settings","contentReviewId","previousWorkflowId","onPageBeforeUpdate","prevApwWorkflowId","currentApwWorkflowId","linkedContentReviewId","prevTitle","newTitle","contentReview","update","title","onWorkflowAfterCreate","scope","app","ApwWorkflowApplications","PB","hasPages","pages","pid","updatePageSettings","getPage","updatePage","uniquePageId","getNewSettings","set","id","onWorkflowAfterUpdate","prevScope","shouldUpdatePages","previousPages","currentPages","removedPages","addedPages","getPagesDiff"],"sources":["linkWorkflowToPage.ts"],"sourcesContent":["import get from \"lodash/get\";\nimport set from \"lodash/set\";\nimport {\n ApwWorkflowApplications,\n ApwOnPageBeforeCreateTopicParams,\n ApwOnPageBeforeCreateFromTopicParams,\n ApwOnPageBeforeUpdateTopicParams,\n AdvancedPublishingWorkflow\n} from \"~/types\";\nimport {\n getPagesDiff,\n hasPages,\n updatePageSettings,\n shouldUpdatePages,\n assignWorkflowToPage\n} from \"./utils\";\nimport { PageBuilderContextObject } from \"@webiny/api-page-builder/graphql/types\";\n\ninterface LinkWorkflowToPageParams {\n apw: AdvancedPublishingWorkflow;\n pageBuilder: PageBuilderContextObject;\n}\n\nexport const linkWorkflowToPage = (params: LinkWorkflowToPageParams) => {\n const { apw, pageBuilder } = params;\n\n pageBuilder.onPageBeforeCreate.subscribe<ApwOnPageBeforeCreateTopicParams>(async ({ page }) => {\n await assignWorkflowToPage({ listWorkflow: apw.workflow.list, page });\n });\n pageBuilder.onPageBeforeCreateFrom.subscribe<ApwOnPageBeforeCreateFromTopicParams>(\n async params => {\n const { page, original } = params;\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 = get(original, \"settings.apw.contentReviewId\");\n if (previousContentReviewId) {\n page.settings.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 = get(original, \"settings.apw.workflowId\");\n if (previousWorkflowId) {\n return;\n }\n /**\n * Lookup and assign \"workflowId\".\n */\n await assignWorkflowToPage({ listWorkflow: apw.workflow.list, page });\n }\n );\n pageBuilder.onPageBeforeUpdate.subscribe<ApwOnPageBeforeUpdateTopicParams>(async params => {\n const { page, original } = params;\n const prevApwWorkflowId = get(original, \"settings.apw\");\n const currentApwWorkflowId = get(page, \"settings.apw\");\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 page.settings.apw = original.settings.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 = get(page, \"settings.apw.contentReviewId\");\n const prevTitle = get(original, \"title\");\n const newTitle = get(page, \"title\");\n\n if (linkedContentReviewId && prevTitle !== newTitle) {\n await apw.contentReview.update(linkedContentReviewId, { title: newTitle });\n }\n });\n /**\n * Link created workflow to associated pages.\n */\n apw.workflow.onWorkflowAfterCreate.subscribe(async ({ workflow }) => {\n const { scope } = workflow;\n if (workflow.app !== ApwWorkflowApplications.PB) {\n return;\n }\n /**\n * If the workflow has pages in it's scope, we'll link that workflow for each of those pages.\n */\n if (hasPages(workflow) === false) {\n return;\n }\n const pages = get(scope, \"data.pages\") as unknown as string[];\n\n for (const pid of pages) {\n await updatePageSettings({\n getPage: pageBuilder.getPage,\n updatePage: pageBuilder.updatePage,\n uniquePageId: pid,\n getNewSettings: settings => {\n return set(settings, \"apw.workflowId\", workflow.id);\n }\n });\n }\n });\n /**\n * Link updated workflow to associated pages.\n */\n apw.workflow.onWorkflowAfterUpdate.subscribe(async ({ workflow, original }) => {\n const { scope } = workflow;\n if (workflow.app !== ApwWorkflowApplications.PB) {\n return;\n }\n const { scope: prevScope } = original;\n /**\n * If the workflow has pages in it's scope and there is a change in that page list,\n * we'll update the workflow link for corresponding pages.\n */\n if (hasPages(workflow) === false || shouldUpdatePages(scope, prevScope) === false) {\n return;\n }\n\n const previousPages = get(prevScope, \"data.pages\", []);\n const currentPages = get(scope, \"data.pages\", []);\n\n const { removedPages, addedPages } = getPagesDiff(currentPages, previousPages);\n for (const pid of addedPages) {\n await updatePageSettings({\n getPage: pageBuilder.getPage,\n updatePage: pageBuilder.updatePage,\n uniquePageId: pid,\n getNewSettings: settings => {\n return set(settings, \"apw.workflowId\", workflow.id);\n }\n });\n }\n for (const pid of removedPages) {\n await updatePageSettings({\n getPage: pageBuilder.getPage,\n updatePage: pageBuilder.updatePage,\n uniquePageId: pid,\n getNewSettings: settings => {\n return set(settings, \"apw.workflowId\", null);\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,35 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
4
|
+
value: true
|
5
|
+
});
|
6
|
+
exports.createChangeRequestNotification = void 0;
|
7
|
+
|
8
|
+
var _types = require("../../../types");
|
9
|
+
|
10
|
+
var _ApwChangeRequestNotification = require("../../../ApwChangeRequestNotification");
|
11
|
+
|
12
|
+
const createChangeRequestNotification = () => {
|
13
|
+
const plugin = (0, _ApwChangeRequestNotification.createApwChangeRequestNotification)(_types.ApwContentTypes.PAGE, params => {
|
14
|
+
const {
|
15
|
+
changeRequestUrl,
|
16
|
+
contentUrl
|
17
|
+
} = params;
|
18
|
+
return {
|
19
|
+
text: `
|
20
|
+
Hi,<br /><br />
|
21
|
+
|
22
|
+
You have received a <a href="${changeRequestUrl}">change request</a>, for <a href="${contentUrl}">this</a> page.<br /><br />
|
23
|
+
|
24
|
+
Here are the full URLs:<br /><br />
|
25
|
+
|
26
|
+
Change Request: ${changeRequestUrl}<br />
|
27
|
+
Page: ${contentUrl}
|
28
|
+
`
|
29
|
+
};
|
30
|
+
});
|
31
|
+
plugin.name = `${plugin.type}.${_types.ApwContentTypes.PAGE}.default`;
|
32
|
+
return plugin;
|
33
|
+
};
|
34
|
+
|
35
|
+
exports.createChangeRequestNotification = createChangeRequestNotification;
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"names":["createChangeRequestNotification","plugin","createApwChangeRequestNotification","ApwContentTypes","PAGE","params","changeRequestUrl","contentUrl","text","name","type"],"sources":["changeRequestNotification.ts"],"sourcesContent":["import { ApwContentTypes } from \"~/types\";\nimport { createApwChangeRequestNotification } from \"~/ApwChangeRequestNotification\";\n\nexport const createChangeRequestNotification = () => {\n const plugin = createApwChangeRequestNotification(ApwContentTypes.PAGE, params => {\n const { changeRequestUrl, contentUrl } = params;\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> page.<br /><br />\n \n Here are the full URLs:<br /><br />\n \n Change Request: ${changeRequestUrl}<br />\n Page: ${contentUrl}\n `\n };\n });\n\n plugin.name = `${plugin.type}.${ApwContentTypes.PAGE}.default`;\n\n return plugin;\n};\n"],"mappings":";;;;;;;AAAA;;AACA;;AAEO,MAAMA,+BAA+B,GAAG,MAAM;EACjD,MAAMC,MAAM,GAAG,IAAAC,gEAAA,EAAmCC,sBAAA,CAAgBC,IAAnD,EAAyDC,MAAM,IAAI;IAC9E,MAAM;MAAEC,gBAAF;MAAoBC;IAApB,IAAmCF,MAAzC;IACA,OAAO;MACHG,IAAI,EAAG;AACnB;AACA;AACA,+CAA+CF,gBAAiB,sCAAqCC,UAAW;AAChH;AACA;AACA;AACA,kCAAkCD,gBAAiB;AACnD,wBAAwBC,UAAW;AACnC;IAVe,CAAP;EAYH,CAdc,CAAf;EAgBAN,MAAM,CAACQ,IAAP,GAAe,GAAER,MAAM,CAACS,IAAK,IAAGP,sBAAA,CAAgBC,IAAK,UAArD;EAEA,OAAOH,MAAP;AACH,CApBM"}
|
@@ -0,0 +1 @@
|
|
1
|
+
export declare const createCommentNotification: () => import("../../../ApwCommentNotification").ApwCommentNotification;
|
@@ -0,0 +1,35 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
4
|
+
value: true
|
5
|
+
});
|
6
|
+
exports.createCommentNotification = void 0;
|
7
|
+
|
8
|
+
var _ApwCommentNotification = require("../../../ApwCommentNotification");
|
9
|
+
|
10
|
+
var _types = require("../../../types");
|
11
|
+
|
12
|
+
const createCommentNotification = () => {
|
13
|
+
const plugin = (0, _ApwCommentNotification.createApwCommentNotification)(_types.ApwContentTypes.PAGE, params => {
|
14
|
+
const {
|
15
|
+
commentUrl,
|
16
|
+
contentUrl
|
17
|
+
} = params;
|
18
|
+
return {
|
19
|
+
text: `
|
20
|
+
Hi,<br /><br />
|
21
|
+
|
22
|
+
You have received a <a href="${commentUrl}">comment</a>, on a change request, for <a href="${contentUrl}">this</a> page.<br /><br />
|
23
|
+
|
24
|
+
Here are the full URLs:<br /><br />
|
25
|
+
|
26
|
+
Comment: ${commentUrl}<br />
|
27
|
+
Page: ${contentUrl}
|
28
|
+
`
|
29
|
+
};
|
30
|
+
});
|
31
|
+
plugin.name = `${plugin.type}.${_types.ApwContentTypes.PAGE}.default`;
|
32
|
+
return plugin;
|
33
|
+
};
|
34
|
+
|
35
|
+
exports.createCommentNotification = createCommentNotification;
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"names":["createCommentNotification","plugin","createApwCommentNotification","ApwContentTypes","PAGE","params","commentUrl","contentUrl","text","name","type"],"sources":["commentNotification.ts"],"sourcesContent":["import { createApwCommentNotification } from \"~/ApwCommentNotification\";\nimport { ApwContentTypes } from \"~/types\";\n\nexport const createCommentNotification = () => {\n const plugin = createApwCommentNotification(ApwContentTypes.PAGE, params => {\n const { commentUrl, contentUrl } = params;\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> page.<br /><br />\n \n Here are the full URLs:<br /><br />\n \n Comment: ${commentUrl}<br />\n Page: ${contentUrl}\n `\n };\n });\n\n plugin.name = `${plugin.type}.${ApwContentTypes.PAGE}.default`;\n\n return plugin;\n};\n"],"mappings":";;;;;;;AAAA;;AACA;;AAEO,MAAMA,yBAAyB,GAAG,MAAM;EAC3C,MAAMC,MAAM,GAAG,IAAAC,oDAAA,EAA6BC,sBAAA,CAAgBC,IAA7C,EAAmDC,MAAM,IAAI;IACxE,MAAM;MAAEC,UAAF;MAAcC;IAAd,IAA6BF,MAAnC;IACA,OAAO;MACHG,IAAI,EAAG;AACnB;AACA;AACA,+CAA+CF,UAAW,oDAAmDC,UAAW;AACxH;AACA;AACA;AACA,2BAA2BD,UAAW;AACtC,wBAAwBC,UAAW;AACnC;IAVe,CAAP;EAYH,CAdc,CAAf;EAgBAN,MAAM,CAACQ,IAAP,GAAe,GAAER,MAAM,CAACS,IAAK,IAAGP,sBAAA,CAAgBC,IAAK,UAArD;EAEA,OAAOH,MAAP;AACH,CApBM"}
|
@@ -0,0 +1 @@
|
|
1
|
+
export declare const createContentReviewNotification: () => import("../../../ApwContentReviewNotification").ApwContentReviewNotification;
|
@@ -0,0 +1,35 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
4
|
+
value: true
|
5
|
+
});
|
6
|
+
exports.createContentReviewNotification = void 0;
|
7
|
+
|
8
|
+
var _types = require("../../../types");
|
9
|
+
|
10
|
+
var _ApwContentReviewNotification = require("../../../ApwContentReviewNotification");
|
11
|
+
|
12
|
+
const createContentReviewNotification = () => {
|
13
|
+
const plugin = (0, _ApwContentReviewNotification.createApwContentReviewNotification)(_types.ApwContentTypes.PAGE, params => {
|
14
|
+
const {
|
15
|
+
contentReviewUrl,
|
16
|
+
contentUrl
|
17
|
+
} = params;
|
18
|
+
return {
|
19
|
+
text: `
|
20
|
+
Hi,<br /><br />
|
21
|
+
|
22
|
+
You have received a <a href="${contentReviewUrl}">content review</a>, for <a href="${contentUrl}">this</a> page.<br /><br />
|
23
|
+
|
24
|
+
Here are the full URLs:<br /><br />
|
25
|
+
|
26
|
+
Content Review: ${contentReviewUrl}<br />
|
27
|
+
Page: ${contentUrl}
|
28
|
+
`
|
29
|
+
};
|
30
|
+
});
|
31
|
+
plugin.name = `${plugin.type}.${_types.ApwContentTypes.PAGE}.default`;
|
32
|
+
return plugin;
|
33
|
+
};
|
34
|
+
|
35
|
+
exports.createContentReviewNotification = createContentReviewNotification;
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"names":["createContentReviewNotification","plugin","createApwContentReviewNotification","ApwContentTypes","PAGE","params","contentReviewUrl","contentUrl","text","name","type"],"sources":["contentReviewNotification.ts"],"sourcesContent":["import { ApwContentTypes } from \"~/types\";\nimport { createApwContentReviewNotification } from \"~/ApwContentReviewNotification\";\n\nexport const createContentReviewNotification = () => {\n const plugin = createApwContentReviewNotification(ApwContentTypes.PAGE, params => {\n const { contentReviewUrl, contentUrl } = params;\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> page.<br /><br />\n \n Here are the full URLs:<br /><br />\n \n Content Review: ${contentReviewUrl}<br />\n Page: ${contentUrl}\n `\n };\n });\n\n plugin.name = `${plugin.type}.${ApwContentTypes.PAGE}.default`;\n\n return plugin;\n};\n"],"mappings":";;;;;;;AAAA;;AACA;;AAEO,MAAMA,+BAA+B,GAAG,MAAM;EACjD,MAAMC,MAAM,GAAG,IAAAC,gEAAA,EAAmCC,sBAAA,CAAgBC,IAAnD,EAAyDC,MAAM,IAAI;IAC9E,MAAM;MAAEC,gBAAF;MAAoBC;IAApB,IAAmCF,MAAzC;IACA,OAAO;MACHG,IAAI,EAAG;AACnB;AACA;AACA,+CAA+CF,gBAAiB,sCAAqCC,UAAW;AAChH;AACA;AACA;AACA,kCAAkCD,gBAAiB;AACnD,wBAAwBC,UAAW;AACnC;IAVe,CAAP;EAYH,CAdc,CAAf;EAgBAN,MAAM,CAACQ,IAAP,GAAe,GAAER,MAAM,CAACS,IAAK,IAAGP,sBAAA,CAAgBC,IAAK,UAArD;EAEA,OAAOH,MAAP;AACH,CApBM"}
|
@@ -0,0 +1 @@
|
|
1
|
+
export declare const createContentUrlPlugin: () => import("../../../ApwContentUrlPlugin").ApwContentUrlPlugin;
|