@webiny/api-apw 0.0.0-unstable.13771d80a8 → 0.0.0-unstable.2696f9d9e8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/ApwChangeRequestNotification.js +4 -6
- package/ApwChangeRequestNotification.js.map +1 -1
- package/ApwCommentNotification.js +4 -6
- package/ApwCommentNotification.js.map +1 -1
- package/ApwContentReviewNotification.js +4 -6
- package/ApwContentReviewNotification.js.map +1 -1
- package/ApwContentUrlPlugin.js +4 -6
- package/ApwContentUrlPlugin.js.map +1 -1
- package/ContentApwSettingsPlugin.js +5 -4
- package/ContentApwSettingsPlugin.js.map +1 -1
- package/README.md +3 -3
- package/crud/createChangeRequestMethods.js +3 -1
- package/crud/createChangeRequestMethods.js.map +1 -1
- package/crud/createCommentMethods.js +3 -1
- package/crud/createCommentMethods.js.map +1 -1
- package/crud/createContentReviewMethods.js +56 -30
- package/crud/createContentReviewMethods.js.map +1 -1
- package/crud/createReviewerMethods.js +3 -1
- package/crud/createReviewerMethods.js.map +1 -1
- package/crud/createWorkflowMethods.js +3 -1
- package/crud/createWorkflowMethods.js.map +1 -1
- package/crud/index.js +6 -5
- package/crud/index.js.map +1 -1
- package/crud/utils.js +7 -6
- package/crud/utils.js.map +1 -1
- package/index.d.ts +1 -1
- package/index.js +3 -1
- package/index.js.map +1 -1
- package/package.json +39 -46
- package/plugins/cms/CmsEntryApwSettingsGetterPlugin.js +5 -5
- package/plugins/cms/CmsEntryApwSettingsGetterPlugin.js.map +1 -1
- package/plugins/cms/apwEntryPlugins.js +9 -6
- package/plugins/cms/apwEntryPlugins.js.map +1 -1
- package/plugins/cms/index.js +3 -1
- package/plugins/cms/index.js.map +1 -1
- package/plugins/cms/linkContentReviewToEntry.js +5 -4
- package/plugins/cms/linkContentReviewToEntry.js.map +1 -1
- package/plugins/cms/linkWorkflowToEntry.js +16 -15
- package/plugins/cms/linkWorkflowToEntry.js.map +1 -1
- package/plugins/cms/notifications/changeRequestNotification.js +3 -1
- package/plugins/cms/notifications/changeRequestNotification.js.map +1 -1
- package/plugins/cms/notifications/commentNotification.js +3 -1
- package/plugins/cms/notifications/commentNotification.js.map +1 -1
- package/plugins/cms/notifications/contentReviewNotification.js +3 -1
- package/plugins/cms/notifications/contentReviewNotification.js.map +1 -1
- package/plugins/cms/notifications/contentUrl.js +3 -1
- package/plugins/cms/notifications/contentUrl.js.map +1 -1
- package/plugins/cms/triggerContentReview.js +6 -5
- package/plugins/cms/triggerContentReview.js.map +1 -1
- package/plugins/cms/updateContentReviewStatus.js +15 -13
- package/plugins/cms/updateContentReviewStatus.js.map +1 -1
- package/plugins/cms/utils.d.ts +3 -2
- package/plugins/cms/utils.js +22 -14
- package/plugins/cms/utils.js.map +1 -1
- package/plugins/context.js +3 -1
- package/plugins/context.js.map +1 -1
- package/plugins/graphql/changeRequest.gql.js +16 -12
- package/plugins/graphql/changeRequest.gql.js.map +1 -1
- package/plugins/graphql/comment.gql.js +41 -35
- package/plugins/graphql/comment.gql.js.map +1 -1
- package/plugins/graphql/contentReview.gql.js +23 -13
- package/plugins/graphql/contentReview.gql.js.map +1 -1
- package/plugins/graphql/reviewer.gql.js +15 -12
- package/plugins/graphql/reviewer.gql.js.map +1 -1
- package/plugins/graphql/utils.d.ts +2 -0
- package/plugins/graphql/utils.js +12 -0
- package/plugins/graphql/utils.js.map +1 -0
- package/plugins/graphql/workflow.gql.js +15 -12
- package/plugins/graphql/workflow.gql.js.map +1 -1
- package/plugins/graphql.js +3 -1
- package/plugins/graphql.js.map +1 -1
- package/plugins/hooks/createReviewerFromIdentity.js +4 -2
- package/plugins/hooks/createReviewerFromIdentity.js.map +1 -1
- package/plugins/hooks/deleteChangeRequestsAfterContentReview.js +3 -1
- package/plugins/hooks/deleteChangeRequestsAfterContentReview.js.map +1 -1
- package/plugins/hooks/deleteCommentsAfterChangeRequest.js +3 -1
- package/plugins/hooks/deleteCommentsAfterChangeRequest.js.map +1 -1
- package/plugins/hooks/index.js +3 -1
- package/plugins/hooks/index.js.map +1 -1
- package/plugins/hooks/initializeContentReviewSteps.js +6 -4
- package/plugins/hooks/initializeContentReviewSteps.js.map +1 -1
- package/plugins/hooks/initializeNotifications.js +3 -1
- package/plugins/hooks/initializeNotifications.js.map +1 -1
- package/plugins/hooks/listContentReviews.js +4 -2
- package/plugins/hooks/listContentReviews.js.map +1 -1
- package/plugins/hooks/notifications/appUrl.js +3 -1
- package/plugins/hooks/notifications/appUrl.js.map +1 -1
- package/plugins/hooks/notifications/changeRequestAfterCreate.js +6 -9
- package/plugins/hooks/notifications/changeRequestAfterCreate.js.map +1 -1
- package/plugins/hooks/notifications/changeRequestUrl.js +3 -1
- package/plugins/hooks/notifications/changeRequestUrl.js.map +1 -1
- package/plugins/hooks/notifications/commentAfterCreate.js +6 -9
- package/plugins/hooks/notifications/commentAfterCreate.js.map +1 -1
- package/plugins/hooks/notifications/commentUrl.js +3 -1
- package/plugins/hooks/notifications/commentUrl.js.map +1 -1
- package/plugins/hooks/notifications/contentReviewAfterCreate.js +7 -10
- package/plugins/hooks/notifications/contentReviewAfterCreate.js.map +1 -1
- package/plugins/hooks/notifications/contentReviewUrl.js +3 -1
- package/plugins/hooks/notifications/contentReviewUrl.js.map +1 -1
- package/plugins/hooks/notifications/contentUrl.js +3 -1
- package/plugins/hooks/notifications/contentUrl.js.map +1 -1
- package/plugins/hooks/notifications/lastChangeRequestNotificationPlugin.js +3 -1
- package/plugins/hooks/notifications/lastChangeRequestNotificationPlugin.js.map +1 -1
- package/plugins/hooks/notifications/lastCommentNotificationPlugin.js +3 -1
- package/plugins/hooks/notifications/lastCommentNotificationPlugin.js.map +1 -1
- package/plugins/hooks/notifications/lastContentReviewNotificationPlugin.js +3 -1
- package/plugins/hooks/notifications/lastContentReviewNotificationPlugin.js.map +1 -1
- package/plugins/hooks/notifications/reviewers.js +18 -15
- package/plugins/hooks/notifications/reviewers.js.map +1 -1
- package/plugins/hooks/notifications/sendChangeRequestNotification.js +3 -1
- package/plugins/hooks/notifications/sendChangeRequestNotification.js.map +1 -1
- package/plugins/hooks/notifications/sendCommentNotification.js +3 -1
- package/plugins/hooks/notifications/sendCommentNotification.js.map +1 -1
- package/plugins/hooks/notifications/sendContentReviewNotification.js +3 -1
- package/plugins/hooks/notifications/sendContentReviewNotification.js.map +1 -1
- package/plugins/hooks/updatePendingChangeRequests.js +8 -6
- package/plugins/hooks/updatePendingChangeRequests.js.map +1 -1
- package/plugins/hooks/updateTotalComments.js +22 -15
- package/plugins/hooks/updateTotalComments.js.map +1 -1
- package/plugins/hooks/validateChangeRequest.js +3 -1
- package/plugins/hooks/validateChangeRequest.js.map +1 -1
- package/plugins/hooks/validateComment.js +3 -1
- package/plugins/hooks/validateComment.js.map +1 -1
- package/plugins/hooks/validateContentReview.js +3 -1
- package/plugins/hooks/validateContentReview.js.map +1 -1
- package/plugins/pageBuilder/PageApwSettingsGetterPlugin.js +5 -5
- package/plugins/pageBuilder/PageApwSettingsGetterPlugin.js.map +1 -1
- package/plugins/pageBuilder/apwContentPagePlugins.js +3 -1
- package/plugins/pageBuilder/apwContentPagePlugins.js.map +1 -1
- package/plugins/pageBuilder/extendPbPageSettingsSchema.js +3 -1
- package/plugins/pageBuilder/extendPbPageSettingsSchema.js.map +1 -1
- package/plugins/pageBuilder/index.js +3 -1
- package/plugins/pageBuilder/index.js.map +1 -1
- package/plugins/pageBuilder/linkContentReviewToPage.js +16 -12
- package/plugins/pageBuilder/linkContentReviewToPage.js.map +1 -1
- package/plugins/pageBuilder/linkWorkflowToPage.js +3 -1
- package/plugins/pageBuilder/linkWorkflowToPage.js.map +1 -1
- package/plugins/pageBuilder/notifications/changeRequestNotification.js +3 -1
- package/plugins/pageBuilder/notifications/changeRequestNotification.js.map +1 -1
- package/plugins/pageBuilder/notifications/commentNotification.js +3 -1
- package/plugins/pageBuilder/notifications/commentNotification.js.map +1 -1
- package/plugins/pageBuilder/notifications/contentReviewNotification.js +3 -1
- package/plugins/pageBuilder/notifications/contentReviewNotification.js.map +1 -1
- package/plugins/pageBuilder/notifications/contentUrl.js +3 -1
- package/plugins/pageBuilder/notifications/contentUrl.js.map +1 -1
- package/plugins/pageBuilder/triggerContentReview.js +3 -1
- package/plugins/pageBuilder/triggerContentReview.js.map +1 -1
- package/plugins/pageBuilder/updateContentReviewStatus.js +11 -6
- package/plugins/pageBuilder/updateContentReviewStatus.js.map +1 -1
- package/plugins/pageBuilder/utils.d.ts +2 -2
- package/plugins/pageBuilder/utils.js +3 -1
- package/plugins/pageBuilder/utils.js.map +1 -1
- package/plugins/utils.d.ts +1 -1
- package/plugins/utils.js +6 -3
- package/plugins/utils.js.map +1 -1
- package/scheduler/createScheduleActionMethods.js +44 -30
- package/scheduler/createScheduleActionMethods.js.map +1 -1
- package/scheduler/handlers/executeAction/index.d.ts +1 -1
- package/scheduler/handlers/executeAction/index.js +11 -6
- package/scheduler/handlers/executeAction/index.js.map +1 -1
- package/scheduler/handlers/executeAction/plugins/ApplicationGraphQL.js +5 -4
- package/scheduler/handlers/executeAction/plugins/ApplicationGraphQL.js.map +1 -1
- package/scheduler/handlers/executeAction/plugins/HeadlessCMSGraphQL.js +6 -7
- package/scheduler/handlers/executeAction/plugins/HeadlessCMSGraphQL.js.map +1 -1
- package/scheduler/handlers/executeAction/plugins/PageBuilderGraphQL.js +4 -7
- package/scheduler/handlers/executeAction/plugins/PageBuilderGraphQL.js.map +1 -1
- package/scheduler/handlers/executeAction/security.js +3 -1
- package/scheduler/handlers/executeAction/security.js.map +1 -1
- package/scheduler/handlers/scheduleAction/index.d.ts +1 -1
- package/scheduler/handlers/scheduleAction/index.js +21 -14
- package/scheduler/handlers/scheduleAction/index.js.map +1 -1
- package/scheduler/handlers/scheduleAction/scheduleAction.utils.js +17 -14
- package/scheduler/handlers/scheduleAction/scheduleAction.utils.js.map +1 -1
- package/scheduler/handlers/utils.d.ts +2 -3
- package/scheduler/handlers/utils.js +6 -7
- package/scheduler/handlers/utils.js.map +1 -1
- package/scheduler/index.js +3 -1
- package/scheduler/index.js.map +1 -1
- package/scheduler/types.d.ts +10 -8
- package/scheduler/types.js +14 -12
- package/scheduler/types.js.map +1 -1
- package/storageOperations/changeRequestStorageOperations.js +60 -27
- package/storageOperations/changeRequestStorageOperations.js.map +1 -1
- package/storageOperations/commentStorageOperations.js +36 -30
- package/storageOperations/commentStorageOperations.js.map +1 -1
- package/storageOperations/contentReviewStorageOperations.d.ts +1 -1
- package/storageOperations/contentReviewStorageOperations.js +35 -27
- package/storageOperations/contentReviewStorageOperations.js.map +1 -1
- package/storageOperations/index.d.ts +1 -7
- package/storageOperations/index.js +11 -16
- package/storageOperations/index.js.map +1 -1
- package/storageOperations/models/changeRequest.model.d.ts +1 -2
- package/storageOperations/models/changeRequest.model.js +7 -7
- package/storageOperations/models/changeRequest.model.js.map +1 -1
- package/storageOperations/models/comment.model.d.ts +1 -2
- package/storageOperations/models/comment.model.js +7 -7
- package/storageOperations/models/comment.model.js.map +1 -1
- package/storageOperations/models/contentReview.model.d.ts +1 -2
- package/storageOperations/models/contentReview.model.js +13 -11
- package/storageOperations/models/contentReview.model.js.map +1 -1
- package/storageOperations/models/index.js +6 -26
- package/storageOperations/models/index.js.map +1 -1
- package/storageOperations/models/reviewer.model.d.ts +1 -2
- package/storageOperations/models/reviewer.model.js +8 -8
- package/storageOperations/models/reviewer.model.js.map +1 -1
- package/storageOperations/models/utils.js +3 -1
- package/storageOperations/models/utils.js.map +1 -1
- package/storageOperations/models/workflow.model.d.ts +1 -2
- package/storageOperations/models/workflow.model.js +19 -19
- package/storageOperations/models/workflow.model.js.map +1 -1
- package/storageOperations/reviewerStorageOperations.d.ts +1 -1
- package/storageOperations/reviewerStorageOperations.js +38 -35
- package/storageOperations/reviewerStorageOperations.js.map +1 -1
- package/storageOperations/types.js +3 -1
- package/storageOperations/workflowStorageOperations.js +41 -31
- package/storageOperations/workflowStorageOperations.js.map +1 -1
- package/types.d.ts +16 -16
- package/types.js +126 -28
- package/types.js.map +1 -1
- package/utils/contentApwSettingsPlugin.js +3 -1
- package/utils/contentApwSettingsPlugin.js.map +1 -1
- package/utils/errors.js +3 -1
- package/utils/errors.js.map +1 -1
- package/utils/fieldResolver.js +7 -7
- package/utils/fieldResolver.js.map +1 -1
- package/utils/pickEntryFieldValues.d.ts +3 -0
- package/utils/pickEntryFieldValues.js +31 -0
- package/utils/pickEntryFieldValues.js.map +1 -0
- package/utils/resolve.d.ts +1 -1
- package/utils/resolve.js +3 -1
- package/utils/resolve.js.map +1 -1
- package/storageOperations/models/contentModelPluginFactory.d.ts +0 -11
- package/storageOperations/models/contentModelPluginFactory.js +0 -19
- package/storageOperations/models/contentModelPluginFactory.js.map +0 -1
@@ -5,8 +5,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
value: true
|
6
6
|
});
|
7
7
|
exports.createChangeRequestStorageOperations = void 0;
|
8
|
-
var
|
9
|
-
var _index = require("./index");
|
8
|
+
var _pickEntryFieldValues = require("../utils/pickEntryFieldValues");
|
10
9
|
var _fieldResolver = require("../utils/fieldResolver");
|
11
10
|
var _error = _interopRequireDefault(require("@webiny/error"));
|
12
11
|
const createChangeRequestStorageOperations = params => {
|
@@ -16,9 +15,9 @@ const createChangeRequestStorageOperations = params => {
|
|
16
15
|
security
|
17
16
|
} = params;
|
18
17
|
const getChangeRequestModel = async () => {
|
19
|
-
security.
|
20
|
-
|
21
|
-
|
18
|
+
const model = await security.withoutAuthorization(async () => {
|
19
|
+
return cms.getModel("apwChangeRequestModelDefinition");
|
20
|
+
});
|
22
21
|
if (!model) {
|
23
22
|
throw new _error.default("Could not find `apwChangeRequestModelDefinition` model.", "MODEL_NOT_FOUND_ERROR");
|
24
23
|
}
|
@@ -28,12 +27,12 @@ const createChangeRequestStorageOperations = params => {
|
|
28
27
|
id
|
29
28
|
}) => {
|
30
29
|
const model = await getChangeRequestModel();
|
31
|
-
security.
|
32
|
-
|
33
|
-
|
30
|
+
const entry = await security.withoutAuthorization(async () => {
|
31
|
+
return cms.getEntryById(model, id);
|
32
|
+
});
|
34
33
|
return (0, _fieldResolver.getFieldValues)({
|
35
34
|
entry,
|
36
|
-
fields:
|
35
|
+
fields: _pickEntryFieldValues.baseFields,
|
37
36
|
context: getCmsContext(),
|
38
37
|
transformers: [(0, _fieldResolver.getTransformer)(model, "body")]
|
39
38
|
});
|
@@ -43,15 +42,18 @@ const createChangeRequestStorageOperations = params => {
|
|
43
42
|
getChangeRequest,
|
44
43
|
async listChangeRequests(params) {
|
45
44
|
const model = await getChangeRequestModel();
|
46
|
-
security.
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
45
|
+
const [entries, meta] = await security.withoutAuthorization(async () => {
|
46
|
+
return cms.listLatestEntries(model, {
|
47
|
+
...params,
|
48
|
+
where: {
|
49
|
+
...params.where
|
50
|
+
}
|
51
|
+
});
|
52
|
+
});
|
51
53
|
try {
|
52
54
|
const all = await Promise.all(entries.map(entry => (0, _fieldResolver.getFieldValues)({
|
53
55
|
entry,
|
54
|
-
fields:
|
56
|
+
fields: _pickEntryFieldValues.baseFields,
|
55
57
|
context: getCmsContext(),
|
56
58
|
transformers: [(0, _fieldResolver.getTransformer)(model, "body")]
|
57
59
|
})));
|
@@ -62,18 +64,19 @@ const createChangeRequestStorageOperations = params => {
|
|
62
64
|
},
|
63
65
|
async createChangeRequest(params) {
|
64
66
|
const model = await getChangeRequestModel();
|
65
|
-
security.
|
66
|
-
|
67
|
-
|
67
|
+
const entry = await security.withoutAuthorization(async () => {
|
68
|
+
return cms.createEntry(model, params.data);
|
69
|
+
});
|
68
70
|
return (0, _fieldResolver.getFieldValues)({
|
69
71
|
entry,
|
70
|
-
fields:
|
72
|
+
fields: _pickEntryFieldValues.baseFields,
|
71
73
|
context: getCmsContext(),
|
72
74
|
transformers: [(0, _fieldResolver.getTransformer)(model, "body")]
|
73
75
|
});
|
74
76
|
},
|
75
77
|
async updateChangeRequest(params) {
|
76
78
|
const model = await getChangeRequestModel();
|
79
|
+
|
77
80
|
/**
|
78
81
|
* We're fetching the existing entry here because we're not accepting "app" field as input,
|
79
82
|
* but, we still need to retain its value after the "update" operation.
|
@@ -81,23 +84,53 @@ const createChangeRequestStorageOperations = params => {
|
|
81
84
|
const existingEntry = await getChangeRequest({
|
82
85
|
id: params.id
|
83
86
|
});
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
+
|
88
|
+
/**
|
89
|
+
* Only creator can update the change request
|
90
|
+
*/
|
91
|
+
if (existingEntry.createdBy.id !== security.getIdentity().id) {
|
92
|
+
throw new _error.default("A change request can only be updated by its creator.", "ONLY_CREATOR_CAN_UPDATE_CHANGE_REQUEST");
|
93
|
+
}
|
94
|
+
const entry = await security.withoutAuthorization(async () => {
|
95
|
+
return cms.updateEntry(model, params.id, {
|
96
|
+
...existingEntry,
|
97
|
+
...params.data,
|
98
|
+
savedOn: new Date()
|
99
|
+
});
|
100
|
+
});
|
87
101
|
return (0, _fieldResolver.getFieldValues)({
|
88
102
|
entry,
|
89
|
-
fields:
|
103
|
+
fields: _pickEntryFieldValues.baseFields,
|
90
104
|
context: getCmsContext(),
|
91
105
|
transformers: [(0, _fieldResolver.getTransformer)(model, "body")]
|
92
106
|
});
|
93
107
|
},
|
94
108
|
async deleteChangeRequest(params) {
|
95
109
|
const model = await getChangeRequestModel();
|
96
|
-
security.
|
97
|
-
|
98
|
-
|
110
|
+
if (!security.getIdentity()) {
|
111
|
+
return true;
|
112
|
+
}
|
113
|
+
|
114
|
+
/**
|
115
|
+
* We're fetching the existing entry
|
116
|
+
*/
|
117
|
+
const existingEntry = await getChangeRequest({
|
118
|
+
id: params.id
|
119
|
+
});
|
120
|
+
|
121
|
+
/**
|
122
|
+
* Only creator can delete the change request
|
123
|
+
*/
|
124
|
+
if (existingEntry.createdBy.id !== security.getIdentity().id) {
|
125
|
+
throw new _error.default("A change request can only be deleted by its creator.", "ONLY_CREATOR_CAN_DELETE_CHANGE_REQUEST");
|
126
|
+
}
|
127
|
+
await security.withoutAuthorization(async () => {
|
128
|
+
return cms.deleteEntry(model, params.id);
|
129
|
+
});
|
99
130
|
return true;
|
100
131
|
}
|
101
132
|
};
|
102
133
|
};
|
103
|
-
exports.createChangeRequestStorageOperations = createChangeRequestStorageOperations;
|
134
|
+
exports.createChangeRequestStorageOperations = createChangeRequestStorageOperations;
|
135
|
+
|
136
|
+
//# sourceMappingURL=changeRequestStorageOperations.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["createChangeRequestStorageOperations","params","cms","getCmsContext","security","getChangeRequestModel","
|
1
|
+
{"version":3,"names":["_pickEntryFieldValues","require","_fieldResolver","_error","_interopRequireDefault","createChangeRequestStorageOperations","params","cms","getCmsContext","security","getChangeRequestModel","model","withoutAuthorization","getModel","WebinyError","getChangeRequest","id","entry","getEntryById","getFieldValues","fields","baseFields","context","transformers","getTransformer","listChangeRequests","entries","meta","listLatestEntries","where","all","Promise","map","ex","message","code","data","createChangeRequest","createEntry","updateChangeRequest","existingEntry","createdBy","getIdentity","updateEntry","savedOn","Date","deleteChangeRequest","deleteEntry","exports"],"sources":["changeRequestStorageOperations.ts"],"sourcesContent":["import { ApwChangeRequestStorageOperations } from \"./types\";\nimport { CreateApwStorageOperationsParams } from \"~/storageOperations/index\";\nimport { baseFields } from \"~/utils/pickEntryFieldValues\";\nimport { getFieldValues, getTransformer } from \"~/utils/fieldResolver\";\nimport WebinyError from \"@webiny/error\";\nimport { ApwChangeRequest } from \"~/types\";\n\nexport const createChangeRequestStorageOperations = (\n params: CreateApwStorageOperationsParams\n): ApwChangeRequestStorageOperations => {\n const { cms, getCmsContext, security } = params;\n const getChangeRequestModel = async () => {\n const model = await security.withoutAuthorization(async () => {\n return cms.getModel(\"apwChangeRequestModelDefinition\");\n });\n if (!model) {\n throw new WebinyError(\n \"Could not find `apwChangeRequestModelDefinition` model.\",\n \"MODEL_NOT_FOUND_ERROR\"\n );\n }\n return model;\n };\n const getChangeRequest: ApwChangeRequestStorageOperations[\"getChangeRequest\"] = async ({\n id\n }) => {\n const model = await getChangeRequestModel();\n\n const entry = await security.withoutAuthorization(async () => {\n return cms.getEntryById(model, id);\n });\n return getFieldValues({\n entry,\n fields: baseFields,\n context: getCmsContext(),\n transformers: [getTransformer(model, \"body\")]\n });\n };\n return {\n getChangeRequestModel,\n getChangeRequest,\n async listChangeRequests(params) {\n const model = await getChangeRequestModel();\n\n const [entries, meta] = await security.withoutAuthorization(async () => {\n return cms.listLatestEntries(model, {\n ...params,\n where: {\n ...params.where\n }\n });\n });\n try {\n const all = await Promise.all(\n entries.map(entry =>\n getFieldValues<ApwChangeRequest>({\n entry,\n fields: baseFields,\n context: getCmsContext(),\n transformers: [getTransformer(model, \"body\")]\n })\n )\n );\n return [all, meta];\n } catch (ex) {\n throw new WebinyError(ex.message, ex.code, ex.data);\n }\n },\n async createChangeRequest(params) {\n const model = await getChangeRequestModel();\n\n const entry = await security.withoutAuthorization(async () => {\n return cms.createEntry(model, params.data);\n });\n return getFieldValues({\n entry,\n fields: baseFields,\n context: getCmsContext(),\n transformers: [getTransformer(model, \"body\")]\n });\n },\n async updateChangeRequest(params) {\n const model = await getChangeRequestModel();\n\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 getChangeRequest({ id: params.id });\n\n /**\n * Only creator can update the change request\n */\n if (existingEntry.createdBy.id !== security.getIdentity().id) {\n throw new WebinyError(\n \"A change request can only be updated by its creator.\",\n \"ONLY_CREATOR_CAN_UPDATE_CHANGE_REQUEST\"\n );\n }\n\n const entry = await security.withoutAuthorization(async () => {\n return cms.updateEntry(model, params.id, {\n ...existingEntry,\n ...params.data,\n savedOn: new Date()\n });\n });\n return getFieldValues({\n entry,\n fields: baseFields,\n context: getCmsContext(),\n transformers: [getTransformer(model, \"body\")]\n });\n },\n async deleteChangeRequest(params) {\n const model = await getChangeRequestModel();\n\n if (!security.getIdentity()) {\n return true;\n }\n\n /**\n * We're fetching the existing entry\n */\n const existingEntry = await getChangeRequest({ id: params.id });\n\n /**\n * Only creator can delete the change request\n */\n if (existingEntry.createdBy.id !== security.getIdentity().id) {\n throw new WebinyError(\n \"A change request can only be deleted by its creator.\",\n \"ONLY_CREATOR_CAN_DELETE_CHANGE_REQUEST\"\n );\n }\n\n await security.withoutAuthorization(async () => {\n return cms.deleteEntry(model, params.id);\n });\n\n return true;\n }\n };\n};\n"],"mappings":";;;;;;;AAEA,IAAAA,qBAAA,GAAAC,OAAA;AACA,IAAAC,cAAA,GAAAD,OAAA;AACA,IAAAE,MAAA,GAAAC,sBAAA,CAAAH,OAAA;AAGO,MAAMI,oCAAoC,GAC7CC,MAAwC,IACJ;EACpC,MAAM;IAAEC,GAAG;IAAEC,aAAa;IAAEC;EAAS,CAAC,GAAGH,MAAM;EAC/C,MAAMI,qBAAqB,GAAG,MAAAA,CAAA,KAAY;IACtC,MAAMC,KAAK,GAAG,MAAMF,QAAQ,CAACG,oBAAoB,CAAC,YAAY;MAC1D,OAAOL,GAAG,CAACM,QAAQ,CAAC,iCAAiC,CAAC;IAC1D,CAAC,CAAC;IACF,IAAI,CAACF,KAAK,EAAE;MACR,MAAM,IAAIG,cAAW,CACjB,yDAAyD,EACzD,uBACJ,CAAC;IACL;IACA,OAAOH,KAAK;EAChB,CAAC;EACD,MAAMI,gBAAuE,GAAG,MAAAA,CAAO;IACnFC;EACJ,CAAC,KAAK;IACF,MAAML,KAAK,GAAG,MAAMD,qBAAqB,CAAC,CAAC;IAE3C,MAAMO,KAAK,GAAG,MAAMR,QAAQ,CAACG,oBAAoB,CAAC,YAAY;MAC1D,OAAOL,GAAG,CAACW,YAAY,CAACP,KAAK,EAAEK,EAAE,CAAC;IACtC,CAAC,CAAC;IACF,OAAO,IAAAG,6BAAc,EAAC;MAClBF,KAAK;MACLG,MAAM,EAAEC,gCAAU;MAClBC,OAAO,EAAEd,aAAa,CAAC,CAAC;MACxBe,YAAY,EAAE,CAAC,IAAAC,6BAAc,EAACb,KAAK,EAAE,MAAM,CAAC;IAChD,CAAC,CAAC;E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A;MACY,MAAMF,aAAa,GAAG,MAAMzB,gBAAgB,CAAC;QAAEC,EAAE,EAAEV,MAAM,CAACU;MAAG,CAAC,CAAC;;MAE/D;AACZ;AACA;MACY,IAAIwB,aAAa,CAACC,SAAS,CAACzB,EAAE,KAAKP,QAAQ,CAACiC,WAAW,CAAC,CAAC,CAAC1B,EAAE,EAAE;QAC1D,MAAM,IAAIF,cAAW,CACjB,sDAAsD,EACtD,wCACJ,CAAC;MACL;MAEA,MAAML,QAAQ,CAACG,oBAAoB,CAAC,YAAY;QAC5C,OAAOL,GAAG,CAACwC,WAAW,CAACpC,KAAK,EAAEL,MAAM,CAACU,EAAE,CAAC;MAC5C,CAAC,CAAC;MAEF,OAAO,IAAI;IACf;EACJ,CAAC;AACL,CAAC;AAACgC,OAAA,CAAA3C,oCAAA,GAAAA,oCAAA"}
|
@@ -5,9 +5,8 @@ Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
value: true
|
6
6
|
});
|
7
7
|
exports.createCommentStorageOperations = void 0;
|
8
|
-
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
|
9
|
-
var _index = require("./index");
|
10
8
|
var _fieldResolver = require("../utils/fieldResolver");
|
9
|
+
var _pickEntryFieldValues = require("../utils/pickEntryFieldValues");
|
11
10
|
var _error = _interopRequireDefault(require("@webiny/error"));
|
12
11
|
var _comment = require("./models/comment.model");
|
13
12
|
const pickIdFromChangeRequest = obj => {
|
@@ -24,9 +23,9 @@ const createCommentStorageOperations = ({
|
|
24
23
|
security
|
25
24
|
}) => {
|
26
25
|
const getCommentModel = async () => {
|
27
|
-
security.
|
28
|
-
|
29
|
-
|
26
|
+
const model = await security.withoutAuthorization(async () => {
|
27
|
+
return cms.getModel(_comment.COMMENT_MODEL_ID);
|
28
|
+
});
|
30
29
|
if (!model) {
|
31
30
|
throw new _error.default(`Could not find "${_comment.COMMENT_MODEL_ID}" model.`, "MODEL_NOT_FOUND_ERROR");
|
32
31
|
}
|
@@ -36,12 +35,12 @@ const createCommentStorageOperations = ({
|
|
36
35
|
id
|
37
36
|
}) => {
|
38
37
|
const model = await getCommentModel();
|
39
|
-
security.
|
40
|
-
|
41
|
-
|
38
|
+
const entry = await security.withoutAuthorization(async () => {
|
39
|
+
return cms.getEntryById(model, id);
|
40
|
+
});
|
42
41
|
return (0, _fieldResolver.getFieldValues)({
|
43
42
|
entry,
|
44
|
-
fields:
|
43
|
+
fields: _pickEntryFieldValues.baseFields,
|
45
44
|
context: getCmsContext(),
|
46
45
|
transformers: [(0, _fieldResolver.getTransformer)(model, "body")]
|
47
46
|
});
|
@@ -54,12 +53,12 @@ const createCommentStorageOperations = ({
|
|
54
53
|
},
|
55
54
|
async listComments(params) {
|
56
55
|
const model = await getCommentModel();
|
57
|
-
security.
|
58
|
-
|
59
|
-
|
56
|
+
const [entries, meta] = await security.withoutAuthorization(async () => {
|
57
|
+
return cms.listLatestEntries(model, params);
|
58
|
+
});
|
60
59
|
const values = await Promise.all(entries.map(entry => (0, _fieldResolver.getFieldValues)({
|
61
60
|
entry,
|
62
|
-
fields:
|
61
|
+
fields: _pickEntryFieldValues.baseFields,
|
63
62
|
context: getCmsContext(),
|
64
63
|
transformers: [(0, _fieldResolver.getTransformer)(model, "body")]
|
65
64
|
})));
|
@@ -69,17 +68,18 @@ const createCommentStorageOperations = ({
|
|
69
68
|
async createComment(params) {
|
70
69
|
const model = await getCommentModel();
|
71
70
|
const refModel = await this.getChangeRequestModel();
|
72
|
-
security.
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
71
|
+
const entry = await security.withoutAuthorization(async () => {
|
72
|
+
return cms.createEntry(model, {
|
73
|
+
...params.data,
|
74
|
+
changeRequest: {
|
75
|
+
id: params.data.changeRequest,
|
76
|
+
modelId: refModel.modelId
|
77
|
+
}
|
78
|
+
});
|
79
|
+
});
|
80
80
|
const values = await (0, _fieldResolver.getFieldValues)({
|
81
81
|
entry,
|
82
|
-
fields:
|
82
|
+
fields: _pickEntryFieldValues.baseFields,
|
83
83
|
context: getCmsContext(),
|
84
84
|
transformers: [(0, _fieldResolver.getTransformer)(model, "body")]
|
85
85
|
});
|
@@ -94,12 +94,16 @@ const createCommentStorageOperations = ({
|
|
94
94
|
const existingEntry = await getComment({
|
95
95
|
id: params.id
|
96
96
|
});
|
97
|
-
security.
|
98
|
-
|
99
|
-
|
97
|
+
const entry = await security.withoutAuthorization(async () => {
|
98
|
+
return cms.updateEntry(model, params.id, {
|
99
|
+
...existingEntry,
|
100
|
+
...params.data,
|
101
|
+
savedOn: new Date()
|
102
|
+
});
|
103
|
+
});
|
100
104
|
const values = await (0, _fieldResolver.getFieldValues)({
|
101
105
|
entry,
|
102
|
-
fields:
|
106
|
+
fields: _pickEntryFieldValues.baseFields,
|
103
107
|
context: getCmsContext(),
|
104
108
|
transformers: [(0, _fieldResolver.getTransformer)(model, "body")]
|
105
109
|
});
|
@@ -107,11 +111,13 @@ const createCommentStorageOperations = ({
|
|
107
111
|
},
|
108
112
|
async deleteComment(params) {
|
109
113
|
const model = await getCommentModel();
|
110
|
-
security.
|
111
|
-
|
112
|
-
|
114
|
+
await security.withoutAuthorization(async () => {
|
115
|
+
return cms.deleteEntry(model, params.id);
|
116
|
+
});
|
113
117
|
return true;
|
114
118
|
}
|
115
119
|
};
|
116
120
|
};
|
117
|
-
exports.createCommentStorageOperations = createCommentStorageOperations;
|
121
|
+
exports.createCommentStorageOperations = createCommentStorageOperations;
|
122
|
+
|
123
|
+
//# sourceMappingURL=commentStorageOperations.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["pickIdFromChangeRequest","obj","rawValue","id","createCommentStorageOperations","cms","getCmsContext","security","getCommentModel","
|
1
|
+
{"version":3,"names":["_fieldResolver","require","_pickEntryFieldValues","_error","_interopRequireDefault","_comment","pickIdFromChangeRequest","obj","rawValue","id","createCommentStorageOperations","cms","getCmsContext","security","getCommentModel","model","withoutAuthorization","getModel","COMMENT_MODEL_ID","WebinyError","getComment","entry","getEntryById","getFieldValues","fields","baseFields","context","transformers","getTransformer","params","values","listComments","entries","meta","listLatestEntries","Promise","all","map","value","createComment","refModel","getChangeRequestModel","createEntry","data","changeRequest","modelId","updateComment","existingEntry","updateEntry","savedOn","Date","deleteComment","deleteEntry","exports"],"sources":["commentStorageOperations.ts"],"sourcesContent":["import { ApwStorageOperations } from \"./types\";\nimport { ApwCommentStorageOperations } from \"./types\";\nimport { CreateApwStorageOperationsParams } from \"~/storageOperations/index\";\nimport { getFieldValues, getTransformer } from \"~/utils/fieldResolver\";\nimport { baseFields } from \"~/utils/pickEntryFieldValues\";\n\nimport WebinyError from \"@webiny/error\";\nimport { ApwComment } from \"~/types\";\nimport { CmsEntryListParams } from \"@webiny/api-headless-cms/types\";\nimport { COMMENT_MODEL_ID } from \"~/storageOperations/models/comment.model\";\n\nconst pickIdFromChangeRequest = (obj: Record<string, any>): ApwComment => {\n const rawValue = obj[\"changeRequest\"];\n if (!rawValue) {\n return obj as unknown as ApwComment;\n }\n obj[\"changeRequest\"] = rawValue.id;\n return obj as unknown as ApwComment;\n};\n\nexport const createCommentStorageOperations = ({\n cms,\n getCmsContext,\n security\n}: CreateApwStorageOperationsParams): ApwCommentStorageOperations => {\n const getCommentModel = async () => {\n const model = await security.withoutAuthorization(async () => {\n return cms.getModel(COMMENT_MODEL_ID);\n });\n\n if (!model) {\n throw new WebinyError(\n `Could not find \"${COMMENT_MODEL_ID}\" model.`,\n \"MODEL_NOT_FOUND_ERROR\"\n );\n }\n return model;\n };\n const getComment: ApwCommentStorageOperations[\"getComment\"] = async ({ id }) => {\n const model = await getCommentModel();\n const entry = await security.withoutAuthorization(async () => {\n return cms.getEntryById(model, id);\n });\n\n return getFieldValues({\n entry,\n fields: baseFields,\n context: getCmsContext(),\n transformers: [getTransformer(model, \"body\")]\n });\n };\n return {\n getCommentModel,\n getComment: async params => {\n const values = await getComment(params);\n return pickIdFromChangeRequest(values);\n },\n async listComments(params) {\n const model = await getCommentModel();\n const [entries, meta] = await security.withoutAuthorization(async () => {\n return cms.listLatestEntries(model, params as CmsEntryListParams);\n });\n const values = await Promise.all(\n entries.map(entry =>\n getFieldValues<ApwComment>({\n entry,\n fields: baseFields,\n context: getCmsContext(),\n transformers: [getTransformer(model, \"body\")]\n })\n )\n );\n const all = values.map(value => pickIdFromChangeRequest(value));\n return [all, meta];\n },\n async createComment(this: ApwStorageOperations, params) {\n const model = await getCommentModel();\n const refModel = await this.getChangeRequestModel();\n\n const entry = await security.withoutAuthorization(async () => {\n return cms.createEntry(model, {\n ...params.data,\n changeRequest: {\n id: params.data.changeRequest,\n modelId: refModel.modelId\n }\n });\n });\n\n const values = await getFieldValues({\n entry,\n fields: baseFields,\n context: getCmsContext(),\n transformers: [getTransformer(model, \"body\")]\n });\n return pickIdFromChangeRequest(values);\n },\n async updateComment(params) {\n const model = await getCommentModel();\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 getComment({ id: params.id });\n\n const entry = await security.withoutAuthorization(async () => {\n return cms.updateEntry(model, params.id, {\n ...existingEntry,\n ...params.data,\n savedOn: new Date()\n });\n });\n\n const values = await getFieldValues({\n entry,\n fields: baseFields,\n context: getCmsContext(),\n transformers: [getTransformer(model, \"body\")]\n });\n return pickIdFromChangeRequest(values);\n },\n async deleteComment(params) {\n const model = await getCommentModel();\n await security.withoutAuthorization(async () => {\n return cms.deleteEntry(model, params.id);\n });\n return true;\n }\n };\n};\n"],"mappings":";;;;;;;AAGA,IAAAA,cAAA,GAAAC,OAAA;AACA,IAAAC,qBAAA,GAAAD,OAAA;AAEA,IAAAE,MAAA,GAAAC,sBAAA,CAAAH,OAAA;AAGA,IAAAI,QAAA,GAAAJ,OAAA;AAEA,MAAMK,uBAAuB,GAAIC,GAAwB,IAAiB;EACtE,MAAMC,QAAQ,GAAGD,GAAG,CAAC,eAAe,CAAC;EACrC,IAAI,CAACC,QAAQ,EAAE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-1,3 +1,3 @@
|
|
1
1
|
import { ApwContentReviewStorageOperations } from "./types";
|
2
|
-
import { CreateApwStorageOperationsParams } from "
|
2
|
+
import { CreateApwStorageOperationsParams } from ".";
|
3
3
|
export declare const createContentReviewStorageOperations: ({ cms, security }: CreateApwStorageOperationsParams) => ApwContentReviewStorageOperations;
|
@@ -5,8 +5,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
value: true
|
6
6
|
});
|
7
7
|
exports.createContentReviewStorageOperations = void 0;
|
8
|
-
var
|
9
|
-
var _index = require("./index");
|
8
|
+
var _pickEntryFieldValues = require("../utils/pickEntryFieldValues");
|
10
9
|
var _error = _interopRequireDefault(require("@webiny/error"));
|
11
10
|
var _contentReview = require("./models/contentReview.model");
|
12
11
|
const createContentReviewStorageOperations = ({
|
@@ -14,9 +13,9 @@ const createContentReviewStorageOperations = ({
|
|
14
13
|
security
|
15
14
|
}) => {
|
16
15
|
const getContentReviewModel = async () => {
|
17
|
-
security.
|
18
|
-
|
19
|
-
|
16
|
+
const model = await security.withoutAuthorization(async () => {
|
17
|
+
return cms.getModel(_contentReview.CONTENT_REVIEW_MODEL_ID);
|
18
|
+
});
|
20
19
|
if (!model) {
|
21
20
|
throw new _error.default(`Could not find "${_contentReview.CONTENT_REVIEW_MODEL_ID}" model.`, "MODEL_NOT_FOUND_ERROR");
|
22
21
|
}
|
@@ -26,29 +25,32 @@ const createContentReviewStorageOperations = ({
|
|
26
25
|
id
|
27
26
|
}) => {
|
28
27
|
const model = await getContentReviewModel();
|
29
|
-
security.
|
30
|
-
|
31
|
-
|
32
|
-
return (0,
|
28
|
+
const entry = await security.withoutAuthorization(async () => {
|
29
|
+
return cms.getEntryById(model, id);
|
30
|
+
});
|
31
|
+
return (0, _pickEntryFieldValues.pickEntryFieldValues)(entry);
|
33
32
|
};
|
34
33
|
return {
|
35
34
|
getContentReviewModel,
|
36
35
|
getContentReview,
|
37
36
|
async listContentReviews(params) {
|
38
37
|
const model = await getContentReviewModel();
|
39
|
-
security.
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
38
|
+
const [entries, meta] = await security.withoutAuthorization(async () => {
|
39
|
+
return cms.listLatestEntries(model, {
|
40
|
+
...params,
|
41
|
+
where: {
|
42
|
+
...params.where
|
43
|
+
}
|
44
|
+
});
|
45
|
+
});
|
46
|
+
return [entries.map(_pickEntryFieldValues.pickEntryFieldValues), meta];
|
45
47
|
},
|
46
48
|
async createContentReview(params) {
|
47
49
|
const model = await getContentReviewModel();
|
48
|
-
security.
|
49
|
-
|
50
|
-
|
51
|
-
return (0,
|
50
|
+
const entry = await security.withoutAuthorization(async () => {
|
51
|
+
return cms.createEntry(model, params.data);
|
52
|
+
});
|
53
|
+
return (0, _pickEntryFieldValues.pickEntryFieldValues)(entry);
|
52
54
|
},
|
53
55
|
async updateContentReview(params) {
|
54
56
|
const model = await getContentReviewModel();
|
@@ -59,18 +61,24 @@ const createContentReviewStorageOperations = ({
|
|
59
61
|
const existingEntry = await getContentReview({
|
60
62
|
id: params.id
|
61
63
|
});
|
62
|
-
security.
|
63
|
-
|
64
|
-
|
65
|
-
|
64
|
+
const entry = await security.withoutAuthorization(async () => {
|
65
|
+
return cms.updateEntry(model, params.id, {
|
66
|
+
...existingEntry,
|
67
|
+
...params.data,
|
68
|
+
savedOn: new Date()
|
69
|
+
});
|
70
|
+
});
|
71
|
+
return (0, _pickEntryFieldValues.pickEntryFieldValues)(entry);
|
66
72
|
},
|
67
73
|
async deleteContentReview(params) {
|
68
74
|
const model = await getContentReviewModel();
|
69
|
-
security.
|
70
|
-
|
71
|
-
|
75
|
+
await security.withoutAuthorization(async () => {
|
76
|
+
return cms.deleteEntry(model, params.id);
|
77
|
+
});
|
72
78
|
return true;
|
73
79
|
}
|
74
80
|
};
|
75
81
|
};
|
76
|
-
exports.createContentReviewStorageOperations = createContentReviewStorageOperations;
|
82
|
+
exports.createContentReviewStorageOperations = createContentReviewStorageOperations;
|
83
|
+
|
84
|
+
//# sourceMappingURL=contentReviewStorageOperations.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["createContentReviewStorageOperations","cms","security","getContentReviewModel","
|
1
|
+
{"version":3,"names":["_pickEntryFieldValues","require","_error","_interopRequireDefault","_contentReview","createContentReviewStorageOperations","cms","security","getContentReviewModel","model","withoutAuthorization","getModel","CONTENT_REVIEW_MODEL_ID","WebinyError","getContentReview","id","entry","getEntryById","pickEntryFieldValues","listContentReviews","params","entries","meta","listLatestEntries","where","map","createContentReview","createEntry","data","updateContentReview","existingEntry","updateEntry","savedOn","Date","deleteContentReview","deleteEntry","exports"],"sources":["contentReviewStorageOperations.ts"],"sourcesContent":["import { ApwContentReviewStorageOperations } from \"./types\";\nimport { CreateApwStorageOperationsParams } from \"~/storageOperations\";\nimport { pickEntryFieldValues } from \"~/utils/pickEntryFieldValues\";\nimport WebinyError from \"@webiny/error\";\nimport { CONTENT_REVIEW_MODEL_ID } from \"~/storageOperations/models/contentReview.model\";\nimport { ApwContentReview } from \"~/types\";\n\nexport const createContentReviewStorageOperations = ({\n cms,\n security\n}: CreateApwStorageOperationsParams): ApwContentReviewStorageOperations => {\n const getContentReviewModel = async () => {\n const model = await security.withoutAuthorization(async () => {\n return cms.getModel(CONTENT_REVIEW_MODEL_ID);\n });\n if (!model) {\n throw new WebinyError(\n `Could not find \"${CONTENT_REVIEW_MODEL_ID}\" model.`,\n \"MODEL_NOT_FOUND_ERROR\"\n );\n }\n return model;\n };\n const getContentReview: ApwContentReviewStorageOperations[\"getContentReview\"] = async ({\n id\n }) => {\n const model = await getContentReviewModel();\n const entry = await security.withoutAuthorization(async () => {\n return cms.getEntryById(model, id);\n });\n return pickEntryFieldValues(entry);\n };\n return {\n getContentReviewModel,\n getContentReview,\n async listContentReviews(params) {\n const model = await getContentReviewModel();\n\n const [entries, meta] = await security.withoutAuthorization(async () => {\n return cms.listLatestEntries(model, {\n ...params,\n where: {\n ...params.where\n }\n });\n });\n\n return [entries.map(pickEntryFieldValues<ApwContentReview>), meta];\n },\n async createContentReview(params) {\n const model = await getContentReviewModel();\n\n const entry = await security.withoutAuthorization(async () => {\n return cms.createEntry(model, params.data);\n });\n return pickEntryFieldValues(entry);\n },\n async updateContentReview(params) {\n const model = await getContentReviewModel();\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 getContentReview({ id: params.id });\n\n const entry = await security.withoutAuthorization(async () => {\n return cms.updateEntry(model, params.id, {\n ...existingEntry,\n ...params.data,\n savedOn: new Date()\n });\n });\n return pickEntryFieldValues(entry);\n },\n async deleteContentReview(params) {\n const model = await getContentReviewModel();\n\n await security.withoutAuthorization(async () => {\n return cms.deleteEntry(model, params.id);\n });\n\n return true;\n }\n };\n};\n"],"mappings":";;;;;;;AAEA,IAAAA,qBAAA,GAAAC,OAAA;AACA,IAAAC,MAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,cAAA,GAAAH,OAAA;AAGO,MAAMI,oCAAoC,GAAGA,CAAC;EACjDC,GAAG;EACHC;AAC8B,CAAC,KAAwC;EACvE,MAAMC,qBAAqB,GAAG,MAAAA,CAAA,KAAY;IACtC,MAAMC,KAAK,GAAG,MAAMF,QAAQ,CAACG,oBAAoB,CAAC,YAAY;MAC1D,OAAOJ,GAAG,CAACK,QAAQ,CAACC,sCAAuB,CAAC;IAChD,CAAC,CAAC;IACF,IAAI,CAACH,KAAK,EAAE;MACR,MAAM,IAAII,cAAW,CAChB,mBAAkBD,sCAAwB,UAAS,EACpD,uBACJ,CAAC;IACL;IACA,OAAOH,KAAK;EAChB,CAAC;EACD,MAAMK,gBAAuE,GAAG,MAAAA,CAAO;IACnFC;EACJ,CAAC,KAAK;IACF,MAAMN,KAAK,GAAG,MAAMD,qBAAqB,CAAC,CAAC;IAC3C,MAAMQ,KAAK,GAAG,MAAMT,QAAQ,CAACG,oBAAoB,CAAC,YAAY;MAC1D,OAAOJ,GAAG,CAACW,YAAY,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W,MAAM,CAACL,EAAE,EAAE;UACrC,GAAGe,aAAa;UAChB,GAAGV,MAAM,CAACQ,IAAI;UACdI,OAAO,EAAE,IAAIC,IAAI,CAAC;QACtB,CAAC,CAAC;MACN,CAAC,CAAC;MACF,OAAO,IAAAf,0CAAoB,EAACF,KAAK,CAAC;IACtC,CAAC;IACD,MAAMkB,mBAAmBA,CAACd,MAAM,EAAE;MAC9B,MAAMX,KAAK,GAAG,MAAMD,qBAAqB,CAAC,CAAC;MAE3C,MAAMD,QAAQ,CAACG,oBAAoB,CAAC,YAAY;QAC5C,OAAOJ,GAAG,CAAC6B,WAAW,CAAC1B,KAAK,EAAEW,MAAM,CAACL,EAAE,CAAC;MAC5C,CAAC,CAAC;MAEF,OAAO,IAAI;IACf;EACJ,CAAC;AACL,CAAC;AAACqB,OAAA,CAAA/B,oCAAA,GAAAA,oCAAA"}
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import { CmsContext,
|
1
|
+
import { CmsContext, HeadlessCms } from "@webiny/api-headless-cms/types";
|
2
2
|
import { ApwStorageOperations } from "../types";
|
3
3
|
import { Security } from "@webiny/api-security/types";
|
4
4
|
export interface CreateApwStorageOperationsParams {
|
@@ -6,10 +6,4 @@ export interface CreateApwStorageOperationsParams {
|
|
6
6
|
security: Security;
|
7
7
|
getCmsContext: () => CmsContext;
|
8
8
|
}
|
9
|
-
/**
|
10
|
-
* Using any because value can be a lot of types.
|
11
|
-
* TODO @ts-refactor figure out correct types.
|
12
|
-
*/
|
13
|
-
export declare function getFieldValues(entry: CmsEntry, fields: string[]): any;
|
14
|
-
export declare const baseFields: string[];
|
15
9
|
export declare const createStorageOperations: (params: CreateApwStorageOperationsParams) => ApwStorageOperations;
|
@@ -1,34 +1,29 @@
|
|
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
|
-
exports.createStorageOperations =
|
8
|
-
exports.getFieldValues = getFieldValues;
|
9
|
-
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
|
10
|
-
var _pick = _interopRequireDefault(require("lodash/pick"));
|
6
|
+
exports.createStorageOperations = void 0;
|
11
7
|
var _reviewerStorageOperations = require("./reviewerStorageOperations");
|
12
8
|
var _workflowStorageOperations = require("./workflowStorageOperations");
|
13
9
|
var _contentReviewStorageOperations = require("./contentReviewStorageOperations");
|
14
10
|
var _changeRequestStorageOperations = require("./changeRequestStorageOperations");
|
15
11
|
var _commentStorageOperations = require("./commentStorageOperations");
|
16
12
|
var _models = require("./models");
|
17
|
-
/**
|
18
|
-
* Using any because value can be a lot of types.
|
19
|
-
* TODO @ts-refactor figure out correct types.
|
20
|
-
*/
|
21
|
-
function getFieldValues(entry, fields) {
|
22
|
-
return (0, _objectSpread2.default)((0, _objectSpread2.default)({}, (0, _pick.default)(entry, fields)), entry.values);
|
23
|
-
}
|
24
|
-
const baseFields = ["id", "entryId", "createdBy", "createdOn", "savedOn"];
|
25
|
-
exports.baseFields = baseFields;
|
26
13
|
const createStorageOperations = params => {
|
27
14
|
const context = params.getCmsContext();
|
28
15
|
/**
|
29
16
|
* Register Apw models.
|
30
17
|
*/
|
31
18
|
(0, _models.createApwModels)(context);
|
32
|
-
return
|
19
|
+
return {
|
20
|
+
...(0, _reviewerStorageOperations.createReviewerStorageOperations)(params),
|
21
|
+
...(0, _workflowStorageOperations.createWorkflowStorageOperations)(params),
|
22
|
+
...(0, _contentReviewStorageOperations.createContentReviewStorageOperations)(params),
|
23
|
+
...(0, _changeRequestStorageOperations.createChangeRequestStorageOperations)(params),
|
24
|
+
...(0, _commentStorageOperations.createCommentStorageOperations)(params)
|
25
|
+
};
|
33
26
|
};
|
34
|
-
exports.createStorageOperations = createStorageOperations;
|
27
|
+
exports.createStorageOperations = createStorageOperations;
|
28
|
+
|
29
|
+
//# sourceMappingURL=index.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["
|
1
|
+
{"version":3,"names":["_reviewerStorageOperations","require","_workflowStorageOperations","_contentReviewStorageOperations","_changeRequestStorageOperations","_commentStorageOperations","_models","createStorageOperations","params","context","getCmsContext","createApwModels","createReviewerStorageOperations","createWorkflowStorageOperations","createContentReviewStorageOperations","createChangeRequestStorageOperations","createCommentStorageOperations","exports"],"sources":["index.ts"],"sourcesContent":["import { CmsContext, HeadlessCms } from \"@webiny/api-headless-cms/types\";\nimport { ApwStorageOperations } from \"~/types\";\nimport { createReviewerStorageOperations } from \"./reviewerStorageOperations\";\nimport { createWorkflowStorageOperations } from \"./workflowStorageOperations\";\nimport { createContentReviewStorageOperations } from \"./contentReviewStorageOperations\";\nimport { createChangeRequestStorageOperations } from \"./changeRequestStorageOperations\";\nimport { createCommentStorageOperations } from \"~/storageOperations/commentStorageOperations\";\nimport { createApwModels } from \"./models\";\nimport { Security } from \"@webiny/api-security/types\";\n\nexport interface CreateApwStorageOperationsParams {\n cms: HeadlessCms;\n security: Security;\n getCmsContext: () => CmsContext;\n}\n\nexport const createStorageOperations = (\n params: CreateApwStorageOperationsParams\n): ApwStorageOperations => {\n const context = params.getCmsContext();\n /**\n * Register Apw models.\n */\n createApwModels(context);\n\n return {\n ...createReviewerStorageOperations(params),\n ...createWorkflowStorageOperations(params),\n ...createContentReviewStorageOperations(params),\n ...createChangeRequestStorageOperations(params),\n ...createCommentStorageOperations(params)\n };\n};\n"],"mappings":";;;;;;AAEA,IAAAA,0BAAA,GAAAC,OAAA;AACA,IAAAC,0BAAA,GAAAD,OAAA;AACA,IAAAE,+BAAA,GAAAF,OAAA;AACA,IAAAG,+BAAA,GAAAH,OAAA;AACA,IAAAI,yBAAA,GAAAJ,OAAA;AACA,IAAAK,OAAA,GAAAL,OAAA;AASO,MAAMM,uBAAuB,GAChCC,MAAwC,IACjB;EACvB,MAAMC,OAAO,GAAGD,MAAM,CAACE,aAAa,CAAC,CAAC;EACtC;AACJ;AACA;EACI,IAAAC,uBAAe,EAACF,OAAO,CAAC;EAExB,OAAO;IACH,GAAG,IAAAG,0DAA+B,EAACJ,MAAM,CAAC;IAC1C,GAAG,IAAAK,0DAA+B,EAACL,MAAM,CAAC;IAC1C,GAAG,IAAAM,oEAAoC,EAACN,MAAM,CAAC;IAC/C,GAAG,IAAAO,oEAAoC,EAACP,MAAM,CAAC;IAC/C,GAAG,IAAAQ,wDAA8B,EAACR,MAAM;EAC5C,CAAC;AACL,CAAC;AAACS,OAAA,CAAAV,uBAAA,GAAAA,uBAAA"}
|
@@ -1,3 +1,2 @@
|
|
1
|
-
import { WorkflowModelDefinition } from "../../types";
|
2
1
|
export declare const CHANGE_REQUEST_MODEL_ID = "apwChangeRequestModelDefinition";
|
3
|
-
export declare const createChangeRequestModelDefinition: () =>
|
2
|
+
export declare const createChangeRequestModelDefinition: () => import("@webiny/api-headless-cms").CmsPrivateModelFull;
|