@webiny/api-apw 0.0.0-ee-vpcs.549378cf03
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/ApwChangeRequestNotification.d.ts +27 -0
- package/ApwChangeRequestNotification.js +40 -0
- package/ApwChangeRequestNotification.js.map +1 -0
- package/ApwCommentNotification.d.ts +27 -0
- package/ApwCommentNotification.js +40 -0
- package/ApwCommentNotification.js.map +1 -0
- package/ApwContentReviewNotification.d.ts +26 -0
- package/ApwContentReviewNotification.js +40 -0
- package/ApwContentReviewNotification.js.map +1 -0
- package/ApwContentUrlPlugin.d.ts +19 -0
- package/ApwContentUrlPlugin.js +40 -0
- package/ApwContentUrlPlugin.js.map +1 -0
- package/ContentApwSettingsPlugin.d.ts +10 -0
- package/ContentApwSettingsPlugin.js +17 -0
- package/ContentApwSettingsPlugin.js.map +1 -0
- package/LICENSE +21 -0
- package/README.md +34 -0
- package/crud/createChangeRequestMethods.d.ts +2 -0
- package/crud/createChangeRequestMethods.js +98 -0
- package/crud/createChangeRequestMethods.js.map +1 -0
- package/crud/createCommentMethods.d.ts +2 -0
- package/crud/createCommentMethods.js +99 -0
- package/crud/createCommentMethods.js.map +1 -0
- package/crud/createContentReviewMethods.d.ts +10 -0
- package/crud/createContentReviewMethods.js +562 -0
- package/crud/createContentReviewMethods.js.map +1 -0
- package/crud/createReviewerMethods.d.ts +2 -0
- package/crud/createReviewerMethods.js +99 -0
- package/crud/createReviewerMethods.js.map +1 -0
- package/crud/createWorkflowMethods.d.ts +2 -0
- package/crud/createWorkflowMethods.js +118 -0
- package/crud/createWorkflowMethods.js.map +1 -0
- package/crud/index.d.ts +2 -0
- package/crud/index.js +96 -0
- package/crud/index.js.map +1 -0
- package/crud/utils.d.ts +21 -0
- package/crud/utils.js +138 -0
- package/crud/utils.js.map +1 -0
- package/index.d.ts +4 -0
- package/index.js +38 -0
- package/index.js.map +1 -0
- package/package.json +76 -0
- package/plugins/cms/CmsEntryApwSettingsGetterPlugin.d.ts +10 -0
- package/plugins/cms/CmsEntryApwSettingsGetterPlugin.js +51 -0
- package/plugins/cms/CmsEntryApwSettingsGetterPlugin.js.map +1 -0
- package/plugins/cms/README.md +49 -0
- package/plugins/cms/apwEntryPlugins.d.ts +8 -0
- package/plugins/cms/apwEntryPlugins.js +46 -0
- package/plugins/cms/apwEntryPlugins.js.map +1 -0
- package/plugins/cms/index.d.ts +12 -0
- package/plugins/cms/index.js +45 -0
- package/plugins/cms/index.js.map +1 -0
- package/plugins/cms/linkContentReviewToEntry.d.ts +8 -0
- package/plugins/cms/linkContentReviewToEntry.js +108 -0
- package/plugins/cms/linkContentReviewToEntry.js.map +1 -0
- package/plugins/cms/linkWorkflowToEntry.d.ts +8 -0
- package/plugins/cms/linkWorkflowToEntry.js +166 -0
- package/plugins/cms/linkWorkflowToEntry.js.map +1 -0
- package/plugins/cms/notifications/changeRequestNotification.d.ts +1 -0
- package/plugins/cms/notifications/changeRequestNotification.js +35 -0
- package/plugins/cms/notifications/changeRequestNotification.js.map +1 -0
- package/plugins/cms/notifications/commentNotification.d.ts +1 -0
- package/plugins/cms/notifications/commentNotification.js +35 -0
- package/plugins/cms/notifications/commentNotification.js.map +1 -0
- package/plugins/cms/notifications/contentReviewNotification.d.ts +1 -0
- package/plugins/cms/notifications/contentReviewNotification.js +35 -0
- package/plugins/cms/notifications/contentReviewNotification.js.map +1 -0
- package/plugins/cms/notifications/contentUrl.d.ts +8 -0
- package/plugins/cms/notifications/contentUrl.js +60 -0
- package/plugins/cms/notifications/contentUrl.js.map +1 -0
- package/plugins/cms/triggerContentReview.d.ts +8 -0
- package/plugins/cms/triggerContentReview.js +59 -0
- package/plugins/cms/triggerContentReview.js.map +1 -0
- package/plugins/cms/updateContentReviewStatus.d.ts +10 -0
- package/plugins/cms/updateContentReviewStatus.js +97 -0
- package/plugins/cms/updateContentReviewStatus.js.map +1 -0
- package/plugins/cms/utils.d.ts +27 -0
- package/plugins/cms/utils.js +207 -0
- package/plugins/cms/utils.js.map +1 -0
- package/plugins/context.d.ts +5 -0
- package/plugins/context.js +146 -0
- package/plugins/context.js.map +1 -0
- package/plugins/graphql/changeRequest.gql.d.ts +4 -0
- package/plugins/graphql/changeRequest.gql.js +155 -0
- package/plugins/graphql/changeRequest.gql.js.map +1 -0
- package/plugins/graphql/comment.gql.d.ts +4 -0
- package/plugins/graphql/comment.gql.js +160 -0
- package/plugins/graphql/comment.gql.js.map +1 -0
- package/plugins/graphql/contentReview.gql.d.ts +4 -0
- package/plugins/graphql/contentReview.gql.js +382 -0
- package/plugins/graphql/contentReview.gql.js.map +1 -0
- package/plugins/graphql/reviewer.gql.d.ts +4 -0
- package/plugins/graphql/reviewer.gql.js +116 -0
- package/plugins/graphql/reviewer.gql.js.map +1 -0
- package/plugins/graphql/workflow.gql.d.ts +4 -0
- package/plugins/graphql/workflow.gql.js +205 -0
- package/plugins/graphql/workflow.gql.js.map +1 -0
- package/plugins/graphql.d.ts +4 -0
- package/plugins/graphql.js +95 -0
- package/plugins/graphql.js.map +1 -0
- package/plugins/hooks/createReviewerFromIdentity.d.ts +2 -0
- package/plugins/hooks/createReviewerFromIdentity.js +82 -0
- package/plugins/hooks/createReviewerFromIdentity.js.map +1 -0
- package/plugins/hooks/deleteChangeRequestsAfterContentReview.d.ts +2 -0
- package/plugins/hooks/deleteChangeRequestsAfterContentReview.js +67 -0
- package/plugins/hooks/deleteChangeRequestsAfterContentReview.js.map +1 -0
- package/plugins/hooks/deleteCommentsAfterChangeRequest.d.ts +2 -0
- package/plugins/hooks/deleteCommentsAfterChangeRequest.js +59 -0
- package/plugins/hooks/deleteCommentsAfterChangeRequest.js.map +1 -0
- package/plugins/hooks/index.d.ts +3 -0
- package/plugins/hooks/index.js +74 -0
- package/plugins/hooks/index.js.map +1 -0
- package/plugins/hooks/initializeContentReviewSteps.d.ts +2 -0
- package/plugins/hooks/initializeContentReviewSteps.js +86 -0
- package/plugins/hooks/initializeContentReviewSteps.js.map +1 -0
- package/plugins/hooks/initializeNotifications.d.ts +2 -0
- package/plugins/hooks/initializeNotifications.js +20 -0
- package/plugins/hooks/initializeNotifications.js.map +1 -0
- package/plugins/hooks/listContentReviews.d.ts +10 -0
- package/plugins/hooks/listContentReviews.js +68 -0
- package/plugins/hooks/listContentReviews.js.map +1 -0
- package/plugins/hooks/notifications/appUrl.d.ts +2 -0
- package/plugins/hooks/notifications/appUrl.js +22 -0
- package/plugins/hooks/notifications/appUrl.js.map +1 -0
- package/plugins/hooks/notifications/changeRequestAfterCreate.d.ts +2 -0
- package/plugins/hooks/notifications/changeRequestAfterCreate.js +144 -0
- package/plugins/hooks/notifications/changeRequestAfterCreate.js.map +1 -0
- package/plugins/hooks/notifications/changeRequestUrl.d.ts +8 -0
- package/plugins/hooks/notifications/changeRequestUrl.js +31 -0
- package/plugins/hooks/notifications/changeRequestUrl.js.map +1 -0
- package/plugins/hooks/notifications/commentAfterCreate.d.ts +2 -0
- package/plugins/hooks/notifications/commentAfterCreate.js +157 -0
- package/plugins/hooks/notifications/commentAfterCreate.js.map +1 -0
- package/plugins/hooks/notifications/commentUrl.d.ts +8 -0
- package/plugins/hooks/notifications/commentUrl.js +31 -0
- package/plugins/hooks/notifications/commentUrl.js.map +1 -0
- package/plugins/hooks/notifications/contentReviewAfterCreate.d.ts +2 -0
- package/plugins/hooks/notifications/contentReviewAfterCreate.js +122 -0
- package/plugins/hooks/notifications/contentReviewAfterCreate.js.map +1 -0
- package/plugins/hooks/notifications/contentReviewUrl.d.ts +7 -0
- package/plugins/hooks/notifications/contentReviewUrl.js +30 -0
- package/plugins/hooks/notifications/contentReviewUrl.js.map +1 -0
- package/plugins/hooks/notifications/contentUrl.d.ts +7 -0
- package/plugins/hooks/notifications/contentUrl.js +29 -0
- package/plugins/hooks/notifications/contentUrl.js.map +1 -0
- package/plugins/hooks/notifications/lastChangeRequestNotificationPlugin.d.ts +11 -0
- package/plugins/hooks/notifications/lastChangeRequestNotificationPlugin.js +25 -0
- package/plugins/hooks/notifications/lastChangeRequestNotificationPlugin.js.map +1 -0
- package/plugins/hooks/notifications/lastCommentNotificationPlugin.d.ts +11 -0
- package/plugins/hooks/notifications/lastCommentNotificationPlugin.js +25 -0
- package/plugins/hooks/notifications/lastCommentNotificationPlugin.js.map +1 -0
- package/plugins/hooks/notifications/lastContentReviewNotificationPlugin.d.ts +11 -0
- package/plugins/hooks/notifications/lastContentReviewNotificationPlugin.js +25 -0
- package/plugins/hooks/notifications/lastContentReviewNotificationPlugin.js.map +1 -0
- package/plugins/hooks/notifications/reviewers.d.ts +15 -0
- package/plugins/hooks/notifications/reviewers.js +51 -0
- package/plugins/hooks/notifications/reviewers.js.map +1 -0
- package/plugins/hooks/notifications/sendChangeRequestNotification.d.ts +2 -0
- package/plugins/hooks/notifications/sendChangeRequestNotification.js +52 -0
- package/plugins/hooks/notifications/sendChangeRequestNotification.js.map +1 -0
- package/plugins/hooks/notifications/sendCommentNotification.d.ts +2 -0
- package/plugins/hooks/notifications/sendCommentNotification.js +52 -0
- package/plugins/hooks/notifications/sendCommentNotification.js.map +1 -0
- package/plugins/hooks/notifications/sendContentReviewNotification.d.ts +2 -0
- package/plugins/hooks/notifications/sendContentReviewNotification.js +52 -0
- package/plugins/hooks/notifications/sendContentReviewNotification.js.map +1 -0
- package/plugins/hooks/updatePendingChangeRequests.d.ts +2 -0
- package/plugins/hooks/updatePendingChangeRequests.js +94 -0
- package/plugins/hooks/updatePendingChangeRequests.js.map +1 -0
- package/plugins/hooks/updateTotalComments.d.ts +3 -0
- package/plugins/hooks/updateTotalComments.js +153 -0
- package/plugins/hooks/updateTotalComments.js.map +1 -0
- package/plugins/hooks/validateChangeRequest.d.ts +2 -0
- package/plugins/hooks/validateChangeRequest.js +89 -0
- package/plugins/hooks/validateChangeRequest.js.map +1 -0
- package/plugins/hooks/validateComment.d.ts +2 -0
- package/plugins/hooks/validateComment.js +57 -0
- package/plugins/hooks/validateComment.js.map +1 -0
- package/plugins/hooks/validateContentReview.d.ts +2 -0
- package/plugins/hooks/validateContentReview.js +38 -0
- package/plugins/hooks/validateContentReview.js.map +1 -0
- package/plugins/pageBuilder/PageApwSettingsGetterPlugin.d.ts +9 -0
- package/plugins/pageBuilder/PageApwSettingsGetterPlugin.js +51 -0
- package/plugins/pageBuilder/PageApwSettingsGetterPlugin.js.map +1 -0
- package/plugins/pageBuilder/apwContentPagePlugins.d.ts +3 -0
- package/plugins/pageBuilder/apwContentPagePlugins.js +30 -0
- package/plugins/pageBuilder/apwContentPagePlugins.js.map +1 -0
- package/plugins/pageBuilder/extendPbPageSettingsSchema.d.ts +3 -0
- package/plugins/pageBuilder/extendPbPageSettingsSchema.js +25 -0
- package/plugins/pageBuilder/extendPbPageSettingsSchema.js.map +1 -0
- package/plugins/pageBuilder/index.d.ts +11 -0
- package/plugins/pageBuilder/index.js +53 -0
- package/plugins/pageBuilder/index.js.map +1 -0
- package/plugins/pageBuilder/linkContentReviewToPage.d.ts +8 -0
- package/plugins/pageBuilder/linkContentReviewToPage.js +105 -0
- package/plugins/pageBuilder/linkContentReviewToPage.js.map +1 -0
- package/plugins/pageBuilder/linkWorkflowToPage.d.ts +8 -0
- package/plugins/pageBuilder/linkWorkflowToPage.js +194 -0
- package/plugins/pageBuilder/linkWorkflowToPage.js.map +1 -0
- package/plugins/pageBuilder/notifications/changeRequestNotification.d.ts +1 -0
- package/plugins/pageBuilder/notifications/changeRequestNotification.js +35 -0
- package/plugins/pageBuilder/notifications/changeRequestNotification.js.map +1 -0
- package/plugins/pageBuilder/notifications/commentNotification.d.ts +1 -0
- package/plugins/pageBuilder/notifications/commentNotification.js +35 -0
- package/plugins/pageBuilder/notifications/commentNotification.js.map +1 -0
- package/plugins/pageBuilder/notifications/contentReviewNotification.d.ts +1 -0
- package/plugins/pageBuilder/notifications/contentReviewNotification.js +35 -0
- package/plugins/pageBuilder/notifications/contentReviewNotification.js.map +1 -0
- package/plugins/pageBuilder/notifications/contentUrl.d.ts +1 -0
- package/plugins/pageBuilder/notifications/contentUrl.js +53 -0
- package/plugins/pageBuilder/notifications/contentUrl.js.map +1 -0
- package/plugins/pageBuilder/triggerContentReview.d.ts +8 -0
- package/plugins/pageBuilder/triggerContentReview.js +50 -0
- package/plugins/pageBuilder/triggerContentReview.js.map +1 -0
- package/plugins/pageBuilder/updateContentReviewStatus.d.ts +10 -0
- package/plugins/pageBuilder/updateContentReviewStatus.js +79 -0
- package/plugins/pageBuilder/updateContentReviewStatus.js.map +1 -0
- package/plugins/pageBuilder/utils.d.ts +22 -0
- package/plugins/pageBuilder/utils.js +184 -0
- package/plugins/pageBuilder/utils.js.map +1 -0
- package/plugins/utils.d.ts +35 -0
- package/plugins/utils.js +187 -0
- package/plugins/utils.js.map +1 -0
- package/scheduler/createScheduleActionMethods.d.ts +2 -0
- package/scheduler/createScheduleActionMethods.js +149 -0
- package/scheduler/createScheduleActionMethods.js.map +1 -0
- package/scheduler/handlers/executeAction/index.d.ts +13 -0
- package/scheduler/handlers/executeAction/index.js +172 -0
- package/scheduler/handlers/executeAction/index.js.map +1 -0
- package/scheduler/handlers/executeAction/plugins/ApplicationGraphQL.d.ts +13 -0
- package/scheduler/handlers/executeAction/plugins/ApplicationGraphQL.js +17 -0
- package/scheduler/handlers/executeAction/plugins/ApplicationGraphQL.js.map +1 -0
- package/scheduler/handlers/executeAction/plugins/HeadlessCMSGraphQL.d.ts +11 -0
- package/scheduler/handlers/executeAction/plugins/HeadlessCMSGraphQL.js +126 -0
- package/scheduler/handlers/executeAction/plugins/HeadlessCMSGraphQL.js.map +1 -0
- package/scheduler/handlers/executeAction/plugins/PageBuilderGraphQL.d.ts +11 -0
- package/scheduler/handlers/executeAction/plugins/PageBuilderGraphQL.js +163 -0
- package/scheduler/handlers/executeAction/plugins/PageBuilderGraphQL.js.map +1 -0
- package/scheduler/handlers/executeAction/security.d.ts +4 -0
- package/scheduler/handlers/executeAction/security.js +68 -0
- package/scheduler/handlers/executeAction/security.js.map +1 -0
- package/scheduler/handlers/scheduleAction/index.d.ts +22 -0
- package/scheduler/handlers/scheduleAction/index.js +164 -0
- package/scheduler/handlers/scheduleAction/index.js.map +1 -0
- package/scheduler/handlers/scheduleAction/scheduleAction.utils.d.ts +24 -0
- package/scheduler/handlers/scheduleAction/scheduleAction.utils.js +172 -0
- package/scheduler/handlers/scheduleAction/scheduleAction.utils.js.map +1 -0
- package/scheduler/handlers/utils.d.ts +33 -0
- package/scheduler/handlers/utils.js +168 -0
- package/scheduler/handlers/utils.js.map +1 -0
- package/scheduler/index.d.ts +2 -0
- package/scheduler/index.js +27 -0
- package/scheduler/index.js.map +1 -0
- package/scheduler/types.d.ts +171 -0
- package/scheduler/types.js +34 -0
- package/scheduler/types.js.map +1 -0
- package/storageOperations/changeRequestStorageOperations.d.ts +3 -0
- package/storageOperations/changeRequestStorageOperations.js +122 -0
- package/storageOperations/changeRequestStorageOperations.js.map +1 -0
- package/storageOperations/commentStorageOperations.d.ts +3 -0
- package/storageOperations/commentStorageOperations.js +138 -0
- package/storageOperations/commentStorageOperations.js.map +1 -0
- package/storageOperations/contentReviewStorageOperations.d.ts +3 -0
- package/storageOperations/contentReviewStorageOperations.js +93 -0
- package/storageOperations/contentReviewStorageOperations.js.map +1 -0
- package/storageOperations/index.d.ts +15 -0
- package/storageOperations/index.js +48 -0
- package/storageOperations/index.js.map +1 -0
- package/storageOperations/models/changeRequest.model.d.ts +3 -0
- package/storageOperations/models/changeRequest.model.js +59 -0
- package/storageOperations/models/changeRequest.model.js.map +1 -0
- package/storageOperations/models/comment.model.d.ts +7 -0
- package/storageOperations/models/comment.model.js +60 -0
- package/storageOperations/models/comment.model.js.map +1 -0
- package/storageOperations/models/contentModelPluginFactory.d.ts +15 -0
- package/storageOperations/models/contentModelPluginFactory.js +28 -0
- package/storageOperations/models/contentModelPluginFactory.js.map +1 -0
- package/storageOperations/models/contentReview.model.d.ts +7 -0
- package/storageOperations/models/contentReview.model.js +258 -0
- package/storageOperations/models/contentReview.model.js.map +1 -0
- package/storageOperations/models/index.d.ts +2 -0
- package/storageOperations/models/index.js +115 -0
- package/storageOperations/models/index.js.map +1 -0
- package/storageOperations/models/reviewer.model.d.ts +3 -0
- package/storageOperations/models/reviewer.model.js +71 -0
- package/storageOperations/models/reviewer.model.js.map +1 -0
- package/storageOperations/models/utils.d.ts +3 -0
- package/storageOperations/models/utils.js +37 -0
- package/storageOperations/models/utils.js.map +1 -0
- package/storageOperations/models/workflow.model.d.ts +12 -0
- package/storageOperations/models/workflow.model.js +208 -0
- package/storageOperations/models/workflow.model.js.map +1 -0
- package/storageOperations/reviewerStorageOperations.d.ts +3 -0
- package/storageOperations/reviewerStorageOperations.js +97 -0
- package/storageOperations/reviewerStorageOperations.js.map +1 -0
- package/storageOperations/types.d.ts +34 -0
- package/storageOperations/types.js +5 -0
- package/storageOperations/types.js.map +1 -0
- package/storageOperations/workflowStorageOperations.d.ts +3 -0
- package/storageOperations/workflowStorageOperations.js +111 -0
- package/storageOperations/workflowStorageOperations.js.map +1 -0
- package/types.d.ts +752 -0
- package/types.js +69 -0
- package/types.js.map +1 -0
- package/utils/contentApwSettingsPlugin.d.ts +9 -0
- package/utils/contentApwSettingsPlugin.js +26 -0
- package/utils/contentApwSettingsPlugin.js.map +1 -0
- package/utils/errors.d.ts +16 -0
- package/utils/errors.js +75 -0
- package/utils/errors.js.map +1 -0
- package/utils/fieldResolver.d.ts +16 -0
- package/utils/fieldResolver.js +54 -0
- package/utils/fieldResolver.js.map +1 -0
- package/utils/resolve.d.ts +3 -0
- package/utils/resolve.js +18 -0
- package/utils/resolve.js.map +1 -0
@@ -0,0 +1,208 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
4
|
+
value: true
|
5
|
+
});
|
6
|
+
exports.stepTypeField = exports.stepTitleField = exports.stepReviewersField = exports.stepIdField = exports.createWorkflowModelDefinition = exports.WORKFLOW_MODEL_ID = void 0;
|
7
|
+
|
8
|
+
var _utils = require("./utils");
|
9
|
+
|
10
|
+
const titleField = () => (0, _utils.createModelField)({
|
11
|
+
label: "Title",
|
12
|
+
type: "text",
|
13
|
+
parent: "workflow",
|
14
|
+
validation: [{
|
15
|
+
message: "`title` field value is required in workflow.",
|
16
|
+
name: "required"
|
17
|
+
}]
|
18
|
+
});
|
19
|
+
|
20
|
+
const stepsField = fields => (0, _utils.createModelField)({
|
21
|
+
label: "Steps",
|
22
|
+
type: "object",
|
23
|
+
parent: "workflow",
|
24
|
+
settings: {
|
25
|
+
fields
|
26
|
+
},
|
27
|
+
multipleValues: true
|
28
|
+
});
|
29
|
+
|
30
|
+
const stepTitleField = () => (0, _utils.createModelField)({
|
31
|
+
label: "Title",
|
32
|
+
type: "text",
|
33
|
+
parent: "workflow steps",
|
34
|
+
validation: [{
|
35
|
+
message: "`title` field value is required in workflow steps.",
|
36
|
+
name: "required"
|
37
|
+
}]
|
38
|
+
});
|
39
|
+
|
40
|
+
exports.stepTitleField = stepTitleField;
|
41
|
+
|
42
|
+
const stepTypeField = () => (0, _utils.createModelField)({
|
43
|
+
label: "Type",
|
44
|
+
type: "text",
|
45
|
+
parent: "workflow steps",
|
46
|
+
predefinedValues: {
|
47
|
+
enabled: true,
|
48
|
+
values: [{
|
49
|
+
value: "mandatoryBlocking",
|
50
|
+
label: "Mandatory, blocking - An approval from a reviewer is required before being able to move to the next step and publish the content. "
|
51
|
+
}, {
|
52
|
+
value: "mandatoryNonBlocking",
|
53
|
+
label: "Mandatory, non-blocking - An approval from a reviewer is to publish the content, but the next step in the review workflow is not blocked. "
|
54
|
+
}, {
|
55
|
+
value: "notMandatory",
|
56
|
+
label: "Not mandatory - This is an optional review step. The content can be published regardless if an approval is provided or not."
|
57
|
+
}]
|
58
|
+
},
|
59
|
+
validation: [{
|
60
|
+
name: "required",
|
61
|
+
message: "`type` field value is required in workflow steps."
|
62
|
+
}]
|
63
|
+
});
|
64
|
+
|
65
|
+
exports.stepTypeField = stepTypeField;
|
66
|
+
|
67
|
+
const stepIdField = () => (0, _utils.createModelField)({
|
68
|
+
label: "Id",
|
69
|
+
type: "text",
|
70
|
+
parent: "workflow steps",
|
71
|
+
validation: [{
|
72
|
+
message: "`id` field value is required in workflow steps.",
|
73
|
+
name: "required"
|
74
|
+
}]
|
75
|
+
});
|
76
|
+
|
77
|
+
exports.stepIdField = stepIdField;
|
78
|
+
|
79
|
+
const stepReviewersField = reviewerModelId => (0, _utils.createModelField)({
|
80
|
+
label: "Reviewers",
|
81
|
+
type: "ref",
|
82
|
+
parent: "workflow steps",
|
83
|
+
multipleValues: true,
|
84
|
+
settings: {
|
85
|
+
models: [{
|
86
|
+
modelId: reviewerModelId
|
87
|
+
}]
|
88
|
+
},
|
89
|
+
listValidation: [{
|
90
|
+
name: "minLength",
|
91
|
+
message: "Value is too short.",
|
92
|
+
settings: {
|
93
|
+
value: "1"
|
94
|
+
}
|
95
|
+
}]
|
96
|
+
});
|
97
|
+
|
98
|
+
exports.stepReviewersField = stepReviewersField;
|
99
|
+
|
100
|
+
const scopeField = fields => (0, _utils.createModelField)({
|
101
|
+
type: "object",
|
102
|
+
label: "Scope",
|
103
|
+
parent: "workflow",
|
104
|
+
settings: {
|
105
|
+
fields
|
106
|
+
}
|
107
|
+
});
|
108
|
+
|
109
|
+
const scopeTypeField = () => (0, _utils.createModelField)({
|
110
|
+
label: "Type",
|
111
|
+
parent: "workflow scope",
|
112
|
+
type: "text",
|
113
|
+
validation: [{
|
114
|
+
message: "`type` field value is required in workflow scope.",
|
115
|
+
name: "required"
|
116
|
+
}],
|
117
|
+
predefinedValues: {
|
118
|
+
enabled: true,
|
119
|
+
values: [{
|
120
|
+
value: "default",
|
121
|
+
label: "Default - Catch all scope that applies to all content that's being published."
|
122
|
+
}, {
|
123
|
+
value: "pageBuilder",
|
124
|
+
label: "Page category (Page Builder only) - The workflow will apply to all pages inside specific categories."
|
125
|
+
}, {
|
126
|
+
value: "cms",
|
127
|
+
label: "Content model (Headless CMS only) - The workflow will apply to all the content inside the specific content models. "
|
128
|
+
}]
|
129
|
+
}
|
130
|
+
});
|
131
|
+
|
132
|
+
const scopeDataField = fields => (0, _utils.createModelField)({
|
133
|
+
label: "Data",
|
134
|
+
parent: "workflow scope",
|
135
|
+
type: "object",
|
136
|
+
settings: {
|
137
|
+
fields
|
138
|
+
}
|
139
|
+
});
|
140
|
+
|
141
|
+
const scopeDataPbCategories = () => (0, _utils.createModelField)({
|
142
|
+
label: "Categories",
|
143
|
+
parent: "workflow scope data",
|
144
|
+
type: "text",
|
145
|
+
multipleValues: true
|
146
|
+
});
|
147
|
+
|
148
|
+
const scopeDataPbPages = () => (0, _utils.createModelField)({
|
149
|
+
label: "Pages",
|
150
|
+
parent: "workflow scope data",
|
151
|
+
type: "text",
|
152
|
+
multipleValues: true
|
153
|
+
});
|
154
|
+
|
155
|
+
const scopeDataCmsModels = () => (0, _utils.createModelField)({
|
156
|
+
label: "Models",
|
157
|
+
parent: "workflow scope data",
|
158
|
+
type: "text",
|
159
|
+
multipleValues: true
|
160
|
+
});
|
161
|
+
|
162
|
+
const scopeDataCmsEntries = () => (0, _utils.createModelField)({
|
163
|
+
label: "Entries",
|
164
|
+
parent: "workflow scope data",
|
165
|
+
type: "text",
|
166
|
+
multipleValues: true
|
167
|
+
});
|
168
|
+
|
169
|
+
const applicationField = () => (0, _utils.createModelField)({
|
170
|
+
parent: "workflow",
|
171
|
+
type: "text",
|
172
|
+
label: "App",
|
173
|
+
validation: [{
|
174
|
+
message: "`app` field value is required in workflow.",
|
175
|
+
name: "required"
|
176
|
+
}],
|
177
|
+
predefinedValues: {
|
178
|
+
enabled: true,
|
179
|
+
values: [{
|
180
|
+
label: "Page Builder",
|
181
|
+
value: "pageBuilder"
|
182
|
+
}, {
|
183
|
+
label: "Headless CMS",
|
184
|
+
value: "cms"
|
185
|
+
}]
|
186
|
+
}
|
187
|
+
});
|
188
|
+
|
189
|
+
const WORKFLOW_MODEL_ID = "apwWorkflowModelDefinition";
|
190
|
+
exports.WORKFLOW_MODEL_ID = WORKFLOW_MODEL_ID;
|
191
|
+
|
192
|
+
const createWorkflowModelDefinition = ({
|
193
|
+
reviewerModelId
|
194
|
+
}) => ({
|
195
|
+
name: "APW - Workflow",
|
196
|
+
|
197
|
+
/**
|
198
|
+
* Id of the model cannot be appWorkflow because it clashes with the GraphQL types for APW.
|
199
|
+
*/
|
200
|
+
modelId: WORKFLOW_MODEL_ID,
|
201
|
+
layout: [["workflow_title"], ["workflow_steps"], ["workflow_scope"], ["workflow_app"]],
|
202
|
+
titleFieldId: "title",
|
203
|
+
description: "",
|
204
|
+
fields: [titleField(), stepsField([stepTitleField(), stepTypeField(), stepIdField(), stepReviewersField(reviewerModelId)]), scopeField([scopeTypeField(), scopeDataField([scopeDataPbCategories(), scopeDataPbPages(), scopeDataCmsModels(), scopeDataCmsEntries()])]), applicationField()],
|
205
|
+
isPrivate: true
|
206
|
+
});
|
207
|
+
|
208
|
+
exports.createWorkflowModelDefinition = createWorkflowModelDefinition;
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"names":["titleField","createModelField","label","type","parent","validation","message","name","stepsField","fields","settings","multipleValues","stepTitleField","stepTypeField","predefinedValues","enabled","values","value","stepIdField","stepReviewersField","reviewerModelId","models","modelId","listValidation","scopeField","scopeTypeField","scopeDataField","scopeDataPbCategories","scopeDataPbPages","scopeDataCmsModels","scopeDataCmsEntries","applicationField","WORKFLOW_MODEL_ID","createWorkflowModelDefinition","layout","titleFieldId","description","isPrivate"],"sources":["workflow.model.ts"],"sourcesContent":["import { createModelField } from \"./utils\";\nimport { CmsModelField } from \"@webiny/api-headless-cms/types\";\nimport { WorkflowModelDefinition } from \"~/types\";\n\nconst titleField = () =>\n createModelField({\n label: \"Title\",\n type: \"text\",\n parent: \"workflow\",\n validation: [\n {\n message: \"`title` field value is required in workflow.\",\n name: \"required\"\n }\n ]\n });\n\nconst stepsField = (fields: CmsModelField[]) =>\n createModelField({\n label: \"Steps\",\n type: \"object\",\n parent: \"workflow\",\n settings: {\n fields\n },\n multipleValues: true\n });\n\nexport const stepTitleField = () =>\n createModelField({\n label: \"Title\",\n type: \"text\",\n parent: \"workflow steps\",\n validation: [\n {\n message: \"`title` field value is required in workflow steps.\",\n name: \"required\"\n }\n ]\n });\n\nexport const stepTypeField = () =>\n createModelField({\n label: \"Type\",\n type: \"text\",\n parent: \"workflow steps\",\n predefinedValues: {\n enabled: true,\n values: [\n {\n value: \"mandatoryBlocking\",\n label: \"Mandatory, blocking - An approval from a reviewer is required before being able to move to the next step and publish the content. \"\n },\n {\n value: \"mandatoryNonBlocking\",\n label: \"Mandatory, non-blocking - An approval from a reviewer is to publish the content, but the next step in the review workflow is not blocked. \"\n },\n {\n value: \"notMandatory\",\n label: \"Not mandatory - This is an optional review step. The content can be published regardless if an approval is provided or not.\"\n }\n ]\n },\n validation: [\n {\n name: \"required\",\n message: \"`type` field value is required in workflow steps.\"\n }\n ]\n });\n\nexport const stepIdField = () =>\n createModelField({\n label: \"Id\",\n type: \"text\",\n parent: \"workflow steps\",\n validation: [\n {\n message: \"`id` field value is required in workflow steps.\",\n name: \"required\"\n }\n ]\n });\n\nexport const stepReviewersField = (reviewerModelId: string) =>\n createModelField({\n label: \"Reviewers\",\n type: \"ref\",\n parent: \"workflow steps\",\n multipleValues: true,\n settings: {\n models: [\n {\n modelId: reviewerModelId\n }\n ]\n },\n listValidation: [\n {\n name: \"minLength\",\n message: \"Value is too short.\",\n settings: {\n value: \"1\"\n }\n }\n ]\n });\n\nconst scopeField = (fields: CmsModelField[]) =>\n createModelField({\n type: \"object\",\n label: \"Scope\",\n parent: \"workflow\",\n settings: {\n fields\n }\n });\n\nconst scopeTypeField = () =>\n createModelField({\n label: \"Type\",\n parent: \"workflow scope\",\n type: \"text\",\n validation: [\n {\n message: \"`type` field value is required in workflow scope.\",\n name: \"required\"\n }\n ],\n predefinedValues: {\n enabled: true,\n values: [\n {\n value: \"default\",\n label: \"Default - Catch all scope that applies to all content that's being published.\"\n },\n {\n value: \"pageBuilder\",\n label: \"Page category (Page Builder only) - The workflow will apply to all pages inside specific categories.\"\n },\n {\n value: \"cms\",\n label: \"Content model (Headless CMS only) - The workflow will apply to all the content inside the specific content models. \"\n }\n ]\n }\n });\n\nconst scopeDataField = (fields: CmsModelField[]) =>\n createModelField({\n label: \"Data\",\n parent: \"workflow scope\",\n type: \"object\",\n settings: {\n fields\n }\n });\n\nconst scopeDataPbCategories = () =>\n createModelField({\n label: \"Categories\",\n parent: \"workflow scope data\",\n type: \"text\",\n multipleValues: true\n });\nconst scopeDataPbPages = () =>\n createModelField({\n label: \"Pages\",\n parent: \"workflow scope data\",\n type: \"text\",\n multipleValues: true\n });\nconst scopeDataCmsModels = () =>\n createModelField({\n label: \"Models\",\n parent: \"workflow scope data\",\n type: \"text\",\n multipleValues: true\n });\nconst scopeDataCmsEntries = () =>\n createModelField({\n label: \"Entries\",\n parent: \"workflow scope data\",\n type: \"text\",\n multipleValues: true\n });\n\nconst applicationField = () =>\n createModelField({\n parent: \"workflow\",\n type: \"text\",\n label: \"App\",\n validation: [\n {\n message: \"`app` field value is required in workflow.\",\n name: \"required\"\n }\n ],\n predefinedValues: {\n enabled: true,\n values: [\n { label: \"Page Builder\", value: \"pageBuilder\" },\n { label: \"Headless CMS\", value: \"cms\" }\n ]\n }\n });\n\ninterface CreateWorkflowModelDefinitionParams {\n reviewerModelId: string;\n}\n\nexport const WORKFLOW_MODEL_ID = \"apwWorkflowModelDefinition\";\n\nexport const createWorkflowModelDefinition = ({\n reviewerModelId\n}: CreateWorkflowModelDefinitionParams): WorkflowModelDefinition => ({\n name: \"APW - Workflow\",\n /**\n * Id of the model cannot be appWorkflow because it clashes with the GraphQL types for APW.\n */\n modelId: WORKFLOW_MODEL_ID,\n layout: [[\"workflow_title\"], [\"workflow_steps\"], [\"workflow_scope\"], [\"workflow_app\"]],\n titleFieldId: \"title\",\n description: \"\",\n fields: [\n titleField(),\n stepsField([\n stepTitleField(),\n stepTypeField(),\n stepIdField(),\n stepReviewersField(reviewerModelId)\n ]),\n scopeField([\n scopeTypeField(),\n scopeDataField([\n scopeDataPbCategories(),\n scopeDataPbPages(),\n scopeDataCmsModels(),\n scopeDataCmsEntries()\n ])\n ]),\n applicationField()\n ],\n isPrivate: true\n});\n"],"mappings":";;;;;;;AAAA;;AAIA,MAAMA,UAAU,GAAG,MACf,IAAAC,uBAAA,EAAiB;EACbC,KAAK,EAAE,OADM;EAEbC,IAAI,EAAE,MAFO;EAGbC,MAAM,EAAE,UAHK;EAIbC,UAAU,EAAE,CACR;IACIC,OAAO,EAAE,8CADb;IAEIC,IAAI,EAAE;EAFV,CADQ;AAJC,CAAjB,CADJ;;AAaA,MAAMC,UAAU,GAAIC,MAAD,IACf,IAAAR,uBAAA,EAAiB;EACbC,KAAK,EAAE,OADM;EAEbC,IAAI,EAAE,QAFO;EAGbC,MAAM,EAAE,UAHK;EAIbM,QAAQ,EAAE;IACND;EADM,CAJG;EAObE,cAAc,EAAE;AAPH,CAAjB,CADJ;;AAWO,MAAMC,cAAc,GAAG,MAC1B,IAAAX,uBAAA,EAAiB;EACbC,KAAK,EAAE,OADM;EAEbC,IAAI,EAAE,MAFO;EAGbC,MAAM,EAAE,gBAHK;EAIbC,UAAU,EAAE,CACR;IACIC,OAAO,EAAE,oDADb;IAEIC,IAAI,EAAE;EAFV,CADQ;AAJC,CAAjB,CADG;;;;AAaA,MAAMM,aAAa,GAAG,MACzB,IAAAZ,uBAAA,EAAiB;EACbC,KAAK,EAAE,MADM;EAEbC,IAAI,EAAE,MAFO;EAGbC,MAAM,EAAE,gBAHK;EAIbU,gBAAgB,EAAE;IACdC,OAAO,EAAE,IADK;IAEdC,MAAM,EAAE,CACJ;MACIC,KAAK,EAAE,mBADX;MAEIf,KAAK,EAAE;IAFX,CADI,EAKJ;MACIe,KAAK,EAAE,sBADX;MAEIf,KAAK,EAAE;IAFX,CALI,EASJ;MACIe,KAAK,EAAE,cADX;MAEIf,KAAK,EAAE;IAFX,CATI;EAFM,CAJL;EAqBbG,UAAU,EAAE,CACR;IACIE,IAAI,EAAE,UADV;IAE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;IACdC,OAAO,EAAE,IADK;IAEdC,MAAM,EAAE,CACJ;MAAEd,KAAK,EAAE,cAAT;MAAyBe,KAAK,EAAE;IAAhC,CADI,EAEJ;MAAEf,KAAK,EAAE,cAAT;MAAyBe,KAAK,EAAE;IAAhC,CAFI;EAFM;AAVL,CAAjB,CADJ;;AAwBO,MAAMe,iBAAiB,GAAG,4BAA1B;;;AAEA,MAAMC,6BAA6B,GAAG,CAAC;EAC1Cb;AAD0C,CAAD,MAEwB;EACjEb,IAAI,EAAE,gBAD2D;;EAEjE;AACJ;AACA;EACIe,OAAO,EAAEU,iBALwD;EAMjEE,MAAM,EAAE,CAAC,CAAC,gBAAD,CAAD,EAAqB,CAAC,gBAAD,CAArB,EAAyC,CAAC,gBAAD,CAAzC,EAA6D,CAAC,cAAD,CAA7D,CANyD;EAOjEC,YAAY,EAAE,OAPmD;EAQjEC,WAAW,EAAE,EARoD;EASjE3B,MAAM,EAAE,CACJT,UAAU,EADN,EAEJQ,UAAU,CAAC,CACPI,cAAc,EADP,EAEPC,aAAa,EAFN,EAGPK,WAAW,EAHJ,EAIPC,kBAAkB,CAACC,eAAD,CAJX,CAAD,CAFN,EAQJI,UAAU,CAAC,CACPC,cAAc,EADP,EAEPC,cAAc,CAAC,CACXC,qBAAqB,EADV,EAEXC,gBAAgB,EAFL,EAGXC,kBAAkB,EAHP,EAIXC,mBAAmB,EAJR,CAAD,CAFP,CAAD,CARN,EAiBJC,gBAAgB,EAjBZ,CATyD;EA4BjEM,SAAS,EAAE;AA5BsD,CAFxB,CAAtC"}
|
@@ -0,0 +1,97 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
4
|
+
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
6
|
+
value: true
|
7
|
+
});
|
8
|
+
exports.createReviewerStorageOperations = void 0;
|
9
|
+
|
10
|
+
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
|
11
|
+
|
12
|
+
var _index = require("./index");
|
13
|
+
|
14
|
+
var _error = _interopRequireDefault(require("@webiny/error"));
|
15
|
+
|
16
|
+
const createReviewerStorageOperations = ({
|
17
|
+
cms,
|
18
|
+
security
|
19
|
+
}) => {
|
20
|
+
const getReviewerModel = async () => {
|
21
|
+
security.disableAuthorization();
|
22
|
+
|
23
|
+
try {
|
24
|
+
const model = await cms.getModel("apwReviewerModelDefinition");
|
25
|
+
|
26
|
+
if (!model) {
|
27
|
+
throw new _error.default("Could not find `apwReviewerModelDefinition` model.", "MODEL_NOT_FOUND_ERROR");
|
28
|
+
}
|
29
|
+
|
30
|
+
return model;
|
31
|
+
} catch (ex) {
|
32
|
+
throw ex;
|
33
|
+
} finally {
|
34
|
+
security.enableAuthorization();
|
35
|
+
}
|
36
|
+
};
|
37
|
+
|
38
|
+
const getReviewer = async ({
|
39
|
+
id
|
40
|
+
}) => {
|
41
|
+
const model = await getReviewerModel();
|
42
|
+
security.disableAuthorization();
|
43
|
+
const entry = await cms.getEntryById(model, id);
|
44
|
+
security.enableAuthorization();
|
45
|
+
return (0, _index.getFieldValues)(entry, _index.baseFields);
|
46
|
+
};
|
47
|
+
|
48
|
+
return {
|
49
|
+
getReviewerModel,
|
50
|
+
getReviewer,
|
51
|
+
|
52
|
+
async listReviewers(params) {
|
53
|
+
const model = await getReviewerModel();
|
54
|
+
security.disableAuthorization();
|
55
|
+
const [entries, meta] = await cms.listLatestEntries(model, (0, _objectSpread2.default)((0, _objectSpread2.default)({}, params), {}, {
|
56
|
+
where: (0, _objectSpread2.default)({}, params.where)
|
57
|
+
}));
|
58
|
+
security.enableAuthorization();
|
59
|
+
return [entries.map(entry => (0, _index.getFieldValues)(entry, _index.baseFields)), meta];
|
60
|
+
},
|
61
|
+
|
62
|
+
async createReviewer(params) {
|
63
|
+
const model = await getReviewerModel();
|
64
|
+
security.disableAuthorization();
|
65
|
+
const entry = await cms.createEntry(model, params.data);
|
66
|
+
security.enableAuthorization();
|
67
|
+
return (0, _index.getFieldValues)(entry, _index.baseFields);
|
68
|
+
},
|
69
|
+
|
70
|
+
async updateReviewer(params) {
|
71
|
+
const model = await getReviewerModel();
|
72
|
+
/**
|
73
|
+
* We're fetching the existing entry here because we're not accepting "app" field as input,
|
74
|
+
* but, we still need to retain its value after the "update" operation.
|
75
|
+
*/
|
76
|
+
|
77
|
+
const existingEntry = await getReviewer({
|
78
|
+
id: params.id
|
79
|
+
});
|
80
|
+
security.disableAuthorization();
|
81
|
+
const entry = await cms.updateEntry(model, params.id, (0, _objectSpread2.default)((0, _objectSpread2.default)({}, existingEntry), params.data));
|
82
|
+
security.enableAuthorization();
|
83
|
+
return (0, _index.getFieldValues)(entry, _index.baseFields);
|
84
|
+
},
|
85
|
+
|
86
|
+
async deleteReviewer(params) {
|
87
|
+
const model = await getReviewerModel();
|
88
|
+
security.disableAuthorization();
|
89
|
+
await cms.deleteEntry(model, params.id);
|
90
|
+
security.enableAuthorization();
|
91
|
+
return true;
|
92
|
+
}
|
93
|
+
|
94
|
+
};
|
95
|
+
};
|
96
|
+
|
97
|
+
exports.createReviewerStorageOperations = createReviewerStorageOperations;
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"names":["createReviewerStorageOperations","cms","security","getReviewerModel","disableAuthorization","model","getModel","WebinyError","ex","enableAuthorization","getReviewer","id","entry","getEntryById","getFieldValues","baseFields","listReviewers","params","entries","meta","listLatestEntries","where","map","createReviewer","createEntry","data","updateReviewer","existingEntry","updateEntry","deleteReviewer","deleteEntry"],"sources":["reviewerStorageOperations.ts"],"sourcesContent":["import { ApwReviewerStorageOperations } from \"./types\";\nimport {\n baseFields,\n CreateApwStorageOperationsParams,\n getFieldValues\n} from \"~/storageOperations/index\";\nimport WebinyError from \"@webiny/error\";\n\nexport const createReviewerStorageOperations = ({\n cms,\n security\n}: CreateApwStorageOperationsParams): ApwReviewerStorageOperations => {\n const getReviewerModel = async () => {\n security.disableAuthorization();\n try {\n const model = await cms.getModel(\"apwReviewerModelDefinition\");\n if (!model) {\n throw new WebinyError(\n \"Could not find `apwReviewerModelDefinition` model.\",\n \"MODEL_NOT_FOUND_ERROR\"\n );\n }\n return model;\n } catch (ex) {\n throw ex;\n } finally {\n security.enableAuthorization();\n }\n };\n const getReviewer: ApwReviewerStorageOperations[\"getReviewer\"] = async ({ id }) => {\n const model = await getReviewerModel();\n security.disableAuthorization();\n const entry = await cms.getEntryById(model, id);\n security.enableAuthorization();\n return getFieldValues(entry, baseFields);\n };\n return {\n getReviewerModel,\n getReviewer,\n async listReviewers(params) {\n const model = await getReviewerModel();\n security.disableAuthorization();\n const [entries, meta] = await cms.listLatestEntries(model, {\n ...params,\n where: {\n ...params.where\n }\n });\n security.enableAuthorization();\n return [entries.map(entry => getFieldValues(entry, baseFields)), meta];\n },\n async createReviewer(params) {\n const model = await getReviewerModel();\n security.disableAuthorization();\n const entry = await cms.createEntry(model, params.data);\n security.enableAuthorization();\n return getFieldValues(entry, baseFields);\n },\n async updateReviewer(params) {\n const model = await getReviewerModel();\n /**\n * We're fetching the existing entry here because we're not accepting \"app\" field as input,\n * but, we still need to retain its value after the \"update\" operation.\n */\n const existingEntry = await getReviewer({ id: params.id });\n\n security.disableAuthorization();\n const entry = await cms.updateEntry(model, params.id, {\n ...existingEntry,\n ...params.data\n });\n security.enableAuthorization();\n return getFieldValues(entry, baseFields);\n },\n async deleteReviewer(params) {\n const model = await getReviewerModel();\n security.disableAuthorization();\n await cms.deleteEntry(model, params.id);\n security.enableAuthorization();\n return true;\n }\n };\n};\n"],"mappings":";;;;;;;;;;;AACA;;AAKA;;AAEO,MAAMA,+BAA+B,GAAG,CAAC;EAC5CC,GAD4C;EAE5CC;AAF4C,CAAD,KAGuB;EAClE,MAAMC,gBAAgB,GAAG,YAAY;IACjCD,QAAQ,CAACE,oBAAT;;IACA,IAAI;MACA,MAAMC,KAAK,GAAG,MAAMJ,GAAG,CAACK,QAAJ,CAAa,4BAAb,CAApB;;MACA,IAAI,CAACD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AApB;MACAvB,QAAQ,CAACO,mBAAT;MACA,OAAO,IAAAK,qBAAA,EAAeF,KAAf,EAAsBG,iBAAtB,CAAP;IACH,CArBE;;IAsBH,MAAMW,cAAN,CAAqBT,MAArB,EAA6B;MACzB,MAAMZ,KAAK,GAAG,MAAMF,gBAAgB,EAApC;MACA;AACZ;AACA;AACA;;MACY,MAAMwB,aAAa,GAAG,MAAMjB,WAAW,CAAC;QAAEC,EAAE,EAAEM,MAAM,CAACN;MAAb,CAAD,CAAvC;MAEAT,QAAQ,CAACE,oBAAT;MACA,MAAMQ,KAAK,GAAG,MAAMX,GAAG,CAAC2B,WAAJ,CAAgBvB,KAAhB,EAAuBY,MAAM,CAACN,EAA9B,8DACbgB,aADa,GAEbV,MAAM,CAACQ,IAFM,EAApB;MAIAvB,QAAQ,CAACO,mBAAT;MACA,OAAO,IAAAK,qBAAA,EAAeF,KAAf,EAAsBG,iBAAtB,CAAP;IACH,CArCE;;IAsCH,MAAMc,cAAN,CAAqBZ,MAArB,EAA6B;MACzB,MAAMZ,KAAK,GAAG,MAAMF,gBAAgB,EAApC;MACAD,QAAQ,CAACE,oBAAT;MACA,MAAMH,GAAG,CAAC6B,WAAJ,CAAgBzB,KAAhB,EAAuBY,MAAM,CAACN,EAA9B,CAAN;MACAT,QAAQ,CAACO,mBAAT;MACA,OAAO,IAAP;IACH;;EA5CE,CAAP;AA8CH,CA1EM"}
|
@@ -0,0 +1,34 @@
|
|
1
|
+
import { CmsModel } from "@webiny/api-headless-cms/types";
|
2
|
+
import { ApwReviewerStorageOperations as BaseApwReviewerStorageOperations, ApwWorkflowStorageOperations as BaseApwWorkflowStorageOperations, ApwContentReviewStorageOperations as BaseApwContentReviewStorageOperations, ApwChangeRequestStorageOperations as BaseApwChangeRequestStorageOperations, ApwCommentStorageOperations as BaseApwCommentStorageOperations } from "../types";
|
3
|
+
export interface ApwCommentStorageOperations extends BaseApwCommentStorageOperations {
|
4
|
+
/**
|
5
|
+
* @internal
|
6
|
+
*/
|
7
|
+
getCommentModel(): Promise<CmsModel>;
|
8
|
+
}
|
9
|
+
export interface ApwReviewerStorageOperations extends BaseApwReviewerStorageOperations {
|
10
|
+
/**
|
11
|
+
* @internal
|
12
|
+
*/
|
13
|
+
getReviewerModel(): Promise<CmsModel>;
|
14
|
+
}
|
15
|
+
export interface ApwWorkflowStorageOperations extends BaseApwWorkflowStorageOperations {
|
16
|
+
/**
|
17
|
+
* @internal
|
18
|
+
*/
|
19
|
+
getWorkflowModel(): Promise<CmsModel>;
|
20
|
+
}
|
21
|
+
export interface ApwContentReviewStorageOperations extends BaseApwContentReviewStorageOperations {
|
22
|
+
/**
|
23
|
+
* @internal
|
24
|
+
*/
|
25
|
+
getContentReviewModel(): Promise<CmsModel>;
|
26
|
+
}
|
27
|
+
export interface ApwChangeRequestStorageOperations extends BaseApwChangeRequestStorageOperations {
|
28
|
+
/**
|
29
|
+
* @internal
|
30
|
+
*/
|
31
|
+
getChangeRequestModel(): Promise<CmsModel>;
|
32
|
+
}
|
33
|
+
export interface ApwStorageOperations extends ApwReviewerStorageOperations, ApwWorkflowStorageOperations, ApwContentReviewStorageOperations, ApwChangeRequestStorageOperations, ApwCommentStorageOperations {
|
34
|
+
}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"names":[],"sources":["types.ts"],"sourcesContent":["import { CmsModel } from \"@webiny/api-headless-cms/types\";\nimport {\n ApwReviewerStorageOperations as BaseApwReviewerStorageOperations,\n ApwWorkflowStorageOperations as BaseApwWorkflowStorageOperations,\n ApwContentReviewStorageOperations as BaseApwContentReviewStorageOperations,\n ApwChangeRequestStorageOperations as BaseApwChangeRequestStorageOperations,\n ApwCommentStorageOperations as BaseApwCommentStorageOperations\n} from \"~/types\";\n\nexport interface ApwCommentStorageOperations extends BaseApwCommentStorageOperations {\n /**\n * @internal\n */\n getCommentModel(): Promise<CmsModel>;\n}\n\nexport interface ApwReviewerStorageOperations extends BaseApwReviewerStorageOperations {\n /**\n * @internal\n */\n getReviewerModel(): Promise<CmsModel>;\n}\n\nexport interface ApwWorkflowStorageOperations extends BaseApwWorkflowStorageOperations {\n /**\n * @internal\n */\n getWorkflowModel(): Promise<CmsModel>;\n}\n\nexport interface ApwContentReviewStorageOperations extends BaseApwContentReviewStorageOperations {\n /**\n * @internal\n */\n getContentReviewModel(): Promise<CmsModel>;\n}\n\nexport interface ApwChangeRequestStorageOperations extends BaseApwChangeRequestStorageOperations {\n /**\n * @internal\n */\n getChangeRequestModel(): Promise<CmsModel>;\n}\n\nexport interface ApwStorageOperations\n extends ApwReviewerStorageOperations,\n ApwWorkflowStorageOperations,\n ApwContentReviewStorageOperations,\n ApwChangeRequestStorageOperations,\n ApwCommentStorageOperations {}\n"],"mappings":""}
|
@@ -0,0 +1,111 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
4
|
+
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
6
|
+
value: true
|
7
|
+
});
|
8
|
+
exports.createWorkflowStorageOperations = void 0;
|
9
|
+
|
10
|
+
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
|
11
|
+
|
12
|
+
var _index = require("./index");
|
13
|
+
|
14
|
+
var _error = _interopRequireDefault(require("@webiny/error"));
|
15
|
+
|
16
|
+
var _workflow = require("./models/workflow.model");
|
17
|
+
|
18
|
+
const formatReviewersForRefInput = (data, modelId) => {
|
19
|
+
return (0, _objectSpread2.default)((0, _objectSpread2.default)({}, data), {}, {
|
20
|
+
steps: data.steps.map(step => (0, _objectSpread2.default)((0, _objectSpread2.default)({}, step), {}, {
|
21
|
+
reviewers: step.reviewers.map(id => ({
|
22
|
+
id,
|
23
|
+
modelId
|
24
|
+
}))
|
25
|
+
}))
|
26
|
+
});
|
27
|
+
};
|
28
|
+
|
29
|
+
const createWorkflowStorageOperations = params => {
|
30
|
+
const {
|
31
|
+
cms,
|
32
|
+
security
|
33
|
+
} = params;
|
34
|
+
|
35
|
+
const getWorkflowModel = async () => {
|
36
|
+
security.disableAuthorization();
|
37
|
+
const model = await cms.getModel(_workflow.WORKFLOW_MODEL_ID);
|
38
|
+
security.enableAuthorization();
|
39
|
+
|
40
|
+
if (!model) {
|
41
|
+
throw new _error.default(`Could not find "${_workflow.WORKFLOW_MODEL_ID}" model.`, "MODEL_NOT_FOUND_ERROR");
|
42
|
+
}
|
43
|
+
|
44
|
+
return model;
|
45
|
+
};
|
46
|
+
|
47
|
+
const getWorkflow = async ({
|
48
|
+
id
|
49
|
+
}) => {
|
50
|
+
const model = await getWorkflowModel();
|
51
|
+
security.disableAuthorization();
|
52
|
+
const entry = await cms.getEntryById(model, id);
|
53
|
+
security.enableAuthorization();
|
54
|
+
return (0, _index.getFieldValues)(entry, _index.baseFields);
|
55
|
+
};
|
56
|
+
|
57
|
+
return {
|
58
|
+
getWorkflowModel,
|
59
|
+
getWorkflow,
|
60
|
+
|
61
|
+
async listWorkflows(params) {
|
62
|
+
const model = await getWorkflowModel();
|
63
|
+
security.disableAuthorization();
|
64
|
+
const [entries, meta] = await cms.listLatestEntries(model, (0, _objectSpread2.default)((0, _objectSpread2.default)({}, params), {}, {
|
65
|
+
where: (0, _objectSpread2.default)({}, params.where || {})
|
66
|
+
}));
|
67
|
+
security.enableAuthorization();
|
68
|
+
return [entries.map(entry => (0, _index.getFieldValues)(entry, _index.baseFields)), meta];
|
69
|
+
},
|
70
|
+
|
71
|
+
async createWorkflow(params) {
|
72
|
+
const model = await getWorkflowModel();
|
73
|
+
const reviewerModel = await this.getReviewerModel();
|
74
|
+
const data = formatReviewersForRefInput(params.data, reviewerModel.modelId);
|
75
|
+
security.disableAuthorization();
|
76
|
+
const entry = await cms.createEntry(model, data);
|
77
|
+
security.enableAuthorization();
|
78
|
+
return (0, _index.getFieldValues)(entry, _index.baseFields);
|
79
|
+
},
|
80
|
+
|
81
|
+
async updateWorkflow(params) {
|
82
|
+
const model = await getWorkflowModel();
|
83
|
+
const reviewerModel = await this.getReviewerModel();
|
84
|
+
/**
|
85
|
+
* We're fetching the existing entry here because we're not accepting "app" field as input,
|
86
|
+
* but, we still need to retain its value after the "update" operation.
|
87
|
+
*/
|
88
|
+
|
89
|
+
const existingEntry = await getWorkflow({
|
90
|
+
id: params.id
|
91
|
+
});
|
92
|
+
const input = (0, _objectSpread2.default)((0, _objectSpread2.default)({}, existingEntry), params.data);
|
93
|
+
const data = formatReviewersForRefInput(input, reviewerModel.modelId);
|
94
|
+
security.disableAuthorization();
|
95
|
+
const entry = await cms.updateEntry(model, params.id, data);
|
96
|
+
security.enableAuthorization();
|
97
|
+
return (0, _index.getFieldValues)(entry, _index.baseFields);
|
98
|
+
},
|
99
|
+
|
100
|
+
async deleteWorkflow(params) {
|
101
|
+
const model = await getWorkflowModel();
|
102
|
+
security.disableAuthorization();
|
103
|
+
await cms.deleteEntry(model, params.id);
|
104
|
+
security.enableAuthorization();
|
105
|
+
return true;
|
106
|
+
}
|
107
|
+
|
108
|
+
};
|
109
|
+
};
|
110
|
+
|
111
|
+
exports.createWorkflowStorageOperations = createWorkflowStorageOperations;
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"names":["formatReviewersForRefInput","data","modelId","steps","map","step","reviewers","id","createWorkflowStorageOperations","params","cms","security","getWorkflowModel","disableAuthorization","model","getModel","WORKFLOW_MODEL_ID","enableAuthorization","WebinyError","getWorkflow","entry","getEntryById","getFieldValues","baseFields","listWorkflows","entries","meta","listLatestEntries","where","createWorkflow","reviewerModel","getReviewerModel","createEntry","updateWorkflow","existingEntry","input","updateEntry","deleteWorkflow","deleteEntry"],"sources":["workflowStorageOperations.ts"],"sourcesContent":["import { CreateApwWorkflowParams } from \"~/types\";\nimport { ApwStorageOperations, ApwWorkflowStorageOperations } from \"./types\";\nimport {\n baseFields,\n CreateApwStorageOperationsParams,\n getFieldValues\n} from \"~/storageOperations/index\";\nimport WebinyError from \"@webiny/error\";\nimport { WORKFLOW_MODEL_ID } from \"~/storageOperations/models/workflow.model\";\n\ntype ReviewersRefInput = CreateApwWorkflowParams<{ modelId: string; id: string }>;\n\nconst formatReviewersForRefInput = (\n data: CreateApwWorkflowParams,\n modelId: string\n): ReviewersRefInput => {\n return {\n ...data,\n steps: data.steps.map(step => ({\n ...step,\n reviewers: step.reviewers.map(id => ({\n id,\n modelId\n }))\n }))\n };\n};\n\nexport const createWorkflowStorageOperations = (\n params: CreateApwStorageOperationsParams\n): ApwWorkflowStorageOperations => {\n const { cms, security } = params;\n const getWorkflowModel = async () => {\n security.disableAuthorization();\n const model = await cms.getModel(WORKFLOW_MODEL_ID);\n security.enableAuthorization();\n if (!model) {\n throw new WebinyError(\n `Could not find \"${WORKFLOW_MODEL_ID}\" model.`,\n \"MODEL_NOT_FOUND_ERROR\"\n );\n }\n return model;\n };\n const getWorkflow: ApwWorkflowStorageOperations[\"getWorkflow\"] = async ({ id }) => {\n const model = await getWorkflowModel();\n security.disableAuthorization();\n const entry = await cms.getEntryById(model, id);\n security.enableAuthorization();\n return getFieldValues(entry, baseFields);\n };\n return {\n getWorkflowModel,\n getWorkflow,\n async listWorkflows(params) {\n const model = await getWorkflowModel();\n security.disableAuthorization();\n const [entries, meta] = await cms.listLatestEntries(model, {\n ...params,\n where: {\n ...(params.where || {})\n }\n });\n security.enableAuthorization();\n return [entries.map(entry => getFieldValues(entry, baseFields)), meta];\n },\n async createWorkflow(this: ApwStorageOperations, params) {\n const model = await getWorkflowModel();\n const reviewerModel = await this.getReviewerModel();\n\n const data = formatReviewersForRefInput(params.data, reviewerModel.modelId);\n security.disableAuthorization();\n const entry = await cms.createEntry(model, data);\n security.enableAuthorization();\n\n return getFieldValues(entry, baseFields);\n },\n async updateWorkflow(this: ApwStorageOperations, params) {\n const model = await getWorkflowModel();\n const reviewerModel = await this.getReviewerModel();\n /**\n * We're fetching the existing entry here because we're not accepting \"app\" field as input,\n * but, we still need to retain its value after the \"update\" operation.\n */\n const existingEntry = await getWorkflow({ id: params.id });\n const input = {\n ...existingEntry,\n ...params.data\n };\n const data = formatReviewersForRefInput(\n input as CreateApwWorkflowParams,\n reviewerModel.modelId\n );\n security.disableAuthorization();\n const entry = await cms.updateEntry(model, params.id, data);\n security.enableAuthorization();\n return getFieldValues(entry, baseFields);\n },\n async deleteWorkflow(params) {\n const model = await getWorkflowModel();\n security.disableAuthorization();\n await cms.deleteEntry(model, params.id);\n security.enableAuthorization();\n return true;\n }\n };\n};\n"],"mappings":";;;;;;;;;;;AAEA;;AAKA;;AACA;;AAIA,MAAMA,0BAA0B,GAAG,CAC/BC,IAD+B,EAE/BC,OAF+B,KAGX;EACpB,mEACOD,IADP;IAEIE,KAAK,EAAEF,IAAI,CAACE,KAAL,CAAWC,GAAX,CAAeC,IAAI,gEACnBA,IADmB;MAEtBC,SAAS,EAAED,IAAI,CAACC,SAAL,CAAeF,GAAf,CAAmBG,EAAE,KAAK;QACjCA,EADiC;QAEjCL;MAFiC,CAAL,CAArB;IAFW,EAAnB;EAFX;AAUH,CAdD;;AAgBO,MAAMM,+BAA+B,GACxCC,MAD2C,IAEZ;EAC/B,MAAM;IAAEC,GAAF;IAAOC;EAAP,IAAoBF,MAA1B;;EACA,MAAMG,gBAAgB,GAAG,YAAY;IACjCD,QAAQ,CAACE,oBAAT;IACA,MAAMC,KAAK,GAAG,MAAMJ,GAAG,CAACK,QAAJ,CAAaC,2BAAb,CAApB;IACAL,QAAQ,CAACM,mBAAT;;IACA,IAAI,CAACH,KAAL,EAAY;MACR,MAAM,IAAII,cAAJ,CACD,mBAAkBF,2BAAkB,UADnC,EAEF,uBAFE,CAAN;IAIH;;IACD,OAAOF,KAAP;EACH,CAXD;;EAYA,MAAMK,WAAwD,GAAG,OAAO;IAAEZ;EAAF,CAAP,KAAkB;IAC/E,MAAMO,KAAK,GAAG,MAAMF,gBAAgB,EAApC;IACAD,QAAQ,CAACE,oBAAT;IACA,MAAMO,KAAK,GAAG,MAAMV,GAAG,CAACW,YAAJ,CAAiBP,KAAjB,EAAwBP,EAAxB,CAApB;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