permdock 0.35.1 → 0.36.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (275) hide show
  1. package/dist/a2a/index.d.ts +1 -1
  2. package/dist/a2a/index.js +2 -2
  3. package/dist/{adoption-scan-B_jVJgMK.js → adoption-scan-FcbJOEo1.js} +1 -1
  4. package/dist/agent/index.d.ts +1 -1
  5. package/dist/agent/index.js +1 -1
  6. package/dist/ai-sdk/index.d.ts +1 -1
  7. package/dist/ai-sdk/index.js +3 -3
  8. package/dist/app/index.d.ts +1 -1
  9. package/dist/app/index.js +1 -1
  10. package/dist/approvals/index.d.ts +1 -1
  11. package/dist/{arazzo-D-fDq8Dv.js → arazzo-BRWgVc8j.js} +1 -1
  12. package/dist/{arazzo-CKsNFj_5.js → arazzo-rYG2UY9k.js} +2 -2
  13. package/dist/astro/index.d.ts +3 -3
  14. package/dist/astro/index.js +1 -1
  15. package/dist/authzen/index.d.ts +3 -3
  16. package/dist/authzen/index.js +1 -1
  17. package/dist/better-supabase/index.d.ts +13 -4
  18. package/dist/better-supabase/index.js +8 -8
  19. package/dist/{bind-DPptdk31.js → bind-2Cuy29LS.js} +2 -2
  20. package/dist/{bind-BnrOLyJq.d.ts → bind-Caffleoh.d.ts} +5 -5
  21. package/dist/{bsb-access-tags-1oVQZWKp.js → bsb-access-tags-Bfmhft2o.js} +1 -1
  22. package/dist/{bsb-action-keys-BfZAwg-9.js → bsb-action-keys-LgveZiHJ.js} +2 -2
  23. package/dist/{bsb-actions-BHiyBxQZ.js → bsb-actions-DcDxQ_Ku.js} +3 -3
  24. package/dist/{budgets-hi-ecgEd.js → budgets-B2hIDaz7.js} +2 -2
  25. package/dist/{build-instance-DZEWYO-A.js → build-instance-CZg_Bf45.js} +1 -1
  26. package/dist/{bundle-size-DbXV65Ix.js → bundle-size-BjdmlKWJ.js} +2 -2
  27. package/dist/bundle-size-BoG9Jm7c.js +1 -0
  28. package/dist/{casbin-CWfeuRmI.js → casbin-4FACZ5Ez.js} +1 -1
  29. package/dist/{casbin-DqiTIceJ.js → casbin-Cz8BGXHW.js} +1 -1
  30. package/dist/{catalog-CBPFyRv7.js → catalog-DYC6wfAj.js} +1 -1
  31. package/dist/{catalog-BExjL94D.js → catalog-SnaPhbZ1.js} +2 -2
  32. package/dist/{catalog-doc-D4g3nyFB.js → catalog-doc-BX97oFAn.js} +1 -1
  33. package/dist/catalog-e6QRd1JP.js +1 -0
  34. package/dist/chat/index.d.ts +1 -1
  35. package/dist/chat/index.js +1 -1
  36. package/dist/chat-sdk/index.d.ts +1 -1
  37. package/dist/claude-agent/index.d.ts +2 -2
  38. package/dist/claude-agent/index.js +2 -2
  39. package/dist/clerk/index.d.ts +1 -1
  40. package/dist/cli/bin.js +1 -1
  41. package/dist/cli/generate/watch-worker.js +1 -1
  42. package/dist/cli/index.js +1 -1
  43. package/dist/cli/plugins/app.js +1 -1
  44. package/dist/cli/plugins/openapi.js +1 -1
  45. package/dist/cli/plugins/powersync.js +1 -1
  46. package/dist/cli/plugins/rls.js +1 -1
  47. package/dist/cli/plugins/schemas.js +1 -1
  48. package/dist/cli/plugins/supabase-hook.js +1 -1
  49. package/dist/cli/plugins/supabase.js +2 -2
  50. package/dist/cli/plugins/ui.js +1 -1
  51. package/dist/{cloud-CvA_LeOt.js → cloud-BB67klb4.js} +2 -2
  52. package/dist/{codemod-DduTfuWM.js → codemod-BPcxGOlq.js} +5 -5
  53. package/dist/{codemod-CA0MQoG4.js → codemod-Lov9764v.js} +1 -1
  54. package/dist/collect-C2_CKZ09.js +1 -0
  55. package/dist/{collect-Ba7ccZ23.js → collect-CcE8QBtZ.js} +2 -2
  56. package/dist/{collect-CPimbkC5.js → collect-Co-w8Eg2.js} +1 -1
  57. package/dist/compile/index.d.ts +1 -1
  58. package/dist/{compile-CoUadQXF.d.ts → compile-CyUn58lf.d.ts} +1 -1
  59. package/dist/{compile-D-BULiHE.js → compile-EtZv2wc0.js} +6 -6
  60. package/dist/{completion-DXdFnwLY.js → completion-5Y8toe1d.js} +1 -1
  61. package/dist/{config-BWYfHYvW.js → config-DfbiV554.js} +1 -1
  62. package/dist/{config-report-pg-66Bdr.js → config-report-Cs6iDebE.js} +2 -2
  63. package/dist/{context-rioF4fQl.js → context-CFPsmfPl.js} +1 -1
  64. package/dist/convex/index.d.ts +2 -2
  65. package/dist/convex/index.js +2 -2
  66. package/dist/{core-DCMIztx1.d.ts → core-_Lofwt2K.d.ts} +1 -1
  67. package/dist/{core-DIUrkFNL.js → core-s_TCdJ6G.js} +2 -2
  68. package/dist/{create-BYL8xCJB.d.ts → create-BfTbYrts.d.ts} +1 -1
  69. package/dist/{create-T_NqxU31.d.ts → create-D12I1Vkl.d.ts} +4 -4
  70. package/dist/{create-BMRnaZel.js → create-D6B06lb8.js} +3 -3
  71. package/dist/{create-iCwrnaFE.d.ts → create-EPbgV-LA.d.ts} +2 -2
  72. package/dist/{create-BRY0OtFV.js → create-bbjS7tCW.js} +2 -2
  73. package/dist/{credentials-DzNrCNZY.d.ts → credentials-DtSnydoD.d.ts} +1 -1
  74. package/dist/{custom-role-rebuild-wzN8pqDk.js → custom-role-rebuild-QFXiMHqJ.js} +1 -1
  75. package/dist/{define-permdock-CO7YNrOF.js → define-permdock-Dazve5lw.js} +1 -1
  76. package/dist/{define-permdock-Bhye7WSY.d.ts → define-permdock-ZR0w-Loy.d.ts} +3 -3
  77. package/dist/delivery/index.d.ts +1 -1
  78. package/dist/{diff-CkSZF7LO.js → diff-BABnQ-z0.js} +3 -3
  79. package/dist/{diff-CS8ks9h3.js → diff-C7zKA7ny.js} +1 -1
  80. package/dist/{doctor-Cs0Xl46A.js → doctor-Chio5Col.js} +101 -31
  81. package/dist/{doctor-B55XfWdG.js → doctor-Cm1HDI5s.js} +2 -2
  82. package/dist/drizzle/index.d.ts +2 -2
  83. package/dist/elysia/index.d.ts +3 -3
  84. package/dist/elysia/index.js +1 -1
  85. package/dist/{evaluations-CUkSKioS.d.ts → evaluations-BYoj5ci6.d.ts} +1 -1
  86. package/dist/eve/index.d.ts +2 -2
  87. package/dist/eve/index.js +2 -2
  88. package/dist/{execute-Vfo2CAhv.js → execute-B_yY9xWV.js} +4 -4
  89. package/dist/{explain-DISCeeYS.js → explain-Blkq60Ff.js} +2 -2
  90. package/dist/{explain-D4ipf8IH.js → explain-CKIqxXSe.js} +1 -1
  91. package/dist/express/index.d.ts +3 -3
  92. package/dist/express/index.js +1 -1
  93. package/dist/fastify/index.d.ts +3 -3
  94. package/dist/fastify/index.js +1 -1
  95. package/dist/{fetch-adapter-Ds2-fUUi.d.ts → fetch-adapter-CdaSVKrt.d.ts} +2 -2
  96. package/dist/{fetch-adapter-BXQc4NoV.js → fetch-adapter-DXgza6EM.js} +1 -1
  97. package/dist/{fields-CwFej4gp.js → fields-CKX-qjWb.js} +1 -1
  98. package/dist/gen-CYuPbpBZ.js +1 -0
  99. package/dist/{gen-M_5UU5Ck.js → gen-DlJK73v7.js} +4 -4
  100. package/dist/{gen-kind-DLz0P-TB.js → gen-kind-C4tERYMw.js} +1 -1
  101. package/dist/{generate-CNkkKAL-.js → generate-CFqcr3H6.js} +94 -15
  102. package/dist/{generate-GCDLA8vW.js → generate-CbLA2WW_.js} +3 -3
  103. package/dist/{generate-options-O3mVjjcG.js → generate-options-BFAvlJKQ.js} +9 -9
  104. package/dist/h3/index.d.ts +3 -3
  105. package/dist/h3/index.js +2 -2
  106. package/dist/{helper-calls-B5MOl99d.js → helper-calls-DN1PJcNY.js} +53 -1
  107. package/dist/hono/index.d.ts +3 -3
  108. package/dist/hono/index.js +1 -1
  109. package/dist/{hook-sql-y0CJBLJr.js → hook-sql-CSUFnRn0.js} +283 -13
  110. package/dist/{import-CQSJ6xcN.js → import-B-17dw3B.js} +1 -1
  111. package/dist/{import-Bz6IKoMM.js → import-wBO24zgo.js} +1 -1
  112. package/dist/{index-Cjr8Q-uq.d.ts → index-Bb2sZq1K.d.ts} +8 -7
  113. package/dist/{index-CWBCzwOp.d.ts → index-CT4VKXU-.d.ts} +1 -1
  114. package/dist/{index-ktQ7E4qB.d.ts → index-Cfg0ED9K.d.ts} +2 -2
  115. package/dist/{index-BOJPdIBk.d.ts → index-DY1aJ-K1.d.ts} +1 -1
  116. package/dist/index.d.ts +4 -4
  117. package/dist/index.js +2 -2
  118. package/dist/{init-BucxAxRw.js → init-Bg0vS1LV.js} +1 -1
  119. package/dist/{init-Cfb0VX3T.js → init-DRbkPclr.js} +3 -3
  120. package/dist/{inspect-functions-CzrQtRDb.js → inspect-functions-DLP72IMA.js} +1 -1
  121. package/dist/{instance-options-DDERlopm.d.ts → instance-options-D-SLCp4I.d.ts} +1 -1
  122. package/dist/{interactive-only-Bbq9e61G.js → interactive-only-CylKSukS.js} +1 -1
  123. package/dist/{kernel-DSnWVZ0O.js → kernel-CzzmzwLg.js} +3 -3
  124. package/dist/{keys-BWhAnANj.js → keys-C-W0yrql.js} +1 -1
  125. package/dist/kysely/index.d.ts +2 -2
  126. package/dist/{lazy-provider-Clt2095H.d.ts → lazy-provider-BSHAIpMK.d.ts} +1 -1
  127. package/dist/{login-qYcM0hKh.js → login-D6IJk8k1.js} +1 -1
  128. package/dist/{login-CU89mk0U.js → login-yF-sDNm9.js} +3 -3
  129. package/dist/{manifest-Bu9gUrI0.js → manifest-DkHIGPoY.js} +63 -52
  130. package/dist/{manifest-schema-N3v2RVL-.js → manifest-schema-CkROwfT9.js} +1 -1
  131. package/dist/{manifest-CIWOmdlP.js → manifest-teSfgeqF.js} +1 -1
  132. package/dist/mcp/index.d.ts +3 -3
  133. package/dist/mcp/index.js +2 -2
  134. package/dist/{measure-C_Z0a7B8.js → measure-_VlSPfSY.js} +2 -2
  135. package/dist/{memberships-CNoAlsma.js → memberships-CDiSsFTu.js} +1 -1
  136. package/dist/{memberships-4e6qi8Uv.js → memberships-DiCbNRny.js} +1 -1
  137. package/dist/{model-BYCtXS_g.js → model-r7X_HXyS.js} +2 -2
  138. package/dist/{names-DBxKx2bz.js → names-DwGleRKB.js} +3 -3
  139. package/dist/nest/index.d.ts +3 -3
  140. package/dist/nest/index.js +1 -1
  141. package/dist/next/index.d.ts +6 -6
  142. package/dist/next/index.js +3 -3
  143. package/dist/next/plugin.js +1 -1
  144. package/dist/node/index.d.ts +3 -3
  145. package/dist/node/index.js +1 -1
  146. package/dist/openai/index.d.ts +2 -2
  147. package/dist/openai/index.js +3 -3
  148. package/dist/{openapi-DIhS8iHN.js → openapi-D156UqcM.js} +100 -5
  149. package/dist/{openapi-ZIlGKUwQ.js → openapi-Dcqqja0n.js} +1 -1
  150. package/dist/{openapi-document-D5IhoJo0.js → openapi-document-CTvHkCXz.js} +1 -1
  151. package/dist/orpc/index.d.ts +4 -4
  152. package/dist/orpc/index.js +2 -2
  153. package/dist/otel/index.d.ts +2 -2
  154. package/dist/{output-DIjUJioq.js → output-DNbj0_Yi.js} +1 -1
  155. package/dist/{ownership-Bmt-z0rF.js → ownership-BvKT4DBj.js} +3 -3
  156. package/dist/pdp/index.d.ts +2 -2
  157. package/dist/pdp/index.js +1 -1
  158. package/dist/{permdock-DkvkGVF0.d.ts → permdock-CHU1LZGq.d.ts} +5 -3
  159. package/dist/{permdock-JM9TKevZ.js → permdock-DZmr2kJw.js} +2 -1
  160. package/dist/{permissions-xPyAmuXi.js → permissions-DUmypTlO.js} +1 -1
  161. package/dist/{pipeline-BAGSNnct.js → pipeline-BMbLI2Sj.js} +2 -2
  162. package/dist/{policy-D8RxFeZO.js → policy-DekUQ-6v.js} +1 -1
  163. package/dist/{policy-bundle-DC_xq2R5.js → policy-bundle-JU4-AFJM.js} +3 -3
  164. package/dist/{powersync-CgCMKvaU.js → powersync-CpxkK_Lz.js} +1 -1
  165. package/dist/{powersync-BlfO3_jN.js → powersync-D9ZLDzyv.js} +1 -1
  166. package/dist/{powersync-CiQ97gzz.js → powersync-cG4lxrzQ.js} +8 -8
  167. package/dist/prisma/index.d.ts +1 -1
  168. package/dist/{protected-action-gBxeetqY.d.ts → protected-action-Dux5RJbA.d.ts} +3 -3
  169. package/dist/{provider-Clt2095H.d.ts → provider-BSHAIpMK.d.ts} +1 -1
  170. package/dist/{provider-BwqzED5h.js → provider-BfKUBNyV.js} +32 -5
  171. package/dist/{prune-config-CbhJ_XvD.js → prune-config-ByigsAkl.js} +4 -4
  172. package/dist/{pull-DLyCr-7L.js → pull-4Cyo0uTS.js} +3 -3
  173. package/dist/pull-_ic7Md2h.js +1 -0
  174. package/dist/{push-D5so0ptb.js → push-Br0Uz5pT.js} +2 -2
  175. package/dist/{rbac-DbyaaNLa.js → rbac-BOVyTCI6.js} +3 -3
  176. package/dist/react/index.d.ts +4 -4
  177. package/dist/react/lazy.d.ts +4 -4
  178. package/dist/react/provider-client-lazy.d.ts +1 -1
  179. package/dist/react/provider-client.d.ts +1 -1
  180. package/dist/react-native/index.d.ts +4 -4
  181. package/dist/{rename-CI6NIF9t.js → rename-Dp47Gs_j.js} +2 -2
  182. package/dist/{report-DF0zUNut.js → report-Dp-ApWVC.js} +1 -1
  183. package/dist/{report-XdCm1y_J.js → report-x9GeUvjx.js} +1 -1
  184. package/dist/{request-context-CqqdiVp4.js → request-context-LvIolknK.js} +1 -1
  185. package/dist/{resolve-names-BR6PiCrx.js → resolve-names-B_no27Dh.js} +4 -4
  186. package/dist/{resolver-D2c1CcoZ.js → resolver-CAmmdVAL.js} +22 -11
  187. package/dist/{rls-CdQW7v9D.js → rls-C816Uuvx.js} +5 -5
  188. package/dist/{rls-BfUIMNeV.js → rls-DB18scnl.js} +13 -12
  189. package/dist/{rls-files-68-nKfmG.js → rls-files-Cp-qzl61.js} +1 -1
  190. package/dist/{row-conditions-DwIJocfQ.js → row-conditions-BjARoFLU.js} +1 -1
  191. package/dist/{rpc-BYFB37KV.d.ts → rpc-CL8lrV5Y.d.ts} +1 -1
  192. package/dist/{rpc-BQPa7tLP.js → rpc-CoClxzcc.js} +1 -1
  193. package/dist/{run-B2Axta4z.js → run-CJhz8BHw.js} +2 -2
  194. package/dist/run-PpoUQXDc.js +1 -0
  195. package/dist/{run-ticket-CRldclc7.d.ts → run-ticket-CCRYQNj0.d.ts} +1 -1
  196. package/dist/{saas-DSeazNrN.js → saas-iXqf78G8.js} +2 -2
  197. package/dist/{scan-DNzOELYT.js → scan-DvM-_F8-.js} +1 -1
  198. package/dist/{schema-CJc23R4a.js → schema-uTRr3B9f.js} +1 -1
  199. package/dist/server/index.d.ts +5 -5
  200. package/dist/server/index.js +1 -1
  201. package/dist/{server-types-FkdDSB9h.d.ts → server-types-C_Lnc8Ec.d.ts} +5 -5
  202. package/dist/{size-CY6rK6l9.js → size-BO7J8M3B.js} +2 -2
  203. package/dist/{skills-DTpSMQRg.js → skills-B5exEJf5.js} +1 -1
  204. package/dist/{skills-TqrLrmuv.js → skills-DF_3nX9_.js} +1 -1
  205. package/dist/{snapshot-size-D6ixbYvH.js → snapshot-size-BzamcZrn.js} +1 -1
  206. package/dist/{snapshot-size-NklqBKcV.js → snapshot-size-CJ53OOen.js} +1 -1
  207. package/dist/solid/index.d.ts +2 -2
  208. package/dist/solid-start/index.d.ts +3 -3
  209. package/dist/solid-start/index.js +2 -2
  210. package/dist/{src-BXDohWNO.js → src-CYKqpYUM.js} +4 -4
  211. package/dist/{store-core-aluQ3R1M.d.ts → store-core-D5-cqb6z.d.ts} +1 -1
  212. package/dist/{stores-hHICuiQl.d.ts → stores-DPUPLu29.d.ts} +3 -3
  213. package/dist/supabase/index.d.ts +2 -2
  214. package/dist/supabase/index.js +3 -3
  215. package/dist/supabase/middleware.d.ts +4 -4
  216. package/dist/supabase/middleware.js +3 -3
  217. package/dist/{supabase-MitbozF6.js → supabase-Dpy2XE9v.js} +2 -2
  218. package/dist/{supabase-ByhSqBDB.js → supabase-NpHqrRXC.js} +2 -2
  219. package/dist/supabase-hook-DaK4Rirh.js +2 -0
  220. package/dist/{supabase-hook-RFLW2YPX.js → supabase-hook-VIpXUHKI.js} +5 -5
  221. package/dist/{supabase-schemas-CVhpyYB6.js → supabase-schemas-DA28GP4N.js} +1 -1
  222. package/dist/{supautils-C85NuESf.js → supautils-ym4X20ig.js} +2 -1
  223. package/dist/svelte/index.d.ts +3 -3
  224. package/dist/svelte/runtime.d.ts +2 -2
  225. package/dist/svelte/source.d.ts +3 -3
  226. package/dist/sveltekit/index.d.ts +3 -3
  227. package/dist/sveltekit/index.js +1 -1
  228. package/dist/{table-reads-Dso5UyeT.js → table-reads-4KzGXg9f.js} +1 -1
  229. package/dist/{table-reads-D0M_X-pj.js → table-reads-B5kunhny.js} +3 -3
  230. package/dist/{tables-DrrGtayG.js → tables-BwQvlpS4.js} +4 -4
  231. package/dist/tanstack-start/index.d.ts +3 -3
  232. package/dist/tanstack-start/index.js +1 -1
  233. package/dist/{tenant-check-D6fnfQBP.js → tenant-check-CsJkduIb.js} +3 -3
  234. package/dist/terminal/index.d.ts +2 -2
  235. package/dist/terminal/index.js +2 -2
  236. package/dist/testing/core.d.ts +1 -1
  237. package/dist/testing/core.js +1 -1
  238. package/dist/testing/fixtures/index.js +1753 -162
  239. package/dist/testing/index.d.ts +7 -7
  240. package/dist/testing/index.js +6 -6
  241. package/dist/testing/saas/index.d.ts +1 -1
  242. package/dist/testing/saas/index.js +2 -2
  243. package/dist/testing/saas/permissions.js +1 -1
  244. package/dist/trpc/index.d.ts +4 -4
  245. package/dist/trpc/index.js +2 -2
  246. package/dist/{types-DRMoZjJm.d.ts → types-B23A72BG.d.ts} +1 -1
  247. package/dist/{types-D417woMp.d.ts → types-BRaJxlqL.d.ts} +2 -2
  248. package/dist/{types-CBUYbPwl.d.ts → types-C8sDUhaF.d.ts} +1 -1
  249. package/dist/{types-dtDg4goh.d.ts → types-CM5GwxiJ.d.ts} +2 -2
  250. package/dist/{types-BzsplNgO.d.ts → types-iwSmOTcK.d.ts} +2 -2
  251. package/dist/unplugin/index.js +1 -1
  252. package/dist/{usage-DBaJfCZB.js → usage-BD_z4pba.js} +1 -1
  253. package/dist/{usage-Cv4WDRWv.js → usage-_9h9jQo8.js} +4 -4
  254. package/dist/usage-wphGxzPQ.js +1 -0
  255. package/dist/{verify-DT9WS_Gm.js → verify-cw6SFoQE.js} +9 -9
  256. package/dist/vue/index.d.ts +2 -2
  257. package/dist/{warm-BZ0ZwSmO.js → warm-XyQ-2nUR.js} +1 -1
  258. package/dist/watch-5WP3ZCcR.js +1 -0
  259. package/dist/{watch-14vng0pg.js → watch-BFDMb5N4.js} +1 -1
  260. package/dist/{watch-DuIAsqFR.js → watch-Cvc7eUPk.js} +2 -2
  261. package/dist/workflow/index.d.ts +1 -1
  262. package/dist/workflow/index.js +1 -1
  263. package/dist/workflow-sdk/index.d.ts +2 -2
  264. package/dist/{wrap-C36-eV-C.d.ts → wrap-B4Ge6LOd.d.ts} +1 -1
  265. package/package.json +1 -1
  266. package/schemas/supabase-manifest-v1.json +1 -1
  267. package/dist/bundle-size-BRFeBvuv.js +0 -1
  268. package/dist/catalog-sR0m6x2g.js +0 -1
  269. package/dist/collect-CIdE3FGC.js +0 -1
  270. package/dist/gen-vr1udb1p.js +0 -1
  271. package/dist/pull-IQPhpX4y.js +0 -1
  272. package/dist/run-CfvcMtPK.js +0 -1
  273. package/dist/supabase-hook-DZk7PV7Z.js +0 -2
  274. package/dist/usage-DOcCnIdW.js +0 -1
  275. package/dist/watch-Be7ja4dL.js +0 -1
@@ -7,12 +7,101 @@ const docFlag = { doc: {
7
7
  description: "OpenAPI document: a path, or a URL for import",
8
8
  valueHint: "path"
9
9
  } };
10
- ({
10
+ const emitFlags = {
11
11
  ...docFlag,
12
12
  ...outFlag,
13
13
  ...checkFlag,
14
- ...policyFlag
15
- });
14
+ ...policyFlag,
15
+ target: {
16
+ type: "enum",
17
+ options: [
18
+ "3.1",
19
+ "3.2",
20
+ "3.3"
21
+ ],
22
+ default: "3.2",
23
+ description: "OpenAPI version; 3.3 is the pinned Security Profiles draft"
24
+ },
25
+ kind: {
26
+ type: "enum",
27
+ options: ["document", "overlay"],
28
+ default: "document",
29
+ description: "A full document or an Overlay"
30
+ },
31
+ overlay: {
32
+ type: "enum",
33
+ options: ["1.1", "1.2"],
34
+ default: "1.1",
35
+ description: "Overlay version; 1.2 is the pinned reusable-actions draft"
36
+ },
37
+ profile: {
38
+ type: "enum",
39
+ options: ["fapi2"],
40
+ description: "Security profile to declare"
41
+ },
42
+ "profile-scheme": {
43
+ type: "string",
44
+ description: "Security scheme name for the profile",
45
+ valueHint: "name"
46
+ },
47
+ scheme: {
48
+ type: "string",
49
+ description: "OAuth security scheme name (default permdockOAuth)",
50
+ valueHint: "name"
51
+ },
52
+ "metadata-url": {
53
+ type: "string",
54
+ description: "OAuth authorization server metadata URL",
55
+ valueHint: "url"
56
+ },
57
+ "device-flow": {
58
+ type: "boolean",
59
+ description: "Declare the device authorization flow"
60
+ },
61
+ arity: {
62
+ type: "boolean",
63
+ description: "Mark instance and collection operations"
64
+ },
65
+ "authorization-url": {
66
+ type: "string",
67
+ description: "OAuth authorization endpoint",
68
+ valueHint: "url"
69
+ },
70
+ "token-url": {
71
+ type: "string",
72
+ description: "OAuth token endpoint",
73
+ valueHint: "url"
74
+ },
75
+ "device-authorization-url": {
76
+ type: "string",
77
+ description: "OAuth device authorization endpoint",
78
+ valueHint: "url"
79
+ }
80
+ };
81
+ async function executeOpenapiEmit(ctx, flags) {
82
+ return (await import("./openapi-Dcqqja0n.js")).runOpenapi({
83
+ cwd: ctx.cwd,
84
+ config: ctx.config,
85
+ rest: ["emit"],
86
+ doc: given(flags.doc),
87
+ out: fileOut("openapi emit", flags.out),
88
+ from: given(flags.policy),
89
+ target: flags.target,
90
+ format: flags.kind,
91
+ overlay: flags.overlay,
92
+ check: flags.check,
93
+ profile: flags.profile,
94
+ profileScheme: given(flags["profile-scheme"]),
95
+ scheme: given(flags.scheme) ?? "permdockOAuth",
96
+ metadataUrl: given(flags["metadata-url"]),
97
+ deviceFlow: flags["device-flow"],
98
+ arity: flags.arity,
99
+ authorizationUrl: given(flags["authorization-url"]),
100
+ tokenUrl: given(flags["token-url"]),
101
+ deviceAuthorizationUrl: given(flags["device-authorization-url"]),
102
+ io: ctx.io
103
+ });
104
+ }
16
105
  const annotateFlags = {
17
106
  routes: {
18
107
  type: "string",
@@ -64,6 +153,12 @@ async function executeAnnotate(ctx, flags) {
64
153
  io: ctx.io
65
154
  });
66
155
  }
156
+ const emitDocument = defineLeaf({
157
+ flags: emitFlags,
158
+ run(ctx, { flags }) {
159
+ return executeOpenapiEmit(ctx, flags);
160
+ }
161
+ });
67
162
  const annotateRoutes = defineLeaf({
68
163
  flags: annotateFlags,
69
164
  run(ctx, { flags }) {
@@ -88,7 +183,7 @@ const importDocument = defineLeaf({
88
183
  async run(ctx, { flags }) {
89
184
  const doc = given(flags.doc);
90
185
  if (doc === void 0) throw missingInput("openapi import", ["--doc"], "the OpenAPI document to import");
91
- return (await import("./import-CQSJ6xcN.js")).runOpenapiImport({
186
+ return (await import("./import-B-17dw3B.js")).runOpenapiImport({
92
187
  cwd: ctx.cwd,
93
188
  doc,
94
189
  out: fileOut("openapi import", flags.out),
@@ -99,4 +194,4 @@ const importDocument = defineLeaf({
99
194
  });
100
195
  }
101
196
  });
102
- export { annotateRoutes, importDocument };
197
+ export { annotateRoutes, emitDocument, importDocument };
@@ -7,7 +7,7 @@ import { i as fileDrift } from "./output-files-8lfALMSU.js";
7
7
  import { t as shortDiff } from "./text-diff-DxKRNFlx.js";
8
8
  import { i as readJsonFile, s as writeFileEnsuringDir } from "./files-DAR51W3J.js";
9
9
  import { a as loadModule, n as asPolicy, s as pickNamed, t as asPermissionTree } from "./load-m7jmit3y.js";
10
- import { n as validateOverlay, t as validateOpenapi } from "./schema-CJc23R4a.js";
10
+ import { n as validateOverlay, t as validateOpenapi } from "./schema-uTRr3B9f.js";
11
11
  import { existsSync } from "node:fs";
12
12
  import { resolve } from "node:path";
13
13
  // src/cli/openapi/emit/merge.ts
@@ -3,7 +3,7 @@ import { n as CliError } from "./errors-DgLOqc6j.js";
3
3
  /** The annotated document, without writing it. */
4
4
  async function openapiDocument(task, options, source) {
5
5
  if (options.doc === void 0) return [];
6
- const { runOpenapi } = await import("./openapi-ZIlGKUwQ.js");
6
+ const { runOpenapi } = await import("./openapi-Dcqqja0n.js");
7
7
  const outcome = await runOpenapi({
8
8
  cwd: source.cwd,
9
9
  config: source.config,
@@ -1,10 +1,10 @@
1
- import { a as PermDock } from "../permdock-DkvkGVF0.js";
1
+ import { a as PermDock } from "../permdock-CHU1LZGq.js";
2
2
  import { w as Permission } from "../vocabulary-DHfKPIC5.js";
3
3
  import { D as Policy, N as PolicyVocabulary, Or as Principal } from "../policy-types-DuM3k5Ao.js";
4
4
  import { n as RevocationFeed } from "../revocations-ku_f2d2y.js";
5
- import { t as ServerAdapterOptions } from "../bind-BnrOLyJq.js";
6
- import { D as ConnectionOptions, T as Connection, i as OpenApiHooks } from "../server-types-FkdDSB9h.js";
7
- import { t as RpcProtectOptions } from "../rpc-BYFB37KV.js";
5
+ import { t as ServerAdapterOptions } from "../bind-Caffleoh.js";
6
+ import { D as ConnectionOptions, T as Connection, i as OpenApiHooks } from "../server-types-C_Lnc8Ec.js";
7
+ import { t as RpcProtectOptions } from "../rpc-CL8lrV5Y.js";
8
8
  import { a as OperationInput, t as Operation } from "../operations-DaEoGpMV.js";
9
9
  import { AnySchema, MetaPlugin, Middleware, Procedure, Schema } from "@orpc/server";
10
10
  import { StandardSchemaV1 } from "@standard-schema/spec";
@@ -1,9 +1,9 @@
1
1
  import { t as compact } from "../compact-C4LFuqbW.js";
2
2
  import { o as isPermission } from "../permission-registry-DstT40VS.js";
3
- import { n as attached } from "../bind-DPptdk31.js";
3
+ import { n as attached } from "../bind-2Cuy29LS.js";
4
4
  import { o as problemMessage } from "../http-C9jDw_bZ.js";
5
5
  import { t as problemFromError } from "../map-error-DYQbf-3Q.js";
6
- import { i as rpcCode, n as guardStream, r as problemBody, t as bindRpcKernel } from "../rpc-BQPa7tLP.js";
6
+ import { i as rpcCode, n as guardStream, r as problemBody, t as bindRpcKernel } from "../rpc-CoClxzcc.js";
7
7
  import { i as isAsyncIterable, o as reloadAfter } from "../stream-DdF94h7T.js";
8
8
  import { r as permissionList } from "../decide-set-CgNcE6pP.js";
9
9
  import { ORPCError, os } from "@orpc/server";
@@ -1,6 +1,6 @@
1
- import { a as PermDock } from "../permdock-DkvkGVF0.js";
1
+ import { a as PermDock } from "../permdock-CHU1LZGq.js";
2
2
  import { N as PolicyVocabulary } from "../policy-types-DuM3k5Ao.js";
3
- import { a as OtelOptions, i as OtelApi, n as GEN_AI_TOOL_CALL_ID, o as OtelWrap, r as GEN_AI_TOOL_NAME, s as StructuralLogger, t as GENAI_SEMCONV_PIN } from "../types-DRMoZjJm.js";
3
+ import { a as OtelOptions, i as OtelApi, n as GEN_AI_TOOL_CALL_ID, o as OtelWrap, r as GEN_AI_TOOL_NAME, s as StructuralLogger, t as GENAI_SEMCONV_PIN } from "../types-B23A72BG.js";
4
4
  /**
5
5
  * Listens on one instance. Spans carry no duration and no histogram is
6
6
  * recorded, because a listener only sees a decision after it is made; use
@@ -1,5 +1,5 @@
1
1
  import { c as isActionRequired, l as isRetryable, n as CliError, t as CLI_ERRORS_URL } from "./errors-DgLOqc6j.js";
2
- import { t as DOCS_BASE } from "./manifest-Bu9gUrI0.js";
2
+ import { t as DOCS_BASE } from "./manifest-DkHIGPoY.js";
3
3
  import { s as cliVersion } from "./version-D-jWyJb9.js";
4
4
  import { createHash } from "node:crypto";
5
5
  // src/cli/core/consent.ts
@@ -1,14 +1,14 @@
1
1
  import { l as scopeChain, s as resolveScope } from "./scopes-B-KX9EI8.js";
2
2
  import { r as findRole } from "./vocabulary-CE2k7s1a.js";
3
- import { S as scopeTable, _ as memberRoleOf, m as memberForTable, x as scopeSources } from "./names-DBxKx2bz.js";
3
+ import { S as scopeTable, _ as memberRoleOf, m as memberForTable, x as scopeSources } from "./names-DwGleRKB.js";
4
4
  import { C as tenantTypeOf, a as kindFilterSql, f as subjectIdSql, r as globalKindFilterSql, s as memberVia } from "./subject-B7p94Y0s.js";
5
5
  import { i as qualifySqlTable } from "./sql-T4GaBh9X.js";
6
6
  import { l as roleColumn } from "./sources-C6Id63F8.js";
7
7
  import { i as configError } from "./errors-DgLOqc6j.js";
8
8
  import { a as quoteIdent, i as qualified, n as declaredArray, o as quoteLiteral, s as quoteQualified } from "./quote-LNaBdCGA.js";
9
9
  import { s as signedIn, t as CUSTOM_ROLES } from "./shared-DnVY767H.js";
10
- import { A as membershipRows, D as globalRoleRows, I as hasCustomRoleChecksFor, T as sourcesKeep, V as storedTenant, d as disabledColumn, h as memberColumn, j as roleRows, l as claimKeptLines, n as delegatedGlobalSql, o as interactiveSessionSql, x as sourceFilters } from "./interactive-only-Bbq9e61G.js";
11
- import { _ as sourceTransferTriggerSql, b as ASSIGNMENTS, g as sourceRowsSql, h as sourceHoldersTriggerSql, m as pairsSql, p as holderSources, v as holdersTriggerSql, x as OWNERSHIP, y as transferTriggerSql } from "./tables-DrrGtayG.js";
10
+ import { A as membershipRows, D as globalRoleRows, I as hasCustomRoleChecksFor, T as sourcesKeep, V as storedTenant, d as disabledColumn, h as memberColumn, j as roleRows, l as claimKeptLines, n as delegatedGlobalSql, o as interactiveSessionSql, x as sourceFilters } from "./interactive-only-CylKSukS.js";
11
+ import { _ as sourceTransferTriggerSql, b as ASSIGNMENTS, g as sourceRowsSql, h as sourceHoldersTriggerSql, m as pairsSql, p as holderSources, v as holdersTriggerSql, x as OWNERSHIP, y as transferTriggerSql } from "./tables-BwQvlpS4.js";
12
12
  // src/cli/rls/assignments.ts
13
13
  /**
14
14
  * The client roles whose writes the assignment triggers check; any other role
@@ -1,6 +1,6 @@
1
- import { o as PermDockOptions } from "../permdock-DkvkGVF0.js";
1
+ import { o as PermDockOptions } from "../permdock-CHU1LZGq.js";
2
2
  import { D as Policy, N as PolicyVocabulary, Or as Principal, Y as DecisionProvider } from "../policy-types-DuM3k5Ao.js";
3
- import { a as RelationMap, c as RemotePdpEndpoints, d as SpiceDbCheck, f as SpiceDbOptions, i as PdpPermDock, l as RemotePdpMapping, n as OpenFgaTuple, o as RemotePdpAuth, r as PdpFactory, s as RemotePdpCache, t as OpenFgaOptions, u as RemotePdpOptions } from "../types-CBUYbPwl.js";
3
+ import { a as RelationMap, c as RemotePdpEndpoints, d as SpiceDbCheck, f as SpiceDbOptions, i as PdpPermDock, l as RemotePdpMapping, n as OpenFgaTuple, o as RemotePdpAuth, r as PdpFactory, s as RemotePdpCache, t as OpenFgaOptions, u as RemotePdpOptions } from "../types-C8sDUhaF.js";
4
4
  /**
5
5
  * The PDP-aware instance, built synchronously like core `getPermDockSync`; use
6
6
  * `getPermDock` for asynchronous inputs.
package/dist/pdp/index.js CHANGED
@@ -4,7 +4,7 @@ import { n as PermDockValidationError } from "../validation-error-CgDOA6VS.js";
4
4
  import { a as deniedMessage, i as approvalMessage, n as PermDockDeniedError, t as PermDockApprovalRequiredError } from "../errors-DOSkVeTC.js";
5
5
  import { n as freezeDeep } from "../freeze-DGfJq_j2.js";
6
6
  import { n as internalsOf, t as attachInternals } from "../internals-D58TnmDB.js";
7
- import { n as getPermDockSync$1, t as getPermDock$1 } from "../permdock-JM9TKevZ.js";
7
+ import { n as getPermDockSync$1, t as getPermDock$1 } from "../permdock-DZmr2kJw.js";
8
8
  import { a as getResource, c as listPermissions } from "../permission-registry-DstT40VS.js";
9
9
  import { a as postJson, c as ttlMs, i as joinUrl, n as denied, o as resourceIdOf, r as granted, s as ttlCache, t as cacheKey } from "../shared-BOsJIQf4.js";
10
10
  import { n as toWireDelegation } from "../wire-delegation-DC5Cyec4.js";
@@ -759,9 +759,11 @@ type PermDock<V extends PolicyVocabulary = PolicyVocabulary> = {
759
759
  /**
760
760
  * The same subject, tenant, team, actor, delegation, sink and limits with
761
761
  * other sources: `customRoles`, `approvalPolicies` or `relations`. The
762
- * sources it names are read again for the subject's tenants; the others keep
763
- * what this instance loaded. Always a promise, since the sources it names may
764
- * answer asynchronously.
762
+ * sources it names are read again for the subject's tenants, with this
763
+ * instance's `SourceMemo` as `context.memo`, so a read this instance already
764
+ * made under the same memo key is answered from it; the others keep what this
765
+ * instance loaded. Always a promise, since the sources it names may answer
766
+ * asynchronously.
765
767
  */
766
768
  readonly derive: (options: DeriveOptions) => Promise<PermDock<V>>;
767
769
  };
@@ -1001,7 +1001,7 @@ function deriveEnv(policy, subject, base, relationCache, options) {
1001
1001
  const auth = [];
1002
1002
  const named = options.customRoles === void 0 ? void 0 : roleSourceFor(options.customRoles, subject, auth);
1003
1003
  const roleSource = options.customRoles === void 0 ? base.roleSource : named;
1004
- const roles = options.customRoles === void 0 ? base.customRoles : customRolesFor(named, tenants, auth, subject.principal === null ? void 0 : subject.principal.roles ?? [], (tenant) => heldRoleNamesIn(subject.principal, scopes, tenant));
1004
+ const roles = options.customRoles === void 0 ? base.customRoles : customRolesFor(named, tenants, auth, subject.principal === null ? void 0 : subject.principal.roles ?? [], (tenant) => heldRoleNamesIn(subject.principal, scopes, tenant), base.memo);
1005
1005
  const names = options.customRoles === void 0 ? base.assignable : assignableNamesFor(named, tenants, auth);
1006
1006
  const approvals = options.approvalPolicies === void 0 ? base.approvalPolicies : options.approvalPolicies.load(policy, tenants, auth);
1007
1007
  const envWith = (loadedRoles, loadedNames, loadedApprovals) => compact({
@@ -1505,6 +1505,7 @@ function instantiate(codePolicy, subject, options, auth, memo) {
1505
1505
  memberships: options.memberships === void 0 ? void 0 : asMembershipSource(options.memberships),
1506
1506
  principals: options.principals,
1507
1507
  settings: options.settings,
1508
+ memo,
1508
1509
  targets: (principal, tenant) => getPermDock(codePolicy, {
1509
1510
  principal,
1510
1511
  context: {}
@@ -1,4 +1,4 @@
1
- import { c as crud } from "./src-BXDohWNO.js";
1
+ import { c as crud } from "./src-CYKqpYUM.js";
2
2
  import { t as definePermissions } from "./permissions-DJ_QV9L7.js";
3
3
  import { n as defineRoles, t as definePlans } from "./vocabulary-CE2k7s1a.js";
4
4
  import { v as resource } from "./permission-registry-DstT40VS.js";
@@ -2,8 +2,8 @@ import { t as canonicalJson } from "./canonical-json-BibZkXtE.js";
2
2
  import { r as planFiles, t as applyFiles } from "./files-DuV7wRim.js";
3
3
  import { s as writeFileEnsuringDir } from "./files-DAR51W3J.js";
4
4
  import { n as CliError } from "./errors-DgLOqc6j.js";
5
- import { a as ownedObjects, i as inReservedDir, n as foreignSchemaFiles, o as shownKey, s as withoutOwned, t as policyModel } from "./model-BYCtXS_g.js";
6
- import { n as resolveSchemas } from "./supabase-schemas-CVhpyYB6.js";
5
+ import { a as ownedObjects, i as inReservedDir, n as foreignSchemaFiles, o as shownKey, s as withoutOwned, t as policyModel } from "./model-r7X_HXyS.js";
6
+ import { n as resolveSchemas } from "./supabase-schemas-DA28GP4N.js";
7
7
  import { i as orderPlugins } from "./plugin-MQVfUBUS.js";
8
8
  import { existsSync, readFileSync, readdirSync, statSync } from "node:fs";
9
9
  import { join, relative, resolve } from "node:path";
@@ -18,7 +18,7 @@ const policyBundle = defineLeaf({
18
18
  },
19
19
  async run(ctx, { flags }) {
20
20
  try {
21
- const { runPolicyBundle } = await import("./policy-bundle-DC_xq2R5.js");
21
+ const { runPolicyBundle } = await import("./policy-bundle-JU4-AFJM.js");
22
22
  const policy = await requirePolicy(ctx.cwd, given(flags.policy) ?? ctx.config.policy, "set policy in permdock.config.ts or pass --policy");
23
23
  return runPolicyBundle({
24
24
  cwd: ctx.cwd,
@@ -1,7 +1,7 @@
1
1
  import { n as fileSummary, t as applyFiles } from "./files-DuV7wRim.js";
2
- import { i as buildContext, n as isRefusal, o as inheritTargets, t as generateOptions } from "./generate-options-O3mVjjcG.js";
3
- import { r as compileGrants } from "./compile-D-BULiHE.js";
4
- import { X as policyBundle, Y as bundleLoaderSql, i as tableNames, q as POLICY_BUNDLE_FORMAT } from "./tables-DrrGtayG.js";
2
+ import { i as buildContext, n as isRefusal, o as inheritTargets, t as generateOptions } from "./generate-options-BFAvlJKQ.js";
3
+ import { r as compileGrants } from "./compile-EtZv2wc0.js";
4
+ import { X as policyBundle, Y as bundleLoaderSql, i as tableNames, q as POLICY_BUNDLE_FORMAT } from "./tables-BwQvlpS4.js";
5
5
  import { existsSync, readFileSync } from "node:fs";
6
6
  import { resolve } from "node:path";
7
7
  // src/cli/policy-bundle.ts
@@ -24,7 +24,7 @@ const verify = defineLeaf({
24
24
  const db = await dbUrl(ctx, flags, { required: true });
25
25
  const fixtures = given(flags.fixtures);
26
26
  const from = given(flags.policy);
27
- const { runPowerSync } = await import("./powersync-BlfO3_jN.js");
27
+ const { runPowerSync } = await import("./powersync-D9ZLDzyv.js");
28
28
  return runPowerSync({
29
29
  cwd: ctx.cwd,
30
30
  config: ctx.config,
@@ -1 +1 @@
1
- export { i as powersyncFiles, r as publicationPath, t as runPowerSync } from "./powersync-CiQ97gzz.js";
1
+ export { i as powersyncFiles, r as publicationPath, t as runPowerSync } from "./powersync-cG4lxrzQ.js";
@@ -1,15 +1,15 @@
1
1
  import { c as isConditionDate, l as isConditionRef, o as hasConditionOp } from "./refs-Cix9Zjis.js";
2
2
  import { n as findPermission } from "./permission-registry-DstT40VS.js";
3
- import { t as getPermDock } from "./permdock-JM9TKevZ.js";
4
- import { A as memoryCustomRoleSource, _ as localSnapshotManifest } from "./src-BXDohWNO.js";
3
+ import { t as getPermDock } from "./permdock-DZmr2kJw.js";
4
+ import { A as memoryCustomRoleSource, _ as localSnapshotManifest } from "./src-CYKqpYUM.js";
5
5
  import { f as usageResult } from "./errors-DgLOqc6j.js";
6
6
  import { t as applyFiles } from "./files-DuV7wRim.js";
7
7
  import { i as fileDrift } from "./output-files-8lfALMSU.js";
8
8
  import { n as fixtureSubject, r as loadFixtures, t as fixtureRow } from "./fixtures-3aUUP6Nx.js";
9
9
  import { r as pgConnector } from "./pg-DmS5ITHu.js";
10
10
  import { c as requirePolicy } from "./load-m7jmit3y.js";
11
- import { t as canFixture } from "./verify-DT9WS_Gm.js";
12
- import { d as andConditions, l as collectGrants, o as assignableRoles, p as contextRefs, u as roleNames } from "./rbac-DbyaaNLa.js";
11
+ import { t as canFixture } from "./verify-cw6SFoQE.js";
12
+ import { d as andConditions, l as collectGrants, o as assignableRoles, p as contextRefs, u as roleNames } from "./rbac-BOVyTCI6.js";
13
13
  import { a as quoteIdent, s as quoteQualified } from "./quote-LNaBdCGA.js";
14
14
  import { a as scopeMembershipTable, i as scopeColumn } from "./compile-BUKXrueE.js";
15
15
  import { r as isRecord, t as compact } from "./compact-C4LFuqbW.js";
@@ -18,15 +18,15 @@ import { d as keptKeys, t as AUTHZ_VERSION_TABLE } from "./sources-C6Id63F8.js";
18
18
  import { a as customRolesOn, t as CUSTOM_ROLES } from "./shared-DnVY767H.js";
19
19
  import { t as membershipSourcesOf } from "./sources-BbSUNmFX.js";
20
20
  import { s as quoteSqlLiteral, t as SQL_IDENT } from "./sql-T4GaBh9X.js";
21
- import { t as ownershipRules } from "./ownership-Bmt-z0rF.js";
22
- import { a as tableFor } from "./compile-D-BULiHE.js";
23
- import { i as tableNames, r as tableNameOf } from "./tables-DrrGtayG.js";
21
+ import { t as ownershipRules } from "./ownership-BvKT4DBj.js";
22
+ import { a as tableFor } from "./compile-EtZv2wc0.js";
23
+ import { i as tableNames, r as tableNameOf } from "./tables-BwQvlpS4.js";
24
24
  import { l as policyLevels } from "./policy-CZBJDcTx.js";
25
25
  import { p as scopeField } from "./tenancy-B5Xxt9Sc.js";
26
26
  import { t as requiresApproval } from "./approval-required-B-R4Yw3J.js";
27
27
  import { o as sqlFiles } from "./files-DAR51W3J.js";
28
28
  import { o as parseSqlLenient } from "./ast-Dnm2TOHN.js";
29
- import { n as resolveSchemas } from "./supabase-schemas-CVhpyYB6.js";
29
+ import { n as resolveSchemas } from "./supabase-schemas-DA28GP4N.js";
30
30
  import { existsSync, readFileSync } from "node:fs";
31
31
  import { join, resolve } from "node:path";
32
32
  // src/cli/powersync/claims.ts
@@ -1,6 +1,6 @@
1
1
  import { Ar as Subject, Fr as Condition, qt as Instant } from "../policy-types-DuM3k5Ao.js";
2
2
  import { n as RowCheck, t as WithSubjectOptions } from "../subject-settings-C9F1sU1d.js";
3
- import { p as WhereResult } from "../permdock-DkvkGVF0.js";
3
+ import { p as WhereResult } from "../permdock-CHU1LZGq.js";
4
4
  import { r as RelationsMapping } from "../graph-sql-Ds3nbevr.js";
5
5
  /**
6
6
  * A model's non-nullable scalar fields and its scalar list fields, by Prisma
@@ -1,10 +1,10 @@
1
1
  import { Dr as Membership, N as PolicyVocabulary, ir as Decision } from "./policy-types-DuM3k5Ao.js";
2
2
  import { r as Role, w as Permission } from "./vocabulary-DHfKPIC5.js";
3
- import { d as UncheckedData, s as RowData } from "./permdock-DkvkGVF0.js";
3
+ import { d as UncheckedData, s as RowData } from "./permdock-CHU1LZGq.js";
4
4
  import { r as DescribeOptions, t as DecisionDescription } from "./describe-DEoWvk00.js";
5
- import { _ as SubjectView, a as ClientPermDock, b as ProtectedAction, c as GateMode, d as PermissionSet, f as PermissionState, g as RolesOptions, l as GateView, p as ProtectedActionHandle, r as ApprovalHandle, s as FilterResult, u as PermissionOutcome, v as TenantView } from "./store-core-aluQ3R1M.js";
5
+ import { _ as SubjectView, a as ClientPermDock, b as ProtectedAction, c as GateMode, d as PermissionSet, f as PermissionState, g as RolesOptions, l as GateView, p as ProtectedActionHandle, r as ApprovalHandle, s as FilterResult, u as PermissionOutcome, v as TenantView } from "./store-core-D5-cqb6z.js";
6
6
  import { r as RefreshTrigger } from "./refresh-on-C1zIMtJr.js";
7
- import { r as ProtectedProps } from "./types-BzsplNgO.js";
7
+ import { r as ProtectedProps } from "./types-iwSmOTcK.js";
8
8
  import { ReactNode } from "react";
9
9
  /**
10
10
  * The instance with every check. It loads the evaluator on first use and
@@ -1,4 +1,4 @@
1
- import { n as PermDockProviderProps } from "./types-BzsplNgO.js";
1
+ import { n as PermDockProviderProps } from "./types-iwSmOTcK.js";
2
2
  import { ReactElement } from "react";
3
3
  declare function PermDockProvider(props: PermDockProviderProps): ReactElement;
4
4
  export { PermDockProvider as t };
@@ -1,8 +1,8 @@
1
1
  import { t as parseCatalog } from "./parse-CUqZ_lLC.js";
2
2
  import { n as freezeDeep } from "./freeze-DGfJq_j2.js";
3
- import { a as delegatedScopeMap } from "./permdock-JM9TKevZ.js";
3
+ import { a as delegatedScopeMap } from "./permdock-DZmr2kJw.js";
4
4
  import { i as qualifySqlTable, l as sqlIdent, s as quoteSqlLiteral } from "./sql-T4GaBh9X.js";
5
- import { n as parseSupabaseManifest, t as hasTokenHook } from "./manifest-CIWOmdlP.js";
5
+ import { n as parseSupabaseManifest, t as hasTokenHook } from "./manifest-teSfgeqF.js";
6
6
  import { y as parseAnswer } from "./permission-registry-DstT40VS.js";
7
7
  import { o as holder, r as approverLeaves } from "./approvers-BkY_ZfWl.js";
8
8
  import { n as asApprover } from "./approval-normalize-C6je8vWN.js";
@@ -149,6 +149,11 @@ function actionKeysOf(catalog, problems) {
149
149
  // src/better-supabase/approvers.ts
150
150
  /** `rls.approvals`' approver check, executable by `authenticated`. */
151
151
  const IS_APPROVER = "permdock_is_approver";
152
+ /**
153
+ * `rls.approvals`' approver check as a set, for better-supabase's
154
+ * `isApproverMany`.
155
+ */
156
+ const APPROVER_REQUEST_IDS = "permdock_approver_request_ids";
152
157
  /** The manager walk `rls.approvals.managers` writes. */
153
158
  const MANAGES = "permdock_manages";
154
159
  /**
@@ -177,6 +182,7 @@ function isApproverTemplate(input) {
177
182
  if (current && input.covers !== true) return { problems: [`requestApprovers needs the five-argument ${IS_APPROVER}, which \`permdock rls generate\` writes with rls.approvals.delegations or rls.approvals.managers. Set one, run it, then \`permdock supabase inspect --out\`.`] };
178
183
  const passed = current ? ", ({approvers})::jsonb" : "";
179
184
  const branches = [];
185
+ const kinds = {};
180
186
  for (const [kind, given] of Object.entries(input.approvers)) {
181
187
  if (kind === "") {
182
188
  problems.push("approvers has an empty kind, which no request has.");
@@ -191,6 +197,7 @@ function isApproverTemplate(input) {
191
197
  } else if (leaf.kind !== "permission") problems.push(`The ${kind} approvers name a ${leaf.kind} approver, which ${IS_APPROVER} cannot check in SQL, so it matches nobody. Use user(), holder(), manager() or anyOf().`);
192
198
  else if (keys !== void 0 && !keys.has(leaf.permission)) problems.push(`The ${kind} approver permission ${leaf.permission} is not in the catalog. Run \`permdock catalog\` after adding it to the policy.`);
193
199
  }
200
+ kinds[kind] = approvers;
194
201
  const json = `${quoteSqlLiteral(JSON.stringify(approvers))}::jsonb`;
195
202
  branches.push(input.covers === true ? `when ${quoteSqlLiteral(kind)} then ${fn}(${json}, ({tenant})::text, ({requester})::text, ${quoteSqlLiteral(resourceOf(kind))}${passed})` : `when ${quoteSqlLiteral(kind)} then ${fn}(${json}, ({tenant})::text)`);
196
203
  }
@@ -199,6 +206,16 @@ function isApproverTemplate(input) {
199
206
  return { problems };
200
207
  }
201
208
  if (!input.rootTenant) problems.push(`The tenant scope "${input.tenantScope}" is not a root scope, and ${IS_APPROVER} checks holder() approvers at the root scope, so they match nobody.`);
209
+ if (input.many === null) problems.push(`isApproverMany needs ${input.schema}.${APPROVER_REQUEST_IDS}, which \`permdock rls generate\` writes with rls.approvals. Run it, then \`permdock supabase inspect --out\`.`);
210
+ const manyFn = `${sqlIdent(input.schema)}.${sqlIdent(APPROVER_REQUEST_IDS)}`;
211
+ const many = input.many === true ? {
212
+ template: `${manyFn}({requests}, ${quoteSqlLiteral(JSON.stringify(kinds))}::jsonb, ${current ? "true" : "false"})`,
213
+ requires: {
214
+ function: manyFn,
215
+ args: "jsonb, jsonb, boolean",
216
+ role: "postgres"
217
+ }
218
+ } : void 0;
202
219
  const otherwise = current ? `${fn}(null::jsonb, ({tenant})::text, ({requester})::text, pg_catalog.split_part({kind}, '.', 1)${passed})` : "false";
203
220
  return {
204
221
  template: branches.length === 0 ? otherwise : `case {kind} ${branches.join(" ")} else ${otherwise} end`,
@@ -207,6 +224,7 @@ function isApproverTemplate(input) {
207
224
  args: current ? "jsonb, text, text, text, jsonb" : input.covers === true ? "jsonb, text, text, text" : "jsonb, text",
208
225
  role: "postgres"
209
226
  },
227
+ ...many === void 0 ? {} : { many },
210
228
  problems
211
229
  };
212
230
  }
@@ -510,7 +528,7 @@ function providerFunctions(input) {
510
528
  });
511
529
  }
512
530
  }
513
- const isApprover = isApproverOf(input, helpers, requires);
531
+ const { isApprover, isApproverMany } = isApproverOf(input, helpers, requires) ?? {};
514
532
  const call = (name, sql, role, args) => {
515
533
  const fn = `${schema}.${sqlIdent(name)}`;
516
534
  requires.push({
@@ -567,6 +585,7 @@ function providerFunctions(input) {
567
585
  ...portal.portalParties === void 0 ? {} : { portalParties: portal.portalParties },
568
586
  ...actorMayWrite === void 0 ? {} : { actorMayWrite },
569
587
  ...isApprover === void 0 ? {} : { isApprover },
588
+ ...isApproverMany === void 0 ? {} : { isApproverMany },
570
589
  ...permitted === void 0 ? {} : { permitted },
571
590
  ...canIn === void 0 ? {} : { canIn },
572
591
  ...subject === void 0 ? {} : { subject },
@@ -582,7 +601,8 @@ function providerFunctions(input) {
582
601
  }
583
602
  /**
584
603
  * `isApprover` from `approvers` (with `approver` as its `'ai-tool'` entry) or
585
- * `requestApprovers`, over `permdock_is_approver`.
604
+ * `requestApprovers`, over `permdock_is_approver`, and with `isApproverMany`
605
+ * its set form over `permdock_approver_request_ids`.
586
606
  */
587
607
  function isApproverOf(input, helpers, requires) {
588
608
  const { options } = input;
@@ -599,13 +619,20 @@ function isApproverOf(input, helpers, requires) {
599
619
  listed: helpers.has(IS_APPROVER),
600
620
  covers: /\bp_requester\b/u.test(helpers.get("permdock_is_approver")?.args ?? ""),
601
621
  managers: helpers.has(MANAGES),
622
+ ...options.isApproverMany === true ? { many: helpers.has("permdock_approver_request_ids") ? true : null } : {},
602
623
  tenantScope: input.tenantScope,
603
624
  rootTenant: input.rootTenant,
604
625
  catalog: input.catalog
605
626
  });
606
627
  input.problems.push(...built.problems);
607
628
  if (built.requires !== void 0) requires.push(built.requires);
608
- return built.template;
629
+ if (built.template === void 0) return;
630
+ if (built.many === void 0) return { isApprover: built.template };
631
+ requires.push(built.many.requires);
632
+ return {
633
+ isApprover: built.template,
634
+ isApproverMany: built.many.template
635
+ };
609
636
  }
610
637
  // src/better-supabase/provider-hook.ts
611
638
  const TEAM_IDS_TRUNCATED = "team_ids_truncated";
@@ -1,16 +1,16 @@
1
1
  import { n as CliError } from "./errors-DgLOqc6j.js";
2
2
  import { i as refuseDirty, t as applyFiles } from "./files-DuV7wRim.js";
3
3
  import { a as rel } from "./files-DAR51W3J.js";
4
- import { t as genFiles } from "./gen-M_5UU5Ck.js";
5
- import { t as projectContext } from "./context-rioF4fQl.js";
6
- import { t as emitPluginFiles } from "./pipeline-BAGSNnct.js";
4
+ import { t as genFiles } from "./gen-DlJK73v7.js";
5
+ import { t as projectContext } from "./context-CFPsmfPl.js";
6
+ import { t as emitPluginFiles } from "./pipeline-BMbLI2Sj.js";
7
7
  import { n as isPermDockPlugin } from "./plugin-MQVfUBUS.js";
8
8
  import { S as restatedFacts, c as withDerivedDefaults, o as readParsedConfig, t as configFileIn } from "./config-Dan6vcvj.js";
9
9
  import { c as requirePolicy } from "./load-m7jmit3y.js";
10
10
  import { n as restatedDefaults, r as withoutPath } from "./resolve-config-Cu_mE2wt.js";
11
11
  import { n as writtenPaths, t as configProperty } from "./config-paths-CQvGng3k.js";
12
12
  import { r as removeProperty, t as applyEditsStrict } from "./edits-CqU8s2GC.js";
13
- import { n as commandFor } from "./compile-D-BULiHE.js";
13
+ import { n as commandFor } from "./compile-EtZv2wc0.js";
14
14
  import { r as schemaTables, t as restatedSchemaDefaults } from "./schema-tables-Ba9LE_XB.js";
15
15
  import { readFileSync } from "node:fs";
16
16
  // src/cli/codemod/prune-config.ts
@@ -1,10 +1,10 @@
1
1
  import { t as parseCatalog } from "./parse-CUqZ_lLC.js";
2
2
  import { t as catalogFingerprint } from "./catalog-fingerprint-DAWZARy6.js";
3
- import { n as parseSupabaseManifest } from "./manifest-CIWOmdlP.js";
4
- import { o as formatCatalogJson } from "./catalog-doc-D4g3nyFB.js";
3
+ import { n as parseSupabaseManifest } from "./manifest-teSfgeqF.js";
4
+ import { o as formatCatalogJson } from "./catalog-doc-BX97oFAn.js";
5
5
  import { t as catalogPath } from "./catalog-path-bG0XxHMu.js";
6
6
  import { a as describeError } from "./errors-DgLOqc6j.js";
7
- import { o as nonEmptyOr } from "./output-DIjUJioq.js";
7
+ import { o as nonEmptyOr } from "./output-DNbj0_Yi.js";
8
8
  import { s as cliVersion } from "./version-D-jWyJb9.js";
9
9
  import { s as writeFileEnsuringDir } from "./files-DAR51W3J.js";
10
10
  import { n as formatManifestJson } from "./manifest-json-DMaBWmcG.js";
@@ -0,0 +1 @@
1
+ export { n as runCloudPull } from "./pull-4Cyo0uTS.js";
@@ -3,8 +3,8 @@ import { r as pushedPolicy } from "./pushed-policy-dm_hFstN.js";
3
3
  import { r as isRecord } from "./compact-C4LFuqbW.js";
4
4
  import { n as PermDockValidationError } from "./validation-error-CgDOA6VS.js";
5
5
  import { t as catalogFingerprint } from "./catalog-fingerprint-DAWZARy6.js";
6
- import { n as parseSupabaseManifest } from "./manifest-CIWOmdlP.js";
7
- import { n as runCatalog } from "./catalog-BExjL94D.js";
6
+ import { n as parseSupabaseManifest } from "./manifest-teSfgeqF.js";
7
+ import { n as runCatalog } from "./catalog-SnaPhbZ1.js";
8
8
  import { a as describeError, n as CliError } from "./errors-DgLOqc6j.js";
9
9
  import { n as httpRequest, t as authFailure } from "./http-BbX_Ou3_.js";
10
10
  import { s as cliVersion } from "./version-D-jWyJb9.js";
@@ -1,4 +1,4 @@
1
- import { n as authorizeSql } from "./supabase-ByhSqBDB.js";
1
+ import { n as authorizeSql } from "./supabase-NpHqrRXC.js";
2
2
  import { i as configError } from "./errors-DgLOqc6j.js";
3
3
  import { r as relationCondition, t as inheritCondition } from "./grantee-conditions-Dob6QQAc.js";
4
4
  import { c as rootScope, d as scopeList, s as resolveScope } from "./scopes-B-KX9EI8.js";
@@ -10,9 +10,9 @@ import { n as isForbiddenKey } from "./paths-CeS_gpHf.js";
10
10
  import { i as qualifySqlTable } from "./sql-T4GaBh9X.js";
11
11
  import { u as isoAt } from "./time-r0CKBm57.js";
12
12
  import { u as isSqlFunctionField } from "./refs-Cix9Zjis.js";
13
- import { K as activeUserSql, U as activeInstancesSql, W as activeMembershipSql, c as memoUserSql, g as memoHitList, y as memoizes } from "./interactive-only-Bbq9e61G.js";
13
+ import { K as activeUserSql, U as activeInstancesSql, W as activeMembershipSql, c as memoUserSql, g as memoHitList, y as memoizes } from "./interactive-only-CylKSukS.js";
14
14
  import { S as sqlType, a as kindFilterSql, b as idTypeOf, c as roleKindSql, d as subjectClaimSql, f as subjectIdSql, h as CLAIM, i as keyTenantSql, o as liveSessionSql, p as tenantClaimSql, s as memberVia, u as subjectClaimJsonSql } from "./subject-B7p94Y0s.js";
15
- import { S as scopeTable, _ as memberRoleOf, a as graphSqlText, b as restrictedHelper, d as linkHelper, h as memberIdsHelper, l as inheritedRowsHelper, n as CLOSURE, r as graphHelper, x as scopeSources } from "./names-DBxKx2bz.js";
15
+ import { S as scopeTable, _ as memberRoleOf, a as graphSqlText, b as restrictedHelper, d as linkHelper, h as memberIdsHelper, l as inheritedRowsHelper, n as CLOSURE, r as graphHelper, x as scopeSources } from "./names-DwGleRKB.js";
16
16
  import { a as quoteIdent, c as quoteTable, i as qualified, l as textArrayLiteral, o as quoteLiteral, r as helperSchema, s as quoteQualified } from "./quote-LNaBdCGA.js";
17
17
  // src/cli/sql/conditions.ts
18
18
  const MAX_CLAIM_DEPTH = 8;
@@ -2,9 +2,9 @@ import { i as describe } from "../describe-DEoWvk00.js";
2
2
  import { c as requiredPlans } from "../errors-BliKrfmP.js";
3
3
  import { t as approvalHeaders } from "../headers-D1oRr-js.js";
4
4
  import { a as broadcastChannelRefresh, c as visibilityRefresh, i as authzChangeRefresh, n as EventSourceRefreshOptions, o as eventSourceRefresh, r as RefreshTrigger, s as focusRefresh, t as AuthzChangeRefresh } from "../refresh-on-C1zIMtJr.js";
5
- import { _ as useTenant, a as useAssignableRoles, c as useFilter, d as usePermDock, f as usePermission, g as useSubject, h as useRoles, i as useAssignablePermissions, l as useGate, m as useRefreshOn, n as Protected, o as useDecision, p as usePermissions, r as useApproval, s as useDescribe, t as useProtectedAction, u as useMemberships } from "../protected-action-gBxeetqY.js";
5
+ import { _ as useTenant, a as useAssignableRoles, c as useFilter, d as usePermDock, f as usePermission, g as useSubject, h as useRoles, i as useAssignablePermissions, l as useGate, m as useRefreshOn, n as Protected, o as useDecision, p as usePermissions, r as useApproval, s as useDescribe, t as useProtectedAction, u as useMemberships } from "../protected-action-Dux5RJbA.js";
6
6
  import { t as onlineRefresh } from "../refresh-online-vtUfV6dk.js";
7
- import { t as PermDockProvider } from "../provider-Clt2095H.js";
8
- import { n as PermDockProviderProps, r as ProtectedProps, t as PermDockDefaults } from "../types-BzsplNgO.js";
9
- import { _ as SubjectView, a as ClientPermDock, b as ProtectedAction, c as GateMode, d as PermissionSet, f as PermissionState, g as RolesOptions, i as ApprovalState, l as GateView, m as ProtectedActionView, o as ClientStatus, p as ProtectedActionHandle, r as ApprovalHandle, s as FilterResult, u as PermissionOutcome, v as TenantView, y as ActionResult } from "../store-core-aluQ3R1M.js";
7
+ import { t as PermDockProvider } from "../provider-BSHAIpMK.js";
8
+ import { n as PermDockProviderProps, r as ProtectedProps, t as PermDockDefaults } from "../types-iwSmOTcK.js";
9
+ import { _ as SubjectView, a as ClientPermDock, b as ProtectedAction, c as GateMode, d as PermissionSet, f as PermissionState, g as RolesOptions, i as ApprovalState, l as GateView, m as ProtectedActionView, o as ClientStatus, p as ProtectedActionHandle, r as ApprovalHandle, s as FilterResult, u as PermissionOutcome, v as TenantView, y as ActionResult } from "../store-core-D5-cqb6z.js";
10
10
  export { type ActionResult, type ApprovalHandle, type ApprovalState, type AuthzChangeRefresh, type ClientPermDock, type ClientStatus, type EventSourceRefreshOptions, type FilterResult, type GateMode, type GateView, type PermDockDefaults, PermDockProvider, type PermDockProviderProps, type PermissionOutcome, type PermissionSet, type PermissionState, Protected, type ProtectedAction, type ProtectedActionHandle, type ProtectedActionView, type ProtectedProps, type RefreshTrigger, type RolesOptions, type SubjectView, type TenantView, approvalHeaders, authzChangeRefresh, broadcastChannelRefresh, describe, eventSourceRefresh, focusRefresh, onlineRefresh, requiredPlans, useApproval, useAssignablePermissions, useAssignableRoles, useDecision, useDescribe, useFilter, useGate, useMemberships, usePermDock, usePermission, usePermissions, useProtectedAction, useRefreshOn, useRoles, useSubject, useTenant, visibilityRefresh };