itlab-internal-services 2.15.7 → 2.16.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 (342) hide show
  1. package/README.md +1 -187
  2. package/dist/classes/document-merger.class.js +3 -5
  3. package/dist/classes/index.d.ts +1 -0
  4. package/dist/classes/index.js +3 -1
  5. package/dist/classes/report-category.class.d.ts +55 -0
  6. package/dist/classes/report-category.class.js +120 -0
  7. package/dist/decorators/{account.decorator.d.ts → authenticated-account.decorator.d.ts} +4 -4
  8. package/dist/decorators/{account.decorator.js → authenticated-account.decorator.js} +8 -10
  9. package/dist/decorators/index.d.ts +1 -1
  10. package/dist/decorators/index.js +1 -1
  11. package/dist/exceptions/authenticated-user-required.exception.d.ts +34 -0
  12. package/dist/exceptions/authenticated-user-required.exception.js +51 -0
  13. package/dist/exceptions/bad-body.exception.d.ts +19 -8
  14. package/dist/exceptions/bad-body.exception.js +26 -10
  15. package/dist/exceptions/bad-parameter.exception.d.ts +23 -8
  16. package/dist/exceptions/bad-parameter.exception.js +41 -19
  17. package/dist/exceptions/duplicate.exception.d.ts +20 -8
  18. package/dist/exceptions/duplicate.exception.js +27 -10
  19. package/dist/exceptions/index.d.ts +1 -0
  20. package/dist/exceptions/index.js +1 -0
  21. package/dist/functions/add-views-likes-virtuals.function.d.ts +15 -0
  22. package/dist/functions/add-views-likes-virtuals.function.js +43 -0
  23. package/dist/functions/create-internal-axios-client.function.js +2 -2
  24. package/dist/functions/index.d.ts +1 -0
  25. package/dist/functions/index.js +3 -1
  26. package/dist/index.d.ts +2 -2
  27. package/dist/index.js +2 -2
  28. package/dist/likeable.interface.d.ts +1 -1
  29. package/dist/likeable.interface.js +2 -2
  30. package/dist/models/account.model.d.ts +23 -0
  31. package/dist/models/account.model.js +59 -0
  32. package/dist/models/index.d.ts +3 -1
  33. package/dist/models/index.js +7 -3
  34. package/dist/{modules/search/models → models}/search-document.model.d.ts +1 -1
  35. package/dist/{modules/search/models → models}/search-document.model.js +1 -1
  36. package/dist/models/{account-entity.model.d.ts → user.model.d.ts} +8 -21
  37. package/dist/models/{account-entity.model.js → user.model.js} +11 -25
  38. package/dist/modules/authentication/authentication-module-options.interface.d.ts +2 -8
  39. package/dist/modules/authentication/authentication-options.parameter.d.ts +4 -0
  40. package/dist/modules/authentication/{inject-auth-options.decorator.js → authentication-options.parameter.js} +5 -2
  41. package/dist/modules/authentication/authentication.module.d.ts +23 -0
  42. package/dist/modules/authentication/authentication.module.js +24 -1
  43. package/dist/modules/authentication/guards/index.d.ts +2 -2
  44. package/dist/modules/authentication/guards/index.js +7 -7
  45. package/dist/modules/authentication/guards/jwt-auth.guard.d.ts +17 -0
  46. package/dist/modules/authentication/guards/jwt-auth.guard.js +73 -0
  47. package/dist/modules/authentication/guards/permissions.guard.d.ts +5 -27
  48. package/dist/modules/authentication/guards/permissions.guard.js +26 -59
  49. package/dist/modules/authentication/guards/public.guard.d.ts +7 -13
  50. package/dist/modules/authentication/guards/public.guard.js +10 -24
  51. package/dist/modules/authentication/guards/service-auth.guard.d.ts +22 -0
  52. package/dist/modules/authentication/guards/service-auth.guard.js +65 -0
  53. package/dist/modules/authentication/index.d.ts +3 -3
  54. package/dist/modules/authentication/index.js +3 -5
  55. package/dist/modules/cache/cache-response.interceptor.d.ts +2 -2
  56. package/dist/modules/cache/cache-response.interceptor.js +2 -2
  57. package/dist/modules/cache/index.d.ts +1 -0
  58. package/dist/modules/cache/index.js +1 -0
  59. package/dist/modules/comment/comment-module-options.interface.d.ts +38 -0
  60. package/dist/modules/comment/comment.controller.d.ts +24 -30
  61. package/dist/modules/comment/comment.controller.js +59 -61
  62. package/dist/modules/comment/comment.module-definition.d.ts +1 -42
  63. package/dist/modules/comment/comment.module-definition.js +1 -2
  64. package/dist/modules/comment/comment.module.d.ts +13 -13
  65. package/dist/modules/comment/comment.module.js +15 -42
  66. package/dist/modules/comment/comment.service.d.ts +27 -37
  67. package/dist/modules/comment/comment.service.js +50 -84
  68. package/dist/modules/comment/index.d.ts +2 -3
  69. package/dist/modules/comment/index.js +16 -7
  70. package/dist/modules/database/database.module.js +2 -5
  71. package/dist/modules/database/index.d.ts +2 -5
  72. package/dist/modules/database/index.js +17 -9
  73. package/dist/modules/index.d.ts +2 -6
  74. package/dist/modules/index.js +2 -6
  75. package/dist/modules/like/index.d.ts +2 -1
  76. package/dist/modules/like/index.js +16 -3
  77. package/dist/modules/like/like-module-options.interface.d.ts +21 -0
  78. package/dist/modules/like/like.controller.d.ts +45 -37
  79. package/dist/modules/like/like.controller.js +117 -102
  80. package/dist/modules/like/like.module-definition.d.ts +1 -17
  81. package/dist/modules/like/like.module-definition.js +1 -2
  82. package/dist/modules/like/like.module.d.ts +12 -12
  83. package/dist/modules/like/like.module.js +14 -37
  84. package/dist/modules/like/like.service.d.ts +31 -27
  85. package/dist/modules/like/like.service.js +42 -35
  86. package/dist/modules/merge/index.d.ts +3 -0
  87. package/dist/modules/merge/index.js +19 -0
  88. package/dist/modules/merge/merge-module-options.interface.d.ts +21 -0
  89. package/dist/modules/merge/merge.controller.d.ts +30 -0
  90. package/dist/modules/merge/merge.controller.js +76 -0
  91. package/dist/modules/merge/merge.module.d.ts +18 -0
  92. package/dist/modules/merge/merge.module.js +41 -0
  93. package/dist/modules/merge/merge.service.interface.d.ts +17 -0
  94. package/dist/modules/services/base-http.service.d.ts +83 -0
  95. package/dist/modules/services/base-http.service.js +124 -0
  96. package/dist/modules/services/base-urls.d.ts +22 -0
  97. package/dist/modules/services/base-urls.js +121 -0
  98. package/dist/modules/services/index.d.ts +4 -0
  99. package/dist/modules/services/index.js +20 -0
  100. package/dist/modules/services/providers/accounts.service.d.ts +52 -0
  101. package/dist/modules/services/providers/accounts.service.js +82 -0
  102. package/dist/modules/services/providers/books.service.d.ts +29 -0
  103. package/dist/modules/services/providers/books.service.js +53 -0
  104. package/dist/modules/services/providers/changelog.service.d.ts +18 -0
  105. package/dist/modules/services/providers/changelog.service.js +41 -0
  106. package/dist/modules/services/providers/comments/comments.service-definition.d.ts +1 -0
  107. package/dist/modules/services/providers/comments/comments.service-definition.js +4 -0
  108. package/dist/modules/services/providers/comments/comments.service.d.ts +60 -0
  109. package/dist/modules/services/providers/comments/comments.service.js +138 -0
  110. package/dist/modules/services/providers/comments/index.d.ts +1 -0
  111. package/dist/{factories → modules/services/providers/comments}/index.js +1 -1
  112. package/dist/modules/services/providers/content/content-types.d.ts +20 -0
  113. package/dist/modules/services/providers/content/content-types.js +7 -0
  114. package/dist/modules/services/providers/content/content.service-definition.d.ts +1 -0
  115. package/dist/modules/services/providers/content/content.service-definition.js +4 -0
  116. package/dist/modules/services/providers/content/content.service.d.ts +94 -0
  117. package/dist/modules/services/providers/content/content.service.js +214 -0
  118. package/dist/modules/services/providers/content/index.d.ts +1 -0
  119. package/dist/modules/{search/models → services/providers/content}/index.js +1 -1
  120. package/dist/modules/services/providers/demo-hive.service.d.ts +29 -0
  121. package/dist/modules/services/providers/demo-hive.service.js +53 -0
  122. package/dist/modules/services/providers/events.service.d.ts +29 -0
  123. package/dist/modules/services/providers/events.service.js +53 -0
  124. package/dist/modules/services/providers/hackschool.service.d.ts +49 -0
  125. package/dist/modules/services/providers/hackschool.service.js +77 -0
  126. package/dist/modules/services/providers/ideas.service.d.ts +18 -0
  127. package/dist/modules/services/providers/ideas.service.js +41 -0
  128. package/dist/modules/services/providers/index.d.ts +19 -0
  129. package/dist/modules/services/providers/index.js +35 -0
  130. package/dist/modules/services/providers/lunch-roulette.service.d.ts +18 -0
  131. package/dist/modules/services/providers/lunch-roulette.service.js +41 -0
  132. package/dist/modules/services/providers/mail/index.d.ts +3 -0
  133. package/dist/modules/services/providers/mail/index.js +19 -0
  134. package/dist/modules/services/providers/mail/mail-types.d.ts +30 -0
  135. package/dist/modules/services/providers/mail/mail-types.js +22 -0
  136. package/dist/modules/services/providers/mail/mail.service.d.ts +99 -0
  137. package/dist/modules/{mail → services/providers/mail}/mail.service.js +54 -91
  138. package/dist/modules/services/providers/newletter.service.d.ts +29 -0
  139. package/dist/modules/services/providers/newletter.service.js +53 -0
  140. package/dist/modules/services/providers/newsroom.service.d.ts +47 -0
  141. package/dist/modules/services/providers/newsroom.service.js +71 -0
  142. package/dist/modules/services/providers/notification/dtos/schedule-notification.dto.js +2 -0
  143. package/dist/modules/services/providers/notification/index.d.ts +2 -0
  144. package/dist/modules/services/providers/notification/index.js +18 -0
  145. package/dist/modules/services/providers/notification/notification.service-definition.d.ts +1 -0
  146. package/dist/modules/services/providers/notification/notification.service-definition.js +4 -0
  147. package/dist/modules/services/providers/notification/notification.service.d.ts +50 -0
  148. package/dist/modules/services/providers/notification/notification.service.js +130 -0
  149. package/dist/modules/services/providers/pass/dtos/create-guild-member-pass.dto.js +2 -0
  150. package/dist/modules/services/providers/pass/dtos/create-team-member-pass.dto.js +2 -0
  151. package/dist/modules/services/providers/pass/index.d.ts +2 -0
  152. package/dist/modules/services/providers/pass/index.js +18 -0
  153. package/dist/modules/services/providers/pass/pass-types.d.ts +18 -0
  154. package/dist/modules/services/providers/pass/pass-types.js +7 -0
  155. package/dist/modules/{pass → services/providers/pass}/pass.service.d.ts +15 -39
  156. package/dist/modules/{pass → services/providers/pass}/pass.service.js +46 -61
  157. package/dist/modules/services/providers/podcasts.service.d.ts +29 -0
  158. package/dist/modules/services/providers/podcasts.service.js +53 -0
  159. package/dist/modules/services/providers/search/dtos/index-search-document.dto.js +2 -0
  160. package/dist/modules/services/providers/search/index.d.ts +2 -0
  161. package/dist/modules/services/providers/search/index.js +18 -0
  162. package/dist/modules/services/providers/search/search.service-definition.d.ts +1 -0
  163. package/dist/modules/services/providers/search/search.service-definition.js +4 -0
  164. package/dist/modules/services/providers/search/search.service.d.ts +66 -0
  165. package/dist/modules/services/providers/search/search.service.js +171 -0
  166. package/dist/modules/services/providers/team.service.d.ts +29 -0
  167. package/dist/modules/services/providers/team.service.js +53 -0
  168. package/dist/modules/services/providers/tech-radar.service.d.ts +39 -0
  169. package/dist/modules/services/providers/tech-radar.service.js +65 -0
  170. package/dist/modules/services/services-module-options.interface.d.ts +4 -0
  171. package/dist/modules/services/services-module-options.interface.js +2 -0
  172. package/dist/modules/services/services-options.parameter.d.ts +1 -0
  173. package/dist/modules/services/services-options.parameter.js +8 -0
  174. package/dist/modules/services/services.module-definition.d.ts +16 -0
  175. package/dist/modules/services/services.module-definition.js +21 -0
  176. package/dist/modules/services/services.module.d.ts +17 -0
  177. package/dist/modules/services/services.module.js +63 -0
  178. package/dist/pipes/index.d.ts +2 -3
  179. package/dist/pipes/index.js +2 -3
  180. package/dist/pipes/params/hub-id.pipe.d.ts +22 -0
  181. package/dist/pipes/{hub-id.pipe.js → params/hub-id.pipe.js} +14 -17
  182. package/dist/pipes/params/hub-resource.pipe.d.ts +22 -0
  183. package/dist/pipes/{hub-resource.pipe.js → params/hub-resource.pipe.js} +19 -20
  184. package/dist/pipes/params/index.d.ts +3 -0
  185. package/dist/pipes/params/index.js +19 -0
  186. package/dist/pipes/params/mongo-id.pipe.d.ts +15 -0
  187. package/dist/pipes/params/mongo-id.pipe.js +52 -0
  188. package/dist/pipes/queries/index.d.ts +3 -0
  189. package/dist/pipes/queries/index.js +19 -0
  190. package/dist/pipes/queries/mongo-ids.pipe.d.ts +22 -0
  191. package/dist/pipes/queries/mongo-ids.pipe.js +60 -0
  192. package/dist/pipes/queries/optional-boolean.pipe.d.ts +29 -0
  193. package/dist/pipes/queries/optional-boolean.pipe.js +72 -0
  194. package/dist/pipes/queries/optional-include-drafts.pipe.d.ts +28 -0
  195. package/dist/pipes/queries/optional-include-drafts.pipe.js +38 -0
  196. package/dist/properties/index.d.ts +1 -0
  197. package/dist/properties/index.js +5 -0
  198. package/dist/swagger/index.d.ts +1 -0
  199. package/dist/swagger/index.js +5 -0
  200. package/dist/swagger/remove-public-route-auth.plugin.d.ts +9 -0
  201. package/dist/swagger/remove-public-route-auth.plugin.js +25 -0
  202. package/dist/swagger/swagger-options.interface.d.ts +14 -0
  203. package/dist/swagger/swagger-options.interface.js +2 -0
  204. package/dist/swagger/swagger.function.d.ts +11 -0
  205. package/dist/swagger/swagger.function.js +47 -0
  206. package/dist/transform/boolean.transform.js +3 -3
  207. package/dist/viewable.interface.js +1 -1
  208. package/package.json +2 -2
  209. package/dist/factories/index.d.ts +0 -1
  210. package/dist/factories/virtuals.factory.d.ts +0 -79
  211. package/dist/factories/virtuals.factory.js +0 -171
  212. package/dist/modules/authentication/guards/auth.guard.d.ts +0 -36
  213. package/dist/modules/authentication/guards/auth.guard.js +0 -107
  214. package/dist/modules/authentication/guards/internal.guard.d.ts +0 -33
  215. package/dist/modules/authentication/guards/internal.guard.js +0 -72
  216. package/dist/modules/authentication/inject-auth-options.decorator.d.ts +0 -1
  217. package/dist/modules/comment/comment.model.d.ts +0 -29
  218. package/dist/modules/comment/comment.model.js +0 -43
  219. package/dist/modules/content/content.module-definition.d.ts +0 -5
  220. package/dist/modules/content/content.module-definition.js +0 -8
  221. package/dist/modules/content/content.module.d.ts +0 -31
  222. package/dist/modules/content/content.module.js +0 -60
  223. package/dist/modules/content/content.service.d.ts +0 -50
  224. package/dist/modules/content/content.service.js +0 -145
  225. package/dist/modules/content/index.d.ts +0 -3
  226. package/dist/modules/content/index.js +0 -9
  227. package/dist/modules/database/model-service/dbs/hub-account.db.d.ts +0 -28
  228. package/dist/modules/database/model-service/dbs/hub-account.db.js +0 -44
  229. package/dist/modules/database/model-service/dbs/hub-books.db.d.ts +0 -23
  230. package/dist/modules/database/model-service/dbs/hub-books.db.js +0 -45
  231. package/dist/modules/database/model-service/dbs/hub-comments.db.d.ts +0 -29
  232. package/dist/modules/database/model-service/dbs/hub-comments.db.js +0 -68
  233. package/dist/modules/database/model-service/dbs/hub-content.db.d.ts +0 -24
  234. package/dist/modules/database/model-service/dbs/hub-content.db.js +0 -49
  235. package/dist/modules/database/model-service/dbs/hub-demo-hive.db.d.ts +0 -23
  236. package/dist/modules/database/model-service/dbs/hub-demo-hive.db.js +0 -45
  237. package/dist/modules/database/model-service/dbs/hub-events.db.d.ts +0 -24
  238. package/dist/modules/database/model-service/dbs/hub-events.db.js +0 -49
  239. package/dist/modules/database/model-service/dbs/hub-hackschool.db.d.ts +0 -60
  240. package/dist/modules/database/model-service/dbs/hub-hackschool.db.js +0 -106
  241. package/dist/modules/database/model-service/dbs/hub-newsroom.db.d.ts +0 -25
  242. package/dist/modules/database/model-service/dbs/hub-newsroom.db.js +0 -53
  243. package/dist/modules/database/model-service/dbs/hub-podcasts.db.d.ts +0 -23
  244. package/dist/modules/database/model-service/dbs/hub-podcasts.db.js +0 -45
  245. package/dist/modules/database/model-service/dbs/hub-team.db.d.ts +0 -22
  246. package/dist/modules/database/model-service/dbs/hub-team.db.js +0 -41
  247. package/dist/modules/database/model-service/dbs/hub-tech-radar.db.d.ts +0 -42
  248. package/dist/modules/database/model-service/dbs/hub-tech-radar.db.js +0 -81
  249. package/dist/modules/database/model-service/model.service.d.ts +0 -6407
  250. package/dist/modules/database/model-service/model.service.js +0 -136
  251. package/dist/modules/database/populate-service/populate.service.d.ts +0 -73
  252. package/dist/modules/database/populate-service/populate.service.js +0 -163
  253. package/dist/modules/database/service-mapper-service/service-mapper.service.d.ts +0 -32
  254. package/dist/modules/database/service-mapper-service/service-mapper.service.js +0 -73
  255. package/dist/modules/fetch/fetch.module.d.ts +0 -31
  256. package/dist/modules/fetch/fetch.module.js +0 -60
  257. package/dist/modules/fetch/fetch.service.d.ts +0 -153
  258. package/dist/modules/fetch/fetch.service.js +0 -274
  259. package/dist/modules/fetch/index.d.ts +0 -2
  260. package/dist/modules/fetch/index.js +0 -7
  261. package/dist/modules/mail/index.d.ts +0 -4
  262. package/dist/modules/mail/index.js +0 -23
  263. package/dist/modules/mail/mail.module.d.ts +0 -31
  264. package/dist/modules/mail/mail.module.js +0 -60
  265. package/dist/modules/mail/mail.service.d.ts +0 -136
  266. package/dist/modules/notification/index.d.ts +0 -3
  267. package/dist/modules/notification/index.js +0 -22
  268. package/dist/modules/notification/notification.module-definition.d.ts +0 -5
  269. package/dist/modules/notification/notification.module-definition.js +0 -8
  270. package/dist/modules/notification/notification.module.d.ts +0 -34
  271. package/dist/modules/notification/notification.module.js +0 -63
  272. package/dist/modules/notification/notification.service.d.ts +0 -42
  273. package/dist/modules/notification/notification.service.js +0 -100
  274. package/dist/modules/pass/index.d.ts +0 -3
  275. package/dist/modules/pass/index.js +0 -22
  276. package/dist/modules/pass/pass.module.d.ts +0 -32
  277. package/dist/modules/pass/pass.module.js +0 -61
  278. package/dist/modules/search/index.d.ts +0 -4
  279. package/dist/modules/search/index.js +0 -23
  280. package/dist/modules/search/models/index.d.ts +0 -1
  281. package/dist/modules/search/search.module-definition.d.ts +0 -5
  282. package/dist/modules/search/search.module-definition.js +0 -8
  283. package/dist/modules/search/search.module.d.ts +0 -33
  284. package/dist/modules/search/search.module.js +0 -62
  285. package/dist/modules/search/search.service.d.ts +0 -49
  286. package/dist/modules/search/search.service.js +0 -120
  287. package/dist/pipes/hub-id.pipe.d.ts +0 -22
  288. package/dist/pipes/hub-resource.pipe.d.ts +0 -22
  289. package/dist/pipes/mongo-id.pipe.d.ts +0 -14
  290. package/dist/pipes/mongo-id.pipe.js +0 -52
  291. package/dist/swagger.config.d.ts +0 -36
  292. package/dist/swagger.config.js +0 -76
  293. /package/dist/modules/{mail/dtos/auth-login-token-mail.dto.js → comment/comment-module-options.interface.js} +0 -0
  294. /package/dist/modules/{mail/dtos/auth-password-reset-mail.dto.js → like/like-module-options.interface.js} +0 -0
  295. /package/dist/modules/{mail/dtos/event-cancel-mail.dto.js → merge/merge-module-options.interface.js} +0 -0
  296. /package/dist/modules/{mail/dtos/event-invite-mail.dto.js → merge/merge.service.interface.js} +0 -0
  297. /package/dist/modules/{mail → services/providers/mail}/dtos/auth-login-token-mail.dto.d.ts +0 -0
  298. /package/dist/modules/{mail/dtos/idea-status-updated-mail.dto.js → services/providers/mail/dtos/auth-login-token-mail.dto.js} +0 -0
  299. /package/dist/modules/{mail → services/providers/mail}/dtos/auth-password-reset-mail.dto.d.ts +0 -0
  300. /package/dist/modules/{mail/dtos/idea-submitted-mail.dto.js → services/providers/mail/dtos/auth-password-reset-mail.dto.js} +0 -0
  301. /package/dist/modules/{mail → services/providers/mail}/dtos/event-cancel-mail.dto.d.ts +0 -0
  302. /package/dist/modules/{mail/dtos/lunch-roulette-cancel-mail.dto.js → services/providers/mail/dtos/event-cancel-mail.dto.js} +0 -0
  303. /package/dist/modules/{mail → services/providers/mail}/dtos/event-invite-mail.dto.d.ts +0 -0
  304. /package/dist/modules/{mail/dtos/lunch-roulette-matched-mail.dto.js → services/providers/mail/dtos/event-invite-mail.dto.js} +0 -0
  305. /package/dist/modules/{mail → services/providers/mail}/dtos/idea-status-updated-mail.dto.d.ts +0 -0
  306. /package/dist/modules/{mail/dtos/lunch-roulette-submitted-mail.dto.js → services/providers/mail/dtos/idea-status-updated-mail.dto.js} +0 -0
  307. /package/dist/modules/{mail → services/providers/mail}/dtos/idea-submitted-mail.dto.d.ts +0 -0
  308. /package/dist/modules/{mail/dtos/lunch-roulette-unmatched-mail.dto.js → services/providers/mail/dtos/idea-submitted-mail.dto.js} +0 -0
  309. /package/dist/modules/{mail → services/providers/mail}/dtos/index.d.ts +0 -0
  310. /package/dist/modules/{mail → services/providers/mail}/dtos/index.js +0 -0
  311. /package/dist/modules/{mail → services/providers/mail}/dtos/lunch-roulette-cancel-mail.dto.d.ts +0 -0
  312. /package/dist/modules/{mail/dtos/newsletter-issue-mail.dto.js → services/providers/mail/dtos/lunch-roulette-cancel-mail.dto.js} +0 -0
  313. /package/dist/modules/{mail → services/providers/mail}/dtos/lunch-roulette-matched-mail.dto.d.ts +0 -0
  314. /package/dist/modules/{mail/dtos/newsletter-subscribed-mail.dto.js → services/providers/mail/dtos/lunch-roulette-matched-mail.dto.js} +0 -0
  315. /package/dist/modules/{mail → services/providers/mail}/dtos/lunch-roulette-submitted-mail.dto.d.ts +0 -0
  316. /package/dist/modules/{mail/dtos/newsletter-unsubscribed-mail.dto.js → services/providers/mail/dtos/lunch-roulette-submitted-mail.dto.js} +0 -0
  317. /package/dist/modules/{mail → services/providers/mail}/dtos/lunch-roulette-unmatched-mail.dto.d.ts +0 -0
  318. /package/dist/modules/{mail/dtos/notification-mail.dto.js → services/providers/mail/dtos/lunch-roulette-unmatched-mail.dto.js} +0 -0
  319. /package/dist/modules/{mail → services/providers/mail}/dtos/newsletter-issue-mail.dto.d.ts +0 -0
  320. /package/dist/modules/{notification/dtos/schedule-notification.dto.js → services/providers/mail/dtos/newsletter-issue-mail.dto.js} +0 -0
  321. /package/dist/modules/{mail → services/providers/mail}/dtos/newsletter-subscribed-mail.dto.d.ts +0 -0
  322. /package/dist/modules/{pass/dtos/create-guild-member-pass.dto.js → services/providers/mail/dtos/newsletter-subscribed-mail.dto.js} +0 -0
  323. /package/dist/modules/{mail → services/providers/mail}/dtos/newsletter-unsubscribed-mail.dto.d.ts +0 -0
  324. /package/dist/modules/{pass/dtos/create-team-member-pass.dto.js → services/providers/mail/dtos/newsletter-unsubscribed-mail.dto.js} +0 -0
  325. /package/dist/modules/{mail → services/providers/mail}/dtos/notification-mail.dto.d.ts +0 -0
  326. /package/dist/modules/{search/dtos/index-search-document.dto.js → services/providers/mail/dtos/notification-mail.dto.js} +0 -0
  327. /package/dist/modules/{mail → services/providers/mail}/models/index.d.ts +0 -0
  328. /package/dist/modules/{mail → services/providers/mail}/models/index.js +0 -0
  329. /package/dist/modules/{mail → services/providers/mail}/models/mail-recipient.model.d.ts +0 -0
  330. /package/dist/modules/{mail → services/providers/mail}/models/mail-recipient.model.js +0 -0
  331. /package/dist/modules/{notification → services/providers/notification}/dtos/index.d.ts +0 -0
  332. /package/dist/modules/{notification → services/providers/notification}/dtos/index.js +0 -0
  333. /package/dist/modules/{notification → services/providers/notification}/dtos/schedule-notification.dto.d.ts +0 -0
  334. /package/dist/modules/{pass → services/providers/pass}/dtos/create-guild-member-pass.dto.d.ts +0 -0
  335. /package/dist/modules/{pass → services/providers/pass}/dtos/create-team-member-pass.dto.d.ts +0 -0
  336. /package/dist/modules/{pass → services/providers/pass}/dtos/index.d.ts +0 -0
  337. /package/dist/modules/{pass → services/providers/pass}/dtos/index.js +0 -0
  338. /package/dist/modules/{search → services/providers/search}/dtos/index-search-document.dto.d.ts +0 -0
  339. /package/dist/modules/{search → services/providers/search}/dtos/index.d.ts +0 -0
  340. /package/dist/modules/{search → services/providers/search}/dtos/index.js +0 -0
  341. /package/dist/{modules/content → properties}/content.property.d.ts +0 -0
  342. /package/dist/{modules/content → properties}/content.property.js +0 -0
@@ -0,0 +1,41 @@
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.LunchRouletteService = void 0;
16
+ const config_1 = require("@nestjs/config");
17
+ const authentication_1 = require("../../authentication");
18
+ const base_http_service_1 = require("../base-http.service");
19
+ const base_urls_1 = require("../base-urls");
20
+ /**
21
+ * LunchRouletteService
22
+ *
23
+ * Service client for interacting with the LunchRoulette domain.
24
+ * Inherits logging, authentication, and environment-sensitive URL resolution from `BaseHttpService`.
25
+ */
26
+ let LunchRouletteService = class LunchRouletteService extends base_http_service_1.BaseHttpService {
27
+ /**
28
+ * Constructs a LunchRoulette service client.
29
+ *
30
+ * @param {AuthenticationModuleOptions} authenticationOptions - Authentication options (provided by DI).
31
+ * @param {ConfigService} configService - Global NestJS config service for environment detection.
32
+ */
33
+ constructor(authenticationOptions, configService) {
34
+ super('LunchRoulette', base_urls_1.BaseUrls.LunchRouletteService, authenticationOptions, configService);
35
+ }
36
+ };
37
+ exports.LunchRouletteService = LunchRouletteService;
38
+ exports.LunchRouletteService = LunchRouletteService = __decorate([
39
+ __param(0, (0, authentication_1.InjectAuthenticationOptions)()),
40
+ __metadata("design:paramtypes", [Object, config_1.ConfigService])
41
+ ], LunchRouletteService);
@@ -0,0 +1,3 @@
1
+ export * from './dtos';
2
+ export * from './models';
3
+ export * from './mail.service';
@@ -0,0 +1,19 @@
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("./dtos"), exports);
18
+ __exportStar(require("./models"), exports);
19
+ __exportStar(require("./mail.service"), exports);
@@ -0,0 +1,30 @@
1
+ import { AuthLoginTokenMailDto, AuthPasswordResetMailDto, EventCancelMailDto, EventInviteMailDto, IdeaStatusUpdateMailDto, IdeaSubmittedMailDto, LunchRouletteCancelMailDto, LunchRouletteMatchedMailDto, LunchRouletteSubmittedMailDto, LunchRouletteUnmatchedMailDto, NewsletterIssueMailDto, NewsletterSubscribedMailDto, NewsletterUnsubscribedMailDto, NotificationMailDto } from './dtos';
2
+ /**
3
+ * Constant list of supported mail types.
4
+ */
5
+ declare const supportedMailTypes: readonly ["auth.login-token", "auth.password-reset", "event.invite", "event.cancel", "idea.submitted", "idea.status-update", "lunch-roulette.submitted", "lunch-roulette.cancel", "lunch-roulette.matched", "lunch-roulette.unmatched", "newsletter.subscribed", "newsletter.unsubscribed", "newsletter.issue", "notification.notification"];
6
+ /**
7
+ * Union type representing valid mail kinds.
8
+ */
9
+ export type MailType = (typeof supportedMailTypes)[number];
10
+ /**
11
+ * Maps each supported mail type to its corresponding DTO.
12
+ * This enables type-safe payload handling when creating passes.
13
+ */
14
+ export type MailTypeDtoMap = {
15
+ 'auth.login-token': AuthLoginTokenMailDto;
16
+ 'auth.password-reset': AuthPasswordResetMailDto;
17
+ 'event.invite': EventInviteMailDto;
18
+ 'event.cancel': EventCancelMailDto;
19
+ 'idea.submitted': IdeaSubmittedMailDto;
20
+ 'idea.status-update': IdeaStatusUpdateMailDto;
21
+ 'lunch-roulette.submitted': LunchRouletteSubmittedMailDto;
22
+ 'lunch-roulette.cancel': LunchRouletteCancelMailDto;
23
+ 'lunch-roulette.matched': LunchRouletteMatchedMailDto;
24
+ 'lunch-roulette.unmatched': LunchRouletteUnmatchedMailDto;
25
+ 'newsletter.subscribed': NewsletterSubscribedMailDto;
26
+ 'newsletter.unsubscribed': NewsletterUnsubscribedMailDto;
27
+ 'newsletter.issue': NewsletterIssueMailDto;
28
+ 'notification.notification': NotificationMailDto;
29
+ };
30
+ export {};
@@ -0,0 +1,22 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ /**
4
+ * Constant list of supported mail types.
5
+ */
6
+ // eslint-disable-next-line
7
+ const supportedMailTypes = [
8
+ 'auth.login-token',
9
+ 'auth.password-reset',
10
+ 'event.invite',
11
+ 'event.cancel',
12
+ 'idea.submitted',
13
+ 'idea.status-update',
14
+ 'lunch-roulette.submitted',
15
+ 'lunch-roulette.cancel',
16
+ 'lunch-roulette.matched',
17
+ 'lunch-roulette.unmatched',
18
+ 'newsletter.subscribed',
19
+ 'newsletter.unsubscribed',
20
+ 'newsletter.issue',
21
+ 'notification.notification',
22
+ ];
@@ -0,0 +1,99 @@
1
+ import { ConfigService } from '@nestjs/config';
2
+ import { AuthenticationModuleOptions } from '../../../authentication';
3
+ import { BaseHttpService } from '../../base-http.service';
4
+ import { AuthLoginTokenMailDto, AuthPasswordResetMailDto, EventCancelMailDto, EventInviteMailDto, IdeaStatusUpdateMailDto, IdeaSubmittedMailDto, LunchRouletteCancelMailDto, LunchRouletteMatchedMailDto, LunchRouletteSubmittedMailDto, LunchRouletteUnmatchedMailDto, NewsletterIssueMailDto, NewsletterSubscribedMailDto, NewsletterUnsubscribedMailDto, NotificationMailDto } from './dtos';
5
+ import { MailType, MailTypeDtoMap } from './mail-types';
6
+ /**
7
+ * MailService
8
+ *
9
+ * Provides a type-safe interface for sending various email notifications
10
+ * via the central organisation-hub-email service. Handles environment-aware
11
+ * client configuration and logging for success/failure of email dispatches.
12
+ */
13
+ export declare class MailService extends BaseHttpService {
14
+ /**
15
+ * Creates a MailService client for a specific resource.
16
+ *
17
+ * @param authenticationOptions Authentication options injected from the Auth module.
18
+ * @param configService NestJS configuration service for environment variables and URLs.
19
+ */
20
+ constructor(authenticationOptions: AuthenticationModuleOptions, configService: ConfigService);
21
+ /**
22
+ * Sends an email of the given type with the provided payload.
23
+ *
24
+ * @template Type - One of the supported MailType keys
25
+ * @param type - The type of email to send
26
+ * @param payload - The payload DTO corresponding to the type
27
+ */
28
+ sendMail<Type extends MailType>(type: Type, payload: MailTypeDtoMap[Type]): void;
29
+ /**
30
+ * Sends an email with a one-time login token.
31
+ * @param {AuthLoginTokenMailDto} payload - DTO containing recipient and token.
32
+ */
33
+ sendAuthLoginTokenMail(payload: AuthLoginTokenMailDto): void;
34
+ /**
35
+ * Sends a password reset email with a secure link.
36
+ * @param {AuthPasswordResetMailDto} payload - DTO containing recipient and reset URL.
37
+ */
38
+ sendAuthPasswordResetMail(payload: AuthPasswordResetMailDto): void;
39
+ /**
40
+ * Sends an event invitation email.
41
+ * @param {EventInviteMailDto} payload - DTO containing event details and recipient.
42
+ */
43
+ sendEventInviteMail(payload: EventInviteMailDto): void;
44
+ /**
45
+ * Sends a notification about an event cancellation.
46
+ * @param {EventCancelMailDto} payload - DTO containing event title, time, and links.
47
+ */
48
+ sendEventCancelMail(payload: EventCancelMailDto): void;
49
+ /**
50
+ * Sends a confirmation that an idea was submitted.
51
+ * @param {IdeaSubmittedMailDto} payload - DTO containing recipient and management URL.
52
+ */
53
+ sendIdeaSubmittedMail(payload: IdeaSubmittedMailDto): void;
54
+ /**
55
+ * Sends a notification that an idea's status has changed.
56
+ * @param {IdeaStatusUpdateMailDto} payload - DTO containing the old and new status.
57
+ */
58
+ sendIdeaStatusUpdateMail(payload: IdeaStatusUpdateMailDto): void;
59
+ /**
60
+ * Sends confirmation of lunch roulette participation.
61
+ * @param {LunchRouletteSubmittedMailDto} payload - DTO with recipient, location, and type.
62
+ */
63
+ sendLunchRouletteSubmittedMail(payload: LunchRouletteSubmittedMailDto): void;
64
+ /**
65
+ * Sends a cancellation email for lunch roulette.
66
+ * @param {LunchRouletteCancelMailDto} payload - DTO containing the recipient.
67
+ */
68
+ sendLunchRouletteCancelMail(payload: LunchRouletteCancelMailDto): void;
69
+ /**
70
+ * Sends a match notification to lunch roulette participants.
71
+ * @param {LunchRouletteMatchedMailDto} payload - DTO with recipients, message, and details URL.
72
+ */
73
+ sendLunchRouletteMatchedMail(payload: LunchRouletteMatchedMailDto): void;
74
+ /**
75
+ * Notifies a user that they were unmatched in lunch roulette.
76
+ * @param {LunchRouletteUnmatchedMailDto} payload - DTO with the unmatched recipient.
77
+ */
78
+ sendLunchRouletteUnmatchedMail(payload: LunchRouletteUnmatchedMailDto): void;
79
+ /**
80
+ * Sends confirmation of a newsletter subscription.
81
+ * @param {NewsletterSubscribedMailDto} payload - DTO with recipient information.
82
+ */
83
+ sendNewsletterSubscribedMail(payload: NewsletterSubscribedMailDto): void;
84
+ /**
85
+ * Sends confirmation of newsletter unsubscription.
86
+ * @param {NewsletterUnsubscribedMailDto} payload - DTO with recipient information.
87
+ */
88
+ sendNewsletterUnsubscribedMail(payload: NewsletterUnsubscribedMailDto): void;
89
+ /**
90
+ * Sends the latest issue of the newsletter.
91
+ * @param {NewsletterIssueMailDto} payload - DTO containing recipients, content, and metadata.
92
+ */
93
+ sendNewsletterIssueMail(payload: NewsletterIssueMailDto): void;
94
+ /**
95
+ * Sends a general-purpose email notification.
96
+ * @param {NotificationMailDto} payload - DTO with recipients, title, message, and optional URL.
97
+ */
98
+ sendNotificationMail(payload: NotificationMailDto): void;
99
+ }
@@ -11,86 +11,49 @@ var __metadata = (this && this.__metadata) || function (k, v) {
11
11
  var __param = (this && this.__param) || function (paramIndex, decorator) {
12
12
  return function (target, key) { decorator(target, key, paramIndex); }
13
13
  };
14
- var MailService_1;
15
14
  Object.defineProperty(exports, "__esModule", { value: true });
16
15
  exports.MailService = void 0;
17
16
  const common_1 = require("@nestjs/common");
18
17
  const config_1 = require("@nestjs/config");
19
- const create_internal_axios_client_function_1 = require("../../functions/create-internal-axios-client.function");
20
- const authentication_1 = require("../authentication");
18
+ const authentication_1 = require("../../../authentication");
19
+ const base_http_service_1 = require("../../base-http.service");
20
+ const base_urls_1 = require("../../base-urls");
21
21
  /**
22
- * Constant list of supported mail types.
23
- */
24
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
25
- const supportedMailTypes = [
26
- 'auth.login-token',
27
- 'auth.password-reset',
28
- 'event.invite',
29
- 'event.cancel',
30
- 'idea.submitted',
31
- 'idea.status-update',
32
- 'lunch-roulette.submitted',
33
- 'lunch-roulette.cancel',
34
- 'lunch-roulette.matched',
35
- 'lunch-roulette.unmatched',
36
- 'newsletter.subscribed',
37
- 'newsletter.unsubscribed',
38
- 'newsletter.issue',
39
- 'notification.notification',
40
- ];
41
- /**
42
- * @class MailService
43
- * @description
44
- * MailService provides a structured and type-safe interface for sending
45
- * various types of email notifications within the platform.
22
+ * MailService
46
23
  *
47
- * It integrates with the central organisation-hub-email service,
48
- * automatically configuring the client based on environment (dev/prod).
24
+ * Provides a type-safe interface for sending various email notifications
25
+ * via the central organisation-hub-email service. Handles environment-aware
26
+ * client configuration and logging for success/failure of email dispatches.
49
27
  */
50
- let MailService = MailService_1 = class MailService {
28
+ let MailService = class MailService extends base_http_service_1.BaseHttpService {
51
29
  /**
52
- * Initializes the PassService with appropriate API client and settings.
30
+ * Creates a MailService client for a specific resource.
53
31
  *
54
- * @param {AuthenticationModuleOptions} authOptions - Contains Kubernetes service account token
55
- * @param {ConfigService} configService - Configuration service for environment checks
56
- */
57
- constructor(authOptions, configService) {
58
- this.authOptions = authOptions;
59
- this.configService = configService;
60
- this.logger = new common_1.Logger(MailService_1.name);
61
- const isProduction = this.configService.get('NODE_ENV') === 'production';
62
- // Construct base URL conditionally based on environment.
63
- const baseUrl = isProduction
64
- ? 'http://organisation-hub-email-service.organisation-hub-services.svc.cluster.local:3000/internal/'
65
- : 'https://services.svi-itlab.com/email/internal/';
66
- // Initialize axios instance with k8s token and appropriate URL.
67
- this.axiosInstance = (0, create_internal_axios_client_function_1.createInternalAxiosClient)({
68
- k8sToken: this.authOptions.k8sToken,
69
- baseUrl: `${baseUrl}`,
70
- });
32
+ * @param authenticationOptions Authentication options injected from the Auth module.
33
+ * @param configService NestJS configuration service for environment variables and URLs.
34
+ */
35
+ constructor(authenticationOptions, configService) {
36
+ super('Mail', base_urls_1.BaseUrls.MailService, authenticationOptions, configService);
71
37
  }
72
38
  /**
73
- * Sends an email based on a provided type and payload.
74
- *
75
- * @template Type
76
- * @param {Type} type - The type of email to send (must be a supported type).
77
- * @param {MailTypeDtoMap[Type]} payload - The payload DTO matching the type.
39
+ * Sends an email of the given type with the provided payload.
78
40
  *
79
- * @remarks
80
- * This generic method allows all email variants to be routed through
81
- * one point with strong type checking for safety and consistency.
41
+ * @template Type - One of the supported MailType keys
42
+ * @param type - The type of email to send
43
+ * @param payload - The payload DTO corresponding to the type
82
44
  */
83
- send(type, payload) {
45
+ sendMail(type, payload) {
84
46
  // Email service expects paths like "auth/login-token"
85
47
  const endpoint = type.split('.').join('/');
86
48
  this.logger.log(`Dispatching email to endpoint: ${endpoint}`);
87
- this.axiosInstance
88
- .post(endpoint, payload)
49
+ this.client
50
+ .post(`internal/${endpoint}`, payload)
89
51
  .then(() => {
90
52
  this.logger.log(`Email sent successfully: ${type}`);
91
53
  })
92
- .catch(({ response }) => {
93
- this.logger.error(`Failed to send email: ${type}: ${JSON.stringify(response === null || response === void 0 ? void 0 : response.data)}`);
54
+ .catch((error) => {
55
+ const { message } = this.parseError(error);
56
+ this.logger.error(`Failed to send email: ${type}: ${message}`);
94
57
  });
95
58
  }
96
59
  // ─────────────────────────────────────────────
@@ -100,15 +63,15 @@ let MailService = MailService_1 = class MailService {
100
63
  * Sends an email with a one-time login token.
101
64
  * @param {AuthLoginTokenMailDto} payload - DTO containing recipient and token.
102
65
  */
103
- sendAuthLoginToken(payload) {
104
- this.send('auth.login-token', payload);
66
+ sendAuthLoginTokenMail(payload) {
67
+ this.sendMail('auth.login-token', payload);
105
68
  }
106
69
  /**
107
70
  * Sends a password reset email with a secure link.
108
71
  * @param {AuthPasswordResetMailDto} payload - DTO containing recipient and reset URL.
109
72
  */
110
- sendAuthPasswordReset(payload) {
111
- this.send('auth.password-reset', payload);
73
+ sendAuthPasswordResetMail(payload) {
74
+ this.sendMail('auth.password-reset', payload);
112
75
  }
113
76
  // ─────────────────────────────────────────────
114
77
  // Event Emails
@@ -117,15 +80,15 @@ let MailService = MailService_1 = class MailService {
117
80
  * Sends an event invitation email.
118
81
  * @param {EventInviteMailDto} payload - DTO containing event details and recipient.
119
82
  */
120
- sendEventInvite(payload) {
121
- this.send('event.invite', payload);
83
+ sendEventInviteMail(payload) {
84
+ this.sendMail('event.invite', payload);
122
85
  }
123
86
  /**
124
87
  * Sends a notification about an event cancellation.
125
88
  * @param {EventCancelMailDto} payload - DTO containing event title, time, and links.
126
89
  */
127
- sendEventCancel(payload) {
128
- this.send('event.cancel', payload);
90
+ sendEventCancelMail(payload) {
91
+ this.sendMail('event.cancel', payload);
129
92
  }
130
93
  // ─────────────────────────────────────────────
131
94
  // Idea Submission Emails
@@ -134,15 +97,15 @@ let MailService = MailService_1 = class MailService {
134
97
  * Sends a confirmation that an idea was submitted.
135
98
  * @param {IdeaSubmittedMailDto} payload - DTO containing recipient and management URL.
136
99
  */
137
- sendIdeaSubmitted(payload) {
138
- this.send('idea.submitted', payload);
100
+ sendIdeaSubmittedMail(payload) {
101
+ this.sendMail('idea.submitted', payload);
139
102
  }
140
103
  /**
141
104
  * Sends a notification that an idea's status has changed.
142
105
  * @param {IdeaStatusUpdateMailDto} payload - DTO containing the old and new status.
143
106
  */
144
- sendIdeaStatusUpdate(payload) {
145
- this.send('idea.status-update', payload);
107
+ sendIdeaStatusUpdateMail(payload) {
108
+ this.sendMail('idea.status-update', payload);
146
109
  }
147
110
  // ─────────────────────────────────────────────
148
111
  // Lunch Roulette Emails
@@ -151,29 +114,29 @@ let MailService = MailService_1 = class MailService {
151
114
  * Sends confirmation of lunch roulette participation.
152
115
  * @param {LunchRouletteSubmittedMailDto} payload - DTO with recipient, location, and type.
153
116
  */
154
- sendLunchRouletteSubmitted(payload) {
155
- this.send('lunch-roulette.submitted', payload);
117
+ sendLunchRouletteSubmittedMail(payload) {
118
+ this.sendMail('lunch-roulette.submitted', payload);
156
119
  }
157
120
  /**
158
121
  * Sends a cancellation email for lunch roulette.
159
122
  * @param {LunchRouletteCancelMailDto} payload - DTO containing the recipient.
160
123
  */
161
- sendLunchRouletteCancel(payload) {
162
- this.send('lunch-roulette.cancel', payload);
124
+ sendLunchRouletteCancelMail(payload) {
125
+ this.sendMail('lunch-roulette.cancel', payload);
163
126
  }
164
127
  /**
165
128
  * Sends a match notification to lunch roulette participants.
166
129
  * @param {LunchRouletteMatchedMailDto} payload - DTO with recipients, message, and details URL.
167
130
  */
168
- sendLunchRouletteMatched(payload) {
169
- this.send('lunch-roulette.matched', payload);
131
+ sendLunchRouletteMatchedMail(payload) {
132
+ this.sendMail('lunch-roulette.matched', payload);
170
133
  }
171
134
  /**
172
135
  * Notifies a user that they were unmatched in lunch roulette.
173
136
  * @param {LunchRouletteUnmatchedMailDto} payload - DTO with the unmatched recipient.
174
137
  */
175
- sendLunchRouletteUnmatched(payload) {
176
- this.send('lunch-roulette.unmatched', payload);
138
+ sendLunchRouletteUnmatchedMail(payload) {
139
+ this.sendMail('lunch-roulette.unmatched', payload);
177
140
  }
178
141
  // ─────────────────────────────────────────────
179
142
  // Newsletter Emails
@@ -182,22 +145,22 @@ let MailService = MailService_1 = class MailService {
182
145
  * Sends confirmation of a newsletter subscription.
183
146
  * @param {NewsletterSubscribedMailDto} payload - DTO with recipient information.
184
147
  */
185
- sendNewsletterSubscribed(payload) {
186
- this.send('newsletter.subscribed', payload);
148
+ sendNewsletterSubscribedMail(payload) {
149
+ this.sendMail('newsletter.subscribed', payload);
187
150
  }
188
151
  /**
189
152
  * Sends confirmation of newsletter unsubscription.
190
153
  * @param {NewsletterUnsubscribedMailDto} payload - DTO with recipient information.
191
154
  */
192
- sendNewsletterUnsubscribed(payload) {
193
- this.send('newsletter.unsubscribed', payload);
155
+ sendNewsletterUnsubscribedMail(payload) {
156
+ this.sendMail('newsletter.unsubscribed', payload);
194
157
  }
195
158
  /**
196
159
  * Sends the latest issue of the newsletter.
197
160
  * @param {NewsletterIssueMailDto} payload - DTO containing recipients, content, and metadata.
198
161
  */
199
- sendNewsletterIssue(payload) {
200
- this.send('newsletter.issue', payload);
162
+ sendNewsletterIssueMail(payload) {
163
+ this.sendMail('newsletter.issue', payload);
201
164
  }
202
165
  // ─────────────────────────────────────────────
203
166
  // Notification Emails
@@ -206,13 +169,13 @@ let MailService = MailService_1 = class MailService {
206
169
  * Sends a general-purpose email notification.
207
170
  * @param {NotificationMailDto} payload - DTO with recipients, title, message, and optional URL.
208
171
  */
209
- sendNotification(payload) {
210
- this.send('notification.notification', payload);
172
+ sendNotificationMail(payload) {
173
+ this.sendMail('notification.notification', payload);
211
174
  }
212
175
  };
213
176
  exports.MailService = MailService;
214
- exports.MailService = MailService = MailService_1 = __decorate([
177
+ exports.MailService = MailService = __decorate([
215
178
  (0, common_1.Injectable)(),
216
- __param(0, (0, authentication_1.InjectAuthOptions)()),
179
+ __param(0, (0, authentication_1.InjectAuthenticationOptions)()),
217
180
  __metadata("design:paramtypes", [Object, config_1.ConfigService])
218
181
  ], MailService);
@@ -0,0 +1,29 @@
1
+ import { ConfigService } from '@nestjs/config';
2
+ import { LabNewsletter } from 'itlab-functions';
3
+ import { AuthenticationModuleOptions } from '../../authentication';
4
+ import { BaseHttpService } from '../base-http.service';
5
+ /**
6
+ * NewsletterService
7
+ *
8
+ * Service client for interacting with the Newsletter domain.
9
+ * Inherits logging, authentication, and environment-sensitive URL resolution from `BaseHttpService`.
10
+ */
11
+ export declare class NewsletterService extends BaseHttpService {
12
+ /**
13
+ * Constructs a Newsletter service client.
14
+ *
15
+ * @param {AuthenticationModuleOptions} authenticationOptions - Authentication options (provided by DI).
16
+ * @param {ConfigService} configService - Global NestJS config service for environment detection.
17
+ */
18
+ constructor(authenticationOptions: AuthenticationModuleOptions, configService: ConfigService);
19
+ /**
20
+ * Retrieves a single issue entry by its MongoDB identifier.
21
+ *
22
+ * If the downstream call fails or the resource does not exist, the method
23
+ * will log the failure and return `undefined`.
24
+ *
25
+ * @param {string} issueId - Unique MongoDB identifier of the issue item.
26
+ * @returns {Promise<LabNewsletter | undefined>} Resolves to the issue object if found, otherwise `undefined`.
27
+ */
28
+ fetchIssueById(issueId: string): Promise<LabNewsletter | undefined>;
29
+ }
@@ -0,0 +1,53 @@
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.NewsletterService = void 0;
16
+ const config_1 = require("@nestjs/config");
17
+ const authentication_1 = require("../../authentication");
18
+ const base_http_service_1 = require("../base-http.service");
19
+ const base_urls_1 = require("../base-urls");
20
+ /**
21
+ * NewsletterService
22
+ *
23
+ * Service client for interacting with the Newsletter domain.
24
+ * Inherits logging, authentication, and environment-sensitive URL resolution from `BaseHttpService`.
25
+ */
26
+ let NewsletterService = class NewsletterService extends base_http_service_1.BaseHttpService {
27
+ /**
28
+ * Constructs a Newsletter service client.
29
+ *
30
+ * @param {AuthenticationModuleOptions} authenticationOptions - Authentication options (provided by DI).
31
+ * @param {ConfigService} configService - Global NestJS config service for environment detection.
32
+ */
33
+ constructor(authenticationOptions, configService) {
34
+ super('Newsletter', base_urls_1.BaseUrls.NewsletterService, authenticationOptions, configService);
35
+ }
36
+ /**
37
+ * Retrieves a single issue entry by its MongoDB identifier.
38
+ *
39
+ * If the downstream call fails or the resource does not exist, the method
40
+ * will log the failure and return `undefined`.
41
+ *
42
+ * @param {string} issueId - Unique MongoDB identifier of the issue item.
43
+ * @returns {Promise<LabNewsletter | undefined>} Resolves to the issue object if found, otherwise `undefined`.
44
+ */
45
+ async fetchIssueById(issueId) {
46
+ return this.fetchResource(`internal/issue/${issueId}`);
47
+ }
48
+ };
49
+ exports.NewsletterService = NewsletterService;
50
+ exports.NewsletterService = NewsletterService = __decorate([
51
+ __param(0, (0, authentication_1.InjectAuthenticationOptions)()),
52
+ __metadata("design:paramtypes", [Object, config_1.ConfigService])
53
+ ], NewsletterService);
@@ -0,0 +1,47 @@
1
+ import { ConfigService } from '@nestjs/config';
2
+ import { LabNews } from 'itlab-functions';
3
+ import { AuthenticationModuleOptions } from '../../authentication';
4
+ import { BaseHttpService } from '../base-http.service';
5
+ type FetchNewsOptions = {
6
+ includeDrafts?: boolean;
7
+ includeContent?: boolean;
8
+ includeComments?: boolean;
9
+ includeAuthors?: boolean;
10
+ };
11
+ /**
12
+ * NewsroomService
13
+ *
14
+ * Service client for interacting with the Newsroom domain.
15
+ * Inherits logging, authentication, and environment-sensitive URL resolution from `BaseHttpService`.
16
+ */
17
+ export declare class NewsroomService extends BaseHttpService {
18
+ /**
19
+ * NewsroomService
20
+ *
21
+ * Service client for interacting with the Newsroom domain.
22
+ * Inherits logging, authentication, and environment-sensitive URL resolution from `BaseHttpService`.
23
+ */
24
+ constructor(authenticationOptions: AuthenticationModuleOptions, configService: ConfigService);
25
+ /**
26
+ * Retrieves a single news entry by its MongoDB identifier.
27
+ *
28
+ * If the downstream call fails or the resource does not exist, the method
29
+ * will log the failure and return `undefined`.
30
+ *
31
+ * @param {string} newsId - Unique MongoDB identifier of the news item.
32
+ * @param options - Optional flags controlling retrieval behavior.
33
+ * @returns {Promise<LabNews | undefined>} Resolves to the news object if found, otherwise `undefined`.
34
+ */
35
+ fetchNewsById(newsId: string, options?: FetchNewsOptions): Promise<LabNews | undefined>;
36
+ /**
37
+ * Retrieves a collection of news entries by their MongoDB identifiers.
38
+ *
39
+ * If the downstream call fails, an empty array is returned.
40
+ *
41
+ * @param {string[]} newsIds - Array of MongoDB identifiers for the news items.
42
+ * @param options - Optional flags controlling retrieval behavior.
43
+ * @returns {Promise<LabNews[]>} Resolves to an array of news objects (empty if none found).
44
+ */
45
+ getNewsCollection(newsIds: string[], options?: FetchNewsOptions): Promise<LabNews[]>;
46
+ }
47
+ export {};