permdock 0.20.1 → 0.22.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -1
- package/dist/a2a/index.d.ts +5 -5
- package/dist/a2a/index.js +5 -4
- package/dist/{adoption-scan-BTG9Noyy.js → adoption-scan-_bHLMnVQ.js} +1 -1
- package/dist/agent/index.d.ts +2 -2
- package/dist/agent/index.js +1 -1
- package/dist/ai-sdk/index.d.ts +4 -4
- package/dist/ai-sdk/index.js +3 -3
- package/dist/app/index.d.ts +85 -0
- package/dist/app/index.js +91 -0
- package/dist/app-DIvM65Mv.js +24 -0
- package/dist/{approval-policies-CKlByf5o.d.ts → approval-policies-UnDSxT__.d.ts} +2 -2
- package/dist/{approval-prompt-CQFiO1KE.d.ts → approval-prompt-2hTqo6IM.d.ts} +2 -2
- package/dist/approvals/index.d.ts +3 -3
- package/dist/approvals/index.js +3 -3
- package/dist/{approvals-CuXILe52.js → approvals-B_sn4Wrn.js} +6 -6
- package/dist/{arazzo-CDXfX4u0.js → arazzo-BXD-VJU_.js} +1 -1
- package/dist/{arazzo-D4mKdaWI.js → arazzo-Ct0PGblq.js} +3 -3
- package/dist/astro/index.d.ts +6 -6
- package/dist/astro/index.js +2 -2
- package/dist/{audience-BUonniPx.js → audience-5Xx1hdIv.js} +1 -1
- package/dist/{auth-j3Eu-j4h.js → auth-BxXHxWRy.js} +1 -1
- package/dist/authzen/index.d.ts +5 -5
- package/dist/authzen/index.js +4 -4
- package/dist/{automation-CpOk7Tlu.d.ts → automation-B20_8UoT.d.ts} +3 -3
- package/dist/{automation-x3KEUusw.js → automation-BueW05db.js} +2 -2
- package/dist/better-auth/index.d.ts +2 -2
- package/dist/better-auth/index.js +1 -1
- package/dist/better-supabase/index.d.ts +113 -56
- package/dist/better-supabase/index.js +200 -62
- package/dist/better-supabase-DF8f8oly.js +194 -0
- package/dist/{bind-gwEbe9hL.js → bind-B4Z0U2Gr.js} +5 -5
- package/dist/{bind-CW7nsZ86.d.ts → bind-CnOMjazH.d.ts} +7 -7
- package/dist/{build-instance-DaBdCRiz.js → build-instance-B0vsViF5.js} +3 -25
- package/dist/{capability-zN6T9fxe.js → capability-CenWwTMR.js} +1 -1
- package/dist/{capability-v2xZB7us.d.ts → capability-YkRMUAsF.d.ts} +2 -2
- package/dist/{casbin-COUi09Ti.js → casbin-D5evU3lX.js} +1 -1
- package/dist/{casbin-BXlRcCdU.js → casbin-imBS3UIf.js} +1 -1
- package/dist/catalog/index.d.ts +5 -5
- package/dist/catalog/index.js +5 -5
- package/dist/catalog-C462QC3A.js +1 -0
- package/dist/{catalog-DjDc87R2.js → catalog-CoyKnU5c.js} +1 -1
- package/dist/{catalog-s0waIrfY.js → catalog-Y4CjN8NA.js} +4 -4
- package/dist/{catalog-operations-BD22drQf.js → catalog-operations-Do1eD-Rt.js} +1 -1
- package/dist/{challenge-DbkpCx_v.js → challenge-B__LcNve.js} +3 -3
- package/dist/chat/index.d.ts +1 -1
- package/dist/chat/index.js +3 -2
- package/dist/chat-sdk/index.d.ts +3 -3
- package/dist/claude-agent/index.d.ts +3 -3
- package/dist/claude-agent/index.js +2 -2
- package/dist/clerk/index.d.ts +3 -3
- package/dist/cli/bin.js +1 -1
- package/dist/cli/index.d.ts +8 -7
- package/dist/cli/index.js +3 -3
- package/dist/cloud/index.d.ts +8 -8
- package/dist/cloud/index.js +3 -3
- package/dist/{cloud-BW7JKfrF.js → cloud-DWCeStPH.js} +2 -2
- package/dist/{codemod-6CBQaT0x.js → codemod-B7QKJ_ak.js} +2 -2
- package/dist/{codemod-CR9EQBVd.js → codemod-BaPmaCYQ.js} +13 -6
- package/dist/{collect-DN_x7hvV.js → collect-Cr71JA7z.js} +8 -7
- package/dist/{collect-DMQ6Sxr6.js → collect-ScSG05VJ.js} +2 -2
- package/dist/collect-W9i7REKT.js +1 -0
- package/dist/compile/index.d.ts +1 -1
- package/dist/compile/index.js +1 -1
- package/dist/{compile-B_oJqmIg.js → compile-Cvru58id.js} +2 -2
- package/dist/{compile-DZftFfXc.d.ts → compile-DC-BrhH1.d.ts} +3 -3
- package/dist/{completion-CYRlOJzv.js → completion-DOUMyCwa.js} +1 -1
- package/dist/{delegation-aK4T_5WU.js → condition-evaluate-bVVRSdzq.js} +159 -159
- package/dist/{config-6iLK155o.js → config-DRp-E8Ly.js} +1 -1
- package/dist/{config-D2oXUwos.js → config-DyNanTjZ.js} +10 -8
- package/dist/{config-report-BLroaWCe.js → config-report-Bh_nLdAE.js} +2 -2
- package/dist/{config-shape-D9paLhEX.js → config-shape-C4zqzG2K.js} +9 -2
- package/dist/{context-YhyXyqBI.js → context-Cem4QafV.js} +2 -2
- package/dist/convex/index.d.ts +5 -5
- package/dist/convex/index.js +2 -2
- package/dist/{core-BwVkrpsi.js → core-CUjhfz0W.js} +6 -6
- package/dist/{core-BOeGWbcR.d.ts → core-D2JNg5jA.d.ts} +3 -3
- package/dist/coverage-D8jBJdgD.d.ts +114 -0
- package/dist/coverage-Dh2W_DmF.js +211 -0
- package/dist/{create-BezeYFcT.d.ts → create-B2tdOygC.d.ts} +7 -7
- package/dist/{create-C0R8omeF.js → create-BJ2_8NDO.js} +5 -5
- package/dist/{create-DDUFG1ul.js → create-BsL5lCWR.js} +10 -8
- package/dist/{create-DYSYYiLr.d.ts → create-CPDSbK1a.d.ts} +5 -5
- package/dist/{create-DMCC5ZOi.d.ts → create-oMCcZV4X.d.ts} +9 -9
- package/dist/{credential-B3Hj4puZ.js → credential-Bap3HClV.js} +4 -4
- package/dist/{server-D0PW6ZCw.js → credentials-BXV0oz56.js} +3 -146
- package/dist/credentials-DPX140fN.d.ts +125 -0
- package/dist/delivery/index.d.ts +4 -4
- package/dist/delivery/index.js +1 -1
- package/dist/{denied-text-De8cw3MW.d.ts → denied-text-BXQkWU7d.d.ts} +2 -2
- package/dist/{describe-DibQM6g-.d.ts → describe-DVobr5FX.d.ts} +2 -2
- package/dist/{diff-Bd1-VCe5.js → diff-BR9JArxz.js} +6 -6
- package/dist/{diff-DXRNcjpg.js → diff-Jc_kbDz-.js} +1 -1
- package/dist/{doctor-CJcS0Mrq.js → doctor-BBMW5ZT_.js} +310 -36
- package/dist/{doctor-DYTgibLC.js → doctor-DhqSiPkq.js} +3 -3
- package/dist/drizzle/index.d.ts +3 -3
- package/dist/drizzle/index.js +1 -1
- package/dist/elysia/index.d.ts +5 -5
- package/dist/elysia/index.js +3 -3
- package/dist/{errors-OTE9u4Wk.d.ts → errors-D_JIQJYb.d.ts} +1 -1
- package/dist/{evaluate-Dcq_U2TV.js → evaluate-B5yZHmts.js} +16 -16
- package/dist/{evaluations-CNMVJVD6.js → evaluations-BzTDWO4m.js} +57 -57
- package/dist/{evaluations-BgxEfPL7.d.ts → evaluations-DQYfh4Jh.d.ts} +3 -3
- package/dist/eve/index.d.ts +5 -5
- package/dist/eve/index.js +3 -3
- package/dist/express/index.d.ts +5 -5
- package/dist/express/index.js +3 -3
- package/dist/fastify/index.d.ts +5 -5
- package/dist/fastify/index.js +3 -3
- package/dist/{fetch-adapter-DCQ4pZxf.d.ts → fetch-adapter-DxqsIXSO.d.ts} +4 -4
- package/dist/{fetch-adapter-acq4dPX3.js → fetch-adapter-MoYZ-vF5.js} +5 -4
- package/dist/{fields-D_TfExiI.js → fields-CVyOk-f1.js} +2 -2
- package/dist/{fixtures-Cemqurt8.js → fixtures-BVZc7OCF.js} +1 -1
- package/dist/{from-snapshot-DHnb8Fh4.js → from-snapshot-oR_N97dM.js} +346 -14
- package/dist/{gen-gv_WHBIG.js → gen-DXXoFjyf.js} +1 -1
- package/dist/{gen-CH50v9VI.js → gen-WdycZ_-b.js} +5 -5
- package/dist/{grantee-conditions-DX4K_gGI.js → grantee-conditions-Dzprappv.js} +1 -1
- package/dist/{grantee-match-BP-k4vRJ.js → grantee-match-8J2y60MF.js} +3 -3
- package/dist/h3/index.d.ts +4 -4
- package/dist/h3/index.js +3 -3
- package/dist/{helpers-D-MXwkOF.js → helpers-DzBIfL1N.js} +25 -25
- package/dist/hono/index.d.ts +5 -5
- package/dist/hono/index.js +3 -3
- package/dist/{hosted-C2Pmhy2x.js → hosted-C5I2TSXm.js} +4 -4
- package/dist/{hosted-yhyAuQkL.d.ts → hosted-DXq1plaP.d.ts} +1 -1
- package/dist/{http-DhMWeB_h.js → http-dptLQzPP.js} +1 -1
- package/dist/{expiry-6XByK0dm.js → ids-DzhJaCUj.js} +23 -23
- package/dist/{import-BlwuuZkr.js → import-BE5sDazm.js} +2 -2
- package/dist/{import-C2ExjVvv.js → import-CvXswHDy.js} +2 -2
- package/dist/index-BcS8c_2S.d.ts +101 -0
- package/dist/{index--AwSBzJC.d.ts → index-BdZpqhJK.d.ts} +2 -2
- package/dist/{index-CLbGOPBr.d.ts → index-C-R8lBPb.d.ts} +3 -3
- package/dist/{index-CruReRkB.d.ts → index-C_8uxAlv.d.ts} +5 -5
- package/dist/{index-D7xGi1LS.d.ts → index-Cjfa1Uwr.d.ts} +22 -40
- package/dist/{index-Bt37QovT.d.ts → index-iIsqXFVu.d.ts} +6 -6
- package/dist/index.d.ts +19 -20
- package/dist/index.js +25 -24
- package/dist/{init-CalppFAI.js → init-B_S8Xdz1.js} +4 -4
- package/dist/{init-B62H9Kyx.js → init-CqGHcvyR.js} +2 -2
- package/dist/{instance-options-VPsNQsTH.d.ts → instance-options-C6gEDOts.d.ts} +1 -1
- package/dist/instance-options-URVwqpMW.js +24 -0
- package/dist/{instance-snapshot-SX8zH_1t.js → instance-snapshot-D_dGTq--.js} +10 -10
- package/dist/jwt/index.d.ts +4 -4
- package/dist/jwt/index.js +2 -2
- package/dist/{kernel-_QEUOSU0.js → kernel-NmxiWII2.js} +8 -8
- package/dist/kysely/index.d.ts +3 -3
- package/dist/kysely/index.js +1 -1
- package/dist/limits-CAhpRrhk.js +167 -0
- package/dist/{load-BaEamml-.js → load-C4p4VgwR.js} +2 -2
- package/dist/load-DiBUJx77.js +1 -0
- package/dist/{login-dDb_8muO.js → login-CzwlsBEO.js} +4 -4
- package/dist/{login-MxQV1BLh.js → login-DoLxv1s5.js} +3 -3
- package/dist/{manifest-DvDzxhy6.js → manifest-BAf7cgRx.js} +35 -35
- package/dist/{map-claims-PQwHynxV.js → map-claims-CAa_bQt9.js} +1 -1
- package/dist/{map-error-EOhahOVA.js → map-error-p4ROJ_26.js} +1 -1
- package/dist/mcp/index.d.ts +9 -9
- package/dist/mcp/index.js +9 -8
- package/dist/{migrate-CkLHdwuH.js → migrate-DVsxeE0y.js} +1 -1
- package/dist/{module-values-BYuNtdK5.js → module-values-BLiVlO1X.js} +3 -3
- package/dist/nest/index.d.ts +5 -5
- package/dist/nest/index.js +3 -3
- package/dist/next/index.d.ts +46 -17
- package/dist/next/index.js +58 -23
- package/dist/next/plugin.d.ts +1 -1
- package/dist/next/plugin.js +1 -1
- package/dist/node/index.d.ts +5 -5
- package/dist/node/index.js +2 -2
- package/dist/openai/index.d.ts +5 -5
- package/dist/openai/index.js +3 -3
- package/dist/openapi/index.d.ts +5 -59
- package/dist/openapi/index.js +3 -2
- package/dist/{openapi-BOsx0xn9.js → openapi-Cc-aS9xC.js} +6 -135
- package/dist/{openapi-BkGtE5kX.js → openapi-DroBcLJZ.js} +2 -2
- package/dist/{openapi-DKePsnln.js → openapi-EmvKwuWj.js} +4 -4
- package/dist/{operations-Ci_rT6Uo.d.ts → operations-BMPx7HyO.d.ts} +1 -1
- package/dist/optional-8TKc-0j4.js +47 -0
- package/dist/orpc/index.d.ts +7 -7
- package/dist/orpc/index.js +4 -4
- package/dist/otel/index.d.ts +3 -3
- package/dist/otel/index.js +1 -1
- package/dist/{output-B2h-2g3F.js → output-CYgfpT6o.js} +1 -1
- package/dist/{ownership-MGHa5vfX.js → ownership-adPAsUwY.js} +15 -13
- package/dist/{parse-CXTT7hBq.js → parse-CORUNcCo.js} +1 -1
- package/dist/{parse-local-manifest-CE4tgFsj.d.ts → parse-local-manifest-BaCqsqwC.d.ts} +1 -1
- package/dist/pdp/index.d.ts +3 -3
- package/dist/pdp/index.js +4 -3
- package/dist/{permdock-C1DN_7a-.js → permdock-B5LyNVgn.js} +71 -34
- package/dist/{permdock-D4F2p5J8.d.ts → permdock-BaB-KQqn.d.ts} +51 -9
- package/dist/{permissions-8N2yFsUM.js → permissions-COpRGKt7.js} +1 -1
- package/dist/{permissions-Bx6UI8n1.d.ts → permissions-DriWkV7q.d.ts} +1 -2
- package/dist/{policy-from-catalog-CUNlpgz0.js → policy-from-catalog-Cy103lsm.js} +8 -8
- package/dist/{policy-types-BI9C5Sp5.d.ts → policy-types-rNfz7t0M.d.ts} +9 -3
- package/dist/{policy-CaAME-Rh.js → policy-wGzbAPQF.js} +7 -7
- package/dist/{policy-Dh9WVSVz.d.ts → policy-x8RBKW8d.d.ts} +2 -2
- package/dist/{postgrest-CWCCbaxm.d.ts → postgrest-Cn0Res25.d.ts} +9 -21
- package/dist/powersync-BdoR7nwS.js +1 -0
- package/dist/{powersync-Deim9O47.js → powersync-BeI0VmEK.js} +2 -2
- package/dist/{powersync-CB8RwcB4.js → powersync-Dpa5AnnN.js} +11 -11
- package/dist/preset/index.js +1 -1
- package/dist/{preset-pPrVyGU5.js → preset-Bn5Z54cH.js} +5 -6
- package/dist/prisma/index.d.ts +2 -2
- package/dist/prisma/index.js +1 -1
- package/dist/{protected-action-ua0cx5cW.d.ts → protected-action-C4aj1KjO.d.ts} +6 -7
- package/dist/{protected-action-CD1HXwQK.js → protected-action-E7Sdt_Dt.js} +1 -1
- package/dist/{provider-D_hgjZRa.d.ts → provider-B-1DlOGM.d.ts} +1 -1
- package/dist/{provider-qESIf_C0.js → provider-DKO9KHua.js} +2 -2
- package/dist/{provider-store-BTHGJH9j.js → provider-store-D4PU1my_.js} +2 -2
- package/dist/{pull-BxqVL4Es.js → pull-3tkn25ll.js} +5 -5
- package/dist/pull-D90HqWNP.js +1 -0
- package/dist/{push-D2SsRW0U.js → push-dMyKdlEm.js} +6 -6
- package/dist/{pushed-policy-BERO0x9O.js → pushed-policy-Bi5-il4C.js} +2 -2
- package/dist/{pushed-policy-P0hgyLBh.d.ts → pushed-policy-P55cJNx5.d.ts} +1 -1
- package/dist/react/index.d.ts +6 -6
- package/dist/react/index.js +3 -3
- package/dist/react/provider-client.d.ts +1 -1
- package/dist/react/provider-client.js +1 -1
- package/dist/react-native/index.d.ts +9 -9
- package/dist/react-native/index.js +7 -7
- package/dist/{relation-walk-DK_gkgL7.js → relation-walk-BDTaTKTM.js} +1 -1
- package/dist/{relations-BxvRvDHK.js → relations-CMsJ1ARY.js} +1 -1
- package/dist/{replay-DYXI4gRN.d.ts → replay-DKhFvt0L.d.ts} +1 -1
- package/dist/{request-context-BPTi68z5.js → request-context-5gl_oxO1.js} +2 -2
- package/dist/resend/index.d.ts +4 -4
- package/dist/resend/index.js +2 -2
- package/dist/{resolve-names-BZQZRnMH.js → resolve-names-BnGJU88N.js} +4 -4
- package/dist/{rls-DpoJ5gCg.js → rls-DIYSRnDZ.js} +1 -1
- package/dist/{rls-OPorg_2G.js → rls-qrehUPf_.js} +45 -18
- package/dist/{role-builder-C5AgaC1x.js → role-builder-boQiUvfo.js} +3 -3
- package/dist/{rpc-D2LnFELm.d.ts → rpc-BqRiVpbP.d.ts} +2 -2
- package/dist/{rpc-DdkbQVlT.js → rpc-Dhi55Whd.js} +2 -2
- package/dist/run-elFdnSZx.js +1 -0
- package/dist/{run-YCpANf1B.js → run-oNqBe0gc.js} +3 -3
- package/dist/{run-ticket-CjvXr6wj.js → run-ticket-Ddxt9OuU.js} +2 -2
- package/dist/{run-ticket-94DOS9Cd.d.ts → run-ticket-Dulj4RQk.d.ts} +2 -2
- package/dist/{saas-BEXnrH9H.js → saas-DABv6vjy.js} +6 -5
- package/dist/{scan-COvn7ZjN.js → scan-BYXqcgON.js} +1 -1
- package/dist/{schema-BfSDo7Xj.js → schema-Wf-SvlHG.js} +1 -1
- package/dist/scim/index.d.ts +1 -1
- package/dist/scim/index.js +1 -1
- package/dist/{scopes-BSdYaGHs.js → scopes-gdH__vDZ.js} +1 -1
- package/dist/server/index.d.ts +11 -10
- package/dist/server/index.js +7 -6
- package/dist/server-CKjFooaJ.js +147 -0
- package/dist/{server-types-ChzXWU4Y.d.ts → server-types--_Hann81.d.ts} +10 -9
- package/dist/{shared-sW3VYchq.js → shared-DfaIWvIJ.js} +11 -2
- package/dist/{sink-RwmP7ZHs.d.ts → sink-Cs6z34AX.d.ts} +4 -4
- package/dist/{skills-N2Hd8KN8.js → skills-417bOj4o.js} +1 -1
- package/dist/{skills-Ce4C2dq1.js → skills-B9U465B7.js} +2 -2
- package/dist/{snapshot-DHPih65J.js → snapshot-C2j96x97.js} +4 -4
- package/dist/{snapshot-cache-MPinwwgZ.d.ts → snapshot-cache-Cc7VNabe.d.ts} +1 -1
- package/dist/solid/index.d.ts +6 -7
- package/dist/solid/index.js +2 -2
- package/dist/solid-start/index.d.ts +6 -6
- package/dist/solid-start/index.js +3 -3
- package/dist/{sources-sgQlMfmz.d.ts → sources-BfTza0zT.d.ts} +1 -1
- package/dist/{src-B8SQNsvw.js → src-BG9YJM3Q.js} +97 -247
- package/dist/ssf/index.d.ts +3 -3
- package/dist/ssf/index.js +3 -3
- package/dist/{standard-webhooks-CFZIYtBF.d.ts → standard-webhooks-CJBgfl7y.d.ts} +2 -2
- package/dist/{store-CSOsXd5s.js → store-BpKH-pLm.js} +2 -2
- package/dist/{store-Dpg_fSNQ.d.ts → store-DSyjHD5-.d.ts} +5 -5
- package/dist/{store-options-CDvoX52-.js → store-options-CXv6BHH6.js} +5 -6
- package/dist/{stores-PpYVQ5yF.js → stores-BuqAHjp_.js} +1 -1
- package/dist/{stores-C2A6KsxE.d.ts → stores-C6-7TPTV.d.ts} +6 -7
- package/dist/{postgrest-BrjrckDG.js → subject-BqFwS6l3.js} +214 -319
- package/dist/subject-cache-BT1fGuea.js +193 -0
- package/dist/subject-cache-d_Z4KAnm.d.ts +144 -0
- package/dist/supabase/index.d.ts +6 -5
- package/dist/supabase/index.js +3 -2
- package/dist/supabase/middleware.d.ts +6 -6
- package/dist/supabase/middleware.js +6 -6
- package/dist/{supabase-zL7PC3RG.js → supabase-D0J99yqL.js} +2 -2
- package/dist/{supabase-CVZuytCC.js → supabase-DnazO6W4.js} +3 -3
- package/dist/{supabase-hook-BCSwK5x-.js → supabase-hook-Bh5syR9N.js} +174 -62
- package/dist/supabase-hook-CVAenq-w.js +1 -0
- package/dist/{supautils-7UES0i4a.js → supautils-ChXR-4Or.js} +302 -43
- package/dist/{support-session-BsmPCbz8.js → support-session-BGeEYDSq.js} +2 -2
- package/dist/svelte/index.d.ts +5 -5
- package/dist/svelte/index.js +3 -3
- package/dist/svelte/runtime.d.ts +3 -3
- package/dist/svelte/runtime.js +1 -1
- package/dist/svelte/source.d.ts +5 -5
- package/dist/svelte/source.js +2 -2
- package/dist/sveltekit/index.d.ts +6 -6
- package/dist/sveltekit/index.js +2 -2
- package/dist/{tables-DSX_Ma_n.js → tables-CbEOy2Ma.js} +137 -55
- package/dist/tanstack-start/index.d.ts +6 -6
- package/dist/tanstack-start/index.js +2 -2
- package/dist/{tenancy-DvOHHk3-.js → tenancy-BlxY5T0q.js} +2 -2
- package/dist/terminal/index.d.ts +6 -6
- package/dist/terminal/index.js +6 -6
- package/dist/testing/core.d.ts +1 -1
- package/dist/testing/core.js +1 -1
- package/dist/testing/fixtures/index.d.ts +35 -2
- package/dist/testing/fixtures/index.js +39 -2
- package/dist/testing/index.d.ts +41 -25
- package/dist/testing/index.js +114 -26
- package/dist/testing/saas/index.d.ts +5 -5
- package/dist/testing/saas/index.js +2 -2
- package/dist/testing/saas/permissions.d.ts +1 -1
- package/dist/testing/saas/permissions.js +1 -1
- package/dist/trpc/index.d.ts +6 -6
- package/dist/trpc/index.js +4 -4
- package/dist/{type-helpers-BjOLGVy1.d.ts → type-helpers-iXJEIDe7.d.ts} +3 -4
- package/dist/{types-p8mhWTcR.d.ts → types-B9F0EZAF.d.ts} +3 -3
- package/dist/{types-DZwEOsK1.d.ts → types-BSNZMp5b.d.ts} +1 -1
- package/dist/{types-DnzRZjEu.d.ts → types-BpxdxaRD.d.ts} +5 -5
- package/dist/{types-C5p2hoBR.d.ts → types-CD1qmxdx.d.ts} +4 -4
- package/dist/{types-D1NjjwI4.d.ts → types-CS1DI_Ke.d.ts} +40 -9
- package/dist/{types-CMclYgSk.d.ts → types-C_a44wSr.d.ts} +3 -3
- package/dist/{types-DBVSljAx.d.ts → types-Cq2rvv-C.d.ts} +3 -3
- package/dist/{types--_lpWUGV.d.ts → types-CuDXvyIT.d.ts} +5 -5
- package/dist/{types-7Vlz1Wi2.d.ts → types-DAyp592k.d.ts} +2 -2
- package/dist/{types-Drs3OOAy.d.ts → types-NikV1pND.d.ts} +4 -4
- package/dist/{types-BzxA2OAD.d.ts → types-ZfjQB0KC.d.ts} +2 -2
- package/dist/{types-D8JVDWOr.d.ts → types-_pi9kxS2.d.ts} +2 -2
- package/dist/unplugin/index.d.ts +1 -1
- package/dist/unplugin/index.js +1 -1
- package/dist/{usage-CUnw73Y-.js → usage-0wsl83uw.js} +10 -10
- package/dist/{usage-BcAqmjkj.js → usage-Bl-BkXEq.js} +1 -1
- package/dist/usage-CmyGbo4e.js +1 -0
- package/dist/{validation-error-DkOK9zUE.d.ts → validation-error-DLAYFlkr.d.ts} +1 -1
- package/dist/{verify-V08pirDB.js → verify-BSLotSa0.js} +41 -24
- package/dist/version-sources-BC3hf2ME.js +34 -0
- package/dist/{permission-types-CAY-GU7e.d.ts → vocabulary-DeZvUaTw.d.ts} +69 -1
- package/dist/vue/index.d.ts +6 -7
- package/dist/vue/index.js +2 -2
- package/dist/{waiter-BjVI_Byg.d.ts → waiter-cbK1CBhT.d.ts} +2 -2
- package/dist/{watch-Dz2LNM1R.js → watch-BigZ260i.js} +2 -2
- package/dist/watch-CHURMgrv.js +1 -0
- package/dist/webmcp/index.d.ts +2 -2
- package/dist/{who-can-CZeAwQZD.js → who-can-CjfMP9a4.js} +8 -8
- package/dist/workflow/index.d.ts +3 -3
- package/dist/workflow/index.js +6 -5
- package/dist/workflow-sdk/index.d.ts +5 -5
- package/dist/{wrap-CE5lxje7.d.ts → wrap-B-k2qHJx.d.ts} +2 -2
- package/package.json +16 -4
- package/skills/permdock-wire/references/presets-and-recipes.md +2 -2
- package/dist/better-supabase-ayun1IKE.js +0 -122
- package/dist/catalog-BTPySmbp.js +0 -1
- package/dist/collect-eSTXOZDC.js +0 -1
- package/dist/index-B_I6N8Ju.d.ts +0 -222
- package/dist/load-CjnlPxpL.js +0 -1
- package/dist/powersync-Cs1E04s6.js +0 -1
- package/dist/pull-BLT25Y5C.js +0 -1
- package/dist/run-CW0QsyA9.js +0 -1
- package/dist/supabase-hook-7XxWGHQF.js +0 -1
- package/dist/usage-BdIS9NfN.js +0 -1
- package/dist/version-cache-q5cpaDSt.d.ts +0 -57
- package/dist/vocabulary-DEJ5j4mR.d.ts +0 -70
- package/dist/watch-CS69ftMP.js +0 -1
- package/dist/where-scope-BAyOsPQW.js +0 -332
- package/dist/{approval-normalize-hlfO9BJv.js → approval-normalize-DNLW0zOM.js} +1 -1
- package/dist/{body-C9JbIoqb.js → body-B3ylkmmE.js} +1 -1
- package/dist/{catalog-doc-nrgfbh8I.js → catalog-doc-Zi0jRpyH.js} +2 -2
- package/dist/{device-BwbJNmb2.js → device-BkSynWdg.js} +1 -1
- package/dist/{prompt-BYc6drYW.js → prompt-D1Gj1W4Y.js} +1 -1
- package/dist/{scim-C30QBBoF.js → scim-BG6uPUeW.js} +1 -1
- package/dist/{wrap-C5PWzgkq.js → wrap-BKU5Arsu.js} +1 -1
|
@@ -1,21 +1,292 @@
|
|
|
1
|
-
import { t as compact } from "./compact-CAf557ZB.js";
|
|
1
|
+
import { a as sole, r as isRecord, t as compact } from "./compact-CAf557ZB.js";
|
|
2
2
|
import { n as freezeDeep } from "./freeze-jjan0lCv.js";
|
|
3
|
+
import { i as decideAllWith, n as canAllWith } from "./checks-fyDOhcz0.js";
|
|
4
|
+
import { t as loadPrincipal } from "./principal-source-C6N60GtM.js";
|
|
3
5
|
import { a as deniedMessage, i as approvalMessage, n as PermDockDeniedError, t as PermDockApprovalRequiredError } from "./errors-ynga1EQy.js";
|
|
4
|
-
import { o as
|
|
6
|
+
import { a as grantCoversField, o as pickVisible, r as readWireValidity, t as isActive } from "./validity-Buc7w8E9.js";
|
|
5
7
|
import { c as listPermissions } from "./permission-registry-B8tYxPIt.js";
|
|
6
|
-
import { g as secondsOf, o as epochSeconds, t as INVALID_NOW } from "./time-nR1JesoH.js";
|
|
7
|
-
import { d as scopeList, o as normalizeMemberships, p as tenantOf, s as resolveScope, t as activeFor } from "./scopes-BSdYaGHs.js";
|
|
8
|
-
import { a as readOnlyActorRefuses, c as rowIdOf, l as rowValues, n as coveredByDelegation, u as evaluateCondition } from "./delegation-aK4T_5WU.js";
|
|
9
8
|
import { b as synthesiseRole, m as findRole, v as listRoles } from "./grantee-Dke-9rd1.js";
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
9
|
+
import { g as secondsOf, m as rfc3339, o as epochSeconds, t as INVALID_NOW } from "./time-nR1JesoH.js";
|
|
10
|
+
import { i as sameId } from "./ids-DzhJaCUj.js";
|
|
11
|
+
import { d as scopeList, l as scopeChain, o as normalizeMemberships, p as tenantOf, r as findScope, s as resolveScope, t as activeFor, u as scopeIdOf } from "./scopes-gdH__vDZ.js";
|
|
12
|
+
import { o as resourceRoleCondition } from "./grantee-conditions-Dzprappv.js";
|
|
13
|
+
import { n as matchGrantee } from "./grantee-match-8J2y60MF.js";
|
|
14
|
+
import { i as rowValues, l as readOnlyActorRefuses, o as coveredByDelegation, r as rowIdOf, t as evaluateCondition } from "./condition-evaluate-bVVRSdzq.js";
|
|
15
|
+
import { c as nowSeconds, d as resolveActiveTenant, f as rowInScope, n as inTeam, o as membershipField, r as isMembershipExpired, s as nestedAppliesWithoutRow } from "./tenancy-BlxY5T0q.js";
|
|
12
16
|
import { t as requiresApproval } from "./approval-required-TzNB9oQA.js";
|
|
17
|
+
import { t as resourceIdOf } from "./resource-ref-CaS9yVPi.js";
|
|
13
18
|
import { i as tokenPayload, n as decisionToken } from "./token-DaMnIU9O.js";
|
|
19
|
+
import { a as bindConditionRefs, n as parseSnapshot } from "./snapshot-C2j96x97.js";
|
|
14
20
|
import { t as fromWireDelegation } from "./wire-delegation-Cv3W2eaM.js";
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
21
|
+
//#region src/core/decide-for.ts
|
|
22
|
+
function deniedFor(permission, reason) {
|
|
23
|
+
return freezeDeep({
|
|
24
|
+
outcome: "denied",
|
|
25
|
+
permission: permission.key,
|
|
26
|
+
denials: [{
|
|
27
|
+
role: null,
|
|
28
|
+
reason
|
|
29
|
+
}],
|
|
30
|
+
alternatives: []
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
/** Rows are checked like `decide`; `call: 'can'` keeps every limit unconsumed. */
|
|
34
|
+
const PEEK = Object.freeze({ call: "can" });
|
|
35
|
+
/**
|
|
36
|
+
* What `permission` on `row` decides for the principal `principalId` in the
|
|
37
|
+
* caller's active tenant. Never throws, never consumes a limit, and grants the
|
|
38
|
+
* caller nothing: the target is a separate instance with its own caches.
|
|
39
|
+
*/
|
|
40
|
+
async function decideForTarget(caller, principals, create, principalId, permission, row) {
|
|
41
|
+
if (caller.principal === null) return deniedFor(permission, "anonymous");
|
|
42
|
+
const tenant = caller.principal.tenant;
|
|
43
|
+
try {
|
|
44
|
+
const principal = await loadPrincipal(principals, principalId, tenant);
|
|
45
|
+
if (principal === null) return deniedFor(permission, "anonymous");
|
|
46
|
+
const target = await create(principal, tenant);
|
|
47
|
+
if (tenant !== void 0 && target.subject.principal?.tenant !== tenant && (principal.kind !== "contact" || target.tenants().length > 0)) return deniedFor(permission, "tenant-mismatch");
|
|
48
|
+
if (row !== void 0) await target.prefetchRelations(permission, [row]);
|
|
49
|
+
return target.decide(permission, row, PEEK);
|
|
50
|
+
} catch {
|
|
51
|
+
return deniedFor(permission, "anonymous");
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
//#endregion
|
|
55
|
+
//#region src/core/may-use.ts
|
|
56
|
+
function delegationMayCover(permission, delegation, hasActor) {
|
|
57
|
+
return [void 0, ...[...delegation?.access ?? [], ...delegation?.authorizationDetails ?? []].flatMap((entry) => typeof entry === "object" && entry !== null && typeof entry["identifier"] === "string" ? [entry["identifier"]] : [])].some((id) => coveredByDelegation(permission, delegation, id, hasActor) === void 0);
|
|
58
|
+
}
|
|
59
|
+
function blocksEveryRow(grant) {
|
|
60
|
+
return grant.effect === "deny" && grant.where === void 0 && grant.check === void 0 && grant.portable !== false && grant.fields === void 0 && (grant.scope === void 0 || grant.scope === "tenant");
|
|
61
|
+
}
|
|
62
|
+
function withinDelegation(permdock, permission, ceiling) {
|
|
63
|
+
return (ceiling === void 0 || ceiling.includes(permission.key)) && !readOnlyActorRefuses(permdock.subject.actor, permission) && delegationMayCover(permission, permdock.subject.delegation, permdock.subject.actor !== void 0 && ceiling === void 0);
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* Whether the subject's delegation, its delegated ceiling and a read-only actor
|
|
67
|
+
* leave `permission` within reach, whatever the grants say. A hint, never a
|
|
68
|
+
* decision.
|
|
69
|
+
*/
|
|
70
|
+
function delegationAllows(permdock, permission) {
|
|
71
|
+
try {
|
|
72
|
+
const snapshot = permdock.snapshot();
|
|
73
|
+
return "grants" in snapshot && withinDelegation(permdock, permission, snapshot.delegated);
|
|
74
|
+
} catch {
|
|
75
|
+
return false;
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* Whether `permission` could be granted to this instance's subject for some
|
|
80
|
+
* row: the grants its snapshot carries for the active tenant, minus an
|
|
81
|
+
* unconditional deny, within its delegation. A listing hint for tools and
|
|
82
|
+
* skills, never a decision; the call itself is decided in full.
|
|
83
|
+
*/
|
|
84
|
+
function mayUse(permdock, permission) {
|
|
85
|
+
try {
|
|
86
|
+
const snapshot = permdock.snapshot();
|
|
87
|
+
if (!("grants" in snapshot) || !withinDelegation(permdock, permission, snapshot.delegated)) return false;
|
|
88
|
+
const tenant = permdock.subject.principal?.tenant;
|
|
89
|
+
const scopes = scopeList(snapshot.scopes);
|
|
90
|
+
const grants = snapshot.grants.filter((grant) => {
|
|
91
|
+
if (grant.permission !== permission.key) return false;
|
|
92
|
+
const owner = grant.membership === void 0 ? void 0 : tenantOf(grant.membership, scopes);
|
|
93
|
+
return owner === void 0 || owner === tenant;
|
|
94
|
+
});
|
|
95
|
+
if (grants.some(blocksEveryRow)) return false;
|
|
96
|
+
return grants.some((grant) => grant.effect === "allow");
|
|
97
|
+
} catch {
|
|
98
|
+
return false;
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
function isConditioned(grant) {
|
|
102
|
+
return grant.where !== void 0 || grant.check !== void 0 || grant.validity !== void 0 || grant.portable === false;
|
|
103
|
+
}
|
|
104
|
+
/**
|
|
105
|
+
* The instances of `scope` in which the subject holds `permission`, from its
|
|
106
|
+
* live memberships of exactly that scope, within its delegation: by default
|
|
107
|
+
* those with an allow that carries no row condition (`where`, `check`, a
|
|
108
|
+
* validity window or a non-portable test; a `fields` limit is not a row
|
|
109
|
+
* condition), minus the instances any deny of the permission reaches. The
|
|
110
|
+
* in-process mirror of the SQL `permitted_<scope>_ids_by_permission`. With
|
|
111
|
+
* `conditioned: true` it also lists the instances where a conditioned allow
|
|
112
|
+
* applies, minus only unconditional denies, as
|
|
113
|
+
* `permitted_<scope>_ids_by_permission(p_permission, true)` does. A listing,
|
|
114
|
+
* never a decision: a row's own check still runs `can`.
|
|
115
|
+
*/
|
|
116
|
+
function permittedIds(permdock, permission, scope, options = {}) {
|
|
117
|
+
try {
|
|
118
|
+
const snapshot = permdock.snapshot({ tenants: "all" });
|
|
119
|
+
if (!("grants" in snapshot)) return [];
|
|
120
|
+
const scopes = scopeList(snapshot.scopes);
|
|
121
|
+
const name = resolveScope(scopes, scope);
|
|
122
|
+
if (name === void 0 || !withinDelegation(permdock, permission, snapshot.delegated)) return [];
|
|
123
|
+
const conditioned = options.conditioned === true;
|
|
124
|
+
const now = nowSeconds();
|
|
125
|
+
const allowed = /* @__PURE__ */ new Set();
|
|
126
|
+
const denied = /* @__PURE__ */ new Set();
|
|
127
|
+
for (const grant of snapshot.grants) {
|
|
128
|
+
const membership = grant.membership;
|
|
129
|
+
if (grant.permission !== permission.key || grant.scope !== name || membership?.scope !== name || membership.id === void 0 || isMembershipExpired(membership, now) || options.within !== void 0 && tenantOf(membership, scopes) !== options.within) continue;
|
|
130
|
+
if (grant.effect === "deny") {
|
|
131
|
+
if (!conditioned || !isConditioned(grant)) denied.add(membership.id);
|
|
132
|
+
} else if ((conditioned || !isConditioned(grant)) && isActive(readWireValidity(grant.validity), now)) allowed.add(membership.id);
|
|
133
|
+
}
|
|
134
|
+
return [...allowed].filter((id) => !denied.has(id)).toSorted();
|
|
135
|
+
} catch {
|
|
136
|
+
return [];
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
//#endregion
|
|
140
|
+
//#region src/core/membership-filter.ts
|
|
141
|
+
function filterMemberships(memberships, filter) {
|
|
142
|
+
if (filter?.via === void 0 && filter?.scope === void 0) return memberships;
|
|
143
|
+
return memberships.filter((entry) => (filter.via === void 0 || entry.via === filter.via) && (filter.scope === void 0 || (entry.scope ?? entry.on?.resource) === filter.scope));
|
|
144
|
+
}
|
|
145
|
+
//#endregion
|
|
146
|
+
//#region src/core/where-scope.ts
|
|
147
|
+
const ALWAYS = freezeDeep({
|
|
148
|
+
op: "eq",
|
|
149
|
+
field: "_",
|
|
150
|
+
value: true
|
|
151
|
+
});
|
|
152
|
+
function eq(field, value) {
|
|
153
|
+
return value === void 0 ? {
|
|
154
|
+
op: "or",
|
|
155
|
+
conditions: []
|
|
156
|
+
} : {
|
|
157
|
+
op: "eq",
|
|
158
|
+
field,
|
|
159
|
+
value
|
|
160
|
+
};
|
|
161
|
+
}
|
|
162
|
+
/**
|
|
163
|
+
* One equality per partitioning scope key on the membership's chain, outermost
|
|
164
|
+
* first.
|
|
165
|
+
*/
|
|
166
|
+
function namedFilters(membership, scope) {
|
|
167
|
+
if (findScope(scope.scopes, membership.scope ?? "") === void 0 || !inTeam(membership, scope.scopes, scope.team) || !activeFor(membership, scope.scopes, scope.tenant) || membership.scope === void 0) return null;
|
|
168
|
+
const filters = [];
|
|
169
|
+
for (const name of scopeChain(scope.scopes, membership.scope).toReversed()) {
|
|
170
|
+
const key = scope.fieldOf(name);
|
|
171
|
+
if (key !== void 0 && scope.partitioned(name, key)) filters.push(eq(key, scopeIdOf(membership, name)));
|
|
172
|
+
}
|
|
173
|
+
return filters;
|
|
174
|
+
}
|
|
175
|
+
/**
|
|
176
|
+
* The row filters a grant's membership implies, or `null` when the grant
|
|
177
|
+
* reaches no row in this scope (another tenant, no active tenant, expired).
|
|
178
|
+
*/
|
|
179
|
+
function scopeFilters(grant, scope) {
|
|
180
|
+
if (grant.scope === void 0) return [];
|
|
181
|
+
const membership = grant.membership;
|
|
182
|
+
if (membership === void 0 || isMembershipExpired(membership, scope.now)) return null;
|
|
183
|
+
if (typeof grant.scope === "string") return membership.scope === grant.scope ? namedFilters(membership, scope) : null;
|
|
184
|
+
const on = membership.on;
|
|
185
|
+
if (on === void 0) return null;
|
|
186
|
+
if (scope.resources === void 0) return on.resource === grant.scope.resource && on.resource === scope.resource ? [eq("id", on.id)] : null;
|
|
187
|
+
const roleResource = scope.resources.get(grant.scope.resource);
|
|
188
|
+
if (on.resource !== grant.scope.resource && membershipField(roleResource, on.resource, scope.resources) === void 0) return null;
|
|
189
|
+
const walked = scope.graph === true ? resourceRoleCondition(scope.resources.get(scope.resource), on.resource, [on.id], scope.resources) : void 0;
|
|
190
|
+
if (walked !== void 0) return [walked];
|
|
191
|
+
const field = membershipField(scope.resources.get(scope.resource), on.resource, scope.resources);
|
|
192
|
+
return field === void 0 ? null : [eq(field, on.id)];
|
|
193
|
+
}
|
|
194
|
+
function all(conditions) {
|
|
195
|
+
if (conditions.length === 0) return ALWAYS;
|
|
196
|
+
return sole(conditions) ?? {
|
|
197
|
+
op: "and",
|
|
198
|
+
conditions: [...conditions]
|
|
199
|
+
};
|
|
200
|
+
}
|
|
201
|
+
function scopedCondition(grant, scope) {
|
|
202
|
+
const filters = scopeFilters(grant, scope);
|
|
203
|
+
if (filters === null) return null;
|
|
204
|
+
const parts = grant.where === void 0 ? filters : [...filters, grant.where];
|
|
205
|
+
return parts.length === 0 ? "always" : all(parts);
|
|
206
|
+
}
|
|
207
|
+
/** Whether an unconditional `deny` removes every row `allow` could reach. */
|
|
208
|
+
function covers(deny, allow, scopes) {
|
|
209
|
+
if (deny.where !== void 0) return false;
|
|
210
|
+
const denied = deny.membership;
|
|
211
|
+
if (deny.scope === void 0 || denied === void 0) return deny.scope === void 0;
|
|
212
|
+
const allowed = allow.membership;
|
|
213
|
+
if (allowed === void 0) return false;
|
|
214
|
+
if (typeof deny.scope === "object") return typeof allow.scope === "object" && denied.on?.resource === allowed.on?.resource && denied.on?.id === allowed.on?.id;
|
|
215
|
+
if (typeof allow.scope !== "string" || allowed.scope === void 0) return false;
|
|
216
|
+
const chain = scopeChain(scopes, deny.scope);
|
|
217
|
+
return scopeChain(scopes, allowed.scope).includes(deny.scope) && chain.every((name) => scopeIdOf(allowed, name) === scopeIdOf(denied, name));
|
|
218
|
+
}
|
|
219
|
+
/**
|
|
220
|
+
* The portable filter for one permission's grants: allows OR together, each
|
|
221
|
+
* narrowed to its membership's tenant, team or resource; any applicable
|
|
222
|
+
* portable deny is subtracted, and an unconditional one empties the result.
|
|
223
|
+
*/
|
|
224
|
+
function collect(grants, scope) {
|
|
225
|
+
const none = {
|
|
226
|
+
op: "or",
|
|
227
|
+
conditions: []
|
|
228
|
+
};
|
|
229
|
+
const partial = grants.some((grant) => grant.portable === false);
|
|
230
|
+
const denies = [];
|
|
231
|
+
for (const grant of grants) {
|
|
232
|
+
if (grant.effect !== "deny" || grant.portable === false || !isActive(readWireValidity(grant.validity, "deny"), scope.now)) continue;
|
|
233
|
+
const condition = scopedCondition(grant, scope);
|
|
234
|
+
if (condition === "always") return {
|
|
235
|
+
condition: none,
|
|
236
|
+
partial
|
|
237
|
+
};
|
|
238
|
+
if (condition !== null) denies.push({
|
|
239
|
+
grant,
|
|
240
|
+
condition
|
|
241
|
+
});
|
|
242
|
+
}
|
|
243
|
+
const parts = [];
|
|
244
|
+
for (const grant of grants) {
|
|
245
|
+
if (grant.effect !== "allow" || grant.portable === false || !isActive(readWireValidity(grant.validity), scope.now)) continue;
|
|
246
|
+
const condition = scopedCondition(grant, scope);
|
|
247
|
+
if (condition === null || denies.some((deny) => covers(deny.grant, grant, scope.scopes))) continue;
|
|
248
|
+
parts.push(all([...condition === "always" ? [] : [condition], ...denies.map((deny) => ({
|
|
249
|
+
op: "not",
|
|
250
|
+
condition: deny.condition
|
|
251
|
+
}))]));
|
|
252
|
+
}
|
|
253
|
+
if (parts.length === 0) return {
|
|
254
|
+
condition: none,
|
|
255
|
+
partial
|
|
256
|
+
};
|
|
257
|
+
return {
|
|
258
|
+
condition: sole(parts) ?? {
|
|
259
|
+
op: "or",
|
|
260
|
+
conditions: parts
|
|
261
|
+
},
|
|
262
|
+
partial
|
|
263
|
+
};
|
|
264
|
+
}
|
|
265
|
+
/**
|
|
266
|
+
* `collect`, with every subject ref bound to `scope.subject` and the subject
|
|
267
|
+
* attached (not enumerable) for `memberOf`, which needs its memberships.
|
|
268
|
+
*/
|
|
269
|
+
function whereFromGrants(grants, scope) {
|
|
270
|
+
const { condition, partial } = collect(grants, scope);
|
|
271
|
+
const result = {
|
|
272
|
+
condition: bindConditionRefs(condition, scope.subject),
|
|
273
|
+
partial
|
|
274
|
+
};
|
|
275
|
+
Object.defineProperty(result, "subject", {
|
|
276
|
+
value: scope.subject,
|
|
277
|
+
enumerable: false
|
|
278
|
+
});
|
|
279
|
+
Object.defineProperty(result, "scopes", {
|
|
280
|
+
value: scope.scopes,
|
|
281
|
+
enumerable: false
|
|
282
|
+
});
|
|
283
|
+
if (scope.resources !== void 0) Object.defineProperty(result, "resources", {
|
|
284
|
+
value: scope.resources,
|
|
285
|
+
enumerable: false
|
|
286
|
+
});
|
|
287
|
+
return freezeDeep(result);
|
|
288
|
+
}
|
|
289
|
+
//#endregion
|
|
19
290
|
//#region src/core/snapshot-evaluate.ts
|
|
20
291
|
function coveredByInclude(snapshot, permission) {
|
|
21
292
|
const include = snapshot.include;
|
|
@@ -357,6 +628,64 @@ function whereFromSnapshot(snapshot, subject, permission, team) {
|
|
|
357
628
|
});
|
|
358
629
|
}
|
|
359
630
|
//#endregion
|
|
631
|
+
//#region src/core/snapshot-sign.ts
|
|
632
|
+
/**
|
|
633
|
+
* The claims `signSnapshot` signs for `snapshot`. `issuedAt` and `expiresAt`
|
|
634
|
+
* become `iat` and `exp` and leave the `snapshot` claim, so the registered
|
|
635
|
+
* claims are the only times a verifier reads.
|
|
636
|
+
*/
|
|
637
|
+
function snapshotClaims(snapshot) {
|
|
638
|
+
const { issuedAt, expiresAt, ...claim } = snapshot;
|
|
639
|
+
const iat = secondsOf(issuedAt);
|
|
640
|
+
return compact({
|
|
641
|
+
snapshot: claim,
|
|
642
|
+
sub: snapshot.subject.principal?.id,
|
|
643
|
+
iat: iat === void 0 || iat <= 0 ? void 0 : iat,
|
|
644
|
+
exp: secondsOf(expiresAt)
|
|
645
|
+
});
|
|
646
|
+
}
|
|
647
|
+
/**
|
|
648
|
+
* Signs `snapshot` as a `vnd.permdock.snapshot+jwt` with the claims
|
|
649
|
+
* `snapshotClaims` answers.
|
|
650
|
+
*/
|
|
651
|
+
function signSnapshot(snapshot, signer, options = {}) {
|
|
652
|
+
const { iat, exp, ...payload } = snapshotClaims(snapshot);
|
|
653
|
+
return signer.sign(payload, compact({
|
|
654
|
+
typ: "vnd.permdock.snapshot+jwt",
|
|
655
|
+
audience: options.audience,
|
|
656
|
+
issuedAt: iat,
|
|
657
|
+
expiresAt: exp
|
|
658
|
+
}));
|
|
659
|
+
}
|
|
660
|
+
/**
|
|
661
|
+
* The `snapshot` claim of verified claims with `issuedAt` and `expiresAt` taken
|
|
662
|
+
* from `iat` and `exp`; `undefined` when the claim is not an object.
|
|
663
|
+
*/
|
|
664
|
+
function snapshotClaim(claims) {
|
|
665
|
+
const claim = claims["snapshot"];
|
|
666
|
+
if (!isRecord(claim)) return;
|
|
667
|
+
const { issuedAt: _issuedAt, expiresAt: _expiresAt, ...rest } = claim;
|
|
668
|
+
return compact({
|
|
669
|
+
...rest,
|
|
670
|
+
issuedAt: rfc3339(typeof claims.iat === "number" ? claims.iat : 0),
|
|
671
|
+
expiresAt: typeof claims.exp === "number" ? rfc3339(claims.exp) : void 0
|
|
672
|
+
});
|
|
673
|
+
}
|
|
674
|
+
/**
|
|
675
|
+
* The snapshot a verified `vnd.permdock.snapshot+jwt` carries, parsed as
|
|
676
|
+
* `parseSnapshot` parses it, with `issuedAt` and `expiresAt` from `iat` and
|
|
677
|
+
* `exp`. `null` when the claim is missing or not a valid snapshot.
|
|
678
|
+
*/
|
|
679
|
+
function snapshotFromClaims(claims) {
|
|
680
|
+
const claim = snapshotClaim(claims);
|
|
681
|
+
if (claim === void 0) return null;
|
|
682
|
+
try {
|
|
683
|
+
return parseSnapshot(claim);
|
|
684
|
+
} catch {
|
|
685
|
+
return null;
|
|
686
|
+
}
|
|
687
|
+
}
|
|
688
|
+
//#endregion
|
|
360
689
|
//#region src/core/snapshot-subject.ts
|
|
361
690
|
function subjectFromSnapshot(snapshot, tenant) {
|
|
362
691
|
const principal = snapshot.subject.principal;
|
|
@@ -517,8 +846,11 @@ function fromSnapshot(snapshot, options = {}) {
|
|
|
517
846
|
team: id
|
|
518
847
|
}));
|
|
519
848
|
},
|
|
520
|
-
memberships() {
|
|
521
|
-
return subject.principal?.memberships ?? [];
|
|
849
|
+
memberships(filter) {
|
|
850
|
+
return filterMemberships(subject.principal?.memberships ?? [], filter);
|
|
851
|
+
},
|
|
852
|
+
grantedPermissions() {
|
|
853
|
+
return [];
|
|
522
854
|
},
|
|
523
855
|
tenants() {
|
|
524
856
|
return snapshot.tenants;
|
|
@@ -592,4 +924,4 @@ function emptySnapshot() {
|
|
|
592
924
|
});
|
|
593
925
|
}
|
|
594
926
|
//#endregion
|
|
595
|
-
export { fromSnapshot as n, heldRoleNames as r, emptySnapshot as t };
|
|
927
|
+
export { snapshotClaim as a, whereFromGrants as c, mayUse as d, permittedIds as f, signSnapshot as i, filterMemberships as l, deniedFor as m, fromSnapshot as n, snapshotClaims as o, decideForTarget as p, heldRoleNames as r, snapshotFromClaims as s, emptySnapshot as t, delegationAllows as u };
|
|
@@ -41,7 +41,7 @@ const gen = defineLeaf({
|
|
|
41
41
|
const out = given(flags.out);
|
|
42
42
|
const outDir = given(flags["out-dir"]);
|
|
43
43
|
const from = given(flags.policy);
|
|
44
|
-
const { runGen } = await import("./gen-
|
|
44
|
+
const { runGen } = await import("./gen-WdycZ_-b.js");
|
|
45
45
|
return runGen({
|
|
46
46
|
cwd: ctx.cwd,
|
|
47
47
|
config: ctx.config,
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import { r as isRecord } from "./compact-CAf557ZB.js";
|
|
2
2
|
import { t as DESCRIBE_TITLES } from "./describe-BZAlPHxT.js";
|
|
3
3
|
import { c as listPermissions } from "./permission-registry-B8tYxPIt.js";
|
|
4
|
-
import { d as scopeList } from "./scopes-BSdYaGHs.js";
|
|
5
4
|
import { v as listRoles } from "./grantee-Dke-9rd1.js";
|
|
5
|
+
import { d as scopeList } from "./scopes-gdH__vDZ.js";
|
|
6
6
|
import { t as byCodePoint } from "./compare-DTfyUunF.js";
|
|
7
7
|
import { i as configError, n as CliError } from "./errors-BhRkoNS7.js";
|
|
8
|
-
import { c as jsonSchemaOf } from "./catalog-doc-
|
|
9
|
-
import { c as requirePolicy } from "./load-
|
|
10
|
-
import { t as loadConfiguredOperations } from "./catalog-operations-
|
|
8
|
+
import { c as jsonSchemaOf } from "./catalog-doc-Zi0jRpyH.js";
|
|
9
|
+
import { c as requirePolicy } from "./load-C4p4VgwR.js";
|
|
10
|
+
import { t as loadConfiguredOperations } from "./catalog-operations-Do1eD-Rt.js";
|
|
11
11
|
import { n as fileSummary, r as planFiles } from "./files-CfiRtQ-m.js";
|
|
12
12
|
import { f as writeOutputFiles, r as driftOf } from "./output-files-CM0BnH05.js";
|
|
13
|
-
import { t as resolveNames } from "./resolve-names-
|
|
13
|
+
import { t as resolveNames } from "./resolve-names-BnGJU88N.js";
|
|
14
14
|
import { i as schemaExpression } from "./generate-CezbCaTI.js";
|
|
15
15
|
import { existsSync, readFileSync } from "node:fs";
|
|
16
16
|
import { dirname, extname, relative, resolve } from "node:path";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { a as sole, t as compact } from "./compact-CAf557ZB.js";
|
|
2
2
|
import { a as expandRelation, c as isEdgeRelation, d as isSelfParented, l as isFieldRelation, m as restrictedStops, p as restrictedFor, s as isComputedRelation, u as isPrincipalRelation } from "./resource-relations-8-pCScBO.js";
|
|
3
3
|
import { d as isoNow } from "./time-nR1JesoH.js";
|
|
4
|
-
import { c as rootScope, d as scopeList, s as resolveScope } from "./scopes-
|
|
4
|
+
import { c as rootScope, d as scopeList, s as resolveScope } from "./scopes-gdH__vDZ.js";
|
|
5
5
|
//#region src/core/grantee-conditions.ts
|
|
6
6
|
/**
|
|
7
7
|
* Where a graph relation starts on the row: its own id when the relation is on
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { t as compact } from "./compact-CAf557ZB.js";
|
|
2
|
-
import { u as isoAt } from "./time-nR1JesoH.js";
|
|
3
|
-
import { d as scopeList, t as activeFor } from "./scopes-BSdYaGHs.js";
|
|
4
2
|
import { o as flattenGrantee } from "./grantee-Dke-9rd1.js";
|
|
5
|
-
import {
|
|
3
|
+
import { u as isoAt } from "./time-nR1JesoH.js";
|
|
4
|
+
import { d as scopeList, t as activeFor } from "./scopes-gdH__vDZ.js";
|
|
5
|
+
import { r as relationCondition, t as inheritCondition } from "./grantee-conditions-Dzprappv.js";
|
|
6
6
|
//#region src/core/grantee-match.ts
|
|
7
7
|
function combineWhere(left, right) {
|
|
8
8
|
if (left === void 0) return right;
|
package/dist/h3/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { D as Policy, N as PolicyVocabulary, en as Snapshot, yr as Principal } from "../policy-types-
|
|
2
|
-
import { a as PermDock } from "../permdock-
|
|
3
|
-
import { D as ConnectionOptions, T as Connection, f as InvalidSignatureError, i as OpenApiHooks, u as SnapshotQuery, v as discoverViaSignatureAgent, x as webBotAuthVerifier } from "../server-types
|
|
4
|
-
import { a as ProtectTarget, n as FetchAdapterOptions, r as FetchProtect, t as ContextReader } from "../fetch-adapter-
|
|
1
|
+
import { D as Policy, N as PolicyVocabulary, en as Snapshot, yr as Principal } from "../policy-types-rNfz7t0M.js";
|
|
2
|
+
import { a as PermDock } from "../permdock-BaB-KQqn.js";
|
|
3
|
+
import { D as ConnectionOptions, T as Connection, f as InvalidSignatureError, i as OpenApiHooks, u as SnapshotQuery, v as discoverViaSignatureAgent, x as webBotAuthVerifier } from "../server-types--_Hann81.js";
|
|
4
|
+
import { a as ProtectTarget, n as FetchAdapterOptions, r as FetchProtect, t as ContextReader } from "../fetch-adapter-DxqsIXSO.js";
|
|
5
5
|
import { EventHandler, H3Event, H3EventContext, Middleware } from "h3";
|
|
6
6
|
//#region src/h3/create.d.ts
|
|
7
7
|
type H3PermDockOptions<TUser = unknown> = FetchAdapterOptions<H3Event, TUser>;
|
package/dist/h3/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { i as decorate } from "../bind-
|
|
3
|
-
import { t as fetchAdapter } from "../fetch-adapter-
|
|
1
|
+
import { f as InvalidSignatureError, g as webBotAuthVerifier, p as discoverViaSignatureAgent } from "../evaluations-BzTDWO4m.js";
|
|
2
|
+
import { i as decorate } from "../bind-B4Z0U2Gr.js";
|
|
3
|
+
import { t as fetchAdapter } from "../fetch-adapter-MoYZ-vF5.js";
|
|
4
4
|
//#region src/h3/create.ts
|
|
5
5
|
function createPermDock(policy, options) {
|
|
6
6
|
const adapter = fetchAdapter(policy, options, "h3", (event) => event.req);
|
|
@@ -5,12 +5,33 @@ import { n as describe } from "./describe-BZAlPHxT.js";
|
|
|
5
5
|
import { i as getRegistry, n as findPermission } from "./permission-registry-B8tYxPIt.js";
|
|
6
6
|
import { t as assertAppData } from "./app-data-UNNm07jV.js";
|
|
7
7
|
import { a as durationOf, i as dateAt, u as isoAt } from "./time-nR1JesoH.js";
|
|
8
|
-
import { r as relationReader, t as pendingRelations } from "./relations-BxvRvDHK.js";
|
|
9
|
-
import { n as resolveRelated } from "./relation-walk-DK_gkgL7.js";
|
|
10
8
|
import { n as toWireDelegation } from "./wire-delegation-Cv3W2eaM.js";
|
|
9
|
+
import { r as relationReader, t as pendingRelations } from "./relations-CMsJ1ARY.js";
|
|
10
|
+
import { n as resolveRelated } from "./relation-walk-BDTaTKTM.js";
|
|
11
11
|
import { i as approverRelationKey, s as ApprovalError, t as APPROVAL_HEADER } from "./types-CcUXciSj.js";
|
|
12
|
-
import { n as assertApprover, u as listAllApprovals } from "./store-
|
|
12
|
+
import { n as assertApprover, u as listAllApprovals } from "./store-BpKH-pLm.js";
|
|
13
13
|
import { n as parseApprovalHeader } from "./approval-header-8QV6MU4H.js";
|
|
14
|
+
//#region src/approvals/directory.ts
|
|
15
|
+
/**
|
|
16
|
+
* The number of eligible approvers other than `by` and the request's principal,
|
|
17
|
+
* or `undefined` when the request has no `fallback: 'confirm'`, there is no
|
|
18
|
+
* directory, or it cannot answer.
|
|
19
|
+
*/
|
|
20
|
+
async function countOtherApprovers(request, by, directory) {
|
|
21
|
+
if (directory === void 0 || request.approvers?.fallback !== "confirm") return;
|
|
22
|
+
let ids;
|
|
23
|
+
try {
|
|
24
|
+
ids = await directory.approversFor(request);
|
|
25
|
+
} catch {
|
|
26
|
+
return;
|
|
27
|
+
}
|
|
28
|
+
if (ids === null) return;
|
|
29
|
+
const excluded = /* @__PURE__ */ new Set();
|
|
30
|
+
for (const subject of [by, request.subject]) if (subject.principal !== null) excluded.add(subject.principal.id);
|
|
31
|
+
if (request.subject.actor !== void 0) excluded.add(request.subject.actor.id);
|
|
32
|
+
return new Set(ids.filter((id) => !excluded.has(id))).size;
|
|
33
|
+
}
|
|
34
|
+
//#endregion
|
|
14
35
|
//#region src/approvals/relations.ts
|
|
15
36
|
const DEFAULT_PARENT_DEPTH = 16;
|
|
16
37
|
/**
|
|
@@ -200,27 +221,6 @@ async function heldPermissions(request, subject, permdockFor) {
|
|
|
200
221
|
}
|
|
201
222
|
}
|
|
202
223
|
//#endregion
|
|
203
|
-
//#region src/approvals/directory.ts
|
|
204
|
-
/**
|
|
205
|
-
* The number of eligible approvers other than `by` and the request's principal,
|
|
206
|
-
* or `undefined` when the request has no `fallback: 'confirm'`, there is no
|
|
207
|
-
* directory, or it cannot answer.
|
|
208
|
-
*/
|
|
209
|
-
async function countOtherApprovers(request, by, directory) {
|
|
210
|
-
if (directory === void 0 || request.approvers?.fallback !== "confirm") return;
|
|
211
|
-
let ids;
|
|
212
|
-
try {
|
|
213
|
-
ids = await directory.approversFor(request);
|
|
214
|
-
} catch {
|
|
215
|
-
return;
|
|
216
|
-
}
|
|
217
|
-
if (ids === null) return;
|
|
218
|
-
const excluded = /* @__PURE__ */ new Set();
|
|
219
|
-
for (const subject of [by, request.subject]) if (subject.principal !== null) excluded.add(subject.principal.id);
|
|
220
|
-
if (request.subject.actor !== void 0) excluded.add(request.subject.actor.id);
|
|
221
|
-
return new Set(ids.filter((id) => !excluded.has(id))).size;
|
|
222
|
-
}
|
|
223
|
-
//#endregion
|
|
224
224
|
//#region src/approvals/helpers.ts
|
|
225
225
|
function permissionMeta(permission) {
|
|
226
226
|
return {
|
|
@@ -534,4 +534,4 @@ async function storedApprovalToken(store, decision, options = {}) {
|
|
|
534
534
|
}
|
|
535
535
|
}
|
|
536
536
|
//#endregion
|
|
537
|
-
export { requestApproval as a, resumeFromHeader as c, vouchApproval as d,
|
|
537
|
+
export { requestApproval as a, resumeFromHeader as c, vouchApproval as d, approverPermissions as f, countOtherApprovers as g, managerKeys as h, readApprovalHeader as i, storedApprovalToken as l, approverRelations as m, consumeApproval as n, resolveApproval as o, heldPermissions as p, inspectApproval as r, resumeDecision as s, cancelApprovals as t, summarizeSubject as u };
|
package/dist/hono/index.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { D as Policy, N as PolicyVocabulary, yr as Principal } from "../policy-types-
|
|
2
|
-
import {
|
|
3
|
-
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 PermDock } from "../permdock-BaB-KQqn.js";
|
|
4
4
|
import { n as RevocationFeed } from "../revocations-BaUXHM1N.js";
|
|
5
|
-
import { D as ConnectionOptions, T as Connection, f as InvalidSignatureError, i as OpenApiHooks, o as ProtectOptions, v as discoverViaSignatureAgent, x as webBotAuthVerifier } from "../server-types
|
|
6
|
-
import { t as ServerAdapterOptions } from "../bind-
|
|
5
|
+
import { D as ConnectionOptions, T as Connection, f as InvalidSignatureError, i as OpenApiHooks, o as ProtectOptions, v as discoverViaSignatureAgent, x as webBotAuthVerifier } from "../server-types--_Hann81.js";
|
|
6
|
+
import { t as ServerAdapterOptions } from "../bind-CnOMjazH.js";
|
|
7
7
|
import { Context, Hono, MiddlewareHandler } from "hono";
|
|
8
8
|
import { SSEMessage, SSEStreamingApi } from "hono/streaming";
|
|
9
9
|
import { WSEvents } from "hono/ws";
|
package/dist/hono/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { t as compact } from "../compact-CAf557ZB.js";
|
|
2
2
|
import { r as PermDockRevokedError } from "../errors-ynga1EQy.js";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
3
|
+
import { f as InvalidSignatureError, g as webBotAuthVerifier, p as discoverViaSignatureAgent } from "../evaluations-BzTDWO4m.js";
|
|
4
|
+
import { r as bindKernel } from "../bind-B4Z0U2Gr.js";
|
|
5
|
+
import { t as problemFromError } from "../map-error-p4ROJ_26.js";
|
|
6
6
|
import { a as onRevoked, n as closeReason, r as guardIterable, t as POLICY_VIOLATION } from "../stream-DQ3rbO3J.js";
|
|
7
7
|
import { Hono } from "hono";
|
|
8
8
|
//#region src/hono/create.ts
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { r as isRecord, t as compact } from "./compact-CAf557ZB.js";
|
|
2
2
|
import { n as freezeDeep } from "./freeze-jjan0lCv.js";
|
|
3
3
|
import { n as isForbiddenKey, s as splitPath } from "./paths-CUvURzHp.js";
|
|
4
|
-
import { a as deny, i as completeGrant, l as normalizeWhere, n as role, r as allow } from "./role-builder-
|
|
4
|
+
import { a as deny, i as completeGrant, l as normalizeWhere, n as role, r as allow } from "./role-builder-boQiUvfo.js";
|
|
5
5
|
import { a as getResource, n as findPermission } from "./permission-registry-B8tYxPIt.js";
|
|
6
6
|
import { d as isSelfParented } from "./resource-relations-8-pCScBO.js";
|
|
7
|
+
import { _ as listPlans, m as findRole, o as flattenGrantee } from "./grantee-Dke-9rd1.js";
|
|
7
8
|
import { a as durationOf, l as isRfc3339, m as rfc3339 } from "./time-nR1JesoH.js";
|
|
8
9
|
import { r as sha256Digest } from "./sha256-C-4WXKIu.js";
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import { a as indexPolicy, n as declaredRoleNames } from "./policy-CaAME-Rh.js";
|
|
10
|
+
import { o as readWireApproval } from "./approval-normalize-DNLW0zOM.js";
|
|
11
|
+
import { a as indexPolicy, n as declaredRoleNames } from "./policy-wGzbAPQF.js";
|
|
12
12
|
//#region src/core/hosted.ts
|
|
13
13
|
function memoryPolicySource(document = null) {
|
|
14
14
|
const current = document === null ? null : parsePolicyDocument(document);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { D as Policy, Er as Condition, In as Grantee, s as ApprovalRequirement } from "./policy-types-
|
|
1
|
+
import { D as Policy, Er as Condition, In as Grantee, s as ApprovalRequirement } from "./policy-types-rNfz7t0M.js";
|
|
2
2
|
//#region src/core/hosted.d.ts
|
|
3
3
|
/**
|
|
4
4
|
* One grant authored in PermDock Cloud; its grantee is a declared role, plan or
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { t as timeoutSignal } from "./timeout-D51niuQP.js";
|
|
2
2
|
import { a as describeError, n as CliError } from "./errors-BhRkoNS7.js";
|
|
3
3
|
import { s as cliVersion } from "./version-DMQ0dnN5.js";
|
|
4
|
-
import "./device-
|
|
4
|
+
import "./device-BkSynWdg.js";
|
|
5
5
|
//#region src/cli/core/http.ts
|
|
6
6
|
/**
|
|
7
7
|
* `permdock-cli/<version> node/<version> <platform>`, sent on every request the
|