@scpxl/nodejs-framework 1.0.20 → 1.0.22

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 (276) hide show
  1. package/LICENSE +15 -0
  2. package/README.md +530 -67
  3. package/dist/application/base-application.js +1 -1
  4. package/dist/application/base-application.js.map +2 -2
  5. package/dist/application/command-application.js.map +2 -2
  6. package/dist/application/web-application.js +1 -0
  7. package/dist/application/web-application.js.map +2 -2
  8. package/dist/command/command.js.map +1 -1
  9. package/dist/config/schema.js +17 -7
  10. package/dist/config/schema.js.map +2 -2
  11. package/dist/event/manager.js.map +2 -2
  12. package/dist/lifecycle/lifecycle-manager.js.map +2 -2
  13. package/dist/logger/logger.js +21 -1
  14. package/dist/logger/logger.js.map +2 -2
  15. package/dist/queue/index.js.map +1 -1
  16. package/dist/queue/manager.js +24 -12
  17. package/dist/queue/manager.js.map +2 -2
  18. package/dist/queue/processor/base.js.map +2 -2
  19. package/dist/services/aws/s3.js.map +2 -2
  20. package/dist/util/helper.js +1 -1
  21. package/dist/util/helper.js.map +2 -2
  22. package/dist/util/loader.js.map +2 -2
  23. package/dist/webserver/controller/base.js.map +2 -2
  24. package/dist/webserver/define-route.js +22 -0
  25. package/dist/webserver/define-route.js.map +7 -0
  26. package/dist/webserver/index.js +2 -0
  27. package/dist/webserver/index.js.map +2 -2
  28. package/dist/webserver/webserver.interface.js.map +2 -2
  29. package/dist/webserver/webserver.js +211 -56
  30. package/dist/webserver/webserver.js.map +2 -2
  31. package/dist/websocket/websocket-base.js.map +2 -2
  32. package/dist/websocket/websocket-client.js.map +1 -1
  33. package/dist/websocket/websocket-server.js +5 -5
  34. package/dist/websocket/websocket-server.js.map +2 -2
  35. package/dist/websocket/websocket.interface.js.map +2 -2
  36. package/package.json +3 -2
  37. package/dist/api-requester/api-requester.d.ts +0 -32
  38. package/dist/api-requester/api-requester.d.ts.map +0 -1
  39. package/dist/api-requester/index.d.ts +0 -3
  40. package/dist/api-requester/index.d.ts.map +0 -1
  41. package/dist/application/base-application.d.ts +0 -106
  42. package/dist/application/base-application.d.ts.map +0 -1
  43. package/dist/application/base-application.interface.d.ts +0 -161
  44. package/dist/application/base-application.interface.d.ts.map +0 -1
  45. package/dist/application/command-application.d.ts +0 -18
  46. package/dist/application/command-application.d.ts.map +0 -1
  47. package/dist/application/command-application.interface.d.ts +0 -26
  48. package/dist/application/command-application.interface.d.ts.map +0 -1
  49. package/dist/application/index.d.ts +0 -5
  50. package/dist/application/index.d.ts.map +0 -1
  51. package/dist/application/web-application.d.ts +0 -43
  52. package/dist/application/web-application.d.ts.map +0 -1
  53. package/dist/application/web-application.interface.d.ts +0 -21
  54. package/dist/application/web-application.interface.d.ts.map +0 -1
  55. package/dist/auth/index.d.ts +0 -2
  56. package/dist/auth/index.d.ts.map +0 -1
  57. package/dist/auth/jwt.d.ts +0 -25
  58. package/dist/auth/jwt.d.ts.map +0 -1
  59. package/dist/cache/index.d.ts +0 -2
  60. package/dist/cache/index.d.ts.map +0 -1
  61. package/dist/cache/manager.d.ts +0 -107
  62. package/dist/cache/manager.d.ts.map +0 -1
  63. package/dist/cluster/cluster-manager.d.ts +0 -15
  64. package/dist/cluster/cluster-manager.d.ts.map +0 -1
  65. package/dist/cluster/cluster-manager.interface.d.ts +0 -23
  66. package/dist/cluster/cluster-manager.interface.d.ts.map +0 -1
  67. package/dist/cluster/index.d.ts +0 -2
  68. package/dist/cluster/index.d.ts.map +0 -1
  69. package/dist/command/command-manager.d.ts +0 -19
  70. package/dist/command/command-manager.d.ts.map +0 -1
  71. package/dist/command/command.d.ts +0 -27
  72. package/dist/command/command.d.ts.map +0 -1
  73. package/dist/command/command.interface.d.ts +0 -11
  74. package/dist/command/command.interface.d.ts.map +0 -1
  75. package/dist/command/index.d.ts +0 -3
  76. package/dist/command/index.d.ts.map +0 -1
  77. package/dist/config/env.d.ts +0 -11
  78. package/dist/config/env.d.ts.map +0 -1
  79. package/dist/config/index.d.ts +0 -3
  80. package/dist/config/index.d.ts.map +0 -1
  81. package/dist/config/schema.d.ts +0 -408
  82. package/dist/config/schema.d.ts.map +0 -1
  83. package/dist/database/dynamic-entity-form-decorators.d.ts +0 -31
  84. package/dist/database/dynamic-entity-form-decorators.d.ts.map +0 -1
  85. package/dist/database/dynamic-entity.d.ts +0 -15
  86. package/dist/database/dynamic-entity.d.ts.map +0 -1
  87. package/dist/database/index.d.ts +0 -5
  88. package/dist/database/index.d.ts.map +0 -1
  89. package/dist/database/instance.d.ts +0 -36
  90. package/dist/database/instance.d.ts.map +0 -1
  91. package/dist/database/instance.interface.d.ts +0 -5
  92. package/dist/database/instance.interface.d.ts.map +0 -1
  93. package/dist/database/manager.d.ts +0 -27
  94. package/dist/database/manager.d.ts.map +0 -1
  95. package/dist/database/manager.interface.d.ts +0 -18
  96. package/dist/database/manager.interface.d.ts.map +0 -1
  97. package/dist/error/error-reporter.d.ts +0 -96
  98. package/dist/error/error-reporter.d.ts.map +0 -1
  99. package/dist/error/error.interface.d.ts +0 -126
  100. package/dist/error/error.interface.d.ts.map +0 -1
  101. package/dist/error/framework-errors.d.ts +0 -113
  102. package/dist/error/framework-errors.d.ts.map +0 -1
  103. package/dist/error/index.d.ts +0 -6
  104. package/dist/error/index.d.ts.map +0 -1
  105. package/dist/event/controller/base.d.ts +0 -23
  106. package/dist/event/controller/base.d.ts.map +0 -1
  107. package/dist/event/controller/base.interface.d.ts +0 -11
  108. package/dist/event/controller/base.interface.d.ts.map +0 -1
  109. package/dist/event/index.d.ts +0 -5
  110. package/dist/event/index.d.ts.map +0 -1
  111. package/dist/event/manager.d.ts +0 -21
  112. package/dist/event/manager.d.ts.map +0 -1
  113. package/dist/event/manager.interface.d.ts +0 -134
  114. package/dist/event/manager.interface.d.ts.map +0 -1
  115. package/dist/index.d.ts +0 -22
  116. package/dist/index.d.ts.map +0 -1
  117. package/dist/lifecycle/exit.d.ts +0 -11
  118. package/dist/lifecycle/exit.d.ts.map +0 -1
  119. package/dist/lifecycle/index.d.ts +0 -7
  120. package/dist/lifecycle/index.d.ts.map +0 -1
  121. package/dist/lifecycle/lifecycle-manager.d.ts +0 -66
  122. package/dist/lifecycle/lifecycle-manager.d.ts.map +0 -1
  123. package/dist/lifecycle/shutdown-controller.d.ts +0 -15
  124. package/dist/lifecycle/shutdown-controller.d.ts.map +0 -1
  125. package/dist/lifecycle/types.d.ts +0 -28
  126. package/dist/lifecycle/types.d.ts.map +0 -1
  127. package/dist/logger/index.d.ts +0 -2
  128. package/dist/logger/index.d.ts.map +0 -1
  129. package/dist/logger/logger.d.ts +0 -55
  130. package/dist/logger/logger.d.ts.map +0 -1
  131. package/dist/logger/logger.interface.d.ts +0 -2
  132. package/dist/logger/logger.interface.d.ts.map +0 -1
  133. package/dist/performance/cache-performance.d.ts +0 -64
  134. package/dist/performance/cache-performance.d.ts.map +0 -1
  135. package/dist/performance/database-performance.d.ts +0 -40
  136. package/dist/performance/database-performance.d.ts.map +0 -1
  137. package/dist/performance/index.d.ts +0 -8
  138. package/dist/performance/index.d.ts.map +0 -1
  139. package/dist/performance/performance-monitor.d.ts +0 -68
  140. package/dist/performance/performance-monitor.d.ts.map +0 -1
  141. package/dist/performance/performance-monitor.plugin.d.ts +0 -24
  142. package/dist/performance/performance-monitor.plugin.d.ts.map +0 -1
  143. package/dist/performance/queue-performance.d.ts +0 -46
  144. package/dist/performance/queue-performance.d.ts.map +0 -1
  145. package/dist/performance/webserver-performance.d.ts +0 -69
  146. package/dist/performance/webserver-performance.d.ts.map +0 -1
  147. package/dist/performance/websocket-performance.d.ts +0 -44
  148. package/dist/performance/websocket-performance.d.ts.map +0 -1
  149. package/dist/queue/index.d.ts +0 -6
  150. package/dist/queue/index.d.ts.map +0 -1
  151. package/dist/queue/index.interface.d.ts +0 -10
  152. package/dist/queue/index.interface.d.ts.map +0 -1
  153. package/dist/queue/job.interface.d.ts +0 -42
  154. package/dist/queue/job.interface.d.ts.map +0 -1
  155. package/dist/queue/manager.d.ts +0 -36
  156. package/dist/queue/manager.d.ts.map +0 -1
  157. package/dist/queue/manager.interface.d.ts +0 -18
  158. package/dist/queue/manager.interface.d.ts.map +0 -1
  159. package/dist/queue/processor/base.d.ts +0 -28
  160. package/dist/queue/processor/base.d.ts.map +0 -1
  161. package/dist/queue/processor/processor.interface.d.ts +0 -15
  162. package/dist/queue/processor/processor.interface.d.ts.map +0 -1
  163. package/dist/queue/worker.d.ts +0 -14
  164. package/dist/queue/worker.d.ts.map +0 -1
  165. package/dist/queue/worker.interface.d.ts +0 -13
  166. package/dist/queue/worker.interface.d.ts.map +0 -1
  167. package/dist/redis/index.d.ts +0 -3
  168. package/dist/redis/index.d.ts.map +0 -1
  169. package/dist/redis/instance.d.ts +0 -32
  170. package/dist/redis/instance.d.ts.map +0 -1
  171. package/dist/redis/instance.interface.d.ts +0 -9
  172. package/dist/redis/instance.interface.d.ts.map +0 -1
  173. package/dist/redis/manager.d.ts +0 -15
  174. package/dist/redis/manager.d.ts.map +0 -1
  175. package/dist/redis/manager.interface.d.ts +0 -8
  176. package/dist/redis/manager.interface.d.ts.map +0 -1
  177. package/dist/request-context/index.d.ts +0 -3
  178. package/dist/request-context/index.d.ts.map +0 -1
  179. package/dist/request-context/request-context.d.ts +0 -108
  180. package/dist/request-context/request-context.d.ts.map +0 -1
  181. package/dist/request-context/request-context.interface.d.ts +0 -46
  182. package/dist/request-context/request-context.interface.d.ts.map +0 -1
  183. package/dist/services/aws/index.d.ts +0 -2
  184. package/dist/services/aws/index.d.ts.map +0 -1
  185. package/dist/services/aws/s3.d.ts +0 -54
  186. package/dist/services/aws/s3.d.ts.map +0 -1
  187. package/dist/services/aws/s3.interface.d.ts +0 -14
  188. package/dist/services/aws/s3.interface.d.ts.map +0 -1
  189. package/dist/services/index.d.ts +0 -2
  190. package/dist/services/index.d.ts.map +0 -1
  191. package/dist/util/file.d.ts +0 -58
  192. package/dist/util/file.d.ts.map +0 -1
  193. package/dist/util/helper.d.ts +0 -52
  194. package/dist/util/helper.d.ts.map +0 -1
  195. package/dist/util/image.d.ts +0 -12
  196. package/dist/util/image.d.ts.map +0 -1
  197. package/dist/util/index.d.ts +0 -11
  198. package/dist/util/index.d.ts.map +0 -1
  199. package/dist/util/loader.d.ts +0 -19
  200. package/dist/util/loader.d.ts.map +0 -1
  201. package/dist/util/num.d.ts +0 -13
  202. package/dist/util/num.d.ts.map +0 -1
  203. package/dist/util/os.d.ts +0 -6
  204. package/dist/util/os.d.ts.map +0 -1
  205. package/dist/util/str.d.ts +0 -39
  206. package/dist/util/str.d.ts.map +0 -1
  207. package/dist/util/time.d.ts +0 -19
  208. package/dist/util/time.d.ts.map +0 -1
  209. package/dist/util/time.interface.d.ts +0 -12
  210. package/dist/util/time.interface.d.ts.map +0 -1
  211. package/dist/util/timing.d.ts +0 -36
  212. package/dist/util/timing.d.ts.map +0 -1
  213. package/dist/util/timing.interface.d.ts +0 -47
  214. package/dist/util/timing.interface.d.ts.map +0 -1
  215. package/dist/util/url.d.ts +0 -7
  216. package/dist/util/url.d.ts.map +0 -1
  217. package/dist/webserver/controller/auth-middleware.d.ts +0 -21
  218. package/dist/webserver/controller/auth-middleware.d.ts.map +0 -1
  219. package/dist/webserver/controller/base.d.ts +0 -41
  220. package/dist/webserver/controller/base.d.ts.map +0 -1
  221. package/dist/webserver/controller/base.interface.d.ts +0 -47
  222. package/dist/webserver/controller/base.interface.d.ts.map +0 -1
  223. package/dist/webserver/controller/entity.d.ts +0 -94
  224. package/dist/webserver/controller/entity.d.ts.map +0 -1
  225. package/dist/webserver/controller/example-auth.d.ts +0 -12
  226. package/dist/webserver/controller/example-auth.d.ts.map +0 -1
  227. package/dist/webserver/controller/health.d.ts +0 -15
  228. package/dist/webserver/controller/health.d.ts.map +0 -1
  229. package/dist/webserver/index.d.ts +0 -12
  230. package/dist/webserver/index.d.ts.map +0 -1
  231. package/dist/webserver/util.d.ts +0 -10
  232. package/dist/webserver/util.d.ts.map +0 -1
  233. package/dist/webserver/webserver.d.ts +0 -79
  234. package/dist/webserver/webserver.d.ts.map +0 -1
  235. package/dist/webserver/webserver.interface.d.ts +0 -155
  236. package/dist/webserver/webserver.interface.d.ts.map +0 -1
  237. package/dist/websocket/controller/client/base.d.ts +0 -12
  238. package/dist/websocket/controller/client/base.d.ts.map +0 -1
  239. package/dist/websocket/controller/client/base.interface.d.ts +0 -12
  240. package/dist/websocket/controller/client/base.interface.d.ts.map +0 -1
  241. package/dist/websocket/controller/server/base.d.ts +0 -13
  242. package/dist/websocket/controller/server/base.d.ts.map +0 -1
  243. package/dist/websocket/controller/server/base.interface.d.ts +0 -13
  244. package/dist/websocket/controller/server/base.interface.d.ts.map +0 -1
  245. package/dist/websocket/controllers/client/system.d.ts +0 -6
  246. package/dist/websocket/controllers/client/system.d.ts.map +0 -1
  247. package/dist/websocket/controllers/server/system.d.ts +0 -7
  248. package/dist/websocket/controllers/server/system.d.ts.map +0 -1
  249. package/dist/websocket/index.d.ts +0 -7
  250. package/dist/websocket/index.d.ts.map +0 -1
  251. package/dist/websocket/routes/client/system.d.ts +0 -3
  252. package/dist/websocket/routes/client/system.d.ts.map +0 -1
  253. package/dist/websocket/routes/server/system.d.ts +0 -3
  254. package/dist/websocket/routes/server/system.d.ts.map +0 -1
  255. package/dist/websocket/utils.d.ts +0 -9
  256. package/dist/websocket/utils.d.ts.map +0 -1
  257. package/dist/websocket/websocket-base.d.ts +0 -15
  258. package/dist/websocket/websocket-base.d.ts.map +0 -1
  259. package/dist/websocket/websocket-client-manager.d.ts +0 -53
  260. package/dist/websocket/websocket-client-manager.d.ts.map +0 -1
  261. package/dist/websocket/websocket-client-manager.interface.d.ts +0 -8
  262. package/dist/websocket/websocket-client-manager.interface.d.ts.map +0 -1
  263. package/dist/websocket/websocket-client.d.ts +0 -35
  264. package/dist/websocket/websocket-client.d.ts.map +0 -1
  265. package/dist/websocket/websocket-client.interface.d.ts +0 -14
  266. package/dist/websocket/websocket-client.interface.d.ts.map +0 -1
  267. package/dist/websocket/websocket-room-manager.d.ts +0 -32
  268. package/dist/websocket/websocket-room-manager.d.ts.map +0 -1
  269. package/dist/websocket/websocket-server.d.ts +0 -92
  270. package/dist/websocket/websocket-server.d.ts.map +0 -1
  271. package/dist/websocket/websocket-server.interface.d.ts +0 -16
  272. package/dist/websocket/websocket-server.interface.d.ts.map +0 -1
  273. package/dist/websocket/websocket-service.d.ts +0 -44
  274. package/dist/websocket/websocket-service.d.ts.map +0 -1
  275. package/dist/websocket/websocket.interface.d.ts +0 -119
  276. package/dist/websocket/websocket.interface.d.ts.map +0 -1
@@ -1,10 +0,0 @@
1
- import type { QueueJob } from './job.interface.js';
2
- export interface QueueItem {
3
- /** Queue name */
4
- name: string;
5
- /** Whether queue is external */
6
- isExternal?: boolean;
7
- /** Queue jobs */
8
- jobs: QueueJob[];
9
- }
10
- //# sourceMappingURL=index.interface.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.interface.d.ts","sourceRoot":"","sources":["../../src/queue/index.interface.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAEnD,MAAM,WAAW,SAAS;IACxB,iBAAiB;IACjB,IAAI,EAAE,MAAM,CAAC;IAEb,gCAAgC;IAChC,UAAU,CAAC,EAAE,OAAO,CAAC;IAErB,iBAAiB;IACjB,IAAI,EAAE,QAAQ,EAAE,CAAC;CAClB"}
@@ -1,42 +0,0 @@
1
- export interface QueueJob {
2
- /** Job ID */
3
- id: string;
4
- /** The maximum number of concurrent jobs in queue */
5
- maxConcurrency?: number;
6
- }
7
- export interface QueueJobData {
8
- /** Unique identifier for the job */
9
- jobId?: string;
10
- /** Timestamp when job was created */
11
- createdAt?: Date;
12
- /** Timestamp when job processing started */
13
- startTime?: [number, number];
14
- /** Priority of the job (higher number = higher priority) */
15
- priority?: number;
16
- /** Maximum number of retry attempts */
17
- maxRetries?: number;
18
- /** Current retry attempt number */
19
- attemptsMade?: number;
20
- /** Delay before processing (in milliseconds) */
21
- delay?: number;
22
- /** WebSocket client ID for real-time updates */
23
- webSocketClientId?: string;
24
- /** User ID associated with the job */
25
- userId?: string;
26
- /** Custom metadata for the job */
27
- metadata?: Record<string, unknown>;
28
- /** The actual job payload data */
29
- payload: Record<string, unknown>;
30
- /** Job configuration options */
31
- options?: {
32
- /** Remove job from queue after completion */
33
- removeOnComplete?: boolean;
34
- /** Remove job from queue after failure */
35
- removeOnFail?: boolean;
36
- /** Exponential backoff multiplier */
37
- backoffMultiplier?: number;
38
- /** Exponential backoff delay */
39
- backoffDelay?: number;
40
- };
41
- }
42
- //# sourceMappingURL=job.interface.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"job.interface.d.ts","sourceRoot":"","sources":["../../src/queue/job.interface.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,QAAQ;IACvB,aAAa;IACb,EAAE,EAAE,MAAM,CAAC;IAEX,qDAAqD;IACrD,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AAED,MAAM,WAAW,YAAY;IAC3B,oCAAoC;IACpC,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf,qCAAqC;IACrC,SAAS,CAAC,EAAE,IAAI,CAAC;IAEjB,4CAA4C;IAC5C,SAAS,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAE7B,4DAA4D;IAC5D,QAAQ,CAAC,EAAE,MAAM,CAAC;IAElB,uCAAuC;IACvC,UAAU,CAAC,EAAE,MAAM,CAAC;IAEpB,mCAAmC;IACnC,YAAY,CAAC,EAAE,MAAM,CAAC;IAEtB,gDAAgD;IAChD,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf,gDAAgD;IAChD,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAE3B,sCAAsC;IACtC,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB,kCAAkC;IAClC,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAEnC,kCAAkC;IAClC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAEjC,gCAAgC;IAChC,OAAO,CAAC,EAAE;QACR,6CAA6C;QAC7C,gBAAgB,CAAC,EAAE,OAAO,CAAC;QAC3B,0CAA0C;QAC1C,YAAY,CAAC,EAAE,OAAO,CAAC;QACvB,qCAAqC;QACrC,iBAAiB,CAAC,EAAE,MAAM,CAAC;QAC3B,gCAAgC;QAChC,YAAY,CAAC,EAAE,MAAM,CAAC;KACvB,CAAC;CACH"}
@@ -1,36 +0,0 @@
1
- import { type Job } from 'bullmq';
2
- import type { QueueManagerConstructorParams } from './manager.interface.js';
3
- import type { QueueJobData } from './job.interface.js';
4
- import type { QueueItem } from './index.interface.js';
5
- export default class QueueManager {
6
- private logger;
7
- private applicationConfig;
8
- private options;
9
- private redisInstance;
10
- private databaseInstance;
11
- private eventManager?;
12
- private queues;
13
- private jobProcessors;
14
- constructor({ applicationConfig, options, queues: _queues, redisInstance, databaseInstance, eventManager, }: QueueManagerConstructorParams);
15
- registerQueues({ queues }: {
16
- queues: QueueItem[];
17
- }): Promise<void>;
18
- private registerQueue;
19
- private registerJobProcessors;
20
- private onQueueError;
21
- private onQueueWaiting;
22
- private onQueueProgress;
23
- private onQueueRemoved;
24
- addJobToQueue: ({ queueId, jobId, data }: {
25
- queueId: string;
26
- jobId: string;
27
- data: QueueJobData;
28
- }) => Promise<Job<any, any, string> | undefined>;
29
- private workerProcessor;
30
- listAllJobsWithStatus(): Promise<any[]>;
31
- /**
32
- * Log queue message
33
- */
34
- log(message: string, meta?: Record<string, unknown>): void;
35
- }
36
- //# sourceMappingURL=manager.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"manager.d.ts","sourceRoot":"","sources":["../../src/queue/manager.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,GAAG,EAAgE,MAAM,QAAQ,CAAC;AAEhG,OAAO,KAAK,EAAE,6BAA6B,EAAuB,MAAM,wBAAwB,CAAC;AAOjG,OAAO,KAAK,EAAY,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAEjE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAItD,MAAM,CAAC,OAAO,OAAO,YAAY;IAC/B,OAAO,CAAC,MAAM,CAAyB;IAEvC,OAAO,CAAC,iBAAiB,CAAoB;IAE7C,OAAO,CAAC,OAAO,CAAsB;IAErC,OAAO,CAAC,aAAa,CAAgB;IACrC,OAAO,CAAC,gBAAgB,CAA0B;IAClD,OAAO,CAAC,YAAY,CAAC,CAAe;IAEpC,OAAO,CAAC,MAAM,CAAiC;IAE/C,OAAO,CAAC,aAAa,CAAyC;gBAElD,EACV,iBAAiB,EACjB,OAAO,EACP,MAAM,EAAE,OAAO,EACf,aAAa,EACb,gBAAgB,EAChB,YAAY,GACb,EAAE,6BAA6B;IAcnB,cAAc,CAAC,EAAE,MAAM,EAAE,EAAE;QAAE,MAAM,EAAE,SAAS,EAAE,CAAA;KAAE,GAAG,OAAO,CAAC,IAAI,CAAC;IAiC/E,OAAO,CAAC,aAAa;IAyDrB,OAAO,CAAC,qBAAqB;IA0C7B,OAAO,CAAC,YAAY,CAElB;IAEF,OAAO,CAAC,cAAc,CAIpB;IAEF,OAAO,CAAC,eAAe,CAOrB;IAEF,OAAO,CAAC,cAAc,CAEpB;IAEK,aAAa,GAAU,0BAA0B;QAAE,OAAO,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,YAAY,CAAA;KAAE,gDA0B5G;IAEF,OAAO,CAAC,eAAe,CAuCrB;IAEW,qBAAqB,IAAI,OAAO,CAAC,GAAG,EAAE,CAAC;IA2BpD;;OAEG;IACI,GAAG,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI;CAGlE"}
@@ -1,18 +0,0 @@
1
- import type { ApplicationConfig } from '../application/base-application.interface.js';
2
- import type DatabaseInstance from '../database/instance.js';
3
- import type EventManager from '../event/manager.js';
4
- import type { RedisInstance } from '../redis/index.js';
5
- import type { QueueItem } from './index.interface.js';
6
- export interface QueueManagerOptions {
7
- /** Queue processors directory */
8
- processorsDirectory: string;
9
- }
10
- export interface QueueManagerConstructorParams {
11
- applicationConfig: ApplicationConfig;
12
- options?: QueueManagerOptions;
13
- queues: QueueItem[];
14
- redisInstance: RedisInstance;
15
- databaseInstance: DatabaseInstance | null;
16
- eventManager?: EventManager;
17
- }
18
- //# sourceMappingURL=manager.interface.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"manager.interface.d.ts","sourceRoot":"","sources":["../../src/queue/manager.interface.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,8CAA8C,CAAC;AACtF,OAAO,KAAK,gBAAgB,MAAM,yBAAyB,CAAC;AAC5D,OAAO,KAAK,YAAY,MAAM,qBAAqB,CAAC;AACpD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AACvD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAEtD,MAAM,WAAW,mBAAmB;IAClC,iCAAiC;IACjC,mBAAmB,EAAE,MAAM,CAAC;CAC7B;AAED,MAAM,WAAW,6BAA6B;IAC5C,iBAAiB,EAAE,iBAAiB,CAAC;IACrC,OAAO,CAAC,EAAE,mBAAmB,CAAC;IAC9B,MAAM,EAAE,SAAS,EAAE,CAAC;IACpB,aAAa,EAAE,aAAa,CAAC;IAC7B,gBAAgB,EAAE,gBAAgB,GAAG,IAAI,CAAC;IAC1C,YAAY,CAAC,EAAE,YAAY,CAAC;CAC7B"}
@@ -1,28 +0,0 @@
1
- import type { Job } from 'bullmq';
2
- import type { QueueManager } from '../../queue/index.js';
3
- import type { DatabaseInstance } from '../../database/index.js';
4
- import type { ApplicationConfig } from '../../application/base-application.interface.js';
5
- import type { RedisInstance } from '../../redis/index.js';
6
- import type EventManager from '../../event/manager.js';
7
- export default abstract class BaseProcessor {
8
- protected queueManager: QueueManager;
9
- protected applicationConfig: ApplicationConfig;
10
- protected redisInstance: RedisInstance;
11
- protected databaseInstance: DatabaseInstance | null;
12
- protected eventManager?: EventManager | undefined;
13
- private logger;
14
- constructor(queueManager: QueueManager, applicationConfig: ApplicationConfig, redisInstance: RedisInstance, databaseInstance: DatabaseInstance | null, eventManager?: EventManager | undefined);
15
- abstract process({ job }: {
16
- job: Job;
17
- }): Promise<any>;
18
- /**
19
- * Enhanced logger with structured methods
20
- */
21
- log: {
22
- error: (error: Error | unknown, message?: string, meta?: Record<string, unknown>) => void;
23
- info: (message: string, meta?: Record<string, unknown>) => void;
24
- warn: (message: string, meta?: Record<string, unknown>) => void;
25
- debug: (message: string, meta?: Record<string, unknown>) => void;
26
- };
27
- }
28
- //# sourceMappingURL=base.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"base.d.ts","sourceRoot":"","sources":["../../../src/queue/processor/base.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,QAAQ,CAAC;AAClC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AACzD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAChE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,iDAAiD,CAAC;AAEzF,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,KAAK,YAAY,MAAM,wBAAwB,CAAC;AAEvD,MAAM,CAAC,OAAO,CAAC,QAAQ,OAAO,aAAa;IAIvC,SAAS,CAAC,YAAY,EAAE,YAAY;IACpC,SAAS,CAAC,iBAAiB,EAAE,iBAAiB;IAC9C,SAAS,CAAC,aAAa,EAAE,aAAa;IACtC,SAAS,CAAC,gBAAgB,EAAE,gBAAgB,GAAG,IAAI;IACnD,SAAS,CAAC,YAAY,CAAC,EAAE,YAAY;IAPvC,OAAO,CAAC,MAAM,CAAyB;gBAG3B,YAAY,EAAE,YAAY,EAC1B,iBAAiB,EAAE,iBAAiB,EACpC,aAAa,EAAE,aAAa,EAC5B,gBAAgB,EAAE,gBAAgB,GAAG,IAAI,EACzC,YAAY,CAAC,EAAE,YAAY,YAAA;aAGvB,OAAO,CAAC,EAAE,GAAG,EAAE,EAAE;QAAE,GAAG,EAAE,GAAG,CAAA;KAAE,GAAG,OAAO,CAAC,GAAG,CAAC;IAE5D;;OAEG;IACI,GAAG;uBACO,KAAK,GAAG,OAAO,YAAY,MAAM,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAG,IAAI;wBAavE,MAAM,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAG,IAAI;wBAI7C,MAAM,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAG,IAAI;yBAI5C,MAAM,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAG,IAAI;MAG9D;CACH"}
@@ -1,15 +0,0 @@
1
- import type QueueManager from '../manager.js';
2
- import type { ApplicationConfig } from '../../application/base-application.interface.js';
3
- import type { RedisInstance } from '../../redis/index.js';
4
- import type { DatabaseInstance } from '../../database/index.js';
5
- import type EventManager from '../../event/manager.js';
6
- import type BaseProcessor from './base.js';
7
- export interface ProcessorConstructorParams {
8
- queueManager: QueueManager;
9
- applicationConfig: ApplicationConfig;
10
- redisInstance: RedisInstance;
11
- databaseInstance: DatabaseInstance | null;
12
- eventManager?: EventManager;
13
- }
14
- export type ProcessorConstructor = new (queueManager: QueueManager, applicationConfig: ApplicationConfig, redisInstance: RedisInstance, databaseInstance: DatabaseInstance | null, eventManager?: EventManager) => BaseProcessor;
15
- //# sourceMappingURL=processor.interface.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"processor.interface.d.ts","sourceRoot":"","sources":["../../../src/queue/processor/processor.interface.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,YAAY,MAAM,eAAe,CAAC;AAC9C,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,iDAAiD,CAAC;AACzF,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAChE,OAAO,KAAK,YAAY,MAAM,wBAAwB,CAAC;AACvD,OAAO,KAAK,aAAa,MAAM,WAAW,CAAC;AAE3C,MAAM,WAAW,0BAA0B;IACzC,YAAY,EAAE,YAAY,CAAC;IAC3B,iBAAiB,EAAE,iBAAiB,CAAC;IACrC,aAAa,EAAE,aAAa,CAAC;IAC7B,gBAAgB,EAAE,gBAAgB,GAAG,IAAI,CAAC;IAC1C,YAAY,CAAC,EAAE,YAAY,CAAC;CAC7B;AAED,MAAM,MAAM,oBAAoB,GAAG,KACjC,YAAY,EAAE,YAAY,EAC1B,iBAAiB,EAAE,iBAAiB,EACpC,aAAa,EAAE,aAAa,EAC5B,gBAAgB,EAAE,gBAAgB,GAAG,IAAI,EACzC,YAAY,CAAC,EAAE,YAAY,KACxB,aAAa,CAAC"}
@@ -1,14 +0,0 @@
1
- import { Worker } from 'bullmq';
2
- import type { QueueWorkerConstructorParams } from './worker.interface.js';
3
- export default class QueueWorker extends Worker {
4
- private applicationConfig;
5
- private queueManager;
6
- private redisInstance;
7
- constructor({ applicationConfig, queueManager, name, processor, options, redisInstance, }: QueueWorkerConstructorParams);
8
- private onWorkerActive;
9
- private onWorkerError;
10
- private onWorkerFailed;
11
- private onWorkerStalled;
12
- private onWorkerCompleted;
13
- }
14
- //# sourceMappingURL=worker.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"worker.d.ts","sourceRoot":"","sources":["../../src/queue/worker.ts"],"names":[],"mappings":"AAAA,OAAO,EAA4B,MAAM,EAAE,MAAM,QAAQ,CAAC;AAC1D,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,uBAAuB,CAAC;AAQ1E,MAAM,CAAC,OAAO,OAAO,WAAY,SAAQ,MAAM;IAC7C,OAAO,CAAC,iBAAiB,CAAoB;IAE7C,OAAO,CAAC,YAAY,CAAe;IACnC,OAAO,CAAC,aAAa,CAAgB;gBAEzB,EACV,iBAAiB,EACjB,YAAY,EACZ,IAAI,EACJ,SAAS,EACT,OAAO,EACP,aAAa,GACd,EAAE,4BAA4B;IAe/B,OAAO,CAAC,cAAc,CAMpB;IAEF,OAAO,CAAC,aAAa,CAEnB;IAEF,OAAO,CAAC,cAAc,CAcpB;IAEF,OAAO,CAAC,eAAe,CAErB;IAEF,OAAO,CAAC,iBAAiB,CAwBvB;CACH"}
@@ -1,13 +0,0 @@
1
- import type { Processor, WorkerOptions } from 'bullmq';
2
- import type { RedisInstance } from '../redis/index.js';
3
- import type { ApplicationConfig } from '../application/base-application.interface.js';
4
- import type QueueManager from './manager.js';
5
- export interface QueueWorkerConstructorParams {
6
- applicationConfig: ApplicationConfig;
7
- queueManager: QueueManager;
8
- name: string;
9
- processor: string | URL | Processor<any, any, string> | null | undefined;
10
- options?: WorkerOptions;
11
- redisInstance: RedisInstance;
12
- }
13
- //# sourceMappingURL=worker.interface.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"worker.interface.d.ts","sourceRoot":"","sources":["../../src/queue/worker.interface.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,QAAQ,CAAC;AACvD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AACvD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,8CAA8C,CAAC;AACtF,OAAO,KAAK,YAAY,MAAM,cAAc,CAAC;AAE7C,MAAM,WAAW,4BAA4B;IAC3C,iBAAiB,EAAE,iBAAiB,CAAC;IACrC,YAAY,EAAE,YAAY,CAAC;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,MAAM,GAAG,GAAG,GAAG,SAAS,CAAC,GAAG,EAAE,GAAG,EAAE,MAAM,CAAC,GAAG,IAAI,GAAG,SAAS,CAAC;IACzE,OAAO,CAAC,EAAE,aAAa,CAAC;IACxB,aAAa,EAAE,aAAa,CAAC;CAC9B"}
@@ -1,3 +0,0 @@
1
- export { default as RedisManager } from './manager.js';
2
- export { default as RedisInstance } from './instance.js';
3
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/redis/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,cAAc,CAAC;AACvD,OAAO,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,eAAe,CAAC"}
@@ -1,32 +0,0 @@
1
- import type { Redis } from 'ioredis';
2
- import type { RedisInstanceProps } from './instance.interface.js';
3
- export default class RedisInstance {
4
- private redisManager;
5
- client: Redis;
6
- publisherClient: Redis;
7
- subscriberClient: Redis;
8
- constructor({ redisManager, client, publisherClient, subscriberClient }: RedisInstanceProps);
9
- disconnect(): Promise<void>;
10
- isConnected(): Promise<boolean>;
11
- /**
12
- * Sets a value in the cache with an optional expiration time.
13
- *
14
- * @param key - The key to set in the cache.
15
- * @param value - The value to set in the cache.
16
- * @param expiration - The expiration time in seconds (optional).
17
- * @throws Error if the value type is not supported.
18
- * @returns A Promise that resolves when the value is set in the cache.
19
- */
20
- setCache({ key, value, expiration, }: {
21
- key: string;
22
- value: unknown;
23
- expiration?: number;
24
- }): Promise<void>;
25
- getCache({ key }: {
26
- key: string;
27
- }): Promise<string | null>;
28
- deleteCache({ key }: {
29
- key: string;
30
- }): Promise<void>;
31
- }
32
- //# sourceMappingURL=instance.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"instance.d.ts","sourceRoot":"","sources":["../../src/redis/instance.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAErC,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAGlE,MAAM,CAAC,OAAO,OAAO,aAAa;IAChC,OAAO,CAAC,YAAY,CAAe;IAE5B,MAAM,EAAE,KAAK,CAAC;IACd,eAAe,EAAE,KAAK,CAAC;IACvB,gBAAgB,EAAE,KAAK,CAAC;gBAEnB,EAAE,YAAY,EAAE,MAAM,EAAE,eAAe,EAAE,gBAAgB,EAAE,EAAE,kBAAkB;IAQ9E,UAAU,IAAI,OAAO,CAAC,IAAI,CAAC;IAsBjC,WAAW,IAAI,OAAO,CAAC,OAAO,CAAC;IAgBtC;;;;;;;;OAQG;IACU,QAAQ,CAAC,EACpB,GAAG,EACH,KAAK,EACL,UAAU,GACX,EAAE;QACD,GAAG,EAAE,MAAM,CAAC;QACZ,KAAK,EAAE,OAAO,CAAC;QACf,UAAU,CAAC,EAAE,MAAM,CAAC;KACrB,GAAG,OAAO,CAAC,IAAI,CAAC;IAoBJ,QAAQ,CAAC,EAAE,GAAG,EAAE,EAAE;QAAE,GAAG,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC;IAM1D,WAAW,CAAC,EAAE,GAAG,EAAE,EAAE;QAAE,GAAG,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC,IAAI,CAAC;CAGlE"}
@@ -1,9 +0,0 @@
1
- import type { Redis } from 'ioredis';
2
- import type { RedisManager } from './index.js';
3
- export interface RedisInstanceProps {
4
- redisManager: RedisManager;
5
- client: Redis;
6
- publisherClient: Redis;
7
- subscriberClient: Redis;
8
- }
9
- //# sourceMappingURL=instance.interface.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"instance.interface.d.ts","sourceRoot":"","sources":["../../src/redis/instance.interface.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAE/C,MAAM,WAAW,kBAAkB;IACjC,YAAY,EAAE,YAAY,CAAC;IAC3B,MAAM,EAAE,KAAK,CAAC;IACd,eAAe,EAAE,KAAK,CAAC;IACvB,gBAAgB,EAAE,KAAK,CAAC;CACzB"}
@@ -1,15 +0,0 @@
1
- import type { RedisManagerConfig as RedisManagerOptions } from './manager.interface.js';
2
- import RedisInstance from './instance.js';
3
- export default class RedisManager {
4
- private logger;
5
- private options;
6
- instances: RedisInstance[];
7
- constructor(config: RedisManagerOptions);
8
- connect(): Promise<RedisInstance>;
9
- disconnect(): Promise<void>;
10
- /**
11
- * Log Redis message
12
- */
13
- log(message: string, meta?: Record<string, unknown>): void;
14
- }
15
- //# sourceMappingURL=manager.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"manager.d.ts","sourceRoot":"","sources":["../../src/redis/manager.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,kBAAkB,IAAI,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AACxF,OAAO,aAAa,MAAM,eAAe,CAAC;AA2I1C,MAAM,CAAC,OAAO,OAAO,YAAY;IAC/B,OAAO,CAAC,MAAM,CAAyB;IAEvC,OAAO,CAAC,OAAO,CAAsB;IAE9B,SAAS,EAAE,aAAa,EAAE,CAAM;gBAE3B,MAAM,EAAE,mBAAmB;IAI1B,OAAO,IAAI,OAAO,CAAC,aAAa,CAAC;IA8GjC,UAAU,IAAI,OAAO,CAAC,IAAI,CAAC;IAiDxC;;OAEG;IACI,GAAG,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI;CAGlE"}
@@ -1,8 +0,0 @@
1
- import type { ApplicationConfig } from '../application/base-application.interface.js';
2
- export interface RedisManagerConfig {
3
- applicationConfig: ApplicationConfig;
4
- host: string;
5
- port: number;
6
- password?: string;
7
- }
8
- //# sourceMappingURL=manager.interface.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"manager.interface.d.ts","sourceRoot":"","sources":["../../src/redis/manager.interface.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,8CAA8C,CAAC;AAEtF,MAAM,WAAW,kBAAkB;IACjC,iBAAiB,EAAE,iBAAiB,CAAC;IACrC,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB"}
@@ -1,3 +0,0 @@
1
- export type { RequestContext, RunWithContextOptions } from './request-context.interface.js';
2
- export { getRequestContext, getRequestId, getUserId, setUserId, getContextMetadata, setContextMetadata, runWithContext, runWithContextAsync, enterRequestContext, requestContextStorage, } from './request-context.js';
3
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/request-context/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,cAAc,EAAE,qBAAqB,EAAE,MAAM,gCAAgC,CAAC;AAC5F,OAAO,EACL,iBAAiB,EACjB,YAAY,EACZ,SAAS,EACT,SAAS,EACT,kBAAkB,EAClB,kBAAkB,EAClB,cAAc,EACd,mBAAmB,EACnB,mBAAmB,EACnB,qBAAqB,GACtB,MAAM,sBAAsB,CAAC"}
@@ -1,108 +0,0 @@
1
- import { AsyncLocalStorage } from 'node:async_hooks';
2
- import type { RequestContext, RunWithContextOptions } from './request-context.interface.js';
3
- /**
4
- * AsyncLocalStorage instance for request context
5
- *
6
- * This provides request-scoped storage that automatically propagates through
7
- * async operations, enabling correlation IDs and request metadata to be
8
- * accessible throughout the request lifecycle without explicit passing.
9
- */
10
- declare const requestContextStorage: AsyncLocalStorage<RequestContext>;
11
- /**
12
- * Get the current request context
13
- *
14
- * @returns The current request context, or undefined if not in a request context
15
- *
16
- * @example
17
- * const context = getRequestContext();
18
- * if (context) {
19
- * console.log('Request ID:', context.requestId);
20
- * }
21
- */
22
- export declare function getRequestContext(): RequestContext | undefined;
23
- /**
24
- * Get the current request ID
25
- *
26
- * @returns The current request ID, or undefined if not in a request context
27
- *
28
- * @example
29
- * const requestId = getRequestId();
30
- * logger.info({ message: 'Processing request', requestId });
31
- */
32
- export declare function getRequestId(): string | undefined;
33
- /**
34
- * Set metadata in the current request context
35
- *
36
- * @param key - Metadata key
37
- * @param value - Metadata value
38
- *
39
- * @example
40
- * setContextMetadata('operation', 'userLookup');
41
- * setContextMetadata('cacheHit', true);
42
- */
43
- export declare function setContextMetadata(key: string, value: unknown): void;
44
- /**
45
- * Get metadata from the current request context
46
- *
47
- * @param key - Metadata key
48
- * @returns Metadata value, or undefined if not found
49
- */
50
- export declare function getContextMetadata(key: string): unknown;
51
- /**
52
- * Run a function within a new request context
53
- *
54
- * @param options - Context options (requestId will be generated if not provided)
55
- * @param fn - Function to run within the context
56
- * @returns The result of the function
57
- *
58
- * @example
59
- * await runWithContext({ requestId: 'custom-id' }, async () => {
60
- * await processRequest();
61
- * });
62
- */
63
- export declare function runWithContext<T>(options: RunWithContextOptions | undefined, fn: () => T): T;
64
- /**
65
- * Run a function within a new request context (async version)
66
- *
67
- * @param options - Context options (requestId will be generated if not provided)
68
- * @param fn - Async function to run within the context
69
- * @returns Promise resolving to the result of the function
70
- *
71
- * @example
72
- * await runWithContextAsync({ requestId: 'custom-id' }, async () => {
73
- * await processRequest();
74
- * });
75
- */
76
- export declare function runWithContextAsync<T>(options: RunWithContextOptions | undefined, fn: () => Promise<T>): Promise<T>;
77
- /**
78
- * Update the user ID in the current request context
79
- *
80
- * @param userId - User ID to set
81
- *
82
- * @example
83
- * // After authentication
84
- * setUserId(authenticatedUser.id);
85
- */
86
- export declare function setUserId(userId: string): void;
87
- /**
88
- * Get the user ID from the current request context
89
- *
90
- * @returns The current user ID, or undefined if not set
91
- */
92
- export declare function getUserId(): string | undefined;
93
- /**
94
- * Enter a new request context (advanced usage for middleware)
95
- *
96
- * This sets the context for the current async execution context without
97
- * wrapping in a callback. Use with caution - prefer runWithContext when possible.
98
- *
99
- * @param options - Context options
100
- *
101
- * @example
102
- * // In Fastify middleware
103
- * const requestId = req.headers['x-request-id'] || crypto.randomUUID();
104
- * enterRequestContext({ requestId });
105
- */
106
- export declare function enterRequestContext(options: RunWithContextOptions): void;
107
- export { requestContextStorage };
108
- //# sourceMappingURL=request-context.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"request-context.d.ts","sourceRoot":"","sources":["../../src/request-context/request-context.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAErD,OAAO,KAAK,EAAE,cAAc,EAAE,qBAAqB,EAAE,MAAM,gCAAgC,CAAC;AAE5F;;;;;;GAMG;AACH,QAAA,MAAM,qBAAqB,mCAA0C,CAAC;AAEtE;;;;;;;;;;GAUG;AACH,wBAAgB,iBAAiB,IAAI,cAAc,GAAG,SAAS,CAE9D;AAED;;;;;;;;GAQG;AACH,wBAAgB,YAAY,IAAI,MAAM,GAAG,SAAS,CAEjD;AAED;;;;;;;;;GASG;AACH,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,GAAG,IAAI,CAOpE;AAED;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAGvD;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,cAAc,CAAC,CAAC,EAAE,OAAO,EAAE,qBAAqB,GAAG,SAAS,EAAE,EAAE,EAAE,MAAM,CAAC,GAAG,CAAC,CAS5F;AAED;;;;;;;;;;;GAWG;AACH,wBAAsB,mBAAmB,CAAC,CAAC,EACzC,OAAO,EAAE,qBAAqB,GAAG,SAAS,EAC1C,EAAE,EAAE,MAAM,OAAO,CAAC,CAAC,CAAC,GACnB,OAAO,CAAC,CAAC,CAAC,CASZ;AAED;;;;;;;;GAQG;AACH,wBAAgB,SAAS,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAK9C;AAED;;;;GAIG;AACH,wBAAgB,SAAS,IAAI,MAAM,GAAG,SAAS,CAE9C;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,qBAAqB,GAAG,IAAI,CASxE;AAGD,OAAO,EAAE,qBAAqB,EAAE,CAAC"}
@@ -1,46 +0,0 @@
1
- /**
2
- * Request context interface
3
- *
4
- * This interface defines the shape of the context stored in AsyncLocalStorage
5
- * for each HTTP request, providing correlation IDs and request metadata.
6
- */
7
- export interface RequestContext {
8
- /**
9
- * Unique request ID (UUID v4/v7) for tracing/correlation
10
- */
11
- requestId: string;
12
- /**
13
- * Request start time (performance.now() timestamp)
14
- */
15
- startTime?: number;
16
- /**
17
- * Authenticated user ID (if available)
18
- */
19
- userId?: string;
20
- /**
21
- * Additional custom metadata
22
- */
23
- metadata?: Record<string, unknown>;
24
- }
25
- /**
26
- * Options for running code within a request context
27
- */
28
- export interface RunWithContextOptions {
29
- /**
30
- * Request ID to use (generated if not provided)
31
- */
32
- requestId?: string;
33
- /**
34
- * Request start time
35
- */
36
- startTime?: number;
37
- /**
38
- * User ID
39
- */
40
- userId?: string;
41
- /**
42
- * Additional metadata
43
- */
44
- metadata?: Record<string, unknown>;
45
- }
46
- //# sourceMappingURL=request-context.interface.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"request-context.interface.d.ts","sourceRoot":"","sources":["../../src/request-context/request-context.interface.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,MAAM,WAAW,cAAc;IAC7B;;OAEG;IACH,SAAS,EAAE,MAAM,CAAC;IAElB;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACpC;AAED;;GAEG;AACH,MAAM,WAAW,qBAAqB;IACpC;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACpC"}
@@ -1,2 +0,0 @@
1
- export { default as AwsS3 } from './s3.js';
2
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/services/aws/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,KAAK,EAAE,MAAM,SAAS,CAAC"}
@@ -1,54 +0,0 @@
1
- import { S3Client } from '@aws-sdk/client-s3';
2
- import type { AwsS3ConstructorOptions } from './s3.interface.js';
3
- interface DownloadFileOptions {
4
- bucketName: string;
5
- key: string;
6
- destinationFilePath: string;
7
- }
8
- export default class AwsS3 {
9
- client: S3Client;
10
- private options;
11
- constructor(options: Partial<AwsS3ConstructorOptions>);
12
- private getBucketUrl;
13
- uploadFile({ bucketName, path, body, contentType, forceDownload, publicRead, }: {
14
- bucketName: string;
15
- path: string;
16
- body: Buffer;
17
- contentType?: string;
18
- forceDownload?: boolean;
19
- publicRead?: boolean;
20
- }): Promise<string>;
21
- startMultipartUpload({ bucketName, path, publicRead, }: {
22
- bucketName: string;
23
- path: string;
24
- publicRead?: boolean;
25
- }): Promise<string | undefined>;
26
- uploadPart({ bucketName, path, partNumber, uploadId, body, }: {
27
- bucketName: string;
28
- path: string;
29
- partNumber: number;
30
- uploadId: string;
31
- body: any;
32
- }): Promise<string | undefined>;
33
- completeMultipartUpload({ bucketName, path, uploadId, parts, }: {
34
- bucketName: string;
35
- path: string;
36
- uploadId: string;
37
- parts: {
38
- PartNumber: number;
39
- ETag: string;
40
- }[];
41
- }): Promise<string>;
42
- downloadFile({ bucketName, key, destinationFilePath, onStart, onProgress, onComplete, onError, }: DownloadFileOptions & {
43
- onStart?: () => void;
44
- onProgress?: (progress: number) => void;
45
- onComplete?: () => void;
46
- onError?: (error: Error) => void;
47
- }): Promise<void>;
48
- generateSignedUrl({ bucket, key }: {
49
- bucket: string;
50
- key: string;
51
- }): Promise<string>;
52
- }
53
- export {};
54
- //# sourceMappingURL=s3.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"s3.d.ts","sourceRoot":"","sources":["../../../src/services/aws/s3.ts"],"names":[],"mappings":"AAAA,OAAO,EAML,QAAQ,EAGT,MAAM,oBAAoB,CAAC;AAG5B,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,mBAAmB,CAAC;AASjE,UAAU,mBAAmB;IAC3B,UAAU,EAAE,MAAM,CAAC;IACnB,GAAG,EAAE,MAAM,CAAC;IACZ,mBAAmB,EAAE,MAAM,CAAC;CAC7B;AAED,MAAM,CAAC,OAAO,OAAO,KAAK;IACjB,MAAM,EAAE,QAAQ,CAAC;IAExB,OAAO,CAAC,OAAO,CAA0B;gBAE7B,OAAO,EAAE,OAAO,CAAC,uBAAuB,CAAC;IA4CrD,OAAO,CAAC,YAAY;IAYP,UAAU,CAAC,EACtB,UAAU,EACV,IAAI,EACJ,IAAI,EACJ,WAAW,EACX,aAAa,EACb,UAAU,GACX,EAAE;QACD,UAAU,EAAE,MAAM,CAAC;QACnB,IAAI,EAAE,MAAM,CAAC;QACb,IAAI,EAAE,MAAM,CAAC;QACb,WAAW,CAAC,EAAE,MAAM,CAAC;QACrB,aAAa,CAAC,EAAE,OAAO,CAAC;QACxB,UAAU,CAAC,EAAE,OAAO,CAAC;KACtB,GAAG,OAAO,CAAC,MAAM,CAAC;IAuBN,oBAAoB,CAAC,EAChC,UAAU,EACV,IAAI,EACJ,UAAU,GACX,EAAE;QACD,UAAU,EAAE,MAAM,CAAC;QACnB,IAAI,EAAE,MAAM,CAAC;QACb,UAAU,CAAC,EAAE,OAAO,CAAC;KACtB;IAYY,UAAU,CAAC,EACtB,UAAU,EACV,IAAI,EACJ,UAAU,EACV,QAAQ,EACR,IAAI,GACL,EAAE;QACD,UAAU,EAAE,MAAM,CAAC;QACnB,IAAI,EAAE,MAAM,CAAC;QACb,UAAU,EAAE,MAAM,CAAC;QACnB,QAAQ,EAAE,MAAM,CAAC;QACjB,IAAI,EAAE,GAAG,CAAC;KACX,GAAG,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC;IAclB,uBAAuB,CAAC,EACnC,UAAU,EACV,IAAI,EACJ,QAAQ,EACR,KAAK,GACN,EAAE;QACD,UAAU,EAAE,MAAM,CAAC;QACnB,IAAI,EAAE,MAAM,CAAC;QACb,QAAQ,EAAE,MAAM,CAAC;QACjB,KAAK,EAAE;YAAE,UAAU,EAAE,MAAM,CAAC;YAAC,IAAI,EAAE,MAAM,CAAA;SAAE,EAAE,CAAC;KAC/C;IA0BK,YAAY,CAAC,EACjB,UAAU,EACV,GAAG,EACH,mBAAmB,EACnB,OAAO,EACP,UAAU,EACV,UAAU,EACV,OAAO,GACR,EAAE,mBAAmB,GAAG;QACvB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;QACrB,UAAU,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,IAAI,CAAC;QACxC,UAAU,CAAC,EAAE,MAAM,IAAI,CAAC;QACxB,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,CAAC;KAClC,GAAG,OAAO,CAAC,IAAI,CAAC;IA+EJ,iBAAiB,CAAC,EAAE,MAAM,EAAE,GAAG,EAAE,EAAE;QAAE,MAAM,EAAE,MAAM,CAAC;QAAC,GAAG,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC,MAAM,CAAC;CA2BlG"}
@@ -1,14 +0,0 @@
1
- export interface AwsS3LocalstackOptions {
2
- enabled?: boolean;
3
- port?: number;
4
- }
5
- export interface AwsS3ConstructorOptions {
6
- region: string;
7
- localstack: AwsS3LocalstackOptions;
8
- credentials?: {
9
- accessKeyId?: string;
10
- secretAccessKey?: string;
11
- };
12
- endpoint?: string;
13
- }
14
- //# sourceMappingURL=s3.interface.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"s3.interface.d.ts","sourceRoot":"","sources":["../../../src/services/aws/s3.interface.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,sBAAsB;IACrC,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,uBAAuB;IACtC,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,EAAE,sBAAsB,CAAC;IACnC,WAAW,CAAC,EAAE;QACZ,WAAW,CAAC,EAAE,MAAM,CAAC;QACrB,eAAe,CAAC,EAAE,MAAM,CAAC;KAC1B,CAAC;IACF,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB"}
@@ -1,2 +0,0 @@
1
- export * from './aws/index.js';
2
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/services/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC"}