@webiny/api-apw 0.0.0-unstable.d16f688daf → 0.0.0-unstable.d7f521b032
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.js +0 -10
- package/ApwChangeRequestNotification.js.map +1 -1
- package/ApwCommentNotification.js +0 -10
- package/ApwCommentNotification.js.map +1 -1
- package/ApwContentReviewNotification.js +0 -10
- package/ApwContentReviewNotification.js.map +1 -1
- package/ApwContentUrlPlugin.js +0 -10
- package/ApwContentUrlPlugin.js.map +1 -1
- package/ContentApwSettingsPlugin.js +0 -5
- package/ContentApwSettingsPlugin.js.map +1 -1
- package/crud/createChangeRequestMethods.js +4 -11
- package/crud/createChangeRequestMethods.js.map +1 -1
- package/crud/createCommentMethods.js +4 -12
- package/crud/createCommentMethods.js.map +1 -1
- package/crud/createContentReviewMethods.js +20 -84
- package/crud/createContentReviewMethods.js.map +1 -1
- package/crud/createReviewerMethods.js +4 -12
- package/crud/createReviewerMethods.js.map +1 -1
- package/crud/createWorkflowMethods.js +4 -17
- package/crud/createWorkflowMethods.js.map +1 -1
- package/crud/index.js +0 -25
- package/crud/index.js.map +1 -1
- package/crud/utils.js +0 -28
- package/crud/utils.js.map +1 -1
- package/index.d.ts +1 -2
- package/index.js +1 -15
- package/index.js.map +1 -1
- package/package.json +34 -34
- package/plugins/cms/CmsEntryApwSettingsGetterPlugin.js +0 -15
- package/plugins/cms/CmsEntryApwSettingsGetterPlugin.js.map +1 -1
- package/plugins/cms/apwEntryPlugins.js +0 -8
- package/plugins/cms/apwEntryPlugins.js.map +1 -1
- package/plugins/cms/index.js +0 -13
- package/plugins/cms/index.js.map +1 -1
- package/plugins/cms/linkContentReviewToEntry.js +0 -17
- package/plugins/cms/linkContentReviewToEntry.js.map +1 -1
- package/plugins/cms/linkWorkflowToEntry.js +2 -31
- package/plugins/cms/linkWorkflowToEntry.js.map +1 -1
- package/plugins/cms/notifications/changeRequestNotification.js +0 -4
- package/plugins/cms/notifications/changeRequestNotification.js.map +1 -1
- package/plugins/cms/notifications/commentNotification.js +0 -4
- package/plugins/cms/notifications/commentNotification.js.map +1 -1
- package/plugins/cms/notifications/contentReviewNotification.js +0 -4
- package/plugins/cms/notifications/contentReviewNotification.js.map +1 -1
- package/plugins/cms/notifications/contentUrl.js +1 -8
- package/plugins/cms/notifications/contentUrl.js.map +1 -1
- package/plugins/cms/triggerContentReview.js +0 -14
- package/plugins/cms/triggerContentReview.js.map +1 -1
- package/plugins/cms/updateContentReviewStatus.js +0 -18
- package/plugins/cms/updateContentReviewStatus.js.map +1 -1
- package/plugins/cms/utils.js +2 -47
- package/plugins/cms/utils.js.map +1 -1
- package/plugins/context.d.ts +0 -1
- package/plugins/context.js +2 -47
- package/plugins/context.js.map +1 -1
- package/plugins/graphql/changeRequest.gql.js +1 -8
- package/plugins/graphql/changeRequest.gql.js.map +1 -1
- package/plugins/graphql/comment.gql.js +1 -8
- package/plugins/graphql/comment.gql.js.map +1 -1
- package/plugins/graphql/contentReview.gql.js +1 -20
- package/plugins/graphql/contentReview.gql.js.map +1 -1
- package/plugins/graphql/reviewer.gql.js +1 -8
- package/plugins/graphql/reviewer.gql.js.map +1 -1
- package/plugins/graphql/workflow.gql.js +1 -8
- package/plugins/graphql/workflow.gql.js.map +1 -1
- package/plugins/graphql.js +2 -17
- package/plugins/graphql.js.map +1 -1
- package/plugins/hooks/createReviewerFromIdentity.js +2 -11
- package/plugins/hooks/createReviewerFromIdentity.js.map +1 -1
- package/plugins/hooks/deleteChangeRequestsAfterContentReview.js +1 -9
- package/plugins/hooks/deleteChangeRequestsAfterContentReview.js.map +1 -1
- package/plugins/hooks/deleteCommentsAfterChangeRequest.js +1 -8
- package/plugins/hooks/deleteCommentsAfterChangeRequest.js.map +1 -1
- package/plugins/hooks/index.js +0 -14
- package/plugins/hooks/index.js.map +1 -1
- package/plugins/hooks/initializeContentReviewSteps.js +10 -17
- package/plugins/hooks/initializeContentReviewSteps.js.map +1 -1
- package/plugins/hooks/initializeNotifications.js +0 -5
- package/plugins/hooks/initializeNotifications.js.map +1 -1
- package/plugins/hooks/listContentReviews.js +0 -12
- package/plugins/hooks/listContentReviews.js.map +1 -1
- package/plugins/hooks/notifications/appUrl.js +0 -4
- package/plugins/hooks/notifications/appUrl.js.map +1 -1
- package/plugins/hooks/notifications/changeRequestAfterCreate.js +0 -28
- package/plugins/hooks/notifications/changeRequestAfterCreate.js.map +1 -1
- package/plugins/hooks/notifications/changeRequestUrl.js +0 -4
- package/plugins/hooks/notifications/changeRequestUrl.js.map +1 -1
- package/plugins/hooks/notifications/commentAfterCreate.js +0 -30
- package/plugins/hooks/notifications/commentAfterCreate.js.map +1 -1
- package/plugins/hooks/notifications/commentUrl.js +0 -4
- package/plugins/hooks/notifications/commentUrl.js.map +1 -1
- package/plugins/hooks/notifications/contentReviewAfterCreate.js +1 -24
- package/plugins/hooks/notifications/contentReviewAfterCreate.js.map +1 -1
- package/plugins/hooks/notifications/contentReviewUrl.js +0 -4
- package/plugins/hooks/notifications/contentReviewUrl.js.map +1 -1
- package/plugins/hooks/notifications/contentUrl.js +0 -5
- package/plugins/hooks/notifications/contentUrl.js.map +1 -1
- package/plugins/hooks/notifications/lastChangeRequestNotificationPlugin.js +0 -4
- package/plugins/hooks/notifications/lastChangeRequestNotificationPlugin.js.map +1 -1
- package/plugins/hooks/notifications/lastCommentNotificationPlugin.js +0 -4
- package/plugins/hooks/notifications/lastCommentNotificationPlugin.js.map +1 -1
- package/plugins/hooks/notifications/lastContentReviewNotificationPlugin.js +0 -4
- package/plugins/hooks/notifications/lastContentReviewNotificationPlugin.js.map +1 -1
- package/plugins/hooks/notifications/reviewers.js +0 -7
- package/plugins/hooks/notifications/reviewers.js.map +1 -1
- package/plugins/hooks/notifications/sendChangeRequestNotification.js +0 -11
- package/plugins/hooks/notifications/sendChangeRequestNotification.js.map +1 -1
- package/plugins/hooks/notifications/sendCommentNotification.js +0 -11
- package/plugins/hooks/notifications/sendCommentNotification.js.map +1 -1
- package/plugins/hooks/notifications/sendContentReviewNotification.js +0 -11
- package/plugins/hooks/notifications/sendContentReviewNotification.js.map +1 -1
- package/plugins/hooks/updatePendingChangeRequests.js +0 -8
- package/plugins/hooks/updatePendingChangeRequests.js.map +1 -1
- package/plugins/hooks/updateTotalComments.js +0 -9
- package/plugins/hooks/updateTotalComments.js.map +1 -1
- package/plugins/hooks/validateChangeRequest.js +0 -16
- package/plugins/hooks/validateChangeRequest.js.map +1 -1
- package/plugins/hooks/validateComment.js +1 -12
- package/plugins/hooks/validateComment.js.map +1 -1
- package/plugins/hooks/validateContentReview.js +0 -6
- package/plugins/hooks/validateContentReview.js.map +1 -1
- package/plugins/pageBuilder/PageApwSettingsGetterPlugin.js +0 -15
- package/plugins/pageBuilder/PageApwSettingsGetterPlugin.js.map +1 -1
- package/plugins/pageBuilder/apwContentPagePlugins.js +0 -4
- package/plugins/pageBuilder/apwContentPagePlugins.js.map +1 -1
- package/plugins/pageBuilder/extendPbPageSettingsSchema.js +1 -6
- package/plugins/pageBuilder/extendPbPageSettingsSchema.js.map +1 -1
- package/plugins/pageBuilder/index.js +0 -11
- package/plugins/pageBuilder/index.js.map +1 -1
- package/plugins/pageBuilder/linkContentReviewToPage.js +0 -16
- package/plugins/pageBuilder/linkContentReviewToPage.js.map +1 -1
- package/plugins/pageBuilder/linkWorkflowToPage.js +1 -31
- package/plugins/pageBuilder/linkWorkflowToPage.js.map +1 -1
- package/plugins/pageBuilder/notifications/changeRequestNotification.js +0 -4
- package/plugins/pageBuilder/notifications/changeRequestNotification.js.map +1 -1
- package/plugins/pageBuilder/notifications/commentNotification.js +0 -4
- package/plugins/pageBuilder/notifications/commentNotification.js.map +1 -1
- package/plugins/pageBuilder/notifications/contentReviewNotification.js +0 -4
- package/plugins/pageBuilder/notifications/contentReviewNotification.js.map +1 -1
- package/plugins/pageBuilder/notifications/contentUrl.js +1 -7
- package/plugins/pageBuilder/notifications/contentUrl.js.map +1 -1
- package/plugins/pageBuilder/triggerContentReview.js +0 -11
- package/plugins/pageBuilder/triggerContentReview.js.map +1 -1
- package/plugins/pageBuilder/updateContentReviewStatus.js +0 -12
- package/plugins/pageBuilder/updateContentReviewStatus.js.map +1 -1
- package/plugins/pageBuilder/utils.js +1 -35
- package/plugins/pageBuilder/utils.js.map +1 -1
- package/plugins/utils.js +0 -43
- package/plugins/utils.js.map +1 -1
- package/scheduler/createScheduleActionMethods.js +1 -20
- package/scheduler/createScheduleActionMethods.js.map +1 -1
- package/scheduler/handlers/executeAction/index.d.ts +1 -1
- package/scheduler/handlers/executeAction/index.js +19 -34
- 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 +14 -5
- 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 +7 -23
- 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 +7 -86
- package/scheduler/handlers/executeAction/plugins/PageBuilderGraphQL.js.map +1 -1
- package/scheduler/handlers/executeAction/security.js +0 -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 +5 -25
- package/scheduler/handlers/scheduleAction/index.js.map +1 -1
- package/scheduler/handlers/scheduleAction/scheduleAction.utils.js +2 -23
- package/scheduler/handlers/scheduleAction/scheduleAction.utils.js.map +1 -1
- package/scheduler/handlers/utils.d.ts +1 -2
- package/scheduler/handlers/utils.js +3 -41
- package/scheduler/handlers/utils.js.map +1 -1
- package/scheduler/index.js +0 -3
- package/scheduler/index.js.map +1 -1
- package/scheduler/types.js +0 -6
- package/scheduler/types.js.map +1 -1
- package/storageOperations/changeRequestStorageOperations.js +0 -19
- package/storageOperations/changeRequestStorageOperations.js.map +1 -1
- package/storageOperations/commentStorageOperations.js +0 -21
- package/storageOperations/commentStorageOperations.js.map +1 -1
- package/storageOperations/contentReviewStorageOperations.js +0 -17
- package/storageOperations/contentReviewStorageOperations.js.map +1 -1
- package/storageOperations/index.js +0 -14
- package/storageOperations/index.js.map +1 -1
- package/storageOperations/models/changeRequest.model.js +0 -9
- package/storageOperations/models/changeRequest.model.js.map +1 -1
- package/storageOperations/models/comment.model.js +0 -8
- package/storageOperations/models/comment.model.js.map +1 -1
- package/storageOperations/models/contentModelPluginFactory.d.ts +0 -7
- package/storageOperations/models/contentModelPluginFactory.js +1 -10
- package/storageOperations/models/contentModelPluginFactory.js.map +1 -1
- package/storageOperations/models/contentReview.model.js +0 -26
- package/storageOperations/models/contentReview.model.js.map +1 -1
- package/storageOperations/models/index.js +2 -26
- package/storageOperations/models/index.js.map +1 -1
- package/storageOperations/models/reviewer.model.js +0 -8
- package/storageOperations/models/reviewer.model.js.map +1 -1
- package/storageOperations/models/utils.js +0 -4
- package/storageOperations/models/utils.js.map +1 -1
- package/storageOperations/models/workflow.model.js +0 -23
- package/storageOperations/models/workflow.model.js.map +1 -1
- package/storageOperations/reviewerStorageOperations.js +0 -17
- package/storageOperations/reviewerStorageOperations.js.map +1 -1
- package/storageOperations/workflowStorageOperations.js +0 -19
- package/storageOperations/workflowStorageOperations.js.map +1 -1
- package/types.js +0 -14
- package/types.js.map +1 -1
- package/utils/contentApwSettingsPlugin.js +0 -6
- package/utils/contentApwSettingsPlugin.js.map +1 -1
- package/utils/errors.js +0 -17
- package/utils/errors.js.map +1 -1
- package/utils/fieldResolver.js +2 -12
- package/utils/fieldResolver.js.map +1 -1
- package/utils/resolve.d.ts +1 -1
- package/utils/resolve.js +0 -3
- package/utils/resolve.js.map +1 -1
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["validateChangeRequest","apw","changeRequest","onChangeRequestBeforeCreate","subscribe","input","step","id","revisionId","stepId","extractContentReviewIdAndStep","entryId","version","parseIdentifier","WebinyError","contentReview","undefined","get","ex","process","env","NODE_ENV","console","log","message","code","data","NotFoundError","steps","currentStep","find","signOffProvidedOn"],"sources":["validateChangeRequest.ts"],"sourcesContent":["import WebinyError from \"@webiny/error\";\nimport { NotFoundError } from \"@webiny/handler-graphql\";\nimport { ApwContentReview, LifeCycleHookCallbackParams } from \"~/types\";\nimport { extractContentReviewIdAndStep } from \"~/plugins/utils\";\nimport { parseIdentifier } from \"@webiny/utils\";\n\nexport const validateChangeRequest = ({ apw }: Pick<LifeCycleHookCallbackParams, \"apw\">) => {\n apw.changeRequest.onChangeRequestBeforeCreate.subscribe(async ({ input }) => {\n const { step } = input;\n /**\n * We need step to be in a particular format i.e. \"contentReviewId#version#stepId\"\n */\n const { id: revisionId, stepId } = extractContentReviewIdAndStep(step);\n\n const { id: entryId, version } = parseIdentifier(revisionId);\n if (!entryId || !version || !stepId) {\n throw new WebinyError(\n `The step property in input is not properly formatted.`,\n \"MALFORMED_CHANGE_REQUEST_STEP\",\n {\n step\n }\n );\n }\n /**\n * Check whether a contentReview entry exists with provided id.\n */\n let contentReview: ApwContentReview | undefined = undefined;\n try {\n contentReview = await apw.contentReview.get(revisionId);\n } catch (ex) {\n /**\n * There is no need to output the log if this is the test environment.\n */\n if (process.env.NODE_ENV !== \"test\") {\n console.log({\n message: ex.message,\n code: ex.data,\n data: ex.data\n });\n }\n }\n if (!contentReview) {\n throw new NotFoundError(\n `Unable to found \"ContentReview\" with given id \"${revisionId}\"`\n );\n }\n /**\n * Don't allow \"change request\" creation once the sign-off has been provided.\n */\n const { steps } = contentReview;\n const currentStep = steps.find(step => step.id === stepId);\n\n if (currentStep && currentStep.signOffProvidedOn) {\n throw new WebinyError(\n `Please retract the sign-off before opening a new change request.`,\n \"SIGN_OFF_PROVIDED\",\n {\n step: currentStep,\n stepId: stepId\n }\n );\n }\n });\n};\n"],"mappings":"
|
1
|
+
{"version":3,"names":["validateChangeRequest","apw","changeRequest","onChangeRequestBeforeCreate","subscribe","input","step","id","revisionId","stepId","extractContentReviewIdAndStep","entryId","version","parseIdentifier","WebinyError","contentReview","undefined","get","ex","process","env","NODE_ENV","console","log","message","code","data","NotFoundError","steps","currentStep","find","signOffProvidedOn"],"sources":["validateChangeRequest.ts"],"sourcesContent":["import WebinyError from \"@webiny/error\";\nimport { NotFoundError } from \"@webiny/handler-graphql\";\nimport { ApwContentReview, LifeCycleHookCallbackParams } from \"~/types\";\nimport { extractContentReviewIdAndStep } from \"~/plugins/utils\";\nimport { parseIdentifier } from \"@webiny/utils\";\n\nexport const validateChangeRequest = ({ apw }: Pick<LifeCycleHookCallbackParams, \"apw\">) => {\n apw.changeRequest.onChangeRequestBeforeCreate.subscribe(async ({ input }) => {\n const { step } = input;\n /**\n * We need step to be in a particular format i.e. \"contentReviewId#version#stepId\"\n */\n const { id: revisionId, stepId } = extractContentReviewIdAndStep(step);\n\n const { id: entryId, version } = parseIdentifier(revisionId);\n if (!entryId || !version || !stepId) {\n throw new WebinyError(\n `The step property in input is not properly formatted.`,\n \"MALFORMED_CHANGE_REQUEST_STEP\",\n {\n step\n }\n );\n }\n /**\n * Check whether a contentReview entry exists with provided id.\n */\n let contentReview: ApwContentReview | undefined = undefined;\n try {\n contentReview = await apw.contentReview.get(revisionId);\n } catch (ex) {\n /**\n * There is no need to output the log if this is the test environment.\n */\n if (process.env.NODE_ENV !== \"test\") {\n console.log({\n message: ex.message,\n code: ex.data,\n data: ex.data\n });\n }\n }\n if (!contentReview) {\n throw new NotFoundError(\n `Unable to found \"ContentReview\" with given id \"${revisionId}\"`\n );\n }\n /**\n * Don't allow \"change request\" creation once the sign-off has been provided.\n */\n const { steps } = contentReview;\n const currentStep = steps.find(step => step.id === stepId);\n\n if (currentStep && currentStep.signOffProvidedOn) {\n throw new WebinyError(\n `Please retract the sign-off before opening a new change request.`,\n \"SIGN_OFF_PROVIDED\",\n {\n step: currentStep,\n stepId: stepId\n }\n );\n }\n });\n};\n"],"mappings":";;;;;;;AAAA;AACA;AAEA;AACA;AAEO,MAAMA,qBAAqB,GAAG,CAAC;EAAEC;AAA8C,CAAC,KAAK;EACxFA,GAAG,CAACC,aAAa,CAACC,2BAA2B,CAACC,SAAS,CAAC,OAAO;IAAEC;EAAM,CAAC,KAAK;IACzE,MAAM;MAAEC;IAAK,CAAC,GAAGD,KAAK;IACtB;AACR;AACA;IACQ,MAAM;MAAEE,EAAE,EAAEC,UAAU;MAAEC;IAAO,CAAC,GAAG,IAAAC,oCAA6B,EAACJ,IAAI,CAAC;IAEtE,MAAM;MAAEC,EAAE,EAAEI,OAAO;MAAEC;IAAQ,CAAC,GAAG,IAAAC,uBAAe,EAACL,UAAU,CAAC;IAC5D,IAAI,CAACG,OAAO,IAAI,CAACC,OAAO,IAAI,CAACH,MAAM,EAAE;MACjC,MAAM,IAAIK,cAAW,CAChB,uDAAsD,EACvD,+BAA+B,EAC/B;QACIR;MACJ,CAAC,CACJ;IACL;IACA;AACR;AACA;IACQ,IAAIS,aAA2C,GAAGC,SAAS;IAC3D,IAAI;MACAD,aAAa,GAAG,MAAMd,GAAG,CAACc,aAAa,CAACE,GAAG,CAACT,UAAU,CAAC;IAC3D,CAAC,CAAC,OAAOU,EAAE,EAAE;MACT;AACZ;AACA;MACY,IAAIC,OAAO,CAACC,GAAG,CAACC,QAAQ,KAAK,MAAM,EAAE;QACjCC,OAAO,CAACC,GAAG,CAAC;UACRC,OAAO,EAAEN,EAAE,CAACM,OAAO;UACnBC,IAAI,EAAEP,EAAE,CAACQ,IAAI;UACbA,IAAI,EAAER,EAAE,CAACQ;QACb,CAAC,CAAC;MACN;IACJ;IACA,IAAI,CAACX,aAAa,EAAE;MAChB,MAAM,IAAIY,6BAAa,CAClB,kDAAiDnB,UAAW,GAAE,CAClE;IACL;IACA;AACR;AACA;IACQ,MAAM;MAAEoB;IAAM,CAAC,GAAGb,aAAa;IAC/B,MAAMc,WAAW,GAAGD,KAAK,CAACE,IAAI,CAACxB,IAAI,IAAIA,IAAI,CAACC,EAAE,KAAKE,MAAM,CAAC;IAE1D,IAAIoB,WAAW,IAAIA,WAAW,CAACE,iBAAiB,EAAE;MAC9C,MAAM,IAAIjB,cAAW,CAChB,kEAAiE,EAClE,mBAAmB,EACnB;QACIR,IAAI,EAAEuB,WAAW;QACjBpB,MAAM,EAAEA;MACZ,CAAC,CACJ;IACL;EACJ,CAAC,CAAC;AACN,CAAC;AAAC"}
|
@@ -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.validateComment = void 0;
|
9
|
-
|
10
8
|
var _error = _interopRequireDefault(require("@webiny/error"));
|
11
|
-
|
12
9
|
var _utils = require("@webiny/utils");
|
13
|
-
|
14
10
|
const validateComment = ({
|
15
11
|
apw
|
16
12
|
}) => {
|
@@ -23,12 +19,9 @@ const validateComment = ({
|
|
23
19
|
/**
|
24
20
|
* We need changeRequest to be in a particular format i.e. "contentReviewUniqueId#version"
|
25
21
|
*/
|
26
|
-
|
27
22
|
let result;
|
28
|
-
|
29
23
|
try {
|
30
24
|
result = (0, _utils.parseIdentifier)(changeRequestId);
|
31
|
-
|
32
25
|
if (!result) {
|
33
26
|
throw new _error.default("Could not parse changeRequestId.", "MALFORMED_CHANGE_REQUEST_ID", {
|
34
27
|
changeRequestId
|
@@ -39,19 +32,15 @@ const validateComment = ({
|
|
39
32
|
input
|
40
33
|
});
|
41
34
|
}
|
35
|
+
|
42
36
|
/**
|
43
37
|
* Assign value for "step" field from "changeRequest".
|
44
38
|
*/
|
45
|
-
|
46
|
-
|
47
39
|
const changeRequest = await apw.changeRequest.get(changeRequestId);
|
48
|
-
|
49
40
|
if (!changeRequest) {
|
50
41
|
return;
|
51
42
|
}
|
52
|
-
|
53
43
|
input.step = changeRequest.step;
|
54
44
|
});
|
55
45
|
};
|
56
|
-
|
57
46
|
exports.validateComment = validateComment;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["validateComment","apw","comment","onCommentBeforeCreate","subscribe","input","changeRequest","changeRequestId","result","parseIdentifier","WebinyError","ex","get","step"],"sources":["validateComment.ts"],"sourcesContent":["import WebinyError from \"@webiny/error\";\nimport { LifeCycleHookCallbackParams } from \"~/types\";\nimport { parseIdentifier, ParseIdentifierResult } from \"@webiny/utils\";\n\nexport const validateComment = ({ apw }: Pick<LifeCycleHookCallbackParams, \"apw\">) => {\n apw.comment.onCommentBeforeCreate.subscribe(async ({ input }) => {\n const { changeRequest: changeRequestId } = input;\n /**\n * We need changeRequest to be in a particular format i.e. \"contentReviewUniqueId#version\"\n */\n let result: ParseIdentifierResult;\n try {\n result = parseIdentifier(changeRequestId);\n if (!result) {\n throw new WebinyError(\n \"Could not parse changeRequestId.\",\n \"MALFORMED_CHANGE_REQUEST_ID\",\n {\n changeRequestId\n }\n );\n }\n } catch (ex) {\n throw new WebinyError(\n `The\"changeRequest\" property in input is not properly formatted.`,\n \"MALFORMED_CHANGE_REQUEST_ID\",\n {\n input\n }\n );\n }\n\n /**\n * Assign value for \"step\" field from \"changeRequest\".\n */\n const changeRequest = await apw.changeRequest.get(changeRequestId);\n if (!changeRequest) {\n return;\n }\n input.step = changeRequest.step;\n });\n};\n"],"mappings":"
|
1
|
+
{"version":3,"names":["validateComment","apw","comment","onCommentBeforeCreate","subscribe","input","changeRequest","changeRequestId","result","parseIdentifier","WebinyError","ex","get","step"],"sources":["validateComment.ts"],"sourcesContent":["import WebinyError from \"@webiny/error\";\nimport { LifeCycleHookCallbackParams } from \"~/types\";\nimport { parseIdentifier, ParseIdentifierResult } from \"@webiny/utils\";\n\nexport const validateComment = ({ apw }: Pick<LifeCycleHookCallbackParams, \"apw\">) => {\n apw.comment.onCommentBeforeCreate.subscribe(async ({ input }) => {\n const { changeRequest: changeRequestId } = input;\n /**\n * We need changeRequest to be in a particular format i.e. \"contentReviewUniqueId#version\"\n */\n let result: ParseIdentifierResult;\n try {\n result = parseIdentifier(changeRequestId);\n if (!result) {\n throw new WebinyError(\n \"Could not parse changeRequestId.\",\n \"MALFORMED_CHANGE_REQUEST_ID\",\n {\n changeRequestId\n }\n );\n }\n } catch (ex) {\n throw new WebinyError(\n `The\"changeRequest\" property in input is not properly formatted.`,\n \"MALFORMED_CHANGE_REQUEST_ID\",\n {\n input\n }\n );\n }\n\n /**\n * Assign value for \"step\" field from \"changeRequest\".\n */\n const changeRequest = await apw.changeRequest.get(changeRequestId);\n if (!changeRequest) {\n return;\n }\n input.step = changeRequest.step;\n });\n};\n"],"mappings":";;;;;;;AAAA;AAEA;AAEO,MAAMA,eAAe,GAAG,CAAC;EAAEC;AAA8C,CAAC,KAAK;EAClFA,GAAG,CAACC,OAAO,CAACC,qBAAqB,CAACC,SAAS,CAAC,OAAO;IAAEC;EAAM,CAAC,KAAK;IAC7D,MAAM;MAAEC,aAAa,EAAEC;IAAgB,CAAC,GAAGF,KAAK;IAChD;AACR;AACA;IACQ,IAAIG,MAA6B;IACjC,IAAI;MACAA,MAAM,GAAG,IAAAC,sBAAe,EAACF,eAAe,CAAC;MACzC,IAAI,CAACC,MAAM,EAAE;QACT,MAAM,IAAIE,cAAW,CACjB,kCAAkC,EAClC,6BAA6B,EAC7B;UACIH;QACJ,CAAC,CACJ;MACL;IACJ,CAAC,CAAC,OAAOI,EAAE,EAAE;MACT,MAAM,IAAID,cAAW,CAChB,iEAAgE,EACjE,6BAA6B,EAC7B;QACIL;MACJ,CAAC,CACJ;IACL;;IAEA;AACR;AACA;IACQ,MAAMC,aAAa,GAAG,MAAML,GAAG,CAACK,aAAa,CAACM,GAAG,CAACL,eAAe,CAAC;IAClE,IAAI,CAACD,aAAa,EAAE;MAChB;IACJ;IACAD,KAAK,CAACQ,IAAI,GAAGP,aAAa,CAACO,IAAI;EACnC,CAAC,CAAC;AACN,CAAC;AAAC"}
|
@@ -1,14 +1,11 @@
|
|
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.validateContentReview = void 0;
|
9
|
-
|
10
8
|
var _error = _interopRequireDefault(require("@webiny/error"));
|
11
|
-
|
12
9
|
const validateContentReview = ({
|
13
10
|
apw
|
14
11
|
}) => {
|
@@ -21,11 +18,9 @@ const validateContentReview = ({
|
|
21
18
|
/**
|
22
19
|
* Check whether a contentReview already exists for provided content.
|
23
20
|
*/
|
24
|
-
|
25
21
|
const {
|
26
22
|
contentReviewId
|
27
23
|
} = await apw.contentReview.isReviewRequired(content);
|
28
|
-
|
29
24
|
if (contentReviewId) {
|
30
25
|
throw new _error.default(`A peer review for this content has been already requested.`, "REVIEW_ALREADY_EXIST", {
|
31
26
|
contentReviewId,
|
@@ -34,5 +29,4 @@ const validateContentReview = ({
|
|
34
29
|
}
|
35
30
|
});
|
36
31
|
};
|
37
|
-
|
38
32
|
exports.validateContentReview = validateContentReview;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["validateContentReview","apw","contentReview","onContentReviewBeforeCreate","subscribe","input","content","contentReviewId","isReviewRequired","WebinyError"],"sources":["validateContentReview.ts"],"sourcesContent":["import WebinyError from \"@webiny/error\";\nimport { LifeCycleHookCallbackParams } from \"~/types\";\n\nexport const validateContentReview = ({ apw }: Pick<LifeCycleHookCallbackParams, \"apw\">) => {\n apw.contentReview.onContentReviewBeforeCreate.subscribe(async ({ input }) => {\n const { content } = input;\n /**\n * Check whether a contentReview already exists for provided content.\n */\n const { contentReviewId } = await apw.contentReview.isReviewRequired(content);\n if (contentReviewId) {\n throw new WebinyError(\n `A peer review for this content has been already requested.`,\n \"REVIEW_ALREADY_EXIST\",\n {\n contentReviewId,\n content\n }\n );\n }\n });\n};\n"],"mappings":"
|
1
|
+
{"version":3,"names":["validateContentReview","apw","contentReview","onContentReviewBeforeCreate","subscribe","input","content","contentReviewId","isReviewRequired","WebinyError"],"sources":["validateContentReview.ts"],"sourcesContent":["import WebinyError from \"@webiny/error\";\nimport { LifeCycleHookCallbackParams } from \"~/types\";\n\nexport const validateContentReview = ({ apw }: Pick<LifeCycleHookCallbackParams, \"apw\">) => {\n apw.contentReview.onContentReviewBeforeCreate.subscribe(async ({ input }) => {\n const { content } = input;\n /**\n * Check whether a contentReview already exists for provided content.\n */\n const { contentReviewId } = await apw.contentReview.isReviewRequired(content);\n if (contentReviewId) {\n throw new WebinyError(\n `A peer review for this content has been already requested.`,\n \"REVIEW_ALREADY_EXIST\",\n {\n contentReviewId,\n content\n }\n );\n }\n });\n};\n"],"mappings":";;;;;;;AAAA;AAGO,MAAMA,qBAAqB,GAAG,CAAC;EAAEC;AAA8C,CAAC,KAAK;EACxFA,GAAG,CAACC,aAAa,CAACC,2BAA2B,CAACC,SAAS,CAAC,OAAO;IAAEC;EAAM,CAAC,KAAK;IACzE,MAAM;MAAEC;IAAQ,CAAC,GAAGD,KAAK;IACzB;AACR;AACA;IACQ,MAAM;MAAEE;IAAgB,CAAC,GAAG,MAAMN,GAAG,CAACC,aAAa,CAACM,gBAAgB,CAACF,OAAO,CAAC;IAC7E,IAAIC,eAAe,EAAE;MACjB,MAAM,IAAIE,cAAW,CAChB,4DAA2D,EAC5D,sBAAsB,EACtB;QACIF,eAAe;QACfD;MACJ,CAAC,CACJ;IACL;EACJ,CAAC,CAAC;AACN,CAAC;AAAC"}
|
@@ -1,51 +1,36 @@
|
|
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.PageApwSettingsGetterPlugin = void 0;
|
9
|
-
|
10
8
|
var _ContentApwSettingsPlugin = require("../../ContentApwSettingsPlugin");
|
11
|
-
|
12
9
|
var _types = require("../../types");
|
13
|
-
|
14
10
|
var _set = _interopRequireDefault(require("lodash/set"));
|
15
|
-
|
16
11
|
class PageApwSettingsGetterPlugin extends _ContentApwSettingsPlugin.ContentApwSettingsPlugin {
|
17
12
|
canUse(type) {
|
18
13
|
return type === _types.ApwContentTypes.PAGE;
|
19
14
|
}
|
20
|
-
|
21
15
|
setWorkflowId(page, id) {
|
22
16
|
page.settings = (0, _set.default)(page.settings || {}, "apw.workflowId", id);
|
23
17
|
}
|
24
|
-
|
25
18
|
getWorkflowId(page) {
|
26
19
|
var _page$settings$apw;
|
27
|
-
|
28
20
|
if (!page.settings) {
|
29
21
|
return null;
|
30
22
|
}
|
31
|
-
|
32
23
|
return ((_page$settings$apw = page.settings.apw) === null || _page$settings$apw === void 0 ? void 0 : _page$settings$apw.workflowId) || null;
|
33
24
|
}
|
34
|
-
|
35
25
|
setContentReviewId(page, id) {
|
36
26
|
page.settings = (0, _set.default)(page.settings || {}, "apw.contentReviewId", id);
|
37
27
|
}
|
38
|
-
|
39
28
|
getContentReviewId(page) {
|
40
29
|
var _page$settings$apw2;
|
41
|
-
|
42
30
|
if (!page.settings) {
|
43
31
|
return null;
|
44
32
|
}
|
45
|
-
|
46
33
|
return (_page$settings$apw2 = page.settings.apw) === null || _page$settings$apw2 === void 0 ? void 0 : _page$settings$apw2.contentReviewId;
|
47
34
|
}
|
48
|
-
|
49
35
|
}
|
50
|
-
|
51
36
|
exports.PageApwSettingsGetterPlugin = PageApwSettingsGetterPlugin;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["PageApwSettingsGetterPlugin","ContentApwSettingsPlugin","canUse","type","ApwContentTypes","PAGE","setWorkflowId","page","id","settings","set","getWorkflowId","apw","workflowId","setContentReviewId","getContentReviewId","contentReviewId"],"sources":["PageApwSettingsGetterPlugin.ts"],"sourcesContent":["import { ContentApwSettingsPlugin } from \"~/ContentApwSettingsPlugin\";\nimport { ApwContentTypes, PageWithWorkflow } from \"~/types\";\nimport set from \"lodash/set\";\n\nexport class PageApwSettingsGetterPlugin extends ContentApwSettingsPlugin {\n public override canUse(type: ApwContentTypes): boolean {\n return type === ApwContentTypes.PAGE;\n }\n\n public override setWorkflowId(page: PageWithWorkflow, id: string | null) {\n page.settings = set(page.settings || {}, \"apw.workflowId\", id);\n }\n\n public override getWorkflowId(page: PageWithWorkflow): string | null {\n if (!page.settings) {\n return null;\n }\n return page.settings.apw?.workflowId || null;\n }\n\n public override setContentReviewId(page: PageWithWorkflow, id: string | null) {\n page.settings = set(page.settings || {}, \"apw.contentReviewId\", id);\n }\n\n public override getContentReviewId(page: PageWithWorkflow): string | null {\n if (!page.settings) {\n return null;\n }\n return page.settings.apw?.contentReviewId;\n }\n}\n"],"mappings":"
|
1
|
+
{"version":3,"names":["PageApwSettingsGetterPlugin","ContentApwSettingsPlugin","canUse","type","ApwContentTypes","PAGE","setWorkflowId","page","id","settings","set","getWorkflowId","apw","workflowId","setContentReviewId","getContentReviewId","contentReviewId"],"sources":["PageApwSettingsGetterPlugin.ts"],"sourcesContent":["import { ContentApwSettingsPlugin } from \"~/ContentApwSettingsPlugin\";\nimport { ApwContentTypes, PageWithWorkflow } from \"~/types\";\nimport set from \"lodash/set\";\n\nexport class PageApwSettingsGetterPlugin extends ContentApwSettingsPlugin {\n public override canUse(type: ApwContentTypes): boolean {\n return type === ApwContentTypes.PAGE;\n }\n\n public override setWorkflowId(page: PageWithWorkflow, id: string | null) {\n page.settings = set(page.settings || {}, \"apw.workflowId\", id);\n }\n\n public override getWorkflowId(page: PageWithWorkflow): string | null {\n if (!page.settings) {\n return null;\n }\n return page.settings.apw?.workflowId || null;\n }\n\n public override setContentReviewId(page: PageWithWorkflow, id: string | null) {\n page.settings = set(page.settings || {}, \"apw.contentReviewId\", id);\n }\n\n public override getContentReviewId(page: PageWithWorkflow): string | null {\n if (!page.settings) {\n return null;\n }\n return page.settings.apw?.contentReviewId;\n }\n}\n"],"mappings":";;;;;;;AAAA;AACA;AACA;AAEO,MAAMA,2BAA2B,SAASC,kDAAwB,CAAC;EACtDC,MAAM,CAACC,IAAqB,EAAW;IACnD,OAAOA,IAAI,KAAKC,sBAAe,CAACC,IAAI;EACxC;EAEgBC,aAAa,CAACC,IAAsB,EAAEC,EAAiB,EAAE;IACrED,IAAI,CAACE,QAAQ,GAAG,IAAAC,YAAG,EAACH,IAAI,CAACE,QAAQ,IAAI,CAAC,CAAC,EAAE,gBAAgB,EAAED,EAAE,CAAC;EAClE;EAEgBG,aAAa,CAACJ,IAAsB,EAAiB;IAAA;IACjE,IAAI,CAACA,IAAI,CAACE,QAAQ,EAAE;MAChB,OAAO,IAAI;IACf;IACA,OAAO,uBAAAF,IAAI,CAACE,QAAQ,CAACG,GAAG,uDAAjB,mBAAmBC,UAAU,KAAI,IAAI;EAChD;EAEgBC,kBAAkB,CAACP,IAAsB,EAAEC,EAAiB,EAAE;IAC1ED,IAAI,CAACE,QAAQ,GAAG,IAAAC,YAAG,EAACH,IAAI,CAACE,QAAQ,IAAI,CAAC,CAAC,EAAE,qBAAqB,EAAED,EAAE,CAAC;EACvE;EAEgBO,kBAAkB,CAACR,IAAsB,EAAiB;IAAA;IACtE,IAAI,CAACA,IAAI,CAACE,QAAQ,EAAE;MAChB,OAAO,IAAI;IACf;IACA,8BAAOF,IAAI,CAACE,QAAQ,CAACG,GAAG,wDAAjB,oBAAmBI,eAAe;EAC7C;AACJ;AAAC"}
|
@@ -4,11 +4,8 @@ Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
5
5
|
});
|
6
6
|
exports.apwContentPagePlugins = void 0;
|
7
|
-
|
8
7
|
var _api = require("@webiny/api");
|
9
|
-
|
10
8
|
var _types = require("../../types");
|
11
|
-
|
12
9
|
const apwContentPagePlugins = () => new _api.ContextPlugin(async context => {
|
13
10
|
const {
|
14
11
|
apw,
|
@@ -26,5 +23,4 @@ const apwContentPagePlugins = () => new _api.ContextPlugin(async context => {
|
|
26
23
|
return true;
|
27
24
|
});
|
28
25
|
});
|
29
|
-
|
30
26
|
exports.apwContentPagePlugins = apwContentPagePlugins;
|
@@ -1 +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":"
|
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,kBAAa,CAAa,MAAMC,OAAO,IAAI;EAC3C,MAAM;IAAEC,GAAG;IAAEC;EAAY,CAAC,GAAGF,OAAO;EAEpCC,GAAG,CAACE,gBAAgB,CAACC,sBAAe,CAACC,IAAI,EAAE,MAAMC,EAAE,IAAI;IACnD,OAAOJ,WAAW,CAACK,OAAO,CAAmBD,EAAE,CAAC;EACpD,CAAC,CAAC;EAEFL,GAAG,CAACO,mBAAmB,CAACJ,sBAAe,CAACC,IAAI,EAAE,MAAMC,EAAE,IAAI;IACtD,MAAMJ,WAAW,CAACO,WAAW,CAAmBH,EAAE,CAAC;IACnD,OAAO,IAAI;EACf,CAAC,CAAC;EAEFL,GAAG,CAACS,qBAAqB,CAACN,sBAAe,CAACC,IAAI,EAAE,MAAMC,EAAE,IAAI;IACxD,MAAMJ,WAAW,CAACS,aAAa,CAAmBL,EAAE,CAAC;IACrD,OAAO,IAAI;EACf,CAAC,CAAC;AACN,CAAC,CAAC;AAAC"}
|
@@ -4,13 +4,9 @@ Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
5
5
|
});
|
6
6
|
exports.extendPbPageSettingsSchema = void 0;
|
7
|
-
|
8
7
|
var _plugins = require("@webiny/handler-graphql/plugins");
|
9
|
-
|
10
8
|
const extendPbPageSettingsSchema = () => new _plugins.GraphQLSchemaPlugin({
|
11
|
-
typeDefs:
|
12
|
-
/* GraphQL */
|
13
|
-
`
|
9
|
+
typeDefs: /* GraphQL */`
|
14
10
|
type PbApwPageSettings {
|
15
11
|
workflowId: ID
|
16
12
|
contentReviewId: ID
|
@@ -21,5 +17,4 @@ const extendPbPageSettingsSchema = () => new _plugins.GraphQLSchemaPlugin({
|
|
21
17
|
}
|
22
18
|
`
|
23
19
|
});
|
24
|
-
|
25
20
|
exports.extendPbPageSettingsSchema = extendPbPageSettingsSchema;
|
@@ -1 +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":"
|
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,4BAAmB,CAAa;EAChCC,QAAQ,EAAE,aAAe;AACjC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACI,CAAC,CAAC;AAAC"}
|
@@ -4,25 +4,15 @@ Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
5
5
|
});
|
6
6
|
exports.apwPageBuilderHooks = void 0;
|
7
|
-
|
8
7
|
var _triggerContentReview = require("./triggerContentReview");
|
9
|
-
|
10
8
|
var _linkContentReviewToPage = require("./linkContentReviewToPage");
|
11
|
-
|
12
9
|
var _updateContentReviewStatus = require("./updateContentReviewStatus");
|
13
|
-
|
14
10
|
var _linkWorkflowToPage = require("./linkWorkflowToPage");
|
15
|
-
|
16
11
|
var _PageApwSettingsGetterPlugin = require("./PageApwSettingsGetterPlugin");
|
17
|
-
|
18
12
|
var _commentNotification = require("./notifications/commentNotification");
|
19
|
-
|
20
13
|
var _contentUrl = require("./notifications/contentUrl");
|
21
|
-
|
22
14
|
var _changeRequestNotification = require("./notifications/changeRequestNotification");
|
23
|
-
|
24
15
|
var _contentReviewNotification = require("./notifications/contentReviewNotification");
|
25
|
-
|
26
16
|
const apwPageBuilderHooks = params => {
|
27
17
|
const {
|
28
18
|
pageBuilder,
|
@@ -49,5 +39,4 @@ const apwPageBuilderHooks = params => {
|
|
49
39
|
pageBuilder
|
50
40
|
});
|
51
41
|
};
|
52
|
-
|
53
42
|
exports.apwPageBuilderHooks = apwPageBuilderHooks;
|
@@ -1 +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":"
|
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,MAAmC,IAAK;EACxE,MAAM;IAAEC,WAAW;IAAEC,GAAG;IAAEC,QAAQ;IAAEC;EAAQ,CAAC,GAAGJ,MAAM;EAEtDI,OAAO,CAACC,QAAQ,CAAC,CACb,IAAIC,wDAA2B,EAAE,EACjC,IAAAC,8CAAyB,GAAE,EAC3B,IAAAC,0DAA+B,GAAE,EACjC,IAAAC,kCAAsB,GAAE,EACxB,IAAAC,0DAA+B,GAAE,CACpC,CAAC;EAEF,IAAAC,0CAAoB,EAAC;IACjBT,GAAG;IACHD;EACJ,CAAC,CAAC;EACF,IAAAW,gDAAuB,EAAC;IACpBV,GAAG;IACHD;EACJ,CAAC,CAAC;EACF,IAAAY,oDAAyB,EAAC;IACtBX,GAAG;IACHD,WAAW;IACXE;EACJ,CAAC,CAAC;EACF,IAAAW,sCAAkB,EAAC;IACfZ,GAAG;IACHD;EACJ,CAAC,CAAC;AACN,CAAC;AAAC"}
|
@@ -1,20 +1,14 @@
|
|
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.linkContentReviewToPage = void 0;
|
9
|
-
|
10
8
|
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
|
11
|
-
|
12
9
|
var _error = _interopRequireDefault(require("@webiny/error"));
|
13
|
-
|
14
10
|
var _types = require("../../types");
|
15
|
-
|
16
11
|
var _utils = require("./utils");
|
17
|
-
|
18
12
|
const linkContentReviewToPage = params => {
|
19
13
|
const {
|
20
14
|
apw,
|
@@ -26,11 +20,9 @@ const linkContentReviewToPage = params => {
|
|
26
20
|
const {
|
27
21
|
content
|
28
22
|
} = contentReview;
|
29
|
-
|
30
23
|
if (content.type !== _types.ApwContentTypes.PAGE) {
|
31
24
|
return;
|
32
25
|
}
|
33
|
-
|
34
26
|
await (0, _utils.updatePageSettings)({
|
35
27
|
getPage: pageBuilder.getPage,
|
36
28
|
updatePage: pageBuilder.updatePage,
|
@@ -50,11 +42,9 @@ const linkContentReviewToPage = params => {
|
|
50
42
|
const {
|
51
43
|
content
|
52
44
|
} = contentReview;
|
53
|
-
|
54
45
|
if (content.type !== _types.ApwContentTypes.PAGE) {
|
55
46
|
return;
|
56
47
|
}
|
57
|
-
|
58
48
|
await (0, _utils.updatePageSettings)({
|
59
49
|
getPage: pageBuilder.getPage,
|
60
50
|
updatePage: pageBuilder.updatePage,
|
@@ -72,15 +62,11 @@ const linkContentReviewToPage = params => {
|
|
72
62
|
page
|
73
63
|
}) => {
|
74
64
|
var _page$settings, _page$settings$apw;
|
75
|
-
|
76
65
|
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
66
|
if (!contentReviewId) {
|
79
67
|
return;
|
80
68
|
}
|
81
|
-
|
82
69
|
let contentReview;
|
83
|
-
|
84
70
|
try {
|
85
71
|
contentReview = await apw.contentReview.get(contentReviewId);
|
86
72
|
} catch (ex) {
|
@@ -92,7 +78,6 @@ const linkContentReviewToPage = params => {
|
|
92
78
|
throw ex;
|
93
79
|
}
|
94
80
|
}
|
95
|
-
|
96
81
|
if (contentReview) {
|
97
82
|
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
83
|
contentReviewId,
|
@@ -101,5 +86,4 @@ const linkContentReviewToPage = params => {
|
|
101
86
|
}
|
102
87
|
});
|
103
88
|
};
|
104
|
-
|
105
89
|
exports.linkContentReviewToPage = linkContentReviewToPage;
|
@@ -1 +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":"
|
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,MAAqC,IAAK;EAC9E,MAAM;IAAEC,GAAG;IAAEC;EAAY,CAAC,GAAGF,MAAM;EAEnCC,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,IAAI,EAAE;MACvC;IACJ;IACA,MAAM,IAAAC,yBAAkB,EAAC;MACrBC,OAAO,EAAET,WAAW,CAACS,OAAO;MAC5BC,UAAU,EAAEV,WAAW,CAACU,UAAU;MAClCC,YAAY,EAAEP,OAAO,CAACQ,EAAE;MACxBC,cAAc,EAAEC,QAAQ,IAAI;QACxB,m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4BAA4B,EAC5B;QACIP,eAAe;QACfG;MACJ,CAAC,CACJ;IACL;EACJ,CAAC,CAAC;AACN,CAAC;AAAC"}
|
@@ -1,20 +1,14 @@
|
|
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.linkWorkflowToPage = void 0;
|
9
|
-
|
10
8
|
var _get = _interopRequireDefault(require("lodash/get"));
|
11
|
-
|
12
9
|
var _set = _interopRequireDefault(require("lodash/set"));
|
13
|
-
|
14
10
|
var _types = require("../../types");
|
15
|
-
|
16
11
|
var _utils = require("./utils");
|
17
|
-
|
18
12
|
const linkWorkflowToPage = params => {
|
19
13
|
const {
|
20
14
|
apw,
|
@@ -37,28 +31,22 @@ const linkWorkflowToPage = params => {
|
|
37
31
|
* If the previous revision(original) already had the "contentReviewId",
|
38
32
|
* we need to unlink it so that new "contentReview" can be request for the new revision.
|
39
33
|
*/
|
40
|
-
|
41
34
|
const previousContentReviewId = (0, _get.default)(original, "settings.apw.contentReviewId");
|
42
|
-
|
43
35
|
if (previousContentReviewId) {
|
44
36
|
page.settings.apw.contentReviewId = null;
|
45
37
|
}
|
38
|
+
|
46
39
|
/**
|
47
40
|
* If the previous revision(original) already had the "workflowId",
|
48
41
|
* we don't need to do anything we'll just let it be copied over.
|
49
42
|
*/
|
50
|
-
|
51
|
-
|
52
43
|
const previousWorkflowId = (0, _get.default)(original, "settings.apw.workflowId");
|
53
|
-
|
54
44
|
if (previousWorkflowId) {
|
55
45
|
return;
|
56
46
|
}
|
57
47
|
/**
|
58
48
|
* Lookup and assign "workflowId".
|
59
49
|
*/
|
60
|
-
|
61
|
-
|
62
50
|
await (0, _utils.assignWorkflowToPage)({
|
63
51
|
listWorkflow: apw.workflow.list,
|
64
52
|
page
|
@@ -76,7 +64,6 @@ const linkWorkflowToPage = params => {
|
|
76
64
|
* It can happen because we run modal validation in "onBeforePageUpdate" event,
|
77
65
|
* which doesn't have the "apw" property.
|
78
66
|
*/
|
79
|
-
|
80
67
|
if (prevApwWorkflowId && !currentApwWorkflowId) {
|
81
68
|
page.settings.apw = original.settings.apw;
|
82
69
|
}
|
@@ -84,12 +71,9 @@ const linkWorkflowToPage = params => {
|
|
84
71
|
* If there is a linked "contentReview" for this page and the page "title" has changed.
|
85
72
|
* Let's update the "title" field in "contentReview".
|
86
73
|
*/
|
87
|
-
|
88
|
-
|
89
74
|
const linkedContentReviewId = (0, _get.default)(page, "settings.apw.contentReviewId");
|
90
75
|
const prevTitle = (0, _get.default)(original, "title");
|
91
76
|
const newTitle = (0, _get.default)(page, "title");
|
92
|
-
|
93
77
|
if (linkedContentReviewId && prevTitle !== newTitle) {
|
94
78
|
await apw.contentReview.update(linkedContentReviewId, {
|
95
79
|
title: newTitle
|
@@ -99,28 +83,22 @@ const linkWorkflowToPage = params => {
|
|
99
83
|
/**
|
100
84
|
* Link created workflow to associated pages.
|
101
85
|
*/
|
102
|
-
|
103
86
|
apw.workflow.onWorkflowAfterCreate.subscribe(async ({
|
104
87
|
workflow
|
105
88
|
}) => {
|
106
89
|
const {
|
107
90
|
scope
|
108
91
|
} = workflow;
|
109
|
-
|
110
92
|
if (workflow.app !== _types.ApwWorkflowApplications.PB) {
|
111
93
|
return;
|
112
94
|
}
|
113
95
|
/**
|
114
96
|
* If the workflow has pages in it's scope, we'll link that workflow for each of those pages.
|
115
97
|
*/
|
116
|
-
|
117
|
-
|
118
98
|
if ((0, _utils.hasPages)(workflow) === false) {
|
119
99
|
return;
|
120
100
|
}
|
121
|
-
|
122
101
|
const pages = (0, _get.default)(scope, "data.pages");
|
123
|
-
|
124
102
|
for (const pid of pages) {
|
125
103
|
await (0, _utils.updatePageSettings)({
|
126
104
|
getPage: pageBuilder.getPage,
|
@@ -135,7 +113,6 @@ const linkWorkflowToPage = params => {
|
|
135
113
|
/**
|
136
114
|
* Link updated workflow to associated pages.
|
137
115
|
*/
|
138
|
-
|
139
116
|
apw.workflow.onWorkflowAfterUpdate.subscribe(async ({
|
140
117
|
workflow,
|
141
118
|
original
|
@@ -143,11 +120,9 @@ const linkWorkflowToPage = params => {
|
|
143
120
|
const {
|
144
121
|
scope
|
145
122
|
} = workflow;
|
146
|
-
|
147
123
|
if (workflow.app !== _types.ApwWorkflowApplications.PB) {
|
148
124
|
return;
|
149
125
|
}
|
150
|
-
|
151
126
|
const {
|
152
127
|
scope: prevScope
|
153
128
|
} = original;
|
@@ -155,18 +130,15 @@ const linkWorkflowToPage = params => {
|
|
155
130
|
* If the workflow has pages in it's scope and there is a change in that page list,
|
156
131
|
* we'll update the workflow link for corresponding pages.
|
157
132
|
*/
|
158
|
-
|
159
133
|
if ((0, _utils.hasPages)(workflow) === false || (0, _utils.shouldUpdatePages)(scope, prevScope) === false) {
|
160
134
|
return;
|
161
135
|
}
|
162
|
-
|
163
136
|
const previousPages = (0, _get.default)(prevScope, "data.pages", []);
|
164
137
|
const currentPages = (0, _get.default)(scope, "data.pages", []);
|
165
138
|
const {
|
166
139
|
removedPages,
|
167
140
|
addedPages
|
168
141
|
} = (0, _utils.getPagesDiff)(currentPages, previousPages);
|
169
|
-
|
170
142
|
for (const pid of addedPages) {
|
171
143
|
await (0, _utils.updatePageSettings)({
|
172
144
|
getPage: pageBuilder.getPage,
|
@@ -177,7 +149,6 @@ const linkWorkflowToPage = params => {
|
|
177
149
|
}
|
178
150
|
});
|
179
151
|
}
|
180
|
-
|
181
152
|
for (const pid of removedPages) {
|
182
153
|
await (0, _utils.updatePageSettings)({
|
183
154
|
getPage: pageBuilder.getPage,
|
@@ -190,5 +161,4 @@ const linkWorkflowToPage = params => {
|
|
190
161
|
}
|
191
162
|
});
|
192
163
|
};
|
193
|
-
|
194
164
|
exports.linkWorkflowToPage = linkWorkflowToPage;
|
@@ -1 +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":";;;;;;;;;AAAA;;AACA;;AACA;;AAOA;;AAcO,MAAMA,kBAAkB,GAAIC,MAAD,IAAsC;EACpE,MAAM;IAAEC,GAAF;IAAOC;EAAP,IAAuBF,MAA7B;EAEAE,WAAW,CAACC,kBAAZ,CAA+BC,SAA/B,CAA2E,OAAO;IAAEC;EAAF,CAAP,KAAoB;IAC3F,MAAM,IAAAC,2BAAA,EAAqB;MAAEC,YAAY,EAAEN,GAAG,CAACO,QAAJ,CAAaC,IAA7B;MAAmCJ;IAAnC,CAArB,CAAN;EACH,CAFD;EAGAH,WAAW,CAACQ,sBAAZ,CAAmCN,SAAnC,CACI,MAAMJ,MAAN,IAAgB;IACZ,MAAM;MAAEK,IAAF;MAAQM;IAAR,IAAqBX,MAA3B;IACA;AACZ;AACA;AACA;;IACY,MAAMY,uBAAuB,GAAG,IAAAC,YAAA,EAAIF,QAAJ,EAAc,8BAAd,CAAhC;;IACA,IAAIC,uBAAJ,EAA6B;MACzBP,IAAI,CAACS,QAAL,CAAcb,GAAd,CAAkBc,eAAlB,GAAoC,IAApC;IACH;IAED;AACZ;AACA;AACA;;;IACY,MAAMC,kBAAkB,GAAG,IAAAH,YAAA,EAAIF,QAAJ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AAJ,EAAW,YAAX,EAAyB,EAAzB,CAArB;IAEA,MAAM;MAAEmB,YAAF;MAAgBC;IAAhB,IAA+B,IAAAC,mBAAA,EAAaH,YAAb,EAA2BD,aAA3B,CAArC;;IACA,KAAK,MAAMX,GAAX,IAAkBc,UAAlB,EAA8B;MAC1B,MAAM,IAAAb,yBAAA,EAAmB;QACrBC,OAAO,EAAEjC,WAAW,CAACiC,OADA;QAErBC,UAAU,EAAElC,WAAW,CAACkC,UAFH;QAGrBC,YAAY,EAAEJ,GAHO;QAIrBK,cAAc,EAAExB,QAAQ,IAAI;UACxB,OAAO,IAAAyB,YAAA,EAAIzB,QAAJ,EAAc,gBAAd,EAAgCN,QAAQ,CAACgC,EAAzC,CAAP;QACH;MANoB,CAAnB,CAAN;IAQH;;IACD,KAAK,MAAMP,GAAX,IAAkBa,YAAlB,EAAgC;MAC5B,MAAM,IAAAZ,yBAAA,EAAmB;QACrBC,OAAO,EAAEjC,WAAW,CAACiC,OADA;QAErBC,UAAU,EAAElC,WAAW,CAACkC,UAFH;QAGrBC,YAAY,EAAEJ,GAHO;QAIrBK,cAAc,EAAExB,QAAQ,IAAI;UACxB,OAAO,IAAAyB,YAAA,EAAIzB,QAAJ,EAAc,gBAAd,EAAgC,IAAhC,CAAP;QACH;MANoB,CAAnB,CAAN;IAQH;EACJ,CAtCD;AAuCH,CA7HM"}
|
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":";;;;;;;AAAA;AACA;AACA;AAOA;AAcO,MAAMA,kBAAkB,GAAIC,MAAgC,IAAK;EACpE,MAAM;IAAEC,GAAG;IAAEC;EAAY,CAAC,GAAGF,MAAM;EAEnCE,WAAW,CAACC,kBAAkB,CAACC,SAAS,CAAmC,OAAO;IAAEC;EAAK,CAAC,KAAK;IAC3F,MAAM,IAAAC,2BAAoB,EAAC;MAAEC,YAAY,EAAEN,GAAG,CAACO,QAAQ,CAACC,IAAI;MAAEJ;IAAK,CAAC,CAAC;EACzE,CAAC,CAAC;EACFH,WAAW,CAACQ,sBAAsB,CAACN,SAAS,CACxC,MAAMJ,MAAM,IAAI;IACZ,MAAM;MAAEK,IAAI;MAAEM;IAAS,CAAC,GAAGX,MAAM;IACjC;AACZ;AACA;AACA;IACY,MAAMY,uBAAuB,GAAG,IAAAC,YAAG,EAACF,QAAQ,EAAE,8BAA8B,CAAC;IAC7E,IAAIC,uBAAuB,EAAE;MACzBP,IAAI,CAACS,QAAQ,CAACb,GAAG,CAACc,eAAe,GAAG,IAAI;IAC5C;;IAEA;AACZ;AACA;AACA;IACY,MAAMC,kBAAkB,GAAG,IAAAH,YAAG,EAACF,QAAQ,EAAE,yBAAyB,CAAC;IACnE,IAAIK,kBAAkB,EAAE;MACpB;IACJ;IACA;AACZ;AACA;IACY,MAAM,IAAAV,2BAAoB,EAAC;MAAEC,YAAY,EAAEN,GAAG,CAACO,QAAQ,CAACC,IAAI;MAAEJ;IAAK,CAAC,CAAC;EACzE,CAAC,CACJ;EACDH,WAAW,CAACe,kBAAkB,CAACb,SAAS,CAAmC,MAAMJ,MAAM,IAAI;IACvF,MAAM;MAAEK,IAAI;MAAEM;IAAS,CAAC,GAAGX,MAAM;IACjC,M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