@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,15 @@
1
+ import { CmsModelPlugin } from "@webiny/api-headless-cms";
2
+ import { CmsModel, CmsGroup } from "@webiny/api-headless-cms/types";
3
+ interface Params {
4
+ group: Pick<CmsGroup, "id" | "name">;
5
+ /**
6
+ * Locale and tenant do not need to be defined.
7
+ * In that case model is not bound to any locale or tenant.
8
+ * You can bind it to locale, tenant, both or none.
9
+ */
10
+ locale?: string;
11
+ tenant?: string;
12
+ modelDefinition: Omit<CmsModel, "locale" | "tenant" | "webinyVersion" | "group">;
13
+ }
14
+ export declare const contentModelPluginFactory: (params: Params) => CmsModelPlugin;
15
+ export {};
@@ -0,0 +1,28 @@
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.contentModelPluginFactory = void 0;
9
+
10
+ var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
11
+
12
+ var _apiHeadlessCms = require("@webiny/api-headless-cms");
13
+
14
+ const contentModelPluginFactory = params => {
15
+ const {
16
+ group,
17
+ locale,
18
+ tenant,
19
+ modelDefinition
20
+ } = params;
21
+ return (0, _apiHeadlessCms.createCmsModel)((0, _objectSpread2.default)({
22
+ group,
23
+ locale,
24
+ tenant
25
+ }, modelDefinition));
26
+ };
27
+
28
+ exports.contentModelPluginFactory = contentModelPluginFactory;
@@ -0,0 +1 @@
1
+ {"version":3,"names":["contentModelPluginFactory","params","group","locale","tenant","modelDefinition","createCmsModel"],"sources":["contentModelPluginFactory.ts"],"sourcesContent":["import { CmsModelPlugin, createCmsModel } from \"@webiny/api-headless-cms\";\nimport { CmsModel, CmsGroup } from \"@webiny/api-headless-cms/types\";\n\ninterface Params {\n group: Pick<CmsGroup, \"id\" | \"name\">;\n /**\n * Locale and tenant do not need to be defined.\n * In that case model is not bound to any locale or tenant.\n * You can bind it to locale, tenant, both or none.\n */\n locale?: string;\n tenant?: string;\n modelDefinition: Omit<CmsModel, \"locale\" | \"tenant\" | \"webinyVersion\" | \"group\">;\n}\n\nexport const contentModelPluginFactory = (params: Params): CmsModelPlugin => {\n const { group, locale, tenant, modelDefinition } = params;\n\n return createCmsModel({\n group,\n locale,\n tenant,\n ...modelDefinition\n });\n};\n"],"mappings":";;;;;;;;;;;AAAA;;AAeO,MAAMA,yBAAyB,GAAIC,MAAD,IAAoC;EACzE,MAAM;IAAEC,KAAF;IAASC,MAAT;IAAiBC,MAAjB;IAAyBC;EAAzB,IAA6CJ,MAAnD;EAEA,OAAO,IAAAK,8BAAA;IACHJ,KADG;IAEHC,MAFG;IAGHC;EAHG,GAIAC,eAJA,EAAP;AAMH,CATM"}
@@ -0,0 +1,7 @@
1
+ import { WorkflowModelDefinition } from "../../types";
2
+ interface CreateContentReviewModelDefinitionParams {
3
+ reviewerModelId: string;
4
+ }
5
+ export declare const CONTENT_REVIEW_MODEL_ID = "apwContentReviewModelDefinition";
6
+ export declare const createContentReviewModelDefinition: ({ reviewerModelId }: CreateContentReviewModelDefinitionParams) => WorkflowModelDefinition;
7
+ export {};
@@ -0,0 +1,258 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.createContentReviewModelDefinition = exports.CONTENT_REVIEW_MODEL_ID = void 0;
7
+
8
+ var _utils = require("./utils");
9
+
10
+ var _workflow = require("./workflow.model");
11
+
12
+ const contentField = fields => (0, _utils.createModelField)({
13
+ label: "Content",
14
+ parent: "contentReview",
15
+ type: "object",
16
+ multipleValues: false,
17
+ settings: {
18
+ fields
19
+ },
20
+ validation: [{
21
+ message: "`content` field value is required in contentReview.",
22
+ name: "required"
23
+ }]
24
+ });
25
+
26
+ const contentStatus = () => (0, _utils.createModelField)({
27
+ label: "Status",
28
+ fieldId: "reviewStatus",
29
+ parent: "contentReview",
30
+ type: "text",
31
+ predefinedValues: {
32
+ enabled: true,
33
+ values: [{
34
+ label: "Under review",
35
+ value: "underReview"
36
+ }, {
37
+ label: "Ready to be published",
38
+ value: "readyToBePublished"
39
+ }, {
40
+ label: "Published",
41
+ value: "published"
42
+ }]
43
+ },
44
+ validation: [{
45
+ message: "`reviewStatus` field value is required in contentReview.",
46
+ name: "required"
47
+ }]
48
+ });
49
+
50
+ const titleField = () => (0, _utils.createModelField)({
51
+ label: "Title",
52
+ type: "text",
53
+ parent: "contentReview",
54
+ validation: [{
55
+ message: "`title` field value is required in contentReview.",
56
+ name: "required"
57
+ }]
58
+ });
59
+
60
+ const contentIdField = () => (0, _utils.createModelField)({
61
+ label: "Id",
62
+ type: "text",
63
+ parent: "contentReview Content",
64
+ validation: [{
65
+ message: "`id` field value is required in contentReview Content.",
66
+ name: "required"
67
+ }]
68
+ });
69
+
70
+ const workflowIdField = () => (0, _utils.createModelField)({
71
+ label: "Workflow Id",
72
+ type: "text",
73
+ parent: "contentReview",
74
+ validation: [{
75
+ message: "`workflowId` field value is required in contentReview Content.",
76
+ name: "required"
77
+ }]
78
+ });
79
+
80
+ const contentTypeField = () => (0, _utils.createModelField)({
81
+ label: "Type",
82
+ type: "text",
83
+ parent: "contentReview Type",
84
+ predefinedValues: {
85
+ enabled: true,
86
+ values: [{
87
+ label: "Page",
88
+ value: "page"
89
+ }, {
90
+ value: "cms-entry",
91
+ label: "CMS Entry"
92
+ }]
93
+ },
94
+ validation: [{
95
+ message: "`type` field value is required in contentReview Type.",
96
+ name: "required"
97
+ }]
98
+ });
99
+
100
+ const contentSettingsField = fields => (0, _utils.createModelField)({
101
+ label: "Settings",
102
+ parent: "contentReview Content",
103
+ type: "object",
104
+ multipleValues: false,
105
+ settings: {
106
+ fields
107
+ }
108
+ });
109
+
110
+ const contentSettingsModelIdField = () => (0, _utils.createModelField)({
111
+ label: "Model Id",
112
+ parent: "contentReview Settings",
113
+ type: "text"
114
+ });
115
+
116
+ const scheduledActionIdField = () => (0, _utils.createModelField)({
117
+ label: "Scheduled action Id",
118
+ type: "text",
119
+ parent: "contentReview Content"
120
+ });
121
+
122
+ const contentScheduledOnField = () => (0, _utils.createModelField)({
123
+ label: "Scheduled on",
124
+ type: "datetime",
125
+ parent: "contentReview Content"
126
+ });
127
+
128
+ const contentScheduledByField = () => (0, _utils.createModelField)({
129
+ label: "Scheduled by",
130
+ type: "text",
131
+ parent: "contentReview Content"
132
+ });
133
+
134
+ const contentPublishedByField = () => (0, _utils.createModelField)({
135
+ label: "Published by",
136
+ type: "text",
137
+ parent: "contentReview Content"
138
+ });
139
+
140
+ const stepStatusField = () => ({
141
+ multipleValues: false,
142
+ listValidation: [],
143
+ renderer: {
144
+ name: "radio-buttons"
145
+ },
146
+ predefinedValues: {
147
+ enabled: true,
148
+ values: [{
149
+ value: "done",
150
+ label: "Steps done"
151
+ }, {
152
+ value: "active",
153
+ label: "Step active"
154
+ }, {
155
+ value: "inactive",
156
+ label: "Step inactive"
157
+ }]
158
+ },
159
+ label: "Status",
160
+ id: "contentReview_steps_status",
161
+ type: "text",
162
+ validation: [{
163
+ message: "`status` field value is required in contentReview steps status.",
164
+ name: "required"
165
+ }],
166
+ storageId: "status",
167
+ fieldId: "status"
168
+ });
169
+
170
+ const stepPendingChangeRequests = () => (0, _utils.createModelField)({
171
+ label: "Pending change requests",
172
+ type: "number",
173
+ parent: "contentReview Step",
174
+ validation: [{
175
+ message: "`pendingChangeRequests` field value is required in contentReview step.",
176
+ name: "required"
177
+ }]
178
+ });
179
+
180
+ const stepTotalComments = () => (0, _utils.createModelField)({
181
+ label: "Total comments",
182
+ type: "number",
183
+ parent: "contentReview Step",
184
+ validation: [{
185
+ message: "`totalComments` field value is required in contentReview step.",
186
+ name: "required"
187
+ }]
188
+ });
189
+
190
+ const latestCommentId = () => (0, _utils.createModelField)({
191
+ label: "Latest comment Id",
192
+ type: "text",
193
+ parent: "contentReview"
194
+ });
195
+
196
+ const stepSignOffProvidedOn = () => (0, _utils.createModelField)({
197
+ label: "Sign off provided on",
198
+ type: "datetime",
199
+ parent: "contentReview Step"
200
+ });
201
+
202
+ const stepSignOffProvidedBy = fields => (0, _utils.createModelField)({
203
+ label: "Sign off provided By",
204
+ type: "object",
205
+ parent: "contentReview Step",
206
+ multipleValues: false,
207
+ settings: {
208
+ fields
209
+ }
210
+ });
211
+
212
+ const stepSignOffProvidedById = () => (0, _utils.createModelField)({
213
+ label: "Id",
214
+ type: "text",
215
+ parent: "contentReview Step"
216
+ });
217
+
218
+ const stepSignOffProvidedByDisplayName = () => (0, _utils.createModelField)({
219
+ label: "DisplayName",
220
+ type: "text",
221
+ parent: "contentReview Step"
222
+ });
223
+
224
+ const stepsField = fields => ({
225
+ id: "contentReview_steps",
226
+ label: "Steps",
227
+ type: "object",
228
+ settings: {
229
+ fields,
230
+ layout: fields.map(field => [field.storageId])
231
+ },
232
+ listValidation: [],
233
+ validation: [],
234
+ fieldId: "steps",
235
+ storageId: "steps",
236
+ multipleValues: true,
237
+ predefinedValues: {
238
+ values: [],
239
+ enabled: false
240
+ }
241
+ });
242
+
243
+ const CONTENT_REVIEW_MODEL_ID = "apwContentReviewModelDefinition";
244
+ exports.CONTENT_REVIEW_MODEL_ID = CONTENT_REVIEW_MODEL_ID;
245
+
246
+ const createContentReviewModelDefinition = ({
247
+ reviewerModelId
248
+ }) => ({
249
+ name: "APW - Content Review",
250
+ modelId: CONTENT_REVIEW_MODEL_ID,
251
+ titleFieldId: "content",
252
+ layout: [["contentReview_title"], ["contentReview_content"], ["contentReview_reviewStatus"], ["contentReview_reviewRequestedBy"], ["contentReview_steps"], ["contentReview_changeRequested"], ["contentReview_latestCommentId"], ["contentReview_workflowId"]],
253
+ fields: [titleField(), contentField([contentIdField(), contentTypeField(), contentSettingsField([contentSettingsModelIdField()]), contentScheduledOnField(), contentScheduledByField(), scheduledActionIdField(), contentPublishedByField()]), contentStatus(), stepsField([(0, _workflow.stepTitleField)(), (0, _workflow.stepTypeField)(), (0, _workflow.stepIdField)(), (0, _workflow.stepReviewersField)(reviewerModelId), stepStatusField(), stepPendingChangeRequests(), stepTotalComments(), stepSignOffProvidedOn(), stepSignOffProvidedBy([stepSignOffProvidedById(), stepSignOffProvidedByDisplayName()])]), latestCommentId(), workflowIdField()],
254
+ description: "",
255
+ isPrivate: true
256
+ });
257
+
258
+ exports.createContentReviewModelDefinition = createContentReviewModelDefinition;
@@ -0,0 +1 @@
1
+ {"version":3,"names":["contentField","fields","createModelField","label","parent","type","multipleValues","settings","validation","message","name","contentStatus","fieldId","predefinedValues","enabled","values","value","titleField","contentIdField","workflowIdField","contentTypeField","contentSettingsField","contentSettingsModelIdField","scheduledActionIdField","contentScheduledOnField","contentScheduledByField","contentPublishedByField","stepStatusField","listValidation","renderer","id","storageId","stepPendingChangeRequests","stepTotalComments","latestCommentId","stepSignOffProvidedOn","stepSignOffProvidedBy","stepSignOffProvidedById","stepSignOffProvidedByDisplayName","stepsField","layout","map","field","CONTENT_REVIEW_MODEL_ID","createContentReviewModelDefinition","reviewerModelId","modelId","titleFieldId","stepTitleField","stepTypeField","stepIdField","stepReviewersField","description","isPrivate"],"sources":["contentReview.model.ts"],"sourcesContent":["import { createModelField } from \"./utils\";\nimport { stepTitleField, stepTypeField, stepIdField, stepReviewersField } from \"./workflow.model\";\nimport { CmsModelField } from \"@webiny/api-headless-cms/types\";\nimport { WorkflowModelDefinition } from \"~/types\";\n\nconst contentField = (fields: CmsModelField[]) =>\n createModelField({\n label: \"Content\",\n parent: \"contentReview\",\n type: \"object\",\n multipleValues: false,\n settings: { fields },\n validation: [\n {\n message: \"`content` field value is required in contentReview.\",\n name: \"required\"\n }\n ]\n });\n\nconst contentStatus = () =>\n createModelField({\n label: \"Status\",\n fieldId: \"reviewStatus\",\n parent: \"contentReview\",\n type: \"text\",\n predefinedValues: {\n enabled: true,\n values: [\n {\n label: \"Under review\",\n value: \"underReview\"\n },\n {\n label: \"Ready to be published\",\n value: \"readyToBePublished\"\n },\n {\n label: \"Published\",\n value: \"published\"\n }\n ]\n },\n validation: [\n {\n message: \"`reviewStatus` field value is required in contentReview.\",\n name: \"required\"\n }\n ]\n });\n\nconst titleField = () =>\n createModelField({\n label: \"Title\",\n type: \"text\",\n parent: \"contentReview\",\n validation: [\n {\n message: \"`title` field value is required in contentReview.\",\n name: \"required\"\n }\n ]\n });\n\nconst contentIdField = () =>\n createModelField({\n label: \"Id\",\n type: \"text\",\n parent: \"contentReview Content\",\n validation: [\n {\n message: \"`id` field value is required in contentReview Content.\",\n name: \"required\"\n }\n ]\n });\n\nconst workflowIdField = () =>\n createModelField({\n label: \"Workflow Id\",\n type: \"text\",\n parent: \"contentReview\",\n validation: [\n {\n message: \"`workflowId` field value is required in contentReview Content.\",\n name: \"required\"\n }\n ]\n });\n\nconst contentTypeField = () =>\n createModelField({\n label: \"Type\",\n type: \"text\",\n parent: \"contentReview Type\",\n predefinedValues: {\n enabled: true,\n values: [\n {\n label: \"Page\",\n value: \"page\"\n },\n { value: \"cms-entry\", label: \"CMS Entry\" }\n ]\n },\n validation: [\n {\n message: \"`type` field value is required in contentReview Type.\",\n name: \"required\"\n }\n ]\n });\n\nconst contentSettingsField = (fields: CmsModelField[]) =>\n createModelField({\n label: \"Settings\",\n parent: \"contentReview Content\",\n type: \"object\",\n multipleValues: false,\n settings: { fields }\n });\n\nconst contentSettingsModelIdField = () =>\n createModelField({\n label: \"Model Id\",\n parent: \"contentReview Settings\",\n type: \"text\"\n });\n\nconst scheduledActionIdField = () =>\n createModelField({\n label: \"Scheduled action Id\",\n type: \"text\",\n parent: \"contentReview Content\"\n });\n\nconst contentScheduledOnField = () =>\n createModelField({\n label: \"Scheduled on\",\n type: \"datetime\",\n parent: \"contentReview Content\"\n });\n\nconst contentScheduledByField = () =>\n createModelField({\n label: \"Scheduled by\",\n type: \"text\",\n parent: \"contentReview Content\"\n });\n\nconst contentPublishedByField = () =>\n createModelField({\n label: \"Published by\",\n type: \"text\",\n parent: \"contentReview Content\"\n });\n\nconst stepStatusField = (): CmsModelField => ({\n multipleValues: false,\n listValidation: [],\n renderer: {\n name: \"radio-buttons\"\n },\n predefinedValues: {\n enabled: true,\n values: [\n {\n value: \"done\",\n label: \"Steps done\"\n },\n {\n value: \"active\",\n label: \"Step active\"\n },\n {\n value: \"inactive\",\n label: \"Step inactive\"\n }\n ]\n },\n label: \"Status\",\n id: \"contentReview_steps_status\",\n type: \"text\",\n validation: [\n {\n message: \"`status` field value is required in contentReview steps status.\",\n name: \"required\"\n }\n ],\n storageId: \"status\",\n fieldId: \"status\"\n});\n\nconst stepPendingChangeRequests = () =>\n createModelField({\n label: \"Pending change requests\",\n type: \"number\",\n parent: \"contentReview Step\",\n validation: [\n {\n message: \"`pendingChangeRequests` field value is required in contentReview step.\",\n name: \"required\"\n }\n ]\n });\n\nconst stepTotalComments = () =>\n createModelField({\n label: \"Total comments\",\n type: \"number\",\n parent: \"contentReview Step\",\n validation: [\n {\n message: \"`totalComments` field value is required in contentReview step.\",\n name: \"required\"\n }\n ]\n });\n\nconst latestCommentId = () =>\n createModelField({\n label: \"Latest comment Id\",\n type: \"text\",\n parent: \"contentReview\"\n });\n\nconst stepSignOffProvidedOn = () =>\n createModelField({\n label: \"Sign off provided on\",\n type: \"datetime\",\n parent: \"contentReview Step\"\n });\n\nconst stepSignOffProvidedBy = (fields: CmsModelField[]) =>\n createModelField({\n label: \"Sign off provided By\",\n type: \"object\",\n parent: \"contentReview Step\",\n multipleValues: false,\n settings: { fields }\n });\n\nconst stepSignOffProvidedById = () =>\n createModelField({\n label: \"Id\",\n type: \"text\",\n parent: \"contentReview Step\"\n });\n\nconst stepSignOffProvidedByDisplayName = () =>\n createModelField({\n label: \"DisplayName\",\n type: \"text\",\n parent: \"contentReview Step\"\n });\n\nconst stepsField = (fields: CmsModelField[]): CmsModelField => ({\n id: \"contentReview_steps\",\n label: \"Steps\",\n type: \"object\",\n settings: {\n fields,\n layout: fields.map(field => [field.storageId])\n },\n listValidation: [],\n validation: [],\n fieldId: \"steps\",\n storageId: \"steps\",\n multipleValues: true,\n predefinedValues: {\n values: [],\n enabled: false\n }\n});\n\ninterface CreateContentReviewModelDefinitionParams {\n reviewerModelId: string;\n}\n\nexport const CONTENT_REVIEW_MODEL_ID = \"apwContentReviewModelDefinition\";\n\nexport const createContentReviewModelDefinition = ({\n reviewerModelId\n}: CreateContentReviewModelDefinitionParams): WorkflowModelDefinition => ({\n name: \"APW - Content Review\",\n modelId: CONTENT_REVIEW_MODEL_ID,\n titleFieldId: \"content\",\n layout: [\n [\"contentReview_title\"],\n [\"contentReview_content\"],\n [\"contentReview_reviewStatus\"],\n [\"contentReview_reviewRequestedBy\"],\n [\"contentReview_steps\"],\n [\"contentReview_changeRequested\"],\n [\"contentReview_latestCommentId\"],\n [\"contentReview_workflowId\"]\n ],\n fields: [\n titleField(),\n contentField([\n contentIdField(),\n contentTypeField(),\n contentSettingsField([contentSettingsModelIdField()]),\n contentScheduledOnField(),\n contentScheduledByField(),\n scheduledActionIdField(),\n contentPublishedByField()\n ]),\n contentStatus(),\n stepsField([\n stepTitleField(),\n stepTypeField(),\n stepIdField(),\n stepReviewersField(reviewerModelId),\n stepStatusField(),\n stepPendingChangeRequests(),\n stepTotalComments(),\n stepSignOffProvidedOn(),\n stepSignOffProvidedBy([stepSignOffProvidedById(), stepSignOffProvidedByDisplayName()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,IAAAC,qBAAA,GAHO,EAIP,IAAAC,4BAAA,EAAmBN,eAAnB,CAJO,EAKPlB,eAAe,EALR,EAMPK,yBAAyB,EANlB,EAOPC,iBAAiB,EAPV,EAQPE,qBAAqB,EARd,EASPC,qBAAqB,CAAC,CAACC,uBAAuB,EAAxB,EAA4BC,gCAAgC,EAA5D,CAAD,CATd,CAAD,CAZN,EAuBJJ,eAAe,EAvBX,EAwBJf,eAAe,EAxBX,CAd8D;EAwCtEiC,WAAW,EAAE,EAxCyD;EAyCtEC,SAAS,EAAE;AAzC2D,CAFxB,CAA3C"}
@@ -0,0 +1,2 @@
1
+ import { CmsContext } from "@webiny/api-headless-cms/types";
2
+ export declare const createApwModels: (context: CmsContext) => void;
@@ -0,0 +1,115 @@
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.createApwModels = void 0;
9
+
10
+ var _error = _interopRequireDefault(require("@webiny/error"));
11
+
12
+ var _apiHeadlessCms = require("@webiny/api-headless-cms");
13
+
14
+ var _contentModelPluginFactory = require("./contentModelPluginFactory");
15
+
16
+ var _workflow = require("./workflow.model");
17
+
18
+ var _contentReview = require("./contentReview.model");
19
+
20
+ var _reviewer = require("./reviewer.model");
21
+
22
+ var _comment = require("./comment.model");
23
+
24
+ var _changeRequest = require("./changeRequest.model");
25
+
26
+ var _utils = require("../../plugins/utils");
27
+
28
+ const createApwModels = context => {
29
+ /**
30
+ * This should never happen in the actual project.
31
+ * It is to make sure that we load setup context before the CRUD init in our internal code.
32
+ */
33
+ if (!context.cms) {
34
+ console.warn("Creating model before cms init.");
35
+ return;
36
+ }
37
+
38
+ if ((0, _utils.isInstallationPending)({
39
+ tenancy: context.tenancy,
40
+ i18n: context.i18n
41
+ })) {
42
+ return;
43
+ }
44
+
45
+ context.security.disableAuthorization();
46
+ const locale = context.i18n.getContentLocale();
47
+
48
+ if (!locale) {
49
+ throw new _error.default("Missing content locale in api-apw/storageOperations/index.ts", "LOCALE_ERROR");
50
+ }
51
+ /**
52
+ * TODO:@ashutosh
53
+ * We need to move these plugin in an installation plugin
54
+ */
55
+
56
+
57
+ const groupId = "contentModelGroup_apw";
58
+ /**
59
+ * Create a CmsGroup.
60
+ */
61
+
62
+ const cmsGroupPlugin = new _apiHeadlessCms.CmsGroupPlugin({
63
+ id: groupId,
64
+ slug: "apw",
65
+ name: "APW",
66
+ description: "Group for Advanced Publishing Workflow",
67
+ icon: "fas/star",
68
+ isPrivate: true
69
+ });
70
+ /**
71
+ * Create CmsModel plugins.
72
+ */
73
+
74
+ const changeRequestModelDefinition = (0, _changeRequest.createChangeRequestModelDefinition)();
75
+ const reviewerModelDefinition = (0, _reviewer.createReviewerModelDefinition)();
76
+ const workflowModelDefinition = (0, _workflow.createWorkflowModelDefinition)({
77
+ reviewerModelId: reviewerModelDefinition.modelId
78
+ });
79
+ const commentModelDefinition = (0, _comment.createCommentModelDefinition)({
80
+ modelId: changeRequestModelDefinition.modelId
81
+ });
82
+ const contentReviewModelDefinition = (0, _contentReview.createContentReviewModelDefinition)({
83
+ reviewerModelId: reviewerModelDefinition.modelId
84
+ });
85
+ const modelDefinitions = [workflowModelDefinition, contentReviewModelDefinition, reviewerModelDefinition, changeRequestModelDefinition, commentModelDefinition];
86
+ const cmsModelPlugins = [];
87
+
88
+ for (const modelDefinition of modelDefinitions) {
89
+ const cmsModelPlugin = (0, _contentModelPluginFactory.contentModelPluginFactory)({
90
+ group: cmsGroupPlugin.contentModelGroup,
91
+ tenant: context.tenancy.getCurrentTenant().id,
92
+ locale: locale.code,
93
+ modelDefinition
94
+ });
95
+ /**
96
+ * We want "title" field as the "titleField" for "ContentReview" model.
97
+ * so that we can later search entries by title.
98
+ */
99
+
100
+ if (cmsModelPlugin.contentModel.modelId === "apwContentReviewModelDefinition") {
101
+ cmsModelPlugin.contentModel.titleFieldId = "title";
102
+ }
103
+
104
+ cmsModelPlugins.push(cmsModelPlugin);
105
+ }
106
+ /**
107
+ * Register them so that they are accessible in cms context
108
+ */
109
+
110
+
111
+ context.plugins.register([cmsGroupPlugin, cmsModelPlugins]);
112
+ context.security.enableAuthorization();
113
+ };
114
+
115
+ exports.createApwModels = createApwModels;
@@ -0,0 +1 @@
1
+ {"version":3,"names":["createApwModels","context","cms","console","warn","isInstallationPending","tenancy","i18n","security","disableAuthorization","locale","getContentLocale","WebinyError","groupId","cmsGroupPlugin","CmsGroupPlugin","id","slug","name","description","icon","isPrivate","changeRequestModelDefinition","createChangeRequestModelDefinition","reviewerModelDefinition","createReviewerModelDefinition","workflowModelDefinition","createWorkflowModelDefinition","reviewerModelId","modelId","commentModelDefinition","createCommentModelDefinition","contentReviewModelDefinition","createContentReviewModelDefinition","modelDefinitions","cmsModelPlugins","modelDefinition","cmsModelPlugin","contentModelPluginFactory","group","contentModelGroup","tenant","getCurrentTenant","code","contentModel","titleFieldId","push","plugins","register","enableAuthorization"],"sources":["index.ts"],"sourcesContent":["import WebinyError from \"@webiny/error\";\nimport { CmsGroupPlugin } from \"@webiny/api-headless-cms\";\nimport { contentModelPluginFactory } from \"./contentModelPluginFactory\";\nimport { createWorkflowModelDefinition } from \"./workflow.model\";\nimport { createContentReviewModelDefinition } from \"./contentReview.model\";\nimport { createReviewerModelDefinition } from \"./reviewer.model\";\nimport { createCommentModelDefinition } from \"./comment.model\";\nimport { createChangeRequestModelDefinition } from \"./changeRequest.model\";\nimport { CmsContext } from \"@webiny/api-headless-cms/types\";\nimport { isInstallationPending } from \"~/plugins/utils\";\n\nexport const createApwModels = (context: CmsContext) => {\n /**\n * This should never happen in the actual project.\n * It is to make sure that we load setup context before the CRUD init in our internal code.\n */\n if (!context.cms) {\n console.warn(\"Creating model before cms init.\");\n return;\n }\n\n if (isInstallationPending({ tenancy: context.tenancy, i18n: context.i18n })) {\n return;\n }\n\n context.security.disableAuthorization();\n\n const locale = context.i18n.getContentLocale();\n if (!locale) {\n throw new WebinyError(\n \"Missing content locale in api-apw/storageOperations/index.ts\",\n \"LOCALE_ERROR\"\n );\n }\n /**\n * TODO:@ashutosh\n * We need to move these plugin in an installation plugin\n */\n const groupId = \"contentModelGroup_apw\";\n /**\n * Create a CmsGroup.\n */\n const cmsGroupPlugin = new CmsGroupPlugin({\n id: groupId,\n slug: \"apw\",\n name: \"APW\",\n description: \"Group for Advanced Publishing Workflow\",\n icon: \"fas/star\",\n isPrivate: true\n });\n\n /**\n * Create CmsModel plugins.\n */\n const changeRequestModelDefinition = createChangeRequestModelDefinition();\n const reviewerModelDefinition = createReviewerModelDefinition();\n const workflowModelDefinition = createWorkflowModelDefinition({\n reviewerModelId: reviewerModelDefinition.modelId\n });\n const commentModelDefinition = createCommentModelDefinition({\n modelId: changeRequestModelDefinition.modelId\n });\n const contentReviewModelDefinition = createContentReviewModelDefinition({\n reviewerModelId: reviewerModelDefinition.modelId\n });\n\n const modelDefinitions = [\n workflowModelDefinition,\n contentReviewModelDefinition,\n reviewerModelDefinition,\n changeRequestModelDefinition,\n commentModelDefinition\n ];\n\n const cmsModelPlugins = [];\n for (const modelDefinition of modelDefinitions) {\n const cmsModelPlugin = contentModelPluginFactory({\n group: cmsGroupPlugin.contentModelGroup,\n tenant: context.tenancy.getCurrentTenant().id,\n locale: locale.code,\n modelDefinition\n });\n /**\n * We want \"title\" field as the \"titleField\" for \"ContentReview\" model.\n * so that we can later search entries by title.\n */\n if (cmsModelPlugin.contentModel.modelId === \"apwContentReviewModelDefinition\") {\n cmsModelPlugin.contentModel.titleFieldId = \"title\";\n }\n cmsModelPlugins.push(cmsModelPlugin);\n }\n\n /**\n * Register them so that they are accessible in cms context\n */\n context.plugins.register([cmsGroupPlugin, cmsModelPlugins]);\n\n context.security.enableAuthorization();\n};\n"],"mappings":";;;;;;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AAEA;;AAEO,MAAMA,eAAe,GAAIC,OAAD,IAAyB;EACpD;AACJ;AACA;AACA;EACI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AIrBF,4BAJqB,EAKrBQ,sBALqB,CAAzB;EAQA,MAAMK,eAAe,GAAG,EAAxB;;EACA,KAAK,MAAMC,eAAX,IAA8BF,gBAA9B,EAAgD;IAC5C,MAAMG,cAAc,GAAG,IAAAC,oDAAA,EAA0B;MAC7CC,KAAK,EAAEzB,cAAc,CAAC0B,iBADuB;MAE7CC,MAAM,EAAExC,OAAO,CAACK,OAAR,CAAgBoC,gBAAhB,GAAmC1B,EAFE;MAG7CN,MAAM,EAAEA,MAAM,CAACiC,IAH8B;MAI7CP;IAJ6C,CAA1B,CAAvB;IAMA;AACR;AACA;AACA;;IACQ,IAAIC,cAAc,CAACO,YAAf,CAA4Bf,OAA5B,KAAwC,iCAA5C,EAA+E;MAC3EQ,cAAc,CAACO,YAAf,CAA4BC,YAA5B,GAA2C,OAA3C;IACH;;IACDV,eAAe,CAACW,IAAhB,CAAqBT,cAArB;EACH;EAED;AACJ;AACA;;;EACIpC,OAAO,CAAC8C,OAAR,CAAgBC,QAAhB,CAAyB,CAAClC,cAAD,EAAiBqB,eAAjB,CAAzB;EAEAlC,OAAO,CAACO,QAAR,CAAiByC,mBAAjB;AACH,CAvFM"}
@@ -0,0 +1,3 @@
1
+ import { WorkflowModelDefinition } from "../../types";
2
+ export declare const REVIEWER_MODEL_ID = "apwReviewerModelDefinition";
3
+ export declare const createReviewerModelDefinition: () => WorkflowModelDefinition;
@@ -0,0 +1,71 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.createReviewerModelDefinition = exports.REVIEWER_MODEL_ID = void 0;
7
+
8
+ var _utils = require("./utils");
9
+
10
+ const idField = () => (0, _utils.createModelField)({
11
+ label: "Identity Id",
12
+ type: "text",
13
+ parent: "reviewer",
14
+ validation: [{
15
+ message: "`identityId` field value is required in reviewer.",
16
+ name: "required"
17
+ }]
18
+ });
19
+
20
+ const displayNameField = () => (0, _utils.createModelField)({
21
+ label: "Display Name",
22
+ type: "text",
23
+ parent: "reviewer",
24
+ validation: [{
25
+ message: "`displayName` field value is required in reviewer.",
26
+ name: "required"
27
+ }]
28
+ });
29
+
30
+ const typeField = () => (0, _utils.createModelField)({
31
+ label: "Type",
32
+ type: "text",
33
+ parent: "reviewer",
34
+ validation: [{
35
+ message: "`type` field value is required in reviewer.",
36
+ name: "required"
37
+ }]
38
+ });
39
+
40
+ const emailField = () => (0, _utils.createModelField)({
41
+ label: "E-mail",
42
+ fieldId: "email",
43
+ type: "text",
44
+ parent: "reviewer",
45
+ validation: [{
46
+ message: "`email` field value in reviewer accepts only e-mails.",
47
+ name: "pattern",
48
+ settings: {
49
+ preset: "email",
50
+ regex: null,
51
+ flags: null
52
+ }
53
+ }]
54
+ });
55
+
56
+ const REVIEWER_MODEL_ID = "apwReviewerModelDefinition";
57
+ exports.REVIEWER_MODEL_ID = REVIEWER_MODEL_ID;
58
+
59
+ const createReviewerModelDefinition = () => {
60
+ return {
61
+ name: "APW - Reviewer",
62
+ modelId: REVIEWER_MODEL_ID,
63
+ titleFieldId: "displayName",
64
+ layout: [["reviewer_identityId"], ["reviewer_displayName"], ["reviewer_type"], ["reviewer_email"]],
65
+ fields: [idField(), displayNameField(), typeField(), emailField()],
66
+ description: "",
67
+ isPrivate: true
68
+ };
69
+ };
70
+
71
+ exports.createReviewerModelDefinition = createReviewerModelDefinition;
@@ -0,0 +1 @@
1
+ {"version":3,"names":["idField","createModelField","label","type","parent","validation","message","name","displayNameField","typeField","emailField","fieldId","settings","preset","regex","flags","REVIEWER_MODEL_ID","createReviewerModelDefinition","modelId","titleFieldId","layout","fields","description","isPrivate"],"sources":["reviewer.model.ts"],"sourcesContent":["import { createModelField } from \"./utils\";\nimport { WorkflowModelDefinition } from \"~/types\";\n\nconst idField = () =>\n createModelField({\n label: \"Identity Id\",\n type: \"text\",\n parent: \"reviewer\",\n validation: [\n {\n message: \"`identityId` field value is required in reviewer.\",\n name: \"required\"\n }\n ]\n });\n\nconst displayNameField = () =>\n createModelField({\n label: \"Display Name\",\n type: \"text\",\n parent: \"reviewer\",\n validation: [\n {\n message: \"`displayName` field value is required in reviewer.\",\n name: \"required\"\n }\n ]\n });\n\nconst typeField = () =>\n createModelField({\n label: \"Type\",\n type: \"text\",\n parent: \"reviewer\",\n validation: [\n {\n message: \"`type` field value is required in reviewer.\",\n name: \"required\"\n }\n ]\n });\n\nconst emailField = () =>\n createModelField({\n label: \"E-mail\",\n fieldId: \"email\",\n type: \"text\",\n parent: \"reviewer\",\n validation: [\n {\n message: \"`email` field value in reviewer accepts only e-mails.\",\n name: \"pattern\",\n settings: {\n preset: \"email\",\n regex: null,\n flags: null\n }\n }\n ]\n });\n\nexport const REVIEWER_MODEL_ID = \"apwReviewerModelDefinition\";\n\nexport const createReviewerModelDefinition = (): WorkflowModelDefinition => {\n return {\n name: \"APW - Reviewer\",\n modelId: REVIEWER_MODEL_ID,\n titleFieldId: \"displayName\",\n layout: [\n [\"reviewer_identityId\"],\n [\"reviewer_displayName\"],\n [\"reviewer_type\"],\n [\"reviewer_email\"]\n ],\n fields: [idField(), displayNameField(), typeField(), emailField()],\n description: \"\",\n isPrivate: true\n };\n};\n"],"mappings":";;;;;;;AAAA;;AAGA,MAAMA,OAAO,GAAG,MACZ,IAAAC,uBAAA,EAAiB;EACbC,KAAK,EAAE,aADM;EAEbC,IAAI,EAAE,MAFO;EAGbC,MAAM,EAAE,UAHK;EAIbC,UAAU,EAAE,CACR;IACIC,OAAO,EAAE,mDADb;IAEIC,IAAI,EAAE;EAFV,CADQ;AAJC,CAAjB,CADJ;;AAaA,MAAMC,gBAAgB,GAAG,MACrB,IAAAP,uBAAA,EAAiB;EACbC,KAAK,EAAE,cADM;EAEbC,IAAI,EAAE,MAFO;EAGbC,MAAM,EAAE,UAHK;EAIbC,UAAU,EAAE,CACR;IACIC,OAAO,EAAE,oDADb;IAEIC,IAAI,EAAE;EAFV,CADQ;AAJC,CAAjB,CADJ;;AAaA,MAAME,SAAS,GAAG,MACd,IAAAR,uBAAA,EAAiB;EACbC,KAAK,EAAE,MADM;EAEbC,IAAI,EAAE,MAFO;EAGbC,MAAM,EAAE,UAHK;EAIbC,UAAU,EAAE,CACR;IACIC,OAAO,EAAE,6CADb;IAEIC,IAAI,EAAE;EAFV,CADQ;AAJC,CAAjB,CADJ;;AAaA,MAAMG,UAAU,GAAG,MACf,IAAAT,uBAAA,EAAiB;EACbC,KAAK,EAAE,QADM;EAEbS,OAAO,EAAE,OAFI;EAGbR,IAAI,EAAE,MAHO;EAIbC,MAAM,EAAE,UAJK;EAKbC,UAAU,EAAE,CACR;IACIC,OAAO,EAAE,uDADb;IAEIC,IAAI,EAAE,SAFV;IAGIK,QAAQ,EAAE;MACNC,MAAM,EAAE,OADF;MAENC,KAAK,EAAE,IAFD;MAGNC,KAAK,EAAE;IAHD;EAHd,CADQ;AALC,CAAjB,CADJ;;AAmBO,MAAMC,iBAAiB,GAAG,4BAA1B;;;AAEA,MAAMC,6BAA6B,GAAG,MAA+B;EACxE,OAAO;IACHV,IAAI,EAAE,gBADH;IAEHW,OAAO,EAAEF,iBAFN;IAGHG,YAAY,EAAE,aAHX;IAIHC,MAAM,EAAE,CACJ,CAAC,qBAAD,CADI,EAEJ,CAAC,sBAAD,CAFI,EAGJ,CAAC,eAAD,CAHI,EAIJ,CAAC,gBAAD,CAJI,CAJL;IAUHC,MAAM,EAAE,CAACrB,OAAO,EAAR,EAAYQ,gBAAgB,EAA5B,EAAgCC,SAAS,EAAzC,EAA6CC,UAAU,EAAvD,CAVL;IAWHY,WAAW,EAAE,EAXV;IAYHC,SAAS,EAAE;EAZR,CAAP;AAcH,CAfM"}
@@ -0,0 +1,3 @@
1
+ import { CmsModelField } from "@webiny/api-headless-cms/types";
2
+ import { CreateModelFieldParams } from "../../plugins/utils";
3
+ export declare const createModelField: (params: CreateModelFieldParams) => CmsModelField;
@@ -0,0 +1,37 @@
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.createModelField = void 0;
9
+
10
+ var _camelCase = _interopRequireDefault(require("lodash/camelCase"));
11
+
12
+ const createModelField = params => {
13
+ const {
14
+ label,
15
+ fieldId: initialFieldId,
16
+ type,
17
+ parent
18
+ } = params;
19
+ const fieldId = initialFieldId ? (0, _camelCase.default)(initialFieldId) : (0, _camelCase.default)(label);
20
+ return {
21
+ id: `${(0, _camelCase.default)(parent)}_${fieldId}`,
22
+ storageId: fieldId,
23
+ fieldId,
24
+ label,
25
+ type,
26
+ settings: params.settings || {},
27
+ listValidation: params.listValidation || [],
28
+ validation: params.validation || [],
29
+ multipleValues: params.multipleValues || false,
30
+ predefinedValues: params.predefinedValues || {
31
+ values: [],
32
+ enabled: false
33
+ }
34
+ };
35
+ };
36
+
37
+ exports.createModelField = createModelField;
@@ -0,0 +1 @@
1
+ {"version":3,"names":["createModelField","params","label","fieldId","initialFieldId","type","parent","camelCase","id","storageId","settings","listValidation","validation","multipleValues","predefinedValues","values","enabled"],"sources":["utils.ts"],"sourcesContent":["import camelCase from \"lodash/camelCase\";\nimport { CmsModelField } from \"@webiny/api-headless-cms/types\";\nimport { CreateModelFieldParams } from \"~/plugins/utils\";\n\nexport const createModelField = (params: CreateModelFieldParams): CmsModelField => {\n const { label, fieldId: initialFieldId, type, parent } = params;\n const fieldId = initialFieldId ? camelCase(initialFieldId) : camelCase(label);\n return {\n id: `${camelCase(parent)}_${fieldId}`,\n storageId: fieldId,\n fieldId,\n label,\n type,\n settings: params.settings || {},\n listValidation: params.listValidation || [],\n validation: params.validation || [],\n multipleValues: params.multipleValues || false,\n predefinedValues: params.predefinedValues || {\n values: [],\n enabled: false\n }\n };\n};\n"],"mappings":";;;;;;;;;AAAA;;AAIO,MAAMA,gBAAgB,GAAIC,MAAD,IAAmD;EAC/E,MAAM;IAAEC,KAAF;IAASC,OAAO,EAAEC,cAAlB;IAAkCC,IAAlC;IAAwCC;EAAxC,IAAmDL,MAAzD;EACA,MAAME,OAAO,GAAGC,cAAc,GAAG,IAAAG,kBAAA,EAAUH,cAAV,CAAH,GAA+B,IAAAG,kBAAA,EAAUL,KAAV,CAA7D;EACA,OAAO;IACHM,EAAE,EAAG,GAAE,IAAAD,kBAAA,EAAUD,MAAV,CAAkB,IAAGH,OAAQ,EADjC;IAEHM,SAAS,EAAEN,OAFR;IAGHA,OAHG;IAIHD,KAJG;IAKHG,IALG;IAMHK,QAAQ,EAAET,MAAM,CAACS,QAAP,IAAmB,EAN1B;IAOHC,cAAc,EAAEV,MAAM,CAACU,cAAP,IAAyB,EAPtC;IAQHC,UAAU,EAAEX,MAAM,CAACW,UAAP,IAAqB,EAR9B;IASHC,cAAc,EAAEZ,MAAM,CAACY,cAAP,IAAyB,KATtC;IAUHC,gBAAgB,EAAEb,MAAM,CAACa,gBAAP,IAA2B;MACzCC,MAAM,EAAE,EADiC;MAEzCC,OAAO,EAAE;IAFgC;EAV1C,CAAP;AAeH,CAlBM"}
@@ -0,0 +1,12 @@
1
+ import { CmsModelField } from "@webiny/api-headless-cms/types";
2
+ import { WorkflowModelDefinition } from "../../types";
3
+ export declare const stepTitleField: () => CmsModelField;
4
+ export declare const stepTypeField: () => CmsModelField;
5
+ export declare const stepIdField: () => CmsModelField;
6
+ export declare const stepReviewersField: (reviewerModelId: string) => CmsModelField;
7
+ interface CreateWorkflowModelDefinitionParams {
8
+ reviewerModelId: string;
9
+ }
10
+ export declare const WORKFLOW_MODEL_ID = "apwWorkflowModelDefinition";
11
+ export declare const createWorkflowModelDefinition: ({ reviewerModelId }: CreateWorkflowModelDefinitionParams) => WorkflowModelDefinition;
12
+ export {};