permdock 0.20.1 → 0.22.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/README.md +2 -1
- package/dist/a2a/index.d.ts +5 -5
- package/dist/a2a/index.js +5 -4
- package/dist/{adoption-scan-BTG9Noyy.js → adoption-scan-_bHLMnVQ.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 +4 -4
- package/dist/ai-sdk/index.js +3 -3
- package/dist/app/index.d.ts +85 -0
- package/dist/app/index.js +91 -0
- package/dist/app-DIvM65Mv.js +24 -0
- package/dist/{approval-policies-CKlByf5o.d.ts → approval-policies-UnDSxT__.d.ts} +2 -2
- package/dist/{approval-prompt-CQFiO1KE.d.ts → approval-prompt-2hTqo6IM.d.ts} +2 -2
- package/dist/approvals/index.d.ts +3 -3
- package/dist/approvals/index.js +3 -3
- package/dist/{approvals-CuXILe52.js → approvals-B_sn4Wrn.js} +6 -6
- package/dist/{arazzo-CDXfX4u0.js → arazzo-BXD-VJU_.js} +1 -1
- package/dist/{arazzo-D4mKdaWI.js → arazzo-Ct0PGblq.js} +3 -3
- package/dist/astro/index.d.ts +6 -6
- package/dist/astro/index.js +2 -2
- package/dist/{audience-BUonniPx.js → audience-5Xx1hdIv.js} +1 -1
- package/dist/{auth-j3Eu-j4h.js → auth-BxXHxWRy.js} +1 -1
- package/dist/authzen/index.d.ts +5 -5
- package/dist/authzen/index.js +4 -4
- package/dist/{automation-CpOk7Tlu.d.ts → automation-B20_8UoT.d.ts} +3 -3
- package/dist/{automation-x3KEUusw.js → automation-BueW05db.js} +2 -2
- package/dist/better-auth/index.d.ts +2 -2
- package/dist/better-auth/index.js +1 -1
- package/dist/better-supabase/index.d.ts +113 -56
- package/dist/better-supabase/index.js +200 -62
- package/dist/better-supabase-DF8f8oly.js +194 -0
- package/dist/{bind-gwEbe9hL.js → bind-B4Z0U2Gr.js} +5 -5
- package/dist/{bind-CW7nsZ86.d.ts → bind-CnOMjazH.d.ts} +7 -7
- package/dist/{build-instance-DaBdCRiz.js → build-instance-B0vsViF5.js} +3 -25
- package/dist/{capability-zN6T9fxe.js → capability-CenWwTMR.js} +1 -1
- package/dist/{capability-v2xZB7us.d.ts → capability-YkRMUAsF.d.ts} +2 -2
- package/dist/{casbin-COUi09Ti.js → casbin-D5evU3lX.js} +1 -1
- package/dist/{casbin-BXlRcCdU.js → casbin-imBS3UIf.js} +1 -1
- package/dist/catalog/index.d.ts +5 -5
- package/dist/catalog/index.js +5 -5
- package/dist/catalog-C462QC3A.js +1 -0
- package/dist/{catalog-DjDc87R2.js → catalog-CoyKnU5c.js} +1 -1
- package/dist/{catalog-s0waIrfY.js → catalog-Y4CjN8NA.js} +4 -4
- package/dist/{catalog-operations-BD22drQf.js → catalog-operations-Do1eD-Rt.js} +1 -1
- package/dist/{challenge-DbkpCx_v.js → challenge-B__LcNve.js} +3 -3
- package/dist/chat/index.d.ts +1 -1
- package/dist/chat/index.js +3 -2
- package/dist/chat-sdk/index.d.ts +3 -3
- package/dist/claude-agent/index.d.ts +3 -3
- package/dist/claude-agent/index.js +2 -2
- package/dist/clerk/index.d.ts +3 -3
- package/dist/cli/bin.js +1 -1
- package/dist/cli/index.d.ts +8 -7
- package/dist/cli/index.js +3 -3
- package/dist/cloud/index.d.ts +8 -8
- package/dist/cloud/index.js +3 -3
- package/dist/{cloud-BW7JKfrF.js → cloud-DWCeStPH.js} +2 -2
- package/dist/{codemod-6CBQaT0x.js → codemod-B7QKJ_ak.js} +2 -2
- package/dist/{codemod-CR9EQBVd.js → codemod-BaPmaCYQ.js} +13 -6
- package/dist/{collect-DN_x7hvV.js → collect-Cr71JA7z.js} +8 -7
- package/dist/{collect-DMQ6Sxr6.js → collect-ScSG05VJ.js} +2 -2
- package/dist/collect-W9i7REKT.js +1 -0
- package/dist/compile/index.d.ts +1 -1
- package/dist/compile/index.js +1 -1
- package/dist/{compile-B_oJqmIg.js → compile-Cvru58id.js} +2 -2
- package/dist/{compile-DZftFfXc.d.ts → compile-DC-BrhH1.d.ts} +3 -3
- package/dist/{completion-CYRlOJzv.js → completion-DOUMyCwa.js} +1 -1
- package/dist/{delegation-aK4T_5WU.js → condition-evaluate-bVVRSdzq.js} +159 -159
- package/dist/{config-6iLK155o.js → config-DRp-E8Ly.js} +1 -1
- package/dist/{config-D2oXUwos.js → config-DyNanTjZ.js} +10 -8
- package/dist/{config-report-BLroaWCe.js → config-report-Bh_nLdAE.js} +2 -2
- package/dist/{config-shape-D9paLhEX.js → config-shape-C4zqzG2K.js} +9 -2
- package/dist/{context-YhyXyqBI.js → context-Cem4QafV.js} +2 -2
- package/dist/convex/index.d.ts +5 -5
- package/dist/convex/index.js +2 -2
- package/dist/{core-BwVkrpsi.js → core-CUjhfz0W.js} +6 -6
- package/dist/{core-BOeGWbcR.d.ts → core-D2JNg5jA.d.ts} +3 -3
- package/dist/coverage-D8jBJdgD.d.ts +114 -0
- package/dist/coverage-Dh2W_DmF.js +211 -0
- package/dist/{create-BezeYFcT.d.ts → create-B2tdOygC.d.ts} +7 -7
- package/dist/{create-C0R8omeF.js → create-BJ2_8NDO.js} +5 -5
- package/dist/{create-DDUFG1ul.js → create-BsL5lCWR.js} +10 -8
- package/dist/{create-DYSYYiLr.d.ts → create-CPDSbK1a.d.ts} +5 -5
- package/dist/{create-DMCC5ZOi.d.ts → create-oMCcZV4X.d.ts} +9 -9
- package/dist/{credential-B3Hj4puZ.js → credential-Bap3HClV.js} +4 -4
- package/dist/{server-D0PW6ZCw.js → credentials-BXV0oz56.js} +3 -146
- package/dist/credentials-DPX140fN.d.ts +125 -0
- package/dist/delivery/index.d.ts +4 -4
- package/dist/delivery/index.js +1 -1
- package/dist/{denied-text-De8cw3MW.d.ts → denied-text-BXQkWU7d.d.ts} +2 -2
- package/dist/{describe-DibQM6g-.d.ts → describe-DVobr5FX.d.ts} +2 -2
- package/dist/{diff-Bd1-VCe5.js → diff-BR9JArxz.js} +6 -6
- package/dist/{diff-DXRNcjpg.js → diff-Jc_kbDz-.js} +1 -1
- package/dist/{doctor-CJcS0Mrq.js → doctor-BBMW5ZT_.js} +310 -36
- package/dist/{doctor-DYTgibLC.js → doctor-DhqSiPkq.js} +3 -3
- package/dist/drizzle/index.d.ts +3 -3
- package/dist/drizzle/index.js +1 -1
- package/dist/elysia/index.d.ts +5 -5
- package/dist/elysia/index.js +3 -3
- package/dist/{errors-OTE9u4Wk.d.ts → errors-D_JIQJYb.d.ts} +1 -1
- package/dist/{evaluate-Dcq_U2TV.js → evaluate-B5yZHmts.js} +16 -16
- package/dist/{evaluations-CNMVJVD6.js → evaluations-BzTDWO4m.js} +57 -57
- package/dist/{evaluations-BgxEfPL7.d.ts → evaluations-DQYfh4Jh.d.ts} +3 -3
- package/dist/eve/index.d.ts +5 -5
- package/dist/eve/index.js +3 -3
- package/dist/express/index.d.ts +5 -5
- package/dist/express/index.js +3 -3
- package/dist/fastify/index.d.ts +5 -5
- package/dist/fastify/index.js +3 -3
- package/dist/{fetch-adapter-DCQ4pZxf.d.ts → fetch-adapter-DxqsIXSO.d.ts} +4 -4
- package/dist/{fetch-adapter-acq4dPX3.js → fetch-adapter-MoYZ-vF5.js} +5 -4
- package/dist/{fields-D_TfExiI.js → fields-CVyOk-f1.js} +2 -2
- package/dist/{fixtures-Cemqurt8.js → fixtures-BVZc7OCF.js} +1 -1
- package/dist/{from-snapshot-DHnb8Fh4.js → from-snapshot-oR_N97dM.js} +346 -14
- package/dist/{gen-gv_WHBIG.js → gen-DXXoFjyf.js} +1 -1
- package/dist/{gen-CH50v9VI.js → gen-WdycZ_-b.js} +5 -5
- package/dist/{grantee-conditions-DX4K_gGI.js → grantee-conditions-Dzprappv.js} +1 -1
- package/dist/{grantee-match-BP-k4vRJ.js → grantee-match-8J2y60MF.js} +3 -3
- package/dist/h3/index.d.ts +4 -4
- package/dist/h3/index.js +3 -3
- package/dist/{helpers-D-MXwkOF.js → helpers-DzBIfL1N.js} +25 -25
- package/dist/hono/index.d.ts +5 -5
- package/dist/hono/index.js +3 -3
- package/dist/{hosted-C2Pmhy2x.js → hosted-C5I2TSXm.js} +4 -4
- package/dist/{hosted-yhyAuQkL.d.ts → hosted-DXq1plaP.d.ts} +1 -1
- package/dist/{http-DhMWeB_h.js → http-dptLQzPP.js} +1 -1
- package/dist/{expiry-6XByK0dm.js → ids-DzhJaCUj.js} +23 -23
- package/dist/{import-BlwuuZkr.js → import-BE5sDazm.js} +2 -2
- package/dist/{import-C2ExjVvv.js → import-CvXswHDy.js} +2 -2
- package/dist/index-BcS8c_2S.d.ts +101 -0
- package/dist/{index--AwSBzJC.d.ts → index-BdZpqhJK.d.ts} +2 -2
- package/dist/{index-CLbGOPBr.d.ts → index-C-R8lBPb.d.ts} +3 -3
- package/dist/{index-CruReRkB.d.ts → index-C_8uxAlv.d.ts} +5 -5
- package/dist/{index-D7xGi1LS.d.ts → index-Cjfa1Uwr.d.ts} +22 -40
- package/dist/{index-Bt37QovT.d.ts → index-iIsqXFVu.d.ts} +6 -6
- package/dist/index.d.ts +19 -20
- package/dist/index.js +25 -24
- package/dist/{init-CalppFAI.js → init-B_S8Xdz1.js} +4 -4
- package/dist/{init-B62H9Kyx.js → init-CqGHcvyR.js} +2 -2
- package/dist/{instance-options-VPsNQsTH.d.ts → instance-options-C6gEDOts.d.ts} +1 -1
- package/dist/instance-options-URVwqpMW.js +24 -0
- package/dist/{instance-snapshot-SX8zH_1t.js → instance-snapshot-D_dGTq--.js} +10 -10
- package/dist/jwt/index.d.ts +4 -4
- package/dist/jwt/index.js +2 -2
- package/dist/{kernel-_QEUOSU0.js → kernel-NmxiWII2.js} +8 -8
- package/dist/kysely/index.d.ts +3 -3
- package/dist/kysely/index.js +1 -1
- package/dist/limits-CAhpRrhk.js +167 -0
- package/dist/{load-BaEamml-.js → load-C4p4VgwR.js} +2 -2
- package/dist/load-DiBUJx77.js +1 -0
- package/dist/{login-dDb_8muO.js → login-CzwlsBEO.js} +4 -4
- package/dist/{login-MxQV1BLh.js → login-DoLxv1s5.js} +3 -3
- package/dist/{manifest-DvDzxhy6.js → manifest-BAf7cgRx.js} +35 -35
- package/dist/{map-claims-PQwHynxV.js → map-claims-CAa_bQt9.js} +1 -1
- package/dist/{map-error-EOhahOVA.js → map-error-p4ROJ_26.js} +1 -1
- package/dist/mcp/index.d.ts +9 -9
- package/dist/mcp/index.js +9 -8
- package/dist/{migrate-CkLHdwuH.js → migrate-DVsxeE0y.js} +1 -1
- package/dist/{module-values-BYuNtdK5.js → module-values-BLiVlO1X.js} +3 -3
- package/dist/nest/index.d.ts +5 -5
- package/dist/nest/index.js +3 -3
- package/dist/next/index.d.ts +46 -17
- package/dist/next/index.js +58 -23
- package/dist/next/plugin.d.ts +1 -1
- package/dist/next/plugin.js +1 -1
- package/dist/node/index.d.ts +5 -5
- package/dist/node/index.js +2 -2
- package/dist/openai/index.d.ts +5 -5
- package/dist/openai/index.js +3 -3
- package/dist/openapi/index.d.ts +5 -59
- package/dist/openapi/index.js +3 -2
- package/dist/{openapi-BOsx0xn9.js → openapi-Cc-aS9xC.js} +6 -135
- package/dist/{openapi-BkGtE5kX.js → openapi-DroBcLJZ.js} +2 -2
- package/dist/{openapi-DKePsnln.js → openapi-EmvKwuWj.js} +4 -4
- package/dist/{operations-Ci_rT6Uo.d.ts → operations-BMPx7HyO.d.ts} +1 -1
- package/dist/optional-8TKc-0j4.js +47 -0
- package/dist/orpc/index.d.ts +7 -7
- package/dist/orpc/index.js +4 -4
- package/dist/otel/index.d.ts +3 -3
- package/dist/otel/index.js +1 -1
- package/dist/{output-B2h-2g3F.js → output-CYgfpT6o.js} +1 -1
- package/dist/{ownership-MGHa5vfX.js → ownership-adPAsUwY.js} +15 -13
- package/dist/{parse-CXTT7hBq.js → parse-CORUNcCo.js} +1 -1
- package/dist/{parse-local-manifest-CE4tgFsj.d.ts → parse-local-manifest-BaCqsqwC.d.ts} +1 -1
- package/dist/pdp/index.d.ts +3 -3
- package/dist/pdp/index.js +4 -3
- package/dist/{permdock-C1DN_7a-.js → permdock-B5LyNVgn.js} +71 -34
- package/dist/{permdock-D4F2p5J8.d.ts → permdock-BaB-KQqn.d.ts} +51 -9
- package/dist/{permissions-8N2yFsUM.js → permissions-COpRGKt7.js} +1 -1
- package/dist/{permissions-Bx6UI8n1.d.ts → permissions-DriWkV7q.d.ts} +1 -2
- package/dist/{policy-from-catalog-CUNlpgz0.js → policy-from-catalog-Cy103lsm.js} +8 -8
- package/dist/{policy-types-BI9C5Sp5.d.ts → policy-types-rNfz7t0M.d.ts} +9 -3
- package/dist/{policy-CaAME-Rh.js → policy-wGzbAPQF.js} +7 -7
- package/dist/{policy-Dh9WVSVz.d.ts → policy-x8RBKW8d.d.ts} +2 -2
- package/dist/{postgrest-CWCCbaxm.d.ts → postgrest-Cn0Res25.d.ts} +9 -21
- package/dist/powersync-BdoR7nwS.js +1 -0
- package/dist/{powersync-Deim9O47.js → powersync-BeI0VmEK.js} +2 -2
- package/dist/{powersync-CB8RwcB4.js → powersync-Dpa5AnnN.js} +11 -11
- package/dist/preset/index.js +1 -1
- package/dist/{preset-pPrVyGU5.js → preset-Bn5Z54cH.js} +5 -6
- package/dist/prisma/index.d.ts +2 -2
- package/dist/prisma/index.js +1 -1
- package/dist/{protected-action-ua0cx5cW.d.ts → protected-action-C4aj1KjO.d.ts} +6 -7
- package/dist/{protected-action-CD1HXwQK.js → protected-action-E7Sdt_Dt.js} +1 -1
- package/dist/{provider-D_hgjZRa.d.ts → provider-B-1DlOGM.d.ts} +1 -1
- package/dist/{provider-qESIf_C0.js → provider-DKO9KHua.js} +2 -2
- package/dist/{provider-store-BTHGJH9j.js → provider-store-D4PU1my_.js} +2 -2
- package/dist/{pull-BxqVL4Es.js → pull-3tkn25ll.js} +5 -5
- package/dist/pull-D90HqWNP.js +1 -0
- package/dist/{push-D2SsRW0U.js → push-dMyKdlEm.js} +6 -6
- package/dist/{pushed-policy-BERO0x9O.js → pushed-policy-Bi5-il4C.js} +2 -2
- package/dist/{pushed-policy-P0hgyLBh.d.ts → pushed-policy-P55cJNx5.d.ts} +1 -1
- package/dist/react/index.d.ts +6 -6
- package/dist/react/index.js +3 -3
- package/dist/react/provider-client.d.ts +1 -1
- package/dist/react/provider-client.js +1 -1
- package/dist/react-native/index.d.ts +9 -9
- package/dist/react-native/index.js +7 -7
- package/dist/{relation-walk-DK_gkgL7.js → relation-walk-BDTaTKTM.js} +1 -1
- package/dist/{relations-BxvRvDHK.js → relations-CMsJ1ARY.js} +1 -1
- package/dist/{replay-DYXI4gRN.d.ts → replay-DKhFvt0L.d.ts} +1 -1
- package/dist/{request-context-BPTi68z5.js → request-context-5gl_oxO1.js} +2 -2
- package/dist/resend/index.d.ts +4 -4
- package/dist/resend/index.js +2 -2
- package/dist/{resolve-names-BZQZRnMH.js → resolve-names-BnGJU88N.js} +4 -4
- package/dist/{rls-DpoJ5gCg.js → rls-DIYSRnDZ.js} +1 -1
- package/dist/{rls-OPorg_2G.js → rls-qrehUPf_.js} +45 -18
- package/dist/{role-builder-C5AgaC1x.js → role-builder-boQiUvfo.js} +3 -3
- package/dist/{rpc-D2LnFELm.d.ts → rpc-BqRiVpbP.d.ts} +2 -2
- package/dist/{rpc-DdkbQVlT.js → rpc-Dhi55Whd.js} +2 -2
- package/dist/run-elFdnSZx.js +1 -0
- package/dist/{run-YCpANf1B.js → run-oNqBe0gc.js} +3 -3
- package/dist/{run-ticket-CjvXr6wj.js → run-ticket-Ddxt9OuU.js} +2 -2
- package/dist/{run-ticket-94DOS9Cd.d.ts → run-ticket-Dulj4RQk.d.ts} +2 -2
- package/dist/{saas-BEXnrH9H.js → saas-DABv6vjy.js} +6 -5
- package/dist/{scan-COvn7ZjN.js → scan-BYXqcgON.js} +1 -1
- package/dist/{schema-BfSDo7Xj.js → schema-Wf-SvlHG.js} +1 -1
- package/dist/scim/index.d.ts +1 -1
- package/dist/scim/index.js +1 -1
- package/dist/{scopes-BSdYaGHs.js → scopes-gdH__vDZ.js} +1 -1
- package/dist/server/index.d.ts +11 -10
- package/dist/server/index.js +7 -6
- package/dist/server-CKjFooaJ.js +147 -0
- package/dist/{server-types-ChzXWU4Y.d.ts → server-types--_Hann81.d.ts} +10 -9
- package/dist/{shared-sW3VYchq.js → shared-DfaIWvIJ.js} +11 -2
- package/dist/{sink-RwmP7ZHs.d.ts → sink-Cs6z34AX.d.ts} +4 -4
- package/dist/{skills-N2Hd8KN8.js → skills-417bOj4o.js} +1 -1
- package/dist/{skills-Ce4C2dq1.js → skills-B9U465B7.js} +2 -2
- package/dist/{snapshot-DHPih65J.js → snapshot-C2j96x97.js} +4 -4
- package/dist/{snapshot-cache-MPinwwgZ.d.ts → snapshot-cache-Cc7VNabe.d.ts} +1 -1
- package/dist/solid/index.d.ts +6 -7
- package/dist/solid/index.js +2 -2
- package/dist/solid-start/index.d.ts +6 -6
- package/dist/solid-start/index.js +3 -3
- package/dist/{sources-sgQlMfmz.d.ts → sources-BfTza0zT.d.ts} +1 -1
- package/dist/{src-B8SQNsvw.js → src-BG9YJM3Q.js} +97 -247
- package/dist/ssf/index.d.ts +3 -3
- package/dist/ssf/index.js +3 -3
- package/dist/{standard-webhooks-CFZIYtBF.d.ts → standard-webhooks-CJBgfl7y.d.ts} +2 -2
- package/dist/{store-CSOsXd5s.js → store-BpKH-pLm.js} +2 -2
- package/dist/{store-Dpg_fSNQ.d.ts → store-DSyjHD5-.d.ts} +5 -5
- package/dist/{store-options-CDvoX52-.js → store-options-CXv6BHH6.js} +5 -6
- package/dist/{stores-PpYVQ5yF.js → stores-BuqAHjp_.js} +1 -1
- package/dist/{stores-C2A6KsxE.d.ts → stores-C6-7TPTV.d.ts} +6 -7
- package/dist/{postgrest-BrjrckDG.js → subject-BqFwS6l3.js} +214 -319
- package/dist/subject-cache-BT1fGuea.js +193 -0
- package/dist/subject-cache-d_Z4KAnm.d.ts +144 -0
- package/dist/supabase/index.d.ts +6 -5
- package/dist/supabase/index.js +3 -2
- package/dist/supabase/middleware.d.ts +6 -6
- package/dist/supabase/middleware.js +6 -6
- package/dist/{supabase-zL7PC3RG.js → supabase-D0J99yqL.js} +2 -2
- package/dist/{supabase-CVZuytCC.js → supabase-DnazO6W4.js} +3 -3
- package/dist/{supabase-hook-BCSwK5x-.js → supabase-hook-Bh5syR9N.js} +174 -62
- package/dist/supabase-hook-CVAenq-w.js +1 -0
- package/dist/{supautils-7UES0i4a.js → supautils-ChXR-4Or.js} +302 -43
- package/dist/{support-session-BsmPCbz8.js → support-session-BGeEYDSq.js} +2 -2
- 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 +6 -6
- package/dist/sveltekit/index.js +2 -2
- package/dist/{tables-DSX_Ma_n.js → tables-CbEOy2Ma.js} +137 -55
- package/dist/tanstack-start/index.d.ts +6 -6
- package/dist/tanstack-start/index.js +2 -2
- package/dist/{tenancy-DvOHHk3-.js → tenancy-BlxY5T0q.js} +2 -2
- package/dist/terminal/index.d.ts +6 -6
- package/dist/terminal/index.js +6 -6
- package/dist/testing/core.d.ts +1 -1
- package/dist/testing/core.js +1 -1
- package/dist/testing/fixtures/index.d.ts +35 -2
- package/dist/testing/fixtures/index.js +39 -2
- package/dist/testing/index.d.ts +41 -25
- package/dist/testing/index.js +114 -26
- package/dist/testing/saas/index.d.ts +5 -5
- package/dist/testing/saas/index.js +2 -2
- package/dist/testing/saas/permissions.d.ts +1 -1
- package/dist/testing/saas/permissions.js +1 -1
- package/dist/trpc/index.d.ts +6 -6
- package/dist/trpc/index.js +4 -4
- package/dist/{type-helpers-BjOLGVy1.d.ts → type-helpers-iXJEIDe7.d.ts} +3 -4
- package/dist/{types-p8mhWTcR.d.ts → types-B9F0EZAF.d.ts} +3 -3
- package/dist/{types-DZwEOsK1.d.ts → types-BSNZMp5b.d.ts} +1 -1
- package/dist/{types-DnzRZjEu.d.ts → types-BpxdxaRD.d.ts} +5 -5
- package/dist/{types-C5p2hoBR.d.ts → types-CD1qmxdx.d.ts} +4 -4
- package/dist/{types-D1NjjwI4.d.ts → types-CS1DI_Ke.d.ts} +40 -9
- package/dist/{types-CMclYgSk.d.ts → types-C_a44wSr.d.ts} +3 -3
- package/dist/{types-DBVSljAx.d.ts → types-Cq2rvv-C.d.ts} +3 -3
- package/dist/{types--_lpWUGV.d.ts → types-CuDXvyIT.d.ts} +5 -5
- package/dist/{types-7Vlz1Wi2.d.ts → types-DAyp592k.d.ts} +2 -2
- package/dist/{types-Drs3OOAy.d.ts → types-NikV1pND.d.ts} +4 -4
- package/dist/{types-BzxA2OAD.d.ts → types-ZfjQB0KC.d.ts} +2 -2
- package/dist/{types-D8JVDWOr.d.ts → types-_pi9kxS2.d.ts} +2 -2
- package/dist/unplugin/index.d.ts +1 -1
- package/dist/unplugin/index.js +1 -1
- package/dist/{usage-CUnw73Y-.js → usage-0wsl83uw.js} +10 -10
- package/dist/{usage-BcAqmjkj.js → usage-Bl-BkXEq.js} +1 -1
- package/dist/usage-CmyGbo4e.js +1 -0
- package/dist/{validation-error-DkOK9zUE.d.ts → validation-error-DLAYFlkr.d.ts} +1 -1
- package/dist/{verify-V08pirDB.js → verify-BSLotSa0.js} +41 -24
- package/dist/version-sources-BC3hf2ME.js +34 -0
- package/dist/{permission-types-CAY-GU7e.d.ts → vocabulary-DeZvUaTw.d.ts} +69 -1
- package/dist/vue/index.d.ts +6 -7
- package/dist/vue/index.js +2 -2
- package/dist/{waiter-BjVI_Byg.d.ts → waiter-cbK1CBhT.d.ts} +2 -2
- package/dist/{watch-Dz2LNM1R.js → watch-BigZ260i.js} +2 -2
- package/dist/watch-CHURMgrv.js +1 -0
- package/dist/webmcp/index.d.ts +2 -2
- package/dist/{who-can-CZeAwQZD.js → who-can-CjfMP9a4.js} +8 -8
- package/dist/workflow/index.d.ts +3 -3
- package/dist/workflow/index.js +6 -5
- package/dist/workflow-sdk/index.d.ts +5 -5
- package/dist/{wrap-CE5lxje7.d.ts → wrap-B-k2qHJx.d.ts} +2 -2
- package/package.json +16 -4
- package/skills/permdock-wire/references/presets-and-recipes.md +2 -2
- package/dist/better-supabase-ayun1IKE.js +0 -122
- package/dist/catalog-BTPySmbp.js +0 -1
- package/dist/collect-eSTXOZDC.js +0 -1
- package/dist/index-B_I6N8Ju.d.ts +0 -222
- package/dist/load-CjnlPxpL.js +0 -1
- package/dist/powersync-Cs1E04s6.js +0 -1
- package/dist/pull-BLT25Y5C.js +0 -1
- package/dist/run-CW0QsyA9.js +0 -1
- package/dist/supabase-hook-7XxWGHQF.js +0 -1
- package/dist/usage-BdIS9NfN.js +0 -1
- package/dist/version-cache-q5cpaDSt.d.ts +0 -57
- package/dist/vocabulary-DEJ5j4mR.d.ts +0 -70
- package/dist/watch-CS69ftMP.js +0 -1
- package/dist/where-scope-BAyOsPQW.js +0 -332
- package/dist/{approval-normalize-hlfO9BJv.js → approval-normalize-DNLW0zOM.js} +1 -1
- package/dist/{body-C9JbIoqb.js → body-B3ylkmmE.js} +1 -1
- package/dist/{catalog-doc-nrgfbh8I.js → catalog-doc-Zi0jRpyH.js} +2 -2
- package/dist/{device-BwbJNmb2.js → device-BkSynWdg.js} +1 -1
- package/dist/{prompt-BYc6drYW.js → prompt-D1Gj1W4Y.js} +1 -1
- package/dist/{scim-C30QBBoF.js → scim-BG6uPUeW.js} +1 -1
- package/dist/{wrap-C5PWzgkq.js → wrap-BKU5Arsu.js} +1 -1
|
@@ -1,40 +1,43 @@
|
|
|
1
1
|
import { r as isRecord, t as compact } from "../compact-CAf557ZB.js";
|
|
2
2
|
import { n as freezeDeep } from "../freeze-jjan0lCv.js";
|
|
3
3
|
import { a as flattenApprovers, i as approverManagerKey, o as holder, r as approverLeaves } from "../approvers-BaNwKYgd.js";
|
|
4
|
+
import { a as permissionStates } from "../checks-fyDOhcz0.js";
|
|
4
5
|
import { t as loadPrincipal } from "../principal-source-C6N60GtM.js";
|
|
5
|
-
import { a as isId, r as idList } from "../expiry-6XByK0dm.js";
|
|
6
6
|
import { c as listPermissions, n as findPermission, o as isPermission } from "../permission-registry-B8tYxPIt.js";
|
|
7
|
+
import { o as flattenGrantee } from "../grantee-Dke-9rd1.js";
|
|
7
8
|
import { i as dateAt, m as rfc3339, p as nowSeconds, u as isoAt } from "../time-nR1JesoH.js";
|
|
9
|
+
import { r as isId, t as idList } from "../ids-DzhJaCUj.js";
|
|
10
|
+
import { d as scopeList } from "../scopes-gdH__vDZ.js";
|
|
8
11
|
import { t as canonicalJson } from "../canonical-json-DwilZ1iB.js";
|
|
9
12
|
import { r as sha256Digest } from "../sha256-C-4WXKIu.js";
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import { n as asApprover } from "../approval-normalize-hlfO9BJv.js";
|
|
13
|
+
import { a as delegatedScopeMap, s as scopesReaching } from "../permdock-B5LyNVgn.js";
|
|
14
|
+
import { t as decideSupportSession } from "../support-session-BGeEYDSq.js";
|
|
15
|
+
import { n as asApprover } from "../approval-normalize-DNLW0zOM.js";
|
|
14
16
|
import { n as isOperationEffect } from "../operations-Bm9HFecz.js";
|
|
15
17
|
import { r as isSubject, t as anonymousSubject } from "../subject-C7RddW0G.js";
|
|
16
|
-
import { I as decisionTenant } from "../evaluate-
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
18
|
+
import { I as decisionTenant } from "../evaluate-B5yZHmts.js";
|
|
19
|
+
import { n as readSubjectRecord } from "../subject-cache-BT1fGuea.js";
|
|
20
|
+
import { n as appOf } from "../app-DIvM65Mv.js";
|
|
21
|
+
import { i as linkPolicyViolation, n as capabilityOf, r as capabilitySubject } from "../capability-CenWwTMR.js";
|
|
22
|
+
import { r as credentialSubject, s as parseCredential } from "../credential-Bap3HClV.js";
|
|
20
23
|
import { s as ApprovalError } from "../types-CcUXciSj.js";
|
|
21
|
-
import { t as applyApprovalVerdict } from "../store-
|
|
22
|
-
import {
|
|
23
|
-
import {
|
|
24
|
-
import {
|
|
24
|
+
import { t as applyApprovalVerdict } from "../store-BpKH-pLm.js";
|
|
25
|
+
import { t as instanceOptions } from "../instance-options-URVwqpMW.js";
|
|
26
|
+
import { t as versionSources } from "../version-sources-BC3hf2ME.js";
|
|
27
|
+
import { t as buildInstance } from "../build-instance-B0vsViF5.js";
|
|
28
|
+
import { n as NO_GRANT } from "../decision-CaG5_eNJ.js";
|
|
29
|
+
import { n as parseApprovalHeader } from "../approval-header-8QV6MU4H.js";
|
|
30
|
+
import { h as managerKeys, s as resumeDecision } from "../helpers-DzBIfL1N.js";
|
|
25
31
|
import { t as AccessReviewError } from "../errors-BDUwg2qC.js";
|
|
26
32
|
import { t as parseApprovalRequest } from "../parse-request-DOBVaeiQ.js";
|
|
27
|
-
import { n as parseApprovalHeader } from "../approval-header-8QV6MU4H.js";
|
|
28
33
|
import { i as snapshotTag } from "../snapshot-cache-B66h7FBK.js";
|
|
29
|
-
import { t as buildInstance } from "../build-instance-DaBdCRiz.js";
|
|
30
|
-
import { n as NO_GRANT } from "../decision-CaG5_eNJ.js";
|
|
31
34
|
import { t as policyRowConditionKeys } from "../row-conditions-BAGHOmVq.js";
|
|
32
|
-
import { n as subscribersFor } from "../audience-
|
|
35
|
+
import { n as subscribersFor } from "../audience-5Xx1hdIv.js";
|
|
33
36
|
import { i as qualifySqlTable, l as sqlIdent, s as quoteSqlLiteral } from "../sql-0WjxIp9g.js";
|
|
34
37
|
import { o as junctionMembershipSource } from "../sources-C4vkzZJV.js";
|
|
35
|
-
import {
|
|
38
|
+
import { a as callRpc, i as subjectFromSupabaseSession } from "../subject-BqFwS6l3.js";
|
|
36
39
|
import { n as parseSupabaseManifest, t as hasTokenHook } from "../manifest-BdzBobNK.js";
|
|
37
|
-
import { t as parseCatalog } from "../parse-
|
|
40
|
+
import { t as parseCatalog } from "../parse-CORUNcCo.js";
|
|
38
41
|
import { n as activeTenantMismatch, t as activeOrganizationFrom } from "../active-tenant-DVee32-T.js";
|
|
39
42
|
import { AsyncResult, dbError } from "better-supabase";
|
|
40
43
|
//#region src/better-supabase/access-reviews.ts
|
|
@@ -785,6 +788,99 @@ function subjectFromBetterSupabase(session, options = {}) {
|
|
|
785
788
|
});
|
|
786
789
|
}
|
|
787
790
|
//#endregion
|
|
791
|
+
//#region src/better-supabase/version-cache.ts
|
|
792
|
+
const DEFAULT_MAX_STALE_MS = 3e4;
|
|
793
|
+
const adapters = /* @__PURE__ */ new WeakMap();
|
|
794
|
+
function isFiniteVersion(value) {
|
|
795
|
+
return typeof value === "number" && Number.isFinite(value);
|
|
796
|
+
}
|
|
797
|
+
function quiet(call) {
|
|
798
|
+
try {
|
|
799
|
+
Promise.resolve(call()).catch(() => void 0);
|
|
800
|
+
} catch {}
|
|
801
|
+
}
|
|
802
|
+
/** better-supabase's cache is the one shape with `get` and no `current`. */
|
|
803
|
+
function isBetterSupabaseVersionCache(value) {
|
|
804
|
+
return isRecord(value) && typeof value["get"] === "function" && typeof value["current"] !== "function";
|
|
805
|
+
}
|
|
806
|
+
/**
|
|
807
|
+
* A PermDock `VersionCache` over better-supabase's `createVersionCache`, so
|
|
808
|
+
* `claimsFirst(source, { versions })` and the cache `createNext({ versions })`
|
|
809
|
+
* evicts are one store. A read answers from `get`; a version PermDock reads is
|
|
810
|
+
* seeded back, and a failing cache reads the version itself.
|
|
811
|
+
*/
|
|
812
|
+
function betterSupabaseVersionCache(cache, options = {}) {
|
|
813
|
+
const known = adapters.get(cache);
|
|
814
|
+
if (known !== void 0) return known;
|
|
815
|
+
const inFlight = /* @__PURE__ */ new Map();
|
|
816
|
+
const counts = {
|
|
817
|
+
reads: 0,
|
|
818
|
+
shared: 0,
|
|
819
|
+
storeHits: 0,
|
|
820
|
+
hits: 0,
|
|
821
|
+
evictions: 0
|
|
822
|
+
};
|
|
823
|
+
const seed = (id, version) => {
|
|
824
|
+
if (isFiniteVersion(version) && cache.seed !== void 0) {
|
|
825
|
+
const { seed: put } = cache;
|
|
826
|
+
quiet(() => put.call(cache, id, version));
|
|
827
|
+
}
|
|
828
|
+
};
|
|
829
|
+
const read = async (id, load) => {
|
|
830
|
+
counts.reads += 1;
|
|
831
|
+
const version = await load();
|
|
832
|
+
seed(id, version);
|
|
833
|
+
return version;
|
|
834
|
+
};
|
|
835
|
+
const adapter = Object.freeze({
|
|
836
|
+
name: "better-supabase",
|
|
837
|
+
maxStaleMs: options.maxStaleMs ?? DEFAULT_MAX_STALE_MS,
|
|
838
|
+
async current(principal, load, { live }) {
|
|
839
|
+
if (live) return read(principal.id, load);
|
|
840
|
+
try {
|
|
841
|
+
const cached = await cache.get(principal.id);
|
|
842
|
+
if (isFiniteVersion(cached)) {
|
|
843
|
+
counts.hits += 1;
|
|
844
|
+
return cached;
|
|
845
|
+
}
|
|
846
|
+
} catch {}
|
|
847
|
+
const pending = inFlight.get(principal.id);
|
|
848
|
+
if (pending !== void 0) {
|
|
849
|
+
counts.shared += 1;
|
|
850
|
+
return pending;
|
|
851
|
+
}
|
|
852
|
+
const started = read(principal.id, load);
|
|
853
|
+
inFlight.set(principal.id, started);
|
|
854
|
+
const settle = () => {
|
|
855
|
+
if (inFlight.get(principal.id) === started) inFlight.delete(principal.id);
|
|
856
|
+
};
|
|
857
|
+
started.then(settle, settle);
|
|
858
|
+
return started;
|
|
859
|
+
},
|
|
860
|
+
seed(principal, version) {
|
|
861
|
+
if (Number.isFinite(version)) seed(principal, version);
|
|
862
|
+
},
|
|
863
|
+
evict(principal) {
|
|
864
|
+
counts.evictions += 1;
|
|
865
|
+
inFlight.delete(principal);
|
|
866
|
+
quiet(() => cache.evict(principal));
|
|
867
|
+
},
|
|
868
|
+
stats() {
|
|
869
|
+
return {
|
|
870
|
+
...counts,
|
|
871
|
+
size: 0
|
|
872
|
+
};
|
|
873
|
+
}
|
|
874
|
+
});
|
|
875
|
+
adapters.set(cache, adapter);
|
|
876
|
+
return adapter;
|
|
877
|
+
}
|
|
878
|
+
/** `versions` as a PermDock `VersionCache`, whichever shape it has. */
|
|
879
|
+
function versionCacheOf(versions) {
|
|
880
|
+
if (versions === void 0) return;
|
|
881
|
+
return isBetterSupabaseVersionCache(versions) ? betterSupabaseVersionCache(versions) : versions;
|
|
882
|
+
}
|
|
883
|
+
//#endregion
|
|
788
884
|
//#region src/better-supabase/permdock-for.ts
|
|
789
885
|
/** The options a `permdockFor` resolver already holds. */
|
|
790
886
|
const RESOLVER_OWNS = [
|
|
@@ -793,6 +889,7 @@ const RESOLVER_OWNS = [
|
|
|
793
889
|
"version",
|
|
794
890
|
"versions",
|
|
795
891
|
"instances",
|
|
892
|
+
"subjects",
|
|
796
893
|
"options"
|
|
797
894
|
];
|
|
798
895
|
function isResult(source) {
|
|
@@ -807,40 +904,57 @@ function subjectOf(source, result, signedOut, options) {
|
|
|
807
904
|
return subjectFromBetterSupabase(source, options);
|
|
808
905
|
}
|
|
809
906
|
/**
|
|
907
|
+
* `options` with the `definePermDock` definition of its policy under it:
|
|
908
|
+
* `memberships`, `instances`, `versions` and `subjects` by key, and the other
|
|
909
|
+
* sources and `settings` inside `options.options`. A plain policy changes
|
|
910
|
+
* nothing.
|
|
911
|
+
*/
|
|
912
|
+
function withDefinition(options) {
|
|
913
|
+
const app = appOf(options.policy);
|
|
914
|
+
if (app === void 0) return options;
|
|
915
|
+
const { memberships, instances, ...sources } = instanceOptions(app);
|
|
916
|
+
return {
|
|
917
|
+
...options,
|
|
918
|
+
...compact({
|
|
919
|
+
memberships: options.memberships ?? memberships,
|
|
920
|
+
instances: options.instances ?? instances,
|
|
921
|
+
versions: options.versions ?? app.versions,
|
|
922
|
+
subjects: options.subjects ?? app.subjects
|
|
923
|
+
}),
|
|
924
|
+
options: {
|
|
925
|
+
...sources,
|
|
926
|
+
...compact({ settings: app.settings }),
|
|
927
|
+
...options.options
|
|
928
|
+
}
|
|
929
|
+
};
|
|
930
|
+
}
|
|
931
|
+
/**
|
|
810
932
|
* The resolver behind `permdockFor`, the authorizer and the hooks: one sources
|
|
811
933
|
* object per version cache, so every instance of one subject at one version
|
|
812
934
|
* shares an `instances` entry.
|
|
813
935
|
*/
|
|
814
|
-
function permdockResolver(
|
|
815
|
-
const
|
|
816
|
-
|
|
817
|
-
const
|
|
818
|
-
...
|
|
819
|
-
...
|
|
820
|
-
...options.memberships === void 0 ? {} : { memberships: claimsFirst(options.memberships, {
|
|
821
|
-
onStale: "reread",
|
|
822
|
-
...options.version === void 0 ? {} : { version: options.version },
|
|
823
|
-
...versions === void 0 ? {} : { versions }
|
|
824
|
-
}) }
|
|
825
|
-
});
|
|
826
|
-
const sourcesFor = (versions) => {
|
|
827
|
-
if (versions === void 0) {
|
|
828
|
-
uncached ??= sourcesOf(void 0);
|
|
829
|
-
return uncached;
|
|
830
|
-
}
|
|
831
|
-
const known = byCache.get(versions);
|
|
832
|
-
if (known !== void 0) return known;
|
|
833
|
-
const created = sourcesOf(versions);
|
|
834
|
-
byCache.set(versions, created);
|
|
835
|
-
return created;
|
|
936
|
+
function permdockResolver(given) {
|
|
937
|
+
const { versions: anyVersions, ...definition } = withDefinition(given);
|
|
938
|
+
const cache = versionCacheOf(anyVersions);
|
|
939
|
+
const options = {
|
|
940
|
+
...definition,
|
|
941
|
+
...cache === void 0 ? {} : { versions: cache }
|
|
836
942
|
};
|
|
943
|
+
const versionSourcesFor = versionSources(options);
|
|
944
|
+
const sourcesFor = (versions) => versionSourcesFor(versionCacheOf(versions));
|
|
837
945
|
const resolve = async (source, query, runtimeVersions) => {
|
|
838
946
|
const result = isResult(source) ? source : void 0;
|
|
839
947
|
const signedOut = result?.sessionActive === false;
|
|
840
948
|
const user = subjectOf(source, result, signedOut, options.subject);
|
|
841
949
|
const tenant = query.tenant ?? result?.tenant ?? void 0;
|
|
842
950
|
const known = signedOut ? void 0 : knownVersion(result?.authzVersion);
|
|
843
|
-
const sources = sourcesFor(runtimeVersions
|
|
951
|
+
const sources = sourcesFor(runtimeVersions);
|
|
952
|
+
const id = user.principal?.id;
|
|
953
|
+
if (options.subjects !== void 0 && id !== void 0 && known !== void 0) try {
|
|
954
|
+
await options.subjects.record(id, known);
|
|
955
|
+
const record = result?.subject === void 0 ? void 0 : readSubjectRecord(result.subject);
|
|
956
|
+
if (record?.active === true && record.id === id && record.authzVersion === known) await options.subjects.seed(record);
|
|
957
|
+
} catch {}
|
|
844
958
|
const { permdock } = await buildInstance({
|
|
845
959
|
policy: options.policy,
|
|
846
960
|
user,
|
|
@@ -855,8 +969,7 @@ function permdockResolver(options) {
|
|
|
855
969
|
});
|
|
856
970
|
return permdock;
|
|
857
971
|
};
|
|
858
|
-
|
|
859
|
-
return Object.freeze(Object.assign(resolve, { sources }));
|
|
972
|
+
return Object.freeze(Object.assign(resolve, { sources: sourcesFor }));
|
|
860
973
|
}
|
|
861
974
|
/**
|
|
862
975
|
* The resolver an adapter builds instances with: the app's `permdockFor`, or
|
|
@@ -1066,12 +1179,12 @@ function matches(approvers, userId, permdock, managed) {
|
|
|
1066
1179
|
* authorization })`), decided by `policy`. Every hook builds the principal's
|
|
1067
1180
|
* instance from the claims `claims` loads now, never from the request, and
|
|
1068
1181
|
* fails closed: a throw, an unknown key and `approval-required` refuse.
|
|
1069
|
-
* `
|
|
1070
|
-
*
|
|
1071
|
-
* `
|
|
1072
|
-
* options they read. `delegation.permissions` maps each scope to
|
|
1073
|
-
* `.scope` it is, was renamed from, or that a policy
|
|
1074
|
-
* covers, and reads no `authorization_details`.
|
|
1182
|
+
* `delegation` and `sessionTags` (`snapshotTag(userId)`, so `evictSession` and
|
|
1183
|
+
* sign-out clear PermDock snapshots) are always set; `automation`, `support`
|
|
1184
|
+
* and `tickets` only with `claims`; `identities`, `delivery` and `approverOf`
|
|
1185
|
+
* only with the options they read. `delegation.permissions` maps each scope to
|
|
1186
|
+
* the keys whose `.scope` it is, was renamed from, or that a policy
|
|
1187
|
+
* `oauthScopes` entry covers, and reads no `authorization_details`.
|
|
1075
1188
|
*/
|
|
1076
1189
|
function authorizationHooks(options) {
|
|
1077
1190
|
const { policy } = options;
|
|
@@ -1088,8 +1201,10 @@ function authorizationHooks(options) {
|
|
|
1088
1201
|
const permdock = await instance(claims, automation.tenant);
|
|
1089
1202
|
return permdock !== null && automation.permissions.every((key) => grants$1(permdock, key));
|
|
1090
1203
|
};
|
|
1204
|
+
const loadClaims = options.claims;
|
|
1091
1205
|
const claimsOf = async (userId, tenant) => {
|
|
1092
|
-
|
|
1206
|
+
if (loadClaims === void 0) return null;
|
|
1207
|
+
const claims = await loadClaims(userId, tenant === null || tenant === void 0 ? {} : { tenant });
|
|
1093
1208
|
return isRecord(claims) && claims["sub"] === userId ? claims : null;
|
|
1094
1209
|
};
|
|
1095
1210
|
const automation = {
|
|
@@ -1162,7 +1277,7 @@ function authorizationHooks(options) {
|
|
|
1162
1277
|
apiVersion: 1,
|
|
1163
1278
|
name: "PermDock",
|
|
1164
1279
|
sessionTags: (userId) => [snapshotTag(userId)],
|
|
1165
|
-
automation: Object.freeze(automation),
|
|
1280
|
+
...loadClaims === void 0 ? {} : { automation: Object.freeze(automation) },
|
|
1166
1281
|
delegation: Object.freeze(delegation),
|
|
1167
1282
|
...approverOf === void 0 ? {} : { approverOf },
|
|
1168
1283
|
...identities === void 0 ? {} : { identities: Object.freeze(identities) },
|
|
@@ -1170,11 +1285,11 @@ function authorizationHooks(options) {
|
|
|
1170
1285
|
subscribers: fanOut,
|
|
1171
1286
|
audience: fanOut
|
|
1172
1287
|
}) },
|
|
1173
|
-
...support === void 0 ? {} : { support: Object.freeze({ authorize: supportPolicy({
|
|
1288
|
+
...loadClaims === void 0 || support === void 0 ? {} : { support: Object.freeze({ authorize: supportPolicy({
|
|
1174
1289
|
...support,
|
|
1175
1290
|
policy
|
|
1176
1291
|
}) }) },
|
|
1177
|
-
...tickets === void 0 ? {} : { tickets: Object.freeze({ async subject(ticket) {
|
|
1292
|
+
...loadClaims === void 0 || tickets === void 0 ? {} : { tickets: Object.freeze({ async subject(ticket) {
|
|
1178
1293
|
try {
|
|
1179
1294
|
const found = await tickets(ticket);
|
|
1180
1295
|
if (!isRecord(found) || typeof found.userId !== "string") return null;
|
|
@@ -1833,6 +1948,18 @@ function claimsOf(request) {
|
|
|
1833
1948
|
const claims = subject.properties?.["claims"];
|
|
1834
1949
|
return isRecord(claims) ? claims : void 0;
|
|
1835
1950
|
}
|
|
1951
|
+
/**
|
|
1952
|
+
* What a bootstrap read for this user, from better-supabase's runtime `seed`:
|
|
1953
|
+
* used only when it names the claims' user and carries a version.
|
|
1954
|
+
*/
|
|
1955
|
+
function seedOf(runtime, claims) {
|
|
1956
|
+
if (!isRecord(runtime) || !isRecord(runtime["seed"]) || !isRecord(claims)) return;
|
|
1957
|
+
const { userId, version, subject } = runtime["seed"];
|
|
1958
|
+
return typeof userId === "string" && userId !== "" && userId === claims["sub"] && typeof version === "number" && Number.isSafeInteger(version) && version >= 0 ? {
|
|
1959
|
+
version,
|
|
1960
|
+
subject
|
|
1961
|
+
} : void 0;
|
|
1962
|
+
}
|
|
1836
1963
|
const tenantOf = (request) => {
|
|
1837
1964
|
const { tenant } = request.context;
|
|
1838
1965
|
return typeof tenant === "string" ? tenant : null;
|
|
@@ -1857,13 +1984,24 @@ function authorizer(options) {
|
|
|
1857
1984
|
return isPermission(request.action) && READ_ACTIONS.has(request.action.action) ? "read" : "write";
|
|
1858
1985
|
};
|
|
1859
1986
|
const resolve = resolverOf(options, "authorizer");
|
|
1860
|
-
const instanceFor = (claims, tenant, intent, runtime) =>
|
|
1861
|
-
|
|
1862
|
-
claims
|
|
1863
|
-
|
|
1864
|
-
|
|
1865
|
-
|
|
1866
|
-
|
|
1987
|
+
const instanceFor = (claims, tenant, intent, runtime) => {
|
|
1988
|
+
const seed = seedOf(runtime, claims);
|
|
1989
|
+
return resolve(claims === void 0 ? null : seed === void 0 ? {
|
|
1990
|
+
kind: "user",
|
|
1991
|
+
claims
|
|
1992
|
+
} : {
|
|
1993
|
+
session: {
|
|
1994
|
+
kind: "user",
|
|
1995
|
+
claims
|
|
1996
|
+
},
|
|
1997
|
+
tenant,
|
|
1998
|
+
authzVersion: seed.version,
|
|
1999
|
+
subject: seed.subject
|
|
2000
|
+
}, {
|
|
2001
|
+
tenant,
|
|
2002
|
+
intent
|
|
2003
|
+
}, runtime?.versions);
|
|
2004
|
+
};
|
|
1867
2005
|
const scoped = (claims, tenant, intent, runtime, batch) => {
|
|
1868
2006
|
const key = `permdock:authorizer:${canonicalJson([
|
|
1869
2007
|
claims ?? null,
|
|
@@ -2489,4 +2627,4 @@ function workflowResource(subject, types) {
|
|
|
2489
2627
|
});
|
|
2490
2628
|
}
|
|
2491
2629
|
//#endregion
|
|
2492
|
-
export { accessReviewApplier, apiKeyClaimOptions, apiKeyVerifier, authorizationHooks, authorizationProvider, authorizer, blockApprovalPolicySource, blockApprovalStore, blockMembershipSource, bucketPolicy, credentialGuard, getPermissions, handlerCan, hookCan, permdockFor, principalFromMemberships, principalSource, roleOrderFromCatalog, subjectFromBetterSupabase, subjectFromShareLink, subscriberPolicy, supportPolicy, toolPolicy, topicPolicy, workflowResource };
|
|
2630
|
+
export { accessReviewApplier, apiKeyClaimOptions, apiKeyVerifier, authorizationHooks, authorizationProvider, authorizer, betterSupabaseVersionCache, blockApprovalPolicySource, blockApprovalStore, blockMembershipSource, bucketPolicy, credentialGuard, getPermissions, handlerCan, hookCan, isBetterSupabaseVersionCache, permdockFor, principalFromMemberships, principalSource, roleOrderFromCatalog, subjectFromBetterSupabase, subjectFromShareLink, subscriberPolicy, supportPolicy, toolPolicy, topicPolicy, workflowResource };
|
|
@@ -0,0 +1,194 @@
|
|
|
1
|
+
import { r as isRecord } from "./compact-CAf557ZB.js";
|
|
2
|
+
import "./budget-BBCPDOGP.js";
|
|
3
|
+
import { existsSync, readFileSync, readdirSync, statSync } from "node:fs";
|
|
4
|
+
import { dirname, join, resolve } from "node:path";
|
|
5
|
+
//#region src/cli/shared/doctor-files.ts
|
|
6
|
+
const nodeFiles = Object.freeze({
|
|
7
|
+
exists: (path) => existsSync(path),
|
|
8
|
+
read: (path) => readFileSync(path, "utf8"),
|
|
9
|
+
list: (path) => readdirSync(path),
|
|
10
|
+
isDirectory: (path) => statSync(path, { throwIfNoEntry: false })?.isDirectory() === true
|
|
11
|
+
});
|
|
12
|
+
function filesOf(input) {
|
|
13
|
+
return input.files ?? nodeFiles;
|
|
14
|
+
}
|
|
15
|
+
/** Parses the JSON file at `path`; throws when it is missing or invalid. */
|
|
16
|
+
function readJson(files, path) {
|
|
17
|
+
return JSON.parse(files.read(path));
|
|
18
|
+
}
|
|
19
|
+
//#endregion
|
|
20
|
+
//#region src/cli/shared/workspace.ts
|
|
21
|
+
/**
|
|
22
|
+
* The directories from `cwd` up to the workspace root: the first one with a
|
|
23
|
+
* `pnpm-workspace.yaml`, a `package.json` that declares `workspaces`, or a
|
|
24
|
+
* `.git`. Skills are often installed once at a monorepo's root.
|
|
25
|
+
*/
|
|
26
|
+
function workspaceDirs(files, cwd) {
|
|
27
|
+
const dirs = [];
|
|
28
|
+
let dir = resolve(cwd);
|
|
29
|
+
for (;;) {
|
|
30
|
+
dirs.push(dir);
|
|
31
|
+
if (isWorkspaceRoot(files, dir)) return dirs;
|
|
32
|
+
const parent = dirname(dir);
|
|
33
|
+
if (parent === dir) return [resolve(cwd)];
|
|
34
|
+
dir = parent;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
function isWorkspaceRoot(files, dir) {
|
|
38
|
+
if (files.exists(join(dir, "pnpm-workspace.yaml")) || files.exists(join(dir, ".git"))) return true;
|
|
39
|
+
const manifest = join(dir, "package.json");
|
|
40
|
+
if (!files.exists(manifest)) return false;
|
|
41
|
+
try {
|
|
42
|
+
const parsed = readJson(files, manifest);
|
|
43
|
+
return parsed !== null && typeof parsed === "object" && Object.hasOwn(parsed, "workspaces");
|
|
44
|
+
} catch {
|
|
45
|
+
return false;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
//#endregion
|
|
49
|
+
//#region src/cli/project/better-supabase.ts
|
|
50
|
+
const CONFIG_FILES = [
|
|
51
|
+
"better-supabase.config.ts",
|
|
52
|
+
"better-supabase.config.mts",
|
|
53
|
+
"better-supabase.config.js",
|
|
54
|
+
"better-supabase.config.mjs"
|
|
55
|
+
];
|
|
56
|
+
/**
|
|
57
|
+
* The default export of the project's better-supabase config, if it loads.
|
|
58
|
+
* `betterSupabase.config` in `permdock.config.ts` names it; without that the
|
|
59
|
+
* search starts in `from` (default `cwd`), the directory of
|
|
60
|
+
* `permdock.config.ts`, and goes up to the workspace root, so an app inside a
|
|
61
|
+
* monorepo finds the root's config.
|
|
62
|
+
*/
|
|
63
|
+
async function betterSupabaseConfig(input) {
|
|
64
|
+
const files = filesOf(input);
|
|
65
|
+
const path = input.path === void 0 ? workspaceDirs(files, input.from ?? input.cwd).flatMap((dir) => CONFIG_FILES.map((name) => resolve(dir, name))).find((file) => files.exists(file)) : [resolve(input.cwd, input.path)].find((file) => files.exists(file));
|
|
66
|
+
if (path === void 0) return;
|
|
67
|
+
try {
|
|
68
|
+
const { loadModule } = await import("./load-DiBUJx77.js");
|
|
69
|
+
const loaded = (await loadModule(path))["default"];
|
|
70
|
+
return isRecord(loaded) ? loaded : void 0;
|
|
71
|
+
} catch {
|
|
72
|
+
return;
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
const DEPENDENCY_FIELDS = [
|
|
76
|
+
"dependencies",
|
|
77
|
+
"devDependencies",
|
|
78
|
+
"peerDependencies",
|
|
79
|
+
"optionalDependencies"
|
|
80
|
+
];
|
|
81
|
+
function declaresBetterSupabase(files, directory) {
|
|
82
|
+
const manifest = join(directory, "package.json");
|
|
83
|
+
if (!files.exists(manifest)) return false;
|
|
84
|
+
try {
|
|
85
|
+
const parsed = readJson(files, manifest);
|
|
86
|
+
return isRecord(parsed) && DEPENDENCY_FIELDS.some((field) => {
|
|
87
|
+
const group = parsed[field];
|
|
88
|
+
return isRecord(group) && Object.hasOwn(group, "better-supabase");
|
|
89
|
+
});
|
|
90
|
+
} catch {
|
|
91
|
+
return false;
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
/** The patterns of `pnpm-workspace.yaml`'s `packages:` list or `workspaces`. */
|
|
95
|
+
function workspacePatterns(files, root) {
|
|
96
|
+
const patterns = [];
|
|
97
|
+
const yaml = join(root, "pnpm-workspace.yaml");
|
|
98
|
+
if (files.exists(yaml)) {
|
|
99
|
+
let inPackages = false;
|
|
100
|
+
for (const line of files.read(yaml).split("\n")) if (/^packages\s*:/u.test(line)) inPackages = true;
|
|
101
|
+
else if (/^\S/u.test(line)) inPackages = false;
|
|
102
|
+
else if (inPackages) {
|
|
103
|
+
const item = /^\s*-\s*["']?([^"'#\s]+)["']?/u.exec(line);
|
|
104
|
+
if (item?.[1] !== void 0) patterns.push(item[1]);
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
const manifest = join(root, "package.json");
|
|
108
|
+
if (files.exists(manifest)) try {
|
|
109
|
+
const parsed = readJson(files, manifest);
|
|
110
|
+
const workspaces = isRecord(parsed) ? parsed["workspaces"] : void 0;
|
|
111
|
+
const list = isRecord(workspaces) ? workspaces["packages"] : workspaces;
|
|
112
|
+
if (Array.isArray(list)) patterns.push(...list.filter((entry) => typeof entry === "string"));
|
|
113
|
+
} catch {}
|
|
114
|
+
return patterns;
|
|
115
|
+
}
|
|
116
|
+
/**
|
|
117
|
+
* The package directories a workspace pattern names: `dir/*`, `dir/**` or a
|
|
118
|
+
* path.
|
|
119
|
+
*/
|
|
120
|
+
function packageDirs(files, root, pattern) {
|
|
121
|
+
if (pattern.startsWith("!")) return [];
|
|
122
|
+
const base = pattern.replace(/\/\*\*?$/u, "");
|
|
123
|
+
const dir = resolve(root, base);
|
|
124
|
+
if (base === pattern) return [dir];
|
|
125
|
+
return files.isDirectory(dir) ? files.list(dir).filter((name) => name !== "node_modules" && !name.startsWith(".")).map((name) => join(dir, name)).filter((entry) => files.isDirectory(entry)) : [];
|
|
126
|
+
}
|
|
127
|
+
/**
|
|
128
|
+
* Whether the nearest `package.json` (up to the workspace root) or a workspace
|
|
129
|
+
* package depends on `better-supabase`, for a project whose config file sits in
|
|
130
|
+
* another package than `permdock.config.ts`.
|
|
131
|
+
*/
|
|
132
|
+
function betterSupabaseInstalled(input) {
|
|
133
|
+
const files = filesOf(input);
|
|
134
|
+
const dirs = workspaceDirs(files, input.from ?? input.cwd);
|
|
135
|
+
if (dirs.some((dir) => declaresBetterSupabase(files, dir))) return true;
|
|
136
|
+
const root = dirs.at(-1);
|
|
137
|
+
return root !== void 0 && workspacePatterns(files, root).flatMap((pattern) => packageDirs(files, root, pattern)).some((dir) => declaresBetterSupabase(files, dir));
|
|
138
|
+
}
|
|
139
|
+
function stringAt(value, ...path) {
|
|
140
|
+
let at = value;
|
|
141
|
+
for (const key of path) {
|
|
142
|
+
if (!isRecord(at)) return void 0;
|
|
143
|
+
at = at[key];
|
|
144
|
+
}
|
|
145
|
+
return typeof at === "string" && at !== "" ? at : void 0;
|
|
146
|
+
}
|
|
147
|
+
/**
|
|
148
|
+
* The claim better-supabase writes the active tenant to: `auth.tenant.claim` in
|
|
149
|
+
* a grouped config, `claims.tenant` in a flat one, then `rls.tenantClaim` and
|
|
150
|
+
* `tenant_id`.
|
|
151
|
+
*/
|
|
152
|
+
function betterSupabaseTenantClaim(config, betterSupabase) {
|
|
153
|
+
return stringAt(betterSupabase, "auth", "tenant", "claim") ?? stringAt(betterSupabase, "claims", "tenant") ?? config.rls?.tenantClaim ?? "tenant_id";
|
|
154
|
+
}
|
|
155
|
+
/** better-supabase's server topic for authorization version changes. */
|
|
156
|
+
const BETTER_SUPABASE_AUTHZ_TOPIC = "better_supabase:authz";
|
|
157
|
+
/**
|
|
158
|
+
* Whether better-supabase's sessions block writes its own version table and the
|
|
159
|
+
* `authz:<uid>` receive policy (`blocks.sessions.authzVersions`).
|
|
160
|
+
*/
|
|
161
|
+
function betterSupabaseAuthzVersions(betterSupabase) {
|
|
162
|
+
const blocks = betterSupabase["blocks"];
|
|
163
|
+
const sessions = isRecord(blocks) ? blocks["sessions"] : void 0;
|
|
164
|
+
if (!isRecord(sessions)) return false;
|
|
165
|
+
const options = sessions["options"];
|
|
166
|
+
return sessions["authzVersions"] === true || isRecord(options) && options["authzVersions"] === true;
|
|
167
|
+
}
|
|
168
|
+
/**
|
|
169
|
+
* Resolve the hook defaults once for generation, inspection and doctor. With a
|
|
170
|
+
* config, the hook reads its tenant claim and sessions block; with only the
|
|
171
|
+
* dependency (`installed`), it broadcasts on better-supabase's topic and
|
|
172
|
+
* changes nothing else.
|
|
173
|
+
*/
|
|
174
|
+
function betterSupabaseDefaults(config, betterSupabase, installed = false) {
|
|
175
|
+
const hook = config.supabase?.hook;
|
|
176
|
+
if (hook === void 0 || betterSupabase === void 0 && !installed) return config;
|
|
177
|
+
const broadcast = hook.broadcast === false ? false : {
|
|
178
|
+
topic: hook.broadcast?.topic ?? "better_supabase:authz",
|
|
179
|
+
receivePolicy: hook.broadcast?.receivePolicy ?? (betterSupabase === void 0 || !betterSupabaseAuthzVersions(betterSupabase))
|
|
180
|
+
};
|
|
181
|
+
return {
|
|
182
|
+
...config,
|
|
183
|
+
supabase: {
|
|
184
|
+
...config.supabase,
|
|
185
|
+
hook: {
|
|
186
|
+
...hook,
|
|
187
|
+
...betterSupabase === void 0 ? {} : { activeFrom: hook.activeFrom ?? `app_metadata.${betterSupabaseTenantClaim(config, betterSupabase)}` },
|
|
188
|
+
broadcast
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
};
|
|
192
|
+
}
|
|
193
|
+
//#endregion
|
|
194
|
+
export { betterSupabaseInstalled as a, filesOf as c, betterSupabaseDefaults as i, nodeFiles as l, betterSupabaseAuthzVersions as n, betterSupabaseTenantClaim as o, betterSupabaseConfig as r, workspaceDirs as s, BETTER_SUPABASE_AUTHZ_TOPIC as t, readJson as u };
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { t as compact } from "./compact-CAf557ZB.js";
|
|
2
|
-
import {
|
|
3
|
-
import { t as composeWraps } from "./wrap-
|
|
4
|
-
import {
|
|
5
|
-
import { f as invalidSignatureResponse } from "./evaluations-CNMVJVD6.js";
|
|
2
|
+
import { r as withApp } from "./app-DIvM65Mv.js";
|
|
3
|
+
import { t as composeWraps } from "./wrap-BKU5Arsu.js";
|
|
4
|
+
import { t as instanceOptions } from "./instance-options-URVwqpMW.js";
|
|
6
5
|
import { n as tenantScope } from "./adapter-context-OHikyRqV.js";
|
|
7
|
-
import { t as createPermDock } from "./create-
|
|
6
|
+
import { t as createPermDock } from "./create-BsL5lCWR.js";
|
|
7
|
+
import { h as invalidSignatureResponse } from "./evaluations-BzTDWO4m.js";
|
|
8
8
|
//#region src/server/bind.ts
|
|
9
9
|
/**
|
|
10
10
|
* The server kernel with the subject and actor callbacks reading the context
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { Q as Intent, xr as Subject } from "./policy-types-
|
|
2
|
-
import { m as ApprovalStore } from "./types-
|
|
3
|
-
import { t as InstanceOptions } from "./instance-options-
|
|
1
|
+
import { Q as Intent, xr as Subject } from "./policy-types-rNfz7t0M.js";
|
|
2
|
+
import { m as ApprovalStore } from "./types-ZfjQB0KC.js";
|
|
3
|
+
import { t as InstanceOptions } from "./instance-options-C6gEDOts.js";
|
|
4
4
|
import { t as RequestContext } from "./request-context-C2_1lchh.js";
|
|
5
|
-
import { n as PermDockWrap } from "./wrap-
|
|
6
|
-
import { o as OtelWrap } from "./types-
|
|
7
|
-
import { r as PdpFactory } from "./types-
|
|
8
|
-
import { S as TenantOption, _ as WebBotAuthVerifier, t as DeniedResponse } from "./server-types
|
|
5
|
+
import { n as PermDockWrap } from "./wrap-B-k2qHJx.js";
|
|
6
|
+
import { o as OtelWrap } from "./types-_pi9kxS2.js";
|
|
7
|
+
import { r as PdpFactory } from "./types-C_a44wSr.js";
|
|
8
|
+
import { S as TenantOption, _ as WebBotAuthVerifier, t as DeniedResponse } from "./server-types--_Hann81.js";
|
|
9
9
|
//#region src/server/bind.d.ts
|
|
10
10
|
/**
|
|
11
11
|
* The options of every framework adapter; `TContext` is what its callbacks
|
|
@@ -1,28 +1,6 @@
|
|
|
1
1
|
import { t as compact } from "./compact-CAf557ZB.js";
|
|
2
|
-
import { t as getPermDock } from "./permdock-
|
|
3
|
-
|
|
4
|
-
const INSTANCE_KEYS = {
|
|
5
|
-
memberships: true,
|
|
6
|
-
relations: true,
|
|
7
|
-
entitlements: true,
|
|
8
|
-
customRoles: true,
|
|
9
|
-
policies: true,
|
|
10
|
-
approvalPolicies: true,
|
|
11
|
-
sink: true,
|
|
12
|
-
limits: true,
|
|
13
|
-
principals: true,
|
|
14
|
-
instances: true
|
|
15
|
-
};
|
|
16
|
-
/** The `InstanceOptions` set on `options`, without the adapter's own keys. */
|
|
17
|
-
function instanceOptions(options) {
|
|
18
|
-
const picked = {};
|
|
19
|
-
for (const key of Object.keys(INSTANCE_KEYS)) {
|
|
20
|
-
const name = key;
|
|
21
|
-
if (options[name] !== void 0) picked[name] = options[name];
|
|
22
|
-
}
|
|
23
|
-
return picked;
|
|
24
|
-
}
|
|
25
|
-
//#endregion
|
|
2
|
+
import { t as getPermDock } from "./permdock-B5LyNVgn.js";
|
|
3
|
+
import { t as instanceOptions } from "./instance-options-URVwqpMW.js";
|
|
26
4
|
//#region src/core/build-instance.ts
|
|
27
5
|
/**
|
|
28
6
|
* `resolve()`, or `null` when it throws: a subject or delegation that cannot be
|
|
@@ -50,4 +28,4 @@ async function buildInstance(input) {
|
|
|
50
28
|
};
|
|
51
29
|
}
|
|
52
30
|
//#endregion
|
|
53
|
-
export { resolveOrNull as n,
|
|
31
|
+
export { resolveOrNull as n, buildInstance as t };
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { t as compact } from "./compact-CAf557ZB.js";
|
|
2
2
|
import { n as freezeDeep } from "./freeze-jjan0lCv.js";
|
|
3
3
|
import { a as ownRecord } from "./paths-CUvURzHp.js";
|
|
4
|
-
import { a as isId, o as sameId, r as idList, t as expiredAt } from "./expiry-6XByK0dm.js";
|
|
5
4
|
import { c as listPermissions } from "./permission-registry-B8tYxPIt.js";
|
|
6
5
|
import { o as epochSeconds, p as nowSeconds } from "./time-nR1JesoH.js";
|
|
6
|
+
import { a as expiredAt, i as sameId, r as isId, t as idList } from "./ids-DzhJaCUj.js";
|
|
7
7
|
import { t as anonymousSubject } from "./subject-C7RddW0G.js";
|
|
8
8
|
//#region src/core/capability.ts
|
|
9
9
|
function redeemerKind(redeemer) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { _t as TokenSigner, qt as Instant, yr as Principal } from "./policy-types-
|
|
2
|
-
import {
|
|
1
|
+
import { _t as TokenSigner, qt as Instant, yr as Principal } from "./policy-types-rNfz7t0M.js";
|
|
2
|
+
import { E as PermissionTree, w as Permission } from "./vocabulary-DeZvUaTw.js";
|
|
3
3
|
//#region src/core/capability.d.ts
|
|
4
4
|
/**
|
|
5
5
|
* Who may redeem a capability: anyone holding it, any signed-in principal, one
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as nonEmptyOr } from "./output-
|
|
1
|
+
import { a as nonEmptyOr } from "./output-CYgfpT6o.js";
|
|
2
2
|
import { t as applyFiles } from "./files-CfiRtQ-m.js";
|
|
3
3
|
import { n as isIdentifier, t as emitPolicyModule } from "./policy-module-xym9fnSq.js";
|
|
4
4
|
import { existsSync, readFileSync } from "node:fs";
|