permdock 0.15.0 → 0.17.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/{adapter-context-CIQpQxbE.js → adapter-context-OHikyRqV.js} +1 -1
- package/dist/{adoption-scan-DLel53Oa.js → adoption-scan-Ci0xiJ3T.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 +189 -0
- package/dist/approval-policies-9VagPixq.d.ts +138 -0
- package/dist/{approval-prompt-3BqWczTt.d.ts → approval-prompt-BSh-yxbH.d.ts} +1 -1
- package/dist/approvals/index.d.ts +5 -4
- package/dist/approvals/index.js +7 -6
- package/dist/{approvals-DnIBTuXE.js → approvals-DdFcTncq.js} +3 -3
- package/dist/{approvers-B4r0N_Uz.js → approvers-CNtl4Vc5.js} +22 -1
- package/dist/{arazzo-CL8CZnpL.js → arazzo-7kbeh1yi.js} +2 -2
- package/dist/{arazzo-CHK9NT6u.js → arazzo-_zUmT8ZT.js} +4 -4
- package/dist/{args-0FrVs5EH.js → args-iafbHiXn.js} +2 -5
- package/dist/astro/index.d.ts +4 -4
- package/dist/astro/index.js +2 -2
- package/dist/{audience-DTjR8xet.js → audience-jRO819i3.js} +1 -1
- package/dist/{auth--yPyZNgr.js → auth-j3Eu-j4h.js} +1 -1
- package/dist/authz-topic-Dbc-HDOS.js +15 -0
- package/dist/authzen/index.d.ts +5 -5
- package/dist/authzen/index.js +2 -2
- package/dist/{automation-C6Jg75xq.d.ts → automation-DCWuVKtd.d.ts} +1 -1
- package/dist/better-auth/index.d.ts +1 -1
- package/dist/better-auth/index.js +10 -8
- package/dist/better-supabase/index.d.ts +273 -38
- package/dist/better-supabase/index.js +493 -102
- package/dist/{better-supabase-Dirf_8Ec.js → better-supabase-BJtQ-kNf.js} +26 -10
- package/dist/{bind-BNQA9JK9.js → bind-BJFeLX1V.js} +6 -6
- package/dist/{bind-YYjvfpB9.d.ts → bind-DjFNX0Pq.d.ts} +7 -7
- package/dist/{budget-BELja5A9.js → budget-BBCPDOGP.js} +1 -1
- package/dist/{budget-hYsPz_yE.d.ts → budget-CNLsV2SL.d.ts} +1 -1
- package/dist/{build-instance-BWXqwQYU.js → build-instance-lye7oEqf.js} +3 -2
- package/dist/{capability-Di9tiUvi.d.ts → capability-BzjWdKmP.d.ts} +1 -1
- package/dist/{capability-BqX94r07.js → capability-zN6T9fxe.js} +2 -3
- package/dist/{casbin-iAEXjmca.js → casbin-C3O_O9nu.js} +2 -2
- package/dist/{casbin-DRFwgVIP.js → casbin-DFzk_so3.js} +2 -2
- package/dist/{casl-C4OINZHI.js → casl-CjBVJj8R.js} +2 -2
- package/dist/{casl-CHHoCldP.js → casl-CkBssiB1.js} +1 -1
- package/dist/catalog/index.d.ts +5 -5
- package/dist/catalog/index.js +6 -6
- package/dist/catalog-BpnjesqX.js +1 -0
- package/dist/{catalog-CGlSwU6j.js → catalog-DGDd_ww1.js} +5 -5
- package/dist/{catalog-amPDr0JQ.js → catalog-DJJIkR9P.js} +3 -3
- package/dist/{catalog-doc-DjMKzJp9.js → catalog-doc-C4DGfJCO.js} +3 -3
- package/dist/{catalog-operations-DeHTrJSV.js → catalog-operations-DVI5QO5R.js} +3 -3
- package/dist/{challenge-DImNcR7B.js → challenge-M_ghKJnT.js} +2 -2
- 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/{checks-CGkP3Z7A.js → checks-fyDOhcz0.js} +33 -1
- 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/clerk/index.js +10 -7
- package/dist/cli/bin.js +1 -1
- package/dist/cli/index.d.ts +5 -5
- package/dist/cli/index.js +3 -3
- package/dist/cloud/index.d.ts +8 -8
- package/dist/cloud/index.js +1 -1
- package/dist/{cloud-eOtmuonF.js → cloud-DYqzmh5i.js} +4 -4
- package/dist/{codemod-KEDj_3zl.js → codemod-DNGMGqBS.js} +395 -8
- package/dist/{codemod-D6NYu4AK.js → codemod-DqB9klYI.js} +3 -3
- package/dist/{collect-DnXL4B8c.js → collect-C44RrKCI.js} +4 -4
- package/dist/collect-CAibhmCi.js +1 -0
- package/dist/{collect-WCl8cJQV.js → collect-HfJXl8Tr.js} +4 -4
- package/dist/compile/index.d.ts +1 -1
- package/dist/compile/index.js +1 -1
- package/dist/{compile-EzEMB-7v.js → compile-B_oJqmIg.js} +4 -4
- package/dist/{compile-BEklRUYo.d.ts → compile-BxiwRotu.d.ts} +2 -2
- package/dist/{completion-DCza8aQY.js → completion-pwVjJlek.js} +3 -3
- package/dist/{config-CcLlvEYW.js → config-COHmivz9.js} +4 -4
- package/dist/{config-BAM3a3z8.js → config-DnfH6_eT.js} +2 -2
- package/dist/{config-report-VZcQ0ZpS.js → config-report-C1jl7Na-.js} +2 -2
- package/dist/{context-BnIzxTNE.js → context-DeammvFl.js} +2 -2
- package/dist/convex/index.d.ts +4 -4
- package/dist/convex/index.js +3 -3
- package/dist/{core-CFepFiDP.d.ts → core-0iYZ5HUx.d.ts} +2 -2
- package/dist/{core-lxoANyai.js → core-W5f4Rjt0.js} +7 -7
- package/dist/{create-DBvUsgzK.d.ts → create-DNN3OtsO.d.ts} +4 -4
- package/dist/{create-CDd9c22W.d.ts → create-DrHUmKvG.d.ts} +6 -6
- package/dist/{create-BPUopdfL.d.ts → create-bzQlBzG4.d.ts} +7 -7
- package/dist/{create-Coq5fIrq.js → create-gqtDb1nU.js} +5 -5
- package/dist/{create-BLPKnJKa.js → create-jCPwPWXf.js} +6 -5
- package/dist/{credential-CyyyvCsL.js → credential-B3Hj4puZ.js} +4 -3
- package/dist/{credentials-CdDxp7jN.js → credentials-dkycUsY3.js} +1 -1
- package/dist/decision-CaG5_eNJ.js +21 -0
- package/dist/{delegation-CDB6_keF.js → delegation-aK4T_5WU.js} +3 -3
- package/dist/delivery/index.d.ts +4 -4
- package/dist/delivery/index.js +1 -1
- package/dist/{denied-text-DHldhVUv.d.ts → denied-text-DyzWwxEB.d.ts} +1 -1
- package/dist/{describe-Bb4hGK5d.js → describe-CogP1loh.js} +2 -1
- package/dist/{describe-BbFPBSms.d.ts → describe-nalX_HHE.d.ts} +1 -1
- package/dist/{diff-DfmYaIhB.js → diff-BTsLiW59.js} +7 -7
- package/dist/{diff-CxtbOi2l.js → diff-CcxYooMu.js} +2 -2
- package/dist/{doctor-gIO9WTYo.js → doctor-BNRhJegR.js} +3 -3
- package/dist/{doctor-CMqPKuN_.js → doctor-DS-9ApID.js} +195 -30
- package/dist/drizzle/index.d.ts +3 -3
- package/dist/drizzle/index.js +1 -1
- package/dist/elysia/index.d.ts +4 -4
- package/dist/elysia/index.js +3 -3
- package/dist/{errors-Vpu6rKHl.js → errors-BhRkoNS7.js} +0 -2
- package/dist/{errors-BIM4MFsJ.d.ts → errors-Dc9FdamT.d.ts} +1 -1
- package/dist/{evaluate-BAmf_AQd.js → evaluate-CsjXeLRo.js} +18 -15
- package/dist/{evaluations-DOWuBpWv.d.ts → evaluations-BasA9zXp.d.ts} +3 -3
- package/dist/{evaluations-IBceAeKT.js → evaluations-DG40eSJa.js} +3 -22
- 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-BIbBAtPZ.d.ts → fetch-adapter-BgqpOOpd.d.ts} +2 -2
- package/dist/{fetch-adapter-dPTgJVHd.js → fetch-adapter-UZOW0PRC.js} +2 -2
- package/dist/{fields-DI8s3cPl.js → fields-CrjL6A49.js} +3 -3
- package/dist/{files-B3AA05f1.js → files-CfiRtQ-m.js} +1 -1
- package/dist/{fixtures-Bm4_K1ke.js → fixtures-0VTW5oNq.js} +2 -2
- package/dist/{flags-DXjoTVbS.js → flags-BlmpmXoY.js} +2 -2
- package/dist/{from-snapshot-DCakWRsr.js → from-snapshot-DMlSSo9b.js} +14 -12
- package/dist/{gen-DwgCSC6V.js → gen-CNCzG4sB.js} +2 -2
- package/dist/{gen-DuAhghDw.js → gen-DnpZwQPo.js} +9 -9
- package/dist/{generate-CRVV5V7l.js → generate-BqkZq8Dr.js} +2 -2
- package/dist/{grantee-conditions-BrYPe-w0.js → grantee-conditions-DX4K_gGI.js} +1 -1
- package/dist/{grantee-match-7RZZvoT_.js → grantee-match-BP-k4vRJ.js} +2 -2
- package/dist/h3/index.d.ts +4 -4
- package/dist/h3/index.js +3 -3
- package/dist/{helpers-DJicaG6f.js → helpers-DNnZffrI.js} +76 -12
- package/dist/hono/index.d.ts +4 -4
- package/dist/hono/index.js +3 -3
- package/dist/{hosted-DVxlLZMe.d.ts → hosted-DxRLLiFU.d.ts} +1 -1
- package/dist/{hosted-D0IzESu_.js → hosted-tPZnyjQS.js} +12 -10
- package/dist/{http-DOL33cO0.js → http-DhMWeB_h.js} +1 -1
- package/dist/{import-DK_J8tVE.js → import-BYVbSKx0.js} +3 -3
- package/dist/{import-CNBF96hB.js → import-C1XXpG_m.js} +4 -4
- package/dist/{index-Cay5-Kvx.d.ts → index-Bt-UoBWu.d.ts} +11 -10
- package/dist/{index-DJwEgYzA.d.ts → index-CXXUFWtG.d.ts} +17 -11
- package/dist/{index-Dj2qF9VC.d.ts → index-CZ5mixHO.d.ts} +1 -1
- package/dist/{index-ymept53A.d.ts → index-DFwUOkvt.d.ts} +4 -4
- package/dist/{index-CV-7DWeD.d.ts → index-DtGtDzjb.d.ts} +4 -4
- package/dist/{index-BinlXeU-.d.ts → index-z44pfWar.d.ts} +2 -2
- package/dist/index.d.ts +18 -16
- package/dist/index.js +20 -18
- package/dist/{init-Buibrl9h.js → init-Dr1qAStu.js} +5 -5
- package/dist/{init-jLSyPMM7.js → init-YSDySeMy.js} +5 -5
- package/dist/{instance-options-CoHn-0e8.d.ts → instance-options-BOCRxEFb.d.ts} +2 -2
- package/dist/{instance-snapshot-DuWf1cT3.js → instance-snapshot-BgOGtyCy.js} +15 -12
- package/dist/jwt/index.d.ts +4 -4
- package/dist/jwt/index.js +3 -3
- package/dist/{kernel-BD8QuMnv.js → kernel-CDDU93dI.js} +10 -10
- package/dist/kysely/index.d.ts +3 -3
- package/dist/kysely/index.js +1 -1
- package/dist/{load-DjSU5KXO.js → load-BaEamml-.js} +1 -1
- package/dist/load-CjnlPxpL.js +1 -0
- package/dist/{login-CB55O4Gv.js → login-CXgEKLaW.js} +4 -4
- package/dist/{login-VVpkkund.js → login-DEVXDTX8.js} +4 -4
- package/dist/{manifest-CbEyvPN2.js → manifest-Dij1U0hx.js} +37 -37
- package/dist/{map-claims-C-nv08_n.js → map-claims-PQwHynxV.js} +25 -11
- package/dist/{map-error-pasIGqMT.js → map-error-B_f3C5cs.js} +1 -1
- package/dist/mcp/index.d.ts +8 -8
- package/dist/mcp/index.js +9 -9
- package/dist/{migrate-BJHxQqT5.js → migrate-BbY5-Khy.js} +4 -4
- package/dist/{module-values-B1EVTkHP.js → module-values-B8tNIxdd.js} +2 -2
- package/dist/nest/index.d.ts +4 -4
- package/dist/nest/index.js +3 -3
- package/dist/next/index.d.ts +32 -13
- package/dist/next/index.js +43 -25
- package/dist/next/plugin.d.ts +1 -1
- package/dist/next/plugin.js +2 -2
- 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-eHZ5hwUJ.js → openapi-D3wkvOoU.js} +4 -4
- package/dist/{openapi-CleDZYVf.js → openapi-GM-kTdkq.js} +5 -5
- 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/otel/index.js +1 -1
- package/dist/{output-BVZpQDad.js → output-DhTpe8v1.js} +1 -1
- package/dist/output-files-BYscrQl-.js +1 -0
- package/dist/{output-files-BIQ_9pIs.js → output-files-CM0BnH05.js} +1 -1
- package/dist/{ownership-qqBuGJXr.js → ownership-moSRhxl_.js} +6 -6
- package/dist/{parse-1_ZheTW5.js → parse-UTC-sDrt.js} +2 -2
- package/dist/{parse-local-manifest-CCmbhnxP.d.ts → parse-local-manifest-BgTYdR3q.d.ts} +1 -1
- package/dist/{parse-request-CwCZpyjV.js → parse-request-DOBVaeiQ.js} +1 -1
- package/dist/pdp/index.d.ts +3 -3
- package/dist/pdp/index.js +3 -3
- package/dist/{peer-Q0fuZ6hx.js → peer-BuK9F53f.js} +1 -1
- package/dist/{peer-C9LvBCcb.js → peer-n-swIV4H.js} +1 -1
- package/dist/{permdock-CprAPN3w.d.ts → permdock-DUWZEOLR.d.ts} +88 -131
- package/dist/{permdock-BvjivVb9.js → permdock-DdzMv5-F.js} +195 -102
- package/dist/{permissions-CYcHj_w7.js → permissions-CvpPtz5O.js} +1 -1
- package/dist/{pg-DQTqRrou.js → pg-Ddxsd5ZB.js} +2 -2
- package/dist/{policy-BycVKnXv.d.ts → policy-CTNl7pvN.d.ts} +1 -1
- package/dist/{policy-CLQ8__GF.js → policy-DxQyHKPB.js} +5 -4
- package/dist/{policy-from-catalog-CU3An8uP.js → policy-from-catalog-DVa1faOr.js} +8 -7
- package/dist/{policy-types-DGIO_gxq.d.ts → policy-types-IRJVABmm.d.ts} +63 -19
- package/dist/{postgrest-D5nUGm-c.d.ts → postgrest-B_cEDd4e.d.ts} +12 -7
- package/dist/{postgrest-DAxFltvO.js → postgrest-BrjrckDG.js} +74 -19
- package/dist/{powersync-CFWILHjb.js → powersync-BZxw_v-A.js} +3 -3
- package/dist/{powersync-uqYWxTjq.js → powersync-C0nsyULQ.js} +15 -15
- package/dist/powersync-Cqzx25dI.js +1 -0
- package/dist/preset/index.js +1 -1
- package/dist/{preset-BjLzeFpp.js → preset-pPrVyGU5.js} +74 -7
- package/dist/prisma/index.d.ts +2 -2
- package/dist/prisma/index.js +1 -1
- package/dist/{protected-action-DUYqb-Ma.js → protected-action-B6n6w7Rl.js} +1 -1
- package/dist/{protected-action-D8x73IGm.d.ts → protected-action-D3S9U4nc.d.ts} +14 -7
- package/dist/{protected-action-QEA8arRB.js → protected-action-qowj6nxN.js} +15 -5
- package/dist/{provider-C55OGXJ7.js → provider-CY4TSSJo.js} +2 -2
- package/dist/{provider-DfLeek9O.d.ts → provider-CjAu39fJ.d.ts} +1 -1
- package/dist/{provider-store-CaTv00tr.js → provider-store-BQP_pp8s.js} +2 -2
- package/dist/pull-CUVdB04v.js +1 -0
- package/dist/{pull-BBmCxnqX.js → pull-DVoZ0V9_.js} +6 -6
- package/dist/{push-Dq_ca4-j.js → push-eJl1Tvqm.js} +7 -7
- package/dist/{pushed-policy-CryQheKq.d.ts → pushed-policy-CUQuvlS3.d.ts} +1 -1
- package/dist/{pushed-policy-CDuOL2de.js → pushed-policy-DMXAOmEW.js} +1 -1
- package/dist/react/index.d.ts +8 -8
- package/dist/react/index.js +6 -6
- package/dist/react/provider-client.d.ts +1 -1
- package/dist/react/provider-client.js +1 -1
- package/dist/react-native/index.d.ts +10 -10
- package/dist/react-native/index.js +9 -9
- package/dist/refresh-on-L9UOwATg.d.ts +49 -0
- package/dist/{replay-Bs9Df2fQ.d.ts → replay-Dc3d8LhG.d.ts} +1 -1
- package/dist/{request-context-Duzdf0cd.js → request-context-Ch052blg.js} +2 -2
- package/dist/{request-schema-DhX7UbfQ.js → request-schema-CMP8Cmxd.js} +5 -0
- package/dist/resend/index.d.ts +4 -4
- package/dist/{resolve-names-Y1Cb22cp.js → resolve-names-1nCei24V.js} +6 -6
- package/dist/{rls-yK2nZUcm.js → rls-BVzoZCn3.js} +4 -4
- package/dist/{rls-BwKXdVEW.js → rls-ClJRblnR.js} +19 -19
- package/dist/{role-builder-BK2-T6oD.js → role-builder-BrmOcXch.js} +3 -157
- package/dist/{rpc-vHIwyXCp.js → rpc-BOu3FD6X.js} +2 -2
- package/dist/{run-D5WIJfs7.js → run-CnCaTjWX.js} +8 -40
- package/dist/run-D9N6V5WQ.js +1 -0
- package/dist/{run-ticket-ylovhyFQ.d.ts → run-ticket-C6lXvHM_.d.ts} +2 -2
- package/dist/{run-ticket-DfnZCh-u.js → run-ticket-CjvXr6wj.js} +1 -1
- package/dist/{runtime-BGnrOkVH.js → runtime-CBXkOcg9.js} +1 -1
- package/dist/{saas-DK4V-3Is.js → saas-BqM9mJkk.js} +13 -10
- package/dist/{scan-CzdMtHnq.js → scan-CepUXrFt.js} +1 -1
- package/dist/{schema-BDGEVO4g.js → schema-9_NDz8fx.js} +1 -1
- package/dist/{schema-BOJjqlWL.js → schema-CuX70xgH.js} +15 -2
- package/dist/scim/index.d.ts +1 -1
- package/dist/scim/index.js +1 -1
- package/dist/{scim-jJBJ7g1Z.js → scim-C30QBBoF.js} +2 -1
- package/dist/{scim-D8YupzX1.js → scim-CovliQUg.js} +2 -2
- package/dist/{scopes-0Up_UA2t.js → scopes-BSdYaGHs.js} +9 -40
- package/dist/server/index.d.ts +11 -11
- package/dist/server/index.js +8 -8
- package/dist/{server-3cVlTLde.js → server-D0PW6ZCw.js} +2 -2
- package/dist/{server-types-CyRN0-Cd.d.ts → server-types-Bw-lWqzR.d.ts} +8 -8
- package/dist/{shared-l0oGGetg.js → shared-BRmCJxDK.js} +2 -2
- package/dist/{shared-DrGLwM3s.js → shared-DyYVEjKC.js} +2 -2
- package/dist/{sink-B5zoUW_O.d.ts → sink-DUzt0e4B.d.ts} +2 -2
- package/dist/{skills-BZxPQ_09.js → skills-BUuH-QFt.js} +2 -2
- package/dist/{skills-BIsm1n26.js → skills-a4N6Y2Xm.js} +2 -2
- package/dist/{snapshot-CXlzi69u.js → snapshot-DN_8J27z.js} +6 -2
- package/dist/{snapshot-cache-Bx_4xC_6.js → snapshot-cache-B66h7FBK.js} +25 -8
- package/dist/{snapshot-cache-BjAWkchD.d.ts → snapshot-cache-Dbk-Gnij.d.ts} +20 -6
- package/dist/solid/index.d.ts +7 -7
- package/dist/solid/index.js +6 -6
- package/dist/solid-start/index.d.ts +4 -4
- package/dist/solid-start/index.js +3 -3
- package/dist/{sources-oB1Hg1Fm.d.ts → sources-CXY05xtB.d.ts} +1 -1
- package/dist/{src-C_pi2Rnh.js → src-nYNBfmgq.js} +187 -39
- package/dist/ssf/index.d.ts +3 -3
- package/dist/ssf/index.js +1 -1
- package/dist/{standard-webhooks-DOYEuOLx.d.ts → standard-webhooks-BFeEpjxy.d.ts} +2 -2
- package/dist/{store-RNFvaJJv.js → store-XgBMbfDy.js} +13 -7
- package/dist/{types-tQB2CEnY.d.ts → store-g5ctUrOI.d.ts} +114 -113
- package/dist/{store-options-Dil3lraY.js → store-options--zWn48PK.js} +76 -7
- package/dist/{stores-DxZWDXCs.js → stores-53_kOwPi.js} +3 -3
- package/dist/{stores-DZJvxFIZ.d.ts → stores-BtdN3eDO.d.ts} +5 -6
- package/dist/{stream-9y9qw51m.d.ts → stream-BMJg56jU.d.ts} +1 -1
- package/dist/{subject-BGoM5o8B.js → subject-C7RddW0G.js} +8 -1
- package/dist/supabase/client.d.ts +31 -0
- package/dist/supabase/client.js +21 -0
- package/dist/supabase/index.d.ts +37 -6
- package/dist/supabase/index.js +5 -4
- package/dist/supabase/middleware.d.ts +8 -7
- package/dist/supabase/middleware.js +6 -6
- package/dist/{supabase-DYWnT800.js → supabase-C6FyUeSh.js} +3 -3
- package/dist/{supabase-CDHMsDD0.js → supabase-C8cNzp4i.js} +31 -8
- package/dist/supabase-hook-CPBX4dy5.js +1 -0
- package/dist/{supabase-hook-HPgwYb9V.js → supabase-hook-Cj85nccs.js} +167 -21
- package/dist/{supautils-CGk4YpvC.js → supautils-BP_5WAIc.js} +20 -18
- package/dist/svelte/index.d.ts +7 -7
- package/dist/svelte/index.js +8 -8
- package/dist/svelte/runtime.d.ts +3 -3
- package/dist/svelte/runtime.js +3 -3
- package/dist/svelte/source.d.ts +7 -7
- package/dist/svelte/source.js +5 -5
- package/dist/sveltekit/index.d.ts +4 -4
- package/dist/sveltekit/index.js +2 -2
- package/dist/{tables-DimBcVWY.js → tables-BsGE6HBR.js} +7 -7
- package/dist/tanstack-start/index.d.ts +4 -4
- package/dist/tanstack-start/index.js +2 -2
- package/dist/{tenancy-5d1zVBvK.js → tenancy-DvOHHk3-.js} +1 -1
- package/dist/terminal/index.d.ts +5 -5
- package/dist/terminal/index.js +6 -6
- package/dist/testing/core.d.ts +1 -1
- package/dist/testing/core.js +1 -1
- package/dist/testing/fixtures/index.d.ts +1 -1
- package/dist/testing/fixtures/index.js +1 -1
- package/dist/testing/index.d.ts +29 -22
- package/dist/testing/index.js +118 -46
- 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/token-D6pWn8Uj.d.ts +11 -0
- package/dist/{token-DC9EQiet.js → token-DaMnIU9O.js} +24 -8
- package/dist/{tool-refusal-Qpjs_W6M.js → tool-refusal-C1UlhU0V.js} +1 -1
- package/dist/trpc/index.d.ts +5 -5
- package/dist/trpc/index.js +3 -3
- package/dist/{type-helpers-c7Xo_2Cu.d.ts → type-helpers-C_OnZW8c.d.ts} +1 -1
- package/dist/{types-B2efzoSX.d.ts → types-AOP5HQku.d.ts} +1 -1
- package/dist/{types-DlelvQk4.d.ts → types-B3BOcI0J.d.ts} +2 -2
- package/dist/{types-DLvhVm1r.d.ts → types-BvBbkAu1.d.ts} +16 -7
- package/dist/{types-BB-zWDcR.d.ts → types-CA-A33Q5.d.ts} +5 -5
- package/dist/{types-Cklw5hJo.d.ts → types-CAAN7evk.d.ts} +24 -1
- package/dist/{types-DsHGPtkR.d.ts → types-CJC1aaoJ.d.ts} +2 -2
- package/dist/{types-CWBsAwqn.d.ts → types-D29K5ZNP.d.ts} +4 -4
- package/dist/{types-CEinc15V.d.ts → types-DVZNTkU0.d.ts} +3 -4
- package/dist/{types-ZzRGoViD.d.ts → types-NYoj8JBm.d.ts} +2 -2
- package/dist/{types-B6ExllNo.d.ts → types-Sj1U8HMm.d.ts} +2 -2
- package/dist/{types-CN0LsqbK.d.ts → types-UfpcY575.d.ts} +3 -3
- package/dist/{types-rCRV4Ge-.d.ts → types-e82uzrTn.d.ts} +4 -4
- package/dist/unplugin/index.d.ts +1 -1
- package/dist/unplugin/index.js +2 -2
- package/dist/{usage-e6M1Mls1.js → usage-COsGLht5.js} +6 -6
- package/dist/{usage-DBNrpwoT.js → usage-CqcMeQgX.js} +2 -2
- package/dist/usage-D1cpHO7p.js +1 -0
- package/dist/{validation-error-uvp-kyfO.d.ts → validation-error-DpvsBwZJ.d.ts} +1 -1
- package/dist/{verify-CgIpJRcG.js → verify-C8G8D5mk.js} +19 -19
- package/dist/{version-cache-Df11C2Qp.d.ts → version-cache-9Vq5QVFC.d.ts} +9 -3
- package/dist/{views-CD8wuL4Z.js → views-TrZYlDnM.js} +1 -1
- package/dist/vue/index.d.ts +7 -7
- package/dist/vue/index.js +6 -6
- package/dist/{waiter-CqUKX6CY.d.ts → waiter-C2cXXLFZ.d.ts} +2 -2
- package/dist/{watch-DAkjm75Y.js → watch-DXRDBSCu.js} +3 -3
- package/dist/watch-DnymTAfe.js +1 -0
- package/dist/webmcp/index.d.ts +1 -1
- package/dist/webmcp/index.js +1 -1
- package/dist/{where-scope-DlCdCM_8.js → where-scope-BKrqUDVk.js} +5 -5
- package/dist/{who-can-BoDJm0Nc.js → who-can-BY5d3HPw.js} +4 -4
- package/dist/workflow/index.d.ts +3 -3
- package/dist/workflow/index.js +5 -4
- package/dist/workflow-sdk/index.d.ts +4 -4
- package/dist/{wrap-B2wziJI_.js → wrap-C5PWzgkq.js} +1 -1
- package/dist/{wrap-DxXB54Wu.d.ts → wrap-DpZAbxuD.d.ts} +2 -2
- package/package.json +8 -5
- package/schemas/approval-request-v1.json +5 -0
- package/schemas/catalog-v1.json +18 -2
- package/schemas/cli-result-v1.json +0 -2
- package/schemas/snapshot-v1.json +9 -0
- package/skills/permdock-approvals/SKILL.md +8 -8
- package/skills/permdock-approvals/references/stores-and-resume.md +7 -3
- package/skills/permdock-audit/SKILL.md +1 -1
- package/skills/permdock-data/references/queries-and-rls.md +1 -1
- package/dist/action-result-BcudBQOF.d.ts +0 -19
- package/dist/catalog-D3oS2GH3.js +0 -1
- package/dist/collect-D-eroIfV.js +0 -1
- package/dist/load-Dm0pSYH3.js +0 -1
- package/dist/output-files-BHOIlrfD.js +0 -1
- package/dist/powersync-CnGzxvEl.js +0 -1
- package/dist/pull-D6dloyrc.js +0 -1
- package/dist/renames-CGj7YwcQ.js +0 -175
- package/dist/run-DlQYPtPv.js +0 -1
- package/dist/supabase-hook-qsewAVZY.js +0 -1
- package/dist/usage-D3KJyaNS.js +0 -1
- package/dist/watch-CuPz0D2M.js +0 -1
|
@@ -1,17 +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 {
|
|
3
|
+
import { l as normalizeWhere } from "./role-builder-BrmOcXch.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
|
-
import { n as defineScopes } from "./scopes-
|
|
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-4KxMRdJC.js";
|
|
8
9
|
import { r as readWireValidity } from "./validity-Buc7w8E9.js";
|
|
9
|
-
import { a as indexPolicy, f as normalizeDelegation } from "./policy-
|
|
10
|
-
import { o as isPortableCondition } from "./hosted-
|
|
10
|
+
import { a as indexPolicy, f as normalizeDelegation } from "./policy-DxQyHKPB.js";
|
|
11
|
+
import { o as isPortableCondition } from "./hosted-tPZnyjQS.js";
|
|
11
12
|
import { t as definePermissions } from "./permissions-CVXmRILq.js";
|
|
12
13
|
import { n as copyJson, t as checkSchema } from "./json-schema-BPGa-RjQ.js";
|
|
13
|
-
import { t as parseCatalog } from "./parse-
|
|
14
|
-
import { n as parsePushedPolicy } from "./pushed-policy-
|
|
14
|
+
import { t as parseCatalog } from "./parse-UTC-sDrt.js";
|
|
15
|
+
import { n as parsePushedPolicy } from "./pushed-policy-DMXAOmEW.js";
|
|
15
16
|
//#region src/catalog/json-schema-validator.ts
|
|
16
17
|
const ANNOTATIONS = /* @__PURE__ */ new Set([
|
|
17
18
|
"$schema",
|
|
@@ -292,7 +293,7 @@ function buildGrant(tree, raw) {
|
|
|
292
293
|
role: raw.role,
|
|
293
294
|
where,
|
|
294
295
|
check: condition(raw.check, `grant '${raw.permission}' check`, raw.portable !== false),
|
|
295
|
-
approval: raw.approval,
|
|
296
|
+
approval: readWireApproval(raw.approval),
|
|
296
297
|
portable: raw.portable !== false,
|
|
297
298
|
limit: raw.limit,
|
|
298
299
|
fields: raw.fields,
|
|
@@ -193,7 +193,7 @@ type ActorKind = OpenUnion<"mcp-client" | "oauth-client" | "support" | "imperson
|
|
|
193
193
|
* The adapter a decision event names: a PermDock entry, or an integrator's own
|
|
194
194
|
* adapter.
|
|
195
195
|
*/
|
|
196
|
-
type AdapterId = OpenUnion<"server" | "next" | "hono" | "express" | "fastify" | "elysia" | "nest" | "node" | "h3" | "sveltekit" | "astro" | "solid-start" | "tanstack-start" | "trpc" | "orpc" | "supabase-middleware" | "convex" | "authzen" | "mcp" | "a2a" | "agent" | "ai-sdk" | "claude-agent" | "openai" | "eve" | "terminal" | "webmcp" | "workflow" | "chat" | "delivery">;
|
|
196
|
+
type AdapterId = OpenUnion<"server" | "next" | "hono" | "express" | "fastify" | "elysia" | "nest" | "node" | "h3" | "sveltekit" | "astro" | "solid-start" | "tanstack-start" | "trpc" | "orpc" | "supabase-middleware" | "better-supabase" | "convex" | "authzen" | "mcp" | "a2a" | "agent" | "ai-sdk" | "claude-agent" | "openai" | "eve" | "terminal" | "webmcp" | "workflow" | "chat" | "delivery">;
|
|
197
197
|
/**
|
|
198
198
|
* How a membership was obtained (`membership.via`); `viaOnly` and support rules
|
|
199
199
|
* match it by equality.
|
|
@@ -289,10 +289,6 @@ type Membership = {
|
|
|
289
289
|
* conditions or RLS, and never written into token claims.
|
|
290
290
|
*/
|
|
291
291
|
readonly x?: AppData;
|
|
292
|
-
/** Input only: an instance of the first scope. */
|
|
293
|
-
readonly tenant?: string;
|
|
294
|
-
/** Input only: an instance of the second scope, inside `tenant`. */
|
|
295
|
-
readonly team?: string;
|
|
296
292
|
};
|
|
297
293
|
/**
|
|
298
294
|
* One permission a custom role adds or removes. It names a declared permission
|
|
@@ -595,6 +591,11 @@ type ApprovalRequiredDecision = {
|
|
|
595
591
|
readonly grant: MatchedGrant;
|
|
596
592
|
readonly reason: "human";
|
|
597
593
|
readonly token: string;
|
|
594
|
+
/**
|
|
595
|
+
* The `fingerprint` the call passed, bound into `token`; the request it opens
|
|
596
|
+
* records it, and a resume under another fingerprint is refused.
|
|
597
|
+
*/
|
|
598
|
+
readonly fingerprint?: string;
|
|
598
599
|
/** Present only with `explain: true`. */
|
|
599
600
|
readonly trace?: Trace;
|
|
600
601
|
};
|
|
@@ -690,6 +691,16 @@ type PermissionApprover = {
|
|
|
690
691
|
readonly kind: "permission";
|
|
691
692
|
readonly permission: string;
|
|
692
693
|
};
|
|
694
|
+
/**
|
|
695
|
+
* The requester's manager, or anyone up the chain within `levels` (default 1),
|
|
696
|
+
* read from the `manager` relation on the requester's `user` record. Checked
|
|
697
|
+
* only through verdict facts (`ApprovalVerdict.relations`) that the handler
|
|
698
|
+
* reads from its `RelationSource`.
|
|
699
|
+
*/
|
|
700
|
+
type ManagerApprover = {
|
|
701
|
+
readonly kind: "manager";
|
|
702
|
+
readonly levels?: number;
|
|
703
|
+
};
|
|
693
704
|
/**
|
|
694
705
|
* An approver who matches at least one item; an item that is a list matches
|
|
695
706
|
* when every entry does.
|
|
@@ -701,11 +712,11 @@ type AnyOfApprover = {
|
|
|
701
712
|
/**
|
|
702
713
|
* Who may approve: a subject-only grantee, a `relation()` the approver holds on
|
|
703
714
|
* the requested row (checked when the verdict is given), `user(id)`,
|
|
704
|
-
* `holder(permission)`, or `anyOf(...)`. A list (or `allOf(...)`)
|
|
705
|
-
* approver who satisfies every item.
|
|
715
|
+
* `holder(permission)`, `manager()`, or `anyOf(...)`. A list (or `allOf(...)`)
|
|
716
|
+
* matches an approver who satisfies every item.
|
|
706
717
|
*/
|
|
707
|
-
type Approver = Grantee | UserApprover | PermissionApprover | AnyOfApprover;
|
|
708
|
-
type ApproverInput = GranteeInput | UserApprover | PermissionApprover | {
|
|
718
|
+
type Approver = Grantee | UserApprover | PermissionApprover | ManagerApprover | AnyOfApprover;
|
|
719
|
+
type ApproverInput = GranteeInput | UserApprover | PermissionApprover | ManagerApprover | {
|
|
709
720
|
readonly kind: "any-of";
|
|
710
721
|
readonly of: readonly ApproverInput[];
|
|
711
722
|
} | readonly ApproverInput[];
|
|
@@ -723,6 +734,13 @@ declare function anyOf(...items: readonly ApproverInput[]): {
|
|
|
723
734
|
declare function allOf(...items: readonly ApproverInput[]): readonly ApproverInput[];
|
|
724
735
|
/** A named approver for `approval.by`, matched on the approver's principal id. */
|
|
725
736
|
declare function user(id: string): UserApprover;
|
|
737
|
+
/**
|
|
738
|
+
* Approves when the approver manages the requester, directly or within `levels`
|
|
739
|
+
* steps up the chain (1 to `MAX_MANAGER_LEVELS`, default 1).
|
|
740
|
+
*/
|
|
741
|
+
declare function manager(options?: {
|
|
742
|
+
readonly levels?: number;
|
|
743
|
+
}): ManagerApprover;
|
|
726
744
|
//#endregion
|
|
727
745
|
//#region src/core/scopes.d.ts
|
|
728
746
|
/**
|
|
@@ -1183,6 +1201,13 @@ type Snapshot = {
|
|
|
1183
1201
|
* still cover.
|
|
1184
1202
|
*/
|
|
1185
1203
|
readonly delegated?: readonly string[];
|
|
1204
|
+
/**
|
|
1205
|
+
* The token's authorization version (`authz_ver`) the snapshot was built
|
|
1206
|
+
* from. A client compares it with the version in a refresh signal.
|
|
1207
|
+
*/
|
|
1208
|
+
readonly authzVersion?: number;
|
|
1209
|
+
/** The Auth session (`session_id`) the snapshot was built for. */
|
|
1210
|
+
readonly sessionId?: string;
|
|
1186
1211
|
};
|
|
1187
1212
|
/**
|
|
1188
1213
|
* A grant the subject would hold on another plan: its permission, role and
|
|
@@ -1721,6 +1746,16 @@ type DecisionProvider = {
|
|
|
1721
1746
|
* query and no answer outlives the instance.
|
|
1722
1747
|
*/
|
|
1723
1748
|
type SourceMemo = <T>(key: string, read: () => T) => T;
|
|
1749
|
+
/**
|
|
1750
|
+
* One read a source made, for an `onSourceCall` hook: `cached` is `true` when
|
|
1751
|
+
* the instance's `SourceMemo` answered it without a query.
|
|
1752
|
+
*/
|
|
1753
|
+
type SourceCall = {
|
|
1754
|
+
readonly source: string;
|
|
1755
|
+
readonly method: string;
|
|
1756
|
+
readonly durationMs: number;
|
|
1757
|
+
readonly cached: boolean;
|
|
1758
|
+
};
|
|
1724
1759
|
/** What `getPermDock` passes to every source call besides its query. */
|
|
1725
1760
|
type SourceContext = {
|
|
1726
1761
|
/** Absent when the source is called outside `getPermDock`. */
|
|
@@ -2089,16 +2124,22 @@ type ApprovalStage = {
|
|
|
2089
2124
|
* order. `'sequential'`: stages complete in order; an approver signs only the
|
|
2090
2125
|
* first incomplete stage. An approver signs once per request.
|
|
2091
2126
|
*/
|
|
2092
|
-
type
|
|
2127
|
+
type ApprovalCombine = "any" | "all" | "sequential";
|
|
2128
|
+
/**
|
|
2129
|
+
* `'authorize'` (the default): someone other than the request's principal
|
|
2130
|
+
* approves. `'confirm'`: the principal may approve their own request. Neither
|
|
2131
|
+
* is met by an approver acting through an agent or a delegated token.
|
|
2132
|
+
*/
|
|
2133
|
+
type ApprovalMode = "confirm" | "authorize";
|
|
2093
2134
|
type ApprovalRequirement = {
|
|
2094
|
-
/** Set when `
|
|
2135
|
+
/** Set when `combine` is `'any'` (the default); absent under `stages`. */
|
|
2095
2136
|
readonly by?: Approver | readonly Approver[];
|
|
2096
2137
|
/** Absent means `'any'`. */
|
|
2097
|
-
readonly
|
|
2098
|
-
/** Set when `
|
|
2138
|
+
readonly combine?: ApprovalCombine;
|
|
2139
|
+
/** Set when `combine` is `'all'` or `'sequential'`. */
|
|
2099
2140
|
readonly stages?: readonly ApprovalStage[];
|
|
2100
|
-
/**
|
|
2101
|
-
readonly
|
|
2141
|
+
/** Absent means `'authorize'`. */
|
|
2142
|
+
readonly mode?: ApprovalMode;
|
|
2102
2143
|
/** `'resource-change'` binds the approval to the row's `version` field. */
|
|
2103
2144
|
readonly staleOn?: "resource-change";
|
|
2104
2145
|
/**
|
|
@@ -2119,7 +2160,7 @@ type ApprovalOption = "human" | {
|
|
|
2119
2160
|
* `'all'` or `'sequential'` with `stages`; absent means `'any'` with
|
|
2120
2161
|
* `by`.
|
|
2121
2162
|
*/
|
|
2122
|
-
readonly
|
|
2163
|
+
readonly combine?: ApprovalCombine;
|
|
2123
2164
|
readonly stages?: readonly {
|
|
2124
2165
|
readonly by: ApproverInput;
|
|
2125
2166
|
readonly quorum?: number;
|
|
@@ -2129,8 +2170,11 @@ type ApprovalOption = "human" | {
|
|
|
2129
2170
|
readonly to: ApproverInput;
|
|
2130
2171
|
};
|
|
2131
2172
|
}[];
|
|
2132
|
-
/**
|
|
2133
|
-
|
|
2173
|
+
/**
|
|
2174
|
+
* `'confirm'` lets the request's principal approve it; absent means
|
|
2175
|
+
* `'authorize'`.
|
|
2176
|
+
*/
|
|
2177
|
+
readonly mode?: ApprovalMode;
|
|
2134
2178
|
/**
|
|
2135
2179
|
* `'resource-change'`: the approval covers the row as it was when it was
|
|
2136
2180
|
* requested. The resource must declare `version`; once that field
|
|
@@ -2676,4 +2720,4 @@ type SubjectOf<P> = {
|
|
|
2676
2720
|
readonly expiresAt?: number;
|
|
2677
2721
|
};
|
|
2678
2722
|
//#endregion
|
|
2679
|
-
export {
|
|
2723
|
+
export { LimitConsumeInput as $, GrantedDecision as $n, Snapshot as $t, PolicyOptions as A, anyOf as An, RelatedCondition as Ar, ApiKeyPrincipal as At, SupportConsent as B, assurance as Bn, credentialDelegation as Bt, HostedGrantRef as C, AnyOfApprover as Cn, MembershipVia as Cr, DecideSupportSessionOptions as Ct, PolicyAppDataSchemas as D, PermissionApprover as Dn, MemberOfCondition as Dr, SupportSessionRequest as Dt, Policy as E, ManagerApprover as En, ConditionValue as Er, SupportSessionPolicy as Et, RoleOptions as F, GranteeInput as Fn, hasConditionOp as Fr, CredentialPermissionInput as Ft, CustomRoleContext as G, AppObligation as Gn, InstanceHandle as Gt, VocabularyFromInput as H, inherit as Hn, decideCredential as Ht, RoleScope as I, InheritGrantee as In, isCondition as Ir, CredentialPolicy as It, DecisionProvider as J, Denial as Jn, LocalMembershipRows as Jt, CustomRoleSource as K, ApprovalRequiredDecision as Kn, Instant as Kt, SeparationConflict as L, RelationGrantee as Ln, isConditionDate as Lr, CredentialPolicyViolation as Lt, PolicyVocabulary as M, manager as Mn, RestrictedAncestors as Mr, CredentialDecision as Mt, PrincipalOf as N, user as Nn, SqlFunctionArg as Nr, CredentialKind as Nt, PolicyDelegation as O, UserApprover as On, MemberOfParent as Or, decideSupportSession as Ot, RoleBinding as P, Grantee as Pn, SqlFunctionCondition as Pr, CredentialPermission as Pt, JwtClaims as Q, ExplainedDecision as Qn, LocalSnapshotRows as Qt, SubjectOf as R, actor as Rn, isConditionRef as Rr, CredentialRequest as Rt, GrantValidity as S, ScopeNames as Sn, AdapterId as Sr, WhereCompiler as St, ObligationInput as T, ApproverInput as Tn, ConditionRef as Tr, SupportSessionDecision as Tt, WireValidity as U, plan as Un, isFeedId as Ut, ValidateMode as V, authenticated as Vn, credentialPolicyViolation as Vt, CredentialVerifier as W, relation as Wn, parseCredential as Wt, EntitlementSource as X, DenialReason as Xn, LocalRowValue as Xt, DecisionSink as Y, DenialDetails as Yn, LocalRowColumn as Yt, Intent as Z, DeniedDecision as Zn, LocalSnapshotManifest as Zt, GrantCondition as _, WireDenial as _n, Principal as _r, TokenVerifier as _t, ApprovalOption as a, AuthEvent as an, TraceSkip as ar, RelationGroup as at, GrantOptions as b, Scope as bn, VerifiedClaims as br, VersionContext as bt, AssuranceRequirement as c, DecisionEvent as cn, Assurance as cr, SettingsSource as ct, BreakGlassSpec as d, DeliveryFailureCause as dn, CustomRole as dr, SourceContext as dt, SnapshotAssignable as en, LimitDetail as er, LimitRemaining as et, ClosureContext as f, DirectoryEvent as fn, CustomRoleGrant as fr, SourceMemo as ft, Grant as g, WireDecision as gn, Membership as gr, TokenSigner as gt, DelegationTarget as h, SinkEvent as hn, JsonWebKeyLike as hr, TokenFailureCause as ht, ApprovalMode as i, AccessEvent as in, Trace as ir, RelationChain as it, PolicyScopes as j, holder as jn, RelatedHop as jr, Credential as jt, PolicyOAuthScope as k, allOf as kn, OpaqueCondition as kr, parseSupportSession as kt, BreakGlassOptions as l, DeliveryChannel as ln, AuthorizationDetail as lr, SnapshotSource as lt, DelegationInput as m, MembershipEvent as mn, GnapAccess as mr, TenantSettings as mt, ApprovalCombine as n, SnapshotNotEntitled as nn, Obligation as nr, MemberEntry as nt, ApprovalRequirement as o, AutomationEvent as on, TraceSkipReason as or, RelationHolder as ot, ClosureGrantFn as p, EmailCategory as pn, Delegation as pr, SubjectResolver as pt, CustomRoleSourceFactory as q, Decision as qn, LocalCustomRoleTable as qt, ApprovalEscalation as r, SnapshotScope as rn, Quota as rr, MembershipSource as rt, ApprovalStage as s, CredentialEvent as sn, Actor as sr, RelationSource as st, ActivationOption as t, SnapshotGrant as tn, MatchedGrant as tr, LimitStore as tt, BreakGlassRequirements as u, DeliveryEvent as un, Binding as ur, SourceCall as ut, GrantLimit as v, WireDelegation as vn, SharedCustomRole as vr, VerificationFailure as vt, MembershipFixture as w, Approver as wn, Condition as wr, SupportSession as wt, GrantScope as x, ScopeDeclaration as xn, ActorKind as xr, VersionQuery as xt, GrantMeta as y, PolicyScopesInput as yn, Subject as yr, VerifiedToken as yt, SupportAccessOptions as z, anyone as zn, isSqlFunctionField as zr, DecideCredentialOptions as zt };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
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-IRJVABmm.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
|
|
@@ -57,6 +57,11 @@ type PostgrestSourcesOptions = {
|
|
|
57
57
|
* token claims a custom role, which the custom roles need anyway.
|
|
58
58
|
*/
|
|
59
59
|
readonly policy?: Policy;
|
|
60
|
+
/**
|
|
61
|
+
* Called after every function read with its duration and whether the
|
|
62
|
+
* instance's memo answered it. A hook that throws is ignored.
|
|
63
|
+
*/
|
|
64
|
+
readonly onSourceCall?: (call: SourceCall) => void;
|
|
60
65
|
};
|
|
61
66
|
/** One user as `subject_for(p_user)` returns it. */
|
|
62
67
|
type SubjectRecord = {
|
|
@@ -119,12 +124,12 @@ declare function readSubjectRecord(value: unknown): SubjectRecord | undefined;
|
|
|
119
124
|
* `permdock supabase hook generate` writes, for a backend that reaches Postgres
|
|
120
125
|
* only through PostgREST. `memberships.version` reads only the version, so
|
|
121
126
|
* `claimsFirst` with `onStale: 'reread'` reads the full subject only for a
|
|
122
|
-
* stale token;
|
|
123
|
-
*
|
|
124
|
-
*
|
|
125
|
-
*
|
|
126
|
-
*
|
|
127
|
-
*
|
|
127
|
+
* stale token; a missing version function throws, and `permdock doctor` PD083
|
|
128
|
+
* reports it. With `policy`, a token that claims a custom role has its subject
|
|
129
|
+
* read in one `subject_for` call instead, and custom roles are read only for a
|
|
130
|
+
* subject that holds one. It keeps no answers: create it once at module scope,
|
|
131
|
+
* and `getPermDock` shares each read within one instance. Pass `claimsFirst(…,
|
|
132
|
+
* { versions })` to share version reads across instances.
|
|
128
133
|
*/
|
|
129
134
|
declare function postgrestSources(client: SupabaseRpcCaller, options?: PostgrestSourcesOptions): PostgrestSources;
|
|
130
135
|
//#endregion
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { r as isRecord, t as compact } from "./compact-CAf557ZB.js";
|
|
2
2
|
import { n as freezeDeep } from "./freeze-jjan0lCv.js";
|
|
3
3
|
import { r as validateRecord } from "./thenable-BNSM1U2R.js";
|
|
4
|
-
import {
|
|
4
|
+
import { f as nowMillis } from "./time-nR1JesoH.js";
|
|
5
|
+
import { t as anonymousSubject } from "./subject-C7RddW0G.js";
|
|
5
6
|
import { t as readClaim } from "./claims-map-CKkoAAYF.js";
|
|
6
7
|
import { t as clientNameOf } from "./clients-DYr3U86j.js";
|
|
7
|
-
import "./budget-
|
|
8
|
+
import "./budget-BBCPDOGP.js";
|
|
8
9
|
import { a as hookApiNames } from "./sources-C4vkzZJV.js";
|
|
9
10
|
//#region src/supabase/subject.ts
|
|
10
11
|
const REGISTERED = /* @__PURE__ */ new Set([
|
|
@@ -79,14 +80,12 @@ function asMembership(item) {
|
|
|
79
80
|
const scope = typeof item["scope"] === "string" ? item["scope"] : void 0;
|
|
80
81
|
const id = typeof item["id"] === "string" ? item["id"] : void 0;
|
|
81
82
|
const within = isRecord(item["within"]) ? Object.fromEntries(Object.entries(item["within"]).filter((entry) => typeof entry[1] === "string")) : void 0;
|
|
82
|
-
const tenant = typeof item["tenant"] === "string" ? item["tenant"] : void 0;
|
|
83
|
-
const team = typeof item["team"] === "string" ? item["team"] : void 0;
|
|
84
83
|
const onRecord = isRecord(item["on"]) ? item["on"] : void 0;
|
|
85
84
|
const on = onRecord !== void 0 && typeof onRecord["resource"] === "string" && typeof onRecord["id"] === "string" ? {
|
|
86
85
|
resource: onRecord["resource"],
|
|
87
86
|
id: onRecord["id"]
|
|
88
87
|
} : void 0;
|
|
89
|
-
if ((scope === void 0 || id === void 0) &&
|
|
88
|
+
if ((scope === void 0 || id === void 0) && on === void 0) return;
|
|
90
89
|
const keep = item["keep"];
|
|
91
90
|
if (keep !== void 0 && (!Array.isArray(keep) || !keep.every((key) => typeof key === "string" && key !== ""))) return;
|
|
92
91
|
return compact({
|
|
@@ -94,8 +93,6 @@ function asMembership(item) {
|
|
|
94
93
|
scope,
|
|
95
94
|
id,
|
|
96
95
|
within,
|
|
97
|
-
tenant,
|
|
98
|
-
team,
|
|
99
96
|
on,
|
|
100
97
|
via: typeof item["via"] === "string" ? item["via"] : void 0,
|
|
101
98
|
expiresAt: typeof item["expires_at"] === "number" ? item["expires_at"] : void 0,
|
|
@@ -487,8 +484,41 @@ function readSubjectRecord(value) {
|
|
|
487
484
|
claims: isRecord(value["claims"]) && Object.keys(value["claims"]).length > 0 ? value["claims"] : void 0
|
|
488
485
|
});
|
|
489
486
|
}
|
|
490
|
-
|
|
491
|
-
|
|
487
|
+
/**
|
|
488
|
+
* Uncached version reads of one principal closer together than this count as
|
|
489
|
+
* one request reading the version more than once.
|
|
490
|
+
*/
|
|
491
|
+
const REPEAT_WINDOW_MS = 1e3;
|
|
492
|
+
const REPEAT_TRACKED = 1e3;
|
|
493
|
+
/** Read through `globalThis` so the entry loads on runtimes without `process`. */
|
|
494
|
+
function isDevelopment() {
|
|
495
|
+
const proc = Reflect.get(globalThis, "process");
|
|
496
|
+
if (typeof proc !== "object" || proc === null) return false;
|
|
497
|
+
const env = Reflect.get(proc, "env");
|
|
498
|
+
return typeof env === "object" && env !== null && Reflect.get(env, "NODE_ENV") === "development";
|
|
499
|
+
}
|
|
500
|
+
/**
|
|
501
|
+
* In development, warns once when one principal's version is read twice within
|
|
502
|
+
* `REPEAT_WINDOW_MS`: a request that builds its instance more than once instead
|
|
503
|
+
* of sharing it through `instanceCache` or `permdockFor`.
|
|
504
|
+
*/
|
|
505
|
+
function repeatedVersionReads() {
|
|
506
|
+
if (!isDevelopment()) return () => void 0;
|
|
507
|
+
const last = /* @__PURE__ */ new Map();
|
|
508
|
+
let warned = false;
|
|
509
|
+
return (userId) => {
|
|
510
|
+
if (warned) return;
|
|
511
|
+
const at = nowMillis();
|
|
512
|
+
const previous = last.get(userId);
|
|
513
|
+
if (previous !== void 0 && at - previous < REPEAT_WINDOW_MS) {
|
|
514
|
+
warned = true;
|
|
515
|
+
last.clear();
|
|
516
|
+
console.warn("PermDock: the authorization version of one user was read more than once within a second. Share one instance per request through instanceCache and permdockFor, or pass version: { known }.");
|
|
517
|
+
return;
|
|
518
|
+
}
|
|
519
|
+
if (last.size >= REPEAT_TRACKED) last.clear();
|
|
520
|
+
last.set(userId, at);
|
|
521
|
+
};
|
|
492
522
|
}
|
|
493
523
|
/**
|
|
494
524
|
* Membership, custom-role and subject sources over the `subject_for(p_user)`,
|
|
@@ -496,12 +526,12 @@ function once(memo, key, read) {
|
|
|
496
526
|
* `permdock supabase hook generate` writes, for a backend that reaches Postgres
|
|
497
527
|
* only through PostgREST. `memberships.version` reads only the version, so
|
|
498
528
|
* `claimsFirst` with `onStale: 'reread'` reads the full subject only for a
|
|
499
|
-
* stale token;
|
|
500
|
-
*
|
|
501
|
-
*
|
|
502
|
-
*
|
|
503
|
-
*
|
|
504
|
-
*
|
|
529
|
+
* stale token; a missing version function throws, and `permdock doctor` PD083
|
|
530
|
+
* reports it. With `policy`, a token that claims a custom role has its subject
|
|
531
|
+
* read in one `subject_for` call instead, and custom roles are read only for a
|
|
532
|
+
* subject that holds one. It keeps no answers: create it once at module scope,
|
|
533
|
+
* and `getPermDock` shares each read within one instance. Pass `claimsFirst(…,
|
|
534
|
+
* { versions })` to share version reads across instances.
|
|
505
535
|
*/
|
|
506
536
|
function postgrestSources(client, options = {}) {
|
|
507
537
|
const api = options.api;
|
|
@@ -512,7 +542,29 @@ function postgrestSources(client, options = {}) {
|
|
|
512
542
|
const versionFn = options.versionFn ?? names?.authzVersionFor ?? "authz_version_for";
|
|
513
543
|
const declared = options.policy === void 0 ? void 0 : options.policy.index.declaredRoles;
|
|
514
544
|
const onlyDeclared = (held) => declared !== void 0 && held?.every((name) => declared.has(name)) === true;
|
|
515
|
-
const
|
|
545
|
+
const hook = options.onSourceCall;
|
|
546
|
+
const noteVersionRead = repeatedVersionReads();
|
|
547
|
+
const once = (memo, method, key, read) => {
|
|
548
|
+
let ran = false;
|
|
549
|
+
const started = performance.now();
|
|
550
|
+
const run = () => {
|
|
551
|
+
ran = true;
|
|
552
|
+
return read();
|
|
553
|
+
};
|
|
554
|
+
const answer = memo === void 0 ? run() : memo(key, run);
|
|
555
|
+
if (hook === void 0) return answer;
|
|
556
|
+
return answer.finally(() => {
|
|
557
|
+
try {
|
|
558
|
+
hook({
|
|
559
|
+
source: "postgrest",
|
|
560
|
+
method,
|
|
561
|
+
durationMs: performance.now() - started,
|
|
562
|
+
cached: !ran
|
|
563
|
+
});
|
|
564
|
+
} catch {}
|
|
565
|
+
});
|
|
566
|
+
};
|
|
567
|
+
const members = async (query) => {
|
|
516
568
|
const result = await callRpc(client, schema, membersFn, {
|
|
517
569
|
p_scope: query.scope,
|
|
518
570
|
p_id: query.id
|
|
@@ -520,14 +572,17 @@ function postgrestSources(client, options = {}) {
|
|
|
520
572
|
if (result.error !== null) throw new Error(`PermDock: ${schema}.${membersFn} failed: ${result.error.message}`);
|
|
521
573
|
return readMemberEntries(result.data);
|
|
522
574
|
};
|
|
523
|
-
const
|
|
575
|
+
const list = (query) => once(void 0, `${schema}.${membersFn}`, "", () => members(query));
|
|
576
|
+
const record = (userId, memo) => once(memo, `${schema}.${fn}`, `${schema}.${fn}:${userId}`, async () => {
|
|
524
577
|
const result = await callRpc(client, schema, fn, { p_user: userId });
|
|
525
578
|
if (result.error !== null) throw new Error(`PermDock: ${schema}.${fn} failed: ${result.error.message}`);
|
|
526
579
|
return readSubjectRecord(result.data);
|
|
527
580
|
});
|
|
528
|
-
const version = (userId, memo) => once(memo, `${schema}.${versionFn}:${userId}`, async () => {
|
|
581
|
+
const version = (userId, memo) => once(memo, `${schema}.${versionFn}`, `${schema}.${versionFn}:${userId}`, async () => {
|
|
582
|
+
noteVersionRead(userId);
|
|
529
583
|
const result = await callRpc(client, schema, versionFn, { p_user: userId });
|
|
530
|
-
|
|
584
|
+
if (result.error !== null) throw new Error(`PermDock: ${schema}.${versionFn} failed: ${result.error.message}`);
|
|
585
|
+
return versionOf(result.data);
|
|
531
586
|
});
|
|
532
587
|
const live = async (userId, memo) => {
|
|
533
588
|
const found = await record(userId, memo);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as defineLeaf } from "./command-L8EstFNm.js";
|
|
2
|
-
import { c as given, d as policyFlag, n as dbUrl, o as fileOut, r as dbUrlFlags, t as checkFlag } from "./flags-
|
|
2
|
+
import { c as given, d as policyFlag, n as dbUrl, o as fileOut, r as dbUrlFlags, t as checkFlag } from "./flags-BlmpmXoY.js";
|
|
3
3
|
//#region src/cli/commands/powersync.ts
|
|
4
4
|
const generate = defineLeaf({
|
|
5
5
|
flags: {
|
|
@@ -14,7 +14,7 @@ const generate = defineLeaf({
|
|
|
14
14
|
async run(ctx, { flags }) {
|
|
15
15
|
const out = fileOut("powersync", flags.out);
|
|
16
16
|
const from = given(flags.policy);
|
|
17
|
-
const { runPowerSync } = await import("./powersync-
|
|
17
|
+
const { runPowerSync } = await import("./powersync-Cqzx25dI.js");
|
|
18
18
|
return runPowerSync({
|
|
19
19
|
cwd: ctx.cwd,
|
|
20
20
|
config: ctx.config,
|
|
@@ -45,7 +45,7 @@ const verify = defineLeaf({
|
|
|
45
45
|
const db = await dbUrl(ctx, flags, { required: true });
|
|
46
46
|
const fixtures = given(flags.fixtures);
|
|
47
47
|
const from = given(flags.policy);
|
|
48
|
-
const { runPowerSync } = await import("./powersync-
|
|
48
|
+
const { runPowerSync } = await import("./powersync-Cqzx25dI.js");
|
|
49
49
|
return runPowerSync({
|
|
50
50
|
cwd: ctx.cwd,
|
|
51
51
|
config: ctx.config,
|
|
@@ -1,25 +1,25 @@
|
|
|
1
1
|
import { r as isRecord, t as compact } from "./compact-CAf557ZB.js";
|
|
2
2
|
import { c as isConditionDate, l as isConditionRef, o as hasConditionOp } from "./refs-C8BKxc_e.js";
|
|
3
|
-
import {
|
|
3
|
+
import { M as memoryCustomRoleSource, g as localSnapshotManifest } from "./src-nYNBfmgq.js";
|
|
4
4
|
import { n as findPermission } from "./permission-registry-B8tYxPIt.js";
|
|
5
|
-
import {
|
|
6
|
-
import { l as policyLevels } from "./policy-
|
|
5
|
+
import { d as scopeList, s as resolveScope } from "./scopes-BSdYaGHs.js";
|
|
6
|
+
import { l as policyLevels } from "./policy-DxQyHKPB.js";
|
|
7
7
|
import { t as requiresApproval } from "./approval-required-TzNB9oQA.js";
|
|
8
|
-
import { t as getPermDock } from "./permdock-
|
|
9
|
-
import { u as usageResult } from "./errors-
|
|
10
|
-
import { c as requirePolicy } from "./load-
|
|
8
|
+
import { t as getPermDock } from "./permdock-DdzMv5-F.js";
|
|
9
|
+
import { u as usageResult } from "./errors-BhRkoNS7.js";
|
|
10
|
+
import { c as requirePolicy } from "./load-BaEamml-.js";
|
|
11
11
|
import { s as quoteSqlLiteral, t as SQL_IDENT } from "./sql-0WjxIp9g.js";
|
|
12
|
-
import { a as scopeMembershipTable, i as scopeColumn } from "./compile-
|
|
12
|
+
import { a as scopeMembershipTable, i as scopeColumn } from "./compile-B_oJqmIg.js";
|
|
13
13
|
import { d as keptKeys } from "./sources-C4vkzZJV.js";
|
|
14
|
-
import { t as applyFiles } from "./files-
|
|
15
|
-
import { i as fileDrift } from "./output-files-
|
|
16
|
-
import { n as fixtureSubject, r as loadFixtures, t as fixtureRow } from "./fixtures-
|
|
17
|
-
import { A as quoteQualified, O as quoteIdent, a as customRolesOn, t as CUSTOM_ROLES } from "./shared-
|
|
18
|
-
import { n as tableNameOf, r as tableNames } from "./tables-
|
|
19
|
-
import { d as andConditions, l as collectGrants, o as assignableRoles, p as contextRefs, t as ownershipRules, u as roleNames } from "./ownership-
|
|
14
|
+
import { t as applyFiles } from "./files-CfiRtQ-m.js";
|
|
15
|
+
import { i as fileDrift } from "./output-files-CM0BnH05.js";
|
|
16
|
+
import { n as fixtureSubject, r as loadFixtures, t as fixtureRow } from "./fixtures-0VTW5oNq.js";
|
|
17
|
+
import { A as quoteQualified, O as quoteIdent, a as customRolesOn, t as CUSTOM_ROLES } from "./shared-DyYVEjKC.js";
|
|
18
|
+
import { n as tableNameOf, r as tableNames } from "./tables-BsGE6HBR.js";
|
|
19
|
+
import { d as andConditions, l as collectGrants, o as assignableRoles, p as contextRefs, t as ownershipRules, u as roleNames } from "./ownership-moSRhxl_.js";
|
|
20
20
|
import { t as membershipSourcesOf } from "./sources-qoIJQrJv.js";
|
|
21
|
-
import { n as pgConnector } from "./pg-
|
|
22
|
-
import { m as tableFor, t as canFixture } from "./verify-
|
|
21
|
+
import { n as pgConnector } from "./pg-Ddxsd5ZB.js";
|
|
22
|
+
import { m as tableFor, t as canFixture } from "./verify-C8G8D5mk.js";
|
|
23
23
|
import { resolve } from "node:path";
|
|
24
24
|
//#region src/cli/powersync/names.ts
|
|
25
25
|
function ident(name) {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { n as runPowerSync } from "./powersync-C0nsyULQ.js";
|
package/dist/preset/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { s as ARCHETYPES, c as AUTH, l as BACKENDS, u as FEATURES, d as FRAMEWORKS, f as INTEGRATIONS, p as PRESET_DEFAULTS, r as PRESET_FLAGS, m as SERVICES, a as decodePreset, o as encodePreset, n as generatePreset, h as integrationsOf, i as presetFlags, t as presetMatrix, g as resolvePreset } from "../preset-
|
|
1
|
+
export { s as ARCHETYPES, c as AUTH, l as BACKENDS, u as FEATURES, d as FRAMEWORKS, f as INTEGRATIONS, p as PRESET_DEFAULTS, r as PRESET_FLAGS, m as SERVICES, a as decodePreset, o as encodePreset, n as generatePreset, h as integrationsOf, i as presetFlags, t as presetMatrix, g as resolvePreset } from "../preset-pPrVyGU5.js";
|
|
@@ -934,16 +934,80 @@ export async function currentUser(${sessionCall(ctx).takesRequest ? "_request: R
|
|
|
934
934
|
}
|
|
935
935
|
`;
|
|
936
936
|
}
|
|
937
|
+
function supabaseCookieSession() {
|
|
938
|
+
return `import { createServerClient } from "@supabase/ssr";
|
|
939
|
+
import { cookies } from "next/headers";
|
|
940
|
+
import { subjectFromSupabase } from "permdock/supabase";
|
|
941
|
+
|
|
942
|
+
/**
|
|
943
|
+
* The subject the Supabase session cookie proves, verified with getClaims();
|
|
944
|
+
* anonymous without one. proxy.ts refreshes the session before this runs, so
|
|
945
|
+
* setAll has nothing to write.
|
|
946
|
+
*/
|
|
947
|
+
export async function currentSubject() {
|
|
948
|
+
const store = await cookies();
|
|
949
|
+
const supabase = createServerClient(
|
|
950
|
+
${env("SUPABASE_URL")} ?? "",
|
|
951
|
+
${env("SUPABASE_PUBLISHABLE_KEY")} ?? "",
|
|
952
|
+
{ cookies: { getAll: () => store.getAll(), setAll: () => undefined } },
|
|
953
|
+
);
|
|
954
|
+
const { data, error } = await supabase.auth.getClaims();
|
|
955
|
+
return subjectFromSupabase(error ? null : (data?.claims ?? null));
|
|
956
|
+
}
|
|
957
|
+
`;
|
|
958
|
+
}
|
|
959
|
+
/**
|
|
960
|
+
* Next.js 16's `proxy.ts`: refreshes the Supabase session once per request and
|
|
961
|
+
* returns the response `setAll` built, with the cache headers `@supabase/ssr`
|
|
962
|
+
* passes so a CDN never stores a session cookie.
|
|
963
|
+
*/
|
|
964
|
+
function supabaseProxy() {
|
|
965
|
+
return `import { createServerClient } from "@supabase/ssr";
|
|
966
|
+
import { type NextRequest, NextResponse } from "next/server";
|
|
967
|
+
|
|
968
|
+
/** Refreshes the Supabase session; authorization happens in the pages. */
|
|
969
|
+
export async function proxy(request: NextRequest) {
|
|
970
|
+
let response = NextResponse.next({ request });
|
|
971
|
+
const supabase = createServerClient(
|
|
972
|
+
${env("SUPABASE_URL")} ?? "",
|
|
973
|
+
${env("SUPABASE_PUBLISHABLE_KEY")} ?? "",
|
|
974
|
+
{
|
|
975
|
+
cookies: {
|
|
976
|
+
getAll: () => request.cookies.getAll(),
|
|
977
|
+
setAll: (cookiesToSet, headers) => {
|
|
978
|
+
for (const { name, value } of cookiesToSet) {
|
|
979
|
+
request.cookies.set(name, value);
|
|
980
|
+
}
|
|
981
|
+
response = NextResponse.next({ request });
|
|
982
|
+
for (const { name, value, options } of cookiesToSet) {
|
|
983
|
+
response.cookies.set(name, value, options);
|
|
984
|
+
}
|
|
985
|
+
for (const [key, value] of Object.entries(headers)) {
|
|
986
|
+
response.headers.set(key, value);
|
|
987
|
+
}
|
|
988
|
+
},
|
|
989
|
+
},
|
|
990
|
+
},
|
|
991
|
+
);
|
|
992
|
+
await supabase.auth.getClaims();
|
|
993
|
+
return response;
|
|
994
|
+
}
|
|
995
|
+
|
|
996
|
+
export const config = {
|
|
997
|
+
matcher: ["/((?!_next/static|_next/image|favicon.ico).*)"],
|
|
998
|
+
};
|
|
999
|
+
`;
|
|
1000
|
+
}
|
|
937
1001
|
function supabaseSession(ctx) {
|
|
1002
|
+
if (!sessionCall(ctx).takesRequest) return supabaseCookieSession();
|
|
938
1003
|
const h = headersOf(ctx);
|
|
939
|
-
const browser = sessionCall(ctx).takesRequest ? "" : "\n * A browser session keeps the token in cookies: read it there with\n * createServerClient from @supabase/ssr.";
|
|
940
1004
|
return moduleText([
|
|
941
1005
|
`import { createClient } from "@supabase/supabase-js";`,
|
|
942
1006
|
...h.imports,
|
|
943
1007
|
`import { subjectFromSupabase } from "permdock/supabase";`
|
|
944
1008
|
], `/**
|
|
945
1009
|
* The subject the Supabase access token in the Authorization header proves;
|
|
946
|
-
* anonymous without a valid one
|
|
1010
|
+
* anonymous without a valid one.
|
|
947
1011
|
*/
|
|
948
1012
|
export async function currentSubject(${h.param}) {
|
|
949
1013
|
const requestHeaders = ${h.read};
|
|
@@ -1038,7 +1102,7 @@ function sessionFiles(ctx) {
|
|
|
1038
1102
|
const at = (name) => `${ctx.src}/${name}`;
|
|
1039
1103
|
switch (ctx.preset.auth) {
|
|
1040
1104
|
case "custom": return [ownedFile(at("session.ts"), customSession(ctx))];
|
|
1041
|
-
case "supabase": return [ownedFile(at("session.ts"), supabaseSession(ctx))];
|
|
1105
|
+
case "supabase": return [ownedFile(at("session.ts"), supabaseSession(ctx)), ...sessionCall(ctx).takesRequest ? [] : [ownedFile(at("proxy.ts"), supabaseProxy())]];
|
|
1042
1106
|
case "better-auth": return [ownedFile(at("auth.ts"), betterAuthFile()), ownedFile(at("session.ts"), betterAuthSession(ctx))];
|
|
1043
1107
|
case "clerk": return [ownedFile(at("session.ts"), clerkSession(ctx))];
|
|
1044
1108
|
case "jwt": return [ownedFile(at("session.ts"), jwtSession(ctx))];
|
|
@@ -1048,7 +1112,7 @@ function sessionFiles(ctx) {
|
|
|
1048
1112
|
function authDependencies(ctx) {
|
|
1049
1113
|
switch (ctx.preset.auth) {
|
|
1050
1114
|
case "custom": return [];
|
|
1051
|
-
case "supabase": return ["@supabase/supabase-js"];
|
|
1115
|
+
case "supabase": return sessionCall(ctx).takesRequest ? ["@supabase/supabase-js"] : ["@supabase/ssr", "@supabase/supabase-js"];
|
|
1052
1116
|
case "better-auth": return ["better-auth"];
|
|
1053
1117
|
case "clerk": return [sessionCall(ctx).takesRequest ? "@clerk/backend" : "@clerk/nextjs"];
|
|
1054
1118
|
case "jwt": return ["jose"];
|
|
@@ -1489,14 +1553,17 @@ app.patch(
|
|
|
1489
1553
|
);
|
|
1490
1554
|
`)];
|
|
1491
1555
|
case "none":
|
|
1492
|
-
if (current === "currentSubject") return [owned(`${ctx.src}/server.ts`, `import { getPermDock } from "permdock";
|
|
1556
|
+
if (current === "currentSubject") return [owned(`${ctx.src}/server.ts`, `import { getPermDock, instanceCache } from "permdock";
|
|
1493
1557
|
|
|
1494
1558
|
import { app } from "./permdock";
|
|
1495
1559
|
import { currentSubject } from "./session";
|
|
1496
1560
|
|
|
1497
|
-
/**
|
|
1561
|
+
/** Instances reused while a caller's authorization version holds; one per process. */
|
|
1562
|
+
const instances = instanceCache();
|
|
1563
|
+
|
|
1564
|
+
/** The decision object for the caller of \`request\`. */
|
|
1498
1565
|
export async function permdockFor(request: Request) {
|
|
1499
|
-
return getPermDock(app, await currentSubject(request));
|
|
1566
|
+
return getPermDock(app, await currentSubject(request), { instances });
|
|
1500
1567
|
}
|
|
1501
1568
|
`)];
|
|
1502
1569
|
return [owned(`${ctx.src}/server.ts`, `import { getPermDockSync } from "permdock";
|
package/dist/prisma/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { f as WhereResult } from "../permdock-
|
|
1
|
+
import { Kt as Instant, wr as Condition, yr as Subject } from "../policy-types-IRJVABmm.js";
|
|
2
|
+
import { f as WhereResult } from "../permdock-DUWZEOLR.js";
|
|
3
3
|
import { r as RelationsMapping } from "../graph-sql-BwFC4Qjs.js";
|
|
4
4
|
import { n as RowCheck, t as WithSubjectOptions } from "../subject-settings-vNW8qmUH.js";
|
|
5
5
|
//#region src/prisma/model-fields.d.ts
|
package/dist/prisma/index.js
CHANGED
|
@@ -2,7 +2,7 @@ import { t as compact } from "../compact-CAf557ZB.js";
|
|
|
2
2
|
import { n as freezeDeep } from "../freeze-jjan0lCv.js";
|
|
3
3
|
import { t as assertSafeKey } from "../paths-CUvURzHp.js";
|
|
4
4
|
import { n as PermDockValidationError } from "../validation-error-CYg2kJEw.js";
|
|
5
|
-
import { c as relatedTargetsSql, d as restrictedRowsSql, n as compileWhere, o as relatedRowGuard, r as escapeLike, u as renderGraphSql } from "../compile-
|
|
5
|
+
import { c as relatedTargetsSql, d as restrictedRowsSql, n as compileWhere, o as relatedRowGuard, r as escapeLike, u as renderGraphSql } from "../compile-B_oJqmIg.js";
|
|
6
6
|
import { n as statementText, o as rowCheckOf, r as subjectStatements, s as loadPeer } from "../subject-settings-8sH5HlII.js";
|
|
7
7
|
//#region src/prisma/to-where.ts
|
|
8
8
|
function fieldTests(options) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { a as problemType } from "./problem-details-CLDgX1KV.js";
|
|
2
2
|
import { t as approvalHeaderValue } from "./approval-header-8QV6MU4H.js";
|
|
3
|
-
import { t as approvalHandle } from "./views-
|
|
3
|
+
import { t as approvalHandle } from "./views-TrZYlDnM.js";
|
|
4
4
|
//#region src/client/headers.ts
|
|
5
5
|
/**
|
|
6
6
|
* The `PermDock-Approval` header for a resume; a `TypeError` for a token that
|