@webiny/api-apw 0.0.0-unstable.1e66d121db → 0.0.0-unstable.2696f9d9e8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (267) hide show
  1. package/ApwChangeRequestNotification.d.ts +27 -0
  2. package/ApwChangeRequestNotification.js +28 -0
  3. package/ApwChangeRequestNotification.js.map +1 -0
  4. package/ApwCommentNotification.d.ts +27 -0
  5. package/ApwCommentNotification.js +28 -0
  6. package/ApwCommentNotification.js.map +1 -0
  7. package/ApwContentReviewNotification.d.ts +26 -0
  8. package/ApwContentReviewNotification.js +28 -0
  9. package/ApwContentReviewNotification.js.map +1 -0
  10. package/ApwContentUrlPlugin.d.ts +19 -0
  11. package/ApwContentUrlPlugin.js +28 -0
  12. package/ApwContentUrlPlugin.js.map +1 -0
  13. package/ContentApwSettingsPlugin.js +5 -9
  14. package/ContentApwSettingsPlugin.js.map +1 -1
  15. package/README.md +3 -3
  16. package/crud/createChangeRequestMethods.js +7 -12
  17. package/crud/createChangeRequestMethods.js.map +1 -1
  18. package/crud/createCommentMethods.js +7 -13
  19. package/crud/createCommentMethods.js.map +1 -1
  20. package/crud/createContentReviewMethods.js +83 -111
  21. package/crud/createContentReviewMethods.js.map +1 -1
  22. package/crud/createReviewerMethods.js +7 -13
  23. package/crud/createReviewerMethods.js.map +1 -1
  24. package/crud/createWorkflowMethods.js +7 -18
  25. package/crud/createWorkflowMethods.js.map +1 -1
  26. package/crud/index.js +5 -29
  27. package/crud/index.js.map +1 -1
  28. package/crud/utils.js +6 -33
  29. package/crud/utils.js.map +1 -1
  30. package/index.d.ts +2 -3
  31. package/index.js +6 -16
  32. package/index.js.map +1 -1
  33. package/package.json +40 -47
  34. package/plugins/cms/CmsEntryApwSettingsGetterPlugin.js +4 -19
  35. package/plugins/cms/CmsEntryApwSettingsGetterPlugin.js.map +1 -1
  36. package/plugins/cms/apwEntryPlugins.js +8 -13
  37. package/plugins/cms/apwEntryPlugins.js.map +1 -1
  38. package/plugins/cms/index.js +7 -10
  39. package/plugins/cms/index.js.map +1 -1
  40. package/plugins/cms/linkContentReviewToEntry.js +4 -20
  41. package/plugins/cms/linkContentReviewToEntry.js.map +1 -1
  42. package/plugins/cms/linkWorkflowToEntry.js +17 -45
  43. package/plugins/cms/linkWorkflowToEntry.js.map +1 -1
  44. package/plugins/cms/notifications/changeRequestNotification.d.ts +1 -0
  45. package/plugins/cms/notifications/changeRequestNotification.js +33 -0
  46. package/plugins/cms/notifications/changeRequestNotification.js.map +1 -0
  47. package/plugins/cms/notifications/commentNotification.d.ts +1 -0
  48. package/plugins/cms/notifications/commentNotification.js +33 -0
  49. package/plugins/cms/notifications/commentNotification.js.map +1 -0
  50. package/plugins/cms/notifications/contentReviewNotification.d.ts +1 -0
  51. package/plugins/cms/notifications/contentReviewNotification.js +33 -0
  52. package/plugins/cms/notifications/contentReviewNotification.js.map +1 -0
  53. package/plugins/cms/notifications/contentUrl.d.ts +8 -0
  54. package/plugins/cms/notifications/contentUrl.js +55 -0
  55. package/plugins/cms/notifications/contentUrl.js.map +1 -0
  56. package/plugins/cms/triggerContentReview.js +5 -18
  57. package/plugins/cms/triggerContentReview.js.map +1 -1
  58. package/plugins/cms/updateContentReviewStatus.js +14 -30
  59. package/plugins/cms/updateContentReviewStatus.js.map +1 -1
  60. package/plugins/cms/utils.d.ts +3 -2
  61. package/plugins/cms/utils.js +23 -60
  62. package/plugins/cms/utils.js.map +1 -1
  63. package/plugins/context.d.ts +0 -1
  64. package/plugins/context.js +2 -45
  65. package/plugins/context.js.map +1 -1
  66. package/plugins/graphql/changeRequest.gql.js +16 -19
  67. package/plugins/graphql/changeRequest.gql.js.map +1 -1
  68. package/plugins/graphql/comment.gql.js +41 -42
  69. package/plugins/graphql/comment.gql.js.map +1 -1
  70. package/plugins/graphql/contentReview.gql.js +25 -34
  71. package/plugins/graphql/contentReview.gql.js.map +1 -1
  72. package/plugins/graphql/reviewer.gql.js +17 -19
  73. package/plugins/graphql/reviewer.gql.js.map +1 -1
  74. package/plugins/graphql/utils.d.ts +2 -0
  75. package/plugins/graphql/utils.js +12 -0
  76. package/plugins/graphql/utils.js.map +1 -0
  77. package/plugins/graphql/workflow.gql.js +15 -19
  78. package/plugins/graphql/workflow.gql.js.map +1 -1
  79. package/plugins/graphql.js +5 -18
  80. package/plugins/graphql.js.map +1 -1
  81. package/plugins/hooks/createReviewerFromIdentity.js +28 -15
  82. package/plugins/hooks/createReviewerFromIdentity.js.map +1 -1
  83. package/plugins/hooks/deleteChangeRequestsAfterContentReview.js +3 -9
  84. package/plugins/hooks/deleteChangeRequestsAfterContentReview.js.map +1 -1
  85. package/plugins/hooks/deleteCommentsAfterChangeRequest.js +3 -8
  86. package/plugins/hooks/deleteCommentsAfterChangeRequest.js.map +1 -1
  87. package/plugins/hooks/index.js +4 -13
  88. package/plugins/hooks/index.js.map +1 -1
  89. package/plugins/hooks/initializeContentReviewSteps.js +15 -20
  90. package/plugins/hooks/initializeContentReviewSteps.js.map +1 -1
  91. package/plugins/hooks/initializeNotifications.d.ts +2 -0
  92. package/plugins/hooks/initializeNotifications.js +17 -0
  93. package/plugins/hooks/initializeNotifications.js.map +1 -0
  94. package/plugins/hooks/listContentReviews.d.ts +1 -1
  95. package/plugins/hooks/listContentReviews.js +11 -33
  96. package/plugins/hooks/listContentReviews.js.map +1 -1
  97. package/plugins/hooks/notifications/appUrl.d.ts +2 -0
  98. package/plugins/hooks/notifications/appUrl.js +20 -0
  99. package/plugins/hooks/notifications/appUrl.js.map +1 -0
  100. package/plugins/hooks/notifications/changeRequestAfterCreate.d.ts +2 -0
  101. package/plugins/hooks/notifications/changeRequestAfterCreate.js +113 -0
  102. package/plugins/hooks/notifications/changeRequestAfterCreate.js.map +1 -0
  103. package/plugins/hooks/notifications/changeRequestUrl.d.ts +8 -0
  104. package/plugins/hooks/notifications/changeRequestUrl.js +29 -0
  105. package/plugins/hooks/notifications/changeRequestUrl.js.map +1 -0
  106. package/plugins/hooks/notifications/commentAfterCreate.d.ts +2 -0
  107. package/plugins/hooks/notifications/commentAfterCreate.js +124 -0
  108. package/plugins/hooks/notifications/commentAfterCreate.js.map +1 -0
  109. package/plugins/hooks/notifications/commentUrl.d.ts +8 -0
  110. package/plugins/hooks/notifications/commentUrl.js +29 -0
  111. package/plugins/hooks/notifications/commentUrl.js.map +1 -0
  112. package/plugins/hooks/notifications/contentReviewAfterCreate.d.ts +2 -0
  113. package/plugins/hooks/notifications/contentReviewAfterCreate.js +96 -0
  114. package/plugins/hooks/notifications/contentReviewAfterCreate.js.map +1 -0
  115. package/plugins/hooks/notifications/contentReviewUrl.d.ts +7 -0
  116. package/plugins/hooks/notifications/contentReviewUrl.js +28 -0
  117. package/plugins/hooks/notifications/contentReviewUrl.js.map +1 -0
  118. package/plugins/hooks/notifications/contentUrl.d.ts +7 -0
  119. package/plugins/hooks/notifications/contentUrl.js +26 -0
  120. package/plugins/hooks/notifications/contentUrl.js.map +1 -0
  121. package/plugins/hooks/notifications/lastChangeRequestNotificationPlugin.d.ts +11 -0
  122. package/plugins/hooks/notifications/lastChangeRequestNotificationPlugin.js +23 -0
  123. package/plugins/hooks/notifications/lastChangeRequestNotificationPlugin.js.map +1 -0
  124. package/plugins/hooks/notifications/lastCommentNotificationPlugin.d.ts +11 -0
  125. package/plugins/hooks/notifications/lastCommentNotificationPlugin.js +23 -0
  126. package/plugins/hooks/notifications/lastCommentNotificationPlugin.js.map +1 -0
  127. package/plugins/hooks/notifications/lastContentReviewNotificationPlugin.d.ts +11 -0
  128. package/plugins/hooks/notifications/lastContentReviewNotificationPlugin.js +23 -0
  129. package/plugins/hooks/notifications/lastContentReviewNotificationPlugin.js.map +1 -0
  130. package/plugins/hooks/notifications/reviewers.d.ts +15 -0
  131. package/plugins/hooks/notifications/reviewers.js +47 -0
  132. package/plugins/hooks/notifications/reviewers.js.map +1 -0
  133. package/plugins/hooks/notifications/sendChangeRequestNotification.d.ts +2 -0
  134. package/plugins/hooks/notifications/sendChangeRequestNotification.js +43 -0
  135. package/plugins/hooks/notifications/sendChangeRequestNotification.js.map +1 -0
  136. package/plugins/hooks/notifications/sendCommentNotification.d.ts +2 -0
  137. package/plugins/hooks/notifications/sendCommentNotification.js +43 -0
  138. package/plugins/hooks/notifications/sendCommentNotification.js.map +1 -0
  139. package/plugins/hooks/notifications/sendContentReviewNotification.d.ts +2 -0
  140. package/plugins/hooks/notifications/sendContentReviewNotification.js +43 -0
  141. package/plugins/hooks/notifications/sendContentReviewNotification.js.map +1 -0
  142. package/plugins/hooks/updatePendingChangeRequests.js +7 -13
  143. package/plugins/hooks/updatePendingChangeRequests.js.map +1 -1
  144. package/plugins/hooks/updateTotalComments.js +21 -23
  145. package/plugins/hooks/updateTotalComments.js.map +1 -1
  146. package/plugins/hooks/validateChangeRequest.js +27 -16
  147. package/plugins/hooks/validateChangeRequest.js.map +1 -1
  148. package/plugins/hooks/validateComment.js +13 -12
  149. package/plugins/hooks/validateComment.js.map +1 -1
  150. package/plugins/hooks/validateContentReview.js +2 -6
  151. package/plugins/hooks/validateContentReview.js.map +1 -1
  152. package/plugins/pageBuilder/PageApwSettingsGetterPlugin.js +4 -19
  153. package/plugins/pageBuilder/PageApwSettingsGetterPlugin.js.map +1 -1
  154. package/plugins/pageBuilder/apwContentPagePlugins.js +2 -4
  155. package/plugins/pageBuilder/apwContentPagePlugins.js.map +1 -1
  156. package/plugins/pageBuilder/extendPbPageSettingsSchema.js +3 -6
  157. package/plugins/pageBuilder/extendPbPageSettingsSchema.js.map +1 -1
  158. package/plugins/pageBuilder/index.js +7 -8
  159. package/plugins/pageBuilder/index.js.map +1 -1
  160. package/plugins/pageBuilder/linkContentReviewToPage.js +15 -27
  161. package/plugins/pageBuilder/linkContentReviewToPage.js.map +1 -1
  162. package/plugins/pageBuilder/linkWorkflowToPage.js +3 -31
  163. package/plugins/pageBuilder/linkWorkflowToPage.js.map +1 -1
  164. package/plugins/pageBuilder/notifications/changeRequestNotification.d.ts +1 -0
  165. package/plugins/pageBuilder/notifications/changeRequestNotification.js +33 -0
  166. package/plugins/pageBuilder/notifications/changeRequestNotification.js.map +1 -0
  167. package/plugins/pageBuilder/notifications/commentNotification.d.ts +1 -0
  168. package/plugins/pageBuilder/notifications/commentNotification.js +33 -0
  169. package/plugins/pageBuilder/notifications/commentNotification.js.map +1 -0
  170. package/plugins/pageBuilder/notifications/contentReviewNotification.d.ts +1 -0
  171. package/plugins/pageBuilder/notifications/contentReviewNotification.js +33 -0
  172. package/plugins/pageBuilder/notifications/contentReviewNotification.js.map +1 -0
  173. package/plugins/pageBuilder/notifications/contentUrl.d.ts +1 -0
  174. package/plugins/pageBuilder/notifications/contentUrl.js +49 -0
  175. package/plugins/pageBuilder/notifications/contentUrl.js.map +1 -0
  176. package/plugins/pageBuilder/triggerContentReview.js +2 -11
  177. package/plugins/pageBuilder/triggerContentReview.js.map +1 -1
  178. package/plugins/pageBuilder/updateContentReviewStatus.js +10 -17
  179. package/plugins/pageBuilder/updateContentReviewStatus.js.map +1 -1
  180. package/plugins/pageBuilder/utils.d.ts +2 -2
  181. package/plugins/pageBuilder/utils.js +3 -35
  182. package/plugins/pageBuilder/utils.js.map +1 -1
  183. package/plugins/utils.d.ts +1 -2
  184. package/plugins/utils.js +6 -52
  185. package/plugins/utils.js.map +1 -1
  186. package/scheduler/createScheduleActionMethods.js +45 -50
  187. package/scheduler/createScheduleActionMethods.js.map +1 -1
  188. package/scheduler/handlers/executeAction/index.d.ts +1 -1
  189. package/scheduler/handlers/executeAction/index.js +47 -40
  190. package/scheduler/handlers/executeAction/index.js.map +1 -1
  191. package/scheduler/handlers/executeAction/plugins/ApplicationGraphQL.d.ts +6 -0
  192. package/scheduler/handlers/executeAction/plugins/ApplicationGraphQL.js +19 -9
  193. package/scheduler/handlers/executeAction/plugins/ApplicationGraphQL.js.map +1 -1
  194. package/scheduler/handlers/executeAction/plugins/HeadlessCMSGraphQL.d.ts +2 -3
  195. package/scheduler/handlers/executeAction/plugins/HeadlessCMSGraphQL.js +11 -28
  196. package/scheduler/handlers/executeAction/plugins/HeadlessCMSGraphQL.js.map +1 -1
  197. package/scheduler/handlers/executeAction/plugins/PageBuilderGraphQL.d.ts +2 -2
  198. package/scheduler/handlers/executeAction/plugins/PageBuilderGraphQL.js +10 -92
  199. package/scheduler/handlers/executeAction/plugins/PageBuilderGraphQL.js.map +1 -1
  200. package/scheduler/handlers/executeAction/security.js +2 -11
  201. package/scheduler/handlers/executeAction/security.js.map +1 -1
  202. package/scheduler/handlers/scheduleAction/index.d.ts +1 -1
  203. package/scheduler/handlers/scheduleAction/index.js +24 -37
  204. package/scheduler/handlers/scheduleAction/index.js.map +1 -1
  205. package/scheduler/handlers/scheduleAction/scheduleAction.utils.js +20 -36
  206. package/scheduler/handlers/scheduleAction/scheduleAction.utils.js.map +1 -1
  207. package/scheduler/handlers/utils.d.ts +2 -4
  208. package/scheduler/handlers/utils.js +8 -47
  209. package/scheduler/handlers/utils.js.map +1 -1
  210. package/scheduler/index.js +2 -3
  211. package/scheduler/index.js.map +1 -1
  212. package/scheduler/types.d.ts +12 -28
  213. package/scheduler/types.js +13 -22
  214. package/scheduler/types.js.map +1 -1
  215. package/storageOperations/changeRequestStorageOperations.js +59 -45
  216. package/storageOperations/changeRequestStorageOperations.js.map +1 -1
  217. package/storageOperations/commentStorageOperations.js +35 -50
  218. package/storageOperations/commentStorageOperations.js.map +1 -1
  219. package/storageOperations/contentReviewStorageOperations.d.ts +1 -1
  220. package/storageOperations/contentReviewStorageOperations.js +34 -43
  221. package/storageOperations/contentReviewStorageOperations.js.map +1 -1
  222. package/storageOperations/index.d.ts +1 -7
  223. package/storageOperations/index.js +10 -29
  224. package/storageOperations/index.js.map +1 -1
  225. package/storageOperations/models/changeRequest.model.d.ts +1 -2
  226. package/storageOperations/models/changeRequest.model.js +6 -15
  227. package/storageOperations/models/changeRequest.model.js.map +1 -1
  228. package/storageOperations/models/comment.model.d.ts +1 -2
  229. package/storageOperations/models/comment.model.js +6 -14
  230. package/storageOperations/models/comment.model.js.map +1 -1
  231. package/storageOperations/models/contentReview.model.d.ts +1 -2
  232. package/storageOperations/models/contentReview.model.js +13 -37
  233. package/storageOperations/models/contentReview.model.js.map +1 -1
  234. package/storageOperations/models/index.js +6 -50
  235. package/storageOperations/models/index.js.map +1 -1
  236. package/storageOperations/models/reviewer.model.d.ts +1 -2
  237. package/storageOperations/models/reviewer.model.js +22 -14
  238. package/storageOperations/models/reviewer.model.js.map +1 -1
  239. package/storageOperations/models/utils.js +2 -4
  240. package/storageOperations/models/utils.js.map +1 -1
  241. package/storageOperations/models/workflow.model.d.ts +1 -2
  242. package/storageOperations/models/workflow.model.js +19 -42
  243. package/storageOperations/models/workflow.model.js.map +1 -1
  244. package/storageOperations/reviewerStorageOperations.d.ts +1 -1
  245. package/storageOperations/reviewerStorageOperations.js +34 -40
  246. package/storageOperations/reviewerStorageOperations.js.map +1 -1
  247. package/storageOperations/types.js +3 -1
  248. package/storageOperations/workflowStorageOperations.js +40 -47
  249. package/storageOperations/workflowStorageOperations.js.map +1 -1
  250. package/types.d.ts +39 -25
  251. package/types.js +126 -42
  252. package/types.js.map +1 -1
  253. package/utils/contentApwSettingsPlugin.js +2 -6
  254. package/utils/contentApwSettingsPlugin.js.map +1 -1
  255. package/utils/errors.js +2 -17
  256. package/utils/errors.js.map +1 -1
  257. package/utils/fieldResolver.js +8 -18
  258. package/utils/fieldResolver.js.map +1 -1
  259. package/utils/pickEntryFieldValues.d.ts +3 -0
  260. package/utils/pickEntryFieldValues.js +31 -0
  261. package/utils/pickEntryFieldValues.js.map +1 -0
  262. package/utils/resolve.d.ts +1 -1
  263. package/utils/resolve.js +2 -3
  264. package/utils/resolve.js.map +1 -1
  265. package/storageOperations/models/contentModelPluginFactory.d.ts +0 -15
  266. package/storageOperations/models/contentModelPluginFactory.js +0 -28
  267. package/storageOperations/models/contentModelPluginFactory.js.map +0 -1
@@ -0,0 +1,8 @@
1
+ interface CreateCommentUrlParams {
2
+ baseUrl?: string;
3
+ changeRequestId: string;
4
+ contentReviewId: string;
5
+ stepId: string;
6
+ }
7
+ export declare const createCommentUrl: (params: CreateCommentUrlParams) => string | null;
8
+ export {};
@@ -0,0 +1,29 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.createCommentUrl = void 0;
7
+ const createCommentUrl = params => {
8
+ /**
9
+ * All variables must exist for URL to be created.
10
+ * We go through all vars and throw a log if it does not exist.
11
+ */
12
+ for (const key in params) {
13
+ if (!!key) {
14
+ continue;
15
+ }
16
+ console.log(`Missing variable "${key}", which we use to create a comment URL.`);
17
+ return null;
18
+ }
19
+ const {
20
+ baseUrl,
21
+ changeRequestId,
22
+ contentReviewId,
23
+ stepId
24
+ } = params;
25
+ return `${baseUrl}/apw/content-reviews/${contentReviewId}/${stepId}/${changeRequestId}`;
26
+ };
27
+ exports.createCommentUrl = createCommentUrl;
28
+
29
+ //# sourceMappingURL=commentUrl.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["createCommentUrl","params","key","console","log","baseUrl","changeRequestId","contentReviewId","stepId","exports"],"sources":["commentUrl.ts"],"sourcesContent":["interface CreateCommentUrlParams {\n baseUrl?: string;\n changeRequestId: string;\n contentReviewId: string;\n stepId: string;\n}\nexport const createCommentUrl = (params: CreateCommentUrlParams): string | null => {\n /**\n * All variables must exist for URL to be created.\n * We go through all vars and throw a log if it does not exist.\n */\n for (const key in params) {\n if (!!key) {\n continue;\n }\n console.log(`Missing variable \"${key}\", which we use to create a comment URL.`);\n return null;\n }\n const { baseUrl, changeRequestId, contentReviewId, stepId } = params;\n\n return `${baseUrl}/apw/content-reviews/${contentReviewId}/${stepId}/${changeRequestId}`;\n};\n"],"mappings":";;;;;;AAMO,MAAMA,gBAAgB,GAAIC,MAA8B,IAAoB;EAC/E;AACJ;AACA;AACA;EACI,KAAK,MAAMC,GAAG,IAAID,MAAM,EAAE;IACtB,IAAI,CAAC,CAACC,GAAG,EAAE;MACP;IACJ;IACAC,OAAO,CAACC,GAAG,CAAE,qBAAoBF,GAAI,0CAAyC,CAAC;IAC/E,OAAO,IAAI;EACf;EACA,MAAM;IAAEG,OAAO;IAAEC,eAAe;IAAEC,eAAe;IAAEC;EAAO,CAAC,GAAGP,MAAM;EAEpE,OAAQ,GAAEI,OAAQ,wBAAuBE,eAAgB,IAAGC,MAAO,IAAGF,eAAgB,EAAC;AAC3F,CAAC;AAACG,OAAA,CAAAT,gBAAA,GAAAA,gBAAA"}
@@ -0,0 +1,2 @@
1
+ import { ApwContext } from "../../../types";
2
+ export declare const attachContentReviewAfterCreate: (context: ApwContext) => void;
@@ -0,0 +1,96 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
4
+ Object.defineProperty(exports, "__esModule", {
5
+ value: true
6
+ });
7
+ exports.attachContentReviewAfterCreate = void 0;
8
+ var _error = _interopRequireDefault(require("@webiny/error"));
9
+ var _appUrl = require("./appUrl");
10
+ var _contentReviewUrl = require("./contentReviewUrl");
11
+ var _contentUrl = require("./contentUrl");
12
+ var _reviewers = require("./reviewers");
13
+ var _sendContentReviewNotification = require("./sendContentReviewNotification");
14
+ const attachContentReviewAfterCreate = context => {
15
+ context.apw.contentReview.onContentReviewAfterCreate.subscribe(async ({
16
+ contentReview
17
+ }) => {
18
+ const execute = async () => {
19
+ if (contentReview.steps.length === 0) {
20
+ return;
21
+ }
22
+ const [step] = contentReview.steps;
23
+ if (!step?.id) {
24
+ return;
25
+ }
26
+ const settings = await (0, _appUrl.getAppUrl)(context);
27
+ if (!settings) {
28
+ return;
29
+ }
30
+ const contentReviewUrl = (0, _contentReviewUrl.createContentReviewUrl)({
31
+ baseUrl: settings.appUrl,
32
+ contentReviewId: contentReview.id,
33
+ stepId: step.id
34
+ });
35
+ if (!contentReviewUrl) {
36
+ return;
37
+ }
38
+
39
+ /**
40
+ * We go and check the workflow.
41
+ */
42
+ const workflow = await context.apw.workflow.get(contentReview.workflowId);
43
+ if (!workflow) {
44
+ throw new _error.default(`There is no workflow with Id "${contentReview.workflowId}".`, "WORKFLOW_NOT_FOUND", {
45
+ workflowId: contentReview.workflowId
46
+ });
47
+ }
48
+ const contentUrl = (0, _contentUrl.createContentUrl)({
49
+ plugins: context.plugins,
50
+ baseUrl: settings.appUrl,
51
+ contentReview,
52
+ workflow
53
+ });
54
+ if (!contentUrl) {
55
+ return;
56
+ }
57
+ const reviewers = await (0, _reviewers.fetchReviewers)({
58
+ context,
59
+ workflow,
60
+ exclude: [contentReview.createdBy.id]
61
+ });
62
+ if (reviewers.length === 0) {
63
+ return;
64
+ }
65
+ try {
66
+ await (0, _sendContentReviewNotification.sendContentReviewNotification)({
67
+ context,
68
+ reviewers,
69
+ contentReview,
70
+ workflow,
71
+ contentReviewUrl,
72
+ contentUrl
73
+ });
74
+ } catch (ex) {
75
+ throw new _error.default(`Could not send content review notifications.`, "CONTENT_REVIEW_NOTIFICATIONS_NOT_SENT", {
76
+ workflowId: workflow.id,
77
+ contentReviewId: contentReview.id,
78
+ contentReviewUrl,
79
+ contentUrl,
80
+ error: {
81
+ message: ex.message,
82
+ code: ex.code,
83
+ data: ex.data,
84
+ stack: ex.stack
85
+ }
86
+ });
87
+ }
88
+ };
89
+ await context.security.withoutAuthorization(async () => {
90
+ return execute();
91
+ });
92
+ });
93
+ };
94
+ exports.attachContentReviewAfterCreate = attachContentReviewAfterCreate;
95
+
96
+ //# sourceMappingURL=contentReviewAfterCreate.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_error","_interopRequireDefault","require","_appUrl","_contentReviewUrl","_contentUrl","_reviewers","_sendContentReviewNotification","attachContentReviewAfterCreate","context","apw","contentReview","onContentReviewAfterCreate","subscribe","execute","steps","length","step","id","settings","getAppUrl","contentReviewUrl","createContentReviewUrl","baseUrl","appUrl","contentReviewId","stepId","workflow","get","workflowId","WebinyError","contentUrl","createContentUrl","plugins","reviewers","fetchReviewers","exclude","createdBy","sendContentReviewNotification","ex","error","message","code","data","stack","security","withoutAuthorization","exports"],"sources":["contentReviewAfterCreate.ts"],"sourcesContent":["import WebinyError from \"@webiny/error\";\nimport { ApwContext } from \"~/types\";\nimport { getAppUrl } from \"./appUrl\";\nimport { createContentReviewUrl } from \"./contentReviewUrl\";\nimport { createContentUrl } from \"./contentUrl\";\nimport { fetchReviewers } from \"./reviewers\";\nimport { sendContentReviewNotification } from \"./sendContentReviewNotification\";\n\nexport const attachContentReviewAfterCreate = (context: ApwContext): void => {\n context.apw.contentReview.onContentReviewAfterCreate.subscribe(async ({ contentReview }) => {\n const execute = async () => {\n if (contentReview.steps.length === 0) {\n return;\n }\n const [step] = contentReview.steps;\n if (!step?.id) {\n return;\n }\n const settings = await getAppUrl(context);\n if (!settings) {\n return;\n }\n\n const contentReviewUrl = createContentReviewUrl({\n baseUrl: settings.appUrl,\n contentReviewId: contentReview.id,\n stepId: step.id\n });\n if (!contentReviewUrl) {\n return;\n }\n\n /**\n * We go and check the workflow.\n */\n const workflow = await context.apw.workflow.get(contentReview.workflowId);\n if (!workflow) {\n throw new WebinyError(\n `There is no workflow with Id \"${contentReview.workflowId}\".`,\n \"WORKFLOW_NOT_FOUND\",\n {\n workflowId: contentReview.workflowId\n }\n );\n }\n\n const contentUrl = createContentUrl({\n plugins: context.plugins,\n baseUrl: settings.appUrl,\n contentReview,\n workflow\n });\n if (!contentUrl) {\n return;\n }\n\n const reviewers = await fetchReviewers({\n context,\n workflow,\n exclude: [contentReview.createdBy.id]\n });\n if (reviewers.length === 0) {\n return;\n }\n\n try {\n await sendContentReviewNotification({\n context,\n reviewers,\n contentReview,\n workflow,\n contentReviewUrl,\n contentUrl\n });\n } catch (ex) {\n throw new WebinyError(\n `Could not send content review notifications.`,\n \"CONTENT_REVIEW_NOTIFICATIONS_NOT_SENT\",\n {\n workflowId: workflow.id,\n contentReviewId: contentReview.id,\n contentReviewUrl,\n contentUrl,\n error: {\n message: ex.message,\n code: ex.code,\n data: ex.data,\n stack: ex.stack\n }\n }\n );\n }\n };\n\n await context.security.withoutAuthorization(async () => {\n return execute();\n });\n });\n};\n"],"mappings":";;;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AAEA,IAAAC,OAAA,GAAAD,OAAA;AACA,IAAAE,iBAAA,GAAAF,OAAA;AACA,IAAAG,WAAA,GAAAH,OAAA;AACA,IAAAI,UAAA,GAAAJ,OAAA;AACA,IAAAK,8BAAA,GAAAL,OAAA;AAEO,MAAMM,8BAA8B,GAAIC,OAAmB,IAAW;EACzEA,OAAO,CAACC,GAAG,CAACC,aAAa,CAACC,0BAA0B,CAACC,SAAS,CAAC,OAAO;IAAEF;EAAc,CAAC,KAAK;IACxF,MAAMG,OAAO,GAAG,MAAAA,CAAA,KAAY;MACxB,IAAIH,aAAa,CAACI,KAAK,CAACC,MAAM,KAAK,CAAC,EAAE;QAClC;MACJ;MACA,MAAM,CAACC,IAAI,CAAC,GAAGN,aAAa,CAACI,KAAK;MAClC,IAAI,CAACE,IAAI,EAAEC,EAAE,EAAE;QACX;MACJ;MACA,MAAMC,QAAQ,GAAG,MAAM,IAAAC,iBAAS,EAACX,OAAO,CAAC;MACzC,IAAI,CAACU,QAAQ,EAAE;QACX;MACJ;MAEA,MAAME,gBAAgB,GAAG,IAAAC,wCAAsB,EAAC;QAC5CC,OAAO,EAAEJ,QAAQ,CAACK,MAAM;QACxBC,eAAe,EAAEd,aAAa,CAACO,EAAE;QACjCQ,MAAM,EAAET,IAAI,CAACC;MACjB,CAAC,CAAC;MACF,IAAI,CAACG,gBAAgB,EAAE;QACnB;MACJ;;MAEA;AACZ;AACA;MACY,MAAMM,QAAQ,GAAG,MAAMlB,OAAO,CAACC,GAAG,CAACiB,QAAQ,CAACC,GAAG,CAACjB,aAAa,CAACkB,UAAU,CAAC;MACzE,IAAI,CAACF,QAAQ,EAAE;QACX,MAAM,IAAIG,cAAW,CAChB,iCAAgCnB,aAAa,CAACkB,UAAW,IAAG,EAC7D,oBAAoB,EACpB;UACIA,UAAU,EAAElB,aAAa,CAACkB;QAC9B,CACJ,CAAC;MACL;MAEA,MAAME,UAAU,GAAG,IAAAC,4BAAgB,EAAC;QAChCC,OAAO,EAAExB,OAAO,CAACwB,OAAO;QACxBV,OAAO,EAAEJ,QAAQ,CAACK,MAAM;QACxBb,aAAa;QACbgB;MACJ,CAAC,CAAC;MACF,IAAI,CAACI,UAAU,EAAE;QACb;MACJ;MAEA,MAAMG,SAAS,GAAG,MAAM,IAAAC,yBAAc,EAAC;QACnC1B,OAAO;QACPkB,QAAQ;QACRS,OAAO,EAAE,CAACzB,aAAa,CAAC0B,SAAS,CAACnB,EAAE;MACxC,CAAC,CAAC;MACF,IAAIgB,SAAS,CAAClB,MAAM,KAAK,CAAC,EAAE;QACxB;MACJ;MAEA,IAAI;QACA,MAAM,IAAAsB,4DAA6B,EAAC;UAChC7B,OAAO;UACPyB,SAAS;UACTvB,aAAa;UACbgB,QAAQ;UACRN,gBAAgB;UAChBU;QACJ,CAAC,CAAC;MACN,CAAC,CAAC,OAAOQ,EAAE,EAAE;QACT,MAAM,IAAIT,cAAW,CAChB,8CAA6C,EAC9C,uCAAuC,EACvC;UACID,UAAU,EAAEF,QAAQ,CAACT,EAAE;UACvBO,eAAe,EAAEd,aAAa,CAACO,EAAE;UACjCG,gBAAgB;UAChBU,UAAU;UACVS,KAAK,EAAE;YACHC,OAAO,EAAEF,EAAE,CAACE,OAAO;YACnBC,IAAI,EAAEH,EAAE,CAACG,IAAI;YACbC,IAAI,EAAEJ,EAAE,CAACI,IAAI;YACbC,KAAK,EAAEL,EAAE,CAACK;UACd;QACJ,CACJ,CAAC;MACL;IACJ,CAAC;IAED,MAAMnC,OAAO,CAACoC,QAAQ,CAACC,oBAAoB,CAAC,YAAY;MACpD,OAAOhC,OAAO,CAAC,CAAC;IACpB,CAAC,CAAC;EACN,CAAC,CAAC;AACN,CAAC;AAACiC,OAAA,CAAAvC,8BAAA,GAAAA,8BAAA"}
@@ -0,0 +1,7 @@
1
+ interface Params {
2
+ baseUrl?: string;
3
+ contentReviewId: string;
4
+ stepId: string;
5
+ }
6
+ export declare const createContentReviewUrl: (params: Params) => string | null;
7
+ export {};
@@ -0,0 +1,28 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.createContentReviewUrl = void 0;
7
+ const createContentReviewUrl = params => {
8
+ /**
9
+ * All variables must exist for URL to be created.
10
+ * We go through all vars and throw a log if it does not exist.
11
+ */
12
+ for (const key in params) {
13
+ if (!!key) {
14
+ continue;
15
+ }
16
+ console.log(`Missing variable "${key}", which we use to create a comment URL.`);
17
+ return null;
18
+ }
19
+ const {
20
+ baseUrl,
21
+ contentReviewId,
22
+ stepId
23
+ } = params;
24
+ return `${baseUrl}/apw/content-reviews/${contentReviewId}/${stepId}`;
25
+ };
26
+ exports.createContentReviewUrl = createContentReviewUrl;
27
+
28
+ //# sourceMappingURL=contentReviewUrl.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["createContentReviewUrl","params","key","console","log","baseUrl","contentReviewId","stepId","exports"],"sources":["contentReviewUrl.ts"],"sourcesContent":["interface Params {\n baseUrl?: string;\n contentReviewId: string;\n stepId: string;\n}\nexport const createContentReviewUrl = (params: Params) => {\n /**\n * All variables must exist for URL to be created.\n * We go through all vars and throw a log if it does not exist.\n */\n for (const key in params) {\n if (!!key) {\n continue;\n }\n console.log(`Missing variable \"${key}\", which we use to create a comment URL.`);\n return null;\n }\n const { baseUrl, contentReviewId, stepId } = params;\n\n return `${baseUrl}/apw/content-reviews/${contentReviewId}/${stepId}`;\n};\n"],"mappings":";;;;;;AAKO,MAAMA,sBAAsB,GAAIC,MAAc,IAAK;EACtD;AACJ;AACA;AACA;EACI,KAAK,MAAMC,GAAG,IAAID,MAAM,EAAE;IACtB,IAAI,CAAC,CAACC,GAAG,EAAE;MACP;IACJ;IACAC,OAAO,CAACC,GAAG,CAAE,qBAAoBF,GAAI,0CAAyC,CAAC;IAC/E,OAAO,IAAI;EACf;EACA,MAAM;IAAEG,OAAO;IAAEC,eAAe;IAAEC;EAAO,CAAC,GAAGN,MAAM;EAEnD,OAAQ,GAAEI,OAAQ,wBAAuBC,eAAgB,IAAGC,MAAO,EAAC;AACxE,CAAC;AAACC,OAAA,CAAAR,sBAAA,GAAAA,sBAAA"}
@@ -0,0 +1,7 @@
1
+ import { PluginsContainer } from "@webiny/plugins";
2
+ import { ApwContentUrlPluginCbParams } from "../../../ApwContentUrlPlugin";
3
+ interface Params extends ApwContentUrlPluginCbParams {
4
+ plugins: PluginsContainer;
5
+ }
6
+ export declare const createContentUrl: (params: Params) => string | null;
7
+ export {};
@@ -0,0 +1,26 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.createContentUrl = void 0;
7
+ var _ApwContentUrlPlugin = require("../../../ApwContentUrlPlugin");
8
+ const createContentUrl = params => {
9
+ const {
10
+ plugins,
11
+ contentReview
12
+ } = params;
13
+ const {
14
+ type: contentType
15
+ } = contentReview.content;
16
+ const [contentUrlPlugin] = plugins.byType(_ApwContentUrlPlugin.ApwContentUrlPlugin.type).filter(plugin => {
17
+ return plugin.canUse(contentType);
18
+ }).reverse();
19
+ if (!contentUrlPlugin) {
20
+ return null;
21
+ }
22
+ return contentUrlPlugin.create(params);
23
+ };
24
+ exports.createContentUrl = createContentUrl;
25
+
26
+ //# sourceMappingURL=contentUrl.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_ApwContentUrlPlugin","require","createContentUrl","params","plugins","contentReview","type","contentType","content","contentUrlPlugin","byType","ApwContentUrlPlugin","filter","plugin","canUse","reverse","create","exports"],"sources":["contentUrl.ts"],"sourcesContent":["import { PluginsContainer } from \"@webiny/plugins\";\nimport { ApwContentUrlPlugin, ApwContentUrlPluginCbParams } from \"~/ApwContentUrlPlugin\";\n\ninterface Params extends ApwContentUrlPluginCbParams {\n plugins: PluginsContainer;\n}\n\nexport const createContentUrl = (params: Params): string | null => {\n const { plugins, contentReview } = params;\n\n const { type: contentType } = contentReview.content;\n\n const [contentUrlPlugin] = plugins\n .byType<ApwContentUrlPlugin>(ApwContentUrlPlugin.type)\n .filter(plugin => {\n return plugin.canUse(contentType);\n })\n .reverse();\n if (!contentUrlPlugin) {\n return null;\n }\n\n return contentUrlPlugin.create(params);\n};\n"],"mappings":";;;;;;AACA,IAAAA,oBAAA,GAAAC,OAAA;AAMO,MAAMC,gBAAgB,GAAIC,MAAc,IAAoB;EAC/D,MAAM;IAAEC,OAAO;IAAEC;EAAc,CAAC,GAAGF,MAAM;EAEzC,MAAM;IAAEG,IAAI,EAAEC;EAAY,CAAC,GAAGF,aAAa,CAACG,OAAO;EAEnD,MAAM,CAACC,gBAAgB,CAAC,GAAGL,OAAO,CAC7BM,MAAM,CAAsBC,wCAAmB,CAACL,IAAI,CAAC,CACrDM,MAAM,CAACC,MAAM,IAAI;IACd,OAAOA,MAAM,CAACC,MAAM,CAACP,WAAW,CAAC;EACrC,CAAC,CAAC,CACDQ,OAAO,CAAC,CAAC;EACd,IAAI,CAACN,gBAAgB,EAAE;IACnB,OAAO,IAAI;EACf;EAEA,OAAOA,gBAAgB,CAACO,MAAM,CAACb,MAAM,CAAC;AAC1C,CAAC;AAACc,OAAA,CAAAf,gBAAA,GAAAA,gBAAA"}
@@ -0,0 +1,11 @@
1
+ import { ApwContentTypes, ApwContext } from "../../../types";
2
+ import { ApwChangeRequestNotification } from "../../../ApwChangeRequestNotification";
3
+ interface GetLastChangeRequestNotificationPluginParams {
4
+ context: ApwContext;
5
+ type: ApwContentTypes;
6
+ }
7
+ interface GetLastChangeRequestNotificationPlugin {
8
+ (params: GetLastChangeRequestNotificationPluginParams): ApwChangeRequestNotification | undefined;
9
+ }
10
+ export declare const getLastChangeRequestNotificationPlugin: GetLastChangeRequestNotificationPlugin;
11
+ export {};
@@ -0,0 +1,23 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.getLastChangeRequestNotificationPlugin = void 0;
7
+ var _ApwChangeRequestNotification = require("../../../ApwChangeRequestNotification");
8
+ const getLastChangeRequestNotificationPlugin = params => {
9
+ const {
10
+ context,
11
+ type
12
+ } = params;
13
+ /**
14
+ * We need the plugin to create the notification text.
15
+ */
16
+ const plugins = context.plugins.byType(_ApwChangeRequestNotification.ApwChangeRequestNotification.type).filter(plugin => {
17
+ return plugin.canUse(type);
18
+ });
19
+ return plugins.shift();
20
+ };
21
+ exports.getLastChangeRequestNotificationPlugin = getLastChangeRequestNotificationPlugin;
22
+
23
+ //# sourceMappingURL=lastChangeRequestNotificationPlugin.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_ApwChangeRequestNotification","require","getLastChangeRequestNotificationPlugin","params","context","type","plugins","byType","ApwChangeRequestNotification","filter","plugin","canUse","shift","exports"],"sources":["lastChangeRequestNotificationPlugin.ts"],"sourcesContent":["import { ApwContentTypes, ApwContext } from \"~/types\";\nimport { ApwChangeRequestNotification } from \"~/ApwChangeRequestNotification\";\n\ninterface GetLastChangeRequestNotificationPluginParams {\n context: ApwContext;\n type: ApwContentTypes;\n}\ninterface GetLastChangeRequestNotificationPlugin {\n (params: GetLastChangeRequestNotificationPluginParams):\n | ApwChangeRequestNotification\n | undefined;\n}\nexport const getLastChangeRequestNotificationPlugin: GetLastChangeRequestNotificationPlugin =\n params => {\n const { context, type } = params;\n /**\n * We need the plugin to create the notification text.\n */\n const plugins = context.plugins\n .byType<ApwChangeRequestNotification>(ApwChangeRequestNotification.type)\n .filter(plugin => {\n return plugin.canUse(type);\n });\n\n return plugins.shift();\n };\n"],"mappings":";;;;;;AACA,IAAAA,6BAAA,GAAAC,OAAA;AAWO,MAAMC,sCAA8E,GACvFC,MAAM,IAAI;EACN,MAAM;IAAEC,OAAO;IAAEC;EAAK,CAAC,GAAGF,MAAM;EAChC;AACR;AACA;EACQ,MAAMG,OAAO,GAAGF,OAAO,CAACE,OAAO,CAC1BC,MAAM,CAA+BC,0DAA4B,CAACH,IAAI,CAAC,CACvEI,MAAM,CAACC,MAAM,IAAI;IACd,OAAOA,MAAM,CAACC,MAAM,CAACN,IAAI,CAAC;EAC9B,CAAC,CAAC;EAEN,OAAOC,OAAO,CAACM,KAAK,CAAC,CAAC;AAC1B,CAAC;AAACC,OAAA,CAAAX,sCAAA,GAAAA,sCAAA"}
@@ -0,0 +1,11 @@
1
+ import { ApwContentTypes, ApwContext } from "../../../types";
2
+ import { ApwCommentNotification } from "../../../ApwCommentNotification";
3
+ interface GetLastCommentNotificationPluginParams {
4
+ context: ApwContext;
5
+ type: ApwContentTypes;
6
+ }
7
+ interface GetLastCommentNotificationPlugin {
8
+ (params: GetLastCommentNotificationPluginParams): ApwCommentNotification | undefined;
9
+ }
10
+ export declare const getLastCommentNotificationPlugin: GetLastCommentNotificationPlugin;
11
+ export {};
@@ -0,0 +1,23 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.getLastCommentNotificationPlugin = void 0;
7
+ var _ApwCommentNotification = require("../../../ApwCommentNotification");
8
+ const getLastCommentNotificationPlugin = params => {
9
+ const {
10
+ context,
11
+ type
12
+ } = params;
13
+ /**
14
+ * We need the plugin to create the notification text.
15
+ */
16
+ const plugins = context.plugins.byType(_ApwCommentNotification.ApwCommentNotification.type).filter(plugin => {
17
+ return plugin.canUse(type);
18
+ });
19
+ return plugins.shift();
20
+ };
21
+ exports.getLastCommentNotificationPlugin = getLastCommentNotificationPlugin;
22
+
23
+ //# sourceMappingURL=lastCommentNotificationPlugin.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_ApwCommentNotification","require","getLastCommentNotificationPlugin","params","context","type","plugins","byType","ApwCommentNotification","filter","plugin","canUse","shift","exports"],"sources":["lastCommentNotificationPlugin.ts"],"sourcesContent":["import { ApwContentTypes, ApwContext } from \"~/types\";\nimport { ApwCommentNotification } from \"~/ApwCommentNotification\";\n\ninterface GetLastCommentNotificationPluginParams {\n context: ApwContext;\n type: ApwContentTypes;\n}\ninterface GetLastCommentNotificationPlugin {\n (params: GetLastCommentNotificationPluginParams): ApwCommentNotification | undefined;\n}\nexport const getLastCommentNotificationPlugin: GetLastCommentNotificationPlugin = params => {\n const { context, type } = params;\n /**\n * We need the plugin to create the notification text.\n */\n const plugins = context.plugins\n .byType<ApwCommentNotification>(ApwCommentNotification.type)\n .filter(plugin => {\n return plugin.canUse(type);\n });\n\n return plugins.shift();\n};\n"],"mappings":";;;;;;AACA,IAAAA,uBAAA,GAAAC,OAAA;AASO,MAAMC,gCAAkE,GAAGC,MAAM,IAAI;EACxF,MAAM;IAAEC,OAAO;IAAEC;EAAK,CAAC,GAAGF,MAAM;EAChC;AACJ;AACA;EACI,MAAMG,OAAO,GAAGF,OAAO,CAACE,OAAO,CAC1BC,MAAM,CAAyBC,8CAAsB,CAACH,IAAI,CAAC,CAC3DI,MAAM,CAACC,MAAM,IAAI;IACd,OAAOA,MAAM,CAACC,MAAM,CAACN,IAAI,CAAC;EAC9B,CAAC,CAAC;EAEN,OAAOC,OAAO,CAACM,KAAK,CAAC,CAAC;AAC1B,CAAC;AAACC,OAAA,CAAAX,gCAAA,GAAAA,gCAAA"}
@@ -0,0 +1,11 @@
1
+ import { ApwContentTypes, ApwContext } from "../../../types";
2
+ import { ApwContentReviewNotification } from "../../../ApwContentReviewNotification";
3
+ interface GetLastContentReviewNotificationPluginParams {
4
+ context: ApwContext;
5
+ type: ApwContentTypes;
6
+ }
7
+ interface GetLastContentReviewNotificationPlugin {
8
+ (params: GetLastContentReviewNotificationPluginParams): ApwContentReviewNotification | undefined;
9
+ }
10
+ export declare const getLastContentReviewNotificationPlugin: GetLastContentReviewNotificationPlugin;
11
+ export {};
@@ -0,0 +1,23 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.getLastContentReviewNotificationPlugin = void 0;
7
+ var _ApwContentReviewNotification = require("../../../ApwContentReviewNotification");
8
+ const getLastContentReviewNotificationPlugin = params => {
9
+ const {
10
+ context,
11
+ type
12
+ } = params;
13
+ /**
14
+ * We need the plugin to create the notification text.
15
+ */
16
+ const plugins = context.plugins.byType(_ApwContentReviewNotification.ApwContentReviewNotification.type).filter(plugin => {
17
+ return plugin.canUse(type);
18
+ });
19
+ return plugins.shift();
20
+ };
21
+ exports.getLastContentReviewNotificationPlugin = getLastContentReviewNotificationPlugin;
22
+
23
+ //# sourceMappingURL=lastContentReviewNotificationPlugin.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_ApwContentReviewNotification","require","getLastContentReviewNotificationPlugin","params","context","type","plugins","byType","ApwContentReviewNotification","filter","plugin","canUse","shift","exports"],"sources":["lastContentReviewNotificationPlugin.ts"],"sourcesContent":["import { ApwContentTypes, ApwContext } from \"~/types\";\nimport { ApwContentReviewNotification } from \"~/ApwContentReviewNotification\";\n\ninterface GetLastContentReviewNotificationPluginParams {\n context: ApwContext;\n type: ApwContentTypes;\n}\ninterface GetLastContentReviewNotificationPlugin {\n (params: GetLastContentReviewNotificationPluginParams):\n | ApwContentReviewNotification\n | undefined;\n}\nexport const getLastContentReviewNotificationPlugin: GetLastContentReviewNotificationPlugin =\n params => {\n const { context, type } = params;\n /**\n * We need the plugin to create the notification text.\n */\n const plugins = context.plugins\n .byType<ApwContentReviewNotification>(ApwContentReviewNotification.type)\n .filter(plugin => {\n return plugin.canUse(type);\n });\n\n return plugins.shift();\n };\n"],"mappings":";;;;;;AACA,IAAAA,6BAAA,GAAAC,OAAA;AAWO,MAAMC,sCAA8E,GACvFC,MAAM,IAAI;EACN,MAAM;IAAEC,OAAO;IAAEC;EAAK,CAAC,GAAGF,MAAM;EAChC;AACR;AACA;EACQ,MAAMG,OAAO,GAAGF,OAAO,CAACE,OAAO,CAC1BC,MAAM,CAA+BC,0DAA4B,CAACH,IAAI,CAAC,CACvEI,MAAM,CAACC,MAAM,IAAI;IACd,OAAOA,MAAM,CAACC,MAAM,CAACN,IAAI,CAAC;EAC9B,CAAC,CAAC;EAEN,OAAOC,OAAO,CAACM,KAAK,CAAC,CAAC;AAC1B,CAAC;AAACC,OAAA,CAAAX,sCAAA,GAAAA,sCAAA"}
@@ -0,0 +1,15 @@
1
+ import { ApwContext, ApwReviewerWithEmail, ApwWorkflow, ApwWorkflowStep } from "../../../types";
2
+ interface GetReviewerIdListParams {
3
+ steps: ApwWorkflowStep[];
4
+ }
5
+ interface GetReviewerIdList {
6
+ (params: GetReviewerIdListParams): string[];
7
+ }
8
+ export declare const getReviewerIdList: GetReviewerIdList;
9
+ interface FetchReviewersParams {
10
+ context: ApwContext;
11
+ workflow: ApwWorkflow;
12
+ exclude: string[];
13
+ }
14
+ export declare const fetchReviewers: (params: FetchReviewersParams) => Promise<ApwReviewerWithEmail[]>;
15
+ export {};
@@ -0,0 +1,47 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.getReviewerIdList = exports.fetchReviewers = void 0;
7
+ const getReviewerIdList = ({
8
+ steps
9
+ }) => {
10
+ return steps.reduce((collection, step) => {
11
+ for (const reviewer of step.reviewers) {
12
+ if (collection.includes(reviewer.id)) {
13
+ return collection;
14
+ }
15
+ collection.push(reviewer.id);
16
+ }
17
+ return collection;
18
+ }, []);
19
+ };
20
+ exports.getReviewerIdList = getReviewerIdList;
21
+ const fetchReviewers = async params => {
22
+ const {
23
+ context,
24
+ workflow,
25
+ exclude
26
+ } = params;
27
+ const idList = getReviewerIdList(workflow);
28
+ return context.security.withoutAuthorization(async () => {
29
+ const [reviewers] = await context.apw.reviewer.list({
30
+ where: {
31
+ id_in: idList
32
+ },
33
+ limit: 10000
34
+ });
35
+ return reviewers.filter(item => {
36
+ if (!item.email) {
37
+ return false;
38
+ } else if (exclude.includes(item.identityId)) {
39
+ return false;
40
+ }
41
+ return true;
42
+ });
43
+ });
44
+ };
45
+ exports.fetchReviewers = fetchReviewers;
46
+
47
+ //# sourceMappingURL=reviewers.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["getReviewerIdList","steps","reduce","collection","step","reviewer","reviewers","includes","id","push","exports","fetchReviewers","params","context","workflow","exclude","idList","security","withoutAuthorization","apw","list","where","id_in","limit","filter","item","email","identityId"],"sources":["reviewers.ts"],"sourcesContent":["import { ApwContext, ApwReviewerWithEmail, ApwWorkflow, ApwWorkflowStep } from \"~/types\";\n\ninterface GetReviewerIdListParams {\n steps: ApwWorkflowStep[];\n}\n\ninterface GetReviewerIdList {\n (params: GetReviewerIdListParams): string[];\n}\n\nexport const getReviewerIdList: GetReviewerIdList = ({ steps }) => {\n return steps.reduce<string[]>((collection, step) => {\n for (const reviewer of step.reviewers) {\n if (collection.includes(reviewer.id)) {\n return collection;\n }\n collection.push(reviewer.id);\n }\n\n return collection;\n }, []);\n};\n\ninterface FetchReviewersParams {\n context: ApwContext;\n workflow: ApwWorkflow;\n exclude: string[];\n}\n\nexport const fetchReviewers = async (\n params: FetchReviewersParams\n): Promise<ApwReviewerWithEmail[]> => {\n const { context, workflow, exclude } = params;\n\n const idList = getReviewerIdList(workflow);\n\n return context.security.withoutAuthorization(async () => {\n const [reviewers] = await context.apw.reviewer.list({\n where: {\n id_in: idList\n },\n limit: 10000\n });\n return reviewers.filter((item): item is ApwReviewerWithEmail => {\n if (!item.email) {\n return false;\n } else if (exclude.includes(item.identityId)) {\n return false;\n }\n\n return true;\n });\n });\n};\n"],"mappings":";;;;;;AAUO,MAAMA,iBAAoC,GAAGA,CAAC;EAAEC;AAAM,CAAC,KAAK;EAC/D,OAAOA,KAAK,CAACC,MAAM,CAAW,CAACC,UAAU,EAAEC,IAAI,KAAK;IAChD,KAAK,MAAMC,QAAQ,IAAID,IAAI,CAACE,SAAS,EAAE;MACnC,IAAIH,UAAU,CAACI,QAAQ,CAACF,QAAQ,CAACG,EAAE,CAAC,EAAE;QAClC,OAAOL,UAAU;MACrB;MACAA,UAAU,CAACM,IAAI,CAACJ,QAAQ,CAACG,EAAE,CAAC;IAChC;IAEA,OAAOL,UAAU;EACrB,CAAC,EAAE,EAAE,CAAC;AACV,CAAC;AAACO,OAAA,CAAAV,iBAAA,GAAAA,iBAAA;AAQK,MAAMW,cAAc,GAAG,MAC1BC,MAA4B,IACM;EAClC,MAAM;IAAEC,OAAO;IAAEC,QAAQ;IAAEC;EAAQ,CAAC,GAAGH,MAAM;EAE7C,MAAMI,MAAM,GAAGhB,iBAAiB,CAACc,QAAQ,CAAC;EAE1C,OAAOD,OAAO,CAACI,QAAQ,CAACC,oBAAoB,CAAC,YAAY;IACrD,MAAM,CAACZ,SAAS,CAAC,GAAG,MAAMO,OAAO,CAACM,GAAG,CAACd,QAAQ,CAACe,IAAI,CAAC;MAChDC,KAAK,EAAE;QACHC,KAAK,EAAEN;MACX,CAAC;MACDO,KAAK,EAAE;IACX,CAAC,CAAC;IACF,OAAOjB,SAAS,CAACkB,MAAM,CAAEC,IAAI,IAAmC;MAC5D,IAAI,CAACA,IAAI,CAACC,KAAK,EAAE;QACb,OAAO,KAAK;MAChB,CAAC,MAAM,IAAIX,OAAO,CAACR,QAAQ,CAACkB,IAAI,CAACE,UAAU,CAAC,EAAE;QAC1C,OAAO,KAAK;MAChB;MAEA,OAAO,IAAI;IACf,CAAC,CAAC;EACN,CAAC,CAAC;AACN,CAAC;AAACjB,OAAA,CAAAC,cAAA,GAAAA,cAAA"}
@@ -0,0 +1,2 @@
1
+ import { ApwChangeRequestNotificationCbParams } from "../../../ApwChangeRequestNotification";
2
+ export declare const sendChangeRequestNotification: (params: ApwChangeRequestNotificationCbParams) => Promise<void>;
@@ -0,0 +1,43 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.sendChangeRequestNotification = void 0;
7
+ var _lastChangeRequestNotificationPlugin = require("./lastChangeRequestNotificationPlugin");
8
+ const sendChangeRequestNotification = async params => {
9
+ const {
10
+ context,
11
+ reviewers,
12
+ contentReview
13
+ } = params;
14
+ if (reviewers.length === 0) {
15
+ return;
16
+ }
17
+ const changeRequestPlugin = (0, _lastChangeRequestNotificationPlugin.getLastChangeRequestNotificationPlugin)({
18
+ context,
19
+ type: contentReview.content.type
20
+ });
21
+ if (!changeRequestPlugin) {
22
+ console.log("No e-mail body change request plugin.");
23
+ return;
24
+ }
25
+ const body = changeRequestPlugin.create(params);
26
+ if (!body) {
27
+ console.log(`No e-mail body from the change request plugin: ${changeRequestPlugin.name}`);
28
+ return;
29
+ }
30
+ const result = await context.mailer.sendMail({
31
+ bcc: reviewers.map(r => r.email),
32
+ subject: "There is a new change request on the Content Review you are assigned on.",
33
+ text: body.text,
34
+ html: body.html || body.text
35
+ });
36
+ if (!result.error) {
37
+ return;
38
+ }
39
+ console.log("Error while sending e-mail", JSON.stringify(result.error));
40
+ };
41
+ exports.sendChangeRequestNotification = sendChangeRequestNotification;
42
+
43
+ //# sourceMappingURL=sendChangeRequestNotification.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_lastChangeRequestNotificationPlugin","require","sendChangeRequestNotification","params","context","reviewers","contentReview","length","changeRequestPlugin","getLastChangeRequestNotificationPlugin","type","content","console","log","body","create","name","result","mailer","sendMail","bcc","map","r","email","subject","text","html","error","JSON","stringify","exports"],"sources":["sendChangeRequestNotification.ts"],"sourcesContent":["import { getLastChangeRequestNotificationPlugin } from \"./lastChangeRequestNotificationPlugin\";\nimport { ApwChangeRequestNotificationCbParams } from \"~/ApwChangeRequestNotification\";\n\nexport const sendChangeRequestNotification = async (\n params: ApwChangeRequestNotificationCbParams\n): Promise<void> => {\n const { context, reviewers, contentReview } = params;\n if (reviewers.length === 0) {\n return;\n }\n\n const changeRequestPlugin = getLastChangeRequestNotificationPlugin({\n context,\n type: contentReview.content.type\n });\n if (!changeRequestPlugin) {\n console.log(\"No e-mail body change request plugin.\");\n return;\n }\n\n const body = changeRequestPlugin.create(params);\n if (!body) {\n console.log(`No e-mail body from the change request plugin: ${changeRequestPlugin.name}`);\n return;\n }\n\n const result = await context.mailer.sendMail({\n bcc: reviewers.map(r => r.email),\n subject: \"There is a new change request on the Content Review you are assigned on.\",\n text: body.text,\n html: body.html || body.text\n });\n if (!result.error) {\n return;\n }\n console.log(\"Error while sending e-mail\", JSON.stringify(result.error));\n};\n"],"mappings":";;;;;;AAAA,IAAAA,oCAAA,GAAAC,OAAA;AAGO,MAAMC,6BAA6B,GAAG,MACzCC,MAA4C,IAC5B;EAChB,MAAM;IAAEC,OAAO;IAAEC,SAAS;IAAEC;EAAc,CAAC,GAAGH,MAAM;EACpD,IAAIE,SAAS,CAACE,MAAM,KAAK,CAAC,EAAE;IACxB;EACJ;EAEA,MAAMC,mBAAmB,GAAG,IAAAC,2EAAsC,EAAC;IAC/DL,OAAO;IACPM,IAAI,EAAEJ,aAAa,CAACK,OAAO,CAACD;EAChC,CAAC,CAAC;EACF,IAAI,CAACF,mBAAmB,EAAE;IACtBI,OAAO,CAACC,GAAG,CAAC,uCAAuC,CAAC;IACpD;EACJ;EAEA,MAAMC,IAAI,GAAGN,mBAAmB,CAACO,MAAM,CAACZ,MAAM,CAAC;EAC/C,IAAI,CAACW,IAAI,EAAE;IACPF,OAAO,CAACC,GAAG,CAAE,kDAAiDL,mBAAmB,CAACQ,IAAK,EAAC,CAAC;IACzF;EACJ;EAEA,MAAMC,MAAM,GAAG,MAAMb,OAAO,CAACc,MAAM,CAACC,QAAQ,CAAC;IACzCC,GAAG,EAAEf,SAAS,CAACgB,GAAG,CAACC,CAAC,IAAIA,CAAC,CAACC,KAAK,CAAC;IAChCC,OAAO,EAAE,0EAA0E;IACnFC,IAAI,EAAEX,IAAI,CAACW,IAAI;IACfC,IAAI,EAAEZ,IAAI,CAACY,IAAI,IAAIZ,IAAI,CAACW;EAC5B,CAAC,CAAC;EACF,IAAI,CAACR,MAAM,CAACU,KAAK,EAAE;IACf;EACJ;EACAf,OAAO,CAACC,GAAG,CAAC,4BAA4B,EAAEe,IAAI,CAACC,SAAS,CAACZ,MAAM,CAACU,KAAK,CAAC,CAAC;AAC3E,CAAC;AAACG,OAAA,CAAA5B,6BAAA,GAAAA,6BAAA"}
@@ -0,0 +1,2 @@
1
+ import { ApwCommentNotificationCbParams } from "../../../ApwCommentNotification";
2
+ export declare const sendCommentNotification: (params: ApwCommentNotificationCbParams) => Promise<void>;
@@ -0,0 +1,43 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.sendCommentNotification = void 0;
7
+ var _lastCommentNotificationPlugin = require("./lastCommentNotificationPlugin");
8
+ const sendCommentNotification = async params => {
9
+ const {
10
+ context,
11
+ reviewers,
12
+ contentReview
13
+ } = params;
14
+ if (reviewers.length === 0) {
15
+ return;
16
+ }
17
+ const commentPlugin = (0, _lastCommentNotificationPlugin.getLastCommentNotificationPlugin)({
18
+ context,
19
+ type: contentReview.content.type
20
+ });
21
+ if (!commentPlugin) {
22
+ console.log("No e-mail body comment plugin.");
23
+ return;
24
+ }
25
+ const body = commentPlugin.create(params);
26
+ if (!body) {
27
+ console.log(`No e-mail body from the comment plugin: ${commentPlugin.name}`);
28
+ return;
29
+ }
30
+ const result = await context.mailer.sendMail({
31
+ bcc: reviewers.map(r => r.email),
32
+ subject: "There is a new comment on the Content Review you are assigned on.",
33
+ text: body.text,
34
+ html: body.html || body.text
35
+ });
36
+ if (!result.error) {
37
+ return;
38
+ }
39
+ console.log("Error while sending e-mail", JSON.stringify(result.error));
40
+ };
41
+ exports.sendCommentNotification = sendCommentNotification;
42
+
43
+ //# sourceMappingURL=sendCommentNotification.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_lastCommentNotificationPlugin","require","sendCommentNotification","params","context","reviewers","contentReview","length","commentPlugin","getLastCommentNotificationPlugin","type","content","console","log","body","create","name","result","mailer","sendMail","bcc","map","r","email","subject","text","html","error","JSON","stringify","exports"],"sources":["sendCommentNotification.ts"],"sourcesContent":["import { getLastCommentNotificationPlugin } from \"./lastCommentNotificationPlugin\";\nimport { ApwCommentNotificationCbParams } from \"~/ApwCommentNotification\";\n\nexport const sendCommentNotification = async (\n params: ApwCommentNotificationCbParams\n): Promise<void> => {\n const { context, reviewers, contentReview } = params;\n if (reviewers.length === 0) {\n return;\n }\n\n const commentPlugin = getLastCommentNotificationPlugin({\n context,\n type: contentReview.content.type\n });\n if (!commentPlugin) {\n console.log(\"No e-mail body comment plugin.\");\n return;\n }\n\n const body = commentPlugin.create(params);\n if (!body) {\n console.log(`No e-mail body from the comment plugin: ${commentPlugin.name}`);\n return;\n }\n\n const result = await context.mailer.sendMail({\n bcc: reviewers.map(r => r.email),\n subject: \"There is a new comment on the Content Review you are assigned on.\",\n text: body.text,\n html: body.html || body.text\n });\n if (!result.error) {\n return;\n }\n console.log(\"Error while sending e-mail\", JSON.stringify(result.error));\n};\n"],"mappings":";;;;;;AAAA,IAAAA,8BAAA,GAAAC,OAAA;AAGO,MAAMC,uBAAuB,GAAG,MACnCC,MAAsC,IACtB;EAChB,MAAM;IAAEC,OAAO;IAAEC,SAAS;IAAEC;EAAc,CAAC,GAAGH,MAAM;EACpD,IAAIE,SAAS,CAACE,MAAM,KAAK,CAAC,EAAE;IACxB;EACJ;EAEA,MAAMC,aAAa,GAAG,IAAAC,+DAAgC,EAAC;IACnDL,OAAO;IACPM,IAAI,EAAEJ,aAAa,CAACK,OAAO,CAACD;EAChC,CAAC,CAAC;EACF,IAAI,CAACF,aAAa,EAAE;IAChBI,OAAO,CAACC,GAAG,CAAC,gCAAgC,CAAC;IAC7C;EACJ;EAEA,MAAMC,IAAI,GAAGN,aAAa,CAACO,MAAM,CAACZ,MAAM,CAAC;EACzC,IAAI,CAACW,IAAI,EAAE;IACPF,OAAO,CAACC,GAAG,CAAE,2CAA0CL,aAAa,CAACQ,IAAK,EAAC,CAAC;IAC5E;EACJ;EAEA,MAAMC,MAAM,GAAG,MAAMb,OAAO,CAACc,MAAM,CAACC,QAAQ,CAAC;IACzCC,GAAG,EAAEf,SAAS,CAACgB,GAAG,CAACC,CAAC,IAAIA,CAAC,CAACC,KAAK,CAAC;IAChCC,OAAO,EAAE,mEAAmE;IAC5EC,IAAI,EAAEX,IAAI,CAACW,IAAI;IACfC,IAAI,EAAEZ,IAAI,CAACY,IAAI,IAAIZ,IAAI,CAACW;EAC5B,CAAC,CAAC;EACF,IAAI,CAACR,MAAM,CAACU,KAAK,EAAE;IACf;EACJ;EACAf,OAAO,CAACC,GAAG,CAAC,4BAA4B,EAAEe,IAAI,CAACC,SAAS,CAACZ,MAAM,CAACU,KAAK,CAAC,CAAC;AAC3E,CAAC;AAACG,OAAA,CAAA5B,uBAAA,GAAAA,uBAAA"}
@@ -0,0 +1,2 @@
1
+ import { ApwContentReviewNotificationCbParams } from "../../../ApwContentReviewNotification";
2
+ export declare const sendContentReviewNotification: (params: ApwContentReviewNotificationCbParams) => Promise<void>;
@@ -0,0 +1,43 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.sendContentReviewNotification = void 0;
7
+ var _lastContentReviewNotificationPlugin = require("./lastContentReviewNotificationPlugin");
8
+ const sendContentReviewNotification = async params => {
9
+ const {
10
+ context,
11
+ reviewers,
12
+ contentReview
13
+ } = params;
14
+ if (reviewers.length === 0) {
15
+ return;
16
+ }
17
+ const contentReviewPlugin = (0, _lastContentReviewNotificationPlugin.getLastContentReviewNotificationPlugin)({
18
+ context,
19
+ type: contentReview.content.type
20
+ });
21
+ if (!contentReviewPlugin) {
22
+ console.log("No e-mail body content review plugin.");
23
+ return;
24
+ }
25
+ const body = contentReviewPlugin.create(params);
26
+ if (!body) {
27
+ console.log(`No e-mail body from the content review plugin: ${contentReviewPlugin.name}`);
28
+ return;
29
+ }
30
+ const result = await context.mailer.sendMail({
31
+ bcc: reviewers.map(r => r.email),
32
+ subject: "There is a new content review which you are assigned on.",
33
+ text: body.text,
34
+ html: body.html || body.text
35
+ });
36
+ if (!result.error) {
37
+ return;
38
+ }
39
+ console.log("Error while sending e-mail", JSON.stringify(result.error));
40
+ };
41
+ exports.sendContentReviewNotification = sendContentReviewNotification;
42
+
43
+ //# sourceMappingURL=sendContentReviewNotification.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_lastContentReviewNotificationPlugin","require","sendContentReviewNotification","params","context","reviewers","contentReview","length","contentReviewPlugin","getLastContentReviewNotificationPlugin","type","content","console","log","body","create","name","result","mailer","sendMail","bcc","map","r","email","subject","text","html","error","JSON","stringify","exports"],"sources":["sendContentReviewNotification.ts"],"sourcesContent":["import { getLastContentReviewNotificationPlugin } from \"./lastContentReviewNotificationPlugin\";\nimport { ApwContentReviewNotificationCbParams } from \"~/ApwContentReviewNotification\";\n\nexport const sendContentReviewNotification = async (\n params: ApwContentReviewNotificationCbParams\n): Promise<void> => {\n const { context, reviewers, contentReview } = params;\n if (reviewers.length === 0) {\n return;\n }\n\n const contentReviewPlugin = getLastContentReviewNotificationPlugin({\n context,\n type: contentReview.content.type\n });\n if (!contentReviewPlugin) {\n console.log(\"No e-mail body content review plugin.\");\n return;\n }\n\n const body = contentReviewPlugin.create(params);\n if (!body) {\n console.log(`No e-mail body from the content review plugin: ${contentReviewPlugin.name}`);\n return;\n }\n\n const result = await context.mailer.sendMail({\n bcc: reviewers.map(r => r.email),\n subject: \"There is a new content review which you are assigned on.\",\n text: body.text,\n html: body.html || body.text\n });\n if (!result.error) {\n return;\n }\n console.log(\"Error while sending e-mail\", JSON.stringify(result.error));\n};\n"],"mappings":";;;;;;AAAA,IAAAA,oCAAA,GAAAC,OAAA;AAGO,MAAMC,6BAA6B,GAAG,MACzCC,MAA4C,IAC5B;EAChB,MAAM;IAAEC,OAAO;IAAEC,SAAS;IAAEC;EAAc,CAAC,GAAGH,MAAM;EACpD,IAAIE,SAAS,CAACE,MAAM,KAAK,CAAC,EAAE;IACxB;EACJ;EAEA,MAAMC,mBAAmB,GAAG,IAAAC,2EAAsC,EAAC;IAC/DL,OAAO;IACPM,IAAI,EAAEJ,aAAa,CAACK,OAAO,CAACD;EAChC,CAAC,CAAC;EACF,IAAI,CAACF,mBAAmB,EAAE;IACtBI,OAAO,CAACC,GAAG,CAAC,uCAAuC,CAAC;IACpD;EACJ;EAEA,MAAMC,IAAI,GAAGN,mBAAmB,CAACO,MAAM,CAACZ,MAAM,CAAC;EAC/C,IAAI,CAACW,IAAI,EAAE;IACPF,OAAO,CAACC,GAAG,CAAE,kDAAiDL,mBAAmB,CAACQ,IAAK,EAAC,CAAC;IACzF;EACJ;EAEA,MAAMC,MAAM,GAAG,MAAMb,OAAO,CAACc,MAAM,CAACC,QAAQ,CAAC;IACzCC,GAAG,EAAEf,SAAS,CAACgB,GAAG,CAACC,CAAC,IAAIA,CAAC,CAACC,KAAK,CAAC;IAChCC,OAAO,EAAE,0DAA0D;IACnEC,IAAI,EAAEX,IAAI,CAACW,IAAI;IACfC,IAAI,EAAEZ,IAAI,CAACY,IAAI,IAAIZ,IAAI,CAACW;EAC5B,CAAC,CAAC;EACF,IAAI,CAACR,MAAM,CAACU,KAAK,EAAE;IACf;EACJ;EACAf,OAAO,CAACC,GAAG,CAAC,4BAA4B,EAAEe,IAAI,CAACC,SAAS,CAACZ,MAAM,CAACU,KAAK,CAAC,CAAC;AAC3E,CAAC;AAACG,OAAA,CAAA5B,6BAAA,GAAAA,6BAAA"}