acrylblends 1.0.4 → 1.0.6

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 (351) hide show
  1. package/docs/framework/agents/index.md +7 -5
  2. package/lib/accept-CNNHu4Cf.js +193 -0
  3. package/lib/{accepts-XBuZPVRI.js → accepts-Btq83xPd.js} +1 -1
  4. package/lib/accepts.js +1 -1
  5. package/lib/acryl-base.js +1 -331
  6. package/lib/adapter-CaZ6FZUU.js +37 -0
  7. package/lib/adapter.js +1 -36
  8. package/lib/{app-BM0rTCp7.js → app-CQcGWjrk.js} +4 -4
  9. package/lib/app-base-CpRMZL4v.js +332 -0
  10. package/lib/{audit-D5z9uwOP.d.ts → audit-GcLtvNLV.d.ts} +4 -2
  11. package/lib/{base-NSN_SNv-.js → base-D_6kfOr-.js} +1 -1
  12. package/lib/basic-auth-C0HTRpXh.js +20 -0
  13. package/lib/basic-auth-DFLflXNe.js +95 -0
  14. package/lib/basic-auth.js +1 -94
  15. package/lib/bearer-auth-Cwxt-vgS.js +94 -0
  16. package/lib/bearer-auth.js +1 -93
  17. package/lib/body-D7f4e7w_.js +94 -0
  18. package/lib/body-limit-WmIjWRLt.js +66 -0
  19. package/lib/body-limit.js +1 -65
  20. package/lib/buffer-CkEOJCcY.js +51 -0
  21. package/lib/bun.js +3 -3
  22. package/lib/cache-B0bHH7s5.js +169 -0
  23. package/lib/cache.js +1 -168
  24. package/lib/{client-DDLXwhBo.js → client-BrMFnMEd.js} +1 -1
  25. package/lib/{client-modules-CLvWOjbd.js → client-modules-drj4mjhj.js} +4 -4
  26. package/lib/client.js +1 -1
  27. package/lib/color-COa3DplO.js +37 -0
  28. package/lib/combine-TWuGdcbC.js +137 -0
  29. package/lib/combine.js +1 -136
  30. package/lib/{components-cEW3ovK0.js → components-B2ka9Ax1.js} +4 -4
  31. package/lib/{components-JXVm45kK.js → components-PVXwaOaC.js} +2 -2
  32. package/lib/compress-BzWqsHF1.js +79 -0
  33. package/lib/compress-C-9vK4B2.d.ts +11 -0
  34. package/lib/compress-DCyrrQ5D.js +11 -0
  35. package/lib/compress.d.ts +1 -1
  36. package/lib/compress.js +2 -78
  37. package/lib/concurrent-DrF3d2c-.js +30 -0
  38. package/lib/conninfo-BCROmdnf.d.ts +11 -0
  39. package/lib/conninfo-CWJwieh4.js +19 -0
  40. package/lib/constants-CBSEudrb.js +7 -0
  41. package/lib/{context-DDO0cfuP.js → context-CkOh7Ygv.js} +2 -2
  42. package/lib/context-storage-iuPoI_CR.js +52 -0
  43. package/lib/context-storage.js +1 -51
  44. package/lib/cookie-B1LlkzOe.js +125 -0
  45. package/lib/cookie-BHIduy2T.js +82 -0
  46. package/lib/cookie.js +1 -81
  47. package/lib/cordis/db-sqlite.d.ts +1 -1
  48. package/lib/cordis/door.d.ts +99 -5
  49. package/lib/cordis/door.js +562 -20
  50. package/lib/cordis/inspect.js +4 -4
  51. package/lib/cordis/kv-db.d.ts +1 -1
  52. package/lib/cordis/kv-db.js +1 -1
  53. package/lib/cordis/kv-json.d.ts +1 -1
  54. package/lib/cordis/kv-json.js +1 -1
  55. package/lib/cordis/node-server.d.ts +1 -1
  56. package/lib/cordis/node-server.js +3 -116
  57. package/lib/cordis/router-http.js +2 -2
  58. package/lib/cordis/router.js +4 -4
  59. package/lib/cordis/state.js +7 -7
  60. package/lib/{core-CaY8XDZ6.js → core-BOu1jYua.js} +1 -1
  61. package/lib/cors-CbAQ-8qU.js +106 -0
  62. package/lib/cors.js +1 -105
  63. package/lib/crypto-iVP-N-tS.js +34 -0
  64. package/lib/csrf-DqqOZtgy.js +101 -0
  65. package/lib/csrf.js +1 -100
  66. package/lib/css-C5CPVMvM.js +134 -0
  67. package/lib/css.js +2 -133
  68. package/lib/db/sqlite.d.ts +1 -25
  69. package/lib/dev-CLgu-JRe.js +50 -0
  70. package/lib/dev.js +1 -49
  71. package/lib/dom-YjND9Jt3.js +74 -0
  72. package/lib/door/host.d.ts +2 -2
  73. package/lib/door/host.js +1 -1
  74. package/lib/door/page.d.ts +3 -1
  75. package/lib/door/page.js +2 -2
  76. package/lib/door/protocol.d.ts +1 -1
  77. package/lib/door/protocol.js +1 -212
  78. package/lib/encode-BhbNLrjp.js +33 -0
  79. package/lib/factory-CLdSf-xS.js +30 -0
  80. package/lib/factory.js +1 -29
  81. package/lib/handler-C0wZ0KwO.js +12 -0
  82. package/lib/helpers-BEjcdbgw.js +5 -0
  83. package/lib/{hooks-w72iLeFR.js → hooks-CfC07ri0.js} +1 -1
  84. package/lib/html-CgNa89xw.js +31 -0
  85. package/lib/html-DGExBFNg.js +103 -0
  86. package/lib/html.d.ts +2 -5
  87. package/lib/html.js +2 -30
  88. package/lib/http-exception-MjWkT89V.js +54 -0
  89. package/lib/http-exception.js +1 -53
  90. package/lib/index-dAzQsJG9.d.ts +6 -0
  91. package/lib/index.js +3 -3
  92. package/lib/ip-restriction-jKtKCRM_.js +166 -0
  93. package/lib/ip-restriction.js +1 -165
  94. package/lib/ipaddr-DCoIo528.js +238 -0
  95. package/lib/jsx/dom/client.js +1 -1
  96. package/lib/jsx/dom/jsx-dev-runtime.js +1 -1
  97. package/lib/jsx/dom/jsx-runtime.js +2 -1
  98. package/lib/jsx/dom/server.js +3 -3
  99. package/lib/jsx/dom.js +5 -73
  100. package/lib/jsx/jsx-dev-runtime.d.ts +2 -5
  101. package/lib/jsx/jsx-dev-runtime.js +2 -13
  102. package/lib/jsx/jsx-runtime.d.ts +2 -2
  103. package/lib/jsx/jsx-runtime.js +4 -4
  104. package/lib/jsx/streaming.js +1 -1
  105. package/lib/jsx-CUQgttxU.js +47 -0
  106. package/lib/jsx-dev-runtime-B4WTyq8r.js +14 -0
  107. package/lib/{jsx-dev-runtime-CWLRA2F3.js → jsx-dev-runtime-BLfA-EhI.js} +2 -2
  108. package/lib/jsx-dev-runtime-CGt4kNYr.d.ts +6 -0
  109. package/lib/jsx-renderer-CfifM4hT.js +99 -0
  110. package/lib/jsx-renderer.js +1 -98
  111. package/lib/jsx-runtime-COCRWBJ9.js +2 -0
  112. package/lib/jsx.js +5 -46
  113. package/lib/{jwk-LkzeoaU8.js → jwk-CDPpYQpD.js} +3 -3
  114. package/lib/jwk.js +1 -1
  115. package/lib/{jwt-BGJBw5AF.js → jwt-BXoIA2fQ.js} +2 -2
  116. package/lib/{jwt-CskdhEW9.js → jwt-lyS4Q3mT.js} +3 -3
  117. package/lib/jwt.js +2 -2
  118. package/lib/kv/db.d.ts +1 -10
  119. package/lib/kv/db.js +1 -56
  120. package/lib/kv/json.d.ts +1 -9
  121. package/lib/kv/json.js +1 -223
  122. package/lib/{language-D9a4zqvn.js → language-DeGRtLJt.js} +2 -2
  123. package/lib/language.js +1 -1
  124. package/lib/{linear-router-C3FPib6h.js → linear-router-CmZn_JLV.js} +2 -2
  125. package/lib/logger-Ckxu8diz.js +54 -0
  126. package/lib/logger.js +1 -53
  127. package/lib/loopback-only-BbasoF7R.js +90 -0
  128. package/lib/loopback-only.js +1 -89
  129. package/lib/method-not-allowed-TO2_hnfl.js +82 -0
  130. package/lib/method-not-allowed.js +1 -81
  131. package/lib/method-override-DnZKfJbV.js +103 -0
  132. package/lib/method-override.js +1 -102
  133. package/lib/middleware-BfG_fp8P.js +12 -0
  134. package/lib/mime-BnScXkQn.js +77 -0
  135. package/lib/mount-QkK_3NtJ.js +67 -0
  136. package/lib/mount.js +1 -66
  137. package/lib/node-server/conninfo.d.ts +1 -10
  138. package/lib/node-server/conninfo.js +1 -18
  139. package/lib/node-server/register.js +25 -2
  140. package/lib/node-server/serve-static.d.ts +1 -17
  141. package/lib/node-server/serve-static.js +1 -1
  142. package/lib/node-server.d.ts +2 -2
  143. package/lib/node-server.js +4 -4
  144. package/lib/open-BqK4D2Wn.d.ts +11 -0
  145. package/lib/open-But9E2rL.js +57 -0
  146. package/lib/open-CULVJgOc.d.ts +12 -0
  147. package/lib/open-Dp4sxspc.js +224 -0
  148. package/lib/open-T7kgbO2O.d.ts +27 -0
  149. package/lib/{pattern-router-HZxjDGEQ.js → pattern-router-CJBecJBd.js} +1 -1
  150. package/lib/powered-by-CXQNjNIX.js +24 -0
  151. package/lib/powered-by.js +1 -23
  152. package/lib/pretty-json-CeC1yvYt.js +39 -0
  153. package/lib/pretty-json.js +1 -38
  154. package/lib/{protocol-C37gPePD.d.ts → protocol-CR31M7K_.d.ts} +2 -0
  155. package/lib/protocol-Dt0AZBOz.js +213 -0
  156. package/lib/proxy-C2w_mH7k.js +121 -0
  157. package/lib/proxy.js +1 -120
  158. package/lib/quick.js +4 -4
  159. package/lib/{reg-exp-router-DC1R3qoY.js → reg-exp-router-C_WV84eV.js} +2 -2
  160. package/lib/request-DvMgGtlW.js +323 -0
  161. package/lib/request.js +1 -322
  162. package/lib/route-D8m-a2I1.js +126 -0
  163. package/lib/route.js +1 -125
  164. package/lib/router/linear-router.js +1 -1
  165. package/lib/router/pattern-router.js +1 -1
  166. package/lib/router/reg-exp-router.js +1 -1
  167. package/lib/router/smart-router.js +1 -1
  168. package/lib/router/trie-router.js +1 -1
  169. package/lib/router-Be_o6nFu.js +35 -0
  170. package/lib/router.js +1 -34
  171. package/lib/schema-validator-EK3cUUCt.js +22 -0
  172. package/lib/schema-validator.js +1 -21
  173. package/lib/{secure-headers-mP3j6Hm6.js → secure-headers-C5ZOcXqk.js} +1 -1
  174. package/lib/secure-headers.js +1 -1
  175. package/lib/serve-static-B7sqnftW.d.ts +18 -0
  176. package/lib/{serve-static-3uo_9rjF.js → serve-static-C1Nkj_xB.js} +2 -2
  177. package/lib/{serve-static-Cp5adzGo.js → serve-static-EiJf1zkO.js} +4 -4
  178. package/lib/serve-static.js +1 -1
  179. package/lib/{smart-router-C5CZ5XSM.js → smart-router-BjxkDQCE.js} +1 -1
  180. package/lib/{snapshot-text-BLz8nlSc.js → snapshot-text-CtQm3n8n.js} +23 -14
  181. package/lib/{src-dy3Fk9tA.js → src-BTBm4OPD.js} +6 -6
  182. package/lib/src-LX0E4ec4.js +117 -0
  183. package/lib/{ssg-BwjcA-Ge.js → ssg-BEl7MHqg.js} +5 -5
  184. package/lib/ssg.js +1 -1
  185. package/lib/stream-CzM_SHkq.js +88 -0
  186. package/lib/{streaming-DHST3Scg.js → streaming-BlDaph8U.js} +3 -3
  187. package/lib/streaming.js +1 -1
  188. package/lib/{test-websocket-D8WWqE5G.js → test-websocket-BLeEvybj.js} +2 -2
  189. package/lib/testing-BQx5T_UX.js +17 -0
  190. package/lib/testing.js +1 -16
  191. package/lib/timeout-FeqZ9A-0.js +42 -0
  192. package/lib/timeout.js +1 -41
  193. package/lib/tiny.js +2 -2
  194. package/lib/trailing-slash-DwTx-1sk.js +85 -0
  195. package/lib/trailing-slash.js +1 -84
  196. package/lib/{trie-router-CfFbapzL.js → trie-router-JydLKUa2.js} +2 -2
  197. package/lib/url-BPh4d6j-.js +197 -0
  198. package/lib/utils/accept.js +1 -192
  199. package/lib/utils/basic-auth.js +1 -19
  200. package/lib/utils/body.js +1 -93
  201. package/lib/utils/buffer.js +1 -50
  202. package/lib/utils/color.js +1 -36
  203. package/lib/utils/compress.d.ts +1 -10
  204. package/lib/utils/compress.js +1 -10
  205. package/lib/utils/concurrent.js +1 -29
  206. package/lib/utils/constants.js +1 -6
  207. package/lib/utils/cookie.js +1 -124
  208. package/lib/utils/crypto.js +1 -33
  209. package/lib/utils/encode.js +1 -32
  210. package/lib/utils/handler.js +1 -11
  211. package/lib/utils/html.js +1 -102
  212. package/lib/utils/ipaddr.js +1 -237
  213. package/lib/utils/jwt.js +1 -1
  214. package/lib/utils/mime.js +1 -76
  215. package/lib/utils/stream.js +1 -87
  216. package/lib/utils/url.js +1 -196
  217. package/lib/{validator-D84mq-dO.js → validator-Btiyt5VJ.js} +3 -3
  218. package/lib/validator.js +1 -1
  219. package/lib/websocket-DsyBIKVA.js +56 -0
  220. package/lib/ws.js +1 -55
  221. package/package.json +1 -1
  222. package/plugins/acryl-door/src/cli/acryl.ts +36 -5
  223. package/plugins/acryl-door/src/host/channel.ts +14 -6
  224. package/plugins/acryl-door/src/host/chat-tools.ts +2 -0
  225. package/plugins/acryl-door/src/host/door.ts +97 -12
  226. package/plugins/acryl-door/src/host/page-routes.ts +3 -1
  227. package/plugins/acryl-door/src/host/shell.ts +147 -0
  228. package/plugins/acryl-door/src/host/shim.ts +39 -3
  229. package/plugins/acryl-door/src/host/verbs.ts +39 -2
  230. package/plugins/acryl-door/src/index.ts +22 -3
  231. package/plugins/acryl-door/src/page/channel.ts +3 -1
  232. package/plugins/acryl-door/src/page/index.ts +2 -1
  233. package/plugins/acryl-door/src/page/protocol.ts +2 -0
  234. package/plugins/acryl-door/src/shell/protocol.ts +130 -0
  235. package/plugins/acryl-node-server/src/register.ts +29 -2
  236. package/plugins/agent/model.ts +6 -1
  237. package/plugins/agent/tools.ts +12 -2
  238. package/plugins/agent-panel/client/describe.ts +44 -0
  239. package/plugins/agent-panel/client/main.ts +4 -1
  240. package/plugins/agent-panel/headless.ts +29 -8
  241. package/plugins/agent-panel/index.ts +22 -10
  242. package/plugins/agent-panel/launch.ts +67 -0
  243. package/plugins/desktop/attach.ts +72 -0
  244. package/plugins/desktop/door-shell.ts +379 -0
  245. package/plugins/desktop/main.ts +82 -15
  246. package/plugins/extensions/index.ts +3 -4
  247. package/plugins/extensions/stage.ts +33 -5
  248. package/plugins/openai/index.ts +1 -1
  249. package/templates/agent/AGENTS.md +4 -0
  250. package/templates/agent/blend.yaml +4 -1
  251. package/templates/agent/src/app.ts +2 -0
  252. package/templates/agent/src/routes.ts +1 -1
  253. package/templates/agent/template.json +1 -0
  254. package/templates/agent/test/builder.test.ts +26 -21
  255. package/lib/helpers-CvTauQT5.js +0 -5
  256. package/lib/middleware-CPQ8himN.js +0 -12
  257. package/plugins/acryl-router/src/connection.d.ts +0 -25
  258. package/plugins/acryl-router/src/core/app-base.d.ts +0 -215
  259. package/plugins/acryl-router/src/core/app.d.ts +0 -19
  260. package/plugins/acryl-router/src/core/client/client.d.ts +0 -4
  261. package/plugins/acryl-router/src/core/client/fetch-result-please.d.ts +0 -35
  262. package/plugins/acryl-router/src/core/client/index.d.ts +0 -7
  263. package/plugins/acryl-router/src/core/client/types.d.ts +0 -229
  264. package/plugins/acryl-router/src/core/client/utils.d.ts +0 -18
  265. package/plugins/acryl-router/src/core/compose.d.ts +0 -14
  266. package/plugins/acryl-router/src/core/context.d.ts +0 -443
  267. package/plugins/acryl-router/src/core/helper/accepts/accepts.d.ts +0 -30
  268. package/plugins/acryl-router/src/core/helper/accepts/index.d.ts +0 -5
  269. package/plugins/acryl-router/src/core/helper/conninfo/index.d.ts +0 -5
  270. package/plugins/acryl-router/src/core/helper/conninfo/types.d.ts +0 -36
  271. package/plugins/acryl-router/src/core/helper/cookie/index.d.ts +0 -25
  272. package/plugins/acryl-router/src/core/helper/css/common.d.ts +0 -59
  273. package/plugins/acryl-router/src/core/helper/css/index.d.ts +0 -80
  274. package/plugins/acryl-router/src/core/helper/dev/index.d.ts +0 -20
  275. package/plugins/acryl-router/src/core/helper/factory/index.d.ts +0 -82
  276. package/plugins/acryl-router/src/core/helper/html/index.d.ts +0 -8
  277. package/plugins/acryl-router/src/core/helper/proxy/index.d.ts +0 -73
  278. package/plugins/acryl-router/src/core/helper/route/index.d.ts +0 -75
  279. package/plugins/acryl-router/src/core/helper/ssg/index.d.ts +0 -7
  280. package/plugins/acryl-router/src/core/helper/ssg/middleware.d.ts +0 -44
  281. package/plugins/acryl-router/src/core/helper/ssg/plugins.d.ts +0 -27
  282. package/plugins/acryl-router/src/core/helper/ssg/ssg.d.ts +0 -91
  283. package/plugins/acryl-router/src/core/helper/ssg/utils.d.ts +0 -16
  284. package/plugins/acryl-router/src/core/helper/streaming/index.d.ts +0 -8
  285. package/plugins/acryl-router/src/core/helper/streaming/sse.d.ts +0 -13
  286. package/plugins/acryl-router/src/core/helper/streaming/stream.d.ts +0 -3
  287. package/plugins/acryl-router/src/core/helper/streaming/text.d.ts +0 -3
  288. package/plugins/acryl-router/src/core/helper/streaming/utils.d.ts +0 -1
  289. package/plugins/acryl-router/src/core/helper/testing/index.d.ts +0 -13
  290. package/plugins/acryl-router/src/core/helper/websocket/index.d.ts +0 -70
  291. package/plugins/acryl-router/src/core/http-exception.d.ts +0 -58
  292. package/plugins/acryl-router/src/core/index.d.ts +0 -37
  293. package/plugins/acryl-router/src/core/jsx/base.d.ts +0 -61
  294. package/plugins/acryl-router/src/core/jsx/children.d.ts +0 -9
  295. package/plugins/acryl-router/src/core/jsx/components.d.ts +0 -15
  296. package/plugins/acryl-router/src/core/jsx/constants.d.ts +0 -6
  297. package/plugins/acryl-router/src/core/jsx/context.d.ts +0 -51
  298. package/plugins/acryl-router/src/core/jsx/dom/components.d.ts +0 -10
  299. package/plugins/acryl-router/src/core/jsx/dom/context.d.ts +0 -3
  300. package/plugins/acryl-router/src/core/jsx/dom/css.d.ts +0 -83
  301. package/plugins/acryl-router/src/core/jsx/dom/hooks/index.d.ts +0 -39
  302. package/plugins/acryl-router/src/core/jsx/dom/intrinsic-element/components.d.ts +0 -16
  303. package/plugins/acryl-router/src/core/jsx/dom/jsx-dev-runtime.d.ts +0 -8
  304. package/plugins/acryl-router/src/core/jsx/dom/jsx-runtime.d.ts +0 -7
  305. package/plugins/acryl-router/src/core/jsx/dom/render.d.ts +0 -73
  306. package/plugins/acryl-router/src/core/jsx/dom/utils.d.ts +0 -1
  307. package/plugins/acryl-router/src/core/jsx/hooks/index.d.ts +0 -47
  308. package/plugins/acryl-router/src/core/jsx/index.d.ts +0 -76
  309. package/plugins/acryl-router/src/core/jsx/intrinsic-element/common.d.ts +0 -6
  310. package/plugins/acryl-router/src/core/jsx/intrinsic-element/components.d.ts +0 -13
  311. package/plugins/acryl-router/src/core/jsx/intrinsic-elements.d.ts +0 -735
  312. package/plugins/acryl-router/src/core/jsx/streaming.d.ts +0 -36
  313. package/plugins/acryl-router/src/core/jsx/types.d.ts +0 -36
  314. package/plugins/acryl-router/src/core/jsx/utils.d.ts +0 -4
  315. package/plugins/acryl-router/src/core/request/constants.d.ts +0 -1
  316. package/plugins/acryl-router/src/core/request.d.ts +0 -306
  317. package/plugins/acryl-router/src/core/router/reg-exp-router/index.d.ts +0 -6
  318. package/plugins/acryl-router/src/core/router/reg-exp-router/matcher.d.ts +0 -7
  319. package/plugins/acryl-router/src/core/router/reg-exp-router/node.d.ts +0 -13
  320. package/plugins/acryl-router/src/core/router/reg-exp-router/prepared-router.d.ts +0 -17
  321. package/plugins/acryl-router/src/core/router/reg-exp-router/router.d.ts +0 -11
  322. package/plugins/acryl-router/src/core/router/reg-exp-router/trie.d.ts +0 -8
  323. package/plugins/acryl-router/src/core/router/smart-router/index.d.ts +0 -5
  324. package/plugins/acryl-router/src/core/router/smart-router/router.d.ts +0 -11
  325. package/plugins/acryl-router/src/core/router/trie-router/index.d.ts +0 -5
  326. package/plugins/acryl-router/src/core/router/trie-router/node.d.ts +0 -6
  327. package/plugins/acryl-router/src/core/router/trie-router/router.d.ts +0 -7
  328. package/plugins/acryl-router/src/core/router/utils.d.ts +0 -1
  329. package/plugins/acryl-router/src/core/router.d.ts +0 -97
  330. package/plugins/acryl-router/src/core/types.d.ts +0 -573
  331. package/plugins/acryl-router/src/core/utils/accept.d.ts +0 -6
  332. package/plugins/acryl-router/src/core/utils/body.d.ts +0 -79
  333. package/plugins/acryl-router/src/core/utils/buffer.d.ts +0 -17
  334. package/plugins/acryl-router/src/core/utils/color.d.ts +0 -21
  335. package/plugins/acryl-router/src/core/utils/concurrent.d.ts +0 -11
  336. package/plugins/acryl-router/src/core/utils/constants.d.ts +0 -4
  337. package/plugins/acryl-router/src/core/utils/cookie.d.ts +0 -41
  338. package/plugins/acryl-router/src/core/utils/crypto.d.ts +0 -15
  339. package/plugins/acryl-router/src/core/utils/handler.d.ts +0 -6
  340. package/plugins/acryl-router/src/core/utils/headers.d.ts +0 -8
  341. package/plugins/acryl-router/src/core/utils/html.d.ts +0 -44
  342. package/plugins/acryl-router/src/core/utils/http-status.d.ts +0 -32
  343. package/plugins/acryl-router/src/core/utils/mime.d.ts +0 -70
  344. package/plugins/acryl-router/src/core/utils/stream.d.ts +0 -31
  345. package/plugins/acryl-router/src/core/utils/types.d.ts +0 -128
  346. package/plugins/acryl-router/src/core/utils/url.d.ts +0 -44
  347. package/plugins/acryl-router/src/core/validator/index.d.ts +0 -7
  348. package/plugins/acryl-router/src/core/validator/utils.d.ts +0 -29
  349. package/plugins/acryl-router/src/core/validator/validator.d.ts +0 -16
  350. package/plugins/acryl-router/src/helpers/index.d.ts +0 -17
  351. package/plugins/acryl-router/src/helpers/schema-validator.d.ts +0 -54
@@ -1,20 +0,0 @@
1
- /**
2
- * @module
3
- * Dev Helper for Acryl.
4
- */
5
- import type { Acryl } from '../../app.ts';
6
- import type { Env } from '../../types.ts';
7
- interface ShowRoutesOptions {
8
- verbose?: boolean;
9
- colorize?: boolean;
10
- }
11
- interface RouteData {
12
- path: string;
13
- method: string;
14
- name: string;
15
- isMiddleware: boolean;
16
- }
17
- export declare const inspectRoutes: <E extends Env>(acryl: Acryl<E>) => RouteData[];
18
- export declare const showRoutes: <E extends Env>(acryl: Acryl<E>, opts?: ShowRoutesOptions) => void;
19
- export declare const getRouterName: <E extends Env>(app: Acryl<E>) => string;
20
- export {};
@@ -1,82 +0,0 @@
1
- /**
2
- * @module
3
- * Factory Helper for Acryl.
4
- */
5
- import { Acryl } from '../../app.ts';
6
- import type { AcrylOptions } from '../../app-base.ts';
7
- import type { Env, H, HandlerResponse, Input, IntersectNonAnyTypes, MiddlewareHandler } from '../../types.ts';
8
- type InitApp<E extends Env = Env> = (app: Acryl<E>) => void;
9
- export interface CreateHandlersInterface<E extends Env, P extends string> {
10
- <I extends Input = {}, R extends HandlerResponse<any> = any, E2 extends Env = E>(handler1: H<E2, P, I, R>): [H<E2, P, I, R>];
11
- <I extends Input = {}, I2 extends Input = I, R extends HandlerResponse<any> = any, R2 extends HandlerResponse<any> = any, E2 extends Env = E, E3 extends Env = IntersectNonAnyTypes<[E, E2]>>(handler1: H<E2, P, I, R>, handler2: H<E3, P, I2, R2>): [H<E2, P, I, R>, H<E3, P, I2, R2>];
12
- <I extends Input = {}, I2 extends Input = I, I3 extends Input = I & I2, R extends HandlerResponse<any> = any, R2 extends HandlerResponse<any> = any, R3 extends HandlerResponse<any> = any, E2 extends Env = E, E3 extends Env = IntersectNonAnyTypes<[E, E2]>, E4 extends Env = IntersectNonAnyTypes<[E, E2, E3]>>(handler1: H<E2, P, I, R>, handler2: H<E3, P, I2, R2>, handler3: H<E4, P, I3, R3>): [H<E2, P, I, R>, H<E3, P, I2, R2>, H<E4, P, I3, R3>];
13
- <I extends Input = {}, I2 extends Input = I, I3 extends Input = I & I2, I4 extends Input = I & I2 & I3, R extends HandlerResponse<any> = any, R2 extends HandlerResponse<any> = any, R3 extends HandlerResponse<any> = any, R4 extends HandlerResponse<any> = any, E2 extends Env = E, E3 extends Env = IntersectNonAnyTypes<[E, E2]>, E4 extends Env = IntersectNonAnyTypes<[E, E2, E3]>, E5 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4]>>(handler1: H<E2, P, I, R>, handler2: H<E3, P, I2, R2>, handler3: H<E4, P, I3, R3>, handler4: H<E5, P, I4, R4>): [H<E2, P, I, R>, H<E3, P, I2, R2>, H<E4, P, I3, R3>, H<E5, P, I4, R4>];
14
- <I extends Input = {}, I2 extends Input = I, I3 extends Input = I & I2, I4 extends Input = I & I2 & I3, I5 extends Input = I & I2 & I3 & I4, R extends HandlerResponse<any> = any, R2 extends HandlerResponse<any> = any, R3 extends HandlerResponse<any> = any, R4 extends HandlerResponse<any> = any, R5 extends HandlerResponse<any> = any, E2 extends Env = E, E3 extends Env = IntersectNonAnyTypes<[E, E2]>, E4 extends Env = IntersectNonAnyTypes<[E, E2, E3]>, E5 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4]>, E6 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5]>>(handler1: H<E2, P, I, R>, handler2: H<E3, P, I2, R2>, handler3: H<E4, P, I3, R3>, handler4: H<E5, P, I4, R4>, handler5: H<E6, P, I5, R5>): [H<E2, P, I, R>, H<E3, P, I2, R2>, H<E4, P, I3, R3>, H<E5, P, I4, R4>, H<E6, P, I5, R5>];
15
- <I extends Input = {}, I2 extends Input = I, I3 extends Input = I & I2, I4 extends Input = I & I2 & I3, I5 extends Input = I & I2 & I3 & I4, I6 extends Input = I & I2 & I3 & I4 & I5, R extends HandlerResponse<any> = any, R2 extends HandlerResponse<any> = any, R3 extends HandlerResponse<any> = any, R4 extends HandlerResponse<any> = any, R5 extends HandlerResponse<any> = any, R6 extends HandlerResponse<any> = any, E2 extends Env = E, E3 extends Env = IntersectNonAnyTypes<[E, E2]>, E4 extends Env = IntersectNonAnyTypes<[E, E2, E3]>, E5 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4]>, E6 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5]>, E7 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6]>>(handler1: H<E2, P, I, R>, handler2: H<E3, P, I2, R2>, handler3: H<E4, P, I3, R3>, handler4: H<E5, P, I4, R4>, handler5: H<E6, P, I5, R5>, handler6: H<E7, P, I6, R6>): [
16
- H<E2, P, I, R>,
17
- H<E3, P, I2, R2>,
18
- H<E4, P, I3, R3>,
19
- H<E5, P, I4, R4>,
20
- H<E6, P, I5, R5>,
21
- H<E7, P, I6, R6>
22
- ];
23
- <I extends Input = {}, I2 extends Input = I, I3 extends Input = I & I2, I4 extends Input = I & I2 & I3, I5 extends Input = I & I2 & I3 & I4, I6 extends Input = I & I2 & I3 & I4 & I5, I7 extends Input = I & I2 & I3 & I4 & I5 & I6, R extends HandlerResponse<any> = any, R2 extends HandlerResponse<any> = any, R3 extends HandlerResponse<any> = any, R4 extends HandlerResponse<any> = any, R5 extends HandlerResponse<any> = any, R6 extends HandlerResponse<any> = any, R7 extends HandlerResponse<any> = any, E2 extends Env = E, E3 extends Env = IntersectNonAnyTypes<[E, E2]>, E4 extends Env = IntersectNonAnyTypes<[E, E2, E3]>, E5 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4]>, E6 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5]>, E7 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6]>, E8 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6, E7]>>(handler1: H<E2, P, I, R>, handler2: H<E3, P, I2, R2>, handler3: H<E4, P, I3, R3>, handler4: H<E5, P, I4, R4>, handler5: H<E6, P, I5, R5>, handler6: H<E7, P, I6, R6>, handler7: H<E8, P, I7, R7>): [
24
- H<E2, P, I, R>,
25
- H<E3, P, I2, R2>,
26
- H<E4, P, I3, R3>,
27
- H<E5, P, I4, R4>,
28
- H<E6, P, I5, R5>,
29
- H<E7, P, I6, R6>,
30
- H<E8, P, I7, R7>
31
- ];
32
- <I extends Input = {}, I2 extends Input = I, I3 extends Input = I & I2, I4 extends Input = I & I2 & I3, I5 extends Input = I & I2 & I3 & I4, I6 extends Input = I & I2 & I3 & I4 & I5, I7 extends Input = I & I2 & I3 & I4 & I5 & I6, I8 extends Input = I & I2 & I3 & I4 & I5 & I6 & I7, R extends HandlerResponse<any> = any, R2 extends HandlerResponse<any> = any, R3 extends HandlerResponse<any> = any, R4 extends HandlerResponse<any> = any, R5 extends HandlerResponse<any> = any, R6 extends HandlerResponse<any> = any, R7 extends HandlerResponse<any> = any, R8 extends HandlerResponse<any> = any, E2 extends Env = E, E3 extends Env = IntersectNonAnyTypes<[E, E2]>, E4 extends Env = IntersectNonAnyTypes<[E, E2, E3]>, E5 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4]>, E6 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5]>, E7 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6]>, E8 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6, E7]>, E9 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6, E7, E8]>>(handler1: H<E2, P, I, R>, handler2: H<E3, P, I2, R2>, handler3: H<E4, P, I3, R3>, handler4: H<E5, P, I4, R4>, handler5: H<E6, P, I5, R5>, handler6: H<E7, P, I6, R6>, handler7: H<E8, P, I7, R7>, handler8: H<E9, P, I8, R8>): [
33
- H<E2, P, I, R>,
34
- H<E3, P, I2, R2>,
35
- H<E4, P, I3, R3>,
36
- H<E5, P, I4, R4>,
37
- H<E6, P, I5, R5>,
38
- H<E7, P, I6, R6>,
39
- H<E8, P, I7, R7>,
40
- H<E9, P, I8, R8>
41
- ];
42
- <I extends Input = {}, I2 extends Input = I, I3 extends Input = I & I2, I4 extends Input = I & I2 & I3, I5 extends Input = I & I2 & I3 & I4, I6 extends Input = I & I2 & I3 & I4 & I5, I7 extends Input = I & I2 & I3 & I4 & I5 & I6, I8 extends Input = I & I2 & I3 & I4 & I5 & I6 & I7, I9 extends Input = I & I2 & I3 & I4 & I5 & I6 & I7 & I8, R extends HandlerResponse<any> = any, R2 extends HandlerResponse<any> = any, R3 extends HandlerResponse<any> = any, R4 extends HandlerResponse<any> = any, R5 extends HandlerResponse<any> = any, R6 extends HandlerResponse<any> = any, R7 extends HandlerResponse<any> = any, R8 extends HandlerResponse<any> = any, R9 extends HandlerResponse<any> = any, E2 extends Env = E, E3 extends Env = IntersectNonAnyTypes<[E, E2]>, E4 extends Env = IntersectNonAnyTypes<[E, E2, E3]>, E5 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4]>, E6 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5]>, E7 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6]>, E8 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6, E7]>, E9 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6, E7, E8]>, E10 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6, E7, E8, E9]>>(handler1: H<E2, P, I, R>, handler2: H<E3, P, I2, R2>, handler3: H<E4, P, I3, R3>, handler4: H<E5, P, I4, R4>, handler5: H<E6, P, I5, R5>, handler6: H<E7, P, I6, R6>, handler7: H<E8, P, I7, R7>, handler8: H<E9, P, I8, R8>, handler9: H<E10, P, I9, R9>): [
43
- H<E2, P, I, R>,
44
- H<E3, P, I2, R>,
45
- H<E4, P, I3, R>,
46
- H<E5, P, I4, R>,
47
- H<E6, P, I5, R>,
48
- H<E7, P, I6, R>,
49
- H<E8, P, I7, R>,
50
- H<E9, P, I8, R>,
51
- H<E10, P, I9, R>
52
- ];
53
- <I extends Input = {}, I2 extends Input = I, I3 extends Input = I & I2, I4 extends Input = I & I2 & I3, I5 extends Input = I & I2 & I3 & I4, I6 extends Input = I & I2 & I3 & I4 & I5, I7 extends Input = I & I2 & I3 & I4 & I5 & I6, I8 extends Input = I & I2 & I3 & I4 & I5 & I6 & I7, I9 extends Input = I & I2 & I3 & I4 & I5 & I6 & I7 & I8, I10 extends Input = I & I2 & I3 & I4 & I5 & I6 & I7 & I8 & I9, R extends HandlerResponse<any> = any, R2 extends HandlerResponse<any> = any, R3 extends HandlerResponse<any> = any, R4 extends HandlerResponse<any> = any, R5 extends HandlerResponse<any> = any, R6 extends HandlerResponse<any> = any, R7 extends HandlerResponse<any> = any, R8 extends HandlerResponse<any> = any, R9 extends HandlerResponse<any> = any, R10 extends HandlerResponse<any> = any, E2 extends Env = E, E3 extends Env = IntersectNonAnyTypes<[E, E2]>, E4 extends Env = IntersectNonAnyTypes<[E, E2, E3]>, E5 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4]>, E6 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5]>, E7 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6]>, E8 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6, E7]>, E9 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6, E7, E8]>, E10 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6, E7, E8, E9]>, E11 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6, E7, E8, E9, E10]>>(handler1: H<E2, P, I, R>, handler2: H<E3, P, I2, R2>, handler3: H<E4, P, I3, R3>, handler4: H<E5, P, I4, R4>, handler5: H<E6, P, I5, R5>, handler6: H<E7, P, I6, R6>, handler7: H<E8, P, I7, R7>, handler8: H<E9, P, I8, R8>, handler9: H<E10, P, I9, R9>, handler10: H<E11, P, I10, R10>): [
54
- H<E2, P, I, R>,
55
- H<E3, P, I2, R2>,
56
- H<E4, P, I3, R3>,
57
- H<E5, P, I4, R4>,
58
- H<E6, P, I5, R5>,
59
- H<E7, P, I6, R6>,
60
- H<E8, P, I7, R7>,
61
- H<E9, P, I8, R8>,
62
- H<E10, P, I9, R9>,
63
- H<E11, P, I10, R10>
64
- ];
65
- }
66
- export declare class Factory<E extends Env = Env, P extends string = string> {
67
- #private;
68
- private initApp?;
69
- constructor(init?: {
70
- initApp?: InitApp<E>;
71
- defaultAppOptions?: AcrylOptions<E>;
72
- });
73
- createApp: (options?: AcrylOptions<E>) => Acryl<E>;
74
- createMiddleware: <I extends Input = {}, R extends HandlerResponse<any> | void = void>(middleware: MiddlewareHandler<E, P, I, R extends void ? Response : R>) => MiddlewareHandler<E, P, I, R extends void ? Response : R>;
75
- createHandlers: CreateHandlersInterface<E, P>;
76
- }
77
- export declare const createFactory: <E extends Env = Env, P extends string = string>(init?: {
78
- initApp?: InitApp<E>;
79
- defaultAppOptions?: AcrylOptions<E>;
80
- }) => Factory<E, P>;
81
- export declare const createMiddleware: <E extends Env = any, P extends string = string, I extends Input = {}, R extends HandlerResponse<any> | void = void>(middleware: MiddlewareHandler<E, P, I, R extends void ? Response : R>) => MiddlewareHandler<E, P, I, R extends void ? Response : R>;
82
- export {};
@@ -1,8 +0,0 @@
1
- /**
2
- * @module
3
- * html Helper for Acryl.
4
- */
5
- import { raw } from '../../utils/html.ts';
6
- import type { HtmlEscapedString } from '../../utils/html.ts';
7
- export { raw };
8
- export declare const html: (strings: TemplateStringsArray, ...values: unknown[]) => HtmlEscapedString | Promise<HtmlEscapedString>;
@@ -1,73 +0,0 @@
1
- /**
2
- * @module
3
- * Proxy Helper for Acryl.
4
- */
5
- import type { RequestHeader } from '../../utils/headers.ts';
6
- import type { HeadersInit } from '../../utils/types.ts';
7
- interface ProxyRequestInit extends Omit<RequestInit, 'headers'> {
8
- raw?: Request;
9
- headers?: HeadersInit | [string, string][] | Record<RequestHeader, string | undefined> | Record<string, string | undefined>;
10
- customFetch?: (request: Request) => Promise<Response>;
11
- /**
12
- * Enable strict RFC 9110 compliance for Connection header processing.
13
- *
14
- * - `false` (default): Ignores Connection header to prevent potential
15
- * Hop-by-Hop Header Injection attacks. Recommended for untrusted clients.
16
- * - `true`: Processes Connection header per RFC 9110 and removes listed headers.
17
- * Only use in trusted environments.
18
- *
19
- * @default false
20
- * @see https://datatracker.ietf.org/doc/html/rfc9110#section-7.6.1
21
- */
22
- strictConnectionProcessing?: boolean;
23
- }
24
- interface ProxyFetch {
25
- (input: string | URL | Request, init?: ProxyRequestInit): Promise<Response>;
26
- }
27
- /**
28
- * Fetch API wrapper for proxy.
29
- * The parameters and return value are the same as for `fetch` (except for the proxy-specific options).
30
- *
31
- * The "Accept-Encoding" header is replaced with an encoding that the current runtime can handle.
32
- * Unnecessary response headers are deleted and a Response object is returned that can be returned
33
- * as is as a response from the handler.
34
- *
35
- * @example
36
- * ```ts
37
- * app.get('/proxy/:path', (c) => {
38
- * return proxy(`http://${originServer}/${c.req.param('path')}`, {
39
- * headers: {
40
- * ...c.req.header(), // optional, specify only when forwarding all the request data (including credentials) is necessary.
41
- * 'X-Forwarded-For': '127.0.0.1',
42
- * 'X-Forwarded-Host': c.req.header('host'),
43
- * Authorization: undefined, // do not propagate request headers contained in c.req.header('Authorization')
44
- * },
45
- * }).then((res) => {
46
- * res.headers.delete('Set-Cookie')
47
- * return res
48
- * })
49
- * })
50
- *
51
- * app.all('/proxy/:path', (c) => {
52
- * return proxy(`http://${originServer}/${c.req.param('path')}`, {
53
- * ...c.req, // optional, specify only when forwarding all the request data (including credentials) is necessary.
54
- * headers: {
55
- * ...c.req.header(),
56
- * 'X-Forwarded-For': '127.0.0.1',
57
- * 'X-Forwarded-Host': c.req.header('host'),
58
- * Authorization: undefined, // do not propagate request headers contained in c.req.header('Authorization')
59
- * },
60
- * })
61
- * })
62
- *
63
- * // Strict RFC compliance mode (use only in trusted environments)
64
- * app.get('/internal-proxy/:path', (c) => {
65
- * return proxy(`http://${internalServer}/${c.req.param('path')}`, {
66
- * ...c.req,
67
- * strictConnectionProcessing: true,
68
- * })
69
- * })
70
- * ```
71
- */
72
- export declare const proxy: ProxyFetch;
73
- export {};
@@ -1,75 +0,0 @@
1
- import type { Context } from '../../context.ts';
2
- import type { RouterRoute } from '../../types.ts';
3
- /**
4
- * Get matched routes in the handler
5
- *
6
- * @param {Context} c - The context object
7
- * @returns An array of matched routes
8
- *
9
- * @example
10
- * ```ts
11
- * import { matchedRoutes } from 'acrylblends/route'
12
- *
13
- * app.use('*', async function logger(c, next) {
14
- * await next()
15
- * matchedRoutes(c).forEach(({ handler, method, path }, i) => {
16
- * const name = handler.name || (handler.length < 2 ? '[handler]' : '[middleware]')
17
- * console.log(
18
- * method,
19
- * ' ',
20
- * path,
21
- * ' '.repeat(Math.max(10 - path.length, 0)),
22
- * name,
23
- * i === c.req.routeIndex ? '<- respond from here' : ''
24
- * )
25
- * })
26
- * })
27
- * ```
28
- */
29
- export declare const matchedRoutes: (c: Context) => RouterRoute[];
30
- /**
31
- * Get the route path registered within the handler
32
- *
33
- * @param {Context} c - The context object
34
- * @param {number} index - The index of the route from which to retrieve the path, similar to Array.prototype.at(), where a negative number is the index counted from the end of the matching route. Defaults to the current route index.
35
- * @returns The route path registered within the handler
36
- *
37
- * @example
38
- * ```ts
39
- * import { routePath } from 'acrylblends/route'
40
- *
41
- * app.use('*', (c, next) => {
42
- * console.log(routePath(c)) // '*'
43
- * console.log(routePath(c, -1)) // '/posts/:id'
44
- * return next()
45
- * })
46
- *
47
- * app.get('/posts/:id', (c) => {
48
- * return c.text(routePath(c)) // '/posts/:id'
49
- * })
50
- * ```
51
- */
52
- export declare const routePath: (c: Context, index?: number) => string;
53
- /**
54
- * Get the basePath of the as-is route specified by routing.
55
- *
56
- * @param {Context} c - The context object
57
- * @param {number} index - The index of the route from which to retrieve the path, similar to Array.prototype.at(), where a negative number is the index counted from the end of the matching route. Defaults to the current route index.
58
- * @returns The basePath of the as-is route specified by routing.
59
- *
60
- * @example
61
- * ```ts
62
- * import { baseRoutePath } from 'acrylblends/route'
63
- *
64
- * const app = new Acryl()
65
- *
66
- * const subApp = new Acryl()
67
- * subApp.get('/posts/:id', (c) => {
68
- * return c.text(baseRoutePath(c)) // '/:sub'
69
- * })
70
- *
71
- * app.route('/:sub', subApp)
72
- * ```
73
- */
74
- export declare const baseRoutePath: (c: Context, index?: number) => string;
75
- export declare const basePath: (c: Context, index?: number) => string;
@@ -1,7 +0,0 @@
1
- /**
2
- * @module
3
- * SSG Helper for Acryl.
4
- */
5
- export * from './ssg.ts';
6
- export { X_ACRYL_DISABLE_SSG_HEADER_KEY, ssgParams, isSSGContext, disableSSG, onlySSG, } from './middleware.ts';
7
- export { defaultPlugin, redirectPlugin } from './plugins.ts';
@@ -1,44 +0,0 @@
1
- import type { Context } from '../../context.ts';
2
- import type { Env, MiddlewareHandler } from '../../types.ts';
3
- export declare const SSG_CONTEXT = "ACRYL_SSG_CONTEXT";
4
- export declare const X_ACRYL_DISABLE_SSG_HEADER_KEY = "x-acryl-disable-ssg";
5
- /**
6
- * @deprecated
7
- * Use `X_ACRYL_DISABLE_SSG_HEADER_KEY` instead.
8
- * This constant will be removed in the next minor version.
9
- */
10
- export declare const SSG_DISABLED_RESPONSE: Response;
11
- interface SSGParam {
12
- [key: string]: string;
13
- }
14
- export type SSGParams = SSGParam[];
15
- interface SSGParamsMiddleware {
16
- <E extends Env = Env>(generateParams: (c: Context<E>) => SSGParams | Promise<SSGParams>): MiddlewareHandler<E>;
17
- <E extends Env = Env>(params: SSGParams): MiddlewareHandler<E>;
18
- }
19
- export type AddedSSGDataRequest = Request & {
20
- ssgParams?: SSGParams;
21
- };
22
- /**
23
- * Define SSG Route
24
- */
25
- export declare const ssgParams: SSGParamsMiddleware;
26
- /**
27
- * @experimental
28
- * `isSSGContext` is an experimental feature.
29
- * The API might be changed.
30
- */
31
- export declare const isSSGContext: (c: Context) => boolean;
32
- /**
33
- * @experimental
34
- * `disableSSG` is an experimental feature.
35
- * The API might be changed.
36
- */
37
- export declare const disableSSG: () => MiddlewareHandler;
38
- /**
39
- * @experimental
40
- * `onlySSG` is an experimental feature.
41
- * The API might be changed.
42
- */
43
- export declare const onlySSG: () => MiddlewareHandler;
44
- export {};
@@ -1,27 +0,0 @@
1
- import type { SSGPlugin } from './ssg.ts';
2
- /**
3
- * The default plugin that defines the recommended behavior.
4
- *
5
- * @experimental
6
- * `defaultPlugin` is an experimental feature.
7
- * The API might be changed.
8
- */
9
- export declare const defaultPlugin: () => SSGPlugin;
10
- /**
11
- * The redirect plugin that generates HTML redirect pages for HTTP redirect responses for status codes 301, 302, 303, 307 and 308.
12
- *
13
- * When used with `defaultPlugin`, place `redirectPlugin` before it, because `defaultPlugin` skips non-200 responses.
14
- *
15
- * ```ts
16
- * // ✅ Will work as expected
17
- * toSSG(app, fs, { plugins: [redirectPlugin(), defaultPlugin()] })
18
- *
19
- * // ❌ Will not work as expected
20
- * toSSG(app, fs, { plugins: [defaultPlugin(), redirectPlugin()] })
21
- * ```
22
- *
23
- * @experimental
24
- * `redirectPlugin` is an experimental feature.
25
- * The API might be changed.
26
- */
27
- export declare const redirectPlugin: () => SSGPlugin;
@@ -1,91 +0,0 @@
1
- import type { Acryl } from '../../app.ts';
2
- import type { Env, Schema } from '../../types.ts';
3
- export declare const DEFAULT_OUTPUT_DIR = "./static";
4
- /**
5
- * @experimental
6
- * `FileSystemModule` is an experimental feature.
7
- * The API might be changed.
8
- */
9
- export interface FileSystemModule {
10
- writeFile(path: string, data: string | Uint8Array): Promise<void>;
11
- mkdir(path: string, options: {
12
- recursive: boolean;
13
- }): Promise<void | string>;
14
- }
15
- /**
16
- * @experimental
17
- * `ToSSGResult` is an experimental feature.
18
- * The API might be changed.
19
- */
20
- export interface ToSSGResult {
21
- success: boolean;
22
- files: string[];
23
- error?: Error;
24
- }
25
- export declare const defaultExtensionMap: Record<string, string>;
26
- export type BeforeRequestHook = (req: Request) => Request | false | Promise<Request | false>;
27
- export type AfterResponseHook = (res: Response) => Response | false | Promise<Response | false>;
28
- export type AfterGenerateHook = (result: ToSSGResult, fsModule: FileSystemModule, options?: ToSSGOptions) => void | Promise<void>;
29
- export declare const combineBeforeRequestHooks: (hooks: BeforeRequestHook | BeforeRequestHook[]) => BeforeRequestHook;
30
- export declare const combineAfterResponseHooks: (hooks: AfterResponseHook | AfterResponseHook[]) => AfterResponseHook;
31
- export declare const combineAfterGenerateHooks: (hooks: AfterGenerateHook | AfterGenerateHook[], fsModule: FileSystemModule, options?: ToSSGOptions) => AfterGenerateHook;
32
- export interface SSGPlugin {
33
- beforeRequestHook?: BeforeRequestHook | BeforeRequestHook[];
34
- afterResponseHook?: AfterResponseHook | AfterResponseHook[];
35
- afterGenerateHook?: AfterGenerateHook | AfterGenerateHook[];
36
- }
37
- export interface ToSSGOptions {
38
- dir?: string;
39
- /**
40
- * @deprecated Use plugins[].beforeRequestHook instead.
41
- */
42
- beforeRequestHook?: BeforeRequestHook | BeforeRequestHook[];
43
- /**
44
- * @deprecated Use plugins[].afterResponseHook instead.
45
- */
46
- afterResponseHook?: AfterResponseHook | AfterResponseHook[];
47
- /**
48
- * @deprecated Use plugins[].afterGenerateHook instead.
49
- */
50
- afterGenerateHook?: AfterGenerateHook | AfterGenerateHook[];
51
- concurrency?: number;
52
- extensionMap?: Record<string, string>;
53
- plugins?: SSGPlugin[];
54
- }
55
- /**
56
- * @experimental
57
- * `fetchRoutesContent` is an experimental feature.
58
- * The API might be changed.
59
- */
60
- export declare const fetchRoutesContent: <E extends Env = Env, S extends Schema = {}, BasePath extends string = "/">(app: Acryl<E, S, BasePath>, beforeRequestHook?: BeforeRequestHook, afterResponseHook?: AfterResponseHook, concurrency?: number) => Generator<Promise<Generator<Promise<{
61
- routePath: string;
62
- mimeType: string;
63
- content: string | ArrayBuffer;
64
- } | undefined>> | undefined>>;
65
- export declare const saveContentToFile: (data: Promise<{
66
- routePath: string;
67
- content: string | ArrayBuffer;
68
- mimeType: string;
69
- } | undefined>, fsModule: FileSystemModule, outDir: string, extensionMap?: Record<string, string>) => Promise<string | undefined>;
70
- /**
71
- * @experimental
72
- * `ToSSGInterface` is an experimental feature.
73
- * The API might be changed.
74
- */
75
- export interface ToSSGInterface {
76
- (app: Acryl<any, any, any>, fsModule: FileSystemModule, options?: ToSSGOptions): Promise<ToSSGResult>;
77
- }
78
- /**
79
- * @experimental
80
- * `ToSSGAdaptorInterface` is an experimental feature.
81
- * The API might be changed.
82
- */
83
- export interface ToSSGAdaptorInterface<E extends Env = Env, S extends Schema = {}, BasePath extends string = '/'> {
84
- (app: Acryl<E, S, BasePath>, options?: ToSSGOptions): Promise<ToSSGResult>;
85
- }
86
- /**
87
- * @experimental
88
- * `toSSG` is an experimental feature.
89
- * The API might be changed.
90
- */
91
- export declare const toSSG: ToSSGInterface;
@@ -1,16 +0,0 @@
1
- import type { Acryl } from '../../app.ts';
2
- import type { Env } from '../../types.ts';
3
- /**
4
- * Get dirname
5
- * @param path File Path
6
- * @returns Parent dir path
7
- */
8
- export declare const dirname: (path: string) => string;
9
- export declare const joinPaths: (...paths: string[]) => string;
10
- interface FilterStaticGenerateRouteData {
11
- path: string;
12
- }
13
- export declare const filterStaticGenerateRoutes: <E extends Env>(acryl: Acryl<E>) => FilterStaticGenerateRouteData[];
14
- export declare const isDynamicRoute: (path: string) => boolean;
15
- export declare const ensureWithinOutDir: (outDir: string, filePath: string) => void;
16
- export {};
@@ -1,8 +0,0 @@
1
- /**
2
- * @module
3
- * Streaming Helper for Acryl.
4
- */
5
- export { stream } from './stream.ts';
6
- export type { SSEMessage } from './sse.ts';
7
- export { streamSSE, SSEStreamingApi } from './sse.ts';
8
- export { streamText } from './text.ts';
@@ -1,13 +0,0 @@
1
- import type { Context } from '../../context.ts';
2
- import { StreamingApi } from '../../utils/stream.ts';
3
- export interface SSEMessage {
4
- data: string | Promise<string>;
5
- event?: string;
6
- id?: string;
7
- retry?: number;
8
- }
9
- export declare class SSEStreamingApi extends StreamingApi {
10
- constructor(writable: WritableStream, readable: ReadableStream);
11
- writeSSE(message: SSEMessage): Promise<void>;
12
- }
13
- export declare const streamSSE: (c: Context, cb: (stream: SSEStreamingApi) => Promise<void>, onError?: (e: Error, stream: SSEStreamingApi) => Promise<void>) => Response;
@@ -1,3 +0,0 @@
1
- import type { Context } from '../../context.ts';
2
- import { StreamingApi } from '../../utils/stream.ts';
3
- export declare const stream: (c: Context, cb: (stream: StreamingApi) => Promise<void>, onError?: (e: Error, stream: StreamingApi) => Promise<void>) => Response;
@@ -1,3 +0,0 @@
1
- import type { Context } from '../../context.ts';
2
- import type { StreamingApi } from '../../utils/stream.ts';
3
- export declare const streamText: (c: Context, cb: (stream: StreamingApi) => Promise<void>, onError?: (e: Error, stream: StreamingApi) => Promise<void>) => Response;
@@ -1 +0,0 @@
1
- export declare let isOldBunVersion: () => boolean;
@@ -1,13 +0,0 @@
1
- /**
2
- * @module
3
- * Testing Helper for Acryl.
4
- */
5
- import type { ClientRequestOptions } from '../../client/index.ts';
6
- import type { Client } from '../../client/types.ts';
7
- import type { ExecutionContext } from '../../context.ts';
8
- import type { Acryl } from '../../app.ts';
9
- import type { Schema } from '../../types.ts';
10
- import type { UnionToIntersection } from '../../utils/types.ts';
11
- type ExtractEnv<T> = T extends Acryl<infer E, Schema, string> ? E : never;
12
- export declare const testClient: <T extends Acryl<any, Schema, string>>(app: T, Env?: ExtractEnv<T>["Bindings"] | {}, executionCtx?: ExecutionContext, options?: Omit<ClientRequestOptions, "fetch">) => UnionToIntersection<Client<T, "http://localhost">>;
13
- export {};
@@ -1,70 +0,0 @@
1
- /**
2
- * @module
3
- * WebSocket Helper for Acryl.
4
- */
5
- import type { Context } from '../../context.ts';
6
- import type { MiddlewareHandler, TypedResponse } from '../../types.ts';
7
- import type { StatusCode } from '../../utils/http-status.ts';
8
- import type { BinaryType, CloseEvent, MessageEvent } from '../../utils/types.ts';
9
- /**
10
- * WebSocket Event Listeners type
11
- */
12
- export interface WSEvents<T = unknown> {
13
- onOpen?: (evt: Event, ws: WSContext<T>) => void;
14
- onMessage?: (evt: MessageEvent<WSMessageReceive>, ws: WSContext<T>) => void;
15
- onClose?: (evt: CloseEvent, ws: WSContext<T>) => void;
16
- onError?: (evt: Event, ws: WSContext<T>) => void;
17
- }
18
- /**
19
- * Upgrade WebSocket Type
20
- */
21
- export interface UpgradeWebSocket<T = unknown, U = any, _WSEvents = WSEvents<T>> {
22
- (createEvents: (c: Context) => _WSEvents | Promise<_WSEvents>, options?: U): MiddlewareHandler<any, string, {
23
- outputFormat: 'ws';
24
- }>;
25
- (c: Context, events: _WSEvents, options?: U): Promise<Response & TypedResponse<{}, StatusCode, 'ws'>>;
26
- }
27
- /**
28
- * ReadyState for WebSocket
29
- */
30
- export type WSReadyState = 0 | 1 | 2 | 3;
31
- /**
32
- * An argument for WSContext class
33
- */
34
- export interface WSContextInit<T = unknown> {
35
- send(data: string | ArrayBuffer | Uint8Array<ArrayBuffer>, options: SendOptions): void;
36
- close(code?: number, reason?: string): void;
37
- raw?: T;
38
- readyState: WSReadyState;
39
- url?: string | URL | null;
40
- protocol?: string | null;
41
- }
42
- /**
43
- * Options for sending message
44
- */
45
- export interface SendOptions {
46
- compress?: boolean;
47
- }
48
- /**
49
- * A context for controlling WebSockets
50
- */
51
- export declare class WSContext<T = unknown> {
52
- #private;
53
- constructor(init: WSContextInit<T>);
54
- send(source: string | ArrayBuffer | Uint8Array<ArrayBuffer>, options?: SendOptions): void;
55
- raw?: T;
56
- binaryType: BinaryType;
57
- get readyState(): WSReadyState;
58
- url: URL | null;
59
- protocol: string | null;
60
- close(code?: number, reason?: string): void;
61
- }
62
- export type WSMessageReceive = string | Blob | ArrayBufferLike;
63
- export declare const createWSMessageEvent: (source: WSMessageReceive) => MessageEvent<WSMessageReceive>;
64
- export interface WebSocketHelperDefineContext {
65
- }
66
- export type WebSocketHelperDefineHandler<T, U> = (c: Context, events: WSEvents<T>, options?: U) => Promise<Response | void> | Response | void;
67
- /**
68
- * Create a WebSocket adapter/helper
69
- */
70
- export declare const defineWebSocketHelper: <T = unknown, U = any>(handler: WebSocketHelperDefineHandler<T, U>) => UpgradeWebSocket<T, U>;
@@ -1,58 +0,0 @@
1
- /**
2
- * @module
3
- * This module provides the `HTTPException` class.
4
- */
5
- import type { ContentfulStatusCode } from './utils/http-status.ts';
6
- /**
7
- * Options for creating an `HTTPException`.
8
- * @property res - Optional response object to use.
9
- * @property message - Optional custom error message.
10
- * @property cause - Optional cause of the error.
11
- */
12
- type HTTPExceptionOptions = {
13
- res?: Response;
14
- message?: string;
15
- cause?: unknown;
16
- };
17
- /**
18
- * `HTTPException` must be used when a fatal error such as authentication failure occurs.
19
- *
20
- *
21
- * @param {StatusCode} status - status code of HTTPException
22
- * @param {HTTPExceptionOptions} options - options of HTTPException
23
- * @param {HTTPExceptionOptions["res"]} options.res - response of options of HTTPException
24
- * @param {HTTPExceptionOptions["message"]} options.message - message of options of HTTPException
25
- * @param {HTTPExceptionOptions["cause"]} options.cause - cause of options of HTTPException
26
- *
27
- * @example
28
- * ```ts
29
- * import { HTTPException } from 'acrylblends/http-exception'
30
- *
31
- * // ...
32
- *
33
- * app.post('/auth', async (c, next) => {
34
- * // authentication
35
- * if (authorized === false) {
36
- * throw new HTTPException(401, { message: 'Custom error message' })
37
- * }
38
- * await next()
39
- * })
40
- * ```
41
- */
42
- export declare class HTTPException extends Error {
43
- readonly res?: Response;
44
- readonly status: ContentfulStatusCode;
45
- /**
46
- * Creates an instance of `HTTPException`.
47
- * @param status - HTTP status code for the exception. Defaults to 500.
48
- * @param options - Additional options for the exception.
49
- */
50
- constructor(status?: ContentfulStatusCode, options?: HTTPExceptionOptions);
51
- /**
52
- * Returns the response object associated with the exception.
53
- * If a response object is not provided, a new response is created with the error message and status code.
54
- * @returns The response object.
55
- */
56
- getResponse(): Response;
57
- }
58
- export {};