@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.
Files changed (375) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +362 -2
  3. package/bin/xtandard-permissions.mjs +3 -0
  4. package/dist/better-auth-Bp9YVyQa.d.cts +56 -0
  5. package/dist/better-auth-DHyW5-yt.cjs +91 -0
  6. package/dist/better-auth-DHyW5-yt.cjs.map +1 -0
  7. package/dist/better-auth-NO40ZqSM.mjs +74 -0
  8. package/dist/better-auth-NO40ZqSM.mjs.map +1 -0
  9. package/dist/better-auth-NSXgt6ZU.d.mts +56 -0
  10. package/dist/catalog-DA_d1SdC.d.cts +153 -0
  11. package/dist/catalog-DJcJ3ycq.d.mts +153 -0
  12. package/dist/catalog.cjs +198 -0
  13. package/dist/catalog.cjs.map +1 -0
  14. package/dist/catalog.d.cts +3 -0
  15. package/dist/catalog.d.mts +3 -0
  16. package/dist/catalog.mjs +141 -0
  17. package/dist/catalog.mjs.map +1 -0
  18. package/dist/chunk-DakpK96I.cjs +43 -0
  19. package/dist/cli.cjs +548 -0
  20. package/dist/cli.cjs.map +1 -0
  21. package/dist/cli.d.cts +28 -0
  22. package/dist/cli.d.mts +28 -0
  23. package/dist/cli.mjs +544 -0
  24. package/dist/cli.mjs.map +1 -0
  25. package/dist/contract-BMiOmg2f.d.cts +50 -0
  26. package/dist/contract-Bpy8yPrS.cjs +70 -0
  27. package/dist/contract-Bpy8yPrS.cjs.map +1 -0
  28. package/dist/contract-CNgMXr2u.d.cts +46 -0
  29. package/dist/contract-CNgMXr2u.d.mts +46 -0
  30. package/dist/contract-CPmJVoRx.cjs +70 -0
  31. package/dist/contract-CPmJVoRx.cjs.map +1 -0
  32. package/dist/contract-D32H1t0u.d.mts +50 -0
  33. package/dist/contract-DTdTXZtJ.mjs +47 -0
  34. package/dist/contract-DTdTXZtJ.mjs.map +1 -0
  35. package/dist/contract-DUzgB-He.d.mts +375 -0
  36. package/dist/contract-Dk6d2ylD.d.cts +375 -0
  37. package/dist/contract-RMkmERhT.d.cts +2 -0
  38. package/dist/contract-RMkmERhT.d.mts +2 -0
  39. package/dist/contract-Yc5AZuvv.mjs +47 -0
  40. package/dist/contract-Yc5AZuvv.mjs.map +1 -0
  41. package/dist/create-fetch-handler-BHDU4chu.d.mts +77 -0
  42. package/dist/create-fetch-handler-BtX64_rS.d.cts +77 -0
  43. package/dist/create-fetch-handler-C-WyaRCR.cjs +653 -0
  44. package/dist/create-fetch-handler-C-WyaRCR.cjs.map +1 -0
  45. package/dist/create-fetch-handler-ojjpk1Iw.mjs +636 -0
  46. package/dist/create-fetch-handler-ojjpk1Iw.mjs.map +1 -0
  47. package/dist/elysia-shared-BM6cPoCU.mjs +78 -0
  48. package/dist/elysia-shared-BM6cPoCU.mjs.map +1 -0
  49. package/dist/elysia-shared-BUTFTeal.cjs +101 -0
  50. package/dist/elysia-shared-BUTFTeal.cjs.map +1 -0
  51. package/dist/elysia-shared-DtKViycb.d.cts +58 -0
  52. package/dist/elysia-shared-g8zsb_pU.d.mts +58 -0
  53. package/dist/engine-Bufv0TbD.mjs +574 -0
  54. package/dist/engine-Bufv0TbD.mjs.map +1 -0
  55. package/dist/engine-CGGVDCqi.d.cts +296 -0
  56. package/dist/engine-DpFIcbgh.d.mts +296 -0
  57. package/dist/engine-bMoz3iW-.cjs +587 -0
  58. package/dist/engine-bMoz3iW-.cjs.map +1 -0
  59. package/dist/entry-auth-basic.cjs +40 -0
  60. package/dist/entry-auth-basic.cjs.map +1 -0
  61. package/dist/entry-auth-basic.d.cts +24 -0
  62. package/dist/entry-auth-basic.d.mts +24 -0
  63. package/dist/entry-auth-basic.mjs +26 -0
  64. package/dist/entry-auth-basic.mjs.map +1 -0
  65. package/dist/entry-auth-better-auth.cjs +12 -0
  66. package/dist/entry-auth-better-auth.d.cts +5 -0
  67. package/dist/entry-auth-better-auth.d.mts +5 -0
  68. package/dist/entry-auth-better-auth.mjs +4 -0
  69. package/dist/entry-auth-delegated.cjs +8 -0
  70. package/dist/entry-auth-delegated.d.cts +2 -0
  71. package/dist/entry-auth-delegated.d.mts +2 -0
  72. package/dist/entry-auth-delegated.mjs +2 -0
  73. package/dist/entry-auth-jwt.cjs +116 -0
  74. package/dist/entry-auth-jwt.cjs.map +1 -0
  75. package/dist/entry-auth-jwt.d.cts +65 -0
  76. package/dist/entry-auth-jwt.d.mts +65 -0
  77. package/dist/entry-auth-jwt.mjs +108 -0
  78. package/dist/entry-auth-jwt.mjs.map +1 -0
  79. package/dist/entry-auth-none.cjs +14 -0
  80. package/dist/entry-auth-none.d.cts +2 -0
  81. package/dist/entry-auth-none.d.mts +2 -0
  82. package/dist/entry-auth-none.mjs +2 -0
  83. package/dist/entry-auth-session.cjs +82 -0
  84. package/dist/entry-auth-session.cjs.map +1 -0
  85. package/dist/entry-auth-session.d.cts +20 -0
  86. package/dist/entry-auth-session.d.mts +20 -0
  87. package/dist/entry-auth-session.mjs +75 -0
  88. package/dist/entry-auth-session.mjs.map +1 -0
  89. package/dist/entry-authorization-delegated.cjs +31 -0
  90. package/dist/entry-authorization-delegated.cjs.map +1 -0
  91. package/dist/entry-authorization-delegated.d.cts +27 -0
  92. package/dist/entry-authorization-delegated.d.mts +27 -0
  93. package/dist/entry-authorization-delegated.mjs +30 -0
  94. package/dist/entry-authorization-delegated.mjs.map +1 -0
  95. package/dist/entry-authorization-none.cjs +29 -0
  96. package/dist/entry-authorization-none.cjs.map +1 -0
  97. package/dist/entry-authorization-none.d.cts +17 -0
  98. package/dist/entry-authorization-none.d.mts +17 -0
  99. package/dist/entry-authorization-none.mjs +28 -0
  100. package/dist/entry-authorization-none.mjs.map +1 -0
  101. package/dist/entry-authorization-permissions.cjs +4 -0
  102. package/dist/entry-authorization-permissions.d.cts +49 -0
  103. package/dist/entry-authorization-permissions.d.mts +49 -0
  104. package/dist/entry-authorization-permissions.mjs +2 -0
  105. package/dist/entry-authorization-roles.cjs +9 -0
  106. package/dist/entry-authorization-roles.d.cts +37 -0
  107. package/dist/entry-authorization-roles.d.mts +37 -0
  108. package/dist/entry-authorization-roles.mjs +3 -0
  109. package/dist/entry-better-auth-client.cjs +31 -0
  110. package/dist/entry-better-auth-client.cjs.map +1 -0
  111. package/dist/entry-better-auth-client.d.cts +63 -0
  112. package/dist/entry-better-auth-client.d.mts +63 -0
  113. package/dist/entry-better-auth-client.mjs +29 -0
  114. package/dist/entry-better-auth-client.mjs.map +1 -0
  115. package/dist/entry-better-auth.cjs +289 -0
  116. package/dist/entry-better-auth.cjs.map +1 -0
  117. package/dist/entry-better-auth.d.cts +3 -0
  118. package/dist/entry-better-auth.d.mts +3 -0
  119. package/dist/entry-better-auth.mjs +284 -0
  120. package/dist/entry-better-auth.mjs.map +1 -0
  121. package/dist/entry-bridges-audit.cjs +106 -0
  122. package/dist/entry-bridges-audit.cjs.map +1 -0
  123. package/dist/entry-bridges-audit.d.cts +58 -0
  124. package/dist/entry-bridges-audit.d.mts +58 -0
  125. package/dist/entry-bridges-audit.mjs +105 -0
  126. package/dist/entry-bridges-audit.mjs.map +1 -0
  127. package/dist/entry-bridges-webhooks.cjs +90 -0
  128. package/dist/entry-bridges-webhooks.cjs.map +1 -0
  129. package/dist/entry-bridges-webhooks.d.cts +46 -0
  130. package/dist/entry-bridges-webhooks.d.mts +46 -0
  131. package/dist/entry-bridges-webhooks.mjs +88 -0
  132. package/dist/entry-bridges-webhooks.mjs.map +1 -0
  133. package/dist/entry-bun.cjs +33 -0
  134. package/dist/entry-bun.cjs.map +1 -0
  135. package/dist/entry-bun.d.cts +31 -0
  136. package/dist/entry-bun.d.mts +31 -0
  137. package/dist/entry-bun.mjs +30 -0
  138. package/dist/entry-bun.mjs.map +1 -0
  139. package/dist/entry-drizzle-mysql.cjs +34 -0
  140. package/dist/entry-drizzle-mysql.cjs.map +1 -0
  141. package/dist/entry-drizzle-mysql.d.cts +20 -0
  142. package/dist/entry-drizzle-mysql.d.mts +20 -0
  143. package/dist/entry-drizzle-mysql.mjs +33 -0
  144. package/dist/entry-drizzle-mysql.mjs.map +1 -0
  145. package/dist/entry-drizzle-pg.cjs +44 -0
  146. package/dist/entry-drizzle-pg.cjs.map +1 -0
  147. package/dist/entry-drizzle-pg.d.cts +20 -0
  148. package/dist/entry-drizzle-pg.d.mts +20 -0
  149. package/dist/entry-drizzle-pg.mjs +43 -0
  150. package/dist/entry-drizzle-pg.mjs.map +1 -0
  151. package/dist/entry-drizzle-sqlite.cjs +34 -0
  152. package/dist/entry-drizzle-sqlite.cjs.map +1 -0
  153. package/dist/entry-drizzle-sqlite.d.cts +15 -0
  154. package/dist/entry-drizzle-sqlite.d.mts +15 -0
  155. package/dist/entry-drizzle-sqlite.mjs +33 -0
  156. package/dist/entry-drizzle-sqlite.mjs.map +1 -0
  157. package/dist/entry-elysia.cjs +117 -0
  158. package/dist/entry-elysia.cjs.map +1 -0
  159. package/dist/entry-elysia.d.cts +446 -0
  160. package/dist/entry-elysia.d.mts +446 -0
  161. package/dist/entry-elysia.mjs +113 -0
  162. package/dist/entry-elysia.mjs.map +1 -0
  163. package/dist/entry-elysia2.cjs +117 -0
  164. package/dist/entry-elysia2.cjs.map +1 -0
  165. package/dist/entry-elysia2.d.cts +571 -0
  166. package/dist/entry-elysia2.d.mts +571 -0
  167. package/dist/entry-elysia2.mjs +113 -0
  168. package/dist/entry-elysia2.mjs.map +1 -0
  169. package/dist/entry-express.cjs +101 -0
  170. package/dist/entry-express.cjs.map +1 -0
  171. package/dist/entry-express.d.cts +36 -0
  172. package/dist/entry-express.d.mts +36 -0
  173. package/dist/entry-express.mjs +97 -0
  174. package/dist/entry-express.mjs.map +1 -0
  175. package/dist/entry-hono.cjs +63 -0
  176. package/dist/entry-hono.cjs.map +1 -0
  177. package/dist/entry-hono.d.cts +40 -0
  178. package/dist/entry-hono.d.mts +40 -0
  179. package/dist/entry-hono.mjs +60 -0
  180. package/dist/entry-hono.mjs.map +1 -0
  181. package/dist/entry-hooks-log.cjs +39 -0
  182. package/dist/entry-hooks-log.cjs.map +1 -0
  183. package/dist/entry-hooks-log.d.cts +19 -0
  184. package/dist/entry-hooks-log.d.mts +19 -0
  185. package/dist/entry-hooks-log.mjs +36 -0
  186. package/dist/entry-hooks-log.mjs.map +1 -0
  187. package/dist/entry-next.cjs +67 -0
  188. package/dist/entry-next.cjs.map +1 -0
  189. package/dist/entry-next.d.cts +60 -0
  190. package/dist/entry-next.d.mts +60 -0
  191. package/dist/entry-next.mjs +57 -0
  192. package/dist/entry-next.mjs.map +1 -0
  193. package/dist/entry-react.cjs +401 -0
  194. package/dist/entry-react.cjs.map +1 -0
  195. package/dist/entry-react.d.cts +206 -0
  196. package/dist/entry-react.d.mts +206 -0
  197. package/dist/entry-react.mjs +388 -0
  198. package/dist/entry-react.mjs.map +1 -0
  199. package/dist/entry-storage-cloudflare-kv.cjs +8 -0
  200. package/dist/entry-storage-cloudflare-kv.d.cts +2 -0
  201. package/dist/entry-storage-cloudflare-kv.d.mts +2 -0
  202. package/dist/entry-storage-cloudflare-kv.mjs +2 -0
  203. package/dist/entry-storage-drizzle.cjs +71 -0
  204. package/dist/entry-storage-drizzle.cjs.map +1 -0
  205. package/dist/entry-storage-drizzle.d.cts +27 -0
  206. package/dist/entry-storage-drizzle.d.mts +27 -0
  207. package/dist/entry-storage-drizzle.mjs +68 -0
  208. package/dist/entry-storage-drizzle.mjs.map +1 -0
  209. package/dist/entry-storage-file.cjs +54 -0
  210. package/dist/entry-storage-file.cjs.map +1 -0
  211. package/dist/entry-storage-file.d.cts +24 -0
  212. package/dist/entry-storage-file.d.mts +24 -0
  213. package/dist/entry-storage-file.mjs +46 -0
  214. package/dist/entry-storage-file.mjs.map +1 -0
  215. package/dist/entry-storage-libsql.cjs +64 -0
  216. package/dist/entry-storage-libsql.cjs.map +1 -0
  217. package/dist/entry-storage-libsql.d.cts +28 -0
  218. package/dist/entry-storage-libsql.d.mts +28 -0
  219. package/dist/entry-storage-libsql.mjs +61 -0
  220. package/dist/entry-storage-libsql.mjs.map +1 -0
  221. package/dist/entry-storage-memory.cjs +3 -0
  222. package/dist/entry-storage-memory.d.cts +25 -0
  223. package/dist/entry-storage-memory.d.mts +25 -0
  224. package/dist/entry-storage-memory.mjs +2 -0
  225. package/dist/entry-storage-mongodb.cjs +61 -0
  226. package/dist/entry-storage-mongodb.cjs.map +1 -0
  227. package/dist/entry-storage-mongodb.d.cts +25 -0
  228. package/dist/entry-storage-mongodb.d.mts +25 -0
  229. package/dist/entry-storage-mongodb.mjs +58 -0
  230. package/dist/entry-storage-mongodb.mjs.map +1 -0
  231. package/dist/entry-storage-postgres.cjs +62 -0
  232. package/dist/entry-storage-postgres.cjs.map +1 -0
  233. package/dist/entry-storage-postgres.d.cts +29 -0
  234. package/dist/entry-storage-postgres.d.mts +29 -0
  235. package/dist/entry-storage-postgres.mjs +58 -0
  236. package/dist/entry-storage-postgres.mjs.map +1 -0
  237. package/dist/entry-storage-redis.cjs +76 -0
  238. package/dist/entry-storage-redis.cjs.map +1 -0
  239. package/dist/entry-storage-redis.d.cts +29 -0
  240. package/dist/entry-storage-redis.d.mts +29 -0
  241. package/dist/entry-storage-redis.mjs +72 -0
  242. package/dist/entry-storage-redis.mjs.map +1 -0
  243. package/dist/entry-storage-sqlite.cjs +46 -0
  244. package/dist/entry-storage-sqlite.cjs.map +1 -0
  245. package/dist/entry-storage-sqlite.d.cts +22 -0
  246. package/dist/entry-storage-sqlite.d.mts +22 -0
  247. package/dist/entry-storage-sqlite.mjs +43 -0
  248. package/dist/entry-storage-sqlite.mjs.map +1 -0
  249. package/dist/entry-storage-unstorage.cjs +8 -0
  250. package/dist/entry-storage-unstorage.d.cts +2 -0
  251. package/dist/entry-storage-unstorage.d.mts +2 -0
  252. package/dist/entry-storage-unstorage.mjs +2 -0
  253. package/dist/error-codes-9MRMSSMQ.cjs +49 -0
  254. package/dist/error-codes-9MRMSSMQ.cjs.map +1 -0
  255. package/dist/error-codes-CCKuDDu7.mjs +44 -0
  256. package/dist/error-codes-CCKuDDu7.mjs.map +1 -0
  257. package/dist/errors-bL3XQLfE.mjs +54 -0
  258. package/dist/errors-bL3XQLfE.mjs.map +1 -0
  259. package/dist/errors-vVYic8gz.cjs +89 -0
  260. package/dist/errors-vVYic8gz.cjs.map +1 -0
  261. package/dist/events-AE4Ytqmz.d.cts +6 -0
  262. package/dist/events-AE4Ytqmz.d.mts +6 -0
  263. package/dist/events-DYZShrYB.mjs +15 -0
  264. package/dist/events-DYZShrYB.mjs.map +1 -0
  265. package/dist/events-FJ2K0wly.cjs +26 -0
  266. package/dist/events-FJ2K0wly.cjs.map +1 -0
  267. package/dist/guard-BOx5cnMP.mjs +141 -0
  268. package/dist/guard-BOx5cnMP.mjs.map +1 -0
  269. package/dist/guard-C3o7V14m.d.cts +62 -0
  270. package/dist/guard-DCbTnqPz.d.mts +62 -0
  271. package/dist/guard-nwdOYe90.cjs +188 -0
  272. package/dist/guard-nwdOYe90.cjs.map +1 -0
  273. package/dist/index-BVVgDSdq.d.cts +1 -0
  274. package/dist/index-BVVgDSdq.d.mts +1 -0
  275. package/dist/index.cjs +240 -0
  276. package/dist/index.cjs.map +1 -0
  277. package/dist/index.d.cts +195 -0
  278. package/dist/index.d.mts +195 -0
  279. package/dist/index.mjs +60 -0
  280. package/dist/index.mjs.map +1 -0
  281. package/dist/kit-C7tepDB2.cjs +76 -0
  282. package/dist/kit-C7tepDB2.cjs.map +1 -0
  283. package/dist/kit-DMVBLBI9.d.mts +57 -0
  284. package/dist/kit-fzXHYb1l.mjs +65 -0
  285. package/dist/kit-fzXHYb1l.mjs.map +1 -0
  286. package/dist/kit-qAROuhOI.d.cts +57 -0
  287. package/dist/memory-BbBbbY8-.mjs +32 -0
  288. package/dist/memory-BbBbbY8-.mjs.map +1 -0
  289. package/dist/memory-knijqKw_.cjs +39 -0
  290. package/dist/memory-knijqKw_.cjs.map +1 -0
  291. package/dist/permissions-C9PjftY6.mjs +59 -0
  292. package/dist/permissions-C9PjftY6.mjs.map +1 -0
  293. package/dist/permissions-Cxri_P_k.cjs +70 -0
  294. package/dist/permissions-Cxri_P_k.cjs.map +1 -0
  295. package/dist/policy-BQmlo2lu.mjs +3 -0
  296. package/dist/policy-CGA6QD0a.d.mts +4 -0
  297. package/dist/policy-DFq_SYR3.d.cts +4 -0
  298. package/dist/react-embed.js +18710 -0
  299. package/dist/react.css +1 -0
  300. package/dist/relationships-BLYEJ9tc.cjs +907 -0
  301. package/dist/relationships-BLYEJ9tc.cjs.map +1 -0
  302. package/dist/relationships-BfLonEMI.mjs +756 -0
  303. package/dist/relationships-BfLonEMI.mjs.map +1 -0
  304. package/dist/roles-DBk4i8b5.mjs +69 -0
  305. package/dist/roles-DBk4i8b5.mjs.map +1 -0
  306. package/dist/roles-a8B5uZ35.cjs +104 -0
  307. package/dist/roles-a8B5uZ35.cjs.map +1 -0
  308. package/dist/rolldown-runtime-D7D4PA-g.mjs +13 -0
  309. package/dist/routes-DtRb3EO0.mjs +1001 -0
  310. package/dist/routes-DtRb3EO0.mjs.map +1 -0
  311. package/dist/routes-irNuuZqo.cjs +1049 -0
  312. package/dist/routes-irNuuZqo.cjs.map +1 -0
  313. package/dist/server-C2F4H6bR.d.cts +886 -0
  314. package/dist/server-CJ7AIJpO.d.mts +886 -0
  315. package/dist/table-DA98mVVT.d.cts +2 -0
  316. package/dist/table-DA98mVVT.d.mts +2 -0
  317. package/dist/testing.cjs +59 -0
  318. package/dist/testing.cjs.map +1 -0
  319. package/dist/testing.d.cts +37 -0
  320. package/dist/testing.d.mts +37 -0
  321. package/dist/testing.mjs +57 -0
  322. package/dist/testing.mjs.map +1 -0
  323. package/dist/types-elysia2/adapters/elysia-shared.d.ts +71 -0
  324. package/dist/types-elysia2/adapters/elysia2.d.ts +432 -0
  325. package/dist/types-elysia2/adapters/guard.d.ts +140 -0
  326. package/dist/types-elysia2/auth/contract.d.ts +9 -0
  327. package/dist/types-elysia2/auth-provider/contract.d.ts +57 -0
  328. package/dist/types-elysia2/auth-provider/kit.d.ts +57 -0
  329. package/dist/types-elysia2/authorization/contract.d.ts +53 -0
  330. package/dist/types-elysia2/authorization/permissions.d.ts +54 -0
  331. package/dist/types-elysia2/catalog.d.ts +197 -0
  332. package/dist/types-elysia2/engine.d.ts +192 -0
  333. package/dist/types-elysia2/entry-elysia2.d.ts +9 -0
  334. package/dist/types-elysia2/errors.d.ts +47 -0
  335. package/dist/types-elysia2/hooks/contract.d.ts +100 -0
  336. package/dist/types-elysia2/keys.d.ts +78 -0
  337. package/dist/types-elysia2/policy.d.ts +13 -0
  338. package/dist/types-elysia2/relationships.d.ts +162 -0
  339. package/dist/types-elysia2/schema.d.ts +299 -0
  340. package/dist/types-elysia2/server/cors.d.ts +8 -0
  341. package/dist/types-elysia2/server/create-fetch-handler.d.ts +87 -0
  342. package/dist/types-elysia2/server/openapi.d.ts +29 -0
  343. package/dist/types-elysia2/server/routes.d.ts +132 -0
  344. package/dist/types-elysia2/server/validation.d.ts +205 -0
  345. package/dist/types-elysia2/storage/contract.d.ts +18 -0
  346. package/dist/types-react/catalog.d.ts +197 -0
  347. package/dist/types-react/engine.d.ts +192 -0
  348. package/dist/types-react/entry-react-embed.d.ts +20 -0
  349. package/dist/types-react/errors.d.ts +47 -0
  350. package/dist/types-react/hooks/contract.d.ts +100 -0
  351. package/dist/types-react/keys.d.ts +78 -0
  352. package/dist/types-react/policy.d.ts +13 -0
  353. package/dist/types-react/react-embed.d.ts +37 -0
  354. package/dist/types-react/relationships.d.ts +162 -0
  355. package/dist/types-react/schema.d.ts +299 -0
  356. package/dist/types-react/storage/contract.d.ts +18 -0
  357. package/dist/types-react/ui/App.d.ts +23 -0
  358. package/dist/types-react/ui/api.d.ts +73 -0
  359. package/dist/types-react/ui/components/perm-bits.d.ts +64 -0
  360. package/dist/types-react/ui/lib/queries.d.ts +46 -0
  361. package/dist/types-react/ui/theme.d.ts +10 -0
  362. package/dist/types-react/ui/types.d.ts +109 -0
  363. package/dist/types-react/ui/views/CatalogView.d.ts +3 -0
  364. package/dist/types-react/ui/views/HistoryView.d.ts +6 -0
  365. package/dist/types-react/ui/views/PlaygroundView.d.ts +14 -0
  366. package/dist/types-react/ui/views/RelationshipsView.d.ts +6 -0
  367. package/dist/types-react/ui/views/SubjectDetailView.d.ts +7 -0
  368. package/dist/types-react/ui/views/SubjectsView.d.ts +6 -0
  369. package/dist/ui/apple-touch-icon.png +0 -0
  370. package/dist/ui/assets/index-DCPZRo-Z.css +1 -0
  371. package/dist/ui/assets/index-uXGOtyuj.js +104 -0
  372. package/dist/ui/favicon.ico +0 -0
  373. package/dist/ui/favicon.svg +15 -0
  374. package/dist/ui/index.html +20 -0
  375. package/package.json +587 -4
@@ -0,0 +1,108 @@
1
+ import { i as stringField, n as normalizeRoles, r as splitRoles, t as identity } from "./contract-Yc5AZuvv.mjs";
2
+ import { n as toKitAuth, t as subjectOf } from "./kit-fzXHYb1l.mjs";
3
+ import { importPeer } from "@xtandard/kit/storage";
4
+ //#region src/auth-provider/jwt.ts
5
+ /**
6
+ * A Bearer / cookie JWT as a {@link PermissionsAuthProvider} (ADR 0006), verified with `jose` (an
7
+ * optional peer, imported on first use): an HS256 shared secret, or a JWKS (remote URL or inline
8
+ * key set) for asymmetric tokens from an identity provider.
9
+ *
10
+ * An invalid, expired or wrongly-signed token is "no session" (`null` → guest / 401), never a 500.
11
+ * A JWKS endpoint that times out is an error (500): it says nothing about the caller.
12
+ *
13
+ * @module
14
+ */
15
+ const SUBPATH = "@xtandard/permissions/auth/jwt";
16
+ /** The token of a request: the Bearer header first, then the cookie. */
17
+ function readToken(request, options) {
18
+ if (options.header !== false) {
19
+ const match = /^Bearer\s+(\S+)\s*$/i.exec(request.headers.get("authorization") ?? "");
20
+ if (match) return match[1];
21
+ }
22
+ if (options.cookie) for (const part of (request.headers.get("cookie") ?? "").split(";")) {
23
+ const eq = part.indexOf("=");
24
+ if (eq === -1 || part.slice(0, eq).trim() !== options.cookie) continue;
25
+ const value = part.slice(eq + 1).trim();
26
+ if (!value) return null;
27
+ try {
28
+ return decodeURIComponent(value);
29
+ } catch {
30
+ return value;
31
+ }
32
+ }
33
+ return null;
34
+ }
35
+ /** The default claims → identity mapping. */
36
+ function defaultMap(claims, roleClaim) {
37
+ const id = stringField(claims, "sub");
38
+ if (!id) return null;
39
+ return identity({
40
+ id,
41
+ role: roleClaim ? claims[roleClaim] : claims.role ?? claims.roles,
42
+ name: stringField(claims, "name"),
43
+ email: stringField(claims, "email")
44
+ });
45
+ }
46
+ /** True for a `jose` error that means "this token is not valid" (not an infrastructure failure). */
47
+ function isInvalidToken(jose, error) {
48
+ return error instanceof jose.errors.JOSEError && !(error instanceof jose.errors.JWKSTimeout);
49
+ }
50
+ /**
51
+ * A {@link PermissionsAuthProvider} that verifies a JWT from the request.
52
+ *
53
+ * @example
54
+ * ```ts
55
+ * import { jwtProvider } from "@xtandard/permissions/auth/jwt";
56
+ *
57
+ * jwtProvider({ secret: process.env.JWT_SECRET!, issuer: "my-app", cookie: "token" });
58
+ * jwtProvider({ jwks: "https://idp.example.com/.well-known/jwks.json", audience: "api" });
59
+ * ```
60
+ */
61
+ function jwtProvider(options) {
62
+ if (!options.secret && !options.jwks) throw new TypeError("jwtProvider: pass `secret` (HS256) or `jwks`");
63
+ if (options.secret && options.jwks) throw new TypeError("jwtProvider: pass either `secret` or `jwks`, not both");
64
+ let ready;
65
+ const load = () => (ready ??= importPeer("jose", SUBPATH, () => import("jose")).then((jose) => {
66
+ let key;
67
+ if (options.secret !== void 0) key = typeof options.secret === "string" ? new TextEncoder().encode(options.secret) : options.secret;
68
+ else if (typeof options.jwks === "string" || options.jwks instanceof URL) key = jose.createRemoteJWKSet(new URL(options.jwks));
69
+ else key = jose.createLocalJWKSet(options.jwks);
70
+ return {
71
+ jose,
72
+ key
73
+ };
74
+ })).catch((error) => {
75
+ ready = void 0;
76
+ throw error;
77
+ });
78
+ const algorithms = options.algorithms ?? (options.secret !== void 0 ? ["HS256"] : void 0);
79
+ const verifyOptions = {};
80
+ if (algorithms) verifyOptions.algorithms = algorithms;
81
+ if (options.issuer !== void 0) verifyOptions.issuer = options.issuer;
82
+ if (options.audience !== void 0) verifyOptions.audience = options.audience;
83
+ if (options.clockTolerance !== void 0) verifyOptions.clockTolerance = options.clockTolerance;
84
+ const provider = { async getSubject(request) {
85
+ const token = readToken(request, options);
86
+ if (!token) return null;
87
+ const { jose, key } = await load();
88
+ let claims;
89
+ try {
90
+ claims = (await jose.jwtVerify(token, key, verifyOptions)).payload;
91
+ } catch (error) {
92
+ if (isInvalidToken(jose, error)) return null;
93
+ throw error;
94
+ }
95
+ const mapped = options.map ? options.map(claims, request) : defaultMap(claims, options.roleClaim);
96
+ if (!mapped) return null;
97
+ return identity({
98
+ ...mapped,
99
+ role: normalizeRoles(mapped.role, options.mapRole)
100
+ });
101
+ } };
102
+ if (options.canManage) provider.canManage = options.canManage;
103
+ return provider;
104
+ }
105
+ //#endregion
106
+ export { identity, jwtProvider, normalizeRoles, readToken, splitRoles, stringField, subjectOf, toKitAuth };
107
+
108
+ //# sourceMappingURL=entry-auth-jwt.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"entry-auth-jwt.mjs","names":[],"sources":["../src/auth-provider/jwt.ts"],"sourcesContent":["/**\n * A Bearer / cookie JWT as a {@link PermissionsAuthProvider} (ADR 0006), verified with `jose` (an\n * optional peer, imported on first use): an HS256 shared secret, or a JWKS (remote URL or inline\n * key set) for asymmetric tokens from an identity provider.\n *\n * An invalid, expired or wrongly-signed token is \"no session\" (`null` → guest / 401), never a 500.\n * A JWKS endpoint that times out is an error (500): it says nothing about the caller.\n *\n * @module\n */\n\nimport { importPeer } from \"@xtandard/kit/storage\";\nimport {\n identity,\n normalizeRoles,\n stringField,\n type PermissionsAuthProvider,\n type ProviderRoleOptions,\n type SubjectIdentity,\n} from \"./contract.ts\";\n\n/** Verified JWT claims. */\nexport type JwtClaims = Record<string, unknown> & {\n sub?: string;\n iss?: string;\n aud?: string | string[];\n exp?: number;\n iat?: number;\n};\n\n/** A JSON Web Key Set (`{ keys: [...] }`). */\nexport interface JsonWebKeySet {\n keys: Record<string, unknown>[];\n}\n\ninterface JwtProviderBase extends ProviderRoleOptions {\n /** Expected `iss`. */\n issuer?: string | string[];\n /** Expected `aud`. */\n audience?: string | string[];\n /** Accepted algorithms. Default: `[\"HS256\"]` with `secret`; the key set's with `jwks`. */\n algorithms?: string[];\n /** Clock skew tolerance, seconds or a `jose` duration string (`\"30s\"`). */\n clockTolerance?: number | string;\n /** Read the token from this cookie when there is no `Authorization: Bearer` header. */\n cookie?: string;\n /** Read `Authorization: Bearer <token>`. Default `true`. */\n header?: boolean;\n /** Claim holding the role(s). Default: `role`, then `roles`. */\n roleClaim?: string;\n /**\n * Map verified claims to a subject. Default: `sub` → id, the role claim, `name`, `email`.\n * Return `null` to treat a valid token as no session (e.g. a machine token without `sub`).\n */\n map?(claims: JwtClaims, request: Request): SubjectIdentity | null | undefined;\n}\n\n/** Options for {@link jwtProvider}: exactly one of `secret` or `jwks`. */\nexport type JwtProviderOptions =\n | (JwtProviderBase & { secret: string | Uint8Array; jwks?: never })\n | (JwtProviderBase & { jwks: string | URL | JsonWebKeySet; secret?: never });\n\ntype Jose = typeof import(\"jose\");\ntype VerifyKey = Parameters<Jose[\"jwtVerify\"]>[1];\n\nconst SUBPATH = \"@xtandard/permissions/auth/jwt\";\n\n/** The token of a request: the Bearer header first, then the cookie. */\nexport function readToken(\n request: Request,\n options: { cookie?: string | undefined; header?: boolean | undefined },\n): string | null {\n if (options.header !== false) {\n const match = /^Bearer\\s+(\\S+)\\s*$/i.exec(request.headers.get(\"authorization\") ?? \"\");\n if (match) return match[1]!;\n }\n if (options.cookie) {\n for (const part of (request.headers.get(\"cookie\") ?? \"\").split(\";\")) {\n const eq = part.indexOf(\"=\");\n if (eq === -1 || part.slice(0, eq).trim() !== options.cookie) continue;\n const value = part.slice(eq + 1).trim();\n if (!value) return null;\n try {\n return decodeURIComponent(value);\n } catch {\n return value;\n }\n }\n }\n return null;\n}\n\n/** The default claims → identity mapping. */\nfunction defaultMap(claims: JwtClaims, roleClaim: string | undefined): SubjectIdentity | null {\n const id = stringField(claims, \"sub\");\n if (!id) return null;\n const role = roleClaim ? claims[roleClaim] : (claims.role ?? claims.roles);\n return identity({\n id,\n role: role as string | string[] | undefined,\n name: stringField(claims, \"name\"),\n email: stringField(claims, \"email\"),\n });\n}\n\n/** True for a `jose` error that means \"this token is not valid\" (not an infrastructure failure). */\nfunction isInvalidToken(jose: Jose, error: unknown): boolean {\n return error instanceof jose.errors.JOSEError && !(error instanceof jose.errors.JWKSTimeout);\n}\n\n/**\n * A {@link PermissionsAuthProvider} that verifies a JWT from the request.\n *\n * @example\n * ```ts\n * import { jwtProvider } from \"@xtandard/permissions/auth/jwt\";\n *\n * jwtProvider({ secret: process.env.JWT_SECRET!, issuer: \"my-app\", cookie: \"token\" });\n * jwtProvider({ jwks: \"https://idp.example.com/.well-known/jwks.json\", audience: \"api\" });\n * ```\n */\nexport function jwtProvider(options: JwtProviderOptions): PermissionsAuthProvider {\n if (!options.secret && !options.jwks) {\n throw new TypeError(\"jwtProvider: pass `secret` (HS256) or `jwks`\");\n }\n if (options.secret && options.jwks) {\n throw new TypeError(\"jwtProvider: pass either `secret` or `jwks`, not both\");\n }\n let ready: Promise<{ jose: Jose; key: VerifyKey }> | undefined;\n const load = () =>\n (ready ??= importPeer(\"jose\", SUBPATH, () => import(\"jose\")).then((jose) => {\n let key: VerifyKey;\n if (options.secret !== undefined) {\n key =\n typeof options.secret === \"string\"\n ? new TextEncoder().encode(options.secret)\n : options.secret;\n } else if (typeof options.jwks === \"string\" || options.jwks instanceof URL) {\n key = jose.createRemoteJWKSet(new URL(options.jwks));\n } else {\n key = jose.createLocalJWKSet(options.jwks as Parameters<Jose[\"createLocalJWKSet\"]>[0]);\n }\n return { jose, key };\n })).catch((error: unknown) => {\n ready = undefined; // a missing peer may be installed later; don't cache the failure\n throw error;\n });\n\n const algorithms = options.algorithms ?? (options.secret !== undefined ? [\"HS256\"] : undefined);\n const verifyOptions: Record<string, unknown> = {};\n if (algorithms) verifyOptions.algorithms = algorithms;\n if (options.issuer !== undefined) verifyOptions.issuer = options.issuer;\n if (options.audience !== undefined) verifyOptions.audience = options.audience;\n if (options.clockTolerance !== undefined) verifyOptions.clockTolerance = options.clockTolerance;\n\n const provider: PermissionsAuthProvider = {\n async getSubject(request) {\n const token = readToken(request, options);\n if (!token) return null;\n const { jose, key } = await load();\n let claims: JwtClaims;\n try {\n claims = (await jose.jwtVerify(token, key, verifyOptions)).payload as JwtClaims;\n } catch (error) {\n if (isInvalidToken(jose, error)) return null;\n throw error;\n }\n const mapped = options.map\n ? options.map(claims, request)\n : defaultMap(claims, options.roleClaim);\n if (!mapped) return null;\n return identity({ ...mapped, role: normalizeRoles(mapped.role, options.mapRole) });\n },\n };\n if (options.canManage) provider.canManage = options.canManage;\n return provider;\n}\n"],"mappings":";;;;;;;;;;;;;;AAiEA,MAAM,UAAU;;AAGhB,SAAgB,UACd,SACA,SACe;CACf,IAAI,QAAQ,WAAW,OAAO;EAC5B,MAAM,QAAQ,uBAAuB,KAAK,QAAQ,QAAQ,IAAI,eAAe,KAAK,EAAE;EACpF,IAAI,OAAO,OAAO,MAAM;CAC1B;CACA,IAAI,QAAQ,QACV,KAAK,MAAM,SAAS,QAAQ,QAAQ,IAAI,QAAQ,KAAK,IAAI,MAAM,GAAG,GAAG;EACnE,MAAM,KAAK,KAAK,QAAQ,GAAG;EAC3B,IAAI,OAAO,MAAM,KAAK,MAAM,GAAG,EAAE,EAAE,KAAK,MAAM,QAAQ,QAAQ;EAC9D,MAAM,QAAQ,KAAK,MAAM,KAAK,CAAC,EAAE,KAAK;EACtC,IAAI,CAAC,OAAO,OAAO;EACnB,IAAI;GACF,OAAO,mBAAmB,KAAK;EACjC,QAAQ;GACN,OAAO;EACT;CACF;CAEF,OAAO;AACT;;AAGA,SAAS,WAAW,QAAmB,WAAuD;CAC5F,MAAM,KAAK,YAAY,QAAQ,KAAK;CACpC,IAAI,CAAC,IAAI,OAAO;CAEhB,OAAO,SAAS;EACd;EACA,MAHW,YAAY,OAAO,aAAc,OAAO,QAAQ,OAAO;EAIlE,MAAM,YAAY,QAAQ,MAAM;EAChC,OAAO,YAAY,QAAQ,OAAO;CACpC,CAAC;AACH;;AAGA,SAAS,eAAe,MAAY,OAAyB;CAC3D,OAAO,iBAAiB,KAAK,OAAO,aAAa,EAAE,iBAAiB,KAAK,OAAO;AAClF;;;;;;;;;;;;AAaA,SAAgB,YAAY,SAAsD;CAChF,IAAI,CAAC,QAAQ,UAAU,CAAC,QAAQ,MAC9B,MAAM,IAAI,UAAU,8CAA8C;CAEpE,IAAI,QAAQ,UAAU,QAAQ,MAC5B,MAAM,IAAI,UAAU,uDAAuD;CAE7E,IAAI;CACJ,MAAM,cACH,UAAU,WAAW,QAAQ,eAAe,OAAO,OAAO,EAAE,MAAM,SAAS;EAC1E,IAAI;EACJ,IAAI,QAAQ,WAAW,KAAA,GACrB,MACE,OAAO,QAAQ,WAAW,WACtB,IAAI,YAAY,EAAE,OAAO,QAAQ,MAAM,IACvC,QAAQ;OACT,IAAI,OAAO,QAAQ,SAAS,YAAY,QAAQ,gBAAgB,KACrE,MAAM,KAAK,mBAAmB,IAAI,IAAI,QAAQ,IAAI,CAAC;OAEnD,MAAM,KAAK,kBAAkB,QAAQ,IAAgD;EAEvF,OAAO;GAAE;GAAM;EAAI;CACrB,CAAC,GAAG,OAAO,UAAmB;EAC5B,QAAQ,KAAA;EACR,MAAM;CACR,CAAC;CAEH,MAAM,aAAa,QAAQ,eAAe,QAAQ,WAAW,KAAA,IAAY,CAAC,OAAO,IAAI,KAAA;CACrF,MAAM,gBAAyC,CAAC;CAChD,IAAI,YAAY,cAAc,aAAa;CAC3C,IAAI,QAAQ,WAAW,KAAA,GAAW,cAAc,SAAS,QAAQ;CACjE,IAAI,QAAQ,aAAa,KAAA,GAAW,cAAc,WAAW,QAAQ;CACrE,IAAI,QAAQ,mBAAmB,KAAA,GAAW,cAAc,iBAAiB,QAAQ;CAEjF,MAAM,WAAoC,EACxC,MAAM,WAAW,SAAS;EACxB,MAAM,QAAQ,UAAU,SAAS,OAAO;EACxC,IAAI,CAAC,OAAO,OAAO;EACnB,MAAM,EAAE,MAAM,QAAQ,MAAM,KAAK;EACjC,IAAI;EACJ,IAAI;GACF,UAAU,MAAM,KAAK,UAAU,OAAO,KAAK,aAAa,GAAG;EAC7D,SAAS,OAAO;GACd,IAAI,eAAe,MAAM,KAAK,GAAG,OAAO;GACxC,MAAM;EACR;EACA,MAAM,SAAS,QAAQ,MACnB,QAAQ,IAAI,QAAQ,OAAO,IAC3B,WAAW,QAAQ,QAAQ,SAAS;EACxC,IAAI,CAAC,QAAQ,OAAO;EACpB,OAAO,SAAS;GAAE,GAAG;GAAQ,MAAM,eAAe,OAAO,MAAM,QAAQ,OAAO;EAAE,CAAC;CACnF,EACF;CACA,IAAI,QAAQ,WAAW,SAAS,YAAY,QAAQ;CACpD,OAAO;AACT"}
@@ -0,0 +1,14 @@
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
+ let _xtandard_kit_auth_none = require("@xtandard/kit/auth/none");
3
+ Object.defineProperty(exports, "ANONYMOUS_PRINCIPAL", {
4
+ enumerable: true,
5
+ get: function() {
6
+ return _xtandard_kit_auth_none.ANONYMOUS_PRINCIPAL;
7
+ }
8
+ });
9
+ Object.defineProperty(exports, "noAuth", {
10
+ enumerable: true,
11
+ get: function() {
12
+ return _xtandard_kit_auth_none.noAuth;
13
+ }
14
+ });
@@ -0,0 +1,2 @@
1
+ import { ANONYMOUS_PRINCIPAL, noAuth } from "@xtandard/kit/auth/none";
2
+ export { ANONYMOUS_PRINCIPAL, noAuth };
@@ -0,0 +1,2 @@
1
+ import { ANONYMOUS_PRINCIPAL, noAuth } from "@xtandard/kit/auth/none";
2
+ export { ANONYMOUS_PRINCIPAL, noAuth };
@@ -0,0 +1,2 @@
1
+ import { ANONYMOUS_PRINCIPAL, noAuth } from "@xtandard/kit/auth/none";
2
+ export { ANONYMOUS_PRINCIPAL, noAuth };
@@ -0,0 +1,82 @@
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
+ const require_contract = require("./contract-CPmJVoRx.cjs");
3
+ const require_kit = require("./kit-C7tepDB2.cjs");
4
+ //#region src/auth-provider/session.ts
5
+ /**
6
+ * A generic session getter as a {@link PermissionsAuthProvider} (ADR 0006): you say how to load the
7
+ * session for a request and how to read a subject from it. Covers Auth.js, Clerk, Lucia-style
8
+ * session tables and home-grown cookies in a few lines (recipes below and in `docs/AUTH.md`).
9
+ *
10
+ * @example Auth.js (Next.js) — the role exists only if your `jwt`/`session` callbacks copy it
11
+ * ```ts
12
+ * import { auth } from "@/auth";
13
+ * sessionProvider({
14
+ * getSession: () => auth(),
15
+ * map: (s) => (s.user?.id ? { id: s.user.id, role: s.user.role, name: s.user.name, email: s.user.email } : null),
16
+ * });
17
+ * ```
18
+ *
19
+ * @example Auth.js (any framework, `@auth/core`)
20
+ * ```ts
21
+ * import { Auth } from "@auth/core";
22
+ * sessionProvider({
23
+ * getSession: async (request) => {
24
+ * const url = new URL("/auth/session", request.url); // your Auth.js basePath
25
+ * const res = await Auth(new Request(url, { headers: request.headers }), authConfig);
26
+ * const data = await res.json();
27
+ * return data && Object.keys(data).length ? data : null;
28
+ * },
29
+ * map: (s) => (s.user?.id ? { id: s.user.id, role: s.user.role } : null),
30
+ * });
31
+ * ```
32
+ *
33
+ * @example Clerk (`@clerk/backend`) — `orgRole` is namespaced (`"org:admin"`)
34
+ * ```ts
35
+ * sessionProvider({
36
+ * getSession: async (request) => {
37
+ * const state = await clerkClient.authenticateRequest(request, { authorizedParties });
38
+ * return state.isAuthenticated ? state.toAuth() : null;
39
+ * },
40
+ * map: (a) => ({ id: a.userId, role: a.orgRole ?? a.sessionClaims?.metadata?.role }),
41
+ * mapRole: { "org:admin": "admin", "org:member": "member" },
42
+ * });
43
+ * ```
44
+ *
45
+ * @example Lucia-style session table
46
+ * ```ts
47
+ * sessionProvider({
48
+ * getSession: (request) => {
49
+ * const token = parseCookie(request.headers.get("cookie"))["session"];
50
+ * return token ? validateSessionToken(token) : null; // → { session, user } | null
51
+ * },
52
+ * map: ({ user }) => ({ id: user.id, role: user.role, email: user.email }),
53
+ * });
54
+ * ```
55
+ *
56
+ * @module
57
+ */
58
+ /** A {@link PermissionsAuthProvider} from a session getter and a mapping. */
59
+ function sessionProvider(options) {
60
+ const provider = { async getSubject(request) {
61
+ const session = await options.getSession(request);
62
+ if (session === null || session === void 0) return null;
63
+ const mapped = options.map(session, request);
64
+ if (!mapped) return null;
65
+ return require_contract.identity({
66
+ ...mapped,
67
+ role: require_contract.normalizeRoles(mapped.role, options.mapRole)
68
+ });
69
+ } };
70
+ if (options.canManage) provider.canManage = options.canManage;
71
+ return provider;
72
+ }
73
+ //#endregion
74
+ exports.identity = require_contract.identity;
75
+ exports.normalizeRoles = require_contract.normalizeRoles;
76
+ exports.sessionProvider = sessionProvider;
77
+ exports.splitRoles = require_contract.splitRoles;
78
+ exports.stringField = require_contract.stringField;
79
+ exports.subjectOf = require_kit.subjectOf;
80
+ exports.toKitAuth = require_kit.toKitAuth;
81
+
82
+ //# sourceMappingURL=entry-auth-session.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"entry-auth-session.cjs","names":["identity","normalizeRoles"],"sources":["../src/auth-provider/session.ts"],"sourcesContent":["/**\n * A generic session getter as a {@link PermissionsAuthProvider} (ADR 0006): you say how to load the\n * session for a request and how to read a subject from it. Covers Auth.js, Clerk, Lucia-style\n * session tables and home-grown cookies in a few lines (recipes below and in `docs/AUTH.md`).\n *\n * @example Auth.js (Next.js) — the role exists only if your `jwt`/`session` callbacks copy it\n * ```ts\n * import { auth } from \"@/auth\";\n * sessionProvider({\n * getSession: () => auth(),\n * map: (s) => (s.user?.id ? { id: s.user.id, role: s.user.role, name: s.user.name, email: s.user.email } : null),\n * });\n * ```\n *\n * @example Auth.js (any framework, `@auth/core`)\n * ```ts\n * import { Auth } from \"@auth/core\";\n * sessionProvider({\n * getSession: async (request) => {\n * const url = new URL(\"/auth/session\", request.url); // your Auth.js basePath\n * const res = await Auth(new Request(url, { headers: request.headers }), authConfig);\n * const data = await res.json();\n * return data && Object.keys(data).length ? data : null;\n * },\n * map: (s) => (s.user?.id ? { id: s.user.id, role: s.user.role } : null),\n * });\n * ```\n *\n * @example Clerk (`@clerk/backend`) — `orgRole` is namespaced (`\"org:admin\"`)\n * ```ts\n * sessionProvider({\n * getSession: async (request) => {\n * const state = await clerkClient.authenticateRequest(request, { authorizedParties });\n * return state.isAuthenticated ? state.toAuth() : null;\n * },\n * map: (a) => ({ id: a.userId, role: a.orgRole ?? a.sessionClaims?.metadata?.role }),\n * mapRole: { \"org:admin\": \"admin\", \"org:member\": \"member\" },\n * });\n * ```\n *\n * @example Lucia-style session table\n * ```ts\n * sessionProvider({\n * getSession: (request) => {\n * const token = parseCookie(request.headers.get(\"cookie\"))[\"session\"];\n * return token ? validateSessionToken(token) : null; // → { session, user } | null\n * },\n * map: ({ user }) => ({ id: user.id, role: user.role, email: user.email }),\n * });\n * ```\n *\n * @module\n */\n\nimport {\n identity,\n normalizeRoles,\n type PermissionsAuthProvider,\n type ProviderRoleOptions,\n type SubjectIdentity,\n} from \"./contract.ts\";\n\n/** Options for {@link sessionProvider}. */\nexport interface SessionProviderOptions<S> extends ProviderRoleOptions {\n /** Load the session for a request. `null`/`undefined` = no session. Throwing = 500. */\n getSession(request: Request): S | null | undefined | Promise<S | null | undefined>;\n /**\n * Read the subject from a session. Return `null`/`undefined` when the session has no usable user\n * (e.g. an Auth.js session without `user.id`). `role` may be a string, a comma list or an array;\n * it is split and passed through `mapRole`.\n */\n map(session: S, request: Request): SubjectIdentity | null | undefined;\n}\n\n/** A {@link PermissionsAuthProvider} from a session getter and a mapping. */\nexport function sessionProvider<S>(options: SessionProviderOptions<S>): PermissionsAuthProvider {\n const provider: PermissionsAuthProvider = {\n async getSubject(request) {\n const session = await options.getSession(request);\n if (session === null || session === undefined) return null;\n const mapped = options.map(session, request);\n if (!mapped) return null;\n return identity({ ...mapped, role: normalizeRoles(mapped.role, options.mapRole) });\n },\n };\n if (options.canManage) provider.canManage = options.canManage;\n return provider;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA2EA,SAAgB,gBAAmB,SAA6D;CAC9F,MAAM,WAAoC,EACxC,MAAM,WAAW,SAAS;EACxB,MAAM,UAAU,MAAM,QAAQ,WAAW,OAAO;EAChD,IAAI,YAAY,QAAQ,YAAY,KAAA,GAAW,OAAO;EACtD,MAAM,SAAS,QAAQ,IAAI,SAAS,OAAO;EAC3C,IAAI,CAAC,QAAQ,OAAO;EACpB,OAAOA,iBAAAA,SAAS;GAAE,GAAG;GAAQ,MAAMC,iBAAAA,eAAe,OAAO,MAAM,QAAQ,OAAO;EAAE,CAAC;CACnF,EACF;CACA,IAAI,QAAQ,WAAW,SAAS,YAAY,QAAQ;CACpD,OAAO;AACT"}
@@ -0,0 +1,20 @@
1
+ import { f as PermissionsSubject, h as SubjectIdentity } from "./catalog-DA_d1SdC.cjs";
2
+ import { a as normalizeRoles, i as identity, n as ProviderRoleOptions, o as splitRoles, r as RoleMapper, s as stringField, t as PermissionsAuthProvider } from "./contract-BMiOmg2f.cjs";
3
+ import { a as toKitAuth, i as subjectOf, n as KitAuthEngine, r as ToKitAuthOptions, t as KitAuth } from "./kit-qAROuhOI.cjs";
4
+ //#region src/auth-provider/session.d.ts
5
+ /** Options for {@link sessionProvider}. */
6
+ interface SessionProviderOptions<S> extends ProviderRoleOptions {
7
+ /** Load the session for a request. `null`/`undefined` = no session. Throwing = 500. */
8
+ getSession(request: Request): S | null | undefined | Promise<S | null | undefined>;
9
+ /**
10
+ * Read the subject from a session. Return `null`/`undefined` when the session has no usable user
11
+ * (e.g. an Auth.js session without `user.id`). `role` may be a string, a comma list or an array;
12
+ * it is split and passed through `mapRole`.
13
+ */
14
+ map(session: S, request: Request): SubjectIdentity | null | undefined;
15
+ }
16
+ /** A {@link PermissionsAuthProvider} from a session getter and a mapping. */
17
+ declare function sessionProvider<S>(options: SessionProviderOptions<S>): PermissionsAuthProvider;
18
+ //#endregion
19
+ export { KitAuth, KitAuthEngine, PermissionsAuthProvider, type PermissionsSubject, ProviderRoleOptions, RoleMapper, type SessionProviderOptions, type SubjectIdentity, ToKitAuthOptions, identity, normalizeRoles, sessionProvider, splitRoles, stringField, subjectOf, toKitAuth };
20
+ //# sourceMappingURL=entry-auth-session.d.cts.map
@@ -0,0 +1,20 @@
1
+ import { f as PermissionsSubject, h as SubjectIdentity } from "./catalog-DJcJ3ycq.mjs";
2
+ import { a as normalizeRoles, i as identity, n as ProviderRoleOptions, o as splitRoles, r as RoleMapper, s as stringField, t as PermissionsAuthProvider } from "./contract-D32H1t0u.mjs";
3
+ import { a as toKitAuth, i as subjectOf, n as KitAuthEngine, r as ToKitAuthOptions, t as KitAuth } from "./kit-DMVBLBI9.mjs";
4
+ //#region src/auth-provider/session.d.ts
5
+ /** Options for {@link sessionProvider}. */
6
+ interface SessionProviderOptions<S> extends ProviderRoleOptions {
7
+ /** Load the session for a request. `null`/`undefined` = no session. Throwing = 500. */
8
+ getSession(request: Request): S | null | undefined | Promise<S | null | undefined>;
9
+ /**
10
+ * Read the subject from a session. Return `null`/`undefined` when the session has no usable user
11
+ * (e.g. an Auth.js session without `user.id`). `role` may be a string, a comma list or an array;
12
+ * it is split and passed through `mapRole`.
13
+ */
14
+ map(session: S, request: Request): SubjectIdentity | null | undefined;
15
+ }
16
+ /** A {@link PermissionsAuthProvider} from a session getter and a mapping. */
17
+ declare function sessionProvider<S>(options: SessionProviderOptions<S>): PermissionsAuthProvider;
18
+ //#endregion
19
+ export { KitAuth, KitAuthEngine, PermissionsAuthProvider, type PermissionsSubject, ProviderRoleOptions, RoleMapper, type SessionProviderOptions, type SubjectIdentity, ToKitAuthOptions, identity, normalizeRoles, sessionProvider, splitRoles, stringField, subjectOf, toKitAuth };
20
+ //# sourceMappingURL=entry-auth-session.d.mts.map
@@ -0,0 +1,75 @@
1
+ import { i as stringField, n as normalizeRoles, r as splitRoles, t as identity } from "./contract-Yc5AZuvv.mjs";
2
+ import { n as toKitAuth, t as subjectOf } from "./kit-fzXHYb1l.mjs";
3
+ //#region src/auth-provider/session.ts
4
+ /**
5
+ * A generic session getter as a {@link PermissionsAuthProvider} (ADR 0006): you say how to load the
6
+ * session for a request and how to read a subject from it. Covers Auth.js, Clerk, Lucia-style
7
+ * session tables and home-grown cookies in a few lines (recipes below and in `docs/AUTH.md`).
8
+ *
9
+ * @example Auth.js (Next.js) — the role exists only if your `jwt`/`session` callbacks copy it
10
+ * ```ts
11
+ * import { auth } from "@/auth";
12
+ * sessionProvider({
13
+ * getSession: () => auth(),
14
+ * map: (s) => (s.user?.id ? { id: s.user.id, role: s.user.role, name: s.user.name, email: s.user.email } : null),
15
+ * });
16
+ * ```
17
+ *
18
+ * @example Auth.js (any framework, `@auth/core`)
19
+ * ```ts
20
+ * import { Auth } from "@auth/core";
21
+ * sessionProvider({
22
+ * getSession: async (request) => {
23
+ * const url = new URL("/auth/session", request.url); // your Auth.js basePath
24
+ * const res = await Auth(new Request(url, { headers: request.headers }), authConfig);
25
+ * const data = await res.json();
26
+ * return data && Object.keys(data).length ? data : null;
27
+ * },
28
+ * map: (s) => (s.user?.id ? { id: s.user.id, role: s.user.role } : null),
29
+ * });
30
+ * ```
31
+ *
32
+ * @example Clerk (`@clerk/backend`) — `orgRole` is namespaced (`"org:admin"`)
33
+ * ```ts
34
+ * sessionProvider({
35
+ * getSession: async (request) => {
36
+ * const state = await clerkClient.authenticateRequest(request, { authorizedParties });
37
+ * return state.isAuthenticated ? state.toAuth() : null;
38
+ * },
39
+ * map: (a) => ({ id: a.userId, role: a.orgRole ?? a.sessionClaims?.metadata?.role }),
40
+ * mapRole: { "org:admin": "admin", "org:member": "member" },
41
+ * });
42
+ * ```
43
+ *
44
+ * @example Lucia-style session table
45
+ * ```ts
46
+ * sessionProvider({
47
+ * getSession: (request) => {
48
+ * const token = parseCookie(request.headers.get("cookie"))["session"];
49
+ * return token ? validateSessionToken(token) : null; // → { session, user } | null
50
+ * },
51
+ * map: ({ user }) => ({ id: user.id, role: user.role, email: user.email }),
52
+ * });
53
+ * ```
54
+ *
55
+ * @module
56
+ */
57
+ /** A {@link PermissionsAuthProvider} from a session getter and a mapping. */
58
+ function sessionProvider(options) {
59
+ const provider = { async getSubject(request) {
60
+ const session = await options.getSession(request);
61
+ if (session === null || session === void 0) return null;
62
+ const mapped = options.map(session, request);
63
+ if (!mapped) return null;
64
+ return identity({
65
+ ...mapped,
66
+ role: normalizeRoles(mapped.role, options.mapRole)
67
+ });
68
+ } };
69
+ if (options.canManage) provider.canManage = options.canManage;
70
+ return provider;
71
+ }
72
+ //#endregion
73
+ export { identity, normalizeRoles, sessionProvider, splitRoles, stringField, subjectOf, toKitAuth };
74
+
75
+ //# sourceMappingURL=entry-auth-session.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"entry-auth-session.mjs","names":[],"sources":["../src/auth-provider/session.ts"],"sourcesContent":["/**\n * A generic session getter as a {@link PermissionsAuthProvider} (ADR 0006): you say how to load the\n * session for a request and how to read a subject from it. Covers Auth.js, Clerk, Lucia-style\n * session tables and home-grown cookies in a few lines (recipes below and in `docs/AUTH.md`).\n *\n * @example Auth.js (Next.js) — the role exists only if your `jwt`/`session` callbacks copy it\n * ```ts\n * import { auth } from \"@/auth\";\n * sessionProvider({\n * getSession: () => auth(),\n * map: (s) => (s.user?.id ? { id: s.user.id, role: s.user.role, name: s.user.name, email: s.user.email } : null),\n * });\n * ```\n *\n * @example Auth.js (any framework, `@auth/core`)\n * ```ts\n * import { Auth } from \"@auth/core\";\n * sessionProvider({\n * getSession: async (request) => {\n * const url = new URL(\"/auth/session\", request.url); // your Auth.js basePath\n * const res = await Auth(new Request(url, { headers: request.headers }), authConfig);\n * const data = await res.json();\n * return data && Object.keys(data).length ? data : null;\n * },\n * map: (s) => (s.user?.id ? { id: s.user.id, role: s.user.role } : null),\n * });\n * ```\n *\n * @example Clerk (`@clerk/backend`) — `orgRole` is namespaced (`\"org:admin\"`)\n * ```ts\n * sessionProvider({\n * getSession: async (request) => {\n * const state = await clerkClient.authenticateRequest(request, { authorizedParties });\n * return state.isAuthenticated ? state.toAuth() : null;\n * },\n * map: (a) => ({ id: a.userId, role: a.orgRole ?? a.sessionClaims?.metadata?.role }),\n * mapRole: { \"org:admin\": \"admin\", \"org:member\": \"member\" },\n * });\n * ```\n *\n * @example Lucia-style session table\n * ```ts\n * sessionProvider({\n * getSession: (request) => {\n * const token = parseCookie(request.headers.get(\"cookie\"))[\"session\"];\n * return token ? validateSessionToken(token) : null; // → { session, user } | null\n * },\n * map: ({ user }) => ({ id: user.id, role: user.role, email: user.email }),\n * });\n * ```\n *\n * @module\n */\n\nimport {\n identity,\n normalizeRoles,\n type PermissionsAuthProvider,\n type ProviderRoleOptions,\n type SubjectIdentity,\n} from \"./contract.ts\";\n\n/** Options for {@link sessionProvider}. */\nexport interface SessionProviderOptions<S> extends ProviderRoleOptions {\n /** Load the session for a request. `null`/`undefined` = no session. Throwing = 500. */\n getSession(request: Request): S | null | undefined | Promise<S | null | undefined>;\n /**\n * Read the subject from a session. Return `null`/`undefined` when the session has no usable user\n * (e.g. an Auth.js session without `user.id`). `role` may be a string, a comma list or an array;\n * it is split and passed through `mapRole`.\n */\n map(session: S, request: Request): SubjectIdentity | null | undefined;\n}\n\n/** A {@link PermissionsAuthProvider} from a session getter and a mapping. */\nexport function sessionProvider<S>(options: SessionProviderOptions<S>): PermissionsAuthProvider {\n const provider: PermissionsAuthProvider = {\n async getSubject(request) {\n const session = await options.getSession(request);\n if (session === null || session === undefined) return null;\n const mapped = options.map(session, request);\n if (!mapped) return null;\n return identity({ ...mapped, role: normalizeRoles(mapped.role, options.mapRole) });\n },\n };\n if (options.canManage) provider.canManage = options.canManage;\n return provider;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA2EA,SAAgB,gBAAmB,SAA6D;CAC9F,MAAM,WAAoC,EACxC,MAAM,WAAW,SAAS;EACxB,MAAM,UAAU,MAAM,QAAQ,WAAW,OAAO;EAChD,IAAI,YAAY,QAAQ,YAAY,KAAA,GAAW,OAAO;EACtD,MAAM,SAAS,QAAQ,IAAI,SAAS,OAAO;EAC3C,IAAI,CAAC,QAAQ,OAAO;EACpB,OAAO,SAAS;GAAE,GAAG;GAAQ,MAAM,eAAe,OAAO,MAAM,QAAQ,OAAO;EAAE,CAAC;CACnF,EACF;CACA,IAAI,QAAQ,WAAW,SAAS,YAAY,QAAQ;CACpD,OAAO;AACT"}
@@ -0,0 +1,31 @@
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
+ let _xtandard_kit_authorization_delegated = require("@xtandard/kit/authorization/delegated");
3
+ //#region src/authorization/delegated.ts
4
+ /**
5
+ * Delegated {@link AuthorizationProvider}: wraps a decision function (sync or async) so any policy
6
+ * works (per-subject ownership, an external policy engine) without implementing the interface.
7
+ *
8
+ * @module
9
+ */
10
+ /**
11
+ * Create an {@link AuthorizationProvider} from a plain decision function.
12
+ *
13
+ * @example
14
+ * ```ts
15
+ * import { delegatedAuthorization } from "@xtandard/permissions/authorization/delegated";
16
+ *
17
+ * // Support staff may read everything but only grant on their own team's subjects.
18
+ * const authz = delegatedAuthorization({
19
+ * authorize: ({ principal, action, resource }) =>
20
+ * action !== "grants:write" ||
21
+ * ("subject" in resource && resource.subject?.startsWith(`${principal?.id}-team-`) === true),
22
+ * });
23
+ * ```
24
+ */
25
+ function delegatedAuthorization(options) {
26
+ return (0, _xtandard_kit_authorization_delegated.delegatedAuthorization)(options);
27
+ }
28
+ //#endregion
29
+ exports.delegatedAuthorization = delegatedAuthorization;
30
+
31
+ //# sourceMappingURL=entry-authorization-delegated.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"entry-authorization-delegated.cjs","names":[],"sources":["../src/authorization/delegated.ts"],"sourcesContent":["/**\n * Delegated {@link AuthorizationProvider}: wraps a decision function (sync or async) so any policy\n * works (per-subject ownership, an external policy engine) without implementing the interface.\n *\n * @module\n */\n\nimport { delegatedAuthorization as kitDelegated } from \"@xtandard/kit/authorization/delegated\";\nimport type { AuthorizationProvider, AuthorizeInput } from \"./contract.ts\";\n\n/** Options for {@link delegatedAuthorization}. */\nexport interface DelegatedAuthorizationOptions {\n /** Return `true` to allow the {@link AuthorizeInput}. May be async. */\n authorize: (input: AuthorizeInput) => Promise<boolean> | boolean;\n}\n\n/**\n * Create an {@link AuthorizationProvider} from a plain decision function.\n *\n * @example\n * ```ts\n * import { delegatedAuthorization } from \"@xtandard/permissions/authorization/delegated\";\n *\n * // Support staff may read everything but only grant on their own team's subjects.\n * const authz = delegatedAuthorization({\n * authorize: ({ principal, action, resource }) =>\n * action !== \"grants:write\" ||\n * (\"subject\" in resource && resource.subject?.startsWith(`${principal?.id}-team-`) === true),\n * });\n * ```\n */\nexport function delegatedAuthorization(\n options: DelegatedAuthorizationOptions,\n): AuthorizationProvider {\n return kitDelegated(options);\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AA+BA,SAAgB,uBACd,SACuB;CACvB,QAAA,GAAA,sCAAA,wBAAoB,OAAO;AAC7B"}
@@ -0,0 +1,27 @@
1
+ import { n as AuthorizationProvider, r as AuthorizeInput } from "./contract-CNgMXr2u.cjs";
2
+
3
+ //#region src/authorization/delegated.d.ts
4
+ /** Options for {@link delegatedAuthorization}. */
5
+ interface DelegatedAuthorizationOptions {
6
+ /** Return `true` to allow the {@link AuthorizeInput}. May be async. */
7
+ authorize: (input: AuthorizeInput) => Promise<boolean> | boolean;
8
+ }
9
+ /**
10
+ * Create an {@link AuthorizationProvider} from a plain decision function.
11
+ *
12
+ * @example
13
+ * ```ts
14
+ * import { delegatedAuthorization } from "@xtandard/permissions/authorization/delegated";
15
+ *
16
+ * // Support staff may read everything but only grant on their own team's subjects.
17
+ * const authz = delegatedAuthorization({
18
+ * authorize: ({ principal, action, resource }) =>
19
+ * action !== "grants:write" ||
20
+ * ("subject" in resource && resource.subject?.startsWith(`${principal?.id}-team-`) === true),
21
+ * });
22
+ * ```
23
+ */
24
+ declare function delegatedAuthorization(options: DelegatedAuthorizationOptions): AuthorizationProvider;
25
+ //#endregion
26
+ export { DelegatedAuthorizationOptions, delegatedAuthorization };
27
+ //# sourceMappingURL=entry-authorization-delegated.d.cts.map
@@ -0,0 +1,27 @@
1
+ import { n as AuthorizationProvider, r as AuthorizeInput } from "./contract-CNgMXr2u.mjs";
2
+
3
+ //#region src/authorization/delegated.d.ts
4
+ /** Options for {@link delegatedAuthorization}. */
5
+ interface DelegatedAuthorizationOptions {
6
+ /** Return `true` to allow the {@link AuthorizeInput}. May be async. */
7
+ authorize: (input: AuthorizeInput) => Promise<boolean> | boolean;
8
+ }
9
+ /**
10
+ * Create an {@link AuthorizationProvider} from a plain decision function.
11
+ *
12
+ * @example
13
+ * ```ts
14
+ * import { delegatedAuthorization } from "@xtandard/permissions/authorization/delegated";
15
+ *
16
+ * // Support staff may read everything but only grant on their own team's subjects.
17
+ * const authz = delegatedAuthorization({
18
+ * authorize: ({ principal, action, resource }) =>
19
+ * action !== "grants:write" ||
20
+ * ("subject" in resource && resource.subject?.startsWith(`${principal?.id}-team-`) === true),
21
+ * });
22
+ * ```
23
+ */
24
+ declare function delegatedAuthorization(options: DelegatedAuthorizationOptions): AuthorizationProvider;
25
+ //#endregion
26
+ export { DelegatedAuthorizationOptions, delegatedAuthorization };
27
+ //# sourceMappingURL=entry-authorization-delegated.d.mts.map
@@ -0,0 +1,30 @@
1
+ import { delegatedAuthorization as delegatedAuthorization$1 } from "@xtandard/kit/authorization/delegated";
2
+ //#region src/authorization/delegated.ts
3
+ /**
4
+ * Delegated {@link AuthorizationProvider}: wraps a decision function (sync or async) so any policy
5
+ * works (per-subject ownership, an external policy engine) without implementing the interface.
6
+ *
7
+ * @module
8
+ */
9
+ /**
10
+ * Create an {@link AuthorizationProvider} from a plain decision function.
11
+ *
12
+ * @example
13
+ * ```ts
14
+ * import { delegatedAuthorization } from "@xtandard/permissions/authorization/delegated";
15
+ *
16
+ * // Support staff may read everything but only grant on their own team's subjects.
17
+ * const authz = delegatedAuthorization({
18
+ * authorize: ({ principal, action, resource }) =>
19
+ * action !== "grants:write" ||
20
+ * ("subject" in resource && resource.subject?.startsWith(`${principal?.id}-team-`) === true),
21
+ * });
22
+ * ```
23
+ */
24
+ function delegatedAuthorization(options) {
25
+ return delegatedAuthorization$1(options);
26
+ }
27
+ //#endregion
28
+ export { delegatedAuthorization };
29
+
30
+ //# sourceMappingURL=entry-authorization-delegated.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"entry-authorization-delegated.mjs","names":["kitDelegated"],"sources":["../src/authorization/delegated.ts"],"sourcesContent":["/**\n * Delegated {@link AuthorizationProvider}: wraps a decision function (sync or async) so any policy\n * works (per-subject ownership, an external policy engine) without implementing the interface.\n *\n * @module\n */\n\nimport { delegatedAuthorization as kitDelegated } from \"@xtandard/kit/authorization/delegated\";\nimport type { AuthorizationProvider, AuthorizeInput } from \"./contract.ts\";\n\n/** Options for {@link delegatedAuthorization}. */\nexport interface DelegatedAuthorizationOptions {\n /** Return `true` to allow the {@link AuthorizeInput}. May be async. */\n authorize: (input: AuthorizeInput) => Promise<boolean> | boolean;\n}\n\n/**\n * Create an {@link AuthorizationProvider} from a plain decision function.\n *\n * @example\n * ```ts\n * import { delegatedAuthorization } from \"@xtandard/permissions/authorization/delegated\";\n *\n * // Support staff may read everything but only grant on their own team's subjects.\n * const authz = delegatedAuthorization({\n * authorize: ({ principal, action, resource }) =>\n * action !== \"grants:write\" ||\n * (\"subject\" in resource && resource.subject?.startsWith(`${principal?.id}-team-`) === true),\n * });\n * ```\n */\nexport function delegatedAuthorization(\n options: DelegatedAuthorizationOptions,\n): AuthorizationProvider {\n return kitDelegated(options);\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AA+BA,SAAgB,uBACd,SACuB;CACvB,OAAOA,yBAAa,OAAO;AAC7B"}
@@ -0,0 +1,29 @@
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
+ let _xtandard_kit_authorization_none = require("@xtandard/kit/authorization/none");
3
+ //#region src/authorization/none.ts
4
+ /**
5
+ * The "no authorization" {@link AuthorizationProvider}: every action is allowed, whoever asks.
6
+ *
7
+ * Right for embedded usage and local development where the admin API is not exposed to untrusted
8
+ * callers (commonly with `noAuth()`). Never for a network-exposed panel: use
9
+ * `rolesAuthorization()`, a delegated provider, or `toKitAuth(provider, perms)`.
10
+ *
11
+ * @module
12
+ */
13
+ /**
14
+ * Create an {@link AuthorizationProvider} that authorizes everything.
15
+ *
16
+ * @example
17
+ * ```ts
18
+ * import { noAuthorization } from "@xtandard/permissions/authorization/none";
19
+ *
20
+ * createFetchHandler({ permissions: perms, authorization: noAuthorization() });
21
+ * ```
22
+ */
23
+ function noAuthorization() {
24
+ return (0, _xtandard_kit_authorization_none.noAuthorization)();
25
+ }
26
+ //#endregion
27
+ exports.noAuthorization = noAuthorization;
28
+
29
+ //# sourceMappingURL=entry-authorization-none.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"entry-authorization-none.cjs","names":[],"sources":["../src/authorization/none.ts"],"sourcesContent":["/**\n * The \"no authorization\" {@link AuthorizationProvider}: every action is allowed, whoever asks.\n *\n * Right for embedded usage and local development where the admin API is not exposed to untrusted\n * callers (commonly with `noAuth()`). Never for a network-exposed panel: use\n * `rolesAuthorization()`, a delegated provider, or `toKitAuth(provider, perms)`.\n *\n * @module\n */\n\nimport { noAuthorization as kitNoAuthorization } from \"@xtandard/kit/authorization/none\";\nimport type { AuthorizationProvider } from \"./contract.ts\";\n\n/**\n * Create an {@link AuthorizationProvider} that authorizes everything.\n *\n * @example\n * ```ts\n * import { noAuthorization } from \"@xtandard/permissions/authorization/none\";\n *\n * createFetchHandler({ permissions: perms, authorization: noAuthorization() });\n * ```\n */\nexport function noAuthorization(): AuthorizationProvider {\n return kitNoAuthorization();\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAuBA,SAAgB,kBAAyC;CACvD,QAAA,GAAA,iCAAA,iBAA0B;AAC5B"}
@@ -0,0 +1,17 @@
1
+ import { n as AuthorizationProvider } from "./contract-CNgMXr2u.cjs";
2
+
3
+ //#region src/authorization/none.d.ts
4
+ /**
5
+ * Create an {@link AuthorizationProvider} that authorizes everything.
6
+ *
7
+ * @example
8
+ * ```ts
9
+ * import { noAuthorization } from "@xtandard/permissions/authorization/none";
10
+ *
11
+ * createFetchHandler({ permissions: perms, authorization: noAuthorization() });
12
+ * ```
13
+ */
14
+ declare function noAuthorization(): AuthorizationProvider;
15
+ //#endregion
16
+ export { noAuthorization };
17
+ //# sourceMappingURL=entry-authorization-none.d.cts.map
@@ -0,0 +1,17 @@
1
+ import { n as AuthorizationProvider } from "./contract-CNgMXr2u.mjs";
2
+
3
+ //#region src/authorization/none.d.ts
4
+ /**
5
+ * Create an {@link AuthorizationProvider} that authorizes everything.
6
+ *
7
+ * @example
8
+ * ```ts
9
+ * import { noAuthorization } from "@xtandard/permissions/authorization/none";
10
+ *
11
+ * createFetchHandler({ permissions: perms, authorization: noAuthorization() });
12
+ * ```
13
+ */
14
+ declare function noAuthorization(): AuthorizationProvider;
15
+ //#endregion
16
+ export { noAuthorization };
17
+ //# sourceMappingURL=entry-authorization-none.d.mts.map
@@ -0,0 +1,28 @@
1
+ import { noAuthorization as noAuthorization$1 } from "@xtandard/kit/authorization/none";
2
+ //#region src/authorization/none.ts
3
+ /**
4
+ * The "no authorization" {@link AuthorizationProvider}: every action is allowed, whoever asks.
5
+ *
6
+ * Right for embedded usage and local development where the admin API is not exposed to untrusted
7
+ * callers (commonly with `noAuth()`). Never for a network-exposed panel: use
8
+ * `rolesAuthorization()`, a delegated provider, or `toKitAuth(provider, perms)`.
9
+ *
10
+ * @module
11
+ */
12
+ /**
13
+ * Create an {@link AuthorizationProvider} that authorizes everything.
14
+ *
15
+ * @example
16
+ * ```ts
17
+ * import { noAuthorization } from "@xtandard/permissions/authorization/none";
18
+ *
19
+ * createFetchHandler({ permissions: perms, authorization: noAuthorization() });
20
+ * ```
21
+ */
22
+ function noAuthorization() {
23
+ return noAuthorization$1();
24
+ }
25
+ //#endregion
26
+ export { noAuthorization };
27
+
28
+ //# sourceMappingURL=entry-authorization-none.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"entry-authorization-none.mjs","names":["kitNoAuthorization"],"sources":["../src/authorization/none.ts"],"sourcesContent":["/**\n * The \"no authorization\" {@link AuthorizationProvider}: every action is allowed, whoever asks.\n *\n * Right for embedded usage and local development where the admin API is not exposed to untrusted\n * callers (commonly with `noAuth()`). Never for a network-exposed panel: use\n * `rolesAuthorization()`, a delegated provider, or `toKitAuth(provider, perms)`.\n *\n * @module\n */\n\nimport { noAuthorization as kitNoAuthorization } from \"@xtandard/kit/authorization/none\";\nimport type { AuthorizationProvider } from \"./contract.ts\";\n\n/**\n * Create an {@link AuthorizationProvider} that authorizes everything.\n *\n * @example\n * ```ts\n * import { noAuthorization } from \"@xtandard/permissions/authorization/none\";\n *\n * createFetchHandler({ permissions: perms, authorization: noAuthorization() });\n * ```\n */\nexport function noAuthorization(): AuthorizationProvider {\n return kitNoAuthorization();\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAuBA,SAAgB,kBAAyC;CACvD,OAAOA,kBAAmB;AAC5B"}
@@ -0,0 +1,4 @@
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
+ const require_permissions = require("./permissions-Cxri_P_k.cjs");
3
+ exports.permissionsAuthorization = require_permissions.permissionsAuthorization;
4
+ exports.principalIdentity = require_permissions.principalIdentity;