@buenojs/bueno 0.8.6 → 0.8.8

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 (398) hide show
  1. package/.claude/settings.local.json +9 -0
  2. package/README.md +132 -15
  3. package/dist/cache/index.d.ts +187 -0
  4. package/dist/cache/index.d.ts.map +1 -0
  5. package/dist/cli/bin.d.ts +8 -0
  6. package/dist/cli/bin.d.ts.map +1 -0
  7. package/dist/cli/bin.js +483 -155
  8. package/dist/cli/commands/add-frontend.d.ts +7 -0
  9. package/dist/cli/commands/add-frontend.d.ts.map +1 -0
  10. package/dist/cli/commands/build.d.ts +7 -0
  11. package/dist/cli/commands/build.d.ts.map +1 -0
  12. package/dist/cli/commands/dev.d.ts +7 -0
  13. package/dist/cli/commands/dev.d.ts.map +1 -0
  14. package/dist/cli/commands/generate.d.ts +7 -0
  15. package/dist/cli/commands/generate.d.ts.map +1 -0
  16. package/dist/cli/commands/help.d.ts +7 -0
  17. package/dist/cli/commands/help.d.ts.map +1 -0
  18. package/dist/cli/commands/index.d.ts +59 -0
  19. package/dist/cli/commands/index.d.ts.map +1 -0
  20. package/dist/cli/commands/migration.d.ts +7 -0
  21. package/dist/cli/commands/migration.d.ts.map +1 -0
  22. package/dist/cli/commands/new.d.ts +7 -0
  23. package/dist/cli/commands/new.d.ts.map +1 -0
  24. package/dist/cli/commands/start.d.ts +7 -0
  25. package/dist/cli/commands/start.d.ts.map +1 -0
  26. package/dist/cli/core/args.d.ts +61 -0
  27. package/dist/cli/core/args.d.ts.map +1 -0
  28. package/dist/cli/core/console.d.ts +135 -0
  29. package/dist/cli/core/console.d.ts.map +1 -0
  30. package/dist/cli/core/index.d.ts +10 -0
  31. package/dist/cli/core/index.d.ts.map +1 -0
  32. package/dist/cli/core/prompt.d.ts +63 -0
  33. package/dist/cli/core/prompt.d.ts.map +1 -0
  34. package/dist/cli/core/spinner.d.ts +111 -0
  35. package/dist/cli/core/spinner.d.ts.map +1 -0
  36. package/dist/cli/index.d.ts +47 -0
  37. package/dist/cli/index.d.ts.map +1 -0
  38. package/dist/cli/templates/database/index.d.ts +24 -0
  39. package/dist/cli/templates/database/index.d.ts.map +1 -0
  40. package/dist/cli/templates/database/mysql.d.ts +6 -0
  41. package/dist/cli/templates/database/mysql.d.ts.map +1 -0
  42. package/dist/cli/templates/database/none.d.ts +8 -0
  43. package/dist/cli/templates/database/none.d.ts.map +1 -0
  44. package/dist/cli/templates/database/postgresql.d.ts +6 -0
  45. package/dist/cli/templates/database/postgresql.d.ts.map +1 -0
  46. package/dist/cli/templates/database/sqlite.d.ts +6 -0
  47. package/dist/cli/templates/database/sqlite.d.ts.map +1 -0
  48. package/dist/cli/templates/deploy.d.ts +41 -0
  49. package/dist/cli/templates/deploy.d.ts.map +1 -0
  50. package/dist/cli/templates/docker.d.ts +30 -0
  51. package/dist/cli/templates/docker.d.ts.map +1 -0
  52. package/dist/cli/templates/frontend/index.d.ts +25 -0
  53. package/dist/cli/templates/frontend/index.d.ts.map +1 -0
  54. package/dist/cli/templates/frontend/none.d.ts +8 -0
  55. package/dist/cli/templates/frontend/none.d.ts.map +1 -0
  56. package/dist/cli/templates/frontend/react.d.ts +6 -0
  57. package/dist/cli/templates/frontend/react.d.ts.map +1 -0
  58. package/dist/cli/templates/frontend/solid.d.ts +6 -0
  59. package/dist/cli/templates/frontend/solid.d.ts.map +1 -0
  60. package/dist/cli/templates/frontend/svelte.d.ts +6 -0
  61. package/dist/cli/templates/frontend/svelte.d.ts.map +1 -0
  62. package/dist/cli/templates/frontend/vue.d.ts +6 -0
  63. package/dist/cli/templates/frontend/vue.d.ts.map +1 -0
  64. package/dist/cli/templates/generators/index.d.ts +29 -0
  65. package/dist/cli/templates/generators/index.d.ts.map +1 -0
  66. package/dist/cli/templates/generators/types.d.ts +32 -0
  67. package/dist/cli/templates/generators/types.d.ts.map +1 -0
  68. package/dist/cli/templates/index.d.ts +12 -0
  69. package/dist/cli/templates/index.d.ts.map +1 -0
  70. package/dist/cli/templates/project/api.d.ts +6 -0
  71. package/dist/cli/templates/project/api.d.ts.map +1 -0
  72. package/dist/cli/templates/project/default.d.ts +6 -0
  73. package/dist/cli/templates/project/default.d.ts.map +1 -0
  74. package/dist/cli/templates/project/fullstack.d.ts +14 -0
  75. package/dist/cli/templates/project/fullstack.d.ts.map +1 -0
  76. package/dist/cli/templates/project/index.d.ts +26 -0
  77. package/dist/cli/templates/project/index.d.ts.map +1 -0
  78. package/dist/cli/templates/project/minimal.d.ts +6 -0
  79. package/dist/cli/templates/project/minimal.d.ts.map +1 -0
  80. package/dist/cli/templates/project/types.d.ts +80 -0
  81. package/dist/cli/templates/project/types.d.ts.map +1 -0
  82. package/dist/cli/templates/project/website.d.ts +8 -0
  83. package/dist/cli/templates/project/website.d.ts.map +1 -0
  84. package/dist/cli/utils/fs.d.ts +137 -0
  85. package/dist/cli/utils/fs.d.ts.map +1 -0
  86. package/dist/cli/utils/index.d.ts +9 -0
  87. package/dist/cli/utils/index.d.ts.map +1 -0
  88. package/dist/cli/utils/strings.d.ts +86 -0
  89. package/dist/cli/utils/strings.d.ts.map +1 -0
  90. package/dist/cli/utils/version.d.ts +15 -0
  91. package/dist/cli/utils/version.d.ts.map +1 -0
  92. package/dist/config/env-validation.d.ts +49 -0
  93. package/dist/config/env-validation.d.ts.map +1 -0
  94. package/dist/config/env.d.ts +167 -0
  95. package/dist/config/env.d.ts.map +1 -0
  96. package/dist/config/index.d.ts +168 -0
  97. package/dist/config/index.d.ts.map +1 -0
  98. package/dist/config/loader.d.ts +81 -0
  99. package/dist/config/loader.d.ts.map +1 -0
  100. package/dist/config/merge.d.ts +66 -0
  101. package/dist/config/merge.d.ts.map +1 -0
  102. package/dist/config/types.d.ts +322 -0
  103. package/dist/config/types.d.ts.map +1 -0
  104. package/dist/config/validation.d.ts +100 -0
  105. package/dist/config/validation.d.ts.map +1 -0
  106. package/dist/container/forward-ref.d.ts +116 -0
  107. package/dist/container/forward-ref.d.ts.map +1 -0
  108. package/dist/container/index.d.ts +95 -0
  109. package/dist/container/index.d.ts.map +1 -0
  110. package/dist/context/index.d.ts +143 -0
  111. package/dist/context/index.d.ts.map +1 -0
  112. package/dist/database/index.d.ts +219 -0
  113. package/dist/database/index.d.ts.map +1 -0
  114. package/dist/database/migrations/index.d.ts +146 -0
  115. package/dist/database/migrations/index.d.ts.map +1 -0
  116. package/dist/database/orm/builder.d.ts +122 -0
  117. package/dist/database/orm/builder.d.ts.map +1 -0
  118. package/dist/database/orm/casts/index.d.ts +16 -0
  119. package/dist/database/orm/casts/index.d.ts.map +1 -0
  120. package/dist/database/orm/casts/types.d.ts +16 -0
  121. package/dist/database/orm/casts/types.d.ts.map +1 -0
  122. package/dist/database/orm/compiler.d.ts +90 -0
  123. package/dist/database/orm/compiler.d.ts.map +1 -0
  124. package/dist/database/orm/hooks/index.d.ts +53 -0
  125. package/dist/database/orm/hooks/index.d.ts.map +1 -0
  126. package/dist/database/orm/index.d.ts +21 -0
  127. package/dist/database/orm/index.d.ts.map +1 -0
  128. package/dist/database/orm/model-registry.d.ts +33 -0
  129. package/dist/database/orm/model-registry.d.ts.map +1 -0
  130. package/dist/database/orm/model.d.ts +245 -0
  131. package/dist/database/orm/model.d.ts.map +1 -0
  132. package/dist/database/orm/relationships/base.d.ts +69 -0
  133. package/dist/database/orm/relationships/base.d.ts.map +1 -0
  134. package/dist/database/orm/relationships/belongs-to-many.d.ts +47 -0
  135. package/dist/database/orm/relationships/belongs-to-many.d.ts.map +1 -0
  136. package/dist/database/orm/relationships/belongs-to.d.ts +17 -0
  137. package/dist/database/orm/relationships/belongs-to.d.ts.map +1 -0
  138. package/dist/database/orm/relationships/has-many.d.ts +14 -0
  139. package/dist/database/orm/relationships/has-many.d.ts.map +1 -0
  140. package/dist/database/orm/relationships/has-one.d.ts +14 -0
  141. package/dist/database/orm/relationships/has-one.d.ts.map +1 -0
  142. package/dist/database/orm/relationships/index.d.ts +10 -0
  143. package/dist/database/orm/relationships/index.d.ts.map +1 -0
  144. package/dist/database/orm/scopes/index.d.ts +36 -0
  145. package/dist/database/orm/scopes/index.d.ts.map +1 -0
  146. package/dist/database/schema/index.d.ts +155 -0
  147. package/dist/database/schema/index.d.ts.map +1 -0
  148. package/dist/events/__tests__/event-system.test.d.ts +2 -0
  149. package/dist/events/__tests__/event-system.test.d.ts.map +1 -0
  150. package/dist/events/config.d.ts +16 -0
  151. package/dist/events/config.d.ts.map +1 -0
  152. package/dist/events/example-usage.d.ts +12 -0
  153. package/dist/events/example-usage.d.ts.map +1 -0
  154. package/dist/events/index.d.ts +27 -0
  155. package/dist/events/index.d.ts.map +1 -0
  156. package/dist/events/manager.d.ts +33 -0
  157. package/dist/events/manager.d.ts.map +1 -0
  158. package/dist/events/registry.d.ts +31 -0
  159. package/dist/events/registry.d.ts.map +1 -0
  160. package/dist/events/types.d.ts +105 -0
  161. package/dist/events/types.d.ts.map +1 -0
  162. package/dist/frontend/api-routes.d.ts +189 -0
  163. package/dist/frontend/api-routes.d.ts.map +1 -0
  164. package/dist/frontend/bundler.d.ts +99 -0
  165. package/dist/frontend/bundler.d.ts.map +1 -0
  166. package/dist/frontend/console-client.d.ts +11 -0
  167. package/dist/frontend/console-client.d.ts.map +1 -0
  168. package/dist/frontend/console-stream.d.ts +138 -0
  169. package/dist/frontend/console-stream.d.ts.map +1 -0
  170. package/dist/frontend/dev-server.d.ts +174 -0
  171. package/dist/frontend/dev-server.d.ts.map +1 -0
  172. package/dist/frontend/file-router.d.ts +170 -0
  173. package/dist/frontend/file-router.d.ts.map +1 -0
  174. package/dist/frontend/frameworks/index.d.ts +41 -0
  175. package/dist/frontend/frameworks/index.d.ts.map +1 -0
  176. package/dist/frontend/frameworks/react.d.ts +32 -0
  177. package/dist/frontend/frameworks/react.d.ts.map +1 -0
  178. package/dist/frontend/frameworks/solid.d.ts +42 -0
  179. package/dist/frontend/frameworks/solid.d.ts.map +1 -0
  180. package/dist/frontend/frameworks/svelte.d.ts +57 -0
  181. package/dist/frontend/frameworks/svelte.d.ts.map +1 -0
  182. package/dist/frontend/frameworks/vue.d.ts +36 -0
  183. package/dist/frontend/frameworks/vue.d.ts.map +1 -0
  184. package/dist/frontend/hmr-client.d.ts +22 -0
  185. package/dist/frontend/hmr-client.d.ts.map +1 -0
  186. package/dist/frontend/hmr.d.ts +185 -0
  187. package/dist/frontend/hmr.d.ts.map +1 -0
  188. package/dist/frontend/index.d.ts +34 -0
  189. package/dist/frontend/index.d.ts.map +1 -0
  190. package/dist/frontend/islands.d.ts +135 -0
  191. package/dist/frontend/islands.d.ts.map +1 -0
  192. package/dist/frontend/isr.d.ts +143 -0
  193. package/dist/frontend/isr.d.ts.map +1 -0
  194. package/dist/frontend/layout.d.ts +140 -0
  195. package/dist/frontend/layout.d.ts.map +1 -0
  196. package/dist/frontend/ssr/react.d.ts +118 -0
  197. package/dist/frontend/ssr/react.d.ts.map +1 -0
  198. package/dist/frontend/ssr/solid.d.ts +141 -0
  199. package/dist/frontend/ssr/solid.d.ts.map +1 -0
  200. package/dist/frontend/ssr/svelte.d.ts +158 -0
  201. package/dist/frontend/ssr/svelte.d.ts.map +1 -0
  202. package/dist/frontend/ssr/vue.d.ts +161 -0
  203. package/dist/frontend/ssr/vue.d.ts.map +1 -0
  204. package/dist/frontend/ssr.d.ts +147 -0
  205. package/dist/frontend/ssr.d.ts.map +1 -0
  206. package/dist/frontend/types.d.ts +1902 -0
  207. package/dist/frontend/types.d.ts.map +1 -0
  208. package/dist/graphql/built-in-engine.d.ts +36 -0
  209. package/dist/graphql/built-in-engine.d.ts.map +1 -0
  210. package/dist/graphql/context-builder.d.ts +44 -0
  211. package/dist/graphql/context-builder.d.ts.map +1 -0
  212. package/dist/graphql/decorators.d.ts +162 -0
  213. package/dist/graphql/decorators.d.ts.map +1 -0
  214. package/dist/graphql/execution-pipeline.d.ts +67 -0
  215. package/dist/graphql/execution-pipeline.d.ts.map +1 -0
  216. package/dist/graphql/graphql-module.d.ts +70 -0
  217. package/dist/graphql/graphql-module.d.ts.map +1 -0
  218. package/dist/graphql/index.d.ts +48 -0
  219. package/dist/graphql/index.d.ts.map +1 -0
  220. package/dist/graphql/metadata.d.ts +37 -0
  221. package/dist/graphql/metadata.d.ts.map +1 -0
  222. package/dist/graphql/schema-builder.d.ts +34 -0
  223. package/dist/graphql/schema-builder.d.ts.map +1 -0
  224. package/dist/graphql/subscription-handler.d.ts +47 -0
  225. package/dist/graphql/subscription-handler.d.ts.map +1 -0
  226. package/dist/graphql/types.d.ts +252 -0
  227. package/dist/graphql/types.d.ts.map +1 -0
  228. package/dist/health/index.d.ts +176 -0
  229. package/dist/health/index.d.ts.map +1 -0
  230. package/dist/i18n/engine.d.ts +105 -0
  231. package/dist/i18n/engine.d.ts.map +1 -0
  232. package/dist/i18n/index.d.ts +13 -0
  233. package/dist/i18n/index.d.ts.map +1 -0
  234. package/dist/i18n/loader.d.ts +79 -0
  235. package/dist/i18n/loader.d.ts.map +1 -0
  236. package/dist/i18n/middleware.d.ts +96 -0
  237. package/dist/i18n/middleware.d.ts.map +1 -0
  238. package/dist/i18n/negotiator.d.ts +84 -0
  239. package/dist/i18n/negotiator.d.ts.map +1 -0
  240. package/dist/i18n/types.d.ts +129 -0
  241. package/dist/i18n/types.d.ts.map +1 -0
  242. package/dist/index.d.ts +48 -0
  243. package/dist/index.d.ts.map +1 -0
  244. package/dist/jobs/drivers/memory.d.ts +38 -0
  245. package/dist/jobs/drivers/memory.d.ts.map +1 -0
  246. package/dist/jobs/drivers/redis.d.ts +34 -0
  247. package/dist/jobs/drivers/redis.d.ts.map +1 -0
  248. package/dist/jobs/index.d.ts +12 -0
  249. package/dist/jobs/index.d.ts.map +1 -0
  250. package/dist/jobs/queue.d.ts +93 -0
  251. package/dist/jobs/queue.d.ts.map +1 -0
  252. package/dist/jobs/types.d.ts +193 -0
  253. package/dist/jobs/types.d.ts.map +1 -0
  254. package/dist/jobs/worker.d.ts +91 -0
  255. package/dist/jobs/worker.d.ts.map +1 -0
  256. package/dist/lock/index.d.ts +141 -0
  257. package/dist/lock/index.d.ts.map +1 -0
  258. package/dist/logger/index.d.ts +156 -0
  259. package/dist/logger/index.d.ts.map +1 -0
  260. package/dist/logger/transports/index.d.ts +371 -0
  261. package/dist/logger/transports/index.d.ts.map +1 -0
  262. package/dist/metrics/index.d.ts +163 -0
  263. package/dist/metrics/index.d.ts.map +1 -0
  264. package/dist/middleware/built-in.d.ts +50 -0
  265. package/dist/middleware/built-in.d.ts.map +1 -0
  266. package/dist/middleware/index.d.ts +40 -0
  267. package/dist/middleware/index.d.ts.map +1 -0
  268. package/dist/migrations/index.d.ts +10 -0
  269. package/dist/migrations/index.d.ts.map +1 -0
  270. package/dist/modules/filters.d.ts +150 -0
  271. package/dist/modules/filters.d.ts.map +1 -0
  272. package/dist/modules/guards.d.ts +188 -0
  273. package/dist/modules/guards.d.ts.map +1 -0
  274. package/dist/modules/index.d.ts +266 -0
  275. package/dist/modules/index.d.ts.map +1 -0
  276. package/dist/modules/interceptors.d.ts +242 -0
  277. package/dist/modules/interceptors.d.ts.map +1 -0
  278. package/dist/modules/lazy.d.ts +187 -0
  279. package/dist/modules/lazy.d.ts.map +1 -0
  280. package/dist/modules/lifecycle.d.ts +221 -0
  281. package/dist/modules/lifecycle.d.ts.map +1 -0
  282. package/dist/modules/metadata.d.ts +32 -0
  283. package/dist/modules/metadata.d.ts.map +1 -0
  284. package/dist/modules/pipes.d.ts +287 -0
  285. package/dist/modules/pipes.d.ts.map +1 -0
  286. package/dist/notification/channels/base.d.ts +32 -0
  287. package/dist/notification/channels/base.d.ts.map +1 -0
  288. package/dist/notification/channels/email.d.ts +37 -0
  289. package/dist/notification/channels/email.d.ts.map +1 -0
  290. package/dist/notification/channels/push.d.ts +37 -0
  291. package/dist/notification/channels/push.d.ts.map +1 -0
  292. package/dist/notification/channels/sms.d.ts +37 -0
  293. package/dist/notification/channels/sms.d.ts.map +1 -0
  294. package/dist/notification/channels/whatsapp.d.ts +37 -0
  295. package/dist/notification/channels/whatsapp.d.ts.map +1 -0
  296. package/dist/notification/index.d.ts +15 -0
  297. package/dist/notification/index.d.ts.map +1 -0
  298. package/dist/notification/service.d.ts +100 -0
  299. package/dist/notification/service.d.ts.map +1 -0
  300. package/dist/notification/types.d.ts +253 -0
  301. package/dist/notification/types.d.ts.map +1 -0
  302. package/dist/observability/__tests__/observability.test.d.ts +2 -0
  303. package/dist/observability/__tests__/observability.test.d.ts.map +1 -0
  304. package/dist/observability/breadcrumbs.d.ts +48 -0
  305. package/dist/observability/breadcrumbs.d.ts.map +1 -0
  306. package/dist/observability/index.d.ts +95 -0
  307. package/dist/observability/index.d.ts.map +1 -0
  308. package/dist/observability/interceptor.d.ts +19 -0
  309. package/dist/observability/interceptor.d.ts.map +1 -0
  310. package/dist/observability/service.d.ts +101 -0
  311. package/dist/observability/service.d.ts.map +1 -0
  312. package/dist/observability/trace.d.ts +21 -0
  313. package/dist/observability/trace.d.ts.map +1 -0
  314. package/dist/observability/types.d.ts +172 -0
  315. package/dist/observability/types.d.ts.map +1 -0
  316. package/dist/openapi/__tests__/decorators.test.d.ts +2 -0
  317. package/dist/openapi/__tests__/decorators.test.d.ts.map +1 -0
  318. package/dist/openapi/__tests__/document-builder.test.d.ts +2 -0
  319. package/dist/openapi/__tests__/document-builder.test.d.ts.map +1 -0
  320. package/dist/openapi/__tests__/route-scanner.test.d.ts +2 -0
  321. package/dist/openapi/__tests__/route-scanner.test.d.ts.map +1 -0
  322. package/dist/openapi/__tests__/schema-generator.test.d.ts +2 -0
  323. package/dist/openapi/__tests__/schema-generator.test.d.ts.map +1 -0
  324. package/dist/openapi/decorators.d.ts +173 -0
  325. package/dist/openapi/decorators.d.ts.map +1 -0
  326. package/dist/openapi/document-builder.d.ts +82 -0
  327. package/dist/openapi/document-builder.d.ts.map +1 -0
  328. package/dist/openapi/index.d.ts +48 -0
  329. package/dist/openapi/index.d.ts.map +1 -0
  330. package/dist/openapi/metadata.d.ts +36 -0
  331. package/dist/openapi/metadata.d.ts.map +1 -0
  332. package/dist/openapi/route-scanner.d.ts +34 -0
  333. package/dist/openapi/route-scanner.d.ts.map +1 -0
  334. package/dist/openapi/schema-generator.d.ts +53 -0
  335. package/dist/openapi/schema-generator.d.ts.map +1 -0
  336. package/dist/openapi/swagger-module.d.ts +57 -0
  337. package/dist/openapi/swagger-module.d.ts.map +1 -0
  338. package/dist/openapi/types.d.ts +344 -0
  339. package/dist/openapi/types.d.ts.map +1 -0
  340. package/dist/orm/index.d.ts +10 -0
  341. package/dist/orm/index.d.ts.map +1 -0
  342. package/dist/router/index.d.ts +73 -0
  343. package/dist/router/index.d.ts.map +1 -0
  344. package/dist/router/linear.d.ts +54 -0
  345. package/dist/router/linear.d.ts.map +1 -0
  346. package/dist/router/regex.d.ts +49 -0
  347. package/dist/router/regex.d.ts.map +1 -0
  348. package/dist/router/tree.d.ts +112 -0
  349. package/dist/router/tree.d.ts.map +1 -0
  350. package/dist/rpc/index.d.ts +321 -0
  351. package/dist/rpc/index.d.ts.map +1 -0
  352. package/dist/schema/index.d.ts +10 -0
  353. package/dist/schema/index.d.ts.map +1 -0
  354. package/dist/security/index.d.ts +126 -0
  355. package/dist/security/index.d.ts.map +1 -0
  356. package/dist/ssg/index.d.ts +73 -0
  357. package/dist/ssg/index.d.ts.map +1 -0
  358. package/dist/storage/index.d.ts +99 -0
  359. package/dist/storage/index.d.ts.map +1 -0
  360. package/dist/telemetry/index.d.ts +376 -0
  361. package/dist/telemetry/index.d.ts.map +1 -0
  362. package/dist/template/index.d.ts +7 -0
  363. package/dist/template/index.d.ts.map +1 -0
  364. package/dist/templates/engine.d.ts +60 -0
  365. package/dist/templates/engine.d.ts.map +1 -0
  366. package/dist/templates/index.d.ts +9 -0
  367. package/dist/templates/index.d.ts.map +1 -0
  368. package/dist/templates/loader.d.ts +45 -0
  369. package/dist/templates/loader.d.ts.map +1 -0
  370. package/dist/templates/renderers/markdown.d.ts +46 -0
  371. package/dist/templates/renderers/markdown.d.ts.map +1 -0
  372. package/dist/templates/renderers/simple.d.ts +35 -0
  373. package/dist/templates/renderers/simple.d.ts.map +1 -0
  374. package/dist/templates/types.d.ts +138 -0
  375. package/dist/templates/types.d.ts.map +1 -0
  376. package/dist/testing/index.d.ts +539 -0
  377. package/dist/testing/index.d.ts.map +1 -0
  378. package/dist/types/index.d.ts +116 -0
  379. package/dist/types/index.d.ts.map +1 -0
  380. package/dist/validation/index.d.ts +89 -0
  381. package/dist/validation/index.d.ts.map +1 -0
  382. package/dist/validation/schemas.d.ts +243 -0
  383. package/dist/validation/schemas.d.ts.map +1 -0
  384. package/dist/websocket/index.d.ts +252 -0
  385. package/dist/websocket/index.d.ts.map +1 -0
  386. package/package.json +3 -3
  387. package/src/cli/commands/add-frontend.ts +444 -0
  388. package/src/cli/commands/new.ts +23 -0
  389. package/src/cli/index.ts +1 -0
  390. package/src/cli/templates/frontend/react.ts +2 -1
  391. package/src/cli/templates/frontend/solid.ts +2 -1
  392. package/src/cli/templates/frontend/svelte.ts +2 -1
  393. package/src/cli/templates/frontend/vue.ts +2 -1
  394. package/src/cli/templates/project/api.ts +1 -1
  395. package/src/cli/templates/project/default.ts +1 -1
  396. package/src/cli/templates/project/fullstack.ts +14 -104
  397. package/src/cli/templates/project/website.ts +62 -11
  398. package/tsconfig.declaration.json +14 -0
@@ -0,0 +1,252 @@
1
+ /**
2
+ * GraphQL Module Types
3
+ *
4
+ * Core type definitions for the Bueno GraphQL integration layer.
5
+ */
6
+ export type Constructor<T = unknown> = new (...args: unknown[]) => T;
7
+ /**
8
+ * Represents a GraphQL scalar type via its JS constructor.
9
+ * Usage: () => String, () => Number, () => Boolean, () => GraphQLID
10
+ */
11
+ export type GraphQLScalar = StringConstructor | NumberConstructor | BooleanConstructor | typeof GraphQLID | typeof GraphQLInt | typeof GraphQLFloat;
12
+ /**
13
+ * A thunk that returns a type constructor or array of constructors.
14
+ * Used to avoid circular reference issues in type definitions.
15
+ *
16
+ * @example
17
+ * () => String // GraphQL String scalar
18
+ * () => Number // GraphQL Float scalar
19
+ * () => [User] // [User!]! list
20
+ * () => User // User object type
21
+ */
22
+ export type TypeFn = () => Constructor | Constructor[] | GraphQLScalar;
23
+ /**
24
+ * Sentinel class representing GraphQL ID scalar.
25
+ * Usage: @Field(() => GraphQLID)
26
+ */
27
+ export declare class GraphQLID {
28
+ static readonly __type = "ID";
29
+ }
30
+ /**
31
+ * Sentinel class representing GraphQL Int scalar.
32
+ * Usage: @Field(() => GraphQLInt)
33
+ */
34
+ export declare class GraphQLInt {
35
+ static readonly __type = "Int";
36
+ }
37
+ /**
38
+ * Sentinel class representing GraphQL Float scalar.
39
+ * Usage: @Field(() => GraphQLFloat)
40
+ */
41
+ export declare class GraphQLFloat {
42
+ static readonly __type = "Float";
43
+ }
44
+ /** Options for @Field decorator */
45
+ export interface FieldDecoratorOptions {
46
+ /** Whether the field can be null (default: false → non-null) */
47
+ nullable?: boolean;
48
+ /** Human-readable description */
49
+ description?: string;
50
+ /** Deprecation reason */
51
+ deprecationReason?: string;
52
+ /** Default value for input types */
53
+ defaultValue?: unknown;
54
+ }
55
+ /** Options for @Query/@Mutation/@Subscription decorators */
56
+ export interface FieldOptions extends FieldDecoratorOptions {
57
+ /** GraphQL field name override (default: method name) */
58
+ name?: string;
59
+ }
60
+ /** Metadata stored per @Field-decorated property */
61
+ export interface FieldMetadata {
62
+ propertyKey: string;
63
+ typeFn: TypeFn;
64
+ nullable: boolean;
65
+ description?: string;
66
+ deprecationReason?: string;
67
+ defaultValue?: unknown;
68
+ }
69
+ /** Metadata for a single resolver method parameter */
70
+ export interface ParamMetadata {
71
+ index: number;
72
+ kind: "args" | "argsObject" | "context";
73
+ /** For @Args('name') — the specific argument name */
74
+ argName?: string;
75
+ /** For @Args('name', InputType) — the input object type */
76
+ inputTypeFn?: TypeFn;
77
+ }
78
+ /** Metadata stored per @Query/@Mutation/@Subscription method */
79
+ export interface ResolverFieldMetadata {
80
+ /** Actual method name on the class */
81
+ methodName: string;
82
+ /** GraphQL field name (defaults to methodName) */
83
+ fieldName: string;
84
+ typeFn: TypeFn;
85
+ kind: "query" | "mutation" | "subscription";
86
+ nullable: boolean;
87
+ description?: string;
88
+ deprecationReason?: string;
89
+ paramMetadata: ParamMetadata[];
90
+ }
91
+ /** Metadata stored per @Resolver-decorated class */
92
+ export interface ResolverClassMetadata {
93
+ /** GraphQL type name (default: class name) */
94
+ name: string;
95
+ }
96
+ /** Metadata stored per @ObjectType / @InputType class */
97
+ export interface TypeClassMetadata {
98
+ name: string;
99
+ kind: "object" | "input";
100
+ description?: string;
101
+ }
102
+ /** A single resolvable field in the built schema */
103
+ export interface ResolvedField {
104
+ resolverInstance: unknown;
105
+ methodName: string;
106
+ paramMetadata: ParamMetadata[];
107
+ typeFn: TypeFn;
108
+ nullable: boolean;
109
+ }
110
+ /** Internal schema representation consumed by the built-in engine */
111
+ export interface ResolvedSchema {
112
+ queryFields: Map<string, ResolvedField>;
113
+ mutationFields: Map<string, ResolvedField>;
114
+ subscriptionFields: Map<string, ResolvedField>;
115
+ }
116
+ /** Context available inside resolver methods */
117
+ export interface GraphQLContext {
118
+ /** The original HTTP Request */
119
+ request: Request;
120
+ /** Authenticated user (set by auth guards via context.set('user', ...)) */
121
+ user?: unknown;
122
+ /** Reference to the HTTP Context for advanced use */
123
+ httpContext: unknown;
124
+ /** Allow arbitrary values */
125
+ [key: string]: unknown;
126
+ }
127
+ /** A GraphQL error entry in the response */
128
+ export interface GraphQLError {
129
+ message: string;
130
+ locations?: Array<{
131
+ line: number;
132
+ column: number;
133
+ }>;
134
+ path?: Array<string | number>;
135
+ extensions?: Record<string, unknown>;
136
+ }
137
+ /** The GraphQL response envelope */
138
+ export interface GraphQLResult {
139
+ data?: Record<string, unknown> | null;
140
+ errors?: GraphQLError[];
141
+ }
142
+ /**
143
+ * Pluggable GraphQL execution engine.
144
+ * Implement this interface to use graphql-js, GraphQL Yoga, Mercurius, etc.
145
+ *
146
+ * @example
147
+ * ```typescript
148
+ * import * as graphqlJs from 'graphql';
149
+ * import { GraphQLJsAdapter } from '@buenojs/bueno/graphql';
150
+ *
151
+ * GraphQLModule.setup(app, {
152
+ * engine: new GraphQLJsAdapter(graphqlJs),
153
+ * resolvers: [UserResolver],
154
+ * });
155
+ * ```
156
+ */
157
+ export interface GraphQLEngine {
158
+ /**
159
+ * Build the internal schema representation from resolver and type metadata.
160
+ * Returns an opaque schema object that is passed back to execute().
161
+ */
162
+ buildSchema(resolvers: ResolverFieldsByType, types: Map<string, FieldMetadata[]>, sdl: string): unknown;
163
+ /**
164
+ * Execute a GraphQL query or mutation.
165
+ */
166
+ execute(schema: unknown, query: string, variables: Record<string, unknown>, context: GraphQLContext, operationName?: string): Promise<GraphQLResult>;
167
+ /**
168
+ * Execute a GraphQL subscription (optional).
169
+ * Returns an async generator that yields results.
170
+ */
171
+ subscribe?(schema: unknown, query: string, variables: Record<string, unknown>, context: GraphQLContext, operationName?: string): Promise<AsyncGenerator<GraphQLResult>>;
172
+ /**
173
+ * Whether this engine supports introspection queries.
174
+ * Used to determine if the GraphQL Playground should be enabled.
175
+ */
176
+ readonly supportsIntrospection: boolean;
177
+ /**
178
+ * Whether this engine supports subscriptions.
179
+ */
180
+ readonly supportsSubscriptions: boolean;
181
+ }
182
+ /** Resolver fields organized by root type */
183
+ export interface ResolverFieldsByType {
184
+ queries: Map<string, ResolvedField>;
185
+ mutations: Map<string, ResolvedField>;
186
+ subscriptions: Map<string, ResolvedField>;
187
+ }
188
+ /**
189
+ * Options passed to GraphQLModule.setup()
190
+ */
191
+ export interface GraphQLModuleOptions {
192
+ /**
193
+ * Resolver classes to register.
194
+ * Dependencies are resolved from the DI container.
195
+ */
196
+ resolvers: Constructor[];
197
+ /**
198
+ * GraphQL engine adapter (default: built-in lightweight engine).
199
+ * Use GraphQLJsAdapter for full spec compliance.
200
+ */
201
+ engine?: GraphQLEngine;
202
+ /**
203
+ * HTTP path for the GraphQL endpoint (default: '/graphql').
204
+ */
205
+ path?: string;
206
+ /**
207
+ * Enable GraphiQL playground UI at GET <path>.
208
+ * Default: true when using an engine with supportsIntrospection,
209
+ * false when using the built-in engine.
210
+ * Set to true to force-enable even with the built-in engine (with warning).
211
+ */
212
+ playground?: boolean;
213
+ /**
214
+ * Serve the SDL at GET <path>/schema (default: true).
215
+ */
216
+ introspection?: boolean;
217
+ /**
218
+ * Enable WebSocket subscriptions (default: false).
219
+ * Requires an engine with supportsSubscriptions.
220
+ */
221
+ subscriptions?: boolean;
222
+ /**
223
+ * Sync @Field metadata to the OpenAPI property store (default: false).
224
+ * Enables unified types: one class works for both GraphQL and REST/OpenAPI.
225
+ * Requires @buenojs/bueno/openapi to be in scope.
226
+ */
227
+ syncOpenAPI?: boolean;
228
+ /** Maximum query complexity score (default: 1000) */
229
+ complexityLimit?: number;
230
+ /** Maximum query depth (default: 10) */
231
+ maxDepth?: number;
232
+ }
233
+ /**
234
+ * GraphQL configuration added to BuenoConfig.
235
+ */
236
+ export interface GraphQLConfig {
237
+ /** Enable GraphQL support (default: false) */
238
+ enabled?: boolean;
239
+ /** HTTP path (default: '/graphql') */
240
+ path?: string;
241
+ /** Enable playground (default: auto) */
242
+ playground?: boolean;
243
+ /** Enable introspection SDL endpoint (default: true) */
244
+ introspection?: boolean;
245
+ /** Maximum query complexity (default: 1000) */
246
+ complexityLimit?: number;
247
+ /** Maximum query depth (default: 10) */
248
+ maxDepth?: number;
249
+ /** Enable subscriptions (default: false) */
250
+ subscriptions?: boolean;
251
+ }
252
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/graphql/types.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH,MAAM,MAAM,WAAW,CAAC,CAAC,GAAG,OAAO,IAAI,KAAK,GAAG,IAAI,EAAE,OAAO,EAAE,KAAK,CAAC,CAAC;AAIrE;;;GAGG;AACH,MAAM,MAAM,aAAa,GACtB,iBAAiB,GACjB,iBAAiB,GACjB,kBAAkB,GAClB,OAAO,SAAS,GAChB,OAAO,UAAU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+ * Health Check System
3
+ *
4
+ * Provides health check endpoints for production monitoring:
5
+ * - /health (liveness probe) - Returns 200 if server is running
6
+ * - /ready (readiness probe) - Returns 200 only if all checks pass
7
+ */
8
+ import type { Middleware } from "../middleware";
9
+ /**
10
+ * Health check status
11
+ */
12
+ export type HealthStatus = "healthy" | "unhealthy" | "degraded";
13
+ /**
14
+ * Individual check result
15
+ */
16
+ export interface CheckResult {
17
+ status: HealthStatus;
18
+ latency?: number;
19
+ message?: string;
20
+ }
21
+ /**
22
+ * Overall health check result
23
+ */
24
+ export interface HealthCheckResult {
25
+ status: HealthStatus;
26
+ timestamp: string;
27
+ version?: string;
28
+ uptime?: number;
29
+ checks?: Record<string, CheckResult>;
30
+ }
31
+ /**
32
+ * Health check function type
33
+ */
34
+ export type HealthCheckFn = () => Promise<CheckResult> | CheckResult;
35
+ /**
36
+ * Options for individual health checks
37
+ */
38
+ export interface CheckOptions {
39
+ /** Whether this check is critical for readiness (default: true) */
40
+ critical?: boolean;
41
+ /** Timeout in milliseconds (default: 5000) */
42
+ timeout?: number;
43
+ /** Description of the check */
44
+ description?: string;
45
+ }
46
+ /**
47
+ * Options for health middleware
48
+ */
49
+ export interface HealthMiddlewareOptions {
50
+ /** Path for liveness probe (default: /health) */
51
+ healthPath?: string;
52
+ /** Path for readiness probe (default: /ready) */
53
+ readyPath?: string;
54
+ /** Whether to expose metrics in response (default: true) */
55
+ exposeMetrics?: boolean;
56
+ /** Initial health checks to register */
57
+ checks?: Record<string, HealthCheckFn | {
58
+ fn: HealthCheckFn;
59
+ options?: CheckOptions;
60
+ }>;
61
+ /** Custom version string (default: from package.json) */
62
+ version?: string;
63
+ }
64
+ /**
65
+ * Database interface for built-in checker
66
+ */
67
+ export interface DatabaseLike {
68
+ query?(sql: string): Promise<unknown>;
69
+ execute?(sql: string): Promise<unknown>;
70
+ healthCheck?(): Promise<boolean>;
71
+ }
72
+ /**
73
+ * Cache interface for built-in checker
74
+ */
75
+ export interface CacheLike {
76
+ get?(key: string): Promise<unknown>;
77
+ set?(key: string, value: unknown): Promise<unknown>;
78
+ ping?(): Promise<unknown>;
79
+ healthCheck?(): Promise<boolean>;
80
+ }
81
+ /**
82
+ * Manages health checks for the application
83
+ */
84
+ export declare class HealthCheckManager {
85
+ private checks;
86
+ private startTime;
87
+ private version;
88
+ constructor(version?: string);
89
+ /**
90
+ * Register a health check
91
+ */
92
+ registerCheck(name: string, checkFn: HealthCheckFn, options?: CheckOptions): this;
93
+ /**
94
+ * Remove a health check
95
+ */
96
+ removeCheck(name: string): boolean;
97
+ /**
98
+ * Get all registered check names
99
+ */
100
+ getCheckNames(): string[];
101
+ /**
102
+ * Check if a check is registered
103
+ */
104
+ hasCheck(name: string): boolean;
105
+ /**
106
+ * Run a single check with timeout
107
+ */
108
+ private runSingleCheck;
109
+ /**
110
+ * Execute all registered checks
111
+ */
112
+ runChecks(): Promise<Record<string, CheckResult>>;
113
+ /**
114
+ * Get liveness status (lightweight - no dependency checks)
115
+ */
116
+ getHealth(): HealthCheckResult;
117
+ /**
118
+ * Get readiness status (runs all checks)
119
+ */
120
+ getReadiness(): Promise<HealthCheckResult>;
121
+ /**
122
+ * Get uptime in seconds
123
+ */
124
+ getUptime(): number;
125
+ /**
126
+ * Reset start time (useful for testing)
127
+ */
128
+ resetStartTime(): void;
129
+ }
130
+ /**
131
+ * Create health check middleware
132
+ */
133
+ export declare function createHealthMiddleware(options?: HealthMiddlewareOptions): {
134
+ middleware: Middleware;
135
+ manager: HealthCheckManager;
136
+ };
137
+ /**
138
+ * Create a database connectivity check
139
+ */
140
+ export declare function createDatabaseCheck(db: DatabaseLike, options?: {
141
+ query?: string;
142
+ timeout?: number;
143
+ }): HealthCheckFn;
144
+ /**
145
+ * Create a cache connectivity check
146
+ */
147
+ export declare function createCacheCheck(cache: CacheLike, options?: {
148
+ testKey?: string;
149
+ timeout?: number;
150
+ }): HealthCheckFn;
151
+ /**
152
+ * Create a custom health check with timeout
153
+ */
154
+ export declare function createCustomCheck(checkFn: () => Promise<boolean> | boolean, options?: {
155
+ message?: string;
156
+ timeout?: number;
157
+ }): HealthCheckFn;
158
+ /**
159
+ * Create a TCP port check
160
+ */
161
+ export declare function createTCPCheck(host: string, port: number, options?: {
162
+ timeout?: number;
163
+ }): HealthCheckFn;
164
+ /**
165
+ * Create an HTTP endpoint check
166
+ */
167
+ export declare function createHTTPCheck(url: string, options?: {
168
+ expectedStatus?: number;
169
+ timeout?: number;
170
+ headers?: Record<string, string>;
171
+ }): HealthCheckFn;
172
+ /**
173
+ * Create a new health check manager
174
+ */
175
+ export declare function createHealthManager(version?: string): HealthCheckManager;
176
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/health/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAIhD;;GAEG;AACH,MAAM,MAAM,YAAY,GAAG,SAAS,GAAG,WAAW,GAAG,UAAU,CAAC;AAEhE;;GAEG;AACH,MAAM,WAAW,WAAW;IAC3B,MAAM,EAAE,YAAY,CAAC;IACrB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;CACjB;AAED;;GAEG;AACH,MAAM,WAAW,iBAAiB;IACjC,MAAM,EAAE,YAAY,CAAC;IACrB,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,WAAW,CAAC,CAAC;CACrC;AAED;;GAEG;AACH,MAAM,MAAM,aAAa,GAAG,MAAM,OAAO,CAAC,WAAW,CAAC,GAAG,WAAW,CAAC;AAErE;;GAEG;AACH,MAAM,WAAW,YAAY;IAC5B,mEAAmE;IACnE,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,8CAA8C;IA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C,EAAE,MAAM,CAAA;CAAO,GAClD,aAAa,CAqBf;AAED;;GAEG;AACH,wBAAgB,cAAc,CAC7B,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,MAAM,EACZ,OAAO,GAAE;IAAE,OAAO,CAAC,EAAE,MAAM,CAAA;CAAO,GAChC,aAAa,CA+Bf;AAED;;GAEG;AACH,wBAAgB,eAAe,CAC9B,GAAG,EAAE,MAAM,EACX,OAAO,GAAE;IACR,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CAC5B,GACJ,aAAa,CAuCf;AAID;;GAEG;AACH,wBAAgB,mBAAmB,CAAC,OAAO,CAAC,EAAE,MAAM,GAAG,kBAAkB,CAExE"}
@@ -0,0 +1,105 @@
1
+ /**
2
+ * i18n Engine — Translation Lookup and Interpolation
3
+ *
4
+ * Orchestrates locale loading and exposes the t() translation function.
5
+ * Handles pluralisation, variable interpolation, fallback, and metrics.
6
+ */
7
+ import { LocaleNegotiator } from "./negotiator";
8
+ import type { I18nConfig, I18nMetrics, ResolvedI18nConfig, TranslationFunction, TranslationParams } from "./types";
9
+ /**
10
+ * Main i18n engine.
11
+ * Handles translation lookup, plural forms, interpolation, and caching.
12
+ *
13
+ * Usage:
14
+ * ```
15
+ * const i18n = new I18n({ defaultLocale: 'en', supportedLocales: ['en', 'fr'] });
16
+ * i18n.preload(); // optional
17
+ * const t = i18n.createTranslator('fr');
18
+ * console.log(t('greeting', { name: 'Alice' })); // from fr.json
19
+ * ```
20
+ */
21
+ export declare class I18n {
22
+ private loader;
23
+ private negotiator;
24
+ readonly config: ResolvedI18nConfig;
25
+ private metrics;
26
+ /**
27
+ * Create an i18n engine.
28
+ * @param config Optional configuration (all fields are optional)
29
+ */
30
+ constructor(config?: I18nConfig);
31
+ /**
32
+ * Pre-load all supported locale files at startup.
33
+ * Optional — lazy loading works without calling this.
34
+ * Useful for production to catch missing files early.
35
+ */
36
+ preload(): void;
37
+ /**
38
+ * Enable hot-reload file watching for all supported locales.
39
+ * Should only be called in development mode.
40
+ */
41
+ watchAll(): void;
42
+ /**
43
+ * Stop all file watchers.
44
+ * Call this when the application shuts down.
45
+ */
46
+ stopWatching(): void;
47
+ /**
48
+ * Return a bound translation function for the given locale.
49
+ * This is what gets stored on context: ctx.set('t', ...)
50
+ *
51
+ * @param locale Locale to create translator for
52
+ * @returns TranslationFunction bound to that locale
53
+ */
54
+ createTranslator(locale: string): TranslationFunction;
55
+ /**
56
+ * Primary translation lookup.
57
+ *
58
+ * Resolution order:
59
+ * 1. Check `locale` translations
60
+ * a. If `params.count` is provided, try plural key first ({key}_one, {key}_other, etc.)
61
+ * b. Then try bare key
62
+ * 2. If fallbackToDefault and locale !== defaultLocale, repeat step 1 for defaultLocale
63
+ * 3. Return the key string as last resort
64
+ *
65
+ * Metrics are tracked: hits (found in locale), fallbacks (found in default),
66
+ * misses (returned key string).
67
+ *
68
+ * @param locale Locale to translate in
69
+ * @param key Translation key (supports dot-notation for nested keys)
70
+ * @param params Optional translation parameters (interpolation + plural count)
71
+ * @returns Translated string, or key string if not found
72
+ */
73
+ t(locale: string, key: string, params?: TranslationParams): string;
74
+ /**
75
+ * Returns the LocaleNegotiator instance for use by middleware.
76
+ * @returns LocaleNegotiator instance
77
+ */
78
+ getNegotiator(): LocaleNegotiator;
79
+ /**
80
+ * Get current translation metrics.
81
+ * Useful for debugging and performance monitoring.
82
+ * @returns Current I18nMetrics
83
+ */
84
+ getMetrics(): I18nMetrics;
85
+ /**
86
+ * Resolve a translation key in a specific locale.
87
+ * Returns null if not found (to distinguish from a successful empty string).
88
+ *
89
+ * @param locale Locale to resolve in
90
+ * @param key Translation key
91
+ * @param params Translation parameters
92
+ * @param hasCount Whether params contains a count field
93
+ * @returns Translated string, or null if not found
94
+ */
95
+ private _resolve;
96
+ }
97
+ /**
98
+ * Create an i18n engine.
99
+ * Convenience factory for new I18n(config).
100
+ *
101
+ * @param config Optional configuration
102
+ * @returns New I18n instance
103
+ */
104
+ export declare function createI18n(config?: I18nConfig): I18n;
105
+ //# sourceMappingURL=engine.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"engine.d.ts","sourceRoot":"","sources":["../../src/i18n/engine.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAChD,OAAO,KAAK,EACX,UAAU,EACV,WAAW,EAEX,kBAAkB,EAClB,mBAAmB,EACnB,iBAAiB,EACjB,MAAM,SAAS,CAAC;AAkFjB;;;;;;;;;;;GAWG;AACH,qBAAa,IAAI;IAChB,OAAO,CAAC,MAAM,CAAoB;IAClC,OAAO,CAAC,UAAU,CAAmB;IACrC,QAAQ,CAAC,MAAM,EAAE,kBAAkB,CAAC;IACpC,OAAO,CAAC,OAAO,CAMb;IAEF;;;OAGG;gBACS,MAAM,GAAE,UAAe;IAmBnC;;;;OAIG;IACH,OAAO,IAAI,IAAI;IAIf;;;OAGG;IACH,QAAQ,IAAI,IAAI;IAMhB;;;OAGG;IACH,YAAY,IAAI,IAAI;IAIpB;;;;;;OAMG;IACH,gBAAgB,CAAC,MAAM,EAAE,MAAM,GAAG,mBAAmB;IAMrD;;;;;;;;;;;;;;;;;OAiBG;IACH,CAAC,CAAC,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,iBAAiB,GAAG,MAAM;IAkClE;;;OAGG;IACH,aAAa,IAAI,gBAAgB;IAIjC;;;;OAIG;IACH,UAAU,IAAI,WAAW;IASzB;;;;;;;;;OASG;IACH,OAAO,CAAC,QAAQ;CAsBhB;AAID;;;;;;GAMG;AACH,wBAAgB,UAAU,CAAC,MAAM,CAAC,EAAE,UAAU,GAAG,IAAI,CAEpD"}
@@ -0,0 +1,13 @@
1
+ /**
2
+ * i18n Module — Internationalisation for Bueno Framework
3
+ *
4
+ * Locale detection (cookie → Accept-Language), translation lookup with
5
+ * dot-notation keys, variable interpolation, plural forms, and caching.
6
+ */
7
+ export type { PluralKey, TranslationMap, FlatTranslations, TranslationParams, TranslationFunction, LocaleMatch, I18nContext, I18nConfig, ResolvedI18nConfig, LocaleBundle, I18nMetrics, } from "./types";
8
+ export { I18n, createI18n } from "./engine";
9
+ export { TranslationLoader } from "./loader";
10
+ export { LocaleNegotiator, parseAcceptLanguage, normaliseLocale, } from "./negotiator";
11
+ export { i18nMiddleware, getLocale, getT } from "./middleware";
12
+ export type { I18nMiddlewareOptions } from "./middleware";
13
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/i18n/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,YAAY,EACX,SAAS,EACT,cAAc,EACd,gBAAgB,EAChB,iBAAiB,EACjB,mBAAmB,EACnB,WAAW,EACX,WAAW,EACX,UAAU,EACV,kBAAkB,EAClB,YAAY,EACZ,WAAW,GACX,MAAM,SAAS,CAAC;AAGjB,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAG5C,OAAO,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAG7C,OAAO,EACN,gBAAgB,EAChB,mBAAmB,EACnB,eAAe,GACf,MAAM,cAAc,CAAC;AAGtB,OAAO,EAAE,cAAc,EAAE,SAAS,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAC/D,YAAY,EAAE,qBAAqB,EAAE,MAAM,cAAc,CAAC"}
@@ -0,0 +1,79 @@
1
+ /**
2
+ * Translation Loader — JSON File Loading and Caching
3
+ *
4
+ * Loads locale JSON files from disk, flattens nested keys to dot-notation,
5
+ * caches in memory, and supports hot-reload via file watching.
6
+ */
7
+ import type { LocaleBundle, ResolvedI18nConfig } from "./types";
8
+ /**
9
+ * Loads and caches locale translation bundles from JSON files.
10
+ * Supports file watching for hot-reload in development.
11
+ */
12
+ export declare class TranslationLoader {
13
+ private cache;
14
+ private watchers;
15
+ private config;
16
+ constructor(config: ResolvedI18nConfig);
17
+ /**
18
+ * Load a locale bundle. Returns from cache if already loaded.
19
+ *
20
+ * For the default locale:
21
+ * - Throws if the file is not found (cannot proceed without defaults)
22
+ *
23
+ * For non-default locales:
24
+ * - Returns an empty bundle if the file is not found
25
+ * - Fallback in the engine will handle the miss
26
+ *
27
+ * @param locale Locale identifier to load
28
+ * @returns LocaleBundle with flattened translations
29
+ * @throws Error if default locale file is not found
30
+ */
31
+ load(locale: string): LocaleBundle;
32
+ /**
33
+ * Pre-load all supported locales eagerly.
34
+ * Call this once at application startup for best performance.
35
+ *
36
+ * Non-default locales that are missing are silently skipped
37
+ * (returning empty bundles).
38
+ */
39
+ preload(): void;
40
+ /**
41
+ * Invalidate a locale's cache entry.
42
+ * Forces a reload from disk on the next access.
43
+ *
44
+ * @param locale Locale to invalidate
45
+ */
46
+ invalidate(locale: string): void;
47
+ /**
48
+ * Return all currently loaded locale names.
49
+ *
50
+ * @returns Array of loaded locale identifiers
51
+ */
52
+ loadedLocales(): string[];
53
+ /**
54
+ * Enable file watching for a locale (hot reload in dev mode).
55
+ * Invalidates cache and reloads on file change.
56
+ *
57
+ * @param locale Locale file to watch
58
+ */
59
+ watch(locale: string): void;
60
+ /**
61
+ * Stop all file watchers.
62
+ * Call this when the application shuts down.
63
+ */
64
+ stopWatching(): void;
65
+ /**
66
+ * Resolve the full file path for a locale.
67
+ * @param locale Locale identifier
68
+ * @returns Full file path to the locale JSON file
69
+ */
70
+ private _resolvePath;
71
+ /**
72
+ * Load a locale file from disk and cache it.
73
+ * @param locale Locale to load
74
+ * @returns LocaleBundle with flattened translations
75
+ * @throws Error if default locale file is not found or JSON is invalid
76
+ */
77
+ private _loadFromDisk;
78
+ }
79
+ //# sourceMappingURL=loader.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"loader.d.ts","sourceRoot":"","sources":["../../src/i18n/loader.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAIH,OAAO,KAAK,EAEX,YAAY,EACZ,kBAAkB,EAClB,MAAM,SAAS,CAAC;AAsCjB;;;GAGG;AACH,qBAAa,iBAAiB;IAC7B,OAAO,CAAC,KAAK,CAAwC;IACrD,OAAO,CAAC,QAAQ,CAAoD;IACpE,OAAO,CAAC,MAAM,CAAqB;gBAEvB,MAAM,EAAE,kBAAkB;IAItC;;;;;;;;;;;;;OAaG;IACH,IAAI,CAAC,MAAM,EAAE,MAAM,GAAG,YAAY;IAOlC;;;;;;OAMG;IACH,OAAO,IAAI,IAAI;IAiBf;;;;;OAKG;IACH,UAAU,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI;IAIhC;;;;OAIG;IACH,aAAa,IAAI,MAAM,EAAE;IAIzB;;;;;OAKG;IACH,KAAK,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI;IAiB3B;;;OAGG;IACH,YAAY,IAAI,IAAI;IASpB;;;;OAIG;IACH,OAAO,CAAC,YAAY;IAIpB;;;;;OAKG;IACH,OAAO,CAAC,aAAa;CAsCrB"}