@fuzdev/fuz_app 0.51.0 → 0.53.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 (395) hide show
  1. package/dist/actions/CLAUDE.md +43 -10
  2. package/dist/actions/action_bridge.d.ts +3 -1
  3. package/dist/actions/action_bridge.d.ts.map +1 -1
  4. package/dist/actions/action_bridge.js +3 -1
  5. package/dist/actions/action_codegen.d.ts +28 -43
  6. package/dist/actions/action_codegen.d.ts.map +1 -1
  7. package/dist/actions/action_codegen.js +31 -50
  8. package/dist/actions/action_event.d.ts +44 -1
  9. package/dist/actions/action_event.d.ts.map +1 -1
  10. package/dist/actions/action_event.js +44 -1
  11. package/dist/actions/action_event_helpers.d.ts +26 -0
  12. package/dist/actions/action_event_helpers.d.ts.map +1 -1
  13. package/dist/actions/action_event_helpers.js +26 -1
  14. package/dist/actions/action_peer.d.ts +17 -0
  15. package/dist/actions/action_peer.d.ts.map +1 -1
  16. package/dist/actions/action_peer.js +8 -9
  17. package/dist/actions/action_registry.d.ts +1 -5
  18. package/dist/actions/action_registry.d.ts.map +1 -1
  19. package/dist/actions/action_registry.js +5 -11
  20. package/dist/actions/action_rpc.d.ts +20 -0
  21. package/dist/actions/action_rpc.d.ts.map +1 -1
  22. package/dist/actions/action_rpc.js +45 -20
  23. package/dist/actions/action_spec.d.ts +75 -6
  24. package/dist/actions/action_spec.d.ts.map +1 -1
  25. package/dist/actions/action_spec.js +36 -6
  26. package/dist/actions/frontend_rpc_client.d.ts +1 -9
  27. package/dist/actions/frontend_rpc_client.d.ts.map +1 -1
  28. package/dist/actions/frontend_rpc_client.js +1 -9
  29. package/dist/actions/register_action_ws.d.ts +19 -0
  30. package/dist/actions/register_action_ws.d.ts.map +1 -1
  31. package/dist/actions/register_action_ws.js +44 -1
  32. package/dist/actions/register_ws_endpoint.d.ts +3 -0
  33. package/dist/actions/register_ws_endpoint.d.ts.map +1 -1
  34. package/dist/actions/register_ws_endpoint.js +3 -0
  35. package/dist/actions/request_tracker.svelte.d.ts +24 -16
  36. package/dist/actions/request_tracker.svelte.d.ts.map +1 -1
  37. package/dist/actions/request_tracker.svelte.js +24 -16
  38. package/dist/actions/rpc_client.d.ts +0 -1
  39. package/dist/actions/rpc_client.d.ts.map +1 -1
  40. package/dist/actions/rpc_client.js +3 -17
  41. package/dist/actions/socket.svelte.d.ts +35 -16
  42. package/dist/actions/socket.svelte.d.ts.map +1 -1
  43. package/dist/actions/socket.svelte.js +33 -14
  44. package/dist/actions/transports.d.ts +15 -5
  45. package/dist/actions/transports.d.ts.map +1 -1
  46. package/dist/actions/transports.js +15 -15
  47. package/dist/actions/transports_http.d.ts +7 -0
  48. package/dist/actions/transports_http.d.ts.map +1 -1
  49. package/dist/actions/transports_http.js +7 -0
  50. package/dist/actions/transports_ws.d.ts +13 -0
  51. package/dist/actions/transports_ws.d.ts.map +1 -1
  52. package/dist/actions/transports_ws.js +13 -0
  53. package/dist/actions/transports_ws_auth_guard.d.ts +6 -4
  54. package/dist/actions/transports_ws_auth_guard.d.ts.map +1 -1
  55. package/dist/actions/transports_ws_auth_guard.js +6 -4
  56. package/dist/actions/transports_ws_backend.d.ts +14 -1
  57. package/dist/actions/transports_ws_backend.d.ts.map +1 -1
  58. package/dist/actions/transports_ws_backend.js +14 -10
  59. package/dist/auth/CLAUDE.md +64 -18
  60. package/dist/auth/account_queries.d.ts +7 -0
  61. package/dist/auth/account_queries.d.ts.map +1 -1
  62. package/dist/auth/account_queries.js +7 -0
  63. package/dist/auth/admin_action_specs.d.ts +5 -0
  64. package/dist/auth/admin_action_specs.d.ts.map +1 -1
  65. package/dist/auth/admin_action_specs.js +5 -0
  66. package/dist/auth/admin_actions.d.ts +1 -0
  67. package/dist/auth/admin_actions.d.ts.map +1 -1
  68. package/dist/auth/admin_actions.js +1 -0
  69. package/dist/auth/api_token_queries.d.ts +6 -0
  70. package/dist/auth/api_token_queries.d.ts.map +1 -1
  71. package/dist/auth/api_token_queries.js +6 -0
  72. package/dist/auth/app_settings_queries.d.ts +4 -0
  73. package/dist/auth/app_settings_queries.d.ts.map +1 -1
  74. package/dist/auth/app_settings_queries.js +4 -0
  75. package/dist/auth/audit_log_queries.d.ts +5 -0
  76. package/dist/auth/audit_log_queries.d.ts.map +1 -1
  77. package/dist/auth/audit_log_queries.js +5 -0
  78. package/dist/auth/audit_log_routes.d.ts +2 -2
  79. package/dist/auth/audit_log_routes.js +2 -2
  80. package/dist/auth/audit_log_schema.d.ts +2 -0
  81. package/dist/auth/audit_log_schema.d.ts.map +1 -1
  82. package/dist/auth/audit_log_schema.js +134 -55
  83. package/dist/auth/bearer_auth.d.ts +2 -0
  84. package/dist/auth/bearer_auth.d.ts.map +1 -1
  85. package/dist/auth/bearer_auth.js +2 -0
  86. package/dist/auth/bootstrap_account.d.ts +3 -0
  87. package/dist/auth/bootstrap_account.d.ts.map +1 -1
  88. package/dist/auth/bootstrap_account.js +3 -0
  89. package/dist/auth/cleanup.d.ts +6 -0
  90. package/dist/auth/cleanup.d.ts.map +1 -1
  91. package/dist/auth/cleanup.js +6 -0
  92. package/dist/auth/daemon_token_middleware.d.ts +4 -0
  93. package/dist/auth/daemon_token_middleware.d.ts.map +1 -1
  94. package/dist/auth/daemon_token_middleware.js +4 -0
  95. package/dist/auth/invite_queries.d.ts +3 -0
  96. package/dist/auth/invite_queries.d.ts.map +1 -1
  97. package/dist/auth/invite_queries.js +3 -0
  98. package/dist/auth/permit_offer_action_specs.d.ts +6 -0
  99. package/dist/auth/permit_offer_action_specs.d.ts.map +1 -1
  100. package/dist/auth/permit_offer_action_specs.js +11 -0
  101. package/dist/auth/permit_offer_queries.d.ts +18 -0
  102. package/dist/auth/permit_offer_queries.d.ts.map +1 -1
  103. package/dist/auth/permit_offer_queries.js +18 -0
  104. package/dist/auth/permit_queries.d.ts +7 -0
  105. package/dist/auth/permit_queries.d.ts.map +1 -1
  106. package/dist/auth/permit_queries.js +7 -0
  107. package/dist/auth/request_context.d.ts +1 -0
  108. package/dist/auth/request_context.d.ts.map +1 -1
  109. package/dist/auth/request_context.js +1 -0
  110. package/dist/auth/role_schema.d.ts +2 -0
  111. package/dist/auth/role_schema.d.ts.map +1 -1
  112. package/dist/auth/role_schema.js +2 -0
  113. package/dist/auth/self_service_role_actions.d.ts +1 -0
  114. package/dist/auth/self_service_role_actions.d.ts.map +1 -1
  115. package/dist/auth/self_service_role_actions.js +1 -0
  116. package/dist/auth/session_lifecycle.d.ts +2 -0
  117. package/dist/auth/session_lifecycle.d.ts.map +1 -1
  118. package/dist/auth/session_lifecycle.js +2 -0
  119. package/dist/auth/session_middleware.d.ts +1 -0
  120. package/dist/auth/session_middleware.d.ts.map +1 -1
  121. package/dist/auth/session_middleware.js +1 -0
  122. package/dist/auth/session_queries.d.ts +9 -0
  123. package/dist/auth/session_queries.d.ts.map +1 -1
  124. package/dist/auth/session_queries.js +9 -0
  125. package/dist/cli/config.d.ts +1 -2
  126. package/dist/cli/config.d.ts.map +1 -1
  127. package/dist/cli/config.js +1 -2
  128. package/dist/cli/daemon.d.ts +6 -1
  129. package/dist/cli/daemon.d.ts.map +1 -1
  130. package/dist/cli/daemon.js +6 -1
  131. package/dist/db/assert_row.d.ts +2 -1
  132. package/dist/db/assert_row.d.ts.map +1 -1
  133. package/dist/db/assert_row.js +2 -1
  134. package/dist/db/create_db.d.ts +3 -1
  135. package/dist/db/create_db.d.ts.map +1 -1
  136. package/dist/db/create_db.js +3 -1
  137. package/dist/db/db.d.ts +15 -4
  138. package/dist/db/db.d.ts.map +1 -1
  139. package/dist/db/db.js +14 -3
  140. package/dist/db/db_pg.d.ts +4 -3
  141. package/dist/db/db_pg.d.ts.map +1 -1
  142. package/dist/db/db_pg.js +7 -5
  143. package/dist/db/db_pglite.d.ts +4 -4
  144. package/dist/db/db_pglite.js +4 -4
  145. package/dist/db/migrate.d.ts +7 -4
  146. package/dist/db/migrate.d.ts.map +1 -1
  147. package/dist/db/migrate.js +5 -2
  148. package/dist/db/sql_identifier.d.ts +2 -1
  149. package/dist/db/sql_identifier.d.ts.map +1 -1
  150. package/dist/db/sql_identifier.js +2 -1
  151. package/dist/db/status.d.ts +4 -1
  152. package/dist/db/status.d.ts.map +1 -1
  153. package/dist/db/status.js +5 -2
  154. package/dist/dev/setup.d.ts +15 -2
  155. package/dist/dev/setup.d.ts.map +1 -1
  156. package/dist/dev/setup.js +15 -2
  157. package/dist/env/dotenv.d.ts +2 -1
  158. package/dist/env/dotenv.d.ts.map +1 -1
  159. package/dist/env/dotenv.js +2 -1
  160. package/dist/env/load.d.ts +1 -3
  161. package/dist/env/load.d.ts.map +1 -1
  162. package/dist/env/load.js +1 -3
  163. package/dist/env/resolve.d.ts +1 -1
  164. package/dist/env/resolve.js +1 -1
  165. package/dist/env/update_env_variable.d.ts +2 -0
  166. package/dist/env/update_env_variable.d.ts.map +1 -1
  167. package/dist/env/update_env_variable.js +2 -0
  168. package/dist/hono_context.d.ts +2 -5
  169. package/dist/hono_context.d.ts.map +1 -1
  170. package/dist/hono_context.js +2 -5
  171. package/dist/http/common_routes.d.ts +0 -8
  172. package/dist/http/common_routes.d.ts.map +1 -1
  173. package/dist/http/common_routes.js +0 -8
  174. package/dist/http/db_routes.d.ts +0 -3
  175. package/dist/http/db_routes.d.ts.map +1 -1
  176. package/dist/http/db_routes.js +0 -3
  177. package/dist/http/error_schemas.d.ts +12 -11
  178. package/dist/http/error_schemas.d.ts.map +1 -1
  179. package/dist/http/error_schemas.js +11 -7
  180. package/dist/http/jsonrpc_errors.d.ts +0 -6
  181. package/dist/http/jsonrpc_errors.d.ts.map +1 -1
  182. package/dist/http/jsonrpc_errors.js +0 -6
  183. package/dist/http/origin.d.ts +6 -13
  184. package/dist/http/origin.d.ts.map +1 -1
  185. package/dist/http/origin.js +7 -14
  186. package/dist/http/pending_effects.d.ts +4 -0
  187. package/dist/http/pending_effects.d.ts.map +1 -1
  188. package/dist/http/pending_effects.js +4 -0
  189. package/dist/http/proxy.d.ts +3 -6
  190. package/dist/http/proxy.d.ts.map +1 -1
  191. package/dist/http/proxy.js +3 -6
  192. package/dist/http/route_spec.d.ts +14 -35
  193. package/dist/http/route_spec.d.ts.map +1 -1
  194. package/dist/http/route_spec.js +17 -22
  195. package/dist/http/schema_helpers.d.ts +0 -4
  196. package/dist/http/schema_helpers.d.ts.map +1 -1
  197. package/dist/http/schema_helpers.js +0 -4
  198. package/dist/http/surface.d.ts +2 -12
  199. package/dist/http/surface.d.ts.map +1 -1
  200. package/dist/http/surface.js +1 -12
  201. package/dist/rate_limiter.d.ts +30 -1
  202. package/dist/rate_limiter.d.ts.map +1 -1
  203. package/dist/rate_limiter.js +40 -1
  204. package/dist/realtime/sse.d.ts +7 -2
  205. package/dist/realtime/sse.d.ts.map +1 -1
  206. package/dist/realtime/sse.js +3 -2
  207. package/dist/realtime/sse_auth_guard.d.ts +21 -21
  208. package/dist/realtime/sse_auth_guard.d.ts.map +1 -1
  209. package/dist/realtime/sse_auth_guard.js +24 -24
  210. package/dist/realtime/subscriber_registry.d.ts +4 -5
  211. package/dist/realtime/subscriber_registry.d.ts.map +1 -1
  212. package/dist/realtime/subscriber_registry.js +4 -5
  213. package/dist/runtime/fs.d.ts +5 -3
  214. package/dist/runtime/fs.d.ts.map +1 -1
  215. package/dist/runtime/fs.js +5 -3
  216. package/dist/runtime/mock.d.ts +6 -3
  217. package/dist/runtime/mock.d.ts.map +1 -1
  218. package/dist/runtime/mock.js +6 -3
  219. package/dist/server/app_backend.d.ts +1 -0
  220. package/dist/server/app_backend.d.ts.map +1 -1
  221. package/dist/server/app_backend.js +1 -0
  222. package/dist/server/app_server.d.ts +31 -5
  223. package/dist/server/app_server.d.ts.map +1 -1
  224. package/dist/server/app_server.js +23 -7
  225. package/dist/server/startup.d.ts +0 -2
  226. package/dist/server/startup.d.ts.map +1 -1
  227. package/dist/server/startup.js +0 -2
  228. package/dist/server/static.d.ts +0 -1
  229. package/dist/server/static.d.ts.map +1 -1
  230. package/dist/server/static.js +0 -1
  231. package/dist/server/validate_nginx.d.ts +3 -3
  232. package/dist/server/validate_nginx.d.ts.map +1 -1
  233. package/dist/server/validate_nginx.js +0 -3
  234. package/dist/testing/CLAUDE.md +1 -1
  235. package/dist/testing/admin_integration.d.ts +5 -1
  236. package/dist/testing/admin_integration.d.ts.map +1 -1
  237. package/dist/testing/admin_integration.js +8 -6
  238. package/dist/testing/adversarial_404.d.ts +0 -2
  239. package/dist/testing/adversarial_404.d.ts.map +1 -1
  240. package/dist/testing/adversarial_404.js +0 -2
  241. package/dist/testing/adversarial_headers.d.ts +5 -4
  242. package/dist/testing/adversarial_headers.d.ts.map +1 -1
  243. package/dist/testing/adversarial_headers.js +5 -4
  244. package/dist/testing/adversarial_input.d.ts +4 -2
  245. package/dist/testing/adversarial_input.d.ts.map +1 -1
  246. package/dist/testing/adversarial_input.js +4 -2
  247. package/dist/testing/app_server.d.ts +25 -0
  248. package/dist/testing/app_server.d.ts.map +1 -1
  249. package/dist/testing/app_server.js +11 -2
  250. package/dist/testing/assertions.d.ts +23 -11
  251. package/dist/testing/assertions.d.ts.map +1 -1
  252. package/dist/testing/assertions.js +23 -11
  253. package/dist/testing/attack_surface.d.ts +0 -4
  254. package/dist/testing/attack_surface.d.ts.map +1 -1
  255. package/dist/testing/attack_surface.js +0 -4
  256. package/dist/testing/audit_completeness.d.ts +4 -1
  257. package/dist/testing/audit_completeness.d.ts.map +1 -1
  258. package/dist/testing/audit_completeness.js +4 -1
  259. package/dist/testing/auth_apps.d.ts +5 -10
  260. package/dist/testing/auth_apps.d.ts.map +1 -1
  261. package/dist/testing/auth_apps.js +5 -10
  262. package/dist/testing/data_exposure.d.ts +0 -11
  263. package/dist/testing/data_exposure.d.ts.map +1 -1
  264. package/dist/testing/data_exposure.js +0 -11
  265. package/dist/testing/db.d.ts +9 -7
  266. package/dist/testing/db.d.ts.map +1 -1
  267. package/dist/testing/db.js +9 -7
  268. package/dist/testing/error_coverage.d.ts +9 -14
  269. package/dist/testing/error_coverage.d.ts.map +1 -1
  270. package/dist/testing/error_coverage.js +9 -14
  271. package/dist/testing/integration.d.ts +4 -1
  272. package/dist/testing/integration.d.ts.map +1 -1
  273. package/dist/testing/integration.js +4 -1
  274. package/dist/testing/integration_helpers.d.ts +5 -34
  275. package/dist/testing/integration_helpers.d.ts.map +1 -1
  276. package/dist/testing/integration_helpers.js +5 -41
  277. package/dist/testing/middleware.d.ts +5 -10
  278. package/dist/testing/middleware.d.ts.map +1 -1
  279. package/dist/testing/middleware.js +5 -10
  280. package/dist/testing/mock_fs.d.ts +0 -2
  281. package/dist/testing/mock_fs.d.ts.map +1 -1
  282. package/dist/testing/mock_fs.js +0 -2
  283. package/dist/testing/rate_limiting.d.ts +3 -1
  284. package/dist/testing/rate_limiting.d.ts.map +1 -1
  285. package/dist/testing/rate_limiting.js +3 -1
  286. package/dist/testing/round_trip.d.ts +0 -2
  287. package/dist/testing/round_trip.d.ts.map +1 -1
  288. package/dist/testing/round_trip.js +0 -2
  289. package/dist/testing/rpc_attack_surface.d.ts +0 -2
  290. package/dist/testing/rpc_attack_surface.d.ts.map +1 -1
  291. package/dist/testing/rpc_attack_surface.js +0 -2
  292. package/dist/testing/rpc_helpers.d.ts +21 -14
  293. package/dist/testing/rpc_helpers.d.ts.map +1 -1
  294. package/dist/testing/rpc_helpers.js +21 -14
  295. package/dist/testing/rpc_round_trip.d.ts +0 -2
  296. package/dist/testing/rpc_round_trip.d.ts.map +1 -1
  297. package/dist/testing/rpc_round_trip.js +0 -2
  298. package/dist/testing/schema_generators.d.ts +5 -3
  299. package/dist/testing/schema_generators.d.ts.map +1 -1
  300. package/dist/testing/schema_generators.js +22 -3
  301. package/dist/testing/sse_round_trip.d.ts +3 -1
  302. package/dist/testing/sse_round_trip.d.ts.map +1 -1
  303. package/dist/testing/sse_round_trip.js +3 -1
  304. package/dist/testing/standard.d.ts +0 -2
  305. package/dist/testing/standard.d.ts.map +1 -1
  306. package/dist/testing/standard.js +0 -2
  307. package/dist/testing/stubs.d.ts +8 -3
  308. package/dist/testing/stubs.d.ts.map +1 -1
  309. package/dist/testing/stubs.js +10 -3
  310. package/dist/testing/surface_invariants.d.ts +14 -3
  311. package/dist/testing/surface_invariants.d.ts.map +1 -1
  312. package/dist/testing/surface_invariants.js +14 -3
  313. package/dist/testing/ws_round_trip.d.ts +13 -1
  314. package/dist/testing/ws_round_trip.d.ts.map +1 -1
  315. package/dist/ui/AccountSessions.svelte +9 -0
  316. package/dist/ui/AccountSessions.svelte.d.ts.map +1 -1
  317. package/dist/ui/AdminAccounts.svelte +10 -0
  318. package/dist/ui/AdminAccounts.svelte.d.ts.map +1 -1
  319. package/dist/ui/AdminAuditLog.svelte +10 -0
  320. package/dist/ui/AdminAuditLog.svelte.d.ts.map +1 -1
  321. package/dist/ui/AdminInvites.svelte +9 -0
  322. package/dist/ui/AdminInvites.svelte.d.ts.map +1 -1
  323. package/dist/ui/AdminOverview.svelte +10 -0
  324. package/dist/ui/AdminOverview.svelte.d.ts.map +1 -1
  325. package/dist/ui/AdminPermitHistory.svelte +9 -0
  326. package/dist/ui/AdminPermitHistory.svelte.d.ts.map +1 -1
  327. package/dist/ui/AdminSessions.svelte +10 -0
  328. package/dist/ui/AdminSessions.svelte.d.ts.map +1 -1
  329. package/dist/ui/AdminSettings.svelte +9 -0
  330. package/dist/ui/AdminSettings.svelte.d.ts.map +1 -1
  331. package/dist/ui/AdminSurface.svelte +9 -0
  332. package/dist/ui/AdminSurface.svelte.d.ts.map +1 -1
  333. package/dist/ui/AppShell.svelte +24 -0
  334. package/dist/ui/AppShell.svelte.d.ts +23 -0
  335. package/dist/ui/AppShell.svelte.d.ts.map +1 -1
  336. package/dist/ui/BootstrapForm.svelte +17 -0
  337. package/dist/ui/BootstrapForm.svelte.d.ts +4 -0
  338. package/dist/ui/BootstrapForm.svelte.d.ts.map +1 -1
  339. package/dist/ui/CLAUDE.md +1 -1
  340. package/dist/ui/ColumnLayout.svelte +11 -0
  341. package/dist/ui/ColumnLayout.svelte.d.ts +10 -0
  342. package/dist/ui/ColumnLayout.svelte.d.ts.map +1 -1
  343. package/dist/ui/Datatable.svelte +18 -0
  344. package/dist/ui/Datatable.svelte.d.ts +17 -0
  345. package/dist/ui/Datatable.svelte.d.ts.map +1 -1
  346. package/dist/ui/LoginForm.svelte +18 -0
  347. package/dist/ui/LoginForm.svelte.d.ts +9 -0
  348. package/dist/ui/LoginForm.svelte.d.ts.map +1 -1
  349. package/dist/ui/LogoutButton.svelte +9 -0
  350. package/dist/ui/LogoutButton.svelte.d.ts +8 -0
  351. package/dist/ui/LogoutButton.svelte.d.ts.map +1 -1
  352. package/dist/ui/MenuLink.svelte +10 -0
  353. package/dist/ui/MenuLink.svelte.d.ts +9 -0
  354. package/dist/ui/MenuLink.svelte.d.ts.map +1 -1
  355. package/dist/ui/OpenSignupToggle.svelte +9 -0
  356. package/dist/ui/OpenSignupToggle.svelte.d.ts.map +1 -1
  357. package/dist/ui/SignupForm.svelte +16 -0
  358. package/dist/ui/SignupForm.svelte.d.ts +4 -0
  359. package/dist/ui/SignupForm.svelte.d.ts.map +1 -1
  360. package/dist/ui/SurfaceExplorer.svelte +9 -0
  361. package/dist/ui/SurfaceExplorer.svelte.d.ts.map +1 -1
  362. package/dist/ui/audit_log_state.svelte.d.ts +6 -1
  363. package/dist/ui/audit_log_state.svelte.d.ts.map +1 -1
  364. package/dist/ui/audit_log_state.svelte.js +7 -2
  365. package/dist/ui/auth_state.svelte.d.ts +16 -4
  366. package/dist/ui/auth_state.svelte.d.ts.map +1 -1
  367. package/dist/ui/auth_state.svelte.js +16 -4
  368. package/dist/ui/form_state.svelte.d.ts +9 -0
  369. package/dist/ui/form_state.svelte.d.ts.map +1 -1
  370. package/dist/ui/form_state.svelte.js +9 -0
  371. package/dist/ui/loadable.svelte.d.ts +6 -1
  372. package/dist/ui/loadable.svelte.d.ts.map +1 -1
  373. package/dist/ui/loadable.svelte.js +6 -1
  374. package/dist/ui/permit_offers_state.svelte.d.ts +2 -0
  375. package/dist/ui/permit_offers_state.svelte.d.ts.map +1 -1
  376. package/dist/ui/permit_offers_state.svelte.js +2 -0
  377. package/dist/ui/popover.svelte.d.ts +17 -4
  378. package/dist/ui/popover.svelte.d.ts.map +1 -1
  379. package/dist/ui/popover.svelte.js +17 -4
  380. package/dist/ui/position_helpers.d.ts +1 -3
  381. package/dist/ui/position_helpers.d.ts.map +1 -1
  382. package/dist/ui/position_helpers.js +1 -3
  383. package/dist/ui/sidebar_state.svelte.d.ts +21 -9
  384. package/dist/ui/sidebar_state.svelte.d.ts.map +1 -1
  385. package/dist/ui/sidebar_state.svelte.js +16 -2
  386. package/dist/ui/table_state.svelte.d.ts +14 -0
  387. package/dist/ui/table_state.svelte.d.ts.map +1 -1
  388. package/dist/ui/table_state.svelte.js +14 -0
  389. package/dist/ui/ui_fetch.d.ts +1 -7
  390. package/dist/ui/ui_fetch.d.ts.map +1 -1
  391. package/dist/ui/ui_fetch.js +1 -7
  392. package/dist/ui/ui_format.d.ts +2 -14
  393. package/dist/ui/ui_format.d.ts.map +1 -1
  394. package/dist/ui/ui_format.js +2 -14
  395. package/package.json +2 -2
@@ -56,7 +56,7 @@ export declare const resolve_env_vars_in_object: <T extends Record<string, unkno
56
56
  * @param value - string with `$$VAR$$` references
57
57
  * @param context - description for error message (e.g., `"target.host"`)
58
58
  * @returns resolved string
59
- * @throws error if any referenced env var is missing or empty
59
+ * @throws Error if any referenced env var is missing or empty
60
60
  */
61
61
  export declare const resolve_env_vars_required: (runtime: Pick<EnvDeps, "env_get">, value: string, context: string) => string;
62
62
  /**
@@ -85,7 +85,7 @@ export const resolve_env_vars_in_object = (runtime, obj) => {
85
85
  * @param value - string with `$$VAR$$` references
86
86
  * @param context - description for error message (e.g., `"target.host"`)
87
87
  * @returns resolved string
88
- * @throws error if any referenced env var is missing or empty
88
+ * @throws Error if any referenced env var is missing or empty
89
89
  */
90
90
  export const resolve_env_vars_required = (runtime, value, context) => {
91
91
  const missing = [];
@@ -31,6 +31,8 @@ export interface UpdateEnvVariableOptions {
31
31
  * @param key - the environment variable name (e.g., `'SOME_CONFIGURATION_KEY'`)
32
32
  * @param value - the new value for the environment variable
33
33
  * @param options - file path and optional read/write overrides
34
+ * @mutates filesystem - writes the updated content back to `options.env_file_path`
35
+ * @throws Error if the file read fails for any reason other than `ENOENT`, or if the write fails
34
36
  */
35
37
  export declare const update_env_variable: (key: string, value: string, options: UpdateEnvVariableOptions) => Promise<void>;
36
38
  //# sourceMappingURL=update_env_variable.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"update_env_variable.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/env/update_env_variable.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAKH;;GAEG;AACH,MAAM,WAAW,wBAAwB;IACxC,6BAA6B;IAC7B,aAAa,EAAE,MAAM,CAAC;IACtB,kFAAkF;IAClF,SAAS,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,KAAK,OAAO,CAAC,MAAM,CAAC,CAAC;IAChE,oFAAoF;IACpF,UAAU,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;CAChF;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,eAAO,MAAM,mBAAmB,GAC/B,KAAK,MAAM,EACX,OAAO,MAAM,EACb,SAAS,wBAAwB,KAC/B,OAAO,CAAC,IAAI,CAmDd,CAAC"}
1
+ {"version":3,"file":"update_env_variable.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/env/update_env_variable.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAKH;;GAEG;AACH,MAAM,WAAW,wBAAwB;IACxC,6BAA6B;IAC7B,aAAa,EAAE,MAAM,CAAC;IACtB,kFAAkF;IAClF,SAAS,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,KAAK,OAAO,CAAC,MAAM,CAAC,CAAC;IAChE,oFAAoF;IACpF,UAAU,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;CAChF;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,eAAO,MAAM,mBAAmB,GAC/B,KAAK,MAAM,EACX,OAAO,MAAM,EACb,SAAS,wBAAwB,KAC/B,OAAO,CAAC,IAAI,CAmDd,CAAC"}
@@ -22,6 +22,8 @@ import { resolve } from 'node:path';
22
22
  * @param key - the environment variable name (e.g., `'SOME_CONFIGURATION_KEY'`)
23
23
  * @param value - the new value for the environment variable
24
24
  * @param options - file path and optional read/write overrides
25
+ * @mutates filesystem - writes the updated content back to `options.env_file_path`
26
+ * @throws Error if the file read fails for any reason other than `ENOENT`, or if the write fails
25
27
  */
26
28
  export const update_env_variable = async (key, value, options) => {
27
29
  const { env_file_path, read_file = readFile, write_file = writeFile } = options;
@@ -4,11 +4,8 @@
4
4
  * Cross-cutting shared vocabulary — defines the Hono `ContextVariableMap`
5
5
  * variables used by auth, http, server, and testing modules.
6
6
  *
7
- * Import this module once in your app to get type-safe access to
8
- * `auth_session_id`, `request_context`, and `credential_type` on the Hono context.
9
- *
10
- * In practice, this is auto-loaded by `server/app_server.ts` (side-effect import)
11
- * and transitively by auth middleware modules that import `CREDENTIAL_TYPE_KEY`.
7
+ * Auto-loaded by `server/app_server.ts` (side-effect import) and
8
+ * transitively by auth middleware modules that import `CREDENTIAL_TYPE_KEY`.
12
9
  * Consumers don't need a manual import unless bypassing the standard server assembly.
13
10
  *
14
11
  * @module
@@ -1 +1 @@
1
- {"version":3,"file":"hono_context.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/hono_context.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAC,CAAC,EAAC,MAAM,KAAK,CAAC;AAEtB,OAAO,KAAK,EAAC,cAAc,EAAC,MAAM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C,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,CAAC;AAE5D,0DAA0D;AAC1D,eAAO,MAAM,mBAAmB,oBAAoB,CAAC;AAErD,qEAAqE;AACrE,eAAO,MAAM,qBAAqB,sBAAsB,CAAC;AAEzD,OAAO,QAAQ,MAAM,CAAC;IACrB,UAAU,kBAAkB;QAC3B,+DAA+D;QAC/D,SAAS,EAAE,MAAM,CAAC;QAClB,eAAe,EAAE,MAAM,GAAG,IAAI,CAAC;QAC/B,eAAe,EAAE,cAAc,GAAG,IAAI,CAAC;QACvC,eAAe,EAAE,OAAO,CAAC;QACzB,gBAAgB,EAAE,OAAO,CAAC;QAC1B,eAAe,EAAE,OAAO,CAAC;QACzB,2FAA2F;QAC3F,eAAe,EAAE,cAAc,GAAG,IAAI,CAAC;QACvC;;;;;WAKG;QACH,uBAAuB,EAAE,MAAM,GAAG,IAAI,CAAC;QACvC;;;;;;WAMG;QACH,iBAAiB,EAAE,MAAM,GAAG,IAAI,CAAC;QACjC;;;;WAIG;QACH,eAAe,EAAE,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC;KACtC;CACD"}
@@ -4,11 +4,8 @@
4
4
  * Cross-cutting shared vocabulary — defines the Hono `ContextVariableMap`
5
5
  * variables used by auth, http, server, and testing modules.
6
6
  *
7
- * Import this module once in your app to get type-safe access to
8
- * `auth_session_id`, `request_context`, and `credential_type` on the Hono context.
9
- *
10
- * In practice, this is auto-loaded by `server/app_server.ts` (side-effect import)
11
- * and transitively by auth middleware modules that import `CREDENTIAL_TYPE_KEY`.
7
+ * Auto-loaded by `server/app_server.ts` (side-effect import) and
8
+ * transitively by auth middleware modules that import `CREDENTIAL_TYPE_KEY`.
12
9
  * Consumers don't need a manual import unless bypassing the standard server assembly.
13
10
  *
14
11
  * @module
@@ -13,8 +13,6 @@ import type { AppSurface } from './surface.js';
13
13
  *
14
14
  * Infrastructure endpoint for uptime monitors and load balancers.
15
15
  * Bootstrap availability is exposed via `/api/account/status` instead.
16
- *
17
- * @returns a single health check route spec
18
16
  */
19
17
  export declare const create_health_route_spec: () => RouteSpec;
20
18
  /** Options for the authenticated server status route. */
@@ -29,9 +27,6 @@ export interface ServerStatusOptions {
29
27
  *
30
28
  * Returns version and uptime. Unlike the public health check,
31
29
  * this requires authentication.
32
- *
33
- * @param options - version and uptime source
34
- * @returns route spec for `GET /api/server/status`
35
30
  */
36
31
  export declare const create_server_status_route_spec: (options: ServerStatusOptions) => RouteSpec;
37
32
  /** Options for the surface explorer route. */
@@ -44,9 +39,6 @@ export interface SurfaceRouteOptions {
44
39
  *
45
40
  * Surface data reveals API structure (routes, auth, schemas), so this
46
41
  * requires authentication like the server status route.
47
- *
48
- * @param options - surface data source
49
- * @returns route spec for `GET /api/surface`
50
42
  */
51
43
  export declare const create_surface_route_spec: (options: SurfaceRouteOptions) => RouteSpec;
52
44
  //# sourceMappingURL=common_routes.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"common_routes.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/http/common_routes.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAIH,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,iBAAiB,CAAC;AAC/C,OAAO,KAAK,EAAC,UAAU,EAAC,MAAM,cAAc,CAAC;AAE7C;;;;;;;GAOG;AACH,eAAO,MAAM,wBAAwB,QAAO,SAQ1C,CAAC;AAEH,yDAAyD;AACzD,MAAM,WAAW,mBAAmB;IACnC,kCAAkC;IAClC,OAAO,EAAE,MAAM,CAAC;IAChB,+CAA+C;IAC/C,aAAa,EAAE,MAAM,MAAM,CAAC;CAC5B;AAED;;;;;;;;GAQG;AACH,eAAO,MAAM,+BAA+B,GAAI,SAAS,mBAAmB,KAAG,SAQ7E,CAAC;AAEH,8CAA8C;AAC9C,MAAM,WAAW,mBAAmB;IACnC,0CAA0C;IAC1C,OAAO,EAAE,UAAU,CAAC;CACpB;AAED;;;;;;;;GAQG;AACH,eAAO,MAAM,yBAAyB,GAAI,SAAS,mBAAmB,KAAG,SAWvE,CAAC"}
1
+ {"version":3,"file":"common_routes.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/http/common_routes.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAIH,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,iBAAiB,CAAC;AAC/C,OAAO,KAAK,EAAC,UAAU,EAAC,MAAM,cAAc,CAAC;AAE7C;;;;;GAKG;AACH,eAAO,MAAM,wBAAwB,QAAO,SAQ1C,CAAC;AAEH,yDAAyD;AACzD,MAAM,WAAW,mBAAmB;IACnC,kCAAkC;IAClC,OAAO,EAAE,MAAM,CAAC;IAChB,+CAA+C;IAC/C,aAAa,EAAE,MAAM,MAAM,CAAC;CAC5B;AAED;;;;;GAKG;AACH,eAAO,MAAM,+BAA+B,GAAI,SAAS,mBAAmB,KAAG,SAQ7E,CAAC;AAEH,8CAA8C;AAC9C,MAAM,WAAW,mBAAmB;IACnC,0CAA0C;IAC1C,OAAO,EAAE,UAAU,CAAC;CACpB;AAED;;;;;GAKG;AACH,eAAO,MAAM,yBAAyB,GAAI,SAAS,mBAAmB,KAAG,SAWvE,CAAC"}
@@ -12,8 +12,6 @@ import { z } from 'zod';
12
12
  *
13
13
  * Infrastructure endpoint for uptime monitors and load balancers.
14
14
  * Bootstrap availability is exposed via `/api/account/status` instead.
15
- *
16
- * @returns a single health check route spec
17
15
  */
18
16
  export const create_health_route_spec = () => ({
19
17
  method: 'GET',
@@ -29,9 +27,6 @@ export const create_health_route_spec = () => ({
29
27
  *
30
28
  * Returns version and uptime. Unlike the public health check,
31
29
  * this requires authentication.
32
- *
33
- * @param options - version and uptime source
34
- * @returns route spec for `GET /api/server/status`
35
30
  */
36
31
  export const create_server_status_route_spec = (options) => ({
37
32
  method: 'GET',
@@ -47,9 +42,6 @@ export const create_server_status_route_spec = (options) => ({
47
42
  *
48
43
  * Surface data reveals API structure (routes, auth, schemas), so this
49
44
  * requires authentication like the server status route.
50
- *
51
- * @param options - surface data source
52
- * @returns route spec for `GET /api/surface`
53
45
  */
54
46
  export const create_surface_route_spec = (options) => ({
55
47
  method: 'GET',
@@ -49,9 +49,6 @@ export interface DbRouteOptions {
49
49
  }
50
50
  /**
51
51
  * Create the db API route specs.
52
- *
53
- * @param options - route configuration (db_type, db_name, extra_stats)
54
- * @returns route specs for database administration
55
52
  */
56
53
  export declare const create_db_route_specs: (options: DbRouteOptions) => Array<RouteSpec>;
57
54
  //# sourceMappingURL=db_routes.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"db_routes.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/http/db_routes.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAGH,OAAO,KAAK,EAAC,MAAM,EAAC,MAAM,yBAAyB,CAAC;AAEpD,OAAO,KAAK,EAAC,EAAE,EAAE,MAAM,EAAC,MAAM,aAAa,CAAC;AAC5C,OAAO,EAAmB,KAAK,SAAS,EAAC,MAAM,iBAAiB,CAAC;AAYjE;;GAEG;AACH,MAAM,WAAW,SAAS;IACzB,UAAU,EAAE,MAAM,CAAC;CACnB;AAED;;GAEG;AACH,MAAM,WAAW,cAAc;IAC9B,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,MAAM,CAAC;CAClB;AAED;;GAEG;AACH,MAAM,WAAW,cAAc;IAC9B,WAAW,EAAE,MAAM,CAAC;CACpB;AAED;;GAEG;AACH,MAAM,WAAW,UAAU;IAC1B,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC;CACpB;AAED;;GAEG;AACH,MAAM,WAAW,cAAc;IAC9B,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,8EAA8E;IAC9E,WAAW,CAAC,EAAE,CAAC,EAAE,EAAE,EAAE,KAAK,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;IAC3D,+EAA+E;IAC/E,GAAG,CAAC,EAAE,MAAM,CAAC;CACb;AAED;;;;;GAKG;AACH,eAAO,MAAM,qBAAqB,GAAI,SAAS,cAAc,KAAG,KAAK,CAAC,SAAS,CA8N9E,CAAC"}
1
+ {"version":3,"file":"db_routes.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/http/db_routes.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAGH,OAAO,KAAK,EAAC,MAAM,EAAC,MAAM,yBAAyB,CAAC;AAEpD,OAAO,KAAK,EAAC,EAAE,EAAE,MAAM,EAAC,MAAM,aAAa,CAAC;AAC5C,OAAO,EAAmB,KAAK,SAAS,EAAC,MAAM,iBAAiB,CAAC;AAYjE;;GAEG;AACH,MAAM,WAAW,SAAS;IACzB,UAAU,EAAE,MAAM,CAAC;CACnB;AAED;;GAEG;AACH,MAAM,WAAW,cAAc;IAC9B,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,MAAM,CAAC;CAClB;AAED;;GAEG;AACH,MAAM,WAAW,cAAc;IAC9B,WAAW,EAAE,MAAM,CAAC;CACpB;AAED;;GAEG;AACH,MAAM,WAAW,UAAU;IAC1B,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC;CACpB;AAED;;GAEG;AACH,MAAM,WAAW,cAAc;IAC9B,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,8EAA8E;IAC9E,WAAW,CAAC,EAAE,CAAC,EAAE,EAAE,EAAE,KAAK,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;IAC3D,+EAA+E;IAC/E,GAAG,CAAC,EAAE,MAAM,CAAC;CACb;AAED;;GAEG;AACH,eAAO,MAAM,qBAAqB,GAAI,SAAS,cAAc,KAAG,KAAK,CAAC,SAAS,CA8N9E,CAAC"}
@@ -12,9 +12,6 @@ import { ForeignKeyError, ERROR_TABLE_NOT_FOUND, ERROR_TABLE_NO_PRIMARY_KEY, ERR
12
12
  import { assert_valid_sql_identifier, VALID_SQL_IDENTIFIER } from '../db/sql_identifier.js';
13
13
  /**
14
14
  * Create the db API route specs.
15
- *
16
- * @param options - route configuration (db_type, db_name, extra_stats)
17
- * @returns route specs for database administration
18
15
  */
19
16
  export const create_db_route_specs = (options) => {
20
17
  const { db_type, db_name, extra_stats, log } = options;
@@ -139,13 +139,21 @@ export type ForeignKeyError = z.infer<typeof ForeignKeyError>;
139
139
  */
140
140
  export type RouteErrorSchemas = Partial<Record<number, z.ZodType>>;
141
141
  /**
142
- * Rate limit key type — declares what a route's rate limiter is keyed on.
142
+ * Rate limit key type — declares what a route or RPC action's rate limiter
143
+ * is keyed on.
143
144
  *
144
145
  * - `'ip'` — per-IP rate limiting (bootstrap, password change, bearer auth)
145
- * - `'account'` — per-account rate limiting (keyed on submitted identifier)
146
- * - `'both'` both per-IP and per-account (login)
146
+ * - `'account'` — per-account rate limiting. On REST auth routes the key is
147
+ * the submitted identifier (login). On RPC actions (post-auth) the key is
148
+ * the resolved actor id (`request_context.actor.id`) — separate namespace.
149
+ * - `'both'` — both keys.
147
150
  */
148
- export type RateLimitKey = 'ip' | 'account' | 'both';
151
+ export declare const RateLimitKey: z.ZodEnum<{
152
+ account: "account";
153
+ ip: "ip";
154
+ both: "both";
155
+ }>;
156
+ export type RateLimitKey = z.infer<typeof RateLimitKey>;
149
157
  /**
150
158
  * Derive error schemas from a route's auth requirement, input schema, and rate limit config.
151
159
  *
@@ -159,13 +167,6 @@ export type RateLimitKey = 'ip' | 'account' | 'both';
159
167
  * - **auth: role**: 401 + 403 (with `required_role`)
160
168
  * - **auth: keeper**: 401 + 403 (keeper-specific)
161
169
  * - **rate_limit**: 429 (rate limit exceeded with `retry_after`)
162
- *
163
- * @param auth - the route's auth requirement
164
- * @param has_input - whether the route has a non-null input schema
165
- * @param has_params - whether the route has a params schema
166
- * @param has_query - whether the route has a query schema
167
- * @param rate_limit - the rate limit key type, if any
168
- * @returns error schemas keyed by HTTP status code
169
170
  */
170
171
  export declare const derive_error_schemas: (auth: RouteAuth, has_input: boolean, has_params?: boolean, has_query?: boolean, rate_limit?: RateLimitKey) => RouteErrorSchemas;
171
172
  //# sourceMappingURL=error_schemas.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"error_schemas.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/http/error_schemas.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAAC,CAAC,EAAC,MAAM,KAAK,CAAC;AAEtB,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,iBAAiB,CAAC;AAI/C,0CAA0C;AAC1C,eAAO,MAAM,0BAA0B,EAAG,sBAA+B,CAAC;AAE1E,uDAAuD;AACvD,eAAO,MAAM,uBAAuB,EAAG,mBAA4B,CAAC;AAEpE,6CAA6C;AAC7C,eAAO,MAAM,0BAA0B,EAAG,sBAA+B,CAAC;AAE1E,8CAA8C;AAC9C,eAAO,MAAM,0BAA0B,EAAG,sBAA+B,CAAC;AAI1E,wCAAwC;AACxC,eAAO,MAAM,6BAA6B,EAAG,yBAAkC,CAAC;AAEhF,+CAA+C;AAC/C,eAAO,MAAM,8BAA8B,EAAG,0BAAmC,CAAC;AAElF,yCAAyC;AACzC,eAAO,MAAM,yBAAyB,EAAG,qBAA8B,CAAC;AAExE,sFAAsF;AACtF,eAAO,MAAM,yBAAyB,EAAG,qBAA8B,CAAC;AAExE,qDAAqD;AACrD,eAAO,MAAM,uBAAuB,EAAG,mBAA4B,CAAC;AAIpE,uCAAuC;AACvC,eAAO,MAAM,sBAAsB,EAAG,kBAA2B,CAAC;AAElE,wCAAwC;AACxC,eAAO,MAAM,uBAAuB,EAAG,mBAA4B,CAAC;AAEpE,sEAAsE;AACtE,eAAO,MAAM,6BAA6B,EAAG,0CAAmD,CAAC;AAEjG,uEAAuE;AACvE,eAAO,MAAM,mBAAmB,EAAG,eAAwB,C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,CAAC,KAAK,CAAC,OAAO,eAAe,CAAC,CAAC;AAE9D;;;;GAIG;AACH,MAAM,MAAM,iBAAiB,GAAG,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC;AAEnE;;;;;;;;;GASG;AACH,eAAO,MAAM,YAAY;;;;EAAoC,CAAC;AAC9D,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,YAAY,CAAC,CAAC;AAExD;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,oBAAoB,GAChC,MAAM,SAAS,EACf,WAAW,OAAO,EAClB,oBAAkB,EAClB,mBAAiB,EACjB,aAAa,YAAY,KACvB,iBA4BF,CAAC"}
@@ -132,6 +132,17 @@ export const PayloadTooLargeError = z.looseObject({
132
132
  export const ForeignKeyError = z.looseObject({
133
133
  error: z.literal(ERROR_FOREIGN_KEY_VIOLATION),
134
134
  });
135
+ /**
136
+ * Rate limit key type — declares what a route or RPC action's rate limiter
137
+ * is keyed on.
138
+ *
139
+ * - `'ip'` — per-IP rate limiting (bootstrap, password change, bearer auth)
140
+ * - `'account'` — per-account rate limiting. On REST auth routes the key is
141
+ * the submitted identifier (login). On RPC actions (post-auth) the key is
142
+ * the resolved actor id (`request_context.actor.id`) — separate namespace.
143
+ * - `'both'` — both keys.
144
+ */
145
+ export const RateLimitKey = z.enum(['ip', 'account', 'both']);
135
146
  /**
136
147
  * Derive error schemas from a route's auth requirement, input schema, and rate limit config.
137
148
  *
@@ -145,13 +156,6 @@ export const ForeignKeyError = z.looseObject({
145
156
  * - **auth: role**: 401 + 403 (with `required_role`)
146
157
  * - **auth: keeper**: 401 + 403 (keeper-specific)
147
158
  * - **rate_limit**: 429 (rate limit exceeded with `retry_after`)
148
- *
149
- * @param auth - the route's auth requirement
150
- * @param has_input - whether the route has a non-null input schema
151
- * @param has_params - whether the route has a params schema
152
- * @param has_query - whether the route has a query schema
153
- * @param rate_limit - the rate limit key type, if any
154
- * @returns error schemas keyed by HTTP status code
155
159
  */
156
160
  export const derive_error_schemas = (auth, has_input, has_params = false, has_query = false, rate_limit) => {
157
161
  const errors = {};
@@ -98,18 +98,12 @@ export declare const HTTP_STATUS_TO_JSONRPC_ERROR_CODE: Record<number, JsonrpcEr
98
98
  *
99
99
  * Returns 500 for unrecognized codes (consumer-defined codes
100
100
  * without a mapping default to internal server error).
101
- *
102
- * @param code - the JSON-RPC error code
103
- * @returns the corresponding HTTP status code
104
101
  */
105
102
  export declare const jsonrpc_error_code_to_http_status: (code: JsonrpcErrorCode) => number;
106
103
  /**
107
104
  * Map an HTTP status code to a JSON-RPC error code.
108
105
  *
109
106
  * Returns `internal_error` (-32603) for unrecognized status codes.
110
- *
111
- * @param status - the HTTP status code
112
- * @returns the corresponding JSON-RPC error code
113
107
  */
114
108
  export declare const http_status_to_jsonrpc_error_code: (status: number) => JsonrpcErrorCode;
115
109
  //# sourceMappingURL=jsonrpc_errors.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"jsonrpc_errors.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/http/jsonrpc_errors.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,EAMN,KAAK,gBAAgB,EACrB,KAAK,kBAAkB,EACvB,MAAM,cAAc,CAAC;AAEtB,0CAA0C;AAC1C,eAAO,MAAM,qBAAqB,kBAAkB,CAAC;AAErD,sEAAsE;AACtE,MAAM,MAAM,gBAAgB,GACzB,aAAa,GACb,iBAAiB,GACjB,kBAAkB,GAClB,gBAAgB,GAChB,gBAAgB,GAChB,iBAAiB,GACjB,WAAW,GACX,WAAW,GACX,UAAU,GACV,kBAAkB,GAClB,cAAc,GACd,qBAAqB,GACrB,SAAS,GACT,gBAAgB,GAChB,mBAAmB,CAAC;AAEvB;;;;;;;;;;GAUG;AACH,eAAO,MAAM,mBAAmB,EA0C1B,QAAQ,CAAC,MAAM,CAAC,gBAAgB,EAAE,gBAAgB,C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;;;;GAOG;AACH,eAAO,MAAM,iCAAiC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAkBpE,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,iCAAiC,EAAE,MAAM,CAAC,MAAM,EAAE,gBAAgB,CAMzC,CAAC;AAEvC;;;;;GAKG;AACH,eAAO,MAAM,iCAAiC,GAAI,MAAM,gBAAgB,KAAG,MAClB,CAAC;AAE1D;;;;GAIG;AACH,eAAO,MAAM,iCAAiC,GAAI,QAAQ,MAAM,KAAG,gBACa,CAAC"}
@@ -243,17 +243,11 @@ export const HTTP_STATUS_TO_JSONRPC_ERROR_CODE = Object.fromEntries(Object.entri
243
243
  *
244
244
  * Returns 500 for unrecognized codes (consumer-defined codes
245
245
  * without a mapping default to internal server error).
246
- *
247
- * @param code - the JSON-RPC error code
248
- * @returns the corresponding HTTP status code
249
246
  */
250
247
  export const jsonrpc_error_code_to_http_status = (code) => JSONRPC_ERROR_CODE_TO_HTTP_STATUS[code] ?? 500;
251
248
  /**
252
249
  * Map an HTTP status code to a JSON-RPC error code.
253
250
  *
254
251
  * Returns `internal_error` (-32603) for unrecognized status codes.
255
- *
256
- * @param status - the HTTP status code
257
- * @returns the corresponding JSON-RPC error code
258
252
  */
259
253
  export const http_status_to_jsonrpc_error_code = (status) => HTTP_STATUS_TO_JSONRPC_ERROR_CODE[status] ?? JSONRPC_ERROR_CODES.internal_error;
@@ -28,7 +28,7 @@ import type { Handler } from 'hono';
28
28
  * - `https://*.api.fuz.dev,http://127.0.0.1:*`
29
29
  * - `http://[::1]:*,https://*.*.corp.fuz.dev:*`
30
30
  *
31
- * @throws if any individual pattern is invalid (missing protocol, partial wildcards, etc.)
31
+ * @throws Error if any individual pattern is invalid (missing protocol, partial wildcards, etc.)
32
32
  */
33
33
  export declare const parse_allowed_origins: (env_value: string | undefined) => Array<RegExp>;
34
34
  /**
@@ -39,19 +39,12 @@ export declare const should_allow_origin: (origin: string, allowed_patterns: Arr
39
39
  /**
40
40
  * Middleware that verifies the request source against an allowlist.
41
41
  *
42
- * Origin allowlisting (not the CSRF layer — that's `SameSite: strict` cookies) that:
43
- * - Checks the Origin header first (if present)
44
- * - Falls back to Referer header (if no Origin)
45
- * - Allows requests without Origin/Referer headers (direct access, curl, etc.)
42
+ * Origin allowlisting (not the CSRF layer — that's `SameSite: strict` cookies):
43
+ * - Checks the `Origin` header first (if present)
44
+ * - Falls back to `Referer` header (if no `Origin`)
45
+ * - Allows requests without `Origin`/`Referer` headers (direct access, curl, etc.)
46
46
  *
47
- * This is useful for:
48
- * - Protecting locally-running services from being called by
49
- * untrusted websites as the user browses the web
50
- * - Restricting which domains can make requests to your API
51
- * - Preventing embedding of your service in unexpected sites
52
- * - Basic source verification for locally-running services
53
- *
54
- * @param allowed_patterns - array of compiled regex patterns from parse_allowed_origins
47
+ * @param allowed_patterns - compiled regex patterns from `parse_allowed_origins`
55
48
  */
56
49
  export declare const verify_request_source: (allowed_patterns: Array<RegExp>) => Handler;
57
50
  //# sourceMappingURL=origin.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"origin.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/http/origin.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAGH,OAAO,KAAK,EAAC,OAAO,EAAC,MAAM,MAAM,CAAC;AAIlC;;;;;;;;;;;;;;;;;;;GAmBG;AACH,eAAO,MAAM,qBAAqB,GAAI,WAAW,MAAM,GAAG,SAAS,KAAG,KAAK,CAAC,MAAM,CAO5E,CAAC;AAEP;;;GAGG;AACH,eAAO,MAAM,mBAAmB,GAAI,QAAQ,MAAM,EAAE,kBAAkB,KAAK,CAAC,MAAM,CAAC,KAAG,OACzC,CAAC;AAE9C;;;;;;;;;;;;;;;;GAgBG;AACH,eAAO,MAAM,qBAAqB,GAChC,kBAAkB,KAAK,CAAC,MAAM,CAAC,KAAG,OA2BlC,CAAC"}
1
+ {"version":3,"file":"origin.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/http/origin.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAGH,OAAO,KAAK,EAAC,OAAO,EAAC,MAAM,MAAM,CAAC;AAIlC;;;;;;;;;;;;;;;;;;;GAmBG;AACH,eAAO,MAAM,qBAAqB,GAAI,WAAW,MAAM,GAAG,SAAS,KAAG,KAAK,CAAC,MAAM,CAO5E,CAAC;AAEP;;;GAGG;AACH,eAAO,MAAM,mBAAmB,GAAI,QAAQ,MAAM,EAAE,kBAAkB,KAAK,CAAC,MAAM,CAAC,KAAG,OACzC,CAAC;AAE9C;;;;;;;;;GASG;AACH,eAAO,MAAM,qBAAqB,GAChC,kBAAkB,KAAK,CAAC,MAAM,CAAC,KAAG,OA2BlC,CAAC"}
@@ -29,7 +29,7 @@ import { ERROR_FORBIDDEN_ORIGIN, ERROR_FORBIDDEN_REFERER } from './error_schemas
29
29
  * - `https://*.api.fuz.dev,http://127.0.0.1:*`
30
30
  * - `http://[::1]:*,https://*.*.corp.fuz.dev:*`
31
31
  *
32
- * @throws if any individual pattern is invalid (missing protocol, partial wildcards, etc.)
32
+ * @throws Error if any individual pattern is invalid (missing protocol, partial wildcards, etc.)
33
33
  */
34
34
  export const parse_allowed_origins = (env_value) => env_value
35
35
  ? env_value
@@ -46,19 +46,12 @@ export const should_allow_origin = (origin, allowed_patterns) => allowed_pattern
46
46
  /**
47
47
  * Middleware that verifies the request source against an allowlist.
48
48
  *
49
- * Origin allowlisting (not the CSRF layer — that's `SameSite: strict` cookies) that:
50
- * - Checks the Origin header first (if present)
51
- * - Falls back to Referer header (if no Origin)
52
- * - Allows requests without Origin/Referer headers (direct access, curl, etc.)
49
+ * Origin allowlisting (not the CSRF layer — that's `SameSite: strict` cookies):
50
+ * - Checks the `Origin` header first (if present)
51
+ * - Falls back to `Referer` header (if no `Origin`)
52
+ * - Allows requests without `Origin`/`Referer` headers (direct access, curl, etc.)
53
53
  *
54
- * This is useful for:
55
- * - Protecting locally-running services from being called by
56
- * untrusted websites as the user browses the web
57
- * - Restricting which domains can make requests to your API
58
- * - Preventing embedding of your service in unexpected sites
59
- * - Basic source verification for locally-running services
60
- *
61
- * @param allowed_patterns - array of compiled regex patterns from parse_allowed_origins
54
+ * @param allowed_patterns - compiled regex patterns from `parse_allowed_origins`
62
55
  */
63
56
  export const verify_request_source = (allowed_patterns) => (c, next) => {
64
57
  // Check origin header (preferred, sent by browsers for CORS requests).
@@ -106,7 +99,7 @@ export const verify_request_source = (allowed_patterns) => (c, next) => {
106
99
  * like `[::ffff:127.0.0.1]` will be normalized to `[::ffff:7f00:1]`. IPv6 zone
107
100
  * identifiers (e.g., `%eth0`) are not supported.
108
101
  *
109
- * @throws if pattern format is invalid
102
+ * @throws Error if pattern format is invalid
110
103
  */
111
104
  const origin_pattern_to_regexp = (pattern) => {
112
105
  // Quick validation: no paths, query strings, or fragments allowed
@@ -24,6 +24,10 @@ export interface PendingEffectsContext {
24
24
  * Exceptions thrown by `fn` are caught and logged via `ctx.log.error`, so one
25
25
  * failed send cannot corrupt the already-committed response or starve other
26
26
  * queued effects in the same tick.
27
+ *
28
+ * @param ctx - context carrying `log` and the `pending_effects` queue
29
+ * @param fn - synchronous side effect to run after commit
30
+ * @mutates `ctx.pending_effects` - appends a never-rejecting promise wrapping `fn`
27
31
  */
28
32
  export declare const emit_after_commit: (ctx: PendingEffectsContext, fn: () => void) => void;
29
33
  //# sourceMappingURL=pending_effects.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"pending_effects.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/http/pending_effects.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,KAAK,EAAC,MAAM,EAAC,MAAM,yBAAyB,CAAC;AAEpD,kEAAkE;AAClE,MAAM,WAAW,qBAAqB;IACrC,GAAG,EAAE,MAAM,CAAC;IACZ,eAAe,EAAE,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC;CACtC;AAED;;;;;;GAMG;AACH,eAAO,MAAM,iBAAiB,GAAI,KAAK,qBAAqB,EAAE,IAAI,MAAM,IAAI,KAAG,IAU9E,CAAC"}
1
+ {"version":3,"file":"pending_effects.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/http/pending_effects.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,KAAK,EAAC,MAAM,EAAC,MAAM,yBAAyB,CAAC;AAEpD,kEAAkE;AAClE,MAAM,WAAW,qBAAqB;IACrC,GAAG,EAAE,MAAM,CAAC;IACZ,eAAe,EAAE,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC;CACtC;AAED;;;;;;;;;;GAUG;AACH,eAAO,MAAM,iBAAiB,GAAI,KAAK,qBAAqB,EAAE,IAAI,MAAM,IAAI,KAAG,IAU9E,CAAC"}
@@ -18,6 +18,10 @@
18
18
  * Exceptions thrown by `fn` are caught and logged via `ctx.log.error`, so one
19
19
  * failed send cannot corrupt the already-committed response or starve other
20
20
  * queued effects in the same tick.
21
+ *
22
+ * @param ctx - context carrying `log` and the `pending_effects` queue
23
+ * @param fn - synchronous side effect to run after commit
24
+ * @mutates `ctx.pending_effects` - appends a never-rejecting promise wrapping `fn`
21
25
  */
22
26
  export const emit_after_commit = (ctx, fn) => {
23
27
  ctx.pending_effects.push(Promise.resolve().then(() => {
@@ -18,8 +18,6 @@ import type { MiddlewareSpec } from './middleware_spec.js';
18
18
  * - Lowercases for case-insensitive IPv6 comparison
19
19
  * - Idempotent: calling twice produces the same result
20
20
  * - Safe on non-IP strings: `normalize_ip('unknown')` returns `'unknown'`
21
- *
22
- * @param ip - IP address string to normalize
23
21
  */
24
22
  export declare const normalize_ip: (ip: string) => string;
25
23
  /**
@@ -53,16 +51,13 @@ export type ParsedProxy = {
53
51
  * CIDR prefixes are validated against address family bounds.
54
52
  *
55
53
  * @param entry - IP address or CIDR notation
56
- * @throws on invalid IP, invalid CIDR network, or NaN/negative/over-range prefix
54
+ * @throws Error on invalid IP, invalid CIDR network, or NaN/negative/over-range prefix
57
55
  */
58
56
  export declare const parse_proxy_entry: (entry: string) => ParsedProxy;
59
57
  /**
60
58
  * Check whether `ip` matches any entry in the trusted proxy list.
61
59
  *
62
60
  * Normalizes `ip` before matching (lowercase, IPv4-mapped IPv6 stripped).
63
- *
64
- * @param ip - the IP address to check
65
- * @param proxies - parsed proxy entries
66
61
  */
67
62
  export declare const is_trusted_ip: (ip: string, proxies: Array<ParsedProxy>) => boolean;
68
63
  /**
@@ -92,6 +87,8 @@ export declare const resolve_client_ip: (forwarded_for: string, proxies: Array<P
92
87
  * right-to-left, strip trusted entries, use first untrusted entry.
93
88
  *
94
89
  * @param options - trusted proxy configuration
90
+ * @mutates `c.var.client_ip` - set to the resolved (or `'unknown'`) client IP per request
91
+ * @throws Error if any entry in `options.trusted_proxies` is invalid (parsed eagerly via `parse_proxy_entry`)
95
92
  */
96
93
  export declare const create_proxy_middleware: (options: ProxyOptions) => MiddlewareHandler;
97
94
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"proxy.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/http/proxy.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAC,OAAO,EAAE,iBAAiB,EAAC,MAAM,MAAM,CAAC;AAErD,OAAO,KAAK,EAAC,MAAM,EAAC,MAAM,yBAAyB,CAAC;AAEpD,OAAO,KAAK,EAAC,cAAc,EAAC,MAAM,sBAAsB,CAAC;AAEzD;;;;;;;;;;GAUG;AACH,eAAO,MAAM,YAAY,GAAI,IAAI,MAAM,KAAG,MAQzC,CAAC;AAEF;;GAEG;AACH,MAAM,WAAW,YAAY;IAC5B,sFAAsF;IACtF,eAAe,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;IAC/B,+DAA+D;IAC/D,iBAAiB,EAAE,CAAC,CAAC,EAAE,OAAO,KAAK,MAAM,GAAG,SAAS,CAAC;IACtD,wDAAwD;IACxD,GAAG,CAAC,EAAE,M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;AAEF;;GAEG;AACH,MAAM,WAAW,YAAY;IAC5B,sFAAsF;IACtF,eAAe,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;IAC/B,+DAA+D;IAC/D,iBAAiB,EAAE,CAAC,CAAC,EAAE,OAAO,KAAK,MAAM,GAAG,SAAS,CAAC;IACtD,wDAAwD;IACxD,GAAG,CAAC,EAAE,MAAM,CAAC;CACb;AAED;;GAEG;AACH,MAAM,MAAM,WAAW,GACpB;IAAC,IAAI,EAAE,IAAI,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAC,GAC7B;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAC;IAAC,YAAY,EAAE,MAAM,GAAG,MAAM,CAAA;CAAC,CAAC;AAElF;;;;;;;;;GASG;AACH,eAAO,MAAM,iBAAiB,GAAI,OAAO,MAAM,KAAG,WA6CjD,CAAC;AAiBF;;;;GAIG;AACH,eAAO,MAAM,aAAa,GAAI,IAAI,MAAM,EAAE,SAAS,KAAK,CAAC,WAAW,CAAC,KAAG,OAqBvE,CAAC;AAQF;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,iBAAiB,GAC7B,eAAe,MAAM,EACrB,SAAS,KAAK,CAAC,WAAW,CAAC,KACzB,MAAM,GAAG,SAiBX,CAAC;AAEF;;;;;;;;;;;;;;;;GAgBG;AACH,eAAO,MAAM,uBAAuB,GAAI,SAAS,YAAY,KAAG,iBAyC/D,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,4BAA4B,GAAI,SAAS,YAAY,KAAG,cAInE,CAAC;AAEH;;;;;GAKG;AACH,eAAO,MAAM,aAAa,GAAI,GAAG,OAAO,KAAG,MAAyC,CAAC"}
@@ -16,8 +16,6 @@ import { convertIPv4ToBinary, convertIPv6ToBinary, distinctRemoteAddr } from 'ho
16
16
  * - Lowercases for case-insensitive IPv6 comparison
17
17
  * - Idempotent: calling twice produces the same result
18
18
  * - Safe on non-IP strings: `normalize_ip('unknown')` returns `'unknown'`
19
- *
20
- * @param ip - IP address string to normalize
21
19
  */
22
20
  export const normalize_ip = (ip) => {
23
21
  const lowered = ip.toLowerCase();
@@ -36,7 +34,7 @@ export const normalize_ip = (ip) => {
36
34
  * CIDR prefixes are validated against address family bounds.
37
35
  *
38
36
  * @param entry - IP address or CIDR notation
39
- * @throws on invalid IP, invalid CIDR network, or NaN/negative/over-range prefix
37
+ * @throws Error on invalid IP, invalid CIDR network, or NaN/negative/over-range prefix
40
38
  */
41
39
  export const parse_proxy_entry = (entry) => {
42
40
  const slash_index = entry.indexOf('/');
@@ -97,9 +95,6 @@ const cidr_contains = (ip_binary, network, prefix, total_bits) => {
97
95
  * Check whether `ip` matches any entry in the trusted proxy list.
98
96
  *
99
97
  * Normalizes `ip` before matching (lowercase, IPv4-mapped IPv6 stripped).
100
- *
101
- * @param ip - the IP address to check
102
- * @param proxies - parsed proxy entries
103
98
  */
104
99
  export const is_trusted_ip = (ip, proxies) => {
105
100
  const normalized = normalize_ip(ip);
@@ -176,6 +171,8 @@ export const resolve_client_ip = (forwarded_for, proxies) => {
176
171
  * right-to-left, strip trusted entries, use first untrusted entry.
177
172
  *
178
173
  * @param options - trusted proxy configuration
174
+ * @mutates `c.var.client_ip` - set to the resolved (or `'unknown'`) client IP per request
175
+ * @throws Error if any entry in `options.trusted_proxies` is invalid (parsed eagerly via `parse_proxy_entry`)
179
176
  */
180
177
  export const create_proxy_middleware = (options) => {
181
178
  const parsed_proxies = options.trusted_proxies.map(parse_proxy_entry);