permdock 0.1.0 → 0.2.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 (349) hide show
  1. package/README.md +106 -47
  2. package/dist/a2a/index.d.ts +7 -16
  3. package/dist/a2a/index.js +59 -98
  4. package/dist/adapter-context-mlWsVGGg.js +23 -0
  5. package/dist/ai-sdk/index.d.ts +37 -16
  6. package/dist/ai-sdk/index.js +30 -13
  7. package/dist/approvals/index.d.ts +3 -3
  8. package/dist/approvals/index.js +5 -4
  9. package/dist/{approvals-DaxY-Bdg.js → approvals-DbYAuNkG.js} +17 -11
  10. package/dist/approvers-DT4AVyIg.js +52 -0
  11. package/dist/{arazzo-CTeVuXr5.js → arazzo-BAgw9ap6.js} +2 -2
  12. package/dist/{arazzo-aoTkqYsJ.js → arazzo-cmvX2jDe.js} +2 -2
  13. package/dist/authzen/index.d.ts +4 -13
  14. package/dist/authzen/index.js +16 -50
  15. package/dist/better-auth/index.d.ts +20 -3
  16. package/dist/better-auth/index.js +27 -7
  17. package/dist/better-supabase/index.d.ts +206 -0
  18. package/dist/better-supabase/index.js +620 -0
  19. package/dist/bind-CVy3Espv.d.ts +25 -0
  20. package/dist/bind-VnYn2HKq.js +97 -0
  21. package/dist/boundary-BM8a_P6E.js +13 -0
  22. package/dist/boundary-BmHxVH1J.d.ts +15 -0
  23. package/dist/canonical-json-DemiK4Vp.js +26 -0
  24. package/dist/{capability-B68OFnZx.js → capability-4qPdO9gk.js} +7 -5
  25. package/dist/{capability-BDG_nkxt.d.ts → capability-Dq43tT1u.d.ts} +2 -2
  26. package/dist/catalog/index.d.ts +1 -1
  27. package/dist/catalog/index.js +1 -1
  28. package/dist/catalog-BjZSovXQ.js +2 -0
  29. package/dist/{catalog-doc-BSo_Q_-6.js → catalog-doc-Dsc9y7sd.js} +23 -12
  30. package/dist/{catalog-B0E6bggc.js → catalog-h2tlKFkq.js} +2 -2
  31. package/dist/{catalog-H-vFGwWK.js → catalog-z8q6bi_r.js} +4 -4
  32. package/dist/claude-agent/index.d.ts +5 -14
  33. package/dist/claude-agent/index.js +4 -10
  34. package/dist/clerk/index.d.ts +12 -3
  35. package/dist/clerk/index.js +26 -5
  36. package/dist/cli/bin.js +1 -1
  37. package/dist/cli/index.d.ts +3 -3
  38. package/dist/cli/index.js +2 -2
  39. package/dist/clients-C7zLFuWT.d.ts +12 -0
  40. package/dist/clients-DjU5ABMy.js +23 -0
  41. package/dist/cloud/index.d.ts +4 -5
  42. package/dist/cloud/index.js +20 -6
  43. package/dist/{cloud-BNQTrmrr.js → cloud-BGhHS-lY.js} +2 -2
  44. package/dist/{cloud-Cuxr6Czw.js → cloud-Bo3e9Ak3.js} +7 -6
  45. package/dist/{collect-O-tOtbnk.js → collect-DDDv_ESs.js} +194 -42
  46. package/dist/collect-DLlujdHC.js +83 -0
  47. package/dist/collect-rG2IQ3t0.js +2 -0
  48. package/dist/{commands-BMh_Etm2.js → commands-DWOrSQic.js} +16 -12
  49. package/dist/compile/index.d.ts +3 -0
  50. package/dist/compile/index.js +2 -0
  51. package/dist/{compile-D22iwvuV.js → compile-Ba4blROR.js} +85 -30
  52. package/dist/compile-CNnl6uIt.d.ts +94 -0
  53. package/dist/config-BJiM-xAm.js +157 -0
  54. package/dist/config-Bn00Z3ks.js +36 -0
  55. package/dist/config-report-Dw_JcUqT.js +44 -0
  56. package/dist/{connection-JvqwHODC.js → connection-CU8MQxRi.js} +1 -1
  57. package/dist/{context-CKEAabd7.js → context-Ttp0ekMT.js} +36 -27
  58. package/dist/convex/index.d.ts +9 -4
  59. package/dist/convex/index.js +14 -4
  60. package/dist/create-BWyx3jua.d.ts +245 -0
  61. package/dist/create-CPhDL6qx.js +253 -0
  62. package/dist/{credential-B_rkUNlY.js → credential-8P81ff4u.js} +26 -46
  63. package/dist/delegation-D8pUEuce.js +103 -0
  64. package/dist/{describe-Bt1YD5uS.js → describe-B_gVZEVi.js} +10 -15
  65. package/dist/{describe-DernyItf.d.ts → describe-PdoqESvg.d.ts} +9 -10
  66. package/dist/{diff-x5Il8LVa.js → diff-B8Tunc3o.js} +44 -11
  67. package/dist/{diff-BUzf5Poi.js → diff-CzqLxZ77.js} +2 -2
  68. package/dist/doctor-WpvG6p4k.js +1194 -0
  69. package/dist/doctor-collect-ByfYlNv1.js +664 -0
  70. package/dist/{doctor-Bqo6FwUa.js → doctor-rOr-4ZfS.js} +2 -2
  71. package/dist/drizzle/index.d.ts +4 -3
  72. package/dist/drizzle/index.js +3 -3
  73. package/dist/elysia/index.d.ts +6 -28
  74. package/dist/elysia/index.js +16 -60
  75. package/dist/{errors-DSMnAVNa.js → errors-CWfoNg9N.js} +8 -4
  76. package/dist/{errors-Iy71s7Oj.js → errors-Cz5zn0mW.js} +17 -71
  77. package/dist/{errors-DbZ1YOnb.d.ts → errors-DAqevpNk.d.ts} +8 -21
  78. package/dist/{errors-m3u9TmDu.js → errors-DRnGZHzF.js} +4 -1
  79. package/dist/evaluation-items-CfCCejQd.js +40 -0
  80. package/dist/{evaluations-DsAU9ppl.js → evaluations-tz6D9A2G.js} +28 -46
  81. package/dist/eve/index.d.ts +6 -15
  82. package/dist/eve/index.js +7 -12
  83. package/dist/expiry-BoBJ8Tvc.js +7 -0
  84. package/dist/express/index.d.ts +6 -29
  85. package/dist/express/index.js +28 -58
  86. package/dist/fastify/index.d.ts +6 -29
  87. package/dist/fastify/index.js +16 -65
  88. package/dist/fields-BMl1RxoX.js +26 -0
  89. package/dist/{files-B_wAGYmt.js → files-DWUN9PzI.js} +5 -1
  90. package/dist/{fixtures-Cvaw0gDG.js → fixtures-ht28Cplr.js} +5 -2
  91. package/dist/{freeze-y1_jQL4v.js → freeze-CrU8nQeX.js} +31 -2
  92. package/dist/{from-snapshot-BMGnhmgv.js → from-snapshot-C3sHpZNS.js} +65 -48
  93. package/dist/{grantee-Bv04_Vzf.js → grantee-Cv5Sogfv.js} +88 -7
  94. package/dist/graph-sql-B-dsAT6j.d.ts +29 -0
  95. package/dist/{headers-B5RRv3Xm.js → headers-BZSDieNT.js} +1 -1
  96. package/dist/{headers-C8SHQccD.d.ts → headers-Cf-zWvsO.d.ts} +1 -1
  97. package/dist/helpers-H_KARDVC.js +421 -0
  98. package/dist/hono/index.d.ts +6 -28
  99. package/dist/hono/index.js +11 -43
  100. package/dist/{hosted-BwKQ1BTA.js → hosted-DJQw46hn.js} +6 -5
  101. package/dist/{http-GgVApX1k.js → http-BIhmLfCc.js} +4 -20
  102. package/dist/http-SO7qGttf.js +44 -0
  103. package/dist/ids-DC4V4CFu.js +18 -0
  104. package/dist/{index-LF_hS-yn.d.ts → index-A0YNL8jZ.d.ts} +1 -1
  105. package/dist/index-CtE07CBF.d.ts +6 -0
  106. package/dist/{index-xIxJLwOQ.d.ts → index-D3vbkoSI.d.ts} +75 -7
  107. package/dist/{index-CltcQ4Bf.d.ts → index-D6_cSa1z.d.ts} +68 -5
  108. package/dist/index.d.ts +14 -9
  109. package/dist/index.js +22 -17
  110. package/dist/instance-options-BK_rNOSC.d.ts +11 -0
  111. package/dist/instance-options-Dhhcnm3y.js +22 -0
  112. package/dist/{parse-DPfIvFMU.js → json-schema-BsAflUGW.js} +28 -57
  113. package/dist/jwt/index.d.ts +10 -6
  114. package/dist/jwt/index.js +32 -13
  115. package/dist/kernel-GSQnMz3O.js +208 -0
  116. package/dist/kysely/index.d.ts +4 -3
  117. package/dist/kysely/index.js +3 -3
  118. package/dist/live-options-H2eG8dfJ.js +60 -0
  119. package/dist/{load-BZ24CpZP.js → load-DhWEB9P1.js} +16 -10
  120. package/dist/load-DwJUafYN.js +2 -0
  121. package/dist/manifest-iaoBXHKc.js +783 -0
  122. package/dist/manifest-uDS9y5de.d.ts +206 -0
  123. package/dist/{map-DowSO96j.js → map-AcxK9o_D.js} +4 -15
  124. package/dist/{map-claims-B_6I1Rn-.js → map-claims-Z4QZOiFF.js} +13 -4
  125. package/dist/map-error-pgUWNNtG.js +23 -0
  126. package/dist/may-use-DndQ5tQ-.js +77 -0
  127. package/dist/mcp/index.d.ts +54 -22
  128. package/dist/mcp/index.js +218 -178
  129. package/dist/nest/index.d.ts +26 -31
  130. package/dist/nest/index.js +75 -84
  131. package/dist/next/client.d.ts +7 -8
  132. package/dist/next/client.js +11 -9
  133. package/dist/next/index.d.ts +30 -47
  134. package/dist/next/index.js +45 -60
  135. package/dist/next/plugin.d.ts +1 -1
  136. package/dist/next/plugin.js +32 -1
  137. package/dist/node/index.d.ts +9 -28
  138. package/dist/node/index.js +11 -43
  139. package/dist/openai/index.d.ts +6 -15
  140. package/dist/openai/index.js +7 -20
  141. package/dist/openapi/index.d.ts +87 -4
  142. package/dist/openapi/index.js +3 -3
  143. package/dist/{openapi-CwePaF7C.js → openapi-Bbg4wGVL.js} +3 -3
  144. package/dist/{openapi-DcqM8nU7.js → openapi-BqRBvAng.js} +237 -5
  145. package/dist/{openapi-DWD0Uc_4.js → openapi-CqqEbHsL.js} +5 -5
  146. package/dist/{openapi-import-BWRUNNeW.js → openapi-import-cmwetbzw.js} +1 -1
  147. package/dist/{openapi-schema-D8j_T9tO.js → openapi-schema--ARjyfQr.js} +2 -2
  148. package/dist/orpc/index.d.ts +15 -28
  149. package/dist/orpc/index.js +74 -117
  150. package/dist/otel/index.d.ts +2 -2
  151. package/dist/parse-BuyjxhZV.js +53 -0
  152. package/dist/parse-local-manifest-BkGQNzAh.d.ts +10 -0
  153. package/dist/parse-local-manifest-BrMozJCo.js +36 -0
  154. package/dist/pdp/index.d.ts +2 -2
  155. package/dist/pdp/index.js +14 -127
  156. package/dist/{permdock-yoZ7EjxX.js → permdock-CzqXjCpU.js} +641 -126
  157. package/dist/{permissions-B8vCg_bI.d.ts → permissions-CDgvKG5L.d.ts} +2 -2
  158. package/dist/{permissions-CofRqesP.js → permissions-CpZrivYv.js} +3 -3
  159. package/dist/{permissions-DC7GROPA.js → permissions-DVoF6dMt.js} +77 -15
  160. package/dist/{permissions-B4apnahQ.d.ts → permissions-DttnqqxC.d.ts} +34 -5
  161. package/dist/{pins-CqE1jZuF.js → pins-8ILTftC9.js} +2 -2
  162. package/dist/{policy-CInmNGkM.d.ts → policy-CFZAr_Al.d.ts} +330 -37
  163. package/dist/{policy-Cq2fB8Q5.d.ts → policy-D8UFyERw.d.ts} +2 -2
  164. package/dist/{policy-ANp36PnI.js → policy-xyWg7QdR.js} +173 -22
  165. package/dist/powersync-A8x_Yyvh.js +2 -0
  166. package/dist/powersync-C7kLglqX.js +540 -0
  167. package/dist/powersync-yW1UUFzp.js +62 -0
  168. package/dist/prisma/index.d.ts +3 -2
  169. package/dist/prisma/index.js +45 -20
  170. package/dist/{problem-Cgp9-KZA.js → problem-B43ztKIm.js} +74 -109
  171. package/dist/problem-details-CkL50EEf.d.ts +7 -0
  172. package/dist/problem-details-_AMOYz-w.js +144 -0
  173. package/dist/{protected-BuPAycJT.d.ts → protected-CNsMzrVd.d.ts} +5 -4
  174. package/dist/protected-Cs6kTaHo.js +100 -0
  175. package/dist/protected-bZs6rbT1.d.ts +40 -0
  176. package/dist/{provider-wTAUda2v.d.ts → provider-Cjr62YMV.d.ts} +1 -1
  177. package/dist/provider-DLzpb2Xz.js +52 -0
  178. package/dist/provider-store-DNyC1y48.js +43 -0
  179. package/dist/react/index.d.ts +7 -5
  180. package/dist/react/index.js +5 -4
  181. package/dist/react/provider-client.d.ts +1 -1
  182. package/dist/react/provider-client.js +1 -1
  183. package/dist/react-native/index.d.ts +166 -10
  184. package/dist/react-native/index.js +607 -85
  185. package/dist/{refs-ChLSxbST.js → refs-KYb4ntaz.js} +4 -3
  186. package/dist/{relations-r4soIFZB.js → relations-cjOL01hZ.js} +110 -31
  187. package/dist/replay-BsOyTrdV.js +28 -0
  188. package/dist/replay-sqBGMnNs.d.ts +5 -0
  189. package/dist/resource-ref-CaS9yVPi.js +20 -0
  190. package/dist/revocations-Bhr0aMIC.js +27 -0
  191. package/dist/rls-BMNydpHk.js +2521 -0
  192. package/dist/{rls-BOFU3chG.js → rls-CEvs64Kj.js} +8 -3
  193. package/dist/rls-fields-BMasREhR.js +3502 -0
  194. package/dist/{rls-graph-DxQ39PJj.js → rls-graph-pc9fuXYm.js} +100 -36
  195. package/dist/{rls-import-CXV6LBlS.js → rls-import-D8F7j35Q.js} +7 -6
  196. package/dist/{rls-migrate-DrFPbf8p.js → rls-migrate-7wikfrVI.js} +6 -5
  197. package/dist/rls-ownership-B5Lkq62W.js +843 -0
  198. package/dist/rls-shared-aOQ4hGTO.js +493 -0
  199. package/dist/rls-verify-D8B7dOTh.js +745 -0
  200. package/dist/{row-check-BajTgQZ-.d.ts → row-check-Dt35czLy.d.ts} +12 -15
  201. package/dist/rpc-DOK54_CS.js +89 -0
  202. package/dist/{run-CJ6UvS3a.js → run-YXCJDNYk.js} +31 -12
  203. package/dist/runtime-CB8gQFvS.js +11 -0
  204. package/dist/{saas-BRrZzJkM.js → saas-Bj_FFkjN.js} +17 -7
  205. package/dist/{schema-P8yoma__.js → schema-D3MnDMxa.js} +8 -4
  206. package/dist/scim/index.d.ts +1 -1
  207. package/dist/scim/index.js +1 -1
  208. package/dist/{scim-9NFa0XVZ.js → scim-BFGBBAqR.js} +1 -1
  209. package/dist/{scopes-cKVp_WTw.js → scopes-CVdPrWN-.js} +35 -8
  210. package/dist/server/index.d.ts +22 -11
  211. package/dist/server/index.js +11 -8
  212. package/dist/{credentials-BgRX3WEg.js → server-DlZ28Oz5.js} +1 -1
  213. package/dist/shared-DRu8VFVM.js +123 -0
  214. package/dist/{sink-Cfr9-7YC.d.ts → sink-Gs6TTVa-.d.ts} +1 -1
  215. package/dist/skills-Biq5uup3.js +192 -0
  216. package/dist/{skills-C_lpV4Jx.js → skills-JaymNCdK.js} +10 -4
  217. package/dist/{snapshot-DE8dE_hz.js → snapshot-Enxd0n-s.js} +138 -214
  218. package/dist/snapshot-cache-D6jLelln.js +44 -0
  219. package/dist/snapshot-cache-DwQH8ufx.d.ts +45 -0
  220. package/dist/solid/index.d.ts +39 -9
  221. package/dist/solid/index.js +76 -85
  222. package/dist/sources-B0UvrJ21.js +534 -0
  223. package/dist/sources-BcJgw0lt.d.ts +192 -0
  224. package/dist/{sql-Bll1d7y0.js → sql-xdg5f4Fi.js} +6 -1
  225. package/dist/{src-CTNT-PBW.js → src-CSbUiozF.js} +149 -11
  226. package/dist/ssf/index.d.ts +3 -2
  227. package/dist/ssf/index.js +3 -29
  228. package/dist/store-DMAWwAJV.js +371 -0
  229. package/dist/{store-Bq90395i.d.ts → store-D_pjn91-.d.ts} +13 -4
  230. package/dist/store-options-yO0V6gRn.js +716 -0
  231. package/dist/{stores-CkG2HrSg.js → stores-4_sqiOA1.js} +10 -63
  232. package/dist/{stores-CvOnu_2T.d.ts → stores-DVR5NHLE.d.ts} +20 -9
  233. package/dist/{stream-Q_xlB6Ko.js → stream-DDpvynSB.js} +16 -2
  234. package/dist/{stream-BhMfZOwr.d.ts → stream-DlvG2hs-.d.ts} +2 -2
  235. package/dist/subject-settings-BwBmCdTR.js +128 -0
  236. package/dist/supabase/index.d.ts +122 -6
  237. package/dist/supabase/index.js +4 -3
  238. package/dist/supabase/middleware.d.ts +32 -27
  239. package/dist/supabase/middleware.js +56 -22
  240. package/dist/{supabase-D8UlBA7Z.js → supabase-CwafwxxF.js} +3 -3
  241. package/dist/{supabase-DTxGtYdi.js → supabase-DTBaC20O.js} +345 -367
  242. package/dist/supabase-config-Bs44dare.js +472 -0
  243. package/dist/{supabase-hook-D_OqGb_V.js → supabase-hook-BuxLQLpU.js} +994 -708
  244. package/dist/supabase-hook-D5qVd_D8.js +2 -0
  245. package/dist/supautils-DYZnzRWV.js +91 -0
  246. package/dist/svelte/PermissionBoundary.svelte +37 -0
  247. package/dist/svelte/Protected.svelte +8 -2
  248. package/dist/svelte/index.d.ts +9 -6
  249. package/dist/svelte/index.js +61 -7
  250. package/dist/svelte/runtime.d.ts +4 -3
  251. package/dist/svelte/runtime.js +4 -3
  252. package/dist/svelte/source.d.ts +9 -6
  253. package/dist/svelte/source.js +7 -4
  254. package/dist/terminal/index.d.ts +6 -14
  255. package/dist/terminal/index.js +44 -32
  256. package/dist/testing/index.d.ts +105 -16
  257. package/dist/testing/index.js +504 -40
  258. package/dist/testing/saas/index.d.ts +4 -4
  259. package/dist/testing/saas/index.js +2 -2
  260. package/dist/testing/saas/permissions.d.ts +1 -1
  261. package/dist/testing/saas/permissions.js +1 -1
  262. package/dist/token-CIWxJOCh.js +50 -0
  263. package/dist/trpc/index.d.ts +7 -26
  264. package/dist/trpc/index.js +17 -100
  265. package/dist/types-9AWO9EGt.d.ts +197 -0
  266. package/dist/{types-D6Z6-rKJ.d.ts → types-BPxgszlT.d.ts} +260 -22
  267. package/dist/{types-BvBk1wgn.d.ts → types-BVyImy5I.d.ts} +5 -3
  268. package/dist/{types-CxquUByI.d.ts → types-Bvc4oWT6.d.ts} +1 -1
  269. package/dist/types-C3s9xVJG.d.ts +48 -0
  270. package/dist/{types-BBK-exvJ.d.ts → types-Dnemwd77.d.ts} +7 -1
  271. package/dist/types-kxznc7cn.d.ts +52 -0
  272. package/dist/{types-B8w5PFtS.d.ts → types-vKyAMtcX.d.ts} +17 -1
  273. package/dist/{types-B9dmiiab.d.ts → types-vNSDF7Dq.d.ts} +1 -1
  274. package/dist/{sources-DOpW5Ila.d.ts → types-yF5LmQVD.d.ts} +86 -127
  275. package/dist/unplugin/index.d.ts +1 -1
  276. package/dist/unplugin/index.js +10 -9
  277. package/dist/{usage-1ozMubLY.js → usage-D07N9QJ3.js} +2 -2
  278. package/dist/usage-D82l1CwK.js +2 -0
  279. package/dist/{usage-CUnK6Ou9.js → usage-DG1oeCca.js} +225 -62
  280. package/dist/validation-error-CnjZ4t92.js +33 -0
  281. package/dist/validation-error-CtF23SrC.d.ts +26 -0
  282. package/dist/{validity-D0uRmJKJ.js → validity-uOp8UpYn.js} +57 -36
  283. package/dist/{verifier-B90agnhl.js → verifier-BxBo6I44.js} +10 -5
  284. package/dist/version-BvacVTZR.js +17 -0
  285. package/dist/views-Soe7bGSC.js +95 -0
  286. package/dist/{vocabulary-Dk0fs-Jk.d.ts → vocabulary-DA8a8zif.d.ts} +1 -1
  287. package/dist/vue/index.d.ts +35 -13
  288. package/dist/vue/index.js +86 -93
  289. package/dist/watch-Etoa_Mvr.js +2 -0
  290. package/dist/watch-UihESpsJ.js +128 -0
  291. package/dist/webmcp/index.d.ts +2 -2
  292. package/dist/webmcp/index.js +7 -13
  293. package/package.json +62 -36
  294. package/schemas/approval-request-v1.json +175 -0
  295. package/schemas/catalog-v1.json +29 -1
  296. package/schemas/supabase-claims-v1.json +6 -1
  297. package/schemas/supabase-manifest-v1.json +150 -6
  298. package/skills/permdock/SKILL.md +7 -7
  299. package/skills/permdock-agents/SKILL.md +5 -5
  300. package/skills/permdock-agents/references/runtimes.md +12 -10
  301. package/skills/permdock-approvals/SKILL.md +4 -4
  302. package/skills/permdock-approvals/references/stores-and-resume.md +15 -4
  303. package/skills/permdock-audit/SKILL.md +3 -3
  304. package/skills/permdock-credentials/SKILL.md +4 -4
  305. package/skills/permdock-credentials/references/tokens-keys-links.md +7 -2
  306. package/skills/permdock-data/SKILL.md +4 -4
  307. package/skills/permdock-data/references/queries-and-rls.md +14 -6
  308. package/skills/permdock-data/references/relationships.md +5 -3
  309. package/skills/permdock-tenancy/SKILL.md +9 -6
  310. package/skills/permdock-tenancy/references/ownership-and-custom-roles.md +14 -8
  311. package/skills/permdock-wire/SKILL.md +4 -4
  312. package/skills/permdock-wire/references/adapters.md +42 -30
  313. package/skills/permdock-wire/references/policy-options.md +5 -3
  314. package/dist/approvers-aH0PJkmf.js +0 -20
  315. package/dist/catalog-idsHc0vo.js +0 -2
  316. package/dist/collect-B7_TIfmg.js +0 -49
  317. package/dist/collect-fRPAQIWb.js +0 -2
  318. package/dist/compile-CQbvyIBr.d.ts +0 -30
  319. package/dist/config-BPYmjTOp.js +0 -26
  320. package/dist/context-gtAwAILx.js +0 -6
  321. package/dist/create-BKF3dgFk.d.ts +0 -162
  322. package/dist/create-CSkhDU9T.js +0 -222
  323. package/dist/doctor-BGle8Gqi.js +0 -1314
  324. package/dist/helpers-DnSOrhB9.js +0 -682
  325. package/dist/index-fG6NSXlc.d.ts +0 -9
  326. package/dist/kernel-YOGCWNLf.js +0 -211
  327. package/dist/load-QOOm1z70.js +0 -2
  328. package/dist/manifest-DDQbC6K0.d.ts +0 -118
  329. package/dist/map-error-RJ3ZsUyA.js +0 -16
  330. package/dist/may-use-CnFEjVEp.js +0 -37
  331. package/dist/pg-4GJWDUxG.js +0 -953
  332. package/dist/plugin-4gr7IxFJ.js +0 -65
  333. package/dist/protected-B4K3BKoX.js +0 -138
  334. package/dist/protected-wY7nXhY9.d.ts +0 -23
  335. package/dist/provider-_wx46HpB.js +0 -48
  336. package/dist/rls-CJVja9Ww.js +0 -2119
  337. package/dist/rls-helpers-BxRuif0l.js +0 -1346
  338. package/dist/runtime-DP9ttFh1.js +0 -27
  339. package/dist/skills-Dx3QLnMY.js +0 -110
  340. package/dist/source-DoBBYJi2.js +0 -6
  341. package/dist/sources-DVHM3Mwq.js +0 -284
  342. package/dist/store-C6hFW6ta.js +0 -508
  343. package/dist/subject-settings-xt7V845g.js +0 -82
  344. package/dist/supabase-hook-DW-xP4hU.js +0 -2
  345. package/dist/types-DbWdEfcm.d.ts +0 -87
  346. package/dist/types-bva3i4Gf.d.ts +0 -98
  347. package/dist/types-i4BAOvdb.d.ts +0 -97
  348. package/dist/usage-PyEor6GA.js +0 -2
  349. package/dist/version-CnSh33Fj.js +0 -16
@@ -0,0 +1,18 @@
1
+ //#region src/core/ids.ts
2
+ /**
3
+ * The canonical text of a scope or object id: a non-empty string as is, a
4
+ * finite number or a bigint as its decimal text (a `bigint` key column read
5
+ * through supabase-js arrives as a number), anything else none.
6
+ */
7
+ function idText(value) {
8
+ if (typeof value === "string") return value === "" ? void 0 : value;
9
+ if (typeof value === "number" && Number.isFinite(value)) return String(value);
10
+ if (typeof value === "bigint") return String(value);
11
+ }
12
+ /** Whether two ids are the same id once both are read as text; a missing id matches nothing. */
13
+ function sameId(left, right) {
14
+ const text = idText(left);
15
+ return text !== void 0 && text === idText(right);
16
+ }
17
+ //#endregion
18
+ export { sameId as n, idText as t };
@@ -1,4 +1,4 @@
1
- import { $ as DecisionSink, Et as TokenVerifier, ct as MembershipSource } from "./policy-CInmNGkM.js";
1
+ import { Ft as TokenVerifier, at as DecisionSink, gt as MembershipSource } from "./policy-CFZAr_Al.js";
2
2
  import { n as RevocationFeed } from "./revocations-Cy06JNx2.js";
3
3
  //#region src/scim/types.d.ts
4
4
  declare const SCIM_CONTENT_TYPE = "application/scim+json";
@@ -0,0 +1,6 @@
1
+ import { C as Policy, Nr as Principal } from "./policy-CFZAr_Al.js";
2
+ import { C as SsfPermDock, w as SsfPermDockOptions } from "./types-9AWO9EGt.js";
3
+ //#region src/ssf/create.d.ts
4
+ declare function createPermDock<TUser, TPrincipal extends Principal = Principal>(policy: Policy<TUser, TPrincipal>, options: SsfPermDockOptions): SsfPermDock;
5
+ //#endregion
6
+ export { createPermDock as t };
@@ -1,11 +1,13 @@
1
- import { C as Policy, E as PolicyVocabulary, Er as SqlFunctionCondition, Pn as DenialReason, Sr as OpaqueCondition, Tr as SqlFunctionArg, Z as DecisionEvent, Zt as PermDock, at as LimitStore, cr as CustomRole, ct as MembershipSource, ft as RelationSource, gt as Snapshot, h as Grant, hr as Subject, mr as Principal, pr as Membership, q as AccessEvent, tt as EntitlementSource, ur as Delegation, vr as ConditionRef, w as PolicyDelegation } from "./policy-CInmNGkM.js";
2
- import { d as Permission, n as ActionMeta, p as PermissionTree, t as ActionList, x as ResourceRelationInput, y as ResourceParent } from "./permissions-B4apnahQ.js";
1
+ import { $ as AccessEvent, C as Policy, D as PolicyVocabulary, Dr as CustomRole, Gr as SqlFunctionArg, Kr as SqlFunctionCondition, Lr as ConditionRef, Mr as Membership, Nr as Principal, Pr as Subject, Tt as Snapshot, Vr as OpaqueCondition, Zn as DenialReason, bt as RelationSource, dt as LimitStore, gt as MembershipSource, h as Grant, kr as Delegation, ln as PermDock, pt as LocalSnapshotManifest, rt as DecisionEvent, st as EntitlementSource, w as PolicyDelegation, xt as RoleSource } from "./policy-CFZAr_Al.js";
2
+ import { C as ResourceRelationInput, f as Permission, m as PermissionTree, n as ActionMeta, t as ActionList, w as ResourceRestricted, x as ResourceParent } from "./permissions-DttnqqxC.js";
3
3
  //#region src/core/custom-roles.d.ts
4
- type CustomRoleDropReason = "unknown-permission" | "outside-ceiling" | "condition-not-allowed";
4
+ type CustomRoleDropReason = "unknown-permission" | "outside-ceiling" | "condition-not-allowed" | "unknown-level";
5
5
  /** Why part of a custom role was left out: a permission, or an undeclared include. */
6
6
  type CustomRoleDrop = {
7
7
  readonly permission: string;
8
8
  readonly reason: CustomRoleDropReason;
9
+ /** The stored level, for `unknown-level`. */
10
+ readonly level?: string;
9
11
  } | {
10
12
  readonly role: string;
11
13
  readonly reason: "unknown-role";
@@ -118,13 +120,29 @@ declare function composeMemberships(sources: readonly MembershipSource[]): Membe
118
120
  /**
119
121
  * Trust the memberships the verified token carries, and read `source` only
120
122
  * when the token marks them truncated. With `version`, a token minted before
121
- * the latest membership change is stale for the policy's `fresh` permissions.
123
+ * the latest membership change is stale for the policy's `fresh` permissions,
124
+ * or with `onStale: 'reread'` has its memberships read from `source` instead.
122
125
  */
123
126
  declare function claimsFirst(source: MembershipSource | readonly MembershipSource[], options?: {
124
127
  readonly version?: MembershipSource["version"];
128
+ readonly onStale?: "deny" | "reread";
125
129
  }): MembershipSource;
126
130
  /** Whether the identity provider owns `membership`: the application must not add, change or remove it. */
127
131
  declare function isExternallyManaged(membership: Membership): boolean;
132
+ /**
133
+ * How many principals hold `role` in one scope instance now, from the
134
+ * source's member list (`MembershipSource.list`): live memberships of exactly
135
+ * that scope and instance, each principal counted once. The `holders` a
136
+ * `decideRoleChange` with `min`, `max` or `transferOnly` needs. `undefined`
137
+ * when the source cannot list or the read fails, which that check denies.
138
+ */
139
+ declare function countHolders(source: MembershipSource | readonly MembershipSource[], query: {
140
+ readonly scope: string;
141
+ readonly id: string;
142
+ readonly role: string | {
143
+ readonly key: string;
144
+ };
145
+ }): Promise<number | undefined>;
128
146
  //#endregion
129
147
  //#region src/core/stripe-entitlements.d.ts
130
148
  /** The part of the Stripe Node SDK this source calls: `stripe.entitlements.activeEntitlements.list`. */
@@ -164,6 +182,14 @@ declare function memoryLimitStore(): LimitStore & {
164
182
  size(): number;
165
183
  };
166
184
  //#endregion
185
+ //#region src/core/local-manifest.d.ts
186
+ /**
187
+ * What the policy grants, as JSON a device turns into snapshots from its own
188
+ * membership rows (`localSnapshot` in `permdock/react-native`). Write it at
189
+ * build time; the policy itself never ships to the client.
190
+ */
191
+ declare function localSnapshotManifest(policy: Policy): LocalSnapshotManifest;
192
+ //#endregion
167
193
  //#region src/core/may-access.d.ts
168
194
  /**
169
195
  * An optimistic routing hint for a proxy or middleware, never a decision.
@@ -184,6 +210,48 @@ declare function mayAccess(policy: Policy, user: unknown, permission: Permission
184
210
  * skills, never a decision; the call itself is decided in full.
185
211
  */
186
212
  declare function mayUse(permdock: PermDock, permission: Permission): boolean;
213
+ type PermittedIdsOptions = {
214
+ readonly within?: string;
215
+ readonly conditioned?: boolean;
216
+ };
217
+ /**
218
+ * The instances of `scope` in which the subject holds `permission`, from its
219
+ * live memberships of exactly that scope, within its delegation: by default
220
+ * those with an allow that carries no row condition (`where`, `check`, a
221
+ * validity window or a non-portable test; a `fields` limit is not a row
222
+ * condition), minus the instances any deny of the permission reaches. The
223
+ * in-process mirror of the SQL `permitted_<scope>_ids_by_permission`. With
224
+ * `conditioned: true` it also lists the instances where a conditioned allow
225
+ * applies, minus only unconditional denies, as
226
+ * `permitted_<scope>_ids_by_permission(p_permission, true)` does. A listing,
227
+ * never a decision: a row's own check still runs `can`.
228
+ */
229
+ declare function permittedIds(permdock: PermDock, permission: Permission, scope: string, options?: PermittedIdsOptions): readonly string[];
230
+ //#endregion
231
+ //#region src/core/custom-role-source.d.ts
232
+ /** Reads custom roles from the application's store, as `customRoleSource` takes them. */
233
+ type CustomRoleReader = {
234
+ /** Every custom role of `tenant`, whether or not anyone in the request holds it. */
235
+ rolesOf(tenant: string): CustomRole[] | Promise<CustomRole[]>;
236
+ assignable?(tenant: string): string[] | Promise<string[]>;
237
+ /** Platform custom roles (`scope: 'global'`). */
238
+ globalRoles?(): CustomRole[] | Promise<CustomRole[]>;
239
+ };
240
+ type CustomRoleSourceOptions = {
241
+ /** `'all'` (default): read every custom role of each tenant, so `assignableRoles` and `decideRoleChange` see them all. */
242
+ readonly read?: "all";
243
+ } | {
244
+ /** `'held'`: skip a tenant's read, and the platform read, when every role the subject holds there is declared in `policy`. For requests that never manage roles. */
245
+ readonly read: "held";
246
+ readonly policy: Policy;
247
+ };
248
+ /**
249
+ * A `RoleSource` over a reader that returns every custom role of a tenant.
250
+ * It keeps only the roles of the requested tenant. With `read: 'held'` it
251
+ * skips a tenant's read, and `globalRoles`, when the subject holds only
252
+ * declared roles there.
253
+ */
254
+ declare function customRoleSource(reader: CustomRoleReader, options?: CustomRoleSourceOptions): RoleSource;
187
255
  //#endregion
188
256
  //#region src/core/instance.d.ts
189
257
  type SnapshotInclude = readonly (Permission | {
@@ -256,7 +324,7 @@ type PresetOptions<A extends ActionList | undefined = undefined, C extends Actio
256
324
  readonly id?: string;
257
325
  readonly parent?: ResourceParent;
258
326
  readonly relations?: Readonly<Record<string, ResourceRelationInput>>;
259
- readonly restricted?: string;
327
+ readonly restricted?: string | ResourceRestricted;
260
328
  readonly disclosure?: "hide" | "reveal";
261
329
  readonly actions?: A;
262
330
  readonly collection?: C;
@@ -265,7 +333,7 @@ type PresetResult<BaseA extends Record<string, ActionMeta>, BaseC extends Record
265
333
  readonly id?: string;
266
334
  readonly parent?: ResourceParent;
267
335
  readonly relations?: Readonly<Record<string, ResourceRelationInput>>;
268
- readonly restricted?: string;
336
+ readonly restricted?: string | ResourceRestricted;
269
337
  readonly disclosure?: "hide" | "reveal";
270
338
  readonly actions: MergeActionRecords<BaseA, ToActionRecord<A>>;
271
339
  readonly collection?: MergeActionRecords<BaseC, ToActionRecord<C>>;
@@ -412,4 +480,4 @@ declare function coveredByDelegation(permission: DelegatedPermission, delegation
412
480
  */
413
481
  declare function delegatedPermissions(delegations: readonly PolicyDelegation[] | undefined, subject: Subject, heldRoles: ReadonlySet<string>, now: number): ReadonlySet<string> | undefined;
414
482
  //#endregion
415
- export { emptySnapshot as A, ResolvedCustomRole as B, composeMemberships as C, requiresApproval as D, opaque as E, memoryRelations as F, resolveCustomRole as H, CustomRoleDrop as I, CustomRoleDropReason as L, parseSnapshot as M, MemoryEdge as N, context as O, MemoryRelationsData as P, CustomRoleRename as R, claimsFirst as S, sqlFunction as T, validateCustomRole as U, customRoleClaim as V, mayUse as _, toCsvRow as a, StripeEntitlementsClient as b, OcsfAuthorizeSession as c, parseDuration as d, crud as f, snapshotFor as g, SnapshotForOptions as h, CSV_COLUMNS as i, fromSnapshot as j, principal as k, accessToOcsf as l, writable as m, delegatedPermissions as n, OCSF_VERSION as o, readable as p, catalogFingerprint as r, OcsfAccountChange as s, coveredByDelegation as t, toOcsf as u, mayAccess as v, isExternallyManaged as w, fromStripeEntitlements as x, memoryLimitStore as y, CustomRoleValidation as z };
483
+ export { countHolders as A, MemoryEdge as B, mayAccess as C, fromStripeEntitlements as D, StripeEntitlementsClient as E, context as F, CustomRoleRename as G, memoryRelations as H, principal as I, customRoleClaim as J, CustomRoleValidation as K, emptySnapshot as L, sqlFunction as M, opaque as N, claimsFirst as O, requiresApproval as P, fromSnapshot as R, permittedIds as S, memoryLimitStore as T, CustomRoleDrop as U, MemoryRelationsData as V, CustomRoleDropReason as W, validateCustomRole as X, resolveCustomRole as Y, CustomRoleReader as _, toCsvRow as a, PermittedIdsOptions as b, OcsfAuthorizeSession as c, parseDuration as d, crud as f, snapshotFor as g, SnapshotForOptions as h, CSV_COLUMNS as i, isExternallyManaged as j, composeMemberships as k, accessToOcsf as l, writable as m, delegatedPermissions as n, OCSF_VERSION as o, readable as p, ResolvedCustomRole as q, catalogFingerprint as r, OcsfAccountChange as s, coveredByDelegation as t, toOcsf as u, CustomRoleSourceOptions as v, localSnapshotManifest as w, mayUse as x, customRoleSource as y, parseSnapshot as z };
@@ -1,6 +1,6 @@
1
- import { Mn as Decision, Tt as TokenSigner, ft as RelationSource, hr as Subject, pr as Membership } from "./policy-CInmNGkM.js";
2
- import { d as Permission, p as PermissionTree } from "./permissions-B4apnahQ.js";
3
- import { a as ApprovalListFilter, c as ApprovalRequest, f as ApprovalStore, i as ApprovalInspectResult, m as ApprovalVerdict, r as ApprovalCancelMeta } from "./types-B8w5PFtS.js";
1
+ import { Mr as Membership, Pr as Subject, Pt as TokenSigner, Yn as Decision, bt as RelationSource, ln as PermDock } from "./policy-CFZAr_Al.js";
2
+ import { f as Permission, m as PermissionTree } from "./permissions-DttnqqxC.js";
3
+ import { a as ApprovalListFilter, c as ApprovalRequest, f as ApprovalStore, i as ApprovalInspectResult, m as ApprovalVerdict, o as ApprovalListQuery, r as ApprovalCancelMeta, s as ApprovalPage } from "./types-vKyAMtcX.js";
4
4
  //#region src/approvals/errors.d.ts
5
5
  type ApprovalErrorCode = "approval-not-found" | "approval-not-pending" | "approval-expired" | "approver-unauthenticated" | "approver-is-actor" | "approver-is-principal" | "approver-not-eligible" | "approver-repeated";
6
6
  declare class ApprovalError extends Error {
@@ -22,6 +22,12 @@ type ApprovalsHandlerOptions = {
22
22
  readonly relations?: RelationSource;
23
23
  /** The policy's permission tree, for `through` links and `includes` on relation approvers. */
24
24
  readonly permissions?: PermissionTree;
25
+ /**
26
+ * The approver's own instance in the request's tenant, for
27
+ * `holder(permission)` approvers (custom roles included when the instance
28
+ * reads a `RoleSource`). Without it, or when it throws, they match nobody.
29
+ */
30
+ readonly permdockFor?: (approver: Subject, request: ApprovalRequest) => PermDock | Promise<PermDock>;
25
31
  };
26
32
  declare function approvalsHandler(store: ApprovalStore, options: ApprovalsHandlerOptions): (request: Request) => Promise<Response>;
27
33
  //#endregion
@@ -68,6 +74,13 @@ declare function requestApproval(store: ApprovalStore, decision: Extract<Decisio
68
74
  */
69
75
  declare function resolveApproval(store: ApprovalStore, token: string, verdict: ApprovalVerdict, options?: ApproverRelationsOptions & {
70
76
  readonly requireDistinctApprover?: boolean;
77
+ readonly permdockFor?: ApprovalsHandlerOptions["permdockFor"];
78
+ }): Promise<ApprovalRequest>;
79
+ declare function vouchApproval(store: ApprovalStore, token: string, verdict: {
80
+ readonly status: "approved" | "rejected";
81
+ readonly by: Subject;
82
+ readonly rule: string;
83
+ readonly note?: string;
71
84
  }): Promise<ApprovalRequest>;
72
85
  declare function inspectApproval(store: ApprovalStore, token: string, now?: Date): Promise<ApprovalInspectResult>;
73
86
  /** Inspects `token` and, when it is approved, consumes it so it resumes once. */
@@ -98,6 +111,12 @@ declare function resumeDecision(input: {
98
111
  /** `false` for checks that do not run the action, such as the decision endpoint. */
99
112
  readonly consume?: boolean;
100
113
  readonly now?: Date;
114
+ /**
115
+ * How long a request this call opens stays open, in milliseconds; absent
116
+ * means the store's `ttl`, else `DEFAULT_APPROVAL_TTL_MS`. The grant's
117
+ * `approval.ttl` still caps it.
118
+ */
119
+ readonly ttl?: number;
101
120
  }): Promise<Decision>;
102
121
  declare function cancelApprovals(store: ApprovalStore, filter: ApprovalListFilter, meta: ApprovalCancelMeta): Promise<number>;
103
122
  declare function readApprovalHeader(headers: Headers | {
@@ -106,6 +125,50 @@ declare function readApprovalHeader(headers: Headers | {
106
125
  declare function resumeFromHeader(store: ApprovalStore, headers: Headers | {
107
126
  readonly get: (name: string) => string | null;
108
127
  }, now?: Date): Promise<ApprovalInspectResult>;
128
+ /**
129
+ * The token to resume `decision` with when the caller carries none: the
130
+ * decision's own token when the store holds an approved or rejected request
131
+ * for it, so `resumeDecision` resumes (or denies) the call without the
132
+ * caller passing the token back. The token already binds permission,
133
+ * resource (or the call's data when there is no row id), subject and actor.
134
+ * A pending request counts only with `denyPending: true`, which makes the
135
+ * call deny with `approval-pending` instead of asking again. `undefined` when
136
+ * the decision needs no approval, there is no store, or the store has no
137
+ * unexpired request for the token; a store that throws counts as none.
138
+ */
139
+ declare function storedApprovalToken(store: ApprovalStore | undefined, decision: Decision, options?: {
140
+ readonly denyPending?: boolean;
141
+ readonly now?: Date;
142
+ }): Promise<string | undefined>;
143
+ //#endregion
144
+ //#region src/approvals/page.d.ts
145
+ /** The page size of a query: `limit` within 1 to 200, 50 when absent. */
146
+ declare function approvalPageSize(limit: number | undefined): number;
147
+ /** Where a page starts: the `(createdAt, token)` of the last request before it. */
148
+ type ApprovalCursorPosition = readonly [createdAt: string, token: string];
149
+ /** The `next` cursor after `request`, for a store that pages in its own query. */
150
+ declare function encodeApprovalCursor(request: ApprovalRequest): string;
151
+ /** The `(createdAt, token)` position a `next` cursor names, or `null` for one that does not parse. */
152
+ declare function decodeApprovalCursor(cursor: string): ApprovalCursorPosition | null;
153
+ /**
154
+ * Pages already-filtered requests in `(createdAt, token)` order, as the
155
+ * built-in stores do: `limit` within 1 to 200 (50 when absent), `cursor` from
156
+ * the previous page's `next`, and no items for a cursor that does not parse.
157
+ * A custom `ApprovalStore` that filters in memory returns it from `list`.
158
+ */
159
+ declare function pageApprovals(matching: readonly ApprovalRequest[], query: ApprovalListQuery): ApprovalPage;
160
+ /** Every matching request of `store`, following `next` until the last page (at most 1000 pages of 200). */
161
+ declare function listAllApprovals(store: ApprovalStore, filter: ApprovalListFilter): Promise<ApprovalRequest[]>;
162
+ //#endregion
163
+ //#region src/approvals/permissions.d.ts
164
+ /**
165
+ * The `holder(permission)` approvers of `request` that `approver` holds, for
166
+ * `ApprovalVerdict.permissions`: each permission key the approver's own
167
+ * instance grants without a row. `approver` must be an instance for the
168
+ * approving principal in the request's tenant; for any other tenant, or an
169
+ * anonymous instance, it holds nothing. A check that throws holds nothing.
170
+ */
171
+ declare function approverPermissions(request: ApprovalRequest, approver: PermDock): readonly string[];
109
172
  //#endregion
110
173
  //#region src/approvals/store.d.ts
111
174
  /**
@@ -118,7 +181,7 @@ declare function resumeFromHeader(store: ApprovalStore, headers: Headers | {
118
181
  * two stages. `relations` are the relation approvers `by` holds on the
119
182
  * request's resource (see `ApprovalVerdict.relations`).
120
183
  */
121
- declare function assertApprover(request: ApprovalRequest, by: Subject, requireDistinctApprover: boolean, now?: Date, relations?: readonly string[]): number | undefined;
184
+ declare function assertApprover(request: ApprovalRequest, by: Subject, requireDistinctApprover: boolean, now?: Date, relations?: readonly string[], permissions?: readonly string[]): number | undefined;
122
185
  /**
123
186
  * The request after `verdict`, for a store to persist: a rejection resolves
124
187
  * it; an approval is appended to `approvals` and resolves it once there are
@@ -135,4 +198,4 @@ declare function memoryApprovalStore(options?: {
135
198
  readonly ttl?: number;
136
199
  }): MemoryApprovalStore;
137
200
  //#endregion
138
- export { approvalsHandler as _, cancelApprovals as a, isApprovalError as b, readApprovalHeader as c, resumeDecision as d, resumeFromHeader as f, ApprovalsHandlerOptions as g, approverRelations as h, memoryApprovalStore as i, requestApproval as l, ApproverRelationsOptions as m, applyApprovalVerdict as n, consumeApproval as o, summariseSubject as p, assertApprover as r, inspectApproval as s, MemoryApprovalStore as t, resolveApproval as u, ApprovalError as v, ApprovalErrorCode as y };
201
+ export { ApproverRelationsOptions as C, ApprovalError as D, approvalsHandler as E, ApprovalErrorCode as O, vouchApproval as S, ApprovalsHandlerOptions as T, resolveApproval as _, approverPermissions as a, storedApprovalToken as b, decodeApprovalCursor as c, pageApprovals as d, cancelApprovals as f, requestApproval as g, readApprovalHeader as h, memoryApprovalStore as i, isApprovalError as k, encodeApprovalCursor as l, inspectApproval as m, applyApprovalVerdict as n, ApprovalCursorPosition as o, consumeApproval as p, assertApprover as r, approvalPageSize as s, MemoryApprovalStore as t, listAllApprovals as u, resumeDecision as v, approverRelations as w, summariseSubject as x, resumeFromHeader as y };
package/dist/index.d.ts CHANGED
@@ -1,11 +1,16 @@
1
- import { $ as DecisionSink, $n as relation, $t as RowPair, A as RoleScope, An as memoryApprovalPolicies, Ar as isConditionRef, At as memoryEntitlementSource, B as normalizeAssurance, Bn as Obligation, Bt as CredentialPolicy, C as Policy, Cn as ArazzoPlan, Cr as RelatedCondition, Ct as TenantSettings, D as PrincipalOf, Dn as simulateArazzo, Dr as hasConditionOp, Dt as VerificationFailure, En as arazzoFindings, Er as SqlFunctionCondition, Et as TokenVerifier, F as ValidateMode, Fn as DeniedDecision, Ft as Credential, G as UserApprover, Gn as Grantee, Gt as credentialDelegation, H as separationConflicts, Hn as Trace, Ht as CredentialPrincipal, I as allow, In as ExplainedDecision, It as CredentialDecision, J as AuthEvent, Jn as actor, Jt as decideCredential, K as user, Kn as GranteeInput, Kt as credentialPolicyViolation, L as definePolicy, Ln as GrantedDecision, Lt as CredentialKind, M as SubjectOf, Mn as Decision, Mt as memorySettings, N as SupportAccessOptions, Nn as Denial, Nt as WireDecision, O as RoleBinding, On as ApprovalPolicy, Or as isCondition, Ot as VerifiedToken, P as SupportConsent, Pn as DenialReason, Pt as WireDenial, Q as DecisionProvider, Qn as plan, Qt as PermDockOptions, R as deny, Rn as LimitDetail, Rt as CredentialPermission, S as MembershipFixture, Sn as ArazzoFinding, St as SubjectResolver, T as PolicyScopes, Tn as ArazzoStepResult, Tr as SqlFunctionArg, Tt as TokenSigner, U as Approver, Un as TraceSkip, Ut as CredentialRequest, V as role, Vn as Quota, Vt as CredentialPolicyViolation, W as ApproverInput, Wn as TraceSkipReason, Wt as DecideCredentialOptions, X as CredentialVerifier, Xn as assurance, Xt as DecideOptions, Y as CredentialEvent, Yn as anyone, Yt as parseCredential, Z as DecisionEvent, Zn as authenticated, Zt as PermDock, _ as GrantLimit, _n as RoleChangeOptions, _r as Condition, _t as SnapshotAssignable, a as ApprovalRequirement, an as HostedGrantDropped, ar as Assurance, at as LimitStore, b as GrantValidity, bn as breakGlass, br as MemberOfCondition, bt as SnapshotScope, c as BreakGlassOptions, cn as isPortableCondition, cr as CustomRole, ct as MembershipSource, d as ClosureContext, dn as parsePolicyDocument, dr as GnapAccess, dt as RelationHolder, en as SimulateOptions, er as PolicyScopesInput, et as DirectoryEvent, f as ClosureGrantFn, fn as Holder, ft as RelationSource, g as GrantCondition, gn as RoleChangeDecision, gr as VerifiedClaims, gt as Snapshot, h as Grant, hn as RoleChange, hr as Subject, ht as SinkEvent, i as ApprovalOption, in as HostedGrantDropReason, ir as Actor, it as LimitRemaining, j as SeparationConflict, jn as ApprovalRequiredDecision, jr as isSqlFunctionField, jt as memoryRoleSource, k as RoleOptions, kn as ApprovalPolicySource, kr as isConditionDate, kt as WhereCompiler, l as BreakGlassRequirements, ln as memoryPolicySource, lr as CustomRoleGrant, lt as RelationChain, m as DelegationTarget, mn as WhoCan, mr as Principal, mt as SettingsSource, n as ApprovalEscalation, nn as createPermDock, nr as ScopeDeclaration, o as ApprovalStage, on as PolicyDocument, or as AuthorizationDetail, ot as MemberEntry, p as DelegationInput, pn as HoldingVia, pr as Membership, pt as RoleSource, q as AccessEvent, qn as RelationGrantee, qt as credentialSubject, r as ApprovalMode, rn as HostedGrant, rr as ScopeNames, rt as LimitConsumeInput, s as AssuranceRequirement, sn as PolicySource, sr as Binding, st as MembershipEvent, t as ActivationOption, tn as WhereResult, tr as Scope, tt as EntitlementSource, u as BreakGlassSpec, un as mergeHostedGrants, ur as Delegation, ut as RelationGroup, v as GrantOptions, vn as RoleChangeTarget, vr as ConditionRef, vt as SnapshotGrant, w as PolicyDelegation, wn as ArazzoSimulateInput, wr as RelatedHop, wt as TokenFailureCause, x as HostedGrantRef, xn as supportAccess, xr as MemberOfParent, xt as SnapshotSource, y as GrantScope, yn as ActivateInput, yr as ConditionValue, yt as SnapshotNotEntitled, z as normalizeApproval, zn as MatchedGrant, zt as CredentialPermissionInput } from "./policy-CInmNGkM.js";
2
- import { C as findPermission, D as listPermissions, E as isPermission, O as mergePermissions, S as definePermissions, T as getResource, _ as ResourceNode, a as EdgeGroups, b as ResourceRelation, c as FieldRelation, d as Permission, f as PermissionKind, g as ResourceLink, h as ResourceInit, i as DefinePermissionsOptions, k as resource, m as PrincipalRelation, n as ActionMeta, o as EdgeMatch, p as PermissionTree, r as ComputedRelation, s as EdgeRelation, u as MetaValue, v as ResourceOptions, w as formerKeys, x as ResourceRelationInput, y as ResourceParent } from "./permissions-B4apnahQ.js";
3
- import { a as RoleTree, c as defineRoles, d as isRole, f as listPlans, i as RoleMeta, l as findRole, n as PlanTree, o as Vocabulary, p as listRoles, r as Role, s as definePlans, t as Plan, u as isPlan } from "./vocabulary-Dk0fs-Jk.js";
4
- import { A as emptySnapshot, B as ResolvedCustomRole, C as composeMemberships, D as requiresApproval, E as opaque, F as memoryRelations, H as resolveCustomRole, I as CustomRoleDrop, L as CustomRoleDropReason, M as parseSnapshot, N as MemoryEdge, O as context, P as MemoryRelationsData, R as CustomRoleRename, S as claimsFirst, T as sqlFunction, U as validateCustomRole, V as customRoleClaim, _ as mayUse, a as toCsvRow, b as StripeEntitlementsClient, c as OcsfAuthorizeSession, d as parseDuration, f as crud, g as snapshotFor, h as SnapshotForOptions, i as CSV_COLUMNS, j as fromSnapshot, k as principal, l as accessToOcsf, m as writable, n as delegatedPermissions, o as OCSF_VERSION, p as readable, r as catalogFingerprint, s as OcsfAccountChange, t as coveredByDelegation, u as toOcsf, v as mayAccess, w as isExternallyManaged, x as fromStripeEntitlements, y as memoryLimitStore, z as CustomRoleValidation } from "./index-xIxJLwOQ.js";
5
- import { a as PermDockValidationError, i as PermDockRevokedError, n as PermDockApprovalRequiredError, o as ProblemDetails, r as PermDockDeniedError, s as RevokedCode } from "./errors-DbZ1YOnb.js";
6
- import { a as CloudEvent, c as MemorySinkOptions, d as credentialEvent, f as membershipEvent, h as toCloudEvent, i as CatalogFindingCode, l as SignDecisionBatchOptions, m as signDecisionBatch, n as CatalogEventData, o as CloudEventType, p as memorySink, r as CatalogFinding, s as MemorySink, t as CLOUD_EVENT_TYPES, u as accessEvent } from "./sink-Cfr9-7YC.js";
1
+ import { $ as AccessEvent, $n as ExplainedDecision, $t as CredentialPrincipal, A as RoleOptions, An as RoleChangeOptions, Ar as GnapAccess, At as SnapshotSource, B as normalizeApproval, Bn as simulateArazzo, Br as MemberOfParent, Bt as memoryMembershipSource, C as Policy, Cn as mergeHostedGrants, Cr as Actor, Ct as SettingsSource, Dn as WhoCan, Dr as CustomRole, Dt as SnapshotGrant, E as PolicyScopes, En as HoldingVia, Er as Binding, Et as SnapshotAssignable, F as SupportConsent, Fn as ArazzoFinding, Fr as VerifiedClaims, Ft as TokenVerifier, G as Approver, Gn as ApprovalPolicyValidation, Gr as SqlFunctionArg, Gt as WireDenial, H as role, Hn as ApprovalPolicy, Hr as RelatedCondition, Ht as memorySettings, I as ValidateMode, In as ArazzoPlan, Ir as Condition, It as VerificationFailure, J as UserApprover, Jn as ApprovalRequiredDecision, Jr as isCondition, Jt as CredentialKind, K as ApproverInput, Kn as memoryApprovalPolicies, Kr as SqlFunctionCondition, Kt as Credential, L as allow, Ln as ArazzoSimulateInput, Lr as ConditionRef, Lt as VerifiedToken, M as SeparationConflict, Mn as ActivateInput, Mr as Membership, Mt as TenantSettings, N as SubjectOf, Nn as breakGlass, Nr as Principal, Nt as TokenFailureCause, O as PrincipalOf, On as RoleChange, Or as CustomRoleGrant, Ot as SnapshotNotEntitled, P as SupportAccessOptions, Pn as supportAccess, Pr as Subject, Pt as TokenSigner, Q as user, Qn as DeniedDecision, Qt as CredentialPolicyViolation, R as definePolicy, Rn as ArazzoStepResult, Rr as ConditionValue, Rt as WhereCompiler, S as MembershipFixture, Sn as memoryPolicySource, Sr as ScopeNames, St as RoleSourceFactory, T as PolicyOAuthScope, Tn as Holder, Tr as AuthorizationDetail, Tt as Snapshot, U as separationConflicts, Un as ApprovalPolicyProblem, Ur as RelatedHop, Ut as memorySnapshotSource, V as normalizeAssurance, Vn as APPROVAL_POLICY_UNAVAILABLE, Vt as memoryRoleSource, W as AnyOfApprover, Wn as ApprovalPolicySource, Wr as RestrictedAncestors, Wt as WireDecision, X as anyOf, Xn as Denial, Xr as isConditionRef, Xt as CredentialPermissionInput, Y as allOf, Yn as Decision, Yr as isConditionDate, Yt as CredentialPermission, Z as holder, Zn as DenialReason, Zr as isSqlFunctionField, Zt as CredentialPolicy, _ as GrantLimit, _n as HostedGrantDropReason, _r as plan, _t as RelationChain, a as ApprovalRequirement, an as decideCredential, ar as Trace, at as DecisionSink, b as GrantValidity, bn as PolicySource, br as Scope, bt as RelationSource, c as BreakGlassOptions, cn as DeriveOptions, cr as Grantee, d as ClosureContext, dn as RowPair, dr as RelationGrantee, dt as LimitStore, en as CredentialRequest, er as GrantedDecision, et as AuthEvent, f as ClosureGrantFn, fn as SimulateOptions, fr as actor, ft as LocalCustomRoleTable, g as GrantCondition, gn as HostedGrant, gr as inherit, gt as MembershipSource, h as Grant, hn as createPermDock, hr as authenticated, ht as MembershipEvent, i as ApprovalOption, in as credentialSubject, ir as Quota, it as DecisionProvider, j as RoleScope, jn as RoleChangeTarget, jt as SubjectResolver, k as RoleBinding, kn as RoleChangeDecision, kr as Delegation, kt as SnapshotScope, l as BreakGlassRequirements, ln as PermDock, lr as GranteeInput, lt as LimitConsumeInput, m as DelegationTarget, mn as WhereResult, mr as assurance, mt as MemberEntry, n as ApprovalEscalation, nn as credentialDelegation, nr as MatchedGrant, nt as CredentialVerifier, o as ApprovalStage, on as parseCredential, or as TraceSkip, ot as DirectoryEvent, p as DelegationInput, pn as SnapshotOptions, pr as anyone, pt as LocalSnapshotManifest, q as PermissionApprover, qn as validateApprovalPolicy, qr as hasConditionOp, qt as CredentialDecision, r as ApprovalMode, rn as credentialPolicyViolation, rr as Obligation, rt as DecisionEvent, s as AssuranceRequirement, sn as DecideOptions, sr as TraceSkipReason, st as EntitlementSource, t as ActivationOption, tn as DecideCredentialOptions, tr as LimitDetail, tt as CredentialEvent, u as BreakGlassSpec, un as PermDockOptions, ur as InheritGrantee, ut as LimitRemaining, v as GrantOptions, vn as HostedGrantDropped, vr as relation, vt as RelationGroup, w as PolicyDelegation, wn as parsePolicyDocument, wr as Assurance, wt as SinkEvent, x as HostedGrantRef, xn as isPortableCondition, xr as ScopeDeclaration, xt as RoleSource, y as GrantScope, yn as PolicyDocument, yr as PolicyScopesInput, yt as RelationHolder, z as deny, zn as arazzoFindings, zr as MemberOfCondition, zt as memoryEntitlementSource } from "./policy-CFZAr_Al.js";
2
+ import { A as listPermissions, C as ResourceRelationInput, D as formerKeys, E as findPermission, M as resource, O as getResource, S as ResourceRelation, T as definePermissions, _ as ResourceLevel, a as EdgeGroup, b as ResourceOptions, c as EdgeRelation, d as MetaValue, f as Permission, g as ResourceInit, h as PrincipalRelation, i as DefinePermissionsOptions, j as mergePermissions, k as isPermission, l as FieldRelation, m as PermissionTree, n as ActionMeta, o as EdgeGroups, p as PermissionKind, r as ComputedRelation, s as EdgeMatch, v as ResourceLink, w as ResourceRestricted, x as ResourceParent, y as ResourceNode } from "./permissions-DttnqqxC.js";
3
+ import { a as RoleTree, c as defineRoles, d as isRole, f as listPlans, i as RoleMeta, l as findRole, n as PlanTree, o as Vocabulary, p as listRoles, r as Role, s as definePlans, t as Plan, u as isPlan } from "./vocabulary-DA8a8zif.js";
4
+ import { A as countHolders, B as MemoryEdge, C as mayAccess, D as fromStripeEntitlements, E as StripeEntitlementsClient, F as context, G as CustomRoleRename, H as memoryRelations, I as principal, J as customRoleClaim, K as CustomRoleValidation, L as emptySnapshot, M as sqlFunction, N as opaque, O as claimsFirst, P as requiresApproval, R as fromSnapshot, S as permittedIds, T as memoryLimitStore, U as CustomRoleDrop, V as MemoryRelationsData, W as CustomRoleDropReason, X as validateCustomRole, Y as resolveCustomRole, _ as CustomRoleReader, a as toCsvRow, b as PermittedIdsOptions, c as OcsfAuthorizeSession, d as parseDuration, f as crud, g as snapshotFor, h as SnapshotForOptions, i as CSV_COLUMNS, j as isExternallyManaged, k as composeMemberships, l as accessToOcsf, m as writable, n as delegatedPermissions, o as OCSF_VERSION, p as readable, q as ResolvedCustomRole, r as catalogFingerprint, s as OcsfAccountChange, t as coveredByDelegation, u as toOcsf, v as CustomRoleSourceOptions, w as localSnapshotManifest, x as mayUse, y as customRoleSource, z as parseSnapshot } from "./index-D3vbkoSI.js";
5
+ import { n as PermDockValidationError } from "./validation-error-CtF23SrC.js";
6
+ import { n as requiredPlans } from "./problem-details-CkL50EEf.js";
7
+ import { a as ProblemDetails, i as PermDockRevokedError, n as PermDockApprovalRequiredError, o as RevokedCode, r as PermDockDeniedError } from "./errors-DAqevpNk.js";
8
+ import { t as InstanceOptions } from "./instance-options-BK_rNOSC.js";
9
+ import { t as ClientNames } from "./clients-C7zLFuWT.js";
10
+ import { a as CloudEvent, c as MemorySinkOptions, d as credentialEvent, f as membershipEvent, h as toCloudEvent, i as CatalogFindingCode, l as SignDecisionBatchOptions, m as signDecisionBatch, n as CatalogEventData, o as CloudEventType, p as memorySink, r as CatalogFinding, s as MemorySink, t as CLOUD_EVENT_TYPES, u as accessEvent } from "./sink-Gs6TTVa-.js";
7
11
  import { i as memoryRevocationFeed, n as RevocationFeed, r as RevocationListener, t as RevocationEvent } from "./revocations-Cy06JNx2.js";
8
- import { a as requiredPlans, i as describe, n as DescribeMessages, r as DescribeOptions, t as DecisionDescription } from "./describe-DernyItf.js";
12
+ import { i as describe, n as DescribeMessages, r as DescribeOptions, t as DecisionDescription } from "./describe-PdoqESvg.js";
9
13
  import { n as parsePermDockDigest, t as PermDockDigest } from "./digest-B3kc_PgQ.js";
10
- import { a as LinkPolicyViolation, c as capabilitySubject, d as signCapability, i as LinkPolicy, l as linkPolicyViolation, n as CapabilityInput, o as LinkPrincipal, r as CapabilityRedeemer, s as SignCapabilityOptions, t as Capability, u as parseCapability } from "./capability-BDG_nkxt.js";
11
- export { type AccessEvent, type ActionMeta, type ActivateInput, type ActivationOption, type Actor, type ApprovalEscalation, type ApprovalMode, type ApprovalOption, type ApprovalPolicy, type ApprovalPolicySource, type ApprovalRequiredDecision, type ApprovalRequirement, type ApprovalStage, type Approver, type ApproverInput, type ArazzoFinding, type ArazzoPlan, type ArazzoSimulateInput, type ArazzoStepResult, type Assurance, type AssuranceRequirement, type AuthEvent, type AuthorizationDetail, type Binding, type BreakGlassOptions, type BreakGlassRequirements, type BreakGlassSpec, CLOUD_EVENT_TYPES, CSV_COLUMNS, type Capability, type CapabilityInput, type CapabilityRedeemer, type CatalogEventData, type CatalogFinding, type CatalogFindingCode, type ClosureContext, type ClosureGrantFn, type CloudEvent, type CloudEventType, type ComputedRelation, type Condition, type ConditionRef, type ConditionValue, type Credential, type CredentialDecision, type CredentialEvent, type CredentialKind, type CredentialPermission, type CredentialPermissionInput, type CredentialPolicy, type CredentialPolicyViolation, type CredentialPrincipal, type CredentialRequest, type CredentialVerifier, type CustomRole, type CustomRoleDrop, type CustomRoleDropReason, type CustomRoleGrant, type CustomRoleRename, type CustomRoleValidation, type DecideCredentialOptions, type DecideOptions, type Decision, type DecisionDescription, type DecisionEvent, type DecisionProvider, type DecisionSink, type DefinePermissionsOptions, type Delegation, type DelegationInput, type DelegationTarget, type Denial, type DenialReason, type DeniedDecision, type DescribeMessages, type DescribeOptions, type DirectoryEvent, type EdgeGroups, type EdgeMatch, type EdgeRelation, type EntitlementSource, type ExplainedDecision, type FieldRelation, type GnapAccess, type Grant, type GrantCondition, type GrantLimit, type GrantOptions, type GrantScope, type GrantValidity, type GrantedDecision, type Grantee, type GranteeInput, type Holder, type HoldingVia, type HostedGrant, type HostedGrantDropReason, type HostedGrantDropped, type HostedGrantRef, type LimitConsumeInput, type LimitDetail, type LimitRemaining, type LimitStore, type LinkPolicy, type LinkPolicyViolation, type LinkPrincipal, type MatchedGrant, type MemberEntry, type MemberOfCondition, type MemberOfParent, type Membership, type MembershipEvent, type MembershipFixture, type MembershipSource, type MemoryEdge, type MemoryRelationsData, type MemorySink, type MemorySinkOptions, type MetaValue, OCSF_VERSION, type Obligation, type OcsfAccountChange, type OcsfAuthorizeSession, type PermDock, PermDockApprovalRequiredError, PermDockDeniedError, type PermDockDigest, type PermDockOptions, PermDockRevokedError, PermDockValidationError, type Permission, type PermissionKind, type PermissionTree, type Plan, type PlanTree, type Policy, type PolicyDelegation, type PolicyDocument, type PolicyScopes, type PolicyScopesInput, type PolicySource, type Principal, type PrincipalOf, type PrincipalRelation, type ProblemDetails, type Quota, type RelatedCondition, type RelatedHop, type RelationChain, type RelationGrantee, type RelationGroup, type RelationHolder, type RelationSource, type ResolvedCustomRole, type ResourceInit, type ResourceLink, type ResourceNode, type ResourceOptions, type ResourceParent, type ResourceRelation, type ResourceRelationInput, type RevocationEvent, type RevocationFeed, type RevocationListener, type RevokedCode, type Role, type RoleBinding, type RoleChange, type RoleChangeDecision, type RoleChangeOptions, type RoleChangeTarget, type RoleMeta, type RoleOptions, type RoleScope, type RoleSource, type RoleTree, type RowPair, type Scope, type ScopeDeclaration, type ScopeNames, type SeparationConflict, type SettingsSource, type SignCapabilityOptions, type SignDecisionBatchOptions, type SimulateOptions, type SinkEvent, type Snapshot, type SnapshotAssignable, type SnapshotForOptions, type SnapshotGrant, type SnapshotNotEntitled, type SnapshotScope, type SnapshotSource, type SqlFunctionArg, type SqlFunctionCondition, type StripeEntitlementsClient, type Subject, type SubjectOf, type SubjectResolver, type SupportAccessOptions, type SupportConsent, type TenantSettings, type TokenFailureCause, type TokenSigner, type TokenVerifier, type Trace, type TraceSkip, type TraceSkipReason, type UserApprover, type ValidateMode, type VerificationFailure, type VerifiedClaims, type VerifiedToken, type Vocabulary, type WhereCompiler, type WhereResult, type WhoCan, type WireDecision, type WireDenial, accessEvent, accessToOcsf, actor, allow, anyone, arazzoFindings, assurance, authenticated, breakGlass, capabilitySubject, catalogFingerprint, claimsFirst, composeMemberships, context, coveredByDelegation, createPermDock, credentialDelegation, credentialEvent, credentialPolicyViolation, credentialSubject, crud, customRoleClaim, decideCredential, definePermissions, definePlans, definePolicy, defineRoles, delegatedPermissions, deny, describe, emptySnapshot, findPermission, findRole, formerKeys, fromSnapshot, fromStripeEntitlements, getResource, hasConditionOp, isCondition, isConditionDate, isConditionRef, isExternallyManaged, isPermission, isPlan, isPortableCondition, isRole, isSqlFunctionField, linkPolicyViolation, listPermissions, listPlans, listRoles, mayAccess, mayUse, membershipEvent, memoryApprovalPolicies, memoryEntitlementSource, memoryLimitStore, memoryPolicySource, memoryRelations, memoryRevocationFeed, memoryRoleSource, memorySettings, memorySink, mergeHostedGrants, mergePermissions, normalizeApproval, normalizeAssurance, opaque, parseCapability, parseCredential, parseDuration, parsePermDockDigest, parsePolicyDocument, parseSnapshot, plan, principal, readable, relation, requiredPlans, requiresApproval, resolveCustomRole, resource, role, separationConflicts, signCapability, signDecisionBatch, simulateArazzo, snapshotFor, sqlFunction, supportAccess, toCloudEvent, toCsvRow, toOcsf, user, validateCustomRole, writable };
14
+ import { t as parseLocalSnapshotManifest } from "./parse-local-manifest-BkGQNzAh.js";
15
+ import { a as LinkPolicyViolation, c as capabilitySubject, d as signCapability, i as LinkPolicy, l as linkPolicyViolation, n as CapabilityInput, o as LinkPrincipal, r as CapabilityRedeemer, s as SignCapabilityOptions, t as Capability, u as parseCapability } from "./capability-Dq43tT1u.js";
16
+ export { APPROVAL_POLICY_UNAVAILABLE, type AccessEvent, type ActionMeta, type ActivateInput, type ActivationOption, type Actor, type AnyOfApprover, type ApprovalEscalation, type ApprovalMode, type ApprovalOption, type ApprovalPolicy, type ApprovalPolicyProblem, type ApprovalPolicySource, type ApprovalPolicyValidation, type ApprovalRequiredDecision, type ApprovalRequirement, type ApprovalStage, type Approver, type ApproverInput, type ArazzoFinding, type ArazzoPlan, type ArazzoSimulateInput, type ArazzoStepResult, type Assurance, type AssuranceRequirement, type AuthEvent, type AuthorizationDetail, type Binding, type BreakGlassOptions, type BreakGlassRequirements, type BreakGlassSpec, CLOUD_EVENT_TYPES, CSV_COLUMNS, type Capability, type CapabilityInput, type CapabilityRedeemer, type CatalogEventData, type CatalogFinding, type CatalogFindingCode, type ClientNames, type ClosureContext, type ClosureGrantFn, type CloudEvent, type CloudEventType, type ComputedRelation, type Condition, type ConditionRef, type ConditionValue, type Credential, type CredentialDecision, type CredentialEvent, type CredentialKind, type CredentialPermission, type CredentialPermissionInput, type CredentialPolicy, type CredentialPolicyViolation, type CredentialPrincipal, type CredentialRequest, type CredentialVerifier, type CustomRole, type CustomRoleDrop, type CustomRoleDropReason, type CustomRoleGrant, type CustomRoleReader, type CustomRoleRename, type CustomRoleSourceOptions, type CustomRoleValidation, type DecideCredentialOptions, type DecideOptions, type Decision, type DecisionDescription, type DecisionEvent, type DecisionProvider, type DecisionSink, type DefinePermissionsOptions, type Delegation, type DelegationInput, type DelegationTarget, type Denial, type DenialReason, type DeniedDecision, type DeriveOptions, type DescribeMessages, type DescribeOptions, type DirectoryEvent, type EdgeGroup, type EdgeGroups, type EdgeMatch, type EdgeRelation, type EntitlementSource, type ExplainedDecision, type FieldRelation, type GnapAccess, type Grant, type GrantCondition, type GrantLimit, type GrantOptions, type GrantScope, type GrantValidity, type GrantedDecision, type Grantee, type GranteeInput, type Holder, type HoldingVia, type HostedGrant, type HostedGrantDropReason, type HostedGrantDropped, type HostedGrantRef, type InheritGrantee, type InstanceOptions, type LimitConsumeInput, type LimitDetail, type LimitRemaining, type LimitStore, type LinkPolicy, type LinkPolicyViolation, type LinkPrincipal, type LocalCustomRoleTable, type LocalSnapshotManifest, type MatchedGrant, type MemberEntry, type MemberOfCondition, type MemberOfParent, type Membership, type MembershipEvent, type MembershipFixture, type MembershipSource, type MemoryEdge, type MemoryRelationsData, type MemorySink, type MemorySinkOptions, type MetaValue, OCSF_VERSION, type Obligation, type OcsfAccountChange, type OcsfAuthorizeSession, type PermDock, PermDockApprovalRequiredError, PermDockDeniedError, type PermDockDigest, type PermDockOptions, PermDockRevokedError, PermDockValidationError, type Permission, type PermissionApprover, type PermissionKind, type PermissionTree, type PermittedIdsOptions, type Plan, type PlanTree, type Policy, type PolicyDelegation, type PolicyDocument, type PolicyOAuthScope, type PolicyScopes, type PolicyScopesInput, type PolicySource, type Principal, type PrincipalOf, type PrincipalRelation, type ProblemDetails, type Quota, type RelatedCondition, type RelatedHop, type RelationChain, type RelationGrantee, type RelationGroup, type RelationHolder, type RelationSource, type ResolvedCustomRole, type ResourceInit, type ResourceLevel, type ResourceLink, type ResourceNode, type ResourceOptions, type ResourceParent, type ResourceRelation, type ResourceRelationInput, type ResourceRestricted, type RestrictedAncestors, type RevocationEvent, type RevocationFeed, type RevocationListener, type RevokedCode, type Role, type RoleBinding, type RoleChange, type RoleChangeDecision, type RoleChangeOptions, type RoleChangeTarget, type RoleMeta, type RoleOptions, type RoleScope, type RoleSource, type RoleSourceFactory, type RoleTree, type RowPair, type Scope, type ScopeDeclaration, type ScopeNames, type SeparationConflict, type SettingsSource, type SignCapabilityOptions, type SignDecisionBatchOptions, type SimulateOptions, type SinkEvent, type Snapshot, type SnapshotAssignable, type SnapshotForOptions, type SnapshotGrant, type SnapshotNotEntitled, type SnapshotOptions, type SnapshotScope, type SnapshotSource, type SqlFunctionArg, type SqlFunctionCondition, type StripeEntitlementsClient, type Subject, type SubjectOf, type SubjectResolver, type SupportAccessOptions, type SupportConsent, type TenantSettings, type TokenFailureCause, type TokenSigner, type TokenVerifier, type Trace, type TraceSkip, type TraceSkipReason, type UserApprover, type ValidateMode, type VerificationFailure, type VerifiedClaims, type VerifiedToken, type Vocabulary, type WhereCompiler, type WhereResult, type WhoCan, type WireDecision, type WireDenial, accessEvent, accessToOcsf, actor, allOf, allow, anyOf, anyone, arazzoFindings, assurance, authenticated, breakGlass, capabilitySubject, catalogFingerprint, claimsFirst, composeMemberships, context, countHolders, coveredByDelegation, createPermDock, credentialDelegation, credentialEvent, credentialPolicyViolation, credentialSubject, crud, customRoleClaim, customRoleSource, decideCredential, definePermissions, definePlans, definePolicy, defineRoles, delegatedPermissions, deny, describe, emptySnapshot, findPermission, findRole, formerKeys, fromSnapshot, fromStripeEntitlements, getResource, hasConditionOp, holder, inherit, isCondition, isConditionDate, isConditionRef, isExternallyManaged, isPermission, isPlan, isPortableCondition, isRole, isSqlFunctionField, linkPolicyViolation, listPermissions, listPlans, listRoles, localSnapshotManifest, mayAccess, mayUse, membershipEvent, memoryApprovalPolicies, memoryEntitlementSource, memoryLimitStore, memoryMembershipSource, memoryPolicySource, memoryRelations, memoryRevocationFeed, memoryRoleSource, memorySettings, memorySink, memorySnapshotSource, mergeHostedGrants, mergePermissions, normalizeApproval, normalizeAssurance, opaque, parseCapability, parseCredential, parseDuration, parseLocalSnapshotManifest, parsePermDockDigest, parsePolicyDocument, parseSnapshot, permittedIds, plan, principal, readable, relation, requiredPlans, requiresApproval, resolveCustomRole, resource, role, separationConflicts, signCapability, signDecisionBatch, simulateArazzo, snapshotFor, sqlFunction, supportAccess, toCloudEvent, toCsvRow, toOcsf, user, validateApprovalPolicy, validateCustomRole, writable };
package/dist/index.js CHANGED
@@ -1,21 +1,26 @@
1
- import { _ as mergePermissions, a as formerKeys, c as getResource, f as isPermission, g as listPermissions, i as findPermission, n as definePermissions, y as resource } from "./permissions-DC7GROPA.js";
2
- import { a as hasConditionOp, c as isConditionRef, l as isSqlFunctionField, o as isCondition, r as principal, s as isConditionDate, t as context } from "./refs-ChLSxbST.js";
3
- import { a as definePolicy, d as role, f as separationConflicts, l as normalizeApproval, m as memoryLimitStore, o as deny, t as allow, u as normalizeAssurance, y as opaque } from "./policy-ANp36PnI.js";
4
- import { a as accessToOcsf, c as readable, d as mayAccess, f as fromStripeEntitlements, g as sqlFunction, h as memorySettings, i as OCSF_VERSION, l as writable, m as memoryRoleSource, n as CSV_COLUMNS, o as toOcsf, p as memoryEntitlementSource, r as toCsvRow, s as crud, t as catalogFingerprint, u as snapshotFor } from "./src-CTNT-PBW.js";
5
- import { r as user } from "./approvers-aH0PJkmf.js";
6
- import { C as listPlans, S as isRole, a as authenticated, b as findRole, d as relation, i as assurance, n as anyone, t as actor, u as plan, v as definePlans, w as listRoles, x as isPlan, y as defineRoles } from "./grantee-Bv04_Vzf.js";
7
- import { n as requiredPlans, t as describe } from "./describe-Bt1YD5uS.js";
1
+ import { _ as listPermissions, a as formerKeys, b as resource, c as getResource, i as findPermission, n as definePermissions, p as isPermission, v as mergePermissions } from "./permissions-DVoF6dMt.js";
2
+ import { a as hasConditionOp, c as isConditionRef, l as isSqlFunctionField, o as isCondition, r as principal, s as isConditionDate, t as context } from "./refs-KYb4ntaz.js";
3
+ import { S as opaque, _ as memoryLimitStore, a as definePolicy, d as normalizeApproval, f as normalizeAssurance, h as separationConflicts, m as role, o as deny, t as allow } from "./policy-xyWg7QdR.js";
4
+ import { _ as memoryRoleSource, a as accessToOcsf, b as sqlFunction, c as readable, d as customRoleSource, f as mayAccess, g as memoryMembershipSource, h as memoryEntitlementSource, i as OCSF_VERSION, l as writable, m as fromStripeEntitlements, n as CSV_COLUMNS, o as toOcsf, p as localSnapshotManifest, r as toCsvRow, s as crud, t as catalogFingerprint, u as snapshotFor, v as memorySettings, y as memorySnapshotSource } from "./src-CSbUiozF.js";
5
+ import { a as holder, l as user, n as anyOf, t as allOf } from "./approvers-DT4AVyIg.js";
6
+ import { n as PermDockValidationError } from "./validation-error-CnjZ4t92.js";
7
+ import { r as requiredPlans } from "./problem-details-_AMOYz-w.js";
8
+ import { t as describe } from "./describe-B_gVZEVi.js";
8
9
  import { r as parsePermDockDigest } from "./digest-BI-6aa6d.js";
9
- import { i as PermDockValidationError, n as PermDockDeniedError, r as PermDockRevokedError, t as PermDockApprovalRequiredError } from "./errors-Iy71s7Oj.js";
10
- import { a as decideCredential, n as credentialPolicyViolation, o as parseCredential, r as credentialSubject, s as memoryRevocationFeed, t as credentialDelegation } from "./credential-B_rkUNlY.js";
11
- import { d as delegatedPermissions, h as simulateArazzo, n as parseSnapshot, p as arazzoFindings, u as coveredByDelegation } from "./snapshot-DE8dE_hz.js";
10
+ import { n as PermDockDeniedError, r as PermDockRevokedError, t as PermDockApprovalRequiredError } from "./errors-Cz5zn0mW.js";
11
+ import { t as memoryRevocationFeed } from "./revocations-Bhr0aMIC.js";
12
+ import { f as simulateArazzo, n as parseSnapshot, u as arazzoFindings } from "./snapshot-Enxd0n-s.js";
12
13
  import { t as parseDuration } from "./duration-xK2jGFVc.js";
14
+ import { C as isPlan, E as listRoles, S as findRole, T as listPlans, a as authenticated, b as definePlans, c as inherit, f as plan, i as assurance, n as anyone, p as relation, t as actor, w as isRole, x as defineRoles } from "./grantee-Cv5Sogfv.js";
13
15
  import { t as requiresApproval } from "./approval-required-TzNB9oQA.js";
14
- import { i as parsePolicyDocument, n as memoryPolicySource, r as mergeHostedGrants, t as isPortableCondition } from "./hosted-BwKQ1BTA.js";
15
- import { c as supportAccess, f as resolveCustomRole, g as isExternallyManaged, h as composeMemberships, l as customRoleClaim, m as claimsFirst, p as validateCustomRole, s as breakGlass, t as createPermDock, v as memoryApprovalPolicies } from "./permdock-yoZ7EjxX.js";
16
- import { t as memoryRelations } from "./relations-r4soIFZB.js";
17
- import { n as fromSnapshot, t as emptySnapshot } from "./from-snapshot-BMGnhmgv.js";
18
- import { t as mayUse } from "./may-use-CnFEjVEp.js";
16
+ import { i as parsePolicyDocument, n as memoryPolicySource, r as mergeHostedGrants, t as isPortableCondition } from "./hosted-DJQw46hn.js";
17
+ import { C as countHolders, D as memoryApprovalPolicies, O as validateApprovalPolicy, S as composeMemberships, T as APPROVAL_POLICY_UNAVAILABLE, b as validateCustomRole, d as breakGlass, f as supportAccess, h as customRoleClaim, t as createPermDock, w as isExternallyManaged, x as claimsFirst, y as resolveCustomRole } from "./permdock-CzqXjCpU.js";
18
+ import { t as memoryRelations } from "./relations-cjOL01hZ.js";
19
+ import { r as delegatedPermissions, t as coveredByDelegation } from "./delegation-D8pUEuce.js";
20
+ import { n as fromSnapshot, t as emptySnapshot } from "./from-snapshot-C3sHpZNS.js";
21
+ import { t as parseLocalSnapshotManifest } from "./parse-local-manifest-BrMozJCo.js";
22
+ import { n as permittedIds, t as mayUse } from "./may-use-DndQ5tQ-.js";
19
23
  import { a as memorySink, i as membershipEvent, n as accessEvent, o as signDecisionBatch, r as credentialEvent, s as toCloudEvent, t as CLOUD_EVENT_TYPES } from "./sink-Bd9PSyfq.js";
20
- import { c as signCapability, i as linkPolicyViolation, o as parseCapability, t as capabilitySubject } from "./capability-B68OFnZx.js";
21
- export { CLOUD_EVENT_TYPES, CSV_COLUMNS, OCSF_VERSION, PermDockApprovalRequiredError, PermDockDeniedError, PermDockRevokedError, PermDockValidationError, accessEvent, accessToOcsf, actor, allow, anyone, arazzoFindings, assurance, authenticated, breakGlass, capabilitySubject, catalogFingerprint, claimsFirst, composeMemberships, context, coveredByDelegation, createPermDock, credentialDelegation, credentialEvent, credentialPolicyViolation, credentialSubject, crud, customRoleClaim, decideCredential, definePermissions, definePlans, definePolicy, defineRoles, delegatedPermissions, deny, describe, emptySnapshot, findPermission, findRole, formerKeys, fromSnapshot, fromStripeEntitlements, getResource, hasConditionOp, isCondition, isConditionDate, isConditionRef, isExternallyManaged, isPermission, isPlan, isPortableCondition, isRole, isSqlFunctionField, linkPolicyViolation, listPermissions, listPlans, listRoles, mayAccess, mayUse, membershipEvent, memoryApprovalPolicies, memoryEntitlementSource, memoryLimitStore, memoryPolicySource, memoryRelations, memoryRevocationFeed, memoryRoleSource, memorySettings, memorySink, mergeHostedGrants, mergePermissions, normalizeApproval, normalizeAssurance, opaque, parseCapability, parseCredential, parseDuration, parsePermDockDigest, parsePolicyDocument, parseSnapshot, plan, principal, readable, relation, requiredPlans, requiresApproval, resolveCustomRole, resource, role, separationConflicts, signCapability, signDecisionBatch, simulateArazzo, snapshotFor, sqlFunction, supportAccess, toCloudEvent, toCsvRow, toOcsf, user, validateCustomRole, writable };
24
+ import { c as signCapability, i as linkPolicyViolation, o as parseCapability, t as capabilitySubject } from "./capability-4qPdO9gk.js";
25
+ import { a as decideCredential, n as credentialPolicyViolation, o as parseCredential, r as credentialSubject, t as credentialDelegation } from "./credential-8P81ff4u.js";
26
+ export { APPROVAL_POLICY_UNAVAILABLE, CLOUD_EVENT_TYPES, CSV_COLUMNS, OCSF_VERSION, PermDockApprovalRequiredError, PermDockDeniedError, PermDockRevokedError, PermDockValidationError, accessEvent, accessToOcsf, actor, allOf, allow, anyOf, anyone, arazzoFindings, assurance, authenticated, breakGlass, capabilitySubject, catalogFingerprint, claimsFirst, composeMemberships, context, countHolders, coveredByDelegation, createPermDock, credentialDelegation, credentialEvent, credentialPolicyViolation, credentialSubject, crud, customRoleClaim, customRoleSource, decideCredential, definePermissions, definePlans, definePolicy, defineRoles, delegatedPermissions, deny, describe, emptySnapshot, findPermission, findRole, formerKeys, fromSnapshot, fromStripeEntitlements, getResource, hasConditionOp, holder, inherit, isCondition, isConditionDate, isConditionRef, isExternallyManaged, isPermission, isPlan, isPortableCondition, isRole, isSqlFunctionField, linkPolicyViolation, listPermissions, listPlans, listRoles, localSnapshotManifest, mayAccess, mayUse, membershipEvent, memoryApprovalPolicies, memoryEntitlementSource, memoryLimitStore, memoryMembershipSource, memoryPolicySource, memoryRelations, memoryRevocationFeed, memoryRoleSource, memorySettings, memorySink, memorySnapshotSource, mergeHostedGrants, mergePermissions, normalizeApproval, normalizeAssurance, opaque, parseCapability, parseCredential, parseDuration, parseLocalSnapshotManifest, parsePermDockDigest, parsePolicyDocument, parseSnapshot, permittedIds, plan, principal, readable, relation, requiredPlans, requiresApproval, resolveCustomRole, resource, role, separationConflicts, signCapability, signDecisionBatch, simulateArazzo, snapshotFor, sqlFunction, supportAccess, toCloudEvent, toCsvRow, toOcsf, user, validateApprovalPolicy, validateCustomRole, writable };
@@ -0,0 +1,11 @@
1
+ import { un as PermDockOptions } from "./policy-CFZAr_Al.js";
2
+ //#region src/core/instance-options.d.ts
3
+ type InstanceKey = "memberships" | "relations" | "entitlements" | "customRoles" | "policies" | "approvalPolicies" | "sink" | "limits";
4
+ /**
5
+ * The data sources an adapter passes through to every instance it creates.
6
+ * Each adapter's options type extends this, so a source added to core
7
+ * reaches every adapter without a per-adapter change.
8
+ */
9
+ type InstanceOptions = Pick<PermDockOptions, InstanceKey>;
10
+ //#endregion
11
+ export { InstanceOptions as t };
@@ -0,0 +1,22 @@
1
+ //#region src/core/instance-options.ts
2
+ const INSTANCE_KEYS = {
3
+ memberships: true,
4
+ relations: true,
5
+ entitlements: true,
6
+ customRoles: true,
7
+ policies: true,
8
+ approvalPolicies: true,
9
+ sink: true,
10
+ limits: true
11
+ };
12
+ /** The `InstanceOptions` set on `options`, without the adapter's own keys. */
13
+ function instanceOptions(options) {
14
+ const picked = {};
15
+ for (const key of Object.keys(INSTANCE_KEYS)) {
16
+ const name = key;
17
+ if (options[name] !== void 0) picked[name] = options[name];
18
+ }
19
+ return picked;
20
+ }
21
+ //#endregion
22
+ export { instanceOptions as t };
@@ -1,7 +1,4 @@
1
- import { n as freezeDeep } from "./freeze-y1_jQL4v.js";
2
- import { i as PermDockValidationError } from "./errors-Iy71s7Oj.js";
3
- import { t as catalogSchema } from "./schema-P8yoma__.js";
4
- //#region src/catalog/parse.ts
1
+ //#region src/core/json-schema.ts
5
2
  function issue(issues, path, message) {
6
3
  issues.push({
7
4
  message,
@@ -53,8 +50,19 @@ function typeMatches(type, value) {
53
50
  default: return type;
54
51
  }
55
52
  }
56
- /** The subset of JSON Schema 2020-12 `CatalogSchemaNode` names, over a `copyJson` result. */
57
- function checkSchema(node, value, path, issues) {
53
+ const DEF_REF = /^#\/\$defs\/([^/]+)$/u;
54
+ function resolveRef(root, ref) {
55
+ const name = DEF_REF.exec(ref)?.[1];
56
+ const target = name !== void 0 && root.$defs !== void 0 && Object.hasOwn(root.$defs, name) ? root.$defs[name] : void 0;
57
+ if (target === void 0) throw new TypeError(`Unsupported or unknown $ref ${ref}`);
58
+ return target;
59
+ }
60
+ /** Validates a `copyJson` result against `node`, reading `$ref` targets from `root`. */
61
+ function checkSchema(node, value, path, issues, root = node) {
62
+ if (node.$ref !== void 0) {
63
+ checkSchema(resolveRef(root, node.$ref), value, path, issues, root);
64
+ return;
65
+ }
58
66
  if ("const" in node && value !== node.const) {
59
67
  issue(issues, path, `Expected ${JSON.stringify(node.const)}`);
60
68
  return;
@@ -72,64 +80,27 @@ function checkSchema(node, value, path, issues) {
72
80
  if (node.oneOf !== void 0) {
73
81
  if (node.oneOf.filter((option) => {
74
82
  const scratch = [];
75
- checkSchema(option, value, path, scratch);
83
+ checkSchema(option, value, path, scratch, root);
76
84
  return scratch.length === 0;
77
85
  }).length !== 1) issue(issues, path, "Expected exactly one matching form");
78
86
  }
79
- if (Array.isArray(value) && node.items !== void 0) for (const [index, item] of value.entries()) checkSchema(node.items, item, [...path, index], issues);
87
+ if (Array.isArray(value)) {
88
+ if (node.minItems !== void 0 && value.length < node.minItems) issue(issues, path, `Expected at least ${String(node.minItems)} items`);
89
+ if (node.uniqueItems === true && new Set(value.map((item) => JSON.stringify(item))).size !== value.length) issue(issues, path, "Expected unique items");
90
+ if (node.items !== void 0) for (const [index, item] of value.entries()) checkSchema(node.items, item, [...path, index], issues, root);
91
+ }
80
92
  if (!isRecord(value)) return;
81
93
  for (const key of node.required ?? []) if (!Object.hasOwn(value, key)) issue(issues, [...path, key], "Required");
82
94
  const properties = node.properties ?? {};
83
95
  for (const key of Object.keys(value)) {
84
- const child = Object.hasOwn(properties, key) ? properties[key] : node.additionalProperties;
85
- if (child !== void 0) checkSchema(child, value[key], [...path, key], issues);
86
- }
87
- }
88
- function invalid(issues) {
89
- const [first] = issues;
90
- const where = first?.path === void 0 || first.path.length === 0 ? "" : ` at ${first.path.map(String).join(".")}`;
91
- const more = issues.length > 1 ? ` (and ${String(issues.length - 1)} more)` : "";
92
- throw new PermDockValidationError({
93
- code: "invalid-data",
94
- permission: "",
95
- resource: "",
96
- boundary: "catalog",
97
- issues,
98
- message: `PermDock: invalid catalog${where}: ${first?.message ?? "unknown"}${more}`
99
- });
100
- }
101
- /**
102
- * Reads a `permissions.catalog.json` document (parsed, or the JSON text) and
103
- * validates it against `schemas/catalog-v1.json`. Returns a deep-frozen copy
104
- * built from own keys; throws `PermDockValidationError` with every issue.
105
- */
106
- function parseCatalog(json) {
107
- const issues = [];
108
- let input = json;
109
- if (typeof json === "string") try {
110
- input = JSON.parse(json);
111
- } catch (error) {
112
- invalid([{
113
- message: `Expected JSON text: ${error instanceof Error ? error.message : String(error)}`,
114
- path: []
115
- }]);
116
- }
117
- let copy;
118
- try {
119
- copy = copyJson(input, [], issues, /* @__PURE__ */ new Set());
120
- } catch (error) {
121
- invalid([{
122
- message: `Could not read the input: ${error instanceof Error ? error.message : String(error)}`,
123
- path: []
124
- }]);
96
+ if (Object.hasOwn(properties, key)) {
97
+ const child = properties[key];
98
+ if (child !== void 0) checkSchema(child, value[key], [...path, key], issues, root);
99
+ continue;
100
+ }
101
+ if (node.additionalProperties === false) issue(issues, [...path, key], "Unexpected property");
102
+ else if (node.additionalProperties !== void 0) checkSchema(node.additionalProperties, value[key], [...path, key], issues, root);
125
103
  }
126
- if (issues.length === 0) checkSchema(catalogSchema, copy, [], issues);
127
- if (issues.length > 0) invalid(issues);
128
- return freezeDeep(copy);
129
- }
130
- /** Keys of the permissions the catalog marks `rowConditions: true`: the SQL helpers alone cannot enforce them. */
131
- function rowConditionKeys(catalog) {
132
- return new Set(catalog.permissions.filter((permission) => permission.rowConditions === true).map((permission) => permission.key));
133
104
  }
134
105
  //#endregion
135
- export { rowConditionKeys as n, parseCatalog as t };
106
+ export { copyJson as n, checkSchema as t };