@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,58 +0,0 @@
1
- /**
2
- * Check if a file or directory exists asynchronously
3
- * @param pathToCheck - Path to check
4
- * @returns Promise<boolean> - true if exists, false otherwise
5
- */
6
- declare function pathExists(pathToCheck: string): Promise<boolean>;
7
- /**
8
- * Ensure directory exists, create if it doesn't
9
- * @param dirPath - Directory path to ensure
10
- */
11
- declare function ensureDir(dirPath: string): Promise<void>;
12
- declare function convertFile({ inputFilePath, outputFilePath, format, }: {
13
- inputFilePath: string;
14
- outputFilePath: string;
15
- format: string;
16
- }): Promise<void>;
17
- /**
18
- * Copy a file or directory synchronously
19
- *
20
- * @param src The source path
21
- * @param dest The destination path
22
- */
23
- declare function copySync(src: string, dest: string): void;
24
- /**
25
- * Download file from URL
26
- *
27
- * @param url The URL to download the file from
28
- * @param destinationPath The path to save the downloaded file
29
- */
30
- declare function downloadFile({ url, destinationPath }: {
31
- url: string;
32
- destinationPath: string;
33
- }): Promise<void>;
34
- /**
35
- * Format file size.
36
- *
37
- * @param bytes The file size in bytes
38
- */
39
- declare function formatFileSize({ bytes }: {
40
- bytes: number;
41
- }): string;
42
- /**
43
- * Remove a file or directory synchronously
44
- *
45
- * @param target The path to the file or directory to remove
46
- */
47
- declare function removeSync(target: string): void;
48
- declare const _default: {
49
- convertFile: typeof convertFile;
50
- copySync: typeof copySync;
51
- downloadFile: typeof downloadFile;
52
- formatFileSize: typeof formatFileSize;
53
- removeSync: typeof removeSync;
54
- pathExists: typeof pathExists;
55
- ensureDir: typeof ensureDir;
56
- };
57
- export default _default;
58
- //# sourceMappingURL=file.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"file.d.ts","sourceRoot":"","sources":["../../src/util/file.ts"],"names":[],"mappings":"AAUA;;;;GAIG;AACH,iBAAe,UAAU,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAO/D;AAED;;;GAGG;AACH,iBAAe,SAAS,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAMvD;AAED,iBAAe,WAAW,CAAC,EACzB,aAAa,EACb,cAAc,EACd,MAAM,GACP,EAAE;IACD,aAAa,EAAE,MAAM,CAAC;IACtB,cAAc,EAAE,MAAM,CAAC;IACvB,MAAM,EAAE,MAAM,CAAC;CAChB,GAAG,OAAO,CAAC,IAAI,CAAC,CAsBhB;AAED;;;;;GAKG;AACH,iBAAS,QAAQ,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,IAAI,CAmBjD;AAED;;;;;GAKG;AACH,iBAAe,YAAY,CAAC,EAAE,GAAG,EAAE,eAAe,EAAE,EAAE;IAAE,GAAG,EAAE,MAAM,CAAC;IAAC,eAAe,EAAE,MAAM,CAAA;CAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CA4B7G;AAED;;;;GAIG;AACH,iBAAS,cAAc,CAAC,EAAE,KAAK,EAAE,EAAE;IAAE,KAAK,EAAE,MAAM,CAAA;CAAE,GAAG,MAAM,CAyB5D;AAED;;;;GAIG;AACH,iBAAS,UAAU,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAoBxC;;;;;;;;;;AAED,wBAQE"}
@@ -1,52 +0,0 @@
1
- /**
2
- * Deep merge objects with defaults, preventing prototype pollution.
3
- *
4
- * This is a secure wrapper around lodash.defaultsdeep that:
5
- * - Sanitizes sources to remove dangerous keys (__proto__, constructor, prototype)
6
- * - Delegates to battle-tested lodash.defaultsdeep for merge logic
7
- * - Maintains backward compatibility with existing usage
8
- *
9
- * @param target - The target object to merge into
10
- * @param sources - Source objects providing default values
11
- * @returns The merged target object (mutated)
12
- *
13
- * @example
14
- * const userConfig = { host: 'localhost' };
15
- * const defaults = { host: '0.0.0.0', port: 3001 };
16
- * const merged = defaultsDeep(userConfig, defaults);
17
- * // merged = { host: 'localhost', port: 3001 }
18
- */
19
- declare function defaultsDeep(target: any, ...sources: any[]): any;
20
- /**
21
- * Check if a value is an object.
22
- */
23
- declare function isObject(item: any): boolean;
24
- type AnyObject = {
25
- [key: string]: any;
26
- };
27
- /**
28
- * Retrieves the value from an object using a dotted key path safely.
29
- *
30
- * @param obj - The object to retrieve the value from.
31
- * @param path - The dotted key path (e.g., 'user.email').
32
- * @returns The value at the specified key path or undefined if not found.
33
- */
34
- declare function getValueFromObject(obj: AnyObject, path: string): any;
35
- /**
36
- * Retrieves the value from an array of objects using a dotted key path.
37
- *
38
- * @param arr - The array of objects.
39
- * @param path - The dotted key path (e.g., 'user.email').
40
- * @returns An array of values at the specified key path from each object.
41
- */
42
- declare function getValueFromArray(arr: AnyObject[], path: string): any[];
43
- declare function getScriptFileExtension(): string;
44
- declare const _default: {
45
- defaultsDeep: typeof defaultsDeep;
46
- isObject: typeof isObject;
47
- getValueFromArray: typeof getValueFromArray;
48
- getValueFromObject: typeof getValueFromObject;
49
- getScriptFileExtension: typeof getScriptFileExtension;
50
- };
51
- export default _default;
52
- //# sourceMappingURL=helper.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"helper.d.ts","sourceRoot":"","sources":["../../src/util/helper.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;;GAiBG;AACH,iBAAS,YAAY,CAAC,MAAM,EAAE,GAAG,EAAE,GAAG,OAAO,EAAE,GAAG,EAAE,GAAG,GAAG,CAczD;AAED;;GAEG;AACH,iBAAS,QAAQ,CAAC,IAAI,EAAE,GAAG,GAAG,OAAO,CAEpC;AAED,KAAK,SAAS,GAAG;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAA;CAAE,CAAC;AAExC;;;;;;GAMG;AACH,iBAAS,kBAAkB,CAAC,GAAG,EAAE,SAAS,EAAE,IAAI,EAAE,MAAM,GAAG,GAAG,CAW7D;AAED;;;;;;GAMG;AACH,iBAAS,iBAAiB,CAAC,GAAG,EAAE,SAAS,EAAE,EAAE,IAAI,EAAE,MAAM,GAAG,GAAG,EAAE,CAEhE;AAED,iBAAS,sBAAsB,IAAI,MAAM,CAExC;;;;;;;;AAED,wBAME"}
@@ -1,12 +0,0 @@
1
- declare function extractMimeType({ base64 }: {
2
- base64: string;
3
- }): string | undefined;
4
- declare function mimeTypeToExtension({ mimeType }: {
5
- mimeType: string;
6
- }): string | undefined;
7
- declare const _default: {
8
- extractMimeType: typeof extractMimeType;
9
- mimeTypeToExtension: typeof mimeTypeToExtension;
10
- };
11
- export default _default;
12
- //# sourceMappingURL=image.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"image.d.ts","sourceRoot":"","sources":["../../src/util/image.ts"],"names":[],"mappings":"AAAA,iBAAS,eAAe,CAAC,EAAE,MAAM,EAAE,EAAE;IAAE,MAAM,EAAE,MAAM,CAAA;CAAE,GAAG,MAAM,GAAG,SAAS,CAO3E;AAED,iBAAS,mBAAmB,CAAC,EAAE,QAAQ,EAAE,EAAE;IAAE,QAAQ,EAAE,MAAM,CAAA;CAAE,GAAG,MAAM,GAAG,SAAS,CAenF;;;;;AAED,wBAGE"}
@@ -1,11 +0,0 @@
1
- export { default as Time } from './time.js';
2
- export { default as Timing } from './timing.js';
3
- export { default as File } from './file.js';
4
- export { default as Helper } from './helper.js';
5
- export { default as Image } from './image.js';
6
- export { default as Loader } from './loader.js';
7
- export { default as Num } from './num.js';
8
- export { default as OS } from './os.js';
9
- export { default as Str } from './str.js';
10
- export { default as URL } from './url.js';
11
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/util/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,IAAI,EAAE,MAAM,WAAW,CAAC;AAC5C,OAAO,EAAE,OAAO,IAAI,MAAM,EAAE,MAAM,aAAa,CAAC;AAChD,OAAO,EAAE,OAAO,IAAI,IAAI,EAAE,MAAM,WAAW,CAAC;AAC5C,OAAO,EAAE,OAAO,IAAI,MAAM,EAAE,MAAM,aAAa,CAAC;AAChD,OAAO,EAAE,OAAO,IAAI,KAAK,EAAE,MAAM,YAAY,CAAC;AAC9C,OAAO,EAAE,OAAO,IAAI,MAAM,EAAE,MAAM,aAAa,CAAC;AAChD,OAAO,EAAE,OAAO,IAAI,GAAG,EAAE,MAAM,UAAU,CAAC;AAC1C,OAAO,EAAE,OAAO,IAAI,EAAE,EAAE,MAAM,SAAS,CAAC;AACxC,OAAO,EAAE,OAAO,IAAI,GAAG,EAAE,MAAM,UAAU,CAAC;AAC1C,OAAO,EAAE,OAAO,IAAI,GAAG,EAAE,MAAM,UAAU,CAAC"}
@@ -1,19 +0,0 @@
1
- declare const _default: {
2
- loadModulesInDirectory: ({ directory, extensions, }: {
3
- directory: string;
4
- extensions?: string[];
5
- }) => Promise<{
6
- [key: string]: any;
7
- }>;
8
- loadEntityModule: ({ entitiesDirectory, entityName, }: {
9
- entitiesDirectory: string;
10
- entityName: string;
11
- }) => Promise<any>;
12
- clearModuleCache: () => void;
13
- getCacheStats: () => {
14
- modulesCached: number;
15
- entitiesCached: number;
16
- };
17
- };
18
- export default _default;
19
- //# sourceMappingURL=loader.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"loader.d.ts","sourceRoot":"","sources":["../../src/util/loader.ts"],"names":[],"mappings":";yDAoBG;QACD,SAAS,EAAE,MAAM,CAAC;QAClB,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC;KACvB,KAAG,OAAO,CAAC;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAA;KAAE,CAAC;2DAwDhC;QACD,iBAAiB,EAAE,MAAM,CAAC;QAC1B,UAAU,EAAE,MAAM,CAAC;KACpB,KAAG,OAAO,CAAC,GAAG,CAAC;4BAkCa,IAAI;yBAKP;QAAE,aAAa,EAAE,MAAM,CAAC;QAAC,cAAc,EAAE,MAAM,CAAA;KAAE;;AAO3E,wBAKE"}
@@ -1,13 +0,0 @@
1
- declare const _default: {
2
- getRandomNumber: ({ min, max }: {
3
- min: number;
4
- max: number;
5
- }) => number;
6
- clamp: ({ value, min, max }: {
7
- value: number;
8
- min: number;
9
- max: number;
10
- }) => number;
11
- };
12
- export default _default;
13
- //# sourceMappingURL=num.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"num.d.ts","sourceRoot":"","sources":["../../src/util/num.ts"],"names":[],"mappings":";oCAAuC;QAAE,GAAG,EAAE,MAAM,CAAC;QAAC,GAAG,EAAE,MAAM,CAAA;KAAE,KAAG,MAAM;iCAIxC;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,GAAG,EAAE,MAAM,CAAC;QAAC,GAAG,EAAE,MAAM,CAAA;KAAE,KAAG,MAAM;;AAIxF,wBAGE"}
package/dist/util/os.d.ts DELETED
@@ -1,6 +0,0 @@
1
- declare function getUniqueComputerId(): string;
2
- declare const _default: {
3
- getUniqueComputerId: typeof getUniqueComputerId;
4
- };
5
- export default _default;
6
- //# sourceMappingURL=os.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"os.d.ts","sourceRoot":"","sources":["../../src/util/os.ts"],"names":[],"mappings":"AAGA,iBAAS,mBAAmB,IAAI,MAAM,CAarC;;;;AAED,wBAEE"}
@@ -1,39 +0,0 @@
1
- /**
2
- * Generate a unique id.
3
- */
4
- declare function generateUniqueId(): string;
5
- /**
6
- * Slugify string.
7
- */
8
- declare function slugify({ text }: {
9
- text: string;
10
- }): string;
11
- /**
12
- * Make text title case.
13
- */
14
- declare function titleCase({ text }: {
15
- text: string;
16
- }): string;
17
- /**
18
- * Remove file extension from filename.
19
- */
20
- declare function removeFileExtension({ filename }: {
21
- filename: string;
22
- }): string;
23
- /**
24
- * Get file extension from filename.
25
- * @param filename
26
- * @returns File extension
27
- */
28
- declare function getFileExtension({ filename }: {
29
- filename: string;
30
- }): string;
31
- declare const _default: {
32
- generateUniqueId: typeof generateUniqueId;
33
- slugify: typeof slugify;
34
- titleCase: typeof titleCase;
35
- removeFileExtension: typeof removeFileExtension;
36
- getFileExtension: typeof getFileExtension;
37
- };
38
- export default _default;
39
- //# sourceMappingURL=str.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"str.d.ts","sourceRoot":"","sources":["../../src/util/str.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,iBAAS,gBAAgB,IAAI,MAAM,CAElC;AAED;;GAEG;AACH,iBAAS,OAAO,CAAC,EAAE,IAAI,EAAE,EAAE;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,GAAG,MAAM,CAQnD;AAED;;GAEG;AACH,iBAAS,SAAS,CAAC,EAAE,IAAI,EAAE,EAAE;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,GAAG,MAAM,CAMrD;AAED;;GAEG;AACH,iBAAS,mBAAmB,CAAC,EAAE,QAAQ,EAAE,EAAE;IAAE,QAAQ,EAAE,MAAM,CAAA;CAAE,GAAG,MAAM,CAEvE;AAED;;;;GAIG;AACH,iBAAS,gBAAgB,CAAC,EAAE,QAAQ,EAAE,EAAE;IAAE,QAAQ,EAAE,MAAM,CAAA;CAAE,GAAG,MAAM,CAEpE;;;;;;;;AAED,wBAME"}
@@ -1,19 +0,0 @@
1
- import type { FormatRelativeTimeOptions, FormatTimeOptions } from './time.interface.js';
2
- import Timing from './timing.js';
3
- declare const _default: {
4
- calculateElapsedTimeMs: ({ startTime }: {
5
- startTime: number;
6
- }) => number;
7
- formatTime: ({ time, format, numDecimals, showUnit }: FormatTimeOptions) => string;
8
- formatRelativeTime: ({ date, baseDate, includeSeconds, }: FormatRelativeTimeOptions) => string;
9
- sleep: ({ seconds }: {
10
- seconds: number;
11
- }) => Promise<void>;
12
- now: typeof Timing.now;
13
- start: typeof Timing.start;
14
- measure: typeof Timing.measure;
15
- measureSync: typeof Timing.measureSync;
16
- duration: typeof Timing.duration;
17
- };
18
- export default _default;
19
- //# sourceMappingURL=time.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"time.d.ts","sourceRoot":"","sources":["../../src/util/time.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,yBAAyB,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxF,OAAO,MAAM,MAAM,aAAa,CAAC;;4CAMc;QAAE,SAAS,EAAE,MAAM,CAAA;KAAE,KAAG,MAAM;0DAOI,iBAAiB,KAAG,MAAM;8DA4CxG,yBAAyB,KAAG,MAAM;yBAbT;QAAE,OAAO,EAAE,MAAM,CAAA;KAAE,KAAG,OAAO,CAAC,IAAI,CAAC;;;;;;;AA6D/D,wBAWE"}
@@ -1,12 +0,0 @@
1
- export interface FormatTimeOptions {
2
- time: number;
3
- format?: 'ms' | 's' | 'auto' | 'hh:mm:ss';
4
- numDecimals?: number;
5
- showUnit?: boolean;
6
- }
7
- export interface FormatRelativeTimeOptions {
8
- date: Date;
9
- baseDate?: Date;
10
- includeSeconds?: boolean;
11
- }
12
- //# sourceMappingURL=time.interface.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"time.interface.d.ts","sourceRoot":"","sources":["../../src/util/time.interface.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,iBAAiB;IAChC,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,CAAC,EAAE,IAAI,GAAG,GAAG,GAAG,MAAM,GAAG,UAAU,CAAC;IAC1C,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,MAAM,WAAW,yBAAyB;IACxC,IAAI,EAAE,IAAI,CAAC;IACX,QAAQ,CAAC,EAAE,IAAI,CAAC;IAChB,cAAc,CAAC,EAAE,OAAO,CAAC;CAC1B"}
@@ -1,36 +0,0 @@
1
- import type { MeasureOptions, Timer, TimingResult } from './timing.interface.js';
2
- /**
3
- * Modern high-resolution timing utility using performance.now()
4
- *
5
- * Provides simple APIs for measuring function execution time and manual timing.
6
- * All durations are returned in milliseconds with decimal precision.
7
- */
8
- declare class Timing {
9
- /**
10
- * Get current high-resolution timestamp in milliseconds.
11
- * Uses performance.now() which provides sub-millisecond precision.
12
- */
13
- static now(): number;
14
- /**
15
- * Start a timer and return a Timer instance.
16
- * Call timer.stop() to get elapsed time in milliseconds.
17
- */
18
- static start(): Timer;
19
- /**
20
- * Measure the execution time of a function (async or sync).
21
- * Returns both the function result and timing information.
22
- */
23
- static measure<T>(fn: () => T | Promise<T>, options?: MeasureOptions): Promise<TimingResult<T>>;
24
- /**
25
- * Measure the execution time of a synchronous function.
26
- * Returns both the function result and timing information.
27
- */
28
- static measureSync<T>(fn: () => T, options?: MeasureOptions): TimingResult<T>;
29
- /**
30
- * Calculate duration between two timestamps in milliseconds.
31
- * Both timestamps should be from performance.now().
32
- */
33
- static duration(startTime: number, endTime: number): number;
34
- }
35
- export default Timing;
36
- //# sourceMappingURL=timing.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"timing.d.ts","sourceRoot":"","sources":["../../src/util/timing.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,KAAK,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAqBjF;;;;;GAKG;AACH,cAAM,MAAM;IACV;;;OAGG;IACH,MAAM,CAAC,GAAG,IAAI,MAAM;IAIpB;;;OAGG;IACH,MAAM,CAAC,KAAK,IAAI,KAAK;IAIrB;;;OAGG;WACU,OAAO,CAAC,CAAC,EAAE,EAAE,EAAE,MAAM,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,EAAE,OAAO,GAAE,cAAmB,GAAG,OAAO,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC;IAwBzG;;;OAGG;IACH,MAAM,CAAC,WAAW,CAAC,CAAC,EAAE,EAAE,EAAE,MAAM,CAAC,EAAE,OAAO,GAAE,cAAmB,GAAG,YAAY,CAAC,CAAC,CAAC;IAwBjF;;;OAGG;IACH,MAAM,CAAC,QAAQ,CAAC,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,MAAM;CAG5D;AAED,eAAe,MAAM,CAAC"}
@@ -1,47 +0,0 @@
1
- export interface Timer {
2
- /**
3
- * Stop the timer and return elapsed time in milliseconds with decimal precision.
4
- */
5
- stop(): number;
6
- /**
7
- * Get elapsed time since timer start without stopping the timer.
8
- */
9
- elapsed(): number;
10
- /**
11
- * The start timestamp in milliseconds (performance.now() format).
12
- */
13
- readonly startTime: number;
14
- }
15
- export interface TimingResult<T = any> {
16
- /**
17
- * Duration in milliseconds with decimal precision.
18
- */
19
- duration: number;
20
- /**
21
- * The result returned by the measured function.
22
- */
23
- result: T;
24
- /**
25
- * Start timestamp in milliseconds (performance.now() format).
26
- */
27
- startTime: number;
28
- /**
29
- * End timestamp in milliseconds (performance.now() format).
30
- */
31
- endTime: number;
32
- }
33
- export interface MeasureOptions {
34
- /**
35
- * Optional name for the measurement (useful for logging/debugging).
36
- */
37
- name?: string;
38
- /**
39
- * Whether to log the timing result automatically.
40
- */
41
- log?: boolean;
42
- /**
43
- * Custom logger function to use if log is true.
44
- */
45
- logger?: (message: string, duration: number) => void;
46
- }
47
- //# sourceMappingURL=timing.interface.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"timing.interface.d.ts","sourceRoot":"","sources":["../../src/util/timing.interface.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,KAAK;IACpB;;OAEG;IACH,IAAI,IAAI,MAAM,CAAC;IAEf;;OAEG;IACH,OAAO,IAAI,MAAM,CAAC;IAElB;;OAEG;IACH,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;CAC5B;AAED,MAAM,WAAW,YAAY,CAAC,CAAC,GAAG,GAAG;IACnC;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAC;IAEjB;;OAEG;IACH,MAAM,EAAE,CAAC,CAAC;IAEV;;OAEG;IACH,SAAS,EAAE,MAAM,CAAC;IAElB;;OAEG;IACH,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,cAAc;IAC7B;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IAEd;;OAEG;IACH,GAAG,CAAC,EAAE,OAAO,CAAC;IAEd;;OAEG;IACH,MAAM,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,KAAK,IAAI,CAAC;CACtD"}
@@ -1,7 +0,0 @@
1
- declare const _default: {
2
- buildQueryString: (params: {
3
- [key: string]: string | number | boolean;
4
- }) => string;
5
- };
6
- export default _default;
7
- //# sourceMappingURL=url.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"url.d.ts","sourceRoot":"","sources":["../../src/util/url.ts"],"names":[],"mappings":";+BAAkC;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,CAAA;KAAE,KAAG,MAAM;;AAOvF,wBAEE"}
@@ -1,21 +0,0 @@
1
- import type { FastifyReply, FastifyRequest } from 'fastify';
2
- import type { AuthenticatedUser } from './base.js';
3
- export type { AuthenticatedUser } from './base.js';
4
- export interface AuthenticatedRequest extends FastifyRequest {
5
- user: AuthenticatedUser;
6
- }
7
- export type AuthenticatedRouteHandler = (request: AuthenticatedRequest, reply: FastifyReply) => Promise<void>;
8
- export type RouteHandler = (request: FastifyRequest, reply: FastifyReply) => Promise<void>;
9
- /**
10
- * Higher-order function that wraps a route handler with authentication
11
- * @param handler The route handler that requires authentication
12
- * @param authenticateRequest The authentication method from the controller
13
- * @returns A new route handler with authentication built-in
14
- */
15
- export declare function withAuth(handler: AuthenticatedRouteHandler, authenticateRequest: (request: FastifyRequest, reply: FastifyReply) => Promise<AuthenticatedUser | null>): RouteHandler;
16
- /**
17
- * Method decorator for class-based controllers
18
- * Usage: @requiresAuth()
19
- */
20
- export declare function requiresAuth(): (target: any, propertyKey: string, descriptor: PropertyDescriptor) => PropertyDescriptor;
21
- //# sourceMappingURL=auth-middleware.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"auth-middleware.d.ts","sourceRoot":"","sources":["../../../src/webserver/controller/auth-middleware.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAC5D,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAC;AAEnD,YAAY,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAC;AAEnD,MAAM,WAAW,oBAAqB,SAAQ,cAAc;IAC1D,IAAI,EAAE,iBAAiB,CAAC;CACzB;AAED,MAAM,MAAM,yBAAyB,GAAG,CAAC,OAAO,EAAE,oBAAoB,EAAE,KAAK,EAAE,YAAY,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;AAC9G,MAAM,MAAM,YAAY,GAAG,CAAC,OAAO,EAAE,cAAc,EAAE,KAAK,EAAE,YAAY,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;AAE3F;;;;;GAKG;AACH,wBAAgB,QAAQ,CACtB,OAAO,EAAE,yBAAyB,EAClC,mBAAmB,EAAE,CAAC,OAAO,EAAE,cAAc,EAAE,KAAK,EAAE,YAAY,KAAK,OAAO,CAAC,iBAAiB,GAAG,IAAI,CAAC,GACvG,YAAY,CAed;AAED;;;GAGG;AACH,wBAAgB,YAAY,KACT,QAAQ,GAAG,EAAE,aAAa,MAAM,EAAE,YAAY,kBAAkB,wBAoBlF"}
@@ -1,41 +0,0 @@
1
- import { StatusCodes } from 'http-status-codes';
2
- import type { FastifyReply, FastifyRequest } from 'fastify';
3
- import type { DatabaseInstance } from '../../database/index.js';
4
- import type { RedisInstance } from '../../redis/index.js';
5
- import type { QueueManager } from '../../queue/index.js';
6
- import type { ApiError, ApiResponse, WebServerBaseControllerConstructorParams } from './base.interface.js';
7
- import type { ApplicationConfig } from '../../application/base-application.interface.js';
8
- import type EventManager from '../../event/manager.js';
9
- import type { WebServerOptions } from '../webserver.interface.js';
10
- import type { LifecycleManager } from '../../lifecycle/lifecycle-manager.js';
11
- export interface AuthenticatedUser {
12
- userId: number;
13
- payload: any;
14
- }
15
- export default abstract class BaseController {
16
- protected workerId: number | undefined;
17
- protected applicationConfig: ApplicationConfig;
18
- protected webServerOptions: WebServerOptions;
19
- protected redisInstance: RedisInstance;
20
- protected queueManager: QueueManager;
21
- protected eventManager: EventManager;
22
- protected databaseInstance: DatabaseInstance;
23
- protected lifecycleManager: LifecycleManager;
24
- constructor({ applicationConfig, webServerOptions, redisInstance, queueManager, eventManager, databaseInstance, lifecycleManager, }: WebServerBaseControllerConstructorParams);
25
- protected sendSuccessResponse<T = any>({ reply, data, statusCode, meta, }: {
26
- reply: FastifyReply;
27
- data: T;
28
- statusCode?: StatusCodes;
29
- meta?: ApiResponse<T>['meta'];
30
- }): void;
31
- protected sendNotFoundResponse(reply: FastifyReply, message?: string): void;
32
- protected sendErrorResponse({ reply, error, statusCode, errorType, }: {
33
- reply: FastifyReply;
34
- error: unknown;
35
- statusCode?: StatusCodes;
36
- errorType?: ApiError['type'];
37
- }): void;
38
- private getErrorType;
39
- protected authenticateRequest(request: FastifyRequest, reply: FastifyReply): Promise<AuthenticatedUser | null>;
40
- }
41
- //# sourceMappingURL=base.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"base.d.ts","sourceRoot":"","sources":["../../../src/webserver/controller/base.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,KAAK,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAC5D,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAChE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAC1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WAAW,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC;KAC/B;IAYD,SAAS,CAAC,oBAAoB,CAAC,KAAK,EAAE,YAAY,EAAE,OAAO,GAAE,MAA6B;IAW1F,SAAS,CAAC,iBAAiB,CAAC,EAC1B,KAAK,EACL,KAAK,EACL,UAAoC,EACpC,SAAS,GACV,EAAE;QACD,KAAK,EAAE,YAAY,CAAC;QACpB,KAAK,EAAE,OAAO,CAAC;QACf,UAAU,CAAC,EAAE,WAAW,CAAC;QACzB,SAAS,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,CAAC;KAC9B;IA6CD,OAAO,CAAC,YAAY;cAoBJ,mBAAmB,CAAC,OAAO,EAAE,cAAc,EAAE,KAAK,EAAE,YAAY,GAAG,OAAO,CAAC,iBAAiB,GAAG,IAAI,CAAC;CAwErH"}
@@ -1,47 +0,0 @@
1
- import type { ApplicationConfig } from '../../application/base-application.interface.js';
2
- import type { DatabaseInstance } from '../../database/index.js';
3
- import type EventManager from '../../event/manager.js';
4
- import type { QueueManager } from '../../queue/index.js';
5
- import type { RedisInstance } from '../../redis/index.js';
6
- import type { WebServerOptions } from '../webserver.interface.js';
7
- import type WebServerBaseController from './base.js';
8
- import type { LifecycleManager } from '../../lifecycle/lifecycle-manager.js';
9
- export interface WebServerBaseControllerConstructorParams {
10
- applicationConfig: ApplicationConfig;
11
- webServerOptions: WebServerOptions;
12
- redisInstance: RedisInstance;
13
- queueManager: QueueManager;
14
- eventManager: EventManager;
15
- databaseInstance: DatabaseInstance;
16
- lifecycleManager: LifecycleManager;
17
- }
18
- export type WebServerBaseControllerType = new (params: WebServerBaseControllerConstructorParams) => WebServerBaseController;
19
- export interface ApiResponse<T = any> {
20
- data?: T;
21
- meta?: {
22
- pagination?: {
23
- page: number;
24
- limit: number;
25
- total: number;
26
- totalPages: number;
27
- };
28
- timestamp: string;
29
- requestId: string;
30
- };
31
- error?: ApiError;
32
- }
33
- export interface ApiError {
34
- message: string;
35
- code?: string;
36
- type: 'validation' | 'authentication' | 'authorization' | 'not_found' | 'server_error' | 'client_error';
37
- details?: any;
38
- timestamp: string;
39
- requestId: string;
40
- }
41
- export interface PaginationParams {
42
- page?: number;
43
- limit?: number;
44
- sortBy?: string;
45
- sortOrder?: 'asc' | 'desc';
46
- }
47
- //# sourceMappingURL=base.interface.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"base.interface.d.ts","sourceRoot":"","sources":["../../../src/webserver/controller/base.interface.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,iDAAiD,CAAC;AACzF,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAChE,OAAO,KAAK,YAAY,MAAM,wBAAwB,CAAC;AACvD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AACzD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAClE,OAAO,KAAK,uBAAuB,MAAM,WAAW,CAAC;AACrD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,sCAAsC,CAAC;AAE7E,MAAM,WAAW,wCAAwC;IACvD,iBAAiB,EAAE,iBAAiB,CAAC;IACrC,gBAAgB,EAAE,gBAAgB,CAAC;IAEnC,aAAa,EAAE,aAAa,CAAC;IAC7B,YAAY,EAAE,YAAY,CAAC;IAC3B,YAAY,EAAE,YAAY,CAAC;IAC3B,gBAAgB,EAAE,gBAAgB,CAAC;IACnC,gBAAgB,EAAE,gBAAgB,CAAC;CACpC;AAED,MAAM,MAAM,2BAA2B,GAAG,KACxC,MAAM,EAAE,wCAAwC,KAC7C,uBAAuB,CAAC;AAE7B,MAAM,WAAW,WAAW,CAAC,CAAC,GAAG,GAAG;IAClC,IAAI,CAAC,EAAE,CAAC,CAAC;IACT,IAAI,CAAC,EAAE;QACL,UAAU,CAAC,EAAE;YACX,IAAI,EAAE,MAAM,CAAC;YACb,KAAK,EAAE,MAAM,CAAC;YACd,KAAK,EAAE,MAAM,CAAC;YACd,UAAU,EAAE,MAAM,CAAC;SACpB,CAAC;QACF,SAAS,EAAE,MAAM,CAAC;QAClB,SAAS,EAAE,MAAM,CAAC;KACnB,CAAC;IACF,KAAK,CAAC,EAAE,QAAQ,CAAC;CAClB;AAED,MAAM,WAAW,QAAQ;IACvB,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,YAAY,GAAG,gBAAgB,GAAG,eAAe,GAAG,WAAW,GAAG,cAAc,GAAG,cAAc,CAAC;IACxG,OAAO,CAAC,EAAE,GAAG,CAAC;IACd,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,gBAAgB;IAC/B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,SAAS,CAAC,EAAE,KAAK,GAAG,MAAM,CAAC;CAC5B"}
@@ -1,94 +0,0 @@
1
- import 'reflect-metadata';
2
- import type { EntityManager } from '@mikro-orm/core';
3
- import type { FastifyReply, FastifyRequest } from 'fastify';
4
- import BaseController from './base.js';
5
- import type { DynamicEntity } from '../../database/dynamic-entity.js';
6
- import type { WebServerBaseControllerConstructorParams } from './base.interface.js';
7
- export default abstract class EntityController extends BaseController {
8
- protected abstract entityName: string;
9
- protected entityManager: EntityManager;
10
- private static entityCache;
11
- constructor(props: WebServerBaseControllerConstructorParams);
12
- protected getEntity: () => Promise<typeof DynamicEntity | undefined>;
13
- private getEntityProperties;
14
- options: (request: FastifyRequest, reply: FastifyReply) => Promise<void>;
15
- metadata: (request: FastifyRequest, reply: FastifyReply) => Promise<void>;
16
- protected preGetMany(_: {
17
- entityManager: EntityManager;
18
- request: FastifyRequest;
19
- reply: FastifyReply;
20
- }): Promise<void>;
21
- protected postGetMany(_: {
22
- entityManager: EntityManager;
23
- request: FastifyRequest;
24
- reply: FastifyReply;
25
- data: {
26
- items: any[];
27
- total: number;
28
- page: number;
29
- totalPages: number;
30
- limit: number;
31
- };
32
- }): Promise<void>;
33
- getMany: (request: FastifyRequest<{
34
- Querystring: {
35
- page: string;
36
- limit: string;
37
- filters: string;
38
- sort: string;
39
- "sort-order": string;
40
- search: string;
41
- [key: string]: any;
42
- };
43
- }>, reply: FastifyReply) => Promise<void>;
44
- protected preGetOne(_: {
45
- entityManager: EntityManager;
46
- request: FastifyRequest;
47
- reply: FastifyReply;
48
- }): Promise<void>;
49
- protected postGetOne(_: {
50
- entityManager: EntityManager;
51
- request: FastifyRequest;
52
- reply: FastifyReply;
53
- item: any;
54
- }): Promise<void>;
55
- getOne: (request: FastifyRequest<{
56
- Params: {
57
- id: number;
58
- };
59
- Querystring: {
60
- populate: string;
61
- };
62
- }>, reply: FastifyReply) => Promise<void>;
63
- protected preCreateOne: ({ request, reply, }: {
64
- request: FastifyRequest;
65
- reply: FastifyReply;
66
- }) => {
67
- request: FastifyRequest;
68
- reply: FastifyReply;
69
- };
70
- protected postCreateOne(_: {
71
- entityManager: EntityManager;
72
- request: FastifyRequest;
73
- reply: FastifyReply;
74
- item: any;
75
- }): Promise<void>;
76
- createOne: (request: FastifyRequest, reply: FastifyReply) => Promise<void>;
77
- protected postUpdateOne(_: {
78
- entityManager: EntityManager;
79
- request: FastifyRequest;
80
- reply: FastifyReply;
81
- item: any;
82
- }): Promise<void>;
83
- updateOne: (request: FastifyRequest<{
84
- Params: {
85
- id: number;
86
- };
87
- }>, reply: FastifyReply) => Promise<void>;
88
- deleteOne: (request: FastifyRequest<{
89
- Params: {
90
- id: number;
91
- };
92
- }>, reply: FastifyReply) => Promise<void>;
93
- }
94
- //# sourceMappingURL=entity.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"entity.d.ts","sourceRoot":"","sources":["../../../src/webserver/controller/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QACpB,IAAI,EAAE,GAAG,CAAC;KACX,GAAG,OAAO,CAAC,IAAI,CAAC;IAEV,SAAS,GAAU,SAAS,cAAc,EAAE,OAAO,YAAY,mBA0CpE;cAEc,aAAa,CAAC,CAAC,EAAE;QAC/B,aAAa,EAAE,aAAa,CAAC;QAC7B,OAAO,EAAE,cAAc,CAAC;QACxB,KAAK,EAAE,YAAY,CAAC;QACpB,IAAI,EAAE,GAAG,CAAC;KACX,GAAG,OAAO,CAAC,IAAI,CAAC;IAEV,SAAS,GAAU,SAAS,cAAc,CAAC;QAAE,MAAM,EAAE;YAAE,EAAE,EAAE,MAAM,CAAA;SAAE,CAAA;KAAE,CAAC,EAAE,OAAO,YAAY,mBAuChG;IAEK,SAAS,GAAU,SAAS,cAAc,CAAC;QAAE,MAAM,EAAE;YAAE,EAAE,EAAE,MAAM,CAAA;SAAE,CAAA;KAAE,CAAC,EAAE,OAAO,YAAY,mBAwBhG;CACH"}
@@ -1,12 +0,0 @@
1
- import type { FastifyReply, FastifyRequest } from 'fastify';
2
- import WebServerBaseController from './base.js';
3
- /**
4
- * Example controller demonstrating simplified authentication
5
- */
6
- export default class ExampleAuthController extends WebServerBaseController {
7
- getUserTickers: import("./auth-middleware.js").RouteHandler;
8
- getUserOrders: (request: FastifyRequest, reply: FastifyReply) => Promise<void>;
9
- getUserProfile: (request: FastifyRequest, reply: FastifyReply) => Promise<void>;
10
- private withAuthentication;
11
- }
12
- //# sourceMappingURL=example-auth.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"example-auth.d.ts","sourceRoot":"","sources":["../../../src/webserver/controller/example-auth.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAC5D,OAAO,uBAAmD,MAAM,WAAW,CAAC;AAG5E;;GAEG;AACH,MAAM,CAAC,OAAO,OAAO,qBAAsB,SAAQ,uBAAuB;IAEjE,cAAc,8CAWmB;IAGjC,aAAa,GAAU,SAAS,cAAc,EAAE,OAAO,YAAY,KAAG,OAAO,CAAC,IAAI,CAAC,CAexF;IAGK,cAAc,GAAU,SAAS,cAAc,EAAE,OAAO,YAAY,KAAG,OAAO,CAAC,IAAI,CAAC,CAWzF;YAGY,kBAAkB;CAcjC"}