@softistx/alxia-react-router 0.0.0-stage → 0.83.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 (609) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +2085 -2
  3. package/dist/api-keys/api-keys.d.ts +93 -0
  4. package/dist/api-keys/api-keys.d.ts.map +1 -0
  5. package/dist/api-keys/index.d.ts +9 -0
  6. package/dist/api-keys/index.d.ts.map +1 -0
  7. package/dist/api-keys/index.js +66 -0
  8. package/dist/api-keys/index.js.map +10 -0
  9. package/dist/assets.d.ts +14 -0
  10. package/dist/assets.d.ts.map +1 -0
  11. package/dist/chunks/index-0786n4qe.js +25 -0
  12. package/dist/chunks/index-0786n4qe.js.map +10 -0
  13. package/dist/chunks/index-1nw5yeek.js +169 -0
  14. package/dist/chunks/index-1nw5yeek.js.map +11 -0
  15. package/dist/chunks/index-59vhfj6n.js +10 -0
  16. package/dist/chunks/index-59vhfj6n.js.map +10 -0
  17. package/dist/chunks/index-5gqcpyyg.js +34 -0
  18. package/dist/chunks/index-5gqcpyyg.js.map +10 -0
  19. package/dist/chunks/index-6jf7zpxz.js +119 -0
  20. package/dist/chunks/index-6jf7zpxz.js.map +11 -0
  21. package/dist/chunks/index-8as4j8m3.js +340 -0
  22. package/dist/chunks/index-8as4j8m3.js.map +16 -0
  23. package/dist/chunks/index-9xv2a8et.js +108 -0
  24. package/dist/chunks/index-9xv2a8et.js.map +11 -0
  25. package/dist/chunks/index-ajtvyq35.js +16 -0
  26. package/dist/chunks/index-ajtvyq35.js.map +10 -0
  27. package/dist/chunks/index-c55hxgr5.js +124 -0
  28. package/dist/chunks/index-c55hxgr5.js.map +14 -0
  29. package/dist/chunks/index-d42p3mdp.js +19 -0
  30. package/dist/chunks/index-d42p3mdp.js.map +10 -0
  31. package/dist/chunks/index-gac44rs5.js +42 -0
  32. package/dist/chunks/index-gac44rs5.js.map +11 -0
  33. package/dist/chunks/index-j4ktpcke.js +62 -0
  34. package/dist/chunks/index-j4ktpcke.js.map +10 -0
  35. package/dist/chunks/index-mscfme4r.js +12 -0
  36. package/dist/chunks/index-mscfme4r.js.map +10 -0
  37. package/dist/chunks/index-pghmb2dm.js +30 -0
  38. package/dist/chunks/index-pghmb2dm.js.map +10 -0
  39. package/dist/chunks/index-rfr02vg4.js +40 -0
  40. package/dist/chunks/index-rfr02vg4.js.map +10 -0
  41. package/dist/chunks/index-sfhshxqz.js +31 -0
  42. package/dist/chunks/index-sfhshxqz.js.map +10 -0
  43. package/dist/chunks/index-skwypsjz.js +357 -0
  44. package/dist/chunks/index-skwypsjz.js.map +12 -0
  45. package/dist/chunks/index-sxh06ged.js +118 -0
  46. package/dist/chunks/index-sxh06ged.js.map +11 -0
  47. package/dist/chunks/index-t2ph23wk.js +96 -0
  48. package/dist/chunks/index-t2ph23wk.js.map +13 -0
  49. package/dist/chunks/index-thyabr5n.js +19 -0
  50. package/dist/chunks/index-thyabr5n.js.map +10 -0
  51. package/dist/chunks/index-tx36swjx.js +134 -0
  52. package/dist/chunks/index-tx36swjx.js.map +11 -0
  53. package/dist/chunks/index-v2z5k640.js +54 -0
  54. package/dist/chunks/index-v2z5k640.js.map +11 -0
  55. package/dist/chunks/index-vr82typq.js +23 -0
  56. package/dist/chunks/index-vr82typq.js.map +11 -0
  57. package/dist/chunks/index-whj6h5eg.js +9 -0
  58. package/dist/chunks/index-whj6h5eg.js.map +10 -0
  59. package/dist/chunks/index-wyypkfdv.js +130 -0
  60. package/dist/chunks/index-wyypkfdv.js.map +13 -0
  61. package/dist/chunks/index-xd5aqy3g.js +90 -0
  62. package/dist/chunks/index-xd5aqy3g.js.map +10 -0
  63. package/dist/chunks/index-zdbqzcjp.js +97 -0
  64. package/dist/chunks/index-zdbqzcjp.js.map +12 -0
  65. package/dist/chunks/index-zyg8amjc.js +23 -0
  66. package/dist/chunks/index-zyg8amjc.js.map +10 -0
  67. package/dist/cli/index.d.ts +3 -0
  68. package/dist/cli/index.d.ts.map +1 -0
  69. package/dist/cli/index.js +215 -0
  70. package/dist/cli/index.js.map +13 -0
  71. package/dist/cli/main.d.ts +13 -0
  72. package/dist/cli/main.d.ts.map +1 -0
  73. package/dist/cli/reveal.d.ts +18 -0
  74. package/dist/cli/reveal.d.ts.map +1 -0
  75. package/dist/cli/template.d.ts +8 -0
  76. package/dist/cli/template.d.ts.map +1 -0
  77. package/dist/context.d.ts +104 -0
  78. package/dist/context.d.ts.map +1 -0
  79. package/dist/document/index.d.ts +11 -0
  80. package/dist/document/index.d.ts.map +1 -0
  81. package/dist/document/index.js +19 -0
  82. package/dist/document/index.js.map +9 -0
  83. package/dist/document/inline-script.d.ts +27 -0
  84. package/dist/document/inline-script.d.ts.map +1 -0
  85. package/dist/document/language-store.d.ts +8 -0
  86. package/dist/document/language-store.d.ts.map +1 -0
  87. package/dist/document/nonce.d.ts +34 -0
  88. package/dist/document/nonce.d.ts.map +1 -0
  89. package/dist/document/page-language.d.ts +39 -0
  90. package/dist/document/page-language.d.ts.map +1 -0
  91. package/dist/document/text-direction.d.ts +10 -0
  92. package/dist/document/text-direction.d.ts.map +1 -0
  93. package/dist/entry/abort.d.ts +21 -0
  94. package/dist/entry/abort.d.ts.map +1 -0
  95. package/dist/entry/create-entry.d.ts +41 -0
  96. package/dist/entry/create-entry.d.ts.map +1 -0
  97. package/dist/entry/index.d.ts +8 -0
  98. package/dist/entry/index.d.ts.map +1 -0
  99. package/dist/entry/index.js +154 -0
  100. package/dist/entry/index.js.map +13 -0
  101. package/dist/entry/root-data.d.ts +27 -0
  102. package/dist/entry/root-data.d.ts.map +1 -0
  103. package/dist/entry/whole-page.d.ts +10 -0
  104. package/dist/entry/whole-page.d.ts.map +1 -0
  105. package/dist/errors/api-error.d.ts +117 -0
  106. package/dist/errors/api-error.d.ts.map +1 -0
  107. package/dist/errors/api-errors.d.ts +122 -0
  108. package/dist/errors/api-errors.d.ts.map +1 -0
  109. package/dist/errors/call-failure.d.ts +45 -0
  110. package/dist/errors/call-failure.d.ts.map +1 -0
  111. package/dist/errors/catalogue-check.d.ts +24 -0
  112. package/dist/errors/catalogue-check.d.ts.map +1 -0
  113. package/dist/errors/catalogue-read.d.ts +33 -0
  114. package/dist/errors/catalogue-read.d.ts.map +1 -0
  115. package/dist/errors/catalogue.d.ts +59 -0
  116. package/dist/errors/catalogue.d.ts.map +1 -0
  117. package/dist/errors/code-resolver.d.ts +44 -0
  118. package/dist/errors/code-resolver.d.ts.map +1 -0
  119. package/dist/errors/cross-site.d.ts +8 -0
  120. package/dist/errors/cross-site.d.ts.map +1 -0
  121. package/dist/errors/describe-refusal.d.ts +6 -0
  122. package/dist/errors/describe-refusal.d.ts.map +1 -0
  123. package/dist/errors/describe.d.ts +3 -0
  124. package/dist/errors/describe.d.ts.map +1 -0
  125. package/dist/errors/fetcher-result.d.ts +33 -0
  126. package/dist/errors/fetcher-result.d.ts.map +1 -0
  127. package/dist/errors/field-placement.d.ts +12 -0
  128. package/dist/errors/field-placement.d.ts.map +1 -0
  129. package/dist/errors/form-errors.d.ts +8 -0
  130. package/dist/errors/form-errors.d.ts.map +1 -0
  131. package/dist/errors/form-refusal.d.ts +25 -0
  132. package/dist/errors/form-refusal.d.ts.map +1 -0
  133. package/dist/errors/index.d.ts +21 -0
  134. package/dist/errors/index.d.ts.map +1 -0
  135. package/dist/errors/index.js +588 -0
  136. package/dist/errors/index.js.map +26 -0
  137. package/dist/errors/json-actions.d.ts +38 -0
  138. package/dist/errors/json-actions.d.ts.map +1 -0
  139. package/dist/errors/log.d.ts +8 -0
  140. package/dist/errors/log.d.ts.map +1 -0
  141. package/dist/errors/message-values.d.ts +11 -0
  142. package/dist/errors/message-values.d.ts.map +1 -0
  143. package/dist/errors/messages.d.ts +63 -0
  144. package/dist/errors/messages.d.ts.map +1 -0
  145. package/dist/errors/page-path.d.ts +9 -0
  146. package/dist/errors/page-path.d.ts.map +1 -0
  147. package/dist/errors/problem-error.d.ts +50 -0
  148. package/dist/errors/problem-error.d.ts.map +1 -0
  149. package/dist/errors/provider.d.ts +20 -0
  150. package/dist/errors/provider.d.ts.map +1 -0
  151. package/dist/errors/request-id.d.ts +5 -0
  152. package/dist/errors/request-id.d.ts.map +1 -0
  153. package/dist/errors/route-error.d.ts +33 -0
  154. package/dist/errors/route-error.d.ts.map +1 -0
  155. package/dist/errors/route-refusal.d.ts +20 -0
  156. package/dist/errors/route-refusal.d.ts.map +1 -0
  157. package/dist/errors/same-site.d.ts +49 -0
  158. package/dist/errors/same-site.d.ts.map +1 -0
  159. package/dist/errors/section-action.d.ts +46 -0
  160. package/dist/errors/section-action.d.ts.map +1 -0
  161. package/dist/errors/standard-schema.d.ts +34 -0
  162. package/dist/errors/standard-schema.d.ts.map +1 -0
  163. package/dist/errors/submit-form.d.ts +16 -0
  164. package/dist/errors/submit-form.d.ts.map +1 -0
  165. package/dist/errors/upstream-headers.d.ts +18 -0
  166. package/dist/errors/upstream-headers.d.ts.map +1 -0
  167. package/dist/errors/use-json-fetcher.d.ts +18 -0
  168. package/dist/errors/use-json-fetcher.d.ts.map +1 -0
  169. package/dist/fetcher/auth-refusal.d.ts +29 -0
  170. package/dist/fetcher/auth-refusal.d.ts.map +1 -0
  171. package/dist/fetcher/index.d.ts +20 -0
  172. package/dist/fetcher/index.d.ts.map +1 -0
  173. package/dist/fetcher/index.js +392 -0
  174. package/dist/fetcher/index.js.map +21 -0
  175. package/dist/fetcher/section-form.d.ts +24 -0
  176. package/dist/fetcher/section-form.d.ts.map +1 -0
  177. package/dist/fetcher/section-reload.d.ts +17 -0
  178. package/dist/fetcher/section-reload.d.ts.map +1 -0
  179. package/dist/fetcher/section-save.d.ts +29 -0
  180. package/dist/fetcher/section-save.d.ts.map +1 -0
  181. package/dist/fetcher/use-debounced-fetcher.d.ts +57 -0
  182. package/dist/fetcher/use-debounced-fetcher.d.ts.map +1 -0
  183. package/dist/fetcher/use-fetcher-answer.d.ts +16 -0
  184. package/dist/fetcher/use-fetcher-answer.d.ts.map +1 -0
  185. package/dist/fetcher/use-fetcher-done.d.ts +15 -0
  186. package/dist/fetcher/use-fetcher-done.d.ts.map +1 -0
  187. package/dist/fetcher/use-fetcher-promise.d.ts +48 -0
  188. package/dist/fetcher/use-fetcher-promise.d.ts.map +1 -0
  189. package/dist/fetcher/use-form-refusal.d.ts +20 -0
  190. package/dist/fetcher/use-form-refusal.d.ts.map +1 -0
  191. package/dist/fetcher/use-revalidate-on-focus.d.ts +20 -0
  192. package/dist/fetcher/use-revalidate-on-focus.d.ts.map +1 -0
  193. package/dist/fetcher/use-row-save.d.ts +32 -0
  194. package/dist/fetcher/use-row-save.d.ts.map +1 -0
  195. package/dist/fetcher/use-section-save.d.ts +46 -0
  196. package/dist/fetcher/use-section-save.d.ts.map +1 -0
  197. package/dist/fetcher/use-visible-interval.d.ts +24 -0
  198. package/dist/fetcher/use-visible-interval.d.ts.map +1 -0
  199. package/dist/fetcher/use-visible-revalidation.d.ts +10 -0
  200. package/dist/fetcher/use-visible-revalidation.d.ts.map +1 -0
  201. package/dist/health.d.ts +21 -0
  202. package/dist/health.d.ts.map +1 -0
  203. package/dist/help/check/check.d.ts +35 -0
  204. package/dist/help/check/check.d.ts.map +1 -0
  205. package/dist/help/check/index.d.ts +8 -0
  206. package/dist/help/check/index.d.ts.map +1 -0
  207. package/dist/help/check/index.js +17 -0
  208. package/dist/help/check/index.js.map +9 -0
  209. package/dist/help/check/routes.d.ts +22 -0
  210. package/dist/help/check/routes.d.ts.map +1 -0
  211. package/dist/help/guide.d.ts +33 -0
  212. package/dist/help/guide.d.ts.map +1 -0
  213. package/dist/help/index.d.ts +16 -0
  214. package/dist/help/index.d.ts.map +1 -0
  215. package/dist/help/index.js +192 -0
  216. package/dist/help/index.js.map +14 -0
  217. package/dist/help/load.d.ts +39 -0
  218. package/dist/help/load.d.ts.map +1 -0
  219. package/dist/help/panel.d.ts +69 -0
  220. package/dist/help/panel.d.ts.map +1 -0
  221. package/dist/help/parse-flow.d.ts +27 -0
  222. package/dist/help/parse-flow.d.ts.map +1 -0
  223. package/dist/help/react.d.ts +12 -0
  224. package/dist/help/react.d.ts.map +1 -0
  225. package/dist/help/resolve.d.ts +24 -0
  226. package/dist/help/resolve.d.ts.map +1 -0
  227. package/dist/help/types.d.ts +50 -0
  228. package/dist/help/types.d.ts.map +1 -0
  229. package/dist/help/yaml.d.ts +18 -0
  230. package/dist/help/yaml.d.ts.map +1 -0
  231. package/dist/index.d.ts +7 -0
  232. package/dist/index.d.ts.map +1 -0
  233. package/dist/index.js +197 -0
  234. package/dist/index.js.map +14 -0
  235. package/dist/link/index.d.ts +7 -0
  236. package/dist/link/index.d.ts.map +1 -0
  237. package/dist/link/index.js +16 -0
  238. package/dist/link/index.js.map +10 -0
  239. package/dist/link/router-link.d.ts +27 -0
  240. package/dist/link/router-link.d.ts.map +1 -0
  241. package/dist/lists/connection-page.d.ts +50 -0
  242. package/dist/lists/connection-page.d.ts.map +1 -0
  243. package/dist/lists/index.d.ts +13 -0
  244. package/dist/lists/index.d.ts.map +1 -0
  245. package/dist/lists/index.js +205 -0
  246. package/dist/lists/index.js.map +15 -0
  247. package/dist/lists/newest-first.d.ts +5 -0
  248. package/dist/lists/newest-first.d.ts.map +1 -0
  249. package/dist/lists/nodes-of.d.ts +21 -0
  250. package/dist/lists/nodes-of.d.ts.map +1 -0
  251. package/dist/lists/or-failed.d.ts +19 -0
  252. package/dist/lists/or-failed.d.ts.map +1 -0
  253. package/dist/lists/use-paged-rows.d.ts +40 -0
  254. package/dist/lists/use-paged-rows.d.ts.map +1 -0
  255. package/dist/lists/use-same-route-loading.d.ts +8 -0
  256. package/dist/lists/use-same-route-loading.d.ts.map +1 -0
  257. package/dist/lists/use-search-change.d.ts +20 -0
  258. package/dist/lists/use-search-change.d.ts.map +1 -0
  259. package/dist/mcp/index.d.ts +8 -0
  260. package/dist/mcp/index.d.ts.map +1 -0
  261. package/dist/mcp/index.js +105 -0
  262. package/dist/mcp/index.js.map +11 -0
  263. package/dist/mcp/mcp-relay.d.ts +58 -0
  264. package/dist/mcp/mcp-relay.d.ts.map +1 -0
  265. package/dist/mcp/relay.d.ts +38 -0
  266. package/dist/mcp/relay.d.ts.map +1 -0
  267. package/dist/media/client/error.d.ts +29 -0
  268. package/dist/media/client/error.d.ts.map +1 -0
  269. package/dist/media/client/index.d.ts +8 -0
  270. package/dist/media/client/index.d.ts.map +1 -0
  271. package/dist/media/client/index.js +133 -0
  272. package/dist/media/client/index.js.map +11 -0
  273. package/dist/media/client/upload.d.ts +32 -0
  274. package/dist/media/client/upload.d.ts.map +1 -0
  275. package/dist/media/forward.d.ts +14 -0
  276. package/dist/media/forward.d.ts.map +1 -0
  277. package/dist/media/headers.d.ts +11 -0
  278. package/dist/media/headers.d.ts.map +1 -0
  279. package/dist/media/index.d.ts +9 -0
  280. package/dist/media/index.d.ts.map +1 -0
  281. package/dist/media/index.js +396 -0
  282. package/dist/media/index.js.map +16 -0
  283. package/dist/media/options.d.ts +114 -0
  284. package/dist/media/options.d.ts.map +1 -0
  285. package/dist/media/path.d.ts +12 -0
  286. package/dist/media/path.d.ts.map +1 -0
  287. package/dist/media/read.d.ts +11 -0
  288. package/dist/media/read.d.ts.map +1 -0
  289. package/dist/media/refusal.d.ts +11 -0
  290. package/dist/media/refusal.d.ts.map +1 -0
  291. package/dist/media/respond.d.ts +8 -0
  292. package/dist/media/respond.d.ts.map +1 -0
  293. package/dist/media/write.d.ts +13 -0
  294. package/dist/media/write.d.ts.map +1 -0
  295. package/dist/navigation/index.d.ts +9 -0
  296. package/dist/navigation/index.d.ts.map +1 -0
  297. package/dist/navigation/index.js +48 -0
  298. package/dist/navigation/index.js.map +11 -0
  299. package/dist/navigation/use-focus-on-navigate.d.ts +16 -0
  300. package/dist/navigation/use-focus-on-navigate.d.ts.map +1 -0
  301. package/dist/navigation/use-route-transition.d.ts +19 -0
  302. package/dist/navigation/use-route-transition.d.ts.map +1 -0
  303. package/dist/nonce.d.ts +16 -0
  304. package/dist/nonce.d.ts.map +1 -0
  305. package/dist/oauth/answer.d.ts +33 -0
  306. package/dist/oauth/answer.d.ts.map +1 -0
  307. package/dist/oauth/binding.d.ts +43 -0
  308. package/dist/oauth/binding.d.ts.map +1 -0
  309. package/dist/oauth/consent.d.ts +134 -0
  310. package/dist/oauth/consent.d.ts.map +1 -0
  311. package/dist/oauth/grants.d.ts +88 -0
  312. package/dist/oauth/grants.d.ts.map +1 -0
  313. package/dist/oauth/index.d.ts +16 -0
  314. package/dist/oauth/index.d.ts.map +1 -0
  315. package/dist/oauth/index.js +207 -0
  316. package/dist/oauth/index.js.map +12 -0
  317. package/dist/oauth/model.d.ts +13 -0
  318. package/dist/oauth/model.d.ts.map +1 -0
  319. package/dist/oauth/react/index.d.ts +7 -0
  320. package/dist/oauth/react/index.d.ts.map +1 -0
  321. package/dist/oauth/react/index.js +99 -0
  322. package/dist/oauth/react/index.js.map +10 -0
  323. package/dist/oauth/react/use-consent.d.ts +52 -0
  324. package/dist/oauth/react/use-consent.d.ts.map +1 -0
  325. package/dist/oidc/dpop.d.ts +80 -0
  326. package/dist/oidc/dpop.d.ts.map +1 -0
  327. package/dist/oidc/errors.d.ts +16 -0
  328. package/dist/oidc/errors.d.ts.map +1 -0
  329. package/dist/oidc/flow.d.ts +59 -0
  330. package/dist/oidc/flow.d.ts.map +1 -0
  331. package/dist/oidc/index.d.ts +11 -0
  332. package/dist/oidc/index.d.ts.map +1 -0
  333. package/dist/oidc/index.js +742 -0
  334. package/dist/oidc/index.js.map +15 -0
  335. package/dist/oidc/oidc.d.ts +132 -0
  336. package/dist/oidc/oidc.d.ts.map +1 -0
  337. package/dist/oidc/revoke.d.ts +28 -0
  338. package/dist/oidc/revoke.d.ts.map +1 -0
  339. package/dist/oidc/seal.d.ts +20 -0
  340. package/dist/oidc/seal.d.ts.map +1 -0
  341. package/dist/pwa/build/build-worker.d.ts +41 -0
  342. package/dist/pwa/build/build-worker.d.ts.map +1 -0
  343. package/dist/pwa/build/index.d.ts +9 -0
  344. package/dist/pwa/build/index.d.ts.map +1 -0
  345. package/dist/pwa/build/index.js +9 -0
  346. package/dist/pwa/build/index.js.map +9 -0
  347. package/dist/pwa/build/precache.d.ts +17 -0
  348. package/dist/pwa/build/precache.d.ts.map +1 -0
  349. package/dist/pwa/index.d.ts +16 -0
  350. package/dist/pwa/index.d.ts.map +1 -0
  351. package/dist/pwa/index.js +110 -0
  352. package/dist/pwa/index.js.map +12 -0
  353. package/dist/pwa/model/caching.d.ts +46 -0
  354. package/dist/pwa/model/caching.d.ts.map +1 -0
  355. package/dist/pwa/model/clear-app-caches.d.ts +9 -0
  356. package/dist/pwa/model/clear-app-caches.d.ts.map +1 -0
  357. package/dist/pwa/model/font-precache.d.ts +15 -0
  358. package/dist/pwa/model/font-precache.d.ts.map +1 -0
  359. package/dist/pwa/model/manifest.d.ts +80 -0
  360. package/dist/pwa/model/manifest.d.ts.map +1 -0
  361. package/dist/pwa/model/precache-list.d.ts +40 -0
  362. package/dist/pwa/model/precache-list.d.ts.map +1 -0
  363. package/dist/pwa/model/registration.d.ts +39 -0
  364. package/dist/pwa/model/registration.d.ts.map +1 -0
  365. package/dist/pwa/model/start-service-worker.d.ts +24 -0
  366. package/dist/pwa/model/start-service-worker.d.ts.map +1 -0
  367. package/dist/pwa/model/storable.d.ts +8 -0
  368. package/dist/pwa/model/storable.d.ts.map +1 -0
  369. package/dist/pwa/model/theme-color.d.ts +20 -0
  370. package/dist/pwa/model/theme-color.d.ts.map +1 -0
  371. package/dist/pwa/model/update-notice.d.ts +38 -0
  372. package/dist/pwa/model/update-notice.d.ts.map +1 -0
  373. package/dist/pwa/model/worker-contract.d.ts +61 -0
  374. package/dist/pwa/model/worker-contract.d.ts.map +1 -0
  375. package/dist/pwa/react/index.d.ts +9 -0
  376. package/dist/pwa/react/index.d.ts.map +1 -0
  377. package/dist/pwa/react/index.js +75 -0
  378. package/dist/pwa/react/index.js.map +13 -0
  379. package/dist/pwa/react/use-online.d.ts +6 -0
  380. package/dist/pwa/react/use-online.d.ts.map +1 -0
  381. package/dist/pwa/react/use-service-worker.d.ts +33 -0
  382. package/dist/pwa/react/use-service-worker.d.ts.map +1 -0
  383. package/dist/pwa/react/use-update-notice.d.ts +14 -0
  384. package/dist/pwa/react/use-update-notice.d.ts.map +1 -0
  385. package/dist/pwa/server/index.d.ts +7 -0
  386. package/dist/pwa/server/index.d.ts.map +1 -0
  387. package/dist/pwa/server/index.js +18 -0
  388. package/dist/pwa/server/index.js.map +10 -0
  389. package/dist/pwa/server/no-cache.d.ts +22 -0
  390. package/dist/pwa/server/no-cache.d.ts.map +1 -0
  391. package/dist/pwa/worker/index.d.ts +9 -0
  392. package/dist/pwa/worker/index.d.ts.map +1 -0
  393. package/dist/pwa/worker/index.js +144 -0
  394. package/dist/pwa/worker/index.js.map +12 -0
  395. package/dist/pwa/worker/injected.d.ts +15 -0
  396. package/dist/pwa/worker/injected.d.ts.map +1 -0
  397. package/dist/pwa/worker/plan.d.ts +65 -0
  398. package/dist/pwa/worker/plan.d.ts.map +1 -0
  399. package/dist/pwa/worker/scope.d.ts +18 -0
  400. package/dist/pwa/worker/scope.d.ts.map +1 -0
  401. package/dist/pwa/worker/start-worker.d.ts +17 -0
  402. package/dist/pwa/worker/start-worker.d.ts.map +1 -0
  403. package/dist/react-router.d.ts +68 -0
  404. package/dist/react-router.d.ts.map +1 -0
  405. package/dist/server.d.ts +127 -0
  406. package/dist/server.d.ts.map +1 -0
  407. package/dist/session/codes.d.ts +9 -0
  408. package/dist/session/codes.d.ts.map +1 -0
  409. package/dist/session/cookies.d.ts +128 -0
  410. package/dist/session/cookies.d.ts.map +1 -0
  411. package/dist/session/flow-types.d.ts +235 -0
  412. package/dist/session/flow-types.d.ts.map +1 -0
  413. package/dist/session/guard.d.ts +10 -0
  414. package/dist/session/guard.d.ts.map +1 -0
  415. package/dist/session/index.d.ts +22 -0
  416. package/dist/session/index.d.ts.map +1 -0
  417. package/dist/session/index.js +1090 -0
  418. package/dist/session/index.js.map +27 -0
  419. package/dist/session/land.d.ts +28 -0
  420. package/dist/session/land.d.ts.map +1 -0
  421. package/dist/session/link-json.d.ts +22 -0
  422. package/dist/session/link-json.d.ts.map +1 -0
  423. package/dist/session/link-land.d.ts +20 -0
  424. package/dist/session/link-land.d.ts.map +1 -0
  425. package/dist/session/link-token.d.ts +24 -0
  426. package/dist/session/link-token.d.ts.map +1 -0
  427. package/dist/session/link-types.d.ts +142 -0
  428. package/dist/session/link-types.d.ts.map +1 -0
  429. package/dist/session/links.d.ts +14 -0
  430. package/dist/session/links.d.ts.map +1 -0
  431. package/dist/session/model/index.d.ts +8 -0
  432. package/dist/session/model/index.d.ts.map +1 -0
  433. package/dist/session/model/index.js +35 -0
  434. package/dist/session/model/index.js.map +9 -0
  435. package/dist/session/model/link-post.d.ts +35 -0
  436. package/dist/session/model/link-post.d.ts.map +1 -0
  437. package/dist/session/model/paths.d.ts +24 -0
  438. package/dist/session/model/paths.d.ts.map +1 -0
  439. package/dist/session/model/safe-next.d.ts +15 -0
  440. package/dist/session/model/safe-next.d.ts.map +1 -0
  441. package/dist/session/model/second-factor.d.ts +16 -0
  442. package/dist/session/model/second-factor.d.ts.map +1 -0
  443. package/dist/session/model/site-path.d.ts +10 -0
  444. package/dist/session/model/site-path.d.ts.map +1 -0
  445. package/dist/session/model/step-up-answers.d.ts +45 -0
  446. package/dist/session/model/step-up-answers.d.ts.map +1 -0
  447. package/dist/session/model/step-up-props.d.ts +22 -0
  448. package/dist/session/model/step-up-props.d.ts.map +1 -0
  449. package/dist/session/model/step-up.d.ts +48 -0
  450. package/dist/session/model/step-up.d.ts.map +1 -0
  451. package/dist/session/react/index.d.ts +13 -0
  452. package/dist/session/react/index.d.ts.map +1 -0
  453. package/dist/session/react/index.js +196 -0
  454. package/dist/session/react/index.js.map +14 -0
  455. package/dist/session/react/step-up/answers.d.ts +9 -0
  456. package/dist/session/react/step-up/answers.d.ts.map +1 -0
  457. package/dist/session/react/step-up/dialog-props.d.ts +27 -0
  458. package/dist/session/react/step-up/dialog-props.d.ts.map +1 -0
  459. package/dist/session/react/step-up/index.d.ts +7 -0
  460. package/dist/session/react/step-up/index.d.ts.map +1 -0
  461. package/dist/session/react/step-up/pending-runs.d.ts +21 -0
  462. package/dist/session/react/step-up/pending-runs.d.ts.map +1 -0
  463. package/dist/session/react/step-up/phase.d.ts +8 -0
  464. package/dist/session/react/step-up/phase.d.ts.map +1 -0
  465. package/dist/session/react/step-up/use-step-up-replay.d.ts +59 -0
  466. package/dist/session/react/step-up/use-step-up-replay.d.ts.map +1 -0
  467. package/dist/session/react/step-up/use-step-up-runner.d.ts +70 -0
  468. package/dist/session/react/step-up/use-step-up-runner.d.ts.map +1 -0
  469. package/dist/session/react/step-up/use-step-up.d.ts +51 -0
  470. package/dist/session/react/step-up/use-step-up.d.ts.map +1 -0
  471. package/dist/session/react/use-code-field.d.ts +37 -0
  472. package/dist/session/react/use-code-field.d.ts.map +1 -0
  473. package/dist/session/react/use-link-fragment.d.ts +22 -0
  474. package/dist/session/react/use-link-fragment.d.ts.map +1 -0
  475. package/dist/session/react/use-link-param.d.ts +26 -0
  476. package/dist/session/react/use-link-param.d.ts.map +1 -0
  477. package/dist/session/react/use-link-post.d.ts +39 -0
  478. package/dist/session/react/use-link-post.d.ts.map +1 -0
  479. package/dist/session/react/use-sign-out.d.ts +46 -0
  480. package/dist/session/react/use-sign-out.d.ts.map +1 -0
  481. package/dist/session/second-factor.d.ts +22 -0
  482. package/dist/session/second-factor.d.ts.map +1 -0
  483. package/dist/session/serialize.d.ts +42 -0
  484. package/dist/session/serialize.d.ts.map +1 -0
  485. package/dist/session/sign-in.d.ts +19 -0
  486. package/dist/session/sign-in.d.ts.map +1 -0
  487. package/dist/session/signed.d.ts +44 -0
  488. package/dist/session/signed.d.ts.map +1 -0
  489. package/dist/session/social-flow.d.ts +22 -0
  490. package/dist/session/social-flow.d.ts.map +1 -0
  491. package/dist/session/social-land.d.ts +31 -0
  492. package/dist/session/social-land.d.ts.map +1 -0
  493. package/dist/session/social-types.d.ts +136 -0
  494. package/dist/session/social-types.d.ts.map +1 -0
  495. package/dist/session/social.d.ts +32 -0
  496. package/dist/session/social.d.ts.map +1 -0
  497. package/dist/session/step-up-codes.d.ts +9 -0
  498. package/dist/session/step-up-codes.d.ts.map +1 -0
  499. package/dist/session/step-up-signed-out.d.ts +21 -0
  500. package/dist/session/step-up-signed-out.d.ts.map +1 -0
  501. package/dist/session/step-up-types.d.ts +127 -0
  502. package/dist/session/step-up-types.d.ts.map +1 -0
  503. package/dist/session/step-up.d.ts +17 -0
  504. package/dist/session/step-up.d.ts.map +1 -0
  505. package/dist/session/step.d.ts +22 -0
  506. package/dist/session/step.d.ts.map +1 -0
  507. package/dist/session/throttle.d.ts +73 -0
  508. package/dist/session/throttle.d.ts.map +1 -0
  509. package/dist/session/timed-wait.d.ts +4 -0
  510. package/dist/session/timed-wait.d.ts.map +1 -0
  511. package/dist/session/viewer.d.ts +34 -0
  512. package/dist/session/viewer.d.ts.map +1 -0
  513. package/dist/subscription/documents.d.ts +3 -0
  514. package/dist/subscription/documents.d.ts.map +1 -0
  515. package/dist/subscription/index.d.ts +7 -0
  516. package/dist/subscription/index.d.ts.map +1 -0
  517. package/dist/subscription/index.js +359 -0
  518. package/dist/subscription/index.js.map +14 -0
  519. package/dist/subscription/proxy.d.ts +54 -0
  520. package/dist/subscription/proxy.d.ts.map +1 -0
  521. package/dist/subscription/react/backoff.d.ts +8 -0
  522. package/dist/subscription/react/backoff.d.ts.map +1 -0
  523. package/dist/subscription/react/classify.d.ts +15 -0
  524. package/dist/subscription/react/classify.d.ts.map +1 -0
  525. package/dist/subscription/react/controller.d.ts +40 -0
  526. package/dist/subscription/react/controller.d.ts.map +1 -0
  527. package/dist/subscription/react/fake-timers.d.ts +8 -0
  528. package/dist/subscription/react/fake-timers.d.ts.map +1 -0
  529. package/dist/subscription/react/index.d.ts +15 -0
  530. package/dist/subscription/react/index.d.ts.map +1 -0
  531. package/dist/subscription/react/index.js +227 -0
  532. package/dist/subscription/react/index.js.map +17 -0
  533. package/dist/subscription/react/reconnect.d.ts +9 -0
  534. package/dist/subscription/react/reconnect.d.ts.map +1 -0
  535. package/dist/subscription/react/scheduler.d.ts +13 -0
  536. package/dist/subscription/react/scheduler.d.ts.map +1 -0
  537. package/dist/subscription/react/timers.d.ts +7 -0
  538. package/dist/subscription/react/timers.d.ts.map +1 -0
  539. package/dist/subscription/react/use-live-subscription.d.ts +36 -0
  540. package/dist/subscription/react/use-live-subscription.d.ts.map +1 -0
  541. package/dist/subscription/react/versions.d.ts +6 -0
  542. package/dist/subscription/react/versions.d.ts.map +1 -0
  543. package/dist/subscription/read.d.ts +17 -0
  544. package/dist/subscription/read.d.ts.map +1 -0
  545. package/dist/subscription/refusal.d.ts +11 -0
  546. package/dist/subscription/refusal.d.ts.map +1 -0
  547. package/dist/subscription/relay.d.ts +16 -0
  548. package/dist/subscription/relay.d.ts.map +1 -0
  549. package/dist/vite/bun.d.ts +21 -0
  550. package/dist/vite/bun.d.ts.map +1 -0
  551. package/dist/vite/bundle.d.ts +33 -0
  552. package/dist/vite/bundle.d.ts.map +1 -0
  553. package/dist/vite/compress.d.ts +18 -0
  554. package/dist/vite/compress.d.ts.map +1 -0
  555. package/dist/vite/config.d.ts +33 -0
  556. package/dist/vite/config.d.ts.map +1 -0
  557. package/dist/vite/dev.d.ts +28 -0
  558. package/dist/vite/dev.d.ts.map +1 -0
  559. package/dist/vite/entry.d.ts +20 -0
  560. package/dist/vite/entry.d.ts.map +1 -0
  561. package/dist/vite/hosts.d.ts +16 -0
  562. package/dist/vite/hosts.d.ts.map +1 -0
  563. package/dist/vite/index.d.ts +68 -0
  564. package/dist/vite/index.d.ts.map +1 -0
  565. package/dist/vite/index.js +635 -0
  566. package/dist/vite/index.js.map +22 -0
  567. package/dist/vite/inline.d.ts +18 -0
  568. package/dist/vite/inline.d.ts.map +1 -0
  569. package/dist/vite/node.d.ts +16 -0
  570. package/dist/vite/node.d.ts.map +1 -0
  571. package/dist/vite/preview.d.ts +8 -0
  572. package/dist/vite/preview.d.ts.map +1 -0
  573. package/dist/vite/runtime.d.ts +8 -0
  574. package/dist/vite/runtime.d.ts.map +1 -0
  575. package/dist/vite/socket.d.ts +75 -0
  576. package/dist/vite/socket.d.ts.map +1 -0
  577. package/dist/vite/worker.d.ts +16 -0
  578. package/dist/vite/worker.d.ts.map +1 -0
  579. package/dist/with-alxia.d.ts +36 -0
  580. package/dist/with-alxia.d.ts.map +1 -0
  581. package/docs/README.md +42 -0
  582. package/docs/guide/api-keys.md +216 -0
  583. package/docs/guide/beside-the-pages.md +201 -0
  584. package/docs/guide/csp-nonce.md +166 -0
  585. package/docs/guide/customising-the-server.md +324 -0
  586. package/docs/guide/deploying.md +102 -0
  587. package/docs/guide/document.md +334 -0
  588. package/docs/guide/errors.md +1147 -0
  589. package/docs/guide/fetcher.md +355 -0
  590. package/docs/guide/getting-started.md +112 -0
  591. package/docs/guide/help.md +325 -0
  592. package/docs/guide/how-it-works.md +274 -0
  593. package/docs/guide/link.md +32 -0
  594. package/docs/guide/lists.md +225 -0
  595. package/docs/guide/mcp.md +173 -0
  596. package/docs/guide/media.md +273 -0
  597. package/docs/guide/navigation.md +52 -0
  598. package/docs/guide/oauth.md +342 -0
  599. package/docs/guide/oidc.md +262 -0
  600. package/docs/guide/openapi.md +51 -0
  601. package/docs/guide/pwa.md +670 -0
  602. package/docs/guide/session.md +2105 -0
  603. package/docs/guide/subscriptions.md +211 -0
  604. package/docs/guide/testing.md +42 -0
  605. package/docs/guide/typing-the-loaders.md +311 -0
  606. package/docs/guide.md +82 -0
  607. package/docs/roadmap.md +474 -0
  608. package/docs/troubleshooting.md +3837 -0
  609. package/package.json +301 -5
@@ -0,0 +1,31 @@
1
+ import { type SessionCookies } from './cookies';
2
+ import type { SocialOutcome } from './social-types';
3
+ /** What the landing reads: the app's cookies, the landing paths and parameter names, and the flow cookie's clearing. */
4
+ export interface LandContext {
5
+ readonly cookies: SessionCookies<boolean>;
6
+ readonly secondFactor: string;
7
+ readonly signIn: string;
8
+ /** `paths.linked`, when the app set one. */
9
+ readonly linked: string | undefined;
10
+ readonly errorParam: string;
11
+ readonly socialParam: string;
12
+ readonly invalid: string;
13
+ readonly name: string;
14
+ readonly base: string;
15
+ readonly secure: boolean;
16
+ }
17
+ /** A 302 to `location` setting `cookies`. */
18
+ export declare const found: (location: string, cookies: readonly string[]) => Response;
19
+ type ErrorParams = Extract<SocialOutcome, {
20
+ kind: 'error';
21
+ }>['params'];
22
+ /** The sign-in page with an error code; the flow cookie is cleared. */
23
+ export declare function signInFailed(ctx: LandContext, code: string, params?: ErrorParams): Response;
24
+ /** Where a sign-in `complete` outcome leads; the flow cookie is cleared on each. */
25
+ export declare function landOutcome(ctx: LandContext, outcome: SocialOutcome, kept: string): Response;
26
+ /** Where a link `complete` outcome leads; the flow cookie is cleared on each, and no session is opened. */
27
+ export declare function landLink(ctx: LandContext, outcome: SocialOutcome, kept: string): Response;
28
+ /** Where `link` sends a request from another site: the link landing with the error code. No cookie is set or cleared, so an attacker cannot end a flow in progress. */
29
+ export declare function linkRefused(ctx: LandContext, kept: string, code: string): Response;
30
+ export {};
31
+ //# sourceMappingURL=social-land.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"social-land.d.ts","sourceRoot":"","sources":["../../src/session/social-land.ts"],"names":[],"mappings":"AAAA,OAAO,EAAoB,KAAK,cAAc,EAAE,MAAM,WAAW,CAAC;AAIlE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAEpD,wHAAwH;AACxH,MAAM,WAAW,WAAW;IAC3B,QAAQ,CAAC,OAAO,EAAE,cAAc,CAAC,OAAO,CAAC,CAAC;IAC1C,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;IAC9B,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,4CAA4C;IAC5C,QAAQ,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC;IACpC,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAC;CACzB;AAED,6CAA6C;AAC7C,eAAO,MAAM,KAAK,GACjB,UAAU,MAAM,EAChB,SAAS,SAAS,MAAM,EAAE,KACxB,QAIF,CAAC;AASF,KAAK,WAAW,GAAG,OAAO,CAAC,aAAa,EAAE;IAAE,IAAI,EAAE,OAAO,CAAA;CAAE,CAAC,CAAC,QAAQ,CAAC,CAAC;AAcvE,uEAAuE;AACvE,wBAAgB,YAAY,CAC3B,GAAG,EAAE,WAAW,EAChB,IAAI,EAAE,MAAM,EACZ,MAAM,CAAC,EAAE,WAAW,GAClB,QAAQ,CAIV;AASD,oFAAoF;AACpF,wBAAgB,WAAW,CAC1B,GAAG,EAAE,WAAW,EAChB,OAAO,EAAE,aAAa,EACtB,IAAI,EAAE,MAAM,GACV,QAAQ,CA6BV;AAMD,2GAA2G;AAC3G,wBAAgB,QAAQ,CACvB,GAAG,EAAE,WAAW,EAChB,OAAO,EAAE,aAAa,EACtB,IAAI,EAAE,MAAM,GACV,QAAQ,CAcV;AAED,uKAAuK;AACvK,wBAAgB,WAAW,CAC1B,GAAG,EAAE,WAAW,EAChB,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,MAAM,GACV,QAAQ,CAKV"}
@@ -0,0 +1,136 @@
1
+ import type { SessionCookies } from './cookies';
2
+ import type { FlowKind } from './social-flow';
3
+ /** What a social sign-in route handler is called with: the loader's arguments, as far as the helper reads them. */
4
+ export interface SocialArgs<C = unknown> {
5
+ readonly request: Request;
6
+ readonly params: {
7
+ readonly provider?: string | undefined;
8
+ };
9
+ readonly context?: C | undefined;
10
+ }
11
+ /** What the API's `socialSignInStart` answered: where the provider's page is, and the flow token to keep until it calls back. */
12
+ export interface SocialStart {
13
+ readonly url: string;
14
+ readonly flow: string;
15
+ }
16
+ /** What `complete` is given: the whole callback URL (the provider's `code` and `state` are in its query), and the flow token kept at the start. */
17
+ export interface SocialCompleteInput<P extends string = string> {
18
+ readonly provider: P;
19
+ readonly callbackUrl: string;
20
+ readonly flow: string;
21
+ }
22
+ /** What the API's `socialSignInComplete` came to. */
23
+ export type SocialOutcome = {
24
+ readonly kind: 'session';
25
+ readonly token: string;
26
+ readonly expiresAt: string | Date;
27
+ /** A path of this site to land on; anything else is `/`. */
28
+ readonly returnTo?: string | null | undefined;
29
+ } | {
30
+ readonly kind: 'secondFactor';
31
+ readonly challenge: string;
32
+ readonly expiresAt?: string | Date | null | undefined;
33
+ readonly returnTo?: string | null | undefined;
34
+ } | {
35
+ /**
36
+ * A link flow's success: the provider is attached to the signed-in
37
+ * account and no session is opened. Lands on `returnTo` (checked), else
38
+ * the kept one when not `/`, else `paths.linked`, with `?social=linked`.
39
+ */
40
+ readonly kind: 'linked';
41
+ readonly returnTo?: string | null | undefined;
42
+ } | {
43
+ /**
44
+ * A refusal. Lands with `?error=<code>`; `params` (for example the API's
45
+ * `{ minutes: 5, retryAfter: 300 }` for a throttled callback) are added
46
+ * beside it as query parameters so the page can word a wait. A key equal
47
+ * to `errorParam` or `socialParam` is ignored; `undefined` values are left out.
48
+ */
49
+ readonly kind: 'error';
50
+ readonly code: string;
51
+ readonly params?: Readonly<Record<string, string | number | boolean | undefined>> | undefined;
52
+ };
53
+ /** Which flow a callback belongs to. */
54
+ export type SocialFlowKind = FlowKind;
55
+ /** What `linkStart` is called with, and `start` too. */
56
+ export interface SocialStartContext<C = unknown> {
57
+ readonly request: Request;
58
+ readonly context: C | undefined;
59
+ readonly returnTo: string;
60
+ }
61
+ /** The cookie that keeps the flow token between the start and the callback. */
62
+ export interface SocialFlowCookie {
63
+ /** Base name; `__Secure-` is added when `secure`. `'social_flow'` by default. */
64
+ readonly name?: string | undefined;
65
+ /** Seconds the flow may take. 600 by default. */
66
+ readonly seconds?: number | undefined;
67
+ /** The app is served over HTTPS. Required, never read from the environment. */
68
+ readonly secure: boolean;
69
+ }
70
+ export interface SocialRoutesOptions<C = unknown, P extends string = string> {
71
+ /** The providers the routes answer; any other `:provider` is a 404. */
72
+ readonly providers: readonly P[];
73
+ readonly flowCookie: SocialFlowCookie;
74
+ /** The app's call to `socialSignInStart`. `returnTo` is the request's `?next`, already checked. */
75
+ start(provider: P, ctx: SocialStartContext<C>): Promise<SocialStart>;
76
+ /**
77
+ * The app's call that starts linking a provider to the signed-in account.
78
+ * Optional: without it `link` is a 404. It runs for anyone who opens the
79
+ * URL, so it is the app's to refuse a guest or a stale proof (the API's link
80
+ * start does too, and may ask a fresh one): catch that here and throw the
81
+ * sign-in or step-up redirect; nothing is kept then. The flow kind rides in a
82
+ * cookie the visitor can edit and only picks the landing: the API must bind
83
+ * the flow to its kind and its user.
84
+ */
85
+ linkStart?(provider: P, ctx: SocialStartContext<C>): Promise<SocialStart>;
86
+ /** The app's call to `socialSignInComplete`. */
87
+ complete(input: SocialCompleteInput<P>, ctx: {
88
+ readonly request: Request;
89
+ readonly context: C | undefined;
90
+ /**
91
+ * The `returnTo` `start` was given (the checked `?next`), kept in the
92
+ * flow cookie; `/` when there was none or the cookie predates it. A
93
+ * `session` or `secondFactor` outcome with no `returnTo` of its own
94
+ * lands on it.
95
+ */
96
+ readonly returnTo: string;
97
+ /** Which flow the cookie started: `'link'` from `link`, `'signIn'` from `start` or a cookie written before links existed. */
98
+ readonly kind: SocialFlowKind;
99
+ }): Promise<SocialOutcome>;
100
+ /**
101
+ * The app's `sessionCookies(…)`, as `signInFlow` takes them. A second
102
+ * factor needs its challenge helpers; without them it is an error outcome.
103
+ */
104
+ readonly cookies: SessionCookies<boolean>;
105
+ /** The code sent to the sign-in page for a session with no token or a missing, unreadable or past end, or a second factor the app cannot keep. `'invalid_session'` by default. */
106
+ readonly invalidSessionCode?: string | undefined;
107
+ readonly paths?: {
108
+ /** Where a second factor goes on. `/sign-in/second-factor` by default. */
109
+ readonly secondFactor?: string | undefined;
110
+ /** Where an error goes. `/sign-in` by default. */
111
+ readonly signIn?: string | undefined;
112
+ /** Where a link flow lands (a `linked` outcome or an error): the outcome's `returnTo`, else the kept one when not `/`, else `paths.linked`, else `/`. */
113
+ readonly linked?: string | undefined;
114
+ /** The prefix of the two routes, and the flow cookie's `Path`. `/auth` by default. */
115
+ readonly base?: string | undefined;
116
+ };
117
+ /** The error code's query parameter on the sign-in page, and on the link landing for a link flow's error. `'error'` by default. */
118
+ readonly errorParam?: string | undefined;
119
+ /** The state parameter of a `linked` landing (`?social=linked`). `'social'` by default. */
120
+ readonly socialParam?: string | undefined;
121
+ /** The code sent to the sign-in page when the flow cookie is missing. `'flow_missing'` by default. */
122
+ readonly missingFlowCode?: string | undefined;
123
+ /** The code on the link landing when `link` refuses a request whose `Sec-Fetch-Site` is any value but `same-origin` and `none` (`cross-site`, `same-site`…). It lands on the kept `?next`, else `paths.linked`, `/` by default. With no header the guard cannot tell and the link goes on. `'social_cross_site'` by default. */
124
+ readonly crossSiteCode?: string | undefined;
125
+ }
126
+ export interface SocialRoutes<C = unknown> {
127
+ /** The loader of `/auth/:provider`. */
128
+ start(args: SocialArgs<C>): Promise<Response>;
129
+ /** The loader of `/auth/:provider/link`; a 404 when `linkStart` is not given. */
130
+ link(args: SocialArgs<C>): Promise<Response>;
131
+ /** The loader of `/auth/:provider/callback`, for both flows. */
132
+ callback(args: SocialArgs<C>): Promise<Response>;
133
+ /** The flow cookie's name as sent. */
134
+ readonly flowCookieName: string;
135
+ }
136
+ //# sourceMappingURL=social-types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"social-types.d.ts","sourceRoot":"","sources":["../../src/session/social-types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAChD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAE9C,mHAAmH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QAAQ,CAAC,aAAa,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CAC5C;AAED,MAAM,WAAW,YAAY,CAAC,CAAC,GAAG,OAAO;IACxC,uCAAuC;IACvC,KAAK,CAAC,IAAI,EAAE,UAAU,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,QAAQ,CAAC,CAAC;IAC9C,iFAAiF;IACjF,IAAI,CAAC,IAAI,EAAE,UAAU,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,QAAQ,CAAC,CAAC;IAC7C,gEAAgE;IAChE,QAAQ,CAAC,IAAI,EAAE,UAAU,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,QAAQ,CAAC,CAAC;IACjD,sCAAsC;IACtC,QAAQ,CAAC,cAAc,EAAE,MAAM,CAAC;CAChC"}
@@ -0,0 +1,32 @@
1
+ import type { SocialRoutes, SocialRoutesOptions } from './social-types';
2
+ export type { SocialArgs, SocialCompleteInput, SocialFlowCookie, SocialFlowKind, SocialOutcome, SocialRoutes, SocialRoutesOptions, SocialStart, SocialStartContext, } from './social-types';
3
+ /**
4
+ * The routes of a social sign-in for a BFF that keeps the API's session
5
+ * token in its own cookie: `start` redirects to the provider with a flow
6
+ * cookie (`HttpOnly`, `SameSite=Lax`, short-lived), `callback` hands the full
7
+ * callback URL and that cookie to the app's `complete`, clears the cookie on
8
+ * every outcome it lands (a `complete` that throws leaves it to expire) and
9
+ * lands the outcome (on the outcome's own `returnTo`, else the `?next` `start`
10
+ * checked and kept in the flow cookie): a session, the second-factor page or
11
+ * the sign-in page with an error code. The GraphQL calls stay the app's.
12
+ *
13
+ * With `linkStart`, `link` starts the same flow for a signed-in user to attach
14
+ * a provider: `complete` is told the `kind`, and a `linked` outcome (or an
15
+ * error) lands on the outcome's `returnTo`, else the kept one when not `/`,
16
+ * else `paths.linked`, with `?social=linked` (or `?error=<code>`).
17
+ *
18
+ * @example
19
+ * export const social = socialRoutes({
20
+ * providers: ['google', 'github'],
21
+ * flowCookie: { secure: !import.meta.env.DEV },
22
+ * start: (provider, { returnTo }) => api.socialSignInStart({ provider, returnTo }),
23
+ * linkStart: (provider, { returnTo }) => api.socialLinkStart({ provider, returnTo }),
24
+ * complete: (input, { kind }) => kind === 'link' ? api.socialLink(input) : api.socialSignInComplete(input),
25
+ * cookies,
26
+ * });
27
+ * // routes/auth.$provider.tsx: export const loader = social.start;
28
+ * // routes/auth.$provider.link.tsx: export const loader = social.link;
29
+ * // routes/auth.$provider.callback.tsx: export const loader = social.callback;
30
+ */
31
+ export declare function socialRoutes<C = unknown, P extends string = string>(options: SocialRoutesOptions<C, P>): SocialRoutes<C>;
32
+ //# sourceMappingURL=social.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"social.d.ts","sourceRoot":"","sources":["../../src/session/social.ts"],"names":[],"mappings":"AAkBA,OAAO,KAAK,EAEX,YAAY,EACZ,mBAAmB,EACnB,MAAM,gBAAgB,CAAC;AAExB,YAAY,EACX,UAAU,EACV,mBAAmB,EACnB,gBAAgB,EAChB,cAAc,EACd,aAAa,EACb,YAAY,EACZ,mBAAmB,EACnB,WAAW,EACX,kBAAkB,GAClB,MAAM,gBAAgB,CAAC;AAIxB;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,wBAAgB,YAAY,CAAC,CAAC,GAAG,OAAO,EAAE,CAAC,SAAS,MAAM,GAAG,MAAM,EAClE,OAAO,EAAE,mBAAmB,CAAC,CAAC,EAAE,CAAC,CAAC,GAChC,YAAY,CAAC,CAAC,CAAC,CAkFjB"}
@@ -0,0 +1,9 @@
1
+ /** `@softistx/janus`'s code for a mutation that needs a recent step-up. */
2
+ export declare const STEP_UP_REQUIRED = "STEP_UP_REQUIRED";
3
+ /**
4
+ * The codes that end a step-up's challenge: unknown, spent, expired or stale,
5
+ * and a second factor that changed since the request (`SECOND_FACTOR_ACTIVE`,
6
+ * `SECOND_FACTOR_NOT_ENROLLED`). The user asks again.
7
+ */
8
+ export declare const STEP_UP_OVER: readonly ["TOKEN_UNKNOWN", "TOKEN_SPENT", "TOKEN_EXPIRED", "TOKEN_STALE", "SECOND_FACTOR_ACTIVE", "SECOND_FACTOR_NOT_ENROLLED"];
9
+ //# sourceMappingURL=step-up-codes.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"step-up-codes.d.ts","sourceRoot":"","sources":["../../src/session/step-up-codes.ts"],"names":[],"mappings":"AAEA,2EAA2E;AAC3E,eAAO,MAAM,gBAAgB,qBAAqB,CAAC;AAEnD;;;;GAIG;AACH,eAAO,MAAM,YAAY,iIAKf,CAAC"}
@@ -0,0 +1,21 @@
1
+ import type { SignInFlow } from './flow-types';
2
+ import type { StepUpRun } from './step-up-types';
3
+ /**
4
+ * The request the sign-in redirect comes back to: the same-site `Referer`'s
5
+ * page (the step-up route has none of its own), else the request's own URL.
6
+ * A `Referer` of another origin (port and protocol count), or one that is not
7
+ * a URL, is ignored. Behind a TLS-terminating proxy an `http` `request.url`
8
+ * never matches an `https` `Referer`, so `next` is the route's own path.
9
+ */
10
+ export declare function cameFrom(request: Request): Request;
11
+ /**
12
+ * Runs `route` over a `run` that notes a signed-out failure, then throws the
13
+ * flow's sign-in redirect in place of whatever the step answered or threw.
14
+ */
15
+ export declare function signingOut<A>({ signIn, unauthenticated, run, request, }: {
16
+ readonly signIn: Pick<SignInFlow<string, never>, 'signInRedirect'>;
17
+ readonly unauthenticated: string;
18
+ readonly run: StepUpRun;
19
+ readonly request: Request;
20
+ }, route: (watched: StepUpRun) => Promise<A>): Promise<A>;
21
+ //# sourceMappingURL=step-up-signed-out.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"step-up-signed-out.d.ts","sourceRoot":"","sources":["../../src/session/step-up-signed-out.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC/C,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAiBjD;;;;;;GAMG;AACH,wBAAgB,QAAQ,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,CAalD;AAED;;;GAGG;AACH,wBAAsB,UAAU,CAAC,CAAC,EACjC,EACC,MAAM,EACN,eAAe,EACf,GAAG,EACH,OAAO,GACP,EAAE;IACF,QAAQ,CAAC,MAAM,EAAE,IAAI,CAAC,UAAU,CAAC,MAAM,EAAE,KAAK,CAAC,EAAE,gBAAgB,CAAC,CAAC;IACnE,QAAQ,CAAC,eAAe,EAAE,MAAM,CAAC;IACjC,QAAQ,CAAC,GAAG,EAAE,SAAS,CAAC;IACxB,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;CAC1B,EACD,KAAK,EAAE,CAAC,OAAO,EAAE,SAAS,KAAK,OAAO,CAAC,CAAC,CAAC,GACvC,OAAO,CAAC,CAAC,CAAC,CA6BZ"}
@@ -0,0 +1,127 @@
1
+ import type { data } from 'react-router';
2
+ import type { ApiErrorLike } from '../errors/api-error';
3
+ import type { SignInCodes, SignInFlow } from './flow-types';
4
+ import type { StepUpConfirmAnswer, StepUpRequestAnswer, StepUpVia } from './model';
5
+ /** The codes the step-up tells apart; `@softistx/janus`'s by default. */
6
+ export interface StepUpCodes extends SignInCodes {
7
+ /** The code of a mutation that needs a step-up first (`'STEP_UP_REQUIRED'`). */
8
+ readonly stepUpRequired?: string | undefined;
9
+ /** The code of a mail the API holds back (`'MAIL_THROTTLED'`): `request` answers `error: 'throttled'`. Any 429 is throttled too, whatever its code. */
10
+ readonly mailThrottled?: string | undefined;
11
+ /** The code of an API answer for no session or a dead one (`'UNAUTHENTICATED'`): what `onSignedOut` redirects on. */
12
+ readonly unauthenticated?: string | undefined;
13
+ }
14
+ /**
15
+ * What the step-up reads of the app's sign-in: `errors`, `json` (a step runs
16
+ * only for a same-site JSON post) and `attemptsLeft`, and `signInRedirect`
17
+ * when `onSignedOut` is `'sign-in'`. A `signInFlow(...)` fits, and so does a
18
+ * hand-written sign-in that offers those members.
19
+ */
20
+ export type StepUpSignIn<L extends string, C = undefined> = Pick<SignInFlow<L, C>, 'errors' | 'json' | 'attemptsLeft'> & Partial<Pick<SignInFlow<L, C>, 'signInRedirect'>>;
21
+ export interface StepUpStepsOptions<L extends string, C = undefined> {
22
+ /**
23
+ * The app's sign-in: a `signInFlow(...)`, or any object with the members
24
+ * the step-up reads (`StepUpSignIn`). With `onSignedOut: 'sign-in'` it
25
+ * must have `signInRedirect` too, or `stepUpSteps` throws a `TypeError`.
26
+ * A flow typed with a caller context (`C`) is as good: the step-up never
27
+ * revokes, so it never reads one.
28
+ */
29
+ readonly signIn: StepUpSignIn<L, C>;
30
+ /**
31
+ * A challenge that is over, worded ("ask for a new code"): the text when
32
+ * the tries ran out, and the fallback for a challenge that is gone when
33
+ * `wording` has nothing to say about its code.
34
+ */
35
+ spent(language: L): string;
36
+ /**
37
+ * @deprecated No longer read. A code with no try left is a spent challenge
38
+ * (`expired`), and a timed wait is `throttled` with `retryAfter`; `locked`
39
+ * is always `false`.
40
+ */
41
+ readonly locked?: ((language: L) => string) | undefined;
42
+ /**
43
+ * The app's own words for a refusal that is not a code's (a mail
44
+ * throttle's wait, say), before `errors`' default. `undefined` keeps the
45
+ * default. It is also asked for a refusal whose code is in
46
+ * `codes.challengeOver` (an unknown or expired challenge), where `undefined`
47
+ * falls back to `spent`; the tries running out is always `spent`.
48
+ */
49
+ readonly wording?: ((error: ApiErrorLike, language: L) => string | undefined) | undefined;
50
+ readonly codes?: StepUpCodes | undefined;
51
+ /**
52
+ * What `route` does when the user is signed out. `'sign-in'` redirects to
53
+ * the flow's sign-in page (clearing the session cookie) when `run` fails
54
+ * with `codes.unauthenticated` (`UNAUTHENTICATED`) as an `ApiError`, or, from `request` only, a bare 401 response (from `confirm` a bare 401 stays a refusal, since a wrong code is a 401 too: `run.confirm` must throw an `ApiError` for the API's code refusals);
55
+ * `next` is the page the request came from (a same-site `Referer`, else the
56
+ * route's own path). A wrong or expired code (also a 401 from the API)
57
+ * stays a refusal for the dialog, and a second-factor-required answer is a
58
+ * refusal too, never a redirect of the fetcher. Unset keeps `route` as it
59
+ * was: `run`'s failures are the app's to read.
60
+ */
61
+ readonly onSignedOut?: 'sign-in' | undefined;
62
+ }
63
+ /** An answer that stays on the page: the answer, with the API's status. */
64
+ export type StepUpStayed<T> = ReturnType<typeof data<T>>;
65
+ /**
66
+ * What each step takes beside `run`: the request, whose headers must be a
67
+ * same-site JSON post's (a native form post goes back to its page, another
68
+ * site is a 403), and the language of the wording.
69
+ */
70
+ export interface StepUpCall<L extends string> {
71
+ readonly request: Request;
72
+ readonly language: L;
73
+ }
74
+ /**
75
+ * What `StepUpSteps.route` calls for each intent: the app's own API calls,
76
+ * with the fields the page posted.
77
+ */
78
+ export interface StepUpRun {
79
+ /** Asks the API for a challenge (`requestStepUp`). */
80
+ request(): Promise<{
81
+ readonly challenge: string;
82
+ readonly via: StepUpVia;
83
+ }>;
84
+ /** Confirms the code of the challenge (`confirmStepUp`). */
85
+ confirm(input: {
86
+ readonly challenge: string;
87
+ readonly code: string;
88
+ }): Promise<unknown>;
89
+ }
90
+ export interface StepUpSteps<L extends string> {
91
+ /**
92
+ * Starts a step-up (`requestStepUp`): the challenge and how it is
93
+ * confirmed. The challenge goes to the page's fetcher and nowhere else.
94
+ * A refusal is `error: 'failed'` with the
95
+ * message and the API's status, and a throttled mail or any 429 (a rate
96
+ * limit) `error: 'throttled'`, with `retryAfter` when the API says how long; an API it cannot reach is a 503. Anything
97
+ * that is not an API failure is thrown. Only a same-site JSON post goes on.
98
+ */
99
+ request(run: () => Promise<{
100
+ readonly challenge: string;
101
+ readonly via: StepUpVia;
102
+ }>, options: StepUpCall<L>): Promise<StepUpRequestAnswer | StepUpStayed<StepUpRequestAnswer>>;
103
+ /**
104
+ * Confirms the step-up with the code (`confirmStepUp`). A refusal says
105
+ * why: `invalid` with the tries left, `expired` (ask again), `throttled`
106
+ * (a 429, or `extensions.reason === 'throttled'`: wait `retryAfter`, the
107
+ * challenge and its tries stay), or `failed`; with no try left and no
108
+ * `reason` the challenge is spent: `expired`, whatever `via`.
109
+ */
110
+ confirm(run: () => Promise<unknown>, options: StepUpCall<L> & {
111
+ /** @deprecated No longer read: the answer does not depend on the factor. */
112
+ readonly via?: StepUpVia | undefined;
113
+ }): Promise<StepUpConfirmAnswer | StepUpStayed<StepUpConfirmAnswer>>;
114
+ /**
115
+ * The whole action of a resource route that serves the step-up to any
116
+ * page: reads the same-site JSON body, runs `request` for
117
+ * `{ intent: 'request-step-up' }` and `confirm` for
118
+ * `{ intent: 'confirm-step-up', challenge, code }` (a `via` in the body is ignored), and answers what
119
+ * those steps answer. Any other intent, or a confirm with no challenge or
120
+ * code, is a 400. With `onSignedOut: 'sign-in'` a signed-out user is
121
+ * redirected to sign-in (thrown) instead of answered.
122
+ */
123
+ route(run: StepUpRun, options: StepUpCall<L>): Promise<StepUpRequestAnswer | StepUpConfirmAnswer | StepUpStayed<StepUpRequestAnswer> | StepUpStayed<StepUpConfirmAnswer>>;
124
+ /** Whether `error` is the API asking for a step-up first. */
125
+ isStepUpRequired(error: unknown): boolean;
126
+ }
127
+ //# sourceMappingURL=step-up-types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"step-up-types.d.ts","sourceRoot":"","sources":["../../src/session/step-up-types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,KAAK,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC5D,OAAO,KAAK,EACX,mBAAmB,EACnB,mBAAmB,EACnB,SAAS,EACT,MAAM,SAAS,CAAC;AAEjB,yEAAyE;AACzE,MAAM,WAAW,WAAY,SAAQ,WAAW;IAC/C,gFAAgF;IAChF,QAAQ,CAAC,cAAc,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC7C,uJAAuJ;IACvJ,QAAQ,CAAC,aAAa,CAAC,EAAE,MAAM,GAAG,SA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C,mBAAmB,CAAC,CACnC,CAAC;IACF,6DAA6D;IAC7D,gBAAgB,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAAC;CAC1C"}
@@ -0,0 +1,17 @@
1
+ import type { StepUpSteps, StepUpStepsOptions } from './step-up-types';
2
+ /**
3
+ * The server side of a BFF's step-up: `request` and `confirm` answer the
4
+ * page's fetcher with `StepUpRequestAnswer` and `StepUpConfirmAnswer`, which
5
+ * `stepUpReducer` takes as they are. It speaks `@softistx/janus`'s words
6
+ * (`CODE_INVALID`, `TOKEN_*`, `STEP_UP_REQUIRED`); the app maps the rest.
7
+ *
8
+ * @example
9
+ * const stepUp = stepUpSteps({
10
+ * errors,
11
+ * attemptsLeft: (count, language) => t('code.attempts-left', { count }, language),
12
+ * spent: (language) => t('step-up.spent', {}, language),
13
+ * locked: (language) => t('step-up.locked', {}, language),
14
+ * });
15
+ */
16
+ export declare function stepUpSteps<L extends string, C = undefined>(options: StepUpStepsOptions<L, C>): StepUpSteps<L>;
17
+ //# sourceMappingURL=step-up.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"step-up.d.ts","sourceRoot":"","sources":["../../src/session/step-up.ts"],"names":[],"mappings":"AAkBA,OAAO,KAAK,EAGX,WAAW,EACX,kBAAkB,EAClB,MAAM,iBAAiB,CAAC;AA8NzB;;;;;;;;;;;;;GAaG;AACH,wBAAgB,WAAW,CAAC,CAAC,SAAS,MAAM,EAAE,CAAC,GAAG,SAAS,EAC1D,OAAO,EAAE,kBAAkB,CAAC,CAAC,EAAE,CAAC,CAAC,GAC/B,WAAW,CAAC,CAAC,CAAC,CAShB"}
@@ -0,0 +1,22 @@
1
+ import { type ApiErrorLike } from '../errors/api-error';
2
+ import type { CodeWording, FlowContext, SignInAnswer, SignInFlow, SignInFlowOptions, SignInStayed } from './flow-types';
3
+ /**
4
+ * A refused code's message, with the tries left when the API counts them;
5
+ * a refusal with `reason: 'throttled'` says how long to wait instead
6
+ * (`options.throttled`, else a default in English or French);
7
+ * `undefined` when the challenge is over (gone, or no try left and no
8
+ * `whenNone` to say instead) and the user must sign in again.
9
+ */
10
+ export declare function codeRefusal<L extends string>({ options, invalidCode, challengeOver }: CodeWording<L>, error: ApiErrorLike, language: L, whenNone?: string): string | undefined;
11
+ /** What a sign-in says when the API cannot be reached. */
12
+ export declare const unavailableMessage: <L extends string>({ unavailable, errors }: Pick<SignInFlowOptions<L>, "unavailable" | "errors">, language: L) => string;
13
+ /**
14
+ * Runs a sign-in step and redirects where its answer leads, a new session
15
+ * replacing the browser's (`landReplacing`). A refusal is the form's
16
+ * message (a wrong password, a lock with its delay); an unreachable API
17
+ * says `unavailable`, with a 503.
18
+ */
19
+ export declare function signInStep<L extends string, C, T extends object>(flow: FlowContext<L, C>, run: () => Promise<SignInAnswer>, { request, language, next, extra, refused, context, }: Parameters<SignInFlow<L, C>['signInStep']>[1] & {
20
+ extra: T;
21
+ }): Promise<Response | SignInStayed<T>>;
22
+ //# sourceMappingURL=step.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"step.d.ts","sourceRoot":"","sources":["../../src/session/step.ts"],"names":[],"mappings":"AACA,OAAO,EACN,KAAK,YAAY,EAKjB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,KAAK,EACX,WAAW,EACX,WAAW,EACX,YAAY,EACZ,UAAU,EACV,iBAAiB,EAEjB,YAAY,EACZ,MAAM,cAAc,CAAC;AAetB;;;;;;GAMG;AACH,wBAAgB,WAAW,CAAC,CAAC,SAAS,MAAM,EAC3C,EAAE,OAAO,EAAE,WAAW,EAAE,aAAa,EAAE,EAAE,WAAW,CAAC,CAAC,CAAC,EACvD,KAAK,EAAE,YAAY,EACnB,QAAQ,EAAE,CAAC,EACX,QAAQ,CAAC,EAAE,MAAM,GACf,MAAM,GAAG,SAAS,CAmBpB;AAED,0DAA0D;AAC1D,eAAO,MAAM,kBAAkB,GAAI,CAAC,SAAS,MAAM,EAClD,yBAAyB,IAAI,CAAC,iBAAiB,CAAC,CAAC,CAAC,EAAE,aAAa,GAAG,QAAQ,CAAC,EAC7E,UAAU,CAAC,KACT,MAAwE,CAAC;AAE5E;;;;;GAKG;AACH,wBAAsB,UAAU,CAAC,CAAC,SAAS,MAAM,EAAE,CAAC,EAAE,CAAC,SAAS,MAAM,EACrE,IAAI,EAAE,WAAW,CAAC,CAAC,EAAE,CAAC,CAAC,EACvB,GAAG,EAAE,MAAM,OAAO,CAAC,YAAY,CAAC,EAChC,EACC,OAAO,EACP,QAAQ,EACR,IAAI,EACJ,KAAK,EACL,OAAO,EACP,OAAO,GACP,EAAE,UAAU,CAAC,UAAU,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG;IAAE,KAAK,EAAE,CAAC,CAAA;CAAE,GAC7D,OAAO,CAAC,QAAQ,GAAG,YAAY,CAAC,CAAC,CAAC,CAAC,CAmCrC"}
@@ -0,0 +1,73 @@
1
+ /** What `createSignInThrottle` takes; every field has a default. */
2
+ export interface SignInThrottleOptions {
3
+ /** Failures one key may make within `windowMs` before it waits. 5 by default. */
4
+ readonly max?: number | undefined;
5
+ /** The per-key window, in milliseconds. 15 minutes by default. */
6
+ readonly windowMs?: number | undefined;
7
+ /** How many keys are held; past it the oldest is dropped. 10 000 by default. */
8
+ readonly maxKeys?: number | undefined;
9
+ /** Failures, all keys together, within `globalWindowMs` before every sign-in is delayed. 100 by default. */
10
+ readonly globalMax?: number | undefined;
11
+ /** The global window, in milliseconds: also the longest the global delay lasts. 1 minute by default. */
12
+ readonly globalWindowMs?: number | undefined;
13
+ /**
14
+ * What the global bucket does past `globalMax`: `'refuse'` (the default) makes `wait` answer
15
+ * the seconds left for every key; `'delay'` leaves `wait` per key and gives `globalDelay` a bounded delay instead.
16
+ */
17
+ readonly globalMode?: 'refuse' | 'delay' | undefined;
18
+ /** In `'delay'` mode, the longest `globalDelay` answers, in milliseconds. 3 000 by default. */
19
+ readonly maxDelayMs?: number | undefined;
20
+ /** Password verifications that run at once. 2 by default. */
21
+ readonly maxConcurrentVerifies?: number | undefined;
22
+ /** Verifications that wait for a slot; past it `verify` answers `{ busy: true }`. 4 by default; 0 for none. */
23
+ readonly maxQueuedVerifies?: number | undefined;
24
+ /** The clock, in milliseconds. `Date.now` by default; inject one in a test. */
25
+ readonly now?: (() => number) | undefined;
26
+ }
27
+ /** What `verify` answers: the task's value, or a refusal because the queue was full. */
28
+ export type VerifyResult<T> = {
29
+ readonly busy: false;
30
+ readonly value: T;
31
+ } | {
32
+ readonly busy: true;
33
+ };
34
+ /** A per-process sign-in throttle. */
35
+ export interface SignInThrottle {
36
+ /** Seconds to wait before this key may try again, 0 when it may. Records nothing. */
37
+ wait(key: string): number;
38
+ /**
39
+ * Milliseconds to slow this attempt down because of the global bucket, 0 when it needs none.
40
+ * Always 0 in the default `'refuse'` mode. In `'delay'` mode it is 0 below `globalMax` failures in the window,
41
+ * then grows by `maxDelayMs / globalMax` with each failure past it, up to `maxDelayMs`. Records nothing.
42
+ */
43
+ globalDelay(): number;
44
+ /** Record a failed attempt for the key (and in the global bucket). */
45
+ fail(key: string): void;
46
+ /** Forget the key's failures after a successful sign-in. The global bucket is left alone. */
47
+ clear(key: string): void;
48
+ /** Run a password verification under the concurrency limit, or refuse when the wait queue is full. A rejection of `task` passes through and frees its slot. */
49
+ verify<T>(task: () => Promise<T>): Promise<VerifyResult<T>>;
50
+ /** How many keys are held now. */
51
+ readonly size: number;
52
+ }
53
+ /**
54
+ * A failed-attempt throttle for a password sign-in, in this process's memory:
55
+ * `max` failures per key within `windowMs`, a bounded number of keys, a global
56
+ * bucket that delays every sign-in for a few seconds rather than locking an
57
+ * account (or, with `globalMode: 'delay'`, leaves `wait` per key and gives
58
+ * `globalDelay`, a bounded delay that grows with the excess), and `verify`,
59
+ * which holds password hashing (argon2 at 64 MiB each) to a small concurrency. Each process counts alone: behind several instances
60
+ * the limits multiply. Pass the lower-cased address as the key.
61
+ *
62
+ * @example
63
+ * const throttle = createSignInThrottle({ max: 5, windowMs: 15 * 60_000 });
64
+ * // in the sign-in action
65
+ * const seconds = throttle.wait(email);
66
+ * if (seconds > 0) return tooMany(seconds);
67
+ * const checked = await throttle.verify(() => Bun.password.verify(password, hash));
68
+ * if (checked.busy) return tryLater();
69
+ * if (!checked.value) { throttle.fail(email); return refused(); }
70
+ * throttle.clear(email);
71
+ */
72
+ export declare function createSignInThrottle(options?: SignInThrottleOptions): SignInThrottle;
73
+ //# sourceMappingURL=throttle.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"throttle.d.ts","sourceRoot":"","sources":["../../src/session/throttle.ts"],"names":[],"mappings":"AAAA,oEAAoE;AACpE,MAAM,WAAW,qBAAqB;IACrC,iFAAiF;IACjF,QAAQ,CAAC,GAAG,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAClC,kEAAkE;IAClE,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACvC,gFAAgF;IAChF,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACtC,4GAA4G;IAC5G,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACxC,wGAAwG;IACxG,QAAQ,CAAC,cAAc,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC7C;;;OAGG;IACH,QAAQ,CAAC,UAAU,CAAC,EAAE,QAAQ,GAAG,OAAO,GAAG,SAAS,CAAC;IACrD,+FAA+F;IAC/F,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACzC,6DAA6D;IAC7D,QAAQ,CAAC,qBAAqB,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACpD,+GAA+G;IAC/G,QAAQ,CAAC,iBAAiB,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAChD,+EAA+E;IAC/E,QAAQ,CAAC,GAAG,CAAC,EAAE,CAAC,MAAM,MAAM,CAAC,GAAG,SAAS,CAAC;CAC1C;AAED,wFAAwF;AACxF,MAAM,MAAM,YAAY,CAAC,CAAC,IACvB;IAAE,QAAQ,CAAC,IAAI,EAAE,KAAK,CAAC;IAAC,QAAQ,CAAC,KAAK,EAAE,CAAC,CAAA;CAAE,GAC3C;IAAE,QAAQ,CAAC,IAAI,EAAE,IAAI,CAAA;CAAE,CAAC;AAE3B,sCAAsC;AACtC,MAAM,WAAW,cAAc;IAC9B,qFAAqF;IACrF,IAAI,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAC;IAC1B;;;;OAIG;IACH,WAAW,IAAI,MAAM,CAAC;IACtB,sEAAsE;IACtE,IAAI,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,6FAA6F;IAC7F,KAAK,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,+JAA+J;IAC/J,MAAM,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,OAAO,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,CAAC;IAC5D,kCAAkC;IAClC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;CACtB;AAuBD;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,oBAAoB,CACnC,OAAO,GAAE,qBAA0B,GACjC,cAAc,CAmHhB"}
@@ -0,0 +1,4 @@
1
+ import { type ApiErrorLike } from '../errors/api-error';
2
+ /** A 429, or a refusal whose `reason` is `'throttled'`: a rate limit asks to wait, whatever its code. */
3
+ export declare const isTimedWait: (error: ApiErrorLike) => boolean;
4
+ //# sourceMappingURL=timed-wait.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"timed-wait.d.ts","sourceRoot":"","sources":["../../src/session/timed-wait.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,YAAY,EAAqB,MAAM,qBAAqB,CAAC;AAE3E,yGAAyG;AACzG,eAAO,MAAM,WAAW,GAAI,OAAO,YAAY,KAAG,OACD,CAAC"}
@@ -0,0 +1,34 @@
1
+ import type { FlowContext } from './flow-types';
2
+ /** The `next` a sign-in page was opened with, safe to redirect to. */
3
+ export declare const nextParam: (request: Request) => string;
4
+ /**
5
+ * The sign-in page, coming back to this request's page afterwards, with the
6
+ * session cookie cleared: what a page answers without a (live) session. A
7
+ * request that carried a session cookie says it ended when `endedParam` is
8
+ * set.
9
+ */
10
+ export declare function signInRedirect<L extends string, C>({ options, paths }: FlowContext<L, C>, request: Request): Response;
11
+ /**
12
+ * For the sign-in pages: the viewer when the cookie holds a live session,
13
+ * `null` when the API refuses it (a 401), `undefined` without a cookie or
14
+ * when the API cannot tell.
15
+ */
16
+ export declare function viewer<L extends string, C, V>({ options }: FlowContext<L, C>, request: Request, read: (token: string) => Promise<V | null>, token?: string | null | undefined): Promise<V | null | undefined>;
17
+ /**
18
+ * The signed-in viewer, else the sign-in redirect. Its `headers` move the
19
+ * cookie's expiry to the session's when the API moved it.
20
+ */
21
+ export declare function requireViewer<L extends string, C, V>(context: FlowContext<L, C>, request: Request, read: (token: string) => Promise<V | null>, expiresAt: (viewer: V) => string | null): Promise<{
22
+ viewer: V;
23
+ headers: HeadersInit;
24
+ }>;
25
+ /**
26
+ * Ends the session and goes to the sign-in page (`?signed-out=1`, plus
27
+ * the body's `next` when it is a safe path), or to `to`. The body is read as JSON first: JSON and same-origin only, so
28
+ * another site cannot sign the user out.
29
+ */
30
+ export declare function signOut<L extends string, C>(flow: FlowContext<L, C>, request: Request, { to, context, }?: {
31
+ readonly to?: string | undefined;
32
+ readonly context?: C | undefined;
33
+ }): Promise<Response>;
34
+ //# sourceMappingURL=viewer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"viewer.d.ts","sourceRoot":"","sources":["../../src/session/viewer.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAIhD,sEAAsE;AACtE,eAAO,MAAM,SAAS,GAAI,SAAS,OAAO,KAAG,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IACjC,QAAQ,CAAC,OAAO,CAAC,EAAE,CAAC,GAAG,SAAS,CAAC;CAC5B,GACJ,OAAO,CAAC,QAAQ,CAAC,CAqBnB"}
@@ -0,0 +1,3 @@
1
+ /** Throws a worded `TypeError` for a document that is not exactly `subscription <name>`. */
2
+ export declare function checkDocuments(allow: Readonly<Record<string, string>>): void;
3
+ //# sourceMappingURL=documents.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"documents.d.ts","sourceRoot":"","sources":["../../src/subscription/documents.ts"],"names":[],"mappings":"AA+CA,4FAA4F;AAC5F,wBAAgB,cAAc,CAAC,KAAK,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,GAAG,IAAI,CAkB5E"}
@@ -0,0 +1,7 @@
1
+ /**
2
+ * `@softistx/alxia-react-router/subscription`: GraphQL subscriptions over SSE for a
3
+ * BFF, as a resource route. It imports nothing (web APIs only), so it adds
4
+ * no peer.
5
+ */
6
+ export { createSubscriptionProxy, type SubscriptionArgs, type SubscriptionProxy, type SubscriptionProxyOptions, } from './proxy';
7
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/subscription/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EACN,uBAAuB,EACvB,KAAK,gBAAgB,EACrB,KAAK,iBAAiB,EACtB,KAAK,wBAAwB,GAC7B,MAAM,SAAS,CAAC"}