permdock 0.21.0 → 0.22.1
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-UkQisAqe.js → adoption-scan-DzX5Gqcg.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-CUthH61H.js → arazzo-BkjyGVF0.js} +1 -1
- package/dist/{arazzo-BC3uLIZy.js → arazzo-CTx11zFc.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 +213 -69
- package/dist/better-supabase-DF8f8oly.js +194 -0
- package/dist/{bind-CJf7S-Jd.js → bind-B4Z0U2Gr.js} +5 -5
- package/dist/{bind-XvnD_SUz.d.ts → bind-CnOMjazH.d.ts} +7 -7
- package/dist/{build-instance-CkRKgjSj.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-v9Xo_XPa.js → casbin-BFOuRptJ.js} +1 -1
- package/dist/{casbin-BOZN1P2Y.js → casbin-BpS9ABSO.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-CB0btByh.js → cloud-DXcQXWDi.js} +2 -2
- package/dist/{codemod-B-duJDFD.js → codemod-CxyKuniX.js} +13 -6
- package/dist/{codemod-C3a3Iz_w.js → codemod-DJ0WqXWk.js} +2 -2
- 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-DonvwG9x.d.ts → compile-DC-BrhH1.d.ts} +3 -3
- package/dist/{completion-6IshPaPd.js → completion-BHVvAJ6Q.js} +1 -1
- package/dist/{delegation-aK4T_5WU.js → condition-evaluate-bVVRSdzq.js} +159 -159
- package/dist/{config-C45X7mpm.js → config-2grt3oll.js} +1 -1
- package/dist/{config-D2oXUwos.js → config-DyNanTjZ.js} +10 -8
- package/dist/{config-report-Bmo62RRr.js → config-report-Cg5Y5j0h.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-Dxkwz4xR.js → core-CUjhfz0W.js} +6 -6
- package/dist/{core-9KbhurkH.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-DH4ZD0A7.d.ts → create-B2tdOygC.d.ts} +7 -7
- package/dist/{create-Q0wF9Elt.js → create-BJ2_8NDO.js} +5 -5
- package/dist/{create-BRiRVNUO.js → create-BsL5lCWR.js} +8 -7
- package/dist/{create-BzgDDamI.d.ts → create-CPDSbK1a.d.ts} +5 -5
- package/dist/{create-BQOQkYYg.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-BJv7I3GR.js → diff-BR9JArxz.js} +6 -6
- package/dist/{diff-3fpwo3UD.js → diff-Jc_kbDz-.js} +1 -1
- package/dist/{doctor-Bz7s3JYD.js → doctor-DaRoSPT0.js} +310 -36
- package/dist/{doctor-keoa9DpH.js → doctor-iIbdUK8F.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-OCm_Z-8V.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-BlL-ZhHq.d.ts → fetch-adapter-DxqsIXSO.d.ts} +4 -4
- package/dist/{fetch-adapter-4EB3cLgB.js → fetch-adapter-MoYZ-vF5.js} +3 -3
- 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-Cf7nQsOb.js → gen-Cw8goef4.js} +5 -5
- package/dist/{gen-DYF4LKUP.js → gen-DFpWGJWF.js} +1 -1
- 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-C2ExjVvv.js → import-CvXswHDy.js} +2 -2
- package/dist/{import-CQ_kH_Ny.js → import-DDegvwDI.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-Do7FqHEr.d.ts → index-C_8uxAlv.d.ts} +5 -5
- package/dist/{index-tuR-kZoJ.d.ts → index-Cjfa1Uwr.d.ts} +21 -40
- package/dist/{index-BqzpT-90.d.ts → index-iIsqXFVu.d.ts} +6 -6
- package/dist/index.d.ts +19 -20
- package/dist/index.js +25 -24
- package/dist/{init-DvkvbvZ_.js → init-D_T_zgFg.js} +2 -2
- package/dist/{init-kTFkEu8S.js → init-Dz552ZPp.js} +4 -4
- package/dist/{instance-options-Cq66kEeR.d.ts → instance-options-C6gEDOts.d.ts} +1 -1
- package/dist/instance-options-URVwqpMW.js +24 -0
- package/dist/{instance-snapshot-Bi4-dJk0.js → instance-snapshot-D_dGTq--.js} +9 -9
- package/dist/jwt/index.d.ts +4 -4
- package/dist/jwt/index.js +2 -2
- package/dist/{kernel-CLEzDmbv.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-9ycIcJZH.js → login-B2usNw0X.js} +4 -4
- package/dist/{login-CM_etiLM.js → login-DIVe6QdP.js} +3 -3
- package/dist/{manifest-B5yF3CIq.d.ts → manifest-C6eFl3Vo.d.ts} +1 -0
- package/dist/{manifest-CCd-xrM3.js → manifest-CbHnl4I_.js} +35 -35
- package/dist/{manifest-BdzBobNK.js → manifest-D44OkoLk.js} +1 -1
- package/dist/{manifest-schema-CsFsYLF-.js → manifest-schema-DUheHWcp.js} +4 -0
- 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 +43 -17
- package/dist/next/index.js +54 -21
- 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-DA7FVG2F.js → openapi-5moP9sTG.js} +4 -4
- package/dist/{openapi-BOsx0xn9.js → openapi-Cc-aS9xC.js} +6 -135
- package/dist/{openapi-QnnU2A1c.js → openapi-DcvNnLFa.js} +2 -2
- 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-KT0a3B3H.js → output-RIUEs3_S.js} +1 -1
- package/dist/{ownership-CeNOtQMV.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-DbAq8_Fp.js → permdock-B5LyNVgn.js} +70 -34
- package/dist/{permdock-CsrvbzHk.d.ts → permdock-BaB-KQqn.d.ts} +46 -9
- package/dist/{permissions-Dz79qsFw.js → permissions-COpRGKt7.js} +1 -1
- package/dist/{permissions-Bx6UI8n1.d.ts → permissions-DriWkV7q.d.ts} +1 -2
- package/dist/{policy-from-catalog-BtqfxytV.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-DiqY3VBG.js → powersync-BUO5uQve.js} +11 -11
- package/dist/{powersync-CWsN-QaK.js → powersync-C5_aFFaU.js} +2 -2
- package/dist/powersync-DhspazC8.js +1 -0
- 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-CuG0xz4P.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-ihxuJbMi.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-B4EhSqOG.js → pull-BkT7tTKb.js} +6 -6
- package/dist/pull-COPm1W-l.js +1 -0
- package/dist/{push-DYOI4bPf.js → push-CEPcWdTJ.js} +7 -7
- package/dist/{pushed-policy-Dszouliu.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-VjeXst1z.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-BIHnWL_L.js → resolve-names-bzYlAXRt.js} +11 -6
- package/dist/{rls-CMFZWosz.js → rls-DTf8X__h.js} +45 -18
- package/dist/{rls-C7qXye9M.js → rls-v6V75yf_.js} +1 -1
- package/dist/{role-builder-C5AgaC1x.js → role-builder-boQiUvfo.js} +3 -3
- package/dist/{rpc-CYXICjM1.d.ts → rpc-BqRiVpbP.d.ts} +2 -2
- package/dist/{rpc-BNIQwEB6.js → rpc-Dhi55Whd.js} +2 -2
- package/dist/{run-CMJX9x7b.js → run-CgSQS9RF.js} +3 -3
- package/dist/run-ItR_bQGz.js +1 -0
- package/dist/{run-ticket-CjvXr6wj.js → run-ticket-Ddxt9OuU.js} +2 -2
- package/dist/{run-ticket-BXYqQ9dy.d.ts → run-ticket-Dulj4RQk.d.ts} +2 -2
- package/dist/{saas-DHFfthXv.js → saas-DABv6vjy.js} +6 -5
- package/dist/{scan-CSOkcNdl.js → scan-BY3Pp1PS.js} +1 -1
- package/dist/{schema-7pXCaRYB.js → schema-B_HsJKm2.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-Bfl-IrzZ.d.ts → server-types--_Hann81.d.ts} +9 -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-DrX83QBK.js → skills-Bj2wk38p.js} +2 -2
- package/dist/{skills-DAjg-rgF.js → skills-Clo4qYLn.js} +1 -1
- 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-CdYZBVcW.d.ts} +2 -2
- package/dist/{src-Cop53_X1.js → src-BG9YJM3Q.js} +96 -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-CRQ5VrWR.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-pEBMy94l.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 +7 -6
- package/dist/supabase/index.js +4 -3
- package/dist/supabase/middleware.d.ts +6 -6
- package/dist/supabase/middleware.js +6 -6
- package/dist/{supabase-Cbl2orB2.js → supabase-CJv6K3iz.js} +2 -2
- package/dist/{supabase-CVZuytCC.js → supabase-DnazO6W4.js} +3 -3
- package/dist/{supabase-hook-BUcu3vPM.js → supabase-hook-DLQMugW8.js} +174 -62
- package/dist/supabase-hook-vZADjjfN.js +1 -0
- package/dist/{supautils-a_253u1X.js → supautils-BHKsP7l-.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-XrvffTMj.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 +36 -3
- package/dist/testing/fixtures/index.js +40 -3
- package/dist/testing/index.d.ts +42 -26
- package/dist/testing/index.js +115 -27
- 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-MixnvXQ5.d.ts → types-BpxdxaRD.d.ts} +5 -5
- package/dist/{types-C3C9ien9.d.ts → types-CD1qmxdx.d.ts} +4 -4
- package/dist/{types-zh4WGQcP.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-DjGZAU64.d.ts → types-NikV1pND.d.ts} +4 -4
- package/dist/{types-BzxA2OAD.d.ts → types-ZfjQB0KC.d.ts} +2 -2
- package/dist/{types-DotXrris.d.ts → types-_pi9kxS2.d.ts} +2 -2
- package/dist/{types-D1NjjwI4.d.ts → types-cNZhj0UF.d.ts} +40 -9
- package/dist/unplugin/index.d.ts +1 -1
- package/dist/unplugin/index.js +1 -1
- package/dist/{usage-DHsqp4lN.js → usage-BUUXeKwk.js} +1 -1
- package/dist/{usage-DPbdI3Vi.js → usage-DlOllyPi.js} +10 -10
- package/dist/usage-NmH5QXKC.js +1 -0
- package/dist/{validation-error-DkOK9zUE.d.ts → validation-error-DLAYFlkr.d.ts} +1 -1
- package/dist/{verify-C0jGJrmb.js → verify-CfmvQjVw.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-EQ6Or2Hi.d.ts → wrap-B-k2qHJx.d.ts} +2 -2
- package/package.json +16 -4
- package/schemas/supabase-manifest-v1.json +6 -0
- 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-DuOF7OqS.d.ts +0 -222
- package/dist/load-CjnlPxpL.js +0 -1
- package/dist/powersync-CWCirKAJ.js +0 -1
- package/dist/pull-VzcECZ-R.js +0 -1
- package/dist/run-D2e1tybu.js +0 -1
- package/dist/supabase-hook-QWphWBnG.js +0 -1
- package/dist/usage-dmSjKx-Z.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,15 +1,167 @@
|
|
|
1
1
|
import { n as isReadonlyArray } from "./compact-CAf557ZB.js";
|
|
2
2
|
import { r as ownGet } from "./paths-CUvURzHp.js";
|
|
3
3
|
import { a as resolveConditionRef, c as isConditionDate, d as parentHop, l as isConditionRef } from "./refs-C8BKxc_e.js";
|
|
4
|
-
import {
|
|
4
|
+
import { t as isActive } from "./validity-Buc7w8E9.js";
|
|
5
5
|
import { g as formerScopes, m as annotationsFor, n as findPermission } from "./permission-registry-B8tYxPIt.js";
|
|
6
|
+
import { o as flattenGrantee } from "./grantee-Dke-9rd1.js";
|
|
6
7
|
import { o as epochSeconds } from "./time-nR1JesoH.js";
|
|
7
|
-
import {
|
|
8
|
+
import { a as expiredAt, i as sameId } from "./ids-DzhJaCUj.js";
|
|
9
|
+
import { d as scopeList, p as tenantOf, s as resolveScope } from "./scopes-gdH__vDZ.js";
|
|
10
|
+
import { n as matchGrantee } from "./grantee-match-8J2y60MF.js";
|
|
8
11
|
import { t as isoInstant } from "./instant-DK3Iz83e.js";
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
12
|
+
//#region src/core/delegation.ts
|
|
13
|
+
/**
|
|
14
|
+
* The permission's scope and any scope it was renamed from: tokens issued
|
|
15
|
+
* before a rename keep working.
|
|
16
|
+
*/
|
|
17
|
+
function scopeNames(permission) {
|
|
18
|
+
return [permission.scope, ...formerScopes(permission)];
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Whether a delegated caller may use a permission its principal holds, through
|
|
22
|
+
* OAuth `scopes`, RFC 9396 `authorizationDetails` or GNAP `access`. `undefined`
|
|
23
|
+
* means covered; otherwise the denial reason `decide` would add.
|
|
24
|
+
*/
|
|
25
|
+
function coveredByDelegation(permission, delegation, resourceId, hasActor = false) {
|
|
26
|
+
const unscoped = hasActor ? "no-delegation" : void 0;
|
|
27
|
+
if (delegation === void 0) return unscoped;
|
|
28
|
+
const hasScopes = delegation.scopes !== void 0;
|
|
29
|
+
const hasDetails = delegation.authorizationDetails !== void 0;
|
|
30
|
+
const hasAccess = delegation.access !== void 0;
|
|
31
|
+
if (!hasScopes && !hasDetails && !hasAccess) return unscoped;
|
|
32
|
+
const emptyScopes = hasScopes && (delegation.scopes?.length ?? 0) === 0;
|
|
33
|
+
const emptyAccess = hasAccess && (delegation.access?.length ?? 0) === 0;
|
|
34
|
+
if (emptyScopes && !hasDetails && !hasAccess) return "no-delegation";
|
|
35
|
+
if (emptyAccess && !hasScopes && !hasDetails) return "no-delegation";
|
|
36
|
+
if (emptyScopes && emptyAccess && !hasDetails) return "no-delegation";
|
|
37
|
+
const scopes = scopeNames(permission);
|
|
38
|
+
const scopeOk = delegation.scopes?.some((scope) => scopes.includes(scope)) ?? false;
|
|
39
|
+
const detailOk = delegation.authorizationDetails?.some((detail) => {
|
|
40
|
+
if (detail.type !== permission.resource) return false;
|
|
41
|
+
const identifier = detail["identifier"];
|
|
42
|
+
if (identifier !== void 0 && (typeof identifier !== "string" || identifier !== resourceId)) return false;
|
|
43
|
+
const actions = detail.actions;
|
|
44
|
+
if (actions === void 0) return true;
|
|
45
|
+
return Array.isArray(actions) && actions.includes(permission.action);
|
|
46
|
+
}) ?? false;
|
|
47
|
+
const accessOk = accessCovers(permission, delegation.access, resourceId);
|
|
48
|
+
if (scopeOk || detailOk || accessOk) return;
|
|
49
|
+
return "not-delegated";
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* A `readOnly` actor never uses a permission without `readOnlyHint`, delegated
|
|
53
|
+
* or not.
|
|
54
|
+
*/
|
|
55
|
+
function readOnlyActorRefuses(actor, permission) {
|
|
56
|
+
return actor?.readOnly === true && !annotationsFor(permission).readOnlyHint;
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* Whether an `agent` actor may call the tool `name`: its `tools` list names it.
|
|
60
|
+
* An agent without a `tools` list and any other actor kind are not restricted
|
|
61
|
+
* here; a `tools` value that is not a list of strings refuses every tool.
|
|
62
|
+
*/
|
|
63
|
+
function actorMayCallTool(actor, name) {
|
|
64
|
+
if (actor?.kind !== "agent" || !Object.hasOwn(actor, "tools")) return true;
|
|
65
|
+
const tools = actor["tools"];
|
|
66
|
+
return Array.isArray(tools) && tools.some((tool) => typeof tool === "string" && tool === name);
|
|
67
|
+
}
|
|
68
|
+
function coversRequirements(tree, requires, delegation, resourceId, hasActor = false) {
|
|
69
|
+
return (requires ?? []).every((key) => {
|
|
70
|
+
const leaf = findPermission(tree, key);
|
|
71
|
+
return leaf !== void 0 && coveredByDelegation(leaf, delegation, resourceId, hasActor) === void 0;
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
function requiresStandIn(grant) {
|
|
75
|
+
return (grant.requires ?? []).length > 0 && annotationsFor(grant.permission).readOnlyHint && !flattenGrantee(grant.to).some((item) => item.kind === "role");
|
|
76
|
+
}
|
|
77
|
+
function accessCovers(permission, access, resourceId) {
|
|
78
|
+
if (access === void 0) return false;
|
|
79
|
+
return access.some((entry) => {
|
|
80
|
+
if (typeof entry === "string") return scopeNames(permission).includes(entry);
|
|
81
|
+
if (entry === null || typeof entry !== "object") return false;
|
|
82
|
+
const type = entry["type"];
|
|
83
|
+
if (typeof type !== "string" || !typeMatches(type, permission.resource)) return false;
|
|
84
|
+
const actions = entry["actions"];
|
|
85
|
+
if (actions !== void 0 && (!Array.isArray(actions) || !actions.includes(permission.action))) return false;
|
|
86
|
+
const identifier = entry["identifier"];
|
|
87
|
+
if (identifier !== void 0 && (typeof identifier !== "string" || identifier !== resourceId)) return false;
|
|
88
|
+
return true;
|
|
89
|
+
});
|
|
90
|
+
}
|
|
91
|
+
function typeMatches(type, resource) {
|
|
92
|
+
if (type === resource) return true;
|
|
93
|
+
return type.endsWith(`/${resource}`);
|
|
94
|
+
}
|
|
95
|
+
/**
|
|
96
|
+
* Whether the subject's principal is a `from` of the delegation: every item
|
|
97
|
+
* matches, with roles checked against the roles the principal holds here
|
|
98
|
+
* (`matchGrantee` leaves role holding to the caller) and nothing that needs a
|
|
99
|
+
* row.
|
|
100
|
+
*/
|
|
101
|
+
function handsOver(delegation, subject, heldRoles, now) {
|
|
102
|
+
const items = flattenGrantee(delegation.from);
|
|
103
|
+
if (items.length === 0 || subject.principal === null) return false;
|
|
104
|
+
return items.every((item) => {
|
|
105
|
+
if (item.kind === "role") return heldRoles.has(item.role);
|
|
106
|
+
if (item.kind === "relation") return false;
|
|
107
|
+
const match = matchGrantee(item, subject, now, void 0);
|
|
108
|
+
return match.matched && match.where === void 0;
|
|
109
|
+
});
|
|
110
|
+
}
|
|
111
|
+
/**
|
|
112
|
+
* The permission keys the policy's delegations let `subject.actor` use for
|
|
113
|
+
* `subject.principal` right now: the union over every active delegation whose
|
|
114
|
+
* `to` matches the actor and whose `from` the principal holds. `undefined` when
|
|
115
|
+
* none applies, so the call falls back to the token delegation alone. An actor
|
|
116
|
+
* with `readOnly: true` gets only each delegation's read-only keys. Attenuation
|
|
117
|
+
* only: a key here still needs a matching allow and no deny.
|
|
118
|
+
*/
|
|
119
|
+
function delegatedPermissions(delegations, subject, heldRoles, now) {
|
|
120
|
+
const actor = subject.actor;
|
|
121
|
+
if (actor === void 0 || delegations === void 0) return;
|
|
122
|
+
let keys;
|
|
123
|
+
for (const delegation of delegations) {
|
|
124
|
+
if (delegation.to.kind !== actor.kind || delegation.to.id !== void 0 && delegation.to.id !== actor.id || delegation.to.client !== void 0 && delegation.to.client !== actor.client || !isActive(delegation.validity, now) || !handsOver(delegation, subject, heldRoles, now)) continue;
|
|
125
|
+
keys ??= /* @__PURE__ */ new Set();
|
|
126
|
+
for (const key of actor.readOnly === true ? delegation.readOnly : delegation.permissions) keys.add(key);
|
|
127
|
+
}
|
|
128
|
+
return keys;
|
|
129
|
+
}
|
|
130
|
+
//#endregion
|
|
131
|
+
//#region src/core/row-pair.ts
|
|
132
|
+
function isRowPair(value) {
|
|
133
|
+
return value !== null && typeof value === "object" && "current" in value && "next" in value;
|
|
134
|
+
}
|
|
135
|
+
/**
|
|
136
|
+
* The row a `where` reads and the row a `check` reads. An instance check takes
|
|
137
|
+
* a `{ current, next }` pair or one row for both; a collection check has no
|
|
138
|
+
* current row, only the input it creates.
|
|
139
|
+
*/
|
|
140
|
+
function rowValues(permission, data) {
|
|
141
|
+
if (permission.kind === "collection") return {
|
|
142
|
+
current: void 0,
|
|
143
|
+
next: data
|
|
144
|
+
};
|
|
145
|
+
if (permission.kind === "instance" && isRowPair(data)) return {
|
|
146
|
+
current: data.current,
|
|
147
|
+
next: data.next
|
|
148
|
+
};
|
|
149
|
+
return {
|
|
150
|
+
current: data,
|
|
151
|
+
next: data
|
|
152
|
+
};
|
|
153
|
+
}
|
|
154
|
+
/**
|
|
155
|
+
* The row's id under `field` as a string, or `*` when the row has no string or
|
|
156
|
+
* number there.
|
|
157
|
+
*/
|
|
158
|
+
function rowIdOf(row, field = "id") {
|
|
159
|
+
if (row === null || typeof row !== "object" || !Object.hasOwn(row, field)) return "*";
|
|
160
|
+
const id = Reflect.get(row, field);
|
|
161
|
+
return typeof id === "string" || typeof id === "number" ? String(id) : "*";
|
|
162
|
+
}
|
|
163
|
+
//#endregion
|
|
164
|
+
//#region src/conditions/condition-evaluate.ts
|
|
13
165
|
function resolveRef(ref, subject) {
|
|
14
166
|
return resolveConditionRef(ref, subject);
|
|
15
167
|
}
|
|
@@ -140,156 +292,4 @@ function evaluateCondition(condition, data, subject, now = epochSeconds(), scope
|
|
|
140
292
|
}
|
|
141
293
|
}
|
|
142
294
|
//#endregion
|
|
143
|
-
|
|
144
|
-
function isRowPair(value) {
|
|
145
|
-
return value !== null && typeof value === "object" && "current" in value && "next" in value;
|
|
146
|
-
}
|
|
147
|
-
/**
|
|
148
|
-
* The row a `where` reads and the row a `check` reads. An instance check takes
|
|
149
|
-
* a `{ current, next }` pair or one row for both; a collection check has no
|
|
150
|
-
* current row, only the input it creates.
|
|
151
|
-
*/
|
|
152
|
-
function rowValues(permission, data) {
|
|
153
|
-
if (permission.kind === "collection") return {
|
|
154
|
-
current: void 0,
|
|
155
|
-
next: data
|
|
156
|
-
};
|
|
157
|
-
if (permission.kind === "instance" && isRowPair(data)) return {
|
|
158
|
-
current: data.current,
|
|
159
|
-
next: data.next
|
|
160
|
-
};
|
|
161
|
-
return {
|
|
162
|
-
current: data,
|
|
163
|
-
next: data
|
|
164
|
-
};
|
|
165
|
-
}
|
|
166
|
-
/**
|
|
167
|
-
* The row's id under `field` as a string, or `*` when the row has no string or
|
|
168
|
-
* number there.
|
|
169
|
-
*/
|
|
170
|
-
function rowIdOf(row, field = "id") {
|
|
171
|
-
if (row === null || typeof row !== "object" || !Object.hasOwn(row, field)) return "*";
|
|
172
|
-
const id = Reflect.get(row, field);
|
|
173
|
-
return typeof id === "string" || typeof id === "number" ? String(id) : "*";
|
|
174
|
-
}
|
|
175
|
-
//#endregion
|
|
176
|
-
//#region src/core/delegation.ts
|
|
177
|
-
/**
|
|
178
|
-
* The permission's scope and any scope it was renamed from: tokens issued
|
|
179
|
-
* before a rename keep working.
|
|
180
|
-
*/
|
|
181
|
-
function scopeNames(permission) {
|
|
182
|
-
return [permission.scope, ...formerScopes(permission)];
|
|
183
|
-
}
|
|
184
|
-
/**
|
|
185
|
-
* Whether a delegated caller may use a permission its principal holds, through
|
|
186
|
-
* OAuth `scopes`, RFC 9396 `authorizationDetails` or GNAP `access`. `undefined`
|
|
187
|
-
* means covered; otherwise the denial reason `decide` would add.
|
|
188
|
-
*/
|
|
189
|
-
function coveredByDelegation(permission, delegation, resourceId, hasActor = false) {
|
|
190
|
-
const unscoped = hasActor ? "no-delegation" : void 0;
|
|
191
|
-
if (delegation === void 0) return unscoped;
|
|
192
|
-
const hasScopes = delegation.scopes !== void 0;
|
|
193
|
-
const hasDetails = delegation.authorizationDetails !== void 0;
|
|
194
|
-
const hasAccess = delegation.access !== void 0;
|
|
195
|
-
if (!hasScopes && !hasDetails && !hasAccess) return unscoped;
|
|
196
|
-
const emptyScopes = hasScopes && (delegation.scopes?.length ?? 0) === 0;
|
|
197
|
-
const emptyAccess = hasAccess && (delegation.access?.length ?? 0) === 0;
|
|
198
|
-
if (emptyScopes && !hasDetails && !hasAccess) return "no-delegation";
|
|
199
|
-
if (emptyAccess && !hasScopes && !hasDetails) return "no-delegation";
|
|
200
|
-
if (emptyScopes && emptyAccess && !hasDetails) return "no-delegation";
|
|
201
|
-
const scopes = scopeNames(permission);
|
|
202
|
-
const scopeOk = delegation.scopes?.some((scope) => scopes.includes(scope)) ?? false;
|
|
203
|
-
const detailOk = delegation.authorizationDetails?.some((detail) => {
|
|
204
|
-
if (detail.type !== permission.resource) return false;
|
|
205
|
-
const identifier = detail["identifier"];
|
|
206
|
-
if (identifier !== void 0 && (typeof identifier !== "string" || identifier !== resourceId)) return false;
|
|
207
|
-
const actions = detail.actions;
|
|
208
|
-
if (actions === void 0) return true;
|
|
209
|
-
return Array.isArray(actions) && actions.includes(permission.action);
|
|
210
|
-
}) ?? false;
|
|
211
|
-
const accessOk = accessCovers(permission, delegation.access, resourceId);
|
|
212
|
-
if (scopeOk || detailOk || accessOk) return;
|
|
213
|
-
return "not-delegated";
|
|
214
|
-
}
|
|
215
|
-
/**
|
|
216
|
-
* A `readOnly` actor never uses a permission without `readOnlyHint`, delegated
|
|
217
|
-
* or not.
|
|
218
|
-
*/
|
|
219
|
-
function readOnlyActorRefuses(actor, permission) {
|
|
220
|
-
return actor?.readOnly === true && !annotationsFor(permission).readOnlyHint;
|
|
221
|
-
}
|
|
222
|
-
/**
|
|
223
|
-
* Whether an `agent` actor may call the tool `name`: its `tools` list names it.
|
|
224
|
-
* An agent without a `tools` list and any other actor kind are not restricted
|
|
225
|
-
* here; a `tools` value that is not a list of strings refuses every tool.
|
|
226
|
-
*/
|
|
227
|
-
function actorMayCallTool(actor, name) {
|
|
228
|
-
if (actor?.kind !== "agent" || !Object.hasOwn(actor, "tools")) return true;
|
|
229
|
-
const tools = actor["tools"];
|
|
230
|
-
return Array.isArray(tools) && tools.some((tool) => typeof tool === "string" && tool === name);
|
|
231
|
-
}
|
|
232
|
-
function coversRequirements(tree, requires, delegation, resourceId, hasActor = false) {
|
|
233
|
-
return (requires ?? []).every((key) => {
|
|
234
|
-
const leaf = findPermission(tree, key);
|
|
235
|
-
return leaf !== void 0 && coveredByDelegation(leaf, delegation, resourceId, hasActor) === void 0;
|
|
236
|
-
});
|
|
237
|
-
}
|
|
238
|
-
function requiresStandIn(grant) {
|
|
239
|
-
return (grant.requires ?? []).length > 0 && annotationsFor(grant.permission).readOnlyHint && !flattenGrantee(grant.to).some((item) => item.kind === "role");
|
|
240
|
-
}
|
|
241
|
-
function accessCovers(permission, access, resourceId) {
|
|
242
|
-
if (access === void 0) return false;
|
|
243
|
-
return access.some((entry) => {
|
|
244
|
-
if (typeof entry === "string") return scopeNames(permission).includes(entry);
|
|
245
|
-
if (entry === null || typeof entry !== "object") return false;
|
|
246
|
-
const type = entry["type"];
|
|
247
|
-
if (typeof type !== "string" || !typeMatches(type, permission.resource)) return false;
|
|
248
|
-
const actions = entry["actions"];
|
|
249
|
-
if (actions !== void 0 && (!Array.isArray(actions) || !actions.includes(permission.action))) return false;
|
|
250
|
-
const identifier = entry["identifier"];
|
|
251
|
-
if (identifier !== void 0 && (typeof identifier !== "string" || identifier !== resourceId)) return false;
|
|
252
|
-
return true;
|
|
253
|
-
});
|
|
254
|
-
}
|
|
255
|
-
function typeMatches(type, resource) {
|
|
256
|
-
if (type === resource) return true;
|
|
257
|
-
return type.endsWith(`/${resource}`);
|
|
258
|
-
}
|
|
259
|
-
/**
|
|
260
|
-
* Whether the subject's principal is a `from` of the delegation: every item
|
|
261
|
-
* matches, with roles checked against the roles the principal holds here
|
|
262
|
-
* (`matchGrantee` leaves role holding to the caller) and nothing that needs a
|
|
263
|
-
* row.
|
|
264
|
-
*/
|
|
265
|
-
function handsOver(delegation, subject, heldRoles, now) {
|
|
266
|
-
const items = flattenGrantee(delegation.from);
|
|
267
|
-
if (items.length === 0 || subject.principal === null) return false;
|
|
268
|
-
return items.every((item) => {
|
|
269
|
-
if (item.kind === "role") return heldRoles.has(item.role);
|
|
270
|
-
if (item.kind === "relation") return false;
|
|
271
|
-
const match = matchGrantee(item, subject, now, void 0);
|
|
272
|
-
return match.matched && match.where === void 0;
|
|
273
|
-
});
|
|
274
|
-
}
|
|
275
|
-
/**
|
|
276
|
-
* The permission keys the policy's delegations let `subject.actor` use for
|
|
277
|
-
* `subject.principal` right now: the union over every active delegation whose
|
|
278
|
-
* `to` matches the actor and whose `from` the principal holds. `undefined` when
|
|
279
|
-
* none applies, so the call falls back to the token delegation alone. An actor
|
|
280
|
-
* with `readOnly: true` gets only each delegation's read-only keys. Attenuation
|
|
281
|
-
* only: a key here still needs a matching allow and no deny.
|
|
282
|
-
*/
|
|
283
|
-
function delegatedPermissions(delegations, subject, heldRoles, now) {
|
|
284
|
-
const actor = subject.actor;
|
|
285
|
-
if (actor === void 0 || delegations === void 0) return;
|
|
286
|
-
let keys;
|
|
287
|
-
for (const delegation of delegations) {
|
|
288
|
-
if (delegation.to.kind !== actor.kind || delegation.to.id !== void 0 && delegation.to.id !== actor.id || delegation.to.client !== void 0 && delegation.to.client !== actor.client || !isActive(delegation.validity, now) || !handsOver(delegation, subject, heldRoles, now)) continue;
|
|
289
|
-
keys ??= /* @__PURE__ */ new Set();
|
|
290
|
-
for (const key of actor.readOnly === true ? delegation.readOnly : delegation.permissions) keys.add(key);
|
|
291
|
-
}
|
|
292
|
-
return keys;
|
|
293
|
-
}
|
|
294
|
-
//#endregion
|
|
295
|
-
export { readOnlyActorRefuses as a, rowIdOf as c, delegatedPermissions as i, rowValues as l, coveredByDelegation as n, requiresStandIn as o, coversRequirements as r, isRowPair as s, actorMayCallTool as t, evaluateCondition as u };
|
|
295
|
+
export { actorMayCallTool as a, delegatedPermissions as c, rowValues as i, readOnlyActorRefuses as l, isRowPair as n, coveredByDelegation as o, rowIdOf as r, coversRequirements as s, evaluateCondition as t, requiresStandIn as u };
|
|
@@ -10,7 +10,7 @@ const config = defineLeaf({
|
|
|
10
10
|
...failOnFlag
|
|
11
11
|
},
|
|
12
12
|
async run(ctx, { flags }) {
|
|
13
|
-
const { runConfig } = await import("./config-report-
|
|
13
|
+
const { runConfig } = await import("./config-report-Cg5Y5j0h.js");
|
|
14
14
|
return runConfig({
|
|
15
15
|
cwd: ctx.cwd,
|
|
16
16
|
config: ctx.config,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { r as isRecord } from "./compact-CAf557ZB.js";
|
|
2
2
|
import { i as configError, n as CliError } from "./errors-BhRkoNS7.js";
|
|
3
|
-
import {
|
|
4
|
-
import { a as isSection, i as isModuleKey, n as MODULE_KEYS, o as kindOf, r as describeKinds, t as CONFIG_SHAPE } from "./config-shape-
|
|
3
|
+
import { a as betterSupabaseInstalled, i as betterSupabaseDefaults, r as betterSupabaseConfig } from "./better-supabase-DF8f8oly.js";
|
|
4
|
+
import { a as isSection, i as isModuleKey, n as MODULE_KEYS, o as kindOf, r as describeKinds, t as CONFIG_SHAPE } from "./config-shape-C4zqzG2K.js";
|
|
5
5
|
import { existsSync } from "node:fs";
|
|
6
6
|
import { dirname, relative, resolve } from "node:path";
|
|
7
7
|
//#region src/cli/project/config-schema.ts
|
|
@@ -77,17 +77,19 @@ async function readConfig(cwd, fromFlag, options) {
|
|
|
77
77
|
file: void 0
|
|
78
78
|
};
|
|
79
79
|
if (!existsSync(path)) throw new CliError("usage", `PermDock CLI: config file not found: ${path}`, { code: "config_not_found" });
|
|
80
|
-
const { loadModule, pickNamed } = await import("./load-
|
|
80
|
+
const { loadModule, pickNamed } = await import("./load-DiBUJx77.js");
|
|
81
81
|
const mod = await loadModule(path, options);
|
|
82
82
|
const display = relative(cwd, path).replaceAll("\\", "/");
|
|
83
83
|
const raw = pickNamed(mod, ["default"]);
|
|
84
84
|
const parsed = parseConfig(hasModuleValue(raw) ? await traceValues(cwd, path, display, raw, options) : raw, display);
|
|
85
|
+
const lookup = {
|
|
86
|
+
cwd,
|
|
87
|
+
from: dirname(path),
|
|
88
|
+
...parsed.config.betterSupabase?.config === void 0 ? {} : { path: parsed.config.betterSupabase.config }
|
|
89
|
+
};
|
|
85
90
|
return {
|
|
86
91
|
...parsed,
|
|
87
|
-
config: betterSupabaseDefaults(parsed.config, await betterSupabaseConfig(
|
|
88
|
-
cwd,
|
|
89
|
-
from: dirname(path)
|
|
90
|
-
})),
|
|
92
|
+
config: betterSupabaseDefaults(parsed.config, await betterSupabaseConfig(lookup), betterSupabaseInstalled(lookup)),
|
|
91
93
|
file: path
|
|
92
94
|
};
|
|
93
95
|
}
|
|
@@ -95,7 +97,7 @@ function hasModuleValue(raw) {
|
|
|
95
97
|
return isRecord(raw) && Object.keys(MODULE_KEYS).some((key) => isRecord(raw[key]));
|
|
96
98
|
}
|
|
97
99
|
async function traceValues(cwd, file, display, config, options) {
|
|
98
|
-
const { traceModuleValues } = await import("./module-values-
|
|
100
|
+
const { traceModuleValues } = await import("./module-values-BLiVlO1X.js");
|
|
99
101
|
return traceModuleValues({
|
|
100
102
|
cwd,
|
|
101
103
|
file,
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { a as rel, t as defaultSrcPath } from "./files-BSjrtIHw.js";
|
|
2
2
|
import { r as CONFIG_REPORT_SCHEMA } from "./version-DMQ0dnN5.js";
|
|
3
3
|
import { t as catalogPath } from "./catalog-path-CnI0XTFK.js";
|
|
4
|
-
import { n as guessPermissions, t as barrelFile } from "./collect-
|
|
4
|
+
import { n as guessPermissions, t as barrelFile } from "./collect-Cr71JA7z.js";
|
|
5
5
|
import "./sources-C4vkzZJV.js";
|
|
6
|
-
import { t as DOCS_BASE } from "./manifest-
|
|
6
|
+
import { t as DOCS_BASE } from "./manifest-CbHnl4I_.js";
|
|
7
7
|
import { n as MIGRATION_DIRS, t as DEFAULT_SENSITIVE_ACTIONS } from "./constants-DcJABbLW.js";
|
|
8
8
|
//#region src/cli/config-report.ts
|
|
9
9
|
function configReport(input) {
|
|
@@ -19,7 +19,13 @@ const CONFIG_SHAPE = {
|
|
|
19
19
|
barrel: BOOLEAN_OR_STRING
|
|
20
20
|
},
|
|
21
21
|
catalog: { out: STRING },
|
|
22
|
-
openapi: {
|
|
22
|
+
openapi: {
|
|
23
|
+
doc: ARRAY,
|
|
24
|
+
operations: STRING,
|
|
25
|
+
tenantPaths: ARRAY,
|
|
26
|
+
base: STRING
|
|
27
|
+
},
|
|
28
|
+
betterSupabase: { config: STRING },
|
|
23
29
|
rls: {
|
|
24
30
|
tables: OBJECT,
|
|
25
31
|
dialect: STRING,
|
|
@@ -33,6 +39,7 @@ const CONFIG_SHAPE = {
|
|
|
33
39
|
verify: OBJECT,
|
|
34
40
|
tenantClaim: STRING,
|
|
35
41
|
scopeTypes: OBJECT,
|
|
42
|
+
idTypes: OBJECT,
|
|
36
43
|
roleClaim: STRING,
|
|
37
44
|
roleValues: OBJECT,
|
|
38
45
|
gucPrefix: STRING,
|
|
@@ -55,6 +62,7 @@ const CONFIG_SHAPE = {
|
|
|
55
62
|
roles: OBJECT,
|
|
56
63
|
actions: OBJECT,
|
|
57
64
|
helpersOnly: BOOLEAN,
|
|
65
|
+
memo: STRING,
|
|
58
66
|
rowHelpers: BOOLEAN_OR_ARRAY,
|
|
59
67
|
seeds: STRING,
|
|
60
68
|
treeValues: OBJECT,
|
|
@@ -93,7 +101,6 @@ const CONFIG_SHAPE = {
|
|
|
93
101
|
migrations: ARRAY,
|
|
94
102
|
claims: STRING,
|
|
95
103
|
srcPath: ARRAY,
|
|
96
|
-
sharedTables: ARRAY,
|
|
97
104
|
cacheHelpers: ARRAY,
|
|
98
105
|
ignore: ARRAY,
|
|
99
106
|
waivers: ARRAY
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { t as compact } from "./compact-CAf557ZB.js";
|
|
2
|
-
import { l as isPromiseLike } from "./store-options-
|
|
3
|
-
import { n as switchTenant, t as providerStore } from "./provider-store-
|
|
2
|
+
import { l as isPromiseLike } from "./store-options-CXv6BHH6.js";
|
|
3
|
+
import { n as switchTenant, t as providerStore } from "./provider-store-D4PU1my_.js";
|
|
4
4
|
import { getContext, onDestroy, setContext } from "svelte";
|
|
5
5
|
import { toStore } from "svelte/store";
|
|
6
6
|
//#region src/svelte/context.ts
|
package/dist/convex/index.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { D as Policy, N as PolicyVocabulary, yr as Principal } from "../policy-types-
|
|
2
|
-
import {
|
|
3
|
-
import { a as PermDock } from "../permdock-
|
|
4
|
-
import { a as ProblemDetails, r as PermDockDeniedError } from "../errors-
|
|
5
|
-
import { t as InstanceOptions } from "../instance-options-
|
|
1
|
+
import { D as Policy, N as PolicyVocabulary, yr as Principal } from "../policy-types-rNfz7t0M.js";
|
|
2
|
+
import { w as Permission } from "../vocabulary-DeZvUaTw.js";
|
|
3
|
+
import { a as PermDock } from "../permdock-BaB-KQqn.js";
|
|
4
|
+
import { a as ProblemDetails, r as PermDockDeniedError } from "../errors-D_JIQJYb.js";
|
|
5
|
+
import { t as InstanceOptions } from "../instance-options-C6gEDOts.js";
|
|
6
6
|
//#region src/convex/types.d.ts
|
|
7
7
|
type ConvexContextLike = {
|
|
8
8
|
readonly auth?: {
|
package/dist/convex/index.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { t as compact } from "../compact-CAf557ZB.js";
|
|
2
2
|
import { n as PermDockValidationError } from "../validation-error-CYg2kJEw.js";
|
|
3
3
|
import { n as PermDockDeniedError, t as PermDockApprovalRequiredError } from "../errors-ynga1EQy.js";
|
|
4
|
-
import {
|
|
5
|
-
import { n as resolveOrNull, t as buildInstance } from "../build-instance-CkRKgjSj.js";
|
|
4
|
+
import { r as withApp } from "../app-DIvM65Mv.js";
|
|
6
5
|
import { n as tenantScope, t as actorFrom } from "../adapter-context-OHikyRqV.js";
|
|
6
|
+
import { n as resolveOrNull, t as buildInstance } from "../build-instance-B0vsViF5.js";
|
|
7
7
|
//#region src/convex/create.ts
|
|
8
8
|
/**
|
|
9
9
|
* Convex's runtime sends `data` to the client only for an error carrying this
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { D as memoryCustomRoleSource } from "./src-BG9YJM3Q.js";
|
|
2
|
+
import { n as fromSnapshot } from "./from-snapshot-oR_N97dM.js";
|
|
2
3
|
import { c as listPermissions } from "./permission-registry-B8tYxPIt.js";
|
|
3
|
-
import { d as scopeList } from "./scopes-
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import { t as getPermDock } from "./permdock-DbAq8_Fp.js";
|
|
4
|
+
import { d as scopeList } from "./scopes-gdH__vDZ.js";
|
|
5
|
+
import { n as parseSnapshot } from "./snapshot-C2j96x97.js";
|
|
6
|
+
import { t as getPermDock } from "./permdock-B5LyNVgn.js";
|
|
7
|
+
import { y as membershipsClaim } from "./evaluate-B5yZHmts.js";
|
|
8
8
|
import "./budget-BBCPDOGP.js";
|
|
9
9
|
import { c as quoteSqlTable, n as defaultSqlCommand, o as quoteSqlIdent, t as SQL_IDENT } from "./sql-0WjxIp9g.js";
|
|
10
10
|
//#region src/testing/policy-matrix.ts
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { D as Policy, Yn as Decision, pr as CustomRole, vr as Membership } from "./policy-types-
|
|
2
|
-
import {
|
|
3
|
-
import { f as WhereResult, o as PermDockOptions } from "./permdock-
|
|
1
|
+
import { D as Policy, Yn as Decision, pr as CustomRole, vr as Membership } from "./policy-types-rNfz7t0M.js";
|
|
2
|
+
import { w as Permission } from "./vocabulary-DeZvUaTw.js";
|
|
3
|
+
import { f as WhereResult, o as PermDockOptions } from "./permdock-BaB-KQqn.js";
|
|
4
4
|
//#region src/testing/policy-matrix.d.ts
|
|
5
5
|
type MatrixOutcome = "granted" | "denied" | "approval-required";
|
|
6
6
|
type MatrixCell = MatrixOutcome | {
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
import { E as PermissionTree, w as Permission } from "./vocabulary-DeZvUaTw.js";
|
|
2
|
+
//#region src/openapi/operations.d.ts
|
|
3
|
+
/**
|
|
4
|
+
* One declared operation: a permission, or a permission with the operation id a
|
|
5
|
+
* tool name uses and the OAuth scopes that reach it, or only OAuth scopes for a
|
|
6
|
+
* route that checks no permission (`protect(null)`).
|
|
7
|
+
*/
|
|
8
|
+
type OperationEntry = Permission | {
|
|
9
|
+
readonly permission: Permission;
|
|
10
|
+
readonly operationId?: string;
|
|
11
|
+
readonly oauthScopes?: readonly string[];
|
|
12
|
+
} | {
|
|
13
|
+
readonly permission?: undefined;
|
|
14
|
+
readonly operationId?: string;
|
|
15
|
+
readonly oauthScopes: readonly string[];
|
|
16
|
+
};
|
|
17
|
+
/**
|
|
18
|
+
* The permission of each operation of an API, declared once and read by the
|
|
19
|
+
* HTTP gate and by `permdock/mcp`'s `permissionFor`, so a REST route and the
|
|
20
|
+
* MCP tool that calls it can never disagree.
|
|
21
|
+
*/
|
|
22
|
+
type OperationPermissions = {
|
|
23
|
+
/**
|
|
24
|
+
* The permission of a request: the declared operation whose method and path
|
|
25
|
+
* template match, a literal segment winning over a `{param}`. `undefined` for
|
|
26
|
+
* an undeclared operation, which a gate denies, and for an operation that
|
|
27
|
+
* declares only OAuth scopes. A `HEAD` request matches the `GET` entry of its
|
|
28
|
+
* path when no `HEAD` entry matches.
|
|
29
|
+
*/
|
|
30
|
+
forRequest: (method: string, path: string) => Permission | undefined;
|
|
31
|
+
/**
|
|
32
|
+
* The permission of an operation id; pass it as `permissionFor` when tool
|
|
33
|
+
* names are operation ids.
|
|
34
|
+
*/
|
|
35
|
+
forOperation: (id: string) => Permission | undefined;
|
|
36
|
+
oauthScopesForRequest: (method: string, path: string) => readonly string[] | undefined;
|
|
37
|
+
oauthScopesForOperation: (id: string) => readonly string[] | undefined;
|
|
38
|
+
/**
|
|
39
|
+
* Every declared operation in declaration order, with the key's method
|
|
40
|
+
* upper-cased and its path template as written. `testOperationCoverage` and
|
|
41
|
+
* `permdock doctor` (PD091) compare it with an OpenAPI document.
|
|
42
|
+
*/
|
|
43
|
+
entries: () => readonly OperationDeclaration[];
|
|
44
|
+
};
|
|
45
|
+
/** One declared operation as `OperationPermissions.entries()` lists it. */
|
|
46
|
+
type OperationDeclaration = {
|
|
47
|
+
readonly method: string;
|
|
48
|
+
readonly path: string;
|
|
49
|
+
readonly permission?: Permission;
|
|
50
|
+
readonly operationId?: string;
|
|
51
|
+
readonly oauthScopes?: readonly string[];
|
|
52
|
+
};
|
|
53
|
+
/** An OpenAPI operation `operationPermissionsFromOpenApi` read. */
|
|
54
|
+
type OpenApiOperationRef = {
|
|
55
|
+
readonly method: string;
|
|
56
|
+
readonly path: string;
|
|
57
|
+
readonly operationId?: string;
|
|
58
|
+
};
|
|
59
|
+
/** Why `operationPermissionsFromOpenApi` left an operation out. */
|
|
60
|
+
type OperationSkipCause = "no-permission" | "several-permissions" | "unknown-permission" | "invalid-extension";
|
|
61
|
+
/** Every skip cause, for a table or an exhaustive switch. */
|
|
62
|
+
declare const OPERATION_SKIP_CAUSES: readonly OperationSkipCause[];
|
|
63
|
+
/**
|
|
64
|
+
* Operations as `"METHOD /path/{param}"` keys, the OpenAPI path template, to a
|
|
65
|
+
* permission. `base` is a prefix requests carry and the keys do not
|
|
66
|
+
* (`/api/v1`). A key that is not a method and a path throws.
|
|
67
|
+
*/
|
|
68
|
+
declare function operationPermissions(operations: Readonly<Record<string, OperationEntry>>, options?: {
|
|
69
|
+
readonly base?: string;
|
|
70
|
+
}): OperationPermissions;
|
|
71
|
+
/**
|
|
72
|
+
* The operation permissions an OpenAPI document declares: every operation whose
|
|
73
|
+
* `x-permdock-permissions` names exactly one permission of `tree`, keyed by its
|
|
74
|
+
* method, path and `operationId`. An operation naming none, several or an
|
|
75
|
+
* unknown key is left out, so a gate denies it; `onSkip` hears each one with
|
|
76
|
+
* its cause.
|
|
77
|
+
*/
|
|
78
|
+
declare function operationPermissionsFromOpenApi(document: unknown, tree: PermissionTree, options?: {
|
|
79
|
+
readonly base?: string;
|
|
80
|
+
readonly onSkip?: (operation: OpenApiOperationRef, cause: OperationSkipCause) => void;
|
|
81
|
+
}): OperationPermissions;
|
|
82
|
+
//#endregion
|
|
83
|
+
//#region src/openapi/coverage.d.ts
|
|
84
|
+
type OperationCoverageOptions = {
|
|
85
|
+
/**
|
|
86
|
+
* Path templates whose operations act on a tenant, such as `/orgs/{orgId}`.
|
|
87
|
+
* An operation under one needs an entry; others may go undeclared. A
|
|
88
|
+
* `{param}` matches any parameter name.
|
|
89
|
+
*/
|
|
90
|
+
readonly tenantPaths: readonly string[];
|
|
91
|
+
/** A prefix the document's paths carry and the declared keys do not. */
|
|
92
|
+
readonly base?: string;
|
|
93
|
+
};
|
|
94
|
+
type OperationCoverage = {
|
|
95
|
+
/**
|
|
96
|
+
* Tenant-path operations of the document with no declared entry, as `METHOD
|
|
97
|
+
* /path`.
|
|
98
|
+
*/
|
|
99
|
+
readonly undeclared: readonly string[];
|
|
100
|
+
/**
|
|
101
|
+
* Declared entries that match no operation of the document, as `METHOD
|
|
102
|
+
* /path`.
|
|
103
|
+
*/
|
|
104
|
+
readonly stale: readonly string[];
|
|
105
|
+
};
|
|
106
|
+
/**
|
|
107
|
+
* Compares the declared operations with an OpenAPI document: a tenant-path
|
|
108
|
+
* operation with no entry is `undeclared` (a gate denies it), an entry that
|
|
109
|
+
* matches no operation is `stale`. `testOperationCoverage` and `permdock
|
|
110
|
+
* doctor` (PD091) run this one function.
|
|
111
|
+
*/
|
|
112
|
+
declare function operationCoverage(operations: OperationPermissions, document: unknown, options: OperationCoverageOptions): OperationCoverage;
|
|
113
|
+
//#endregion
|
|
114
|
+
export { OpenApiOperationRef as a, OperationPermissions as c, operationPermissionsFromOpenApi as d, OPERATION_SKIP_CAUSES as i, OperationSkipCause as l, OperationCoverageOptions as n, OperationDeclaration as o, operationCoverage as r, OperationEntry as s, OperationCoverage as t, operationPermissions as u };
|