permdock 0.16.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-C2BCiUEG.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-CHoYnQXO.js → arazzo-7kbeh1yi.js} +2 -2
- package/dist/{arazzo-ClYz2Z0W.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-C9EvElBb.js → casbin-C3O_O9nu.js} +2 -2
- package/dist/{casbin-D_rVQ31U.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-DdaJ7ILM.js → cloud-DYqzmh5i.js} +4 -4
- package/dist/{codemod-ammy6wv4.js → codemod-DNGMGqBS.js} +395 -8
- package/dist/{codemod-B1USJS7a.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--Y4YItFZ.js → completion-pwVjJlek.js} +3 -3
- package/dist/{config-CcLlvEYW.js → config-COHmivz9.js} +4 -4
- package/dist/{config-BQ77xMZk.js → config-DnfH6_eT.js} +2 -2
- package/dist/{config-report-DVMOLJ7F.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-CwYc2lJb.js → doctor-BNRhJegR.js} +3 -3
- package/dist/{doctor-D1Xnmy6u.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-Dfe2unKO.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-C6cWP3xW.js → init-Dr1qAStu.js} +5 -5
- package/dist/{init-BUo2G-FI.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-D1MHOomI.js → login-CXgEKLaW.js} +4 -4
- package/dist/{login-DCKE5pVy.js → login-DEVXDTX8.js} +4 -4
- package/dist/{manifest-Cft51TLK.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-BwWkHxvW.js → openapi-D3wkvOoU.js} +4 -4
- package/dist/{openapi-DSzQN7Zu.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-DlICTjBh.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-DAfo0EL5.js → powersync-BZxw_v-A.js} +3 -3
- package/dist/{powersync-CBhTBhG2.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-CQCGy1gv.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-C5ZGzR_B.js → rls-BVzoZCn3.js} +4 -4
- package/dist/{rls-tHu7N_Pe.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-DUq1xU4K.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-C3HRH9Fs.js → scan-CepUXrFt.js} +1 -1
- package/dist/{schema-DvXvxPhQ.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-Celu2W6v.js → skills-BUuH-QFt.js} +2 -2
- package/dist/{skills-B2qTbaQa.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-SwE642N1.js → supautils-BP_5WAIc.js} +12 -12
- 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-CPXeuAdT.js → usage-COsGLht5.js} +6 -6
- package/dist/{usage-CfZCQd0F.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-DfT0QYNh.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/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-0QVP_DuR.js +0 -1
- package/dist/pull-CCAChKuy.js +0 -1
- package/dist/renames-CGj7YwcQ.js +0 -175
- package/dist/run-C5P3x1EI.js +0 -1
- package/dist/supabase-hook-qsewAVZY.js +0 -1
- package/dist/usage-DmmO_xjJ.js +0 -1
- package/dist/watch-CuPz0D2M.js +0 -1
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { $t as Snapshot, Kt as Instant, M as PolicyVocabulary, Z as Intent, hr as JsonWebKeyLike, qn as Decision, sr as Actor, yr as Subject } from "./policy-types-IRJVABmm.js";
|
|
2
2
|
import { u as Permission } from "./permission-types-CAY-GU7e.js";
|
|
3
|
-
import { a as PermDock, u as SnapshotOptions } from "./permdock-
|
|
4
|
-
import { m as ApprovalStore } from "./types-
|
|
5
|
-
import { a as ProblemDetails, t as ApprovalHint } from "./errors-
|
|
6
|
-
import { t as InstanceOptions } from "./instance-options-
|
|
3
|
+
import { a as PermDock, u as SnapshotOptions } from "./permdock-DUWZEOLR.js";
|
|
4
|
+
import { m as ApprovalStore } from "./types-BvBbkAu1.js";
|
|
5
|
+
import { a as ProblemDetails, t as ApprovalHint } from "./errors-Dc9FdamT.js";
|
|
6
|
+
import { t as InstanceOptions } from "./instance-options-BOCRxEFb.js";
|
|
7
7
|
import { t as RequestContext } from "./request-context-C2_1lchh.js";
|
|
8
|
-
import { n as PermDockWrap } from "./wrap-
|
|
8
|
+
import { n as PermDockWrap } from "./wrap-DpZAbxuD.js";
|
|
9
9
|
import { n as RevocationFeed } from "./revocations-BaUXHM1N.js";
|
|
10
|
-
import { r as PdpFactory } from "./types-
|
|
11
|
-
import { i as evaluationsHandler } from "./evaluations-
|
|
10
|
+
import { r as PdpFactory } from "./types-B3BOcI0J.js";
|
|
11
|
+
import { i as evaluationsHandler } from "./evaluations-BasA9zXp.js";
|
|
12
12
|
//#region src/server/connection.d.ts
|
|
13
13
|
type ConnectionData<T> = T | (() => T | null | undefined | Promise<T | null | undefined>);
|
|
14
14
|
type ConnectionOptions<T = unknown> = {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { a as durationOf, f as nowMillis } from "./time-nR1JesoH.js";
|
|
2
|
-
import {
|
|
2
|
+
import { n as decisionToken } from "./token-DaMnIU9O.js";
|
|
3
3
|
//#region src/pdp/shared.ts
|
|
4
4
|
const MAX_CACHE_TTL = 30;
|
|
5
5
|
const CACHE_MAX = 1e3;
|
|
@@ -46,7 +46,7 @@ function granted(provider, permission, subject, data) {
|
|
|
46
46
|
resourceId: resourceIdOf(data),
|
|
47
47
|
principal,
|
|
48
48
|
actor: subject.actor,
|
|
49
|
-
|
|
49
|
+
source: provider
|
|
50
50
|
})
|
|
51
51
|
};
|
|
52
52
|
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { r as isRecord } from "./compact-CAf557ZB.js";
|
|
2
2
|
import { n as isForbiddenKey } from "./paths-CUvURzHp.js";
|
|
3
3
|
import { t as byCodePoint } from "./compare-DTfyUunF.js";
|
|
4
|
-
import { i as configError } from "./errors-
|
|
4
|
+
import { i as configError } from "./errors-BhRkoNS7.js";
|
|
5
5
|
import { a as quoteQualifiedTable, c as quoteSqlTable, o as quoteSqlIdent, s as quoteSqlLiteral, t as SQL_IDENT } from "./sql-0WjxIp9g.js";
|
|
6
|
-
import { t as byScope } from "./compile-
|
|
6
|
+
import { t as byScope } from "./compile-B_oJqmIg.js";
|
|
7
7
|
import "./sources-C4vkzZJV.js";
|
|
8
8
|
//#region src/cli/sql/columns.ts
|
|
9
9
|
/**
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Y as DecisionSink, gt as TokenSigner, hn as SinkEvent, in as AccessEvent, jt as Credential, mn as MembershipEvent, on as AutomationEvent, sn as CredentialEvent, wt as SupportSession } from "./policy-types-IRJVABmm.js";
|
|
2
2
|
import { M as AppData } from "./permission-types-CAY-GU7e.js";
|
|
3
3
|
import { u as OperationRisk } from "./operations-Ci_rT6Uo.js";
|
|
4
|
-
import { t as Automation } from "./automation-
|
|
4
|
+
import { t as Automation } from "./automation-DCWuVKtd.js";
|
|
5
5
|
//#region src/core/sink.d.ts
|
|
6
6
|
/**
|
|
7
7
|
* The closed list of CloudEvents `type` values, `com.permdock.<family>` or
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { t as byCodePoint } from "./compare-DTfyUunF.js";
|
|
2
2
|
import { i as readJsonFile } from "./files-BSjrtIHw.js";
|
|
3
3
|
import { l as packageRoot } from "./version-DMQ0dnN5.js";
|
|
4
|
-
import { t as didYouMean } from "./args-
|
|
5
|
-
import { a as nonEmptyOr } from "./output-
|
|
4
|
+
import { t as didYouMean } from "./args-iafbHiXn.js";
|
|
5
|
+
import { a as nonEmptyOr } from "./output-DhTpe8v1.js";
|
|
6
6
|
import { cpSync, existsSync, lstatSync, mkdirSync, readFileSync, readdirSync, readlinkSync, realpathSync, writeFileSync } from "node:fs";
|
|
7
7
|
import { basename, dirname, join, relative, resolve } from "node:path";
|
|
8
8
|
import { pathToFileURL } from "node:url";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { t as defineLeaf } from "./command-L8EstFNm.js";
|
|
2
|
-
import { t as checkFlag } from "./flags-
|
|
2
|
+
import { t as checkFlag } from "./flags-BlmpmXoY.js";
|
|
3
3
|
import { r as pick, t as CANCELLED } from "./prompt-BYc6drYW.js";
|
|
4
|
-
import { n as detectedAgents, r as runSkills, t as SKILL_AGENTS } from "./skills-
|
|
4
|
+
import { n as detectedAgents, r as runSkills, t as SKILL_AGENTS } from "./skills-BUuH-QFt.js";
|
|
5
5
|
//#region src/cli/commands/skills.ts
|
|
6
6
|
const forFlag = { for: {
|
|
7
7
|
type: "string",
|
|
@@ -3,10 +3,10 @@ import { n as freezeDeep } from "./freeze-jjan0lCv.js";
|
|
|
3
3
|
import { n as isForbiddenKey } from "./paths-CUvURzHp.js";
|
|
4
4
|
import { a as resolveConditionRef, l as isConditionRef } from "./refs-C8BKxc_e.js";
|
|
5
5
|
import { l as isRfc3339, m as rfc3339, p as nowSeconds } from "./time-nR1JesoH.js";
|
|
6
|
-
import {
|
|
6
|
+
import { d as scopeList } from "./scopes-BSdYaGHs.js";
|
|
7
7
|
import { _ as listPlans, v as listRoles } from "./grantee-Dke-9rd1.js";
|
|
8
8
|
import { i as wireValidity } from "./validity-Buc7w8E9.js";
|
|
9
|
-
import { m as tenantsOf } from "./tenancy-
|
|
9
|
+
import { m as tenantsOf } from "./tenancy-DvOHHk3-.js";
|
|
10
10
|
import { n as toWireDelegation } from "./wire-delegation-Cv3W2eaM.js";
|
|
11
11
|
//#region src/conditions/bind.ts
|
|
12
12
|
function isPrimitive(value) {
|
|
@@ -220,6 +220,8 @@ function buildSnapshot(input) {
|
|
|
220
220
|
include,
|
|
221
221
|
simulated: input.simulated === true ? true : void 0,
|
|
222
222
|
expiresAt: input.subject.expiresAt === void 0 ? void 0 : rfc3339(input.subject.expiresAt),
|
|
223
|
+
authzVersion: principal?.authzVersion,
|
|
224
|
+
sessionId: input.subject.session,
|
|
223
225
|
scopes: input.scopes,
|
|
224
226
|
ids: Object.keys(ids).length === 0 ? void 0 : ids,
|
|
225
227
|
assignable: assignable.length > 0 ? assignable : void 0,
|
|
@@ -266,6 +268,8 @@ function parseSnapshot(json) {
|
|
|
266
268
|
const version = record["v"];
|
|
267
269
|
if (version !== 1) throw new Error(`PermDock: unsupported snapshot version '${String(version)}'`);
|
|
268
270
|
if (!isRfc3339(record["issuedAt"]) || record["expiresAt"] !== void 0 && !isRfc3339(record["expiresAt"])) throw new Error("PermDock: snapshot times must be RFC 3339");
|
|
271
|
+
const authzVersion = record["authzVersion"];
|
|
272
|
+
if (authzVersion !== void 0 && (typeof authzVersion !== "number" || !Number.isSafeInteger(authzVersion) || authzVersion < 0) || record["sessionId"] !== void 0 && typeof record["sessionId"] !== "string") throw new Error("PermDock: snapshot authzVersion must be a non-negative integer and sessionId a string");
|
|
269
273
|
return freezeDeep(value);
|
|
270
274
|
}
|
|
271
275
|
//#endregion
|
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
import { g as secondsOf, p as nowSeconds } from "./time-nR1JesoH.js";
|
|
2
|
-
import {
|
|
2
|
+
import { r as payloadDigest } from "./token-DaMnIU9O.js";
|
|
3
3
|
//#region src/core/snapshot-cache.ts
|
|
4
4
|
/** Seconds since the epoch of a NumericDate or an RFC 3339 instant. */
|
|
5
5
|
function epochSeconds(value) {
|
|
6
6
|
return typeof value === "number" ? value : secondsOf(value);
|
|
7
7
|
}
|
|
8
8
|
/**
|
|
9
|
-
* `{ stale }` in seconds: `max`
|
|
10
|
-
*
|
|
11
|
-
* left gets its real remainder, so Next.js leaves it out of prefetches
|
|
12
|
-
* HTTP cache does not serve it past `expiresAt`.
|
|
9
|
+
* `{ stale }` in seconds: `max` (default 300). With `capToToken`, the seconds
|
|
10
|
+
* the value has left, clamped to `[min, max]`; a value with less than `min`
|
|
11
|
+
* seconds left gets its real remainder, so Next.js leaves it out of prefetches
|
|
12
|
+
* and an HTTP cache does not serve it past `expiresAt`.
|
|
13
13
|
*/
|
|
14
14
|
function cacheLifeFor(value, options = {}) {
|
|
15
15
|
const min = options.min ?? 30;
|
|
16
16
|
const max = Math.max(options.max ?? 300, min);
|
|
17
|
-
const expiresAt = epochSeconds(value?.expiresAt);
|
|
17
|
+
const expiresAt = options.capToToken === true ? epochSeconds(value?.expiresAt) : void 0;
|
|
18
18
|
if (expiresAt === void 0) return { stale: max };
|
|
19
19
|
const issued = epochSeconds(value?.issuedAt);
|
|
20
20
|
const issuedAt = issued !== void 0 && issued > 0 ? issued : void 0;
|
|
@@ -24,6 +24,20 @@ function cacheLifeFor(value, options = {}) {
|
|
|
24
24
|
return { stale: Math.min(max, remaining) };
|
|
25
25
|
}
|
|
26
26
|
/**
|
|
27
|
+
* The key of one subject's snapshot in a server cache:
|
|
28
|
+
* `<sub>:<authzVersion>:<tenant>`, with `anon` for no subject and an empty part
|
|
29
|
+
* for a missing version or tenant. It carries no claims, so a refreshed token
|
|
30
|
+
* at the same version keeps the key.
|
|
31
|
+
*/
|
|
32
|
+
function snapshotKey(snapshot) {
|
|
33
|
+
const principal = snapshot.subject.principal;
|
|
34
|
+
return [
|
|
35
|
+
principal?.id ?? "anon",
|
|
36
|
+
snapshot.authzVersion ?? "",
|
|
37
|
+
principal?.tenant ?? ""
|
|
38
|
+
].join(":");
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
27
41
|
* The `cacheTag` for one subject's cached snapshots: `permdock:<sub>`, or
|
|
28
42
|
* `permdock:anon` without a subject. Tag the private cache with it and pass it
|
|
29
43
|
* to `updateTag` or `revalidateTag` on every write that changes the subject's
|
|
@@ -43,11 +57,14 @@ function snapshotHeaders(snapshot, options = {}) {
|
|
|
43
57
|
for (const [key, value] of Object.entries(snapshot)) if (key !== "issuedAt") content[key] = value;
|
|
44
58
|
const { tags, ...life } = options;
|
|
45
59
|
return {
|
|
46
|
-
"Cache-Control": `private, max-age=${cacheLifeFor(snapshot,
|
|
60
|
+
"Cache-Control": `private, max-age=${cacheLifeFor(snapshot, {
|
|
61
|
+
capToToken: true,
|
|
62
|
+
...life
|
|
63
|
+
}).stale}`,
|
|
47
64
|
Vary: "Authorization, Cookie",
|
|
48
65
|
ETag: `"${payloadDigest(content)}"`,
|
|
49
66
|
"Cache-Tag": [snapshotTag(snapshot.subject.principal?.id), ...tags ?? []].join(",")
|
|
50
67
|
};
|
|
51
68
|
}
|
|
52
69
|
//#endregion
|
|
53
|
-
export { snapshotHeaders as n,
|
|
70
|
+
export { snapshotTag as i, snapshotHeaders as n, snapshotKey as r, cacheLifeFor as t };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { $t as Snapshot, Kt as Instant } from "./policy-types-IRJVABmm.js";
|
|
2
2
|
//#region src/core/snapshot-cache.d.ts
|
|
3
3
|
type CacheLifeForOptions = {
|
|
4
4
|
/**
|
|
@@ -8,14 +8,21 @@ type CacheLifeForOptions = {
|
|
|
8
8
|
readonly min?: number;
|
|
9
9
|
/** Upper bound in seconds. Next.js keeps a per-session App Shell entry from 300. */
|
|
10
10
|
readonly max?: number;
|
|
11
|
+
/**
|
|
12
|
+
* Cap the lifetime at the seconds the token has left, as `bsb.cached()` does.
|
|
13
|
+
* Off by default: a proxy that refreshes the session on every request keeps
|
|
14
|
+
* the token ahead of the entry. `snapshotHeaders` turns it on, since an HTTP
|
|
15
|
+
* cache sees no refresh.
|
|
16
|
+
*/
|
|
17
|
+
readonly capToToken?: boolean;
|
|
11
18
|
/** Defaults to the snapshot's `issuedAt`, then the clock. */
|
|
12
19
|
readonly now?: Instant;
|
|
13
20
|
};
|
|
14
21
|
/**
|
|
15
|
-
* `{ stale }` in seconds: `max`
|
|
16
|
-
*
|
|
17
|
-
* left gets its real remainder, so Next.js leaves it out of prefetches
|
|
18
|
-
* HTTP cache does not serve it past `expiresAt`.
|
|
22
|
+
* `{ stale }` in seconds: `max` (default 300). With `capToToken`, the seconds
|
|
23
|
+
* the value has left, clamped to `[min, max]`; a value with less than `min`
|
|
24
|
+
* seconds left gets its real remainder, so Next.js leaves it out of prefetches
|
|
25
|
+
* and an HTTP cache does not serve it past `expiresAt`.
|
|
19
26
|
*/
|
|
20
27
|
declare function cacheLifeFor(value: {
|
|
21
28
|
/** RFC 3339, or a NumericDate. */
|
|
@@ -25,6 +32,13 @@ declare function cacheLifeFor(value: {
|
|
|
25
32
|
} | null, options?: CacheLifeForOptions): {
|
|
26
33
|
readonly stale: number;
|
|
27
34
|
};
|
|
35
|
+
/**
|
|
36
|
+
* The key of one subject's snapshot in a server cache:
|
|
37
|
+
* `<sub>:<authzVersion>:<tenant>`, with `anon` for no subject and an empty part
|
|
38
|
+
* for a missing version or tenant. It carries no claims, so a refreshed token
|
|
39
|
+
* at the same version keeps the key.
|
|
40
|
+
*/
|
|
41
|
+
declare function snapshotKey(snapshot: Snapshot): string;
|
|
28
42
|
/**
|
|
29
43
|
* The `cacheTag` for one subject's cached snapshots: `permdock:<sub>`, or
|
|
30
44
|
* `permdock:anon` without a subject. Tag the private cache with it and pass it
|
|
@@ -53,4 +67,4 @@ type SnapshotHeaders = {
|
|
|
53
67
|
*/
|
|
54
68
|
declare function snapshotHeaders(snapshot: Snapshot, options?: SnapshotHeadersOptions): SnapshotHeaders;
|
|
55
69
|
//#endregion
|
|
56
|
-
export { snapshotHeaders as a, cacheLifeFor as i, SnapshotHeaders as n,
|
|
70
|
+
export { snapshotHeaders as a, cacheLifeFor as i, SnapshotHeaders as n, snapshotKey as o, SnapshotHeadersOptions as r, snapshotTag as s, CacheLifeForOptions as t };
|
package/dist/solid/index.d.ts
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { $n as GrantedDecision, $t as Snapshot, Kn as ApprovalRequiredDecision, M as PolicyVocabulary, _t as TokenVerifier, gr as Membership, qn as Decision } from "../policy-types-IRJVABmm.js";
|
|
2
2
|
import { u as Permission } from "../permission-types-CAY-GU7e.js";
|
|
3
3
|
import { r as Role } from "../vocabulary-DEJ5j4mR.js";
|
|
4
|
-
import { d as UncheckedData, s as RowData } from "../permdock-
|
|
5
|
-
import { c as requiredPlans } from "../errors-
|
|
6
|
-
import { i as describe, r as DescribeOptions, t as DecisionDescription } from "../describe-
|
|
4
|
+
import { d as UncheckedData, s as RowData } from "../permdock-DUWZEOLR.js";
|
|
5
|
+
import { c as requiredPlans } from "../errors-Dc9FdamT.js";
|
|
6
|
+
import { i as describe, r as DescribeOptions, t as DecisionDescription } from "../describe-nalX_HHE.js";
|
|
7
7
|
import { t as PermissionBoundaryState } from "../boundary-C9ck-3uK.js";
|
|
8
|
-
import {
|
|
8
|
+
import { _ as TenantView, a as ClientPermDock, c as GateMode, d as PermissionState, g as SubjectView, h as RolesOptions, i as ApprovalState, l as GateView, m as ProviderOptionsBase, o as ClientStatus, p as ProtectedActionView, r as ApprovalHandle, s as FilterResult, u as PermissionSet, v as ActionResult, y as ProtectedAction } from "../store-g5ctUrOI.js";
|
|
9
|
+
import { a as broadcastChannelRefresh, c as visibilityRefresh, i as authzChangeRefresh, n as EventSourceRefreshOptions, o as eventSourceRefresh, r as RefreshTrigger, s as focusRefresh, t as AuthzChangeRefresh } from "../refresh-on-L9UOwATg.js";
|
|
9
10
|
import { t as approvalHeaders } from "../headers-B9jQxjtW.js";
|
|
10
|
-
import { a as FilterResult, b as eventSourceRefresh, c as PermissionSet, d as ProtectedActionView, f as ProviderOptionsBase, h as TenantView, i as ClientStatus, l as PermissionState, m as SubjectView, n as ApprovalState, o as GateMode, p as RolesOptions, r as ClientPermDock, s as GateView, t as ApprovalHandle, v as EventSourceRefreshOptions, y as RefreshTrigger } from "../types-tQB2CEnY.js";
|
|
11
11
|
import { Accessor, Accessor as Accessor$1, JSX } from "solid-js";
|
|
12
12
|
//#region src/solid/types.d.ts
|
|
13
13
|
/** Structural `JSX.Element`: text, a DOM node or a list of children. */
|
|
@@ -129,4 +129,4 @@ export declare function Protected(props: ProtectedProps): JSX.Element;
|
|
|
129
129
|
//#region src/solid/provider.d.ts
|
|
130
130
|
export declare function PermDockProvider(props: PermDockProviderProps): JSX.Element;
|
|
131
131
|
//#endregion
|
|
132
|
-
export { type ActionResult, type ApprovalHandle, type ApprovalState, type ClientPermDock, type ClientStatus, type EventSourceRefreshOptions, type FilterResult, type GateMode, type GateView, type PermDockDefaults, type PermDockProviderProps, type PermissionBoundaryProps, type PermissionBoundaryState, type PermissionSet, type PermissionState, type ProtectedAction, type ProtectedActionAccessors, type ProtectedActionView, type ProtectedProps, type RefreshTrigger, type RolesOptions, type SolidChild, type SubjectView, type TenantView, approvalHeaders, describe, eventSourceRefresh, requiredPlans };
|
|
132
|
+
export { type ActionResult, type ApprovalHandle, type ApprovalState, type AuthzChangeRefresh, type ClientPermDock, type ClientStatus, type EventSourceRefreshOptions, type FilterResult, type GateMode, type GateView, type PermDockDefaults, type PermDockProviderProps, type PermissionBoundaryProps, type PermissionBoundaryState, type PermissionSet, type PermissionState, type ProtectedAction, type ProtectedActionAccessors, type ProtectedActionView, type ProtectedProps, type RefreshTrigger, type RolesOptions, type SolidChild, type SubjectView, type TenantView, approvalHeaders, authzChangeRefresh, broadcastChannelRefresh, describe, eventSourceRefresh, focusRefresh, requiredPlans, visibilityRefresh };
|
package/dist/solid/index.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { t as compact } from "../compact-CAf557ZB.js";
|
|
2
2
|
import { r as requiredPlans } from "../problem-details-CLDgX1KV.js";
|
|
3
|
-
import { n as describe } from "../describe-
|
|
3
|
+
import { n as describe } from "../describe-CogP1loh.js";
|
|
4
4
|
import { n as boundaryFallback, t as boundaryDigest } from "../boundary-BV3O1eud.js";
|
|
5
|
-
import { n as actionRunner, r as approvalHeaders, t as actionApproval } from "../protected-action-
|
|
6
|
-
import { a as livePermDock, c as rolesView, d as subjectView, f as tenantView, i as gateView, l as scopedTenant, n as describeWith, o as permissionSet, r as filterResult, s as protectedView, t as approvalHandle, u as slotContent } from "../views-
|
|
7
|
-
import { a as isPromiseLike, r as
|
|
8
|
-
import { n as switchTenant, t as providerStore } from "../provider-store-
|
|
5
|
+
import { n as actionRunner, r as approvalHeaders, t as actionApproval } from "../protected-action-B6n6w7Rl.js";
|
|
6
|
+
import { a as livePermDock, c as rolesView, d as subjectView, f as tenantView, i as gateView, l as scopedTenant, n as describeWith, o as permissionSet, r as filterResult, s as protectedView, t as approvalHandle, u as slotContent } from "../views-TrZYlDnM.js";
|
|
7
|
+
import { a as eventSourceRefresh, i as broadcastChannelRefresh, l as isPromiseLike, o as focusRefresh, r as authzChangeRefresh, s as visibilityRefresh } from "../store-options--zWn48PK.js";
|
|
8
|
+
import { n as switchTenant, t as providerStore } from "../provider-store-BQP_pp8s.js";
|
|
9
9
|
import { ErrorBoundary, createComponent, createComputed, createContext, createMemo, createSignal, getOwner, on, onCleanup, useContext } from "solid-js";
|
|
10
10
|
//#region src/solid/context.ts
|
|
11
11
|
const PermDockContext = createContext(void 0);
|
|
@@ -249,4 +249,4 @@ function uiProvider(ui, props) {
|
|
|
249
249
|
});
|
|
250
250
|
}
|
|
251
251
|
//#endregion
|
|
252
|
-
export { PermDockProvider, PermissionBoundary, Protected, approvalHeaders, describe, eventSourceRefresh, requiredPlans, useApproval, useAssignablePermissions, useAssignableRoles, useDescribe, useFilter, useGate, useMemberships, usePermDock, usePermission, usePermissionBoundary, usePermissions, useProtectedAction, useRoles, useSubject, useTenant };
|
|
252
|
+
export { PermDockProvider, PermissionBoundary, Protected, approvalHeaders, authzChangeRefresh, broadcastChannelRefresh, describe, eventSourceRefresh, focusRefresh, requiredPlans, useApproval, useAssignablePermissions, useAssignableRoles, useDescribe, useFilter, useGate, useMemberships, usePermDock, usePermission, usePermissionBoundary, usePermissions, useProtectedAction, useRoles, useSubject, useTenant, visibilityRefresh };
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { $t as Snapshot, E as Policy, M as PolicyVocabulary, _r as Principal } from "../policy-types-IRJVABmm.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-
|
|
5
|
-
import { D as ConnectionOptions, T as Connection, f as InvalidSignatureError, i as OpenApiHooks, o as ProtectOptions, u as SnapshotQuery, v as discoverViaSignatureAgent, x as webBotAuthVerifier } from "../server-types-
|
|
6
|
-
import { a as ProtectTarget, n as FetchAdapterOptions, t as ContextReader } from "../fetch-adapter-
|
|
4
|
+
import { a as PermDock } from "../permdock-DUWZEOLR.js";
|
|
5
|
+
import { D as ConnectionOptions, T as Connection, f as InvalidSignatureError, i as OpenApiHooks, o as ProtectOptions, u as SnapshotQuery, v as discoverViaSignatureAgent, x as webBotAuthVerifier } from "../server-types-Bw-lWqzR.js";
|
|
6
|
+
import { a as ProtectTarget, n as FetchAdapterOptions, t as ContextReader } from "../fetch-adapter-BgqpOOpd.js";
|
|
7
7
|
import { APIEvent, FetchEvent } from "@solidjs/start/server";
|
|
8
8
|
//#region src/solid-start/create.d.ts
|
|
9
9
|
/** The h3 event under every SolidStart request; `subject` and `scope` read it. */
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { l as InvalidSignatureError, p as webBotAuthVerifier, u as discoverViaSignatureAgent } from "../evaluations-
|
|
2
|
-
import { i as decorate } from "../bind-
|
|
3
|
-
import { n as guardedRoute, t as fetchAdapter } from "../fetch-adapter-
|
|
1
|
+
import { l as InvalidSignatureError, p as webBotAuthVerifier, u as discoverViaSignatureAgent } from "../evaluations-DG40eSJa.js";
|
|
2
|
+
import { i as decorate } from "../bind-BJFeLX1V.js";
|
|
3
|
+
import { n as guardedRoute, t as fetchAdapter } from "../fetch-adapter-UZOW0PRC.js";
|
|
4
4
|
//#region src/solid-start/create.ts
|
|
5
5
|
/**
|
|
6
6
|
* `event.locals`. Its type, `App.RequestEventLocals`, is declared by
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { _r as Principal, an as AuthEvent, rt as MembershipSource } from "./policy-types-IRJVABmm.js";
|
|
2
2
|
import { t as ClaimsMap } from "./claims-map-D1Pb5oRq.js";
|
|
3
3
|
import { t as ClientNames } from "./clients-C_NOET3z.js";
|
|
4
4
|
import { c as SupabaseManifestMembership } from "./manifest-B5yF3CIq.js";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { n as isReadonlyArray, r as isRecord, t as compact } from "./compact-CAf557ZB.js";
|
|
2
2
|
import { n as freezeDeep } from "./freeze-jjan0lCv.js";
|
|
3
3
|
import { n as isForbiddenKey, r as ownGet } from "./paths-CUvURzHp.js";
|
|
4
|
-
import {
|
|
4
|
+
import { d as assertSqlFunctionArg, f as assertSqlFunctionName, l as normalizeWhere, u as assertPortableTwin } from "./role-builder-BrmOcXch.js";
|
|
5
5
|
import { n as PermDockDeniedError } from "./errors-B6R_lg2a.js";
|
|
6
6
|
import { o as sameId } from "./expiry-6XByK0dm.js";
|
|
7
7
|
import { n as internalsOf } from "./internals-B3IgHrvo.js";
|
|
@@ -9,21 +9,23 @@ import { c as listPermissions, i as getRegistry, n as findPermission, o as isPer
|
|
|
9
9
|
import { n as isThenable$1 } from "./thenable-BNSM1U2R.js";
|
|
10
10
|
import { c as isEdgeRelation, m as restrictedStops, o as groupEntries, s as isComputedRelation, u as isPrincipalRelation } from "./resource-relations-8-pCScBO.js";
|
|
11
11
|
import { a as durationOf, f as nowMillis, g as secondsOf, m as rfc3339, p as nowSeconds } from "./time-nR1JesoH.js";
|
|
12
|
-
import {
|
|
13
|
-
import { u as
|
|
12
|
+
import { t as canonicalJson } from "./canonical-json-DwilZ1iB.js";
|
|
13
|
+
import { a as normalizeMembership$1, c as rootScope, d as scopeList, l as scopeChain, o as normalizeMemberships$1, p as tenantOf, s as resolveScope$1, u as scopeIdOf } from "./scopes-BSdYaGHs.js";
|
|
14
|
+
import { u as evaluateCondition } from "./delegation-aK4T_5WU.js";
|
|
14
15
|
import { _ as listPlans, a as authenticated, m as findRole, o as flattenGrantee } from "./grantee-Dke-9rd1.js";
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
16
|
+
import { a as normalizeApproval, r as assertApprovalRelations } from "./approval-normalize-4KxMRdJC.js";
|
|
17
|
+
import { m as tenantsOf, r as isMembershipExpired } from "./tenancy-DvOHHk3-.js";
|
|
18
|
+
import { c as levelNames, i as grantList, n as declaredRoleNames } from "./policy-DxQyHKPB.js";
|
|
19
|
+
import { o as isPortableCondition } from "./hosted-tPZnyjQS.js";
|
|
18
20
|
import { n as OPERATION_RISKS, r as isOperationRisk } from "./permissions-CVXmRILq.js";
|
|
19
|
-
import { C as tenantCustomRoles, S as roleAllowKeys, f as customRoleId, l as ceilingGrants, m as customRoleScope, p as customRoleOf, x as resolveCustomRole } from "./evaluate-
|
|
20
|
-
import { a as heldLevels, f as bindingOf, h as usesAssigns, m as roleMeta, n as snapshotScopes, o as collectSnapshotGrants, p as rankRoles, r as assignableCandidates, t as snapshotOf } from "./instance-snapshot-
|
|
21
|
+
import { C as tenantCustomRoles, S as roleAllowKeys, f as customRoleId, l as ceilingGrants, m as customRoleScope, p as customRoleOf, x as resolveCustomRole } from "./evaluate-CsjXeLRo.js";
|
|
22
|
+
import { a as heldLevels, f as bindingOf, h as usesAssigns, m as roleMeta, n as snapshotScopes, o as collectSnapshotGrants, p as rankRoles, r as assignableCandidates, t as snapshotOf } from "./instance-snapshot-BgOGtyCy.js";
|
|
21
23
|
import { n as relationId } from "./relations-BxvRvDHK.js";
|
|
22
|
-
import { i as snapshotGrant, r as plainPermission, t as buildSnapshot } from "./snapshot-
|
|
24
|
+
import { i as snapshotGrant, r as plainPermission, t as buildSnapshot } from "./snapshot-DN_8J27z.js";
|
|
23
25
|
import { n as LOCAL_CUSTOM_ROLE } from "./parse-local-manifest-DEiCF4ah.js";
|
|
24
|
-
import { c as APP, r as resolveSubject } from "./permdock-
|
|
25
|
-
import { i as memoryApprovalStore } from "./store-
|
|
26
|
-
import { n as wrapPermDock } from "./wrap-
|
|
26
|
+
import { c as APP, r as resolveSubject } from "./permdock-DdzMv5-F.js";
|
|
27
|
+
import { i as memoryApprovalStore } from "./store-XgBMbfDy.js";
|
|
28
|
+
import { n as wrapPermDock } from "./wrap-C5PWzgkq.js";
|
|
27
29
|
//#region src/conditions/sql-function.ts
|
|
28
30
|
function sqlFunction(name, options) {
|
|
29
31
|
assertSqlFunctionName(name);
|
|
@@ -395,8 +397,8 @@ function shorter(a, b) {
|
|
|
395
397
|
/**
|
|
396
398
|
* `code` with every matching entry added as further stages: the result needs
|
|
397
399
|
* all of them (`'sequential'` when any part is ordered), keeps the code's
|
|
398
|
-
* escalation, the shortest `ttl`, and `
|
|
399
|
-
* Without a matching entry, `code` unchanged.
|
|
400
|
+
* escalation, the shortest `ttl`, and `'authorize'` unless every part is
|
|
401
|
+
* `'confirm'`. Without a matching entry, `code` unchanged.
|
|
400
402
|
*/
|
|
401
403
|
function tightenApproval(code, entries, input) {
|
|
402
404
|
const extra = entries.filter((entry) => (entry.permission === void 0 || entry.permission === input.permission) && metaMatches(entry, input.operation) && matches(entry, input.tenant, input.subject, input.current, input.next, input.now, input.scopes));
|
|
@@ -405,7 +407,7 @@ function tightenApproval(code, entries, input) {
|
|
|
405
407
|
const stages = [];
|
|
406
408
|
const seen = /* @__PURE__ */ new Set();
|
|
407
409
|
let sequential = false;
|
|
408
|
-
let
|
|
410
|
+
let authorize = false;
|
|
409
411
|
let staleOn;
|
|
410
412
|
let ttl;
|
|
411
413
|
for (const [index, part] of parts.entries()) {
|
|
@@ -418,18 +420,18 @@ function tightenApproval(code, entries, input) {
|
|
|
418
420
|
}
|
|
419
421
|
}
|
|
420
422
|
if (part === "human") {
|
|
421
|
-
|
|
423
|
+
authorize = true;
|
|
422
424
|
continue;
|
|
423
425
|
}
|
|
424
|
-
sequential ||= part.
|
|
425
|
-
|
|
426
|
+
sequential ||= part.combine === "sequential";
|
|
427
|
+
authorize ||= part.mode !== "confirm";
|
|
426
428
|
staleOn ??= part.staleOn;
|
|
427
429
|
ttl = shorter(ttl, part.ttl);
|
|
428
430
|
}
|
|
429
431
|
return compact({
|
|
430
|
-
|
|
432
|
+
combine: sequential ? "sequential" : "all",
|
|
431
433
|
stages,
|
|
432
|
-
|
|
434
|
+
mode: authorize ? void 0 : "confirm",
|
|
433
435
|
staleOn,
|
|
434
436
|
ttl,
|
|
435
437
|
escalation: code === void 0 || code === "human" ? void 0 : code.escalation
|
|
@@ -819,6 +821,152 @@ function signPolicyDocument(document, signer, options) {
|
|
|
819
821
|
});
|
|
820
822
|
}
|
|
821
823
|
//#endregion
|
|
824
|
+
//#region src/core/instance-cache.ts
|
|
825
|
+
const MAX_AGE_CEILING_MS = 6e4;
|
|
826
|
+
const DEFAULT_MAX_AGE_MS = 5e3;
|
|
827
|
+
const DEFAULT_MAX_ENTRIES$1 = 1e4;
|
|
828
|
+
function roleKey(method, args) {
|
|
829
|
+
return `roles:${canonicalJson([method, ...args])}`;
|
|
830
|
+
}
|
|
831
|
+
function withoutMemo(context) {
|
|
832
|
+
if (context === void 0) return null;
|
|
833
|
+
const { memo: _memo, ...rest } = context;
|
|
834
|
+
return rest;
|
|
835
|
+
}
|
|
836
|
+
/**
|
|
837
|
+
* An in-process `InstanceCache`: a bounded LRU that shares builds in flight.
|
|
838
|
+
* Create it once at module scope and pass it as `instances` to every adapter of
|
|
839
|
+
* the app; adapters with the same sources and policy share entries.
|
|
840
|
+
*/
|
|
841
|
+
function instanceCache(options = {}) {
|
|
842
|
+
const maxAgeMs = Math.min(Math.max(Math.floor(options.maxAgeMs ?? DEFAULT_MAX_AGE_MS), 0), MAX_AGE_CEILING_MS);
|
|
843
|
+
const maxEntries = Math.max(Math.floor(options.maxEntries ?? DEFAULT_MAX_ENTRIES$1), 1);
|
|
844
|
+
const now = options.now ?? Date.now;
|
|
845
|
+
const entries = /* @__PURE__ */ new Map();
|
|
846
|
+
const inFlight = /* @__PURE__ */ new Map();
|
|
847
|
+
const byPrincipal = /* @__PURE__ */ new Map();
|
|
848
|
+
const ownerIds = /* @__PURE__ */ new WeakMap();
|
|
849
|
+
let nextOwner = 0;
|
|
850
|
+
const counts = {
|
|
851
|
+
builds: 0,
|
|
852
|
+
shared: 0,
|
|
853
|
+
hits: 0,
|
|
854
|
+
evictions: 0
|
|
855
|
+
};
|
|
856
|
+
const ownerId = (owner) => {
|
|
857
|
+
const known = ownerIds.get(owner);
|
|
858
|
+
if (known !== void 0) return known;
|
|
859
|
+
nextOwner += 1;
|
|
860
|
+
const id = nextOwner;
|
|
861
|
+
ownerIds.set(owner, id);
|
|
862
|
+
return id;
|
|
863
|
+
};
|
|
864
|
+
const forget = (id) => {
|
|
865
|
+
const entry = entries.get(id);
|
|
866
|
+
entries.delete(id);
|
|
867
|
+
if (entry?.principal !== void 0) byPrincipal.get(entry.principal)?.delete(id);
|
|
868
|
+
};
|
|
869
|
+
const store = (id, entry) => {
|
|
870
|
+
entries.delete(id);
|
|
871
|
+
entries.set(id, entry);
|
|
872
|
+
if (entry.principal !== void 0) {
|
|
873
|
+
const keys = byPrincipal.get(entry.principal) ?? /* @__PURE__ */ new Set();
|
|
874
|
+
keys.add(id);
|
|
875
|
+
byPrincipal.set(entry.principal, keys);
|
|
876
|
+
}
|
|
877
|
+
if (entries.size > maxEntries) {
|
|
878
|
+
const oldest = entries.keys().next();
|
|
879
|
+
if (oldest.done !== true) forget(oldest.value);
|
|
880
|
+
}
|
|
881
|
+
};
|
|
882
|
+
const through = (id, principal, build) => {
|
|
883
|
+
const at = now();
|
|
884
|
+
const entry = entries.get(id);
|
|
885
|
+
if (entry !== void 0 && at - entry.at <= maxAgeMs) {
|
|
886
|
+
counts.hits += 1;
|
|
887
|
+
store(id, entry);
|
|
888
|
+
return entry.value;
|
|
889
|
+
}
|
|
890
|
+
if (entry !== void 0) forget(id);
|
|
891
|
+
const pending = inFlight.get(id);
|
|
892
|
+
if (pending !== void 0) {
|
|
893
|
+
counts.shared += 1;
|
|
894
|
+
return pending;
|
|
895
|
+
}
|
|
896
|
+
counts.builds += 1;
|
|
897
|
+
const answer = build();
|
|
898
|
+
if (!isThenable$1(answer)) {
|
|
899
|
+
if (maxAgeMs > 0) store(id, {
|
|
900
|
+
value: answer,
|
|
901
|
+
at,
|
|
902
|
+
principal
|
|
903
|
+
});
|
|
904
|
+
return answer;
|
|
905
|
+
}
|
|
906
|
+
const started = Promise.resolve(answer).then((value) => {
|
|
907
|
+
if (inFlight.get(id) === started && maxAgeMs > 0) store(id, {
|
|
908
|
+
value,
|
|
909
|
+
at,
|
|
910
|
+
principal
|
|
911
|
+
});
|
|
912
|
+
return value;
|
|
913
|
+
});
|
|
914
|
+
inFlight.set(id, started);
|
|
915
|
+
const settle = () => {
|
|
916
|
+
if (inFlight.get(id) === started) inFlight.delete(id);
|
|
917
|
+
};
|
|
918
|
+
started.then(settle, settle);
|
|
919
|
+
return started;
|
|
920
|
+
};
|
|
921
|
+
return Object.freeze({
|
|
922
|
+
name: "memory",
|
|
923
|
+
maxAgeMs,
|
|
924
|
+
instance(key, owners, build) {
|
|
925
|
+
const id = `instance:${owners.map((owner) => typeof owner === "object" && owner !== null || typeof owner === "function" ? ownerId(owner) : 0).join(",")}:${canonicalJson([
|
|
926
|
+
key.principal,
|
|
927
|
+
key.version,
|
|
928
|
+
key.tenant ?? null,
|
|
929
|
+
key.intent,
|
|
930
|
+
key.parts
|
|
931
|
+
])}`;
|
|
932
|
+
return Promise.resolve(through(id, key.principal, build));
|
|
933
|
+
},
|
|
934
|
+
customRoles(source) {
|
|
935
|
+
const sourceId = ownerId(source);
|
|
936
|
+
const { globalRoles, sharedRoles, assignable } = source;
|
|
937
|
+
return Object.freeze({
|
|
938
|
+
...source.name === void 0 ? {} : { name: source.name },
|
|
939
|
+
rolesFor: (tenant, context) => through(roleKey(`${sourceId}:rolesFor`, [tenant, withoutMemo(context)]), void 0, () => source.rolesFor(tenant, context)),
|
|
940
|
+
...assignable === void 0 ? {} : { assignable: (tenant) => through(roleKey(`${sourceId}:assignable`, [tenant]), void 0, () => assignable.call(source, tenant)) },
|
|
941
|
+
...globalRoles === void 0 ? {} : { globalRoles: (context) => through(roleKey(`${sourceId}:globalRoles`, [withoutMemo(context)]), void 0, () => globalRoles.call(source, context)) },
|
|
942
|
+
...sharedRoles === void 0 ? {} : { sharedRoles: (context) => through(roleKey(`${sourceId}:sharedRoles`, [withoutMemo(context)]), void 0, () => sharedRoles.call(source, context)) }
|
|
943
|
+
});
|
|
944
|
+
},
|
|
945
|
+
entitlements(source) {
|
|
946
|
+
const sourceId = ownerId(source);
|
|
947
|
+
return Object.freeze({
|
|
948
|
+
...source.name === void 0 ? {} : { name: source.name },
|
|
949
|
+
entitlementsFor: (principal, scope) => through(`entitlements:${sourceId}:${canonicalJson([principal.id, scope.tenant ?? null])}`, principal.id, () => source.entitlementsFor(principal, scope))
|
|
950
|
+
});
|
|
951
|
+
},
|
|
952
|
+
evict(principal) {
|
|
953
|
+
counts.evictions += 1;
|
|
954
|
+
const keys = byPrincipal.get(principal);
|
|
955
|
+
byPrincipal.delete(principal);
|
|
956
|
+
for (const id of keys ?? []) {
|
|
957
|
+
entries.delete(id);
|
|
958
|
+
inFlight.delete(id);
|
|
959
|
+
}
|
|
960
|
+
},
|
|
961
|
+
stats() {
|
|
962
|
+
return {
|
|
963
|
+
...counts,
|
|
964
|
+
size: entries.size
|
|
965
|
+
};
|
|
966
|
+
}
|
|
967
|
+
});
|
|
968
|
+
}
|
|
969
|
+
//#endregion
|
|
822
970
|
//#region src/core/version-cache.ts
|
|
823
971
|
const MAX_STALE_CEILING_MS = 6e4;
|
|
824
972
|
const DEFAULT_MAX_ENTRIES = 1e4;
|
|
@@ -847,23 +995,6 @@ function memoryVersionCache(options) {
|
|
|
847
995
|
if (oldest.done !== true) entries.delete(oldest.value);
|
|
848
996
|
}
|
|
849
997
|
};
|
|
850
|
-
const observe = (principal, at) => {
|
|
851
|
-
const claimed = principal.authzVersion;
|
|
852
|
-
if (typeof claimed !== "number") return;
|
|
853
|
-
const issued = typeof principal.issuedAt === "number" ? principal.issuedAt * 1e3 : void 0;
|
|
854
|
-
const entry = entries.get(principal.id);
|
|
855
|
-
if (entry === void 0) {
|
|
856
|
-
if (issued !== void 0 && issued <= at && at - issued <= maxStaleMs) store(principal.id, {
|
|
857
|
-
version: claimed,
|
|
858
|
-
at: issued
|
|
859
|
-
});
|
|
860
|
-
return;
|
|
861
|
-
}
|
|
862
|
-
if (claimed > entry.version) store(principal.id, {
|
|
863
|
-
version: claimed,
|
|
864
|
-
at: issued === void 0 ? entry.at : Math.max(entry.at, issued)
|
|
865
|
-
});
|
|
866
|
-
};
|
|
867
998
|
const start = (id, read, at) => {
|
|
868
999
|
counts.reads += 1;
|
|
869
1000
|
const keep = (version) => {
|
|
@@ -892,7 +1023,6 @@ function memoryVersionCache(options) {
|
|
|
892
1023
|
current(principal, read, { live }) {
|
|
893
1024
|
const at = now();
|
|
894
1025
|
if (live) return start(principal.id, read, at);
|
|
895
|
-
observe(principal, at);
|
|
896
1026
|
const entry = entries.get(principal.id);
|
|
897
1027
|
if (entry !== void 0 && at - entry.at <= maxStaleMs) {
|
|
898
1028
|
counts.hits += 1;
|
|
@@ -906,6 +1036,24 @@ function memoryVersionCache(options) {
|
|
|
906
1036
|
}
|
|
907
1037
|
return start(principal.id, read, at);
|
|
908
1038
|
},
|
|
1039
|
+
seed(principal, version, at) {
|
|
1040
|
+
if (!Number.isFinite(version)) return;
|
|
1041
|
+
const current = now();
|
|
1042
|
+
const dated = at === void 0 ? current : nowMillis(at);
|
|
1043
|
+
if (dated > current) return;
|
|
1044
|
+
const entry = entries.get(principal);
|
|
1045
|
+
if (entry === void 0) {
|
|
1046
|
+
if (current - dated <= maxStaleMs) store(principal, {
|
|
1047
|
+
version,
|
|
1048
|
+
at: dated
|
|
1049
|
+
});
|
|
1050
|
+
return;
|
|
1051
|
+
}
|
|
1052
|
+
if (version > entry.version || version === entry.version && dated > entry.at) store(principal, {
|
|
1053
|
+
version,
|
|
1054
|
+
at: Math.max(entry.at, dated)
|
|
1055
|
+
});
|
|
1056
|
+
},
|
|
909
1057
|
evict(principal) {
|
|
910
1058
|
counts.evictions += 1;
|
|
911
1059
|
entries.delete(principal);
|
|
@@ -2140,4 +2288,4 @@ function toCsvRow(event) {
|
|
|
2140
2288
|
].map(field).join(",");
|
|
2141
2289
|
}
|
|
2142
2290
|
//#endregion
|
|
2143
|
-
export {
|
|
2291
|
+
export { defineOperations as A, limits as C, approvalPoliciesFor as D, approvalPolicies as E, memorySettingsSource as F, memorySnapshotSource as I, sqlFunction as L, memoryCustomRoleSource as M, memoryEntitlementSource as N, memoryApprovalPolicySource as O, memoryMembershipSource as P, memoryRelationSource as S, stripeEntitlementSource as T, arazzoFindings as _, normalizeMembership as a, instanceCache as b, crud as c, snapshotFor as d, customRoleSource as f, localSnapshotManifest as g, defineApp as h, decideRoleChange as i, isOperationEffect as j, validateApprovalPolicy as k, readable as l, shadowMode as m, toCsvRow as n, normalizeMemberships as o, mayAccess as p, checkRoleChange as r, resolveScope as s, CSV_COLUMNS as t, writable as u, simulateArazzo as v, memoryLimitStore as w, signPolicyDocument as x, memoryVersionCache as y };
|