permdock 0.3.1 → 0.4.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 +7 -5
- package/dist/a2a/index.js +14 -21
- package/dist/ai-sdk/index.d.ts +18 -6
- package/dist/ai-sdk/index.js +8 -5
- package/dist/app-data-CV8pqqMi.js +59 -0
- package/dist/approvals/index.d.ts +2 -2
- package/dist/approvals/index.js +3 -3
- package/dist/{approvals-DbYAuNkG.js → approvals-DZL76lKW.js} +35 -19
- package/dist/{approvers-DT4AVyIg.js → approvers-CqPOLD-o.js} +1 -1
- package/dist/{arazzo-BAgw9ap6.js → arazzo-C4BcskbX.js} +6 -5
- package/dist/{arazzo-C9chp3ST.js → arazzo-CD8d0WLb.js} +2 -2
- package/dist/authzen/index.d.ts +3 -3
- package/dist/authzen/index.js +161 -23
- package/dist/better-auth/index.d.ts +2 -2
- package/dist/better-auth/index.js +6 -19
- package/dist/better-supabase/index.d.ts +112 -87
- package/dist/better-supabase/index.js +257 -156
- package/dist/{bind-C_ob3LKa.d.ts → bind-BzqG8SMb.d.ts} +16 -5
- package/dist/{bind-CuzGytRf.js → bind-kk-uyCwH.js} +14 -6
- package/dist/build-instance-DIIV9DbC.js +51 -0
- package/dist/{canonical-json-DemiK4Vp.js → canonical-json-CFKyFOke.js} +1 -3
- package/dist/{capability-2kYTMWDv.d.ts → capability-CksyCWDH.d.ts} +2 -2
- package/dist/{capability-4qPdO9gk.js → capability-txATtKV4.js} +3 -2
- package/dist/catalog/index.d.ts +1 -1
- package/dist/catalog/index.js +1 -1
- package/dist/catalog-6yWAX6Ps.js +2 -0
- package/dist/{catalog-CYj-mX2O.js → catalog-WHG4kBq7.js} +2 -2
- package/dist/{catalog-doc-DdGm82XT.js → catalog-doc-DWtg0gGR.js} +17 -10
- package/dist/{catalog-DWF5cYqB.js → catalog-tZUyOfOv.js} +4 -4
- package/dist/claude-agent/index.d.ts +4 -4
- package/dist/claude-agent/index.js +4 -5
- package/dist/clerk/index.d.ts +3 -3
- package/dist/clerk/index.js +8 -33
- package/dist/cli/bin.js +1 -1
- package/dist/cli/index.d.ts +3 -3
- package/dist/cli/index.js +3 -3
- package/dist/cloud/index.d.ts +4 -4
- package/dist/cloud/index.js +9 -15
- package/dist/{cloud-CfwZ39Rl.js → cloud-C7bSDgX4.js} +2 -2
- package/dist/{cloud-DWLXO2af.js → cloud-PeBN3IEn.js} +5 -5
- package/dist/{collect-DSTE3ml9.js → collect-2SrB7lfk.js} +6 -8
- package/dist/collect-Bw2Jdq1q.js +2 -0
- package/dist/{collect-CHB22Sx4.js → collect-CQx4hX4N.js} +3 -3
- package/dist/{commands-BeaGNj_o.js → commands-Cpip4ULx.js} +13 -13
- package/dist/{compact-y6vfu2_f.js → compact-CAf557ZB.js} +11 -1
- package/dist/compile/index.d.ts +1 -1
- package/dist/compile/index.js +1 -1
- package/dist/{compile-Ba4blROR.js → compile-CcEu2ZQ1.js} +6 -5
- package/dist/{compile-BkRyBDBw.d.ts → compile-CtTP7eur.d.ts} +2 -2
- package/dist/{config-BJiM-xAm.js → config-BIjREpyE.js} +4 -4
- package/dist/{config-ir40y8m0.js → config-DLt6BvV7.js} +2 -2
- package/dist/{config-report-CdCgbRnV.js → config-report--Xb9APJS.js} +5 -6
- package/dist/{connection-CU8MQxRi.js → connection-DUsczpB5.js} +3 -2
- package/dist/constants-DcJABbLW.js +20 -0
- package/dist/{context-Bcy85rGi.js → context-DieZVJXu.js} +16 -5
- package/dist/convex/index.d.ts +4 -4
- package/dist/convex/index.js +14 -16
- package/dist/create-BBO24vj6.js +324 -0
- package/dist/{credential-8P81ff4u.js → credential-kue0qpbm.js} +4 -4
- package/dist/deciding-columns-Sq12mEA6.js +123 -0
- package/dist/delegation-input-FTxMK3ji.js +19 -0
- package/dist/denied-text-DfRk15uw.d.ts +19 -0
- package/dist/{describe-DMYiCjJV.d.ts → describe-C3ldA9os.d.ts} +11 -2
- package/dist/{describe-B_gVZEVi.js → describe-Cgkp7eP0.js} +5 -4
- package/dist/{diff-C9RDjjhs.js → diff-Cnghh_Ip.js} +2 -2
- package/dist/{diff-2VaeChzX.js → diff-rpqoe7Ag.js} +9 -9
- package/dist/{doctor-Djh6JDEk.js → doctor-CuVJvhV_.js} +2 -2
- package/dist/doctor-owlv6ddh.js +2166 -0
- package/dist/drizzle/index.d.ts +2 -2
- package/dist/drizzle/index.js +6 -14
- package/dist/elysia/index.d.ts +4 -4
- package/dist/elysia/index.js +7 -7
- package/dist/{errors-DPdqI50v.d.ts → errors-OD_4c__H.d.ts} +2 -2
- package/dist/{errors-Cz5zn0mW.js → errors-drnfxYtm.js} +3 -3
- package/dist/{evaluations-tz6D9A2G.js → evaluations-C9YJsv3H.js} +45 -7
- package/dist/eve/index.d.ts +5 -5
- package/dist/eve/index.js +5 -5
- package/dist/express/index.d.ts +4 -4
- package/dist/express/index.js +8 -7
- package/dist/fastify/index.d.ts +15 -5
- package/dist/fastify/index.js +9 -29
- package/dist/fields-fwfXN01n.js +1016 -0
- package/dist/{files-DWUN9PzI.js → files-D_JIzUrP.js} +12 -3
- package/dist/{fixtures-ht28Cplr.js → fixtures-h2eG2OZV.js} +5 -6
- package/dist/{from-snapshot-CTLijvdm.js → from-snapshot-7REQZe0H.js} +32 -22
- package/dist/{generate-CH7ThJ14.js → generate-CNU1pIOo.js} +1 -3
- package/dist/grantee-CXY-0C87.js +254 -0
- package/dist/grantee-conditions-MQs5NIuX.js +270 -0
- package/dist/grantee-match-fxYp9Nmt.js +141 -0
- package/dist/{helpers-H_KARDVC.js → helpers-C9YmyBIa.js} +7 -6
- package/dist/hono/index.d.ts +4 -4
- package/dist/hono/index.js +8 -8
- package/dist/hosted-CBHgkzDl.js +655 -0
- package/dist/{http-SO7qGttf.js → http-BBoKefeS.js} +35 -2
- package/dist/{http-BIhmLfCc.js → http-BEbdMZ05.js} +2 -24
- package/dist/{rls-import-4lLW_pbb.js → import-BFIlhetD.js} +86 -80
- package/dist/{openapi-import-cmwetbzw.js → import-UHk1N7vH.js} +6 -7
- package/dist/{index-C8z4RjQV.d.ts → index-BwMe94Xq.d.ts} +1 -1
- package/dist/{index-0nNqHspG.d.ts → index-DgM7w96K.d.ts} +2 -2
- package/dist/{index-C7Tw7MaW.d.ts → index-Dz7didpC.d.ts} +3 -3
- package/dist/{index-BNc7Wer_.d.ts → index-UdVQgq48.d.ts} +105 -38
- package/dist/index.d.ts +15 -13
- package/dist/index.js +22 -22
- package/dist/{instance-options-jARdwfPN.d.ts → instance-options-plkrsAog.d.ts} +1 -1
- package/dist/{json-schema-BsAflUGW.js → json-schema-DBkdUuCO.js} +1 -3
- package/dist/jwt/index.d.ts +4 -4
- package/dist/jwt/index.js +13 -13
- package/dist/{kernel-_RRHmnMY.js → kernel-CB3LrIJM.js} +81 -32
- package/dist/kysely/index.d.ts +2 -2
- package/dist/kysely/index.js +6 -14
- package/dist/{live-options-H2eG8dfJ.js → live-options-BaAFCIiu.js} +16 -3
- package/dist/load-B_shHrmd.js +2 -0
- package/dist/{load-DhWEB9P1.js → load-C3_oTHyO.js} +11 -3
- package/dist/{manifest-iaoBXHKc.js → manifest-BngWKryL.js} +5 -18
- package/dist/{map-claims-Z4QZOiFF.js → map-claims-AVlBaJoa.js} +7 -16
- package/dist/{map-error-pgUWNNtG.js → map-error-BE27PYkE.js} +5 -5
- package/dist/{markers-B0hYLvMD.js → markers-CiwAOZtO.js} +6 -2
- package/dist/{may-use-DndQ5tQ-.js → may-use-BOn_dR_w.js} +4 -3
- package/dist/mcp/index.d.ts +26 -9
- package/dist/mcp/index.js +456 -446
- package/dist/{rls-migrate-CN4TlJTO.js → migrate-BwlB5-Wk.js} +75 -15
- package/dist/nest/index.d.ts +4 -4
- package/dist/nest/index.js +11 -12
- package/dist/next/index.d.ts +31 -8
- package/dist/next/index.js +29 -33
- package/dist/next/plugin.d.ts +1 -1
- package/dist/next/plugin.js +1 -1
- package/dist/node/index.d.ts +4 -4
- package/dist/node/index.js +4 -4
- package/dist/ocsf-uYFXGVw2.js +115 -0
- package/dist/openai/index.d.ts +5 -5
- package/dist/openai/index.js +4 -4
- package/dist/openapi/index.d.ts +3 -3
- package/dist/openapi/index.js +1 -1
- package/dist/{openapi-CqqEbHsL.js → openapi-BJdBmYDG.js} +19 -23
- package/dist/{openapi-BqRBvAng.js → openapi-DBzHQbov.js} +2 -5
- package/dist/{openapi-CQTsgKoB.js → openapi-DcQ1Kg40.js} +3 -3
- package/dist/orpc/index.d.ts +5 -5
- package/dist/orpc/index.js +9 -11
- package/dist/otel/index.d.ts +2 -2
- package/dist/otel/index.js +26 -23
- package/dist/output-files-CgIsvdSa.js +140 -0
- package/dist/{rls-ownership-DcYlZ09B.js → ownership-BgnbOJFT.js} +387 -379
- package/dist/{package-root-zGkxO3oN.js → package-root-DtNnpmUd.js} +3 -2
- package/dist/{parse-BuyjxhZV.js → parse-CVFQHk6c.js} +3 -3
- package/dist/{parse-local-manifest-BrMozJCo.js → parse-local-manifest-C-q02Pal.js} +2 -4
- package/dist/{parse-local-manifest-JLnaBH0S.d.ts → parse-local-manifest-DvYUR0QL.d.ts} +1 -1
- package/dist/pdp/index.d.ts +2 -2
- package/dist/pdp/index.js +8 -9
- package/dist/{permdock-CbgvLnuo.js → permdock-L26udHSk.js} +1387 -1220
- package/dist/{rls-fields-CZOMlwHl.js → permission-keys-B26jeyUv.js} +1268 -2053
- package/dist/permission-registry-BsblpB-z.js +385 -0
- package/dist/{permissions-DttnqqxC.d.ts → permission-types-Dg39z9Kv.d.ts} +59 -31
- package/dist/{permissions-RJrovw98.js → permissions-CCJ6lmxB.js} +3 -3
- package/dist/{permissions-CDgvKG5L.d.ts → permissions-COH-KRgT.d.ts} +2 -2
- package/dist/{policy-IB6yxpC3.d.ts → policy-types-sp9P1iIV.d.ts} +661 -582
- package/dist/{policy-D2W7uv19.d.ts → policy-ur0BBK_e.d.ts} +2 -2
- package/dist/{powersync-DE19b9dT.js → powersync-BFSbSElQ.js} +2 -2
- package/dist/powersync-DCDgZgfZ.js +2 -0
- package/dist/{powersync-Dv1_aWF7.js → powersync-cZe4kzhL.js} +26 -27
- package/dist/prisma/index.d.ts +1 -1
- package/dist/prisma/index.js +6 -12
- package/dist/{problem-B43ztKIm.js → problem-CnWraVhC.js} +8 -7
- package/dist/{problem-details-_AMOYz-w.js → problem-details-DECUnXAn.js} +2 -2
- package/dist/{problem-details-DX075l9V.d.ts → problem-details-rIIo8B2C.d.ts} +1 -1
- package/dist/{protected-BdnIEFkY.d.ts → protected-B3_P7xuw.d.ts} +9 -6
- package/dist/{protected-utU-SLuy.js → protected-BN7BUdY1.js} +20 -8
- package/dist/{provider-CSQd7m92.js → provider-Bi-0HNL3.js} +23 -10
- package/dist/{provider-DZY281jO.d.ts → provider-kwHC9CZD.d.ts} +1 -1
- package/dist/{provider-store-Cfbvo4DE.js → provider-store-Ctt-81Ni.js} +6 -3
- package/dist/react/index.d.ts +7 -7
- package/dist/react/index.js +5 -5
- package/dist/react/provider-client.d.ts +1 -1
- package/dist/react/provider-client.js +1 -1
- package/dist/react-native/index.d.ts +20 -11
- package/dist/react-native/index.js +33 -17
- package/dist/{refs-KYb4ntaz.js → refs-f3imMjNW.js} +1 -1
- package/dist/relation-walk-BXnlLtg2.js +186 -0
- package/dist/relations-CvmSpG67.js +163 -0
- package/dist/{replay-CYyiLiwO.d.ts → replay-COpmZUfx.d.ts} +1 -1
- package/dist/request-context-BVM7aWNs.js +71 -0
- package/dist/request-context-C2_1lchh.d.ts +5 -0
- package/dist/resource-relations-D1Un3pcz.js +243 -0
- package/dist/retire-BFcxL6un.js +240 -0
- package/dist/{rls-P-BeBx0n.js → rls-55DQTuf5.js} +14 -2
- package/dist/{rls-DiinlRML.js → rls-BEktUaqg.js} +884 -484
- package/dist/{policy-xyWg7QdR.js → role-builder-B4GbKM-i.js} +235 -541
- package/dist/{rpc-DL9Sqvb1.js → rpc-nYC3cR_u.js} +15 -5
- package/dist/{run-BWc9qqvE.js → run-DMcNW_8T.js} +3 -3
- package/dist/{runtime-CB8gQFvS.js → runtime-D_tMXnsq.js} +1 -1
- package/dist/{saas-DhpJjnBA.js → saas-DtaA4JuW.js} +9 -8
- package/dist/{openapi-schema--ARjyfQr.js → schema-Bol6gqXA.js} +3 -5
- package/dist/{schema-D3MnDMxa.js → schema-DjQBcAP9.js} +4 -2
- package/dist/scim/index.d.ts +1 -1
- package/dist/scim/index.js +1 -1
- package/dist/{scim-BFGBBAqR.js → scim-vFR1O5oG.js} +6 -12
- package/dist/{scopes-CVdPrWN-.js → scopes-tvpa34ep.js} +10 -2
- package/dist/server/index.d.ts +18 -8
- package/dist/server/index.js +8 -8
- package/dist/{server-DlZ28Oz5.js → server-ZYEHtNHS.js} +4 -4
- package/dist/{create-B1d519XK.d.ts → server-types-DdqBwZN_.d.ts} +69 -33
- package/dist/shared-1uhI-e-b.js +294 -0
- package/dist/{shared-DRu8VFVM.js → shared-JhMeOsDF.js} +1 -1
- package/dist/{sink-Bd9PSyfq.js → sink-BTtmfPnE.js} +1 -1
- package/dist/{sink-B1fZzIMf.d.ts → sink-CPN4zLfs.d.ts} +1 -1
- package/dist/{skills-Biq5uup3.js → skills-BZdRQkxs.js} +4 -3
- package/dist/{skills-C5CbhhpG.js → skills-Dle4ZoLF.js} +2 -2
- package/dist/{snapshot-Enxd0n-s.js → snapshot-Dc9CHPME.js} +116 -13
- package/dist/{snapshot-cache-D6jLelln.js → snapshot-cache-Cod40D-X.js} +1 -1
- package/dist/{snapshot-cache-B-LxUahj.d.ts → snapshot-cache-J5T7t_vD.d.ts} +1 -1
- package/dist/solid/index.d.ts +22 -22
- package/dist/solid/index.js +40 -10
- package/dist/{sources-4p0-4xQm.js → sources-B1-b-R0t.js} +25 -26
- package/dist/{sources-BdOYLw9j.d.ts → sources-Dljy06zL.d.ts} +6 -2
- package/dist/{sql-xdg5f4Fi.js → sql-t8teWOfo.js} +19 -3
- package/dist/{src-BDwEZWrZ.js → src-Bb7no-hS.js} +194 -123
- package/dist/ssf/index.d.ts +3 -3
- package/dist/ssf/index.js +58 -61
- package/dist/store-9KO4BlkB.d.ts +147 -0
- package/dist/{store-DMAWwAJV.js → store-ILkLUj_o.js} +4 -4
- package/dist/{store-options-ByhZq1jV.js → store-options-CbUHDoSe.js} +16 -7
- package/dist/{stores-BT2pSCub.js → stores-BHXdSbw9.js} +7 -3
- package/dist/stores-Cxz_80g-.d.ts +31 -0
- package/dist/{stream-DDpvynSB.js → stream-BMui98KK.js} +2 -1
- package/dist/{stream-D1RXubw2.d.ts → stream-Dwsg6WwE.d.ts} +2 -2
- package/dist/{subject-settings-BwBmCdTR.js → subject-settings-CkEwrw3W.js} +23 -5
- package/dist/supabase/index.d.ts +4 -4
- package/dist/supabase/index.js +3 -3
- package/dist/supabase/middleware.d.ts +11 -5
- package/dist/supabase/middleware.js +10 -7
- package/dist/{supabase-C0qESOa-.js → supabase-C1TWlnYt.js} +36 -52
- package/dist/{supabase-s4o9s1O1.js → supabase-Dbqr141s.js} +2 -2
- package/dist/supabase-hook-BULg7Ut_.js +2 -0
- package/dist/{supabase-hook-ntETYCQu.js → supabase-hook-Cva3ikXz.js} +730 -781
- package/dist/{supautils-u8jXTGrt.js → supautils-B6HYL9eL.js} +2 -2
- package/dist/svelte/Protected.svelte +9 -2
- package/dist/svelte/index.d.ts +6 -6
- package/dist/svelte/index.js +25 -11
- package/dist/svelte/runtime.d.ts +10 -3
- package/dist/svelte/runtime.js +4 -3
- package/dist/svelte/source.d.ts +6 -6
- package/dist/svelte/source.js +4 -4
- package/dist/{validity-uOp8UpYn.js → tenancy-DshjqY0n.js} +3 -39
- package/dist/terminal/index.d.ts +5 -5
- package/dist/terminal/index.js +18 -34
- package/dist/testing/index.d.ts +89 -77
- package/dist/testing/index.js +1276 -1262
- package/dist/testing/saas/index.d.ts +4 -4
- package/dist/testing/saas/index.js +2 -2
- package/dist/testing/saas/permissions.d.ts +1 -1
- package/dist/testing/saas/permissions.js +1 -1
- package/dist/thenable-QSmvt-vZ.js +65 -0
- package/dist/{token-CIWxJOCh.js → token-Bx9qy30p.js} +1 -1
- package/dist/tool-refusal-CQ7OEia9.js +41 -0
- package/dist/trpc/index.d.ts +5 -5
- package/dist/trpc/index.js +7 -8
- package/dist/{types-DbjRN55U.d.ts → types-7rJVLWe5.d.ts} +82 -4
- package/dist/{types-aqOHTHcp.d.ts → types-Br9IXUBG.d.ts} +1 -1
- package/dist/types-ByUo56un.d.ts +88 -0
- package/dist/{types-Cq_H8N_X.d.ts → types-C0dee0Qf.d.ts} +2 -2
- package/dist/{types-DxiCGmmd.d.ts → types-CIlTojhq.d.ts} +2 -2
- package/dist/{types-QCuYJh4q.d.ts → types-CUcFZfpU.d.ts} +1 -1
- package/dist/{types-C97IskBw.d.ts → types-CqrjB9o6.d.ts} +1 -1
- package/dist/{types-BnIEz1sU.d.ts → types-DHrmBJLH.d.ts} +24 -6
- package/dist/{types-Dnemwd77.d.ts → types-DpWfQdSh.d.ts} +5 -1
- package/dist/{types-Bvc4oWT6.d.ts → types-DvupZE0w.d.ts} +1 -1
- package/dist/unplugin/index.d.ts +1 -1
- package/dist/unplugin/index.js +1 -1
- package/dist/{usage-B0YuTQRO.js → usage-4G6t643F.js} +2 -2
- package/dist/{usage-ItS7nLcl.js → usage-CG9nOYZw.js} +7 -7
- package/dist/usage-iFLJ0-rr.js +2 -0
- package/dist/{validation-error-Ba264OaJ.d.ts → validation-error-BSSw0l_8.d.ts} +1 -1
- package/dist/{validation-error-CnjZ4t92.js → validation-error-ZfUHbKvf.js} +1 -1
- package/dist/validity-dVrUEPJt.js +62 -0
- package/dist/{verifier-BxBo6I44.js → verifier-DMr_Zmb_.js} +51 -15
- package/dist/{rls-verify-CMv9H3wV.js → verify-BztUB3GX.js} +668 -239
- package/dist/{version-BvacVTZR.js → version-BEogC-rB.js} +1 -1
- package/dist/{views-Soe7bGSC.js → views-CJsrBS1f.js} +23 -1
- package/dist/{vocabulary-DA8a8zif.d.ts → vocabulary-hhEFLFoL.d.ts} +15 -6
- package/dist/vue/index.d.ts +24 -19
- package/dist/vue/index.js +24 -8
- package/dist/watch-C8TpsAl4.js +2 -0
- package/dist/{watch-DVBJ9cBq.js → watch-zeucB7eF.js} +6 -6
- package/dist/webmcp/index.d.ts +2 -2
- package/dist/webmcp/index.js +13 -37
- package/dist/wrap-Cr93qqdP.d.ts +14 -0
- package/dist/wrap-DWsU_5Bd.js +26 -0
- package/package.json +8 -8
- package/schemas/catalog-v1.json +6 -0
- package/skills/permdock-credentials/SKILL.md +1 -1
- package/skills/permdock-credentials/references/tokens-keys-links.md +7 -2
- package/skills/permdock-data/references/queries-and-rls.md +4 -0
- package/skills/permdock-tenancy/references/ownership-and-custom-roles.md +1 -0
- package/skills/permdock-wire/SKILL.md +2 -2
- package/skills/permdock-wire/references/adapters.md +9 -1
- package/skills/permdock-wire/references/policy-options.md +10 -1
- package/dist/catalog-CRW5Mx_B.js +0 -2
- package/dist/collect-DSWOk19R.js +0 -2
- package/dist/create-CMwIl-w2.js +0 -253
- package/dist/delegation-D8pUEuce.js +0 -103
- package/dist/doctor-DvH0IQff.js +0 -1194
- package/dist/doctor-collect-CjdO0wQX.js +0 -665
- package/dist/evaluation-items-CfCCejQd.js +0 -40
- package/dist/fields-BMl1RxoX.js +0 -26
- package/dist/grantee-Cv5Sogfv.js +0 -602
- package/dist/hosted-DJQw46hn.js +0 -266
- package/dist/instance-options-Dhhcnm3y.js +0 -22
- package/dist/load-DwJUafYN.js +0 -2
- package/dist/map-AcxK9o_D.js +0 -147
- package/dist/permissions-DVoF6dMt.js +0 -662
- package/dist/powersync-CrBX8hY6.js +0 -2
- package/dist/protected-xAr24FEC.d.ts +0 -40
- package/dist/relations-cjOL01hZ.js +0 -505
- package/dist/rls-graph-CHwx0V8q.js +0 -435
- package/dist/rls-shared-Cewd_-zI.js +0 -495
- package/dist/store-jOBYpiXC.d.ts +0 -36
- package/dist/stores-C0IMQrGI.d.ts +0 -52
- package/dist/supabase-config-Bj3iDH2I.js +0 -472
- package/dist/supabase-hook-gd3s8bxB.js +0 -2
- package/dist/thenable-okc2xDsj.js +0 -10
- package/dist/types-CKNSyIf_.d.ts +0 -52
- package/dist/usage-DorAJiU_.js +0 -2
- package/dist/watch-BwxLTYMZ.js +0 -2
package/dist/solid/index.js
CHANGED
|
@@ -1,14 +1,15 @@
|
|
|
1
|
-
import { t as compact } from "../compact-
|
|
2
|
-
import { r as requiredPlans } from "../problem-details-
|
|
3
|
-
import { t as describe } from "../describe-
|
|
1
|
+
import { t as compact } from "../compact-CAf557ZB.js";
|
|
2
|
+
import { r as requiredPlans } from "../problem-details-DECUnXAn.js";
|
|
3
|
+
import { t as describe } from "../describe-Cgkp7eP0.js";
|
|
4
4
|
import { t as approvalHeaders } from "../headers-BZSDieNT.js";
|
|
5
|
-
import { i as isPromiseLike } from "../store-options-
|
|
6
|
-
import { a as
|
|
5
|
+
import { i as isPromiseLike } from "../store-options-CbUHDoSe.js";
|
|
6
|
+
import { a as permissionSet, c as scopedTenant, d as tenantView, i as livePermDock, l as slotContent, n as describeWith, o as protectedView, r as filterResult, s as rolesView, t as approvalHandle, u as subjectView } from "../views-CJsrBS1f.js";
|
|
7
7
|
import { n as boundaryFallback, t as boundaryDigest } from "../boundary-BM8a_P6E.js";
|
|
8
|
-
import { n as switchTenant, t as providerStore } from "../provider-store-
|
|
8
|
+
import { n as switchTenant, t as providerStore } from "../provider-store-Ctt-81Ni.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);
|
|
12
|
+
const PermDockUiContext = createContext({});
|
|
12
13
|
function useStore() {
|
|
13
14
|
const store = useContext(PermDockContext);
|
|
14
15
|
if (store === void 0) throw new Error("PermDock: hooks require <PermDockProvider>.");
|
|
@@ -85,6 +86,11 @@ function useApproval(decision) {
|
|
|
85
86
|
return approvalHandle(store, decision());
|
|
86
87
|
});
|
|
87
88
|
}
|
|
89
|
+
/** `describe` with the provider's `messages`; a call's own `messages` win. */
|
|
90
|
+
function useDescribe() {
|
|
91
|
+
const ui = useContext(PermDockUiContext);
|
|
92
|
+
return (decision, options) => describeWith(ui.messages)(decision, options);
|
|
93
|
+
}
|
|
88
94
|
//#endregion
|
|
89
95
|
//#region src/solid/boundary.ts
|
|
90
96
|
const BoundaryContext = createContext(null);
|
|
@@ -124,20 +130,25 @@ function usePermissionBoundary() {
|
|
|
124
130
|
//#region src/solid/protected.ts
|
|
125
131
|
function Protected(props) {
|
|
126
132
|
const root = usePermDock();
|
|
133
|
+
const ui = useContext(PermDockUiContext);
|
|
127
134
|
const local = usePermission(() => props.permission, () => props.data);
|
|
128
135
|
const scoped = createMemo(() => scopedTenant(root, props.tenant));
|
|
129
136
|
const view = createMemo(() => protectedView(local(), root, props.permission, props.data, scoped()));
|
|
130
137
|
const render = () => {
|
|
131
138
|
const current = view();
|
|
132
139
|
switch (current.slot) {
|
|
133
|
-
case "pending": return props.
|
|
134
|
-
case "fallback": return
|
|
140
|
+
case "pending": return slotContent("pending", props, ui.defaults) ?? null;
|
|
141
|
+
case "fallback": return content(slotContent("fallback", props, ui.defaults), current.decision);
|
|
142
|
+
case "approval": return content(slotContent("approval", props, ui.defaults), current.decision);
|
|
135
143
|
case "default": return typeof props.children === "function" ? props.children(current.decision) : props.children;
|
|
136
144
|
default: return current;
|
|
137
145
|
}
|
|
138
146
|
};
|
|
139
147
|
return render;
|
|
140
148
|
}
|
|
149
|
+
function content(slot, decision) {
|
|
150
|
+
return typeof slot === "function" ? slot(decision) : slot ?? null;
|
|
151
|
+
}
|
|
141
152
|
//#endregion
|
|
142
153
|
//#region src/solid/provider.ts
|
|
143
154
|
function PermDockProvider(props) {
|
|
@@ -150,7 +161,10 @@ function PermDockProvider(props) {
|
|
|
150
161
|
snapshotUrl: props.snapshotUrl,
|
|
151
162
|
approvals: props.approvals,
|
|
152
163
|
tenant: props.tenant,
|
|
153
|
-
maxAge: props.maxAge
|
|
164
|
+
maxAge: props.maxAge,
|
|
165
|
+
onSnapshot: props.onSnapshot,
|
|
166
|
+
onClear: props.onClear,
|
|
167
|
+
approvalInterval: props.approvalInterval
|
|
154
168
|
}), () => ({
|
|
155
169
|
headers: props.headers,
|
|
156
170
|
fetch: props.fetch,
|
|
@@ -177,12 +191,28 @@ function PermDockProvider(props) {
|
|
|
177
191
|
arrive = void 0;
|
|
178
192
|
}, { defer: initial !== void 0 }));
|
|
179
193
|
}
|
|
194
|
+
const ui = {
|
|
195
|
+
get defaults() {
|
|
196
|
+
return props.defaults;
|
|
197
|
+
},
|
|
198
|
+
get messages() {
|
|
199
|
+
return props.messages;
|
|
200
|
+
}
|
|
201
|
+
};
|
|
180
202
|
return createComponent(PermDockContext.Provider, {
|
|
181
203
|
value: store,
|
|
204
|
+
get children() {
|
|
205
|
+
return uiProvider(ui, props);
|
|
206
|
+
}
|
|
207
|
+
});
|
|
208
|
+
}
|
|
209
|
+
function uiProvider(ui, props) {
|
|
210
|
+
return createComponent(PermDockUiContext.Provider, {
|
|
211
|
+
value: ui,
|
|
182
212
|
get children() {
|
|
183
213
|
return props.children;
|
|
184
214
|
}
|
|
185
215
|
});
|
|
186
216
|
}
|
|
187
217
|
//#endregion
|
|
188
|
-
export { PermDockProvider, PermissionBoundary, Protected, approvalHeaders, describe, requiredPlans, useApproval, useAssignablePermissions, useAssignableRoles, useFilter, useMemberships, usePermDock, usePermission, usePermissionBoundary, usePermissions, useRoles, useSubject, useTenant };
|
|
218
|
+
export { PermDockProvider, PermissionBoundary, Protected, approvalHeaders, describe, requiredPlans, useApproval, useAssignablePermissions, useAssignableRoles, useDescribe, useFilter, useMemberships, usePermDock, usePermission, usePermissionBoundary, usePermissions, useRoles, useSubject, useTenant };
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { t as compact } from "./compact-
|
|
2
|
-
import {
|
|
1
|
+
import { r as isRecord, t as compact } from "./compact-CAf557ZB.js";
|
|
2
|
+
import { i as readAppData } from "./app-data-CV8pqqMi.js";
|
|
3
|
+
import { a as quoteSqlIdent, i as quoteQualifiedTable, l as sqlTextArray, o as quoteSqlLiteral, r as qualifySqlTable, s as quoteSqlTable } from "./sql-t8teWOfo.js";
|
|
3
4
|
//#region src/supabase/keep.ts
|
|
4
5
|
/** The permission keys of a suspended scope's `keep`, references read by `key`, sorted and unique. */
|
|
5
6
|
function keptKeys(row) {
|
|
@@ -106,12 +107,6 @@ function roleManifest(role) {
|
|
|
106
107
|
//#region src/supabase/sources.ts
|
|
107
108
|
const ident = (name) => quoteSqlIdent(name);
|
|
108
109
|
const literal = quoteSqlLiteral;
|
|
109
|
-
function qualifiedName(name) {
|
|
110
|
-
return name.includes(".") ? name : `public.${name}`;
|
|
111
|
-
}
|
|
112
|
-
function qualified(name) {
|
|
113
|
-
return quoteSqlTable(qualifiedName(name));
|
|
114
|
-
}
|
|
115
110
|
function col(name) {
|
|
116
111
|
return `m.${ident(name)}`;
|
|
117
112
|
}
|
|
@@ -124,10 +119,7 @@ function activeRow(row, id) {
|
|
|
124
119
|
parts.push(`s.${ident(row.status)}::text = any(array[${values.map(literal).join(", ")}]::text[])`);
|
|
125
120
|
}
|
|
126
121
|
if (row.disabledAt === void 0 && row.status === void 0) throw new TypeError("PermDock: a suspension table needs disabledAt or status");
|
|
127
|
-
return `exists (select 1 from ${
|
|
128
|
-
}
|
|
129
|
-
function textArray(values) {
|
|
130
|
-
return `array[${values.map(literal).join(", ")}]::text[]`;
|
|
122
|
+
return `exists (select 1 from ${quoteQualifiedTable(row.table)} s where ${parts.join(" and ")})`;
|
|
131
123
|
}
|
|
132
124
|
/**
|
|
133
125
|
* The suspendable instances on the row's chain whose scope keeps
|
|
@@ -163,8 +155,8 @@ function keptSql(shape) {
|
|
|
163
155
|
const list = keeping(shape);
|
|
164
156
|
if (list.length === 0) return;
|
|
165
157
|
const keys = [...new Set(list.flatMap((item) => item.keep))].toSorted();
|
|
166
|
-
const each = list.map((item) => `(${item.active} or k = any(${
|
|
167
|
-
return `(select jsonb_agg(k order by k) from unnest(${
|
|
158
|
+
const each = list.map((item) => `(${item.active} or k = any(${sqlTextArray(item.keep)}))`).join(" and ");
|
|
159
|
+
return `(select jsonb_agg(k order by k) from unnest(${sqlTextArray(keys)}) k where ${each})`;
|
|
168
160
|
}
|
|
169
161
|
function allActive(shape) {
|
|
170
162
|
return keeping(shape).map((item) => item.active).join(" and ");
|
|
@@ -204,6 +196,7 @@ function selectOf(shape, where, user, keep) {
|
|
|
204
196
|
`${shape.memberGroup} as member_group`,
|
|
205
197
|
`${shape.managed} as managed_by`,
|
|
206
198
|
`${shape.seats} as seats`,
|
|
199
|
+
...shape.x === void 0 ? [] : [`${col(shape.x)} as x`],
|
|
207
200
|
...keep ? [`${keepColumn(shape)} as keep`] : []
|
|
208
201
|
];
|
|
209
202
|
const group = [
|
|
@@ -212,14 +205,14 @@ function selectOf(shape, where, user, keep) {
|
|
|
212
205
|
...keepsDisabled(shape) && shape.disabledAt !== void 0 ? [`(${enabled(shape.disabledAt)})`] : []
|
|
213
206
|
];
|
|
214
207
|
return `select ${fields.join(", ")}
|
|
215
|
-
from ${
|
|
208
|
+
from ${quoteQualifiedTable(shape.table)} m${shape.join}
|
|
216
209
|
where ${where.join("\n and ")}
|
|
217
210
|
group by ${group.join(", ")}`;
|
|
218
211
|
}
|
|
219
212
|
function holdersOf(shape) {
|
|
220
213
|
const id = ident(shape.idColumn);
|
|
221
214
|
return {
|
|
222
|
-
idType: `${
|
|
215
|
+
idType: `${quoteQualifiedTable(shape.table)}.${id}%type`,
|
|
223
216
|
id: (scope, row) => {
|
|
224
217
|
const filter = shape.holds(scope, row);
|
|
225
218
|
return filter === void 0 ? "null::text" : filter === "true" ? `${row}.${id}::text` : `case when ${filter} then ${row}.${id}::text end`;
|
|
@@ -231,7 +224,7 @@ function holdersOf(shape) {
|
|
|
231
224
|
const live = conditions.length === 0 ? "true" : conditions.length === 1 ? conditions.join("") : `(${conditions.join(" and ")})`;
|
|
232
225
|
const kept = where.filter((part) => part !== "true");
|
|
233
226
|
return `select m.${id}::text as id, ${shape.userSql}::text as user_id, ${shape.roleKey} as role, ${shape.via} as via, ${live} as live
|
|
234
|
-
from ${options.from ??
|
|
227
|
+
from ${options.from ?? quoteQualifiedTable(shape.table)} m${shape.join}${shape.roleJoin}${kept.length === 0 ? "" : `\nwhere ${kept.join(" and ")}`}`;
|
|
235
228
|
}
|
|
236
229
|
};
|
|
237
230
|
}
|
|
@@ -242,14 +235,14 @@ function sqlOf(shape) {
|
|
|
242
235
|
table: shape.table,
|
|
243
236
|
user: shape.user,
|
|
244
237
|
userThrough: shape.userThrough,
|
|
245
|
-
userType: shape.userThrough === void 0 ? `${
|
|
238
|
+
userType: shape.userThrough === void 0 ? `${quoteQualifiedTable(shape.table)}.${ident(shape.user)}%type` : `${quoteSqlTable(shape.userThrough.table)}.${ident(shape.userThrough.key)}%type`,
|
|
246
239
|
reads: [...new Set([suspension?.users, ...Object.values(suspension?.scopes ?? {})].flatMap((row) => row === void 0 ? [] : [row.table]))],
|
|
247
240
|
managed: shape.managedColumn,
|
|
248
241
|
through: shape.through,
|
|
249
242
|
throughs: shape.throughs,
|
|
250
243
|
columns: [...new Set(shape.columns)],
|
|
251
244
|
manifest: {
|
|
252
|
-
table:
|
|
245
|
+
table: qualifySqlTable(shape.table),
|
|
253
246
|
...shape.manifest,
|
|
254
247
|
columns: [...new Set(shape.columns)]
|
|
255
248
|
},
|
|
@@ -263,14 +256,14 @@ function isFixed(roles) {
|
|
|
263
256
|
}
|
|
264
257
|
/** A role column of the membership table, aliased `m`; a `through` column joins its roles table as `mk`. */
|
|
265
258
|
function memberRole(role, table, label) {
|
|
266
|
-
return roleColumn(role,
|
|
259
|
+
return roleColumn(role, qualifySqlTable(table), "m", {
|
|
267
260
|
label,
|
|
268
261
|
indent: ""
|
|
269
262
|
});
|
|
270
263
|
}
|
|
271
264
|
/** The user of the membership table, aliased `m`; a `through` user joins its table as `mu`. */
|
|
272
265
|
function memberUser(user, table, label) {
|
|
273
|
-
const column = roleColumn(user,
|
|
266
|
+
const column = roleColumn(user, qualifySqlTable(table), "m", {
|
|
274
267
|
label,
|
|
275
268
|
indent: "",
|
|
276
269
|
joined: "mu",
|
|
@@ -294,7 +287,8 @@ function membershipOf(row) {
|
|
|
294
287
|
const roles = strings(row["roles"]);
|
|
295
288
|
if (typeof row["scope"] !== "string" || typeof row["id"] !== "string") return;
|
|
296
289
|
if (roles.length === 0) return;
|
|
297
|
-
const
|
|
290
|
+
const rawWithin = row["within"];
|
|
291
|
+
const within = isRecord(rawWithin) ? Object.fromEntries(Object.entries(rawWithin).filter((entry) => typeof entry[1] === "string")) : void 0;
|
|
298
292
|
const expires = typeof row["expires_at"] === "number" ? row["expires_at"] : typeof row["expires_at"] === "string" && row["expires_at"] !== "" ? Number(row["expires_at"]) : void 0;
|
|
299
293
|
const seats = strings(row["seats"]);
|
|
300
294
|
const keep = row["keep"];
|
|
@@ -311,7 +305,8 @@ function membershipOf(row) {
|
|
|
311
305
|
member: typeof row["member_group"] === "string" && row["member_group"] !== "" ? { group: row["member_group"] } : void 0,
|
|
312
306
|
managedBy: row["managed_by"] === "idp" ? "idp" : void 0,
|
|
313
307
|
entitlements: seats.length === 0 ? void 0 : seats,
|
|
314
|
-
keep: keep === null || keep === void 0 ? void 0 : strings(keep)
|
|
308
|
+
keep: keep === null || keep === void 0 ? void 0 : strings(keep),
|
|
309
|
+
x: row["x"] === null ? void 0 : readAppData(void 0, row["x"])
|
|
315
310
|
});
|
|
316
311
|
}
|
|
317
312
|
function sourceOf(sql, query) {
|
|
@@ -382,6 +377,7 @@ function fromTable(options) {
|
|
|
382
377
|
managed: optional(c.managedBy, "text"),
|
|
383
378
|
managedColumn: c.managedBy,
|
|
384
379
|
seats: c.seats === void 0 ? "null::jsonb" : `to_jsonb(${col(c.seats)})`,
|
|
380
|
+
x: c.x,
|
|
385
381
|
idOf: (name) => `coalesce(case when ${scope} = ${literal(name)} then ${id} end${c.within === void 0 ? "" : `, ${within} ->> ${literal(name)}`})`,
|
|
386
382
|
idColumn: c.id ?? "scope_id",
|
|
387
383
|
holds: (name, alias) => `${alias}.${ident(c.scope ?? "scope")}::text = ${literal(name)}`,
|
|
@@ -398,7 +394,8 @@ function fromTable(options) {
|
|
|
398
394
|
c.reason,
|
|
399
395
|
c.group,
|
|
400
396
|
c.managedBy,
|
|
401
|
-
c.seats
|
|
397
|
+
c.seats,
|
|
398
|
+
c.x
|
|
402
399
|
].filter((name) => name !== void 0).map(col)
|
|
403
400
|
],
|
|
404
401
|
suspension: options.suspension,
|
|
@@ -463,6 +460,7 @@ function fromJunction(options) {
|
|
|
463
460
|
managed: managedColumn === void 0 ? "null::text" : managedColumn === "" ? `'idp'::text` : `${col(managedColumn)}::text`,
|
|
464
461
|
managedColumn,
|
|
465
462
|
seats: options.seats === void 0 ? "null::jsonb" : `to_jsonb(${col(options.seats)})`,
|
|
463
|
+
x: options.x,
|
|
466
464
|
idColumn,
|
|
467
465
|
holds: (name) => name === options.scope ? "true" : void 0,
|
|
468
466
|
roleKey: role === void 0 ? "mf.role" : role.sql,
|
|
@@ -481,7 +479,8 @@ function fromJunction(options) {
|
|
|
481
479
|
options.reason,
|
|
482
480
|
groupColumn,
|
|
483
481
|
managedColumn === "" ? void 0 : managedColumn,
|
|
484
|
-
options.seats
|
|
482
|
+
options.seats,
|
|
483
|
+
options.x
|
|
485
484
|
].filter((name) => name !== void 0).map(col)
|
|
486
485
|
],
|
|
487
486
|
suspension: options.suspension,
|
|
@@ -534,7 +533,7 @@ function hookApiNames(prefix = HOOK_API_PREFIX) {
|
|
|
534
533
|
* `<schema>.permdock_authz_version`: pass it to `claimsFirst(sources, { version })`.
|
|
535
534
|
*/
|
|
536
535
|
function authzVersion(options) {
|
|
537
|
-
const table =
|
|
536
|
+
const table = quoteQualifiedTable(`${options.schema ?? "permdock"}.${AUTHZ_VERSION_TABLE}`);
|
|
538
537
|
return async (principal) => {
|
|
539
538
|
const value = rowsOf(await options.query(`select version from ${table} where user_id = $1`, [principal.id]))[0]?.["version"];
|
|
540
539
|
const version = typeof value === "number" ? value : value === void 0 ? 0 : Number(value);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { n as RoleThrough, y as SupabaseSuspension } from "./types-
|
|
1
|
+
import { Z as MembershipSource } from "./policy-types-sp9P1iIV.js";
|
|
2
|
+
import { n as RoleThrough, y as SupabaseSuspension } from "./types-CqrjB9o6.js";
|
|
3
3
|
import { o as SupabaseManifestMembership } from "./manifest-uDS9y5de.js";
|
|
4
4
|
//#region src/supabase/roles.d.ts
|
|
5
5
|
/** A roles table a role column references, by `schema.table`. */
|
|
@@ -55,6 +55,8 @@ type MembershipTableOptions = Common & {
|
|
|
55
55
|
readonly managedBy?: string;
|
|
56
56
|
/** A `text[]` column of seats. */
|
|
57
57
|
readonly seats?: string;
|
|
58
|
+
/** A `jsonb` column of app data (`Membership.x`); never written into claims. */
|
|
59
|
+
readonly x?: string;
|
|
58
60
|
};
|
|
59
61
|
};
|
|
60
62
|
type MembershipJunctionOptions = Common & {
|
|
@@ -92,6 +94,8 @@ type MembershipJunctionOptions = Common & {
|
|
|
92
94
|
};
|
|
93
95
|
/** A `text[]` column of seats. */
|
|
94
96
|
readonly seats?: string;
|
|
97
|
+
/** A `jsonb` column of app data (`Membership.x`); never written into claims. */
|
|
98
|
+
readonly x?: string;
|
|
95
99
|
};
|
|
96
100
|
/** What `permdock supabase hook generate` compiles; the same SQL the source runs. */
|
|
97
101
|
type MembershipSql = {
|
|
@@ -3,8 +3,7 @@
|
|
|
3
3
|
const SQL_IDENT = /^[A-Za-z_][A-Za-z0-9_]*$/u;
|
|
4
4
|
/** A validated, double-quoted identifier; anything outside `SQL_IDENT` throws. */
|
|
5
5
|
function quoteSqlIdent(name, prefix = "PermDock") {
|
|
6
|
-
|
|
7
|
-
return `"${name}"`;
|
|
6
|
+
return `"${assertSqlIdent(name, prefix)}"`;
|
|
8
7
|
}
|
|
9
8
|
/** A schema-qualified name, each part validated by `quoteSqlIdent`. */
|
|
10
9
|
function quoteSqlTable(name, prefix = "PermDock") {
|
|
@@ -23,5 +22,22 @@ const PLAIN_IDENT = /^[a-z_][a-z0-9_]*$/u;
|
|
|
23
22
|
function sqlIdent(name) {
|
|
24
23
|
return PLAIN_IDENT.test(name) ? name : escapeSqlIdent(name);
|
|
25
24
|
}
|
|
25
|
+
/** The plain-identifier check behind `quoteSqlIdent`, returning the name unquoted. */
|
|
26
|
+
function assertSqlIdent(name, prefix = "PermDock") {
|
|
27
|
+
if (!SQL_IDENT.test(name)) throw new TypeError(`${prefix}: unsafe SQL identifier '${name}'`);
|
|
28
|
+
return name;
|
|
29
|
+
}
|
|
30
|
+
/** `name` with `public.` added when it names no schema; generated functions run with `search_path = ''`. */
|
|
31
|
+
function qualifySqlTable(name) {
|
|
32
|
+
return name.includes(".") ? name : `public.${name}`;
|
|
33
|
+
}
|
|
34
|
+
/** `qualifySqlTable`, then each part quoted by `quoteSqlIdent`. */
|
|
35
|
+
function quoteQualifiedTable(name, prefix = "PermDock") {
|
|
36
|
+
return quoteSqlTable(qualifySqlTable(name), prefix);
|
|
37
|
+
}
|
|
38
|
+
/** A `text[]` literal of `values`, each quoted by `quoteSqlLiteral`. */
|
|
39
|
+
function sqlTextArray(values) {
|
|
40
|
+
return values.length === 0 ? `'{}'::text[]` : `array[${values.map(quoteSqlLiteral).join(", ")}]::text[]`;
|
|
41
|
+
}
|
|
26
42
|
//#endregion
|
|
27
|
-
export {
|
|
43
|
+
export { quoteSqlIdent as a, sqlIdent as c, quoteQualifiedTable as i, sqlTextArray as l, escapeSqlIdent as n, quoteSqlLiteral as o, qualifySqlTable as r, quoteSqlTable as s, SQL_IDENT as t };
|