@webiny/api-apw 0.0.0-unstable.99666aeb00 → 0.0.0-unstable.a9593f74dd

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.
Files changed (232) hide show
  1. package/ApwChangeRequestNotification.js +4 -6
  2. package/ApwChangeRequestNotification.js.map +1 -1
  3. package/ApwCommentNotification.js +4 -6
  4. package/ApwCommentNotification.js.map +1 -1
  5. package/ApwContentReviewNotification.js +4 -6
  6. package/ApwContentReviewNotification.js.map +1 -1
  7. package/ApwContentUrlPlugin.js +4 -6
  8. package/ApwContentUrlPlugin.js.map +1 -1
  9. package/ContentApwSettingsPlugin.js +5 -4
  10. package/ContentApwSettingsPlugin.js.map +1 -1
  11. package/README.md +3 -3
  12. package/crud/createChangeRequestMethods.js +3 -1
  13. package/crud/createChangeRequestMethods.js.map +1 -1
  14. package/crud/createCommentMethods.js +3 -1
  15. package/crud/createCommentMethods.js.map +1 -1
  16. package/crud/createContentReviewMethods.js +40 -29
  17. package/crud/createContentReviewMethods.js.map +1 -1
  18. package/crud/createReviewerMethods.js +3 -1
  19. package/crud/createReviewerMethods.js.map +1 -1
  20. package/crud/createWorkflowMethods.js +3 -1
  21. package/crud/createWorkflowMethods.js.map +1 -1
  22. package/crud/index.js +6 -5
  23. package/crud/index.js.map +1 -1
  24. package/crud/utils.js +7 -6
  25. package/crud/utils.js.map +1 -1
  26. package/index.d.ts +1 -1
  27. package/index.js +3 -1
  28. package/index.js.map +1 -1
  29. package/package.json +32 -32
  30. package/plugins/cms/CmsEntryApwSettingsGetterPlugin.js +5 -5
  31. package/plugins/cms/CmsEntryApwSettingsGetterPlugin.js.map +1 -1
  32. package/plugins/cms/apwEntryPlugins.js +9 -6
  33. package/plugins/cms/apwEntryPlugins.js.map +1 -1
  34. package/plugins/cms/index.js +3 -1
  35. package/plugins/cms/index.js.map +1 -1
  36. package/plugins/cms/linkContentReviewToEntry.js +5 -4
  37. package/plugins/cms/linkContentReviewToEntry.js.map +1 -1
  38. package/plugins/cms/linkWorkflowToEntry.js +16 -15
  39. package/plugins/cms/linkWorkflowToEntry.js.map +1 -1
  40. package/plugins/cms/notifications/changeRequestNotification.js +3 -1
  41. package/plugins/cms/notifications/changeRequestNotification.js.map +1 -1
  42. package/plugins/cms/notifications/commentNotification.js +3 -1
  43. package/plugins/cms/notifications/commentNotification.js.map +1 -1
  44. package/plugins/cms/notifications/contentReviewNotification.js +3 -1
  45. package/plugins/cms/notifications/contentReviewNotification.js.map +1 -1
  46. package/plugins/cms/notifications/contentUrl.js +3 -1
  47. package/plugins/cms/notifications/contentUrl.js.map +1 -1
  48. package/plugins/cms/triggerContentReview.js +6 -5
  49. package/plugins/cms/triggerContentReview.js.map +1 -1
  50. package/plugins/cms/updateContentReviewStatus.js +15 -13
  51. package/plugins/cms/updateContentReviewStatus.js.map +1 -1
  52. package/plugins/cms/utils.d.ts +3 -2
  53. package/plugins/cms/utils.js +22 -14
  54. package/plugins/cms/utils.js.map +1 -1
  55. package/plugins/context.js +3 -1
  56. package/plugins/context.js.map +1 -1
  57. package/plugins/graphql/changeRequest.gql.js +16 -12
  58. package/plugins/graphql/changeRequest.gql.js.map +1 -1
  59. package/plugins/graphql/comment.gql.js +41 -35
  60. package/plugins/graphql/comment.gql.js.map +1 -1
  61. package/plugins/graphql/contentReview.gql.js +23 -13
  62. package/plugins/graphql/contentReview.gql.js.map +1 -1
  63. package/plugins/graphql/reviewer.gql.js +15 -12
  64. package/plugins/graphql/reviewer.gql.js.map +1 -1
  65. package/plugins/graphql/utils.d.ts +2 -0
  66. package/plugins/graphql/utils.js +12 -0
  67. package/plugins/graphql/utils.js.map +1 -0
  68. package/plugins/graphql/workflow.gql.js +15 -12
  69. package/plugins/graphql/workflow.gql.js.map +1 -1
  70. package/plugins/graphql.js +3 -1
  71. package/plugins/graphql.js.map +1 -1
  72. package/plugins/hooks/createReviewerFromIdentity.js +4 -2
  73. package/plugins/hooks/createReviewerFromIdentity.js.map +1 -1
  74. package/plugins/hooks/deleteChangeRequestsAfterContentReview.js +3 -1
  75. package/plugins/hooks/deleteChangeRequestsAfterContentReview.js.map +1 -1
  76. package/plugins/hooks/deleteCommentsAfterChangeRequest.js +3 -1
  77. package/plugins/hooks/deleteCommentsAfterChangeRequest.js.map +1 -1
  78. package/plugins/hooks/index.js +3 -1
  79. package/plugins/hooks/index.js.map +1 -1
  80. package/plugins/hooks/initializeContentReviewSteps.js +6 -4
  81. package/plugins/hooks/initializeContentReviewSteps.js.map +1 -1
  82. package/plugins/hooks/initializeNotifications.js +3 -1
  83. package/plugins/hooks/initializeNotifications.js.map +1 -1
  84. package/plugins/hooks/listContentReviews.js +4 -2
  85. package/plugins/hooks/listContentReviews.js.map +1 -1
  86. package/plugins/hooks/notifications/appUrl.js +3 -1
  87. package/plugins/hooks/notifications/appUrl.js.map +1 -1
  88. package/plugins/hooks/notifications/changeRequestAfterCreate.js +3 -1
  89. package/plugins/hooks/notifications/changeRequestAfterCreate.js.map +1 -1
  90. package/plugins/hooks/notifications/changeRequestUrl.js +3 -1
  91. package/plugins/hooks/notifications/changeRequestUrl.js.map +1 -1
  92. package/plugins/hooks/notifications/commentAfterCreate.js +3 -1
  93. package/plugins/hooks/notifications/commentAfterCreate.js.map +1 -1
  94. package/plugins/hooks/notifications/commentUrl.js +3 -1
  95. package/plugins/hooks/notifications/commentUrl.js.map +1 -1
  96. package/plugins/hooks/notifications/contentReviewAfterCreate.js +4 -2
  97. package/plugins/hooks/notifications/contentReviewAfterCreate.js.map +1 -1
  98. package/plugins/hooks/notifications/contentReviewUrl.js +3 -1
  99. package/plugins/hooks/notifications/contentReviewUrl.js.map +1 -1
  100. package/plugins/hooks/notifications/contentUrl.js +3 -1
  101. package/plugins/hooks/notifications/contentUrl.js.map +1 -1
  102. package/plugins/hooks/notifications/lastChangeRequestNotificationPlugin.js +3 -1
  103. package/plugins/hooks/notifications/lastChangeRequestNotificationPlugin.js.map +1 -1
  104. package/plugins/hooks/notifications/lastCommentNotificationPlugin.js +3 -1
  105. package/plugins/hooks/notifications/lastCommentNotificationPlugin.js.map +1 -1
  106. package/plugins/hooks/notifications/lastContentReviewNotificationPlugin.js +3 -1
  107. package/plugins/hooks/notifications/lastContentReviewNotificationPlugin.js.map +1 -1
  108. package/plugins/hooks/notifications/reviewers.js +3 -1
  109. package/plugins/hooks/notifications/reviewers.js.map +1 -1
  110. package/plugins/hooks/notifications/sendChangeRequestNotification.js +3 -1
  111. package/plugins/hooks/notifications/sendChangeRequestNotification.js.map +1 -1
  112. package/plugins/hooks/notifications/sendCommentNotification.js +3 -1
  113. package/plugins/hooks/notifications/sendCommentNotification.js.map +1 -1
  114. package/plugins/hooks/notifications/sendContentReviewNotification.js +3 -1
  115. package/plugins/hooks/notifications/sendContentReviewNotification.js.map +1 -1
  116. package/plugins/hooks/updatePendingChangeRequests.js +8 -6
  117. package/plugins/hooks/updatePendingChangeRequests.js.map +1 -1
  118. package/plugins/hooks/updateTotalComments.js +22 -15
  119. package/plugins/hooks/updateTotalComments.js.map +1 -1
  120. package/plugins/hooks/validateChangeRequest.js +3 -1
  121. package/plugins/hooks/validateChangeRequest.js.map +1 -1
  122. package/plugins/hooks/validateComment.js +3 -1
  123. package/plugins/hooks/validateComment.js.map +1 -1
  124. package/plugins/hooks/validateContentReview.js +3 -1
  125. package/plugins/hooks/validateContentReview.js.map +1 -1
  126. package/plugins/pageBuilder/PageApwSettingsGetterPlugin.js +5 -5
  127. package/plugins/pageBuilder/PageApwSettingsGetterPlugin.js.map +1 -1
  128. package/plugins/pageBuilder/apwContentPagePlugins.js +3 -1
  129. package/plugins/pageBuilder/apwContentPagePlugins.js.map +1 -1
  130. package/plugins/pageBuilder/extendPbPageSettingsSchema.js +3 -1
  131. package/plugins/pageBuilder/extendPbPageSettingsSchema.js.map +1 -1
  132. package/plugins/pageBuilder/index.js +3 -1
  133. package/plugins/pageBuilder/index.js.map +1 -1
  134. package/plugins/pageBuilder/linkContentReviewToPage.js +16 -12
  135. package/plugins/pageBuilder/linkContentReviewToPage.js.map +1 -1
  136. package/plugins/pageBuilder/linkWorkflowToPage.js +3 -1
  137. package/plugins/pageBuilder/linkWorkflowToPage.js.map +1 -1
  138. package/plugins/pageBuilder/notifications/changeRequestNotification.js +3 -1
  139. package/plugins/pageBuilder/notifications/changeRequestNotification.js.map +1 -1
  140. package/plugins/pageBuilder/notifications/commentNotification.js +3 -1
  141. package/plugins/pageBuilder/notifications/commentNotification.js.map +1 -1
  142. package/plugins/pageBuilder/notifications/contentReviewNotification.js +3 -1
  143. package/plugins/pageBuilder/notifications/contentReviewNotification.js.map +1 -1
  144. package/plugins/pageBuilder/notifications/contentUrl.js +3 -1
  145. package/plugins/pageBuilder/notifications/contentUrl.js.map +1 -1
  146. package/plugins/pageBuilder/triggerContentReview.js +3 -1
  147. package/plugins/pageBuilder/triggerContentReview.js.map +1 -1
  148. package/plugins/pageBuilder/updateContentReviewStatus.js +11 -6
  149. package/plugins/pageBuilder/updateContentReviewStatus.js.map +1 -1
  150. package/plugins/pageBuilder/utils.d.ts +2 -2
  151. package/plugins/pageBuilder/utils.js +3 -1
  152. package/plugins/pageBuilder/utils.js.map +1 -1
  153. package/plugins/utils.d.ts +1 -1
  154. package/plugins/utils.js +6 -3
  155. package/plugins/utils.js.map +1 -1
  156. package/scheduler/createScheduleActionMethods.js +42 -23
  157. package/scheduler/createScheduleActionMethods.js.map +1 -1
  158. package/scheduler/handlers/executeAction/index.d.ts +1 -1
  159. package/scheduler/handlers/executeAction/index.js +5 -4
  160. package/scheduler/handlers/executeAction/index.js.map +1 -1
  161. package/scheduler/handlers/executeAction/plugins/ApplicationGraphQL.js +5 -4
  162. package/scheduler/handlers/executeAction/plugins/ApplicationGraphQL.js.map +1 -1
  163. package/scheduler/handlers/executeAction/plugins/HeadlessCMSGraphQL.js +6 -7
  164. package/scheduler/handlers/executeAction/plugins/HeadlessCMSGraphQL.js.map +1 -1
  165. package/scheduler/handlers/executeAction/plugins/PageBuilderGraphQL.js +4 -7
  166. package/scheduler/handlers/executeAction/plugins/PageBuilderGraphQL.js.map +1 -1
  167. package/scheduler/handlers/executeAction/security.js +3 -1
  168. package/scheduler/handlers/executeAction/security.js.map +1 -1
  169. package/scheduler/handlers/scheduleAction/index.js +16 -13
  170. package/scheduler/handlers/scheduleAction/index.js.map +1 -1
  171. package/scheduler/handlers/scheduleAction/scheduleAction.utils.js +17 -14
  172. package/scheduler/handlers/scheduleAction/scheduleAction.utils.js.map +1 -1
  173. package/scheduler/handlers/utils.d.ts +1 -2
  174. package/scheduler/handlers/utils.js +6 -7
  175. package/scheduler/handlers/utils.js.map +1 -1
  176. package/scheduler/index.js +3 -1
  177. package/scheduler/index.js.map +1 -1
  178. package/scheduler/types.d.ts +10 -8
  179. package/scheduler/types.js +14 -12
  180. package/scheduler/types.js.map +1 -1
  181. package/storageOperations/changeRequestStorageOperations.js +44 -11
  182. package/storageOperations/changeRequestStorageOperations.js.map +1 -1
  183. package/storageOperations/commentStorageOperations.js +16 -10
  184. package/storageOperations/commentStorageOperations.js.map +1 -1
  185. package/storageOperations/contentReviewStorageOperations.d.ts +1 -1
  186. package/storageOperations/contentReviewStorageOperations.js +19 -11
  187. package/storageOperations/contentReviewStorageOperations.js.map +1 -1
  188. package/storageOperations/index.d.ts +1 -7
  189. package/storageOperations/index.js +11 -16
  190. package/storageOperations/index.js.map +1 -1
  191. package/storageOperations/models/changeRequest.model.d.ts +1 -2
  192. package/storageOperations/models/changeRequest.model.js +7 -7
  193. package/storageOperations/models/changeRequest.model.js.map +1 -1
  194. package/storageOperations/models/comment.model.d.ts +1 -2
  195. package/storageOperations/models/comment.model.js +7 -7
  196. package/storageOperations/models/comment.model.js.map +1 -1
  197. package/storageOperations/models/contentReview.model.d.ts +1 -2
  198. package/storageOperations/models/contentReview.model.js +13 -11
  199. package/storageOperations/models/contentReview.model.js.map +1 -1
  200. package/storageOperations/models/index.js +6 -24
  201. package/storageOperations/models/index.js.map +1 -1
  202. package/storageOperations/models/reviewer.model.d.ts +1 -2
  203. package/storageOperations/models/reviewer.model.js +8 -8
  204. package/storageOperations/models/reviewer.model.js.map +1 -1
  205. package/storageOperations/models/utils.js +3 -1
  206. package/storageOperations/models/utils.js.map +1 -1
  207. package/storageOperations/models/workflow.model.d.ts +1 -2
  208. package/storageOperations/models/workflow.model.js +19 -19
  209. package/storageOperations/models/workflow.model.js.map +1 -1
  210. package/storageOperations/reviewerStorageOperations.d.ts +1 -1
  211. package/storageOperations/reviewerStorageOperations.js +19 -11
  212. package/storageOperations/reviewerStorageOperations.js.map +1 -1
  213. package/storageOperations/types.js +3 -1
  214. package/storageOperations/workflowStorageOperations.js +24 -14
  215. package/storageOperations/workflowStorageOperations.js.map +1 -1
  216. package/types.d.ts +15 -14
  217. package/types.js +126 -28
  218. package/types.js.map +1 -1
  219. package/utils/contentApwSettingsPlugin.js +3 -1
  220. package/utils/contentApwSettingsPlugin.js.map +1 -1
  221. package/utils/errors.js +3 -1
  222. package/utils/errors.js.map +1 -1
  223. package/utils/fieldResolver.js +7 -7
  224. package/utils/fieldResolver.js.map +1 -1
  225. package/utils/pickEntryFieldValues.d.ts +3 -0
  226. package/utils/pickEntryFieldValues.js +31 -0
  227. package/utils/pickEntryFieldValues.js.map +1 -0
  228. package/utils/resolve.js +3 -1
  229. package/utils/resolve.js.map +1 -1
  230. package/storageOperations/models/contentModelPluginFactory.d.ts +0 -8
  231. package/storageOperations/models/contentModelPluginFactory.js +0 -20
  232. package/storageOperations/models/contentModelPluginFactory.js.map +0 -1
@@ -1,17 +1,14 @@
1
1
  "use strict";
2
2
 
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
4
3
  Object.defineProperty(exports, "__esModule", {
5
4
  value: true
6
5
  });
7
6
  exports.createApwChangeRequestNotification = exports.ApwChangeRequestNotification = void 0;
8
- var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
9
7
  var _plugins = require("@webiny/plugins");
10
8
  class ApwChangeRequestNotification extends _plugins.Plugin {
9
+ static type = "apw.notification.changeRequest";
11
10
  constructor(contentType, cb) {
12
11
  super();
13
- (0, _defineProperty2.default)(this, "contentType", void 0);
14
- (0, _defineProperty2.default)(this, "cb", void 0);
15
12
  this.contentType = contentType;
16
13
  this.cb = cb;
17
14
  }
@@ -23,8 +20,9 @@ class ApwChangeRequestNotification extends _plugins.Plugin {
23
20
  }
24
21
  }
25
22
  exports.ApwChangeRequestNotification = ApwChangeRequestNotification;
26
- (0, _defineProperty2.default)(ApwChangeRequestNotification, "type", "apw.notification.changeRequest");
27
23
  const createApwChangeRequestNotification = (contentType, cb) => {
28
24
  return new ApwChangeRequestNotification(contentType, cb);
29
25
  };
30
- exports.createApwChangeRequestNotification = createApwChangeRequestNotification;
26
+ exports.createApwChangeRequestNotification = createApwChangeRequestNotification;
27
+
28
+ //# sourceMappingURL=ApwChangeRequestNotification.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["ApwChangeRequestNotification","Plugin","constructor","contentType","cb","canUse","create","params","createApwChangeRequestNotification"],"sources":["ApwChangeRequestNotification.ts"],"sourcesContent":["import { Plugin } from \"@webiny/plugins\";\nimport {\n ApwChangeRequest,\n ApwContentReview,\n ApwContentTypes,\n ApwContext,\n ApwReviewerWithEmail,\n ApwWorkflow\n} from \"~/types\";\n\nexport interface ApwChangeRequestNotificationCbParams {\n context: ApwContext;\n reviewers: ApwReviewerWithEmail[];\n changeRequestUrl: string;\n contentUrl: string;\n changeRequest: ApwChangeRequest;\n contentReview: ApwContentReview;\n workflow: ApwWorkflow;\n}\nexport interface ApwChangeRequestNotificationCbParamsResponse {\n text: string;\n html?: string;\n}\nexport interface ApwChangeRequestNotificationCb {\n (params: ApwChangeRequestNotificationCbParams):\n | ApwChangeRequestNotificationCbParamsResponse\n | null\n | undefined;\n}\nexport class ApwChangeRequestNotification extends Plugin {\n public static override readonly type: string = \"apw.notification.changeRequest\";\n\n private readonly contentType: ApwContentTypes;\n private readonly cb: ApwChangeRequestNotificationCb;\n\n public constructor(contentType: ApwContentTypes, cb: ApwChangeRequestNotificationCb) {\n super();\n this.contentType = contentType;\n this.cb = cb;\n }\n\n public canUse(contentType: ApwContentTypes): boolean {\n return contentType === this.contentType;\n }\n\n public create(params: ApwChangeRequestNotificationCbParams) {\n return this.cb(params);\n }\n}\n\nexport const createApwChangeRequestNotification = (\n contentType: ApwContentTypes,\n cb: ApwChangeRequestNotificationCb\n) => {\n return new ApwChangeRequestNotification(contentType, cb);\n};\n"],"mappings":";;;;;;;;AAAA;AA6BO,MAAMA,4BAA4B,SAASC,eAAM,CAAC;EAM9CC,WAAW,CAACC,WAA4B,EAAEC,EAAkC,EAAE;IACjF,KAAK,EAAE;IAAC;IAAA;IACR,IAAI,CAACD,WAAW,GAAGA,WAAW;IAC9B,IAAI,CAACC,EAAE,GAAGA,EAAE;EAChB;EAEOC,MAAM,CAACF,WAA4B,EAAW;IACjD,OAAOA,WAAW,KAAK,IAAI,CAACA,WAAW;EAC3C;EAEOG,MAAM,CAACC,MAA4C,EAAE;IACxD,OAAO,IAAI,CAACH,EAAE,CAACG,MAAM,CAAC;EAC1B;AACJ;AAAC;AAAA,8BAnBYP,4BAA4B,UACU,gCAAgC;AAoB5E,MAAMQ,kCAAkC,GAAG,CAC9CL,WAA4B,EAC5BC,EAAkC,KACjC;EACD,OAAO,IAAIJ,4BAA4B,CAACG,WAAW,EAAEC,EAAE,CAAC;AAC5D,CAAC;AAAC"}
1
+ {"version":3,"names":["_plugins","require","ApwChangeRequestNotification","Plugin","type","constructor","contentType","cb","canUse","create","params","exports","createApwChangeRequestNotification"],"sources":["ApwChangeRequestNotification.ts"],"sourcesContent":["import { Plugin } from \"@webiny/plugins\";\nimport {\n ApwChangeRequest,\n ApwContentReview,\n ApwContentTypes,\n ApwContext,\n ApwReviewerWithEmail,\n ApwWorkflow\n} from \"~/types\";\n\nexport interface ApwChangeRequestNotificationCbParams {\n context: ApwContext;\n reviewers: ApwReviewerWithEmail[];\n changeRequestUrl: string;\n contentUrl: string;\n changeRequest: ApwChangeRequest;\n contentReview: ApwContentReview;\n workflow: ApwWorkflow;\n}\nexport interface ApwChangeRequestNotificationCbParamsResponse {\n text: string;\n html?: string;\n}\nexport interface ApwChangeRequestNotificationCb {\n (params: ApwChangeRequestNotificationCbParams):\n | ApwChangeRequestNotificationCbParamsResponse\n | null\n | undefined;\n}\nexport class ApwChangeRequestNotification extends Plugin {\n public static override readonly type: string = \"apw.notification.changeRequest\";\n\n private readonly contentType: ApwContentTypes;\n private readonly cb: ApwChangeRequestNotificationCb;\n\n public constructor(contentType: ApwContentTypes, cb: ApwChangeRequestNotificationCb) {\n super();\n this.contentType = contentType;\n this.cb = cb;\n }\n\n public canUse(contentType: ApwContentTypes): boolean {\n return contentType === this.contentType;\n }\n\n public create(params: ApwChangeRequestNotificationCbParams) {\n return this.cb(params);\n }\n}\n\nexport const createApwChangeRequestNotification = (\n contentType: ApwContentTypes,\n cb: ApwChangeRequestNotificationCb\n) => {\n return new ApwChangeRequestNotification(contentType, cb);\n};\n"],"mappings":";;;;;;AAAA,IAAAA,QAAA,GAAAC,OAAA;AA6BO,MAAMC,4BAA4B,SAASC,eAAM,CAAC;EACrD,OAAgCC,IAAI,GAAW,gCAAgC;EAKxEC,WAAWA,CAACC,WAA4B,EAAEC,EAAkC,EAAE;IACjF,KAAK,CAAC,CAAC;IACP,IAAI,CAACD,WAAW,GAAGA,WAAW;IAC9B,IAAI,CAACC,EAAE,GAAGA,EAAE;EAChB;EAEOC,MAAMA,CAACF,WAA4B,EAAW;IACjD,OAAOA,WAAW,KAAK,IAAI,CAACA,WAAW;EAC3C;EAEOG,MAAMA,CAACC,MAA4C,EAAE;IACxD,OAAO,IAAI,CAACH,EAAE,CAACG,MAAM,CAAC;EAC1B;AACJ;AAACC,OAAA,CAAAT,4BAAA,GAAAA,4BAAA;AAEM,MAAMU,kCAAkC,GAAGA,CAC9CN,WAA4B,EAC5BC,EAAkC,KACjC;EACD,OAAO,IAAIL,4BAA4B,CAACI,WAAW,EAAEC,EAAE,CAAC;AAC5D,CAAC;AAACI,OAAA,CAAAC,kCAAA,GAAAA,kCAAA"}
@@ -1,17 +1,14 @@
1
1
  "use strict";
2
2
 
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
4
3
  Object.defineProperty(exports, "__esModule", {
5
4
  value: true
6
5
  });
7
6
  exports.createApwCommentNotification = exports.ApwCommentNotification = void 0;
8
- var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
9
7
  var _plugins = require("@webiny/plugins");
10
8
  class ApwCommentNotification extends _plugins.Plugin {
9
+ static type = "apw.notification.comment";
11
10
  constructor(contentType, cb) {
12
11
  super();
13
- (0, _defineProperty2.default)(this, "contentType", void 0);
14
- (0, _defineProperty2.default)(this, "cb", void 0);
15
12
  this.contentType = contentType;
16
13
  this.cb = cb;
17
14
  }
@@ -23,8 +20,9 @@ class ApwCommentNotification extends _plugins.Plugin {
23
20
  }
24
21
  }
25
22
  exports.ApwCommentNotification = ApwCommentNotification;
26
- (0, _defineProperty2.default)(ApwCommentNotification, "type", "apw.notification.comment");
27
23
  const createApwCommentNotification = (contentType, cb) => {
28
24
  return new ApwCommentNotification(contentType, cb);
29
25
  };
30
- exports.createApwCommentNotification = createApwCommentNotification;
26
+ exports.createApwCommentNotification = createApwCommentNotification;
27
+
28
+ //# sourceMappingURL=ApwCommentNotification.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["ApwCommentNotification","Plugin","constructor","contentType","cb","canUse","create","params","createApwCommentNotification"],"sources":["ApwCommentNotification.ts"],"sourcesContent":["import { Plugin } from \"@webiny/plugins\";\nimport {\n ApwChangeRequest,\n ApwContentReview,\n ApwContentTypes,\n ApwContext,\n ApwReviewerWithEmail,\n ApwWorkflow\n} from \"~/types\";\n\nexport interface ApwCommentNotificationCbParams {\n context: ApwContext;\n reviewers: ApwReviewerWithEmail[];\n commentUrl: string;\n contentUrl: string;\n changeRequest: ApwChangeRequest;\n contentReview: ApwContentReview;\n workflow: ApwWorkflow;\n}\nexport interface ApwCommentNotificationCbParamsResponse {\n text: string;\n html?: string;\n}\nexport interface ApwCommentNotificationCb {\n (params: ApwCommentNotificationCbParams):\n | ApwCommentNotificationCbParamsResponse\n | null\n | undefined;\n}\nexport class ApwCommentNotification extends Plugin {\n public static override readonly type: string = \"apw.notification.comment\";\n\n private readonly contentType: ApwContentTypes;\n private readonly cb: ApwCommentNotificationCb;\n\n public constructor(contentType: ApwContentTypes, cb: ApwCommentNotificationCb) {\n super();\n this.contentType = contentType;\n this.cb = cb;\n }\n\n public canUse(contentType: ApwContentTypes): boolean {\n return contentType === this.contentType;\n }\n\n public create(params: ApwCommentNotificationCbParams) {\n return this.cb(params);\n }\n}\n\nexport const createApwCommentNotification = (\n contentType: ApwContentTypes,\n cb: ApwCommentNotificationCb\n) => {\n return new ApwCommentNotification(contentType, cb);\n};\n"],"mappings":";;;;;;;;AAAA;AA6BO,MAAMA,sBAAsB,SAASC,eAAM,CAAC;EAMxCC,WAAW,CAACC,WAA4B,EAAEC,EAA4B,EAAE;IAC3E,KAAK,EAAE;IAAC;IAAA;IACR,IAAI,CAACD,WAAW,GAAGA,WAAW;IAC9B,IAAI,CAACC,EAAE,GAAGA,EAAE;EAChB;EAEOC,MAAM,CAACF,WAA4B,EAAW;IACjD,OAAOA,WAAW,KAAK,IAAI,CAACA,WAAW;EAC3C;EAEOG,MAAM,CAACC,MAAsC,EAAE;IAClD,OAAO,IAAI,CAACH,EAAE,CAACG,MAAM,CAAC;EAC1B;AACJ;AAAC;AAAA,8BAnBYP,sBAAsB,UACgB,0BAA0B;AAoBtE,MAAMQ,4BAA4B,GAAG,CACxCL,WAA4B,EAC5BC,EAA4B,KAC3B;EACD,OAAO,IAAIJ,sBAAsB,CAACG,WAAW,EAAEC,EAAE,CAAC;AACtD,CAAC;AAAC"}
1
+ {"version":3,"names":["_plugins","require","ApwCommentNotification","Plugin","type","constructor","contentType","cb","canUse","create","params","exports","createApwCommentNotification"],"sources":["ApwCommentNotification.ts"],"sourcesContent":["import { Plugin } from \"@webiny/plugins\";\nimport {\n ApwChangeRequest,\n ApwContentReview,\n ApwContentTypes,\n ApwContext,\n ApwReviewerWithEmail,\n ApwWorkflow\n} from \"~/types\";\n\nexport interface ApwCommentNotificationCbParams {\n context: ApwContext;\n reviewers: ApwReviewerWithEmail[];\n commentUrl: string;\n contentUrl: string;\n changeRequest: ApwChangeRequest;\n contentReview: ApwContentReview;\n workflow: ApwWorkflow;\n}\nexport interface ApwCommentNotificationCbParamsResponse {\n text: string;\n html?: string;\n}\nexport interface ApwCommentNotificationCb {\n (params: ApwCommentNotificationCbParams):\n | ApwCommentNotificationCbParamsResponse\n | null\n | undefined;\n}\nexport class ApwCommentNotification extends Plugin {\n public static override readonly type: string = \"apw.notification.comment\";\n\n private readonly contentType: ApwContentTypes;\n private readonly cb: ApwCommentNotificationCb;\n\n public constructor(contentType: ApwContentTypes, cb: ApwCommentNotificationCb) {\n super();\n this.contentType = contentType;\n this.cb = cb;\n }\n\n public canUse(contentType: ApwContentTypes): boolean {\n return contentType === this.contentType;\n }\n\n public create(params: ApwCommentNotificationCbParams) {\n return this.cb(params);\n }\n}\n\nexport const createApwCommentNotification = (\n contentType: ApwContentTypes,\n cb: ApwCommentNotificationCb\n) => {\n return new ApwCommentNotification(contentType, cb);\n};\n"],"mappings":";;;;;;AAAA,IAAAA,QAAA,GAAAC,OAAA;AA6BO,MAAMC,sBAAsB,SAASC,eAAM,CAAC;EAC/C,OAAgCC,IAAI,GAAW,0BAA0B;EAKlEC,WAAWA,CAACC,WAA4B,EAAEC,EAA4B,EAAE;IAC3E,KAAK,CAAC,CAAC;IACP,IAAI,CAACD,WAAW,GAAGA,WAAW;IAC9B,IAAI,CAACC,EAAE,GAAGA,EAAE;EAChB;EAEOC,MAAMA,CAACF,WAA4B,EAAW;IACjD,OAAOA,WAAW,KAAK,IAAI,CAACA,WAAW;EAC3C;EAEOG,MAAMA,CAACC,MAAsC,EAAE;IAClD,OAAO,IAAI,CAACH,EAAE,CAACG,MAAM,CAAC;EAC1B;AACJ;AAACC,OAAA,CAAAT,sBAAA,GAAAA,sBAAA;AAEM,MAAMU,4BAA4B,GAAGA,CACxCN,WAA4B,EAC5BC,EAA4B,KAC3B;EACD,OAAO,IAAIL,sBAAsB,CAACI,WAAW,EAAEC,EAAE,CAAC;AACtD,CAAC;AAACI,OAAA,CAAAC,4BAAA,GAAAA,4BAAA"}
@@ -1,17 +1,14 @@
1
1
  "use strict";
2
2
 
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
4
3
  Object.defineProperty(exports, "__esModule", {
5
4
  value: true
6
5
  });
7
6
  exports.createApwContentReviewNotification = exports.ApwContentReviewNotification = void 0;
8
- var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
9
7
  var _plugins = require("@webiny/plugins");
10
8
  class ApwContentReviewNotification extends _plugins.Plugin {
9
+ static type = "apw.notification.contentReview";
11
10
  constructor(contentType, cb) {
12
11
  super();
13
- (0, _defineProperty2.default)(this, "contentType", void 0);
14
- (0, _defineProperty2.default)(this, "cb", void 0);
15
12
  this.contentType = contentType;
16
13
  this.cb = cb;
17
14
  }
@@ -23,8 +20,9 @@ class ApwContentReviewNotification extends _plugins.Plugin {
23
20
  }
24
21
  }
25
22
  exports.ApwContentReviewNotification = ApwContentReviewNotification;
26
- (0, _defineProperty2.default)(ApwContentReviewNotification, "type", "apw.notification.contentReview");
27
23
  const createApwContentReviewNotification = (contentType, cb) => {
28
24
  return new ApwContentReviewNotification(contentType, cb);
29
25
  };
30
- exports.createApwContentReviewNotification = createApwContentReviewNotification;
26
+ exports.createApwContentReviewNotification = createApwContentReviewNotification;
27
+
28
+ //# sourceMappingURL=ApwContentReviewNotification.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["ApwContentReviewNotification","Plugin","constructor","contentType","cb","canUse","create","params","createApwContentReviewNotification"],"sources":["ApwContentReviewNotification.ts"],"sourcesContent":["import { Plugin } from \"@webiny/plugins\";\nimport {\n ApwContentReview,\n ApwContentTypes,\n ApwContext,\n ApwReviewerWithEmail,\n ApwWorkflow\n} from \"~/types\";\n\nexport interface ApwContentReviewNotificationCbParams {\n context: ApwContext;\n reviewers: ApwReviewerWithEmail[];\n contentReviewUrl: string;\n contentUrl: string;\n contentReview: ApwContentReview;\n workflow: ApwWorkflow;\n}\nexport interface ApwContentReviewNotificationCbParamsResponse {\n text: string;\n html?: string;\n}\nexport interface ApwContentReviewNotificationCb {\n (params: ApwContentReviewNotificationCbParams):\n | ApwContentReviewNotificationCbParamsResponse\n | null\n | undefined;\n}\nexport class ApwContentReviewNotification extends Plugin {\n public static override readonly type: string = \"apw.notification.contentReview\";\n\n private readonly contentType: ApwContentTypes;\n private readonly cb: ApwContentReviewNotificationCb;\n\n public constructor(contentType: ApwContentTypes, cb: ApwContentReviewNotificationCb) {\n super();\n this.contentType = contentType;\n this.cb = cb;\n }\n\n public canUse(contentType: ApwContentTypes): boolean {\n return contentType === this.contentType;\n }\n\n public create(params: ApwContentReviewNotificationCbParams) {\n return this.cb(params);\n }\n}\n\nexport const createApwContentReviewNotification = (\n contentType: ApwContentTypes,\n cb: ApwContentReviewNotificationCb\n) => {\n return new ApwContentReviewNotification(contentType, cb);\n};\n"],"mappings":";;;;;;;;AAAA;AA2BO,MAAMA,4BAA4B,SAASC,eAAM,CAAC;EAM9CC,WAAW,CAACC,WAA4B,EAAEC,EAAkC,EAAE;IACjF,KAAK,EAAE;IAAC;IAAA;IACR,IAAI,CAACD,WAAW,GAAGA,WAAW;IAC9B,IAAI,CAACC,EAAE,GAAGA,EAAE;EAChB;EAEOC,MAAM,CAACF,WAA4B,EAAW;IACjD,OAAOA,WAAW,KAAK,IAAI,CAACA,WAAW;EAC3C;EAEOG,MAAM,CAACC,MAA4C,EAAE;IACxD,OAAO,IAAI,CAACH,EAAE,CAACG,MAAM,CAAC;EAC1B;AACJ;AAAC;AAAA,8BAnBYP,4BAA4B,UACU,gCAAgC;AAoB5E,MAAMQ,kCAAkC,GAAG,CAC9CL,WAA4B,EAC5BC,EAAkC,KACjC;EACD,OAAO,IAAIJ,4BAA4B,CAACG,WAAW,EAAEC,EAAE,CAAC;AAC5D,CAAC;AAAC"}
1
+ {"version":3,"names":["_plugins","require","ApwContentReviewNotification","Plugin","type","constructor","contentType","cb","canUse","create","params","exports","createApwContentReviewNotification"],"sources":["ApwContentReviewNotification.ts"],"sourcesContent":["import { Plugin } from \"@webiny/plugins\";\nimport {\n ApwContentReview,\n ApwContentTypes,\n ApwContext,\n ApwReviewerWithEmail,\n ApwWorkflow\n} from \"~/types\";\n\nexport interface ApwContentReviewNotificationCbParams {\n context: ApwContext;\n reviewers: ApwReviewerWithEmail[];\n contentReviewUrl: string;\n contentUrl: string;\n contentReview: ApwContentReview;\n workflow: ApwWorkflow;\n}\nexport interface ApwContentReviewNotificationCbParamsResponse {\n text: string;\n html?: string;\n}\nexport interface ApwContentReviewNotificationCb {\n (params: ApwContentReviewNotificationCbParams):\n | ApwContentReviewNotificationCbParamsResponse\n | null\n | undefined;\n}\nexport class ApwContentReviewNotification extends Plugin {\n public static override readonly type: string = \"apw.notification.contentReview\";\n\n private readonly contentType: ApwContentTypes;\n private readonly cb: ApwContentReviewNotificationCb;\n\n public constructor(contentType: ApwContentTypes, cb: ApwContentReviewNotificationCb) {\n super();\n this.contentType = contentType;\n this.cb = cb;\n }\n\n public canUse(contentType: ApwContentTypes): boolean {\n return contentType === this.contentType;\n }\n\n public create(params: ApwContentReviewNotificationCbParams) {\n return this.cb(params);\n }\n}\n\nexport const createApwContentReviewNotification = (\n contentType: ApwContentTypes,\n cb: ApwContentReviewNotificationCb\n) => {\n return new ApwContentReviewNotification(contentType, cb);\n};\n"],"mappings":";;;;;;AAAA,IAAAA,QAAA,GAAAC,OAAA;AA2BO,MAAMC,4BAA4B,SAASC,eAAM,CAAC;EACrD,OAAgCC,IAAI,GAAW,gCAAgC;EAKxEC,WAAWA,CAACC,WAA4B,EAAEC,EAAkC,EAAE;IACjF,KAAK,CAAC,CAAC;IACP,IAAI,CAACD,WAAW,GAAGA,WAAW;IAC9B,IAAI,CAACC,EAAE,GAAGA,EAAE;EAChB;EAEOC,MAAMA,CAACF,WAA4B,EAAW;IACjD,OAAOA,WAAW,KAAK,IAAI,CAACA,WAAW;EAC3C;EAEOG,MAAMA,CAACC,MAA4C,EAAE;IACxD,OAAO,IAAI,CAACH,EAAE,CAACG,MAAM,CAAC;EAC1B;AACJ;AAACC,OAAA,CAAAT,4BAAA,GAAAA,4BAAA;AAEM,MAAMU,kCAAkC,GAAGA,CAC9CN,WAA4B,EAC5BC,EAAkC,KACjC;EACD,OAAO,IAAIL,4BAA4B,CAACI,WAAW,EAAEC,EAAE,CAAC;AAC5D,CAAC;AAACI,OAAA,CAAAC,kCAAA,GAAAA,kCAAA"}
@@ -1,17 +1,14 @@
1
1
  "use strict";
2
2
 
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
4
3
  Object.defineProperty(exports, "__esModule", {
5
4
  value: true
6
5
  });
7
6
  exports.createApwContentUrlPlugin = exports.ApwContentUrlPlugin = void 0;
8
- var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
9
7
  var _plugins = require("@webiny/plugins");
10
8
  class ApwContentUrlPlugin extends _plugins.Plugin {
9
+ static type = "apw.contentUrl";
11
10
  constructor(contentType, cb) {
12
11
  super();
13
- (0, _defineProperty2.default)(this, "cb", void 0);
14
- (0, _defineProperty2.default)(this, "contentType", void 0);
15
12
  this.contentType = contentType;
16
13
  this.cb = cb;
17
14
  }
@@ -23,8 +20,9 @@ class ApwContentUrlPlugin extends _plugins.Plugin {
23
20
  }
24
21
  }
25
22
  exports.ApwContentUrlPlugin = ApwContentUrlPlugin;
26
- (0, _defineProperty2.default)(ApwContentUrlPlugin, "type", "apw.contentUrl");
27
23
  const createApwContentUrlPlugin = (contentType, cb) => {
28
24
  return new ApwContentUrlPlugin(contentType, cb);
29
25
  };
30
- exports.createApwContentUrlPlugin = createApwContentUrlPlugin;
26
+ exports.createApwContentUrlPlugin = createApwContentUrlPlugin;
27
+
28
+ //# sourceMappingURL=ApwContentUrlPlugin.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["ApwContentUrlPlugin","Plugin","constructor","contentType","cb","canUse","create","params","createApwContentUrlPlugin"],"sources":["ApwContentUrlPlugin.ts"],"sourcesContent":["import { Plugin } from \"@webiny/plugins\";\nimport { ApwContentReview, ApwContentTypes, ApwWorkflow } from \"~/types\";\n\nexport interface ApwContentUrlPluginCbParams {\n baseUrl: string;\n contentReview: ApwContentReview;\n workflow: ApwWorkflow;\n}\nexport interface ApwContentUrlPluginCb {\n (params: ApwContentUrlPluginCbParams): string | null;\n}\n\nexport class ApwContentUrlPlugin extends Plugin {\n public static override type = \"apw.contentUrl\";\n\n private readonly cb: ApwContentUrlPluginCb;\n private readonly contentType: ApwContentTypes;\n\n public constructor(contentType: ApwContentTypes, cb: ApwContentUrlPluginCb) {\n super();\n\n this.contentType = contentType;\n this.cb = cb;\n }\n\n public canUse(contentType: ApwContentTypes): boolean {\n return this.contentType === contentType;\n }\n\n public create(params: ApwContentUrlPluginCbParams): string | null {\n return this.cb(params);\n }\n}\n\nexport const createApwContentUrlPlugin = (\n contentType: ApwContentTypes,\n cb: ApwContentUrlPluginCb\n) => {\n return new ApwContentUrlPlugin(contentType, cb);\n};\n"],"mappings":";;;;;;;;AAAA;AAYO,MAAMA,mBAAmB,SAASC,eAAM,CAAC;EAMrCC,WAAW,CAACC,WAA4B,EAAEC,EAAyB,EAAE;IACxE,KAAK,EAAE;IAAC;IAAA;IAER,IAAI,CAACD,WAAW,GAAGA,WAAW;IAC9B,IAAI,CAACC,EAAE,GAAGA,EAAE;EAChB;EAEOC,MAAM,CAACF,WAA4B,EAAW;IACjD,OAAO,IAAI,CAACA,WAAW,KAAKA,WAAW;EAC3C;EAEOG,MAAM,CAACC,MAAmC,EAAiB;IAC9D,OAAO,IAAI,CAACH,EAAE,CAACG,MAAM,CAAC;EAC1B;AACJ;AAAC;AAAA,8BApBYP,mBAAmB,UACE,gBAAgB;AAqB3C,MAAMQ,yBAAyB,GAAG,CACrCL,WAA4B,EAC5BC,EAAyB,KACxB;EACD,OAAO,IAAIJ,mBAAmB,CAACG,WAAW,EAAEC,EAAE,CAAC;AACnD,CAAC;AAAC"}
1
+ {"version":3,"names":["_plugins","require","ApwContentUrlPlugin","Plugin","type","constructor","contentType","cb","canUse","create","params","exports","createApwContentUrlPlugin"],"sources":["ApwContentUrlPlugin.ts"],"sourcesContent":["import { Plugin } from \"@webiny/plugins\";\nimport { ApwContentReview, ApwContentTypes, ApwWorkflow } from \"~/types\";\n\nexport interface ApwContentUrlPluginCbParams {\n baseUrl: string;\n contentReview: ApwContentReview;\n workflow: ApwWorkflow;\n}\nexport interface ApwContentUrlPluginCb {\n (params: ApwContentUrlPluginCbParams): string | null;\n}\n\nexport class ApwContentUrlPlugin extends Plugin {\n public static override type = \"apw.contentUrl\";\n\n private readonly cb: ApwContentUrlPluginCb;\n private readonly contentType: ApwContentTypes;\n\n public constructor(contentType: ApwContentTypes, cb: ApwContentUrlPluginCb) {\n super();\n\n this.contentType = contentType;\n this.cb = cb;\n }\n\n public canUse(contentType: ApwContentTypes): boolean {\n return this.contentType === contentType;\n }\n\n public create(params: ApwContentUrlPluginCbParams): string | null {\n return this.cb(params);\n }\n}\n\nexport const createApwContentUrlPlugin = (\n contentType: ApwContentTypes,\n cb: ApwContentUrlPluginCb\n) => {\n return new ApwContentUrlPlugin(contentType, cb);\n};\n"],"mappings":";;;;;;AAAA,IAAAA,QAAA,GAAAC,OAAA;AAYO,MAAMC,mBAAmB,SAASC,eAAM,CAAC;EAC5C,OAAuBC,IAAI,GAAG,gBAAgB;EAKvCC,WAAWA,CAACC,WAA4B,EAAEC,EAAyB,EAAE;IACxE,KAAK,CAAC,CAAC;IAEP,IAAI,CAACD,WAAW,GAAGA,WAAW;IAC9B,IAAI,CAACC,EAAE,GAAGA,EAAE;EAChB;EAEOC,MAAMA,CAACF,WAA4B,EAAW;IACjD,OAAO,IAAI,CAACA,WAAW,KAAKA,WAAW;EAC3C;EAEOG,MAAMA,CAACC,MAAmC,EAAiB;IAC9D,OAAO,IAAI,CAACH,EAAE,CAACG,MAAM,CAAC;EAC1B;AACJ;AAACC,OAAA,CAAAT,mBAAA,GAAAA,mBAAA;AAEM,MAAMU,yBAAyB,GAAGA,CACrCN,WAA4B,EAC5BC,EAAyB,KACxB;EACD,OAAO,IAAIL,mBAAmB,CAACI,WAAW,EAAEC,EAAE,CAAC;AACnD,CAAC;AAACI,OAAA,CAAAC,yBAAA,GAAAA,yBAAA"}
@@ -1,12 +1,13 @@
1
1
  "use strict";
2
2
 
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
4
3
  Object.defineProperty(exports, "__esModule", {
5
4
  value: true
6
5
  });
7
6
  exports.ContentApwSettingsPlugin = void 0;
8
- var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
9
7
  var _Plugin = require("@webiny/plugins/Plugin");
10
- class ContentApwSettingsPlugin extends _Plugin.Plugin {}
8
+ class ContentApwSettingsPlugin extends _Plugin.Plugin {
9
+ static type = "apw.contentApwSettings";
10
+ }
11
11
  exports.ContentApwSettingsPlugin = ContentApwSettingsPlugin;
12
- (0, _defineProperty2.default)(ContentApwSettingsPlugin, "type", "apw.contentApwSettings");
12
+
13
+ //# sourceMappingURL=ContentApwSettingsPlugin.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["ContentApwSettingsPlugin","Plugin"],"sources":["ContentApwSettingsPlugin.ts"],"sourcesContent":["import { Plugin } from \"@webiny/plugins/Plugin\";\nimport { ApwContentTypes } from \"~/types\";\n\nexport abstract class ContentApwSettingsPlugin extends Plugin {\n public static override type = \"apw.contentApwSettings\";\n\n public abstract canUse(type: ApwContentTypes): boolean;\n\n public abstract setWorkflowId(content: any, id: string | null): void;\n\n public abstract getWorkflowId(content: any): string | null;\n\n public abstract setContentReviewId(content: any, id: string | null): void;\n\n public abstract getContentReviewId(content: any): string | null;\n}\n"],"mappings":";;;;;;;;AAAA;AAGO,MAAeA,wBAAwB,SAASC,cAAM,CAAC;AAY7D;AAAA,8BAZqBD,wBAAwB,UACZ,wBAAwB"}
1
+ {"version":3,"names":["_Plugin","require","ContentApwSettingsPlugin","Plugin","type","exports"],"sources":["ContentApwSettingsPlugin.ts"],"sourcesContent":["import { Plugin } from \"@webiny/plugins/Plugin\";\nimport { ApwContentTypes } from \"~/types\";\n\nexport abstract class ContentApwSettingsPlugin extends Plugin {\n public static override type = \"apw.contentApwSettings\";\n\n public abstract canUse(type: ApwContentTypes): boolean;\n\n public abstract setWorkflowId(content: any, id: string | null): void;\n\n public abstract getWorkflowId(content: any): string | null;\n\n public abstract setContentReviewId(content: any, id: string | null): void;\n\n public abstract getContentReviewId(content: any): string | null;\n}\n"],"mappings":";;;;;;AAAA,IAAAA,OAAA,GAAAC,OAAA;AAGO,MAAeC,wBAAwB,SAASC,cAAM,CAAC;EAC1D,OAAuBC,IAAI,GAAG,wBAAwB;AAW1D;AAACC,OAAA,CAAAH,wBAAA,GAAAA,wBAAA"}
package/README.md CHANGED
@@ -24,11 +24,11 @@ To run tests api-apw tests with targeted storage operations loaded use:
24
24
  #### DynamoDB
25
25
 
26
26
  ```
27
- yarn test packages/api-apw --keyword=apw:ddb --keyword=apw:base
27
+ yarn test packages/api-apw --storage:ddb --keyword=apw:ddb --keyword=apw:base
28
28
  ```
29
29
 
30
30
  #### Note
31
31
 
32
32
  > All the tests in `@webiny/api-apw` package are being tested against ddb-only storage operations because
33
- current jest setup doesn't allow usage of more than one storage operations at a time with the help of --keyword flag.
34
- We should revisit these tests once we have the ability to load multiple storage operations in the jest setup.
33
+ > current jest setup doesn't allow usage of more than one storage operations at a time with the help of --keyword flag.
34
+ > We should revisit these tests once we have the ability to load multiple storage operations in the jest setup.
@@ -88,4 +88,6 @@ function createChangeRequestMethods({
88
88
  onChangeRequestBeforeDelete,
89
89
  onChangeRequestAfterDelete
90
90
  };
91
- }
91
+ }
92
+
93
+ //# sourceMappingURL=createChangeRequestMethods.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["createChangeRequestMethods","storageOperations","onChangeRequestBeforeCreate","createTopic","onChangeRequestAfterCreate","onChangeRequestBeforeUpdate","onChangeRequestAfterUpdate","onChangeRequestBeforeDelete","onChangeRequestAfterDelete","get","id","getChangeRequest","list","params","listChangeRequests","create","data","publish","input","changeRequest","createChangeRequest","update","original","updateChangeRequest","delete","deleteChangeRequest"],"sources":["createChangeRequestMethods.ts"],"sourcesContent":["import { createTopic } from \"@webiny/pubsub\";\nimport {\n ApwChangeRequestCrud,\n CreateApwParams,\n OnChangeRequestAfterCreateTopicParams,\n OnChangeRequestAfterDeleteTopicParams,\n OnChangeRequestAfterUpdateTopicParams,\n OnChangeRequestBeforeCreateTopicParams,\n OnChangeRequestBeforeDeleteTopicParams,\n OnChangeRequestBeforeUpdateTopicParams\n} from \"~/types\";\n\nexport function createChangeRequestMethods({\n storageOperations\n}: CreateApwParams): ApwChangeRequestCrud {\n // create\n const onChangeRequestBeforeCreate = createTopic<OnChangeRequestBeforeCreateTopicParams>(\n \"apw.onChangeRequestBeforeCreate\"\n );\n const onChangeRequestAfterCreate = createTopic<OnChangeRequestAfterCreateTopicParams>(\n \"apw.onChangeRequestAfterCreate\"\n );\n // update\n const onChangeRequestBeforeUpdate = createTopic<OnChangeRequestBeforeUpdateTopicParams>(\n \"apw.onChangeRequestBeforeUpdate\"\n );\n const onChangeRequestAfterUpdate = createTopic<OnChangeRequestAfterUpdateTopicParams>(\n \"apw.onChangeRequestAfterUpdate\"\n );\n // delete\n const onChangeRequestBeforeDelete = createTopic<OnChangeRequestBeforeDeleteTopicParams>(\n \"apw.onChangeRequestBeforeDelete\"\n );\n const onChangeRequestAfterDelete = createTopic<OnChangeRequestAfterDeleteTopicParams>(\n \"apw.onChangeRequestAfterDelete\"\n );\n\n return {\n async get(id) {\n return storageOperations.getChangeRequest({ id });\n },\n async list(params) {\n return storageOperations.listChangeRequests(params);\n },\n async create(data) {\n await onChangeRequestBeforeCreate.publish({ input: data });\n\n const changeRequest = await storageOperations.createChangeRequest({ data });\n\n await onChangeRequestAfterCreate.publish({ changeRequest });\n\n return changeRequest;\n },\n async update(id, data) {\n const original = await storageOperations.getChangeRequest({ id });\n\n await onChangeRequestBeforeUpdate.publish({ original, input: { id, data } });\n\n const changeRequest = await storageOperations.updateChangeRequest({ id, data });\n\n await onChangeRequestAfterUpdate.publish({\n original,\n input: { id, data },\n changeRequest\n });\n\n return changeRequest;\n },\n async delete(id: string) {\n const changeRequest = await storageOperations.getChangeRequest({ id });\n\n await onChangeRequestBeforeDelete.publish({ changeRequest });\n\n await storageOperations.deleteChangeRequest({ id });\n\n await onChangeRequestAfterDelete.publish({ changeRequest });\n\n return true;\n },\n /**\n * Lifecycle events\n */\n onChangeRequestBeforeCreate,\n onChangeRequestAfterCreate,\n onChangeRequestBeforeUpdate,\n onChangeRequestAfterUpdate,\n onChangeRequestBeforeDelete,\n onChangeRequestAfterDelete\n };\n}\n"],"mappings":";;;;;;AAAA;AAYO,SAASA,0BAA0B,CAAC;EACvCC;AACa,CAAC,EAAwB;EACtC;EACA,MAAMC,2BAA2B,GAAG,IAAAC,mBAAW,EAC3C,iCAAiC,CACpC;EACD,MAAMC,0BAA0B,GAAG,IAAAD,mBAAW,EAC1C,gCAAgC,CACnC;EACD;EACA,MAAME,2BAA2B,GAAG,IAAAF,mBAAW,EAC3C,iCAAiC,CACpC;EACD,MAAMG,0BAA0B,GAAG,IAAAH,mBAAW,EAC1C,gCAAgC,CACnC;EACD;EACA,MAAMI,2BAA2B,GAAG,IAAAJ,mBAAW,EAC3C,iCAAiC,CACpC;EACD,MAAMK,0BAA0B,GAAG,IAAAL,mBAAW,EAC1C,gCAAgC,CACnC;EAED,OAAO;IACH,MAAMM,GAAG,CAACC,EAAE,EAAE;MACV,OAAOT,iBAAiB,CAACU,gBAAgB,CAAC;QAAED;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A0B,CAACS,OAAO,CAAC;QAAEE;MAAc,CAAC,CAAC;MAE3D,OAAO,IAAI;IACf,CAAC;IACD;AACR;AACA;IACQjB,2BAA2B;IAC3BE,0BAA0B;IAC1BC,2BAA2B;IAC3BC,0BAA0B;IAC1BC,2BAA2B;IAC3BC;EACJ,CAAC;AACL"}
1
+ {"version":3,"names":["_pubsub","require","createChangeRequestMethods","storageOperations","onChangeRequestBeforeCreate","createTopic","onChangeRequestAfterCreate","onChangeRequestBeforeUpdate","onChangeRequestAfterUpdate","onChangeRequestBeforeDelete","onChangeRequestAfterDelete","get","id","getChangeRequest","list","params","listChangeRequests","create","data","publish","input","changeRequest","createChangeRequest","update","original","updateChangeRequest","delete","deleteChangeRequest"],"sources":["createChangeRequestMethods.ts"],"sourcesContent":["import { createTopic } from \"@webiny/pubsub\";\nimport {\n ApwChangeRequestCrud,\n CreateApwParams,\n OnChangeRequestAfterCreateTopicParams,\n OnChangeRequestAfterDeleteTopicParams,\n OnChangeRequestAfterUpdateTopicParams,\n OnChangeRequestBeforeCreateTopicParams,\n OnChangeRequestBeforeDeleteTopicParams,\n OnChangeRequestBeforeUpdateTopicParams\n} from \"~/types\";\n\nexport function createChangeRequestMethods({\n storageOperations\n}: CreateApwParams): ApwChangeRequestCrud {\n // create\n const onChangeRequestBeforeCreate = createTopic<OnChangeRequestBeforeCreateTopicParams>(\n \"apw.onChangeRequestBeforeCreate\"\n );\n const onChangeRequestAfterCreate = createTopic<OnChangeRequestAfterCreateTopicParams>(\n \"apw.onChangeRequestAfterCreate\"\n );\n // update\n const onChangeRequestBeforeUpdate = createTopic<OnChangeRequestBeforeUpdateTopicParams>(\n \"apw.onChangeRequestBeforeUpdate\"\n );\n const onChangeRequestAfterUpdate = createTopic<OnChangeRequestAfterUpdateTopicParams>(\n \"apw.onChangeRequestAfterUpdate\"\n );\n // delete\n const onChangeRequestBeforeDelete = createTopic<OnChangeRequestBeforeDeleteTopicParams>(\n \"apw.onChangeRequestBeforeDelete\"\n );\n const onChangeRequestAfterDelete = createTopic<OnChangeRequestAfterDeleteTopicParams>(\n \"apw.onChangeRequestAfterDelete\"\n );\n\n return {\n async get(id) {\n return storageOperations.getChangeRequest({ id });\n },\n async list(params) {\n return storageOperations.listChangeRequests(params);\n },\n async create(data) {\n await onChangeRequestBeforeCreate.publish({ input: data });\n\n const changeRequest = await storageOperations.createChangeRequest({ data });\n\n await onChangeRequestAfterCreate.publish({ changeRequest });\n\n return changeRequest;\n },\n async update(id, data) {\n const original = await storageOperations.getChangeRequest({ id });\n\n await onChangeRequestBeforeUpdate.publish({ original, input: { id, data } });\n\n const changeRequest = await storageOperations.updateChangeRequest({ id, data });\n\n await onChangeRequestAfterUpdate.publish({\n original,\n input: { id, data },\n changeRequest\n });\n\n return changeRequest;\n },\n async delete(id: string) {\n const changeRequest = await storageOperations.getChangeRequest({ id });\n\n await onChangeRequestBeforeDelete.publish({ changeRequest });\n\n await storageOperations.deleteChangeRequest({ id });\n\n await onChangeRequestAfterDelete.publish({ changeRequest });\n\n return true;\n },\n /**\n * Lifecycle events\n */\n onChangeRequestBeforeCreate,\n onChangeRequestAfterCreate,\n onChangeRequestBeforeUpdate,\n onChangeRequestAfterUpdate,\n onChangeRequestBeforeDelete,\n onChangeRequestAfterDelete\n };\n}\n"],"mappings":";;;;;;AAAA,IAAAA,OAAA,GAAAC,OAAA;AAYO,SAASC,0BAA0BA,CAAC;EACvCC;AACa,CAAC,EAAwB;EACtC;EACA,MAAMC,2BAA2B,GAAG,IAAAC,mBAAW,EAC3C,iCACJ,CAAC;EACD,MAAMC,0BAA0B,GAAG,IAAAD,mBAAW,EAC1C,gCACJ,CAAC;EACD;EACA,MAAME,2BAA2B,GAAG,IAAAF,mBAAW,EAC3C,iCACJ,CAAC;EACD,MAAMG,0BAA0B,GAAG,IAAAH,mBAAW,EAC1C,gCACJ,CAAC;EACD;EACA,MAAMI,2BAA2B,GAAG,IAAAJ,mBAAW,EAC3C,iCACJ,CAAC;EACD,MAAMK,0BAA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MH,2BAA2B,CAACU,OAAO,CAAC;QAAEE;MAAc,CAAC,CAAC;MAE5D,MAAMlB,iBAAiB,CAACwB,mBAAmB,CAAC;QAAEf;MAAG,CAAC,CAAC;MAEnD,MAAMF,0BAA0B,CAACS,OAAO,CAAC;QAAEE;MAAc,CAAC,CAAC;MAE3D,OAAO,IAAI;IACf,CAAC;IACD;AACR;AACA;IACQjB,2BAA2B;IAC3BE,0BAA0B;IAC1BC,2BAA2B;IAC3BC,0BAA0B;IAC1BC,2BAA2B;IAC3BC;EACJ,CAAC;AACL"}
@@ -88,4 +88,6 @@ function createCommentMethods({
88
88
  return true;
89
89
  }
90
90
  };
91
- }
91
+ }
92
+
93
+ //# sourceMappingURL=createCommentMethods.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["createCommentMethods","storageOperations","onCommentBeforeCreate","createTopic","onCommentAfterCreate","onCommentBeforeUpdate","onCommentAfterUpdate","onCommentBeforeDelete","onCommentAfterDelete","get","id","getComment","list","params","listComments","create","data","publish","input","comment","createComment","update","original","updateComment","delete","deleteComment"],"sources":["createCommentMethods.ts"],"sourcesContent":["import { createTopic } from \"@webiny/pubsub\";\nimport {\n ApwCommentCrud,\n CreateApwParams,\n OnCommentBeforeCreateTopicParams,\n OnCommentAfterCreateTopicParams,\n OnCommentBeforeUpdateTopicParams,\n OnCommentAfterUpdateTopicParams,\n OnCommentBeforeDeleteTopicParams,\n OnCommentAfterDeleteTopicParams\n} from \"~/types\";\n\nexport function createCommentMethods({ storageOperations }: CreateApwParams): ApwCommentCrud {\n // create\n const onCommentBeforeCreate = createTopic<OnCommentBeforeCreateTopicParams>(\n \"apw.onCommentBeforeCreate\"\n );\n const onCommentAfterCreate = createTopic<OnCommentAfterCreateTopicParams>(\n \"apw.onCommentAfterCreate\"\n );\n // update\n const onCommentBeforeUpdate = createTopic<OnCommentBeforeUpdateTopicParams>(\n \"apw.onCommentBeforeUpdate\"\n );\n const onCommentAfterUpdate = createTopic<OnCommentAfterUpdateTopicParams>(\n \"apw.onCommentAfterUpdate\"\n );\n // delete\n const onCommentBeforeDelete = createTopic<OnCommentBeforeDeleteTopicParams>(\n \"apw.onCommentBeforeDelete\"\n );\n const onCommentAfterDelete = createTopic<OnCommentAfterDeleteTopicParams>(\n \"apw.onCommentAfterDelete\"\n );\n\n return {\n /**\n * Lifecycle events\n */\n onCommentBeforeCreate,\n onCommentAfterCreate,\n onCommentBeforeUpdate,\n onCommentAfterUpdate,\n onCommentBeforeDelete,\n onCommentAfterDelete,\n async get(id) {\n return storageOperations.getComment({ id });\n },\n async list(params) {\n return storageOperations.listComments(params);\n },\n async create(data) {\n await onCommentBeforeCreate.publish({ input: data });\n\n const comment = await storageOperations.createComment({\n data\n });\n await onCommentAfterCreate.publish({ comment });\n\n return comment;\n },\n async update(id, data) {\n const original = await storageOperations.getComment({ id });\n\n await onCommentBeforeUpdate.publish({ original, input: { id, data } });\n\n const comment = await storageOperations.updateComment({ id, data });\n\n await onCommentAfterUpdate.publish({ original, comment, input: { id, data } });\n\n return comment;\n },\n async delete(id: string) {\n const comment = await storageOperations.getComment({ id });\n\n await onCommentBeforeDelete.publish({ comment });\n\n await storageOperations.deleteComment({ id });\n\n await onCommentAfterDelete.publish({ comment });\n\n return true;\n }\n };\n}\n"],"mappings":";;;;;;AAAA;AAYO,SAASA,oBAAoB,CAAC;EAAEC;AAAmC,CAAC,EAAkB;EACzF;EACA,MAAMC,qBAAqB,GAAG,IAAAC,mBAAW,EACrC,2BAA2B,CAC9B;EACD,MAAMC,oBAAoB,GAAG,IAAAD,mBAAW,EACpC,0BAA0B,CAC7B;EACD;EACA,MAAME,qBAAqB,GAAG,IAAAF,mBAAW,EACrC,2BAA2B,CAC9B;EACD,MAAMG,oBAAoB,GAAG,IAAAH,mBAAW,EACpC,0BAA0B,CAC7B;EACD;EACA,MAAMI,qBAAqB,GAAG,IAAAJ,mBAAW,EACrC,2BAA2B,CAC9B;EACD,MAAMK,oBAAoB,GAAG,IAAAL,mBAAW,EACpC,0BA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B,CAACU,UAAU,CAAC;QAAED;MAAG,CAAC,CAAC;MAE1D,MAAMH,qBAAqB,CAACU,OAAO,CAAC;QAAEE;MAAQ,CAAC,CAAC;MAEhD,MAAMlB,iBAAiB,CAACwB,aAAa,CAAC;QAAEf;MAAG,CAAC,CAAC;MAE7C,MAAMF,oBAAoB,CAACS,OAAO,CAAC;QAAEE;MAAQ,CAAC,CAAC;MAE/C,OAAO,IAAI;IACf;EACJ,CAAC;AACL"}
1
+ {"version":3,"names":["_pubsub","require","createCommentMethods","storageOperations","onCommentBeforeCreate","createTopic","onCommentAfterCreate","onCommentBeforeUpdate","onCommentAfterUpdate","onCommentBeforeDelete","onCommentAfterDelete","get","id","getComment","list","params","listComments","create","data","publish","input","comment","createComment","update","original","updateComment","delete","deleteComment"],"sources":["createCommentMethods.ts"],"sourcesContent":["import { createTopic } from \"@webiny/pubsub\";\nimport {\n ApwCommentCrud,\n CreateApwParams,\n OnCommentBeforeCreateTopicParams,\n OnCommentAfterCreateTopicParams,\n OnCommentBeforeUpdateTopicParams,\n OnCommentAfterUpdateTopicParams,\n OnCommentBeforeDeleteTopicParams,\n OnCommentAfterDeleteTopicParams\n} from \"~/types\";\n\nexport function createCommentMethods({ storageOperations }: CreateApwParams): ApwCommentCrud {\n // create\n const onCommentBeforeCreate = createTopic<OnCommentBeforeCreateTopicParams>(\n \"apw.onCommentBeforeCreate\"\n );\n const onCommentAfterCreate = createTopic<OnCommentAfterCreateTopicParams>(\n \"apw.onCommentAfterCreate\"\n );\n // update\n const onCommentBeforeUpdate = createTopic<OnCommentBeforeUpdateTopicParams>(\n \"apw.onCommentBeforeUpdate\"\n );\n const onCommentAfterUpdate = createTopic<OnCommentAfterUpdateTopicParams>(\n \"apw.onCommentAfterUpdate\"\n );\n // delete\n const onCommentBeforeDelete = createTopic<OnCommentBeforeDeleteTopicParams>(\n \"apw.onCommentBeforeDelete\"\n );\n const onCommentAfterDelete = createTopic<OnCommentAfterDeleteTopicParams>(\n \"apw.onCommentAfterDelete\"\n );\n\n return {\n /**\n * Lifecycle events\n */\n onCommentBeforeCreate,\n onCommentAfterCreate,\n onCommentBeforeUpdate,\n onCommentAfterUpdate,\n onCommentBeforeDelete,\n onCommentAfterDelete,\n async get(id) {\n return storageOperations.getComment({ id });\n },\n async list(params) {\n return storageOperations.listComments(params);\n },\n async create(data) {\n await onCommentBeforeCreate.publish({ input: data });\n\n const comment = await storageOperations.createComment({\n data\n });\n await onCommentAfterCreate.publish({ comment });\n\n return comment;\n },\n async update(id, data) {\n const original = await storageOperations.getComment({ id });\n\n await onCommentBeforeUpdate.publish({ original, input: { id, data } });\n\n const comment = await storageOperations.updateComment({ id, data });\n\n await onCommentAfterUpdate.publish({ original, comment, input: { id, data } });\n\n return comment;\n },\n async delete(id: string) {\n const comment = await storageOperations.getComment({ id });\n\n await onCommentBeforeDelete.publish({ comment });\n\n await storageOperations.deleteComment({ id });\n\n await onCommentAfterDelete.publish({ comment });\n\n return true;\n }\n };\n}\n"],"mappings":";;;;;;AAAA,IAAAA,OAAA,GAAAC,OAAA;AAYO,SAASC,oBAAoBA,CAAC;EAAEC;AAAmC,CAAC,EAAkB;EACzF;EACA,MAAMC,qBAAqB,GAAG,IAAAC,mBAAW,EACrC,2BACJ,CAAC;EACD,MAAMC,oBAAoB,GAAG,IAAAD,mBAAW,EACpC,0BACJ,CAAC;EACD;EACA,MAAME,qBAAqB,GAAG,IAAAF,mBAAW,EACrC,2BACJ,CAAC;EACD,MAAMG,oBAAoB,GAAG,IAAAH,mBAAW,EACpC,0BACJ,CAAC;EACD;EACA,MAAMI,qBAAqB,GAAG,IAAAJ,mBAAW,EACrC,2BACJ,CAAC;EACD,MAAMK,oBAAoB,GAAG,IAAAL,mBAAW,EACpC,0BACJ,CAAC;EAED,OAAO;IACH;AACR;AACA;IACQD,qBAAqB;IACrBE,oBAAoB;IACpBC,qBAAqB;IACrBC,oBAAoB;IACpBC,qBAAqB;IACrBC,oBAAoB;IACpB,MAAMC,GAAGA,CAACC,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AAC;QAAEf;MAAG,CAAC,CAAC;MAE7C,MAAMF,oBAAoB,CAACS,OAAO,CAAC;QAAEE;MAAQ,CAAC,CAAC;MAE/C,OAAO,IAAI;IACf;EACJ,CAAC;AACL"}
@@ -5,7 +5,6 @@ Object.defineProperty(exports, "__esModule", {
5
5
  value: true
6
6
  });
7
7
  exports.createContentReviewMethods = createContentReviewMethods;
8
- var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
9
8
  var _get = _interopRequireDefault(require("lodash/get"));
10
9
  var _pubsub = require("@webiny/pubsub");
11
10
  var _error = _interopRequireDefault(require("@webiny/error"));
@@ -64,22 +63,25 @@ function createContentReviewMethods(params) {
64
63
  });
65
64
  if (where.reviewStatus === "requiresMyAttention") {
66
65
  return (0, _utils2.filterContentReviewsByRequiresMyAttention)({
67
- listParams: (0, _objectSpread2.default)((0, _objectSpread2.default)({}, params), {}, {
66
+ listParams: {
67
+ ...params,
68
68
  where
69
- }),
69
+ },
70
70
  listContentReviews: storageOperations.listContentReviews,
71
71
  getReviewer,
72
72
  getIdentity
73
73
  });
74
74
  }
75
- return storageOperations.listContentReviews((0, _objectSpread2.default)((0, _objectSpread2.default)({}, params), {}, {
75
+ return storageOperations.listContentReviews({
76
+ ...params,
76
77
  where
77
- }));
78
+ });
78
79
  },
79
80
  async create(data) {
80
- const input = (0, _objectSpread2.default)((0, _objectSpread2.default)({}, data), {}, {
81
+ const input = {
82
+ ...data,
81
83
  reviewStatus: _types.ApwContentReviewStatus.UNDER_REVIEW
82
- });
84
+ };
83
85
  await onContentReviewBeforeCreate.publish({
84
86
  input
85
87
  });
@@ -202,11 +204,12 @@ function createContentReviewMethods(params) {
202
204
  const updatedSteps = steps.map((step, index) => {
203
205
  if (index === stepIndex) {
204
206
  previousStepStatus = _types.ApwContentReviewStepStatus.DONE;
205
- return (0, _objectSpread2.default)((0, _objectSpread2.default)({}, step), {}, {
207
+ return {
208
+ ...step,
206
209
  status: _types.ApwContentReviewStepStatus.DONE,
207
210
  signOffProvidedOn: new Date().toISOString(),
208
211
  signOffProvidedBy: identity
209
- });
212
+ };
210
213
  }
211
214
  /**
212
215
  * Update next steps status based on type.
@@ -214,9 +217,10 @@ function createContentReviewMethods(params) {
214
217
  if (index > stepIndex) {
215
218
  const previousStep = steps[index - 1];
216
219
  previousStepStatus = (0, _utils.getNextStepStatus)(previousStep.type, previousStepStatus);
217
- return (0, _objectSpread2.default)((0, _objectSpread2.default)({}, step), {}, {
220
+ return {
221
+ ...step,
218
222
  status: previousStepStatus
219
- });
223
+ };
220
224
  }
221
225
  return step;
222
226
  });
@@ -243,7 +247,6 @@ function createContentReviewMethods(params) {
243
247
  return true;
244
248
  },
245
249
  async retractSignOff(id, stepId) {
246
- var _contentReview$conten;
247
250
  const contentReview = await this.get(id);
248
251
  const {
249
252
  steps,
@@ -291,11 +294,12 @@ function createContentReviewMethods(params) {
291
294
  const updatedSteps = steps.map((step, index) => {
292
295
  if (index === stepIndex) {
293
296
  previousStepStatus = _types.ApwContentReviewStepStatus.ACTIVE;
294
- return (0, _objectSpread2.default)((0, _objectSpread2.default)({}, step), {}, {
297
+ return {
298
+ ...step,
295
299
  status: previousStepStatus,
296
300
  signOffProvidedOn: null,
297
301
  signOffProvidedBy: null
298
- });
302
+ };
299
303
  }
300
304
  /**
301
305
  * Set next step status as "inactive".
@@ -303,9 +307,10 @@ function createContentReviewMethods(params) {
303
307
  if (index > stepIndex) {
304
308
  const previousStep = steps[index - 1];
305
309
  previousStepStatus = (0, _utils.getNextStepStatus)(previousStep.type, previousStepStatus);
306
- return (0, _objectSpread2.default)((0, _objectSpread2.default)({}, step), {}, {
310
+ return {
311
+ ...step,
307
312
  status: previousStepStatus
308
- });
313
+ };
309
314
  }
310
315
  return step;
311
316
  });
@@ -325,16 +330,17 @@ function createContentReviewMethods(params) {
325
330
  /**
326
331
  * We need to delete the scheduled action if one was created.
327
332
  */
328
- const scheduledActionId = (_contentReview$conten = contentReview.content) === null || _contentReview$conten === void 0 ? void 0 : _contentReview$conten.scheduledActionId;
333
+ const scheduledActionId = contentReview.content?.scheduledActionId;
329
334
  if (!!scheduledActionId) {
330
335
  await scheduler.delete(scheduledActionId);
331
336
  }
332
337
  await this.update(id, {
333
- content: (0, _objectSpread2.default)((0, _objectSpread2.default)({}, content), {}, {
338
+ content: {
339
+ ...content,
334
340
  scheduledOn: null,
335
341
  scheduledBy: null,
336
342
  scheduledActionId: null
337
- }),
343
+ },
338
344
  steps: updatedSteps,
339
345
  reviewStatus: newStatus
340
346
  });
@@ -362,7 +368,6 @@ function createContentReviewMethods(params) {
362
368
  };
363
369
  },
364
370
  async publishContent(id, datetime) {
365
- var _content$settings;
366
371
  const {
367
372
  content,
368
373
  reviewStatus
@@ -394,7 +399,7 @@ function createContentReviewMethods(params) {
394
399
  action: _types2.ApwScheduleActionTypes.PUBLISH,
395
400
  type: content.type,
396
401
  entryId: content.id,
397
- modelId: (_content$settings = content.settings) === null || _content$settings === void 0 ? void 0 : _content$settings.modelId,
402
+ modelId: content.settings?.modelId,
398
403
  datetime
399
404
  };
400
405
  const scheduledActionId = await this.scheduleAction(data);
@@ -402,16 +407,16 @@ function createContentReviewMethods(params) {
402
407
  * Update scheduled related meta data.
403
408
  */
404
409
  await this.update(id, {
405
- content: (0, _objectSpread2.default)((0, _objectSpread2.default)({}, content), {}, {
410
+ content: {
411
+ ...content,
406
412
  scheduledOn: datetime,
407
413
  scheduledBy: identity.id,
408
414
  scheduledActionId
409
- })
415
+ }
410
416
  });
411
417
  return true;
412
418
  },
413
419
  async unpublishContent(id, datetime) {
414
- var _content$settings2;
415
420
  const {
416
421
  content,
417
422
  reviewStatus
@@ -443,18 +448,19 @@ function createContentReviewMethods(params) {
443
448
  action: _types2.ApwScheduleActionTypes.UNPUBLISH,
444
449
  type: content.type,
445
450
  entryId: content.id,
446
- modelId: (_content$settings2 = content.settings) === null || _content$settings2 === void 0 ? void 0 : _content$settings2.modelId,
451
+ modelId: content.settings?.modelId,
447
452
  datetime
448
453
  });
449
454
  /**
450
455
  * Update scheduled related meta data.
451
456
  */
452
457
  await this.update(id, {
453
- content: (0, _objectSpread2.default)((0, _objectSpread2.default)({}, content), {}, {
458
+ content: {
459
+ ...content,
454
460
  scheduledOn: datetime,
455
461
  scheduledBy: identity.id,
456
462
  scheduledActionId
457
- })
463
+ }
458
464
  });
459
465
  return true;
460
466
  },
@@ -505,9 +511,14 @@ function createContentReviewMethods(params) {
505
511
  * Reset scheduled related meta data.
506
512
  */
507
513
  await this.update(id, {
508
- content: (0, _objectSpread2.default)((0, _objectSpread2.default)({}, contentReview.content), _utils2.INITIAL_CONTENT_REVIEW_CONTENT_SCHEDULE_META)
514
+ content: {
515
+ ...contentReview.content,
516
+ ..._utils2.INITIAL_CONTENT_REVIEW_CONTENT_SCHEDULE_META
517
+ }
509
518
  });
510
519
  return true;
511
520
  }
512
521
  };
513
- }
522
+ }
523
+
524
+ //# sourceMappingURL=createContentReviewMethods.js.map