@webiny/api-audit-logs 0.0.0-unstable.a4637c5ce6 → 0.0.0-unstable.a4f3e4ea8b

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 (302) hide show
  1. package/README.md +11 -1
  2. package/abstractions.d.ts +10 -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 +4 -291
  7. package/config.js.map +1 -1
  8. package/context/AuditLogsContextValue.d.ts +10 -0
  9. package/context/AuditLogsContextValue.js +129 -0
  10. package/context/AuditLogsContextValue.js.map +1 -0
  11. package/context/index.d.ts +6 -0
  12. package/context/index.js +25 -0
  13. package/context/index.js.map +1 -0
  14. package/events/AuditLogAfterCreateEvent.d.ts +6 -0
  15. package/events/AuditLogAfterCreateEvent.js +13 -0
  16. package/events/AuditLogAfterCreateEvent.js.map +1 -0
  17. package/events/AuditLogAfterUpdateEvent.d.ts +6 -0
  18. package/events/AuditLogAfterUpdateEvent.js +13 -0
  19. package/events/AuditLogAfterUpdateEvent.js.map +1 -0
  20. package/events/AuditLogBeforeCreateEvent.d.ts +6 -0
  21. package/events/AuditLogBeforeCreateEvent.js +13 -0
  22. package/events/AuditLogBeforeCreateEvent.js.map +1 -0
  23. package/events/AuditLogBeforeUpdateEvent.d.ts +6 -0
  24. package/events/AuditLogBeforeUpdateEvent.js +13 -0
  25. package/events/AuditLogBeforeUpdateEvent.js.map +1 -0
  26. package/events/abstractions.d.ts +43 -0
  27. package/events/abstractions.js +8 -0
  28. package/events/abstractions.js.map +1 -0
  29. package/events/index.d.ts +5 -0
  30. package/events/index.js +5 -0
  31. package/graphql/schema.d.ts +3 -0
  32. package/graphql/schema.js +115 -0
  33. package/graphql/schema.js.map +1 -0
  34. package/graphql/validation.d.ts +21 -0
  35. package/graphql/validation.js +31 -0
  36. package/graphql/validation.js.map +1 -0
  37. package/index.d.ts +5 -4
  38. package/index.js +21 -46
  39. package/index.js.map +1 -1
  40. package/package.json +33 -26
  41. package/storage/abstractions/Storage.d.ts +108 -0
  42. package/storage/abstractions/Storage.js +0 -0
  43. package/storage/types.d.ts +19 -0
  44. package/storage/types.js +0 -0
  45. package/subscriptions/aco/handlers/AuditLogFolderAfterCreateHandler.d.ts +11 -0
  46. package/subscriptions/aco/handlers/AuditLogFolderAfterCreateHandler.js +36 -0
  47. package/subscriptions/aco/handlers/AuditLogFolderAfterCreateHandler.js.map +1 -0
  48. package/subscriptions/aco/handlers/AuditLogFolderAfterDeleteHandler.d.ts +11 -0
  49. package/subscriptions/aco/handlers/AuditLogFolderAfterDeleteHandler.js +39 -0
  50. package/subscriptions/aco/handlers/AuditLogFolderAfterDeleteHandler.js.map +1 -0
  51. package/subscriptions/aco/handlers/AuditLogFolderAfterUpdateHandler.d.ts +11 -0
  52. package/subscriptions/aco/handlers/AuditLogFolderAfterUpdateHandler.js +42 -0
  53. package/subscriptions/aco/handlers/AuditLogFolderAfterUpdateHandler.js.map +1 -0
  54. package/subscriptions/aco/index.d.ts +1 -1
  55. package/subscriptions/aco/index.js +8 -15
  56. package/subscriptions/aco/index.js.map +1 -1
  57. package/subscriptions/ai/handlers/AuditLogAiAfterGenerateTextHandler.d.ts +11 -0
  58. package/subscriptions/ai/handlers/AuditLogAiAfterGenerateTextHandler.js +41 -0
  59. package/subscriptions/ai/handlers/AuditLogAiAfterGenerateTextHandler.js.map +1 -0
  60. package/subscriptions/ai/handlers/AuditLogAiBeforeGenerateTextHandler.d.ts +11 -0
  61. package/subscriptions/ai/handlers/AuditLogAiBeforeGenerateTextHandler.js +38 -0
  62. package/subscriptions/ai/handlers/AuditLogAiBeforeGenerateTextHandler.js.map +1 -0
  63. package/subscriptions/ai/handlers/AuditLogAiGenerateTextErrorHandler.d.ts +11 -0
  64. package/subscriptions/ai/handlers/AuditLogAiGenerateTextErrorHandler.js +40 -0
  65. package/subscriptions/ai/handlers/AuditLogAiGenerateTextErrorHandler.js.map +1 -0
  66. package/subscriptions/ai/index.d.ts +2 -0
  67. package/subscriptions/ai/index.js +11 -0
  68. package/subscriptions/ai/index.js.map +1 -0
  69. package/subscriptions/fileManager/handlers/AuditLogFileAfterCreateHandler.d.ts +11 -0
  70. package/subscriptions/fileManager/handlers/AuditLogFileAfterCreateHandler.js +31 -0
  71. package/subscriptions/fileManager/handlers/AuditLogFileAfterCreateHandler.js.map +1 -0
  72. package/subscriptions/fileManager/handlers/AuditLogFileAfterDeleteHandler.d.ts +11 -0
  73. package/subscriptions/fileManager/handlers/AuditLogFileAfterDeleteHandler.js +31 -0
  74. package/subscriptions/fileManager/handlers/AuditLogFileAfterDeleteHandler.js.map +1 -0
  75. package/subscriptions/fileManager/handlers/AuditLogFileAfterUpdateHandler.d.ts +11 -0
  76. package/subscriptions/fileManager/handlers/AuditLogFileAfterUpdateHandler.js +34 -0
  77. package/subscriptions/fileManager/handlers/AuditLogFileAfterUpdateHandler.js.map +1 -0
  78. package/subscriptions/fileManager/handlers/AuditLogSettingsAfterUpdateHandler.d.ts +11 -0
  79. package/subscriptions/fileManager/handlers/AuditLogSettingsAfterUpdateHandler.js +34 -0
  80. package/subscriptions/fileManager/handlers/AuditLogSettingsAfterUpdateHandler.js.map +1 -0
  81. package/subscriptions/fileManager/index.d.ts +2 -2
  82. package/subscriptions/fileManager/index.js +10 -14
  83. package/subscriptions/fileManager/index.js.map +1 -1
  84. package/subscriptions/headlessCms/handlers/AuditLogEntryAfterCreateEventHandler.d.ts +11 -0
  85. package/subscriptions/headlessCms/handlers/AuditLogEntryAfterCreateEventHandler.js +32 -0
  86. package/subscriptions/headlessCms/handlers/AuditLogEntryAfterCreateEventHandler.js.map +1 -0
  87. package/subscriptions/headlessCms/handlers/AuditLogEntryAfterDeleteEventHandler.d.ts +11 -0
  88. package/subscriptions/headlessCms/handlers/AuditLogEntryAfterDeleteEventHandler.js +37 -0
  89. package/subscriptions/headlessCms/handlers/AuditLogEntryAfterDeleteEventHandler.js.map +1 -0
  90. package/subscriptions/headlessCms/handlers/AuditLogEntryAfterPublishEventHandler.d.ts +11 -0
  91. package/subscriptions/headlessCms/handlers/AuditLogEntryAfterPublishEventHandler.js +32 -0
  92. package/subscriptions/headlessCms/handlers/AuditLogEntryAfterPublishEventHandler.js.map +1 -0
  93. package/subscriptions/headlessCms/handlers/AuditLogEntryAfterRestoreFromBinEventHandler.d.ts +11 -0
  94. package/subscriptions/headlessCms/handlers/AuditLogEntryAfterRestoreFromBinEventHandler.js +32 -0
  95. package/subscriptions/headlessCms/handlers/AuditLogEntryAfterRestoreFromBinEventHandler.js.map +1 -0
  96. package/subscriptions/headlessCms/handlers/AuditLogEntryAfterUnpublishEventHandler.d.ts +11 -0
  97. package/subscriptions/headlessCms/handlers/AuditLogEntryAfterUnpublishEventHandler.js +32 -0
  98. package/subscriptions/headlessCms/handlers/AuditLogEntryAfterUnpublishEventHandler.js.map +1 -0
  99. package/subscriptions/headlessCms/handlers/AuditLogEntryAfterUpdateEventHandler.d.ts +11 -0
  100. package/subscriptions/headlessCms/handlers/AuditLogEntryAfterUpdateEventHandler.js +35 -0
  101. package/subscriptions/headlessCms/handlers/AuditLogEntryAfterUpdateEventHandler.js.map +1 -0
  102. package/subscriptions/headlessCms/handlers/AuditLogEntryRevisionAfterCreateEventHandler.d.ts +11 -0
  103. package/subscriptions/headlessCms/handlers/AuditLogEntryRevisionAfterCreateEventHandler.js +32 -0
  104. package/subscriptions/headlessCms/handlers/AuditLogEntryRevisionAfterCreateEventHandler.js.map +1 -0
  105. package/subscriptions/headlessCms/handlers/AuditLogEntryRevisionAfterDeleteEventHandler.d.ts +11 -0
  106. package/subscriptions/headlessCms/handlers/AuditLogEntryRevisionAfterDeleteEventHandler.js +32 -0
  107. package/subscriptions/headlessCms/handlers/AuditLogEntryRevisionAfterDeleteEventHandler.js.map +1 -0
  108. package/subscriptions/headlessCms/handlers/AuditLogGroupAfterCreateEventHandler.d.ts +11 -0
  109. package/subscriptions/headlessCms/handlers/AuditLogGroupAfterCreateEventHandler.js +31 -0
  110. package/subscriptions/headlessCms/handlers/AuditLogGroupAfterCreateEventHandler.js.map +1 -0
  111. package/subscriptions/headlessCms/handlers/AuditLogGroupAfterDeleteEventHandler.d.ts +11 -0
  112. package/subscriptions/headlessCms/handlers/AuditLogGroupAfterDeleteEventHandler.js +31 -0
  113. package/subscriptions/headlessCms/handlers/AuditLogGroupAfterDeleteEventHandler.js.map +1 -0
  114. package/subscriptions/headlessCms/handlers/AuditLogGroupAfterUpdateEventHandler.d.ts +11 -0
  115. package/subscriptions/headlessCms/handlers/AuditLogGroupAfterUpdateEventHandler.js +34 -0
  116. package/subscriptions/headlessCms/handlers/AuditLogGroupAfterUpdateEventHandler.js.map +1 -0
  117. package/subscriptions/headlessCms/handlers/AuditLogModelAfterCreateEventHandler.d.ts +11 -0
  118. package/subscriptions/headlessCms/handlers/AuditLogModelAfterCreateEventHandler.js +31 -0
  119. package/subscriptions/headlessCms/handlers/AuditLogModelAfterCreateEventHandler.js.map +1 -0
  120. package/subscriptions/headlessCms/handlers/AuditLogModelAfterDeleteEventHandler.d.ts +11 -0
  121. package/subscriptions/headlessCms/handlers/AuditLogModelAfterDeleteEventHandler.js +31 -0
  122. package/subscriptions/headlessCms/handlers/AuditLogModelAfterDeleteEventHandler.js.map +1 -0
  123. package/subscriptions/headlessCms/handlers/AuditLogModelAfterUpdateEventHandler.d.ts +11 -0
  124. package/subscriptions/headlessCms/handlers/AuditLogModelAfterUpdateEventHandler.js +34 -0
  125. package/subscriptions/headlessCms/handlers/AuditLogModelAfterUpdateEventHandler.js.map +1 -0
  126. package/subscriptions/headlessCms/index.d.ts +1 -1
  127. package/subscriptions/headlessCms/index.js +30 -28
  128. package/subscriptions/headlessCms/index.js.map +1 -1
  129. package/subscriptions/index.d.ts +1 -1
  130. package/subscriptions/index.js +16 -22
  131. package/subscriptions/index.js.map +1 -1
  132. package/subscriptions/mailer/handlers/AuditLogMailerSettingsAfterSaveHandler.d.ts +11 -0
  133. package/subscriptions/mailer/handlers/AuditLogMailerSettingsAfterSaveHandler.js +33 -0
  134. package/subscriptions/mailer/handlers/AuditLogMailerSettingsAfterSaveHandler.js.map +1 -0
  135. package/subscriptions/mailer/index.d.ts +2 -2
  136. package/subscriptions/mailer/index.js +4 -10
  137. package/subscriptions/mailer/index.js.map +1 -1
  138. package/subscriptions/security/handlers/AuditLogApiKeyAfterCreateHandler.d.ts +11 -0
  139. package/subscriptions/security/handlers/AuditLogApiKeyAfterCreateHandler.js +41 -0
  140. package/subscriptions/security/handlers/AuditLogApiKeyAfterCreateHandler.js.map +1 -0
  141. package/subscriptions/security/handlers/AuditLogApiKeyAfterDeleteHandler.d.ts +11 -0
  142. package/subscriptions/security/handlers/AuditLogApiKeyAfterDeleteHandler.js +41 -0
  143. package/subscriptions/security/handlers/AuditLogApiKeyAfterDeleteHandler.js.map +1 -0
  144. package/subscriptions/security/handlers/AuditLogApiKeyAfterUpdateHandler.d.ts +11 -0
  145. package/subscriptions/security/handlers/AuditLogApiKeyAfterUpdateHandler.js +45 -0
  146. package/subscriptions/security/handlers/AuditLogApiKeyAfterUpdateHandler.js.map +1 -0
  147. package/subscriptions/security/handlers/AuditLogRoleAfterCreateHandler.d.ts +11 -0
  148. package/subscriptions/security/handlers/AuditLogRoleAfterCreateHandler.js +31 -0
  149. package/subscriptions/security/handlers/AuditLogRoleAfterCreateHandler.js.map +1 -0
  150. package/subscriptions/security/handlers/AuditLogRoleAfterDeleteHandler.d.ts +11 -0
  151. package/subscriptions/security/handlers/AuditLogRoleAfterDeleteHandler.js +31 -0
  152. package/subscriptions/security/handlers/AuditLogRoleAfterDeleteHandler.js.map +1 -0
  153. package/subscriptions/security/handlers/AuditLogRoleAfterUpdateHandler.d.ts +11 -0
  154. package/subscriptions/security/handlers/AuditLogRoleAfterUpdateHandler.js +34 -0
  155. package/subscriptions/security/handlers/AuditLogRoleAfterUpdateHandler.js.map +1 -0
  156. package/subscriptions/security/handlers/AuditLogTeamAfterCreateHandler.d.ts +11 -0
  157. package/subscriptions/security/handlers/AuditLogTeamAfterCreateHandler.js +31 -0
  158. package/subscriptions/security/handlers/AuditLogTeamAfterCreateHandler.js.map +1 -0
  159. package/subscriptions/security/handlers/AuditLogTeamAfterDeleteHandler.d.ts +11 -0
  160. package/subscriptions/security/handlers/AuditLogTeamAfterDeleteHandler.js +31 -0
  161. package/subscriptions/security/handlers/AuditLogTeamAfterDeleteHandler.js.map +1 -0
  162. package/subscriptions/security/handlers/AuditLogTeamAfterUpdateHandler.d.ts +11 -0
  163. package/subscriptions/security/handlers/AuditLogTeamAfterUpdateHandler.js +34 -0
  164. package/subscriptions/security/handlers/AuditLogTeamAfterUpdateHandler.js.map +1 -0
  165. package/subscriptions/security/handlers/AuditLogUserAfterCreateHandler.d.ts +11 -0
  166. package/subscriptions/security/handlers/AuditLogUserAfterCreateHandler.js +31 -0
  167. package/subscriptions/security/handlers/AuditLogUserAfterCreateHandler.js.map +1 -0
  168. package/subscriptions/security/handlers/AuditLogUserAfterDeleteHandler.d.ts +11 -0
  169. package/subscriptions/security/handlers/AuditLogUserAfterDeleteHandler.js +31 -0
  170. package/subscriptions/security/handlers/AuditLogUserAfterDeleteHandler.js.map +1 -0
  171. package/subscriptions/security/handlers/AuditLogUserAfterUpdateHandler.d.ts +11 -0
  172. package/subscriptions/security/handlers/AuditLogUserAfterUpdateHandler.js +34 -0
  173. package/subscriptions/security/handlers/AuditLogUserAfterUpdateHandler.js.map +1 -0
  174. package/subscriptions/security/handlers/cleanupApiKey.d.ts +7 -0
  175. package/subscriptions/security/handlers/cleanupApiKey.js +12 -0
  176. package/subscriptions/security/handlers/cleanupApiKey.js.map +1 -0
  177. package/subscriptions/security/index.d.ts +2 -2
  178. package/subscriptions/security/index.js +26 -24
  179. package/subscriptions/security/index.js.map +1 -1
  180. package/subscriptions/websiteBuilder/index.d.ts +2 -0
  181. package/subscriptions/websiteBuilder/index.js +29 -0
  182. package/subscriptions/websiteBuilder/index.js.map +1 -0
  183. package/subscriptions/websiteBuilder/pages/PageAfterCreateHandler.d.ts +11 -0
  184. package/subscriptions/websiteBuilder/pages/PageAfterCreateHandler.js +31 -0
  185. package/subscriptions/websiteBuilder/pages/PageAfterCreateHandler.js.map +1 -0
  186. package/subscriptions/websiteBuilder/pages/PageAfterCreateRevisionFromHandler.d.ts +11 -0
  187. package/subscriptions/websiteBuilder/pages/PageAfterCreateRevisionFromHandler.js +31 -0
  188. package/subscriptions/websiteBuilder/pages/PageAfterCreateRevisionFromHandler.js.map +1 -0
  189. package/subscriptions/websiteBuilder/pages/PageAfterDeleteHandler.d.ts +11 -0
  190. package/subscriptions/websiteBuilder/pages/PageAfterDeleteHandler.js +31 -0
  191. package/subscriptions/websiteBuilder/pages/PageAfterDeleteHandler.js.map +1 -0
  192. package/subscriptions/websiteBuilder/pages/PageAfterDuplicateHandler.d.ts +11 -0
  193. package/subscriptions/websiteBuilder/pages/PageAfterDuplicateHandler.js +34 -0
  194. package/subscriptions/websiteBuilder/pages/PageAfterDuplicateHandler.js.map +1 -0
  195. package/subscriptions/websiteBuilder/pages/PageAfterMoveHandler.d.ts +11 -0
  196. package/subscriptions/websiteBuilder/pages/PageAfterMoveHandler.js +31 -0
  197. package/subscriptions/websiteBuilder/pages/PageAfterMoveHandler.js.map +1 -0
  198. package/subscriptions/websiteBuilder/pages/PageAfterPublishHandler.d.ts +11 -0
  199. package/subscriptions/websiteBuilder/pages/PageAfterPublishHandler.js +31 -0
  200. package/subscriptions/websiteBuilder/pages/PageAfterPublishHandler.js.map +1 -0
  201. package/subscriptions/websiteBuilder/pages/PageAfterUnpublishHandler.d.ts +11 -0
  202. package/subscriptions/websiteBuilder/pages/PageAfterUnpublishHandler.js +31 -0
  203. package/subscriptions/websiteBuilder/pages/PageAfterUnpublishHandler.js.map +1 -0
  204. package/subscriptions/websiteBuilder/pages/PageAfterUpdateHandler.d.ts +11 -0
  205. package/subscriptions/websiteBuilder/pages/PageAfterUpdateHandler.js +34 -0
  206. package/subscriptions/websiteBuilder/pages/PageAfterUpdateHandler.js.map +1 -0
  207. package/subscriptions/websiteBuilder/redirects/RedirectAfterCreateHandler.d.ts +11 -0
  208. package/subscriptions/websiteBuilder/redirects/RedirectAfterCreateHandler.js +31 -0
  209. package/subscriptions/websiteBuilder/redirects/RedirectAfterCreateHandler.js.map +1 -0
  210. package/subscriptions/websiteBuilder/redirects/RedirectAfterDeleteHandler.d.ts +11 -0
  211. package/subscriptions/websiteBuilder/redirects/RedirectAfterDeleteHandler.js +31 -0
  212. package/subscriptions/websiteBuilder/redirects/RedirectAfterDeleteHandler.js.map +1 -0
  213. package/subscriptions/websiteBuilder/redirects/RedirectAfterMoveHandler.d.ts +11 -0
  214. package/subscriptions/websiteBuilder/redirects/RedirectAfterMoveHandler.js +31 -0
  215. package/subscriptions/websiteBuilder/redirects/RedirectAfterMoveHandler.js.map +1 -0
  216. package/subscriptions/websiteBuilder/redirects/RedirectAfterUpdateHandler.d.ts +11 -0
  217. package/subscriptions/websiteBuilder/redirects/RedirectAfterUpdateHandler.js +34 -0
  218. package/subscriptions/websiteBuilder/redirects/RedirectAfterUpdateHandler.js.map +1 -0
  219. package/types.d.ts +37 -38
  220. package/types.js +0 -18
  221. package/utils/expiresAt.d.ts +4 -0
  222. package/utils/expiresAt.js +20 -0
  223. package/utils/expiresAt.js.map +1 -0
  224. package/utils/getAuditConfig.d.ts +4 -36
  225. package/utils/getAuditConfig.js +75 -138
  226. package/utils/getAuditConfig.js.map +1 -1
  227. package/utils/getAuditObject.d.ts +2 -1
  228. package/utils/getAuditObject.js +14 -22
  229. package/utils/getAuditObject.js.map +1 -1
  230. package/app/app.d.ts +0 -2
  231. package/app/app.js +0 -119
  232. package/app/app.js.map +0 -1
  233. package/app/contants.d.ts +0 -2
  234. package/app/contants.js +0 -10
  235. package/app/contants.js.map +0 -1
  236. package/app/createAppModifier.d.ts +0 -4
  237. package/app/createAppModifier.js +0 -14
  238. package/app/createAppModifier.js.map +0 -1
  239. package/app/index.d.ts +0 -4
  240. package/app/index.js +0 -43
  241. package/app/index.js.map +0 -1
  242. package/app/types.d.ts +0 -7
  243. package/app/types.js +0 -7
  244. package/app/types.js.map +0 -1
  245. package/subscriptions/aco/folders.d.ts +0 -4
  246. package/subscriptions/aco/folders.js +0 -94
  247. package/subscriptions/aco/folders.js.map +0 -1
  248. package/subscriptions/apw/changeRequests.d.ts +0 -4
  249. package/subscriptions/apw/changeRequests.js +0 -80
  250. package/subscriptions/apw/changeRequests.js.map +0 -1
  251. package/subscriptions/apw/comments.d.ts +0 -2
  252. package/subscriptions/apw/comments.js +0 -28
  253. package/subscriptions/apw/comments.js.map +0 -1
  254. package/subscriptions/apw/contentReviews.d.ts +0 -2
  255. package/subscriptions/apw/contentReviews.js +0 -28
  256. package/subscriptions/apw/contentReviews.js.map +0 -1
  257. package/subscriptions/apw/index.d.ts +0 -2
  258. package/subscriptions/apw/index.js +0 -26
  259. package/subscriptions/apw/index.js.map +0 -1
  260. package/subscriptions/apw/workflows.d.ts +0 -4
  261. package/subscriptions/apw/workflows.js +0 -64
  262. package/subscriptions/apw/workflows.js.map +0 -1
  263. package/subscriptions/fileManager/files.d.ts +0 -4
  264. package/subscriptions/fileManager/files.js +0 -64
  265. package/subscriptions/fileManager/files.js.map +0 -1
  266. package/subscriptions/fileManager/settings.d.ts +0 -2
  267. package/subscriptions/fileManager/settings.js +0 -32
  268. package/subscriptions/fileManager/settings.js.map +0 -1
  269. package/subscriptions/headlessCms/entries.d.ts +0 -9
  270. package/subscriptions/headlessCms/entries.js +0 -183
  271. package/subscriptions/headlessCms/entries.js.map +0 -1
  272. package/subscriptions/headlessCms/groups.d.ts +0 -4
  273. package/subscriptions/headlessCms/groups.js +0 -64
  274. package/subscriptions/headlessCms/groups.js.map +0 -1
  275. package/subscriptions/headlessCms/models.d.ts +0 -4
  276. package/subscriptions/headlessCms/models.js +0 -64
  277. package/subscriptions/headlessCms/models.js.map +0 -1
  278. package/subscriptions/headlessCms/utils/isSearchModelEntry.d.ts +0 -1
  279. package/subscriptions/headlessCms/utils/isSearchModelEntry.js +0 -13
  280. package/subscriptions/headlessCms/utils/isSearchModelEntry.js.map +0 -1
  281. package/subscriptions/i18n/index.d.ts +0 -2
  282. package/subscriptions/i18n/index.js +0 -15
  283. package/subscriptions/i18n/index.js.map +0 -1
  284. package/subscriptions/i18n/locales.d.ts +0 -4
  285. package/subscriptions/i18n/locales.js +0 -64
  286. package/subscriptions/i18n/locales.js.map +0 -1
  287. package/subscriptions/mailer/settings.d.ts +0 -2
  288. package/subscriptions/mailer/settings.js +0 -32
  289. package/subscriptions/mailer/settings.js.map +0 -1
  290. package/subscriptions/security/apiKeys.d.ts +0 -4
  291. package/subscriptions/security/apiKeys.js +0 -85
  292. package/subscriptions/security/apiKeys.js.map +0 -1
  293. package/subscriptions/security/roles.d.ts +0 -4
  294. package/subscriptions/security/roles.js +0 -64
  295. package/subscriptions/security/roles.js.map +0 -1
  296. package/subscriptions/security/teams.d.ts +0 -4
  297. package/subscriptions/security/teams.js +0 -64
  298. package/subscriptions/security/teams.js.map +0 -1
  299. package/subscriptions/security/users.d.ts +0 -4
  300. package/subscriptions/security/users.js +0 -64
  301. package/subscriptions/security/users.js.map +0 -1
  302. package/types.js.map +0 -1
@@ -0,0 +1,41 @@
1
+ import _webiny_error from "@webiny/error";
2
+ import { ApiKeyAfterDeleteEventHandler } from "@webiny/api-core/features/security/apiKeys/DeleteApiKey/index.js";
3
+ import { AuditLogsContext } from "../../../abstractions.js";
4
+ import { AUDIT } from "../../../config.js";
5
+ import { getAuditConfig } from "../../../utils/getAuditConfig.js";
6
+ const cleanupApiKey = (apiKey)=>({
7
+ id: apiKey.id,
8
+ slug: apiKey.slug,
9
+ createdBy: apiKey.createdBy,
10
+ createdOn: apiKey.createdOn,
11
+ description: apiKey.description,
12
+ name: apiKey.name,
13
+ permissions: apiKey.permissions
14
+ });
15
+ class AuditLogApiKeyAfterDeleteHandlerImpl {
16
+ constructor(context){
17
+ this.context = context;
18
+ }
19
+ async handle(event) {
20
+ try {
21
+ const { apiKey: initialApiKey } = event.payload;
22
+ const createAuditLog = getAuditConfig(AUDIT.SECURITY.API_KEY.DELETE);
23
+ const apiKey = cleanupApiKey(initialApiKey);
24
+ await createAuditLog("API key deleted", apiKey, apiKey.id, this.context);
25
+ } catch (error) {
26
+ throw _webiny_error.from(error, {
27
+ message: "Error while executing AuditLogApiKeyAfterDeleteHandler",
28
+ code: "AUDIT_LOGS_AFTER_API_KEY_DELETE_HANDLER"
29
+ });
30
+ }
31
+ }
32
+ }
33
+ const AuditLogApiKeyAfterDeleteHandler = ApiKeyAfterDeleteEventHandler.createImplementation({
34
+ implementation: AuditLogApiKeyAfterDeleteHandlerImpl,
35
+ dependencies: [
36
+ AuditLogsContext
37
+ ]
38
+ });
39
+ export { AuditLogApiKeyAfterDeleteHandler };
40
+
41
+ //# sourceMappingURL=AuditLogApiKeyAfterDeleteHandler.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"subscriptions/security/handlers/AuditLogApiKeyAfterDeleteHandler.js","sources":["../../../../src/subscriptions/security/handlers/AuditLogApiKeyAfterDeleteHandler.ts"],"sourcesContent":["import WebinyError from \"@webiny/error\";\nimport { ApiKeyAfterDeleteEventHandler } from \"@webiny/api-core/features/security/apiKeys/DeleteApiKey/index.js\";\nimport { AuditLogsContext } from \"~/abstractions.js\";\nimport { AUDIT } from \"~/config.js\";\nimport { getAuditConfig } from \"~/utils/getAuditConfig.js\";\nimport type { ApiKey } from \"@webiny/api-core/types/security.js\";\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 slug: apiKey.slug,\n createdBy: apiKey.createdBy,\n createdOn: apiKey.createdOn,\n description: apiKey.description,\n name: apiKey.name,\n permissions: apiKey.permissions\n };\n};\n\nclass AuditLogApiKeyAfterDeleteHandlerImpl implements ApiKeyAfterDeleteEventHandler.Interface {\n constructor(private context: AuditLogsContext.Interface) {}\n\n async handle(event: ApiKeyAfterDeleteEventHandler.Event): Promise<void> {\n try {\n const { apiKey: initialApiKey } = event.payload;\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, this.context);\n } catch (error) {\n throw WebinyError.from(error, {\n message: \"Error while executing AuditLogApiKeyAfterDeleteHandler\",\n code: \"AUDIT_LOGS_AFTER_API_KEY_DELETE_HANDLER\"\n });\n }\n }\n}\n\nexport const AuditLogApiKeyAfterDeleteHandler = ApiKeyAfterDeleteEventHandler.createImplementation({\n implementation: AuditLogApiKeyAfterDeleteHandlerImpl,\n dependencies: [AuditLogsContext]\n});\n"],"names":["cleanupApiKey","apiKey","AuditLogApiKeyAfterDeleteHandlerImpl","context","event","initialApiKey","createAuditLog","getAuditConfig","AUDIT","error","WebinyError","AuditLogApiKeyAfterDeleteHandler","ApiKeyAfterDeleteEventHandler","AuditLogsContext"],"mappings":";;;;;AAYA,MAAMA,gBAAgB,CAACC,SACZ;QACH,IAAIA,OAAO,EAAE;QACb,MAAMA,OAAO,IAAI;QACjB,WAAWA,OAAO,SAAS;QAC3B,WAAWA,OAAO,SAAS;QAC3B,aAAaA,OAAO,WAAW;QAC/B,MAAMA,OAAO,IAAI;QACjB,aAAaA,OAAO,WAAW;IACnC;AAGJ,MAAMC;IACF,YAAoBC,OAAmC,CAAE;aAArCA,OAAO,GAAPA;IAAsC;IAE1D,MAAM,OAAOC,KAA0C,EAAiB;QACpE,IAAI;YACA,MAAM,EAAE,QAAQC,aAAa,EAAE,GAAGD,MAAM,OAAO;YAC/C,MAAME,iBAAiBC,eAAeC,MAAM,QAAQ,CAAC,OAAO,CAAC,MAAM;YAEnE,MAAMP,SAASD,cAAcK;YAE7B,MAAMC,eAAe,mBAAmBL,QAAQA,OAAO,EAAE,EAAE,IAAI,CAAC,OAAO;QAC3E,EAAE,OAAOQ,OAAO;YACZ,MAAMC,cAAAA,IAAgB,CAACD,OAAO;gBAC1B,SAAS;gBACT,MAAM;YACV;QACJ;IACJ;AACJ;AAEO,MAAME,mCAAmCC,8BAA8B,oBAAoB,CAAC;IAC/F,gBAAgBV;IAChB,cAAc;QAACW;KAAiB;AACpC"}
@@ -0,0 +1,11 @@
1
+ import { ApiKeyAfterUpdateEventHandler } from "@webiny/api-core/features/security/apiKeys/UpdateApiKey/index.js";
2
+ import { AuditLogsContext } from "../../../abstractions.js";
3
+ declare class AuditLogApiKeyAfterUpdateHandlerImpl implements ApiKeyAfterUpdateEventHandler.Interface {
4
+ private context;
5
+ constructor(context: AuditLogsContext.Interface);
6
+ handle(event: ApiKeyAfterUpdateEventHandler.Event): Promise<void>;
7
+ }
8
+ export declare const AuditLogApiKeyAfterUpdateHandler: typeof AuditLogApiKeyAfterUpdateHandlerImpl & {
9
+ __abstraction: import("@webiny/di").Abstraction<import("@webiny/api-core/features/eventPublisher").IEventHandler<import("@webiny/api-core/features/security/apiKeys/UpdateApiKey/events").ApiKeyAfterUpdateEvent>>;
10
+ };
11
+ export {};
@@ -0,0 +1,45 @@
1
+ import _webiny_error from "@webiny/error";
2
+ import { ApiKeyAfterUpdateEventHandler } from "@webiny/api-core/features/security/apiKeys/UpdateApiKey/index.js";
3
+ import { AuditLogsContext } from "../../../abstractions.js";
4
+ import { AUDIT } from "../../../config.js";
5
+ import { getAuditConfig } from "../../../utils/getAuditConfig.js";
6
+ const cleanupApiKey = (apiKey)=>({
7
+ id: apiKey.id,
8
+ slug: apiKey.slug,
9
+ createdBy: apiKey.createdBy,
10
+ createdOn: apiKey.createdOn,
11
+ description: apiKey.description,
12
+ name: apiKey.name,
13
+ permissions: apiKey.permissions
14
+ });
15
+ class AuditLogApiKeyAfterUpdateHandlerImpl {
16
+ constructor(context){
17
+ this.context = context;
18
+ }
19
+ async handle(event) {
20
+ try {
21
+ const { updated: initialApiKey, original: initialOriginalApiKey } = event.payload;
22
+ const createAuditLog = getAuditConfig(AUDIT.SECURITY.API_KEY.UPDATE);
23
+ const apiKey = cleanupApiKey(initialApiKey);
24
+ const original = cleanupApiKey(initialOriginalApiKey);
25
+ await createAuditLog("API key updated", {
26
+ before: original,
27
+ after: apiKey
28
+ }, apiKey.id, this.context);
29
+ } catch (error) {
30
+ throw _webiny_error.from(error, {
31
+ message: "Error while executing AuditLogApiKeyAfterUpdateHandler",
32
+ code: "AUDIT_LOGS_AFTER_API_KEY_UPDATE_HANDLER"
33
+ });
34
+ }
35
+ }
36
+ }
37
+ const AuditLogApiKeyAfterUpdateHandler = ApiKeyAfterUpdateEventHandler.createImplementation({
38
+ implementation: AuditLogApiKeyAfterUpdateHandlerImpl,
39
+ dependencies: [
40
+ AuditLogsContext
41
+ ]
42
+ });
43
+ export { AuditLogApiKeyAfterUpdateHandler };
44
+
45
+ //# sourceMappingURL=AuditLogApiKeyAfterUpdateHandler.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"subscriptions/security/handlers/AuditLogApiKeyAfterUpdateHandler.js","sources":["../../../../src/subscriptions/security/handlers/AuditLogApiKeyAfterUpdateHandler.ts"],"sourcesContent":["import WebinyError from \"@webiny/error\";\nimport { ApiKeyAfterUpdateEventHandler } from \"@webiny/api-core/features/security/apiKeys/UpdateApiKey/index.js\";\nimport { AuditLogsContext } from \"~/abstractions.js\";\nimport { AUDIT } from \"~/config.js\";\nimport { getAuditConfig } from \"~/utils/getAuditConfig.js\";\nimport type { ApiKey } from \"@webiny/api-core/types/security.js\";\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 slug: apiKey.slug,\n createdBy: apiKey.createdBy,\n createdOn: apiKey.createdOn,\n description: apiKey.description,\n name: apiKey.name,\n permissions: apiKey.permissions\n };\n};\n\nclass AuditLogApiKeyAfterUpdateHandlerImpl implements ApiKeyAfterUpdateEventHandler.Interface {\n constructor(private context: AuditLogsContext.Interface) {}\n\n async handle(event: ApiKeyAfterUpdateEventHandler.Event): Promise<void> {\n try {\n const { updated: initialApiKey, original: initialOriginalApiKey } = event.payload;\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 this.context\n );\n } catch (error) {\n throw WebinyError.from(error, {\n message: \"Error while executing AuditLogApiKeyAfterUpdateHandler\",\n code: \"AUDIT_LOGS_AFTER_API_KEY_UPDATE_HANDLER\"\n });\n }\n }\n}\n\nexport const AuditLogApiKeyAfterUpdateHandler = ApiKeyAfterUpdateEventHandler.createImplementation({\n implementation: AuditLogApiKeyAfterUpdateHandlerImpl,\n dependencies: [AuditLogsContext]\n});\n"],"names":["cleanupApiKey","apiKey","AuditLogApiKeyAfterUpdateHandlerImpl","context","event","initialApiKey","initialOriginalApiKey","createAuditLog","getAuditConfig","AUDIT","original","error","WebinyError","AuditLogApiKeyAfterUpdateHandler","ApiKeyAfterUpdateEventHandler","AuditLogsContext"],"mappings":";;;;;AAYA,MAAMA,gBAAgB,CAACC,SACZ;QACH,IAAIA,OAAO,EAAE;QACb,MAAMA,OAAO,IAAI;QACjB,WAAWA,OAAO,SAAS;QAC3B,WAAWA,OAAO,SAAS;QAC3B,aAAaA,OAAO,WAAW;QAC/B,MAAMA,OAAO,IAAI;QACjB,aAAaA,OAAO,WAAW;IACnC;AAGJ,MAAMC;IACF,YAAoBC,OAAmC,CAAE;aAArCA,OAAO,GAAPA;IAAsC;IAE1D,MAAM,OAAOC,KAA0C,EAAiB;QACpE,IAAI;YACA,MAAM,EAAE,SAASC,aAAa,EAAE,UAAUC,qBAAqB,EAAE,GAAGF,MAAM,OAAO;YACjF,MAAMG,iBAAiBC,eAAeC,MAAM,QAAQ,CAAC,OAAO,CAAC,MAAM;YAEnE,MAAMR,SAASD,cAAcK;YAC7B,MAAMK,WAAWV,cAAcM;YAE/B,MAAMC,eACF,mBACA;gBACI,QAAQG;gBACR,OAAOT;YACX,GACAA,OAAO,EAAE,EACT,IAAI,CAAC,OAAO;QAEpB,EAAE,OAAOU,OAAO;YACZ,MAAMC,cAAAA,IAAgB,CAACD,OAAO;gBAC1B,SAAS;gBACT,MAAM;YACV;QACJ;IACJ;AACJ;AAEO,MAAME,mCAAmCC,8BAA8B,oBAAoB,CAAC;IAC/F,gBAAgBZ;IAChB,cAAc;QAACa;KAAiB;AACpC"}
@@ -0,0 +1,11 @@
1
+ import { AuditLogsContext } from "../../../abstractions.js";
2
+ import { RoleAfterCreateEventHandler } from "@webiny/api-core/features/security/roles/CreateRole/index.js";
3
+ declare class AuditLogRoleAfterCreateHandlerImpl implements RoleAfterCreateEventHandler.Interface {
4
+ private context;
5
+ constructor(context: AuditLogsContext.Interface);
6
+ handle(event: RoleAfterCreateEventHandler.Event): Promise<void>;
7
+ }
8
+ export declare const AuditLogRoleAfterCreateHandler: typeof AuditLogRoleAfterCreateHandlerImpl & {
9
+ __abstraction: import("@webiny/di").Abstraction<import("@webiny/api-core/features/eventPublisher").IEventHandler<import("@webiny/api-core/features/security/roles/CreateRole/events").RoleAfterCreateEvent>>;
10
+ };
11
+ export {};
@@ -0,0 +1,31 @@
1
+ import _webiny_error from "@webiny/error";
2
+ import { AuditLogsContext } from "../../../abstractions.js";
3
+ import { AUDIT } from "../../../config.js";
4
+ import { getAuditConfig } from "../../../utils/getAuditConfig.js";
5
+ import { RoleAfterCreateEventHandler } from "@webiny/api-core/features/security/roles/CreateRole/index.js";
6
+ class AuditLogRoleAfterCreateHandlerImpl {
7
+ constructor(context){
8
+ this.context = context;
9
+ }
10
+ async handle(event) {
11
+ try {
12
+ const { role } = event.payload;
13
+ const createAuditLog = getAuditConfig(AUDIT.SECURITY.ROLE.CREATE);
14
+ await createAuditLog("Role created", role, role.id, this.context);
15
+ } catch (error) {
16
+ throw _webiny_error.from(error, {
17
+ message: "Error while executing AuditLogRoleAfterCreateHandler",
18
+ code: "AUDIT_LOGS_AFTER_ROLE_CREATE_HANDLER"
19
+ });
20
+ }
21
+ }
22
+ }
23
+ const AuditLogRoleAfterCreateHandler = RoleAfterCreateEventHandler.createImplementation({
24
+ implementation: AuditLogRoleAfterCreateHandlerImpl,
25
+ dependencies: [
26
+ AuditLogsContext
27
+ ]
28
+ });
29
+ export { AuditLogRoleAfterCreateHandler };
30
+
31
+ //# sourceMappingURL=AuditLogRoleAfterCreateHandler.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"subscriptions/security/handlers/AuditLogRoleAfterCreateHandler.js","sources":["../../../../src/subscriptions/security/handlers/AuditLogRoleAfterCreateHandler.ts"],"sourcesContent":["import WebinyError from \"@webiny/error\";\nimport { AuditLogsContext } from \"~/abstractions.js\";\nimport { AUDIT } from \"~/config.js\";\nimport { getAuditConfig } from \"~/utils/getAuditConfig.js\";\nimport { RoleAfterCreateEventHandler } from \"@webiny/api-core/features/security/roles/CreateRole/index.js\";\n\nclass AuditLogRoleAfterCreateHandlerImpl implements RoleAfterCreateEventHandler.Interface {\n constructor(private context: AuditLogsContext.Interface) {}\n\n async handle(event: RoleAfterCreateEventHandler.Event): Promise<void> {\n try {\n const { role } = event.payload;\n const createAuditLog = getAuditConfig(AUDIT.SECURITY.ROLE.CREATE);\n\n await createAuditLog(\"Role created\", role, role.id, this.context);\n } catch (error) {\n throw WebinyError.from(error, {\n message: \"Error while executing AuditLogRoleAfterCreateHandler\",\n code: \"AUDIT_LOGS_AFTER_ROLE_CREATE_HANDLER\"\n });\n }\n }\n}\n\nexport const AuditLogRoleAfterCreateHandler = RoleAfterCreateEventHandler.createImplementation({\n implementation: AuditLogRoleAfterCreateHandlerImpl,\n dependencies: [AuditLogsContext]\n});\n"],"names":["AuditLogRoleAfterCreateHandlerImpl","context","event","role","createAuditLog","getAuditConfig","AUDIT","error","WebinyError","AuditLogRoleAfterCreateHandler","RoleAfterCreateEventHandler","AuditLogsContext"],"mappings":";;;;;AAMA,MAAMA;IACF,YAAoBC,OAAmC,CAAE;aAArCA,OAAO,GAAPA;IAAsC;IAE1D,MAAM,OAAOC,KAAwC,EAAiB;QAClE,IAAI;YACA,MAAM,EAAEC,IAAI,EAAE,GAAGD,MAAM,OAAO;YAC9B,MAAME,iBAAiBC,eAAeC,MAAM,QAAQ,CAAC,IAAI,CAAC,MAAM;YAEhE,MAAMF,eAAe,gBAAgBD,MAAMA,KAAK,EAAE,EAAE,IAAI,CAAC,OAAO;QACpE,EAAE,OAAOI,OAAO;YACZ,MAAMC,cAAAA,IAAgB,CAACD,OAAO;gBAC1B,SAAS;gBACT,MAAM;YACV;QACJ;IACJ;AACJ;AAEO,MAAME,iCAAiCC,4BAA4B,oBAAoB,CAAC;IAC3F,gBAAgBV;IAChB,cAAc;QAACW;KAAiB;AACpC"}
@@ -0,0 +1,11 @@
1
+ import { RoleAfterDeleteEventHandler } from "@webiny/api-core/features/security/roles/DeleteRole/index.js";
2
+ import { AuditLogsContext } from "../../../abstractions.js";
3
+ declare class AuditLogRoleAfterDeleteHandlerImpl implements RoleAfterDeleteEventHandler.Interface {
4
+ private context;
5
+ constructor(context: AuditLogsContext.Interface);
6
+ handle(event: RoleAfterDeleteEventHandler.Event): Promise<void>;
7
+ }
8
+ export declare const AuditLogRoleAfterDeleteHandler: typeof AuditLogRoleAfterDeleteHandlerImpl & {
9
+ __abstraction: import("@webiny/di").Abstraction<import("@webiny/api-core/features/eventPublisher").IEventHandler<import("@webiny/api-core/features/security/roles/DeleteRole/events").RoleAfterDeleteEvent>>;
10
+ };
11
+ export {};
@@ -0,0 +1,31 @@
1
+ import _webiny_error from "@webiny/error";
2
+ import { RoleAfterDeleteEventHandler } from "@webiny/api-core/features/security/roles/DeleteRole/index.js";
3
+ import { AuditLogsContext } from "../../../abstractions.js";
4
+ import { AUDIT } from "../../../config.js";
5
+ import { getAuditConfig } from "../../../utils/getAuditConfig.js";
6
+ class AuditLogRoleAfterDeleteHandlerImpl {
7
+ constructor(context){
8
+ this.context = context;
9
+ }
10
+ async handle(event) {
11
+ try {
12
+ const { role } = event.payload;
13
+ const createAuditLog = getAuditConfig(AUDIT.SECURITY.ROLE.DELETE);
14
+ await createAuditLog("Role deleted", role, role.id, this.context);
15
+ } catch (error) {
16
+ throw _webiny_error.from(error, {
17
+ message: "Error while executing AuditLogRoleAfterDeleteHandler",
18
+ code: "AUDIT_LOGS_AFTER_ROLE_DELETE_HANDLER"
19
+ });
20
+ }
21
+ }
22
+ }
23
+ const AuditLogRoleAfterDeleteHandler = RoleAfterDeleteEventHandler.createImplementation({
24
+ implementation: AuditLogRoleAfterDeleteHandlerImpl,
25
+ dependencies: [
26
+ AuditLogsContext
27
+ ]
28
+ });
29
+ export { AuditLogRoleAfterDeleteHandler };
30
+
31
+ //# sourceMappingURL=AuditLogRoleAfterDeleteHandler.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"subscriptions/security/handlers/AuditLogRoleAfterDeleteHandler.js","sources":["../../../../src/subscriptions/security/handlers/AuditLogRoleAfterDeleteHandler.ts"],"sourcesContent":["import WebinyError from \"@webiny/error\";\nimport { RoleAfterDeleteEventHandler } from \"@webiny/api-core/features/security/roles/DeleteRole/index.js\";\nimport { AuditLogsContext } from \"~/abstractions.js\";\nimport { AUDIT } from \"~/config.js\";\nimport { getAuditConfig } from \"~/utils/getAuditConfig.js\";\n\nclass AuditLogRoleAfterDeleteHandlerImpl implements RoleAfterDeleteEventHandler.Interface {\n constructor(private context: AuditLogsContext.Interface) {}\n\n async handle(event: RoleAfterDeleteEventHandler.Event): Promise<void> {\n try {\n const { role } = event.payload;\n const createAuditLog = getAuditConfig(AUDIT.SECURITY.ROLE.DELETE);\n\n await createAuditLog(\"Role deleted\", role, role.id, this.context);\n } catch (error) {\n throw WebinyError.from(error, {\n message: \"Error while executing AuditLogRoleAfterDeleteHandler\",\n code: \"AUDIT_LOGS_AFTER_ROLE_DELETE_HANDLER\"\n });\n }\n }\n}\n\nexport const AuditLogRoleAfterDeleteHandler = RoleAfterDeleteEventHandler.createImplementation({\n implementation: AuditLogRoleAfterDeleteHandlerImpl,\n dependencies: [AuditLogsContext]\n});\n"],"names":["AuditLogRoleAfterDeleteHandlerImpl","context","event","role","createAuditLog","getAuditConfig","AUDIT","error","WebinyError","AuditLogRoleAfterDeleteHandler","RoleAfterDeleteEventHandler","AuditLogsContext"],"mappings":";;;;;AAMA,MAAMA;IACF,YAAoBC,OAAmC,CAAE;aAArCA,OAAO,GAAPA;IAAsC;IAE1D,MAAM,OAAOC,KAAwC,EAAiB;QAClE,IAAI;YACA,MAAM,EAAEC,IAAI,EAAE,GAAGD,MAAM,OAAO;YAC9B,MAAME,iBAAiBC,eAAeC,MAAM,QAAQ,CAAC,IAAI,CAAC,MAAM;YAEhE,MAAMF,eAAe,gBAAgBD,MAAMA,KAAK,EAAE,EAAE,IAAI,CAAC,OAAO;QACpE,EAAE,OAAOI,OAAO;YACZ,MAAMC,cAAAA,IAAgB,CAACD,OAAO;gBAC1B,SAAS;gBACT,MAAM;YACV;QACJ;IACJ;AACJ;AAEO,MAAME,iCAAiCC,4BAA4B,oBAAoB,CAAC;IAC3F,gBAAgBV;IAChB,cAAc;QAACW;KAAiB;AACpC"}
@@ -0,0 +1,11 @@
1
+ import { RoleAfterUpdateEventHandler } from "@webiny/api-core/features/security/roles/UpdateRole/index.js";
2
+ import { AuditLogsContext } from "../../../abstractions.js";
3
+ declare class AuditLogRoleAfterUpdateHandlerImpl implements RoleAfterUpdateEventHandler.Interface {
4
+ private context;
5
+ constructor(context: AuditLogsContext.Interface);
6
+ handle(event: RoleAfterUpdateEventHandler.Event): Promise<void>;
7
+ }
8
+ export declare const AuditLogRoleAfterUpdateHandler: typeof AuditLogRoleAfterUpdateHandlerImpl & {
9
+ __abstraction: import("@webiny/di").Abstraction<import("@webiny/api-core/features/eventPublisher").IEventHandler<import("@webiny/api-core/features/security/roles/UpdateRole/events").RoleAfterUpdateEvent>>;
10
+ };
11
+ export {};
@@ -0,0 +1,34 @@
1
+ import _webiny_error from "@webiny/error";
2
+ import { RoleAfterUpdateEventHandler } from "@webiny/api-core/features/security/roles/UpdateRole/index.js";
3
+ import { AuditLogsContext } from "../../../abstractions.js";
4
+ import { AUDIT } from "../../../config.js";
5
+ import { getAuditConfig } from "../../../utils/getAuditConfig.js";
6
+ class AuditLogRoleAfterUpdateHandlerImpl {
7
+ constructor(context){
8
+ this.context = context;
9
+ }
10
+ async handle(event) {
11
+ try {
12
+ const { updated, original } = event.payload;
13
+ const createAuditLog = getAuditConfig(AUDIT.SECURITY.ROLE.UPDATE);
14
+ await createAuditLog("Role updated", {
15
+ before: original,
16
+ after: updated
17
+ }, updated.id, this.context);
18
+ } catch (error) {
19
+ throw _webiny_error.from(error, {
20
+ message: "Error while executing AuditLogRoleAfterUpdateHandler",
21
+ code: "AUDIT_LOGS_AFTER_ROLE_UPDATE_HANDLER"
22
+ });
23
+ }
24
+ }
25
+ }
26
+ const AuditLogRoleAfterUpdateHandler = RoleAfterUpdateEventHandler.createImplementation({
27
+ implementation: AuditLogRoleAfterUpdateHandlerImpl,
28
+ dependencies: [
29
+ AuditLogsContext
30
+ ]
31
+ });
32
+ export { AuditLogRoleAfterUpdateHandler };
33
+
34
+ //# sourceMappingURL=AuditLogRoleAfterUpdateHandler.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"subscriptions/security/handlers/AuditLogRoleAfterUpdateHandler.js","sources":["../../../../src/subscriptions/security/handlers/AuditLogRoleAfterUpdateHandler.ts"],"sourcesContent":["import WebinyError from \"@webiny/error\";\nimport { RoleAfterUpdateEventHandler } from \"@webiny/api-core/features/security/roles/UpdateRole/index.js\";\nimport { AuditLogsContext } from \"~/abstractions.js\";\nimport { AUDIT } from \"~/config.js\";\nimport { getAuditConfig } from \"~/utils/getAuditConfig.js\";\n\nclass AuditLogRoleAfterUpdateHandlerImpl implements RoleAfterUpdateEventHandler.Interface {\n constructor(private context: AuditLogsContext.Interface) {}\n\n async handle(event: RoleAfterUpdateEventHandler.Event): Promise<void> {\n try {\n const { updated, original } = event.payload;\n const createAuditLog = getAuditConfig(AUDIT.SECURITY.ROLE.UPDATE);\n\n await createAuditLog(\n \"Role updated\",\n { before: original, after: updated },\n updated.id,\n this.context\n );\n } catch (error) {\n throw WebinyError.from(error, {\n message: \"Error while executing AuditLogRoleAfterUpdateHandler\",\n code: \"AUDIT_LOGS_AFTER_ROLE_UPDATE_HANDLER\"\n });\n }\n }\n}\n\nexport const AuditLogRoleAfterUpdateHandler = RoleAfterUpdateEventHandler.createImplementation({\n implementation: AuditLogRoleAfterUpdateHandlerImpl,\n dependencies: [AuditLogsContext]\n});\n"],"names":["AuditLogRoleAfterUpdateHandlerImpl","context","event","updated","original","createAuditLog","getAuditConfig","AUDIT","error","WebinyError","AuditLogRoleAfterUpdateHandler","RoleAfterUpdateEventHandler","AuditLogsContext"],"mappings":";;;;;AAMA,MAAMA;IACF,YAAoBC,OAAmC,CAAE;aAArCA,OAAO,GAAPA;IAAsC;IAE1D,MAAM,OAAOC,KAAwC,EAAiB;QAClE,IAAI;YACA,MAAM,EAAEC,OAAO,EAAEC,QAAQ,EAAE,GAAGF,MAAM,OAAO;YAC3C,MAAMG,iBAAiBC,eAAeC,MAAM,QAAQ,CAAC,IAAI,CAAC,MAAM;YAEhE,MAAMF,eACF,gBACA;gBAAE,QAAQD;gBAAU,OAAOD;YAAQ,GACnCA,QAAQ,EAAE,EACV,IAAI,CAAC,OAAO;QAEpB,EAAE,OAAOK,OAAO;YACZ,MAAMC,cAAAA,IAAgB,CAACD,OAAO;gBAC1B,SAAS;gBACT,MAAM;YACV;QACJ;IACJ;AACJ;AAEO,MAAME,iCAAiCC,4BAA4B,oBAAoB,CAAC;IAC3F,gBAAgBX;IAChB,cAAc;QAACY;KAAiB;AACpC"}
@@ -0,0 +1,11 @@
1
+ import { TeamAfterCreateEventHandler } from "@webiny/api-core/features/security/teams/CreateTeam/index.js";
2
+ import { AuditLogsContext } from "../../../abstractions.js";
3
+ declare class AuditLogTeamAfterCreateHandlerImpl implements TeamAfterCreateEventHandler.Interface {
4
+ private context;
5
+ constructor(context: AuditLogsContext.Interface);
6
+ handle(event: TeamAfterCreateEventHandler.Event): Promise<void>;
7
+ }
8
+ export declare const AuditLogTeamAfterCreateHandler: typeof AuditLogTeamAfterCreateHandlerImpl & {
9
+ __abstraction: import("@webiny/di").Abstraction<import("@webiny/api-core/features/eventPublisher").IEventHandler<import("@webiny/api-core/features/security/teams/CreateTeam/events").TeamAfterCreateEvent>>;
10
+ };
11
+ export {};
@@ -0,0 +1,31 @@
1
+ import _webiny_error from "@webiny/error";
2
+ import { TeamAfterCreateEventHandler } from "@webiny/api-core/features/security/teams/CreateTeam/index.js";
3
+ import { AuditLogsContext } from "../../../abstractions.js";
4
+ import { AUDIT } from "../../../config.js";
5
+ import { getAuditConfig } from "../../../utils/getAuditConfig.js";
6
+ class AuditLogTeamAfterCreateHandlerImpl {
7
+ constructor(context){
8
+ this.context = context;
9
+ }
10
+ async handle(event) {
11
+ try {
12
+ const { team } = event.payload;
13
+ const createAuditLog = getAuditConfig(AUDIT.SECURITY.TEAM.CREATE);
14
+ await createAuditLog("Team created", team, team.id, this.context);
15
+ } catch (error) {
16
+ throw _webiny_error.from(error, {
17
+ message: "Error while executing AuditLogTeamAfterCreateHandler",
18
+ code: "AUDIT_LOGS_AFTER_TEAM_CREATE_HANDLER"
19
+ });
20
+ }
21
+ }
22
+ }
23
+ const AuditLogTeamAfterCreateHandler = TeamAfterCreateEventHandler.createImplementation({
24
+ implementation: AuditLogTeamAfterCreateHandlerImpl,
25
+ dependencies: [
26
+ AuditLogsContext
27
+ ]
28
+ });
29
+ export { AuditLogTeamAfterCreateHandler };
30
+
31
+ //# sourceMappingURL=AuditLogTeamAfterCreateHandler.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"subscriptions/security/handlers/AuditLogTeamAfterCreateHandler.js","sources":["../../../../src/subscriptions/security/handlers/AuditLogTeamAfterCreateHandler.ts"],"sourcesContent":["import WebinyError from \"@webiny/error\";\nimport { TeamAfterCreateEventHandler } from \"@webiny/api-core/features/security/teams/CreateTeam/index.js\";\nimport { AuditLogsContext } from \"~/abstractions.js\";\nimport { AUDIT } from \"~/config.js\";\nimport { getAuditConfig } from \"~/utils/getAuditConfig.js\";\n\nclass AuditLogTeamAfterCreateHandlerImpl implements TeamAfterCreateEventHandler.Interface {\n constructor(private context: AuditLogsContext.Interface) {}\n\n async handle(event: TeamAfterCreateEventHandler.Event): Promise<void> {\n try {\n const { team } = event.payload;\n const createAuditLog = getAuditConfig(AUDIT.SECURITY.TEAM.CREATE);\n\n await createAuditLog(\"Team created\", team, team.id, this.context);\n } catch (error) {\n throw WebinyError.from(error, {\n message: \"Error while executing AuditLogTeamAfterCreateHandler\",\n code: \"AUDIT_LOGS_AFTER_TEAM_CREATE_HANDLER\"\n });\n }\n }\n}\n\nexport const AuditLogTeamAfterCreateHandler = TeamAfterCreateEventHandler.createImplementation({\n implementation: AuditLogTeamAfterCreateHandlerImpl,\n dependencies: [AuditLogsContext]\n});\n"],"names":["AuditLogTeamAfterCreateHandlerImpl","context","event","team","createAuditLog","getAuditConfig","AUDIT","error","WebinyError","AuditLogTeamAfterCreateHandler","TeamAfterCreateEventHandler","AuditLogsContext"],"mappings":";;;;;AAMA,MAAMA;IACF,YAAoBC,OAAmC,CAAE;aAArCA,OAAO,GAAPA;IAAsC;IAE1D,MAAM,OAAOC,KAAwC,EAAiB;QAClE,IAAI;YACA,MAAM,EAAEC,IAAI,EAAE,GAAGD,MAAM,OAAO;YAC9B,MAAME,iBAAiBC,eAAeC,MAAM,QAAQ,CAAC,IAAI,CAAC,MAAM;YAEhE,MAAMF,eAAe,gBAAgBD,MAAMA,KAAK,EAAE,EAAE,IAAI,CAAC,OAAO;QACpE,EAAE,OAAOI,OAAO;YACZ,MAAMC,cAAAA,IAAgB,CAACD,OAAO;gBAC1B,SAAS;gBACT,MAAM;YACV;QACJ;IACJ;AACJ;AAEO,MAAME,iCAAiCC,4BAA4B,oBAAoB,CAAC;IAC3F,gBAAgBV;IAChB,cAAc;QAACW;KAAiB;AACpC"}
@@ -0,0 +1,11 @@
1
+ import { TeamAfterDeleteEventHandler } from "@webiny/api-core/features/security/teams/DeleteTeam/index.js";
2
+ import { AuditLogsContext } from "../../../abstractions.js";
3
+ declare class AuditLogTeamAfterDeleteHandlerImpl implements TeamAfterDeleteEventHandler.Interface {
4
+ private context;
5
+ constructor(context: AuditLogsContext.Interface);
6
+ handle(event: TeamAfterDeleteEventHandler.Event): Promise<void>;
7
+ }
8
+ export declare const AuditLogTeamAfterDeleteHandler: typeof AuditLogTeamAfterDeleteHandlerImpl & {
9
+ __abstraction: import("@webiny/di").Abstraction<import("@webiny/api-core/features/eventPublisher").IEventHandler<import("@webiny/api-core/features/security/teams/DeleteTeam/events").TeamAfterDeleteEvent>>;
10
+ };
11
+ export {};
@@ -0,0 +1,31 @@
1
+ import _webiny_error from "@webiny/error";
2
+ import { TeamAfterDeleteEventHandler } from "@webiny/api-core/features/security/teams/DeleteTeam/index.js";
3
+ import { AuditLogsContext } from "../../../abstractions.js";
4
+ import { AUDIT } from "../../../config.js";
5
+ import { getAuditConfig } from "../../../utils/getAuditConfig.js";
6
+ class AuditLogTeamAfterDeleteHandlerImpl {
7
+ constructor(context){
8
+ this.context = context;
9
+ }
10
+ async handle(event) {
11
+ try {
12
+ const { team } = event.payload;
13
+ const createAuditLog = getAuditConfig(AUDIT.SECURITY.TEAM.DELETE);
14
+ await createAuditLog("Team deleted", team, team.id, this.context);
15
+ } catch (error) {
16
+ throw _webiny_error.from(error, {
17
+ message: "Error while executing AuditLogTeamAfterDeleteHandler",
18
+ code: "AUDIT_LOGS_AFTER_TEAM_DELETE_HANDLER"
19
+ });
20
+ }
21
+ }
22
+ }
23
+ const AuditLogTeamAfterDeleteHandler = TeamAfterDeleteEventHandler.createImplementation({
24
+ implementation: AuditLogTeamAfterDeleteHandlerImpl,
25
+ dependencies: [
26
+ AuditLogsContext
27
+ ]
28
+ });
29
+ export { AuditLogTeamAfterDeleteHandler };
30
+
31
+ //# sourceMappingURL=AuditLogTeamAfterDeleteHandler.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"subscriptions/security/handlers/AuditLogTeamAfterDeleteHandler.js","sources":["../../../../src/subscriptions/security/handlers/AuditLogTeamAfterDeleteHandler.ts"],"sourcesContent":["import WebinyError from \"@webiny/error\";\nimport { TeamAfterDeleteEventHandler } from \"@webiny/api-core/features/security/teams/DeleteTeam/index.js\";\nimport { AuditLogsContext } from \"~/abstractions.js\";\nimport { AUDIT } from \"~/config.js\";\nimport { getAuditConfig } from \"~/utils/getAuditConfig.js\";\n\nclass AuditLogTeamAfterDeleteHandlerImpl implements TeamAfterDeleteEventHandler.Interface {\n constructor(private context: AuditLogsContext.Interface) {}\n\n async handle(event: TeamAfterDeleteEventHandler.Event): Promise<void> {\n try {\n const { team } = event.payload;\n const createAuditLog = getAuditConfig(AUDIT.SECURITY.TEAM.DELETE);\n\n await createAuditLog(\"Team deleted\", team, team.id, this.context);\n } catch (error) {\n throw WebinyError.from(error, {\n message: \"Error while executing AuditLogTeamAfterDeleteHandler\",\n code: \"AUDIT_LOGS_AFTER_TEAM_DELETE_HANDLER\"\n });\n }\n }\n}\n\nexport const AuditLogTeamAfterDeleteHandler = TeamAfterDeleteEventHandler.createImplementation({\n implementation: AuditLogTeamAfterDeleteHandlerImpl,\n dependencies: [AuditLogsContext]\n});\n"],"names":["AuditLogTeamAfterDeleteHandlerImpl","context","event","team","createAuditLog","getAuditConfig","AUDIT","error","WebinyError","AuditLogTeamAfterDeleteHandler","TeamAfterDeleteEventHandler","AuditLogsContext"],"mappings":";;;;;AAMA,MAAMA;IACF,YAAoBC,OAAmC,CAAE;aAArCA,OAAO,GAAPA;IAAsC;IAE1D,MAAM,OAAOC,KAAwC,EAAiB;QAClE,IAAI;YACA,MAAM,EAAEC,IAAI,EAAE,GAAGD,MAAM,OAAO;YAC9B,MAAME,iBAAiBC,eAAeC,MAAM,QAAQ,CAAC,IAAI,CAAC,MAAM;YAEhE,MAAMF,eAAe,gBAAgBD,MAAMA,KAAK,EAAE,EAAE,IAAI,CAAC,OAAO;QACpE,EAAE,OAAOI,OAAO;YACZ,MAAMC,cAAAA,IAAgB,CAACD,OAAO;gBAC1B,SAAS;gBACT,MAAM;YACV;QACJ;IACJ;AACJ;AAEO,MAAME,iCAAiCC,4BAA4B,oBAAoB,CAAC;IAC3F,gBAAgBV;IAChB,cAAc;QAACW;KAAiB;AACpC"}
@@ -0,0 +1,11 @@
1
+ import { TeamAfterUpdateEventHandler } from "@webiny/api-core/features/security/teams/UpdateTeam/index.js";
2
+ import { AuditLogsContext } from "../../../abstractions.js";
3
+ declare class AuditLogTeamAfterUpdateHandlerImpl implements TeamAfterUpdateEventHandler.Interface {
4
+ private context;
5
+ constructor(context: AuditLogsContext.Interface);
6
+ handle(event: TeamAfterUpdateEventHandler.Event): Promise<void>;
7
+ }
8
+ export declare const AuditLogTeamAfterUpdateHandler: typeof AuditLogTeamAfterUpdateHandlerImpl & {
9
+ __abstraction: import("@webiny/di").Abstraction<import("@webiny/api-core/features/eventPublisher").IEventHandler<import("@webiny/api-core/features/security/teams/UpdateTeam/events").TeamAfterUpdateEvent>>;
10
+ };
11
+ export {};
@@ -0,0 +1,34 @@
1
+ import _webiny_error from "@webiny/error";
2
+ import { TeamAfterUpdateEventHandler } from "@webiny/api-core/features/security/teams/UpdateTeam/index.js";
3
+ import { AuditLogsContext } from "../../../abstractions.js";
4
+ import { AUDIT } from "../../../config.js";
5
+ import { getAuditConfig } from "../../../utils/getAuditConfig.js";
6
+ class AuditLogTeamAfterUpdateHandlerImpl {
7
+ constructor(context){
8
+ this.context = context;
9
+ }
10
+ async handle(event) {
11
+ try {
12
+ const { updated, original } = event.payload;
13
+ const createAuditLog = getAuditConfig(AUDIT.SECURITY.TEAM.UPDATE);
14
+ await createAuditLog("Team updated", {
15
+ before: original,
16
+ after: updated
17
+ }, updated.id, this.context);
18
+ } catch (error) {
19
+ throw _webiny_error.from(error, {
20
+ message: "Error while executing AuditLogTeamAfterUpdateHandler",
21
+ code: "AUDIT_LOGS_AFTER_TEAM_UPDATE_HANDLER"
22
+ });
23
+ }
24
+ }
25
+ }
26
+ const AuditLogTeamAfterUpdateHandler = TeamAfterUpdateEventHandler.createImplementation({
27
+ implementation: AuditLogTeamAfterUpdateHandlerImpl,
28
+ dependencies: [
29
+ AuditLogsContext
30
+ ]
31
+ });
32
+ export { AuditLogTeamAfterUpdateHandler };
33
+
34
+ //# sourceMappingURL=AuditLogTeamAfterUpdateHandler.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"subscriptions/security/handlers/AuditLogTeamAfterUpdateHandler.js","sources":["../../../../src/subscriptions/security/handlers/AuditLogTeamAfterUpdateHandler.ts"],"sourcesContent":["import WebinyError from \"@webiny/error\";\nimport { TeamAfterUpdateEventHandler } from \"@webiny/api-core/features/security/teams/UpdateTeam/index.js\";\nimport { AuditLogsContext } from \"~/abstractions.js\";\nimport { AUDIT } from \"~/config.js\";\nimport { getAuditConfig } from \"~/utils/getAuditConfig.js\";\n\nclass AuditLogTeamAfterUpdateHandlerImpl implements TeamAfterUpdateEventHandler.Interface {\n constructor(private context: AuditLogsContext.Interface) {}\n\n async handle(event: TeamAfterUpdateEventHandler.Event): Promise<void> {\n try {\n const { updated, original } = event.payload;\n const createAuditLog = getAuditConfig(AUDIT.SECURITY.TEAM.UPDATE);\n\n await createAuditLog(\n \"Team updated\",\n { before: original, after: updated },\n updated.id,\n this.context\n );\n } catch (error) {\n throw WebinyError.from(error, {\n message: \"Error while executing AuditLogTeamAfterUpdateHandler\",\n code: \"AUDIT_LOGS_AFTER_TEAM_UPDATE_HANDLER\"\n });\n }\n }\n}\n\nexport const AuditLogTeamAfterUpdateHandler = TeamAfterUpdateEventHandler.createImplementation({\n implementation: AuditLogTeamAfterUpdateHandlerImpl,\n dependencies: [AuditLogsContext]\n});\n"],"names":["AuditLogTeamAfterUpdateHandlerImpl","context","event","updated","original","createAuditLog","getAuditConfig","AUDIT","error","WebinyError","AuditLogTeamAfterUpdateHandler","TeamAfterUpdateEventHandler","AuditLogsContext"],"mappings":";;;;;AAMA,MAAMA;IACF,YAAoBC,OAAmC,CAAE;aAArCA,OAAO,GAAPA;IAAsC;IAE1D,MAAM,OAAOC,KAAwC,EAAiB;QAClE,IAAI;YACA,MAAM,EAAEC,OAAO,EAAEC,QAAQ,EAAE,GAAGF,MAAM,OAAO;YAC3C,MAAMG,iBAAiBC,eAAeC,MAAM,QAAQ,CAAC,IAAI,CAAC,MAAM;YAEhE,MAAMF,eACF,gBACA;gBAAE,QAAQD;gBAAU,OAAOD;YAAQ,GACnCA,QAAQ,EAAE,EACV,IAAI,CAAC,OAAO;QAEpB,EAAE,OAAOK,OAAO;YACZ,MAAMC,cAAAA,IAAgB,CAACD,OAAO;gBAC1B,SAAS;gBACT,MAAM;YACV;QACJ;IACJ;AACJ;AAEO,MAAME,iCAAiCC,4BAA4B,oBAAoB,CAAC;IAC3F,gBAAgBX;IAChB,cAAc;QAACY;KAAiB;AACpC"}
@@ -0,0 +1,11 @@
1
+ import { UserAfterCreateEventHandler } from "@webiny/api-core/features/users/CreateUser/index.js";
2
+ import { AuditLogsContext } from "../../../abstractions.js";
3
+ declare class AuditLogUserAfterCreateHandlerImpl implements UserAfterCreateEventHandler.Interface {
4
+ private context;
5
+ constructor(context: AuditLogsContext.Interface);
6
+ handle(event: UserAfterCreateEventHandler.Event): Promise<void>;
7
+ }
8
+ export declare const AuditLogUserAfterCreateHandler: typeof AuditLogUserAfterCreateHandlerImpl & {
9
+ __abstraction: import("@webiny/di").Abstraction<import("@webiny/api-core/features/eventPublisher").IEventHandler<import("@webiny/api-core/features/users/CreateUser/events").UserAfterCreateEvent>>;
10
+ };
11
+ export {};
@@ -0,0 +1,31 @@
1
+ import _webiny_error from "@webiny/error";
2
+ import { UserAfterCreateEventHandler } from "@webiny/api-core/features/users/CreateUser/index.js";
3
+ import { AuditLogsContext } from "../../../abstractions.js";
4
+ import { AUDIT } from "../../../config.js";
5
+ import { getAuditConfig } from "../../../utils/getAuditConfig.js";
6
+ class AuditLogUserAfterCreateHandlerImpl {
7
+ constructor(context){
8
+ this.context = context;
9
+ }
10
+ async handle(event) {
11
+ try {
12
+ const { user } = event.payload;
13
+ const createAuditLog = getAuditConfig(AUDIT.SECURITY.USER.CREATE);
14
+ await createAuditLog("User created", user, user.id, this.context);
15
+ } catch (error) {
16
+ throw _webiny_error.from(error, {
17
+ message: "Error while executing AuditLogUserAfterCreateHandler",
18
+ code: "AUDIT_LOGS_AFTER_USER_CREATE_HANDLER"
19
+ });
20
+ }
21
+ }
22
+ }
23
+ const AuditLogUserAfterCreateHandler = UserAfterCreateEventHandler.createImplementation({
24
+ implementation: AuditLogUserAfterCreateHandlerImpl,
25
+ dependencies: [
26
+ AuditLogsContext
27
+ ]
28
+ });
29
+ export { AuditLogUserAfterCreateHandler };
30
+
31
+ //# sourceMappingURL=AuditLogUserAfterCreateHandler.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"subscriptions/security/handlers/AuditLogUserAfterCreateHandler.js","sources":["../../../../src/subscriptions/security/handlers/AuditLogUserAfterCreateHandler.ts"],"sourcesContent":["import WebinyError from \"@webiny/error\";\nimport { UserAfterCreateEventHandler } from \"@webiny/api-core/features/users/CreateUser/index.js\";\nimport { AuditLogsContext } from \"~/abstractions.js\";\nimport { AUDIT } from \"~/config.js\";\nimport { getAuditConfig } from \"~/utils/getAuditConfig.js\";\n\nclass AuditLogUserAfterCreateHandlerImpl implements UserAfterCreateEventHandler.Interface {\n constructor(private context: AuditLogsContext.Interface) {}\n\n async handle(event: UserAfterCreateEventHandler.Event): Promise<void> {\n try {\n const { user } = event.payload;\n const createAuditLog = getAuditConfig(AUDIT.SECURITY.USER.CREATE);\n\n await createAuditLog(\"User created\", user, user.id, this.context);\n } catch (error) {\n throw WebinyError.from(error, {\n message: \"Error while executing AuditLogUserAfterCreateHandler\",\n code: \"AUDIT_LOGS_AFTER_USER_CREATE_HANDLER\"\n });\n }\n }\n}\n\nexport const AuditLogUserAfterCreateHandler = UserAfterCreateEventHandler.createImplementation({\n implementation: AuditLogUserAfterCreateHandlerImpl,\n dependencies: [AuditLogsContext]\n});\n"],"names":["AuditLogUserAfterCreateHandlerImpl","context","event","user","createAuditLog","getAuditConfig","AUDIT","error","WebinyError","AuditLogUserAfterCreateHandler","UserAfterCreateEventHandler","AuditLogsContext"],"mappings":";;;;;AAMA,MAAMA;IACF,YAAoBC,OAAmC,CAAE;aAArCA,OAAO,GAAPA;IAAsC;IAE1D,MAAM,OAAOC,KAAwC,EAAiB;QAClE,IAAI;YACA,MAAM,EAAEC,IAAI,EAAE,GAAGD,MAAM,OAAO;YAC9B,MAAME,iBAAiBC,eAAeC,MAAM,QAAQ,CAAC,IAAI,CAAC,MAAM;YAEhE,MAAMF,eAAe,gBAAgBD,MAAMA,KAAK,EAAE,EAAE,IAAI,CAAC,OAAO;QACpE,EAAE,OAAOI,OAAO;YACZ,MAAMC,cAAAA,IAAgB,CAACD,OAAO;gBAC1B,SAAS;gBACT,MAAM;YACV;QACJ;IACJ;AACJ;AAEO,MAAME,iCAAiCC,4BAA4B,oBAAoB,CAAC;IAC3F,gBAAgBV;IAChB,cAAc;QAACW;KAAiB;AACpC"}
@@ -0,0 +1,11 @@
1
+ import { UserAfterDeleteEventHandler } from "@webiny/api-core/features/users/DeleteUser/index.js";
2
+ import { AuditLogsContext } from "../../../abstractions.js";
3
+ declare class AuditLogUserAfterDeleteHandlerImpl implements UserAfterDeleteEventHandler.Interface {
4
+ private context;
5
+ constructor(context: AuditLogsContext.Interface);
6
+ handle(event: UserAfterDeleteEventHandler.Event): Promise<void>;
7
+ }
8
+ export declare const AuditLogUserAfterDeleteHandler: typeof AuditLogUserAfterDeleteHandlerImpl & {
9
+ __abstraction: import("@webiny/di").Abstraction<import("@webiny/api-core/features/eventPublisher").IEventHandler<import("@webiny/api-core/features/users/DeleteUser/events").UserAfterDeleteEvent>>;
10
+ };
11
+ export {};
@@ -0,0 +1,31 @@
1
+ import _webiny_error from "@webiny/error";
2
+ import { UserAfterDeleteEventHandler } from "@webiny/api-core/features/users/DeleteUser/index.js";
3
+ import { AuditLogsContext } from "../../../abstractions.js";
4
+ import { AUDIT } from "../../../config.js";
5
+ import { getAuditConfig } from "../../../utils/getAuditConfig.js";
6
+ class AuditLogUserAfterDeleteHandlerImpl {
7
+ constructor(context){
8
+ this.context = context;
9
+ }
10
+ async handle(event) {
11
+ try {
12
+ const { user } = event.payload;
13
+ const createAuditLog = getAuditConfig(AUDIT.SECURITY.USER.DELETE);
14
+ await createAuditLog("User deleted", user, user.id, this.context);
15
+ } catch (error) {
16
+ throw _webiny_error.from(error, {
17
+ message: "Error while executing AuditLogUserAfterDeleteHandler",
18
+ code: "AUDIT_LOGS_AFTER_USER_DELETE_HANDLER"
19
+ });
20
+ }
21
+ }
22
+ }
23
+ const AuditLogUserAfterDeleteHandler = UserAfterDeleteEventHandler.createImplementation({
24
+ implementation: AuditLogUserAfterDeleteHandlerImpl,
25
+ dependencies: [
26
+ AuditLogsContext
27
+ ]
28
+ });
29
+ export { AuditLogUserAfterDeleteHandler };
30
+
31
+ //# sourceMappingURL=AuditLogUserAfterDeleteHandler.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"subscriptions/security/handlers/AuditLogUserAfterDeleteHandler.js","sources":["../../../../src/subscriptions/security/handlers/AuditLogUserAfterDeleteHandler.ts"],"sourcesContent":["import WebinyError from \"@webiny/error\";\nimport { UserAfterDeleteEventHandler } from \"@webiny/api-core/features/users/DeleteUser/index.js\";\nimport { AuditLogsContext } from \"~/abstractions.js\";\nimport { AUDIT } from \"~/config.js\";\nimport { getAuditConfig } from \"~/utils/getAuditConfig.js\";\n\nclass AuditLogUserAfterDeleteHandlerImpl implements UserAfterDeleteEventHandler.Interface {\n constructor(private context: AuditLogsContext.Interface) {}\n\n async handle(event: UserAfterDeleteEventHandler.Event): Promise<void> {\n try {\n const { user } = event.payload;\n const createAuditLog = getAuditConfig(AUDIT.SECURITY.USER.DELETE);\n\n await createAuditLog(\"User deleted\", user, user.id, this.context);\n } catch (error) {\n throw WebinyError.from(error, {\n message: \"Error while executing AuditLogUserAfterDeleteHandler\",\n code: \"AUDIT_LOGS_AFTER_USER_DELETE_HANDLER\"\n });\n }\n }\n}\n\nexport const AuditLogUserAfterDeleteHandler = UserAfterDeleteEventHandler.createImplementation({\n implementation: AuditLogUserAfterDeleteHandlerImpl,\n dependencies: [AuditLogsContext]\n});\n"],"names":["AuditLogUserAfterDeleteHandlerImpl","context","event","user","createAuditLog","getAuditConfig","AUDIT","error","WebinyError","AuditLogUserAfterDeleteHandler","UserAfterDeleteEventHandler","AuditLogsContext"],"mappings":";;;;;AAMA,MAAMA;IACF,YAAoBC,OAAmC,CAAE;aAArCA,OAAO,GAAPA;IAAsC;IAE1D,MAAM,OAAOC,KAAwC,EAAiB;QAClE,IAAI;YACA,MAAM,EAAEC,IAAI,EAAE,GAAGD,MAAM,OAAO;YAC9B,MAAME,iBAAiBC,eAAeC,MAAM,QAAQ,CAAC,IAAI,CAAC,MAAM;YAEhE,MAAMF,eAAe,gBAAgBD,MAAMA,KAAK,EAAE,EAAE,IAAI,CAAC,OAAO;QACpE,EAAE,OAAOI,OAAO;YACZ,MAAMC,cAAAA,IAAgB,CAACD,OAAO;gBAC1B,SAAS;gBACT,MAAM;YACV;QACJ;IACJ;AACJ;AAEO,MAAME,iCAAiCC,4BAA4B,oBAAoB,CAAC;IAC3F,gBAAgBV;IAChB,cAAc;QAACW;KAAiB;AACpC"}
@@ -0,0 +1,11 @@
1
+ import { UserAfterUpdateEventHandler } from "@webiny/api-core/features/users/UpdateUser/index.js";
2
+ import { AuditLogsContext } from "../../../abstractions.js";
3
+ declare class AuditLogUserAfterUpdateHandlerImpl implements UserAfterUpdateEventHandler.Interface {
4
+ private context;
5
+ constructor(context: AuditLogsContext.Interface);
6
+ handle(event: UserAfterUpdateEventHandler.Event): Promise<void>;
7
+ }
8
+ export declare const AuditLogUserAfterUpdateHandler: typeof AuditLogUserAfterUpdateHandlerImpl & {
9
+ __abstraction: import("@webiny/di").Abstraction<import("@webiny/api-core/features/eventPublisher").IEventHandler<import("@webiny/api-core/features/users/UpdateUser/events").UserAfterUpdateEvent>>;
10
+ };
11
+ export {};
@@ -0,0 +1,34 @@
1
+ import _webiny_error from "@webiny/error";
2
+ import { UserAfterUpdateEventHandler } from "@webiny/api-core/features/users/UpdateUser/index.js";
3
+ import { AuditLogsContext } from "../../../abstractions.js";
4
+ import { AUDIT } from "../../../config.js";
5
+ import { getAuditConfig } from "../../../utils/getAuditConfig.js";
6
+ class AuditLogUserAfterUpdateHandlerImpl {
7
+ constructor(context){
8
+ this.context = context;
9
+ }
10
+ async handle(event) {
11
+ try {
12
+ const { updatedUser, originalUser } = event.payload;
13
+ const createAuditLog = getAuditConfig(AUDIT.SECURITY.USER.UPDATE);
14
+ await createAuditLog("User updated", {
15
+ before: originalUser,
16
+ after: updatedUser
17
+ }, updatedUser.id, this.context);
18
+ } catch (error) {
19
+ throw _webiny_error.from(error, {
20
+ message: "Error while executing AuditLogUserAfterUpdateHandler",
21
+ code: "AUDIT_LOGS_AFTER_USER_UPDATE_HANDLER"
22
+ });
23
+ }
24
+ }
25
+ }
26
+ const AuditLogUserAfterUpdateHandler = UserAfterUpdateEventHandler.createImplementation({
27
+ implementation: AuditLogUserAfterUpdateHandlerImpl,
28
+ dependencies: [
29
+ AuditLogsContext
30
+ ]
31
+ });
32
+ export { AuditLogUserAfterUpdateHandler };
33
+
34
+ //# sourceMappingURL=AuditLogUserAfterUpdateHandler.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"subscriptions/security/handlers/AuditLogUserAfterUpdateHandler.js","sources":["../../../../src/subscriptions/security/handlers/AuditLogUserAfterUpdateHandler.ts"],"sourcesContent":["import WebinyError from \"@webiny/error\";\nimport { UserAfterUpdateEventHandler } from \"@webiny/api-core/features/users/UpdateUser/index.js\";\nimport { AuditLogsContext } from \"~/abstractions.js\";\nimport { AUDIT } from \"~/config.js\";\nimport { getAuditConfig } from \"~/utils/getAuditConfig.js\";\n\nclass AuditLogUserAfterUpdateHandlerImpl implements UserAfterUpdateEventHandler.Interface {\n constructor(private context: AuditLogsContext.Interface) {}\n\n async handle(event: UserAfterUpdateEventHandler.Event): Promise<void> {\n try {\n const { updatedUser, originalUser } = event.payload;\n const createAuditLog = getAuditConfig(AUDIT.SECURITY.USER.UPDATE);\n\n await createAuditLog(\n \"User updated\",\n { before: originalUser, after: updatedUser },\n updatedUser.id,\n this.context\n );\n } catch (error) {\n throw WebinyError.from(error, {\n message: \"Error while executing AuditLogUserAfterUpdateHandler\",\n code: \"AUDIT_LOGS_AFTER_USER_UPDATE_HANDLER\"\n });\n }\n }\n}\n\nexport const AuditLogUserAfterUpdateHandler = UserAfterUpdateEventHandler.createImplementation({\n implementation: AuditLogUserAfterUpdateHandlerImpl,\n dependencies: [AuditLogsContext]\n});\n"],"names":["AuditLogUserAfterUpdateHandlerImpl","context","event","updatedUser","originalUser","createAuditLog","getAuditConfig","AUDIT","error","WebinyError","AuditLogUserAfterUpdateHandler","UserAfterUpdateEventHandler","AuditLogsContext"],"mappings":";;;;;AAMA,MAAMA;IACF,YAAoBC,OAAmC,CAAE;aAArCA,OAAO,GAAPA;IAAsC;IAE1D,MAAM,OAAOC,KAAwC,EAAiB;QAClE,IAAI;YACA,MAAM,EAAEC,WAAW,EAAEC,YAAY,EAAE,GAAGF,MAAM,OAAO;YACnD,MAAMG,iBAAiBC,eAAeC,MAAM,QAAQ,CAAC,IAAI,CAAC,MAAM;YAEhE,MAAMF,eACF,gBACA;gBAAE,QAAQD;gBAAc,OAAOD;YAAY,GAC3CA,YAAY,EAAE,EACd,IAAI,CAAC,OAAO;QAEpB,EAAE,OAAOK,OAAO;YACZ,MAAMC,cAAAA,IAAgB,CAACD,OAAO;gBAC1B,SAAS;gBACT,MAAM;YACV;QACJ;IACJ;AACJ;AAEO,MAAME,iCAAiCC,4BAA4B,oBAAoB,CAAC;IAC3F,gBAAgBX;IAChB,cAAc;QAACY;KAAiB;AACpC"}
@@ -0,0 +1,7 @@
1
+ import type { ApiKey } from "@webiny/api-core/types/security.js";
2
+ /**
3
+ * We need to remove the token from the API Key object, as it is a security risk.
4
+ *
5
+ * 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.
6
+ */
7
+ export declare const cleanupApiKey: (apiKey: ApiKey) => Omit<ApiKey, "token">;