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,63 @@
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
+ Object.defineProperty(exports, "__esModule", { value: true });
9
+ exports.ServicesModule = void 0;
10
+ const common_1 = require("@nestjs/common");
11
+ const providers_1 = require("./providers");
12
+ const newsroom_service_1 = require("./providers/newsroom.service");
13
+ const services_module_definition_1 = require("./services.module-definition");
14
+ const serviceProviders = [
15
+ // Apps
16
+ newsroom_service_1.NewsroomService,
17
+ providers_1.EventsService,
18
+ providers_1.HackschoolService,
19
+ providers_1.DemoHiveService,
20
+ providers_1.TechRadarService,
21
+ providers_1.PodcastsService,
22
+ providers_1.BooksService,
23
+ providers_1.TeamService,
24
+ providers_1.NewsletterService,
25
+ providers_1.IdeasService,
26
+ providers_1.LunchRouletteService,
27
+ // Utils
28
+ providers_1.AccountsService,
29
+ providers_1.CommentsService,
30
+ providers_1.NotificationService,
31
+ providers_1.MailService,
32
+ providers_1.SearchService,
33
+ providers_1.ChangelogService,
34
+ providers_1.PassService,
35
+ providers_1.ContentService,
36
+ ];
37
+ /**
38
+ * ServicesModule
39
+ */
40
+ let ServicesModule = class ServicesModule extends services_module_definition_1.ServicesModuleClass {
41
+ /**
42
+ * Synchronously configures the ServicesModule with provided options.
43
+ *
44
+ * Extends the base ServicesModuleClass `forRoot` method by exporting the options token.
45
+ *
46
+ * @param {ServicesModuleOptions} options - Configuration options for ServicesModule setup.
47
+ * @returns {DynamicModule} Configured dynamic module.
48
+ */
49
+ static forRoot(options) {
50
+ const moduleDefinition = super.forRoot(options || {});
51
+ return Object.assign(Object.assign({}, moduleDefinition), { exports: [
52
+ ...(moduleDefinition.exports || []),
53
+ {
54
+ provide: services_module_definition_1.SERVICES_MODULE_OPTIONS_TOKEN,
55
+ useValue: options,
56
+ },
57
+ ] });
58
+ }
59
+ };
60
+ exports.ServicesModule = ServicesModule;
61
+ exports.ServicesModule = ServicesModule = __decorate([
62
+ (0, common_1.Module)({ providers: serviceProviders, exports: serviceProviders })
63
+ ], ServicesModule);
@@ -1,3 +1,2 @@
1
- export * from './hub-id.pipe';
2
- export * from './hub-resource.pipe';
3
- export * from './mongo-id.pipe';
1
+ export * from './params';
2
+ export * from './queries';
@@ -14,6 +14,5 @@ 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
- __exportStar(require("./hub-id.pipe"), exports);
18
- __exportStar(require("./hub-resource.pipe"), exports);
19
- __exportStar(require("./mongo-id.pipe"), exports);
17
+ __exportStar(require("./params"), exports);
18
+ __exportStar(require("./queries"), exports);
@@ -0,0 +1,22 @@
1
+ import { ValidationOptions } from 'class-validator';
2
+ /**
3
+ * Parameter decorator that validates a route parameter as a HubId.
4
+ *
5
+ * @param {string} parameterName - The name of the route parameter
6
+ * @returns {ParameterDecorator}
7
+ */
8
+ export declare function HubIdParam(parameterName: string): ParameterDecorator;
9
+ /**
10
+ * Decorator to add Swagger metadata and error response for HubId parameters.
11
+ *
12
+ * @param {string} parameterName - The route parameter name
13
+ * @returns {MethodDecorator & ClassDecorator}
14
+ */
15
+ export declare function ApiHubIdParam(parameterName: string): MethodDecorator & ClassDecorator;
16
+ /**
17
+ * Decorator to validate DTO properties as HubId using class-validator.
18
+ *
19
+ * @param {ValidationOptions} options - Optional validation options
20
+ * @returns {PropertyDecorator}
21
+ */
22
+ export declare function IsHubId(options?: ValidationOptions): PropertyDecorator;
@@ -1,18 +1,16 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.HubIdParam = HubIdParam;
4
- exports.ApiHubId = ApiHubId;
4
+ exports.ApiHubIdParam = ApiHubIdParam;
5
5
  exports.IsHubId = IsHubId;
6
6
  const common_1 = require("@nestjs/common");
7
7
  const swagger_1 = require("@nestjs/swagger");
8
8
  const class_validator_1 = require("class-validator");
9
9
  const itlab_functions_1 = require("itlab-functions");
10
- const exceptions_1 = require("../exceptions");
10
+ const exceptions_1 = require("../../exceptions");
11
11
  /**
12
- * @class ParseHubIdPipe
13
- *
14
12
  * Pipe that validates and transforms a route parameter into a valid HubId string.
15
- * Throws a `BadParameterException` if the input does not match the expected ID format.
13
+ * Throws a `BadParameterException` if the input does not match the expected format.
16
14
  */
17
15
  class ParseHubIdPipe {
18
16
  constructor(parameterName) {
@@ -20,42 +18,41 @@ class ParseHubIdPipe {
20
18
  }
21
19
  /**
22
20
  * @param {unknown} inputValue - Raw route parameter value.
23
- * @returns {string} - Validated HubId.
21
+ * @returns {string} - Validated HubId string.
24
22
  * @throws {BadParameterException} - If validation fails.
25
23
  */
26
24
  transform(inputValue) {
27
- if ((0, itlab_functions_1.isHubId)(inputValue)) {
25
+ if ((0, itlab_functions_1.isHubId)(inputValue))
28
26
  return String(inputValue);
29
- }
30
27
  throw new exceptions_1.BadParameterException(this.parameterName);
31
28
  }
32
29
  }
33
30
  /**
34
- * Creates a parameter decorator that validates a route parameter as a HubId.
31
+ * Parameter decorator that validates a route parameter as a HubId.
35
32
  *
36
- * @param {string} parameterName - Name of the parameter to validate.
33
+ * @param {string} parameterName - The name of the route parameter
37
34
  * @returns {ParameterDecorator}
38
35
  */
39
36
  function HubIdParam(parameterName) {
40
37
  return (0, common_1.Param)(parameterName, new ParseHubIdPipe(parameterName));
41
38
  }
42
39
  /**
43
- * Combines Swagger metadata and error response for HubId parameters.
40
+ * Decorator to add Swagger metadata and error response for HubId parameters.
44
41
  *
45
- * @param {string} parameterName - Name of the parameter for docs/errors.
46
- * @returns {MethodDecorator}
42
+ * @param {string} parameterName - The route parameter name
43
+ * @returns {MethodDecorator & ClassDecorator}
47
44
  */
48
- function ApiHubId(parameterName) {
45
+ function ApiHubIdParam(parameterName) {
49
46
  return (0, common_1.applyDecorators)((0, swagger_1.ApiParam)({
50
47
  name: parameterName,
51
48
  example: 'example-hub-id',
52
- description: 'A valid HubId string (e.g., kebab-case ID format)',
49
+ description: 'A valid HubId string (kebab-case ID format).',
53
50
  }), (0, exceptions_1.ApiBadParameterResponse)(parameterName));
54
51
  }
55
52
  /**
56
- * Decorator for validating DTO properties as HubId using class-validator.
53
+ * Decorator to validate DTO properties as HubId using class-validator.
57
54
  *
58
- * @param {ValidationOptions} [options] - Optional validation settings.
55
+ * @param {ValidationOptions} options - Optional validation options
59
56
  * @returns {PropertyDecorator}
60
57
  */
61
58
  function IsHubId(options) {
@@ -0,0 +1,22 @@
1
+ import { HubResource } from '../../hub-resource.enum';
2
+ /**
3
+ * Parameter decorator to validate and transform a route parameter as a HubResource.
4
+ *
5
+ * @param {string} parameterName - Route parameter name
6
+ * @returns {ParameterDecorator}
7
+ */
8
+ export declare function HubResourceParam(parameterName: string): ParameterDecorator;
9
+ /**
10
+ * Adds Swagger metadata for HubResource parameters.
11
+ *
12
+ * @param {string} parameterName - Parameter name for docs/errors
13
+ * @returns {MethodDecorator & ClassDecorator}
14
+ */
15
+ export declare function ApiHubResourceParam(parameterName: string): MethodDecorator & ClassDecorator;
16
+ /**
17
+ * Type guard to determine if a value is a valid HubResource.
18
+ *
19
+ * @param {unknown} value - Value to validate
20
+ * @returns {boolean} True if the value is a valid HubResource
21
+ */
22
+ export declare function isHubResource(value: unknown): value is HubResource;
@@ -1,51 +1,50 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.HubResourceParam = HubResourceParam;
4
- exports.ApiHubResource = ApiHubResource;
4
+ exports.ApiHubResourceParam = ApiHubResourceParam;
5
5
  exports.isHubResource = isHubResource;
6
6
  const common_1 = require("@nestjs/common");
7
7
  const swagger_1 = require("@nestjs/swagger");
8
8
  const class_validator_1 = require("class-validator");
9
- const exceptions_1 = require("../exceptions");
10
- const hub_resource_enum_1 = require("../hub-resource.enum");
9
+ const exceptions_1 = require("../../exceptions");
10
+ const hub_resource_enum_1 = require("../../hub-resource.enum");
11
11
  /**
12
- * @class ParseHubResourcePipe
13
- *
14
- * Pipe that validates and transforms a route parameter into a valid `HubResource` string.
15
- * Throws `BadParameterException` for unsupported resource identifiers.
12
+ * Pipe that validates and transforms a route parameter into a valid HubResource.
13
+ * Throws BadParameterException for unsupported resource identifiers.
16
14
  */
17
15
  class ParseHubResourcePipe {
18
16
  constructor(parameterName) {
19
17
  this.parameterName = parameterName;
20
18
  }
21
19
  /**
22
- * @param {unknown} inputValue - Route parameter to validate.
23
- * @returns {string} - Validated HubResource.
24
- * @throws {BadParameterException} - If input is invalid.
20
+ * Transform route parameter into a validated HubResource string.
21
+ *
22
+ * @param {unknown} inputValue - Raw route parameter value
23
+ * @returns {string} Validated HubResource string
24
+ * @throws {BadParameterException} if input is invalid
25
25
  */
26
26
  transform(inputValue) {
27
- if (isHubResource(inputValue)) {
27
+ if (isHubResource(inputValue))
28
28
  return String(inputValue);
29
- }
30
29
  throw new exceptions_1.BadParameterException(this.parameterName);
31
30
  }
32
31
  }
33
32
  /**
34
- * Decorator to validate and transform a route parameter as a HubResource.
33
+ * Parameter decorator to validate and transform a route parameter as a HubResource.
35
34
  *
36
- * @param {string} parameterName - Name of the parameter to validate.
35
+ * @param {string} parameterName - Route parameter name
37
36
  * @returns {ParameterDecorator}
38
37
  */
39
38
  function HubResourceParam(parameterName) {
40
39
  return (0, common_1.Param)(parameterName, new ParseHubResourcePipe(parameterName));
41
40
  }
42
41
  /**
43
- * Adds Swagger metadata and error documentation for HubResource parameters.
42
+ * Adds Swagger metadata for HubResource parameters.
44
43
  *
45
- * @param {string} parameterName - Parameter name for docs/errors.
44
+ * @param {string} parameterName - Parameter name for docs/errors
46
45
  * @returns {MethodDecorator & ClassDecorator}
47
46
  */
48
- function ApiHubResource(parameterName) {
47
+ function ApiHubResourceParam(parameterName) {
49
48
  return (0, common_1.applyDecorators)((0, swagger_1.ApiParam)({
50
49
  name: parameterName,
51
50
  enum: hub_resource_enum_1.HubResource,
@@ -53,10 +52,10 @@ function ApiHubResource(parameterName) {
53
52
  }), (0, exceptions_1.ApiBadParameterResponse)(parameterName));
54
53
  }
55
54
  /**
56
- * Determines if a value is a valid HubResource.
55
+ * Type guard to determine if a value is a valid HubResource.
57
56
  *
58
- * @param {unknown} value - value to validate.
59
- * @returns {boolean} - True if valid.
57
+ * @param {unknown} value - Value to validate
58
+ * @returns {boolean} True if the value is a valid HubResource
60
59
  */
61
60
  function isHubResource(value) {
62
61
  return (0, class_validator_1.isString)(value) && hub_resource_enum_1.HUB_RESOURCES.includes(value);
@@ -0,0 +1,3 @@
1
+ export * from './hub-id.pipe';
2
+ export * from './hub-resource.pipe';
3
+ export * from './mongo-id.pipe';
@@ -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("./hub-id.pipe"), exports);
18
+ __exportStar(require("./hub-resource.pipe"), exports);
19
+ __exportStar(require("./mongo-id.pipe"), exports);
@@ -0,0 +1,15 @@
1
+ /**
2
+ * Parameter decorator to validate a route parameter as a MongoId.
3
+ *
4
+ * @param {string} parameterName - Name of the parameter
5
+ * @returns {ParameterDecorator}
6
+ */
7
+ export declare function MongoIdParam(parameterName: string): ParameterDecorator;
8
+ /**
9
+ * Adds Swagger metadata for MongoId parameters.
10
+ *
11
+ * @param {string} parameterName - Parameter name for docs/errors
12
+ * @param {string} description - Optional custom description
13
+ * @returns {MethodDecorator & ClassDecorator}
14
+ */
15
+ export declare function ApiMongoIdParam(parameterName: string, description?: string): MethodDecorator & ClassDecorator;
@@ -0,0 +1,52 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.MongoIdParam = MongoIdParam;
4
+ exports.ApiMongoIdParam = ApiMongoIdParam;
5
+ const common_1 = require("@nestjs/common");
6
+ const swagger_1 = require("@nestjs/swagger");
7
+ const class_validator_1 = require("class-validator");
8
+ const exceptions_1 = require("../../exceptions");
9
+ /**
10
+ * Pipe that validates and transforms a route parameter into a MongoDB ObjectId string.
11
+ * Throws BadParameterException if the input is not a valid ObjectId.
12
+ */
13
+ class ParseMongoIdPipe {
14
+ constructor(parameterName) {
15
+ this.parameterName = parameterName;
16
+ }
17
+ /**
18
+ * Transform route parameter into validated Mongo ObjectId string.
19
+ *
20
+ * @param {unknown} inputValue - Route parameter value
21
+ * @returns {string} Validated Mongo ObjectId string
22
+ * @throws {BadParameterException} if inputValue is invalid
23
+ */
24
+ transform(inputValue) {
25
+ if ((0, class_validator_1.isMongoId)(inputValue))
26
+ return String(inputValue);
27
+ throw new exceptions_1.BadParameterException(this.parameterName);
28
+ }
29
+ }
30
+ /**
31
+ * Parameter decorator to validate a route parameter as a MongoId.
32
+ *
33
+ * @param {string} parameterName - Name of the parameter
34
+ * @returns {ParameterDecorator}
35
+ */
36
+ function MongoIdParam(parameterName) {
37
+ return (0, common_1.Param)(parameterName, new ParseMongoIdPipe(parameterName));
38
+ }
39
+ /**
40
+ * Adds Swagger metadata for MongoId parameters.
41
+ *
42
+ * @param {string} parameterName - Parameter name for docs/errors
43
+ * @param {string} description - Optional custom description
44
+ * @returns {MethodDecorator & ClassDecorator}
45
+ */
46
+ function ApiMongoIdParam(parameterName, description) {
47
+ return (0, common_1.applyDecorators)((0, swagger_1.ApiParam)({
48
+ name: parameterName,
49
+ example: '507f1f77bcf86cd799439011',
50
+ description: description || `A valid MongoDB ObjectId for the "${parameterName}" parameter.`,
51
+ }), (0, exceptions_1.ApiBadParameterResponse)(parameterName));
52
+ }
@@ -0,0 +1,3 @@
1
+ export * from './mongo-ids.pipe';
2
+ export * from './optional-boolean.pipe';
3
+ export * from './optional-include-drafts.pipe';
@@ -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("./mongo-ids.pipe"), exports);
18
+ __exportStar(require("./optional-boolean.pipe"), exports);
19
+ __exportStar(require("./optional-include-drafts.pipe"), exports);
@@ -0,0 +1,22 @@
1
+ /**
2
+ * MongoIdsQuery
3
+ *
4
+ * Creates a NestJS @Query decorator that automatically applies the
5
+ * ParseMongoIdsPipe. Controller methods will receive an array
6
+ * of valid MongoDB ID strings, even if the query parameter is omitted.
7
+ *
8
+ * @param {string} propertyName - The name of the query parameter to bind.
9
+ * @returns {ParameterDecorator} - A NestJS parameter decorator for controller methods.
10
+ */
11
+ export declare function MongoIdsQuery(propertyName: string): ParameterDecorator;
12
+ /**
13
+ * ApiMongoIdsQuery
14
+ *
15
+ * Swagger/OpenAPI documentation decorator for optional Mongo ID query parameters.
16
+ * Marks the query as optional and documents it with a clear description.
17
+ *
18
+ * @param {string} propertyName - The query parameter name to display in Swagger docs.
19
+ * @param {string} [description] - Optional human-readable explanation for the parameter.
20
+ * @returns {MethodDecorator & ClassDecorator} - A combined decorator for use on routes or controllers.
21
+ */
22
+ export declare function ApiMongoIdsQuery(propertyName: string, description?: string): MethodDecorator & ClassDecorator;
@@ -0,0 +1,60 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.MongoIdsQuery = MongoIdsQuery;
4
+ exports.ApiMongoIdsQuery = ApiMongoIdsQuery;
5
+ const common_1 = require("@nestjs/common");
6
+ const swagger_1 = require("@nestjs/swagger");
7
+ const class_validator_1 = require("class-validator");
8
+ /**
9
+ * ParseMongoIdsPipe
10
+ *
11
+ * A NestJS pipe that ensures query parameters expected as MongoDB IDs
12
+ * are filtered and validated. It safely converts an array of raw query
13
+ * values into an array of valid MongoDB ID strings.
14
+ *
15
+ * This helps controllers avoid manual type-checking and validation,
16
+ * improving consistency and reducing the chance of runtime errors.
17
+ */
18
+ class ParseMongoIdsPipe {
19
+ /**
20
+ * Converts the raw input value into an array of valid MongoDB ID strings.
21
+ *
22
+ * @param {unknown} inputValue - The raw value received from the request query string.
23
+ * @returns {string[]} - Array of valid MongoDB IDs; returns empty array if input is invalid.
24
+ */
25
+ transform(inputValue) {
26
+ const inputValues = Array.isArray(inputValue) ? inputValue : [inputValue];
27
+ return inputValues.filter((value) => (0, class_validator_1.isMongoId)(value)).map(String);
28
+ }
29
+ }
30
+ /**
31
+ * MongoIdsQuery
32
+ *
33
+ * Creates a NestJS @Query decorator that automatically applies the
34
+ * ParseMongoIdsPipe. Controller methods will receive an array
35
+ * of valid MongoDB ID strings, even if the query parameter is omitted.
36
+ *
37
+ * @param {string} propertyName - The name of the query parameter to bind.
38
+ * @returns {ParameterDecorator} - A NestJS parameter decorator for controller methods.
39
+ */
40
+ function MongoIdsQuery(propertyName) {
41
+ return (0, common_1.Query)(propertyName, new ParseMongoIdsPipe());
42
+ }
43
+ /**
44
+ * ApiMongoIdsQuery
45
+ *
46
+ * Swagger/OpenAPI documentation decorator for optional Mongo ID query parameters.
47
+ * Marks the query as optional and documents it with a clear description.
48
+ *
49
+ * @param {string} propertyName - The query parameter name to display in Swagger docs.
50
+ * @param {string} [description] - Optional human-readable explanation for the parameter.
51
+ * @returns {MethodDecorator & ClassDecorator} - A combined decorator for use on routes or controllers.
52
+ */
53
+ function ApiMongoIdsQuery(propertyName, description) {
54
+ return (0, common_1.applyDecorators)((0, swagger_1.ApiQuery)({
55
+ required: true,
56
+ name: propertyName,
57
+ description: description || `Array of MongoDB IDs`,
58
+ default: false,
59
+ }));
60
+ }
@@ -0,0 +1,29 @@
1
+ /**
2
+ * OptionalBooleanQuery
3
+ *
4
+ * Factory function that creates a NestJS query decorator for boolean flags.
5
+ * It automatically applies the `ParseOptionalBooleanPipe`, so controller methods
6
+ * receive properly typed booleans instead of raw strings.
7
+ *
8
+ * This prevents controllers from having to manually parse query string values
9
+ * and keeps intent clear at the method signature level.
10
+ *
11
+ * @param {string} propertyName - The name of the query parameter to bind.
12
+ * @returns {ParameterDecorator} - A NestJS parameter decorator for controller methods.
13
+ */
14
+ export declare function OptionalBooleanQuery(propertyName: string): ParameterDecorator;
15
+ /**
16
+ * ApiOptionalBooleanQuery
17
+ *
18
+ * Swagger documentation helper for optional boolean query parameters.
19
+ * By applying this decorator, the parameter will appear in API documentation
20
+ * with clear details, marked as optional, and defaulting to `false`.
21
+ *
22
+ * This ensures consumers of the API understand that the flag exists,
23
+ * what it controls, and that its omission is safe.
24
+ *
25
+ * @param {string} propertyName - The query parameter name to display in Swagger docs.
26
+ * @param {string} [description] - Optional human-readable explanation for the parameter.
27
+ * @returns {MethodDecorator & ClassDecorator} - A combined decorator for use on routes or controllers.
28
+ */
29
+ export declare function ApiOptionalBooleanQuery(propertyName: string, description?: string): MethodDecorator & ClassDecorator;
@@ -0,0 +1,72 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.OptionalBooleanQuery = OptionalBooleanQuery;
4
+ exports.ApiOptionalBooleanQuery = ApiOptionalBooleanQuery;
5
+ const common_1 = require("@nestjs/common");
6
+ const swagger_1 = require("@nestjs/swagger");
7
+ // Standardize boolean input formats (string, number, or boolean)
8
+ const trueValues = [true, 'true', 1, '1', 'yes', 'on'];
9
+ /**
10
+ * ParseOptionalBooleanPipe
11
+ *
12
+ * Custom NestJS pipe that converts a query parameter into a boolean value.
13
+ * This is particularly useful for endpoints where a query string value
14
+ * (e.g., "true", "1", "false", "0") should be interpreted as a boolean flag.
15
+ *
16
+ * The pipe ensures consistent controller input by avoiding raw strings,
17
+ * which helps prevent subtle bugs where "true" is treated as truthy but
18
+ * not equal to `true` (boolean).
19
+ */
20
+ class ParseOptionalBooleanPipe {
21
+ /**
22
+ * Converts the raw input value into a boolean.
23
+ *
24
+ * Accepts `true`, `"true"`, `1`, `"1"`, `"yes"` or `"on"` as `true`.
25
+ * All other values (including `undefined`, `"false"`, `"0"`, or unexpected input) are interpreted as `false`.
26
+ *
27
+ * @param {unknown} inputValue - The raw value received from the request query string.
28
+ * @returns {boolean} - `true` if the input explicitly indicates truth, otherwise `false`.
29
+ */
30
+ transform(inputValue) {
31
+ return trueValues.some((trueValue) => trueValue === inputValue);
32
+ }
33
+ }
34
+ /**
35
+ * OptionalBooleanQuery
36
+ *
37
+ * Factory function that creates a NestJS query decorator for boolean flags.
38
+ * It automatically applies the `ParseOptionalBooleanPipe`, so controller methods
39
+ * receive properly typed booleans instead of raw strings.
40
+ *
41
+ * This prevents controllers from having to manually parse query string values
42
+ * and keeps intent clear at the method signature level.
43
+ *
44
+ * @param {string} propertyName - The name of the query parameter to bind.
45
+ * @returns {ParameterDecorator} - A NestJS parameter decorator for controller methods.
46
+ */
47
+ function OptionalBooleanQuery(propertyName) {
48
+ return (0, common_1.Query)(propertyName, new ParseOptionalBooleanPipe());
49
+ }
50
+ /**
51
+ * ApiOptionalBooleanQuery
52
+ *
53
+ * Swagger documentation helper for optional boolean query parameters.
54
+ * By applying this decorator, the parameter will appear in API documentation
55
+ * with clear details, marked as optional, and defaulting to `false`.
56
+ *
57
+ * This ensures consumers of the API understand that the flag exists,
58
+ * what it controls, and that its omission is safe.
59
+ *
60
+ * @param {string} propertyName - The query parameter name to display in Swagger docs.
61
+ * @param {string} [description] - Optional human-readable explanation for the parameter.
62
+ * @returns {MethodDecorator & ClassDecorator} - A combined decorator for use on routes or controllers.
63
+ */
64
+ function ApiOptionalBooleanQuery(propertyName, description) {
65
+ return (0, common_1.applyDecorators)((0, swagger_1.ApiQuery)({
66
+ required: false,
67
+ default: false,
68
+ name: propertyName,
69
+ description: description || `Optional boolean flag`,
70
+ schema: { type: 'boolean', default: false, nullable: true },
71
+ }));
72
+ }
@@ -0,0 +1,28 @@
1
+ /**
2
+ * OptionalIncludeDraftsQuery
3
+ *
4
+ * NestJS parameter decorator for extracting the `includeDrafts` query parameter
5
+ * from incoming requests. The decorator applies the `ParseOptionalBooleanPipe`
6
+ * internally (through `OptionalBooleanQuery`) to ensure the controller receives
7
+ * a properly typed boolean rather than a raw string.
8
+ *
9
+ * This avoids boilerplate parsing logic inside controllers and makes the
10
+ * method signature self-documenting — any reader can immediately see that
11
+ * `includeDrafts` is expected as a boolean flag.
12
+ *
13
+ * @returns {ParameterDecorator} - A query parameter decorator for use on controller methods.
14
+ */
15
+ export declare function OptionalIncludeDraftsQuery(): ParameterDecorator;
16
+ /**
17
+ * ApiOptionalIncludeDraftsQuery
18
+ *
19
+ * Swagger documentation decorator for the `includeDrafts` query parameter.
20
+ * This marks the parameter as optional, provides a clear description, and
21
+ * specifies a default value of `false`. Adding this ensures that API
22
+ * consumers can see the parameter in the generated docs and understand
23
+ * its behavior without digging into code.
24
+ *
25
+ * @returns {MethodDecorator & ClassDecorator} - A decorator usable on routes or controllers
26
+ * to enhance Swagger-generated documentation.
27
+ */
28
+ export declare function ApiOptionalIncludeDraftsQuery(): MethodDecorator & ClassDecorator;
@@ -0,0 +1,38 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.OptionalIncludeDraftsQuery = OptionalIncludeDraftsQuery;
4
+ exports.ApiOptionalIncludeDraftsQuery = ApiOptionalIncludeDraftsQuery;
5
+ const optional_boolean_pipe_1 = require("./optional-boolean.pipe");
6
+ const propertyName = 'includeDrafts';
7
+ /**
8
+ * OptionalIncludeDraftsQuery
9
+ *
10
+ * NestJS parameter decorator for extracting the `includeDrafts` query parameter
11
+ * from incoming requests. The decorator applies the `ParseOptionalBooleanPipe`
12
+ * internally (through `OptionalBooleanQuery`) to ensure the controller receives
13
+ * a properly typed boolean rather than a raw string.
14
+ *
15
+ * This avoids boilerplate parsing logic inside controllers and makes the
16
+ * method signature self-documenting — any reader can immediately see that
17
+ * `includeDrafts` is expected as a boolean flag.
18
+ *
19
+ * @returns {ParameterDecorator} - A query parameter decorator for use on controller methods.
20
+ */
21
+ function OptionalIncludeDraftsQuery() {
22
+ return (0, optional_boolean_pipe_1.OptionalBooleanQuery)(propertyName);
23
+ }
24
+ /**
25
+ * ApiOptionalIncludeDraftsQuery
26
+ *
27
+ * Swagger documentation decorator for the `includeDrafts` query parameter.
28
+ * This marks the parameter as optional, provides a clear description, and
29
+ * specifies a default value of `false`. Adding this ensures that API
30
+ * consumers can see the parameter in the generated docs and understand
31
+ * its behavior without digging into code.
32
+ *
33
+ * @returns {MethodDecorator & ClassDecorator} - A decorator usable on routes or controllers
34
+ * to enhance Swagger-generated documentation.
35
+ */
36
+ function ApiOptionalIncludeDraftsQuery() {
37
+ return (0, optional_boolean_pipe_1.ApiOptionalBooleanQuery)(propertyName, 'Boolean flag to indicate whether draft resources should be included in the response.');
38
+ }