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.
Files changed (323) hide show
  1. package/dist/a2a/index.d.ts +7 -5
  2. package/dist/a2a/index.js +14 -21
  3. package/dist/ai-sdk/index.d.ts +18 -6
  4. package/dist/ai-sdk/index.js +8 -5
  5. package/dist/app-data-CV8pqqMi.js +59 -0
  6. package/dist/approvals/index.d.ts +2 -2
  7. package/dist/approvals/index.js +3 -3
  8. package/dist/{approvals-DbYAuNkG.js → approvals-DZL76lKW.js} +35 -19
  9. package/dist/{approvers-DT4AVyIg.js → approvers-CqPOLD-o.js} +1 -1
  10. package/dist/{arazzo-BAgw9ap6.js → arazzo-C4BcskbX.js} +6 -5
  11. package/dist/{arazzo-C9chp3ST.js → arazzo-CD8d0WLb.js} +2 -2
  12. package/dist/authzen/index.d.ts +3 -3
  13. package/dist/authzen/index.js +161 -23
  14. package/dist/better-auth/index.d.ts +2 -2
  15. package/dist/better-auth/index.js +6 -19
  16. package/dist/better-supabase/index.d.ts +112 -87
  17. package/dist/better-supabase/index.js +257 -156
  18. package/dist/{bind-C_ob3LKa.d.ts → bind-BzqG8SMb.d.ts} +16 -5
  19. package/dist/{bind-CuzGytRf.js → bind-kk-uyCwH.js} +14 -6
  20. package/dist/build-instance-DIIV9DbC.js +51 -0
  21. package/dist/{canonical-json-DemiK4Vp.js → canonical-json-CFKyFOke.js} +1 -3
  22. package/dist/{capability-2kYTMWDv.d.ts → capability-CksyCWDH.d.ts} +2 -2
  23. package/dist/{capability-4qPdO9gk.js → capability-txATtKV4.js} +3 -2
  24. package/dist/catalog/index.d.ts +1 -1
  25. package/dist/catalog/index.js +1 -1
  26. package/dist/catalog-6yWAX6Ps.js +2 -0
  27. package/dist/{catalog-CYj-mX2O.js → catalog-WHG4kBq7.js} +2 -2
  28. package/dist/{catalog-doc-DdGm82XT.js → catalog-doc-DWtg0gGR.js} +17 -10
  29. package/dist/{catalog-DWF5cYqB.js → catalog-tZUyOfOv.js} +4 -4
  30. package/dist/claude-agent/index.d.ts +4 -4
  31. package/dist/claude-agent/index.js +4 -5
  32. package/dist/clerk/index.d.ts +3 -3
  33. package/dist/clerk/index.js +8 -33
  34. package/dist/cli/bin.js +1 -1
  35. package/dist/cli/index.d.ts +3 -3
  36. package/dist/cli/index.js +3 -3
  37. package/dist/cloud/index.d.ts +4 -4
  38. package/dist/cloud/index.js +9 -15
  39. package/dist/{cloud-CfwZ39Rl.js → cloud-C7bSDgX4.js} +2 -2
  40. package/dist/{cloud-DWLXO2af.js → cloud-PeBN3IEn.js} +5 -5
  41. package/dist/{collect-DSTE3ml9.js → collect-2SrB7lfk.js} +6 -8
  42. package/dist/collect-Bw2Jdq1q.js +2 -0
  43. package/dist/{collect-CHB22Sx4.js → collect-CQx4hX4N.js} +3 -3
  44. package/dist/{commands-BeaGNj_o.js → commands-Cpip4ULx.js} +13 -13
  45. package/dist/{compact-y6vfu2_f.js → compact-CAf557ZB.js} +11 -1
  46. package/dist/compile/index.d.ts +1 -1
  47. package/dist/compile/index.js +1 -1
  48. package/dist/{compile-Ba4blROR.js → compile-CcEu2ZQ1.js} +6 -5
  49. package/dist/{compile-BkRyBDBw.d.ts → compile-CtTP7eur.d.ts} +2 -2
  50. package/dist/{config-BJiM-xAm.js → config-BIjREpyE.js} +4 -4
  51. package/dist/{config-ir40y8m0.js → config-DLt6BvV7.js} +2 -2
  52. package/dist/{config-report-CdCgbRnV.js → config-report--Xb9APJS.js} +5 -6
  53. package/dist/{connection-CU8MQxRi.js → connection-DUsczpB5.js} +3 -2
  54. package/dist/constants-DcJABbLW.js +20 -0
  55. package/dist/{context-Bcy85rGi.js → context-DieZVJXu.js} +16 -5
  56. package/dist/convex/index.d.ts +4 -4
  57. package/dist/convex/index.js +14 -16
  58. package/dist/create-BBO24vj6.js +324 -0
  59. package/dist/{credential-8P81ff4u.js → credential-kue0qpbm.js} +4 -4
  60. package/dist/deciding-columns-Sq12mEA6.js +123 -0
  61. package/dist/delegation-input-FTxMK3ji.js +19 -0
  62. package/dist/denied-text-DfRk15uw.d.ts +19 -0
  63. package/dist/{describe-DMYiCjJV.d.ts → describe-C3ldA9os.d.ts} +11 -2
  64. package/dist/{describe-B_gVZEVi.js → describe-Cgkp7eP0.js} +5 -4
  65. package/dist/{diff-C9RDjjhs.js → diff-Cnghh_Ip.js} +2 -2
  66. package/dist/{diff-2VaeChzX.js → diff-rpqoe7Ag.js} +9 -9
  67. package/dist/{doctor-Djh6JDEk.js → doctor-CuVJvhV_.js} +2 -2
  68. package/dist/doctor-owlv6ddh.js +2166 -0
  69. package/dist/drizzle/index.d.ts +2 -2
  70. package/dist/drizzle/index.js +6 -14
  71. package/dist/elysia/index.d.ts +4 -4
  72. package/dist/elysia/index.js +7 -7
  73. package/dist/{errors-DPdqI50v.d.ts → errors-OD_4c__H.d.ts} +2 -2
  74. package/dist/{errors-Cz5zn0mW.js → errors-drnfxYtm.js} +3 -3
  75. package/dist/{evaluations-tz6D9A2G.js → evaluations-C9YJsv3H.js} +45 -7
  76. package/dist/eve/index.d.ts +5 -5
  77. package/dist/eve/index.js +5 -5
  78. package/dist/express/index.d.ts +4 -4
  79. package/dist/express/index.js +8 -7
  80. package/dist/fastify/index.d.ts +15 -5
  81. package/dist/fastify/index.js +9 -29
  82. package/dist/fields-fwfXN01n.js +1016 -0
  83. package/dist/{files-DWUN9PzI.js → files-D_JIzUrP.js} +12 -3
  84. package/dist/{fixtures-ht28Cplr.js → fixtures-h2eG2OZV.js} +5 -6
  85. package/dist/{from-snapshot-CTLijvdm.js → from-snapshot-7REQZe0H.js} +32 -22
  86. package/dist/{generate-CH7ThJ14.js → generate-CNU1pIOo.js} +1 -3
  87. package/dist/grantee-CXY-0C87.js +254 -0
  88. package/dist/grantee-conditions-MQs5NIuX.js +270 -0
  89. package/dist/grantee-match-fxYp9Nmt.js +141 -0
  90. package/dist/{helpers-H_KARDVC.js → helpers-C9YmyBIa.js} +7 -6
  91. package/dist/hono/index.d.ts +4 -4
  92. package/dist/hono/index.js +8 -8
  93. package/dist/hosted-CBHgkzDl.js +655 -0
  94. package/dist/{http-SO7qGttf.js → http-BBoKefeS.js} +35 -2
  95. package/dist/{http-BIhmLfCc.js → http-BEbdMZ05.js} +2 -24
  96. package/dist/{rls-import-4lLW_pbb.js → import-BFIlhetD.js} +86 -80
  97. package/dist/{openapi-import-cmwetbzw.js → import-UHk1N7vH.js} +6 -7
  98. package/dist/{index-C8z4RjQV.d.ts → index-BwMe94Xq.d.ts} +1 -1
  99. package/dist/{index-0nNqHspG.d.ts → index-DgM7w96K.d.ts} +2 -2
  100. package/dist/{index-C7Tw7MaW.d.ts → index-Dz7didpC.d.ts} +3 -3
  101. package/dist/{index-BNc7Wer_.d.ts → index-UdVQgq48.d.ts} +105 -38
  102. package/dist/index.d.ts +15 -13
  103. package/dist/index.js +22 -22
  104. package/dist/{instance-options-jARdwfPN.d.ts → instance-options-plkrsAog.d.ts} +1 -1
  105. package/dist/{json-schema-BsAflUGW.js → json-schema-DBkdUuCO.js} +1 -3
  106. package/dist/jwt/index.d.ts +4 -4
  107. package/dist/jwt/index.js +13 -13
  108. package/dist/{kernel-_RRHmnMY.js → kernel-CB3LrIJM.js} +81 -32
  109. package/dist/kysely/index.d.ts +2 -2
  110. package/dist/kysely/index.js +6 -14
  111. package/dist/{live-options-H2eG8dfJ.js → live-options-BaAFCIiu.js} +16 -3
  112. package/dist/load-B_shHrmd.js +2 -0
  113. package/dist/{load-DhWEB9P1.js → load-C3_oTHyO.js} +11 -3
  114. package/dist/{manifest-iaoBXHKc.js → manifest-BngWKryL.js} +5 -18
  115. package/dist/{map-claims-Z4QZOiFF.js → map-claims-AVlBaJoa.js} +7 -16
  116. package/dist/{map-error-pgUWNNtG.js → map-error-BE27PYkE.js} +5 -5
  117. package/dist/{markers-B0hYLvMD.js → markers-CiwAOZtO.js} +6 -2
  118. package/dist/{may-use-DndQ5tQ-.js → may-use-BOn_dR_w.js} +4 -3
  119. package/dist/mcp/index.d.ts +26 -9
  120. package/dist/mcp/index.js +456 -446
  121. package/dist/{rls-migrate-CN4TlJTO.js → migrate-BwlB5-Wk.js} +75 -15
  122. package/dist/nest/index.d.ts +4 -4
  123. package/dist/nest/index.js +11 -12
  124. package/dist/next/index.d.ts +31 -8
  125. package/dist/next/index.js +29 -33
  126. package/dist/next/plugin.d.ts +1 -1
  127. package/dist/next/plugin.js +1 -1
  128. package/dist/node/index.d.ts +4 -4
  129. package/dist/node/index.js +4 -4
  130. package/dist/ocsf-uYFXGVw2.js +115 -0
  131. package/dist/openai/index.d.ts +5 -5
  132. package/dist/openai/index.js +4 -4
  133. package/dist/openapi/index.d.ts +3 -3
  134. package/dist/openapi/index.js +1 -1
  135. package/dist/{openapi-CqqEbHsL.js → openapi-BJdBmYDG.js} +19 -23
  136. package/dist/{openapi-BqRBvAng.js → openapi-DBzHQbov.js} +2 -5
  137. package/dist/{openapi-CQTsgKoB.js → openapi-DcQ1Kg40.js} +3 -3
  138. package/dist/orpc/index.d.ts +5 -5
  139. package/dist/orpc/index.js +9 -11
  140. package/dist/otel/index.d.ts +2 -2
  141. package/dist/otel/index.js +26 -23
  142. package/dist/output-files-CgIsvdSa.js +140 -0
  143. package/dist/{rls-ownership-DcYlZ09B.js → ownership-BgnbOJFT.js} +387 -379
  144. package/dist/{package-root-zGkxO3oN.js → package-root-DtNnpmUd.js} +3 -2
  145. package/dist/{parse-BuyjxhZV.js → parse-CVFQHk6c.js} +3 -3
  146. package/dist/{parse-local-manifest-BrMozJCo.js → parse-local-manifest-C-q02Pal.js} +2 -4
  147. package/dist/{parse-local-manifest-JLnaBH0S.d.ts → parse-local-manifest-DvYUR0QL.d.ts} +1 -1
  148. package/dist/pdp/index.d.ts +2 -2
  149. package/dist/pdp/index.js +8 -9
  150. package/dist/{permdock-CbgvLnuo.js → permdock-L26udHSk.js} +1387 -1220
  151. package/dist/{rls-fields-CZOMlwHl.js → permission-keys-B26jeyUv.js} +1268 -2053
  152. package/dist/permission-registry-BsblpB-z.js +385 -0
  153. package/dist/{permissions-DttnqqxC.d.ts → permission-types-Dg39z9Kv.d.ts} +59 -31
  154. package/dist/{permissions-RJrovw98.js → permissions-CCJ6lmxB.js} +3 -3
  155. package/dist/{permissions-CDgvKG5L.d.ts → permissions-COH-KRgT.d.ts} +2 -2
  156. package/dist/{policy-IB6yxpC3.d.ts → policy-types-sp9P1iIV.d.ts} +661 -582
  157. package/dist/{policy-D2W7uv19.d.ts → policy-ur0BBK_e.d.ts} +2 -2
  158. package/dist/{powersync-DE19b9dT.js → powersync-BFSbSElQ.js} +2 -2
  159. package/dist/powersync-DCDgZgfZ.js +2 -0
  160. package/dist/{powersync-Dv1_aWF7.js → powersync-cZe4kzhL.js} +26 -27
  161. package/dist/prisma/index.d.ts +1 -1
  162. package/dist/prisma/index.js +6 -12
  163. package/dist/{problem-B43ztKIm.js → problem-CnWraVhC.js} +8 -7
  164. package/dist/{problem-details-_AMOYz-w.js → problem-details-DECUnXAn.js} +2 -2
  165. package/dist/{problem-details-DX075l9V.d.ts → problem-details-rIIo8B2C.d.ts} +1 -1
  166. package/dist/{protected-BdnIEFkY.d.ts → protected-B3_P7xuw.d.ts} +9 -6
  167. package/dist/{protected-utU-SLuy.js → protected-BN7BUdY1.js} +20 -8
  168. package/dist/{provider-CSQd7m92.js → provider-Bi-0HNL3.js} +23 -10
  169. package/dist/{provider-DZY281jO.d.ts → provider-kwHC9CZD.d.ts} +1 -1
  170. package/dist/{provider-store-Cfbvo4DE.js → provider-store-Ctt-81Ni.js} +6 -3
  171. package/dist/react/index.d.ts +7 -7
  172. package/dist/react/index.js +5 -5
  173. package/dist/react/provider-client.d.ts +1 -1
  174. package/dist/react/provider-client.js +1 -1
  175. package/dist/react-native/index.d.ts +20 -11
  176. package/dist/react-native/index.js +33 -17
  177. package/dist/{refs-KYb4ntaz.js → refs-f3imMjNW.js} +1 -1
  178. package/dist/relation-walk-BXnlLtg2.js +186 -0
  179. package/dist/relations-CvmSpG67.js +163 -0
  180. package/dist/{replay-CYyiLiwO.d.ts → replay-COpmZUfx.d.ts} +1 -1
  181. package/dist/request-context-BVM7aWNs.js +71 -0
  182. package/dist/request-context-C2_1lchh.d.ts +5 -0
  183. package/dist/resource-relations-D1Un3pcz.js +243 -0
  184. package/dist/retire-BFcxL6un.js +240 -0
  185. package/dist/{rls-P-BeBx0n.js → rls-55DQTuf5.js} +14 -2
  186. package/dist/{rls-DiinlRML.js → rls-BEktUaqg.js} +884 -484
  187. package/dist/{policy-xyWg7QdR.js → role-builder-B4GbKM-i.js} +235 -541
  188. package/dist/{rpc-DL9Sqvb1.js → rpc-nYC3cR_u.js} +15 -5
  189. package/dist/{run-BWc9qqvE.js → run-DMcNW_8T.js} +3 -3
  190. package/dist/{runtime-CB8gQFvS.js → runtime-D_tMXnsq.js} +1 -1
  191. package/dist/{saas-DhpJjnBA.js → saas-DtaA4JuW.js} +9 -8
  192. package/dist/{openapi-schema--ARjyfQr.js → schema-Bol6gqXA.js} +3 -5
  193. package/dist/{schema-D3MnDMxa.js → schema-DjQBcAP9.js} +4 -2
  194. package/dist/scim/index.d.ts +1 -1
  195. package/dist/scim/index.js +1 -1
  196. package/dist/{scim-BFGBBAqR.js → scim-vFR1O5oG.js} +6 -12
  197. package/dist/{scopes-CVdPrWN-.js → scopes-tvpa34ep.js} +10 -2
  198. package/dist/server/index.d.ts +18 -8
  199. package/dist/server/index.js +8 -8
  200. package/dist/{server-DlZ28Oz5.js → server-ZYEHtNHS.js} +4 -4
  201. package/dist/{create-B1d519XK.d.ts → server-types-DdqBwZN_.d.ts} +69 -33
  202. package/dist/shared-1uhI-e-b.js +294 -0
  203. package/dist/{shared-DRu8VFVM.js → shared-JhMeOsDF.js} +1 -1
  204. package/dist/{sink-Bd9PSyfq.js → sink-BTtmfPnE.js} +1 -1
  205. package/dist/{sink-B1fZzIMf.d.ts → sink-CPN4zLfs.d.ts} +1 -1
  206. package/dist/{skills-Biq5uup3.js → skills-BZdRQkxs.js} +4 -3
  207. package/dist/{skills-C5CbhhpG.js → skills-Dle4ZoLF.js} +2 -2
  208. package/dist/{snapshot-Enxd0n-s.js → snapshot-Dc9CHPME.js} +116 -13
  209. package/dist/{snapshot-cache-D6jLelln.js → snapshot-cache-Cod40D-X.js} +1 -1
  210. package/dist/{snapshot-cache-B-LxUahj.d.ts → snapshot-cache-J5T7t_vD.d.ts} +1 -1
  211. package/dist/solid/index.d.ts +22 -22
  212. package/dist/solid/index.js +40 -10
  213. package/dist/{sources-4p0-4xQm.js → sources-B1-b-R0t.js} +25 -26
  214. package/dist/{sources-BdOYLw9j.d.ts → sources-Dljy06zL.d.ts} +6 -2
  215. package/dist/{sql-xdg5f4Fi.js → sql-t8teWOfo.js} +19 -3
  216. package/dist/{src-BDwEZWrZ.js → src-Bb7no-hS.js} +194 -123
  217. package/dist/ssf/index.d.ts +3 -3
  218. package/dist/ssf/index.js +58 -61
  219. package/dist/store-9KO4BlkB.d.ts +147 -0
  220. package/dist/{store-DMAWwAJV.js → store-ILkLUj_o.js} +4 -4
  221. package/dist/{store-options-ByhZq1jV.js → store-options-CbUHDoSe.js} +16 -7
  222. package/dist/{stores-BT2pSCub.js → stores-BHXdSbw9.js} +7 -3
  223. package/dist/stores-Cxz_80g-.d.ts +31 -0
  224. package/dist/{stream-DDpvynSB.js → stream-BMui98KK.js} +2 -1
  225. package/dist/{stream-D1RXubw2.d.ts → stream-Dwsg6WwE.d.ts} +2 -2
  226. package/dist/{subject-settings-BwBmCdTR.js → subject-settings-CkEwrw3W.js} +23 -5
  227. package/dist/supabase/index.d.ts +4 -4
  228. package/dist/supabase/index.js +3 -3
  229. package/dist/supabase/middleware.d.ts +11 -5
  230. package/dist/supabase/middleware.js +10 -7
  231. package/dist/{supabase-C0qESOa-.js → supabase-C1TWlnYt.js} +36 -52
  232. package/dist/{supabase-s4o9s1O1.js → supabase-Dbqr141s.js} +2 -2
  233. package/dist/supabase-hook-BULg7Ut_.js +2 -0
  234. package/dist/{supabase-hook-ntETYCQu.js → supabase-hook-Cva3ikXz.js} +730 -781
  235. package/dist/{supautils-u8jXTGrt.js → supautils-B6HYL9eL.js} +2 -2
  236. package/dist/svelte/Protected.svelte +9 -2
  237. package/dist/svelte/index.d.ts +6 -6
  238. package/dist/svelte/index.js +25 -11
  239. package/dist/svelte/runtime.d.ts +10 -3
  240. package/dist/svelte/runtime.js +4 -3
  241. package/dist/svelte/source.d.ts +6 -6
  242. package/dist/svelte/source.js +4 -4
  243. package/dist/{validity-uOp8UpYn.js → tenancy-DshjqY0n.js} +3 -39
  244. package/dist/terminal/index.d.ts +5 -5
  245. package/dist/terminal/index.js +18 -34
  246. package/dist/testing/index.d.ts +89 -77
  247. package/dist/testing/index.js +1276 -1262
  248. package/dist/testing/saas/index.d.ts +4 -4
  249. package/dist/testing/saas/index.js +2 -2
  250. package/dist/testing/saas/permissions.d.ts +1 -1
  251. package/dist/testing/saas/permissions.js +1 -1
  252. package/dist/thenable-QSmvt-vZ.js +65 -0
  253. package/dist/{token-CIWxJOCh.js → token-Bx9qy30p.js} +1 -1
  254. package/dist/tool-refusal-CQ7OEia9.js +41 -0
  255. package/dist/trpc/index.d.ts +5 -5
  256. package/dist/trpc/index.js +7 -8
  257. package/dist/{types-DbjRN55U.d.ts → types-7rJVLWe5.d.ts} +82 -4
  258. package/dist/{types-aqOHTHcp.d.ts → types-Br9IXUBG.d.ts} +1 -1
  259. package/dist/types-ByUo56un.d.ts +88 -0
  260. package/dist/{types-Cq_H8N_X.d.ts → types-C0dee0Qf.d.ts} +2 -2
  261. package/dist/{types-DxiCGmmd.d.ts → types-CIlTojhq.d.ts} +2 -2
  262. package/dist/{types-QCuYJh4q.d.ts → types-CUcFZfpU.d.ts} +1 -1
  263. package/dist/{types-C97IskBw.d.ts → types-CqrjB9o6.d.ts} +1 -1
  264. package/dist/{types-BnIEz1sU.d.ts → types-DHrmBJLH.d.ts} +24 -6
  265. package/dist/{types-Dnemwd77.d.ts → types-DpWfQdSh.d.ts} +5 -1
  266. package/dist/{types-Bvc4oWT6.d.ts → types-DvupZE0w.d.ts} +1 -1
  267. package/dist/unplugin/index.d.ts +1 -1
  268. package/dist/unplugin/index.js +1 -1
  269. package/dist/{usage-B0YuTQRO.js → usage-4G6t643F.js} +2 -2
  270. package/dist/{usage-ItS7nLcl.js → usage-CG9nOYZw.js} +7 -7
  271. package/dist/usage-iFLJ0-rr.js +2 -0
  272. package/dist/{validation-error-Ba264OaJ.d.ts → validation-error-BSSw0l_8.d.ts} +1 -1
  273. package/dist/{validation-error-CnjZ4t92.js → validation-error-ZfUHbKvf.js} +1 -1
  274. package/dist/validity-dVrUEPJt.js +62 -0
  275. package/dist/{verifier-BxBo6I44.js → verifier-DMr_Zmb_.js} +51 -15
  276. package/dist/{rls-verify-CMv9H3wV.js → verify-BztUB3GX.js} +668 -239
  277. package/dist/{version-BvacVTZR.js → version-BEogC-rB.js} +1 -1
  278. package/dist/{views-Soe7bGSC.js → views-CJsrBS1f.js} +23 -1
  279. package/dist/{vocabulary-DA8a8zif.d.ts → vocabulary-hhEFLFoL.d.ts} +15 -6
  280. package/dist/vue/index.d.ts +24 -19
  281. package/dist/vue/index.js +24 -8
  282. package/dist/watch-C8TpsAl4.js +2 -0
  283. package/dist/{watch-DVBJ9cBq.js → watch-zeucB7eF.js} +6 -6
  284. package/dist/webmcp/index.d.ts +2 -2
  285. package/dist/webmcp/index.js +13 -37
  286. package/dist/wrap-Cr93qqdP.d.ts +14 -0
  287. package/dist/wrap-DWsU_5Bd.js +26 -0
  288. package/package.json +8 -8
  289. package/schemas/catalog-v1.json +6 -0
  290. package/skills/permdock-credentials/SKILL.md +1 -1
  291. package/skills/permdock-credentials/references/tokens-keys-links.md +7 -2
  292. package/skills/permdock-data/references/queries-and-rls.md +4 -0
  293. package/skills/permdock-tenancy/references/ownership-and-custom-roles.md +1 -0
  294. package/skills/permdock-wire/SKILL.md +2 -2
  295. package/skills/permdock-wire/references/adapters.md +9 -1
  296. package/skills/permdock-wire/references/policy-options.md +10 -1
  297. package/dist/catalog-CRW5Mx_B.js +0 -2
  298. package/dist/collect-DSWOk19R.js +0 -2
  299. package/dist/create-CMwIl-w2.js +0 -253
  300. package/dist/delegation-D8pUEuce.js +0 -103
  301. package/dist/doctor-DvH0IQff.js +0 -1194
  302. package/dist/doctor-collect-CjdO0wQX.js +0 -665
  303. package/dist/evaluation-items-CfCCejQd.js +0 -40
  304. package/dist/fields-BMl1RxoX.js +0 -26
  305. package/dist/grantee-Cv5Sogfv.js +0 -602
  306. package/dist/hosted-DJQw46hn.js +0 -266
  307. package/dist/instance-options-Dhhcnm3y.js +0 -22
  308. package/dist/load-DwJUafYN.js +0 -2
  309. package/dist/map-AcxK9o_D.js +0 -147
  310. package/dist/permissions-DVoF6dMt.js +0 -662
  311. package/dist/powersync-CrBX8hY6.js +0 -2
  312. package/dist/protected-xAr24FEC.d.ts +0 -40
  313. package/dist/relations-cjOL01hZ.js +0 -505
  314. package/dist/rls-graph-CHwx0V8q.js +0 -435
  315. package/dist/rls-shared-Cewd_-zI.js +0 -495
  316. package/dist/store-jOBYpiXC.d.ts +0 -36
  317. package/dist/stores-C0IMQrGI.d.ts +0 -52
  318. package/dist/supabase-config-Bj3iDH2I.js +0 -472
  319. package/dist/supabase-hook-gd3s8bxB.js +0 -2
  320. package/dist/thenable-okc2xDsj.js +0 -10
  321. package/dist/types-CKNSyIf_.d.ts +0 -52
  322. package/dist/usage-DorAJiU_.js +0 -2
  323. package/dist/watch-BwxLTYMZ.js +0 -2
@@ -1,8 +1,8 @@
1
- import { t as compact } from "./compact-y6vfu2_f.js";
2
- import { o as requestFromContext } from "./http-SO7qGttf.js";
1
+ import { t as compact } from "./compact-CAf557ZB.js";
2
+ import { s as requestFromContext } from "./http-BBoKefeS.js";
3
3
  import { n as tenantScope } from "./adapter-context-mlWsVGGg.js";
4
- import { t as adapterKernel } from "./bind-CuzGytRf.js";
5
- import { n as guardIterable } from "./stream-DDpvynSB.js";
4
+ import { t as adapterKernel } from "./bind-kk-uyCwH.js";
5
+ import { n as guardIterable } from "./stream-BMui98KK.js";
6
6
  //#region src/server/rpc.ts
7
7
  /** The tRPC and oRPC error code for a Problem Details status. */
8
8
  function rpcCode(status) {
@@ -58,6 +58,15 @@ function bindRpcKernel(policy, options, adapter, contextOf, path) {
58
58
  const opts = optsByRequest.get(request);
59
59
  return opts === void 0 ? { tenant: void 0 } : scopeOf(opts);
60
60
  });
61
+ const guard = async (permission, loadData, opts, protectOptions) => {
62
+ const request = bind(opts);
63
+ const scope = await scopeOf(opts);
64
+ return {
65
+ request,
66
+ scope,
67
+ guard: await kernel.protect(permission, loadData === void 0 ? void 0 : () => loadData(opts), protectOptions)(request, scope)
68
+ };
69
+ };
61
70
  const evaluate = (request, opts) => {
62
71
  bind(opts);
63
72
  return request.method === "GET" ? evaluations.GET(request) : evaluations.POST(request);
@@ -70,7 +79,8 @@ function bindRpcKernel(policy, options, adapter, contextOf, path) {
70
79
  },
71
80
  scopeOf,
72
81
  connection,
73
- evaluate
82
+ evaluate,
83
+ guard
74
84
  };
75
85
  }
76
86
  /** Wraps a streamed result so revocation ends it and items the subscriber cannot read drop. */
@@ -1,7 +1,7 @@
1
1
  import { a as exitCodeOf, i as describeError, n as cliErrorKind, r as cliProblem } from "./errors-CWfoNg9N.js";
2
- import { o as cliVersion } from "./version-BvacVTZR.js";
3
- import { a as resolveCwd, i as readConfig } from "./config-BJiM-xAm.js";
4
- import { i as globalArgs, n as commands, o as resolveArgs, r as isCommand, s as stringArg, t as COMMAND_DESCRIPTIONS } from "./commands-BeaGNj_o.js";
2
+ import { o as cliVersion } from "./version-BEogC-rB.js";
3
+ import { a as resolveCwd, i as readConfig } from "./config-BIjREpyE.js";
4
+ import { i as globalArgs, n as commands, o as resolveArgs, r as isCommand, s as stringArg, t as COMMAND_DESCRIPTIONS } from "./commands-Cpip4ULx.js";
5
5
  import { stripVTControlCharacters } from "node:util";
6
6
  import { defineCommand, parseArgs, renderUsage, runCommand } from "citty";
7
7
  //#region src/cli/run.ts
@@ -1,4 +1,4 @@
1
- import { a as protectedView, s as scopedTenant } from "./views-Soe7bGSC.js";
1
+ import { c as scopedTenant, o as protectedView } from "./views-CJsrBS1f.js";
2
2
  //#region src/svelte/protected.ts
3
3
  /** The instance for `tenant`, built once per store change rather than once per check. */
4
4
  function scopedFor(store, tenant, _generation) {
@@ -1,10 +1,11 @@
1
- import { r as principal } from "./refs-KYb4ntaz.js";
2
- import { _ as memoryLimitStore, a as definePolicy, m as role, o as deny, t as allow } from "./policy-xyWg7QdR.js";
3
- import { _ as memoryRoleSource } from "./src-BDwEZWrZ.js";
4
- import { n as anyone, p as relation } from "./grantee-Cv5Sogfv.js";
5
- import { t as memoryRelations } from "./relations-cjOL01hZ.js";
6
- import { i as quoteSqlLiteral } from "./sql-xdg5f4Fi.js";
7
- import { a as saasPlans, i as saasPermissions, o as saasRoles } from "./permissions-RJrovw98.js";
1
+ import { r as isRecord } from "./compact-CAf557ZB.js";
2
+ import { r as principal } from "./refs-f3imMjNW.js";
3
+ import { a as deny, n as role, r as allow, u as memoryLimitStore } from "./role-builder-B4GbKM-i.js";
4
+ import { f as memoryRelations, g as memoryRoleSource } from "./src-Bb7no-hS.js";
5
+ import { l as relation, n as anyone } from "./grantee-CXY-0C87.js";
6
+ import { o as definePolicy } from "./hosted-CBHgkzDl.js";
7
+ import { o as quoteSqlLiteral } from "./sql-t8teWOfo.js";
8
+ import { a as saasPlans, i as saasPermissions, o as saasRoles } from "./permissions-CCJ6lmxB.js";
8
9
  //#region src/testing/saas/policy.ts
9
10
  function isSubject(user) {
10
11
  return user !== null && "context" in user && "principal" in user;
@@ -632,7 +633,7 @@ function decodeSegment(segment) {
632
633
  function parseSegment(segment) {
633
634
  try {
634
635
  const parsed = JSON.parse(new TextDecoder().decode(decodeSegment(segment)));
635
- return parsed !== null && typeof parsed === "object" && !Array.isArray(parsed) ? parsed : null;
636
+ return isRecord(parsed) ? parsed : null;
636
637
  } catch {
637
638
  return null;
638
639
  }
@@ -1,4 +1,5 @@
1
- import { t as packageRoot } from "./package-root-zGkxO3oN.js";
1
+ import { r as isRecord } from "./compact-CAf557ZB.js";
2
+ import { t as packageRoot } from "./package-root-DtNnpmUd.js";
2
3
  import { t as DRAFT_PINS } from "./pins-8ILTftC9.js";
3
4
  import { readFileSync } from "node:fs";
4
5
  import { join } from "node:path";
@@ -6677,7 +6678,7 @@ var require_json_schema_2020_12 = /* @__PURE__ */ __commonJSMin(((exports) => {
6677
6678
  exports.default = addMetaSchema2020;
6678
6679
  }));
6679
6680
  //#endregion
6680
- //#region src/cli/openapi-schema.ts
6681
+ //#region src/cli/openapi/schema.ts
6681
6682
  var import__2020 = (/* @__PURE__ */ __commonJSMin(((exports, module) => {
6682
6683
  Object.defineProperty(exports, "__esModule", { value: true });
6683
6684
  exports.MissingRefError = exports.ValidationError = exports.CodeGen = exports.Name = exports.nil = exports.stringify = exports.str = exports._ = exports.KeywordCxt = exports.Ajv2020 = void 0;
@@ -6778,9 +6779,6 @@ var import__2020 = (/* @__PURE__ */ __commonJSMin(((exports, module) => {
6778
6779
  function schemaDir() {
6779
6780
  return join(packageRoot(), "schemas", "openapi");
6780
6781
  }
6781
- function isRecord(value) {
6782
- return value !== null && typeof value === "object" && !Array.isArray(value);
6783
- }
6784
6782
  const validators = /* @__PURE__ */ new Map();
6785
6783
  /** Parses a bundled schema file; throws on anything but a JSON object. */
6786
6784
  function parseSchema(text, file) {
@@ -86,7 +86,8 @@ const catalogSchema = freezeDeep({
86
86
  relations: { type: "object" },
87
87
  version: { type: "string" },
88
88
  restricted: { type: "string" },
89
- restrictedStops: strings
89
+ restrictedStops: strings,
90
+ meta: { type: "object" }
90
91
  }
91
92
  }
92
93
  },
@@ -265,7 +266,8 @@ const catalogSchema = freezeDeep({
265
266
  mode: { enum: ["hard", "soft"] }
266
267
  }
267
268
  },
268
- portable: { const: false }
269
+ portable: { const: false },
270
+ meta: { type: "object" }
269
271
  }
270
272
  }
271
273
  },
@@ -1,2 +1,2 @@
1
- import { A as ScimPageResult, C as LIST_SCHEMA, D as ScimFilter, E as SCIM_CONTENT_TYPE, M as ScimTokenOptions, N as USER_SCHEMA, O as ScimHandlerOptions, S as GROUP_SCHEMA, T as ROLES_EXTENSION, _ as DirectoryNotFoundError, a as scimHandler, b as DirectoryUser, c as parseScimFilter, d as serviceProviderConfig, f as authenticateScim, g as DirectoryMembershipSourceOptions, h as DirectoryGroup, i as tenantFromPath, j as ScimPatchOp, k as ScimPage, l as resourceTypes, m as DirectoryChange, n as directoryMembershipSource, o as filterSupported, p as sha256Hex, r as normalizePatchOps, s as matchFilter, t as memoryDirectoryStore, u as schemas, v as DirectoryStore, w as PATCH_SCHEMA, x as ERROR_SCHEMA, y as DirectoryUniquenessError } from "../index-C8z4RjQV.js";
1
+ import { A as ScimPageResult, C as LIST_SCHEMA, D as ScimFilter, E as SCIM_CONTENT_TYPE, M as ScimTokenOptions, N as USER_SCHEMA, O as ScimHandlerOptions, S as GROUP_SCHEMA, T as ROLES_EXTENSION, _ as DirectoryNotFoundError, a as scimHandler, b as DirectoryUser, c as parseScimFilter, d as serviceProviderConfig, f as authenticateScim, g as DirectoryMembershipSourceOptions, h as DirectoryGroup, i as tenantFromPath, j as ScimPatchOp, k as ScimPage, l as resourceTypes, m as DirectoryChange, n as directoryMembershipSource, o as filterSupported, p as sha256Hex, r as normalizePatchOps, s as matchFilter, t as memoryDirectoryStore, u as schemas, v as DirectoryStore, w as PATCH_SCHEMA, x as ERROR_SCHEMA, y as DirectoryUniquenessError } from "../index-BwMe94Xq.js";
2
2
  export { type DirectoryChange, type DirectoryGroup, type DirectoryMembershipSourceOptions, DirectoryNotFoundError, type DirectoryStore, DirectoryUniquenessError, type DirectoryUser, ERROR_SCHEMA, GROUP_SCHEMA, LIST_SCHEMA, PATCH_SCHEMA, ROLES_EXTENSION, SCIM_CONTENT_TYPE, type ScimFilter, type ScimHandlerOptions, type ScimPage, type ScimPageResult, type ScimPatchOp, type ScimTokenOptions, USER_SCHEMA, authenticateScim, directoryMembershipSource, filterSupported, matchFilter, memoryDirectoryStore, normalizePatchOps, parseScimFilter, resourceTypes, schemas, scimHandler, serviceProviderConfig, sha256Hex, tenantFromPath };
@@ -1,2 +1,2 @@
1
- import { S as sha256Hex, _ as PATCH_SCHEMA, a as normalizePatchOps, b as USER_SCHEMA, c as parseScimFilter, d as serviceProviderConfig, f as DirectoryNotFoundError, g as LIST_SCHEMA, h as GROUP_SCHEMA, i as tenantFromPath, l as resourceTypes, m as ERROR_SCHEMA, n as directoryMembershipSource, o as filterSupported, p as DirectoryUniquenessError, r as scimHandler, s as matchFilter, t as memoryDirectoryStore, u as schemas, v as ROLES_EXTENSION, x as authenticateScim, y as SCIM_CONTENT_TYPE } from "../scim-BFGBBAqR.js";
1
+ import { S as sha256Hex, _ as PATCH_SCHEMA, a as normalizePatchOps, b as USER_SCHEMA, c as parseScimFilter, d as serviceProviderConfig, f as DirectoryNotFoundError, g as LIST_SCHEMA, h as GROUP_SCHEMA, i as tenantFromPath, l as resourceTypes, m as ERROR_SCHEMA, n as directoryMembershipSource, o as filterSupported, p as DirectoryUniquenessError, r as scimHandler, s as matchFilter, t as memoryDirectoryStore, u as schemas, v as ROLES_EXTENSION, x as authenticateScim, y as SCIM_CONTENT_TYPE } from "../scim-vFR1O5oG.js";
2
2
  export { DirectoryNotFoundError, DirectoryUniquenessError, ERROR_SCHEMA, GROUP_SCHEMA, LIST_SCHEMA, PATCH_SCHEMA, ROLES_EXTENSION, SCIM_CONTENT_TYPE, USER_SCHEMA, authenticateScim, directoryMembershipSource, filterSupported, matchFilter, memoryDirectoryStore, normalizePatchOps, parseScimFilter, resourceTypes, schemas, scimHandler, serviceProviderConfig, sha256Hex, tenantFromPath };
@@ -1,7 +1,7 @@
1
- import { n as isReadonlyArray, t as compact } from "./compact-y6vfu2_f.js";
1
+ import { n as isReadonlyArray, r as isRecord, t as compact } from "./compact-CAf557ZB.js";
2
2
  import { n as freezeDeep } from "./freeze-CrU8nQeX.js";
3
3
  import { n as sha256 } from "./sha256-BO0swRXL.js";
4
- import { a as memorySink, i as membershipEvent } from "./sink-Bd9PSyfq.js";
4
+ import { a as memorySink, i as membershipEvent } from "./sink-BTtmfPnE.js";
5
5
  //#region src/scim/auth.ts
6
6
  function hexToBytes(hex) {
7
7
  if (hex.length % 2 !== 0) return;
@@ -445,9 +445,6 @@ function filterSupported(filter) {
445
445
  }
446
446
  //#endregion
447
447
  //#region src/scim/body.ts
448
- function isRecord$1(value) {
449
- return value !== null && typeof value === "object" && !Array.isArray(value);
450
- }
451
448
  async function readJson(request) {
452
449
  const text = await request.text();
453
450
  if (text === "") return;
@@ -460,13 +457,13 @@ function schemasOk(body, required) {
460
457
  }
461
458
  function readRoles(body) {
462
459
  const extension = body[ROLES_EXTENSION];
463
- if (!isRecord$1(extension) || !Array.isArray(extension["roles"])) return;
460
+ if (!isRecord(extension) || !Array.isArray(extension["roles"])) return;
464
461
  return extension["roles"].filter((item) => typeof item === "string");
465
462
  }
466
463
  function userFromBody(body, id) {
467
464
  if (typeof body["userName"] !== "string" || body["userName"] === "") return;
468
465
  const emails = Array.isArray(body["emails"]) ? body["emails"].flatMap((item) => {
469
- if (!isRecord$1(item) || typeof item["value"] !== "string") return [];
466
+ if (!isRecord(item) || typeof item["value"] !== "string") return [];
470
467
  return [compact({
471
468
  value: item["value"],
472
469
  primary: typeof item["primary"] === "boolean" ? item["primary"] : void 0,
@@ -489,7 +486,7 @@ function userFromBody(body, id) {
489
486
  function groupFromBody(body, id, fallbackRoles) {
490
487
  if (typeof body["displayName"] !== "string" || body["displayName"] === "") return;
491
488
  const members = Array.isArray(body["members"]) ? body["members"].flatMap((item) => {
492
- if (!isRecord$1(item) || typeof item["value"] !== "string") return [];
489
+ if (!isRecord(item) || typeof item["value"] !== "string") return [];
493
490
  return [{ value: item["value"] }];
494
491
  }) : [];
495
492
  return compact({
@@ -620,9 +617,6 @@ function groupRolesFor(groupRoles, id) {
620
617
  //#endregion
621
618
  //#region src/scim/patch.ts
622
619
  const FILTER_PATH = /^(?<attribute>[A-Za-z0-9._]+)\[(?<field>[A-Za-z0-9._]+)\s+eq\s+"(?<value>[^"]+)"\](?<rest>\.[A-Za-z0-9._]+)?$/u;
623
- function isRecord(value) {
624
- return value !== null && typeof value === "object" && !Array.isArray(value);
625
- }
626
620
  function coerceActive(value) {
627
621
  if (typeof value === "boolean") return value;
628
622
  if (typeof value === "string") {
@@ -963,7 +957,7 @@ function scimHandler(options) {
963
957
  return new Response(null, { status: 204 });
964
958
  }
965
959
  const body = await readJson(request);
966
- if (!isRecord$1(body)) return scimError(400, "invalidSyntax", "malformed body");
960
+ if (!isRecord(body)) return scimError(400, "invalidSyntax", "malformed body");
967
961
  if (request.method === "POST" && route.id === void 0) {
968
962
  if (route.kind === "Users") {
969
963
  if (!schemasOk(body, "urn:ietf:params:scim:schemas:core:2.0:User")) return scimError(400, "invalidSyntax", "unsupported schema");
@@ -1,5 +1,8 @@
1
- import { T as isForbiddenKey } from "./permissions-DVoF6dMt.js";
1
+ import { r as isRecord } from "./compact-CAf557ZB.js";
2
+ import { t as freezeCopy } from "./freeze-CrU8nQeX.js";
3
+ import { o as isForbiddenKey } from "./thenable-QSmvt-vZ.js";
2
4
  import { t as idText } from "./ids-DC4V4CFu.js";
5
+ import { i as readAppData } from "./app-data-CV8pqqMi.js";
3
6
  //#region src/core/scopes.ts
4
7
  const RESERVED = /* @__PURE__ */ new Set(["global", "resource"]);
5
8
  const NAME = /^[a-z][a-z0-9_]*$/u;
@@ -114,13 +117,18 @@ function normalizeMembership(input, scopes) {
114
117
  const roles = roleList(raw["roles"]);
115
118
  if (roles === void 0) return;
116
119
  const extra = {};
120
+ if (raw["x"] !== void 0) {
121
+ const x = readAppData(void 0, raw["x"]);
122
+ if (x !== void 0) extra.x = freezeCopy(x);
123
+ }
117
124
  if (typeof raw["via"] === "string") extra.via = raw["via"];
118
125
  if (typeof raw["expiresAt"] === "number") extra.expiresAt = raw["expiresAt"];
119
126
  if (typeof raw["grantedBy"] === "string" && raw["grantedBy"] !== "") extra.grantedBy = raw["grantedBy"];
120
127
  if (typeof raw["reason"] === "string" && raw["reason"] !== "") extra.reason = raw["reason"];
121
128
  const eligible = roleList(raw["eligible"]);
122
129
  if (eligible !== void 0 && eligible.length > 0) extra.eligible = Object.freeze([...eligible]);
123
- const member = raw["member"] !== null && typeof raw["member"] === "object" && !Array.isArray(raw["member"]) ? raw["member"]["group"] : void 0;
130
+ const rawMember = raw["member"];
131
+ const member = isRecord(rawMember) ? rawMember["group"] : void 0;
124
132
  if (typeof member === "string" && member !== "") extra.member = Object.freeze({ group: member });
125
133
  if (raw["managedBy"] === "idp") extra.managedBy = "idp";
126
134
  if (Array.isArray(raw["entitlements"])) {
@@ -1,11 +1,21 @@
1
- import { $t as CredentialPrincipal, Ct as SettingsSource, Kt as Credential, Nr as Principal, Pr as Subject, Yn as Decision, at as DecisionSink, et as AuthEvent, jt as SubjectResolver, nt as CredentialVerifier } from "../policy-IB6yxpC3.js";
2
- import { f as Permission, m as PermissionTree } from "../permissions-DttnqqxC.js";
3
- import { n as PermDockValidationError, t as PROBLEM_BASE } from "../validation-error-Ba264OaJ.js";
4
- import { t as Disclosure } from "../problem-details-DX075l9V.js";
5
- import { a as ProblemDetails, i as PermDockRevokedError, n as PermDockApprovalRequiredError, r as PermDockDeniedError, t as ApprovalHint } from "../errors-DPdqI50v.js";
1
+ import { E as Policy, H as CredentialVerifier, Or as Principal, W as DecisionSink, ir as Decision, it as SettingsSource, j as PolicyVocabulary, kr as Subject, mt as Credential, ot as SubjectResolver, xt as CredentialPrincipal, yn as AuthEvent } from "../policy-types-sp9P1iIV.js";
2
+ import { d as Permission, p as PermissionTree } from "../permission-types-Dg39z9Kv.js";
3
+ import { n as PermDockValidationError, t as PROBLEM_BASE } from "../validation-error-BSSw0l_8.js";
4
+ import { t as Disclosure } from "../problem-details-rIIo8B2C.js";
5
+ import { a as ProblemDetails, i as PermDockRevokedError, n as PermDockApprovalRequiredError, r as PermDockDeniedError, t as ApprovalHint } from "../errors-OD_4c__H.js";
6
+ import { t as RequestContext } from "../request-context-C2_1lchh.js";
6
7
  import { i as memoryRevocationFeed, n as RevocationFeed, t as RevocationEvent } from "../revocations-Cy06JNx2.js";
7
- import { A as ConnectionOptions, C as invalidSignatureResponse, D as tenantScope, E as TenantScope, O as Connection, S as invalidSignatureProblem, T as TenantOption, _ as WebBotAuthKeyLookup, a as ScopeGuard, b as WebBotAuthVerifier, c as ServerPermDock, d as createPermDock, f as createServerKernel, g as WebBotAuthJwk, h as InvalidSignatureError, i as ProtectOptions, k as ConnectionData, l as ServerPermDockOptions, m as DiscoverViaSignatureAgentOptions, n as OpenApiHooks, o as ServerKernel, p as createEvaluationsHandler, r as OperationScopes, s as ServerKernelOptions, t as Guard, u as SnapshotQuery, v as WebBotAuthKeys, w as verifyWebBotAuth, x as discoverViaSignatureAgent, y as WebBotAuthOptions } from "../create-B1d519XK.js";
8
- import { a as snapshotHeaders, i as cacheLifeFor, n as SnapshotHeaders, o as snapshotTag, r as SnapshotHeadersOptions, t as CacheLifeForOptions } from "../snapshot-cache-B-LxUahj.js";
8
+ import { A as ConnectionOptions, C as verifyWebBotAuth, D as tenantScope, E as TenantScope, O as Connection, S as invalidSignatureResponse, T as TenantOption, _ as WebBotAuthKeys, a as OperationScopes, b as discoverViaSignatureAgent, c as ServerKernel, d as ServerPermDockOptions, f as SnapshotQuery, g as WebBotAuthKeyLookup, h as WebBotAuthJwk, i as OpenApiHooks, k as ConnectionData, l as ServerKernelOptions, m as InvalidSignatureError, n as OnDenied, o as ProtectOptions, p as DiscoverViaSignatureAgentOptions, r as OnDeniedEvent, s as ScopeGuard, t as Guard, u as ServerPermDock, v as WebBotAuthOptions, w as createEvaluationsHandler, x as invalidSignatureProblem, y as WebBotAuthVerifier } from "../server-types-DdqBwZN_.js";
9
+ import { a as snapshotHeaders, i as cacheLifeFor, n as SnapshotHeaders, o as snapshotTag, r as SnapshotHeadersOptions, t as CacheLifeForOptions } from "../snapshot-cache-J5T7t_vD.js";
10
+ //#region src/server/create.d.ts
11
+ export declare function createPermDock<TUser, TPrincipal extends Principal = Principal, V extends PolicyVocabulary = PolicyVocabulary>(policy: Policy<TUser, TPrincipal, V>, options: ServerPermDockOptions<TUser>): ServerPermDock<V>;
12
+ /**
13
+ * The kernel behind every HTTP adapter. The subject and actor are resolved
14
+ * once per `Request`; one instance is cached per `(Request, tenant)`, so a
15
+ * global middleware and a later tenant-scoped `protect` never share a tenant.
16
+ */
17
+ export declare function createServerKernel<TUser, TPrincipal extends Principal = Principal, V extends PolicyVocabulary = PolicyVocabulary>(policy: Policy<TUser, TPrincipal, V>, options: ServerKernelOptions<TUser, V>): ServerKernel<V>;
18
+ //#endregion
9
19
  //#region src/server/credentials.d.ts
10
20
  /** `on('auth')` causes for an API key that resolves to the anonymous subject. */
11
21
  type ApiKeyFailureCause = "malformed" | "unknown-credential" | "invalid-claims" | "expired" | "credential-policy" | "credential-revoked" | "owner-unavailable";
@@ -131,4 +141,4 @@ export declare function problemFromDecision(decision: Decision, permission: Perm
131
141
  readonly scope?: string;
132
142
  }): Response;
133
143
  //#endregion
134
- export { type ApiKeyFailureCause, type ApiKeyParts, type ApiKeySubjectOptions, type ApprovalHint, type CacheLifeForOptions, type Connection, type ConnectionData, type ConnectionOptions, type DiscoverViaSignatureAgentOptions, type Guard, InvalidSignatureError, type MemoryCredentials, type OpenApiHooks, type OperationScopes, PROBLEM_BASE, PermDockApprovalRequiredError, PermDockDeniedError, PermDockRevokedError, PermDockValidationError, type ProblemFromErrorOptions, type ProtectOptions, type RevocationEvent, type RevocationFeed, type ScopeGuard, type ServerKernel, type ServerKernelOptions, type ServerPermDock, type ServerPermDockOptions, type SnapshotHeaders, type SnapshotHeadersOptions, type SnapshotQuery, type StoredCredential, type TenantOption, type TenantScope, type WebBotAuthJwk, type WebBotAuthKeyLookup, type WebBotAuthKeys, type WebBotAuthOptions, type WebBotAuthVerifier, cacheLifeFor, createEvaluationsHandler, createPermDock, createServerKernel, discoverViaSignatureAgent, invalidSignatureProblem, invalidSignatureResponse, memoryRevocationFeed, snapshotHeaders, snapshotTag, tenantScope, verifyWebBotAuth };
144
+ export { type ApiKeyFailureCause, type ApiKeyParts, type ApiKeySubjectOptions, type ApprovalHint, type CacheLifeForOptions, type Connection, type ConnectionData, type ConnectionOptions, type DiscoverViaSignatureAgentOptions, type Guard, InvalidSignatureError, type MemoryCredentials, type OnDenied, type OnDeniedEvent, type OpenApiHooks, type OperationScopes, PROBLEM_BASE, PermDockApprovalRequiredError, PermDockDeniedError, PermDockRevokedError, PermDockValidationError, type ProblemFromErrorOptions, type ProtectOptions, type RequestContext, type RevocationEvent, type RevocationFeed, type ScopeGuard, type ServerKernel, type ServerKernelOptions, type ServerPermDock, type ServerPermDockOptions, type SnapshotHeaders, type SnapshotHeadersOptions, type SnapshotQuery, type StoredCredential, type TenantOption, type TenantScope, type WebBotAuthJwk, type WebBotAuthKeyLookup, type WebBotAuthKeys, type WebBotAuthOptions, type WebBotAuthVerifier, cacheLifeFor, createEvaluationsHandler, discoverViaSignatureAgent, invalidSignatureProblem, invalidSignatureResponse, memoryRevocationFeed, snapshotHeaders, snapshotTag, tenantScope, verifyWebBotAuth };
@@ -1,11 +1,11 @@
1
- import { n as PermDockValidationError, t as PROBLEM_BASE } from "../validation-error-CnjZ4t92.js";
2
- import { n as PermDockDeniedError, r as PermDockRevokedError, t as PermDockApprovalRequiredError } from "../errors-Cz5zn0mW.js";
1
+ import { n as PermDockValidationError, t as PROBLEM_BASE } from "../validation-error-ZfUHbKvf.js";
2
+ import { n as PermDockDeniedError, r as PermDockRevokedError, t as PermDockApprovalRequiredError } from "../errors-drnfxYtm.js";
3
3
  import { t as memoryRevocationFeed } from "../revocations-Bhr0aMIC.js";
4
- import { d as wwwAuthenticate, o as problemFromDecision, s as problemResponse, u as validationProblem } from "../problem-B43ztKIm.js";
5
- import { n as snapshotHeaders, r as snapshotTag, t as cacheLifeFor } from "../snapshot-cache-D6jLelln.js";
6
- import { a as invalidSignatureProblem, i as discoverViaSignatureAgent, n as createEvaluationsHandler, o as invalidSignatureResponse, r as InvalidSignatureError, s as verifyWebBotAuth } from "../evaluations-tz6D9A2G.js";
4
+ import { c as problemResponse, d as validationProblem, f as wwwAuthenticate, s as problemFromDecision } from "../problem-CnWraVhC.js";
5
+ import { n as snapshotHeaders, r as snapshotTag, t as cacheLifeFor } from "../snapshot-cache-Cod40D-X.js";
6
+ import { a as invalidSignatureProblem, i as discoverViaSignatureAgent, n as createEvaluationsHandler, o as invalidSignatureResponse, r as InvalidSignatureError, s as verifyWebBotAuth } from "../evaluations-C9YJsv3H.js";
7
7
  import { n as tenantScope } from "../adapter-context-mlWsVGGg.js";
8
- import { n as createServerKernel, t as createPermDock } from "../create-CMwIl-w2.js";
9
- import { a as parseApiKey, i as memoryCredentials, n as generateApiKey, o as subjectFromApiKey, r as hashApiKey, t as apiKeyVerifier } from "../server-DlZ28Oz5.js";
10
- import { t as problemFromError } from "../map-error-pgUWNNtG.js";
8
+ import { n as createServerKernel, t as createPermDock } from "../create-BBO24vj6.js";
9
+ import { a as parseApiKey, i as memoryCredentials, n as generateApiKey, o as subjectFromApiKey, r as hashApiKey, t as apiKeyVerifier } from "../server-ZYEHtNHS.js";
10
+ import { t as problemFromError } from "../map-error-BE27PYkE.js";
11
11
  export { InvalidSignatureError, PROBLEM_BASE, PermDockApprovalRequiredError, PermDockDeniedError, PermDockRevokedError, PermDockValidationError, apiKeyVerifier, cacheLifeFor, createEvaluationsHandler, createPermDock, createServerKernel, discoverViaSignatureAgent, generateApiKey, hashApiKey, invalidSignatureProblem, invalidSignatureResponse, memoryCredentials, memoryRevocationFeed, parseApiKey, problemFromDecision, problemFromError, problemResponse, snapshotHeaders, snapshotTag, subjectFromApiKey, tenantScope, validationProblem, verifyWebBotAuth, wwwAuthenticate };
@@ -1,9 +1,9 @@
1
- import { t as compact } from "./compact-y6vfu2_f.js";
1
+ import { t as compact } from "./compact-CAf557ZB.js";
2
+ import { n as isThenable } from "./thenable-QSmvt-vZ.js";
2
3
  import { t as bytesToBase64Url } from "./sha256-BO0swRXL.js";
3
- import { n as isThenable } from "./thenable-okc2xDsj.js";
4
4
  import { t as anonymousSubject } from "./subject-C6dLxqHU.js";
5
- import { r as credentialEvent } from "./sink-Bd9PSyfq.js";
6
- import { i as credentialTenant, n as credentialPolicyViolation, o as parseCredential, r as credentialSubject } from "./credential-8P81ff4u.js";
5
+ import { r as credentialEvent } from "./sink-BTtmfPnE.js";
6
+ import { i as credentialTenant, n as credentialPolicyViolation, o as parseCredential, r as credentialSubject } from "./credential-kue0qpbm.js";
7
7
  //#region src/server/credentials.ts
8
8
  const PREFIX = "pdk_";
9
9
  const ID = /^[\w-]{1,128}$/u;
@@ -1,9 +1,11 @@
1
- import { C as Policy, Cr as Actor, D as PolicyVocabulary, Nr as Principal, Pr as Subject, Tt as Snapshot, Yn as Decision, jr as JsonWebKeyLike, ln as PermDock, pn as SnapshotOptions } from "./policy-IB6yxpC3.js";
2
- import { f as Permission } from "./permissions-DttnqqxC.js";
3
- import { f as ApprovalStore } from "./types-aqOHTHcp.js";
4
- import { t as ApprovalHint } from "./errors-DPdqI50v.js";
5
- import { t as InstanceOptions } from "./instance-options-jARdwfPN.js";
6
- import { r as PdpFactory } from "./types-DxiCGmmd.js";
1
+ import { E as Policy, Er as JsonWebKeyLike, Ft as SnapshotOptions, an as Snapshot, ir as Decision, j as PolicyVocabulary, jt as PermDock, kr as Subject, vr as Actor } from "./policy-types-sp9P1iIV.js";
2
+ import { d as Permission } from "./permission-types-Dg39z9Kv.js";
3
+ import { f as ApprovalStore } from "./types-Br9IXUBG.js";
4
+ import { a as ProblemDetails, t as ApprovalHint } from "./errors-OD_4c__H.js";
5
+ import { t as InstanceOptions } from "./instance-options-plkrsAog.js";
6
+ import { t as RequestContext } from "./request-context-C2_1lchh.js";
7
+ import { n as PermDockWrap } from "./wrap-Cr93qqdP.js";
8
+ import { r as PdpFactory } from "./types-CIlTojhq.js";
7
9
  import { n as RevocationFeed } from "./revocations-Cy06JNx2.js";
8
10
  //#region src/server/connection.d.ts
9
11
  type ConnectionData<T> = T | (() => T | null | undefined | Promise<T | null | undefined>);
@@ -28,6 +30,11 @@ type Connection = {
28
30
  readonly trusted?: boolean;
29
31
  }) => Decision;
30
32
  readonly filter: <T>(permission: Permission<string, T, "instance">, items: readonly T[]) => T[];
33
+ /**
34
+ * Resolves once every revalidation queued so far has finished, so a message
35
+ * checked after a revocation event is checked against the rebuilt instance.
36
+ */
37
+ readonly settled: () => Promise<void>;
31
38
  /** Stops timers and the feed subscription. Call it when the transport closes. */
32
39
  readonly close: () => void;
33
40
  };
@@ -44,6 +51,22 @@ type TenantOption<TContext> = string | ((context: TContext) => string | undefine
44
51
  /** Resolves an adapter `tenant` option against its framework context; a throw is no tenant. */
45
52
  declare function tenantScope<TContext>(option: TenantOption<TContext> | undefined, context: TContext): Promise<TenantScope>;
46
53
  //#endregion
54
+ //#region src/server/evaluations.d.ts
55
+ declare function createEvaluationsHandler(options: {
56
+ readonly policy: Policy;
57
+ readonly resolve?: (request: Request) => Promise<PermDock>;
58
+ readonly getPermDock?: (query?: {
59
+ readonly tenant?: string;
60
+ }) => Promise<PermDock>;
61
+ readonly store?: ApprovalStore;
62
+ readonly adapter?: string;
63
+ /** The most evaluations one POST may carry; a larger batch is a 413 before any instance is resolved. */
64
+ readonly maxEvaluations?: number;
65
+ }): {
66
+ readonly POST: (request: Request) => Promise<Response>;
67
+ readonly GET: (request: Request) => Promise<Response>;
68
+ };
69
+ //#endregion
47
70
  //#region src/server/web-bot-auth.d.ts
48
71
  type WebBotAuthJwk = JsonWebKeyLike & {
49
72
  readonly kid?: string;
@@ -84,23 +107,7 @@ declare function invalidSignatureProblem(detail: string): Response;
84
107
  declare function discoverViaSignatureAgent(options: DiscoverViaSignatureAgentOptions): WebBotAuthKeys;
85
108
  declare function verifyWebBotAuth(request: Request, options: WebBotAuthOptions | undefined): Promise<Actor | undefined>;
86
109
  //#endregion
87
- //#region src/server/evaluations.d.ts
88
- declare function createEvaluationsHandler(options: {
89
- readonly policy: Policy;
90
- readonly resolve?: (request: Request) => Promise<PermDock>;
91
- readonly getPermDock?: (query?: {
92
- readonly tenant?: string;
93
- }) => Promise<PermDock>;
94
- readonly store?: ApprovalStore;
95
- readonly adapter?: string;
96
- /** The most evaluations one POST may carry; a larger batch is a 413 before any instance is resolved. */
97
- readonly maxEvaluations?: number;
98
- }): {
99
- readonly POST: (request: Request) => Promise<Response>;
100
- readonly GET: (request: Request) => Promise<Response>;
101
- };
102
- //#endregion
103
- //#region src/server/create.d.ts
110
+ //#region src/server/server-types.d.ts
104
111
  type ServerPermDockOptions<TUser = unknown> = InstanceOptions & {
105
112
  /** The user, or a full `Subject` (core then skips `policy.subject`); `null` is anonymous. */
106
113
  readonly subject: (request: Request) => TUser | Subject | null | Promise<TUser | Subject | null>;
@@ -120,7 +127,31 @@ type ServerPermDockOptions<TUser = unknown> = InstanceOptions & {
120
127
  /** Added as `approval` to every `approval-required` problem. */
121
128
  readonly approval?: ApprovalHint;
122
129
  readonly operations?: OperationScopes;
130
+ /**
131
+ * Replaces the response of a refused guard. A status below 300, or a
132
+ * throw, keeps the default response and reports through `on('error')`.
133
+ */
134
+ readonly onDenied?: OnDenied;
135
+ /**
136
+ * Request values merged into `subject.context`, under `policy.context`.
137
+ * Only values the server derived belong here, never client input. A throw
138
+ * or a value that is not a JSON object adds nothing and reports through
139
+ * `on('error')`.
140
+ */
141
+ readonly context?: (request: Request) => RequestContext | undefined | Promise<RequestContext | undefined>;
142
+ /** Wraps each instance the kernel builds; build it with `wrapPermDock` to cover derived instances. */
143
+ readonly wrap?: PermDockWrap;
144
+ };
145
+ /** What `onDenied` receives: the refusal and the default Problem Details for it. */
146
+ type OnDeniedEvent = {
147
+ readonly decision: Exclude<Decision, {
148
+ readonly outcome: "granted";
149
+ }>;
150
+ readonly problem: ProblemDetails;
151
+ readonly request: Request | undefined;
123
152
  };
153
+ /** Returns Problem Details with extra members, a `Response`, or nothing for the default. */
154
+ type OnDenied = (event: OnDeniedEvent) => ProblemDetails | Response | undefined | Promise<ProblemDetails | Response | undefined>;
124
155
  type OperationScopes = {
125
156
  oauthScopesForRequest(method: string, path: string): readonly string[] | undefined;
126
157
  };
@@ -134,6 +165,10 @@ type Guard<T = unknown, V extends PolicyVocabulary = PolicyVocabulary> = {
134
165
  } | {
135
166
  readonly ok: false;
136
167
  readonly response: Response;
168
+ /** The refusal behind `response`; absent for a missing row or a bad signature. */
169
+ readonly decision?: Exclude<Decision, {
170
+ readonly outcome: "granted";
171
+ }>;
137
172
  };
138
173
  /**
139
174
  * What `protect(null, …)` resolves to: the route declares OAuth scopes and no
@@ -147,6 +182,10 @@ type ScopeGuard<T = unknown, V extends PolicyVocabulary = PolicyVocabulary> = {
147
182
  } | {
148
183
  readonly ok: false;
149
184
  readonly response: Response;
185
+ /** The refusal behind `response`; absent for a missing row or a bad signature. */
186
+ readonly decision?: Exclude<Decision, {
187
+ readonly outcome: "granted";
188
+ }>;
150
189
  };
151
190
  type Loader<T> = (request: Request) => T | null | undefined | Promise<T | null | undefined>;
152
191
  /**
@@ -179,9 +218,13 @@ type ProtectOptions = {
179
218
  * for the request. Required, here or there, for `protect(null)`.
180
219
  */
181
220
  readonly oauthScopes?: readonly string[];
221
+ /** The field being read or written; only grants whose `fields` cover it match. */
222
+ readonly field?: string;
223
+ /** Adds the evaluation `trace` to the guard's decision. */
224
+ readonly explain?: boolean;
182
225
  };
183
- type ServerKernelOptions<TUser, V extends PolicyVocabulary = PolicyVocabulary> = ServerPermDockOptions<TUser> & {
184
- /** Wraps each instance the kernel builds, as `withOtel` does. */
226
+ type ServerKernelOptions<TUser, V extends PolicyVocabulary = PolicyVocabulary> = Omit<ServerPermDockOptions<TUser>, "wrap"> & {
227
+ /** Wraps each instance the kernel builds: `otel`, then the adapter's `wrap`. */
185
228
  readonly wrap?: (permdock: PermDock<V>) => PermDock<V>;
186
229
  /** The `adapter` label on decision events, revocations and approvals. Defaults to `server`. */
187
230
  readonly adapter?: string;
@@ -234,12 +277,5 @@ type ServerPermDock<V extends PolicyVocabulary = PolicyVocabulary> = {
234
277
  readonly openapi: OpenApiHooks;
235
278
  readonly permdockHandler: () => ReturnType<typeof createEvaluationsHandler>;
236
279
  };
237
- declare function createPermDock<TUser, TPrincipal extends Principal = Principal, V extends PolicyVocabulary = PolicyVocabulary>(policy: Policy<TUser, TPrincipal, V>, options: ServerPermDockOptions<TUser>): ServerPermDock<V>;
238
- /**
239
- * The kernel behind every HTTP adapter. The subject and actor are resolved
240
- * once per `Request`; one instance is cached per `(Request, tenant)`, so a
241
- * global middleware and a later tenant-scoped `protect` never share a tenant.
242
- */
243
- declare function createServerKernel<TUser, TPrincipal extends Principal = Principal, V extends PolicyVocabulary = PolicyVocabulary>(policy: Policy<TUser, TPrincipal, V>, options: ServerKernelOptions<TUser, V>): ServerKernel<V>;
244
280
  //#endregion
245
- export { ConnectionOptions as A, invalidSignatureResponse as C, tenantScope as D, TenantScope as E, Connection as O, invalidSignatureProblem as S, TenantOption as T, WebBotAuthKeyLookup as _, ScopeGuard as a, WebBotAuthVerifier as b, ServerPermDock as c, createPermDock as d, createServerKernel as f, WebBotAuthJwk as g, InvalidSignatureError as h, ProtectOptions as i, ConnectionData as k, ServerPermDockOptions as l, DiscoverViaSignatureAgentOptions as m, OpenApiHooks as n, ServerKernel as o, createEvaluationsHandler as p, OperationScopes as r, ServerKernelOptions as s, Guard as t, SnapshotQuery as u, WebBotAuthKeys as v, verifyWebBotAuth as w, discoverViaSignatureAgent as x, WebBotAuthOptions as y };
281
+ export { ConnectionOptions as A, verifyWebBotAuth as C, tenantScope as D, TenantScope as E, Connection as O, invalidSignatureResponse as S, TenantOption as T, WebBotAuthKeys as _, OperationScopes as a, discoverViaSignatureAgent as b, ServerKernel as c, ServerPermDockOptions as d, SnapshotQuery as f, WebBotAuthKeyLookup as g, WebBotAuthJwk as h, OpenApiHooks as i, ConnectionData as k, ServerKernelOptions as l, InvalidSignatureError as m, OnDenied as n, ProtectOptions as o, DiscoverViaSignatureAgentOptions as p, OnDeniedEvent as r, ScopeGuard as s, Guard as t, ServerPermDock as u, WebBotAuthOptions as v, createEvaluationsHandler as w, invalidSignatureProblem as x, WebBotAuthVerifier as y };