permdock 0.32.0 → 0.34.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 (378) hide show
  1. package/dist/a2a/index.d.ts +4 -4
  2. package/dist/a2a/index.js +2 -2
  3. package/dist/{adoption-scan-BJMEEu7V.js → adoption-scan-BPW1eWy5.js} +1 -1
  4. package/dist/agent/index.d.ts +2 -2
  5. package/dist/agent/index.js +1 -1
  6. package/dist/ai-sdk/index.d.ts +3 -3
  7. package/dist/ai-sdk/index.js +3 -3
  8. package/dist/app/index.d.ts +1 -1
  9. package/dist/app/index.js +1 -1
  10. package/dist/{approval-chain-D97rgMoA.js → approval-chain-BEeExHpb.js} +15 -10
  11. package/dist/{approval-prompt-yNyhQqn8.d.ts → approval-prompt-CJvYBdja.d.ts} +1 -1
  12. package/dist/approvals/index.d.ts +3 -3
  13. package/dist/{arazzo-C_xK2Kaa.js → arazzo-BUXKjylF.js} +1 -1
  14. package/dist/{arazzo-BAgh0PT6.js → arazzo-DqzmZG-x.js} +2 -2
  15. package/dist/astro/index.d.ts +4 -4
  16. package/dist/astro/index.js +1 -1
  17. package/dist/{audience-CARf-b-R.js → audience-B6DQ5wQu.js} +1 -1
  18. package/dist/authzen/index.d.ts +6 -6
  19. package/dist/authzen/index.js +1 -1
  20. package/dist/{automation-0VF1xe4o.d.ts → automation-BqUmdFfe.d.ts} +1 -1
  21. package/dist/better-auth/index.d.ts +1 -1
  22. package/dist/better-supabase/index.d.ts +34 -13
  23. package/dist/better-supabase/index.js +21 -21
  24. package/dist/{bind-zQacwAOg.d.ts → bind-Bwk9tt1z.d.ts} +7 -7
  25. package/dist/{bind-BYeoLJgN.js → bind-DPptdk31.js} +2 -2
  26. package/dist/{bsb-access-tags-CjeR7v7-.js → bsb-access-tags-Nv4nDQ2U.js} +11 -2
  27. package/dist/{budgets-Dpumu_Dt.js → budgets-hi-ecgEd.js} +3 -3
  28. package/dist/{build-instance-CFiegi_w.js → build-instance-DZEWYO-A.js} +1 -1
  29. package/dist/bundle-size-BRFeBvuv.js +1 -0
  30. package/dist/{bundle-size-Ddhv_H_v.js → bundle-size-DbXV65Ix.js} +2 -2
  31. package/dist/{capability-BPzseilU.d.ts → capability-qoD_jlcI.d.ts} +1 -1
  32. package/dist/{casbin-EwdKipQs.js → casbin-CM9mWO1V.js} +1 -1
  33. package/dist/{casbin-BErdqy1J.js → casbin-qEW6RfXA.js} +1 -1
  34. package/dist/catalog/index.d.ts +4 -4
  35. package/dist/catalog/index.js +4 -4
  36. package/dist/{challenge-CRB1X3Ry.js → challenge-E9sicsCA.js} +1 -1
  37. package/dist/chat/index.d.ts +1 -1
  38. package/dist/chat/index.js +1 -1
  39. package/dist/chat-sdk/index.d.ts +3 -3
  40. package/dist/{claims-size-BsSDVD5u.js → claims-size-BUhCWS88.js} +18 -3
  41. package/dist/claims-size-C6oKGuOM.js +1 -0
  42. package/dist/claude-agent/index.d.ts +3 -3
  43. package/dist/claude-agent/index.js +2 -2
  44. package/dist/clerk/index.d.ts +2 -2
  45. package/dist/cli/bin.js +1 -1
  46. package/dist/cli/generate/watch-worker.js +1 -1
  47. package/dist/cli/index.d.ts +6 -6
  48. package/dist/cli/index.js +2 -2
  49. package/dist/cli/plugins/app.d.ts +1 -1
  50. package/dist/cli/plugins/app.js +1 -1
  51. package/dist/cli/plugins/better-supabase.d.ts +1 -1
  52. package/dist/cli/plugins/openapi.d.ts +1 -1
  53. package/dist/cli/plugins/openapi.js +1 -1
  54. package/dist/cli/plugins/powersync.d.ts +1 -1
  55. package/dist/cli/plugins/powersync.js +1 -1
  56. package/dist/cli/plugins/rls.d.ts +2 -2
  57. package/dist/cli/plugins/rls.js +1 -1
  58. package/dist/cli/plugins/schemas.d.ts +1 -1
  59. package/dist/cli/plugins/schemas.js +1 -1
  60. package/dist/cli/plugins/scim.d.ts +2 -2
  61. package/dist/cli/plugins/supabase-hook.d.ts +2 -2
  62. package/dist/cli/plugins/supabase-hook.js +1 -1
  63. package/dist/cli/plugins/supabase.d.ts +3 -3
  64. package/dist/cli/plugins/supabase.js +2 -2
  65. package/dist/cli/plugins/ui.d.ts +1 -1
  66. package/dist/cli/plugins/ui.js +1 -1
  67. package/dist/{client-subject-xCSkKD1C.d.ts → client-subject-Dzo49nco.d.ts} +2 -2
  68. package/dist/cloud/index.d.ts +8 -8
  69. package/dist/cloud/index.js +1 -1
  70. package/dist/{cloud-DW3q3qnp.js → cloud-CNGblWX0.js} +2 -2
  71. package/dist/{codemod-DVDMFsTX.js → codemod-BtJFcsD7.js} +5 -5
  72. package/dist/{codemod-CF7NNDzA.js → codemod-Dlhxov9D.js} +1 -1
  73. package/dist/compile/index.d.ts +1 -1
  74. package/dist/{compile-tG1zkSgX.d.ts → compile-DNgpHgcK.d.ts} +2 -2
  75. package/dist/{compile-BXKYYmT1.js → compile-nR1gQhXo.js} +10 -9
  76. package/dist/{completion-B59uPAnZ.js → completion-BIN9YXIe.js} +1 -1
  77. package/dist/{config-VCa1RLUe.js → config-CoYhD6ur.js} +1 -1
  78. package/dist/{config-report-CjvA6lGI.js → config-report-D_L1HXDb.js} +3 -3
  79. package/dist/{context-CAFddgb9.js → context-D8tN3SZm.js} +1 -1
  80. package/dist/{context-BQHKgT1m.js → context-Nr3nknZX.js} +2 -2
  81. package/dist/convex/index.d.ts +4 -4
  82. package/dist/convex/index.js +2 -2
  83. package/dist/{core-C5yCD-Ls.js → core-DIUrkFNL.js} +5 -5
  84. package/dist/{core-bf8qgaZf.d.ts → core-DPuDmlbL.d.ts} +2 -2
  85. package/dist/{create-Cn5EpEez.d.ts → create-BKrKxipb.d.ts} +4 -4
  86. package/dist/{create-COQVXK6C.js → create-BMRnaZel.js} +3 -3
  87. package/dist/{create-nOWD3Joc.js → create-BRY0OtFV.js} +3 -3
  88. package/dist/{create-B7Xa4jSQ.d.ts → create-CdB9FCZh.d.ts} +7 -7
  89. package/dist/{create-DHA0fhmi.d.ts → create-CdbVXh5I.d.ts} +6 -6
  90. package/dist/{credentials-COT-cjnP.d.ts → credentials-Dl0-R2aB.d.ts} +2 -2
  91. package/dist/{custom-role-rebuild-BK73tPib.js → custom-role-rebuild-wzN8pqDk.js} +5 -5
  92. package/dist/{define-permdock-DBgwTFi1.d.ts → define-permdock-4IkoNaB3.d.ts} +6 -6
  93. package/dist/{define-permdock-D7aKxIax.js → define-permdock-CO7YNrOF.js} +2 -2
  94. package/dist/{definition-options-9o8Hdww3.js → definition-options-DO0kIrB9.js} +7 -1
  95. package/dist/delivery/index.d.ts +4 -4
  96. package/dist/delivery/index.js +1 -1
  97. package/dist/{denied-text-C_AWc0f0.d.ts → denied-text-CllTzVJM.d.ts} +1 -1
  98. package/dist/{describe-AdETpWsn.d.ts → describe-FT1oVN_o.d.ts} +1 -1
  99. package/dist/{diff-CW9eZy9X.js → diff-CS8ks9h3.js} +1 -1
  100. package/dist/{diff-COdwpP31.js → diff-CkSZF7LO.js} +2 -2
  101. package/dist/{doctor-ervtBRzG.js → doctor-Bn5OPJMB.js} +94 -35
  102. package/dist/{doctor-ELj5hrVv.js → doctor-C9lLeLp2.js} +2 -2
  103. package/dist/drizzle/index.d.ts +3 -3
  104. package/dist/elysia/index.d.ts +4 -4
  105. package/dist/elysia/index.js +1 -1
  106. package/dist/{errors-COoiWqIs.d.ts → errors-BGosrHl8.d.ts} +1 -1
  107. package/dist/{evaluate-Dmd0bShm.js → evaluate-DNz6wMYv.js} +1 -1
  108. package/dist/{evaluations-GW9j_ARq.d.ts → evaluations-CaXNkxTp.d.ts} +3 -3
  109. package/dist/{evaluator-eager-CpVYslzY.js → evaluator-eager-BLNVbEAC.js} +1 -1
  110. package/dist/evaluator-zpeC7zel.js +2 -0
  111. package/dist/eve/index.d.ts +4 -4
  112. package/dist/eve/index.js +2 -2
  113. package/dist/{execute-ix7AAdWg.js → execute-DsHFIBuO.js} +4 -4
  114. package/dist/{explain-DRC9V5Qb.js → explain-D4ipf8IH.js} +1 -1
  115. package/dist/{explain-jg0KLCVt.js → explain-DISCeeYS.js} +2 -2
  116. package/dist/express/index.d.ts +4 -4
  117. package/dist/express/index.js +1 -1
  118. package/dist/fastify/index.d.ts +4 -4
  119. package/dist/fastify/index.js +1 -1
  120. package/dist/{fetch-adapter-CU1DIkXu.js → fetch-adapter-BXQc4NoV.js} +1 -1
  121. package/dist/{fetch-adapter-CJncmsPg.d.ts → fetch-adapter-Dci9NnyZ.d.ts} +2 -2
  122. package/dist/{fields-y_PSRCyJ.js → fields-CwFej4gp.js} +3 -3
  123. package/dist/{from-snapshot-DGc9W4QU.js → from-snapshot-DZ4D2sLa.js} +14 -9
  124. package/dist/gen-CpS9JkCb.js +1 -0
  125. package/dist/{gen-8rW_AUG5.js → gen-Fi4GcvIY.js} +3 -3
  126. package/dist/{gen-kind-C9ikF8nb.js → gen-kind-DR2-to9P.js} +1 -1
  127. package/dist/{generate-CW7gNfLr.js → generate-BSD_eI61.js} +18 -17
  128. package/dist/{generate-BmpCt5oi.js → generate-QEHCJSyv.js} +3 -3
  129. package/dist/{generate-options-DiR4r_sk.js → generate-options-BZ2nqy28.js} +14 -13
  130. package/dist/h3/index.d.ts +4 -4
  131. package/dist/h3/index.js +2 -2
  132. package/dist/{helper-calls-DHvgN9tr.js → helper-calls-B5MOl99d.js} +1 -1
  133. package/dist/hono/index.d.ts +4 -4
  134. package/dist/hono/index.js +1 -1
  135. package/dist/{hook-sql-D-abRHut.js → hook-sql-CbkH78FC.js} +267 -223
  136. package/dist/{hosted-Bkw3Oyh-.d.ts → hosted-BISipW6F.d.ts} +1 -1
  137. package/dist/{hosted-DZwCFrcy.js → hosted-D3USbpS6.js} +1 -1
  138. package/dist/{import-D_8tLF9g.js → import-Bz6IKoMM.js} +3 -3
  139. package/dist/{import-BAhoTYTk.js → import-DppjSugv.js} +1 -1
  140. package/dist/{index-DT3hOxA7.d.ts → index-BDJ2OZvV.d.ts} +34 -11
  141. package/dist/{index-Kj5S3IWE.d.ts → index-BF4IlvkT.d.ts} +4 -4
  142. package/dist/{index-DWmIuQLz.d.ts → index-BO5f180f.d.ts} +4 -4
  143. package/dist/{index-WOx7TBbj.d.ts → index-CWwWkz10.d.ts} +2 -2
  144. package/dist/{index-xShPsK8G.d.ts → index-Co_e22iJ.d.ts} +1 -1
  145. package/dist/{index-DPVeDtAO.d.ts → index-giCl-aQY.d.ts} +4 -4
  146. package/dist/index.d.ts +16 -16
  147. package/dist/index.js +13 -13
  148. package/dist/{init-DkRHIe8-.js → init-BOYIObRF.js} +3 -3
  149. package/dist/{init-zxb0BVDJ.js → init-DJYSpo-H.js} +1 -1
  150. package/dist/inspect-functions-CwEAQpVF.js +34 -0
  151. package/dist/{instance-options-DQCiBBuz.d.ts → instance-options-hq5Cp2Ih.d.ts} +1 -1
  152. package/dist/{instance-snapshot-D9kjL37B.js → instance-snapshot-D03srwnf.js} +9 -8
  153. package/dist/{interactive-only-Dqww0ABO.js → interactive-only-Bbq9e61G.js} +10 -182
  154. package/dist/jwt/index.d.ts +4 -4
  155. package/dist/{kernel-C5akxw5n.js → kernel-DSnWVZ0O.js} +5 -5
  156. package/dist/{keys-DQsHrgBM.js → keys-U2V0maaq.js} +1 -1
  157. package/dist/kysely/index.d.ts +3 -3
  158. package/dist/{lazy-provider-CMgFAGf8.d.ts → lazy-provider-W8KwlWJU.d.ts} +1 -1
  159. package/dist/{lazy-provider-DNVjY4n3.js → lazy-provider-b8UHGi8P.js} +2 -2
  160. package/dist/{login-C1p3gmj8.js → login-Dv8TFykx.js} +1 -1
  161. package/dist/{login-DOEZveP6.js → login-xgjt0a5o.js} +3 -3
  162. package/dist/{manager-chain-DdkiCw5q.js → manager-chain-FggG63qD.js} +1 -1
  163. package/dist/{manifest-31igzVGQ.js → manifest-BUeAHWDT.js} +44 -37
  164. package/dist/{manifest-DgsxeAsM.d.ts → manifest-BwhZ1s5b.d.ts} +35 -3
  165. package/dist/{manifest-B487A3po.js → manifest-CIWOmdlP.js} +1 -1
  166. package/dist/{manifest-schema-D7RQbnGY.js → manifest-schema-N3v2RVL-.js} +24 -0
  167. package/dist/{may-use-4HzzgYJ3.js → may-use-ikNCnNgZ.js} +1 -1
  168. package/dist/mcp/index.d.ts +8 -8
  169. package/dist/mcp/index.js +2 -2
  170. package/dist/measure-DZtly0oE.js +272 -0
  171. package/dist/membership-claim-sql-DGfhIn__.js +33 -0
  172. package/dist/{membership-filter-C7ZuhAqJ.js → membership-filter-Bz9QX6E9.js} +1 -1
  173. package/dist/memberships-4e6qi8Uv.js +1 -0
  174. package/dist/memberships-CNoAlsma.js +180 -0
  175. package/dist/{migrate-pg-lkbDu.js → migrate-BXk_rUmb.js} +2 -2
  176. package/dist/{model-BXhr8gUI.js → model-D0EKt-ED.js} +3 -3
  177. package/dist/names-DBxKx2bz.js +182 -0
  178. package/dist/nest/index.d.ts +4 -4
  179. package/dist/nest/index.js +1 -1
  180. package/dist/next/index.d.ts +11 -11
  181. package/dist/next/index.js +3 -3
  182. package/dist/next/plugin.d.ts +1 -1
  183. package/dist/node/index.d.ts +4 -4
  184. package/dist/node/index.js +1 -1
  185. package/dist/openai/index.d.ts +4 -4
  186. package/dist/openai/index.js +3 -3
  187. package/dist/openapi/index.d.ts +2 -2
  188. package/dist/{openapi-DEGesHWH.js → openapi-Bfakk4cF.js} +1 -1
  189. package/dist/{openapi-document-CEQ6jqqR.js → openapi-document-ZWpur4f1.js} +1 -1
  190. package/dist/{openapi-BeMVHVY4.js → openapi-g58VVrsc.js} +2 -2
  191. package/dist/orpc/index.d.ts +5 -5
  192. package/dist/orpc/index.js +2 -2
  193. package/dist/otel/index.d.ts +3 -3
  194. package/dist/{output-C7EPeSZj.js → output-D4FLF3_v.js} +1 -1
  195. package/dist/{ownership-Csk9C3Js.js → ownership-DvmaGcup.js} +7 -6
  196. package/dist/{parse-local-manifest-B92rFWnk.d.ts → parse-local-manifest-AJWs3pkW.d.ts} +1 -1
  197. package/dist/pdp/index.d.ts +3 -3
  198. package/dist/pdp/index.js +1 -1
  199. package/dist/{permdock-CJPIwU1T.js → permdock-JM9TKevZ.js} +14 -14
  200. package/dist/{permdock-BShHM8OJ.d.ts → permdock-V86uejcm.d.ts} +2 -2
  201. package/dist/{permissions-wEkTVr_I.js → permissions-xPyAmuXi.js} +1 -1
  202. package/dist/{pipeline-Bbu7uw28.js → pipeline-DCERGTTY.js} +2 -2
  203. package/dist/{plugin-L3G7jPGE.d.ts → plugin-BnvEp5tS.d.ts} +2 -2
  204. package/dist/{policy-BBvhhH9X.js → policy-CZBJDcTx.js} +2 -1
  205. package/dist/{policy-BUtwixSN.d.ts → policy-DZORR-Fw.d.ts} +1 -1
  206. package/dist/{policy-CSOOQ3rR.js → policy-DoHkOOTQ.js} +1 -1
  207. package/dist/{policy-bundle-KYI0EnrM.js → policy-bundle-CsnNAo-n.js} +3 -3
  208. package/dist/{policy-from-catalog-_zwn1sNj.js → policy-from-catalog-BohzTN3J.js} +3 -3
  209. package/dist/{policy-types-CfW4X_yX.d.ts → policy-types-BnBZvh7N.d.ts} +50 -1
  210. package/dist/{postgrest-PQ3zAOD2.d.ts → postgrest-BG0ipED3.d.ts} +9 -2
  211. package/dist/{powersync-CM6Vg4RH.js → powersync-CTKfjnPT.js} +12 -12
  212. package/dist/{powersync-CGvu6j5U.js → powersync-Cz3MUw6R.js} +1 -1
  213. package/dist/{powersync-C1ix7CEY.js → powersync-Dbpn-n0o.js} +1 -1
  214. package/dist/prisma/index.d.ts +2 -2
  215. package/dist/{protected-action-BPN0NaRb.js → protected-action-DDYvU-9Z.js} +1 -1
  216. package/dist/{protected-action-DhCQ4bSe.d.ts → protected-action-aGL_gT4j.d.ts} +5 -5
  217. package/dist/{provider-BV_v0JAY.js → provider-BwqzED5h.js} +83 -50
  218. package/dist/{provider-1xqxLVEz.js → provider-NQwLSlgb.js} +2 -2
  219. package/dist/{provider-CMgFAGf8.d.ts → provider-W8KwlWJU.d.ts} +1 -1
  220. package/dist/{provider-store-Cf8HRNtb.js → provider-store-BizF6jyu.js} +2 -2
  221. package/dist/{provider-with-cpL9vRjC.js → provider-with-DtBgCCV_.js} +1 -1
  222. package/dist/{prune-config-CdoPJIGz.js → prune-config--x-cEF8G.js} +5 -5
  223. package/dist/{pull-BaB401Bk.js → pull-BQELP7aV.js} +2 -2
  224. package/dist/pull-C_ZiPZ5X.js +1 -0
  225. package/dist/{push-DcjvEj0m.js → push-D5so0ptb.js} +2 -2
  226. package/dist/{pushed-policy-DcvO8NXy.d.ts → pushed-policy-CQaXRDe3.d.ts} +1 -1
  227. package/dist/{pushed-policy-DSjSWEAl.js → pushed-policy-dm_hFstN.js} +1 -1
  228. package/dist/{quote-BKrTBbcH.js → quote-LNaBdCGA.js} +1 -1
  229. package/dist/{rbac-mblGDx-Z.js → rbac-BRMnQ9Rl.js} +5 -4
  230. package/dist/react/index.d.ts +6 -6
  231. package/dist/react/index.js +3 -3
  232. package/dist/react/lazy.d.ts +6 -6
  233. package/dist/react/lazy.js +3 -3
  234. package/dist/react/provider-client-lazy.d.ts +1 -1
  235. package/dist/react/provider-client-lazy.js +1 -1
  236. package/dist/react/provider-client.d.ts +1 -1
  237. package/dist/react/provider-client.js +1 -1
  238. package/dist/react-native/index.d.ts +8 -8
  239. package/dist/react-native/index.js +5 -5
  240. package/dist/read-memberships-DVBitJZG.js +164 -0
  241. package/dist/{rename-BZNOV8H9.js → rename-BjP2CFUY.js} +5 -5
  242. package/dist/replay-Dg5-l7xu.d.ts +3 -0
  243. package/dist/{report-DCAiUc5U.js → report-DF0zUNut.js} +1 -1
  244. package/dist/{report-DievqWhf.js → report-XdCm1y_J.js} +1 -1
  245. package/dist/{request-context-BNVY3kZ1.js → request-context-CqqdiVp4.js} +1 -1
  246. package/dist/resend/index.d.ts +4 -4
  247. package/dist/{resolve-config-9NYYVc30.js → resolve-config-Cu_mE2wt.js} +1 -1
  248. package/dist/{resolve-names-Cth1UQ-8.js → resolve-names-xBg9s2IJ.js} +7 -6
  249. package/dist/{resolver-CuIY8aFD.js → resolver-C_a-bddD.js} +99 -15
  250. package/dist/{rls-BtkZgaZp.js → rls-BzCz7ZV0.js} +51 -4
  251. package/dist/{rls-files-ucAI0J5j.js → rls-files-Bu0O7cZ6.js} +1 -1
  252. package/dist/{rls-options-BFGRmdcH.d.ts → rls-options-f1wRhXSG.d.ts} +1 -1
  253. package/dist/{rls-DUYok5e9.js → rls-rk-QH4fc.js} +13 -13
  254. package/dist/{rpc-D7G7IJDa.js → rpc-BQPa7tLP.js} +1 -1
  255. package/dist/{rpc-COnquydd.d.ts → rpc-DyCWVn6C.d.ts} +1 -1
  256. package/dist/run-BvtApZDp.js +1 -0
  257. package/dist/{run-WIqPbnjD.js → run-DTz-e3Od.js} +2 -2
  258. package/dist/{run-ticket-Mmor5sYW.d.ts → run-ticket-mVPqm6M6.d.ts} +2 -2
  259. package/dist/{saas-DcqUkynn.js → saas-DSeazNrN.js} +3 -3
  260. package/dist/{scan-Badcllgg.js → scan-Cn79IAJs.js} +1 -1
  261. package/dist/{schema-DBRKgQb4.js → schema-CbzVUpWv.js} +1 -1
  262. package/dist/scim/index.d.ts +1 -1
  263. package/dist/seeds/index.d.ts +1 -1
  264. package/dist/{seeds-Cih1ztkf.d.ts → seeds-DLjPbhvM.d.ts} +1 -1
  265. package/dist/server/index.d.ts +11 -11
  266. package/dist/server/index.js +1 -1
  267. package/dist/{server-types-C2XX60aF.d.ts → server-types-BlMijUtb.d.ts} +8 -8
  268. package/dist/share-key-claims-CZGAeVqa.js +28 -0
  269. package/dist/{shared-C6_T7QUo.js → shared-DnVY767H.js} +2 -1
  270. package/dist/{sink-BQ_6K81r.d.ts → sink-DhrVLPSJ.d.ts} +2 -2
  271. package/dist/{size-l1pDHE2z.js → size-CY6rK6l9.js} +3 -3
  272. package/dist/{skills-Ba9hHGO6.js → skills-BKrN1qej.js} +1 -1
  273. package/dist/{skills-CTKq3o8D.js → skills-oZ8Ng2e7.js} +1 -1
  274. package/dist/{snapshot-Ty0uk9wZ.js → snapshot-Dzi4LR6n.js} +8 -1
  275. package/dist/{snapshot-cache-DGvLQW0-.d.ts → snapshot-cache-CVYqOThu.d.ts} +1 -1
  276. package/dist/{snapshot-compact-yXFxZLPo.js → snapshot-compact-BWMLnIXK.js} +35 -4
  277. package/dist/{snapshot-evaluate-DSNj2rhV.js → snapshot-evaluate-C382Z1mQ.js} +1 -1
  278. package/dist/{snapshot-reads-BnAHiuoa.js → snapshot-reads-JxcUSUfW.js} +2 -2
  279. package/dist/{snapshot-size-DNY1MTsV.js → snapshot-size-D6ixbYvH.js} +1 -1
  280. package/dist/{snapshot-size-2fkXbCkP.js → snapshot-size-NklqBKcV.js} +1 -1
  281. package/dist/solid/index.d.ts +5 -5
  282. package/dist/solid/index.js +2 -2
  283. package/dist/solid-start/index.d.ts +4 -4
  284. package/dist/solid-start/index.js +2 -2
  285. package/dist/{sources-CjgZns7t.d.ts → sources-Bq7k7g34.d.ts} +7 -2
  286. package/dist/{sources-DnjJPGfb.js → sources-C6Id63F8.js} +2 -1
  287. package/dist/{src-HRYn4UFj.js → src-BXDohWNO.js} +154 -11
  288. package/dist/ssf/index.d.ts +3 -3
  289. package/dist/{standard-webhooks-Bnnrqa6d.d.ts → standard-webhooks-D6SPYjSQ.d.ts} +2 -2
  290. package/dist/{store-core-BdFcruPm.d.ts → store-core-Bq7Qc9QM.d.ts} +4 -4
  291. package/dist/{store-options-DpCQo0vB.js → store-options-DgOuhUSn.js} +4 -4
  292. package/dist/{stores-D6MIjN_-.d.ts → stores-Dn7TpQFa.d.ts} +5 -5
  293. package/dist/{stores-KpBCaY6c.js → stores-jgDndNHa.js} +1 -1
  294. package/dist/{subject-CrldGifz.js → subject-B7p94Y0s.js} +1 -1
  295. package/dist/{subject-cache-CnJcz2K_.d.ts → subject-cache-UKUgQCEX.d.ts} +3 -1
  296. package/dist/supabase/index.d.ts +36 -9
  297. package/dist/supabase/index.js +8 -7
  298. package/dist/supabase/middleware.d.ts +5 -5
  299. package/dist/supabase/middleware.js +4 -4
  300. package/dist/{supabase-CGiB83XQ.js → supabase-BNPS-Gr1.js} +15 -1
  301. package/dist/{supabase-kWQlkrHw.js → supabase-DrazwRER.js} +14 -7
  302. package/dist/supabase-hook-D0Yzbl19.js +2 -0
  303. package/dist/{supabase-hook-CqO_0Koh.js → supabase-hook-t1HnQf8U.js} +7 -7
  304. package/dist/{supabase-schemas-BglbAG2Z.js → supabase-schemas-_ubYYw9i.js} +2 -2
  305. package/dist/svelte/index.d.ts +5 -5
  306. package/dist/svelte/index.js +5 -3
  307. package/dist/svelte/runtime.d.ts +3 -3
  308. package/dist/svelte/runtime.js +1 -1
  309. package/dist/svelte/source.d.ts +5 -5
  310. package/dist/svelte/source.js +2 -2
  311. package/dist/sveltekit/index.d.ts +4 -4
  312. package/dist/sveltekit/index.js +1 -1
  313. package/dist/{table-reads-AnHPrBp8.js → table-reads-B7z40Yu-.js} +297 -48
  314. package/dist/{table-reads-BviGc0L_.js → table-reads-Ci-ZVo5m.js} +1 -1
  315. package/dist/{tables-CDq0HVVq.js → tables-Bxmf2beb.js} +102 -8
  316. package/dist/tanstack-start/index.d.ts +4 -4
  317. package/dist/tanstack-start/index.js +1 -1
  318. package/dist/{tenant-check-D7g9oNVH.js → tenant-check-DW0kbH-a.js} +4 -4
  319. package/dist/terminal/index.d.ts +5 -5
  320. package/dist/terminal/index.js +3 -3
  321. package/dist/testing/core.d.ts +1 -1
  322. package/dist/testing/core.js +1 -1
  323. package/dist/testing/fixtures/index.d.ts +4 -4
  324. package/dist/testing/fixtures/index.js +29 -11
  325. package/dist/testing/index.d.ts +23 -23
  326. package/dist/testing/index.js +13 -13
  327. package/dist/testing/saas/index.d.ts +3 -3
  328. package/dist/testing/saas/index.js +2 -2
  329. package/dist/testing/saas/permissions.js +1 -1
  330. package/dist/trpc/index.d.ts +5 -5
  331. package/dist/trpc/index.js +2 -2
  332. package/dist/{type-helpers-CUmJFGV6.d.ts → type-helpers-CVN-p62O.d.ts} +1 -1
  333. package/dist/{types-vKKndyxx.d.ts → types-5cvjmHTG.d.ts} +1 -1
  334. package/dist/{types-DwoRXDvN.d.ts → types-BMKDvcXc.d.ts} +2 -2
  335. package/dist/{types-CIzXPPV-.d.ts → types-B_I8TBA9.d.ts} +2 -2
  336. package/dist/{types-h9W3CNC_.d.ts → types-BmTW35E5.d.ts} +4 -4
  337. package/dist/{types-BhBfMdQ5.d.ts → types-CDkJNA3a.d.ts} +3 -3
  338. package/dist/{types-euUv1wsO.d.ts → types-CgaGxF5q.d.ts} +1 -1
  339. package/dist/{types-BsRf5rKk.d.ts → types-CrUguLsE.d.ts} +2 -2
  340. package/dist/{types-BRECeQ2n.d.ts → types-DNOJRhyn.d.ts} +3 -3
  341. package/dist/{types-BKnUwgvx.d.ts → types-Dl2jRkyq.d.ts} +4 -4
  342. package/dist/{types-config-DNIw_Gt5.d.ts → types-config-CyawIkMF.d.ts} +2 -2
  343. package/dist/{types-CjZscT16.d.ts → types-gp1w86cV.d.ts} +4 -4
  344. package/dist/{types-run-Bwn1MuW0.d.ts → types-run-ByHuYUen.d.ts} +1 -1
  345. package/dist/unplugin/index.d.ts +1 -1
  346. package/dist/{usage-CW6xhRcV.js → usage-B8ca_Nj_.js} +2 -2
  347. package/dist/usage-CKTsomEq.js +1 -0
  348. package/dist/{usage-n4V2k_a6.js → usage-Do7LQ4i4.js} +1 -1
  349. package/dist/{validation-error-P4Z9HUuP.d.ts → validation-error-BKgVVMc1.d.ts} +1 -1
  350. package/dist/{verify-CKzngsUH.js → verify-ZojGAC3f.js} +12 -12
  351. package/dist/{version-cache-BzK8dwJy.js → version-cache-Ccrfu2A4.js} +6 -1
  352. package/dist/vue/index.d.ts +5 -5
  353. package/dist/vue/index.js +2 -2
  354. package/dist/{waiter-BqUxSRxq.d.ts → waiter-Bov7Cig6.d.ts} +2 -2
  355. package/dist/{warm-BR-mrnY-.d.ts → warm-BKD3FN6k.d.ts} +1 -1
  356. package/dist/{warm-5yxlUmBh.js → warm-BZ0ZwSmO.js} +1 -1
  357. package/dist/{watch-C12Ub7x4.js → watch-EzX_aG73.js} +1 -1
  358. package/dist/webmcp/index.d.ts +1 -1
  359. package/dist/webmcp/index.js +1 -1
  360. package/dist/{who-can-CGVpM3fZ.js → who-can-CIgYpEvy.js} +1 -1
  361. package/dist/workflow/index.d.ts +3 -3
  362. package/dist/workflow/index.js +1 -1
  363. package/dist/workflow-sdk/index.d.ts +4 -4
  364. package/dist/{wrap-D8WtzrB7.d.ts → wrap-CaAA3ubO.d.ts} +2 -2
  365. package/package.json +11 -11
  366. package/schemas/snapshot-v2.json +20 -0
  367. package/schemas/supabase-claims-v1.json +48 -2
  368. package/schemas/supabase-manifest-v1.json +28 -0
  369. package/dist/bundle-size-DwZ4e1gu.js +0 -1
  370. package/dist/claims-size-B6j0Ff4Q.js +0 -1
  371. package/dist/evaluator-COmATWCr.js +0 -2
  372. package/dist/gen-BtiGMiuH.js +0 -1
  373. package/dist/pull-Bp63vtgu.js +0 -1
  374. package/dist/read-memberships-BkePIa1F.js +0 -63
  375. package/dist/replay-BCOZifwx.d.ts +0 -3
  376. package/dist/run-BjMxYYTe.js +0 -1
  377. package/dist/supabase-hook-CluYxKee.js +0 -2
  378. package/dist/usage-Ci7Glu-H.js +0 -1
@@ -1,9 +1,9 @@
1
- import { D as ConnectionOptions, T as Connection, f as InvalidSignatureError, i as OpenApiHooks, o as ProtectOptions, u as SnapshotQuery, v as discoverViaSignatureAgent, x as webBotAuthVerifier } from "../server-types-C2XX60aF.js";
1
+ import { D as ConnectionOptions, T as Connection, f as InvalidSignatureError, i as OpenApiHooks, o as ProtectOptions, u as SnapshotQuery, v as discoverViaSignatureAgent, x as webBotAuthVerifier } from "../server-types-BlMijUtb.js";
2
2
  import { a as OperationInput, t as Operation } from "../operations-DaEoGpMV.js";
3
- import { a as PermDock } from "../permdock-BShHM8OJ.js";
3
+ import { a as PermDock } from "../permdock-V86uejcm.js";
4
4
  import { w as Permission } from "../vocabulary-DHfKPIC5.js";
5
- import { D as Policy, Er as Principal, N as PolicyVocabulary, nn as Snapshot } from "../policy-types-CfW4X_yX.js";
6
- import { a as ProtectTarget, n as FetchAdapterOptions, t as ContextReader } from "../fetch-adapter-CJncmsPg.js";
5
+ import { D as Policy, N as PolicyVocabulary, Or as Principal, rn as Snapshot } from "../policy-types-BnBZvh7N.js";
6
+ import { a as ProtectTarget, n as FetchAdapterOptions, t as ContextReader } from "../fetch-adapter-Dci9NnyZ.js";
7
7
  import { APIEvent, FetchEvent } from "@solidjs/start/server";
8
8
  /** The h3 event under every SolidStart request; `subject` and `scope` read it. */
9
9
  type SolidStartNativeEvent = FetchEvent["nativeEvent"];
@@ -1,6 +1,6 @@
1
1
  import { f as InvalidSignatureError, g as webBotAuthVerifier, p as discoverViaSignatureAgent } from "../evaluations-DPEAu_jM.js";
2
- import { i as decorate } from "../bind-BYeoLJgN.js";
3
- import { n as guardedRoute, t as fetchAdapter } from "../fetch-adapter-CU1DIkXu.js";
2
+ import { i as decorate } from "../bind-DPptdk31.js";
3
+ import { n as guardedRoute, t as fetchAdapter } from "../fetch-adapter-BXQc4NoV.js";
4
4
  // src/solid-start/create.ts
5
5
  /**
6
6
  * `event.locals`. Its type, `App.RequestEventLocals`, is declared by
@@ -1,6 +1,6 @@
1
- import { Er as Principal, it as MembershipSource, mn as AuthEvent, q as CustomRoleSource } from "./policy-types-CfW4X_yX.js";
1
+ import { Or as Principal, gn as AuthEvent, it as MembershipSource, q as CustomRoleSource } from "./policy-types-BnBZvh7N.js";
2
2
  import { t as SqlQuery } from "./sql-BYYNi1lu.js";
3
- import { c as SupabaseManifestMembership } from "./manifest-DgsxeAsM.js";
3
+ import { c as SupabaseManifestMembership } from "./manifest-BwhZ1s5b.js";
4
4
  import { t as ClaimsMap } from "./claims-map-CLKQWxJG.js";
5
5
  import { t as ClientNames } from "./clients-DGcyFDCc.js";
6
6
  import { StandardSchemaV1 } from "@standard-schema/spec";
@@ -54,6 +54,11 @@ type SupabasePermDockClaims<TenantClaim extends string = "tenant_id"> = {
54
54
  readonly memberships?: readonly SupabaseMembershipClaim[];
55
55
  /** `true` when the size budget cut `memberships` or `attrs`. */
56
56
  readonly memberships_truncated?: boolean;
57
+ /**
58
+ * The ids of the tenants where the user is a member and the tenant is
59
+ * suspended, outside the memberships budget and cut at 16.
60
+ */
61
+ readonly suspended_in?: readonly string[];
57
62
  /**
58
63
  * Allow-listed server-owned attributes, read as
59
64
  * `principal.claims.attrs.<key>`.
@@ -638,7 +638,8 @@ function hookApiNames(prefix = HOOK_API_PREFIX) {
638
638
  subjectFor: `${prefix}subject_for`,
639
639
  membersOf: `${prefix}members_of`,
640
640
  authzVersionFor: `${prefix}authz_version_for`,
641
- rolesVersionFor: `${prefix}custom_roles_version_for`
641
+ rolesVersionFor: `${prefix}custom_roles_version_for`,
642
+ versionsFor: `${prefix}authz_versions_for`
642
643
  };
643
644
  }
644
645
  /**
@@ -1,28 +1,30 @@
1
1
  import { d as assertSqlFunctionArg, f as assertSqlFunctionName, l as normalizeWhere, p as assertSqlFunctionSet, u as assertPortableTwin } from "./role-builder-BksM3Q9O.js";
2
2
  import { n as freezeDeep } from "./freeze-DGfJq_j2.js";
3
- import { f as compactWithBundle, r as resolveSubject } from "./permdock-CJPIwU1T.js";
3
+ import { _ as sameList, d as PROBE, f as canonOf, g as probeSnapshot, h as probeGroup, m as compactWithBundle, r as resolveSubject } from "./permdock-JM9TKevZ.js";
4
4
  import { n as PermDockDeniedError } from "./errors-DOSkVeTC.js";
5
5
  import { c as evaluateCondition } from "./delegation-0DVVomzu.js";
6
6
  import { a as normalizeApproval, r as assertApprovalRelations } from "./approval-normalize-C6je8vWN.js";
7
7
  import { n as isReadonlyArray, r as isRecord, t as compact } from "./compact-C4LFuqbW.js";
8
8
  import { a as authenticated, o as flattenGrantee } from "./grantee-BSCdpIF3.js";
9
- import { o as isPortableCondition } from "./hosted-DZwCFrcy.js";
9
+ import { o as isPortableCondition } from "./hosted-D3USbpS6.js";
10
10
  import { n as isOperationRisk } from "./operation-risks-BD-j14dj.js";
11
11
  import { n as isOperationEffect } from "./operations-dJxcshJZ.js";
12
12
  import { c as listPermissions, i as getRegistry, n as findPermission } from "./permission-registry-DstT40VS.js";
13
13
  import { n as isThenable } from "./thenable-BxMy2v8w.js";
14
14
  import { a as durationOf, g as secondsOf, p as nowSeconds } from "./time-r0CKBm57.js";
15
- import { D as tenantCustomRoles, E as roleAllowKeys, O as validateCustomRole, T as resolveCustomRole, b as isGlobalCustomRole, d as customGrantsFor, g as customRoleScope, h as customRoleOf, p as customRoleId, u as ceilingGrants, x as isSharedCustomRole } from "./evaluate-Dmd0bShm.js";
16
- import { a as heldLevels, f as bindingOf, h as usesAssigns, i as assignableIn, m as roleMeta, n as snapshotScopes, o as collectSnapshotGrants, p as rankRoles, r as assignableCandidates, t as snapshotOf } from "./instance-snapshot-D9kjL37B.js";
15
+ import { D as tenantCustomRoles, E as roleAllowKeys, O as validateCustomRole, T as resolveCustomRole, b as isGlobalCustomRole, d as customGrantsFor, g as customRoleScope, h as customRoleOf, p as customRoleId, u as ceilingGrants, x as isSharedCustomRole } from "./evaluate-DNz6wMYv.js";
16
+ import { a as heldLevels, f as bindingOf, h as usesAssigns, i as assignableIn, m as roleMeta, n as snapshotScopes, o as collectSnapshotGrants, p as rankRoles, r as assignableCandidates, t as snapshotOf } from "./instance-snapshot-D03srwnf.js";
17
17
  import { r as ownGet } from "./paths-CeS_gpHf.js";
18
18
  import { n as relationId } from "./relations-CIgB5KPJ.js";
19
19
  import { c as isEdgeRelation, m as restrictedStops, o as groupEntries, s as isComputedRelation, u as isPrincipalRelation } from "./resource-relations-Ck5sjYQR.js";
20
20
  import { n as internalsOf } from "./internals-D58TnmDB.js";
21
- import { n as compactSnapshot } from "./snapshot-compact-yXFxZLPo.js";
22
- import { n as LOCAL_CUSTOM_ROLE } from "./parse-local-manifest-CfMjZAFi.js";
23
- import { c as levelNames, i as grantList, n as declaredRoleNames } from "./policy-BBvhhH9X.js";
21
+ import { t as canonicalJson } from "./canonical-json-BibZkXtE.js";
24
22
  import { a as normalizeMembership$1, c as rootScope, d as scopeList, l as scopeChain, o as normalizeMemberships$1, p as tenantOf, s as resolveScope$1, u as scopeIdOf } from "./scopes-B-KX9EI8.js";
25
- import { i as snapshotGrant, r as plainPermission, t as buildSnapshot } from "./snapshot-Ty0uk9wZ.js";
23
+ import { r as sha256Digest } from "./sha256-DFsnyVPo.js";
24
+ import { n as compactSnapshot } from "./snapshot-compact-BWMLnIXK.js";
25
+ import { n as LOCAL_CUSTOM_ROLE } from "./parse-local-manifest-CfMjZAFi.js";
26
+ import { c as levelNames, i as grantList, n as declaredRoleNames } from "./policy-CZBJDcTx.js";
27
+ import { i as snapshotGrant, r as plainPermission, t as buildSnapshot } from "./snapshot-Dzi4LR6n.js";
26
28
  import { n as wrapPermDock } from "./wrap-CsfsaJhd.js";
27
29
  import { o as listPlans, r as findRole } from "./vocabulary-CE2k7s1a.js";
28
30
  import { m as tenantsOf, r as isMembershipExpired } from "./tenancy-B5Xxt9Sc.js";
@@ -1071,6 +1073,145 @@ function planArazzo(input, tree, decide) {
1071
1073
  steps
1072
1074
  });
1073
1075
  }
1076
+ // src/core/custom-role-record.ts
1077
+ /** The membership a holder of a tenant role has: on its scope, in `tenant`. */
1078
+ function membershipFor(policy, role, tenant) {
1079
+ const scopes = scopeList(policy.scopes);
1080
+ const root = scopes[0];
1081
+ const scope = root === void 0 ? void 0 : resolveScope$1(scopes, role.scope ?? root.name);
1082
+ if (root === void 0 || scope === void 0) return;
1083
+ const within = {};
1084
+ let parent = scopes.find((item) => item.name === scope)?.within;
1085
+ while (parent !== void 0) {
1086
+ within[parent] = parent === root.name ? tenant : PROBE;
1087
+ const name = parent;
1088
+ parent = scopes.find((item) => item.name === name)?.within;
1089
+ }
1090
+ return {
1091
+ scope,
1092
+ id: scope === root.name ? tenant : PROBE,
1093
+ ...Object.keys(within).length === 0 ? {} : { within },
1094
+ roles: [role.name]
1095
+ };
1096
+ }
1097
+ function build(policy, customRoles, tenant) {
1098
+ const roles = {};
1099
+ const expected = /* @__PURE__ */ new Map();
1100
+ const candidates = tenant === null ? customRoles.filter(isGlobalCustomRole) : tenantCustomRoles(policy, customRoles).filter((role) => customRoleOf(role, tenant));
1101
+ for (const role of candidates.toSorted((a, b) => a.name < b.name ? -1 : a.name > b.name ? 1 : 0)) {
1102
+ if (role.id !== void 0 || role.team !== void 0) continue;
1103
+ const membership = tenant === null ? void 0 : membershipFor(policy, role, tenant);
1104
+ if (tenant !== null && membership === void 0) continue;
1105
+ const principal = {
1106
+ id: PROBE,
1107
+ roles: membership === void 0 ? [role.name] : [],
1108
+ ...membership === void 0 ? {} : { memberships: [membership] }
1109
+ };
1110
+ const snapshot = probeSnapshot(policy, principal, customRoles);
1111
+ const group = probeGroup(snapshot, (grant) => grant.role === role.name);
1112
+ if (group === void 0) continue;
1113
+ expected.set(role.name, group.canon);
1114
+ roles[role.name] = {
1115
+ digest: sha256Digest(canonicalJson(group.canon)),
1116
+ grants: group.terms
1117
+ };
1118
+ }
1119
+ return {
1120
+ record: freezeDeep({
1121
+ v: 1,
1122
+ tenant,
1123
+ roles
1124
+ }),
1125
+ expected
1126
+ };
1127
+ }
1128
+ function recordedFor(policy, customRoles, tenant) {
1129
+ let byTenant = policy.index.customRecords.get(customRoles);
1130
+ if (byTenant === void 0) {
1131
+ byTenant = /* @__PURE__ */ new Map();
1132
+ policy.index.customRecords.set(customRoles, byTenant);
1133
+ }
1134
+ let recorded = byTenant.get(tenant);
1135
+ if (recorded === void 0) {
1136
+ recorded = build(policy, customRoles, tenant);
1137
+ byTenant.set(tenant, recorded);
1138
+ }
1139
+ return recorded;
1140
+ }
1141
+ /**
1142
+ * The grants of the custom roles `tenant` holds (its own and the shared ones),
1143
+ * or of the platform's global custom roles for `null`. Pass the record to
1144
+ * `fromSnapshot` and the client store next to a snapshot `snapshotFor` wrote
1145
+ * with `customRoles`; the snapshot names the roles and the record supplies what
1146
+ * they grant. Cache it with the custom roles, once per tenant and version. Pure
1147
+ * and deterministic for one policy and one list of roles.
1148
+ */
1149
+ function customRoleRecord(policy, customRoles, tenant) {
1150
+ return recordedFor(policy, customRoles, tenant).record;
1151
+ }
1152
+ /**
1153
+ * `expanded` without the grants of custom roles the tenant records reproduce
1154
+ * exactly, and the `custom` entry that names them. A group that differs from
1155
+ * its record in any term stays inline, so a client never rebuilds a rule.
1156
+ */
1157
+ function withoutCustomGrants(policy, expanded, customRoles) {
1158
+ if (customRoles.length === 0) return {
1159
+ snapshot: expanded,
1160
+ custom: void 0
1161
+ };
1162
+ const scopes = scopeList(policy.scopes);
1163
+ const memberships = expanded.subject.principal?.memberships ?? [];
1164
+ const memberAt = /* @__PURE__ */ new Map();
1165
+ for (const [at, membership] of memberships.entries()) {
1166
+ const key = canonicalJson(membership);
1167
+ if (!memberAt.has(key)) memberAt.set(key, at);
1168
+ }
1169
+ const groups = /* @__PURE__ */ new Map();
1170
+ for (const [at, grant] of expanded.grants.entries()) {
1171
+ const role = grant.role;
1172
+ if (role === null) continue;
1173
+ const tenant = grant.membership === void 0 ? null : tenantOf(grant.membership, scopes) ?? null;
1174
+ const member = grant.membership === void 0 ? null : memberAt.get(canonicalJson(grant.membership)) ?? null;
1175
+ if (grant.membership !== void 0 && (member === null || tenant === null)) continue;
1176
+ if (!recordedFor(policy, customRoles, tenant).expected.has(role)) continue;
1177
+ const id = `${role}\u0000${String(member)}`;
1178
+ const group = groups.get(id) ?? {
1179
+ role,
1180
+ tenant,
1181
+ member,
1182
+ at: [],
1183
+ canon: []
1184
+ };
1185
+ group.at.push(at);
1186
+ group.canon.push(canonOf(grant, expanded));
1187
+ groups.set(id, group);
1188
+ }
1189
+ const removed = /* @__PURE__ */ new Set();
1190
+ const held = [];
1191
+ for (const group of groups.values()) {
1192
+ const recorded = recordedFor(policy, customRoles, group.tenant);
1193
+ const want = recorded.expected.get(group.role);
1194
+ const entry = recorded.record.roles[group.role];
1195
+ if (want === void 0 || entry === void 0 || !sameList(group.canon, want)) continue;
1196
+ for (const at of group.at) removed.add(at);
1197
+ held.push([
1198
+ group.role,
1199
+ group.member,
1200
+ entry.digest
1201
+ ]);
1202
+ }
1203
+ if (held.length === 0) return {
1204
+ snapshot: expanded,
1205
+ custom: void 0
1206
+ };
1207
+ return {
1208
+ snapshot: {
1209
+ ...expanded,
1210
+ grants: expanded.grants.filter((_, at) => !removed.has(at))
1211
+ },
1212
+ custom: { held }
1213
+ };
1214
+ }
1074
1215
  // src/core/local-manifest.ts
1075
1216
  /**
1076
1217
  * A relation grantee needs the relation graph, which a device does not hold:
@@ -1485,8 +1626,10 @@ function withPlans(subject, plans) {
1485
1626
  function snapshotFor(policy, user, options = {}) {
1486
1627
  const version = options.v;
1487
1628
  if (version !== void 0 && version !== 2) throw new TypeError(`PermDock: snapshotFor() writes snapshot wire version 2 only, got v: ${String(version)}`);
1488
- const expanded = expandedSnapshotFor(policy, user, options);
1489
- return options.omitStatic === true ? compactWithBundle(policy, expanded) : compactSnapshot(expanded);
1629
+ const full = expandedSnapshotFor(policy, user, options);
1630
+ const erased = policy;
1631
+ const { snapshot: expanded, custom } = withoutCustomGrants(erased, full, options.customRoles ?? []);
1632
+ return options.omitStatic === true ? compactWithBundle(erased, expanded, custom) : compactSnapshot(expanded, void 0, void 0, custom);
1490
1633
  }
1491
1634
  /** The flat form `snapshotFor` writes, as the server evaluated it. */
1492
1635
  function expandedSnapshotFor(policy, user, options) {
@@ -1941,4 +2084,4 @@ function toCsvRow(event) {
1941
2084
  event.token
1942
2085
  ].map(field).join(",");
1943
2086
  }
1944
- export { memoryEntitlementSource as A, memoryRelationSource as C, memoryApprovalPolicySource as D, approvalPoliciesFor as E, accessOutcome as F, sqlFunction as I, memorySettingsSource as M, memorySnapshotSource as N, validateApprovalPolicy as O, subjectMembershipSource as P, signPolicyDocument as S, approvalPolicies as T, localSnapshotManifest as _, normalizeMembership as a, postgresCacheVersionStore as b, crud as c, snapshotFor as d, assignableFor as f, shadowMode as g, mayAccess as h, decideRoleChange as i, memoryMembershipSource as j, memoryCustomRoleSource as k, readable as l, decideCustomRole as m, toCsvRow as n, normalizeMemberships as o, customRoleSource as p, checkRoleChange as r, resolveScope as s, CSV_COLUMNS as t, writable as u, arazzoFindings as v, stripeEntitlementSource as w, runtimeCacheVersionStore as x, simulateArazzo as y };
2087
+ export { memoryCustomRoleSource as A, signPolicyDocument as C, approvalPoliciesFor as D, approvalPolicies as E, subjectMembershipSource as F, accessOutcome as I, sqlFunction as L, memoryMembershipSource as M, memorySettingsSource as N, memoryApprovalPolicySource as O, memorySnapshotSource as P, runtimeCacheVersionStore as S, stripeEntitlementSource as T, localSnapshotManifest as _, normalizeMembership as a, simulateArazzo as b, crud as c, snapshotFor as d, assignableFor as f, shadowMode as g, mayAccess as h, decideRoleChange as i, memoryEntitlementSource as j, validateApprovalPolicy as k, readable as l, decideCustomRole as m, toCsvRow as n, normalizeMemberships as o, customRoleSource as p, checkRoleChange as r, resolveScope as s, CSV_COLUMNS as t, writable as u, customRoleRecord as v, memoryRelationSource as w, postgresCacheVersionStore as x, arazzoFindings as y };
@@ -1,4 +1,4 @@
1
- import { A as SsfSubject, C as SsfEventName, D as SsfReceiver, E as SsfPermDockOptions, M as SsfTransmitterConfiguration, N as SsfVerification, O as SsfStreamConfiguration, S as SsfEventListener, T as SsfPermDock, _ as SetSubject, a as PollHandle, b as SsfEventHandler, c as PushSetOptions, d as SetDelivery, f as SetDeliveryFailureCause, g as SetQueue, h as SetPollHandlerOptions, i as CaepReason, j as SsfSubjectResolver, k as SsfStreamStatus, l as ReplayStore, m as SetEvent, n as CaepEventName, o as PollOptions, p as SetError, r as CaepInitiatingEntity, s as PollResult, t as CaepCommon, u as RiscEventName, v as SignSetOptions, w as SsfOnEvent, x as SsfEventInput, y as SsfAuditEvent } from "../types-CIzXPPV-.js";
2
- import { t as memoryReplayStore } from "../replay-BCOZifwx.js";
3
- import { A as createPermDock, C as memorySsfStreamStore, D as PollSetsResult, E as PollSetsOptions, O as PolledSet, S as SsfStreamStore, T as setPollHandler, _ as SsfFanOut, a as CaepTokenClaimsChange, b as ssfTransmitter, c as RiscEvents, d as caepEvents, f as pushSet, g as FanOutSetOptions, h as streamVerificationEvent, i as CaepEvents, k as pollSets, l as SSF_POLL_DELIVERY, m as signSet, n as CaepCredentialChange, o as RiscAccountDisabled, p as riscEvents, r as CaepDeviceComplianceChange, s as RiscCredentialCompromise, t as CaepAssuranceLevelChange, u as SSF_PUSH_DELIVERY, v as SsfTransmitterOptions, w as memorySetQueue, x as SsfStream, y as fanOutSet } from "../index-WOx7TBbj.js";
1
+ import { A as SsfSubject, C as SsfEventName, D as SsfReceiver, E as SsfPermDockOptions, M as SsfTransmitterConfiguration, N as SsfVerification, O as SsfStreamConfiguration, S as SsfEventListener, T as SsfPermDock, _ as SetSubject, a as PollHandle, b as SsfEventHandler, c as PushSetOptions, d as SetDelivery, f as SetDeliveryFailureCause, g as SetQueue, h as SetPollHandlerOptions, i as CaepReason, j as SsfSubjectResolver, k as SsfStreamStatus, l as ReplayStore, m as SetEvent, n as CaepEventName, o as PollOptions, p as SetError, r as CaepInitiatingEntity, s as PollResult, t as CaepCommon, u as RiscEventName, v as SignSetOptions, w as SsfOnEvent, x as SsfEventInput, y as SsfAuditEvent } from "../types-B_I8TBA9.js";
2
+ import { t as memoryReplayStore } from "../replay-Dg5-l7xu.js";
3
+ import { A as createPermDock, C as memorySsfStreamStore, D as PollSetsResult, E as PollSetsOptions, O as PolledSet, S as SsfStreamStore, T as setPollHandler, _ as SsfFanOut, a as CaepTokenClaimsChange, b as ssfTransmitter, c as RiscEvents, d as caepEvents, f as pushSet, g as FanOutSetOptions, h as streamVerificationEvent, i as CaepEvents, k as pollSets, l as SSF_POLL_DELIVERY, m as signSet, n as CaepCredentialChange, o as RiscAccountDisabled, p as riscEvents, r as CaepDeviceComplianceChange, s as RiscCredentialCompromise, t as CaepAssuranceLevelChange, u as SSF_PUSH_DELIVERY, v as SsfTransmitterOptions, w as memorySetQueue, x as SsfStream, y as fanOutSet } from "../index-CWwWkz10.js";
4
4
  export { type CaepAssuranceLevelChange, type CaepCommon, type CaepCredentialChange, type CaepDeviceComplianceChange, type CaepEventName, type CaepEvents, type CaepInitiatingEntity, type CaepReason, type CaepTokenClaimsChange, type FanOutSetOptions, type PollHandle, type PollOptions, type PollResult, type PollSetsOptions, type PollSetsResult, type PolledSet, type PushSetOptions, type ReplayStore, type RiscAccountDisabled, type RiscCredentialCompromise, type RiscEventName, type RiscEvents, SSF_POLL_DELIVERY, SSF_PUSH_DELIVERY, type SetDelivery, type SetDeliveryFailureCause, type SetError, type SetEvent, type SetPollHandlerOptions, type SetQueue, type SetSubject, type SignSetOptions, type SsfAuditEvent, type SsfEventHandler, type SsfEventInput, type SsfEventListener, type SsfEventName, type SsfFanOut, type SsfOnEvent, type SsfPermDock, type SsfPermDockOptions, type SsfReceiver, type SsfStream, type SsfStreamConfiguration, type SsfStreamStatus, type SsfStreamStore, type SsfSubject, type SsfSubjectResolver, type SsfTransmitterConfiguration, type SsfTransmitterOptions, type SsfVerification, caepEvents, createPermDock, fanOutSet, memoryReplayStore, memorySetQueue, memorySsfStreamStore, pollSets, pushSet, riscEvents, setPollHandler, signSet, ssfTransmitter, streamVerificationEvent };
@@ -1,5 +1,5 @@
1
- import { qt as Instant, wr as JsonWebKeyLike } from "./policy-types-CfW4X_yX.js";
2
- import { l as ReplayStore } from "./types-CIzXPPV-.js";
1
+ import { Er as JsonWebKeyLike, qt as Instant } from "./policy-types-BnBZvh7N.js";
2
+ import { l as ReplayStore } from "./types-B_I8TBA9.js";
3
3
  /** The three Standard Webhooks headers a delivery carries. */
4
4
  type WebhookHeaders = {
5
5
  readonly "webhook-id": string;
@@ -1,9 +1,9 @@
1
- import { Er as Principal, Jt as ClientBundle, N as PolicyVocabulary, Sr as Delegation, gr as Actor, nn as Snapshot, nr as Decision, vt as TokenVerifier } from "./policy-types-CfW4X_yX.js";
1
+ import { Jt as ClientBundle, N as PolicyVocabulary, Or as Principal, ir as Decision, rn as Snapshot, vr as Actor, vt as TokenVerifier, wr as Delegation } from "./policy-types-BnBZvh7N.js";
2
2
  import { w as Permission } from "./vocabulary-DHfKPIC5.js";
3
3
  import { r as RefreshTrigger } from "./refresh-on-C1zIMtJr.js";
4
- import { a as ProblemDetails } from "./errors-COoiWqIs.js";
5
- import { n as DescribeMessages, t as DecisionDescription } from "./describe-AdETpWsn.js";
6
- import { a as PermDock } from "./permdock-BShHM8OJ.js";
4
+ import { a as ProblemDetails } from "./errors-BGosrHl8.js";
5
+ import { n as DescribeMessages, t as DecisionDescription } from "./describe-FT1oVN_o.js";
6
+ import { a as PermDock } from "./permdock-V86uejcm.js";
7
7
  /** What a `protectAction` action resolves to; both members cross to the client. */
8
8
  type ActionResult<T> = {
9
9
  readonly ok: true;
@@ -1,13 +1,13 @@
1
1
  import { t as compact } from "./compact-C4LFuqbW.js";
2
- import { s as snapshotHeader } from "./snapshot-compact-yXFxZLPo.js";
2
+ import { s as snapshotHeader } from "./snapshot-compact-BWMLnIXK.js";
3
3
  import { t as emptySnapshot } from "./snapshot-empty-pKgPDcLd.js";
4
- import { r as snapshotClaim } from "./membership-filter-C7ZuhAqJ.js";
5
- import { n as parseSnapshot, s as subjectFromSnapshot } from "./snapshot-Ty0uk9wZ.js";
4
+ import { r as snapshotClaim } from "./membership-filter-Bz9QX6E9.js";
5
+ import { n as parseSnapshot, s as subjectFromSnapshot } from "./snapshot-Dzi4LR6n.js";
6
6
  import { c as nowSeconds } from "./tenancy-B5Xxt9Sc.js";
7
7
  import { g as secondsOf } from "./time-r0CKBm57.js";
8
8
  import { t as canonicalJson } from "./canonical-json-BibZkXtE.js";
9
9
  import { n as rowIdOf } from "./row-pair-CxEhErJU.js";
10
- import { t as snapshotReads } from "./snapshot-reads-BnAHiuoa.js";
10
+ import { t as snapshotReads } from "./snapshot-reads-JxcUSUfW.js";
11
11
  import { t as timeoutSignal } from "./timeout-nOqLpU2I.js";
12
12
  // src/client/source.ts
13
13
  /** A compact JWS: three non-empty dot-separated parts. */
@@ -1,9 +1,9 @@
1
- import { _ as SubjectView, a as ClientPermDock, b as ProtectedAction, c as GateMode, d as PermissionSet, f as PermissionState, g as RolesOptions, l as GateView, r as ApprovalHandle, s as FilterResult, v as TenantView } from "./store-core-BdFcruPm.js";
2
- import { N as PolicyVocabulary, Tr as Membership, nr as Decision } from "./policy-types-CfW4X_yX.js";
3
- import { r as DescribeOptions, t as DecisionDescription } from "./describe-AdETpWsn.js";
4
- import { d as UncheckedData, s as RowData } from "./permdock-BShHM8OJ.js";
1
+ import { _ as SubjectView, a as ClientPermDock, b as ProtectedAction, c as GateMode, d as PermissionSet, f as PermissionState, g as RolesOptions, l as GateView, r as ApprovalHandle, s as FilterResult, v as TenantView } from "./store-core-Bq7Qc9QM.js";
2
+ import { Dr as Membership, N as PolicyVocabulary, ir as Decision } from "./policy-types-BnBZvh7N.js";
3
+ import { r as DescribeOptions, t as DecisionDescription } from "./describe-FT1oVN_o.js";
4
+ import { d as UncheckedData, s as RowData } from "./permdock-V86uejcm.js";
5
5
  import { r as Role, w as Permission } from "./vocabulary-DHfKPIC5.js";
6
- import { n as ProtectedActionReadable, r as SveltePermDockOptions } from "./types-BRECeQ2n.js";
6
+ import { n as ProtectedActionReadable, r as SveltePermDockOptions } from "./types-DNOJRhyn.js";
7
7
  import { Readable } from "svelte/store";
8
8
  declare function setPermDock(options: SveltePermDockOptions): ClientPermDock;
9
9
  declare function getPermDock<V extends PolicyVocabulary = PolicyVocabulary>(): ClientPermDock<V>;
@@ -1,6 +1,6 @@
1
1
  import { n as actionRunner, t as actionApproval } from "./protected-action-DiXulRVj.js";
2
2
  import { a as gateView, f as subjectView, i as filterResult, l as rolesView, n as assignablePermissionsView, o as livePermDock, p as tenantView, r as describeWith, s as permissionSet, t as approvalHandle } from "./views-Dpr1uB16.js";
3
- import { n as getUi, r as providePermDock, t as getStore } from "./context-BQHKgT1m.js";
3
+ import { n as getUi, r as providePermDock, t as getStore } from "./context-Nr3nknZX.js";
4
4
  import { derived, readable, toStore, writable } from "svelte/store";
5
5
  // src/svelte/stores.ts
6
6
  function fromStore(store, compute) {
@@ -4,7 +4,7 @@ import { t as byScope } from "./compile-BUKXrueE.js";
4
4
  import { r as isRecord } from "./compact-C4LFuqbW.js";
5
5
  import { n as isForbiddenKey } from "./paths-CeS_gpHf.js";
6
6
  import { t as SQL_IDENT } from "./sql-T4GaBh9X.js";
7
- import { a as quoteIdent, i as qualified, o as quoteLiteral } from "./quote-BKrTBbcH.js";
7
+ import { a as quoteIdent, i as qualified, o as quoteLiteral } from "./quote-LNaBdCGA.js";
8
8
  // src/cli/sql/columns.ts
9
9
  /**
10
10
  * The Postgres type a JSON Schema property compares as; `undefined` for text or
@@ -1,4 +1,4 @@
1
- import { St as VersionQuery, Tr as Membership, br as CustomRole, qt as Instant } from "./policy-types-CfW4X_yX.js";
1
+ import { Dr as Membership, Sr as CustomRole, St as VersionQuery, qt as Instant } from "./policy-types-BnBZvh7N.js";
2
2
  type VersionCacheStats = {
3
3
  /** Version reads the cache started. */
4
4
  readonly reads: number;
@@ -94,6 +94,8 @@ type SubjectRecord = {
94
94
  */
95
95
  readonly tenant?: string;
96
96
  readonly authzVersion?: number;
97
+ /** The tenants the user is a member of while the tenant is suspended. */
98
+ readonly suspendedIn?: readonly string[];
97
99
  /**
98
100
  * The custom-role version of each tenant the user holds a custom role in,
99
101
  * read with the record. A cached record answers a read at a tenant version
@@ -1,14 +1,14 @@
1
- import { D as Policy, Er as Principal, N as PolicyVocabulary, Or as Subject, Q as Intent, qt as Instant } from "../policy-types-CfW4X_yX.js";
2
- import { A as SupabaseSubjectOptions, B as supabaseClaims, C as SupabasePrincipal, D as SupabaseRlsOptions, E as SupabaseRlsMembershipTable, F as SupabaseClaims, I as SupabaseClaimsOptions, L as SupabaseClaimsSchema, M as SupabaseSuspendedScope, N as SupabaseSuspension, O as SupabaseSessionLike, P as SupabaseActClaim, R as SupabaseMembershipClaim, S as SupabasePermissionRef, T as SupabaseRlsConfig, _ as SupabaseActor, a as MembershipStream, b as SupabaseInclude, c as SupabasePostgres, d as supabasePostgresQuery, f as tableMembershipSource, g as SupabaseActiveRow, h as RoleThrough, i as MembershipSql, j as SupabaseSuspendedMembership, k as SupabaseStorage, l as authzVersion, n as MembershipHolders, o as MembershipTableOptions, p as AuthorizeSqlOptions, r as MembershipJunctionOptions, s as SqlMembershipSource, t as AUTHZ_VERSION_TABLE, u as junctionMembershipSource, v as SupabaseActorResult, w as SupabaseRealtime, x as SupabaseMembershipTable, y as SupabaseDelegation, z as SupabasePermDockClaims } from "../sources-CjgZns7t.js";
3
- import { a as ApprovalDelegationSource, m as ApprovalStore, u as ApprovalRequest } from "../types-vKKndyxx.js";
4
- import { a as SupabaseRpcResult, i as SupabaseRpcClient, n as PostgrestSourcesOptions, o as postgrestSources, r as SupabaseRpcCaller, t as PostgrestSources } from "../postgrest-PQ3zAOD2.js";
5
- import { F as PermissionState, P as PermissionCheck, a as PermDock, z as ApprovalPolicySource } from "../permdock-BShHM8OJ.js";
1
+ import { Ar as Subject, D as Policy, N as PolicyVocabulary, Or as Principal, Q as Intent, qt as Instant } from "../policy-types-BnBZvh7N.js";
2
+ import { A as SupabaseSubjectOptions, B as supabaseClaims, C as SupabasePrincipal, D as SupabaseRlsOptions, E as SupabaseRlsMembershipTable, F as SupabaseClaims, I as SupabaseClaimsOptions, L as SupabaseClaimsSchema, M as SupabaseSuspendedScope, N as SupabaseSuspension, O as SupabaseSessionLike, P as SupabaseActClaim, R as SupabaseMembershipClaim, S as SupabasePermissionRef, T as SupabaseRlsConfig, _ as SupabaseActor, a as MembershipStream, b as SupabaseInclude, c as SupabasePostgres, d as supabasePostgresQuery, f as tableMembershipSource, g as SupabaseActiveRow, h as RoleThrough, i as MembershipSql, j as SupabaseSuspendedMembership, k as SupabaseStorage, l as authzVersion, n as MembershipHolders, o as MembershipTableOptions, p as AuthorizeSqlOptions, r as MembershipJunctionOptions, s as SqlMembershipSource, t as AUTHZ_VERSION_TABLE, u as junctionMembershipSource, v as SupabaseActorResult, w as SupabaseRealtime, x as SupabaseMembershipTable, y as SupabaseDelegation, z as SupabasePermDockClaims } from "../sources-Bq7k7g34.js";
3
+ import { a as ApprovalDelegationSource, m as ApprovalStore, u as ApprovalRequest } from "../types-5cvjmHTG.js";
4
+ import { a as SupabaseRpcResult, i as SupabaseRpcClient, n as PostgrestSourcesOptions, o as postgrestSources, r as SupabaseRpcCaller, t as PostgrestSources } from "../postgrest-BG0ipED3.js";
5
+ import { F as PermissionState, P as PermissionCheck, a as PermDock, z as ApprovalPolicySource } from "../permdock-V86uejcm.js";
6
6
  import { t as SqlQuery } from "../sql-BYYNi1lu.js";
7
- import { a as readSubjectRecord, r as SubjectRecord } from "../subject-cache-CnJcz2K_.js";
8
- import { _ as hasTokenHook, a as SupabaseManifestActiveRow, c as SupabaseManifestMembership, d as SupabaseManifestResourceNames, f as SupabaseManifestRls, g as SupabaseManifestValue, h as SupabaseManifestThrough, i as SupabaseManifest, l as SupabaseManifestNames, m as SupabaseManifestScopeNames, n as SupabaseHookClaim, o as SupabaseManifestColumn, p as SupabaseManifestRole, r as SupabaseHookManifest, s as SupabaseManifestHelper, t as SupabaseDatabaseManifest, u as SupabaseManifestRequires, v as parseSupabaseManifest } from "../manifest-DgsxeAsM.js";
9
- import { a as AppOptions, n as PermDockDefinition, r as PermDockQuery } from "../define-permdock-DBgwTFi1.js";
7
+ import { a as readSubjectRecord, r as SubjectRecord } from "../subject-cache-UKUgQCEX.js";
8
+ import { _ as hasTokenHook, a as SupabaseManifestActiveRow, c as SupabaseManifestMembership, d as SupabaseManifestResourceNames, f as SupabaseManifestRls, g as SupabaseManifestValue, h as SupabaseManifestThrough, i as SupabaseManifest, l as SupabaseManifestNames, m as SupabaseManifestScopeNames, n as SupabaseHookClaim, o as SupabaseManifestColumn, p as SupabaseManifestRole, r as SupabaseHookManifest, s as SupabaseManifestHelper, t as SupabaseDatabaseManifest, u as SupabaseManifestRequires, v as parseSupabaseManifest } from "../manifest-BwhZ1s5b.js";
9
+ import { a as AppOptions, n as PermDockDefinition, r as PermDockQuery } from "../define-permdock-4IkoNaB3.js";
10
10
  import { n as supabaseTenantClaim, t as supabaseMembershipsBudget } from "../budget-5LJ8kfZk.js";
11
- import { n as subjectFromSupabaseClient, t as SupabaseClaimsClient } from "../client-subject-xCSkKD1C.js";
11
+ import { n as subjectFromSupabaseClient, t as SupabaseClaimsClient } from "../client-subject-Dzo49nco.js";
12
12
  /**
13
13
  * The server topic the generated version trigger broadcasts on without
14
14
  * better-supabase; no user may join it. With better-supabase it is
@@ -46,6 +46,33 @@ type ExchangeCapabilityOptions = {
46
46
  * read. `undefined` for any subject that is not a live link.
47
47
  */
48
48
  export declare function exchangeCapability(subject: Subject, options: ExchangeCapabilityOptions): Promise<string | undefined>;
49
+ /**
50
+ * The compact `memberships` claim the hook writes: `s` lists the scopes and `r`
51
+ * the roles and `v` the `via` labels the entries use, `e` holds one `[scope
52
+ * index, id, via index or -1, ...role indexes]` array per plain entry, and `o`
53
+ * keeps the entries that carry more than a scope, an id, roles and a `via`
54
+ * (`within`, `grants`, `expires_at`, …) as objects. An id that is a UUID is its
55
+ * 22 character base64url form; any other id is `=` and the text.
56
+ */
57
+ type CompactMemberships = {
58
+ readonly s?: readonly string[];
59
+ readonly r?: readonly string[];
60
+ readonly v?: readonly string[];
61
+ readonly e?: readonly (readonly (string | number)[])[];
62
+ readonly o?: readonly unknown[];
63
+ };
64
+ /**
65
+ * The compact claim for `entries`: the shape the generated hook writes. The
66
+ * claims-size report and the tests use it to measure the claim without a
67
+ * database.
68
+ */
69
+ export declare function compactMemberships(entries: readonly unknown[]): CompactMemberships | readonly unknown[];
70
+ /**
71
+ * The entry array of a `memberships` claim: an array stays as it is and the
72
+ * compact object expands to the entries it stands for. A row that does not
73
+ * resolve becomes `null`, which `readMemberships` drops and reports.
74
+ */
75
+ export declare function expandMemberships(value: unknown): unknown;
49
76
  type SupabaseApprovalStoreOptions = {
50
77
  /** Schema of the generated store functions (`rls.schema`). Default `permdock`. */
51
78
  readonly schema?: string;
@@ -1,9 +1,10 @@
1
- import { r as readSubjectRecord } from "../version-cache-BzK8dwJy.js";
1
+ import { r as readSubjectRecord } from "../version-cache-Ccrfu2A4.js";
2
+ import { n as compactMemberships, r as expandMemberships } from "../read-memberships-DVBitJZG.js";
2
3
  import { n as AUTHZ_TOPIC, r as authzUserTopic, t as AUTHZ_EVENT } from "../authz-topic-D8x24Jv-.js";
3
4
  import { n as supabaseMembershipsBudget, r as supabaseTenantClaim } from "../budget-BH81q2cj.js";
4
- import { a as tableApprovalPolicySource, c as exchangeCapability, i as tableApprovalDelegationSource, n as authorizeSql, o as supabaseApprovalStore, r as supabaseRls, s as supabaseClaims, t as definePermDock } from "../supabase-kWQlkrHw.js";
5
- import { c as tableMembershipSource, i as authzVersion, o as junctionMembershipSource, s as supabasePostgresQuery, t as AUTHZ_VERSION_TABLE } from "../sources-DnjJPGfb.js";
6
- import { r as subjectFromSupabaseClient, s as postgrestSources } from "../resolver-CuIY8aFD.js";
7
- import { a as delegationOf, i as actorOf, o as subjectFromSupabase, s as subjectFromSupabaseSession } from "../definition-options-9o8Hdww3.js";
8
- import { n as parseSupabaseManifest, t as hasTokenHook } from "../manifest-B487A3po.js";
9
- export { AUTHZ_EVENT, AUTHZ_TOPIC, AUTHZ_VERSION_TABLE, actorOf, authorizeSql, authzUserTopic, authzVersion, definePermDock, delegationOf, exchangeCapability, hasTokenHook, junctionMembershipSource, parseSupabaseManifest, postgrestSources, readSubjectRecord, subjectFromSupabase, subjectFromSupabaseClient, subjectFromSupabaseSession, supabaseApprovalStore, supabaseClaims, supabaseMembershipsBudget, supabasePostgresQuery, supabaseRls, supabaseTenantClaim, tableApprovalDelegationSource, tableApprovalPolicySource, tableMembershipSource };
5
+ import { a as tableApprovalPolicySource, c as exchangeCapability, i as tableApprovalDelegationSource, n as authorizeSql, o as supabaseApprovalStore, r as supabaseRls, s as supabaseClaims, t as definePermDock } from "../supabase-DrazwRER.js";
6
+ import { c as tableMembershipSource, i as authzVersion, o as junctionMembershipSource, s as supabasePostgresQuery, t as AUTHZ_VERSION_TABLE } from "../sources-C6Id63F8.js";
7
+ import { r as subjectFromSupabaseClient, s as postgrestSources } from "../resolver-C_a-bddD.js";
8
+ import { a as delegationOf, i as actorOf, o as subjectFromSupabase, s as subjectFromSupabaseSession } from "../definition-options-DO0kIrB9.js";
9
+ import { n as parseSupabaseManifest, t as hasTokenHook } from "../manifest-CIWOmdlP.js";
10
+ export { AUTHZ_EVENT, AUTHZ_TOPIC, AUTHZ_VERSION_TABLE, actorOf, authorizeSql, authzUserTopic, authzVersion, compactMemberships, definePermDock, delegationOf, exchangeCapability, expandMemberships, hasTokenHook, junctionMembershipSource, parseSupabaseManifest, postgrestSources, readSubjectRecord, subjectFromSupabase, subjectFromSupabaseClient, subjectFromSupabaseSession, supabaseApprovalStore, supabaseClaims, supabaseMembershipsBudget, supabasePostgresQuery, supabaseRls, supabaseTenantClaim, tableApprovalDelegationSource, tableApprovalPolicySource, tableMembershipSource };
@@ -1,11 +1,11 @@
1
1
  import { n as TenantSlugResolver, t as TenantFromPathOptions } from "../tenant-from-path-Dq3jkqjh.js";
2
- import { t as InstanceOptions } from "../instance-options-DQCiBBuz.js";
3
- import { a as PermDock } from "../permdock-BShHM8OJ.js";
2
+ import { t as InstanceOptions } from "../instance-options-hq5Cp2Ih.js";
3
+ import { a as PermDock } from "../permdock-V86uejcm.js";
4
4
  import { w as Permission } from "../vocabulary-DHfKPIC5.js";
5
- import { D as Policy, Er as Principal, N as PolicyVocabulary, Or as Subject } from "../policy-types-CfW4X_yX.js";
6
- import { n as ServerAdapterServices } from "../bind-zQacwAOg.js";
5
+ import { Ar as Subject, D as Policy, N as PolicyVocabulary, Or as Principal } from "../policy-types-BnBZvh7N.js";
6
+ import { n as ServerAdapterServices } from "../bind-Bwk9tt1z.js";
7
7
  import { t as RequestContext } from "../request-context-E3-ps-H_.js";
8
- import { i as OpenApiHooks } from "../server-types-C2XX60aF.js";
8
+ import { i as OpenApiHooks } from "../server-types-BlMijUtb.js";
9
9
  import { FetchHandler, Middleware } from "@supabase/middleware";
10
10
  /**
11
11
  * The verified Supabase Auth access-token payload as `@supabase/server`
@@ -1,13 +1,13 @@
1
- import { u as withApp } from "../permdock-CJPIwU1T.js";
1
+ import { u as withApp } from "../permdock-JM9TKevZ.js";
2
2
  import { t as compact } from "../compact-C4LFuqbW.js";
3
3
  import { r as credentialSubject } from "../credential-D9in5keC.js";
4
4
  import { t as instanceOptions } from "../instance-options-CLErhA76.js";
5
5
  import { t as composeWraps } from "../wrap-CsfsaJhd.js";
6
- import { n as attached } from "../bind-BYeoLJgN.js";
7
- import { t as createPermDock$1 } from "../create-COQVXK6C.js";
6
+ import { n as attached } from "../bind-DPptdk31.js";
7
+ import { t as createPermDock$1 } from "../create-BMRnaZel.js";
8
8
  import { o as methodNotAllowed } from "../problem-BZB7zPC7.js";
9
9
  import { n as tenantFromPath$1 } from "../tenant-from-path-AKTSY7uR.js";
10
- import { n as supabaseOptionsOf, o as subjectFromSupabase, t as SUPABASE_OPTIONS } from "../definition-options-9o8Hdww3.js";
10
+ import { n as supabaseOptionsOf, o as subjectFromSupabase, t as SUPABASE_OPTIONS } from "../definition-options-DO0kIrB9.js";
11
11
  import { defineMiddleware } from "@supabase/middleware";
12
12
  // src/supabase/middleware.ts
13
13
  /**
@@ -11,11 +11,25 @@ const inspect = defineLeaf({
11
11
  description: "File to write; a bare --out writes permdock.manifest.json",
12
12
  valueHint: "file"
13
13
  },
14
+ functions: {
15
+ type: "string",
16
+ description: "Print, for each function matching the pattern (public.*_payload), a pass or every reason it is not shared; writes nothing",
17
+ valueHint: "pattern"
18
+ },
14
19
  ...checkFlag
15
20
  },
16
21
  async run(ctx, { flags }) {
22
+ if (flags.functions !== void 0) {
23
+ const { inspectFunctions } = await import("./inspect-functions-CwEAQpVF.js");
24
+ return inspectFunctions({
25
+ cwd: ctx.cwd,
26
+ config: ctx.config,
27
+ pattern: flags.functions,
28
+ json: ctx.json
29
+ });
30
+ }
17
31
  const out = flags.out === "" ? true : flags.out === "-" ? void 0 : flags.out;
18
- const { runSupabase } = await import("./supabase-hook-CluYxKee.js");
32
+ const { runSupabase } = await import("./supabase-hook-D0Yzbl19.js");
19
33
  return runSupabase({
20
34
  cwd: ctx.cwd,
21
35
  config: ctx.config,
@@ -3,15 +3,17 @@ import { d as isoNow, i as dateAt, p as nowSeconds, u as isoAt } from "./time-r0
3
3
  import { t as loadJose } from "./load-jose-CjzIBSKI.js";
4
4
  import { r as isRecord, t as compact } from "./compact-C4LFuqbW.js";
5
5
  import { r as memoByFrozenObject } from "./freeze-DGfJq_j2.js";
6
+ import { r as expandMemberships } from "./read-memberships-DVBitJZG.js";
6
7
  import { t as CUSTOM_ROLES_VERSION_CLAIM } from "./budget-BH81q2cj.js";
7
8
  import { s as ApprovalError } from "./types-DFZKovb3.js";
8
9
  import { c as decodeApprovalCursor, l as encodeApprovalCursor, s as approvalPageSize, t as applyApprovalVerdict } from "./store-n3yEN7dt.js";
9
10
  import { t as canonicalJson } from "./canonical-json-BibZkXtE.js";
10
- import { a as withMembers, i as ownedCaches, n as getPermissions, o as callRpc, r as subjectFromSupabaseClient, s as postgrestSources, t as createResolver } from "./resolver-CuIY8aFD.js";
11
- import { d as keptKeys, l as roleColumn } from "./sources-DnjJPGfb.js";
11
+ import { a as withMembers, i as ownedCaches, n as getPermissions, o as callRpc, r as subjectFromSupabaseClient, s as postgrestSources, t as createResolver } from "./resolver-C_a-bddD.js";
12
+ import { d as keptKeys, l as roleColumn } from "./sources-C6Id63F8.js";
12
13
  import { a as quoteQualifiedTable, c as quoteSqlTable, d as sqlTextArray, i as qualifySqlTable, o as quoteSqlIdent, s as quoteSqlLiteral } from "./sql-T4GaBh9X.js";
13
- import { o as subjectFromSupabase, t as SUPABASE_OPTIONS } from "./definition-options-9o8Hdww3.js";
14
- import { t as definePermDock$1 } from "./define-permdock-D7aKxIax.js";
14
+ import { t as compactMembershipsSql } from "./membership-claim-sql-DGfhIn__.js";
15
+ import { o as subjectFromSupabase, t as SUPABASE_OPTIONS } from "./definition-options-DO0kIrB9.js";
16
+ import { t as definePermDock$1 } from "./define-permdock-CO7YNrOF.js";
15
17
  import { r as isSubject } from "./subject-DkxY-AhF.js";
16
18
  // src/supabase/capability.ts
17
19
  const DEFAULT_TTL = 300;
@@ -64,6 +66,7 @@ const KNOWN = /* @__PURE__ */ new Set([
64
66
  "roles",
65
67
  "memberships",
66
68
  "memberships_truncated",
69
+ "suspended_in",
67
70
  "team_ids",
68
71
  "attrs",
69
72
  "authz_ver",
@@ -119,7 +122,8 @@ function checkPermDockClaims(record, tenantClaim, path, issues) {
119
122
  optional(record, "roles", path, issues, isStrings, "an array of strings");
120
123
  const memberships = own(record, "memberships");
121
124
  if (memberships !== void 0) {
122
- if (Array.isArray(memberships)) for (const [index, item] of memberships.entries()) checkMembership(item, [
125
+ const entries = expandMemberships(memberships);
126
+ if (Array.isArray(entries)) for (const [index, item] of entries.entries()) checkMembership(item, [
123
127
  ...path,
124
128
  "memberships",
125
129
  index
@@ -127,6 +131,7 @@ function checkPermDockClaims(record, tenantClaim, path, issues) {
127
131
  else issue(issues, [...path, "memberships"], "Expected an array");
128
132
  }
129
133
  optional(record, "memberships_truncated", path, issues, (value) => typeof value === "boolean", "a boolean");
134
+ optional(record, "suspended_in", path, issues, isStrings, "an array of strings");
130
135
  optional(record, "team_ids", path, issues, isStrings, "an array of strings");
131
136
  optional(record, tenantClaim, path, issues, isString, "a string");
132
137
  optional(record, "attrs", path, issues, isRecord, "an object");
@@ -625,9 +630,11 @@ const CLAIM_UNEXPIRED = `case jsonb_typeof(m -> 'expires_at')
625
630
  else true
626
631
  end`;
627
632
  function jwtBody(q, scope, custom, suspension) {
633
+ const claimed = "coalesce(claims -> 'memberships', claims -> 'app_metadata' -> 'memberships')";
628
634
  const memberships = `jsonb_array_elements(
629
- case jsonb_typeof(coalesce(claims -> 'memberships', claims -> 'app_metadata' -> 'memberships'))
630
- when 'array' then coalesce(claims -> 'memberships', claims -> 'app_metadata' -> 'memberships')
635
+ case jsonb_typeof(${claimed})
636
+ when 'array' then ${claimed}
637
+ when 'object' then ${compactMembershipsSql(claimed)}
631
638
  else '[]'::jsonb
632
639
  end
633
640
  ) m
@@ -0,0 +1,2 @@
1
+ import "./hook-sql-CbkH78FC.js";
2
+ export { r as runSupabase } from "./supabase-hook-t1HnQf8U.js";