@webiny/api-apw 5.33.5-beta.0 → 5.34.0-beta.0
Sign up to get free protection for your applications and to get access to all the features.
- 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.js +1 -1
- package/crud/createChangeRequestMethods.js +21 -18
- package/crud/createChangeRequestMethods.js.map +1 -1
- package/crud/createCommentMethods.js +21 -18
- package/crud/createCommentMethods.js.map +1 -1
- package/crud/createContentReviewMethods.js +60 -50
- package/crud/createContentReviewMethods.js.map +1 -1
- package/crud/createReviewerMethods.js +21 -18
- package/crud/createReviewerMethods.js.map +1 -1
- package/crud/createWorkflowMethods.d.ts +1 -1
- package/crud/createWorkflowMethods.js +42 -20
- package/crud/createWorkflowMethods.js.map +1 -1
- package/crud/index.js +3 -7
- package/crud/index.js.map +1 -1
- package/crud/utils.js +4 -8
- package/crud/utils.js.map +1 -1
- package/index.d.ts +3 -3
- package/index.js +8 -4
- package/index.js.map +1 -1
- package/package.json +38 -37
- package/plugins/cms/CmsEntryApwSettingsGetterPlugin.js +1 -1
- package/plugins/cms/apwEntryPlugins.js +4 -8
- package/plugins/cms/apwEntryPlugins.js.map +1 -1
- package/plugins/cms/index.js +9 -1
- package/plugins/cms/index.js.map +1 -1
- package/plugins/cms/linkContentReviewToEntry.js +4 -4
- package/plugins/cms/linkContentReviewToEntry.js.map +1 -1
- package/plugins/cms/linkWorkflowToEntry.js +5 -5
- package/plugins/cms/linkWorkflowToEntry.js.map +1 -1
- 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.js +3 -3
- package/plugins/cms/triggerContentReview.js.map +1 -1
- package/plugins/cms/updateContentReviewStatus.js +10 -14
- package/plugins/cms/updateContentReviewStatus.js.map +1 -1
- package/plugins/cms/utils.js +4 -8
- package/plugins/cms/utils.js.map +1 -1
- package/plugins/context.js +1 -1
- package/plugins/graphql/changeRequest.gql.js +1 -1
- package/plugins/graphql/comment.gql.js +1 -1
- package/plugins/graphql/contentReview.gql.js +4 -4
- package/plugins/graphql/contentReview.gql.js.map +1 -1
- package/plugins/graphql/reviewer.gql.js +3 -1
- package/plugins/graphql/reviewer.gql.js.map +1 -1
- package/plugins/graphql/workflow.gql.js +1 -1
- package/plugins/graphql.js +1 -1
- package/plugins/hooks/createReviewerFromIdentity.js +28 -8
- package/plugins/hooks/createReviewerFromIdentity.js.map +1 -1
- package/plugins/hooks/deleteChangeRequestsAfterContentReview.js +1 -1
- package/plugins/hooks/deleteChangeRequestsAfterContentReview.js.map +1 -1
- package/plugins/hooks/deleteCommentsAfterChangeRequest.js +1 -1
- package/plugins/hooks/deleteCommentsAfterChangeRequest.js.map +1 -1
- package/plugins/hooks/index.js +6 -0
- package/plugins/hooks/index.js.map +1 -1
- package/plugins/hooks/initializeContentReviewSteps.js +5 -8
- package/plugins/hooks/initializeContentReviewSteps.js.map +1 -1
- 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.js +7 -11
- package/plugins/hooks/updatePendingChangeRequests.js.map +1 -1
- package/plugins/hooks/updateTotalComments.js +14 -18
- package/plugins/hooks/updateTotalComments.js.map +1 -1
- package/plugins/hooks/validateChangeRequest.js +30 -5
- package/plugins/hooks/validateChangeRequest.js.map +1 -1
- package/plugins/hooks/validateComment.js +14 -4
- package/plugins/hooks/validateComment.js.map +1 -1
- package/plugins/hooks/validateContentReview.js +2 -2
- package/plugins/hooks/validateContentReview.js.map +1 -1
- package/plugins/pageBuilder/PageApwSettingsGetterPlugin.js +1 -1
- package/plugins/pageBuilder/index.js +9 -1
- package/plugins/pageBuilder/index.js.map +1 -1
- package/plugins/pageBuilder/linkContentReviewToPage.js +41 -29
- package/plugins/pageBuilder/linkContentReviewToPage.js.map +1 -1
- package/plugins/pageBuilder/linkWorkflowToPage.js +18 -6
- package/plugins/pageBuilder/linkWorkflowToPage.js.map +1 -1
- 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.js +3 -3
- package/plugins/pageBuilder/triggerContentReview.js.map +1 -1
- package/plugins/pageBuilder/updateContentReviewStatus.js +10 -14
- package/plugins/pageBuilder/updateContentReviewStatus.js.map +1 -1
- package/plugins/pageBuilder/utils.js +1 -1
- package/plugins/pageBuilder/utils.js.map +1 -1
- package/plugins/utils.d.ts +1 -1
- package/plugins/utils.js +4 -14
- package/plugins/utils.js.map +1 -1
- package/scheduler/createScheduleActionMethods.js +17 -14
- package/scheduler/createScheduleActionMethods.js.map +1 -1
- package/scheduler/handlers/executeAction/plugins/ApplicationGraphQL.js +1 -1
- package/scheduler/handlers/executeAction/plugins/HeadlessCMSGraphQL.js +1 -1
- package/scheduler/handlers/executeAction/plugins/PageBuilderGraphQL.js +1 -1
- package/scheduler/handlers/scheduleAction/index.js +8 -9
- package/scheduler/handlers/scheduleAction/index.js.map +1 -1
- package/scheduler/handlers/scheduleAction/scheduleAction.utils.js +5 -9
- package/scheduler/handlers/scheduleAction/scheduleAction.utils.js.map +1 -1
- package/scheduler/handlers/utils.js +1 -1
- package/storageOperations/changeRequestStorageOperations.js +5 -9
- package/storageOperations/changeRequestStorageOperations.js.map +1 -1
- package/storageOperations/commentStorageOperations.js +4 -8
- package/storageOperations/commentStorageOperations.js.map +1 -1
- package/storageOperations/contentReviewStorageOperations.js +5 -9
- package/storageOperations/contentReviewStorageOperations.js.map +1 -1
- package/storageOperations/index.js +5 -9
- package/storageOperations/index.js.map +1 -1
- package/storageOperations/models/contentModelPluginFactory.js +3 -7
- package/storageOperations/models/contentModelPluginFactory.js.map +1 -1
- package/storageOperations/models/contentReview.model.js +6 -5
- package/storageOperations/models/contentReview.model.js.map +1 -1
- package/storageOperations/models/index.js +1 -1
- package/storageOperations/models/reviewer.model.js +18 -2
- package/storageOperations/models/reviewer.model.js.map +1 -1
- package/storageOperations/models/utils.js +3 -2
- package/storageOperations/models/utils.js.map +1 -1
- package/storageOperations/reviewerStorageOperations.js +18 -14
- package/storageOperations/reviewerStorageOperations.js.map +1 -1
- package/storageOperations/workflowStorageOperations.js +8 -12
- package/storageOperations/workflowStorageOperations.js.map +1 -1
- package/types.d.ts +99 -84
- package/types.js.map +1 -1
- package/utils/errors.js +1 -1
- package/utils/fieldResolver.js +3 -9
- package/utils/fieldResolver.js.map +1 -1
package/utils/fieldResolver.js
CHANGED
@@ -1,22 +1,18 @@
|
|
1
1
|
"use strict";
|
2
2
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
4
4
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
6
6
|
value: true
|
7
7
|
});
|
8
8
|
exports.getTransformer = exports.getFieldValues = void 0;
|
9
9
|
|
10
|
-
var
|
10
|
+
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
|
11
11
|
|
12
12
|
var _pick = _interopRequireDefault(require("lodash/pick"));
|
13
13
|
|
14
14
|
var _apiHeadlessCms = require("@webiny/api-headless-cms");
|
15
15
|
|
16
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
17
|
-
|
18
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
19
|
-
|
20
16
|
const getFieldValues = async params => {
|
21
17
|
const {
|
22
18
|
entry,
|
@@ -24,13 +20,11 @@ const getFieldValues = async params => {
|
|
24
20
|
transformers = [],
|
25
21
|
fields
|
26
22
|
} = params;
|
27
|
-
|
28
|
-
const values = _objectSpread(_objectSpread({}, (0, _pick.default)(entry, fields)), entry.values);
|
23
|
+
const values = (0, _objectSpread2.default)((0, _objectSpread2.default)({}, (0, _pick.default)(entry, fields)), entry.values);
|
29
24
|
/**
|
30
25
|
* Transform field value for each transformers.
|
31
26
|
*/
|
32
27
|
|
33
|
-
|
34
28
|
for (const transformer of transformers) {
|
35
29
|
const {
|
36
30
|
fieldId,
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["getFieldValues","params","entry","context","transformers","fields","values","pick","transformer","fieldId","model","field","entryFieldFromStorageTransform","value","getTransformer","find"],"sources":["fieldResolver.ts"],"sourcesContent":["import pick from \"lodash/pick\";\nimport { CmsContext, CmsEntry, CmsModel } from \"@webiny/api-headless-cms/types\";\nimport { entryFieldFromStorageTransform } from \"@webiny/api-headless-cms\";\nimport { ApwBaseFields } from \"~/types\";\n\ninterface Transformer {\n fieldId: keyof ApwBaseFields;\n model: any;\n field: any;\n}\n\ninterface GetFieldValuesParams {\n entry: CmsEntry;\n fields: string[];\n transformers?: Transformer[];\n context: CmsContext;\n}\n\nexport const getFieldValues = async <T extends ApwBaseFields>(\n params: GetFieldValuesParams\n): Promise<T> => {\n const { entry, context, transformers = [], fields } = params;\n const values = {\n ...pick(entry, fields),\n ...entry.values\n } as T;\n /**\n * Transform field value for each transformers.\n */\n for (const transformer of transformers) {\n const { fieldId, model, field } = transformer;\n // Get transformed value (eg. data decompression)\n values[fieldId] = await entryFieldFromStorageTransform({\n context,\n model,\n field,\n value: values[fieldId]\n });\n }\n\n return values;\n};\n\nexport const getTransformer = (model: CmsModel, fieldId: string): Transformer => ({\n fieldId: fieldId as unknown as keyof ApwBaseFields,\n model: model,\n field: model.fields.find(field => field.fieldId === fieldId)\n});\n"],"mappings":";;;;;;;;;;;AAAA;;AAEA
|
1
|
+
{"version":3,"names":["getFieldValues","params","entry","context","transformers","fields","values","pick","transformer","fieldId","model","field","entryFieldFromStorageTransform","value","getTransformer","find"],"sources":["fieldResolver.ts"],"sourcesContent":["import pick from \"lodash/pick\";\nimport { CmsContext, CmsEntry, CmsModel } from \"@webiny/api-headless-cms/types\";\nimport { entryFieldFromStorageTransform } from \"@webiny/api-headless-cms\";\nimport { ApwBaseFields } from \"~/types\";\n\ninterface Transformer {\n fieldId: keyof ApwBaseFields;\n model: any;\n field: any;\n}\n\ninterface GetFieldValuesParams {\n entry: CmsEntry;\n fields: string[];\n transformers?: Transformer[];\n context: CmsContext;\n}\n\nexport const getFieldValues = async <T extends ApwBaseFields>(\n params: GetFieldValuesParams\n): Promise<T> => {\n const { entry, context, transformers = [], fields } = params;\n const values = {\n ...pick(entry, fields),\n ...entry.values\n } as T;\n /**\n * Transform field value for each transformers.\n */\n for (const transformer of transformers) {\n const { fieldId, model, field } = transformer;\n // Get transformed value (eg. data decompression)\n values[fieldId] = await entryFieldFromStorageTransform({\n context,\n model,\n field,\n value: values[fieldId]\n });\n }\n\n return values;\n};\n\nexport const getTransformer = (model: CmsModel, fieldId: string): Transformer => ({\n fieldId: fieldId as unknown as keyof ApwBaseFields,\n model: model,\n field: model.fields.find(field => field.fieldId === fieldId)\n});\n"],"mappings":";;;;;;;;;;;AAAA;;AAEA;;AAgBO,MAAMA,cAAc,GAAG,MAC1BC,MAD0B,IAEb;EACb,MAAM;IAAEC,KAAF;IAASC,OAAT;IAAkBC,YAAY,GAAG,EAAjC;IAAqCC;EAArC,IAAgDJ,MAAtD;EACA,MAAMK,MAAM,+DACL,IAAAC,aAAA,EAAKL,KAAL,EAAYG,MAAZ,CADK,GAELH,KAAK,CAACI,MAFD,CAAZ;EAIA;AACJ;AACA;;EACI,KAAK,MAAME,WAAX,IAA0BJ,YAA1B,EAAwC;IACpC,MAAM;MAAEK,OAAF;MAAWC,KAAX;MAAkBC;IAAlB,IAA4BH,WAAlC,CADoC,CAEpC;;IACAF,MAAM,CAACG,OAAD,CAAN,GAAkB,MAAM,IAAAG,8CAAA,EAA+B;MACnDT,OADmD;MAEnDO,KAFmD;MAGnDC,KAHmD;MAInDE,KAAK,EAAEP,MAAM,CAACG,OAAD;IAJsC,CAA/B,CAAxB;EAMH;;EAED,OAAOH,MAAP;AACH,CAvBM;;;;AAyBA,MAAMQ,cAAc,GAAG,CAACJ,KAAD,EAAkBD,OAAlB,MAAoD;EAC9EA,OAAO,EAAEA,OADqE;EAE9EC,KAAK,EAAEA,KAFuE;EAG9EC,KAAK,EAAED,KAAK,CAACL,MAAN,CAAaU,IAAb,CAAkBJ,KAAK,IAAIA,KAAK,CAACF,OAAN,KAAkBA,OAA7C;AAHuE,CAApD,CAAvB"}
|