@warlock.js/core 4.0.30 → 4.0.39

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 (703) hide show
  1. package/esm/cli/index.js +2 -1
  2. package/esm/cli/index.js.map +1 -1
  3. package/esm/cli/start.js +132 -2
  4. package/esm/cli/start.js.map +1 -1
  5. package/esm/index.js +72 -1
  6. package/esm/index.js.map +1 -1
  7. package/package.json +71 -65
  8. package/esm/application.d.ts +0 -27
  9. package/esm/application.d.ts.map +0 -1
  10. package/esm/bootstrap/setup.d.ts +0 -7
  11. package/esm/bootstrap/setup.d.ts.map +0 -1
  12. package/esm/bootstrap/setup.js +0 -38
  13. package/esm/bootstrap/setup.js.map +0 -1
  14. package/esm/bootstrap.d.ts +0 -2
  15. package/esm/bootstrap.d.ts.map +0 -1
  16. package/esm/bootstrap.js +0 -5
  17. package/esm/bootstrap.js.map +0 -1
  18. package/esm/cache/database-cache-driver.d.ts +0 -56
  19. package/esm/cache/database-cache-driver.d.ts.map +0 -1
  20. package/esm/cache/database-cache-driver.js +0 -96
  21. package/esm/cache/database-cache-driver.js.map +0 -1
  22. package/esm/cache/index.d.ts +0 -3
  23. package/esm/cache/index.d.ts.map +0 -1
  24. package/esm/cache/index.js +0 -1
  25. package/esm/cache/index.js.map +0 -1
  26. package/esm/cli/cli-command.d.ts +0 -115
  27. package/esm/cli/cli-command.d.ts.map +0 -1
  28. package/esm/cli/cli-command.js +0 -224
  29. package/esm/cli/cli-command.js.map +0 -1
  30. package/esm/cli/cli-commands.manager.d.ts +0 -71
  31. package/esm/cli/cli-commands.manager.d.ts.map +0 -1
  32. package/esm/cli/cli-commands.manager.js +0 -345
  33. package/esm/cli/cli-commands.manager.js.map +0 -1
  34. package/esm/cli/cli-commands.utils.d.ts +0 -68
  35. package/esm/cli/cli-commands.utils.d.ts.map +0 -1
  36. package/esm/cli/cli-commands.utils.js +0 -182
  37. package/esm/cli/cli-commands.utils.js.map +0 -1
  38. package/esm/cli/commands/build.command.d.ts +0 -2
  39. package/esm/cli/commands/build.command.d.ts.map +0 -1
  40. package/esm/cli/commands/build.command.js +0 -8
  41. package/esm/cli/commands/build.command.js.map +0 -1
  42. package/esm/cli/commands/dev-server.command.d.ts +0 -2
  43. package/esm/cli/commands/dev-server.command.d.ts.map +0 -1
  44. package/esm/cli/commands/dev-server.command.js +0 -16
  45. package/esm/cli/commands/dev-server.command.js.map +0 -1
  46. package/esm/cli/commands/start-production.command.d.ts +0 -2
  47. package/esm/cli/commands/start-production.command.d.ts.map +0 -1
  48. package/esm/cli/commands/start-production.command.js +0 -65
  49. package/esm/cli/commands/start-production.command.js.map +0 -1
  50. package/esm/cli/commands/typings-generator.command.d.ts +0 -2
  51. package/esm/cli/commands/typings-generator.command.d.ts.map +0 -1
  52. package/esm/cli/commands/typings-generator.command.js +0 -40
  53. package/esm/cli/commands/typings-generator.command.js.map +0 -1
  54. package/esm/cli/commands-loader.d.ts +0 -18
  55. package/esm/cli/commands-loader.d.ts.map +0 -1
  56. package/esm/cli/commands-loader.js +0 -45
  57. package/esm/cli/commands-loader.js.map +0 -1
  58. package/esm/cli/framework-cli-commands.d.ts +0 -2
  59. package/esm/cli/framework-cli-commands.d.ts.map +0 -1
  60. package/esm/cli/framework-cli-commands.js +0 -6
  61. package/esm/cli/framework-cli-commands.js.map +0 -1
  62. package/esm/cli/index.d.ts +0 -3
  63. package/esm/cli/index.d.ts.map +0 -1
  64. package/esm/cli/parse-cli-args.d.ts +0 -18
  65. package/esm/cli/parse-cli-args.d.ts.map +0 -1
  66. package/esm/cli/parse-cli-args.js +0 -82
  67. package/esm/cli/parse-cli-args.js.map +0 -1
  68. package/esm/cli/start.d.ts +0 -2
  69. package/esm/cli/start.d.ts.map +0 -1
  70. package/esm/cli/string-similarity.d.ts +0 -44
  71. package/esm/cli/string-similarity.d.ts.map +0 -1
  72. package/esm/cli/string-similarity.js +0 -57
  73. package/esm/cli/string-similarity.js.map +0 -1
  74. package/esm/cli/types.d.ts +0 -201
  75. package/esm/cli/types.d.ts.map +0 -1
  76. package/esm/config/config-getter.d.ts +0 -35
  77. package/esm/config/config-getter.d.ts.map +0 -1
  78. package/esm/config/config-getter.js +0 -21
  79. package/esm/config/config-getter.js.map +0 -1
  80. package/esm/config/config-handlers.d.ts +0 -19
  81. package/esm/config/config-handlers.d.ts.map +0 -1
  82. package/esm/config/config-handlers.js +0 -47
  83. package/esm/config/config-handlers.js.map +0 -1
  84. package/esm/config/config-loader.d.ts +0 -37
  85. package/esm/config/config-loader.d.ts.map +0 -1
  86. package/esm/config/config-loader.js +0 -83
  87. package/esm/config/config-loader.js.map +0 -1
  88. package/esm/config/config-manager.d.ts +0 -22
  89. package/esm/config/config-manager.d.ts.map +0 -1
  90. package/esm/config/config-manager.js +0 -25
  91. package/esm/config/config-manager.js.map +0 -1
  92. package/esm/config/config-special-handlers.d.ts +0 -17
  93. package/esm/config/config-special-handlers.d.ts.map +0 -1
  94. package/esm/config/config-special-handlers.js +0 -23
  95. package/esm/config/config-special-handlers.js.map +0 -1
  96. package/esm/config/index.d.ts +0 -5
  97. package/esm/config/index.d.ts.map +0 -1
  98. package/esm/config/load-config-files.d.ts +0 -6
  99. package/esm/config/load-config-files.d.ts.map +0 -1
  100. package/esm/config/load-config-files.js +0 -19
  101. package/esm/config/load-config-files.js.map +0 -1
  102. package/esm/config/types.d.ts +0 -52
  103. package/esm/config/types.d.ts.map +0 -1
  104. package/esm/database/decorators/index.d.ts +0 -2
  105. package/esm/database/decorators/index.d.ts.map +0 -1
  106. package/esm/database/decorators/sluggable.d.ts +0 -2
  107. package/esm/database/decorators/sluggable.d.ts.map +0 -1
  108. package/esm/database/decorators/sluggable.js +0 -8
  109. package/esm/database/decorators/sluggable.js.map +0 -1
  110. package/esm/database/index.d.ts +0 -3
  111. package/esm/database/index.d.ts.map +0 -1
  112. package/esm/database/models/database-log/database-log.d.ts +0 -13
  113. package/esm/database/models/database-log/database-log.d.ts.map +0 -1
  114. package/esm/database/models/database-log/database-log.js +0 -16
  115. package/esm/database/models/database-log/database-log.js.map +0 -1
  116. package/esm/database/models/database-log/index.d.ts +0 -2
  117. package/esm/database/models/database-log/index.d.ts.map +0 -1
  118. package/esm/dev2-server/config-handlers.d.ts +0 -8
  119. package/esm/dev2-server/config-handlers.d.ts.map +0 -1
  120. package/esm/dev2-server/config-loader.d.ts +0 -61
  121. package/esm/dev2-server/config-loader.d.ts.map +0 -1
  122. package/esm/dev2-server/connectors/base-connector.d.ts +0 -49
  123. package/esm/dev2-server/connectors/base-connector.d.ts.map +0 -1
  124. package/esm/dev2-server/connectors/base-connector.js +0 -48
  125. package/esm/dev2-server/connectors/base-connector.js.map +0 -1
  126. package/esm/dev2-server/connectors/cache-connector.d.ts +0 -23
  127. package/esm/dev2-server/connectors/cache-connector.d.ts.map +0 -1
  128. package/esm/dev2-server/connectors/cache-connector.js +0 -35
  129. package/esm/dev2-server/connectors/cache-connector.js.map +0 -1
  130. package/esm/dev2-server/connectors/connectors-manager.d.ts +0 -38
  131. package/esm/dev2-server/connectors/connectors-manager.d.ts.map +0 -1
  132. package/esm/dev2-server/connectors/connectors-manager.js +0 -80
  133. package/esm/dev2-server/connectors/connectors-manager.js.map +0 -1
  134. package/esm/dev2-server/connectors/database-connector.d.ts +0 -23
  135. package/esm/dev2-server/connectors/database-connector.d.ts.map +0 -1
  136. package/esm/dev2-server/connectors/database-connector.js +0 -42
  137. package/esm/dev2-server/connectors/database-connector.js.map +0 -1
  138. package/esm/dev2-server/connectors/http-connector.d.ts +0 -29
  139. package/esm/dev2-server/connectors/http-connector.d.ts.map +0 -1
  140. package/esm/dev2-server/connectors/http-connector.js +0 -69
  141. package/esm/dev2-server/connectors/http-connector.js.map +0 -1
  142. package/esm/dev2-server/connectors/index.d.ts +0 -11
  143. package/esm/dev2-server/connectors/index.d.ts.map +0 -1
  144. package/esm/dev2-server/connectors/types.d.ts +0 -49
  145. package/esm/dev2-server/connectors/types.d.ts.map +0 -1
  146. package/esm/dev2-server/connectors/types.js +0 -9
  147. package/esm/dev2-server/connectors/types.js.map +0 -1
  148. package/esm/dev2-server/create-worker.d.ts +0 -34
  149. package/esm/dev2-server/create-worker.d.ts.map +0 -1
  150. package/esm/dev2-server/create-worker.js +0 -37
  151. package/esm/dev2-server/create-worker.js.map +0 -1
  152. package/esm/dev2-server/dependency-graph.d.ts +0 -93
  153. package/esm/dev2-server/dependency-graph.d.ts.map +0 -1
  154. package/esm/dev2-server/dependency-graph.js +0 -266
  155. package/esm/dev2-server/dependency-graph.js.map +0 -1
  156. package/esm/dev2-server/dev-logger.d.ts +0 -14
  157. package/esm/dev2-server/dev-logger.d.ts.map +0 -1
  158. package/esm/dev2-server/dev-logger.js +0 -130
  159. package/esm/dev2-server/dev-logger.js.map +0 -1
  160. package/esm/dev2-server/development-server.d.ts +0 -47
  161. package/esm/dev2-server/development-server.d.ts.map +0 -1
  162. package/esm/dev2-server/development-server.js +0 -135
  163. package/esm/dev2-server/development-server.js.map +0 -1
  164. package/esm/dev2-server/events.d.ts +0 -5
  165. package/esm/dev2-server/events.d.ts.map +0 -1
  166. package/esm/dev2-server/events.js +0 -4
  167. package/esm/dev2-server/events.js.map +0 -1
  168. package/esm/dev2-server/file-event-handler.d.ts +0 -156
  169. package/esm/dev2-server/file-event-handler.d.ts.map +0 -1
  170. package/esm/dev2-server/file-event-handler.js +0 -300
  171. package/esm/dev2-server/file-event-handler.js.map +0 -1
  172. package/esm/dev2-server/file-manager.d.ts +0 -385
  173. package/esm/dev2-server/file-manager.d.ts.map +0 -1
  174. package/esm/dev2-server/file-manager.js +0 -580
  175. package/esm/dev2-server/file-manager.js.map +0 -1
  176. package/esm/dev2-server/file-operations.d.ts +0 -203
  177. package/esm/dev2-server/file-operations.d.ts.map +0 -1
  178. package/esm/dev2-server/file-operations.js +0 -365
  179. package/esm/dev2-server/file-operations.js.map +0 -1
  180. package/esm/dev2-server/files-orchestrator.d.ts +0 -146
  181. package/esm/dev2-server/files-orchestrator.d.ts.map +0 -1
  182. package/esm/dev2-server/files-orchestrator.js +0 -314
  183. package/esm/dev2-server/files-orchestrator.js.map +0 -1
  184. package/esm/dev2-server/files-watcher.d.ts +0 -67
  185. package/esm/dev2-server/files-watcher.d.ts.map +0 -1
  186. package/esm/dev2-server/files-watcher.js +0 -95
  187. package/esm/dev2-server/files-watcher.js.map +0 -1
  188. package/esm/dev2-server/flags.d.ts +0 -10
  189. package/esm/dev2-server/flags.d.ts.map +0 -1
  190. package/esm/dev2-server/flags.js +0 -9
  191. package/esm/dev2-server/flags.js.map +0 -1
  192. package/esm/dev2-server/health-checker/checkers/base-health-checker.d.ts +0 -52
  193. package/esm/dev2-server/health-checker/checkers/base-health-checker.d.ts.map +0 -1
  194. package/esm/dev2-server/health-checker/checkers/base-health-checker.js +0 -71
  195. package/esm/dev2-server/health-checker/checkers/base-health-checker.js.map +0 -1
  196. package/esm/dev2-server/health-checker/checkers/eslint-health-checker.d.ts +0 -40
  197. package/esm/dev2-server/health-checker/checkers/eslint-health-checker.d.ts.map +0 -1
  198. package/esm/dev2-server/health-checker/checkers/eslint-health-checker.js +0 -217
  199. package/esm/dev2-server/health-checker/checkers/eslint-health-checker.js.map +0 -1
  200. package/esm/dev2-server/health-checker/checkers/typescript-health-checker.d.ts +0 -56
  201. package/esm/dev2-server/health-checker/checkers/typescript-health-checker.d.ts.map +0 -1
  202. package/esm/dev2-server/health-checker/checkers/typescript-health-checker.js +0 -279
  203. package/esm/dev2-server/health-checker/checkers/typescript-health-checker.js.map +0 -1
  204. package/esm/dev2-server/health-checker/file-health-checker.contract.d.ts +0 -59
  205. package/esm/dev2-server/health-checker/file-health-checker.contract.d.ts.map +0 -1
  206. package/esm/dev2-server/health-checker/file-health-result.d.ts +0 -68
  207. package/esm/dev2-server/health-checker/file-health-result.d.ts.map +0 -1
  208. package/esm/dev2-server/health-checker/file-health-result.js +0 -40
  209. package/esm/dev2-server/health-checker/file-health-result.js.map +0 -1
  210. package/esm/dev2-server/health-checker/files-healthcare.manager.d.ts +0 -115
  211. package/esm/dev2-server/health-checker/files-healthcare.manager.d.ts.map +0 -1
  212. package/esm/dev2-server/health-checker/files-healthcare.manager.js +0 -422
  213. package/esm/dev2-server/health-checker/files-healthcare.manager.js.map +0 -1
  214. package/esm/dev2-server/health-checker/index.d.ts +0 -6
  215. package/esm/dev2-server/health-checker/index.d.ts.map +0 -1
  216. package/esm/dev2-server/health-checker/workers/eslint-health.worker.d.ts +0 -2
  217. package/esm/dev2-server/health-checker/workers/eslint-health.worker.d.ts.map +0 -1
  218. package/esm/dev2-server/health-checker/workers/eslint-health.worker.js +0 -214
  219. package/esm/dev2-server/health-checker/workers/eslint-health.worker.js.map +0 -1
  220. package/esm/dev2-server/health-checker/workers/ts-health.worker.d.ts +0 -2
  221. package/esm/dev2-server/health-checker/workers/ts-health.worker.d.ts.map +0 -1
  222. package/esm/dev2-server/health-checker/workers/ts-health.worker.js +0 -261
  223. package/esm/dev2-server/health-checker/workers/ts-health.worker.js.map +0 -1
  224. package/esm/dev2-server/import-transformer.d.ts +0 -17
  225. package/esm/dev2-server/import-transformer.d.ts.map +0 -1
  226. package/esm/dev2-server/import-transformer.js +0 -236
  227. package/esm/dev2-server/import-transformer.js.map +0 -1
  228. package/esm/dev2-server/index.d.ts +0 -1
  229. package/esm/dev2-server/index.d.ts.map +0 -1
  230. package/esm/dev2-server/layer-executor.d.ts +0 -60
  231. package/esm/dev2-server/layer-executor.d.ts.map +0 -1
  232. package/esm/dev2-server/layer-executor.js +0 -309
  233. package/esm/dev2-server/layer-executor.js.map +0 -1
  234. package/esm/dev2-server/manifest-manager.d.ts +0 -80
  235. package/esm/dev2-server/manifest-manager.d.ts.map +0 -1
  236. package/esm/dev2-server/manifest-manager.js +0 -107
  237. package/esm/dev2-server/manifest-manager.js.map +0 -1
  238. package/esm/dev2-server/module-loader.d.ts +0 -104
  239. package/esm/dev2-server/module-loader.d.ts.map +0 -1
  240. package/esm/dev2-server/module-loader.js +0 -251
  241. package/esm/dev2-server/module-loader.js.map +0 -1
  242. package/esm/dev2-server/package-json-manager.d.ts +0 -16
  243. package/esm/dev2-server/package-json-manager.d.ts.map +0 -1
  244. package/esm/dev2-server/package-json-manager.js +0 -20
  245. package/esm/dev2-server/package-json-manager.js.map +0 -1
  246. package/esm/dev2-server/parse-imports.d.ts +0 -13
  247. package/esm/dev2-server/parse-imports.d.ts.map +0 -1
  248. package/esm/dev2-server/parse-imports.js +0 -329
  249. package/esm/dev2-server/parse-imports.js.map +0 -1
  250. package/esm/dev2-server/path.d.ts +0 -39
  251. package/esm/dev2-server/path.d.ts.map +0 -1
  252. package/esm/dev2-server/path.js +0 -56
  253. package/esm/dev2-server/path.js.map +0 -1
  254. package/esm/dev2-server/runtime-import-helper.d.ts +0 -9
  255. package/esm/dev2-server/runtime-import-helper.d.ts.map +0 -1
  256. package/esm/dev2-server/runtime-import-helper.js +0 -150
  257. package/esm/dev2-server/runtime-import-helper.js.map +0 -1
  258. package/esm/dev2-server/special-files-collector.d.ts +0 -114
  259. package/esm/dev2-server/special-files-collector.d.ts.map +0 -1
  260. package/esm/dev2-server/special-files-collector.js +0 -212
  261. package/esm/dev2-server/special-files-collector.js.map +0 -1
  262. package/esm/dev2-server/start-development-server.d.ts +0 -7
  263. package/esm/dev2-server/start-development-server.d.ts.map +0 -1
  264. package/esm/dev2-server/start-development-server.js +0 -21
  265. package/esm/dev2-server/start-development-server.js.map +0 -1
  266. package/esm/dev2-server/transpile-file.d.ts +0 -11
  267. package/esm/dev2-server/transpile-file.d.ts.map +0 -1
  268. package/esm/dev2-server/transpile-file.js +0 -21
  269. package/esm/dev2-server/transpile-file.js.map +0 -1
  270. package/esm/dev2-server/tsconfig-manager.d.ts +0 -45
  271. package/esm/dev2-server/tsconfig-manager.d.ts.map +0 -1
  272. package/esm/dev2-server/tsconfig-manager.js +0 -107
  273. package/esm/dev2-server/tsconfig-manager.js.map +0 -1
  274. package/esm/dev2-server/type-generator.d.ts +0 -115
  275. package/esm/dev2-server/type-generator.d.ts.map +0 -1
  276. package/esm/dev2-server/type-generator.js +0 -566
  277. package/esm/dev2-server/type-generator.js.map +0 -1
  278. package/esm/dev2-server/types.d.ts +0 -30
  279. package/esm/dev2-server/types.d.ts.map +0 -1
  280. package/esm/dev2-server/utils.d.ts +0 -15
  281. package/esm/dev2-server/utils.d.ts.map +0 -1
  282. package/esm/dev2-server/utils.js +0 -40
  283. package/esm/dev2-server/utils.js.map +0 -1
  284. package/esm/http/config.d.ts +0 -10
  285. package/esm/http/config.d.ts.map +0 -1
  286. package/esm/http/config.js +0 -22
  287. package/esm/http/config.js.map +0 -1
  288. package/esm/http/createHttpApplication.d.ts +0 -3
  289. package/esm/http/createHttpApplication.d.ts.map +0 -1
  290. package/esm/http/createHttpApplication.js +0 -28
  291. package/esm/http/createHttpApplication.js.map +0 -1
  292. package/esm/http/database/RequestLog.d.ts +0 -13
  293. package/esm/http/database/RequestLog.d.ts.map +0 -1
  294. package/esm/http/database/RequestLog.js +0 -25
  295. package/esm/http/database/RequestLog.js.map +0 -1
  296. package/esm/http/errors/index.d.ts +0 -2
  297. package/esm/http/errors/index.d.ts.map +0 -1
  298. package/esm/http/errors/resource-not-found.error.d.ts +0 -21
  299. package/esm/http/errors/resource-not-found.error.d.ts.map +0 -1
  300. package/esm/http/errors/resource-not-found.error.js +0 -40
  301. package/esm/http/errors/resource-not-found.error.js.map +0 -1
  302. package/esm/http/events.d.ts +0 -4
  303. package/esm/http/events.d.ts.map +0 -1
  304. package/esm/http/events.js +0 -26
  305. package/esm/http/events.js.map +0 -1
  306. package/esm/http/index.d.ts +0 -16
  307. package/esm/http/index.d.ts.map +0 -1
  308. package/esm/http/middleware/cache-response-middleware.d.ts +0 -34
  309. package/esm/http/middleware/cache-response-middleware.d.ts.map +0 -1
  310. package/esm/http/middleware/cache-response-middleware.js +0 -45
  311. package/esm/http/middleware/cache-response-middleware.js.map +0 -1
  312. package/esm/http/middleware/index.d.ts +0 -3
  313. package/esm/http/middleware/index.d.ts.map +0 -1
  314. package/esm/http/middleware/inject-request-context.d.ts +0 -35
  315. package/esm/http/middleware/inject-request-context.d.ts.map +0 -1
  316. package/esm/http/middleware/inject-request-context.js +0 -110
  317. package/esm/http/middleware/inject-request-context.js.map +0 -1
  318. package/esm/http/plugins/index.d.ts +0 -3
  319. package/esm/http/plugins/index.d.ts.map +0 -1
  320. package/esm/http/plugins.d.ts +0 -3
  321. package/esm/http/plugins.d.ts.map +0 -1
  322. package/esm/http/plugins.js +0 -39
  323. package/esm/http/plugins.js.map +0 -1
  324. package/esm/http/request-controller.d.ts +0 -11
  325. package/esm/http/request-controller.d.ts.map +0 -1
  326. package/esm/http/request-controller.js +0 -9
  327. package/esm/http/request-controller.js.map +0 -1
  328. package/esm/http/request.d.ts +0 -376
  329. package/esm/http/request.d.ts.map +0 -1
  330. package/esm/http/request.js +0 -729
  331. package/esm/http/request.js.map +0 -1
  332. package/esm/http/response.d.ts +0 -271
  333. package/esm/http/response.d.ts.map +0 -1
  334. package/esm/http/response.js +0 -574
  335. package/esm/http/response.js.map +0 -1
  336. package/esm/http/server.d.ts +0 -8
  337. package/esm/http/server.d.ts.map +0 -1
  338. package/esm/http/server.js +0 -15
  339. package/esm/http/server.js.map +0 -1
  340. package/esm/http/types.d.ts +0 -174
  341. package/esm/http/types.d.ts.map +0 -1
  342. package/esm/http/uploaded-file.d.ts +0 -445
  343. package/esm/http/uploaded-file.d.ts.map +0 -1
  344. package/esm/http/uploaded-file.js +0 -694
  345. package/esm/http/uploaded-file.js.map +0 -1
  346. package/esm/http/uploads-config.d.ts +0 -26
  347. package/esm/http/uploads-config.d.ts.map +0 -1
  348. package/esm/http/uploads-config.js +0 -35
  349. package/esm/http/uploads-config.js.map +0 -1
  350. package/esm/http/uploads-types.d.ts +0 -236
  351. package/esm/http/uploads-types.d.ts.map +0 -1
  352. package/esm/image/image.d.ts +0 -382
  353. package/esm/image/image.d.ts.map +0 -1
  354. package/esm/image/image.js +0 -552
  355. package/esm/image/image.js.map +0 -1
  356. package/esm/image/index.d.ts +0 -2
  357. package/esm/image/index.d.ts.map +0 -1
  358. package/esm/index.d.ts +0 -29
  359. package/esm/index.d.ts.map +0 -1
  360. package/esm/logger/index.d.ts +0 -3
  361. package/esm/logger/index.d.ts.map +0 -1
  362. package/esm/logger/logger.d.ts +0 -3
  363. package/esm/logger/logger.d.ts.map +0 -1
  364. package/esm/logger/logger.js +0 -16
  365. package/esm/logger/logger.js.map +0 -1
  366. package/esm/logger/types.d.ts +0 -39
  367. package/esm/logger/types.d.ts.map +0 -1
  368. package/esm/mail/config.d.ts +0 -83
  369. package/esm/mail/config.d.ts.map +0 -1
  370. package/esm/mail/config.js +0 -152
  371. package/esm/mail/config.js.map +0 -1
  372. package/esm/mail/events.d.ts +0 -96
  373. package/esm/mail/events.d.ts.map +0 -1
  374. package/esm/mail/events.js +0 -123
  375. package/esm/mail/events.js.map +0 -1
  376. package/esm/mail/index.d.ts +0 -10
  377. package/esm/mail/index.d.ts.map +0 -1
  378. package/esm/mail/mail.d.ts +0 -175
  379. package/esm/mail/mail.d.ts.map +0 -1
  380. package/esm/mail/mail.js +0 -286
  381. package/esm/mail/mail.js.map +0 -1
  382. package/esm/mail/mailer-pool.d.ts +0 -26
  383. package/esm/mail/mailer-pool.d.ts.map +0 -1
  384. package/esm/mail/mailer-pool.js +0 -95
  385. package/esm/mail/mailer-pool.js.map +0 -1
  386. package/esm/mail/react-mail.d.ts +0 -6
  387. package/esm/mail/react-mail.d.ts.map +0 -1
  388. package/esm/mail/react-mail.js +0 -25
  389. package/esm/mail/react-mail.js.map +0 -1
  390. package/esm/mail/send-mail.d.ts +0 -33
  391. package/esm/mail/send-mail.d.ts.map +0 -1
  392. package/esm/mail/send-mail.js +0 -309
  393. package/esm/mail/send-mail.js.map +0 -1
  394. package/esm/mail/test-mailbox.d.ts +0 -110
  395. package/esm/mail/test-mailbox.d.ts.map +0 -1
  396. package/esm/mail/test-mailbox.js +0 -143
  397. package/esm/mail/test-mailbox.js.map +0 -1
  398. package/esm/mail/types.d.ts +0 -245
  399. package/esm/mail/types.d.ts.map +0 -1
  400. package/esm/mail/types.js +0 -13
  401. package/esm/mail/types.js.map +0 -1
  402. package/esm/manifest/manifest-manager.d.ts +0 -74
  403. package/esm/manifest/manifest-manager.d.ts.map +0 -1
  404. package/esm/manifest/manifest-manager.js +0 -88
  405. package/esm/manifest/manifest-manager.js.map +0 -1
  406. package/esm/output/index.d.ts +0 -3
  407. package/esm/output/index.d.ts.map +0 -1
  408. package/esm/output/output.d.ts +0 -193
  409. package/esm/output/output.d.ts.map +0 -1
  410. package/esm/output/output.js +0 -599
  411. package/esm/output/output.js.map +0 -1
  412. package/esm/output/types.d.ts +0 -23
  413. package/esm/output/types.d.ts.map +0 -1
  414. package/esm/production/build-app-production.d.ts +0 -6
  415. package/esm/production/build-app-production.d.ts.map +0 -1
  416. package/esm/production/build-app-production.js +0 -8
  417. package/esm/production/build-app-production.js.map +0 -1
  418. package/esm/production/esbuild-plugins.d.ts +0 -5
  419. package/esm/production/esbuild-plugins.d.ts.map +0 -1
  420. package/esm/production/esbuild-plugins.js +0 -23
  421. package/esm/production/esbuild-plugins.js.map +0 -1
  422. package/esm/production/production-builder.d.ts +0 -76
  423. package/esm/production/production-builder.d.ts.map +0 -1
  424. package/esm/production/production-builder.js +0 -245
  425. package/esm/production/production-builder.js.map +0 -1
  426. package/esm/react/index.d.ts +0 -3
  427. package/esm/react/index.d.ts.map +0 -1
  428. package/esm/react/index.js +0 -7
  429. package/esm/react/index.js.map +0 -1
  430. package/esm/repositories/base-repository-manager.d.ts +0 -47
  431. package/esm/repositories/base-repository-manager.d.ts.map +0 -1
  432. package/esm/repositories/base-repository-manager.js +0 -63
  433. package/esm/repositories/base-repository-manager.js.map +0 -1
  434. package/esm/repositories/index.d.ts +0 -8
  435. package/esm/repositories/index.d.ts.map +0 -1
  436. package/esm/repositories/repository-destroyer-manager.d.ts +0 -21
  437. package/esm/repositories/repository-destroyer-manager.d.ts.map +0 -1
  438. package/esm/repositories/repository-destroyer-manager.js +0 -38
  439. package/esm/repositories/repository-destroyer-manager.js.map +0 -1
  440. package/esm/repositories/repository-filler-manager.d.ts +0 -60
  441. package/esm/repositories/repository-filler-manager.d.ts.map +0 -1
  442. package/esm/repositories/repository-filler-manager.js +0 -102
  443. package/esm/repositories/repository-filler-manager.js.map +0 -1
  444. package/esm/repositories/repository-filler.d.ts +0 -26
  445. package/esm/repositories/repository-filler.d.ts.map +0 -1
  446. package/esm/repositories/repository-filler.js +0 -63
  447. package/esm/repositories/repository-filler.js.map +0 -1
  448. package/esm/repositories/repository-list-manager.d.ts +0 -385
  449. package/esm/repositories/repository-list-manager.d.ts.map +0 -1
  450. package/esm/repositories/repository-list-manager.js +0 -812
  451. package/esm/repositories/repository-list-manager.js.map +0 -1
  452. package/esm/repositories/repository-listing.d.ts +0 -82
  453. package/esm/repositories/repository-listing.d.ts.map +0 -1
  454. package/esm/repositories/repository-listing.js +0 -177
  455. package/esm/repositories/repository-listing.js.map +0 -1
  456. package/esm/repositories/repository-manager.d.ts +0 -5
  457. package/esm/repositories/repository-manager.d.ts.map +0 -1
  458. package/esm/repositories/repository-manager.js +0 -2
  459. package/esm/repositories/repository-manager.js.map +0 -1
  460. package/esm/repositories/types.d.ts +0 -114
  461. package/esm/repositories/types.d.ts.map +0 -1
  462. package/esm/repositories/utils.d.ts +0 -3
  463. package/esm/repositories/utils.d.ts.map +0 -1
  464. package/esm/repositories/utils.js +0 -7
  465. package/esm/repositories/utils.js.map +0 -1
  466. package/esm/restful/index.d.ts +0 -2
  467. package/esm/restful/index.d.ts.map +0 -1
  468. package/esm/restful/restful.d.ts +0 -110
  469. package/esm/restful/restful.d.ts.map +0 -1
  470. package/esm/restful/restful.js +0 -317
  471. package/esm/restful/restful.js.map +0 -1
  472. package/esm/router/index.d.ts +0 -4
  473. package/esm/router/index.d.ts.map +0 -1
  474. package/esm/router/route-registry.d.ts +0 -30
  475. package/esm/router/route-registry.d.ts.map +0 -1
  476. package/esm/router/route-registry.js +0 -67
  477. package/esm/router/route-registry.js.map +0 -1
  478. package/esm/router/route.d.ts +0 -34
  479. package/esm/router/route.d.ts.map +0 -1
  480. package/esm/router/router.d.ts +0 -169
  481. package/esm/router/router.d.ts.map +0 -1
  482. package/esm/router/router.js +0 -564
  483. package/esm/router/router.js.map +0 -1
  484. package/esm/router/types.d.ts +0 -258
  485. package/esm/router/types.d.ts.map +0 -1
  486. package/esm/router/utils.d.ts +0 -5
  487. package/esm/router/utils.d.ts.map +0 -1
  488. package/esm/router/utils.js +0 -6
  489. package/esm/router/utils.js.map +0 -1
  490. package/esm/storage/config.d.ts +0 -8
  491. package/esm/storage/config.d.ts.map +0 -1
  492. package/esm/storage/config.js +0 -6
  493. package/esm/storage/config.js.map +0 -1
  494. package/esm/storage/drivers/cloud-driver.d.ts +0 -127
  495. package/esm/storage/drivers/cloud-driver.d.ts.map +0 -1
  496. package/esm/storage/drivers/cloud-driver.js +0 -406
  497. package/esm/storage/drivers/cloud-driver.js.map +0 -1
  498. package/esm/storage/drivers/do-spaces-driver.d.ts +0 -47
  499. package/esm/storage/drivers/do-spaces-driver.d.ts.map +0 -1
  500. package/esm/storage/drivers/do-spaces-driver.js +0 -52
  501. package/esm/storage/drivers/do-spaces-driver.js.map +0 -1
  502. package/esm/storage/drivers/local-driver.d.ts +0 -136
  503. package/esm/storage/drivers/local-driver.d.ts.map +0 -1
  504. package/esm/storage/drivers/local-driver.js +0 -409
  505. package/esm/storage/drivers/local-driver.js.map +0 -1
  506. package/esm/storage/drivers/r2-driver.d.ts +0 -50
  507. package/esm/storage/drivers/r2-driver.d.ts.map +0 -1
  508. package/esm/storage/drivers/r2-driver.js +0 -59
  509. package/esm/storage/drivers/r2-driver.js.map +0 -1
  510. package/esm/storage/drivers/s3-driver.d.ts +0 -32
  511. package/esm/storage/drivers/s3-driver.d.ts.map +0 -1
  512. package/esm/storage/drivers/s3-driver.js +0 -34
  513. package/esm/storage/drivers/s3-driver.js.map +0 -1
  514. package/esm/storage/index.d.ts +0 -12
  515. package/esm/storage/index.d.ts.map +0 -1
  516. package/esm/storage/scoped-storage.d.ts +0 -402
  517. package/esm/storage/scoped-storage.d.ts.map +0 -1
  518. package/esm/storage/scoped-storage.js +0 -488
  519. package/esm/storage/scoped-storage.js.map +0 -1
  520. package/esm/storage/storage-file.d.ts +0 -216
  521. package/esm/storage/storage-file.d.ts.map +0 -1
  522. package/esm/storage/storage-file.js +0 -358
  523. package/esm/storage/storage-file.js.map +0 -1
  524. package/esm/storage/storage.d.ts +0 -582
  525. package/esm/storage/storage.d.ts.map +0 -1
  526. package/esm/storage/storage.js +0 -941
  527. package/esm/storage/storage.js.map +0 -1
  528. package/esm/storage/types.d.ts +0 -728
  529. package/esm/storage/types.d.ts.map +0 -1
  530. package/esm/storage/utils/mime.d.ts +0 -33
  531. package/esm/storage/utils/mime.d.ts.map +0 -1
  532. package/esm/storage/utils/mime.js +0 -45
  533. package/esm/storage/utils/mime.js.map +0 -1
  534. package/esm/store/index.d.ts +0 -25
  535. package/esm/store/index.d.ts.map +0 -1
  536. package/esm/store/index.js +0 -52
  537. package/esm/store/index.js.map +0 -1
  538. package/esm/tests/boot-testing.d.ts +0 -7
  539. package/esm/tests/boot-testing.d.ts.map +0 -1
  540. package/esm/tests/boot-testing.js +0 -23
  541. package/esm/tests/boot-testing.js.map +0 -1
  542. package/esm/tests/create-http-test-application.d.ts +0 -25
  543. package/esm/tests/create-http-test-application.d.ts.map +0 -1
  544. package/esm/tests/create-http-test-application.js +0 -76
  545. package/esm/tests/create-http-test-application.js.map +0 -1
  546. package/esm/tests/http-response-output-test.d.ts +0 -42
  547. package/esm/tests/http-response-output-test.d.ts.map +0 -1
  548. package/esm/tests/http-response-output-test.js +0 -53
  549. package/esm/tests/http-response-output-test.js.map +0 -1
  550. package/esm/tests/http-test-response.d.ts +0 -75
  551. package/esm/tests/http-test-response.d.ts.map +0 -1
  552. package/esm/tests/index.d.ts +0 -4
  553. package/esm/tests/index.d.ts.map +0 -1
  554. package/esm/tests/init-testing.d.ts +0 -7
  555. package/esm/tests/init-testing.d.ts.map +0 -1
  556. package/esm/tests/types.d.ts +0 -10
  557. package/esm/tests/types.d.ts.map +0 -1
  558. package/esm/utils/app-log.d.ts +0 -8
  559. package/esm/utils/app-log.d.ts.map +0 -1
  560. package/esm/utils/app-log.js +0 -7
  561. package/esm/utils/app-log.js.map +0 -1
  562. package/esm/utils/cleanup-temp-files.d.ts +0 -5
  563. package/esm/utils/cleanup-temp-files.d.ts.map +0 -1
  564. package/esm/utils/database-log.d.ts +0 -25
  565. package/esm/utils/database-log.d.ts.map +0 -1
  566. package/esm/utils/database-log.js +0 -44
  567. package/esm/utils/database-log.js.map +0 -1
  568. package/esm/utils/date-output.d.ts +0 -69
  569. package/esm/utils/date-output.d.ts.map +0 -1
  570. package/esm/utils/date-output.js +0 -62
  571. package/esm/utils/date-output.js.map +0 -1
  572. package/esm/utils/date-output.test.d.ts +0 -2
  573. package/esm/utils/date-output.test.d.ts.map +0 -1
  574. package/esm/utils/download-file.d.ts +0 -3
  575. package/esm/utils/download-file.d.ts.map +0 -1
  576. package/esm/utils/environment.d.ts +0 -4
  577. package/esm/utils/environment.d.ts.map +0 -1
  578. package/esm/utils/environment.js +0 -6
  579. package/esm/utils/environment.js.map +0 -1
  580. package/esm/utils/get-localized.d.ts +0 -10
  581. package/esm/utils/get-localized.d.ts.map +0 -1
  582. package/esm/utils/get-localized.js +0 -15
  583. package/esm/utils/get-localized.js.map +0 -1
  584. package/esm/utils/get-localized.test.d.ts +0 -2
  585. package/esm/utils/get-localized.test.d.ts.map +0 -1
  586. package/esm/utils/index.d.ts +0 -13
  587. package/esm/utils/index.d.ts.map +0 -1
  588. package/esm/utils/internal.d.ts +0 -4
  589. package/esm/utils/internal.d.ts.map +0 -1
  590. package/esm/utils/paths.d.ts +0 -55
  591. package/esm/utils/paths.d.ts.map +0 -1
  592. package/esm/utils/paths.js +0 -89
  593. package/esm/utils/paths.js.map +0 -1
  594. package/esm/utils/promise-all-object.d.ts +0 -8
  595. package/esm/utils/promise-all-object.d.ts.map +0 -1
  596. package/esm/utils/promise-all-object.js +0 -12
  597. package/esm/utils/promise-all-object.js.map +0 -1
  598. package/esm/utils/queue.d.ts +0 -49
  599. package/esm/utils/queue.d.ts.map +0 -1
  600. package/esm/utils/queue.js +0 -89
  601. package/esm/utils/queue.js.map +0 -1
  602. package/esm/utils/sleep.d.ts +0 -2
  603. package/esm/utils/sleep.d.ts.map +0 -1
  604. package/esm/utils/sleep.js +0 -3
  605. package/esm/utils/sleep.js.map +0 -1
  606. package/esm/utils/sluggable.d.ts +0 -5
  607. package/esm/utils/sluggable.d.ts.map +0 -1
  608. package/esm/utils/sluggable.js +0 -15
  609. package/esm/utils/sluggable.js.map +0 -1
  610. package/esm/utils/sluggable.test.d.ts +0 -2
  611. package/esm/utils/sluggable.test.d.ts.map +0 -1
  612. package/esm/utils/to-json.d.ts +0 -2
  613. package/esm/utils/to-json.d.ts.map +0 -1
  614. package/esm/utils/to-json.js +0 -26
  615. package/esm/utils/to-json.js.map +0 -1
  616. package/esm/utils/types.d.ts +0 -22
  617. package/esm/utils/types.d.ts.map +0 -1
  618. package/esm/utils/urls.d.ts +0 -21
  619. package/esm/utils/urls.d.ts.map +0 -1
  620. package/esm/utils/urls.js +0 -31
  621. package/esm/utils/urls.js.map +0 -1
  622. package/esm/validation/database/exists-except-current-id.d.ts +0 -7
  623. package/esm/validation/database/exists-except-current-id.d.ts.map +0 -1
  624. package/esm/validation/database/exists-except-current-id.js +0 -23
  625. package/esm/validation/database/exists-except-current-id.js.map +0 -1
  626. package/esm/validation/database/exists-except-current-user.d.ts +0 -7
  627. package/esm/validation/database/exists-except-current-user.d.ts.map +0 -1
  628. package/esm/validation/database/exists-except-current-user.js +0 -25
  629. package/esm/validation/database/exists-except-current-user.js.map +0 -1
  630. package/esm/validation/database/exists.d.ts +0 -7
  631. package/esm/validation/database/exists.d.ts.map +0 -1
  632. package/esm/validation/database/exists.js +0 -21
  633. package/esm/validation/database/exists.js.map +0 -1
  634. package/esm/validation/database/index.d.ts +0 -12
  635. package/esm/validation/database/index.d.ts.map +0 -1
  636. package/esm/validation/database/types.d.ts +0 -68
  637. package/esm/validation/database/types.d.ts.map +0 -1
  638. package/esm/validation/database/unique-except-current-id.d.ts +0 -7
  639. package/esm/validation/database/unique-except-current-id.d.ts.map +0 -1
  640. package/esm/validation/database/unique-except-current-id.js +0 -23
  641. package/esm/validation/database/unique-except-current-id.js.map +0 -1
  642. package/esm/validation/database/unique-except-current-user.d.ts +0 -7
  643. package/esm/validation/database/unique-except-current-user.d.ts.map +0 -1
  644. package/esm/validation/database/unique-except-current-user.js +0 -25
  645. package/esm/validation/database/unique-except-current-user.js.map +0 -1
  646. package/esm/validation/database/unique.d.ts +0 -7
  647. package/esm/validation/database/unique.d.ts.map +0 -1
  648. package/esm/validation/database/unique.js +0 -30
  649. package/esm/validation/database/unique.js.map +0 -1
  650. package/esm/validation/file/file.d.ts +0 -22
  651. package/esm/validation/file/file.d.ts.map +0 -1
  652. package/esm/validation/file/file.js +0 -60
  653. package/esm/validation/file/file.js.map +0 -1
  654. package/esm/validation/file/index.d.ts +0 -6
  655. package/esm/validation/file/index.d.ts.map +0 -1
  656. package/esm/validation/index.d.ts +0 -16
  657. package/esm/validation/index.d.ts.map +0 -1
  658. package/esm/validation/init.d.ts +0 -7
  659. package/esm/validation/init.d.ts.map +0 -1
  660. package/esm/validation/init.js +0 -34
  661. package/esm/validation/init.js.map +0 -1
  662. package/esm/validation/plugins/database-plugin.d.ts +0 -14
  663. package/esm/validation/plugins/database-plugin.d.ts.map +0 -1
  664. package/esm/validation/plugins/database-plugin.js +0 -95
  665. package/esm/validation/plugins/database-plugin.js.map +0 -1
  666. package/esm/validation/plugins/file-plugin.d.ts +0 -11
  667. package/esm/validation/plugins/file-plugin.d.ts.map +0 -1
  668. package/esm/validation/plugins/file-plugin.js +0 -17
  669. package/esm/validation/plugins/file-plugin.js.map +0 -1
  670. package/esm/validation/plugins/index.d.ts +0 -9
  671. package/esm/validation/plugins/index.d.ts.map +0 -1
  672. package/esm/validation/plugins/localized-plugin.d.ts +0 -11
  673. package/esm/validation/plugins/localized-plugin.d.ts.map +0 -1
  674. package/esm/validation/plugins/localized-plugin.js +0 -19
  675. package/esm/validation/plugins/localized-plugin.js.map +0 -1
  676. package/esm/validation/types.d.ts +0 -87
  677. package/esm/validation/types.d.ts.map +0 -1
  678. package/esm/validation/validateAll.d.ts +0 -7
  679. package/esm/validation/validateAll.d.ts.map +0 -1
  680. package/esm/validation/validateAll.js +0 -39
  681. package/esm/validation/validateAll.js.map +0 -1
  682. package/esm/validation/validators/file-validator.d.ts +0 -40
  683. package/esm/validation/validators/file-validator.d.ts.map +0 -1
  684. package/esm/validation/validators/file-validator.js +0 -94
  685. package/esm/validation/validators/file-validator.js.map +0 -1
  686. package/esm/validation/validators/index.d.ts +0 -7
  687. package/esm/validation/validators/index.d.ts.map +0 -1
  688. package/esm/warlock-config/default-configurations.d.ts +0 -3
  689. package/esm/warlock-config/default-configurations.d.ts.map +0 -1
  690. package/esm/warlock-config/default-configurations.js +0 -8
  691. package/esm/warlock-config/default-configurations.js.map +0 -1
  692. package/esm/warlock-config/define-config.d.ts +0 -3
  693. package/esm/warlock-config/define-config.d.ts.map +0 -1
  694. package/esm/warlock-config/define-config.js +0 -3
  695. package/esm/warlock-config/define-config.js.map +0 -1
  696. package/esm/warlock-config/index.d.ts +0 -4
  697. package/esm/warlock-config/index.d.ts.map +0 -1
  698. package/esm/warlock-config/types.d.ts +0 -79
  699. package/esm/warlock-config/types.d.ts.map +0 -1
  700. package/esm/warlock-config/warlock-config.manager.d.ts +0 -83
  701. package/esm/warlock-config/warlock-config.manager.d.ts.map +0 -1
  702. package/esm/warlock-config/warlock-config.manager.js +0 -141
  703. package/esm/warlock-config/warlock-config.manager.js.map +0 -1
@@ -1,694 +0,0 @@
1
- import {Random}from'@mongez/reinforcements';import dayjs from'dayjs';import path from'path';import {Image}from'../image/image.js';import'@mongez/config';import'../config/config-handlers.js';import {storage}from'../storage/storage.js';import'mime';import'@aws-sdk/client-s3';import'@aws-sdk/lib-storage';import'@aws-sdk/s3-request-presigner';import'crypto';import'@mongez/fs';import'fs';import'fs/promises';import'stream/promises';import {sanitizePath}from'../utils/paths.js';import {uploadsConfig}from'./uploads-config.js';/**
2
- * UploadedFile - Handles multipart file uploads with storage and image integration
3
- *
4
- * Provides a fluent API for validating, transforming, and saving uploaded files
5
- * to various storage drivers (local, S3, R2, etc.).
6
- *
7
- * @example
8
- * ```typescript
9
- * // Simple save with random name
10
- * const file = await uploadedFile.save("avatars");
11
- *
12
- * // Original name with date prefix
13
- * const file = await uploadedFile.save("avatars", {
14
- * name: "original",
15
- * prefix: { format: "yyyy/mm/dd", as: "directory" }
16
- * });
17
- *
18
- * // With image transformations
19
- * const file = await uploadedFile
20
- * .resize(800, 600)
21
- * .quality(85)
22
- * .format("webp")
23
- * .save("avatars");
24
- *
25
- * // Different storage driver
26
- * const file = await uploadedFile.use("s3").save("avatars");
27
- * ```
28
- */
29
- class UploadedFile {
30
- fileData;
31
- /**
32
- * File buffered content
33
- * @internal
34
- */
35
- bufferedFileContent;
36
- /**
37
- * Upload file hash (SHA-256)
38
- *
39
- * Populated after file is saved.
40
- */
41
- hash = "";
42
- /**
43
- * Selected storage driver
44
- * @internal
45
- */
46
- _storage = storage;
47
- /**
48
- * Saved StorageFile reference
49
- * @internal
50
- */
51
- _storageFile;
52
- /**
53
- * Queued image options (high-level API)
54
- * @internal
55
- */
56
- _imageOptions = {};
57
- /**
58
- * Full transform options or callback
59
- * @internal
60
- */
61
- _transformConfig;
62
- /**
63
- * Create a new UploadedFile instance
64
- *
65
- * @param fileData - Multipart file data from Fastify
66
- * @throws Error if file data is invalid
67
- */
68
- constructor(fileData) {
69
- this.fileData = fileData;
70
- if (!fileData?.filename) {
71
- throw new Error("Invalid file data: filename is required");
72
- }
73
- }
74
- // ============================================================
75
- // File Properties
76
- // ============================================================
77
- /**
78
- * Get file name (sanitized)
79
- *
80
- * Returns the original filename with special characters removed/replaced.
81
- */
82
- get name() {
83
- return sanitizePath(this.fileData.filename);
84
- }
85
- /**
86
- * Get file MIME type
87
- *
88
- * @example "image/jpeg", "application/pdf"
89
- */
90
- get mimeType() {
91
- return this.fileData.mimetype;
92
- }
93
- /**
94
- * Get file extension (lowercase, without dot)
95
- *
96
- * @example "jpg", "png", "pdf"
97
- */
98
- get extension() {
99
- return path.extname(this.fileData.filename).replace(".", "").toLowerCase();
100
- }
101
- /**
102
- * Get file size in bytes
103
- *
104
- * Buffers the file content if not already buffered.
105
- */
106
- async size() {
107
- const file = await this.buffer();
108
- return file.length;
109
- }
110
- /**
111
- * Get file buffer
112
- *
113
- * Caches the buffer after first call for efficiency.
114
- */
115
- async buffer() {
116
- if (this.bufferedFileContent) {
117
- return this.bufferedFileContent;
118
- }
119
- this.bufferedFileContent = await this.fileData.toBuffer();
120
- return this.bufferedFileContent;
121
- }
122
- // ============================================================
123
- // File Type Checks
124
- // ============================================================
125
- /**
126
- * Check if file is an image based on MIME type
127
- */
128
- get isImage() {
129
- return this.mimeType.startsWith("image");
130
- }
131
- /**
132
- * Check if file is a video based on MIME type
133
- */
134
- get isVideo() {
135
- return this.mimeType.startsWith("video");
136
- }
137
- /**
138
- * Check if file is an audio based on MIME type
139
- */
140
- get isAudio() {
141
- return this.mimeType.startsWith("audio");
142
- }
143
- // ============================================================
144
- // Storage Driver Selection
145
- // ============================================================
146
- /**
147
- * Select a specific storage driver for this upload
148
- *
149
- * Returns this instance for chaining. The driver is used
150
- * when `save()` or `saveAs()` is called.
151
- *
152
- * @param driver - Driver name from storage configuration
153
- * @returns This instance for chaining
154
- *
155
- * @example
156
- * ```typescript
157
- * await file.use("s3").save("avatars");
158
- * await file.use("r2").save("cdn/images");
159
- * ```
160
- */
161
- use(driver) {
162
- this._storage = storage.use(driver);
163
- return this;
164
- }
165
- // ============================================================
166
- // High-Level Image Transform API
167
- // ============================================================
168
- /**
169
- * Resize the image before saving
170
- *
171
- * Only applies to image files. Non-image files ignore this.
172
- *
173
- * @param width - Target width in pixels
174
- * @param height - Optional target height (maintains aspect ratio if omitted)
175
- * @returns This instance for chaining
176
- *
177
- * @example
178
- * ```typescript
179
- * await file.resize(800).save("thumbnails");
180
- * await file.resize(400, 400).save("avatars");
181
- * ```
182
- */
183
- resize(width, height) {
184
- this._imageOptions.resize = { width, height };
185
- return this;
186
- }
187
- /**
188
- * Set image output quality
189
- *
190
- * Quality affects file size and visual fidelity.
191
- * Only applies to formats that support quality (JPEG, WebP, AVIF).
192
- *
193
- * @param value - Quality value (1-100)
194
- * @returns This instance for chaining
195
- *
196
- * @example
197
- * ```typescript
198
- * await file.quality(85).save("images");
199
- * ```
200
- */
201
- quality(value) {
202
- if (value < 1 || value > 100) {
203
- throw new Error("Quality must be between 1 and 100");
204
- }
205
- this._imageOptions.quality = value;
206
- return this;
207
- }
208
- /**
209
- * Convert image to a specific format
210
- *
211
- * Changes the output format and updates the file extension accordingly.
212
- *
213
- * @param format - Target image format (jpeg, png, webp, avif, etc.)
214
- * @returns This instance for chaining
215
- *
216
- * @example
217
- * ```typescript
218
- * await file.format("webp").save("images");
219
- * await file.resize(800).format("avif").quality(80).save("optimized");
220
- * ```
221
- */
222
- format(format) {
223
- this._imageOptions.format = format;
224
- return this;
225
- }
226
- /**
227
- * Rotate the image
228
- *
229
- * @param degrees - Rotation angle in degrees (positive = clockwise)
230
- * @returns This instance for chaining
231
- *
232
- * @example
233
- * ```typescript
234
- * await file.rotate(90).save("rotated");
235
- * ```
236
- */
237
- rotate(degrees) {
238
- this._imageOptions.rotate = degrees;
239
- return this;
240
- }
241
- /**
242
- * Apply blur effect to the image
243
- *
244
- * @param sigma - Blur intensity (default: 3, minimum: 0.3)
245
- * @returns This instance for chaining
246
- *
247
- * @example
248
- * ```typescript
249
- * await file.blur(5).save("blurred");
250
- * ```
251
- */
252
- blur(sigma = 3) {
253
- if (sigma < 0.3) {
254
- throw new Error("Blur sigma must be at least 0.3");
255
- }
256
- this._imageOptions.blur = sigma;
257
- return this;
258
- }
259
- /**
260
- * Convert image to grayscale (black and white)
261
- *
262
- * @returns This instance for chaining
263
- *
264
- * @example
265
- * ```typescript
266
- * await file.grayscale().save("bw-images");
267
- * ```
268
- */
269
- grayscale() {
270
- this._imageOptions.grayscale = true;
271
- return this;
272
- }
273
- // ============================================================
274
- // Full Transform Control
275
- // ============================================================
276
- /**
277
- * Apply full image transformations
278
- *
279
- * Provides complete control over image processing. Can be used with:
280
- * - An options object for predefined transforms
281
- * - A callback function for chained operations
282
- *
283
- * @param config - Transform options or callback function
284
- * @returns This instance for chaining
285
- *
286
- * @example
287
- * ```typescript
288
- * // Using options object
289
- * await file.transform({
290
- * resize: { width: 800, fit: "inside" },
291
- * quality: 85
292
- * }).save("images");
293
- *
294
- * // Using callback for full control
295
- * await file.transform(img =>
296
- * img.resize({ width: 800 })
297
- * .watermark("logo.png", { gravity: "southeast" })
298
- * .sharpen()
299
- * ).save("products");
300
- * ```
301
- */
302
- transform(config) {
303
- this._transformConfig = config;
304
- return this;
305
- }
306
- /**
307
- * Get an Image instance for advanced manipulation
308
- *
309
- * Returns an Image instance from the file buffer for manual processing.
310
- * Use this when you need operations not covered by the fluent API.
311
- *
312
- * @returns Promise resolving to Image instance
313
- *
314
- * @example
315
- * ```typescript
316
- * const img = await file.toImage();
317
- * await img
318
- * .resize({ width: 800 })
319
- * .watermark("logo.png", { gravity: "southeast" })
320
- * .save("path/to/output.jpg");
321
- * ```
322
- */
323
- async toImage() {
324
- return new Image(await this.buffer());
325
- }
326
- // ============================================================
327
- // Image Metadata
328
- // ============================================================
329
- /**
330
- * Get file width and height (only for images)
331
- *
332
- * @returns Dimensions object, or empty object if not an image
333
- */
334
- async dimensions() {
335
- if (!this.isImage) {
336
- return {};
337
- }
338
- return new Image(await this.buffer()).dimensions();
339
- }
340
- // ============================================================
341
- // Validation
342
- // ============================================================
343
- /**
344
- * Validate file against the given options
345
- *
346
- * @param options - Validation rules
347
- * @throws Error if validation fails
348
- *
349
- * @example
350
- * ```typescript
351
- * await file.validate({
352
- * allowedMimeTypes: ["image/jpeg", "image/png"],
353
- * maxSize: 5 * 1024 * 1024 // 5MB
354
- * });
355
- * ```
356
- */
357
- async validate(options) {
358
- const { allowedMimeTypes, allowedExtensions, maxSize } = options;
359
- if (allowedMimeTypes && !allowedMimeTypes.includes(this.mimeType)) {
360
- throw new Error(`Invalid file type: ${this.mimeType}. Allowed types: ${allowedMimeTypes.join(", ")}`);
361
- }
362
- if (allowedExtensions && !allowedExtensions.includes(this.extension)) {
363
- throw new Error(`Invalid file extension: ${this.extension}. Allowed extensions: ${allowedExtensions.join(", ")}`);
364
- }
365
- if (maxSize) {
366
- const fileSize = await this.size();
367
- if (fileSize > maxSize) {
368
- throw new Error(`File too large: ${fileSize} bytes. Maximum allowed: ${maxSize} bytes`);
369
- }
370
- }
371
- }
372
- // ============================================================
373
- // Save Operations
374
- // ============================================================
375
- /**
376
- * Save the file to a directory with automatic naming
377
- *
378
- * Uses the configured naming strategy and prefix options to generate
379
- * the final path. Returns a StorageFile for accessing file metadata.
380
- *
381
- * @param directory - Target directory path
382
- * @param options - Save options (name, prefix, driver, validate)
383
- * @returns StorageFile instance with file metadata and operations
384
- *
385
- * @example
386
- * ```typescript
387
- * // Random name (default)
388
- * await file.save("avatars");
389
- * // → avatars/x7k9m2p4.jpg
390
- *
391
- * // Original name
392
- * await file.save("avatars", { name: "original" });
393
- * // → avatars/photo.jpg
394
- *
395
- * // With date directory
396
- * await file.save("avatars", {
397
- * prefix: { format: "yyyy/mm/dd", as: "directory" }
398
- * });
399
- * // → avatars/2025/12/21/x7k9m2p4.jpg
400
- *
401
- * // Original name with datetime prefix
402
- * await file.save("avatars", { name: "original", prefix: true });
403
- * // → avatars/21-12-2025-16-45-30-photo.jpg
404
- * ```
405
- */
406
- async save(directory, options) {
407
- // Validate if requested
408
- if (options?.validate) {
409
- await this.validate(options.validate);
410
- }
411
- // Resolve filename and prefix
412
- const filename = this.resolveFilename(options);
413
- const prefix = this.resolvePrefix(options?.prefix);
414
- const location = this.buildLocation(directory, prefix, filename);
415
- return this.saveToLocation(location, options?.driver);
416
- }
417
- /**
418
- * Save the file to an explicit path
419
- *
420
- * Unlike `save()`, this method uses the exact path you provide.
421
- * No automatic naming or prefix is applied.
422
- *
423
- * @param location - Full file path (directory + filename)
424
- * @param options - Save options (driver, validate)
425
- * @returns StorageFile instance with file metadata
426
- *
427
- * @example
428
- * ```typescript
429
- * await file.saveAs("avatars/profile-123.png");
430
- * await file.saveAs("products/2025/featured-image.webp");
431
- * ```
432
- */
433
- async saveAs(location, options) {
434
- // Validate if requested
435
- if (options?.validate) {
436
- await this.validate(options.validate);
437
- }
438
- return this.saveToLocation(location, options?.driver);
439
- }
440
- /**
441
- * Get the StorageFile reference if file has been saved
442
- *
443
- * Returns undefined if file hasn't been saved yet.
444
- */
445
- get storageFile() {
446
- return this._storageFile;
447
- }
448
- // ============================================================
449
- // Internal Helpers
450
- // ============================================================
451
- /**
452
- * Execute save to the specified location
453
- * @internal
454
- */
455
- async saveToLocation(location, driver) {
456
- // Get file content (apply transforms if image)
457
- const content = await this.getProcessedContent();
458
- // Select storage
459
- const storageInstance = this.resolveStorage(driver);
460
- // Determine final location (adjust extension if format changed)
461
- const finalLocation = this.adjustLocationForFormat(location);
462
- // Save to storage
463
- this._storageFile = await storageInstance.put(content, finalLocation, {
464
- mimeType: this.getFinalMimeType(),
465
- });
466
- // Store hash from StorageFile
467
- const info = await this._storageFile.data();
468
- this.hash = info.hash || "";
469
- return this._storageFile;
470
- }
471
- /**
472
- * Get processed content (with transforms applied if applicable)
473
- * @internal
474
- */
475
- async getProcessedContent() {
476
- const content = await this.buffer();
477
- // If not an image or no transforms, return as-is
478
- if (!this.isImage || !this.hasTransforms()) {
479
- return content;
480
- }
481
- // Create Image and apply transforms
482
- let img = new Image(content);
483
- // Apply transform callback or options
484
- if (typeof this._transformConfig === "function") {
485
- img = this._transformConfig(img);
486
- }
487
- else if (this._transformConfig) {
488
- img = img.apply(this._transformConfig);
489
- }
490
- // Apply high-level options on top
491
- img = this.applyImageOptions(img);
492
- return img.toBuffer();
493
- }
494
- /**
495
- * Apply high-level image options
496
- * @internal
497
- */
498
- applyImageOptions(img) {
499
- const opts = this._imageOptions;
500
- if (opts.resize) {
501
- img = img.resize({ width: opts.resize.width, height: opts.resize.height });
502
- }
503
- if (opts.rotate !== undefined) {
504
- img = img.rotate(opts.rotate);
505
- }
506
- if (opts.blur !== undefined) {
507
- img = img.blur(opts.blur);
508
- }
509
- if (opts.grayscale) {
510
- img = img.grayscale();
511
- }
512
- if (opts.quality !== undefined) {
513
- img = img.quality(opts.quality);
514
- }
515
- if (opts.format) {
516
- img = img.format(opts.format);
517
- }
518
- return img;
519
- }
520
- /**
521
- * Check if any transforms are queued
522
- * @internal
523
- */
524
- hasTransforms() {
525
- return this._transformConfig !== undefined || Object.keys(this._imageOptions).length > 0;
526
- }
527
- /**
528
- * Resolve storage instance to use
529
- * @internal
530
- */
531
- resolveStorage(driver) {
532
- if (this._storage) {
533
- return this._storage;
534
- }
535
- if (driver) {
536
- return storage.use(driver);
537
- }
538
- return storage;
539
- }
540
- /**
541
- * Resolve the filename based on options and config
542
- * @internal
543
- */
544
- resolveFilename(options) {
545
- const namingStrategy = options?.name ?? uploadsConfig("name") ?? "random";
546
- let baseName;
547
- if (namingStrategy === "original") {
548
- baseName = path.basename(this.name, path.extname(this.name));
549
- }
550
- else if (namingStrategy === "random") {
551
- const length = uploadsConfig("randomLength");
552
- baseName = Random.string(length);
553
- }
554
- else {
555
- // Custom name - strip extension if provided, we'll add it
556
- baseName = path.basename(namingStrategy, path.extname(namingStrategy));
557
- }
558
- // Get extension (may be changed by format transform)
559
- const ext = this.getFinalExtension();
560
- return `${baseName}.${ext}`;
561
- }
562
- /**
563
- * Resolve prefix based on options and config
564
- * @internal
565
- */
566
- resolvePrefix(prefix) {
567
- // No prefix
568
- if (prefix === false || prefix === undefined) {
569
- const configPrefix = uploadsConfig("prefix");
570
- if (!configPrefix) {
571
- return "";
572
- }
573
- // Use config prefix if no explicit prefix provided
574
- return this.resolvePrefix(configPrefix);
575
- }
576
- // Boolean true = use default format
577
- if (prefix === true) {
578
- const format = uploadsConfig("defaultPrefixFormat") ?? "dd-mm-yyyy-HH-ii-ss";
579
- return this.formatDatePrefix(format, "file");
580
- }
581
- // String = static prefix
582
- if (typeof prefix === "string") {
583
- return prefix;
584
- }
585
- // PrefixOptions object
586
- const parts = [];
587
- // Add date format if specified
588
- if (prefix.format) {
589
- parts.push(this.formatDate(prefix.format));
590
- }
591
- // Add random string if specified
592
- if (prefix.randomLength) {
593
- parts.push(Random.string(prefix.randomLength));
594
- }
595
- const combined = parts.join("-");
596
- const as = prefix.as ?? "file";
597
- if (as === "directory") {
598
- return combined ? `${combined}/` : "";
599
- }
600
- return combined ? `${combined}-` : "";
601
- }
602
- /**
603
- * Format a date prefix with the given format
604
- * @internal
605
- */
606
- formatDatePrefix(format, as) {
607
- const formatted = this.formatDate(format);
608
- return as === "directory" ? `${formatted}/` : `${formatted}-`;
609
- }
610
- /**
611
- * Format current date using token-based format string
612
- * @internal
613
- */
614
- formatDate(format) {
615
- return dayjs().format(format);
616
- }
617
- /**
618
- * Build final location from directory, prefix, and filename
619
- * @internal
620
- */
621
- buildLocation(directory, prefix, filename) {
622
- // Clean up directory (remove trailing slash)
623
- const dir = directory.replace(/\/$/, "");
624
- // If prefix ends with /, it's a directory
625
- if (prefix.endsWith("/")) {
626
- return `${dir}/${prefix}${filename}`;
627
- }
628
- // Otherwise prefix is part of filename
629
- return `${dir}/${prefix}${filename}`;
630
- }
631
- /**
632
- * Get final extension (accounting for format changes)
633
- * @internal
634
- */
635
- getFinalExtension() {
636
- if (this._imageOptions.format) {
637
- // Map formats to extensions
638
- const format = this._imageOptions.format;
639
- if (format === "jpeg")
640
- return "jpg";
641
- return format;
642
- }
643
- return this.extension;
644
- }
645
- /**
646
- * Get final MIME type (accounting for format changes)
647
- * @internal
648
- */
649
- getFinalMimeType() {
650
- if (this._imageOptions.format) {
651
- const format = this._imageOptions.format;
652
- if (format === "jpeg" || format === "jpg")
653
- return "image/jpeg";
654
- return `image/${format}`;
655
- }
656
- return this.mimeType;
657
- }
658
- /**
659
- * Adjust location to use correct extension if format changed
660
- * @internal
661
- */
662
- adjustLocationForFormat(location) {
663
- if (!this._imageOptions.format) {
664
- return location;
665
- }
666
- const ext = this.getFinalExtension();
667
- const currentExt = path.extname(location);
668
- if (currentExt) {
669
- return location.replace(currentExt, `.${ext}`);
670
- }
671
- return `${location}.${ext}`;
672
- }
673
- // ============================================================
674
- // Serialization
675
- // ============================================================
676
- /**
677
- * Convert to JSON representation
678
- *
679
- * Includes file metadata and base64 content for serialization.
680
- */
681
- async toJSON() {
682
- return {
683
- name: this.name,
684
- mimeType: this.mimeType,
685
- extension: this.extension,
686
- size: await this.size(),
687
- isImage: this.isImage,
688
- isVideo: this.isVideo,
689
- isAudio: this.isAudio,
690
- dimensions: this.isImage ? await this.dimensions() : undefined,
691
- base64: (await this.buffer()).toString("base64"),
692
- };
693
- }
694
- }export{UploadedFile};//# sourceMappingURL=uploaded-file.js.map