permdock 0.8.0 → 0.10.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/dist/a2a/index.d.ts +4 -4
- package/dist/a2a/index.js +3 -3
- package/dist/{action-result-CL-QCITA.d.ts → action-result-BcudBQOF.d.ts} +1 -1
- package/dist/active-tenant-DVee32-T.js +39 -0
- package/dist/{adoption-scan-BLs67P1l.js → adoption-scan-0oFt2RD5.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-prompt-PYagyQUj.d.ts → approval-prompt-3BqWczTt.d.ts} +1 -1
- package/dist/approvals/index.d.ts +3 -3
- package/dist/{arazzo-3RhGfkAK.js → arazzo-DA9PCXew.js} +1 -1
- package/dist/{arazzo-B5-ulWif.js → arazzo-DhxDfYt-.js} +2 -2
- package/dist/astro/index.d.ts +4 -4
- package/dist/astro/index.js +1 -1
- package/dist/{audience-BAkBDMqn.js → audience-DTjR8xet.js} +1 -1
- package/dist/authzen/index.d.ts +5 -5
- package/dist/authzen/index.js +1 -1
- package/dist/{automation-DqEoWHBc.d.ts → automation-C6Jg75xq.d.ts} +1 -1
- package/dist/better-auth/index.d.ts +1 -1
- package/dist/better-supabase/index.d.ts +192 -27
- package/dist/better-supabase/index.js +248 -64
- package/dist/{bind-D_sZSVA3.js → bind-BNQA9JK9.js} +7 -3
- package/dist/{bind-Cp2hBHzP.d.ts → bind-YYjvfpB9.d.ts} +12 -7
- package/dist/{build-instance-CNWaYJyr.js → build-instance-BWXqwQYU.js} +1 -1
- package/dist/{capability-ChuiONQU.d.ts → capability-Di9tiUvi.d.ts} +1 -1
- package/dist/{casbin-H0rKxBx2.js → casbin-BJu2liqU.js} +1 -1
- package/dist/{casbin-cbSbhT_k.js → casbin-BkhqGh2z.js} +1 -1
- package/dist/catalog/index.d.ts +4 -4
- package/dist/catalog/index.js +2 -2
- package/dist/{catalog-BFpz2EmT.js → catalog-CGlSwU6j.js} +2 -2
- package/dist/catalog-D3oS2GH3.js +1 -0
- package/dist/{catalog-DCspHDc8.js → catalog-amPDr0JQ.js} +1 -1
- package/dist/{catalog-operations-Dadrl7Z-.js → catalog-operations-DeHTrJSV.js} +1 -1
- package/dist/chat/index.d.ts +1 -1
- package/dist/chat/index.js +1 -1
- 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 +9 -4
- package/dist/cli/index.js +11 -3
- package/dist/cloud/index.d.ts +8 -8
- package/dist/{cloud-BFlGMaak.js → cloud-3RIuS4E9.js} +2 -2
- package/dist/{codemod-DLQ9Zpo4.js → codemod-DLcp-B6v.js} +2 -2
- package/dist/{codemod-DWSN2erG.js → codemod-DRl_w-bY.js} +1 -1
- package/dist/collect-D-eroIfV.js +1 -0
- package/dist/{collect-Bzv3le0A.js → collect-D9Tt0Bcx.js} +2 -2
- package/dist/{collect-B7ZFAJU3.js → collect-WCl8cJQV.js} +1 -1
- package/dist/compile/index.d.ts +1 -1
- package/dist/{compile-BFzysW3o.d.ts → compile-BEklRUYo.d.ts} +2 -2
- package/dist/{completion-saoYiRFO.js → completion-VSWvaaPO.js} +1 -1
- package/dist/{config-BwPBfN0t.js → config-BR23fL8m.js} +2 -2
- package/dist/{config-DBeXXmBF.js → config-kL36AxkE.js} +1 -1
- package/dist/{config-report-BipSWA6V.js → config-report-osnfUNg5.js} +3 -3
- package/dist/{config-shape-ykV0Vm2n.js → config-shape-tsxHx71E.js} +2 -1
- package/dist/convex/index.d.ts +4 -4
- package/dist/convex/index.js +2 -2
- package/dist/{core-hWIARPDz.d.ts → core-CFepFiDP.d.ts} +2 -2
- package/dist/{core-H-mbhpZc.js → core-DzVINFbU.js} +3 -3
- package/dist/{create-Cq4Uox0f.js → create-6EwRQlig.js} +3 -3
- package/dist/{create-_noSrY1T.js → create-BLPKnJKa.js} +23 -7
- package/dist/{create-BSNrVuxh.d.ts → create-BPUopdfL.d.ts} +7 -7
- package/dist/{create-CM1FciYG.d.ts → create-CDd9c22W.d.ts} +15 -6
- package/dist/{create-BVq1lNQE.d.ts → create-DBvUsgzK.d.ts} +4 -4
- package/dist/delivery/index.d.ts +4 -4
- package/dist/delivery/index.js +1 -1
- package/dist/{denied-text-CHNlVInN.d.ts → denied-text-DHldhVUv.d.ts} +1 -1
- package/dist/{describe-ByS9LgHK.d.ts → describe-BbFPBSms.d.ts} +1 -1
- package/dist/{diff-CN8IYhC_.js → diff-BwR1JdP2.js} +1 -1
- package/dist/{diff-iZWV65nC.js → diff-CQegtBAo.js} +2 -2
- package/dist/{doctor-D3wo-yuz.js → doctor-B9FY9H0F.js} +2 -2
- package/dist/{doctor-CHD1M9R5.js → doctor-DfTnMaUt.js} +144 -16
- package/dist/drizzle/index.d.ts +3 -3
- package/dist/elysia/index.d.ts +4 -4
- package/dist/elysia/index.js +1 -1
- package/dist/{errors-zi_4T-rx.d.ts → errors-BIM4MFsJ.d.ts} +1 -1
- package/dist/{evaluate-Dd8Ta0Ie.js → evaluate-BAmf_AQd.js} +13 -4
- package/dist/{evaluations-z8dQFDaN.d.ts → evaluations-DOWuBpWv.d.ts} +3 -3
- package/dist/eve/index.d.ts +4 -4
- package/dist/eve/index.js +2 -2
- package/dist/express/index.d.ts +4 -4
- package/dist/express/index.js +1 -1
- package/dist/fastify/index.d.ts +4 -4
- package/dist/fastify/index.js +1 -1
- package/dist/{fetch-adapter-C1DCvpqV.d.ts → fetch-adapter-BIbBAtPZ.d.ts} +2 -2
- package/dist/{fetch-adapter-JL43jD3E.js → fetch-adapter-dPTgJVHd.js} +1 -1
- package/dist/{fields-D0vUI6dq.js → fields-DI8s3cPl.js} +1 -1
- package/dist/{gen-DWCYcMQM.js → gen-DuAhghDw.js} +2 -2
- package/dist/{gen-B5kvbAoZ.js → gen-DwgCSC6V.js} +1 -1
- package/dist/h3/index.d.ts +4 -4
- package/dist/h3/index.js +2 -2
- package/dist/hono/index.d.ts +4 -4
- package/dist/hono/index.js +1 -1
- package/dist/{hosted-Cmtxogd0.d.ts → hosted-DVxlLZMe.d.ts} +1 -1
- package/dist/{import-CST57XLp.js → import-CNBF96hB.js} +2 -2
- package/dist/{import-_YqhhwvX.js → import-Iuk9mx8A.js} +1 -1
- package/dist/{index-BhxEUY9J.d.ts → index-BinlXeU-.d.ts} +2 -2
- package/dist/{index-B8s204GL.d.ts → index-CV-7DWeD.d.ts} +4 -4
- package/dist/{index-BW_0MZOS.d.ts → index-Cay5-Kvx.d.ts} +13 -8
- package/dist/{index-_9UiQIkt.d.ts → index-DJwEgYzA.d.ts} +4 -4
- package/dist/{index-BT5-1VsX.d.ts → index-Dj2qF9VC.d.ts} +1 -1
- package/dist/{index-Bv5iXPqU.d.ts → index-ymept53A.d.ts} +4 -4
- package/dist/index.d.ts +16 -15
- package/dist/index.js +6 -6
- package/dist/{init-cE3A8aXq.js → init-DeoSvkh2.js} +1 -1
- package/dist/{init-Dz_PsHdv.js → init-fNF_XmTa.js} +3 -3
- package/dist/{instance-options-B0KXqTrJ.d.ts → instance-options-CoHn-0e8.d.ts} +1 -1
- package/dist/{instance-snapshot--JWiTrvO.js → instance-snapshot-DuWf1cT3.js} +13 -8
- package/dist/jwt/index.d.ts +4 -4
- package/dist/jwt/index.js +1 -1
- package/dist/{kernel-C-fYydV2.js → kernel-qv4cr9w8.js} +4 -4
- package/dist/kysely/index.d.ts +3 -3
- package/dist/{login-DplQ0s84.js → login-CutVtcmQ.js} +1 -1
- package/dist/{login-D-8tMqzo.js → login-DYazeWc9.js} +3 -3
- package/dist/{manifest-Cgiq5oqc.js → manifest-B4ENCp2I.js} +35 -35
- package/dist/{manifest-CzzWtnAb.d.ts → manifest-B5yF3CIq.d.ts} +19 -0
- package/dist/{manifest-wg8WkkpD.js → manifest-BXTbHNIV.js} +1 -1
- package/dist/{manifest-schema-2r37XRhD.js → manifest-schema-DQkBK2Mr.js} +28 -1
- package/dist/{map-claims-BNWCJtmP.js → map-claims-C-nv08_n.js} +2 -1
- package/dist/mcp/index.d.ts +8 -8
- package/dist/mcp/index.js +4 -4
- package/dist/{migrate-B7oP_sQU.js → migrate-BJHxQqT5.js} +2 -2
- package/dist/{module-values-BJTBdo6y.js → module-values-B1EVTkHP.js} +1 -1
- package/dist/nest/index.d.ts +4 -4
- package/dist/nest/index.js +1 -1
- package/dist/next/index.d.ts +32 -12
- package/dist/next/index.js +15 -8
- 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 +1 -1
- 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-VeHHU2l9.js → openapi-C-ADypaY.js} +1 -1
- package/dist/{openapi-CBZUhA3l.js → openapi-DFj0cirS.js} +2 -2
- package/dist/orpc/index.d.ts +5 -5
- package/dist/orpc/index.js +2 -2
- package/dist/otel/index.d.ts +3 -3
- package/dist/{output-tkju6U7R.js → output-LsbLe41I.js} +1 -1
- package/dist/{ownership-B4L59T9u.js → ownership-qqBuGJXr.js} +11 -6
- package/dist/{parse-local-manifest-BQhTlLQS.d.ts → parse-local-manifest-CCmbhnxP.d.ts} +1 -1
- package/dist/pdp/index.d.ts +3 -3
- package/dist/pdp/index.js +1 -1
- package/dist/{permdock-L-_I_3zP.js → permdock-BvjivVb9.js} +143 -107
- package/dist/{permdock-B6Sf4T_S.d.ts → permdock-CprAPN3w.d.ts} +9 -2
- package/dist/{permissions-mDcTWoBs.js → permissions-CYcHj_w7.js} +1 -1
- package/dist/{policy-Ba4bDhaj.d.ts → policy-BycVKnXv.d.ts} +1 -1
- package/dist/{policy-from-catalog-CJgOm6aq.js → policy-from-catalog-CU3An8uP.js} +1 -1
- package/dist/{policy-types-CCiDRZBH.d.ts → policy-types-DGIO_gxq.d.ts} +54 -18
- package/dist/{postgrest-DicQyqm-.d.ts → postgrest-D5nUGm-c.d.ts} +4 -3
- package/dist/{postgrest-D4nuPXIQ.js → postgrest-DAxFltvO.js} +35 -56
- package/dist/{powersync-DXqGuq9A.js → powersync-B_8uwz7f.js} +2 -2
- package/dist/powersync-CSzDCHRu.js +1 -0
- package/dist/{powersync-DHNQX06W.js → powersync-DUT-UKgw.js} +190 -38
- package/dist/prisma/index.d.ts +2 -2
- package/dist/{protected-action-BE7N_Luo.d.ts → protected-action-D8x73IGm.d.ts} +6 -6
- package/dist/{provider-DXfq5c2d.d.ts → provider-DfLeek9O.d.ts} +1 -1
- package/dist/{pull-CwpGaQSi.js → pull-DQCgvJSC.js} +2 -2
- package/dist/pull-DYbyod1f.js +1 -0
- package/dist/{push-DgssgzkK.js → push-Dq_ca4-j.js} +3 -3
- package/dist/{pushed-policy-ITwYKvvH.js → pushed-policy-CDuOL2de.js} +1 -1
- package/dist/{pushed-policy-D1Eoi6NM.d.ts → pushed-policy-CryQheKq.d.ts} +1 -1
- package/dist/react/index.d.ts +7 -7
- package/dist/react/provider-client.d.ts +1 -1
- package/dist/react-native/index.d.ts +9 -9
- package/dist/{replay-DNftIb_R.d.ts → replay-Bs9Df2fQ.d.ts} +1 -1
- package/dist/{request-context-C25ilqiJ.js → request-context-Duzdf0cd.js} +1 -1
- package/dist/resend/index.d.ts +4 -4
- package/dist/{resolve-names-CF7xXLSG.js → resolve-names-Y1Cb22cp.js} +4 -4
- package/dist/{rls-CNEH2_BG.js → rls-B57mIeVq.js} +34 -20
- package/dist/{rls-Ca8Jz9b5.js → rls-j0YrFPpW.js} +1 -1
- package/dist/{rpc-fNqAIqQk.js → rpc-vHIwyXCp.js} +1 -1
- package/dist/run-BATawNVH.js +1 -0
- package/dist/{run-Bz26OTfO.js → run-CLP_fQUF.js} +3 -3
- package/dist/{run-ticket-Dv7aF7Dk.js → run-ticket-DfnZCh-u.js} +19 -6
- package/dist/{run-ticket-DbWI9f99.d.ts → run-ticket-ylovhyFQ.d.ts} +18 -3
- package/dist/{saas-iWnUdwCt.js → saas-DK4V-3Is.js} +2 -2
- package/dist/{scan-DCj1KQfn.js → scan-B7xrAvRm.js} +1 -1
- package/dist/{schema-Dst9I9Gs.js → schema-3PJ8wAeL.js} +1 -1
- package/dist/scim/index.d.ts +1 -1
- package/dist/server/index.d.ts +11 -11
- package/dist/server/index.js +2 -2
- package/dist/{server-types-CIlpSA2G.d.ts → server-types-CyRN0-Cd.d.ts} +15 -8
- package/dist/{shared-Afctg7B0.js → shared-DrGLwM3s.js} +1 -1
- package/dist/{sink-Dvi7YZG_.d.ts → sink-B5zoUW_O.d.ts} +2 -2
- package/dist/{skills-OuoMR49L.js → skills-BUI8DMqy.js} +1 -1
- package/dist/{skills-Bjj7BNEQ.js → skills-iwbRxavw.js} +1 -1
- package/dist/{snapshot-cache-BAXZ0KOp.d.ts → snapshot-cache-BjAWkchD.d.ts} +1 -1
- package/dist/solid/index.d.ts +6 -6
- package/dist/solid-start/index.d.ts +4 -4
- package/dist/solid-start/index.js +2 -2
- package/dist/{sources-CMAM-2A3.js → sources-C4vkzZJV.js} +12 -7
- package/dist/{types-ah9NlU6j.d.ts → sources-oB1Hg1Fm.d.ts} +316 -2
- package/dist/{src-DZ0l9UAg.js → src-C_pi2Rnh.js} +106 -5
- package/dist/ssf/index.d.ts +3 -3
- package/dist/{standard-webhooks-C-qX4mJW.d.ts → standard-webhooks-DOYEuOLx.d.ts} +2 -2
- package/dist/{stores-C0Kta5Ft.d.ts → stores-DZJvxFIZ.d.ts} +6 -6
- package/dist/{stream-ltuLdtTG.d.ts → stream-9y9qw51m.d.ts} +1 -1
- package/dist/supabase/index.d.ts +5 -6
- package/dist/supabase/index.js +4 -4
- package/dist/supabase/middleware.d.ts +5 -5
- package/dist/supabase/middleware.js +4 -4
- package/dist/{supabase-BL1qJzzY.js → supabase-B1EfuD47.js} +2 -2
- package/dist/{supabase-D39cuGPt.js → supabase-BaizG0n7.js} +2 -2
- package/dist/{supabase-hook-B-yXnzUl.js → supabase-hook-BT2P9wah.js} +110 -47
- package/dist/supabase-hook-CbvGAutK.js +1 -0
- package/dist/{supautils-BU-pAEpf.js → supautils-DBKOoyjn.js} +247 -200
- package/dist/svelte/index.d.ts +6 -6
- package/dist/svelte/runtime.d.ts +3 -3
- package/dist/svelte/source.d.ts +6 -6
- package/dist/sveltekit/index.d.ts +4 -4
- package/dist/sveltekit/index.js +1 -1
- package/dist/{tables-DeMNEy6V.js → tables-DimBcVWY.js} +3 -3
- package/dist/tanstack-start/index.d.ts +4 -4
- package/dist/tanstack-start/index.js +1 -1
- package/dist/terminal/index.d.ts +5 -5
- package/dist/terminal/index.js +2 -2
- package/dist/testing/core.d.ts +1 -1
- package/dist/testing/core.js +1 -1
- package/dist/testing/fixtures/index.d.ts +1 -1
- package/dist/testing/fixtures/index.js +26 -28
- package/dist/testing/index.d.ts +23 -21
- package/dist/testing/index.js +64 -10
- 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/trpc/index.d.ts +5 -5
- package/dist/trpc/index.js +2 -2
- package/dist/{type-helpers-BIPIDa6a.d.ts → type-helpers-c7Xo_2Cu.d.ts} +1 -1
- package/dist/{types-B2mlGuhW.d.ts → types-B2efzoSX.d.ts} +1 -1
- package/dist/{types-DHKPcqzr.d.ts → types-B6ExllNo.d.ts} +2 -2
- package/dist/{types-AMJ5qoU_.d.ts → types-BB-zWDcR.d.ts} +4 -4
- package/dist/{types-djVzLlIV.d.ts → types-CEinc15V.d.ts} +4 -4
- package/dist/{types-yUuPR5Hy.d.ts → types-CN0LsqbK.d.ts} +3 -3
- package/dist/{types-HzqOtvsJ.d.ts → types-CWBsAwqn.d.ts} +4 -4
- package/dist/{types-DC1Loeh3.d.ts → types-Cklw5hJo.d.ts} +26 -3
- package/dist/{types-B_tiYvk8.d.ts → types-DLvhVm1r.d.ts} +1 -1
- package/dist/{types-B4uqKDnp.d.ts → types-DlelvQk4.d.ts} +2 -2
- package/dist/{types-DjuMBNF9.d.ts → types-DsHGPtkR.d.ts} +2 -2
- package/dist/{types-BJk0BKRX.d.ts → types-rCRV4Ge-.d.ts} +4 -4
- package/dist/{types-B_d_g7T3.d.ts → types-tQB2CEnY.d.ts} +4 -4
- package/dist/unplugin/index.d.ts +1 -1
- package/dist/unplugin/index.js +1 -1
- package/dist/{usage-ab0PdusX.js → usage-B1ZJOUdr.js} +1 -1
- package/dist/{usage-CxEzS4ey.js → usage-t_nXnwCW.js} +3 -3
- package/dist/usage-weohzv2f.js +1 -0
- package/dist/{validation-error-YGg2mXyH.d.ts → validation-error-uvp-kyfO.d.ts} +1 -1
- package/dist/{verify-DZeqoWu5.js → verify-jHrbmn-E.js} +9 -9
- package/dist/version-cache-Df11C2Qp.d.ts +51 -0
- package/dist/vue/index.d.ts +6 -6
- package/dist/{waiter-Bu9zAlE0.d.ts → waiter-CqUKX6CY.d.ts} +2 -2
- package/dist/{watch-Cx_WciLE.js → watch-Bpci3hBY.js} +2 -2
- package/dist/watch-COuvly20.js +1 -0
- package/dist/webmcp/index.d.ts +1 -1
- package/dist/{who-can-rI7dCR9Q.js → who-can-BoDJm0Nc.js} +1 -1
- package/dist/workflow/index.d.ts +3 -3
- package/dist/workflow/index.js +23 -7
- package/dist/workflow-sdk/index.d.ts +4 -4
- package/dist/{wrap-DlJE3gS_.d.ts → wrap-DxXB54Wu.d.ts} +2 -2
- package/package.json +3 -3
- package/schemas/run-v1.json +16 -0
- package/schemas/supabase-manifest-v1.json +28 -0
- package/skills/permdock-agents/references/operations-automations-chat.md +1 -0
- package/skills/permdock-data/references/queries-and-rls.md +1 -1
- package/skills/permdock-wire/references/adapters.md +4 -3
- package/dist/catalog-mRQQQhNK.js +0 -1
- package/dist/collect-B5BL3klN.js +0 -1
- package/dist/powersync-Djf-zCpB.js +0 -1
- package/dist/pull-B65ndFNZ.js +0 -1
- package/dist/run-D-JE8QWb.js +0 -1
- package/dist/sources-B1Os_YUu.d.ts +0 -312
- package/dist/supabase-hook-H-MtE9Wd.js +0 -1
- package/dist/usage-CYeXek0p.js +0 -1
- package/dist/watch-DB42U1ib.js +0 -1
package/dist/node/index.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { T as Policy, j as PolicyVocabulary,
|
|
1
|
+
import { T as Policy, j as PolicyVocabulary, pr as Principal } from "../policy-types-DGIO_gxq.js";
|
|
2
2
|
import { u as Permission } from "../permission-types-CAY-GU7e.js";
|
|
3
|
-
import { a as PermDock } from "../permdock-
|
|
4
|
-
import { f as InvalidSignatureError, i as OpenApiHooks, o as ProtectOptions, r as Guard, s as ScopeGuard, v as discoverViaSignatureAgent, x as webBotAuthVerifier } from "../server-types-
|
|
5
|
-
import { t as ServerAdapterOptions } from "../bind-
|
|
3
|
+
import { a as PermDock } from "../permdock-CprAPN3w.js";
|
|
4
|
+
import { f as InvalidSignatureError, i as OpenApiHooks, o as ProtectOptions, r as Guard, s as ScopeGuard, v as discoverViaSignatureAgent, x as webBotAuthVerifier } from "../server-types-CyRN0-Cd.js";
|
|
5
|
+
import { t as ServerAdapterOptions } from "../bind-YYjvfpB9.js";
|
|
6
6
|
import { i as toRequest, n as isServerResponse, r as sendResponse, t as NodeRequest } from "../http-B_LphE5Y.js";
|
|
7
7
|
import { IncomingMessage, ServerResponse } from "node:http";
|
|
8
8
|
//#region src/node/create.d.ts
|
package/dist/node/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { l as InvalidSignatureError, p as webBotAuthVerifier, u as discoverViaSignatureAgent } from "../evaluations-IBceAeKT.js";
|
|
2
|
-
import { r as bindKernel } from "../bind-
|
|
2
|
+
import { r as bindKernel } from "../bind-BNQA9JK9.js";
|
|
3
3
|
import { n as sendResponse, r as toRequest, t as isServerResponse } from "../http-DH94eh6f.js";
|
|
4
4
|
//#region src/node/create.ts
|
|
5
5
|
const nodeRequest = (req) => req;
|
package/dist/openai/index.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { T as Policy, j as PolicyVocabulary,
|
|
1
|
+
import { T as Policy, j as PolicyVocabulary, pr as Principal } from "../policy-types-DGIO_gxq.js";
|
|
2
2
|
import { u as Permission } from "../permission-types-CAY-GU7e.js";
|
|
3
|
-
import { a as PermDock } from "../permdock-
|
|
4
|
-
import { u as ApprovalRequest } from "../types-
|
|
5
|
-
import { o as AgentAdapterOptions, t as AgentPermDock } from "../create-
|
|
3
|
+
import { a as PermDock } from "../permdock-CprAPN3w.js";
|
|
4
|
+
import { u as ApprovalRequest } from "../types-DLvhVm1r.js";
|
|
5
|
+
import { o as AgentAdapterOptions, t as AgentPermDock } from "../create-BPUopdfL.js";
|
|
6
6
|
//#region src/openai/create.d.ts
|
|
7
7
|
/** The app context passed to `run(agent, input, { context })`. */
|
|
8
8
|
type OpenAiContext = {
|
package/dist/openai/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { t as compact } from "../compact-CAf557ZB.js";
|
|
2
|
-
import { l as withApp } from "../permdock-
|
|
3
|
-
import { t as approvalTokenOf } from "../kernel-
|
|
4
|
-
import { t as agentRuntime } from "../create-
|
|
2
|
+
import { l as withApp } from "../permdock-BvjivVb9.js";
|
|
3
|
+
import { t as approvalTokenOf } from "../kernel-qv4cr9w8.js";
|
|
4
|
+
import { t as agentRuntime } from "../create-6EwRQlig.js";
|
|
5
5
|
//#region src/openai/create.ts
|
|
6
6
|
function appContext(runContext) {
|
|
7
7
|
const context = runContext?.context;
|
package/dist/openapi/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { T as Policy,
|
|
1
|
+
import { T as Policy, br as Condition, pr as Principal } from "../policy-types-DGIO_gxq.js";
|
|
2
2
|
import { f as PermissionTree, u as Permission } from "../permission-types-CAY-GU7e.js";
|
|
3
|
-
import { a as ProblemDetails } from "../errors-
|
|
3
|
+
import { a as ProblemDetails } from "../errors-BIM4MFsJ.js";
|
|
4
4
|
import { StandardJSONSchemaV1, StandardSchemaV1 } from "@standard-schema/spec";
|
|
5
5
|
//#region src/openapi/types.d.ts
|
|
6
6
|
type OpenApiTarget = "3.1" | "3.2" | "3.3";
|
|
@@ -7,7 +7,7 @@ import { a as loadModule, n as asPolicy, s as pickNamed, t as asPermissionTree }
|
|
|
7
7
|
import { t as shortDiff } from "./text-diff-BtfSmdUo.js";
|
|
8
8
|
import { c as openapiVersion, o as createPermDock } from "./openapi-BOsx0xn9.js";
|
|
9
9
|
import { i as fileDrift } from "./output-files-BIQ_9pIs.js";
|
|
10
|
-
import { n as validateOverlay, t as validateOpenapi } from "./schema-
|
|
10
|
+
import { n as validateOverlay, t as validateOpenapi } from "./schema-3PJ8wAeL.js";
|
|
11
11
|
import { existsSync } from "node:fs";
|
|
12
12
|
import { resolve } from "node:path";
|
|
13
13
|
//#region src/cli/openapi/openapi.ts
|
|
@@ -80,7 +80,7 @@ const emit = defineLeaf({
|
|
|
80
80
|
}
|
|
81
81
|
},
|
|
82
82
|
async run(ctx, { flags }) {
|
|
83
|
-
return (await import("./openapi-
|
|
83
|
+
return (await import("./openapi-C-ADypaY.js")).runOpenapi({
|
|
84
84
|
cwd: ctx.cwd,
|
|
85
85
|
config: ctx.config,
|
|
86
86
|
rest: ["emit"],
|
|
@@ -122,7 +122,7 @@ const importDocument = defineLeaf({
|
|
|
122
122
|
async run(ctx, { flags }) {
|
|
123
123
|
const doc = given(flags.doc);
|
|
124
124
|
if (doc === void 0) throw missingInput("openapi import", ["--doc"], "the OpenAPI document to import");
|
|
125
|
-
return (await import("./import-
|
|
125
|
+
return (await import("./import-Iuk9mx8A.js")).runOpenapiImport({
|
|
126
126
|
cwd: ctx.cwd,
|
|
127
127
|
doc,
|
|
128
128
|
out: fileOut("openapi import", flags.out),
|
package/dist/orpc/index.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { T as Policy, j as PolicyVocabulary,
|
|
1
|
+
import { T as Policy, j as PolicyVocabulary, pr as Principal } from "../policy-types-DGIO_gxq.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-CprAPN3w.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-CyRN0-Cd.js";
|
|
7
|
+
import { t as ServerAdapterOptions } from "../bind-YYjvfpB9.js";
|
|
8
|
+
import { t as StreamProtectOptions } from "../stream-9y9qw51m.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
|
@@ -2,9 +2,9 @@ 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
4
|
import { t as problemFromError } from "../map-error-pasIGqMT.js";
|
|
5
|
-
import { n as attached } from "../bind-
|
|
5
|
+
import { n as attached } from "../bind-BNQA9JK9.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-vHIwyXCp.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 { j 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 { j as PolicyVocabulary } from "../policy-types-DGIO_gxq.js";
|
|
2
|
+
import { a as PermDock } from "../permdock-CprAPN3w.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-B6ExllNo.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-B4ENCp2I.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) {
|
|
@@ -9,9 +9,9 @@ import { r as relationCondition, t as inheritCondition } from "./grantee-conditi
|
|
|
9
9
|
import { i as configError } from "./errors-Vpu6rKHl.js";
|
|
10
10
|
import { i as qualifySqlTable } from "./sql-0WjxIp9g.js";
|
|
11
11
|
import { a as scopeMembershipTable, i as scopeColumn, s as relatedSql } from "./compile-EzEMB-7v.js";
|
|
12
|
-
import { l as roleColumn } from "./sources-
|
|
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-
|
|
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-
|
|
12
|
+
import { l as roleColumn } from "./sources-C4vkzZJV.js";
|
|
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-DrGLwM3s.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-DimBcVWY.js";
|
|
15
15
|
//#region src/cli/sql/conditions.ts
|
|
16
16
|
const MAX_CLAIM_DEPTH = 8;
|
|
17
17
|
/**
|
|
@@ -319,6 +319,10 @@ function sqlFunctionNames(condition) {
|
|
|
319
319
|
default: return condition;
|
|
320
320
|
}
|
|
321
321
|
}
|
|
322
|
+
function candidateIds(ctx, field, wrap) {
|
|
323
|
+
return ctx.candidates === void 0 ? "" : wrap(`array(select ${quoteIdent(field)}::text from ${ctx.candidates})`);
|
|
324
|
+
}
|
|
325
|
+
const idsArgument = (ids) => `, ${ids}`;
|
|
322
326
|
/**
|
|
323
327
|
* A `related` condition as uncorrelated subqueries, so Postgres runs the helper
|
|
324
328
|
* once per statement: the row's field in the closure's descendants of the ids
|
|
@@ -331,12 +335,13 @@ function compileRelatedSql(condition, ctx) {
|
|
|
331
335
|
const type = ctx.columnTypes?.[condition.field];
|
|
332
336
|
const cast = type === void 0 || type === "text" ? "" : `::${type}`;
|
|
333
337
|
const column = type === void 0 ? `${quoteIdent(condition.field)}::text` : quoteIdent(condition.field);
|
|
334
|
-
const helper = condition.permission === void 0 ? `${qualified(ctx, graphHelper(condition.resource))}(${quoteLiteral(condition.relation)})` : `${qualified(ctx, inheritedRowsHelper(condition.resource))}(${quoteLiteral(condition.permission)})`;
|
|
338
|
+
const helper = condition.permission === void 0 ? `${qualified(ctx, graphHelper(condition.resource))}(${quoteLiteral(condition.relation)})` : `${qualified(ctx, inheritedRowsHelper(condition.resource))}(${quoteLiteral(condition.permission)}${condition.depth === 0 ? candidateIds(ctx, condition.field, idsArgument) : ""})`;
|
|
335
339
|
const cap = ctx.graph?.closures[condition.resource];
|
|
336
340
|
let inner;
|
|
337
341
|
if (condition.depth > 0 && cap !== void 0) {
|
|
338
342
|
const depth = condition.depth < cap ? ` and depth <= ${String(condition.depth)}` : "";
|
|
339
|
-
|
|
343
|
+
const narrowed = candidateIds(ctx, condition.field, (ids) => ` and descendant = any (${ids})`);
|
|
344
|
+
inner = `select descendant${cast} from ${qualified(ctx, CLOSURE.table)} where resource = ${quoteLiteral(condition.resource)}${depth}${narrowed} and ancestor = any (array(select ${helper}))`;
|
|
340
345
|
} else inner = cast === "" ? `select ${helper}` : `select p.id${cast} from ${helper} as p(id)`;
|
|
341
346
|
const reach = `${column} in (${inner})`;
|
|
342
347
|
if (condition.parent === true && condition.restricted !== void 0) return `(${reach} and ${quoteIdent(condition.restricted)} is not true)`;
|
|
@@ -358,7 +363,7 @@ function compileHoppedSql(condition, ctx) {
|
|
|
358
363
|
closureDepths: ctx.graph?.closures ?? {},
|
|
359
364
|
qualify: qualifySqlTable,
|
|
360
365
|
holders: (resource, relation) => [{ text: `select ${schema}.${graphHelper(resource)}(${quoteLiteral(relation)})` }],
|
|
361
|
-
permitted: (resource, permission) => [{ text: `select ${schema}.${inheritedRowsHelper(resource)}(${quoteLiteral(permission)})` }],
|
|
366
|
+
permitted: (resource, permission) => [{ text: `select ${schema}.${inheritedRowsHelper(resource)}(${quoteLiteral(permission)}${condition.hops?.length === 1 ? candidateIds(ctx, condition.field, idsArgument) : ""})` }],
|
|
362
367
|
restrictedRows: (resource) => [{ text: `select ${schema}.${restrictedHelper(resource)}()` }],
|
|
363
368
|
linked: (resource, link, targets) => [
|
|
364
369
|
{ text: `select ${schema}.${linkHelper(resource, link)}(array(` },
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Yt as LocalSnapshotManifest } from "./policy-types-DGIO_gxq.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 {
|
|
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 { T as Policy, j as PolicyVocabulary, pr as Principal, q as DecisionProvider } from "../policy-types-DGIO_gxq.js";
|
|
2
|
+
import { o as PermDockOptions } from "../permdock-CprAPN3w.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-DlelvQk4.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-CGkP3Z7A.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-BvjivVb9.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-l0oGGetg.js";
|
|
11
11
|
//#region src/pdp/create.ts
|
|
12
12
|
function withoutProviders(policy) {
|
|
@@ -11,8 +11,8 @@ 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-5d1zVBvK.js";
|
|
13
13
|
import { d as policyX } from "./policy-CLQ8__GF.js";
|
|
14
|
-
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-
|
|
15
|
-
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
|
|
14
|
+
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-BAmf_AQd.js";
|
|
15
|
+
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-DuWf1cT3.js";
|
|
16
16
|
import { r as relationReader, t as pendingRelations } from "./relations-BxvRvDHK.js";
|
|
17
17
|
import { i as snapshotGrant } from "./snapshot-CXlzi69u.js";
|
|
18
18
|
import { a as decideForTarget, i as permittedIds, o as deniedFor, r as mayUse, s as signSnapshot, t as whereFromGrants } from "./where-scope-DlCdCM_8.js";
|
|
@@ -512,6 +512,96 @@ function buildInstance(policy, subject, envBase, team) {
|
|
|
512
512
|
return Object.freeze(instance);
|
|
513
513
|
}
|
|
514
514
|
//#endregion
|
|
515
|
+
//#region src/core/freshness.ts
|
|
516
|
+
function versionQuery(principal, issuedAt) {
|
|
517
|
+
return compact({
|
|
518
|
+
id: principal.id,
|
|
519
|
+
roles: principal.roles,
|
|
520
|
+
memberships: principal.memberships,
|
|
521
|
+
authzVersion: principal.authzVersion,
|
|
522
|
+
issuedAt
|
|
523
|
+
});
|
|
524
|
+
}
|
|
525
|
+
function threw(source, auth) {
|
|
526
|
+
auth.push({
|
|
527
|
+
reason: "source-threw",
|
|
528
|
+
source: "memberships",
|
|
529
|
+
...sourceName(source)
|
|
530
|
+
});
|
|
531
|
+
}
|
|
532
|
+
/**
|
|
533
|
+
* `onStale: 'reread'`: a token behind the source's version has its memberships
|
|
534
|
+
* (and global roles, with `readRoles`) read live; a version that cannot be read
|
|
535
|
+
* keeps the claims and marks the subject stale.
|
|
536
|
+
*/
|
|
537
|
+
function rereadStale(source, principal, issuedAt, context, read, auth, readRoles) {
|
|
538
|
+
const claims = principal.memberships ?? [];
|
|
539
|
+
const claimed = principal.authzVersion;
|
|
540
|
+
const judge = (current) => typeof claimed === "number" && current !== void 0 && claimed >= current ? "fresh" : "reread";
|
|
541
|
+
const unknown = () => {
|
|
542
|
+
threw(source, auth);
|
|
543
|
+
return "unknown";
|
|
544
|
+
};
|
|
545
|
+
let freshness;
|
|
546
|
+
try {
|
|
547
|
+
const current = source.version?.(versionQuery(principal, issuedAt), context);
|
|
548
|
+
freshness = isThenable(current) ? Promise.resolve(current).then(judge, unknown) : judge(current);
|
|
549
|
+
} catch {
|
|
550
|
+
freshness = unknown();
|
|
551
|
+
}
|
|
552
|
+
const failed = () => {
|
|
553
|
+
threw(source, auth);
|
|
554
|
+
return [];
|
|
555
|
+
};
|
|
556
|
+
const rolesOf = (found) => {
|
|
557
|
+
if (found !== "reread" || readRoles === void 0) return;
|
|
558
|
+
try {
|
|
559
|
+
const roles = readRoles();
|
|
560
|
+
return isThenable(roles) ? Promise.resolve(roles).catch(failed) : roles;
|
|
561
|
+
} catch {
|
|
562
|
+
return failed();
|
|
563
|
+
}
|
|
564
|
+
};
|
|
565
|
+
if (isThenable(freshness)) {
|
|
566
|
+
const settled = freshness.then((found) => ({
|
|
567
|
+
found,
|
|
568
|
+
roles: rolesOf(found)
|
|
569
|
+
}));
|
|
570
|
+
return {
|
|
571
|
+
memberships: settled.then(({ found }) => found === "reread" ? read() : claims),
|
|
572
|
+
stale: settled.then(({ found }) => found === "unknown"),
|
|
573
|
+
roles: settled.then(({ roles }) => roles)
|
|
574
|
+
};
|
|
575
|
+
}
|
|
576
|
+
return compact({
|
|
577
|
+
memberships: freshness === "reread" ? read() : claims,
|
|
578
|
+
stale: freshness === "unknown",
|
|
579
|
+
roles: rolesOf(freshness)
|
|
580
|
+
});
|
|
581
|
+
}
|
|
582
|
+
/**
|
|
583
|
+
* Whether the token's memberships are behind the source for `fresh`
|
|
584
|
+
* permissions. Live memberships are never stale; token memberships are stale
|
|
585
|
+
* unless a source reports a version the token's `authzVersion` has reached.
|
|
586
|
+
*/
|
|
587
|
+
function staleness(policy, principal, source, given, auth) {
|
|
588
|
+
if ((policy.fresh ?? []).length === 0 || principal === null || given.live) return false;
|
|
589
|
+
if (given.stale !== void 0) return given.stale;
|
|
590
|
+
const claimed = principal.authzVersion;
|
|
591
|
+
if (source?.version === void 0 || typeof claimed !== "number") return true;
|
|
592
|
+
const compare = (current) => current === void 0 || claimed < current;
|
|
593
|
+
try {
|
|
594
|
+
const current = source.version(versionQuery(principal, given.issuedAt), given.context);
|
|
595
|
+
return isThenable(current) ? Promise.resolve(current).then(compare, () => {
|
|
596
|
+
threw(source, auth);
|
|
597
|
+
return true;
|
|
598
|
+
}) : compare(current);
|
|
599
|
+
} catch {
|
|
600
|
+
threw(source, auth);
|
|
601
|
+
return true;
|
|
602
|
+
}
|
|
603
|
+
}
|
|
604
|
+
//#endregion
|
|
515
605
|
//#region src/core/oauth-scopes.ts
|
|
516
606
|
/**
|
|
517
607
|
* Every OAuth scope a token may carry to the permission keys it reaches: each
|
|
@@ -585,6 +675,21 @@ function hasScope(granted, scopes) {
|
|
|
585
675
|
return scopes.some((scope) => granted?.includes(scope) === true);
|
|
586
676
|
}
|
|
587
677
|
//#endregion
|
|
678
|
+
//#region src/core/source-memo.ts
|
|
679
|
+
/**
|
|
680
|
+
* One memo per `getPermDock` call. A read that throws is not kept, so the next
|
|
681
|
+
* caller tries again.
|
|
682
|
+
*/
|
|
683
|
+
function sourceMemo() {
|
|
684
|
+
const answers = /* @__PURE__ */ new Map();
|
|
685
|
+
return (key, read) => {
|
|
686
|
+
if (answers.has(key)) return answers.get(key);
|
|
687
|
+
const answer = read();
|
|
688
|
+
answers.set(key, answer);
|
|
689
|
+
return answer;
|
|
690
|
+
};
|
|
691
|
+
}
|
|
692
|
+
//#endregion
|
|
588
693
|
//#region src/core/resolve-subject.ts
|
|
589
694
|
/**
|
|
590
695
|
* The tenant a user API key holds its owner to (`Credential.tenant`): only the
|
|
@@ -599,13 +704,14 @@ function heldTenantOf(principal) {
|
|
|
599
704
|
function outsideHeld(held, options) {
|
|
600
705
|
return held !== void 0 && options.tenant !== void 0 && options.tenant !== held;
|
|
601
706
|
}
|
|
602
|
-
function assemblePrincipal(policy, user, options, auth) {
|
|
707
|
+
function assemblePrincipal(policy, user, options, auth, memo) {
|
|
603
708
|
let principal;
|
|
604
709
|
let context = {};
|
|
605
710
|
let actor = options.actor;
|
|
606
711
|
let delegation = options.delegation;
|
|
607
712
|
let session = options.session;
|
|
608
713
|
let expiresAt = options.expiresAt;
|
|
714
|
+
let issuedAt;
|
|
609
715
|
let liveSession;
|
|
610
716
|
try {
|
|
611
717
|
if (user === null || user === void 0) principal = policy.subject(user);
|
|
@@ -616,6 +722,7 @@ function assemblePrincipal(policy, user, options, auth) {
|
|
|
616
722
|
delegation = user.delegation ?? delegation;
|
|
617
723
|
session = user.session ?? session;
|
|
618
724
|
expiresAt = user.expiresAt ?? expiresAt;
|
|
725
|
+
issuedAt = typeof user.issuedAt === "number" && Number.isFinite(user.issuedAt) ? user.issuedAt : void 0;
|
|
619
726
|
liveSession = user.liveSession === true ? true : void 0;
|
|
620
727
|
} else principal = policy.subject(user);
|
|
621
728
|
} catch {
|
|
@@ -631,7 +738,10 @@ function assemblePrincipal(policy, user, options, auth) {
|
|
|
631
738
|
return from.membershipsFor(compact({
|
|
632
739
|
id: of.id,
|
|
633
740
|
kind: of.kind
|
|
634
|
-
}), compact({
|
|
741
|
+
}), compact({
|
|
742
|
+
tenant: options.tenant,
|
|
743
|
+
memo
|
|
744
|
+
}));
|
|
635
745
|
} catch {
|
|
636
746
|
auth.push({
|
|
637
747
|
reason: "source-threw",
|
|
@@ -647,10 +757,13 @@ function assemblePrincipal(policy, user, options, auth) {
|
|
|
647
757
|
live = true;
|
|
648
758
|
memberships = read(source, principal);
|
|
649
759
|
} else if (principal?.memberships !== void 0 && fromClaims && source.onStale === "reread" && source.version !== void 0) {
|
|
650
|
-
const reread = rereadStale(source, principal,
|
|
760
|
+
const reread = rereadStale(source, principal, issuedAt, {
|
|
761
|
+
memo,
|
|
762
|
+
intent: options.intent ?? "write"
|
|
763
|
+
}, () => read(source, principal), auth, source.globalRolesFor === void 0 ? void 0 : () => source.globalRolesFor?.(compact({
|
|
651
764
|
id: principal.id,
|
|
652
765
|
kind: principal.kind
|
|
653
|
-
})) ?? []);
|
|
766
|
+
}), { memo }) ?? []);
|
|
654
767
|
memberships = reread.memberships;
|
|
655
768
|
stale = reread.stale;
|
|
656
769
|
roles = reread.roles;
|
|
@@ -663,78 +776,21 @@ function assemblePrincipal(policy, user, options, auth) {
|
|
|
663
776
|
delegation: expandOAuthScopes(policy, delegation),
|
|
664
777
|
session,
|
|
665
778
|
expiresAt,
|
|
779
|
+
issuedAt,
|
|
666
780
|
memberships,
|
|
667
781
|
live,
|
|
668
782
|
stale,
|
|
669
783
|
liveSession: principal === null ? void 0 : liveSession
|
|
670
784
|
});
|
|
671
785
|
}
|
|
672
|
-
function versionQuery(principal) {
|
|
673
|
-
return compact({
|
|
674
|
-
id: principal.id,
|
|
675
|
-
roles: principal.roles,
|
|
676
|
-
memberships: principal.memberships
|
|
677
|
-
});
|
|
678
|
-
}
|
|
679
|
-
function rereadStale(source, principal, claims, read, auth, readRoles) {
|
|
680
|
-
const claimed = principal.authzVersion;
|
|
681
|
-
const judge = (current) => typeof claimed === "number" && current !== void 0 && claimed >= current ? "fresh" : "reread";
|
|
682
|
-
const unknown = () => {
|
|
683
|
-
auth.push({
|
|
684
|
-
reason: "source-threw",
|
|
685
|
-
source: "memberships",
|
|
686
|
-
...sourceName(source)
|
|
687
|
-
});
|
|
688
|
-
return "unknown";
|
|
689
|
-
};
|
|
690
|
-
let freshness;
|
|
691
|
-
try {
|
|
692
|
-
const current = source.version?.(versionQuery(principal));
|
|
693
|
-
freshness = isThenable(current) ? Promise.resolve(current).then(judge, unknown) : judge(current);
|
|
694
|
-
} catch {
|
|
695
|
-
freshness = unknown();
|
|
696
|
-
}
|
|
697
|
-
const failed = () => {
|
|
698
|
-
auth.push({
|
|
699
|
-
reason: "source-threw",
|
|
700
|
-
source: "memberships",
|
|
701
|
-
...sourceName(source)
|
|
702
|
-
});
|
|
703
|
-
return [];
|
|
704
|
-
};
|
|
705
|
-
const rolesOf = (found) => {
|
|
706
|
-
if (found !== "reread" || readRoles === void 0) return;
|
|
707
|
-
try {
|
|
708
|
-
const roles = readRoles();
|
|
709
|
-
return isThenable(roles) ? Promise.resolve(roles).catch(failed) : roles;
|
|
710
|
-
} catch {
|
|
711
|
-
return failed();
|
|
712
|
-
}
|
|
713
|
-
};
|
|
714
|
-
if (isThenable(freshness)) {
|
|
715
|
-
const settled = freshness.then((found) => ({
|
|
716
|
-
found,
|
|
717
|
-
roles: rolesOf(found)
|
|
718
|
-
}));
|
|
719
|
-
return {
|
|
720
|
-
memberships: settled.then(({ found }) => found === "reread" ? read() : claims),
|
|
721
|
-
stale: settled.then(({ found }) => found === "unknown"),
|
|
722
|
-
roles: settled.then(({ roles }) => roles)
|
|
723
|
-
};
|
|
724
|
-
}
|
|
725
|
-
return compact({
|
|
726
|
-
memberships: freshness === "reread" ? read() : claims,
|
|
727
|
-
stale: freshness === "unknown",
|
|
728
|
-
roles: rolesOf(freshness)
|
|
729
|
-
});
|
|
730
|
-
}
|
|
731
786
|
function finishSubject(policy, assembled, context, input, options, extra) {
|
|
732
787
|
if (assembled.principal === null) return freezeCopy(compact({
|
|
733
788
|
...anonymousSubject(context),
|
|
734
789
|
actor: assembled.actor,
|
|
735
790
|
delegation: assembled.delegation,
|
|
736
791
|
session: assembled.session,
|
|
737
|
-
expiresAt: assembled.expiresAt
|
|
792
|
+
expiresAt: assembled.expiresAt,
|
|
793
|
+
issuedAt: assembled.issuedAt
|
|
738
794
|
}));
|
|
739
795
|
const scopes = scopeList(policy.scopes);
|
|
740
796
|
const held = heldTenantOf(assembled.principal);
|
|
@@ -760,6 +816,7 @@ function finishSubject(policy, assembled, context, input, options, extra) {
|
|
|
760
816
|
context: freezeCopy(context),
|
|
761
817
|
session: assembled.session,
|
|
762
818
|
expiresAt: assembled.expiresAt,
|
|
819
|
+
issuedAt: assembled.issuedAt,
|
|
763
820
|
stale: extra.stale ? true : void 0,
|
|
764
821
|
liveSession: assembled.liveSession
|
|
765
822
|
}));
|
|
@@ -807,37 +864,6 @@ function settle(value, fallback, onError) {
|
|
|
807
864
|
});
|
|
808
865
|
return value;
|
|
809
866
|
}
|
|
810
|
-
/**
|
|
811
|
-
* Whether the token's memberships are behind the source for `fresh`
|
|
812
|
-
* permissions. Live memberships are never stale; token memberships are stale
|
|
813
|
-
* unless a source reports a version the token's `authzVersion` has reached.
|
|
814
|
-
*/
|
|
815
|
-
function staleness(policy, assembled, options, auth) {
|
|
816
|
-
const principal = assembled.principal;
|
|
817
|
-
if ((policy.fresh ?? []).length === 0 || principal === null || assembled.live) return false;
|
|
818
|
-
if (assembled.stale !== void 0) return assembled.stale;
|
|
819
|
-
const source = options.memberships === void 0 ? void 0 : asMembershipSource(options.memberships);
|
|
820
|
-
const claimed = principal.authzVersion;
|
|
821
|
-
if (source?.version === void 0 || typeof claimed !== "number") return true;
|
|
822
|
-
const compare = (current) => current === void 0 || claimed < current;
|
|
823
|
-
try {
|
|
824
|
-
const current = source.version(versionQuery(principal));
|
|
825
|
-
return isThenable(current) ? settle(Promise.resolve(current).then(compare), true, () => {
|
|
826
|
-
auth.push({
|
|
827
|
-
reason: "source-threw",
|
|
828
|
-
source: "memberships",
|
|
829
|
-
...sourceName(source)
|
|
830
|
-
});
|
|
831
|
-
}) : compare(current);
|
|
832
|
-
} catch {
|
|
833
|
-
auth.push({
|
|
834
|
-
reason: "source-threw",
|
|
835
|
-
source: "memberships",
|
|
836
|
-
...sourceName(source)
|
|
837
|
-
});
|
|
838
|
-
return true;
|
|
839
|
-
}
|
|
840
|
-
}
|
|
841
867
|
function cleanNames(list) {
|
|
842
868
|
return Array.isArray(list) ? list.filter((item) => typeof item === "string" && item !== "") : [];
|
|
843
869
|
}
|
|
@@ -891,25 +917,33 @@ function withRequestContext(request, resolved) {
|
|
|
891
917
|
...resolved
|
|
892
918
|
};
|
|
893
919
|
}
|
|
894
|
-
function resolveSubject(policy, user, options, auth) {
|
|
895
|
-
const first = assemblePrincipal(policy, user, options, auth);
|
|
920
|
+
function resolveSubject(policy, user, options, auth, memo = sourceMemo()) {
|
|
921
|
+
const first = assemblePrincipal(policy, user, options, auth, memo);
|
|
896
922
|
const apply = (roles) => resolveAssembled(policy, roles === void 0 || first.principal === null ? first : {
|
|
897
923
|
...first,
|
|
898
924
|
principal: {
|
|
899
925
|
...first.principal,
|
|
900
926
|
roles
|
|
901
927
|
}
|
|
902
|
-
}, options, auth);
|
|
928
|
+
}, options, auth, memo);
|
|
903
929
|
return isThenable(first.roles) ? Promise.resolve(first.roles).then(apply) : apply(first.roles);
|
|
904
930
|
}
|
|
905
|
-
function resolveAssembled(policy, assembled, options, auth) {
|
|
931
|
+
function resolveAssembled(policy, assembled, options, auth, memo) {
|
|
906
932
|
const memberships = settle(assembled.memberships, [], () => {
|
|
907
933
|
auth.push({
|
|
908
934
|
reason: "source-threw",
|
|
909
935
|
source: "memberships"
|
|
910
936
|
});
|
|
911
937
|
});
|
|
912
|
-
const stale = staleness(policy, assembled, options,
|
|
938
|
+
const stale = staleness(policy, assembled.principal, options.memberships === void 0 ? void 0 : asMembershipSource(options.memberships), {
|
|
939
|
+
live: assembled.live,
|
|
940
|
+
stale: assembled.stale,
|
|
941
|
+
issuedAt: assembled.issuedAt,
|
|
942
|
+
context: {
|
|
943
|
+
memo,
|
|
944
|
+
intent: options.intent ?? "write"
|
|
945
|
+
}
|
|
946
|
+
}, auth);
|
|
913
947
|
const withPlans = (resolved) => entitlementsOf(assembled, activeTenantOf(policy, assembled, applyRoleKinds(policy, assembled.principal?.roles, normalizeMemberships(resolved, scopeList(policy.scopes))).memberships, options), options, auth);
|
|
914
948
|
if (isThenable(assembled.context) || isThenable(memberships) || isThenable(stale)) return Promise.all([
|
|
915
949
|
Promise.resolve(assembled.context),
|
|
@@ -934,7 +968,7 @@ function resolveAssembled(policy, assembled, options, auth) {
|
|
|
934
968
|
}
|
|
935
969
|
//#endregion
|
|
936
970
|
//#region src/core/permdock.ts
|
|
937
|
-
function instantiate(codePolicy, subject, options, auth) {
|
|
971
|
+
function instantiate(codePolicy, subject, options, auth, memo) {
|
|
938
972
|
const { policy, errors } = options.policies?.apply(codePolicy) ?? {
|
|
939
973
|
policy: codePolicy,
|
|
940
974
|
errors: []
|
|
@@ -942,7 +976,7 @@ function instantiate(codePolicy, subject, options, auth) {
|
|
|
942
976
|
const scopes = scopeList(policy.scopes);
|
|
943
977
|
const tenants = tenantsOf(subject.principal, scopes);
|
|
944
978
|
const roleSource = roleSourceFor(options.customRoles, subject, auth);
|
|
945
|
-
const customRoles = customRolesFor(roleSource, tenants, auth, subject.principal === null ? void 0 : subject.principal.roles ?? [], (tenant) => heldRoleNamesIn(subject.principal, scopes, tenant));
|
|
979
|
+
const customRoles = customRolesFor(roleSource, tenants, auth, subject.principal === null ? void 0 : subject.principal.roles ?? [], (tenant) => heldRoleNamesIn(subject.principal, scopes, tenant), memo);
|
|
946
980
|
const assignable = assignableNamesFor(roleSource, tenants, auth);
|
|
947
981
|
const approvals = options.approvalPolicies?.load(policy, tenants, auth);
|
|
948
982
|
const build = (roles, names, approvalPolicies) => {
|
|
@@ -971,6 +1005,7 @@ function instantiate(codePolicy, subject, options, auth) {
|
|
|
971
1005
|
context: {}
|
|
972
1006
|
}, compact({
|
|
973
1007
|
tenant,
|
|
1008
|
+
intent: options.intent,
|
|
974
1009
|
memberships: options.memberships,
|
|
975
1010
|
customRoles: options.customRoles,
|
|
976
1011
|
entitlements: options.entitlements,
|
|
@@ -991,9 +1026,10 @@ function instantiate(codePolicy, subject, options, auth) {
|
|
|
991
1026
|
function create(policy, user, given) {
|
|
992
1027
|
const options = withApp(policy, given);
|
|
993
1028
|
const auth = [];
|
|
994
|
-
const
|
|
995
|
-
|
|
996
|
-
return instantiate(policy,
|
|
1029
|
+
const memo = sourceMemo();
|
|
1030
|
+
const subject = resolveSubject(policy, user, options, auth, memo);
|
|
1031
|
+
if (isThenable(subject)) return subject.then((resolved) => instantiate(policy, resolved, options, auth, memo));
|
|
1032
|
+
return instantiate(policy, subject, options, auth, memo);
|
|
997
1033
|
}
|
|
998
1034
|
/**
|
|
999
1035
|
* The instance for `user`, built synchronously. Every input must answer
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { $n as Quota, G as CustomRoleSource, J as DecisionSink, Jn as ExplainedDecision, K as CustomRoleSourceFactory, Qn as Obligation, T as Policy, Un as Decision, Wt as Instant, X as Intent, Xn as LimitDetail, Y as EntitlementSource, Zt as Snapshot, _ as GrantLimit, br as Condition, et as LimitStore, fr as Membership, h as Grant, hr as Subject, i as ApprovalOption, j as PolicyVocabulary, lr as Delegation, mt as TokenSigner, nt as MembershipSource, on as DecisionEvent, ot as RelationSource, pr as Principal, rn as AuthEvent, rr as Actor, st as SettingsSource, vn as Scope, vr as AdapterId } from "./policy-types-DGIO_gxq.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 { i as OperationEffect, s as OperationMeta, t as Operation, u as OperationRisk } from "./operations-Ci_rT6Uo.js";
|
|
5
|
-
import { a as HostedPolicies } from "./hosted-
|
|
5
|
+
import { a as HostedPolicies } from "./hosted-DVxlLZMe.js";
|
|
6
6
|
//#region src/core/approval-policies.d.ts
|
|
7
7
|
/**
|
|
8
8
|
* One approval requirement kept as data, for a tenant or the whole platform. It
|
|
@@ -595,6 +595,13 @@ type PermDockOptions = {
|
|
|
595
595
|
readonly tenant?: string;
|
|
596
596
|
/** One source, or several composed with `composeMemberships`. */
|
|
597
597
|
readonly memberships?: MembershipSource | readonly MembershipSource[];
|
|
598
|
+
/**
|
|
599
|
+
* `'read'` lets `claimsFirst(source, { versions })` judge the token from the
|
|
600
|
+
* shared version cache, at most its `maxStaleMs` stale; `'write'` (the
|
|
601
|
+
* default) reads the version live. Pick `'read'` for rendering and `GET`
|
|
602
|
+
* handlers, never for a mutation.
|
|
603
|
+
*/
|
|
604
|
+
readonly intent?: Intent;
|
|
598
605
|
readonly customRoles?: CustomRoleSource | CustomRoleSourceFactory;
|
|
599
606
|
/**
|
|
600
607
|
* Plans and seats from billing, merged into `principal.plans` for the active
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { c as crud } from "./src-
|
|
1
|
+
import { c as crud } from "./src-C_pi2Rnh.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
4
|
import { t as definePermissions } from "./permissions-CVXmRILq.js";
|