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
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { c as saasPlans, l as saasRoles, s as saasPermissions } from "./permissions-
|
|
1
|
+
import { E as Policy, Or as Principal, kr as Subject } from "./policy-types-sp9P1iIV.js";
|
|
2
|
+
import { c as saasPlans, l as saasRoles, s as saasPermissions } from "./permissions-COH-KRgT.js";
|
|
3
3
|
//#region src/testing/saas/policy.d.ts
|
|
4
4
|
/** Daily API-key quota per subject; the bucket should be per tenant too. */
|
|
5
5
|
declare const SAAS_API_KEY_LIMIT = 5;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { i as globalArgs, s as stringArg, t as COMMAND_DESCRIPTIONS } from "./commands-
|
|
1
|
+
import { i as globalArgs, s as stringArg, t as COMMAND_DESCRIPTIONS } from "./commands-Cpip4ULx.js";
|
|
2
2
|
import { defineCommand } from "citty";
|
|
3
3
|
//#region src/cli/commands/powersync.ts
|
|
4
4
|
function powersync(ctx) {
|
|
@@ -44,7 +44,7 @@ function powersync(ctx) {
|
|
|
44
44
|
const db = stringArg(parsed.db);
|
|
45
45
|
const fixtures = stringArg(parsed.fixtures);
|
|
46
46
|
const from = stringArg(parsed.from);
|
|
47
|
-
const { runPowerSync } = await import("./powersync-
|
|
47
|
+
const { runPowerSync } = await import("./powersync-DCDgZgfZ.js");
|
|
48
48
|
ctx.report(await runPowerSync({
|
|
49
49
|
cwd: ctx.cwd,
|
|
50
50
|
config: ctx.config,
|
|
@@ -1,22 +1,24 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
1
|
+
import { c as isConditionRef, s as isConditionDate } from "./refs-f3imMjNW.js";
|
|
2
|
+
import { d as localSnapshotManifest, g as memoryRoleSource } from "./src-Bb7no-hS.js";
|
|
3
|
+
import { d as scopeList, o as resolveScope } from "./scopes-tvpa34ep.js";
|
|
4
|
+
import { n as findPermission } from "./permission-registry-BsblpB-z.js";
|
|
5
5
|
import { t as requiresApproval } from "./approval-required-TzNB9oQA.js";
|
|
6
|
-
import { t as createPermDock } from "./permdock-
|
|
6
|
+
import { t as createPermDock } from "./permdock-L26udHSk.js";
|
|
7
7
|
import { o as usageResult } from "./errors-CWfoNg9N.js";
|
|
8
|
-
import {
|
|
9
|
-
import { i as scopeMembershipTable, r as scopeColumn } from "./compile-
|
|
10
|
-
import {
|
|
11
|
-
import "./sources-
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import { t as
|
|
17
|
-
import {
|
|
8
|
+
import { c as requirePolicy } from "./load-C3_oTHyO.js";
|
|
9
|
+
import { i as scopeMembershipTable, r as scopeColumn } from "./compile-CcEu2ZQ1.js";
|
|
10
|
+
import { o as quoteSqlLiteral, t as SQL_IDENT } from "./sql-t8teWOfo.js";
|
|
11
|
+
import "./sources-B1-b-R0t.js";
|
|
12
|
+
import { n as fixtureSubject, r as loadFixtures, t as fixtureRow } from "./fixtures-h2eG2OZV.js";
|
|
13
|
+
import { N as quoteIdent, a as customRolesOn, t as CUSTOM_ROLES } from "./shared-1uhI-e-b.js";
|
|
14
|
+
import { r as fileDrift } from "./output-files-CgIsvdSa.js";
|
|
15
|
+
import { E as collectGrants, Z as pgConnector, k as contextRefs } from "./permission-keys-B26jeyUv.js";
|
|
16
|
+
import { t as ownershipRules } from "./ownership-BgnbOJFT.js";
|
|
17
|
+
import { h as tableFor } from "./fields-fwfXN01n.js";
|
|
18
|
+
import { t as canFixture } from "./verify-BztUB3GX.js";
|
|
19
|
+
import { writeFileSync } from "node:fs";
|
|
18
20
|
import { resolve } from "node:path";
|
|
19
|
-
//#region src/cli/powersync
|
|
21
|
+
//#region src/cli/powersync/streams.ts
|
|
20
22
|
function ident(name) {
|
|
21
23
|
if (!SQL_IDENT.test(name)) throw new TypeError(`PermDock CLI: '${name}' is not a plain identifier, which Sync Streams need`);
|
|
22
24
|
return name;
|
|
@@ -228,7 +230,7 @@ function subjectStreams(ctx) {
|
|
|
228
230
|
const database = rls?.authorize === "database";
|
|
229
231
|
const globalRoles = rls?.roles ?? (database ? { table: `${schema}.user_roles` } : void 0);
|
|
230
232
|
if (globalRoles !== void 0) own(globalRoles.table, globalRoles.user ?? "user_id", globalRoles.role ?? "role");
|
|
231
|
-
if (database && rls
|
|
233
|
+
if (database && customRolesOn(rls)) {
|
|
232
234
|
const root = ctx.scopes[0]?.name;
|
|
233
235
|
const tenants = root === void 0 ? void 0 : scopeMembershipTable(memberships, ctx.scopes, root);
|
|
234
236
|
const column = tenants === void 0 || root === void 0 ? void 0 : scopeColumn(tenants, ctx.scopes, root);
|
|
@@ -364,17 +366,15 @@ function powersyncYaml(plan) {
|
|
|
364
366
|
return `${lines.join("\n")}\n`;
|
|
365
367
|
}
|
|
366
368
|
//#endregion
|
|
367
|
-
//#region src/cli/powersync.ts
|
|
369
|
+
//#region src/cli/powersync/powersync.ts
|
|
368
370
|
const POWERSYNC_HELP = `permdock powersync generate [--out sync-config.yaml] [--check]
|
|
369
371
|
permdock powersync verify [--db <url>] [--fixtures rls.fixtures.json]`;
|
|
370
372
|
const DEFAULT_OUT = "sync-config.yaml";
|
|
371
373
|
function powersyncOut(config, out) {
|
|
372
374
|
return out ?? config.powersync?.out ?? DEFAULT_OUT;
|
|
373
375
|
}
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
if (path === void 0) throw new Error("PermDock CLI: powersync needs policy in the config or --from");
|
|
377
|
-
return asPolicy(pickNamed(await loadModule(resolve(cwd, path)), ["policy"]));
|
|
376
|
+
function loadPolicy(cwd, config, from) {
|
|
377
|
+
return requirePolicy(cwd, from ?? config.policy, "powersync needs policy in the config or --from");
|
|
378
378
|
}
|
|
379
379
|
function sameJson(current, expected) {
|
|
380
380
|
try {
|
|
@@ -409,11 +409,10 @@ function powersyncFiles(policy, config, out) {
|
|
|
409
409
|
function staleFiles(cwd, files) {
|
|
410
410
|
const stale = [];
|
|
411
411
|
for (const file of files) {
|
|
412
|
-
const
|
|
413
|
-
|
|
414
|
-
if (!(current !== void 0 && (file.json === true ? sameJson(current, file.text) : current === file.text))) stale.push({
|
|
412
|
+
const found = fileDrift(resolve(cwd, file.path), file.text, file.json === true ? sameJson : void 0);
|
|
413
|
+
if (found !== void 0) stale.push({
|
|
415
414
|
path: file.path,
|
|
416
|
-
missing:
|
|
415
|
+
missing: found.kind === "missing"
|
|
417
416
|
});
|
|
418
417
|
}
|
|
419
418
|
return stale;
|
|
@@ -519,7 +518,7 @@ async function runPowerSync(input) {
|
|
|
519
518
|
fixtures,
|
|
520
519
|
customRoles,
|
|
521
520
|
db: input.db,
|
|
522
|
-
connect: input.connect ?? (
|
|
521
|
+
connect: input.connect ?? pgConnector("permdock powersync verify --db")
|
|
523
522
|
});
|
|
524
523
|
mismatches.push(...database.mismatches);
|
|
525
524
|
notes.push(...database.notes);
|
package/dist/prisma/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { It as WhereResult, jr as Condition, kr as Subject } from "../policy-types-sp9P1iIV.js";
|
|
2
2
|
import { r as RelationsMapping } from "../graph-sql-B-dsAT6j.js";
|
|
3
3
|
import { n as WithSubjectOptions, t as RowCheck } from "../row-check-Dt35czLy.js";
|
|
4
4
|
//#region src/prisma/model-fields.d.ts
|
package/dist/prisma/index.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { t as compact } from "../compact-
|
|
1
|
+
import { t as compact } from "../compact-CAf557ZB.js";
|
|
2
2
|
import { n as freezeDeep } from "../freeze-CrU8nQeX.js";
|
|
3
|
-
import {
|
|
4
|
-
import { n as PermDockValidationError } from "../validation-error-
|
|
5
|
-
import { a as relatedRowGuard, l as renderGraphSql, n as escapeLike, s as relatedTargetsSql, t as compileWhere, u as restrictedRowsSql } from "../compile-
|
|
6
|
-
import {
|
|
3
|
+
import { a as assertSafeKey } from "../thenable-QSmvt-vZ.js";
|
|
4
|
+
import { n as PermDockValidationError } from "../validation-error-ZfUHbKvf.js";
|
|
5
|
+
import { a as relatedRowGuard, l as renderGraphSql, n as escapeLike, s as relatedTargetsSql, t as compileWhere, u as restrictedRowsSql } from "../compile-CcEu2ZQ1.js";
|
|
6
|
+
import { n as statementText, o as rowCheckOf, r as subjectStatements, s as loadPeer } from "../subject-settings-CkEwrw3W.js";
|
|
7
7
|
//#region src/prisma/to-where.ts
|
|
8
8
|
function fieldTests(options) {
|
|
9
9
|
const mapped = (field) => fieldName(field, options.fields);
|
|
@@ -165,13 +165,7 @@ async function checkRow(delegate, input, unique, options = {}) {
|
|
|
165
165
|
//#region src/prisma/predicate.ts
|
|
166
166
|
function loadCombinators(injected) {
|
|
167
167
|
if (injected !== void 0) return injected;
|
|
168
|
-
|
|
169
|
-
try {
|
|
170
|
-
if (loader === void 0) throw new Error("no module loader");
|
|
171
|
-
return loader.createRequire(import.meta.url)("@prisma/orm-postgres/orm-client");
|
|
172
|
-
} catch {
|
|
173
|
-
throw new Error("PermDock: toPredicate needs @prisma/orm-postgres; pass `combinators` on runtimes without require");
|
|
174
|
-
}
|
|
168
|
+
return loadPeer("@prisma/orm-postgres/orm-client", "PermDock: toPredicate needs @prisma/orm-postgres; pass `combinators` on runtimes without require");
|
|
175
169
|
}
|
|
176
170
|
function refused$1(detail) {
|
|
177
171
|
return new PermDockValidationError({
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { t as compact } from "./compact-
|
|
2
|
-
import { n as
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
1
|
+
import { t as compact } from "./compact-CAf557ZB.js";
|
|
2
|
+
import { n as freezeDeep } from "./freeze-CrU8nQeX.js";
|
|
3
|
+
import { n as PermDockValidationError, t as PROBLEM_BASE } from "./validation-error-ZfUHbKvf.js";
|
|
4
|
+
import { i as stepUpOf, n as problemDetails, t as notFoundDetails } from "./problem-details-DECUnXAn.js";
|
|
5
|
+
import { a as deniedMessage, i as approvalMessage } from "./errors-drnfxYtm.js";
|
|
5
6
|
//#region src/server/problem.ts
|
|
6
7
|
function quoted(value) {
|
|
7
8
|
return `"${value.replaceAll(/["\\]/gu, "")}"`;
|
|
@@ -162,14 +163,14 @@ function problemFromDecision(decision, permission, subject, options = {}) {
|
|
|
162
163
|
function notFoundProblem(instance) {
|
|
163
164
|
return problemResponse(notFoundDetails(instance));
|
|
164
165
|
}
|
|
165
|
-
const ANONYMOUS = {
|
|
166
|
+
const ANONYMOUS = freezeDeep({
|
|
166
167
|
outcome: "denied",
|
|
167
168
|
denials: [{
|
|
168
169
|
role: null,
|
|
169
170
|
reason: "anonymous"
|
|
170
171
|
}],
|
|
171
172
|
alternatives: []
|
|
172
|
-
};
|
|
173
|
+
});
|
|
173
174
|
/** The `401` for a request with no subject, with the RFC 6750 challenge its credentials call for. */
|
|
174
175
|
function unauthenticatedProblem(credentials) {
|
|
175
176
|
return decisionResponse(problemDetails({
|
|
@@ -188,4 +189,4 @@ function methodNotAllowed(allow) {
|
|
|
188
189
|
return response;
|
|
189
190
|
}
|
|
190
191
|
//#endregion
|
|
191
|
-
export {
|
|
192
|
+
export { methodNotAllowed as a, problemResponse as c, validationProblem as d, wwwAuthenticate as f, decisionResponse as i, protectedResourceMetadataUrl as l, batchTooLarge as n, notFoundProblem as o, bearerChallenge as r, problemFromDecision as s, ANONYMOUS as t, unauthenticatedProblem as u };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { t as compact } from "./compact-
|
|
2
|
-
import { t as PROBLEM_BASE } from "./validation-error-
|
|
1
|
+
import { t as compact } from "./compact-CAf557ZB.js";
|
|
2
|
+
import { t as PROBLEM_BASE } from "./validation-error-ZfUHbKvf.js";
|
|
3
3
|
//#region src/core/wire-denial.ts
|
|
4
4
|
const IN_PROCESS = /* @__PURE__ */ new Set(["closure-error", "validation"]);
|
|
5
5
|
function jsonDetail(value) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ir as Decision } from "./policy-types-sp9P1iIV.js";
|
|
2
2
|
//#region src/core/problem-details.d.ts
|
|
3
3
|
type Disclosure = "hide" | "reveal";
|
|
4
4
|
/** The plans a `not-entitled` denial asks for; empty unless every denial is `not-entitled`. */
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { r as Role } from "./vocabulary-
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
1
|
+
import { Dr as Membership, ir as Decision, j as PolicyVocabulary } from "./policy-types-sp9P1iIV.js";
|
|
2
|
+
import { d as Permission } from "./permission-types-Dg39z9Kv.js";
|
|
3
|
+
import { r as Role } from "./vocabulary-hhEFLFoL.js";
|
|
4
|
+
import { r as DescribeOptions, t as DecisionDescription } from "./describe-C3ldA9os.js";
|
|
5
|
+
import { a as ClientPermDock, c as PermissionSet, d as SubjectView, f as TenantView, l as PermissionState, p as UseRolesOptions, r as ApprovalHandle, s as FilterResult } from "./store-9KO4BlkB.js";
|
|
6
|
+
import { r as ProtectedProps } from "./types-DHrmBJLH.js";
|
|
6
7
|
import { ReactNode } from "react";
|
|
7
8
|
//#region src/react/hooks.d.ts
|
|
8
9
|
declare function usePermDock<V extends PolicyVocabulary = PolicyVocabulary>(): ClientPermDock<V>;
|
|
@@ -19,9 +20,11 @@ declare function useAssignablePermissions(options?: {
|
|
|
19
20
|
readonly tenant?: string;
|
|
20
21
|
}): readonly Permission[];
|
|
21
22
|
declare function useSubject(): SubjectView;
|
|
23
|
+
/** `describe` with the provider's `messages`; a call's own `messages` win. */
|
|
24
|
+
declare function useDescribe(): (decision: Decision, options?: DescribeOptions) => DecisionDescription;
|
|
22
25
|
declare function useApproval(decision: Decision): ApprovalHandle;
|
|
23
26
|
//#endregion
|
|
24
27
|
//#region src/react/protected.d.ts
|
|
25
28
|
declare function Protected(props: ProtectedProps): ReactNode;
|
|
26
29
|
//#endregion
|
|
27
|
-
export {
|
|
30
|
+
export { useDescribe as a, usePermDock as c, useRoles as d, useSubject as f, useAssignableRoles as i, usePermission as l, useApproval as n, useFilter as o, useTenant as p, useAssignablePermissions as r, useMemberships as s, Protected as t, usePermissions as u };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { n as storeOf } from "./store-options-
|
|
2
|
-
import { a as
|
|
3
|
-
import { i as PermDockStoreContext, r as PermDockSnapshotPromiseContext } from "./live-options-
|
|
1
|
+
import { n as storeOf } from "./store-options-CbUHDoSe.js";
|
|
2
|
+
import { a as permissionSet, c as scopedTenant, d as tenantView, 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";
|
|
3
|
+
import { a as PermDockUiContext, i as PermDockStoreContext, r as PermDockSnapshotPromiseContext } from "./live-options-BaAFCIiu.js";
|
|
4
4
|
import { Suspense, use, useMemo, useSyncExternalStore } from "react";
|
|
5
5
|
import { jsx } from "react/jsx-runtime";
|
|
6
6
|
//#region src/react/hooks.ts
|
|
@@ -72,29 +72,41 @@ function useSubject() {
|
|
|
72
72
|
const permdock = usePermDock();
|
|
73
73
|
return useMemo(() => subjectView(permdock), [permdock]);
|
|
74
74
|
}
|
|
75
|
+
/** `describe` with the provider's `messages`; a call's own `messages` win. */
|
|
76
|
+
function useDescribe() {
|
|
77
|
+
const { messages } = use(PermDockUiContext);
|
|
78
|
+
return useMemo(() => describeWith(messages), [messages]);
|
|
79
|
+
}
|
|
75
80
|
function useApproval(decision) {
|
|
76
81
|
return approvalHandle(storeOf(usePermDock()), decision);
|
|
77
82
|
}
|
|
78
83
|
//#endregion
|
|
79
84
|
//#region src/react/protected.tsx
|
|
80
85
|
function Protected(props) {
|
|
81
|
-
|
|
86
|
+
const { defaults } = use(PermDockUiContext);
|
|
87
|
+
const pending = slotContent("pending", props, defaults);
|
|
88
|
+
if (pending === void 0) return /* @__PURE__ */ jsx(Guard, { ...props });
|
|
82
89
|
return /* @__PURE__ */ jsx(Suspense, {
|
|
83
|
-
fallback:
|
|
90
|
+
fallback: pending,
|
|
84
91
|
children: /* @__PURE__ */ jsx(Guard, { ...props })
|
|
85
92
|
});
|
|
86
93
|
}
|
|
87
94
|
function Guard(props) {
|
|
95
|
+
const { defaults } = use(PermDockUiContext);
|
|
88
96
|
const root = usePermDock();
|
|
89
97
|
const local = usePermission(props.permission, props.data);
|
|
90
98
|
const scoped = useMemo(() => scopedTenant(root, props.tenant), [root, props.tenant]);
|
|
91
99
|
const view = protectedView(local, root, props.permission, props.data, scoped);
|
|
92
100
|
switch (view.slot) {
|
|
93
|
-
case "pending": return
|
|
94
|
-
case "fallback": return
|
|
101
|
+
case "pending": return slotContent("pending", props, defaults) ?? null;
|
|
102
|
+
case "fallback": return render(slotContent("fallback", props, defaults), view.decision);
|
|
103
|
+
case "approval": return render(slotContent("approval", props, defaults), view.decision);
|
|
95
104
|
case "default": return typeof props.children === "function" ? props.children(view.decision) : props.children;
|
|
96
105
|
default: return view;
|
|
97
106
|
}
|
|
98
107
|
}
|
|
108
|
+
function render(content, decision) {
|
|
109
|
+
return typeof content === "function" ? content(decision) : content ?? null;
|
|
110
|
+
}
|
|
99
111
|
//#endregion
|
|
100
|
-
export {
|
|
112
|
+
export { useDescribe as a, usePermDock as c, useRoles as d, useSubject as f, useAssignableRoles as i, usePermission as l, useApproval as n, useFilter as o, useTenant as p, useAssignablePermissions as r, useMemberships as s, Protected as t, usePermissions as u };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { t as compact } from "./compact-
|
|
2
|
-
import { t as emptySnapshot } from "./from-snapshot-
|
|
3
|
-
import { t as adapterStore } from "./store-options-
|
|
4
|
-
import { i as PermDockStoreContext, n as useKeyed, r as PermDockSnapshotPromiseContext, t as useLiveOptions } from "./live-options-
|
|
5
|
-
import { useLayoutEffect } from "react";
|
|
1
|
+
import { t as compact } from "./compact-CAf557ZB.js";
|
|
2
|
+
import { t as emptySnapshot } from "./from-snapshot-7REQZe0H.js";
|
|
3
|
+
import { t as adapterStore } from "./store-options-CbUHDoSe.js";
|
|
4
|
+
import { a as PermDockUiContext, i as PermDockStoreContext, n as useKeyed, r as PermDockSnapshotPromiseContext, t as useLiveOptions } from "./live-options-BaAFCIiu.js";
|
|
5
|
+
import { useLayoutEffect, useMemo } from "react";
|
|
6
6
|
import { jsx } from "react/jsx-runtime";
|
|
7
7
|
//#region src/react/provider.tsx
|
|
8
8
|
function PermDockProvider(props) {
|
|
@@ -20,7 +20,10 @@ function PermDockProvider(props) {
|
|
|
20
20
|
maxAge: props.maxAge,
|
|
21
21
|
verifier: live.verifier,
|
|
22
22
|
awaiting,
|
|
23
|
-
passCache: true
|
|
23
|
+
passCache: true,
|
|
24
|
+
onSnapshot: live.onSnapshot,
|
|
25
|
+
onClear: live.onClear,
|
|
26
|
+
approvalInterval: props.approvalInterval
|
|
24
27
|
}), props.snapshot ?? emptySnapshot()), [
|
|
25
28
|
props.snapshot,
|
|
26
29
|
props.endpoint,
|
|
@@ -31,8 +34,15 @@ function PermDockProvider(props) {
|
|
|
31
34
|
live.headers,
|
|
32
35
|
props.maxAge,
|
|
33
36
|
live.verifier,
|
|
34
|
-
awaiting
|
|
37
|
+
awaiting,
|
|
38
|
+
live.onSnapshot,
|
|
39
|
+
live.onClear,
|
|
40
|
+
props.approvalInterval
|
|
35
41
|
]);
|
|
42
|
+
const ui = useMemo(() => ({
|
|
43
|
+
defaults: props.defaults,
|
|
44
|
+
messages: props.messages
|
|
45
|
+
}), [props.defaults, props.messages]);
|
|
36
46
|
useLayoutEffect(() => {
|
|
37
47
|
if (promise !== null && !suspend) store.track(promise);
|
|
38
48
|
}, [
|
|
@@ -42,9 +52,12 @@ function PermDockProvider(props) {
|
|
|
42
52
|
]);
|
|
43
53
|
return /* @__PURE__ */ jsx(PermDockStoreContext, {
|
|
44
54
|
value: store,
|
|
45
|
-
children: /* @__PURE__ */ jsx(
|
|
46
|
-
value:
|
|
47
|
-
children:
|
|
55
|
+
children: /* @__PURE__ */ jsx(PermDockUiContext, {
|
|
56
|
+
value: ui,
|
|
57
|
+
children: /* @__PURE__ */ jsx(PermDockSnapshotPromiseContext, {
|
|
58
|
+
value: suspend ? promise : null,
|
|
59
|
+
children: props.children
|
|
60
|
+
})
|
|
48
61
|
})
|
|
49
62
|
});
|
|
50
63
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { n as PermDockProviderProps } from "./types-DHrmBJLH.js";
|
|
2
2
|
import { ReactElement } from "react";
|
|
3
3
|
//#region src/react/provider.d.ts
|
|
4
4
|
declare function PermDockProvider(props: PermDockProviderProps): ReactElement;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { t as compact } from "./compact-
|
|
2
|
-
import { t as emptySnapshot } from "./from-snapshot-
|
|
3
|
-
import { i as isPromiseLike, t as adapterStore } from "./store-options-
|
|
1
|
+
import { t as compact } from "./compact-CAf557ZB.js";
|
|
2
|
+
import { t as emptySnapshot } from "./from-snapshot-7REQZe0H.js";
|
|
3
|
+
import { i as isPromiseLike, t as adapterStore } from "./store-options-CbUHDoSe.js";
|
|
4
4
|
//#region src/client/provider-store.ts
|
|
5
5
|
/**
|
|
6
6
|
* Store options that read `read()` on every request, so a rotated token, a
|
|
@@ -30,6 +30,9 @@ function providerStore(options, read, snapshot) {
|
|
|
30
30
|
approvals: options.approvals,
|
|
31
31
|
tenant: options.tenant,
|
|
32
32
|
maxAge: options.maxAge,
|
|
33
|
+
onSnapshot: options.onSnapshot,
|
|
34
|
+
onClear: options.onClear,
|
|
35
|
+
approvalInterval: options.approvalInterval,
|
|
33
36
|
...liveOptions(read)
|
|
34
37
|
}), promised || snapshot === void 0 ? emptySnapshot() : snapshot);
|
|
35
38
|
if (promised) store.follow(snapshot);
|
package/dist/react/index.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { n as requiredPlans } from "../problem-details-
|
|
2
|
-
import { i as describe } from "../describe-
|
|
1
|
+
import { n as requiredPlans } from "../problem-details-rIIo8B2C.js";
|
|
2
|
+
import { i as describe } from "../describe-C3ldA9os.js";
|
|
3
3
|
import { t as approvalHeaders } from "../headers-Cf-zWvsO.js";
|
|
4
|
-
import { a as
|
|
5
|
-
import { n as ProtectedProps, t as
|
|
6
|
-
import { a as
|
|
7
|
-
import { t as PermDockProvider } from "../provider-
|
|
8
|
-
export { type ApprovalHandle, type ApprovalState, type ClientPermDock, type ClientStatus, type FilterResult, PermDockProvider, type PermDockProviderProps, type PermissionSet, type PermissionState, Protected, type ProtectedProps, type SubjectView, type TenantView, approvalHeaders, describe, requiredPlans, useApproval, useAssignablePermissions, useAssignableRoles, useFilter, useMemberships, usePermDock, usePermission, usePermissions, useRoles, useSubject, useTenant };
|
|
4
|
+
import { a as ClientPermDock, c as PermissionSet, d as SubjectView, f as TenantView, i as ApprovalState, l as PermissionState, o as ClientStatus, r as ApprovalHandle, s as FilterResult } from "../store-9KO4BlkB.js";
|
|
5
|
+
import { n as PermDockProviderProps, r as ProtectedProps, t as PermDockDefaults } from "../types-DHrmBJLH.js";
|
|
6
|
+
import { a as useDescribe, c as usePermDock, d as useRoles, f as useSubject, i as useAssignableRoles, l as usePermission, n as useApproval, o as useFilter, p as useTenant, r as useAssignablePermissions, s as useMemberships, t as Protected, u as usePermissions } from "../protected-B3_P7xuw.js";
|
|
7
|
+
import { t as PermDockProvider } from "../provider-kwHC9CZD.js";
|
|
8
|
+
export { type ApprovalHandle, type ApprovalState, type ClientPermDock, type ClientStatus, type FilterResult, type PermDockDefaults, PermDockProvider, type PermDockProviderProps, type PermissionSet, type PermissionState, Protected, type ProtectedProps, type SubjectView, type TenantView, approvalHeaders, describe, requiredPlans, useApproval, useAssignablePermissions, useAssignableRoles, useDescribe, useFilter, useMemberships, usePermDock, usePermission, usePermissions, useRoles, useSubject, useTenant };
|
package/dist/react/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { r as requiredPlans } from "../problem-details-
|
|
3
|
-
import { t as describe } from "../describe-
|
|
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 { a as
|
|
6
|
-
import { t as PermDockProvider } from "../provider-
|
|
7
|
-
export { PermDockProvider, Protected, approvalHeaders, describe, requiredPlans, useApproval, useAssignablePermissions, useAssignableRoles, useFilter, useMemberships, usePermDock, usePermission, usePermissions, useRoles, useSubject, useTenant };
|
|
5
|
+
import { a as useDescribe, c as usePermDock, d as useRoles, f as useSubject, i as useAssignableRoles, l as usePermission, n as useApproval, o as useFilter, p as useTenant, r as useAssignablePermissions, s as useMemberships, t as Protected, u as usePermissions } from "../protected-BN7BUdY1.js";
|
|
6
|
+
import { t as PermDockProvider } from "../provider-Bi-0HNL3.js";
|
|
7
|
+
export { PermDockProvider, Protected, approvalHeaders, describe, requiredPlans, useApproval, useAssignablePermissions, useAssignableRoles, useDescribe, useFilter, useMemberships, usePermDock, usePermission, usePermissions, useRoles, useSubject, useTenant };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as PermDockProvider } from "../provider-
|
|
1
|
+
import { t as PermDockProvider } from "../provider-kwHC9CZD.js";
|
|
2
2
|
export { PermDockProvider };
|
|
@@ -1,13 +1,12 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { n as requiredPlans } from "../problem-details-
|
|
4
|
-
import { i as describe } from "../describe-
|
|
5
|
-
import { t as parseLocalSnapshotManifest } from "../parse-local-manifest-
|
|
1
|
+
import { Dr as Membership, Sr as CustomRole, an as Snapshot, at as SnapshotSource, in as LocalSnapshotManifest, ut as TokenVerifier } from "../policy-types-sp9P1iIV.js";
|
|
2
|
+
import { d as Permission } from "../permission-types-Dg39z9Kv.js";
|
|
3
|
+
import { n as requiredPlans } from "../problem-details-rIIo8B2C.js";
|
|
4
|
+
import { i as describe, n as DescribeMessages } from "../describe-C3ldA9os.js";
|
|
5
|
+
import { t as parseLocalSnapshotManifest } from "../parse-local-manifest-DvYUR0QL.js";
|
|
6
6
|
import { t as approvalHeaders } from "../headers-Cf-zWvsO.js";
|
|
7
|
-
import { a as
|
|
8
|
-
import {
|
|
9
|
-
import { a as
|
|
10
|
-
import { t as ClientStore } from "../store-jOBYpiXC.js";
|
|
7
|
+
import { a as ClientPermDock, c as PermissionSet, d as SubjectView, f as TenantView, i as ApprovalState, l as PermissionState, n as ClientStoreOptions, o as ClientStatus, r as ApprovalHandle, s as FilterResult, t as ClientStore } from "../store-9KO4BlkB.js";
|
|
8
|
+
import { r as ProtectedProps, t as PermDockDefaults } from "../types-DHrmBJLH.js";
|
|
9
|
+
import { a as useDescribe, c as usePermDock, d as useRoles, f as useSubject, i as useAssignableRoles, l as usePermission, n as useApproval, o as useFilter, p as useTenant, r as useAssignablePermissions, s as useMemberships, t as Protected, u as usePermissions } from "../protected-B3_P7xuw.js";
|
|
11
10
|
import { ReactElement, ReactNode } from "react";
|
|
12
11
|
//#region src/react-native/guards.d.ts
|
|
13
12
|
/** `true` once the provider has a snapshot to answer from: storage was read or a seed was given. Hide the splash screen on it. */
|
|
@@ -123,6 +122,16 @@ type NativePermDockProviderProps = {
|
|
|
123
122
|
readonly headers?: Readonly<Record<string, string>>;
|
|
124
123
|
readonly maxAge?: number;
|
|
125
124
|
readonly verifier?: TokenVerifier;
|
|
125
|
+
/** What every `<Protected>` below renders for a slot it leaves out. */
|
|
126
|
+
readonly defaults?: PermDockDefaults;
|
|
127
|
+
/** Localised text for `useDescribe()`. */
|
|
128
|
+
readonly messages?: DescribeMessages;
|
|
129
|
+
/** Called with each snapshot the store accepts, after it is persisted. */
|
|
130
|
+
readonly onSnapshot?: NonNullable<ClientStoreOptions["onSnapshot"]>;
|
|
131
|
+
/** Called when the store drops its snapshot, after storage is cleared. */
|
|
132
|
+
readonly onClear?: () => void;
|
|
133
|
+
/** Milliseconds between approval status polls. Defaults to 2000. */
|
|
134
|
+
readonly approvalInterval?: number;
|
|
126
135
|
readonly children: ReactNode;
|
|
127
136
|
};
|
|
128
137
|
//#endregion
|
|
@@ -181,7 +190,7 @@ export declare function appStateForeground(appState: AppStateModule): SubscribeF
|
|
|
181
190
|
export declare function netInfoOnline(netInfo: NetInfoModule): SubscribeOnline;
|
|
182
191
|
//#endregion
|
|
183
192
|
//#region src/react-native/store.d.ts
|
|
184
|
-
type NativeStoreOptions = Omit<NativePermDockProviderProps, "children" | "headers"> & {
|
|
193
|
+
type NativeStoreOptions = Omit<NativePermDockProviderProps, "children" | "headers" | "defaults" | "messages"> & {
|
|
185
194
|
readonly headers?: Readonly<Record<string, string>> | (() => Readonly<Record<string, string>> | undefined);
|
|
186
195
|
/** A store this one replaces: its snapshot and tenant seed this store, so guards do not flip while it boots. */
|
|
187
196
|
readonly previous?: ClientStore;
|
|
@@ -195,4 +204,4 @@ type NativeStoreOptions = Omit<NativePermDockProviderProps, "children" | "header
|
|
|
195
204
|
export declare function connectSource(store: ClientStore, source: SnapshotSource, subscribeForeground?: SubscribeForeground): () => void;
|
|
196
205
|
export declare function createNativeStore(options: NativeStoreOptions): ClientStore;
|
|
197
206
|
//#endregion
|
|
198
|
-
export { type AppStateModule, type ApprovalHandle, type ApprovalState, type ClientPermDock, type ClientStatus, type FilterResult, type LocalSnapshotData, type LocalSnapshotManifest, type LocalSnapshotOptions, type MmkvInstance, type NativePermDockProviderProps, type NativeRevalidate, type NetInfoModule, type PermDockStorage, type PermissionSet, type PermissionState, type PowerSyncQuery, type PowerSyncSourceOptions, type PowerSyncWatchable, Protected, type ProtectedProps, type SecureStoreModule, type SnapshotSource, type SubjectView, type SubscribeForeground, type SubscribeOnline, type TenantView, approvalHeaders, describe, parseLocalSnapshotManifest, requiredPlans, useApproval, useAssignablePermissions, useAssignableRoles, useFilter, useMemberships, usePermDock, usePermission, usePermissions, useRoles, useSubject, useTenant };
|
|
207
|
+
export { type AppStateModule, type ApprovalHandle, type ApprovalState, type ClientPermDock, type ClientStatus, type FilterResult, type LocalSnapshotData, type LocalSnapshotManifest, type LocalSnapshotOptions, type MmkvInstance, type NativePermDockProviderProps, type NativeRevalidate, type NetInfoModule, type PermDockDefaults, type PermDockStorage, type PermissionSet, type PermissionState, type PowerSyncQuery, type PowerSyncSourceOptions, type PowerSyncWatchable, Protected, type ProtectedProps, type SecureStoreModule, type SnapshotSource, type SubjectView, type SubscribeForeground, type SubscribeOnline, type TenantView, approvalHeaders, describe, parseLocalSnapshotManifest, requiredPlans, useApproval, useAssignablePermissions, useAssignableRoles, useDescribe, useFilter, useMemberships, usePermDock, usePermission, usePermissions, useRoles, useSubject, useTenant };
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { t as compact } from "../compact-
|
|
2
|
+
import { t as compact } from "../compact-CAf557ZB.js";
|
|
3
3
|
import { n as freezeDeep } from "../freeze-CrU8nQeX.js";
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import { r as heldRoleNames, t as emptySnapshot } from "../from-snapshot-
|
|
12
|
-
import { t as parseLocalSnapshotManifest } from "../parse-local-manifest-
|
|
4
|
+
import { n as isThenable } from "../thenable-QSmvt-vZ.js";
|
|
5
|
+
import { r as requiredPlans } from "../problem-details-DECUnXAn.js";
|
|
6
|
+
import { t as describe } from "../describe-Cgkp7eP0.js";
|
|
7
|
+
import { a as normalizeMemberships, d as scopeList, m as tenantOf$1, o as resolveScope } from "../scopes-tvpa34ep.js";
|
|
8
|
+
import { n as parseSnapshot, o as bindConditionRefs } from "../snapshot-Dc9CHPME.js";
|
|
9
|
+
import { o as flattenGrantee } from "../grantee-CXY-0C87.js";
|
|
10
|
+
import { c as nowSeconds, d as resolveActiveTenant } from "../tenancy-DshjqY0n.js";
|
|
11
|
+
import { r as heldRoleNames, t as emptySnapshot } from "../from-snapshot-7REQZe0H.js";
|
|
12
|
+
import { t as parseLocalSnapshotManifest } from "../parse-local-manifest-C-q02Pal.js";
|
|
13
13
|
import { t as approvalHeaders } from "../headers-BZSDieNT.js";
|
|
14
|
-
import { n as storeOf, r as isJws, t as adapterStore } from "../store-options-
|
|
15
|
-
import { i as PermDockStoreContext, n as useKeyed, t as useLiveOptions } from "../live-options-
|
|
16
|
-
import { a as
|
|
14
|
+
import { n as storeOf, r as isJws, t as adapterStore } from "../store-options-CbUHDoSe.js";
|
|
15
|
+
import { a as PermDockUiContext, i as PermDockStoreContext, n as useKeyed, t as useLiveOptions } from "../live-options-BaAFCIiu.js";
|
|
16
|
+
import { a as useDescribe, c as usePermDock, d as useRoles, f as useSubject, i as useAssignableRoles, l as usePermission, n as useApproval, o as useFilter, p as useTenant, r as useAssignablePermissions, s as useMemberships, t as Protected, u as usePermissions } from "../protected-BN7BUdY1.js";
|
|
17
17
|
import { useEffect, useMemo, useRef } from "react";
|
|
18
18
|
import { jsx } from "react/jsx-runtime";
|
|
19
19
|
//#region src/react-native/guards.ts
|
|
@@ -447,7 +447,10 @@ function createNativeStore(options) {
|
|
|
447
447
|
maxAge: options.maxAge,
|
|
448
448
|
verifier: options.verifier,
|
|
449
449
|
awaiting: waiting,
|
|
450
|
-
passCache: true
|
|
450
|
+
passCache: true,
|
|
451
|
+
onSnapshot: options.onSnapshot,
|
|
452
|
+
onClear: options.onClear,
|
|
453
|
+
approvalInterval: options.approvalInterval
|
|
451
454
|
}), snapshot, {
|
|
452
455
|
server: false,
|
|
453
456
|
stale: revalidates && (fromStorage !== void 0 || waiting),
|
|
@@ -498,6 +501,9 @@ function PermDockProvider(props) {
|
|
|
498
501
|
headers: live.readHeaders,
|
|
499
502
|
maxAge: props.maxAge,
|
|
500
503
|
verifier: live.verifier,
|
|
504
|
+
onSnapshot: live.onSnapshot,
|
|
505
|
+
onClear: live.onClear,
|
|
506
|
+
approvalInterval: props.approvalInterval,
|
|
501
507
|
previous: shown.current ?? void 0
|
|
502
508
|
})), [
|
|
503
509
|
props.storage,
|
|
@@ -510,8 +516,15 @@ function PermDockProvider(props) {
|
|
|
510
516
|
props.tenant,
|
|
511
517
|
live.fetch,
|
|
512
518
|
props.maxAge,
|
|
513
|
-
live.verifier
|
|
519
|
+
live.verifier,
|
|
520
|
+
live.onSnapshot,
|
|
521
|
+
live.onClear,
|
|
522
|
+
props.approvalInterval
|
|
514
523
|
]);
|
|
524
|
+
const ui = useMemo(() => ({
|
|
525
|
+
defaults: props.defaults,
|
|
526
|
+
messages: props.messages
|
|
527
|
+
}), [props.defaults, props.messages]);
|
|
515
528
|
useEffect(() => {
|
|
516
529
|
const previous = shown.current;
|
|
517
530
|
shown.current = store;
|
|
@@ -580,7 +593,10 @@ function PermDockProvider(props) {
|
|
|
580
593
|
]);
|
|
581
594
|
return /* @__PURE__ */ jsx(PermDockStoreContext, {
|
|
582
595
|
value: store,
|
|
583
|
-
children:
|
|
596
|
+
children: /* @__PURE__ */ jsx(PermDockUiContext, {
|
|
597
|
+
value: ui,
|
|
598
|
+
children: props.children
|
|
599
|
+
})
|
|
584
600
|
});
|
|
585
601
|
}
|
|
586
602
|
//#endregion
|
|
@@ -693,4 +709,4 @@ function netInfoOnline(netInfo) {
|
|
|
693
709
|
});
|
|
694
710
|
}
|
|
695
711
|
//#endregion
|
|
696
|
-
export { PermDockProvider, Protected, appStateForeground, approvalHeaders, buildLocalSnapshot, connectSource, createNativeStore, describe, localSnapshot, memoryStorage, mmkvStorage, netInfoOnline, parseLocalSnapshotManifest, powersyncSource, requiredPlans, secureStoreStorage, useApproval, useAssignablePermissions, useAssignableRoles, useFilter, useMemberships, usePermDock, usePermission, usePermissionGuard, usePermissions, useRoles, useSnapshotReady, useSubject, useTenant };
|
|
712
|
+
export { PermDockProvider, Protected, appStateForeground, approvalHeaders, buildLocalSnapshot, connectSource, createNativeStore, describe, localSnapshot, memoryStorage, mmkvStorage, netInfoOnline, parseLocalSnapshotManifest, powersyncSource, requiredPlans, secureStoreStorage, useApproval, useAssignablePermissions, useAssignableRoles, useDescribe, useFilter, useMemberships, usePermDock, usePermission, usePermissionGuard, usePermissions, useRoles, useSnapshotReady, useSubject, useTenant };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { n as freezeDeep } from "./freeze-CrU8nQeX.js";
|
|
2
|
-
import {
|
|
2
|
+
import { a as assertSafeKey, l as readPath, u as splitPath } from "./thenable-QSmvt-vZ.js";
|
|
3
3
|
//#region src/conditions/ast.ts
|
|
4
4
|
function parentHop(parent) {
|
|
5
5
|
return typeof parent === "string" ? { field: parent } : parent;
|