@flipstream/sdk 0.14.0 → 0.15.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 (218) hide show
  1. package/CHANGELOG.md +76 -0
  2. package/README.md +95 -1
  3. package/dist/auth/transport.d.ts +6 -2
  4. package/dist/auth/transport.js +5 -3
  5. package/dist/auth/transport.js.map +1 -1
  6. package/dist/core/call.d.ts +4 -0
  7. package/dist/core/call.js +7 -1
  8. package/dist/core/call.js.map +1 -1
  9. package/dist/core/fetch.d.ts +20 -1
  10. package/dist/core/fetch.js +50 -3
  11. package/dist/core/fetch.js.map +1 -1
  12. package/dist/core/hosts.d.ts +11 -0
  13. package/dist/core/hosts.js +13 -0
  14. package/dist/core/hosts.js.map +1 -0
  15. package/dist/core/identify.d.ts +6 -2
  16. package/dist/core/identify.js +16 -12
  17. package/dist/core/identify.js.map +1 -1
  18. package/dist/core/result.d.ts +1 -1
  19. package/dist/core/shared.d.ts +2 -0
  20. package/dist/core/shared.js +1 -0
  21. package/dist/core/shared.js.map +1 -1
  22. package/dist/core/signal.d.ts +7 -0
  23. package/dist/core/signal.js +9 -0
  24. package/dist/core/signal.js.map +1 -1
  25. package/dist/first-party/asPerson.d.ts +13 -0
  26. package/dist/first-party/asPerson.js +144 -0
  27. package/dist/first-party/asPerson.js.map +1 -0
  28. package/dist/first-party/attempts.d.ts +71 -0
  29. package/dist/first-party/attempts.js +132 -0
  30. package/dist/first-party/attempts.js.map +1 -0
  31. package/dist/first-party/authProxyMark.d.ts +7 -0
  32. package/dist/first-party/authProxyMark.js +8 -0
  33. package/dist/first-party/authProxyMark.js.map +1 -0
  34. package/dist/first-party/browser.d.ts +55 -0
  35. package/dist/first-party/browser.js +137 -0
  36. package/dist/first-party/browser.js.map +1 -0
  37. package/dist/first-party/browserSession.d.ts +95 -0
  38. package/dist/first-party/browserSession.js +242 -0
  39. package/dist/first-party/browserSession.js.map +1 -0
  40. package/dist/first-party/calls/consent.d.ts +77 -0
  41. package/dist/first-party/calls/consent.js +174 -0
  42. package/dist/first-party/calls/consent.js.map +1 -0
  43. package/dist/first-party/calls/device.d.ts +75 -0
  44. package/dist/first-party/calls/device.js +133 -0
  45. package/dist/first-party/calls/device.js.map +1 -0
  46. package/dist/first-party/calls/invitation.d.ts +198 -0
  47. package/dist/first-party/calls/invitation.js +240 -0
  48. package/dist/first-party/calls/invitation.js.map +1 -0
  49. package/dist/first-party/calls/logIn.d.ts +41 -0
  50. package/dist/first-party/calls/logIn.js +48 -0
  51. package/dist/first-party/calls/logIn.js.map +1 -0
  52. package/dist/first-party/calls/reset.d.ts +58 -0
  53. package/dist/first-party/calls/reset.js +163 -0
  54. package/dist/first-party/calls/reset.js.map +1 -0
  55. package/dist/first-party/calls/signUp.d.ts +21 -0
  56. package/dist/first-party/calls/signUp.js +72 -0
  57. package/dist/first-party/calls/signUp.js.map +1 -0
  58. package/dist/first-party/calls/twoStepSetup.d.ts +55 -0
  59. package/dist/first-party/calls/twoStepSetup.js +168 -0
  60. package/dist/first-party/calls/twoStepSetup.js.map +1 -0
  61. package/dist/first-party/claims.d.ts +88 -0
  62. package/dist/first-party/claims.js +181 -0
  63. package/dist/first-party/claims.js.map +1 -0
  64. package/dist/first-party/enrollment.d.ts +10 -0
  65. package/dist/first-party/enrollment.js +44 -0
  66. package/dist/first-party/enrollment.js.map +1 -0
  67. package/dist/first-party/entry.d.ts +549 -0
  68. package/dist/first-party/entry.js +580 -0
  69. package/dist/first-party/entry.js.map +1 -0
  70. package/dist/first-party/hooks.d.ts +66 -0
  71. package/dist/first-party/hooks.js +19 -0
  72. package/dist/first-party/hooks.js.map +1 -0
  73. package/dist/first-party/http.d.ts +191 -0
  74. package/dist/first-party/http.js +364 -0
  75. package/dist/first-party/http.js.map +1 -0
  76. package/dist/first-party/index.d.ts +14 -0
  77. package/dist/first-party/index.js +3 -0
  78. package/dist/first-party/index.js.map +1 -0
  79. package/dist/first-party/landed.d.ts +32 -0
  80. package/dist/first-party/landed.js +50 -0
  81. package/dist/first-party/landed.js.map +1 -0
  82. package/dist/first-party/landedProof.d.ts +12 -0
  83. package/dist/first-party/landedProof.js +20 -0
  84. package/dist/first-party/landedProof.js.map +1 -0
  85. package/dist/first-party/linkToken.d.ts +16 -0
  86. package/dist/first-party/linkToken.js +29 -0
  87. package/dist/first-party/linkToken.js.map +1 -0
  88. package/dist/first-party/links.d.ts +100 -0
  89. package/dist/first-party/links.js +84 -0
  90. package/dist/first-party/links.js.map +1 -0
  91. package/dist/first-party/locks.d.ts +36 -0
  92. package/dist/first-party/locks.js +64 -0
  93. package/dist/first-party/locks.js.map +1 -0
  94. package/dist/first-party/personTransport.d.ts +38 -0
  95. package/dist/first-party/personTransport.js +177 -0
  96. package/dist/first-party/personTransport.js.map +1 -0
  97. package/dist/first-party/proxy/app.d.ts +25 -0
  98. package/dist/first-party/proxy/app.js +94 -0
  99. package/dist/first-party/proxy/app.js.map +1 -0
  100. package/dist/first-party/proxy/bound.d.ts +5 -0
  101. package/dist/first-party/proxy/bound.js +13 -0
  102. package/dist/first-party/proxy/bound.js.map +1 -0
  103. package/dist/first-party/proxy/cases.d.ts +54 -0
  104. package/dist/first-party/proxy/cases.js +412 -0
  105. package/dist/first-party/proxy/cases.js.map +1 -0
  106. package/dist/first-party/proxy/decide.d.ts +29 -0
  107. package/dist/first-party/proxy/decide.js +140 -0
  108. package/dist/first-party/proxy/decide.js.map +1 -0
  109. package/dist/first-party/proxy/freeze.d.ts +2 -0
  110. package/dist/first-party/proxy/freeze.js +10 -0
  111. package/dist/first-party/proxy/freeze.js.map +1 -0
  112. package/dist/first-party/proxy/handler.d.ts +23 -0
  113. package/dist/first-party/proxy/handler.js +190 -0
  114. package/dist/first-party/proxy/handler.js.map +1 -0
  115. package/dist/first-party/proxy/headers.d.ts +8 -0
  116. package/dist/first-party/proxy/headers.js +20 -0
  117. package/dist/first-party/proxy/headers.js.map +1 -0
  118. package/dist/first-party/proxy/hop.d.ts +9 -0
  119. package/dist/first-party/proxy/hop.js +37 -0
  120. package/dist/first-party/proxy/hop.js.map +1 -0
  121. package/dist/first-party/proxy/host.d.ts +5 -0
  122. package/dist/first-party/proxy/host.js +11 -0
  123. package/dist/first-party/proxy/host.js.map +1 -0
  124. package/dist/first-party/proxy/index.d.ts +7 -0
  125. package/dist/first-party/proxy/index.js +6 -0
  126. package/dist/first-party/proxy/index.js.map +1 -0
  127. package/dist/first-party/proxy/pass-back.d.ts +21 -0
  128. package/dist/first-party/proxy/pass-back.js +51 -0
  129. package/dist/first-party/proxy/pass-back.js.map +1 -0
  130. package/dist/first-party/proxy/paths.d.ts +17 -0
  131. package/dist/first-party/proxy/paths.js +36 -0
  132. package/dist/first-party/proxy/paths.js.map +1 -0
  133. package/dist/first-party/proxy/shown.d.ts +5 -0
  134. package/dist/first-party/proxy/shown.js +16 -0
  135. package/dist/first-party/proxy/shown.js.map +1 -0
  136. package/dist/first-party/proxy/stand-in.d.ts +47 -0
  137. package/dist/first-party/proxy/stand-in.js +318 -0
  138. package/dist/first-party/proxy/stand-in.js.map +1 -0
  139. package/dist/first-party/report.d.ts +47 -0
  140. package/dist/first-party/report.js +38 -0
  141. package/dist/first-party/report.js.map +1 -0
  142. package/dist/first-party/result.d.ts +82 -0
  143. package/dist/first-party/result.js +40 -0
  144. package/dist/first-party/result.js.map +1 -0
  145. package/dist/first-party/session/cell.d.ts +177 -0
  146. package/dist/first-party/session/cell.js +89 -0
  147. package/dist/first-party/session/cell.js.map +1 -0
  148. package/dist/first-party/session/closed.d.ts +8 -0
  149. package/dist/first-party/session/closed.js +12 -0
  150. package/dist/first-party/session/closed.js.map +1 -0
  151. package/dist/first-party/session/index.d.ts +3 -0
  152. package/dist/first-party/session/index.js +3 -0
  153. package/dist/first-party/session/index.js.map +1 -0
  154. package/dist/first-party/session/logout.d.ts +82 -0
  155. package/dist/first-party/session/logout.js +328 -0
  156. package/dist/first-party/session/logout.js.map +1 -0
  157. package/dist/first-party/session/owed.d.ts +30 -0
  158. package/dist/first-party/session/owed.js +27 -0
  159. package/dist/first-party/session/owed.js.map +1 -0
  160. package/dist/first-party/session/refresh.d.ts +19 -0
  161. package/dist/first-party/session/refresh.js +229 -0
  162. package/dist/first-party/session/refresh.js.map +1 -0
  163. package/dist/first-party/session/results.d.ts +38 -0
  164. package/dist/first-party/session/results.js +74 -0
  165. package/dist/first-party/session/results.js.map +1 -0
  166. package/dist/first-party/session/session.d.ts +2 -0
  167. package/dist/first-party/session/session.js +379 -0
  168. package/dist/first-party/session/session.js.map +1 -0
  169. package/dist/first-party/session/shared.d.ts +34 -0
  170. package/dist/first-party/session/shared.js +104 -0
  171. package/dist/first-party/session/shared.js.map +1 -0
  172. package/dist/first-party/session/sharedSignal.d.ts +27 -0
  173. package/dist/first-party/session/sharedSignal.js +55 -0
  174. package/dist/first-party/session/sharedSignal.js.map +1 -0
  175. package/dist/first-party/session/signIn.d.ts +43 -0
  176. package/dist/first-party/session/signIn.js +294 -0
  177. package/dist/first-party/session/signIn.js.map +1 -0
  178. package/dist/first-party/session/signInThrough.d.ts +5 -0
  179. package/dist/first-party/session/signInThrough.js +95 -0
  180. package/dist/first-party/session/signInThrough.js.map +1 -0
  181. package/dist/first-party/session/sync.d.ts +17 -0
  182. package/dist/first-party/session/sync.js +143 -0
  183. package/dist/first-party/session/sync.js.map +1 -0
  184. package/dist/first-party/session/tokens.d.ts +18 -0
  185. package/dist/first-party/session/tokens.js +64 -0
  186. package/dist/first-party/session/tokens.js.map +1 -0
  187. package/dist/first-party/session/types.d.ts +270 -0
  188. package/dist/first-party/session/types.js +3 -0
  189. package/dist/first-party/session/types.js.map +1 -0
  190. package/dist/first-party/sessionWire.d.ts +31 -0
  191. package/dist/first-party/sessionWire.js +91 -0
  192. package/dist/first-party/sessionWire.js.map +1 -0
  193. package/dist/first-party/signInHooks.d.ts +57 -0
  194. package/dist/first-party/signInHooks.js +2 -0
  195. package/dist/first-party/signInHooks.js.map +1 -0
  196. package/dist/first-party/state.d.ts +51 -0
  197. package/dist/first-party/state.js +52 -0
  198. package/dist/first-party/state.js.map +1 -0
  199. package/dist/first-party/strip.d.ts +1 -0
  200. package/dist/first-party/strip.js +8 -0
  201. package/dist/first-party/strip.js.map +1 -0
  202. package/dist/first-party/twoStepLock.d.ts +26 -0
  203. package/dist/first-party/twoStepLock.js +58 -0
  204. package/dist/first-party/twoStepLock.js.map +1 -0
  205. package/dist/first-party/twoStepSession.d.ts +21 -0
  206. package/dist/first-party/twoStepSession.js +31 -0
  207. package/dist/first-party/twoStepSession.js.map +1 -0
  208. package/dist/first-party/wire.d.ts +63 -0
  209. package/dist/first-party/wire.js +5 -0
  210. package/dist/first-party/wire.js.map +1 -0
  211. package/dist/flipstream.d.ts +51 -9
  212. package/dist/flipstream.js +58 -22
  213. package/dist/flipstream.js.map +1 -1
  214. package/dist/node/session.js +3 -1
  215. package/dist/node/session.js.map +1 -1
  216. package/dist/version.gen.js +1 -1
  217. package/docs/first-party.md +278 -0
  218. package/package.json +34 -5
package/CHANGELOG.md CHANGED
@@ -1,5 +1,81 @@
1
1
  # Changelog
2
2
 
3
+ ## [0.15.0](https://github.com/flipstream-io/sdk/compare/typescript-v0.14.0...typescript-v0.15.0) (2026-12-04)
4
+
5
+
6
+ ### ⚠ BREAKING CHANGES
7
+
8
+ * **typescript:** not_sent when verifyTwoStep never sent the code ([#533](https://github.com/flipstream-io/sdk/issues/533))
9
+
10
+ ### Features
11
+
12
+ * **typescript:** @flipstream/sdk/first-party keeps a person signed in in Flipstream's own apps, with typed results and no token in the page ([#475](https://github.com/flipstream-io/sdk/issues/475)) ([8b6bbae](https://github.com/flipstream-io/sdk/commit/8b6bbaedaafbfd0936e2030d64225889a379b742))
13
+ * **typescript:** a Flipstream app signs a person in with a password through @flipstream/sdk/first-party ([#491](https://github.com/flipstream-io/sdk/issues/491)) ([beff1ff](https://github.com/flipstream-io/sdk/commit/beff1ffeaa67bf6784ee55306643ce6648b65d76))
14
+ * **typescript:** a proxy that normalises the request target passes the lookalike rows when pulse-auth gets exactly a listed path ([#520](https://github.com/flipstream-io/sdk/issues/520)) ([106d934](https://github.com/flipstream-io/sdk/commit/106d934795104246a469776c9ad03bcbfea5d164))
15
+ * **typescript:** a second device press answers answered, and pulse-auth's unknown-code answer gives the code back ([#550](https://github.com/flipstream-io/sdk/issues/550)) ([8770280](https://github.com/flipstream-io/sdk/commit/877028021dad555cdc04d22f5c9a8a5dd6dc0750))
16
+ * **typescript:** an invitation opened, previewed and accepted from an account page ([#548](https://github.com/flipstream-io/sdk/issues/548)) ([ff8e2ba](https://github.com/flipstream-io/sdk/commit/ff8e2ba59621d11c2d62b70848a891761e5d4be3))
17
+ * **typescript:** device sign-in from an account page: look a code up open, approve or deny it as the person ([#536](https://github.com/flipstream-io/sdk/issues/536)) ([8e0cfe5](https://github.com/flipstream-io/sdk/commit/8e0cfe5165152ac0668ca7d92dc0bb98b46e6882))
18
+ * **typescript:** not_sent when verifyTwoStep never sent the code ([#533](https://github.com/flipstream-io/sdk/issues/533)) ([5ef9d03](https://github.com/flipstream-io/sdk/commit/5ef9d03eccada49911b67d84d2d44e7f57bf8fd3))
19
+ * **typescript:** requestSignUp mails a sign-up link from an account page, with the legal versions the person accepted ([#490](https://github.com/flipstream-io/sdk/issues/490)) ([34df8fe](https://github.com/flipstream-io/sdk/commit/34df8fe622fdad8ebd94ca0cb3707b5061991056))
20
+ * **typescript:** reset a password from an account page with requestPasswordReset, openedReset and setPassword ([#492](https://github.com/flipstream-io/sdk/issues/492)) ([d47e0ea](https://github.com/flipstream-io/sdk/commit/d47e0ea07a0d746f1cfc31b763abd8e372ff4587))
21
+ * **typescript:** review and answer an authorisation request ([#538](https://github.com/flipstream-io/sdk/issues/538)) ([763f847](https://github.com/flipstream-io/sdk/commit/763f847eda6f95af10d303c202ebe221e5610262))
22
+ * **typescript:** session.flipstream is the main SDK as the signed-in person, pinned when a call is made ([#495](https://github.com/flipstream-io/sdk/issues/495)) ([9fb7f3d](https://github.com/flipstream-io/sdk/commit/9fb7f3d142405c57a9d0d031d89ee57912ea2509))
23
+ * **typescript:** set up two-step verification and manage backup codes ([#534](https://github.com/flipstream-io/sdk/issues/534)) ([382f24e](https://github.com/flipstream-io/sdk/commit/382f24e6037577d3ba2dcedd9115c37686d567a6))
24
+ * **typescript:** the /auth proxy's rules live once in the first-party/proxy entry, with the rows and a stand-in every app's proxy is checked against ([#509](https://github.com/flipstream-io/sdk/issues/509)) ([0c4939b](https://github.com/flipstream-io/sdk/commit/0c4939b1bac3110936b94c1c286c04a114d3c3f6))
25
+
26
+
27
+ ### Bug Fixes
28
+
29
+ * **typescript:** a browser that blocks site data gets an unsupported session, not a throw ([#498](https://github.com/flipstream-io/sdk/issues/498)) ([4a3d81d](https://github.com/flipstream-io/sdk/commit/4a3d81de70ce80986539217429f4955e1eb9c83c))
30
+ * **typescript:** a burst of sync() calls sends one /logout while the first is still in flight ([#522](https://github.com/flipstream-io/sdk/issues/522)) ([53c02bd](https://github.com/flipstream-io/sdk/commit/53c02bd72b34cb761e592a03c9e25063a33984cb))
31
+ * **typescript:** a logout confirmed while storage refused to clear its flag is not sent again on every sync() ([#521](https://github.com/flipstream-io/sdk/issues/521)) ([1100538](https://github.com/flipstream-io/sdk/commit/1100538a08f79f22d70ba8b5200f0499f1cbe875))
32
+ * **typescript:** a logout owed by a session object outlives it, so the next session sends it before it restores ([#494](https://github.com/flipstream-io/sdk/issues/494)) ([dd9d469](https://github.com/flipstream-io/sdk/commit/dd9d469a27f9b1e13b26232ad8faa475bd9247b6))
33
+ * **typescript:** a logout try queued behind this tab's own send of an owed logout is told its kept answer, not sent again ([#547](https://github.com/flipstream-io/sdk/issues/547)) ([710cfdc](https://github.com/flipstream-io/sdk/commit/710cfdc82baf89b81652ca6f253bf6d40b996715))
34
+ * **typescript:** a refresh that returns another person starts a new generation, and the record names the person ([#551](https://github.com/flipstream-io/sdk/issues/551)) ([d6d9a06](https://github.com/flipstream-io/sdk/commit/d6d9a061bd0551f4371070ba5239f1bc2a8a0f6c))
35
+ * **typescript:** a session left open drops its unrecorded sign-out once a sign-in is recorded after it, instead of writing over it ([#542](https://github.com/flipstream-io/sdk/issues/542)) ([bd6a1aa](https://github.com/flipstream-io/sdk/commit/bd6a1aa508fa57b2d44a753dab5e107aa5a4fe91))
36
+ * **typescript:** a sign-in overtaken by a sign-out spends no link, sends no code and doesn't reopen the code screen ([#487](https://github.com/flipstream-io/sdk/issues/487)) ([4fdeb36](https://github.com/flipstream-io/sdk/commit/4fdeb365d00ddf30792a6ae5b58e68aca4924779))
37
+ * **typescript:** a sign-out is told superseded only when a sign-in moved the shared record on before its try ([#546](https://github.com/flipstream-io/sdk/issues/546)) ([70b198b](https://github.com/flipstream-io/sdk/commit/70b198b07e1d7af2ffe9a43397e57ebb7a770982))
38
+ * **typescript:** a sign-out pulse-auth refused or answered outside the contract stays owed without hitting /logout every 30 seconds ([#516](https://github.com/flipstream-io/sdk/issues/516)) ([9553612](https://github.com/flipstream-io/sdk/commit/9553612570e54f7c4fe1fa2a600be63c951fbd0a))
39
+ * **typescript:** a subscriber that throws does not stop a sign-out, and its error goes to the page, never to onReport ([#493](https://github.com/flipstream-io/sdk/issues/493)) ([94eb2d9](https://github.com/flipstream-io/sdk/commit/94eb2d9e407784c4e9aa8c83983fa9636b23728a))
40
+ * **typescript:** a tab that knows the person's rights changed sends nothing with the earlier token ([#488](https://github.com/flipstream-io/sdk/issues/488)) ([710bf20](https://github.com/flipstream-io/sdk/commit/710bf206953639e4ee5819100821d3d4cdb53241))
41
+ * **typescript:** every request with a bearer asks the browser not to use its HTTP cache ([#518](https://github.com/flipstream-io/sdk/issues/518)) ([4e6e3ad](https://github.com/flipstream-io/sdk/commit/4e6e3ada915494f712e51c6cb8b38086399f9c48))
42
+ * **typescript:** no request of the first-party entry follows a redirect: it is read as an answer outside the contract and reported once ([#497](https://github.com/flipstream-io/sdk/issues/497)) ([57d9474](https://github.com/flipstream-io/sdk/commit/57d9474e9a14daa7041bae65a7422871760e651d))
43
+
44
+
45
+ ### Code Refactoring
46
+
47
+ * **typescript:** the console's browser session, its cookie calls and its tab rules move into the SDK, unchanged and unexported ([#464](https://github.com/flipstream-io/sdk/issues/464)) ([039628d](https://github.com/flipstream-io/sdk/commit/039628d477a642adc199445512039b8a3f188a52))
48
+
49
+
50
+ ### Miscellaneous
51
+
52
+ * **deps:** take the fixes for source-map-js, vite and markdown-it, and drop their audit ignores ([#426](https://github.com/flipstream-io/sdk/issues/426)) ([9225c43](https://github.com/flipstream-io/sdk/commit/9225c4315cb0521c26367e0ce098a8dd955ece1e))
53
+ * the repository checks out with LF line endings on every OS, so the lint tests pass on Windows ([#455](https://github.com/flipstream-io/sdk/issues/455)) ([71abc10](https://github.com/flipstream-io/sdk/commit/71abc10507f275b2a8adb9f68c91906faf2e12fb))
54
+
55
+
56
+ ### Documentation
57
+
58
+ * **typescript:** the first-party guide says /login is sent and an unavailable tab asks again on a timer ([#532](https://github.com/flipstream-io/sdk/issues/532)) ([a2251be](https://github.com/flipstream-io/sdk/commit/a2251bebbcd92b197e3dbbaabf891cb2c5c9ada2))
59
+
60
+
61
+ ### Tests
62
+
63
+ * endsAt waits for a call's outcome at its instant, not settle()'s 20 turns, so a loaded ci-01 can't fail a correct sign-in ([#434](https://github.com/flipstream-io/sdk/issues/434)) ([3b6d06e](https://github.com/flipstream-io/sdk/commit/3b6d06eb61f5c000a637843b27419d704bfc5327))
64
+ * **typescript:** a first-party test row that fails before it closes its session goes red, and its file ends ([#545](https://github.com/flipstream-io/sdk/issues/545)) ([8925561](https://github.com/flipstream-io/sdk/commit/8925561f857dfd735c0dc6db363a8459031ce66d))
65
+ * **typescript:** a live check Michel runs to record the macOS keychain's real "locked" error words ([#157](https://github.com/flipstream-io/sdk/issues/157) item 8) ([#440](https://github.com/flipstream-io/sdk/issues/440)) ([bfce8bb](https://github.com/flipstream-io/sdk/commit/bfce8bb8dd20daad1e6e3707030851721f08551b))
66
+ * **typescript:** a test child takes its script on stdin, so Windows starts it whatever its length ([#457](https://github.com/flipstream-io/sdk/issues/457)) ([92bbf1f](https://github.com/flipstream-io/sdk/commit/92bbf1f29d6956cb155dffafe81935cf9d5c9660))
67
+ * **typescript:** six more contract cases read the call's timers and turns, not the real clock ([#461](https://github.com/flipstream-io/sdk/issues/461)) ([54cbddc](https://github.com/flipstream-io/sdk/commit/54cbddcc0463c81a132230364290349804cdf551))
68
+ * **typescript:** the fake keyring's teardown ends the helpers it started before removing its folder, so a late write can't fail a passing test file ([#443](https://github.com/flipstream-io/sdk/issues/443)) ([4cdc6d1](https://github.com/flipstream-io/sdk/commit/4cdc6d19ce2bca89d7f69820693c7776111d4341))
69
+ * **typescript:** the four fileStore rows fail a save, link a folder and read a kill the Windows way ([#458](https://github.com/flipstream-io/sdk/issues/458)) ([d35eb10](https://github.com/flipstream-io/sdk/commit/d35eb10550293ea8b34459f3988b104d71f597b9))
70
+ * **typescript:** the Retry-After HTTP-date case reads the call's wait off its timeline, not the real clock ([#459](https://github.com/flipstream-io/sdk/issues/459)) ([8f39d5c](https://github.com/flipstream-io/sdk/commit/8f39d5cae0976b8d79533833e7ef29a7ae7caa0a))
71
+ * **typescript:** the tests that compare file names write them with /, so they pass on Windows ([#456](https://github.com/flipstream-io/sdk/issues/456)) ([8c0e536](https://github.com/flipstream-io/sdk/commit/8c0e5369de185430974fee1133745265d237040e))
72
+ * **typescript:** two ported session tests get a control, so each can fail ([#489](https://github.com/flipstream-io/sdk/issues/489)) ([43f73fe](https://github.com/flipstream-io/sdk/commit/43f73fef62b24d8720bbf06883a15359c5ef3c4e))
73
+
74
+
75
+ ### CI
76
+
77
+ * the unit jobs run at most 8 test files at once on ci-01, so they stop taking all of its cores ([#433](https://github.com/flipstream-io/sdk/issues/433)) ([e9d0856](https://github.com/flipstream-io/sdk/commit/e9d08566a3e84e92f13746b5ca6ca8e152261897))
78
+
3
79
  ## [0.14.0](https://github.com/flipstream-io/sdk/compare/typescript-v0.13.0...typescript-v0.14.0) (2026-11-25)
4
80
 
5
81
 
package/README.md CHANGED
@@ -367,6 +367,86 @@ The main entry, `@flipstream/sdk`, runs in browsers with no Node polyfills. Only
367
367
  - **Browser code shouldn't keep a refresh token.** We recommend signing in on your web app's
368
368
  server instead (see "On your web app's server").
369
369
 
370
+ ### Flipstream's own apps: `@flipstream/sdk/first-party`
371
+
372
+ Flipstream's own apps, served on a Flipstream origin, keep the person signed in in the page with
373
+ `createBrowserSession`, and no token in the page's hands: pulse-auth's refresh cookie is httpOnly
374
+ and reaches only the app's own `/auth` proxy, and the access token stays in the tab's memory. The
375
+ tabs of one browser share one session. The person signs in with a login link or with a password,
376
+ and with a two-step code when their account asks for one.
377
+
378
+ ```ts
379
+ // boot.ts: the link-token import and the line that takes the token out of the address, nothing
380
+ // else. It keeps the history entry's state.
381
+ import { strip } from '@flipstream/sdk/first-party/link-token'
382
+
383
+ const cleaned = strip(location.href)
384
+ if (cleaned !== null) history.replaceState(history.state, '', cleaned)
385
+ ```
386
+
387
+ ```ts
388
+ // main.ts, the app's entry module. A module's imports are all evaluated before its first
389
+ // statement, so ./boot goes first: the token is gone before the SDK or anything else is evaluated.
390
+ import './boot'
391
+ import { createBrowserSession } from '@flipstream/sdk/first-party'
392
+
393
+ const session = createBrowserSession({ app: { name: 'account', version: '1.4.0' }, landing: '/login-link' })
394
+ session.subscribe(() => { document.body.dataset.session = session.current().kind }) // render from current()
395
+ session.start()
396
+
397
+ // On the landing page: the link is read as the page loads, and redeemed only on the person's press.
398
+ const link = session.openedLink()
399
+ document.querySelector('#sign-in')?.addEventListener('click', () => {
400
+ if (link.kind !== 'ready') return
401
+ void session.redeem(link).then((signedIn) => {
402
+ if (signedIn.ok && signedIn.data.kind === 'two_step') {
403
+ // ask for the code, then session.verifyTwoStep({ code })
404
+ }
405
+ })
406
+ })
407
+ ```
408
+
409
+ `verifyTwoStep` answers after the state has turned `signed_in`, so a code screen that leaves on
410
+ `signed_in` takes its answer first: the backup codes it carries exist nowhere else.
411
+
412
+ `redeem` runs only on a press: a prerender, a speculative load or a restored tab runs the page's
413
+ script with nobody there, and a link works once.
414
+
415
+ After either `logIn({ email, password })` or `redeem(link)`, a `two_step` result takes the person
416
+ to `verifyTwoStep({ code })`. For `two_step_setup`, pass its `setup` to `startSignInTwoStepSetup(setup)` first. Use its
417
+ `otpauth_uri` for the authenticator's QR code or display its `secret` for manual entry. Then call
418
+ `verifyTwoStep({ code })` and show the ten backup codes from the successful result. If setup verification answers
419
+ `superseded`, show `error.backup_codes` when present.
420
+
421
+ On the signed-in security page, read `twoStepStatus()`, start with `startTwoStepSetup()`,
422
+ and finish with `confirmTwoStepSetup({ code })`. A person with a current code can replace their
423
+ backup codes with `newBackupCodes({ code })` or turn off two-step with `turnOffTwoStep({ code })`.
424
+
425
+ `signOut()` signs out here and in every tab at once; its `told` settles with what pulse-auth said
426
+ to the first try. `superseded` means a sign-in, in any tab, reached pulse-auth before this
427
+ sign-out's own try: it sent this logout itself before it signed in, and its cookie replaced the old
428
+ one, so this call isn't told whether pulse-auth confirmed it. Nothing is pending: read `current()`.
429
+
430
+ On a consent page, `session.consentRequest()` reads the callback host and scopes to show. Pass
431
+ that request to `approveConsent` or `denyConsent` when the person makes their choice.
432
+
433
+ Read `session.flipstream` for each piece of work. For example, `await session.flipstream.me()`
434
+ reads the organisation and user as the person the tab shows when the call is made.
435
+ A change of person or rights cancels the call. A kept scope also answers `cancelled`.
436
+
437
+ The browser session needs a proxy on the app's own server that forwards six paths to pulse-auth and marks
438
+ each refusal of its own with `X-Auth-Proxy: refused`. The calls, the options and the proxy's contract:
439
+ [docs/first-party.md](docs/first-party.md).
440
+
441
+ Use `session.requestPasswordReset` to mail a reset link. Configure `resetLanding` with the page's path so `openedReset` and `setPassword` can use the link there.
442
+
443
+ `session.requestSignUp` sends the legal versions the person accepted directly to pulse-admin to
444
+ request a sign-up link. Pulse-admin must allow the app's origin.
445
+
446
+ For device sign-in, `session.lookUpDevice({ user_code })` reads the code a device shows, open,
447
+ and answers the request to show; `approveDevice(request)` or `denyDevice(request)` answers that
448
+ same request as the signed-in person, on a press.
449
+
370
450
  ## On your web app's server
371
451
 
372
452
  Your server signs the person in, keeps the tokens, and proves who it is with your app's client
@@ -628,6 +708,18 @@ await flipstream.catalog.list({ conversationId: 'c-456', traceparent: '00-4bf92f
628
708
  - **The token only goes to the configured hosts, over https.** No redirect is followed, and no
629
709
  cookies are sent. Plain http to a loopback host needs `allowLocalhostHttp: true`, for development
630
710
  only.
711
+ - **A request with the token asks for no HTTP cache** (`cache: 'no-store'`), so a browser never
712
+ answers it with a stored body, another person's or one from before a sign-out. `fetch` then
713
+ also sends `Cache-Control: no-cache` and `Pragma: no-cache`, in a browser and in Node; they are
714
+ added after the CORS preflight is decided, so no host has to allow them. `health`, which sends
715
+ no token, keeps the default.
716
+ - **Only where `fetch` keeps that mode.** The SDK checks once whether the runtime's `Request`
717
+ keeps `cache: 'no-store'` as asked. Where it doesn't (a polyfilled `fetch`, such as React
718
+ Native's, or a Cloudflare Worker on a compatibility date before `cache_option_enabled`), the
719
+ request goes without it, and nothing in the SDK keeps its answer out of that runtime's HTTP
720
+ cache. In a browser that means a native `fetch`.
721
+ - **The server's part:** the hosts' own `Cache-Control` on signed-in reads keeps them out of
722
+ every cache, wherever the SDK runs.
631
723
  - **Retries:**
632
724
  - A read (`catalog`, `health`, each of `me`'s) is tried again after a 408, 429, 502, 503 or
633
725
  504, or a connection that failed, at most twice. It waits as long as `Retry-After` asks, in seconds, or
@@ -661,7 +753,9 @@ await flipstream.catalog.list({ conversationId: 'c-456', traceparent: '00-4bf92f
661
753
  reads is still waited on: the call ends its other reads at once, through their `signal`, and the
662
754
  rejection is the first read's to reject, in the order the call started them. A failure that comes
663
755
  back as a result keeps each call's own order. Your transport may still be running after the call
664
- ended its read, or after a read's deadline; the SDK no longer waits for it.
756
+ ended its read, or after a read's deadline; the SDK no longer waits for it. In a browser, a
757
+ transport that adds a bearer should ask `cache: 'no-store'` itself: the SDK can't set it on a
758
+ request it doesn't send.
665
759
 
666
760
  ## Which app sent a request
667
761
 
@@ -31,6 +31,10 @@ export declare function endpointProblem(issuer: string, endpoints: readonly stri
31
31
  /**
32
32
  * Sign-in's transport: https only, or with `allowLocalhostHttp` http to this machine, and no
33
33
  * token, since these calls are how a token is had. It sends as the default transport does
34
- * (`sendRequest`): no cookies, and no redirect followed.
34
+ * (`sendRequest`): no cookies, and no redirect followed. `noStore`, for a caller that puts a bearer
35
+ * in its requests (a session's userinfo check): no HTTP cache, as the default transport asks for
36
+ * its own (SDK-D2013).
35
37
  */
36
- export declare function authTransport(options: AuthCallOptions): Transport;
38
+ export declare function authTransport(options: AuthCallOptions, { noStore }?: {
39
+ readonly noStore?: boolean;
40
+ }): Transport;
@@ -30,16 +30,18 @@ export function endpointProblem(issuer, endpoints) {
30
30
  /**
31
31
  * Sign-in's transport: https only, or with `allowLocalhostHttp` http to this machine, and no
32
32
  * token, since these calls are how a token is had. It sends as the default transport does
33
- * (`sendRequest`): no cookies, and no redirect followed.
33
+ * (`sendRequest`): no cookies, and no redirect followed. `noStore`, for a caller that puts a bearer
34
+ * in its requests (a session's userinfo check): no HTTP cache, as the default transport asks for
35
+ * its own (SDK-D2013).
34
36
  */
35
- export function authTransport(options) {
37
+ export function authTransport(options, { noStore = false } = {}) {
36
38
  const send = options.fetch ?? globalThis.fetch;
37
39
  return async (call) => {
38
40
  const built = call.makeRequest();
39
41
  const url = new URL(built.url);
40
42
  if (url.protocol !== 'https:' && !(options.allowLocalhostHttp === true && isLoopbackHttp(url)))
41
43
  return { kind: 'refused', reason: 'destination' };
42
- const sent = await sendRequest(send, built, new Headers(built.headers), call.signal);
44
+ const sent = await sendRequest(send, built, new Headers(built.headers), call.signal, { noStore });
43
45
  return sent.kind === 'sent' ? { kind: 'response', response: sent.response } : sent;
44
46
  };
45
47
  }
@@ -1 +1 @@
1
- {"version":3,"file":"transport.js","sourceRoot":"","sources":["../../src/auth/transport.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAA;AA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AAC,kBAAkB,KAAK,IAAI,IAAI,cAAc,CAAC,GAAG,CAAC,CAAC;YAAE,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,EAAE,aAAa,EAAE,CAAA;QACjJ,MAAM,IAAI,GAAG,MAAM,WAAW,CAAC,IAAI,EAAE,KAAK,EAAE,IAAI,OAAO,CAAC,KAAK,CAAC,OAAO,CAAC,EAAE,IAAI,CAAC,MAAM,EAAE,EAAE,OAAO,EAAE,CAAC,CAAA;QACjG,OAAO,IAAI,CAAC,IAAI,KAAK,MAAM,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,UAAU,EAAE,QAAQ,EAAE,IAAI,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC,IAAI,CAAA;IACpF,CAAC,CAAA;AACH,CAAC"}
@@ -3,6 +3,10 @@ import type { HeardResult } from './invalid.js';
3
3
  import type { SharedRule } from './shared.js';
4
4
  import { type RetryRule } from './retry.js';
5
5
  import type { ApiRequest, Transport } from './transport.js';
6
+ /** A local admission decision. No network request failed, so a later retry cannot serve this call. */
7
+ export declare const FINAL_UNAVAILABLE: Readonly<{
8
+ readonly kind: "unavailable";
9
+ }>;
6
10
  /** One endpoint's call: what it sends, and the rules it is sent under, declared next to its schema. */
7
11
  export interface CallSpec<T> extends Omit<ApiRequest, 'signal'> {
8
12
  readonly schema: z.ZodType<T>;
package/dist/core/call.js CHANGED
@@ -3,6 +3,12 @@ import { deadlineIn, MAX_TIMER_MS } from './deadline.js';
3
3
  import { classifyStatus } from './result.js';
4
4
  import { decide, parseRetryAfterMs } from './retry.js';
5
5
  import { stopListening } from './signal.js';
6
+ /*
7
+ * The call layer: one deadline and one retry rule per endpoint, above any `Transport`, the
8
+ * console's included, so a call follows the same rule whoever sends it (#4).
9
+ */
10
+ /** A local admission decision. No network request failed, so a later retry cannot serve this call. */
11
+ export const FINAL_UNAVAILABLE = Object.freeze({ kind: 'unavailable' });
6
12
  /**
7
13
  * One call: attempts under its rule, every attempt, wait and read under one signal that joins the
8
14
  * caller's with the deadline. Whichever fires first decides the answer, `timeout` or `aborted`
@@ -107,7 +113,7 @@ function outcomeOf(sent) {
107
113
  if (sent.kind === 'response') {
108
114
  return { kind: 'answered', status: sent.response.status, retryAfter: sent.response.headers.get('retry-after') };
109
115
  }
110
- return sent.kind === 'unavailable' ? { kind: 'unavailable' } : { kind: 'final' };
116
+ return sent.kind === 'unavailable' && sent !== FINAL_UNAVAILABLE ? { kind: 'unavailable' } : { kind: 'final' };
111
117
  }
112
118
  /** A failure the host answered keeps the wait it asked for, so the caller can decide (D414). */
113
119
  function withRetryAfter(result, sent) {
@@ -1 +1 @@
1
- {"version":3,"file":"call.js","sourceRoot":"","sources":["../../src/core/call.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAA;AAEpC,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,eAAe,CAAA;AACxD,OAAO,EAAE,cAAc,EAAgC,MAAM,aAAa,CAAA;AAC1E,OAAO,EAAE,MAAM,EAAE,iBAAiB,EAAgC,MAAM,YAAY,CAAA;AACpF,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAA;AA4B3C;;;;;;;;;;GAUG;AACH,MAAM,CAAC,KAAK,UAAU,IAAI,CAAI,SAAoB,EAAE,IAAiB,EAAE,MAAoB,EAAE,OAAqB;IAChH,IAAI,MAAM,EAAE,OAAO,KAAK,IAAI,IAAI,OAAO,EAAE,OAAO,KAAK,IAAI;QAAE,OAAO,MAAM,CAAC,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC,CAAA;IAC7F,mGAAmG;IACnG,gGAAgG;IAChG,kGAAkG;IAClG,iGAAiG;IACjG,kGAAkG;IAClG,gGAAgG;IAChG,2FAA2F;IAC3F,gBAAgB;IAChB,IAAI,CAAC,CAAC,IAAI,CAAC,UAAU,IAAI,CAAC,CAAC,IAAI,IAAI,CAAC,UAAU,GAAG,YAAY;QAAE,OAAO,MAAM,CAAC,E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,wFAAwF;QACxF,uFAAuF;QACvF,IAAI,MAAM,CAAC,OAAO;YAAE,OAAO,OAAO,EAAE,CAAA;QACpC,MAAM,IAAI,GAAG,GAAS,EAAE;YACtB,YAAY,CAAC,KAAK,CAAC,CAAA;YACnB,MAAM,CAAC,mBAAmB,CAAC,OAAO,EAAE,IAAI,CAAC,CAAA;YACzC,OAAO,EAAE,CAAA;QACX,CAAC,CAAA;QACD,MAAM,KAAK,GAAG,UAAU,CAAC,IAAI,EAAE,EAAE,CAAC,CAAA;QAClC,MAAM,CAAC,gBAAgB,CAAC,OAAO,EAAE,IAAI,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,CAAA;IACxD,CAAC,CAAC,CAAA;AACJ,CAAC;AAED,MAAM,MAAM,GAAG,CAAC,KAAe,EAAU,EAAE,CAAC,CAAC,EAAE,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC,CAAA"}
@@ -38,13 +38,32 @@ export type TokenlessTransportOptions = Omit<FetchTransportOptions, 'token'>;
38
38
  * signed out. It never resends after a 401: there is no token to renew.
39
39
  */
40
40
  export declare function tokenlessTransport(options: TokenlessTransportOptions): Transport;
41
+ /**
42
+ * Whether this runtime's global Request keeps `cache: 'no-store'` as asked (SDK-D2013): checked
43
+ * once per Request, the first time it is needed. It checks `Request`, not `fetch`. Not where the
44
+ * field throws (a Cloudflare Worker on a compatibility date before `cache_option_enabled`), nor
45
+ * where the mode is turned into something else, such as the whatwg-fetch polyfill's `_=<n>` on a
46
+ * GET's URL (React Native, or a page with no native fetch, where the polyfill fills it in), which
47
+ * would send a URL the destination check never read. Never throws: no global Request is no.
48
+ */
49
+ export declare function keepsNoStore(): boolean;
41
50
  /**
42
51
  * One request out, as every transport of the SDK's own sends it (sign-in's too, #63), with
43
52
  * `headers` in place of `built`'s. Nothing is sent once `signal` has fired. No cookies, and no
44
53
  * redirect followed: a redirect would take what the request carries (a token, a code) to a URL
45
54
  * nobody checked. A 3xx comes back as it is, outside the contract (`readJson`).
55
+ *
56
+ * `noStore`, from the code that attaches a bearer (SDK-D2013): the request asks for no HTTP cache
57
+ * (`cache: 'no-store'`), so a browser never answers it with a body stored for another person or
58
+ * from before a sign-out, and doesn't store this one. Only where `keepsNoStore()` says the runtime
59
+ * keeps that mode as asked; elsewhere it goes as it would without, and nothing here keeps its
60
+ * answer out of that runtime's cache. With the mode, fetch also sends `Cache-Control: no-cache`
61
+ * and `Pragma: no-cache`, in a browser and in Node; they are added after the CORS preflight is
62
+ * decided, so no host has to allow them.
46
63
  */
47
- export declare function sendRequest(send: typeof fetch, built: Request, headers: Headers, signal: AbortSignal): Promise<{
64
+ export declare function sendRequest(send: typeof fetch, built: Request, headers: Headers, signal: AbortSignal, { noStore }?: {
65
+ readonly noStore?: boolean;
66
+ }): Promise<{
48
67
  readonly kind: 'sent';
49
68
  readonly response: Response;
50
69
  } | typeof ABORTED | {
@@ -40,7 +40,8 @@ export function fetchTransport(options) {
40
40
  // A token no header can carry (a line break, a NUL, a character past U+00FF) is no token.
41
41
  return { kind: 'no_token', cause };
42
42
  }
43
- const sent = await sendRequest(send, built, headers, call.signal);
43
+ // It carries the bearer: no HTTP cache (SDK-D2013).
44
+ const sent = await sendRequest(send, built, headers, call.signal, { noStore: true });
44
45
  return sent.kind === 'sent' ? { ...sent, token: token.token } : sent;
45
46
  }
46
47
  return async (call) => {
@@ -90,16 +91,62 @@ function destinations({ hosts, allowLocalhostHttp }) {
90
91
  return secure && origins.get(service) === url.origin;
91
92
  };
92
93
  }
94
+ const PROBE_URL = 'https://sdk.invalid/';
95
+ // What the check found, per Request constructor: a page or a test that swaps the global Request
96
+ // is checked again; a process that keeps one checks once.
97
+ const keptBy = new WeakMap();
98
+ /**
99
+ * Whether this runtime's global Request keeps `cache: 'no-store'` as asked (SDK-D2013): checked
100
+ * once per Request, the first time it is needed. It checks `Request`, not `fetch`. Not where the
101
+ * field throws (a Cloudflare Worker on a compatibility date before `cache_option_enabled`), nor
102
+ * where the mode is turned into something else, such as the whatwg-fetch polyfill's `_=<n>` on a
103
+ * GET's URL (React Native, or a page with no native fetch, where the polyfill fills it in), which
104
+ * would send a URL the destination check never read. Never throws: no global Request is no.
105
+ */
106
+ export function keepsNoStore() {
107
+ // A runtime or a page may have none, whatever the types say.
108
+ const Built = globalThis.Request;
109
+ if (typeof Built !== 'function')
110
+ return false;
111
+ const known = keptBy.get(Built);
112
+ if (known !== undefined)
113
+ return known;
114
+ const kept = probe(Built);
115
+ keptBy.set(Built, kept);
116
+ return kept;
117
+ }
118
+ /**
119
+ * Two requests built from a Request, as `sendRequest` builds what it sends: a GET, whose URL a
120
+ * polyfill may rewrite, and a POST with a body. Both must keep the mode and their URL.
121
+ */
122
+ function probe(Built) {
123
+ try {
124
+ const get = new Built(new Built(PROBE_URL), { cache: 'no-store' });
125
+ const post = new Built(new Built(PROBE_URL, { method: 'POST', body: '{}' }), { cache: 'no-store' });
126
+ return [get, post].every((request) => request.cache === 'no-store' && request.url === PROBE_URL);
127
+ }
128
+ catch {
129
+ return false;
130
+ }
131
+ }
93
132
  /**
94
133
  * One request out, as every transport of the SDK's own sends it (sign-in's too, #63), with
95
134
  * `headers` in place of `built`'s. Nothing is sent once `signal` has fired. No cookies, and no
96
135
  * redirect followed: a redirect would take what the request carries (a token, a code) to a URL
97
136
  * nobody checked. A 3xx comes back as it is, outside the contract (`readJson`).
137
+ *
138
+ * `noStore`, from the code that attaches a bearer (SDK-D2013): the request asks for no HTTP cache
139
+ * (`cache: 'no-store'`), so a browser never answers it with a body stored for another person or
140
+ * from before a sign-out, and doesn't store this one. Only where `keepsNoStore()` says the runtime
141
+ * keeps that mode as asked; elsewhere it goes as it would without, and nothing here keeps its
142
+ * answer out of that runtime's cache. With the mode, fetch also sends `Cache-Control: no-cache`
143
+ * and `Pragma: no-cache`, in a browser and in Node; they are added after the CORS preflight is
144
+ * decided, so no host has to allow them.
98
145
  */
99
- export async function sendRequest(send, built, headers, signal) {
146
+ export async function sendRequest(send, built, headers, signal, { noStore = false } = {}) {
100
147
  if (signal.aborted)
101
148
  return ABORTED;
102
- const request = new Request(built, { headers, signal, credentials: 'omit', redirect: 'manual' });
149
+ const request = new Request(built, { headers, signal, credentials: 'omit', redirect: 'manual', ...(noStore && keepsNoStore() ? { cache: 'no-store' } : {}) });
103
150
  // A Request follows its signal only weakly. Held from the call's signal while it is sent, so
104
151
  // a fetch that keeps it only through its own abort listener is still told when the call ends
105
152
  // (#57: without this, under forced garbage collection, it was told 0 times in 20).
@@ -1 +1 @@
1
- {"version":3,"file":"fetch.js","sourceRoot":"","sources":["../../src/core/fetch.ts"],"names":[],"mappings":"AAgCA,MAAM,QAAQ,GAAG,CAAC,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,QAAQ,CAA2C,CAAA;AACtG,sGAAsG;AACtG,MAAM,YAAY,GAAqF,IAAI,CAAA;AAC3G,KAAK,YAAY,CAAA,CAAC,6CAA6C;AAC/D,MAAM,QAAQ,GAAwB,IAAI,GAAG,CAAC,CAAC,WAAW,EAAE,WAAW,EAAE,OAAO,CAAC,CAAC,CAAA;AAElF;;;GAGG;AACH,MAAM,UAAU,cAAc,CAAC,GAAQ;IACrC,OAAO,GAAG,CAAC,QAAQ,KAAK,OAAO,IAAI,QAAQ,CAAC,GAAG,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAA;AAC/D,CAAC;AACD,MAAM,OAAO,GAAG,EAAE,IAAI,EAAE,SAAS,EAAW,CAAA;AAC5C,MAAM,OAAO,GAAG,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,EAAE,aAAa,EAAW,CAAA;AACnE,MAAM,WAAW,GAAG,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,EAAE,gBAAgB,EAAW,CAAA;AAO1E,MAAM,UAAU,cAAc,CAAC,OAA8B;IAC3D,MAAM,IAAI,GAAG,OAAO,CAAC,KAAK,IAAI,UAAU,CAAC,KAAK,CAAA;IAC9C,MAAM,OAAO,GAAG,YAAY,CAAC,OAAO,CA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I,EAAE,CAAC,CAAA;IACxD,CAAC,CAAC,CAAA;IACF,qFAAqF;IACrF,MAAM,KAAK,GAAG,OAAO,CAAC,OAAO,EAAE;SAC5B,IAAI,CAAC,GAAG,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;SACtB,IAAI,CACH,CAAC,KAAK,EAAS,EAAE,CACf,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,EAAE;QACvC,CAAC,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE;QACjC,CAAC,CAAC,EAAE,IAAI,EAAE,UAAU,EAAE,KAAK,EAAE,IAAI,SAAS,CAAC,kCAAkC,CAAC,EAAE,EACpF,CAAC,KAAc,EAAS,EAAE,CAAC,CAAC,EAAE,IAAI,EAAE,UAAU,EAAE,KAAK,EAAE,CAAC,CACzD,CAAA;IACH,IAAI,CAAC;QACH,OAAO,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC,CAAA;IAC7C,CAAC;YAAS,CAAC;QACT,MAAM,CAAC,mBAAmB,CAAC,OAAO,EAAE,IAAI,CAAC,CAAA;IAC3C,CAAC;AACH,CAAC"}
@@ -0,0 +1,11 @@
1
+ /**
2
+ * Flipstream's deployed hosts: a client's defaults, and what `createFlipstreamFor`'s `deployed`
3
+ * stands in for. Its own module (#465), so the first-party entry takes the defaults without the
4
+ * main entry's client.
5
+ */
6
+ export declare const DEFAULT_HOSTS: {
7
+ readonly query: "https://query.flipstream.io";
8
+ readonly auth: "https://auth.flipstream.io";
9
+ readonly admin: "https://pulse.admin.api.flipstream.io";
10
+ readonly wallet: "https://pulse.wallet.api.flipstream.io";
11
+ };
@@ -0,0 +1,13 @@
1
+ /**
2
+ * Flipstream's deployed hosts: a client's defaults, and what `createFlipstreamFor`'s `deployed`
3
+ * stands in for. Its own module (#465), so the first-party entry takes the defaults without the
4
+ * main entry's client.
5
+ */
6
+ export const DEFAULT_HOSTS = {
7
+ query: 'https://query.flipstream.io',
8
+ auth: 'https://auth.flipstream.io',
9
+ // Today's admin and wallet APIs, behind #67's seam (D541, D544).
10
+ admin: 'https://pulse.admin.api.flipstream.io',
11
+ wallet: 'https://pulse.wallet.api.flipstream.io',
12
+ };
13
+ //# sourceMappingURL=hosts.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"hosts.js","sourceRoot":"","sources":["../../src/core/hosts.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG;IAC3B,KAAK,EAAE,6BAA6B;IACpC,IAAI,EAAE,4BAA4B;IAClC,iEAAiE;IACjE,KAAK,EAAE,uCAAuC;IAC9C,MAAM,EAAE,wCAAwC;CACxC,CAAA"}
@@ -11,12 +11,16 @@ export interface Identity {
11
11
  readonly conversationId: string | undefined;
12
12
  }
13
13
  export declare function isConversationId(value: unknown): value is string;
14
- /** The client's identity from createFlipstream's options, or a TypeError naming what breaks its rule. */
14
+ /**
15
+ * The client's identity from its options, or a TypeError naming what breaks its rule. `caller`: the
16
+ * function the options were given to, which the error names (#465: `createBrowserSession` checks
17
+ * its `app` by the same rules).
18
+ */
15
19
  export declare function identityOf(options: {
16
20
  readonly app?: unknown;
17
21
  readonly agent?: unknown;
18
22
  readonly conversationId?: unknown;
19
- }): Identity;
23
+ }, caller?: string): Identity;
20
24
  /** One call's trace: the caller's trace-id and flags when it passed a valid traceparent, or new ones. */
21
25
  export interface Trace {
22
26
  readonly traceId: string;
@@ -11,33 +11,37 @@ const isRecord = (value) => typeof value === 'object' && value !== null;
11
11
  * A field that isn't one, as a TypeError naming the option and its rule, never its value: a value
12
12
  * may be a secret put in the wrong place, and an error message ends up in logs.
13
13
  */
14
- function invalid(option, rule) {
15
- return new TypeError(`createFlipstream: ${option} must be ${rule}; nothing is sent until it is`);
14
+ function invalid(option, rule, caller = 'createFlipstream') {
15
+ return new TypeError(`${caller}: ${option} must be ${rule}; nothing is sent until it is`);
16
16
  }
17
17
  const PRODUCT_RULE = "1 to 64 of RFC 9110's token characters (letters, digits and !#$%&'*+-.^_`|~)";
18
18
  const CONVERSATION_RULE = '1 to 128 of the characters A-Z, a-z, 0-9, ., _, : and -';
19
- function product(value, option) {
19
+ function product(value, option, caller) {
20
20
  if (!isRecord(value))
21
- throw invalid(option, `{ name, version }, each ${PRODUCT_RULE}`);
21
+ throw invalid(option, `{ name, version }, each ${PRODUCT_RULE}`, caller);
22
22
  const { name, version: productVersion } = value;
23
23
  if (typeof name !== 'string' || !PRODUCT_TOKEN.test(name))
24
- throw invalid(`${option}.name`, PRODUCT_RULE);
24
+ throw invalid(`${option}.name`, PRODUCT_RULE, caller);
25
25
  if (typeof productVersion !== 'string' || !PRODUCT_TOKEN.test(productVersion))
26
- throw invalid(`${option}.version`, PRODUCT_RULE);
26
+ throw invalid(`${option}.version`, PRODUCT_RULE, caller);
27
27
  return { name, version: productVersion };
28
28
  }
29
29
  export function isConversationId(value) {
30
30
  return typeof value === 'string' && CONVERSATION_ID.test(value);
31
31
  }
32
- /** The client's identity from createFlipstream's options, or a TypeError naming what breaks its rule. */
33
- export function identityOf(options) {
32
+ /**
33
+ * The client's identity from its options, or a TypeError naming what breaks its rule. `caller`: the
34
+ * function the options were given to, which the error names (#465: `createBrowserSession` checks
35
+ * its `app` by the same rules).
36
+ */
37
+ export function identityOf(options, caller = 'createFlipstream') {
34
38
  if (options.app === undefined)
35
- throw invalid('app', `given: { name, version }, so each request says which app sent it`);
36
- const app = product(options.app, 'app');
37
- const agent = options.agent === undefined ? undefined : product(options.agent, 'agent');
39
+ throw invalid('app', `given: { name, version }, so each request says which app sent it`, caller);
40
+ const app = product(options.app, 'app', caller);
41
+ const agent = options.agent === undefined ? undefined : product(options.agent, 'agent', caller);
38
42
  const { conversationId } = options;
39
43
  if (conversationId !== undefined && !isConversationId(conversationId))
40
- throw invalid('conversationId', CONVERSATION_RULE);
44
+ throw invalid('conversationId', CONVERSATION_RULE, caller);
41
45
  return { app, agent, convers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,CAAC,SAAS,CAAA;QAC9D,IAAI,OAAO,IAAI,KAAK,QAAQ,IAAI,aAAa,CAAC,IAAI,CAAC,IAAI,CAAC;YAAE,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,CAAA;IAClG,CAAC;IACD,OAAO,OAAO,QAAQ,KAAK,WAAW,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAA;AAClF,CAAC;AAED;;;;;;;;;;GAUG;AACH,MAAM,CAAC,MAAM,UAAU,GAAyF;IAC9G,KAAK,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE;IACpC,KAAK,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE;IACrC,MAAM,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE;IACtC,GAAG,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE;IACnC,IAAI,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE;CACtC,CAAA;AAED;;;;GAIG;AACH,MAAM,UAAU,UAAU,CAAC,OAAoB,EAAE,OAAoB,EAAE,gBAAyB;IAC9F,OAAO,OAAO,CAAC,IAAI,KAAK,MAAM,CAAC,CAAC,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC,OAAO,IAAI,gBAAgB,CAAA;AAC7G,CAAC"}
@@ -76,7 +76,7 @@ export type ApiError = Answered
76
76
  readonly status?: number;
77
77
  readonly text?: string;
78
78
  }
79
- /** The app's session moved while the call ran: nobody may see the answer. */
79
+ /** The app's session moved while the call ran: nobody may see the answer. A write's outcome is then unknown: it may have run. */
80
80
  | {
81
81
  readonly kind: 'cancelled';
82
82
  }