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
package/dist/next/index.js
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import { t as compact } from "../compact-CAf557ZB.js";
|
|
2
2
|
import { n as PermDockValidationError } from "../validation-error-CYg2kJEw.js";
|
|
3
3
|
import { o as statusProblem, t as notFoundDetails } from "../problem-details-CLDgX1KV.js";
|
|
4
|
+
import { a as permissionStates } from "../checks-fyDOhcz0.js";
|
|
4
5
|
import { n as isThenable } from "../thenable-BNSM1U2R.js";
|
|
5
6
|
import { n as resourceRef } from "../resource-ref-CaS9yVPi.js";
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import { n as
|
|
7
|
+
import { r as withApp } from "../app-DIvM65Mv.js";
|
|
8
|
+
import { n as wrapPermDock } from "../wrap-BKU5Arsu.js";
|
|
9
|
+
import { n as resolveOrNull, t as buildInstance } from "../build-instance-B0vsViF5.js";
|
|
10
|
+
import { n as NO_GRANT, t as LOAD_FAILED } from "../decision-CaG5_eNJ.js";
|
|
9
11
|
import { i as decisionProblem } from "../problem-BWP1l86g.js";
|
|
10
|
-
import {
|
|
12
|
+
import { o as evaluationsHandler } from "../evaluations-BzTDWO4m.js";
|
|
13
|
+
import { s as resumeDecision } from "../helpers-DzBIfL1N.js";
|
|
11
14
|
import { i as snapshotTag, n as snapshotHeaders, r as snapshotKey, t as cacheLifeFor } from "../snapshot-cache-B66h7FBK.js";
|
|
12
|
-
import { n as resolveOrNull, t as buildInstance } from "../build-instance-CkRKgjSj.js";
|
|
13
|
-
import { n as NO_GRANT, t as LOAD_FAILED } from "../decision-CaG5_eNJ.js";
|
|
14
|
-
import { o as evaluationsHandler } from "../evaluations-CNMVJVD6.js";
|
|
15
15
|
import { cache } from "react";
|
|
16
16
|
import { jsx } from "react/jsx-runtime";
|
|
17
17
|
import { forbidden, unauthorized, unstable_rethrow } from "#next/navigation";
|
|
@@ -51,22 +51,43 @@ function invalidInput(permission, issues) {
|
|
|
51
51
|
message: `${permission.key}: ${issues.map((issue) => issue.message).join("; ")}.`
|
|
52
52
|
}).toProblemDetails());
|
|
53
53
|
}
|
|
54
|
+
/** Prefixes each issue path with the argument's position. */
|
|
55
|
+
function argIssues(index, issues) {
|
|
56
|
+
return issues.map((issue) => ({
|
|
57
|
+
message: issue.message,
|
|
58
|
+
path: [index, ...issue.path ?? []]
|
|
59
|
+
}));
|
|
60
|
+
}
|
|
61
|
+
async function parseArgs(schemas, values) {
|
|
62
|
+
const results = await Promise.all(schemas.map((schema, index) => parseInput(schema, values[index])));
|
|
63
|
+
const parsed = [];
|
|
64
|
+
for (const [index, result] of results.entries()) {
|
|
65
|
+
if (result.issues !== void 0) return { issues: plainIssues(argIssues(index, result.issues)) };
|
|
66
|
+
parsed.push(result.value);
|
|
67
|
+
}
|
|
68
|
+
return { value: parsed };
|
|
69
|
+
}
|
|
54
70
|
/**
|
|
55
|
-
* `protectAction(permission, { input, data?, tenant? })(handler
|
|
56
|
-
* the input, loads the row, decides, then
|
|
57
|
-
* including a throw, is a Problem Details
|
|
58
|
-
* interrupts leaves as an exception.
|
|
71
|
+
* `protectAction(permission, { input, args?, data?, tenant? })(handler,
|
|
72
|
+
* hooks?)`: validates the arguments and the input, loads the row, decides, then
|
|
73
|
+
* runs the handler. Every refusal, including a throw, is a Problem Details
|
|
74
|
+
* result; nothing but Next.js interrupts leaves as an exception.
|
|
59
75
|
*/
|
|
60
76
|
function protectActionOf(deps) {
|
|
61
|
-
|
|
62
|
-
const
|
|
77
|
+
const protect = (permission, options) => (handler, hooks) => async (...call) => {
|
|
78
|
+
const schemas = options.args ?? [];
|
|
79
|
+
const parsedArgs = await parseArgs(schemas, call);
|
|
80
|
+
if ("issues" in parsedArgs) return invalidInput(permission, parsedArgs.issues);
|
|
81
|
+
const args = Object.freeze(parsedArgs.value);
|
|
82
|
+
const parsed = await parseInput(options.input, call[schemas.length]);
|
|
63
83
|
if (parsed.issues !== void 0) return invalidInput(permission, parsed.issues);
|
|
64
84
|
const input = parsed.value;
|
|
85
|
+
const approval = approvalOf(call[schemas.length + 1]);
|
|
65
86
|
let permdock;
|
|
66
87
|
let data;
|
|
67
88
|
try {
|
|
68
89
|
permdock = await deps.getPermDock(compact({
|
|
69
|
-
tenant: options.tenant?.(input),
|
|
90
|
+
tenant: options.tenant?.(input, args),
|
|
70
91
|
intent: "write"
|
|
71
92
|
}));
|
|
72
93
|
} catch (error) {
|
|
@@ -75,7 +96,7 @@ function protectActionOf(deps) {
|
|
|
75
96
|
}
|
|
76
97
|
if (options.data !== void 0) {
|
|
77
98
|
try {
|
|
78
|
-
data = await options.data(input) ?? void 0;
|
|
99
|
+
data = await options.data(input, args) ?? void 0;
|
|
79
100
|
} catch (error) {
|
|
80
101
|
deps.rethrow(error);
|
|
81
102
|
return refused(decisionProblem(LOAD_FAILED, permission));
|
|
@@ -94,23 +115,35 @@ function protectActionOf(deps) {
|
|
|
94
115
|
store: deps.store,
|
|
95
116
|
resource: resourceRef(permission, data),
|
|
96
117
|
adapter: "next",
|
|
97
|
-
token:
|
|
118
|
+
token: approval
|
|
98
119
|
});
|
|
99
120
|
if (decision.outcome !== "granted") return refused(decisionProblem(decision, permission, compact({ disclosure: data === void 0 ? void 0 : deps.policy.resources.get(permission.resource)?.disclosure })));
|
|
121
|
+
const context = {
|
|
122
|
+
permdock,
|
|
123
|
+
decision,
|
|
124
|
+
data,
|
|
125
|
+
args
|
|
126
|
+
};
|
|
100
127
|
try {
|
|
128
|
+
const result = await handler(input, context);
|
|
129
|
+
await hooks?.after?.(decision, {
|
|
130
|
+
...context,
|
|
131
|
+
result
|
|
132
|
+
});
|
|
101
133
|
return {
|
|
102
134
|
ok: true,
|
|
103
|
-
value: await
|
|
104
|
-
permdock,
|
|
105
|
-
decision,
|
|
106
|
-
data
|
|
107
|
-
})
|
|
135
|
+
value: hooks?.result === void 0 ? result : await hooks.result(result, context)
|
|
108
136
|
};
|
|
109
137
|
} catch (error) {
|
|
110
138
|
deps.rethrow(error);
|
|
111
139
|
return refused(statusProblem(500, `${permission.key}: the action failed`));
|
|
112
140
|
}
|
|
113
141
|
};
|
|
142
|
+
return protect;
|
|
143
|
+
}
|
|
144
|
+
function approvalOf(call) {
|
|
145
|
+
if (typeof call !== "object" || call === null || !("approval" in call)) return;
|
|
146
|
+
return typeof call.approval === "string" ? call.approval : void 0;
|
|
114
147
|
}
|
|
115
148
|
//#endregion
|
|
116
149
|
//#region src/next/provider.tsx
|
package/dist/next/plugin.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { s as PermDockPluginOptions } from "../types-
|
|
1
|
+
import { s as PermDockPluginOptions } from "../types-cNZhj0UF.js";
|
|
2
2
|
//#region src/cli/plugin.d.ts
|
|
3
3
|
/** Any object: Next's `NextConfig` is an interface, so no index signature. */
|
|
4
4
|
type NextConfigLike = object;
|
package/dist/next/plugin.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { a as describeError } from "../errors-BhRkoNS7.js";
|
|
2
|
-
import { n as createCollectScheduler, r as report, t as collectOnce } from "../watch-
|
|
2
|
+
import { n as createCollectScheduler, r as report, t as collectOnce } from "../watch-BigZ260i.js";
|
|
3
3
|
//#region src/cli/plugin.ts
|
|
4
4
|
const PHASE_BUILD = "phase-production-build";
|
|
5
5
|
const PHASE_DEV = "phase-development-server";
|
package/dist/node/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 { f as InvalidSignatureError, i as OpenApiHooks, o as ProtectOptions, r as Guard, s as ScopeGuard, v as discoverViaSignatureAgent, x as webBotAuthVerifier } from "../server-types
|
|
5
|
-
import { t as ServerAdapterOptions } from "../bind-
|
|
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 { f as InvalidSignatureError, i as OpenApiHooks, o as ProtectOptions, r as Guard, s as ScopeGuard, v as discoverViaSignatureAgent, x as webBotAuthVerifier } from "../server-types--_Hann81.js";
|
|
5
|
+
import { t as ServerAdapterOptions } from "../bind-CnOMjazH.js";
|
|
6
6
|
import { i as toRequest, n as isServerResponse, r as sendResponse, t as NodeRequest } from "../http-B_LphE5Y.js";
|
|
7
7
|
import { IncomingMessage, ServerResponse } from "node:http";
|
|
8
8
|
//#region src/node/create.d.ts
|
package/dist/node/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { r as bindKernel } from "../bind-
|
|
1
|
+
import { f as InvalidSignatureError, g as webBotAuthVerifier, p as discoverViaSignatureAgent } from "../evaluations-BzTDWO4m.js";
|
|
2
|
+
import { r as bindKernel } from "../bind-B4Z0U2Gr.js";
|
|
3
3
|
import { n as sendResponse, r as toRequest, t as isServerResponse } from "../http-DH94eh6f.js";
|
|
4
4
|
//#region src/node/create.ts
|
|
5
5
|
const nodeRequest = (req) => req;
|
package/dist/openai/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 { u as ApprovalRequest } from "../types-
|
|
5
|
-
import { o as AgentAdapterOptions, t as AgentPermDock } from "../create-
|
|
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 { u as ApprovalRequest } from "../types-ZfjQB0KC.js";
|
|
5
|
+
import { o as AgentAdapterOptions, t as AgentPermDock } from "../create-oMCcZV4X.js";
|
|
6
6
|
//#region src/openai/create.d.ts
|
|
7
7
|
/** The app context passed to `run(agent, input, { context })`. */
|
|
8
8
|
type OpenAiContext = {
|
package/dist/openai/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { t as compact } from "../compact-CAf557ZB.js";
|
|
2
|
-
import {
|
|
3
|
-
import { t as approvalTokenOf } from "../kernel-
|
|
4
|
-
import { t as agentRuntime } from "../create-
|
|
2
|
+
import { r as withApp } from "../app-DIvM65Mv.js";
|
|
3
|
+
import { t as approvalTokenOf } from "../kernel-NmxiWII2.js";
|
|
4
|
+
import { t as agentRuntime } from "../create-BJ2_8NDO.js";
|
|
5
5
|
//#region src/openai/create.ts
|
|
6
6
|
function appContext(runContext) {
|
|
7
7
|
const context = runContext?.context;
|
package/dist/openapi/index.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { D as Policy, Er as Condition, yr as Principal } from "../policy-types-
|
|
2
|
-
import {
|
|
3
|
-
import { a as ProblemDetails } from "../errors-
|
|
1
|
+
import { D as Policy, Er as Condition, yr as Principal } from "../policy-types-rNfz7t0M.js";
|
|
2
|
+
import { w as Permission } from "../vocabulary-DeZvUaTw.js";
|
|
3
|
+
import { a as ProblemDetails } from "../errors-D_JIQJYb.js";
|
|
4
|
+
import { a as OpenApiOperationRef, c as OperationPermissions, d as operationPermissionsFromOpenApi, i as OPERATION_SKIP_CAUSES, l as OperationSkipCause, n as OperationCoverageOptions, o as OperationDeclaration, r as operationCoverage, s as OperationEntry, t as OperationCoverage, u as operationPermissions } from "../coverage-D8jBJdgD.js";
|
|
4
5
|
import { StandardJSONSchemaV1, StandardSchemaV1 } from "@standard-schema/spec";
|
|
5
6
|
//#region src/openapi/types.d.ts
|
|
6
7
|
type OpenApiTarget = "3.1" | "3.2" | "3.3";
|
|
@@ -98,61 +99,6 @@ export declare function securitySchemesOf(policy: Policy, options: OpenApiPermDo
|
|
|
98
99
|
export declare function catalogOf(options: OpenApiPermDockOptions, extraDrafts?: Readonly<Record<string, string>>): Record<string, unknown>;
|
|
99
100
|
export declare function openapiVersion(target: OpenApiTarget): string;
|
|
100
101
|
//#endregion
|
|
101
|
-
//#region src/openapi/operations.d.ts
|
|
102
|
-
/**
|
|
103
|
-
* One declared operation: a permission, or a permission with the operation id a
|
|
104
|
-
* tool name uses and the OAuth scopes that reach it, or only OAuth scopes for a
|
|
105
|
-
* route that checks no permission (`protect(null)`).
|
|
106
|
-
*/
|
|
107
|
-
type OperationEntry = Permission | {
|
|
108
|
-
readonly permission: Permission;
|
|
109
|
-
readonly operationId?: string;
|
|
110
|
-
readonly oauthScopes?: readonly string[];
|
|
111
|
-
} | {
|
|
112
|
-
readonly permission?: undefined;
|
|
113
|
-
readonly operationId?: string;
|
|
114
|
-
readonly oauthScopes: readonly string[];
|
|
115
|
-
};
|
|
116
|
-
/**
|
|
117
|
-
* The permission of each operation of an API, declared once and read by the
|
|
118
|
-
* HTTP gate and by `permdock/mcp`'s `permissionFor`, so a REST route and the
|
|
119
|
-
* MCP tool that calls it can never disagree.
|
|
120
|
-
*/
|
|
121
|
-
type OperationPermissions = {
|
|
122
|
-
/**
|
|
123
|
-
* The permission of a request: the declared operation whose method and path
|
|
124
|
-
* template match, a literal segment winning over a `{param}`. `undefined` for
|
|
125
|
-
* an undeclared operation, which a gate denies, and for an operation that
|
|
126
|
-
* declares only OAuth scopes. A `HEAD` request matches the `GET` entry of its
|
|
127
|
-
* path when no `HEAD` entry matches.
|
|
128
|
-
*/
|
|
129
|
-
forRequest: (method: string, path: string) => Permission | undefined;
|
|
130
|
-
/**
|
|
131
|
-
* The permission of an operation id; pass it as `permissionFor` when tool
|
|
132
|
-
* names are operation ids.
|
|
133
|
-
*/
|
|
134
|
-
forOperation: (id: string) => Permission | undefined;
|
|
135
|
-
oauthScopesForRequest: (method: string, path: string) => readonly string[] | undefined;
|
|
136
|
-
oauthScopesForOperation: (id: string) => readonly string[] | undefined;
|
|
137
|
-
};
|
|
138
|
-
/**
|
|
139
|
-
* Operations as `"METHOD /path/{param}"` keys, the OpenAPI path template, to a
|
|
140
|
-
* permission. `base` is a prefix requests carry and the keys do not
|
|
141
|
-
* (`/api/v1`). A key that is not a method and a path throws.
|
|
142
|
-
*/
|
|
143
|
-
export declare function operationPermissions(operations: Readonly<Record<string, OperationEntry>>, options?: {
|
|
144
|
-
readonly base?: string;
|
|
145
|
-
}): OperationPermissions;
|
|
146
|
-
/**
|
|
147
|
-
* The operation permissions an OpenAPI document declares: every operation whose
|
|
148
|
-
* `x-permdock-permissions` names exactly one permission of `tree`, keyed by its
|
|
149
|
-
* method, path and `operationId`. An operation naming none, several or an
|
|
150
|
-
* unknown key is left out, so a gate denies it.
|
|
151
|
-
*/
|
|
152
|
-
export declare function operationPermissionsFromOpenApi(document: unknown, tree: PermissionTree, options?: {
|
|
153
|
-
readonly base?: string;
|
|
154
|
-
}): OperationPermissions;
|
|
155
|
-
//#endregion
|
|
156
102
|
//#region src/openapi/problem-details.d.ts
|
|
157
103
|
/**
|
|
158
104
|
* The Problem Details body the adapters send on a denial, as a Standard Schema
|
|
@@ -204,4 +150,4 @@ export declare function securityFor(permission: Permission | readonly Permission
|
|
|
204
150
|
export declare function securityFor(permission: Permission | readonly Permission[], options?: SecurityForOptions): SecurityFor;
|
|
205
151
|
export declare function securityFor(permission: Permission | readonly Permission[], options?: SecurityForOptions | SecurityExtensionOptions): SecurityFor | SecurityExtensionFor;
|
|
206
152
|
//#endregion
|
|
207
|
-
export type
|
|
153
|
+
export { OPERATION_SKIP_CAUSES, type OpenApiDescribe, type OpenApiDocsHints, type OpenApiFactory, type OpenApiOperationRef, type OpenApiOverlayOptions, type OpenApiPermDock, type OpenApiPermDockOptions, type OpenApiSchemeOptions, type OpenApiSecurityRequirement, type OpenApiTarget, type OperationCoverage, type OperationCoverageOptions, type OperationDeclaration, type OperationEntry, type OperationPermissions, type OperationSkipCause, type OverlayOperation, type OverlayVersion, type SchemeType, type SecurityExtensionFor, type SecurityExtensionOptions, type SecurityFor, type SecurityForOptions, type SecurityProfileName, operationCoverage, operationPermissions, operationPermissionsFromOpenApi };
|
package/dist/openapi/index.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
import { n as GNAP_RESERVED, r as PROFILE_NAMES, t as DRAFT_PINS } from "../pins-nqarl3oE.js";
|
|
2
|
-
import { a as
|
|
3
|
-
|
|
2
|
+
import { a as catalogOf, i as createPermDock, n as securityFor, o as openapiVersion, r as problemDetails, s as securitySchemesOf, t as permissionsExtension } from "../openapi-Cc-aS9xC.js";
|
|
3
|
+
import { i as operationPermissionsFromOpenApi, n as OPERATION_SKIP_CAUSES, r as operationPermissions, t as operationCoverage } from "../coverage-Dh2W_DmF.js";
|
|
4
|
+
export { DRAFT_PINS, GNAP_RESERVED, OPERATION_SKIP_CAUSES, PROFILE_NAMES, catalogOf, createPermDock, openapiVersion, operationCoverage, operationPermissions, operationPermissionsFromOpenApi, permissionsExtension, problemDetails, securityFor, securitySchemesOf };
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { r as isRecord } from "./compact-CAf557ZB.js";
|
|
2
2
|
import { a as getResource, n as findPermission } from "./permission-registry-B8tYxPIt.js";
|
|
3
|
-
import { r as definePolicy } from "./policy-
|
|
3
|
+
import { r as definePolicy } from "./policy-wGzbAPQF.js";
|
|
4
4
|
import { i as configError } from "./errors-BhRkoNS7.js";
|
|
5
5
|
import { i as readJsonFile, s as writeFileEnsuringDir } from "./files-BSjrtIHw.js";
|
|
6
|
-
import { a as loadModule, n as asPolicy, s as pickNamed, t as asPermissionTree } from "./load-
|
|
6
|
+
import { a as loadModule, n as asPolicy, s as pickNamed, t as asPermissionTree } from "./load-C4p4VgwR.js";
|
|
7
7
|
import { t as shortDiff } from "./text-diff-BtfSmdUo.js";
|
|
8
|
-
import {
|
|
8
|
+
import { i as createPermDock, o as openapiVersion } from "./openapi-Cc-aS9xC.js";
|
|
9
9
|
import { i as fileDrift } from "./output-files-CM0BnH05.js";
|
|
10
|
-
import { n as validateOverlay, t as validateOpenapi } from "./schema-
|
|
10
|
+
import { n as validateOverlay, t as validateOpenapi } from "./schema-B_HsJKm2.js";
|
|
11
11
|
import { existsSync } from "node:fs";
|
|
12
12
|
import { resolve } from "node:path";
|
|
13
13
|
//#region src/cli/openapi/openapi.ts
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { c as listPermissions,
|
|
3
|
-
import { r as sha256Digest } from "./sha256-C-4WXKIu.js";
|
|
1
|
+
import { t as compact } from "./compact-CAf557ZB.js";
|
|
2
|
+
import { c as listPermissions, o as isPermission } from "./permission-registry-B8tYxPIt.js";
|
|
4
3
|
import { t as requiresApproval } from "./approval-required-TzNB9oQA.js";
|
|
4
|
+
import { r as sha256Digest } from "./sha256-C-4WXKIu.js";
|
|
5
5
|
import { i as PROFILE_PARAMETERS, n as GNAP_RESERVED, r as PROFILE_NAMES, t as DRAFT_PINS } from "./pins-nqarl3oE.js";
|
|
6
6
|
//#region src/openapi/emit.ts
|
|
7
7
|
function assertScheme(options) {
|
|
@@ -31,7 +31,7 @@ function mergeRecord(base, extra) {
|
|
|
31
31
|
for (const [key, value] of Object.entries(extra)) result[key] = value;
|
|
32
32
|
return result;
|
|
33
33
|
}
|
|
34
|
-
function scopesOf
|
|
34
|
+
function scopesOf(policy) {
|
|
35
35
|
const scopes = {};
|
|
36
36
|
for (const leaf of listPermissions(policy.permissions)) scopes[leaf.scope] = leaf.meta.description ?? leaf.meta.title ?? leaf.key;
|
|
37
37
|
return scopes;
|
|
@@ -42,7 +42,7 @@ function flowWithScopes(flow, scopes) {
|
|
|
42
42
|
function securitySchemesOf(policy, options) {
|
|
43
43
|
assertScheme(options);
|
|
44
44
|
const target = options.target ?? "3.2";
|
|
45
|
-
const scopes = scopesOf
|
|
45
|
+
const scopes = scopesOf(policy);
|
|
46
46
|
const name = options.scheme.name;
|
|
47
47
|
if (options.scheme.ref !== void 0 && target !== "3.1") return { [name]: { $ref: options.scheme.ref } };
|
|
48
48
|
const flowsIn = options.scheme.flows ?? { authorizationCode: {} };
|
|
@@ -309,135 +309,6 @@ const createPermDock = (policy, options) => {
|
|
|
309
309
|
};
|
|
310
310
|
};
|
|
311
311
|
//#endregion
|
|
312
|
-
//#region src/openapi/operations.ts
|
|
313
|
-
const METHODS = /* @__PURE__ */ new Set([
|
|
314
|
-
"GET",
|
|
315
|
-
"PUT",
|
|
316
|
-
"POST",
|
|
317
|
-
"DELETE",
|
|
318
|
-
"OPTIONS",
|
|
319
|
-
"HEAD",
|
|
320
|
-
"PATCH",
|
|
321
|
-
"TRACE",
|
|
322
|
-
"QUERY"
|
|
323
|
-
]);
|
|
324
|
-
function segmentsOf(path) {
|
|
325
|
-
return path.split("/").filter((segment) => segment !== "");
|
|
326
|
-
}
|
|
327
|
-
function isParam(segment) {
|
|
328
|
-
return segment.startsWith("{") && segment.endsWith("}");
|
|
329
|
-
}
|
|
330
|
-
/**
|
|
331
|
-
* The number of literal segments that match, or -1 when the template does not
|
|
332
|
-
* match.
|
|
333
|
-
*/
|
|
334
|
-
function score(route, segments) {
|
|
335
|
-
if (route.segments.length !== segments.length) return -1;
|
|
336
|
-
let literal = 0;
|
|
337
|
-
for (const [index, segment] of route.segments.entries()) {
|
|
338
|
-
if (isParam(segment)) continue;
|
|
339
|
-
if (segment !== segments[index]) return -1;
|
|
340
|
-
literal += 1;
|
|
341
|
-
}
|
|
342
|
-
return literal;
|
|
343
|
-
}
|
|
344
|
-
function isEntryObject(entry) {
|
|
345
|
-
return !isPermission(entry);
|
|
346
|
-
}
|
|
347
|
-
function scopesOf(key, entry) {
|
|
348
|
-
if (!isEntryObject(entry) || entry.oauthScopes === void 0) return;
|
|
349
|
-
const scopes = entry.oauthScopes;
|
|
350
|
-
if (scopes.length === 0 || !scopes.every((scope) => typeof scope === "string" && scope !== "")) throw new TypeError(`PermDock: operation '${key}' sets oauthScopes, which must be a non-empty list of scope names`);
|
|
351
|
-
return Object.freeze([...entry.oauthScopes]);
|
|
352
|
-
}
|
|
353
|
-
/**
|
|
354
|
-
* Operations as `"METHOD /path/{param}"` keys, the OpenAPI path template, to a
|
|
355
|
-
* permission. `base` is a prefix requests carry and the keys do not
|
|
356
|
-
* (`/api/v1`). A key that is not a method and a path throws.
|
|
357
|
-
*/
|
|
358
|
-
function operationPermissions(operations, options = {}) {
|
|
359
|
-
const routes = [];
|
|
360
|
-
const byId = /* @__PURE__ */ new Map();
|
|
361
|
-
for (const [key, entry] of Object.entries(operations)) {
|
|
362
|
-
const space = key.indexOf(" ");
|
|
363
|
-
const method = key.slice(0, space).toUpperCase();
|
|
364
|
-
const path = key.slice(space + 1).trim();
|
|
365
|
-
if (space <= 0 || !METHODS.has(method) || !path.startsWith("/")) throw new TypeError(`PermDock: operation '${key}' must be a method and a path, such as 'GET /customers/{id}'`);
|
|
366
|
-
const oauthScopes = scopesOf(key, entry);
|
|
367
|
-
if (isEntryObject(entry) && (entry.permission === void 0 ? oauthScopes === void 0 : !isPermission(entry.permission))) throw new TypeError(`PermDock: operation '${key}' needs a permission, oauthScopes or both`);
|
|
368
|
-
const route = {
|
|
369
|
-
method,
|
|
370
|
-
segments: segmentsOf(path),
|
|
371
|
-
permission: isEntryObject(entry) ? entry.permission : entry,
|
|
372
|
-
...oauthScopes === void 0 ? {} : { oauthScopes }
|
|
373
|
-
};
|
|
374
|
-
routes.push(route);
|
|
375
|
-
if (isEntryObject(entry) && entry.operationId !== void 0) byId.set(entry.operationId, route);
|
|
376
|
-
}
|
|
377
|
-
const base = segmentsOf(options.base ?? "");
|
|
378
|
-
const matchMethod = (upper, path) => {
|
|
379
|
-
const full = segmentsOf(path.split("?")[0] ?? "");
|
|
380
|
-
if (base.some((segment, index) => full[index] !== segment)) return;
|
|
381
|
-
const segments = full.slice(base.length);
|
|
382
|
-
let best;
|
|
383
|
-
let bestScore = -1;
|
|
384
|
-
for (const route of routes) {
|
|
385
|
-
if (route.method !== upper) continue;
|
|
386
|
-
const value = score(route, segments);
|
|
387
|
-
if (value > bestScore) {
|
|
388
|
-
best = route;
|
|
389
|
-
bestScore = value;
|
|
390
|
-
}
|
|
391
|
-
}
|
|
392
|
-
return best;
|
|
393
|
-
};
|
|
394
|
-
const match = (method, path) => {
|
|
395
|
-
const upper = method.toUpperCase();
|
|
396
|
-
const route = matchMethod(upper, path);
|
|
397
|
-
return route === void 0 && upper === "HEAD" ? matchMethod("GET", path) : route;
|
|
398
|
-
};
|
|
399
|
-
return {
|
|
400
|
-
forRequest(method, path) {
|
|
401
|
-
return match(method, path)?.permission;
|
|
402
|
-
},
|
|
403
|
-
forOperation(id) {
|
|
404
|
-
return byId.get(id)?.permission;
|
|
405
|
-
},
|
|
406
|
-
oauthScopesForRequest(method, path) {
|
|
407
|
-
return match(method, path)?.oauthScopes;
|
|
408
|
-
},
|
|
409
|
-
oauthScopesForOperation(id) {
|
|
410
|
-
return byId.get(id)?.oauthScopes;
|
|
411
|
-
}
|
|
412
|
-
};
|
|
413
|
-
}
|
|
414
|
-
/**
|
|
415
|
-
* The operation permissions an OpenAPI document declares: every operation whose
|
|
416
|
-
* `x-permdock-permissions` names exactly one permission of `tree`, keyed by its
|
|
417
|
-
* method, path and `operationId`. An operation naming none, several or an
|
|
418
|
-
* unknown key is left out, so a gate denies it.
|
|
419
|
-
*/
|
|
420
|
-
function operationPermissionsFromOpenApi(document, tree, options = {}) {
|
|
421
|
-
const operations = {};
|
|
422
|
-
const paths = isRecord(document) && isRecord(document["paths"]) ? document["paths"] : {};
|
|
423
|
-
for (const [path, item] of Object.entries(paths)) {
|
|
424
|
-
if (!isRecord(item)) continue;
|
|
425
|
-
for (const [method, operation] of Object.entries(item)) {
|
|
426
|
-
if (!METHODS.has(method.toUpperCase()) || !isRecord(operation)) continue;
|
|
427
|
-
const keys = operation["x-permdock-permissions"];
|
|
428
|
-
if (!Array.isArray(keys) || keys.length !== 1 || typeof keys[0] !== "string") continue;
|
|
429
|
-
const permission = findPermission(tree, keys[0]);
|
|
430
|
-
if (permission === void 0) continue;
|
|
431
|
-
const operationId = operation["operationId"];
|
|
432
|
-
operations[`${method.toUpperCase()} ${path}`] = typeof operationId === "string" ? {
|
|
433
|
-
permission,
|
|
434
|
-
operationId
|
|
435
|
-
} : permission;
|
|
436
|
-
}
|
|
437
|
-
}
|
|
438
|
-
return operationPermissions(operations, options);
|
|
439
|
-
}
|
|
440
|
-
//#endregion
|
|
441
312
|
//#region src/openapi/problem-details.ts
|
|
442
313
|
const TARGETS = /* @__PURE__ */ new Set([
|
|
443
314
|
"draft-2020-12",
|
|
@@ -542,4 +413,4 @@ function securityFor(permission, options = {}) {
|
|
|
542
413
|
});
|
|
543
414
|
}
|
|
544
415
|
//#endregion
|
|
545
|
-
export {
|
|
416
|
+
export { catalogOf as a, createPermDock as i, securityFor as n, openapiVersion as o, problemDetails as r, securitySchemesOf as s, permissionsExtension as t };
|
|
@@ -80,7 +80,7 @@ const emit = defineLeaf({
|
|
|
80
80
|
}
|
|
81
81
|
},
|
|
82
82
|
async run(ctx, { flags }) {
|
|
83
|
-
return (await import("./openapi-
|
|
83
|
+
return (await import("./openapi-5moP9sTG.js")).runOpenapi({
|
|
84
84
|
cwd: ctx.cwd,
|
|
85
85
|
config: ctx.config,
|
|
86
86
|
rest: ["emit"],
|
|
@@ -122,7 +122,7 @@ const importDocument = defineLeaf({
|
|
|
122
122
|
async run(ctx, { flags }) {
|
|
123
123
|
const doc = given(flags.doc);
|
|
124
124
|
if (doc === void 0) throw missingInput("openapi import", ["--doc"], "the OpenAPI document to import");
|
|
125
|
-
return (await import("./import-
|
|
125
|
+
return (await import("./import-DDegvwDI.js")).runOpenapiImport({
|
|
126
126
|
cwd: ctx.cwd,
|
|
127
127
|
doc,
|
|
128
128
|
out: fileOut("openapi import", flags.out),
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { E as PermissionTree, w as Permission } from "./vocabulary-DeZvUaTw.js";
|
|
2
2
|
//#region src/core/operation-risks.d.ts
|
|
3
3
|
type OperationRisk = "low" | "medium" | "high" | "critical";
|
|
4
4
|
/** Every `meta.risk` level, lowest first. */
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { n as CliError } from "./errors-BhRkoNS7.js";
|
|
2
|
+
import { r as peerHint } from "./peer-BuK9F53f.js";
|
|
3
|
+
import { createRequire } from "node:module";
|
|
4
|
+
//#region src/cli/core/optional.ts
|
|
5
|
+
const requireFrom = createRequire(import.meta.url);
|
|
6
|
+
function isMissing(error, name) {
|
|
7
|
+
return typeof error === "object" && error !== null && "code" in error && error.code === "MODULE_NOT_FOUND" && "message" in error && typeof error.message === "string" && error.message.includes(`'${name}'`);
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Loads an optional peer synchronously, for the call sites that parse or
|
|
11
|
+
* resolve inside a synchronous function. A missing peer fails with the install
|
|
12
|
+
* line for the project's package manager.
|
|
13
|
+
*/
|
|
14
|
+
function loadSync(name, task) {
|
|
15
|
+
try {
|
|
16
|
+
return requireFrom(name);
|
|
17
|
+
} catch (error) {
|
|
18
|
+
if (!isMissing(error, name)) throw error;
|
|
19
|
+
throw new CliError("unavailable", peerHint(name, task), {
|
|
20
|
+
cause: error,
|
|
21
|
+
code: "dependency_missing",
|
|
22
|
+
extensions: { package: name }
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
/** `oxc-parser`, an optional peer that source scans and codemods need. */
|
|
27
|
+
function oxc() {
|
|
28
|
+
return loadSync("oxc-parser", "reading source files");
|
|
29
|
+
}
|
|
30
|
+
/** `jiti`, an optional peer for project modules Node cannot import natively. */
|
|
31
|
+
function jiti() {
|
|
32
|
+
return loadSync("jiti", "loading a TypeScript module Node cannot import");
|
|
33
|
+
}
|
|
34
|
+
/** `parseSync` from `oxc-parser`, loaded on first call. */
|
|
35
|
+
function parseSync(...args) {
|
|
36
|
+
return oxc().parseSync(...args);
|
|
37
|
+
}
|
|
38
|
+
/** `new Visitor(visitor)` from `oxc-parser`, loaded on first call. */
|
|
39
|
+
function createVisitor(visitor) {
|
|
40
|
+
return new (oxc()).Visitor(visitor);
|
|
41
|
+
}
|
|
42
|
+
/** The node types `Visitor` has a hook for. */
|
|
43
|
+
function visitorKeyTypes() {
|
|
44
|
+
return Object.keys(oxc().visitorKeys);
|
|
45
|
+
}
|
|
46
|
+
//#endregion
|
|
47
|
+
export { visitorKeyTypes as i, jiti as n, parseSync as r, createVisitor as t };
|
package/dist/orpc/index.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { D as Policy, N as PolicyVocabulary, yr as Principal } from "../policy-types-
|
|
2
|
-
import {
|
|
3
|
-
import { a as OperationInput, t as Operation } from "../operations-
|
|
4
|
-
import { a as PermDock } from "../permdock-
|
|
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 OperationInput, t as Operation } from "../operations-BMPx7HyO.js";
|
|
4
|
+
import { a as PermDock } from "../permdock-BaB-KQqn.js";
|
|
5
5
|
import { n as RevocationFeed } from "../revocations-BaUXHM1N.js";
|
|
6
|
-
import { D as ConnectionOptions, T as Connection, i as OpenApiHooks } from "../server-types
|
|
7
|
-
import { t as ServerAdapterOptions } from "../bind-
|
|
8
|
-
import { t as RpcProtectOptions } from "../rpc-
|
|
6
|
+
import { D as ConnectionOptions, T as Connection, i as OpenApiHooks } from "../server-types--_Hann81.js";
|
|
7
|
+
import { t as ServerAdapterOptions } from "../bind-CnOMjazH.js";
|
|
8
|
+
import { t as RpcProtectOptions } from "../rpc-BqRiVpbP.js";
|
|
9
9
|
import { AnySchema, MetaPlugin, Middleware, Procedure, Schema } from "@orpc/server";
|
|
10
10
|
import { StandardSchemaV1 } from "@standard-schema/spec";
|
|
11
11
|
//#region src/orpc/operations.d.ts
|
package/dist/orpc/index.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { t as compact } from "../compact-CAf557ZB.js";
|
|
2
2
|
import { o as isPermission } from "../permission-registry-B8tYxPIt.js";
|
|
3
|
-
import { o as problemMessage } from "../http-DKLXrFGk.js";
|
|
4
3
|
import { r as permissionList } from "../decide-set-DXEPepY1.js";
|
|
5
|
-
import {
|
|
6
|
-
import { n as attached } from "../bind-
|
|
4
|
+
import { o as problemMessage } from "../http-DKLXrFGk.js";
|
|
5
|
+
import { n as attached } from "../bind-B4Z0U2Gr.js";
|
|
6
|
+
import { t as problemFromError } from "../map-error-p4ROJ_26.js";
|
|
7
7
|
import { i as isAsyncIterable, o as reloadAfter } from "../stream-DQ3rbO3J.js";
|
|
8
|
-
import { i as rpcCode, n as guardStream, r as problemBody, t as bindRpcKernel } from "../rpc-
|
|
8
|
+
import { i as rpcCode, n as guardStream, r as problemBody, t as bindRpcKernel } from "../rpc-Dhi55Whd.js";
|
|
9
9
|
import { ORPCError, os } from "@orpc/server";
|
|
10
10
|
//#region src/orpc/operations.ts
|
|
11
11
|
const root = os;
|
package/dist/otel/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { N as PolicyVocabulary } from "../policy-types-
|
|
2
|
-
import { a as PermDock } from "../permdock-
|
|
3
|
-
import { a as OtelOptions, i as OtelApi, n as GEN_AI_TOOL_CALL_ID, o as OtelWrap, r as GEN_AI_TOOL_NAME, s as StructuralLogger, t as GENAI_SEMCONV_PIN } from "../types-
|
|
1
|
+
import { N as PolicyVocabulary } from "../policy-types-rNfz7t0M.js";
|
|
2
|
+
import { a as PermDock } from "../permdock-BaB-KQqn.js";
|
|
3
|
+
import { a as OtelOptions, i as OtelApi, n as GEN_AI_TOOL_CALL_ID, o as OtelWrap, r as GEN_AI_TOOL_NAME, s as StructuralLogger, t as GENAI_SEMCONV_PIN } from "../types-_pi9kxS2.js";
|
|
4
4
|
//#region src/otel/instrument.d.ts
|
|
5
5
|
/**
|
|
6
6
|
* Listens on one instance. Spans carry no duration and no histogram is
|
package/dist/otel/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as compact } from "../compact-CAf557ZB.js";
|
|
2
|
-
import { n as wrapPermDock } from "../wrap-
|
|
2
|
+
import { n as wrapPermDock } from "../wrap-BKU5Arsu.js";
|
|
3
3
|
import { r as appObligationNames } from "../ocsf-TcjRBgIs.js";
|
|
4
4
|
//#region src/otel/types.ts
|
|
5
5
|
const GENAI_SEMCONV_PIN = "1.37.0";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { s as cliVersion } from "./version-DMQ0dnN5.js";
|
|
2
|
-
import { t as DOCS_BASE } from "./manifest-
|
|
2
|
+
import { t as DOCS_BASE } from "./manifest-CbHnl4I_.js";
|
|
3
3
|
//#region src/cli/core/output.ts
|
|
4
4
|
const CLI_RESULT_SCHEMA = "https://permdock.com/schemas/cli-result-v1.json";
|
|
5
5
|
function envelope(input) {
|