permdock 0.17.0 → 0.18.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/dist/a2a/index.d.ts +4 -4
- package/dist/a2a/index.js +3 -3
- package/dist/{adoption-scan-Ci0xiJ3T.js → adoption-scan-CxExBYSJ.js} +1 -1
- package/dist/agent/index.d.ts +2 -2
- package/dist/agent/index.js +1 -1
- package/dist/ai-sdk/index.d.ts +3 -3
- package/dist/ai-sdk/index.js +3 -3
- package/dist/{approval-normalize-4KxMRdJC.js → approval-normalize-CUjgSsOl.js} +1 -1
- package/dist/{approval-policies-9VagPixq.d.ts → approval-policies-oNnckT12.d.ts} +1 -1
- package/dist/{approval-prompt-BSh-yxbH.d.ts → approval-prompt-Bg7gDSqd.d.ts} +1 -1
- package/dist/approvals/index.d.ts +3 -3
- package/dist/approvals/index.js +3 -3
- package/dist/{approvals-DdFcTncq.js → approvals-DGId_hgJ.js} +2 -2
- package/dist/{approvers-CNtl4Vc5.js → approvers-BaNwKYgd.js} +1 -3
- package/dist/{arazzo-_zUmT8ZT.js → arazzo--riLuGY0.js} +2 -2
- package/dist/{arazzo-7kbeh1yi.js → arazzo-CEDbb-uM.js} +1 -1
- package/dist/astro/index.d.ts +4 -4
- package/dist/astro/index.js +2 -2
- package/dist/{audience-jRO819i3.js → audience-B4YR9UpV.js} +1 -1
- package/dist/authzen/index.d.ts +5 -5
- package/dist/authzen/index.js +2 -2
- package/dist/{automation-DCWuVKtd.d.ts → automation-Bfa_wD1h.d.ts} +1 -1
- package/dist/better-auth/index.d.ts +1 -1
- package/dist/better-auth/index.js +1 -1
- package/dist/better-supabase/index.d.ts +153 -91
- package/dist/better-supabase/index.js +332 -62
- package/dist/{bind-BJFeLX1V.js → bind-B4pMH9bm.js} +4 -4
- package/dist/{bind-DjFNX0Pq.d.ts → bind-DR6ku3A9.d.ts} +7 -7
- package/dist/{build-instance-lye7oEqf.js → build-instance-BFMFQdE_.js} +1 -1
- package/dist/{capability-BzjWdKmP.d.ts → capability-BZ_veK9o.d.ts} +1 -1
- package/dist/{casbin-DFzk_so3.js → casbin-DCQHkkyj.js} +1 -1
- package/dist/{casbin-C3O_O9nu.js → casbin-bKC1FpEx.js} +1 -1
- package/dist/catalog/index.d.ts +4 -4
- package/dist/catalog/index.js +5 -5
- package/dist/catalog-Caqhbdix.js +1 -0
- package/dist/{catalog-DGDd_ww1.js → catalog-D1fw8qif.js} +2 -2
- package/dist/{catalog-operations-DVI5QO5R.js → catalog-operations-BD22drQf.js} +2 -2
- package/dist/{catalog-DJJIkR9P.js → catalog-zzNuR3sY.js} +1 -1
- package/dist/{challenge-M_ghKJnT.js → challenge-B2O2OLEk.js} +1 -1
- package/dist/chat/index.d.ts +1 -1
- package/dist/chat/index.js +2 -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 +2 -2
- package/dist/cli/bin.js +1 -1
- package/dist/cli/index.d.ts +4 -4
- package/dist/cli/index.js +2 -2
- package/dist/client-CH7vzSAY.d.ts +32 -0
- package/dist/cloud/index.d.ts +8 -8
- package/dist/cloud/index.js +1 -1
- package/dist/{cloud-DYqzmh5i.js → cloud-C0vXBmLG.js} +2 -2
- package/dist/{codemod-DqB9klYI.js → codemod-C-L0w-u7.js} +2 -2
- package/dist/{codemod-DNGMGqBS.js → codemod-eYI1FbeJ.js} +1 -1
- package/dist/{collect-C44RrKCI.js → collect-CU85z6Ta.js} +2 -2
- package/dist/{collect-HfJXl8Tr.js → collect-D878zLDP.js} +1 -1
- package/dist/collect-KCtOigxx.js +1 -0
- package/dist/compile/index.d.ts +1 -1
- package/dist/{compile-BxiwRotu.d.ts → compile-DBm0ub4p.d.ts} +2 -2
- package/dist/{completion-pwVjJlek.js → completion-Dauc6pVT.js} +1 -1
- package/dist/{config-DnfH6_eT.js → config-DWp2PucY.js} +1 -1
- package/dist/{config-report-C1jl7Na-.js → config-report-DKpFm5ID.js} +2 -2
- package/dist/convex/index.d.ts +4 -4
- package/dist/convex/index.js +2 -2
- package/dist/{core-W5f4Rjt0.js → core-B8sLve3z.js} +3 -3
- package/dist/{core-0iYZ5HUx.d.ts → core-D87h2kpR.d.ts} +2 -2
- package/dist/{create-jCPwPWXf.js → create-3A7J9KRR.js} +4 -4
- package/dist/{create-DrHUmKvG.d.ts → create-BrQXL-Wt.d.ts} +6 -6
- package/dist/{create-bzQlBzG4.d.ts → create-BzwjZuRS.d.ts} +7 -7
- package/dist/{create-gqtDb1nU.js → create-C-tm3KIF.js} +3 -3
- package/dist/{create-DNN3OtsO.d.ts → create-CtoT1lIQ.d.ts} +4 -4
- package/dist/delivery/index.d.ts +4 -4
- package/dist/delivery/index.js +1 -1
- package/dist/{denied-text-DyzWwxEB.d.ts → denied-text-DlIxt8fh.d.ts} +1 -1
- package/dist/{describe-nalX_HHE.d.ts → describe-BKtC_8PG.d.ts} +1 -1
- package/dist/{describe-CogP1loh.js → describe-BZAlPHxT.js} +1 -1
- package/dist/{diff-BTsLiW59.js → diff-BnNHqtHj.js} +4 -4
- package/dist/{diff-CcxYooMu.js → diff-CBCzOTWM.js} +1 -1
- package/dist/{doctor-DS-9ApID.js → doctor-CkYKCuX7.js} +55 -17
- package/dist/{doctor-BNRhJegR.js → doctor-xUpR5rXg.js} +2 -2
- package/dist/drizzle/index.d.ts +3 -3
- package/dist/elysia/index.d.ts +4 -4
- package/dist/elysia/index.js +3 -3
- package/dist/{errors-Dc9FdamT.d.ts → errors-TpzkEKgJ.d.ts} +1 -1
- package/dist/{evaluate-CsjXeLRo.js → evaluate-Czbj7thS.js} +2 -2
- package/dist/{evaluations-BasA9zXp.d.ts → evaluations-CisTTURl.d.ts} +3 -3
- package/dist/{evaluations-DG40eSJa.js → evaluations-h3KoJAPa.js} +1 -1
- package/dist/eve/index.d.ts +4 -4
- package/dist/eve/index.js +3 -3
- package/dist/express/index.d.ts +4 -4
- package/dist/express/index.js +3 -3
- package/dist/fastify/index.d.ts +4 -4
- package/dist/fastify/index.js +3 -3
- package/dist/{fetch-adapter-BgqpOOpd.d.ts → fetch-adapter-BdmfnbJM.d.ts} +2 -2
- package/dist/{fetch-adapter-UZOW0PRC.js → fetch-adapter-DH-NJPbL.js} +2 -2
- package/dist/{fixtures-0VTW5oNq.js → fixtures-Cemqurt8.js} +8 -2
- package/dist/{gen-CNCzG4sB.js → gen-BEIN-DRM.js} +1 -1
- package/dist/{gen-DnpZwQPo.js → gen-mf-MRwVr.js} +3 -3
- package/dist/h3/index.d.ts +4 -4
- package/dist/h3/index.js +3 -3
- package/dist/{helpers-DNnZffrI.js → helpers-DmqGy63f.js} +21 -13
- package/dist/hono/index.d.ts +4 -4
- package/dist/hono/index.js +3 -3
- package/dist/{hosted-DxRLLiFU.d.ts → hosted-BFNXwcjd.d.ts} +1 -1
- package/dist/{hosted-tPZnyjQS.js → hosted-waouw2V-.js} +3 -3
- package/dist/{import-BYVbSKx0.js → import-DObwEota.js} +1 -1
- package/dist/{index-z44pfWar.d.ts → index-BhnOOnp9.d.ts} +2 -2
- package/dist/{index-DFwUOkvt.d.ts → index-CVGio3cH.d.ts} +4 -4
- package/dist/{index-CXXUFWtG.d.ts → index-CdMOd-GY.d.ts} +4 -4
- package/dist/{index-Bt-UoBWu.d.ts → index-CdUTE6qd.d.ts} +8 -8
- package/dist/{index-CZ5mixHO.d.ts → index-Dfv9Toct.d.ts} +1 -1
- package/dist/{index-DtGtDzjb.d.ts → index-rFp6X_QP.d.ts} +4 -4
- package/dist/index.d.ts +17 -17
- package/dist/index.js +15 -13
- package/dist/{init-YSDySeMy.js → init-CNJ8lLjo.js} +1 -1
- package/dist/{init-Dr1qAStu.js → init-DS3PEsCG.js} +3 -3
- package/dist/{instance-options-BOCRxEFb.d.ts → instance-options-2sFGSdsf.d.ts} +1 -1
- package/dist/{instance-snapshot-BgOGtyCy.js → instance-snapshot-BWa71my8.js} +2 -2
- package/dist/jwt/index.d.ts +4 -4
- package/dist/{kernel-CDDU93dI.js → kernel-30Z2zM_d.js} +6 -6
- package/dist/kysely/index.d.ts +3 -3
- package/dist/{login-CXgEKLaW.js → login-BgK5Jloo.js} +1 -1
- package/dist/{login-DEVXDTX8.js → login-DUVzBLh7.js} +3 -3
- package/dist/{manifest-BXTbHNIV.js → manifest-BdzBobNK.js} +1 -1
- package/dist/{manifest-schema-DQkBK2Mr.js → manifest-schema-CsFsYLF-.js} +1 -1
- package/dist/{manifest-Dij1U0hx.js → manifest-wclLWBVH.js} +35 -35
- package/dist/{map-error-B_f3C5cs.js → map-error-BH16Ah8P.js} +1 -1
- package/dist/mcp/index.d.ts +8 -8
- package/dist/mcp/index.js +5 -5
- package/dist/nest/index.d.ts +4 -4
- package/dist/nest/index.js +3 -3
- package/dist/next/index.d.ts +23 -10
- package/dist/next/index.js +29 -9
- package/dist/next/plugin.d.ts +1 -1
- package/dist/next/plugin.js +1 -1
- package/dist/node/index.d.ts +4 -4
- package/dist/node/index.js +2 -2
- package/dist/openai/index.d.ts +4 -4
- package/dist/openai/index.js +3 -3
- package/dist/openapi/index.d.ts +2 -2
- package/dist/{openapi-D3wkvOoU.js → openapi-C4gFqeRz.js} +2 -2
- package/dist/{openapi-GM-kTdkq.js → openapi-zMEB9qxn.js} +2 -2
- package/dist/{operation-findings-CXtFzlKJ.js → operation-findings-CVwJHEu_.js} +1 -1
- package/dist/operation-risks-BKOcTv8J.js +13 -0
- package/dist/operations-Bm9HFecz.js +89 -0
- package/dist/orpc/index.d.ts +5 -5
- package/dist/orpc/index.js +3 -3
- package/dist/otel/index.d.ts +3 -3
- package/dist/{output-DhTpe8v1.js → output-BFWLER4r.js} +1 -1
- package/dist/{ownership-moSRhxl_.js → ownership-D-mIt-w0.js} +1 -1
- package/dist/{parse-local-manifest-DEiCF4ah.js → parse-local-manifest-CxcSMQgl.js} +2 -2
- package/dist/{parse-local-manifest-BgTYdR3q.d.ts → parse-local-manifest-DvjTQNuO.d.ts} +1 -1
- package/dist/pdp/index.d.ts +3 -3
- package/dist/pdp/index.js +1 -1
- package/dist/{permdock-DdzMv5-F.js → permdock-D-_WrdKu.js} +18 -8
- package/dist/{permdock-DUWZEOLR.d.ts → permdock-ffY4CMd9.d.ts} +20 -7
- package/dist/{permissions-CvpPtz5O.js → permissions-B3ggI88M.js} +2 -2
- package/dist/{permissions-CVXmRILq.js → permissions-BaoLxy66.js} +1 -13
- package/dist/{policy-CTNl7pvN.d.ts → policy-BtKSApSt.d.ts} +1 -1
- package/dist/{policy-DxQyHKPB.js → policy-cV_wwPb8.js} +2 -2
- package/dist/{policy-from-catalog-DVa1faOr.js → policy-from-catalog-B68hGC0S.js} +6 -6
- package/dist/{policy-types-IRJVABmm.d.ts → policy-types-D-GwfQTc.d.ts} +9 -0
- package/dist/{postgrest-B_cEDd4e.d.ts → postgrest-D84p5dbA.d.ts} +1 -1
- package/dist/{powersync-C0nsyULQ.js → powersync-9PYOE1wt.js} +150 -13
- package/dist/{powersync-BZxw_v-A.js → powersync-DStC_g0B.js} +2 -2
- package/dist/powersync-xNRlC4jN.js +1 -0
- package/dist/prisma/index.d.ts +2 -2
- package/dist/{protected-action-qowj6nxN.js → protected-action-B40tU3yP.js} +2 -2
- package/dist/{protected-action-D3S9U4nc.d.ts → protected-action-Ds_EUY8B.d.ts} +5 -5
- package/dist/{protected-action-B6n6w7Rl.js → protected-action-OpOxtTsN.js} +1 -1
- package/dist/{provider-CjAu39fJ.d.ts → provider-OtnIiFWm.d.ts} +1 -1
- package/dist/{pull-DVoZ0V9_.js → pull-DLP4I1Kl.js} +2 -2
- package/dist/pull-UBjDnf4b.js +1 -0
- package/dist/{push-eJl1Tvqm.js → push-BSb8j1EW.js} +3 -3
- package/dist/{pushed-policy-DMXAOmEW.js → pushed-policy-BecMsTtM.js} +1 -1
- package/dist/{pushed-policy-CUQuvlS3.d.ts → pushed-policy-Ck3FZcoy.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-native/index.d.ts +103 -38
- package/dist/react-native/index.js +194 -35
- package/dist/{replay-Dc3d8LhG.d.ts → replay-E5X9E1lC.d.ts} +1 -1
- package/dist/{request-context-Ch052blg.js → request-context-DM6_jY1n.js} +1 -1
- package/dist/resend/index.d.ts +4 -4
- package/dist/{resolve-names-1nCei24V.js → resolve-names-CBl4r4_r.js} +1 -1
- package/dist/{rls-ClJRblnR.js → rls-DGBL-jDY.js} +10 -10
- package/dist/{rls-BVzoZCn3.js → rls-pAHGYgTb.js} +1 -1
- package/dist/{role-builder-BrmOcXch.js → role-builder-CMW4wWzn.js} +1 -1
- package/dist/{rpc-BOu3FD6X.js → rpc-KwX_Jcxz.js} +1 -1
- package/dist/{run-CnCaTjWX.js → run-B7lv3NuK.js} +2 -2
- package/dist/run-UPbacxPg.js +1 -0
- package/dist/{run-ticket-C6lXvHM_.d.ts → run-ticket-DPaD27_r.d.ts} +2 -2
- package/dist/{runtime-CBXkOcg9.js → runtime-rf0ZuyF3.js} +1 -1
- package/dist/{saas-BqM9mJkk.js → saas-B8H1MsQ3.js} +4 -4
- package/dist/{scan-CepUXrFt.js → scan-0r3OZqqK.js} +1 -1
- package/dist/{schema-9_NDz8fx.js → schema-B_9tXrbG.js} +1 -1
- package/dist/scim/index.d.ts +1 -1
- package/dist/server/index.d.ts +10 -10
- package/dist/server/index.js +3 -3
- package/dist/{server-types-Bw-lWqzR.d.ts → server-types-3OnXjZ2D.d.ts} +8 -8
- package/dist/{sink-DUzt0e4B.d.ts → sink-ogbVkyeo.d.ts} +2 -2
- package/dist/{skills-BUuH-QFt.js → skills-B4MPRxQd.js} +1 -1
- package/dist/{skills-a4N6Y2Xm.js → skills-C9sTD70r.js} +1 -1
- package/dist/{snapshot-cache-Dbk-Gnij.d.ts → snapshot-cache-B4YvlGG_.d.ts} +1 -1
- package/dist/solid/index.d.ts +5 -5
- package/dist/solid/index.js +3 -3
- package/dist/solid-start/index.d.ts +4 -4
- package/dist/solid-start/index.js +3 -3
- package/dist/{sources-CXY05xtB.d.ts → sources-xdQShLDU.d.ts} +1 -1
- package/dist/{src-nYNBfmgq.js → src-Brzq_0in.js} +21 -104
- package/dist/ssf/index.d.ts +3 -3
- package/dist/ssf/index.js +1 -1
- package/dist/{standard-webhooks-BFeEpjxy.d.ts → standard-webhooks-BfPaZ6T1.d.ts} +2 -2
- package/dist/{store-g5ctUrOI.d.ts → store-DYeB-_U3.d.ts} +4 -4
- package/dist/{store-XgBMbfDy.js → store-DmVqy74I.js} +2 -2
- package/dist/{stores-53_kOwPi.js → stores-BYFopOm1.js} +2 -2
- package/dist/{stores-BtdN3eDO.d.ts → stores-EPul_8MN.d.ts} +5 -5
- package/dist/{stream-BMJg56jU.d.ts → stream-W2RuUYly.d.ts} +1 -1
- package/dist/supabase/client.d.ts +2 -31
- package/dist/supabase/index.d.ts +5 -5
- package/dist/supabase/index.js +3 -3
- package/dist/supabase/middleware.d.ts +5 -5
- package/dist/supabase/middleware.js +4 -4
- package/dist/{supabase-C8cNzp4i.js → supabase-BiViJpQ4.js} +1 -1
- package/dist/{supabase-C6FyUeSh.js → supabase-CogTyJH2.js} +2 -2
- package/dist/supabase-hook-BN46IrVI.js +1 -0
- package/dist/{supabase-hook-Cj85nccs.js → supabase-hook-DX38Hj8h.js} +238 -23
- package/dist/{supautils-BP_5WAIc.js → supautils-BGf6zRvM.js} +6 -6
- package/dist/svelte/index.d.ts +5 -5
- package/dist/svelte/index.js +5 -5
- package/dist/svelte/runtime.d.ts +3 -3
- package/dist/svelte/runtime.js +2 -2
- package/dist/svelte/source.d.ts +5 -5
- package/dist/svelte/source.js +3 -3
- package/dist/sveltekit/index.d.ts +4 -4
- package/dist/sveltekit/index.js +2 -2
- package/dist/{tables-BsGE6HBR.js → tables-BfOk0ymL.js} +1 -1
- package/dist/tanstack-start/index.d.ts +4 -4
- package/dist/tanstack-start/index.js +2 -2
- package/dist/terminal/index.d.ts +5 -5
- package/dist/terminal/index.js +3 -3
- package/dist/testing/core.d.ts +1 -1
- package/dist/testing/core.js +1 -1
- package/dist/testing/fixtures/index.js +1 -1
- package/dist/testing/index.d.ts +22 -22
- package/dist/testing/index.js +15 -15
- package/dist/testing/saas/index.d.ts +3 -3
- package/dist/testing/saas/index.js +2 -2
- package/dist/testing/saas/permissions.js +1 -1
- package/dist/{tool-refusal-C1UlhU0V.js → tool-refusal-D4spOJ7I.js} +1 -1
- package/dist/trpc/index.d.ts +5 -5
- package/dist/trpc/index.js +3 -3
- package/dist/{type-helpers-C_OnZW8c.d.ts → type-helpers-i1EJ3Eb1.d.ts} +1 -1
- package/dist/{types-CAAN7evk.d.ts → types-3Y8UpFkF.d.ts} +17 -1
- package/dist/{types-B3BOcI0J.d.ts → types-B8qUkGja.d.ts} +2 -2
- package/dist/{types-UfpcY575.d.ts → types-CCEeSCMB.d.ts} +3 -3
- package/dist/{types-AOP5HQku.d.ts → types-CDVXR6YD.d.ts} +1 -1
- package/dist/{types-CJC1aaoJ.d.ts → types-Ck1KOfug.d.ts} +2 -2
- package/dist/{types-BvBbkAu1.d.ts → types-CqcsNCaN.d.ts} +1 -1
- package/dist/{types-CA-A33Q5.d.ts → types-D-JO7lh8.d.ts} +4 -4
- package/dist/{types-DVZNTkU0.d.ts → types-D19MK4t-.d.ts} +3 -3
- package/dist/{types-Sj1U8HMm.d.ts → types-DGf_cpKF.d.ts} +2 -2
- package/dist/{types-e82uzrTn.d.ts → types-DmbfLu2p.d.ts} +4 -4
- package/dist/{types-D29K5ZNP.d.ts → types-o1vu6Ks3.d.ts} +4 -4
- package/dist/unplugin/index.d.ts +1 -1
- package/dist/unplugin/index.js +1 -1
- package/dist/usage-Cl5eb-e1.js +1 -0
- package/dist/{usage-COsGLht5.js → usage-DC0UKe6C.js} +3 -3
- package/dist/{usage-CqcMeQgX.js → usage-DYtRVkcN.js} +1 -1
- package/dist/{validation-error-DpvsBwZJ.d.ts → validation-error-Dx8PipbO.d.ts} +1 -1
- package/dist/{verify-C8G8D5mk.js → verify-Bpj0hauG.js} +8 -8
- package/dist/{version-cache-9Vq5QVFC.d.ts → version-cache-DzNKWiI6.d.ts} +1 -1
- package/dist/{views-TrZYlDnM.js → views-MWmJ6Y4P.js} +1 -1
- package/dist/vue/index.d.ts +5 -5
- package/dist/vue/index.js +3 -3
- package/dist/{waiter-C2cXXLFZ.d.ts → waiter-NK_UuZbb.d.ts} +2 -2
- package/dist/{watch-DXRDBSCu.js → watch-CBHADqBH.js} +1 -1
- package/dist/watch-OYwAPCzx.js +1 -0
- package/dist/webmcp/index.d.ts +1 -1
- package/dist/webmcp/index.js +1 -1
- package/dist/{who-can-BY5d3HPw.js → who-can-KhVWMxtf.js} +1 -1
- package/dist/workflow/index.d.ts +3 -3
- package/dist/workflow/index.js +2 -2
- package/dist/workflow-sdk/index.d.ts +4 -4
- package/dist/{wrap-DpZAbxuD.d.ts → wrap-BHGA-SMM.d.ts} +2 -2
- package/package.json +1 -1
- package/schemas/supabase-manifest-v1.json +1 -1
- package/skills/permdock-approvals/references/stores-and-resume.md +1 -1
- package/skills/permdock-wire/references/adapters.md +3 -1
- package/dist/catalog-BpnjesqX.js +0 -1
- package/dist/collect-CAibhmCi.js +0 -1
- package/dist/powersync-Cqzx25dI.js +0 -1
- package/dist/pull-CUVdB04v.js +0 -1
- package/dist/run-D9N6V5WQ.js +0 -1
- package/dist/supabase-hook-CPBX4dy5.js +0 -1
- package/dist/usage-D1cpHO7p.js +0 -1
- package/dist/watch-DnymTAfe.js +0 -1
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
//#region src/core/operation-risks.ts
|
|
2
|
+
/** Every `meta.risk` level, lowest first. */
|
|
3
|
+
const OPERATION_RISKS = Object.freeze([
|
|
4
|
+
"low",
|
|
5
|
+
"medium",
|
|
6
|
+
"high",
|
|
7
|
+
"critical"
|
|
8
|
+
]);
|
|
9
|
+
function isOperationRisk(value) {
|
|
10
|
+
return OPERATION_RISKS.some((risk) => risk === value);
|
|
11
|
+
}
|
|
12
|
+
//#endregion
|
|
13
|
+
export { isOperationRisk as n, OPERATION_RISKS as t };
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import { n as isForbiddenKey } from "./paths-CUvURzHp.js";
|
|
2
|
+
import { c as listPermissions, o as isPermission } from "./permission-registry-B8tYxPIt.js";
|
|
3
|
+
import { n as isOperationRisk, t as OPERATION_RISKS } from "./operation-risks-BKOcTv8J.js";
|
|
4
|
+
//#region src/core/operations.ts
|
|
5
|
+
const OPERATION_EFFECTS = Object.freeze([
|
|
6
|
+
"read",
|
|
7
|
+
"write",
|
|
8
|
+
"delete",
|
|
9
|
+
"send",
|
|
10
|
+
"spend",
|
|
11
|
+
"external"
|
|
12
|
+
]);
|
|
13
|
+
/**
|
|
14
|
+
* MCP tool-name characters (MCP 2025-11-25, Tools: Tool names), so a name works
|
|
15
|
+
* as a tool name unchanged.
|
|
16
|
+
*/
|
|
17
|
+
const NAME = /^[A-Za-z0-9_.-]{1,128}$/u;
|
|
18
|
+
const META_KEYS = /* @__PURE__ */ new Set([
|
|
19
|
+
"risk",
|
|
20
|
+
"effects",
|
|
21
|
+
"title"
|
|
22
|
+
]);
|
|
23
|
+
function isOperationEffect(value) {
|
|
24
|
+
return OPERATION_EFFECTS.some((effect) => effect === value);
|
|
25
|
+
}
|
|
26
|
+
function readMeta(name, value) {
|
|
27
|
+
if (value === void 0) return Object.freeze({});
|
|
28
|
+
if (value === null || typeof value !== "object" || Array.isArray(value)) throw new TypeError(`Operation "${name}": meta must be an object.`);
|
|
29
|
+
for (const key of Object.keys(value)) if (!META_KEYS.has(key)) throw new TypeError(`Operation "${name}": meta.${key} is not one of risk, effects, title.`);
|
|
30
|
+
const meta = {};
|
|
31
|
+
const risk = Reflect.get(value, "risk");
|
|
32
|
+
if (risk !== void 0) {
|
|
33
|
+
if (!isOperationRisk(risk)) throw new TypeError(`Operation "${name}": meta.risk must be one of ${OPERATION_RISKS.join(", ")}.`);
|
|
34
|
+
meta.risk = risk;
|
|
35
|
+
}
|
|
36
|
+
const effects = Reflect.get(value, "effects");
|
|
37
|
+
if (effects !== void 0) {
|
|
38
|
+
if (!Array.isArray(effects) || !effects.every(isOperationEffect) || new Set(effects).size !== effects.length) throw new TypeError(`Operation "${name}": meta.effects must list distinct values of ${OPERATION_EFFECTS.join(", ")}.`);
|
|
39
|
+
meta.effects = Object.freeze([...effects]);
|
|
40
|
+
}
|
|
41
|
+
const title = Reflect.get(value, "title");
|
|
42
|
+
if (title !== void 0) {
|
|
43
|
+
if (typeof title !== "string" || title.trim() === "") throw new TypeError(`Operation "${name}": meta.title must be a non-empty string.`);
|
|
44
|
+
meta.title = title;
|
|
45
|
+
}
|
|
46
|
+
return Object.freeze(meta);
|
|
47
|
+
}
|
|
48
|
+
function treeLeaf(keys, name, field, value) {
|
|
49
|
+
if (!isPermission(value)) throw new TypeError(`Operation "${name}": ${field} must be a permission from the tree.`);
|
|
50
|
+
if (!keys.has(value.key)) throw new TypeError(`Operation "${name}": ${field} ${value.key} is not a permission of the tree passed to defineOperations.`);
|
|
51
|
+
return value;
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Binds each named operation to a permission of `permissions`. Throws at
|
|
55
|
+
* definition time for a permission or `results` outside the tree, a name that
|
|
56
|
+
* is not 1 to 128 of `A-Z a-z 0-9 _ . -` or repeats another case-insensitively,
|
|
57
|
+
* a `data` that is not a function, or meta outside the closed lists.
|
|
58
|
+
*/
|
|
59
|
+
function defineOperations(permissions, definitions) {
|
|
60
|
+
const keys = new Map(listPermissions(permissions).map((leaf) => [leaf.key, leaf]));
|
|
61
|
+
const seen = /* @__PURE__ */ new Map();
|
|
62
|
+
const out = {};
|
|
63
|
+
for (const name of Object.keys(definitions)) {
|
|
64
|
+
if (!NAME.test(name) || isForbiddenKey(name)) throw new TypeError(`Operation name "${name}" must be 1 to 128 of A-Z a-z 0-9 _ . -.`);
|
|
65
|
+
const folded = name.toLowerCase();
|
|
66
|
+
const previous = seen.get(folded);
|
|
67
|
+
if (previous !== void 0) throw new TypeError(`Operation name "${name}" is a duplicate of "${previous}".`);
|
|
68
|
+
seen.set(folded, name);
|
|
69
|
+
const definition = definitions[name];
|
|
70
|
+
if (definition === null || typeof definition !== "object" || Array.isArray(definition)) throw new TypeError(`Operation "${name}" must be an object.`);
|
|
71
|
+
const permission = treeLeaf(keys, name, "permission", Reflect.get(definition, "permission"));
|
|
72
|
+
const value = Reflect.get(definition, "data");
|
|
73
|
+
if (value !== void 0 && typeof value !== "function") throw new TypeError(`Operation "${name}": data must be a function.`);
|
|
74
|
+
const data = value;
|
|
75
|
+
const resultsValue = Reflect.get(definition, "results");
|
|
76
|
+
const results = resultsValue === void 0 ? void 0 : treeLeaf(keys, name, "results", resultsValue);
|
|
77
|
+
const meta = readMeta(name, Reflect.get(definition, "meta"));
|
|
78
|
+
out[name] = Object.freeze({
|
|
79
|
+
name,
|
|
80
|
+
permission,
|
|
81
|
+
...data === void 0 ? {} : { data },
|
|
82
|
+
...results === void 0 ? {} : { results },
|
|
83
|
+
meta
|
|
84
|
+
});
|
|
85
|
+
}
|
|
86
|
+
return Object.freeze(out);
|
|
87
|
+
}
|
|
88
|
+
//#endregion
|
|
89
|
+
export { isOperationEffect as n, defineOperations as t };
|
package/dist/orpc/index.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { E as Policy, M as PolicyVocabulary, _r as Principal } from "../policy-types-
|
|
1
|
+
import { E as Policy, M as PolicyVocabulary, _r as Principal } from "../policy-types-D-GwfQTc.js";
|
|
2
2
|
import { u as Permission } from "../permission-types-CAY-GU7e.js";
|
|
3
3
|
import { a as OperationInput, t as Operation } from "../operations-Ci_rT6Uo.js";
|
|
4
|
-
import { a as PermDock } from "../permdock-
|
|
4
|
+
import { a as PermDock } from "../permdock-ffY4CMd9.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 StreamProtectOptions } from "../stream-
|
|
6
|
+
import { D as ConnectionOptions, T as Connection, i as OpenApiHooks } from "../server-types-3OnXjZ2D.js";
|
|
7
|
+
import { t as ServerAdapterOptions } from "../bind-DR6ku3A9.js";
|
|
8
|
+
import { t as StreamProtectOptions } from "../stream-W2RuUYly.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,10 +1,10 @@
|
|
|
1
1
|
import { t as compact } from "../compact-CAf557ZB.js";
|
|
2
2
|
import { o as isPermission } from "../permission-registry-B8tYxPIt.js";
|
|
3
3
|
import { o as problemMessage } from "../http-DKLXrFGk.js";
|
|
4
|
-
import { t as problemFromError } from "../map-error-
|
|
5
|
-
import { n as attached } from "../bind-
|
|
4
|
+
import { t as problemFromError } from "../map-error-BH16Ah8P.js";
|
|
5
|
+
import { n as attached } from "../bind-B4pMH9bm.js";
|
|
6
6
|
import { i as isAsyncIterable, o as reloadAfter } from "../stream-CDvF0sJm.js";
|
|
7
|
-
import { i as rpcCode, n as guardStream, r as problemBody, t as bindRpcKernel } from "../rpc-
|
|
7
|
+
import { i as rpcCode, n as guardStream, r as problemBody, t as bindRpcKernel } from "../rpc-KwX_Jcxz.js";
|
|
8
8
|
import { ORPCError, os } from "@orpc/server";
|
|
9
9
|
//#region src/orpc/operations.ts
|
|
10
10
|
const root = os;
|
package/dist/otel/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { M 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 { M as PolicyVocabulary } from "../policy-types-D-GwfQTc.js";
|
|
2
|
+
import { a as PermDock } from "../permdock-ffY4CMd9.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-DGf_cpKF.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
|
|
@@ -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-wclLWBVH.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) {
|
|
@@ -11,7 +11,7 @@ import { i as qualifySqlTable } from "./sql-0WjxIp9g.js";
|
|
|
11
11
|
import { a as scopeMembershipTable, i as scopeColumn, s as relatedSql } from "./compile-B_oJqmIg.js";
|
|
12
12
|
import { l as roleColumn } from "./sources-C4vkzZJV.js";
|
|
13
13
|
import { A as quoteQualified, D as qualified, E as helperSchema, L as sqlType, M as textArrayLiteral, O as quoteIdent, R as tenantTypeOf, S as CLAIM, T as declaredArray, _ as subjectClaimJsonSql, b as tenantClaimSql, d as keyTenantSql, f as kindFilterSql, h as roleKindSql, j as quoteTable, k as quoteLiteral, m as memberVia, p as liveSessionSql, s as signedIn, t as CUSTOM_ROLES, u as globalKindFilterSql, v as subjectClaimSql, y as subjectIdSql } from "./shared-DyYVEjKC.js";
|
|
14
|
-
import { $ as graphSqlText, A as claimKeptLines, B as hasCustomRoleChecksFor, F as globalRoleRows, I as membershipRows, L as roleRows, M as memberColumn, N as sourceFilters, P as sourcesKeep, U as storedTenant, X as CLOSURE, Z as graphHelper, _t as activeMembershipSql, c as holderSources, ct as memberIdsHelper, d as sourceRowsSql, f as sourceTransferTriggerSql, g as OWNERSHIP, gt as activeInstancesSql, h as ASSIGNMENTS, ht as scopeTable, it as linkHelper, j as disabledColumn, l as pairsSql, m as transferTriggerSql, mt as scopeSources, nt as inheritedRowsHelper, p as holdersTriggerSql, pt as restrictedHelper, st as memberForTable, u as sourceHoldersTriggerSql, ut as memberRoleOf, yt as activeUserSql } from "./tables-
|
|
14
|
+
import { $ as graphSqlText, A as claimKeptLines, B as hasCustomRoleChecksFor, F as globalRoleRows, I as membershipRows, L as roleRows, M as memberColumn, N as sourceFilters, P as sourcesKeep, U as storedTenant, X as CLOSURE, Z as graphHelper, _t as activeMembershipSql, c as holderSources, ct as memberIdsHelper, d as sourceRowsSql, f as sourceTransferTriggerSql, g as OWNERSHIP, gt as activeInstancesSql, h as ASSIGNMENTS, ht as scopeTable, it as linkHelper, j as disabledColumn, l as pairsSql, m as transferTriggerSql, mt as scopeSources, nt as inheritedRowsHelper, p as holdersTriggerSql, pt as restrictedHelper, st as memberForTable, u as sourceHoldersTriggerSql, ut as memberRoleOf, yt as activeUserSql } from "./tables-BfOk0ymL.js";
|
|
15
15
|
//#region src/cli/sql/conditions.ts
|
|
16
16
|
const MAX_CLAIM_DEPTH = 8;
|
|
17
17
|
/**
|
|
@@ -54,8 +54,8 @@ function isMembershipRows(value) {
|
|
|
54
54
|
}
|
|
55
55
|
function isRows(value) {
|
|
56
56
|
if (!isRecord(value)) return false;
|
|
57
|
-
const { memberships, roles, customRoles } = value;
|
|
58
|
-
return Array.isArray(memberships) && memberships.every(isMembershipRows) && (roles === void 0 || isRecord(roles) && isText(roles["table"]) && isText(roles["user"]) && Array.isArray(roles["roles"]) && roles["roles"].length > 0 && roles["roles"].every(isColumn)) && (customRoles === void 0 || isRecord(customRoles) && isText(customRoles["permissions"]) && isText(customRoles["includes"]));
|
|
57
|
+
const { memberships, roles, customRoles, version } = value;
|
|
58
|
+
return Array.isArray(memberships) && memberships.every(isMembershipRows) && (roles === void 0 || isRecord(roles) && isText(roles["table"]) && isText(roles["user"]) && Array.isArray(roles["roles"]) && roles["roles"].length > 0 && roles["roles"].every(isColumn)) && (customRoles === void 0 || isRecord(customRoles) && isText(customRoles["permissions"]) && isText(customRoles["includes"])) && (version === void 0 || isRecord(version) && isText(version["table"]) && isText(version["user"]) && isText(version["version"]));
|
|
59
59
|
}
|
|
60
60
|
/**
|
|
61
61
|
* Whether `value` has the shape `localSnapshotManifest(policy)` writes, with no
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Zt as LocalSnapshotManifest } from "./policy-types-
|
|
1
|
+
import { Zt as LocalSnapshotManifest } from "./policy-types-D-GwfQTc.js";
|
|
2
2
|
//#region src/core/parse-local-manifest.d.ts
|
|
3
3
|
/**
|
|
4
4
|
* Whether `value` has the shape `localSnapshotManifest(policy)` writes, with no
|
package/dist/pdp/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { E as Policy, J as DecisionProvider, M as PolicyVocabulary, _r as Principal } from "../policy-types-
|
|
2
|
-
import { o as PermDockOptions } from "../permdock-
|
|
3
|
-
import { a as RelationMap, c as RemotePdpEndpoints, d as SpiceDbCheck, f as SpiceDbOptions, i as PdpPermDock, l as RemotePdpMapping, n as OpenFgaTuple, o as RemotePdpAuth, r as PdpFactory, s as RemotePdpCache, t as OpenFgaOptions, u as RemotePdpOptions } from "../types-
|
|
1
|
+
import { E as Policy, J as DecisionProvider, M as PolicyVocabulary, _r as Principal } from "../policy-types-D-GwfQTc.js";
|
|
2
|
+
import { o as PermDockOptions } from "../permdock-ffY4CMd9.js";
|
|
3
|
+
import { a as RelationMap, c as RemotePdpEndpoints, d as SpiceDbCheck, f as SpiceDbOptions, i as PdpPermDock, l as RemotePdpMapping, n as OpenFgaTuple, o as RemotePdpAuth, r as PdpFactory, s as RemotePdpCache, t as OpenFgaOptions, u as RemotePdpOptions } from "../types-B8qUkGja.js";
|
|
4
4
|
//#region src/pdp/create.d.ts
|
|
5
5
|
/**
|
|
6
6
|
* The PDP-aware instance, built synchronously like core `getPermDockSync`; use
|
package/dist/pdp/index.js
CHANGED
|
@@ -6,7 +6,7 @@ import { n as internalsOf, t as attachInternals } from "../internals-B3IgHrvo.js
|
|
|
6
6
|
import { a as getResource, c as listPermissions } from "../permission-registry-B8tYxPIt.js";
|
|
7
7
|
import { n as toWireDelegation } from "../wire-delegation-Cv3W2eaM.js";
|
|
8
8
|
import { r as decideAllAsync, t as canAllAsync } from "../checks-fyDOhcz0.js";
|
|
9
|
-
import { n as getPermDockSync$1, t as getPermDock$1 } from "../permdock-
|
|
9
|
+
import { n as getPermDockSync$1, t as getPermDock$1 } from "../permdock-D-_WrdKu.js";
|
|
10
10
|
import { a as postJson, c as ttlMs, i as joinUrl, n as denied, o as resourceIdOf, r as granted, s as ttlCache, t as cacheKey } from "../shared-BRmCJxDK.js";
|
|
11
11
|
//#region src/pdp/create.ts
|
|
12
12
|
function withoutProviders(policy) {
|
|
@@ -10,10 +10,10 @@ import { d as scopeList, o as normalizeMemberships, p as tenantOf } from "./scop
|
|
|
10
10
|
import { o as pickVisible, s as sanitizeContext } from "./validity-Buc7w8E9.js";
|
|
11
11
|
import { t as byCodePoint } from "./compare-DTfyUunF.js";
|
|
12
12
|
import { c as nowSeconds, d as resolveActiveTenant, m as tenantsOf, p as scopeField, t as heldRoleNamesIn, u as relatesTo } from "./tenancy-DvOHHk3-.js";
|
|
13
|
-
import { d as policyX } from "./policy-
|
|
13
|
+
import { d as policyX } from "./policy-cV_wwPb8.js";
|
|
14
14
|
import { r as isSubject, t as anonymousSubject } from "./subject-C7RddW0G.js";
|
|
15
|
-
import { D as emptyListeners, E as emitSafe, N as contactMemberships, O as finish, P as isContact, i as customRolesFor, o as roleSourceFor, r as assignableNamesFor, s as sourceName, t as evaluate, u as customGrantsFor, w as unknownLevelsFor } from "./evaluate-
|
|
16
|
-
import { c as heldRoleNames, d as audiencesOf, g as asMembershipSource, i as assignableIn, l as roleLeaf, o as collectSnapshotGrants, s as whereGrant, t as snapshotOf, u as applyRoleKinds } from "./instance-snapshot-
|
|
15
|
+
import { D as emptyListeners, E as emitSafe, N as contactMemberships, O as finish, P as isContact, i as customRolesFor, o as roleSourceFor, r as assignableNamesFor, s as sourceName, t as evaluate, u as customGrantsFor, w as unknownLevelsFor } from "./evaluate-Czbj7thS.js";
|
|
16
|
+
import { c as heldRoleNames, d as audiencesOf, g as asMembershipSource, i as assignableIn, l as roleLeaf, o as collectSnapshotGrants, s as whereGrant, t as snapshotOf, u as applyRoleKinds } from "./instance-snapshot-BWa71my8.js";
|
|
17
17
|
import { r as relationReader, t as pendingRelations } from "./relations-BxvRvDHK.js";
|
|
18
18
|
import { i as snapshotGrant } from "./snapshot-DN_8J27z.js";
|
|
19
19
|
import { a as decideForTarget, i as permittedIds, o as deniedFor, r as mayUse, s as signSnapshot, t as whereFromGrants } from "./where-scope-BKrqUDVk.js";
|
|
@@ -139,7 +139,6 @@ function staleness(policy, principal, source, given, auth) {
|
|
|
139
139
|
/** Options that shape an instance by value; the rest by identity. */
|
|
140
140
|
const DATA_KEYS = /* @__PURE__ */ new Set([
|
|
141
141
|
"tenant",
|
|
142
|
-
"intent",
|
|
143
142
|
"actor",
|
|
144
143
|
"delegation",
|
|
145
144
|
"session",
|
|
@@ -178,12 +177,12 @@ async function cacheKey(policy, user, options) {
|
|
|
178
177
|
return;
|
|
179
178
|
}
|
|
180
179
|
if (!isVersion(version)) return;
|
|
181
|
-
const data = {};
|
|
180
|
+
const data = { intent };
|
|
182
181
|
const owners = [policy];
|
|
183
182
|
for (const name of Object.keys(options).toSorted()) {
|
|
184
183
|
const value = Reflect.get(options, name);
|
|
185
184
|
if (DATA_KEYS.has(name)) data[name] = value;
|
|
186
|
-
else if (name !== "version") owners.push(value);
|
|
185
|
+
else if (name !== "version" && name !== "intent") owners.push(value);
|
|
187
186
|
}
|
|
188
187
|
return {
|
|
189
188
|
key: compact({
|
|
@@ -203,18 +202,29 @@ async function cacheKey(policy, user, options) {
|
|
|
203
202
|
}
|
|
204
203
|
};
|
|
205
204
|
}
|
|
205
|
+
function cachedFactory(factory, instances) {
|
|
206
|
+
return (subject) => {
|
|
207
|
+
const source = factory(subject);
|
|
208
|
+
const principal = subject.principal?.id;
|
|
209
|
+
return source === void 0 || principal === void 0 ? source : instances.customRoles(source, {
|
|
210
|
+
owner: factory,
|
|
211
|
+
principal
|
|
212
|
+
});
|
|
213
|
+
};
|
|
214
|
+
}
|
|
206
215
|
function cachedSources(options, instances) {
|
|
207
216
|
const { customRoles, entitlements } = options;
|
|
208
217
|
return {
|
|
209
218
|
...options,
|
|
210
|
-
...customRoles === void 0
|
|
219
|
+
...customRoles === void 0 ? {} : { customRoles: typeof customRoles === "function" ? cachedFactory(customRoles, instances) : instances.customRoles(customRoles) },
|
|
211
220
|
...entitlements === void 0 ? {} : { entitlements: instances.entitlements(entitlements) }
|
|
212
221
|
};
|
|
213
222
|
}
|
|
214
223
|
/**
|
|
215
224
|
* `create` through `instances`: a subject whose authorization version is known
|
|
216
225
|
* gets the instance built for it at that version, with the cache's custom-role
|
|
217
|
-
* and entitlement memos;
|
|
226
|
+
* and entitlement memos; a custom-role factory's answers are kept per factory
|
|
227
|
+
* and principal. Any other subject gets a new one.
|
|
218
228
|
*/
|
|
219
229
|
async function cachedInstance(policy, user, options, instances, create) {
|
|
220
230
|
const cached = await cacheKey(policy, user, options);
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { $t as Snapshot, E as Policy, K as CustomRoleSource, Kt as Instant, M as PolicyVocabulary, Qn as ExplainedDecision, Sr as AdapterId, X as EntitlementSource, Y as DecisionSink, Z as Intent, _r as Principal, bn as Scope, cn as DecisionEvent, ct as SettingsSource, er as LimitDetail, gr as Membership, gt as TokenSigner, nr as Obligation, pr as Delegation, q as CustomRoleSourceFactory, qn as Decision, rr as Quota, rt as MembershipSource, sr as Actor, st as RelationSource, tt as LimitStore, v as GrantLimit, wr as Condition, yr as Subject } from "./policy-types-
|
|
1
|
+
import { $t as Snapshot, E as Policy, K as CustomRoleSource, Kt as Instant, M as PolicyVocabulary, Qn as ExplainedDecision, Sr as AdapterId, X as EntitlementSource, Y as DecisionSink, Z as Intent, _r as Principal, bn as Scope, cn as DecisionEvent, ct as SettingsSource, er as LimitDetail, gr as Membership, gt as TokenSigner, nr as Obligation, pr as Delegation, q as CustomRoleSourceFactory, qn as Decision, rr as Quota, rt as MembershipSource, sr as Actor, st as RelationSource, tt as LimitStore, v as GrantLimit, wr as Condition, yr as Subject } from "./policy-types-D-GwfQTc.js";
|
|
2
2
|
import { D as RowOf, M as AppData, b as ResourceNode, u as Permission } from "./permission-types-CAY-GU7e.js";
|
|
3
3
|
import { a as RoleTree, n as PlanTree, r as Role } from "./vocabulary-DEJ5j4mR.js";
|
|
4
4
|
import { t as Operation } from "./operations-Ci_rT6Uo.js";
|
|
5
|
-
import { t as ApprovalPolicies } from "./approval-policies-
|
|
6
|
-
import { a as HostedPolicies } from "./hosted-
|
|
5
|
+
import { t as ApprovalPolicies } from "./approval-policies-oNnckT12.js";
|
|
6
|
+
import { a as HostedPolicies } from "./hosted-BFNXwcjd.js";
|
|
7
7
|
//#region src/core/checks.d.ts
|
|
8
8
|
/**
|
|
9
9
|
* One check of `canAll` or `decideAll`: a permission alone, or with the row it
|
|
@@ -55,14 +55,27 @@ type InstanceCache = {
|
|
|
55
55
|
* rejected build is not stored.
|
|
56
56
|
*/
|
|
57
57
|
instance: <T>(key: InstanceCacheKey, owners: readonly unknown[], build: () => Promise<T>) => Promise<T>;
|
|
58
|
-
/**
|
|
59
|
-
|
|
58
|
+
/**
|
|
59
|
+
* `source` with every answer kept for `maxAgeMs`, keyed by its arguments.
|
|
60
|
+
* With `of`, the answers are keyed by `of.owner` and `of.principal` instead
|
|
61
|
+
* of `source`, so the new source a `CustomRoleSourceFactory` returns per
|
|
62
|
+
* subject reuses them, and `evict(of.principal)` drops them.
|
|
63
|
+
*/
|
|
64
|
+
customRoles: (source: CustomRoleSource, of?: CustomRoleOwner) => CustomRoleSource;
|
|
60
65
|
/** `source` with every answer kept for `maxAgeMs`, per principal and tenant. */
|
|
61
66
|
entitlements: (source: EntitlementSource) => EntitlementSource;
|
|
62
|
-
/**
|
|
67
|
+
/**
|
|
68
|
+
* Drops `principal`'s instances, entitlements and the answers of custom-role
|
|
69
|
+
* sources cached for it.
|
|
70
|
+
*/
|
|
63
71
|
evict: (principal: string) => void;
|
|
64
72
|
stats: () => InstanceCacheStats;
|
|
65
73
|
};
|
|
74
|
+
/** The factory and principal a per-subject custom-role source belongs to. */
|
|
75
|
+
type CustomRoleOwner = {
|
|
76
|
+
readonly owner: object;
|
|
77
|
+
readonly principal: string;
|
|
78
|
+
};
|
|
66
79
|
type InstanceCacheOptions = {
|
|
67
80
|
/** Entries kept; the least recently used goes first. Default 10,000. */
|
|
68
81
|
readonly maxEntries?: number;
|
|
@@ -616,4 +629,4 @@ declare function getPermDockSync<TUser, TPrincipal extends Principal = Principal
|
|
|
616
629
|
*/
|
|
617
630
|
declare function getPermDock<TUser, TPrincipal extends Principal = Principal, V extends PolicyVocabulary = PolicyVocabulary>(policy: Policy<TUser, TPrincipal, V>, user: TUser | Subject | null, options?: PermDockOptions): Promise<PermDock<V>>;
|
|
618
631
|
//#endregion
|
|
619
|
-
export {
|
|
632
|
+
export { PermissionState as A, CustomRoleOwner as C, InstanceCacheStats as D, InstanceCacheOptions as E, instanceCache as O, memoryLimitStore as S, InstanceCacheKey as T, PrincipalSource as _, PermDock as a, Limits as b, RowPair as c, UncheckedData as d, WhereResult as f, PrincipalIdentityLink as g, PrincipalIdentity as h, LoadedRows as i, PermissionCheck as k, SimulateOptions as l, getPermDockSync as m, DecideOptions as n, PermDockOptions as o, getPermDock as p, DeriveOptions as r, RowData as s, DecideIdsOptions as t, SnapshotOptions as u, memoryPrincipalSource as v, InstanceCache as w, limits as x, PermittedIdsOptions as y };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { c as crud } from "./src-
|
|
1
|
+
import { c as crud } from "./src-Brzq_0in.js";
|
|
2
2
|
import { v as resource } from "./permission-registry-B8tYxPIt.js";
|
|
3
3
|
import { f as definePlans, p as defineRoles } from "./grantee-Dke-9rd1.js";
|
|
4
|
-
import { t as definePermissions } from "./permissions-
|
|
4
|
+
import { t as definePermissions } from "./permissions-BaoLxy66.js";
|
|
5
5
|
//#region src/testing/saas/schema.ts
|
|
6
6
|
function accepts(kind, value) {
|
|
7
7
|
switch (kind) {
|
|
@@ -1,18 +1,6 @@
|
|
|
1
1
|
import { n as freezeDeep } from "./freeze-jjan0lCv.js";
|
|
2
2
|
import { d as attachRegistry, p as walk, r as formerByKey, t as assertKeys } from "./permission-registry-B8tYxPIt.js";
|
|
3
3
|
import { r as assertGraphTargets } from "./resource-relations-8-pCScBO.js";
|
|
4
|
-
//#region src/core/operation-risks.ts
|
|
5
|
-
/** Every `meta.risk` level, lowest first. */
|
|
6
|
-
const OPERATION_RISKS = Object.freeze([
|
|
7
|
-
"low",
|
|
8
|
-
"medium",
|
|
9
|
-
"high",
|
|
10
|
-
"critical"
|
|
11
|
-
]);
|
|
12
|
-
function isOperationRisk(value) {
|
|
13
|
-
return OPERATION_RISKS.some((risk) => risk === value);
|
|
14
|
-
}
|
|
15
|
-
//#endregion
|
|
16
4
|
//#region src/core/permissions.ts
|
|
17
5
|
function definePermissions(input, options) {
|
|
18
6
|
const registry = /* @__PURE__ */ new Map();
|
|
@@ -27,4 +15,4 @@ function definePermissions(input, options) {
|
|
|
27
15
|
return freezeDeep(attachRegistry(tree, registry, leaves));
|
|
28
16
|
}
|
|
29
17
|
//#endregion
|
|
30
|
-
export {
|
|
18
|
+
export { definePermissions as t };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { E as Policy, _r as Principal, yr as Subject } from "./policy-types-
|
|
1
|
+
import { E as Policy, _r as Principal, yr as Subject } from "./policy-types-D-GwfQTc.js";
|
|
2
2
|
import { c as saasPlans, l as saasRoles, s as saasPermissions } from "./permissions-Bx6UI8n1.js";
|
|
3
3
|
//#region src/testing/saas/policy.d.ts
|
|
4
4
|
/** Daily API-key quota per subject; the bucket should be per tenant too. */
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { t as compact } from "./compact-CAf557ZB.js";
|
|
2
2
|
import { n as freezeDeep } from "./freeze-jjan0lCv.js";
|
|
3
|
-
import { c as withGrantSchema, i as completeGrant, l as normalizeWhere, o as flattenGrants, s as flattenPermissions } from "./role-builder-
|
|
3
|
+
import { c as withGrantSchema, i as completeGrant, l as normalizeWhere, o as flattenGrants, s as flattenPermissions } from "./role-builder-CMW4wWzn.js";
|
|
4
4
|
import { c as listPermissions, i as getRegistry, m as annotationsFor, n as findPermission, s as isRegistryTree } from "./permission-registry-B8tYxPIt.js";
|
|
5
5
|
import { d as isSelfParented, l as isFieldRelation } from "./resource-relations-8-pCScBO.js";
|
|
6
6
|
import { t as canonicalJson } from "./canonical-json-DwilZ1iB.js";
|
|
7
7
|
import { r as sha256Digest } from "./sha256-C-4WXKIu.js";
|
|
8
8
|
import { n as defineScopes, s as resolveScope } from "./scopes-BSdYaGHs.js";
|
|
9
9
|
import { o as flattenGrantee, r as asGrantee, v as listRoles } from "./grantee-Dke-9rd1.js";
|
|
10
|
-
import { i as assertApprovalVersions, r as assertApprovalRelations } from "./approval-normalize-
|
|
10
|
+
import { i as assertApprovalVersions, r as assertApprovalRelations } from "./approval-normalize-CUjgSsOl.js";
|
|
11
11
|
import { n as normalizeValidity } from "./validity-Buc7w8E9.js";
|
|
12
12
|
import { t as byCodePoint } from "./compare-DTfyUunF.js";
|
|
13
13
|
import { a as relationStart, i as relationHops, n as isGraphRelation, t as inheritCondition } from "./grantee-conditions-DX4K_gGI.js";
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import { r as isRecord, t as compact } from "./compact-CAf557ZB.js";
|
|
2
2
|
import { n as freezeDeep } from "./freeze-jjan0lCv.js";
|
|
3
|
-
import { l as normalizeWhere } from "./role-builder-
|
|
3
|
+
import { l as normalizeWhere } from "./role-builder-CMW4wWzn.js";
|
|
4
4
|
import { n as PermDockValidationError } from "./validation-error-CYg2kJEw.js";
|
|
5
5
|
import { i as getRegistry, n as findPermission, v as resource } from "./permission-registry-B8tYxPIt.js";
|
|
6
6
|
import { n as defineScopes } from "./scopes-BSdYaGHs.js";
|
|
7
7
|
import { f as definePlans, p as defineRoles } from "./grantee-Dke-9rd1.js";
|
|
8
|
-
import { o as readWireApproval } from "./approval-normalize-
|
|
8
|
+
import { o as readWireApproval } from "./approval-normalize-CUjgSsOl.js";
|
|
9
9
|
import { r as readWireValidity } from "./validity-Buc7w8E9.js";
|
|
10
|
-
import { a as indexPolicy, f as normalizeDelegation } from "./policy-
|
|
11
|
-
import { o as isPortableCondition } from "./hosted-
|
|
12
|
-
import { t as definePermissions } from "./permissions-
|
|
10
|
+
import { a as indexPolicy, f as normalizeDelegation } from "./policy-cV_wwPb8.js";
|
|
11
|
+
import { o as isPortableCondition } from "./hosted-waouw2V-.js";
|
|
12
|
+
import { t as definePermissions } from "./permissions-BaoLxy66.js";
|
|
13
13
|
import { n as copyJson, t as checkSchema } from "./json-schema-BPGa-RjQ.js";
|
|
14
14
|
import { t as parseCatalog } from "./parse-UTC-sDrt.js";
|
|
15
|
-
import { n as parsePushedPolicy } from "./pushed-policy-
|
|
15
|
+
import { n as parsePushedPolicy } from "./pushed-policy-BecMsTtM.js";
|
|
16
16
|
//#region src/catalog/json-schema-validator.ts
|
|
17
17
|
const ANNOTATIONS = /* @__PURE__ */ new Set([
|
|
18
18
|
"$schema",
|
|
@@ -1396,6 +1396,15 @@ type LocalSnapshotRows = {
|
|
|
1396
1396
|
readonly permissions: string;
|
|
1397
1397
|
readonly includes: string;
|
|
1398
1398
|
};
|
|
1399
|
+
/**
|
|
1400
|
+
* The user's authorization version row (`permdock_authz_version`), the value
|
|
1401
|
+
* the token hook stamps `authz_ver` from.
|
|
1402
|
+
*/
|
|
1403
|
+
readonly version?: {
|
|
1404
|
+
readonly table: string;
|
|
1405
|
+
readonly user: string;
|
|
1406
|
+
readonly version: string;
|
|
1407
|
+
};
|
|
1399
1408
|
};
|
|
1400
1409
|
/**
|
|
1401
1410
|
* Grants a custom role entry resolves to, held by a placeholder role the client
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { E as Policy, K as CustomRoleSource, _r as Principal, dr as CustomRole, gr as Membership, nt as MemberEntry, rt as MembershipSource, ut as SourceCall, yr as Subject } from "./policy-types-
|
|
1
|
+
import { E as Policy, K as CustomRoleSource, _r as Principal, dr as CustomRole, gr as Membership, nt as MemberEntry, rt as MembershipSource, ut as SourceCall, yr as Subject } from "./policy-types-D-GwfQTc.js";
|
|
2
2
|
//#region src/supabase/postgrest.d.ts
|
|
3
3
|
/**
|
|
4
4
|
* What a supabase-js `rpc` call resolves to: `data` or an `error` with a
|