@webiny/api-apw 0.0.0-ee-vpcs.549378cf03

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 (316) hide show
  1. package/ApwChangeRequestNotification.d.ts +27 -0
  2. package/ApwChangeRequestNotification.js +40 -0
  3. package/ApwChangeRequestNotification.js.map +1 -0
  4. package/ApwCommentNotification.d.ts +27 -0
  5. package/ApwCommentNotification.js +40 -0
  6. package/ApwCommentNotification.js.map +1 -0
  7. package/ApwContentReviewNotification.d.ts +26 -0
  8. package/ApwContentReviewNotification.js +40 -0
  9. package/ApwContentReviewNotification.js.map +1 -0
  10. package/ApwContentUrlPlugin.d.ts +19 -0
  11. package/ApwContentUrlPlugin.js +40 -0
  12. package/ApwContentUrlPlugin.js.map +1 -0
  13. package/ContentApwSettingsPlugin.d.ts +10 -0
  14. package/ContentApwSettingsPlugin.js +17 -0
  15. package/ContentApwSettingsPlugin.js.map +1 -0
  16. package/LICENSE +21 -0
  17. package/README.md +34 -0
  18. package/crud/createChangeRequestMethods.d.ts +2 -0
  19. package/crud/createChangeRequestMethods.js +98 -0
  20. package/crud/createChangeRequestMethods.js.map +1 -0
  21. package/crud/createCommentMethods.d.ts +2 -0
  22. package/crud/createCommentMethods.js +99 -0
  23. package/crud/createCommentMethods.js.map +1 -0
  24. package/crud/createContentReviewMethods.d.ts +10 -0
  25. package/crud/createContentReviewMethods.js +562 -0
  26. package/crud/createContentReviewMethods.js.map +1 -0
  27. package/crud/createReviewerMethods.d.ts +2 -0
  28. package/crud/createReviewerMethods.js +99 -0
  29. package/crud/createReviewerMethods.js.map +1 -0
  30. package/crud/createWorkflowMethods.d.ts +2 -0
  31. package/crud/createWorkflowMethods.js +118 -0
  32. package/crud/createWorkflowMethods.js.map +1 -0
  33. package/crud/index.d.ts +2 -0
  34. package/crud/index.js +96 -0
  35. package/crud/index.js.map +1 -0
  36. package/crud/utils.d.ts +21 -0
  37. package/crud/utils.js +138 -0
  38. package/crud/utils.js.map +1 -0
  39. package/index.d.ts +4 -0
  40. package/index.js +38 -0
  41. package/index.js.map +1 -0
  42. package/package.json +76 -0
  43. package/plugins/cms/CmsEntryApwSettingsGetterPlugin.d.ts +10 -0
  44. package/plugins/cms/CmsEntryApwSettingsGetterPlugin.js +51 -0
  45. package/plugins/cms/CmsEntryApwSettingsGetterPlugin.js.map +1 -0
  46. package/plugins/cms/README.md +49 -0
  47. package/plugins/cms/apwEntryPlugins.d.ts +8 -0
  48. package/plugins/cms/apwEntryPlugins.js +46 -0
  49. package/plugins/cms/apwEntryPlugins.js.map +1 -0
  50. package/plugins/cms/index.d.ts +12 -0
  51. package/plugins/cms/index.js +45 -0
  52. package/plugins/cms/index.js.map +1 -0
  53. package/plugins/cms/linkContentReviewToEntry.d.ts +8 -0
  54. package/plugins/cms/linkContentReviewToEntry.js +108 -0
  55. package/plugins/cms/linkContentReviewToEntry.js.map +1 -0
  56. package/plugins/cms/linkWorkflowToEntry.d.ts +8 -0
  57. package/plugins/cms/linkWorkflowToEntry.js +166 -0
  58. package/plugins/cms/linkWorkflowToEntry.js.map +1 -0
  59. package/plugins/cms/notifications/changeRequestNotification.d.ts +1 -0
  60. package/plugins/cms/notifications/changeRequestNotification.js +35 -0
  61. package/plugins/cms/notifications/changeRequestNotification.js.map +1 -0
  62. package/plugins/cms/notifications/commentNotification.d.ts +1 -0
  63. package/plugins/cms/notifications/commentNotification.js +35 -0
  64. package/plugins/cms/notifications/commentNotification.js.map +1 -0
  65. package/plugins/cms/notifications/contentReviewNotification.d.ts +1 -0
  66. package/plugins/cms/notifications/contentReviewNotification.js +35 -0
  67. package/plugins/cms/notifications/contentReviewNotification.js.map +1 -0
  68. package/plugins/cms/notifications/contentUrl.d.ts +8 -0
  69. package/plugins/cms/notifications/contentUrl.js +60 -0
  70. package/plugins/cms/notifications/contentUrl.js.map +1 -0
  71. package/plugins/cms/triggerContentReview.d.ts +8 -0
  72. package/plugins/cms/triggerContentReview.js +59 -0
  73. package/plugins/cms/triggerContentReview.js.map +1 -0
  74. package/plugins/cms/updateContentReviewStatus.d.ts +10 -0
  75. package/plugins/cms/updateContentReviewStatus.js +97 -0
  76. package/plugins/cms/updateContentReviewStatus.js.map +1 -0
  77. package/plugins/cms/utils.d.ts +27 -0
  78. package/plugins/cms/utils.js +207 -0
  79. package/plugins/cms/utils.js.map +1 -0
  80. package/plugins/context.d.ts +5 -0
  81. package/plugins/context.js +146 -0
  82. package/plugins/context.js.map +1 -0
  83. package/plugins/graphql/changeRequest.gql.d.ts +4 -0
  84. package/plugins/graphql/changeRequest.gql.js +155 -0
  85. package/plugins/graphql/changeRequest.gql.js.map +1 -0
  86. package/plugins/graphql/comment.gql.d.ts +4 -0
  87. package/plugins/graphql/comment.gql.js +160 -0
  88. package/plugins/graphql/comment.gql.js.map +1 -0
  89. package/plugins/graphql/contentReview.gql.d.ts +4 -0
  90. package/plugins/graphql/contentReview.gql.js +382 -0
  91. package/plugins/graphql/contentReview.gql.js.map +1 -0
  92. package/plugins/graphql/reviewer.gql.d.ts +4 -0
  93. package/plugins/graphql/reviewer.gql.js +116 -0
  94. package/plugins/graphql/reviewer.gql.js.map +1 -0
  95. package/plugins/graphql/workflow.gql.d.ts +4 -0
  96. package/plugins/graphql/workflow.gql.js +205 -0
  97. package/plugins/graphql/workflow.gql.js.map +1 -0
  98. package/plugins/graphql.d.ts +4 -0
  99. package/plugins/graphql.js +95 -0
  100. package/plugins/graphql.js.map +1 -0
  101. package/plugins/hooks/createReviewerFromIdentity.d.ts +2 -0
  102. package/plugins/hooks/createReviewerFromIdentity.js +82 -0
  103. package/plugins/hooks/createReviewerFromIdentity.js.map +1 -0
  104. package/plugins/hooks/deleteChangeRequestsAfterContentReview.d.ts +2 -0
  105. package/plugins/hooks/deleteChangeRequestsAfterContentReview.js +67 -0
  106. package/plugins/hooks/deleteChangeRequestsAfterContentReview.js.map +1 -0
  107. package/plugins/hooks/deleteCommentsAfterChangeRequest.d.ts +2 -0
  108. package/plugins/hooks/deleteCommentsAfterChangeRequest.js +59 -0
  109. package/plugins/hooks/deleteCommentsAfterChangeRequest.js.map +1 -0
  110. package/plugins/hooks/index.d.ts +3 -0
  111. package/plugins/hooks/index.js +74 -0
  112. package/plugins/hooks/index.js.map +1 -0
  113. package/plugins/hooks/initializeContentReviewSteps.d.ts +2 -0
  114. package/plugins/hooks/initializeContentReviewSteps.js +86 -0
  115. package/plugins/hooks/initializeContentReviewSteps.js.map +1 -0
  116. package/plugins/hooks/initializeNotifications.d.ts +2 -0
  117. package/plugins/hooks/initializeNotifications.js +20 -0
  118. package/plugins/hooks/initializeNotifications.js.map +1 -0
  119. package/plugins/hooks/listContentReviews.d.ts +10 -0
  120. package/plugins/hooks/listContentReviews.js +68 -0
  121. package/plugins/hooks/listContentReviews.js.map +1 -0
  122. package/plugins/hooks/notifications/appUrl.d.ts +2 -0
  123. package/plugins/hooks/notifications/appUrl.js +22 -0
  124. package/plugins/hooks/notifications/appUrl.js.map +1 -0
  125. package/plugins/hooks/notifications/changeRequestAfterCreate.d.ts +2 -0
  126. package/plugins/hooks/notifications/changeRequestAfterCreate.js +144 -0
  127. package/plugins/hooks/notifications/changeRequestAfterCreate.js.map +1 -0
  128. package/plugins/hooks/notifications/changeRequestUrl.d.ts +8 -0
  129. package/plugins/hooks/notifications/changeRequestUrl.js +31 -0
  130. package/plugins/hooks/notifications/changeRequestUrl.js.map +1 -0
  131. package/plugins/hooks/notifications/commentAfterCreate.d.ts +2 -0
  132. package/plugins/hooks/notifications/commentAfterCreate.js +157 -0
  133. package/plugins/hooks/notifications/commentAfterCreate.js.map +1 -0
  134. package/plugins/hooks/notifications/commentUrl.d.ts +8 -0
  135. package/plugins/hooks/notifications/commentUrl.js +31 -0
  136. package/plugins/hooks/notifications/commentUrl.js.map +1 -0
  137. package/plugins/hooks/notifications/contentReviewAfterCreate.d.ts +2 -0
  138. package/plugins/hooks/notifications/contentReviewAfterCreate.js +122 -0
  139. package/plugins/hooks/notifications/contentReviewAfterCreate.js.map +1 -0
  140. package/plugins/hooks/notifications/contentReviewUrl.d.ts +7 -0
  141. package/plugins/hooks/notifications/contentReviewUrl.js +30 -0
  142. package/plugins/hooks/notifications/contentReviewUrl.js.map +1 -0
  143. package/plugins/hooks/notifications/contentUrl.d.ts +7 -0
  144. package/plugins/hooks/notifications/contentUrl.js +29 -0
  145. package/plugins/hooks/notifications/contentUrl.js.map +1 -0
  146. package/plugins/hooks/notifications/lastChangeRequestNotificationPlugin.d.ts +11 -0
  147. package/plugins/hooks/notifications/lastChangeRequestNotificationPlugin.js +25 -0
  148. package/plugins/hooks/notifications/lastChangeRequestNotificationPlugin.js.map +1 -0
  149. package/plugins/hooks/notifications/lastCommentNotificationPlugin.d.ts +11 -0
  150. package/plugins/hooks/notifications/lastCommentNotificationPlugin.js +25 -0
  151. package/plugins/hooks/notifications/lastCommentNotificationPlugin.js.map +1 -0
  152. package/plugins/hooks/notifications/lastContentReviewNotificationPlugin.d.ts +11 -0
  153. package/plugins/hooks/notifications/lastContentReviewNotificationPlugin.js +25 -0
  154. package/plugins/hooks/notifications/lastContentReviewNotificationPlugin.js.map +1 -0
  155. package/plugins/hooks/notifications/reviewers.d.ts +15 -0
  156. package/plugins/hooks/notifications/reviewers.js +51 -0
  157. package/plugins/hooks/notifications/reviewers.js.map +1 -0
  158. package/plugins/hooks/notifications/sendChangeRequestNotification.d.ts +2 -0
  159. package/plugins/hooks/notifications/sendChangeRequestNotification.js +52 -0
  160. package/plugins/hooks/notifications/sendChangeRequestNotification.js.map +1 -0
  161. package/plugins/hooks/notifications/sendCommentNotification.d.ts +2 -0
  162. package/plugins/hooks/notifications/sendCommentNotification.js +52 -0
  163. package/plugins/hooks/notifications/sendCommentNotification.js.map +1 -0
  164. package/plugins/hooks/notifications/sendContentReviewNotification.d.ts +2 -0
  165. package/plugins/hooks/notifications/sendContentReviewNotification.js +52 -0
  166. package/plugins/hooks/notifications/sendContentReviewNotification.js.map +1 -0
  167. package/plugins/hooks/updatePendingChangeRequests.d.ts +2 -0
  168. package/plugins/hooks/updatePendingChangeRequests.js +94 -0
  169. package/plugins/hooks/updatePendingChangeRequests.js.map +1 -0
  170. package/plugins/hooks/updateTotalComments.d.ts +3 -0
  171. package/plugins/hooks/updateTotalComments.js +153 -0
  172. package/plugins/hooks/updateTotalComments.js.map +1 -0
  173. package/plugins/hooks/validateChangeRequest.d.ts +2 -0
  174. package/plugins/hooks/validateChangeRequest.js +89 -0
  175. package/plugins/hooks/validateChangeRequest.js.map +1 -0
  176. package/plugins/hooks/validateComment.d.ts +2 -0
  177. package/plugins/hooks/validateComment.js +57 -0
  178. package/plugins/hooks/validateComment.js.map +1 -0
  179. package/plugins/hooks/validateContentReview.d.ts +2 -0
  180. package/plugins/hooks/validateContentReview.js +38 -0
  181. package/plugins/hooks/validateContentReview.js.map +1 -0
  182. package/plugins/pageBuilder/PageApwSettingsGetterPlugin.d.ts +9 -0
  183. package/plugins/pageBuilder/PageApwSettingsGetterPlugin.js +51 -0
  184. package/plugins/pageBuilder/PageApwSettingsGetterPlugin.js.map +1 -0
  185. package/plugins/pageBuilder/apwContentPagePlugins.d.ts +3 -0
  186. package/plugins/pageBuilder/apwContentPagePlugins.js +30 -0
  187. package/plugins/pageBuilder/apwContentPagePlugins.js.map +1 -0
  188. package/plugins/pageBuilder/extendPbPageSettingsSchema.d.ts +3 -0
  189. package/plugins/pageBuilder/extendPbPageSettingsSchema.js +25 -0
  190. package/plugins/pageBuilder/extendPbPageSettingsSchema.js.map +1 -0
  191. package/plugins/pageBuilder/index.d.ts +11 -0
  192. package/plugins/pageBuilder/index.js +53 -0
  193. package/plugins/pageBuilder/index.js.map +1 -0
  194. package/plugins/pageBuilder/linkContentReviewToPage.d.ts +8 -0
  195. package/plugins/pageBuilder/linkContentReviewToPage.js +105 -0
  196. package/plugins/pageBuilder/linkContentReviewToPage.js.map +1 -0
  197. package/plugins/pageBuilder/linkWorkflowToPage.d.ts +8 -0
  198. package/plugins/pageBuilder/linkWorkflowToPage.js +194 -0
  199. package/plugins/pageBuilder/linkWorkflowToPage.js.map +1 -0
  200. package/plugins/pageBuilder/notifications/changeRequestNotification.d.ts +1 -0
  201. package/plugins/pageBuilder/notifications/changeRequestNotification.js +35 -0
  202. package/plugins/pageBuilder/notifications/changeRequestNotification.js.map +1 -0
  203. package/plugins/pageBuilder/notifications/commentNotification.d.ts +1 -0
  204. package/plugins/pageBuilder/notifications/commentNotification.js +35 -0
  205. package/plugins/pageBuilder/notifications/commentNotification.js.map +1 -0
  206. package/plugins/pageBuilder/notifications/contentReviewNotification.d.ts +1 -0
  207. package/plugins/pageBuilder/notifications/contentReviewNotification.js +35 -0
  208. package/plugins/pageBuilder/notifications/contentReviewNotification.js.map +1 -0
  209. package/plugins/pageBuilder/notifications/contentUrl.d.ts +1 -0
  210. package/plugins/pageBuilder/notifications/contentUrl.js +53 -0
  211. package/plugins/pageBuilder/notifications/contentUrl.js.map +1 -0
  212. package/plugins/pageBuilder/triggerContentReview.d.ts +8 -0
  213. package/plugins/pageBuilder/triggerContentReview.js +50 -0
  214. package/plugins/pageBuilder/triggerContentReview.js.map +1 -0
  215. package/plugins/pageBuilder/updateContentReviewStatus.d.ts +10 -0
  216. package/plugins/pageBuilder/updateContentReviewStatus.js +79 -0
  217. package/plugins/pageBuilder/updateContentReviewStatus.js.map +1 -0
  218. package/plugins/pageBuilder/utils.d.ts +22 -0
  219. package/plugins/pageBuilder/utils.js +184 -0
  220. package/plugins/pageBuilder/utils.js.map +1 -0
  221. package/plugins/utils.d.ts +35 -0
  222. package/plugins/utils.js +187 -0
  223. package/plugins/utils.js.map +1 -0
  224. package/scheduler/createScheduleActionMethods.d.ts +2 -0
  225. package/scheduler/createScheduleActionMethods.js +149 -0
  226. package/scheduler/createScheduleActionMethods.js.map +1 -0
  227. package/scheduler/handlers/executeAction/index.d.ts +13 -0
  228. package/scheduler/handlers/executeAction/index.js +172 -0
  229. package/scheduler/handlers/executeAction/index.js.map +1 -0
  230. package/scheduler/handlers/executeAction/plugins/ApplicationGraphQL.d.ts +13 -0
  231. package/scheduler/handlers/executeAction/plugins/ApplicationGraphQL.js +17 -0
  232. package/scheduler/handlers/executeAction/plugins/ApplicationGraphQL.js.map +1 -0
  233. package/scheduler/handlers/executeAction/plugins/HeadlessCMSGraphQL.d.ts +11 -0
  234. package/scheduler/handlers/executeAction/plugins/HeadlessCMSGraphQL.js +126 -0
  235. package/scheduler/handlers/executeAction/plugins/HeadlessCMSGraphQL.js.map +1 -0
  236. package/scheduler/handlers/executeAction/plugins/PageBuilderGraphQL.d.ts +11 -0
  237. package/scheduler/handlers/executeAction/plugins/PageBuilderGraphQL.js +163 -0
  238. package/scheduler/handlers/executeAction/plugins/PageBuilderGraphQL.js.map +1 -0
  239. package/scheduler/handlers/executeAction/security.d.ts +4 -0
  240. package/scheduler/handlers/executeAction/security.js +68 -0
  241. package/scheduler/handlers/executeAction/security.js.map +1 -0
  242. package/scheduler/handlers/scheduleAction/index.d.ts +22 -0
  243. package/scheduler/handlers/scheduleAction/index.js +164 -0
  244. package/scheduler/handlers/scheduleAction/index.js.map +1 -0
  245. package/scheduler/handlers/scheduleAction/scheduleAction.utils.d.ts +24 -0
  246. package/scheduler/handlers/scheduleAction/scheduleAction.utils.js +172 -0
  247. package/scheduler/handlers/scheduleAction/scheduleAction.utils.js.map +1 -0
  248. package/scheduler/handlers/utils.d.ts +33 -0
  249. package/scheduler/handlers/utils.js +168 -0
  250. package/scheduler/handlers/utils.js.map +1 -0
  251. package/scheduler/index.d.ts +2 -0
  252. package/scheduler/index.js +27 -0
  253. package/scheduler/index.js.map +1 -0
  254. package/scheduler/types.d.ts +171 -0
  255. package/scheduler/types.js +34 -0
  256. package/scheduler/types.js.map +1 -0
  257. package/storageOperations/changeRequestStorageOperations.d.ts +3 -0
  258. package/storageOperations/changeRequestStorageOperations.js +122 -0
  259. package/storageOperations/changeRequestStorageOperations.js.map +1 -0
  260. package/storageOperations/commentStorageOperations.d.ts +3 -0
  261. package/storageOperations/commentStorageOperations.js +138 -0
  262. package/storageOperations/commentStorageOperations.js.map +1 -0
  263. package/storageOperations/contentReviewStorageOperations.d.ts +3 -0
  264. package/storageOperations/contentReviewStorageOperations.js +93 -0
  265. package/storageOperations/contentReviewStorageOperations.js.map +1 -0
  266. package/storageOperations/index.d.ts +15 -0
  267. package/storageOperations/index.js +48 -0
  268. package/storageOperations/index.js.map +1 -0
  269. package/storageOperations/models/changeRequest.model.d.ts +3 -0
  270. package/storageOperations/models/changeRequest.model.js +59 -0
  271. package/storageOperations/models/changeRequest.model.js.map +1 -0
  272. package/storageOperations/models/comment.model.d.ts +7 -0
  273. package/storageOperations/models/comment.model.js +60 -0
  274. package/storageOperations/models/comment.model.js.map +1 -0
  275. package/storageOperations/models/contentModelPluginFactory.d.ts +15 -0
  276. package/storageOperations/models/contentModelPluginFactory.js +28 -0
  277. package/storageOperations/models/contentModelPluginFactory.js.map +1 -0
  278. package/storageOperations/models/contentReview.model.d.ts +7 -0
  279. package/storageOperations/models/contentReview.model.js +258 -0
  280. package/storageOperations/models/contentReview.model.js.map +1 -0
  281. package/storageOperations/models/index.d.ts +2 -0
  282. package/storageOperations/models/index.js +115 -0
  283. package/storageOperations/models/index.js.map +1 -0
  284. package/storageOperations/models/reviewer.model.d.ts +3 -0
  285. package/storageOperations/models/reviewer.model.js +71 -0
  286. package/storageOperations/models/reviewer.model.js.map +1 -0
  287. package/storageOperations/models/utils.d.ts +3 -0
  288. package/storageOperations/models/utils.js +37 -0
  289. package/storageOperations/models/utils.js.map +1 -0
  290. package/storageOperations/models/workflow.model.d.ts +12 -0
  291. package/storageOperations/models/workflow.model.js +208 -0
  292. package/storageOperations/models/workflow.model.js.map +1 -0
  293. package/storageOperations/reviewerStorageOperations.d.ts +3 -0
  294. package/storageOperations/reviewerStorageOperations.js +97 -0
  295. package/storageOperations/reviewerStorageOperations.js.map +1 -0
  296. package/storageOperations/types.d.ts +34 -0
  297. package/storageOperations/types.js +5 -0
  298. package/storageOperations/types.js.map +1 -0
  299. package/storageOperations/workflowStorageOperations.d.ts +3 -0
  300. package/storageOperations/workflowStorageOperations.js +111 -0
  301. package/storageOperations/workflowStorageOperations.js.map +1 -0
  302. package/types.d.ts +752 -0
  303. package/types.js +69 -0
  304. package/types.js.map +1 -0
  305. package/utils/contentApwSettingsPlugin.d.ts +9 -0
  306. package/utils/contentApwSettingsPlugin.js +26 -0
  307. package/utils/contentApwSettingsPlugin.js.map +1 -0
  308. package/utils/errors.d.ts +16 -0
  309. package/utils/errors.js +75 -0
  310. package/utils/errors.js.map +1 -0
  311. package/utils/fieldResolver.d.ts +16 -0
  312. package/utils/fieldResolver.js +54 -0
  313. package/utils/fieldResolver.js.map +1 -0
  314. package/utils/resolve.d.ts +3 -0
  315. package/utils/resolve.js +18 -0
  316. package/utils/resolve.js.map +1 -0
@@ -0,0 +1,208 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.stepTypeField = exports.stepTitleField = exports.stepReviewersField = exports.stepIdField = exports.createWorkflowModelDefinition = exports.WORKFLOW_MODEL_ID = void 0;
7
+
8
+ var _utils = require("./utils");
9
+
10
+ const titleField = () => (0, _utils.createModelField)({
11
+ label: "Title",
12
+ type: "text",
13
+ parent: "workflow",
14
+ validation: [{
15
+ message: "`title` field value is required in workflow.",
16
+ name: "required"
17
+ }]
18
+ });
19
+
20
+ const stepsField = fields => (0, _utils.createModelField)({
21
+ label: "Steps",
22
+ type: "object",
23
+ parent: "workflow",
24
+ settings: {
25
+ fields
26
+ },
27
+ multipleValues: true
28
+ });
29
+
30
+ const stepTitleField = () => (0, _utils.createModelField)({
31
+ label: "Title",
32
+ type: "text",
33
+ parent: "workflow steps",
34
+ validation: [{
35
+ message: "`title` field value is required in workflow steps.",
36
+ name: "required"
37
+ }]
38
+ });
39
+
40
+ exports.stepTitleField = stepTitleField;
41
+
42
+ const stepTypeField = () => (0, _utils.createModelField)({
43
+ label: "Type",
44
+ type: "text",
45
+ parent: "workflow steps",
46
+ predefinedValues: {
47
+ enabled: true,
48
+ values: [{
49
+ value: "mandatoryBlocking",
50
+ label: "Mandatory, blocking - An approval from a reviewer is required before being able to move to the next step and publish the content. "
51
+ }, {
52
+ value: "mandatoryNonBlocking",
53
+ label: "Mandatory, non-blocking - An approval from a reviewer is to publish the content, but the next step in the review workflow is not blocked. "
54
+ }, {
55
+ value: "notMandatory",
56
+ label: "Not mandatory - This is an optional review step. The content can be published regardless if an approval is provided or not."
57
+ }]
58
+ },
59
+ validation: [{
60
+ name: "required",
61
+ message: "`type` field value is required in workflow steps."
62
+ }]
63
+ });
64
+
65
+ exports.stepTypeField = stepTypeField;
66
+
67
+ const stepIdField = () => (0, _utils.createModelField)({
68
+ label: "Id",
69
+ type: "text",
70
+ parent: "workflow steps",
71
+ validation: [{
72
+ message: "`id` field value is required in workflow steps.",
73
+ name: "required"
74
+ }]
75
+ });
76
+
77
+ exports.stepIdField = stepIdField;
78
+
79
+ const stepReviewersField = reviewerModelId => (0, _utils.createModelField)({
80
+ label: "Reviewers",
81
+ type: "ref",
82
+ parent: "workflow steps",
83
+ multipleValues: true,
84
+ settings: {
85
+ models: [{
86
+ modelId: reviewerModelId
87
+ }]
88
+ },
89
+ listValidation: [{
90
+ name: "minLength",
91
+ message: "Value is too short.",
92
+ settings: {
93
+ value: "1"
94
+ }
95
+ }]
96
+ });
97
+
98
+ exports.stepReviewersField = stepReviewersField;
99
+
100
+ const scopeField = fields => (0, _utils.createModelField)({
101
+ type: "object",
102
+ label: "Scope",
103
+ parent: "workflow",
104
+ settings: {
105
+ fields
106
+ }
107
+ });
108
+
109
+ const scopeTypeField = () => (0, _utils.createModelField)({
110
+ label: "Type",
111
+ parent: "workflow scope",
112
+ type: "text",
113
+ validation: [{
114
+ message: "`type` field value is required in workflow scope.",
115
+ name: "required"
116
+ }],
117
+ predefinedValues: {
118
+ enabled: true,
119
+ values: [{
120
+ value: "default",
121
+ label: "Default - Catch all scope that applies to all content that's being published."
122
+ }, {
123
+ value: "pageBuilder",
124
+ label: "Page category (Page Builder only) - The workflow will apply to all pages inside specific categories."
125
+ }, {
126
+ value: "cms",
127
+ label: "Content model (Headless CMS only) - The workflow will apply to all the content inside the specific content models. "
128
+ }]
129
+ }
130
+ });
131
+
132
+ const scopeDataField = fields => (0, _utils.createModelField)({
133
+ label: "Data",
134
+ parent: "workflow scope",
135
+ type: "object",
136
+ settings: {
137
+ fields
138
+ }
139
+ });
140
+
141
+ const scopeDataPbCategories = () => (0, _utils.createModelField)({
142
+ label: "Categories",
143
+ parent: "workflow scope data",
144
+ type: "text",
145
+ multipleValues: true
146
+ });
147
+
148
+ const scopeDataPbPages = () => (0, _utils.createModelField)({
149
+ label: "Pages",
150
+ parent: "workflow scope data",
151
+ type: "text",
152
+ multipleValues: true
153
+ });
154
+
155
+ const scopeDataCmsModels = () => (0, _utils.createModelField)({
156
+ label: "Models",
157
+ parent: "workflow scope data",
158
+ type: "text",
159
+ multipleValues: true
160
+ });
161
+
162
+ const scopeDataCmsEntries = () => (0, _utils.createModelField)({
163
+ label: "Entries",
164
+ parent: "workflow scope data",
165
+ type: "text",
166
+ multipleValues: true
167
+ });
168
+
169
+ const applicationField = () => (0, _utils.createModelField)({
170
+ parent: "workflow",
171
+ type: "text",
172
+ label: "App",
173
+ validation: [{
174
+ message: "`app` field value is required in workflow.",
175
+ name: "required"
176
+ }],
177
+ predefinedValues: {
178
+ enabled: true,
179
+ values: [{
180
+ label: "Page Builder",
181
+ value: "pageBuilder"
182
+ }, {
183
+ label: "Headless CMS",
184
+ value: "cms"
185
+ }]
186
+ }
187
+ });
188
+
189
+ const WORKFLOW_MODEL_ID = "apwWorkflowModelDefinition";
190
+ exports.WORKFLOW_MODEL_ID = WORKFLOW_MODEL_ID;
191
+
192
+ const createWorkflowModelDefinition = ({
193
+ reviewerModelId
194
+ }) => ({
195
+ name: "APW - Workflow",
196
+
197
+ /**
198
+ * Id of the model cannot be appWorkflow because it clashes with the GraphQL types for APW.
199
+ */
200
+ modelId: WORKFLOW_MODEL_ID,
201
+ layout: [["workflow_title"], ["workflow_steps"], ["workflow_scope"], ["workflow_app"]],
202
+ titleFieldId: "title",
203
+ description: "",
204
+ fields: [titleField(), stepsField([stepTitleField(), stepTypeField(), stepIdField(), stepReviewersField(reviewerModelId)]), scopeField([scopeTypeField(), scopeDataField([scopeDataPbCategories(), scopeDataPbPages(), scopeDataCmsModels(), scopeDataCmsEntries()])]), applicationField()],
205
+ isPrivate: true
206
+ });
207
+
208
+ exports.createWorkflowModelDefinition = createWorkflowModelDefinition;
@@ -0,0 +1 @@
1
+ {"version":3,"names":["titleField","createModelField","label","type","parent","validation","message","name","stepsField","fields","settings","multipleValues","stepTitleField","stepTypeField","predefinedValues","enabled","values","value","stepIdField","stepReviewersField","reviewerModelId","models","modelId","listValidation","scopeField","scopeTypeField","scopeDataField","scopeDataPbCategories","scopeDataPbPages","scopeDataCmsModels","scopeDataCmsEntries","applicationField","WORKFLOW_MODEL_ID","createWorkflowModelDefinition","layout","titleFieldId","description","isPrivate"],"sources":["workflow.model.ts"],"sourcesContent":["import { createModelField } from \"./utils\";\nimport { CmsModelField } from \"@webiny/api-headless-cms/types\";\nimport { WorkflowModelDefinition } from \"~/types\";\n\nconst titleField = () =>\n createModelField({\n label: \"Title\",\n type: \"text\",\n parent: \"workflow\",\n validation: [\n {\n message: \"`title` field value is required in workflow.\",\n name: \"required\"\n }\n ]\n });\n\nconst stepsField = (fields: CmsModelField[]) =>\n createModelField({\n label: \"Steps\",\n type: \"object\",\n parent: \"workflow\",\n settings: {\n fields\n },\n multipleValues: true\n });\n\nexport const stepTitleField = () =>\n createModelField({\n label: \"Title\",\n type: \"text\",\n parent: \"workflow steps\",\n validation: [\n {\n message: \"`title` field value is required in workflow steps.\",\n name: \"required\"\n }\n ]\n });\n\nexport const stepTypeField = () =>\n createModelField({\n label: \"Type\",\n type: \"text\",\n parent: \"workflow steps\",\n predefinedValues: {\n enabled: true,\n values: [\n {\n value: \"mandatoryBlocking\",\n label: \"Mandatory, blocking - An approval from a reviewer is required before being able to move to the next step and publish the content. \"\n },\n {\n value: \"mandatoryNonBlocking\",\n label: \"Mandatory, non-blocking - An approval from a reviewer is to publish the content, but the next step in the review workflow is not blocked. \"\n },\n {\n value: \"notMandatory\",\n label: \"Not mandatory - This is an optional review step. The content can be published regardless if an approval is provided or not.\"\n }\n ]\n },\n validation: [\n {\n name: \"required\",\n message: \"`type` field value is required in workflow steps.\"\n }\n ]\n });\n\nexport const stepIdField = () =>\n createModelField({\n label: \"Id\",\n type: \"text\",\n parent: \"workflow steps\",\n validation: [\n {\n message: \"`id` field value is required in workflow steps.\",\n name: \"required\"\n }\n ]\n });\n\nexport const stepReviewersField = (reviewerModelId: string) =>\n createModelField({\n label: \"Reviewers\",\n type: \"ref\",\n parent: \"workflow steps\",\n multipleValues: true,\n settings: {\n models: [\n {\n modelId: reviewerModelId\n }\n ]\n },\n listValidation: [\n {\n name: \"minLength\",\n message: \"Value is too short.\",\n settings: {\n value: \"1\"\n }\n }\n ]\n });\n\nconst scopeField = (fields: CmsModelField[]) =>\n createModelField({\n type: \"object\",\n label: \"Scope\",\n parent: \"workflow\",\n settings: {\n fields\n }\n });\n\nconst scopeTypeField = () =>\n createModelField({\n label: \"Type\",\n parent: \"workflow scope\",\n type: \"text\",\n validation: [\n {\n message: \"`type` field value is required in workflow scope.\",\n name: \"required\"\n }\n ],\n predefinedValues: {\n enabled: true,\n values: [\n {\n value: \"default\",\n label: \"Default - Catch all scope that applies to all content that's being published.\"\n },\n {\n value: \"pageBuilder\",\n label: \"Page category (Page Builder only) - The workflow will apply to all pages inside specific categories.\"\n },\n {\n value: \"cms\",\n label: \"Content model (Headless CMS only) - The workflow will apply to all the content inside the specific content models. \"\n }\n ]\n }\n });\n\nconst scopeDataField = (fields: CmsModelField[]) =>\n createModelField({\n label: \"Data\",\n parent: \"workflow scope\",\n type: \"object\",\n settings: {\n fields\n }\n });\n\nconst scopeDataPbCategories = () =>\n createModelField({\n label: \"Categories\",\n parent: \"workflow scope data\",\n type: \"text\",\n multipleValues: true\n });\nconst scopeDataPbPages = () =>\n createModelField({\n label: \"Pages\",\n parent: \"workflow scope data\",\n type: \"text\",\n multipleValues: true\n });\nconst scopeDataCmsModels = () =>\n createModelField({\n label: \"Models\",\n parent: \"workflow scope data\",\n type: \"text\",\n multipleValues: true\n });\nconst scopeDataCmsEntries = () =>\n createModelField({\n label: \"Entries\",\n parent: \"workflow scope data\",\n type: \"text\",\n multipleValues: true\n });\n\nconst applicationField = () =>\n createModelField({\n parent: \"workflow\",\n type: \"text\",\n label: \"App\",\n validation: [\n {\n message: \"`app` field value is required in workflow.\",\n name: \"required\"\n }\n ],\n predefinedValues: {\n enabled: true,\n values: [\n { label: \"Page Builder\", value: \"pageBuilder\" },\n { label: \"Headless CMS\", value: \"cms\" }\n ]\n }\n });\n\ninterface CreateWorkflowModelDefinitionParams {\n reviewerModelId: string;\n}\n\nexport const WORKFLOW_MODEL_ID = \"apwWorkflowModelDefinition\";\n\nexport const createWorkflowModelDefinition = ({\n reviewerModelId\n}: CreateWorkflowModelDefinitionParams): WorkflowModelDefinition => ({\n name: \"APW - Workflow\",\n /**\n * Id of the model cannot be appWorkflow because it clashes with the GraphQL types for APW.\n */\n modelId: WORKFLOW_MODEL_ID,\n layout: [[\"workflow_title\"], [\"workflow_steps\"], [\"workflow_scope\"], [\"workflow_app\"]],\n titleFieldId: \"title\",\n description: \"\",\n fields: [\n titleField(),\n stepsField([\n stepTitleField(),\n stepTypeField(),\n stepIdField(),\n stepReviewersField(reviewerModelId)\n ]),\n scopeField([\n scopeTypeField(),\n scopeDataField([\n scopeDataPbCategories(),\n scopeDataPbPages(),\n scopeDataCmsModels(),\n scopeDataCmsEntries()\n ])\n ]),\n applicationField()\n ],\n isPrivate: true\n});\n"],"mappings":";;;;;;;AAAA;;AAIA,MAAMA,UAAU,GAAG,MACf,IAAAC,uBAAA,EAAiB;EACbC,KAAK,EAAE,OADM;EAEbC,IAAI,EAAE,MAFO;EAGbC,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AEA,MAAMC,6BAA6B,GAAG,CAAC;EAC1Cb;AAD0C,CAAD,MAEwB;EACjEb,IAAI,EAAE,gBAD2D;;EAEjE;AACJ;AACA;EACIe,OAAO,EAAEU,iBALwD;EAMjEE,MAAM,EAAE,CAAC,CAAC,gBAAD,CAAD,EAAqB,CAAC,gBAAD,CAArB,EAAyC,CAAC,gBAAD,CAAzC,EAA6D,CAAC,cAAD,CAA7D,CANyD;EAOjEC,YAAY,EAAE,OAPmD;EAQjEC,WAAW,EAAE,EARoD;EASjE3B,MAAM,EAAE,CACJT,UAAU,EADN,EAEJQ,UAAU,CAAC,CACPI,cAAc,EADP,EAEPC,aAAa,EAFN,EAGPK,WAAW,EAHJ,EAIPC,kBAAkB,CAACC,eAAD,CAJX,CAAD,CAFN,EAQJI,UAAU,CAAC,CACPC,cAAc,EADP,EAEPC,cAAc,CAAC,CACXC,qBAAqB,EADV,EAEXC,gBAAgB,EAFL,EAGXC,kBAAkB,EAHP,EAIXC,mBAAmB,EAJR,CAAD,CAFP,CAAD,CARN,EAiBJC,gBAAgB,EAjBZ,CATyD;EA4BjEM,SAAS,EAAE;AA5BsD,CAFxB,CAAtC"}
@@ -0,0 +1,3 @@
1
+ import { ApwReviewerStorageOperations } from "./types";
2
+ import { CreateApwStorageOperationsParams } from "./index";
3
+ export declare const createReviewerStorageOperations: ({ cms, security }: CreateApwStorageOperationsParams) => ApwReviewerStorageOperations;
@@ -0,0 +1,97 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
4
+
5
+ Object.defineProperty(exports, "__esModule", {
6
+ value: true
7
+ });
8
+ exports.createReviewerStorageOperations = void 0;
9
+
10
+ var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
11
+
12
+ var _index = require("./index");
13
+
14
+ var _error = _interopRequireDefault(require("@webiny/error"));
15
+
16
+ const createReviewerStorageOperations = ({
17
+ cms,
18
+ security
19
+ }) => {
20
+ const getReviewerModel = async () => {
21
+ security.disableAuthorization();
22
+
23
+ try {
24
+ const model = await cms.getModel("apwReviewerModelDefinition");
25
+
26
+ if (!model) {
27
+ throw new _error.default("Could not find `apwReviewerModelDefinition` model.", "MODEL_NOT_FOUND_ERROR");
28
+ }
29
+
30
+ return model;
31
+ } catch (ex) {
32
+ throw ex;
33
+ } finally {
34
+ security.enableAuthorization();
35
+ }
36
+ };
37
+
38
+ const getReviewer = async ({
39
+ id
40
+ }) => {
41
+ const model = await getReviewerModel();
42
+ security.disableAuthorization();
43
+ const entry = await cms.getEntryById(model, id);
44
+ security.enableAuthorization();
45
+ return (0, _index.getFieldValues)(entry, _index.baseFields);
46
+ };
47
+
48
+ return {
49
+ getReviewerModel,
50
+ getReviewer,
51
+
52
+ async listReviewers(params) {
53
+ const model = await getReviewerModel();
54
+ security.disableAuthorization();
55
+ const [entries, meta] = await cms.listLatestEntries(model, (0, _objectSpread2.default)((0, _objectSpread2.default)({}, params), {}, {
56
+ where: (0, _objectSpread2.default)({}, params.where)
57
+ }));
58
+ security.enableAuthorization();
59
+ return [entries.map(entry => (0, _index.getFieldValues)(entry, _index.baseFields)), meta];
60
+ },
61
+
62
+ async createReviewer(params) {
63
+ const model = await getReviewerModel();
64
+ security.disableAuthorization();
65
+ const entry = await cms.createEntry(model, params.data);
66
+ security.enableAuthorization();
67
+ return (0, _index.getFieldValues)(entry, _index.baseFields);
68
+ },
69
+
70
+ async updateReviewer(params) {
71
+ const model = await getReviewerModel();
72
+ /**
73
+ * We're fetching the existing entry here because we're not accepting "app" field as input,
74
+ * but, we still need to retain its value after the "update" operation.
75
+ */
76
+
77
+ const existingEntry = await getReviewer({
78
+ id: params.id
79
+ });
80
+ security.disableAuthorization();
81
+ const entry = await cms.updateEntry(model, params.id, (0, _objectSpread2.default)((0, _objectSpread2.default)({}, existingEntry), params.data));
82
+ security.enableAuthorization();
83
+ return (0, _index.getFieldValues)(entry, _index.baseFields);
84
+ },
85
+
86
+ async deleteReviewer(params) {
87
+ const model = await getReviewerModel();
88
+ security.disableAuthorization();
89
+ await cms.deleteEntry(model, params.id);
90
+ security.enableAuthorization();
91
+ return true;
92
+ }
93
+
94
+ };
95
+ };
96
+
97
+ exports.createReviewerStorageOperations = createReviewerStorageOperations;
@@ -0,0 +1 @@
1
+ {"version":3,"names":["createReviewerStorageOperations","cms","security","getReviewerModel","disableAuthorization","model","getModel","WebinyError","ex","enableAuthorization","getReviewer","id","entry","getEntryById","getFieldValues","baseFields","listReviewers","params","entries","meta","listLatestEntries","where","map","createReviewer","createEntry","data","updateReviewer","existingEntry","updateEntry","deleteReviewer","deleteEntry"],"sources":["reviewerStorageOperations.ts"],"sourcesContent":["import { ApwReviewerStorageOperations } from \"./types\";\nimport {\n baseFields,\n CreateApwStorageOperationsParams,\n getFieldValues\n} from \"~/storageOperations/index\";\nimport WebinyError from \"@webiny/error\";\n\nexport const createReviewerStorageOperations = ({\n cms,\n security\n}: CreateApwStorageOperationsParams): ApwReviewerStorageOperations => {\n const getReviewerModel = async () => {\n security.disableAuthorization();\n try {\n const model = await cms.getModel(\"apwReviewerModelDefinition\");\n if (!model) {\n throw new WebinyError(\n \"Could not find `apwReviewerModelDefinition` model.\",\n \"MODEL_NOT_FOUND_ERROR\"\n );\n }\n return model;\n } catch (ex) {\n throw ex;\n } finally {\n security.enableAuthorization();\n }\n };\n const getReviewer: ApwReviewerStorageOperations[\"getReviewer\"] = async ({ id }) => {\n const model = await getReviewerModel();\n security.disableAuthorization();\n const entry = await cms.getEntryById(model, id);\n security.enableAuthorization();\n return getFieldValues(entry, baseFields);\n };\n return {\n getReviewerModel,\n getReviewer,\n async listReviewers(params) {\n const model = await getReviewerModel();\n security.disableAuthorization();\n const [entries, meta] = await cms.listLatestEntries(model, {\n ...params,\n where: {\n ...params.where\n }\n });\n security.enableAuthorization();\n return [entries.map(entry => getFieldValues(entry, baseFields)), meta];\n },\n async createReviewer(params) {\n const model = await getReviewerModel();\n security.disableAuthorization();\n const entry = await cms.createEntry(model, params.data);\n security.enableAuthorization();\n return getFieldValues(entry, baseFields);\n },\n async updateReviewer(params) {\n const model = await getReviewerModel();\n /**\n * We're fetching the existing entry here because we're not accepting \"app\" field as input,\n * but, we still need to retain its value after the \"update\" operation.\n */\n const existingEntry = await getReviewer({ id: params.id });\n\n security.disableAuthorization();\n const entry = await cms.updateEntry(model, params.id, {\n ...existingEntry,\n ...params.data\n });\n security.enableAuthorization();\n return getFieldValues(entry, baseFields);\n },\n async deleteReviewer(params) {\n const model = await getReviewerModel();\n security.disableAuthorization();\n await cms.deleteEntry(model, params.id);\n security.enableAuthorization();\n return true;\n }\n };\n};\n"],"mappings":";;;;;;;;;;;AACA;;AAKA;;AAEO,MAAMA,+BAA+B,GAAG,CAAC;EAC5CC,GAD4C;EAE5CC;AAF4C,CAAD,KAGuB;EAClE,MAAMC,gBAAgB,GAAG,YAAY;IACjCD,QAAQ,CAACE,oBAAT;;IACA,IAAI;MACA,MAAMC,KAAK,GAAG,MAAMJ,GAAG,CAACK,QAAJ,CAAa,4BAAb,CAApB;;MACA,IAAI,CAACD,KAAL,EAAY;QACR,MAAM,IAAIE,cAAJ,CACF,oDADE,EAEF,uBAFE,CAAN;MAIH;;MACD,OAAOF,KAAP;IACH,CATD,CASE,OAAOG,EAAP,EAAW;MACT,MAAMA,EAAN;IACH,CAXD,SAWU;MACNN,QAAQ,CAACO,mBAAT;IACH;EACJ,CAhBD;;EAiBA,MAAMC,WAAwD,GAAG,OAAO;IAAEC;EAAF,CAAP,KAAkB;IAC/E,MAAMN,KAAK,GAAG,MAAMF,gBAAgB,EAApC;IACAD,QAAQ,CAACE,oBAAT;IACA,MAAMQ,KAAK,GAAG,MAAMX,GAAG,CAACY,YAAJ,CAAiBR,KAAjB,EAAwBM,EAAxB,CAApB;IACAT,QAAQ,CAACO,mBAAT;IACA,OAAO,IAAAK,qBAAA,EAAeF,KAAf,EAAsBG,iBAAtB,CAAP;EACH,CAND;;EAOA,OAAO;IACHZ,gBADG;IAEHO,WAFG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tB,CAAP;IACH,CArCE;;IAsCH,MAAMc,cAAN,CAAqBZ,MAArB,EAA6B;MACzB,MAAMZ,KAAK,GAAG,MAAMF,gBAAgB,EAApC;MACAD,QAAQ,CAACE,oBAAT;MACA,MAAMH,GAAG,CAAC6B,WAAJ,CAAgBzB,KAAhB,EAAuBY,MAAM,CAACN,EAA9B,CAAN;MACAT,QAAQ,CAACO,mBAAT;MACA,OAAO,IAAP;IACH;;EA5CE,CAAP;AA8CH,CA1EM"}
@@ -0,0 +1,34 @@
1
+ import { CmsModel } from "@webiny/api-headless-cms/types";
2
+ import { ApwReviewerStorageOperations as BaseApwReviewerStorageOperations, ApwWorkflowStorageOperations as BaseApwWorkflowStorageOperations, ApwContentReviewStorageOperations as BaseApwContentReviewStorageOperations, ApwChangeRequestStorageOperations as BaseApwChangeRequestStorageOperations, ApwCommentStorageOperations as BaseApwCommentStorageOperations } from "../types";
3
+ export interface ApwCommentStorageOperations extends BaseApwCommentStorageOperations {
4
+ /**
5
+ * @internal
6
+ */
7
+ getCommentModel(): Promise<CmsModel>;
8
+ }
9
+ export interface ApwReviewerStorageOperations extends BaseApwReviewerStorageOperations {
10
+ /**
11
+ * @internal
12
+ */
13
+ getReviewerModel(): Promise<CmsModel>;
14
+ }
15
+ export interface ApwWorkflowStorageOperations extends BaseApwWorkflowStorageOperations {
16
+ /**
17
+ * @internal
18
+ */
19
+ getWorkflowModel(): Promise<CmsModel>;
20
+ }
21
+ export interface ApwContentReviewStorageOperations extends BaseApwContentReviewStorageOperations {
22
+ /**
23
+ * @internal
24
+ */
25
+ getContentReviewModel(): Promise<CmsModel>;
26
+ }
27
+ export interface ApwChangeRequestStorageOperations extends BaseApwChangeRequestStorageOperations {
28
+ /**
29
+ * @internal
30
+ */
31
+ getChangeRequestModel(): Promise<CmsModel>;
32
+ }
33
+ export interface ApwStorageOperations extends ApwReviewerStorageOperations, ApwWorkflowStorageOperations, ApwContentReviewStorageOperations, ApwChangeRequestStorageOperations, ApwCommentStorageOperations {
34
+ }
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
@@ -0,0 +1 @@
1
+ {"version":3,"names":[],"sources":["types.ts"],"sourcesContent":["import { CmsModel } from \"@webiny/api-headless-cms/types\";\nimport {\n ApwReviewerStorageOperations as BaseApwReviewerStorageOperations,\n ApwWorkflowStorageOperations as BaseApwWorkflowStorageOperations,\n ApwContentReviewStorageOperations as BaseApwContentReviewStorageOperations,\n ApwChangeRequestStorageOperations as BaseApwChangeRequestStorageOperations,\n ApwCommentStorageOperations as BaseApwCommentStorageOperations\n} from \"~/types\";\n\nexport interface ApwCommentStorageOperations extends BaseApwCommentStorageOperations {\n /**\n * @internal\n */\n getCommentModel(): Promise<CmsModel>;\n}\n\nexport interface ApwReviewerStorageOperations extends BaseApwReviewerStorageOperations {\n /**\n * @internal\n */\n getReviewerModel(): Promise<CmsModel>;\n}\n\nexport interface ApwWorkflowStorageOperations extends BaseApwWorkflowStorageOperations {\n /**\n * @internal\n */\n getWorkflowModel(): Promise<CmsModel>;\n}\n\nexport interface ApwContentReviewStorageOperations extends BaseApwContentReviewStorageOperations {\n /**\n * @internal\n */\n getContentReviewModel(): Promise<CmsModel>;\n}\n\nexport interface ApwChangeRequestStorageOperations extends BaseApwChangeRequestStorageOperations {\n /**\n * @internal\n */\n getChangeRequestModel(): Promise<CmsModel>;\n}\n\nexport interface ApwStorageOperations\n extends ApwReviewerStorageOperations,\n ApwWorkflowStorageOperations,\n ApwContentReviewStorageOperations,\n ApwChangeRequestStorageOperations,\n ApwCommentStorageOperations {}\n"],"mappings":""}
@@ -0,0 +1,3 @@
1
+ import { ApwWorkflowStorageOperations } from "./types";
2
+ import { CreateApwStorageOperationsParams } from "./index";
3
+ export declare const createWorkflowStorageOperations: (params: CreateApwStorageOperationsParams) => ApwWorkflowStorageOperations;
@@ -0,0 +1,111 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
4
+
5
+ Object.defineProperty(exports, "__esModule", {
6
+ value: true
7
+ });
8
+ exports.createWorkflowStorageOperations = void 0;
9
+
10
+ var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
11
+
12
+ var _index = require("./index");
13
+
14
+ var _error = _interopRequireDefault(require("@webiny/error"));
15
+
16
+ var _workflow = require("./models/workflow.model");
17
+
18
+ const formatReviewersForRefInput = (data, modelId) => {
19
+ return (0, _objectSpread2.default)((0, _objectSpread2.default)({}, data), {}, {
20
+ steps: data.steps.map(step => (0, _objectSpread2.default)((0, _objectSpread2.default)({}, step), {}, {
21
+ reviewers: step.reviewers.map(id => ({
22
+ id,
23
+ modelId
24
+ }))
25
+ }))
26
+ });
27
+ };
28
+
29
+ const createWorkflowStorageOperations = params => {
30
+ const {
31
+ cms,
32
+ security
33
+ } = params;
34
+
35
+ const getWorkflowModel = async () => {
36
+ security.disableAuthorization();
37
+ const model = await cms.getModel(_workflow.WORKFLOW_MODEL_ID);
38
+ security.enableAuthorization();
39
+
40
+ if (!model) {
41
+ throw new _error.default(`Could not find "${_workflow.WORKFLOW_MODEL_ID}" model.`, "MODEL_NOT_FOUND_ERROR");
42
+ }
43
+
44
+ return model;
45
+ };
46
+
47
+ const getWorkflow = async ({
48
+ id
49
+ }) => {
50
+ const model = await getWorkflowModel();
51
+ security.disableAuthorization();
52
+ const entry = await cms.getEntryById(model, id);
53
+ security.enableAuthorization();
54
+ return (0, _index.getFieldValues)(entry, _index.baseFields);
55
+ };
56
+
57
+ return {
58
+ getWorkflowModel,
59
+ getWorkflow,
60
+
61
+ async listWorkflows(params) {
62
+ const model = await getWorkflowModel();
63
+ security.disableAuthorization();
64
+ const [entries, meta] = await cms.listLatestEntries(model, (0, _objectSpread2.default)((0, _objectSpread2.default)({}, params), {}, {
65
+ where: (0, _objectSpread2.default)({}, params.where || {})
66
+ }));
67
+ security.enableAuthorization();
68
+ return [entries.map(entry => (0, _index.getFieldValues)(entry, _index.baseFields)), meta];
69
+ },
70
+
71
+ async createWorkflow(params) {
72
+ const model = await getWorkflowModel();
73
+ const reviewerModel = await this.getReviewerModel();
74
+ const data = formatReviewersForRefInput(params.data, reviewerModel.modelId);
75
+ security.disableAuthorization();
76
+ const entry = await cms.createEntry(model, data);
77
+ security.enableAuthorization();
78
+ return (0, _index.getFieldValues)(entry, _index.baseFields);
79
+ },
80
+
81
+ async updateWorkflow(params) {
82
+ const model = await getWorkflowModel();
83
+ const reviewerModel = await this.getReviewerModel();
84
+ /**
85
+ * We're fetching the existing entry here because we're not accepting "app" field as input,
86
+ * but, we still need to retain its value after the "update" operation.
87
+ */
88
+
89
+ const existingEntry = await getWorkflow({
90
+ id: params.id
91
+ });
92
+ const input = (0, _objectSpread2.default)((0, _objectSpread2.default)({}, existingEntry), params.data);
93
+ const data = formatReviewersForRefInput(input, reviewerModel.modelId);
94
+ security.disableAuthorization();
95
+ const entry = await cms.updateEntry(model, params.id, data);
96
+ security.enableAuthorization();
97
+ return (0, _index.getFieldValues)(entry, _index.baseFields);
98
+ },
99
+
100
+ async deleteWorkflow(params) {
101
+ const model = await getWorkflowModel();
102
+ security.disableAuthorization();
103
+ await cms.deleteEntry(model, params.id);
104
+ security.enableAuthorization();
105
+ return true;
106
+ }
107
+
108
+ };
109
+ };
110
+
111
+ exports.createWorkflowStorageOperations = createWorkflowStorageOperations;
@@ -0,0 +1 @@
1
+ {"version":3,"names":["formatReviewersForRefInput","data","modelId","steps","map","step","reviewers","id","createWorkflowStorageOperations","params","cms","security","getWorkflowModel","disableAuthorization","model","getModel","WORKFLOW_MODEL_ID","enableAuthorization","WebinyError","getWorkflow","entry","getEntryById","getFieldValues","baseFields","listWorkflows","entries","meta","listLatestEntries","where","createWorkflow","reviewerModel","getReviewerModel","createEntry","updateWorkflow","existingEntry","input","updateEntry","deleteWorkflow","deleteEntry"],"sources":["workflowStorageOperations.ts"],"sourcesContent":["import { CreateApwWorkflowParams } from \"~/types\";\nimport { ApwStorageOperations, ApwWorkflowStorageOperations } from \"./types\";\nimport {\n baseFields,\n CreateApwStorageOperationsParams,\n getFieldValues\n} from \"~/storageOperations/index\";\nimport WebinyError from \"@webiny/error\";\nimport { WORKFLOW_MODEL_ID } from \"~/storageOperations/models/workflow.model\";\n\ntype ReviewersRefInput = CreateApwWorkflowParams<{ modelId: string; id: string }>;\n\nconst formatReviewersForRefInput = (\n data: CreateApwWorkflowParams,\n modelId: string\n): ReviewersRefInput => {\n return {\n ...data,\n steps: data.steps.map(step => ({\n ...step,\n reviewers: step.reviewers.map(id => ({\n id,\n modelId\n }))\n }))\n };\n};\n\nexport const createWorkflowStorageOperations = (\n params: CreateApwStorageOperationsParams\n): ApwWorkflowStorageOperations => {\n const { cms, security } = params;\n const getWorkflowModel = async () => {\n security.disableAuthorization();\n const model = await cms.getModel(WORKFLOW_MODEL_ID);\n security.enableAuthorization();\n if (!model) {\n throw new WebinyError(\n `Could not find \"${WORKFLOW_MODEL_ID}\" model.`,\n \"MODEL_NOT_FOUND_ERROR\"\n );\n }\n return model;\n };\n const getWorkflow: ApwWorkflowStorageOperations[\"getWorkflow\"] = async ({ id }) => {\n const model = await getWorkflowModel();\n security.disableAuthorization();\n const entry = await cms.getEntryById(model, id);\n security.enableAuthorization();\n return getFieldValues(entry, baseFields);\n };\n return {\n getWorkflowModel,\n getWorkflow,\n async listWorkflows(params) {\n const model = await getWorkflowModel();\n security.disableAuthorization();\n const [entries, meta] = await cms.listLatestEntries(model, {\n ...params,\n where: {\n ...(params.where || {})\n }\n });\n security.enableAuthorization();\n return [entries.map(entry => getFieldValues(entry, baseFields)), meta];\n },\n async createWorkflow(this: ApwStorageOperations, params) {\n const model = await getWorkflowModel();\n const reviewerModel = await this.getReviewerModel();\n\n const data = formatReviewersForRefInput(params.data, reviewerModel.modelId);\n security.disableAuthorization();\n const entry = await cms.createEntry(model, data);\n security.enableAuthorization();\n\n return getFieldValues(entry, baseFields);\n },\n async updateWorkflow(this: ApwStorageOperations, params) {\n const model = await getWorkflowModel();\n const reviewerModel = await this.getReviewerModel();\n /**\n * We're fetching the existing entry here because we're not accepting \"app\" field as input,\n * but, we still need to retain its value after the \"update\" operation.\n */\n const existingEntry = await getWorkflow({ id: params.id });\n const input = {\n ...existingEntry,\n ...params.data\n };\n const data = formatReviewersForRefInput(\n input as CreateApwWorkflowParams,\n reviewerModel.modelId\n );\n security.disableAuthorization();\n const entry = await cms.updateEntry(model, params.id, data);\n security.enableAuthorization();\n return getFieldValues(entry, baseFields);\n },\n async deleteWorkflow(params) {\n const model = await getWorkflowModel();\n security.disableAuthorization();\n await cms.deleteEntry(model, params.id);\n security.enableAuthorization();\n return true;\n }\n };\n};\n"],"mappings":";;;;;;;;;;;AAEA;;AAKA;;AACA;;AAIA,MAAMA,0BAA0B,GAAG,CAC/BC,IAD+B,EAE/BC,OAF+B,KAGX;EACpB,mEACOD,IADP;IAEIE,KAAK,EAAEF,IAAI,CAACE,KAAL,CAAWC,GAAX,CAAeC,IAAI,gEACnBA,IADmB;MAEtBC,SAAS,EAAED,IAAI,CAACC,SAAL,CAAeF,GAAf,CAAmBG,EAAE,KAAK;QACjCA,EADiC;QAEjCL;MAFiC,CAAL,CAArB;IAFW,EAAnB;EAFX;AAUH,CAdD;;AAgBO,MAAMM,+BAA+B,GACxCC,MAD2C,IAEZ;EAC/B,MAAM;IAAEC,GAAF;IAAOC;EAAP,IAAoBF,MAA1B;;EACA,MAAMG,gBAAgB,GAAG,YAAY;IACjCD,QAAQ,CAACE,oBAAT;IACA,MAAMC,KAAK,GAAG,MAAMJ,GAAG,CAACK,QAAJ,CAAaC,2BAAb,CAApB;IACAL,QAAQ,CAACM,mBAAT;;IACA,IAAI,CAACH,KAAL,EAAY;MACR,MAAM,IAAII,cAAJ,CACD,mBAAkBF,2BAAkB,UADnC,EAEF,uBAFE,CAAN;IAIH;;IACD,OAAOF,KAAP;EACH,CAXD;;EAYA,MAAMK,WAAwD,GAAG,OAAO;IAAEZ;EAAF,CAAP,KAAkB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