@xtandard/permissions 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 +362 -2
- package/bin/xtandard-permissions.mjs +3 -0
- package/dist/better-auth-Bp9YVyQa.d.cts +56 -0
- package/dist/better-auth-DHyW5-yt.cjs +91 -0
- package/dist/better-auth-DHyW5-yt.cjs.map +1 -0
- package/dist/better-auth-NO40ZqSM.mjs +74 -0
- package/dist/better-auth-NO40ZqSM.mjs.map +1 -0
- package/dist/better-auth-NSXgt6ZU.d.mts +56 -0
- package/dist/catalog-DA_d1SdC.d.cts +153 -0
- package/dist/catalog-DJcJ3ycq.d.mts +153 -0
- package/dist/catalog.cjs +198 -0
- package/dist/catalog.cjs.map +1 -0
- package/dist/catalog.d.cts +3 -0
- package/dist/catalog.d.mts +3 -0
- package/dist/catalog.mjs +141 -0
- package/dist/catalog.mjs.map +1 -0
- package/dist/chunk-DakpK96I.cjs +43 -0
- package/dist/cli.cjs +548 -0
- package/dist/cli.cjs.map +1 -0
- package/dist/cli.d.cts +28 -0
- package/dist/cli.d.mts +28 -0
- package/dist/cli.mjs +544 -0
- package/dist/cli.mjs.map +1 -0
- package/dist/contract-BMiOmg2f.d.cts +50 -0
- package/dist/contract-Bpy8yPrS.cjs +70 -0
- package/dist/contract-Bpy8yPrS.cjs.map +1 -0
- package/dist/contract-CNgMXr2u.d.cts +46 -0
- package/dist/contract-CNgMXr2u.d.mts +46 -0
- package/dist/contract-CPmJVoRx.cjs +70 -0
- package/dist/contract-CPmJVoRx.cjs.map +1 -0
- package/dist/contract-D32H1t0u.d.mts +50 -0
- package/dist/contract-DTdTXZtJ.mjs +47 -0
- package/dist/contract-DTdTXZtJ.mjs.map +1 -0
- package/dist/contract-DUzgB-He.d.mts +375 -0
- package/dist/contract-Dk6d2ylD.d.cts +375 -0
- package/dist/contract-RMkmERhT.d.cts +2 -0
- package/dist/contract-RMkmERhT.d.mts +2 -0
- package/dist/contract-Yc5AZuvv.mjs +47 -0
- package/dist/contract-Yc5AZuvv.mjs.map +1 -0
- package/dist/create-fetch-handler-BHDU4chu.d.mts +77 -0
- package/dist/create-fetch-handler-BtX64_rS.d.cts +77 -0
- package/dist/create-fetch-handler-C-WyaRCR.cjs +653 -0
- package/dist/create-fetch-handler-C-WyaRCR.cjs.map +1 -0
- package/dist/create-fetch-handler-ojjpk1Iw.mjs +636 -0
- package/dist/create-fetch-handler-ojjpk1Iw.mjs.map +1 -0
- package/dist/elysia-shared-BM6cPoCU.mjs +78 -0
- package/dist/elysia-shared-BM6cPoCU.mjs.map +1 -0
- package/dist/elysia-shared-BUTFTeal.cjs +101 -0
- package/dist/elysia-shared-BUTFTeal.cjs.map +1 -0
- package/dist/elysia-shared-DtKViycb.d.cts +58 -0
- package/dist/elysia-shared-g8zsb_pU.d.mts +58 -0
- package/dist/engine-Bufv0TbD.mjs +574 -0
- package/dist/engine-Bufv0TbD.mjs.map +1 -0
- package/dist/engine-CGGVDCqi.d.cts +296 -0
- package/dist/engine-DpFIcbgh.d.mts +296 -0
- package/dist/engine-bMoz3iW-.cjs +587 -0
- package/dist/engine-bMoz3iW-.cjs.map +1 -0
- package/dist/entry-auth-basic.cjs +40 -0
- package/dist/entry-auth-basic.cjs.map +1 -0
- package/dist/entry-auth-basic.d.cts +24 -0
- package/dist/entry-auth-basic.d.mts +24 -0
- package/dist/entry-auth-basic.mjs +26 -0
- package/dist/entry-auth-basic.mjs.map +1 -0
- package/dist/entry-auth-better-auth.cjs +12 -0
- package/dist/entry-auth-better-auth.d.cts +5 -0
- package/dist/entry-auth-better-auth.d.mts +5 -0
- package/dist/entry-auth-better-auth.mjs +4 -0
- package/dist/entry-auth-delegated.cjs +8 -0
- package/dist/entry-auth-delegated.d.cts +2 -0
- package/dist/entry-auth-delegated.d.mts +2 -0
- package/dist/entry-auth-delegated.mjs +2 -0
- package/dist/entry-auth-jwt.cjs +116 -0
- package/dist/entry-auth-jwt.cjs.map +1 -0
- package/dist/entry-auth-jwt.d.cts +65 -0
- package/dist/entry-auth-jwt.d.mts +65 -0
- package/dist/entry-auth-jwt.mjs +108 -0
- package/dist/entry-auth-jwt.mjs.map +1 -0
- package/dist/entry-auth-none.cjs +14 -0
- package/dist/entry-auth-none.d.cts +2 -0
- package/dist/entry-auth-none.d.mts +2 -0
- package/dist/entry-auth-none.mjs +2 -0
- package/dist/entry-auth-session.cjs +82 -0
- package/dist/entry-auth-session.cjs.map +1 -0
- package/dist/entry-auth-session.d.cts +20 -0
- package/dist/entry-auth-session.d.mts +20 -0
- package/dist/entry-auth-session.mjs +75 -0
- package/dist/entry-auth-session.mjs.map +1 -0
- package/dist/entry-authorization-delegated.cjs +31 -0
- package/dist/entry-authorization-delegated.cjs.map +1 -0
- package/dist/entry-authorization-delegated.d.cts +27 -0
- package/dist/entry-authorization-delegated.d.mts +27 -0
- package/dist/entry-authorization-delegated.mjs +30 -0
- package/dist/entry-authorization-delegated.mjs.map +1 -0
- package/dist/entry-authorization-none.cjs +29 -0
- package/dist/entry-authorization-none.cjs.map +1 -0
- package/dist/entry-authorization-none.d.cts +17 -0
- package/dist/entry-authorization-none.d.mts +17 -0
- package/dist/entry-authorization-none.mjs +28 -0
- package/dist/entry-authorization-none.mjs.map +1 -0
- package/dist/entry-authorization-permissions.cjs +4 -0
- package/dist/entry-authorization-permissions.d.cts +49 -0
- package/dist/entry-authorization-permissions.d.mts +49 -0
- package/dist/entry-authorization-permissions.mjs +2 -0
- package/dist/entry-authorization-roles.cjs +9 -0
- package/dist/entry-authorization-roles.d.cts +37 -0
- package/dist/entry-authorization-roles.d.mts +37 -0
- package/dist/entry-authorization-roles.mjs +3 -0
- package/dist/entry-better-auth-client.cjs +31 -0
- package/dist/entry-better-auth-client.cjs.map +1 -0
- package/dist/entry-better-auth-client.d.cts +63 -0
- package/dist/entry-better-auth-client.d.mts +63 -0
- package/dist/entry-better-auth-client.mjs +29 -0
- package/dist/entry-better-auth-client.mjs.map +1 -0
- package/dist/entry-better-auth.cjs +289 -0
- package/dist/entry-better-auth.cjs.map +1 -0
- package/dist/entry-better-auth.d.cts +3 -0
- package/dist/entry-better-auth.d.mts +3 -0
- package/dist/entry-better-auth.mjs +284 -0
- package/dist/entry-better-auth.mjs.map +1 -0
- package/dist/entry-bridges-audit.cjs +106 -0
- package/dist/entry-bridges-audit.cjs.map +1 -0
- package/dist/entry-bridges-audit.d.cts +58 -0
- package/dist/entry-bridges-audit.d.mts +58 -0
- package/dist/entry-bridges-audit.mjs +105 -0
- package/dist/entry-bridges-audit.mjs.map +1 -0
- package/dist/entry-bridges-webhooks.cjs +90 -0
- package/dist/entry-bridges-webhooks.cjs.map +1 -0
- package/dist/entry-bridges-webhooks.d.cts +46 -0
- package/dist/entry-bridges-webhooks.d.mts +46 -0
- package/dist/entry-bridges-webhooks.mjs +88 -0
- package/dist/entry-bridges-webhooks.mjs.map +1 -0
- package/dist/entry-bun.cjs +33 -0
- package/dist/entry-bun.cjs.map +1 -0
- package/dist/entry-bun.d.cts +31 -0
- package/dist/entry-bun.d.mts +31 -0
- package/dist/entry-bun.mjs +30 -0
- package/dist/entry-bun.mjs.map +1 -0
- package/dist/entry-drizzle-mysql.cjs +34 -0
- package/dist/entry-drizzle-mysql.cjs.map +1 -0
- package/dist/entry-drizzle-mysql.d.cts +20 -0
- package/dist/entry-drizzle-mysql.d.mts +20 -0
- package/dist/entry-drizzle-mysql.mjs +33 -0
- package/dist/entry-drizzle-mysql.mjs.map +1 -0
- package/dist/entry-drizzle-pg.cjs +44 -0
- package/dist/entry-drizzle-pg.cjs.map +1 -0
- package/dist/entry-drizzle-pg.d.cts +20 -0
- package/dist/entry-drizzle-pg.d.mts +20 -0
- package/dist/entry-drizzle-pg.mjs +43 -0
- package/dist/entry-drizzle-pg.mjs.map +1 -0
- package/dist/entry-drizzle-sqlite.cjs +34 -0
- package/dist/entry-drizzle-sqlite.cjs.map +1 -0
- package/dist/entry-drizzle-sqlite.d.cts +15 -0
- package/dist/entry-drizzle-sqlite.d.mts +15 -0
- package/dist/entry-drizzle-sqlite.mjs +33 -0
- package/dist/entry-drizzle-sqlite.mjs.map +1 -0
- package/dist/entry-elysia.cjs +117 -0
- package/dist/entry-elysia.cjs.map +1 -0
- package/dist/entry-elysia.d.cts +446 -0
- package/dist/entry-elysia.d.mts +446 -0
- package/dist/entry-elysia.mjs +113 -0
- package/dist/entry-elysia.mjs.map +1 -0
- package/dist/entry-elysia2.cjs +117 -0
- package/dist/entry-elysia2.cjs.map +1 -0
- package/dist/entry-elysia2.d.cts +571 -0
- package/dist/entry-elysia2.d.mts +571 -0
- package/dist/entry-elysia2.mjs +113 -0
- package/dist/entry-elysia2.mjs.map +1 -0
- package/dist/entry-express.cjs +101 -0
- package/dist/entry-express.cjs.map +1 -0
- package/dist/entry-express.d.cts +36 -0
- package/dist/entry-express.d.mts +36 -0
- package/dist/entry-express.mjs +97 -0
- package/dist/entry-express.mjs.map +1 -0
- package/dist/entry-hono.cjs +63 -0
- package/dist/entry-hono.cjs.map +1 -0
- package/dist/entry-hono.d.cts +40 -0
- package/dist/entry-hono.d.mts +40 -0
- package/dist/entry-hono.mjs +60 -0
- package/dist/entry-hono.mjs.map +1 -0
- package/dist/entry-hooks-log.cjs +39 -0
- package/dist/entry-hooks-log.cjs.map +1 -0
- package/dist/entry-hooks-log.d.cts +19 -0
- package/dist/entry-hooks-log.d.mts +19 -0
- package/dist/entry-hooks-log.mjs +36 -0
- package/dist/entry-hooks-log.mjs.map +1 -0
- package/dist/entry-next.cjs +67 -0
- package/dist/entry-next.cjs.map +1 -0
- package/dist/entry-next.d.cts +60 -0
- package/dist/entry-next.d.mts +60 -0
- package/dist/entry-next.mjs +57 -0
- package/dist/entry-next.mjs.map +1 -0
- package/dist/entry-react.cjs +401 -0
- package/dist/entry-react.cjs.map +1 -0
- package/dist/entry-react.d.cts +206 -0
- package/dist/entry-react.d.mts +206 -0
- package/dist/entry-react.mjs +388 -0
- package/dist/entry-react.mjs.map +1 -0
- package/dist/entry-storage-cloudflare-kv.cjs +8 -0
- package/dist/entry-storage-cloudflare-kv.d.cts +2 -0
- package/dist/entry-storage-cloudflare-kv.d.mts +2 -0
- package/dist/entry-storage-cloudflare-kv.mjs +2 -0
- package/dist/entry-storage-drizzle.cjs +71 -0
- package/dist/entry-storage-drizzle.cjs.map +1 -0
- package/dist/entry-storage-drizzle.d.cts +27 -0
- package/dist/entry-storage-drizzle.d.mts +27 -0
- package/dist/entry-storage-drizzle.mjs +68 -0
- package/dist/entry-storage-drizzle.mjs.map +1 -0
- package/dist/entry-storage-file.cjs +54 -0
- package/dist/entry-storage-file.cjs.map +1 -0
- package/dist/entry-storage-file.d.cts +24 -0
- package/dist/entry-storage-file.d.mts +24 -0
- package/dist/entry-storage-file.mjs +46 -0
- package/dist/entry-storage-file.mjs.map +1 -0
- package/dist/entry-storage-libsql.cjs +64 -0
- package/dist/entry-storage-libsql.cjs.map +1 -0
- package/dist/entry-storage-libsql.d.cts +28 -0
- package/dist/entry-storage-libsql.d.mts +28 -0
- package/dist/entry-storage-libsql.mjs +61 -0
- package/dist/entry-storage-libsql.mjs.map +1 -0
- package/dist/entry-storage-memory.cjs +3 -0
- package/dist/entry-storage-memory.d.cts +25 -0
- package/dist/entry-storage-memory.d.mts +25 -0
- package/dist/entry-storage-memory.mjs +2 -0
- package/dist/entry-storage-mongodb.cjs +61 -0
- package/dist/entry-storage-mongodb.cjs.map +1 -0
- package/dist/entry-storage-mongodb.d.cts +25 -0
- package/dist/entry-storage-mongodb.d.mts +25 -0
- package/dist/entry-storage-mongodb.mjs +58 -0
- package/dist/entry-storage-mongodb.mjs.map +1 -0
- package/dist/entry-storage-postgres.cjs +62 -0
- package/dist/entry-storage-postgres.cjs.map +1 -0
- package/dist/entry-storage-postgres.d.cts +29 -0
- package/dist/entry-storage-postgres.d.mts +29 -0
- package/dist/entry-storage-postgres.mjs +58 -0
- package/dist/entry-storage-postgres.mjs.map +1 -0
- package/dist/entry-storage-redis.cjs +76 -0
- package/dist/entry-storage-redis.cjs.map +1 -0
- package/dist/entry-storage-redis.d.cts +29 -0
- package/dist/entry-storage-redis.d.mts +29 -0
- package/dist/entry-storage-redis.mjs +72 -0
- package/dist/entry-storage-redis.mjs.map +1 -0
- package/dist/entry-storage-sqlite.cjs +46 -0
- package/dist/entry-storage-sqlite.cjs.map +1 -0
- package/dist/entry-storage-sqlite.d.cts +22 -0
- package/dist/entry-storage-sqlite.d.mts +22 -0
- package/dist/entry-storage-sqlite.mjs +43 -0
- package/dist/entry-storage-sqlite.mjs.map +1 -0
- package/dist/entry-storage-unstorage.cjs +8 -0
- package/dist/entry-storage-unstorage.d.cts +2 -0
- package/dist/entry-storage-unstorage.d.mts +2 -0
- package/dist/entry-storage-unstorage.mjs +2 -0
- package/dist/error-codes-9MRMSSMQ.cjs +49 -0
- package/dist/error-codes-9MRMSSMQ.cjs.map +1 -0
- package/dist/error-codes-CCKuDDu7.mjs +44 -0
- package/dist/error-codes-CCKuDDu7.mjs.map +1 -0
- package/dist/errors-bL3XQLfE.mjs +54 -0
- package/dist/errors-bL3XQLfE.mjs.map +1 -0
- package/dist/errors-vVYic8gz.cjs +89 -0
- package/dist/errors-vVYic8gz.cjs.map +1 -0
- package/dist/events-AE4Ytqmz.d.cts +6 -0
- package/dist/events-AE4Ytqmz.d.mts +6 -0
- package/dist/events-DYZShrYB.mjs +15 -0
- package/dist/events-DYZShrYB.mjs.map +1 -0
- package/dist/events-FJ2K0wly.cjs +26 -0
- package/dist/events-FJ2K0wly.cjs.map +1 -0
- package/dist/guard-BOx5cnMP.mjs +141 -0
- package/dist/guard-BOx5cnMP.mjs.map +1 -0
- package/dist/guard-C3o7V14m.d.cts +62 -0
- package/dist/guard-DCbTnqPz.d.mts +62 -0
- package/dist/guard-nwdOYe90.cjs +188 -0
- package/dist/guard-nwdOYe90.cjs.map +1 -0
- package/dist/index-BVVgDSdq.d.cts +1 -0
- package/dist/index-BVVgDSdq.d.mts +1 -0
- package/dist/index.cjs +240 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +195 -0
- package/dist/index.d.mts +195 -0
- package/dist/index.mjs +60 -0
- package/dist/index.mjs.map +1 -0
- package/dist/kit-C7tepDB2.cjs +76 -0
- package/dist/kit-C7tepDB2.cjs.map +1 -0
- package/dist/kit-DMVBLBI9.d.mts +57 -0
- package/dist/kit-fzXHYb1l.mjs +65 -0
- package/dist/kit-fzXHYb1l.mjs.map +1 -0
- package/dist/kit-qAROuhOI.d.cts +57 -0
- package/dist/memory-BbBbbY8-.mjs +32 -0
- package/dist/memory-BbBbbY8-.mjs.map +1 -0
- package/dist/memory-knijqKw_.cjs +39 -0
- package/dist/memory-knijqKw_.cjs.map +1 -0
- package/dist/permissions-C9PjftY6.mjs +59 -0
- package/dist/permissions-C9PjftY6.mjs.map +1 -0
- package/dist/permissions-Cxri_P_k.cjs +70 -0
- package/dist/permissions-Cxri_P_k.cjs.map +1 -0
- package/dist/policy-BQmlo2lu.mjs +3 -0
- package/dist/policy-CGA6QD0a.d.mts +4 -0
- package/dist/policy-DFq_SYR3.d.cts +4 -0
- package/dist/react-embed.js +18710 -0
- package/dist/react.css +1 -0
- package/dist/relationships-BLYEJ9tc.cjs +907 -0
- package/dist/relationships-BLYEJ9tc.cjs.map +1 -0
- package/dist/relationships-BfLonEMI.mjs +756 -0
- package/dist/relationships-BfLonEMI.mjs.map +1 -0
- package/dist/roles-DBk4i8b5.mjs +69 -0
- package/dist/roles-DBk4i8b5.mjs.map +1 -0
- package/dist/roles-a8B5uZ35.cjs +104 -0
- package/dist/roles-a8B5uZ35.cjs.map +1 -0
- package/dist/rolldown-runtime-D7D4PA-g.mjs +13 -0
- package/dist/routes-DtRb3EO0.mjs +1001 -0
- package/dist/routes-DtRb3EO0.mjs.map +1 -0
- package/dist/routes-irNuuZqo.cjs +1049 -0
- package/dist/routes-irNuuZqo.cjs.map +1 -0
- package/dist/server-C2F4H6bR.d.cts +886 -0
- package/dist/server-CJ7AIJpO.d.mts +886 -0
- package/dist/table-DA98mVVT.d.cts +2 -0
- package/dist/table-DA98mVVT.d.mts +2 -0
- package/dist/testing.cjs +59 -0
- package/dist/testing.cjs.map +1 -0
- package/dist/testing.d.cts +37 -0
- package/dist/testing.d.mts +37 -0
- package/dist/testing.mjs +57 -0
- package/dist/testing.mjs.map +1 -0
- package/dist/types-elysia2/adapters/elysia-shared.d.ts +71 -0
- package/dist/types-elysia2/adapters/elysia2.d.ts +432 -0
- package/dist/types-elysia2/adapters/guard.d.ts +140 -0
- package/dist/types-elysia2/auth/contract.d.ts +9 -0
- package/dist/types-elysia2/auth-provider/contract.d.ts +57 -0
- package/dist/types-elysia2/auth-provider/kit.d.ts +57 -0
- package/dist/types-elysia2/authorization/contract.d.ts +53 -0
- package/dist/types-elysia2/authorization/permissions.d.ts +54 -0
- package/dist/types-elysia2/catalog.d.ts +197 -0
- package/dist/types-elysia2/engine.d.ts +192 -0
- package/dist/types-elysia2/entry-elysia2.d.ts +9 -0
- package/dist/types-elysia2/errors.d.ts +47 -0
- package/dist/types-elysia2/hooks/contract.d.ts +100 -0
- package/dist/types-elysia2/keys.d.ts +78 -0
- package/dist/types-elysia2/policy.d.ts +13 -0
- package/dist/types-elysia2/relationships.d.ts +162 -0
- package/dist/types-elysia2/schema.d.ts +299 -0
- package/dist/types-elysia2/server/cors.d.ts +8 -0
- package/dist/types-elysia2/server/create-fetch-handler.d.ts +87 -0
- package/dist/types-elysia2/server/openapi.d.ts +29 -0
- package/dist/types-elysia2/server/routes.d.ts +132 -0
- package/dist/types-elysia2/server/validation.d.ts +205 -0
- package/dist/types-elysia2/storage/contract.d.ts +18 -0
- package/dist/types-react/catalog.d.ts +197 -0
- package/dist/types-react/engine.d.ts +192 -0
- package/dist/types-react/entry-react-embed.d.ts +20 -0
- package/dist/types-react/errors.d.ts +47 -0
- package/dist/types-react/hooks/contract.d.ts +100 -0
- package/dist/types-react/keys.d.ts +78 -0
- package/dist/types-react/policy.d.ts +13 -0
- package/dist/types-react/react-embed.d.ts +37 -0
- package/dist/types-react/relationships.d.ts +162 -0
- package/dist/types-react/schema.d.ts +299 -0
- package/dist/types-react/storage/contract.d.ts +18 -0
- package/dist/types-react/ui/App.d.ts +23 -0
- package/dist/types-react/ui/api.d.ts +73 -0
- package/dist/types-react/ui/components/perm-bits.d.ts +64 -0
- package/dist/types-react/ui/lib/queries.d.ts +46 -0
- package/dist/types-react/ui/theme.d.ts +10 -0
- package/dist/types-react/ui/types.d.ts +109 -0
- package/dist/types-react/ui/views/CatalogView.d.ts +3 -0
- package/dist/types-react/ui/views/HistoryView.d.ts +6 -0
- package/dist/types-react/ui/views/PlaygroundView.d.ts +14 -0
- package/dist/types-react/ui/views/RelationshipsView.d.ts +6 -0
- package/dist/types-react/ui/views/SubjectDetailView.d.ts +7 -0
- package/dist/types-react/ui/views/SubjectsView.d.ts +6 -0
- package/dist/ui/apple-touch-icon.png +0 -0
- package/dist/ui/assets/index-DCPZRo-Z.css +1 -0
- package/dist/ui/assets/index-uXGOtyuj.js +104 -0
- package/dist/ui/favicon.ico +0 -0
- package/dist/ui/favicon.svg +15 -0
- package/dist/ui/index.html +20 -0
- package/package.json +587 -4
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"entry-storage-redis.mjs","names":[],"sources":["../src/storage/redis.ts"],"sourcesContent":["/**\n * Redis storage adapters built on the [`redis`](https://github.com/redis/node-redis)\n * package (node-redis v4/v5), an optional peer dependency. You can either pass a\n * pre-connected `client` or a `url` to connect lazily on first use. An optional\n * `prefix` is prepended (with a `:` separator) to every key so multiple\n * deployments can share a Redis instance without collisions; the prefix is\n * stripped from keys returned by {@link RedisPermissionsStorage.getKeys}.\n *\n * Two variants over the same plumbing, differing only in the value encoding:\n *\n * - {@link createRedisStorage} — values are plain **strings** containing JSON\n * (`SET`/`GET`). Works on any Redis; the default choice.\n * - {@link createRedisJSONStorage} — values are native **RedisJSON** documents\n * (`JSON.SET`/`JSON.GET`), so the stored data is queryable with JSONPath and\n * indexable with RediSearch. Requires the JSON module (Redis 8 / Redis Stack).\n * Do NOT point both variants at the same keys — the types are incompatible\n * (`WRONGTYPE`).\n *\n * `getKeys` uses a non-blocking `SCAN` cursor (never the blocking `KEYS`\n * command) with the prefix glob-escaped, so `*`, `?`, `[` and `\\` in a prefix\n * match literally. `watch` is implemented with Redis keyspace notifications; it\n * requires the server to be configured with `notify-keyspace-events` covering\n * generic + string + expiry events (e.g. `KEA` — whose `A` class also covers the\n * module events that RedisJSON writes emit, e.g. `json.set`).\n *\n * ## Compare-and-swap\n *\n * Both variants implement `compareAndSwap` with a small Lua script: it decodes\n * the stored value and the expectation with `cjson`, compares them\n * structurally (object key order is irrelevant) and writes `next` only on a\n * match — one atomic server-side step, safe across any number of instances.\n * The engine uses it for insert-if-absent grant writes.\n *\n * The driver is `@xtandard/kit/storage/redis`.\n *\n * @module\n */\n\nimport * as kit from \"@xtandard/kit/storage/redis\";\n\nexport type { RedisLike } from \"@xtandard/kit/storage/redis\";\n\n/** Options for {@link createRedisStorage} and {@link createRedisJSONStorage}. */\nexport type RedisStorageOptions = kit.RedisStorageOptions;\n\n/** A watchable, compare-and-swap capable storage backed by Redis, plus `close()`. */\nexport type RedisPermissionsStorage = kit.RedisKvStorage;\n\nconst SUBPATH = \"@xtandard/permissions/storage/redis\";\n\n/**\n * Create a Redis storage that stores values as JSON **strings**. Works on any\n * Redis. Connection is lazy (first operation).\n *\n * @example\n * ```ts\n * import { createRedisStorage } from \"@xtandard/permissions/storage/redis\";\n *\n * const storage = createRedisStorage({ url: process.env.REDIS_URL, prefix: \"permissions\" });\n * ```\n */\nexport function createRedisStorage(options: RedisStorageOptions): RedisPermissionsStorage {\n return kit.createRedisStorage({ subpath: SUBPATH, ...options });\n}\n\n/**\n * Create a Redis storage that stores values as native **RedisJSON** documents.\n * Needs Redis 8+ or Redis Stack. Never point it at keys written by\n * {@link createRedisStorage}.\n */\nexport function createRedisJSONStorage(options: RedisStorageOptions): RedisPermissionsStorage {\n return kit.createRedisJSONStorage({ subpath: SUBPATH, ...options });\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAgDA,MAAM,UAAU;;;;;;;;;;;;AAahB,SAAgB,mBAAmB,SAAuD;CACxF,OAAO,IAAI,mBAAmB;EAAE,SAAS;EAAS,GAAG;CAAQ,CAAC;AAChE;;;;;;AAOA,SAAgB,uBAAuB,SAAuD;CAC5F,OAAO,IAAI,uBAAuB;EAAE,SAAS;EAAS,GAAG;CAAQ,CAAC;AACpE"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
+
const require_chunk = require("./chunk-DakpK96I.cjs");
|
|
3
|
+
let _xtandard_kit_storage_sqlite = require("@xtandard/kit/storage/sqlite");
|
|
4
|
+
_xtandard_kit_storage_sqlite = require_chunk.__toESM(_xtandard_kit_storage_sqlite, 1);
|
|
5
|
+
//#region src/storage/sqlite.ts
|
|
6
|
+
/**
|
|
7
|
+
* SQLite storage adapter built on `bun:sqlite` — **Bun only**, zero npm deps.
|
|
8
|
+
* Ideal for single-node deployments and local/dev persistence: durable, fast, and
|
|
9
|
+
* file-backed (or in-memory). For multi-node runtimes prefer Redis/Postgres.
|
|
10
|
+
*
|
|
11
|
+
* Values are stored as canonical JSON, so `compareAndSwap` is one atomic
|
|
12
|
+
* `UPDATE … WHERE value = ?` (safe across processes sharing the file, too).
|
|
13
|
+
*
|
|
14
|
+
* ```ts
|
|
15
|
+
* import { createSqliteStorage } from "@xtandard/permissions/storage/sqlite";
|
|
16
|
+
* const storage = createSqliteStorage({ path: "./permissions.sqlite" });
|
|
17
|
+
* ```
|
|
18
|
+
*
|
|
19
|
+
* The driver is `@xtandard/kit/storage/sqlite`; `bun:sqlite` is loaded on first
|
|
20
|
+
* use, so importing this subpath under Node no longer throws (opening a
|
|
21
|
+
* database still needs Bun).
|
|
22
|
+
*
|
|
23
|
+
* @module
|
|
24
|
+
*/
|
|
25
|
+
/**
|
|
26
|
+
* Create a SQLite-backed {@link SqlitePermissionsStorage}. The table is created
|
|
27
|
+
* on first use.
|
|
28
|
+
*
|
|
29
|
+
* @example
|
|
30
|
+
* ```ts
|
|
31
|
+
* import { createSqliteStorage } from "@xtandard/permissions/storage/sqlite";
|
|
32
|
+
*
|
|
33
|
+
* const storage = createSqliteStorage({ path: "./permissions.sqlite" });
|
|
34
|
+
* ```
|
|
35
|
+
*/
|
|
36
|
+
function createSqliteStorage(options = {}) {
|
|
37
|
+
return _xtandard_kit_storage_sqlite.createSqliteStorage({
|
|
38
|
+
subpath: "@xtandard/permissions/storage/sqlite",
|
|
39
|
+
...options,
|
|
40
|
+
table: options.table ?? "xtandard_permissions_kv"
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
//#endregion
|
|
44
|
+
exports.createSqliteStorage = createSqliteStorage;
|
|
45
|
+
|
|
46
|
+
//# sourceMappingURL=entry-storage-sqlite.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"entry-storage-sqlite.cjs","names":["kit"],"sources":["../src/storage/sqlite.ts"],"sourcesContent":["/**\n * SQLite storage adapter built on `bun:sqlite` — **Bun only**, zero npm deps.\n * Ideal for single-node deployments and local/dev persistence: durable, fast, and\n * file-backed (or in-memory). For multi-node runtimes prefer Redis/Postgres.\n *\n * Values are stored as canonical JSON, so `compareAndSwap` is one atomic\n * `UPDATE … WHERE value = ?` (safe across processes sharing the file, too).\n *\n * ```ts\n * import { createSqliteStorage } from \"@xtandard/permissions/storage/sqlite\";\n * const storage = createSqliteStorage({ path: \"./permissions.sqlite\" });\n * ```\n *\n * The driver is `@xtandard/kit/storage/sqlite`; `bun:sqlite` is loaded on first\n * use, so importing this subpath under Node no longer throws (opening a\n * database still needs Bun).\n *\n * @module\n */\n\nimport * as kit from \"@xtandard/kit/storage/sqlite\";\n\n/** Options for {@link createSqliteStorage}. `table` defaults to `\"xtandard_permissions_kv\"`. */\nexport type SqliteStorageOptions = kit.SqliteStorageOptions;\n\n/** A compare-and-swap capable storage backed by SQLite, plus `close()`. */\nexport type SqlitePermissionsStorage = kit.SqliteKvStorage;\n\n/**\n * Create a SQLite-backed {@link SqlitePermissionsStorage}. The table is created\n * on first use.\n *\n * @example\n * ```ts\n * import { createSqliteStorage } from \"@xtandard/permissions/storage/sqlite\";\n *\n * const storage = createSqliteStorage({ path: \"./permissions.sqlite\" });\n * ```\n */\nexport function createSqliteStorage(options: SqliteStorageOptions = {}): SqlitePermissionsStorage {\n return kit.createSqliteStorage({\n subpath: \"@xtandard/permissions/storage/sqlite\",\n ...options,\n table: options.table ?? \"xtandard_permissions_kv\",\n });\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAuCA,SAAgB,oBAAoB,UAAgC,CAAC,GAA6B;CAChG,OAAOA,6BAAI,oBAAoB;EAC7B,SAAS;EACT,GAAG;EACH,OAAO,QAAQ,SAAS;CAC1B,CAAC;AACH"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import * as kit from "@xtandard/kit/storage/sqlite";
|
|
2
|
+
|
|
3
|
+
//#region src/storage/sqlite.d.ts
|
|
4
|
+
/** Options for {@link createSqliteStorage}. `table` defaults to `"xtandard_permissions_kv"`. */
|
|
5
|
+
type SqliteStorageOptions = kit.SqliteStorageOptions;
|
|
6
|
+
/** A compare-and-swap capable storage backed by SQLite, plus `close()`. */
|
|
7
|
+
type SqlitePermissionsStorage = kit.SqliteKvStorage;
|
|
8
|
+
/**
|
|
9
|
+
* Create a SQLite-backed {@link SqlitePermissionsStorage}. The table is created
|
|
10
|
+
* on first use.
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* ```ts
|
|
14
|
+
* import { createSqliteStorage } from "@xtandard/permissions/storage/sqlite";
|
|
15
|
+
*
|
|
16
|
+
* const storage = createSqliteStorage({ path: "./permissions.sqlite" });
|
|
17
|
+
* ```
|
|
18
|
+
*/
|
|
19
|
+
declare function createSqliteStorage(options?: SqliteStorageOptions): SqlitePermissionsStorage;
|
|
20
|
+
//#endregion
|
|
21
|
+
export { SqlitePermissionsStorage, SqliteStorageOptions, createSqliteStorage };
|
|
22
|
+
//# sourceMappingURL=entry-storage-sqlite.d.cts.map
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import * as kit from "@xtandard/kit/storage/sqlite";
|
|
2
|
+
|
|
3
|
+
//#region src/storage/sqlite.d.ts
|
|
4
|
+
/** Options for {@link createSqliteStorage}. `table` defaults to `"xtandard_permissions_kv"`. */
|
|
5
|
+
type SqliteStorageOptions = kit.SqliteStorageOptions;
|
|
6
|
+
/** A compare-and-swap capable storage backed by SQLite, plus `close()`. */
|
|
7
|
+
type SqlitePermissionsStorage = kit.SqliteKvStorage;
|
|
8
|
+
/**
|
|
9
|
+
* Create a SQLite-backed {@link SqlitePermissionsStorage}. The table is created
|
|
10
|
+
* on first use.
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* ```ts
|
|
14
|
+
* import { createSqliteStorage } from "@xtandard/permissions/storage/sqlite";
|
|
15
|
+
*
|
|
16
|
+
* const storage = createSqliteStorage({ path: "./permissions.sqlite" });
|
|
17
|
+
* ```
|
|
18
|
+
*/
|
|
19
|
+
declare function createSqliteStorage(options?: SqliteStorageOptions): SqlitePermissionsStorage;
|
|
20
|
+
//#endregion
|
|
21
|
+
export { SqlitePermissionsStorage, SqliteStorageOptions, createSqliteStorage };
|
|
22
|
+
//# sourceMappingURL=entry-storage-sqlite.d.mts.map
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import * as kit from "@xtandard/kit/storage/sqlite";
|
|
2
|
+
//#region src/storage/sqlite.ts
|
|
3
|
+
/**
|
|
4
|
+
* SQLite storage adapter built on `bun:sqlite` — **Bun only**, zero npm deps.
|
|
5
|
+
* Ideal for single-node deployments and local/dev persistence: durable, fast, and
|
|
6
|
+
* file-backed (or in-memory). For multi-node runtimes prefer Redis/Postgres.
|
|
7
|
+
*
|
|
8
|
+
* Values are stored as canonical JSON, so `compareAndSwap` is one atomic
|
|
9
|
+
* `UPDATE … WHERE value = ?` (safe across processes sharing the file, too).
|
|
10
|
+
*
|
|
11
|
+
* ```ts
|
|
12
|
+
* import { createSqliteStorage } from "@xtandard/permissions/storage/sqlite";
|
|
13
|
+
* const storage = createSqliteStorage({ path: "./permissions.sqlite" });
|
|
14
|
+
* ```
|
|
15
|
+
*
|
|
16
|
+
* The driver is `@xtandard/kit/storage/sqlite`; `bun:sqlite` is loaded on first
|
|
17
|
+
* use, so importing this subpath under Node no longer throws (opening a
|
|
18
|
+
* database still needs Bun).
|
|
19
|
+
*
|
|
20
|
+
* @module
|
|
21
|
+
*/
|
|
22
|
+
/**
|
|
23
|
+
* Create a SQLite-backed {@link SqlitePermissionsStorage}. The table is created
|
|
24
|
+
* on first use.
|
|
25
|
+
*
|
|
26
|
+
* @example
|
|
27
|
+
* ```ts
|
|
28
|
+
* import { createSqliteStorage } from "@xtandard/permissions/storage/sqlite";
|
|
29
|
+
*
|
|
30
|
+
* const storage = createSqliteStorage({ path: "./permissions.sqlite" });
|
|
31
|
+
* ```
|
|
32
|
+
*/
|
|
33
|
+
function createSqliteStorage(options = {}) {
|
|
34
|
+
return kit.createSqliteStorage({
|
|
35
|
+
subpath: "@xtandard/permissions/storage/sqlite",
|
|
36
|
+
...options,
|
|
37
|
+
table: options.table ?? "xtandard_permissions_kv"
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
//#endregion
|
|
41
|
+
export { createSqliteStorage };
|
|
42
|
+
|
|
43
|
+
//# sourceMappingURL=entry-storage-sqlite.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"entry-storage-sqlite.mjs","names":[],"sources":["../src/storage/sqlite.ts"],"sourcesContent":["/**\n * SQLite storage adapter built on `bun:sqlite` — **Bun only**, zero npm deps.\n * Ideal for single-node deployments and local/dev persistence: durable, fast, and\n * file-backed (or in-memory). For multi-node runtimes prefer Redis/Postgres.\n *\n * Values are stored as canonical JSON, so `compareAndSwap` is one atomic\n * `UPDATE … WHERE value = ?` (safe across processes sharing the file, too).\n *\n * ```ts\n * import { createSqliteStorage } from \"@xtandard/permissions/storage/sqlite\";\n * const storage = createSqliteStorage({ path: \"./permissions.sqlite\" });\n * ```\n *\n * The driver is `@xtandard/kit/storage/sqlite`; `bun:sqlite` is loaded on first\n * use, so importing this subpath under Node no longer throws (opening a\n * database still needs Bun).\n *\n * @module\n */\n\nimport * as kit from \"@xtandard/kit/storage/sqlite\";\n\n/** Options for {@link createSqliteStorage}. `table` defaults to `\"xtandard_permissions_kv\"`. */\nexport type SqliteStorageOptions = kit.SqliteStorageOptions;\n\n/** A compare-and-swap capable storage backed by SQLite, plus `close()`. */\nexport type SqlitePermissionsStorage = kit.SqliteKvStorage;\n\n/**\n * Create a SQLite-backed {@link SqlitePermissionsStorage}. The table is created\n * on first use.\n *\n * @example\n * ```ts\n * import { createSqliteStorage } from \"@xtandard/permissions/storage/sqlite\";\n *\n * const storage = createSqliteStorage({ path: \"./permissions.sqlite\" });\n * ```\n */\nexport function createSqliteStorage(options: SqliteStorageOptions = {}): SqlitePermissionsStorage {\n return kit.createSqliteStorage({\n subpath: \"@xtandard/permissions/storage/sqlite\",\n ...options,\n table: options.table ?? \"xtandard_permissions_kv\",\n });\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAuCA,SAAgB,oBAAoB,UAAgC,CAAC,GAA6B;CAChG,OAAO,IAAI,oBAAoB;EAC7B,SAAS;EACT,GAAG;EACH,OAAO,QAAQ,SAAS;CAC1B,CAAC;AACH"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
+
let _xtandard_kit_storage_unstorage = require("@xtandard/kit/storage/unstorage");
|
|
3
|
+
Object.defineProperty(exports, "createUnstorageStorage", {
|
|
4
|
+
enumerable: true,
|
|
5
|
+
get: function() {
|
|
6
|
+
return _xtandard_kit_storage_unstorage.createUnstorageStorage;
|
|
7
|
+
}
|
|
8
|
+
});
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
//#region src/better-auth/error-codes.ts
|
|
2
|
+
/**
|
|
3
|
+
* Error codes shared by the better-auth server and client plugins (`error.code` on the client).
|
|
4
|
+
*
|
|
5
|
+
* @module
|
|
6
|
+
*/
|
|
7
|
+
const PERMISSIONS_ERROR_CODES = {
|
|
8
|
+
PERMISSIONS_FORBIDDEN: {
|
|
9
|
+
code: "PERMISSIONS_FORBIDDEN",
|
|
10
|
+
message: "You are not allowed to manage permissions"
|
|
11
|
+
},
|
|
12
|
+
PERMISSIONS_UNKNOWN_PERMISSION: {
|
|
13
|
+
code: "PERMISSIONS_UNKNOWN_PERMISSION",
|
|
14
|
+
message: "Unknown permission"
|
|
15
|
+
},
|
|
16
|
+
PERMISSIONS_UNKNOWN_ROLE: {
|
|
17
|
+
code: "PERMISSIONS_UNKNOWN_ROLE",
|
|
18
|
+
message: "Unknown role"
|
|
19
|
+
},
|
|
20
|
+
PERMISSIONS_INVALID_INPUT: {
|
|
21
|
+
code: "PERMISSIONS_INVALID_INPUT",
|
|
22
|
+
message: "Invalid input"
|
|
23
|
+
},
|
|
24
|
+
PERMISSIONS_NOT_FOUND: {
|
|
25
|
+
code: "PERMISSIONS_NOT_FOUND",
|
|
26
|
+
message: "Not found"
|
|
27
|
+
},
|
|
28
|
+
PERMISSIONS_READONLY: {
|
|
29
|
+
code: "PERMISSIONS_READONLY",
|
|
30
|
+
message: "Permissions are read-only"
|
|
31
|
+
},
|
|
32
|
+
PERMISSIONS_NO_SUBJECT: {
|
|
33
|
+
code: "PERMISSIONS_NO_SUBJECT",
|
|
34
|
+
message: "No subject"
|
|
35
|
+
},
|
|
36
|
+
PERMISSIONS_INVALID_RELATION: {
|
|
37
|
+
code: "PERMISSIONS_INVALID_RELATION",
|
|
38
|
+
message: "Invalid relation (not in the catalog's relation schema)"
|
|
39
|
+
}
|
|
40
|
+
};
|
|
41
|
+
//#endregion
|
|
42
|
+
Object.defineProperty(exports, "PERMISSIONS_ERROR_CODES", {
|
|
43
|
+
enumerable: true,
|
|
44
|
+
get: function() {
|
|
45
|
+
return PERMISSIONS_ERROR_CODES;
|
|
46
|
+
}
|
|
47
|
+
});
|
|
48
|
+
|
|
49
|
+
//# sourceMappingURL=error-codes-9MRMSSMQ.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"error-codes-9MRMSSMQ.cjs","names":[],"sources":["../src/better-auth/error-codes.ts"],"sourcesContent":["/**\n * Error codes shared by the better-auth server and client plugins (`error.code` on the client).\n *\n * @module\n */\n\nexport const PERMISSIONS_ERROR_CODES = {\n PERMISSIONS_FORBIDDEN: {\n code: \"PERMISSIONS_FORBIDDEN\",\n message: \"You are not allowed to manage permissions\",\n },\n PERMISSIONS_UNKNOWN_PERMISSION: {\n code: \"PERMISSIONS_UNKNOWN_PERMISSION\",\n message: \"Unknown permission\",\n },\n PERMISSIONS_UNKNOWN_ROLE: { code: \"PERMISSIONS_UNKNOWN_ROLE\", message: \"Unknown role\" },\n PERMISSIONS_INVALID_INPUT: { code: \"PERMISSIONS_INVALID_INPUT\", message: \"Invalid input\" },\n PERMISSIONS_NOT_FOUND: { code: \"PERMISSIONS_NOT_FOUND\", message: \"Not found\" },\n PERMISSIONS_READONLY: { code: \"PERMISSIONS_READONLY\", message: \"Permissions are read-only\" },\n PERMISSIONS_NO_SUBJECT: { code: \"PERMISSIONS_NO_SUBJECT\", message: \"No subject\" },\n PERMISSIONS_INVALID_RELATION: {\n code: \"PERMISSIONS_INVALID_RELATION\",\n message: \"Invalid relation (not in the catalog's relation schema)\",\n },\n} as const;\n"],"mappings":";;;;;;AAMA,MAAa,0BAA0B;CACrC,uBAAuB;EACrB,MAAM;EACN,SAAS;CACX;CACA,gCAAgC;EAC9B,MAAM;EACN,SAAS;CACX;CACA,0BAA0B;EAAE,MAAM;EAA4B,SAAS;CAAe;CACtF,2BAA2B;EAAE,MAAM;EAA6B,SAAS;CAAgB;CACzF,uBAAuB;EAAE,MAAM;EAAyB,SAAS;CAAY;CAC7E,sBAAsB;EAAE,MAAM;EAAwB,SAAS;CAA4B;CAC3F,wBAAwB;EAAE,MAAM;EAA0B,SAAS;CAAa;CAChF,8BAA8B;EAC5B,MAAM;EACN,SAAS;CACX;AACF"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
//#region src/better-auth/error-codes.ts
|
|
2
|
+
/**
|
|
3
|
+
* Error codes shared by the better-auth server and client plugins (`error.code` on the client).
|
|
4
|
+
*
|
|
5
|
+
* @module
|
|
6
|
+
*/
|
|
7
|
+
const PERMISSIONS_ERROR_CODES = {
|
|
8
|
+
PERMISSIONS_FORBIDDEN: {
|
|
9
|
+
code: "PERMISSIONS_FORBIDDEN",
|
|
10
|
+
message: "You are not allowed to manage permissions"
|
|
11
|
+
},
|
|
12
|
+
PERMISSIONS_UNKNOWN_PERMISSION: {
|
|
13
|
+
code: "PERMISSIONS_UNKNOWN_PERMISSION",
|
|
14
|
+
message: "Unknown permission"
|
|
15
|
+
},
|
|
16
|
+
PERMISSIONS_UNKNOWN_ROLE: {
|
|
17
|
+
code: "PERMISSIONS_UNKNOWN_ROLE",
|
|
18
|
+
message: "Unknown role"
|
|
19
|
+
},
|
|
20
|
+
PERMISSIONS_INVALID_INPUT: {
|
|
21
|
+
code: "PERMISSIONS_INVALID_INPUT",
|
|
22
|
+
message: "Invalid input"
|
|
23
|
+
},
|
|
24
|
+
PERMISSIONS_NOT_FOUND: {
|
|
25
|
+
code: "PERMISSIONS_NOT_FOUND",
|
|
26
|
+
message: "Not found"
|
|
27
|
+
},
|
|
28
|
+
PERMISSIONS_READONLY: {
|
|
29
|
+
code: "PERMISSIONS_READONLY",
|
|
30
|
+
message: "Permissions are read-only"
|
|
31
|
+
},
|
|
32
|
+
PERMISSIONS_NO_SUBJECT: {
|
|
33
|
+
code: "PERMISSIONS_NO_SUBJECT",
|
|
34
|
+
message: "No subject"
|
|
35
|
+
},
|
|
36
|
+
PERMISSIONS_INVALID_RELATION: {
|
|
37
|
+
code: "PERMISSIONS_INVALID_RELATION",
|
|
38
|
+
message: "Invalid relation (not in the catalog's relation schema)"
|
|
39
|
+
}
|
|
40
|
+
};
|
|
41
|
+
//#endregion
|
|
42
|
+
export { PERMISSIONS_ERROR_CODES as t };
|
|
43
|
+
|
|
44
|
+
//# sourceMappingURL=error-codes-CCKuDDu7.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"error-codes-CCKuDDu7.mjs","names":[],"sources":["../src/better-auth/error-codes.ts"],"sourcesContent":["/**\n * Error codes shared by the better-auth server and client plugins (`error.code` on the client).\n *\n * @module\n */\n\nexport const PERMISSIONS_ERROR_CODES = {\n PERMISSIONS_FORBIDDEN: {\n code: \"PERMISSIONS_FORBIDDEN\",\n message: \"You are not allowed to manage permissions\",\n },\n PERMISSIONS_UNKNOWN_PERMISSION: {\n code: \"PERMISSIONS_UNKNOWN_PERMISSION\",\n message: \"Unknown permission\",\n },\n PERMISSIONS_UNKNOWN_ROLE: { code: \"PERMISSIONS_UNKNOWN_ROLE\", message: \"Unknown role\" },\n PERMISSIONS_INVALID_INPUT: { code: \"PERMISSIONS_INVALID_INPUT\", message: \"Invalid input\" },\n PERMISSIONS_NOT_FOUND: { code: \"PERMISSIONS_NOT_FOUND\", message: \"Not found\" },\n PERMISSIONS_READONLY: { code: \"PERMISSIONS_READONLY\", message: \"Permissions are read-only\" },\n PERMISSIONS_NO_SUBJECT: { code: \"PERMISSIONS_NO_SUBJECT\", message: \"No subject\" },\n PERMISSIONS_INVALID_RELATION: {\n code: \"PERMISSIONS_INVALID_RELATION\",\n message: \"Invalid relation (not in the catalog's relation schema)\",\n },\n} as const;\n"],"mappings":";;;;;;AAMA,MAAa,0BAA0B;CACrC,uBAAuB;EACrB,MAAM;EACN,SAAS;CACX;CACA,gCAAgC;EAC9B,MAAM;EACN,SAAS;CACX;CACA,0BAA0B;EAAE,MAAM;EAA4B,SAAS;CAAe;CACtF,2BAA2B;EAAE,MAAM;EAA6B,SAAS;CAAgB;CACzF,uBAAuB;EAAE,MAAM;EAAyB,SAAS;CAAY;CAC7E,sBAAsB;EAAE,MAAM;EAAwB,SAAS;CAA4B;CAC3F,wBAAwB;EAAE,MAAM;EAA0B,SAAS;CAAa;CAChF,8BAA8B;EAC5B,MAAM;EACN,SAAS;CACX;AACF"}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { ValidationError as ValidationError$1 } from "@xtandard/kit/util";
|
|
2
|
+
//#region src/errors.ts
|
|
3
|
+
/** A write (or a check) needs a subject id and got none (no session, or an empty id). */
|
|
4
|
+
var NoSubjectError = class extends Error {
|
|
5
|
+
constructor(message = "A subject id is required (no session, or an empty id).") {
|
|
6
|
+
super(message);
|
|
7
|
+
this.name = "NoSubjectError";
|
|
8
|
+
}
|
|
9
|
+
};
|
|
10
|
+
/** The permission is not in the catalog's `assignable` list. */
|
|
11
|
+
var UnknownPermissionError = class extends Error {
|
|
12
|
+
/** The rejected permission. */
|
|
13
|
+
permission;
|
|
14
|
+
constructor(permission) {
|
|
15
|
+
super(`Unknown permission ${JSON.stringify(String(permission))}: not in the catalog's assignable list.`);
|
|
16
|
+
this.name = "UnknownPermissionError";
|
|
17
|
+
this.permission = String(permission);
|
|
18
|
+
}
|
|
19
|
+
};
|
|
20
|
+
/** The role is not one of the catalog's `roles` (or may not be assigned). */
|
|
21
|
+
var UnknownRoleError = class extends Error {
|
|
22
|
+
/** The rejected role. */
|
|
23
|
+
role;
|
|
24
|
+
constructor(role, message) {
|
|
25
|
+
super(message ?? `Unknown role ${JSON.stringify(String(role))}: not in the catalog's roles.`);
|
|
26
|
+
this.name = "UnknownRoleError";
|
|
27
|
+
this.role = String(role);
|
|
28
|
+
}
|
|
29
|
+
};
|
|
30
|
+
/** The caller may not perform the operation (e.g. grant without a manager role). */
|
|
31
|
+
var ForbiddenError = class extends Error {
|
|
32
|
+
constructor(message = "Forbidden") {
|
|
33
|
+
super(message);
|
|
34
|
+
this.name = "ForbiddenError";
|
|
35
|
+
}
|
|
36
|
+
};
|
|
37
|
+
/** A referenced record does not exist. */
|
|
38
|
+
var NotFoundError = class extends Error {
|
|
39
|
+
constructor(message) {
|
|
40
|
+
super(message);
|
|
41
|
+
this.name = "NotFoundError";
|
|
42
|
+
}
|
|
43
|
+
};
|
|
44
|
+
/** Thrown by mutating operations when the engine is readonly. */
|
|
45
|
+
var ReadonlyError = class extends Error {
|
|
46
|
+
constructor(operation) {
|
|
47
|
+
super(`Cannot ${operation}: @xtandard/permissions is in readonly mode.`);
|
|
48
|
+
this.name = "ReadonlyError";
|
|
49
|
+
}
|
|
50
|
+
};
|
|
51
|
+
//#endregion
|
|
52
|
+
export { UnknownPermissionError as a, ReadonlyError as i, NoSubjectError as n, UnknownRoleError as o, NotFoundError as r, ValidationError$1 as s, ForbiddenError as t };
|
|
53
|
+
|
|
54
|
+
//# sourceMappingURL=errors-bL3XQLfE.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"errors-bL3XQLfE.mjs","names":[],"sources":["../src/errors.ts"],"sourcesContent":["/**\n * Typed errors. Every class sets a distinct `name`: the kit maps errors to HTTP\n * responses **by name** (`isNamed`), so a copy from another bundle still maps.\n *\n * | name | when |\n * | ------------------------ | --------------------------------------------------------------- |\n * | `NoSubjectError` | a write (or a check) without a subject id — never `\"\"` |\n * | `UnknownPermissionError` | a permission not in the catalog's `assignable` list |\n * | `UnknownRoleError` | a role not in the catalog's `roles` |\n * | `ForbiddenError` | the caller may not manage permissions |\n * | `NotFoundError` | a referenced record does not exist |\n * | `ReadonlyError` | a mutation on a `readonly` engine |\n * | `ValidationError` | malformed input (the kit's, with `errors` / `issues`) |\n * | `AsyncRuleError` | a rule returned a Promise (the lib's; the check denied) |\n *\n * @module\n */\n\nexport { ValidationError, type ValidationIssue } from \"@xtandard/kit/util\";\nexport { AsyncRuleError } from \"./policy.ts\";\n\n/** A write (or a check) needs a subject id and got none (no session, or an empty id). */\nexport class NoSubjectError extends Error {\n constructor(message = \"A subject id is required (no session, or an empty id).\") {\n super(message);\n this.name = \"NoSubjectError\";\n }\n}\n\n/** The permission is not in the catalog's `assignable` list. */\nexport class UnknownPermissionError extends Error {\n /** The rejected permission. */\n readonly permission: string;\n constructor(permission: unknown) {\n super(\n `Unknown permission ${JSON.stringify(String(permission))}: not in the catalog's assignable list.`,\n );\n this.name = \"UnknownPermissionError\";\n this.permission = String(permission);\n }\n}\n\n/** The role is not one of the catalog's `roles` (or may not be assigned). */\nexport class UnknownRoleError extends Error {\n /** The rejected role. */\n readonly role: string;\n constructor(role: unknown, message?: string) {\n super(message ?? `Unknown role ${JSON.stringify(String(role))}: not in the catalog's roles.`);\n this.name = \"UnknownRoleError\";\n this.role = String(role);\n }\n}\n\n/** The caller may not perform the operation (e.g. grant without a manager role). */\nexport class ForbiddenError extends Error {\n constructor(message = \"Forbidden\") {\n super(message);\n this.name = \"ForbiddenError\";\n }\n}\n\n/** A referenced record does not exist. */\nexport class NotFoundError extends Error {\n constructor(message: string) {\n super(message);\n this.name = \"NotFoundError\";\n }\n}\n\n/** Thrown by mutating operations when the engine is readonly. */\nexport class ReadonlyError extends Error {\n constructor(operation: string) {\n super(`Cannot ${operation}: @xtandard/permissions is in readonly mode.`);\n this.name = \"ReadonlyError\";\n }\n}\n"],"mappings":";;;AAsBA,IAAa,iBAAb,cAAoC,MAAM;CACxC,YAAY,UAAU,0DAA0D;EAC9E,MAAM,OAAO;EACb,KAAK,OAAO;CACd;AACF;;AAGA,IAAa,yBAAb,cAA4C,MAAM;;CAEhD;CACA,YAAY,YAAqB;EAC/B,MACE,sBAAsB,KAAK,UAAU,OAAO,UAAU,CAAC,EAAE,wCAC3D;EACA,KAAK,OAAO;EACZ,KAAK,aAAa,OAAO,UAAU;CACrC;AACF;;AAGA,IAAa,mBAAb,cAAsC,MAAM;;CAE1C;CACA,YAAY,MAAe,SAAkB;EAC3C,MAAM,WAAW,gBAAgB,KAAK,UAAU,OAAO,IAAI,CAAC,EAAE,8BAA8B;EAC5F,KAAK,OAAO;EACZ,KAAK,OAAO,OAAO,IAAI;CACzB;AACF;;AAGA,IAAa,iBAAb,cAAoC,MAAM;CACxC,YAAY,UAAU,aAAa;EACjC,MAAM,OAAO;EACb,KAAK,OAAO;CACd;AACF;;AAGA,IAAa,gBAAb,cAAmC,MAAM;CACvC,YAAY,SAAiB;EAC3B,MAAM,OAAO;EACb,KAAK,OAAO;CACd;AACF;;AAGA,IAAa,gBAAb,cAAmC,MAAM;CACvC,YAAY,WAAmB;EAC7B,MAAM,UAAU,UAAU,6CAA6C;EACvE,KAAK,OAAO;CACd;AACF"}
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
require("@xtandard/kit/util");
|
|
2
|
+
//#region src/errors.ts
|
|
3
|
+
/** A write (or a check) needs a subject id and got none (no session, or an empty id). */
|
|
4
|
+
var NoSubjectError = class extends Error {
|
|
5
|
+
constructor(message = "A subject id is required (no session, or an empty id).") {
|
|
6
|
+
super(message);
|
|
7
|
+
this.name = "NoSubjectError";
|
|
8
|
+
}
|
|
9
|
+
};
|
|
10
|
+
/** The permission is not in the catalog's `assignable` list. */
|
|
11
|
+
var UnknownPermissionError = class extends Error {
|
|
12
|
+
/** The rejected permission. */
|
|
13
|
+
permission;
|
|
14
|
+
constructor(permission) {
|
|
15
|
+
super(`Unknown permission ${JSON.stringify(String(permission))}: not in the catalog's assignable list.`);
|
|
16
|
+
this.name = "UnknownPermissionError";
|
|
17
|
+
this.permission = String(permission);
|
|
18
|
+
}
|
|
19
|
+
};
|
|
20
|
+
/** The role is not one of the catalog's `roles` (or may not be assigned). */
|
|
21
|
+
var UnknownRoleError = class extends Error {
|
|
22
|
+
/** The rejected role. */
|
|
23
|
+
role;
|
|
24
|
+
constructor(role, message) {
|
|
25
|
+
super(message ?? `Unknown role ${JSON.stringify(String(role))}: not in the catalog's roles.`);
|
|
26
|
+
this.name = "UnknownRoleError";
|
|
27
|
+
this.role = String(role);
|
|
28
|
+
}
|
|
29
|
+
};
|
|
30
|
+
/** The caller may not perform the operation (e.g. grant without a manager role). */
|
|
31
|
+
var ForbiddenError = class extends Error {
|
|
32
|
+
constructor(message = "Forbidden") {
|
|
33
|
+
super(message);
|
|
34
|
+
this.name = "ForbiddenError";
|
|
35
|
+
}
|
|
36
|
+
};
|
|
37
|
+
/** A referenced record does not exist. */
|
|
38
|
+
var NotFoundError = class extends Error {
|
|
39
|
+
constructor(message) {
|
|
40
|
+
super(message);
|
|
41
|
+
this.name = "NotFoundError";
|
|
42
|
+
}
|
|
43
|
+
};
|
|
44
|
+
/** Thrown by mutating operations when the engine is readonly. */
|
|
45
|
+
var ReadonlyError = class extends Error {
|
|
46
|
+
constructor(operation) {
|
|
47
|
+
super(`Cannot ${operation}: @xtandard/permissions is in readonly mode.`);
|
|
48
|
+
this.name = "ReadonlyError";
|
|
49
|
+
}
|
|
50
|
+
};
|
|
51
|
+
//#endregion
|
|
52
|
+
Object.defineProperty(exports, "ForbiddenError", {
|
|
53
|
+
enumerable: true,
|
|
54
|
+
get: function() {
|
|
55
|
+
return ForbiddenError;
|
|
56
|
+
}
|
|
57
|
+
});
|
|
58
|
+
Object.defineProperty(exports, "NoSubjectError", {
|
|
59
|
+
enumerable: true,
|
|
60
|
+
get: function() {
|
|
61
|
+
return NoSubjectError;
|
|
62
|
+
}
|
|
63
|
+
});
|
|
64
|
+
Object.defineProperty(exports, "NotFoundError", {
|
|
65
|
+
enumerable: true,
|
|
66
|
+
get: function() {
|
|
67
|
+
return NotFoundError;
|
|
68
|
+
}
|
|
69
|
+
});
|
|
70
|
+
Object.defineProperty(exports, "ReadonlyError", {
|
|
71
|
+
enumerable: true,
|
|
72
|
+
get: function() {
|
|
73
|
+
return ReadonlyError;
|
|
74
|
+
}
|
|
75
|
+
});
|
|
76
|
+
Object.defineProperty(exports, "UnknownPermissionError", {
|
|
77
|
+
enumerable: true,
|
|
78
|
+
get: function() {
|
|
79
|
+
return UnknownPermissionError;
|
|
80
|
+
}
|
|
81
|
+
});
|
|
82
|
+
Object.defineProperty(exports, "UnknownRoleError", {
|
|
83
|
+
enumerable: true,
|
|
84
|
+
get: function() {
|
|
85
|
+
return UnknownRoleError;
|
|
86
|
+
}
|
|
87
|
+
});
|
|
88
|
+
|
|
89
|
+
//# sourceMappingURL=errors-vVYic8gz.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"errors-vVYic8gz.cjs","names":[],"sources":["../src/errors.ts"],"sourcesContent":["/**\n * Typed errors. Every class sets a distinct `name`: the kit maps errors to HTTP\n * responses **by name** (`isNamed`), so a copy from another bundle still maps.\n *\n * | name | when |\n * | ------------------------ | --------------------------------------------------------------- |\n * | `NoSubjectError` | a write (or a check) without a subject id — never `\"\"` |\n * | `UnknownPermissionError` | a permission not in the catalog's `assignable` list |\n * | `UnknownRoleError` | a role not in the catalog's `roles` |\n * | `ForbiddenError` | the caller may not manage permissions |\n * | `NotFoundError` | a referenced record does not exist |\n * | `ReadonlyError` | a mutation on a `readonly` engine |\n * | `ValidationError` | malformed input (the kit's, with `errors` / `issues`) |\n * | `AsyncRuleError` | a rule returned a Promise (the lib's; the check denied) |\n *\n * @module\n */\n\nexport { ValidationError, type ValidationIssue } from \"@xtandard/kit/util\";\nexport { AsyncRuleError } from \"./policy.ts\";\n\n/** A write (or a check) needs a subject id and got none (no session, or an empty id). */\nexport class NoSubjectError extends Error {\n constructor(message = \"A subject id is required (no session, or an empty id).\") {\n super(message);\n this.name = \"NoSubjectError\";\n }\n}\n\n/** The permission is not in the catalog's `assignable` list. */\nexport class UnknownPermissionError extends Error {\n /** The rejected permission. */\n readonly permission: string;\n constructor(permission: unknown) {\n super(\n `Unknown permission ${JSON.stringify(String(permission))}: not in the catalog's assignable list.`,\n );\n this.name = \"UnknownPermissionError\";\n this.permission = String(permission);\n }\n}\n\n/** The role is not one of the catalog's `roles` (or may not be assigned). */\nexport class UnknownRoleError extends Error {\n /** The rejected role. */\n readonly role: string;\n constructor(role: unknown, message?: string) {\n super(message ?? `Unknown role ${JSON.stringify(String(role))}: not in the catalog's roles.`);\n this.name = \"UnknownRoleError\";\n this.role = String(role);\n }\n}\n\n/** The caller may not perform the operation (e.g. grant without a manager role). */\nexport class ForbiddenError extends Error {\n constructor(message = \"Forbidden\") {\n super(message);\n this.name = \"ForbiddenError\";\n }\n}\n\n/** A referenced record does not exist. */\nexport class NotFoundError extends Error {\n constructor(message: string) {\n super(message);\n this.name = \"NotFoundError\";\n }\n}\n\n/** Thrown by mutating operations when the engine is readonly. */\nexport class ReadonlyError extends Error {\n constructor(operation: string) {\n super(`Cannot ${operation}: @xtandard/permissions is in readonly mode.`);\n this.name = \"ReadonlyError\";\n }\n}\n"],"mappings":";;;AAsBA,IAAa,iBAAb,cAAoC,MAAM;CACxC,YAAY,UAAU,0DAA0D;EAC9E,MAAM,OAAO;EACb,KAAK,OAAO;CACd;AACF;;AAGA,IAAa,yBAAb,cAA4C,MAAM;;CAEhD;CACA,YAAY,YAAqB;EAC/B,MACE,sBAAsB,KAAK,UAAU,OAAO,UAAU,CAAC,EAAE,wCAC3D;EACA,KAAK,OAAO;EACZ,KAAK,aAAa,OAAO,UAAU;CACrC;AACF;;AAGA,IAAa,mBAAb,cAAsC,MAAM;;CAE1C;CACA,YAAY,MAAe,SAAkB;EAC3C,MAAM,WAAW,gBAAgB,KAAK,UAAU,OAAO,IAAI,CAAC,EAAE,8BAA8B;EAC5F,KAAK,OAAO;EACZ,KAAK,OAAO,OAAO,IAAI;CACzB;AACF;;AAGA,IAAa,iBAAb,cAAoC,MAAM;CACxC,YAAY,UAAU,aAAa;EACjC,MAAM,OAAO;EACb,KAAK,OAAO;CACd;AACF;;AAGA,IAAa,gBAAb,cAAmC,MAAM;CACvC,YAAY,SAAiB;EAC3B,MAAM,OAAO;EACb,KAAK,OAAO;CACd;AACF;;AAGA,IAAa,gBAAb,cAAmC,MAAM;CACvC,YAAY,WAAmB;EAC7B,MAAM,UAAU,UAAU,6CAA6C;EACvE,KAAK,OAAO;CACd;AACF"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
//#region src/bridges/events.d.ts
|
|
2
|
+
/** A bridged event name (without the `permissions.` prefix). */
|
|
3
|
+
type PermissionsEventName = "granted" | "revoked" | "role_changed" | "relationship_written" | "relationship_deleted";
|
|
4
|
+
//#endregion
|
|
5
|
+
export { PermissionsEventName as t };
|
|
6
|
+
//# sourceMappingURL=events-AE4Ytqmz.d.cts.map
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
//#region src/bridges/events.d.ts
|
|
2
|
+
/** A bridged event name (without the `permissions.` prefix). */
|
|
3
|
+
type PermissionsEventName = "granted" | "revoked" | "role_changed" | "relationship_written" | "relationship_deleted";
|
|
4
|
+
//#endregion
|
|
5
|
+
export { PermissionsEventName as t };
|
|
6
|
+
//# sourceMappingURL=events-AE4Ytqmz.d.mts.map
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
//#region src/bridges/events.ts
|
|
2
|
+
/** `after` hook type → bridged event name. */
|
|
3
|
+
const EVENT_NAMES = {
|
|
4
|
+
"grant.created": "granted",
|
|
5
|
+
"grant.revoked": "revoked",
|
|
6
|
+
"role.changed": "role_changed",
|
|
7
|
+
"relationship.written": "relationship_written",
|
|
8
|
+
"relationship.deleted": "relationship_deleted"
|
|
9
|
+
};
|
|
10
|
+
/** A JSON-safe copy (drops `undefined` fields). */
|
|
11
|
+
const toJson = (value) => JSON.parse(JSON.stringify(value));
|
|
12
|
+
//#endregion
|
|
13
|
+
export { toJson as n, EVENT_NAMES as t };
|
|
14
|
+
|
|
15
|
+
//# sourceMappingURL=events-DYZShrYB.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"events-DYZShrYB.mjs","names":[],"sources":["../src/bridges/events.ts"],"sourcesContent":["/**\n * The public event names both bridges use (ADR 0011): the engine's `after` hook types mapped to\n * past-tense names that read well in an audit log and a webhooks catalog.\n *\n * @module\n */\n\nimport type { AfterEventType } from \"../hooks/contract.ts\";\n\n/** A bridged event name (without the `permissions.` prefix). */\nexport type PermissionsEventName =\n | \"granted\"\n | \"revoked\"\n | \"role_changed\"\n | \"relationship_written\"\n | \"relationship_deleted\";\n\n/** `after` hook type → bridged event name. */\nexport const EVENT_NAMES: Readonly<Record<AfterEventType, PermissionsEventName>> = {\n \"grant.created\": \"granted\",\n \"grant.revoked\": \"revoked\",\n \"role.changed\": \"role_changed\",\n \"relationship.written\": \"relationship_written\",\n \"relationship.deleted\": \"relationship_deleted\",\n};\n\n/** A JSON-safe copy (drops `undefined` fields). */\nexport const toJson = <T>(value: unknown): T => JSON.parse(JSON.stringify(value)) as T;\n"],"mappings":";;AAkBA,MAAa,cAAsE;CACjF,iBAAiB;CACjB,iBAAiB;CACjB,gBAAgB;CAChB,wBAAwB;CACxB,wBAAwB;AAC1B;;AAGA,MAAa,UAAa,UAAsB,KAAK,MAAM,KAAK,UAAU,KAAK,CAAC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
//#region src/bridges/events.ts
|
|
2
|
+
/** `after` hook type → bridged event name. */
|
|
3
|
+
const EVENT_NAMES = {
|
|
4
|
+
"grant.created": "granted",
|
|
5
|
+
"grant.revoked": "revoked",
|
|
6
|
+
"role.changed": "role_changed",
|
|
7
|
+
"relationship.written": "relationship_written",
|
|
8
|
+
"relationship.deleted": "relationship_deleted"
|
|
9
|
+
};
|
|
10
|
+
/** A JSON-safe copy (drops `undefined` fields). */
|
|
11
|
+
const toJson = (value) => JSON.parse(JSON.stringify(value));
|
|
12
|
+
//#endregion
|
|
13
|
+
Object.defineProperty(exports, "EVENT_NAMES", {
|
|
14
|
+
enumerable: true,
|
|
15
|
+
get: function() {
|
|
16
|
+
return EVENT_NAMES;
|
|
17
|
+
}
|
|
18
|
+
});
|
|
19
|
+
Object.defineProperty(exports, "toJson", {
|
|
20
|
+
enumerable: true,
|
|
21
|
+
get: function() {
|
|
22
|
+
return toJson;
|
|
23
|
+
}
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
//# sourceMappingURL=events-FJ2K0wly.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"events-FJ2K0wly.cjs","names":[],"sources":["../src/bridges/events.ts"],"sourcesContent":["/**\n * The public event names both bridges use (ADR 0011): the engine's `after` hook types mapped to\n * past-tense names that read well in an audit log and a webhooks catalog.\n *\n * @module\n */\n\nimport type { AfterEventType } from \"../hooks/contract.ts\";\n\n/** A bridged event name (without the `permissions.` prefix). */\nexport type PermissionsEventName =\n | \"granted\"\n | \"revoked\"\n | \"role_changed\"\n | \"relationship_written\"\n | \"relationship_deleted\";\n\n/** `after` hook type → bridged event name. */\nexport const EVENT_NAMES: Readonly<Record<AfterEventType, PermissionsEventName>> = {\n \"grant.created\": \"granted\",\n \"grant.revoked\": \"revoked\",\n \"role.changed\": \"role_changed\",\n \"relationship.written\": \"relationship_written\",\n \"relationship.deleted\": \"relationship_deleted\",\n};\n\n/** A JSON-safe copy (drops `undefined` fields). */\nexport const toJson = <T>(value: unknown): T => JSON.parse(JSON.stringify(value)) as T;\n"],"mappings":";;AAkBA,MAAa,cAAsE;CACjF,iBAAiB;CACjB,iBAAiB;CACjB,gBAAgB;CAChB,wBAAwB;CACxB,wBAAwB;AAC1B;;AAGA,MAAa,UAAa,UAAsB,KAAK,MAAM,KAAK,UAAU,KAAK,CAAC"}
|