@webiny/api-audit-logs 6.0.0-beta.0 → 6.0.0-rc.0

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 (413) hide show
  1. package/README.md +11 -1
  2. package/abstractions.d.ts +5 -0
  3. package/abstractions.js +6 -0
  4. package/abstractions.js.map +1 -0
  5. package/config.d.ts +0 -13
  6. package/config.js +3 -291
  7. package/config.js.map +1 -1
  8. package/context/AuditLogsContextValue.d.ts +10 -0
  9. package/context/AuditLogsContextValue.js +139 -0
  10. package/context/AuditLogsContextValue.js.map +1 -0
  11. package/context/index.d.ts +9 -0
  12. package/context/index.js +35 -0
  13. package/context/index.js.map +1 -0
  14. package/events/AuditLogAfterCreateEvent.d.ts +6 -0
  15. package/events/AuditLogAfterCreateEvent.js +10 -0
  16. package/events/AuditLogAfterCreateEvent.js.map +1 -0
  17. package/events/AuditLogAfterUpdateEvent.d.ts +6 -0
  18. package/events/AuditLogAfterUpdateEvent.js +10 -0
  19. package/events/AuditLogAfterUpdateEvent.js.map +1 -0
  20. package/events/AuditLogBeforeCreateEvent.d.ts +6 -0
  21. package/events/AuditLogBeforeCreateEvent.js +10 -0
  22. package/events/AuditLogBeforeCreateEvent.js.map +1 -0
  23. package/events/AuditLogBeforeUpdateEvent.d.ts +6 -0
  24. package/events/AuditLogBeforeUpdateEvent.js +10 -0
  25. package/events/AuditLogBeforeUpdateEvent.js.map +1 -0
  26. package/events/abstractions.d.ts +43 -0
  27. package/events/abstractions.js +27 -0
  28. package/events/abstractions.js.map +1 -0
  29. package/events/index.d.ts +5 -0
  30. package/events/index.js +7 -0
  31. package/events/index.js.map +1 -0
  32. package/graphql/schema.d.ts +3 -0
  33. package/graphql/schema.js +126 -0
  34. package/graphql/schema.js.map +1 -0
  35. package/graphql/validation.d.ts +64 -0
  36. package/graphql/validation.js +35 -0
  37. package/graphql/validation.js.map +1 -0
  38. package/index.d.ts +8 -4
  39. package/index.js +15 -41
  40. package/index.js.map +1 -1
  41. package/package.json +30 -34
  42. package/storage/AccessPatternHandler.d.ts +14 -0
  43. package/storage/AccessPatternHandler.js +60 -0
  44. package/storage/AccessPatternHandler.js.map +1 -0
  45. package/storage/Converter.d.ts +16 -0
  46. package/storage/Converter.js +52 -0
  47. package/storage/Converter.js.map +1 -0
  48. package/storage/Storage.d.ts +18 -0
  49. package/storage/Storage.js +89 -0
  50. package/storage/Storage.js.map +1 -0
  51. package/storage/abstractions/AccessPattern.d.ts +24 -0
  52. package/storage/abstractions/AccessPattern.js +3 -0
  53. package/storage/abstractions/AccessPattern.js.map +1 -0
  54. package/storage/abstractions/AccessPatternHandler.d.ts +13 -0
  55. package/storage/abstractions/AccessPatternHandler.js +3 -0
  56. package/storage/abstractions/AccessPatternHandler.js.map +1 -0
  57. package/storage/abstractions/Converter.d.ts +6 -0
  58. package/storage/abstractions/Converter.js +3 -0
  59. package/storage/abstractions/Converter.js.map +1 -0
  60. package/storage/abstractions/Storage.d.ts +108 -0
  61. package/storage/abstractions/Storage.js +3 -0
  62. package/storage/abstractions/Storage.js.map +1 -0
  63. package/storage/accessPatterns/AppAccessPattern.d.ts +9 -0
  64. package/storage/accessPatterns/AppAccessPattern.js +29 -0
  65. package/storage/accessPatterns/AppAccessPattern.js.map +1 -0
  66. package/storage/accessPatterns/AppCreatedByAccessPattern.d.ts +9 -0
  67. package/storage/accessPatterns/AppCreatedByAccessPattern.js +32 -0
  68. package/storage/accessPatterns/AppCreatedByAccessPattern.js.map +1 -0
  69. package/storage/accessPatterns/AppEntityAccessPattern.d.ts +9 -0
  70. package/storage/accessPatterns/AppEntityAccessPattern.js +29 -0
  71. package/storage/accessPatterns/AppEntityAccessPattern.js.map +1 -0
  72. package/storage/accessPatterns/AppEntityActionAccessPattern.d.ts +9 -0
  73. package/storage/accessPatterns/AppEntityActionAccessPattern.js +29 -0
  74. package/storage/accessPatterns/AppEntityActionAccessPattern.js.map +1 -0
  75. package/storage/accessPatterns/AppEntityActionCreatedByAccessPattern.d.ts +9 -0
  76. package/storage/accessPatterns/AppEntityActionCreatedByAccessPattern.js +32 -0
  77. package/storage/accessPatterns/AppEntityActionCreatedByAccessPattern.js.map +1 -0
  78. package/storage/accessPatterns/AppEntityCreatedByAccessPattern.d.ts +9 -0
  79. package/storage/accessPatterns/AppEntityCreatedByAccessPattern.js +32 -0
  80. package/storage/accessPatterns/AppEntityCreatedByAccessPattern.js.map +1 -0
  81. package/storage/accessPatterns/BaseAccessPattern.d.ts +32 -0
  82. package/storage/accessPatterns/BaseAccessPattern.js +82 -0
  83. package/storage/accessPatterns/BaseAccessPattern.js.map +1 -0
  84. package/storage/accessPatterns/CreatedByAccessPattern.d.ts +9 -0
  85. package/storage/accessPatterns/CreatedByAccessPattern.js +32 -0
  86. package/storage/accessPatterns/CreatedByAccessPattern.js.map +1 -0
  87. package/storage/accessPatterns/CreatedOnAccessPattern.d.ts +9 -0
  88. package/storage/accessPatterns/CreatedOnAccessPattern.js +30 -0
  89. package/storage/accessPatterns/CreatedOnAccessPattern.js.map +1 -0
  90. package/storage/accessPatterns/DefaultAccessPattern.d.ts +15 -0
  91. package/storage/accessPatterns/DefaultAccessPattern.js +36 -0
  92. package/storage/accessPatterns/DefaultAccessPattern.js.map +1 -0
  93. package/storage/accessPatterns/EntityIdAccessPattern.d.ts +9 -0
  94. package/storage/accessPatterns/EntityIdAccessPattern.js +33 -0
  95. package/storage/accessPatterns/EntityIdAccessPattern.js.map +1 -0
  96. package/storage/accessPatterns/index.d.ts +6 -0
  97. package/storage/accessPatterns/index.js +47 -0
  98. package/storage/accessPatterns/index.js.map +1 -0
  99. package/storage/cursorSchema.d.ts +4 -0
  100. package/storage/cursorSchema.js +25 -0
  101. package/storage/cursorSchema.js.map +1 -0
  102. package/storage/entity.d.ts +36 -0
  103. package/storage/entity.js +127 -0
  104. package/storage/entity.js.map +1 -0
  105. package/storage/results/ListErrorResult.d.ts +10 -0
  106. package/storage/results/ListErrorResult.js +11 -0
  107. package/storage/results/ListErrorResult.js.map +1 -0
  108. package/storage/results/ListSuccessResult.d.ts +14 -0
  109. package/storage/results/ListSuccessResult.js +16 -0
  110. package/storage/results/ListSuccessResult.js.map +1 -0
  111. package/storage/results/index.d.ts +2 -0
  112. package/storage/results/index.js +4 -0
  113. package/storage/results/index.js.map +1 -0
  114. package/storage/startKey.d.ts +6 -0
  115. package/storage/startKey.js +9 -0
  116. package/storage/startKey.js.map +1 -0
  117. package/storage/types.d.ts +54 -0
  118. package/storage/types.js +3 -0
  119. package/storage/types.js.map +1 -0
  120. package/subscriptions/aco/handlers/AuditLogFolderAfterCreateHandler.d.ts +11 -0
  121. package/subscriptions/aco/handlers/AuditLogFolderAfterCreateHandler.js +35 -0
  122. package/subscriptions/aco/handlers/AuditLogFolderAfterCreateHandler.js.map +1 -0
  123. package/subscriptions/aco/handlers/AuditLogFolderAfterDeleteHandler.d.ts +11 -0
  124. package/subscriptions/aco/handlers/AuditLogFolderAfterDeleteHandler.js +38 -0
  125. package/subscriptions/aco/handlers/AuditLogFolderAfterDeleteHandler.js.map +1 -0
  126. package/subscriptions/aco/handlers/AuditLogFolderAfterUpdateHandler.d.ts +11 -0
  127. package/subscriptions/aco/handlers/AuditLogFolderAfterUpdateHandler.js +42 -0
  128. package/subscriptions/aco/handlers/AuditLogFolderAfterUpdateHandler.js.map +1 -0
  129. package/subscriptions/aco/index.d.ts +1 -1
  130. package/subscriptions/aco/index.js +7 -15
  131. package/subscriptions/aco/index.js.map +1 -1
  132. package/subscriptions/fileManager/handlers/AuditLogFileAfterCreateHandler.d.ts +11 -0
  133. package/subscriptions/fileManager/handlers/AuditLogFileAfterCreateHandler.js +30 -0
  134. package/subscriptions/fileManager/handlers/AuditLogFileAfterCreateHandler.js.map +1 -0
  135. package/subscriptions/fileManager/handlers/AuditLogFileAfterDeleteHandler.d.ts +11 -0
  136. package/subscriptions/fileManager/handlers/AuditLogFileAfterDeleteHandler.js +30 -0
  137. package/subscriptions/fileManager/handlers/AuditLogFileAfterDeleteHandler.js.map +1 -0
  138. package/subscriptions/fileManager/handlers/AuditLogFileAfterUpdateHandler.d.ts +11 -0
  139. package/subscriptions/fileManager/handlers/AuditLogFileAfterUpdateHandler.js +34 -0
  140. package/subscriptions/fileManager/handlers/AuditLogFileAfterUpdateHandler.js.map +1 -0
  141. package/subscriptions/fileManager/handlers/AuditLogSettingsAfterUpdateHandler.d.ts +11 -0
  142. package/subscriptions/fileManager/handlers/AuditLogSettingsAfterUpdateHandler.js +34 -0
  143. package/subscriptions/fileManager/handlers/AuditLogSettingsAfterUpdateHandler.js.map +1 -0
  144. package/subscriptions/fileManager/index.d.ts +2 -2
  145. package/subscriptions/fileManager/index.js +11 -13
  146. package/subscriptions/fileManager/index.js.map +1 -1
  147. package/subscriptions/headlessCms/handlers/AuditLogEntryAfterCreateEventHandler.d.ts +11 -0
  148. package/subscriptions/headlessCms/handlers/AuditLogEntryAfterCreateEventHandler.js +34 -0
  149. package/subscriptions/headlessCms/handlers/AuditLogEntryAfterCreateEventHandler.js.map +1 -0
  150. package/subscriptions/headlessCms/handlers/AuditLogEntryAfterDeleteEventHandler.d.ts +11 -0
  151. package/subscriptions/headlessCms/handlers/AuditLogEntryAfterDeleteEventHandler.js +40 -0
  152. package/subscriptions/headlessCms/handlers/AuditLogEntryAfterDeleteEventHandler.js.map +1 -0
  153. package/subscriptions/headlessCms/handlers/AuditLogEntryAfterPublishEventHandler.d.ts +11 -0
  154. package/subscriptions/headlessCms/handlers/AuditLogEntryAfterPublishEventHandler.js +34 -0
  155. package/subscriptions/headlessCms/handlers/AuditLogEntryAfterPublishEventHandler.js.map +1 -0
  156. package/subscriptions/headlessCms/handlers/AuditLogEntryAfterRestoreFromBinEventHandler.d.ts +11 -0
  157. package/subscriptions/headlessCms/handlers/AuditLogEntryAfterRestoreFromBinEventHandler.js +34 -0
  158. package/subscriptions/headlessCms/handlers/AuditLogEntryAfterRestoreFromBinEventHandler.js.map +1 -0
  159. package/subscriptions/headlessCms/handlers/AuditLogEntryAfterUnpublishEventHandler.d.ts +11 -0
  160. package/subscriptions/headlessCms/handlers/AuditLogEntryAfterUnpublishEventHandler.js +34 -0
  161. package/subscriptions/headlessCms/handlers/AuditLogEntryAfterUnpublishEventHandler.js.map +1 -0
  162. package/subscriptions/headlessCms/handlers/AuditLogEntryAfterUpdateEventHandler.d.ts +11 -0
  163. package/subscriptions/headlessCms/handlers/AuditLogEntryAfterUpdateEventHandler.js +38 -0
  164. package/subscriptions/headlessCms/handlers/AuditLogEntryAfterUpdateEventHandler.js.map +1 -0
  165. package/subscriptions/headlessCms/handlers/AuditLogEntryRevisionAfterCreateEventHandler.d.ts +11 -0
  166. package/subscriptions/headlessCms/handlers/AuditLogEntryRevisionAfterCreateEventHandler.js +34 -0
  167. package/subscriptions/headlessCms/handlers/AuditLogEntryRevisionAfterCreateEventHandler.js.map +1 -0
  168. package/subscriptions/headlessCms/handlers/AuditLogEntryRevisionAfterDeleteEventHandler.d.ts +11 -0
  169. package/subscriptions/headlessCms/handlers/AuditLogEntryRevisionAfterDeleteEventHandler.js +34 -0
  170. package/subscriptions/headlessCms/handlers/AuditLogEntryRevisionAfterDeleteEventHandler.js.map +1 -0
  171. package/subscriptions/headlessCms/handlers/AuditLogGroupAfterCreateEventHandler.d.ts +11 -0
  172. package/subscriptions/headlessCms/handlers/AuditLogGroupAfterCreateEventHandler.js +30 -0
  173. package/subscriptions/headlessCms/handlers/AuditLogGroupAfterCreateEventHandler.js.map +1 -0
  174. package/subscriptions/headlessCms/handlers/AuditLogGroupAfterDeleteEventHandler.d.ts +11 -0
  175. package/subscriptions/headlessCms/handlers/AuditLogGroupAfterDeleteEventHandler.js +30 -0
  176. package/subscriptions/headlessCms/handlers/AuditLogGroupAfterDeleteEventHandler.js.map +1 -0
  177. package/subscriptions/headlessCms/handlers/AuditLogGroupAfterUpdateEventHandler.d.ts +11 -0
  178. package/subscriptions/headlessCms/handlers/AuditLogGroupAfterUpdateEventHandler.js +34 -0
  179. package/subscriptions/headlessCms/handlers/AuditLogGroupAfterUpdateEventHandler.js.map +1 -0
  180. package/subscriptions/headlessCms/handlers/AuditLogModelAfterCreateEventHandler.d.ts +11 -0
  181. package/subscriptions/headlessCms/handlers/AuditLogModelAfterCreateEventHandler.js +30 -0
  182. package/subscriptions/headlessCms/handlers/AuditLogModelAfterCreateEventHandler.js.map +1 -0
  183. package/subscriptions/headlessCms/handlers/AuditLogModelAfterDeleteEventHandler.d.ts +11 -0
  184. package/subscriptions/headlessCms/handlers/AuditLogModelAfterDeleteEventHandler.js +30 -0
  185. package/subscriptions/headlessCms/handlers/AuditLogModelAfterDeleteEventHandler.js.map +1 -0
  186. package/subscriptions/headlessCms/handlers/AuditLogModelAfterUpdateEventHandler.d.ts +11 -0
  187. package/subscriptions/headlessCms/handlers/AuditLogModelAfterUpdateEventHandler.js +34 -0
  188. package/subscriptions/headlessCms/handlers/AuditLogModelAfterUpdateEventHandler.js.map +1 -0
  189. package/subscriptions/headlessCms/index.d.ts +1 -1
  190. package/subscriptions/headlessCms/index.js +33 -27
  191. package/subscriptions/headlessCms/index.js.map +1 -1
  192. package/subscriptions/index.d.ts +1 -1
  193. package/subscriptions/index.js +13 -26
  194. package/subscriptions/index.js.map +1 -1
  195. package/subscriptions/mailer/handlers/AuditLogMailerSettingsAfterSaveHandler.d.ts +11 -0
  196. package/subscriptions/mailer/handlers/AuditLogMailerSettingsAfterSaveHandler.js +32 -0
  197. package/subscriptions/mailer/handlers/AuditLogMailerSettingsAfterSaveHandler.js.map +1 -0
  198. package/subscriptions/mailer/index.d.ts +2 -2
  199. package/subscriptions/mailer/index.js +4 -10
  200. package/subscriptions/mailer/index.js.map +1 -1
  201. package/subscriptions/security/handlers/AuditLogApiKeyAfterCreateHandler.d.ts +11 -0
  202. package/subscriptions/security/handlers/AuditLogApiKeyAfterCreateHandler.js +47 -0
  203. package/subscriptions/security/handlers/AuditLogApiKeyAfterCreateHandler.js.map +1 -0
  204. package/subscriptions/security/handlers/AuditLogApiKeyAfterDeleteHandler.d.ts +11 -0
  205. package/subscriptions/security/handlers/AuditLogApiKeyAfterDeleteHandler.js +47 -0
  206. package/subscriptions/security/handlers/AuditLogApiKeyAfterDeleteHandler.js.map +1 -0
  207. package/subscriptions/security/handlers/AuditLogApiKeyAfterUpdateHandler.d.ts +11 -0
  208. package/subscriptions/security/handlers/AuditLogApiKeyAfterUpdateHandler.js +52 -0
  209. package/subscriptions/security/handlers/AuditLogApiKeyAfterUpdateHandler.js.map +1 -0
  210. package/subscriptions/security/handlers/AuditLogRoleAfterCreateHandler.d.ts +11 -0
  211. package/subscriptions/security/handlers/AuditLogRoleAfterCreateHandler.js +30 -0
  212. package/subscriptions/security/handlers/AuditLogRoleAfterCreateHandler.js.map +1 -0
  213. package/subscriptions/security/handlers/AuditLogRoleAfterDeleteHandler.d.ts +11 -0
  214. package/subscriptions/security/handlers/AuditLogRoleAfterDeleteHandler.js +30 -0
  215. package/subscriptions/security/handlers/AuditLogRoleAfterDeleteHandler.js.map +1 -0
  216. package/subscriptions/security/handlers/AuditLogRoleAfterUpdateHandler.d.ts +11 -0
  217. package/subscriptions/security/handlers/AuditLogRoleAfterUpdateHandler.js +34 -0
  218. package/subscriptions/security/handlers/AuditLogRoleAfterUpdateHandler.js.map +1 -0
  219. package/subscriptions/security/handlers/AuditLogTeamAfterCreateHandler.d.ts +11 -0
  220. package/subscriptions/security/handlers/AuditLogTeamAfterCreateHandler.js +30 -0
  221. package/subscriptions/security/handlers/AuditLogTeamAfterCreateHandler.js.map +1 -0
  222. package/subscriptions/security/handlers/AuditLogTeamAfterDeleteHandler.d.ts +11 -0
  223. package/subscriptions/security/handlers/AuditLogTeamAfterDeleteHandler.js +30 -0
  224. package/subscriptions/security/handlers/AuditLogTeamAfterDeleteHandler.js.map +1 -0
  225. package/subscriptions/security/handlers/AuditLogTeamAfterUpdateHandler.d.ts +11 -0
  226. package/subscriptions/security/handlers/AuditLogTeamAfterUpdateHandler.js +34 -0
  227. package/subscriptions/security/handlers/AuditLogTeamAfterUpdateHandler.js.map +1 -0
  228. package/subscriptions/security/handlers/AuditLogUserAfterCreateHandler.d.ts +11 -0
  229. package/subscriptions/security/handlers/AuditLogUserAfterCreateHandler.js +30 -0
  230. package/subscriptions/security/handlers/AuditLogUserAfterCreateHandler.js.map +1 -0
  231. package/subscriptions/security/handlers/AuditLogUserAfterDeleteHandler.d.ts +11 -0
  232. package/subscriptions/security/handlers/AuditLogUserAfterDeleteHandler.js +30 -0
  233. package/subscriptions/security/handlers/AuditLogUserAfterDeleteHandler.js.map +1 -0
  234. package/subscriptions/security/handlers/AuditLogUserAfterUpdateHandler.d.ts +11 -0
  235. package/subscriptions/security/handlers/AuditLogUserAfterUpdateHandler.js +34 -0
  236. package/subscriptions/security/handlers/AuditLogUserAfterUpdateHandler.js.map +1 -0
  237. package/subscriptions/security/handlers/cleanupApiKey.d.ts +7 -0
  238. package/subscriptions/security/handlers/cleanupApiKey.js +18 -0
  239. package/subscriptions/security/handlers/cleanupApiKey.js.map +1 -0
  240. package/subscriptions/security/index.d.ts +2 -2
  241. package/subscriptions/security/index.js +31 -23
  242. package/subscriptions/security/index.js.map +1 -1
  243. package/subscriptions/websiteBuilder/index.d.ts +2 -0
  244. package/subscriptions/websiteBuilder/index.js +31 -0
  245. package/subscriptions/websiteBuilder/index.js.map +1 -0
  246. package/subscriptions/websiteBuilder/pages/PageAfterCreateHandler.d.ts +11 -0
  247. package/subscriptions/websiteBuilder/pages/PageAfterCreateHandler.js +30 -0
  248. package/subscriptions/websiteBuilder/pages/PageAfterCreateHandler.js.map +1 -0
  249. package/subscriptions/websiteBuilder/pages/PageAfterCreateRevisionFromHandler.d.ts +11 -0
  250. package/subscriptions/websiteBuilder/pages/PageAfterCreateRevisionFromHandler.js +30 -0
  251. package/subscriptions/websiteBuilder/pages/PageAfterCreateRevisionFromHandler.js.map +1 -0
  252. package/subscriptions/websiteBuilder/pages/PageAfterDeleteHandler.d.ts +11 -0
  253. package/subscriptions/websiteBuilder/pages/PageAfterDeleteHandler.js +30 -0
  254. package/subscriptions/websiteBuilder/pages/PageAfterDeleteHandler.js.map +1 -0
  255. package/subscriptions/websiteBuilder/pages/PageAfterDuplicateHandler.d.ts +11 -0
  256. package/subscriptions/websiteBuilder/pages/PageAfterDuplicateHandler.js +34 -0
  257. package/subscriptions/websiteBuilder/pages/PageAfterDuplicateHandler.js.map +1 -0
  258. package/subscriptions/websiteBuilder/pages/PageAfterMoveHandler.d.ts +11 -0
  259. package/subscriptions/websiteBuilder/pages/PageAfterMoveHandler.js +30 -0
  260. package/subscriptions/websiteBuilder/pages/PageAfterMoveHandler.js.map +1 -0
  261. package/subscriptions/websiteBuilder/pages/PageAfterPublishHandler.d.ts +11 -0
  262. package/subscriptions/websiteBuilder/pages/PageAfterPublishHandler.js +30 -0
  263. package/subscriptions/websiteBuilder/pages/PageAfterPublishHandler.js.map +1 -0
  264. package/subscriptions/websiteBuilder/pages/PageAfterUnpublishHandler.d.ts +11 -0
  265. package/subscriptions/websiteBuilder/pages/PageAfterUnpublishHandler.js +30 -0
  266. package/subscriptions/websiteBuilder/pages/PageAfterUnpublishHandler.js.map +1 -0
  267. package/subscriptions/websiteBuilder/pages/PageAfterUpdateHandler.d.ts +11 -0
  268. package/subscriptions/websiteBuilder/pages/PageAfterUpdateHandler.js +34 -0
  269. package/subscriptions/websiteBuilder/pages/PageAfterUpdateHandler.js.map +1 -0
  270. package/subscriptions/websiteBuilder/redirects/RedirectAfterCreateHandler.d.ts +11 -0
  271. package/subscriptions/websiteBuilder/redirects/RedirectAfterCreateHandler.js +30 -0
  272. package/subscriptions/websiteBuilder/redirects/RedirectAfterCreateHandler.js.map +1 -0
  273. package/subscriptions/websiteBuilder/redirects/RedirectAfterDeleteHandler.d.ts +11 -0
  274. package/subscriptions/websiteBuilder/redirects/RedirectAfterDeleteHandler.js +30 -0
  275. package/subscriptions/websiteBuilder/redirects/RedirectAfterDeleteHandler.js.map +1 -0
  276. package/subscriptions/websiteBuilder/redirects/RedirectAfterMoveHandler.d.ts +11 -0
  277. package/subscriptions/websiteBuilder/redirects/RedirectAfterMoveHandler.js +30 -0
  278. package/subscriptions/websiteBuilder/redirects/RedirectAfterMoveHandler.js.map +1 -0
  279. package/subscriptions/websiteBuilder/redirects/RedirectAfterUpdateHandler.d.ts +11 -0
  280. package/subscriptions/websiteBuilder/redirects/RedirectAfterUpdateHandler.js +34 -0
  281. package/subscriptions/websiteBuilder/redirects/RedirectAfterUpdateHandler.js.map +1 -0
  282. package/types.d.ts +37 -43
  283. package/types.js +1 -16
  284. package/types.js.map +1 -1
  285. package/utils/expiresAt.d.ts +4 -0
  286. package/utils/expiresAt.js +25 -0
  287. package/utils/expiresAt.js.map +1 -0
  288. package/utils/getAuditConfig.d.ts +4 -36
  289. package/utils/getAuditConfig.js +77 -113
  290. package/utils/getAuditConfig.js.map +1 -1
  291. package/utils/getAuditObject.d.ts +2 -1
  292. package/utils/getAuditObject.js +1 -8
  293. package/utils/getAuditObject.js.map +1 -1
  294. package/app/app.d.ts +0 -2
  295. package/app/app.js +0 -120
  296. package/app/app.js.map +0 -1
  297. package/app/contants.d.ts +0 -2
  298. package/app/contants.js +0 -10
  299. package/app/contants.js.map +0 -1
  300. package/app/createAppModifier.d.ts +0 -4
  301. package/app/createAppModifier.js +0 -14
  302. package/app/createAppModifier.js.map +0 -1
  303. package/app/index.d.ts +0 -4
  304. package/app/index.js +0 -43
  305. package/app/index.js.map +0 -1
  306. package/app/types.d.ts +0 -7
  307. package/app/types.js +0 -7
  308. package/app/types.js.map +0 -1
  309. package/subscriptions/aco/folders.d.ts +0 -4
  310. package/subscriptions/aco/folders.js +0 -94
  311. package/subscriptions/aco/folders.js.map +0 -1
  312. package/subscriptions/apw/changeRequests.d.ts +0 -4
  313. package/subscriptions/apw/changeRequests.js +0 -80
  314. package/subscriptions/apw/changeRequests.js.map +0 -1
  315. package/subscriptions/apw/comments.d.ts +0 -2
  316. package/subscriptions/apw/comments.js +0 -28
  317. package/subscriptions/apw/comments.js.map +0 -1
  318. package/subscriptions/apw/contentReviews.d.ts +0 -2
  319. package/subscriptions/apw/contentReviews.js +0 -28
  320. package/subscriptions/apw/contentReviews.js.map +0 -1
  321. package/subscriptions/apw/index.d.ts +0 -2
  322. package/subscriptions/apw/index.js +0 -26
  323. package/subscriptions/apw/index.js.map +0 -1
  324. package/subscriptions/apw/workflows.d.ts +0 -4
  325. package/subscriptions/apw/workflows.js +0 -64
  326. package/subscriptions/apw/workflows.js.map +0 -1
  327. package/subscriptions/fileManager/files.d.ts +0 -4
  328. package/subscriptions/fileManager/files.js +0 -64
  329. package/subscriptions/fileManager/files.js.map +0 -1
  330. package/subscriptions/fileManager/settings.d.ts +0 -2
  331. package/subscriptions/fileManager/settings.js +0 -32
  332. package/subscriptions/fileManager/settings.js.map +0 -1
  333. package/subscriptions/formBuilder/formRevisions.d.ts +0 -6
  334. package/subscriptions/formBuilder/formRevisions.js +0 -96
  335. package/subscriptions/formBuilder/formRevisions.js.map +0 -1
  336. package/subscriptions/formBuilder/formSubmissions.d.ts +0 -2
  337. package/subscriptions/formBuilder/formSubmissions.js +0 -28
  338. package/subscriptions/formBuilder/formSubmissions.js.map +0 -1
  339. package/subscriptions/formBuilder/forms.d.ts +0 -5
  340. package/subscriptions/formBuilder/forms.js +0 -76
  341. package/subscriptions/formBuilder/forms.js.map +0 -1
  342. package/subscriptions/formBuilder/index.d.ts +0 -2
  343. package/subscriptions/formBuilder/index.js +0 -26
  344. package/subscriptions/formBuilder/index.js.map +0 -1
  345. package/subscriptions/formBuilder/settings.d.ts +0 -2
  346. package/subscriptions/formBuilder/settings.js +0 -32
  347. package/subscriptions/formBuilder/settings.js.map +0 -1
  348. package/subscriptions/headlessCms/entries.d.ts +0 -9
  349. package/subscriptions/headlessCms/entries.js +0 -183
  350. package/subscriptions/headlessCms/entries.js.map +0 -1
  351. package/subscriptions/headlessCms/groups.d.ts +0 -4
  352. package/subscriptions/headlessCms/groups.js +0 -64
  353. package/subscriptions/headlessCms/groups.js.map +0 -1
  354. package/subscriptions/headlessCms/models.d.ts +0 -4
  355. package/subscriptions/headlessCms/models.js +0 -64
  356. package/subscriptions/headlessCms/models.js.map +0 -1
  357. package/subscriptions/headlessCms/utils/isSearchModelEntry.d.ts +0 -1
  358. package/subscriptions/headlessCms/utils/isSearchModelEntry.js +0 -13
  359. package/subscriptions/headlessCms/utils/isSearchModelEntry.js.map +0 -1
  360. package/subscriptions/i18n/index.d.ts +0 -2
  361. package/subscriptions/i18n/index.js +0 -15
  362. package/subscriptions/i18n/index.js.map +0 -1
  363. package/subscriptions/i18n/locales.d.ts +0 -4
  364. package/subscriptions/i18n/locales.js +0 -64
  365. package/subscriptions/i18n/locales.js.map +0 -1
  366. package/subscriptions/mailer/settings.d.ts +0 -2
  367. package/subscriptions/mailer/settings.js +0 -32
  368. package/subscriptions/mailer/settings.js.map +0 -1
  369. package/subscriptions/pageBuilder/blockCategories.d.ts +0 -4
  370. package/subscriptions/pageBuilder/blockCategories.js +0 -64
  371. package/subscriptions/pageBuilder/blockCategories.js.map +0 -1
  372. package/subscriptions/pageBuilder/blocks.d.ts +0 -6
  373. package/subscriptions/pageBuilder/blocks.js +0 -96
  374. package/subscriptions/pageBuilder/blocks.js.map +0 -1
  375. package/subscriptions/pageBuilder/categories.d.ts +0 -4
  376. package/subscriptions/pageBuilder/categories.js +0 -64
  377. package/subscriptions/pageBuilder/categories.js.map +0 -1
  378. package/subscriptions/pageBuilder/index.d.ts +0 -2
  379. package/subscriptions/pageBuilder/index.js +0 -51
  380. package/subscriptions/pageBuilder/index.js.map +0 -1
  381. package/subscriptions/pageBuilder/menus.d.ts +0 -4
  382. package/subscriptions/pageBuilder/menus.js +0 -64
  383. package/subscriptions/pageBuilder/menus.js.map +0 -1
  384. package/subscriptions/pageBuilder/pageElements.d.ts +0 -4
  385. package/subscriptions/pageBuilder/pageElements.js +0 -64
  386. package/subscriptions/pageBuilder/pageElements.js.map +0 -1
  387. package/subscriptions/pageBuilder/pageRevisions.d.ts +0 -6
  388. package/subscriptions/pageBuilder/pageRevisions.js +0 -101
  389. package/subscriptions/pageBuilder/pageRevisions.js.map +0 -1
  390. package/subscriptions/pageBuilder/pages.d.ts +0 -4
  391. package/subscriptions/pageBuilder/pages.js +0 -60
  392. package/subscriptions/pageBuilder/pages.js.map +0 -1
  393. package/subscriptions/pageBuilder/settings.d.ts +0 -2
  394. package/subscriptions/pageBuilder/settings.js +0 -32
  395. package/subscriptions/pageBuilder/settings.js.map +0 -1
  396. package/subscriptions/pageBuilder/templates.d.ts +0 -6
  397. package/subscriptions/pageBuilder/templates.js +0 -96
  398. package/subscriptions/pageBuilder/templates.js.map +0 -1
  399. package/subscriptions/security/apiKeys.d.ts +0 -4
  400. package/subscriptions/security/apiKeys.js +0 -85
  401. package/subscriptions/security/apiKeys.js.map +0 -1
  402. package/subscriptions/security/roles.d.ts +0 -4
  403. package/subscriptions/security/roles.js +0 -64
  404. package/subscriptions/security/roles.js.map +0 -1
  405. package/subscriptions/security/teams.d.ts +0 -4
  406. package/subscriptions/security/teams.js +0 -64
  407. package/subscriptions/security/teams.js.map +0 -1
  408. package/subscriptions/security/users.d.ts +0 -4
  409. package/subscriptions/security/users.js +0 -64
  410. package/subscriptions/security/users.js.map +0 -1
  411. package/utils/compressor.d.ts +0 -11
  412. package/utils/compressor.js +0 -109
  413. package/utils/compressor.js.map +0 -1
@@ -1,64 +0,0 @@
1
- "use strict";
2
-
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
4
- Object.defineProperty(exports, "__esModule", {
5
- value: true
6
- });
7
- exports.onMenuAfterUpdateHook = exports.onMenuAfterDeleteHook = exports.onMenuAfterCreateHook = void 0;
8
- var _error = _interopRequireDefault(require("@webiny/error"));
9
- var _config = require("../../config");
10
- var _getAuditConfig = require("../../utils/getAuditConfig");
11
- const onMenuAfterCreateHook = context => {
12
- context.pageBuilder.onMenuAfterCreate.subscribe(async ({
13
- menu
14
- }) => {
15
- try {
16
- const createAuditLog = (0, _getAuditConfig.getAuditConfig)(_config.AUDIT.PAGE_BUILDER.MENU.CREATE);
17
- await createAuditLog("Menu created", menu, menu.slug, context);
18
- } catch (error) {
19
- throw _error.default.from(error, {
20
- message: "Error while executing onMenuAfterCreateHook hook",
21
- code: "AUDIT_LOGS_AFTER_MENU_CREATE_HOOK"
22
- });
23
- }
24
- });
25
- };
26
- exports.onMenuAfterCreateHook = onMenuAfterCreateHook;
27
- const onMenuAfterUpdateHook = context => {
28
- context.pageBuilder.onMenuAfterUpdate.subscribe(async ({
29
- menu,
30
- original
31
- }) => {
32
- try {
33
- const createAuditLog = (0, _getAuditConfig.getAuditConfig)(_config.AUDIT.PAGE_BUILDER.MENU.UPDATE);
34
- await createAuditLog("Menu updated", {
35
- before: original,
36
- after: menu
37
- }, menu.slug, context);
38
- } catch (error) {
39
- throw _error.default.from(error, {
40
- message: "Error while executing onMenuAfterUpdateHook hook",
41
- code: "AUDIT_LOGS_AFTER_MENU_UPDATE_HOOK"
42
- });
43
- }
44
- });
45
- };
46
- exports.onMenuAfterUpdateHook = onMenuAfterUpdateHook;
47
- const onMenuAfterDeleteHook = context => {
48
- context.pageBuilder.onMenuAfterDelete.subscribe(async ({
49
- menu
50
- }) => {
51
- try {
52
- const createAuditLog = (0, _getAuditConfig.getAuditConfig)(_config.AUDIT.PAGE_BUILDER.MENU.DELETE);
53
- await createAuditLog("Menu deleted", menu, menu.slug, context);
54
- } catch (error) {
55
- throw _error.default.from(error, {
56
- message: "Error while executing onMenuAfterDeleteHook hook",
57
- code: "AUDIT_LOGS_AFTER_MENU_DELETE_HOOK"
58
- });
59
- }
60
- });
61
- };
62
- exports.onMenuAfterDeleteHook = onMenuAfterDeleteHook;
63
-
64
- //# sourceMappingURL=menus.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["_error","_interopRequireDefault","require","_config","_getAuditConfig","onMenuAfterCreateHook","context","pageBuilder","onMenuAfterCreate","subscribe","menu","createAuditLog","getAuditConfig","AUDIT","PAGE_BUILDER","MENU","CREATE","slug","error","WebinyError","from","message","code","exports","onMenuAfterUpdateHook","onMenuAfterUpdate","original","UPDATE","before","after","onMenuAfterDeleteHook","onMenuAfterDelete","DELETE"],"sources":["menus.ts"],"sourcesContent":["import WebinyError from \"@webiny/error\";\n\nimport { AUDIT } from \"~/config\";\nimport { getAuditConfig } from \"~/utils/getAuditConfig\";\nimport { AuditLogsContext } from \"~/types\";\n\nexport const onMenuAfterCreateHook = (context: AuditLogsContext) => {\n context.pageBuilder.onMenuAfterCreate.subscribe(async ({ menu }) => {\n try {\n const createAuditLog = getAuditConfig(AUDIT.PAGE_BUILDER.MENU.CREATE);\n\n await createAuditLog(\"Menu created\", menu, menu.slug, context);\n } catch (error) {\n throw WebinyError.from(error, {\n message: \"Error while executing onMenuAfterCreateHook hook\",\n code: \"AUDIT_LOGS_AFTER_MENU_CREATE_HOOK\"\n });\n }\n });\n};\n\nexport const onMenuAfterUpdateHook = (context: AuditLogsContext) => {\n context.pageBuilder.onMenuAfterUpdate.subscribe(async ({ menu, original }) => {\n try {\n const createAuditLog = getAuditConfig(AUDIT.PAGE_BUILDER.MENU.UPDATE);\n\n await createAuditLog(\n \"Menu updated\",\n { before: original, after: menu },\n menu.slug,\n context\n );\n } catch (error) {\n throw WebinyError.from(error, {\n message: \"Error while executing onMenuAfterUpdateHook hook\",\n code: \"AUDIT_LOGS_AFTER_MENU_UPDATE_HOOK\"\n });\n }\n });\n};\n\nexport const onMenuAfterDeleteHook = (context: AuditLogsContext) => {\n context.pageBuilder.onMenuAfterDelete.subscribe(async ({ menu }) => {\n try {\n const createAuditLog = getAuditConfig(AUDIT.PAGE_BUILDER.MENU.DELETE);\n\n await createAuditLog(\"Menu deleted\", menu, menu.slug, context);\n } catch (error) {\n throw WebinyError.from(error, {\n message: \"Error while executing onMenuAfterDeleteHook hook\",\n code: \"AUDIT_LOGS_AFTER_MENU_DELETE_HOOK\"\n });\n }\n });\n};\n"],"mappings":";;;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;A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qBAAA;AAEK,MAAMM,qBAAqB,GAAIxB,OAAyB,IAAK;EAChEA,OAAO,CAACC,WAAW,CAACwB,iBAAiB,CAACtB,SAAS,CAAC,OAAO;IAAEC;EAAK,CAAC,KAAK;IAChE,IAAI;MACA,MAAMC,cAAc,GAAG,IAAAC,8BAAc,EAACC,aAAK,CAACC,YAAY,CAACC,IAAI,CAACiB,MAAM,CAAC;MAErE,MAAMrB,cAAc,CAAC,cAAc,EAAED,IAAI,EAAEA,IAAI,CAACO,IAAI,EAAEX,OAAO,CAAC;IAClE,CAAC,CAAC,OAAOY,KAAK,EAAE;MACZ,MAAMC,cAAW,CAACC,IAAI,CAACF,KAAK,EAAE;QAC1BG,OAAO,EAAE,kDAAkD;QAC3DC,IAAI,EAAE;MACV,CAAC,CAAC;IACN;EACJ,CAAC,CAAC;AACN,CAAC;AAACC,OAAA,CAAAO,qBAAA,GAAAA,qBAAA","ignoreList":[]}
@@ -1,4 +0,0 @@
1
- import { AuditLogsContext } from "../../types";
2
- export declare const onPageElementAfterCreateHook: (context: AuditLogsContext) => void;
3
- export declare const onPageElementAfterUpdateHook: (context: AuditLogsContext) => void;
4
- export declare const onPageElementAfterDeleteHook: (context: AuditLogsContext) => void;
@@ -1,64 +0,0 @@
1
- "use strict";
2
-
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
4
- Object.defineProperty(exports, "__esModule", {
5
- value: true
6
- });
7
- exports.onPageElementAfterUpdateHook = exports.onPageElementAfterDeleteHook = exports.onPageElementAfterCreateHook = void 0;
8
- var _error = _interopRequireDefault(require("@webiny/error"));
9
- var _config = require("../../config");
10
- var _getAuditConfig = require("../../utils/getAuditConfig");
11
- const onPageElementAfterCreateHook = context => {
12
- context.pageBuilder.onPageElementAfterCreate.subscribe(async ({
13
- pageElement
14
- }) => {
15
- try {
16
- const createAuditLog = (0, _getAuditConfig.getAuditConfig)(_config.AUDIT.PAGE_BUILDER.PAGE_ELEMENT.CREATE);
17
- await createAuditLog("Page element created", pageElement, pageElement.id, context);
18
- } catch (error) {
19
- throw _error.default.from(error, {
20
- message: "Error while executing onPageElementAfterCreateHook hook",
21
- code: "AUDIT_LOGS_AFTER_PAGE_ELEMENT_CREATE_HOOK"
22
- });
23
- }
24
- });
25
- };
26
- exports.onPageElementAfterCreateHook = onPageElementAfterCreateHook;
27
- const onPageElementAfterUpdateHook = context => {
28
- context.pageBuilder.onPageElementAfterUpdate.subscribe(async ({
29
- pageElement,
30
- original
31
- }) => {
32
- try {
33
- const createAuditLog = (0, _getAuditConfig.getAuditConfig)(_config.AUDIT.PAGE_BUILDER.PAGE_ELEMENT.UPDATE);
34
- await createAuditLog("Page element updated", {
35
- before: original,
36
- after: pageElement
37
- }, pageElement.id, context);
38
- } catch (error) {
39
- throw _error.default.from(error, {
40
- message: "Error while executing onPageElementAfterUpdateHook hook",
41
- code: "AUDIT_LOGS_AFTER_PAGE_ELEMENT_UPDATE_HOOK"
42
- });
43
- }
44
- });
45
- };
46
- exports.onPageElementAfterUpdateHook = onPageElementAfterUpdateHook;
47
- const onPageElementAfterDeleteHook = context => {
48
- context.pageBuilder.onPageElementAfterDelete.subscribe(async ({
49
- pageElement
50
- }) => {
51
- try {
52
- const createAuditLog = (0, _getAuditConfig.getAuditConfig)(_config.AUDIT.PAGE_BUILDER.PAGE_ELEMENT.DELETE);
53
- await createAuditLog("Page element deleted", pageElement, pageElement.id, context);
54
- } catch (error) {
55
- throw _error.default.from(error, {
56
- message: "Error while executing onPageElementAfterDeleteHook hook",
57
- code: "AUDIT_LOGS_AFTER_PAGE_ELEMENT_DELETE_HOOK"
58
- });
59
- }
60
- });
61
- };
62
- exports.onPageElementAfterDeleteHook = onPageElementAfterDeleteHook;
63
-
64
- //# sourceMappingURL=pageElements.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["_error","_interopRequireDefault","require","_config","_getAuditConfig","onPageElementAfterCreateHook","context","pageBuilder","onPageElementAfterCreate","subscribe","pageElement","createAuditLog","getAuditConfig","AUDIT","PAGE_BUILDER","PAGE_ELEMENT","CREATE","id","error","WebinyError","from","message","code","exports","onPageElementAfterUpdateHook","onPageElementAfterUpdate","original","UPDATE","before","after","onPageElementAfterDeleteHook","onPageElementAfterDelete","DELETE"],"sources":["pageElements.ts"],"sourcesContent":["import WebinyError from \"@webiny/error\";\n\nimport { AUDIT } from \"~/config\";\nimport { getAuditConfig } from \"~/utils/getAuditConfig\";\nimport { AuditLogsContext } from \"~/types\";\n\nexport const onPageElementAfterCreateHook = (context: AuditLogsContext) => {\n context.pageBuilder.onPageElementAfterCreate.subscribe(async ({ pageElement }) => {\n try {\n const createAuditLog = getAuditConfig(AUDIT.PAGE_BUILDER.PAGE_ELEMENT.CREATE);\n\n await createAuditLog(\"Page element created\", pageElement, pageElement.id, context);\n } catch (error) {\n throw WebinyError.from(error, {\n message: \"Error while executing onPageElementAfterCreateHook hook\",\n code: \"AUDIT_LOGS_AFTER_PAGE_ELEMENT_CREATE_HOOK\"\n });\n }\n });\n};\n\nexport const onPageElementAfterUpdateHook = (context: AuditLogsContext) => {\n context.pageBuilder.onPageElementAfterUpdate.subscribe(async ({ pageElement, original }) => {\n try {\n const createAuditLog = getAuditConfig(AUDIT.PAGE_BUILDER.PAGE_ELEMENT.UPDATE);\n\n await createAuditLog(\n \"Page element updated\",\n { before: original, after: pageElement },\n pageElement.id,\n context\n );\n } catch (error) {\n throw WebinyError.from(error, {\n message: \"Error while executing onPageElementAfterUpdateHook hook\",\n code: \"AUDIT_LOGS_AFTER_PAGE_ELEMENT_UPDATE_HOOK\"\n });\n }\n });\n};\n\nexport const onPageElementAfterDeleteHook = (context: AuditLogsContext) => {\n context.pageBuilder.onPageElementAfterDelete.subscribe(async ({ pageElement }) => {\n try {\n const createAuditLog = getAuditConfig(AUDIT.PAGE_BUILDER.PAGE_ELEMENT.DELETE);\n\n await createAuditLog(\"Page element deleted\", pageElement, pageElement.id, context);\n } catch (error) {\n throw WebinyError.from(error, {\n message: \"Error while executing onPageElementAfterDelete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AACF,KAAK,EAAE;QAC1BG,OAAO,EAAE,yDAAyD;QAClEC,IAAI,EAAE;MACV,CAAC,CAAC;IACN;EACJ,CAAC,CAAC;AACN,CAAC;AAACC,OAAA,CAAAC,4BAAA,GAAAA,4BAAA;AAEK,MAAMM,4BAA4B,GAAIxB,OAAyB,IAAK;EACvEA,OAAO,CAACC,WAAW,CAACwB,wBAAwB,CAACtB,SAAS,CAAC,OAAO;IAAEC;EAAY,CAAC,KAAK;IAC9E,IAAI;MACA,MAAMC,cAAc,GAAG,IAAAC,8BAAc,EAACC,aAAK,CAACC,YAAY,CAACC,YAAY,CAACiB,MAAM,CAAC;MAE7E,MAAMrB,cAAc,CAAC,sBAAsB,EAAED,WAAW,EAAEA,WAAW,CAACO,EAAE,EAAEX,OAAO,CAAC;IACtF,CAAC,CAAC,OAAOY,KAAK,EAAE;MACZ,MAAMC,cAAW,CAACC,IAAI,CAACF,KAAK,EAAE;QAC1BG,OAAO,EAAE,yDAAyD;QAClEC,IAAI,EAAE;MACV,CAAC,CAAC;IACN;EACJ,CAAC,CAAC;AACN,CAAC;AAACC,OAAA,CAAAO,4BAAA,GAAAA,4BAAA","ignoreList":[]}
@@ -1,6 +0,0 @@
1
- import { AuditLogsContext } from "../../types";
2
- export declare const onPageRevisionAfterCreateHook: (context: AuditLogsContext) => void;
3
- export declare const onPageRevisionAfterUpdateHook: (context: AuditLogsContext) => void;
4
- export declare const onPageRevisionAfterDeleteHook: (context: AuditLogsContext) => void;
5
- export declare const onPageRevisionAfterPublishHook: (context: AuditLogsContext) => void;
6
- export declare const onPageRevisionAfterUnpublishHook: (context: AuditLogsContext) => void;
@@ -1,101 +0,0 @@
1
- "use strict";
2
-
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
4
- Object.defineProperty(exports, "__esModule", {
5
- value: true
6
- });
7
- exports.onPageRevisionAfterUpdateHook = exports.onPageRevisionAfterUnpublishHook = exports.onPageRevisionAfterPublishHook = exports.onPageRevisionAfterDeleteHook = exports.onPageRevisionAfterCreateHook = void 0;
8
- var _error = _interopRequireDefault(require("@webiny/error"));
9
- var _config = require("../../config");
10
- var _getAuditConfig = require("../../utils/getAuditConfig");
11
- const onPageRevisionAfterCreateHook = context => {
12
- context.pageBuilder.onPageAfterCreateFrom.subscribe(async ({
13
- page
14
- }) => {
15
- try {
16
- const createAuditLog = (0, _getAuditConfig.getAuditConfig)(_config.AUDIT.PAGE_BUILDER.PAGE_REVISION.CREATE);
17
- await createAuditLog("Page revision created", page, page.id, context);
18
- } catch (error) {
19
- throw _error.default.from(error, {
20
- message: "Error while executing onPageRevisionAfterCreateHook hook",
21
- code: "AUDIT_LOGS_AFTER_PAGE_REVISION_CREATE_HOOK"
22
- });
23
- }
24
- });
25
- };
26
- exports.onPageRevisionAfterCreateHook = onPageRevisionAfterCreateHook;
27
- const onPageRevisionAfterUpdateHook = context => {
28
- context.pageBuilder.onPageAfterUpdate.subscribe(async ({
29
- page,
30
- original
31
- }) => {
32
- try {
33
- const createAuditLog = (0, _getAuditConfig.getAuditConfig)(_config.AUDIT.PAGE_BUILDER.PAGE_REVISION.UPDATE);
34
- await await createAuditLog("Page revision updated", {
35
- before: original,
36
- after: page
37
- }, page.id, context);
38
- } catch (error) {
39
- throw _error.default.from(error, {
40
- message: "Error while executing onPageRevisionAfterUpdateHook hook",
41
- code: "AUDIT_LOGS_AFTER_PAGE_REVISION_UPDATE_HOOK"
42
- });
43
- }
44
- });
45
- };
46
- exports.onPageRevisionAfterUpdateHook = onPageRevisionAfterUpdateHook;
47
- const onPageRevisionAfterDeleteHook = context => {
48
- context.pageBuilder.onPageAfterDelete.subscribe(async ({
49
- page
50
- }) => {
51
- try {
52
- if (page.version === 1) {
53
- const createAuditLog = (0, _getAuditConfig.getAuditConfig)(_config.AUDIT.PAGE_BUILDER.PAGE.DELETE);
54
- await createAuditLog("Page deleted", page, page.pid, context);
55
- } else {
56
- const createAuditLog = (0, _getAuditConfig.getAuditConfig)(_config.AUDIT.PAGE_BUILDER.PAGE_REVISION.DELETE);
57
- await createAuditLog("Page revision deleted", page, page.id, context);
58
- }
59
- } catch (error) {
60
- throw _error.default.from(error, {
61
- message: "Error while executing onPageRevisionAfterDeleteHook hook",
62
- code: "AUDIT_LOGS_AFTER_PAGE_REVISION_DELETE_HOOK"
63
- });
64
- }
65
- });
66
- };
67
- exports.onPageRevisionAfterDeleteHook = onPageRevisionAfterDeleteHook;
68
- const onPageRevisionAfterPublishHook = context => {
69
- context.pageBuilder.onPageAfterPublish.subscribe(async ({
70
- page
71
- }) => {
72
- try {
73
- const createAuditLog = (0, _getAuditConfig.getAuditConfig)(_config.AUDIT.PAGE_BUILDER.PAGE_REVISION.PUBLISH);
74
- await createAuditLog("Page revision published", page, page.id, context);
75
- } catch (error) {
76
- throw _error.default.from(error, {
77
- message: "Error while executing onPageRevisionAfterPublishHook hook",
78
- code: "AUDIT_LOGS_AFTER_PAGE_REVISION_PUBLISH_HOOK"
79
- });
80
- }
81
- });
82
- };
83
- exports.onPageRevisionAfterPublishHook = onPageRevisionAfterPublishHook;
84
- const onPageRevisionAfterUnpublishHook = context => {
85
- context.pageBuilder.onPageAfterUnpublish.subscribe(async ({
86
- page
87
- }) => {
88
- try {
89
- const createAuditLog = (0, _getAuditConfig.getAuditConfig)(_config.AUDIT.PAGE_BUILDER.PAGE_REVISION.UNPUBLISH);
90
- await createAuditLog("Page revision unpublished", page, page.id, context);
91
- } catch (error) {
92
- throw _error.default.from(error, {
93
- message: "Error while executing onPageRevisionAfterUnpublishHook hook",
94
- code: "AUDIT_LOGS_AFTER_PAGE_REVISION_UNPUBLISH_HOOK"
95
- });
96
- }
97
- });
98
- };
99
- exports.onPageRevisionAfterUnpublishHook = onPageRevisionAfterUnpublishHook;
100
-
101
- //# sourceMappingURL=pageRevisions.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["_error","_interopRequireDefault","require","_config","_getAuditConfig","onPageRevisionAfterCreateHook","context","pageBuilder","onPageAfterCreateFrom","subscribe","page","createAuditLog","getAuditConfig","AUDIT","PAGE_BUILDER","PAGE_REVISION","CREATE","id","error","WebinyError","from","message","code","exports","onPageRevisionAfterUpdateHook","onPageAfterUpdate","original","UPDATE","before","after","onPageRevisionAfterDeleteHook","onPageAfterDelete","version","PAGE","DELETE","pid","onPageRevisionAfterPublishHook","onPageAfterPublish","PUBLISH","onPageRevisionAfterUnpublishHook","onPageAfterUnpublish","UNPUBLISH"],"sources":["pageRevisions.ts"],"sourcesContent":["import WebinyError from \"@webiny/error\";\n\nimport { AUDIT } from \"~/config\";\nimport { getAuditConfig } from \"~/utils/getAuditConfig\";\nimport { AuditLogsContext } from \"~/types\";\n\nexport const onPageRevisionAfterCreateHook = (context: AuditLogsContext) => {\n context.pageBuilder.onPageAfterCreateFrom.subscribe(async ({ page }) => {\n try {\n const createAuditLog = getAuditConfig(AUDIT.PAGE_BUILDER.PAGE_REVISION.CREATE);\n\n await createAuditLog(\"Page revision created\", page, page.id, context);\n } catch (error) {\n throw WebinyError.from(error, {\n message: \"Error while executing onPageRevisionAfterCreateHook hook\",\n code: \"AUDIT_LOGS_AFTER_PAGE_REVISION_CREATE_HOOK\"\n });\n }\n });\n};\n\nexport const onPageRevisionAfterUpdateHook = (context: AuditLogsContext) => {\n context.pageBuilder.onPageAfterUpdate.subscribe(async ({ page, original }) => {\n try {\n const createAuditLog = getAuditConfig(AUDIT.PAGE_BUILDER.PAGE_REVISION.UPDATE);\n\n await await createAuditLog(\n \"Page revision updated\",\n { before: original, after: page },\n page.id,\n context\n );\n } catch (error) {\n throw WebinyError.from(error, {\n message: \"Error while executing onPageRevisionAfterUpdateHook hook\",\n code: \"AUDIT_LOGS_AFTER_PAGE_REVISION_UPDATE_HOOK\"\n });\n }\n });\n};\n\nexport const onPageRevisionAfterDeleteHook = (context: AuditLogsContext) => {\n context.pageBuilder.onPageAfterDelete.subscribe(async ({ page }) => {\n try {\n if (page.version === 1) {\n const createAuditLog = getAuditConfig(AUDIT.PAGE_BUILDER.PAGE.DELETE);\n\n await createAuditLog(\"Page deleted\", page, page.pid, context);\n } else {\n const createAuditLog = getAuditConfig(AUDIT.PAGE_BUILDER.PAGE_REVISION.DELETE);\n\n await createAuditLog(\"Page revision deleted\", page, page.id, context);\n }\n } catch (error) {\n throw WebinyError.from(error, {\n message: \"Error while executing onPageRevisionAfterDeleteHook hook\",\n code: \"AUDIT_LOGS_AFTER_PAGE_REVISION_DELETE_HOOK\"\n });\n }\n });\n};\n\nexport const onPageRevisionAfterPublishHook = (context: AuditLogsContext) => {\n context.pageBuilder.onPageAfterPublish.subscribe(async ({ page }) => {\n try {\n const createAuditLog = getAuditConfig(AUDIT.PAGE_BUILDER.PAGE_REVISION.PUBLISH);\n\n await createAuditLog(\"Page revision published\", page, page.id, context);\n } catch (error) {\n throw WebinyError.from(error, {\n message: \"Error while executing onPageRevisionAfterPublishHook hook\",\n code: \"AUDIT_LOGS_AFTER_PAGE_REVISION_PUBLISH_HOOK\"\n });\n }\n });\n};\n\nexport const onPageRevisionAfterUnpublishHook = (context: AuditLogsContext) => {\n context.pageBuilder.onPageAfterUnpublish.subscribe(async ({ page }) => {\n try {\n const createAuditLog = getAuditConfig(AUDIT.PAGE_BUILDER.PAGE_REVISION.UNPUBLISH);\n\n await createAuditLog(\"Page revision unpublished\", page, page.id, context);\n } catch (error) {\n throw WebinyError.from(error, {\n message: \"Error while executing onPageRevisionAfterUnpublishHook hook\",\n code: \"AUDIT_LOGS_AFTER_PAGE_REVISION_UNPUBLISH_HOOK\"\n });\n }\n });\n};\n"],"mappings":";;;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AAEA,IAAAC,OAAA,GAAAD,OAAA;AACA,IAAAE,eAAA,GAAAF,OAAA;AAGO,MAAMG,6BAA6B,GAAIC,OAAyB,IAAK;EACxEA,OAAO,CAACC,WAAW,CAACC,qBAAqB,CAACC,SAAS,CAAC,OAAO;IAAEC;EAAK,CAAC,KAAK;IACpE,IAAI;MACA,MAAMC,cAAc,G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AO,CAACC,WAAW,CAACiC,oBAAoB,CAAC/B,SAAS,CAAC,OAAO;IAAEC;EAAK,CAAC,KAAK;IACnE,IAAI;MACA,MAAMC,cAAc,GAAG,IAAAC,8BAAc,EAACC,aAAK,CAACC,YAAY,CAACC,aAAa,CAAC0B,SAAS,CAAC;MAEjF,MAAM9B,cAAc,CAAC,2BAA2B,EAAED,IAAI,EAAEA,IAAI,CAACO,EAAE,EAAEX,OAAO,CAAC;IAC7E,CAAC,CAAC,OAAOY,KAAK,EAAE;MACZ,MAAMC,cAAW,CAACC,IAAI,CAACF,KAAK,EAAE;QAC1BG,OAAO,EAAE,6DAA6D;QACtEC,IAAI,EAAE;MACV,CAAC,CAAC;IACN;EACJ,CAAC,CAAC;AACN,CAAC;AAACC,OAAA,CAAAgB,gCAAA,GAAAA,gCAAA","ignoreList":[]}
@@ -1,4 +0,0 @@
1
- import { AuditLogsContext } from "../../types";
2
- export declare const onPageAfterCreateHook: (context: AuditLogsContext) => void;
3
- export declare const onPagesAfterExportHook: (context: AuditLogsContext) => void;
4
- export declare const onPagesAfterImportHook: (context: AuditLogsContext) => void;
@@ -1,60 +0,0 @@
1
- "use strict";
2
-
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
4
- Object.defineProperty(exports, "__esModule", {
5
- value: true
6
- });
7
- exports.onPagesAfterImportHook = exports.onPagesAfterExportHook = exports.onPageAfterCreateHook = void 0;
8
- var _error = _interopRequireDefault(require("@webiny/error"));
9
- var _config = require("../../config");
10
- var _getAuditConfig = require("../../utils/getAuditConfig");
11
- const onPageAfterCreateHook = context => {
12
- context.pageBuilder.onPageAfterCreate.subscribe(async ({
13
- page
14
- }) => {
15
- try {
16
- const createAuditLog = (0, _getAuditConfig.getAuditConfig)(_config.AUDIT.PAGE_BUILDER.PAGE.CREATE);
17
- await createAuditLog("Page created", page, page.pid, context);
18
- } catch (error) {
19
- throw _error.default.from(error, {
20
- message: "Error while executing onPageAfterCreateHook hook",
21
- code: "AUDIT_LOGS_AFTER_PAGE_CREATE_HOOK"
22
- });
23
- }
24
- });
25
- };
26
- exports.onPageAfterCreateHook = onPageAfterCreateHook;
27
- const onPagesAfterExportHook = context => {
28
- context.pageBuilder.pages.onPagesAfterExport.subscribe(async ({
29
- params
30
- }) => {
31
- try {
32
- const createAuditLog = (0, _getAuditConfig.getAuditConfig)(_config.AUDIT.PAGE_BUILDER.PAGE.EXPORT);
33
- await createAuditLog("Pages exported", params, "-", context);
34
- } catch (error) {
35
- throw _error.default.from(error, {
36
- message: "Error while executing onPagesAfterExportHook hook",
37
- code: "AUDIT_LOGS_PAGES_EXPORT_HOOK"
38
- });
39
- }
40
- });
41
- };
42
- exports.onPagesAfterExportHook = onPagesAfterExportHook;
43
- const onPagesAfterImportHook = context => {
44
- context.pageBuilder.pages.onPagesAfterImport.subscribe(async ({
45
- params
46
- }) => {
47
- try {
48
- const createAuditLog = (0, _getAuditConfig.getAuditConfig)(_config.AUDIT.PAGE_BUILDER.PAGE.IMPORT);
49
- await createAuditLog("Pages imported", params, "-", context);
50
- } catch (error) {
51
- throw _error.default.from(error, {
52
- message: "Error while executing onPagesAfterImportHook hook",
53
- code: "AUDIT_LOGS_PAGES_IMPORT_HOOK"
54
- });
55
- }
56
- });
57
- };
58
- exports.onPagesAfterImportHook = onPagesAfterImportHook;
59
-
60
- //# sourceMappingURL=pages.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["_error","_interopRequireDefault","require","_config","_getAuditConfig","onPageAfterCreateHook","context","pageBuilder","onPageAfterCreate","subscribe","page","createAuditLog","getAuditConfig","AUDIT","PAGE_BUILDER","PAGE","CREATE","pid","error","WebinyError","from","message","code","exports","onPagesAfterExportHook","pages","onPagesAfterExport","params","EXPORT","onPagesAfterImportHook","onPagesAfterImport","IMPORT"],"sources":["pages.ts"],"sourcesContent":["import WebinyError from \"@webiny/error\";\n\nimport { AUDIT } from \"~/config\";\nimport { getAuditConfig } from \"~/utils/getAuditConfig\";\nimport { AuditLogsContext } from \"~/types\";\n\nexport const onPageAfterCreateHook = (context: AuditLogsContext) => {\n context.pageBuilder.onPageAfterCreate.subscribe(async ({ page }) => {\n try {\n const createAuditLog = getAuditConfig(AUDIT.PAGE_BUILDER.PAGE.CREATE);\n\n await createAuditLog(\"Page created\", page, page.pid, context);\n } catch (error) {\n throw WebinyError.from(error, {\n message: \"Error while executing onPageAfterCreateHook hook\",\n code: \"AUDIT_LOGS_AFTER_PAGE_CREATE_HOOK\"\n });\n }\n });\n};\n\nexport const onPagesAfterExportHook = (context: AuditLogsContext) => {\n context.pageBuilder.pages.onPagesAfterExport.subscribe(async ({ params }) => {\n try {\n const createAuditLog = getAuditConfig(AUDIT.PAGE_BUILDER.PAGE.EXPORT);\n\n await createAuditLog(\"Pages exported\", params, \"-\", context);\n } catch (error) {\n throw WebinyError.from(error, {\n message: \"Error while executing onPagesAfterExportHook hook\",\n code: \"AUDIT_LOGS_PAGES_EXPORT_HOOK\"\n });\n }\n });\n};\n\nexport const onPagesAfterImportHook = (context: AuditLogsContext) => {\n context.pageBuilder.pages.onPagesAfterImport.subscribe(async ({ params }) => {\n try {\n const createAuditLog = getAuditConfig(AUDIT.PAGE_BUILDER.PAGE.IMPORT);\n\n await createAuditLog(\"Pages imported\", params, \"-\", context);\n } catch (error) {\n throw WebinyError.from(error, {\n message: \"Error while executing onPagesAfterImportHook hook\",\n code: \"AUDIT_LOGS_PAGES_IMPORT_HOOK\"\n });\n }\n });\n};\n"],"mappings":";;;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AAEA,IAAAC,OAAA,GAAAD,OAAA;AACA,IAAAE,eAAA,GAAAF,OAAA;AAGO,MAAMG,qBAAqB,GAAIC,OAAyB,IAAK;EAChEA,OAAO,CAACC,WAAW,CAACC,iBAAiB,CAACC,SAAS,CAAC,OAAO;IAAEC;EAAK,CAAC,KAAK;IAChE,IAAI;MACA,MAAMC,cAAc,GAAG,IAAAC,8BAAc,EAACC,aAAK,CAACC,YA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ErB,OAAO,CAAC;IAChE,CAAC,CAAC,OAAOY,KAAK,EAAE;MACZ,MAAMC,cAAW,CAACC,IAAI,CAACF,KAAK,EAAE;QAC1BG,OAAO,EAAE,mDAAmD;QAC5DC,IAAI,EAAE;MACV,CAAC,CAAC;IACN;EACJ,CAAC,CAAC;AACN,CAAC;AAACC,OAAA,CAAAM,sBAAA,GAAAA,sBAAA","ignoreList":[]}
@@ -1,2 +0,0 @@
1
- import { AuditLogsContext } from "../../types";
2
- export declare const onSettingsAfterUpdateHook: (context: AuditLogsContext) => void;
@@ -1,32 +0,0 @@
1
- "use strict";
2
-
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
4
- Object.defineProperty(exports, "__esModule", {
5
- value: true
6
- });
7
- exports.onSettingsAfterUpdateHook = void 0;
8
- var _error = _interopRequireDefault(require("@webiny/error"));
9
- var _config = require("../../config");
10
- var _getAuditConfig = require("../../utils/getAuditConfig");
11
- const onSettingsAfterUpdateHook = context => {
12
- context.pageBuilder.onSettingsAfterUpdate.subscribe(async ({
13
- settings,
14
- original
15
- }) => {
16
- try {
17
- const createAuditLog = (0, _getAuditConfig.getAuditConfig)(_config.AUDIT.PAGE_BUILDER.SETTINGS.UPDATE);
18
- await createAuditLog("Settings updated", {
19
- before: original,
20
- after: settings
21
- }, "-", context);
22
- } catch (error) {
23
- throw _error.default.from(error, {
24
- message: "Error while executing onSettingsAfterUpdateHook hook",
25
- code: "AUDIT_LOGS_AFTER_SETTINGS_UPDATE_HOOK"
26
- });
27
- }
28
- });
29
- };
30
- exports.onSettingsAfterUpdateHook = onSettingsAfterUpdateHook;
31
-
32
- //# sourceMappingURL=settings.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["_error","_interopRequireDefault","require","_config","_getAuditConfig","onSettingsAfterUpdateHook","context","pageBuilder","onSettingsAfterUpdate","subscribe","settings","original","createAuditLog","getAuditConfig","AUDIT","PAGE_BUILDER","SETTINGS","UPDATE","before","after","error","WebinyError","from","message","code","exports"],"sources":["settings.ts"],"sourcesContent":["import WebinyError from \"@webiny/error\";\n\nimport { AUDIT } from \"~/config\";\nimport { getAuditConfig } from \"~/utils/getAuditConfig\";\nimport { AuditLogsContext } from \"~/types\";\n\nexport const onSettingsAfterUpdateHook = (context: AuditLogsContext) => {\n context.pageBuilder.onSettingsAfterUpdate.subscribe(async ({ settings, original }) => {\n try {\n const createAuditLog = getAuditConfig(AUDIT.PAGE_BUILDER.SETTINGS.UPDATE);\n\n await createAuditLog(\n \"Settings updated\",\n { before: original, after: settings },\n \"-\",\n context\n );\n } catch (error) {\n throw WebinyError.from(error, {\n message: \"Error while executing onSettingsAfterUpdateHook hook\",\n code: \"AUDIT_LOGS_AFTER_SETTINGS_UPDATE_HOOK\"\n });\n }\n });\n};\n"],"mappings":";;;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AAEA,IAAAC,OAAA,GAAAD,OAAA;AACA,IAAAE,eAAA,GAAAF,OAAA;AAGO,MAAMG,yBAAyB,GAAIC,OAAyB,IAAK;EACpEA,OAAO,CAACC,WAAW,CAACC,qBAAqB,CAACC,SAAS,CAAC,OAAO;IAAEC,QAAQ;IAAEC;EAAS,CAAC,KAAK;IAClF,IAAI;MACA,MAAMC,cAAc,GAAG,IAAAC,8BAAc,EAACC,aAAK,CAACC,YAAY,CAACC,QAAQ,CAACC,MAAM,CAAC;MAEzE,MAAML,cAAc,CAChB,kBAAkB,EAClB;QAAEM,MAAM,EAAEP,QAAQ;QAAEQ,KAAK,EAAET;MAAS,CAAC,EACrC,GAAG,EACHJ,OACJ,CAAC;IACL,CAAC,CAAC,OAAOc,KAAK,EAAE;MACZ,MAAMC,cAAW,CAACC,IAAI,CAACF,KAAK,EAAE;QAC1BG,OAAO,EAAE,sDAAsD;QAC/DC,IAAI,EAAE;MACV,CAAC,CAAC;IACN;EACJ,CAAC,CAAC;AACN,CAAC;AAACC,OAAA,CAAApB,yBAAA,GAAAA,yBAAA","ignoreList":[]}
@@ -1,6 +0,0 @@
1
- import { AuditLogsContext } from "../../types";
2
- export declare const onTemplateAfterCreateHook: (context: AuditLogsContext) => void;
3
- export declare const onTemplateAfterUpdateHook: (context: AuditLogsContext) => void;
4
- export declare const onTemplateAfterDeleteHook: (context: AuditLogsContext) => void;
5
- export declare const onTemplatesAfterExportHook: (context: AuditLogsContext) => void;
6
- export declare const onTemplatesAfterImportHook: (context: AuditLogsContext) => void;
@@ -1,96 +0,0 @@
1
- "use strict";
2
-
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
4
- Object.defineProperty(exports, "__esModule", {
5
- value: true
6
- });
7
- exports.onTemplatesAfterImportHook = exports.onTemplatesAfterExportHook = exports.onTemplateAfterUpdateHook = exports.onTemplateAfterDeleteHook = exports.onTemplateAfterCreateHook = void 0;
8
- var _error = _interopRequireDefault(require("@webiny/error"));
9
- var _config = require("../../config");
10
- var _getAuditConfig = require("../../utils/getAuditConfig");
11
- const onTemplateAfterCreateHook = context => {
12
- context.pageBuilder.onPageTemplateAfterCreate.subscribe(async ({
13
- pageTemplate
14
- }) => {
15
- try {
16
- const createAuditLog = (0, _getAuditConfig.getAuditConfig)(_config.AUDIT.PAGE_BUILDER.TEMPLATE.CREATE);
17
- await createAuditLog("Template created", pageTemplate, pageTemplate.id, context);
18
- } catch (error) {
19
- throw _error.default.from(error, {
20
- message: "Error while executing onTemplateAfterCreateHook hook",
21
- code: "AUDIT_LOGS_AFTER_TEMPLATE_CREATE_HOOK"
22
- });
23
- }
24
- });
25
- };
26
- exports.onTemplateAfterCreateHook = onTemplateAfterCreateHook;
27
- const onTemplateAfterUpdateHook = context => {
28
- context.pageBuilder.onPageTemplateAfterUpdate.subscribe(async ({
29
- pageTemplate,
30
- original
31
- }) => {
32
- try {
33
- const createAuditLog = (0, _getAuditConfig.getAuditConfig)(_config.AUDIT.PAGE_BUILDER.TEMPLATE.UPDATE);
34
- await createAuditLog("Template updated", {
35
- before: original,
36
- after: pageTemplate
37
- }, pageTemplate.id, context);
38
- } catch (error) {
39
- throw _error.default.from(error, {
40
- message: "Error while executing onTemplateAfterUpdateHook hook",
41
- code: "AUDIT_LOGS_AFTER_TEMPLATE_UPDATE_HOOK"
42
- });
43
- }
44
- });
45
- };
46
- exports.onTemplateAfterUpdateHook = onTemplateAfterUpdateHook;
47
- const onTemplateAfterDeleteHook = context => {
48
- context.pageBuilder.onPageTemplateAfterDelete.subscribe(async ({
49
- pageTemplate
50
- }) => {
51
- try {
52
- const createAuditLog = (0, _getAuditConfig.getAuditConfig)(_config.AUDIT.PAGE_BUILDER.TEMPLATE.DELETE);
53
- await createAuditLog("Template deleted", pageTemplate, pageTemplate.id, context);
54
- } catch (error) {
55
- throw _error.default.from(error, {
56
- message: "Error while executing onTemplateAfterDeleteHook hook",
57
- code: "AUDIT_LOGS_AFTER_TEMPLATE_DELETE_HOOK"
58
- });
59
- }
60
- });
61
- };
62
- exports.onTemplateAfterDeleteHook = onTemplateAfterDeleteHook;
63
- const onTemplatesAfterExportHook = context => {
64
- context.pageBuilder.templates.onTemplatesAfterExport.subscribe(async ({
65
- params
66
- }) => {
67
- try {
68
- const createAuditLog = (0, _getAuditConfig.getAuditConfig)(_config.AUDIT.PAGE_BUILDER.TEMPLATE.EXPORT);
69
- await createAuditLog("Templates exported", params, "-", context);
70
- } catch (error) {
71
- throw _error.default.from(error, {
72
- message: "Error while executing onTemplatesAfterExportHook hook",
73
- code: "AUDIT_LOGS_TEMPLATES_EXPORT_HOOK"
74
- });
75
- }
76
- });
77
- };
78
- exports.onTemplatesAfterExportHook = onTemplatesAfterExportHook;
79
- const onTemplatesAfterImportHook = context => {
80
- context.pageBuilder.templates.onTemplatesAfterImport.subscribe(async ({
81
- params
82
- }) => {
83
- try {
84
- const createAuditLog = (0, _getAuditConfig.getAuditConfig)(_config.AUDIT.PAGE_BUILDER.TEMPLATE.IMPORT);
85
- await createAuditLog("Templates imported", params, "-", context);
86
- } catch (error) {
87
- throw _error.default.from(error, {
88
- message: "Error while executing onTemplatesAfterImportHook hook",
89
- code: "AUDIT_LOGS_TEMPLATES_IMPORT_HOOK"
90
- });
91
- }
92
- });
93
- };
94
- exports.onTemplatesAfterImportHook = onTemplatesAfterImportHook;
95
-
96
- //# sourceMappingURL=templates.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["_error","_interopRequireDefault","require","_config","_getAuditConfig","onTemplateAfterCreateHook","context","pageBuilder","onPageTemplateAfterCreate","subscribe","pageTemplate","createAuditLog","getAuditConfig","AUDIT","PAGE_BUILDER","TEMPLATE","CREATE","id","error","WebinyError","from","message","code","exports","onTemplateAfterUpdateHook","onPageTemplateAfterUpdate","original","UPDATE","before","after","onTemplateAfterDeleteHook","onPageTemplateAfterDelete","DELETE","onTemplatesAfterExportHook","templates","onTemplatesAfterExport","params","EXPORT","onTemplatesAfterImportHook","onTemplatesAfterImport","IMPORT"],"sources":["templates.ts"],"sourcesContent":["import WebinyError from \"@webiny/error\";\n\nimport { AUDIT } from \"~/config\";\nimport { getAuditConfig } from \"~/utils/getAuditConfig\";\nimport { AuditLogsContext } from \"~/types\";\n\nexport const onTemplateAfterCreateHook = (context: AuditLogsContext) => {\n context.pageBuilder.onPageTemplateAfterCreate.subscribe(async ({ pageTemplate }) => {\n try {\n const createAuditLog = getAuditConfig(AUDIT.PAGE_BUILDER.TEMPLATE.CREATE);\n\n await createAuditLog(\"Template created\", pageTemplate, pageTemplate.id, context);\n } catch (error) {\n throw WebinyError.from(error, {\n message: \"Error while executing onTemplateAfterCreateHook hook\",\n code: \"AUDIT_LOGS_AFTER_TEMPLATE_CREATE_HOOK\"\n });\n }\n });\n};\n\nexport const onTemplateAfterUpdateHook = (context: AuditLogsContext) => {\n context.pageBuilder.onPageTemplateAfterUpdate.subscribe(async ({ pageTemplate, original }) => {\n try {\n const createAuditLog = getAuditConfig(AUDIT.PAGE_BUILDER.TEMPLATE.UPDATE);\n\n await createAuditLog(\n \"Template updated\",\n { before: original, after: pageTemplate },\n pageTemplate.id,\n context\n );\n } catch (error) {\n throw WebinyError.from(error, {\n message: \"Error while executing onTemplateAfterUpdateHook hook\",\n code: \"AUDIT_LOGS_AFTER_TEMPLATE_UPDATE_HOOK\"\n });\n }\n });\n};\n\nexport const onTemplateAfterDeleteHook = (context: AuditLogsContext) => {\n context.pageBuilder.onPageTemplateAfterDelete.subscribe(async ({ pageTemplate }) => {\n try {\n const createAuditLog = getAuditConfig(AUDIT.PAGE_BUILDER.TEMPLATE.DELETE);\n\n await createAuditLog(\"Template deleted\", pageTemplate, pageTemplate.id, context);\n } catch (error) {\n throw WebinyError.from(error, {\n message: \"Error while executing onTemplateAfterDeleteHook hook\",\n code: \"AUDIT_LOGS_AFTER_TEMPLATE_DELETE_HOOK\"\n });\n }\n });\n};\n\nexport const onTemplatesAfterExportHook = (context: AuditLogsContext) => {\n context.pageBuilder.templates.onTemplatesAfterExport.subscribe(async ({ params }) => {\n try {\n const createAuditLog = getAuditConfig(AUDIT.PAGE_BUILDER.TEMPLATE.EXPORT);\n\n await createAuditLog(\"Templates exported\", params, \"-\", context);\n } catch (error) {\n throw WebinyError.from(error, {\n message: \"Error while executing onTemplatesAfterExportHook hook\",\n code: \"AUDIT_LOGS_TEMPLATES_EXPORT_HOOK\"\n });\n }\n });\n};\n\nexport const onTemplatesAfterImportHook = (context: AuditLogsContext) => {\n context.pageBuilder.templates.onTemplatesAfterImport.subscribe(async ({ params }) => {\n try {\n const createAuditLog = getAuditConfig(AUDIT.PAGE_BUILDER.TEMPLATE.IMPORT);\n\n await createAuditLog(\"Templates imported\", params, \"-\", context);\n } catch (error) {\n throw WebinyError.from(error, {\n message: \"Error while executing onTemplatesAfterImportHook hook\",\n code: \"AUDIT_LOGS_TEMPLATES_IMPORT_HOOK\"\n });\n }\n });\n};\n"],"mappings":";;;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AAEA,IAAAC,OAAA,GAAAD,OAAA;AACA,IAAAE,eAAA,GAAAF,OAAA;AAGO,MAAMG,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I;MACA,MAAMzB,cAAc,GAAG,IAAAC,8BAAc,EAACC,aAAK,CAACC,YAAY,CAACC,QAAQ,CAACyB,MAAM,CAAC;MAEzE,MAAM7B,cAAc,CAAC,oBAAoB,EAAEyB,MAAM,EAAE,GAAG,EAAE9B,OAAO,CAAC;IACpE,CAAC,CAAC,OAAOY,KAAK,EAAE;MACZ,MAAMC,cAAW,CAACC,IAAI,CAACF,KAAK,EAAE;QAC1BG,OAAO,EAAE,uDAAuD;QAChEC,IAAI,EAAE;MACV,CAAC,CAAC;IACN;EACJ,CAAC,CAAC;AACN,CAAC;AAACC,OAAA,CAAAe,0BAAA,GAAAA,0BAAA","ignoreList":[]}
@@ -1,4 +0,0 @@
1
- import { AuditLogsContext } from "../../types";
2
- export declare const onApiKeyAfterCreateHook: (context: AuditLogsContext) => void;
3
- export declare const onApiKeyAfterUpdateHook: (context: AuditLogsContext) => void;
4
- export declare const onApiKeyAfterDeleteHook: (context: AuditLogsContext) => void;
@@ -1,85 +0,0 @@
1
- "use strict";
2
-
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
4
- Object.defineProperty(exports, "__esModule", {
5
- value: true
6
- });
7
- exports.onApiKeyAfterUpdateHook = exports.onApiKeyAfterDeleteHook = exports.onApiKeyAfterCreateHook = void 0;
8
- var _error = _interopRequireDefault(require("@webiny/error"));
9
- var _config = require("../../config");
10
- var _getAuditConfig = require("../../utils/getAuditConfig");
11
- /**
12
- * We need to remove the token from the API Key object, as it is a security risk.
13
- *
14
- * We assign the API Key object explicitly, so we do not miss any new properties that might be added in the future - and they should not be in the log.
15
- */
16
- const cleanupApiKey = apiKey => {
17
- return {
18
- id: apiKey.id,
19
- createdBy: apiKey.createdBy,
20
- createdOn: apiKey.createdOn,
21
- description: apiKey.description,
22
- name: apiKey.name,
23
- permissions: apiKey.permissions,
24
- tenant: apiKey.tenant,
25
- webinyVersion: apiKey.webinyVersion
26
- };
27
- };
28
- const onApiKeyAfterCreateHook = context => {
29
- context.security.onApiKeyAfterCreate.subscribe(async ({
30
- apiKey: initialApiKey
31
- }) => {
32
- try {
33
- const createAuditLog = (0, _getAuditConfig.getAuditConfig)(_config.AUDIT.SECURITY.API_KEY.CREATE);
34
- const apiKey = cleanupApiKey(initialApiKey);
35
- await createAuditLog("API key created", apiKey, apiKey.id, context);
36
- } catch (error) {
37
- throw _error.default.from(error, {
38
- message: "Error while executing onApiKeyAfterCreateHook hook",
39
- code: "AUDIT_LOGS_AFTER_API_KEY_CREATE_HOOK"
40
- });
41
- }
42
- });
43
- };
44
- exports.onApiKeyAfterCreateHook = onApiKeyAfterCreateHook;
45
- const onApiKeyAfterUpdateHook = context => {
46
- context.security.onApiKeyAfterUpdate.subscribe(async ({
47
- apiKey: initialApiKey,
48
- original: initialOriginalApiKey
49
- }) => {
50
- try {
51
- const createAuditLog = (0, _getAuditConfig.getAuditConfig)(_config.AUDIT.SECURITY.API_KEY.UPDATE);
52
- const apiKey = cleanupApiKey(initialApiKey);
53
- const original = cleanupApiKey(initialOriginalApiKey);
54
- await createAuditLog("API key updated", {
55
- before: original,
56
- after: apiKey
57
- }, apiKey.id, context);
58
- } catch (error) {
59
- throw _error.default.from(error, {
60
- message: "Error while executing onApiKeyAfterUpdateHook hook",
61
- code: "AUDIT_LOGS_AFTER_API_KEY_UPDATE_HOOK"
62
- });
63
- }
64
- });
65
- };
66
- exports.onApiKeyAfterUpdateHook = onApiKeyAfterUpdateHook;
67
- const onApiKeyAfterDeleteHook = context => {
68
- context.security.onApiKeyAfterDelete.subscribe(async ({
69
- apiKey: initialApiKey
70
- }) => {
71
- try {
72
- const createAuditLog = (0, _getAuditConfig.getAuditConfig)(_config.AUDIT.SECURITY.API_KEY.DELETE);
73
- const apiKey = cleanupApiKey(initialApiKey);
74
- await createAuditLog("API key deleted", apiKey, apiKey.id, context);
75
- } catch (error) {
76
- throw _error.default.from(error, {
77
- message: "Error while executing onApiKeyAfterDeleteHook hook",
78
- code: "AUDIT_LOGS_AFTER_API_KEY_DELETE_HOOK"
79
- });
80
- }
81
- });
82
- };
83
- exports.onApiKeyAfterDeleteHook = onApiKeyAfterDeleteHook;
84
-
85
- //# sourceMappingURL=apiKeys.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["_error","_interopRequireDefault","require","_config","_getAuditConfig","cleanupApiKey","apiKey","id","createdBy","createdOn","description","name","permissions","tenant","webinyVersion","onApiKeyAfterCreateHook","context","security","onApiKeyAfterCreate","subscribe","initialApiKey","createAuditLog","getAuditConfig","AUDIT","SECURITY","API_KEY","CREATE","error","WebinyError","from","message","code","exports","onApiKeyAfterUpdateHook","onApiKeyAfterUpdate","original","initialOriginalApiKey","UPDATE","before","after","onApiKeyAfterDeleteHook","onApiKeyAfterDelete","DELETE"],"sources":["apiKeys.ts"],"sourcesContent":["import WebinyError from \"@webiny/error\";\n\nimport { AUDIT } from \"~/config\";\nimport { getAuditConfig } from \"~/utils/getAuditConfig\";\nimport { AuditLogsContext } from \"~/types\";\nimport { ApiKey } from \"@webiny/api-security/types\";\n\n/**\n * We need to remove the token from the API Key object, as it is a security risk.\n *\n * We assign the API Key object explicitly, so we do not miss any new properties that might be added in the future - and they should not be in the log.\n */\nconst cleanupApiKey = (apiKey: ApiKey): Omit<ApiKey, \"token\"> => {\n return {\n id: apiKey.id,\n createdBy: apiKey.createdBy,\n createdOn: apiKey.createdOn,\n description: apiKey.description,\n name: apiKey.name,\n permissions: apiKey.permissions,\n tenant: apiKey.tenant,\n webinyVersion: apiKey.webinyVersion\n };\n};\n\nexport const onApiKeyAfterCreateHook = (context: AuditLogsContext) => {\n context.security.onApiKeyAfterCreate.subscribe(async ({ apiKey: initialApiKey }) => {\n try {\n const createAuditLog = getAuditConfig(AUDIT.SECURITY.API_KEY.CREATE);\n\n const apiKey = cleanupApiKey(initialApiKey);\n\n await createAuditLog(\"API key created\", apiKey, apiKey.id, context);\n } catch (error) {\n throw WebinyError.from(error, {\n message: \"Error while executing onApiKeyAfterCreateHook hook\",\n code: \"AUDIT_LOGS_AFTER_API_KEY_CREATE_HOOK\"\n });\n }\n });\n};\n\nexport const onApiKeyAfterUpdateHook = (context: AuditLogsContext) => {\n context.security.onApiKeyAfterUpdate.subscribe(\n async ({ apiKey: initialApiKey, original: initialOriginalApiKey }) => {\n try {\n const createAuditLog = getAuditConfig(AUDIT.SECURITY.API_KEY.UPDATE);\n\n const apiKey = cleanupApiKey(initialApiKey);\n const original = cleanupApiKey(initialOriginalApiKey);\n\n await createAuditLog(\n \"API key updated\",\n {\n before: original,\n after: apiKey\n },\n apiKey.id,\n context\n );\n } catch (error) {\n throw WebinyError.from(error, {\n message: \"Error while executing onApiKeyAfterUpdateHook hook\",\n code: \"AUDIT_LOGS_AFTER_API_KEY_UPDATE_HOOK\"\n });\n }\n }\n );\n};\n\nexport const onApiKeyAfterDeleteHook = (context: AuditLogsContext) => {\n context.security.onApiKeyAfterDelete.subscribe(async ({ apiKey: initialApiKey }) => {\n try {\n const createAuditLog = getAuditConfig(AUDIT.SECURITY.API_KEY.DELETE);\n\n const apiKey = cleanupApiKey(initialApiKey);\n\n await createAuditLog(\"API key deleted\", apiKey, apiKey.id, context);\n } catch (error) {\n throw WebinyError.from(error, {\n message: \"Error while executing onApiKeyAfterDeleteHook hook\",\n code: \"AUDIT_LOGS_AFTER_API_KEY_DELETE_HOOK\"\n });\n }\n });\n};\n"],"mappings":";;;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AAEA,IAAAC,OAAA,GAAAD,OAAA;AACA,IAAAE,eAAA,GAAAF,OAAA;AAIA;AACA;AACA;AACA;AACA;AACA,MAAMG,aAAa,GAAIC,MAAc,IAA4B;EAC7D,OAAO;IACHC,EAAE,EAAED,MAAM,CAACC,EAAE;IACbC,SAAS,EAAEF,MAAM,CAACE,SAAS;IAC3BC,SAAS,EAAEH,MAAM,CAACG,SAAS;IAC3BC,WAAW,EAAEJ,MAAM,CAACI,WAAW;IAC/BC,IAAI,EAAEL,MAAM,CAACK,IAAI;IAC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