permdock 0.35.1 → 0.36.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 +1 -1
- package/dist/a2a/index.js +2 -2
- package/dist/{adoption-scan-B_jVJgMK.js → adoption-scan-FcbJOEo1.js} +1 -1
- package/dist/agent/index.d.ts +1 -1
- package/dist/agent/index.js +1 -1
- package/dist/ai-sdk/index.d.ts +1 -1
- package/dist/ai-sdk/index.js +3 -3
- package/dist/app/index.d.ts +1 -1
- package/dist/app/index.js +1 -1
- package/dist/approvals/index.d.ts +1 -1
- package/dist/{arazzo-D-fDq8Dv.js → arazzo-BRWgVc8j.js} +1 -1
- package/dist/{arazzo-CKsNFj_5.js → arazzo-rYG2UY9k.js} +2 -2
- package/dist/astro/index.d.ts +3 -3
- package/dist/astro/index.js +1 -1
- package/dist/authzen/index.d.ts +3 -3
- package/dist/authzen/index.js +1 -1
- package/dist/better-supabase/index.d.ts +13 -4
- package/dist/better-supabase/index.js +8 -8
- package/dist/{bind-DPptdk31.js → bind-2Cuy29LS.js} +2 -2
- package/dist/{bind-BnrOLyJq.d.ts → bind-Caffleoh.d.ts} +5 -5
- package/dist/{bsb-access-tags-1oVQZWKp.js → bsb-access-tags-Bfmhft2o.js} +1 -1
- package/dist/{bsb-action-keys-BfZAwg-9.js → bsb-action-keys-LgveZiHJ.js} +2 -2
- package/dist/{bsb-actions-BHiyBxQZ.js → bsb-actions-DcDxQ_Ku.js} +3 -3
- package/dist/{budgets-hi-ecgEd.js → budgets-B2hIDaz7.js} +2 -2
- package/dist/{build-instance-DZEWYO-A.js → build-instance-CZg_Bf45.js} +1 -1
- package/dist/{bundle-size-DbXV65Ix.js → bundle-size-BjdmlKWJ.js} +2 -2
- package/dist/bundle-size-BoG9Jm7c.js +1 -0
- package/dist/{casbin-CWfeuRmI.js → casbin-4FACZ5Ez.js} +1 -1
- package/dist/{casbin-DqiTIceJ.js → casbin-Cz8BGXHW.js} +1 -1
- package/dist/{catalog-CBPFyRv7.js → catalog-DYC6wfAj.js} +1 -1
- package/dist/{catalog-BExjL94D.js → catalog-SnaPhbZ1.js} +2 -2
- package/dist/{catalog-doc-D4g3nyFB.js → catalog-doc-BX97oFAn.js} +1 -1
- package/dist/catalog-e6QRd1JP.js +1 -0
- package/dist/chat/index.d.ts +1 -1
- package/dist/chat/index.js +1 -1
- package/dist/chat-sdk/index.d.ts +1 -1
- package/dist/claude-agent/index.d.ts +2 -2
- package/dist/claude-agent/index.js +2 -2
- package/dist/clerk/index.d.ts +1 -1
- package/dist/cli/bin.js +1 -1
- package/dist/cli/generate/watch-worker.js +1 -1
- package/dist/cli/index.js +1 -1
- package/dist/cli/plugins/app.js +1 -1
- package/dist/cli/plugins/openapi.js +1 -1
- package/dist/cli/plugins/powersync.js +1 -1
- package/dist/cli/plugins/rls.js +1 -1
- package/dist/cli/plugins/schemas.js +1 -1
- package/dist/cli/plugins/supabase-hook.js +1 -1
- package/dist/cli/plugins/supabase.js +2 -2
- package/dist/cli/plugins/ui.js +1 -1
- package/dist/{cloud-CvA_LeOt.js → cloud-BB67klb4.js} +2 -2
- package/dist/{codemod-DduTfuWM.js → codemod-BPcxGOlq.js} +5 -5
- package/dist/{codemod-CA0MQoG4.js → codemod-Lov9764v.js} +1 -1
- package/dist/collect-C2_CKZ09.js +1 -0
- package/dist/{collect-Ba7ccZ23.js → collect-CcE8QBtZ.js} +2 -2
- package/dist/{collect-CPimbkC5.js → collect-Co-w8Eg2.js} +1 -1
- package/dist/compile/index.d.ts +1 -1
- package/dist/{compile-CoUadQXF.d.ts → compile-CyUn58lf.d.ts} +1 -1
- package/dist/{compile-D-BULiHE.js → compile-EtZv2wc0.js} +6 -6
- package/dist/{completion-DXdFnwLY.js → completion-5Y8toe1d.js} +1 -1
- package/dist/{config-BWYfHYvW.js → config-DfbiV554.js} +1 -1
- package/dist/{config-report-pg-66Bdr.js → config-report-Cs6iDebE.js} +2 -2
- package/dist/{context-rioF4fQl.js → context-CFPsmfPl.js} +1 -1
- package/dist/convex/index.d.ts +2 -2
- package/dist/convex/index.js +2 -2
- package/dist/{core-DCMIztx1.d.ts → core-_Lofwt2K.d.ts} +1 -1
- package/dist/{core-DIUrkFNL.js → core-s_TCdJ6G.js} +2 -2
- package/dist/{create-BYL8xCJB.d.ts → create-BfTbYrts.d.ts} +1 -1
- package/dist/{create-T_NqxU31.d.ts → create-D12I1Vkl.d.ts} +4 -4
- package/dist/{create-BMRnaZel.js → create-D6B06lb8.js} +3 -3
- package/dist/{create-iCwrnaFE.d.ts → create-EPbgV-LA.d.ts} +2 -2
- package/dist/{create-BRY0OtFV.js → create-bbjS7tCW.js} +2 -2
- package/dist/{credentials-DzNrCNZY.d.ts → credentials-DtSnydoD.d.ts} +1 -1
- package/dist/{custom-role-rebuild-wzN8pqDk.js → custom-role-rebuild-QFXiMHqJ.js} +1 -1
- package/dist/{define-permdock-CO7YNrOF.js → define-permdock-Dazve5lw.js} +1 -1
- package/dist/{define-permdock-Bhye7WSY.d.ts → define-permdock-ZR0w-Loy.d.ts} +3 -3
- package/dist/delivery/index.d.ts +1 -1
- package/dist/{diff-CkSZF7LO.js → diff-BABnQ-z0.js} +3 -3
- package/dist/{diff-CS8ks9h3.js → diff-C7zKA7ny.js} +1 -1
- package/dist/{doctor-Cs0Xl46A.js → doctor-Chio5Col.js} +101 -31
- package/dist/{doctor-B55XfWdG.js → doctor-Cm1HDI5s.js} +2 -2
- package/dist/drizzle/index.d.ts +2 -2
- package/dist/elysia/index.d.ts +3 -3
- package/dist/elysia/index.js +1 -1
- package/dist/{evaluations-CUkSKioS.d.ts → evaluations-BYoj5ci6.d.ts} +1 -1
- package/dist/eve/index.d.ts +2 -2
- package/dist/eve/index.js +2 -2
- package/dist/{execute-Vfo2CAhv.js → execute-B_yY9xWV.js} +4 -4
- package/dist/{explain-DISCeeYS.js → explain-Blkq60Ff.js} +2 -2
- package/dist/{explain-D4ipf8IH.js → explain-CKIqxXSe.js} +1 -1
- package/dist/express/index.d.ts +3 -3
- package/dist/express/index.js +1 -1
- package/dist/fastify/index.d.ts +3 -3
- package/dist/fastify/index.js +1 -1
- package/dist/{fetch-adapter-Ds2-fUUi.d.ts → fetch-adapter-CdaSVKrt.d.ts} +2 -2
- package/dist/{fetch-adapter-BXQc4NoV.js → fetch-adapter-DXgza6EM.js} +1 -1
- package/dist/{fields-CwFej4gp.js → fields-CKX-qjWb.js} +1 -1
- package/dist/gen-CYuPbpBZ.js +1 -0
- package/dist/{gen-M_5UU5Ck.js → gen-DlJK73v7.js} +4 -4
- package/dist/{gen-kind-DLz0P-TB.js → gen-kind-C4tERYMw.js} +1 -1
- package/dist/{generate-CNkkKAL-.js → generate-CFqcr3H6.js} +94 -15
- package/dist/{generate-GCDLA8vW.js → generate-CbLA2WW_.js} +3 -3
- package/dist/{generate-options-O3mVjjcG.js → generate-options-BFAvlJKQ.js} +9 -9
- package/dist/h3/index.d.ts +3 -3
- package/dist/h3/index.js +2 -2
- package/dist/{helper-calls-B5MOl99d.js → helper-calls-DN1PJcNY.js} +53 -1
- package/dist/hono/index.d.ts +3 -3
- package/dist/hono/index.js +1 -1
- package/dist/{hook-sql-y0CJBLJr.js → hook-sql-CSUFnRn0.js} +283 -13
- package/dist/{import-CQSJ6xcN.js → import-B-17dw3B.js} +1 -1
- package/dist/{import-Bz6IKoMM.js → import-wBO24zgo.js} +1 -1
- package/dist/{index-Cjr8Q-uq.d.ts → index-Bb2sZq1K.d.ts} +8 -7
- package/dist/{index-CWBCzwOp.d.ts → index-CT4VKXU-.d.ts} +1 -1
- package/dist/{index-ktQ7E4qB.d.ts → index-Cfg0ED9K.d.ts} +2 -2
- package/dist/{index-BOJPdIBk.d.ts → index-DY1aJ-K1.d.ts} +1 -1
- package/dist/index.d.ts +4 -4
- package/dist/index.js +2 -2
- package/dist/{init-BucxAxRw.js → init-Bg0vS1LV.js} +1 -1
- package/dist/{init-Cfb0VX3T.js → init-DRbkPclr.js} +3 -3
- package/dist/{inspect-functions-CzrQtRDb.js → inspect-functions-DLP72IMA.js} +1 -1
- package/dist/{instance-options-DDERlopm.d.ts → instance-options-D-SLCp4I.d.ts} +1 -1
- package/dist/{interactive-only-Bbq9e61G.js → interactive-only-CylKSukS.js} +1 -1
- package/dist/{kernel-DSnWVZ0O.js → kernel-CzzmzwLg.js} +3 -3
- package/dist/{keys-BWhAnANj.js → keys-C-W0yrql.js} +1 -1
- package/dist/kysely/index.d.ts +2 -2
- package/dist/{lazy-provider-Clt2095H.d.ts → lazy-provider-BSHAIpMK.d.ts} +1 -1
- package/dist/{login-qYcM0hKh.js → login-D6IJk8k1.js} +1 -1
- package/dist/{login-CU89mk0U.js → login-yF-sDNm9.js} +3 -3
- package/dist/{manifest-Bu9gUrI0.js → manifest-DkHIGPoY.js} +63 -52
- package/dist/{manifest-schema-N3v2RVL-.js → manifest-schema-CkROwfT9.js} +1 -1
- package/dist/{manifest-CIWOmdlP.js → manifest-teSfgeqF.js} +1 -1
- package/dist/mcp/index.d.ts +3 -3
- package/dist/mcp/index.js +2 -2
- package/dist/{measure-C_Z0a7B8.js → measure-_VlSPfSY.js} +2 -2
- package/dist/{memberships-CNoAlsma.js → memberships-CDiSsFTu.js} +1 -1
- package/dist/{memberships-4e6qi8Uv.js → memberships-DiCbNRny.js} +1 -1
- package/dist/{model-BYCtXS_g.js → model-r7X_HXyS.js} +2 -2
- package/dist/{names-DBxKx2bz.js → names-DwGleRKB.js} +3 -3
- package/dist/nest/index.d.ts +3 -3
- package/dist/nest/index.js +1 -1
- package/dist/next/index.d.ts +6 -6
- package/dist/next/index.js +3 -3
- package/dist/next/plugin.js +1 -1
- package/dist/node/index.d.ts +3 -3
- package/dist/node/index.js +1 -1
- package/dist/openai/index.d.ts +2 -2
- package/dist/openai/index.js +3 -3
- package/dist/{openapi-DIhS8iHN.js → openapi-D156UqcM.js} +100 -5
- package/dist/{openapi-ZIlGKUwQ.js → openapi-Dcqqja0n.js} +1 -1
- package/dist/{openapi-document-D5IhoJo0.js → openapi-document-CTvHkCXz.js} +1 -1
- package/dist/orpc/index.d.ts +4 -4
- package/dist/orpc/index.js +2 -2
- package/dist/otel/index.d.ts +2 -2
- package/dist/{output-DIjUJioq.js → output-DNbj0_Yi.js} +1 -1
- package/dist/{ownership-Bmt-z0rF.js → ownership-BvKT4DBj.js} +3 -3
- package/dist/pdp/index.d.ts +2 -2
- package/dist/pdp/index.js +1 -1
- package/dist/{permdock-DkvkGVF0.d.ts → permdock-CHU1LZGq.d.ts} +5 -3
- package/dist/{permdock-JM9TKevZ.js → permdock-DZmr2kJw.js} +2 -1
- package/dist/{permissions-xPyAmuXi.js → permissions-DUmypTlO.js} +1 -1
- package/dist/{pipeline-BAGSNnct.js → pipeline-BMbLI2Sj.js} +2 -2
- package/dist/{policy-D8RxFeZO.js → policy-DekUQ-6v.js} +1 -1
- package/dist/{policy-bundle-DC_xq2R5.js → policy-bundle-JU4-AFJM.js} +3 -3
- package/dist/{powersync-CgCMKvaU.js → powersync-CpxkK_Lz.js} +1 -1
- package/dist/{powersync-BlfO3_jN.js → powersync-D9ZLDzyv.js} +1 -1
- package/dist/{powersync-CiQ97gzz.js → powersync-cG4lxrzQ.js} +8 -8
- package/dist/prisma/index.d.ts +1 -1
- package/dist/{protected-action-gBxeetqY.d.ts → protected-action-Dux5RJbA.d.ts} +3 -3
- package/dist/{provider-Clt2095H.d.ts → provider-BSHAIpMK.d.ts} +1 -1
- package/dist/{provider-BwqzED5h.js → provider-BfKUBNyV.js} +32 -5
- package/dist/{prune-config-CbhJ_XvD.js → prune-config-ByigsAkl.js} +4 -4
- package/dist/{pull-DLyCr-7L.js → pull-4Cyo0uTS.js} +3 -3
- package/dist/pull-_ic7Md2h.js +1 -0
- package/dist/{push-D5so0ptb.js → push-Br0Uz5pT.js} +2 -2
- package/dist/{rbac-DbyaaNLa.js → rbac-BOVyTCI6.js} +3 -3
- package/dist/react/index.d.ts +4 -4
- package/dist/react/lazy.d.ts +4 -4
- package/dist/react/provider-client-lazy.d.ts +1 -1
- package/dist/react/provider-client.d.ts +1 -1
- package/dist/react-native/index.d.ts +4 -4
- package/dist/{rename-CI6NIF9t.js → rename-Dp47Gs_j.js} +2 -2
- package/dist/{report-DF0zUNut.js → report-Dp-ApWVC.js} +1 -1
- package/dist/{report-XdCm1y_J.js → report-x9GeUvjx.js} +1 -1
- package/dist/{request-context-CqqdiVp4.js → request-context-LvIolknK.js} +1 -1
- package/dist/{resolve-names-BR6PiCrx.js → resolve-names-B_no27Dh.js} +4 -4
- package/dist/{resolver-D2c1CcoZ.js → resolver-CAmmdVAL.js} +22 -11
- package/dist/{rls-CdQW7v9D.js → rls-C816Uuvx.js} +5 -5
- package/dist/{rls-BfUIMNeV.js → rls-DB18scnl.js} +13 -12
- package/dist/{rls-files-68-nKfmG.js → rls-files-Cp-qzl61.js} +1 -1
- package/dist/{row-conditions-DwIJocfQ.js → row-conditions-BjARoFLU.js} +1 -1
- package/dist/{rpc-BYFB37KV.d.ts → rpc-CL8lrV5Y.d.ts} +1 -1
- package/dist/{rpc-BQPa7tLP.js → rpc-CoClxzcc.js} +1 -1
- package/dist/{run-B2Axta4z.js → run-CJhz8BHw.js} +2 -2
- package/dist/run-PpoUQXDc.js +1 -0
- package/dist/{run-ticket-CRldclc7.d.ts → run-ticket-CCRYQNj0.d.ts} +1 -1
- package/dist/{saas-DSeazNrN.js → saas-iXqf78G8.js} +2 -2
- package/dist/{scan-DNzOELYT.js → scan-DvM-_F8-.js} +1 -1
- package/dist/{schema-CJc23R4a.js → schema-uTRr3B9f.js} +1 -1
- package/dist/server/index.d.ts +5 -5
- package/dist/server/index.js +1 -1
- package/dist/{server-types-FkdDSB9h.d.ts → server-types-C_Lnc8Ec.d.ts} +5 -5
- package/dist/{size-CY6rK6l9.js → size-BO7J8M3B.js} +2 -2
- package/dist/{skills-DTpSMQRg.js → skills-B5exEJf5.js} +1 -1
- package/dist/{skills-TqrLrmuv.js → skills-DF_3nX9_.js} +1 -1
- package/dist/{snapshot-size-D6ixbYvH.js → snapshot-size-BzamcZrn.js} +1 -1
- package/dist/{snapshot-size-NklqBKcV.js → snapshot-size-CJ53OOen.js} +1 -1
- package/dist/solid/index.d.ts +2 -2
- package/dist/solid-start/index.d.ts +3 -3
- package/dist/solid-start/index.js +2 -2
- package/dist/{src-BXDohWNO.js → src-CYKqpYUM.js} +4 -4
- package/dist/{store-core-aluQ3R1M.d.ts → store-core-D5-cqb6z.d.ts} +1 -1
- package/dist/{stores-hHICuiQl.d.ts → stores-DPUPLu29.d.ts} +3 -3
- package/dist/supabase/index.d.ts +2 -2
- package/dist/supabase/index.js +3 -3
- package/dist/supabase/middleware.d.ts +4 -4
- package/dist/supabase/middleware.js +3 -3
- package/dist/{supabase-MitbozF6.js → supabase-Dpy2XE9v.js} +2 -2
- package/dist/{supabase-ByhSqBDB.js → supabase-NpHqrRXC.js} +2 -2
- package/dist/supabase-hook-DaK4Rirh.js +2 -0
- package/dist/{supabase-hook-RFLW2YPX.js → supabase-hook-VIpXUHKI.js} +5 -5
- package/dist/{supabase-schemas-CVhpyYB6.js → supabase-schemas-DA28GP4N.js} +1 -1
- package/dist/{supautils-C85NuESf.js → supautils-ym4X20ig.js} +2 -1
- package/dist/svelte/index.d.ts +3 -3
- package/dist/svelte/runtime.d.ts +2 -2
- package/dist/svelte/source.d.ts +3 -3
- package/dist/sveltekit/index.d.ts +3 -3
- package/dist/sveltekit/index.js +1 -1
- package/dist/{table-reads-Dso5UyeT.js → table-reads-4KzGXg9f.js} +1 -1
- package/dist/{table-reads-D0M_X-pj.js → table-reads-B5kunhny.js} +3 -3
- package/dist/{tables-DrrGtayG.js → tables-BwQvlpS4.js} +4 -4
- package/dist/tanstack-start/index.d.ts +3 -3
- package/dist/tanstack-start/index.js +1 -1
- package/dist/{tenant-check-D6fnfQBP.js → tenant-check-CsJkduIb.js} +3 -3
- package/dist/terminal/index.d.ts +2 -2
- package/dist/terminal/index.js +2 -2
- package/dist/testing/core.d.ts +1 -1
- package/dist/testing/core.js +1 -1
- package/dist/testing/fixtures/index.js +1753 -162
- package/dist/testing/index.d.ts +7 -7
- package/dist/testing/index.js +6 -6
- package/dist/testing/saas/index.d.ts +1 -1
- package/dist/testing/saas/index.js +2 -2
- package/dist/testing/saas/permissions.js +1 -1
- package/dist/trpc/index.d.ts +4 -4
- package/dist/trpc/index.js +2 -2
- package/dist/{types-DRMoZjJm.d.ts → types-B23A72BG.d.ts} +1 -1
- package/dist/{types-D417woMp.d.ts → types-BRaJxlqL.d.ts} +2 -2
- package/dist/{types-CBUYbPwl.d.ts → types-C8sDUhaF.d.ts} +1 -1
- package/dist/{types-dtDg4goh.d.ts → types-CM5GwxiJ.d.ts} +2 -2
- package/dist/{types-BzsplNgO.d.ts → types-iwSmOTcK.d.ts} +2 -2
- package/dist/unplugin/index.js +1 -1
- package/dist/{usage-DBaJfCZB.js → usage-BD_z4pba.js} +1 -1
- package/dist/{usage-Cv4WDRWv.js → usage-_9h9jQo8.js} +4 -4
- package/dist/usage-wphGxzPQ.js +1 -0
- package/dist/{verify-DT9WS_Gm.js → verify-cw6SFoQE.js} +9 -9
- package/dist/vue/index.d.ts +2 -2
- package/dist/{warm-BZ0ZwSmO.js → warm-XyQ-2nUR.js} +1 -1
- package/dist/watch-5WP3ZCcR.js +1 -0
- package/dist/{watch-14vng0pg.js → watch-BFDMb5N4.js} +1 -1
- package/dist/{watch-DuIAsqFR.js → watch-Cvc7eUPk.js} +2 -2
- package/dist/workflow/index.d.ts +1 -1
- package/dist/workflow/index.js +1 -1
- package/dist/workflow-sdk/index.d.ts +2 -2
- package/dist/{wrap-C36-eV-C.d.ts → wrap-B4Ge6LOd.d.ts} +1 -1
- package/package.json +1 -1
- package/schemas/supabase-manifest-v1.json +1 -1
- package/dist/bundle-size-BRFeBvuv.js +0 -1
- package/dist/catalog-sR0m6x2g.js +0 -1
- package/dist/collect-CIdE3FGC.js +0 -1
- package/dist/gen-vr1udb1p.js +0 -1
- package/dist/pull-IQPhpX4y.js +0 -1
- package/dist/run-CfvcMtPK.js +0 -1
- package/dist/supabase-hook-DZk7PV7Z.js +0 -2
- package/dist/usage-DOcCnIdW.js +0 -1
- package/dist/watch-Be7ja4dL.js +0 -1
|
@@ -15,17 +15,17 @@ import { n as GRANTS_MARKER, r as HOOK_MARKER } from "./markers-C-kThnKN.js";
|
|
|
15
15
|
import { a as quoteIdent, c as quoteTable, i as qualified$1, o as quoteLiteral, s as quoteQualified } from "./quote-LNaBdCGA.js";
|
|
16
16
|
import "./output-files-8lfALMSU.js";
|
|
17
17
|
import { m as splitUndiffed } from "./ast-Dnm2TOHN.js";
|
|
18
|
-
import { c as ACTOR_MAY_WRITE, p as readOnlyActorKinds } from "./fields-
|
|
18
|
+
import { c as ACTOR_MAY_WRITE, p as readOnlyActorKinds } from "./fields-CKX-qjWb.js";
|
|
19
19
|
import { C as tenantTypeOf, S as sqlType, f as subjectIdSql, n as USER_ID_HELPER, w as userTypeOf, x as scopeTypeOf, y as firstScopeType } from "./subject-B7p94Y0s.js";
|
|
20
20
|
import { a as customRolesOn, r as HELPERS, t as CUSTOM_ROLES } from "./shared-DnVY767H.js";
|
|
21
|
-
import { G as activeRowSql, N as globalRoleSource, a as interactiveOnlyKeys, q as checkSuspension, t as INTERACTIVE_ALLOWS } from "./interactive-only-
|
|
22
|
-
import { f as memberForHelper, g as memberOfHelper, h as memberIdsHelper, t as BOOTSTRAP_PERMISSIONS, u as isTeamScope, v as permittedForHelper, y as permittedIdsHelper } from "./names-
|
|
23
|
-
import { G as hookTeamReader, K as hookTeamsHelper, M as tokenScopesOn, O as TOKEN_SCOPE_ALLOWS, R as API_KEY_ALLOWS, V as apiKeyFields, W as HOOK_TEAM_READER, b as ASSIGNMENTS, d as permittedByPermissionHelper, l as permissionKeysForHelper, o as PERMISSION_HELPERS, s as checkName, x as OWNERSHIP } from "./tables-
|
|
24
|
-
import { r as permittedUsersHelper, t as resolveNames } from "./resolve-names-
|
|
25
|
-
import { a as resolveAuthorize, n as hookUri, t as authAdminRead } from "./rbac-
|
|
26
|
-
import { a as guardedTables, t as ownershipRules } from "./ownership-
|
|
21
|
+
import { G as activeRowSql, N as globalRoleSource, a as interactiveOnlyKeys, q as checkSuspension, t as INTERACTIVE_ALLOWS } from "./interactive-only-CylKSukS.js";
|
|
22
|
+
import { f as memberForHelper, g as memberOfHelper, h as memberIdsHelper, t as BOOTSTRAP_PERMISSIONS, u as isTeamScope, v as permittedForHelper, y as permittedIdsHelper } from "./names-DwGleRKB.js";
|
|
23
|
+
import { G as hookTeamReader, K as hookTeamsHelper, M as tokenScopesOn, O as TOKEN_SCOPE_ALLOWS, R as API_KEY_ALLOWS, V as apiKeyFields, W as HOOK_TEAM_READER, b as ASSIGNMENTS, d as permittedByPermissionHelper, l as permissionKeysForHelper, o as PERMISSION_HELPERS, s as checkName, x as OWNERSHIP } from "./tables-BwQvlpS4.js";
|
|
24
|
+
import { r as permittedUsersHelper, t as resolveNames } from "./resolve-names-B_no27Dh.js";
|
|
25
|
+
import { a as resolveAuthorize, n as hookUri, t as authAdminRead } from "./rbac-BOVyTCI6.js";
|
|
26
|
+
import { a as guardedTables, t as ownershipRules } from "./ownership-BvKT4DBj.js";
|
|
27
27
|
import { a as REQUEST_APPROVER_IDS, c as MANAGES, d as checkedManagers, l as MANAGES_FOR, o as approvalChainSql, p as managerEdges, s as APPROVES, u as approvalManagersSql } from "./approval-chain-BEeExHpb.js";
|
|
28
|
-
import { a as hookMemberships, c as typedSourceUsers, i as entriesSql, l as typedUsers, n as activeSource, o as memberForPlan, r as checkSources, s as positiveInteger, t as activeFromSql } from "./memberships-
|
|
28
|
+
import { a as hookMemberships, c as typedSourceUsers, i as entriesSql, l as typedUsers, n as activeSource, o as memberForPlan, r as checkSources, s as positiveInteger, t as activeFromSql } from "./memberships-CDiSsFTu.js";
|
|
29
29
|
import { r as tableKey, t as decidingColumns } from "./deciding-columns-DBZsrpdD.js";
|
|
30
30
|
// src/cli/claims-schema.ts
|
|
31
31
|
/**
|
|
@@ -987,6 +987,264 @@ function customRolesOfSql(parts, tenantType) {
|
|
|
987
987
|
) v
|
|
988
988
|
where v.tenant is not null;`;
|
|
989
989
|
}
|
|
990
|
+
// src/cli/rls/approval-request-ids.ts
|
|
991
|
+
/**
|
|
992
|
+
* The approver check as a set: the ids of the requests the caller may approve,
|
|
993
|
+
* each decided as better-supabase's `isApprover` template decides it.
|
|
994
|
+
*/
|
|
995
|
+
const APPROVER_REQUEST_IDS = "permdock_approver_request_ids";
|
|
996
|
+
/**
|
|
997
|
+
* The approver check over facts read once; only `permdock_approver_request_ids`
|
|
998
|
+
* calls it.
|
|
999
|
+
*/
|
|
1000
|
+
const APPROVER_MATCHES = "permdock_approver_matches";
|
|
1001
|
+
/**
|
|
1002
|
+
* The most requests one `permdock_approver_request_ids` call takes; a longer
|
|
1003
|
+
* `p_requests` raises `54000`, so one call never walks an unbounded array.
|
|
1004
|
+
*/
|
|
1005
|
+
const MAX_APPROVER_REQUESTS = 5e3;
|
|
1006
|
+
/** The function `rls.approvals.delegations` writes for a cover's own rights. */
|
|
1007
|
+
const COVER_APPROVES = "permdock_cover_approves";
|
|
1008
|
+
/**
|
|
1009
|
+
* `permdock_approver_request_ids(p_requests jsonb, p_kinds jsonb, p_current
|
|
1010
|
+
* boolean default false)`: the `id` of every element of `p_requests` (`{ id,
|
|
1011
|
+
* kind, tenant, requester, approvers }`, the placeholders of better-supabase's
|
|
1012
|
+
* `isApprover`) whose request the signed-in user may approve. `p_kinds` maps a
|
|
1013
|
+
* kind to its approvers, and `p_current` passes each element's `approvers`, as
|
|
1014
|
+
* the provider's `approvers` and `requestApprovers` options do. An element
|
|
1015
|
+
* answers as `permdock_is_approver` does for it, but the caller's `holder()`,
|
|
1016
|
+
* manager and cover facts are read once per call, not once per request. A
|
|
1017
|
+
* policy or a set query calls it uncorrelated, so Postgres runs it once per
|
|
1018
|
+
* statement. More than `MAX_APPROVER_REQUESTS` elements raise `54000`, and a
|
|
1019
|
+
* `p_kinds` entry under the empty kind matches nothing.
|
|
1020
|
+
*/
|
|
1021
|
+
function approverRequestIdsSql(ctx, options) {
|
|
1022
|
+
const fn = qualified$1(ctx, APPROVER_REQUEST_IDS);
|
|
1023
|
+
const covering = options.managers || options.delegations;
|
|
1024
|
+
const approvers = covering ? `case when p_current then
|
|
1025
|
+
jsonb_build_object(
|
|
1026
|
+
'kind', 'any-of',
|
|
1027
|
+
'of',
|
|
1028
|
+
case when r.approvers is null then '[]'::jsonb else jsonb_build_array(r.approvers) end
|
|
1029
|
+
|| case
|
|
1030
|
+
when jsonb_typeof(r.current -> 'users') = 'array' then coalesce(
|
|
1031
|
+
(select jsonb_agg(jsonb_build_object('kind', 'user', 'id', u.id)) from jsonb_array_elements_text(r.current -> 'users') u(id)),
|
|
1032
|
+
'[]'::jsonb
|
|
1033
|
+
)
|
|
1034
|
+
else '[]'::jsonb
|
|
1035
|
+
end
|
|
1036
|
+
|| case when r.current -> 'manager' = 'true'::jsonb then '[{"kind": "manager"}]'::jsonb else '[]'::jsonb end
|
|
1037
|
+
|| case
|
|
1038
|
+
when jsonb_typeof(r.current -> 'permission') = 'string'
|
|
1039
|
+
then jsonb_build_array(jsonb_build_object('kind', 'permission', 'permission', r.current ->> 'permission'))
|
|
1040
|
+
else '[]'::jsonb
|
|
1041
|
+
end
|
|
1042
|
+
)
|
|
1043
|
+
else r.approvers end` : "r.approvers";
|
|
1044
|
+
const kept = covering ? "r.listed or p_current" : "r.listed";
|
|
1045
|
+
const listed = `jsonb_typeof(p_kinds) = 'object' and e ->> 'kind' <> '' and p_kinds ? (e ->> 'kind')`;
|
|
1046
|
+
const resource = `case when strpos(e ->> 'kind', '.') > 1 then split_part(e ->> 'kind', '.', 1) else e ->> 'kind' end`;
|
|
1047
|
+
const matches = qualified$1(ctx, APPROVER_MATCHES);
|
|
1048
|
+
const root = ctx.scopes[0]?.name;
|
|
1049
|
+
const user = userTypeOf(ctx);
|
|
1050
|
+
const managerCase = options.managers ? `
|
|
1051
|
+
when 'manager' then
|
|
1052
|
+
v_levels := coalesce(p_approvers -> 'levels', '1'::jsonb);
|
|
1053
|
+
if jsonb_typeof(v_levels) <> 'number' or v_levels::text !~ '^[0-9]{1,2}$' then
|
|
1054
|
+
return false;
|
|
1055
|
+
end if;
|
|
1056
|
+
return coalesce((p_facts -> 'manages' ->> jsonb_build_array(p_requester, p_tenant, v_levels::text::integer)::text)::boolean, false);` : "";
|
|
1057
|
+
const tenantFacts = root === void 0 ? "'{}'::jsonb" : `(
|
|
1058
|
+
select coalesce(jsonb_object_agg(p.permission, (
|
|
1059
|
+
select coalesce(jsonb_agg(i.id::text), '[]'::jsonb)
|
|
1060
|
+
from ${qualified$1(ctx, checkName(permittedByPermissionHelper(root)))}(p.permission) i(id)
|
|
1061
|
+
)), '{}'::jsonb)
|
|
1062
|
+
from (select distinct l.permission from leaves l where l.within is not null and l.permission is not null) p
|
|
1063
|
+
)`;
|
|
1064
|
+
const managerLeaves = options.managers ? `,
|
|
1065
|
+
managers as (
|
|
1066
|
+
select distinct r ->> 'requester' as requester, r ->> 'within' as within, coalesce(l -> 'levels', '1'::jsonb) as levels
|
|
1067
|
+
from jsonb_array_elements(v_requests) r, jsonb_path_query(r -> 'approvers', 'strict $.** ? (@.kind == "manager")') l
|
|
1068
|
+
)` : "";
|
|
1069
|
+
const managerFacts = options.managers ? `,
|
|
1070
|
+
'manages', (
|
|
1071
|
+
select coalesce(jsonb_object_agg(
|
|
1072
|
+
jsonb_build_array(m.requester, m.within, m.levels::text::integer)::text,
|
|
1073
|
+
coalesce(${qualified$1(ctx, MANAGES_FOR)}(v_user, m.requester, m.levels::text::integer, m.within), false)
|
|
1074
|
+
), '{}'::jsonb)
|
|
1075
|
+
from managers m
|
|
1076
|
+
where jsonb_typeof(m.levels) = 'number' and m.levels::text ~ '^[0-9]{1,2}$'
|
|
1077
|
+
)` : "";
|
|
1078
|
+
const member = root === void 0 ? ` if v_request ->> 'within' is not null then
|
|
1079
|
+
continue;
|
|
1080
|
+
end if;` : ` if v_request ->> 'within' is not null then
|
|
1081
|
+
if v_member is null then
|
|
1082
|
+
select coalesce(array_agg(m.id::text), '{}') into v_member from ${qualified$1(ctx, memberIdsHelper(root))}() m(id);
|
|
1083
|
+
end if;
|
|
1084
|
+
if not (v_request ->> 'within' = any (v_member)) then
|
|
1085
|
+
continue;
|
|
1086
|
+
end if;
|
|
1087
|
+
end if;`;
|
|
1088
|
+
const covers = options.delegations ? `
|
|
1089
|
+
if coalesce(v_request ->> 'requester', '') = '' then
|
|
1090
|
+
continue;
|
|
1091
|
+
end if;
|
|
1092
|
+
if v_covers is null then
|
|
1093
|
+
select coalesce(jsonb_agg(jsonb_build_object('delegator', d.delegator, 'within', d.tenant, 'resources', d.resources)), '[]'::jsonb)
|
|
1094
|
+
into v_covers
|
|
1095
|
+
from ${qualified$1(ctx, "approval_delegations")} d
|
|
1096
|
+
where d.delegate = v_user::${user}
|
|
1097
|
+
and d.delegator::text <> v_user
|
|
1098
|
+
and d."from" <= now()
|
|
1099
|
+
and now() < d."until"
|
|
1100
|
+
and d.permissions is null;
|
|
1101
|
+
end if;
|
|
1102
|
+
if jsonb_array_length(v_covers) = 0 then
|
|
1103
|
+
continue;
|
|
1104
|
+
end if;
|
|
1105
|
+
${member}
|
|
1106
|
+
for v_delegator in
|
|
1107
|
+
select (c ->> 'delegator')::${user}
|
|
1108
|
+
from jsonb_array_elements(v_covers) c
|
|
1109
|
+
where c ->> 'delegator' <> v_request ->> 'requester'
|
|
1110
|
+
and (c ->> 'within' is null or c ->> 'within' = v_request ->> 'within')
|
|
1111
|
+
and (c ->> 'resources' is null or c -> 'resources' ? (v_request ->> 'resource'))
|
|
1112
|
+
loop
|
|
1113
|
+
if ${qualified$1(ctx, COVER_APPROVES)}(v_delegator, v_request -> 'approvers', v_request ->> 'within', v_request ->> 'requester') then
|
|
1114
|
+
return next v_request ->> 'id';
|
|
1115
|
+
exit;
|
|
1116
|
+
end if;
|
|
1117
|
+
end loop;` : "";
|
|
1118
|
+
const coverDeclarations = options.delegations ? `
|
|
1119
|
+
v_covers jsonb;
|
|
1120
|
+
v_member text[];
|
|
1121
|
+
v_delegator ${user};` : "";
|
|
1122
|
+
return `
|
|
1123
|
+
-- approvers as a set: permdock_is_approver over the facts permdock_approver_request_ids read once; only it calls this
|
|
1124
|
+
create or replace function ${matches}(p_approvers jsonb, p_tenant text, p_requester text, p_user text, p_facts jsonb)
|
|
1125
|
+
returns boolean
|
|
1126
|
+
language plpgsql
|
|
1127
|
+
immutable
|
|
1128
|
+
parallel safe
|
|
1129
|
+
set search_path = ''
|
|
1130
|
+
as $$
|
|
1131
|
+
declare
|
|
1132
|
+
v_item jsonb;${options.managers ? "\n v_levels jsonb;" : ""}
|
|
1133
|
+
begin
|
|
1134
|
+
if p_approvers is null then
|
|
1135
|
+
return false;
|
|
1136
|
+
end if;
|
|
1137
|
+
if jsonb_typeof(p_approvers) = 'array' then
|
|
1138
|
+
if jsonb_array_length(p_approvers) = 0 then
|
|
1139
|
+
return false;
|
|
1140
|
+
end if;
|
|
1141
|
+
for v_item in select value from jsonb_array_elements(p_approvers) loop
|
|
1142
|
+
if not ${matches}(v_item, p_tenant, p_requester, p_user, p_facts) then
|
|
1143
|
+
return false;
|
|
1144
|
+
end if;
|
|
1145
|
+
end loop;
|
|
1146
|
+
return true;
|
|
1147
|
+
end if;
|
|
1148
|
+
if jsonb_typeof(p_approvers) <> 'object' then
|
|
1149
|
+
return false;
|
|
1150
|
+
end if;
|
|
1151
|
+
case p_approvers ->> 'kind'
|
|
1152
|
+
when 'user' then
|
|
1153
|
+
return coalesce(p_approvers ->> 'id' = p_user, false);
|
|
1154
|
+
when 'permission' then
|
|
1155
|
+
if p_tenant is null then
|
|
1156
|
+
return coalesce((p_facts -> 'global' ->> (p_approvers ->> 'permission'))::boolean, false);
|
|
1157
|
+
end if;
|
|
1158
|
+
return coalesce(p_facts -> 'within' -> (p_approvers ->> 'permission') ? p_tenant, false);${managerCase}
|
|
1159
|
+
when 'any-of' then
|
|
1160
|
+
if jsonb_typeof(p_approvers -> 'of') <> 'array' then
|
|
1161
|
+
return false;
|
|
1162
|
+
end if;
|
|
1163
|
+
for v_item in select value from jsonb_array_elements(p_approvers -> 'of') loop
|
|
1164
|
+
if ${matches}(v_item, p_tenant, p_requester, p_user, p_facts) then
|
|
1165
|
+
return true;
|
|
1166
|
+
end if;
|
|
1167
|
+
end loop;
|
|
1168
|
+
return false;
|
|
1169
|
+
else
|
|
1170
|
+
return false;
|
|
1171
|
+
end case;
|
|
1172
|
+
end;
|
|
1173
|
+
$$;
|
|
1174
|
+
revoke execute on function ${matches}(jsonb, text, text, text, jsonb) from public, anon, authenticated;
|
|
1175
|
+
|
|
1176
|
+
-- approvers as a set: the ids in p_requests ({ id, kind, tenant, requester, approvers }) the signed-in user may approve, each as permdock_is_approver answers it; a policy calls it uncorrelated, once per statement
|
|
1177
|
+
create or replace function ${fn}(p_requests jsonb, p_kinds jsonb, p_current boolean default false)
|
|
1178
|
+
returns setof text
|
|
1179
|
+
language plpgsql
|
|
1180
|
+
stable
|
|
1181
|
+
security definer
|
|
1182
|
+
rows 10
|
|
1183
|
+
set search_path = ''
|
|
1184
|
+
as $$
|
|
1185
|
+
declare
|
|
1186
|
+
v_user text := ${subjectIdSql(ctx)}::text;
|
|
1187
|
+
v_requests jsonb;
|
|
1188
|
+
v_request jsonb;
|
|
1189
|
+
v_facts jsonb;${coverDeclarations}
|
|
1190
|
+
begin
|
|
1191
|
+
if coalesce(v_user, '') = '' or jsonb_typeof(p_requests) is distinct from 'array' then
|
|
1192
|
+
return;
|
|
1193
|
+
end if;
|
|
1194
|
+
if jsonb_array_length(p_requests) > ${String(MAX_APPROVER_REQUESTS)} then
|
|
1195
|
+
raise exception using
|
|
1196
|
+
errcode = '54000',
|
|
1197
|
+
hint = 'pass at most ${String(MAX_APPROVER_REQUESTS)} requests per call, for example one page of the list',
|
|
1198
|
+
message = 'permdock: permdock_approver_request_ids takes at most ${String(MAX_APPROVER_REQUESTS)} requests, got ' || jsonb_array_length(p_requests);
|
|
1199
|
+
end if;
|
|
1200
|
+
select coalesce(jsonb_agg(jsonb_build_object(
|
|
1201
|
+
'id', r.id,
|
|
1202
|
+
'within', r.within,
|
|
1203
|
+
'requester', r.requester,
|
|
1204
|
+
'resource', r.resource,
|
|
1205
|
+
'approvers', ${approvers}
|
|
1206
|
+
)), '[]'::jsonb)
|
|
1207
|
+
into v_requests
|
|
1208
|
+
from (
|
|
1209
|
+
select e ->> 'id' as id,
|
|
1210
|
+
e ->> 'tenant' as within,
|
|
1211
|
+
e ->> 'requester' as requester,
|
|
1212
|
+
case when k.listed then ${resource} else split_part(e ->> 'kind', '.', 1) end as resource,
|
|
1213
|
+
case when k.listed then p_kinds -> (e ->> 'kind') end as approvers,
|
|
1214
|
+
e -> 'approvers' as current,
|
|
1215
|
+
k.listed
|
|
1216
|
+
from jsonb_array_elements(p_requests) e,
|
|
1217
|
+
lateral (select coalesce(${listed}, false) as listed) k
|
|
1218
|
+
where jsonb_typeof(e) = 'object' and e ->> 'id' is not null
|
|
1219
|
+
) r
|
|
1220
|
+
where ${kept};
|
|
1221
|
+
if jsonb_array_length(v_requests) = 0 then
|
|
1222
|
+
return;
|
|
1223
|
+
end if;
|
|
1224
|
+
with leaves as (
|
|
1225
|
+
select r ->> 'within' as within, l ->> 'permission' as permission
|
|
1226
|
+
from jsonb_array_elements(v_requests) r, jsonb_path_query(r -> 'approvers', 'strict $.** ? (@.kind == "permission")') l
|
|
1227
|
+
)${managerLeaves}
|
|
1228
|
+
select jsonb_build_object(
|
|
1229
|
+
'global', (
|
|
1230
|
+
select coalesce(jsonb_object_agg(p.permission, coalesce(${qualified$1(ctx, PERMISSION_HELPERS.has)}(p.permission), false)), '{}'::jsonb)
|
|
1231
|
+
from (select distinct l.permission from leaves l where l.within is null and l.permission is not null) p
|
|
1232
|
+
),
|
|
1233
|
+
'within', ${tenantFacts}${managerFacts}
|
|
1234
|
+
)
|
|
1235
|
+
into v_facts;
|
|
1236
|
+
for v_request in select value from jsonb_array_elements(v_requests) loop
|
|
1237
|
+
if ${matches}(v_request -> 'approvers', v_request ->> 'within', v_request ->> 'requester', v_user, v_facts) then
|
|
1238
|
+
return next v_request ->> 'id';
|
|
1239
|
+
continue;
|
|
1240
|
+
end if;${covers}
|
|
1241
|
+
end loop;
|
|
1242
|
+
end;
|
|
1243
|
+
$$;
|
|
1244
|
+
revoke execute on function ${fn}(jsonb, jsonb, boolean) from public, anon;
|
|
1245
|
+
grant execute on function ${fn}(jsonb, jsonb, boolean) to authenticated;
|
|
1246
|
+
`;
|
|
1247
|
+
}
|
|
990
1248
|
// src/cli/rls/approval-sets.ts
|
|
991
1249
|
/** The caller plus active delegators, one hop. */
|
|
992
1250
|
const APPROVER_FOR_IDS = "permdock_approver_for_ids";
|
|
@@ -1522,13 +1780,17 @@ ${exposure}
|
|
|
1522
1780
|
/**
|
|
1523
1781
|
* Everything `rls.approvals` writes: the generated or adopted store, the
|
|
1524
1782
|
* approver check, with `managers` the manager walk, with `delegations: true`
|
|
1525
|
-
* the covers,
|
|
1783
|
+
* the covers, with `tenantPolicies` the tenant approval policies, and the
|
|
1784
|
+
* approver check as a set, `permdock_approver_request_ids`. With
|
|
1526
1785
|
* `actorMayWrite`, the covers' write policies call
|
|
1527
1786
|
* `permdock_actor_may_write()`.
|
|
1528
1787
|
*/
|
|
1529
1788
|
function approvalsSql(ctx, approvals, jsonSchema, actorMayWrite = false) {
|
|
1530
1789
|
if (approvals === void 0 || approvals === false) return;
|
|
1531
|
-
if (approvals === true) return approvalStoreSql(ctx, jsonSchema) + isApproverSql(ctx) + approvalSetsSql(ctx, { delegations: false })
|
|
1790
|
+
if (approvals === true) return approvalStoreSql(ctx, jsonSchema) + isApproverSql(ctx) + approvalSetsSql(ctx, { delegations: false }) + approverRequestIdsSql(ctx, {
|
|
1791
|
+
managers: false,
|
|
1792
|
+
delegations: false
|
|
1793
|
+
});
|
|
1532
1794
|
const { table, delegations, tenantPolicies, managers } = approvals;
|
|
1533
1795
|
if (delegations !== void 0 && typeof delegations !== "boolean") throw new TypeError("PermDock CLI: rls.approvals.delegations must be a boolean");
|
|
1534
1796
|
if (approvals.store !== void 0 && typeof approvals.store !== "boolean") throw new TypeError("PermDock CLI: rls.approvals.store must be a boolean");
|
|
@@ -1561,7 +1823,10 @@ function approvalsSql(ctx, approvals, jsonSchema, actorMayWrite = false) {
|
|
|
1561
1823
|
return store + isApproverSql(ctx, managers !== void 0) + (managers === void 0 ? "" : approvalManagersSql(ctx, managers, qualified$1(ctx, APPROVAL_STORE.isApprover), qualified$1(ctx, APPROVAL_STORE.isApproverBase), delegations === true)) + (delegations === true ? approvalDelegationsSql(ctx, actorMayWrite, managers !== void 0) : "") + (delegations === true || managers !== void 0 ? requestApproversSql(ctx) : "") + (tenantPolicies === void 0 ? "" : approvalPoliciesSql(ctx, tenantPolicies, actorMayWrite)) + approvalSetsSql(ctx, {
|
|
1562
1824
|
delegations: delegations === true,
|
|
1563
1825
|
...managers === void 0 ? {} : { managers }
|
|
1564
|
-
}) + (managers === void 0 ? "" : approvalChainSql(ctx, checkedManagers(managers, ctx), delegations === true))
|
|
1826
|
+
}) + (managers === void 0 ? "" : approvalChainSql(ctx, checkedManagers(managers, ctx), delegations === true)) + approverRequestIdsSql(ctx, {
|
|
1827
|
+
managers: managers !== void 0,
|
|
1828
|
+
delegations: delegations === true
|
|
1829
|
+
});
|
|
1565
1830
|
}
|
|
1566
1831
|
/**
|
|
1567
1832
|
* The objects `rls.approvals.delegations` adds; `tableApprovalDelegationSource`
|
|
@@ -2949,6 +3214,7 @@ ${statementTriggers(target, `${bump}()`)}`;
|
|
|
2949
3214
|
function helperList(parts, types) {
|
|
2950
3215
|
const client = ["authenticated"];
|
|
2951
3216
|
const teams = hookTeamsHelper(parts);
|
|
3217
|
+
const memberFor = parts.helpers.memberFor.length === 0 ? /* @__PURE__ */ new Set() : new Set(parts.scopes.map((scope) => scope.name));
|
|
2952
3218
|
return [
|
|
2953
3219
|
helperEntry(HELPERS.has, "p_grant text", "boolean", client),
|
|
2954
3220
|
...parts.scopes.flatMap((scope) => {
|
|
@@ -2956,7 +3222,7 @@ function helperList(parts, types) {
|
|
|
2956
3222
|
return [
|
|
2957
3223
|
helperEntry(permittedIdsHelper(scope.name), "p_grant text", returns, client),
|
|
2958
3224
|
helperEntry(memberIdsHelper(scope.name), "", returns, client),
|
|
2959
|
-
...
|
|
3225
|
+
...memberFor.has(scope.name) ? [helperEntry(memberForHelper(scope.name), isTeamScope(scope.name) ? "p_user uuid, p_active text" : "p_user uuid", returns, ["supabase_auth_admin"])] : [],
|
|
2960
3226
|
...parts.helpers.memberFor.includes(scope.name) && isTeamScope(scope.name) ? [helperEntry(memberOfHelper(scope.name), "p_user uuid", returns, client)] : []
|
|
2961
3227
|
];
|
|
2962
3228
|
}),
|
|
@@ -2998,7 +3264,11 @@ function trustedHelpers(parts, config, types, tenantType, policy) {
|
|
|
2998
3264
|
...tokenScopesOn(config.rls?.tokenScopes) ? [helperEntry(TOKEN_SCOPE_ALLOWS, "p_grant text", "boolean", client)] : [],
|
|
2999
3265
|
...policy === void 0 || interactiveOnlyKeys(policy) === void 0 ? [] : [helperEntry(INTERACTIVE_ALLOWS, "p_grant text", "boolean", client)],
|
|
3000
3266
|
...readOnlyActorKinds(config.rls?.readOnlyActors) === void 0 ? [] : [helperEntry(ACTOR_MAY_WRITE, "", "boolean", client)],
|
|
3001
|
-
...config.rls?.approvals === true || typeof config.rls?.approvals === "object" ? [
|
|
3267
|
+
...config.rls?.approvals === true || typeof config.rls?.approvals === "object" ? [
|
|
3268
|
+
helperEntry(IS_APPROVER, typeof config.rls.approvals === "object" && (config.rls.approvals.delegations === true || config.rls.approvals.managers !== void 0) ? "p_approvers jsonb, p_tenant text, p_requester text, p_resource text" : "p_approvers jsonb, p_tenant text", "boolean", client),
|
|
3269
|
+
helperEntry(APPROVER_FOR_IDS, "", "setof uuid", client),
|
|
3270
|
+
helperEntry(APPROVER_REQUEST_IDS, "p_requests jsonb, p_kinds jsonb, p_current boolean", "setof text", client)
|
|
3271
|
+
] : [],
|
|
3002
3272
|
...typeof config.rls?.approvals === "object" && config.rls.approvals.managers !== void 0 ? [
|
|
3003
3273
|
helperEntry(MANAGES, "p_requester text, p_levels integer", "boolean", []),
|
|
3004
3274
|
helperEntry(MANAGED_USER_IDS, config.rls.approvals.managers.tenant === void 0 ? "" : `p_tenant ${tenantType}`, "setof uuid", client),
|
|
@@ -6,7 +6,7 @@ import { t as applyFiles } from "./files-DuV7wRim.js";
|
|
|
6
6
|
import { n as httpRequest } from "./http-BbX_Ou3_.js";
|
|
7
7
|
import { i as readJsonFile } from "./files-DAR51W3J.js";
|
|
8
8
|
import { i as schemaExpression, t as emitPermissionsModule } from "./generate-5_kz2309.js";
|
|
9
|
-
import { t as validateOpenapi } from "./schema-
|
|
9
|
+
import { t as validateOpenapi } from "./schema-uTRr3B9f.js";
|
|
10
10
|
import { existsSync, readFileSync } from "node:fs";
|
|
11
11
|
import { resolve } from "node:path";
|
|
12
12
|
// src/cli/openapi/import.ts
|
|
@@ -8,7 +8,7 @@ import { u as isSqlFunctionField } from "./refs-Cix9Zjis.js";
|
|
|
8
8
|
import { r as escapeSqlIdent, s as quoteSqlLiteral } from "./sql-T4GaBh9X.js";
|
|
9
9
|
import { r as HELPERS } from "./shared-DnVY767H.js";
|
|
10
10
|
import { r as isRecord } from "./compact-C4LFuqbW.js";
|
|
11
|
-
import { t as FIELD_VIEWS } from "./fields-
|
|
11
|
+
import { t as FIELD_VIEWS } from "./fields-CKX-qjWb.js";
|
|
12
12
|
import { existsSync, readFileSync } from "node:fs";
|
|
13
13
|
import { resolve } from "node:path";
|
|
14
14
|
import { createHash } from "node:crypto";
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { $ as JwtClaims, An as PolicyScopesInput, Ar as Subject, B as SupportAccessOptions, Br as OpaqueCondition, D as Policy, Dr as Membership, En as SinkEvent, F as RoleBinding, Gr as SqlFunctionCondition, I as RoleOptions, Ir as ConditionRef, Jt as ClientBundle, Kt as InstanceHandle, N as PolicyVocabulary, Or as Principal, R as SeparationConflict, Sr as CustomRole, T as MembershipFixture, U as VocabularyFromInput, Wr as SqlFunctionArg, Xt as ExpandedSnapshot, Yt as CustomRoleRecord, Z as EntitlementSource, _ as Grant, _t as TokenSigner, ar as Denial, ct as RelationSource, hn as AccessEvent, ht as TenantSettings, in as SnapshotAssignable, ir as Decision, it as MembershipSource, j as PolicyOptions, jn as Scope, k as PolicyDelegation, l as AssuranceRequirement, lt as SettingsSource, o as ApprovalOption, ot as RelationGroup, pn as SnapshotTenants, q as CustomRoleSource, qt as Instant, rn as Snapshot, sr as DenialReason, tn as LocalSnapshotManifest, u as BreakGlassOptions, ut as SnapshotSource, v as GrantCondition, wr as Delegation, xn as DeliveryEvent, yn as DecisionEvent } from "./policy-types-DuM3k5Ao.js";
|
|
1
|
+
import { $ as JwtClaims, An as PolicyScopesInput, Ar as Subject, B as SupportAccessOptions, Br as OpaqueCondition, D as Policy, Dr as Membership, En as SinkEvent, F as RoleBinding, Gr as SqlFunctionCondition, I as RoleOptions, Ir as ConditionRef, Jt as ClientBundle, K as CustomRoleContext, Kt as InstanceHandle, N as PolicyVocabulary, Or as Principal, R as SeparationConflict, Sr as CustomRole, T as MembershipFixture, U as VocabularyFromInput, Wr as SqlFunctionArg, Xt as ExpandedSnapshot, Yt as CustomRoleRecord, Z as EntitlementSource, _ as Grant, _t as TokenSigner, ar as Denial, ct as RelationSource, hn as AccessEvent, ht as TenantSettings, in as SnapshotAssignable, ir as Decision, it as MembershipSource, j as PolicyOptions, jn as Scope, k as PolicyDelegation, l as AssuranceRequirement, lt as SettingsSource, o as ApprovalOption, ot as RelationGroup, pn as SnapshotTenants, q as CustomRoleSource, qt as Instant, rn as Snapshot, sr as DenialReason, tn as LocalSnapshotManifest, u as BreakGlassOptions, ut as SnapshotSource, v as GrantCondition, wr as Delegation, xn as DeliveryEvent, yn as DecisionEvent } from "./policy-types-DuM3k5Ao.js";
|
|
2
2
|
import { A as ResourceInit, B as ResourceXTree, D as PermissionsOf, E as PermissionTree, F as ResourceOptions, I as ResourceParent, N as ResourceMeta, O as PermissionsOptions, P as ResourceNode, R as ResourceRelationInput, T as PermissionKind, a as RoleTree, g as ActionMeta, h as ActionList, r as Role, w as Permission, z as ResourceRestricted } from "./vocabulary-DHfKPIC5.js";
|
|
3
|
-
import { a as PermDock } from "./permdock-
|
|
3
|
+
import { a as PermDock } from "./permdock-CHU1LZGq.js";
|
|
4
4
|
import { o as PolicyDocument } from "./hosted-DZgmEG4b.js";
|
|
5
|
-
import { n as PermDockWrap } from "./wrap-
|
|
5
|
+
import { n as PermDockWrap } from "./wrap-B4Ge6LOd.js";
|
|
6
6
|
import { l as VersionStore, s as VersionCache } from "./subject-cache-Bn4oJY_R.js";
|
|
7
7
|
import { t as JsonSchemaNode } from "./json-schema-DAeA-lJa.js";
|
|
8
8
|
import { i as CatalogEventData, s as CloudEvent } from "./sink-CoMI_OVw.js";
|
|
@@ -585,19 +585,20 @@ type CustomRoleDecision = {
|
|
|
585
585
|
declare function decideCustomRole(permdock: InstanceHandle, role: CustomRole): CustomRoleDecision;
|
|
586
586
|
/**
|
|
587
587
|
* Reads custom roles from the application's store, as `customRoleSource` takes
|
|
588
|
-
* them.
|
|
588
|
+
* them. Each read gets the source's `context`, so a reader that reads through
|
|
589
|
+
* another `CustomRoleSource` can pass it on with its `memo`.
|
|
589
590
|
*/
|
|
590
591
|
type CustomRoleReader = {
|
|
591
592
|
/**
|
|
592
593
|
* Every custom role of `tenant`, whether or not anyone in the request holds
|
|
593
594
|
* it.
|
|
594
595
|
*/
|
|
595
|
-
rolesFor: (tenant: string) => CustomRole[] | Promise<CustomRole[]>;
|
|
596
|
+
rolesFor: (tenant: string, context?: CustomRoleContext) => CustomRole[] | Promise<CustomRole[]>;
|
|
596
597
|
assignable?: (tenant: string) => string[] | Promise<string[]>;
|
|
597
598
|
/** Platform custom roles (`scope: 'global'`). */
|
|
598
|
-
globalRoles?: () => CustomRole[] | Promise<CustomRole[]>;
|
|
599
|
+
globalRoles?: (context?: CustomRoleContext) => CustomRole[] | Promise<CustomRole[]>;
|
|
599
600
|
/** Shared custom roles (`shared: true`), the same for every tenant. */
|
|
600
|
-
sharedRoles?: () => CustomRole[] | Promise<CustomRole[]>;
|
|
601
|
+
sharedRoles?: (context?: CustomRoleContext) => CustomRole[] | Promise<CustomRole[]>;
|
|
601
602
|
};
|
|
602
603
|
type CustomRoleSourceOptions = {
|
|
603
604
|
/**
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as PermDock, v as PrincipalSource } from "./permdock-
|
|
1
|
+
import { a as PermDock, v as PrincipalSource } from "./permdock-CHU1LZGq.js";
|
|
2
2
|
import { w as Permission } from "./vocabulary-DHfKPIC5.js";
|
|
3
3
|
import { t as JsonSchemaNode } from "./json-schema-DAeA-lJa.js";
|
|
4
4
|
import { _ as TransportOptions, a as DeliveryReport, c as DeliveryTransport, g as TransportMessages, i as DeliveryMessages, l as DeliveryTransports, m as Recipient, o as DeliveryResult, r as DeliverOptions, s as DeliveryTarget, y as WebhookTransport } from "./types-D3GI2B9O.js";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Ar as Subject, D as Policy, N as PolicyVocabulary, Or as Principal, Tt as SupportSession, _t as TokenSigner, gn as AuthEvent, gt as TokenFailureCause, ir as Decision, vt as TokenVerifier } from "./policy-types-DuM3k5Ao.js";
|
|
2
|
-
import { c as ServerPermDock, l as ServerPermDockOptions } from "./server-types-
|
|
2
|
+
import { c as ServerPermDock, l as ServerPermDockOptions } from "./server-types-C_Lnc8Ec.js";
|
|
3
3
|
import { E as PermissionTree, w as Permission } from "./vocabulary-DHfKPIC5.js";
|
|
4
|
-
import { v as PrincipalSource } from "./permdock-
|
|
4
|
+
import { v as PrincipalSource } from "./permdock-CHU1LZGq.js";
|
|
5
5
|
import { a as ProblemDetails, s as Disclosure, t as ApprovalHint } from "./errors-BliKrfmP.js";
|
|
6
6
|
/**
|
|
7
7
|
* The Fetch factory behind every HTTP adapter. The subject and actor are
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as PermDock } from "./permdock-
|
|
1
|
+
import { a as PermDock } from "./permdock-CHU1LZGq.js";
|
|
2
2
|
import { Ar as Subject, D as Policy, Dr as Membership, Fn as Approver, _t as TokenSigner, br as AuthorizationDetail, ct as RelationSource, ir as Decision, it as MembershipSource, qt as Instant } from "./policy-types-DuM3k5Ao.js";
|
|
3
3
|
import { a as AccessReviewItemQuery, c as AccessReviewStore, i as AccessReviewItemPage, n as AccessReviewDecision, r as AccessReviewItem, t as AccessReview } from "./types-CKwI6AT4.js";
|
|
4
4
|
import { E as PermissionTree, K as AppData, w as Permission } from "./vocabulary-DHfKPIC5.js";
|
package/dist/index.d.ts
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { $n as inherit, $t as LocalRowColumn, A as PolicyOAuthScope, An as PolicyScopesInput, Ar as Subject, At as parseSupportSession, B as SupportAccessOptions, Bn as allOf, Bt as DecideCredentialOptions, C as GrantValidity, Cn as DirectoryEvent, Cr as CustomRoleGrant, Ct as WhereCompiler, D as Policy, Dn as WireDecision, Dr as Membership, Dt as SupportSessionPolicy, E as ObligationInput, En as SinkEvent, Et as SupportSessionDecision, F as RoleBinding, Fn as Approver, Fr as Condition, Ft as CredentialPermission, G as CredentialVerifier, Gn as Grantee, Gr as SqlFunctionCondition, Gt as parseCredential, H as ValidateMode, Hn as holder, Hr as RelatedHop, Ht as credentialPolicyViolation, I as RoleOptions, In as ApproverInput, Ir as ConditionRef, It as CredentialPermissionInput, J as CustomRoleSourceFactory, Jn as RelationGrantee, Jr as isConditionDate, Jt as ClientBundle, K as CustomRoleContext, Kn as GranteeInput, Kr as hasConditionOp, L as RoleScope, Ln as ManagerApprover, Lr as ConditionValue, Lt as CredentialPolicy, M as PolicyScopes, Mn as ScopeDeclaration, Mr as ActorKind, Mt as Credential, Nn as ScopeNames, Nr as AdapterId, Nt as CredentialDecision, O as PolicyAppDataSchemas, On as WireDenial, Or as Principal, Ot as SupportSessionRequest, P as PrincipalOf, Pn as AnyOfApprover, Pr as MembershipVia, Pt as CredentialKind, Q as Intent, Qn as authenticated, Qt as LocalMembershipRows, R as SeparationConflict, Rn as PermissionApprover, Rr as MemberOfCondition, Rt as CredentialPolicyViolation, S as GrantScope, Sn as DeliveryFailureCause, Sr as CustomRole, St as VersionQuery, T as MembershipFixture, Tn as MembershipEvent, Tr as GnapAccess, Tt as SupportSession, Un as manager, Ur as RestrictedAncestors, Ut as decideCredential, V as SupportConsent, Vn as anyOf, Vr as RelatedCondition, Vt as credentialDelegation, W as WireValidity, Wn as user, Wr as SqlFunctionArg, Wt as isFeedId, X as DecisionSink, Xn as anyone, Xr as isSqlFunctionField, Xt as ExpandedSnapshot, Y as DecisionProvider, Yn as actor, Yr as isConditionRef, Yt as CustomRoleRecord, Z as EntitlementSource, Zn as assurance, Zt as LocalCustomRoleTable, _ as Grant, _n as AutomationEvent, _r as TraceSkipReason, _t as TokenSigner, a as ApprovalMode, an as SnapshotCustom, ar as Denial, at as RelationChain, b as GrantMeta, bn as DeliveryChannel, br as AuthorizationDetail, bt as VerifiedToken, c as ApprovalStage, cn as SnapshotGrantTerms, cr as DeniedDecision, ct as RelationSource, d as BreakGlassRequirements, dn as SnapshotScope, dr as LimitDetail, dt as SourceCall, en as LocalRowValue, er as plan, et as LimitConsumeInput, f as BreakGlassSpec, fn as SnapshotStatic, fr as MatchedGrant, ft as SourceContext, g as DelegationTarget, gn as AuthEvent, gr as TraceSkip, gt as TokenFailureCause, h as DelegationInput, hn as AccessEvent, hr as Trace, ht as TenantSettings, i as ApprovalFallback, in as SnapshotAssignable, ir as Decision, it as MembershipSource, jn as Scope, jr as VerifiedClaims, jt as ApiKeyPrincipal, k as PolicyDelegation, kr as SharedCustomRole, kt as decideSupportSession, l as AssuranceRequirement, ln as SnapshotListRef, lr as ExplainedDecision, lt as SettingsSource, m as ClosureGrantFn, mn as SnapshotWireAssignable, mr as Quota, mt as SubjectResolver, n as ApprovalCombine, nn as LocalSnapshotRows, nr as AppObligation, nt as LimitStore, o as ApprovalOption, on as SnapshotGrant, or as DenialDetails, ot as RelationGroup, p as ClosureContext, pn as SnapshotTenants, pr as Obligation, pt as SourceMemo, q as CustomRoleSource, qn as InheritGrantee, qr as isCondition, r as ApprovalEscalation, rn as Snapshot, rr as ApprovalRequiredDecision, rt as MemberEntry, s as ApprovalRequirement, sn as SnapshotGrantRef, sr as DenialReason, st as RelationHolder, t as ActivationOption, tn as LocalSnapshotManifest, tr as relation, tt as LimitRemaining, u as BreakGlassOptions, un as SnapshotNotEntitled, ur as GrantedDecision, ut as SnapshotSource, v as GrantCondition, vn as CredentialEvent, vr as Actor, vt as TokenVerifier, w as HostedGrantRef, wn as EmailCategory, wr as Delegation, wt as DecideSupportSessionOptions, x as GrantOptions, xn as DeliveryEvent, xr as Binding, xt as VersionContext, y as GrantLimit, yn as DecisionEvent, yr as Assurance, yt as VerificationFailure, z as SubjectOf, zn as UserApprover, zr as MemberOfParent, zt as CredentialRequest } from "./policy-types-DuM3k5Ao.js";
|
|
2
2
|
import { A as ResourceInit, B as ResourceXTree, D as PermissionsOf, E as PermissionTree, F as ResourceOptions, G as RESOURCE_X, H as PERMISSION_ROW, I as ResourceParent, J as MetaValue, K as AppData, L as ResourceRelation, M as ResourceLink, N as ResourceMeta, O as PermissionsOptions, P as ResourceNode, R as ResourceRelationInput, S as FieldRelation, T as PermissionKind, U as POLICY_SCOPES, V as RowOf, W as RESOURCE_NAME, _ as ComputedRelation, a as RoleTree, b as EdgeMatch, c as definePlans, d as isPlan, f as isRole, g as ActionMeta, i as RoleMeta, j as ResourceLevel, k as PrincipalRelation, l as defineRoles, m as listRoles, n as PlanTree, o as Vocabulary, p as listPlans, q as AppDataSchema, r as Role, s as VocabularyOptions, t as Plan, u as findRole, v as EdgeGroup, w as Permission, x as EdgeRelation, y as EdgeGroups, z as ResourceRestricted } from "./vocabulary-DHfKPIC5.js";
|
|
3
|
-
import { $ as resource, $t as memoryMembershipSource, A as RoleChangeCheckInput, An as validateCustomRole, At as SignSnapshotOptions, B as ActivateInput, Bt as whoCan, C as parseCatalogEventData, Cn as CustomRoleRename, Ct as arazzoFindings, D as parseSinkEvents, Dn as customRoleClaim, Dt as RuntimeCacheLike, E as parseSinkEvent, En as ValidateCustomRoleOptions, Et as QueryableLike, F as checkRoleChange, Ft as SignPolicyDocumentOptions, G as allow, Gt as stripeEntitlementSource, H as breakGlass, Ht as MemoryRelationSourceData, I as decideRoleChange, It as signPolicyDocument, J as role, Jt as countHolders, K as deny, Kt as claimsFirst, L as normalizeMembership, Lt as Holder, M as RoleChangeOptions, Mn as context, Mt as signSnapshot, N as RoleChangeTarget, Nn as principal, Nt as snapshotClaims, O as RoleChange, On as parseCustomRoleEntry, Ot as postgresCacheVersionStore, P as RoleRules, Pt as snapshotFromClaims, Q as formerKeys, Qt as memoryEntitlementSource, R as normalizeMemberships, Rt as HoldingVia, S as SINK_EVENT_SCHEMAS, Sn as CustomRoleEntry, St as ArazzoStepResult, T as parseCloudEventBatch, Tn as ResolvedCustomRole, Tt as deliveryEvent, U as supportAccess, Ut as memoryRelationSource, V as activate, Vt as MemoryEdge, W as normalizeApproval, Wt as StripeEntitlementsClient, X as readable, Xt as APPROVAL_POLICY_UNAVAILABLE, Y as crud, Yt as isExternallyManaged, Z as writable, Zt as memoryCustomRoleSource, _ as DECISION_EVENT_SCHEMA, _n as fromSnapshot, _t as customRoleRecord, a as catalogFingerprint, an as sqlFunction, at as CustomRoleReader, b as EVENT_SCHEMA_IDS, bn as CustomRoleDrop, bt as ArazzoPlan, c as OCSF_VERSION, cn as getResource, ct as CustomRoleDecision, d as accessToOcsf, dn as mergePermissions, dt as LegacyCheck, en as memorySettingsSource, et as definePermissions, f as toOcsf, fn as RoleNameOf, ft as ShadowMismatch, g as CREDENTIAL_EVENT_SCHEMA, gn as requiresApproval, gt as readSnapshot, h as CATALOG_EVENT_SCHEMA, hn as separationConflicts, ht as localSnapshotManifest, i as canonicalJson, in as accessOutcome, it as assignableFor, j as RoleChangeDecision, jn as claim, jt as SnapshotClaims, k as RoleChangeCheck, kn as resolveCustomRole, kt as runtimeCacheVersionStore, l as OcsfAuthorizeSession, ln as isPermission, lt as decideCustomRole, m as AUTOMATION_EVENT_SCHEMA, mn as isRoleName, mt as shadowMode, n as delegatedPermissions, nn as subjectMembershipSource, nt as snapshotFor, o as CSV_COLUMNS, on as opaque, ot as CustomRoleSourceOptions, p as ACCESS_EVENT_SCHEMA, pn as definePolicy, pt as ShadowOptions, q as normalizeAssurance, qt as composeMemberships, r as sha256Digest, rn as AccessOutcome, rt as AssignableForOptions, s as toCsvRow, sn as findPermission, st as customRoleSource, t as coveredByDelegation, tn as memorySnapshotSource, tt as SnapshotForOptions, u as OcsfUserManagement, un as listPermissions, ut as mayAccess, v as DELIVERY_EVENT_SCHEMA, vn as emptySnapshot, vt as clientBundle, w as parseCloudEvent, wn as CustomRoleValidation, wt as simulateArazzo, x as MEMBERSHIP_EVENT_SCHEMA, xn as CustomRoleDropReason, xt as ArazzoSimulateInput, y as DIRECTORY_EVENT_SCHEMA, yn as parseSnapshot, yt as ArazzoFinding, z as resolveScope, zt as WhoCan } from "./index-
|
|
3
|
+
import { $ as resource, $t as memoryMembershipSource, A as RoleChangeCheckInput, An as validateCustomRole, At as SignSnapshotOptions, B as ActivateInput, Bt as whoCan, C as parseCatalogEventData, Cn as CustomRoleRename, Ct as arazzoFindings, D as parseSinkEvents, Dn as customRoleClaim, Dt as RuntimeCacheLike, E as parseSinkEvent, En as ValidateCustomRoleOptions, Et as QueryableLike, F as checkRoleChange, Ft as SignPolicyDocumentOptions, G as allow, Gt as stripeEntitlementSource, H as breakGlass, Ht as MemoryRelationSourceData, I as decideRoleChange, It as signPolicyDocument, J as role, Jt as countHolders, K as deny, Kt as claimsFirst, L as normalizeMembership, Lt as Holder, M as RoleChangeOptions, Mn as context, Mt as signSnapshot, N as RoleChangeTarget, Nn as principal, Nt as snapshotClaims, O as RoleChange, On as parseCustomRoleEntry, Ot as postgresCacheVersionStore, P as RoleRules, Pt as snapshotFromClaims, Q as formerKeys, Qt as memoryEntitlementSource, R as normalizeMemberships, Rt as HoldingVia, S as SINK_EVENT_SCHEMAS, Sn as CustomRoleEntry, St as ArazzoStepResult, T as parseCloudEventBatch, Tn as ResolvedCustomRole, Tt as deliveryEvent, U as supportAccess, Ut as memoryRelationSource, V as activate, Vt as MemoryEdge, W as normalizeApproval, Wt as StripeEntitlementsClient, X as readable, Xt as APPROVAL_POLICY_UNAVAILABLE, Y as crud, Yt as isExternallyManaged, Z as writable, Zt as memoryCustomRoleSource, _ as DECISION_EVENT_SCHEMA, _n as fromSnapshot, _t as customRoleRecord, a as catalogFingerprint, an as sqlFunction, at as CustomRoleReader, b as EVENT_SCHEMA_IDS, bn as CustomRoleDrop, bt as ArazzoPlan, c as OCSF_VERSION, cn as getResource, ct as CustomRoleDecision, d as accessToOcsf, dn as mergePermissions, dt as LegacyCheck, en as memorySettingsSource, et as definePermissions, f as toOcsf, fn as RoleNameOf, ft as ShadowMismatch, g as CREDENTIAL_EVENT_SCHEMA, gn as requiresApproval, gt as readSnapshot, h as CATALOG_EVENT_SCHEMA, hn as separationConflicts, ht as localSnapshotManifest, i as canonicalJson, in as accessOutcome, it as assignableFor, j as RoleChangeDecision, jn as claim, jt as SnapshotClaims, k as RoleChangeCheck, kn as resolveCustomRole, kt as runtimeCacheVersionStore, l as OcsfAuthorizeSession, ln as isPermission, lt as decideCustomRole, m as AUTOMATION_EVENT_SCHEMA, mn as isRoleName, mt as shadowMode, n as delegatedPermissions, nn as subjectMembershipSource, nt as snapshotFor, o as CSV_COLUMNS, on as opaque, ot as CustomRoleSourceOptions, p as ACCESS_EVENT_SCHEMA, pn as definePolicy, pt as ShadowOptions, q as normalizeAssurance, qt as composeMemberships, r as sha256Digest, rn as AccessOutcome, rt as AssignableForOptions, s as toCsvRow, sn as findPermission, st as customRoleSource, t as coveredByDelegation, tn as memorySnapshotSource, tt as SnapshotForOptions, u as OcsfUserManagement, un as listPermissions, ut as mayAccess, v as DELIVERY_EVENT_SCHEMA, vn as emptySnapshot, vt as clientBundle, w as parseCloudEvent, wn as CustomRoleValidation, wt as simulateArazzo, x as MEMBERSHIP_EVENT_SCHEMA, xn as CustomRoleDropReason, xt as ArazzoSimulateInput, y as DIRECTORY_EVENT_SCHEMA, yn as parseSnapshot, yt as ArazzoFinding, z as resolveScope, zt as WhoCan } from "./index-Bb2sZq1K.js";
|
|
4
4
|
import { a as OperationInput, c as defineOperations, d as isOperationRisk, i as OperationEffect, l as OPERATION_RISKS, n as OperationData, o as OperationMap, r as OperationDefinition, s as OperationMeta, t as Operation, u as OperationRisk } from "./operations-DaEoGpMV.js";
|
|
5
|
-
import { A as InstanceCacheStats, B as ApprovalPolicyValidation, C as Limits, D as InstanceCache, E as CustomRoleOwner, F as PermissionState, H as memoryApprovalPolicySource, I as ApprovalPolicies, L as ApprovalPolicy, M as GrantedPermissionsOptions, N as isGlobalPermission, O as InstanceCacheKey, P as PermissionCheck, R as ApprovalPolicyProblem, S as PermittedScopeIdsOptions, T as memoryLimitStore, U as validateApprovalPolicy, V as approvalPolicies, _ as PrincipalIdentityLink, a as PermDock, b as MembershipFilter, c as RowPair, d as UncheckedData, f as WhereOptions, g as PrincipalIdentity, h as getPermDockSync, i as LoadedRows, j as instanceCache, k as InstanceCacheOptions, l as SimulateOptions, m as getPermDock, n as DecideOptions, o as PermDockOptions, p as WhereResult, r as DeriveOptions, s as RowData, t as DecideIdsOptions, u as SnapshotOptions, v as PrincipalSource, w as limits, x as PermittedIdsOptions, y as memoryPrincipalSource, z as ApprovalPolicySource } from "./permdock-
|
|
5
|
+
import { A as InstanceCacheStats, B as ApprovalPolicyValidation, C as Limits, D as InstanceCache, E as CustomRoleOwner, F as PermissionState, H as memoryApprovalPolicySource, I as ApprovalPolicies, L as ApprovalPolicy, M as GrantedPermissionsOptions, N as isGlobalPermission, O as InstanceCacheKey, P as PermissionCheck, R as ApprovalPolicyProblem, S as PermittedScopeIdsOptions, T as memoryLimitStore, U as validateApprovalPolicy, V as approvalPolicies, _ as PrincipalIdentityLink, a as PermDock, b as MembershipFilter, c as RowPair, d as UncheckedData, f as WhereOptions, g as PrincipalIdentity, h as getPermDockSync, i as LoadedRows, j as instanceCache, k as InstanceCacheOptions, l as SimulateOptions, m as getPermDock, n as DecideOptions, o as PermDockOptions, p as WhereResult, r as DeriveOptions, s as RowData, t as DecideIdsOptions, u as SnapshotOptions, v as PrincipalSource, w as limits, x as PermittedIdsOptions, y as memoryPrincipalSource, z as ApprovalPolicySource } from "./permdock-CHU1LZGq.js";
|
|
6
6
|
import { d as memoryPolicySource, f as mergeHostedGrants, i as HostedGrantDropped, l as hostedPolicies, m as policyDocumentFromClaims, o as PolicyDocument, p as parsePolicyDocument, r as HostedGrantDropReason, s as PolicySource, t as HostedGrant, u as isPortableCondition } from "./hosted-DZgmEG4b.js";
|
|
7
7
|
import { n as PermDockValidationError } from "./validation-error-MZ7KLNHt.js";
|
|
8
8
|
import { a as ProblemDetails, c as requiredPlans, i as PermDockRevokedError, n as PermDockApprovalRequiredError, o as RevokedCode, r as PermDockDeniedError } from "./errors-BliKrfmP.js";
|
|
9
|
-
import { t as InstanceOptions } from "./instance-options-
|
|
9
|
+
import { t as InstanceOptions } from "./instance-options-D-SLCp4I.js";
|
|
10
10
|
import { t as RequestContext } from "./request-context-E3-ps-H_.js";
|
|
11
|
-
import { n as PermDockWrap, r as wrapPermDock, t as PermDockOverrides } from "./wrap-
|
|
11
|
+
import { n as PermDockWrap, r as wrapPermDock, t as PermDockOverrides } from "./wrap-B4Ge6LOd.js";
|
|
12
12
|
import { c as VersionCacheStats, d as memoryVersionCache, i as memorySubjectCache, l as VersionStore, n as SubjectCache, o as MemoryVersionCacheOptions, r as SubjectRecord, s as VersionCache, t as MemorySubjectCacheOptions, u as VersionStoreEntry } from "./subject-cache-Bn4oJY_R.js";
|
|
13
13
|
import { t as JsonSchemaNode } from "./json-schema-DAeA-lJa.js";
|
|
14
14
|
import { t as approvalFingerprint } from "./token-BgswTQzt.js";
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { c as isConditionDate, i as principal, l as isConditionRef, n as context, o as hasConditionOp, s as isCondition, t as claim, u as isSqlFunctionField } from "./refs-Cix9Zjis.js";
|
|
2
2
|
import { a as deny, m as opaque, n as role, r as allow, t as normalizeAssurance } from "./role-builder-BksM3Q9O.js";
|
|
3
|
-
import { A as memoryCustomRoleSource, C as signPolicyDocument, E as approvalPolicies, F as subjectMembershipSource, I as accessOutcome, L as sqlFunction, M as memoryMembershipSource, N as memorySettingsSource, O as memoryApprovalPolicySource, P as memorySnapshotSource, S as runtimeCacheVersionStore, T as stripeEntitlementSource, _ as localSnapshotManifest, a as normalizeMembership, b as simulateArazzo, c as crud, d as snapshotFor, f as assignableFor, g as shadowMode, h as mayAccess, i as decideRoleChange, j as memoryEntitlementSource, k as validateApprovalPolicy, l as readable, m as decideCustomRole, n as toCsvRow, o as normalizeMemberships, p as customRoleSource, r as checkRoleChange, s as resolveScope, t as CSV_COLUMNS, u as writable, v as customRoleRecord, w as memoryRelationSource, x as postgresCacheVersionStore, y as arazzoFindings } from "./src-
|
|
3
|
+
import { A as memoryCustomRoleSource, C as signPolicyDocument, E as approvalPolicies, F as subjectMembershipSource, I as accessOutcome, L as sqlFunction, M as memoryMembershipSource, N as memorySettingsSource, O as memoryApprovalPolicySource, P as memorySnapshotSource, S as runtimeCacheVersionStore, T as stripeEntitlementSource, _ as localSnapshotManifest, a as normalizeMembership, b as simulateArazzo, c as crud, d as snapshotFor, f as assignableFor, g as shadowMode, h as mayAccess, i as decideRoleChange, j as memoryEntitlementSource, k as validateApprovalPolicy, l as readable, m as decideCustomRole, n as toCsvRow, o as normalizeMemberships, p as customRoleSource, r as checkRoleChange, s as resolveScope, t as CSV_COLUMNS, u as writable, v as customRoleRecord, w as memoryRelationSource, x as postgresCacheVersionStore, y as arazzoFindings } from "./src-CYKqpYUM.js";
|
|
4
4
|
import { d as manager, f as user, n as anyOf, o as holder, t as allOf } from "./approvers-BkY_ZfWl.js";
|
|
5
5
|
import { n as PermDockValidationError } from "./validation-error-CgDOA6VS.js";
|
|
6
6
|
import { r as requiredPlans } from "./problem-details-EJHcvYCz.js";
|
|
@@ -15,7 +15,7 @@ import { t as requiresApproval } from "./approval-required-B-R4Yw3J.js";
|
|
|
15
15
|
import { r as sha256Digest } from "./sha256-DFsnyVPo.js";
|
|
16
16
|
import { t as approvalFingerprint } from "./token-CSljQqzA.js";
|
|
17
17
|
import { n as parseSnapshot } from "./snapshot-Dzi4LR6n.js";
|
|
18
|
-
import { n as getPermDockSync, p as clientBundle, t as getPermDock, v as isGlobalPermission } from "./permdock-
|
|
18
|
+
import { n as getPermDockSync, p as clientBundle, t as getPermDock, v as isGlobalPermission } from "./permdock-DZmr2kJw.js";
|
|
19
19
|
import { r as parsePermDockDigest } from "./digest-BaP8bQzX.js";
|
|
20
20
|
import { n as PermDockDeniedError, r as PermDockRevokedError, t as PermDockApprovalRequiredError } from "./errors-DOSkVeTC.js";
|
|
21
21
|
import { t as memoryRevocationFeed } from "./revocations-3jyzniOz.js";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { a as decodePreset, g as resolvePreset, i as presetFlags, n as generatePreset, o as encodePreset } from "./preset-BcFDaeqd.js";
|
|
2
2
|
import { n as CliError } from "./errors-DgLOqc6j.js";
|
|
3
3
|
import { t as applyFiles } from "./files-DuV7wRim.js";
|
|
4
|
-
import { o as nonEmptyOr } from "./output-
|
|
4
|
+
import { o as nonEmptyOr } from "./output-DNbj0_Yi.js";
|
|
5
5
|
import { t as addLine } from "./peer-D77JpXe-.js";
|
|
6
6
|
import { existsSync } from "node:fs";
|
|
7
7
|
import { join } from "node:path";
|
|
@@ -48,7 +48,7 @@ const init = defineLeaf({
|
|
|
48
48
|
...forceFlag
|
|
49
49
|
},
|
|
50
50
|
async run(ctx, { flags }) {
|
|
51
|
-
const [{ runInit }, { packageManagerOf }] = await Promise.all([import("./init-
|
|
51
|
+
const [{ runInit }, { packageManagerOf }] = await Promise.all([import("./init-Bg0vS1LV.js"), import("./peer-BWTpSLs2.js")]);
|
|
52
52
|
const agent = await packageManagerOf(ctx.cwd);
|
|
53
53
|
const selection = {
|
|
54
54
|
archetype: flags.archetype,
|
|
@@ -79,7 +79,7 @@ const presetDecode = defineLeaf({
|
|
|
79
79
|
positionals: presetCode,
|
|
80
80
|
flags: {},
|
|
81
81
|
async run(_ctx, { args }) {
|
|
82
|
-
const { runPreset } = await import("./init-
|
|
82
|
+
const { runPreset } = await import("./init-Bg0vS1LV.js");
|
|
83
83
|
return runPreset("decode", args["code"] ?? "");
|
|
84
84
|
}
|
|
85
85
|
});
|
|
@@ -87,7 +87,7 @@ const presetUrl = defineLeaf({
|
|
|
87
87
|
positionals: presetCode,
|
|
88
88
|
flags: {},
|
|
89
89
|
async run(_ctx, { args }) {
|
|
90
|
-
const { runPreset } = await import("./init-
|
|
90
|
+
const { runPreset } = await import("./init-Bg0vS1LV.js");
|
|
91
91
|
return runPreset("url", args["code"] ?? "");
|
|
92
92
|
}
|
|
93
93
|
});
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as configuredTableReads, o as functionShares } from "./table-reads-
|
|
1
|
+
import { n as configuredTableReads, o as functionShares } from "./table-reads-B5kunhny.js";
|
|
2
2
|
// src/cli/rls/inspect-functions.ts
|
|
3
3
|
/**
|
|
4
4
|
* `permdock supabase inspect --functions <pattern>`: for each function the
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { o as PermDockOptions } from "./permdock-
|
|
1
|
+
import { o as PermDockOptions } from "./permdock-CHU1LZGq.js";
|
|
2
2
|
type InstanceKey = "memberships" | "relations" | "entitlements" | "customRoles" | "policies" | "approvalPolicies" | "sink" | "limits" | "principals" | "instances";
|
|
3
3
|
/**
|
|
4
4
|
* The data sources an adapter passes through to every instance it creates. Each
|
|
@@ -8,7 +8,7 @@ import { t as compactMembershipsSql } from "./membership-claim-sql-DGfhIn__.js";
|
|
|
8
8
|
import { a as quoteIdent, c as quoteTable, i as qualified, n as declaredArray, o as quoteLiteral, r as helperSchema, s as quoteQualified } from "./quote-LNaBdCGA.js";
|
|
9
9
|
import { C as tenantTypeOf, a as kindFilterSql, d as subjectClaimSql, f as subjectIdSql, i as keyTenantSql, r as globalKindFilterSql, s as memberVia, u as subjectClaimJsonSql, x as scopeTypeOf } from "./subject-B7p94Y0s.js";
|
|
10
10
|
import { i as allowEntry, o as rootName, r as HELPERS, s as signedIn, t as CUSTOM_ROLES } from "./shared-DnVY767H.js";
|
|
11
|
-
import { S as scopeTable, _ as memberRoleOf, h as memberIdsHelper, o as hasMemberFor, x as scopeSources } from "./names-
|
|
11
|
+
import { S as scopeTable, _ as memberRoleOf, h as memberIdsHelper, o as hasMemberFor, x as scopeSources } from "./names-DwGleRKB.js";
|
|
12
12
|
import { n as byKey } from "./compare-8SNJN-9U.js";
|
|
13
13
|
// src/cli/sql/active.ts
|
|
14
14
|
function checkActiveRow(label, row) {
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { l as storedApprovalToken, s as resumeDecision } from "./helpers-COh0lLc1.js";
|
|
2
2
|
import { n as tenantScope, t as actorFrom } from "./adapter-context-lHq_i_77.js";
|
|
3
|
-
import { u as withApp } from "./permdock-
|
|
4
|
-
import { n as resolveOrNull } from "./build-instance-
|
|
3
|
+
import { u as withApp } from "./permdock-DZmr2kJw.js";
|
|
4
|
+
import { n as resolveOrNull } from "./build-instance-CZg_Bf45.js";
|
|
5
5
|
import { t as compact } from "./compact-C4LFuqbW.js";
|
|
6
6
|
import { t as actorMayCallTool } from "./delegation-0DVVomzu.js";
|
|
7
|
-
import { n as requestContext, t as buildReportingInstance } from "./request-context-
|
|
7
|
+
import { n as requestContext, t as buildReportingInstance } from "./request-context-LvIolknK.js";
|
|
8
8
|
import { n as resourceRef } from "./resource-ref-BiQtFK-I.js";
|
|
9
9
|
import { n as describe } from "./describe-B7EosIKA.js";
|
|
10
10
|
import { a as deniedMessage } from "./errors-DOSkVeTC.js";
|
|
@@ -24,7 +24,7 @@ const keysRename = defineLeaf({
|
|
|
24
24
|
}
|
|
25
25
|
},
|
|
26
26
|
async run(ctx, { flags, args }) {
|
|
27
|
-
const { runKeysRename } = await import("./rename-
|
|
27
|
+
const { runKeysRename } = await import("./rename-Dp47Gs_j.js");
|
|
28
28
|
const migration = given(flags.migration);
|
|
29
29
|
return runKeysRename({
|
|
30
30
|
cwd: ctx.cwd,
|
package/dist/kysely/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Ar as Subject, Fr as Condition, qt as Instant } from "../policy-types-DuM3k5Ao.js";
|
|
2
2
|
import { n as RowCheck, t as WithSubjectOptions } from "../subject-settings-C9F1sU1d.js";
|
|
3
|
-
import { p as WhereResult } from "../permdock-
|
|
4
|
-
import { s as MembershipsMapping } from "../compile-
|
|
3
|
+
import { p as WhereResult } from "../permdock-CHU1LZGq.js";
|
|
4
|
+
import { s as MembershipsMapping } from "../compile-CyUn58lf.js";
|
|
5
5
|
import { r as RelationsMapping } from "../graph-sql-Ds3nbevr.js";
|
|
6
6
|
type KyselySelectQuery = {
|
|
7
7
|
select: (expr: unknown) => KyselySelectQuery;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as PermDockProviderProps } from "./types-
|
|
1
|
+
import { n as PermDockProviderProps } from "./types-iwSmOTcK.js";
|
|
2
2
|
import { ReactElement } from "react";
|
|
3
3
|
declare function PermDockProvider(props: PermDockProviderProps): ReactElement;
|
|
4
4
|
export { PermDockProvider as t };
|