@xtandard/kit 0.0.0-stage → 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +71 -2
- package/bin/xtandard-kit.mjs +3 -0
- package/dist/base-path-BJugWLNO.cjs +42 -0
- package/dist/base-path-BJugWLNO.cjs.map +1 -0
- package/dist/base-path-CDb4In5E.mjs +31 -0
- package/dist/base-path-CDb4In5E.mjs.map +1 -0
- package/dist/basic-Qtriv0xS.mjs +176 -0
- package/dist/basic-Qtriv0xS.mjs.map +1 -0
- package/dist/basic-ZaO92-lB.cjs +199 -0
- package/dist/basic-ZaO92-lB.cjs.map +1 -0
- package/dist/bin.cjs +126 -0
- package/dist/bin.cjs.map +1 -0
- package/dist/bin.d.cts +20 -0
- package/dist/bin.d.mts +20 -0
- package/dist/bin.mjs +125 -0
- package/dist/bin.mjs.map +1 -0
- package/dist/cas-CuPSaXBV.cjs +23 -0
- package/dist/cas-CuPSaXBV.cjs.map +1 -0
- package/dist/cas-CzA-yECx.mjs +18 -0
- package/dist/cas-CzA-yECx.mjs.map +1 -0
- package/dist/chunk-DakpK96I.cjs +43 -0
- package/dist/contract-B3UPXXLx.d.cts +30 -0
- package/dist/contract-B3UPXXLx.d.mts +30 -0
- package/dist/contract-BDPNvjtp.d.mts +64 -0
- package/dist/contract-BEdfGTPs.mjs +85 -0
- package/dist/contract-BEdfGTPs.mjs.map +1 -0
- package/dist/contract-BIVzAn4f.d.cts +64 -0
- package/dist/contract-BvgtswLX.d.cts +75 -0
- package/dist/contract-BvgtswLX.d.mts +75 -0
- package/dist/contract-DUj9P3Vt.d.cts +72 -0
- package/dist/contract-DUj9P3Vt.d.mts +72 -0
- package/dist/contract-wAEMDmYG.cjs +132 -0
- package/dist/contract-wAEMDmYG.cjs.map +1 -0
- package/dist/drizzle-BElCHWri.d.mts +115 -0
- package/dist/drizzle-BXaQXCr0.cjs +232 -0
- package/dist/drizzle-BXaQXCr0.cjs.map +1 -0
- package/dist/drizzle-CEpahWQB.d.cts +115 -0
- package/dist/drizzle-DxnelsPT.mjs +197 -0
- package/dist/drizzle-DxnelsPT.mjs.map +1 -0
- package/dist/duration-7WpAK-xe.mjs +52 -0
- package/dist/duration-7WpAK-xe.mjs.map +1 -0
- package/dist/duration-DVA0Fzkx.cjs +63 -0
- package/dist/duration-DVA0Fzkx.cjs.map +1 -0
- package/dist/duration-FPwbmWIU.d.cts +35 -0
- package/dist/duration-FPwbmWIU.d.mts +35 -0
- package/dist/entry-adapters-bun.cjs +10 -0
- package/dist/entry-adapters-bun.cjs.map +1 -0
- package/dist/entry-adapters-bun.d.cts +10 -0
- package/dist/entry-adapters-bun.d.mts +10 -0
- package/dist/entry-adapters-bun.mjs +9 -0
- package/dist/entry-adapters-bun.mjs.map +1 -0
- package/dist/entry-adapters-elysia.cjs +54 -0
- package/dist/entry-adapters-elysia.cjs.map +1 -0
- package/dist/entry-adapters-elysia.d.cts +38 -0
- package/dist/entry-adapters-elysia.d.mts +38 -0
- package/dist/entry-adapters-elysia.mjs +53 -0
- package/dist/entry-adapters-elysia.mjs.map +1 -0
- package/dist/entry-adapters-express.cjs +27 -0
- package/dist/entry-adapters-express.cjs.map +1 -0
- package/dist/entry-adapters-express.d.cts +24 -0
- package/dist/entry-adapters-express.d.mts +24 -0
- package/dist/entry-adapters-express.mjs +26 -0
- package/dist/entry-adapters-express.mjs.map +1 -0
- package/dist/entry-adapters-hono.cjs +33 -0
- package/dist/entry-adapters-hono.cjs.map +1 -0
- package/dist/entry-adapters-hono.d.cts +36 -0
- package/dist/entry-adapters-hono.d.mts +36 -0
- package/dist/entry-adapters-hono.mjs +30 -0
- package/dist/entry-adapters-hono.mjs.map +1 -0
- package/dist/entry-adapters-next.cjs +19 -0
- package/dist/entry-adapters-next.cjs.map +1 -0
- package/dist/entry-adapters-next.d.cts +35 -0
- package/dist/entry-adapters-next.d.mts +35 -0
- package/dist/entry-adapters-next.mjs +18 -0
- package/dist/entry-adapters-next.mjs.map +1 -0
- package/dist/entry-adapters-node.cjs +7 -0
- package/dist/entry-adapters-node.d.cts +2 -0
- package/dist/entry-adapters-node.d.mts +2 -0
- package/dist/entry-adapters-node.mjs +2 -0
- package/dist/entry-auth-basic.cjs +5 -0
- package/dist/entry-auth-basic.d.cts +83 -0
- package/dist/entry-auth-basic.d.mts +83 -0
- package/dist/entry-auth-basic.mjs +2 -0
- package/dist/entry-auth-delegated.cjs +28 -0
- package/dist/entry-auth-delegated.cjs.map +1 -0
- package/dist/entry-auth-delegated.d.cts +36 -0
- package/dist/entry-auth-delegated.d.mts +36 -0
- package/dist/entry-auth-delegated.mjs +27 -0
- package/dist/entry-auth-delegated.mjs.map +1 -0
- package/dist/entry-auth-none.cjs +4 -0
- package/dist/entry-auth-none.d.cts +25 -0
- package/dist/entry-auth-none.d.mts +25 -0
- package/dist/entry-auth-none.mjs +2 -0
- package/dist/entry-auth.cjs +0 -0
- package/dist/entry-auth.d.cts +2 -0
- package/dist/entry-auth.d.mts +2 -0
- package/dist/entry-auth.mjs +1 -0
- package/dist/entry-authorization-delegated.cjs +27 -0
- package/dist/entry-authorization-delegated.cjs.map +1 -0
- package/dist/entry-authorization-delegated.d.cts +31 -0
- package/dist/entry-authorization-delegated.d.mts +31 -0
- package/dist/entry-authorization-delegated.mjs +26 -0
- package/dist/entry-authorization-delegated.mjs.map +1 -0
- package/dist/entry-authorization-none.cjs +3 -0
- package/dist/entry-authorization-none.d.cts +18 -0
- package/dist/entry-authorization-none.d.mts +18 -0
- package/dist/entry-authorization-none.mjs +2 -0
- package/dist/entry-authorization-roles.cjs +3 -0
- package/dist/entry-authorization-roles.d.cts +2 -0
- package/dist/entry-authorization-roles.d.mts +2 -0
- package/dist/entry-authorization-roles.mjs +2 -0
- package/dist/entry-authorization.cjs +35 -0
- package/dist/entry-authorization.cjs.map +1 -0
- package/dist/entry-authorization.d.cts +2 -0
- package/dist/entry-authorization.d.mts +2 -0
- package/dist/entry-authorization.mjs +34 -0
- package/dist/entry-authorization.mjs.map +1 -0
- package/dist/entry-build.cjs +481 -0
- package/dist/entry-build.cjs.map +1 -0
- package/dist/entry-build.d.cts +355 -0
- package/dist/entry-build.d.mts +355 -0
- package/dist/entry-build.mjs +460 -0
- package/dist/entry-build.mjs.map +1 -0
- package/dist/entry-cli.cjs +368 -0
- package/dist/entry-cli.cjs.map +1 -0
- package/dist/entry-cli.d.cts +275 -0
- package/dist/entry-cli.d.mts +275 -0
- package/dist/entry-cli.mjs +355 -0
- package/dist/entry-cli.mjs.map +1 -0
- package/dist/entry-drizzle-mysql.cjs +36 -0
- package/dist/entry-drizzle-mysql.cjs.map +1 -0
- package/dist/entry-drizzle-mysql.d.cts +55 -0
- package/dist/entry-drizzle-mysql.d.mts +55 -0
- package/dist/entry-drizzle-mysql.mjs +34 -0
- package/dist/entry-drizzle-mysql.mjs.map +1 -0
- package/dist/entry-drizzle-pg.cjs +38 -0
- package/dist/entry-drizzle-pg.cjs.map +1 -0
- package/dist/entry-drizzle-pg.d.cts +78 -0
- package/dist/entry-drizzle-pg.d.mts +78 -0
- package/dist/entry-drizzle-pg.mjs +36 -0
- package/dist/entry-drizzle-pg.mjs.map +1 -0
- package/dist/entry-drizzle-sqlite.cjs +20 -0
- package/dist/entry-drizzle-sqlite.cjs.map +1 -0
- package/dist/entry-drizzle-sqlite.d.cts +22 -0
- package/dist/entry-drizzle-sqlite.d.mts +22 -0
- package/dist/entry-drizzle-sqlite.mjs +19 -0
- package/dist/entry-drizzle-sqlite.mjs.map +1 -0
- package/dist/entry-hooks-log.cjs +32 -0
- package/dist/entry-hooks-log.cjs.map +1 -0
- package/dist/entry-hooks-log.d.cts +36 -0
- package/dist/entry-hooks-log.d.mts +36 -0
- package/dist/entry-hooks-log.mjs +31 -0
- package/dist/entry-hooks-log.mjs.map +1 -0
- package/dist/entry-hooks.cjs +10 -0
- package/dist/entry-hooks.d.cts +2 -0
- package/dist/entry-hooks.d.mts +2 -0
- package/dist/entry-hooks.mjs +2 -0
- package/dist/entry-server-router.cjs +235 -0
- package/dist/entry-server-router.cjs.map +1 -0
- package/dist/entry-server-router.d.cts +193 -0
- package/dist/entry-server-router.d.mts +193 -0
- package/dist/entry-server-router.mjs +228 -0
- package/dist/entry-server-router.mjs.map +1 -0
- package/dist/entry-server.cjs +344 -0
- package/dist/entry-server.cjs.map +1 -0
- package/dist/entry-server.d.cts +230 -0
- package/dist/entry-server.d.mts +230 -0
- package/dist/entry-server.mjs +322 -0
- package/dist/entry-server.mjs.map +1 -0
- package/dist/entry-site.cjs +1083 -0
- package/dist/entry-site.cjs.map +1 -0
- package/dist/entry-site.d.cts +336 -0
- package/dist/entry-site.d.mts +336 -0
- package/dist/entry-site.mjs +1060 -0
- package/dist/entry-site.mjs.map +1 -0
- package/dist/entry-storage-cloudflare-kv.cjs +51 -0
- package/dist/entry-storage-cloudflare-kv.cjs.map +1 -0
- package/dist/entry-storage-cloudflare-kv.d.cts +52 -0
- package/dist/entry-storage-cloudflare-kv.d.mts +52 -0
- package/dist/entry-storage-cloudflare-kv.mjs +50 -0
- package/dist/entry-storage-cloudflare-kv.mjs.map +1 -0
- package/dist/entry-storage-drizzle-internals.cjs +6 -0
- package/dist/entry-storage-drizzle-internals.d.cts +2 -0
- package/dist/entry-storage-drizzle-internals.d.mts +2 -0
- package/dist/entry-storage-drizzle-internals.mjs +2 -0
- package/dist/entry-storage-drizzle.cjs +4 -0
- package/dist/entry-storage-drizzle.d.cts +3 -0
- package/dist/entry-storage-drizzle.d.mts +3 -0
- package/dist/entry-storage-drizzle.mjs +2 -0
- package/dist/entry-storage-file.cjs +306 -0
- package/dist/entry-storage-file.cjs.map +1 -0
- package/dist/entry-storage-file.d.cts +76 -0
- package/dist/entry-storage-file.d.mts +76 -0
- package/dist/entry-storage-file.mjs +301 -0
- package/dist/entry-storage-file.mjs.map +1 -0
- package/dist/entry-storage-libsql-internals.cjs +7 -0
- package/dist/entry-storage-libsql-internals.d.cts +3 -0
- package/dist/entry-storage-libsql-internals.d.mts +3 -0
- package/dist/entry-storage-libsql-internals.mjs +3 -0
- package/dist/entry-storage-libsql.cjs +3 -0
- package/dist/entry-storage-libsql.d.cts +2 -0
- package/dist/entry-storage-libsql.d.mts +2 -0
- package/dist/entry-storage-libsql.mjs +2 -0
- package/dist/entry-storage-memory.cjs +78 -0
- package/dist/entry-storage-memory.cjs.map +1 -0
- package/dist/entry-storage-memory.d.cts +35 -0
- package/dist/entry-storage-memory.d.mts +35 -0
- package/dist/entry-storage-memory.mjs +77 -0
- package/dist/entry-storage-memory.mjs.map +1 -0
- package/dist/entry-storage-mongodb-internals.cjs +5 -0
- package/dist/entry-storage-mongodb-internals.d.cts +2 -0
- package/dist/entry-storage-mongodb-internals.d.mts +2 -0
- package/dist/entry-storage-mongodb-internals.mjs +2 -0
- package/dist/entry-storage-mongodb.cjs +3 -0
- package/dist/entry-storage-mongodb.d.cts +2 -0
- package/dist/entry-storage-mongodb.d.mts +2 -0
- package/dist/entry-storage-mongodb.mjs +2 -0
- package/dist/entry-storage-postgres-internals.cjs +6 -0
- package/dist/entry-storage-postgres-internals.d.cts +2 -0
- package/dist/entry-storage-postgres-internals.d.mts +2 -0
- package/dist/entry-storage-postgres-internals.mjs +2 -0
- package/dist/entry-storage-postgres.cjs +4 -0
- package/dist/entry-storage-postgres.d.cts +2 -0
- package/dist/entry-storage-postgres.d.mts +2 -0
- package/dist/entry-storage-postgres.mjs +2 -0
- package/dist/entry-storage-redis-internals.cjs +7 -0
- package/dist/entry-storage-redis-internals.d.cts +2 -0
- package/dist/entry-storage-redis-internals.d.mts +2 -0
- package/dist/entry-storage-redis-internals.mjs +2 -0
- package/dist/entry-storage-redis.cjs +4 -0
- package/dist/entry-storage-redis.d.cts +2 -0
- package/dist/entry-storage-redis.d.mts +2 -0
- package/dist/entry-storage-redis.mjs +2 -0
- package/dist/entry-storage-sqlite-internals.cjs +7 -0
- package/dist/entry-storage-sqlite-internals.d.cts +3 -0
- package/dist/entry-storage-sqlite-internals.d.mts +3 -0
- package/dist/entry-storage-sqlite-internals.mjs +3 -0
- package/dist/entry-storage-sqlite.cjs +3 -0
- package/dist/entry-storage-sqlite.d.cts +2 -0
- package/dist/entry-storage-sqlite.d.mts +2 -0
- package/dist/entry-storage-sqlite.mjs +2 -0
- package/dist/entry-storage-testing.cjs +801 -0
- package/dist/entry-storage-testing.cjs.map +1 -0
- package/dist/entry-storage-testing.d.cts +150 -0
- package/dist/entry-storage-testing.d.mts +150 -0
- package/dist/entry-storage-testing.mjs +790 -0
- package/dist/entry-storage-testing.mjs.map +1 -0
- package/dist/entry-storage-unstorage.cjs +78 -0
- package/dist/entry-storage-unstorage.cjs.map +1 -0
- package/dist/entry-storage-unstorage.d.cts +30 -0
- package/dist/entry-storage-unstorage.d.mts +30 -0
- package/dist/entry-storage-unstorage.mjs +77 -0
- package/dist/entry-storage-unstorage.mjs.map +1 -0
- package/dist/entry-storage.cjs +114 -0
- package/dist/entry-storage.cjs.map +1 -0
- package/dist/entry-storage.d.cts +152 -0
- package/dist/entry-storage.d.mts +152 -0
- package/dist/entry-storage.mjs +91 -0
- package/dist/entry-storage.mjs.map +1 -0
- package/dist/entry-testing.cjs +79 -0
- package/dist/entry-testing.cjs.map +1 -0
- package/dist/entry-testing.d.cts +55 -0
- package/dist/entry-testing.d.mts +55 -0
- package/dist/entry-testing.mjs +77 -0
- package/dist/entry-testing.mjs.map +1 -0
- package/dist/entry-tokens.cjs +4 -0
- package/dist/entry-tokens.d.cts +85 -0
- package/dist/entry-tokens.d.mts +85 -0
- package/dist/entry-tokens.mjs +2 -0
- package/dist/entry-ui-embed.cjs +131 -0
- package/dist/entry-ui-embed.cjs.map +1 -0
- package/dist/entry-ui-embed.d.cts +87 -0
- package/dist/entry-ui-embed.d.mts +87 -0
- package/dist/entry-ui-embed.mjs +127 -0
- package/dist/entry-ui-embed.mjs.map +1 -0
- package/dist/entry-ui.cjs +795 -0
- package/dist/entry-ui.cjs.map +1 -0
- package/dist/entry-ui.d.cts +574 -0
- package/dist/entry-ui.d.mts +574 -0
- package/dist/entry-ui.mjs +731 -0
- package/dist/entry-ui.mjs.map +1 -0
- package/dist/entry-util.cjs +145 -0
- package/dist/entry-util.cjs.map +1 -0
- package/dist/entry-util.d.cts +85 -0
- package/dist/entry-util.d.mts +85 -0
- package/dist/entry-util.mjs +130 -0
- package/dist/entry-util.mjs.map +1 -0
- package/dist/http-B_rTnLW9.cjs +235 -0
- package/dist/http-B_rTnLW9.cjs.map +1 -0
- package/dist/http-CxYM7kPT.d.mts +133 -0
- package/dist/http-DVdVI6kJ.mjs +164 -0
- package/dist/http-DVdVI6kJ.mjs.map +1 -0
- package/dist/http-XBVRk8uo.d.cts +133 -0
- package/dist/index.cjs +8 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +6 -0
- package/dist/index.d.mts +6 -0
- package/dist/index.mjs +7 -0
- package/dist/index.mjs.map +1 -0
- package/dist/json-CCyzstIm.d.cts +44 -0
- package/dist/json-CCyzstIm.d.mts +44 -0
- package/dist/json-CM7TwYQ7.cjs +92 -0
- package/dist/json-CM7TwYQ7.cjs.map +1 -0
- package/dist/json-CmM1M5Kz.mjs +63 -0
- package/dist/json-CmM1M5Kz.mjs.map +1 -0
- package/dist/keys-Bwubabk0.mjs +73 -0
- package/dist/keys-Bwubabk0.mjs.map +1 -0
- package/dist/keys-DQrwxDKI.cjs +126 -0
- package/dist/keys-DQrwxDKI.cjs.map +1 -0
- package/dist/kv-sqlite-B6iTLOx2.d.cts +20 -0
- package/dist/kv-sqlite-CHOdIMJ-.cjs +77 -0
- package/dist/kv-sqlite-CHOdIMJ-.cjs.map +1 -0
- package/dist/kv-sqlite-DIIPfflJ.mjs +66 -0
- package/dist/kv-sqlite-DIIPfflJ.mjs.map +1 -0
- package/dist/kv-sqlite-Tx4UedJs.d.mts +20 -0
- package/dist/libsql-0160BubR.d.mts +65 -0
- package/dist/libsql-BZmRZIqt.d.cts +65 -0
- package/dist/libsql-CiBfVtbS.cjs +103 -0
- package/dist/libsql-CiBfVtbS.cjs.map +1 -0
- package/dist/libsql-CkOjQINi.mjs +86 -0
- package/dist/libsql-CkOjQINi.mjs.map +1 -0
- package/dist/mongodb--Cuj7V_9.cjs +150 -0
- package/dist/mongodb--Cuj7V_9.cjs.map +1 -0
- package/dist/mongodb-DGtsolQ2.d.cts +61 -0
- package/dist/mongodb-JMizy4Wg.mjs +127 -0
- package/dist/mongodb-JMizy4Wg.mjs.map +1 -0
- package/dist/mongodb-xGEU5Gwz.d.mts +61 -0
- package/dist/node-B1Djcwfi.d.cts +57 -0
- package/dist/node-B1Djcwfi.d.mts +57 -0
- package/dist/node-BYjocCbU.mjs +167 -0
- package/dist/node-BYjocCbU.mjs.map +1 -0
- package/dist/node-DFFqYRk-.cjs +201 -0
- package/dist/node-DFFqYRk-.cjs.map +1 -0
- package/dist/none-BEY7Kc_-.mjs +33 -0
- package/dist/none-BEY7Kc_-.mjs.map +1 -0
- package/dist/none-BoQ6-30P.cjs +33 -0
- package/dist/none-BoQ6-30P.cjs.map +1 -0
- package/dist/none-CHwVkQL-.cjs +49 -0
- package/dist/none-CHwVkQL-.cjs.map +1 -0
- package/dist/none-yu3qC47E.mjs +23 -0
- package/dist/none-yu3qC47E.mjs.map +1 -0
- package/dist/peer-BIjBFzwQ.cjs +56 -0
- package/dist/peer-BIjBFzwQ.cjs.map +1 -0
- package/dist/peer-CTHMzOdn.mjs +40 -0
- package/dist/peer-CTHMzOdn.mjs.map +1 -0
- package/dist/portal-container-CJIcau3B.mjs +610 -0
- package/dist/portal-container-CJIcau3B.mjs.map +1 -0
- package/dist/portal-container-Ca1NxrLE.cjs +774 -0
- package/dist/portal-container-Ca1NxrLE.cjs.map +1 -0
- package/dist/postgres-BJzxKBk0.d.cts +72 -0
- package/dist/postgres-CA8_XcAE.cjs +164 -0
- package/dist/postgres-CA8_XcAE.cjs.map +1 -0
- package/dist/postgres-RfQMgAsj.d.mts +72 -0
- package/dist/postgres-aDiBmNzr.mjs +135 -0
- package/dist/postgres-aDiBmNzr.mjs.map +1 -0
- package/dist/redis-B2AS4xAQ.cjs +259 -0
- package/dist/redis-B2AS4xAQ.cjs.map +1 -0
- package/dist/redis-B362ofBw.d.cts +159 -0
- package/dist/redis-CahNAVTW.d.mts +159 -0
- package/dist/redis-hdoKymfG.mjs +218 -0
- package/dist/redis-hdoKymfG.mjs.map +1 -0
- package/dist/roles-7JPrQXZa.mjs +46 -0
- package/dist/roles-7JPrQXZa.mjs.map +1 -0
- package/dist/roles-B_8QqJ3j.cjs +56 -0
- package/dist/roles-B_8QqJ3j.cjs.map +1 -0
- package/dist/roles-DLISB4T3.d.mts +41 -0
- package/dist/roles-DQbbtUPW.d.cts +41 -0
- package/dist/rolldown-runtime-D7D4PA-g.mjs +13 -0
- package/dist/scope-css-BN3jf0ly.cjs +315 -0
- package/dist/scope-css-BN3jf0ly.cjs.map +1 -0
- package/dist/scope-css-BuJfRCsE.mjs +256 -0
- package/dist/scope-css-BuJfRCsE.mjs.map +1 -0
- package/dist/scoped-BRoE1W1x.cjs +175 -0
- package/dist/scoped-BRoE1W1x.cjs.map +1 -0
- package/dist/scoped-cFBbotCh.mjs +164 -0
- package/dist/scoped-cFBbotCh.mjs.map +1 -0
- package/dist/sqlite-B2g1JJz1.d.cts +47 -0
- package/dist/sqlite-BIPIlxfj.d.mts +47 -0
- package/dist/sqlite-BntoYaXZ.cjs +79 -0
- package/dist/sqlite-BntoYaXZ.cjs.map +1 -0
- package/dist/sqlite-DYJDcu7p.mjs +62 -0
- package/dist/sqlite-DYJDcu7p.mjs.map +1 -0
- package/dist/table-BrioFSra.d.cts +11 -0
- package/dist/table-BrioFSra.d.mts +11 -0
- package/dist/theme-context-DzZ1otaD.d.cts +270 -0
- package/dist/theme-context-J65pythD.d.mts +270 -0
- package/dist/ui/styles.css +239 -0
- package/dist/util-Dnj5T-yw.mjs +39 -0
- package/dist/util-Dnj5T-yw.mjs.map +1 -0
- package/dist/util-dAnTK9x-.cjs +74 -0
- package/dist/util-dAnTK9x-.cjs.map +1 -0
- package/dist/validation-B-atP968.mjs +191 -0
- package/dist/validation-B-atP968.mjs.map +1 -0
- package/dist/validation-BJifGoB2.d.mts +122 -0
- package/dist/validation-DLnzBVJr.cjs +258 -0
- package/dist/validation-DLnzBVJr.cjs.map +1 -0
- package/dist/validation-tfV2qhbD.d.cts +122 -0
- package/package.json +715 -4
- package/tsconfig/assets.d.ts +21 -0
- package/tsconfig/base.json +21 -0
- package/tsconfig/react.json +9 -0
|
@@ -0,0 +1,322 @@
|
|
|
1
|
+
import { n as stripBasePath, t as normalizeBasePath } from "./base-path-CDb4In5E.mjs";
|
|
2
|
+
import { t as durationToMs } from "./duration-7WpAK-xe.mjs";
|
|
3
|
+
import { a as error, c as mapError, d as noContent, f as requireOneOf, i as authorize, l as match, n as JSON_CONTENT_TYPE, o as intParam, r as authenticate, s as json, t as HttpError, u as methodNotAllowed } from "./http-DVdVI6kJ.mjs";
|
|
4
|
+
//#region src/server/cors.ts
|
|
5
|
+
const DEFAULT_METHODS = "GET,HEAD,PUT,POST,DELETE,PATCH,OPTIONS";
|
|
6
|
+
/**
|
|
7
|
+
* Resolve the value for `Access-Control-Allow-Origin` for this request, or
|
|
8
|
+
* `null` when the origin is not allowed (no CORS headers → the browser blocks).
|
|
9
|
+
*/
|
|
10
|
+
function resolveOrigin(cors, requestOrigin) {
|
|
11
|
+
const { origin } = cors;
|
|
12
|
+
if (origin === "*") return cors.credentials ? requestOrigin ?? null : "*";
|
|
13
|
+
if (requestOrigin === null) return null;
|
|
14
|
+
return (typeof origin === "string" ? origin === requestOrigin : Array.isArray(origin) ? origin.includes(requestOrigin) : origin(requestOrigin)) ? requestOrigin : null;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* `response` itself when its headers can be changed, else a copy that shares
|
|
18
|
+
* its body (`Response.redirect()` and `fetch()` responses have immutable
|
|
19
|
+
* headers).
|
|
20
|
+
*/
|
|
21
|
+
function mutable(response) {
|
|
22
|
+
try {
|
|
23
|
+
response.headers.set("x-xtandard-probe", "1");
|
|
24
|
+
response.headers.delete("x-xtandard-probe");
|
|
25
|
+
return response;
|
|
26
|
+
} catch {
|
|
27
|
+
return new Response(response.body, response);
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
/** Attach `Access-Control-*` headers to `response` for an allowed cross-origin request. */
|
|
31
|
+
function applyCorsHeaders(request, response, cors) {
|
|
32
|
+
const allowOrigin = resolveOrigin(cors, request.headers.get("origin"));
|
|
33
|
+
if (allowOrigin === null) return response;
|
|
34
|
+
response = mutable(response);
|
|
35
|
+
response.headers.set("access-control-allow-origin", allowOrigin);
|
|
36
|
+
if (cors.credentials) response.headers.set("access-control-allow-credentials", "true");
|
|
37
|
+
if (allowOrigin !== "*") response.headers.append("vary", "Origin");
|
|
38
|
+
return response;
|
|
39
|
+
}
|
|
40
|
+
/** Build the `204` response for a CORS preflight (`OPTIONS`). */
|
|
41
|
+
function preflightResponse(request, cors) {
|
|
42
|
+
const response = new Response(null, { status: 204 });
|
|
43
|
+
applyCorsHeaders(request, response, cors);
|
|
44
|
+
response.headers.set("access-control-allow-methods", (cors.methods ?? []).join(",") || DEFAULT_METHODS);
|
|
45
|
+
const requestedHeaders = request.headers.get("access-control-request-headers");
|
|
46
|
+
response.headers.set("access-control-allow-headers", cors.headers?.join(",") || requestedHeaders || "Content-Type, Authorization");
|
|
47
|
+
if (cors.maxAge !== void 0) response.headers.set("access-control-max-age", String(cors.maxAge));
|
|
48
|
+
return response;
|
|
49
|
+
}
|
|
50
|
+
//#endregion
|
|
51
|
+
//#region src/server/render-index-html.ts
|
|
52
|
+
const IDENTIFIER = /^[A-Za-z_$][A-Za-z0-9_$]*$/;
|
|
53
|
+
const escapeJson = (value) => JSON.stringify(value).replace(/</g, "\\u003c").replace(/>/g, "\\u003e").replace(/\u2028/g, "\\u2028").replace(/\u2029/g, "\\u2029");
|
|
54
|
+
const escapeHtml = (s) => s.replace(/[&<>"']/g, (c) => `&#${c.charCodeAt(0)};`);
|
|
55
|
+
/** Build the `<base href>` value (always ends in `/`). */
|
|
56
|
+
function baseHref(basePath) {
|
|
57
|
+
return basePath === "" ? "/" : `${basePath}/`;
|
|
58
|
+
}
|
|
59
|
+
function headTags(options) {
|
|
60
|
+
return `<base href="${escapeHtml(baseHref(options.config.basePath))}"><script>window.${options.globalName}=${escapeJson(options.config)}<\/script>`;
|
|
61
|
+
}
|
|
62
|
+
function injectInto(html, options) {
|
|
63
|
+
const tags = headTags(options);
|
|
64
|
+
if (html.includes("<head>")) return html.replace("<head>", () => `<head>${tags}`);
|
|
65
|
+
return tags + html;
|
|
66
|
+
}
|
|
67
|
+
/** Minimal page served when no built UI is present. */
|
|
68
|
+
function fallbackHtml(options) {
|
|
69
|
+
const title = escapeHtml(String(options.config.title));
|
|
70
|
+
const code = "background:#1a1a1a;padding:2px 6px;border-radius:4px";
|
|
71
|
+
return `<!doctype html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1">${headTags(options)}<title>${title}</title></head><body style="font-family:system-ui;margin:0;padding:3rem;background:#0a0a0a;color:#e5e5e5"><h1 style="margin:0 0 .5rem">${title}</h1><p style="color:#a3a3a3">The admin UI bundle is not built. Run <code style="${code}">bun run build:ui</code>. The JSON API at <code style="${code}">api/</code> is fully available (<a style="color:#2dd4bf" href="api/openapi.json">OpenAPI</a>).</p></body></html>`;
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* Read, inject into, and return the SPA index HTML from `uiDir`, or the
|
|
75
|
+
* fallback page when `uiDir` is `undefined` or has no `index.html`.
|
|
76
|
+
*
|
|
77
|
+
* @example
|
|
78
|
+
* ```ts
|
|
79
|
+
* const html = await renderIndexHtml(uiDir, {
|
|
80
|
+
* globalName: "__WEBHOOKS_CONFIG__",
|
|
81
|
+
* config: { title, basePath, readonly },
|
|
82
|
+
* });
|
|
83
|
+
* ```
|
|
84
|
+
*/
|
|
85
|
+
async function renderIndexHtml(uiDir, options) {
|
|
86
|
+
if (!IDENTIFIER.test(options.globalName)) throw new TypeError(`renderIndexHtml: globalName must be an identifier, got "${options.globalName}"`);
|
|
87
|
+
if (uiDir === void 0) return fallbackHtml(options);
|
|
88
|
+
try {
|
|
89
|
+
const [{ readFile }, { join }] = await Promise.all([import("node:fs/promises"), import("node:path")]);
|
|
90
|
+
return injectInto(await readFile(join(uiDir, "index.html"), "utf8"), options);
|
|
91
|
+
} catch {
|
|
92
|
+
return fallbackHtml(options);
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
//#endregion
|
|
96
|
+
//#region src/server/static-assets.ts
|
|
97
|
+
/**
|
|
98
|
+
* Serves the bundled SPA's static assets from the UI output directory. Maps file
|
|
99
|
+
* extensions to content types and guards against path traversal.
|
|
100
|
+
*
|
|
101
|
+
* `node:fs` / `node:path` are imported lazily, only when an asset is actually
|
|
102
|
+
* served, so a runtime without them (Cloudflare Workers without
|
|
103
|
+
* `nodejs_compat`) can still import the panel and serve the API — it just
|
|
104
|
+
* passes no `uiDir`.
|
|
105
|
+
*
|
|
106
|
+
* @module
|
|
107
|
+
*/
|
|
108
|
+
const CONTENT_TYPES = {
|
|
109
|
+
".html": "text/html; charset=utf-8",
|
|
110
|
+
".js": "text/javascript; charset=utf-8",
|
|
111
|
+
".mjs": "text/javascript; charset=utf-8",
|
|
112
|
+
".css": "text/css; charset=utf-8",
|
|
113
|
+
".json": "application/json; charset=utf-8",
|
|
114
|
+
".svg": "image/svg+xml",
|
|
115
|
+
".png": "image/png",
|
|
116
|
+
".jpg": "image/jpeg",
|
|
117
|
+
".jpeg": "image/jpeg",
|
|
118
|
+
".gif": "image/gif",
|
|
119
|
+
".webp": "image/webp",
|
|
120
|
+
".ico": "image/x-icon",
|
|
121
|
+
".woff": "font/woff",
|
|
122
|
+
".woff2": "font/woff2",
|
|
123
|
+
".ttf": "font/ttf",
|
|
124
|
+
".map": "application/json; charset=utf-8",
|
|
125
|
+
".txt": "text/plain; charset=utf-8"
|
|
126
|
+
};
|
|
127
|
+
function contentType(path) {
|
|
128
|
+
const dot = path.lastIndexOf(".");
|
|
129
|
+
return CONTENT_TYPES[dot >= 0 ? path.slice(dot).toLowerCase() : ""] ?? "application/octet-stream";
|
|
130
|
+
}
|
|
131
|
+
/** True if the path has a file extension (so a miss should 404 rather than fall through to the SPA). */
|
|
132
|
+
function looksLikeAsset(path) {
|
|
133
|
+
return (path.split("/").pop() ?? "").includes(".");
|
|
134
|
+
}
|
|
135
|
+
/**
|
|
136
|
+
* Try to serve `path` (base-path-stripped, leading `/`) as a static file from
|
|
137
|
+
* `uiDir`. Returns a `Response`, or `null` if the file does not exist or the
|
|
138
|
+
* path escapes `uiDir`. Files under `assets/` (content-hashed by the bundler)
|
|
139
|
+
* are cached for a year; everything else is `no-cache`.
|
|
140
|
+
*/
|
|
141
|
+
async function serveStaticAsset(uiDir, path) {
|
|
142
|
+
const [{ readFile }, { join, normalize, resolve, sep }] = await Promise.all([import("node:fs/promises"), import("node:path")]);
|
|
143
|
+
const rel = normalize(path).replace(/^(\.\.(\/|\\|$))+/, "");
|
|
144
|
+
const root = resolve(uiDir);
|
|
145
|
+
const full = resolve(join(root, rel));
|
|
146
|
+
if (full !== root && !full.startsWith(root + sep)) return null;
|
|
147
|
+
try {
|
|
148
|
+
const data = await readFile(full);
|
|
149
|
+
return new Response(new Uint8Array(data), {
|
|
150
|
+
status: 200,
|
|
151
|
+
headers: {
|
|
152
|
+
"content-type": contentType(full),
|
|
153
|
+
"cache-control": rel.includes("/assets/") ? "public, max-age=31536000, immutable" : "no-cache"
|
|
154
|
+
}
|
|
155
|
+
});
|
|
156
|
+
} catch {
|
|
157
|
+
return null;
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
/**
|
|
161
|
+
* Locate a product's built SPA. Pass the product module's `import.meta.url`:
|
|
162
|
+
* compiled (the npm-consumer case) the bundle is the sibling `./ui` of the
|
|
163
|
+
* module's `dist/` chunk; run from TypeScript source (examples, `file:`
|
|
164
|
+
* links) it is `<repo>/dist/ui`. Falls back to the compiled-layout path so the
|
|
165
|
+
* "build the UI" hint still fires when nothing is built yet.
|
|
166
|
+
*
|
|
167
|
+
* Extra `candidates` (relative to `moduleUrl`) are tried first. Returns
|
|
168
|
+
* `undefined` when the module URL is not a `file:` URL or the runtime has no
|
|
169
|
+
* `node:fs` (Workers): the panel then serves the API and a fallback page.
|
|
170
|
+
*
|
|
171
|
+
* @example
|
|
172
|
+
* ```ts
|
|
173
|
+
* const uiDir = options.uiDir ?? resolveUiDir(import.meta.url);
|
|
174
|
+
* ```
|
|
175
|
+
*/
|
|
176
|
+
function resolveUiDir(moduleUrl, candidates = []) {
|
|
177
|
+
const fs = getBuiltin("node:fs");
|
|
178
|
+
const url = getBuiltin("node:url");
|
|
179
|
+
if (!fs || !url) return void 0;
|
|
180
|
+
try {
|
|
181
|
+
const paths = [
|
|
182
|
+
...candidates,
|
|
183
|
+
"./ui",
|
|
184
|
+
"../../dist/ui"
|
|
185
|
+
].map((c) => url.fileURLToPath(new URL(c, moduleUrl)));
|
|
186
|
+
return paths.find((p) => fs.existsSync(p)) ?? paths[candidates.length];
|
|
187
|
+
} catch {
|
|
188
|
+
return;
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
/** A Node built-in, synchronously, when the runtime has it (Node ≥ 20.16, Bun, Deno). */
|
|
192
|
+
function getBuiltin(name) {
|
|
193
|
+
return globalThis.process?.getBuiltinModule?.(name);
|
|
194
|
+
}
|
|
195
|
+
//#endregion
|
|
196
|
+
//#region src/server/panel.ts
|
|
197
|
+
/**
|
|
198
|
+
* The panel handler skeleton every product wraps in its `createFetchHandler`:
|
|
199
|
+
* one web-standard `(request) => Promise<Response>` that serves the
|
|
200
|
+
* healthcheck, the product's JSON API, the OpenAPI document, the bundled SPA's
|
|
201
|
+
* static assets and the SPA fallback, under any base path, with optional
|
|
202
|
+
* CORS, plus a uniform `close()` that stops background tasks.
|
|
203
|
+
*
|
|
204
|
+
* Request flow:
|
|
205
|
+
*
|
|
206
|
+
* 1. `OPTIONS` with `cors` set → preflight `204`.
|
|
207
|
+
* 2. `GET|HEAD /healthcheck` → `{ ok: true }`.
|
|
208
|
+
* 3. The product's `api(request, path)`; a non-`null` response wins.
|
|
209
|
+
* 4. `GET|HEAD /api/openapi.json` (and `/openapi.json`) when `openapi` is set.
|
|
210
|
+
* 5. Any other method → `405` (`Allow: GET, HEAD`).
|
|
211
|
+
* 6. A static asset from `uiDir`; a miss on an asset-looking path → `404`.
|
|
212
|
+
* 7. The SPA `index.html` with the bootstrap injected, `cache-control: no-cache`.
|
|
213
|
+
*
|
|
214
|
+
* @module
|
|
215
|
+
*/
|
|
216
|
+
const OPENAPI_PATHS = new Set(["/api/openapi.json", "/openapi.json"]);
|
|
217
|
+
/**
|
|
218
|
+
* Build the panel handler.
|
|
219
|
+
*
|
|
220
|
+
* @example
|
|
221
|
+
* ```ts
|
|
222
|
+
* import { createPanelHandler, resolveUiDir } from "@xtandard/kit/server";
|
|
223
|
+
*
|
|
224
|
+
* const panel = createPanelHandler({
|
|
225
|
+
* basePath: options.basePath,
|
|
226
|
+
* title: options.title ?? "@xtandard/webhooks",
|
|
227
|
+
* globalName: "__WEBHOOKS_CONFIG__",
|
|
228
|
+
* uiDir: options.uiDir ?? resolveUiDir(import.meta.url),
|
|
229
|
+
* api: (request, path) => handleApiRequest(request, path, ctx),
|
|
230
|
+
* openapi: () => buildOpenApiDocument({ basePath, title }),
|
|
231
|
+
* tasks: [dispatcherTask],
|
|
232
|
+
* });
|
|
233
|
+
* Bun.serve({ fetch: panel.fetch });
|
|
234
|
+
* ```
|
|
235
|
+
*/
|
|
236
|
+
function createPanelHandler(options) {
|
|
237
|
+
const basePath = normalizeBasePath(options.basePath);
|
|
238
|
+
const { cors, uiDir } = options;
|
|
239
|
+
const healthcheck = options.healthcheck ?? "/healthcheck";
|
|
240
|
+
const tasks = [...options.tasks ?? []];
|
|
241
|
+
for (const task of tasks) task.start?.();
|
|
242
|
+
let closing;
|
|
243
|
+
async function fetch(request) {
|
|
244
|
+
if (cors && request.method === "OPTIONS") return preflightResponse(request, cors);
|
|
245
|
+
const response = await respond(request);
|
|
246
|
+
return cors ? applyCorsHeaders(request, response, cors) : response;
|
|
247
|
+
}
|
|
248
|
+
async function respond(request) {
|
|
249
|
+
const path = stripBasePath(new URL(request.url).pathname, basePath);
|
|
250
|
+
const read = request.method === "GET" || request.method === "HEAD";
|
|
251
|
+
if (read && healthcheck !== false && path === healthcheck) return json({ ok: true });
|
|
252
|
+
const api = options.api ? await options.api(request, path) : null;
|
|
253
|
+
if (api) return api;
|
|
254
|
+
if (read && options.openapi && OPENAPI_PATHS.has(path)) return json(options.openapi());
|
|
255
|
+
if (!read) return new Response("Method Not Allowed", {
|
|
256
|
+
status: 405,
|
|
257
|
+
headers: { allow: "GET, HEAD" }
|
|
258
|
+
});
|
|
259
|
+
if (uiDir !== void 0) {
|
|
260
|
+
const asset = await serveStaticAsset(uiDir, path);
|
|
261
|
+
if (asset) return asset;
|
|
262
|
+
}
|
|
263
|
+
if (path !== "/" && looksLikeAsset(path)) return new Response("Not Found", { status: 404 });
|
|
264
|
+
const html = await renderIndexHtml(uiDir, {
|
|
265
|
+
globalName: options.globalName,
|
|
266
|
+
config: {
|
|
267
|
+
title: options.title,
|
|
268
|
+
basePath,
|
|
269
|
+
readonly: options.readonly ?? false,
|
|
270
|
+
...options.logoUrl !== void 0 ? { logoUrl: options.logoUrl } : {},
|
|
271
|
+
...options.bootstrap?.()
|
|
272
|
+
}
|
|
273
|
+
});
|
|
274
|
+
return new Response(html, {
|
|
275
|
+
status: 200,
|
|
276
|
+
headers: {
|
|
277
|
+
"content-type": "text/html; charset=utf-8",
|
|
278
|
+
"cache-control": "no-cache"
|
|
279
|
+
}
|
|
280
|
+
});
|
|
281
|
+
}
|
|
282
|
+
return {
|
|
283
|
+
fetch,
|
|
284
|
+
basePath,
|
|
285
|
+
close() {
|
|
286
|
+
closing ??= Promise.all(tasks.map(async (task) => task.stop())).then(() => void 0);
|
|
287
|
+
return closing;
|
|
288
|
+
}
|
|
289
|
+
};
|
|
290
|
+
}
|
|
291
|
+
/**
|
|
292
|
+
* A {@link PanelTask} that runs `run` every `every` (a `Duration`). The timer
|
|
293
|
+
* is `unref()`ed so it never keeps the process alive; a run that rejects is
|
|
294
|
+
* reported, never thrown. `every <= 0` makes a task that does nothing.
|
|
295
|
+
*
|
|
296
|
+
* @example
|
|
297
|
+
* ```ts
|
|
298
|
+
* tasks: [intervalTask("1m", () => engine.sweep(), { source: "@xtandard/entitlements" })]
|
|
299
|
+
* ```
|
|
300
|
+
*/
|
|
301
|
+
function intervalTask(every, run, options = {}) {
|
|
302
|
+
const ms = durationToMs(every);
|
|
303
|
+
const onError = options.onError ?? ((error) => console.warn(`[${options.source ?? "@xtandard/kit"}] task failed:`, error));
|
|
304
|
+
let timer;
|
|
305
|
+
return {
|
|
306
|
+
start() {
|
|
307
|
+
if (ms <= 0 || timer) return;
|
|
308
|
+
timer = setInterval(() => {
|
|
309
|
+
Promise.resolve().then(run).catch((error) => onError(error));
|
|
310
|
+
}, ms);
|
|
311
|
+
timer.unref?.();
|
|
312
|
+
},
|
|
313
|
+
stop() {
|
|
314
|
+
if (timer) clearInterval(timer);
|
|
315
|
+
timer = void 0;
|
|
316
|
+
}
|
|
317
|
+
};
|
|
318
|
+
}
|
|
319
|
+
//#endregion
|
|
320
|
+
export { HttpError, JSON_CONTENT_TYPE, applyCorsHeaders, authenticate, authorize, createPanelHandler, error, intParam, intervalTask, json, looksLikeAsset, mapError, match, methodNotAllowed, noContent, normalizeBasePath, preflightResponse, renderIndexHtml, requireOneOf, resolveUiDir, serveStaticAsset, stripBasePath };
|
|
321
|
+
|
|
322
|
+
//# sourceMappingURL=entry-server.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"entry-server.mjs","names":[],"sources":["../src/server/cors.ts","../src/server/render-index-html.ts","../src/server/static-assets.ts","../src/server/panel.ts"],"sourcesContent":["/**\n * Framework-independent CORS for the mounted panel. When the panel handler is\n * given a `cors` option, it answers `OPTIONS` preflights itself and attaches\n * `Access-Control-*` headers to every response — so a **cross-origin embed**\n * (a widget on `app.example.com`, the panel on `api.example.com`) works even if\n * the host framework's CORS middleware does not wrap the mounted sub-handler.\n *\n * @module\n */\n\n/** CORS configuration for the panel handler. */\nexport interface CorsOptions {\n /**\n * Allowed origin(s): a single origin (`\"https://app.example.com\"`), `\"*\"`, a\n * list, or a predicate `(origin) => boolean`. With `credentials: true`, `\"*\"`\n * is echoed back as the caller's exact origin (the browser forbids `*` +\n * credentials).\n */\n origin: string | string[] | ((origin: string) => boolean);\n /** Send `Access-Control-Allow-Credentials: true` (needed for cookie auth). Default `false`. */\n credentials?: boolean;\n /** Allowed methods advertised in preflight. Default `GET,HEAD,PUT,POST,DELETE,PATCH,OPTIONS`. */\n methods?: string[];\n /**\n * Allowed request headers advertised in preflight. Default: reflect the\n * request's `Access-Control-Request-Headers`, falling back to\n * `Content-Type, Authorization`.\n */\n headers?: string[];\n /** `Access-Control-Max-Age` (seconds) for the preflight cache. */\n maxAge?: number;\n}\n\nconst DEFAULT_METHODS = \"GET,HEAD,PUT,POST,DELETE,PATCH,OPTIONS\";\n\n/**\n * Resolve the value for `Access-Control-Allow-Origin` for this request, or\n * `null` when the origin is not allowed (no CORS headers → the browser blocks).\n */\nfunction resolveOrigin(cors: CorsOptions, requestOrigin: string | null): string | null {\n const { origin } = cors;\n if (origin === \"*\") {\n // `*` + credentials is invalid; echo the caller's origin instead.\n return cors.credentials ? (requestOrigin ?? null) : \"*\";\n }\n if (requestOrigin === null) return null;\n const allowed =\n typeof origin === \"string\"\n ? origin === requestOrigin\n : Array.isArray(origin)\n ? origin.includes(requestOrigin)\n : origin(requestOrigin);\n return allowed ? requestOrigin : null;\n}\n\n/**\n * `response` itself when its headers can be changed, else a copy that shares\n * its body (`Response.redirect()` and `fetch()` responses have immutable\n * headers).\n */\nfunction mutable(response: Response): Response {\n try {\n response.headers.set(\"x-xtandard-probe\", \"1\");\n response.headers.delete(\"x-xtandard-probe\");\n return response;\n } catch {\n return new Response(response.body, response);\n }\n}\n\n/** Attach `Access-Control-*` headers to `response` for an allowed cross-origin request. */\nexport function applyCorsHeaders(\n request: Request,\n response: Response,\n cors: CorsOptions,\n): Response {\n const requestOrigin = request.headers.get(\"origin\");\n const allowOrigin = resolveOrigin(cors, requestOrigin);\n if (allowOrigin === null) return response;\n response = mutable(response);\n response.headers.set(\"access-control-allow-origin\", allowOrigin);\n if (cors.credentials) response.headers.set(\"access-control-allow-credentials\", \"true\");\n // The response varies by Origin unless we blanket-allow `*` — tell caches.\n if (allowOrigin !== \"*\") response.headers.append(\"vary\", \"Origin\");\n return response;\n}\n\n/** Build the `204` response for a CORS preflight (`OPTIONS`). */\nexport function preflightResponse(request: Request, cors: CorsOptions): Response {\n const response = new Response(null, { status: 204 });\n applyCorsHeaders(request, response, cors);\n response.headers.set(\n \"access-control-allow-methods\",\n (cors.methods ?? []).join(\",\") || DEFAULT_METHODS,\n );\n const requestedHeaders = request.headers.get(\"access-control-request-headers\");\n response.headers.set(\n \"access-control-allow-headers\",\n cors.headers?.join(\",\") || requestedHeaders || \"Content-Type, Authorization\",\n );\n if (cors.maxAge !== undefined) {\n response.headers.set(\"access-control-max-age\", String(cors.maxAge));\n }\n return response;\n}\n","/**\n * Renders the SPA `index.html`: injects a `<base>` tag so relative asset URLs\n * resolve under any mount path, and a bootstrap `window.<globalName>` blob.\n * Falls back to a minimal built-in page when the UI bundle is absent (before\n * `bun run build:ui`, in headless tests, or on Workers without `node:fs`).\n *\n * Everything operator-controlled is escaped: the title (HTML), the `<base\n * href>` (attribute) and the bootstrap JSON (`<`, `>`, U+2028/U+2029, so it\n * can't close the `<script>` or break the line).\n *\n * @module\n */\n\n/** Bootstrap config injected into the page. Products add their own fields. */\nexport interface BootstrapConfig {\n title: string;\n basePath: string;\n [key: string]: unknown;\n}\n\n/** Options for {@link renderIndexHtml}. */\nexport interface RenderIndexHtmlOptions {\n /**\n * The global the SPA reads its bootstrap from, e.g. `\"__WEBHOOKS_CONFIG__\"`.\n * Must be a JavaScript identifier.\n */\n globalName: string;\n /** The bootstrap config (`title` and `basePath` are required). */\n config: BootstrapConfig;\n}\n\nconst IDENTIFIER = /^[A-Za-z_$][A-Za-z0-9_$]*$/;\n\nconst escapeJson = (value: unknown): string =>\n JSON.stringify(value)\n .replace(/</g, \"\\\\u003c\")\n .replace(/>/g, \"\\\\u003e\")\n .replace(/\\u2028/g, \"\\\\u2028\")\n .replace(/\\u2029/g, \"\\\\u2029\");\n\nconst escapeHtml = (s: string): string => s.replace(/[&<>\"']/g, (c) => `&#${c.charCodeAt(0)};`);\n\n/** Build the `<base href>` value (always ends in `/`). */\nfunction baseHref(basePath: string): string {\n return basePath === \"\" ? \"/\" : `${basePath}/`;\n}\n\nfunction headTags(options: RenderIndexHtmlOptions): string {\n return (\n `<base href=\"${escapeHtml(baseHref(options.config.basePath))}\">` +\n `<script>window.${options.globalName}=${escapeJson(options.config)}</script>`\n );\n}\n\nfunction injectInto(html: string, options: RenderIndexHtmlOptions): string {\n const tags = headTags(options);\n if (html.includes(\"<head>\")) return html.replace(\"<head>\", () => `<head>${tags}`);\n return tags + html;\n}\n\n/** Minimal page served when no built UI is present. */\nfunction fallbackHtml(options: RenderIndexHtmlOptions): string {\n const title = escapeHtml(String(options.config.title));\n const code = \"background:#1a1a1a;padding:2px 6px;border-radius:4px\";\n return `<!doctype html><html lang=\"en\"><head><meta charset=\"utf-8\"><meta name=\"viewport\" content=\"width=device-width,initial-scale=1\">${headTags(\n options,\n )}<title>${title}</title></head><body style=\"font-family:system-ui;margin:0;padding:3rem;background:#0a0a0a;color:#e5e5e5\"><h1 style=\"margin:0 0 .5rem\">${title}</h1><p style=\"color:#a3a3a3\">The admin UI bundle is not built. Run <code style=\"${code}\">bun run build:ui</code>. The JSON API at <code style=\"${code}\">api/</code> is fully available (<a style=\"color:#2dd4bf\" href=\"api/openapi.json\">OpenAPI</a>).</p></body></html>`;\n}\n\n/**\n * Read, inject into, and return the SPA index HTML from `uiDir`, or the\n * fallback page when `uiDir` is `undefined` or has no `index.html`.\n *\n * @example\n * ```ts\n * const html = await renderIndexHtml(uiDir, {\n * globalName: \"__WEBHOOKS_CONFIG__\",\n * config: { title, basePath, readonly },\n * });\n * ```\n */\nexport async function renderIndexHtml(\n uiDir: string | undefined,\n options: RenderIndexHtmlOptions,\n): Promise<string> {\n if (!IDENTIFIER.test(options.globalName)) {\n throw new TypeError(\n `renderIndexHtml: globalName must be an identifier, got \"${options.globalName}\"`,\n );\n }\n if (uiDir === undefined) return fallbackHtml(options);\n try {\n const [{ readFile }, { join }] = await Promise.all([\n import(\"node:fs/promises\"),\n import(\"node:path\"),\n ]);\n const html = await readFile(join(uiDir, \"index.html\"), \"utf8\");\n return injectInto(html, options);\n } catch {\n return fallbackHtml(options);\n }\n}\n","/**\n * Serves the bundled SPA's static assets from the UI output directory. Maps file\n * extensions to content types and guards against path traversal.\n *\n * `node:fs` / `node:path` are imported lazily, only when an asset is actually\n * served, so a runtime without them (Cloudflare Workers without\n * `nodejs_compat`) can still import the panel and serve the API — it just\n * passes no `uiDir`.\n *\n * @module\n */\n\nconst CONTENT_TYPES: Record<string, string> = {\n \".html\": \"text/html; charset=utf-8\",\n \".js\": \"text/javascript; charset=utf-8\",\n \".mjs\": \"text/javascript; charset=utf-8\",\n \".css\": \"text/css; charset=utf-8\",\n \".json\": \"application/json; charset=utf-8\",\n \".svg\": \"image/svg+xml\",\n \".png\": \"image/png\",\n \".jpg\": \"image/jpeg\",\n \".jpeg\": \"image/jpeg\",\n \".gif\": \"image/gif\",\n \".webp\": \"image/webp\",\n \".ico\": \"image/x-icon\",\n \".woff\": \"font/woff\",\n \".woff2\": \"font/woff2\",\n \".ttf\": \"font/ttf\",\n \".map\": \"application/json; charset=utf-8\",\n \".txt\": \"text/plain; charset=utf-8\",\n};\n\nfunction contentType(path: string): string {\n const dot = path.lastIndexOf(\".\");\n const ext = dot >= 0 ? path.slice(dot).toLowerCase() : \"\";\n return CONTENT_TYPES[ext] ?? \"application/octet-stream\";\n}\n\n/** True if the path has a file extension (so a miss should 404 rather than fall through to the SPA). */\nexport function looksLikeAsset(path: string): boolean {\n const last = path.split(\"/\").pop() ?? \"\";\n return last.includes(\".\");\n}\n\n/**\n * Try to serve `path` (base-path-stripped, leading `/`) as a static file from\n * `uiDir`. Returns a `Response`, or `null` if the file does not exist or the\n * path escapes `uiDir`. Files under `assets/` (content-hashed by the bundler)\n * are cached for a year; everything else is `no-cache`.\n */\nexport async function serveStaticAsset(uiDir: string, path: string): Promise<Response | null> {\n const [{ readFile }, { join, normalize, resolve, sep }] = await Promise.all([\n import(\"node:fs/promises\"),\n import(\"node:path\"),\n ]);\n // Resolve within uiDir and refuse anything that escapes it (including sibling\n // directories that merely share the prefix, e.g. `ui-private`).\n const rel = normalize(path).replace(/^(\\.\\.(\\/|\\\\|$))+/, \"\");\n const root = resolve(uiDir);\n const full = resolve(join(root, rel));\n if (full !== root && !full.startsWith(root + sep)) return null;\n try {\n const data = await readFile(full);\n return new Response(new Uint8Array(data), {\n status: 200,\n headers: {\n \"content-type\": contentType(full),\n \"cache-control\": rel.includes(\"/assets/\")\n ? \"public, max-age=31536000, immutable\"\n : \"no-cache\",\n },\n });\n } catch {\n return null;\n }\n}\n\n/**\n * Locate a product's built SPA. Pass the product module's `import.meta.url`:\n * compiled (the npm-consumer case) the bundle is the sibling `./ui` of the\n * module's `dist/` chunk; run from TypeScript source (examples, `file:`\n * links) it is `<repo>/dist/ui`. Falls back to the compiled-layout path so the\n * \"build the UI\" hint still fires when nothing is built yet.\n *\n * Extra `candidates` (relative to `moduleUrl`) are tried first. Returns\n * `undefined` when the module URL is not a `file:` URL or the runtime has no\n * `node:fs` (Workers): the panel then serves the API and a fallback page.\n *\n * @example\n * ```ts\n * const uiDir = options.uiDir ?? resolveUiDir(import.meta.url);\n * ```\n */\nexport function resolveUiDir(\n moduleUrl: string | URL,\n candidates: readonly string[] = [],\n): string | undefined {\n const fs = getBuiltin<{ existsSync(path: string): boolean }>(\"node:fs\");\n const url = getBuiltin<{ fileURLToPath(url: URL): string }>(\"node:url\");\n if (!fs || !url) return undefined;\n try {\n const paths = [...candidates, \"./ui\", \"../../dist/ui\"].map((c) =>\n url.fileURLToPath(new URL(c, moduleUrl)),\n );\n return paths.find((p) => fs.existsSync(p)) ?? paths[candidates.length];\n } catch {\n return undefined;\n }\n}\n\n/** A Node built-in, synchronously, when the runtime has it (Node ≥ 20.16, Bun, Deno). */\nfunction getBuiltin<T>(name: string): T | undefined {\n const proc = (globalThis as { process?: { getBuiltinModule?: (id: string) => unknown } }).process;\n return proc?.getBuiltinModule?.(name) as T | undefined;\n}\n","/**\n * The panel handler skeleton every product wraps in its `createFetchHandler`:\n * one web-standard `(request) => Promise<Response>` that serves the\n * healthcheck, the product's JSON API, the OpenAPI document, the bundled SPA's\n * static assets and the SPA fallback, under any base path, with optional\n * CORS, plus a uniform `close()` that stops background tasks.\n *\n * Request flow:\n *\n * 1. `OPTIONS` with `cors` set → preflight `204`.\n * 2. `GET|HEAD /healthcheck` → `{ ok: true }`.\n * 3. The product's `api(request, path)`; a non-`null` response wins.\n * 4. `GET|HEAD /api/openapi.json` (and `/openapi.json`) when `openapi` is set.\n * 5. Any other method → `405` (`Allow: GET, HEAD`).\n * 6. A static asset from `uiDir`; a miss on an asset-looking path → `404`.\n * 7. The SPA `index.html` with the bootstrap injected, `cache-control: no-cache`.\n *\n * @module\n */\n\nimport { durationToMs, type Duration } from \"../util/duration.ts\";\nimport { normalizeBasePath, stripBasePath } from \"./base-path.ts\";\nimport { applyCorsHeaders, preflightResponse, type CorsOptions } from \"./cors.ts\";\nimport { json } from \"./http.ts\";\nimport { renderIndexHtml } from \"./render-index-html.ts\";\nimport { looksLikeAsset, serveStaticAsset } from \"./static-assets.ts\";\n\n/** Background work owned by a panel (a dispatcher, a sweep timer…). */\nexport interface PanelTask {\n /** Called once when the panel is created. */\n start?(): void;\n /** Called once by `close()`. */\n stop(): void | Promise<void>;\n}\n\n/** Options for {@link createPanelHandler}. */\nexport interface PanelOptions {\n /** Mount prefix, e.g. `\"/webhooks\"`. Default `\"\"` (root). */\n basePath?: string;\n /** UI title, in the page and the bootstrap. */\n title: string;\n /** Logo image URL shown in the navbar in place of the title wordmark. */\n logoUrl?: string;\n /** Reported to the SPA in the bootstrap. Default `false`. */\n readonly?: boolean;\n /**\n * The built SPA directory (see `resolveUiDir`). `undefined` serves no static\n * files and the fallback page (e.g. on Workers).\n */\n uiDir?: string | undefined;\n /** Answer CORS preflights and decorate every response. */\n cors?: CorsOptions;\n /**\n * The product's API router. Receives the base-path-stripped path; returns a\n * response, or `null` when the path is not an API route.\n */\n api?: (request: Request, path: string) => Promise<Response | null> | Response | null;\n /** Extra bootstrap fields injected into `index.html` (beside `title`, `basePath`, `readonly`, `logoUrl`). */\n bootstrap?: () => Record<string, unknown>;\n /** The global the SPA reads its bootstrap from, e.g. `\"__WEBHOOKS_CONFIG__\"`. */\n globalName: string;\n /** The OpenAPI document, served at `/api/openapi.json` and `/openapi.json` (public). */\n openapi?: () => Record<string, unknown>;\n /** Background tasks: started now, stopped by `close()`. */\n tasks?: readonly PanelTask[];\n /** Healthcheck path, or `false` to leave it to the product. Default `\"/healthcheck\"`. */\n healthcheck?: string | false;\n}\n\n/** What {@link createPanelHandler} returns. */\nexport interface PanelHandler {\n /** Web-standard request handler. */\n fetch(request: Request): Promise<Response>;\n /** The normalized base path. */\n readonly basePath: string;\n /** Stop every task (idempotent). */\n close(): Promise<void>;\n}\n\nconst OPENAPI_PATHS = new Set([\"/api/openapi.json\", \"/openapi.json\"]);\n\n/**\n * Build the panel handler.\n *\n * @example\n * ```ts\n * import { createPanelHandler, resolveUiDir } from \"@xtandard/kit/server\";\n *\n * const panel = createPanelHandler({\n * basePath: options.basePath,\n * title: options.title ?? \"@xtandard/webhooks\",\n * globalName: \"__WEBHOOKS_CONFIG__\",\n * uiDir: options.uiDir ?? resolveUiDir(import.meta.url),\n * api: (request, path) => handleApiRequest(request, path, ctx),\n * openapi: () => buildOpenApiDocument({ basePath, title }),\n * tasks: [dispatcherTask],\n * });\n * Bun.serve({ fetch: panel.fetch });\n * ```\n */\nexport function createPanelHandler(options: PanelOptions): PanelHandler {\n const basePath = normalizeBasePath(options.basePath);\n const { cors, uiDir } = options;\n const healthcheck = options.healthcheck ?? \"/healthcheck\";\n const tasks = [...(options.tasks ?? [])];\n for (const task of tasks) task.start?.();\n let closing: Promise<void> | undefined;\n\n async function fetch(request: Request): Promise<Response> {\n // CORS preflight: answer OPTIONS directly so it works for any path,\n // independent of the host framework wrapping this handler.\n if (cors && request.method === \"OPTIONS\") return preflightResponse(request, cors);\n const response = await respond(request);\n return cors ? applyCorsHeaders(request, response, cors) : response;\n }\n\n async function respond(request: Request): Promise<Response> {\n const path = stripBasePath(new URL(request.url).pathname, basePath);\n const read = request.method === \"GET\" || request.method === \"HEAD\";\n\n if (read && healthcheck !== false && path === healthcheck) return json({ ok: true });\n\n const api = options.api ? await options.api(request, path) : null;\n if (api) return api;\n\n if (read && options.openapi && OPENAPI_PATHS.has(path)) return json(options.openapi());\n\n if (!read) {\n return new Response(\"Method Not Allowed\", { status: 405, headers: { allow: \"GET, HEAD\" } });\n }\n\n if (uiDir !== undefined) {\n const asset = await serveStaticAsset(uiDir, path);\n if (asset) return asset;\n }\n // A path that looks like a file but was not found → 404 (don't mask it with the SPA).\n if (path !== \"/\" && looksLikeAsset(path)) return new Response(\"Not Found\", { status: 404 });\n\n const html = await renderIndexHtml(uiDir, {\n globalName: options.globalName,\n config: {\n title: options.title,\n basePath,\n readonly: options.readonly ?? false,\n ...(options.logoUrl !== undefined ? { logoUrl: options.logoUrl } : {}),\n ...options.bootstrap?.(),\n },\n });\n return new Response(html, {\n status: 200,\n headers: { \"content-type\": \"text/html; charset=utf-8\", \"cache-control\": \"no-cache\" },\n });\n }\n\n return {\n fetch,\n basePath,\n close() {\n closing ??= Promise.all(tasks.map(async (task) => task.stop())).then(() => undefined);\n return closing;\n },\n };\n}\n\n/** Options for {@link intervalTask}. */\nexport interface IntervalTaskOptions {\n /** Reports a rejected run. Default: `console.warn` with `[source]`. */\n onError?: (error: unknown) => void;\n /** Log prefix for the default `onError`. Default `\"@xtandard/kit\"`. */\n source?: string;\n}\n\n/**\n * A {@link PanelTask} that runs `run` every `every` (a `Duration`). The timer\n * is `unref()`ed so it never keeps the process alive; a run that rejects is\n * reported, never thrown. `every <= 0` makes a task that does nothing.\n *\n * @example\n * ```ts\n * tasks: [intervalTask(\"1m\", () => engine.sweep(), { source: \"@xtandard/entitlements\" })]\n * ```\n */\nexport function intervalTask(\n every: Duration,\n run: () => unknown,\n options: IntervalTaskOptions = {},\n): PanelTask {\n const ms = durationToMs(every);\n const onError =\n options.onError ??\n ((error: unknown) =>\n console.warn(`[${options.source ?? \"@xtandard/kit\"}] task failed:`, error));\n let timer: ReturnType<typeof setInterval> | undefined;\n return {\n start() {\n if (ms <= 0 || timer) return;\n timer = setInterval(() => {\n Promise.resolve()\n .then(run)\n .catch((error: unknown) => onError(error));\n }, ms);\n (timer as { unref?: () => void }).unref?.();\n },\n stop() {\n if (timer) clearInterval(timer);\n timer = undefined;\n },\n };\n}\n"],"mappings":";;;;AAiCA,MAAM,kBAAkB;;;;;AAMxB,SAAS,cAAc,MAAmB,eAA6C;CACrF,MAAM,EAAE,WAAW;CACnB,IAAI,WAAW,KAEb,OAAO,KAAK,cAAe,iBAAiB,OAAQ;CAEtD,IAAI,kBAAkB,MAAM,OAAO;CAOnC,QALE,OAAO,WAAW,WACd,WAAW,gBACX,MAAM,QAAQ,MAAM,IAClB,OAAO,SAAS,aAAa,IAC7B,OAAO,aAAa,KACX,gBAAgB;AACnC;;;;;;AAOA,SAAS,QAAQ,UAA8B;CAC7C,IAAI;EACF,SAAS,QAAQ,IAAI,oBAAoB,GAAG;EAC5C,SAAS,QAAQ,OAAO,kBAAkB;EAC1C,OAAO;CACT,QAAQ;EACN,OAAO,IAAI,SAAS,SA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