permdock 0.22.0 → 0.23.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/a2a/index.d.ts +4 -4
- package/dist/a2a/index.js +4 -4
- package/dist/{adoption-scan-_bHLMnVQ.js → adoption-scan-CNoE5yBA.js} +1 -1
- package/dist/agent/index.d.ts +2 -2
- package/dist/agent/index.js +1 -1
- package/dist/ai-sdk/index.d.ts +3 -3
- package/dist/ai-sdk/index.js +2 -2
- package/dist/app/index.d.ts +6 -6
- package/dist/app/index.js +4 -4
- package/dist/{approval-normalize-DNLW0zOM.js → approval-normalize-KfhzpD93.js} +1 -1
- package/dist/{approval-policies-UnDSxT__.d.ts → approval-policies-D7moEfTM.d.ts} +1 -1
- package/dist/{approval-prompt-2hTqo6IM.d.ts → approval-prompt-DtfKSH-8.d.ts} +1 -1
- package/dist/approvals/index.d.ts +3 -3
- package/dist/approvals/index.js +3 -3
- package/dist/{approvals-B_sn4Wrn.js → approvals-BfzI8Foe.js} +5 -5
- package/dist/{arazzo-BXD-VJU_.js → arazzo-4rMFOHbu.js} +1 -1
- package/dist/{arazzo-Ct0PGblq.js → arazzo-rsYPFgga.js} +2 -2
- package/dist/astro/index.d.ts +4 -4
- package/dist/astro/index.js +2 -2
- package/dist/{audience-5Xx1hdIv.js → audience-N2BqOvES.js} +1 -1
- package/dist/authzen/index.d.ts +5 -5
- package/dist/authzen/index.js +3 -3
- package/dist/{automation-B20_8UoT.d.ts → automation-CrGcfIZn.d.ts} +1 -1
- package/dist/better-auth/index.d.ts +1 -1
- package/dist/better-auth/index.js +1 -1
- package/dist/better-supabase/index.d.ts +35 -10
- package/dist/better-supabase/index.js +70 -21
- package/dist/{bind-B4Z0U2Gr.js → bind-Cx10JuJ-.js} +3 -3
- package/dist/{bind-CnOMjazH.d.ts → bind-N5jf6kjk.d.ts} +7 -7
- package/dist/{body-B3ylkmmE.js → body-Cy9S8zhw.js} +1 -1
- package/dist/{build-instance-B0vsViF5.js → build-instance-BDGzsGcn.js} +1 -1
- package/dist/{capability-YkRMUAsF.d.ts → capability-mLbd3KZ0.d.ts} +1 -1
- package/dist/{casbin-imBS3UIf.js → casbin-CjUT-wqV.js} +1 -1
- package/dist/{casbin-D5evU3lX.js → casbin-Dg5N0Gfa.js} +1 -1
- package/dist/catalog/index.d.ts +4 -4
- package/dist/catalog/index.js +5 -5
- package/dist/{catalog-Y4CjN8NA.js → catalog-BJu0A15r.js} +2 -2
- package/dist/{catalog-CoyKnU5c.js → catalog-CgA6-DQA.js} +1 -1
- package/dist/catalog-DqYnQz8U.js +1 -0
- package/dist/{catalog-doc-Zi0jRpyH.js → catalog-doc-BoSOQRXT.js} +2 -2
- package/dist/{challenge-B__LcNve.js → challenge-DVw1SrH9.js} +1 -1
- package/dist/chat/index.d.ts +1 -1
- package/dist/chat/index.js +3 -3
- package/dist/chat-sdk/index.d.ts +3 -3
- package/dist/claude-agent/index.d.ts +3 -3
- package/dist/claude-agent/index.js +1 -1
- package/dist/clerk/index.d.ts +2 -2
- package/dist/cli/bin.js +1 -1
- package/dist/cli/index.d.ts +4 -4
- package/dist/cli/index.js +2 -2
- package/dist/cloud/index.d.ts +8 -8
- package/dist/cloud/index.js +2 -2
- package/dist/{cloud-DWCeStPH.js → cloud-Blw4AaQv.js} +2 -2
- package/dist/{codemod-BaPmaCYQ.js → codemod-BFFXaS-S.js} +1 -1
- package/dist/{codemod-B7QKJ_ak.js → codemod-ByRUKVp-.js} +2 -2
- package/dist/{collect-ScSG05VJ.js → collect-COqPRz6O.js} +2 -2
- package/dist/collect-CjFczu8a.js +1 -0
- package/dist/{collect-Cr71JA7z.js → collect-D3ToPa6Z.js} +1 -1
- package/dist/compile/index.d.ts +1 -1
- package/dist/{compile-DC-BrhH1.d.ts → compile-DSwZUJmL.d.ts} +2 -2
- package/dist/{completion-DOUMyCwa.js → completion-BW53byZN.js} +1 -1
- package/dist/{config-DRp-E8Ly.js → config-B0qti4jI.js} +1 -1
- package/dist/{config-report-Bh_nLdAE.js → config-report-DgMqeeK6.js} +2 -2
- package/dist/{context-Cem4QafV.js → context-KrAhRY22.js} +2 -2
- package/dist/convex/index.d.ts +4 -4
- package/dist/convex/index.js +1 -1
- package/dist/{core-CUjhfz0W.js → core-DMQsq2Gv.js} +5 -5
- package/dist/{core-D2JNg5jA.d.ts → core-KsoqXWhf.d.ts} +2 -2
- package/dist/{create-BsL5lCWR.js → create-BRr7Gu7N.js} +6 -6
- package/dist/{create-oMCcZV4X.d.ts → create-ChK8bpCK.d.ts} +7 -7
- package/dist/{create-CPDSbK1a.d.ts → create-DGFv7Dje.d.ts} +4 -4
- package/dist/{create-BJ2_8NDO.js → create-bYkJ4-tg.js} +3 -3
- package/dist/{create-B2tdOygC.d.ts → create-goT32QIN.d.ts} +6 -6
- package/dist/{credential-Bap3HClV.js → credential-DrVrRL7z.js} +2 -2
- package/dist/{credentials-BXV0oz56.js → credentials-UwTE2wCW.js} +1 -1
- package/dist/{credentials-DPX140fN.d.ts → credentials-fqa_Xzzh.d.ts} +2 -2
- package/dist/{condition-evaluate-bVVRSdzq.js → delegation-CrdqnesZ.js} +123 -156
- package/dist/delivery/index.d.ts +4 -4
- package/dist/delivery/index.js +1 -1
- package/dist/{denied-text-BXQkWU7d.d.ts → denied-text-BTMxIn5W.d.ts} +1 -1
- package/dist/{describe-DVobr5FX.d.ts → describe-CazEjtOH.d.ts} +1 -1
- package/dist/{diff-Jc_kbDz-.js → diff-BkuW_5dK.js} +1 -1
- package/dist/{diff-BR9JArxz.js → diff-DLcsCeVo.js} +3 -3
- package/dist/{doctor-DhqSiPkq.js → doctor-Jk2Ifezw.js} +2 -2
- package/dist/{doctor-BBMW5ZT_.js → doctor-oD08zL1e.js} +37 -19
- package/dist/drizzle/index.d.ts +3 -3
- package/dist/elysia/index.d.ts +4 -4
- package/dist/elysia/index.js +3 -3
- package/dist/{errors-D_JIQJYb.d.ts → errors-CXxQwtbZ.d.ts} +1 -1
- package/dist/{evaluate-B5yZHmts.js → evaluate-_JdlbJ32.js} +11 -8
- package/dist/{evaluations-BzTDWO4m.js → evaluations-Bj5xw0EM.js} +3 -3
- package/dist/{evaluations-DQYfh4Jh.d.ts → evaluations-DcUW5VkX.d.ts} +3 -3
- package/dist/evaluator-BvRk9kiK.js +0 -0
- package/dist/evaluator-eager-DvmrpdZt.js +9 -0
- package/dist/evaluator-mHAoYEkk.js +2 -0
- package/dist/eve/index.d.ts +4 -4
- package/dist/eve/index.js +2 -2
- package/dist/express/index.d.ts +4 -4
- package/dist/express/index.js +3 -3
- package/dist/fastify/index.d.ts +4 -4
- package/dist/fastify/index.js +3 -3
- package/dist/{fetch-adapter-MoYZ-vF5.js → fetch-adapter-CAA3VJMX.js} +3 -3
- package/dist/{fetch-adapter-DxqsIXSO.d.ts → fetch-adapter-eQ-mdk8n.d.ts} +2 -2
- package/dist/{fields-CVyOk-f1.js → fields-B17OWcPx.js} +1 -1
- package/dist/fields-DlKwZYiy.js +26 -0
- package/dist/from-snapshot-CdGYjHUg.js +153 -0
- package/dist/{gen-WdycZ_-b.js → gen-BwcwwLok.js} +3 -3
- package/dist/{gen-DXXoFjyf.js → gen-D4ulqsYR.js} +1 -1
- package/dist/grantee-OG4klcNr.js +110 -0
- package/dist/{grantee-match-8J2y60MF.js → grantee-match-CPQ9zV-H.js} +1 -1
- package/dist/h3/index.d.ts +4 -4
- package/dist/h3/index.js +3 -3
- package/dist/{helpers-DzBIfL1N.js → helpers-CO2hDpBU.js} +1 -1
- package/dist/hono/index.d.ts +4 -4
- package/dist/hono/index.js +3 -3
- package/dist/{hosted-DXq1plaP.d.ts → hosted-BUCpV8-u.d.ts} +1 -1
- package/dist/{hosted-C5I2TSXm.js → hosted-cPDyrlsQ.js} +5 -4
- package/dist/{import-CvXswHDy.js → import-B2jgnNS0.js} +1 -1
- package/dist/{import-BE5sDazm.js → import-BsrnU4BF.js} +1 -1
- package/dist/{index-C-R8lBPb.d.ts → index-BXS29UnX.d.ts} +1 -1
- package/dist/{index-BcS8c_2S.d.ts → index-CvKGALWb.d.ts} +4 -4
- package/dist/{index-BdZpqhJK.d.ts → index-CxA-ygwc.d.ts} +2 -2
- package/dist/{index-Cjfa1Uwr.d.ts → index-DD2FBFdm.d.ts} +10 -8
- package/dist/{index-iIsqXFVu.d.ts → index-DQCBzEhO.d.ts} +4 -4
- package/dist/{index-C_8uxAlv.d.ts → index-DYAJ9JX1.d.ts} +4 -4
- package/dist/index.d.ts +16 -16
- package/dist/index.js +21 -18
- package/dist/{init-CqGHcvyR.js → init-Baq0yYfu.js} +1 -1
- package/dist/{init-B_S8Xdz1.js → init-Cik6ITgM.js} +3 -3
- package/dist/{instance-options-C6gEDOts.d.ts → instance-options-BDHB3qBG.d.ts} +1 -1
- package/dist/{instance-snapshot-D_dGTq--.js → instance-snapshot-LPNBG9np.js} +67 -8
- package/dist/jwt/index.d.ts +4 -4
- package/dist/{kernel-NmxiWII2.js → kernel-BY3rVRs2.js} +8 -8
- package/dist/kysely/index.d.ts +3 -3
- package/dist/{login-DoLxv1s5.js → login-CUboKh0f.js} +3 -3
- package/dist/{login-CzwlsBEO.js → login-CcBS1xkU.js} +1 -1
- package/dist/{manifest-BdzBobNK.js → manifest-BoCYBbQL.js} +1 -1
- package/dist/{manifest-B5yF3CIq.d.ts → manifest-C6eFl3Vo.d.ts} +1 -0
- package/dist/{manifest-BAf7cgRx.js → manifest-CIlVL-QT.js} +35 -35
- package/dist/{manifest-schema-CsFsYLF-.js → manifest-schema-svAkgqMc.js} +5 -1
- package/dist/{map-error-p4ROJ_26.js → map-error-BCdb2Nrp.js} +2 -2
- package/dist/may-use-D0_wNcgB.js +126 -0
- package/dist/mcp/index.d.ts +8 -8
- package/dist/mcp/index.js +5 -5
- package/dist/membership-filter-CfLdP_F9.js +68 -0
- package/dist/nest/index.d.ts +4 -4
- package/dist/nest/index.js +3 -3
- package/dist/next/index.d.ts +10 -10
- package/dist/next/index.js +6 -6
- package/dist/next/plugin.d.ts +1 -1
- package/dist/next/plugin.js +1 -1
- package/dist/node/index.d.ts +4 -4
- package/dist/node/index.js +2 -2
- package/dist/openai/index.d.ts +4 -4
- package/dist/openai/index.js +2 -2
- package/dist/openapi/index.d.ts +2 -2
- package/dist/{openapi-EmvKwuWj.js → openapi-DglIpD53.js} +2 -2
- package/dist/{openapi-DroBcLJZ.js → openapi-DobvXTF6.js} +2 -2
- package/dist/orpc/index.d.ts +5 -5
- package/dist/orpc/index.js +3 -3
- package/dist/otel/index.d.ts +3 -3
- package/dist/otel/index.js +1 -1
- package/dist/{output-CYgfpT6o.js → output-B81GJ6u6.js} +1 -1
- package/dist/{ownership-adPAsUwY.js → ownership-B7Ea-hUY.js} +3 -3
- package/dist/{parse-local-manifest-BaCqsqwC.d.ts → parse-local-manifest-DzZOzDsK.d.ts} +1 -1
- package/dist/pdp/index.d.ts +3 -3
- package/dist/pdp/index.js +3 -3
- package/dist/{permdock-B5LyNVgn.js → permdock-HfTF99xX.js} +26 -15
- package/dist/{permdock-BaB-KQqn.d.ts → permdock-vD3mwLSm.d.ts} +3 -3
- package/dist/{permissions-COpRGKt7.js → permissions-CGYZqYsY.js} +2 -2
- package/dist/{policy-x8RBKW8d.d.ts → policy-B_cqFLHu.d.ts} +1 -1
- package/dist/{policy-wGzbAPQF.js → policy-BovcTojN.js} +5 -4
- package/dist/{policy-from-catalog-Cy103lsm.js → policy-from-catalog-lKL280I8.js} +7 -7
- package/dist/{policy-types-rNfz7t0M.d.ts → policy-types-CCBrL7me.d.ts} +14 -0
- package/dist/{postgrest-Cn0Res25.d.ts → postgrest-5WOO47Ud.d.ts} +2 -2
- package/dist/{powersync-BeI0VmEK.js → powersync-B6f4l8C1.js} +2 -2
- package/dist/{powersync-Dpa5AnnN.js → powersync-BUUqJfH2.js} +6 -6
- package/dist/powersync-D12Q6Chj.js +1 -0
- package/dist/prisma/index.d.ts +2 -2
- package/dist/{protected-action-E7Sdt_Dt.js → protected-action-CdqR2-E2.js} +80 -12
- package/dist/{protected-action-C4aj1KjO.d.ts → protected-action-DGuJNiMA.d.ts} +20 -8
- package/dist/{provider-DKO9KHua.js → provider-6mpRZO1E.js} +21 -3
- package/dist/{provider-store-D4PU1my_.js → provider-store-BLd4UEmg.js} +4 -3
- package/dist/{provider-B-1DlOGM.d.ts → provider-yIM04TwN.d.ts} +1 -1
- package/dist/{pull-3tkn25ll.js → pull-4Yi8zYeU.js} +3 -3
- package/dist/pull-Dr6Bq5Jo.js +1 -0
- package/dist/{push-dMyKdlEm.js → push-Dv1nfFPr.js} +3 -3
- package/dist/{pushed-policy-P55cJNx5.d.ts → pushed-policy-B2ZSpnRY.d.ts} +1 -1
- package/dist/{pushed-policy-Bi5-il4C.js → pushed-policy-DJoyBZsd.js} +2 -2
- package/dist/react/index.d.ts +7 -7
- package/dist/react/index.js +4 -4
- package/dist/react/provider-client.d.ts +1 -1
- package/dist/react/provider-client.js +1 -1
- package/dist/react-native/index.d.ts +8 -8
- package/dist/react-native/index.js +7 -6
- package/dist/{replay-DKhFvt0L.d.ts → replay-CsErjiHt.d.ts} +1 -1
- package/dist/{request-context-5gl_oxO1.js → request-context-B_L4ev8L.js} +2 -2
- package/dist/resend/index.d.ts +4 -4
- package/dist/resend/index.js +2 -2
- package/dist/{resolve-names-BnGJU88N.js → resolve-names-SGcLjtFc.js} +10 -5
- package/dist/{rls-DIYSRnDZ.js → rls-Df9NEWD3.js} +1 -1
- package/dist/{rls-qrehUPf_.js → rls-hmwRIS3-.js} +11 -11
- package/dist/{role-builder-boQiUvfo.js → role-builder-BXdhhQcB.js} +5 -3
- package/dist/row-pair-DglMdRFh.js +34 -0
- package/dist/{rpc-BqRiVpbP.d.ts → rpc-D3St8vPO.d.ts} +1 -1
- package/dist/{rpc-Dhi55Whd.js → rpc-DFtputZ1.js} +1 -1
- package/dist/{run-oNqBe0gc.js → run-BXmJIjRA.js} +2 -2
- package/dist/run-DnzrDgU-.js +1 -0
- package/dist/{run-ticket-Dulj4RQk.d.ts → run-ticket-zfABczfh.d.ts} +2 -2
- package/dist/{saas-DABv6vjy.js → saas-DIThcxbn.js} +5 -5
- package/dist/{scan-BYXqcgON.js → scan-BrTSlc_5.js} +1 -1
- package/dist/{schema-Wf-SvlHG.js → schema-UOeI_LTB.js} +1 -1
- package/dist/scim/index.d.ts +1 -1
- package/dist/server/index.d.ts +11 -11
- package/dist/server/index.js +5 -5
- package/dist/{server-types--_Hann81.d.ts → server-types-CtJSDhOv.d.ts} +8 -8
- package/dist/{sink-Cs6z34AX.d.ts → sink-BskpqwLl.d.ts} +2 -2
- package/dist/{skills-B9U465B7.js → skills-BTVeFptV.js} +1 -1
- package/dist/{skills-417bOj4o.js → skills-CAgWKbDR.js} +1 -1
- package/dist/{snapshot-C2j96x97.js → snapshot-BcHYtUIg.js} +57 -7
- package/dist/{snapshot-cache-Cc7VNabe.d.ts → snapshot-cache-BnXMcJbK.d.ts} +1 -1
- package/dist/snapshot-empty-BoPBFoB8.js +17 -0
- package/dist/snapshot-evaluate-CwYVSUgO.js +501 -0
- package/dist/snapshot-reads-DOsTYC82.js +66 -0
- package/dist/solid/index.d.ts +5 -5
- package/dist/solid/index.js +2 -2
- package/dist/solid-start/index.d.ts +4 -4
- package/dist/solid-start/index.js +3 -3
- package/dist/{sources-BfTza0zT.d.ts → sources-DhCtO9G8.d.ts} +2 -2
- package/dist/{src-BG9YJM3Q.js → src-BZKQe1lr.js} +13 -12
- package/dist/ssf/index.d.ts +3 -3
- package/dist/ssf/index.js +2 -2
- package/dist/{standard-webhooks-CJBgfl7y.d.ts → standard-webhooks-kQDkIPj3.d.ts} +2 -2
- package/dist/{store-BpKH-pLm.js → store-DXO0aVgf.js} +2 -2
- package/dist/{store-DSyjHD5-.d.ts → store-core-CDabEiO9.d.ts} +27 -6
- package/dist/{store-options-CXv6BHH6.js → store-options-COLWAd1K.js} +92 -12
- package/dist/{stores-BuqAHjp_.js → stores-DYxx75fk.js} +1 -1
- package/dist/{stores-C6-7TPTV.d.ts → stores-Mw_VAJ3B.d.ts} +5 -5
- package/dist/{subject-cache-d_Z4KAnm.d.ts → subject-cache-DrJGnRiV.d.ts} +1 -1
- package/dist/supabase/index.d.ts +7 -7
- package/dist/supabase/index.js +2 -2
- package/dist/supabase/middleware.d.ts +5 -5
- package/dist/supabase/middleware.js +5 -5
- package/dist/{supabase-DnazO6W4.js → supabase-BDr-fIHp.js} +1 -1
- package/dist/{supabase-D0J99yqL.js → supabase-Bt8rb-ah.js} +2 -2
- package/dist/{supabase-hook-Bh5syR9N.js → supabase-hook-Cb3UZpGC.js} +6 -5
- package/dist/supabase-hook-D1pwHu87.js +1 -0
- package/dist/{supautils-ChXR-4Or.js → supautils-CuR9rPsi.js} +8 -8
- package/dist/svelte/index.d.ts +5 -5
- package/dist/svelte/index.js +3 -3
- package/dist/svelte/runtime.d.ts +3 -3
- package/dist/svelte/runtime.js +1 -1
- package/dist/svelte/source.d.ts +5 -5
- package/dist/svelte/source.js +2 -2
- package/dist/sveltekit/index.d.ts +4 -4
- package/dist/sveltekit/index.js +2 -2
- package/dist/{tables-CbEOy2Ma.js → tables-Bl_ozD0k.js} +35 -13
- package/dist/tanstack-start/index.d.ts +4 -4
- package/dist/tanstack-start/index.js +2 -2
- package/dist/terminal/index.d.ts +5 -5
- package/dist/terminal/index.js +3 -3
- package/dist/testing/core.d.ts +1 -1
- package/dist/testing/core.js +1 -1
- package/dist/testing/fixtures/index.d.ts +4 -4
- package/dist/testing/fixtures/index.js +7 -1
- package/dist/testing/index.d.ts +24 -24
- package/dist/testing/index.js +47 -41
- package/dist/testing/saas/index.d.ts +3 -3
- package/dist/testing/saas/index.js +2 -2
- package/dist/testing/saas/permissions.js +1 -1
- package/dist/trpc/index.d.ts +5 -5
- package/dist/trpc/index.js +3 -3
- package/dist/{type-helpers-iXJEIDe7.d.ts → type-helpers-fQdBvtU0.d.ts} +1 -1
- package/dist/{types-BpxdxaRD.d.ts → types-BSGrzDPi.d.ts} +4 -4
- package/dist/{types-ZfjQB0KC.d.ts → types-CAp7UGiB.d.ts} +1 -1
- package/dist/{types-CD1qmxdx.d.ts → types-CErg7ft6.d.ts} +3 -3
- package/dist/{types-_pi9kxS2.d.ts → types-CXUwgZ3d.d.ts} +2 -2
- package/dist/{types-C_a44wSr.d.ts → types-Cc68_zqR.d.ts} +2 -2
- package/dist/{types-Cq2rvv-C.d.ts → types-CdXM6qPc.d.ts} +2 -2
- package/dist/{types-BSNZMp5b.d.ts → types-ChYCRn7Y.d.ts} +1 -1
- package/dist/{types-CuDXvyIT.d.ts → types-DDlaFDM3.d.ts} +4 -4
- package/dist/{types-NikV1pND.d.ts → types-DM0o1YyJ.d.ts} +4 -4
- package/dist/{types-B9F0EZAF.d.ts → types-DyA4Loy4.d.ts} +3 -3
- package/dist/{types-CS1DI_Ke.d.ts → types-JmB6unT6.d.ts} +1 -1
- package/dist/unplugin/index.d.ts +1 -1
- package/dist/unplugin/index.js +1 -1
- package/dist/{usage-0wsl83uw.js → usage-B6sQwycY.js} +4 -4
- package/dist/{usage-Bl-BkXEq.js → usage-CNkKk27O.js} +1 -1
- package/dist/usage-Cem1FOeJ.js +1 -0
- package/dist/{validation-error-DLAYFlkr.d.ts → validation-error-BE8bpmhR.d.ts} +1 -1
- package/dist/{validity-Buc7w8E9.js → validity-IcjQSR7I.js} +1 -26
- package/dist/{verify-BSLotSa0.js → verify-OtU4yCzg.js} +11 -11
- package/dist/{version-sources-BC3hf2ME.js → version-sources-BZ7V6Z8Z.js} +1 -1
- package/dist/{grantee-Dke-9rd1.js → vocabulary-BuYFWeCU.js} +1 -107
- package/dist/vue/index.d.ts +5 -5
- package/dist/vue/index.js +2 -2
- package/dist/{waiter-cbK1CBhT.d.ts → waiter-LdnPaBJE.d.ts} +2 -2
- package/dist/watch-B8F7Wgdy.js +1 -0
- package/dist/{watch-BigZ260i.js → watch-CR2ZIT_5.js} +1 -1
- package/dist/webmcp/index.d.ts +1 -1
- package/dist/{who-can-CjfMP9a4.js → who-can-DcrHB6ya.js} +2 -2
- package/dist/workflow/index.d.ts +3 -3
- package/dist/workflow/index.js +2 -2
- package/dist/workflow-sdk/index.d.ts +4 -4
- package/dist/{wrap-B-k2qHJx.d.ts → wrap-CVBPIuEs.d.ts} +2 -2
- package/package.json +1 -1
- package/schemas/supabase-manifest-v1.json +7 -1
- package/skills/permdock-wire/references/adapters.md +2 -0
- package/dist/catalog-C462QC3A.js +0 -1
- package/dist/collect-W9i7REKT.js +0 -1
- package/dist/from-snapshot-oR_N97dM.js +0 -927
- package/dist/powersync-BdoR7nwS.js +0 -1
- package/dist/pull-D90HqWNP.js +0 -1
- package/dist/run-elFdnSZx.js +0 -1
- package/dist/supabase-hook-CVAenq-w.js +0 -1
- package/dist/usage-CmyGbo4e.js +0 -1
- package/dist/watch-CHURMgrv.js +0 -1
- package/dist/{connection-QFsv-kbh.js → connection-zoAgwdsD.js} +1 -1
- package/dist/{problem-BWP1l86g.js → problem-CPB8kqk7.js} +1 -1
- package/dist/{wrap-BKU5Arsu.js → wrap-C5PWzgkq.js} +1 -1
|
@@ -0,0 +1,501 @@
|
|
|
1
|
+
import { a as sole, t as compact } from "./compact-CAf557ZB.js";
|
|
2
|
+
import { n as freezeDeep } from "./freeze-jjan0lCv.js";
|
|
3
|
+
import { o as epochSeconds, t as INVALID_NOW } from "./time-nR1JesoH.js";
|
|
4
|
+
import { d as scopeList, l as scopeChain, r as findScope, t as activeFor, u as scopeIdOf } from "./scopes-gdH__vDZ.js";
|
|
5
|
+
import { a as readOnlyActorRefuses, n as coveredByDelegation, s as evaluateCondition } from "./delegation-CrdqnesZ.js";
|
|
6
|
+
import { t as requiresApproval } from "./approval-required-TzNB9oQA.js";
|
|
7
|
+
import { o as resourceRoleCondition } from "./grantee-conditions-Dzprappv.js";
|
|
8
|
+
import { n as matchGrantee } from "./grantee-match-CPQ9zV-H.js";
|
|
9
|
+
import { r as readWireValidity, t as isActive } from "./validity-IcjQSR7I.js";
|
|
10
|
+
import { t as grantCoversField } from "./fields-DlKwZYiy.js";
|
|
11
|
+
import { t as resourceIdOf } from "./resource-ref-CaS9yVPi.js";
|
|
12
|
+
import { n as rowIdOf, r as rowValues } from "./row-pair-DglMdRFh.js";
|
|
13
|
+
import { c as nowSeconds, f as rowInScope, n as inTeam, o as membershipField, r as isMembershipExpired, s as nestedAppliesWithoutRow } from "./tenancy-BlxY5T0q.js";
|
|
14
|
+
import { i as tokenPayload, n as decisionToken } from "./token-DaMnIU9O.js";
|
|
15
|
+
import { s as bindConditionRefs } from "./snapshot-BcHYtUIg.js";
|
|
16
|
+
//#region src/core/where-scope.ts
|
|
17
|
+
const ALWAYS = freezeDeep({
|
|
18
|
+
op: "eq",
|
|
19
|
+
field: "_",
|
|
20
|
+
value: true
|
|
21
|
+
});
|
|
22
|
+
function eq(field, value) {
|
|
23
|
+
return value === void 0 ? {
|
|
24
|
+
op: "or",
|
|
25
|
+
conditions: []
|
|
26
|
+
} : {
|
|
27
|
+
op: "eq",
|
|
28
|
+
field,
|
|
29
|
+
value
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* One equality per partitioning scope key on the membership's chain, outermost
|
|
34
|
+
* first.
|
|
35
|
+
*/
|
|
36
|
+
function namedFilters(membership, scope) {
|
|
37
|
+
if (findScope(scope.scopes, membership.scope ?? "") === void 0 || !inTeam(membership, scope.scopes, scope.team) || !activeFor(membership, scope.scopes, scope.tenant) || membership.scope === void 0) return null;
|
|
38
|
+
const filters = [];
|
|
39
|
+
for (const name of scopeChain(scope.scopes, membership.scope).toReversed()) {
|
|
40
|
+
const key = scope.fieldOf(name);
|
|
41
|
+
if (key !== void 0 && scope.partitioned(name, key)) filters.push(eq(key, scopeIdOf(membership, name)));
|
|
42
|
+
}
|
|
43
|
+
return filters;
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* The row filters a grant's membership implies, or `null` when the grant
|
|
47
|
+
* reaches no row in this scope (another tenant, no active tenant, expired).
|
|
48
|
+
*/
|
|
49
|
+
function scopeFilters(grant, scope) {
|
|
50
|
+
if (grant.scope === void 0) return [];
|
|
51
|
+
const membership = grant.membership;
|
|
52
|
+
if (membership === void 0 || isMembershipExpired(membership, scope.now)) return null;
|
|
53
|
+
if (typeof grant.scope === "string") return membership.scope === grant.scope ? namedFilters(membership, scope) : null;
|
|
54
|
+
const on = membership.on;
|
|
55
|
+
if (on === void 0) return null;
|
|
56
|
+
if (scope.resources === void 0) return on.resource === grant.scope.resource && on.resource === scope.resource ? [eq("id", on.id)] : null;
|
|
57
|
+
const roleResource = scope.resources.get(grant.scope.resource);
|
|
58
|
+
if (on.resource !== grant.scope.resource && membershipField(roleResource, on.resource, scope.resources) === void 0) return null;
|
|
59
|
+
const walked = scope.graph === true ? resourceRoleCondition(scope.resources.get(scope.resource), on.resource, [on.id], scope.resources) : void 0;
|
|
60
|
+
if (walked !== void 0) return [walked];
|
|
61
|
+
const field = membershipField(scope.resources.get(scope.resource), on.resource, scope.resources);
|
|
62
|
+
return field === void 0 ? null : [eq(field, on.id)];
|
|
63
|
+
}
|
|
64
|
+
function all(conditions) {
|
|
65
|
+
if (conditions.length === 0) return ALWAYS;
|
|
66
|
+
return sole(conditions) ?? {
|
|
67
|
+
op: "and",
|
|
68
|
+
conditions: [...conditions]
|
|
69
|
+
};
|
|
70
|
+
}
|
|
71
|
+
function scopedCondition(grant, scope) {
|
|
72
|
+
const filters = scopeFilters(grant, scope);
|
|
73
|
+
if (filters === null) return null;
|
|
74
|
+
const parts = grant.where === void 0 ? filters : [...filters, grant.where];
|
|
75
|
+
return parts.length === 0 ? "always" : all(parts);
|
|
76
|
+
}
|
|
77
|
+
/** Whether an unconditional `deny` removes every row `allow` could reach. */
|
|
78
|
+
function covers(deny, allow, scopes) {
|
|
79
|
+
if (deny.where !== void 0) return false;
|
|
80
|
+
const denied = deny.membership;
|
|
81
|
+
if (deny.scope === void 0 || denied === void 0) return deny.scope === void 0;
|
|
82
|
+
const allowed = allow.membership;
|
|
83
|
+
if (allowed === void 0) return false;
|
|
84
|
+
if (typeof deny.scope === "object") return typeof allow.scope === "object" && denied.on?.resource === allowed.on?.resource && denied.on?.id === allowed.on?.id;
|
|
85
|
+
if (typeof allow.scope !== "string" || allowed.scope === void 0) return false;
|
|
86
|
+
const chain = scopeChain(scopes, deny.scope);
|
|
87
|
+
return scopeChain(scopes, allowed.scope).includes(deny.scope) && chain.every((name) => scopeIdOf(allowed, name) === scopeIdOf(denied, name));
|
|
88
|
+
}
|
|
89
|
+
/**
|
|
90
|
+
* The portable filter for one permission's grants: allows OR together, each
|
|
91
|
+
* narrowed to its membership's tenant, team or resource; any applicable
|
|
92
|
+
* portable deny is subtracted, and an unconditional one empties the result.
|
|
93
|
+
*/
|
|
94
|
+
function collect(grants, scope) {
|
|
95
|
+
const none = {
|
|
96
|
+
op: "or",
|
|
97
|
+
conditions: []
|
|
98
|
+
};
|
|
99
|
+
const partial = grants.some((grant) => grant.portable === false);
|
|
100
|
+
const denies = [];
|
|
101
|
+
for (const grant of grants) {
|
|
102
|
+
if (grant.effect !== "deny" || grant.portable === false || !isActive(readWireValidity(grant.validity, "deny"), scope.now)) continue;
|
|
103
|
+
const condition = scopedCondition(grant, scope);
|
|
104
|
+
if (condition === "always") return {
|
|
105
|
+
condition: none,
|
|
106
|
+
partial
|
|
107
|
+
};
|
|
108
|
+
if (condition !== null) denies.push({
|
|
109
|
+
grant,
|
|
110
|
+
condition
|
|
111
|
+
});
|
|
112
|
+
}
|
|
113
|
+
const parts = [];
|
|
114
|
+
for (const grant of grants) {
|
|
115
|
+
if (grant.effect !== "allow" || grant.portable === false || !isActive(readWireValidity(grant.validity), scope.now)) continue;
|
|
116
|
+
const condition = scopedCondition(grant, scope);
|
|
117
|
+
if (condition === null || denies.some((deny) => covers(deny.grant, grant, scope.scopes))) continue;
|
|
118
|
+
parts.push(all([...condition === "always" ? [] : [condition], ...denies.map((deny) => ({
|
|
119
|
+
op: "not",
|
|
120
|
+
condition: deny.condition
|
|
121
|
+
}))]));
|
|
122
|
+
}
|
|
123
|
+
if (parts.length === 0) return {
|
|
124
|
+
condition: none,
|
|
125
|
+
partial
|
|
126
|
+
};
|
|
127
|
+
return {
|
|
128
|
+
condition: sole(parts) ?? {
|
|
129
|
+
op: "or",
|
|
130
|
+
conditions: parts
|
|
131
|
+
},
|
|
132
|
+
partial
|
|
133
|
+
};
|
|
134
|
+
}
|
|
135
|
+
/**
|
|
136
|
+
* `collect`, with every subject ref bound to `scope.subject` and the subject
|
|
137
|
+
* attached (not enumerable) for `memberOf`, which needs its memberships.
|
|
138
|
+
*/
|
|
139
|
+
function whereFromGrants(grants, scope) {
|
|
140
|
+
const { condition, partial } = collect(grants, scope);
|
|
141
|
+
const result = {
|
|
142
|
+
condition: bindConditionRefs(condition, scope.subject),
|
|
143
|
+
partial
|
|
144
|
+
};
|
|
145
|
+
Object.defineProperty(result, "subject", {
|
|
146
|
+
value: scope.subject,
|
|
147
|
+
enumerable: false
|
|
148
|
+
});
|
|
149
|
+
Object.defineProperty(result, "scopes", {
|
|
150
|
+
value: scope.scopes,
|
|
151
|
+
enumerable: false
|
|
152
|
+
});
|
|
153
|
+
if (scope.resources !== void 0) Object.defineProperty(result, "resources", {
|
|
154
|
+
value: scope.resources,
|
|
155
|
+
enumerable: false
|
|
156
|
+
});
|
|
157
|
+
return freezeDeep(result);
|
|
158
|
+
}
|
|
159
|
+
//#endregion
|
|
160
|
+
//#region src/core/snapshot-evaluate.ts
|
|
161
|
+
function coveredByInclude(snapshot, permission) {
|
|
162
|
+
const include = snapshot.include;
|
|
163
|
+
if (include === void 0 || include.length === 0) return true;
|
|
164
|
+
return include.some((prefix) => permission.key === prefix || permission.key.startsWith(`${prefix}.`) || permission.resource === prefix);
|
|
165
|
+
}
|
|
166
|
+
/**
|
|
167
|
+
* The field of `resource` that holds scope `name`'s id in a snapshot: its
|
|
168
|
+
* `fields` entry, else the scope's key.
|
|
169
|
+
*/
|
|
170
|
+
function snapshotField(snapshot, name, resource) {
|
|
171
|
+
const entry = snapshot.scopes?.find((item) => item.name === name);
|
|
172
|
+
return entry?.fields?.[resource] ?? entry?.key;
|
|
173
|
+
}
|
|
174
|
+
function scopeOk(snapshot, grant, permission, subject, data, team, now, only) {
|
|
175
|
+
const scope = grant.scope;
|
|
176
|
+
if (scope === void 0) return { ok: true };
|
|
177
|
+
if (only !== void 0 && scope !== only) return {
|
|
178
|
+
ok: false,
|
|
179
|
+
reason: "scope"
|
|
180
|
+
};
|
|
181
|
+
const principal = subject.principal;
|
|
182
|
+
const membership = grant.membership;
|
|
183
|
+
if (principal === null || membership === void 0) return {
|
|
184
|
+
ok: false,
|
|
185
|
+
reason: "no-membership"
|
|
186
|
+
};
|
|
187
|
+
if (isMembershipExpired(membership, now)) return {
|
|
188
|
+
ok: false,
|
|
189
|
+
reason: "expired-membership"
|
|
190
|
+
};
|
|
191
|
+
if (typeof scope === "string") {
|
|
192
|
+
const scopes = scopeList(snapshot.scopes);
|
|
193
|
+
if (membership.scope !== scope || !scopes.some((entry) => entry.name === scope)) return {
|
|
194
|
+
ok: false,
|
|
195
|
+
reason: "scope"
|
|
196
|
+
};
|
|
197
|
+
if (!activeFor(membership, scopes, principal.tenant)) return {
|
|
198
|
+
ok: false,
|
|
199
|
+
reason: principal.tenant === void 0 && principal.unheldTenant === void 0 ? "no-tenant" : principal.tenant === void 0 ? "no-membership" : "tenant-mismatch"
|
|
200
|
+
};
|
|
201
|
+
if (!inTeam(membership, scopes, team)) return {
|
|
202
|
+
ok: false,
|
|
203
|
+
reason: "scope"
|
|
204
|
+
};
|
|
205
|
+
if (data === null || typeof data !== "object") return permission.kind !== "instance" || nestedAppliesWithoutRow(membership, scopes, data, team) ? { ok: true } : {
|
|
206
|
+
ok: false,
|
|
207
|
+
reason: "scope"
|
|
208
|
+
};
|
|
209
|
+
const partitioned = (name) => snapshot.scopes?.find((entry) => entry.name === name)?.resources?.includes(permission.resource) === true;
|
|
210
|
+
return rowInScope(membership, scopes, data, partitioned, (name) => snapshotField(snapshot, name, permission.resource));
|
|
211
|
+
}
|
|
212
|
+
const on = membership.on;
|
|
213
|
+
if (on === void 0 || on.resource !== scope.resource || on.resource !== permission.resource) return {
|
|
214
|
+
ok: false,
|
|
215
|
+
reason: "scope"
|
|
216
|
+
};
|
|
217
|
+
if (on.id !== rowIdOf(data, snapshot.ids?.[permission.resource])) return {
|
|
218
|
+
ok: false,
|
|
219
|
+
reason: "scope"
|
|
220
|
+
};
|
|
221
|
+
return { ok: true };
|
|
222
|
+
}
|
|
223
|
+
function conditionOk(grant, permission, current, next, subject, now, scopes) {
|
|
224
|
+
let opaqueReached = false;
|
|
225
|
+
const onOpaque = () => {
|
|
226
|
+
opaqueReached = true;
|
|
227
|
+
};
|
|
228
|
+
if (grant.portable === false) return {
|
|
229
|
+
matched: false,
|
|
230
|
+
reason: "opaque-condition"
|
|
231
|
+
};
|
|
232
|
+
const deny = grant.effect === "deny";
|
|
233
|
+
let whereMatched;
|
|
234
|
+
if (grant.where !== void 0) {
|
|
235
|
+
if (permission.kind === "collection" || current === void 0) return {
|
|
236
|
+
matched: false,
|
|
237
|
+
reason: "condition"
|
|
238
|
+
};
|
|
239
|
+
if (grant.where.op === "opaque" || grant.check?.op === "opaque") return {
|
|
240
|
+
matched: false,
|
|
241
|
+
reason: "opaque-condition"
|
|
242
|
+
};
|
|
243
|
+
whereMatched = evaluateCondition(grant.where, current, subject, now, scopes, void 0, onOpaque);
|
|
244
|
+
if (opaqueReached) return {
|
|
245
|
+
matched: false,
|
|
246
|
+
reason: "opaque-condition"
|
|
247
|
+
};
|
|
248
|
+
if (whereMatched && deny) return { matched: true };
|
|
249
|
+
if (!whereMatched && !deny) return {
|
|
250
|
+
matched: false,
|
|
251
|
+
reason: "condition"
|
|
252
|
+
};
|
|
253
|
+
}
|
|
254
|
+
const check = grant.check ?? (permission.action === "update" ? grant.where : void 0);
|
|
255
|
+
if (check === void 0 && whereMatched === false) return {
|
|
256
|
+
matched: false,
|
|
257
|
+
reason: "condition"
|
|
258
|
+
};
|
|
259
|
+
if (check !== void 0) {
|
|
260
|
+
if (check.op === "opaque") return {
|
|
261
|
+
matched: false,
|
|
262
|
+
reason: "opaque-condition"
|
|
263
|
+
};
|
|
264
|
+
if (next === void 0) return {
|
|
265
|
+
matched: false,
|
|
266
|
+
reason: "condition"
|
|
267
|
+
};
|
|
268
|
+
const matched = evaluateCondition(check, next, subject, now, scopes, void 0, onOpaque);
|
|
269
|
+
if (opaqueReached) return {
|
|
270
|
+
matched: false,
|
|
271
|
+
reason: "opaque-condition"
|
|
272
|
+
};
|
|
273
|
+
if (!matched) return {
|
|
274
|
+
matched: false,
|
|
275
|
+
reason: "condition"
|
|
276
|
+
};
|
|
277
|
+
}
|
|
278
|
+
return { matched: true };
|
|
279
|
+
}
|
|
280
|
+
function matchedOf(grant) {
|
|
281
|
+
return compact({
|
|
282
|
+
role: grant.role,
|
|
283
|
+
permission: grant.permission,
|
|
284
|
+
name: grant.name,
|
|
285
|
+
meta: grant.meta,
|
|
286
|
+
to: grant.to,
|
|
287
|
+
where: grant.where,
|
|
288
|
+
check: grant.check,
|
|
289
|
+
approval: grant.approval
|
|
290
|
+
});
|
|
291
|
+
}
|
|
292
|
+
function evaluateSnapshot(snapshot, subject, permission, data, team, options, outcomeOnly = false) {
|
|
293
|
+
let clock = options.now === void 0 ? void 0 : epochSeconds(options.now);
|
|
294
|
+
const now = () => clock ??= nowSeconds();
|
|
295
|
+
const tracer = options.explain === true ? {
|
|
296
|
+
evaluated: 0,
|
|
297
|
+
allows: [],
|
|
298
|
+
denies: [],
|
|
299
|
+
skipped: []
|
|
300
|
+
} : void 0;
|
|
301
|
+
const done = (raw) => {
|
|
302
|
+
if (outcomeOnly) return raw;
|
|
303
|
+
const decision = raw.outcome === "denied" ? {
|
|
304
|
+
...raw,
|
|
305
|
+
permission: permission.key
|
|
306
|
+
} : raw;
|
|
307
|
+
return freezeDeep(tracer === void 0 ? decision : {
|
|
308
|
+
...decision,
|
|
309
|
+
trace: {
|
|
310
|
+
evaluated: tracer.evaluated,
|
|
311
|
+
allows: tracer.allows,
|
|
312
|
+
denies: tracer.denies,
|
|
313
|
+
skipped: tracer.skipped
|
|
314
|
+
}
|
|
315
|
+
});
|
|
316
|
+
};
|
|
317
|
+
const skip = (grant, why) => {
|
|
318
|
+
tracer?.skipped.push({
|
|
319
|
+
role: grant.role,
|
|
320
|
+
permission: grant.permission,
|
|
321
|
+
effect: grant.effect,
|
|
322
|
+
why
|
|
323
|
+
});
|
|
324
|
+
};
|
|
325
|
+
if (!coveredByInclude(snapshot, permission)) return done({
|
|
326
|
+
outcome: "denied",
|
|
327
|
+
denials: [{
|
|
328
|
+
role: null,
|
|
329
|
+
reason: "opaque-condition"
|
|
330
|
+
}],
|
|
331
|
+
alternatives: []
|
|
332
|
+
});
|
|
333
|
+
if (clock !== void 0 && !Number.isFinite(clock)) return done({
|
|
334
|
+
outcome: "denied",
|
|
335
|
+
denials: [{
|
|
336
|
+
role: null,
|
|
337
|
+
reason: "validation",
|
|
338
|
+
detail: INVALID_NOW
|
|
339
|
+
}],
|
|
340
|
+
alternatives: []
|
|
341
|
+
});
|
|
342
|
+
const { current, next } = rowValues(permission, data);
|
|
343
|
+
const scopes = scopeList(snapshot.scopes);
|
|
344
|
+
const denials = [];
|
|
345
|
+
const allows = [];
|
|
346
|
+
for (const grant of snapshot.grants) {
|
|
347
|
+
if (grant.permission !== permission.key) continue;
|
|
348
|
+
if (tracer !== void 0) tracer.evaluated += 1;
|
|
349
|
+
const match = matchGrantee(grant.to, subject, now(), void 0, scopes, void 0, grant.effect === "deny");
|
|
350
|
+
if (!match.matched) {
|
|
351
|
+
denials.push(compact({
|
|
352
|
+
role: grant.role,
|
|
353
|
+
reason: match.reason ?? "no-grant",
|
|
354
|
+
to: grant.to
|
|
355
|
+
}));
|
|
356
|
+
continue;
|
|
357
|
+
}
|
|
358
|
+
let scoped = scopeOk(snapshot, grant, permission, subject, permission.kind === "instance" ? current : next, team, now(), options.scope);
|
|
359
|
+
if (scoped.ok !== (grant.effect === "deny") && permission.kind === "instance" && next !== current) scoped = scopeOk(snapshot, grant, permission, subject, next, team, now(), options.scope);
|
|
360
|
+
if (!scoped.ok) {
|
|
361
|
+
denials.push(compact({
|
|
362
|
+
role: grant.role,
|
|
363
|
+
reason: scoped.reason,
|
|
364
|
+
to: grant.to
|
|
365
|
+
}));
|
|
366
|
+
continue;
|
|
367
|
+
}
|
|
368
|
+
if (!isActive(readWireValidity(grant.validity, grant.effect), now())) {
|
|
369
|
+
if (grant.effect === "allow") denials.push({
|
|
370
|
+
role: grant.role,
|
|
371
|
+
reason: "inactive-grant",
|
|
372
|
+
detail: grant.validity
|
|
373
|
+
});
|
|
374
|
+
else skip(grant, "validity");
|
|
375
|
+
continue;
|
|
376
|
+
}
|
|
377
|
+
if (grant.effect === "deny" && grant.portable === false) {
|
|
378
|
+
if (!grantCoversField(grant.fields, options.field, grant.effect)) {
|
|
379
|
+
skip(grant, "field");
|
|
380
|
+
continue;
|
|
381
|
+
}
|
|
382
|
+
tracer?.denies.push(matchedOf(grant));
|
|
383
|
+
return done({
|
|
384
|
+
outcome: "denied",
|
|
385
|
+
denials: [{
|
|
386
|
+
role: grant.role,
|
|
387
|
+
reason: "opaque-condition"
|
|
388
|
+
}],
|
|
389
|
+
alternatives: []
|
|
390
|
+
});
|
|
391
|
+
}
|
|
392
|
+
const condition = conditionOk(grant, permission, current, next, subject, now(), scopes);
|
|
393
|
+
if (!condition.matched && grant.effect === "deny" && condition.reason === "opaque-condition" && grantCoversField(grant.fields, options.field, grant.effect)) {
|
|
394
|
+
tracer?.denies.push(matchedOf(grant));
|
|
395
|
+
return done({
|
|
396
|
+
outcome: "denied",
|
|
397
|
+
denials: [{
|
|
398
|
+
role: grant.role,
|
|
399
|
+
reason: "opaque-condition"
|
|
400
|
+
}],
|
|
401
|
+
alternatives: []
|
|
402
|
+
});
|
|
403
|
+
}
|
|
404
|
+
if (!condition.matched) {
|
|
405
|
+
denials.push({
|
|
406
|
+
role: grant.role,
|
|
407
|
+
reason: condition.reason ?? "condition"
|
|
408
|
+
});
|
|
409
|
+
continue;
|
|
410
|
+
}
|
|
411
|
+
if (!grantCoversField(grant.fields, options.field, grant.effect)) {
|
|
412
|
+
skip(grant, "field");
|
|
413
|
+
continue;
|
|
414
|
+
}
|
|
415
|
+
if (grant.effect === "deny") {
|
|
416
|
+
tracer?.denies.push(matchedOf(grant));
|
|
417
|
+
return done({
|
|
418
|
+
outcome: "denied",
|
|
419
|
+
denials: [{
|
|
420
|
+
role: grant.role,
|
|
421
|
+
reason: "deny"
|
|
422
|
+
}],
|
|
423
|
+
alternatives: []
|
|
424
|
+
});
|
|
425
|
+
}
|
|
426
|
+
tracer?.allows.push(matchedOf(grant));
|
|
427
|
+
allows.push(grant);
|
|
428
|
+
}
|
|
429
|
+
const [matched] = allows;
|
|
430
|
+
if (matched === void 0) {
|
|
431
|
+
for (const entry of snapshot.notEntitled ?? []) if (entry.permission === permission.key) denials.push({
|
|
432
|
+
role: entry.role,
|
|
433
|
+
reason: "not-entitled",
|
|
434
|
+
to: entry.to
|
|
435
|
+
});
|
|
436
|
+
return done({
|
|
437
|
+
outcome: "denied",
|
|
438
|
+
denials: denials.length > 0 ? denials : [{
|
|
439
|
+
role: null,
|
|
440
|
+
reason: subject.principal === null ? "anonymous" : "no-grant"
|
|
441
|
+
}],
|
|
442
|
+
alternatives: []
|
|
443
|
+
});
|
|
444
|
+
}
|
|
445
|
+
if (snapshot.delegated !== void 0 && !snapshot.delegated.includes(permission.key) || readOnlyActorRefuses(subject.actor, permission)) return done({
|
|
446
|
+
outcome: "denied",
|
|
447
|
+
denials: [{
|
|
448
|
+
role: null,
|
|
449
|
+
reason: "not-delegated"
|
|
450
|
+
}],
|
|
451
|
+
alternatives: []
|
|
452
|
+
});
|
|
453
|
+
const miss = coveredByDelegation(permission, subject.delegation, resourceIdOf(current), subject.actor !== void 0 && snapshot.delegated === void 0);
|
|
454
|
+
if (miss !== void 0) return done({
|
|
455
|
+
outcome: "denied",
|
|
456
|
+
denials: [{
|
|
457
|
+
role: null,
|
|
458
|
+
reason: miss
|
|
459
|
+
}],
|
|
460
|
+
alternatives: []
|
|
461
|
+
});
|
|
462
|
+
const resourceId = permission.kind === "collection" ? "*" : rowIdOf(current, snapshot.ids?.[permission.resource]);
|
|
463
|
+
const token = outcomeOnly ? "" : decisionToken({
|
|
464
|
+
key: permission.key,
|
|
465
|
+
resourceId,
|
|
466
|
+
principal: subject.principal,
|
|
467
|
+
actor: subject.actor,
|
|
468
|
+
source: `snapshot:${snapshot.issuedAt}`,
|
|
469
|
+
payload: tokenPayload(resourceId, next ?? current, options.args),
|
|
470
|
+
fingerprint: options.fingerprint
|
|
471
|
+
});
|
|
472
|
+
const grant = matchedOf(matched);
|
|
473
|
+
if (requiresApproval(matched.approval)) return done(compact({
|
|
474
|
+
outcome: "approval-required",
|
|
475
|
+
grant,
|
|
476
|
+
reason: "human",
|
|
477
|
+
token,
|
|
478
|
+
fingerprint: options.fingerprint
|
|
479
|
+
}));
|
|
480
|
+
return done(compact({
|
|
481
|
+
outcome: "granted",
|
|
482
|
+
subject,
|
|
483
|
+
matched: grant,
|
|
484
|
+
token,
|
|
485
|
+
obligations: matched.obligations
|
|
486
|
+
}));
|
|
487
|
+
}
|
|
488
|
+
function whereFromSnapshot(snapshot, subject, permission, team) {
|
|
489
|
+
return whereFromGrants(snapshot.grants.filter((grant) => grant.permission === permission.key), {
|
|
490
|
+
resource: permission.resource,
|
|
491
|
+
scopes: scopeList(snapshot.scopes),
|
|
492
|
+
partitioned: (name) => snapshot.scopes?.find((entry) => entry.name === name)?.resources?.includes(permission.resource) === true,
|
|
493
|
+
fieldOf: (name) => snapshotField(snapshot, name, permission.resource),
|
|
494
|
+
tenant: subject.principal?.tenant,
|
|
495
|
+
team,
|
|
496
|
+
now: nowSeconds(),
|
|
497
|
+
subject
|
|
498
|
+
});
|
|
499
|
+
}
|
|
500
|
+
//#endregion
|
|
501
|
+
export { whereFromSnapshot as n, whereFromGrants as r, evaluateSnapshot as t };
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { t as compact } from "./compact-CAf557ZB.js";
|
|
2
|
+
import { l as synthesiseRole, r as findRole, s as listRoles } from "./vocabulary-BuYFWeCU.js";
|
|
3
|
+
import { d as scopeList } from "./scopes-gdH__vDZ.js";
|
|
4
|
+
import { a as heldRoleNames } from "./snapshot-BcHYtUIg.js";
|
|
5
|
+
import { t as filterMemberships } from "./membership-filter-CfLdP_F9.js";
|
|
6
|
+
//#region src/core/snapshot-reads.ts
|
|
7
|
+
function assignableEntry(snapshot, tenant) {
|
|
8
|
+
if (tenant === void 0) return;
|
|
9
|
+
return snapshot.assignable?.find((entry) => entry.tenant === tenant);
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* The members of a snapshot instance that only read the snapshot: memberships,
|
|
13
|
+
* tenants, held roles, audiences and what the subject may hand out. A client
|
|
14
|
+
* reads them without the evaluator.
|
|
15
|
+
*/
|
|
16
|
+
function snapshotReads(snapshot, subject) {
|
|
17
|
+
return {
|
|
18
|
+
memberships(filter) {
|
|
19
|
+
return filterMemberships(subject.principal?.memberships ?? [], filter);
|
|
20
|
+
},
|
|
21
|
+
tenants() {
|
|
22
|
+
return snapshot.tenants;
|
|
23
|
+
},
|
|
24
|
+
heldRoles(query) {
|
|
25
|
+
const names = heldRoleNames(subject, query?.tenant ?? subject.principal?.tenant, scopeList(snapshot.scopes), compact({
|
|
26
|
+
scope: query?.scope,
|
|
27
|
+
id: query?.id,
|
|
28
|
+
rank: snapshot.roles
|
|
29
|
+
}));
|
|
30
|
+
const tree = snapshot.vocabulary?.roles;
|
|
31
|
+
return names.map((name) => findRole(tree, name) ?? synthesiseRole(name));
|
|
32
|
+
},
|
|
33
|
+
audiences() {
|
|
34
|
+
const tenant = subject.principal?.tenant;
|
|
35
|
+
if (tenant === snapshot.subject.principal?.tenant) return snapshot.audiences ?? [];
|
|
36
|
+
const tree = snapshot.vocabulary?.roles;
|
|
37
|
+
const out = [];
|
|
38
|
+
for (const name of heldRoleNames(subject, tenant, scopeList(snapshot.scopes), { rank: snapshot.roles })) {
|
|
39
|
+
const audience = findRole(tree, name)?.meta.audience;
|
|
40
|
+
if (typeof audience === "string" && !out.includes(audience)) out.push(audience);
|
|
41
|
+
}
|
|
42
|
+
return out;
|
|
43
|
+
},
|
|
44
|
+
assignableRoles(query) {
|
|
45
|
+
if (query?.scope === "global") return [];
|
|
46
|
+
const tenant = query?.tenant ?? subject.principal?.tenant;
|
|
47
|
+
const tree = snapshot.vocabulary?.roles;
|
|
48
|
+
if (snapshot.assignable !== void 0) return (assignableEntry(snapshot, tenant)?.roles ?? []).map((name) => findRole(tree, name) ?? synthesiseRole(name, { assignable: true }));
|
|
49
|
+
const names = new Set(heldRoleNames(subject, tenant, scopeList(snapshot.scopes)));
|
|
50
|
+
return listRoles(tree).filter((leaf) => leaf.assignable && names.has(leaf.key));
|
|
51
|
+
},
|
|
52
|
+
assignablePermissions(query) {
|
|
53
|
+
if (query?.scope === "global") return [];
|
|
54
|
+
return assignableEntry(snapshot, query?.tenant ?? subject.principal?.tenant)?.permissions ?? [];
|
|
55
|
+
},
|
|
56
|
+
assignableLevels(permission, query) {
|
|
57
|
+
if (query?.scope === "global") return [];
|
|
58
|
+
const levels = assignableEntry(snapshot, query?.tenant ?? subject.principal?.tenant)?.levels;
|
|
59
|
+
if (levels === void 0 || !Object.hasOwn(levels, permission.key)) return [];
|
|
60
|
+
const names = levels[permission.key];
|
|
61
|
+
return Array.isArray(names) ? names.filter((name) => typeof name === "string") : [];
|
|
62
|
+
}
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
//#endregion
|
|
66
|
+
export { snapshotReads as t };
|
package/dist/solid/index.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { Jn as ApprovalRequiredDecision, N as PolicyVocabulary, Yn as Decision, en as Snapshot, tr as GrantedDecision, vr as Membership, vt as TokenVerifier } from "../policy-types-
|
|
1
|
+
import { Jn as ApprovalRequiredDecision, N as PolicyVocabulary, Yn as Decision, en as Snapshot, tr as GrantedDecision, vr as Membership, vt as TokenVerifier } from "../policy-types-CCBrL7me.js";
|
|
2
2
|
import { r as Role, w as Permission } from "../vocabulary-DeZvUaTw.js";
|
|
3
|
-
import { d as UncheckedData, s as RowData } from "../permdock-
|
|
4
|
-
import { c as requiredPlans } from "../errors-
|
|
5
|
-
import { i as describe, r as DescribeOptions, t as DecisionDescription } from "../describe-
|
|
3
|
+
import { d as UncheckedData, s as RowData } from "../permdock-vD3mwLSm.js";
|
|
4
|
+
import { c as requiredPlans } from "../errors-CXxQwtbZ.js";
|
|
5
|
+
import { i as describe, r as DescribeOptions, t as DecisionDescription } from "../describe-CazEjtOH.js";
|
|
6
6
|
import { t as PermissionBoundaryState } from "../boundary-C9ck-3uK.js";
|
|
7
|
-
import { _ as
|
|
7
|
+
import { _ as SubjectView, a as ClientPermDock, b as ProtectedAction, c as GateMode, d as PermissionSet, f as PermissionState, g as RolesOptions, h as ProviderOptionsBase, i as ApprovalState, l as GateView, m as ProtectedActionView, o as ClientStatus, r as ApprovalHandle, s as FilterResult, v as TenantView, y as ActionResult } from "../store-core-CDabEiO9.js";
|
|
8
8
|
import { a as broadcastChannelRefresh, c as visibilityRefresh, i as authzChangeRefresh, n as EventSourceRefreshOptions, o as eventSourceRefresh, r as RefreshTrigger, s as focusRefresh, t as AuthzChangeRefresh } from "../refresh-on-L9UOwATg.js";
|
|
9
9
|
import { t as approvalHeaders } from "../headers-B9jQxjtW.js";
|
|
10
10
|
import { Accessor, Accessor as Accessor$1, JSX } from "solid-js";
|
package/dist/solid/index.js
CHANGED
|
@@ -4,8 +4,8 @@ import { n as describe } from "../describe-BZAlPHxT.js";
|
|
|
4
4
|
import { n as boundaryFallback, t as boundaryDigest } from "../boundary-BV3O1eud.js";
|
|
5
5
|
import { n as actionRunner, r as approvalHeaders, t as actionApproval } from "../protected-action-OpOxtTsN.js";
|
|
6
6
|
import { a as livePermDock, c as rolesView, d as subjectView, f as tenantView, i as gateView, l as scopedTenant, n as describeWith, o as permissionSet, r as filterResult, s as protectedView, t as approvalHandle, u as slotContent } from "../views-MWmJ6Y4P.js";
|
|
7
|
-
import { a as eventSourceRefresh, i as broadcastChannelRefresh, l as isPromiseLike, o as focusRefresh, r as authzChangeRefresh, s as visibilityRefresh } from "../store-options-
|
|
8
|
-
import { n as switchTenant, t as providerStore } from "../provider-store-
|
|
7
|
+
import { a as eventSourceRefresh, i as broadcastChannelRefresh, l as isPromiseLike, o as focusRefresh, r as authzChangeRefresh, s as visibilityRefresh } from "../store-options-COLWAd1K.js";
|
|
8
|
+
import { n as switchTenant, t as providerStore } from "../provider-store-BLd4UEmg.js";
|
|
9
9
|
import { ErrorBoundary, createComponent, createComputed, createContext, createMemo, createSignal, getOwner, on, onCleanup, useContext } from "solid-js";
|
|
10
10
|
//#region src/solid/context.ts
|
|
11
11
|
const PermDockContext = createContext(void 0);
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { D as Policy, N as PolicyVocabulary, en as Snapshot, yr as Principal } from "../policy-types-
|
|
1
|
+
import { D as Policy, N as PolicyVocabulary, en as Snapshot, yr as Principal } from "../policy-types-CCBrL7me.js";
|
|
2
2
|
import { w as Permission } from "../vocabulary-DeZvUaTw.js";
|
|
3
3
|
import { a as OperationInput, t as Operation } from "../operations-BMPx7HyO.js";
|
|
4
|
-
import { a as PermDock } from "../permdock-
|
|
5
|
-
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
|
|
6
|
-
import { a as ProtectTarget, n as FetchAdapterOptions, t as ContextReader } from "../fetch-adapter-
|
|
4
|
+
import { a as PermDock } from "../permdock-vD3mwLSm.js";
|
|
5
|
+
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-CtJSDhOv.js";
|
|
6
|
+
import { a as ProtectTarget, n as FetchAdapterOptions, t as ContextReader } from "../fetch-adapter-eQ-mdk8n.js";
|
|
7
7
|
import { APIEvent, FetchEvent } from "@solidjs/start/server";
|
|
8
8
|
//#region src/solid-start/create.d.ts
|
|
9
9
|
/** The h3 event under every SolidStart request; `subject` and `scope` read it. */
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { f as InvalidSignatureError, g as webBotAuthVerifier, p as discoverViaSignatureAgent } from "../evaluations-
|
|
2
|
-
import { i as decorate } from "../bind-
|
|
3
|
-
import { n as guardedRoute, t as fetchAdapter } from "../fetch-adapter-
|
|
1
|
+
import { f as InvalidSignatureError, g as webBotAuthVerifier, p as discoverViaSignatureAgent } from "../evaluations-Bj5xw0EM.js";
|
|
2
|
+
import { i as decorate } from "../bind-Cx10JuJ-.js";
|
|
3
|
+
import { n as guardedRoute, t as fetchAdapter } from "../fetch-adapter-CAA3VJMX.js";
|
|
4
4
|
//#region src/solid-start/create.ts
|
|
5
5
|
/**
|
|
6
6
|
* `event.locals`. Its type, `App.RequestEventLocals`, is declared by
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { it as MembershipSource, sn as AuthEvent, yr as Principal } from "./policy-types-
|
|
1
|
+
import { it as MembershipSource, sn as AuthEvent, yr as Principal } from "./policy-types-CCBrL7me.js";
|
|
2
2
|
import { t as ClaimsMap } from "./claims-map-D1Pb5oRq.js";
|
|
3
3
|
import { t as ClientNames } from "./clients-C_NOET3z.js";
|
|
4
|
-
import { c as SupabaseManifestMembership } from "./manifest-
|
|
4
|
+
import { c as SupabaseManifestMembership } from "./manifest-C6eFl3Vo.js";
|
|
5
5
|
import { t as SqlQuery } from "./sql-B80DFdpG.js";
|
|
6
6
|
import { StandardSchemaV1 } from "@standard-schema/spec";
|
|
7
7
|
//#region src/supabase/claims.d.ts
|