itlab-internal-services 2.14.6 → 2.15.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 (269) hide show
  1. package/dist/classes/document-merger.class.d.ts +26 -15
  2. package/dist/classes/document-merger.class.js +45 -25
  3. package/dist/classes/document-updater.class.d.ts +21 -17
  4. package/dist/classes/document-updater.class.js +28 -20
  5. package/dist/controllers/favicon.controller.d.ts +9 -7
  6. package/dist/controllers/favicon.controller.js +20 -32
  7. package/dist/controllers/liveness-probe.controller.d.ts +8 -8
  8. package/dist/controllers/liveness-probe.controller.js +11 -26
  9. package/dist/decorators/account.decorator.d.ts +13 -3
  10. package/dist/decorators/account.decorator.js +21 -8
  11. package/dist/decorators/jwt.decorator.d.ts +7 -5
  12. package/dist/decorators/jwt.decorator.js +15 -10
  13. package/dist/exceptions/bad-body.exception.d.ts +13 -11
  14. package/dist/exceptions/bad-body.exception.js +20 -16
  15. package/dist/exceptions/bad-parameter.exception.d.ts +15 -10
  16. package/dist/exceptions/bad-parameter.exception.js +23 -15
  17. package/dist/exceptions/duplicate.exception.d.ts +15 -10
  18. package/dist/exceptions/duplicate.exception.js +22 -15
  19. package/dist/factories/virtuals.factory.d.ts +48 -58
  20. package/dist/factories/virtuals.factory.js +87 -73
  21. package/dist/functions/create-duplicate-checker.function.d.ts +24 -11
  22. package/dist/functions/create-duplicate-checker.function.js +36 -30
  23. package/dist/functions/create-internal-axios-client.function.d.ts +33 -0
  24. package/dist/functions/create-internal-axios-client.function.js +30 -0
  25. package/dist/functions/create-schema-transformer.function.d.ts +20 -8
  26. package/dist/functions/create-schema-transformer.function.js +26 -12
  27. package/dist/functions/index.d.ts +1 -1
  28. package/dist/functions/index.js +3 -3
  29. package/dist/http-logger.middleware.d.ts +6 -5
  30. package/dist/http-logger.middleware.js +24 -19
  31. package/dist/hub-resource.enum.d.ts +26 -10
  32. package/dist/hub-resource.enum.js +26 -10
  33. package/dist/likeable.interface.d.ts +21 -19
  34. package/dist/likeable.interface.js +17 -18
  35. package/dist/models/account-entity.model.d.ts +34 -6
  36. package/dist/models/account-entity.model.js +25 -6
  37. package/dist/models/filter/index.d.ts +6 -49
  38. package/dist/models/filter/index.js +19 -85
  39. package/dist/models/filter/limit.property.d.ts +16 -2
  40. package/dist/models/filter/limit.property.js +14 -3
  41. package/dist/models/filter/pagination-filter.interfaces.d.ts +22 -0
  42. package/dist/models/filter/skip.property.d.ts +14 -2
  43. package/dist/models/filter/skip.property.js +13 -3
  44. package/dist/models/filter/sort-direction.property.d.ts +14 -2
  45. package/dist/models/filter/sort-direction.property.js +12 -6
  46. package/dist/models/filter/sort-field.property.d.ts +13 -2
  47. package/dist/models/filter/sort-field.property.js +9 -5
  48. package/dist/models/filter/sorting-filter.interfaces.d.ts +20 -0
  49. package/dist/models/index.d.ts +0 -4
  50. package/dist/models/index.js +1 -9
  51. package/dist/models/search-result.model.d.ts +18 -13
  52. package/dist/models/search-result.model.js +21 -12
  53. package/dist/models/thumbnail/alt.property.d.ts +5 -4
  54. package/dist/models/thumbnail/alt.property.js +7 -8
  55. package/dist/models/thumbnail/background.property.d.ts +6 -4
  56. package/dist/models/thumbnail/background.property.js +16 -14
  57. package/dist/models/thumbnail/contain.property.d.ts +5 -4
  58. package/dist/models/thumbnail/contain.property.js +5 -8
  59. package/dist/models/thumbnail/index.d.ts +7 -33
  60. package/dist/models/thumbnail/index.js +20 -73
  61. package/dist/models/thumbnail/max-height.property.d.ts +5 -4
  62. package/dist/models/thumbnail/max-height.property.js +7 -10
  63. package/dist/models/thumbnail/max-width.property.d.ts +5 -4
  64. package/dist/models/thumbnail/max-width.property.js +7 -10
  65. package/dist/models/thumbnail/src.property.d.ts +5 -4
  66. package/dist/models/thumbnail/src.property.js +5 -10
  67. package/dist/models/thumbnail/thumbnail.model.d.ts +29 -0
  68. package/dist/models/thumbnail/thumbnail.model.js +68 -0
  69. package/dist/modules/authentication/authentication-module-options.interface.d.ts +31 -4
  70. package/dist/modules/authentication/authentication.module-definition.d.ts +8 -0
  71. package/dist/modules/authentication/authentication.module-definition.js +8 -0
  72. package/dist/modules/authentication/authentication.module.js +1 -1
  73. package/dist/modules/authentication/guards/auth.guard.d.ts +25 -10
  74. package/dist/modules/authentication/guards/auth.guard.js +56 -21
  75. package/dist/modules/authentication/guards/index.d.ts +1 -1
  76. package/dist/modules/authentication/guards/index.js +4 -4
  77. package/dist/modules/authentication/guards/internal.guard.d.ts +23 -10
  78. package/dist/modules/authentication/guards/internal.guard.js +32 -12
  79. package/dist/modules/authentication/guards/permissions.guard.d.ts +36 -0
  80. package/dist/modules/authentication/guards/permissions.guard.js +93 -0
  81. package/dist/modules/authentication/guards/public.guard.d.ts +11 -4
  82. package/dist/modules/authentication/guards/public.guard.js +17 -4
  83. package/dist/modules/authentication/index.d.ts +2 -2
  84. package/dist/modules/authentication/index.js +1 -1
  85. package/dist/modules/authentication/inject-auth-options.decorator.d.ts +1 -2
  86. package/dist/modules/authentication/inject-auth-options.decorator.js +4 -3
  87. package/dist/modules/cache/cache-module-options.interface.d.ts +35 -5
  88. package/dist/modules/cache/cache-response.interceptor.d.ts +8 -11
  89. package/dist/modules/cache/cache-response.interceptor.js +13 -17
  90. package/dist/modules/cache/cache.module-definition.d.ts +12 -0
  91. package/dist/modules/cache/cache.module-definition.js +12 -0
  92. package/dist/modules/cache/cache.module.d.ts +30 -4
  93. package/dist/modules/cache/cache.module.js +34 -5
  94. package/dist/modules/cache/cache.service.d.ts +31 -33
  95. package/dist/modules/cache/cache.service.js +58 -54
  96. package/dist/modules/comment/comment.controller.d.ts +22 -11
  97. package/dist/modules/comment/comment.controller.js +31 -12
  98. package/dist/modules/comment/comment.model.d.ts +29 -0
  99. package/dist/{models → modules/comment}/comment.model.js +15 -8
  100. package/dist/modules/comment/comment.module-definition.d.ts +45 -0
  101. package/dist/modules/comment/comment.module-definition.js +8 -0
  102. package/dist/modules/comment/comment.module.d.ts +14 -3
  103. package/dist/modules/comment/comment.module.js +35 -23
  104. package/dist/modules/comment/comment.service.d.ts +36 -40
  105. package/dist/modules/comment/comment.service.js +77 -80
  106. package/dist/modules/comment/index.d.ts +1 -0
  107. package/dist/modules/comment/index.js +3 -1
  108. package/dist/modules/content/content.module-definition.d.ts +5 -2
  109. package/dist/modules/content/content.module-definition.js +6 -4
  110. package/dist/modules/content/content.module.d.ts +26 -5
  111. package/dist/modules/content/content.module.js +34 -10
  112. package/dist/modules/content/content.property.d.ts +13 -0
  113. package/dist/modules/content/content.property.js +27 -0
  114. package/dist/modules/content/content.service.d.ts +30 -30
  115. package/dist/modules/content/content.service.js +85 -76
  116. package/dist/modules/content/index.d.ts +1 -0
  117. package/dist/modules/content/index.js +3 -1
  118. package/dist/modules/database/database-module-options.interface.d.ts +36 -4
  119. package/dist/modules/database/database.liveness-controller.d.ts +16 -8
  120. package/dist/modules/database/database.liveness-controller.js +24 -21
  121. package/dist/modules/database/database.module.d.ts +33 -1
  122. package/dist/modules/database/database.module.js +39 -8
  123. package/dist/modules/database/lock-service/lock.schema.d.ts +30 -0
  124. package/dist/modules/database/lock-service/lock.schema.js +14 -0
  125. package/dist/modules/database/lock-service/lock.service.d.ts +24 -14
  126. package/dist/modules/database/lock-service/lock.service.js +41 -35
  127. package/dist/modules/database/model-service/dbs/hub-account.db.d.ts +2 -2
  128. package/dist/modules/database/model-service/dbs/hub-account.db.js +1 -1
  129. package/dist/modules/database/model-service/dbs/hub-tech-radar.db.d.ts +5 -5
  130. package/dist/modules/database/model-service/dbs/hub-tech-radar.db.js +12 -12
  131. package/dist/modules/database/model-service/model.service.d.ts +45 -18
  132. package/dist/modules/database/model-service/model.service.js +63 -36
  133. package/dist/modules/database/populate-service/populate.service.d.ts +51 -27
  134. package/dist/modules/database/populate-service/populate.service.js +101 -51
  135. package/dist/modules/database/service-mapper-service/service-mapper.service.d.ts +18 -9
  136. package/dist/modules/database/service-mapper-service/service-mapper.service.js +28 -18
  137. package/dist/modules/fetch/fetch.module.d.ts +24 -2
  138. package/dist/modules/fetch/fetch.module.js +32 -12
  139. package/dist/modules/fetch/fetch.service.d.ts +145 -26
  140. package/dist/modules/fetch/fetch.service.js +256 -42
  141. package/dist/modules/index.d.ts +1 -0
  142. package/dist/modules/index.js +1 -0
  143. package/dist/modules/like/like.controller.d.ts +23 -20
  144. package/dist/modules/like/like.controller.js +50 -29
  145. package/dist/modules/like/like.module-definition.d.ts +20 -0
  146. package/dist/modules/like/like.module-definition.js +8 -0
  147. package/dist/modules/like/like.module.d.ts +15 -4
  148. package/dist/modules/like/like.module.js +29 -11
  149. package/dist/modules/like/like.service.d.ts +37 -34
  150. package/dist/modules/like/like.service.js +51 -55
  151. package/dist/modules/mail/dtos/auth-login-token-mail.dto.d.ts +15 -0
  152. package/dist/modules/mail/dtos/auth-login-token-mail.dto.js +2 -0
  153. package/dist/modules/mail/dtos/auth-password-reset-mail.dto.d.ts +15 -0
  154. package/dist/modules/mail/dtos/auth-password-reset-mail.dto.js +2 -0
  155. package/dist/modules/mail/dtos/event-cancel-mail.dto.d.ts +25 -0
  156. package/dist/modules/mail/dtos/event-cancel-mail.dto.js +2 -0
  157. package/dist/modules/mail/dtos/event-invite-mail.dto.d.ts +27 -0
  158. package/dist/modules/mail/dtos/event-invite-mail.dto.js +2 -0
  159. package/dist/modules/mail/dtos/idea-status-updated-mail.dto.d.ts +22 -0
  160. package/dist/modules/mail/dtos/idea-status-updated-mail.dto.js +2 -0
  161. package/dist/modules/mail/dtos/idea-submitted-mail.dto.d.ts +11 -0
  162. package/dist/modules/mail/dtos/idea-submitted-mail.dto.js +2 -0
  163. package/dist/modules/mail/dtos/index.d.ts +14 -0
  164. package/dist/modules/mail/dtos/index.js +30 -0
  165. package/dist/modules/mail/dtos/lunch-roulette-cancel-mail.dto.d.ts +7 -0
  166. package/dist/modules/mail/dtos/lunch-roulette-cancel-mail.dto.js +2 -0
  167. package/dist/modules/mail/dtos/lunch-roulette-matched-mail.dto.d.ts +19 -0
  168. package/dist/modules/mail/dtos/lunch-roulette-matched-mail.dto.js +2 -0
  169. package/dist/modules/mail/dtos/lunch-roulette-submitted-mail.dto.d.ts +17 -0
  170. package/dist/modules/mail/dtos/lunch-roulette-submitted-mail.dto.js +2 -0
  171. package/dist/modules/mail/dtos/lunch-roulette-unmatched-mail.dto.d.ts +7 -0
  172. package/dist/modules/mail/dtos/lunch-roulette-unmatched-mail.dto.js +2 -0
  173. package/dist/modules/mail/dtos/newsletter-issue-mail.dto.d.ts +26 -0
  174. package/dist/modules/mail/dtos/newsletter-issue-mail.dto.js +2 -0
  175. package/dist/modules/mail/dtos/newsletter-subscribed-mail.dto.d.ts +7 -0
  176. package/dist/modules/mail/dtos/newsletter-subscribed-mail.dto.js +2 -0
  177. package/dist/modules/mail/dtos/newsletter-unsubscribed-mail.dto.d.ts +7 -0
  178. package/dist/modules/mail/dtos/newsletter-unsubscribed-mail.dto.js +2 -0
  179. package/dist/modules/mail/dtos/notification-mail.dto.d.ts +21 -0
  180. package/dist/modules/mail/dtos/notification-mail.dto.js +2 -0
  181. package/dist/modules/mail/index.d.ts +2 -0
  182. package/dist/modules/mail/index.js +16 -0
  183. package/dist/modules/mail/mail.module.d.ts +24 -2
  184. package/dist/modules/mail/mail.module.js +32 -12
  185. package/dist/modules/mail/mail.service.d.ts +123 -14
  186. package/dist/modules/mail/mail.service.js +175 -24
  187. package/dist/modules/mail/models/index.d.ts +1 -0
  188. package/dist/modules/mail/models/index.js +17 -0
  189. package/dist/{models → modules/mail/models}/mail-recipient.model.d.ts +0 -1
  190. package/dist/{models → modules/mail/models}/mail-recipient.model.js +0 -1
  191. package/dist/modules/notification/dtos/index.d.ts +1 -0
  192. package/dist/modules/notification/dtos/index.js +17 -0
  193. package/dist/modules/notification/dtos/schedule-notification.dto.d.ts +77 -0
  194. package/dist/modules/notification/dtos/schedule-notification.dto.js +2 -0
  195. package/dist/modules/notification/index.d.ts +1 -0
  196. package/dist/modules/notification/index.js +15 -0
  197. package/dist/modules/notification/notification.module-definition.d.ts +5 -2
  198. package/dist/modules/notification/notification.module-definition.js +6 -4
  199. package/dist/modules/notification/notification.module.d.ts +29 -5
  200. package/dist/modules/notification/notification.module.js +37 -10
  201. package/dist/modules/notification/notification.service.d.ts +23 -19
  202. package/dist/modules/notification/notification.service.js +47 -31
  203. package/dist/modules/pass/dtos/create-guild-member-pass.dto.d.ts +33 -0
  204. package/dist/modules/pass/dtos/create-guild-member-pass.dto.js +2 -0
  205. package/dist/modules/pass/dtos/create-team-member-pass.dto.d.ts +57 -0
  206. package/dist/modules/pass/dtos/create-team-member-pass.dto.js +2 -0
  207. package/dist/modules/pass/dtos/index.d.ts +2 -0
  208. package/dist/modules/pass/dtos/index.js +18 -0
  209. package/dist/modules/pass/index.d.ts +3 -0
  210. package/dist/modules/pass/index.js +22 -0
  211. package/dist/modules/pass/pass.module.d.ts +32 -0
  212. package/dist/modules/pass/pass.module.js +58 -0
  213. package/dist/modules/pass/pass.service.d.ts +122 -0
  214. package/dist/modules/pass/pass.service.js +237 -0
  215. package/dist/modules/search/dtos/index-search-document.dto.d.ts +47 -0
  216. package/dist/modules/search/dtos/index-search-document.dto.js +2 -0
  217. package/dist/modules/search/dtos/index.d.ts +1 -0
  218. package/dist/modules/search/dtos/index.js +17 -0
  219. package/dist/modules/search/index.d.ts +2 -1
  220. package/dist/modules/search/index.js +17 -4
  221. package/dist/modules/search/models/index.d.ts +1 -0
  222. package/dist/modules/search/models/index.js +17 -0
  223. package/dist/modules/search/models/search-document.model.d.ts +47 -0
  224. package/dist/modules/search/{search.models.js → models/search-document.model.js} +6 -36
  225. package/dist/modules/search/search.module-definition.d.ts +5 -2
  226. package/dist/modules/search/search.module-definition.js +6 -4
  227. package/dist/modules/search/search.module.d.ts +28 -5
  228. package/dist/modules/search/search.module.js +36 -10
  229. package/dist/modules/search/search.service.d.ts +29 -25
  230. package/dist/modules/search/search.service.js +66 -41
  231. package/dist/pipes/hub-id.pipe.d.ts +11 -18
  232. package/dist/pipes/hub-id.pipe.js +33 -40
  233. package/dist/pipes/hub-resource.pipe.d.ts +16 -8
  234. package/dist/pipes/hub-resource.pipe.js +39 -25
  235. package/dist/pipes/mongo-id.pipe.d.ts +8 -8
  236. package/dist/pipes/mongo-id.pipe.js +26 -23
  237. package/dist/swagger.config.d.ts +22 -15
  238. package/dist/swagger.config.js +44 -37
  239. package/dist/transform/boolean.transform.d.ts +4 -10
  240. package/dist/transform/boolean.transform.js +10 -16
  241. package/dist/transform/image-url.transform.d.ts +3 -8
  242. package/dist/transform/image-url.transform.js +5 -12
  243. package/dist/transform/index.d.ts +6 -6
  244. package/dist/transform/index.js +20 -13
  245. package/dist/transform/number.transform.d.ts +8 -12
  246. package/dist/transform/number.transform.js +17 -24
  247. package/dist/transform/string-array.transform.d.ts +9 -7
  248. package/dist/transform/string-array.transform.js +12 -12
  249. package/dist/transform/string.transform.d.ts +10 -15
  250. package/dist/transform/string.transform.js +14 -12
  251. package/dist/transform/timestamp.transform.d.ts +8 -15
  252. package/dist/transform/timestamp.transform.js +17 -26
  253. package/dist/viewable.interface.d.ts +21 -19
  254. package/dist/viewable.interface.js +17 -18
  255. package/package.json +14 -14
  256. package/dist/functions/configure-axios-instance.function.d.ts +0 -21
  257. package/dist/functions/configure-axios-instance.function.js +0 -20
  258. package/dist/models/comment.model.d.ts +0 -28
  259. package/dist/models/content.model.d.ts +0 -8
  260. package/dist/models/content.model.js +0 -22
  261. package/dist/models/scheduled-notification.model.d.ts +0 -87
  262. package/dist/models/scheduled-notification.model.js +0 -59
  263. package/dist/modules/authentication/guards/perms.guard.d.ts +0 -30
  264. package/dist/modules/authentication/guards/perms.guard.js +0 -63
  265. package/dist/modules/comment/comment-module-options.interface.d.ts +0 -10
  266. package/dist/modules/like/like-module-options.interface.d.ts +0 -5
  267. package/dist/modules/search/search.models.d.ts +0 -30
  268. /package/dist/{modules/comment/comment-module-options.interface.js → models/filter/pagination-filter.interfaces.js} +0 -0
  269. /package/dist/{modules/like/like-module-options.interface.js → models/filter/sorting-filter.interfaces.js} +0 -0
@@ -1,7 +1,15 @@
1
1
  import { Document, Model } from 'mongoose';
2
2
  /**
3
3
  * DocumentMerger
4
- * A service for merging documents in a collection by replacing occurrences of oldId with newId in specified fields
4
+ *
5
+ * Provides a utility to merge references within documents of a MongoDB collection by replacing
6
+ * all occurrences of an old identifier with a new identifier in specified fields.
7
+ *
8
+ * This class handles both single string references and arrays of references,
9
+ * ensuring unique values after the merge.
10
+ *
11
+ * @template T - Type of Mongoose Document
12
+ * @template Field - Keys of T excluding standard Document properties, representing the fields to update
5
13
  */
6
14
  export declare class DocumentMerger<T extends Document, Field extends keyof Omit<T, keyof Document>> {
7
15
  private readonly logger;
@@ -10,27 +18,30 @@ export declare class DocumentMerger<T extends Document, Field extends keyof Omit
10
18
  private readonly newId;
11
19
  private readonly fields;
12
20
  /**
13
- * DocumentMerger constructor
14
- * @param {Model<T>} model - The Mongoose model for the collection.
15
- * @param {string} oldId - The id of the document to be merged.
16
- * @param {string} newId - The id of the document to merge into.
17
- * @param {...Field[]} fields - The fields to be merged.
21
+ * Initializes the DocumentMerger with the collection model, IDs to merge, and target fields.
18
22
  *
19
- * @description Creates a new DocumentMerger instance.
23
+ * @param model - Mongoose model representing the target collection
24
+ * @param oldId - Identifier to be replaced in documents
25
+ * @param newId - Identifier to replace oldId with
26
+ * @param fields - List of document fields where replacements should occur
20
27
  */
21
28
  constructor(model: Model<T>, oldId: string, newId: string, ...fields: Field[]);
22
29
  /**
23
- * Merges documents in a collection by replacing occurrences of oldId with newId in specified fields.
30
+ * Executes the merge operation over all documents in the collection.
24
31
  *
25
- * Iterates over all documents in the collection, applying an optional transformation to each item.
26
- * For each specified field, if the field is a string and matches oldId, it is replaced with newId.
27
- * If the field is an array, occurrences of oldId are replaced with newId, ensuring uniqueness.
32
+ * Iterates asynchronously through each document using a cursor to avoid loading all documents at once.
33
+ * For each document:
34
+ * - Optionally applies a transformation function before merging.
35
+ * - Replaces occurrences of oldId with newId in each specified field.
36
+ * - If the field is a string matching oldId, it is replaced directly.
37
+ * - If the field is an array, each occurrence of oldId is replaced with newId,
38
+ * and duplicates are removed to maintain uniqueness.
39
+ * - Saves the updated document without modifying timestamp fields.
28
40
  *
29
- * @param {Function} [transform] - Optional function to transform each item before merging fields.
30
- * @returns {Promise<void>} Resolves when all documents have been processed and saved.
41
+ * This approach ensures memory efficiency and consistency during the merge process.
31
42
  *
32
- * @description Merges all documents in the collection by replacing occurrences of oldId with newId in
33
- * the specified fields.
43
+ * @param transform - Optional callback to modify each document before merging fields
44
+ * @returns Promise resolving when all documents have been processed and saved
34
45
  */
35
46
  merge(transform?: (item: Omit<T, keyof Document>) => Omit<T, keyof Document>): Promise<void>;
36
47
  }
@@ -14,17 +14,24 @@ const common_1 = require("@nestjs/common");
14
14
  const itlab_functions_1 = require("itlab-functions");
15
15
  /**
16
16
  * DocumentMerger
17
- * A service for merging documents in a collection by replacing occurrences of oldId with newId in specified fields
17
+ *
18
+ * Provides a utility to merge references within documents of a MongoDB collection by replacing
19
+ * all occurrences of an old identifier with a new identifier in specified fields.
20
+ *
21
+ * This class handles both single string references and arrays of references,
22
+ * ensuring unique values after the merge.
23
+ *
24
+ * @template T - Type of Mongoose Document
25
+ * @template Field - Keys of T excluding standard Document properties, representing the fields to update
18
26
  */
19
27
  class DocumentMerger {
20
28
  /**
21
- * DocumentMerger constructor
22
- * @param {Model<T>} model - The Mongoose model for the collection.
23
- * @param {string} oldId - The id of the document to be merged.
24
- * @param {string} newId - The id of the document to merge into.
25
- * @param {...Field[]} fields - The fields to be merged.
29
+ * Initializes the DocumentMerger with the collection model, IDs to merge, and target fields.
26
30
  *
27
- * @description Creates a new DocumentMerger instance.
31
+ * @param model - Mongoose model representing the target collection
32
+ * @param oldId - Identifier to be replaced in documents
33
+ * @param newId - Identifier to replace oldId with
34
+ * @param fields - List of document fields where replacements should occur
28
35
  */
29
36
  constructor(model, oldId, newId, ...fields) {
30
37
  this.logger = new common_1.Logger('DocumentMerger');
@@ -34,39 +41,52 @@ class DocumentMerger {
34
41
  this.fields = fields;
35
42
  }
36
43
  /**
37
- * Merges documents in a collection by replacing occurrences of oldId with newId in specified fields.
44
+ * Executes the merge operation over all documents in the collection.
38
45
  *
39
- * Iterates over all documents in the collection, applying an optional transformation to each item.
40
- * For each specified field, if the field is a string and matches oldId, it is replaced with newId.
41
- * If the field is an array, occurrences of oldId are replaced with newId, ensuring uniqueness.
46
+ * Iterates asynchronously through each document using a cursor to avoid loading all documents at once.
47
+ * For each document:
48
+ * - Optionally applies a transformation function before merging.
49
+ * - Replaces occurrences of oldId with newId in each specified field.
50
+ * - If the field is a string matching oldId, it is replaced directly.
51
+ * - If the field is an array, each occurrence of oldId is replaced with newId,
52
+ * and duplicates are removed to maintain uniqueness.
53
+ * - Saves the updated document without modifying timestamp fields.
42
54
  *
43
- * @param {Function} [transform] - Optional function to transform each item before merging fields.
44
- * @returns {Promise<void>} Resolves when all documents have been processed and saved.
55
+ * This approach ensures memory efficiency and consistency during the merge process.
45
56
  *
46
- * @description Merges all documents in the collection by replacing occurrences of oldId with newId in
47
- * the specified fields.
57
+ * @param transform - Optional callback to modify each document before merging fields
58
+ * @returns Promise resolving when all documents have been processed and saved
48
59
  */
49
60
  merge(transform) {
50
61
  return __awaiter(this, void 0, void 0, function* () {
51
- const iterator = this.model.find().cursor();
52
- for (let item = yield iterator.next(); item != null; item = yield iterator.next()) {
62
+ const startTime = Date.now();
63
+ const cursor = this.model.find().cursor();
64
+ // Process documents one by one to handle large collections efficiently
65
+ for (let doc = yield cursor.next(); doc != null; doc = yield cursor.next()) {
66
+ // Apply user-defined transformation if provided
53
67
  if (transform) {
54
- item = transform(item);
68
+ doc = transform(doc);
55
69
  }
70
+ // Iterate through each target field and perform replacements as needed
56
71
  for (const field of this.fields) {
57
- const value = item[field];
58
- if (typeof value === 'string' && value === this.oldId) {
59
- item[field] = this.newId;
72
+ const fieldValue = doc[field];
73
+ // Replace string fields equal to oldId with newId
74
+ if (typeof fieldValue === 'string' && fieldValue === this.oldId) {
75
+ doc[field] = this.newId;
60
76
  continue;
61
77
  }
62
- if (Array.isArray(value)) {
63
- item[field] = [...new Set(value.map((id) => (id === this.oldId ? this.newId : id)))];
78
+ // Replace oldId occurrences in array fields and remove duplicates
79
+ if (Array.isArray(fieldValue)) {
80
+ doc[field] = [...new Set(fieldValue.map((id) => (id === this.oldId ? this.newId : id)))];
64
81
  continue;
65
82
  }
66
83
  }
67
- yield item.save({ timestamps: false });
84
+ // Save changes to the database without updating timestamps
85
+ yield doc.save({ timestamps: false });
68
86
  }
69
- this.logger.log(`Succesfully merged fields ${(0, itlab_functions_1.toList)(this.fields)}`);
87
+ const elapsedTime = Date.now() - startTime;
88
+ // Log completion with fields merged and time taken
89
+ this.logger.log(`Successfully merged fields: ${(0, itlab_functions_1.formatList)(this.fields)} (took ${elapsedTime} ms)`);
70
90
  });
71
91
  }
72
92
  }
@@ -1,35 +1,39 @@
1
1
  import { Document } from 'mongoose';
2
2
  import { Viewable } from '../viewable.interface';
3
3
  /**
4
- * Class responsible for managing updates to documents, specifically for adding unique account IDs to specified attribute arrays.
4
+ * Facilitates asynchronous updates to documents by adding unique account IDs to specified
5
+ * array attributes. This prevents duplication of IDs in those arrays, ensuring data integrity.
5
6
  *
6
- * The DocumentUpdater class provides methods to update documents by adding unique account IDs to specified arrays.
7
- * It ensures that each account ID is only added if it is not already present in the array. All update operations are performed asynchronously.
7
+ * Designed primarily for adding account references such as views or other related IDs.
8
8
  */
9
9
  export declare class DocumentUpdater {
10
10
  private static readonly logger;
11
11
  /**
12
- * Adds a unique account ID to a specified attribute array in the document.
12
+ * Adds an account ID uniquely to a specified array attribute of a document.
13
13
  *
14
- * This method checks if an account ID is provided and updates the document by adding the account ID
15
- * to the specified attribute array, ensuring that the account ID is unique within the array.
14
+ * This method verifies the presence of an accountId before proceeding.
15
+ * It then performs an atomic MongoDB `$addToSet` update on the document to
16
+ * add the accountId to the given attribute array only if it is not already present,
17
+ * preventing duplicates without needing to fetch the document first.
16
18
  *
17
- * @template I - The interface representing the structure of the document.
18
- * @template T - The type of the document extending mongoose's Document.
19
- * @param {T} document - The document to be updated.
20
- * @param {keyof I} attribute - The attribute of the document to update.
21
- * @param {string} accountId - The account ID to add to the attribute array.
19
+ * Updates are saved without modifying timestamps to preserve original metadata.
20
+ *
21
+ * @template I - Interface representing the document’s shape.
22
+ * @template T - Mongoose Document type extending `Document`.
23
+ * @param document - The Mongoose document to update.
24
+ * @param attribute - The document attribute (key) representing the array to update.
25
+ * @param accountId - The unique account ID to add.
22
26
  */
23
27
  static addUniqueAccountId<I, T extends Document = Document>(document: T, attribute: keyof I, accountId?: string): void;
24
28
  /**
25
- * Adds a view to the target document by a specific account ID.
29
+ * Adds a view record to a document by associating an account ID with the '_viewedBy' attribute.
26
30
  *
27
- * This method logs the addition of a view and updates the target document by adding the account ID
28
- * to the '_viewedBy' attribute array, ensuring the account ID is unique within the array.
31
+ * This method leverages `addUniqueAccountId` to add the given accountId to the '_viewedBy' array,
32
+ * ensuring each viewer is recorded only once.
29
33
  *
30
- * @template T - The type of the document extending mongoose's Document and implementing Viewable.
31
- * @param {T} target - The target document to add a view to.
32
- * @param {string} accountId - The account ID responsible for the view.
34
+ * @template T - Mongoose Document type that extends Document and implements Viewable interface.
35
+ * @param target - The target document to record the view.
36
+ * @param accountId - The account ID representing the viewer.
33
37
  */
34
38
  static addView<T extends Document & Viewable>(target: T, accountId?: string): void;
35
39
  }
@@ -3,43 +3,51 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.DocumentUpdater = void 0;
4
4
  const common_1 = require("@nestjs/common");
5
5
  /**
6
- * Class responsible for managing updates to documents, specifically for adding unique account IDs to specified attribute arrays.
6
+ * Facilitates asynchronous updates to documents by adding unique account IDs to specified
7
+ * array attributes. This prevents duplication of IDs in those arrays, ensuring data integrity.
7
8
  *
8
- * The DocumentUpdater class provides methods to update documents by adding unique account IDs to specified arrays.
9
- * It ensures that each account ID is only added if it is not already present in the array. All update operations are performed asynchronously.
9
+ * Designed primarily for adding account references such as views or other related IDs.
10
10
  */
11
11
  class DocumentUpdater {
12
12
  /**
13
- * Adds a unique account ID to a specified attribute array in the document.
13
+ * Adds an account ID uniquely to a specified array attribute of a document.
14
14
  *
15
- * This method checks if an account ID is provided and updates the document by adding the account ID
16
- * to the specified attribute array, ensuring that the account ID is unique within the array.
15
+ * This method verifies the presence of an accountId before proceeding.
16
+ * It then performs an atomic MongoDB `$addToSet` update on the document to
17
+ * add the accountId to the given attribute array only if it is not already present,
18
+ * preventing duplicates without needing to fetch the document first.
17
19
  *
18
- * @template I - The interface representing the structure of the document.
19
- * @template T - The type of the document extending mongoose's Document.
20
- * @param {T} document - The document to be updated.
21
- * @param {keyof I} attribute - The attribute of the document to update.
22
- * @param {string} accountId - The account ID to add to the attribute array.
20
+ * Updates are saved without modifying timestamps to preserve original metadata.
21
+ *
22
+ * @template I - Interface representing the document’s shape.
23
+ * @template T - Mongoose Document type extending `Document`.
24
+ * @param document - The Mongoose document to update.
25
+ * @param attribute - The document attribute (key) representing the array to update.
26
+ * @param accountId - The unique account ID to add.
23
27
  */
24
28
  static addUniqueAccountId(document, attribute, accountId) {
25
29
  if (!accountId)
26
- return; // Exit early if no accountId is provided
27
- // Update the document by adding the accountId to the specified attribute array, ensuring uniqueness
30
+ return; // Exit if no accountId provided, avoiding unnecessary operations.
31
+ // Perform atomic update to add accountId uniquely to the attribute array.
28
32
  document
29
33
  .updateOne({ $addToSet: { [String(attribute)]: accountId } }, { timestamps: false })
30
34
  .then(() => {
31
- this.logger.log(`Successfully added ${accountId} to ${String(attribute)} for ${document._id}`);
35
+ this.logger.log(`Added unique accountId '${accountId}' to attribute '${String(attribute)}' for document ${document._id}`);
36
+ })
37
+ .catch((error) => {
38
+ // Log any errors during the update operation for debugging and audit.
39
+ this.logger.error(`Failed to add accountId '${accountId}' to attribute '${String(attribute)}' for document ${document._id}: ${error.stack}`);
32
40
  });
33
41
  }
34
42
  /**
35
- * Adds a view to the target document by a specific account ID.
43
+ * Adds a view record to a document by associating an account ID with the '_viewedBy' attribute.
36
44
  *
37
- * This method logs the addition of a view and updates the target document by adding the account ID
38
- * to the '_viewedBy' attribute array, ensuring the account ID is unique within the array.
45
+ * This method leverages `addUniqueAccountId` to add the given accountId to the '_viewedBy' array,
46
+ * ensuring each viewer is recorded only once.
39
47
  *
40
- * @template T - The type of the document extending mongoose's Document and implementing Viewable.
41
- * @param {T} target - The target document to add a view to.
42
- * @param {string} accountId - The account ID responsible for the view.
48
+ * @template T - Mongoose Document type that extends Document and implements Viewable interface.
49
+ * @param target - The target document to record the view.
50
+ * @param accountId - The account ID representing the viewer.
43
51
  */
44
52
  static addView(target, accountId) {
45
53
  this.addUniqueAccountId(target, '_viewedBy', accountId);
@@ -1,13 +1,15 @@
1
- import { Response } from 'express';
1
+ import { StreamableFile } from '@nestjs/common';
2
2
  /**
3
- * The FaviconController is responsible for handling requests to the favicon.ico endpoint.
4
- * This endpoint returns the application's favicon as an image/x-icon response.
5
- * The favicon is stored as a base64 string in the favicon variable below.
3
+ * Controller responsible for serving the favicon.ico image.
4
+ * The favicon is provided as a Base64-encoded ico image to avoid serving static files.
6
5
  */
7
6
  export declare class FaviconController {
7
+ private static readonly base64EncodedFavicon;
8
8
  /**
9
- * Handles GET requests to the favicon.ico endpoint.
10
- * @param res The HTTP response object.
9
+ * Streams the favicon image as an HTTP response.
10
+ * Decodes the Base64 string into a buffer and returns it with the appropriate content type.
11
+ *
12
+ * @returns {StreamableFile} - The favicon ico image stream.
11
13
  */
12
- getFavicon(res: Response): Promise<void>;
14
+ getFavicon(): StreamableFile;
13
15
  }
@@ -8,54 +8,42 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
8
8
  var __metadata = (this && this.__metadata) || function (k, v) {
9
9
  if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
10
  };
11
- var __param = (this && this.__param) || function (paramIndex, decorator) {
12
- return function (target, key) { decorator(target, key, paramIndex); }
13
- };
14
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
15
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
16
- return new (P || (P = Promise))(function (resolve, reject) {
17
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
18
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
19
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
20
- step((generator = generator.apply(thisArg, _arguments || [])).next());
21
- });
22
- };
11
+ var FaviconController_1;
23
12
  Object.defineProperty(exports, "__esModule", { value: true });
24
13
  exports.FaviconController = void 0;
25
14
  const common_1 = require("@nestjs/common");
26
15
  const swagger_1 = require("@nestjs/swagger");
27
- const favicon = `AAABAAEAKCgAAAEAIABoGgAAFgAAACgAAAAoAAAAUAAAAAEAIAAAAAAAABkAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAH190DGQkNiXoKDd05aW2fObm9v/v7/o/8LC6vunp9/tpqbf3Ken38mQkNaVfX3QMQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABLS8UshITVvKam4PDAwOn/wMDp/8DA6f/AwOn/v7/o/8DA6P+/v+j/v7/o/7+/6P+/v+j/v7/o/7+/6P+qquDooaHdmP///wwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIuL3BaKiti1tLTm/8DA6v/AwOn/wMDp/8DA6f/AwOn/wMDp/8DA6f/AwOn/wMDp/7+/6P+/v+j/v7/o/7+/6P+/v+j/v7/o/7+/6P+4uOX4jo7XrP///ww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D/gAAB/wAAAP/gAAf/AAAA//wAP/8AAAA=`;
28
16
  /**
29
- * The FaviconController is responsible for handling requests to the favicon.ico endpoint.
30
- * This endpoint returns the application's favicon as an image/x-icon response.
31
- * The favicon is stored as a base64 string in the favicon variable below.
17
+ * Controller responsible for serving the favicon.ico image.
18
+ * The favicon is provided as a Base64-encoded ico image to avoid serving static files.
32
19
  */
33
- let FaviconController = class FaviconController {
20
+ let FaviconController = FaviconController_1 = class FaviconController {
34
21
  /**
35
- * Handles GET requests to the favicon.ico endpoint.
36
- * @param res The HTTP response object.
22
+ * Streams the favicon image as an HTTP response.
23
+ * Decodes the Base64 string into a buffer and returns it with the appropriate content type.
24
+ *
25
+ * @returns {StreamableFile} - The favicon ico image stream.
37
26
  */
38
- getFavicon(res) {
39
- return __awaiter(this, void 0, void 0, function* () {
40
- // Decode the base64 string to binary data
41
- const buffer = Buffer.from(favicon, 'base64');
42
- // Set the appropriate headers for an ICO file
43
- res.setHeader('Content-Type', 'image/x-icon');
44
- res.setHeader('Content-Length', buffer.length);
45
- // Send the binary data as a response
46
- res.send(buffer);
27
+ getFavicon() {
28
+ // Decode Base64 string to buffer to be sent as PNG image response.
29
+ const faviconBuffer = Buffer.from(FaviconController_1.base64EncodedFavicon, 'base64');
30
+ return new common_1.StreamableFile(faviconBuffer, {
31
+ type: 'image/x-icon',
32
+ length: faviconBuffer.length,
33
+ disposition: 'inline; filename=favicon.ico',
47
34
  });
48
35
  }
49
36
  };
50
37
  exports.FaviconController = FaviconController;
38
+ // Base64-encoded ico favicon data.
39
+ FaviconController.base64EncodedFavicon = `AAABAAEAKCgAAAEAIABoGgAAFgAAACgAAAAoAAAAUAAAAAEAIAAAAAAAABkAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAH190DGQkNiXoKDd05aW2fObm9v/v7/o/8LC6vunp9/tpqbf3Ken38mQkNaV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AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA//wAP/8AAAD/4AAH/wAAAP+AAAH/AAAA/wAAAP8AAAD8AAAAfwAAAPgAAAAfAAAA8AAAAA8AAADwAAAADwAAAOAAAAAHAAAAwAAAAAMAAADAAAAAAwAAAIAAAAABAAAAgAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgAAAAAEAAACAAAAAAQAAAMAAAAADAAAAwAAAAAMAAADgAAAABwAAAPAAAAAPAAAA8AAAAA8AAAD4AAAAHwAAAPwAAAA/AAAA/wAAAP8AAAD/gAAB/wAAAP/gAAf/AAAA//wAP/8AAAA=`;
51
40
  __decorate([
52
41
  (0, common_1.Get)('favicon.ico'),
53
- __param(0, (0, common_1.Res)()),
54
42
  __metadata("design:type", Function),
55
- __metadata("design:paramtypes", [Object]),
56
- __metadata("design:returntype", Promise)
43
+ __metadata("design:paramtypes", []),
44
+ __metadata("design:returntype", common_1.StreamableFile)
57
45
  ], FaviconController.prototype, "getFavicon", null);
58
- exports.FaviconController = FaviconController = __decorate([
46
+ exports.FaviconController = FaviconController = FaviconController_1 = __decorate([
59
47
  (0, swagger_1.ApiTags)('Favicon'),
60
48
  (0, common_1.Controller)()
61
49
  ], FaviconController);
@@ -1,15 +1,15 @@
1
- import { Response } from 'express';
2
1
  /**
3
- * Handles requests from Kubernetes to check if the service is alive.
4
- *
5
- * @class LivenessProbe
2
+ * Handles Kubernetes liveness probe requests to confirm service health.
3
+ * Kubernetes uses this endpoint to check if the application is alive and responsive.
6
4
  */
7
5
  export declare class LivenessProbeController {
8
6
  /**
9
- * Returns a 200 status when the service is alive.
7
+ * Returns a simple JSON response indicating the service is alive.
8
+ * This lightweight response is optimized for quick health checks by Kubernetes.
10
9
  *
11
- * @param {Response} response - the response object
12
- * @return {Promise<void>} a Promise that resolves to void
10
+ * @returns {{ ok: number }} Object confirming liveness status
13
11
  */
14
- getAlive(response: Response): Promise<void>;
12
+ getLivenessStatus(): {
13
+ ok: number;
14
+ };
15
15
  }
@@ -8,48 +8,33 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
8
8
  var __metadata = (this && this.__metadata) || function (k, v) {
9
9
  if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
10
  };
11
- var __param = (this && this.__param) || function (paramIndex, decorator) {
12
- return function (target, key) { decorator(target, key, paramIndex); }
13
- };
14
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
15
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
16
- return new (P || (P = Promise))(function (resolve, reject) {
17
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
18
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
19
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
20
- step((generator = generator.apply(thisArg, _arguments || [])).next());
21
- });
22
- };
23
11
  Object.defineProperty(exports, "__esModule", { value: true });
24
12
  exports.LivenessProbeController = void 0;
25
13
  const common_1 = require("@nestjs/common");
26
14
  const swagger_1 = require("@nestjs/swagger");
27
15
  /**
28
- * Handles requests from Kubernetes to check if the service is alive.
29
- *
30
- * @class LivenessProbe
16
+ * Handles Kubernetes liveness probe requests to confirm service health.
17
+ * Kubernetes uses this endpoint to check if the application is alive and responsive.
31
18
  */
32
19
  let LivenessProbeController = class LivenessProbeController {
33
20
  /**
34
- * Returns a 200 status when the service is alive.
21
+ * Returns a simple JSON response indicating the service is alive.
22
+ * This lightweight response is optimized for quick health checks by Kubernetes.
35
23
  *
36
- * @param {Response} response - the response object
37
- * @return {Promise<void>} a Promise that resolves to void
24
+ * @returns {{ ok: number }} Object confirming liveness status
38
25
  */
39
- getAlive(response) {
40
- return __awaiter(this, void 0, void 0, function* () {
41
- response.status(200).send({ ok: 1 });
42
- });
26
+ getLivenessStatus() {
27
+ // Return a minimal positive response to signal the service is up
28
+ return { ok: 1 };
43
29
  }
44
30
  };
45
31
  exports.LivenessProbeController = LivenessProbeController;
46
32
  __decorate([
47
33
  (0, common_1.Get)('/alive'),
48
- __param(0, (0, common_1.Res)()),
49
34
  __metadata("design:type", Function),
50
- __metadata("design:paramtypes", [Object]),
51
- __metadata("design:returntype", Promise)
52
- ], LivenessProbeController.prototype, "getAlive", null);
35
+ __metadata("design:paramtypes", []),
36
+ __metadata("design:returntype", Object)
37
+ ], LivenessProbeController.prototype, "getLivenessStatus", null);
53
38
  exports.LivenessProbeController = LivenessProbeController = __decorate([
54
39
  (0, swagger_1.ApiTags)('Kubernetes Liveness Probe'),
55
40
  (0, common_1.Controller)()
@@ -1,7 +1,17 @@
1
1
  import { AccountEntity } from '../models';
2
2
  /**
3
- * Decorator to extract account information from the request.
4
- * @param {keyof AccountEntity} attribute - Optional: Attribute of the account to extract.
5
- * @returns {any} The extracted account or attribute of the account.
3
+ * Custom parameter decorator to extract the authenticated user's account
4
+ * or a specific attribute from it within route handlers.
5
+ *
6
+ * This decorator expects the authentication layer (e.g., guard or middleware)
7
+ * to have attached the `user` property to the request object,
8
+ * representing the authenticated user's account data.
9
+ *
10
+ * If no user account is found on the request, it throws an UnprocessableEntityException,
11
+ * signaling that the request is missing necessary authentication context.
12
+ *
13
+ * @param {keyof AccountEntity} [attribute] - Optional key of the AccountEntity to extract.
14
+ * @param {ExecutionContext} executionContext - The context of the current request.
15
+ * @returns {AccountEntity[keyof AccountEntity] | AccountEntity} The requested account attribute or full account object.
6
16
  */
7
17
  export declare const Account: (...dataOrPipes: (keyof AccountEntity | import("@nestjs/common").PipeTransform<any, any> | import("@nestjs/common").Type<import("@nestjs/common").PipeTransform<any, any>>)[]) => ParameterDecorator;