@webiny/api-apw 0.0.0-unstable.13771d80a8 → 0.0.0-unstable.2696f9d9e8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/ApwChangeRequestNotification.js +4 -6
- package/ApwChangeRequestNotification.js.map +1 -1
- package/ApwCommentNotification.js +4 -6
- package/ApwCommentNotification.js.map +1 -1
- package/ApwContentReviewNotification.js +4 -6
- package/ApwContentReviewNotification.js.map +1 -1
- package/ApwContentUrlPlugin.js +4 -6
- package/ApwContentUrlPlugin.js.map +1 -1
- package/ContentApwSettingsPlugin.js +5 -4
- package/ContentApwSettingsPlugin.js.map +1 -1
- package/README.md +3 -3
- package/crud/createChangeRequestMethods.js +3 -1
- package/crud/createChangeRequestMethods.js.map +1 -1
- package/crud/createCommentMethods.js +3 -1
- package/crud/createCommentMethods.js.map +1 -1
- package/crud/createContentReviewMethods.js +56 -30
- package/crud/createContentReviewMethods.js.map +1 -1
- package/crud/createReviewerMethods.js +3 -1
- package/crud/createReviewerMethods.js.map +1 -1
- package/crud/createWorkflowMethods.js +3 -1
- package/crud/createWorkflowMethods.js.map +1 -1
- package/crud/index.js +6 -5
- package/crud/index.js.map +1 -1
- package/crud/utils.js +7 -6
- package/crud/utils.js.map +1 -1
- package/index.d.ts +1 -1
- package/index.js +3 -1
- package/index.js.map +1 -1
- package/package.json +39 -46
- package/plugins/cms/CmsEntryApwSettingsGetterPlugin.js +5 -5
- package/plugins/cms/CmsEntryApwSettingsGetterPlugin.js.map +1 -1
- package/plugins/cms/apwEntryPlugins.js +9 -6
- package/plugins/cms/apwEntryPlugins.js.map +1 -1
- package/plugins/cms/index.js +3 -1
- package/plugins/cms/index.js.map +1 -1
- package/plugins/cms/linkContentReviewToEntry.js +5 -4
- package/plugins/cms/linkContentReviewToEntry.js.map +1 -1
- package/plugins/cms/linkWorkflowToEntry.js +16 -15
- package/plugins/cms/linkWorkflowToEntry.js.map +1 -1
- package/plugins/cms/notifications/changeRequestNotification.js +3 -1
- package/plugins/cms/notifications/changeRequestNotification.js.map +1 -1
- package/plugins/cms/notifications/commentNotification.js +3 -1
- package/plugins/cms/notifications/commentNotification.js.map +1 -1
- package/plugins/cms/notifications/contentReviewNotification.js +3 -1
- package/plugins/cms/notifications/contentReviewNotification.js.map +1 -1
- package/plugins/cms/notifications/contentUrl.js +3 -1
- package/plugins/cms/notifications/contentUrl.js.map +1 -1
- package/plugins/cms/triggerContentReview.js +6 -5
- package/plugins/cms/triggerContentReview.js.map +1 -1
- package/plugins/cms/updateContentReviewStatus.js +15 -13
- package/plugins/cms/updateContentReviewStatus.js.map +1 -1
- package/plugins/cms/utils.d.ts +3 -2
- package/plugins/cms/utils.js +22 -14
- package/plugins/cms/utils.js.map +1 -1
- package/plugins/context.js +3 -1
- package/plugins/context.js.map +1 -1
- package/plugins/graphql/changeRequest.gql.js +16 -12
- package/plugins/graphql/changeRequest.gql.js.map +1 -1
- package/plugins/graphql/comment.gql.js +41 -35
- package/plugins/graphql/comment.gql.js.map +1 -1
- package/plugins/graphql/contentReview.gql.js +23 -13
- package/plugins/graphql/contentReview.gql.js.map +1 -1
- package/plugins/graphql/reviewer.gql.js +15 -12
- package/plugins/graphql/reviewer.gql.js.map +1 -1
- package/plugins/graphql/utils.d.ts +2 -0
- package/plugins/graphql/utils.js +12 -0
- package/plugins/graphql/utils.js.map +1 -0
- package/plugins/graphql/workflow.gql.js +15 -12
- package/plugins/graphql/workflow.gql.js.map +1 -1
- package/plugins/graphql.js +3 -1
- package/plugins/graphql.js.map +1 -1
- package/plugins/hooks/createReviewerFromIdentity.js +4 -2
- package/plugins/hooks/createReviewerFromIdentity.js.map +1 -1
- package/plugins/hooks/deleteChangeRequestsAfterContentReview.js +3 -1
- package/plugins/hooks/deleteChangeRequestsAfterContentReview.js.map +1 -1
- package/plugins/hooks/deleteCommentsAfterChangeRequest.js +3 -1
- package/plugins/hooks/deleteCommentsAfterChangeRequest.js.map +1 -1
- package/plugins/hooks/index.js +3 -1
- package/plugins/hooks/index.js.map +1 -1
- package/plugins/hooks/initializeContentReviewSteps.js +6 -4
- package/plugins/hooks/initializeContentReviewSteps.js.map +1 -1
- package/plugins/hooks/initializeNotifications.js +3 -1
- package/plugins/hooks/initializeNotifications.js.map +1 -1
- package/plugins/hooks/listContentReviews.js +4 -2
- package/plugins/hooks/listContentReviews.js.map +1 -1
- package/plugins/hooks/notifications/appUrl.js +3 -1
- package/plugins/hooks/notifications/appUrl.js.map +1 -1
- package/plugins/hooks/notifications/changeRequestAfterCreate.js +6 -9
- package/plugins/hooks/notifications/changeRequestAfterCreate.js.map +1 -1
- package/plugins/hooks/notifications/changeRequestUrl.js +3 -1
- package/plugins/hooks/notifications/changeRequestUrl.js.map +1 -1
- package/plugins/hooks/notifications/commentAfterCreate.js +6 -9
- package/plugins/hooks/notifications/commentAfterCreate.js.map +1 -1
- package/plugins/hooks/notifications/commentUrl.js +3 -1
- package/plugins/hooks/notifications/commentUrl.js.map +1 -1
- package/plugins/hooks/notifications/contentReviewAfterCreate.js +7 -10
- package/plugins/hooks/notifications/contentReviewAfterCreate.js.map +1 -1
- package/plugins/hooks/notifications/contentReviewUrl.js +3 -1
- package/plugins/hooks/notifications/contentReviewUrl.js.map +1 -1
- package/plugins/hooks/notifications/contentUrl.js +3 -1
- package/plugins/hooks/notifications/contentUrl.js.map +1 -1
- package/plugins/hooks/notifications/lastChangeRequestNotificationPlugin.js +3 -1
- package/plugins/hooks/notifications/lastChangeRequestNotificationPlugin.js.map +1 -1
- package/plugins/hooks/notifications/lastCommentNotificationPlugin.js +3 -1
- package/plugins/hooks/notifications/lastCommentNotificationPlugin.js.map +1 -1
- package/plugins/hooks/notifications/lastContentReviewNotificationPlugin.js +3 -1
- package/plugins/hooks/notifications/lastContentReviewNotificationPlugin.js.map +1 -1
- package/plugins/hooks/notifications/reviewers.js +18 -15
- package/plugins/hooks/notifications/reviewers.js.map +1 -1
- package/plugins/hooks/notifications/sendChangeRequestNotification.js +3 -1
- package/plugins/hooks/notifications/sendChangeRequestNotification.js.map +1 -1
- package/plugins/hooks/notifications/sendCommentNotification.js +3 -1
- package/plugins/hooks/notifications/sendCommentNotification.js.map +1 -1
- package/plugins/hooks/notifications/sendContentReviewNotification.js +3 -1
- package/plugins/hooks/notifications/sendContentReviewNotification.js.map +1 -1
- package/plugins/hooks/updatePendingChangeRequests.js +8 -6
- package/plugins/hooks/updatePendingChangeRequests.js.map +1 -1
- package/plugins/hooks/updateTotalComments.js +22 -15
- package/plugins/hooks/updateTotalComments.js.map +1 -1
- package/plugins/hooks/validateChangeRequest.js +3 -1
- package/plugins/hooks/validateChangeRequest.js.map +1 -1
- package/plugins/hooks/validateComment.js +3 -1
- package/plugins/hooks/validateComment.js.map +1 -1
- package/plugins/hooks/validateContentReview.js +3 -1
- package/plugins/hooks/validateContentReview.js.map +1 -1
- package/plugins/pageBuilder/PageApwSettingsGetterPlugin.js +5 -5
- package/plugins/pageBuilder/PageApwSettingsGetterPlugin.js.map +1 -1
- package/plugins/pageBuilder/apwContentPagePlugins.js +3 -1
- package/plugins/pageBuilder/apwContentPagePlugins.js.map +1 -1
- package/plugins/pageBuilder/extendPbPageSettingsSchema.js +3 -1
- package/plugins/pageBuilder/extendPbPageSettingsSchema.js.map +1 -1
- package/plugins/pageBuilder/index.js +3 -1
- package/plugins/pageBuilder/index.js.map +1 -1
- package/plugins/pageBuilder/linkContentReviewToPage.js +16 -12
- package/plugins/pageBuilder/linkContentReviewToPage.js.map +1 -1
- package/plugins/pageBuilder/linkWorkflowToPage.js +3 -1
- package/plugins/pageBuilder/linkWorkflowToPage.js.map +1 -1
- package/plugins/pageBuilder/notifications/changeRequestNotification.js +3 -1
- package/plugins/pageBuilder/notifications/changeRequestNotification.js.map +1 -1
- package/plugins/pageBuilder/notifications/commentNotification.js +3 -1
- package/plugins/pageBuilder/notifications/commentNotification.js.map +1 -1
- package/plugins/pageBuilder/notifications/contentReviewNotification.js +3 -1
- package/plugins/pageBuilder/notifications/contentReviewNotification.js.map +1 -1
- package/plugins/pageBuilder/notifications/contentUrl.js +3 -1
- package/plugins/pageBuilder/notifications/contentUrl.js.map +1 -1
- package/plugins/pageBuilder/triggerContentReview.js +3 -1
- package/plugins/pageBuilder/triggerContentReview.js.map +1 -1
- package/plugins/pageBuilder/updateContentReviewStatus.js +11 -6
- package/plugins/pageBuilder/updateContentReviewStatus.js.map +1 -1
- package/plugins/pageBuilder/utils.d.ts +2 -2
- package/plugins/pageBuilder/utils.js +3 -1
- package/plugins/pageBuilder/utils.js.map +1 -1
- package/plugins/utils.d.ts +1 -1
- package/plugins/utils.js +6 -3
- package/plugins/utils.js.map +1 -1
- package/scheduler/createScheduleActionMethods.js +44 -30
- package/scheduler/createScheduleActionMethods.js.map +1 -1
- package/scheduler/handlers/executeAction/index.d.ts +1 -1
- package/scheduler/handlers/executeAction/index.js +11 -6
- package/scheduler/handlers/executeAction/index.js.map +1 -1
- package/scheduler/handlers/executeAction/plugins/ApplicationGraphQL.js +5 -4
- package/scheduler/handlers/executeAction/plugins/ApplicationGraphQL.js.map +1 -1
- package/scheduler/handlers/executeAction/plugins/HeadlessCMSGraphQL.js +6 -7
- package/scheduler/handlers/executeAction/plugins/HeadlessCMSGraphQL.js.map +1 -1
- package/scheduler/handlers/executeAction/plugins/PageBuilderGraphQL.js +4 -7
- package/scheduler/handlers/executeAction/plugins/PageBuilderGraphQL.js.map +1 -1
- package/scheduler/handlers/executeAction/security.js +3 -1
- package/scheduler/handlers/executeAction/security.js.map +1 -1
- package/scheduler/handlers/scheduleAction/index.d.ts +1 -1
- package/scheduler/handlers/scheduleAction/index.js +21 -14
- package/scheduler/handlers/scheduleAction/index.js.map +1 -1
- package/scheduler/handlers/scheduleAction/scheduleAction.utils.js +17 -14
- package/scheduler/handlers/scheduleAction/scheduleAction.utils.js.map +1 -1
- package/scheduler/handlers/utils.d.ts +2 -3
- package/scheduler/handlers/utils.js +6 -7
- package/scheduler/handlers/utils.js.map +1 -1
- package/scheduler/index.js +3 -1
- package/scheduler/index.js.map +1 -1
- package/scheduler/types.d.ts +10 -8
- package/scheduler/types.js +14 -12
- package/scheduler/types.js.map +1 -1
- package/storageOperations/changeRequestStorageOperations.js +60 -27
- package/storageOperations/changeRequestStorageOperations.js.map +1 -1
- package/storageOperations/commentStorageOperations.js +36 -30
- package/storageOperations/commentStorageOperations.js.map +1 -1
- package/storageOperations/contentReviewStorageOperations.d.ts +1 -1
- package/storageOperations/contentReviewStorageOperations.js +35 -27
- package/storageOperations/contentReviewStorageOperations.js.map +1 -1
- package/storageOperations/index.d.ts +1 -7
- package/storageOperations/index.js +11 -16
- package/storageOperations/index.js.map +1 -1
- package/storageOperations/models/changeRequest.model.d.ts +1 -2
- package/storageOperations/models/changeRequest.model.js +7 -7
- package/storageOperations/models/changeRequest.model.js.map +1 -1
- package/storageOperations/models/comment.model.d.ts +1 -2
- package/storageOperations/models/comment.model.js +7 -7
- package/storageOperations/models/comment.model.js.map +1 -1
- package/storageOperations/models/contentReview.model.d.ts +1 -2
- package/storageOperations/models/contentReview.model.js +13 -11
- package/storageOperations/models/contentReview.model.js.map +1 -1
- package/storageOperations/models/index.js +6 -26
- package/storageOperations/models/index.js.map +1 -1
- package/storageOperations/models/reviewer.model.d.ts +1 -2
- package/storageOperations/models/reviewer.model.js +8 -8
- package/storageOperations/models/reviewer.model.js.map +1 -1
- package/storageOperations/models/utils.js +3 -1
- package/storageOperations/models/utils.js.map +1 -1
- package/storageOperations/models/workflow.model.d.ts +1 -2
- package/storageOperations/models/workflow.model.js +19 -19
- package/storageOperations/models/workflow.model.js.map +1 -1
- package/storageOperations/reviewerStorageOperations.d.ts +1 -1
- package/storageOperations/reviewerStorageOperations.js +38 -35
- package/storageOperations/reviewerStorageOperations.js.map +1 -1
- package/storageOperations/types.js +3 -1
- package/storageOperations/workflowStorageOperations.js +41 -31
- package/storageOperations/workflowStorageOperations.js.map +1 -1
- package/types.d.ts +16 -16
- package/types.js +126 -28
- package/types.js.map +1 -1
- package/utils/contentApwSettingsPlugin.js +3 -1
- package/utils/contentApwSettingsPlugin.js.map +1 -1
- package/utils/errors.js +3 -1
- package/utils/errors.js.map +1 -1
- package/utils/fieldResolver.js +7 -7
- package/utils/fieldResolver.js.map +1 -1
- package/utils/pickEntryFieldValues.d.ts +3 -0
- package/utils/pickEntryFieldValues.js +31 -0
- package/utils/pickEntryFieldValues.js.map +1 -0
- package/utils/resolve.d.ts +1 -1
- package/utils/resolve.js +3 -1
- package/utils/resolve.js.map +1 -1
- package/storageOperations/models/contentModelPluginFactory.d.ts +0 -11
- package/storageOperations/models/contentModelPluginFactory.js +0 -19
- package/storageOperations/models/contentModelPluginFactory.js.map +0 -1
@@ -1,17 +1,14 @@
|
|
1
1
|
"use strict";
|
2
2
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
4
3
|
Object.defineProperty(exports, "__esModule", {
|
5
4
|
value: true
|
6
5
|
});
|
7
6
|
exports.createApwChangeRequestNotification = exports.ApwChangeRequestNotification = void 0;
|
8
|
-
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
9
7
|
var _plugins = require("@webiny/plugins");
|
10
8
|
class ApwChangeRequestNotification extends _plugins.Plugin {
|
9
|
+
static type = "apw.notification.changeRequest";
|
11
10
|
constructor(contentType, cb) {
|
12
11
|
super();
|
13
|
-
(0, _defineProperty2.default)(this, "contentType", void 0);
|
14
|
-
(0, _defineProperty2.default)(this, "cb", void 0);
|
15
12
|
this.contentType = contentType;
|
16
13
|
this.cb = cb;
|
17
14
|
}
|
@@ -23,8 +20,9 @@ class ApwChangeRequestNotification extends _plugins.Plugin {
|
|
23
20
|
}
|
24
21
|
}
|
25
22
|
exports.ApwChangeRequestNotification = ApwChangeRequestNotification;
|
26
|
-
(0, _defineProperty2.default)(ApwChangeRequestNotification, "type", "apw.notification.changeRequest");
|
27
23
|
const createApwChangeRequestNotification = (contentType, cb) => {
|
28
24
|
return new ApwChangeRequestNotification(contentType, cb);
|
29
25
|
};
|
30
|
-
exports.createApwChangeRequestNotification = createApwChangeRequestNotification;
|
26
|
+
exports.createApwChangeRequestNotification = createApwChangeRequestNotification;
|
27
|
+
|
28
|
+
//# sourceMappingURL=ApwChangeRequestNotification.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["ApwChangeRequestNotification","Plugin","constructor","contentType","cb","canUse","create","params","createApwChangeRequestNotification"],"sources":["ApwChangeRequestNotification.ts"],"sourcesContent":["import { Plugin } from \"@webiny/plugins\";\nimport {\n ApwChangeRequest,\n ApwContentReview,\n ApwContentTypes,\n ApwContext,\n ApwReviewerWithEmail,\n ApwWorkflow\n} from \"~/types\";\n\nexport interface ApwChangeRequestNotificationCbParams {\n context: ApwContext;\n reviewers: ApwReviewerWithEmail[];\n changeRequestUrl: string;\n contentUrl: string;\n changeRequest: ApwChangeRequest;\n contentReview: ApwContentReview;\n workflow: ApwWorkflow;\n}\nexport interface ApwChangeRequestNotificationCbParamsResponse {\n text: string;\n html?: string;\n}\nexport interface ApwChangeRequestNotificationCb {\n (params: ApwChangeRequestNotificationCbParams):\n | ApwChangeRequestNotificationCbParamsResponse\n | null\n | undefined;\n}\nexport class ApwChangeRequestNotification extends Plugin {\n public static override readonly type: string = \"apw.notification.changeRequest\";\n\n private readonly contentType: ApwContentTypes;\n private readonly cb: ApwChangeRequestNotificationCb;\n\n public constructor(contentType: ApwContentTypes, cb: ApwChangeRequestNotificationCb) {\n super();\n this.contentType = contentType;\n this.cb = cb;\n }\n\n public canUse(contentType: ApwContentTypes): boolean {\n return contentType === this.contentType;\n }\n\n public create(params: ApwChangeRequestNotificationCbParams) {\n return this.cb(params);\n }\n}\n\nexport const createApwChangeRequestNotification = (\n contentType: ApwContentTypes,\n cb: ApwChangeRequestNotificationCb\n) => {\n return new ApwChangeRequestNotification(contentType, cb);\n};\n"],"mappings":"
|
1
|
+
{"version":3,"names":["_plugins","require","ApwChangeRequestNotification","Plugin","type","constructor","contentType","cb","canUse","create","params","exports","createApwChangeRequestNotification"],"sources":["ApwChangeRequestNotification.ts"],"sourcesContent":["import { Plugin } from \"@webiny/plugins\";\nimport {\n ApwChangeRequest,\n ApwContentReview,\n ApwContentTypes,\n ApwContext,\n ApwReviewerWithEmail,\n ApwWorkflow\n} from \"~/types\";\n\nexport interface ApwChangeRequestNotificationCbParams {\n context: ApwContext;\n reviewers: ApwReviewerWithEmail[];\n changeRequestUrl: string;\n contentUrl: string;\n changeRequest: ApwChangeRequest;\n contentReview: ApwContentReview;\n workflow: ApwWorkflow;\n}\nexport interface ApwChangeRequestNotificationCbParamsResponse {\n text: string;\n html?: string;\n}\nexport interface ApwChangeRequestNotificationCb {\n (params: ApwChangeRequestNotificationCbParams):\n | ApwChangeRequestNotificationCbParamsResponse\n | null\n | undefined;\n}\nexport class ApwChangeRequestNotification extends Plugin {\n public static override readonly type: string = \"apw.notification.changeRequest\";\n\n private readonly contentType: ApwContentTypes;\n private readonly cb: ApwChangeRequestNotificationCb;\n\n public constructor(contentType: ApwContentTypes, cb: ApwChangeRequestNotificationCb) {\n super();\n this.contentType = contentType;\n this.cb = cb;\n }\n\n public canUse(contentType: ApwContentTypes): boolean {\n return contentType === this.contentType;\n }\n\n public create(params: ApwChangeRequestNotificationCbParams) {\n return this.cb(params);\n }\n}\n\nexport const createApwChangeRequestNotification = (\n contentType: ApwContentTypes,\n cb: ApwChangeRequestNotificationCb\n) => {\n return new ApwChangeRequestNotification(contentType, cb);\n};\n"],"mappings":";;;;;;AAAA,IAAAA,QAAA,GAAAC,OAAA;AA6BO,MAAMC,4BAA4B,SAASC,eAAM,CAAC;EACrD,OAAgCC,IAAI,GAAW,gCAAgC;EAKxEC,WAAWA,CAACC,WAA4B,EAAEC,EAAkC,EAAE;IACjF,KAAK,CAAC,CAAC;IACP,IAAI,CAACD,WAAW,GAAGA,WAAW;IAC9B,IAAI,CAACC,EAAE,GAAGA,EAAE;EAChB;EAEOC,MAAMA,CAACF,WAA4B,EAAW;IACjD,OAAOA,WAAW,KAAK,IAAI,CAACA,WAAW;EAC3C;EAEOG,MAAMA,CAACC,MAA4C,EAAE;IACxD,OAAO,IAAI,CAACH,EAAE,CAACG,MAAM,CAAC;EAC1B;AACJ;AAACC,OAAA,CAAAT,4BAAA,GAAAA,4BAAA;AAEM,MAAMU,kCAAkC,GAAGA,CAC9CN,WAA4B,EAC5BC,EAAkC,KACjC;EACD,OAAO,IAAIL,4BAA4B,CAACI,WAAW,EAAEC,EAAE,CAAC;AAC5D,CAAC;AAACI,OAAA,CAAAC,kCAAA,GAAAA,kCAAA"}
|
@@ -1,17 +1,14 @@
|
|
1
1
|
"use strict";
|
2
2
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
4
3
|
Object.defineProperty(exports, "__esModule", {
|
5
4
|
value: true
|
6
5
|
});
|
7
6
|
exports.createApwCommentNotification = exports.ApwCommentNotification = void 0;
|
8
|
-
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
9
7
|
var _plugins = require("@webiny/plugins");
|
10
8
|
class ApwCommentNotification extends _plugins.Plugin {
|
9
|
+
static type = "apw.notification.comment";
|
11
10
|
constructor(contentType, cb) {
|
12
11
|
super();
|
13
|
-
(0, _defineProperty2.default)(this, "contentType", void 0);
|
14
|
-
(0, _defineProperty2.default)(this, "cb", void 0);
|
15
12
|
this.contentType = contentType;
|
16
13
|
this.cb = cb;
|
17
14
|
}
|
@@ -23,8 +20,9 @@ class ApwCommentNotification extends _plugins.Plugin {
|
|
23
20
|
}
|
24
21
|
}
|
25
22
|
exports.ApwCommentNotification = ApwCommentNotification;
|
26
|
-
(0, _defineProperty2.default)(ApwCommentNotification, "type", "apw.notification.comment");
|
27
23
|
const createApwCommentNotification = (contentType, cb) => {
|
28
24
|
return new ApwCommentNotification(contentType, cb);
|
29
25
|
};
|
30
|
-
exports.createApwCommentNotification = createApwCommentNotification;
|
26
|
+
exports.createApwCommentNotification = createApwCommentNotification;
|
27
|
+
|
28
|
+
//# sourceMappingURL=ApwCommentNotification.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["ApwCommentNotification","Plugin","constructor","contentType","cb","canUse","create","params","createApwCommentNotification"],"sources":["ApwCommentNotification.ts"],"sourcesContent":["import { Plugin } from \"@webiny/plugins\";\nimport {\n ApwChangeRequest,\n ApwContentReview,\n ApwContentTypes,\n ApwContext,\n ApwReviewerWithEmail,\n ApwWorkflow\n} from \"~/types\";\n\nexport interface ApwCommentNotificationCbParams {\n context: ApwContext;\n reviewers: ApwReviewerWithEmail[];\n commentUrl: string;\n contentUrl: string;\n changeRequest: ApwChangeRequest;\n contentReview: ApwContentReview;\n workflow: ApwWorkflow;\n}\nexport interface ApwCommentNotificationCbParamsResponse {\n text: string;\n html?: string;\n}\nexport interface ApwCommentNotificationCb {\n (params: ApwCommentNotificationCbParams):\n | ApwCommentNotificationCbParamsResponse\n | null\n | undefined;\n}\nexport class ApwCommentNotification extends Plugin {\n public static override readonly type: string = \"apw.notification.comment\";\n\n private readonly contentType: ApwContentTypes;\n private readonly cb: ApwCommentNotificationCb;\n\n public constructor(contentType: ApwContentTypes, cb: ApwCommentNotificationCb) {\n super();\n this.contentType = contentType;\n this.cb = cb;\n }\n\n public canUse(contentType: ApwContentTypes): boolean {\n return contentType === this.contentType;\n }\n\n public create(params: ApwCommentNotificationCbParams) {\n return this.cb(params);\n }\n}\n\nexport const createApwCommentNotification = (\n contentType: ApwContentTypes,\n cb: ApwCommentNotificationCb\n) => {\n return new ApwCommentNotification(contentType, cb);\n};\n"],"mappings":"
|
1
|
+
{"version":3,"names":["_plugins","require","ApwCommentNotification","Plugin","type","constructor","contentType","cb","canUse","create","params","exports","createApwCommentNotification"],"sources":["ApwCommentNotification.ts"],"sourcesContent":["import { Plugin } from \"@webiny/plugins\";\nimport {\n ApwChangeRequest,\n ApwContentReview,\n ApwContentTypes,\n ApwContext,\n ApwReviewerWithEmail,\n ApwWorkflow\n} from \"~/types\";\n\nexport interface ApwCommentNotificationCbParams {\n context: ApwContext;\n reviewers: ApwReviewerWithEmail[];\n commentUrl: string;\n contentUrl: string;\n changeRequest: ApwChangeRequest;\n contentReview: ApwContentReview;\n workflow: ApwWorkflow;\n}\nexport interface ApwCommentNotificationCbParamsResponse {\n text: string;\n html?: string;\n}\nexport interface ApwCommentNotificationCb {\n (params: ApwCommentNotificationCbParams):\n | ApwCommentNotificationCbParamsResponse\n | null\n | undefined;\n}\nexport class ApwCommentNotification extends Plugin {\n public static override readonly type: string = \"apw.notification.comment\";\n\n private readonly contentType: ApwContentTypes;\n private readonly cb: ApwCommentNotificationCb;\n\n public constructor(contentType: ApwContentTypes, cb: ApwCommentNotificationCb) {\n super();\n this.contentType = contentType;\n this.cb = cb;\n }\n\n public canUse(contentType: ApwContentTypes): boolean {\n return contentType === this.contentType;\n }\n\n public create(params: ApwCommentNotificationCbParams) {\n return this.cb(params);\n }\n}\n\nexport const createApwCommentNotification = (\n contentType: ApwContentTypes,\n cb: ApwCommentNotificationCb\n) => {\n return new ApwCommentNotification(contentType, cb);\n};\n"],"mappings":";;;;;;AAAA,IAAAA,QAAA,GAAAC,OAAA;AA6BO,MAAMC,sBAAsB,SAASC,eAAM,CAAC;EAC/C,OAAgCC,IAAI,GAAW,0BAA0B;EAKlEC,WAAWA,CAACC,WAA4B,EAAEC,EAA4B,EAAE;IAC3E,KAAK,CAAC,CAAC;IACP,IAAI,CAACD,WAAW,GAAGA,WAAW;IAC9B,IAAI,CAACC,EAAE,GAAGA,EAAE;EAChB;EAEOC,MAAMA,CAACF,WAA4B,EAAW;IACjD,OAAOA,WAAW,KAAK,IAAI,CAACA,WAAW;EAC3C;EAEOG,MAAMA,CAACC,MAAsC,EAAE;IAClD,OAAO,IAAI,CAACH,EAAE,CAACG,MAAM,CAAC;EAC1B;AACJ;AAACC,OAAA,CAAAT,sBAAA,GAAAA,sBAAA;AAEM,MAAMU,4BAA4B,GAAGA,CACxCN,WAA4B,EAC5BC,EAA4B,KAC3B;EACD,OAAO,IAAIL,sBAAsB,CAACI,WAAW,EAAEC,EAAE,CAAC;AACtD,CAAC;AAACI,OAAA,CAAAC,4BAAA,GAAAA,4BAAA"}
|
@@ -1,17 +1,14 @@
|
|
1
1
|
"use strict";
|
2
2
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
4
3
|
Object.defineProperty(exports, "__esModule", {
|
5
4
|
value: true
|
6
5
|
});
|
7
6
|
exports.createApwContentReviewNotification = exports.ApwContentReviewNotification = void 0;
|
8
|
-
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
9
7
|
var _plugins = require("@webiny/plugins");
|
10
8
|
class ApwContentReviewNotification extends _plugins.Plugin {
|
9
|
+
static type = "apw.notification.contentReview";
|
11
10
|
constructor(contentType, cb) {
|
12
11
|
super();
|
13
|
-
(0, _defineProperty2.default)(this, "contentType", void 0);
|
14
|
-
(0, _defineProperty2.default)(this, "cb", void 0);
|
15
12
|
this.contentType = contentType;
|
16
13
|
this.cb = cb;
|
17
14
|
}
|
@@ -23,8 +20,9 @@ class ApwContentReviewNotification extends _plugins.Plugin {
|
|
23
20
|
}
|
24
21
|
}
|
25
22
|
exports.ApwContentReviewNotification = ApwContentReviewNotification;
|
26
|
-
(0, _defineProperty2.default)(ApwContentReviewNotification, "type", "apw.notification.contentReview");
|
27
23
|
const createApwContentReviewNotification = (contentType, cb) => {
|
28
24
|
return new ApwContentReviewNotification(contentType, cb);
|
29
25
|
};
|
30
|
-
exports.createApwContentReviewNotification = createApwContentReviewNotification;
|
26
|
+
exports.createApwContentReviewNotification = createApwContentReviewNotification;
|
27
|
+
|
28
|
+
//# sourceMappingURL=ApwContentReviewNotification.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["ApwContentReviewNotification","Plugin","constructor","contentType","cb","canUse","create","params","createApwContentReviewNotification"],"sources":["ApwContentReviewNotification.ts"],"sourcesContent":["import { Plugin } from \"@webiny/plugins\";\nimport {\n ApwContentReview,\n ApwContentTypes,\n ApwContext,\n ApwReviewerWithEmail,\n ApwWorkflow\n} from \"~/types\";\n\nexport interface ApwContentReviewNotificationCbParams {\n context: ApwContext;\n reviewers: ApwReviewerWithEmail[];\n contentReviewUrl: string;\n contentUrl: string;\n contentReview: ApwContentReview;\n workflow: ApwWorkflow;\n}\nexport interface ApwContentReviewNotificationCbParamsResponse {\n text: string;\n html?: string;\n}\nexport interface ApwContentReviewNotificationCb {\n (params: ApwContentReviewNotificationCbParams):\n | ApwContentReviewNotificationCbParamsResponse\n | null\n | undefined;\n}\nexport class ApwContentReviewNotification extends Plugin {\n public static override readonly type: string = \"apw.notification.contentReview\";\n\n private readonly contentType: ApwContentTypes;\n private readonly cb: ApwContentReviewNotificationCb;\n\n public constructor(contentType: ApwContentTypes, cb: ApwContentReviewNotificationCb) {\n super();\n this.contentType = contentType;\n this.cb = cb;\n }\n\n public canUse(contentType: ApwContentTypes): boolean {\n return contentType === this.contentType;\n }\n\n public create(params: ApwContentReviewNotificationCbParams) {\n return this.cb(params);\n }\n}\n\nexport const createApwContentReviewNotification = (\n contentType: ApwContentTypes,\n cb: ApwContentReviewNotificationCb\n) => {\n return new ApwContentReviewNotification(contentType, cb);\n};\n"],"mappings":"
|
1
|
+
{"version":3,"names":["_plugins","require","ApwContentReviewNotification","Plugin","type","constructor","contentType","cb","canUse","create","params","exports","createApwContentReviewNotification"],"sources":["ApwContentReviewNotification.ts"],"sourcesContent":["import { Plugin } from \"@webiny/plugins\";\nimport {\n ApwContentReview,\n ApwContentTypes,\n ApwContext,\n ApwReviewerWithEmail,\n ApwWorkflow\n} from \"~/types\";\n\nexport interface ApwContentReviewNotificationCbParams {\n context: ApwContext;\n reviewers: ApwReviewerWithEmail[];\n contentReviewUrl: string;\n contentUrl: string;\n contentReview: ApwContentReview;\n workflow: ApwWorkflow;\n}\nexport interface ApwContentReviewNotificationCbParamsResponse {\n text: string;\n html?: string;\n}\nexport interface ApwContentReviewNotificationCb {\n (params: ApwContentReviewNotificationCbParams):\n | ApwContentReviewNotificationCbParamsResponse\n | null\n | undefined;\n}\nexport class ApwContentReviewNotification extends Plugin {\n public static override readonly type: string = \"apw.notification.contentReview\";\n\n private readonly contentType: ApwContentTypes;\n private readonly cb: ApwContentReviewNotificationCb;\n\n public constructor(contentType: ApwContentTypes, cb: ApwContentReviewNotificationCb) {\n super();\n this.contentType = contentType;\n this.cb = cb;\n }\n\n public canUse(contentType: ApwContentTypes): boolean {\n return contentType === this.contentType;\n }\n\n public create(params: ApwContentReviewNotificationCbParams) {\n return this.cb(params);\n }\n}\n\nexport const createApwContentReviewNotification = (\n contentType: ApwContentTypes,\n cb: ApwContentReviewNotificationCb\n) => {\n return new ApwContentReviewNotification(contentType, cb);\n};\n"],"mappings":";;;;;;AAAA,IAAAA,QAAA,GAAAC,OAAA;AA2BO,MAAMC,4BAA4B,SAASC,eAAM,CAAC;EACrD,OAAgCC,IAAI,GAAW,gCAAgC;EAKxEC,WAAWA,CAACC,WAA4B,EAAEC,EAAkC,EAAE;IACjF,KAAK,CAAC,CAAC;IACP,IAAI,CAACD,WAAW,GAAGA,WAAW;IAC9B,IAAI,CAACC,EAAE,GAAGA,EAAE;EAChB;EAEOC,MAAMA,CAACF,WAA4B,EAAW;IACjD,OAAOA,WAAW,KAAK,IAAI,CAACA,WAAW;EAC3C;EAEOG,MAAMA,CAACC,MAA4C,EAAE;IACxD,OAAO,IAAI,CAACH,EAAE,CAACG,MAAM,CAAC;EAC1B;AACJ;AAACC,OAAA,CAAAT,4BAAA,GAAAA,4BAAA;AAEM,MAAMU,kCAAkC,GAAGA,CAC9CN,WAA4B,EAC5BC,EAAkC,KACjC;EACD,OAAO,IAAIL,4BAA4B,CAACI,WAAW,EAAEC,EAAE,CAAC;AAC5D,CAAC;AAACI,OAAA,CAAAC,kCAAA,GAAAA,kCAAA"}
|
package/ApwContentUrlPlugin.js
CHANGED
@@ -1,17 +1,14 @@
|
|
1
1
|
"use strict";
|
2
2
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
4
3
|
Object.defineProperty(exports, "__esModule", {
|
5
4
|
value: true
|
6
5
|
});
|
7
6
|
exports.createApwContentUrlPlugin = exports.ApwContentUrlPlugin = void 0;
|
8
|
-
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
9
7
|
var _plugins = require("@webiny/plugins");
|
10
8
|
class ApwContentUrlPlugin extends _plugins.Plugin {
|
9
|
+
static type = "apw.contentUrl";
|
11
10
|
constructor(contentType, cb) {
|
12
11
|
super();
|
13
|
-
(0, _defineProperty2.default)(this, "cb", void 0);
|
14
|
-
(0, _defineProperty2.default)(this, "contentType", void 0);
|
15
12
|
this.contentType = contentType;
|
16
13
|
this.cb = cb;
|
17
14
|
}
|
@@ -23,8 +20,9 @@ class ApwContentUrlPlugin extends _plugins.Plugin {
|
|
23
20
|
}
|
24
21
|
}
|
25
22
|
exports.ApwContentUrlPlugin = ApwContentUrlPlugin;
|
26
|
-
(0, _defineProperty2.default)(ApwContentUrlPlugin, "type", "apw.contentUrl");
|
27
23
|
const createApwContentUrlPlugin = (contentType, cb) => {
|
28
24
|
return new ApwContentUrlPlugin(contentType, cb);
|
29
25
|
};
|
30
|
-
exports.createApwContentUrlPlugin = createApwContentUrlPlugin;
|
26
|
+
exports.createApwContentUrlPlugin = createApwContentUrlPlugin;
|
27
|
+
|
28
|
+
//# sourceMappingURL=ApwContentUrlPlugin.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["ApwContentUrlPlugin","Plugin","constructor","contentType","cb","canUse","create","params","createApwContentUrlPlugin"],"sources":["ApwContentUrlPlugin.ts"],"sourcesContent":["import { Plugin } from \"@webiny/plugins\";\nimport { ApwContentReview, ApwContentTypes, ApwWorkflow } from \"~/types\";\n\nexport interface ApwContentUrlPluginCbParams {\n baseUrl: string;\n contentReview: ApwContentReview;\n workflow: ApwWorkflow;\n}\nexport interface ApwContentUrlPluginCb {\n (params: ApwContentUrlPluginCbParams): string | null;\n}\n\nexport class ApwContentUrlPlugin extends Plugin {\n public static override type = \"apw.contentUrl\";\n\n private readonly cb: ApwContentUrlPluginCb;\n private readonly contentType: ApwContentTypes;\n\n public constructor(contentType: ApwContentTypes, cb: ApwContentUrlPluginCb) {\n super();\n\n this.contentType = contentType;\n this.cb = cb;\n }\n\n public canUse(contentType: ApwContentTypes): boolean {\n return this.contentType === contentType;\n }\n\n public create(params: ApwContentUrlPluginCbParams): string | null {\n return this.cb(params);\n }\n}\n\nexport const createApwContentUrlPlugin = (\n contentType: ApwContentTypes,\n cb: ApwContentUrlPluginCb\n) => {\n return new ApwContentUrlPlugin(contentType, cb);\n};\n"],"mappings":"
|
1
|
+
{"version":3,"names":["_plugins","require","ApwContentUrlPlugin","Plugin","type","constructor","contentType","cb","canUse","create","params","exports","createApwContentUrlPlugin"],"sources":["ApwContentUrlPlugin.ts"],"sourcesContent":["import { Plugin } from \"@webiny/plugins\";\nimport { ApwContentReview, ApwContentTypes, ApwWorkflow } from \"~/types\";\n\nexport interface ApwContentUrlPluginCbParams {\n baseUrl: string;\n contentReview: ApwContentReview;\n workflow: ApwWorkflow;\n}\nexport interface ApwContentUrlPluginCb {\n (params: ApwContentUrlPluginCbParams): string | null;\n}\n\nexport class ApwContentUrlPlugin extends Plugin {\n public static override type = \"apw.contentUrl\";\n\n private readonly cb: ApwContentUrlPluginCb;\n private readonly contentType: ApwContentTypes;\n\n public constructor(contentType: ApwContentTypes, cb: ApwContentUrlPluginCb) {\n super();\n\n this.contentType = contentType;\n this.cb = cb;\n }\n\n public canUse(contentType: ApwContentTypes): boolean {\n return this.contentType === contentType;\n }\n\n public create(params: ApwContentUrlPluginCbParams): string | null {\n return this.cb(params);\n }\n}\n\nexport const createApwContentUrlPlugin = (\n contentType: ApwContentTypes,\n cb: ApwContentUrlPluginCb\n) => {\n return new ApwContentUrlPlugin(contentType, cb);\n};\n"],"mappings":";;;;;;AAAA,IAAAA,QAAA,GAAAC,OAAA;AAYO,MAAMC,mBAAmB,SAASC,eAAM,CAAC;EAC5C,OAAuBC,IAAI,GAAG,gBAAgB;EAKvCC,WAAWA,CAACC,WAA4B,EAAEC,EAAyB,EAAE;IACxE,KAAK,CAAC,CAAC;IAEP,IAAI,CAACD,WAAW,GAAGA,WAAW;IAC9B,IAAI,CAACC,EAAE,GAAGA,EAAE;EAChB;EAEOC,MAAMA,CAACF,WAA4B,EAAW;IACjD,OAAO,IAAI,CAACA,WAAW,KAAKA,WAAW;EAC3C;EAEOG,MAAMA,CAACC,MAAmC,EAAiB;IAC9D,OAAO,IAAI,CAACH,EAAE,CAACG,MAAM,CAAC;EAC1B;AACJ;AAACC,OAAA,CAAAT,mBAAA,GAAAA,mBAAA;AAEM,MAAMU,yBAAyB,GAAGA,CACrCN,WAA4B,EAC5BC,EAAyB,KACxB;EACD,OAAO,IAAIL,mBAAmB,CAACI,WAAW,EAAEC,EAAE,CAAC;AACnD,CAAC;AAACI,OAAA,CAAAC,yBAAA,GAAAA,yBAAA"}
|
@@ -1,12 +1,13 @@
|
|
1
1
|
"use strict";
|
2
2
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
4
3
|
Object.defineProperty(exports, "__esModule", {
|
5
4
|
value: true
|
6
5
|
});
|
7
6
|
exports.ContentApwSettingsPlugin = void 0;
|
8
|
-
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
9
7
|
var _Plugin = require("@webiny/plugins/Plugin");
|
10
|
-
class ContentApwSettingsPlugin extends _Plugin.Plugin {
|
8
|
+
class ContentApwSettingsPlugin extends _Plugin.Plugin {
|
9
|
+
static type = "apw.contentApwSettings";
|
10
|
+
}
|
11
11
|
exports.ContentApwSettingsPlugin = ContentApwSettingsPlugin;
|
12
|
-
|
12
|
+
|
13
|
+
//# sourceMappingURL=ContentApwSettingsPlugin.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["ContentApwSettingsPlugin","Plugin"],"sources":["ContentApwSettingsPlugin.ts"],"sourcesContent":["import { Plugin } from \"@webiny/plugins/Plugin\";\nimport { ApwContentTypes } from \"~/types\";\n\nexport abstract class ContentApwSettingsPlugin extends Plugin {\n public static override type = \"apw.contentApwSettings\";\n\n public abstract canUse(type: ApwContentTypes): boolean;\n\n public abstract setWorkflowId(content: any, id: string | null): void;\n\n public abstract getWorkflowId(content: any): string | null;\n\n public abstract setContentReviewId(content: any, id: string | null): void;\n\n public abstract getContentReviewId(content: any): string | null;\n}\n"],"mappings":"
|
1
|
+
{"version":3,"names":["_Plugin","require","ContentApwSettingsPlugin","Plugin","type","exports"],"sources":["ContentApwSettingsPlugin.ts"],"sourcesContent":["import { Plugin } from \"@webiny/plugins/Plugin\";\nimport { ApwContentTypes } from \"~/types\";\n\nexport abstract class ContentApwSettingsPlugin extends Plugin {\n public static override type = \"apw.contentApwSettings\";\n\n public abstract canUse(type: ApwContentTypes): boolean;\n\n public abstract setWorkflowId(content: any, id: string | null): void;\n\n public abstract getWorkflowId(content: any): string | null;\n\n public abstract setContentReviewId(content: any, id: string | null): void;\n\n public abstract getContentReviewId(content: any): string | null;\n}\n"],"mappings":";;;;;;AAAA,IAAAA,OAAA,GAAAC,OAAA;AAGO,MAAeC,wBAAwB,SAASC,cAAM,CAAC;EAC1D,OAAuBC,IAAI,GAAG,wBAAwB;AAW1D;AAACC,OAAA,CAAAH,wBAAA,GAAAA,wBAAA"}
|
package/README.md
CHANGED
@@ -24,11 +24,11 @@ To run tests api-apw tests with targeted storage operations loaded use:
|
|
24
24
|
#### DynamoDB
|
25
25
|
|
26
26
|
```
|
27
|
-
yarn test packages/api-apw --keyword=apw:ddb --keyword=apw:base
|
27
|
+
yarn test packages/api-apw --storage:ddb --keyword=apw:ddb --keyword=apw:base
|
28
28
|
```
|
29
29
|
|
30
30
|
#### Note
|
31
31
|
|
32
32
|
> All the tests in `@webiny/api-apw` package are being tested against ddb-only storage operations because
|
33
|
-
current jest setup doesn't allow usage of more than one storage operations at a time with the help of --keyword flag.
|
34
|
-
We should revisit these tests once we have the ability to load multiple storage operations in the jest setup.
|
33
|
+
> current jest setup doesn't allow usage of more than one storage operations at a time with the help of --keyword flag.
|
34
|
+
> We should revisit these tests once we have the ability to load multiple storage operations in the jest setup.
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["createChangeRequestMethods","storageOperations","onChangeRequestBeforeCreate","createTopic","onChangeRequestAfterCreate","onChangeRequestBeforeUpdate","onChangeRequestAfterUpdate","onChangeRequestBeforeDelete","onChangeRequestAfterDelete","get","id","getChangeRequest","list","params","listChangeRequests","create","data","publish","input","changeRequest","createChangeRequest","update","original","updateChangeRequest","delete","deleteChangeRequest"],"sources":["createChangeRequestMethods.ts"],"sourcesContent":["import { createTopic } from \"@webiny/pubsub\";\nimport {\n ApwChangeRequestCrud,\n CreateApwParams,\n OnChangeRequestAfterCreateTopicParams,\n OnChangeRequestAfterDeleteTopicParams,\n OnChangeRequestAfterUpdateTopicParams,\n OnChangeRequestBeforeCreateTopicParams,\n OnChangeRequestBeforeDeleteTopicParams,\n OnChangeRequestBeforeUpdateTopicParams\n} from \"~/types\";\n\nexport function createChangeRequestMethods({\n storageOperations\n}: CreateApwParams): ApwChangeRequestCrud {\n // create\n const onChangeRequestBeforeCreate = createTopic<OnChangeRequestBeforeCreateTopicParams>(\n \"apw.onChangeRequestBeforeCreate\"\n );\n const onChangeRequestAfterCreate = createTopic<OnChangeRequestAfterCreateTopicParams>(\n \"apw.onChangeRequestAfterCreate\"\n );\n // update\n const onChangeRequestBeforeUpdate = createTopic<OnChangeRequestBeforeUpdateTopicParams>(\n \"apw.onChangeRequestBeforeUpdate\"\n );\n const onChangeRequestAfterUpdate = createTopic<OnChangeRequestAfterUpdateTopicParams>(\n \"apw.onChangeRequestAfterUpdate\"\n );\n // delete\n const onChangeRequestBeforeDelete = createTopic<OnChangeRequestBeforeDeleteTopicParams>(\n \"apw.onChangeRequestBeforeDelete\"\n );\n const onChangeRequestAfterDelete = createTopic<OnChangeRequestAfterDeleteTopicParams>(\n \"apw.onChangeRequestAfterDelete\"\n );\n\n return {\n async get(id) {\n return storageOperations.getChangeRequest({ id });\n },\n async list(params) {\n return storageOperations.listChangeRequests(params);\n },\n async create(data) {\n await onChangeRequestBeforeCreate.publish({ input: data });\n\n const changeRequest = await storageOperations.createChangeRequest({ data });\n\n await onChangeRequestAfterCreate.publish({ changeRequest });\n\n return changeRequest;\n },\n async update(id, data) {\n const original = await storageOperations.getChangeRequest({ id });\n\n await onChangeRequestBeforeUpdate.publish({ original, input: { id, data } });\n\n const changeRequest = await storageOperations.updateChangeRequest({ id, data });\n\n await onChangeRequestAfterUpdate.publish({\n original,\n input: { id, data },\n changeRequest\n });\n\n return changeRequest;\n },\n async delete(id: string) {\n const changeRequest = await storageOperations.getChangeRequest({ id });\n\n await onChangeRequestBeforeDelete.publish({ changeRequest });\n\n await storageOperations.deleteChangeRequest({ id });\n\n await onChangeRequestAfterDelete.publish({ changeRequest });\n\n return true;\n },\n /**\n * Lifecycle events\n */\n onChangeRequestBeforeCreate,\n onChangeRequestAfterCreate,\n onChangeRequestBeforeUpdate,\n onChangeRequestAfterUpdate,\n onChangeRequestBeforeDelete,\n onChangeRequestAfterDelete\n };\n}\n"],"mappings":";;;;;;AAAA;AAYO,
|
1
|
+
{"version":3,"names":["_pubsub","require","createChangeRequestMethods","storageOperations","onChangeRequestBeforeCreate","createTopic","onChangeRequestAfterCreate","onChangeRequestBeforeUpdate","onChangeRequestAfterUpdate","onChangeRequestBeforeDelete","onChangeRequestAfterDelete","get","id","getChangeRequest","list","params","listChangeRequests","create","data","publish","input","changeRequest","createChangeRequest","update","original","updateChangeRequest","delete","deleteChangeRequest"],"sources":["createChangeRequestMethods.ts"],"sourcesContent":["import { createTopic } from \"@webiny/pubsub\";\nimport {\n ApwChangeRequestCrud,\n CreateApwParams,\n OnChangeRequestAfterCreateTopicParams,\n OnChangeRequestAfterDeleteTopicParams,\n OnChangeRequestAfterUpdateTopicParams,\n OnChangeRequestBeforeCreateTopicParams,\n OnChangeRequestBeforeDeleteTopicParams,\n OnChangeRequestBeforeUpdateTopicParams\n} from \"~/types\";\n\nexport function createChangeRequestMethods({\n storageOperations\n}: CreateApwParams): ApwChangeRequestCrud {\n // create\n const onChangeRequestBeforeCreate = createTopic<OnChangeRequestBeforeCreateTopicParams>(\n \"apw.onChangeRequestBeforeCreate\"\n );\n const onChangeRequestAfterCreate = createTopic<OnChangeRequestAfterCreateTopicParams>(\n \"apw.onChangeRequestAfterCreate\"\n );\n // update\n const onChangeRequestBeforeUpdate = createTopic<OnChangeRequestBeforeUpdateTopicParams>(\n \"apw.onChangeRequestBeforeUpdate\"\n );\n const onChangeRequestAfterUpdate = createTopic<OnChangeRequestAfterUpdateTopicParams>(\n \"apw.onChangeRequestAfterUpdate\"\n );\n // delete\n const onChangeRequestBeforeDelete = createTopic<OnChangeRequestBeforeDeleteTopicParams>(\n \"apw.onChangeRequestBeforeDelete\"\n );\n const onChangeRequestAfterDelete = createTopic<OnChangeRequestAfterDeleteTopicParams>(\n \"apw.onChangeRequestAfterDelete\"\n );\n\n return {\n async get(id) {\n return storageOperations.getChangeRequest({ id });\n },\n async list(params) {\n return storageOperations.listChangeRequests(params);\n },\n async create(data) {\n await onChangeRequestBeforeCreate.publish({ input: data });\n\n const changeRequest = await storageOperations.createChangeRequest({ data });\n\n await onChangeRequestAfterCreate.publish({ changeRequest });\n\n return changeRequest;\n },\n async update(id, data) {\n const original = await storageOperations.getChangeRequest({ id });\n\n await onChangeRequestBeforeUpdate.publish({ original, input: { id, data } });\n\n const changeRequest = await storageOperations.updateChangeRequest({ id, data });\n\n await onChangeRequestAfterUpdate.publish({\n original,\n input: { id, data },\n changeRequest\n });\n\n return changeRequest;\n },\n async delete(id: string) {\n const changeRequest = await storageOperations.getChangeRequest({ id });\n\n await onChangeRequestBeforeDelete.publish({ changeRequest });\n\n await storageOperations.deleteChangeRequest({ id });\n\n await onChangeRequestAfterDelete.publish({ changeRequest });\n\n return true;\n },\n /**\n * Lifecycle events\n */\n onChangeRequestBeforeCreate,\n onChangeRequestAfterCreate,\n onChangeRequestBeforeUpdate,\n onChangeRequestAfterUpdate,\n onChangeRequestBeforeDelete,\n onChangeRequestAfterDelete\n };\n}\n"],"mappings":";;;;;;AAAA,IAAAA,OAAA,GAAAC,OAAA;AAYO,SAASC,0BAA0BA,CAAC;EACvCC;AACa,CAAC,EAAwB;EACtC;EACA,MAAMC,2BAA2B,GAAG,IAAAC,mBAAW,EAC3C,iCACJ,CAAC;EACD,MAAMC,0BAA0B,GAAG,IAAAD,mBAAW,EAC1C,gCACJ,CAAC;EACD;EACA,MAAME,2BAA2B,GAAG,IAAAF,mBAAW,EAC3C,iCACJ,CAAC;EACD,MAAMG,0BAA0B,GAAG,IAAAH,mBAAW,EAC1C,gCACJ,CAAC;EACD;EACA,MAAMI,2BAA2B,GAAG,IAAAJ,mBAAW,EAC3C,iCACJ,CAAC;EACD,MAAMK,0BAA0B,GAAG,IAAAL,mBAAW,EAC1C,gCACJ,CAAC;EAED,OAAO;IACH,MAAMM,GAAGA,CAACC,EAAE,EAAE;MACV,OAAOT,iBAAiB,CAACU,gBAAgB,CAAC;QAAED;MAAG,CAAC,CAAC;IACrD,CAAC;IACD,MAAME,IAAIA,CAACC,MAAM,EAAE;MACf,OAAOZ,iBAAiB,CAACa,kBAAkB,CAACD,MAAM,CAAC;IACvD,CAAC;IACD,MAAME,MAAMA,CAACC,IAAI,EAAE;MACf,MAAMd,2BAA2B,CAACe,OAAO,CAAC;QAAEC,KAAK,EAAEF;MAAK,CAAC,CAAC;MAE1D,MAAMG,aAAa,GAAG,MAAMlB,iBAAiB,CAACmB,mBAAmB,CAAC;QAAEJ;MAAK,CAAC,CAAC;MAE3E,MAAMZ,0BAA0B,CAACa,OAAO,CAAC;QAAEE;MAAc,CAAC,CAAC;MAE3D,OAAOA,aAAa;IACxB,CAAC;IACD,MAAME,MAAMA,CAACX,EAAE,EAAEM,IAAI,EAAE;MACnB,MAAMM,QAAQ,GAAG,MAAMrB,iBAAiB,CAACU,gBAAgB,CAAC;QAAED;MAAG,CAAC,CAAC;MAEjE,MAAML,2BAA2B,CAACY,OAAO,CAAC;QAAEK,QAAQ;QAAEJ,KAAK,EAAE;UAAER,EAAE;UAAEM;QAAK;MAAE,CAAC,CAAC;MAE5E,MAAMG,aAAa,GAAG,MAAMlB,iBAAiB,CAACsB,mBAAmB,CAAC;QAAEb,EAAE;QAAEM;MAAK,CAAC,CAAC;MAE/E,MAAMV,0BAA0B,CAACW,OAAO,CAAC;QACrCK,QAAQ;QACRJ,KAAK,EAAE;UAAER,EAAE;UAAEM;QAAK,CAAC;QACnBG;MACJ,CAAC,CAAC;MAEF,OAAOA,aAAa;IACxB,CAAC;IACD,MAAMK,MAAMA,CAACd,EAAU,EAAE;MACrB,MAAMS,aAAa,GAAG,MAAMlB,iBAAiB,CAACU,gBAAgB,CAAC;QAAED;MAAG,CAAC,CAAC;MAEtE,MAAMH,2BAA2B,CAACU,OAAO,CAAC;QAAEE;MAAc,CAAC,CAAC;MAE5D,MAAMlB,iBAAiB,CAACwB,mBAAmB,CAAC;QAAEf;MAAG,CAAC,CAAC;MAEnD,MAAMF,0BAA0B,CAACS,OAAO,CAAC;QAAEE;MAAc,CAAC,CAAC;MAE3D,OAAO,IAAI;IACf,CAAC;IACD;AACR;AACA;IACQjB,2BAA2B;IAC3BE,0BAA0B;IAC1BC,2BAA2B;IAC3BC,0BAA0B;IAC1BC,2BAA2B;IAC3BC;EACJ,CAAC;AACL"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["createCommentMethods","storageOperations","onCommentBeforeCreate","createTopic","onCommentAfterCreate","onCommentBeforeUpdate","onCommentAfterUpdate","onCommentBeforeDelete","onCommentAfterDelete","get","id","getComment","list","params","listComments","create","data","publish","input","comment","createComment","update","original","updateComment","delete","deleteComment"],"sources":["createCommentMethods.ts"],"sourcesContent":["import { createTopic } from \"@webiny/pubsub\";\nimport {\n ApwCommentCrud,\n CreateApwParams,\n OnCommentBeforeCreateTopicParams,\n OnCommentAfterCreateTopicParams,\n OnCommentBeforeUpdateTopicParams,\n OnCommentAfterUpdateTopicParams,\n OnCommentBeforeDeleteTopicParams,\n OnCommentAfterDeleteTopicParams\n} from \"~/types\";\n\nexport function createCommentMethods({ storageOperations }: CreateApwParams): ApwCommentCrud {\n // create\n const onCommentBeforeCreate = createTopic<OnCommentBeforeCreateTopicParams>(\n \"apw.onCommentBeforeCreate\"\n );\n const onCommentAfterCreate = createTopic<OnCommentAfterCreateTopicParams>(\n \"apw.onCommentAfterCreate\"\n );\n // update\n const onCommentBeforeUpdate = createTopic<OnCommentBeforeUpdateTopicParams>(\n \"apw.onCommentBeforeUpdate\"\n );\n const onCommentAfterUpdate = createTopic<OnCommentAfterUpdateTopicParams>(\n \"apw.onCommentAfterUpdate\"\n );\n // delete\n const onCommentBeforeDelete = createTopic<OnCommentBeforeDeleteTopicParams>(\n \"apw.onCommentBeforeDelete\"\n );\n const onCommentAfterDelete = createTopic<OnCommentAfterDeleteTopicParams>(\n \"apw.onCommentAfterDelete\"\n );\n\n return {\n /**\n * Lifecycle events\n */\n onCommentBeforeCreate,\n onCommentAfterCreate,\n onCommentBeforeUpdate,\n onCommentAfterUpdate,\n onCommentBeforeDelete,\n onCommentAfterDelete,\n async get(id) {\n return storageOperations.getComment({ id });\n },\n async list(params) {\n return storageOperations.listComments(params);\n },\n async create(data) {\n await onCommentBeforeCreate.publish({ input: data });\n\n const comment = await storageOperations.createComment({\n data\n });\n await onCommentAfterCreate.publish({ comment });\n\n return comment;\n },\n async update(id, data) {\n const original = await storageOperations.getComment({ id });\n\n await onCommentBeforeUpdate.publish({ original, input: { id, data } });\n\n const comment = await storageOperations.updateComment({ id, data });\n\n await onCommentAfterUpdate.publish({ original, comment, input: { id, data } });\n\n return comment;\n },\n async delete(id: string) {\n const comment = await storageOperations.getComment({ id });\n\n await onCommentBeforeDelete.publish({ comment });\n\n await storageOperations.deleteComment({ id });\n\n await onCommentAfterDelete.publish({ comment });\n\n return true;\n }\n };\n}\n"],"mappings":";;;;;;AAAA;AAYO,
|
1
|
+
{"version":3,"names":["_pubsub","require","createCommentMethods","storageOperations","onCommentBeforeCreate","createTopic","onCommentAfterCreate","onCommentBeforeUpdate","onCommentAfterUpdate","onCommentBeforeDelete","onCommentAfterDelete","get","id","getComment","list","params","listComments","create","data","publish","input","comment","createComment","update","original","updateComment","delete","deleteComment"],"sources":["createCommentMethods.ts"],"sourcesContent":["import { createTopic } from \"@webiny/pubsub\";\nimport {\n ApwCommentCrud,\n CreateApwParams,\n OnCommentBeforeCreateTopicParams,\n OnCommentAfterCreateTopicParams,\n OnCommentBeforeUpdateTopicParams,\n OnCommentAfterUpdateTopicParams,\n OnCommentBeforeDeleteTopicParams,\n OnCommentAfterDeleteTopicParams\n} from \"~/types\";\n\nexport function createCommentMethods({ storageOperations }: CreateApwParams): ApwCommentCrud {\n // create\n const onCommentBeforeCreate = createTopic<OnCommentBeforeCreateTopicParams>(\n \"apw.onCommentBeforeCreate\"\n );\n const onCommentAfterCreate = createTopic<OnCommentAfterCreateTopicParams>(\n \"apw.onCommentAfterCreate\"\n );\n // update\n const onCommentBeforeUpdate = createTopic<OnCommentBeforeUpdateTopicParams>(\n \"apw.onCommentBeforeUpdate\"\n );\n const onCommentAfterUpdate = createTopic<OnCommentAfterUpdateTopicParams>(\n \"apw.onCommentAfterUpdate\"\n );\n // delete\n const onCommentBeforeDelete = createTopic<OnCommentBeforeDeleteTopicParams>(\n \"apw.onCommentBeforeDelete\"\n );\n const onCommentAfterDelete = createTopic<OnCommentAfterDeleteTopicParams>(\n \"apw.onCommentAfterDelete\"\n );\n\n return {\n /**\n * Lifecycle events\n */\n onCommentBeforeCreate,\n onCommentAfterCreate,\n onCommentBeforeUpdate,\n onCommentAfterUpdate,\n onCommentBeforeDelete,\n onCommentAfterDelete,\n async get(id) {\n return storageOperations.getComment({ id });\n },\n async list(params) {\n return storageOperations.listComments(params);\n },\n async create(data) {\n await onCommentBeforeCreate.publish({ input: data });\n\n const comment = await storageOperations.createComment({\n data\n });\n await onCommentAfterCreate.publish({ comment });\n\n return comment;\n },\n async update(id, data) {\n const original = await storageOperations.getComment({ id });\n\n await onCommentBeforeUpdate.publish({ original, input: { id, data } });\n\n const comment = await storageOperations.updateComment({ id, data });\n\n await onCommentAfterUpdate.publish({ original, comment, input: { id, data } });\n\n return comment;\n },\n async delete(id: string) {\n const comment = await storageOperations.getComment({ id });\n\n await onCommentBeforeDelete.publish({ comment });\n\n await storageOperations.deleteComment({ id });\n\n await onCommentAfterDelete.publish({ comment });\n\n return true;\n }\n };\n}\n"],"mappings":";;;;;;AAAA,IAAAA,OAAA,GAAAC,OAAA;AAYO,SAASC,oBAAoBA,CAAC;EAAEC;AAAmC,CAAC,EAAkB;EACzF;EACA,MAAMC,qBAAqB,GAAG,IAAAC,mBAAW,EACrC,2BACJ,CAAC;EACD,MAAMC,oBAAoB,GAAG,IAAAD,mBAAW,EACpC,0BACJ,CAAC;EACD;EACA,MAAME,qBAAqB,GAAG,IAAAF,mBAAW,EACrC,2BACJ,CAAC;EACD,MAAMG,oBAAoB,GAAG,IAAAH,mBAAW,EACpC,0BACJ,CAAC;EACD;EACA,MAAMI,qBAAqB,GAAG,IAAAJ,mBAAW,EACrC,2BACJ,CAAC;EACD,MAAMK,oBAAoB,GAAG,IAAAL,mBAAW,EACpC,0BACJ,CAAC;EAED,OAAO;IACH;AACR;AACA;IACQD,qBAAqB;IACrBE,oBAAoB;IACpBC,qBAAqB;IACrBC,oBAAoB;IACpBC,qBAAqB;IACrBC,oBAAoB;IACpB,MAAMC,GAAGA,CAACC,EAAE,EAAE;MACV,OAAOT,iBAAiB,CAACU,UAAU,CAAC;QAAED;MAAG,CAAC,CAAC;IAC/C,CAAC;IACD,MAAME,IAAIA,CAACC,MAAM,EAAE;MACf,OAAOZ,iBAAiB,CAACa,YAAY,CAACD,MAAM,CAAC;IACjD,CAAC;IACD,MAAME,MAAMA,CAACC,IAAI,EAAE;MACf,MAAMd,qBAAqB,CAACe,OAAO,CAAC;QAAEC,KAAK,EAAEF;MAAK,CAAC,CAAC;MAEpD,MAAMG,OAAO,GAAG,MAAMlB,iBAAiB,CAACmB,aAAa,CAAC;QAClDJ;MACJ,CAAC,CAAC;MACF,MAAMZ,oBAAoB,CAACa,OAAO,CAAC;QAAEE;MAAQ,CAAC,CAAC;MAE/C,OAAOA,OAAO;IAClB,CAAC;IACD,MAAME,MAAMA,CAACX,EAAE,EAAEM,IAAI,EAAE;MACnB,MAAMM,QAAQ,GAAG,MAAMrB,iBAAiB,CAACU,UAAU,CAAC;QAAED;MAAG,CAAC,CAAC;MAE3D,MAAML,qBAAqB,CAACY,OAAO,CAAC;QAAEK,QAAQ;QAAEJ,KAAK,EAAE;UAAER,EAAE;UAAEM;QAAK;MAAE,CAAC,CAAC;MAEtE,MAAMG,OAAO,GAAG,MAAMlB,iBAAiB,CAACsB,aAAa,CAAC;QAAEb,EAAE;QAAEM;MAAK,CAAC,CAAC;MAEnE,MAAMV,oBAAoB,CAACW,OAAO,CAAC;QAAEK,QAAQ;QAAEH,OAAO;QAAED,KAAK,EAAE;UAAER,EAAE;UAAEM;QAAK;MAAE,CAAC,CAAC;MAE9E,OAAOG,OAAO;IAClB,CAAC;IACD,MAAMK,MAAMA,CAACd,EAAU,EAAE;MACrB,MAAMS,OAAO,GAAG,MAAMlB,iBAAiB,CAACU,UAAU,CAAC;QAAED;MAAG,CAAC,CAAC;MAE1D,MAAMH,qBAAqB,CAACU,OAAO,CAAC;QAAEE;MAAQ,CAAC,CAAC;MAEhD,MAAMlB,iBAAiB,CAACwB,aAAa,CAAC;QAAEf;MAAG,CAAC,CAAC;MAE7C,MAAMF,oBAAoB,CAACS,OAAO,CAAC;QAAEE;MAAQ,CAAC,CAAC;MAE/C,OAAO,IAAI;IACf;EACJ,CAAC;AACL"}
|
@@ -5,7 +5,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
value: true
|
6
6
|
});
|
7
7
|
exports.createContentReviewMethods = createContentReviewMethods;
|
8
|
-
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
|
9
8
|
var _get = _interopRequireDefault(require("lodash/get"));
|
10
9
|
var _pubsub = require("@webiny/pubsub");
|
11
10
|
var _error = _interopRequireDefault(require("@webiny/error"));
|
@@ -64,22 +63,25 @@ function createContentReviewMethods(params) {
|
|
64
63
|
});
|
65
64
|
if (where.reviewStatus === "requiresMyAttention") {
|
66
65
|
return (0, _utils2.filterContentReviewsByRequiresMyAttention)({
|
67
|
-
listParams:
|
66
|
+
listParams: {
|
67
|
+
...params,
|
68
68
|
where
|
69
|
-
}
|
69
|
+
},
|
70
70
|
listContentReviews: storageOperations.listContentReviews,
|
71
71
|
getReviewer,
|
72
72
|
getIdentity
|
73
73
|
});
|
74
74
|
}
|
75
|
-
return storageOperations.listContentReviews(
|
75
|
+
return storageOperations.listContentReviews({
|
76
|
+
...params,
|
76
77
|
where
|
77
|
-
})
|
78
|
+
});
|
78
79
|
},
|
79
80
|
async create(data) {
|
80
|
-
const input =
|
81
|
+
const input = {
|
82
|
+
...data,
|
81
83
|
reviewStatus: _types.ApwContentReviewStatus.UNDER_REVIEW
|
82
|
-
}
|
84
|
+
};
|
83
85
|
await onContentReviewBeforeCreate.publish({
|
84
86
|
input
|
85
87
|
});
|
@@ -202,11 +204,12 @@ function createContentReviewMethods(params) {
|
|
202
204
|
const updatedSteps = steps.map((step, index) => {
|
203
205
|
if (index === stepIndex) {
|
204
206
|
previousStepStatus = _types.ApwContentReviewStepStatus.DONE;
|
205
|
-
return
|
207
|
+
return {
|
208
|
+
...step,
|
206
209
|
status: _types.ApwContentReviewStepStatus.DONE,
|
207
210
|
signOffProvidedOn: new Date().toISOString(),
|
208
211
|
signOffProvidedBy: identity
|
209
|
-
}
|
212
|
+
};
|
210
213
|
}
|
211
214
|
/**
|
212
215
|
* Update next steps status based on type.
|
@@ -214,9 +217,10 @@ function createContentReviewMethods(params) {
|
|
214
217
|
if (index > stepIndex) {
|
215
218
|
const previousStep = steps[index - 1];
|
216
219
|
previousStepStatus = (0, _utils.getNextStepStatus)(previousStep.type, previousStepStatus);
|
217
|
-
return
|
220
|
+
return {
|
221
|
+
...step,
|
218
222
|
status: previousStepStatus
|
219
|
-
}
|
223
|
+
};
|
220
224
|
}
|
221
225
|
return step;
|
222
226
|
});
|
@@ -243,11 +247,12 @@ function createContentReviewMethods(params) {
|
|
243
247
|
return true;
|
244
248
|
},
|
245
249
|
async retractSignOff(id, stepId) {
|
246
|
-
const
|
250
|
+
const contentReview = await this.get(id);
|
247
251
|
const {
|
248
252
|
steps,
|
249
|
-
reviewStatus
|
250
|
-
|
253
|
+
reviewStatus,
|
254
|
+
content
|
255
|
+
} = contentReview;
|
251
256
|
const stepIndex = steps.findIndex(step => step.id === stepId);
|
252
257
|
const currentStep = steps[stepIndex];
|
253
258
|
const identity = getIdentity();
|
@@ -262,7 +267,7 @@ function createContentReviewMethods(params) {
|
|
262
267
|
*/
|
263
268
|
if (!hasPermission) {
|
264
269
|
throw new _errors.NotAuthorizedError({
|
265
|
-
entry,
|
270
|
+
entry: contentReview,
|
266
271
|
input: {
|
267
272
|
id,
|
268
273
|
step: stepId
|
@@ -274,7 +279,7 @@ function createContentReviewMethods(params) {
|
|
274
279
|
*/
|
275
280
|
if (currentStep.status !== _types.ApwContentReviewStepStatus.DONE) {
|
276
281
|
throw new _errors.NoSignOffProvidedError({
|
277
|
-
entry,
|
282
|
+
entry: contentReview,
|
278
283
|
input: {
|
279
284
|
id,
|
280
285
|
step: stepId
|
@@ -289,11 +294,12 @@ function createContentReviewMethods(params) {
|
|
289
294
|
const updatedSteps = steps.map((step, index) => {
|
290
295
|
if (index === stepIndex) {
|
291
296
|
previousStepStatus = _types.ApwContentReviewStepStatus.ACTIVE;
|
292
|
-
return
|
297
|
+
return {
|
298
|
+
...step,
|
293
299
|
status: previousStepStatus,
|
294
300
|
signOffProvidedOn: null,
|
295
301
|
signOffProvidedBy: null
|
296
|
-
}
|
302
|
+
};
|
297
303
|
}
|
298
304
|
/**
|
299
305
|
* Set next step status as "inactive".
|
@@ -301,9 +307,10 @@ function createContentReviewMethods(params) {
|
|
301
307
|
if (index > stepIndex) {
|
302
308
|
const previousStep = steps[index - 1];
|
303
309
|
previousStepStatus = (0, _utils.getNextStepStatus)(previousStep.type, previousStepStatus);
|
304
|
-
return
|
310
|
+
return {
|
311
|
+
...step,
|
305
312
|
status: previousStepStatus
|
306
|
-
}
|
313
|
+
};
|
307
314
|
}
|
308
315
|
return step;
|
309
316
|
});
|
@@ -319,7 +326,21 @@ function createContentReviewMethods(params) {
|
|
319
326
|
if (pendingRequiredSteps.length !== 0) {
|
320
327
|
newStatus = _types.ApwContentReviewStatus.UNDER_REVIEW;
|
321
328
|
}
|
329
|
+
|
330
|
+
/**
|
331
|
+
* We need to delete the scheduled action if one was created.
|
332
|
+
*/
|
333
|
+
const scheduledActionId = contentReview.content?.scheduledActionId;
|
334
|
+
if (!!scheduledActionId) {
|
335
|
+
await scheduler.delete(scheduledActionId);
|
336
|
+
}
|
322
337
|
await this.update(id, {
|
338
|
+
content: {
|
339
|
+
...content,
|
340
|
+
scheduledOn: null,
|
341
|
+
scheduledBy: null,
|
342
|
+
scheduledActionId: null
|
343
|
+
},
|
323
344
|
steps: updatedSteps,
|
324
345
|
reviewStatus: newStatus
|
325
346
|
});
|
@@ -347,7 +368,6 @@ function createContentReviewMethods(params) {
|
|
347
368
|
};
|
348
369
|
},
|
349
370
|
async publishContent(id, datetime) {
|
350
|
-
var _content$settings;
|
351
371
|
const {
|
352
372
|
content,
|
353
373
|
reviewStatus
|
@@ -379,7 +399,7 @@ function createContentReviewMethods(params) {
|
|
379
399
|
action: _types2.ApwScheduleActionTypes.PUBLISH,
|
380
400
|
type: content.type,
|
381
401
|
entryId: content.id,
|
382
|
-
modelId:
|
402
|
+
modelId: content.settings?.modelId,
|
383
403
|
datetime
|
384
404
|
};
|
385
405
|
const scheduledActionId = await this.scheduleAction(data);
|
@@ -387,16 +407,16 @@ function createContentReviewMethods(params) {
|
|
387
407
|
* Update scheduled related meta data.
|
388
408
|
*/
|
389
409
|
await this.update(id, {
|
390
|
-
content:
|
410
|
+
content: {
|
411
|
+
...content,
|
391
412
|
scheduledOn: datetime,
|
392
413
|
scheduledBy: identity.id,
|
393
414
|
scheduledActionId
|
394
|
-
}
|
415
|
+
}
|
395
416
|
});
|
396
417
|
return true;
|
397
418
|
},
|
398
419
|
async unpublishContent(id, datetime) {
|
399
|
-
var _content$settings2;
|
400
420
|
const {
|
401
421
|
content,
|
402
422
|
reviewStatus
|
@@ -428,18 +448,19 @@ function createContentReviewMethods(params) {
|
|
428
448
|
action: _types2.ApwScheduleActionTypes.UNPUBLISH,
|
429
449
|
type: content.type,
|
430
450
|
entryId: content.id,
|
431
|
-
modelId:
|
451
|
+
modelId: content.settings?.modelId,
|
432
452
|
datetime
|
433
453
|
});
|
434
454
|
/**
|
435
455
|
* Update scheduled related meta data.
|
436
456
|
*/
|
437
457
|
await this.update(id, {
|
438
|
-
content:
|
458
|
+
content: {
|
459
|
+
...content,
|
439
460
|
scheduledOn: datetime,
|
440
461
|
scheduledBy: identity.id,
|
441
462
|
scheduledActionId
|
442
|
-
}
|
463
|
+
}
|
443
464
|
});
|
444
465
|
return true;
|
445
466
|
},
|
@@ -490,9 +511,14 @@ function createContentReviewMethods(params) {
|
|
490
511
|
* Reset scheduled related meta data.
|
491
512
|
*/
|
492
513
|
await this.update(id, {
|
493
|
-
content:
|
514
|
+
content: {
|
515
|
+
...contentReview.content,
|
516
|
+
..._utils2.INITIAL_CONTENT_REVIEW_CONTENT_SCHEDULE_META
|
517
|
+
}
|
494
518
|
});
|
495
519
|
return true;
|
496
520
|
}
|
497
521
|
};
|
498
|
-
}
|
522
|
+
}
|
523
|
+
|
524
|
+
//# sourceMappingURL=createContentReviewMethods.js.map
|