itlab-internal-services 2.15.7 → 2.16.1

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 (371) hide show
  1. package/README.md +1 -187
  2. package/dist/classes/document-merger.class.js +2 -3
  3. package/dist/classes/index.d.ts +4 -1
  4. package/dist/classes/index.js +7 -3
  5. package/dist/classes/report-category.class.d.ts +55 -0
  6. package/dist/classes/report-category.class.js +120 -0
  7. package/dist/classes/schema-builder.class.d.ts +75 -0
  8. package/dist/classes/schema-builder.class.js +109 -0
  9. package/dist/classes/task-manager.class.d.ts +71 -0
  10. package/dist/classes/task-manager.class.js +99 -0
  11. package/dist/decorators/{account.decorator.d.ts → authenticated-account.decorator.d.ts} +4 -4
  12. package/dist/decorators/{account.decorator.js → authenticated-account.decorator.js} +8 -10
  13. package/dist/decorators/index.d.ts +1 -1
  14. package/dist/decorators/index.js +1 -1
  15. package/dist/exceptions/authenticated-user-required.exception.d.ts +34 -0
  16. package/dist/exceptions/authenticated-user-required.exception.js +51 -0
  17. package/dist/exceptions/bad-body.exception.d.ts +19 -8
  18. package/dist/exceptions/bad-body.exception.js +26 -10
  19. package/dist/exceptions/bad-parameter.exception.d.ts +23 -8
  20. package/dist/exceptions/bad-parameter.exception.js +41 -18
  21. package/dist/exceptions/duplicate.exception.d.ts +20 -8
  22. package/dist/exceptions/duplicate.exception.js +27 -10
  23. package/dist/exceptions/index.d.ts +1 -0
  24. package/dist/exceptions/index.js +1 -0
  25. package/dist/functions/add-views-likes-virtuals.function.d.ts +15 -0
  26. package/dist/functions/add-views-likes-virtuals.function.js +43 -0
  27. package/dist/functions/create-internal-axios-client.function.js +2 -2
  28. package/dist/functions/index.d.ts +1 -0
  29. package/dist/functions/index.js +3 -1
  30. package/dist/index.d.ts +5 -5
  31. package/dist/index.js +5 -5
  32. package/dist/interceptors/attribute-sanitizer.interceptor.d.ts +68 -0
  33. package/dist/interceptors/attribute-sanitizer.interceptor.js +154 -0
  34. package/dist/interceptors/index.d.ts +1 -0
  35. package/dist/interceptors/index.js +17 -0
  36. package/dist/middleware/http-logging.middleware.d.ts +19 -0
  37. package/dist/middleware/http-logging.middleware.js +50 -0
  38. package/dist/middleware/index.d.ts +1 -0
  39. package/dist/middleware/index.js +17 -0
  40. package/dist/models/account.model.d.ts +23 -0
  41. package/dist/models/account.model.js +59 -0
  42. package/dist/models/index.d.ts +3 -1
  43. package/dist/models/index.js +7 -3
  44. package/dist/{modules/search/models → models}/search-document.model.d.ts +1 -1
  45. package/dist/{modules/search/models → models}/search-document.model.js +1 -1
  46. package/dist/models/{account-entity.model.d.ts → user.model.d.ts} +8 -21
  47. package/dist/models/{account-entity.model.js → user.model.js} +11 -25
  48. package/dist/modules/authentication/authentication-module-options.interface.d.ts +2 -8
  49. package/dist/modules/authentication/authentication-options.parameter.d.ts +4 -0
  50. package/dist/modules/authentication/{inject-auth-options.decorator.js → authentication-options.parameter.js} +5 -2
  51. package/dist/modules/authentication/authentication.module.d.ts +23 -0
  52. package/dist/modules/authentication/authentication.module.js +24 -1
  53. package/dist/modules/authentication/guards/index.d.ts +2 -2
  54. package/dist/modules/authentication/guards/index.js +7 -7
  55. package/dist/modules/authentication/guards/jwt-auth.guard.d.ts +17 -0
  56. package/dist/modules/authentication/guards/jwt-auth.guard.js +67 -0
  57. package/dist/modules/authentication/guards/permissions.guard.d.ts +5 -27
  58. package/dist/modules/authentication/guards/permissions.guard.js +27 -59
  59. package/dist/modules/authentication/guards/public.guard.d.ts +7 -13
  60. package/dist/modules/authentication/guards/public.guard.js +10 -24
  61. package/dist/modules/authentication/guards/service-auth.guard.d.ts +22 -0
  62. package/dist/modules/authentication/guards/service-auth.guard.js +65 -0
  63. package/dist/modules/authentication/index.d.ts +3 -3
  64. package/dist/modules/authentication/index.js +3 -5
  65. package/dist/modules/cache/cache-response.interceptor.d.ts +2 -2
  66. package/dist/modules/cache/cache-response.interceptor.js +2 -2
  67. package/dist/modules/cache/index.d.ts +1 -0
  68. package/dist/modules/cache/index.js +1 -0
  69. package/dist/modules/comment/comment-module-options.interface.d.ts +38 -0
  70. package/dist/modules/comment/comment.controller.d.ts +24 -30
  71. package/dist/modules/comment/comment.controller.js +59 -61
  72. package/dist/modules/comment/comment.module-definition.d.ts +1 -42
  73. package/dist/modules/comment/comment.module-definition.js +1 -2
  74. package/dist/modules/comment/comment.module.d.ts +13 -13
  75. package/dist/modules/comment/comment.module.js +15 -42
  76. package/dist/modules/comment/comment.service.d.ts +27 -37
  77. package/dist/modules/comment/comment.service.js +50 -84
  78. package/dist/modules/comment/index.d.ts +2 -3
  79. package/dist/modules/comment/index.js +16 -7
  80. package/dist/modules/database/database.module.js +2 -5
  81. package/dist/modules/database/index.d.ts +2 -5
  82. package/dist/modules/database/index.js +17 -9
  83. package/dist/modules/index.d.ts +2 -6
  84. package/dist/modules/index.js +2 -6
  85. package/dist/modules/like/index.d.ts +2 -1
  86. package/dist/modules/like/index.js +16 -3
  87. package/dist/modules/like/like-module-options.interface.d.ts +21 -0
  88. package/dist/modules/like/like.controller.d.ts +45 -37
  89. package/dist/modules/like/like.controller.js +117 -102
  90. package/dist/modules/like/like.module-definition.d.ts +1 -17
  91. package/dist/modules/like/like.module-definition.js +1 -2
  92. package/dist/modules/like/like.module.d.ts +12 -12
  93. package/dist/modules/like/like.module.js +14 -37
  94. package/dist/modules/like/like.service.d.ts +31 -27
  95. package/dist/modules/like/like.service.js +42 -35
  96. package/dist/modules/merge/index.d.ts +3 -0
  97. package/dist/modules/merge/index.js +19 -0
  98. package/dist/modules/merge/merge-module-options.interface.d.ts +21 -0
  99. package/dist/modules/merge/merge.controller.d.ts +30 -0
  100. package/dist/modules/merge/merge.controller.js +76 -0
  101. package/dist/modules/merge/merge.module.d.ts +18 -0
  102. package/dist/modules/merge/merge.module.js +41 -0
  103. package/dist/modules/merge/merge.service.interface.d.ts +17 -0
  104. package/dist/modules/services/base-http.service.d.ts +83 -0
  105. package/dist/modules/services/base-http.service.js +124 -0
  106. package/dist/modules/services/base-urls.d.ts +22 -0
  107. package/dist/modules/services/base-urls.js +121 -0
  108. package/dist/modules/services/index.d.ts +4 -0
  109. package/dist/modules/services/index.js +20 -0
  110. package/dist/modules/services/providers/accounts.service.d.ts +52 -0
  111. package/dist/modules/services/providers/accounts.service.js +84 -0
  112. package/dist/modules/services/providers/books.service.d.ts +29 -0
  113. package/dist/modules/services/providers/books.service.js +55 -0
  114. package/dist/modules/services/providers/changelog.service.d.ts +18 -0
  115. package/dist/modules/services/providers/changelog.service.js +43 -0
  116. package/dist/modules/services/providers/comments/comments.service-definition.d.ts +1 -0
  117. package/dist/modules/services/providers/comments/comments.service-definition.js +4 -0
  118. package/dist/modules/services/providers/comments/comments.service.d.ts +60 -0
  119. package/dist/modules/services/providers/comments/comments.service.js +139 -0
  120. package/dist/modules/services/providers/comments/index.d.ts +1 -0
  121. package/dist/{factories → modules/services/providers/comments}/index.js +1 -1
  122. package/dist/modules/services/providers/content/content-return-types.d.ts +19 -0
  123. package/dist/modules/services/providers/content/content-return-types.js +7 -0
  124. package/dist/modules/services/providers/content/content.service-definition.d.ts +1 -0
  125. package/dist/modules/services/providers/content/content.service-definition.js +4 -0
  126. package/dist/modules/services/providers/content/content.service.d.ts +96 -0
  127. package/dist/modules/services/providers/content/content.service.js +231 -0
  128. package/dist/modules/services/providers/content/index.d.ts +2 -0
  129. package/dist/modules/{search/models → services/providers/content}/index.js +1 -1
  130. package/dist/modules/services/providers/demo-hive.service.d.ts +29 -0
  131. package/dist/modules/services/providers/demo-hive.service.js +55 -0
  132. package/dist/modules/services/providers/events.service.d.ts +29 -0
  133. package/dist/modules/services/providers/events.service.js +55 -0
  134. package/dist/modules/services/providers/hackschool.service.d.ts +49 -0
  135. package/dist/modules/services/providers/hackschool.service.js +79 -0
  136. package/dist/modules/services/providers/ideas.service.d.ts +18 -0
  137. package/dist/modules/services/providers/ideas.service.js +43 -0
  138. package/dist/modules/services/providers/index.d.ts +19 -0
  139. package/dist/modules/services/providers/index.js +35 -0
  140. package/dist/modules/services/providers/lunch-roulette.service.d.ts +18 -0
  141. package/dist/modules/services/providers/lunch-roulette.service.js +43 -0
  142. package/dist/modules/services/providers/mail/index.d.ts +3 -0
  143. package/dist/modules/services/providers/mail/index.js +19 -0
  144. package/dist/modules/services/providers/mail/mail-types.d.ts +30 -0
  145. package/dist/modules/services/providers/mail/mail-types.js +22 -0
  146. package/dist/modules/services/providers/mail/mail.service.d.ts +99 -0
  147. package/dist/modules/{mail → services/providers/mail}/mail.service.js +55 -92
  148. package/dist/modules/services/providers/newletter.service.d.ts +29 -0
  149. package/dist/modules/services/providers/newletter.service.js +55 -0
  150. package/dist/modules/services/providers/newsroom.service.d.ts +47 -0
  151. package/dist/modules/services/providers/newsroom.service.js +73 -0
  152. package/dist/modules/services/providers/notification/dtos/schedule-notification.dto.js +2 -0
  153. package/dist/modules/services/providers/notification/index.d.ts +2 -0
  154. package/dist/modules/services/providers/notification/index.js +18 -0
  155. package/dist/modules/services/providers/notification/notification.service-definition.d.ts +1 -0
  156. package/dist/modules/services/providers/notification/notification.service-definition.js +4 -0
  157. package/dist/modules/services/providers/notification/notification.service.d.ts +50 -0
  158. package/dist/modules/services/providers/notification/notification.service.js +130 -0
  159. package/dist/modules/services/providers/pass/dtos/create-guild-member-pass.dto.js +2 -0
  160. package/dist/modules/services/providers/pass/dtos/create-team-member-pass.dto.js +2 -0
  161. package/dist/modules/services/providers/pass/index.d.ts +2 -0
  162. package/dist/modules/services/providers/pass/index.js +18 -0
  163. package/dist/modules/services/providers/pass/pass-types.d.ts +18 -0
  164. package/dist/modules/services/providers/pass/pass-types.js +7 -0
  165. package/dist/modules/{pass → services/providers/pass}/pass.service.d.ts +15 -39
  166. package/dist/modules/{pass → services/providers/pass}/pass.service.js +46 -61
  167. package/dist/modules/services/providers/podcasts.service.d.ts +29 -0
  168. package/dist/modules/services/providers/podcasts.service.js +55 -0
  169. package/dist/modules/services/providers/search/dtos/index-search-document.dto.js +2 -0
  170. package/dist/modules/services/providers/search/index.d.ts +2 -0
  171. package/dist/modules/services/providers/search/index.js +18 -0
  172. package/dist/modules/services/providers/search/search.service-definition.d.ts +1 -0
  173. package/dist/modules/services/providers/search/search.service-definition.js +4 -0
  174. package/dist/modules/services/providers/search/search.service.d.ts +66 -0
  175. package/dist/modules/services/providers/search/search.service.js +171 -0
  176. package/dist/modules/services/providers/team.service.d.ts +29 -0
  177. package/dist/modules/services/providers/team.service.js +55 -0
  178. package/dist/modules/services/providers/tech-radar.service.d.ts +39 -0
  179. package/dist/modules/services/providers/tech-radar.service.js +67 -0
  180. package/dist/modules/services/services-module-options.interface.d.ts +4 -0
  181. package/dist/modules/services/services-module-options.interface.js +2 -0
  182. package/dist/modules/services/services-options.parameter.d.ts +1 -0
  183. package/dist/modules/services/services-options.parameter.js +8 -0
  184. package/dist/modules/services/services.module-definition.d.ts +16 -0
  185. package/dist/modules/services/services.module-definition.js +21 -0
  186. package/dist/modules/services/services.module.d.ts +17 -0
  187. package/dist/modules/services/services.module.js +63 -0
  188. package/dist/pipes/index.d.ts +2 -3
  189. package/dist/pipes/index.js +2 -3
  190. package/dist/pipes/params/hub-id.pipe.d.ts +22 -0
  191. package/dist/pipes/{hub-id.pipe.js → params/hub-id.pipe.js} +14 -17
  192. package/dist/pipes/params/hub-resource.pipe.d.ts +22 -0
  193. package/dist/pipes/{hub-resource.pipe.js → params/hub-resource.pipe.js} +19 -20
  194. package/dist/pipes/params/index.d.ts +3 -0
  195. package/dist/pipes/params/index.js +19 -0
  196. package/dist/pipes/params/mongo-id.pipe.d.ts +15 -0
  197. package/dist/pipes/params/mongo-id.pipe.js +52 -0
  198. package/dist/pipes/queries/index.d.ts +3 -0
  199. package/dist/pipes/queries/index.js +19 -0
  200. package/dist/pipes/queries/mongo-ids.pipe.d.ts +22 -0
  201. package/dist/pipes/queries/mongo-ids.pipe.js +60 -0
  202. package/dist/pipes/queries/optional-boolean.pipe.d.ts +29 -0
  203. package/dist/pipes/queries/optional-boolean.pipe.js +72 -0
  204. package/dist/pipes/queries/optional-include-drafts.pipe.d.ts +28 -0
  205. package/dist/pipes/queries/optional-include-drafts.pipe.js +38 -0
  206. package/dist/properties/content-return-type.property.d.ts +7 -0
  207. package/dist/properties/content-return-type.property.js +22 -0
  208. package/dist/properties/index.d.ts +4 -0
  209. package/dist/properties/index.js +11 -0
  210. package/dist/properties/likeable.properties.d.ts +1 -0
  211. package/dist/properties/likeable.properties.js +66 -0
  212. package/dist/properties/viewable.properties.d.ts +1 -0
  213. package/dist/properties/viewable.properties.js +66 -0
  214. package/dist/swagger/index.d.ts +1 -0
  215. package/dist/swagger/index.js +5 -0
  216. package/dist/swagger/remove-public-route-auth.plugin.d.ts +9 -0
  217. package/dist/swagger/remove-public-route-auth.plugin.js +25 -0
  218. package/dist/swagger/swagger-options.interface.d.ts +14 -0
  219. package/dist/swagger/swagger-options.interface.js +2 -0
  220. package/dist/swagger/swagger.function.d.ts +11 -0
  221. package/dist/swagger/swagger.function.js +47 -0
  222. package/dist/transform/boolean.transform.js +3 -3
  223. package/dist/types/index.d.ts +2 -0
  224. package/dist/types/index.js +18 -0
  225. package/dist/types/likeable.type.d.ts +15 -0
  226. package/dist/types/likeable.type.js +2 -0
  227. package/dist/types/viewable.type.d.ts +15 -0
  228. package/dist/types/viewable.type.js +2 -0
  229. package/package.json +2 -2
  230. package/dist/classes/document-updater.class.d.ts +0 -39
  231. package/dist/classes/document-updater.class.js +0 -57
  232. package/dist/factories/index.d.ts +0 -1
  233. package/dist/factories/virtuals.factory.d.ts +0 -79
  234. package/dist/factories/virtuals.factory.js +0 -171
  235. package/dist/http-logger.middleware.d.ts +0 -12
  236. package/dist/http-logger.middleware.js +0 -43
  237. package/dist/likeable.interface.d.ts +0 -41
  238. package/dist/likeable.interface.js +0 -48
  239. package/dist/modules/authentication/guards/auth.guard.d.ts +0 -36
  240. package/dist/modules/authentication/guards/auth.guard.js +0 -107
  241. package/dist/modules/authentication/guards/internal.guard.d.ts +0 -33
  242. package/dist/modules/authentication/guards/internal.guard.js +0 -72
  243. package/dist/modules/authentication/inject-auth-options.decorator.d.ts +0 -1
  244. package/dist/modules/comment/comment.model.d.ts +0 -29
  245. package/dist/modules/comment/comment.model.js +0 -43
  246. package/dist/modules/content/content.module-definition.d.ts +0 -5
  247. package/dist/modules/content/content.module-definition.js +0 -8
  248. package/dist/modules/content/content.module.d.ts +0 -31
  249. package/dist/modules/content/content.module.js +0 -60
  250. package/dist/modules/content/content.service.d.ts +0 -50
  251. package/dist/modules/content/content.service.js +0 -145
  252. package/dist/modules/content/index.d.ts +0 -3
  253. package/dist/modules/content/index.js +0 -9
  254. package/dist/modules/database/model-service/dbs/hub-account.db.d.ts +0 -28
  255. package/dist/modules/database/model-service/dbs/hub-account.db.js +0 -44
  256. package/dist/modules/database/model-service/dbs/hub-books.db.d.ts +0 -23
  257. package/dist/modules/database/model-service/dbs/hub-books.db.js +0 -45
  258. package/dist/modules/database/model-service/dbs/hub-comments.db.d.ts +0 -29
  259. package/dist/modules/database/model-service/dbs/hub-comments.db.js +0 -68
  260. package/dist/modules/database/model-service/dbs/hub-content.db.d.ts +0 -24
  261. package/dist/modules/database/model-service/dbs/hub-content.db.js +0 -49
  262. package/dist/modules/database/model-service/dbs/hub-demo-hive.db.d.ts +0 -23
  263. package/dist/modules/database/model-service/dbs/hub-demo-hive.db.js +0 -45
  264. package/dist/modules/database/model-service/dbs/hub-events.db.d.ts +0 -24
  265. package/dist/modules/database/model-service/dbs/hub-events.db.js +0 -49
  266. package/dist/modules/database/model-service/dbs/hub-hackschool.db.d.ts +0 -60
  267. package/dist/modules/database/model-service/dbs/hub-hackschool.db.js +0 -106
  268. package/dist/modules/database/model-service/dbs/hub-newsroom.db.d.ts +0 -25
  269. package/dist/modules/database/model-service/dbs/hub-newsroom.db.js +0 -53
  270. package/dist/modules/database/model-service/dbs/hub-podcasts.db.d.ts +0 -23
  271. package/dist/modules/database/model-service/dbs/hub-podcasts.db.js +0 -45
  272. package/dist/modules/database/model-service/dbs/hub-team.db.d.ts +0 -22
  273. package/dist/modules/database/model-service/dbs/hub-team.db.js +0 -41
  274. package/dist/modules/database/model-service/dbs/hub-tech-radar.db.d.ts +0 -42
  275. package/dist/modules/database/model-service/dbs/hub-tech-radar.db.js +0 -81
  276. package/dist/modules/database/model-service/model.service.d.ts +0 -6407
  277. package/dist/modules/database/model-service/model.service.js +0 -136
  278. package/dist/modules/database/populate-service/populate.service.d.ts +0 -73
  279. package/dist/modules/database/populate-service/populate.service.js +0 -163
  280. package/dist/modules/database/service-mapper-service/service-mapper.service.d.ts +0 -32
  281. package/dist/modules/database/service-mapper-service/service-mapper.service.js +0 -73
  282. package/dist/modules/fetch/fetch.module.d.ts +0 -31
  283. package/dist/modules/fetch/fetch.module.js +0 -60
  284. package/dist/modules/fetch/fetch.service.d.ts +0 -153
  285. package/dist/modules/fetch/fetch.service.js +0 -274
  286. package/dist/modules/fetch/index.d.ts +0 -2
  287. package/dist/modules/fetch/index.js +0 -7
  288. package/dist/modules/mail/index.d.ts +0 -4
  289. package/dist/modules/mail/index.js +0 -23
  290. package/dist/modules/mail/mail.module.d.ts +0 -31
  291. package/dist/modules/mail/mail.module.js +0 -60
  292. package/dist/modules/mail/mail.service.d.ts +0 -136
  293. package/dist/modules/notification/index.d.ts +0 -3
  294. package/dist/modules/notification/index.js +0 -22
  295. package/dist/modules/notification/notification.module-definition.d.ts +0 -5
  296. package/dist/modules/notification/notification.module-definition.js +0 -8
  297. package/dist/modules/notification/notification.module.d.ts +0 -34
  298. package/dist/modules/notification/notification.module.js +0 -63
  299. package/dist/modules/notification/notification.service.d.ts +0 -42
  300. package/dist/modules/notification/notification.service.js +0 -100
  301. package/dist/modules/pass/index.d.ts +0 -3
  302. package/dist/modules/pass/index.js +0 -22
  303. package/dist/modules/pass/pass.module.d.ts +0 -32
  304. package/dist/modules/pass/pass.module.js +0 -61
  305. package/dist/modules/search/index.d.ts +0 -4
  306. package/dist/modules/search/index.js +0 -23
  307. package/dist/modules/search/models/index.d.ts +0 -1
  308. package/dist/modules/search/search.module-definition.d.ts +0 -5
  309. package/dist/modules/search/search.module-definition.js +0 -8
  310. package/dist/modules/search/search.module.d.ts +0 -33
  311. package/dist/modules/search/search.module.js +0 -62
  312. package/dist/modules/search/search.service.d.ts +0 -49
  313. package/dist/modules/search/search.service.js +0 -120
  314. package/dist/pipes/hub-id.pipe.d.ts +0 -22
  315. package/dist/pipes/hub-resource.pipe.d.ts +0 -22
  316. package/dist/pipes/mongo-id.pipe.d.ts +0 -14
  317. package/dist/pipes/mongo-id.pipe.js +0 -52
  318. package/dist/swagger.config.d.ts +0 -36
  319. package/dist/swagger.config.js +0 -76
  320. package/dist/viewable.interface.d.ts +0 -41
  321. package/dist/viewable.interface.js +0 -48
  322. /package/dist/modules/{mail/dtos/auth-login-token-mail.dto.js → comment/comment-module-options.interface.js} +0 -0
  323. /package/dist/modules/{mail/dtos/auth-password-reset-mail.dto.js → like/like-module-options.interface.js} +0 -0
  324. /package/dist/modules/{mail/dtos/event-cancel-mail.dto.js → merge/merge-module-options.interface.js} +0 -0
  325. /package/dist/modules/{mail/dtos/event-invite-mail.dto.js → merge/merge.service.interface.js} +0 -0
  326. /package/dist/modules/{mail → services/providers/mail}/dtos/auth-login-token-mail.dto.d.ts +0 -0
  327. /package/dist/modules/{mail/dtos/idea-status-updated-mail.dto.js → services/providers/mail/dtos/auth-login-token-mail.dto.js} +0 -0
  328. /package/dist/modules/{mail → services/providers/mail}/dtos/auth-password-reset-mail.dto.d.ts +0 -0
  329. /package/dist/modules/{mail/dtos/idea-submitted-mail.dto.js → services/providers/mail/dtos/auth-password-reset-mail.dto.js} +0 -0
  330. /package/dist/modules/{mail → services/providers/mail}/dtos/event-cancel-mail.dto.d.ts +0 -0
  331. /package/dist/modules/{mail/dtos/lunch-roulette-cancel-mail.dto.js → services/providers/mail/dtos/event-cancel-mail.dto.js} +0 -0
  332. /package/dist/modules/{mail → services/providers/mail}/dtos/event-invite-mail.dto.d.ts +0 -0
  333. /package/dist/modules/{mail/dtos/lunch-roulette-matched-mail.dto.js → services/providers/mail/dtos/event-invite-mail.dto.js} +0 -0
  334. /package/dist/modules/{mail → services/providers/mail}/dtos/idea-status-updated-mail.dto.d.ts +0 -0
  335. /package/dist/modules/{mail/dtos/lunch-roulette-submitted-mail.dto.js → services/providers/mail/dtos/idea-status-updated-mail.dto.js} +0 -0
  336. /package/dist/modules/{mail → services/providers/mail}/dtos/idea-submitted-mail.dto.d.ts +0 -0
  337. /package/dist/modules/{mail/dtos/lunch-roulette-unmatched-mail.dto.js → services/providers/mail/dtos/idea-submitted-mail.dto.js} +0 -0
  338. /package/dist/modules/{mail → services/providers/mail}/dtos/index.d.ts +0 -0
  339. /package/dist/modules/{mail → services/providers/mail}/dtos/index.js +0 -0
  340. /package/dist/modules/{mail → services/providers/mail}/dtos/lunch-roulette-cancel-mail.dto.d.ts +0 -0
  341. /package/dist/modules/{mail/dtos/newsletter-issue-mail.dto.js → services/providers/mail/dtos/lunch-roulette-cancel-mail.dto.js} +0 -0
  342. /package/dist/modules/{mail → services/providers/mail}/dtos/lunch-roulette-matched-mail.dto.d.ts +0 -0
  343. /package/dist/modules/{mail/dtos/newsletter-subscribed-mail.dto.js → services/providers/mail/dtos/lunch-roulette-matched-mail.dto.js} +0 -0
  344. /package/dist/modules/{mail → services/providers/mail}/dtos/lunch-roulette-submitted-mail.dto.d.ts +0 -0
  345. /package/dist/modules/{mail/dtos/newsletter-unsubscribed-mail.dto.js → services/providers/mail/dtos/lunch-roulette-submitted-mail.dto.js} +0 -0
  346. /package/dist/modules/{mail → services/providers/mail}/dtos/lunch-roulette-unmatched-mail.dto.d.ts +0 -0
  347. /package/dist/modules/{mail/dtos/notification-mail.dto.js → services/providers/mail/dtos/lunch-roulette-unmatched-mail.dto.js} +0 -0
  348. /package/dist/modules/{mail → services/providers/mail}/dtos/newsletter-issue-mail.dto.d.ts +0 -0
  349. /package/dist/modules/{notification/dtos/schedule-notification.dto.js → services/providers/mail/dtos/newsletter-issue-mail.dto.js} +0 -0
  350. /package/dist/modules/{mail → services/providers/mail}/dtos/newsletter-subscribed-mail.dto.d.ts +0 -0
  351. /package/dist/modules/{pass/dtos/create-guild-member-pass.dto.js → services/providers/mail/dtos/newsletter-subscribed-mail.dto.js} +0 -0
  352. /package/dist/modules/{mail → services/providers/mail}/dtos/newsletter-unsubscribed-mail.dto.d.ts +0 -0
  353. /package/dist/modules/{pass/dtos/create-team-member-pass.dto.js → services/providers/mail/dtos/newsletter-unsubscribed-mail.dto.js} +0 -0
  354. /package/dist/modules/{mail → services/providers/mail}/dtos/notification-mail.dto.d.ts +0 -0
  355. /package/dist/modules/{search/dtos/index-search-document.dto.js → services/providers/mail/dtos/notification-mail.dto.js} +0 -0
  356. /package/dist/modules/{mail → services/providers/mail}/models/index.d.ts +0 -0
  357. /package/dist/modules/{mail → services/providers/mail}/models/index.js +0 -0
  358. /package/dist/modules/{mail → services/providers/mail}/models/mail-recipient.model.d.ts +0 -0
  359. /package/dist/modules/{mail → services/providers/mail}/models/mail-recipient.model.js +0 -0
  360. /package/dist/modules/{notification → services/providers/notification}/dtos/index.d.ts +0 -0
  361. /package/dist/modules/{notification → services/providers/notification}/dtos/index.js +0 -0
  362. /package/dist/modules/{notification → services/providers/notification}/dtos/schedule-notification.dto.d.ts +0 -0
  363. /package/dist/modules/{pass → services/providers/pass}/dtos/create-guild-member-pass.dto.d.ts +0 -0
  364. /package/dist/modules/{pass → services/providers/pass}/dtos/create-team-member-pass.dto.d.ts +0 -0
  365. /package/dist/modules/{pass → services/providers/pass}/dtos/index.d.ts +0 -0
  366. /package/dist/modules/{pass → services/providers/pass}/dtos/index.js +0 -0
  367. /package/dist/modules/{search → services/providers/search}/dtos/index-search-document.dto.d.ts +0 -0
  368. /package/dist/modules/{search → services/providers/search}/dtos/index.d.ts +0 -0
  369. /package/dist/modules/{search → services/providers/search}/dtos/index.js +0 -0
  370. /package/dist/{modules/content → properties}/content.property.d.ts +0 -0
  371. /package/dist/{modules/content → properties}/content.property.js +0 -0
@@ -0,0 +1,43 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.addViewsLikesVirtuals = addViewsLikesVirtuals;
4
+ const class_validator_1 = require("class-validator");
5
+ /**
6
+ * Enhances a Mongoose schema by adding virtual fields for computed values.
7
+ *
8
+ * This function inspects the schema's definition for special tracking arrays
9
+ * (such as `_viewedBy` or `_likedBy`). If those arrays exist, it adds
10
+ * corresponding virtual properties (`views` and `likes`) to the schema.
11
+ * These virtuals provide a clean way to access the number of views or likes
12
+ * without needing to calculate them manually each time.
13
+ *
14
+ * @template T - A type extending the Mongoose Document interface.
15
+ * @param {Schema<T>} schema - The Mongoose schema to augment with virtuals.
16
+ * @returns {void} - Modifies the schema in place; no return value.
17
+ */
18
+ function addViewsLikesVirtuals(schema) {
19
+ /**
20
+ * Add a `views` virtual property if the schema tracks viewers.
21
+ *
22
+ * The virtual computes the number of users who viewed the document
23
+ * by returning the length of the `_viewedBy` array.
24
+ */
25
+ if ('_viewedBy' in schema.obj) {
26
+ schema.virtual('views').get(function () {
27
+ // Ensure `_viewedBy` exists and is an array before counting
28
+ return '_viewedBy' in this && (0, class_validator_1.isArray)(this._viewedBy) ? this._viewedBy.length : 0;
29
+ });
30
+ }
31
+ /**
32
+ * Add a `likes` virtual property if the schema tracks likes.
33
+ *
34
+ * The virtual computes the number of users who liked the document
35
+ * by returning the length of the `_likedBy` array.
36
+ */
37
+ if ('_likedBy' in schema.obj) {
38
+ schema.virtual('likes').get(function () {
39
+ // Ensure `_likedBy` exists and is an array before counting
40
+ return '_likedBy' in this && (0, class_validator_1.isArray)(this._likedBy) ? this._likedBy.length : 0;
41
+ });
42
+ }
43
+ }
@@ -5,7 +5,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.createInternalAxiosClient = createInternalAxiosClient;
7
7
  const axios_1 = __importDefault(require("axios"));
8
- const internal_guard_1 = require("../modules/authentication/guards/internal.guard");
8
+ const service_auth_guard_1 = require("../modules/authentication/guards/service-auth.guard");
9
9
  /**
10
10
  * Creates a pre-configured Axios instance for internal service communication.
11
11
  *
@@ -24,7 +24,7 @@ function createInternalAxiosClient(options) {
24
24
  return axios_1.default.create({
25
25
  baseURL: baseUrl,
26
26
  headers: {
27
- [internal_guard_1.INTERNAL_HEADER_KEY]: k8sToken, // Inject internal authentication token
27
+ [service_auth_guard_1.SERVICE_AUTH_HEADER_KEY]: k8sToken, // Inject internal authentication token
28
28
  },
29
29
  });
30
30
  }
@@ -1,3 +1,4 @@
1
+ export { addViewsLikesVirtuals } from './add-views-likes-virtuals.function';
1
2
  export { createDuplicateChecker } from './create-duplicate-checker.function';
2
3
  export { createInternalAxiosClient } from './create-internal-axios-client.function';
3
4
  export { createSchemaTransformer } from './create-schema-transformer.function';
@@ -1,6 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.createSchemaTransformer = exports.createInternalAxiosClient = exports.createDuplicateChecker = void 0;
3
+ exports.createSchemaTransformer = exports.createInternalAxiosClient = exports.createDuplicateChecker = exports.addViewsLikesVirtuals = void 0;
4
+ var add_views_likes_virtuals_function_1 = require("./add-views-likes-virtuals.function");
5
+ Object.defineProperty(exports, "addViewsLikesVirtuals", { enumerable: true, get: function () { return add_views_likes_virtuals_function_1.addViewsLikesVirtuals; } });
4
6
  var create_duplicate_checker_function_1 = require("./create-duplicate-checker.function");
5
7
  Object.defineProperty(exports, "createDuplicateChecker", { enumerable: true, get: function () { return create_duplicate_checker_function_1.createDuplicateChecker; } });
6
8
  var create_internal_axios_client_function_1 = require("./create-internal-axios-client.function");
package/dist/index.d.ts CHANGED
@@ -2,14 +2,14 @@ export * from './classes';
2
2
  export * from './controllers';
3
3
  export * from './decorators';
4
4
  export * from './exceptions';
5
- export * from './factories';
6
5
  export * from './functions';
6
+ export * from './interceptors';
7
+ export * from './middleware';
7
8
  export * from './models';
8
9
  export * from './modules';
9
10
  export * from './pipes';
11
+ export * from './properties';
12
+ export * from './swagger';
10
13
  export * from './transform';
11
- export * from './http-logger.middleware';
14
+ export * from './types';
12
15
  export * from './hub-resource.enum';
13
- export * from './likeable.interface';
14
- export * from './swagger.config';
15
- export * from './viewable.interface';
package/dist/index.js CHANGED
@@ -18,14 +18,14 @@ __exportStar(require("./classes"), exports);
18
18
  __exportStar(require("./controllers"), exports);
19
19
  __exportStar(require("./decorators"), exports);
20
20
  __exportStar(require("./exceptions"), exports);
21
- __exportStar(require("./factories"), exports);
22
21
  __exportStar(require("./functions"), exports);
22
+ __exportStar(require("./interceptors"), exports);
23
+ __exportStar(require("./middleware"), exports);
23
24
  __exportStar(require("./models"), exports);
24
25
  __exportStar(require("./modules"), exports);
25
26
  __exportStar(require("./pipes"), exports);
27
+ __exportStar(require("./properties"), exports);
28
+ __exportStar(require("./swagger"), exports);
26
29
  __exportStar(require("./transform"), exports);
27
- __exportStar(require("./http-logger.middleware"), exports);
30
+ __exportStar(require("./types"), exports);
28
31
  __exportStar(require("./hub-resource.enum"), exports);
29
- __exportStar(require("./likeable.interface"), exports);
30
- __exportStar(require("./swagger.config"), exports);
31
- __exportStar(require("./viewable.interface"), exports);
@@ -0,0 +1,68 @@
1
+ import { CallHandler, ExecutionContext, NestInterceptor } from '@nestjs/common';
2
+ import { Observable } from 'rxjs';
3
+ /**
4
+ * AttributeSanitizerInterceptor
5
+ *
6
+ * This interceptor removes specified attributes from response objects.
7
+ * It works with plain objects, arrays, sets, maps and also with Mongoose
8
+ * documents by normalizing them to plain objects before sanitization.
9
+ *
10
+ * This is especially useful for removing sensitive fields (e.g., passwords,
11
+ * tokens, SSNs) consistently across deeply nested response structures.
12
+ */
13
+ export declare class AttributeSanitizerInterceptor implements NestInterceptor {
14
+ private readonly keys;
15
+ private readonly mongooseToObjectOptions;
16
+ /**
17
+ * @param keys - One or more property names to remove from every object.
18
+ * @param mongooseToObjectOptions - Options forwarded to Mongoose `.toObject()`
19
+ * when normalizing documents.
20
+ */
21
+ constructor(keys: string | string[], mongooseToObjectOptions?: Record<string, unknown>);
22
+ /**
23
+ * Intercepts the response and removes the targeted attributes.
24
+ *
25
+ * @param _context - Execution context (unused here).
26
+ * @param next - Next handler in the pipeline.
27
+ * @returns Sanitized response data.
28
+ */
29
+ intercept(_context: ExecutionContext, next: CallHandler): Observable<unknown>;
30
+ /**
31
+ * Recursively removes targeted keys from objects, arrays, and nested structures.
32
+ *
33
+ * @param value - Any response value.
34
+ * @returns A sanitized value without the targeted attributes.
35
+ */
36
+ private sanitizeRecursively;
37
+ /**
38
+ * Converts a Mongoose document to a plain object if needed.
39
+ *
40
+ * @param value - Possible Mongoose document.
41
+ * @returns A plain object if conversion is possible, otherwise the value itself.
42
+ */
43
+ private normalizeIfMongooseDocument;
44
+ /**
45
+ * Checks whether a value is a plain object (and not a class instance, Date, etc.).
46
+ *
47
+ * @param value - Any value.
48
+ * @returns True if the value is a plain object.
49
+ */
50
+ private isPlainObject;
51
+ /**
52
+ * Converts the user-provided keys into a Set for O(1) lookup.
53
+ *
54
+ * @param keys - String or array of strings.
55
+ * @returns A Set of keys.
56
+ */
57
+ private ensureKeySet;
58
+ }
59
+ /**
60
+ * @UseAttributeSanitizer
61
+ *
62
+ * Convenience decorator that applies the AttributeSanitizerInterceptor
63
+ * to a route or controller.
64
+ *
65
+ * @param keys - One or more keys to remove from all response objects.
66
+ * @param mongooseToObjectOptions - Options for Mongoose `.toObject()` normalization.
67
+ */
68
+ export declare function UseAttributeSanitizer(keys: string | string[], mongooseToObjectOptions?: Record<string, unknown>): MethodDecorator & ClassDecorator;
@@ -0,0 +1,154 @@
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.AttributeSanitizerInterceptor = void 0;
13
+ exports.UseAttributeSanitizer = UseAttributeSanitizer;
14
+ const common_1 = require("@nestjs/common");
15
+ const operators_1 = require("rxjs/operators");
16
+ /**
17
+ * AttributeSanitizerInterceptor
18
+ *
19
+ * This interceptor removes specified attributes from response objects.
20
+ * It works with plain objects, arrays, sets, maps and also with Mongoose
21
+ * documents by normalizing them to plain objects before sanitization.
22
+ *
23
+ * This is especially useful for removing sensitive fields (e.g., passwords,
24
+ * tokens, SSNs) consistently across deeply nested response structures.
25
+ */
26
+ let AttributeSanitizerInterceptor = class AttributeSanitizerInterceptor {
27
+ /**
28
+ * @param keys - One or more property names to remove from every object.
29
+ * @param mongooseToObjectOptions - Options forwarded to Mongoose `.toObject()`
30
+ * when normalizing documents.
31
+ */
32
+ constructor(keys, mongooseToObjectOptions = {
33
+ virtuals: true,
34
+ getters: true,
35
+ versionKey: false,
36
+ }) {
37
+ this.keys = keys;
38
+ this.mongooseToObjectOptions = mongooseToObjectOptions;
39
+ }
40
+ /**
41
+ * Intercepts the response and removes the targeted attributes.
42
+ *
43
+ * @param _context - Execution context (unused here).
44
+ * @param next - Next handler in the pipeline.
45
+ * @returns Sanitized response data.
46
+ */
47
+ intercept(_context, next) {
48
+ return next.handle().pipe((0, operators_1.map)((data) => this.sanitizeRecursively(data)));
49
+ }
50
+ /**
51
+ * Recursively removes targeted keys from objects, arrays, and nested structures.
52
+ *
53
+ * @param value - Any response value.
54
+ * @returns A sanitized value without the targeted attributes.
55
+ */
56
+ sanitizeRecursively(value) {
57
+ const normalized = this.normalizeIfMongooseDocument(value);
58
+ if (normalized === null || typeof normalized !== 'object') {
59
+ return normalized;
60
+ }
61
+ // Handle arrays
62
+ if (Array.isArray(normalized)) {
63
+ return normalized.map((item) => this.sanitizeRecursively(item));
64
+ }
65
+ // Handle Set → array
66
+ if (normalized instanceof Set) {
67
+ return Array.from(normalized).map((item) => this.sanitizeRecursively(item));
68
+ }
69
+ // Handle Map → plain object
70
+ if (normalized instanceof Map) {
71
+ const obj = {};
72
+ for (const [k, v] of normalized.entries()) {
73
+ obj[String(k)] = this.sanitizeRecursively(v);
74
+ }
75
+ return obj;
76
+ }
77
+ // Handle plain objects
78
+ if (this.isPlainObject(normalized)) {
79
+ const forbidden = this.ensureKeySet(this.keys);
80
+ const result = {};
81
+ for (const [prop, nested] of Object.entries(normalized)) {
82
+ if (forbidden.has(prop))
83
+ continue;
84
+ result[prop] = this.sanitizeRecursively(nested);
85
+ }
86
+ return result;
87
+ }
88
+ // Other complex types (Date, Buffer, etc.) → leave unchanged
89
+ return normalized;
90
+ }
91
+ /**
92
+ * Converts a Mongoose document to a plain object if needed.
93
+ *
94
+ * @param value - Possible Mongoose document.
95
+ * @returns A plain object if conversion is possible, otherwise the value itself.
96
+ */
97
+ normalizeIfMongooseDocument(value) {
98
+ // Heuristic: Mongoose documents expose `.toObject()` and an internal `$__`.
99
+ // We avoid importing `mongoose` to keep this interceptor framework-agnostic.
100
+ const maybeDoc = value;
101
+ if (maybeDoc &&
102
+ typeof maybeDoc === 'object' &&
103
+ (typeof maybeDoc.toObject === 'function' || typeof maybeDoc.toJSON === 'function') &&
104
+ '$__' in maybeDoc) {
105
+ try {
106
+ if (typeof maybeDoc.toObject === 'function')
107
+ return maybeDoc.toObject(this.mongooseToObjectOptions);
108
+ if (typeof maybeDoc.toJSON === 'function')
109
+ return maybeDoc.toJSON(this.mongooseToObjectOptions);
110
+ }
111
+ catch (_a) {
112
+ // If normalization fails, fall back to the original value—better to
113
+ // return data than to throw at the last step.
114
+ return value;
115
+ }
116
+ }
117
+ return value;
118
+ }
119
+ /**
120
+ * Checks whether a value is a plain object (and not a class instance, Date, etc.).
121
+ *
122
+ * @param value - Any value.
123
+ * @returns True if the value is a plain object.
124
+ */
125
+ isPlainObject(value) {
126
+ return Object.prototype.toString.call(value) === '[object Object]';
127
+ }
128
+ /**
129
+ * Converts the user-provided keys into a Set for O(1) lookup.
130
+ *
131
+ * @param keys - String or array of strings.
132
+ * @returns A Set of keys.
133
+ */
134
+ ensureKeySet(keys) {
135
+ return Array.isArray(keys) ? new Set(keys) : new Set([keys]);
136
+ }
137
+ };
138
+ exports.AttributeSanitizerInterceptor = AttributeSanitizerInterceptor;
139
+ exports.AttributeSanitizerInterceptor = AttributeSanitizerInterceptor = __decorate([
140
+ (0, common_1.Injectable)(),
141
+ __metadata("design:paramtypes", [Object, Object])
142
+ ], AttributeSanitizerInterceptor);
143
+ /**
144
+ * @UseAttributeSanitizer
145
+ *
146
+ * Convenience decorator that applies the AttributeSanitizerInterceptor
147
+ * to a route or controller.
148
+ *
149
+ * @param keys - One or more keys to remove from all response objects.
150
+ * @param mongooseToObjectOptions - Options for Mongoose `.toObject()` normalization.
151
+ */
152
+ function UseAttributeSanitizer(keys, mongooseToObjectOptions) {
153
+ return (0, common_1.UseInterceptors)(new AttributeSanitizerInterceptor(keys, mongooseToObjectOptions));
154
+ }
@@ -0,0 +1 @@
1
+ export * from './attribute-sanitizer.interceptor';
@@ -0,0 +1,17 @@
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("./attribute-sanitizer.interceptor"), exports);
@@ -0,0 +1,19 @@
1
+ import { NestMiddleware } from '@nestjs/common';
2
+ /**
3
+ * HttpLoggingMiddleware
4
+ *
5
+ * This middleware logs incoming HTTP requests and their corresponding responses
6
+ * for improved observability. It is primarily intended for non-internal routes,
7
+ * so it avoids noisy or repetitive logging of system, health check, API, or
8
+ * Swagger documentation endpoints.
9
+ *
10
+ * Logging includes:
11
+ * - HTTP method
12
+ * - Original request URL
13
+ * - Response status code and status message
14
+ *
15
+ * Errors in the 4xx range are logged at the "warn" level, while all other logs
16
+ * use the standard "log" level. This helps distinguish between client errors
17
+ * and normal traffic or server issues.
18
+ */
19
+ export declare const HttpLoggingMiddleware: NestMiddleware['use'];
@@ -0,0 +1,50 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.HttpLoggingMiddleware = void 0;
4
+ const common_1 = require("@nestjs/common");
5
+ const logger = new common_1.Logger('HTTP');
6
+ const excludedPaths = ['/alive', '/favicon.ico'];
7
+ /**
8
+ * HttpLoggingMiddleware
9
+ *
10
+ * This middleware logs incoming HTTP requests and their corresponding responses
11
+ * for improved observability. It is primarily intended for non-internal routes,
12
+ * so it avoids noisy or repetitive logging of system, health check, API, or
13
+ * Swagger documentation endpoints.
14
+ *
15
+ * Logging includes:
16
+ * - HTTP method
17
+ * - Original request URL
18
+ * - Response status code and status message
19
+ *
20
+ * Errors in the 4xx range are logged at the "warn" level, while all other logs
21
+ * use the standard "log" level. This helps distinguish between client errors
22
+ * and normal traffic or server issues.
23
+ */
24
+ const HttpLoggingMiddleware = (req, res, next) => {
25
+ const { method, url } = req;
26
+ // Define a small set of non-critical paths to exclude from logs
27
+ // Determine whether this request should be ignored for logging
28
+ const isSwagger = url.includes('swagger');
29
+ const isApiInternal = url.startsWith('/api');
30
+ const isExcluded = excludedPaths.includes(url);
31
+ if (isSwagger || isApiInternal || isExcluded) {
32
+ // Skip logging altogether for ignored paths to reduce clutter
33
+ next();
34
+ return;
35
+ }
36
+ // Defer logging until after the response has finished,
37
+ // ensuring accurate status information
38
+ res.on('finish', () => {
39
+ const { statusCode, statusMessage } = res;
40
+ // Construct a standardized log message
41
+ const logMessage = `${method} ${url} - ${statusCode} (${statusMessage})`;
42
+ // Client errors (4xx) are logged at warn level for visibility
43
+ // All other responses use standard log level
44
+ const logLevel = statusCode >= 400 && statusCode < 500 ? 'warn' : 'log';
45
+ logger[logLevel](logMessage);
46
+ });
47
+ // Continue to next middleware or request handler
48
+ next();
49
+ };
50
+ exports.HttpLoggingMiddleware = HttpLoggingMiddleware;
@@ -0,0 +1 @@
1
+ export * from './http-logging.middleware';
@@ -0,0 +1,17 @@
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("./http-logging.middleware"), exports);
@@ -0,0 +1,23 @@
1
+ import { User } from './user.model';
2
+ /**
3
+ * Represents the identity and authorization details of a user account.
4
+ *
5
+ * This class is used in API responses to expose user metadata, including core profile
6
+ * information (email, username, avatar) and permission scopes granted to the user.
7
+ */
8
+ export declare class Account extends User {
9
+ /**
10
+ * List of permission keys assigned to this user.
11
+ * These are used to control access to features via role-based access control.
12
+ *
13
+ * @example ["news.publish", "dashboard.view"]
14
+ */
15
+ perms: string[];
16
+ password: boolean;
17
+ disabledNotificationTypes: string[];
18
+ createdAt: string;
19
+ updatedAt: string;
20
+ signedUpAt?: string;
21
+ signedInAt?: string;
22
+ lastSeenAt?: string;
23
+ }
@@ -0,0 +1,59 @@
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.Account = void 0;
13
+ const swagger_1 = require("@nestjs/swagger");
14
+ const user_model_1 = require("./user.model");
15
+ /**
16
+ * Represents the identity and authorization details of a user account.
17
+ *
18
+ * This class is used in API responses to expose user metadata, including core profile
19
+ * information (email, username, avatar) and permission scopes granted to the user.
20
+ */
21
+ class Account extends user_model_1.User {
22
+ }
23
+ exports.Account = Account;
24
+ __decorate([
25
+ (0, swagger_1.ApiProperty)({
26
+ description: 'Permission strings assigned to the account',
27
+ example: ['news.publish', 'dashboard.view'],
28
+ type: [String],
29
+ }),
30
+ __metadata("design:type", Array)
31
+ ], Account.prototype, "perms", void 0);
32
+ __decorate([
33
+ (0, swagger_1.ApiProperty)({ description: 'Can the account sign in to the cms portal', example: false, type: Boolean }),
34
+ __metadata("design:type", Boolean)
35
+ ], Account.prototype, "password", void 0);
36
+ __decorate([
37
+ (0, swagger_1.ApiProperty)({ description: 'Disabled notifications' }),
38
+ __metadata("design:type", Array)
39
+ ], Account.prototype, "disabledNotificationTypes", void 0);
40
+ __decorate([
41
+ (0, swagger_1.ApiProperty)(),
42
+ __metadata("design:type", String)
43
+ ], Account.prototype, "createdAt", void 0);
44
+ __decorate([
45
+ (0, swagger_1.ApiProperty)(),
46
+ __metadata("design:type", String)
47
+ ], Account.prototype, "updatedAt", void 0);
48
+ __decorate([
49
+ (0, swagger_1.ApiPropertyOptional)(),
50
+ __metadata("design:type", String)
51
+ ], Account.prototype, "signedUpAt", void 0);
52
+ __decorate([
53
+ (0, swagger_1.ApiPropertyOptional)(),
54
+ __metadata("design:type", String)
55
+ ], Account.prototype, "signedInAt", void 0);
56
+ __decorate([
57
+ (0, swagger_1.ApiPropertyOptional)(),
58
+ __metadata("design:type", String)
59
+ ], Account.prototype, "lastSeenAt", void 0);
@@ -1,4 +1,6 @@
1
1
  export * from './filter';
2
2
  export * from './thumbnail';
3
- export { AccountEntity } from './account-entity.model';
3
+ export { Account } from './account.model';
4
+ export { SearchDocument } from './search-document.model';
4
5
  export { ApiSearchResultResponse, SearchResult } from './search-result.model';
6
+ export { User } from './user.model';
@@ -14,11 +14,15 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
14
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
- exports.SearchResult = exports.ApiSearchResultResponse = exports.AccountEntity = void 0;
17
+ exports.User = exports.SearchResult = exports.ApiSearchResultResponse = exports.SearchDocument = exports.Account = void 0;
18
18
  __exportStar(require("./filter"), exports);
19
19
  __exportStar(require("./thumbnail"), exports);
20
- var account_entity_model_1 = require("./account-entity.model");
21
- Object.defineProperty(exports, "AccountEntity", { enumerable: true, get: function () { return account_entity_model_1.AccountEntity; } });
20
+ var account_model_1 = require("./account.model");
21
+ Object.defineProperty(exports, "Account", { enumerable: true, get: function () { return account_model_1.Account; } });
22
+ var search_document_model_1 = require("./search-document.model");
23
+ Object.defineProperty(exports, "SearchDocument", { enumerable: true, get: function () { return search_document_model_1.SearchDocument; } });
22
24
  var search_result_model_1 = require("./search-result.model");
23
25
  Object.defineProperty(exports, "ApiSearchResultResponse", { enumerable: true, get: function () { return search_result_model_1.ApiSearchResultResponse; } });
24
26
  Object.defineProperty(exports, "SearchResult", { enumerable: true, get: function () { return search_result_model_1.SearchResult; } });
27
+ var user_model_1 = require("./user.model");
28
+ Object.defineProperty(exports, "User", { enumerable: true, get: function () { return user_model_1.User; } });
@@ -1,4 +1,4 @@
1
- import { HubResource } from '../../../hub-resource.enum';
1
+ import { HubResource } from '../hub-resource.enum';
2
2
  /**
3
3
  * SearchDocument
4
4
  *
@@ -11,7 +11,7 @@ var __metadata = (this && this.__metadata) || function (k, v) {
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
12
  exports.SearchDocument = void 0;
13
13
  const swagger_1 = require("@nestjs/swagger");
14
- const hub_resource_enum_1 = require("../../../hub-resource.enum");
14
+ const hub_resource_enum_1 = require("../hub-resource.enum");
15
15
  /**
16
16
  * SearchDocument
17
17
  *
@@ -1,10 +1,4 @@
1
- /**
2
- * Represents the identity and authorization details of a user account.
3
- *
4
- * This class is used in API responses to expose user metadata, including core profile
5
- * information (email, username, avatar) and permission scopes granted to the user.
6
- */
7
- export declare class AccountEntity {
1
+ export declare class User {
8
2
  /**
9
3
  * Unique identifier for the account.
10
4
  * Typically a MongoDB ObjectId string used as a primary key in the system.
@@ -12,13 +6,6 @@ export declare class AccountEntity {
12
6
  * @example "000000000000000000000000"
13
7
  */
14
8
  id: string;
15
- /**
16
- * Email address registered to the account.
17
- * Used for login, contact, and user identification.
18
- *
19
- * @example "timo@example.com"
20
- */
21
- email: string;
22
9
  /**
23
10
  * Display name of the user.
24
11
  * Commonly shown in UI elements and used for mentions and labels.
@@ -26,6 +13,13 @@ export declare class AccountEntity {
26
13
  * @example "Timo Scheuermann"
27
14
  */
28
15
  username: string;
16
+ /**
17
+ * Email address registered to the account.
18
+ * Used for login, contact, and user identification.
19
+ *
20
+ * @example "timo@example.com"
21
+ */
22
+ email: string;
29
23
  /**
30
24
  * Optional URL of the user’s avatar image.
31
25
  * Used to personalize the interface and visually identify users.
@@ -33,11 +27,4 @@ export declare class AccountEntity {
33
27
  * @example "https://file.svi-itlab.com/avatar/000000000000000000000000.webp"
34
28
  */
35
29
  avatar?: string;
36
- /**
37
- * List of permission keys assigned to this user.
38
- * These are used to control access to features via role-based access control.
39
- *
40
- * @example ["news.publish", "dashboard.view"]
41
- */
42
- perms: string[];
43
30
  }