@softistx/alxia-react-router 0.0.0-stage → 0.83.1

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,227 @@
1
+ // src/subscription/react/backoff.ts
2
+ var BACKOFF_MIN_MS = 1000;
3
+ var BACKOFF_MAX_MS = 30000;
4
+ function backoffDelay(attempt, random) {
5
+ const base = Math.min(BACKOFF_MAX_MS, BACKOFF_MIN_MS * 2 ** attempt);
6
+ return Math.round(base * (0.5 + random * 0.5));
7
+ }
8
+ // src/subscription/react/classify.ts
9
+ function retryAfterMs(error) {
10
+ const first = error.errors?.[0]?.extensions;
11
+ const seconds = Number(first?.retryAfter ?? error.body?.retryAfter);
12
+ return Number.isFinite(seconds) && seconds > 0 ? seconds * 1000 : undefined;
13
+ }
14
+ function classifyEnd(error) {
15
+ if (error === undefined)
16
+ return { kind: "retry" };
17
+ const e = error;
18
+ const status = e.httpStatus ?? e.status;
19
+ if (status === 401)
20
+ return { kind: "stop" };
21
+ const code = e.errors?.[0]?.extensions?.code;
22
+ if (code === "realtime.session-ended" && (status ?? 200) < 400) {
23
+ return { kind: "retry" };
24
+ }
25
+ if (status === 429)
26
+ return { kind: "retry", afterMs: retryAfterMs(e) };
27
+ if (status !== undefined && status >= 400 && status < 500) {
28
+ return { kind: "stop" };
29
+ }
30
+ return { kind: "retry" };
31
+ }
32
+ // src/subscription/react/reconnect.ts
33
+ function createReconnector(timers, random, restart) {
34
+ let attempt = 0;
35
+ let pending;
36
+ const cancel = () => {
37
+ if (pending !== undefined)
38
+ timers.clear(pending);
39
+ pending = undefined;
40
+ };
41
+ return {
42
+ schedule(afterMs = 0) {
43
+ cancel();
44
+ const wait = Math.max(afterMs, backoffDelay(attempt, random()));
45
+ pending = timers.set(() => {
46
+ pending = undefined;
47
+ restart();
48
+ }, wait);
49
+ attempt += 1;
50
+ },
51
+ reset() {
52
+ attempt = 0;
53
+ },
54
+ cancel
55
+ };
56
+ }
57
+
58
+ // src/subscription/react/scheduler.ts
59
+ var REVALIDATE_DEBOUNCE_MS = 300;
60
+ var REVALIDATE_MAX_WAIT_MS = 2000;
61
+ function createRevalidateScheduler(timers, fire) {
62
+ let debounce;
63
+ let maxWait;
64
+ const cancel = () => {
65
+ if (debounce !== undefined)
66
+ timers.clear(debounce);
67
+ if (maxWait !== undefined)
68
+ timers.clear(maxWait);
69
+ debounce = undefined;
70
+ maxWait = undefined;
71
+ };
72
+ const run = () => {
73
+ cancel();
74
+ fire();
75
+ };
76
+ return {
77
+ request() {
78
+ if (debounce !== undefined)
79
+ timers.clear(debounce);
80
+ debounce = timers.set(run, REVALIDATE_DEBOUNCE_MS);
81
+ maxWait ??= timers.set(run, REVALIDATE_MAX_WAIT_MS);
82
+ },
83
+ cancel
84
+ };
85
+ }
86
+
87
+ // src/subscription/react/timers.ts
88
+ var globalTimers = {
89
+ set: (fn, ms) => setTimeout(fn, ms),
90
+ clear: (handle) => clearTimeout(handle)
91
+ };
92
+
93
+ // src/subscription/react/versions.ts
94
+ function createVersions() {
95
+ const seen = new Map;
96
+ return {
97
+ accept(key, version) {
98
+ const highest = seen.get(key);
99
+ if (highest !== undefined && version < highest)
100
+ return false;
101
+ seen.set(key, Math.max(version, highest ?? version));
102
+ return true;
103
+ }
104
+ };
105
+ }
106
+
107
+ // src/subscription/react/controller.ts
108
+ function createLiveController(options) {
109
+ const timers = options.timers ?? globalTimers;
110
+ const versions = createVersions();
111
+ let status = "connecting";
112
+ let opened = false;
113
+ const setStatus = (next) => {
114
+ if (next === status)
115
+ return;
116
+ status = next;
117
+ options.onStatus(next);
118
+ };
119
+ const reconnector = createReconnector(timers, options.random ?? Math.random, options.restart);
120
+ const reads = createRevalidateScheduler(timers, () => options.revalidate?.());
121
+ const dispose = () => {
122
+ reconnector.cancel();
123
+ reads.cancel();
124
+ };
125
+ const stop = () => {
126
+ setStatus("stopped");
127
+ dispose();
128
+ };
129
+ const fresh = (change) => {
130
+ const key = options.keyOf?.(change);
131
+ if (key == null || !options.versionOf)
132
+ return true;
133
+ return versions.accept(key, options.versionOf(change));
134
+ };
135
+ const requestRevalidate = () => {
136
+ if (status !== "stopped" && options.revalidate)
137
+ reads.request();
138
+ };
139
+ return {
140
+ get status() {
141
+ return status;
142
+ },
143
+ open() {
144
+ if (status === "stopped")
145
+ return;
146
+ reconnector.reset();
147
+ setStatus("live");
148
+ if (opened)
149
+ requestRevalidate();
150
+ opened = true;
151
+ },
152
+ data(change) {
153
+ if (status === "stopped" || !fresh(change))
154
+ return false;
155
+ options.onChange(change);
156
+ return true;
157
+ },
158
+ revalidate: requestRevalidate,
159
+ ended(error) {
160
+ if (status === "stopped")
161
+ return;
162
+ const end = classifyEnd(error);
163
+ if (end.kind === "stop")
164
+ return stop();
165
+ setStatus("reconnecting");
166
+ reconnector.schedule(end.afterMs);
167
+ },
168
+ unauthenticated: stop,
169
+ retry() {
170
+ dispose();
171
+ reconnector.reset();
172
+ status = "connecting";
173
+ options.onStatus("connecting");
174
+ options.restart();
175
+ },
176
+ dispose
177
+ };
178
+ }
179
+ // src/subscription/react/use-live-subscription.ts
180
+ import { useSubscription } from "@nxgt/graphql-client/react";
181
+ import { useEffect, useRef, useState } from "react";
182
+ function useLiveSubscription(document, variables, options) {
183
+ const [status, setStatus] = useState("connecting");
184
+ const latest = useRef(options);
185
+ latest.current = options;
186
+ const restartRef = useRef(() => {});
187
+ const [controller] = useState(() => {
188
+ const live = createLiveController({
189
+ keyOf: (event) => latest.current.versionOf ? latest.current.keyOf?.(event) : undefined,
190
+ versionOf: (event) => latest.current.versionOf?.(event) ?? 0,
191
+ restart: () => restartRef.current(),
192
+ revalidate: () => latest.current.revalidate?.(),
193
+ onStatus: setStatus,
194
+ onChange: (event) => latest.current.onChange(event, { revalidate: live.revalidate })
195
+ });
196
+ return live;
197
+ });
198
+ const { restart } = useSubscription(document, ...[
199
+ variables,
200
+ {
201
+ skip: options.skip,
202
+ onOpen: () => controller.open(),
203
+ onData: (event) => void controller.data(event),
204
+ onError: (error) => controller.ended(error),
205
+ onComplete: () => controller.ended(),
206
+ onUnauthenticated: () => controller.unauthenticated()
207
+ }
208
+ ]);
209
+ restartRef.current = restart;
210
+ useEffect(() => () => controller.dispose(), [controller]);
211
+ return { status, retry: controller.retry, revalidate: controller.revalidate };
212
+ }
213
+ export {
214
+ BACKOFF_MAX_MS,
215
+ BACKOFF_MIN_MS,
216
+ REVALIDATE_DEBOUNCE_MS,
217
+ REVALIDATE_MAX_WAIT_MS,
218
+ backoffDelay,
219
+ classifyEnd,
220
+ createLiveController,
221
+ createRevalidateScheduler,
222
+ createVersions,
223
+ useLiveSubscription
224
+ };
225
+
226
+ //# debugId=6B060D490BA28D1A64756E2164756E21
227
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1,17 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../src/subscription/react/backoff.ts", "../src/subscription/react/classify.ts", "../src/subscription/react/reconnect.ts", "../src/subscription/react/scheduler.ts", "../src/subscription/react/timers.ts", "../src/subscription/react/versions.ts", "../src/subscription/react/controller.ts", "../src/subscription/react/use-live-subscription.ts"],
4
+ "sourcesContent": [
5
+ "export const BACKOFF_MIN_MS = 1000;\nexport const BACKOFF_MAX_MS = 30_000;\n\n/**\n * The wait before reconnect number `attempt` (0 first): 1 s doubling to 30 s,\n * then spread by `random` (0..1) over its upper half.\n */\nexport function backoffDelay(attempt: number, random: number): number {\n\tconst base = Math.min(BACKOFF_MAX_MS, BACKOFF_MIN_MS * 2 ** attempt);\n\treturn Math.round(base * (0.5 + random * 0.5));\n}\n",
6
+ "export type EndKind =\n\t| { kind: 'stop' }\n\t| { kind: 'retry'; afterMs?: number | undefined };\n\ntype EndError = {\n\thttpStatus?: number;\n\tstatus?: number;\n\tbody?: { retryAfter?: unknown } | null;\n\terrors?: { extensions?: { code?: string; retryAfter?: unknown } }[];\n};\n\nfunction retryAfterMs(error: EndError): number | undefined {\n\tconst first = error.errors?.[0]?.extensions;\n\tconst seconds = Number(first?.retryAfter ?? error.body?.retryAfter);\n\treturn Number.isFinite(seconds) && seconds > 0 ? seconds * 1000 : undefined;\n}\n\n/**\n * What an ended stream calls for. A 401 always stops (the session is over,\n * with no reconnecting flicker). A refusal that repeating cannot change (any\n * other 4xx) stops. A 429 waits the `retryAfter` the proxy passes on. A\n * network error, a 5xx, an in-stream `realtime.session-ended` and a clean\n * complete retry.\n */\nexport function classifyEnd(error?: unknown): EndKind {\n\tif (error === undefined) return { kind: 'retry' };\n\tconst e = error as EndError;\n\tconst status = e.httpStatus ?? e.status;\n\tif (status === 401) return { kind: 'stop' };\n\tconst code = e.errors?.[0]?.extensions?.code;\n\tif (code === 'realtime.session-ended' && (status ?? 200) < 400) {\n\t\treturn { kind: 'retry' };\n\t}\n\tif (status === 429) return { kind: 'retry', afterMs: retryAfterMs(e) };\n\tif (status !== undefined && status >= 400 && status < 500) {\n\t\treturn { kind: 'stop' };\n\t}\n\treturn { kind: 'retry' };\n}\n",
7
+ "import { backoffDelay } from './backoff';\nimport type { Timers } from './timers';\n\n/** One pending restart at a time, after a growing wait that an open resets. */\nexport function createReconnector(\n\ttimers: Timers,\n\trandom: () => number,\n\trestart: () => void,\n) {\n\tlet attempt = 0;\n\tlet pending: unknown;\n\n\tconst cancel = () => {\n\t\tif (pending !== undefined) timers.clear(pending);\n\t\tpending = undefined;\n\t};\n\n\treturn {\n\t\t/** Restart after the backoff, or `afterMs` when that is longer. */\n\t\tschedule(afterMs = 0) {\n\t\t\tcancel();\n\t\t\tconst wait = Math.max(afterMs, backoffDelay(attempt, random()));\n\t\t\tpending = timers.set(() => {\n\t\t\t\tpending = undefined;\n\t\t\t\trestart();\n\t\t\t}, wait);\n\t\t\tattempt += 1;\n\t\t},\n\t\treset() {\n\t\t\tattempt = 0;\n\t\t},\n\t\tcancel,\n\t};\n}\n",
8
+ "import type { Timers } from './timers';\n\nexport const REVALIDATE_DEBOUNCE_MS = 300;\n/** A steady stream of events still reads the page again at least this often. */\nexport const REVALIDATE_MAX_WAIT_MS = 2000;\n\n/**\n * A debounced \"read again\": quiet for 300 ms, or 2 s after the first request\n * of a burst, whichever comes first; one `fire` per window.\n */\nexport function createRevalidateScheduler(timers: Timers, fire: () => void) {\n\tlet debounce: unknown;\n\tlet maxWait: unknown;\n\n\tconst cancel = () => {\n\t\tif (debounce !== undefined) timers.clear(debounce);\n\t\tif (maxWait !== undefined) timers.clear(maxWait);\n\t\tdebounce = undefined;\n\t\tmaxWait = undefined;\n\t};\n\tconst run = () => {\n\t\tcancel();\n\t\tfire();\n\t};\n\n\treturn {\n\t\trequest() {\n\t\t\tif (debounce !== undefined) timers.clear(debounce);\n\t\t\tdebounce = timers.set(run, REVALIDATE_DEBOUNCE_MS);\n\t\t\tmaxWait ??= timers.set(run, REVALIDATE_MAX_WAIT_MS);\n\t\t},\n\t\tcancel,\n\t};\n}\n",
9
+ "/** The clock the live rules use, injectable so specs can drive it by hand. */\nexport type Timers = {\n\tset: (fn: () => void, ms: number) => unknown;\n\tclear: (handle: unknown) => void;\n};\n\nexport const globalTimers: Timers = {\n\tset: (fn, ms) => setTimeout(fn, ms),\n\tclear: (handle) => clearTimeout(handle as ReturnType<typeof setTimeout>),\n};\n",
10
+ "/** The highest version seen per key: an event below it is stale. */\nexport function createVersions() {\n\tconst seen = new Map<string, number>();\n\treturn {\n\t\t/** True (and remembered) unless `version` is below the highest seen for `key`. */\n\t\taccept(key: string, version: number): boolean {\n\t\t\tconst highest = seen.get(key);\n\t\t\tif (highest !== undefined && version < highest) return false;\n\t\t\tseen.set(key, Math.max(version, highest ?? version));\n\t\t\treturn true;\n\t\t},\n\t};\n}\n",
11
+ "import { classifyEnd } from './classify';\nimport { createReconnector } from './reconnect';\nimport { createRevalidateScheduler } from './scheduler';\nimport { globalTimers, type Timers } from './timers';\nimport { createVersions } from './versions';\n\n/** What the live subscription is doing, for the page's indicator. */\nexport type LiveStatus = 'connecting' | 'live' | 'reconnecting' | 'stopped';\n\nexport type LiveControllerOptions<T> = {\n\t/** Which thing an event is about. With `versionOf`, enables dedupe; an event with no key is never dropped. */\n\tkeyOf?: ((change: T) => string | null | undefined) | undefined;\n\t/** How new the event's state is; below the highest seen for its key, it is dropped. */\n\tversionOf?: ((change: T) => number) | undefined;\n\t/** Opens the stream again. */\n\trestart: () => void;\n\t/** Reads the page's data again; at most once per debounce window. Without it, nothing is read again. */\n\trevalidate?: (() => void) | undefined;\n\t/** An event newer than any seen for its key. */\n\tonChange: (change: T) => void;\n\tonStatus: (status: LiveStatus) => void;\n\ttimers?: Timers | undefined;\n\trandom?: (() => number) | undefined;\n};\n\n/**\n * The rules of a live stream, apart from React so they can be tested with a\n * fake clock: events are hints with no replay, so the page reads again on\n * every reopen after the first, keeps the highest version per key,\n * reconnects with a growing wait, and stops on a refusal.\n */\nexport function createLiveController<T>(options: LiveControllerOptions<T>) {\n\tconst timers = options.timers ?? globalTimers;\n\tconst versions = createVersions();\n\tlet status: LiveStatus = 'connecting';\n\tlet opened = false;\n\n\tconst setStatus = (next: LiveStatus) => {\n\t\tif (next === status) return;\n\t\tstatus = next;\n\t\toptions.onStatus(next);\n\t};\n\tconst reconnector = createReconnector(\n\t\ttimers,\n\t\toptions.random ?? Math.random,\n\t\toptions.restart,\n\t);\n\tconst reads = createRevalidateScheduler(timers, () => options.revalidate?.());\n\tconst dispose = () => {\n\t\treconnector.cancel();\n\t\treads.cancel();\n\t};\n\tconst stop = () => {\n\t\tsetStatus('stopped');\n\t\tdispose();\n\t};\n\tconst fresh = (change: T): boolean => {\n\t\tconst key = options.keyOf?.(change);\n\t\tif (key == null || !options.versionOf) return true;\n\t\treturn versions.accept(key, options.versionOf(change));\n\t};\n\tconst requestRevalidate = () => {\n\t\tif (status !== 'stopped' && options.revalidate) reads.request();\n\t};\n\n\treturn {\n\t\tget status() {\n\t\t\treturn status;\n\t\t},\n\t\t/** The stream is accepted. Anything sent while it was down is lost, so after the first open the page reads again. */\n\t\topen() {\n\t\t\tif (status === 'stopped') return;\n\t\t\treconnector.reset();\n\t\t\tsetStatus('live');\n\t\t\tif (opened) requestRevalidate();\n\t\t\topened = true;\n\t\t},\n\t\t/** A result; false when it is stale. */\n\t\tdata(change: T): boolean {\n\t\t\tif (status === 'stopped' || !fresh(change)) return false;\n\t\t\toptions.onChange(change);\n\t\t\treturn true;\n\t\t},\n\t\trevalidate: requestRevalidate,\n\t\t/** The stream ended (clean, or failed with `error`): open it again, unless the refusal is permanent. */\n\t\tended(error?: unknown) {\n\t\t\tif (status === 'stopped') return;\n\t\t\tconst end = classifyEnd(error);\n\t\t\tif (end.kind === 'stop') return stop();\n\t\t\tsetStatus('reconnecting');\n\t\t\treconnector.schedule(end.afterMs);\n\t\t},\n\t\t/** The session is over (a 401): stopped until `retry`. */\n\t\tunauthenticated: stop,\n\t\t/** The user asks again after a stop. */\n\t\tretry() {\n\t\t\tdispose();\n\t\t\treconnector.reset();\n\t\t\tstatus = 'connecting';\n\t\t\toptions.onStatus('connecting');\n\t\t\toptions.restart();\n\t\t},\n\t\tdispose,\n\t};\n}\n",
12
+ "import type { GraphQLDocument } from '@nxgt/graphql-client';\nimport { useSubscription } from '@nxgt/graphql-client/react';\nimport { useEffect, useRef, useState } from 'react';\nimport { createLiveController, type LiveStatus } from './controller';\n\nexport type LiveControls = {\n\t/** Asks for the page's data to be read again (debounced). */\n\trevalidate: () => void;\n};\n\nexport type UseLiveSubscriptionOptions<TEvent> = {\n\t/** Which thing an event is about. With `versionOf`, an event below the highest version seen for its key is dropped; an event with no key is never dropped. */\n\tkeyOf?: ((event: TEvent) => string | null | undefined) | undefined;\n\t/** How new the event's state is. Leave out with `keyOf` for a stream whose every event is the whole state. */\n\tversionOf?: ((event: TEvent) => number) | undefined;\n\t/** Each fresh event, in order. The latest function is called. */\n\tonChange: (event: TEvent, controls: LiveControls) => void;\n\t/** Reads the page's data again (a loader, a refetch): at most once per window of 300 ms of quiet or 2 s, and after every reopen but the first. Leave out for a stream that needs no read. */\n\trevalidate?: (() => void) | undefined;\n\t/** Connects nothing while `true`. */\n\tskip?: boolean | undefined;\n};\n\nexport type LiveSubscription = {\n\tstatus: LiveStatus;\n\t/** After a stop (`status === 'stopped'`): open the stream again. */\n\tretry: () => void;\n\t/** Asks for the page's data to be read again (debounced). */\n\trevalidate: () => void;\n};\n\n/**\n * A GraphQL subscription kept alive: reconnects with a growing wait (1 s to\n * 30 s), stops on a 401 or another refusal repeating cannot change, waits a\n * 429's `retryAfter`, drops events older than the highest version seen per\n * key, and reads the page again (debounced) after every reopen but the first,\n * since nothing is replayed. Pairs with `createSubscriptionProxy`.\n *\n * Needs `GraphQLProvider` above it.\n */\nexport function useLiveSubscription<TEvent, TVariables = Record<string, never>>(\n\tdocument: GraphQLDocument<TEvent, TVariables>,\n\tvariables: TVariables,\n\toptions: UseLiveSubscriptionOptions<TEvent>,\n): LiveSubscription {\n\tconst [status, setStatus] = useState<LiveStatus>('connecting');\n\t// What the controller calls is always the latest of these, without rebuilding it.\n\tconst latest = useRef(options);\n\tlatest.current = options;\n\tconst restartRef = useRef<() => void>(() => {});\n\tconst [controller] = useState(() => {\n\t\tconst live = createLiveController<TEvent>({\n\t\t\t// No versionOf: no dedupe, every event is delivered.\n\t\t\tkeyOf: (event) =>\n\t\t\t\tlatest.current.versionOf ? latest.current.keyOf?.(event) : undefined,\n\t\t\tversionOf: (event) => latest.current.versionOf?.(event) ?? 0,\n\t\t\trestart: () => restartRef.current(),\n\t\t\trevalidate: () => latest.current.revalidate?.(),\n\t\t\tonStatus: setStatus,\n\t\t\tonChange: (event) =>\n\t\t\t\tlatest.current.onChange(event, { revalidate: live.revalidate }),\n\t\t});\n\t\treturn live;\n\t});\n\tconst { restart } = useSubscription(\n\t\tdocument,\n\t\t...([\n\t\t\tvariables,\n\t\t\t{\n\t\t\t\tskip: options.skip,\n\t\t\t\tonOpen: () => controller.open(),\n\t\t\t\tonData: (event: TEvent) => void controller.data(event),\n\t\t\t\tonError: (error: unknown) => controller.ended(error),\n\t\t\t\tonComplete: () => controller.ended(),\n\t\t\t\tonUnauthenticated: () => controller.unauthenticated(),\n\t\t\t},\n\t\t] as never),\n\t);\n\trestartRef.current = restart;\n\tuseEffect(() => () => controller.dispose(), [controller]);\n\treturn { status, retry: controller.retry, revalidate: controller.revalidate };\n}\n"
13
+ ],
14
+ "mappings": "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",
15
+ "debugId": "6B060D490BA28D1A64756E2164756E21",
16
+ "names": []
17
+ }
@@ -0,0 +1,9 @@
1
+ import type { Timers } from './timers';
2
+ /** One pending restart at a time, after a growing wait that an open resets. */
3
+ export declare function createReconnector(timers: Timers, random: () => number, restart: () => void): {
4
+ /** Restart after the backoff, or `afterMs` when that is longer. */
5
+ schedule(afterMs?: number): void;
6
+ reset(): void;
7
+ cancel: () => void;
8
+ };
9
+ //# sourceMappingURL=reconnect.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"reconnect.d.ts","sourceRoot":"","sources":["../../../src/subscription/react/reconnect.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAEvC,+EAA+E;AAC/E,wBAAgB,iBAAiB,CAChC,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,MAAM,MAAM,EACpB,OAAO,EAAE,MAAM,IAAI;IAWlB,mEAAmE;;;;EAepE"}
@@ -0,0 +1,13 @@
1
+ import type { Timers } from './timers';
2
+ export declare const REVALIDATE_DEBOUNCE_MS = 300;
3
+ /** A steady stream of events still reads the page again at least this often. */
4
+ export declare const REVALIDATE_MAX_WAIT_MS = 2000;
5
+ /**
6
+ * A debounced "read again": quiet for 300 ms, or 2 s after the first request
7
+ * of a burst, whichever comes first; one `fire` per window.
8
+ */
9
+ export declare function createRevalidateScheduler(timers: Timers, fire: () => void): {
10
+ request(): void;
11
+ cancel: () => void;
12
+ };
13
+ //# sourceMappingURL=scheduler.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"scheduler.d.ts","sourceRoot":"","sources":["../../../src/subscription/react/scheduler.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAEvC,eAAO,MAAM,sBAAsB,MAAM,CAAC;AAC1C,gFAAgF;AAChF,eAAO,MAAM,sBAAsB,OAAO,CAAC;AAE3C;;;GAGG;AACH,wBAAgB,yBAAyB,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,IAAI;;;EAuBzE"}
@@ -0,0 +1,7 @@
1
+ /** The clock the live rules use, injectable so specs can drive it by hand. */
2
+ export type Timers = {
3
+ set: (fn: () => void, ms: number) => unknown;
4
+ clear: (handle: unknown) => void;
5
+ };
6
+ export declare const globalTimers: Timers;
7
+ //# sourceMappingURL=timers.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"timers.d.ts","sourceRoot":"","sources":["../../../src/subscription/react/timers.ts"],"names":[],"mappings":"AAAA,8EAA8E;AAC9E,MAAM,MAAM,MAAM,GAAG;IACpB,GAAG,EAAE,CAAC,EAAE,EAAE,MAAM,IAAI,EAAE,EAAE,EAAE,MAAM,KAAK,OAAO,CAAC;IAC7C,KAAK,EAAE,CAAC,MAAM,EAAE,OAAO,KAAK,IAAI,CAAC;CACjC,CAAC;AAEF,eAAO,MAAM,YAAY,EAAE,MAG1B,CAAC"}
@@ -0,0 +1,36 @@
1
+ import type { GraphQLDocument } from '@nxgt/graphql-client';
2
+ import { type LiveStatus } from './controller';
3
+ export type LiveControls = {
4
+ /** Asks for the page's data to be read again (debounced). */
5
+ revalidate: () => void;
6
+ };
7
+ export type UseLiveSubscriptionOptions<TEvent> = {
8
+ /** Which thing an event is about. With `versionOf`, an event below the highest version seen for its key is dropped; an event with no key is never dropped. */
9
+ keyOf?: ((event: TEvent) => string | null | undefined) | undefined;
10
+ /** How new the event's state is. Leave out with `keyOf` for a stream whose every event is the whole state. */
11
+ versionOf?: ((event: TEvent) => number) | undefined;
12
+ /** Each fresh event, in order. The latest function is called. */
13
+ onChange: (event: TEvent, controls: LiveControls) => void;
14
+ /** Reads the page's data again (a loader, a refetch): at most once per window of 300 ms of quiet or 2 s, and after every reopen but the first. Leave out for a stream that needs no read. */
15
+ revalidate?: (() => void) | undefined;
16
+ /** Connects nothing while `true`. */
17
+ skip?: boolean | undefined;
18
+ };
19
+ export type LiveSubscription = {
20
+ status: LiveStatus;
21
+ /** After a stop (`status === 'stopped'`): open the stream again. */
22
+ retry: () => void;
23
+ /** Asks for the page's data to be read again (debounced). */
24
+ revalidate: () => void;
25
+ };
26
+ /**
27
+ * A GraphQL subscription kept alive: reconnects with a growing wait (1 s to
28
+ * 30 s), stops on a 401 or another refusal repeating cannot change, waits a
29
+ * 429's `retryAfter`, drops events older than the highest version seen per
30
+ * key, and reads the page again (debounced) after every reopen but the first,
31
+ * since nothing is replayed. Pairs with `createSubscriptionProxy`.
32
+ *
33
+ * Needs `GraphQLProvider` above it.
34
+ */
35
+ export declare function useLiveSubscription<TEvent, TVariables = Record<string, never>>(document: GraphQLDocument<TEvent, TVariables>, variables: TVariables, options: UseLiveSubscriptionOptions<TEvent>): LiveSubscription;
36
+ //# sourceMappingURL=use-live-subscription.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"use-live-subscription.d.ts","sourceRoot":"","sources":["../../../src/subscription/react/use-live-subscription.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAG5D,OAAO,EAAwB,KAAK,UAAU,EAAE,MAAM,cAAc,CAAC;AAErE,MAAM,MAAM,YAAY,GAAG;IAC1B,6DAA6D;IAC7D,UAAU,EAAE,MAAM,IAAI,CAAC;CACvB,CAAC;AAEF,MAAM,MAAM,0BAA0B,CAAC,MAAM,IAAI;IAChD,8JAA8J;IAC9J,KAAK,CAAC,EAAE,CAAC,CAAC,KAAK,EAAE,MAAM,KAAK,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC,GAAG,SAAS,CAAC;IACnE,8GAA8G;IAC9G,SAAS,CAAC,EAAE,CAAC,CAAC,KAAK,EAAE,MAAM,KAAK,MAAM,CAAC,GAAG,SAAS,CAAC;IACpD,iEAAiE;IACjE,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,YAAY,KAAK,IAAI,CAAC;IAC1D,6LAA6L;IAC7L,UAAU,CAAC,EAAE,CAAC,MAAM,IAAI,CAAC,GAAG,SAAS,CAAC;IACtC,qCAAqC;IACrC,IAAI,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;CAC3B,CAAC;AAEF,MAAM,MAAM,gBAAgB,GAAG;IAC9B,MAAM,EAAE,UAAU,CAAC;IACnB,oEAAoE;IACpE,KAAK,EAAE,MAAM,IAAI,CAAC;IAClB,6DAA6D;IAC7D,UAAU,EAAE,MAAM,IAAI,CAAC;CACvB,CAAC;AAEF;;;;;;;;GAQG;AACH,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,UAAU,GAAG,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,EAC7E,QAAQ,EAAE,eAAe,CAAC,MAAM,EAAE,UAAU,CAAC,EAC7C,SAAS,EAAE,UAAU,EACrB,OAAO,EAAE,0BAA0B,CAAC,MAAM,CAAC,GACzC,gBAAgB,CAqClB"}
@@ -0,0 +1,6 @@
1
+ /** The highest version seen per key: an event below it is stale. */
2
+ export declare function createVersions(): {
3
+ /** True (and remembered) unless `version` is below the highest seen for `key`. */
4
+ accept(key: string, version: number): boolean;
5
+ };
6
+ //# sourceMappingURL=versions.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"versions.d.ts","sourceRoot":"","sources":["../../../src/subscription/react/versions.ts"],"names":[],"mappings":"AAAA,oEAAoE;AACpE,wBAAgB,cAAc;IAG5B,kFAAkF;gBACtE,MAAM,WAAW,MAAM,GAAG,OAAO;EAO9C"}
@@ -0,0 +1,17 @@
1
+ /** The most a body, a query string or the variables may weigh, in bytes. */
2
+ export declare const LIMITS: {
3
+ readonly body: number;
4
+ readonly queryString: number;
5
+ readonly variables: number;
6
+ };
7
+ export interface Asked {
8
+ readonly operationName: string;
9
+ readonly variables?: Record<string, unknown>;
10
+ }
11
+ /**
12
+ * What a client asks for: an `operationName` and its `variables`, from a
13
+ * GET's search params or a POST's JSON body. Any `query` or `extensions` it
14
+ * sends (graphql-sse always sends a `query`) is ignored.
15
+ */
16
+ export declare function readAsked(request: Request): Promise<Asked>;
17
+ //# sourceMappingURL=read.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"read.d.ts","sourceRoot":"","sources":["../../src/subscription/read.ts"],"names":[],"mappings":"AAEA,4EAA4E;AAC5E,eAAO,MAAM,MAAM;;;;CAIT,CAAC;AAEX,MAAM,WAAW,KAAK;IACrB,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAC;IAC/B,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAC7C;AA0CD;;;;GAIG;AACH,wBAAsB,SAAS,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,CAAC,KAAK,CAAC,CA6ChE"}
@@ -0,0 +1,11 @@
1
+ /** An answer the proxy gives itself, as GraphQL-shaped JSON a client can read. */
2
+ export declare class Refusal extends Error {
3
+ readonly status: number;
4
+ readonly code: string;
5
+ constructor(status: number, message: string, code: string);
6
+ }
7
+ export declare function problem(status: number, message: string, code: string, extra?: Record<string, unknown>, headers?: HeadersInit): Response;
8
+ export declare const refusalResponse: (refusal: Refusal) => Response;
9
+ /** What a non-2xx upstream answer becomes: a 429 with `retryAfter`, a 502 for a 5xx, any other 4xx as it came. */
10
+ export declare function refusedUpstream(upstream: Response): Promise<Response>;
11
+ //# sourceMappingURL=refusal.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"refusal.d.ts","sourceRoot":"","sources":["../../src/subscription/refusal.ts"],"names":[],"mappings":"AAAA,kFAAkF;AAClF,qBAAa,OAAQ,SAAQ,KAAK;IAEhC,QAAQ,CAAC,MAAM,EAAE,MAAM;IAEvB,QAAQ,CAAC,IAAI,EAAE,MAAM;gBAFZ,MAAM,EAAE,MAAM,EACvB,OAAO,EAAE,MAAM,EACN,IAAI,EAAE,MAAM;CAKtB;AAED,wBAAgB,OAAO,CACtB,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,MAAM,EACf,IAAI,EAAE,MAAM,EACZ,KAAK,GAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAM,EACnC,OAAO,GAAE,WAAgB,GACvB,QAAQ,CAeV;AAED,eAAO,MAAM,eAAe,GAAI,SAAS,OAAO,KAAG,QACI,CAAC;AAiBxD,kHAAkH;AAClH,wBAAsB,eAAe,CAAC,QAAQ,EAAE,QAAQ,GAAG,OAAO,CAAC,QAAQ,CAAC,CA0B3E"}
@@ -0,0 +1,16 @@
1
+ /** The most one event may weigh before the stream is cut, in characters. */
2
+ export declare const MAX_EVENT: number;
3
+ export declare const SSE_HEADERS: {
4
+ 'content-type': string;
5
+ 'cache-control': string;
6
+ 'x-accel-buffering': string;
7
+ };
8
+ /**
9
+ * Relays whole events (a heartbeat never lands inside one) until the upstream
10
+ * ends or the client leaves. The stream is pulled: upstream is read only when
11
+ * the client has taken what was queued, so a slow client holds the upstream
12
+ * back instead of growing a buffer, and a heartbeat is skipped while one is
13
+ * waiting.
14
+ */
15
+ export declare function relay(upstream: Response, abort: AbortController, heartbeatMs: number): Response;
16
+ //# sourceMappingURL=relay.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"relay.d.ts","sourceRoot":"","sources":["../../src/subscription/relay.ts"],"names":[],"mappings":"AAAA,4EAA4E;AAC5E,eAAO,MAAM,SAAS,QAAc,CAAC;AAKrC,eAAO,MAAM,WAAW;;;;CAIvB,CAAC;AAKF;;;;;;GAMG;AACH,wBAAgB,KAAK,CACpB,QAAQ,EAAE,QAAQ,EAClB,KAAK,EAAE,eAAe,EACtB,WAAW,EAAE,MAAM,GACjB,QAAQ,CAwDV"}
@@ -0,0 +1,21 @@
1
+ import type { EnvironmentOptions } from 'vite';
2
+ /**
3
+ * What the plugin adds to the `ssr` environment, given its options as the
4
+ * config and every plugin's `config` hook left them. Vite merges the
5
+ * result into them, concatenating arrays, so what the app set is kept:
6
+ *
7
+ * - `resolve.conditions` and `resolve.externalConditions` gain `bun`, so a
8
+ * package that exports a `bun` variant is bundled, and checked, as Bun
9
+ * would load it. Which variant wins stays the package's own order.
10
+ * - `resolve.builtins` gains `bun` and `bun:*`: left external, whichever
11
+ * runtime runs Vite. Vite's own builtins are kept when the app names none.
12
+ * - `build.target` is `esnext`, Bun's, unless the app set one, at the top
13
+ * level or on the environment.
14
+ *
15
+ * `ssr.target` stays `node`: Bun runs Node's modules, and `webworker`
16
+ * would bundle every dependency with the browser's conditions. An app that
17
+ * sets `webworker` itself gets none of this: the plugin leaves that
18
+ * environment to Vite's own defaults.
19
+ */
20
+ export declare function bunEnvironment(options: EnvironmentOptions): EnvironmentOptions;
21
+ //# sourceMappingURL=bun.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bun.d.ts","sourceRoot":"","sources":["../../src/vite/bun.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,MAAM,CAAC;AAkD/C;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,cAAc,CAC7B,OAAO,EAAE,kBAAkB,GACzB,kBAAkB,CAiBpB"}
@@ -0,0 +1,33 @@
1
+ /**
2
+ * The server build, self-contained: every dependency bundled into
3
+ * `build/server/index.js`, so that running it needs `build/` and Bun, and
4
+ * no `node_modules`. A Docker image's final stage copies `build/` alone.
5
+ */
6
+ import type { EnvironmentOptions } from 'vite';
7
+ /**
8
+ * What the plugin adds to the `ssr` environment under `react-router build`,
9
+ * given its options as the config and the plugins left them:
10
+ * `resolve.noExternal: true`, every package bundled. Never in dev, where
11
+ * Vite's SSR runner loads the packages from `node_modules`.
12
+ *
13
+ * What the app set wins:
14
+ *
15
+ * - `ssr.external: ['sharp']`, or the same on `environments.ssr.resolve`,
16
+ * keeps those packages external, imported from `node_modules` at
17
+ * runtime: Vite reads `external` before `noExternal`. Bun's own modules,
18
+ * `bun` and `bun:*`, and Node's are builtins, external whatever this says.
19
+ * - `ssr.external: true` keeps every package external, Vite's own default:
20
+ * the plugin adds nothing then.
21
+ * - `ssr.noExternal`, a list, is a subset of everything: it changes nothing.
22
+ *
23
+ * React Router's own plugin reads `noExternal: true` and adds no externals
24
+ * of its own; it runs after this one, which is `enforce: 'pre'`.
25
+ */
26
+ export declare function bundledEnvironment(options: EnvironmentOptions): EnvironmentOptions | undefined;
27
+ /**
28
+ * Everything the plugin adds to the `ssr` environment: built for Bun under
29
+ * either command, and self-contained under `build` alone. In dev, Vite's
30
+ * SSR runner loads the packages from `node_modules`.
31
+ */
32
+ export declare function ssrEnvironment(options: EnvironmentOptions, command: 'build' | 'serve'): EnvironmentOptions;
33
+ //# sourceMappingURL=bundle.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bundle.d.ts","sourceRoot":"","sources":["../../src/vite/bundle.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,MAAM,CAAC;AAG/C;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,kBAAkB,CACjC,OAAO,EAAE,kBAAkB,GACzB,kBAAkB,GAAG,SAAS,CAGhC;AAED;;;;GAIG;AACH,wBAAgB,cAAc,CAC7B,OAAO,EAAE,kBAAkB,EAC3B,OAAO,EAAE,OAAO,GAAG,OAAO,GACxB,kBAAkB,CAKpB"}
@@ -0,0 +1,18 @@
1
+ export interface PrecompressOptions {
2
+ /** The smallest file, in bytes, that gets copies: 1024 by default. */
3
+ readonly minSize?: number;
4
+ }
5
+ export interface Precompressed {
6
+ /** The files that got copies. */
7
+ readonly files: number;
8
+ /** Their size before, and the size of their brotli copies. */
9
+ readonly bytes: number;
10
+ readonly brotliBytes: number;
11
+ }
12
+ /**
13
+ * Writes `<file>.br` and `<file>.gz` beside each compressible file of
14
+ * `client` of at least `minSize` bytes, whichever is smaller than the file
15
+ * itself. Brotli at its best quality: it runs once, at build time.
16
+ */
17
+ export declare function precompressClient(client: string, options?: PrecompressOptions): Promise<Precompressed>;
18
+ //# sourceMappingURL=compress.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"compress.d.ts","sourceRoot":"","sources":["../../src/vite/compress.ts"],"names":[],"mappings":"AAkCA,MAAM,WAAW,kBAAkB;IAClC,sEAAsE;IACtE,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC;CAC1B;AAED,MAAM,WAAW,aAAa;IAC7B,iCAAiC;IACjC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,8DAA8D;IAC9D,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;CAC7B;AAUD;;;;GAIG;AACH,wBAAsB,iBAAiB,CACtC,MAAM,EAAE,MAAM,EACd,OAAO,GAAE,kBAAuB,GAC9B,OAAO,CAAC,aAAa,CAAC,CAqCxB"}
@@ -0,0 +1,33 @@
1
+ import type { ResolvedConfig } from 'vite';
2
+ /** The server build's input, and in dev the module the requests go to. */
3
+ export declare const SERVER = "virtual:alxia-react-router/server";
4
+ /** The same, when there is no server file: `createServer()` as it is. */
5
+ export declare const DEFAULT = "virtual:alxia-react-router/server-default";
6
+ /** What the plugin reads of React Router's own config. */
7
+ export interface ReactRouterConfig {
8
+ readonly appDirectory: string;
9
+ readonly buildDirectory: string;
10
+ readonly serverBuildFile: string;
11
+ readonly ssr: boolean;
12
+ readonly serverBundles?: unknown;
13
+ }
14
+ /** React Router's config, which its plugin puts on Vite's. */
15
+ export declare function contextOf(config: object): ReactRouterConfig;
16
+ /** React Router's child compiler: a Vite server without its plugin, cached apart. */
17
+ export declare function isChildCompiler(config: ResolvedConfig): boolean;
18
+ /**
19
+ * The server file: `entry`, which must exist, or `app/server.ts` when it
20
+ * does, or `undefined` for the default server.
21
+ */
22
+ export declare function serverFile(entry: string | undefined, config: ResolvedConfig): string | undefined;
23
+ /** The built server, absolute: `build/server/index.js`. */
24
+ export declare function serverBuildPath(config: ResolvedConfig): string;
25
+ /** `build/client`, relative to the built `build/server/index.js`. */
26
+ export declare function clientPath(config: ResolvedConfig): string;
27
+ /**
28
+ * The ssr build's options: one file, `build/server/index.js`, the server
29
+ * and React Router's build together. Rolldown, under Vite 8, names the
30
+ * option otherwise.
31
+ */
32
+ export declare function serverBuildOptions(rolldown: boolean): object;
33
+ //# sourceMappingURL=config.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/vite/config.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,MAAM,CAAC;AAG3C,0EAA0E;AAC1E,eAAO,MAAM,MAAM,sCAAsC,CAAC;AAC1D,yEAAyE;AACzE,eAAO,MAAM,OAAO,8CAAsB,CAAC;AAE3C,0DAA0D;AAC1D,MAAM,WAAW,iBAAiB;IACjC,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;IAC9B,QAAQ,CAAC,cAAc,EAAE,MAAM,CAAC;IAChC,QAAQ,CAAC,eAAe,EAAE,MAAM,CAAC;IACjC,QAAQ,CAAC,GAAG,EAAE,OAAO,CAAC;IACtB,QAAQ,CAAC,aAAa,CAAC,EAAE,OAAO,CAAC;CACjC;AAED,8DAA8D;AAC9D,wBAAgB,SAAS,CAAC,MAAM,EAAE,MAAM,GAAG,iBAAiB,CAc3D;AAED,qFAAqF;AACrF,wBAAgB,eAAe,CAAC,MAAM,EAAE,cAAc,GAAG,OAAO,CAM/D;AAED;;;GAGG;AACH,wBAAgB,UAAU,CACzB,KAAK,EAAE,MAAM,GAAG,SAAS,EACzB,MAAM,EAAE,cAAc,GACpB,MAAM,GAAG,SAAS,CAYpB;AAED,2DAA2D;AAC3D,wBAAgB,eAAe,CAAC,MAAM,EAAE,cAAc,GAAG,MAAM,CAQ9D;AAED,qEAAqE;AACrE,wBAAgB,UAAU,CAAC,MAAM,EAAE,cAAc,GAAG,MAAM,CAOzD;AAED;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,QAAQ,EAAE,OAAO,GAAG,MAAM,CAc5D"}
@@ -0,0 +1,28 @@
1
+ /**
2
+ * Under `react-router dev`: a request Vite left, answered by the server,
3
+ * loaded through the ssr environment's module runner.
4
+ */
5
+ import type { ViteDevServer } from 'vite';
6
+ import { toRequest } from './node';
7
+ import { type SideOf } from './socket';
8
+ /** What the dev server module exports: the alxia app, as `server.create` made it. */
9
+ export interface DevApp {
10
+ fetch(request: Request, server?: Bun.Server<unknown>): Promise<Response>;
11
+ readonly websocket: Bun.WebSocketHandler<never>;
12
+ }
13
+ /**
14
+ * The app, as the server file is now: the runner keeps the module until an
15
+ * edit invalidates it, so an edit is a new app.
16
+ */
17
+ export declare function loadApp(server: ViteDevServer, entry: string | undefined): Promise<DevApp>;
18
+ /**
19
+ * One request Vite left, answered by the app as the server file is now,
20
+ * given the side server its sockets are open on as `ctx.server`.
21
+ */
22
+ export declare function serveFromEntry(server: ViteDevServer, entry: string | undefined, sideOf: SideOf, req: Parameters<typeof toRequest>[0], res: Parameters<typeof toRequest>[1]): Promise<void>;
23
+ /**
24
+ * `react-router dev`: the app's sockets on Vite's server now, and, returned
25
+ * for after Vite's own middlewares, every request Vite leaves to the app.
26
+ */
27
+ export declare function serveDev(server: ViteDevServer, entry: string | undefined): () => void;
28
+ //# sourceMappingURL=dev.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dev.d.ts","sourceRoot":"","sources":["../../src/vite/dev.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,MAAM,CAAC;AAG1C,OAAO,EAAQ,SAAS,EAAE,MAAM,QAAQ,CAAC;AACzC,OAAO,EAAiB,KAAK,MAAM,EAAE,MAAM,UAAU,CAAC;AAEtD,qFAAqF;AACrF,MAAM,WAAW,MAAM;IACtB,KAAK,CAAC,OAAO,EAAE,OAAO,EAAE,MAAM,CAAC,EAAE,GAAG,CAAC,MAAM,CAAC,OAAO,CAAC,GAAG,OAAO,CAAC,QAAQ,CAAC,CAAC;IACzE,QAAQ,CAAC,SAAS,EAAE,GAAG,CAAC,gBAAgB,CAAC,KAAK,CAAC,CAAC;CAChD;AAED;;;GAGG;AACH,wBAAsB,OAAO,CAC5B,MAAM,EAAE,aAAa,EACrB,KAAK,EAAE,MAAM,GAAG,SAAS,GACvB,OAAO,CAAC,MAAM,CAAC,CAoBjB;AAED;;;GAGG;AACH,wBAAsB,cAAc,CACnC,MAAM,EAAE,aAAa,EACrB,KAAK,EAAE,MAAM,GAAG,SAAS,EACzB,MAAM,EAAE,MAAM,EACd,GAAG,EAAE,UAAU,CAAC,OAAO,SAAS,CAAC,CAAC,CAAC,CAAC,EACpC,GAAG,EAAE,UAAU,CAAC,OAAO,SAAS,CAAC,CAAC,CAAC,CAAC,GAClC,OAAO,CAAC,IAAI,CAAC,CAGf;AAED;;;GAGG;AACH,wBAAgB,QAAQ,CACvB,MAAM,EAAE,aAAa,EACrB,KAAK,EAAE,MAAM,GAAG,SAAS,GACvB,MAAM,IAAI,CAiBZ"}
@@ -0,0 +1,20 @@
1
+ /**
2
+ * The source of the module the plugin serves in dev and builds as
3
+ * `build/server/index.js`: the server, made into the app with React
4
+ * Router's build, and in a build listening when run.
5
+ */
6
+ export declare const NAME = "alxia-react-router";
7
+ /** The input when the plugin is disabled: React Router's build alone. */
8
+ export declare const PASS_THROUGH = "export * from 'virtual:react-router/server-build';\n";
9
+ export interface EntryOptions {
10
+ /** The server file, absolute, or `undefined` for `createServer()` as it is. */
11
+ readonly file: string | undefined;
12
+ /** How an error names the file: relative to Vite's root. */
13
+ readonly label: string;
14
+ /** Under `react-router dev`: the build on every request, no client, no listening. */
15
+ readonly dev: boolean;
16
+ /** The client build, relative to the built file: `../client`. */
17
+ readonly client: string | undefined;
18
+ }
19
+ export declare function serverEntry({ file, label, dev, client, }: EntryOptions): string;
20
+ //# sourceMappingURL=entry.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"entry.d.ts","sourceRoot":"","sources":["../../src/vite/entry.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,eAAO,MAAM,IAAI,uBAAuB,CAAC;AAKzC,yEAAyE;AACzE,eAAO,MAAM,YAAY,yDAAuC,CAAC;AAEjE,MAAM,WAAW,YAAY;IAC5B,+EAA+E;IAC/E,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS,CAAC;IAClC,4DAA4D;IAC5D,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,qFAAqF;IACrF,QAAQ,CAAC,GAAG,EAAE,OAAO,CAAC;IACtB,iEAAiE;IACjE,QAAQ,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC;CACpC;AAED,wBAAgB,WAAW,CAAC,EAC3B,IAAI,EACJ,KAAK,EACL,GAAG,EACH,MAAM,GACN,EAAE,YAAY,GAAG,MAAM,CAyCvB"}