@webiny/api-apw 0.0.0-unstable.5e7233243f

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 (229) hide show
  1. package/ContentApwSettingsPlugin.d.ts +10 -0
  2. package/ContentApwSettingsPlugin.js +17 -0
  3. package/ContentApwSettingsPlugin.js.map +1 -0
  4. package/LICENSE +21 -0
  5. package/README.md +34 -0
  6. package/crud/createChangeRequestMethods.d.ts +2 -0
  7. package/crud/createChangeRequestMethods.js +95 -0
  8. package/crud/createChangeRequestMethods.js.map +1 -0
  9. package/crud/createCommentMethods.d.ts +2 -0
  10. package/crud/createCommentMethods.js +96 -0
  11. package/crud/createCommentMethods.js.map +1 -0
  12. package/crud/createContentReviewMethods.d.ts +10 -0
  13. package/crud/createContentReviewMethods.js +552 -0
  14. package/crud/createContentReviewMethods.js.map +1 -0
  15. package/crud/createReviewerMethods.d.ts +2 -0
  16. package/crud/createReviewerMethods.js +96 -0
  17. package/crud/createReviewerMethods.js.map +1 -0
  18. package/crud/createWorkflowMethods.d.ts +2 -0
  19. package/crud/createWorkflowMethods.js +96 -0
  20. package/crud/createWorkflowMethods.js.map +1 -0
  21. package/crud/index.d.ts +2 -0
  22. package/crud/index.js +100 -0
  23. package/crud/index.js.map +1 -0
  24. package/crud/utils.d.ts +21 -0
  25. package/crud/utils.js +142 -0
  26. package/crud/utils.js.map +1 -0
  27. package/index.d.ts +4 -0
  28. package/index.js +34 -0
  29. package/index.js.map +1 -0
  30. package/package.json +75 -0
  31. package/plugins/cms/CmsEntryApwSettingsGetterPlugin.d.ts +10 -0
  32. package/plugins/cms/CmsEntryApwSettingsGetterPlugin.js +51 -0
  33. package/plugins/cms/CmsEntryApwSettingsGetterPlugin.js.map +1 -0
  34. package/plugins/cms/README.md +49 -0
  35. package/plugins/cms/apwEntryPlugins.d.ts +8 -0
  36. package/plugins/cms/apwEntryPlugins.js +50 -0
  37. package/plugins/cms/apwEntryPlugins.js.map +1 -0
  38. package/plugins/cms/index.d.ts +12 -0
  39. package/plugins/cms/index.js +37 -0
  40. package/plugins/cms/index.js.map +1 -0
  41. package/plugins/cms/linkContentReviewToEntry.d.ts +8 -0
  42. package/plugins/cms/linkContentReviewToEntry.js +108 -0
  43. package/plugins/cms/linkContentReviewToEntry.js.map +1 -0
  44. package/plugins/cms/linkWorkflowToEntry.d.ts +8 -0
  45. package/plugins/cms/linkWorkflowToEntry.js +166 -0
  46. package/plugins/cms/linkWorkflowToEntry.js.map +1 -0
  47. package/plugins/cms/triggerContentReview.d.ts +8 -0
  48. package/plugins/cms/triggerContentReview.js +59 -0
  49. package/plugins/cms/triggerContentReview.js.map +1 -0
  50. package/plugins/cms/updateContentReviewStatus.d.ts +10 -0
  51. package/plugins/cms/updateContentReviewStatus.js +101 -0
  52. package/plugins/cms/updateContentReviewStatus.js.map +1 -0
  53. package/plugins/cms/utils.d.ts +27 -0
  54. package/plugins/cms/utils.js +211 -0
  55. package/plugins/cms/utils.js.map +1 -0
  56. package/plugins/context.d.ts +5 -0
  57. package/plugins/context.js +146 -0
  58. package/plugins/context.js.map +1 -0
  59. package/plugins/graphql/changeRequest.gql.d.ts +4 -0
  60. package/plugins/graphql/changeRequest.gql.js +155 -0
  61. package/plugins/graphql/changeRequest.gql.js.map +1 -0
  62. package/plugins/graphql/comment.gql.d.ts +4 -0
  63. package/plugins/graphql/comment.gql.js +160 -0
  64. package/plugins/graphql/comment.gql.js.map +1 -0
  65. package/plugins/graphql/contentReview.gql.d.ts +4 -0
  66. package/plugins/graphql/contentReview.gql.js +382 -0
  67. package/plugins/graphql/contentReview.gql.js.map +1 -0
  68. package/plugins/graphql/reviewer.gql.d.ts +4 -0
  69. package/plugins/graphql/reviewer.gql.js +114 -0
  70. package/plugins/graphql/reviewer.gql.js.map +1 -0
  71. package/plugins/graphql/workflow.gql.d.ts +4 -0
  72. package/plugins/graphql/workflow.gql.js +205 -0
  73. package/plugins/graphql/workflow.gql.js.map +1 -0
  74. package/plugins/graphql.d.ts +4 -0
  75. package/plugins/graphql.js +95 -0
  76. package/plugins/graphql.js.map +1 -0
  77. package/plugins/hooks/createReviewerFromIdentity.d.ts +2 -0
  78. package/plugins/hooks/createReviewerFromIdentity.js +62 -0
  79. package/plugins/hooks/createReviewerFromIdentity.js.map +1 -0
  80. package/plugins/hooks/deleteChangeRequestsAfterContentReview.d.ts +2 -0
  81. package/plugins/hooks/deleteChangeRequestsAfterContentReview.js +67 -0
  82. package/plugins/hooks/deleteChangeRequestsAfterContentReview.js.map +1 -0
  83. package/plugins/hooks/deleteCommentsAfterChangeRequest.d.ts +2 -0
  84. package/plugins/hooks/deleteCommentsAfterChangeRequest.js +59 -0
  85. package/plugins/hooks/deleteCommentsAfterChangeRequest.js.map +1 -0
  86. package/plugins/hooks/index.d.ts +3 -0
  87. package/plugins/hooks/index.js +68 -0
  88. package/plugins/hooks/index.js.map +1 -0
  89. package/plugins/hooks/initializeContentReviewSteps.d.ts +2 -0
  90. package/plugins/hooks/initializeContentReviewSteps.js +89 -0
  91. package/plugins/hooks/initializeContentReviewSteps.js.map +1 -0
  92. package/plugins/hooks/updatePendingChangeRequests.d.ts +2 -0
  93. package/plugins/hooks/updatePendingChangeRequests.js +98 -0
  94. package/plugins/hooks/updatePendingChangeRequests.js.map +1 -0
  95. package/plugins/hooks/updateTotalComments.d.ts +3 -0
  96. package/plugins/hooks/updateTotalComments.js +157 -0
  97. package/plugins/hooks/updateTotalComments.js.map +1 -0
  98. package/plugins/hooks/validateChangeRequest.d.ts +2 -0
  99. package/plugins/hooks/validateChangeRequest.js +64 -0
  100. package/plugins/hooks/validateChangeRequest.js.map +1 -0
  101. package/plugins/hooks/validateComment.d.ts +2 -0
  102. package/plugins/hooks/validateComment.js +47 -0
  103. package/plugins/hooks/validateComment.js.map +1 -0
  104. package/plugins/hooks/validateContentReview.d.ts +2 -0
  105. package/plugins/hooks/validateContentReview.js +38 -0
  106. package/plugins/hooks/validateContentReview.js.map +1 -0
  107. package/plugins/pageBuilder/PageApwSettingsGetterPlugin.d.ts +9 -0
  108. package/plugins/pageBuilder/PageApwSettingsGetterPlugin.js +51 -0
  109. package/plugins/pageBuilder/PageApwSettingsGetterPlugin.js.map +1 -0
  110. package/plugins/pageBuilder/apwContentPagePlugins.d.ts +3 -0
  111. package/plugins/pageBuilder/apwContentPagePlugins.js +30 -0
  112. package/plugins/pageBuilder/apwContentPagePlugins.js.map +1 -0
  113. package/plugins/pageBuilder/extendPbPageSettingsSchema.d.ts +3 -0
  114. package/plugins/pageBuilder/extendPbPageSettingsSchema.js +25 -0
  115. package/plugins/pageBuilder/extendPbPageSettingsSchema.js.map +1 -0
  116. package/plugins/pageBuilder/index.d.ts +11 -0
  117. package/plugins/pageBuilder/index.js +45 -0
  118. package/plugins/pageBuilder/index.js.map +1 -0
  119. package/plugins/pageBuilder/linkContentReviewToPage.d.ts +8 -0
  120. package/plugins/pageBuilder/linkContentReviewToPage.js +93 -0
  121. package/plugins/pageBuilder/linkContentReviewToPage.js.map +1 -0
  122. package/plugins/pageBuilder/linkWorkflowToPage.d.ts +8 -0
  123. package/plugins/pageBuilder/linkWorkflowToPage.js +182 -0
  124. package/plugins/pageBuilder/linkWorkflowToPage.js.map +1 -0
  125. package/plugins/pageBuilder/triggerContentReview.d.ts +8 -0
  126. package/plugins/pageBuilder/triggerContentReview.js +50 -0
  127. package/plugins/pageBuilder/triggerContentReview.js.map +1 -0
  128. package/plugins/pageBuilder/updateContentReviewStatus.d.ts +10 -0
  129. package/plugins/pageBuilder/updateContentReviewStatus.js +83 -0
  130. package/plugins/pageBuilder/updateContentReviewStatus.js.map +1 -0
  131. package/plugins/pageBuilder/utils.d.ts +22 -0
  132. package/plugins/pageBuilder/utils.js +184 -0
  133. package/plugins/pageBuilder/utils.js.map +1 -0
  134. package/plugins/utils.d.ts +35 -0
  135. package/plugins/utils.js +197 -0
  136. package/plugins/utils.js.map +1 -0
  137. package/scheduler/createScheduleActionMethods.d.ts +2 -0
  138. package/scheduler/createScheduleActionMethods.js +146 -0
  139. package/scheduler/createScheduleActionMethods.js.map +1 -0
  140. package/scheduler/handlers/executeAction/index.d.ts +13 -0
  141. package/scheduler/handlers/executeAction/index.js +172 -0
  142. package/scheduler/handlers/executeAction/index.js.map +1 -0
  143. package/scheduler/handlers/executeAction/plugins/ApplicationGraphQL.d.ts +13 -0
  144. package/scheduler/handlers/executeAction/plugins/ApplicationGraphQL.js +17 -0
  145. package/scheduler/handlers/executeAction/plugins/ApplicationGraphQL.js.map +1 -0
  146. package/scheduler/handlers/executeAction/plugins/HeadlessCMSGraphQL.d.ts +11 -0
  147. package/scheduler/handlers/executeAction/plugins/HeadlessCMSGraphQL.js +126 -0
  148. package/scheduler/handlers/executeAction/plugins/HeadlessCMSGraphQL.js.map +1 -0
  149. package/scheduler/handlers/executeAction/plugins/PageBuilderGraphQL.d.ts +11 -0
  150. package/scheduler/handlers/executeAction/plugins/PageBuilderGraphQL.js +163 -0
  151. package/scheduler/handlers/executeAction/plugins/PageBuilderGraphQL.js.map +1 -0
  152. package/scheduler/handlers/executeAction/security.d.ts +4 -0
  153. package/scheduler/handlers/executeAction/security.js +68 -0
  154. package/scheduler/handlers/executeAction/security.js.map +1 -0
  155. package/scheduler/handlers/scheduleAction/index.d.ts +22 -0
  156. package/scheduler/handlers/scheduleAction/index.js +165 -0
  157. package/scheduler/handlers/scheduleAction/index.js.map +1 -0
  158. package/scheduler/handlers/scheduleAction/scheduleAction.utils.d.ts +24 -0
  159. package/scheduler/handlers/scheduleAction/scheduleAction.utils.js +176 -0
  160. package/scheduler/handlers/scheduleAction/scheduleAction.utils.js.map +1 -0
  161. package/scheduler/handlers/utils.d.ts +33 -0
  162. package/scheduler/handlers/utils.js +168 -0
  163. package/scheduler/handlers/utils.js.map +1 -0
  164. package/scheduler/index.d.ts +2 -0
  165. package/scheduler/index.js +27 -0
  166. package/scheduler/index.js.map +1 -0
  167. package/scheduler/types.d.ts +171 -0
  168. package/scheduler/types.js +34 -0
  169. package/scheduler/types.js.map +1 -0
  170. package/storageOperations/changeRequestStorageOperations.d.ts +3 -0
  171. package/storageOperations/changeRequestStorageOperations.js +126 -0
  172. package/storageOperations/changeRequestStorageOperations.js.map +1 -0
  173. package/storageOperations/commentStorageOperations.d.ts +3 -0
  174. package/storageOperations/commentStorageOperations.js +142 -0
  175. package/storageOperations/commentStorageOperations.js.map +1 -0
  176. package/storageOperations/contentReviewStorageOperations.d.ts +3 -0
  177. package/storageOperations/contentReviewStorageOperations.js +97 -0
  178. package/storageOperations/contentReviewStorageOperations.js.map +1 -0
  179. package/storageOperations/index.d.ts +15 -0
  180. package/storageOperations/index.js +52 -0
  181. package/storageOperations/index.js.map +1 -0
  182. package/storageOperations/models/changeRequest.model.d.ts +3 -0
  183. package/storageOperations/models/changeRequest.model.js +59 -0
  184. package/storageOperations/models/changeRequest.model.js.map +1 -0
  185. package/storageOperations/models/comment.model.d.ts +7 -0
  186. package/storageOperations/models/comment.model.js +60 -0
  187. package/storageOperations/models/comment.model.js.map +1 -0
  188. package/storageOperations/models/contentModelPluginFactory.d.ts +15 -0
  189. package/storageOperations/models/contentModelPluginFactory.js +32 -0
  190. package/storageOperations/models/contentModelPluginFactory.js.map +1 -0
  191. package/storageOperations/models/contentReview.model.d.ts +7 -0
  192. package/storageOperations/models/contentReview.model.js +257 -0
  193. package/storageOperations/models/contentReview.model.js.map +1 -0
  194. package/storageOperations/models/index.d.ts +2 -0
  195. package/storageOperations/models/index.js +115 -0
  196. package/storageOperations/models/index.js.map +1 -0
  197. package/storageOperations/models/reviewer.model.d.ts +3 -0
  198. package/storageOperations/models/reviewer.model.js +55 -0
  199. package/storageOperations/models/reviewer.model.js.map +1 -0
  200. package/storageOperations/models/utils.d.ts +3 -0
  201. package/storageOperations/models/utils.js +36 -0
  202. package/storageOperations/models/utils.js.map +1 -0
  203. package/storageOperations/models/workflow.model.d.ts +12 -0
  204. package/storageOperations/models/workflow.model.js +208 -0
  205. package/storageOperations/models/workflow.model.js.map +1 -0
  206. package/storageOperations/reviewerStorageOperations.d.ts +3 -0
  207. package/storageOperations/reviewerStorageOperations.js +93 -0
  208. package/storageOperations/reviewerStorageOperations.js.map +1 -0
  209. package/storageOperations/types.d.ts +34 -0
  210. package/storageOperations/types.js +5 -0
  211. package/storageOperations/types.js.map +1 -0
  212. package/storageOperations/workflowStorageOperations.d.ts +3 -0
  213. package/storageOperations/workflowStorageOperations.js +115 -0
  214. package/storageOperations/workflowStorageOperations.js.map +1 -0
  215. package/types.d.ts +737 -0
  216. package/types.js +69 -0
  217. package/types.js.map +1 -0
  218. package/utils/contentApwSettingsPlugin.d.ts +9 -0
  219. package/utils/contentApwSettingsPlugin.js +26 -0
  220. package/utils/contentApwSettingsPlugin.js.map +1 -0
  221. package/utils/errors.d.ts +16 -0
  222. package/utils/errors.js +75 -0
  223. package/utils/errors.js.map +1 -0
  224. package/utils/fieldResolver.d.ts +16 -0
  225. package/utils/fieldResolver.js +60 -0
  226. package/utils/fieldResolver.js.map +1 -0
  227. package/utils/resolve.d.ts +3 -0
  228. package/utils/resolve.js +18 -0
  229. package/utils/resolve.js.map +1 -0
@@ -0,0 +1,96 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.createReviewerMethods = createReviewerMethods;
7
+
8
+ var _pubsub = require("@webiny/pubsub");
9
+
10
+ function createReviewerMethods({
11
+ storageOperations
12
+ }) {
13
+ const onBeforeReviewerCreate = (0, _pubsub.createTopic)();
14
+ const onAfterReviewerCreate = (0, _pubsub.createTopic)();
15
+ const onBeforeReviewerUpdate = (0, _pubsub.createTopic)();
16
+ const onAfterReviewerUpdate = (0, _pubsub.createTopic)();
17
+ const onBeforeReviewerDelete = (0, _pubsub.createTopic)();
18
+ const onAfterReviewerDelete = (0, _pubsub.createTopic)();
19
+ return {
20
+ /**
21
+ * Lifecycle events
22
+ */
23
+ onBeforeReviewerCreate,
24
+ onAfterReviewerCreate,
25
+ onBeforeReviewerUpdate,
26
+ onAfterReviewerUpdate,
27
+ onBeforeReviewerDelete,
28
+ onAfterReviewerDelete,
29
+
30
+ async get(id) {
31
+ return storageOperations.getReviewer({
32
+ id
33
+ });
34
+ },
35
+
36
+ async list(params) {
37
+ return storageOperations.listReviewers(params);
38
+ },
39
+
40
+ async create(data) {
41
+ await onBeforeReviewerCreate.publish({
42
+ input: data
43
+ });
44
+ const reviewer = await storageOperations.createReviewer({
45
+ data
46
+ });
47
+ await onAfterReviewerCreate.publish({
48
+ reviewer
49
+ });
50
+ return reviewer;
51
+ },
52
+
53
+ async update(id, data) {
54
+ const original = await storageOperations.getReviewer({
55
+ id
56
+ });
57
+ await onBeforeReviewerUpdate.publish({
58
+ original,
59
+ input: {
60
+ id,
61
+ data
62
+ }
63
+ });
64
+ const reviewer = await storageOperations.updateReviewer({
65
+ id,
66
+ data
67
+ });
68
+ await onAfterReviewerUpdate.publish({
69
+ original,
70
+ input: {
71
+ id,
72
+ data
73
+ },
74
+ reviewer
75
+ });
76
+ return reviewer;
77
+ },
78
+
79
+ async delete(id) {
80
+ const reviewer = await storageOperations.getReviewer({
81
+ id
82
+ });
83
+ await onBeforeReviewerDelete.publish({
84
+ reviewer
85
+ });
86
+ await storageOperations.deleteReviewer({
87
+ id
88
+ });
89
+ await onAfterReviewerDelete.publish({
90
+ reviewer
91
+ });
92
+ return true;
93
+ }
94
+
95
+ };
96
+ }
@@ -0,0 +1 @@
1
+ {"version":3,"names":["createReviewerMethods","storageOperations","onBeforeReviewerCreate","createTopic","onAfterReviewerCreate","onBeforeReviewerUpdate","onAfterReviewerUpdate","onBeforeReviewerDelete","onAfterReviewerDelete","get","id","getReviewer","list","params","listReviewers","create","data","publish","input","reviewer","createReviewer","update","original","updateReviewer","delete","deleteReviewer"],"sources":["createReviewerMethods.ts"],"sourcesContent":["import {\n ApwReviewerCrud,\n CreateApwParams,\n OnAfterReviewerCreateTopicParams,\n OnAfterReviewerDeleteTopicParams,\n OnAfterReviewerUpdateTopicParams,\n OnBeforeReviewerCreateTopicParams,\n OnBeforeReviewerDeleteTopicParams,\n OnBeforeReviewerUpdateTopicParams\n} from \"~/types\";\nimport { createTopic } from \"@webiny/pubsub\";\n\nexport function createReviewerMethods({ storageOperations }: CreateApwParams): ApwReviewerCrud {\n const onBeforeReviewerCreate = createTopic<OnBeforeReviewerCreateTopicParams>();\n const onAfterReviewerCreate = createTopic<OnAfterReviewerCreateTopicParams>();\n const onBeforeReviewerUpdate = createTopic<OnBeforeReviewerUpdateTopicParams>();\n const onAfterReviewerUpdate = createTopic<OnAfterReviewerUpdateTopicParams>();\n const onBeforeReviewerDelete = createTopic<OnBeforeReviewerDeleteTopicParams>();\n const onAfterReviewerDelete = createTopic<OnAfterReviewerDeleteTopicParams>();\n return {\n /**\n * Lifecycle events\n */\n onBeforeReviewerCreate,\n onAfterReviewerCreate,\n onBeforeReviewerUpdate,\n onAfterReviewerUpdate,\n onBeforeReviewerDelete,\n onAfterReviewerDelete,\n async get(id) {\n return storageOperations.getReviewer({ id });\n },\n async list(params) {\n return storageOperations.listReviewers(params);\n },\n async create(data) {\n await onBeforeReviewerCreate.publish({ input: data });\n\n const reviewer = await storageOperations.createReviewer({ data });\n\n await onAfterReviewerCreate.publish({ reviewer });\n\n return reviewer;\n },\n async update(id, data) {\n const original = await storageOperations.getReviewer({ id });\n\n await onBeforeReviewerUpdate.publish({ original, input: { id, data } });\n\n const reviewer = await storageOperations.updateReviewer({ id, data });\n\n await onAfterReviewerUpdate.publish({ original, input: { id, data }, reviewer });\n\n return reviewer;\n },\n async delete(id: string) {\n const reviewer = await storageOperations.getReviewer({ id });\n\n await onBeforeReviewerDelete.publish({ reviewer });\n\n await storageOperations.deleteReviewer({ id });\n\n await onAfterReviewerDelete.publish({ reviewer });\n\n return true;\n }\n };\n}\n"],"mappings":";;;;;;;AAUA;;AAEO,SAASA,qBAAT,CAA+B;EAAEC;AAAF,CAA/B,EAAwF;EAC3F,MAAMC,sBAAsB,GAAG,IAAAC,mBAAA,GAA/B;EACA,MAAMC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,CAAjC,CAAvB;MAEA,MAAMV,qBAAqB,CAACW,OAAtB,CAA8B;QAAEK,QAAF;QAAYJ,KAAK,EAAE;UAAER,EAAF;UAAMM;QAAN,CAAnB;QAAiCG;MAAjC,CAA9B,CAAN;MAEA,OAAOA,QAAP;IACH,CAnCE;;IAoCH,MAAMK,MAAN,CAAad,EAAb,EAAyB;MACrB,MAAMS,QAAQ,GAAG,MAAMlB,iBAAiB,CAACU,WAAlB,CAA8B;QAAED;MAAF,CAA9B,CAAvB;MAEA,MAAMH,sBAAsB,CAACU,OAAvB,CAA+B;QAAEE;MAAF,CAA/B,CAAN;MAEA,MAAMlB,iBAAiB,CAACwB,cAAlB,CAAiC;QAAEf;MAAF,CAAjC,CAAN;MAEA,MAAMF,qBAAqB,CAACS,OAAtB,CAA8B;QAAEE;MAAF,CAA9B,CAAN;MAEA,OAAO,IAAP;IACH;;EA9CE,CAAP;AAgDH"}
@@ -0,0 +1,2 @@
1
+ import { ApwWorkflowCrud, CreateApwParams } from "../types";
2
+ export declare function createWorkflowMethods({ storageOperations }: CreateApwParams): ApwWorkflowCrud;
@@ -0,0 +1,96 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.createWorkflowMethods = createWorkflowMethods;
7
+
8
+ var _pubsub = require("@webiny/pubsub");
9
+
10
+ function createWorkflowMethods({
11
+ storageOperations
12
+ }) {
13
+ const onBeforeWorkflowCreate = (0, _pubsub.createTopic)();
14
+ const onAfterWorkflowCreate = (0, _pubsub.createTopic)();
15
+ const onBeforeWorkflowUpdate = (0, _pubsub.createTopic)();
16
+ const onAfterWorkflowUpdate = (0, _pubsub.createTopic)();
17
+ const onBeforeWorkflowDelete = (0, _pubsub.createTopic)();
18
+ const onAfterWorkflowDelete = (0, _pubsub.createTopic)();
19
+ return {
20
+ /**
21
+ * Lifecycle events
22
+ */
23
+ onBeforeWorkflowCreate,
24
+ onAfterWorkflowCreate,
25
+ onBeforeWorkflowUpdate,
26
+ onAfterWorkflowUpdate,
27
+ onBeforeWorkflowDelete,
28
+ onAfterWorkflowDelete,
29
+
30
+ async get(id) {
31
+ return storageOperations.getWorkflow({
32
+ id
33
+ });
34
+ },
35
+
36
+ async list(params) {
37
+ return storageOperations.listWorkflows(params);
38
+ },
39
+
40
+ async create(data) {
41
+ await onBeforeWorkflowCreate.publish({
42
+ input: data
43
+ });
44
+ const workflow = await storageOperations.createWorkflow({
45
+ data
46
+ });
47
+ await onAfterWorkflowCreate.publish({
48
+ workflow
49
+ });
50
+ return workflow;
51
+ },
52
+
53
+ async update(id, data) {
54
+ const original = await storageOperations.getWorkflow({
55
+ id
56
+ });
57
+ await onBeforeWorkflowUpdate.publish({
58
+ original,
59
+ input: {
60
+ id,
61
+ data
62
+ }
63
+ });
64
+ const workflow = await storageOperations.updateWorkflow({
65
+ id,
66
+ data
67
+ });
68
+ await onAfterWorkflowUpdate.publish({
69
+ original,
70
+ input: {
71
+ id,
72
+ data
73
+ },
74
+ workflow
75
+ });
76
+ return workflow;
77
+ },
78
+
79
+ async delete(id) {
80
+ const workflow = await storageOperations.getWorkflow({
81
+ id
82
+ });
83
+ await onBeforeWorkflowDelete.publish({
84
+ workflow
85
+ });
86
+ await storageOperations.deleteWorkflow({
87
+ id
88
+ });
89
+ await onAfterWorkflowDelete.publish({
90
+ workflow
91
+ });
92
+ return true;
93
+ }
94
+
95
+ };
96
+ }
@@ -0,0 +1 @@
1
+ {"version":3,"names":["createWorkflowMethods","storageOperations","onBeforeWorkflowCreate","createTopic","onAfterWorkflowCreate","onBeforeWorkflowUpdate","onAfterWorkflowUpdate","onBeforeWorkflowDelete","onAfterWorkflowDelete","get","id","getWorkflow","list","params","listWorkflows","create","data","publish","input","workflow","createWorkflow","update","original","updateWorkflow","delete","deleteWorkflow"],"sources":["createWorkflowMethods.ts"],"sourcesContent":["import {\n ApwWorkflowCrud,\n CreateApwParams,\n OnAfterWorkflowCreateTopicParams,\n OnAfterWorkflowDeleteTopicParams,\n OnAfterWorkflowUpdateTopicParams,\n OnBeforeWorkflowCreateTopicParams,\n OnBeforeWorkflowDeleteTopicParams,\n OnBeforeWorkflowUpdateTopicParams\n} from \"~/types\";\nimport { createTopic } from \"@webiny/pubsub\";\n\nexport function createWorkflowMethods({ storageOperations }: CreateApwParams): ApwWorkflowCrud {\n const onBeforeWorkflowCreate = createTopic<OnBeforeWorkflowCreateTopicParams>();\n const onAfterWorkflowCreate = createTopic<OnAfterWorkflowCreateTopicParams>();\n const onBeforeWorkflowUpdate = createTopic<OnBeforeWorkflowUpdateTopicParams>();\n const onAfterWorkflowUpdate = createTopic<OnAfterWorkflowUpdateTopicParams>();\n const onBeforeWorkflowDelete = createTopic<OnBeforeWorkflowDeleteTopicParams>();\n const onAfterWorkflowDelete = createTopic<OnAfterWorkflowDeleteTopicParams>();\n return {\n /**\n * Lifecycle events\n */\n onBeforeWorkflowCreate,\n onAfterWorkflowCreate,\n onBeforeWorkflowUpdate,\n onAfterWorkflowUpdate,\n onBeforeWorkflowDelete,\n onAfterWorkflowDelete,\n async get(id) {\n return storageOperations.getWorkflow({ id });\n },\n async list(params) {\n return storageOperations.listWorkflows(params);\n },\n async create(data) {\n await onBeforeWorkflowCreate.publish({ input: data });\n\n const workflow = await storageOperations.createWorkflow({ data });\n\n await onAfterWorkflowCreate.publish({ workflow });\n\n return workflow;\n },\n async update(id, data) {\n const original = await storageOperations.getWorkflow({ id });\n\n await onBeforeWorkflowUpdate.publish({ original, input: { id, data } });\n\n const workflow = await storageOperations.updateWorkflow({ id, data });\n\n await onAfterWorkflowUpdate.publish({ original, input: { id, data }, workflow });\n\n return workflow;\n },\n async delete(id: string) {\n const workflow = await storageOperations.getWorkflow({ id });\n\n await onBeforeWorkflowDelete.publish({ workflow });\n\n await storageOperations.deleteWorkflow({ id });\n\n await onAfterWorkflowDelete.publish({ workflow });\n\n return true;\n }\n };\n}\n"],"mappings":";;;;;;;AAUA;;AAEO,SAASA,qBAAT,CAA+B;EAAEC;AA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G,QAAQ,GAAG,MAAMlB,iBAAiB,CAACsB,cAAlB,CAAiC;QAAEb,EAAF;QAAMM;MAAN,CAAjC,CAAvB;MAEA,MAAMV,qBAAqB,CAACW,OAAtB,CAA8B;QAAEK,QAAF;QAAYJ,KAAK,EAAE;UAAER,EAAF;UAAMM;QAAN,CAAnB;QAAiCG;MAAjC,CAA9B,CAAN;MAEA,OAAOA,QAAP;IACH,CAnCE;;IAoCH,MAAMK,MAAN,CAAad,EAAb,EAAyB;MACrB,MAAMS,QAAQ,GAAG,MAAMlB,iBAAiB,CAACU,WAAlB,CAA8B;QAAED;MAAF,CAA9B,CAAvB;MAEA,MAAMH,sBAAsB,CAACU,OAAvB,CAA+B;QAAEE;MAAF,CAA/B,CAAN;MAEA,MAAMlB,iBAAiB,CAACwB,cAAlB,CAAiC;QAAEf;MAAF,CAAjC,CAAN;MAEA,MAAMF,qBAAqB,CAACS,OAAtB,CAA8B;QAAEE;MAAF,CAA9B,CAAN;MAEA,OAAO,IAAP;IACH;;EA9CE,CAAP;AAgDH"}
@@ -0,0 +1,2 @@
1
+ import { AdvancedPublishingWorkflow, CreateApwParams } from "../types";
2
+ export declare const createApw: (params: CreateApwParams) => AdvancedPublishingWorkflow;
package/crud/index.js ADDED
@@ -0,0 +1,100 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+
5
+ Object.defineProperty(exports, "__esModule", {
6
+ value: true
7
+ });
8
+ exports.createApw = void 0;
9
+
10
+ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
11
+
12
+ var _createWorkflowMethods = require("./createWorkflowMethods");
13
+
14
+ var _createReviewerMethods = require("./createReviewerMethods");
15
+
16
+ var _createCommentMethods = require("./createCommentMethods");
17
+
18
+ var _createChangeRequestMethods = require("./createChangeRequestMethods");
19
+
20
+ var _createContentReviewMethods = require("./createContentReviewMethods");
21
+
22
+ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
23
+
24
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
25
+
26
+ const createApw = params => {
27
+ const contentGetters = new Map();
28
+ const contentPublisher = new Map();
29
+ const contentUnPublisher = new Map();
30
+ const workflowMethods = (0, _createWorkflowMethods.createWorkflowMethods)(params);
31
+ const reviewerMethods = (0, _createReviewerMethods.createReviewerMethods)(params);
32
+ const changeRequestMethods = (0, _createChangeRequestMethods.createChangeRequestMethods)(params);
33
+
34
+ function getContentGetter(type) {
35
+ const getter = contentGetters.get(type);
36
+
37
+ if (!getter) {
38
+ throw new Error(`No "ContentGetter" loader found for type: "${type}". You must define a loader.`);
39
+ }
40
+
41
+ return getter;
42
+ }
43
+
44
+ function getContentUnPublisher(type) {
45
+ const getter = contentUnPublisher.get(type);
46
+
47
+ if (!getter) {
48
+ throw new Error(`No "Content UnPublisher" loader found for type: "${type}". You must define a loader.`);
49
+ }
50
+
51
+ return getter;
52
+ }
53
+
54
+ function getContentPublisher(type) {
55
+ const getter = contentPublisher.get(type);
56
+
57
+ if (!getter) {
58
+ throw new Error(`No "ContentPublisher" loader found for type: "${type}". You must define a loader.`);
59
+ }
60
+
61
+ return getter;
62
+ }
63
+
64
+ return {
65
+ addContentPublisher(type, func) {
66
+ contentPublisher.set(type, func);
67
+ },
68
+
69
+ getContentPublisher,
70
+
71
+ addContentGetter(type, func) {
72
+ contentGetters.set(type, func);
73
+ },
74
+
75
+ getContentGetter,
76
+
77
+ addContentUnPublisher(type, func) {
78
+ contentUnPublisher.set(type, func);
79
+ },
80
+
81
+ getContentUnPublisher,
82
+ workflow: workflowMethods,
83
+ reviewer: reviewerMethods,
84
+ changeRequest: changeRequestMethods,
85
+ comment: (0, _createCommentMethods.createCommentMethods)(params),
86
+ contentReview: (0, _createContentReviewMethods.createContentReviewMethods)(_objectSpread(_objectSpread({}, params), {}, {
87
+ getReviewer: reviewerMethods.get.bind(reviewerMethods),
88
+ getContentGetter,
89
+ getContentPublisher,
90
+ getContentUnPublisher
91
+ })),
92
+
93
+ /**
94
+ * Add scheduler to context so that we can access it later. For example, during testing.
95
+ */
96
+ scheduleAction: params.scheduler
97
+ };
98
+ };
99
+
100
+ exports.createApw = createApw;
@@ -0,0 +1 @@
1
+ {"version":3,"names":["createApw","params","contentGetters","Map","contentPublisher","contentUnPublisher","workflowMethods","createWorkflowMethods","reviewerMethods","createReviewerMethods","changeRequestMethods","createChangeRequestMethods","getContentGetter","type","getter","get","Error","getContentUnPublisher","getContentPublisher","addContentPublisher","func","set","addContentGetter","addContentUnPublisher","workflow","reviewer","changeRequest","comment","createCommentMethods","contentReview","createContentReviewMethods","getReviewer","bind","scheduleAction","scheduler"],"sources":["index.ts"],"sourcesContent":["import { createWorkflowMethods } from \"./createWorkflowMethods\";\nimport { createReviewerMethods } from \"./createReviewerMethods\";\nimport { createCommentMethods } from \"./createCommentMethods\";\nimport { createChangeRequestMethods } from \"./createChangeRequestMethods\";\nimport { createContentReviewMethods } from \"./createContentReviewMethods\";\nimport {\n AdvancedPublishingWorkflow,\n ApwContentTypes,\n ContentGetter,\n ContentPublisher,\n ContentUnPublisher,\n CreateApwParams\n} from \"~/types\";\n\nexport const createApw = (params: CreateApwParams): AdvancedPublishingWorkflow => {\n const contentGetters = new Map<ApwContentTypes, ContentGetter>();\n const contentPublisher = new Map<ApwContentTypes, ContentPublisher>();\n const contentUnPublisher = new Map<ApwContentTypes, ContentUnPublisher>();\n\n const workflowMethods = createWorkflowMethods(params);\n const reviewerMethods = createReviewerMethods(params);\n const changeRequestMethods = createChangeRequestMethods(params);\n\n function getContentGetter(type: ApwContentTypes) {\n const getter = contentGetters.get(type);\n if (!getter) {\n throw new Error(\n `No \"ContentGetter\" loader found for type: \"${type}\". You must define a loader.`\n );\n }\n return getter;\n }\n\n function getContentUnPublisher(type: ApwContentTypes) {\n const getter = contentUnPublisher.get(type);\n if (!getter) {\n throw new Error(\n `No \"Content UnPublisher\" loader found for type: \"${type}\". You must define a loader.`\n );\n }\n return getter;\n }\n\n function getContentPublisher(type: ApwContentTypes) {\n const getter = contentPublisher.get(type);\n if (!getter) {\n throw new Error(\n `No \"ContentPublisher\" loader found for type: \"${type}\". You must define a loader.`\n );\n }\n return getter;\n }\n\n return {\n addContentPublisher(type, func) {\n contentPublisher.set(type, func);\n },\n getContentPublisher,\n addContentGetter(type, func) {\n contentGetters.set(type, func);\n },\n getContentGetter,\n addContentUnPublisher(type, func) {\n contentUnPublisher.set(type, func);\n },\n getContentUnPublisher,\n workflow: workflowMethods,\n reviewer: reviewerMethods,\n changeRequest: changeRequestMethods,\n comment: createCommentMethods(params),\n contentReview: createContentReviewMethods({\n ...params,\n getReviewer: reviewerMethods.get.bind(reviewerMethods),\n getContentGetter,\n getContentPublisher,\n getContentUnPublisher\n }),\n /**\n * Add scheduler to context so that we can access it later. For example, during testing.\n */\n scheduleAction: params.scheduler\n };\n};\n"],"mappings":";;;;;;;;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;;;;;AAUO,MAAMA,SAAS,GAAIC,MAAD,IAAyD;EAC9E,MAAMC,cAAc,GAAG,IAAIC,GAAJ,EAAvB;EACA,MAAMC,gBAAgB,GAAG,IAAID,GAAJ,EAAzB;EACA,MAAME,kBAAkB,GAAG,IAAIF,GAAJ,EAA3B;EAEA,MAAMG,eAAe,GAAG,IAAAC,4CAAA,EAAsBN,MAAtB,CAAxB;EACA,MAAMO,eAAe,GAAG,IAA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P;IAcHmB,QAAQ,EAAEjB,eAdP;IAeHkB,aAAa,EAAEhB,oBAfZ;IAgBHiB,OAAO,EAAE,IAAAC,0CAAA,EAAqB3B,MAArB,CAhBN;IAiBH4B,aAAa,EAAE,IAAAC,sDAAA,kCACR7B,MADQ;MAEX8B,WAAW,EAAEvB,eAAe,CAACO,GAAhB,CAAoBiB,IAApB,CAAyBxB,eAAzB,CAFF;MAGXI,gBAHW;MAIXM,mBAJW;MAKXD;IALW,GAjBZ;;IAwBH;AACR;AACA;IACQgB,cAAc,EAAEhC,MAAM,CAACiC;EA3BpB,CAAP;AA6BH,CApEM"}
@@ -0,0 +1,21 @@
1
+ import { ApwContentReview, ApwContentReviewListParams, ApwContentReviewStep, ListMeta } from "../types";
2
+ import { CreateContentReviewMethodsParams } from "./createContentReviewMethods";
3
+ export declare function checkValidDateTime(datetime: string | undefined): void;
4
+ export interface GetPendingRequiredSteps {
5
+ (steps: ApwContentReviewStep[], predicate: (step: ApwContentReviewStep) => boolean): ApwContentReviewStep[];
6
+ }
7
+ export declare const getPendingRequiredSteps: GetPendingRequiredSteps;
8
+ export declare const INITIAL_CONTENT_REVIEW_CONTENT_SCHEDULE_META: {
9
+ scheduledOn: null;
10
+ scheduledBy: null;
11
+ scheduledActionId: null;
12
+ };
13
+ export interface FilterContentReviewsParams extends Pick<CreateContentReviewMethodsParams, "getReviewer" | "getIdentity"> {
14
+ listParams: ApwContentReviewListParams;
15
+ listContentReviews: CreateContentReviewMethodsParams["storageOperations"]["listContentReviews"];
16
+ }
17
+ /**
18
+ * Filter "content reviews" that are "underReview" and current user is a reviewer for the active step.
19
+ * That is the user is able to provide sign-off or comment.
20
+ */
21
+ export declare const filterContentReviewsByRequiresMyAttention: (params: FilterContentReviewsParams) => Promise<[ApwContentReview[], ListMeta]>;
package/crud/utils.js ADDED
@@ -0,0 +1,142 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+
5
+ Object.defineProperty(exports, "__esModule", {
6
+ value: true
7
+ });
8
+ exports.INITIAL_CONTENT_REVIEW_CONTENT_SCHEDULE_META = void 0;
9
+ exports.checkValidDateTime = checkValidDateTime;
10
+ exports.getPendingRequiredSteps = exports.filterContentReviewsByRequiresMyAttention = void 0;
11
+
12
+ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
13
+
14
+ var _error = _interopRequireDefault(require("@webiny/error"));
15
+
16
+ var _dayjs = _interopRequireDefault(require("dayjs"));
17
+
18
+ var _utc = _interopRequireDefault(require("dayjs/plugin/utc"));
19
+
20
+ var _cloneDeep = _interopRequireDefault(require("lodash/cloneDeep"));
21
+
22
+ var _set = _interopRequireDefault(require("lodash/set"));
23
+
24
+ var _types = require("../types");
25
+
26
+ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
27
+
28
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
29
+
30
+ _dayjs.default.extend(_utc.default);
31
+
32
+ function checkValidDateTime(datetime) {
33
+ if (typeof datetime !== "string") {
34
+ return;
35
+ }
36
+
37
+ if (!(0, _dayjs.default)(datetime).isValid()) {
38
+ throw new _error.default({
39
+ message: `Invalid input "datetime" should be an ISO string.`,
40
+ code: "INVALID_DATETIME_FORMAT",
41
+ data: {
42
+ datetime
43
+ }
44
+ });
45
+ }
46
+
47
+ const today = _dayjs.default.utc();
48
+
49
+ if ((0, _dayjs.default)(datetime).isBefore(today)) {
50
+ throw new _error.default({
51
+ message: `Cannot schedule for a past "datetime".`,
52
+ code: "PAST_DATETIME",
53
+ data: {
54
+ datetime
55
+ }
56
+ });
57
+ }
58
+ }
59
+
60
+ const getPendingRequiredSteps = (steps, predicate) => {
61
+ return steps.filter(step => {
62
+ const isRequiredStep = [_types.ApwWorkflowStepTypes.MANDATORY_BLOCKING, _types.ApwWorkflowStepTypes.MANDATORY_NON_BLOCKING].includes(step.type);
63
+
64
+ if (!isRequiredStep) {
65
+ return false;
66
+ }
67
+
68
+ return predicate(step);
69
+ });
70
+ };
71
+
72
+ exports.getPendingRequiredSteps = getPendingRequiredSteps;
73
+ const INITIAL_CONTENT_REVIEW_CONTENT_SCHEDULE_META = {
74
+ scheduledOn: null,
75
+ scheduledBy: null,
76
+ scheduledActionId: null
77
+ };
78
+ exports.INITIAL_CONTENT_REVIEW_CONTENT_SCHEDULE_META = INITIAL_CONTENT_REVIEW_CONTENT_SCHEDULE_META;
79
+
80
+ /**
81
+ * Filter "content reviews" that are "underReview" and current user is a reviewer for the active step.
82
+ * That is the user is able to provide sign-off or comment.
83
+ */
84
+ const filterContentReviewsByRequiresMyAttention = async params => {
85
+ const {
86
+ listContentReviews,
87
+ listParams,
88
+ getIdentity,
89
+ getReviewer
90
+ } = params;
91
+ /**
92
+ * Get all "content reviews" with status "underReview"
93
+ */
94
+
95
+ const newListParams = (0, _set.default)((0, _cloneDeep.default)(listParams), "where.status", _types.ApwContentReviewStatus.UNDER_REVIEW);
96
+ const [contentReviews, meta] = await listContentReviews(newListParams);
97
+ const identity = getIdentity();
98
+ const filteredItems = [];
99
+ /**
100
+ * Filter items where current user is a reviewer for the active step.
101
+ */
102
+
103
+ for (let i = 0; i < contentReviews.length; i++) {
104
+ const contentReview = contentReviews[i];
105
+ const activeStep = contentReview.steps.find(step => step.status === _types.ApwContentReviewStepStatus.ACTIVE);
106
+
107
+ if (!activeStep) {
108
+ continue;
109
+ }
110
+
111
+ let requiresMyAttention = false;
112
+
113
+ for (let j = 0; j < activeStep.reviewers.length; j++) {
114
+ const {
115
+ id
116
+ } = activeStep.reviewers[j];
117
+ /**
118
+ * Load reviewer
119
+ */
120
+
121
+ const reviewer = await getReviewer(id);
122
+ /**
123
+ * Check if the current logged in user is the reviewer.
124
+ */
125
+
126
+ if (reviewer.identityId === identity.id) {
127
+ requiresMyAttention = true;
128
+ break;
129
+ }
130
+ }
131
+
132
+ if (requiresMyAttention) {
133
+ filteredItems.push(contentReview);
134
+ }
135
+ }
136
+
137
+ return [filteredItems, _objectSpread(_objectSpread({}, meta), {}, {
138
+ totalCount: filteredItems.length
139
+ })];
140
+ };
141
+
142
+ exports.filterContentReviewsByRequiresMyAttention = filterContentReviewsByRequiresMyAttention;
@@ -0,0 +1 @@
1
+ {"version":3,"names":["dayjs","extend","utc","checkValidDateTime","datetime","isValid","Error","message","code","data","today","isBefore","getPendingRequiredSteps","steps","predicate","filter","step","isRequiredStep","ApwWorkflowStepTypes","MANDATORY_BLOCKING","MANDATORY_NON_BLOCKING","includes","type","INITIAL_CONTENT_REVIEW_CONTENT_SCHEDULE_META","scheduledOn","scheduledBy","scheduledActionId","filterContentReviewsByRequiresMyAttention","params","listContentReviews","listParams","getIdentity","getReviewer","newListParams","set","cloneDeep","ApwContentReviewStatus","UNDER_REVIEW","contentReviews","meta","identity","filteredItems","i","length","contentReview","activeStep","find","status","ApwContentReviewStepStatus","ACTIVE","requiresMyAttention","j","reviewers","id","reviewer","identityId","push","totalCount"],"sources":["utils.ts"],"sourcesContent":["import Error from \"@webiny/error\";\nimport dayjs from \"dayjs\";\nimport utc from \"dayjs/plugin/utc\";\nimport cloneDeep from \"lodash/cloneDeep\";\nimport set from \"lodash/set\";\nimport {\n ApwContentReview,\n ApwContentReviewListParams,\n ApwContentReviewStatus,\n ApwContentReviewStep,\n ApwContentReviewStepStatus,\n ApwWorkflowStepTypes,\n ListMeta\n} from \"~/types\";\nimport { CreateContentReviewMethodsParams } from \"./createContentReviewMethods\";\n\ndayjs.extend(utc);\n\nexport function checkValidDateTime(datetime: string | undefined): void {\n if (typeof datetime !== \"string\") {\n return;\n }\n\n if (!dayjs(datetime).isValid()) {\n throw new Error({\n message: `Invalid input \"datetime\" should be an ISO string.`,\n code: \"INVALID_DATETIME_FORMAT\",\n data: {\n datetime\n }\n });\n }\n const today = dayjs.utc();\n\n if (dayjs(datetime).isBefore(today)) {\n throw new Error({\n message: `Cannot schedule for a past \"datetime\".`,\n code: \"PAST_DATETIME\",\n data: {\n datetime\n }\n });\n }\n}\n\nexport interface GetPendingRequiredSteps {\n (\n steps: ApwContentReviewStep[],\n predicate: (step: ApwContentReviewStep) => boolean\n ): ApwContentReviewStep[];\n}\n\nexport const getPendingRequiredSteps: GetPendingRequiredSteps = (steps, predicate) => {\n return steps.filter(step => {\n const isRequiredStep = [\n ApwWorkflowStepTypes.MANDATORY_BLOCKING,\n ApwWorkflowStepTypes.MANDATORY_NON_BLOCKING\n ].includes(step.type);\n\n if (!isRequiredStep) {\n return false;\n }\n\n return predicate(step);\n });\n};\n\nexport const INITIAL_CONTENT_REVIEW_CONTENT_SCHEDULE_META = {\n scheduledOn: null,\n scheduledBy: null,\n scheduledActionId: null\n};\n\nexport interface FilterContentReviewsParams\n extends Pick<CreateContentReviewMethodsParams, \"getReviewer\" | \"getIdentity\"> {\n listParams: ApwContentReviewListParams;\n listContentReviews: CreateContentReviewMethodsParams[\"storageOperations\"][\"listContentReviews\"];\n}\n\n/**\n * Filter \"content reviews\" that are \"underReview\" and current user is a reviewer for the active step.\n * That is the user is able to provide sign-off or comment.\n */\nexport const filterContentReviewsByRequiresMyAttention = async (\n params: FilterContentReviewsParams\n): Promise<[ApwContentReview[], ListMeta]> => {\n const { listContentReviews, listParams, getIdentity, getReviewer } = params;\n /**\n * Get all \"content reviews\" with status \"underReview\"\n */\n const newListParams = set(\n cloneDeep(listParams),\n \"where.status\",\n ApwContentReviewStatus.UNDER_REVIEW\n );\n const [contentReviews, meta] = await listContentReviews(newListParams);\n\n const identity = getIdentity();\n const filteredItems = [];\n /**\n * Filter items where current user is a reviewer for the active step.\n */\n for (let i = 0; i < contentReviews.length; i++) {\n const contentReview = contentReviews[i];\n\n const activeStep = contentReview.steps.find(\n step => step.status === ApwContentReviewStepStatus.ACTIVE\n );\n\n if (!activeStep) {\n continue;\n }\n\n let requiresMyAttention = false;\n\n for (let j = 0; j < activeStep.reviewers.length; j++) {\n const { id } = activeStep.reviewers[j];\n /**\n * Load reviewer\n */\n const reviewer = await getReviewer(id);\n /**\n * Check if the current logged in user is the reviewer.\n */\n if (reviewer.identityId === identity.id) {\n requiresMyAttention = true;\n break;\n }\n }\n\n if (requiresMyAttention) {\n filteredItems.push(contentReview);\n }\n }\n\n return [\n filteredItems,\n {\n ...meta,\n totalCount: filteredItems.length\n }\n ];\n};\n"],"mappings":";;;;;;;;;;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;;;AAWAA,cAAA,CAAMC,MAAN,CAAaC,YAAb;;AAEO,SAASC,kBAAT,CAA4BC,QAA5B,EAAgE;EACnE,IAAI,OAAOA,QAAP,KAAoB,QAAxB,EAAkC;IAC9B;EACH;;EAED,IAAI,CAAC,IAAAJ,cAAA,EAAMI,QAAN,EAAgBC,OAAhB,EAAL,EAAgC;IAC5B,MAAM,IAAIC,cAAJ,CAAU;MACZC,OAAO,EAAG,mDADE;MAEZC,IAAI,EAAE,yBAFM;MAGZC,IAAI,EAAE;QACFL;MADE;IAHM,CAAV,CAAN;EAOH;;EACD,MAAMM,KAAK,GAAGV,cAAA,CAAME,GAAN,EAAd;;EAEA,IAAI,IAAAF,cAAA,EAAMI,QAAN,EAAgBO,QAAhB,CAAyBD,KAAzB,CAAJ,EAAqC;IACjC,MAAM,IAAIJ,cAAJ,CAAU;MACZC,OAAO,EAAG,wCADE;MAEZC,IAAI,EAAE,eAFM;MAGZC,IAAI,EAAE;QACFL;MADE;IAHM,CAAV,CAAN;EAOH;AACJ;;AAS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A,CAA2BC,MADpC,CAAnB;;IAIA,IAAI,CAACJ,UAAL,EAAiB;MACb;IACH;;IAED,IAAIK,mBAAmB,GAAG,KAA1B;;IAEA,KAAK,IAAIC,CAAC,GAAG,CAAb,EAAgBA,CAAC,GAAGN,UAAU,CAACO,SAAX,CAAqBT,MAAzC,EAAiDQ,CAAC,EAAlD,EAAsD;MAClD,MAAM;QAAEE;MAAF,IAASR,UAAU,CAACO,SAAX,CAAqBD,CAArB,CAAf;MACA;AACZ;AACA;;MACY,MAAMG,QAAQ,GAAG,MAAMtB,WAAW,CAACqB,EAAD,CAAlC;MACA;AACZ;AACA;;MACY,IAAIC,QAAQ,CAACC,UAAT,KAAwBf,QAAQ,CAACa,EAArC,EAAyC;QACrCH,mBAAmB,GAAG,IAAtB;QACA;MACH;IACJ;;IAED,IAAIA,mBAAJ,EAAyB;MACrBT,aAAa,CAACe,IAAd,CAAmBZ,aAAnB;IACH;EACJ;;EAED,OAAO,CACHH,aADG,kCAGIF,IAHJ;IAICkB,UAAU,EAAEhB,aAAa,CAACE;EAJ3B,GAAP;AAOH,CA3DM"}
package/index.d.ts ADDED
@@ -0,0 +1,4 @@
1
+ import { CreateApwContextParams } from "./scheduler/types";
2
+ export declare const createApwHeadlessCmsContext: (params: CreateApwContextParams) => import("@webiny/api").ContextPlugin<import("./types").ApwContext>;
3
+ export declare const createApwPageBuilderContext: (params: CreateApwContextParams) => import("@webiny/api").ContextPlugin<import("./types").ApwContext>;
4
+ export declare const createApwGraphQL: () => import("@webiny/api").ContextPlugin<import("./types").ApwContext>;
package/index.js ADDED
@@ -0,0 +1,34 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+
5
+ Object.defineProperty(exports, "__esModule", {
6
+ value: true
7
+ });
8
+ exports.createApwPageBuilderContext = exports.createApwHeadlessCmsContext = exports.createApwGraphQL = void 0;
9
+
10
+ var _graphql = _interopRequireDefault(require("./plugins/graphql"));
11
+
12
+ var _context = require("./plugins/context");
13
+
14
+ /**
15
+ * We have separated context and GraphQL creation so user can initialize only context if required.
16
+ * GraphQL will not work without context, but context will without GraphQL.
17
+ */
18
+ const createApwHeadlessCmsContext = params => {
19
+ return (0, _context.createApwHeadlessCmsContext)(params);
20
+ };
21
+
22
+ exports.createApwHeadlessCmsContext = createApwHeadlessCmsContext;
23
+
24
+ const createApwPageBuilderContext = params => {
25
+ return (0, _context.createApwPageBuilderContext)(params);
26
+ };
27
+
28
+ exports.createApwPageBuilderContext = createApwPageBuilderContext;
29
+
30
+ const createApwGraphQL = () => {
31
+ return (0, _graphql.default)();
32
+ };
33
+
34
+ exports.createApwGraphQL = createApwGraphQL;
package/index.js.map ADDED
@@ -0,0 +1 @@
1
+ {"version":3,"names":["createApwHeadlessCmsContext","params","createHeadlessCms","createApwPageBuilderContext","createPageBuilder","createApwGraphQL","graphql"],"sources":["index.ts"],"sourcesContent":["/**\n * We have separated context and GraphQL creation so user can initialize only context if required.\n * GraphQL will not work without context, but context will without GraphQL.\n */\nimport graphql from \"~/plugins/graphql\";\nimport {\n createApwHeadlessCmsContext as createHeadlessCms,\n createApwPageBuilderContext as createPageBuilder\n} from \"./plugins/context\";\nimport { CreateApwContextParams } from \"./scheduler/types\";\n\nexport const createApwHeadlessCmsContext = (params: CreateApwContextParams) => {\n return createHeadlessCms(params);\n};\n\nexport const createApwPageBuilderContext = (params: CreateApwContextParams) => {\n return createPageBuilder(params);\n};\n\nexport const createApwGraphQL = () => {\n return graphql();\n};\n"],"mappings":";;;;;;;;;AAIA;;AACA;;AALA;AACA;AACA;AACA;AAQO,MAAMA,2BAA2B,GAAIC,MAAD,IAAoC;EAC3E,OAAO,IAAAC,oCAAA,EAAkBD,MAAlB,CAAP;AACH,CAFM;;;;AAIA,MAAME,2BAA2B,GAAIF,MAAD,IAAoC;EAC3E,OAAO,IAAAG,oCAAA,EAAkBH,MAAlB,CAAP;AACH,CAFM;;;;AAIA,MAAMI,gBAAgB,GAAG,MAAM;EAClC,OAAO,IAAAC,gBAAA,GAAP;AACH,CAFM"}
package/package.json ADDED
@@ -0,0 +1,75 @@
1
+ {
2
+ "name": "@webiny/api-apw",
3
+ "version": "0.0.0-unstable.5e7233243f",
4
+ "keywords": [
5
+ "apw:base"
6
+ ],
7
+ "main": "index.js",
8
+ "repository": {
9
+ "type": "git",
10
+ "url": "https://github.com/webiny/webiny-js.git",
11
+ "directory": "packages/api-apw"
12
+ },
13
+ "description": "GraphQL API for Webiny Advanced Publishing Workflow.",
14
+ "author": "Webiny Ltd",
15
+ "license": "MIT",
16
+ "dependencies": {
17
+ "@aws-sdk/client-cloudwatch-events": "3.142.0",
18
+ "@babel/runtime": "7.18.9",
19
+ "@commodo/fields": "1.1.2-beta.20",
20
+ "@webiny/api": "0.0.0-unstable.5e7233243f",
21
+ "@webiny/api-headless-cms": "0.0.0-unstable.5e7233243f",
22
+ "@webiny/api-i18n": "0.0.0-unstable.5e7233243f",
23
+ "@webiny/api-i18n-ddb": "0.0.0-unstable.5e7233243f",
24
+ "@webiny/api-page-builder": "0.0.0-unstable.5e7233243f",
25
+ "@webiny/api-security": "0.0.0-unstable.5e7233243f",
26
+ "@webiny/api-tenancy": "0.0.0-unstable.5e7233243f",
27
+ "@webiny/api-wcp": "0.0.0-unstable.5e7233243f",
28
+ "@webiny/db-dynamodb": "0.0.0-unstable.5e7233243f",
29
+ "@webiny/error": "0.0.0-unstable.5e7233243f",
30
+ "@webiny/handler": "0.0.0-unstable.5e7233243f",
31
+ "@webiny/handler-client": "0.0.0-unstable.5e7233243f",
32
+ "@webiny/handler-db": "0.0.0-unstable.5e7233243f",
33
+ "@webiny/handler-graphql": "0.0.0-unstable.5e7233243f",
34
+ "@webiny/handler-logs": "0.0.0-unstable.5e7233243f",
35
+ "@webiny/plugins": "0.0.0-unstable.5e7233243f",
36
+ "@webiny/pubsub": "0.0.0-unstable.5e7233243f",
37
+ "@webiny/validation": "0.0.0-unstable.5e7233243f",
38
+ "dayjs": "1.11.4",
39
+ "lodash": "4.17.21",
40
+ "mdbid": "1.0.0",
41
+ "nanoid": "3.3.4"
42
+ },
43
+ "devDependencies": {
44
+ "@babel/cli": "^7.5.5",
45
+ "@babel/core": "^7.5.5",
46
+ "@babel/preset-env": "^7.5.5",
47
+ "@babel/preset-flow": "^7.0.0",
48
+ "@webiny/api-headless-cms-ddb": "^0.0.0-unstable.5e7233243f",
49
+ "@webiny/api-page-builder-so-ddb": "^0.0.0-unstable.5e7233243f",
50
+ "@webiny/api-security-so-ddb": "^0.0.0-unstable.5e7233243f",
51
+ "@webiny/api-tenancy-so-ddb": "^0.0.0-unstable.5e7233243f",
52
+ "@webiny/cli": "^0.0.0-unstable.5e7233243f",
53
+ "@webiny/handler-aws": "^0.0.0-unstable.5e7233243f",
54
+ "@webiny/project-utils": "^0.0.0-unstable.5e7233243f",
55
+ "@webiny/wcp": "^0.0.0-unstable.5e7233243f",
56
+ "get-yarn-workspaces": "^1.0.2",
57
+ "graphql": "^15.7.2",
58
+ "jest": "^28.1.0",
59
+ "mdbid": "^1.0.0",
60
+ "prettier": "^2.3.2",
61
+ "rimraf": "^3.0.2",
62
+ "sinon": "^9.0.2",
63
+ "ttypescript": "^1.5.12",
64
+ "typescript": "4.7.4"
65
+ },
66
+ "publishConfig": {
67
+ "access": "public",
68
+ "directory": "dist"
69
+ },
70
+ "scripts": {
71
+ "build": "yarn webiny run build",
72
+ "watch": "yarn webiny run watch"
73
+ },
74
+ "gitHead": "995a4b337db9b8497c6615e335dcd206afe26f8f"
75
+ }
@@ -0,0 +1,10 @@
1
+ import { ContentApwSettingsPlugin } from "../../ContentApwSettingsPlugin";
2
+ import { CmsEntry } from "@webiny/api-headless-cms/types";
3
+ import { ApwContentTypes } from "../../types";
4
+ export declare class CmsEntryApwSettingsGetterPlugin extends ContentApwSettingsPlugin {
5
+ canUse(type: ApwContentTypes): boolean;
6
+ setWorkflowId(entry: CmsEntry, id: string | null): void;
7
+ getWorkflowId(entry: CmsEntry): string | null;
8
+ setContentReviewId(entry: CmsEntry, id: string | null): void;
9
+ getContentReviewId(entry: CmsEntry): string | null;
10
+ }