permdock 0.8.0 → 0.10.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.
Files changed (277) hide show
  1. package/dist/a2a/index.d.ts +4 -4
  2. package/dist/a2a/index.js +3 -3
  3. package/dist/{action-result-CL-QCITA.d.ts → action-result-BcudBQOF.d.ts} +1 -1
  4. package/dist/active-tenant-DVee32-T.js +39 -0
  5. package/dist/{adoption-scan-BLs67P1l.js → adoption-scan-0oFt2RD5.js} +1 -1
  6. package/dist/agent/index.d.ts +2 -2
  7. package/dist/agent/index.js +1 -1
  8. package/dist/ai-sdk/index.d.ts +3 -3
  9. package/dist/ai-sdk/index.js +3 -3
  10. package/dist/{approval-prompt-PYagyQUj.d.ts → approval-prompt-3BqWczTt.d.ts} +1 -1
  11. package/dist/approvals/index.d.ts +3 -3
  12. package/dist/{arazzo-3RhGfkAK.js → arazzo-DA9PCXew.js} +1 -1
  13. package/dist/{arazzo-B5-ulWif.js → arazzo-DhxDfYt-.js} +2 -2
  14. package/dist/astro/index.d.ts +4 -4
  15. package/dist/astro/index.js +1 -1
  16. package/dist/{audience-BAkBDMqn.js → audience-DTjR8xet.js} +1 -1
  17. package/dist/authzen/index.d.ts +5 -5
  18. package/dist/authzen/index.js +1 -1
  19. package/dist/{automation-DqEoWHBc.d.ts → automation-C6Jg75xq.d.ts} +1 -1
  20. package/dist/better-auth/index.d.ts +1 -1
  21. package/dist/better-supabase/index.d.ts +192 -27
  22. package/dist/better-supabase/index.js +248 -64
  23. package/dist/{bind-D_sZSVA3.js → bind-BNQA9JK9.js} +7 -3
  24. package/dist/{bind-Cp2hBHzP.d.ts → bind-YYjvfpB9.d.ts} +12 -7
  25. package/dist/{build-instance-CNWaYJyr.js → build-instance-BWXqwQYU.js} +1 -1
  26. package/dist/{capability-ChuiONQU.d.ts → capability-Di9tiUvi.d.ts} +1 -1
  27. package/dist/{casbin-H0rKxBx2.js → casbin-BJu2liqU.js} +1 -1
  28. package/dist/{casbin-cbSbhT_k.js → casbin-BkhqGh2z.js} +1 -1
  29. package/dist/catalog/index.d.ts +4 -4
  30. package/dist/catalog/index.js +2 -2
  31. package/dist/{catalog-BFpz2EmT.js → catalog-CGlSwU6j.js} +2 -2
  32. package/dist/catalog-D3oS2GH3.js +1 -0
  33. package/dist/{catalog-DCspHDc8.js → catalog-amPDr0JQ.js} +1 -1
  34. package/dist/{catalog-operations-Dadrl7Z-.js → catalog-operations-DeHTrJSV.js} +1 -1
  35. package/dist/chat/index.d.ts +1 -1
  36. package/dist/chat/index.js +1 -1
  37. package/dist/chat-sdk/index.d.ts +3 -3
  38. package/dist/claude-agent/index.d.ts +3 -3
  39. package/dist/claude-agent/index.js +2 -2
  40. package/dist/clerk/index.d.ts +2 -2
  41. package/dist/cli/bin.js +1 -1
  42. package/dist/cli/index.d.ts +9 -4
  43. package/dist/cli/index.js +11 -3
  44. package/dist/cloud/index.d.ts +8 -8
  45. package/dist/{cloud-BFlGMaak.js → cloud-3RIuS4E9.js} +2 -2
  46. package/dist/{codemod-DLQ9Zpo4.js → codemod-DLcp-B6v.js} +2 -2
  47. package/dist/{codemod-DWSN2erG.js → codemod-DRl_w-bY.js} +1 -1
  48. package/dist/collect-D-eroIfV.js +1 -0
  49. package/dist/{collect-Bzv3le0A.js → collect-D9Tt0Bcx.js} +2 -2
  50. package/dist/{collect-B7ZFAJU3.js → collect-WCl8cJQV.js} +1 -1
  51. package/dist/compile/index.d.ts +1 -1
  52. package/dist/{compile-BFzysW3o.d.ts → compile-BEklRUYo.d.ts} +2 -2
  53. package/dist/{completion-saoYiRFO.js → completion-VSWvaaPO.js} +1 -1
  54. package/dist/{config-BwPBfN0t.js → config-BR23fL8m.js} +2 -2
  55. package/dist/{config-DBeXXmBF.js → config-kL36AxkE.js} +1 -1
  56. package/dist/{config-report-BipSWA6V.js → config-report-osnfUNg5.js} +3 -3
  57. package/dist/{config-shape-ykV0Vm2n.js → config-shape-tsxHx71E.js} +2 -1
  58. package/dist/convex/index.d.ts +4 -4
  59. package/dist/convex/index.js +2 -2
  60. package/dist/{core-hWIARPDz.d.ts → core-CFepFiDP.d.ts} +2 -2
  61. package/dist/{core-H-mbhpZc.js → core-DzVINFbU.js} +3 -3
  62. package/dist/{create-Cq4Uox0f.js → create-6EwRQlig.js} +3 -3
  63. package/dist/{create-_noSrY1T.js → create-BLPKnJKa.js} +23 -7
  64. package/dist/{create-BSNrVuxh.d.ts → create-BPUopdfL.d.ts} +7 -7
  65. package/dist/{create-CM1FciYG.d.ts → create-CDd9c22W.d.ts} +15 -6
  66. package/dist/{create-BVq1lNQE.d.ts → create-DBvUsgzK.d.ts} +4 -4
  67. package/dist/delivery/index.d.ts +4 -4
  68. package/dist/delivery/index.js +1 -1
  69. package/dist/{denied-text-CHNlVInN.d.ts → denied-text-DHldhVUv.d.ts} +1 -1
  70. package/dist/{describe-ByS9LgHK.d.ts → describe-BbFPBSms.d.ts} +1 -1
  71. package/dist/{diff-CN8IYhC_.js → diff-BwR1JdP2.js} +1 -1
  72. package/dist/{diff-iZWV65nC.js → diff-CQegtBAo.js} +2 -2
  73. package/dist/{doctor-D3wo-yuz.js → doctor-B9FY9H0F.js} +2 -2
  74. package/dist/{doctor-CHD1M9R5.js → doctor-DfTnMaUt.js} +144 -16
  75. package/dist/drizzle/index.d.ts +3 -3
  76. package/dist/elysia/index.d.ts +4 -4
  77. package/dist/elysia/index.js +1 -1
  78. package/dist/{errors-zi_4T-rx.d.ts → errors-BIM4MFsJ.d.ts} +1 -1
  79. package/dist/{evaluate-Dd8Ta0Ie.js → evaluate-BAmf_AQd.js} +13 -4
  80. package/dist/{evaluations-z8dQFDaN.d.ts → evaluations-DOWuBpWv.d.ts} +3 -3
  81. package/dist/eve/index.d.ts +4 -4
  82. package/dist/eve/index.js +2 -2
  83. package/dist/express/index.d.ts +4 -4
  84. package/dist/express/index.js +1 -1
  85. package/dist/fastify/index.d.ts +4 -4
  86. package/dist/fastify/index.js +1 -1
  87. package/dist/{fetch-adapter-C1DCvpqV.d.ts → fetch-adapter-BIbBAtPZ.d.ts} +2 -2
  88. package/dist/{fetch-adapter-JL43jD3E.js → fetch-adapter-dPTgJVHd.js} +1 -1
  89. package/dist/{fields-D0vUI6dq.js → fields-DI8s3cPl.js} +1 -1
  90. package/dist/{gen-DWCYcMQM.js → gen-DuAhghDw.js} +2 -2
  91. package/dist/{gen-B5kvbAoZ.js → gen-DwgCSC6V.js} +1 -1
  92. package/dist/h3/index.d.ts +4 -4
  93. package/dist/h3/index.js +2 -2
  94. package/dist/hono/index.d.ts +4 -4
  95. package/dist/hono/index.js +1 -1
  96. package/dist/{hosted-Cmtxogd0.d.ts → hosted-DVxlLZMe.d.ts} +1 -1
  97. package/dist/{import-CST57XLp.js → import-CNBF96hB.js} +2 -2
  98. package/dist/{import-_YqhhwvX.js → import-Iuk9mx8A.js} +1 -1
  99. package/dist/{index-BhxEUY9J.d.ts → index-BinlXeU-.d.ts} +2 -2
  100. package/dist/{index-B8s204GL.d.ts → index-CV-7DWeD.d.ts} +4 -4
  101. package/dist/{index-BW_0MZOS.d.ts → index-Cay5-Kvx.d.ts} +13 -8
  102. package/dist/{index-_9UiQIkt.d.ts → index-DJwEgYzA.d.ts} +4 -4
  103. package/dist/{index-BT5-1VsX.d.ts → index-Dj2qF9VC.d.ts} +1 -1
  104. package/dist/{index-Bv5iXPqU.d.ts → index-ymept53A.d.ts} +4 -4
  105. package/dist/index.d.ts +16 -15
  106. package/dist/index.js +6 -6
  107. package/dist/{init-cE3A8aXq.js → init-DeoSvkh2.js} +1 -1
  108. package/dist/{init-Dz_PsHdv.js → init-fNF_XmTa.js} +3 -3
  109. package/dist/{instance-options-B0KXqTrJ.d.ts → instance-options-CoHn-0e8.d.ts} +1 -1
  110. package/dist/{instance-snapshot--JWiTrvO.js → instance-snapshot-DuWf1cT3.js} +13 -8
  111. package/dist/jwt/index.d.ts +4 -4
  112. package/dist/jwt/index.js +1 -1
  113. package/dist/{kernel-C-fYydV2.js → kernel-qv4cr9w8.js} +4 -4
  114. package/dist/kysely/index.d.ts +3 -3
  115. package/dist/{login-DplQ0s84.js → login-CutVtcmQ.js} +1 -1
  116. package/dist/{login-D-8tMqzo.js → login-DYazeWc9.js} +3 -3
  117. package/dist/{manifest-Cgiq5oqc.js → manifest-B4ENCp2I.js} +35 -35
  118. package/dist/{manifest-CzzWtnAb.d.ts → manifest-B5yF3CIq.d.ts} +19 -0
  119. package/dist/{manifest-wg8WkkpD.js → manifest-BXTbHNIV.js} +1 -1
  120. package/dist/{manifest-schema-2r37XRhD.js → manifest-schema-DQkBK2Mr.js} +28 -1
  121. package/dist/{map-claims-BNWCJtmP.js → map-claims-C-nv08_n.js} +2 -1
  122. package/dist/mcp/index.d.ts +8 -8
  123. package/dist/mcp/index.js +4 -4
  124. package/dist/{migrate-B7oP_sQU.js → migrate-BJHxQqT5.js} +2 -2
  125. package/dist/{module-values-BJTBdo6y.js → module-values-B1EVTkHP.js} +1 -1
  126. package/dist/nest/index.d.ts +4 -4
  127. package/dist/nest/index.js +1 -1
  128. package/dist/next/index.d.ts +32 -12
  129. package/dist/next/index.js +15 -8
  130. package/dist/next/plugin.d.ts +1 -1
  131. package/dist/next/plugin.js +1 -1
  132. package/dist/node/index.d.ts +4 -4
  133. package/dist/node/index.js +1 -1
  134. package/dist/openai/index.d.ts +4 -4
  135. package/dist/openai/index.js +3 -3
  136. package/dist/openapi/index.d.ts +2 -2
  137. package/dist/{openapi-VeHHU2l9.js → openapi-C-ADypaY.js} +1 -1
  138. package/dist/{openapi-CBZUhA3l.js → openapi-DFj0cirS.js} +2 -2
  139. package/dist/orpc/index.d.ts +5 -5
  140. package/dist/orpc/index.js +2 -2
  141. package/dist/otel/index.d.ts +3 -3
  142. package/dist/{output-tkju6U7R.js → output-LsbLe41I.js} +1 -1
  143. package/dist/{ownership-B4L59T9u.js → ownership-qqBuGJXr.js} +11 -6
  144. package/dist/{parse-local-manifest-BQhTlLQS.d.ts → parse-local-manifest-CCmbhnxP.d.ts} +1 -1
  145. package/dist/pdp/index.d.ts +3 -3
  146. package/dist/pdp/index.js +1 -1
  147. package/dist/{permdock-L-_I_3zP.js → permdock-BvjivVb9.js} +143 -107
  148. package/dist/{permdock-B6Sf4T_S.d.ts → permdock-CprAPN3w.d.ts} +9 -2
  149. package/dist/{permissions-mDcTWoBs.js → permissions-CYcHj_w7.js} +1 -1
  150. package/dist/{policy-Ba4bDhaj.d.ts → policy-BycVKnXv.d.ts} +1 -1
  151. package/dist/{policy-from-catalog-CJgOm6aq.js → policy-from-catalog-CU3An8uP.js} +1 -1
  152. package/dist/{policy-types-CCiDRZBH.d.ts → policy-types-DGIO_gxq.d.ts} +54 -18
  153. package/dist/{postgrest-DicQyqm-.d.ts → postgrest-D5nUGm-c.d.ts} +4 -3
  154. package/dist/{postgrest-D4nuPXIQ.js → postgrest-DAxFltvO.js} +35 -56
  155. package/dist/{powersync-DXqGuq9A.js → powersync-B_8uwz7f.js} +2 -2
  156. package/dist/powersync-CSzDCHRu.js +1 -0
  157. package/dist/{powersync-DHNQX06W.js → powersync-DUT-UKgw.js} +190 -38
  158. package/dist/prisma/index.d.ts +2 -2
  159. package/dist/{protected-action-BE7N_Luo.d.ts → protected-action-D8x73IGm.d.ts} +6 -6
  160. package/dist/{provider-DXfq5c2d.d.ts → provider-DfLeek9O.d.ts} +1 -1
  161. package/dist/{pull-CwpGaQSi.js → pull-DQCgvJSC.js} +2 -2
  162. package/dist/pull-DYbyod1f.js +1 -0
  163. package/dist/{push-DgssgzkK.js → push-Dq_ca4-j.js} +3 -3
  164. package/dist/{pushed-policy-ITwYKvvH.js → pushed-policy-CDuOL2de.js} +1 -1
  165. package/dist/{pushed-policy-D1Eoi6NM.d.ts → pushed-policy-CryQheKq.d.ts} +1 -1
  166. package/dist/react/index.d.ts +7 -7
  167. package/dist/react/provider-client.d.ts +1 -1
  168. package/dist/react-native/index.d.ts +9 -9
  169. package/dist/{replay-DNftIb_R.d.ts → replay-Bs9Df2fQ.d.ts} +1 -1
  170. package/dist/{request-context-C25ilqiJ.js → request-context-Duzdf0cd.js} +1 -1
  171. package/dist/resend/index.d.ts +4 -4
  172. package/dist/{resolve-names-CF7xXLSG.js → resolve-names-Y1Cb22cp.js} +4 -4
  173. package/dist/{rls-CNEH2_BG.js → rls-B57mIeVq.js} +34 -20
  174. package/dist/{rls-Ca8Jz9b5.js → rls-j0YrFPpW.js} +1 -1
  175. package/dist/{rpc-fNqAIqQk.js → rpc-vHIwyXCp.js} +1 -1
  176. package/dist/run-BATawNVH.js +1 -0
  177. package/dist/{run-Bz26OTfO.js → run-CLP_fQUF.js} +3 -3
  178. package/dist/{run-ticket-Dv7aF7Dk.js → run-ticket-DfnZCh-u.js} +19 -6
  179. package/dist/{run-ticket-DbWI9f99.d.ts → run-ticket-ylovhyFQ.d.ts} +18 -3
  180. package/dist/{saas-iWnUdwCt.js → saas-DK4V-3Is.js} +2 -2
  181. package/dist/{scan-DCj1KQfn.js → scan-B7xrAvRm.js} +1 -1
  182. package/dist/{schema-Dst9I9Gs.js → schema-3PJ8wAeL.js} +1 -1
  183. package/dist/scim/index.d.ts +1 -1
  184. package/dist/server/index.d.ts +11 -11
  185. package/dist/server/index.js +2 -2
  186. package/dist/{server-types-CIlpSA2G.d.ts → server-types-CyRN0-Cd.d.ts} +15 -8
  187. package/dist/{shared-Afctg7B0.js → shared-DrGLwM3s.js} +1 -1
  188. package/dist/{sink-Dvi7YZG_.d.ts → sink-B5zoUW_O.d.ts} +2 -2
  189. package/dist/{skills-OuoMR49L.js → skills-BUI8DMqy.js} +1 -1
  190. package/dist/{skills-Bjj7BNEQ.js → skills-iwbRxavw.js} +1 -1
  191. package/dist/{snapshot-cache-BAXZ0KOp.d.ts → snapshot-cache-BjAWkchD.d.ts} +1 -1
  192. package/dist/solid/index.d.ts +6 -6
  193. package/dist/solid-start/index.d.ts +4 -4
  194. package/dist/solid-start/index.js +2 -2
  195. package/dist/{sources-CMAM-2A3.js → sources-C4vkzZJV.js} +12 -7
  196. package/dist/{types-ah9NlU6j.d.ts → sources-oB1Hg1Fm.d.ts} +316 -2
  197. package/dist/{src-DZ0l9UAg.js → src-C_pi2Rnh.js} +106 -5
  198. package/dist/ssf/index.d.ts +3 -3
  199. package/dist/{standard-webhooks-C-qX4mJW.d.ts → standard-webhooks-DOYEuOLx.d.ts} +2 -2
  200. package/dist/{stores-C0Kta5Ft.d.ts → stores-DZJvxFIZ.d.ts} +6 -6
  201. package/dist/{stream-ltuLdtTG.d.ts → stream-9y9qw51m.d.ts} +1 -1
  202. package/dist/supabase/index.d.ts +5 -6
  203. package/dist/supabase/index.js +4 -4
  204. package/dist/supabase/middleware.d.ts +5 -5
  205. package/dist/supabase/middleware.js +4 -4
  206. package/dist/{supabase-BL1qJzzY.js → supabase-B1EfuD47.js} +2 -2
  207. package/dist/{supabase-D39cuGPt.js → supabase-BaizG0n7.js} +2 -2
  208. package/dist/{supabase-hook-B-yXnzUl.js → supabase-hook-BT2P9wah.js} +110 -47
  209. package/dist/supabase-hook-CbvGAutK.js +1 -0
  210. package/dist/{supautils-BU-pAEpf.js → supautils-DBKOoyjn.js} +247 -200
  211. package/dist/svelte/index.d.ts +6 -6
  212. package/dist/svelte/runtime.d.ts +3 -3
  213. package/dist/svelte/source.d.ts +6 -6
  214. package/dist/sveltekit/index.d.ts +4 -4
  215. package/dist/sveltekit/index.js +1 -1
  216. package/dist/{tables-DeMNEy6V.js → tables-DimBcVWY.js} +3 -3
  217. package/dist/tanstack-start/index.d.ts +4 -4
  218. package/dist/tanstack-start/index.js +1 -1
  219. package/dist/terminal/index.d.ts +5 -5
  220. package/dist/terminal/index.js +2 -2
  221. package/dist/testing/core.d.ts +1 -1
  222. package/dist/testing/core.js +1 -1
  223. package/dist/testing/fixtures/index.d.ts +1 -1
  224. package/dist/testing/fixtures/index.js +26 -28
  225. package/dist/testing/index.d.ts +23 -21
  226. package/dist/testing/index.js +64 -10
  227. package/dist/testing/saas/index.d.ts +3 -3
  228. package/dist/testing/saas/index.js +2 -2
  229. package/dist/testing/saas/permissions.js +1 -1
  230. package/dist/trpc/index.d.ts +5 -5
  231. package/dist/trpc/index.js +2 -2
  232. package/dist/{type-helpers-BIPIDa6a.d.ts → type-helpers-c7Xo_2Cu.d.ts} +1 -1
  233. package/dist/{types-B2mlGuhW.d.ts → types-B2efzoSX.d.ts} +1 -1
  234. package/dist/{types-DHKPcqzr.d.ts → types-B6ExllNo.d.ts} +2 -2
  235. package/dist/{types-AMJ5qoU_.d.ts → types-BB-zWDcR.d.ts} +4 -4
  236. package/dist/{types-djVzLlIV.d.ts → types-CEinc15V.d.ts} +4 -4
  237. package/dist/{types-yUuPR5Hy.d.ts → types-CN0LsqbK.d.ts} +3 -3
  238. package/dist/{types-HzqOtvsJ.d.ts → types-CWBsAwqn.d.ts} +4 -4
  239. package/dist/{types-DC1Loeh3.d.ts → types-Cklw5hJo.d.ts} +26 -3
  240. package/dist/{types-B_tiYvk8.d.ts → types-DLvhVm1r.d.ts} +1 -1
  241. package/dist/{types-B4uqKDnp.d.ts → types-DlelvQk4.d.ts} +2 -2
  242. package/dist/{types-DjuMBNF9.d.ts → types-DsHGPtkR.d.ts} +2 -2
  243. package/dist/{types-BJk0BKRX.d.ts → types-rCRV4Ge-.d.ts} +4 -4
  244. package/dist/{types-B_d_g7T3.d.ts → types-tQB2CEnY.d.ts} +4 -4
  245. package/dist/unplugin/index.d.ts +1 -1
  246. package/dist/unplugin/index.js +1 -1
  247. package/dist/{usage-ab0PdusX.js → usage-B1ZJOUdr.js} +1 -1
  248. package/dist/{usage-CxEzS4ey.js → usage-t_nXnwCW.js} +3 -3
  249. package/dist/usage-weohzv2f.js +1 -0
  250. package/dist/{validation-error-YGg2mXyH.d.ts → validation-error-uvp-kyfO.d.ts} +1 -1
  251. package/dist/{verify-DZeqoWu5.js → verify-jHrbmn-E.js} +9 -9
  252. package/dist/version-cache-Df11C2Qp.d.ts +51 -0
  253. package/dist/vue/index.d.ts +6 -6
  254. package/dist/{waiter-Bu9zAlE0.d.ts → waiter-CqUKX6CY.d.ts} +2 -2
  255. package/dist/{watch-Cx_WciLE.js → watch-Bpci3hBY.js} +2 -2
  256. package/dist/watch-COuvly20.js +1 -0
  257. package/dist/webmcp/index.d.ts +1 -1
  258. package/dist/{who-can-rI7dCR9Q.js → who-can-BoDJm0Nc.js} +1 -1
  259. package/dist/workflow/index.d.ts +3 -3
  260. package/dist/workflow/index.js +23 -7
  261. package/dist/workflow-sdk/index.d.ts +4 -4
  262. package/dist/{wrap-DlJE3gS_.d.ts → wrap-DxXB54Wu.d.ts} +2 -2
  263. package/package.json +3 -3
  264. package/schemas/run-v1.json +16 -0
  265. package/schemas/supabase-manifest-v1.json +28 -0
  266. package/skills/permdock-agents/references/operations-automations-chat.md +1 -0
  267. package/skills/permdock-data/references/queries-and-rls.md +1 -1
  268. package/skills/permdock-wire/references/adapters.md +4 -3
  269. package/dist/catalog-mRQQQhNK.js +0 -1
  270. package/dist/collect-B5BL3klN.js +0 -1
  271. package/dist/powersync-Djf-zCpB.js +0 -1
  272. package/dist/pull-B65ndFNZ.js +0 -1
  273. package/dist/run-D-JE8QWb.js +0 -1
  274. package/dist/sources-B1Os_YUu.d.ts +0 -312
  275. package/dist/supabase-hook-H-MtE9Wd.js +0 -1
  276. package/dist/usage-CYeXek0p.js +0 -1
  277. package/dist/watch-DB42U1ib.js +0 -1
@@ -1,312 +0,0 @@
1
- import { et as MembershipSource } from "./policy-types-CCiDRZBH.js";
2
- import { n as RoleMap, r as RoleThrough, x as SupabaseSuspension } from "./types-ah9NlU6j.js";
3
- import { t as SqlQuery } from "./sql-B80DFdpG.js";
4
- import { c as SupabaseManifestMembership } from "./manifest-CzzWtnAb.js";
5
- //#region src/supabase/roles.d.ts
6
- /** A roles table a role column references, by `schema.table`. */
7
- type RoleKeys = {
8
- readonly table: string;
9
- /** The roles table column the reference points at. */
10
- readonly id: string;
11
- /** The roles table column holding the role key. */
12
- readonly key: string;
13
- /** The referencing table's column. */
14
- readonly ref: string;
15
- };
16
- /**
17
- * One role source of a membership row: a key column, or a reference to a roles
18
- * table.
19
- */
20
- type RoleSource = string | RoleThrough | RoleMap;
21
- /** A role source, or several the row holds at once. */
22
- type RoleSpec = RoleSource | readonly RoleSource[];
23
- /**
24
- * A roles table whose tenant rows are written by tenants. A role key read
25
- * through it from a tenant row that is one of `declared` reads as null, so a
26
- * tenant cannot claim the grants of a declared role by naming a role after it.
27
- */
28
- type RoleGuard = {
29
- /** `schema.table`, or `public`. */
30
- readonly table: string;
31
- /** The tenant column of the roles table. */
32
- readonly tenant: string;
33
- /**
34
- * A tenant row with this column true is the application's own copy of a
35
- * declared role.
36
- */
37
- readonly skip?: string | undefined;
38
- readonly declared: readonly string[];
39
- };
40
- //#endregion
41
- //#region src/supabase/sources.d.ts
42
- type Common = {
43
- readonly table: string;
44
- /**
45
- * Runs the lookups; without it the source only describes SQL (for `permdock
46
- * supabase hook generate`).
47
- */
48
- readonly query?: SqlQuery;
49
- /**
50
- * Drop suspended users and memberships under suspended instances, like
51
- * `rls.suspension`.
52
- */
53
- readonly suspension?: SupabaseSuspension;
54
- };
55
- type MembershipTableOptions = Common & {
56
- /**
57
- * Column names; `user`, `scope`, `id` and `role` default to `user_id`,
58
- * `scope`, `scope_id`, `role`.
59
- */
60
- readonly columns?: {
61
- /** The user id column, or a reference to a table that holds the user id. */
62
- readonly user?: string | RoleThrough;
63
- readonly scope?: string;
64
- readonly id?: string;
65
- /** A `jsonb` column of ancestor ids keyed by scope name. */
66
- readonly within?: string;
67
- /**
68
- * The role key column, a reference to a roles table that holds the key, or
69
- * several of them: the row holds every non-null key.
70
- */
71
- readonly role?: RoleSpec;
72
- readonly via?: string;
73
- readonly expiresAt?: string;
74
- readonly disabledAt?: string;
75
- /** The principal id that wrote the membership (`grantedBy`). */
76
- readonly grantedBy?: string;
77
- /** Free-text justification recorded on the membership (`reason`). */
78
- readonly reason?: string;
79
- /** A subgroup column filling `member.group`. */
80
- readonly group?: string;
81
- /**
82
- * A text column; the value `idp` marks the row as owned by the identity
83
- * provider.
84
- */
85
- readonly managedBy?: string;
86
- /** A `text[]` column of seats. */
87
- readonly seats?: string;
88
- /** A `jsonb` column of app data (`Membership.x`); never written into claims. */
89
- readonly x?: string;
90
- };
91
- };
92
- type MembershipJunctionOptions = Common & {
93
- /** The declared scope every row is a membership of. */
94
- readonly scope: string;
95
- /**
96
- * The user id column (default `user_id`), or a reference to a table that
97
- * holds the user id.
98
- */
99
- readonly user?: string | RoleThrough;
100
- /** The column holding the scope instance id. Default `<scope>_id`. */
101
- readonly id?: string;
102
- /** Ancestor id columns keyed by scope name. */
103
- readonly within?: Readonly<Record<string, string>>;
104
- /**
105
- * A role column, a reference to a roles table that holds the key, fixed roles
106
- * every row holds (a contact table with no role column), or `{ sources }`:
107
- * several role columns whose non-null keys the row holds.
108
- */
109
- readonly roles: string | RoleThrough | RoleMap | readonly string[] | {
110
- readonly sources: readonly RoleSource[];
111
- };
112
- /** The membership kind every row has (`contact`, `staff`, `partner`). */
113
- readonly via?: string;
114
- readonly expiresAt?: string;
115
- readonly disabledAt?: string;
116
- /** The principal id that wrote the membership (`grantedBy`). */
117
- readonly grantedBy?: string;
118
- /** Free-text justification recorded on the membership (`reason`). */
119
- readonly reason?: string;
120
- /** A subgroup filling `member.group`: a fixed name every row has, or a column. */
121
- readonly group?: string | {
122
- readonly column: string;
123
- };
124
- /**
125
- * `idp` when the identity provider owns every row, or a text column holding
126
- * `idp` per row.
127
- */
128
- readonly managedBy?: "idp" | {
129
- readonly column: string;
130
- };
131
- /** A `text[]` column of seats. */
132
- readonly seats?: string;
133
- /** A `jsonb` column of app data (`Membership.x`); never written into claims. */
134
- readonly x?: string;
135
- };
136
- /**
137
- * What `permdock supabase hook generate` compiles; the same SQL the source
138
- * runs.
139
- */
140
- type MembershipSql = {
141
- readonly table: string;
142
- /**
143
- * The table's user column: the user id, or with `userThrough` the reference
144
- * to the row holding it.
145
- */
146
- readonly user: string;
147
- /**
148
- * The table that holds the user id when `user` references it; a change of
149
- * that id bumps the old and the new user.
150
- */
151
- readonly userThrough?: RoleKeys;
152
- /**
153
- * `<table>.<user>%type`: the PL/pgSQL type of the user id column, for a
154
- * variable `select` compares with.
155
- */
156
- readonly userType: string;
157
- /**
158
- * The `select` of claim rows for one user, with every filter applied. `user`
159
- * must have the column's type (a `userType` variable, or an untyped `$1`
160
- * Postgres infers): the column is compared uncast so its index applies.
161
- * `keep` adds the `keep` column; it defaults to `keeps`, and a `union` with a
162
- * source that keeps passes `true`.
163
- */
164
- select: (user: string, keep?: boolean) => string;
165
- /** The `select` of member rows for one scope instance (`$1` scope, `$2` id). */
166
- list: (keep?: boolean) => string;
167
- /**
168
- * A suspended scope on the source keeps permissions: rows of its suspended
169
- * instances stay, with a `keep` column.
170
- */
171
- readonly keeps: boolean;
172
- /**
173
- * A text column holding `idp` for rows the identity provider owns; `''` when
174
- * every row is owned.
175
- */
176
- readonly managed?: string;
177
- /** Other tables the `select` reads (suspension tables). */
178
- readonly reads: readonly string[];
179
- /**
180
- * The roles table the role column references; a key change bumps every
181
- * holder's authorization version.
182
- */
183
- readonly through?: RoleKeys;
184
- /** Every roles table the role columns reference, `through` first. */
185
- readonly throughs: readonly RoleKeys[];
186
- /**
187
- * Every column that decides who holds which membership: user, scope, id,
188
- * `within`, role, `via` and expiry.
189
- */
190
- readonly columns: readonly string[];
191
- /**
192
- * For a single-scope source: its scope and the scopes whose ids each row
193
- * carries.
194
- */
195
- readonly scope?: string;
196
- readonly holds?: readonly string[];
197
- /** The source's entry in the hook manifest's `memberships`. */
198
- readonly manifest: SupabaseManifestMembership;
199
- /** What the ownership triggers count; absent on a source that is not a table. */
200
- readonly holders?: MembershipHolders;
201
- /**
202
- * The rows as plain columns, for Sync Streams and `powerSyncSource`; a source
203
- * without it does not sync.
204
- */
205
- readonly stream?: MembershipStream;
206
- };
207
- /**
208
- * One membership source as columns a Sync Streams query can filter on. Tables
209
- * are `schema.table`; a `through` table is qualified in the source's schema
210
- * when it names none.
211
- */
212
- type MembershipStream = {
213
- readonly table: string;
214
- /** The user id column, or the reference to the table that holds the user id. */
215
- readonly user: string | RoleThrough;
216
- /** The scope column, or the scope every row is a membership of. */
217
- readonly scope: {
218
- readonly column: string;
219
- } | {
220
- readonly value: string;
221
- };
222
- readonly id: string;
223
- /**
224
- * The role sources (the row holds every non-null key), or the fixed roles
225
- * every row holds.
226
- */
227
- readonly roles: RoleSpec | {
228
- readonly value: readonly string[];
229
- };
230
- /** The membership kind column, or the kind every row has. */
231
- readonly via?: {
232
- readonly column: string;
233
- } | {
234
- readonly value: string;
235
- };
236
- readonly expiresAt?: string;
237
- readonly disabledAt?: string;
238
- /**
239
- * A row may hold no role key: such a row is no membership, and a reader drops
240
- * it.
241
- */
242
- readonly nullableRoles: boolean;
243
- /**
244
- * The guard the source reads its roles table with: a tenant row named like a
245
- * declared role is no role.
246
- */
247
- readonly guard?: RoleGuard;
248
- };
249
- /**
250
- * The rows of a membership table, for the holder-count and transfer-only
251
- * triggers `permdock rls generate` puts on it. No suspension filter: a
252
- * suspended holder still holds the role.
253
- */
254
- type MembershipHolders = {
255
- /**
256
- * `<table>.<id column>%type`: the type of a variable `rows` compares the id
257
- * column with.
258
- */
259
- readonly idType: string;
260
- /**
261
- * The instance id of scope `scope` the PL/pgSQL record `row` holds, as text;
262
- * null on a row of another scope.
263
- */
264
- id: (scope: string, row: string) => string;
265
- /**
266
- * `select id, user_id, role, via, live` over the rows of scope `scope` in
267
- * `from` (default the table): one row per held role key, `live` false once
268
- * expired. `id` is an expression of `idType` the id column must equal.
269
- */
270
- rows: (scope: string, options?: {
271
- readonly id?: string;
272
- readonly from?: string;
273
- }) => string;
274
- };
275
- type SqlMembershipSource = MembershipSource & {
276
- readonly sql: MembershipSql;
277
- /**
278
- * The same source with the role keys of tenant rows of `guard.table` named
279
- * like a declared role read as null.
280
- */
281
- readonly guarded?: (guard: RoleGuard) => SqlMembershipSource;
282
- };
283
- /** The part of `@supabase/server`'s `PostgresApi` a `SqlQuery` needs. */
284
- type SupabasePostgres = {
285
- readonly queryRaw: (text: string, params?: unknown[]) => Promise<readonly Record<string, unknown>[]>;
286
- };
287
- declare function supabasePostgresQuery(postgres: SupabasePostgres): SqlQuery;
288
- /**
289
- * Memberships from one table holding every scope: a row per user, scope,
290
- * instance and role (`user_id, scope, scope_id, role`), with optional `within`,
291
- * `via`, expiry, owner and seat columns. Rows of the same instance merge into
292
- * one membership.
293
- */
294
- declare function tableMembershipSource(options: MembershipTableOptions): SqlMembershipSource;
295
- /**
296
- * Memberships from a table of one scope (`customer_contacts`): every row is a
297
- * membership of `scope`, with roles from a column or fixed (`['contact']`), a
298
- * fixed `via`, and ancestor ids from `within` columns.
299
- */
300
- declare function junctionMembershipSource(options: MembershipJunctionOptions): SqlMembershipSource;
301
- declare const AUTHZ_VERSION_TABLE = "permdock_authz_version";
302
- /**
303
- * Reads the authorization version `permdock supabase hook generate` keeps in
304
- * `<schema>.permdock_authz_version`: pass it to `claimsFirst(sources, { version
305
- * })`.
306
- */
307
- declare function authzVersion(options: {
308
- readonly query: SqlQuery;
309
- readonly schema?: string;
310
- }): NonNullable<MembershipSource["version"]>;
311
- //#endregion
312
- export { MembershipStream as a, SupabasePostgres as c, supabasePostgresQuery as d, tableMembershipSource as f, MembershipSql as i, authzVersion as l, MembershipHolders as n, MembershipTableOptions as o, MembershipJunctionOptions as r, SqlMembershipSource as s, AUTHZ_VERSION_TABLE as t, junctionMembershipSource as u };
@@ -1 +0,0 @@
1
- export { i as runSupabase } from "./supabase-hook-B-yXnzUl.js";
@@ -1 +0,0 @@
1
- export { t as runUsage } from "./usage-CxEzS4ey.js";
@@ -1 +0,0 @@
1
- export { i as watchCollect } from "./watch-Cx_WciLE.js";