@webiny/api-apw 0.0.0-unstable.df6d94b531 → 0.0.0-unstable.e53eceafb5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/ApwChangeRequestNotification.d.ts +1 -1
- package/ApwChangeRequestNotification.js +4 -6
- package/ApwChangeRequestNotification.js.map +1 -1
- package/ApwCommentNotification.d.ts +1 -1
- package/ApwCommentNotification.js +4 -6
- package/ApwCommentNotification.js.map +1 -1
- package/ApwContentReviewNotification.d.ts +1 -1
- package/ApwContentReviewNotification.js +4 -6
- package/ApwContentReviewNotification.js.map +1 -1
- package/ApwContentUrlPlugin.d.ts +1 -1
- package/ApwContentUrlPlugin.js +4 -6
- package/ApwContentUrlPlugin.js.map +1 -1
- package/ContentApwSettingsPlugin.d.ts +1 -1
- package/ContentApwSettingsPlugin.js +5 -4
- package/ContentApwSettingsPlugin.js.map +1 -1
- package/README.md +3 -3
- package/crud/createChangeRequestMethods.d.ts +1 -1
- package/crud/createChangeRequestMethods.js +3 -1
- package/crud/createChangeRequestMethods.js.map +1 -1
- package/crud/createCommentMethods.d.ts +1 -1
- package/crud/createCommentMethods.js +3 -1
- package/crud/createCommentMethods.js.map +1 -1
- package/crud/createContentReviewMethods.d.ts +2 -2
- package/crud/createContentReviewMethods.js +57 -32
- package/crud/createContentReviewMethods.js.map +1 -1
- package/crud/createReviewerMethods.d.ts +1 -1
- package/crud/createReviewerMethods.js +3 -1
- package/crud/createReviewerMethods.js.map +1 -1
- package/crud/createWorkflowMethods.d.ts +1 -1
- package/crud/createWorkflowMethods.js +3 -1
- package/crud/createWorkflowMethods.js.map +1 -1
- package/crud/index.d.ts +1 -1
- package/crud/index.js +6 -5
- package/crud/index.js.map +1 -1
- package/crud/utils.d.ts +2 -2
- package/crud/utils.js +8 -8
- package/crud/utils.js.map +1 -1
- package/index.d.ts +2 -2
- package/index.js +4 -3
- package/index.js.map +1 -1
- package/package.json +32 -50
- package/plugins/cms/CmsEntryApwSettingsGetterPlugin.d.ts +1 -1
- package/plugins/cms/CmsEntryApwSettingsGetterPlugin.js +5 -5
- package/plugins/cms/CmsEntryApwSettingsGetterPlugin.js.map +1 -1
- package/plugins/cms/apwEntryPlugins.d.ts +2 -2
- package/plugins/cms/apwEntryPlugins.js +19 -7
- package/plugins/cms/apwEntryPlugins.js.map +1 -1
- package/plugins/cms/index.d.ts +4 -4
- package/plugins/cms/index.js +3 -1
- package/plugins/cms/index.js.map +1 -1
- package/plugins/cms/linkContentReviewToEntry.d.ts +2 -2
- package/plugins/cms/linkContentReviewToEntry.js +5 -4
- package/plugins/cms/linkContentReviewToEntry.js.map +1 -1
- package/plugins/cms/linkWorkflowToEntry.d.ts +2 -2
- package/plugins/cms/linkWorkflowToEntry.js +17 -16
- 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.d.ts +2 -2
- package/plugins/cms/triggerContentReview.js +6 -5
- package/plugins/cms/triggerContentReview.js.map +1 -1
- package/plugins/cms/updateContentReviewStatus.d.ts +3 -3
- package/plugins/cms/updateContentReviewStatus.js +15 -13
- package/plugins/cms/updateContentReviewStatus.js.map +1 -1
- package/plugins/cms/utils.d.ts +5 -4
- package/plugins/cms/utils.js +19 -13
- package/plugins/cms/utils.js.map +1 -1
- package/plugins/context.d.ts +2 -2
- package/plugins/context.js +3 -1
- package/plugins/context.js.map +1 -1
- package/plugins/graphql/changeRequest.gql.d.ts +1 -1
- package/plugins/graphql/changeRequest.gql.js +16 -13
- package/plugins/graphql/changeRequest.gql.js.map +1 -1
- package/plugins/graphql/comment.gql.d.ts +1 -1
- package/plugins/graphql/comment.gql.js +41 -36
- package/plugins/graphql/comment.gql.js.map +1 -1
- package/plugins/graphql/contentReview.gql.d.ts +1 -1
- package/plugins/graphql/contentReview.gql.js +23 -14
- package/plugins/graphql/contentReview.gql.js.map +1 -1
- package/plugins/graphql/reviewer.gql.d.ts +1 -1
- package/plugins/graphql/reviewer.gql.js +15 -13
- package/plugins/graphql/reviewer.gql.js.map +1 -1
- package/plugins/graphql/utils.d.ts +2 -0
- package/plugins/graphql/utils.js +10 -0
- package/plugins/graphql/utils.js.map +1 -0
- package/plugins/graphql/workflow.gql.d.ts +1 -1
- package/plugins/graphql/workflow.gql.js +15 -13
- package/plugins/graphql/workflow.gql.js.map +1 -1
- package/plugins/graphql.d.ts +1 -1
- package/plugins/graphql.js +3 -1
- package/plugins/graphql.js.map +1 -1
- package/plugins/hooks/createReviewerFromIdentity.d.ts +1 -1
- package/plugins/hooks/createReviewerFromIdentity.js +4 -2
- package/plugins/hooks/createReviewerFromIdentity.js.map +1 -1
- package/plugins/hooks/deleteChangeRequestsAfterContentReview.d.ts +1 -1
- package/plugins/hooks/deleteChangeRequestsAfterContentReview.js +3 -1
- package/plugins/hooks/deleteChangeRequestsAfterContentReview.js.map +1 -1
- package/plugins/hooks/deleteCommentsAfterChangeRequest.d.ts +1 -1
- package/plugins/hooks/deleteCommentsAfterChangeRequest.js +3 -1
- package/plugins/hooks/deleteCommentsAfterChangeRequest.js.map +1 -1
- package/plugins/hooks/index.d.ts +1 -1
- package/plugins/hooks/index.js +3 -1
- package/plugins/hooks/index.js.map +1 -1
- package/plugins/hooks/initializeContentReviewSteps.d.ts +1 -1
- package/plugins/hooks/initializeContentReviewSteps.js +6 -4
- package/plugins/hooks/initializeContentReviewSteps.js.map +1 -1
- package/plugins/hooks/initializeNotifications.d.ts +1 -1
- package/plugins/hooks/initializeNotifications.js +3 -1
- package/plugins/hooks/initializeNotifications.js.map +1 -1
- package/plugins/hooks/listContentReviews.d.ts +3 -3
- package/plugins/hooks/listContentReviews.js +4 -2
- package/plugins/hooks/listContentReviews.js.map +1 -1
- package/plugins/hooks/notifications/changeRequestAfterCreate.d.ts +1 -1
- package/plugins/hooks/notifications/changeRequestAfterCreate.js +8 -11
- 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.d.ts +1 -1
- package/plugins/hooks/notifications/commentAfterCreate.js +8 -11
- 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.d.ts +1 -1
- package/plugins/hooks/notifications/contentReviewAfterCreate.js +9 -12
- 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.d.ts +2 -2
- package/plugins/hooks/notifications/contentUrl.js +3 -1
- package/plugins/hooks/notifications/contentUrl.js.map +1 -1
- package/plugins/hooks/notifications/getAppUrl.d.ts +2 -0
- package/plugins/hooks/notifications/getAppUrl.js +19 -0
- package/plugins/hooks/notifications/getAppUrl.js.map +1 -0
- package/plugins/hooks/notifications/lastChangeRequestNotificationPlugin.d.ts +1 -1
- package/plugins/hooks/notifications/lastChangeRequestNotificationPlugin.js +3 -1
- package/plugins/hooks/notifications/lastChangeRequestNotificationPlugin.js.map +1 -1
- package/plugins/hooks/notifications/lastCommentNotificationPlugin.d.ts +1 -1
- package/plugins/hooks/notifications/lastCommentNotificationPlugin.js +3 -1
- package/plugins/hooks/notifications/lastCommentNotificationPlugin.js.map +1 -1
- package/plugins/hooks/notifications/lastContentReviewNotificationPlugin.d.ts +1 -1
- package/plugins/hooks/notifications/lastContentReviewNotificationPlugin.js +3 -1
- package/plugins/hooks/notifications/lastContentReviewNotificationPlugin.js.map +1 -1
- package/plugins/hooks/notifications/reviewers.d.ts +1 -1
- package/plugins/hooks/notifications/reviewers.js +18 -15
- package/plugins/hooks/notifications/reviewers.js.map +1 -1
- package/plugins/hooks/notifications/sendChangeRequestNotification.d.ts +1 -1
- package/plugins/hooks/notifications/sendChangeRequestNotification.js +3 -1
- package/plugins/hooks/notifications/sendChangeRequestNotification.js.map +1 -1
- package/plugins/hooks/notifications/sendCommentNotification.d.ts +1 -1
- package/plugins/hooks/notifications/sendCommentNotification.js +3 -1
- package/plugins/hooks/notifications/sendCommentNotification.js.map +1 -1
- package/plugins/hooks/notifications/sendContentReviewNotification.d.ts +1 -1
- package/plugins/hooks/notifications/sendContentReviewNotification.js +3 -1
- package/plugins/hooks/notifications/sendContentReviewNotification.js.map +1 -1
- package/plugins/hooks/updatePendingChangeRequests.d.ts +1 -1
- package/plugins/hooks/updatePendingChangeRequests.js +8 -6
- package/plugins/hooks/updatePendingChangeRequests.js.map +1 -1
- package/plugins/hooks/updateTotalComments.d.ts +1 -1
- package/plugins/hooks/updateTotalComments.js +22 -15
- package/plugins/hooks/updateTotalComments.js.map +1 -1
- package/plugins/hooks/validateChangeRequest.d.ts +1 -1
- package/plugins/hooks/validateChangeRequest.js +3 -1
- package/plugins/hooks/validateChangeRequest.js.map +1 -1
- package/plugins/hooks/validateComment.d.ts +1 -1
- package/plugins/hooks/validateComment.js +3 -1
- package/plugins/hooks/validateComment.js.map +1 -1
- package/plugins/hooks/validateContentReview.d.ts +1 -1
- package/plugins/hooks/validateContentReview.js +3 -1
- package/plugins/hooks/validateContentReview.js.map +1 -1
- package/plugins/pageBuilder/PageApwSettingsGetterPlugin.d.ts +2 -1
- package/plugins/pageBuilder/PageApwSettingsGetterPlugin.js +5 -5
- package/plugins/pageBuilder/PageApwSettingsGetterPlugin.js.map +1 -1
- package/plugins/pageBuilder/apwContentPagePlugins.d.ts +1 -1
- package/plugins/pageBuilder/apwContentPagePlugins.js +3 -1
- package/plugins/pageBuilder/apwContentPagePlugins.js.map +1 -1
- package/plugins/pageBuilder/extendPbPageSettingsSchema.d.ts +1 -1
- package/plugins/pageBuilder/extendPbPageSettingsSchema.js +3 -1
- package/plugins/pageBuilder/extendPbPageSettingsSchema.js.map +1 -1
- package/plugins/pageBuilder/index.d.ts +4 -4
- package/plugins/pageBuilder/index.js +3 -1
- package/plugins/pageBuilder/index.js.map +1 -1
- package/plugins/pageBuilder/linkContentReviewToPage.d.ts +2 -2
- package/plugins/pageBuilder/linkContentReviewToPage.js +16 -12
- package/plugins/pageBuilder/linkContentReviewToPage.js.map +1 -1
- package/plugins/pageBuilder/linkWorkflowToPage.d.ts +2 -2
- package/plugins/pageBuilder/linkWorkflowToPage.js +13 -12
- 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.d.ts +2 -2
- package/plugins/pageBuilder/triggerContentReview.js +5 -4
- package/plugins/pageBuilder/triggerContentReview.js.map +1 -1
- package/plugins/pageBuilder/updateContentReviewStatus.d.ts +3 -3
- package/plugins/pageBuilder/updateContentReviewStatus.js +13 -10
- package/plugins/pageBuilder/updateContentReviewStatus.js.map +1 -1
- package/plugins/pageBuilder/utils.d.ts +4 -4
- package/plugins/pageBuilder/utils.js +7 -6
- package/plugins/pageBuilder/utils.js.map +1 -1
- package/plugins/utils.d.ts +7 -6
- package/plugins/utils.js +12 -8
- package/plugins/utils.js.map +1 -1
- package/scheduler/createScheduleActionMethods.d.ts +1 -1
- package/scheduler/createScheduleActionMethods.js +105 -66
- package/scheduler/createScheduleActionMethods.js.map +1 -1
- package/scheduler/handlers/executeAction/index.d.ts +2 -2
- package/scheduler/handlers/executeAction/index.js +5 -5
- 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.d.ts +2 -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.d.ts +3 -2
- package/scheduler/handlers/executeAction/plugins/PageBuilderGraphQL.js +4 -7
- package/scheduler/handlers/executeAction/plugins/PageBuilderGraphQL.js.map +1 -1
- package/scheduler/handlers/executeAction/security.d.ts +2 -2
- package/scheduler/handlers/executeAction/security.js +3 -1
- package/scheduler/handlers/executeAction/security.js.map +1 -1
- package/scheduler/handlers/scheduleAction/index.d.ts +2 -2
- package/scheduler/handlers/scheduleAction/index.js +15 -14
- package/scheduler/handlers/scheduleAction/index.js.map +1 -1
- package/scheduler/handlers/scheduleAction/scheduleAction.utils.d.ts +3 -3
- 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 +20 -13
- package/scheduler/handlers/utils.js.map +1 -1
- package/scheduler/index.d.ts +1 -1
- package/scheduler/index.js +3 -1
- package/scheduler/index.js.map +1 -1
- package/scheduler/types.d.ts +19 -17
- package/scheduler/types.js +11 -12
- package/scheduler/types.js.map +1 -1
- package/storageOperations/changeRequestStorageOperations.d.ts +2 -2
- package/storageOperations/changeRequestStorageOperations.js +44 -23
- package/storageOperations/changeRequestStorageOperations.js.map +1 -1
- package/storageOperations/commentStorageOperations.d.ts +3 -3
- package/storageOperations/commentStorageOperations.js +17 -24
- package/storageOperations/commentStorageOperations.js.map +1 -1
- package/storageOperations/contentReviewStorageOperations.d.ts +3 -3
- package/storageOperations/contentReviewStorageOperations.js +20 -25
- package/storageOperations/contentReviewStorageOperations.js.map +1 -1
- package/storageOperations/index.d.ts +3 -9
- 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 +10 -11
- package/storageOperations/models/changeRequest.model.js.map +1 -1
- package/storageOperations/models/comment.model.d.ts +1 -2
- package/storageOperations/models/comment.model.js +10 -11
- package/storageOperations/models/comment.model.js.map +1 -1
- package/storageOperations/models/contentReview.model.d.ts +1 -2
- package/storageOperations/models/contentReview.model.js +16 -15
- package/storageOperations/models/contentReview.model.js.map +1 -1
- package/storageOperations/models/index.d.ts +1 -1
- package/storageOperations/models/index.js +11 -31
- package/storageOperations/models/index.js.map +1 -1
- package/storageOperations/models/reviewer.model.d.ts +1 -2
- package/storageOperations/models/reviewer.model.js +11 -12
- package/storageOperations/models/reviewer.model.js.map +1 -1
- package/storageOperations/models/utils.d.ts +2 -2
- package/storageOperations/models/utils.js +3 -1
- package/storageOperations/models/utils.js.map +1 -1
- package/storageOperations/models/workflow.model.d.ts +2 -3
- package/storageOperations/models/workflow.model.js +22 -23
- package/storageOperations/models/workflow.model.js.map +1 -1
- package/storageOperations/reviewerStorageOperations.d.ts +3 -3
- package/storageOperations/reviewerStorageOperations.js +24 -34
- package/storageOperations/reviewerStorageOperations.js.map +1 -1
- package/storageOperations/types.d.ts +2 -2
- package/storageOperations/types.js +3 -1
- package/storageOperations/types.js.map +1 -1
- package/storageOperations/workflowStorageOperations.d.ts +2 -2
- package/storageOperations/workflowStorageOperations.js +25 -28
- package/storageOperations/workflowStorageOperations.js.map +1 -1
- package/types.d.ts +51 -52
- package/types.js +121 -29
- package/types.js.map +1 -1
- package/utils/contentApwSettingsPlugin.d.ts +2 -2
- 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.d.ts +2 -2
- package/utils/fieldResolver.js +7 -7
- package/utils/fieldResolver.js.map +1 -1
- package/utils/pickEntryFieldValues.d.ts +3 -0
- package/utils/pickEntryFieldValues.js +30 -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/plugins/hooks/notifications/appUrl.d.ts +0 -2
- package/plugins/hooks/notifications/appUrl.js +0 -18
- package/plugins/hooks/notifications/appUrl.js.map +0 -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,5 +1,5 @@
|
|
1
1
|
import { Plugin } from "@webiny/plugins";
|
2
|
-
import { ApwChangeRequest, ApwContentReview, ApwContentTypes, ApwContext, ApwReviewerWithEmail, ApwWorkflow } from "./types";
|
2
|
+
import type { ApwChangeRequest, ApwContentReview, ApwContentTypes, ApwContext, ApwReviewerWithEmail, ApwWorkflow } from "./types";
|
3
3
|
export interface ApwChangeRequestNotificationCbParams {
|
4
4
|
context: ApwContext;
|
5
5
|
reviewers: ApwReviewerWithEmail[];
|
@@ -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 type {\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","ignoreList":[]}
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import { Plugin } from "@webiny/plugins";
|
2
|
-
import { ApwChangeRequest, ApwContentReview, ApwContentTypes, ApwContext, ApwReviewerWithEmail, ApwWorkflow } from "./types";
|
2
|
+
import type { ApwChangeRequest, ApwContentReview, ApwContentTypes, ApwContext, ApwReviewerWithEmail, ApwWorkflow } from "./types";
|
3
3
|
export interface ApwCommentNotificationCbParams {
|
4
4
|
context: ApwContext;
|
5
5
|
reviewers: ApwReviewerWithEmail[];
|
@@ -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 type {\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","ignoreList":[]}
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import { Plugin } from "@webiny/plugins";
|
2
|
-
import { ApwContentReview, ApwContentTypes, ApwContext, ApwReviewerWithEmail, ApwWorkflow } from "./types";
|
2
|
+
import type { ApwContentReview, ApwContentTypes, ApwContext, ApwReviewerWithEmail, ApwWorkflow } from "./types";
|
3
3
|
export interface ApwContentReviewNotificationCbParams {
|
4
4
|
context: ApwContext;
|
5
5
|
reviewers: ApwReviewerWithEmail[];
|
@@ -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 type {\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","ignoreList":[]}
|
package/ApwContentUrlPlugin.d.ts
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
import { Plugin } from "@webiny/plugins";
|
2
|
-
import { ApwContentReview, ApwContentTypes, ApwWorkflow } from "./types";
|
2
|
+
import type { ApwContentReview, ApwContentTypes, ApwWorkflow } from "./types";
|
3
3
|
export interface ApwContentUrlPluginCbParams {
|
4
4
|
baseUrl: string;
|
5
5
|
contentReview: ApwContentReview;
|
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 type { 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","ignoreList":[]}
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import { Plugin } from "@webiny/plugins/Plugin";
|
2
|
-
import { ApwContentTypes } from "./types";
|
2
|
+
import type { ApwContentTypes } from "./types";
|
3
3
|
export declare abstract class ContentApwSettingsPlugin extends Plugin {
|
4
4
|
static type: string;
|
5
5
|
abstract canUse(type: ApwContentTypes): boolean;
|
@@ -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 type { 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","ignoreList":[]}
|
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,2 +1,2 @@
|
|
1
|
-
import { ApwChangeRequestCrud, CreateApwParams } from "../types";
|
1
|
+
import type { ApwChangeRequestCrud, CreateApwParams } from "../types";
|
2
2
|
export declare function createChangeRequestMethods({ storageOperations }: CreateApwParams): ApwChangeRequestCrud;
|
@@ -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 type {\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","ignoreList":[]}
|
@@ -1,2 +1,2 @@
|
|
1
|
-
import { ApwCommentCrud, CreateApwParams } from "../types";
|
1
|
+
import type { ApwCommentCrud, CreateApwParams } from "../types";
|
2
2
|
export declare function createCommentMethods({ storageOperations }: CreateApwParams): ApwCommentCrud;
|
@@ -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 type {\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","ignoreList":[]}
|
@@ -1,5 +1,5 @@
|
|
1
|
-
import { AdvancedPublishingWorkflow, ApwContentReviewCrud, ApwReviewerCrud, CreateApwParams } from "../types";
|
2
|
-
import { PluginsContainer } from "@webiny/plugins";
|
1
|
+
import type { AdvancedPublishingWorkflow, ApwContentReviewCrud, ApwReviewerCrud, CreateApwParams } from "../types";
|
2
|
+
import type { PluginsContainer } from "@webiny/plugins";
|
3
3
|
export interface CreateContentReviewMethodsParams extends CreateApwParams {
|
4
4
|
getReviewer: ApwReviewerCrud["get"];
|
5
5
|
getContentGetter: AdvancedPublishingWorkflow["getContentGetter"];
|
@@ -5,8 +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
|
-
var _get = _interopRequireDefault(require("lodash/get"));
|
10
8
|
var _pubsub = require("@webiny/pubsub");
|
11
9
|
var _error = _interopRequireDefault(require("@webiny/error"));
|
12
10
|
var _types = require("../types");
|
@@ -64,22 +62,25 @@ function createContentReviewMethods(params) {
|
|
64
62
|
});
|
65
63
|
if (where.reviewStatus === "requiresMyAttention") {
|
66
64
|
return (0, _utils2.filterContentReviewsByRequiresMyAttention)({
|
67
|
-
listParams:
|
65
|
+
listParams: {
|
66
|
+
...params,
|
68
67
|
where
|
69
|
-
}
|
68
|
+
},
|
70
69
|
listContentReviews: storageOperations.listContentReviews,
|
71
70
|
getReviewer,
|
72
71
|
getIdentity
|
73
72
|
});
|
74
73
|
}
|
75
|
-
return storageOperations.listContentReviews(
|
74
|
+
return storageOperations.listContentReviews({
|
75
|
+
...params,
|
76
76
|
where
|
77
|
-
})
|
77
|
+
});
|
78
78
|
},
|
79
79
|
async create(data) {
|
80
|
-
const input =
|
80
|
+
const input = {
|
81
|
+
...data,
|
81
82
|
reviewStatus: _types.ApwContentReviewStatus.UNDER_REVIEW
|
82
|
-
}
|
83
|
+
};
|
83
84
|
await onContentReviewBeforeCreate.publish({
|
84
85
|
input
|
85
86
|
});
|
@@ -202,11 +203,12 @@ function createContentReviewMethods(params) {
|
|
202
203
|
const updatedSteps = steps.map((step, index) => {
|
203
204
|
if (index === stepIndex) {
|
204
205
|
previousStepStatus = _types.ApwContentReviewStepStatus.DONE;
|
205
|
-
return
|
206
|
+
return {
|
207
|
+
...step,
|
206
208
|
status: _types.ApwContentReviewStepStatus.DONE,
|
207
209
|
signOffProvidedOn: new Date().toISOString(),
|
208
210
|
signOffProvidedBy: identity
|
209
|
-
}
|
211
|
+
};
|
210
212
|
}
|
211
213
|
/**
|
212
214
|
* Update next steps status based on type.
|
@@ -214,9 +216,10 @@ function createContentReviewMethods(params) {
|
|
214
216
|
if (index > stepIndex) {
|
215
217
|
const previousStep = steps[index - 1];
|
216
218
|
previousStepStatus = (0, _utils.getNextStepStatus)(previousStep.type, previousStepStatus);
|
217
|
-
return
|
219
|
+
return {
|
220
|
+
...step,
|
218
221
|
status: previousStepStatus
|
219
|
-
}
|
222
|
+
};
|
220
223
|
}
|
221
224
|
return step;
|
222
225
|
});
|
@@ -243,11 +246,12 @@ function createContentReviewMethods(params) {
|
|
243
246
|
return true;
|
244
247
|
},
|
245
248
|
async retractSignOff(id, stepId) {
|
246
|
-
const
|
249
|
+
const contentReview = await this.get(id);
|
247
250
|
const {
|
248
251
|
steps,
|
249
|
-
reviewStatus
|
250
|
-
|
252
|
+
reviewStatus,
|
253
|
+
content
|
254
|
+
} = contentReview;
|
251
255
|
const stepIndex = steps.findIndex(step => step.id === stepId);
|
252
256
|
const currentStep = steps[stepIndex];
|
253
257
|
const identity = getIdentity();
|
@@ -262,7 +266,7 @@ function createContentReviewMethods(params) {
|
|
262
266
|
*/
|
263
267
|
if (!hasPermission) {
|
264
268
|
throw new _errors.NotAuthorizedError({
|
265
|
-
entry,
|
269
|
+
entry: contentReview,
|
266
270
|
input: {
|
267
271
|
id,
|
268
272
|
step: stepId
|
@@ -274,7 +278,7 @@ function createContentReviewMethods(params) {
|
|
274
278
|
*/
|
275
279
|
if (currentStep.status !== _types.ApwContentReviewStepStatus.DONE) {
|
276
280
|
throw new _errors.NoSignOffProvidedError({
|
277
|
-
entry,
|
281
|
+
entry: contentReview,
|
278
282
|
input: {
|
279
283
|
id,
|
280
284
|
step: stepId
|
@@ -289,11 +293,12 @@ function createContentReviewMethods(params) {
|
|
289
293
|
const updatedSteps = steps.map((step, index) => {
|
290
294
|
if (index === stepIndex) {
|
291
295
|
previousStepStatus = _types.ApwContentReviewStepStatus.ACTIVE;
|
292
|
-
return
|
296
|
+
return {
|
297
|
+
...step,
|
293
298
|
status: previousStepStatus,
|
294
299
|
signOffProvidedOn: null,
|
295
300
|
signOffProvidedBy: null
|
296
|
-
}
|
301
|
+
};
|
297
302
|
}
|
298
303
|
/**
|
299
304
|
* Set next step status as "inactive".
|
@@ -301,9 +306,10 @@ function createContentReviewMethods(params) {
|
|
301
306
|
if (index > stepIndex) {
|
302
307
|
const previousStep = steps[index - 1];
|
303
308
|
previousStepStatus = (0, _utils.getNextStepStatus)(previousStep.type, previousStepStatus);
|
304
|
-
return
|
309
|
+
return {
|
310
|
+
...step,
|
305
311
|
status: previousStepStatus
|
306
|
-
}
|
312
|
+
};
|
307
313
|
}
|
308
314
|
return step;
|
309
315
|
});
|
@@ -319,7 +325,21 @@ function createContentReviewMethods(params) {
|
|
319
325
|
if (pendingRequiredSteps.length !== 0) {
|
320
326
|
newStatus = _types.ApwContentReviewStatus.UNDER_REVIEW;
|
321
327
|
}
|
328
|
+
|
329
|
+
/**
|
330
|
+
* We need to delete the scheduled action if one was created.
|
331
|
+
*/
|
332
|
+
const scheduledActionId = contentReview.content?.scheduledActionId;
|
333
|
+
if (!!scheduledActionId) {
|
334
|
+
await scheduler.delete(scheduledActionId);
|
335
|
+
}
|
322
336
|
await this.update(id, {
|
337
|
+
content: {
|
338
|
+
...content,
|
339
|
+
scheduledOn: null,
|
340
|
+
scheduledBy: null,
|
341
|
+
scheduledActionId: null
|
342
|
+
},
|
323
343
|
steps: updatedSteps,
|
324
344
|
reviewStatus: newStatus
|
325
345
|
});
|
@@ -347,7 +367,6 @@ function createContentReviewMethods(params) {
|
|
347
367
|
};
|
348
368
|
},
|
349
369
|
async publishContent(id, datetime) {
|
350
|
-
var _content$settings;
|
351
370
|
const {
|
352
371
|
content,
|
353
372
|
reviewStatus
|
@@ -379,7 +398,7 @@ function createContentReviewMethods(params) {
|
|
379
398
|
action: _types2.ApwScheduleActionTypes.PUBLISH,
|
380
399
|
type: content.type,
|
381
400
|
entryId: content.id,
|
382
|
-
modelId:
|
401
|
+
modelId: content.settings?.modelId,
|
383
402
|
datetime
|
384
403
|
};
|
385
404
|
const scheduledActionId = await this.scheduleAction(data);
|
@@ -387,16 +406,16 @@ function createContentReviewMethods(params) {
|
|
387
406
|
* Update scheduled related meta data.
|
388
407
|
*/
|
389
408
|
await this.update(id, {
|
390
|
-
content:
|
409
|
+
content: {
|
410
|
+
...content,
|
391
411
|
scheduledOn: datetime,
|
392
412
|
scheduledBy: identity.id,
|
393
413
|
scheduledActionId
|
394
|
-
}
|
414
|
+
}
|
395
415
|
});
|
396
416
|
return true;
|
397
417
|
},
|
398
418
|
async unpublishContent(id, datetime) {
|
399
|
-
var _content$settings2;
|
400
419
|
const {
|
401
420
|
content,
|
402
421
|
reviewStatus
|
@@ -428,18 +447,19 @@ function createContentReviewMethods(params) {
|
|
428
447
|
action: _types2.ApwScheduleActionTypes.UNPUBLISH,
|
429
448
|
type: content.type,
|
430
449
|
entryId: content.id,
|
431
|
-
modelId:
|
450
|
+
modelId: content.settings?.modelId,
|
432
451
|
datetime
|
433
452
|
});
|
434
453
|
/**
|
435
454
|
* Update scheduled related meta data.
|
436
455
|
*/
|
437
456
|
await this.update(id, {
|
438
|
-
content:
|
457
|
+
content: {
|
458
|
+
...content,
|
439
459
|
scheduledOn: datetime,
|
440
460
|
scheduledBy: identity.id,
|
441
461
|
scheduledActionId
|
442
|
-
}
|
462
|
+
}
|
443
463
|
});
|
444
464
|
return true;
|
445
465
|
},
|
@@ -467,7 +487,7 @@ function createContentReviewMethods(params) {
|
|
467
487
|
},
|
468
488
|
async deleteScheduledAction(id) {
|
469
489
|
const contentReview = await this.get(id);
|
470
|
-
const scheduledActionId =
|
490
|
+
const scheduledActionId = contentReview.content?.scheduledActionId;
|
471
491
|
|
472
492
|
/**
|
473
493
|
* Check if there is any action scheduled for this "content review".
|
@@ -490,9 +510,14 @@ function createContentReviewMethods(params) {
|
|
490
510
|
* Reset scheduled related meta data.
|
491
511
|
*/
|
492
512
|
await this.update(id, {
|
493
|
-
content:
|
513
|
+
content: {
|
514
|
+
...contentReview.content,
|
515
|
+
..._utils2.INITIAL_CONTENT_REVIEW_CONTENT_SCHEDULE_META
|
516
|
+
}
|
494
517
|
});
|
495
518
|
return true;
|
496
519
|
}
|
497
520
|
};
|
498
|
-
}
|
521
|
+
}
|
522
|
+
|
523
|
+
//# sourceMappingURL=createContentReviewMethods.js.map
|