@acryldev/blends 0.0.0-stage → 1.7.1
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.
- package/LICENSE +73 -0
- package/README.md +424 -2
- package/bin/acrylblends.js +12 -0
- package/dist/index.d.ts +231 -0
- package/dist/index.js +4505 -0
- package/dist/index.js.map +1 -0
- package/lib/accept-B13wFRkc.js +193 -0
- package/lib/accepts-BN4uue4T.js +52 -0
- package/lib/accepts.d.ts +33 -0
- package/lib/accepts.js +2 -0
- package/lib/acryl-base.d.ts +2 -0
- package/lib/acryl-base.js +2 -0
- package/lib/adapter-Wt9Ntyhx.js +37 -0
- package/lib/adapter.d.ts +12 -0
- package/lib/adapter.js +2 -0
- package/lib/app-CM-rDcw6.js +26 -0
- package/lib/app-DGqSNBSd.d.ts +21 -0
- package/lib/app-base-BwplqlWX.js +332 -0
- package/lib/audit-B2H3sUfg.d.ts +136 -0
- package/lib/base-N-QVQhMZ.d.ts +783 -0
- package/lib/base-kl8P-za0.js +722 -0
- package/lib/basic-auth-ByZGvWGz.js +95 -0
- package/lib/basic-auth-CzulvSad.js +20 -0
- package/lib/basic-auth.d.ts +72 -0
- package/lib/basic-auth.js +2 -0
- package/lib/bearer-auth-CfR6YNqy.js +94 -0
- package/lib/bearer-auth.d.ts +89 -0
- package/lib/bearer-auth.js +2 -0
- package/lib/body-BQ-J23GI.js +94 -0
- package/lib/body-limit-DyO82Wes.js +66 -0
- package/lib/body-limit.d.ts +42 -0
- package/lib/body-limit.js +2 -0
- package/lib/browser/client.js +307 -0
- package/lib/browser/jsx-dom.js +1432 -0
- package/lib/browser/read-sse.js +84 -0
- package/lib/buffer-CWpxJrvI.js +51 -0
- package/lib/bun.d.ts +75 -0
- package/lib/bun.js +134 -0
- package/lib/cache-DllEV7kz.js +169 -0
- package/lib/cache.d.ts +43 -0
- package/lib/cache.js +2 -0
- package/lib/cell-wEBQA3d0.d.ts +32 -0
- package/lib/client-BMFCUlHG.js +143 -0
- package/lib/client-modules-ChLgW0l9.js +267 -0
- package/lib/client.d.ts +3 -0
- package/lib/client.js +3 -0
- package/lib/color-C26GR4OI.js +37 -0
- package/lib/combine-rXRCRMJx.js +137 -0
- package/lib/combine.d.ts +85 -0
- package/lib/combine.js +2 -0
- package/lib/common-CaqP5LIh.d.ts +46 -0
- package/lib/components-BZ8vBk_7.js +268 -0
- package/lib/components-Cq4hcRbo.js +24 -0
- package/lib/compose-DbuvN1rE.js +50 -0
- package/lib/compress-C7QjZM5f.js +11 -0
- package/lib/compress-CdDuP9-S.d.ts +11 -0
- package/lib/compress-T36YxGla.js +79 -0
- package/lib/compress.d.ts +38 -0
- package/lib/compress.js +3 -0
- package/lib/concurrent-B7z-2cwF.js +30 -0
- package/lib/connection-CzRPq1RP.d.ts +25 -0
- package/lib/connection-DLPx5pxD.js +24 -0
- package/lib/conninfo-BbxlV2HK.d.ts +11 -0
- package/lib/conninfo-CNYXEtnA.js +19 -0
- package/lib/conninfo.d.ts +3 -0
- package/lib/conninfo.js +2 -0
- package/lib/constants-D914mQY7.js +7 -0
- package/lib/constants-nJj4XhwC.js +4 -0
- package/lib/constants-vv1oZD_p.js +9 -0
- package/lib/context-BVI2RzT7.js +365 -0
- package/lib/context-Ca3uX_bh.d.ts +1234 -0
- package/lib/context-Dre4P1UW.d.ts +250 -0
- package/lib/context-storage-ClUlVtCZ.js +52 -0
- package/lib/context-storage.d.ts +38 -0
- package/lib/context-storage.js +2 -0
- package/lib/cookie-BqeGZ43j.d.ts +40 -0
- package/lib/cookie-DktnJ0tJ.js +82 -0
- package/lib/cookie-uMH6wAF3.js +125 -0
- package/lib/cookie.d.ts +24 -0
- package/lib/cookie.js +2 -0
- package/lib/cordis/db-sqlite.d.ts +56 -0
- package/lib/cordis/db-sqlite.js +66 -0
- package/lib/cordis/db.d.ts +8 -0
- package/lib/cordis/db.js +1 -0
- package/lib/cordis/door.d.ts +404 -0
- package/lib/cordis/door.js +1812 -0
- package/lib/cordis/inspect.d.ts +77 -0
- package/lib/cordis/inspect.js +149 -0
- package/lib/cordis/kv-db.d.ts +16 -0
- package/lib/cordis/kv-db.js +18 -0
- package/lib/cordis/kv-json.d.ts +16 -0
- package/lib/cordis/kv-json.js +52 -0
- package/lib/cordis/kv.d.ts +8 -0
- package/lib/cordis/kv.js +1 -0
- package/lib/cordis/node-server.d.ts +155 -0
- package/lib/cordis/node-server.js +4 -0
- package/lib/cordis/router-http.d.ts +85 -0
- package/lib/cordis/router-http.js +206 -0
- package/lib/cordis/router.d.ts +7 -0
- package/lib/cordis/router.js +6 -0
- package/lib/cordis/state/react.d.ts +6 -0
- package/lib/cordis/state/react.js +11 -0
- package/lib/cordis/state.d.ts +34 -0
- package/lib/cordis/state.js +527 -0
- package/lib/core-4oDBzv4Q.js +19 -0
- package/lib/cors-C0qqZ-O-.js +106 -0
- package/lib/cors.d.ts +52 -0
- package/lib/cors.js +2 -0
- package/lib/crypto-ciSjk9n3.js +34 -0
- package/lib/csrf-rMr2nM2c.js +101 -0
- package/lib/csrf.d.ts +75 -0
- package/lib/csrf.js +2 -0
- package/lib/css-Bd6tj88A.js +320 -0
- package/lib/css-CLgKjBuO.js +134 -0
- package/lib/css.d.ts +82 -0
- package/lib/css.js +3 -0
- package/lib/database-CyKvumAn.d.ts +44 -0
- package/lib/db/conformance.d.ts +15 -0
- package/lib/db/conformance.js +279 -0
- package/lib/db/sqlite.d.ts +3 -0
- package/lib/db/sqlite.js +2 -0
- package/lib/db.d.ts +3 -0
- package/lib/db.js +2 -0
- package/lib/dev-h25puJmg.js +50 -0
- package/lib/dev.d.ts +19 -0
- package/lib/dev.js +2 -0
- package/lib/dom-MsnhZjjn.js +74 -0
- package/lib/door/host.d.ts +24 -0
- package/lib/door/host.js +2 -0
- package/lib/door/page.d.ts +160 -0
- package/lib/door/page.js +1257 -0
- package/lib/door/protocol.d.ts +2 -0
- package/lib/door/protocol.js +2 -0
- package/lib/drivers.d.ts +77 -0
- package/lib/drivers.js +16 -0
- package/lib/encode-BbgU91Gc.js +33 -0
- package/lib/etag-DevxEjyU.js +135 -0
- package/lib/etag.d.ts +40 -0
- package/lib/etag.js +2 -0
- package/lib/factory-d6WBwm2j.js +30 -0
- package/lib/factory.d.ts +35 -0
- package/lib/factory.js +2 -0
- package/lib/handler-DXCHa3NV.js +12 -0
- package/lib/headers-DbujLUIi.d.ts +11 -0
- package/lib/helpers-qmReU164.js +5 -0
- package/lib/hooks-Bs7lFRjW.js +762 -0
- package/lib/html-1jTa7KN1.js +103 -0
- package/lib/html-CNr9FLdV.d.ts +46 -0
- package/lib/html-CoWdxS1u.js +31 -0
- package/lib/html.d.ts +3 -0
- package/lib/html.js +3 -0
- package/lib/http-exception-BKMYq4x6.js +54 -0
- package/lib/http-exception-Cm8QD9Fl.d.ts +57 -0
- package/lib/http-exception.d.ts +2 -0
- package/lib/http-exception.js +2 -0
- package/lib/http-status-uBFmbzzM.d.ts +35 -0
- package/lib/index-B_g6ECnm.d.ts +57 -0
- package/lib/index-BaOiJMWK.d.ts +31 -0
- package/lib/index-C5RhEyXO.d.ts +45 -0
- package/lib/index-C8xOqNUW.d.ts +71 -0
- package/lib/index-D1HlwHSL.d.ts +129 -0
- package/lib/index-DUYLk7OD.d.ts +44 -0
- package/lib/index-DYBSr8yW.d.ts +156 -0
- package/lib/index-Dv4qFsro.d.ts +94 -0
- package/lib/index-jdWVs88B.d.ts +6 -0
- package/lib/index.d.ts +4 -0
- package/lib/index.js +4 -0
- package/lib/ip-restriction-C4TZKPKl.js +166 -0
- package/lib/ip-restriction.d.ts +68 -0
- package/lib/ip-restriction.js +2 -0
- package/lib/ipaddr-CTeN6kNw.js +238 -0
- package/lib/jsx/dom/client.d.ts +30 -0
- package/lib/jsx/dom/client.js +49 -0
- package/lib/jsx/dom/css.d.ts +84 -0
- package/lib/jsx/dom/css.js +2 -0
- package/lib/jsx/dom/jsx-dev-runtime.d.ts +3 -0
- package/lib/jsx/dom/jsx-dev-runtime.js +2 -0
- package/lib/jsx/dom/jsx-runtime.d.ts +3 -0
- package/lib/jsx/dom/jsx-runtime.js +3 -0
- package/lib/jsx/dom/server.d.ts +105 -0
- package/lib/jsx/dom/server.js +37 -0
- package/lib/jsx/dom.d.ts +5 -0
- package/lib/jsx/dom.js +6 -0
- package/lib/jsx/jsx-dev-runtime.d.ts +3 -0
- package/lib/jsx/jsx-dev-runtime.js +3 -0
- package/lib/jsx/jsx-runtime.d.ts +10 -0
- package/lib/jsx/jsx-runtime.js +30 -0
- package/lib/jsx/streaming.d.ts +2 -0
- package/lib/jsx/streaming.js +2 -0
- package/lib/jsx-C5-YJG0l.js +47 -0
- package/lib/jsx-dev-runtime-CPsrmbgy.d.ts +7 -0
- package/lib/jsx-dev-runtime-Cs-uV30u.js +14 -0
- package/lib/jsx-dev-runtime-DK4z4RD3.js +354 -0
- package/lib/jsx-dev-runtime-DSQ8vSCY.d.ts +6 -0
- package/lib/jsx-renderer-B2wHa9Y8.js +99 -0
- package/lib/jsx-renderer.d.ts +75 -0
- package/lib/jsx-renderer.js +2 -0
- package/lib/jsx-runtime-BVVgDSdq.d.ts +1 -0
- package/lib/jsx-runtime-brX0UliB.js +2 -0
- package/lib/jsx.d.ts +3 -0
- package/lib/jsx.js +6 -0
- package/lib/jwk-BbiXIYhg.js +117 -0
- package/lib/jwk.d.ts +52 -0
- package/lib/jwk.js +2 -0
- package/lib/jwt-BCS5hH1O.d.ts +51 -0
- package/lib/jwt-Culfq-8m.js +403 -0
- package/lib/jwt-DaOoWaF3.js +115 -0
- package/lib/jwt.d.ts +72 -0
- package/lib/jwt.js +3 -0
- package/lib/kv/conformance.d.ts +17 -0
- package/lib/kv/conformance.js +313 -0
- package/lib/kv/db.d.ts +3 -0
- package/lib/kv/db.js +2 -0
- package/lib/kv/json.d.ts +3 -0
- package/lib/kv/json.js +2 -0
- package/lib/kv-Kv6J9zqu.d.ts +39 -0
- package/lib/kv.d.ts +3 -0
- package/lib/kv.js +2 -0
- package/lib/language-anRiLd9a.js +198 -0
- package/lib/language.d.ts +88 -0
- package/lib/language.js +2 -0
- package/lib/linear-router-BUrYQxcv.js +96 -0
- package/lib/logger-CLvaB463.js +54 -0
- package/lib/logger.d.ts +22 -0
- package/lib/logger.js +2 -0
- package/lib/loopback-only-0nTL30Zt.js +131 -0
- package/lib/loopback-only.d.ts +73 -0
- package/lib/loopback-only.js +2 -0
- package/lib/method-not-allowed-B3nMAp1f.js +82 -0
- package/lib/method-not-allowed.d.ts +47 -0
- package/lib/method-not-allowed.js +2 -0
- package/lib/method-override-Dhd_EJD9.js +103 -0
- package/lib/method-override.d.ts +46 -0
- package/lib/method-override.js +2 -0
- package/lib/middleware-B8gJUDgl.js +12 -0
- package/lib/mime-B9GbsqnN.d.ts +72 -0
- package/lib/mime-C-r9WxjH.js +77 -0
- package/lib/mount-RGiNYj2l.js +67 -0
- package/lib/mount.d.ts +44 -0
- package/lib/mount.js +2 -0
- package/lib/node-server/conninfo.d.ts +2 -0
- package/lib/node-server/conninfo.js +2 -0
- package/lib/node-server/register.d.ts +1 -0
- package/lib/node-server/register.js +59 -0
- package/lib/node-server/serve-static.d.ts +2 -0
- package/lib/node-server/serve-static.js +2 -0
- package/lib/node-server.d.ts +134 -0
- package/lib/node-server.js +5 -0
- package/lib/open-BC_BGIQt.d.ts +12 -0
- package/lib/open-BpnCtiKf.js +224 -0
- package/lib/open-CEE2hyrs.d.ts +11 -0
- package/lib/open-CwA_ZiPl.js +57 -0
- package/lib/open-DFt0lT26.js +197 -0
- package/lib/open-DXxlFxS0.d.ts +27 -0
- package/lib/pattern-router-DlkDNR9e.js +41 -0
- package/lib/powered-by-B9ufDvKH.js +24 -0
- package/lib/powered-by.d.ts +28 -0
- package/lib/powered-by.js +2 -0
- package/lib/pretty-json-B_5MzYgk.js +39 -0
- package/lib/pretty-json.d.ts +40 -0
- package/lib/pretty-json.js +2 -0
- package/lib/protocol-8HjYa5OX.js +217 -0
- package/lib/protocol-DdQgl224.d.ts +160 -0
- package/lib/proxy-C02n8qaX.js +121 -0
- package/lib/proxy.d.ts +72 -0
- package/lib/proxy.js +2 -0
- package/lib/quick.d.ts +8 -0
- package/lib/quick.js +17 -0
- package/lib/read-sse.d.ts +33 -0
- package/lib/read-sse.js +84 -0
- package/lib/reg-exp-router-DT_H6W_j.js +363 -0
- package/lib/request-PoZjfrb4.js +323 -0
- package/lib/request-id-CWyCgzyD.js +34 -0
- package/lib/request-id.d.ts +45 -0
- package/lib/request-id.js +2 -0
- package/lib/request.d.ts +2 -0
- package/lib/request.js +2 -0
- package/lib/route-D1WQ4cOh.js +126 -0
- package/lib/route.d.ts +78 -0
- package/lib/route.js +2 -0
- package/lib/router/linear-router.d.ts +11 -0
- package/lib/router/linear-router.js +2 -0
- package/lib/router/pattern-router.d.ts +11 -0
- package/lib/router/pattern-router.js +2 -0
- package/lib/router/reg-exp-router.d.ts +35 -0
- package/lib/router/reg-exp-router.js +2 -0
- package/lib/router/smart-router.d.ts +15 -0
- package/lib/router/smart-router.js +2 -0
- package/lib/router/trie-router.d.ts +11 -0
- package/lib/router/trie-router.js +2 -0
- package/lib/router-0TlTAMdt.d.ts +99 -0
- package/lib/router-wWGf3FlK.js +35 -0
- package/lib/router.d.ts +2 -0
- package/lib/router.js +2 -0
- package/lib/schema-validator-DGAFbTcN.js +22 -0
- package/lib/schema-validator.d.ts +54 -0
- package/lib/schema-validator.js +2 -0
- package/lib/secure-headers-eLrZcjSr.js +163 -0
- package/lib/secure-headers.d.ts +125 -0
- package/lib/secure-headers.js +2 -0
- package/lib/serve-static-D97E4ERX.d.ts +18 -0
- package/lib/serve-static-YoUetEZ8.js +212 -0
- package/lib/serve-static-cnLZvaYu.js +77 -0
- package/lib/serve-static.d.ts +2 -0
- package/lib/serve-static.js +2 -0
- package/lib/smart-router-BF56Yf23.js +49 -0
- package/lib/snapshot-text-Cyl69OKv.js +597 -0
- package/lib/src-6T1gCSq3.js +427 -0
- package/lib/src-BycZ1HUQ.js +407 -0
- package/lib/src-CZ1JoBaO.js +90 -0
- package/lib/src-C_00jcuj.js +85 -0
- package/lib/ssg-D_StqyTO.js +389 -0
- package/lib/ssg.d.ts +2 -0
- package/lib/ssg.js +2 -0
- package/lib/stream-CJ_0BMG2.js +88 -0
- package/lib/stream-Oxo9JHC6.d.ts +34 -0
- package/lib/streaming-CL2i3hX_.js +96 -0
- package/lib/streaming.d.ts +23 -0
- package/lib/streaming.js +2 -0
- package/lib/testing-DnLmBGle.js +17 -0
- package/lib/testing.d.ts +10 -0
- package/lib/testing.js +2 -0
- package/lib/timeout-Bib1sxFc.js +42 -0
- package/lib/timeout.d.ts +30 -0
- package/lib/timeout.js +2 -0
- package/lib/timing-CkkBmV23.js +183 -0
- package/lib/timing.d.ts +130 -0
- package/lib/timing.js +2 -0
- package/lib/tiny.d.ts +8 -0
- package/lib/tiny.js +15 -0
- package/lib/trailing-slash-qJLAJrAH.js +85 -0
- package/lib/trailing-slash.d.ts +91 -0
- package/lib/trailing-slash.js +2 -0
- package/lib/transpile-Bc6rZPK-.js +105 -0
- package/lib/trie-router-DhF3wn5_.js +146 -0
- package/lib/types-Zy1OzMX7.d.ts +29 -0
- package/lib/types-akvg9vbH.d.ts +40 -0
- package/lib/types-cu7acft5.d.ts +195 -0
- package/lib/types-nO2Jov17.d.ts +114 -0
- package/lib/types.d.ts +2 -0
- package/lib/types.js +4 -0
- package/lib/upgrade-hub-7og-sHcQ.d.ts +138 -0
- package/lib/upgrade-hub-B4hca91Y.js +1554 -0
- package/lib/url-Cyyh7Fiw.js +197 -0
- package/lib/utils/accept.d.ts +9 -0
- package/lib/utils/accept.js +2 -0
- package/lib/utils/basic-auth.d.ts +8 -0
- package/lib/utils/basic-auth.js +2 -0
- package/lib/utils/body.d.ts +2 -0
- package/lib/utils/body.js +2 -0
- package/lib/utils/buffer.d.ts +19 -0
- package/lib/utils/buffer.js +2 -0
- package/lib/utils/color.d.ts +24 -0
- package/lib/utils/color.js +2 -0
- package/lib/utils/compress.d.ts +2 -0
- package/lib/utils/compress.js +2 -0
- package/lib/utils/concurrent.d.ts +17 -0
- package/lib/utils/concurrent.js +2 -0
- package/lib/utils/constants.d.ts +7 -0
- package/lib/utils/constants.js +2 -0
- package/lib/utils/cookie.d.ts +2 -0
- package/lib/utils/cookie.js +2 -0
- package/lib/utils/crypto.d.ts +14 -0
- package/lib/utils/crypto.js +2 -0
- package/lib/utils/encode.d.ts +11 -0
- package/lib/utils/encode.js +2 -0
- package/lib/utils/filepath.d.ts +14 -0
- package/lib/utils/filepath.js +25 -0
- package/lib/utils/handler.d.ts +9 -0
- package/lib/utils/handler.js +2 -0
- package/lib/utils/headers.d.ts +2 -0
- package/lib/utils/headers.js +1 -0
- package/lib/utils/html.d.ts +2 -0
- package/lib/utils/html.js +2 -0
- package/lib/utils/http-status.d.ts +2 -0
- package/lib/utils/http-status.js +1 -0
- package/lib/utils/ipaddr.d.ts +56 -0
- package/lib/utils/ipaddr.js +2 -0
- package/lib/utils/jwt.d.ts +24 -0
- package/lib/utils/jwt.js +2 -0
- package/lib/utils/mime.d.ts +2 -0
- package/lib/utils/mime.js +2 -0
- package/lib/utils/stream.d.ts +2 -0
- package/lib/utils/stream.js +2 -0
- package/lib/utils/types.d.ts +2 -0
- package/lib/utils/types.js +1 -0
- package/lib/utils/url.d.ts +46 -0
- package/lib/utils/url.js +2 -0
- package/lib/utils-CYdUlhw1.js +125 -0
- package/lib/utils-CnUrxRO-.js +4 -0
- package/lib/validator-DkpCsiJC.js +65 -0
- package/lib/validator.d.ts +42 -0
- package/lib/validator.js +2 -0
- package/lib/vitest-binding-CctNu3jT.d.ts +15 -0
- package/lib/vitest-binding-CrH7rKg2.js +17 -0
- package/lib/websocket-Cy4jtqHv.js +56 -0
- package/lib/ws.d.ts +2 -0
- package/lib/ws.js +2 -0
- package/package.json +463 -3
- package/shared/AGENTS.core.md +84 -0
- package/shared/DEFAULTS.md +49 -0
- package/shared/library-history-versions.json +48 -0
- package/shared/library-history.json +786 -0
- package/shared/skills/acryl-add-ui/SKILL.md +19 -0
- package/shared/skills/acryl-app/SKILL.md +13 -0
- package/shared/skills/acryl-build-plugin/SKILL.md +22 -0
- package/shared/skills/acryl-change-plugin/SKILL.md +14 -0
- package/shared/skills/acryl-diagnose-plugin/SKILL.md +13 -0
- package/shared/skills/acryl-fix-plugin/SKILL.md +13 -0
- package/shared/skills/acryl-remove-plugin/SKILL.md +12 -0
- package/shared/skills/acryl-share-plugin/SKILL.md +16 -0
- package/shared/skills/cordis-plugin/SKILL.md +26 -0
- package/templates/agent/.gitattributes +2 -0
- package/templates/agent/AGENTS.md +20 -0
- package/templates/agent/Dockerfile +15 -0
- package/templates/agent/README.md +52 -0
- package/templates/agent/blend.yaml +71 -0
- package/templates/agent/dockerignore +3 -0
- package/templates/agent/gitignore +6 -0
- package/templates/agent/package.json +31 -0
- package/templates/agent/src/app.ts +293 -0
- package/templates/agent/src/frame.ts +17 -0
- package/templates/agent/src/main.ts +27 -0
- package/templates/agent/src/routes.ts +163 -0
- package/templates/agent/template.json +22 -0
- package/templates/agent/test/agent.test.ts +51 -0
- package/templates/agent/test/app.test.ts +270 -0
- package/templates/agent/test/builder.test.ts +210 -0
- package/templates/agent/test/model.test.ts +94 -0
- package/templates/agent/tsconfig.json +68 -0
- package/templates/blank/.gitattributes +2 -0
- package/templates/blank/AGENTS.md +6 -0
- package/templates/blank/README.md +26 -0
- package/templates/blank/blend.yaml +37 -0
- package/templates/blank/gitignore +6 -0
- package/templates/blank/package.json +31 -0
- package/templates/blank/src/about.tsx +14 -0
- package/templates/blank/src/app.ts +160 -0
- package/templates/blank/src/door.ts +7 -0
- package/templates/blank/src/first-page.ts +5 -0
- package/templates/blank/src/frame.ts +17 -0
- package/templates/blank/src/main.ts +20 -0
- package/templates/blank/src/routes.ts +79 -0
- package/templates/blank/template.json +15 -0
- package/templates/blank/test/app.test.ts +177 -0
- package/templates/blank/tsconfig.json +19 -0
- package/templates/chat/.gitattributes +2 -0
- package/templates/chat/AGENTS.md +16 -0
- package/templates/chat/blend.yaml +36 -0
- package/templates/chat/gitignore +9 -0
- package/templates/chat/migrations/001-chat.sql +12 -0
- package/templates/chat/package.json +35 -0
- package/templates/chat/src/access.ts +110 -0
- package/templates/chat/src/app.ts +165 -0
- package/templates/chat/src/chat-app.ts +120 -0
- package/templates/chat/src/client/chat.tsx +117 -0
- package/templates/chat/src/client/tsconfig.json +26 -0
- package/templates/chat/src/db.ts +43 -0
- package/templates/chat/src/door.ts +7 -0
- package/templates/chat/src/frame.ts +17 -0
- package/templates/chat/src/llm.ts +48 -0
- package/templates/chat/src/main.ts +23 -0
- package/templates/chat/src/page.tsx +42 -0
- package/templates/chat/src/routes.ts +29 -0
- package/templates/chat/src/runtime.ts +23 -0
- package/templates/chat/template.json +15 -0
- package/templates/chat/test/chat.test.ts +322 -0
- package/templates/chat/test/server.test.ts +92 -0
- package/templates/chat/tsconfig.json +20 -0
- package/templates/nodejs/.gitattributes +2 -0
- package/templates/nodejs/AGENTS.md +9 -0
- package/templates/nodejs/blend.yaml +33 -0
- package/templates/nodejs/gitignore +6 -0
- package/templates/nodejs/package.json +32 -0
- package/templates/nodejs/src/app.ts +158 -0
- package/templates/nodejs/src/client/counter.tsx +12 -0
- package/templates/nodejs/src/client/tsconfig.json +26 -0
- package/templates/nodejs/src/door.ts +7 -0
- package/templates/nodejs/src/frame.ts +17 -0
- package/templates/nodejs/src/main.ts +20 -0
- package/templates/nodejs/src/page.tsx +29 -0
- package/templates/nodejs/src/routes.ts +59 -0
- package/templates/nodejs/template.json +14 -0
- package/templates/nodejs/test/app.test.ts +112 -0
- package/templates/nodejs/test/server.test.ts +97 -0
- package/templates/nodejs/tsconfig.json +20 -0
- package/templates/notes/.gitattributes +2 -0
- package/templates/notes/AGENTS.md +26 -0
- package/templates/notes/blend.yaml +36 -0
- package/templates/notes/gitignore +9 -0
- package/templates/notes/migrations/001-notes.sql +18 -0
- package/templates/notes/package.json +35 -0
- package/templates/notes/src/app.ts +165 -0
- package/templates/notes/src/auth.ts +57 -0
- package/templates/notes/src/client/counter.tsx +21 -0
- package/templates/notes/src/client/tsconfig.json +26 -0
- package/templates/notes/src/db.ts +50 -0
- package/templates/notes/src/door.ts +7 -0
- package/templates/notes/src/frame.ts +17 -0
- package/templates/notes/src/main.ts +23 -0
- package/templates/notes/src/notes-app.ts +212 -0
- package/templates/notes/src/routes.ts +21 -0
- package/templates/notes/src/runtime.ts +23 -0
- package/templates/notes/src/schema.ts +38 -0
- package/templates/notes/src/views.tsx +145 -0
- package/templates/notes/template.json +15 -0
- package/templates/notes/test/notes.test.ts +318 -0
- package/templates/notes/test/server.test.ts +92 -0
- package/templates/notes/tsconfig.json +20 -0
- package/templates/todo/.gitattributes +2 -0
- package/templates/todo/AGENTS.md +5 -0
- package/templates/todo/README.md +27 -0
- package/templates/todo/blend.yaml +28 -0
- package/templates/todo/gitignore +6 -0
- package/templates/todo/package.json +31 -0
- package/templates/todo/src/app.ts +145 -0
- package/templates/todo/src/door.ts +7 -0
- package/templates/todo/src/frame.ts +17 -0
- package/templates/todo/src/main.ts +21 -0
- package/templates/todo/src/page.ts +35 -0
- package/templates/todo/src/todo.ts +137 -0
- package/templates/todo/template.json +14 -0
- package/templates/todo/test/todo.test.ts +228 -0
- package/templates/todo/tsconfig.json +19 -0
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
//#region ../../../plugins/router/src/core/utils/html.ts
|
|
2
|
+
/**
|
|
3
|
+
* @module
|
|
4
|
+
* HTML utility.
|
|
5
|
+
*/
|
|
6
|
+
const HtmlEscapedCallbackPhase = {
|
|
7
|
+
Stringify: 1,
|
|
8
|
+
BeforeStream: 2,
|
|
9
|
+
Stream: 3
|
|
10
|
+
};
|
|
11
|
+
const raw = (value, callbacks) => {
|
|
12
|
+
const escapedString = new String(value);
|
|
13
|
+
escapedString.isEscaped = true;
|
|
14
|
+
escapedString.callbacks = callbacks;
|
|
15
|
+
return escapedString;
|
|
16
|
+
};
|
|
17
|
+
const escapeRe = /[&<>'"]/;
|
|
18
|
+
const stringBufferToString = async (buffer, callbacks) => {
|
|
19
|
+
let str = "";
|
|
20
|
+
callbacks ||= [];
|
|
21
|
+
const resolvedBuffer = await Promise.all(buffer);
|
|
22
|
+
for (let i = resolvedBuffer.length - 1;; i--) {
|
|
23
|
+
str += resolvedBuffer[i];
|
|
24
|
+
i--;
|
|
25
|
+
if (i < 0) break;
|
|
26
|
+
let r = resolvedBuffer[i];
|
|
27
|
+
if (typeof r === "object") callbacks.push(...r.callbacks || []);
|
|
28
|
+
const isEscaped = r.isEscaped;
|
|
29
|
+
r = await (typeof r === "object" ? r.toString() : r);
|
|
30
|
+
if (typeof r === "object") callbacks.push(...r.callbacks || []);
|
|
31
|
+
if (r.isEscaped ?? isEscaped) str += r;
|
|
32
|
+
else {
|
|
33
|
+
const buf = [str];
|
|
34
|
+
escapeToBuffer(r, buf);
|
|
35
|
+
str = buf[0];
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
return raw(str, callbacks);
|
|
39
|
+
};
|
|
40
|
+
const escapeToBuffer = (str, buffer) => {
|
|
41
|
+
const match = str.search(escapeRe);
|
|
42
|
+
if (match === -1) {
|
|
43
|
+
buffer[0] += str;
|
|
44
|
+
return;
|
|
45
|
+
}
|
|
46
|
+
let escape;
|
|
47
|
+
let index;
|
|
48
|
+
let lastIndex = 0;
|
|
49
|
+
for (index = match; index < str.length; index++) {
|
|
50
|
+
switch (str.charCodeAt(index)) {
|
|
51
|
+
case 34:
|
|
52
|
+
escape = """;
|
|
53
|
+
break;
|
|
54
|
+
case 39:
|
|
55
|
+
escape = "'";
|
|
56
|
+
break;
|
|
57
|
+
case 38:
|
|
58
|
+
escape = "&";
|
|
59
|
+
break;
|
|
60
|
+
case 60:
|
|
61
|
+
escape = "<";
|
|
62
|
+
break;
|
|
63
|
+
case 62:
|
|
64
|
+
escape = ">";
|
|
65
|
+
break;
|
|
66
|
+
default: continue;
|
|
67
|
+
}
|
|
68
|
+
buffer[0] += str.substring(lastIndex, index) + escape;
|
|
69
|
+
lastIndex = index + 1;
|
|
70
|
+
}
|
|
71
|
+
buffer[0] += str.substring(lastIndex, index);
|
|
72
|
+
};
|
|
73
|
+
const resolveCallbackSync = (str) => {
|
|
74
|
+
const callbacks = str.callbacks;
|
|
75
|
+
if (!callbacks?.length) return str;
|
|
76
|
+
const buffer = [str];
|
|
77
|
+
const context = {};
|
|
78
|
+
callbacks.forEach((c) => c({
|
|
79
|
+
phase: HtmlEscapedCallbackPhase.Stringify,
|
|
80
|
+
buffer,
|
|
81
|
+
context
|
|
82
|
+
}));
|
|
83
|
+
return buffer[0];
|
|
84
|
+
};
|
|
85
|
+
const resolveCallback = async (str, phase, preserveCallbacks, context, buffer) => {
|
|
86
|
+
if (typeof str === "object" && !(str instanceof String)) {
|
|
87
|
+
if (!(str instanceof Promise)) str = str.toString();
|
|
88
|
+
if (str instanceof Promise) str = await str;
|
|
89
|
+
}
|
|
90
|
+
const callbacks = str.callbacks;
|
|
91
|
+
if (!callbacks?.length) return Promise.resolve(str);
|
|
92
|
+
if (buffer) buffer[0] += str;
|
|
93
|
+
else buffer = [str];
|
|
94
|
+
const resStr = Promise.all(callbacks.map((c) => c({
|
|
95
|
+
phase,
|
|
96
|
+
buffer,
|
|
97
|
+
context
|
|
98
|
+
}))).then((res) => Promise.all(res.filter(Boolean).map((str) => resolveCallback(str, phase, false, context, buffer))).then(() => buffer[0]));
|
|
99
|
+
if (preserveCallbacks) return raw(await resStr, callbacks);
|
|
100
|
+
else return resStr;
|
|
101
|
+
};
|
|
102
|
+
//#endregion
|
|
103
|
+
export { resolveCallbackSync as a, resolveCallback as i, escapeToBuffer as n, stringBufferToString as o, raw as r, HtmlEscapedCallbackPhase as t };
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
//#region ../../../plugins/router/src/core/utils/html.d.ts
|
|
2
|
+
/**
|
|
3
|
+
* @module
|
|
4
|
+
* HTML utility.
|
|
5
|
+
*/
|
|
6
|
+
declare const HtmlEscapedCallbackPhase: {
|
|
7
|
+
readonly Stringify: 1;
|
|
8
|
+
readonly BeforeStream: 2;
|
|
9
|
+
readonly Stream: 3;
|
|
10
|
+
};
|
|
11
|
+
type HtmlEscapedCallbackOpts = {
|
|
12
|
+
buffer?: [string];
|
|
13
|
+
phase: (typeof HtmlEscapedCallbackPhase)[keyof typeof HtmlEscapedCallbackPhase];
|
|
14
|
+
context: Readonly<object>;
|
|
15
|
+
};
|
|
16
|
+
type HtmlEscapedCallback = (opts: HtmlEscapedCallbackOpts) => Promise<string> | undefined;
|
|
17
|
+
type HtmlEscaped = {
|
|
18
|
+
isEscaped: true;
|
|
19
|
+
callbacks?: HtmlEscapedCallback[];
|
|
20
|
+
};
|
|
21
|
+
type HtmlEscapedString = string & HtmlEscaped;
|
|
22
|
+
/**
|
|
23
|
+
* StringBuffer contains string and Promise<string> alternately
|
|
24
|
+
* The length of the array will be odd, the odd numbered element will be a string,
|
|
25
|
+
* and the even numbered element will be a Promise<string>.
|
|
26
|
+
* When concatenating into a single string, it must be processed from the tail.
|
|
27
|
+
* @example
|
|
28
|
+
* [
|
|
29
|
+
* 'framework.',
|
|
30
|
+
* Promise.resolve('ultra fast'),
|
|
31
|
+
* 'a ',
|
|
32
|
+
* Promise.resolve('is '),
|
|
33
|
+
* 'Acryl',
|
|
34
|
+
* ]
|
|
35
|
+
*/
|
|
36
|
+
type StringBuffer = (string | Promise<string>)[];
|
|
37
|
+
type StringBufferWithCallbacks = StringBuffer & {
|
|
38
|
+
callbacks: HtmlEscapedCallback[];
|
|
39
|
+
};
|
|
40
|
+
declare const raw: (value: unknown, callbacks?: HtmlEscapedCallback[]) => HtmlEscapedString;
|
|
41
|
+
declare const stringBufferToString: (buffer: StringBuffer, callbacks: HtmlEscapedCallback[] | undefined) => Promise<HtmlEscapedString>;
|
|
42
|
+
declare const escapeToBuffer: (str: string, buffer: StringBuffer) => void;
|
|
43
|
+
declare const resolveCallbackSync: (str: string | HtmlEscapedString) => string;
|
|
44
|
+
declare const resolveCallback: (str: string | HtmlEscapedString | Promise<string>, phase: (typeof HtmlEscapedCallbackPhase)[keyof typeof HtmlEscapedCallbackPhase], preserveCallbacks: boolean, context: object, buffer?: [string]) => Promise<string>;
|
|
45
|
+
//#endregion
|
|
46
|
+
export { StringBuffer as a, raw as c, stringBufferToString as d, HtmlEscapedString as i, resolveCallback as l, HtmlEscapedCallback as n, StringBufferWithCallbacks as o, HtmlEscapedCallbackPhase as r, escapeToBuffer as s, HtmlEscaped as t, resolveCallbackSync as u };
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { a as resolveCallbackSync, n as escapeToBuffer, o as stringBufferToString, r as raw } from "./html-1jTa7KN1.js";
|
|
2
|
+
//#region ../../../plugins/router/src/core/helper/html/index.ts
|
|
3
|
+
/**
|
|
4
|
+
* @module
|
|
5
|
+
* html Helper for Acryl.
|
|
6
|
+
*/
|
|
7
|
+
const html = (strings, ...values) => {
|
|
8
|
+
const buffer = [""];
|
|
9
|
+
for (let i = 0, len = strings.length - 1; i < len; i++) {
|
|
10
|
+
buffer[0] += strings[i];
|
|
11
|
+
const children = Array.isArray(values[i]) ? values[i].flat(Infinity) : [values[i]];
|
|
12
|
+
for (let i = 0, len = children.length; i < len; i++) {
|
|
13
|
+
const child = children[i];
|
|
14
|
+
if (typeof child === "string") escapeToBuffer(child, buffer);
|
|
15
|
+
else if (typeof child === "number") buffer[0] += child;
|
|
16
|
+
else if (typeof child === "boolean" || child === null || child === void 0) continue;
|
|
17
|
+
else if (typeof child === "object" && child.isEscaped) if (child.callbacks) buffer.unshift("", child);
|
|
18
|
+
else {
|
|
19
|
+
const tmp = child.toString();
|
|
20
|
+
if (tmp instanceof Promise) buffer.unshift("", tmp);
|
|
21
|
+
else buffer[0] += tmp;
|
|
22
|
+
}
|
|
23
|
+
else if (child instanceof Promise) buffer.unshift("", child);
|
|
24
|
+
else escapeToBuffer(child.toString(), buffer);
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
buffer[0] += strings.at(-1);
|
|
28
|
+
return buffer.length === 1 ? "callbacks" in buffer ? raw(resolveCallbackSync(raw(buffer[0], buffer.callbacks))) : raw(buffer[0]) : stringBufferToString(buffer, buffer.callbacks);
|
|
29
|
+
};
|
|
30
|
+
//#endregion
|
|
31
|
+
export { html as t };
|
package/lib/html.d.ts
ADDED
package/lib/html.js
ADDED
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
//#region ../../../plugins/router/src/core/http-exception.ts
|
|
2
|
+
/**
|
|
3
|
+
* `HTTPException` must be used when a fatal error such as authentication failure occurs.
|
|
4
|
+
*
|
|
5
|
+
*
|
|
6
|
+
* @param {StatusCode} status - status code of HTTPException
|
|
7
|
+
* @param {HTTPExceptionOptions} options - options of HTTPException
|
|
8
|
+
* @param {HTTPExceptionOptions["res"]} options.res - response of options of HTTPException
|
|
9
|
+
* @param {HTTPExceptionOptions["message"]} options.message - message of options of HTTPException
|
|
10
|
+
* @param {HTTPExceptionOptions["cause"]} options.cause - cause of options of HTTPException
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* ```ts
|
|
14
|
+
* import { HTTPException } from '@acryldev/blends/http-exception'
|
|
15
|
+
*
|
|
16
|
+
* // ...
|
|
17
|
+
*
|
|
18
|
+
* app.post('/auth', async (c, next) => {
|
|
19
|
+
* // authentication
|
|
20
|
+
* if (authorized === false) {
|
|
21
|
+
* throw new HTTPException(401, { message: 'Custom error message' })
|
|
22
|
+
* }
|
|
23
|
+
* await next()
|
|
24
|
+
* })
|
|
25
|
+
* ```
|
|
26
|
+
*/
|
|
27
|
+
var HTTPException = class extends Error {
|
|
28
|
+
res;
|
|
29
|
+
status;
|
|
30
|
+
/**
|
|
31
|
+
* Creates an instance of `HTTPException`.
|
|
32
|
+
* @param status - HTTP status code for the exception. Defaults to 500.
|
|
33
|
+
* @param options - Additional options for the exception.
|
|
34
|
+
*/
|
|
35
|
+
constructor(status = 500, options) {
|
|
36
|
+
super(options?.message, { cause: options?.cause });
|
|
37
|
+
this.res = options?.res;
|
|
38
|
+
this.status = status;
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Returns the response object associated with the exception.
|
|
42
|
+
* If a response object is not provided, a new response is created with the error message and status code.
|
|
43
|
+
* @returns The response object.
|
|
44
|
+
*/
|
|
45
|
+
getResponse() {
|
|
46
|
+
if (this.res) return new Response(this.res.body, {
|
|
47
|
+
status: this.status,
|
|
48
|
+
headers: this.res.headers
|
|
49
|
+
});
|
|
50
|
+
return new Response(this.message, { status: this.status });
|
|
51
|
+
}
|
|
52
|
+
};
|
|
53
|
+
//#endregion
|
|
54
|
+
export { HTTPException as t };
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { n as ContentfulStatusCode } from "./http-status-uBFmbzzM.js";
|
|
2
|
+
|
|
3
|
+
//#region ../../../plugins/router/src/core/http-exception.d.ts
|
|
4
|
+
/**
|
|
5
|
+
* Options for creating an `HTTPException`.
|
|
6
|
+
* @property res - Optional response object to use.
|
|
7
|
+
* @property message - Optional custom error message.
|
|
8
|
+
* @property cause - Optional cause of the error.
|
|
9
|
+
*/
|
|
10
|
+
type HTTPExceptionOptions = {
|
|
11
|
+
res?: Response;
|
|
12
|
+
message?: string;
|
|
13
|
+
cause?: unknown;
|
|
14
|
+
};
|
|
15
|
+
/**
|
|
16
|
+
* `HTTPException` must be used when a fatal error such as authentication failure occurs.
|
|
17
|
+
*
|
|
18
|
+
*
|
|
19
|
+
* @param {StatusCode} status - status code of HTTPException
|
|
20
|
+
* @param {HTTPExceptionOptions} options - options of HTTPException
|
|
21
|
+
* @param {HTTPExceptionOptions["res"]} options.res - response of options of HTTPException
|
|
22
|
+
* @param {HTTPExceptionOptions["message"]} options.message - message of options of HTTPException
|
|
23
|
+
* @param {HTTPExceptionOptions["cause"]} options.cause - cause of options of HTTPException
|
|
24
|
+
*
|
|
25
|
+
* @example
|
|
26
|
+
* ```ts
|
|
27
|
+
* import { HTTPException } from '@acryldev/blends/http-exception'
|
|
28
|
+
*
|
|
29
|
+
* // ...
|
|
30
|
+
*
|
|
31
|
+
* app.post('/auth', async (c, next) => {
|
|
32
|
+
* // authentication
|
|
33
|
+
* if (authorized === false) {
|
|
34
|
+
* throw new HTTPException(401, { message: 'Custom error message' })
|
|
35
|
+
* }
|
|
36
|
+
* await next()
|
|
37
|
+
* })
|
|
38
|
+
* ```
|
|
39
|
+
*/
|
|
40
|
+
declare class HTTPException extends Error {
|
|
41
|
+
readonly res?: Response;
|
|
42
|
+
readonly status: ContentfulStatusCode;
|
|
43
|
+
/**
|
|
44
|
+
* Creates an instance of `HTTPException`.
|
|
45
|
+
* @param status - HTTP status code for the exception. Defaults to 500.
|
|
46
|
+
* @param options - Additional options for the exception.
|
|
47
|
+
*/
|
|
48
|
+
constructor(status?: ContentfulStatusCode, options?: HTTPExceptionOptions);
|
|
49
|
+
/**
|
|
50
|
+
* Returns the response object associated with the exception.
|
|
51
|
+
* If a response object is not provided, a new response is created with the error message and status code.
|
|
52
|
+
* @returns The response object.
|
|
53
|
+
*/
|
|
54
|
+
getResponse(): Response;
|
|
55
|
+
}
|
|
56
|
+
//#endregion
|
|
57
|
+
export { HTTPException as t };
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
//#region ../../../plugins/router/src/core/utils/http-status.d.ts
|
|
2
|
+
/**
|
|
3
|
+
* @module
|
|
4
|
+
* HTTP Status utility.
|
|
5
|
+
*/
|
|
6
|
+
type InfoStatusCode = 100 | 101 | 102 | 103;
|
|
7
|
+
type SuccessStatusCode = 200 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 208 | 226;
|
|
8
|
+
type DeprecatedStatusCode = 305 | 306;
|
|
9
|
+
type RedirectStatusCode = 300 | 301 | 302 | 303 | 304 | DeprecatedStatusCode | 307 | 308;
|
|
10
|
+
type ClientErrorStatusCode = 400 | 401 | 402 | 403 | 404 | 405 | 406 | 407 | 408 | 409 | 410 | 411 | 412 | 413 | 414 | 415 | 416 | 417 | 418 | 421 | 422 | 423 | 424 | 425 | 426 | 428 | 429 | 431 | 451;
|
|
11
|
+
type ServerErrorStatusCode = 500 | 501 | 502 | 503 | 504 | 505 | 506 | 507 | 508 | 510 | 511;
|
|
12
|
+
/**
|
|
13
|
+
* `UnofficialStatusCode` can be used to specify an unofficial status code.
|
|
14
|
+
* @example
|
|
15
|
+
*
|
|
16
|
+
* ```ts
|
|
17
|
+
* app.get('/unknown', (c) => {
|
|
18
|
+
* return c.text("Unknown Error", 520 as UnofficialStatusCode)
|
|
19
|
+
* })
|
|
20
|
+
* ```
|
|
21
|
+
*/
|
|
22
|
+
type UnofficialStatusCode = -1;
|
|
23
|
+
/**
|
|
24
|
+
* @deprecated
|
|
25
|
+
* Use `UnofficialStatusCode` instead.
|
|
26
|
+
*/
|
|
27
|
+
type UnOfficalStatusCode = UnofficialStatusCode;
|
|
28
|
+
/**
|
|
29
|
+
* If you want to use an unofficial status, use `UnofficialStatusCode`.
|
|
30
|
+
*/
|
|
31
|
+
type StatusCode = InfoStatusCode | SuccessStatusCode | RedirectStatusCode | ClientErrorStatusCode | ServerErrorStatusCode | UnofficialStatusCode;
|
|
32
|
+
type ContentlessStatusCode = 101 | 204 | 205 | 304;
|
|
33
|
+
type ContentfulStatusCode = Exclude<StatusCode, ContentlessStatusCode>;
|
|
34
|
+
//#endregion
|
|
35
|
+
export { InfoStatusCode as a, StatusCode as c, UnofficialStatusCode as d, DeprecatedStatusCode as i, SuccessStatusCode as l, ContentfulStatusCode as n, RedirectStatusCode as o, ContentlessStatusCode as r, ServerErrorStatusCode as s, ClientErrorStatusCode as t, UnOfficalStatusCode as u };
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { n as Kv } from "./kv-Kv6J9zqu.js";
|
|
2
|
+
|
|
3
|
+
//#region ../../../plugins/kv/src/check.d.ts
|
|
4
|
+
/**
|
|
5
|
+
* What every `kv` provider checks the same way, so a bad call fails alike on a file and on SQL: the key, the value, and the order of keys.
|
|
6
|
+
*/
|
|
7
|
+
/** A key is a non-empty string. */
|
|
8
|
+
declare function checkKey(key: unknown): asserts key is string;
|
|
9
|
+
/**
|
|
10
|
+
* The JSON text of a value. `undefined`, functions, symbols, bigints, circular structures and non-finite numbers (which JSON would turn
|
|
11
|
+
* into `null`) are refused with a `TypeError`; nothing is stored for them.
|
|
12
|
+
*/
|
|
13
|
+
declare function encodeValue(value: unknown): string;
|
|
14
|
+
/** The value of stored JSON text: a new copy each time, so changing what `get` returned changes nothing stored. */
|
|
15
|
+
declare function decodeValue<T>(text: string): T;
|
|
16
|
+
/** Order two keys by code point (the order of UTF-8 bytes, which SQLite's binary collation and Postgres' "C" collation give too). */
|
|
17
|
+
declare function compareKeys(a: string, b: string): number;
|
|
18
|
+
/** The number of code points in a string (what SQL's `substr` counts). */
|
|
19
|
+
declare function codePoints(text: string): number;
|
|
20
|
+
/**
|
|
21
|
+
* Call an `update` callback and check what it returns: the callback is synchronous, so a promise (an `async` function the types should have
|
|
22
|
+
* refused) is rejected with a message that says what to do, instead of being stored as `{}`.
|
|
23
|
+
*/
|
|
24
|
+
declare function runChange<T>(change: (current: T | undefined) => T, current: T | undefined): T;
|
|
25
|
+
//#endregion
|
|
26
|
+
//#region ../../../plugins/kv/src/copy.d.ts
|
|
27
|
+
interface CopyKvOptions {
|
|
28
|
+
/** Replace keys the target already has. Without it, a shared key stops the copy before anything is written. */
|
|
29
|
+
readonly overwrite?: boolean;
|
|
30
|
+
/** Copy only the keys that start with this. */
|
|
31
|
+
readonly prefix?: string;
|
|
32
|
+
}
|
|
33
|
+
interface CopyKvResult {
|
|
34
|
+
/** Keys written to the target. */
|
|
35
|
+
readonly copied: number;
|
|
36
|
+
/** Of those, keys the target already had. */
|
|
37
|
+
readonly overwritten: number;
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Copy every key of one store into another: the import when an app moves from a JSON file to SQL (the file opened with
|
|
41
|
+
* `@acryldev/kv-json` is the source, `kvOnDb` the target). The source is not changed.
|
|
42
|
+
* @throws when the target has a key the source has and `overwrite` is not set; nothing is written then.
|
|
43
|
+
*/
|
|
44
|
+
declare function copyKv(source: Kv, target: Kv, options?: CopyKvOptions): Promise<CopyKvResult>;
|
|
45
|
+
//#endregion
|
|
46
|
+
//#region ../../../plugins/kv/src/index.d.ts
|
|
47
|
+
/**
|
|
48
|
+
* The `kv` port: named JSON documents for an app too small for SQL, whichever provider serves it (`@acryldev/kv-json` for one file,
|
|
49
|
+
* `@acryldev/kv-db` over the `db` port). Plain code opens a store with a provider's `openKv`; a Cordis plugin declares `inject: ['kv']`, imports
|
|
50
|
+
* `@acryldev/kv/cordis` for the `ctx.kv` type, and never imports a provider.
|
|
51
|
+
*
|
|
52
|
+
* This entry imports nothing from Cordis, at runtime or in its types.
|
|
53
|
+
*/
|
|
54
|
+
/** The service name every `kv` provider registers. */
|
|
55
|
+
declare const KV_SERVICE = "kv";
|
|
56
|
+
//#endregion
|
|
57
|
+
export { checkKey as a, decodeValue as c, copyKv as i, encodeValue as l, CopyKvOptions as n, codePoints as o, CopyKvResult as r, compareKeys as s, KV_SERVICE as t, runChange as u };
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { L as MiddlewareHandler, i as Data, t as Context, v as Env } from "./context-Ca3uX_bh.js";
|
|
2
|
+
|
|
3
|
+
//#region ../../../plugins/router/src/core/middleware/serve-static/index.d.ts
|
|
4
|
+
type ServeStaticOptions<E extends Env = Env> = {
|
|
5
|
+
root?: string;
|
|
6
|
+
path?: string;
|
|
7
|
+
precompressed?: boolean; /** Allow percent signs in the routed request path. Defaults to false. */
|
|
8
|
+
allowPercentInPath?: boolean;
|
|
9
|
+
mimes?: Record<string, string>;
|
|
10
|
+
rewriteRequestPath?: (path: string) => string;
|
|
11
|
+
onFound?: (path: string, c: Context<E>) => void | Promise<void>;
|
|
12
|
+
onNotFound?: (path: string, c: Context<E>) => void | Promise<void>;
|
|
13
|
+
};
|
|
14
|
+
/**
|
|
15
|
+
* This middleware is not directly used by the user. Create a wrapper specifying `getContent()` by the environment such as Deno or Bun.
|
|
16
|
+
*/
|
|
17
|
+
declare const serveStatic: <E extends Env = Env>(options: ServeStaticOptions<E> & {
|
|
18
|
+
getContent: (path: string, c: Context<E>) => Promise<Data | Response | null>;
|
|
19
|
+
/**
|
|
20
|
+
*
|
|
21
|
+
* `join` option according to the runtime. Example `import { join } from 'node:path`. If not specified, it will fall back to the default join function.`
|
|
22
|
+
*/
|
|
23
|
+
join?: (...paths: string[]) => string;
|
|
24
|
+
/**
|
|
25
|
+
* @deprecated Currently, `pathResolve` is no longer used.
|
|
26
|
+
*/
|
|
27
|
+
pathResolve?: (path: string) => string;
|
|
28
|
+
isDir?: (path: string) => boolean | undefined | Promise<boolean | undefined>;
|
|
29
|
+
}) => MiddlewareHandler;
|
|
30
|
+
//#endregion
|
|
31
|
+
export { serveStatic as n, ServeStaticOptions as t };
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { n as ContentfulStatusCode, s as ServerErrorStatusCode, t as ClientErrorStatusCode } from "./http-status-uBFmbzzM.js";
|
|
2
|
+
import { D as UnionToIntersection } from "./types-nO2Jov17.js";
|
|
3
|
+
import { t as Acryl } from "./app-DGqSNBSd.js";
|
|
4
|
+
import { a as ClientResponse, i as ClientRequestOptions, n as Client, s as FilterClientResponseByStatusCode } from "./types-cu7acft5.js";
|
|
5
|
+
|
|
6
|
+
//#region ../../../plugins/router/src/core/client/client.d.ts
|
|
7
|
+
declare const hc: <T extends Acryl<any, any, any>, Prefix extends string = string>(baseUrl: Prefix, options?: ClientRequestOptions) => UnionToIntersection<Client<T, Prefix>>;
|
|
8
|
+
//#endregion
|
|
9
|
+
//#region ../../../plugins/router/src/core/client/fetch-result-please.d.ts
|
|
10
|
+
declare class DetailedError extends Error {
|
|
11
|
+
/**
|
|
12
|
+
* Additional `message` that will be logged AND returned to client
|
|
13
|
+
*/
|
|
14
|
+
detail?: any;
|
|
15
|
+
/**
|
|
16
|
+
* Additional `code` that will be logged AND returned to client
|
|
17
|
+
*/
|
|
18
|
+
code?: any;
|
|
19
|
+
/**
|
|
20
|
+
* Additional value that will be logged AND NOT returned to client
|
|
21
|
+
*/
|
|
22
|
+
log?: any;
|
|
23
|
+
/**
|
|
24
|
+
* Optionally set the status code to return, in a web server context
|
|
25
|
+
*/
|
|
26
|
+
statusCode?: any;
|
|
27
|
+
constructor(message: string, options?: {
|
|
28
|
+
detail?: any;
|
|
29
|
+
code?: any;
|
|
30
|
+
statusCode?: number;
|
|
31
|
+
log?: any;
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
//#endregion
|
|
35
|
+
//#region ../../../plugins/router/src/core/client/utils.d.ts
|
|
36
|
+
/**
|
|
37
|
+
* Shortcut to get a consumable response from `hc`'s fetch calls (Response), with types inference.
|
|
38
|
+
*
|
|
39
|
+
* Smartly parse the response data, throwing a structured error if the response is not `ok`. ({@link DetailedError})
|
|
40
|
+
*
|
|
41
|
+
* @example const result = await parseResponse(client.posts.$get())
|
|
42
|
+
*/
|
|
43
|
+
declare function parseResponse<T extends ClientResponse<any>>(fetchRes: T | Promise<T>): Promise<FilterClientResponseByStatusCode<T, Exclude<ContentfulStatusCode, ClientErrorStatusCode | ServerErrorStatusCode>> extends never ? undefined : FilterClientResponseByStatusCode<T, Exclude<ContentfulStatusCode, ClientErrorStatusCode | ServerErrorStatusCode>> extends ClientResponse<infer RT, infer _, infer RF> ? RF extends 'json' ? RT : RT extends string ? RT : string : undefined>;
|
|
44
|
+
//#endregion
|
|
45
|
+
export { DetailedError as n, hc as r, parseResponse as t };
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { L as MiddlewareHandler, Z as TypedResponse, t as Context } from "./context-Ca3uX_bh.js";
|
|
2
|
+
import { c as StatusCode } from "./http-status-uBFmbzzM.js";
|
|
3
|
+
import { b as MessageEvent, r as CloseEvent, t as BinaryType } from "./types-nO2Jov17.js";
|
|
4
|
+
|
|
5
|
+
//#region ../../../plugins/router/src/core/helper/websocket/index.d.ts
|
|
6
|
+
/**
|
|
7
|
+
* WebSocket Event Listeners type
|
|
8
|
+
*/
|
|
9
|
+
interface WSEvents<T = unknown> {
|
|
10
|
+
onOpen?: (evt: Event, ws: WSContext<T>) => void;
|
|
11
|
+
onMessage?: (evt: MessageEvent<WSMessageReceive>, ws: WSContext<T>) => void;
|
|
12
|
+
onClose?: (evt: CloseEvent, ws: WSContext<T>) => void;
|
|
13
|
+
onError?: (evt: Event, ws: WSContext<T>) => void;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Upgrade WebSocket Type
|
|
17
|
+
*/
|
|
18
|
+
interface UpgradeWebSocket<T = unknown, U = any, _WSEvents = WSEvents<T>> {
|
|
19
|
+
(createEvents: (c: Context) => _WSEvents | Promise<_WSEvents>, options?: U): MiddlewareHandler<any, string, {
|
|
20
|
+
outputFormat: 'ws';
|
|
21
|
+
}>;
|
|
22
|
+
(c: Context, events: _WSEvents, options?: U): Promise<Response & TypedResponse<{}, StatusCode, 'ws'>>;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* ReadyState for WebSocket
|
|
26
|
+
*/
|
|
27
|
+
type WSReadyState = 0 | 1 | 2 | 3;
|
|
28
|
+
/**
|
|
29
|
+
* An argument for WSContext class
|
|
30
|
+
*/
|
|
31
|
+
interface WSContextInit<T = unknown> {
|
|
32
|
+
send(data: string | ArrayBuffer | Uint8Array<ArrayBuffer>, options: SendOptions): void;
|
|
33
|
+
close(code?: number, reason?: string): void;
|
|
34
|
+
raw?: T;
|
|
35
|
+
readyState: WSReadyState;
|
|
36
|
+
/** Bytes queued to send and not yet written to the socket; a sender that cares about back-pressure reads it. */
|
|
37
|
+
bufferedAmount?: number;
|
|
38
|
+
url?: string | URL | null;
|
|
39
|
+
protocol?: string | null;
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Options for sending message
|
|
43
|
+
*/
|
|
44
|
+
interface SendOptions {
|
|
45
|
+
compress?: boolean;
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* A context for controlling WebSockets
|
|
49
|
+
*/
|
|
50
|
+
declare class WSContext<T = unknown> {
|
|
51
|
+
#private;
|
|
52
|
+
constructor(init: WSContextInit<T>);
|
|
53
|
+
send(source: string | ArrayBuffer | Uint8Array<ArrayBuffer>, options?: SendOptions): void;
|
|
54
|
+
raw?: T;
|
|
55
|
+
binaryType: BinaryType;
|
|
56
|
+
get readyState(): WSReadyState;
|
|
57
|
+
get bufferedAmount(): number;
|
|
58
|
+
url: URL | null;
|
|
59
|
+
protocol: string | null;
|
|
60
|
+
close(code?: number, reason?: string): void;
|
|
61
|
+
}
|
|
62
|
+
type WSMessageReceive = string | Blob | ArrayBufferLike;
|
|
63
|
+
declare const createWSMessageEvent: (source: WSMessageReceive) => MessageEvent<WSMessageReceive>;
|
|
64
|
+
interface WebSocketHelperDefineContext {}
|
|
65
|
+
type WebSocketHelperDefineHandler<T, U> = (c: Context, events: WSEvents<T>, options?: U) => Promise<Response | void> | Response | void;
|
|
66
|
+
/**
|
|
67
|
+
* Create a WebSocket adapter/helper
|
|
68
|
+
*/
|
|
69
|
+
declare const defineWebSocketHelper: <T = unknown, U = any>(handler: WebSocketHelperDefineHandler<T, U>) => UpgradeWebSocket<T, U>;
|
|
70
|
+
//#endregion
|
|
71
|
+
export { WSEvents as a, WebSocketHelperDefineContext as c, defineWebSocketHelper as d, WSContextInit as i, WebSocketHelperDefineHandler as l, UpgradeWebSocket as n, WSMessageReceive as o, WSContext as r, WSReadyState as s, SendOptions as t, createWSMessageEvent as u };
|