@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,38 @@
|
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
+
let drizzle_orm_pg_core = require("drizzle-orm/pg-core");
|
|
3
|
+
//#region src/drizzle/pg.ts
|
|
4
|
+
/**
|
|
5
|
+
* A `text COLLATE "C"` column: bytewise ordering and case-sensitive, index-usable `LIKE` prefixes
|
|
6
|
+
* whatever the database's default collation.
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* ```ts
|
|
10
|
+
* pgTable("events", { key: textC("key").primaryKey(), … });
|
|
11
|
+
* ```
|
|
12
|
+
*/
|
|
13
|
+
const textC = (0, drizzle_orm_pg_core.customType)({ dataType: () => "text COLLATE \"C\"" });
|
|
14
|
+
/**
|
|
15
|
+
* Build a Drizzle `pgTable` for the KV storage: `key text COLLATE "C" PRIMARY KEY` (or plain
|
|
16
|
+
* `text` with `keyCollation: null`),
|
|
17
|
+
* `value jsonb NOT NULL`, extended by `schema`/`extraColumns`/`extraIndexes`. `name` is required
|
|
18
|
+
* (products pass their persisted table name; ADR 0005).
|
|
19
|
+
*
|
|
20
|
+
* @example
|
|
21
|
+
* ```ts
|
|
22
|
+
* import { pgKvTable } from "@xtandard/kit/drizzle/pg";
|
|
23
|
+
* export const kv = pgKvTable("xtandard_kv");
|
|
24
|
+
* ```
|
|
25
|
+
*/
|
|
26
|
+
function pgKvTable(name, opts) {
|
|
27
|
+
const columns = {
|
|
28
|
+
key: (opts?.keyCollation === null ? (0, drizzle_orm_pg_core.text)("key") : textC("key")).primaryKey(),
|
|
29
|
+
value: (0, drizzle_orm_pg_core.jsonb)("value").notNull(),
|
|
30
|
+
...opts?.extraColumns?.()
|
|
31
|
+
};
|
|
32
|
+
return opts?.schema ? (0, drizzle_orm_pg_core.pgSchema)(opts.schema).table(name, columns, opts.extraIndexes) : (0, drizzle_orm_pg_core.pgTable)(name, columns, opts?.extraIndexes);
|
|
33
|
+
}
|
|
34
|
+
//#endregion
|
|
35
|
+
exports.pgKvTable = pgKvTable;
|
|
36
|
+
exports.textC = textC;
|
|
37
|
+
|
|
38
|
+
//# sourceMappingURL=entry-drizzle-pg.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"entry-drizzle-pg.cjs","names":[],"sources":["../src/drizzle/pg.ts"],"sourcesContent":["/**\n * Postgres Drizzle table factories: {@link pgKvTable} puts a KV table in your Drizzle schema and\n * migrations, and {@link textC} is the bytewise `text COLLATE \"C\"` column products reuse for their\n * own key columns. Schema-only (imports `drizzle-orm/pg-core`), so importing this subpath requires\n * `drizzle-orm`.\n *\n * @module\n */\n\nimport type { BuildExtraConfigColumns } from \"drizzle-orm\";\nimport {\n customType,\n jsonb,\n pgSchema,\n pgTable,\n text,\n type PgColumnBuilderBase,\n type PgTableExtraConfigValue,\n} from \"drizzle-orm/pg-core\";\nimport type { DrizzleKvTable } from \"./table.ts\";\n\nexport type { DrizzleKvTable } from \"./table.ts\";\n\n/**\n * A `text COLLATE \"C\"` column: bytewise ordering and case-sensitive, index-usable `LIKE` prefixes\n * whatever the database's default collation.\n *\n * @example\n * ```ts\n * pgTable(\"events\", { key: textC(\"key\").primaryKey(), … });\n * ```\n */\nexport const textC = customType<{ data: string; driverData: string }>({\n dataType: () => 'text COLLATE \"C\"',\n});\n\n/** The `self` passed to a {@link PgKvTableOptions.extraIndexes} callback. */\nexport type PgKvColumns = BuildExtraConfigColumns<\n string,\n Record<string, PgColumnBuilderBase>,\n \"pg\"\n>;\n\n/** Options for {@link pgKvTable}. */\nexport interface PgKvTableOptions {\n /** Postgres schema (namespace) for the table. Defaults to the search path (`public`). */\n schema?: string;\n /**\n * Collation of the `key` column. `\"C\"` (default) is bytewise and case-sensitive, with\n * index-usable `LIKE` prefixes. `null` keeps a plain `text` column: products whose existing\n * table was declared that way pass it, so drizzle-kit doesn't generate an `ALTER` for every\n * existing deployment (ADR 0005). The driver stays correct either way, because prefix queries are\n * post-filtered with an exact `startsWith`.\n *\n * Migration SQL to switch an existing table:\n * `ALTER TABLE <name> ALTER COLUMN key TYPE text COLLATE \"C\";`\n */\n keyCollation?: \"C\" | null;\n /** Additional columns merged into the table (e.g. a tenant discriminator). */\n extraColumns?: () => Record<string, PgColumnBuilderBase>;\n /** Additional indexes/constraints; receives the built columns. */\n extraIndexes?: (table: PgKvColumns) => PgTableExtraConfigValue[];\n}\n\n/**\n * Build a Drizzle `pgTable` for the KV storage: `key text COLLATE \"C\" PRIMARY KEY` (or plain\n * `text` with `keyCollation: null`),\n * `value jsonb NOT NULL`, extended by `schema`/`extraColumns`/`extraIndexes`. `name` is required\n * (products pass their persisted table name; ADR 0005).\n *\n * @example\n * ```ts\n * import { pgKvTable } from \"@xtandard/kit/drizzle/pg\";\n * export const kv = pgKvTable(\"xtandard_kv\");\n * ```\n */\nexport function pgKvTable(name: string, opts?: PgKvTableOptions): DrizzleKvTable {\n const columns = {\n key: (opts?.keyCollation === null ? text(\"key\") : textC(\"key\")).primaryKey(),\n value: jsonb(\"value\").notNull(),\n ...opts?.extraColumns?.(),\n };\n const table = opts?.schema\n ? pgSchema(opts.schema).table(name, columns, opts.extraIndexes)\n : pgTable(name, columns, opts?.extraIndexes);\n return table as unknown as DrizzleKvTable;\n}\n"],"mappings":";;;;;;;;;;;;AAgCA,MAAa,SAAA,GAAA,oBAAA,YAAyD,EACpE,gBAAgB,qBAClB,CAAC;;;;;;;;;;;;;AA0CD,SAAgB,UAAU,MAAc,MAAyC;CAC/E,MAAM,UAAU;EACd,MAAM,MAAM,iBAAiB,QAAA,GAAA,oBAAA,MAAY,KAAK,IAAI,MAAM,KAAK,GAAG,WAAW;EAC3E,QAAA,GAAA,oBAAA,OAAa,OAAO,EAAE,QAAQ;EAC9B,GAAG,MAAM,eAAe;CAC1B;CAIA,OAHc,MAAM,UAAA,GAAA,oBAAA,UACP,KAAK,MAAM,EAAE,MAAM,MAAM,SAAS,KAAK,YAAY,KAAA,GAAA,oBAAA,SACpD,MAAM,SAAS,MAAM,YAAY;AAE/C"}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { t as DrizzleKvTable } from "./table-BrioFSra.cjs";
|
|
2
|
+
import { BuildExtraConfigColumns } from "drizzle-orm";
|
|
3
|
+
import { PgColumnBuilderBase, PgTableExtraConfigValue } from "drizzle-orm/pg-core";
|
|
4
|
+
|
|
5
|
+
//#region src/drizzle/pg.d.ts
|
|
6
|
+
/**
|
|
7
|
+
* A `text COLLATE "C"` column: bytewise ordering and case-sensitive, index-usable `LIKE` prefixes
|
|
8
|
+
* whatever the database's default collation.
|
|
9
|
+
*
|
|
10
|
+
* @example
|
|
11
|
+
* ```ts
|
|
12
|
+
* pgTable("events", { key: textC("key").primaryKey(), … });
|
|
13
|
+
* ```
|
|
14
|
+
*/
|
|
15
|
+
declare const textC: {
|
|
16
|
+
(): import("drizzle-orm/pg-core").PgCustomColumnBuilder<{
|
|
17
|
+
name: "";
|
|
18
|
+
dataType: "custom";
|
|
19
|
+
columnType: "PgCustomColumn";
|
|
20
|
+
data: string;
|
|
21
|
+
driverParam: string;
|
|
22
|
+
enumValues: undefined;
|
|
23
|
+
}>;
|
|
24
|
+
<TConfig extends Record<string, any>>(fieldConfig?: TConfig | undefined): import("drizzle-orm/pg-core").PgCustomColumnBuilder<{
|
|
25
|
+
name: "";
|
|
26
|
+
dataType: "custom";
|
|
27
|
+
columnType: "PgCustomColumn";
|
|
28
|
+
data: string;
|
|
29
|
+
driverParam: string;
|
|
30
|
+
enumValues: undefined;
|
|
31
|
+
}>;
|
|
32
|
+
<TName extends string>(dbName: TName, fieldConfig?: unknown): import("drizzle-orm/pg-core").PgCustomColumnBuilder<{
|
|
33
|
+
name: TName;
|
|
34
|
+
dataType: "custom";
|
|
35
|
+
columnType: "PgCustomColumn";
|
|
36
|
+
data: string;
|
|
37
|
+
driverParam: string;
|
|
38
|
+
enumValues: undefined;
|
|
39
|
+
}>;
|
|
40
|
+
};
|
|
41
|
+
/** The `self` passed to a {@link PgKvTableOptions.extraIndexes} callback. */
|
|
42
|
+
type PgKvColumns = BuildExtraConfigColumns<string, Record<string, PgColumnBuilderBase>, "pg">;
|
|
43
|
+
/** Options for {@link pgKvTable}. */
|
|
44
|
+
interface PgKvTableOptions {
|
|
45
|
+
/** Postgres schema (namespace) for the table. Defaults to the search path (`public`). */
|
|
46
|
+
schema?: string;
|
|
47
|
+
/**
|
|
48
|
+
* Collation of the `key` column. `"C"` (default) is bytewise and case-sensitive, with
|
|
49
|
+
* index-usable `LIKE` prefixes. `null` keeps a plain `text` column: products whose existing
|
|
50
|
+
* table was declared that way pass it, so drizzle-kit doesn't generate an `ALTER` for every
|
|
51
|
+
* existing deployment (ADR 0005). The driver stays correct either way, because prefix queries are
|
|
52
|
+
* post-filtered with an exact `startsWith`.
|
|
53
|
+
*
|
|
54
|
+
* Migration SQL to switch an existing table:
|
|
55
|
+
* `ALTER TABLE <name> ALTER COLUMN key TYPE text COLLATE "C";`
|
|
56
|
+
*/
|
|
57
|
+
keyCollation?: "C" | null;
|
|
58
|
+
/** Additional columns merged into the table (e.g. a tenant discriminator). */
|
|
59
|
+
extraColumns?: () => Record<string, PgColumnBuilderBase>;
|
|
60
|
+
/** Additional indexes/constraints; receives the built columns. */
|
|
61
|
+
extraIndexes?: (table: PgKvColumns) => PgTableExtraConfigValue[];
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* Build a Drizzle `pgTable` for the KV storage: `key text COLLATE "C" PRIMARY KEY` (or plain
|
|
65
|
+
* `text` with `keyCollation: null`),
|
|
66
|
+
* `value jsonb NOT NULL`, extended by `schema`/`extraColumns`/`extraIndexes`. `name` is required
|
|
67
|
+
* (products pass their persisted table name; ADR 0005).
|
|
68
|
+
*
|
|
69
|
+
* @example
|
|
70
|
+
* ```ts
|
|
71
|
+
* import { pgKvTable } from "@xtandard/kit/drizzle/pg";
|
|
72
|
+
* export const kv = pgKvTable("xtandard_kv");
|
|
73
|
+
* ```
|
|
74
|
+
*/
|
|
75
|
+
declare function pgKvTable(name: string, opts?: PgKvTableOptions): DrizzleKvTable;
|
|
76
|
+
//#endregion
|
|
77
|
+
export { type DrizzleKvTable, type PgKvColumns, type PgKvTableOptions, pgKvTable, textC };
|
|
78
|
+
//# sourceMappingURL=entry-drizzle-pg.d.cts.map
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { t as DrizzleKvTable } from "./table-BrioFSra.mjs";
|
|
2
|
+
import { PgColumnBuilderBase, PgTableExtraConfigValue } from "drizzle-orm/pg-core";
|
|
3
|
+
import { BuildExtraConfigColumns } from "drizzle-orm";
|
|
4
|
+
|
|
5
|
+
//#region src/drizzle/pg.d.ts
|
|
6
|
+
/**
|
|
7
|
+
* A `text COLLATE "C"` column: bytewise ordering and case-sensitive, index-usable `LIKE` prefixes
|
|
8
|
+
* whatever the database's default collation.
|
|
9
|
+
*
|
|
10
|
+
* @example
|
|
11
|
+
* ```ts
|
|
12
|
+
* pgTable("events", { key: textC("key").primaryKey(), … });
|
|
13
|
+
* ```
|
|
14
|
+
*/
|
|
15
|
+
declare const textC: {
|
|
16
|
+
(): import("drizzle-orm/pg-core").PgCustomColumnBuilder<{
|
|
17
|
+
name: "";
|
|
18
|
+
dataType: "custom";
|
|
19
|
+
columnType: "PgCustomColumn";
|
|
20
|
+
data: string;
|
|
21
|
+
driverParam: string;
|
|
22
|
+
enumValues: undefined;
|
|
23
|
+
}>;
|
|
24
|
+
<TConfig extends Record<string, any>>(fieldConfig?: TConfig | undefined): import("drizzle-orm/pg-core").PgCustomColumnBuilder<{
|
|
25
|
+
name: "";
|
|
26
|
+
dataType: "custom";
|
|
27
|
+
columnType: "PgCustomColumn";
|
|
28
|
+
data: string;
|
|
29
|
+
driverParam: string;
|
|
30
|
+
enumValues: undefined;
|
|
31
|
+
}>;
|
|
32
|
+
<TName extends string>(dbName: TName, fieldConfig?: unknown): import("drizzle-orm/pg-core").PgCustomColumnBuilder<{
|
|
33
|
+
name: TName;
|
|
34
|
+
dataType: "custom";
|
|
35
|
+
columnType: "PgCustomColumn";
|
|
36
|
+
data: string;
|
|
37
|
+
driverParam: string;
|
|
38
|
+
enumValues: undefined;
|
|
39
|
+
}>;
|
|
40
|
+
};
|
|
41
|
+
/** The `self` passed to a {@link PgKvTableOptions.extraIndexes} callback. */
|
|
42
|
+
type PgKvColumns = BuildExtraConfigColumns<string, Record<string, PgColumnBuilderBase>, "pg">;
|
|
43
|
+
/** Options for {@link pgKvTable}. */
|
|
44
|
+
interface PgKvTableOptions {
|
|
45
|
+
/** Postgres schema (namespace) for the table. Defaults to the search path (`public`). */
|
|
46
|
+
schema?: string;
|
|
47
|
+
/**
|
|
48
|
+
* Collation of the `key` column. `"C"` (default) is bytewise and case-sensitive, with
|
|
49
|
+
* index-usable `LIKE` prefixes. `null` keeps a plain `text` column: products whose existing
|
|
50
|
+
* table was declared that way pass it, so drizzle-kit doesn't generate an `ALTER` for every
|
|
51
|
+
* existing deployment (ADR 0005). The driver stays correct either way, because prefix queries are
|
|
52
|
+
* post-filtered with an exact `startsWith`.
|
|
53
|
+
*
|
|
54
|
+
* Migration SQL to switch an existing table:
|
|
55
|
+
* `ALTER TABLE <name> ALTER COLUMN key TYPE text COLLATE "C";`
|
|
56
|
+
*/
|
|
57
|
+
keyCollation?: "C" | null;
|
|
58
|
+
/** Additional columns merged into the table (e.g. a tenant discriminator). */
|
|
59
|
+
extraColumns?: () => Record<string, PgColumnBuilderBase>;
|
|
60
|
+
/** Additional indexes/constraints; receives the built columns. */
|
|
61
|
+
extraIndexes?: (table: PgKvColumns) => PgTableExtraConfigValue[];
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* Build a Drizzle `pgTable` for the KV storage: `key text COLLATE "C" PRIMARY KEY` (or plain
|
|
65
|
+
* `text` with `keyCollation: null`),
|
|
66
|
+
* `value jsonb NOT NULL`, extended by `schema`/`extraColumns`/`extraIndexes`. `name` is required
|
|
67
|
+
* (products pass their persisted table name; ADR 0005).
|
|
68
|
+
*
|
|
69
|
+
* @example
|
|
70
|
+
* ```ts
|
|
71
|
+
* import { pgKvTable } from "@xtandard/kit/drizzle/pg";
|
|
72
|
+
* export const kv = pgKvTable("xtandard_kv");
|
|
73
|
+
* ```
|
|
74
|
+
*/
|
|
75
|
+
declare function pgKvTable(name: string, opts?: PgKvTableOptions): DrizzleKvTable;
|
|
76
|
+
//#endregion
|
|
77
|
+
export { type DrizzleKvTable, type PgKvColumns, type PgKvTableOptions, pgKvTable, textC };
|
|
78
|
+
//# sourceMappingURL=entry-drizzle-pg.d.mts.map
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { customType, jsonb, pgSchema, pgTable, text } from "drizzle-orm/pg-core";
|
|
2
|
+
//#region src/drizzle/pg.ts
|
|
3
|
+
/**
|
|
4
|
+
* A `text COLLATE "C"` column: bytewise ordering and case-sensitive, index-usable `LIKE` prefixes
|
|
5
|
+
* whatever the database's default collation.
|
|
6
|
+
*
|
|
7
|
+
* @example
|
|
8
|
+
* ```ts
|
|
9
|
+
* pgTable("events", { key: textC("key").primaryKey(), … });
|
|
10
|
+
* ```
|
|
11
|
+
*/
|
|
12
|
+
const textC = customType({ dataType: () => "text COLLATE \"C\"" });
|
|
13
|
+
/**
|
|
14
|
+
* Build a Drizzle `pgTable` for the KV storage: `key text COLLATE "C" PRIMARY KEY` (or plain
|
|
15
|
+
* `text` with `keyCollation: null`),
|
|
16
|
+
* `value jsonb NOT NULL`, extended by `schema`/`extraColumns`/`extraIndexes`. `name` is required
|
|
17
|
+
* (products pass their persisted table name; ADR 0005).
|
|
18
|
+
*
|
|
19
|
+
* @example
|
|
20
|
+
* ```ts
|
|
21
|
+
* import { pgKvTable } from "@xtandard/kit/drizzle/pg";
|
|
22
|
+
* export const kv = pgKvTable("xtandard_kv");
|
|
23
|
+
* ```
|
|
24
|
+
*/
|
|
25
|
+
function pgKvTable(name, opts) {
|
|
26
|
+
const columns = {
|
|
27
|
+
key: (opts?.keyCollation === null ? text("key") : textC("key")).primaryKey(),
|
|
28
|
+
value: jsonb("value").notNull(),
|
|
29
|
+
...opts?.extraColumns?.()
|
|
30
|
+
};
|
|
31
|
+
return opts?.schema ? pgSchema(opts.schema).table(name, columns, opts.extraIndexes) : pgTable(name, columns, opts?.extraIndexes);
|
|
32
|
+
}
|
|
33
|
+
//#endregion
|
|
34
|
+
export { pgKvTable, textC };
|
|
35
|
+
|
|
36
|
+
//# sourceMappingURL=entry-drizzle-pg.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"entry-drizzle-pg.mjs","names":[],"sources":["../src/drizzle/pg.ts"],"sourcesContent":["/**\n * Postgres Drizzle table factories: {@link pgKvTable} puts a KV table in your Drizzle schema and\n * migrations, and {@link textC} is the bytewise `text COLLATE \"C\"` column products reuse for their\n * own key columns. Schema-only (imports `drizzle-orm/pg-core`), so importing this subpath requires\n * `drizzle-orm`.\n *\n * @module\n */\n\nimport type { BuildExtraConfigColumns } from \"drizzle-orm\";\nimport {\n customType,\n jsonb,\n pgSchema,\n pgTable,\n text,\n type PgColumnBuilderBase,\n type PgTableExtraConfigValue,\n} from \"drizzle-orm/pg-core\";\nimport type { DrizzleKvTable } from \"./table.ts\";\n\nexport type { DrizzleKvTable } from \"./table.ts\";\n\n/**\n * A `text COLLATE \"C\"` column: bytewise ordering and case-sensitive, index-usable `LIKE` prefixes\n * whatever the database's default collation.\n *\n * @example\n * ```ts\n * pgTable(\"events\", { key: textC(\"key\").primaryKey(), … });\n * ```\n */\nexport const textC = customType<{ data: string; driverData: string }>({\n dataType: () => 'text COLLATE \"C\"',\n});\n\n/** The `self` passed to a {@link PgKvTableOptions.extraIndexes} callback. */\nexport type PgKvColumns = BuildExtraConfigColumns<\n string,\n Record<string, PgColumnBuilderBase>,\n \"pg\"\n>;\n\n/** Options for {@link pgKvTable}. */\nexport interface PgKvTableOptions {\n /** Postgres schema (namespace) for the table. Defaults to the search path (`public`). */\n schema?: string;\n /**\n * Collation of the `key` column. `\"C\"` (default) is bytewise and case-sensitive, with\n * index-usable `LIKE` prefixes. `null` keeps a plain `text` column: products whose existing\n * table was declared that way pass it, so drizzle-kit doesn't generate an `ALTER` for every\n * existing deployment (ADR 0005). The driver stays correct either way, because prefix queries are\n * post-filtered with an exact `startsWith`.\n *\n * Migration SQL to switch an existing table:\n * `ALTER TABLE <name> ALTER COLUMN key TYPE text COLLATE \"C\";`\n */\n keyCollation?: \"C\" | null;\n /** Additional columns merged into the table (e.g. a tenant discriminator). */\n extraColumns?: () => Record<string, PgColumnBuilderBase>;\n /** Additional indexes/constraints; receives the built columns. */\n extraIndexes?: (table: PgKvColumns) => PgTableExtraConfigValue[];\n}\n\n/**\n * Build a Drizzle `pgTable` for the KV storage: `key text COLLATE \"C\" PRIMARY KEY` (or plain\n * `text` with `keyCollation: null`),\n * `value jsonb NOT NULL`, extended by `schema`/`extraColumns`/`extraIndexes`. `name` is required\n * (products pass their persisted table name; ADR 0005).\n *\n * @example\n * ```ts\n * import { pgKvTable } from \"@xtandard/kit/drizzle/pg\";\n * export const kv = pgKvTable(\"xtandard_kv\");\n * ```\n */\nexport function pgKvTable(name: string, opts?: PgKvTableOptions): DrizzleKvTable {\n const columns = {\n key: (opts?.keyCollation === null ? text(\"key\") : textC(\"key\")).primaryKey(),\n value: jsonb(\"value\").notNull(),\n ...opts?.extraColumns?.(),\n };\n const table = opts?.schema\n ? pgSchema(opts.schema).table(name, columns, opts.extraIndexes)\n : pgTable(name, columns, opts?.extraIndexes);\n return table as unknown as DrizzleKvTable;\n}\n"],"mappings":";;;;;;;;;;;AAgCA,MAAa,QAAQ,WAAiD,EACpE,gBAAgB,qBAClB,CAAC;;;;;;;;;;;;;AA0CD,SAAgB,UAAU,MAAc,MAAyC;CAC/E,MAAM,UAAU;EACd,MAAM,MAAM,iBAAiB,OAAO,KAAK,KAAK,IAAI,MAAM,KAAK,GAAG,WAAW;EAC3E,OAAO,MAAM,OAAO,EAAE,QAAQ;EAC9B,GAAG,MAAM,eAAe;CAC1B;CAIA,OAHc,MAAM,SAChB,SAAS,KAAK,MAAM,EAAE,MAAM,MAAM,SAAS,KAAK,YAAY,IAC5D,QAAQ,MAAM,SAAS,MAAM,YAAY;AAE/C"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
+
let drizzle_orm_sqlite_core = require("drizzle-orm/sqlite-core");
|
|
3
|
+
//#region src/drizzle/sqlite.ts
|
|
4
|
+
/**
|
|
5
|
+
* Build a Drizzle `sqliteTable` for the KV storage: `key text PRIMARY KEY`, `value text NOT NULL`
|
|
6
|
+
* (JSON mode). `name` is required (ADR 0005).
|
|
7
|
+
*/
|
|
8
|
+
function sqliteKvTable(name, opts) {
|
|
9
|
+
const columns = {
|
|
10
|
+
key: (0, drizzle_orm_sqlite_core.text)("key").primaryKey(),
|
|
11
|
+
value: (0, drizzle_orm_sqlite_core.text)("value", { mode: "json" }).notNull(),
|
|
12
|
+
...opts?.extraColumns?.()
|
|
13
|
+
};
|
|
14
|
+
const extraConfig = opts?.extraIndexes;
|
|
15
|
+
return (0, drizzle_orm_sqlite_core.sqliteTable)(name, columns, extraConfig);
|
|
16
|
+
}
|
|
17
|
+
//#endregion
|
|
18
|
+
exports.sqliteKvTable = sqliteKvTable;
|
|
19
|
+
|
|
20
|
+
//# sourceMappingURL=entry-drizzle-sqlite.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"entry-drizzle-sqlite.cjs","names":[],"sources":["../src/drizzle/sqlite.ts"],"sourcesContent":["/**\n * SQLite Drizzle table factory {@link sqliteKvTable}. Keys are `text PRIMARY KEY` with SQLite's\n * default `BINARY` collation (case-sensitive); the storage driver matches prefixes with `GLOB`,\n * never the case-folding `LIKE`. Schema-only (imports `drizzle-orm/sqlite-core`), so importing this\n * subpath requires `drizzle-orm`.\n *\n * @module\n */\n\nimport type { BuildColumns } from \"drizzle-orm\";\nimport {\n sqliteTable,\n text,\n type SQLiteColumnBuilderBase,\n type SQLiteTableExtraConfigValue,\n} from \"drizzle-orm/sqlite-core\";\nimport type { DrizzleKvTable } from \"./table.ts\";\n\nexport type { DrizzleKvTable } from \"./table.ts\";\n\n/** The `self` passed to a {@link SqliteKvTableOptions.extraIndexes} callback. */\nexport type SqliteKvColumns = BuildColumns<\n string,\n Record<string, SQLiteColumnBuilderBase>,\n \"sqlite\"\n>;\n\n/** Options for {@link sqliteKvTable}. */\nexport interface SqliteKvTableOptions {\n /** Additional columns merged into the table. */\n extraColumns?: () => Record<string, SQLiteColumnBuilderBase>;\n /** Additional indexes/constraints; receives the built columns. */\n extraIndexes?: (table: SqliteKvColumns) => SQLiteTableExtraConfigValue[];\n}\n\n/**\n * Build a Drizzle `sqliteTable` for the KV storage: `key text PRIMARY KEY`, `value text NOT NULL`\n * (JSON mode). `name` is required (ADR 0005).\n */\nexport function sqliteKvTable(name: string, opts?: SqliteKvTableOptions): DrizzleKvTable {\n const columns = {\n key: text(\"key\").primaryKey(),\n value: text(\"value\", { mode: \"json\" }).notNull(),\n ...opts?.extraColumns?.(),\n };\n const extraConfig = opts?.extraIndexes as\n | ((self: BuildColumns<string, typeof columns, \"sqlite\">) => SQLiteTableExtraConfigValue[])\n | undefined;\n return sqliteTable(name, columns, extraConfig) as unknown as DrizzleKvTable;\n}\n"],"mappings":";;;;;;;AAuCA,SAAgB,cAAc,MAAc,MAA6C;CACvF,MAAM,UAAU;EACd,MAAA,GAAA,wBAAA,MAAU,KAAK,EAAE,WAAW;EAC5B,QAAA,GAAA,wBAAA,MAAY,SAAS,EAAE,MAAM,OAAO,CAAC,EAAE,QAAQ;EAC/C,GAAG,MAAM,eAAe;CAC1B;CACA,MAAM,cAAc,MAAM;CAG1B,QAAA,GAAA,wBAAA,aAAmB,MAAM,SAAS,WAAW;AAC/C"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { t as DrizzleKvTable } from "./table-BrioFSra.cjs";
|
|
2
|
+
import { BuildColumns } from "drizzle-orm";
|
|
3
|
+
import { SQLiteColumnBuilderBase, SQLiteTableExtraConfigValue } from "drizzle-orm/sqlite-core";
|
|
4
|
+
|
|
5
|
+
//#region src/drizzle/sqlite.d.ts
|
|
6
|
+
/** The `self` passed to a {@link SqliteKvTableOptions.extraIndexes} callback. */
|
|
7
|
+
type SqliteKvColumns = BuildColumns<string, Record<string, SQLiteColumnBuilderBase>, "sqlite">;
|
|
8
|
+
/** Options for {@link sqliteKvTable}. */
|
|
9
|
+
interface SqliteKvTableOptions {
|
|
10
|
+
/** Additional columns merged into the table. */
|
|
11
|
+
extraColumns?: () => Record<string, SQLiteColumnBuilderBase>;
|
|
12
|
+
/** Additional indexes/constraints; receives the built columns. */
|
|
13
|
+
extraIndexes?: (table: SqliteKvColumns) => SQLiteTableExtraConfigValue[];
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Build a Drizzle `sqliteTable` for the KV storage: `key text PRIMARY KEY`, `value text NOT NULL`
|
|
17
|
+
* (JSON mode). `name` is required (ADR 0005).
|
|
18
|
+
*/
|
|
19
|
+
declare function sqliteKvTable(name: string, opts?: SqliteKvTableOptions): DrizzleKvTable;
|
|
20
|
+
//#endregion
|
|
21
|
+
export { type DrizzleKvTable, type SqliteKvColumns, type SqliteKvTableOptions, sqliteKvTable };
|
|
22
|
+
//# sourceMappingURL=entry-drizzle-sqlite.d.cts.map
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { t as DrizzleKvTable } from "./table-BrioFSra.mjs";
|
|
2
|
+
import { SQLiteColumnBuilderBase, SQLiteTableExtraConfigValue } from "drizzle-orm/sqlite-core";
|
|
3
|
+
import { BuildColumns } from "drizzle-orm";
|
|
4
|
+
|
|
5
|
+
//#region src/drizzle/sqlite.d.ts
|
|
6
|
+
/** The `self` passed to a {@link SqliteKvTableOptions.extraIndexes} callback. */
|
|
7
|
+
type SqliteKvColumns = BuildColumns<string, Record<string, SQLiteColumnBuilderBase>, "sqlite">;
|
|
8
|
+
/** Options for {@link sqliteKvTable}. */
|
|
9
|
+
interface SqliteKvTableOptions {
|
|
10
|
+
/** Additional columns merged into the table. */
|
|
11
|
+
extraColumns?: () => Record<string, SQLiteColumnBuilderBase>;
|
|
12
|
+
/** Additional indexes/constraints; receives the built columns. */
|
|
13
|
+
extraIndexes?: (table: SqliteKvColumns) => SQLiteTableExtraConfigValue[];
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Build a Drizzle `sqliteTable` for the KV storage: `key text PRIMARY KEY`, `value text NOT NULL`
|
|
17
|
+
* (JSON mode). `name` is required (ADR 0005).
|
|
18
|
+
*/
|
|
19
|
+
declare function sqliteKvTable(name: string, opts?: SqliteKvTableOptions): DrizzleKvTable;
|
|
20
|
+
//#endregion
|
|
21
|
+
export { type DrizzleKvTable, type SqliteKvColumns, type SqliteKvTableOptions, sqliteKvTable };
|
|
22
|
+
//# sourceMappingURL=entry-drizzle-sqlite.d.mts.map
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { sqliteTable, text } from "drizzle-orm/sqlite-core";
|
|
2
|
+
//#region src/drizzle/sqlite.ts
|
|
3
|
+
/**
|
|
4
|
+
* Build a Drizzle `sqliteTable` for the KV storage: `key text PRIMARY KEY`, `value text NOT NULL`
|
|
5
|
+
* (JSON mode). `name` is required (ADR 0005).
|
|
6
|
+
*/
|
|
7
|
+
function sqliteKvTable(name, opts) {
|
|
8
|
+
const columns = {
|
|
9
|
+
key: text("key").primaryKey(),
|
|
10
|
+
value: text("value", { mode: "json" }).notNull(),
|
|
11
|
+
...opts?.extraColumns?.()
|
|
12
|
+
};
|
|
13
|
+
const extraConfig = opts?.extraIndexes;
|
|
14
|
+
return sqliteTable(name, columns, extraConfig);
|
|
15
|
+
}
|
|
16
|
+
//#endregion
|
|
17
|
+
export { sqliteKvTable };
|
|
18
|
+
|
|
19
|
+
//# sourceMappingURL=entry-drizzle-sqlite.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"entry-drizzle-sqlite.mjs","names":[],"sources":["../src/drizzle/sqlite.ts"],"sourcesContent":["/**\n * SQLite Drizzle table factory {@link sqliteKvTable}. Keys are `text PRIMARY KEY` with SQLite's\n * default `BINARY` collation (case-sensitive); the storage driver matches prefixes with `GLOB`,\n * never the case-folding `LIKE`. Schema-only (imports `drizzle-orm/sqlite-core`), so importing this\n * subpath requires `drizzle-orm`.\n *\n * @module\n */\n\nimport type { BuildColumns } from \"drizzle-orm\";\nimport {\n sqliteTable,\n text,\n type SQLiteColumnBuilderBase,\n type SQLiteTableExtraConfigValue,\n} from \"drizzle-orm/sqlite-core\";\nimport type { DrizzleKvTable } from \"./table.ts\";\n\nexport type { DrizzleKvTable } from \"./table.ts\";\n\n/** The `self` passed to a {@link SqliteKvTableOptions.extraIndexes} callback. */\nexport type SqliteKvColumns = BuildColumns<\n string,\n Record<string, SQLiteColumnBuilderBase>,\n \"sqlite\"\n>;\n\n/** Options for {@link sqliteKvTable}. */\nexport interface SqliteKvTableOptions {\n /** Additional columns merged into the table. */\n extraColumns?: () => Record<string, SQLiteColumnBuilderBase>;\n /** Additional indexes/constraints; receives the built columns. */\n extraIndexes?: (table: SqliteKvColumns) => SQLiteTableExtraConfigValue[];\n}\n\n/**\n * Build a Drizzle `sqliteTable` for the KV storage: `key text PRIMARY KEY`, `value text NOT NULL`\n * (JSON mode). `name` is required (ADR 0005).\n */\nexport function sqliteKvTable(name: string, opts?: SqliteKvTableOptions): DrizzleKvTable {\n const columns = {\n key: text(\"key\").primaryKey(),\n value: text(\"value\", { mode: \"json\" }).notNull(),\n ...opts?.extraColumns?.(),\n };\n const extraConfig = opts?.extraIndexes as\n | ((self: BuildColumns<string, typeof columns, \"sqlite\">) => SQLiteTableExtraConfigValue[])\n | undefined;\n return sqliteTable(name, columns, extraConfig) as unknown as DrizzleKvTable;\n}\n"],"mappings":";;;;;;AAuCA,SAAgB,cAAc,MAAc,MAA6C;CACvF,MAAM,UAAU;EACd,KAAK,KAAK,KAAK,EAAE,WAAW;EAC5B,OAAO,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC,EAAE,QAAQ;EAC/C,GAAG,MAAM,eAAe;CAC1B;CACA,MAAM,cAAc,MAAM;CAG1B,OAAO,YAAY,MAAM,SAAS,WAAW;AAC/C"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
+
//#region src/hooks/log.ts
|
|
3
|
+
/**
|
|
4
|
+
* Build a hook that logs each mutation event. Never throws from `before`, so it
|
|
5
|
+
* never denies a mutation — it is a pure observer.
|
|
6
|
+
*/
|
|
7
|
+
function createLogHook(options = {}) {
|
|
8
|
+
const log = options.log ?? ((line) => console.log(line));
|
|
9
|
+
const source = options.source ?? "@xtandard/kit";
|
|
10
|
+
const describe = options.describe;
|
|
11
|
+
const textFormat = (phase, event) => {
|
|
12
|
+
const extra = describe?.(event);
|
|
13
|
+
return `[${source}] ${phase} ${event.type}${extra ? ` ${extra}` : ""} ${JSON.stringify(event)}`;
|
|
14
|
+
};
|
|
15
|
+
const jsonFormat = (phase, event) => JSON.stringify({
|
|
16
|
+
source,
|
|
17
|
+
phase,
|
|
18
|
+
...event
|
|
19
|
+
});
|
|
20
|
+
const format = options.format ?? (options.json ? jsonFormat : textFormat);
|
|
21
|
+
const hook = { after(event) {
|
|
22
|
+
log(format("after", event));
|
|
23
|
+
} };
|
|
24
|
+
if (options.includeBefore) hook.before = (event) => {
|
|
25
|
+
log(format("before", event));
|
|
26
|
+
};
|
|
27
|
+
return hook;
|
|
28
|
+
}
|
|
29
|
+
//#endregion
|
|
30
|
+
exports.createLogHook = createLogHook;
|
|
31
|
+
|
|
32
|
+
//# sourceMappingURL=entry-hooks-log.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"entry-hooks-log.cjs","names":[],"sources":["../src/hooks/log.ts"],"sourcesContent":["/**\n * A reference hook that logs mutation events.\n *\n * The simplest possible consumer of the hooks seam: useful as a starting point\n * for your own `after` side effects, and handy for local debugging or piping\n * admin activity to a log aggregator (`json: true` prints one JSON object per\n * line). Zero dependencies.\n *\n * @example\n * ```ts\n * import { createLogHook } from \"@xtandard/kit/hooks/log\";\n *\n * const hook = createLogHook({ source: \"@xtandard/flags\", describe: (e) => e.projectKey });\n * ```\n *\n * @module\n */\n\nimport type { HookEvent, Hooks } from \"./contract.ts\";\n\n/** Options for {@link createLogHook}. */\nexport interface LogHookOptions<\n Before extends HookEvent = HookEvent,\n After extends HookEvent = HookEvent,\n> {\n /** Sink for each formatted line. Default: `console.log`. */\n log?: (line: string) => void;\n /** Also log `before` events (default `false` — `after` only). */\n includeBefore?: boolean;\n /**\n * Emit one JSON object per line (`{ \"source\", \"phase\", ...event }`) — for log\n * aggregators. Ignored when `format` is given. Default `false`.\n */\n json?: boolean;\n /** The `source` name in every line, usually the package name. Default `\"@xtandard/kit\"`. */\n source?: string;\n /**\n * Extra field printed after the event type in the text format, e.g. the\n * tenant or `project/env` the event belongs to. Omitted when it returns\n * `undefined` or an empty string.\n */\n describe?: (event: Before | After) => string | undefined;\n /**\n * Format a line for an event. Default: a compact\n * `[<source>] <phase> <type> [<describe>] ` prefix + JSON payload.\n */\n format?: (phase: \"before\" | \"after\", event: Before | After) => string;\n}\n\n/**\n * Build a hook that logs each mutation event. Never throws from `before`, so it\n * never denies a mutation — it is a pure observer.\n */\nexport function createLogHook<\n Before extends HookEvent = HookEvent,\n After extends HookEvent = HookEvent,\n>(options: LogHookOptions<Before, After> = {}): Hooks<Before, After> {\n const log = options.log ?? ((line: string) => console.log(line));\n const source = options.source ?? \"@xtandard/kit\";\n const describe = options.describe;\n const textFormat = (phase: \"before\" | \"after\", event: Before | After): string => {\n const extra = describe?.(event);\n return `[${source}] ${phase} ${event.type}${extra ? ` ${extra}` : \"\"} ${JSON.stringify(event)}`;\n };\n const jsonFormat = (phase: \"before\" | \"after\", event: Before | After): string =>\n JSON.stringify({ source, phase, ...event });\n const format = options.format ?? (options.json ? jsonFormat : textFormat);\n const hook: Hooks<Before, After> = {\n after(event) {\n log(format(\"after\", event));\n },\n };\n if (options.includeBefore) {\n hook.before = (event) => {\n log(format(\"before\", event));\n };\n }\n return hook;\n}\n"],"mappings":";;;;;;AAqDA,SAAgB,cAGd,UAAyC,CAAC,GAAyB;CACnE,MAAM,MAAM,QAAQ,SAAS,SAAiB,QAAQ,IAAI,IAAI;CAC9D,MAAM,SAAS,QAAQ,UAAU;CACjC,MAAM,WAAW,QAAQ;CACzB,MAAM,cAAc,OAA2B,UAAkC;EAC/E,MAAM,QAAQ,WAAW,KAAK;EAC9B,OAAO,IAAI,OAAO,IAAI,MAAM,GAAG,MAAM,OAAO,QAAQ,IAAI,UAAU,GAAG,GAAG,KAAK,UAAU,KAAK;CAC9F;CACA,MAAM,cAAc,OAA2B,UAC7C,KAAK,UAAU;EAAE;EAAQ;EAAO,GAAG;CAAM,CAAC;CAC5C,MAAM,SAAS,QAAQ,WAAW,QAAQ,OAAO,aAAa;CAC9D,MAAM,OAA6B,EACjC,MAAM,OAAO;EACX,IAAI,OAAO,SAAS,KAAK,CAAC;CAC5B,EACF;CACA,IAAI,QAAQ,eACV,KAAK,UAAU,UAAU;EACvB,IAAI,OAAO,UAAU,KAAK,CAAC;CAC7B;CAEF,OAAO;AACT"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { i as Hooks, r as HookEvent } from "./contract-DUj9P3Vt.cjs";
|
|
2
|
+
|
|
3
|
+
//#region src/hooks/log.d.ts
|
|
4
|
+
/** Options for {@link createLogHook}. */
|
|
5
|
+
interface LogHookOptions<Before extends HookEvent = HookEvent, After extends HookEvent = HookEvent> {
|
|
6
|
+
/** Sink for each formatted line. Default: `console.log`. */
|
|
7
|
+
log?: (line: string) => void;
|
|
8
|
+
/** Also log `before` events (default `false` — `after` only). */
|
|
9
|
+
includeBefore?: boolean;
|
|
10
|
+
/**
|
|
11
|
+
* Emit one JSON object per line (`{ "source", "phase", ...event }`) — for log
|
|
12
|
+
* aggregators. Ignored when `format` is given. Default `false`.
|
|
13
|
+
*/
|
|
14
|
+
json?: boolean;
|
|
15
|
+
/** The `source` name in every line, usually the package name. Default `"@xtandard/kit"`. */
|
|
16
|
+
source?: string;
|
|
17
|
+
/**
|
|
18
|
+
* Extra field printed after the event type in the text format, e.g. the
|
|
19
|
+
* tenant or `project/env` the event belongs to. Omitted when it returns
|
|
20
|
+
* `undefined` or an empty string.
|
|
21
|
+
*/
|
|
22
|
+
describe?: (event: Before | After) => string | undefined;
|
|
23
|
+
/**
|
|
24
|
+
* Format a line for an event. Default: a compact
|
|
25
|
+
* `[<source>] <phase> <type> [<describe>] ` prefix + JSON payload.
|
|
26
|
+
*/
|
|
27
|
+
format?: (phase: "before" | "after", event: Before | After) => string;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Build a hook that logs each mutation event. Never throws from `before`, so it
|
|
31
|
+
* never denies a mutation — it is a pure observer.
|
|
32
|
+
*/
|
|
33
|
+
declare function createLogHook<Before extends HookEvent = HookEvent, After extends HookEvent = HookEvent>(options?: LogHookOptions<Before, After>): Hooks<Before, After>;
|
|
34
|
+
//#endregion
|
|
35
|
+
export { type LogHookOptions, createLogHook };
|
|
36
|
+
//# sourceMappingURL=entry-hooks-log.d.cts.map
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { i as Hooks, r as HookEvent } from "./contract-DUj9P3Vt.mjs";
|
|
2
|
+
|
|
3
|
+
//#region src/hooks/log.d.ts
|
|
4
|
+
/** Options for {@link createLogHook}. */
|
|
5
|
+
interface LogHookOptions<Before extends HookEvent = HookEvent, After extends HookEvent = HookEvent> {
|
|
6
|
+
/** Sink for each formatted line. Default: `console.log`. */
|
|
7
|
+
log?: (line: string) => void;
|
|
8
|
+
/** Also log `before` events (default `false` — `after` only). */
|
|
9
|
+
includeBefore?: boolean;
|
|
10
|
+
/**
|
|
11
|
+
* Emit one JSON object per line (`{ "source", "phase", ...event }`) — for log
|
|
12
|
+
* aggregators. Ignored when `format` is given. Default `false`.
|
|
13
|
+
*/
|
|
14
|
+
json?: boolean;
|
|
15
|
+
/** The `source` name in every line, usually the package name. Default `"@xtandard/kit"`. */
|
|
16
|
+
source?: string;
|
|
17
|
+
/**
|
|
18
|
+
* Extra field printed after the event type in the text format, e.g. the
|
|
19
|
+
* tenant or `project/env` the event belongs to. Omitted when it returns
|
|
20
|
+
* `undefined` or an empty string.
|
|
21
|
+
*/
|
|
22
|
+
describe?: (event: Before | After) => string | undefined;
|
|
23
|
+
/**
|
|
24
|
+
* Format a line for an event. Default: a compact
|
|
25
|
+
* `[<source>] <phase> <type> [<describe>] ` prefix + JSON payload.
|
|
26
|
+
*/
|
|
27
|
+
format?: (phase: "before" | "after", event: Before | After) => string;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Build a hook that logs each mutation event. Never throws from `before`, so it
|
|
31
|
+
* never denies a mutation — it is a pure observer.
|
|
32
|
+
*/
|
|
33
|
+
declare function createLogHook<Before extends HookEvent = HookEvent, After extends HookEvent = HookEvent>(options?: LogHookOptions<Before, After>): Hooks<Before, After>;
|
|
34
|
+
//#endregion
|
|
35
|
+
export { type LogHookOptions, createLogHook };
|
|
36
|
+
//# sourceMappingURL=entry-hooks-log.d.mts.map
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
//#region src/hooks/log.ts
|
|
2
|
+
/**
|
|
3
|
+
* Build a hook that logs each mutation event. Never throws from `before`, so it
|
|
4
|
+
* never denies a mutation — it is a pure observer.
|
|
5
|
+
*/
|
|
6
|
+
function createLogHook(options = {}) {
|
|
7
|
+
const log = options.log ?? ((line) => console.log(line));
|
|
8
|
+
const source = options.source ?? "@xtandard/kit";
|
|
9
|
+
const describe = options.describe;
|
|
10
|
+
const textFormat = (phase, event) => {
|
|
11
|
+
const extra = describe?.(event);
|
|
12
|
+
return `[${source}] ${phase} ${event.type}${extra ? ` ${extra}` : ""} ${JSON.stringify(event)}`;
|
|
13
|
+
};
|
|
14
|
+
const jsonFormat = (phase, event) => JSON.stringify({
|
|
15
|
+
source,
|
|
16
|
+
phase,
|
|
17
|
+
...event
|
|
18
|
+
});
|
|
19
|
+
const format = options.format ?? (options.json ? jsonFormat : textFormat);
|
|
20
|
+
const hook = { after(event) {
|
|
21
|
+
log(format("after", event));
|
|
22
|
+
} };
|
|
23
|
+
if (options.includeBefore) hook.before = (event) => {
|
|
24
|
+
log(format("before", event));
|
|
25
|
+
};
|
|
26
|
+
return hook;
|
|
27
|
+
}
|
|
28
|
+
//#endregion
|
|
29
|
+
export { createLogHook };
|
|
30
|
+
|
|
31
|
+
//# sourceMappingURL=entry-hooks-log.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"entry-hooks-log.mjs","names":[],"sources":["../src/hooks/log.ts"],"sourcesContent":["/**\n * A reference hook that logs mutation events.\n *\n * The simplest possible consumer of the hooks seam: useful as a starting point\n * for your own `after` side effects, and handy for local debugging or piping\n * admin activity to a log aggregator (`json: true` prints one JSON object per\n * line). Zero dependencies.\n *\n * @example\n * ```ts\n * import { createLogHook } from \"@xtandard/kit/hooks/log\";\n *\n * const hook = createLogHook({ source: \"@xtandard/flags\", describe: (e) => e.projectKey });\n * ```\n *\n * @module\n */\n\nimport type { HookEvent, Hooks } from \"./contract.ts\";\n\n/** Options for {@link createLogHook}. */\nexport interface LogHookOptions<\n Before extends HookEvent = HookEvent,\n After extends HookEvent = HookEvent,\n> {\n /** Sink for each formatted line. Default: `console.log`. */\n log?: (line: string) => void;\n /** Also log `before` events (default `false` — `after` only). */\n includeBefore?: boolean;\n /**\n * Emit one JSON object per line (`{ \"source\", \"phase\", ...event }`) — for log\n * aggregators. Ignored when `format` is given. Default `false`.\n */\n json?: boolean;\n /** The `source` name in every line, usually the package name. Default `\"@xtandard/kit\"`. */\n source?: string;\n /**\n * Extra field printed after the event type in the text format, e.g. the\n * tenant or `project/env` the event belongs to. Omitted when it returns\n * `undefined` or an empty string.\n */\n describe?: (event: Before | After) => string | undefined;\n /**\n * Format a line for an event. Default: a compact\n * `[<source>] <phase> <type> [<describe>] ` prefix + JSON payload.\n */\n format?: (phase: \"before\" | \"after\", event: Before | After) => string;\n}\n\n/**\n * Build a hook that logs each mutation event. Never throws from `before`, so it\n * never denies a mutation — it is a pure observer.\n */\nexport function createLogHook<\n Before extends HookEvent = HookEvent,\n After extends HookEvent = HookEvent,\n>(options: LogHookOptions<Before, After> = {}): Hooks<Before, After> {\n const log = options.log ?? ((line: string) => console.log(line));\n const source = options.source ?? \"@xtandard/kit\";\n const describe = options.describe;\n const textFormat = (phase: \"before\" | \"after\", event: Before | After): string => {\n const extra = describe?.(event);\n return `[${source}] ${phase} ${event.type}${extra ? ` ${extra}` : \"\"} ${JSON.stringify(event)}`;\n };\n const jsonFormat = (phase: \"before\" | \"after\", event: Before | After): string =>\n JSON.stringify({ source, phase, ...event });\n const format = options.format ?? (options.json ? jsonFormat : textFormat);\n const hook: Hooks<Before, After> = {\n after(event) {\n log(format(\"after\", event));\n },\n };\n if (options.includeBefore) {\n hook.before = (event) => {\n log(format(\"before\", event));\n };\n }\n return hook;\n}\n"],"mappings":";;;;;AAqDA,SAAgB,cAGd,UAAyC,CAAC,GAAyB;CACnE,MAAM,MAAM,QAAQ,SAAS,SAAiB,QAAQ,IAAI,IAAI;CAC9D,MAAM,SAAS,QAAQ,UAAU;CACjC,MAAM,WAAW,QAAQ;CACzB,MAAM,cAAc,OAA2B,UAAkC;EAC/E,MAAM,QAAQ,WAAW,KAAK;EAC9B,OAAO,IAAI,OAAO,IAAI,MAAM,GAAG,MAAM,OAAO,QAAQ,IAAI,UAAU,GAAG,GAAG,KAAK,UAAU,KAAK;CAC9F;CACA,MAAM,cAAc,OAA2B,UAC7C,KAAK,UAAU;EAAE;EAAQ;EAAO,GAAG;CAAM,CAAC;CAC5C,MAAM,SAAS,QAAQ,WAAW,QAAQ,OAAO,aAAa;CAC9D,MAAM,OAA6B,EACjC,MAAM,OAAO;EACX,IAAI,OAAO,SAAS,KAAK,CAAC;CAC5B,EACF;CACA,IAAI,QAAQ,eACV,KAAK,UAAU,UAAU;EACvB,IAAI,OAAO,UAAU,KAAK,CAAC;CAC7B;CAEF,OAAO;AACT"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
+
const require_contract = require("./contract-wAEMDmYG.cjs");
|
|
3
|
+
exports.HookDeniedError = require_contract.HookDeniedError;
|
|
4
|
+
exports.createHookErrorReporter = require_contract.createHookErrorReporter;
|
|
5
|
+
exports.defaultHookErrorReporter = require_contract.defaultHookErrorReporter;
|
|
6
|
+
exports.hookDeniedStatus = require_contract.hookDeniedStatus;
|
|
7
|
+
exports.isNamed = require_contract.isNamed;
|
|
8
|
+
exports.normalizeHooks = require_contract.normalizeHooks;
|
|
9
|
+
exports.runAfter = require_contract.runAfter;
|
|
10
|
+
exports.runBefore = require_contract.runBefore;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { a as HooksInput, c as hookDeniedStatus, d as runAfter, f as runBefore, i as Hooks, l as isNamed, n as HookErrorReporter, o as createHookErrorReporter, r as HookEvent, s as defaultHookErrorReporter, t as HookDeniedError, u as normalizeHooks } from "./contract-DUj9P3Vt.cjs";
|
|
2
|
+
export { HookDeniedError, type HookErrorReporter, type HookEvent, type Hooks, type HooksInput, createHookErrorReporter, defaultHookErrorReporter, hookDeniedStatus, isNamed, normalizeHooks, runAfter, runBefore };
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { a as HooksInput, c as hookDeniedStatus, d as runAfter, f as runBefore, i as Hooks, l as isNamed, n as HookErrorReporter, o as createHookErrorReporter, r as HookEvent, s as defaultHookErrorReporter, t as HookDeniedError, u as normalizeHooks } from "./contract-DUj9P3Vt.mjs";
|
|
2
|
+
export { HookDeniedError, type HookErrorReporter, type HookEvent, type Hooks, type HooksInput, createHookErrorReporter, defaultHookErrorReporter, hookDeniedStatus, isNamed, normalizeHooks, runAfter, runBefore };
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { a as isNamed, c as runBefore, i as hookDeniedStatus, n as createHookErrorReporter, o as normalizeHooks, r as defaultHookErrorReporter, s as runAfter, t as HookDeniedError } from "./contract-BEdfGTPs.mjs";
|
|
2
|
+
export { HookDeniedError, createHookErrorReporter, defaultHookErrorReporter, hookDeniedStatus, isNamed, normalizeHooks, runAfter, runBefore };
|