@xtandard/kit 0.0.0-stage → 0.1.0

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 (402) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +71 -2
  3. package/bin/xtandard-kit.mjs +3 -0
  4. package/dist/base-path-BJugWLNO.cjs +42 -0
  5. package/dist/base-path-BJugWLNO.cjs.map +1 -0
  6. package/dist/base-path-CDb4In5E.mjs +31 -0
  7. package/dist/base-path-CDb4In5E.mjs.map +1 -0
  8. package/dist/basic-Qtriv0xS.mjs +176 -0
  9. package/dist/basic-Qtriv0xS.mjs.map +1 -0
  10. package/dist/basic-ZaO92-lB.cjs +199 -0
  11. package/dist/basic-ZaO92-lB.cjs.map +1 -0
  12. package/dist/bin.cjs +126 -0
  13. package/dist/bin.cjs.map +1 -0
  14. package/dist/bin.d.cts +20 -0
  15. package/dist/bin.d.mts +20 -0
  16. package/dist/bin.mjs +125 -0
  17. package/dist/bin.mjs.map +1 -0
  18. package/dist/cas-CuPSaXBV.cjs +23 -0
  19. package/dist/cas-CuPSaXBV.cjs.map +1 -0
  20. package/dist/cas-CzA-yECx.mjs +18 -0
  21. package/dist/cas-CzA-yECx.mjs.map +1 -0
  22. package/dist/chunk-DakpK96I.cjs +43 -0
  23. package/dist/contract-B3UPXXLx.d.cts +30 -0
  24. package/dist/contract-B3UPXXLx.d.mts +30 -0
  25. package/dist/contract-BDPNvjtp.d.mts +64 -0
  26. package/dist/contract-BEdfGTPs.mjs +85 -0
  27. package/dist/contract-BEdfGTPs.mjs.map +1 -0
  28. package/dist/contract-BIVzAn4f.d.cts +64 -0
  29. package/dist/contract-BvgtswLX.d.cts +75 -0
  30. package/dist/contract-BvgtswLX.d.mts +75 -0
  31. package/dist/contract-DUj9P3Vt.d.cts +72 -0
  32. package/dist/contract-DUj9P3Vt.d.mts +72 -0
  33. package/dist/contract-wAEMDmYG.cjs +132 -0
  34. package/dist/contract-wAEMDmYG.cjs.map +1 -0
  35. package/dist/drizzle-BElCHWri.d.mts +115 -0
  36. package/dist/drizzle-BXaQXCr0.cjs +232 -0
  37. package/dist/drizzle-BXaQXCr0.cjs.map +1 -0
  38. package/dist/drizzle-CEpahWQB.d.cts +115 -0
  39. package/dist/drizzle-DxnelsPT.mjs +197 -0
  40. package/dist/drizzle-DxnelsPT.mjs.map +1 -0
  41. package/dist/duration-7WpAK-xe.mjs +52 -0
  42. package/dist/duration-7WpAK-xe.mjs.map +1 -0
  43. package/dist/duration-DVA0Fzkx.cjs +63 -0
  44. package/dist/duration-DVA0Fzkx.cjs.map +1 -0
  45. package/dist/duration-FPwbmWIU.d.cts +35 -0
  46. package/dist/duration-FPwbmWIU.d.mts +35 -0
  47. package/dist/entry-adapters-bun.cjs +10 -0
  48. package/dist/entry-adapters-bun.cjs.map +1 -0
  49. package/dist/entry-adapters-bun.d.cts +10 -0
  50. package/dist/entry-adapters-bun.d.mts +10 -0
  51. package/dist/entry-adapters-bun.mjs +9 -0
  52. package/dist/entry-adapters-bun.mjs.map +1 -0
  53. package/dist/entry-adapters-elysia.cjs +54 -0
  54. package/dist/entry-adapters-elysia.cjs.map +1 -0
  55. package/dist/entry-adapters-elysia.d.cts +38 -0
  56. package/dist/entry-adapters-elysia.d.mts +38 -0
  57. package/dist/entry-adapters-elysia.mjs +53 -0
  58. package/dist/entry-adapters-elysia.mjs.map +1 -0
  59. package/dist/entry-adapters-express.cjs +27 -0
  60. package/dist/entry-adapters-express.cjs.map +1 -0
  61. package/dist/entry-adapters-express.d.cts +24 -0
  62. package/dist/entry-adapters-express.d.mts +24 -0
  63. package/dist/entry-adapters-express.mjs +26 -0
  64. package/dist/entry-adapters-express.mjs.map +1 -0
  65. package/dist/entry-adapters-hono.cjs +33 -0
  66. package/dist/entry-adapters-hono.cjs.map +1 -0
  67. package/dist/entry-adapters-hono.d.cts +36 -0
  68. package/dist/entry-adapters-hono.d.mts +36 -0
  69. package/dist/entry-adapters-hono.mjs +30 -0
  70. package/dist/entry-adapters-hono.mjs.map +1 -0
  71. package/dist/entry-adapters-next.cjs +19 -0
  72. package/dist/entry-adapters-next.cjs.map +1 -0
  73. package/dist/entry-adapters-next.d.cts +35 -0
  74. package/dist/entry-adapters-next.d.mts +35 -0
  75. package/dist/entry-adapters-next.mjs +18 -0
  76. package/dist/entry-adapters-next.mjs.map +1 -0
  77. package/dist/entry-adapters-node.cjs +7 -0
  78. package/dist/entry-adapters-node.d.cts +2 -0
  79. package/dist/entry-adapters-node.d.mts +2 -0
  80. package/dist/entry-adapters-node.mjs +2 -0
  81. package/dist/entry-auth-basic.cjs +5 -0
  82. package/dist/entry-auth-basic.d.cts +83 -0
  83. package/dist/entry-auth-basic.d.mts +83 -0
  84. package/dist/entry-auth-basic.mjs +2 -0
  85. package/dist/entry-auth-delegated.cjs +28 -0
  86. package/dist/entry-auth-delegated.cjs.map +1 -0
  87. package/dist/entry-auth-delegated.d.cts +36 -0
  88. package/dist/entry-auth-delegated.d.mts +36 -0
  89. package/dist/entry-auth-delegated.mjs +27 -0
  90. package/dist/entry-auth-delegated.mjs.map +1 -0
  91. package/dist/entry-auth-none.cjs +4 -0
  92. package/dist/entry-auth-none.d.cts +25 -0
  93. package/dist/entry-auth-none.d.mts +25 -0
  94. package/dist/entry-auth-none.mjs +2 -0
  95. package/dist/entry-auth.cjs +0 -0
  96. package/dist/entry-auth.d.cts +2 -0
  97. package/dist/entry-auth.d.mts +2 -0
  98. package/dist/entry-auth.mjs +1 -0
  99. package/dist/entry-authorization-delegated.cjs +27 -0
  100. package/dist/entry-authorization-delegated.cjs.map +1 -0
  101. package/dist/entry-authorization-delegated.d.cts +31 -0
  102. package/dist/entry-authorization-delegated.d.mts +31 -0
  103. package/dist/entry-authorization-delegated.mjs +26 -0
  104. package/dist/entry-authorization-delegated.mjs.map +1 -0
  105. package/dist/entry-authorization-none.cjs +3 -0
  106. package/dist/entry-authorization-none.d.cts +18 -0
  107. package/dist/entry-authorization-none.d.mts +18 -0
  108. package/dist/entry-authorization-none.mjs +2 -0
  109. package/dist/entry-authorization-roles.cjs +3 -0
  110. package/dist/entry-authorization-roles.d.cts +2 -0
  111. package/dist/entry-authorization-roles.d.mts +2 -0
  112. package/dist/entry-authorization-roles.mjs +2 -0
  113. package/dist/entry-authorization.cjs +35 -0
  114. package/dist/entry-authorization.cjs.map +1 -0
  115. package/dist/entry-authorization.d.cts +2 -0
  116. package/dist/entry-authorization.d.mts +2 -0
  117. package/dist/entry-authorization.mjs +34 -0
  118. package/dist/entry-authorization.mjs.map +1 -0
  119. package/dist/entry-build.cjs +481 -0
  120. package/dist/entry-build.cjs.map +1 -0
  121. package/dist/entry-build.d.cts +355 -0
  122. package/dist/entry-build.d.mts +355 -0
  123. package/dist/entry-build.mjs +460 -0
  124. package/dist/entry-build.mjs.map +1 -0
  125. package/dist/entry-cli.cjs +368 -0
  126. package/dist/entry-cli.cjs.map +1 -0
  127. package/dist/entry-cli.d.cts +275 -0
  128. package/dist/entry-cli.d.mts +275 -0
  129. package/dist/entry-cli.mjs +355 -0
  130. package/dist/entry-cli.mjs.map +1 -0
  131. package/dist/entry-drizzle-mysql.cjs +36 -0
  132. package/dist/entry-drizzle-mysql.cjs.map +1 -0
  133. package/dist/entry-drizzle-mysql.d.cts +55 -0
  134. package/dist/entry-drizzle-mysql.d.mts +55 -0
  135. package/dist/entry-drizzle-mysql.mjs +34 -0
  136. package/dist/entry-drizzle-mysql.mjs.map +1 -0
  137. package/dist/entry-drizzle-pg.cjs +38 -0
  138. package/dist/entry-drizzle-pg.cjs.map +1 -0
  139. package/dist/entry-drizzle-pg.d.cts +78 -0
  140. package/dist/entry-drizzle-pg.d.mts +78 -0
  141. package/dist/entry-drizzle-pg.mjs +36 -0
  142. package/dist/entry-drizzle-pg.mjs.map +1 -0
  143. package/dist/entry-drizzle-sqlite.cjs +20 -0
  144. package/dist/entry-drizzle-sqlite.cjs.map +1 -0
  145. package/dist/entry-drizzle-sqlite.d.cts +22 -0
  146. package/dist/entry-drizzle-sqlite.d.mts +22 -0
  147. package/dist/entry-drizzle-sqlite.mjs +19 -0
  148. package/dist/entry-drizzle-sqlite.mjs.map +1 -0
  149. package/dist/entry-hooks-log.cjs +32 -0
  150. package/dist/entry-hooks-log.cjs.map +1 -0
  151. package/dist/entry-hooks-log.d.cts +36 -0
  152. package/dist/entry-hooks-log.d.mts +36 -0
  153. package/dist/entry-hooks-log.mjs +31 -0
  154. package/dist/entry-hooks-log.mjs.map +1 -0
  155. package/dist/entry-hooks.cjs +10 -0
  156. package/dist/entry-hooks.d.cts +2 -0
  157. package/dist/entry-hooks.d.mts +2 -0
  158. package/dist/entry-hooks.mjs +2 -0
  159. package/dist/entry-server-router.cjs +235 -0
  160. package/dist/entry-server-router.cjs.map +1 -0
  161. package/dist/entry-server-router.d.cts +193 -0
  162. package/dist/entry-server-router.d.mts +193 -0
  163. package/dist/entry-server-router.mjs +228 -0
  164. package/dist/entry-server-router.mjs.map +1 -0
  165. package/dist/entry-server.cjs +344 -0
  166. package/dist/entry-server.cjs.map +1 -0
  167. package/dist/entry-server.d.cts +230 -0
  168. package/dist/entry-server.d.mts +230 -0
  169. package/dist/entry-server.mjs +322 -0
  170. package/dist/entry-server.mjs.map +1 -0
  171. package/dist/entry-site.cjs +1083 -0
  172. package/dist/entry-site.cjs.map +1 -0
  173. package/dist/entry-site.d.cts +336 -0
  174. package/dist/entry-site.d.mts +336 -0
  175. package/dist/entry-site.mjs +1060 -0
  176. package/dist/entry-site.mjs.map +1 -0
  177. package/dist/entry-storage-cloudflare-kv.cjs +51 -0
  178. package/dist/entry-storage-cloudflare-kv.cjs.map +1 -0
  179. package/dist/entry-storage-cloudflare-kv.d.cts +52 -0
  180. package/dist/entry-storage-cloudflare-kv.d.mts +52 -0
  181. package/dist/entry-storage-cloudflare-kv.mjs +50 -0
  182. package/dist/entry-storage-cloudflare-kv.mjs.map +1 -0
  183. package/dist/entry-storage-drizzle-internals.cjs +6 -0
  184. package/dist/entry-storage-drizzle-internals.d.cts +2 -0
  185. package/dist/entry-storage-drizzle-internals.d.mts +2 -0
  186. package/dist/entry-storage-drizzle-internals.mjs +2 -0
  187. package/dist/entry-storage-drizzle.cjs +4 -0
  188. package/dist/entry-storage-drizzle.d.cts +3 -0
  189. package/dist/entry-storage-drizzle.d.mts +3 -0
  190. package/dist/entry-storage-drizzle.mjs +2 -0
  191. package/dist/entry-storage-file.cjs +306 -0
  192. package/dist/entry-storage-file.cjs.map +1 -0
  193. package/dist/entry-storage-file.d.cts +76 -0
  194. package/dist/entry-storage-file.d.mts +76 -0
  195. package/dist/entry-storage-file.mjs +301 -0
  196. package/dist/entry-storage-file.mjs.map +1 -0
  197. package/dist/entry-storage-libsql-internals.cjs +7 -0
  198. package/dist/entry-storage-libsql-internals.d.cts +3 -0
  199. package/dist/entry-storage-libsql-internals.d.mts +3 -0
  200. package/dist/entry-storage-libsql-internals.mjs +3 -0
  201. package/dist/entry-storage-libsql.cjs +3 -0
  202. package/dist/entry-storage-libsql.d.cts +2 -0
  203. package/dist/entry-storage-libsql.d.mts +2 -0
  204. package/dist/entry-storage-libsql.mjs +2 -0
  205. package/dist/entry-storage-memory.cjs +78 -0
  206. package/dist/entry-storage-memory.cjs.map +1 -0
  207. package/dist/entry-storage-memory.d.cts +35 -0
  208. package/dist/entry-storage-memory.d.mts +35 -0
  209. package/dist/entry-storage-memory.mjs +77 -0
  210. package/dist/entry-storage-memory.mjs.map +1 -0
  211. package/dist/entry-storage-mongodb-internals.cjs +5 -0
  212. package/dist/entry-storage-mongodb-internals.d.cts +2 -0
  213. package/dist/entry-storage-mongodb-internals.d.mts +2 -0
  214. package/dist/entry-storage-mongodb-internals.mjs +2 -0
  215. package/dist/entry-storage-mongodb.cjs +3 -0
  216. package/dist/entry-storage-mongodb.d.cts +2 -0
  217. package/dist/entry-storage-mongodb.d.mts +2 -0
  218. package/dist/entry-storage-mongodb.mjs +2 -0
  219. package/dist/entry-storage-postgres-internals.cjs +6 -0
  220. package/dist/entry-storage-postgres-internals.d.cts +2 -0
  221. package/dist/entry-storage-postgres-internals.d.mts +2 -0
  222. package/dist/entry-storage-postgres-internals.mjs +2 -0
  223. package/dist/entry-storage-postgres.cjs +4 -0
  224. package/dist/entry-storage-postgres.d.cts +2 -0
  225. package/dist/entry-storage-postgres.d.mts +2 -0
  226. package/dist/entry-storage-postgres.mjs +2 -0
  227. package/dist/entry-storage-redis-internals.cjs +7 -0
  228. package/dist/entry-storage-redis-internals.d.cts +2 -0
  229. package/dist/entry-storage-redis-internals.d.mts +2 -0
  230. package/dist/entry-storage-redis-internals.mjs +2 -0
  231. package/dist/entry-storage-redis.cjs +4 -0
  232. package/dist/entry-storage-redis.d.cts +2 -0
  233. package/dist/entry-storage-redis.d.mts +2 -0
  234. package/dist/entry-storage-redis.mjs +2 -0
  235. package/dist/entry-storage-sqlite-internals.cjs +7 -0
  236. package/dist/entry-storage-sqlite-internals.d.cts +3 -0
  237. package/dist/entry-storage-sqlite-internals.d.mts +3 -0
  238. package/dist/entry-storage-sqlite-internals.mjs +3 -0
  239. package/dist/entry-storage-sqlite.cjs +3 -0
  240. package/dist/entry-storage-sqlite.d.cts +2 -0
  241. package/dist/entry-storage-sqlite.d.mts +2 -0
  242. package/dist/entry-storage-sqlite.mjs +2 -0
  243. package/dist/entry-storage-testing.cjs +801 -0
  244. package/dist/entry-storage-testing.cjs.map +1 -0
  245. package/dist/entry-storage-testing.d.cts +150 -0
  246. package/dist/entry-storage-testing.d.mts +150 -0
  247. package/dist/entry-storage-testing.mjs +790 -0
  248. package/dist/entry-storage-testing.mjs.map +1 -0
  249. package/dist/entry-storage-unstorage.cjs +78 -0
  250. package/dist/entry-storage-unstorage.cjs.map +1 -0
  251. package/dist/entry-storage-unstorage.d.cts +30 -0
  252. package/dist/entry-storage-unstorage.d.mts +30 -0
  253. package/dist/entry-storage-unstorage.mjs +77 -0
  254. package/dist/entry-storage-unstorage.mjs.map +1 -0
  255. package/dist/entry-storage.cjs +114 -0
  256. package/dist/entry-storage.cjs.map +1 -0
  257. package/dist/entry-storage.d.cts +152 -0
  258. package/dist/entry-storage.d.mts +152 -0
  259. package/dist/entry-storage.mjs +91 -0
  260. package/dist/entry-storage.mjs.map +1 -0
  261. package/dist/entry-testing.cjs +79 -0
  262. package/dist/entry-testing.cjs.map +1 -0
  263. package/dist/entry-testing.d.cts +55 -0
  264. package/dist/entry-testing.d.mts +55 -0
  265. package/dist/entry-testing.mjs +77 -0
  266. package/dist/entry-testing.mjs.map +1 -0
  267. package/dist/entry-tokens.cjs +4 -0
  268. package/dist/entry-tokens.d.cts +85 -0
  269. package/dist/entry-tokens.d.mts +85 -0
  270. package/dist/entry-tokens.mjs +2 -0
  271. package/dist/entry-ui-embed.cjs +131 -0
  272. package/dist/entry-ui-embed.cjs.map +1 -0
  273. package/dist/entry-ui-embed.d.cts +87 -0
  274. package/dist/entry-ui-embed.d.mts +87 -0
  275. package/dist/entry-ui-embed.mjs +127 -0
  276. package/dist/entry-ui-embed.mjs.map +1 -0
  277. package/dist/entry-ui.cjs +795 -0
  278. package/dist/entry-ui.cjs.map +1 -0
  279. package/dist/entry-ui.d.cts +574 -0
  280. package/dist/entry-ui.d.mts +574 -0
  281. package/dist/entry-ui.mjs +731 -0
  282. package/dist/entry-ui.mjs.map +1 -0
  283. package/dist/entry-util.cjs +145 -0
  284. package/dist/entry-util.cjs.map +1 -0
  285. package/dist/entry-util.d.cts +85 -0
  286. package/dist/entry-util.d.mts +85 -0
  287. package/dist/entry-util.mjs +130 -0
  288. package/dist/entry-util.mjs.map +1 -0
  289. package/dist/http-B_rTnLW9.cjs +235 -0
  290. package/dist/http-B_rTnLW9.cjs.map +1 -0
  291. package/dist/http-CxYM7kPT.d.mts +133 -0
  292. package/dist/http-DVdVI6kJ.mjs +164 -0
  293. package/dist/http-DVdVI6kJ.mjs.map +1 -0
  294. package/dist/http-XBVRk8uo.d.cts +133 -0
  295. package/dist/index.cjs +8 -0
  296. package/dist/index.cjs.map +1 -0
  297. package/dist/index.d.cts +6 -0
  298. package/dist/index.d.mts +6 -0
  299. package/dist/index.mjs +7 -0
  300. package/dist/index.mjs.map +1 -0
  301. package/dist/json-CCyzstIm.d.cts +44 -0
  302. package/dist/json-CCyzstIm.d.mts +44 -0
  303. package/dist/json-CM7TwYQ7.cjs +92 -0
  304. package/dist/json-CM7TwYQ7.cjs.map +1 -0
  305. package/dist/json-CmM1M5Kz.mjs +63 -0
  306. package/dist/json-CmM1M5Kz.mjs.map +1 -0
  307. package/dist/keys-Bwubabk0.mjs +73 -0
  308. package/dist/keys-Bwubabk0.mjs.map +1 -0
  309. package/dist/keys-DQrwxDKI.cjs +126 -0
  310. package/dist/keys-DQrwxDKI.cjs.map +1 -0
  311. package/dist/kv-sqlite-B6iTLOx2.d.cts +20 -0
  312. package/dist/kv-sqlite-CHOdIMJ-.cjs +77 -0
  313. package/dist/kv-sqlite-CHOdIMJ-.cjs.map +1 -0
  314. package/dist/kv-sqlite-DIIPfflJ.mjs +66 -0
  315. package/dist/kv-sqlite-DIIPfflJ.mjs.map +1 -0
  316. package/dist/kv-sqlite-Tx4UedJs.d.mts +20 -0
  317. package/dist/libsql-0160BubR.d.mts +65 -0
  318. package/dist/libsql-BZmRZIqt.d.cts +65 -0
  319. package/dist/libsql-CiBfVtbS.cjs +103 -0
  320. package/dist/libsql-CiBfVtbS.cjs.map +1 -0
  321. package/dist/libsql-CkOjQINi.mjs +86 -0
  322. package/dist/libsql-CkOjQINi.mjs.map +1 -0
  323. package/dist/mongodb--Cuj7V_9.cjs +150 -0
  324. package/dist/mongodb--Cuj7V_9.cjs.map +1 -0
  325. package/dist/mongodb-DGtsolQ2.d.cts +61 -0
  326. package/dist/mongodb-JMizy4Wg.mjs +127 -0
  327. package/dist/mongodb-JMizy4Wg.mjs.map +1 -0
  328. package/dist/mongodb-xGEU5Gwz.d.mts +61 -0
  329. package/dist/node-B1Djcwfi.d.cts +57 -0
  330. package/dist/node-B1Djcwfi.d.mts +57 -0
  331. package/dist/node-BYjocCbU.mjs +167 -0
  332. package/dist/node-BYjocCbU.mjs.map +1 -0
  333. package/dist/node-DFFqYRk-.cjs +201 -0
  334. package/dist/node-DFFqYRk-.cjs.map +1 -0
  335. package/dist/none-BEY7Kc_-.mjs +33 -0
  336. package/dist/none-BEY7Kc_-.mjs.map +1 -0
  337. package/dist/none-BoQ6-30P.cjs +33 -0
  338. package/dist/none-BoQ6-30P.cjs.map +1 -0
  339. package/dist/none-CHwVkQL-.cjs +49 -0
  340. package/dist/none-CHwVkQL-.cjs.map +1 -0
  341. package/dist/none-yu3qC47E.mjs +23 -0
  342. package/dist/none-yu3qC47E.mjs.map +1 -0
  343. package/dist/peer-BIjBFzwQ.cjs +56 -0
  344. package/dist/peer-BIjBFzwQ.cjs.map +1 -0
  345. package/dist/peer-CTHMzOdn.mjs +40 -0
  346. package/dist/peer-CTHMzOdn.mjs.map +1 -0
  347. package/dist/portal-container-CJIcau3B.mjs +610 -0
  348. package/dist/portal-container-CJIcau3B.mjs.map +1 -0
  349. package/dist/portal-container-Ca1NxrLE.cjs +774 -0
  350. package/dist/portal-container-Ca1NxrLE.cjs.map +1 -0
  351. package/dist/postgres-BJzxKBk0.d.cts +72 -0
  352. package/dist/postgres-CA8_XcAE.cjs +164 -0
  353. package/dist/postgres-CA8_XcAE.cjs.map +1 -0
  354. package/dist/postgres-RfQMgAsj.d.mts +72 -0
  355. package/dist/postgres-aDiBmNzr.mjs +135 -0
  356. package/dist/postgres-aDiBmNzr.mjs.map +1 -0
  357. package/dist/redis-B2AS4xAQ.cjs +259 -0
  358. package/dist/redis-B2AS4xAQ.cjs.map +1 -0
  359. package/dist/redis-B362ofBw.d.cts +159 -0
  360. package/dist/redis-CahNAVTW.d.mts +159 -0
  361. package/dist/redis-hdoKymfG.mjs +218 -0
  362. package/dist/redis-hdoKymfG.mjs.map +1 -0
  363. package/dist/roles-7JPrQXZa.mjs +46 -0
  364. package/dist/roles-7JPrQXZa.mjs.map +1 -0
  365. package/dist/roles-B_8QqJ3j.cjs +56 -0
  366. package/dist/roles-B_8QqJ3j.cjs.map +1 -0
  367. package/dist/roles-DLISB4T3.d.mts +41 -0
  368. package/dist/roles-DQbbtUPW.d.cts +41 -0
  369. package/dist/rolldown-runtime-D7D4PA-g.mjs +13 -0
  370. package/dist/scope-css-BN3jf0ly.cjs +315 -0
  371. package/dist/scope-css-BN3jf0ly.cjs.map +1 -0
  372. package/dist/scope-css-BuJfRCsE.mjs +256 -0
  373. package/dist/scope-css-BuJfRCsE.mjs.map +1 -0
  374. package/dist/scoped-BRoE1W1x.cjs +175 -0
  375. package/dist/scoped-BRoE1W1x.cjs.map +1 -0
  376. package/dist/scoped-cFBbotCh.mjs +164 -0
  377. package/dist/scoped-cFBbotCh.mjs.map +1 -0
  378. package/dist/sqlite-B2g1JJz1.d.cts +47 -0
  379. package/dist/sqlite-BIPIlxfj.d.mts +47 -0
  380. package/dist/sqlite-BntoYaXZ.cjs +79 -0
  381. package/dist/sqlite-BntoYaXZ.cjs.map +1 -0
  382. package/dist/sqlite-DYJDcu7p.mjs +62 -0
  383. package/dist/sqlite-DYJDcu7p.mjs.map +1 -0
  384. package/dist/table-BrioFSra.d.cts +11 -0
  385. package/dist/table-BrioFSra.d.mts +11 -0
  386. package/dist/theme-context-DzZ1otaD.d.cts +270 -0
  387. package/dist/theme-context-J65pythD.d.mts +270 -0
  388. package/dist/ui/styles.css +239 -0
  389. package/dist/util-Dnj5T-yw.mjs +39 -0
  390. package/dist/util-Dnj5T-yw.mjs.map +1 -0
  391. package/dist/util-dAnTK9x-.cjs +74 -0
  392. package/dist/util-dAnTK9x-.cjs.map +1 -0
  393. package/dist/validation-B-atP968.mjs +191 -0
  394. package/dist/validation-B-atP968.mjs.map +1 -0
  395. package/dist/validation-BJifGoB2.d.mts +122 -0
  396. package/dist/validation-DLnzBVJr.cjs +258 -0
  397. package/dist/validation-DLnzBVJr.cjs.map +1 -0
  398. package/dist/validation-tfV2qhbD.d.cts +122 -0
  399. package/package.json +715 -4
  400. package/tsconfig/assets.d.ts +21 -0
  401. package/tsconfig/base.json +21 -0
  402. package/tsconfig/react.json +9 -0
@@ -0,0 +1,52 @@
1
+ //#region src/util/duration.ts
2
+ const UNIT_MS = {
3
+ ms: 1,
4
+ s: 1e3,
5
+ m: 6e4,
6
+ h: 36e5,
7
+ d: 864e5,
8
+ w: 6048e5
9
+ };
10
+ const DURATION_RE = /^(\d+(?:\.\d+)?)(ms|s|m|h|d|w)$/;
11
+ /**
12
+ * Convert a {@link Duration} to milliseconds. Throws on malformed strings or
13
+ * negative / non-finite numbers.
14
+ *
15
+ * @example
16
+ * ```ts
17
+ * durationToMs("5m"); // 300000
18
+ * durationToMs(250); // 250
19
+ * ```
20
+ */
21
+ function durationToMs(duration) {
22
+ if (typeof duration === "number") {
23
+ if (!Number.isFinite(duration) || duration < 0) throw new Error(`Invalid duration: ${duration}`);
24
+ return duration;
25
+ }
26
+ const match = DURATION_RE.exec(String(duration).trim());
27
+ if (!match) throw new Error(`Invalid duration: "${duration}" (expected e.g. "30s", "5m", "14d")`);
28
+ return Number(match[1]) * UNIT_MS[match[2]];
29
+ }
30
+ /**
31
+ * Parse a comma-separated list of durations (`"0,30s,5m,1h"`), as used for
32
+ * retry schedules in env vars. Bare numbers become milliseconds; empty items
33
+ * are skipped. Every item is validated eagerly, so a bad list fails at parse
34
+ * time rather than when it is first used.
35
+ *
36
+ * @example
37
+ * ```ts
38
+ * parseDurationList("0, 30s, 5m"); // [0, "30s", "5m"]
39
+ * ```
40
+ */
41
+ function parseDurationList(input) {
42
+ return input.split(",").map((part) => part.trim()).filter((part) => part.length > 0).map((part) => {
43
+ const asNumber = Number(part);
44
+ const duration = Number.isFinite(asNumber) ? asNumber : part;
45
+ durationToMs(duration);
46
+ return duration;
47
+ });
48
+ }
49
+ //#endregion
50
+ export { parseDurationList as n, durationToMs as t };
51
+
52
+ //# sourceMappingURL=duration-7WpAK-xe.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"duration-7WpAK-xe.mjs","names":[],"sources":["../src/util/duration.ts"],"sourcesContent":["/**\n * Duration parsing for config values (`5000`, `\"30s\"`, `\"5m\"`, `\"2h\"`, `\"14d\"`,\n * `\"2w\"`). Zero dependencies.\n *\n * @module\n */\n\n/** A duration: milliseconds, or a number with a unit (`ms`, `s`, `m`, `h`, `d`, `w`). */\nexport type Duration = number | `${number}${\"ms\" | \"s\" | \"m\" | \"h\" | \"d\" | \"w\"}`;\n\nconst UNIT_MS: Record<string, number> = {\n ms: 1,\n s: 1_000,\n m: 60_000,\n h: 3_600_000,\n d: 86_400_000,\n w: 604_800_000,\n};\n\nconst DURATION_RE = /^(\\d+(?:\\.\\d+)?)(ms|s|m|h|d|w)$/;\n\n/**\n * Convert a {@link Duration} to milliseconds. Throws on malformed strings or\n * negative / non-finite numbers.\n *\n * @example\n * ```ts\n * durationToMs(\"5m\"); // 300000\n * durationToMs(250); // 250\n * ```\n */\nexport function durationToMs(duration: Duration): number {\n if (typeof duration === \"number\") {\n if (!Number.isFinite(duration) || duration < 0)\n throw new Error(`Invalid duration: ${duration}`);\n return duration;\n }\n const match = DURATION_RE.exec(String(duration).trim());\n if (!match) throw new Error(`Invalid duration: \"${duration}\" (expected e.g. \"30s\", \"5m\", \"14d\")`);\n return Number(match[1]) * (UNIT_MS[match[2] as string] as number);\n}\n\n/**\n * Parse a comma-separated list of durations (`\"0,30s,5m,1h\"`), as used for\n * retry schedules in env vars. Bare numbers become milliseconds; empty items\n * are skipped. Every item is validated eagerly, so a bad list fails at parse\n * time rather than when it is first used.\n *\n * @example\n * ```ts\n * parseDurationList(\"0, 30s, 5m\"); // [0, \"30s\", \"5m\"]\n * ```\n */\nexport function parseDurationList(input: string): Duration[] {\n return input\n .split(\",\")\n .map((part) => part.trim())\n .filter((part) => part.length > 0)\n .map((part) => {\n const asNumber = Number(part);\n const duration = (Number.isFinite(asNumber) ? asNumber : part) as Duration;\n durationToMs(duration);\n return duration;\n });\n}\n"],"mappings":";AAUA,MAAM,UAAkC;CACtC,IAAI;CACJ,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;AACL;AAEA,MAAM,cAAc;;;;;;;;;;;AAYpB,SAAgB,aAAa,UAA4B;CACvD,IAAI,OAAO,aAAa,UAAU;EAChC,IAAI,CAAC,OAAO,SAAS,QAAQ,KAAK,WAAW,GAC3C,MAAM,IAAI,MAAM,qBAAqB,UAAU;EACjD,OAAO;CACT;CACA,MAAM,QAAQ,YAAY,KAAK,OAAO,QAAQ,EAAE,KAAK,CAAC;CACtD,IAAI,CAAC,OAAO,MAAM,IAAI,MAAM,sBAAsB,SAAS,qCAAqC;CAChG,OAAO,OAAO,MAAM,EAAE,IAAK,QAAQ,MAAM;AAC3C;;;;;;;;;;;;AAaA,SAAgB,kBAAkB,OAA2B;CAC3D,OAAO,MACJ,MAAM,GAAG,EACT,KAAK,SAAS,KAAK,KAAK,CAAC,EACzB,QAAQ,SAAS,KAAK,SAAS,CAAC,EAChC,KAAK,SAAS;EACb,MAAM,WAAW,OAAO,IAAI;EAC5B,MAAM,WAAY,OAAO,SAAS,QAAQ,IAAI,WAAW;EACzD,aAAa,QAAQ;EACrB,OAAO;CACT,CAAC;AACL"}
@@ -0,0 +1,63 @@
1
+ //#region src/util/duration.ts
2
+ const UNIT_MS = {
3
+ ms: 1,
4
+ s: 1e3,
5
+ m: 6e4,
6
+ h: 36e5,
7
+ d: 864e5,
8
+ w: 6048e5
9
+ };
10
+ const DURATION_RE = /^(\d+(?:\.\d+)?)(ms|s|m|h|d|w)$/;
11
+ /**
12
+ * Convert a {@link Duration} to milliseconds. Throws on malformed strings or
13
+ * negative / non-finite numbers.
14
+ *
15
+ * @example
16
+ * ```ts
17
+ * durationToMs("5m"); // 300000
18
+ * durationToMs(250); // 250
19
+ * ```
20
+ */
21
+ function durationToMs(duration) {
22
+ if (typeof duration === "number") {
23
+ if (!Number.isFinite(duration) || duration < 0) throw new Error(`Invalid duration: ${duration}`);
24
+ return duration;
25
+ }
26
+ const match = DURATION_RE.exec(String(duration).trim());
27
+ if (!match) throw new Error(`Invalid duration: "${duration}" (expected e.g. "30s", "5m", "14d")`);
28
+ return Number(match[1]) * UNIT_MS[match[2]];
29
+ }
30
+ /**
31
+ * Parse a comma-separated list of durations (`"0,30s,5m,1h"`), as used for
32
+ * retry schedules in env vars. Bare numbers become milliseconds; empty items
33
+ * are skipped. Every item is validated eagerly, so a bad list fails at parse
34
+ * time rather than when it is first used.
35
+ *
36
+ * @example
37
+ * ```ts
38
+ * parseDurationList("0, 30s, 5m"); // [0, "30s", "5m"]
39
+ * ```
40
+ */
41
+ function parseDurationList(input) {
42
+ return input.split(",").map((part) => part.trim()).filter((part) => part.length > 0).map((part) => {
43
+ const asNumber = Number(part);
44
+ const duration = Number.isFinite(asNumber) ? asNumber : part;
45
+ durationToMs(duration);
46
+ return duration;
47
+ });
48
+ }
49
+ //#endregion
50
+ Object.defineProperty(exports, "durationToMs", {
51
+ enumerable: true,
52
+ get: function() {
53
+ return durationToMs;
54
+ }
55
+ });
56
+ Object.defineProperty(exports, "parseDurationList", {
57
+ enumerable: true,
58
+ get: function() {
59
+ return parseDurationList;
60
+ }
61
+ });
62
+
63
+ //# sourceMappingURL=duration-DVA0Fzkx.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"duration-DVA0Fzkx.cjs","names":[],"sources":["../src/util/duration.ts"],"sourcesContent":["/**\n * Duration parsing for config values (`5000`, `\"30s\"`, `\"5m\"`, `\"2h\"`, `\"14d\"`,\n * `\"2w\"`). Zero dependencies.\n *\n * @module\n */\n\n/** A duration: milliseconds, or a number with a unit (`ms`, `s`, `m`, `h`, `d`, `w`). */\nexport type Duration = number | `${number}${\"ms\" | \"s\" | \"m\" | \"h\" | \"d\" | \"w\"}`;\n\nconst UNIT_MS: Record<string, number> = {\n ms: 1,\n s: 1_000,\n m: 60_000,\n h: 3_600_000,\n d: 86_400_000,\n w: 604_800_000,\n};\n\nconst DURATION_RE = /^(\\d+(?:\\.\\d+)?)(ms|s|m|h|d|w)$/;\n\n/**\n * Convert a {@link Duration} to milliseconds. Throws on malformed strings or\n * negative / non-finite numbers.\n *\n * @example\n * ```ts\n * durationToMs(\"5m\"); // 300000\n * durationToMs(250); // 250\n * ```\n */\nexport function durationToMs(duration: Duration): number {\n if (typeof duration === \"number\") {\n if (!Number.isFinite(duration) || duration < 0)\n throw new Error(`Invalid duration: ${duration}`);\n return duration;\n }\n const match = DURATION_RE.exec(String(duration).trim());\n if (!match) throw new Error(`Invalid duration: \"${duration}\" (expected e.g. \"30s\", \"5m\", \"14d\")`);\n return Number(match[1]) * (UNIT_MS[match[2] as string] as number);\n}\n\n/**\n * Parse a comma-separated list of durations (`\"0,30s,5m,1h\"`), as used for\n * retry schedules in env vars. Bare numbers become milliseconds; empty items\n * are skipped. Every item is validated eagerly, so a bad list fails at parse\n * time rather than when it is first used.\n *\n * @example\n * ```ts\n * parseDurationList(\"0, 30s, 5m\"); // [0, \"30s\", \"5m\"]\n * ```\n */\nexport function parseDurationList(input: string): Duration[] {\n return input\n .split(\",\")\n .map((part) => part.trim())\n .filter((part) => part.length > 0)\n .map((part) => {\n const asNumber = Number(part);\n const duration = (Number.isFinite(asNumber) ? asNumber : part) as Duration;\n durationToMs(duration);\n return duration;\n });\n}\n"],"mappings":";AAUA,MAAM,UAAkC;CACtC,IAAI;CACJ,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;AACL;AAEA,MAAM,cAAc;;;;;;;;;;;AAYpB,SAAgB,aAAa,UAA4B;CACvD,IAAI,OAAO,aAAa,UAAU;EAChC,IAAI,CAAC,OAAO,SAAS,QAAQ,KAAK,WAAW,GAC3C,MAAM,IAAI,MAAM,qBAAqB,UAAU;EACjD,OAAO;CACT;CACA,MAAM,QAAQ,YAAY,KAAK,OAAO,QAAQ,EAAE,KAAK,CAAC;CACtD,IAAI,CAAC,OAAO,MAAM,IAAI,MAAM,sBAAsB,SAAS,qCAAqC;CAChG,OAAO,OAAO,MAAM,EAAE,IAAK,QAAQ,MAAM;AAC3C;;;;;;;;;;;;AAaA,SAAgB,kBAAkB,OAA2B;CAC3D,OAAO,MACJ,MAAM,GAAG,EACT,KAAK,SAAS,KAAK,KAAK,CAAC,EACzB,QAAQ,SAAS,KAAK,SAAS,CAAC,EAChC,KAAK,SAAS;EACb,MAAM,WAAW,OAAO,IAAI;EAC5B,MAAM,WAAY,OAAO,SAAS,QAAQ,IAAI,WAAW;EACzD,aAAa,QAAQ;EACrB,OAAO;CACT,CAAC;AACL"}
@@ -0,0 +1,35 @@
1
+ //#region src/util/duration.d.ts
2
+ /**
3
+ * Duration parsing for config values (`5000`, `"30s"`, `"5m"`, `"2h"`, `"14d"`,
4
+ * `"2w"`). Zero dependencies.
5
+ *
6
+ * @module
7
+ */
8
+ /** A duration: milliseconds, or a number with a unit (`ms`, `s`, `m`, `h`, `d`, `w`). */
9
+ type Duration = number | `${number}${"ms" | "s" | "m" | "h" | "d" | "w"}`;
10
+ /**
11
+ * Convert a {@link Duration} to milliseconds. Throws on malformed strings or
12
+ * negative / non-finite numbers.
13
+ *
14
+ * @example
15
+ * ```ts
16
+ * durationToMs("5m"); // 300000
17
+ * durationToMs(250); // 250
18
+ * ```
19
+ */
20
+ declare function durationToMs(duration: Duration): number;
21
+ /**
22
+ * Parse a comma-separated list of durations (`"0,30s,5m,1h"`), as used for
23
+ * retry schedules in env vars. Bare numbers become milliseconds; empty items
24
+ * are skipped. Every item is validated eagerly, so a bad list fails at parse
25
+ * time rather than when it is first used.
26
+ *
27
+ * @example
28
+ * ```ts
29
+ * parseDurationList("0, 30s, 5m"); // [0, "30s", "5m"]
30
+ * ```
31
+ */
32
+ declare function parseDurationList(input: string): Duration[];
33
+ //#endregion
34
+ export { durationToMs as n, parseDurationList as r, Duration as t };
35
+ //# sourceMappingURL=duration-FPwbmWIU.d.cts.map
@@ -0,0 +1,35 @@
1
+ //#region src/util/duration.d.ts
2
+ /**
3
+ * Duration parsing for config values (`5000`, `"30s"`, `"5m"`, `"2h"`, `"14d"`,
4
+ * `"2w"`). Zero dependencies.
5
+ *
6
+ * @module
7
+ */
8
+ /** A duration: milliseconds, or a number with a unit (`ms`, `s`, `m`, `h`, `d`, `w`). */
9
+ type Duration = number | `${number}${"ms" | "s" | "m" | "h" | "d" | "w"}`;
10
+ /**
11
+ * Convert a {@link Duration} to milliseconds. Throws on malformed strings or
12
+ * negative / non-finite numbers.
13
+ *
14
+ * @example
15
+ * ```ts
16
+ * durationToMs("5m"); // 300000
17
+ * durationToMs(250); // 250
18
+ * ```
19
+ */
20
+ declare function durationToMs(duration: Duration): number;
21
+ /**
22
+ * Parse a comma-separated list of durations (`"0,30s,5m,1h"`), as used for
23
+ * retry schedules in env vars. Bare numbers become milliseconds; empty items
24
+ * are skipped. Every item is validated eagerly, so a bad list fails at parse
25
+ * time rather than when it is first used.
26
+ *
27
+ * @example
28
+ * ```ts
29
+ * parseDurationList("0, 30s, 5m"); // [0, "30s", "5m"]
30
+ * ```
31
+ */
32
+ declare function parseDurationList(input: string): Duration[];
33
+ //#endregion
34
+ export { durationToMs as n, parseDurationList as r, Duration as t };
35
+ //# sourceMappingURL=duration-FPwbmWIU.d.mts.map
@@ -0,0 +1,10 @@
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
+ //#region src/adapters/bun.ts
3
+ /** Pass a fetch handler to `Bun.serve` (or `export default { fetch }`). */
4
+ function toBunFetch(fetch) {
5
+ return (request) => fetch(request);
6
+ }
7
+ //#endregion
8
+ exports.toBunFetch = toBunFetch;
9
+
10
+ //# sourceMappingURL=entry-adapters-bun.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"entry-adapters-bun.cjs","names":[],"sources":["../src/adapters/bun.ts"],"sourcesContent":["/**\n * Bun adapter. Bun serves web-standard handlers natively, so the panel's\n * `fetch` is passed straight through; {@link toBunFetch} only binds it and\n * keeps the optional `server` argument out of the panel.\n *\n * ```ts\n * import { toBunFetch } from \"@xtandard/kit/adapters/bun\";\n *\n * Bun.serve({ port: 3000, fetch: toBunFetch(panel.fetch) });\n * ```\n *\n * @module\n */\n\nimport type { FetchHandler } from \"./node.ts\";\n\n/** A `Bun.serve` `fetch` callback. */\nexport type BunFetch<Server = unknown> = (\n request: Request,\n server: Server,\n) => Response | Promise<Response>;\n\n/** Pass a fetch handler to `Bun.serve` (or `export default { fetch }`). */\nexport function toBunFetch<Server = unknown>(fetch: FetchHandler): BunFetch<Server> {\n return (request) => fetch(request);\n}\n"],"mappings":";;;AAuBA,SAAgB,WAA6B,OAAuC;CAClF,QAAQ,YAAY,MAAM,OAAO;AACnC"}
@@ -0,0 +1,10 @@
1
+ import { t as FetchHandler } from "./node-B1Djcwfi.cjs";
2
+
3
+ //#region src/adapters/bun.d.ts
4
+ /** A `Bun.serve` `fetch` callback. */
5
+ type BunFetch<Server = unknown> = (request: Request, server: Server) => Response | Promise<Response>;
6
+ /** Pass a fetch handler to `Bun.serve` (or `export default { fetch }`). */
7
+ declare function toBunFetch<Server = unknown>(fetch: FetchHandler): BunFetch<Server>;
8
+ //#endregion
9
+ export { type BunFetch, toBunFetch };
10
+ //# sourceMappingURL=entry-adapters-bun.d.cts.map
@@ -0,0 +1,10 @@
1
+ import { t as FetchHandler } from "./node-B1Djcwfi.mjs";
2
+
3
+ //#region src/adapters/bun.d.ts
4
+ /** A `Bun.serve` `fetch` callback. */
5
+ type BunFetch<Server = unknown> = (request: Request, server: Server) => Response | Promise<Response>;
6
+ /** Pass a fetch handler to `Bun.serve` (or `export default { fetch }`). */
7
+ declare function toBunFetch<Server = unknown>(fetch: FetchHandler): BunFetch<Server>;
8
+ //#endregion
9
+ export { type BunFetch, toBunFetch };
10
+ //# sourceMappingURL=entry-adapters-bun.d.mts.map
@@ -0,0 +1,9 @@
1
+ //#region src/adapters/bun.ts
2
+ /** Pass a fetch handler to `Bun.serve` (or `export default { fetch }`). */
3
+ function toBunFetch(fetch) {
4
+ return (request) => fetch(request);
5
+ }
6
+ //#endregion
7
+ export { toBunFetch };
8
+
9
+ //# sourceMappingURL=entry-adapters-bun.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"entry-adapters-bun.mjs","names":[],"sources":["../src/adapters/bun.ts"],"sourcesContent":["/**\n * Bun adapter. Bun serves web-standard handlers natively, so the panel's\n * `fetch` is passed straight through; {@link toBunFetch} only binds it and\n * keeps the optional `server` argument out of the panel.\n *\n * ```ts\n * import { toBunFetch } from \"@xtandard/kit/adapters/bun\";\n *\n * Bun.serve({ port: 3000, fetch: toBunFetch(panel.fetch) });\n * ```\n *\n * @module\n */\n\nimport type { FetchHandler } from \"./node.ts\";\n\n/** A `Bun.serve` `fetch` callback. */\nexport type BunFetch<Server = unknown> = (\n request: Request,\n server: Server,\n) => Response | Promise<Response>;\n\n/** Pass a fetch handler to `Bun.serve` (or `export default { fetch }`). */\nexport function toBunFetch<Server = unknown>(fetch: FetchHandler): BunFetch<Server> {\n return (request) => fetch(request);\n}\n"],"mappings":";;AAuBA,SAAgB,WAA6B,OAAuC;CAClF,QAAQ,YAAY,MAAM,OAAO;AACnC"}
@@ -0,0 +1,54 @@
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
+ //#region src/adapters/elysia.ts
3
+ const BODY_METHODS = new Set([
4
+ "POST",
5
+ "PUT",
6
+ "PATCH",
7
+ "DELETE"
8
+ ]);
9
+ function rebuiltBody(body, headers) {
10
+ if (body === void 0 || body === null || body === "") return void 0;
11
+ if (typeof body === "string") return body;
12
+ if (body instanceof Uint8Array || body instanceof ArrayBuffer) return body;
13
+ if (typeof FormData !== "undefined" && body instanceof FormData) {
14
+ headers.delete("content-type");
15
+ return body;
16
+ }
17
+ const type = headers.get("content-type") ?? "";
18
+ if (type.includes("application/x-www-form-urlencoded") && typeof body === "object") return new URLSearchParams(body).toString();
19
+ if (!type.includes("json")) headers.set("content-type", "application/json");
20
+ return JSON.stringify(body);
21
+ }
22
+ /** Build the handlers every declared Elysia route delegates to. */
23
+ function createPass(options) {
24
+ const { prefix, fetch } = options;
25
+ const pass = async (ctx) => {
26
+ const r = ctx.request;
27
+ if (BODY_METHODS.has(r.method.toUpperCase()) && r.bodyUsed) {
28
+ const headers = new Headers(r.headers);
29
+ headers.delete("content-length");
30
+ const body = rebuiltBody(ctx.body, headers);
31
+ return fetch(new Request(r.url, {
32
+ method: r.method,
33
+ headers,
34
+ ...body !== void 0 ? { body } : {}
35
+ }));
36
+ }
37
+ return fetch(r);
38
+ };
39
+ const raw = async (ctx) => fetch(ctx.request);
40
+ return {
41
+ prefix,
42
+ pass,
43
+ raw,
44
+ plugin: {
45
+ prefix,
46
+ name: options.name ?? "xtandard-panel",
47
+ seed: prefix
48
+ }
49
+ };
50
+ }
51
+ //#endregion
52
+ exports.createPass = createPass;
53
+
54
+ //# sourceMappingURL=entry-adapters-elysia.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"entry-adapters-elysia.cjs","names":[],"sources":["../src/adapters/elysia.ts"],"sourcesContent":["/**\n * Elysia-version-agnostic plumbing for the 1.x and 2.x adapters. No `elysia`\n * import: products keep their typed route chain (Eden inference needs literal\n * chains) and delegate each declared route to {@link createPass}'s handlers.\n *\n * Elysia parses the body of declared routes, draining the request stream;\n * `pass` rebuilds the `Request` before delegating to the panel:\n *\n * - for `POST`, `PUT`, `PATCH` and `DELETE`, when the stream was consumed\n * (`bodyUsed`);\n * - a string body is passed through as-is (CSV imports), bytes as bytes, form\n * data as `FormData`, urlencoded objects re-encoded, everything else as\n * JSON (with a JSON content type);\n * - the stale `content-length` is dropped.\n *\n * `raw` forwards the untouched request, for routes declared with\n * `parse: \"none\"` (signature-verified webhook intake). `plugin` carries\n * `seed: prefix`, so two mounts with different prefixes aren't deduplicated by\n * Elysia's plugin `name`.\n *\n * ```ts\n * const { prefix, pass, raw, plugin } = createPass({ prefix: \"/webhooks\", fetch: panel.fetch, name: \"xtandard-webhooks\" });\n * new Elysia(plugin)\n * .post(\"/api/endpoints\", pass, { body: t.Object({ url: t.String() }) })\n * .post(\"/intake/:provider\", raw, { parse: \"none\" })\n * .all(\"/*\", pass);\n * ```\n *\n * @module\n */\n\nimport type { FetchHandler } from \"./node.ts\";\n\n/** Options for {@link createPass}. */\nexport interface CreatePassOptions {\n /** Mount prefix (also the panel's `basePath`), e.g. `\"/webhooks\"`. */\n prefix: string;\n /** The panel's fetch handler. */\n fetch: FetchHandler;\n /** The Elysia plugin name. Default `\"xtandard-panel\"`. */\n name?: string;\n}\n\n/** The Elysia context fields `pass` reads. */\nexport interface PassContext {\n request: Request;\n body?: unknown;\n}\n\n/** What {@link createPass} returns. */\nexport interface CreatePassResult {\n prefix: string;\n /** Rebuild the request from Elysia's parsed body, then delegate. */\n pass: (ctx: PassContext) => Promise<Response>;\n /** Delegate the untouched request (routes with `parse: \"none\"`). */\n raw: (ctx: { request: Request }) => Promise<Response>;\n /** `new Elysia(plugin)` options: `{ prefix, name, seed: prefix }`. */\n plugin: { prefix: string; name: string; seed: string };\n}\n\nconst BODY_METHODS = new Set([\"POST\", \"PUT\", \"PATCH\", \"DELETE\"]);\n\nfunction rebuiltBody(body: unknown, headers: Headers): BodyInit | undefined {\n if (body === undefined || body === null || body === \"\") return undefined;\n if (typeof body === \"string\") return body;\n if (body instanceof Uint8Array || body instanceof ArrayBuffer) return body as BodyInit;\n if (typeof FormData !== \"undefined\" && body instanceof FormData) {\n headers.delete(\"content-type\"); // a new multipart boundary is generated\n return body;\n }\n const type = headers.get(\"content-type\") ?? \"\";\n if (type.includes(\"application/x-www-form-urlencoded\") && typeof body === \"object\") {\n return new URLSearchParams(body as Record<string, string>).toString();\n }\n if (!type.includes(\"json\")) headers.set(\"content-type\", \"application/json\");\n return JSON.stringify(body);\n}\n\n/** Build the handlers every declared Elysia route delegates to. */\nexport function createPass(options: CreatePassOptions): CreatePassResult {\n const { prefix, fetch } = options;\n const pass = async (ctx: PassContext): Promise<Response> => {\n const r = ctx.request;\n if (BODY_METHODS.has(r.method.toUpperCase()) && r.bodyUsed) {\n const headers = new Headers(r.headers);\n headers.delete(\"content-length\");\n const body = rebuiltBody(ctx.body, headers);\n return fetch(\n new Request(r.url, { method: r.method, headers, ...(body !== undefined ? { body } : {}) }),\n );\n }\n return fetch(r);\n };\n const raw = async (ctx: { request: Request }): Promise<Response> => fetch(ctx.request);\n return {\n prefix,\n pass,\n raw,\n plugin: { prefix, name: options.name ?? \"xtandard-panel\", seed: prefix },\n };\n}\n"],"mappings":";;AA4DA,MAAM,eAAe,IAAI,IAAI;CAAC;CAAQ;CAAO;CAAS;AAAQ,CAAC;AAE/D,SAAS,YAAY,MAAe,SAAwC;CAC1E,IAAI,SAAS,KAAA,KAAa,SAAS,QAAQ,SAAS,IAAI,OAAO,KAAA;CAC/D,IAAI,OAAO,SAAS,UAAU,OAAO;CACrC,IAAI,gBAAgB,cAAc,gBAAgB,aAAa,OAAO;CACtE,IAAI,OAAO,aAAa,eAAe,gBAAgB,UAAU;EAC/D,QAAQ,OAAO,cAAc;EAC7B,OAAO;CACT;CACA,MAAM,OAAO,QAAQ,IAAI,cAAc,KAAK;CAC5C,IAAI,KAAK,SAAS,mCAAmC,KAAK,OAAO,SAAS,UACxE,OAAO,IAAI,gBAAgB,IAA8B,EAAE,SAAS;CAEtE,IAAI,CAAC,KAAK,SAAS,MAAM,GAAG,QAAQ,IAAI,gBAAgB,kBAAkB;CAC1E,OAAO,KAAK,UAAU,IAAI;AAC5B;;AAGA,SAAgB,WAAW,SAA8C;CACvE,MAAM,EAAE,QAAQ,UAAU;CAC1B,MAAM,OAAO,OAAO,QAAwC;EAC1D,MAAM,IAAI,IAAI;EACd,IAAI,aAAa,IAAI,EAAE,OAAO,YAAY,CAAC,KAAK,EAAE,UAAU;GAC1D,MAAM,UAAU,IAAI,QAAQ,EAAE,OAAO;GACrC,QAAQ,OAAO,gBAAgB;GAC/B,MAAM,OAAO,YAAY,IAAI,MAAM,OAAO;GAC1C,OAAO,MACL,IAAI,QAAQ,EAAE,KAAK;IAAE,QAAQ,EAAE;IAAQ;IAAS,GAAI,SAAS,KAAA,IAAY,EAAE,KAAK,IAAI,CAAC;GAAG,CAAC,CAC3F;EACF;EACA,OAAO,MAAM,CAAC;CAChB;CACA,MAAM,MAAM,OAAO,QAAiD,MAAM,IAAI,OAAO;CACrF,OAAO;EACL;EACA;EACA;EACA,QAAQ;GAAE;GAAQ,MAAM,QAAQ,QAAQ;GAAkB,MAAM;EAAO;CACzE;AACF"}
@@ -0,0 +1,38 @@
1
+ import { t as FetchHandler } from "./node-B1Djcwfi.cjs";
2
+
3
+ //#region src/adapters/elysia.d.ts
4
+ /** Options for {@link createPass}. */
5
+ interface CreatePassOptions {
6
+ /** Mount prefix (also the panel's `basePath`), e.g. `"/webhooks"`. */
7
+ prefix: string;
8
+ /** The panel's fetch handler. */
9
+ fetch: FetchHandler;
10
+ /** The Elysia plugin name. Default `"xtandard-panel"`. */
11
+ name?: string;
12
+ }
13
+ /** The Elysia context fields `pass` reads. */
14
+ interface PassContext {
15
+ request: Request;
16
+ body?: unknown;
17
+ }
18
+ /** What {@link createPass} returns. */
19
+ interface CreatePassResult {
20
+ prefix: string;
21
+ /** Rebuild the request from Elysia's parsed body, then delegate. */
22
+ pass: (ctx: PassContext) => Promise<Response>;
23
+ /** Delegate the untouched request (routes with `parse: "none"`). */
24
+ raw: (ctx: {
25
+ request: Request;
26
+ }) => Promise<Response>;
27
+ /** `new Elysia(plugin)` options: `{ prefix, name, seed: prefix }`. */
28
+ plugin: {
29
+ prefix: string;
30
+ name: string;
31
+ seed: string;
32
+ };
33
+ }
34
+ /** Build the handlers every declared Elysia route delegates to. */
35
+ declare function createPass(options: CreatePassOptions): CreatePassResult;
36
+ //#endregion
37
+ export { type CreatePassOptions, type CreatePassResult, type PassContext, createPass };
38
+ //# sourceMappingURL=entry-adapters-elysia.d.cts.map
@@ -0,0 +1,38 @@
1
+ import { t as FetchHandler } from "./node-B1Djcwfi.mjs";
2
+
3
+ //#region src/adapters/elysia.d.ts
4
+ /** Options for {@link createPass}. */
5
+ interface CreatePassOptions {
6
+ /** Mount prefix (also the panel's `basePath`), e.g. `"/webhooks"`. */
7
+ prefix: string;
8
+ /** The panel's fetch handler. */
9
+ fetch: FetchHandler;
10
+ /** The Elysia plugin name. Default `"xtandard-panel"`. */
11
+ name?: string;
12
+ }
13
+ /** The Elysia context fields `pass` reads. */
14
+ interface PassContext {
15
+ request: Request;
16
+ body?: unknown;
17
+ }
18
+ /** What {@link createPass} returns. */
19
+ interface CreatePassResult {
20
+ prefix: string;
21
+ /** Rebuild the request from Elysia's parsed body, then delegate. */
22
+ pass: (ctx: PassContext) => Promise<Response>;
23
+ /** Delegate the untouched request (routes with `parse: "none"`). */
24
+ raw: (ctx: {
25
+ request: Request;
26
+ }) => Promise<Response>;
27
+ /** `new Elysia(plugin)` options: `{ prefix, name, seed: prefix }`. */
28
+ plugin: {
29
+ prefix: string;
30
+ name: string;
31
+ seed: string;
32
+ };
33
+ }
34
+ /** Build the handlers every declared Elysia route delegates to. */
35
+ declare function createPass(options: CreatePassOptions): CreatePassResult;
36
+ //#endregion
37
+ export { type CreatePassOptions, type CreatePassResult, type PassContext, createPass };
38
+ //# sourceMappingURL=entry-adapters-elysia.d.mts.map
@@ -0,0 +1,53 @@
1
+ //#region src/adapters/elysia.ts
2
+ const BODY_METHODS = new Set([
3
+ "POST",
4
+ "PUT",
5
+ "PATCH",
6
+ "DELETE"
7
+ ]);
8
+ function rebuiltBody(body, headers) {
9
+ if (body === void 0 || body === null || body === "") return void 0;
10
+ if (typeof body === "string") return body;
11
+ if (body instanceof Uint8Array || body instanceof ArrayBuffer) return body;
12
+ if (typeof FormData !== "undefined" && body instanceof FormData) {
13
+ headers.delete("content-type");
14
+ return body;
15
+ }
16
+ const type = headers.get("content-type") ?? "";
17
+ if (type.includes("application/x-www-form-urlencoded") && typeof body === "object") return new URLSearchParams(body).toString();
18
+ if (!type.includes("json")) headers.set("content-type", "application/json");
19
+ return JSON.stringify(body);
20
+ }
21
+ /** Build the handlers every declared Elysia route delegates to. */
22
+ function createPass(options) {
23
+ const { prefix, fetch } = options;
24
+ const pass = async (ctx) => {
25
+ const r = ctx.request;
26
+ if (BODY_METHODS.has(r.method.toUpperCase()) && r.bodyUsed) {
27
+ const headers = new Headers(r.headers);
28
+ headers.delete("content-length");
29
+ const body = rebuiltBody(ctx.body, headers);
30
+ return fetch(new Request(r.url, {
31
+ method: r.method,
32
+ headers,
33
+ ...body !== void 0 ? { body } : {}
34
+ }));
35
+ }
36
+ return fetch(r);
37
+ };
38
+ const raw = async (ctx) => fetch(ctx.request);
39
+ return {
40
+ prefix,
41
+ pass,
42
+ raw,
43
+ plugin: {
44
+ prefix,
45
+ name: options.name ?? "xtandard-panel",
46
+ seed: prefix
47
+ }
48
+ };
49
+ }
50
+ //#endregion
51
+ export { createPass };
52
+
53
+ //# sourceMappingURL=entry-adapters-elysia.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"entry-adapters-elysia.mjs","names":[],"sources":["../src/adapters/elysia.ts"],"sourcesContent":["/**\n * Elysia-version-agnostic plumbing for the 1.x and 2.x adapters. No `elysia`\n * import: products keep their typed route chain (Eden inference needs literal\n * chains) and delegate each declared route to {@link createPass}'s handlers.\n *\n * Elysia parses the body of declared routes, draining the request stream;\n * `pass` rebuilds the `Request` before delegating to the panel:\n *\n * - for `POST`, `PUT`, `PATCH` and `DELETE`, when the stream was consumed\n * (`bodyUsed`);\n * - a string body is passed through as-is (CSV imports), bytes as bytes, form\n * data as `FormData`, urlencoded objects re-encoded, everything else as\n * JSON (with a JSON content type);\n * - the stale `content-length` is dropped.\n *\n * `raw` forwards the untouched request, for routes declared with\n * `parse: \"none\"` (signature-verified webhook intake). `plugin` carries\n * `seed: prefix`, so two mounts with different prefixes aren't deduplicated by\n * Elysia's plugin `name`.\n *\n * ```ts\n * const { prefix, pass, raw, plugin } = createPass({ prefix: \"/webhooks\", fetch: panel.fetch, name: \"xtandard-webhooks\" });\n * new Elysia(plugin)\n * .post(\"/api/endpoints\", pass, { body: t.Object({ url: t.String() }) })\n * .post(\"/intake/:provider\", raw, { parse: \"none\" })\n * .all(\"/*\", pass);\n * ```\n *\n * @module\n */\n\nimport type { FetchHandler } from \"./node.ts\";\n\n/** Options for {@link createPass}. */\nexport interface CreatePassOptions {\n /** Mount prefix (also the panel's `basePath`), e.g. `\"/webhooks\"`. */\n prefix: string;\n /** The panel's fetch handler. */\n fetch: FetchHandler;\n /** The Elysia plugin name. Default `\"xtandard-panel\"`. */\n name?: string;\n}\n\n/** The Elysia context fields `pass` reads. */\nexport interface PassContext {\n request: Request;\n body?: unknown;\n}\n\n/** What {@link createPass} returns. */\nexport interface CreatePassResult {\n prefix: string;\n /** Rebuild the request from Elysia's parsed body, then delegate. */\n pass: (ctx: PassContext) => Promise<Response>;\n /** Delegate the untouched request (routes with `parse: \"none\"`). */\n raw: (ctx: { request: Request }) => Promise<Response>;\n /** `new Elysia(plugin)` options: `{ prefix, name, seed: prefix }`. */\n plugin: { prefix: string; name: string; seed: string };\n}\n\nconst BODY_METHODS = new Set([\"POST\", \"PUT\", \"PATCH\", \"DELETE\"]);\n\nfunction rebuiltBody(body: unknown, headers: Headers): BodyInit | undefined {\n if (body === undefined || body === null || body === \"\") return undefined;\n if (typeof body === \"string\") return body;\n if (body instanceof Uint8Array || body instanceof ArrayBuffer) return body as BodyInit;\n if (typeof FormData !== \"undefined\" && body instanceof FormData) {\n headers.delete(\"content-type\"); // a new multipart boundary is generated\n return body;\n }\n const type = headers.get(\"content-type\") ?? \"\";\n if (type.includes(\"application/x-www-form-urlencoded\") && typeof body === \"object\") {\n return new URLSearchParams(body as Record<string, string>).toString();\n }\n if (!type.includes(\"json\")) headers.set(\"content-type\", \"application/json\");\n return JSON.stringify(body);\n}\n\n/** Build the handlers every declared Elysia route delegates to. */\nexport function createPass(options: CreatePassOptions): CreatePassResult {\n const { prefix, fetch } = options;\n const pass = async (ctx: PassContext): Promise<Response> => {\n const r = ctx.request;\n if (BODY_METHODS.has(r.method.toUpperCase()) && r.bodyUsed) {\n const headers = new Headers(r.headers);\n headers.delete(\"content-length\");\n const body = rebuiltBody(ctx.body, headers);\n return fetch(\n new Request(r.url, { method: r.method, headers, ...(body !== undefined ? { body } : {}) }),\n );\n }\n return fetch(r);\n };\n const raw = async (ctx: { request: Request }): Promise<Response> => fetch(ctx.request);\n return {\n prefix,\n pass,\n raw,\n plugin: { prefix, name: options.name ?? \"xtandard-panel\", seed: prefix },\n };\n}\n"],"mappings":";AA4DA,MAAM,eAAe,IAAI,IAAI;CAAC;CAAQ;CAAO;CAAS;AAAQ,CAAC;AAE/D,SAAS,YAAY,MAAe,SAAwC;CAC1E,IAAI,SAAS,KAAA,KAAa,SAAS,QAAQ,SAAS,IAAI,OAAO,KAAA;CAC/D,IAAI,OAAO,SAAS,UAAU,OAAO;CACrC,IAAI,gBAAgB,cAAc,gBAAgB,aAAa,OAAO;CACtE,IAAI,OAAO,aAAa,eAAe,gBAAgB,UAAU;EAC/D,QAAQ,OAAO,cAAc;EAC7B,OAAO;CACT;CACA,MAAM,OAAO,QAAQ,IAAI,cAAc,KAAK;CAC5C,IAAI,KAAK,SAAS,mCAAmC,KAAK,OAAO,SAAS,UACxE,OAAO,IAAI,gBAAgB,IAA8B,EAAE,SAAS;CAEtE,IAAI,CAAC,KAAK,SAAS,MAAM,GAAG,QAAQ,IAAI,gBAAgB,kBAAkB;CAC1E,OAAO,KAAK,UAAU,IAAI;AAC5B;;AAGA,SAAgB,WAAW,SAA8C;CACvE,MAAM,EAAE,QAAQ,UAAU;CAC1B,MAAM,OAAO,OAAO,QAAwC;EAC1D,MAAM,IAAI,IAAI;EACd,IAAI,aAAa,IAAI,EAAE,OAAO,YAAY,CAAC,KAAK,EAAE,UAAU;GAC1D,MAAM,UAAU,IAAI,QAAQ,EAAE,OAAO;GACrC,QAAQ,OAAO,gBAAgB;GAC/B,MAAM,OAAO,YAAY,IAAI,MAAM,OAAO;GAC1C,OAAO,MACL,IAAI,QAAQ,EAAE,KAAK;IAAE,QAAQ,EAAE;IAAQ;IAAS,GAAI,SAAS,KAAA,IAAY,EAAE,KAAK,IAAI,CAAC;GAAG,CAAC,CAC3F;EACF;EACA,OAAO,MAAM,CAAC;CAChB;CACA,MAAM,MAAM,OAAO,QAAiD,MAAM,IAAI,OAAO;CACrF,OAAO;EACL;EACA;EACA;EACA,QAAQ;GAAE;GAAQ,MAAM,QAAQ,QAAQ;GAAkB,MAAM;EAAO;CACzE;AACF"}
@@ -0,0 +1,27 @@
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
+ const require_node = require("./node-DFFqYRk-.cjs");
3
+ //#region src/adapters/express.ts
4
+ /**
5
+ * Serve a fetch handler from Express. Errors go to `next(error)`.
6
+ *
7
+ * Use with `app.use(path, middleware)`: the panel sees `req.originalUrl`, so
8
+ * set its `basePath` to the mount path.
9
+ */
10
+ function toExpressMiddleware(fetch, options = {}) {
11
+ return (req, res, next) => {
12
+ (async () => {
13
+ const request = await require_node.toWebRequest(req, options);
14
+ const response = await fetch(request);
15
+ if (options.fallthroughStatus !== void 0 && response.status === options.fallthroughStatus) {
16
+ await response.body?.cancel().catch(() => void 0);
17
+ next();
18
+ return;
19
+ }
20
+ await require_node.writeWebResponse(res, response, request);
21
+ })().catch(next);
22
+ };
23
+ }
24
+ //#endregion
25
+ exports.toExpressMiddleware = toExpressMiddleware;
26
+
27
+ //# sourceMappingURL=entry-adapters-express.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"entry-adapters-express.cjs","names":["toWebRequest","writeWebResponse"],"sources":["../src/adapters/express.ts"],"sourcesContent":["/**\n * Express adapter: a middleware factory over the shared Node bridge\n * (`@xtandard/kit/adapters/node`). No `express` import at runtime — only its\n * types.\n *\n * Mount it before or after body-parser middleware: a body already parsed by\n * `express.json()` / `express.urlencoded()` / `express.text()` /\n * `express.raw()` is re-serialised. Multiple `Set-Cookie` headers are kept and\n * response bodies are streamed with backpressure.\n *\n * ```ts\n * import express from \"express\";\n * import { toExpressMiddleware } from \"@xtandard/kit/adapters/express\";\n *\n * const app = express();\n * app.use(\"/webhooks\", toExpressMiddleware(panel.fetch));\n * ```\n *\n * @module\n */\n\nimport type { NextFunction, Request as ExRequest, Response as ExResponse } from \"express\";\nimport {\n toWebRequest,\n writeWebResponse,\n type FetchHandler,\n type NodeRequest,\n type ToWebRequestOptions,\n} from \"./node.ts\";\n\n/** An Express middleware. */\nexport type ExpressMiddleware = (req: ExRequest, res: ExResponse, next: NextFunction) => void;\n\n/** Options for {@link toExpressMiddleware}. */\nexport interface ExpressMiddlewareOptions extends ToWebRequestOptions {\n /**\n * Call `next()` (instead of answering) when the handler returns this status,\n * e.g. `404`, so routes mounted after the panel still run. Default: never.\n */\n fallthroughStatus?: number;\n}\n\n/**\n * Serve a fetch handler from Express. Errors go to `next(error)`.\n *\n * Use with `app.use(path, middleware)`: the panel sees `req.originalUrl`, so\n * set its `basePath` to the mount path.\n */\nexport function toExpressMiddleware(\n fetch: FetchHandler,\n options: ExpressMiddlewareOptions = {},\n): ExpressMiddleware {\n return (req, res, next) => {\n void (async () => {\n const request = await toWebRequest(req as unknown as NodeRequest, options);\n const response = await fetch(request);\n if (\n options.fallthroughStatus !== undefined &&\n response.status === options.fallthroughStatus\n ) {\n await response.body?.cancel().catch(() => undefined);\n next();\n return;\n }\n await writeWebResponse(res, response, request);\n })().catch(next);\n };\n}\n"],"mappings":";;;;;;;;;AAgDA,SAAgB,oBACd,OACA,UAAoC,CAAC,GAClB;CACnB,QAAQ,KAAK,KAAK,SAAS;EACzB,CAAM,YAAY;GAChB,MAAM,UAAU,MAAMA,aAAAA,aAAa,KAA+B,OAAO;GACzE,MAAM,WAAW,MAAM,MAAM,OAAO;GACpC,IACE,QAAQ,sBAAsB,KAAA,KAC9B,SAAS,WAAW,QAAQ,mBAC5B;IACA,MAAM,SAAS,MAAM,OAAO,EAAE,YAAY,KAAA,CAAS;IACnD,KAAK;IACL;GACF;GACA,MAAMC,aAAAA,iBAAiB,KAAK,UAAU,OAAO;EAC/C,GAAG,EAAE,MAAM,IAAI;CACjB;AACF"}
@@ -0,0 +1,24 @@
1
+ import { i as ToWebRequestOptions, t as FetchHandler } from "./node-B1Djcwfi.cjs";
2
+ import { NextFunction, Request, Response } from "express";
3
+
4
+ //#region src/adapters/express.d.ts
5
+ /** An Express middleware. */
6
+ type ExpressMiddleware = (req: Request, res: Response, next: NextFunction) => void;
7
+ /** Options for {@link toExpressMiddleware}. */
8
+ interface ExpressMiddlewareOptions extends ToWebRequestOptions {
9
+ /**
10
+ * Call `next()` (instead of answering) when the handler returns this status,
11
+ * e.g. `404`, so routes mounted after the panel still run. Default: never.
12
+ */
13
+ fallthroughStatus?: number;
14
+ }
15
+ /**
16
+ * Serve a fetch handler from Express. Errors go to `next(error)`.
17
+ *
18
+ * Use with `app.use(path, middleware)`: the panel sees `req.originalUrl`, so
19
+ * set its `basePath` to the mount path.
20
+ */
21
+ declare function toExpressMiddleware(fetch: FetchHandler, options?: ExpressMiddlewareOptions): ExpressMiddleware;
22
+ //#endregion
23
+ export { type ExpressMiddleware, type ExpressMiddlewareOptions, toExpressMiddleware };
24
+ //# sourceMappingURL=entry-adapters-express.d.cts.map
@@ -0,0 +1,24 @@
1
+ import { i as ToWebRequestOptions, t as FetchHandler } from "./node-B1Djcwfi.mjs";
2
+ import { NextFunction, Request, Response } from "express";
3
+
4
+ //#region src/adapters/express.d.ts
5
+ /** An Express middleware. */
6
+ type ExpressMiddleware = (req: Request, res: Response, next: NextFunction) => void;
7
+ /** Options for {@link toExpressMiddleware}. */
8
+ interface ExpressMiddlewareOptions extends ToWebRequestOptions {
9
+ /**
10
+ * Call `next()` (instead of answering) when the handler returns this status,
11
+ * e.g. `404`, so routes mounted after the panel still run. Default: never.
12
+ */
13
+ fallthroughStatus?: number;
14
+ }
15
+ /**
16
+ * Serve a fetch handler from Express. Errors go to `next(error)`.
17
+ *
18
+ * Use with `app.use(path, middleware)`: the panel sees `req.originalUrl`, so
19
+ * set its `basePath` to the mount path.
20
+ */
21
+ declare function toExpressMiddleware(fetch: FetchHandler, options?: ExpressMiddlewareOptions): ExpressMiddleware;
22
+ //#endregion
23
+ export { type ExpressMiddleware, type ExpressMiddlewareOptions, toExpressMiddleware };
24
+ //# sourceMappingURL=entry-adapters-express.d.mts.map
@@ -0,0 +1,26 @@
1
+ import { a as toWebRequest, o as writeWebResponse } from "./node-BYjocCbU.mjs";
2
+ //#region src/adapters/express.ts
3
+ /**
4
+ * Serve a fetch handler from Express. Errors go to `next(error)`.
5
+ *
6
+ * Use with `app.use(path, middleware)`: the panel sees `req.originalUrl`, so
7
+ * set its `basePath` to the mount path.
8
+ */
9
+ function toExpressMiddleware(fetch, options = {}) {
10
+ return (req, res, next) => {
11
+ (async () => {
12
+ const request = await toWebRequest(req, options);
13
+ const response = await fetch(request);
14
+ if (options.fallthroughStatus !== void 0 && response.status === options.fallthroughStatus) {
15
+ await response.body?.cancel().catch(() => void 0);
16
+ next();
17
+ return;
18
+ }
19
+ await writeWebResponse(res, response, request);
20
+ })().catch(next);
21
+ };
22
+ }
23
+ //#endregion
24
+ export { toExpressMiddleware };
25
+
26
+ //# sourceMappingURL=entry-adapters-express.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"entry-adapters-express.mjs","names":[],"sources":["../src/adapters/express.ts"],"sourcesContent":["/**\n * Express adapter: a middleware factory over the shared Node bridge\n * (`@xtandard/kit/adapters/node`). No `express` import at runtime — only its\n * types.\n *\n * Mount it before or after body-parser middleware: a body already parsed by\n * `express.json()` / `express.urlencoded()` / `express.text()` /\n * `express.raw()` is re-serialised. Multiple `Set-Cookie` headers are kept and\n * response bodies are streamed with backpressure.\n *\n * ```ts\n * import express from \"express\";\n * import { toExpressMiddleware } from \"@xtandard/kit/adapters/express\";\n *\n * const app = express();\n * app.use(\"/webhooks\", toExpressMiddleware(panel.fetch));\n * ```\n *\n * @module\n */\n\nimport type { NextFunction, Request as ExRequest, Response as ExResponse } from \"express\";\nimport {\n toWebRequest,\n writeWebResponse,\n type FetchHandler,\n type NodeRequest,\n type ToWebRequestOptions,\n} from \"./node.ts\";\n\n/** An Express middleware. */\nexport type ExpressMiddleware = (req: ExRequest, res: ExResponse, next: NextFunction) => void;\n\n/** Options for {@link toExpressMiddleware}. */\nexport interface ExpressMiddlewareOptions extends ToWebRequestOptions {\n /**\n * Call `next()` (instead of answering) when the handler returns this status,\n * e.g. `404`, so routes mounted after the panel still run. Default: never.\n */\n fallthroughStatus?: number;\n}\n\n/**\n * Serve a fetch handler from Express. Errors go to `next(error)`.\n *\n * Use with `app.use(path, middleware)`: the panel sees `req.originalUrl`, so\n * set its `basePath` to the mount path.\n */\nexport function toExpressMiddleware(\n fetch: FetchHandler,\n options: ExpressMiddlewareOptions = {},\n): ExpressMiddleware {\n return (req, res, next) => {\n void (async () => {\n const request = await toWebRequest(req as unknown as NodeRequest, options);\n const response = await fetch(request);\n if (\n options.fallthroughStatus !== undefined &&\n response.status === options.fallthroughStatus\n ) {\n await response.body?.cancel().catch(() => undefined);\n next();\n return;\n }\n await writeWebResponse(res, response, request);\n })().catch(next);\n };\n}\n"],"mappings":";;;;;;;;AAgDA,SAAgB,oBACd,OACA,UAAoC,CAAC,GAClB;CACnB,QAAQ,KAAK,KAAK,SAAS;EACzB,CAAM,YAAY;GAChB,MAAM,UAAU,MAAM,aAAa,KAA+B,OAAO;GACzE,MAAM,WAAW,MAAM,MAAM,OAAO;GACpC,IACE,QAAQ,sBAAsB,KAAA,KAC9B,SAAS,WAAW,QAAQ,mBAC5B;IACA,MAAM,SAAS,MAAM,OAAO,EAAE,YAAY,KAAA,CAAS;IACnD,KAAK;IACL;GACF;GACA,MAAM,iBAAiB,KAAK,UAAU,OAAO;EAC/C,GAAG,EAAE,MAAM,IAAI;CACjB;AACF"}
@@ -0,0 +1,33 @@
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
+ //#region src/adapters/hono.ts
3
+ /** A Hono handler that forwards the raw request to `fetch`. */
4
+ const toHonoHandler = (fetch) => (c) => fetch(c.req.raw);
5
+ /**
6
+ * Route `path` (default `"*"`, everything) to `fetch` on `app`, for every
7
+ * method. Returns the app, so it chains. With a sub-path, mount both the path
8
+ * and everything below it: `mountPanel(app, fetch, "/webhooks")`.
9
+ */
10
+ function mountPanel(app, fetch, path = "*") {
11
+ const handler = toHonoHandler(fetch);
12
+ if (path === "*" || path === "/*") return app.all("*", handler);
13
+ const base = path.replace(/\/+$/, "");
14
+ app.all(base, handler);
15
+ return app.all(`${base}/*`, handler);
16
+ }
17
+ /**
18
+ * The context's `waitUntil`, bound and safe to call, or `undefined` on runtimes
19
+ * without one. Hono's `c.executionCtx` getter **throws** outside Workers, and
20
+ * `waitUntil` must be called as a method (li bf20268), so read it here.
21
+ */
22
+ function waitUntilOf(c) {
23
+ try {
24
+ const ctx = c.executionCtx;
25
+ if (ctx && typeof ctx.waitUntil === "function") return { waitUntil: (p) => ctx.waitUntil?.(p) };
26
+ } catch {}
27
+ }
28
+ //#endregion
29
+ exports.mountPanel = mountPanel;
30
+ exports.toHonoHandler = toHonoHandler;
31
+ exports.waitUntilOf = waitUntilOf;
32
+
33
+ //# sourceMappingURL=entry-adapters-hono.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"entry-adapters-hono.cjs","names":[],"sources":["../src/adapters/hono.ts"],"sourcesContent":["/**\n * Hono helpers. No `hono` import at runtime: {@link mountPanel} takes the\n * product's (or the user's) `Hono` app structurally, and {@link waitUntilOf}\n * reads the execution context defensively.\n *\n * ```ts\n * import { Hono } from \"hono\";\n * import { mountPanel } from \"@xtandard/kit/adapters/hono\";\n *\n * const app = new Hono();\n * mountPanel(app, panel.fetch); // every path, every method\n * ```\n *\n * @module\n */\n\nimport type { FetchHandler } from \"./node.ts\";\n\n/** The part of a Hono context the helpers read. */\nexport interface HonoContextLike {\n req: { raw: Request };\n /** Throws on runtimes without an execution context (Bun, Node). */\n readonly executionCtx?: unknown;\n}\n\n/** The part of a Hono app {@link mountPanel} uses. */\nexport interface HonoAppLike<App> {\n all(path: string, handler: (c: HonoContextLike) => Response | Promise<Response>): App;\n}\n\n/** A Hono handler that forwards the raw request to `fetch`. */\nexport const toHonoHandler =\n (fetch: FetchHandler) =>\n (c: HonoContextLike): Response | Promise<Response> =>\n fetch(c.req.raw);\n\n/**\n * Route `path` (default `\"*\"`, everything) to `fetch` on `app`, for every\n * method. Returns the app, so it chains. With a sub-path, mount both the path\n * and everything below it: `mountPanel(app, fetch, \"/webhooks\")`.\n */\nexport function mountPanel<App extends HonoAppLike<App>>(\n app: App,\n fetch: FetchHandler,\n path = \"*\",\n): App {\n const handler = toHonoHandler(fetch);\n if (path === \"*\" || path === \"/*\") return app.all(\"*\", handler);\n const base = path.replace(/\\/+$/, \"\");\n app.all(base, handler);\n return app.all(`${base}/*`, handler);\n}\n\n/** Something that can keep work alive past the response (Workers' `ExecutionContext`). */\nexport interface WaitUntil {\n waitUntil(promise: Promise<unknown>): void;\n}\n\n/**\n * The context's `waitUntil`, bound and safe to call, or `undefined` on runtimes\n * without one. Hono's `c.executionCtx` getter **throws** outside Workers, and\n * `waitUntil` must be called as a method (li bf20268), so read it here.\n */\nexport function waitUntilOf(c: HonoContextLike): WaitUntil | undefined {\n try {\n const ctx = c.executionCtx as { waitUntil?: (p: Promise<unknown>) => void } | undefined;\n if (ctx && typeof ctx.waitUntil === \"function\") {\n return { waitUntil: (p) => ctx.waitUntil?.(p) };\n }\n } catch {\n // No ExecutionContext (Bun / Node).\n }\n return undefined;\n}\n"],"mappings":";;;AA+BA,MAAa,iBACV,WACA,MACC,MAAM,EAAE,IAAI,GAAG;;;;;;AAOnB,SAAgB,WACd,KACA,OACA,OAAO,KACF;CACL,MAAM,UAAU,cAAc,KAAK;CACnC,IAAI,SAAS,OAAO,SAAS,MAAM,OAAO,IAAI,IAAI,KAAK,OAAO;CAC9D,MAAM,OAAO,KAAK,QAAQ,QAAQ,EAAE;CACpC,IAAI,IAAI,MAAM,OAAO;CACrB,OAAO,IAAI,IAAI,GAAG,KAAK,KAAK,OAAO;AACrC;;;;;;AAYA,SAAgB,YAAY,GAA2C;CACrE,IAAI;EACF,MAAM,MAAM,EAAE;EACd,IAAI,OAAO,OAAO,IAAI,cAAc,YAClC,OAAO,EAAE,YAAY,MAAM,IAAI,YAAY,CAAC,EAAE;CAElD,QAAQ,CAER;AAEF"}