@webiny/api-apw 0.0.0-unstable.df6d94b531 → 0.0.0-unstable.e53eceafb5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (310) hide show
  1. package/ApwChangeRequestNotification.d.ts +1 -1
  2. package/ApwChangeRequestNotification.js +4 -6
  3. package/ApwChangeRequestNotification.js.map +1 -1
  4. package/ApwCommentNotification.d.ts +1 -1
  5. package/ApwCommentNotification.js +4 -6
  6. package/ApwCommentNotification.js.map +1 -1
  7. package/ApwContentReviewNotification.d.ts +1 -1
  8. package/ApwContentReviewNotification.js +4 -6
  9. package/ApwContentReviewNotification.js.map +1 -1
  10. package/ApwContentUrlPlugin.d.ts +1 -1
  11. package/ApwContentUrlPlugin.js +4 -6
  12. package/ApwContentUrlPlugin.js.map +1 -1
  13. package/ContentApwSettingsPlugin.d.ts +1 -1
  14. package/ContentApwSettingsPlugin.js +5 -4
  15. package/ContentApwSettingsPlugin.js.map +1 -1
  16. package/README.md +3 -3
  17. package/crud/createChangeRequestMethods.d.ts +1 -1
  18. package/crud/createChangeRequestMethods.js +3 -1
  19. package/crud/createChangeRequestMethods.js.map +1 -1
  20. package/crud/createCommentMethods.d.ts +1 -1
  21. package/crud/createCommentMethods.js +3 -1
  22. package/crud/createCommentMethods.js.map +1 -1
  23. package/crud/createContentReviewMethods.d.ts +2 -2
  24. package/crud/createContentReviewMethods.js +57 -32
  25. package/crud/createContentReviewMethods.js.map +1 -1
  26. package/crud/createReviewerMethods.d.ts +1 -1
  27. package/crud/createReviewerMethods.js +3 -1
  28. package/crud/createReviewerMethods.js.map +1 -1
  29. package/crud/createWorkflowMethods.d.ts +1 -1
  30. package/crud/createWorkflowMethods.js +3 -1
  31. package/crud/createWorkflowMethods.js.map +1 -1
  32. package/crud/index.d.ts +1 -1
  33. package/crud/index.js +6 -5
  34. package/crud/index.js.map +1 -1
  35. package/crud/utils.d.ts +2 -2
  36. package/crud/utils.js +8 -8
  37. package/crud/utils.js.map +1 -1
  38. package/index.d.ts +2 -2
  39. package/index.js +4 -3
  40. package/index.js.map +1 -1
  41. package/package.json +32 -50
  42. package/plugins/cms/CmsEntryApwSettingsGetterPlugin.d.ts +1 -1
  43. package/plugins/cms/CmsEntryApwSettingsGetterPlugin.js +5 -5
  44. package/plugins/cms/CmsEntryApwSettingsGetterPlugin.js.map +1 -1
  45. package/plugins/cms/apwEntryPlugins.d.ts +2 -2
  46. package/plugins/cms/apwEntryPlugins.js +19 -7
  47. package/plugins/cms/apwEntryPlugins.js.map +1 -1
  48. package/plugins/cms/index.d.ts +4 -4
  49. package/plugins/cms/index.js +3 -1
  50. package/plugins/cms/index.js.map +1 -1
  51. package/plugins/cms/linkContentReviewToEntry.d.ts +2 -2
  52. package/plugins/cms/linkContentReviewToEntry.js +5 -4
  53. package/plugins/cms/linkContentReviewToEntry.js.map +1 -1
  54. package/plugins/cms/linkWorkflowToEntry.d.ts +2 -2
  55. package/plugins/cms/linkWorkflowToEntry.js +17 -16
  56. package/plugins/cms/linkWorkflowToEntry.js.map +1 -1
  57. package/plugins/cms/notifications/changeRequestNotification.js +3 -1
  58. package/plugins/cms/notifications/changeRequestNotification.js.map +1 -1
  59. package/plugins/cms/notifications/commentNotification.js +3 -1
  60. package/plugins/cms/notifications/commentNotification.js.map +1 -1
  61. package/plugins/cms/notifications/contentReviewNotification.js +3 -1
  62. package/plugins/cms/notifications/contentReviewNotification.js.map +1 -1
  63. package/plugins/cms/notifications/contentUrl.js +3 -1
  64. package/plugins/cms/notifications/contentUrl.js.map +1 -1
  65. package/plugins/cms/triggerContentReview.d.ts +2 -2
  66. package/plugins/cms/triggerContentReview.js +6 -5
  67. package/plugins/cms/triggerContentReview.js.map +1 -1
  68. package/plugins/cms/updateContentReviewStatus.d.ts +3 -3
  69. package/plugins/cms/updateContentReviewStatus.js +15 -13
  70. package/plugins/cms/updateContentReviewStatus.js.map +1 -1
  71. package/plugins/cms/utils.d.ts +5 -4
  72. package/plugins/cms/utils.js +19 -13
  73. package/plugins/cms/utils.js.map +1 -1
  74. package/plugins/context.d.ts +2 -2
  75. package/plugins/context.js +3 -1
  76. package/plugins/context.js.map +1 -1
  77. package/plugins/graphql/changeRequest.gql.d.ts +1 -1
  78. package/plugins/graphql/changeRequest.gql.js +16 -13
  79. package/plugins/graphql/changeRequest.gql.js.map +1 -1
  80. package/plugins/graphql/comment.gql.d.ts +1 -1
  81. package/plugins/graphql/comment.gql.js +41 -36
  82. package/plugins/graphql/comment.gql.js.map +1 -1
  83. package/plugins/graphql/contentReview.gql.d.ts +1 -1
  84. package/plugins/graphql/contentReview.gql.js +23 -14
  85. package/plugins/graphql/contentReview.gql.js.map +1 -1
  86. package/plugins/graphql/reviewer.gql.d.ts +1 -1
  87. package/plugins/graphql/reviewer.gql.js +15 -13
  88. package/plugins/graphql/reviewer.gql.js.map +1 -1
  89. package/plugins/graphql/utils.d.ts +2 -0
  90. package/plugins/graphql/utils.js +10 -0
  91. package/plugins/graphql/utils.js.map +1 -0
  92. package/plugins/graphql/workflow.gql.d.ts +1 -1
  93. package/plugins/graphql/workflow.gql.js +15 -13
  94. package/plugins/graphql/workflow.gql.js.map +1 -1
  95. package/plugins/graphql.d.ts +1 -1
  96. package/plugins/graphql.js +3 -1
  97. package/plugins/graphql.js.map +1 -1
  98. package/plugins/hooks/createReviewerFromIdentity.d.ts +1 -1
  99. package/plugins/hooks/createReviewerFromIdentity.js +4 -2
  100. package/plugins/hooks/createReviewerFromIdentity.js.map +1 -1
  101. package/plugins/hooks/deleteChangeRequestsAfterContentReview.d.ts +1 -1
  102. package/plugins/hooks/deleteChangeRequestsAfterContentReview.js +3 -1
  103. package/plugins/hooks/deleteChangeRequestsAfterContentReview.js.map +1 -1
  104. package/plugins/hooks/deleteCommentsAfterChangeRequest.d.ts +1 -1
  105. package/plugins/hooks/deleteCommentsAfterChangeRequest.js +3 -1
  106. package/plugins/hooks/deleteCommentsAfterChangeRequest.js.map +1 -1
  107. package/plugins/hooks/index.d.ts +1 -1
  108. package/plugins/hooks/index.js +3 -1
  109. package/plugins/hooks/index.js.map +1 -1
  110. package/plugins/hooks/initializeContentReviewSteps.d.ts +1 -1
  111. package/plugins/hooks/initializeContentReviewSteps.js +6 -4
  112. package/plugins/hooks/initializeContentReviewSteps.js.map +1 -1
  113. package/plugins/hooks/initializeNotifications.d.ts +1 -1
  114. package/plugins/hooks/initializeNotifications.js +3 -1
  115. package/plugins/hooks/initializeNotifications.js.map +1 -1
  116. package/plugins/hooks/listContentReviews.d.ts +3 -3
  117. package/plugins/hooks/listContentReviews.js +4 -2
  118. package/plugins/hooks/listContentReviews.js.map +1 -1
  119. package/plugins/hooks/notifications/changeRequestAfterCreate.d.ts +1 -1
  120. package/plugins/hooks/notifications/changeRequestAfterCreate.js +8 -11
  121. package/plugins/hooks/notifications/changeRequestAfterCreate.js.map +1 -1
  122. package/plugins/hooks/notifications/changeRequestUrl.js +3 -1
  123. package/plugins/hooks/notifications/changeRequestUrl.js.map +1 -1
  124. package/plugins/hooks/notifications/commentAfterCreate.d.ts +1 -1
  125. package/plugins/hooks/notifications/commentAfterCreate.js +8 -11
  126. package/plugins/hooks/notifications/commentAfterCreate.js.map +1 -1
  127. package/plugins/hooks/notifications/commentUrl.js +3 -1
  128. package/plugins/hooks/notifications/commentUrl.js.map +1 -1
  129. package/plugins/hooks/notifications/contentReviewAfterCreate.d.ts +1 -1
  130. package/plugins/hooks/notifications/contentReviewAfterCreate.js +9 -12
  131. package/plugins/hooks/notifications/contentReviewAfterCreate.js.map +1 -1
  132. package/plugins/hooks/notifications/contentReviewUrl.js +3 -1
  133. package/plugins/hooks/notifications/contentReviewUrl.js.map +1 -1
  134. package/plugins/hooks/notifications/contentUrl.d.ts +2 -2
  135. package/plugins/hooks/notifications/contentUrl.js +3 -1
  136. package/plugins/hooks/notifications/contentUrl.js.map +1 -1
  137. package/plugins/hooks/notifications/getAppUrl.d.ts +2 -0
  138. package/plugins/hooks/notifications/getAppUrl.js +19 -0
  139. package/plugins/hooks/notifications/getAppUrl.js.map +1 -0
  140. package/plugins/hooks/notifications/lastChangeRequestNotificationPlugin.d.ts +1 -1
  141. package/plugins/hooks/notifications/lastChangeRequestNotificationPlugin.js +3 -1
  142. package/plugins/hooks/notifications/lastChangeRequestNotificationPlugin.js.map +1 -1
  143. package/plugins/hooks/notifications/lastCommentNotificationPlugin.d.ts +1 -1
  144. package/plugins/hooks/notifications/lastCommentNotificationPlugin.js +3 -1
  145. package/plugins/hooks/notifications/lastCommentNotificationPlugin.js.map +1 -1
  146. package/plugins/hooks/notifications/lastContentReviewNotificationPlugin.d.ts +1 -1
  147. package/plugins/hooks/notifications/lastContentReviewNotificationPlugin.js +3 -1
  148. package/plugins/hooks/notifications/lastContentReviewNotificationPlugin.js.map +1 -1
  149. package/plugins/hooks/notifications/reviewers.d.ts +1 -1
  150. package/plugins/hooks/notifications/reviewers.js +18 -15
  151. package/plugins/hooks/notifications/reviewers.js.map +1 -1
  152. package/plugins/hooks/notifications/sendChangeRequestNotification.d.ts +1 -1
  153. package/plugins/hooks/notifications/sendChangeRequestNotification.js +3 -1
  154. package/plugins/hooks/notifications/sendChangeRequestNotification.js.map +1 -1
  155. package/plugins/hooks/notifications/sendCommentNotification.d.ts +1 -1
  156. package/plugins/hooks/notifications/sendCommentNotification.js +3 -1
  157. package/plugins/hooks/notifications/sendCommentNotification.js.map +1 -1
  158. package/plugins/hooks/notifications/sendContentReviewNotification.d.ts +1 -1
  159. package/plugins/hooks/notifications/sendContentReviewNotification.js +3 -1
  160. package/plugins/hooks/notifications/sendContentReviewNotification.js.map +1 -1
  161. package/plugins/hooks/updatePendingChangeRequests.d.ts +1 -1
  162. package/plugins/hooks/updatePendingChangeRequests.js +8 -6
  163. package/plugins/hooks/updatePendingChangeRequests.js.map +1 -1
  164. package/plugins/hooks/updateTotalComments.d.ts +1 -1
  165. package/plugins/hooks/updateTotalComments.js +22 -15
  166. package/plugins/hooks/updateTotalComments.js.map +1 -1
  167. package/plugins/hooks/validateChangeRequest.d.ts +1 -1
  168. package/plugins/hooks/validateChangeRequest.js +3 -1
  169. package/plugins/hooks/validateChangeRequest.js.map +1 -1
  170. package/plugins/hooks/validateComment.d.ts +1 -1
  171. package/plugins/hooks/validateComment.js +3 -1
  172. package/plugins/hooks/validateComment.js.map +1 -1
  173. package/plugins/hooks/validateContentReview.d.ts +1 -1
  174. package/plugins/hooks/validateContentReview.js +3 -1
  175. package/plugins/hooks/validateContentReview.js.map +1 -1
  176. package/plugins/pageBuilder/PageApwSettingsGetterPlugin.d.ts +2 -1
  177. package/plugins/pageBuilder/PageApwSettingsGetterPlugin.js +5 -5
  178. package/plugins/pageBuilder/PageApwSettingsGetterPlugin.js.map +1 -1
  179. package/plugins/pageBuilder/apwContentPagePlugins.d.ts +1 -1
  180. package/plugins/pageBuilder/apwContentPagePlugins.js +3 -1
  181. package/plugins/pageBuilder/apwContentPagePlugins.js.map +1 -1
  182. package/plugins/pageBuilder/extendPbPageSettingsSchema.d.ts +1 -1
  183. package/plugins/pageBuilder/extendPbPageSettingsSchema.js +3 -1
  184. package/plugins/pageBuilder/extendPbPageSettingsSchema.js.map +1 -1
  185. package/plugins/pageBuilder/index.d.ts +4 -4
  186. package/plugins/pageBuilder/index.js +3 -1
  187. package/plugins/pageBuilder/index.js.map +1 -1
  188. package/plugins/pageBuilder/linkContentReviewToPage.d.ts +2 -2
  189. package/plugins/pageBuilder/linkContentReviewToPage.js +16 -12
  190. package/plugins/pageBuilder/linkContentReviewToPage.js.map +1 -1
  191. package/plugins/pageBuilder/linkWorkflowToPage.d.ts +2 -2
  192. package/plugins/pageBuilder/linkWorkflowToPage.js +13 -12
  193. package/plugins/pageBuilder/linkWorkflowToPage.js.map +1 -1
  194. package/plugins/pageBuilder/notifications/changeRequestNotification.js +3 -1
  195. package/plugins/pageBuilder/notifications/changeRequestNotification.js.map +1 -1
  196. package/plugins/pageBuilder/notifications/commentNotification.js +3 -1
  197. package/plugins/pageBuilder/notifications/commentNotification.js.map +1 -1
  198. package/plugins/pageBuilder/notifications/contentReviewNotification.js +3 -1
  199. package/plugins/pageBuilder/notifications/contentReviewNotification.js.map +1 -1
  200. package/plugins/pageBuilder/notifications/contentUrl.js +3 -1
  201. package/plugins/pageBuilder/notifications/contentUrl.js.map +1 -1
  202. package/plugins/pageBuilder/triggerContentReview.d.ts +2 -2
  203. package/plugins/pageBuilder/triggerContentReview.js +5 -4
  204. package/plugins/pageBuilder/triggerContentReview.js.map +1 -1
  205. package/plugins/pageBuilder/updateContentReviewStatus.d.ts +3 -3
  206. package/plugins/pageBuilder/updateContentReviewStatus.js +13 -10
  207. package/plugins/pageBuilder/updateContentReviewStatus.js.map +1 -1
  208. package/plugins/pageBuilder/utils.d.ts +4 -4
  209. package/plugins/pageBuilder/utils.js +7 -6
  210. package/plugins/pageBuilder/utils.js.map +1 -1
  211. package/plugins/utils.d.ts +7 -6
  212. package/plugins/utils.js +12 -8
  213. package/plugins/utils.js.map +1 -1
  214. package/scheduler/createScheduleActionMethods.d.ts +1 -1
  215. package/scheduler/createScheduleActionMethods.js +105 -66
  216. package/scheduler/createScheduleActionMethods.js.map +1 -1
  217. package/scheduler/handlers/executeAction/index.d.ts +2 -2
  218. package/scheduler/handlers/executeAction/index.js +5 -5
  219. package/scheduler/handlers/executeAction/index.js.map +1 -1
  220. package/scheduler/handlers/executeAction/plugins/ApplicationGraphQL.js +5 -4
  221. package/scheduler/handlers/executeAction/plugins/ApplicationGraphQL.js.map +1 -1
  222. package/scheduler/handlers/executeAction/plugins/HeadlessCMSGraphQL.d.ts +2 -1
  223. package/scheduler/handlers/executeAction/plugins/HeadlessCMSGraphQL.js +6 -7
  224. package/scheduler/handlers/executeAction/plugins/HeadlessCMSGraphQL.js.map +1 -1
  225. package/scheduler/handlers/executeAction/plugins/PageBuilderGraphQL.d.ts +3 -2
  226. package/scheduler/handlers/executeAction/plugins/PageBuilderGraphQL.js +4 -7
  227. package/scheduler/handlers/executeAction/plugins/PageBuilderGraphQL.js.map +1 -1
  228. package/scheduler/handlers/executeAction/security.d.ts +2 -2
  229. package/scheduler/handlers/executeAction/security.js +3 -1
  230. package/scheduler/handlers/executeAction/security.js.map +1 -1
  231. package/scheduler/handlers/scheduleAction/index.d.ts +2 -2
  232. package/scheduler/handlers/scheduleAction/index.js +15 -14
  233. package/scheduler/handlers/scheduleAction/index.js.map +1 -1
  234. package/scheduler/handlers/scheduleAction/scheduleAction.utils.d.ts +3 -3
  235. package/scheduler/handlers/scheduleAction/scheduleAction.utils.js +17 -14
  236. package/scheduler/handlers/scheduleAction/scheduleAction.utils.js.map +1 -1
  237. package/scheduler/handlers/utils.d.ts +2 -3
  238. package/scheduler/handlers/utils.js +20 -13
  239. package/scheduler/handlers/utils.js.map +1 -1
  240. package/scheduler/index.d.ts +1 -1
  241. package/scheduler/index.js +3 -1
  242. package/scheduler/index.js.map +1 -1
  243. package/scheduler/types.d.ts +19 -17
  244. package/scheduler/types.js +11 -12
  245. package/scheduler/types.js.map +1 -1
  246. package/storageOperations/changeRequestStorageOperations.d.ts +2 -2
  247. package/storageOperations/changeRequestStorageOperations.js +44 -23
  248. package/storageOperations/changeRequestStorageOperations.js.map +1 -1
  249. package/storageOperations/commentStorageOperations.d.ts +3 -3
  250. package/storageOperations/commentStorageOperations.js +17 -24
  251. package/storageOperations/commentStorageOperations.js.map +1 -1
  252. package/storageOperations/contentReviewStorageOperations.d.ts +3 -3
  253. package/storageOperations/contentReviewStorageOperations.js +20 -25
  254. package/storageOperations/contentReviewStorageOperations.js.map +1 -1
  255. package/storageOperations/index.d.ts +3 -9
  256. package/storageOperations/index.js +11 -16
  257. package/storageOperations/index.js.map +1 -1
  258. package/storageOperations/models/changeRequest.model.d.ts +1 -2
  259. package/storageOperations/models/changeRequest.model.js +10 -11
  260. package/storageOperations/models/changeRequest.model.js.map +1 -1
  261. package/storageOperations/models/comment.model.d.ts +1 -2
  262. package/storageOperations/models/comment.model.js +10 -11
  263. package/storageOperations/models/comment.model.js.map +1 -1
  264. package/storageOperations/models/contentReview.model.d.ts +1 -2
  265. package/storageOperations/models/contentReview.model.js +16 -15
  266. package/storageOperations/models/contentReview.model.js.map +1 -1
  267. package/storageOperations/models/index.d.ts +1 -1
  268. package/storageOperations/models/index.js +11 -31
  269. package/storageOperations/models/index.js.map +1 -1
  270. package/storageOperations/models/reviewer.model.d.ts +1 -2
  271. package/storageOperations/models/reviewer.model.js +11 -12
  272. package/storageOperations/models/reviewer.model.js.map +1 -1
  273. package/storageOperations/models/utils.d.ts +2 -2
  274. package/storageOperations/models/utils.js +3 -1
  275. package/storageOperations/models/utils.js.map +1 -1
  276. package/storageOperations/models/workflow.model.d.ts +2 -3
  277. package/storageOperations/models/workflow.model.js +22 -23
  278. package/storageOperations/models/workflow.model.js.map +1 -1
  279. package/storageOperations/reviewerStorageOperations.d.ts +3 -3
  280. package/storageOperations/reviewerStorageOperations.js +24 -34
  281. package/storageOperations/reviewerStorageOperations.js.map +1 -1
  282. package/storageOperations/types.d.ts +2 -2
  283. package/storageOperations/types.js +3 -1
  284. package/storageOperations/types.js.map +1 -1
  285. package/storageOperations/workflowStorageOperations.d.ts +2 -2
  286. package/storageOperations/workflowStorageOperations.js +25 -28
  287. package/storageOperations/workflowStorageOperations.js.map +1 -1
  288. package/types.d.ts +51 -52
  289. package/types.js +121 -29
  290. package/types.js.map +1 -1
  291. package/utils/contentApwSettingsPlugin.d.ts +2 -2
  292. package/utils/contentApwSettingsPlugin.js +3 -1
  293. package/utils/contentApwSettingsPlugin.js.map +1 -1
  294. package/utils/errors.js +3 -1
  295. package/utils/errors.js.map +1 -1
  296. package/utils/fieldResolver.d.ts +2 -2
  297. package/utils/fieldResolver.js +7 -7
  298. package/utils/fieldResolver.js.map +1 -1
  299. package/utils/pickEntryFieldValues.d.ts +3 -0
  300. package/utils/pickEntryFieldValues.js +30 -0
  301. package/utils/pickEntryFieldValues.js.map +1 -0
  302. package/utils/resolve.d.ts +1 -1
  303. package/utils/resolve.js +3 -1
  304. package/utils/resolve.js.map +1 -1
  305. package/plugins/hooks/notifications/appUrl.d.ts +0 -2
  306. package/plugins/hooks/notifications/appUrl.js +0 -18
  307. package/plugins/hooks/notifications/appUrl.js.map +0 -1
  308. package/storageOperations/models/contentModelPluginFactory.d.ts +0 -11
  309. package/storageOperations/models/contentModelPluginFactory.js +0 -19
  310. package/storageOperations/models/contentModelPluginFactory.js.map +0 -1
@@ -1,5 +1,5 @@
1
1
  import { Plugin } from "@webiny/plugins";
2
- import { ApwChangeRequest, ApwContentReview, ApwContentTypes, ApwContext, ApwReviewerWithEmail, ApwWorkflow } from "./types";
2
+ import type { ApwChangeRequest, ApwContentReview, ApwContentTypes, ApwContext, ApwReviewerWithEmail, ApwWorkflow } from "./types";
3
3
  export interface ApwChangeRequestNotificationCbParams {
4
4
  context: ApwContext;
5
5
  reviewers: ApwReviewerWithEmail[];
@@ -1,17 +1,14 @@
1
1
  "use strict";
2
2
 
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
4
3
  Object.defineProperty(exports, "__esModule", {
5
4
  value: true
6
5
  });
7
6
  exports.createApwChangeRequestNotification = exports.ApwChangeRequestNotification = void 0;
8
- var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
9
7
  var _plugins = require("@webiny/plugins");
10
8
  class ApwChangeRequestNotification extends _plugins.Plugin {
9
+ static type = "apw.notification.changeRequest";
11
10
  constructor(contentType, cb) {
12
11
  super();
13
- (0, _defineProperty2.default)(this, "contentType", void 0);
14
- (0, _defineProperty2.default)(this, "cb", void 0);
15
12
  this.contentType = contentType;
16
13
  this.cb = cb;
17
14
  }
@@ -23,8 +20,9 @@ class ApwChangeRequestNotification extends _plugins.Plugin {
23
20
  }
24
21
  }
25
22
  exports.ApwChangeRequestNotification = ApwChangeRequestNotification;
26
- (0, _defineProperty2.default)(ApwChangeRequestNotification, "type", "apw.notification.changeRequest");
27
23
  const createApwChangeRequestNotification = (contentType, cb) => {
28
24
  return new ApwChangeRequestNotification(contentType, cb);
29
25
  };
30
- exports.createApwChangeRequestNotification = createApwChangeRequestNotification;
26
+ exports.createApwChangeRequestNotification = createApwChangeRequestNotification;
27
+
28
+ //# sourceMappingURL=ApwChangeRequestNotification.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["ApwChangeRequestNotification","Plugin","constructor","contentType","cb","canUse","create","params","createApwChangeRequestNotification"],"sources":["ApwChangeRequestNotification.ts"],"sourcesContent":["import { Plugin } from \"@webiny/plugins\";\nimport {\n ApwChangeRequest,\n ApwContentReview,\n ApwContentTypes,\n ApwContext,\n ApwReviewerWithEmail,\n ApwWorkflow\n} from \"~/types\";\n\nexport interface ApwChangeRequestNotificationCbParams {\n context: ApwContext;\n reviewers: ApwReviewerWithEmail[];\n changeRequestUrl: string;\n contentUrl: string;\n changeRequest: ApwChangeRequest;\n contentReview: ApwContentReview;\n workflow: ApwWorkflow;\n}\nexport interface ApwChangeRequestNotificationCbParamsResponse {\n text: string;\n html?: string;\n}\nexport interface ApwChangeRequestNotificationCb {\n (params: ApwChangeRequestNotificationCbParams):\n | ApwChangeRequestNotificationCbParamsResponse\n | null\n | undefined;\n}\nexport class ApwChangeRequestNotification extends Plugin {\n public static override readonly type: string = \"apw.notification.changeRequest\";\n\n private readonly contentType: ApwContentTypes;\n private readonly cb: ApwChangeRequestNotificationCb;\n\n public constructor(contentType: ApwContentTypes, cb: ApwChangeRequestNotificationCb) {\n super();\n this.contentType = contentType;\n this.cb = cb;\n }\n\n public canUse(contentType: ApwContentTypes): boolean {\n return contentType === this.contentType;\n }\n\n public create(params: ApwChangeRequestNotificationCbParams) {\n return this.cb(params);\n }\n}\n\nexport const createApwChangeRequestNotification = (\n contentType: ApwContentTypes,\n cb: ApwChangeRequestNotificationCb\n) => {\n return new ApwChangeRequestNotification(contentType, cb);\n};\n"],"mappings":";;;;;;;;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 type {\n ApwChangeRequest,\n ApwContentReview,\n ApwContentTypes,\n ApwContext,\n ApwReviewerWithEmail,\n ApwWorkflow\n} from \"~/types\";\n\nexport interface ApwChangeRequestNotificationCbParams {\n context: ApwContext;\n reviewers: ApwReviewerWithEmail[];\n changeRequestUrl: string;\n contentUrl: string;\n changeRequest: ApwChangeRequest;\n contentReview: ApwContentReview;\n workflow: ApwWorkflow;\n}\nexport interface ApwChangeRequestNotificationCbParamsResponse {\n text: string;\n html?: string;\n}\nexport interface ApwChangeRequestNotificationCb {\n (params: ApwChangeRequestNotificationCbParams):\n | ApwChangeRequestNotificationCbParamsResponse\n | null\n | undefined;\n}\nexport class ApwChangeRequestNotification extends Plugin {\n public static override readonly type: string = \"apw.notification.changeRequest\";\n\n private readonly contentType: ApwContentTypes;\n private readonly cb: ApwChangeRequestNotificationCb;\n\n public constructor(contentType: ApwContentTypes, cb: ApwChangeRequestNotificationCb) {\n super();\n this.contentType = contentType;\n this.cb = cb;\n }\n\n public canUse(contentType: ApwContentTypes): boolean {\n return contentType === this.contentType;\n }\n\n public create(params: ApwChangeRequestNotificationCbParams) {\n return this.cb(params);\n }\n}\n\nexport const createApwChangeRequestNotification = (\n contentType: ApwContentTypes,\n cb: ApwChangeRequestNotificationCb\n) => {\n return new ApwChangeRequestNotification(contentType, cb);\n};\n"],"mappings":";;;;;;AAAA,IAAAA,QAAA,GAAAC,OAAA;AA6BO,MAAMC,4BAA4B,SAASC,eAAM,CAAC;EACrD,OAAgCC,IAAI,GAAW,gCAAgC;EAKxEC,WAAWA,CAACC,WAA4B,EAAEC,EAAkC,EAAE;IACjF,KAAK,CAAC,CAAC;IACP,IAAI,CAACD,WAAW,GAAGA,WAAW;IAC9B,IAAI,CAACC,EAAE,GAAGA,EAAE;EAChB;EAEOC,MAAMA,CAACF,WAA4B,EAAW;IACjD,OAAOA,WAAW,KAAK,IAAI,CAACA,WAAW;EAC3C;EAEOG,MAAMA,CAACC,MAA4C,EAAE;IACxD,OAAO,IAAI,CAACH,EAAE,CAACG,MAAM,CAAC;EAC1B;AACJ;AAACC,OAAA,CAAAT,4BAAA,GAAAA,4BAAA;AAEM,MAAMU,kCAAkC,GAAGA,CAC9CN,WAA4B,EAC5BC,EAAkC,KACjC;EACD,OAAO,IAAIL,4BAA4B,CAACI,WAAW,EAAEC,EAAE,CAAC;AAC5D,CAAC;AAACI,OAAA,CAAAC,kCAAA,GAAAA,kCAAA","ignoreList":[]}
@@ -1,5 +1,5 @@
1
1
  import { Plugin } from "@webiny/plugins";
2
- import { ApwChangeRequest, ApwContentReview, ApwContentTypes, ApwContext, ApwReviewerWithEmail, ApwWorkflow } from "./types";
2
+ import type { ApwChangeRequest, ApwContentReview, ApwContentTypes, ApwContext, ApwReviewerWithEmail, ApwWorkflow } from "./types";
3
3
  export interface ApwCommentNotificationCbParams {
4
4
  context: ApwContext;
5
5
  reviewers: ApwReviewerWithEmail[];
@@ -1,17 +1,14 @@
1
1
  "use strict";
2
2
 
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
4
3
  Object.defineProperty(exports, "__esModule", {
5
4
  value: true
6
5
  });
7
6
  exports.createApwCommentNotification = exports.ApwCommentNotification = void 0;
8
- var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
9
7
  var _plugins = require("@webiny/plugins");
10
8
  class ApwCommentNotification extends _plugins.Plugin {
9
+ static type = "apw.notification.comment";
11
10
  constructor(contentType, cb) {
12
11
  super();
13
- (0, _defineProperty2.default)(this, "contentType", void 0);
14
- (0, _defineProperty2.default)(this, "cb", void 0);
15
12
  this.contentType = contentType;
16
13
  this.cb = cb;
17
14
  }
@@ -23,8 +20,9 @@ class ApwCommentNotification extends _plugins.Plugin {
23
20
  }
24
21
  }
25
22
  exports.ApwCommentNotification = ApwCommentNotification;
26
- (0, _defineProperty2.default)(ApwCommentNotification, "type", "apw.notification.comment");
27
23
  const createApwCommentNotification = (contentType, cb) => {
28
24
  return new ApwCommentNotification(contentType, cb);
29
25
  };
30
- exports.createApwCommentNotification = createApwCommentNotification;
26
+ exports.createApwCommentNotification = createApwCommentNotification;
27
+
28
+ //# sourceMappingURL=ApwCommentNotification.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["ApwCommentNotification","Plugin","constructor","contentType","cb","canUse","create","params","createApwCommentNotification"],"sources":["ApwCommentNotification.ts"],"sourcesContent":["import { Plugin } from \"@webiny/plugins\";\nimport {\n ApwChangeRequest,\n ApwContentReview,\n ApwContentTypes,\n ApwContext,\n ApwReviewerWithEmail,\n ApwWorkflow\n} from \"~/types\";\n\nexport interface ApwCommentNotificationCbParams {\n context: ApwContext;\n reviewers: ApwReviewerWithEmail[];\n commentUrl: string;\n contentUrl: string;\n changeRequest: ApwChangeRequest;\n contentReview: ApwContentReview;\n workflow: ApwWorkflow;\n}\nexport interface ApwCommentNotificationCbParamsResponse {\n text: string;\n html?: string;\n}\nexport interface ApwCommentNotificationCb {\n (params: ApwCommentNotificationCbParams):\n | ApwCommentNotificationCbParamsResponse\n | null\n | undefined;\n}\nexport class ApwCommentNotification extends Plugin {\n public static override readonly type: string = \"apw.notification.comment\";\n\n private readonly contentType: ApwContentTypes;\n private readonly cb: ApwCommentNotificationCb;\n\n public constructor(contentType: ApwContentTypes, cb: ApwCommentNotificationCb) {\n super();\n this.contentType = contentType;\n this.cb = cb;\n }\n\n public canUse(contentType: ApwContentTypes): boolean {\n return contentType === this.contentType;\n }\n\n public create(params: ApwCommentNotificationCbParams) {\n return this.cb(params);\n }\n}\n\nexport const createApwCommentNotification = (\n contentType: ApwContentTypes,\n cb: ApwCommentNotificationCb\n) => {\n return new ApwCommentNotification(contentType, cb);\n};\n"],"mappings":";;;;;;;;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 type {\n ApwChangeRequest,\n ApwContentReview,\n ApwContentTypes,\n ApwContext,\n ApwReviewerWithEmail,\n ApwWorkflow\n} from \"~/types\";\n\nexport interface ApwCommentNotificationCbParams {\n context: ApwContext;\n reviewers: ApwReviewerWithEmail[];\n commentUrl: string;\n contentUrl: string;\n changeRequest: ApwChangeRequest;\n contentReview: ApwContentReview;\n workflow: ApwWorkflow;\n}\nexport interface ApwCommentNotificationCbParamsResponse {\n text: string;\n html?: string;\n}\nexport interface ApwCommentNotificationCb {\n (params: ApwCommentNotificationCbParams):\n | ApwCommentNotificationCbParamsResponse\n | null\n | undefined;\n}\nexport class ApwCommentNotification extends Plugin {\n public static override readonly type: string = \"apw.notification.comment\";\n\n private readonly contentType: ApwContentTypes;\n private readonly cb: ApwCommentNotificationCb;\n\n public constructor(contentType: ApwContentTypes, cb: ApwCommentNotificationCb) {\n super();\n this.contentType = contentType;\n this.cb = cb;\n }\n\n public canUse(contentType: ApwContentTypes): boolean {\n return contentType === this.contentType;\n }\n\n public create(params: ApwCommentNotificationCbParams) {\n return this.cb(params);\n }\n}\n\nexport const createApwCommentNotification = (\n contentType: ApwContentTypes,\n cb: ApwCommentNotificationCb\n) => {\n return new ApwCommentNotification(contentType, cb);\n};\n"],"mappings":";;;;;;AAAA,IAAAA,QAAA,GAAAC,OAAA;AA6BO,MAAMC,sBAAsB,SAASC,eAAM,CAAC;EAC/C,OAAgCC,IAAI,GAAW,0BAA0B;EAKlEC,WAAWA,CAACC,WAA4B,EAAEC,EAA4B,EAAE;IAC3E,KAAK,CAAC,CAAC;IACP,IAAI,CAACD,WAAW,GAAGA,WAAW;IAC9B,IAAI,CAACC,EAAE,GAAGA,EAAE;EAChB;EAEOC,MAAMA,CAACF,WAA4B,EAAW;IACjD,OAAOA,WAAW,KAAK,IAAI,CAACA,WAAW;EAC3C;EAEOG,MAAMA,CAACC,MAAsC,EAAE;IAClD,OAAO,IAAI,CAACH,EAAE,CAACG,MAAM,CAAC;EAC1B;AACJ;AAACC,OAAA,CAAAT,sBAAA,GAAAA,sBAAA;AAEM,MAAMU,4BAA4B,GAAGA,CACxCN,WAA4B,EAC5BC,EAA4B,KAC3B;EACD,OAAO,IAAIL,sBAAsB,CAACI,WAAW,EAAEC,EAAE,CAAC;AACtD,CAAC;AAACI,OAAA,CAAAC,4BAAA,GAAAA,4BAAA","ignoreList":[]}
@@ -1,5 +1,5 @@
1
1
  import { Plugin } from "@webiny/plugins";
2
- import { ApwContentReview, ApwContentTypes, ApwContext, ApwReviewerWithEmail, ApwWorkflow } from "./types";
2
+ import type { ApwContentReview, ApwContentTypes, ApwContext, ApwReviewerWithEmail, ApwWorkflow } from "./types";
3
3
  export interface ApwContentReviewNotificationCbParams {
4
4
  context: ApwContext;
5
5
  reviewers: ApwReviewerWithEmail[];
@@ -1,17 +1,14 @@
1
1
  "use strict";
2
2
 
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
4
3
  Object.defineProperty(exports, "__esModule", {
5
4
  value: true
6
5
  });
7
6
  exports.createApwContentReviewNotification = exports.ApwContentReviewNotification = void 0;
8
- var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
9
7
  var _plugins = require("@webiny/plugins");
10
8
  class ApwContentReviewNotification extends _plugins.Plugin {
9
+ static type = "apw.notification.contentReview";
11
10
  constructor(contentType, cb) {
12
11
  super();
13
- (0, _defineProperty2.default)(this, "contentType", void 0);
14
- (0, _defineProperty2.default)(this, "cb", void 0);
15
12
  this.contentType = contentType;
16
13
  this.cb = cb;
17
14
  }
@@ -23,8 +20,9 @@ class ApwContentReviewNotification extends _plugins.Plugin {
23
20
  }
24
21
  }
25
22
  exports.ApwContentReviewNotification = ApwContentReviewNotification;
26
- (0, _defineProperty2.default)(ApwContentReviewNotification, "type", "apw.notification.contentReview");
27
23
  const createApwContentReviewNotification = (contentType, cb) => {
28
24
  return new ApwContentReviewNotification(contentType, cb);
29
25
  };
30
- exports.createApwContentReviewNotification = createApwContentReviewNotification;
26
+ exports.createApwContentReviewNotification = createApwContentReviewNotification;
27
+
28
+ //# sourceMappingURL=ApwContentReviewNotification.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["ApwContentReviewNotification","Plugin","constructor","contentType","cb","canUse","create","params","createApwContentReviewNotification"],"sources":["ApwContentReviewNotification.ts"],"sourcesContent":["import { Plugin } from \"@webiny/plugins\";\nimport {\n ApwContentReview,\n ApwContentTypes,\n ApwContext,\n ApwReviewerWithEmail,\n ApwWorkflow\n} from \"~/types\";\n\nexport interface ApwContentReviewNotificationCbParams {\n context: ApwContext;\n reviewers: ApwReviewerWithEmail[];\n contentReviewUrl: string;\n contentUrl: string;\n contentReview: ApwContentReview;\n workflow: ApwWorkflow;\n}\nexport interface ApwContentReviewNotificationCbParamsResponse {\n text: string;\n html?: string;\n}\nexport interface ApwContentReviewNotificationCb {\n (params: ApwContentReviewNotificationCbParams):\n | ApwContentReviewNotificationCbParamsResponse\n | null\n | undefined;\n}\nexport class ApwContentReviewNotification extends Plugin {\n public static override readonly type: string = \"apw.notification.contentReview\";\n\n private readonly contentType: ApwContentTypes;\n private readonly cb: ApwContentReviewNotificationCb;\n\n public constructor(contentType: ApwContentTypes, cb: ApwContentReviewNotificationCb) {\n super();\n this.contentType = contentType;\n this.cb = cb;\n }\n\n public canUse(contentType: ApwContentTypes): boolean {\n return contentType === this.contentType;\n }\n\n public create(params: ApwContentReviewNotificationCbParams) {\n return this.cb(params);\n }\n}\n\nexport const createApwContentReviewNotification = (\n contentType: ApwContentTypes,\n cb: ApwContentReviewNotificationCb\n) => {\n return new ApwContentReviewNotification(contentType, cb);\n};\n"],"mappings":";;;;;;;;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 type {\n ApwContentReview,\n ApwContentTypes,\n ApwContext,\n ApwReviewerWithEmail,\n ApwWorkflow\n} from \"~/types\";\n\nexport interface ApwContentReviewNotificationCbParams {\n context: ApwContext;\n reviewers: ApwReviewerWithEmail[];\n contentReviewUrl: string;\n contentUrl: string;\n contentReview: ApwContentReview;\n workflow: ApwWorkflow;\n}\nexport interface ApwContentReviewNotificationCbParamsResponse {\n text: string;\n html?: string;\n}\nexport interface ApwContentReviewNotificationCb {\n (params: ApwContentReviewNotificationCbParams):\n | ApwContentReviewNotificationCbParamsResponse\n | null\n | undefined;\n}\nexport class ApwContentReviewNotification extends Plugin {\n public static override readonly type: string = \"apw.notification.contentReview\";\n\n private readonly contentType: ApwContentTypes;\n private readonly cb: ApwContentReviewNotificationCb;\n\n public constructor(contentType: ApwContentTypes, cb: ApwContentReviewNotificationCb) {\n super();\n this.contentType = contentType;\n this.cb = cb;\n }\n\n public canUse(contentType: ApwContentTypes): boolean {\n return contentType === this.contentType;\n }\n\n public create(params: ApwContentReviewNotificationCbParams) {\n return this.cb(params);\n }\n}\n\nexport const createApwContentReviewNotification = (\n contentType: ApwContentTypes,\n cb: ApwContentReviewNotificationCb\n) => {\n return new ApwContentReviewNotification(contentType, cb);\n};\n"],"mappings":";;;;;;AAAA,IAAAA,QAAA,GAAAC,OAAA;AA2BO,MAAMC,4BAA4B,SAASC,eAAM,CAAC;EACrD,OAAgCC,IAAI,GAAW,gCAAgC;EAKxEC,WAAWA,CAACC,WAA4B,EAAEC,EAAkC,EAAE;IACjF,KAAK,CAAC,CAAC;IACP,IAAI,CAACD,WAAW,GAAGA,WAAW;IAC9B,IAAI,CAACC,EAAE,GAAGA,EAAE;EAChB;EAEOC,MAAMA,CAACF,WAA4B,EAAW;IACjD,OAAOA,WAAW,KAAK,IAAI,CAACA,WAAW;EAC3C;EAEOG,MAAMA,CAACC,MAA4C,EAAE;IACxD,OAAO,IAAI,CAACH,EAAE,CAACG,MAAM,CAAC;EAC1B;AACJ;AAACC,OAAA,CAAAT,4BAAA,GAAAA,4BAAA;AAEM,MAAMU,kCAAkC,GAAGA,CAC9CN,WAA4B,EAC5BC,EAAkC,KACjC;EACD,OAAO,IAAIL,4BAA4B,CAACI,WAAW,EAAEC,EAAE,CAAC;AAC5D,CAAC;AAACI,OAAA,CAAAC,kCAAA,GAAAA,kCAAA","ignoreList":[]}
@@ -1,5 +1,5 @@
1
1
  import { Plugin } from "@webiny/plugins";
2
- import { ApwContentReview, ApwContentTypes, ApwWorkflow } from "./types";
2
+ import type { ApwContentReview, ApwContentTypes, ApwWorkflow } from "./types";
3
3
  export interface ApwContentUrlPluginCbParams {
4
4
  baseUrl: string;
5
5
  contentReview: ApwContentReview;
@@ -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 type { ApwContentReview, ApwContentTypes, ApwWorkflow } from \"~/types\";\n\nexport interface ApwContentUrlPluginCbParams {\n baseUrl: string;\n contentReview: ApwContentReview;\n workflow: ApwWorkflow;\n}\nexport interface ApwContentUrlPluginCb {\n (params: ApwContentUrlPluginCbParams): string | null;\n}\n\nexport class ApwContentUrlPlugin extends Plugin {\n public static override type = \"apw.contentUrl\";\n\n private readonly cb: ApwContentUrlPluginCb;\n private readonly contentType: ApwContentTypes;\n\n public constructor(contentType: ApwContentTypes, cb: ApwContentUrlPluginCb) {\n super();\n\n this.contentType = contentType;\n this.cb = cb;\n }\n\n public canUse(contentType: ApwContentTypes): boolean {\n return this.contentType === contentType;\n }\n\n public create(params: ApwContentUrlPluginCbParams): string | null {\n return this.cb(params);\n }\n}\n\nexport const createApwContentUrlPlugin = (\n contentType: ApwContentTypes,\n cb: ApwContentUrlPluginCb\n) => {\n return new ApwContentUrlPlugin(contentType, cb);\n};\n"],"mappings":";;;;;;AAAA,IAAAA,QAAA,GAAAC,OAAA;AAYO,MAAMC,mBAAmB,SAASC,eAAM,CAAC;EAC5C,OAAuBC,IAAI,GAAG,gBAAgB;EAKvCC,WAAWA,CAACC,WAA4B,EAAEC,EAAyB,EAAE;IACxE,KAAK,CAAC,CAAC;IAEP,IAAI,CAACD,WAAW,GAAGA,WAAW;IAC9B,IAAI,CAACC,EAAE,GAAGA,EAAE;EAChB;EAEOC,MAAMA,CAACF,WAA4B,EAAW;IACjD,OAAO,IAAI,CAACA,WAAW,KAAKA,WAAW;EAC3C;EAEOG,MAAMA,CAACC,MAAmC,EAAiB;IAC9D,OAAO,IAAI,CAACH,EAAE,CAACG,MAAM,CAAC;EAC1B;AACJ;AAACC,OAAA,CAAAT,mBAAA,GAAAA,mBAAA;AAEM,MAAMU,yBAAyB,GAAGA,CACrCN,WAA4B,EAC5BC,EAAyB,KACxB;EACD,OAAO,IAAIL,mBAAmB,CAACI,WAAW,EAAEC,EAAE,CAAC;AACnD,CAAC;AAACI,OAAA,CAAAC,yBAAA,GAAAA,yBAAA","ignoreList":[]}
@@ -1,5 +1,5 @@
1
1
  import { Plugin } from "@webiny/plugins/Plugin";
2
- import { ApwContentTypes } from "./types";
2
+ import type { ApwContentTypes } from "./types";
3
3
  export declare abstract class ContentApwSettingsPlugin extends Plugin {
4
4
  static type: string;
5
5
  abstract canUse(type: ApwContentTypes): boolean;
@@ -1,12 +1,13 @@
1
1
  "use strict";
2
2
 
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
4
3
  Object.defineProperty(exports, "__esModule", {
5
4
  value: true
6
5
  });
7
6
  exports.ContentApwSettingsPlugin = void 0;
8
- var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
9
7
  var _Plugin = require("@webiny/plugins/Plugin");
10
- class ContentApwSettingsPlugin extends _Plugin.Plugin {}
8
+ class ContentApwSettingsPlugin extends _Plugin.Plugin {
9
+ static type = "apw.contentApwSettings";
10
+ }
11
11
  exports.ContentApwSettingsPlugin = ContentApwSettingsPlugin;
12
- (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 type { ApwContentTypes } from \"~/types\";\n\nexport abstract class ContentApwSettingsPlugin extends Plugin {\n public static override type = \"apw.contentApwSettings\";\n\n public abstract canUse(type: ApwContentTypes): boolean;\n\n public abstract setWorkflowId(content: any, id: string | null): void;\n\n public abstract getWorkflowId(content: any): string | null;\n\n public abstract setContentReviewId(content: any, id: string | null): void;\n\n public abstract getContentReviewId(content: any): string | null;\n}\n"],"mappings":";;;;;;AAAA,IAAAA,OAAA,GAAAC,OAAA;AAGO,MAAeC,wBAAwB,SAASC,cAAM,CAAC;EAC1D,OAAuBC,IAAI,GAAG,wBAAwB;AAW1D;AAACC,OAAA,CAAAH,wBAAA,GAAAA,wBAAA","ignoreList":[]}
package/README.md CHANGED
@@ -24,11 +24,11 @@ To run tests api-apw tests with targeted storage operations loaded use:
24
24
  #### DynamoDB
25
25
 
26
26
  ```
27
- yarn test packages/api-apw --keyword=apw:ddb --keyword=apw:base
27
+ yarn test packages/api-apw --storage:ddb --keyword=apw:ddb --keyword=apw:base
28
28
  ```
29
29
 
30
30
  #### Note
31
31
 
32
32
  > All the tests in `@webiny/api-apw` package are being tested against ddb-only storage operations because
33
- current jest setup doesn't allow usage of more than one storage operations at a time with the help of --keyword flag.
34
- We should revisit these tests once we have the ability to load multiple storage operations in the jest setup.
33
+ > current jest setup doesn't allow usage of more than one storage operations at a time with the help of --keyword flag.
34
+ > We should revisit these tests once we have the ability to load multiple storage operations in the jest setup.
@@ -1,2 +1,2 @@
1
- import { ApwChangeRequestCrud, CreateApwParams } from "../types";
1
+ import type { ApwChangeRequestCrud, CreateApwParams } from "../types";
2
2
  export declare function createChangeRequestMethods({ storageOperations }: CreateApwParams): ApwChangeRequestCrud;
@@ -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;MAAG,CAAC,CAAC;IACrD,CAAC;IACD,MAAME,IAAI,CAACC,MAAM,EAAE;MACf,OAAOZ,iBAAiB,CAACa,kBAAkB,CAACD,MAAM,CAAC;IACvD,CAAC;IACD,MAAME,MAAM,CAACC,IAAI,EAAE;MACf,MAAMd,2BAA2B,CAACe,OAAO,CAAC;QAAEC,KAAK,EAAEF;MAAK,CAAC,CAAC;MAE1D,MAAMG,aAAa,GAAG,MAAMlB,iBAAiB,CAACmB,mBAAmB,CAAC;QAAEJ;MAAK,CAAC,CAAC;MAE3E,MAAMZ,0BAA0B,CAACa,OAAO,CAAC;QAAEE;MAAc,CAAC,CAAC;MAE3D,OAAOA,aAAa;IACxB,CAAC;IACD,MAAME,MAAM,CAACX,EAAE,EAAEM,IAAI,EAAE;MACnB,MAAMM,QAAQ,GAAG,MAAMrB,iBAAiB,CAACU,gBAAgB,CAAC;QAAED;MAAG,CAAC,CAAC;MAEjE,MAAML,2BAA2B,CAACY,OAAO,CAAC;QAAEK,QAAQ;QAAEJ,KAAK,EAAE;UAAER,EAAE;UAAEM;QAAK;MAAE,CAAC,CAAC;MAE5E,MAAMG,aAAa,GAAG,MAAMlB,iBAAiB,CAACsB,mBAAmB,CAAC;QAAEb,EAAE;QAAEM;MAAK,CAAC,CAAC;MAE/E,MAAMV,0BAA0B,CAACW,OAAO,CAAC;QACrCK,QAAQ;QACRJ,KAAK,EAAE;UAAER,EAAE;UAAEM;QAAK,CAAC;QACnBG;MACJ,CAAC,CAAC;MAEF,OAAOA,aAAa;IACxB,CAAC;IACD,MAAMK,MAAM,CAACd,EAAU,EAAE;MACrB,MAAMS,aAAa,GAAG,MAAMlB,iBAAiB,CAACU,gBAAgB,CAAC;QAAED;MAAG,CAAC,CAAC;MAEtE,MAAMH,2BAA2B,CAACU,OAAO,CAAC;QAAEE;MAAc,CAAC,CAAC;MAE5D,MAAMlB,iBAAiB,CAACwB,mBAAmB,CAAC;QAAEf;MAAG,CAAC,CAAC;MAEnD,MAAMF,0BAA0B,CAACS,OAAO,CAAC;QAAEE;MAAc,CAAC,CAAC;MAE3D,OAAO,IAAI;IACf,CAAC;IACD;AACR;AACA;IACQjB,2BAA2B;IAC3BE,0BAA0B;IAC1BC,2BAA2B;IAC3BC,0BAA0B;IAC1BC,2BAA2B;IAC3BC;EACJ,CAAC;AACL"}
1
+ {"version":3,"names":["_pubsub","require","createChangeRequestMethods","storageOperations","onChangeRequestBeforeCreate","createTopic","onChangeRequestAfterCreate","onChangeRequestBeforeUpdate","onChangeRequestAfterUpdate","onChangeRequestBeforeDelete","onChangeRequestAfterDelete","get","id","getChangeRequest","list","params","listChangeRequests","create","data","publish","input","changeRequest","createChangeRequest","update","original","updateChangeRequest","delete","deleteChangeRequest"],"sources":["createChangeRequestMethods.ts"],"sourcesContent":["import { createTopic } from \"@webiny/pubsub\";\nimport type {\n ApwChangeRequestCrud,\n CreateApwParams,\n OnChangeRequestAfterCreateTopicParams,\n OnChangeRequestAfterDeleteTopicParams,\n OnChangeRequestAfterUpdateTopicParams,\n OnChangeRequestBeforeCreateTopicParams,\n OnChangeRequestBeforeDeleteTopicParams,\n OnChangeRequestBeforeUpdateTopicParams\n} from \"~/types\";\n\nexport function createChangeRequestMethods({\n storageOperations\n}: CreateApwParams): ApwChangeRequestCrud {\n // create\n const onChangeRequestBeforeCreate = createTopic<OnChangeRequestBeforeCreateTopicParams>(\n \"apw.onChangeRequestBeforeCreate\"\n );\n const onChangeRequestAfterCreate = createTopic<OnChangeRequestAfterCreateTopicParams>(\n \"apw.onChangeRequestAfterCreate\"\n );\n // update\n const onChangeRequestBeforeUpdate = createTopic<OnChangeRequestBeforeUpdateTopicParams>(\n \"apw.onChangeRequestBeforeUpdate\"\n );\n const onChangeRequestAfterUpdate = createTopic<OnChangeRequestAfterUpdateTopicParams>(\n \"apw.onChangeRequestAfterUpdate\"\n );\n // delete\n const onChangeRequestBeforeDelete = createTopic<OnChangeRequestBeforeDeleteTopicParams>(\n \"apw.onChangeRequestBeforeDelete\"\n );\n const onChangeRequestAfterDelete = createTopic<OnChangeRequestAfterDeleteTopicParams>(\n \"apw.onChangeRequestAfterDelete\"\n );\n\n return {\n async get(id) {\n return storageOperations.getChangeRequest({ id });\n },\n async list(params) {\n return storageOperations.listChangeRequests(params);\n },\n async create(data) {\n await onChangeRequestBeforeCreate.publish({ input: data });\n\n const changeRequest = await storageOperations.createChangeRequest({ data });\n\n await onChangeRequestAfterCreate.publish({ changeRequest });\n\n return changeRequest;\n },\n async update(id, data) {\n const original = await storageOperations.getChangeRequest({ id });\n\n await onChangeRequestBeforeUpdate.publish({ original, input: { id, data } });\n\n const changeRequest = await storageOperations.updateChangeRequest({ id, data });\n\n await onChangeRequestAfterUpdate.publish({\n original,\n input: { id, data },\n changeRequest\n });\n\n return changeRequest;\n },\n async delete(id: string) {\n const changeRequest = await storageOperations.getChangeRequest({ id });\n\n await onChangeRequestBeforeDelete.publish({ changeRequest });\n\n await storageOperations.deleteChangeRequest({ id });\n\n await onChangeRequestAfterDelete.publish({ changeRequest });\n\n return true;\n },\n /**\n * Lifecycle events\n */\n onChangeRequestBeforeCreate,\n onChangeRequestAfterCreate,\n onChangeRequestBeforeUpdate,\n onChangeRequestAfterUpdate,\n onChangeRequestBeforeDelete,\n onChangeRequestAfterDelete\n };\n}\n"],"mappings":";;;;;;AAAA,IAAAA,OAAA,GAAAC,OAAA;AAYO,SAASC,0BAA0BA,CAAC;EACvCC;AACa,CAAC,EAAwB;EACtC;EACA,MAAMC,2BAA2B,GAAG,IAAAC,mBAAW,EAC3C,iCACJ,CAAC;EACD,MAAMC,0BAA0B,GAAG,IAAAD,mBAAW,EAC1C,gCACJ,CAAC;EACD;EACA,MAAME,2BAA2B,GAAG,IAAAF,mBAAW,EAC3C,iCACJ,CAAC;EACD,MAAMG,0BAA0B,GAAG,IAAAH,mBAAW,EAC1C,gCACJ,CAAC;EACD;EACA,MAAMI,2BAA2B,GAAG,IAAAJ,mBAAW,EAC3C,iCACJ,CAAC;EACD,MAAMK,0BAA0B,GAAG,IAAAL,mBAAW,EAC1C,gCACJ,CAAC;EAED,OAAO;IACH,MAAMM,GAAGA,CAACC,EAAE,EAAE;MACV,OAAOT,iBAAiB,CAACU,gBAAgB,CAAC;QAAED;MAAG,CAAC,CAAC;IACrD,CAAC;IACD,MAAME,IAAIA,CAACC,MAAM,EAAE;MACf,OAAOZ,iBAAiB,CAACa,kBAAkB,CAACD,MAAM,CAAC;IACvD,CAAC;IACD,MAAME,MAAMA,CAACC,IAAI,EAAE;MACf,MAAMd,2BAA2B,CAACe,OAAO,CAAC;QAAEC,KAAK,EAAEF;MAAK,CAAC,CAAC;MAE1D,MAAMG,aAAa,GAAG,MAAMlB,iBAAiB,CAACmB,mBAAmB,CAAC;QAAEJ;MAAK,CAAC,CAAC;MAE3E,MAAMZ,0BAA0B,CAACa,OAAO,CAAC;QAAEE;MAAc,CAAC,CAAC;MAE3D,OAAOA,aAAa;IACxB,CAAC;IACD,MAAME,MAAMA,CAACX,EAAE,EAAEM,IAAI,EAAE;MACnB,MAAMM,QAAQ,GAAG,MAAMrB,iBAAiB,CAACU,gBAAgB,CAAC;QAAED;MAAG,CAAC,CAAC;MAEjE,MAAML,2BAA2B,CAACY,OAAO,CAAC;QAAEK,QAAQ;QAAEJ,KAAK,EAAE;UAAER,EAAE;UAAEM;QAAK;MAAE,CAAC,CAAC;MAE5E,MAAMG,aAAa,GAAG,MAAMlB,iBAAiB,CAACsB,mBAAmB,CAAC;QAAEb,EAAE;QAAEM;MAAK,CAAC,CAAC;MAE/E,MAAMV,0BAA0B,CAACW,OAAO,CAAC;QACrCK,QAAQ;QACRJ,KAAK,EAAE;UAAER,EAAE;UAAEM;QAAK,CAAC;QACnBG;MACJ,CAAC,CAAC;MAEF,OAAOA,aAAa;IACxB,CAAC;IACD,MAAMK,MAAMA,CAACd,EAAU,EAAE;MACrB,MAAMS,aAAa,GAAG,MAAMlB,iBAAiB,CAACU,gBAAgB,CAAC;QAAED;MAAG,CAAC,CAAC;MAEtE,MAAMH,2BAA2B,CAACU,OAAO,CAAC;QAAEE;MAAc,CAAC,CAAC;MAE5D,MAAMlB,iBAAiB,CAACwB,mBAAmB,CAAC;QAAEf;MAAG,CAAC,CAAC;MAEnD,MAAMF,0BAA0B,CAACS,OAAO,CAAC;QAAEE;MAAc,CAAC,CAAC;MAE3D,OAAO,IAAI;IACf,CAAC;IACD;AACR;AACA;IACQjB,2BAA2B;IAC3BE,0BAA0B;IAC1BC,2BAA2B;IAC3BC,0BAA0B;IAC1BC,2BAA2B;IAC3BC;EACJ,CAAC;AACL","ignoreList":[]}
@@ -1,2 +1,2 @@
1
- import { ApwCommentCrud, CreateApwParams } from "../types";
1
+ import type { ApwCommentCrud, CreateApwParams } from "../types";
2
2
  export declare function createCommentMethods({ storageOperations }: CreateApwParams): ApwCommentCrud;
@@ -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,0BAA0B,CAC7B;EAED,OAAO;IACH;AACR;AACA;IACQD,qBAAqB;IACrBE,oBAAoB;IACpBC,qBAAqB;IACrBC,oBAAoB;IACpBC,qBAAqB;IACrBC,oBAAoB;IACpB,MAAMC,GAAG,CAACC,EAAE,EAAE;MACV,OAAOT,iBAAiB,CAACU,UAAU,CAAC;QAAED;MAAG,CAAC,CAAC;IAC/C,CAAC;IACD,MAAME,IAAI,CAACC,MAAM,EAAE;MACf,OAAOZ,iBAAiB,CAACa,YAAY,CAACD,MAAM,CAAC;IACjD,CAAC;IACD,MAAME,MAAM,CAACC,IAAI,EAAE;MACf,MAAMd,qBAAqB,CAACe,OAAO,CAAC;QAAEC,KAAK,EAAEF;MAAK,CAAC,CAAC;MAEpD,MAAMG,OAAO,GAAG,MAAMlB,iBAAiB,CAACmB,aAAa,CAAC;QAClDJ;MACJ,CAAC,CAAC;MACF,MAAMZ,oBAAoB,CAACa,OAAO,CAAC;QAAEE;MAAQ,CAAC,CAAC;MAE/C,OAAOA,OAAO;IAClB,CAAC;IACD,MAAME,MAAM,CAACX,EAAE,EAAEM,IAAI,EAAE;MACnB,MAAMM,QAAQ,GAAG,MAAMrB,iBAAiB,CAACU,UAAU,CAAC;QAAED;MAAG,CAAC,CAAC;MAE3D,MAAML,qBAAqB,CAACY,OAAO,CAAC;QAAEK,QAAQ;QAAEJ,KAAK,EAAE;UAAER,EAAE;UAAEM;QAAK;MAAE,CAAC,CAAC;MAEtE,MAAMG,OAAO,GAAG,MAAMlB,iBAAiB,CAACsB,aAAa,CAAC;QAAEb,EAAE;QAAEM;MAAK,CAAC,CAAC;MAEnE,MAAMV,oBAAoB,CAACW,OAAO,CAAC;QAAEK,QAAQ;QAAEH,OAAO;QAAED,KAAK,EAAE;UAAER,EAAE;UAAEM;QAAK;MAAE,CAAC,CAAC;MAE9E,OAAOG,OAAO;IAClB,CAAC;IACD,MAAMK,MAAM,CAACd,EAAU,EAAE;MACrB,MAAMS,OAAO,GAAG,MAAMlB,iBAAiB,CAACU,UAAU,CAAC;QAAED;MAAG,CAAC,CAAC;MAE1D,MAAMH,qBAAqB,CAACU,OAAO,CAAC;QAAEE;MAAQ,CAAC,CAAC;MAEhD,MAAMlB,iBAAiB,CAACwB,aAAa,CAAC;QAAEf;MAAG,CAAC,CAAC;MAE7C,MAAMF,oBAAoB,CAACS,OAAO,CAAC;QAAEE;MAAQ,CAAC,CAAC;MAE/C,OAAO,IAAI;IACf;EACJ,CAAC;AACL"}
1
+ {"version":3,"names":["_pubsub","require","createCommentMethods","storageOperations","onCommentBeforeCreate","createTopic","onCommentAfterCreate","onCommentBeforeUpdate","onCommentAfterUpdate","onCommentBeforeDelete","onCommentAfterDelete","get","id","getComment","list","params","listComments","create","data","publish","input","comment","createComment","update","original","updateComment","delete","deleteComment"],"sources":["createCommentMethods.ts"],"sourcesContent":["import { createTopic } from \"@webiny/pubsub\";\nimport type {\n ApwCommentCrud,\n CreateApwParams,\n OnCommentBeforeCreateTopicParams,\n OnCommentAfterCreateTopicParams,\n OnCommentBeforeUpdateTopicParams,\n OnCommentAfterUpdateTopicParams,\n OnCommentBeforeDeleteTopicParams,\n OnCommentAfterDeleteTopicParams\n} from \"~/types\";\n\nexport function createCommentMethods({ storageOperations }: CreateApwParams): ApwCommentCrud {\n // create\n const onCommentBeforeCreate = createTopic<OnCommentBeforeCreateTopicParams>(\n \"apw.onCommentBeforeCreate\"\n );\n const onCommentAfterCreate = createTopic<OnCommentAfterCreateTopicParams>(\n \"apw.onCommentAfterCreate\"\n );\n // update\n const onCommentBeforeUpdate = createTopic<OnCommentBeforeUpdateTopicParams>(\n \"apw.onCommentBeforeUpdate\"\n );\n const onCommentAfterUpdate = createTopic<OnCommentAfterUpdateTopicParams>(\n \"apw.onCommentAfterUpdate\"\n );\n // delete\n const onCommentBeforeDelete = createTopic<OnCommentBeforeDeleteTopicParams>(\n \"apw.onCommentBeforeDelete\"\n );\n const onCommentAfterDelete = createTopic<OnCommentAfterDeleteTopicParams>(\n \"apw.onCommentAfterDelete\"\n );\n\n return {\n /**\n * Lifecycle events\n */\n onCommentBeforeCreate,\n onCommentAfterCreate,\n onCommentBeforeUpdate,\n onCommentAfterUpdate,\n onCommentBeforeDelete,\n onCommentAfterDelete,\n async get(id) {\n return storageOperations.getComment({ id });\n },\n async list(params) {\n return storageOperations.listComments(params);\n },\n async create(data) {\n await onCommentBeforeCreate.publish({ input: data });\n\n const comment = await storageOperations.createComment({\n data\n });\n await onCommentAfterCreate.publish({ comment });\n\n return comment;\n },\n async update(id, data) {\n const original = await storageOperations.getComment({ id });\n\n await onCommentBeforeUpdate.publish({ original, input: { id, data } });\n\n const comment = await storageOperations.updateComment({ id, data });\n\n await onCommentAfterUpdate.publish({ original, comment, input: { id, data } });\n\n return comment;\n },\n async delete(id: string) {\n const comment = await storageOperations.getComment({ id });\n\n await onCommentBeforeDelete.publish({ comment });\n\n await storageOperations.deleteComment({ id });\n\n await onCommentAfterDelete.publish({ comment });\n\n return true;\n }\n };\n}\n"],"mappings":";;;;;;AAAA,IAAAA,OAAA,GAAAC,OAAA;AAYO,SAASC,oBAAoBA,CAAC;EAAEC;AAAmC,CAAC,EAAkB;EACzF;EACA,MAAMC,qBAAqB,GAAG,IAAAC,mBAAW,EACrC,2BACJ,CAAC;EACD,MAAMC,oBAAoB,GAAG,IAAAD,mBAAW,EACpC,0BACJ,CAAC;EACD;EACA,MAAME,qBAAqB,GAAG,IAAAF,mBAAW,EACrC,2BACJ,CAAC;EACD,MAAMG,oBAAoB,GAAG,IAAAH,mBAAW,EACpC,0BACJ,CAAC;EACD;EACA,MAAMI,qBAAqB,GAAG,IAAAJ,mBAAW,EACrC,2BACJ,CAAC;EACD,MAAMK,oBAAoB,GAAG,IAAAL,mBAAW,EACpC,0BACJ,CAAC;EAED,OAAO;IACH;AACR;AACA;IACQD,qBAAqB;IACrBE,oBAAoB;IACpBC,qBAAqB;IACrBC,oBAAoB;IACpBC,qBAAqB;IACrBC,oBAAoB;IACpB,MAAMC,GAAGA,CAACC,EAAE,EAAE;MACV,OAAOT,iBAAiB,CAACU,UAAU,CAAC;QAAED;MAAG,CAAC,CAAC;IAC/C,CAAC;IACD,MAAME,IAAIA,CAACC,MAAM,EAAE;MACf,OAAOZ,iBAAiB,CAACa,YAAY,CAACD,MAAM,CAAC;IACjD,CAAC;IACD,MAAME,MAAMA,CAACC,IAAI,EAAE;MACf,MAAMd,qBAAqB,CAACe,OAAO,CAAC;QAAEC,KAAK,EAAEF;MAAK,CAAC,CAAC;MAEpD,MAAMG,OAAO,GAAG,MAAMlB,iBAAiB,CAACmB,aAAa,CAAC;QAClDJ;MACJ,CAAC,CAAC;MACF,MAAMZ,oBAAoB,CAACa,OAAO,CAAC;QAAEE;MAAQ,CAAC,CAAC;MAE/C,OAAOA,OAAO;IAClB,CAAC;IACD,MAAME,MAAMA,CAACX,EAAE,EAAEM,IAAI,EAAE;MACnB,MAAMM,QAAQ,GAAG,MAAMrB,iBAAiB,CAACU,UAAU,CAAC;QAAED;MAAG,CAAC,CAAC;MAE3D,MAAML,qBAAqB,CAACY,OAAO,CAAC;QAAEK,QAAQ;QAAEJ,KAAK,EAAE;UAAER,EAAE;UAAEM;QAAK;MAAE,CAAC,CAAC;MAEtE,MAAMG,OAAO,GAAG,MAAMlB,iBAAiB,CAACsB,aAAa,CAAC;QAAEb,EAAE;QAAEM;MAAK,CAAC,CAAC;MAEnE,MAAMV,oBAAoB,CAACW,OAAO,CAAC;QAAEK,QAAQ;QAAEH,OAAO;QAAED,KAAK,EAAE;UAAER,EAAE;UAAEM;QAAK;MAAE,CAAC,CAAC;MAE9E,OAAOG,OAAO;IAClB,CAAC;IACD,MAAMK,MAAMA,CAACd,EAAU,EAAE;MACrB,MAAMS,OAAO,GAAG,MAAMlB,iBAAiB,CAACU,UAAU,CAAC;QAAED;MAAG,CAAC,CAAC;MAE1D,MAAMH,qBAAqB,CAACU,OAAO,CAAC;QAAEE;MAAQ,CAAC,CAAC;MAEhD,MAAMlB,iBAAiB,CAACwB,aAAa,CAAC;QAAEf;MAAG,CAAC,CAAC;MAE7C,MAAMF,oBAAoB,CAACS,OAAO,CAAC;QAAEE;MAAQ,CAAC,CAAC;MAE/C,OAAO,IAAI;IACf;EACJ,CAAC;AACL","ignoreList":[]}
@@ -1,5 +1,5 @@
1
- import { AdvancedPublishingWorkflow, ApwContentReviewCrud, ApwReviewerCrud, CreateApwParams } from "../types";
2
- import { PluginsContainer } from "@webiny/plugins";
1
+ import type { AdvancedPublishingWorkflow, ApwContentReviewCrud, ApwReviewerCrud, CreateApwParams } from "../types";
2
+ import type { PluginsContainer } from "@webiny/plugins";
3
3
  export interface CreateContentReviewMethodsParams extends CreateApwParams {
4
4
  getReviewer: ApwReviewerCrud["get"];
5
5
  getContentGetter: AdvancedPublishingWorkflow["getContentGetter"];
@@ -5,8 +5,6 @@ Object.defineProperty(exports, "__esModule", {
5
5
  value: true
6
6
  });
7
7
  exports.createContentReviewMethods = createContentReviewMethods;
8
- var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
9
- var _get = _interopRequireDefault(require("lodash/get"));
10
8
  var _pubsub = require("@webiny/pubsub");
11
9
  var _error = _interopRequireDefault(require("@webiny/error"));
12
10
  var _types = require("../types");
@@ -64,22 +62,25 @@ function createContentReviewMethods(params) {
64
62
  });
65
63
  if (where.reviewStatus === "requiresMyAttention") {
66
64
  return (0, _utils2.filterContentReviewsByRequiresMyAttention)({
67
- listParams: (0, _objectSpread2.default)((0, _objectSpread2.default)({}, params), {}, {
65
+ listParams: {
66
+ ...params,
68
67
  where
69
- }),
68
+ },
70
69
  listContentReviews: storageOperations.listContentReviews,
71
70
  getReviewer,
72
71
  getIdentity
73
72
  });
74
73
  }
75
- return storageOperations.listContentReviews((0, _objectSpread2.default)((0, _objectSpread2.default)({}, params), {}, {
74
+ return storageOperations.listContentReviews({
75
+ ...params,
76
76
  where
77
- }));
77
+ });
78
78
  },
79
79
  async create(data) {
80
- const input = (0, _objectSpread2.default)((0, _objectSpread2.default)({}, data), {}, {
80
+ const input = {
81
+ ...data,
81
82
  reviewStatus: _types.ApwContentReviewStatus.UNDER_REVIEW
82
- });
83
+ };
83
84
  await onContentReviewBeforeCreate.publish({
84
85
  input
85
86
  });
@@ -202,11 +203,12 @@ function createContentReviewMethods(params) {
202
203
  const updatedSteps = steps.map((step, index) => {
203
204
  if (index === stepIndex) {
204
205
  previousStepStatus = _types.ApwContentReviewStepStatus.DONE;
205
- return (0, _objectSpread2.default)((0, _objectSpread2.default)({}, step), {}, {
206
+ return {
207
+ ...step,
206
208
  status: _types.ApwContentReviewStepStatus.DONE,
207
209
  signOffProvidedOn: new Date().toISOString(),
208
210
  signOffProvidedBy: identity
209
- });
211
+ };
210
212
  }
211
213
  /**
212
214
  * Update next steps status based on type.
@@ -214,9 +216,10 @@ function createContentReviewMethods(params) {
214
216
  if (index > stepIndex) {
215
217
  const previousStep = steps[index - 1];
216
218
  previousStepStatus = (0, _utils.getNextStepStatus)(previousStep.type, previousStepStatus);
217
- return (0, _objectSpread2.default)((0, _objectSpread2.default)({}, step), {}, {
219
+ return {
220
+ ...step,
218
221
  status: previousStepStatus
219
- });
222
+ };
220
223
  }
221
224
  return step;
222
225
  });
@@ -243,11 +246,12 @@ function createContentReviewMethods(params) {
243
246
  return true;
244
247
  },
245
248
  async retractSignOff(id, stepId) {
246
- const entry = await this.get(id);
249
+ const contentReview = await this.get(id);
247
250
  const {
248
251
  steps,
249
- reviewStatus
250
- } = entry;
252
+ reviewStatus,
253
+ content
254
+ } = contentReview;
251
255
  const stepIndex = steps.findIndex(step => step.id === stepId);
252
256
  const currentStep = steps[stepIndex];
253
257
  const identity = getIdentity();
@@ -262,7 +266,7 @@ function createContentReviewMethods(params) {
262
266
  */
263
267
  if (!hasPermission) {
264
268
  throw new _errors.NotAuthorizedError({
265
- entry,
269
+ entry: contentReview,
266
270
  input: {
267
271
  id,
268
272
  step: stepId
@@ -274,7 +278,7 @@ function createContentReviewMethods(params) {
274
278
  */
275
279
  if (currentStep.status !== _types.ApwContentReviewStepStatus.DONE) {
276
280
  throw new _errors.NoSignOffProvidedError({
277
- entry,
281
+ entry: contentReview,
278
282
  input: {
279
283
  id,
280
284
  step: stepId
@@ -289,11 +293,12 @@ function createContentReviewMethods(params) {
289
293
  const updatedSteps = steps.map((step, index) => {
290
294
  if (index === stepIndex) {
291
295
  previousStepStatus = _types.ApwContentReviewStepStatus.ACTIVE;
292
- return (0, _objectSpread2.default)((0, _objectSpread2.default)({}, step), {}, {
296
+ return {
297
+ ...step,
293
298
  status: previousStepStatus,
294
299
  signOffProvidedOn: null,
295
300
  signOffProvidedBy: null
296
- });
301
+ };
297
302
  }
298
303
  /**
299
304
  * Set next step status as "inactive".
@@ -301,9 +306,10 @@ function createContentReviewMethods(params) {
301
306
  if (index > stepIndex) {
302
307
  const previousStep = steps[index - 1];
303
308
  previousStepStatus = (0, _utils.getNextStepStatus)(previousStep.type, previousStepStatus);
304
- return (0, _objectSpread2.default)((0, _objectSpread2.default)({}, step), {}, {
309
+ return {
310
+ ...step,
305
311
  status: previousStepStatus
306
- });
312
+ };
307
313
  }
308
314
  return step;
309
315
  });
@@ -319,7 +325,21 @@ function createContentReviewMethods(params) {
319
325
  if (pendingRequiredSteps.length !== 0) {
320
326
  newStatus = _types.ApwContentReviewStatus.UNDER_REVIEW;
321
327
  }
328
+
329
+ /**
330
+ * We need to delete the scheduled action if one was created.
331
+ */
332
+ const scheduledActionId = contentReview.content?.scheduledActionId;
333
+ if (!!scheduledActionId) {
334
+ await scheduler.delete(scheduledActionId);
335
+ }
322
336
  await this.update(id, {
337
+ content: {
338
+ ...content,
339
+ scheduledOn: null,
340
+ scheduledBy: null,
341
+ scheduledActionId: null
342
+ },
323
343
  steps: updatedSteps,
324
344
  reviewStatus: newStatus
325
345
  });
@@ -347,7 +367,6 @@ function createContentReviewMethods(params) {
347
367
  };
348
368
  },
349
369
  async publishContent(id, datetime) {
350
- var _content$settings;
351
370
  const {
352
371
  content,
353
372
  reviewStatus
@@ -379,7 +398,7 @@ function createContentReviewMethods(params) {
379
398
  action: _types2.ApwScheduleActionTypes.PUBLISH,
380
399
  type: content.type,
381
400
  entryId: content.id,
382
- modelId: (_content$settings = content.settings) === null || _content$settings === void 0 ? void 0 : _content$settings.modelId,
401
+ modelId: content.settings?.modelId,
383
402
  datetime
384
403
  };
385
404
  const scheduledActionId = await this.scheduleAction(data);
@@ -387,16 +406,16 @@ function createContentReviewMethods(params) {
387
406
  * Update scheduled related meta data.
388
407
  */
389
408
  await this.update(id, {
390
- content: (0, _objectSpread2.default)((0, _objectSpread2.default)({}, content), {}, {
409
+ content: {
410
+ ...content,
391
411
  scheduledOn: datetime,
392
412
  scheduledBy: identity.id,
393
413
  scheduledActionId
394
- })
414
+ }
395
415
  });
396
416
  return true;
397
417
  },
398
418
  async unpublishContent(id, datetime) {
399
- var _content$settings2;
400
419
  const {
401
420
  content,
402
421
  reviewStatus
@@ -428,18 +447,19 @@ function createContentReviewMethods(params) {
428
447
  action: _types2.ApwScheduleActionTypes.UNPUBLISH,
429
448
  type: content.type,
430
449
  entryId: content.id,
431
- modelId: (_content$settings2 = content.settings) === null || _content$settings2 === void 0 ? void 0 : _content$settings2.modelId,
450
+ modelId: content.settings?.modelId,
432
451
  datetime
433
452
  });
434
453
  /**
435
454
  * Update scheduled related meta data.
436
455
  */
437
456
  await this.update(id, {
438
- content: (0, _objectSpread2.default)((0, _objectSpread2.default)({}, content), {}, {
457
+ content: {
458
+ ...content,
439
459
  scheduledOn: datetime,
440
460
  scheduledBy: identity.id,
441
461
  scheduledActionId
442
- })
462
+ }
443
463
  });
444
464
  return true;
445
465
  },
@@ -467,7 +487,7 @@ function createContentReviewMethods(params) {
467
487
  },
468
488
  async deleteScheduledAction(id) {
469
489
  const contentReview = await this.get(id);
470
- const scheduledActionId = (0, _get.default)(contentReview, "content.scheduledActionId");
490
+ const scheduledActionId = contentReview.content?.scheduledActionId;
471
491
 
472
492
  /**
473
493
  * Check if there is any action scheduled for this "content review".
@@ -490,9 +510,14 @@ function createContentReviewMethods(params) {
490
510
  * Reset scheduled related meta data.
491
511
  */
492
512
  await this.update(id, {
493
- content: (0, _objectSpread2.default)((0, _objectSpread2.default)({}, contentReview.content), _utils2.INITIAL_CONTENT_REVIEW_CONTENT_SCHEDULE_META)
513
+ content: {
514
+ ...contentReview.content,
515
+ ..._utils2.INITIAL_CONTENT_REVIEW_CONTENT_SCHEDULE_META
516
+ }
494
517
  });
495
518
  return true;
496
519
  }
497
520
  };
498
- }
521
+ }
522
+
523
+ //# sourceMappingURL=createContentReviewMethods.js.map