rl-core-api 0.1.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 (338) hide show
  1. package/README.md +99 -0
  2. package/dist/app.module.d.ts +2 -0
  3. package/dist/app.module.js +19 -0
  4. package/dist/core/auth/authenticatedUser.interface.d.ts +16 -0
  5. package/dist/core/auth/authenticatedUser.interface.js +2 -0
  6. package/dist/core/auth/cookie.util.d.ts +9 -0
  7. package/dist/core/auth/cookie.util.js +28 -0
  8. package/dist/core/auth/decorators/currentUser.decorator.d.ts +2 -0
  9. package/dist/core/auth/decorators/currentUser.decorator.js +9 -0
  10. package/dist/core/auth/decorators/public.decorator.d.ts +3 -0
  11. package/dist/core/auth/decorators/public.decorator.js +7 -0
  12. package/dist/core/auth/decorators/requirePermission.decorator.d.ts +5 -0
  13. package/dist/core/auth/decorators/requirePermission.decorator.js +10 -0
  14. package/dist/core/auth/guards/appThrottler.guard.d.ts +5 -0
  15. package/dist/core/auth/guards/appThrottler.guard.js +23 -0
  16. package/dist/core/auth/guards/csrf.guard.d.ts +8 -0
  17. package/dist/core/auth/guards/csrf.guard.js +55 -0
  18. package/dist/core/auth/guards/jwtAuth.guard.d.ts +10 -0
  19. package/dist/core/auth/guards/jwtAuth.guard.js +37 -0
  20. package/dist/core/auth/guards/permissions.guard.d.ts +7 -0
  21. package/dist/core/auth/guards/permissions.guard.js +42 -0
  22. package/dist/core/bootstrap/bootstrapCore.util.d.ts +9 -0
  23. package/dist/core/bootstrap/bootstrapCore.util.js +67 -0
  24. package/dist/core/config/config.module.d.ts +8 -0
  25. package/dist/core/config/config.module.js +34 -0
  26. package/dist/core/config/env.schema.d.ts +65 -0
  27. package/dist/core/config/env.schema.js +94 -0
  28. package/dist/core/config/env.service.d.ts +7 -0
  29. package/dist/core/config/env.service.js +27 -0
  30. package/dist/core/context/auditContext.d.ts +7 -0
  31. package/dist/core/context/auditContext.js +5 -0
  32. package/dist/core/core.module.d.ts +11 -0
  33. package/dist/core/core.module.js +73 -0
  34. package/dist/core/database/base.schema.d.ts +7 -0
  35. package/dist/core/database/base.schema.js +49 -0
  36. package/dist/core/database/createDataSource.util.d.ts +8 -0
  37. package/dist/core/database/createDataSource.util.js +27 -0
  38. package/dist/core/database/migrations/1710000000000-InitialSchema.d.ts +6 -0
  39. package/dist/core/database/migrations/1710000000000-InitialSchema.js +272 -0
  40. package/dist/core/database/migrations/1786060800000-FirstAccessTokenType.d.ts +6 -0
  41. package/dist/core/database/migrations/1786060800000-FirstAccessTokenType.js +19 -0
  42. package/dist/core/database/migrations/1786147200000-PermanentAccountLock.d.ts +6 -0
  43. package/dist/core/database/migrations/1786147200000-PermanentAccountLock.js +15 -0
  44. package/dist/core/database/migrations/1786233600000-Notifications.d.ts +6 -0
  45. package/dist/core/database/migrations/1786233600000-Notifications.js +59 -0
  46. package/dist/core/database/migrations/index.d.ts +3 -0
  47. package/dist/core/database/migrations/index.js +13 -0
  48. package/dist/core/database/seeds/runSeeds.d.ts +1 -0
  49. package/dist/core/database/seeds/runSeeds.js +20 -0
  50. package/dist/core/database/seeds/seedAdmin.d.ts +2 -0
  51. package/dist/core/database/seeds/seedAdmin.js +44 -0
  52. package/dist/core/database/seeds/seedPermissions.d.ts +2 -0
  53. package/dist/core/database/seeds/seedPermissions.js +93 -0
  54. package/dist/core/events/appEvent.enum.d.ts +31 -0
  55. package/dist/core/events/appEvent.enum.js +12 -0
  56. package/dist/core/filters/allExceptions.filter.d.ts +5 -0
  57. package/dist/core/filters/allExceptions.filter.js +61 -0
  58. package/dist/core/filters/appErrorCode.enum.d.ts +9 -0
  59. package/dist/core/filters/appErrorCode.enum.js +13 -0
  60. package/dist/core/health/health.controller.d.ts +11 -0
  61. package/dist/core/health/health.controller.js +56 -0
  62. package/dist/core/logger/winston.config.d.ts +2 -0
  63. package/dist/core/logger/winston.config.js +74 -0
  64. package/dist/core/mailer/mailer.module.d.ts +2 -0
  65. package/dist/core/mailer/mailer.module.js +21 -0
  66. package/dist/core/mailer/mailer.service.d.ts +14 -0
  67. package/dist/core/mailer/mailer.service.js +148 -0
  68. package/dist/core/openapi/exportOpenapi.d.ts +1 -0
  69. package/dist/core/openapi/exportOpenapi.js +25 -0
  70. package/dist/core/query/applyFilter.util.d.ts +11 -0
  71. package/dist/core/query/applyFilter.util.js +122 -0
  72. package/dist/core/query/filter.constants.d.ts +7 -0
  73. package/dist/core/query/filter.constants.js +64 -0
  74. package/dist/core/query/filterField.interface.d.ts +35 -0
  75. package/dist/core/query/filterField.interface.js +2 -0
  76. package/dist/core/query/filterFieldType.enum.d.ts +10 -0
  77. package/dist/core/query/filterFieldType.enum.js +14 -0
  78. package/dist/core/query/filterOperator.enum.d.ts +23 -0
  79. package/dist/core/query/filterOperator.enum.js +28 -0
  80. package/dist/core/query/filterSchema.response.d.ts +17 -0
  81. package/dist/core/query/filterSchema.response.js +82 -0
  82. package/dist/core/query/filterSort.util.d.ts +7 -0
  83. package/dist/core/query/filterSort.util.js +11 -0
  84. package/dist/core/query/paginateWithFilter.util.d.ts +11 -0
  85. package/dist/core/query/paginateWithFilter.util.js +37 -0
  86. package/dist/core/query/parseFilter.util.d.ts +2 -0
  87. package/dist/core/query/parseFilter.util.js +220 -0
  88. package/dist/core/utils/codedError.util.d.ts +5 -0
  89. package/dist/core/utils/codedError.util.js +23 -0
  90. package/dist/core/utils/crypto.util.d.ts +2 -0
  91. package/dist/core/utils/crypto.util.js +39 -0
  92. package/dist/core/utils/hash.util.d.ts +6 -0
  93. package/dist/core/utils/hash.util.js +67 -0
  94. package/dist/core/utils/ip.util.d.ts +1 -0
  95. package/dist/core/utils/ip.util.js +15 -0
  96. package/dist/core/utils/pagination.util.d.ts +21 -0
  97. package/dist/core/utils/pagination.util.js +98 -0
  98. package/dist/core/utils/paginationMeta.response.d.ts +7 -0
  99. package/dist/core/utils/paginationMeta.response.js +32 -0
  100. package/dist/core/utils/password.constants.d.ts +2 -0
  101. package/dist/core/utils/password.constants.js +5 -0
  102. package/dist/core/websocket/baseGateway.d.ts +21 -0
  103. package/dist/core/websocket/baseGateway.js +63 -0
  104. package/dist/core/websocket/socket.constants.d.ts +4 -0
  105. package/dist/core/websocket/socket.constants.js +9 -0
  106. package/dist/core/websocket/socketEvent.envelope.d.ts +8 -0
  107. package/dist/core/websocket/socketEvent.envelope.js +11 -0
  108. package/dist/core/websocket/socketOrigin.util.d.ts +2 -0
  109. package/dist/core/websocket/socketOrigin.util.js +15 -0
  110. package/dist/core/websocket/wsAuth.service.d.ts +20 -0
  111. package/dist/core/websocket/wsAuth.service.js +97 -0
  112. package/dist/core/websocket/wsUserResolver.interface.d.ts +5 -0
  113. package/dist/core/websocket/wsUserResolver.interface.js +4 -0
  114. package/dist/coreEntities.d.ts +12 -0
  115. package/dist/coreEntities.js +35 -0
  116. package/dist/dataSource.d.ts +3 -0
  117. package/dist/dataSource.js +13 -0
  118. package/dist/features/audit/audit.module.d.ts +2 -0
  119. package/dist/features/audit/audit.module.js +44 -0
  120. package/dist/features/audit/domain/audit.service.d.ts +34 -0
  121. package/dist/features/audit/domain/audit.service.js +93 -0
  122. package/dist/features/audit/domain/classifyError.util.d.ts +2 -0
  123. package/dist/features/audit/domain/classifyError.util.js +24 -0
  124. package/dist/features/audit/domain/index.d.ts +2 -0
  125. package/dist/features/audit/domain/index.js +18 -0
  126. package/dist/features/audit/infra/auditData.subscriber.d.ts +17 -0
  127. package/dist/features/audit/infra/auditData.subscriber.js +139 -0
  128. package/dist/features/audit/infra/index.d.ts +7 -0
  129. package/dist/features/audit/infra/index.js +23 -0
  130. package/dist/features/audit/infra/repositories/auditChange.repository.d.ts +7 -0
  131. package/dist/features/audit/infra/repositories/auditChange.repository.js +35 -0
  132. package/dist/features/audit/infra/repositories/auditDataChange.repository.d.ts +7 -0
  133. package/dist/features/audit/infra/repositories/auditDataChange.repository.js +35 -0
  134. package/dist/features/audit/infra/repositories/errorLog.repository.d.ts +7 -0
  135. package/dist/features/audit/infra/repositories/errorLog.repository.js +35 -0
  136. package/dist/features/audit/infra/schema/auditChange.schema.d.ts +14 -0
  137. package/dist/features/audit/infra/schema/auditChange.schema.js +68 -0
  138. package/dist/features/audit/infra/schema/auditDataChange.schema.d.ts +15 -0
  139. package/dist/features/audit/infra/schema/auditDataChange.schema.js +56 -0
  140. package/dist/features/audit/infra/schema/errorLog.schema.d.ts +21 -0
  141. package/dist/features/audit/infra/schema/errorLog.schema.js +69 -0
  142. package/dist/features/audit/presentation/audit.controller.d.ts +16 -0
  143. package/dist/features/audit/presentation/audit.controller.js +107 -0
  144. package/dist/features/audit/presentation/audit.interceptor.d.ts +8 -0
  145. package/dist/features/audit/presentation/audit.interceptor.js +78 -0
  146. package/dist/features/audit/presentation/filters/audit.filters.d.ts +4 -0
  147. package/dist/features/audit/presentation/filters/audit.filters.js +154 -0
  148. package/dist/features/audit/presentation/index.d.ts +2 -0
  149. package/dist/features/audit/presentation/index.js +18 -0
  150. package/dist/features/audit/presentation/responses/auditDataChange.response.d.ts +25 -0
  151. package/dist/features/audit/presentation/responses/auditDataChange.response.js +96 -0
  152. package/dist/features/audit/presentation/responses/log.response.d.ts +45 -0
  153. package/dist/features/audit/presentation/responses/log.response.js +164 -0
  154. package/dist/features/auth/auth.module.d.ts +2 -0
  155. package/dist/features/auth/auth.module.js +55 -0
  156. package/dist/features/auth/domain/auth.service.d.ts +66 -0
  157. package/dist/features/auth/domain/auth.service.js +289 -0
  158. package/dist/features/auth/domain/index.d.ts +5 -0
  159. package/dist/features/auth/domain/index.js +21 -0
  160. package/dist/features/auth/domain/jwtPayload.interface.d.ts +11 -0
  161. package/dist/features/auth/domain/jwtPayload.interface.js +2 -0
  162. package/dist/features/auth/domain/token.service.d.ts +56 -0
  163. package/dist/features/auth/domain/token.service.js +205 -0
  164. package/dist/features/auth/domain/twoFactor.service.d.ts +19 -0
  165. package/dist/features/auth/domain/twoFactor.service.js +103 -0
  166. package/dist/features/auth/domain/wsUserResolver.service.d.ts +10 -0
  167. package/dist/features/auth/domain/wsUserResolver.service.js +34 -0
  168. package/dist/features/auth/infra/index.d.ts +2 -0
  169. package/dist/features/auth/infra/index.js +18 -0
  170. package/dist/features/auth/infra/repositories/authToken.repository.d.ts +5 -0
  171. package/dist/features/auth/infra/repositories/authToken.repository.js +25 -0
  172. package/dist/features/auth/infra/schema/authToken.schema.d.ts +21 -0
  173. package/dist/features/auth/infra/schema/authToken.schema.js +73 -0
  174. package/dist/features/auth/presentation/auth.controller.d.ts +56 -0
  175. package/dist/features/auth/presentation/auth.controller.js +242 -0
  176. package/dist/features/auth/presentation/commands/clientType.enum.d.ts +4 -0
  177. package/dist/features/auth/presentation/commands/clientType.enum.js +8 -0
  178. package/dist/features/auth/presentation/commands/login.command.d.ts +4 -0
  179. package/dist/features/auth/presentation/commands/login.command.js +28 -0
  180. package/dist/features/auth/presentation/commands/password.command.d.ts +7 -0
  181. package/dist/features/auth/presentation/commands/password.command.js +37 -0
  182. package/dist/features/auth/presentation/commands/refreshToken.command.d.ts +3 -0
  183. package/dist/features/auth/presentation/commands/refreshToken.command.js +26 -0
  184. package/dist/features/auth/presentation/commands/twoFactor.command.d.ts +12 -0
  185. package/dist/features/auth/presentation/commands/twoFactor.command.js +68 -0
  186. package/dist/features/auth/presentation/index.d.ts +7 -0
  187. package/dist/features/auth/presentation/index.js +23 -0
  188. package/dist/features/auth/presentation/responses/sessionUser.response.d.ts +19 -0
  189. package/dist/features/auth/presentation/responses/sessionUser.response.js +90 -0
  190. package/dist/features/auth/presentation/strategies/jwt.strategy.d.ts +18 -0
  191. package/dist/features/auth/presentation/strategies/jwt.strategy.js +59 -0
  192. package/dist/features/auth/token.module.d.ts +2 -0
  193. package/dist/features/auth/token.module.js +23 -0
  194. package/dist/features/maintenance/domain/cleanup.service.d.ts +22 -0
  195. package/dist/features/maintenance/domain/cleanup.service.js +142 -0
  196. package/dist/features/maintenance/maintenance.module.d.ts +2 -0
  197. package/dist/features/maintenance/maintenance.module.js +24 -0
  198. package/dist/features/notifications/domain/enums/channelType.enum.d.ts +7 -0
  199. package/dist/features/notifications/domain/enums/channelType.enum.js +11 -0
  200. package/dist/features/notifications/domain/enums/deliveryStatus.enum.d.ts +8 -0
  201. package/dist/features/notifications/domain/enums/deliveryStatus.enum.js +12 -0
  202. package/dist/features/notifications/domain/enums/notificationType.enum.d.ts +6 -0
  203. package/dist/features/notifications/domain/enums/notificationType.enum.js +10 -0
  204. package/dist/features/notifications/domain/enums/scopeType.enum.d.ts +5 -0
  205. package/dist/features/notifications/domain/enums/scopeType.enum.js +9 -0
  206. package/dist/features/notifications/domain/notifications.service.d.ts +45 -0
  207. package/dist/features/notifications/domain/notifications.service.js +101 -0
  208. package/dist/features/notifications/infra/repositories/notification.repository.d.ts +14 -0
  209. package/dist/features/notifications/infra/repositories/notification.repository.js +74 -0
  210. package/dist/features/notifications/infra/repositories/notificationRead.repository.d.ts +6 -0
  211. package/dist/features/notifications/infra/repositories/notificationRead.repository.js +40 -0
  212. package/dist/features/notifications/infra/repositories/notificationScope.repository.d.ts +5 -0
  213. package/dist/features/notifications/infra/repositories/notificationScope.repository.js +25 -0
  214. package/dist/features/notifications/infra/schema/notification.schema.d.ts +13 -0
  215. package/dist/features/notifications/infra/schema/notification.schema.js +52 -0
  216. package/dist/features/notifications/infra/schema/notificationRead.schema.d.ts +7 -0
  217. package/dist/features/notifications/infra/schema/notificationRead.schema.js +38 -0
  218. package/dist/features/notifications/infra/schema/notificationScope.schema.d.ts +9 -0
  219. package/dist/features/notifications/infra/schema/notificationScope.schema.js +43 -0
  220. package/dist/features/notifications/notifications.module.d.ts +2 -0
  221. package/dist/features/notifications/notifications.module.js +45 -0
  222. package/dist/features/notifications/presentation/commands/createNotification.command.d.ts +13 -0
  223. package/dist/features/notifications/presentation/commands/createNotification.command.js +72 -0
  224. package/dist/features/notifications/presentation/domainEvents.listener.d.ts +13 -0
  225. package/dist/features/notifications/presentation/domainEvents.listener.js +121 -0
  226. package/dist/features/notifications/presentation/notifications.controller.d.ts +16 -0
  227. package/dist/features/notifications/presentation/notifications.controller.js +108 -0
  228. package/dist/features/notifications/presentation/notifications.gateway.d.ts +13 -0
  229. package/dist/features/notifications/presentation/notifications.gateway.js +58 -0
  230. package/dist/features/notifications/presentation/notifications.publisher.d.ts +9 -0
  231. package/dist/features/notifications/presentation/notifications.publisher.js +42 -0
  232. package/dist/features/notifications/presentation/responses/notification.response.d.ts +18 -0
  233. package/dist/features/notifications/presentation/responses/notification.response.js +72 -0
  234. package/dist/features/rbac/domain/index.d.ts +2 -0
  235. package/dist/features/rbac/domain/index.js +18 -0
  236. package/dist/features/rbac/domain/rbac.catalog.d.ts +21 -0
  237. package/dist/features/rbac/domain/rbac.catalog.js +153 -0
  238. package/dist/features/rbac/domain/rbac.service.d.ts +68 -0
  239. package/dist/features/rbac/domain/rbac.service.js +436 -0
  240. package/dist/features/rbac/infra/index.d.ts +12 -0
  241. package/dist/features/rbac/infra/index.js +28 -0
  242. package/dist/features/rbac/infra/repositories/action.repository.d.ts +5 -0
  243. package/dist/features/rbac/infra/repositories/action.repository.js +25 -0
  244. package/dist/features/rbac/infra/repositories/group.repository.d.ts +5 -0
  245. package/dist/features/rbac/infra/repositories/group.repository.js +25 -0
  246. package/dist/features/rbac/infra/repositories/permission.repository.d.ts +5 -0
  247. package/dist/features/rbac/infra/repositories/permission.repository.js +25 -0
  248. package/dist/features/rbac/infra/repositories/resource.repository.d.ts +5 -0
  249. package/dist/features/rbac/infra/repositories/resource.repository.js +25 -0
  250. package/dist/features/rbac/infra/repositories/role.repository.d.ts +5 -0
  251. package/dist/features/rbac/infra/repositories/role.repository.js +25 -0
  252. package/dist/features/rbac/infra/repositories/scope.repository.d.ts +5 -0
  253. package/dist/features/rbac/infra/repositories/scope.repository.js +25 -0
  254. package/dist/features/rbac/infra/schema/action.schema.d.ts +6 -0
  255. package/dist/features/rbac/infra/schema/action.schema.js +36 -0
  256. package/dist/features/rbac/infra/schema/group.schema.d.ts +12 -0
  257. package/dist/features/rbac/infra/schema/group.schema.js +60 -0
  258. package/dist/features/rbac/infra/schema/permission.schema.d.ts +15 -0
  259. package/dist/features/rbac/infra/schema/permission.schema.js +66 -0
  260. package/dist/features/rbac/infra/schema/resource.schema.d.ts +6 -0
  261. package/dist/features/rbac/infra/schema/resource.schema.js +36 -0
  262. package/dist/features/rbac/infra/schema/role.schema.d.ts +8 -0
  263. package/dist/features/rbac/infra/schema/role.schema.js +46 -0
  264. package/dist/features/rbac/infra/schema/scope.schema.d.ts +6 -0
  265. package/dist/features/rbac/infra/schema/scope.schema.js +36 -0
  266. package/dist/features/rbac/presentation/commands/createAction.command.d.ts +4 -0
  267. package/dist/features/rbac/presentation/commands/createAction.command.js +32 -0
  268. package/dist/features/rbac/presentation/commands/createGroup.command.d.ts +7 -0
  269. package/dist/features/rbac/presentation/commands/createGroup.command.js +54 -0
  270. package/dist/features/rbac/presentation/commands/createPermission.command.d.ts +4 -0
  271. package/dist/features/rbac/presentation/commands/createPermission.command.js +35 -0
  272. package/dist/features/rbac/presentation/commands/createResource.command.d.ts +4 -0
  273. package/dist/features/rbac/presentation/commands/createResource.command.js +32 -0
  274. package/dist/features/rbac/presentation/commands/createRole.command.d.ts +5 -0
  275. package/dist/features/rbac/presentation/commands/createRole.command.js +38 -0
  276. package/dist/features/rbac/presentation/commands/createScope.command.d.ts +4 -0
  277. package/dist/features/rbac/presentation/commands/createScope.command.js +32 -0
  278. package/dist/features/rbac/presentation/commands/updateAction.command.d.ts +6 -0
  279. package/dist/features/rbac/presentation/commands/updateAction.command.js +24 -0
  280. package/dist/features/rbac/presentation/commands/updateGroup.command.d.ts +6 -0
  281. package/dist/features/rbac/presentation/commands/updateGroup.command.js +24 -0
  282. package/dist/features/rbac/presentation/commands/updatePermission.command.d.ts +6 -0
  283. package/dist/features/rbac/presentation/commands/updatePermission.command.js +24 -0
  284. package/dist/features/rbac/presentation/commands/updateResource.command.d.ts +6 -0
  285. package/dist/features/rbac/presentation/commands/updateResource.command.js +24 -0
  286. package/dist/features/rbac/presentation/commands/updateRole.command.d.ts +6 -0
  287. package/dist/features/rbac/presentation/commands/updateRole.command.js +24 -0
  288. package/dist/features/rbac/presentation/commands/updateScope.command.d.ts +6 -0
  289. package/dist/features/rbac/presentation/commands/updateScope.command.js +24 -0
  290. package/dist/features/rbac/presentation/index.d.ts +13 -0
  291. package/dist/features/rbac/presentation/index.js +29 -0
  292. package/dist/features/rbac/presentation/rbac.controller.d.ts +54 -0
  293. package/dist/features/rbac/presentation/rbac.controller.js +413 -0
  294. package/dist/features/rbac/presentation/responses/rbac.response.d.ts +47 -0
  295. package/dist/features/rbac/presentation/responses/rbac.response.js +161 -0
  296. package/dist/features/rbac/rbac.module.d.ts +2 -0
  297. package/dist/features/rbac/rbac.module.js +55 -0
  298. package/dist/features/users/domain/avatar.service.d.ts +4 -0
  299. package/dist/features/users/domain/avatar.service.js +61 -0
  300. package/dist/features/users/domain/index.d.ts +2 -0
  301. package/dist/features/users/domain/index.js +18 -0
  302. package/dist/features/users/domain/users.service.d.ts +46 -0
  303. package/dist/features/users/domain/users.service.js +291 -0
  304. package/dist/features/users/infra/index.d.ts +4 -0
  305. package/dist/features/users/infra/index.js +20 -0
  306. package/dist/features/users/infra/repositories/passwordHistory.repository.d.ts +5 -0
  307. package/dist/features/users/infra/repositories/passwordHistory.repository.js +25 -0
  308. package/dist/features/users/infra/repositories/user.repository.d.ts +8 -0
  309. package/dist/features/users/infra/repositories/user.repository.js +56 -0
  310. package/dist/features/users/infra/schema/passwordHistory.schema.d.ts +5 -0
  311. package/dist/features/users/infra/schema/passwordHistory.schema.js +29 -0
  312. package/dist/features/users/infra/schema/user.schema.d.ts +28 -0
  313. package/dist/features/users/infra/schema/user.schema.js +153 -0
  314. package/dist/features/users/presentation/commands/changePassword.command.d.ts +4 -0
  315. package/dist/features/users/presentation/commands/changePassword.command.js +29 -0
  316. package/dist/features/users/presentation/commands/createUser.command.d.ts +8 -0
  317. package/dist/features/users/presentation/commands/createUser.command.js +56 -0
  318. package/dist/features/users/presentation/commands/updateProfile.command.d.ts +5 -0
  319. package/dist/features/users/presentation/commands/updateProfile.command.js +38 -0
  320. package/dist/features/users/presentation/commands/updateUser.command.d.ts +5 -0
  321. package/dist/features/users/presentation/commands/updateUser.command.js +8 -0
  322. package/dist/features/users/presentation/filters/users.filters.d.ts +3 -0
  323. package/dist/features/users/presentation/filters/users.filters.js +62 -0
  324. package/dist/features/users/presentation/index.d.ts +5 -0
  325. package/dist/features/users/presentation/index.js +21 -0
  326. package/dist/features/users/presentation/responses/user.response.d.ts +25 -0
  327. package/dist/features/users/presentation/responses/user.response.js +95 -0
  328. package/dist/features/users/presentation/users.controller.d.ts +30 -0
  329. package/dist/features/users/presentation/users.controller.js +247 -0
  330. package/dist/features/users/users.module.d.ts +2 -0
  331. package/dist/features/users/users.module.js +42 -0
  332. package/dist/index.d.ts +61 -0
  333. package/dist/index.js +149 -0
  334. package/dist/main.d.ts +1 -0
  335. package/dist/main.js +5 -0
  336. package/dist/rlCore.module.d.ts +10 -0
  337. package/dist/rlCore.module.js +42 -0
  338. package/package.json +139 -0
@@ -0,0 +1,107 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ var __metadata = (this && this.__metadata) || function (k, v) {
9
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
+ };
11
+ var __param = (this && this.__param) || function (paramIndex, decorator) {
12
+ return function (target, key) { decorator(target, key, paramIndex); }
13
+ };
14
+ Object.defineProperty(exports, "__esModule", { value: true });
15
+ exports.AuditController = void 0;
16
+ const common_1 = require("@nestjs/common");
17
+ const swagger_1 = require("@nestjs/swagger");
18
+ const requirePermission_decorator_1 = require("../../../core/auth/decorators/requirePermission.decorator");
19
+ const permissions_guard_1 = require("../../../core/auth/guards/permissions.guard");
20
+ const filterSchema_response_1 = require("../../../core/query/filterSchema.response");
21
+ const pagination_util_1 = require("../../../core/utils/pagination.util");
22
+ const audit_service_1 = require("../domain/audit.service");
23
+ const audit_filters_1 = require("./filters/audit.filters");
24
+ const auditDataChange_response_1 = require("./responses/auditDataChange.response");
25
+ const log_response_1 = require("./responses/log.response");
26
+ let AuditController = class AuditController {
27
+ constructor(audit) {
28
+ this.audit = audit;
29
+ }
30
+ changes(query) {
31
+ return this.audit.listChanges(query);
32
+ }
33
+ changesFilterSchema() {
34
+ return (0, filterSchema_response_1.toFilterSchema)(audit_filters_1.AUDIT_CHANGES_FILTER_CATALOG);
35
+ }
36
+ errors(query) {
37
+ return this.audit.listErrors(query);
38
+ }
39
+ errorsFilterSchema() {
40
+ return (0, filterSchema_response_1.toFilterSchema)(audit_filters_1.ERROR_LOGS_FILTER_CATALOG);
41
+ }
42
+ dataChanges(query) {
43
+ return this.audit.listDataChanges(query);
44
+ }
45
+ dataChangesFilterSchema() {
46
+ return (0, filterSchema_response_1.toFilterSchema)(audit_filters_1.AUDIT_DATA_CHANGES_FILTER_CATALOG);
47
+ }
48
+ };
49
+ exports.AuditController = AuditController;
50
+ __decorate([
51
+ (0, common_1.Get)("changes"),
52
+ (0, requirePermission_decorator_1.RequirePermission)("audit:read:any"),
53
+ (0, swagger_1.ApiOkResponse)({ type: log_response_1.PaginatedRequestLogsResponse }),
54
+ __param(0, (0, common_1.Query)()),
55
+ __metadata("design:type", Function),
56
+ __metadata("design:paramtypes", [pagination_util_1.PaginationQuery]),
57
+ __metadata("design:returntype", Promise)
58
+ ], AuditController.prototype, "changes", null);
59
+ __decorate([
60
+ (0, common_1.Get)("changes/filter-schema"),
61
+ (0, requirePermission_decorator_1.RequirePermission)("audit:read:any"),
62
+ (0, swagger_1.ApiOkResponse)({ type: filterSchema_response_1.FilterFieldResponse, isArray: true }),
63
+ __metadata("design:type", Function),
64
+ __metadata("design:paramtypes", []),
65
+ __metadata("design:returntype", Array)
66
+ ], AuditController.prototype, "changesFilterSchema", null);
67
+ __decorate([
68
+ (0, common_1.Get)("errors"),
69
+ (0, requirePermission_decorator_1.RequirePermission)("audit:read:any"),
70
+ (0, swagger_1.ApiOkResponse)({ type: log_response_1.PaginatedErrorLogsResponse }),
71
+ __param(0, (0, common_1.Query)()),
72
+ __metadata("design:type", Function),
73
+ __metadata("design:paramtypes", [pagination_util_1.PaginationQuery]),
74
+ __metadata("design:returntype", Promise)
75
+ ], AuditController.prototype, "errors", null);
76
+ __decorate([
77
+ (0, common_1.Get)("errors/filter-schema"),
78
+ (0, requirePermission_decorator_1.RequirePermission)("audit:read:any"),
79
+ (0, swagger_1.ApiOkResponse)({ type: filterSchema_response_1.FilterFieldResponse, isArray: true }),
80
+ __metadata("design:type", Function),
81
+ __metadata("design:paramtypes", []),
82
+ __metadata("design:returntype", Array)
83
+ ], AuditController.prototype, "errorsFilterSchema", null);
84
+ __decorate([
85
+ (0, common_1.Get)("data-changes"),
86
+ (0, requirePermission_decorator_1.RequirePermission)("audit:read-trail:any"),
87
+ (0, swagger_1.ApiOkResponse)({ type: auditDataChange_response_1.PaginatedAuditDataChangesResponse }),
88
+ __param(0, (0, common_1.Query)()),
89
+ __metadata("design:type", Function),
90
+ __metadata("design:paramtypes", [pagination_util_1.PaginationQuery]),
91
+ __metadata("design:returntype", Promise)
92
+ ], AuditController.prototype, "dataChanges", null);
93
+ __decorate([
94
+ (0, common_1.Get)("data-changes/filter-schema"),
95
+ (0, requirePermission_decorator_1.RequirePermission)("audit:read-trail:any"),
96
+ (0, swagger_1.ApiOkResponse)({ type: filterSchema_response_1.FilterFieldResponse, isArray: true }),
97
+ __metadata("design:type", Function),
98
+ __metadata("design:paramtypes", []),
99
+ __metadata("design:returntype", Array)
100
+ ], AuditController.prototype, "dataChangesFilterSchema", null);
101
+ exports.AuditController = AuditController = __decorate([
102
+ (0, swagger_1.ApiTags)("Audit"),
103
+ (0, swagger_1.ApiBearerAuth)(),
104
+ (0, common_1.UseGuards)(permissions_guard_1.PermissionsGuard),
105
+ (0, common_1.Controller)({ path: "audit", version: "1" }),
106
+ __metadata("design:paramtypes", [audit_service_1.AuditService])
107
+ ], AuditController);
@@ -0,0 +1,8 @@
1
+ import { CallHandler, ExecutionContext, NestInterceptor } from "@nestjs/common";
2
+ import { Observable } from "rxjs";
3
+ import { AuditService } from "../domain/audit.service";
4
+ export declare class AuditInterceptor implements NestInterceptor {
5
+ private readonly audit;
6
+ constructor(audit: AuditService);
7
+ intercept(context: ExecutionContext, next: CallHandler): Observable<unknown>;
8
+ }
@@ -0,0 +1,78 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ var __metadata = (this && this.__metadata) || function (k, v) {
9
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.AuditInterceptor = void 0;
13
+ const node_crypto_1 = require("node:crypto");
14
+ const common_1 = require("@nestjs/common");
15
+ const rxjs_1 = require("rxjs");
16
+ const auditContext_1 = require("../../../core/context/auditContext");
17
+ const ip_util_1 = require("../../../core/utils/ip.util");
18
+ const audit_service_1 = require("../domain/audit.service");
19
+ const classifyError_util_1 = require("../domain/classifyError.util");
20
+ const REQUEST_ID_HEADER = "x-request-id";
21
+ let AuditInterceptor = class AuditInterceptor {
22
+ constructor(audit) {
23
+ this.audit = audit;
24
+ }
25
+ intercept(context, next) {
26
+ const req = context.switchToHttp().getRequest();
27
+ const res = context.switchToHttp().getResponse();
28
+ const user = req.user;
29
+ const method = req.method;
30
+ const start = Date.now();
31
+ const ipAddress = (0, ip_util_1.normalizeIp)(req.ip);
32
+ const requestId = req.headers[REQUEST_ID_HEADER] || (0, node_crypto_1.randomUUID)();
33
+ res.setHeader("X-Request-Id", requestId);
34
+ req.requestId = requestId;
35
+ res.once("finish", () => {
36
+ void this.audit.recordChange({
37
+ userId: user?.id ?? null,
38
+ action: `${method} ${req.path}`,
39
+ method,
40
+ path: req.path,
41
+ ipAddress,
42
+ statusCode: res.statusCode,
43
+ durationMs: Date.now() - start,
44
+ requestId,
45
+ });
46
+ });
47
+ return new rxjs_1.Observable((subscriber) => {
48
+ auditContext_1.auditContext.run({ userId: user?.id ?? null, ipAddress, requestId }, () => {
49
+ next
50
+ .handle()
51
+ .pipe((0, rxjs_1.tap)({
52
+ error: (err) => {
53
+ const status = err?.status ?? 500;
54
+ if (status >= 400) {
55
+ void this.audit.recordError({
56
+ statusCode: status,
57
+ type: (0, classifyError_util_1.classifyError)(err, status),
58
+ message: err?.message ?? "Erro desconhecido",
59
+ stack: err?.stack ?? null,
60
+ method,
61
+ path: req.path,
62
+ userId: user?.id ?? null,
63
+ ipAddress,
64
+ requestId,
65
+ });
66
+ }
67
+ },
68
+ }))
69
+ .subscribe(subscriber);
70
+ });
71
+ });
72
+ }
73
+ };
74
+ exports.AuditInterceptor = AuditInterceptor;
75
+ exports.AuditInterceptor = AuditInterceptor = __decorate([
76
+ (0, common_1.Injectable)(),
77
+ __metadata("design:paramtypes", [audit_service_1.AuditService])
78
+ ], AuditInterceptor);
@@ -0,0 +1,4 @@
1
+ import { FilterCatalog } from "../../../../core/query/filterField.interface";
2
+ export declare const AUDIT_CHANGES_FILTER_CATALOG: FilterCatalog;
3
+ export declare const ERROR_LOGS_FILTER_CATALOG: FilterCatalog;
4
+ export declare const AUDIT_DATA_CHANGES_FILTER_CATALOG: FilterCatalog;
@@ -0,0 +1,154 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.AUDIT_DATA_CHANGES_FILTER_CATALOG = exports.ERROR_LOGS_FILTER_CATALOG = exports.AUDIT_CHANGES_FILTER_CATALOG = void 0;
4
+ const filterFieldType_enum_1 = require("../../../../core/query/filterFieldType.enum");
5
+ const auditDataChange_schema_1 = require("../../infra/schema/auditDataChange.schema");
6
+ const errorLog_schema_1 = require("../../infra/schema/errorLog.schema");
7
+ const TRACKED_ENTITIES = [
8
+ "User",
9
+ "Role",
10
+ "Permission",
11
+ "Group",
12
+ "Resource",
13
+ "Action",
14
+ "Scope",
15
+ ];
16
+ const optionsFromValues = (values) => values.map((value) => ({ value, label: value }));
17
+ exports.AUDIT_CHANGES_FILTER_CATALOG = [
18
+ {
19
+ field: "action",
20
+ column: "action",
21
+ label: "Ação",
22
+ type: filterFieldType_enum_1.FilterFieldType.Text,
23
+ sortable: true,
24
+ },
25
+ {
26
+ field: "method",
27
+ column: "method",
28
+ label: "Método",
29
+ type: filterFieldType_enum_1.FilterFieldType.Enum,
30
+ options: optionsFromValues([
31
+ "GET",
32
+ "POST",
33
+ "PATCH",
34
+ "PUT",
35
+ "DELETE",
36
+ ]),
37
+ sortable: true,
38
+ },
39
+ {
40
+ field: "path",
41
+ column: "path",
42
+ label: "Rota",
43
+ type: filterFieldType_enum_1.FilterFieldType.Text,
44
+ sortable: true,
45
+ },
46
+ {
47
+ field: "statusCode",
48
+ column: "statusCode",
49
+ label: "Status HTTP",
50
+ type: filterFieldType_enum_1.FilterFieldType.Number,
51
+ sortable: true,
52
+ filterable: false,
53
+ },
54
+ {
55
+ field: "durationMs",
56
+ column: "durationMs",
57
+ label: "Duração (ms)",
58
+ type: filterFieldType_enum_1.FilterFieldType.Number,
59
+ sortable: true,
60
+ filterable: false,
61
+ },
62
+ {
63
+ field: "userId",
64
+ column: "userId",
65
+ label: "Usuário",
66
+ type: filterFieldType_enum_1.FilterFieldType.Uuid,
67
+ },
68
+ ];
69
+ exports.ERROR_LOGS_FILTER_CATALOG = [
70
+ {
71
+ field: "type",
72
+ column: "type",
73
+ label: "Tipo",
74
+ type: filterFieldType_enum_1.FilterFieldType.Enum,
75
+ options: optionsFromValues(Object.values(errorLog_schema_1.ErrorType)),
76
+ sortable: true,
77
+ },
78
+ {
79
+ field: "statusCode",
80
+ column: "statusCode",
81
+ label: "Status HTTP",
82
+ type: filterFieldType_enum_1.FilterFieldType.Number,
83
+ sortable: true,
84
+ filterable: false,
85
+ },
86
+ {
87
+ field: "message",
88
+ column: "message",
89
+ label: "Mensagem",
90
+ type: filterFieldType_enum_1.FilterFieldType.Text,
91
+ },
92
+ {
93
+ field: "method",
94
+ column: "method",
95
+ label: "Método",
96
+ type: filterFieldType_enum_1.FilterFieldType.Enum,
97
+ options: optionsFromValues(["GET", "POST", "PATCH", "PUT", "DELETE"]),
98
+ },
99
+ {
100
+ field: "path",
101
+ column: "path",
102
+ label: "Rota",
103
+ type: filterFieldType_enum_1.FilterFieldType.Text,
104
+ },
105
+ {
106
+ field: "userId",
107
+ column: "userId",
108
+ label: "Usuário",
109
+ type: filterFieldType_enum_1.FilterFieldType.Uuid,
110
+ },
111
+ ];
112
+ exports.AUDIT_DATA_CHANGES_FILTER_CATALOG = [
113
+ {
114
+ field: "entity",
115
+ column: "entity",
116
+ label: "Entidade",
117
+ type: filterFieldType_enum_1.FilterFieldType.Enum,
118
+ options: optionsFromValues(TRACKED_ENTITIES),
119
+ sortable: true,
120
+ },
121
+ {
122
+ field: "entityId",
123
+ column: "entityId",
124
+ label: "ID da entidade",
125
+ type: filterFieldType_enum_1.FilterFieldType.Uuid,
126
+ },
127
+ {
128
+ field: "action",
129
+ column: "action",
130
+ label: "Ação",
131
+ type: filterFieldType_enum_1.FilterFieldType.Enum,
132
+ options: optionsFromValues(Object.values(auditDataChange_schema_1.AuditDataAction)),
133
+ sortable: true,
134
+ },
135
+ {
136
+ field: "userId",
137
+ column: "userId",
138
+ label: "Usuário",
139
+ type: filterFieldType_enum_1.FilterFieldType.Uuid,
140
+ },
141
+ {
142
+ field: "ipAddress",
143
+ column: "ipAddress",
144
+ label: "IP",
145
+ type: filterFieldType_enum_1.FilterFieldType.Text,
146
+ },
147
+ {
148
+ field: "createdAt",
149
+ column: "createdAt",
150
+ label: "Data",
151
+ type: filterFieldType_enum_1.FilterFieldType.DateTime,
152
+ sortable: true,
153
+ },
154
+ ];
@@ -0,0 +1,2 @@
1
+ export * from "./audit.controller";
2
+ export * from "./audit.interceptor";
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./audit.controller"), exports);
18
+ __exportStar(require("./audit.interceptor"), exports);
@@ -0,0 +1,25 @@
1
+ import { PaginationMetaResponse } from "../../../../core/utils/paginationMeta.response";
2
+ import { AuditDataAction } from "../../infra/schema/auditDataChange.schema";
3
+ export declare class AuditUserRefResponse {
4
+ id: string;
5
+ name: string;
6
+ email: string;
7
+ }
8
+ export declare class AuditDataChangeResponse {
9
+ id: string;
10
+ entity: string;
11
+ entityId?: string | null;
12
+ action: AuditDataAction;
13
+ oldData?: Record<string, unknown> | null;
14
+ newData?: Record<string, unknown> | null;
15
+ userId?: string | null;
16
+ user?: AuditUserRefResponse | null;
17
+ ipAddress?: string | null;
18
+ createdAt: Date;
19
+ updatedAt: Date;
20
+ deletedAt?: Date | null;
21
+ }
22
+ export declare class PaginatedAuditDataChangesResponse {
23
+ items: AuditDataChangeResponse[];
24
+ meta: PaginationMetaResponse;
25
+ }
@@ -0,0 +1,96 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ var __metadata = (this && this.__metadata) || function (k, v) {
9
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.PaginatedAuditDataChangesResponse = exports.AuditDataChangeResponse = exports.AuditUserRefResponse = void 0;
13
+ const swagger_1 = require("@nestjs/swagger");
14
+ const paginationMeta_response_1 = require("../../../../core/utils/paginationMeta.response");
15
+ const auditDataChange_schema_1 = require("../../infra/schema/auditDataChange.schema");
16
+ class AuditUserRefResponse {
17
+ }
18
+ exports.AuditUserRefResponse = AuditUserRefResponse;
19
+ __decorate([
20
+ (0, swagger_1.ApiProperty)({ format: "uuid" }),
21
+ __metadata("design:type", String)
22
+ ], AuditUserRefResponse.prototype, "id", void 0);
23
+ __decorate([
24
+ (0, swagger_1.ApiProperty)(),
25
+ __metadata("design:type", String)
26
+ ], AuditUserRefResponse.prototype, "name", void 0);
27
+ __decorate([
28
+ (0, swagger_1.ApiProperty)({ example: "admin@admin.com" }),
29
+ __metadata("design:type", String)
30
+ ], AuditUserRefResponse.prototype, "email", void 0);
31
+ class AuditDataChangeResponse {
32
+ }
33
+ exports.AuditDataChangeResponse = AuditDataChangeResponse;
34
+ __decorate([
35
+ (0, swagger_1.ApiProperty)({ format: "uuid" }),
36
+ __metadata("design:type", String)
37
+ ], AuditDataChangeResponse.prototype, "id", void 0);
38
+ __decorate([
39
+ (0, swagger_1.ApiProperty)({ example: "User" }),
40
+ __metadata("design:type", String)
41
+ ], AuditDataChangeResponse.prototype, "entity", void 0);
42
+ __decorate([
43
+ (0, swagger_1.ApiProperty)({ type: String, required: false, nullable: true }),
44
+ __metadata("design:type", Object)
45
+ ], AuditDataChangeResponse.prototype, "entityId", void 0);
46
+ __decorate([
47
+ (0, swagger_1.ApiProperty)({ enum: auditDataChange_schema_1.AuditDataAction, enumName: "AuditDataAction" }),
48
+ __metadata("design:type", String)
49
+ ], AuditDataChangeResponse.prototype, "action", void 0);
50
+ __decorate([
51
+ (0, swagger_1.ApiProperty)({ type: Object, required: false, nullable: true }),
52
+ __metadata("design:type", Object)
53
+ ], AuditDataChangeResponse.prototype, "oldData", void 0);
54
+ __decorate([
55
+ (0, swagger_1.ApiProperty)({ type: Object, required: false, nullable: true }),
56
+ __metadata("design:type", Object)
57
+ ], AuditDataChangeResponse.prototype, "newData", void 0);
58
+ __decorate([
59
+ (0, swagger_1.ApiProperty)({ type: String, required: false, nullable: true }),
60
+ __metadata("design:type", Object)
61
+ ], AuditDataChangeResponse.prototype, "userId", void 0);
62
+ __decorate([
63
+ (0, swagger_1.ApiProperty)({
64
+ type: AuditUserRefResponse,
65
+ required: false,
66
+ nullable: true,
67
+ }),
68
+ __metadata("design:type", Object)
69
+ ], AuditDataChangeResponse.prototype, "user", void 0);
70
+ __decorate([
71
+ (0, swagger_1.ApiProperty)({ type: String, required: false, nullable: true, example: "10.0.0.1" }),
72
+ __metadata("design:type", Object)
73
+ ], AuditDataChangeResponse.prototype, "ipAddress", void 0);
74
+ __decorate([
75
+ (0, swagger_1.ApiProperty)({ format: "date-time" }),
76
+ __metadata("design:type", Date)
77
+ ], AuditDataChangeResponse.prototype, "createdAt", void 0);
78
+ __decorate([
79
+ (0, swagger_1.ApiProperty)({ format: "date-time" }),
80
+ __metadata("design:type", Date)
81
+ ], AuditDataChangeResponse.prototype, "updatedAt", void 0);
82
+ __decorate([
83
+ (0, swagger_1.ApiProperty)({ type: String, format: "date-time", required: false, nullable: true }),
84
+ __metadata("design:type", Object)
85
+ ], AuditDataChangeResponse.prototype, "deletedAt", void 0);
86
+ class PaginatedAuditDataChangesResponse {
87
+ }
88
+ exports.PaginatedAuditDataChangesResponse = PaginatedAuditDataChangesResponse;
89
+ __decorate([
90
+ (0, swagger_1.ApiProperty)({ type: [AuditDataChangeResponse] }),
91
+ __metadata("design:type", Array)
92
+ ], PaginatedAuditDataChangesResponse.prototype, "items", void 0);
93
+ __decorate([
94
+ (0, swagger_1.ApiProperty)({ type: paginationMeta_response_1.PaginationMetaResponse }),
95
+ __metadata("design:type", paginationMeta_response_1.PaginationMetaResponse)
96
+ ], PaginatedAuditDataChangesResponse.prototype, "meta", void 0);
@@ -0,0 +1,45 @@
1
+ import { PaginationMetaResponse } from "../../../../core/utils/paginationMeta.response";
2
+ import { ErrorType } from "../../infra/schema/errorLog.schema";
3
+ import { AuditUserRefResponse } from "./auditDataChange.response";
4
+ export declare class RequestLogResponse {
5
+ id: string;
6
+ action: string;
7
+ entity?: string | null;
8
+ entityId?: string | null;
9
+ method?: string | null;
10
+ path?: string | null;
11
+ statusCode?: number | null;
12
+ durationMs?: number | null;
13
+ ipAddress?: string | null;
14
+ requestId?: string | null;
15
+ metadata?: Record<string, unknown> | null;
16
+ userId?: string | null;
17
+ user?: AuditUserRefResponse | null;
18
+ createdAt: Date;
19
+ updatedAt: Date;
20
+ deletedAt?: Date | null;
21
+ }
22
+ export declare class PaginatedRequestLogsResponse {
23
+ items: RequestLogResponse[];
24
+ meta: PaginationMetaResponse;
25
+ }
26
+ export declare class ErrorLogResponse {
27
+ id: string;
28
+ type: ErrorType;
29
+ statusCode?: number | null;
30
+ message: string;
31
+ stack?: string | null;
32
+ method?: string | null;
33
+ path?: string | null;
34
+ ipAddress?: string | null;
35
+ requestId?: string | null;
36
+ userId?: string | null;
37
+ user?: AuditUserRefResponse | null;
38
+ createdAt: Date;
39
+ updatedAt: Date;
40
+ deletedAt?: Date | null;
41
+ }
42
+ export declare class PaginatedErrorLogsResponse {
43
+ items: ErrorLogResponse[];
44
+ meta: PaginationMetaResponse;
45
+ }