@kabyeon/nexusjs 0.6.5

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 (669) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +860 -0
  3. package/dist/auth/auth.controller.d.ts +175 -0
  4. package/dist/auth/auth.controller.d.ts.map +1 -0
  5. package/dist/auth/auth.d.ts +47 -0
  6. package/dist/auth/auth.d.ts.map +1 -0
  7. package/dist/auth/auth.module.d.ts +34 -0
  8. package/dist/auth/auth.module.d.ts.map +1 -0
  9. package/dist/auth/auth.service.d.ts +192 -0
  10. package/dist/auth/auth.service.d.ts.map +1 -0
  11. package/dist/auth/decorators/current-user.d.ts +58 -0
  12. package/dist/auth/decorators/current-user.d.ts.map +1 -0
  13. package/dist/auth/index.d.ts +43 -0
  14. package/dist/auth/index.d.ts.map +1 -0
  15. package/dist/auth/index.js +730 -0
  16. package/dist/auth/index.js.map +25 -0
  17. package/dist/auth/middleware.d.ts +50 -0
  18. package/dist/auth/middleware.d.ts.map +1 -0
  19. package/dist/auth/types.d.ts +135 -0
  20. package/dist/auth/types.d.ts.map +1 -0
  21. package/dist/cache/cache.module.d.ts +22 -0
  22. package/dist/cache/cache.module.d.ts.map +1 -0
  23. package/dist/cache/cache.service.d.ts +37 -0
  24. package/dist/cache/cache.service.d.ts.map +1 -0
  25. package/dist/cache/index.d.ts +9 -0
  26. package/dist/cache/index.d.ts.map +1 -0
  27. package/dist/cache/index.js +814 -0
  28. package/dist/cache/index.js.map +25 -0
  29. package/dist/cache/stores/drizzle.d.ts +76 -0
  30. package/dist/cache/stores/drizzle.d.ts.map +1 -0
  31. package/dist/cache/stores/index.d.ts +10 -0
  32. package/dist/cache/stores/index.d.ts.map +1 -0
  33. package/dist/cache/stores/memory.d.ts +34 -0
  34. package/dist/cache/stores/memory.d.ts.map +1 -0
  35. package/dist/cache/stores/redis.d.ts +46 -0
  36. package/dist/cache/stores/redis.d.ts.map +1 -0
  37. package/dist/cache/types.d.ts +88 -0
  38. package/dist/cache/types.d.ts.map +1 -0
  39. package/dist/cli/commands/config.d.ts +44 -0
  40. package/dist/cli/commands/config.d.ts.map +1 -0
  41. package/dist/cli/commands/db-generate.d.ts +20 -0
  42. package/dist/cli/commands/db-generate.d.ts.map +1 -0
  43. package/dist/cli/commands/db-migrate.d.ts +33 -0
  44. package/dist/cli/commands/db-migrate.d.ts.map +1 -0
  45. package/dist/cli/commands/db-seed.d.ts +43 -0
  46. package/dist/cli/commands/db-seed.d.ts.map +1 -0
  47. package/dist/cli/commands/index.d.ts +11 -0
  48. package/dist/cli/commands/index.d.ts.map +1 -0
  49. package/dist/cli/commands/info.d.ts +11 -0
  50. package/dist/cli/commands/info.d.ts.map +1 -0
  51. package/dist/cli/commands/init.d.ts +38 -0
  52. package/dist/cli/commands/init.d.ts.map +1 -0
  53. package/dist/cli/commands/make-auth.d.ts +17 -0
  54. package/dist/cli/commands/make-auth.d.ts.map +1 -0
  55. package/dist/cli/commands/make-controller.d.ts +16 -0
  56. package/dist/cli/commands/make-controller.d.ts.map +1 -0
  57. package/dist/cli/commands/make-crud.d.ts +28 -0
  58. package/dist/cli/commands/make-crud.d.ts.map +1 -0
  59. package/dist/cli/commands/make-listener.d.ts +15 -0
  60. package/dist/cli/commands/make-listener.d.ts.map +1 -0
  61. package/dist/cli/commands/make-middleware.d.ts +7 -0
  62. package/dist/cli/commands/make-middleware.d.ts.map +1 -0
  63. package/dist/cli/commands/make-migration.d.ts +21 -0
  64. package/dist/cli/commands/make-migration.d.ts.map +1 -0
  65. package/dist/cli/commands/make-model.d.ts +22 -0
  66. package/dist/cli/commands/make-model.d.ts.map +1 -0
  67. package/dist/cli/commands/make-module.d.ts +11 -0
  68. package/dist/cli/commands/make-module.d.ts.map +1 -0
  69. package/dist/cli/commands/make-queue.d.ts +17 -0
  70. package/dist/cli/commands/make-queue.d.ts.map +1 -0
  71. package/dist/cli/commands/make-schedule.d.ts +17 -0
  72. package/dist/cli/commands/make-schedule.d.ts.map +1 -0
  73. package/dist/cli/commands/make-service.d.ts +7 -0
  74. package/dist/cli/commands/make-service.d.ts.map +1 -0
  75. package/dist/cli/commands/make-session.d.ts +15 -0
  76. package/dist/cli/commands/make-session.d.ts.map +1 -0
  77. package/dist/cli/commands/make-validator.d.ts +7 -0
  78. package/dist/cli/commands/make-validator.d.ts.map +1 -0
  79. package/dist/cli/commands/new.d.ts +14 -0
  80. package/dist/cli/commands/new.d.ts.map +1 -0
  81. package/dist/cli/commands/repl.d.ts +42 -0
  82. package/dist/cli/commands/repl.d.ts.map +1 -0
  83. package/dist/cli/commands/route-list.d.ts +12 -0
  84. package/dist/cli/commands/route-list.d.ts.map +1 -0
  85. package/dist/cli/core/args.d.ts +29 -0
  86. package/dist/cli/core/args.d.ts.map +1 -0
  87. package/dist/cli/core/config.d.ts +137 -0
  88. package/dist/cli/core/config.d.ts.map +1 -0
  89. package/dist/cli/core/fs.d.ts +38 -0
  90. package/dist/cli/core/fs.d.ts.map +1 -0
  91. package/dist/cli/core/index.d.ts +42 -0
  92. package/dist/cli/core/index.d.ts.map +1 -0
  93. package/dist/cli/core/logger.d.ts +46 -0
  94. package/dist/cli/core/logger.d.ts.map +1 -0
  95. package/dist/cli/core/loose-json.d.ts +26 -0
  96. package/dist/cli/core/loose-json.d.ts.map +1 -0
  97. package/dist/cli/core/prompts.d.ts +22 -0
  98. package/dist/cli/core/prompts.d.ts.map +1 -0
  99. package/dist/cli/core/template.d.ts +26 -0
  100. package/dist/cli/core/template.d.ts.map +1 -0
  101. package/dist/cli/index.d.ts +1 -0
  102. package/dist/cli/index.d.ts.map +1 -0
  103. package/dist/cli/index.js +6136 -0
  104. package/dist/cli/index.js.map +91 -0
  105. package/dist/cli/templates/controller/adonis.d.ts +10 -0
  106. package/dist/cli/templates/controller/adonis.d.ts.map +1 -0
  107. package/dist/cli/templates/controller/functional.d.ts +9 -0
  108. package/dist/cli/templates/controller/functional.d.ts.map +1 -0
  109. package/dist/cli/templates/controller/nest.d.ts +17 -0
  110. package/dist/cli/templates/controller/nest.d.ts.map +1 -0
  111. package/dist/cli/templates/crud/controller.d.ts +8 -0
  112. package/dist/cli/templates/crud/controller.d.ts.map +1 -0
  113. package/dist/cli/templates/crud/dto.d.ts +8 -0
  114. package/dist/cli/templates/crud/dto.d.ts.map +1 -0
  115. package/dist/cli/templates/crud/index.d.ts +33 -0
  116. package/dist/cli/templates/crud/index.d.ts.map +1 -0
  117. package/dist/cli/templates/crud/module.d.ts +6 -0
  118. package/dist/cli/templates/crud/module.d.ts.map +1 -0
  119. package/dist/cli/templates/crud/test.d.ts +10 -0
  120. package/dist/cli/templates/crud/test.d.ts.map +1 -0
  121. package/dist/cli/templates/index.d.ts +39 -0
  122. package/dist/cli/templates/index.d.ts.map +1 -0
  123. package/dist/cli/templates/middleware/middleware.d.ts +8 -0
  124. package/dist/cli/templates/middleware/middleware.d.ts.map +1 -0
  125. package/dist/cli/templates/migration/drizzle.d.ts +12 -0
  126. package/dist/cli/templates/migration/drizzle.d.ts.map +1 -0
  127. package/dist/cli/templates/migration/sql.d.ts +10 -0
  128. package/dist/cli/templates/migration/sql.d.ts.map +1 -0
  129. package/dist/cli/templates/model/drizzle-dialect.d.ts +29 -0
  130. package/dist/cli/templates/model/drizzle-dialect.d.ts.map +1 -0
  131. package/dist/cli/templates/model/drizzle.d.ts +14 -0
  132. package/dist/cli/templates/model/drizzle.d.ts.map +1 -0
  133. package/dist/cli/templates/model/kysely.d.ts +12 -0
  134. package/dist/cli/templates/model/kysely.d.ts.map +1 -0
  135. package/dist/cli/templates/model/prisma.d.ts +12 -0
  136. package/dist/cli/templates/model/prisma.d.ts.map +1 -0
  137. package/dist/cli/templates/module/module.d.ts +16 -0
  138. package/dist/cli/templates/module/module.d.ts.map +1 -0
  139. package/dist/cli/templates/project/drizzle.config.d.ts +12 -0
  140. package/dist/cli/templates/project/drizzle.config.d.ts.map +1 -0
  141. package/dist/cli/templates/project/nx.config.d.ts +7 -0
  142. package/dist/cli/templates/project/nx.config.d.ts.map +1 -0
  143. package/dist/cli/templates/repository/repository.d.ts +13 -0
  144. package/dist/cli/templates/repository/repository.d.ts.map +1 -0
  145. package/dist/cli/templates/service/service.d.ts +12 -0
  146. package/dist/cli/templates/service/service.d.ts.map +1 -0
  147. package/dist/cli/templates/validator/validator.d.ts +8 -0
  148. package/dist/cli/templates/validator/validator.d.ts.map +1 -0
  149. package/dist/config/config.module.d.ts +39 -0
  150. package/dist/config/config.module.d.ts.map +1 -0
  151. package/dist/config/config.service.d.ts +47 -0
  152. package/dist/config/config.service.d.ts.map +1 -0
  153. package/dist/config/index.d.ts +39 -0
  154. package/dist/config/index.d.ts.map +1 -0
  155. package/dist/config/index.js +436 -0
  156. package/dist/config/index.js.map +21 -0
  157. package/dist/config/types.d.ts +78 -0
  158. package/dist/config/types.d.ts.map +1 -0
  159. package/dist/core/application.d.ts +77 -0
  160. package/dist/core/application.d.ts.map +1 -0
  161. package/dist/core/constants.d.ts +48 -0
  162. package/dist/core/constants.d.ts.map +1 -0
  163. package/dist/core/decorators/controller.d.ts +21 -0
  164. package/dist/core/decorators/controller.d.ts.map +1 -0
  165. package/dist/core/decorators/http-methods.d.ts +33 -0
  166. package/dist/core/decorators/http-methods.d.ts.map +1 -0
  167. package/dist/core/decorators/index.d.ts +12 -0
  168. package/dist/core/decorators/index.d.ts.map +1 -0
  169. package/dist/core/decorators/injectable.d.ts +42 -0
  170. package/dist/core/decorators/injectable.d.ts.map +1 -0
  171. package/dist/core/decorators/metadata.d.ts +7 -0
  172. package/dist/core/decorators/metadata.d.ts.map +1 -0
  173. package/dist/core/decorators/module.d.ts +23 -0
  174. package/dist/core/decorators/module.d.ts.map +1 -0
  175. package/dist/core/decorators/params.d.ts +33 -0
  176. package/dist/core/decorators/params.d.ts.map +1 -0
  177. package/dist/core/decorators/repository.d.ts +24 -0
  178. package/dist/core/decorators/repository.d.ts.map +1 -0
  179. package/dist/core/decorators/validate.d.ts +21 -0
  180. package/dist/core/decorators/validate.d.ts.map +1 -0
  181. package/dist/core/di/container.d.ts +70 -0
  182. package/dist/core/di/container.d.ts.map +1 -0
  183. package/dist/core/di/index.d.ts +9 -0
  184. package/dist/core/di/index.d.ts.map +1 -0
  185. package/dist/core/di/request-middleware.d.ts +36 -0
  186. package/dist/core/di/request-middleware.d.ts.map +1 -0
  187. package/dist/core/di/request-scope.d.ts +45 -0
  188. package/dist/core/di/request-scope.d.ts.map +1 -0
  189. package/dist/core/di/scanner.d.ts +36 -0
  190. package/dist/core/di/scanner.d.ts.map +1 -0
  191. package/dist/core/di/tokens.d.ts +98 -0
  192. package/dist/core/di/tokens.d.ts.map +1 -0
  193. package/dist/core/http/context.d.ts +30 -0
  194. package/dist/core/http/context.d.ts.map +1 -0
  195. package/dist/core/http/index.d.ts +8 -0
  196. package/dist/core/http/index.d.ts.map +1 -0
  197. package/dist/core/http/middleware.d.ts +31 -0
  198. package/dist/core/http/middleware.d.ts.map +1 -0
  199. package/dist/core/http/router.d.ts +46 -0
  200. package/dist/core/http/router.d.ts.map +1 -0
  201. package/dist/core/http/server.d.ts +58 -0
  202. package/dist/core/http/server.d.ts.map +1 -0
  203. package/dist/core/index.d.ts +20 -0
  204. package/dist/core/index.d.ts.map +1 -0
  205. package/dist/core/orm/drizzle-adapter.d.ts +73 -0
  206. package/dist/core/orm/drizzle-adapter.d.ts.map +1 -0
  207. package/dist/core/orm/index.d.ts +5 -0
  208. package/dist/core/orm/index.d.ts.map +1 -0
  209. package/dist/core/runtime/bun.d.ts +13 -0
  210. package/dist/core/runtime/bun.d.ts.map +1 -0
  211. package/dist/core/runtime/cloudflare.d.ts +18 -0
  212. package/dist/core/runtime/cloudflare.d.ts.map +1 -0
  213. package/dist/core/runtime/index.d.ts +11 -0
  214. package/dist/core/runtime/index.d.ts.map +1 -0
  215. package/dist/core/runtime/node.d.ts +10 -0
  216. package/dist/core/runtime/node.d.ts.map +1 -0
  217. package/dist/core/validation/index.d.ts +5 -0
  218. package/dist/core/validation/index.d.ts.map +1 -0
  219. package/dist/core/validation/validator.d.ts +46 -0
  220. package/dist/core/validation/validator.d.ts.map +1 -0
  221. package/dist/crypto/encryption.d.ts +71 -0
  222. package/dist/crypto/encryption.d.ts.map +1 -0
  223. package/dist/crypto/hash.d.ts +52 -0
  224. package/dist/crypto/hash.d.ts.map +1 -0
  225. package/dist/crypto/index.d.ts +49 -0
  226. package/dist/crypto/index.d.ts.map +1 -0
  227. package/dist/crypto/index.js +533 -0
  228. package/dist/crypto/index.js.map +14 -0
  229. package/dist/crypto/module.d.ts +28 -0
  230. package/dist/crypto/module.d.ts.map +1 -0
  231. package/dist/crypto/types.d.ts +81 -0
  232. package/dist/crypto/types.d.ts.map +1 -0
  233. package/dist/drive/drive.module.d.ts +20 -0
  234. package/dist/drive/drive.module.d.ts.map +1 -0
  235. package/dist/drive/drive.service.d.ts +21 -0
  236. package/dist/drive/drive.service.d.ts.map +1 -0
  237. package/dist/drive/drivers/index.d.ts +9 -0
  238. package/dist/drive/drivers/index.d.ts.map +1 -0
  239. package/dist/drive/drivers/local.d.ts +24 -0
  240. package/dist/drive/drivers/local.d.ts.map +1 -0
  241. package/dist/drive/drivers/memory.d.ts +19 -0
  242. package/dist/drive/drivers/memory.d.ts.map +1 -0
  243. package/dist/drive/drivers/s3.d.ts +44 -0
  244. package/dist/drive/drivers/s3.d.ts.map +1 -0
  245. package/dist/drive/index.d.ts +9 -0
  246. package/dist/drive/index.d.ts.map +1 -0
  247. package/dist/drive/index.js +714 -0
  248. package/dist/drive/index.js.map +25 -0
  249. package/dist/drive/types.d.ts +97 -0
  250. package/dist/drive/types.d.ts.map +1 -0
  251. package/dist/drizzle/decorators/columns.d.ts +16 -0
  252. package/dist/drizzle/decorators/columns.d.ts.map +1 -0
  253. package/dist/drizzle/decorators/index.d.ts +6 -0
  254. package/dist/drizzle/decorators/index.d.ts.map +1 -0
  255. package/dist/drizzle/drivers/base.d.ts +32 -0
  256. package/dist/drizzle/drivers/base.d.ts.map +1 -0
  257. package/dist/drizzle/drivers/bun-sqlite.d.ts +6 -0
  258. package/dist/drizzle/drivers/bun-sqlite.d.ts.map +1 -0
  259. package/dist/drizzle/drivers/d1.d.ts +7 -0
  260. package/dist/drizzle/drivers/d1.d.ts.map +1 -0
  261. package/dist/drizzle/drivers/index.d.ts +14 -0
  262. package/dist/drizzle/drivers/index.d.ts.map +1 -0
  263. package/dist/drizzle/drivers/mysql.d.ts +6 -0
  264. package/dist/drizzle/drivers/mysql.d.ts.map +1 -0
  265. package/dist/drizzle/drivers/postgres.d.ts +12 -0
  266. package/dist/drizzle/drivers/postgres.d.ts.map +1 -0
  267. package/dist/drizzle/drivers/sqlite.d.ts +8 -0
  268. package/dist/drizzle/drivers/sqlite.d.ts.map +1 -0
  269. package/dist/drizzle/drizzle.module.d.ts +29 -0
  270. package/dist/drizzle/drizzle.module.d.ts.map +1 -0
  271. package/dist/drizzle/drizzle.service.d.ts +52 -0
  272. package/dist/drizzle/drizzle.service.d.ts.map +1 -0
  273. package/dist/drizzle/index.d.ts +13 -0
  274. package/dist/drizzle/index.d.ts.map +1 -0
  275. package/dist/drizzle/index.js +979 -0
  276. package/dist/drizzle/index.js.map +32 -0
  277. package/dist/drizzle/model.d.ts +26 -0
  278. package/dist/drizzle/model.d.ts.map +1 -0
  279. package/dist/drizzle/raw-query.d.ts +41 -0
  280. package/dist/drizzle/raw-query.d.ts.map +1 -0
  281. package/dist/drizzle/repository/index.d.ts +6 -0
  282. package/dist/drizzle/repository/index.d.ts.map +1 -0
  283. package/dist/drizzle/repository/repository.d.ts +60 -0
  284. package/dist/drizzle/repository/repository.d.ts.map +1 -0
  285. package/dist/drizzle/types.d.ts +160 -0
  286. package/dist/drizzle/types.d.ts.map +1 -0
  287. package/dist/events/decorators/on-event.d.ts +49 -0
  288. package/dist/events/decorators/on-event.d.ts.map +1 -0
  289. package/dist/events/emitter.d.ts +52 -0
  290. package/dist/events/emitter.d.ts.map +1 -0
  291. package/dist/events/event.service.d.ts +27 -0
  292. package/dist/events/event.service.d.ts.map +1 -0
  293. package/dist/events/events.module.d.ts +35 -0
  294. package/dist/events/events.module.d.ts.map +1 -0
  295. package/dist/events/index.d.ts +43 -0
  296. package/dist/events/index.d.ts.map +1 -0
  297. package/dist/events/index.js +646 -0
  298. package/dist/events/index.js.map +23 -0
  299. package/dist/events/types.d.ts +120 -0
  300. package/dist/events/types.d.ts.map +1 -0
  301. package/dist/grpc/decorators.d.ts +34 -0
  302. package/dist/grpc/decorators.d.ts.map +1 -0
  303. package/dist/grpc/index.d.ts +70 -0
  304. package/dist/grpc/index.d.ts.map +1 -0
  305. package/dist/grpc/index.js +528 -0
  306. package/dist/grpc/index.js.map +22 -0
  307. package/dist/grpc/module.d.ts +32 -0
  308. package/dist/grpc/module.d.ts.map +1 -0
  309. package/dist/grpc/service.d.ts +60 -0
  310. package/dist/grpc/service.d.ts.map +1 -0
  311. package/dist/grpc/types.d.ts +79 -0
  312. package/dist/grpc/types.d.ts.map +1 -0
  313. package/dist/health/health.controller.d.ts +61 -0
  314. package/dist/health/health.controller.d.ts.map +1 -0
  315. package/dist/health/health.module.d.ts +29 -0
  316. package/dist/health/health.module.d.ts.map +1 -0
  317. package/dist/health/health.service.d.ts +34 -0
  318. package/dist/health/health.service.d.ts.map +1 -0
  319. package/dist/health/index.d.ts +38 -0
  320. package/dist/health/index.d.ts.map +1 -0
  321. package/dist/health/index.js +599 -0
  322. package/dist/health/index.js.map +25 -0
  323. package/dist/health/indicators/drizzle.d.ts +18 -0
  324. package/dist/health/indicators/drizzle.d.ts.map +1 -0
  325. package/dist/health/indicators/index.d.ts +59 -0
  326. package/dist/health/indicators/index.d.ts.map +1 -0
  327. package/dist/health/types.d.ts +105 -0
  328. package/dist/health/types.d.ts.map +1 -0
  329. package/dist/i18n/decorators.d.ts +14 -0
  330. package/dist/i18n/decorators.d.ts.map +1 -0
  331. package/dist/i18n/index.d.ts +48 -0
  332. package/dist/i18n/index.d.ts.map +1 -0
  333. package/dist/i18n/index.js +589 -0
  334. package/dist/i18n/index.js.map +17 -0
  335. package/dist/i18n/middleware.d.ts +26 -0
  336. package/dist/i18n/middleware.d.ts.map +1 -0
  337. package/dist/i18n/module.d.ts +39 -0
  338. package/dist/i18n/module.d.ts.map +1 -0
  339. package/dist/i18n/service.d.ts +130 -0
  340. package/dist/i18n/service.d.ts.map +1 -0
  341. package/dist/i18n/types.d.ts +65 -0
  342. package/dist/i18n/types.d.ts.map +1 -0
  343. package/dist/index.d.ts +2 -0
  344. package/dist/index.js +2056 -0
  345. package/dist/index.js.map +53 -0
  346. package/dist/limiter/backends/drizzle.d.ts +40 -0
  347. package/dist/limiter/backends/drizzle.d.ts.map +1 -0
  348. package/dist/limiter/backends/index.d.ts +6 -0
  349. package/dist/limiter/backends/index.d.ts.map +1 -0
  350. package/dist/limiter/backends/memory.d.ts +28 -0
  351. package/dist/limiter/backends/memory.d.ts.map +1 -0
  352. package/dist/limiter/index.d.ts +9 -0
  353. package/dist/limiter/index.d.ts.map +1 -0
  354. package/dist/limiter/index.js +640 -0
  355. package/dist/limiter/index.js.map +25 -0
  356. package/dist/limiter/limiter.middleware.d.ts +11 -0
  357. package/dist/limiter/limiter.middleware.d.ts.map +1 -0
  358. package/dist/limiter/limiter.module.d.ts +23 -0
  359. package/dist/limiter/limiter.module.d.ts.map +1 -0
  360. package/dist/limiter/limiter.service.d.ts +18 -0
  361. package/dist/limiter/limiter.service.d.ts.map +1 -0
  362. package/dist/limiter/types.d.ts +99 -0
  363. package/dist/limiter/types.d.ts.map +1 -0
  364. package/dist/logger/index.d.ts +36 -0
  365. package/dist/logger/index.d.ts.map +1 -0
  366. package/dist/logger/index.js +538 -0
  367. package/dist/logger/index.js.map +22 -0
  368. package/dist/logger/logger.module.d.ts +35 -0
  369. package/dist/logger/logger.module.d.ts.map +1 -0
  370. package/dist/logger/logger.service.d.ts +55 -0
  371. package/dist/logger/logger.service.d.ts.map +1 -0
  372. package/dist/logger/transports/index.d.ts +35 -0
  373. package/dist/logger/transports/index.d.ts.map +1 -0
  374. package/dist/logger/types.d.ts +58 -0
  375. package/dist/logger/types.d.ts.map +1 -0
  376. package/dist/mail/index.d.ts +9 -0
  377. package/dist/mail/index.d.ts.map +1 -0
  378. package/dist/mail/index.js +479 -0
  379. package/dist/mail/index.js.map +25 -0
  380. package/dist/mail/mail.module.d.ts +21 -0
  381. package/dist/mail/mail.module.d.ts.map +1 -0
  382. package/dist/mail/mail.service.d.ts +18 -0
  383. package/dist/mail/mail.service.d.ts.map +1 -0
  384. package/dist/mail/transports/file.d.ts +19 -0
  385. package/dist/mail/transports/file.d.ts.map +1 -0
  386. package/dist/mail/transports/index.d.ts +9 -0
  387. package/dist/mail/transports/index.d.ts.map +1 -0
  388. package/dist/mail/transports/null.d.ts +11 -0
  389. package/dist/mail/transports/null.d.ts.map +1 -0
  390. package/dist/mail/transports/smtp.d.ts +40 -0
  391. package/dist/mail/transports/smtp.d.ts.map +1 -0
  392. package/dist/mail/types.d.ts +73 -0
  393. package/dist/mail/types.d.ts.map +1 -0
  394. package/dist/metrics/controller.d.ts +27 -0
  395. package/dist/metrics/controller.d.ts.map +1 -0
  396. package/dist/metrics/counter.d.ts +36 -0
  397. package/dist/metrics/counter.d.ts.map +1 -0
  398. package/dist/metrics/decorators/counted.d.ts +26 -0
  399. package/dist/metrics/decorators/counted.d.ts.map +1 -0
  400. package/dist/metrics/decorators/index.d.ts +3 -0
  401. package/dist/metrics/decorators/index.d.ts.map +1 -0
  402. package/dist/metrics/decorators/timed.d.ts +25 -0
  403. package/dist/metrics/decorators/timed.d.ts.map +1 -0
  404. package/dist/metrics/gauge.d.ts +38 -0
  405. package/dist/metrics/gauge.d.ts.map +1 -0
  406. package/dist/metrics/histogram.d.ts +52 -0
  407. package/dist/metrics/histogram.d.ts.map +1 -0
  408. package/dist/metrics/index.d.ts +35 -0
  409. package/dist/metrics/index.d.ts.map +1 -0
  410. package/dist/metrics/index.js +1033 -0
  411. package/dist/metrics/index.js.map +21 -0
  412. package/dist/metrics/module.d.ts +33 -0
  413. package/dist/metrics/module.d.ts.map +1 -0
  414. package/dist/metrics/registry.d.ts +52 -0
  415. package/dist/metrics/registry.d.ts.map +1 -0
  416. package/dist/metrics/service.d.ts +42 -0
  417. package/dist/metrics/service.d.ts.map +1 -0
  418. package/dist/metrics/summary.d.ts +50 -0
  419. package/dist/metrics/summary.d.ts.map +1 -0
  420. package/dist/metrics/types.d.ts +115 -0
  421. package/dist/metrics/types.d.ts.map +1 -0
  422. package/dist/openapi/decorators/body.d.ts +9 -0
  423. package/dist/openapi/decorators/body.d.ts.map +1 -0
  424. package/dist/openapi/decorators/index.d.ts +11 -0
  425. package/dist/openapi/decorators/index.d.ts.map +1 -0
  426. package/dist/openapi/decorators/operation.d.ts +9 -0
  427. package/dist/openapi/decorators/operation.d.ts.map +1 -0
  428. package/dist/openapi/decorators/param.d.ts +17 -0
  429. package/dist/openapi/decorators/param.d.ts.map +1 -0
  430. package/dist/openapi/decorators/property.d.ts +24 -0
  431. package/dist/openapi/decorators/property.d.ts.map +1 -0
  432. package/dist/openapi/decorators/response.d.ts +10 -0
  433. package/dist/openapi/decorators/response.d.ts.map +1 -0
  434. package/dist/openapi/decorators/security.d.ts +9 -0
  435. package/dist/openapi/decorators/security.d.ts.map +1 -0
  436. package/dist/openapi/decorators/tags.d.ts +2 -0
  437. package/dist/openapi/decorators/tags.d.ts.map +1 -0
  438. package/dist/openapi/index.d.ts +10 -0
  439. package/dist/openapi/index.d.ts.map +1 -0
  440. package/dist/openapi/index.js +974 -0
  441. package/dist/openapi/index.js.map +31 -0
  442. package/dist/openapi/openapi.module.d.ts +46 -0
  443. package/dist/openapi/openapi.module.d.ts.map +1 -0
  444. package/dist/openapi/openapi.service.d.ts +55 -0
  445. package/dist/openapi/openapi.service.d.ts.map +1 -0
  446. package/dist/openapi/scalar.d.ts +16 -0
  447. package/dist/openapi/scalar.d.ts.map +1 -0
  448. package/dist/openapi/types.d.ts +266 -0
  449. package/dist/openapi/types.d.ts.map +1 -0
  450. package/dist/openapi/zod-to-json-schema.d.ts +34 -0
  451. package/dist/openapi/zod-to-json-schema.d.ts.map +1 -0
  452. package/dist/package.json +59 -0
  453. package/dist/queue/backends/bullmq.d.ts +41 -0
  454. package/dist/queue/backends/bullmq.d.ts.map +1 -0
  455. package/dist/queue/backends/cloudflare.d.ts +84 -0
  456. package/dist/queue/backends/cloudflare.d.ts.map +1 -0
  457. package/dist/queue/backends/index.d.ts +7 -0
  458. package/dist/queue/backends/index.d.ts.map +1 -0
  459. package/dist/queue/backends/memory.d.ts +24 -0
  460. package/dist/queue/backends/memory.d.ts.map +1 -0
  461. package/dist/queue/decorators/on-queue-ready.d.ts +43 -0
  462. package/dist/queue/decorators/on-queue-ready.d.ts.map +1 -0
  463. package/dist/queue/index.d.ts +57 -0
  464. package/dist/queue/index.d.ts.map +1 -0
  465. package/dist/queue/index.js +961 -0
  466. package/dist/queue/index.js.map +25 -0
  467. package/dist/queue/queue.module.d.ts +46 -0
  468. package/dist/queue/queue.module.d.ts.map +1 -0
  469. package/dist/queue/queue.service.d.ts +61 -0
  470. package/dist/queue/queue.service.d.ts.map +1 -0
  471. package/dist/queue/types.d.ts +204 -0
  472. package/dist/queue/types.d.ts.map +1 -0
  473. package/dist/redis/adapters/bun.d.ts +27 -0
  474. package/dist/redis/adapters/bun.d.ts.map +1 -0
  475. package/dist/redis/adapters/cloudflare.d.ts +51 -0
  476. package/dist/redis/adapters/cloudflare.d.ts.map +1 -0
  477. package/dist/redis/adapters/index.d.ts +29 -0
  478. package/dist/redis/adapters/index.d.ts.map +1 -0
  479. package/dist/redis/adapters/memory.d.ts +28 -0
  480. package/dist/redis/adapters/memory.d.ts.map +1 -0
  481. package/dist/redis/adapters/node.d.ts +36 -0
  482. package/dist/redis/adapters/node.d.ts.map +1 -0
  483. package/dist/redis/index.d.ts +33 -0
  484. package/dist/redis/index.d.ts.map +1 -0
  485. package/dist/redis/index.js +667 -0
  486. package/dist/redis/index.js.map +25 -0
  487. package/dist/redis/module.d.ts +32 -0
  488. package/dist/redis/module.d.ts.map +1 -0
  489. package/dist/redis/types.d.ts +146 -0
  490. package/dist/redis/types.d.ts.map +1 -0
  491. package/dist/schedule/backends/cloudflare.d.ts +55 -0
  492. package/dist/schedule/backends/cloudflare.d.ts.map +1 -0
  493. package/dist/schedule/backends/index.d.ts +3 -0
  494. package/dist/schedule/backends/index.d.ts.map +1 -0
  495. package/dist/schedule/backends/memory.d.ts +39 -0
  496. package/dist/schedule/backends/memory.d.ts.map +1 -0
  497. package/dist/schedule/cron-parser.d.ts +48 -0
  498. package/dist/schedule/cron-parser.d.ts.map +1 -0
  499. package/dist/schedule/decorators/cron.d.ts +71 -0
  500. package/dist/schedule/decorators/cron.d.ts.map +1 -0
  501. package/dist/schedule/index.d.ts +51 -0
  502. package/dist/schedule/index.d.ts.map +1 -0
  503. package/dist/schedule/index.js +1108 -0
  504. package/dist/schedule/index.js.map +25 -0
  505. package/dist/schedule/schedule.module.d.ts +44 -0
  506. package/dist/schedule/schedule.module.d.ts.map +1 -0
  507. package/dist/schedule/schedule.service.d.ts +51 -0
  508. package/dist/schedule/schedule.service.d.ts.map +1 -0
  509. package/dist/schedule/types.d.ts +150 -0
  510. package/dist/schedule/types.d.ts.map +1 -0
  511. package/dist/session/backends/cookie.d.ts +56 -0
  512. package/dist/session/backends/cookie.d.ts.map +1 -0
  513. package/dist/session/backends/drizzle.d.ts +65 -0
  514. package/dist/session/backends/drizzle.d.ts.map +1 -0
  515. package/dist/session/backends/index.d.ts +6 -0
  516. package/dist/session/backends/index.d.ts.map +1 -0
  517. package/dist/session/backends/memory.d.ts +32 -0
  518. package/dist/session/backends/memory.d.ts.map +1 -0
  519. package/dist/session/backends/redis.d.ts +53 -0
  520. package/dist/session/backends/redis.d.ts.map +1 -0
  521. package/dist/session/decorators/current-session.d.ts +56 -0
  522. package/dist/session/decorators/current-session.d.ts.map +1 -0
  523. package/dist/session/index.d.ts +42 -0
  524. package/dist/session/index.d.ts.map +1 -0
  525. package/dist/session/index.js +1498 -0
  526. package/dist/session/index.js.map +28 -0
  527. package/dist/session/session-middleware.d.ts +29 -0
  528. package/dist/session/session-middleware.d.ts.map +1 -0
  529. package/dist/session/session.module.d.ts +35 -0
  530. package/dist/session/session.module.d.ts.map +1 -0
  531. package/dist/session/session.service.d.ts +49 -0
  532. package/dist/session/session.service.d.ts.map +1 -0
  533. package/dist/session/types.d.ts +201 -0
  534. package/dist/session/types.d.ts.map +1 -0
  535. package/dist/shield/guards/csrf.d.ts +33 -0
  536. package/dist/shield/guards/csrf.d.ts.map +1 -0
  537. package/dist/shield/guards/headers.d.ts +22 -0
  538. package/dist/shield/guards/headers.d.ts.map +1 -0
  539. package/dist/shield/guards/index.d.ts +6 -0
  540. package/dist/shield/guards/index.d.ts.map +1 -0
  541. package/dist/shield/index.d.ts +8 -0
  542. package/dist/shield/index.d.ts.map +1 -0
  543. package/dist/shield/index.js +728 -0
  544. package/dist/shield/index.js.map +25 -0
  545. package/dist/shield/shield.module.d.ts +25 -0
  546. package/dist/shield/shield.module.d.ts.map +1 -0
  547. package/dist/shield/shield.service.d.ts +21 -0
  548. package/dist/shield/shield.service.d.ts.map +1 -0
  549. package/dist/shield/types.d.ts +95 -0
  550. package/dist/shield/types.d.ts.map +1 -0
  551. package/dist/sse/index.d.ts +7 -0
  552. package/dist/sse/index.d.ts.map +1 -0
  553. package/dist/sse/index.js +214 -0
  554. package/dist/sse/index.js.map +13 -0
  555. package/dist/sse/sse-stream.d.ts +46 -0
  556. package/dist/sse/sse-stream.d.ts.map +1 -0
  557. package/dist/sse/sse.d.ts +24 -0
  558. package/dist/sse/sse.d.ts.map +1 -0
  559. package/dist/sse/types.d.ts +84 -0
  560. package/dist/sse/types.d.ts.map +1 -0
  561. package/dist/static/index.d.ts +41 -0
  562. package/dist/static/index.d.ts.map +1 -0
  563. package/dist/static/index.js +313 -0
  564. package/dist/static/index.js.map +13 -0
  565. package/dist/static/static.module.d.ts +41 -0
  566. package/dist/static/static.module.d.ts.map +1 -0
  567. package/dist/static/static.service.d.ts +38 -0
  568. package/dist/static/static.service.d.ts.map +1 -0
  569. package/dist/tracing/decorators/index.d.ts +2 -0
  570. package/dist/tracing/decorators/index.d.ts.map +1 -0
  571. package/dist/tracing/decorators/trace.d.ts +37 -0
  572. package/dist/tracing/decorators/trace.d.ts.map +1 -0
  573. package/dist/tracing/hono-instrumentation.d.ts +21 -0
  574. package/dist/tracing/hono-instrumentation.d.ts.map +1 -0
  575. package/dist/tracing/index.d.ts +29 -0
  576. package/dist/tracing/index.d.ts.map +1 -0
  577. package/dist/tracing/index.js +782 -0
  578. package/dist/tracing/index.js.map +24 -0
  579. package/dist/tracing/module.d.ts +45 -0
  580. package/dist/tracing/module.d.ts.map +1 -0
  581. package/dist/tracing/propagation.d.ts +53 -0
  582. package/dist/tracing/propagation.d.ts.map +1 -0
  583. package/dist/tracing/service.d.ts +95 -0
  584. package/dist/tracing/service.d.ts.map +1 -0
  585. package/dist/tracing/types.d.ts +90 -0
  586. package/dist/tracing/types.d.ts.map +1 -0
  587. package/dist/upload/decorators/index.d.ts +6 -0
  588. package/dist/upload/decorators/index.d.ts.map +1 -0
  589. package/dist/upload/decorators/upload.d.ts +16 -0
  590. package/dist/upload/decorators/upload.d.ts.map +1 -0
  591. package/dist/upload/decorators/uploaded-file.d.ts +10 -0
  592. package/dist/upload/decorators/uploaded-file.d.ts.map +1 -0
  593. package/dist/upload/index.d.ts +9 -0
  594. package/dist/upload/index.d.ts.map +1 -0
  595. package/dist/upload/index.js +553 -0
  596. package/dist/upload/index.js.map +25 -0
  597. package/dist/upload/types.d.ts +103 -0
  598. package/dist/upload/types.d.ts.map +1 -0
  599. package/dist/upload/upload.middleware.d.ts +15 -0
  600. package/dist/upload/upload.middleware.d.ts.map +1 -0
  601. package/dist/upload/upload.module.d.ts +33 -0
  602. package/dist/upload/upload.module.d.ts.map +1 -0
  603. package/dist/upload/upload.service.d.ts +29 -0
  604. package/dist/upload/upload.service.d.ts.map +1 -0
  605. package/dist/view/edge.d.ts +23 -0
  606. package/dist/view/edge.d.ts.map +1 -0
  607. package/dist/view/eta.d.ts +30 -0
  608. package/dist/view/eta.d.ts.map +1 -0
  609. package/dist/view/index.d.ts +34 -0
  610. package/dist/view/index.d.ts.map +1 -0
  611. package/dist/view/index.js +240 -0
  612. package/dist/view/index.js.map +14 -0
  613. package/dist/view/inertia/default-ssr.d.ts +15 -0
  614. package/dist/view/inertia/default-ssr.d.ts.map +1 -0
  615. package/dist/view/inertia/form-helper.d.ts +102 -0
  616. package/dist/view/inertia/form-helper.d.ts.map +1 -0
  617. package/dist/view/inertia/form-middleware.d.ts +53 -0
  618. package/dist/view/inertia/form-middleware.d.ts.map +1 -0
  619. package/dist/view/inertia/helpers.d.ts +149 -0
  620. package/dist/view/inertia/helpers.d.ts.map +1 -0
  621. package/dist/view/inertia/index.d.ts +18 -0
  622. package/dist/view/inertia/index.d.ts.map +1 -0
  623. package/dist/view/inertia/inertia-adapter.d.ts +93 -0
  624. package/dist/view/inertia/inertia-adapter.d.ts.map +1 -0
  625. package/dist/view/inertia/inertia-response.d.ts +51 -0
  626. package/dist/view/inertia/inertia-response.d.ts.map +1 -0
  627. package/dist/view/inertia/ssr/index.d.ts +13 -0
  628. package/dist/view/inertia/ssr/index.d.ts.map +1 -0
  629. package/dist/view/inertia/ssr/react-adapter.d.ts +33 -0
  630. package/dist/view/inertia/ssr/react-adapter.d.ts.map +1 -0
  631. package/dist/view/inertia/ssr/registry.d.ts +42 -0
  632. package/dist/view/inertia/ssr/registry.d.ts.map +1 -0
  633. package/dist/view/inertia/ssr/solid-adapter.d.ts +31 -0
  634. package/dist/view/inertia/ssr/solid-adapter.d.ts.map +1 -0
  635. package/dist/view/inertia/ssr/svelte-adapter.d.ts +31 -0
  636. package/dist/view/inertia/ssr/svelte-adapter.d.ts.map +1 -0
  637. package/dist/view/inertia/ssr/vue-adapter.d.ts +26 -0
  638. package/dist/view/inertia/ssr/vue-adapter.d.ts.map +1 -0
  639. package/dist/view/inertia/types.d.ts +131 -0
  640. package/dist/view/inertia/types.d.ts.map +1 -0
  641. package/dist/view/rendu.d.ts +11 -0
  642. package/dist/view/rendu.d.ts.map +1 -0
  643. package/dist/view/types.d.ts +52 -0
  644. package/dist/view/types.d.ts.map +1 -0
  645. package/dist/view/view-engine.d.ts +28 -0
  646. package/dist/view/view-engine.d.ts.map +1 -0
  647. package/dist/ws/client.d.ts +42 -0
  648. package/dist/ws/client.d.ts.map +1 -0
  649. package/dist/ws/decorators.d.ts +44 -0
  650. package/dist/ws/decorators.d.ts.map +1 -0
  651. package/dist/ws/index.d.ts +57 -0
  652. package/dist/ws/index.d.ts.map +1 -0
  653. package/dist/ws/index.js +796 -0
  654. package/dist/ws/index.js.map +26 -0
  655. package/dist/ws/module.d.ts +48 -0
  656. package/dist/ws/module.d.ts.map +1 -0
  657. package/dist/ws/runtime/bun.d.ts +41 -0
  658. package/dist/ws/runtime/bun.d.ts.map +1 -0
  659. package/dist/ws/runtime/index.d.ts +14 -0
  660. package/dist/ws/runtime/index.d.ts.map +1 -0
  661. package/dist/ws/runtime/node.d.ts +46 -0
  662. package/dist/ws/runtime/node.d.ts.map +1 -0
  663. package/dist/ws/runtime/types.d.ts +18 -0
  664. package/dist/ws/runtime/types.d.ts.map +1 -0
  665. package/dist/ws/service.d.ts +65 -0
  666. package/dist/ws/service.d.ts.map +1 -0
  667. package/dist/ws/types.d.ts +77 -0
  668. package/dist/ws/types.d.ts.map +1 -0
  669. package/package.json +262 -0
@@ -0,0 +1,24 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../src/core/constants.ts", "../src/core/decorators/controller.ts", "../src/core/decorators/http-methods.ts", "../src/core/decorators/params.ts", "../src/core/decorators/validate.ts", "../src/tracing/service.ts", "../src/core/decorators/module.ts", "../src/core/decorators/index.ts", "../src/core/decorators/injectable.ts", "../src/core/decorators/repository.ts", "../src/core/decorators/metadata.ts", "../src/tracing/hono-instrumentation.ts", "../src/tracing/module.ts", "../src/tracing/propagation.ts", "../src/tracing/decorators/trace.ts"],
4
+ "sourcesContent": [
5
+ "/**\n * Metadata keys used by reflect-metadata for storing decorator data.\n *\n * These constants are the contract between decorators and the framework\n * core (DI container, router, validator).\n */\nexport const METADATA_KEY = {\n\t/** Marks a class as a Nest-style controller, stores route prefix. */\n\tCONTROLLER: \"nexus:controller\",\n\n\t/** Marks a class as an injectable provider. */\n\tINJECTABLE: \"nexus:injectable\",\n\n\t/** Marks a class as a repository. */\n\tREPOSITORY: \"nexus:repository\",\n\n\t/** Marks a class as a module. Stores module options. */\n\tMODULE: \"nexus:module\",\n\n\t/** HTTP method routes registered on a controller (Get/Post/...). */\n\tROUTES: \"nexus:routes\",\n\n\t/** Method parameter type metadata (body/query/param/headers/ctx). */\n\tPARAMS: \"nexus:params\",\n\n\t/** Validation schema per method (Zod schema or class). */\n\tVALIDATE: \"nexus:validate\",\n\n\t/** Class-level design:paramtypes (built-in). */\n\tPARAMTYPES: \"design:paramtypes\",\n\n\t/** Class-level design:type (built-in). */\n\tTYPE: \"design:type\",\n\n\t/** Class-level design:returntype (built-in). */\n\tRETURNTYPE: \"design:returntype\",\n\n\t/** Provider token to inject for a parameter (for custom tokens). */\n\tINJECT: \"nexus:inject\",\n} as const;\n\nexport type MetadataKey = (typeof METADATA_KEY)[keyof typeof METADATA_KEY];\n\n/** Available parameter decorator locations. */\nexport const PARAM_TYPES = {\n\tREQUEST: 0,\n\tRESPONSE: 1,\n\tNEXT: 2,\n\tBODY: 3,\n\tQUERY: 4,\n\tPARAM: 5,\n\tHEADERS: 6,\n\tCTX: 7,\n\tUSER: 8,\n} as const;\n\nexport type ParamType = (typeof PARAM_TYPES)[keyof typeof PARAM_TYPES];\n\n/** HTTP methods supported by the router. */\nexport const HTTP_METHODS = [\n\t\"GET\",\n\t\"POST\",\n\t\"PUT\",\n\t\"DELETE\",\n\t\"PATCH\",\n\t\"OPTIONS\",\n\t\"HEAD\",\n] as const;\nexport type HttpMethod = (typeof HTTP_METHODS)[number];\n",
6
+ "/**\n * @Controller decorator.\n *\n * Marks a class as a controller and registers a route prefix.\n * Routes inside the controller class are decorated with @Get/@Post/etc.\n *\n * @example\n * ```ts\n * @Controller('/users')\n * class UserController {\n * @Get('/')\n * list() { ... }\n * }\n * ```\n */\nimport \"reflect-metadata\";\nimport { METADATA_KEY } from \"../constants.js\";\nimport type { ControllerMetadata } from \"../di/tokens.js\";\n\nexport function Controller(prefix: string = \"/\"): ClassDecorator {\n\treturn (target: object) => {\n\t\tconst normalized = normalizePrefix(prefix);\n\t\tconst meta: ControllerMetadata = { prefix: normalized };\n\t\tReflect.defineMetadata(METADATA_KEY.CONTROLLER, meta, target);\n\t};\n}\n\nexport function getControllerMetadata(target: any): ControllerMetadata {\n\treturn (\n\t\tReflect.getMetadata(METADATA_KEY.CONTROLLER, target) ?? { prefix: \"/\" }\n\t);\n}\n\nexport function isController(target: any): boolean {\n\treturn Reflect.hasMetadata(METADATA_KEY.CONTROLLER, target);\n}\n\n/**\n * Normalize a prefix so we can safely concatenate it with handler paths.\n * - Empty string becomes '/'.\n * - Trailing slashes are trimmed (we re-add them on the join).\n * - No leading slash is added; the router always joins with `/`.\n */\nfunction normalizePrefix(prefix: string): string {\n\tif (!prefix) return \"\";\n\tif (prefix !== \"/\" && prefix.endsWith(\"/\")) {\n\t\treturn prefix.slice(0, -1);\n\t}\n\treturn prefix;\n}\n",
7
+ "/**\n * HTTP method decorators.\n *\n * `@Get`, `@Post`, `@Put`, `@Delete`, `@Patch`, `@Options`, `@Head` mark a\n * controller method as a route handler. The path argument is appended to\n * the controller's prefix.\n *\n * @example\n * ```ts\n * @Controller('/users')\n * class UserController {\n * @Get('/')\n * list() {}\n *\n * @Post('/')\n * create(@Body() body: CreateUserDto) {}\n * }\n * ```\n */\nimport \"reflect-metadata\";\nimport { HTTP_METHODS, METADATA_KEY, type HttpMethod } from \"../constants.js\";\nimport type { RouteMetadata } from \"../di/tokens.js\";\n\nfunction defineRoute(method: HttpMethod, path: string): MethodDecorator {\n\treturn (\n\t\ttarget: object,\n\t\tpropertyKey: string | symbol,\n\t\tdescriptor: PropertyDescriptor,\n\t) => {\n\t\tconst routes: RouteMetadata[] =\n\t\t\tReflect.getMetadata(METADATA_KEY.ROUTES, target.constructor) ?? [];\n\n\t\troutes.push({\n\t\t\tmethod,\n\t\t\tpath: normalizePath(path),\n\t\t\tpropertyKey,\n\t\t\thandler: descriptor.value,\n\t\t});\n\n\t\tReflect.defineMetadata(METADATA_KEY.ROUTES, routes, target.constructor);\n\t};\n}\n\nfunction normalizePath(path: string): string {\n\tif (!path || path === \"/\") return \"/\";\n\treturn path.startsWith(\"/\") ? path : `/${path}`;\n}\n\nexport const Get = (path: string = \"/\") => defineRoute(\"GET\", path);\nexport const Post = (path: string = \"/\") => defineRoute(\"POST\", path);\nexport const Put = (path: string = \"/\") => defineRoute(\"PUT\", path);\nexport const Delete = (path: string = \"/\") => defineRoute(\"DELETE\", path);\nexport const Patch = (path: string = \"/\") => defineRoute(\"PATCH\", path);\nexport const Options = (path: string = \"/\") => defineRoute(\"OPTIONS\", path);\nexport const Head = (path: string = \"/\") => defineRoute(\"HEAD\", path);\n\nexport function getRoutes(target: any): RouteMetadata[] {\n\treturn Reflect.getMetadata(METADATA_KEY.ROUTES, target) ?? [];\n}\n\nexport { HTTP_METHODS };\nexport type { RouteMetadata };\n",
8
+ "/**\n * Parameter decorators.\n *\n * These mark a controller method argument as a source of request data:\n * - `@Req()` → Hono context\n * - `@Res()` → Response helper\n * - `@Next()` → next() callback (for middleware-style handlers)\n * - `@Body()` → request body (parsed)\n * - `@Query('key')` → a single query param, or full query object\n * - `@Param('key')` → a single path param, or full params object\n * - `@Headers('k')` → a single header, or full headers object\n * - `@Ctx()` → Hono context (alias for @Req)\n * - `@User()` → authenticated user (resolved via auth provider)\n *\n * The metadata is read by the router at mount time to build the\n * handler invocation list.\n */\nimport \"reflect-metadata\";\nimport { METADATA_KEY, PARAM_TYPES } from \"../constants.js\";\nimport type { ParamMetadata } from \"../di/tokens.js\";\n\nexport function createParamDecorator(\n\ttype: number,\n\tdata?: string | object,\n): ParameterDecorator {\n\treturn (\n\t\ttarget: object,\n\t\tpropertyKey: string | symbol | undefined,\n\t\tparameterIndex: number,\n\t) => {\n\t\t// Method parameter: target is the prototype, propertyKey is the method name.\n\t\t// Constructor parameter: target is the class, propertyKey is undefined.\n\t\tif (propertyKey !== undefined) {\n\t\t\tconst params: ParamMetadata[] =\n\t\t\t\tReflect.getMetadata(METADATA_KEY.PARAMS, target, propertyKey) ?? [];\n\t\t\tparams.push({\n\t\t\t\tindex: parameterIndex,\n\t\t\t\ttype,\n\t\t\t\tname: typeof data === \"string\" ? data : undefined,\n\t\t\t\tdata: typeof data === \"object\" ? data : undefined,\n\t\t\t});\n\t\t\tReflect.defineMetadata(METADATA_KEY.PARAMS, params, target, propertyKey);\n\t\t} else {\n\t\t\tconst params: ParamMetadata[] =\n\t\t\t\tReflect.getMetadata(METADATA_KEY.PARAMS, target) ?? [];\n\t\t\tparams.push({\n\t\t\t\tindex: parameterIndex,\n\t\t\t\ttype,\n\t\t\t\tname: typeof data === \"string\" ? data : undefined,\n\t\t\t\tdata: typeof data === \"object\" ? data : undefined,\n\t\t\t});\n\t\t\tReflect.defineMetadata(METADATA_KEY.PARAMS, params, target);\n\t\t}\n\t};\n}\n\nexport const Req = () => createParamDecorator(PARAM_TYPES.REQUEST);\nexport const Res = () => createParamDecorator(PARAM_TYPES.RESPONSE);\nexport const Next = () => createParamDecorator(PARAM_TYPES.NEXT);\nexport const Body = (key?: string) =>\n\tcreateParamDecorator(PARAM_TYPES.BODY, key);\nexport const Query = (key?: string) =>\n\tcreateParamDecorator(PARAM_TYPES.QUERY, key);\nexport const Param = (key?: string) =>\n\tcreateParamDecorator(PARAM_TYPES.PARAM, key);\nexport const Headers = (key?: string) =>\n\tcreateParamDecorator(PARAM_TYPES.HEADERS, key);\nexport const Ctx = () => createParamDecorator(PARAM_TYPES.CTX);\nexport const User = () => createParamDecorator(PARAM_TYPES.USER);\n\nexport function getParamMetadata(\n\ttarget: any,\n\tpropertyKey: string | symbol,\n): ParamMetadata[] {\n\treturn Reflect.getMetadata(METADATA_KEY.PARAMS, target, propertyKey) ?? [];\n}\n\nexport { PARAM_TYPES };\n",
9
+ "/**\n * @Validate decorator.\n *\n * Attaches Zod schemas (or class validators) to a route handler. Each\n * schema is run against the corresponding request part before the handler\n * executes; failed validation throws or returns a 400 response.\n *\n * @example\n * ```ts\n * const UserSchema = z.object({ name: z.string(), email: z.email() });\n *\n * @Post('/')\n * @Validate({ body: UserSchema })\n * create(@Body() body: z.infer<typeof UserSchema>) { ... }\n * ```\n */\nimport \"reflect-metadata\";\nimport { METADATA_KEY } from \"../constants.js\";\nimport type { ValidationMetadata } from \"../di/tokens.js\";\n\nexport function Validate(options: ValidationMetadata): MethodDecorator {\n\treturn (\n\t\ttarget: object,\n\t\tpropertyKey: string | symbol,\n\t\tdescriptor: PropertyDescriptor,\n\t) => {\n\t\tReflect.defineMetadata(\n\t\t\tMETADATA_KEY.VALIDATE,\n\t\t\toptions,\n\t\t\ttarget.constructor,\n\t\t\tpropertyKey,\n\t\t);\n\t};\n}\n\nexport function getValidationMetadata(\n\ttarget: any,\n\tpropertyKey: string | symbol,\n): ValidationMetadata | undefined {\n\treturn Reflect.getMetadata(METADATA_KEY.VALIDATE, target, propertyKey);\n}\n",
10
+ "/**\n * `TracingService` — the framework's distributed-tracing primitive.\n *\n * Design:\n * 1. The OpenTelemetry API (`@opentelemetry/api`) is the only\n * required dependency; it's ~7kb and provides the no-op default\n * tracer when the SDK is not configured.\n * 2. The OTel SDK is **lazy-loaded**: only when the user calls\n * `TracingModule.forRoot(...)` is `@opentelemetry/sdk-node` and\n * the configured exporter imported. This keeps the bundle small\n * for users who don't trace.\n * 3. Without `forRoot()`, the service returns no-op spans. They have\n * valid `traceId` / `spanId` (the OTel no-op span id format) so\n * log lines and error reports don't need to special-case \"not\n * configured\".\n *\n * Public API:\n * - `startSpan(name, options?)` — create a new active span\n * - `withSpan(name, fn, options?)` — run `fn` inside a span, return its result\n * - `getCurrentTraceId()` / `getCurrentSpanId()` — read the active context\n * - `extractContext(headers)` / `injectContext(headers)` — W3C trace context\n * - `getSpans()` — read the in-memory span recorder (always available,\n * used for tests and for the `console` exporter)\n * - `reset()` — clear the in-memory recorder\n *\n * The service is registered in the DI container as a singleton. The\n * framework does **not** call `trace.getTracer` until something\n * actually starts a span.\n */\n\nimport {\n\tcontext as otelContext,\n\tpropagation,\n\tSpanStatusCode,\n\tSpanKind,\n\ttrace,\n\ttype Context,\n\ttype Span as OtelSpan,\n\ttype Tracer,\n} from \"@opentelemetry/api\";\nimport type {\n\tActiveSpan,\n\tFinishedSpan,\n\tSpanContext,\n\tSpanOptions,\n\tSpanStatus,\n} from \"./types.js\";\n\n/* ------------------------------------------------------------------ *\n * In-memory recorder\n * ------------------------------------------------------------------ */\n\nexport class InMemorySpanRecorder {\n\tprivate finished: FinishedSpan[] = [];\n\tprivate nextEventCounter = 0;\n\n\t/** Append a finished span. */\n\trecord(span: FinishedSpan): void {\n\t\tthis.finished.push(span);\n\t\tthis.nextEventCounter++;\n\t}\n\n\t/** Return all finished spans (most recent last). */\n\tgetAll(): FinishedSpan[] {\n\t\treturn this.finished;\n\t}\n\n\t/** Return only the spans whose `name` matches. */\n\tfindByName(name: string): FinishedSpan[] {\n\t\treturn this.finished.filter((s) => s.name === name);\n\t}\n\n\t/** Clear the recorder. */\n\tclear(): void {\n\t\tthis.finished = [];\n\t\tthis.nextEventCounter = 0;\n\t}\n\n\t/** Number of recorded spans. */\n\tget size(): number {\n\t\treturn this.finished.length;\n\t}\n}\n\n/* ------------------------------------------------------------------ *\n * ActiveSpan wrapper around OTel span\n * ------------------------------------------------------------------ */\n\nclass OtelActiveSpan implements ActiveSpan {\n\tconstructor(\n\t\tpublic readonly name: string,\n\t\tpublic readonly traceId: string,\n\t\tpublic readonly spanId: string,\n\t\tpublic readonly isRecording: boolean,\n\t\tprivate readonly otelSpan: OtelSpan,\n\t) {}\n\n\tsetAttribute(key: string, value: string | number | boolean): void {\n\t\tthis.otelSpan.setAttribute(key, value);\n\t}\n\n\tsetAttributes(attributes: Record<string, string | number | boolean>): void {\n\t\tthis.otelSpan.setAttributes(attributes);\n\t}\n\n\taddEvent(name: string, attributes?: Record<string, unknown>): void {\n\t\tthis.otelSpan.addEvent(name, attributes as never);\n\t}\n\n\trecordException(err: unknown): void {\n\t\tif (err instanceof Error) {\n\t\t\tthis.otelSpan.recordException(err);\n\t\t} else {\n\t\t\tthis.otelSpan.recordException(new Error(String(err)));\n\t\t}\n\t}\n\n\tsetStatus(status: \"ok\" | \"error\" | \"unset\", description?: string): void {\n\t\tconst code =\n\t\t\tstatus === \"ok\"\n\t\t\t\t? SpanStatusCode.OK\n\t\t\t\t: status === \"error\"\n\t\t\t\t\t? SpanStatusCode.ERROR\n\t\t\t\t\t: SpanStatusCode.UNSET;\n\t\tthis.otelSpan.setStatus({ code, message: description });\n\t}\n\n\tend(): void {\n\t\tthis.otelSpan.end();\n\t}\n}\n\n/* ------------------------------------------------------------------ *\n * TracingService\n * ------------------------------------------------------------------ */\n\nexport const TRACING_SERVICE_TOKEN = Symbol.for(\"nexus:TracingService\");\n\n/**\n * Global registry of the active `TracingService` instance.\n * The framework's `TracingModule.forRoot()` calls `setTracingService()`.\n * Decorators that need a `TracingService` (e.g. `@Trace()`) call\n * `getTracingService()` to look it up without DI plumbing.\n */\nlet _current: TracingService | undefined;\n\nexport function setTracingService(service: TracingService): void {\n\t_current = service;\n}\n\nexport function getTracingService(): TracingService | undefined {\n\treturn _current;\n}\n\nexport class TracingService {\n\treadonly tracer: Tracer;\n\tprivate readonly recorder = new InMemorySpanRecorder();\n\tprivate sdkStop?: () => Promise<void>;\n\tprivate initialized = false;\n\n\tconstructor() {\n\t\t// Default OTel tracer: \"nexusjs\". Even with no SDK, this returns\n\t\t// a no-op tracer that produces no-op spans — never throws.\n\t\tthis.tracer = trace.getTracer(\"nexusjs\", \"0.4.0\");\n\t}\n\n\t/** True if the SDK has been started (i.e. `forRoot()` was called). */\n\tget isInitialized(): boolean {\n\t\treturn this.initialized;\n\t}\n\n\t/** Read all finished spans recorded so far. */\n\tgetSpans(): FinishedSpan[] {\n\t\treturn this.recorder.getAll();\n\t}\n\n\t/** Find spans by name. */\n\tfindSpans(name: string): FinishedSpan[] {\n\t\treturn this.recorder.findByName(name);\n\t}\n\n\t/** Clear the in-memory recorder (and the SDK's batch, if any). */\n\tclearSpans(): void {\n\t\tthis.recorder.clear();\n\t}\n\n\t/* ---------------- span lifecycle ---------------- */\n\n\tstartSpan(name: string, options: SpanOptions = {}): ActiveSpan {\n\t\tconst kind = toOtelKind(options.kind ?? \"internal\");\n\t\tconst otelSpan = this.tracer.startSpan(name, {\n\t\t\tkind,\n\t\t\tattributes: options.attributes as never,\n\t\t\tstartTime: options.startTime,\n\t\t});\n\n\t\tconst ctx = otelSpan.spanContext();\n\t\treturn new OtelActiveSpan(\n\t\t\tname,\n\t\t\tctx.traceId,\n\t\t\tctx.spanId,\n\t\t\totelSpan.isRecording(),\n\t\t\totelSpan,\n\t\t);\n\t}\n\n\t/** Run `fn` inside a new span. Returns the result of `fn`. */\n\tasync withSpan<T>(\n\t\tname: string,\n\t\tfn: (span: ActiveSpan) => Promise<T> | T,\n\t\toptions: SpanOptions = {},\n\t): Promise<T> {\n\t\tconst span = this.startSpan(name, options);\n\t\tconst ctx = trace.setSpan(otelContext.active(), (span as OtelActiveSpan)[\"otelSpan\"] as OtelSpan);\n\t\ttry {\n\t\t\tconst result = await otelContext.with(ctx, () => fn(span));\n\t\t\tif (span.isRecording) span.setStatus(\"ok\");\n\t\t\treturn result;\n\t\t} catch (err) {\n\t\t\tif (span.isRecording) {\n\t\t\t\tspan.recordException(err);\n\t\t\t\tspan.setStatus(\"error\", err instanceof Error ? err.message : String(err));\n\t\t\t}\n\t\t\tthrow err;\n\t\t} finally {\n\t\t\tspan.end();\n\t\t}\n\t}\n\n\t/** Synchronous version of `withSpan`. */\n\twithSpanSync<T>(name: string, fn: (span: ActiveSpan) => T, options: SpanOptions = {}): T {\n\t\tconst span = this.startSpan(name, options);\n\t\ttry {\n\t\t\tconst result = fn(span);\n\t\t\tif (span.isRecording) span.setStatus(\"ok\");\n\t\t\treturn result;\n\t\t} catch (err) {\n\t\t\tif (span.isRecording) {\n\t\t\t\tspan.recordException(err);\n\t\t\t\tspan.setStatus(\"error\", err instanceof Error ? err.message : String(err));\n\t\t\t}\n\t\t\tthrow err;\n\t\t} finally {\n\t\t\tspan.end();\n\t\t}\n\t}\n\n\t/* ---------------- context propagation ---------------- */\n\n\t/** Get the trace id of the active span, or `undefined`. */\n\tgetCurrentTraceId(): string | undefined {\n\t\tconst ctx = trace.getSpan(otelContext.active())?.spanContext();\n\t\treturn ctx?.traceId;\n\t}\n\n\t/** Get the span id of the active span, or `undefined`. */\n\tgetCurrentSpanId(): string | undefined {\n\t\tconst ctx = trace.getSpan(otelContext.active())?.spanContext();\n\t\treturn ctx?.spanId;\n\t}\n\n\t/** Get the current OTel `Context`. */\n\tgetCurrentContext(): Context {\n\t\treturn otelContext.active();\n\t}\n\n\t/**\n\t * Extract a span context from incoming HTTP headers.\n\t * Reads `traceparent` (W3C) and `x-b3-*` (B3 single) when present.\n\t * Returns `undefined` if no recognizable header is found.\n\t */\n\textractContext(headers: Record<string, string | string[] | undefined>): Context {\n\t\tconst flat = flattenHeaders(headers);\n\t\treturn propagation.extract(otelContext.active(), flat);\n\t}\n\n\t/**\n\t * Inject the active span context into outgoing HTTP headers.\n\t * Writes `traceparent` (W3C) by default.\n\t */\n\tinjectContext(headers: Record<string, string> = {}): Record<string, string> {\n\t\tconst out: Record<string, string> = { ...headers };\n\t\tpropagation.inject(otelContext.active(), out);\n\t\treturn out;\n\t}\n\n\t/* ---------------- SDK bootstrap (called by module) ---------------- */\n\n\t/**\n\t * Initialize the OpenTelemetry SDK with the given configuration.\n\t * This is called by `TracingModule.forRoot()`. It's idempotent.\n\t */\n\tasync startSdk(config: import(\"./types.js\").TracingConfig): Promise<void> {\n\t\tif (this.initialized) return;\n\n\t\tconst serviceName = config.serviceName ?? process.env.OTEL_SERVICE_NAME ?? \"nexusjs\";\n\t\tconst endpoint = config.endpoint ?? process.env.OTEL_EXPORTER_OTLP_ENDPOINT ?? \"http://localhost:4318\";\n\t\tconst sampleRatio = config.sampleRatio ?? 1.0;\n\n\t\t// Lazy import the SDK so apps that don't use tracing don't pay the cost.\n\t\t// The SDK packages are optional peer dependencies; we resolve them\n\t\t// dynamically so users who don't trace don't need them.\n\t\tlet NodeSDK: any, OTLPTraceExporter: any, Resource: any, SemanticResourceAttributes: any;\n\t\ttry {\n\t\t\t// @ts-ignore - optional peer dep\n\t\t\t({ NodeSDK } = await import(\"@opentelemetry/sdk-node\"));\n\t\t\t// @ts-ignore - optional peer dep\n\t\t\t({ OTLPTraceExporter } = await import(\"@opentelemetry/exporter-trace-otlp-http\"));\n\t\t\t// @ts-ignore - optional peer dep\n\t\t\t({ Resource } = await import(\"@opentelemetry/resources\"));\n\t\t\tconst semconv = await import(\"@opentelemetry/semantic-conventions\");\n\t\t\tSemanticResourceAttributes = (semconv as any).SemanticResourceAttributes ?? semconv;\n\t\t} catch (err) {\n\t\t\tthrow new Error(\n\t\t\t\t\"TracingModule.forRoot() requires the OTel SDK packages. \" +\n\t\t\t\t\t\"Install with: bun add @opentelemetry/sdk-node @opentelemetry/exporter-trace-otlp-http @opentelemetry/resources @opentelemetry/semantic-conventions\",\n\t\t\t);\n\t\t}\n\n\t\t// Build the resource\n\t\tconst resourceAttrs: Record<string, string> = {\n\t\t\t[SemanticResourceAttributes.SERVICE_NAME ?? \"service.name\"]: serviceName,\n\t\t\t[SemanticResourceAttributes.SERVICE_VERSION ?? \"service.version\"]:\n\t\t\t\tconfig.serviceVersion ?? \"0.0.0\",\n\t\t\t[SemanticResourceAttributes.DEPLOYMENT_ENVIRONMENT ?? \"deployment.environment\"]:\n\t\t\t\tconfig.environment ?? process.env.NODE_ENV ?? \"development\",\n\t\t\t...config.resourceAttributes,\n\t\t};\n\t\tconst resource = new Resource(resourceAttrs);\n\n\t\t// Pick the exporter\n\t\tlet traceExporter: any;\n\t\tif (config.exporter === \"console\" || config.exporter === \"memory\" || !config.exporter) {\n\t\t\t// Console exporter: print to stdout. (Bun has no in-process\n\t\t\t// console exporter, so we use a simple OTel-compatible one\n\t\t\t// via the in-memory recorder.)\n\t\t\ttraceExporter = undefined; // We use the recorder for the in-memory case\n\t\t} else {\n\t\t\ttraceExporter = new OTLPTraceExporter({ url: `${endpoint.replace(/\\/$/, \"\")}/v1/traces` });\n\t\t}\n\n\t\t// Build the SDK\n\t\tconst sdk = new NodeSDK({\n\t\t\tresource,\n\t\t\ttraceExporter,\n\t\t\tsampler: {\n\t\t\t\t// Custom simple ratio sampler to avoid pulling the full sampler package.\n\t\t\t\tshouldSample: () => ({\n\t\t\t\t\tdecision: Math.random() < sampleRatio ? 1 : 0,\n\t\t\t\t}),\n\t\t\t\ttoString: () => `RatioSampler(${sampleRatio})`,\n\t\t\t},\n\t\t});\n\t\tsdk.start();\n\n\t\tthis.sdkStop = async () => {\n\t\t\ttry {\n\t\t\t\tawait sdk.shutdown();\n\t\t\t} catch {\n\t\t\t\t/* ignore shutdown errors */\n\t\t\t}\n\t\t};\n\n\t\tthis.initialized = true;\n\t}\n\n\t/** Stop the SDK. Called on process exit / app shutdown. */\n\tasync stopSdk(): Promise<void> {\n\t\tif (this.sdkStop) {\n\t\t\tawait this.sdkStop();\n\t\t\tthis.sdkStop = undefined;\n\t\t}\n\t\tthis.initialized = false;\n\t}\n}\n\n/* ------------------------------------------------------------------ *\n * Helpers\n * ------------------------------------------------------------------ */\n\nfunction toOtelKind(kind: NonNullable<SpanOptions[\"kind\"]>): SpanKind {\n\tswitch (kind) {\n\t\tcase \"server\":\n\t\t\treturn SpanKind.SERVER;\n\t\tcase \"client\":\n\t\t\treturn SpanKind.CLIENT;\n\t\tcase \"producer\":\n\t\t\treturn SpanKind.PRODUCER;\n\t\tcase \"consumer\":\n\t\t\treturn SpanKind.CONSUMER;\n\t\tdefault:\n\t\t\treturn SpanKind.INTERNAL;\n\t}\n}\n\nfunction flattenHeaders(\n\theaders: Record<string, string | string[] | undefined>,\n): Record<string, string> {\n\tconst out: Record<string, string> = {};\n\tfor (const [k, v] of Object.entries(headers)) {\n\t\tif (v === undefined) continue;\n\t\tout[k.toLowerCase()] = Array.isArray(v) ? v.join(\",\") : v;\n\t}\n\treturn out;\n}\n\n/** Re-export for downstream type users. */\nexport type { SpanContext, SpanStatus };\n",
11
+ "/**\n * @Module decorator.\n *\n * Marks a class as a Nest-style module: a logical grouping of\n * controllers and providers with explicit imports/exports.\n *\n * @example\n * ```ts\n * @Module({\n * imports: [UserModule],\n * controllers: [UserController],\n * providers: [UserService],\n * exports: [UserService],\n * })\n * class AppModule {}\n * ```\n */\nimport \"reflect-metadata\";\nimport { METADATA_KEY } from \"../constants.js\";\nimport type { ModuleOptions, Type } from \"../di/tokens.js\";\n\nexport function Module(options: ModuleOptions = {}): ClassDecorator {\n\treturn (target: object) => {\n\t\tReflect.defineMetadata(METADATA_KEY.MODULE, options, target);\n\t};\n}\n\n/** Read the @Module options from a class. */\nexport function getModuleOptions(target: Type<any>): ModuleOptions {\n\treturn Reflect.getMetadata(METADATA_KEY.MODULE, target) ?? {};\n}\n",
12
+ "/**\n * Convenience barrel for all decorators.\n */\nexport * from \"./module.js\";\nexport * from \"./controller.js\";\nexport * from \"./injectable.js\";\nexport * from \"./http-methods.js\";\nexport * from \"./params.js\";\nexport * from \"./validate.js\";\nexport * from \"./repository.js\";\nexport * from \"./metadata.js\";\n",
13
+ "/**\n * @Injectable decorator.\n *\n * Marks a class as available for DI. The container uses reflect-metadata's\n * `design:paramtypes` to read constructor parameter types and resolve them\n * automatically.\n *\n * @example\n * ```ts\n * @Injectable()\n * class UserService {\n * constructor(private repo: UserRepository) {}\n * }\n *\n * @Injectable({ scope: 'request' })\n * class RequestContext {\n * constructor(@Inject(REQUEST) private req: any) {}\n * }\n * ```\n */\nimport \"reflect-metadata\";\nimport { METADATA_KEY } from \"../constants.js\";\n\nexport interface InjectableOptions {\n\tscope?: \"singleton\" | \"request\" | \"transient\";\n}\n\nexport function Injectable(options: InjectableOptions = {}): ClassDecorator {\n\treturn (target: object) => {\n\t\tReflect.defineMetadata(METADATA_KEY.INJECTABLE, true, target);\n\t\tif (options.scope) {\n\t\t\tReflect.defineMetadata(\n\t\t\t\t\"nexus:di:scope\",\n\t\t\t\toptions.scope,\n\t\t\t\ttarget,\n\t\t\t);\n\t\t}\n\t};\n}\n\nexport function isInjectable(target: any): boolean {\n\treturn Reflect.hasMetadata(METADATA_KEY.INJECTABLE, target);\n}\n\n/**\n * Read the scope declared on a class via `@Injectable({ scope })`.\n * Returns undefined when no scope is declared (defaults to singleton).\n */\nexport function getScope(\n\ttarget: any,\n): \"singleton\" | \"request\" | \"transient\" | undefined {\n\treturn Reflect.getMetadata(\"nexus:di:scope\", target);\n}\n\n/**\n * Mark a parameter as resolved by a specific token instead of its declared\n * type. Useful for interfaces, abstract classes, or string tokens.\n *\n * @example\n * ```ts\n * constructor(@Inject('CONFIG') private config: AppConfig) {}\n * ```\n */\nexport function Inject<T = any>(token: any): ParameterDecorator {\n\treturn (\n\t\ttarget: object,\n\t\tpropertyKey: string | symbol | undefined,\n\t\tparameterIndex: number,\n\t) => {\n\t\tconst existing: Map<number, any> =\n\t\t\tReflect.getMetadata(METADATA_KEY.INJECT, target) ?? new Map();\n\t\texisting.set(parameterIndex, token);\n\t\tReflect.defineMetadata(METADATA_KEY.INJECT, existing, target);\n\t};\n}",
14
+ "/**\n * @Repository decorator.\n *\n * Marks a class as a Spring-style repository. Repositories are normal\n * `@Injectable()` classes; the decorator is a marker so the framework\n * can register them with a database adapter (Drizzle/Prisma) and emit\n * a friendly error if you forget to wire one.\n *\n * @example\n * ```ts\n * @Repository()\n * class UserRepository {\n * findAll() { return db.select().from(users); }\n * }\n * ```\n */\nimport \"reflect-metadata\";\nimport { METADATA_KEY } from \"../constants.js\";\nimport type { InjectionToken } from \"../di/tokens.js\";\n\nexport function Repository(entityToken?: InjectionToken<any>): ClassDecorator {\n\treturn (target: object) => {\n\t\tReflect.defineMetadata(\n\t\t\tMETADATA_KEY.REPOSITORY,\n\t\t\t{ entity: entityToken },\n\t\t\ttarget,\n\t\t);\n\t\tReflect.defineMetadata(METADATA_KEY.INJECTABLE, true, target);\n\t};\n}\n\nexport function getRepositoryMetadata(\n\ttarget: any,\n): { entity?: InjectionToken<any> } | undefined {\n\treturn Reflect.getMetadata(METADATA_KEY.REPOSITORY, target);\n}\n\nexport function isRepository(target: any): boolean {\n\treturn Reflect.hasMetadata(METADATA_KEY.REPOSITORY, target);\n}\n",
15
+ "/**\n * Reflect-metadata helper. Centralizes the keys the framework uses so\n * decorator files stay clean.\n */\nexport { METADATA_KEY, PARAM_TYPES, HTTP_METHODS } from \"../constants.js\";\nexport type { MetadataKey, ParamType, HttpMethod } from \"../constants.js\";\n",
16
+ "/**\n * Hono auto-instrumentation for `nexusjs/tracing`.\n *\n * Returns a Hono middleware that:\n * 1. Extracts the incoming trace context (W3C `traceparent`).\n * 2. Starts a `SERVER` span with HTTP method, route, target, etc.\n * 3. Records the response status, body size, and any thrown error.\n *\n * The middleware is a no-op when the SDK is not configured: the\n * OTel API returns a no-op span that immediately ends, but the\n * `traceparent` is still parsed for the response.\n */\n\nimport { SpanKind, SpanStatusCode, trace, type Context } from \"@opentelemetry/api\";\nimport type { MiddlewareHandler } from \"hono\";\nimport type { TracingService } from \"./service.js\";\n\nexport function tracingMiddleware(service: TracingService): MiddlewareHandler {\n\treturn async (c, next) => {\n\t\tconst incoming = c.req.raw.headers;\n\t\tconst flat: Record<string, string> = {};\n\t\tincoming.forEach((v, k) => (flat[k] = v));\n\t\tconst extractedCtx: Context = service.extractContext(flat);\n\n\t\tconst method = c.req.method;\n\t\tconst path = c.req.path;\n\t\tconst route = c.req.routePath ?? path;\n\t\tconst userAgent = c.req.header(\"user-agent\") ?? \"\";\n\t\tconst url = new URL(c.req.url);\n\t\tconst clientIp = c.req.header(\"x-forwarded-for\") ?? c.req.header(\"x-real-ip\") ?? \"\";\n\n\t\tconst span = service.tracer.startSpan(\n\t\t\t`HTTP ${method} ${route}`,\n\t\t\t{\n\t\t\t\tkind: SpanKind.SERVER,\n\t\t\t\tattributes: {\n\t\t\t\t\t\"http.method\": method,\n\t\t\t\t\t\"http.target\": path,\n\t\t\t\t\t\"http.route\": route,\n\t\t\t\t\t\"http.scheme\": url.protocol.replace(\":\", \"\"),\n\t\t\t\t\t\"http.host\": url.host,\n\t\t\t\t\t\"http.user_agent\": userAgent,\n\t\t\t\t\t\"http.client_ip\": clientIp,\n\t\t\t\t\t\"url.path\": path,\n\t\t\t\t},\n\t\t\t},\n\t\t\textractedCtx,\n\t\t);\n\n\t\tconst ctxWithSpan = trace.setSpan(extractedCtx, span);\n\t\tconst result = await service.tracer.startActiveSpan(\n\t\t\t`HTTP ${method} ${route} handler`,\n\t\t\t{ kind: SpanKind.SERVER },\n\t\t\tctxWithSpan,\n\t\t\tasync () => {\n\t\t\t\ttry {\n\t\t\t\t\tawait next();\n\t\t\t\t\tconst status = c.res.status;\n\t\t\t\t\tspan.setAttribute(\"http.status_code\", status);\n\t\t\t\t\tif (status >= 500) {\n\t\t\t\t\t\tspan.setStatus({ code: SpanStatusCode.ERROR });\n\t\t\t\t\t} else {\n\t\t\t\t\t\tspan.setStatus({ code: SpanStatusCode.OK });\n\t\t\t\t\t}\n\t\t\t\t} catch (err) {\n\t\t\t\t\tspan.recordException(err as Error);\n\t\t\t\t\tspan.setStatus({ code: SpanStatusCode.ERROR, message: (err as Error).message });\n\t\t\t\t\tspan.setAttribute(\"http.status_code\", 500);\n\t\t\t\t\tthrow err;\n\t\t\t\t} finally {\n\t\t\t\t\tspan.end();\n\t\t\t\t}\n\t\t\t},\n\t\t);\n\t\treturn result as never;\n\t};\n}\n\n/**\n * Inject the active trace context into an outgoing fetch / response.\n * Use in fetch() calls so downstream services pick up the trace.\n */\nexport function injectOutgoingTraceparent(\n\tservice: TracingService,\n\theaders: Record<string, string> = {},\n): Record<string, string> {\n\treturn service.injectContext(headers);\n}\n",
17
+ "/**\n * `TracingModule` — wires up `TracingService` into the DI container\n * and (optionally) installs the Hono auto-instrumentation middleware.\n *\n * Usage:\n * @Module({\n * imports: [TracingModule.forRoot({\n * serviceName: \"my-app\",\n * exporter: \"otlp-http\",\n * endpoint: \"http://otel-collector:4318\",\n * sampleRatio: 0.1,\n * })],\n * })\n * class AppModule {}\n *\n * When `forRoot()` is called:\n * 1. The OTel SDK is started (lazy `import()` of the SDK packages).\n * 2. The Hono `tracingMiddleware` is installed in the framework's\n * HTTP server (when `enableHttpInstrumentation !== false`).\n * 3. The `TracingService` becomes the active global service that\n * `@Trace()` decorators read from.\n *\n * When `forRoot()` is **not** called, `nexusjs/tracing` is a no-op:\n * - `TracingService` instances use OTel's default no-op tracer.\n * - `@Trace()` returns the original method unchanged.\n * - No SDK packages are loaded.\n */\n\nimport { Inject, Injectable, Module } from \"../core/decorators/index.js\";\nimport type { MiddlewareHandler } from \"hono\";\nimport { TracingService, TRACING_SERVICE_TOKEN, setTracingService } from \"./service.js\";\nimport { tracingMiddleware } from \"./hono-instrumentation.js\";\nimport type { TracingConfig } from \"./types.js\";\n\nexport const TRACING_CONFIG_TOKEN = Symbol.for(\"nexus:TracingConfig\");\n\n@Injectable()\nexport class TracingConfigHolder {\n\tconstructor(@Inject(TRACING_CONFIG_TOKEN) public readonly config: Required<TracingConfig>) {}\n}\n\n@Injectable()\nexport class TracingServiceWithLifecycle extends TracingService {\n\tasync onApplicationBootstrap(): Promise<void> {\n\t\t// Will be set in the module factory; no-op here.\n\t}\n\n\tasync onApplicationShutdown(): Promise<void> {\n\t\tawait this.stopSdk();\n\t}\n}\n\n@Module({\n\tproviders: [\n\t\tTracingServiceWithLifecycle,\n\t\t{ provide: TRACING_SERVICE_TOKEN, useExisting: TracingServiceWithLifecycle },\n\t],\n\texports: [TracingServiceWithLifecycle, TRACING_SERVICE_TOKEN],\n})\nexport class TracingModule {\n\tstatic forRoot(config: TracingConfig = {}) {\n\t\tconst fullConfig: Required<TracingConfig> = {\n\t\t\tserviceName: config.serviceName ?? process.env.OTEL_SERVICE_NAME ?? \"nexusjs\",\n\t\t\tserviceVersion: config.serviceVersion ?? \"0.0.0\",\n\t\t\tenvironment: config.environment ?? process.env.NODE_ENV ?? \"development\",\n\t\t\texporter: config.exporter ?? \"otlp-http\",\n\t\t\tendpoint: config.endpoint ?? process.env.OTEL_EXPORTER_OTLP_ENDPOINT ?? \"http://localhost:4318\",\n\t\t\tsampleRatio: config.sampleRatio ?? 1.0,\n\t\t\tenableHttpInstrumentation: config.enableHttpInstrumentation ?? true,\n\t\t\tenableDbInstrumentation: config.enableDbInstrumentation ?? true,\n\t\t\tresourceAttributes: config.resourceAttributes ?? {},\n\t\t\tthrowOnError: config.throwOnError ?? false,\n\t\t};\n\n\t\t@Module({\n\t\t\tproviders: [\n\t\t\t\tTracingServiceWithLifecycle,\n\t\t\t\t{ provide: TRACING_CONFIG_TOKEN, useValue: fullConfig },\n\t\t\t\t{ provide: TRACING_SERVICE_TOKEN, useExisting: TracingServiceWithLifecycle },\n\t\t\t],\n\t\t\texports: [TracingServiceWithLifecycle, TRACING_CONFIG_TOKEN, TRACING_SERVICE_TOKEN],\n\t\t})\n\t\tclass ConfiguredTracingModule {\n\t\t\tconstructor(@Inject(TracingServiceWithLifecycle) private svc: TracingServiceWithLifecycle) {\n\t\t\t\t// Side-effect: start the SDK & register the global.\n\t\t\t\tvoid svc.startSdk(fullConfig);\n\t\t\t\tsetTracingService(svc);\n\t\t\t}\n\t\t}\n\t\tObject.defineProperty(ConfiguredTracingModule, \"name\", { value: \"ConfiguredTracingModule\" });\n\n\t\t// Return both the module class and a helper for installing the\n\t\t// Hono middleware (for users who want to use `nexusjs/tracing` with\n\t\t// a custom Hono app, not the framework's HTTP server).\n\t\tconst mod = ConfiguredTracingModule as unknown as Function & {\n\t\t\tmiddleware: () => MiddlewareHandler;\n\t\t};\n\t\tmod.middleware = () => {\n\t\t\tconst svc = new TracingService();\n\t\t\tsetTracingService(svc);\n\t\t\treturn tracingMiddleware(svc);\n\t\t};\n\n\t\treturn mod;\n\t}\n}\n",
18
+ "/**\n * W3C Trace Context propagation.\n *\n * The OTel API ships a default W3C propagator, so most use cases\n * don't need anything here. This file provides:\n * 1. Constants for header names.\n * 2. Helpers to format / parse a `traceparent` value.\n * 3. A simple B3 single-header propagator for legacy systems.\n *\n * Format reference: https://www.w3.org/TR/trace-context/#traceparent-header\n */\n\nimport { propagation, context, type Context } from \"@opentelemetry/api\";\n\n/* ------------------------------------------------------------------ *\n * Header constants\n * ------------------------------------------------------------------ */\n\nexport const TRACE_PARENT_HEADER = \"traceparent\";\nexport const TRACE_STATE_HEADER = \"tracestate\";\nexport const B3_TRACE_ID_HEADER = \"x-b3-traceid\";\nexport const B3_SPAN_ID_HEADER = \"x-b3-spanid\";\nexport const B3_SAMPLED_HEADER = \"x-b3-sampled\";\n\n/* ------------------------------------------------------------------ *\n * traceparent parser\n * ------------------------------------------------------------------ */\n\nexport interface ParsedTraceParent {\n\t/** \"00\" (version 0) for now. */\n\tversion: string;\n\t/** Full trace id (32 hex chars). */\n\ttraceId: string;\n\t/** Parent span id (16 hex chars). */\n\tparentSpanId: string;\n\t/** Trace flags byte, hex. */\n\tflags: string;\n\t/** True if the trace is sampled (flags bit 0 set). */\n\tsampled: boolean;\n}\n\n/**\n * Parse a `traceparent` header value.\n * Returns `undefined` if the value is malformed.\n */\nexport function parseTraceParent(value: string | undefined | null): ParsedTraceParent | undefined {\n\tif (!value) return undefined;\n\tconst parts = value.trim().split(\"-\");\n\tif (parts.length !== 4) return undefined;\n\tconst [version, traceId, parentSpanId, flags] = parts;\n\tif (!/^[0-9a-f]{2}$/i.test(version)) return undefined;\n\tif (!/^[0-9a-f]{32}$/i.test(traceId)) return undefined;\n\tif (traceId === \"0\".repeat(32)) return undefined;\n\tif (!/^[0-9a-f]{16}$/i.test(parentSpanId)) return undefined;\n\tif (parentSpanId === \"0\".repeat(16)) return undefined;\n\tif (!/^[0-9a-f]{2}$/i.test(flags)) return undefined;\n\treturn {\n\t\tversion,\n\t\ttraceId: traceId.toLowerCase(),\n\t\tparentSpanId: parentSpanId.toLowerCase(),\n\t\tflags: flags.toLowerCase(),\n\t\tsampled: (parseInt(flags, 16) & 0x01) === 0x01,\n\t};\n}\n\n/**\n * Format a `traceparent` value from a known context.\n * `00-<traceId>-<spanId>-<flags>`\n */\nexport function formatTraceParent(traceId: string, spanId: string, sampled = true): string {\n\tconst flags = sampled ? \"01\" : \"00\";\n\treturn `00-${traceId.toLowerCase()}-${spanId.toLowerCase()}-${flags}`;\n}\n\n/* ------------------------------------------------------------------ *\n * B3 single-header helpers (legacy Zipkin)\n * ------------------------------------------------------------------ */\n\n/**\n * Extract context from a B3 single-header (`b3: <traceId>-<spanId>-1`).\n * Falls through to W3C if no B3 header is present.\n */\nexport function extractB3Context(\n\theaders: Record<string, string>,\n): { traceId: string; spanId: string; sampled: boolean } | undefined {\n\tconst b3 = headers[\"b3\"] ?? headers[\"x-b3-traceid\"];\n\tif (!b3) return undefined;\n\tif (b3.includes(\"-\")) {\n\t\t// b3 single header: \"traceId-spanId-sampled-parentSpanId\"\n\t\tconst [traceId, spanId, sampled] = b3.split(\"-\");\n\t\tif (traceId && spanId) {\n\t\t\treturn { traceId, spanId, sampled: sampled === \"1\" };\n\t\t}\n\t} else {\n\t\t// x-b3-traceid + x-b3-spanid pair\n\t\tconst spanId = headers[\"x-b3-spanid\"];\n\t\tconst sampled = headers[\"x-b3-sampled\"] === \"1\";\n\t\tif (spanId) return { traceId: b3, spanId, sampled };\n\t}\n\treturn undefined;\n}\n\n/* ------------------------------------------------------------------ *\n * Re-export OTel's propagation API\n * ------------------------------------------------------------------ */\n\n/** Inject the active context into the given carrier. */\nexport function inject(headers: Record<string, string>): Record<string, string> {\n\tconst out: Record<string, string> = { ...headers };\n\tpropagation.inject(context.active(), out);\n\treturn out;\n}\n\n/** Extract a context from a header carrier. */\nexport function extract(headers: Record<string, string>): Context {\n\treturn propagation.extract(context.active(), headers);\n}\n",
19
+ "/**\n * `@Trace()` — class-method decorator that wraps the call in a span.\n *\n * Usage:\n * class UserService {\n * @Trace() // span name = class.method\n * async findById(id: string) { ... }\n *\n * @Trace(\"user.lookup\") // explicit span name\n * async lookup(name: string) { ... }\n *\n * @Trace({ name: \"user.cache.get\", attributes: { cache: \"lru\" } })\n * async getFromCache(key: string) { ... }\n * }\n *\n * The decorator reads the `TracingService` from the global registry\n * (set by `TracingModule.forRoot()`). When no service is registered\n * the decorator is a pass-through.\n *\n * Sync methods stay sync; async methods stay async. The decorator\n * detects `AsyncFunction` and uses `withSpan` / `withSpanSync` accordingly.\n */\n\nimport type { ActiveSpan, SpanOptions } from \"../types.js\";\nimport { getTracingService } from \"../service.js\";\n\nexport type TraceOptions =\n\t| string\n\t| undefined\n\t| (SpanOptions & { name: string });\n\nconst TRACE_KEY = Symbol.for(\"nexus:trace:options\");\n\n/**\n * Method decorator: wrap a call in a span.\n *\n * The decorator works on both async and sync methods. The wrapped\n * function preserves `this` so decorators on classes still see the\n * right instance.\n */\nexport function Trace(opts?: TraceOptions) {\n\treturn function (target: object, propertyKey: string | symbol, descriptor: PropertyDescriptor) {\n\t\tconst original = descriptor.value as (...args: unknown[]) => unknown;\n\t\tif (typeof original !== \"function\") {\n\t\t\tthrow new Error(`@Trace() can only be applied to methods, got ${typeof original}`);\n\t\t}\n\n\t\tconst options = normalizeOptions(opts ?? {}, target, propertyKey);\n\t\t(target as any)[TRACE_KEY] = (target as any)[TRACE_KEY] ?? {};\n\t\t(target as any)[TRACE_KEY][String(propertyKey)] = options;\n\n\t\tconst isAsync = (original as any).constructor?.name === \"AsyncFunction\";\n\n\t\tif (isAsync) {\n\t\t\tdescriptor.value = async function wrapped(this: unknown, ...args: unknown[]) {\n\t\t\t\tconst service = getTracingService();\n\t\t\t\tif (!service) return original.apply(this, args);\n\t\t\t\treturn service.withSpan(\n\t\t\t\t\toptions.name,\n\t\t\t\t\tasync (span: ActiveSpan) => {\n\t\t\t\t\t\tif (options.attributes) span.setAttributes(options.attributes!);\n\t\t\t\t\t\treturn original.apply(this, args);\n\t\t\t\t\t},\n\t\t\t\t\t{ kind: options.kind ?? \"internal\", attributes: options.attributes },\n\t\t\t\t);\n\t\t\t};\n\t\t} else {\n\t\t\tdescriptor.value = function wrapped(this: unknown, ...args: unknown[]) {\n\t\t\t\tconst service = getTracingService();\n\t\t\t\tif (!service) return original.apply(this, args);\n\t\t\t\treturn service.withSpanSync(\n\t\t\t\t\toptions.name,\n\t\t\t\t\t(span: ActiveSpan) => {\n\t\t\t\t\t\tif (options.attributes) span.setAttributes(options.attributes!);\n\t\t\t\t\t\treturn original.apply(this, args);\n\t\t\t\t\t},\n\t\t\t\t\t{ kind: options.kind ?? \"internal\", attributes: options.attributes },\n\t\t\t\t);\n\t\t\t};\n\t\t}\n\t\treturn descriptor;\n\t};\n}\n\n/** Read the @Trace options for a given method (used by OpenAPI integration). */\nexport function getTraceOptions(target: object, method: string): TraceOptions | undefined {\n\treturn (target as any)[TRACE_KEY]?.[method];\n}\n\nfunction normalizeOptions(\n\topts: TraceOptions | object,\n\ttarget: object,\n\tpropertyKey: string | symbol,\n): { name: string; kind: NonNullable<SpanOptions[\"kind\"]>; attributes?: SpanOptions[\"attributes\"] } {\n\tif (typeof opts === \"string\") {\n\t\treturn { name: opts, kind: \"internal\" };\n\t}\n\tif (opts && typeof opts === \"object\" && \"name\" in opts && (opts as any).name) {\n\t\tconst o = opts as { name: string; kind?: SpanOptions[\"kind\"]; attributes?: SpanOptions[\"attributes\"] };\n\t\treturn {\n\t\t\tname: o.name,\n\t\t\tkind: o.kind ?? \"internal\",\n\t\t\tattributes: o.attributes,\n\t\t};\n\t}\n\t// Default: use \"ClassName.methodName\"\n\tconst cls = (target as any)?.constructor?.name ?? \"Anonymous\";\n\treturn {\n\t\tname: `${cls}.${String(propertyKey)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+ * `TracingModule` — wires up `TracingService` into the DI container
3
+ * and (optionally) installs the Hono auto-instrumentation middleware.
4
+ *
5
+ * Usage:
6
+ * @Module({
7
+ * imports: [TracingModule.forRoot({
8
+ * serviceName: "my-app",
9
+ * exporter: "otlp-http",
10
+ * endpoint: "http://otel-collector:4318",
11
+ * sampleRatio: 0.1,
12
+ * })],
13
+ * })
14
+ * class AppModule {}
15
+ *
16
+ * When `forRoot()` is called:
17
+ * 1. The OTel SDK is started (lazy `import()` of the SDK packages).
18
+ * 2. The Hono `tracingMiddleware` is installed in the framework's
19
+ * HTTP server (when `enableHttpInstrumentation !== false`).
20
+ * 3. The `TracingService` becomes the active global service that
21
+ * `@Trace()` decorators read from.
22
+ *
23
+ * When `forRoot()` is **not** called, `nexusjs/tracing` is a no-op:
24
+ * - `TracingService` instances use OTel's default no-op tracer.
25
+ * - `@Trace()` returns the original method unchanged.
26
+ * - No SDK packages are loaded.
27
+ */
28
+ import type { MiddlewareHandler } from "hono";
29
+ import { TracingService } from "./service.js";
30
+ import type { TracingConfig } from "./types.js";
31
+ export declare const TRACING_CONFIG_TOKEN: unique symbol;
32
+ export declare class TracingConfigHolder {
33
+ readonly config: Required<TracingConfig>;
34
+ constructor(config: Required<TracingConfig>);
35
+ }
36
+ export declare class TracingServiceWithLifecycle extends TracingService {
37
+ onApplicationBootstrap(): Promise<void>;
38
+ onApplicationShutdown(): Promise<void>;
39
+ }
40
+ export declare class TracingModule {
41
+ static forRoot(config?: TracingConfig): Function & {
42
+ middleware: () => MiddlewareHandler;
43
+ };
44
+ }
45
+ //# sourceMappingURL=module.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"module.d.ts","sourceRoot":"","sources":["../../src/tracing/module.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAGH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,MAAM,CAAC;AAC9C,OAAO,EAAE,cAAc,EAA4C,MAAM,cAAc,CAAC;AAExF,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAEhD,eAAO,MAAM,oBAAoB,eAAoC,CAAC;AAEtE,qBACa,mBAAmB;aAC2B,MAAM,EAAE,QAAQ,CAAC,aAAa,CAAC;gBAA/B,MAAM,EAAE,QAAQ,CAAC,aAAa,CAAC;CACzF;AAED,qBACa,2BAA4B,SAAQ,cAAc;IACxD,sBAAsB,IAAI,OAAO,CAAC,IAAI,CAAC;IAIvC,qBAAqB,IAAI,OAAO,CAAC,IAAI,CAAC;CAG5C;AAED,qBAOa,aAAa;IACzB,MAAM,CAAC,OAAO,CAAC,MAAM,GAAE,aAAkB;oBAmC3B,MAAM,iBAAiB;;CAUrC"}
@@ -0,0 +1,53 @@
1
+ /**
2
+ * W3C Trace Context propagation.
3
+ *
4
+ * The OTel API ships a default W3C propagator, so most use cases
5
+ * don't need anything here. This file provides:
6
+ * 1. Constants for header names.
7
+ * 2. Helpers to format / parse a `traceparent` value.
8
+ * 3. A simple B3 single-header propagator for legacy systems.
9
+ *
10
+ * Format reference: https://www.w3.org/TR/trace-context/#traceparent-header
11
+ */
12
+ import { type Context } from "@opentelemetry/api";
13
+ export declare const TRACE_PARENT_HEADER = "traceparent";
14
+ export declare const TRACE_STATE_HEADER = "tracestate";
15
+ export declare const B3_TRACE_ID_HEADER = "x-b3-traceid";
16
+ export declare const B3_SPAN_ID_HEADER = "x-b3-spanid";
17
+ export declare const B3_SAMPLED_HEADER = "x-b3-sampled";
18
+ export interface ParsedTraceParent {
19
+ /** "00" (version 0) for now. */
20
+ version: string;
21
+ /** Full trace id (32 hex chars). */
22
+ traceId: string;
23
+ /** Parent span id (16 hex chars). */
24
+ parentSpanId: string;
25
+ /** Trace flags byte, hex. */
26
+ flags: string;
27
+ /** True if the trace is sampled (flags bit 0 set). */
28
+ sampled: boolean;
29
+ }
30
+ /**
31
+ * Parse a `traceparent` header value.
32
+ * Returns `undefined` if the value is malformed.
33
+ */
34
+ export declare function parseTraceParent(value: string | undefined | null): ParsedTraceParent | undefined;
35
+ /**
36
+ * Format a `traceparent` value from a known context.
37
+ * `00-<traceId>-<spanId>-<flags>`
38
+ */
39
+ export declare function formatTraceParent(traceId: string, spanId: string, sampled?: boolean): string;
40
+ /**
41
+ * Extract context from a B3 single-header (`b3: <traceId>-<spanId>-1`).
42
+ * Falls through to W3C if no B3 header is present.
43
+ */
44
+ export declare function extractB3Context(headers: Record<string, string>): {
45
+ traceId: string;
46
+ spanId: string;
47
+ sampled: boolean;
48
+ } | undefined;
49
+ /** Inject the active context into the given carrier. */
50
+ export declare function inject(headers: Record<string, string>): Record<string, string>;
51
+ /** Extract a context from a header carrier. */
52
+ export declare function extract(headers: Record<string, string>): Context;
53
+ //# sourceMappingURL=propagation.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"propagation.d.ts","sourceRoot":"","sources":["../../src/tracing/propagation.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAAwB,KAAK,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAMxE,eAAO,MAAM,mBAAmB,gBAAgB,CAAC;AACjD,eAAO,MAAM,kBAAkB,eAAe,CAAC;AAC/C,eAAO,MAAM,kBAAkB,iBAAiB,CAAC;AACjD,eAAO,MAAM,iBAAiB,gBAAgB,CAAC;AAC/C,eAAO,MAAM,iBAAiB,iBAAiB,CAAC;AAMhD,MAAM,WAAW,iBAAiB;IACjC,gCAAgC;IAChC,OAAO,EAAE,MAAM,CAAC;IAChB,oCAAoC;IACpC,OAAO,EAAE,MAAM,CAAC;IAChB,qCAAqC;IACrC,YAAY,EAAE,MAAM,CAAC;IACrB,6BAA6B;IAC7B,KAAK,EAAE,MAAM,CAAC;IACd,sDAAsD;IACtD,OAAO,EAAE,OAAO,CAAC;CACjB;AAED;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,GAAG,IAAI,GAAG,iBAAiB,GAAG,SAAS,CAkBhG;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,UAAO,GAAG,MAAM,CAGzF;AAMD;;;GAGG;AACH,wBAAgB,gBAAgB,CAC/B,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAC7B;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,OAAO,CAAA;CAAE,GAAG,SAAS,CAgBnE;AAMD,wDAAwD;AACxD,wBAAgB,MAAM,CAAC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAI9E;AAED,+CAA+C;AAC/C,wBAAgB,OAAO,CAAC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,OAAO,CAEhE"}
@@ -0,0 +1,95 @@
1
+ /**
2
+ * `TracingService` — the framework's distributed-tracing primitive.
3
+ *
4
+ * Design:
5
+ * 1. The OpenTelemetry API (`@opentelemetry/api`) is the only
6
+ * required dependency; it's ~7kb and provides the no-op default
7
+ * tracer when the SDK is not configured.
8
+ * 2. The OTel SDK is **lazy-loaded**: only when the user calls
9
+ * `TracingModule.forRoot(...)` is `@opentelemetry/sdk-node` and
10
+ * the configured exporter imported. This keeps the bundle small
11
+ * for users who don't trace.
12
+ * 3. Without `forRoot()`, the service returns no-op spans. They have
13
+ * valid `traceId` / `spanId` (the OTel no-op span id format) so
14
+ * log lines and error reports don't need to special-case "not
15
+ * configured".
16
+ *
17
+ * Public API:
18
+ * - `startSpan(name, options?)` — create a new active span
19
+ * - `withSpan(name, fn, options?)` — run `fn` inside a span, return its result
20
+ * - `getCurrentTraceId()` / `getCurrentSpanId()` — read the active context
21
+ * - `extractContext(headers)` / `injectContext(headers)` — W3C trace context
22
+ * - `getSpans()` — read the in-memory span recorder (always available,
23
+ * used for tests and for the `console` exporter)
24
+ * - `reset()` — clear the in-memory recorder
25
+ *
26
+ * The service is registered in the DI container as a singleton. The
27
+ * framework does **not** call `trace.getTracer` until something
28
+ * actually starts a span.
29
+ */
30
+ import { type Context, type Tracer } from "@opentelemetry/api";
31
+ import type { ActiveSpan, FinishedSpan, SpanContext, SpanOptions, SpanStatus } from "./types.js";
32
+ export declare class InMemorySpanRecorder {
33
+ private finished;
34
+ private nextEventCounter;
35
+ /** Append a finished span. */
36
+ record(span: FinishedSpan): void;
37
+ /** Return all finished spans (most recent last). */
38
+ getAll(): FinishedSpan[];
39
+ /** Return only the spans whose `name` matches. */
40
+ findByName(name: string): FinishedSpan[];
41
+ /** Clear the recorder. */
42
+ clear(): void;
43
+ /** Number of recorded spans. */
44
+ get size(): number;
45
+ }
46
+ export declare const TRACING_SERVICE_TOKEN: unique symbol;
47
+ export declare function setTracingService(service: TracingService): void;
48
+ export declare function getTracingService(): TracingService | undefined;
49
+ export declare class TracingService {
50
+ readonly tracer: Tracer;
51
+ private readonly recorder;
52
+ private sdkStop?;
53
+ private initialized;
54
+ constructor();
55
+ /** True if the SDK has been started (i.e. `forRoot()` was called). */
56
+ get isInitialized(): boolean;
57
+ /** Read all finished spans recorded so far. */
58
+ getSpans(): FinishedSpan[];
59
+ /** Find spans by name. */
60
+ findSpans(name: string): FinishedSpan[];
61
+ /** Clear the in-memory recorder (and the SDK's batch, if any). */
62
+ clearSpans(): void;
63
+ startSpan(name: string, options?: SpanOptions): ActiveSpan;
64
+ /** Run `fn` inside a new span. Returns the result of `fn`. */
65
+ withSpan<T>(name: string, fn: (span: ActiveSpan) => Promise<T> | T, options?: SpanOptions): Promise<T>;
66
+ /** Synchronous version of `withSpan`. */
67
+ withSpanSync<T>(name: string, fn: (span: ActiveSpan) => T, options?: SpanOptions): T;
68
+ /** Get the trace id of the active span, or `undefined`. */
69
+ getCurrentTraceId(): string | undefined;
70
+ /** Get the span id of the active span, or `undefined`. */
71
+ getCurrentSpanId(): string | undefined;
72
+ /** Get the current OTel `Context`. */
73
+ getCurrentContext(): Context;
74
+ /**
75
+ * Extract a span context from incoming HTTP headers.
76
+ * Reads `traceparent` (W3C) and `x-b3-*` (B3 single) when present.
77
+ * Returns `undefined` if no recognizable header is found.
78
+ */
79
+ extractContext(headers: Record<string, string | string[] | undefined>): Context;
80
+ /**
81
+ * Inject the active span context into outgoing HTTP headers.
82
+ * Writes `traceparent` (W3C) by default.
83
+ */
84
+ injectContext(headers?: Record<string, string>): Record<string, string>;
85
+ /**
86
+ * Initialize the OpenTelemetry SDK with the given configuration.
87
+ * This is called by `TracingModule.forRoot()`. It's idempotent.
88
+ */
89
+ startSdk(config: import("./types.js").TracingConfig): Promise<void>;
90
+ /** Stop the SDK. Called on process exit / app shutdown. */
91
+ stopSdk(): Promise<void>;
92
+ }
93
+ /** Re-export for downstream type users. */
94
+ export type { SpanContext, SpanStatus };
95
+ //# sourceMappingURL=service.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"service.d.ts","sourceRoot":"","sources":["../../src/tracing/service.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AAEH,OAAO,EAMN,KAAK,OAAO,EAEZ,KAAK,MAAM,EACX,MAAM,oBAAoB,CAAC;AAC5B,OAAO,KAAK,EACX,UAAU,EACV,YAAY,EACZ,WAAW,EACX,WAAW,EACX,UAAU,EACV,MAAM,YAAY,CAAC;AAMpB,qBAAa,oBAAoB;IAChC,OAAO,CAAC,QAAQ,CAAsB;IACtC,OAAO,CAAC,gBAAgB,CAAK;IAE7B,8BAA8B;IAC9B,MAAM,CAAC,IAAI,EAAE,YAAY,GAAG,IAAI;IAKhC,oDAAoD;IACpD,MAAM,IAAI,YAAY,EAAE;IAIxB,kDAAkD;IAClD,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,YAAY,EAAE;IAIxC,0BAA0B;IAC1B,KAAK,IAAI,IAAI;IAKb,gCAAgC;IAChC,IAAI,IAAI,IAA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,GAAG,MAAM,EAAE,GAAG,SAAS,CAAC,GAAG,OAAO;IAK/E;;;OAGG;IACH,aAAa,CAAC,OAAO,GAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAM,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC;IAQ3E;;;OAGG;IACG,QAAQ,CAAC,MAAM,EAAE,OAAO,YAAY,EAAE,aAAa,GAAG,OAAO,CAAC,IAAI,CAAC;IA0EzE,2DAA2D;IACrD,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC;CAO9B;AAgCD,2CAA2C;AAC3C,YAAY,EAAE,WAAW,EAAE,UAAU,EAAE,CAAC"}
@@ -0,0 +1,90 @@
1
+ /**
2
+ * Public types for `nexusjs/tracing`.
3
+ *
4
+ * `nexusjs/tracing` is a thin, ergonomic wrapper around the
5
+ * OpenTelemetry API (and, when configured, the SDK). It is
6
+ * intentionally minimal — no global side effects on import.
7
+ *
8
+ * If you don't import `TracingModule.forRoot()`, this module
9
+ * is a complete no-op: no OpenTelemetry packages are loaded
10
+ * and `TracingService` falls back to in-memory no-op spans.
11
+ */
12
+ import type { SpanContext as OtelSpanContext } from "@opentelemetry/api";
13
+ export type TracingExporter = "otlp-http" | "otlp-grpc" | "console" | "memory";
14
+ export interface TracingConfig {
15
+ /** Service name reported in spans. Defaults to `process.env.OTEL_SERVICE_NAME ?? "nexusjs"`. */
16
+ serviceName?: string;
17
+ /** Service version (sent as `service.version` resource attribute). */
18
+ serviceVersion?: string;
19
+ /** Deployment environment (e.g. "production", "staging"). */
20
+ environment?: string;
21
+ /** Exporter to use. Default: `"otlp-http"`. */
22
+ exporter?: TracingExporter;
23
+ /** OTLP endpoint. Default: `process.env.OTEL_EXPORTER_OTLP_ENDPOINT ?? "http://localhost:4318"`. */
24
+ endpoint?: string;
25
+ /** Sampling ratio in [0, 1]. 0.0 = drop everything, 1.0 = keep everything. Default: `1.0`. */
26
+ sampleRatio?: number;
27
+ /** Whether to install the Hono HTTP server middleware. Default: `true`. */
28
+ enableHttpInstrumentation?: boolean;
29
+ /** Whether to capture DB spans via `nexusjs/drizzle` (if installed). Default: `true`. */
30
+ enableDbInstrumentation?: boolean;
31
+ /** Extra static resource attributes (service.namespace, deployment.id, ...). */
32
+ resourceAttributes?: Record<string, string>;
33
+ /** When true, exit process on uncaught span error. Default: `false`. */
34
+ throwOnError?: boolean;
35
+ }
36
+ /** Public-facing span context (mirrors OTel's, but vendor-neutral). */
37
+ export interface SpanContext extends OtelSpanContext {
38
+ }
39
+ /** Status of a span — mirrors OTel's `SpanStatusCode`. */
40
+ export type SpanStatus = "unset" | "ok" | "error";
41
+ /** A finished span, returned from `withSpan()` / `endSpan()`. */
42
+ export interface FinishedSpan {
43
+ readonly name: string;
44
+ readonly traceId: string;
45
+ readonly spanId: string;
46
+ readonly parentSpanId?: string;
47
+ readonly startTime: number;
48
+ readonly endTime: number;
49
+ readonly durationMs: number;
50
+ readonly status: SpanStatus;
51
+ readonly attributes: Record<string, string | number | boolean>;
52
+ readonly events: Array<{
53
+ name: string;
54
+ time: number;
55
+ attributes?: Record<string, unknown>;
56
+ }>;
57
+ }
58
+ /** Per-span options. */
59
+ export interface SpanOptions {
60
+ /** Span kind. Default: `"internal"`. */
61
+ kind?: "server" | "client" | "producer" | "consumer" | "internal";
62
+ /** Initial attributes. */
63
+ attributes?: Record<string, string | number | boolean>;
64
+ /** Span start time override (epoch ms). */
65
+ startTime?: number;
66
+ }
67
+ /** Active span handle returned from `startSpan()`. */
68
+ export interface ActiveSpan {
69
+ /** Span name. */
70
+ readonly name: string;
71
+ /** Current trace id (32 hex chars). */
72
+ readonly traceId: string;
73
+ /** Current span id (16 hex chars). */
74
+ readonly spanId: string;
75
+ /** True if the underlying OTel span is a no-op (no SDK configured). */
76
+ readonly isRecording: boolean;
77
+ /** Set an attribute. */
78
+ setAttribute(key: string, value: string | number | boolean): void;
79
+ /** Set multiple attributes at once. */
80
+ setAttributes(attributes: Record<string, string | number | boolean>): void;
81
+ /** Record an event with optional attributes. */
82
+ addEvent(name: string, attributes?: Record<string, unknown>): void;
83
+ /** Record an exception. */
84
+ recordException(err: unknown): void;
85
+ /** Set the span status to "ok" with an optional description. */
86
+ setStatus(status: "ok" | "error" | "unset", description?: string): void;
87
+ /** End the span. After calling, no other methods are valid. */
88
+ end(): void;
89
+ }
90
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/tracing/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,KAAK,EAAE,WAAW,IAAI,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAMzE,MAAM,MAAM,eAAe,GAAG,WAAW,GAAG,WAAW,GAAG,SAAS,GAAG,QAAQ,CAAC;AAE/E,MAAM,WAAW,aAAa;IAC7B,gGAAgG;IAChG,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,sEAAsE;IACtE,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,6DAA6D;IAC7D,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,+CAA+C;IAC/C,QAAQ,CAAC,EAAE,eAAe,CAAC;IAC3B,oGAAoG;IACpG,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,8FAA8F;IAC9F,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,2EAA2E;IAC3E,yBAAyB,CAAC,EAAE,OAAO,CAAC;IACpC,yFAAyF;IACzF,uBAAuB,CAAC,EAAE,OAAO,CAAC;IAClC,gFAAgF;IAChF,kBAAkB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC5C,wEAAwE;IACxE,YAAY,CAAC,EAAE,OAAO,CAAC;CACvB;AAMD,uEAAuE;AACvE,MAAM,WAAW,WAAY,SAAQ,eAAe;CAAG;AAEvD,0DAA0D;AAC1D,MAAM,MAAM,UAAU,GAAG,OAAO,GAAG,IAAI,GAAG,OAAO,CAAC;AAElD,iEAAiE;AACjE,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AAO,CAAC;IAC9B,wBAAwB;IACxB,YAAY,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,IAAI,CAAC;IAClE,uCAAuC;IACvC,aAAa,CAAC,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC,GAAG,IAAI,CAAC;IAC3E,gDAAgD;IAChD,QAAQ,CAAC,IAAI,EAAE,MAAM,EAAE,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,CAAC;IACnE,2BAA2B;IAC3B,eAAe,CAAC,GAAG,EAAE,OAAO,GAAG,IAAI,CAAC;IACpC,gEAAgE;IAChE,SAAS,CAAC,MAAM,EAAE,IAAI,GAAG,OAAO,GAAG,OAAO,EAAE,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACxE,+DAA+D;IAC/D,GAAG,IAAI,IAAI,CAAC;CACZ"}
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Decorator barrel.
3
+ */
4
+ export { Upload } from "./upload.js";
5
+ export { UploadedFile, getUploadedFile, getUploadedFiles } from "./uploaded-file.js";
6
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/upload/decorators/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,EAAE,YAAY,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC"}
@@ -0,0 +1,16 @@
1
+ /**
2
+ * `@Upload('fieldName', opts?)` — declare that a controller method
3
+ * expects one or more uploaded files in `multipart/form-data`.
4
+ *
5
+ * @Post('/avatars')
6
+ * @Upload('avatar')
7
+ * async upload(@UploadedFile('avatar') file: UploadedFile) { ... }
8
+ *
9
+ * @Post('/photos')
10
+ * @Upload('photos', { maxFiles: 10 })
11
+ * async multi(@UploadedFiles('photos') files: UploadedFile[]) { ... }
12
+ */
13
+ import "reflect-metadata";
14
+ import { type UploadOptions } from "../types.js";
15
+ export declare function Upload(name?: string, options?: UploadOptions): MethodDecorator;
16
+ //# sourceMappingURL=upload.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"upload.d.ts","sourceRoot":"","sources":["../../../src/upload/decorators/upload.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AACH,OAAO,kBAAkB,CAAC;AAC1B,OAAO,EAAe,KAAK,aAAa,EAAE,MAAM,aAAa,CAAC;AAK9D,wBAAgB,MAAM,CAAC,IAAI,GAAE,MAAqB,EAAE,OAAO,GAAE,aAAkB,GAAG,eAAe,CAOhG"}
@@ -0,0 +1,10 @@
1
+ export declare const UploadedFile: (fieldName?: string) => ParameterDecorator;
2
+ /**
3
+ * Resolve a `@UploadedFile(name)` call against a Hono context. The
4
+ * framework invokes this from its param pipeline. Application
5
+ * code typically does not call this directly — use the decorator.
6
+ */
7
+ export declare function getUploadedFile(c: any, fieldName: string): any;
8
+ /** Resolve a `@UploadedFiles(name)` call. */
9
+ export declare function getUploadedFiles(c: any, fieldName: string): any[];
10
+ //# sourceMappingURL=uploaded-file.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"uploaded-file.d.ts","sourceRoot":"","sources":["../../../src/upload/decorators/uploaded-file.ts"],"names":[],"mappings":"AAaA,eAAO,MAAM,YAAY,GAAI,YAAY,MAAM,uBACS,CAAC;AASzD;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,CAAC,EAAE,GAAG,EAAE,SAAS,EAAE,MAAM,OAMxD;AAED,6CAA6C;AAC7C,wBAAgB,gBAAgB,CAAC,CAAC,EAAE,GAAG,EAAE,SAAS,EAAE,MAAM,SAOzD"}
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Public entry point for `nexusjs/upload`.
3
+ */
4
+ export * from "./types.js";
5
+ export { UploadService } from "./upload.service.js";
6
+ export { UploadModule } from "./upload.module.js";
7
+ export { uploadMiddleware } from "./upload.middleware.js";
8
+ export { Upload, UploadedFile, getUploadedFile, getUploadedFiles } from "./decorators/index.js";
9
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/upload/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,cAAc,YAAY,CAAC;AAC3B,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC1D,OAAO,EAAE,MAAM,EAAE,YAAY,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC"}