@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,100 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Control-plane hooks fired around grant, revoke, role and relationship writes (mirrors the
|
|
3
|
+
* family's hooks contract, `@xtandard/kit/hooks`).
|
|
4
|
+
*
|
|
5
|
+
* - `before` runs sequentially before the write commits. **Throw to deny**
|
|
6
|
+
* (e.g. {@link HookDeniedError}); the error propagates to the caller.
|
|
7
|
+
* - `after` runs once committed, for side effects (audit, webhooks, cache
|
|
8
|
+
* busting). Errors are isolated and reported via `onHookError`.
|
|
9
|
+
*
|
|
10
|
+
* A re-grant of an existing grant, a revoke of nothing, a role set to the
|
|
11
|
+
* role already stored, a re-write of a stored relationship and a delete of a
|
|
12
|
+
* missing one are no-ops: they fire neither `before` nor `after`.
|
|
13
|
+
* Checks never go through hooks.
|
|
14
|
+
*
|
|
15
|
+
* @module
|
|
16
|
+
*/
|
|
17
|
+
import { type HookErrorReporter as KitHookErrorReporter, type Hooks, type HooksInput } from "@xtandard/kit/hooks";
|
|
18
|
+
import type { Actor, Grant, Relationship, SubjectRecord } from "../schema.ts";
|
|
19
|
+
/** Events delivered to `before` hooks (the write has not happened yet). */
|
|
20
|
+
export type BeforeEvent = {
|
|
21
|
+
type: "grant.create";
|
|
22
|
+
subject: string;
|
|
23
|
+
grant: Grant;
|
|
24
|
+
actor: Actor | null;
|
|
25
|
+
} | {
|
|
26
|
+
type: "grant.revoke";
|
|
27
|
+
subject: string;
|
|
28
|
+
grant: Grant;
|
|
29
|
+
actor: Actor | null;
|
|
30
|
+
reason?: string;
|
|
31
|
+
} | {
|
|
32
|
+
type: "role.set";
|
|
33
|
+
subject: string;
|
|
34
|
+
/** The new role; `null` clears the stored assignment. */
|
|
35
|
+
role: string | null;
|
|
36
|
+
previous: string | null;
|
|
37
|
+
actor: Actor | null;
|
|
38
|
+
reason?: string;
|
|
39
|
+
} | {
|
|
40
|
+
type: "relationship.write";
|
|
41
|
+
/** The tuple's subject reference (`user:ana`, `group:eng#member`). */
|
|
42
|
+
subject: string;
|
|
43
|
+
relationship: Relationship;
|
|
44
|
+
actor: Actor | null;
|
|
45
|
+
} | {
|
|
46
|
+
type: "relationship.delete";
|
|
47
|
+
subject: string;
|
|
48
|
+
relationship: Relationship;
|
|
49
|
+
actor: Actor | null;
|
|
50
|
+
reason?: string;
|
|
51
|
+
};
|
|
52
|
+
/** Events delivered to `after` hooks (committed). */
|
|
53
|
+
export type AfterEvent = {
|
|
54
|
+
type: "grant.created";
|
|
55
|
+
subject: string;
|
|
56
|
+
grant: Grant;
|
|
57
|
+
actor: Actor | null;
|
|
58
|
+
at: string;
|
|
59
|
+
} | {
|
|
60
|
+
type: "grant.revoked";
|
|
61
|
+
subject: string;
|
|
62
|
+
grant: Grant;
|
|
63
|
+
actor: Actor | null;
|
|
64
|
+
reason?: string;
|
|
65
|
+
at: string;
|
|
66
|
+
} | {
|
|
67
|
+
type: "role.changed";
|
|
68
|
+
subject: string;
|
|
69
|
+
role: string | null;
|
|
70
|
+
previous: string | null;
|
|
71
|
+
record: SubjectRecord;
|
|
72
|
+
actor: Actor | null;
|
|
73
|
+
reason?: string;
|
|
74
|
+
at: string;
|
|
75
|
+
} | {
|
|
76
|
+
type: "relationship.written";
|
|
77
|
+
subject: string;
|
|
78
|
+
relationship: Relationship;
|
|
79
|
+
actor: Actor | null;
|
|
80
|
+
at: string;
|
|
81
|
+
} | {
|
|
82
|
+
type: "relationship.deleted";
|
|
83
|
+
subject: string;
|
|
84
|
+
relationship: Relationship;
|
|
85
|
+
actor: Actor | null;
|
|
86
|
+
reason?: string;
|
|
87
|
+
at: string;
|
|
88
|
+
};
|
|
89
|
+
/** The discriminant strings of {@link BeforeEvent} / {@link AfterEvent}. */
|
|
90
|
+
export type BeforeEventType = BeforeEvent["type"];
|
|
91
|
+
export type AfterEventType = AfterEvent["type"];
|
|
92
|
+
export { HookDeniedError, normalizeHooks, runAfter, runBefore } from "@xtandard/kit/hooks";
|
|
93
|
+
/** A hook: implement either side or both. */
|
|
94
|
+
export type PermissionsHooks = Hooks<BeforeEvent, AfterEvent>;
|
|
95
|
+
/** Accepts a single hook, an array, or nothing. */
|
|
96
|
+
export type PermissionsHooksInput = HooksInput<BeforeEvent, AfterEvent>;
|
|
97
|
+
/** Reports an error thrown by an `after` hook. */
|
|
98
|
+
export type HookErrorReporter = KitHookErrorReporter<AfterEvent>;
|
|
99
|
+
/** Default `after`-hook error reporter: warn with the `[@xtandard/permissions]` prefix, never throw. */
|
|
100
|
+
export declare const defaultHookErrorReporter: HookErrorReporter;
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Key layout (ADR 0003). Pure string helpers; every id segment is
|
|
3
|
+
* `encodeURIComponent`-ed, so any subject id or permission name is safe in a
|
|
4
|
+
* key and can't contain the `/` separator.
|
|
5
|
+
*
|
|
6
|
+
* ```txt
|
|
7
|
+
* perm/grants/{subject}/{permission} -> Grant one key per pair: unique on every driver
|
|
8
|
+
* perm/subjects/{subject} -> SubjectRecord optional role assignment + display fields
|
|
9
|
+
* perm/history/{subject}/{at}-{id} -> HistoryEntry append-only; sortable by the last segment
|
|
10
|
+
*
|
|
11
|
+
* perm/rel/{objectType}/{objectId}/{relation}/{subject} -> Relationship
|
|
12
|
+
* perm/relrev/{subjectType}/{subjectId}/{subjectRel}/{objectType}/{objectId}/{relation}
|
|
13
|
+
* -> RelationshipRef
|
|
14
|
+
* ```
|
|
15
|
+
*
|
|
16
|
+
* Relationships (ADR 0013): one forward key per tuple (unique on every driver, so writes are
|
|
17
|
+
* idempotent), read by `(object, relation)` with one prefix scan; the reverse key serves
|
|
18
|
+
* `listObjects` (every tuple naming a subject, plain or as a userset). `{subject}` is the whole
|
|
19
|
+
* subject reference (`user:ana`, `group:eng#member`, `user:*`) as one segment; `{subjectRel}` is
|
|
20
|
+
* `_` for a plain subject or a wildcard and `#{relation}` (encoded `%23…`) for a userset, so it
|
|
21
|
+
* can't collide with a relation named `_`.
|
|
22
|
+
*
|
|
23
|
+
* @module
|
|
24
|
+
*/
|
|
25
|
+
/** Root namespace of every key. */
|
|
26
|
+
export declare const ROOT = "perm";
|
|
27
|
+
/** Prefix of every grant. */
|
|
28
|
+
export declare const grantsPrefix: () => string;
|
|
29
|
+
/** Prefix of one subject's grants. */
|
|
30
|
+
export declare const subjectGrantsPrefix: (subject: string) => string;
|
|
31
|
+
/** One grant. */
|
|
32
|
+
export declare const grantKey: (subject: string, permission: string) => string;
|
|
33
|
+
/** Prefix of every subject record. */
|
|
34
|
+
export declare const subjectsPrefix: () => string;
|
|
35
|
+
/** One subject record. */
|
|
36
|
+
export declare const subjectKey: (subject: string) => string;
|
|
37
|
+
/** Prefix of the whole history log. */
|
|
38
|
+
export declare const historyPrefix: () => string;
|
|
39
|
+
/** Prefix of one subject's history. */
|
|
40
|
+
export declare const subjectHistoryPrefix: (subject: string) => string;
|
|
41
|
+
/** One history entry: the last segment (`{at}-{id}`) sorts by time. */
|
|
42
|
+
export declare const historyKey: (subject: string, at: string, id: string) => string;
|
|
43
|
+
/** Prefix of every relationship (forward keys). */
|
|
44
|
+
export declare const relationshipsPrefix: () => string;
|
|
45
|
+
/** Prefix of one object type's relationships. */
|
|
46
|
+
export declare const relationshipTypePrefix: (type: string) => string;
|
|
47
|
+
/** Prefix of one object's relationships (`doc:1`). */
|
|
48
|
+
export declare const objectRelationshipsPrefix: (object: string) => string;
|
|
49
|
+
/** Prefix of the subjects stored on `(object, relation)`: what a tuple reader scans. */
|
|
50
|
+
export declare const relationSubjectsPrefix: (object: string, relation: string) => string;
|
|
51
|
+
/** One relationship's forward key. */
|
|
52
|
+
export declare const relationshipKey: (object: string, relation: string, subject: string) => string;
|
|
53
|
+
/** Prefix of every reverse key. */
|
|
54
|
+
export declare const reverseRelationshipsPrefix: () => string;
|
|
55
|
+
/** Prefix of the reverse keys of one subject object (`user:ana`), plain and as any userset. */
|
|
56
|
+
export declare const subjectObjectReversePrefix: (object: string) => string;
|
|
57
|
+
/** Prefix of the reverse keys of exactly `subject` (`user:ana`, `user:*`, `group:eng#member`). */
|
|
58
|
+
export declare const subjectReversePrefix: (subject: string) => string;
|
|
59
|
+
/** One relationship's reverse key. */
|
|
60
|
+
export declare const reverseRelationshipKey: (object: string, relation: string, subject: string) => string;
|
|
61
|
+
/** A forward key back to its tuple; `null` when it is not one. */
|
|
62
|
+
export declare function parseRelationshipKey(key: string): {
|
|
63
|
+
object: string;
|
|
64
|
+
relation: string;
|
|
65
|
+
subject: string;
|
|
66
|
+
} | null;
|
|
67
|
+
/** A reverse key back to its tuple; `null` when it is not one. */
|
|
68
|
+
export declare function parseReverseRelationshipKey(key: string): {
|
|
69
|
+
object: string;
|
|
70
|
+
relation: string;
|
|
71
|
+
subject: string;
|
|
72
|
+
} | null;
|
|
73
|
+
/** The decoded segments after the root's area (`grants`, `subjects`, `history`). */
|
|
74
|
+
export declare function parseKey(key: string): {
|
|
75
|
+
area: "grants" | "subjects" | "history";
|
|
76
|
+
subject: string;
|
|
77
|
+
rest?: string;
|
|
78
|
+
} | null;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The one place `@xtandard/lib/policy/permix` (and its `permix` peer) and
|
|
3
|
+
* `@xtandard/lib/policy/rebac` are imported. Every other module imports the policy primitives from here, so
|
|
4
|
+
* moving from the local link to the published `@xtandard/lib` range is a
|
|
5
|
+
* one-line change in `package.json`.
|
|
6
|
+
*
|
|
7
|
+
* @module
|
|
8
|
+
*/
|
|
9
|
+
export { AsyncRuleError, asyncRule, checkRulesAtPathAsync, isAsyncRule, checkRulesAtPath, defineAuthorization, hasAssignedPermission, hasPermission, toPermissionSet, } from "@xtandard/lib/policy/permix";
|
|
10
|
+
export type { Ability, AsyncRule, DefaultUser, AbilityFacts, Authorization, AuthorizationConfig, CheckExplanation, CheckerFn, Definition, PermissionPath, RuleContext, RuleHelpers, Rules, RulesPaths, UnknownCheckResult, } from "@xtandard/lib/policy/permix";
|
|
11
|
+
export type { DataAtPath } from "permix";
|
|
12
|
+
export { computed, createMemoryTuples, createRelationChecker, defineRelations, direct, exclusion, from, hasRelation, incomingEdges, intersection, isAllowedTuple, RelationDepthError, relationEdges, RelationSchemaError, union, } from "@xtandard/lib/policy/rebac";
|
|
13
|
+
export type { ComputedRelation, DirectRelation, ExclusionRelation, FromRelation, IntersectionRelation, MemoryTuples, ObjectRef, RelationChecker, RelationCheckerOptions, RelationEdge, RelationExplanation, RelationExpr, RelationQuery, RelationSchema, RelationTuple, SubjectRef, TupleReadContext, TupleReader, UnionRelation, } from "@xtandard/lib/policy/rebac";
|
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Relationships (ReBAC, ADR 0013): the tuple store, the tuple reader the lib's checker plugs into,
|
|
3
|
+
* `checkRelation`, `listObjects`, `listRelationSubjects` and the synchronous preload for rules.
|
|
4
|
+
* **The lib evaluates** (`@xtandard/lib/policy/rebac`: schema, `check`, `explain`, reverse edges);
|
|
5
|
+
* this module stores, indexes and lists. The engine (`createPermissions`) mixes these methods in.
|
|
6
|
+
*
|
|
7
|
+
* Storage: one forward key per tuple, `perm/rel/{objectType}/{objectId}/{relation}/{subject}`
|
|
8
|
+
* (unique on every driver, so writes are idempotent), plus a reverse key per tuple under
|
|
9
|
+
* `perm/relrev/{subjectType}/{subjectId}/{_ | #relation}/…` for listing. A write sets the forward
|
|
10
|
+
* key, then the reverse key; a delete removes the reverse key, then the forward key. So a crash
|
|
11
|
+
* between the two leaves a forward key without its reverse (listing misses the tuple; checks still
|
|
12
|
+
* see it), never the other way round; `repairRelationships()` restores the invariant.
|
|
13
|
+
*
|
|
14
|
+
* @module
|
|
15
|
+
*/
|
|
16
|
+
import type { Actor } from "@xtandard/kit/util";
|
|
17
|
+
import { type HookErrorReporter, type PermissionsHooks } from "./hooks/contract.ts";
|
|
18
|
+
import { type ObjectRef, type RelationExplanation, type RelationExpr, type RelationSchema, type RelationTuple, type SubjectRef, type TupleReadContext } from "./policy.ts";
|
|
19
|
+
import { type HistoryEntry, type Relationship, type RelationshipInput, type RelationshipPage, type RelationshipQuery } from "./schema.ts";
|
|
20
|
+
import { type PermissionsStorage } from "./storage/contract.ts";
|
|
21
|
+
/** A relationship check: does `subject` have `relation` on `object`? */
|
|
22
|
+
export interface RelationCheckQuery<S extends RelationSchema = RelationSchema> {
|
|
23
|
+
/** `"user:ana"`, or a userset such as `"group:eng#member"`. */
|
|
24
|
+
subject: SubjectRef<S>;
|
|
25
|
+
/** A relation of the object's type. */
|
|
26
|
+
relation: string;
|
|
27
|
+
/** `"doc:1"`. */
|
|
28
|
+
object: ObjectRef<S>;
|
|
29
|
+
}
|
|
30
|
+
/** What `checkRelation()` returns: the lib's explanation (the chain of relations that granted it). */
|
|
31
|
+
export type RelationCheckResult = RelationExplanation;
|
|
32
|
+
/** Query of `listObjects()`: the objects of `type` on which `subject` has `relation`. */
|
|
33
|
+
export interface ListObjectsQuery<S extends RelationSchema = RelationSchema> {
|
|
34
|
+
subject: SubjectRef<S>;
|
|
35
|
+
relation: string;
|
|
36
|
+
type: keyof S & string;
|
|
37
|
+
}
|
|
38
|
+
/** Query of `listRelationSubjects()`: who has `relation` on `object`. */
|
|
39
|
+
export interface ListRelationSubjectsQuery<S extends RelationSchema = RelationSchema> {
|
|
40
|
+
object: ObjectRef<S>;
|
|
41
|
+
relation: string;
|
|
42
|
+
/** Only subjects of this type (`"user"`). */
|
|
43
|
+
type?: keyof S & string;
|
|
44
|
+
}
|
|
45
|
+
/** What `writeRelationship()` returns. */
|
|
46
|
+
export interface WriteRelationshipResult {
|
|
47
|
+
relationship: Relationship;
|
|
48
|
+
/** `false` when the tuple was already stored (no history, no hooks). */
|
|
49
|
+
created: boolean;
|
|
50
|
+
}
|
|
51
|
+
/** What `deleteRelationship()` returns. */
|
|
52
|
+
export interface DeleteRelationshipResult {
|
|
53
|
+
/** `false` when there was nothing to delete. */
|
|
54
|
+
removed: boolean;
|
|
55
|
+
relationship: Relationship | null;
|
|
56
|
+
}
|
|
57
|
+
/** What `repairRelationships()` found and fixed. */
|
|
58
|
+
export interface RepairReport {
|
|
59
|
+
/** Forward keys scanned. */
|
|
60
|
+
scanned: number;
|
|
61
|
+
/** Reverse keys written for forward keys that had none. */
|
|
62
|
+
restored: number;
|
|
63
|
+
/** Reverse keys removed because their forward key is gone. */
|
|
64
|
+
removed: number;
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* Relationships preloaded for synchronous checks (inside permix rules, which stay synchronous,
|
|
68
|
+
* ADR 0005). Built by `loadRelations(objects)`: every tuple of those objects and of every object
|
|
69
|
+
* reachable from them (usersets, `from` parents) is in memory, so checks against those objects
|
|
70
|
+
* need no I/O. A check against an object that was not loaded sees no tuples (denied).
|
|
71
|
+
*/
|
|
72
|
+
export interface RelationFacts<S extends RelationSchema = RelationSchema> {
|
|
73
|
+
/** `true` when `subject` has `relation` on `object` (synchronous). */
|
|
74
|
+
check(query: RelationCheckQuery<S>): boolean;
|
|
75
|
+
/** `check` with the chain of relations that granted it. */
|
|
76
|
+
explain(query: RelationCheckQuery<S>): RelationExplanation;
|
|
77
|
+
/** Shorthand for rules: `relation("user:ana", "editor", "doc:1")`. */
|
|
78
|
+
relation(subject: SubjectRef<S>, relation: string, object: ObjectRef<S>): boolean;
|
|
79
|
+
/** The loaded tuples. */
|
|
80
|
+
tuples(): RelationTuple[];
|
|
81
|
+
}
|
|
82
|
+
/** Options of `loadRelations()`. */
|
|
83
|
+
export interface LoadRelationsOptions {
|
|
84
|
+
/** Stop after loading this many objects (default 1 000). */
|
|
85
|
+
maxObjects?: number;
|
|
86
|
+
}
|
|
87
|
+
/** ReBAC options of the engine. */
|
|
88
|
+
export interface RelationsOptions {
|
|
89
|
+
/** Maximum relation hops per check and per listing walk (the lib's `maxDepth`). Default 25. */
|
|
90
|
+
maxDepth?: number;
|
|
91
|
+
}
|
|
92
|
+
/** The relationship methods of the engine. */
|
|
93
|
+
export interface RelationshipsApi<S extends RelationSchema = RelationSchema> {
|
|
94
|
+
/**
|
|
95
|
+
* Store a relationship. Validated against the catalog's relation schema (`isAllowedTuple`).
|
|
96
|
+
* Idempotent: a stored tuple comes back with `created: false` (no history, no hooks).
|
|
97
|
+
*
|
|
98
|
+
* @throws {RelationSchemaError} no `relations` in the catalog, or a tuple the schema doesn't
|
|
99
|
+
* allow. `ValidationError` malformed input. `ReadonlyError`.
|
|
100
|
+
*/
|
|
101
|
+
writeRelationship(input: RelationshipInput): Promise<WriteRelationshipResult>;
|
|
102
|
+
/** Delete a relationship. Idempotent (`removed: false` when absent). */
|
|
103
|
+
deleteRelationship(input: RelationshipInput): Promise<DeleteRelationshipResult>;
|
|
104
|
+
/**
|
|
105
|
+
* Stored relationships by object (`doc:1`, or a bare type `doc`), relation and/or subject,
|
|
106
|
+
* sorted by key (object type, id, relation, subject), paginated by `cursor`.
|
|
107
|
+
*/
|
|
108
|
+
readRelationships(query?: RelationshipQuery): Promise<RelationshipPage>;
|
|
109
|
+
/** Does `subject` have `relation` on `object`? With the chain of relations that decided it. */
|
|
110
|
+
checkRelation(query: RelationCheckQuery<S>, context?: TupleReadContext): Promise<RelationCheckResult>;
|
|
111
|
+
/**
|
|
112
|
+
* The objects of `type` on which `subject` has `relation`, sorted: a walk backwards over the
|
|
113
|
+
* reverse index (bounded by `maxDepth`); candidates reached through an intersection or an
|
|
114
|
+
* exclusion are confirmed with `checkRelation`.
|
|
115
|
+
*/
|
|
116
|
+
listObjects(query: ListObjectsQuery<S>): Promise<string[]>;
|
|
117
|
+
/**
|
|
118
|
+
* The subjects (plain objects and `type:*` wildcards; usersets are expanded) that have
|
|
119
|
+
* `relation` on `object`, sorted. Candidates under an intersection or an exclusion are
|
|
120
|
+
* confirmed with `checkRelation`.
|
|
121
|
+
*/
|
|
122
|
+
listRelationSubjects(query: ListRelationSubjectsQuery<S>): Promise<string[]>;
|
|
123
|
+
/** Preload the tuples around `objects` for synchronous checks (see {@link RelationFacts}). */
|
|
124
|
+
loadRelations(objects: readonly ObjectRef<S>[], options?: LoadRelationsOptions): Promise<RelationFacts<S>>;
|
|
125
|
+
/** Restore the forward ⊇ reverse key invariant after a crash or a partial copy. */
|
|
126
|
+
repairRelationships(): Promise<RepairReport>;
|
|
127
|
+
}
|
|
128
|
+
/** What the engine hands this module. */
|
|
129
|
+
export interface RelationshipsDeps {
|
|
130
|
+
storage: PermissionsStorage;
|
|
131
|
+
schema: RelationSchema | null;
|
|
132
|
+
options: RelationsOptions | undefined;
|
|
133
|
+
hooks: PermissionsHooks[];
|
|
134
|
+
onHookError: HookErrorReporter;
|
|
135
|
+
nowIso: () => string;
|
|
136
|
+
assertWritable: (operation: string) => void;
|
|
137
|
+
withLock: <T>(key: string, fn: () => Promise<T>) => Promise<T>;
|
|
138
|
+
appendHistory: (entry: Omit<HistoryEntry, "id" | "at">, at: string) => Promise<void>;
|
|
139
|
+
toActor: (actor: string | Actor | null | undefined) => Actor | null;
|
|
140
|
+
}
|
|
141
|
+
/** Build the relationship methods over the engine's plumbing. */
|
|
142
|
+
export declare function createRelationships<S extends RelationSchema>(deps: RelationshipsDeps): RelationshipsApi<S>;
|
|
143
|
+
/** One relation of a type, as the panel shows it. */
|
|
144
|
+
export interface RelationView {
|
|
145
|
+
name: string;
|
|
146
|
+
/**
|
|
147
|
+
* What may be stored on it (`"user"`, `"group#member"`, `"user:*"`); empty for a relation that
|
|
148
|
+
* is only computed (it can't be written).
|
|
149
|
+
*/
|
|
150
|
+
subjects: string[];
|
|
151
|
+
/** A one-line rendering of the rule: `[user, group#member] or editor or viewer from parent`. */
|
|
152
|
+
rule: string;
|
|
153
|
+
}
|
|
154
|
+
/** One object type and its relations. */
|
|
155
|
+
export interface RelationTypeView {
|
|
156
|
+
type: string;
|
|
157
|
+
relations: RelationView[];
|
|
158
|
+
}
|
|
159
|
+
/** Render a relation expression on one line. */
|
|
160
|
+
export declare function describeRelation(expr: RelationExpr): string;
|
|
161
|
+
/** The relation schema as plain data (types, relations, writable subject types, rules). */
|
|
162
|
+
export declare function relationSchemaView(schema: RelationSchema): RelationTypeView[];
|
|
@@ -0,0 +1,299 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The data model (what is stored and what checks return) and the valibot
|
|
3
|
+
* schemas of the engine's write inputs. The engine validates every write with
|
|
4
|
+
* them, and the HTTP layer reuses them for request bodies.
|
|
5
|
+
*
|
|
6
|
+
* @module schema
|
|
7
|
+
*/
|
|
8
|
+
import type { Actor } from "@xtandard/kit/util";
|
|
9
|
+
import * as v from "valibot";
|
|
10
|
+
import type { CheckExplanation } from "./policy.ts";
|
|
11
|
+
export type { Actor };
|
|
12
|
+
/** A permission granted to one subject. Stored at `perm/grants/{subject}/{permission}`. */
|
|
13
|
+
export interface Grant<P extends string = string> {
|
|
14
|
+
/** The subject id. */
|
|
15
|
+
subject: string;
|
|
16
|
+
/** The permission (one of the catalog's `assignable`). */
|
|
17
|
+
permission: P;
|
|
18
|
+
/** The actor id that granted it: plain data, never a reference (ADR 0003). */
|
|
19
|
+
grantedBy: string | null;
|
|
20
|
+
/** ISO-8601. */
|
|
21
|
+
grantedAt: string;
|
|
22
|
+
/** Why it was granted. */
|
|
23
|
+
reason?: string;
|
|
24
|
+
/** ISO-8601; the grant stops counting at this instant. `null` / absent: never expires. */
|
|
25
|
+
expiresAt?: string | null;
|
|
26
|
+
}
|
|
27
|
+
/** Optional per-subject data. Stored at `perm/subjects/{subject}`. */
|
|
28
|
+
export interface SubjectRecord {
|
|
29
|
+
id: string;
|
|
30
|
+
/** A stored role assignment; when absent, the auth provider's role (or `defaultRole`) applies. */
|
|
31
|
+
role?: string;
|
|
32
|
+
name?: string;
|
|
33
|
+
email?: string;
|
|
34
|
+
/** ISO-8601. */
|
|
35
|
+
updatedAt: string;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* A stored relationship (ReBAC tuple, ADR 0013): `subject` has `relation` on `object`. Stored at
|
|
39
|
+
* `perm/rel/{objectType}/{objectId}/{relation}/{subject}`, plus a reverse key for listing.
|
|
40
|
+
*/
|
|
41
|
+
export interface Relationship {
|
|
42
|
+
/** The object: `"doc:1"`. */
|
|
43
|
+
object: string;
|
|
44
|
+
/** A relation of the object's type: `"viewer"`. */
|
|
45
|
+
relation: string;
|
|
46
|
+
/** Who: `"user:ana"`, a userset `"group:eng#member"`, or a wildcard `"user:*"`. */
|
|
47
|
+
subject: string;
|
|
48
|
+
/** The actor id that wrote it: plain data, never a reference (ADR 0003). */
|
|
49
|
+
createdBy: string | null;
|
|
50
|
+
/** ISO-8601. */
|
|
51
|
+
createdAt: string;
|
|
52
|
+
/** Why it was written. */
|
|
53
|
+
reason?: string;
|
|
54
|
+
}
|
|
55
|
+
/** The kinds of {@link HistoryEntry}. */
|
|
56
|
+
export type HistoryType = "grant" | "revoke" | "role" | "relate" | "unrelate";
|
|
57
|
+
/**
|
|
58
|
+
* One append-only history entry. Stored at `perm/history/{subject}/{at}-{id}`; for `relate` /
|
|
59
|
+
* `unrelate` the subject is the tuple's subject reference (`user:ana`, `group:eng#member`).
|
|
60
|
+
*/
|
|
61
|
+
export interface HistoryEntry {
|
|
62
|
+
id: string;
|
|
63
|
+
type: HistoryType;
|
|
64
|
+
subject: string;
|
|
65
|
+
/** For `relate` / `unrelate`: the tuple's object. */
|
|
66
|
+
object?: string;
|
|
67
|
+
/** For `relate` / `unrelate`: the tuple's relation. */
|
|
68
|
+
relation?: string;
|
|
69
|
+
/** For `grant` / `revoke`. */
|
|
70
|
+
permission?: string;
|
|
71
|
+
/** For `role`: the new role, `null` when the assignment was cleared. */
|
|
72
|
+
role?: string | null;
|
|
73
|
+
/** For `role`: the role before the change (`null`: none was stored). */
|
|
74
|
+
previousRole?: string | null;
|
|
75
|
+
/** For `grant`: the expiry the grant was created with. */
|
|
76
|
+
expiresAt?: string | null;
|
|
77
|
+
/** The actor id. */
|
|
78
|
+
actor: string | null;
|
|
79
|
+
reason?: string;
|
|
80
|
+
/** ISO-8601. */
|
|
81
|
+
at: string;
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* Why a check came out the way it did (ADR 0005):
|
|
85
|
+
*
|
|
86
|
+
* - `grant`: `directGrants` is on and a non-expired grant named like the path allowed it;
|
|
87
|
+
* - `role-rule`: the role's rule allowed it;
|
|
88
|
+
* - `denied-by-rule`: the role's rule denied it (a `false` constant or a predicate that did not
|
|
89
|
+
* return `true`);
|
|
90
|
+
* - `rule-threw`: the rule threw (denied);
|
|
91
|
+
* - `unknown-path`: the role has no rule at that path (denied).
|
|
92
|
+
*/
|
|
93
|
+
export type CheckReason = "grant" | "role-rule" | "denied-by-rule" | "rule-threw" | "unknown-path";
|
|
94
|
+
/** The outcome of `check()`. */
|
|
95
|
+
export interface CheckResult<R extends string = string, P extends string = string> {
|
|
96
|
+
allowed: boolean;
|
|
97
|
+
/** The permix path, e.g. `"post.publish"`. */
|
|
98
|
+
path: string;
|
|
99
|
+
/** The subject id, `null` for a guest. */
|
|
100
|
+
subject: string | null;
|
|
101
|
+
/** The effective role the rules ran as. */
|
|
102
|
+
role: R;
|
|
103
|
+
reason: CheckReason;
|
|
104
|
+
/** The lib's `explain()` detail of the rule alone (role, permissions seen, what decided). */
|
|
105
|
+
explanation: CheckExplanation<R, P>;
|
|
106
|
+
}
|
|
107
|
+
/** The serializable state a client needs to rebuild a subject's ability (React, SSR). */
|
|
108
|
+
export interface PermissionsSnapshot<R extends string = string, P extends string = string> {
|
|
109
|
+
subject: {
|
|
110
|
+
id: string | null;
|
|
111
|
+
role: R;
|
|
112
|
+
};
|
|
113
|
+
/** The non-expired, assignable granted permissions. */
|
|
114
|
+
permissions: P[];
|
|
115
|
+
}
|
|
116
|
+
/** Who performs a write: an actor id, an {@link Actor}, or `null` (system). */
|
|
117
|
+
export declare const actorSchema: v.NullableSchema<v.UnionSchema<[v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, "must not be empty">]>, v.ObjectSchema<{
|
|
118
|
+
readonly id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, "must not be empty">]>;
|
|
119
|
+
readonly type: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
120
|
+
readonly name: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
121
|
+
readonly email: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
122
|
+
}, undefined>], undefined>, undefined>;
|
|
123
|
+
/** Input of `grant()`. */
|
|
124
|
+
export declare const grantInputSchema: v.ObjectSchema<{
|
|
125
|
+
readonly subject: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, "must not be empty">]>;
|
|
126
|
+
readonly permission: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, "must not be empty">]>;
|
|
127
|
+
readonly actor: v.OptionalSchema<v.NullableSchema<v.UnionSchema<[v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, "must not be empty">]>, v.ObjectSchema<{
|
|
128
|
+
readonly id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, "must not be empty">]>;
|
|
129
|
+
readonly type: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
130
|
+
readonly name: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
131
|
+
readonly email: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
132
|
+
}, undefined>], undefined>, undefined>, undefined>;
|
|
133
|
+
readonly reason: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MaxLengthAction<string, 1000, "must be at most 1000 characters">]>, undefined>;
|
|
134
|
+
/** ISO string, `Date` or unix ms; `null` = never. */
|
|
135
|
+
readonly expiresAt: v.OptionalSchema<v.NullableSchema<v.UnionSchema<[v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.CheckAction<string, "must be an ISO-8601 date">]>, v.SchemaWithPipe<readonly [v.DateSchema<undefined>, v.CheckAction<Date, "must be a valid date">]>, v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.FiniteAction<number, undefined>]>], undefined>, undefined>, undefined>;
|
|
136
|
+
}, undefined>;
|
|
137
|
+
/** Input of `revoke()`. */
|
|
138
|
+
export declare const revokeInputSchema: v.ObjectSchema<{
|
|
139
|
+
readonly subject: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, "must not be empty">]>;
|
|
140
|
+
readonly permission: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, "must not be empty">]>;
|
|
141
|
+
readonly actor: v.OptionalSchema<v.NullableSchema<v.UnionSchema<[v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, "must not be empty">]>, v.ObjectSchema<{
|
|
142
|
+
readonly id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, "must not be empty">]>;
|
|
143
|
+
readonly type: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
144
|
+
readonly name: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
145
|
+
readonly email: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
146
|
+
}, undefined>], undefined>, undefined>, undefined>;
|
|
147
|
+
readonly reason: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MaxLengthAction<string, 1000, "must be at most 1000 characters">]>, undefined>;
|
|
148
|
+
}, undefined>;
|
|
149
|
+
/** Input of `setRole()`; `role: null` clears the stored assignment. */
|
|
150
|
+
export declare const setRoleInputSchema: v.ObjectSchema<{
|
|
151
|
+
readonly subject: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, "must not be empty">]>;
|
|
152
|
+
readonly role: v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, "must not be empty">]>, undefined>;
|
|
153
|
+
readonly actor: v.OptionalSchema<v.NullableSchema<v.UnionSchema<[v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, "must not be empty">]>, v.ObjectSchema<{
|
|
154
|
+
readonly id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, "must not be empty">]>;
|
|
155
|
+
readonly type: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
156
|
+
readonly name: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
157
|
+
readonly email: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
158
|
+
}, undefined>], undefined>, undefined>, undefined>;
|
|
159
|
+
readonly reason: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MaxLengthAction<string, 1000, "must be at most 1000 characters">]>, undefined>;
|
|
160
|
+
}, undefined>;
|
|
161
|
+
/** Input of `upsertSubject()`. `null` clears a field. */
|
|
162
|
+
export declare const upsertSubjectInputSchema: v.ObjectSchema<{
|
|
163
|
+
readonly id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, "must not be empty">]>;
|
|
164
|
+
readonly name: v.OptionalSchema<v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MaxLengthAction<string, 500, undefined>]>, undefined>, undefined>;
|
|
165
|
+
readonly email: v.OptionalSchema<v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MaxLengthAction<string, 500, undefined>]>, undefined>, undefined>;
|
|
166
|
+
}, undefined>;
|
|
167
|
+
/** Query of `list()`. */
|
|
168
|
+
export declare const listQuerySchema: v.ObjectSchema<{
|
|
169
|
+
readonly subject: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, "must not be empty">]>, undefined>;
|
|
170
|
+
readonly permission: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, "must not be empty">]>, undefined>;
|
|
171
|
+
readonly includeExpired: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
|
|
172
|
+
}, undefined>;
|
|
173
|
+
/** Input of `writeRelationship()` / `deleteRelationship()`. */
|
|
174
|
+
export declare const relationshipInputSchema: v.ObjectSchema<{
|
|
175
|
+
readonly object: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MaxLengthAction<string, 512, "must be at most 512 characters">, v.RegexAction<string, "must be \"type:id\" (no \"#\" in the id)">]>;
|
|
176
|
+
readonly relation: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, "must not be empty">]>;
|
|
177
|
+
readonly subject: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MaxLengthAction<string, 512, "must be at most 512 characters">, v.RegexAction<string, "must be \"type:id\", \"type:id#relation\" or \"type:*\"">]>;
|
|
178
|
+
readonly actor: v.OptionalSchema<v.NullableSchema<v.UnionSchema<[v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, "must not be empty">]>, v.ObjectSchema<{
|
|
179
|
+
readonly id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, "must not be empty">]>;
|
|
180
|
+
readonly type: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
181
|
+
readonly name: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
182
|
+
readonly email: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
183
|
+
}, undefined>], undefined>, undefined>, undefined>;
|
|
184
|
+
readonly reason: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MaxLengthAction<string, 1000, "must be at most 1000 characters">]>, undefined>;
|
|
185
|
+
}, undefined>;
|
|
186
|
+
/** Query of `readRelationships()`. */
|
|
187
|
+
export declare const relationshipQuerySchema: v.ObjectSchema<{
|
|
188
|
+
/** `type:id`, or just `type` for every object of a type. */
|
|
189
|
+
readonly object: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, "must not be empty">]>, undefined>;
|
|
190
|
+
readonly relation: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, "must not be empty">]>, undefined>;
|
|
191
|
+
readonly subject: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MaxLengthAction<string, 512, "must be at most 512 characters">, v.RegexAction<string, "must be \"type:id\", \"type:id#relation\" or \"type:*\"">]>, undefined>;
|
|
192
|
+
readonly limit: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 1, undefined>, v.MaxValueAction<number, 1000, undefined>]>, undefined>;
|
|
193
|
+
readonly cursor: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
194
|
+
}, undefined>;
|
|
195
|
+
/** Input of `checkRelation()`. */
|
|
196
|
+
export declare const relationCheckSchema: v.ObjectSchema<{
|
|
197
|
+
readonly subject: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MaxLengthAction<string, 512, "must be at most 512 characters">, v.RegexAction<string, "must be \"type:id\", \"type:id#relation\" or \"type:*\"">]>;
|
|
198
|
+
readonly relation: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, "must not be empty">]>;
|
|
199
|
+
readonly object: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MaxLengthAction<string, 512, "must be at most 512 characters">, v.RegexAction<string, "must be \"type:id\" (no \"#\" in the id)">]>;
|
|
200
|
+
}, undefined>;
|
|
201
|
+
/** Query of `listObjects()`. */
|
|
202
|
+
export declare const listObjectsQuerySchema: v.ObjectSchema<{
|
|
203
|
+
readonly subject: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MaxLengthAction<string, 512, "must be at most 512 characters">, v.RegexAction<string, "must be \"type:id\", \"type:id#relation\" or \"type:*\"">]>;
|
|
204
|
+
readonly relation: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, "must not be empty">]>;
|
|
205
|
+
readonly type: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, "must not be empty">]>;
|
|
206
|
+
}, undefined>;
|
|
207
|
+
/** Query of `listRelationSubjects()`. */
|
|
208
|
+
export declare const listRelationSubjectsQuerySchema: v.ObjectSchema<{
|
|
209
|
+
readonly object: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MaxLengthAction<string, 512, "must be at most 512 characters">, v.RegexAction<string, "must be \"type:id\" (no \"#\" in the id)">]>;
|
|
210
|
+
readonly relation: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, "must not be empty">]>;
|
|
211
|
+
/** Only subjects of this type. */
|
|
212
|
+
readonly type: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, "must not be empty">]>, undefined>;
|
|
213
|
+
}, undefined>;
|
|
214
|
+
/** Query of `history()`. */
|
|
215
|
+
export declare const historyQuerySchema: v.ObjectSchema<{
|
|
216
|
+
readonly subject: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, "must not be empty">]>, undefined>;
|
|
217
|
+
readonly limit: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 1, undefined>, v.MaxValueAction<number, 1000, undefined>]>, undefined>;
|
|
218
|
+
readonly cursor: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
219
|
+
}, undefined>;
|
|
220
|
+
/** An ISO string, `Date` or unix ms. */
|
|
221
|
+
export type InstantInput = string | Date | number;
|
|
222
|
+
/** Input of `grant()`, typed with the catalog's permissions. */
|
|
223
|
+
export interface GrantInput<P extends string = string> {
|
|
224
|
+
subject: string;
|
|
225
|
+
permission: P;
|
|
226
|
+
actor?: string | Actor | null;
|
|
227
|
+
reason?: string;
|
|
228
|
+
/** When the grant stops counting; `null` / absent = never. */
|
|
229
|
+
expiresAt?: InstantInput | null;
|
|
230
|
+
}
|
|
231
|
+
/** Input of `revoke()`. */
|
|
232
|
+
export interface RevokeInput<P extends string = string> {
|
|
233
|
+
subject: string;
|
|
234
|
+
permission: P;
|
|
235
|
+
actor?: string | Actor | null;
|
|
236
|
+
reason?: string;
|
|
237
|
+
}
|
|
238
|
+
/** Input of `setRole()`. */
|
|
239
|
+
export interface SetRoleInput<R extends string = string> {
|
|
240
|
+
subject: string;
|
|
241
|
+
/** `null` clears the stored role (the auth provider's role, or `defaultRole`, applies again). */
|
|
242
|
+
role: R | null;
|
|
243
|
+
actor?: string | Actor | null;
|
|
244
|
+
reason?: string;
|
|
245
|
+
}
|
|
246
|
+
/** Input of `upsertSubject()`. A field left out is kept; `null` clears it. */
|
|
247
|
+
export interface UpsertSubjectInput {
|
|
248
|
+
id: string;
|
|
249
|
+
name?: string | null;
|
|
250
|
+
email?: string | null;
|
|
251
|
+
}
|
|
252
|
+
/** Query of `list()`. Neither: every grant. */
|
|
253
|
+
export interface ListQuery<P extends string = string> {
|
|
254
|
+
subject?: string;
|
|
255
|
+
permission?: P;
|
|
256
|
+
/** Include grants whose `expiresAt` has passed. Default `false`. */
|
|
257
|
+
includeExpired?: boolean;
|
|
258
|
+
}
|
|
259
|
+
/** Query of `history()`. */
|
|
260
|
+
export interface HistoryQuery {
|
|
261
|
+
/** One subject's history; absent = everyone's. */
|
|
262
|
+
subject?: string;
|
|
263
|
+
/** Page size, 1–1000. Default 50. */
|
|
264
|
+
limit?: number;
|
|
265
|
+
/** The `nextCursor` of the previous page. */
|
|
266
|
+
cursor?: string;
|
|
267
|
+
}
|
|
268
|
+
/** Input of `writeRelationship()` / `deleteRelationship()`. */
|
|
269
|
+
export interface RelationshipInput {
|
|
270
|
+
object: string;
|
|
271
|
+
relation: string;
|
|
272
|
+
subject: string;
|
|
273
|
+
actor?: string | Actor | null;
|
|
274
|
+
reason?: string;
|
|
275
|
+
}
|
|
276
|
+
/** Query of `readRelationships()`. Every field narrows; none: every relationship. */
|
|
277
|
+
export interface RelationshipQuery {
|
|
278
|
+
/** `"doc:1"`, or a bare type (`"doc"`) for every object of that type. */
|
|
279
|
+
object?: string;
|
|
280
|
+
relation?: string;
|
|
281
|
+
/** Exactly this subject reference (`user:ana`, `group:eng#member`, `user:*`). */
|
|
282
|
+
subject?: string;
|
|
283
|
+
/** Page size, 1–1000. Default 100. */
|
|
284
|
+
limit?: number;
|
|
285
|
+
/** The `nextCursor` of the previous page. */
|
|
286
|
+
cursor?: string;
|
|
287
|
+
}
|
|
288
|
+
/** A page of relationships, sorted by object, relation, subject. */
|
|
289
|
+
export interface RelationshipPage {
|
|
290
|
+
relationships: Relationship[];
|
|
291
|
+
/** Pass as `cursor` for the next page; `null` at the end. */
|
|
292
|
+
nextCursor: string | null;
|
|
293
|
+
}
|
|
294
|
+
/** A page of history, newest first. */
|
|
295
|
+
export interface HistoryPage {
|
|
296
|
+
entries: HistoryEntry[];
|
|
297
|
+
/** Pass as `cursor` for the next (older) page; `null` at the end. */
|
|
298
|
+
nextCursor: string | null;
|
|
299
|
+
}
|