@s2-dev/streamstore 0.11.1 → 0.12.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 (569) hide show
  1. package/README.md +50 -1
  2. package/bin/mcp-server.js +1705 -192
  3. package/bin/mcp-server.js.map +73 -40
  4. package/dist/commonjs/funcs/accessTokensIssueAccessToken.js +2 -2
  5. package/dist/commonjs/funcs/accessTokensIssueAccessToken.js.map +1 -1
  6. package/dist/commonjs/funcs/accessTokensListAccessTokens.js +2 -2
  7. package/dist/commonjs/funcs/accessTokensRevokeAccessToken.js +2 -2
  8. package/dist/commonjs/funcs/basinsCreateBasin.d.ts +14 -0
  9. package/dist/commonjs/funcs/basinsCreateBasin.d.ts.map +1 -0
  10. package/dist/commonjs/funcs/basinsCreateBasin.js +124 -0
  11. package/dist/commonjs/funcs/basinsCreateBasin.js.map +1 -0
  12. package/dist/commonjs/funcs/basinsCreateOrReconfigureBasin.js +3 -3
  13. package/dist/commonjs/funcs/basinsCreateOrReconfigureBasin.js.map +1 -1
  14. package/dist/commonjs/funcs/basinsDeleteBasin.d.ts +1 -1
  15. package/dist/commonjs/funcs/basinsDeleteBasin.d.ts.map +1 -1
  16. package/dist/commonjs/funcs/basinsDeleteBasin.js +13 -2
  17. package/dist/commonjs/funcs/basinsDeleteBasin.js.map +1 -1
  18. package/dist/commonjs/funcs/basinsGetBasinConfig.js +2 -2
  19. package/dist/commonjs/funcs/basinsGetBasinConfig.js.map +1 -1
  20. package/dist/commonjs/funcs/basinsListBasins.js +2 -2
  21. package/dist/commonjs/funcs/basinsReconfigureBasin.js +2 -2
  22. package/dist/commonjs/funcs/basinsReconfigureBasin.js.map +1 -1
  23. package/dist/commonjs/funcs/recordsAppend.d.ts +18 -0
  24. package/dist/commonjs/funcs/recordsAppend.d.ts.map +1 -0
  25. package/dist/commonjs/funcs/recordsAppend.js +144 -0
  26. package/dist/commonjs/funcs/recordsAppend.js.map +1 -0
  27. package/dist/commonjs/funcs/recordsCheckTail.d.ts +18 -0
  28. package/dist/commonjs/funcs/recordsCheckTail.d.ts.map +1 -0
  29. package/dist/commonjs/funcs/recordsCheckTail.js +138 -0
  30. package/dist/commonjs/funcs/recordsCheckTail.js.map +1 -0
  31. package/dist/commonjs/funcs/recordsRead.d.ts +23 -0
  32. package/dist/commonjs/funcs/recordsRead.d.ts.map +1 -0
  33. package/dist/commonjs/funcs/recordsRead.js +157 -0
  34. package/dist/commonjs/funcs/recordsRead.js.map +1 -0
  35. package/dist/commonjs/funcs/streamsCreateOrReconfigureStream.js +14 -3
  36. package/dist/commonjs/funcs/streamsCreateOrReconfigureStream.js.map +1 -1
  37. package/dist/commonjs/funcs/streamsCreateStream.d.ts +14 -0
  38. package/dist/commonjs/funcs/streamsCreateStream.d.ts.map +1 -0
  39. package/dist/commonjs/funcs/streamsCreateStream.js +129 -0
  40. package/dist/commonjs/funcs/streamsCreateStream.js.map +1 -0
  41. package/dist/commonjs/funcs/streamsDeleteStream.d.ts +1 -1
  42. package/dist/commonjs/funcs/streamsDeleteStream.d.ts.map +1 -1
  43. package/dist/commonjs/funcs/streamsDeleteStream.js +2 -2
  44. package/dist/commonjs/funcs/streamsDeleteStream.js.map +1 -1
  45. package/dist/commonjs/funcs/streamsGetStreamConfig.js +13 -2
  46. package/dist/commonjs/funcs/streamsGetStreamConfig.js.map +1 -1
  47. package/dist/commonjs/funcs/streamsListStreams.js +2 -2
  48. package/dist/commonjs/funcs/streamsListStreams.js.map +1 -1
  49. package/dist/commonjs/funcs/streamsReconfigureStream.js +13 -2
  50. package/dist/commonjs/funcs/streamsReconfigureStream.js.map +1 -1
  51. package/dist/commonjs/lib/config.d.ts +3 -3
  52. package/dist/commonjs/lib/config.js +3 -3
  53. package/dist/commonjs/lib/event-streams.d.ts +17 -0
  54. package/dist/commonjs/lib/event-streams.d.ts.map +1 -0
  55. package/dist/commonjs/lib/event-streams.js +220 -0
  56. package/dist/commonjs/lib/event-streams.js.map +1 -0
  57. package/dist/commonjs/lib/matchers.d.ts.map +1 -1
  58. package/dist/commonjs/lib/matchers.js +4 -1
  59. package/dist/commonjs/lib/matchers.js.map +1 -1
  60. package/dist/commonjs/lib/sdks.d.ts +3 -1
  61. package/dist/commonjs/lib/sdks.d.ts.map +1 -1
  62. package/dist/commonjs/lib/sdks.js +6 -11
  63. package/dist/commonjs/lib/sdks.js.map +1 -1
  64. package/dist/commonjs/mcp-server/mcp-server.js +1 -1
  65. package/dist/commonjs/mcp-server/server.d.ts.map +1 -1
  66. package/dist/commonjs/mcp-server/server.js +11 -1
  67. package/dist/commonjs/mcp-server/server.js.map +1 -1
  68. package/dist/commonjs/mcp-server/tools/basinsCreateBasin.d.ts +8 -0
  69. package/dist/commonjs/mcp-server/tools/basinsCreateBasin.d.ts.map +1 -0
  70. package/dist/commonjs/mcp-server/tools/basinsCreateBasin.js +63 -0
  71. package/dist/commonjs/mcp-server/tools/basinsCreateBasin.js.map +1 -0
  72. package/dist/commonjs/mcp-server/tools/recordsAppend.d.ts +8 -0
  73. package/dist/commonjs/mcp-server/tools/recordsAppend.d.ts.map +1 -0
  74. package/dist/commonjs/mcp-server/tools/recordsAppend.js +65 -0
  75. package/dist/commonjs/mcp-server/tools/recordsAppend.js.map +1 -0
  76. package/dist/commonjs/mcp-server/tools/recordsCheckTail.d.ts +8 -0
  77. package/dist/commonjs/mcp-server/tools/recordsCheckTail.d.ts.map +1 -0
  78. package/dist/commonjs/mcp-server/tools/recordsCheckTail.js +65 -0
  79. package/dist/commonjs/mcp-server/tools/recordsCheckTail.js.map +1 -0
  80. package/dist/commonjs/mcp-server/tools/recordsRead.d.ts +8 -0
  81. package/dist/commonjs/mcp-server/tools/recordsRead.d.ts.map +1 -0
  82. package/dist/commonjs/mcp-server/tools/recordsRead.js +65 -0
  83. package/dist/commonjs/mcp-server/tools/recordsRead.js.map +1 -0
  84. package/dist/commonjs/mcp-server/tools/streamsCreateStream.d.ts +8 -0
  85. package/dist/commonjs/mcp-server/tools/streamsCreateStream.d.ts.map +1 -0
  86. package/dist/commonjs/mcp-server/tools/streamsCreateStream.js +63 -0
  87. package/dist/commonjs/mcp-server/tools/streamsCreateStream.js.map +1 -0
  88. package/dist/commonjs/models/components/accesstokeninfo.d.ts +2 -2
  89. package/dist/commonjs/models/components/appendack.d.ts +46 -0
  90. package/dist/commonjs/models/components/appendack.d.ts.map +1 -0
  91. package/dist/commonjs/models/components/appendack.js +74 -0
  92. package/dist/commonjs/models/components/appendack.js.map +1 -0
  93. package/dist/commonjs/models/components/appendinput.d.ts +46 -0
  94. package/dist/commonjs/models/components/appendinput.d.ts.map +1 -0
  95. package/dist/commonjs/models/components/appendinput.js +85 -0
  96. package/dist/commonjs/models/components/appendinput.js.map +1 -0
  97. package/dist/commonjs/models/components/appendrecord.d.ts +43 -0
  98. package/dist/commonjs/models/components/appendrecord.d.ts.map +1 -0
  99. package/dist/commonjs/models/components/appendrecord.js +74 -0
  100. package/dist/commonjs/models/components/appendrecord.js.map +1 -0
  101. package/dist/commonjs/models/components/basinconfig.d.ts +4 -4
  102. package/dist/commonjs/models/components/basinconfig.d.ts.map +1 -1
  103. package/dist/commonjs/models/components/basinconfig.js +4 -4
  104. package/dist/commonjs/models/components/basinconfig.js.map +1 -1
  105. package/dist/commonjs/models/components/createbasinrequest.d.ts +5 -0
  106. package/dist/commonjs/models/components/createbasinrequest.d.ts.map +1 -1
  107. package/dist/commonjs/models/components/createbasinrequest.js +2 -0
  108. package/dist/commonjs/models/components/createbasinrequest.js.map +1 -1
  109. package/dist/commonjs/models/components/createorreconfigurebasinrequest.d.ts +54 -0
  110. package/dist/commonjs/models/components/createorreconfigurebasinrequest.d.ts.map +1 -0
  111. package/dist/commonjs/models/components/createorreconfigurebasinrequest.js +96 -0
  112. package/dist/commonjs/models/components/createorreconfigurebasinrequest.js.map +1 -0
  113. package/dist/commonjs/models/components/createstreamrequest.d.ts +35 -0
  114. package/dist/commonjs/models/components/createstreamrequest.d.ts.map +1 -0
  115. package/dist/commonjs/models/components/createstreamrequest.js +72 -0
  116. package/dist/commonjs/models/components/createstreamrequest.js.map +1 -0
  117. package/dist/commonjs/models/components/header.d.ts +43 -0
  118. package/dist/commonjs/models/components/header.d.ts.map +1 -0
  119. package/dist/commonjs/models/components/header.js +72 -0
  120. package/dist/commonjs/models/components/header.js.map +1 -0
  121. package/dist/commonjs/models/components/index.d.ts +15 -0
  122. package/dist/commonjs/models/components/index.d.ts.map +1 -1
  123. package/dist/commonjs/models/components/index.js +15 -0
  124. package/dist/commonjs/models/components/index.js.map +1 -1
  125. package/dist/commonjs/models/components/listaccesstokensresponse.d.ts +5 -5
  126. package/dist/commonjs/models/components/listaccesstokensresponse.d.ts.map +1 -1
  127. package/dist/commonjs/models/components/listaccesstokensresponse.js +4 -2
  128. package/dist/commonjs/models/components/listaccesstokensresponse.js.map +1 -1
  129. package/dist/commonjs/models/components/listbasinsresponse.d.ts +1 -1
  130. package/dist/commonjs/models/components/liststreamsresponse.d.ts +1 -1
  131. package/dist/commonjs/models/components/readbatch.d.ts +30 -0
  132. package/dist/commonjs/models/components/readbatch.d.ts.map +1 -0
  133. package/dist/commonjs/models/components/readbatch.js +70 -0
  134. package/dist/commonjs/models/components/readbatch.js.map +1 -0
  135. package/dist/commonjs/models/components/readevent.d.ts +107 -0
  136. package/dist/commonjs/models/components/readevent.d.ts.map +1 -0
  137. package/dist/commonjs/models/components/readevent.js +175 -0
  138. package/dist/commonjs/models/components/readevent.js.map +1 -0
  139. package/dist/commonjs/models/components/s2format.d.ts +28 -0
  140. package/dist/commonjs/models/components/s2format.d.ts.map +1 -0
  141. package/dist/commonjs/models/components/s2format.js +61 -0
  142. package/dist/commonjs/models/components/s2format.js.map +1 -0
  143. package/dist/commonjs/models/components/sequencedrecord.d.ts +45 -0
  144. package/dist/commonjs/models/components/sequencedrecord.d.ts.map +1 -0
  145. package/dist/commonjs/models/components/sequencedrecord.js +85 -0
  146. package/dist/commonjs/models/components/sequencedrecord.js.map +1 -0
  147. package/dist/commonjs/models/components/streamconfig.d.ts +3 -18
  148. package/dist/commonjs/models/components/streamconfig.d.ts.map +1 -1
  149. package/dist/commonjs/models/components/streamconfig.js +3 -8
  150. package/dist/commonjs/models/components/streamconfig.js.map +1 -1
  151. package/dist/commonjs/models/components/streaminfo.d.ts +2 -2
  152. package/dist/commonjs/models/components/streamposition.d.ts +43 -0
  153. package/dist/commonjs/models/components/streamposition.d.ts.map +1 -0
  154. package/dist/commonjs/models/components/streamposition.js +80 -0
  155. package/dist/commonjs/models/components/streamposition.js.map +1 -0
  156. package/dist/commonjs/models/components/streamreconfiguration.d.ts +3 -18
  157. package/dist/commonjs/models/components/streamreconfiguration.d.ts.map +1 -1
  158. package/dist/commonjs/models/components/streamreconfiguration.js +5 -8
  159. package/dist/commonjs/models/components/streamreconfiguration.js.map +1 -1
  160. package/dist/commonjs/models/components/tailresponse.d.ts +33 -0
  161. package/dist/commonjs/models/components/tailresponse.d.ts.map +1 -0
  162. package/dist/commonjs/models/components/tailresponse.js +70 -0
  163. package/dist/commonjs/models/components/tailresponse.js.map +1 -0
  164. package/dist/commonjs/models/components/timestampingconfig.d.ts +38 -0
  165. package/dist/commonjs/models/components/timestampingconfig.d.ts.map +1 -0
  166. package/dist/commonjs/models/components/timestampingconfig.js +72 -0
  167. package/dist/commonjs/models/components/timestampingconfig.js.map +1 -0
  168. package/dist/commonjs/models/components/timestampingmode.d.ts +31 -0
  169. package/dist/commonjs/models/components/timestampingmode.d.ts.map +1 -0
  170. package/dist/commonjs/models/components/timestampingmode.js +61 -0
  171. package/dist/commonjs/models/components/timestampingmode.js.map +1 -0
  172. package/dist/commonjs/models/components/timestampingreconfiguration.d.ts +35 -0
  173. package/dist/commonjs/models/components/timestampingreconfiguration.d.ts.map +1 -0
  174. package/dist/commonjs/models/components/timestampingreconfiguration.js +72 -0
  175. package/dist/commonjs/models/components/timestampingreconfiguration.js.map +1 -0
  176. package/dist/commonjs/models/errors/appendconditionfailed.d.ts +134 -0
  177. package/dist/commonjs/models/errors/appendconditionfailed.d.ts.map +1 -0
  178. package/dist/commonjs/models/errors/appendconditionfailed.js +171 -0
  179. package/dist/commonjs/models/errors/appendconditionfailed.js.map +1 -0
  180. package/dist/commonjs/models/errors/index.d.ts +3 -0
  181. package/dist/commonjs/models/errors/index.d.ts.map +1 -1
  182. package/dist/commonjs/models/errors/index.js +3 -0
  183. package/dist/commonjs/models/errors/index.js.map +1 -1
  184. package/dist/commonjs/models/errors/notfounderror.d.ts +31 -0
  185. package/dist/commonjs/models/errors/notfounderror.d.ts.map +1 -0
  186. package/dist/commonjs/models/errors/notfounderror.js +75 -0
  187. package/dist/commonjs/models/errors/notfounderror.js.map +1 -0
  188. package/dist/commonjs/models/errors/tailresponse.d.ts +38 -0
  189. package/dist/commonjs/models/errors/tailresponse.d.ts.map +1 -0
  190. package/dist/commonjs/models/errors/tailresponse.js +78 -0
  191. package/dist/commonjs/models/errors/tailresponse.js.map +1 -0
  192. package/dist/commonjs/models/operations/append.d.ts +48 -0
  193. package/dist/commonjs/models/operations/append.d.ts.map +1 -0
  194. package/dist/commonjs/models/operations/append.js +91 -0
  195. package/dist/commonjs/models/operations/append.js.map +1 -0
  196. package/dist/commonjs/models/operations/checktail.d.ts +36 -0
  197. package/dist/commonjs/models/operations/checktail.d.ts.map +1 -0
  198. package/dist/commonjs/models/operations/checktail.js +75 -0
  199. package/dist/commonjs/models/operations/checktail.js.map +1 -0
  200. package/dist/commonjs/models/operations/createorreconfigurebasin.d.ts +7 -7
  201. package/dist/commonjs/models/operations/createorreconfigurebasin.d.ts.map +1 -1
  202. package/dist/commonjs/models/operations/createorreconfigurebasin.js +6 -6
  203. package/dist/commonjs/models/operations/createorreconfigurebasin.js.map +1 -1
  204. package/dist/commonjs/models/operations/createorreconfigurestream.d.ts +3 -4
  205. package/dist/commonjs/models/operations/createorreconfigurestream.d.ts.map +1 -1
  206. package/dist/commonjs/models/operations/createorreconfigurestream.js +2 -2
  207. package/dist/commonjs/models/operations/createorreconfigurestream.js.map +1 -1
  208. package/dist/commonjs/models/operations/createstream.d.ts +2 -0
  209. package/dist/commonjs/models/operations/createstream.d.ts.map +1 -0
  210. package/dist/commonjs/models/operations/createstream.js +13 -0
  211. package/dist/commonjs/models/operations/createstream.js.map +1 -0
  212. package/dist/commonjs/models/operations/deletestream.d.ts +1 -2
  213. package/dist/commonjs/models/operations/deletestream.d.ts.map +1 -1
  214. package/dist/commonjs/models/operations/deletestream.js.map +1 -1
  215. package/dist/commonjs/models/operations/getstreamconfig.d.ts +1 -2
  216. package/dist/commonjs/models/operations/getstreamconfig.d.ts.map +1 -1
  217. package/dist/commonjs/models/operations/getstreamconfig.js.map +1 -1
  218. package/dist/commonjs/models/operations/index.d.ts +4 -0
  219. package/dist/commonjs/models/operations/index.d.ts.map +1 -1
  220. package/dist/commonjs/models/operations/index.js +4 -0
  221. package/dist/commonjs/models/operations/index.js.map +1 -1
  222. package/dist/commonjs/models/operations/listbasins.d.ts +1 -1
  223. package/dist/commonjs/models/operations/read.d.ts +93 -0
  224. package/dist/commonjs/models/operations/read.d.ts.map +1 -0
  225. package/dist/commonjs/models/operations/read.js +136 -0
  226. package/dist/commonjs/models/operations/read.js.map +1 -0
  227. package/dist/commonjs/models/operations/reconfigurestream.d.ts +1 -2
  228. package/dist/commonjs/models/operations/reconfigurestream.d.ts.map +1 -1
  229. package/dist/commonjs/models/operations/reconfigurestream.js.map +1 -1
  230. package/dist/commonjs/models/operations/revokeaccesstoken.d.ts +1 -1
  231. package/dist/commonjs/sdk/basins.d.ts +4 -0
  232. package/dist/commonjs/sdk/basins.d.ts.map +1 -1
  233. package/dist/commonjs/sdk/basins.js +7 -0
  234. package/dist/commonjs/sdk/basins.js.map +1 -1
  235. package/dist/commonjs/sdk/records.d.ts +31 -0
  236. package/dist/commonjs/sdk/records.d.ts.map +1 -0
  237. package/dist/commonjs/sdk/records.js +44 -0
  238. package/dist/commonjs/sdk/records.js.map +1 -0
  239. package/dist/commonjs/sdk/sdk.d.ts +3 -0
  240. package/dist/commonjs/sdk/sdk.d.ts.map +1 -1
  241. package/dist/commonjs/sdk/sdk.js +4 -0
  242. package/dist/commonjs/sdk/sdk.js.map +1 -1
  243. package/dist/commonjs/sdk/streams.d.ts +4 -0
  244. package/dist/commonjs/sdk/streams.d.ts.map +1 -1
  245. package/dist/commonjs/sdk/streams.js +7 -0
  246. package/dist/commonjs/sdk/streams.js.map +1 -1
  247. package/dist/esm/funcs/accessTokensIssueAccessToken.js +2 -2
  248. package/dist/esm/funcs/accessTokensIssueAccessToken.js.map +1 -1
  249. package/dist/esm/funcs/accessTokensListAccessTokens.js +2 -2
  250. package/dist/esm/funcs/accessTokensRevokeAccessToken.js +2 -2
  251. package/dist/esm/funcs/basinsCreateBasin.d.ts +14 -0
  252. package/dist/esm/funcs/basinsCreateBasin.d.ts.map +1 -0
  253. package/dist/esm/funcs/basinsCreateBasin.js +88 -0
  254. package/dist/esm/funcs/basinsCreateBasin.js.map +1 -0
  255. package/dist/esm/funcs/basinsCreateOrReconfigureBasin.js +3 -3
  256. package/dist/esm/funcs/basinsCreateOrReconfigureBasin.js.map +1 -1
  257. package/dist/esm/funcs/basinsDeleteBasin.d.ts +1 -1
  258. package/dist/esm/funcs/basinsDeleteBasin.d.ts.map +1 -1
  259. package/dist/esm/funcs/basinsDeleteBasin.js +13 -2
  260. package/dist/esm/funcs/basinsDeleteBasin.js.map +1 -1
  261. package/dist/esm/funcs/basinsGetBasinConfig.js +2 -2
  262. package/dist/esm/funcs/basinsGetBasinConfig.js.map +1 -1
  263. package/dist/esm/funcs/basinsListBasins.js +2 -2
  264. package/dist/esm/funcs/basinsReconfigureBasin.js +2 -2
  265. package/dist/esm/funcs/basinsReconfigureBasin.js.map +1 -1
  266. package/dist/esm/funcs/recordsAppend.d.ts +18 -0
  267. package/dist/esm/funcs/recordsAppend.d.ts.map +1 -0
  268. package/dist/esm/funcs/recordsAppend.js +108 -0
  269. package/dist/esm/funcs/recordsAppend.js.map +1 -0
  270. package/dist/esm/funcs/recordsCheckTail.d.ts +18 -0
  271. package/dist/esm/funcs/recordsCheckTail.d.ts.map +1 -0
  272. package/dist/esm/funcs/recordsCheckTail.js +102 -0
  273. package/dist/esm/funcs/recordsCheckTail.js.map +1 -0
  274. package/dist/esm/funcs/recordsRead.d.ts +23 -0
  275. package/dist/esm/funcs/recordsRead.d.ts.map +1 -0
  276. package/dist/esm/funcs/recordsRead.js +120 -0
  277. package/dist/esm/funcs/recordsRead.js.map +1 -0
  278. package/dist/esm/funcs/streamsCreateOrReconfigureStream.js +14 -3
  279. package/dist/esm/funcs/streamsCreateOrReconfigureStream.js.map +1 -1
  280. package/dist/esm/funcs/streamsCreateStream.d.ts +14 -0
  281. package/dist/esm/funcs/streamsCreateStream.d.ts.map +1 -0
  282. package/dist/esm/funcs/streamsCreateStream.js +93 -0
  283. package/dist/esm/funcs/streamsCreateStream.js.map +1 -0
  284. package/dist/esm/funcs/streamsDeleteStream.d.ts +1 -1
  285. package/dist/esm/funcs/streamsDeleteStream.d.ts.map +1 -1
  286. package/dist/esm/funcs/streamsDeleteStream.js +2 -2
  287. package/dist/esm/funcs/streamsDeleteStream.js.map +1 -1
  288. package/dist/esm/funcs/streamsGetStreamConfig.js +13 -2
  289. package/dist/esm/funcs/streamsGetStreamConfig.js.map +1 -1
  290. package/dist/esm/funcs/streamsListStreams.js +2 -2
  291. package/dist/esm/funcs/streamsListStreams.js.map +1 -1
  292. package/dist/esm/funcs/streamsReconfigureStream.js +13 -2
  293. package/dist/esm/funcs/streamsReconfigureStream.js.map +1 -1
  294. package/dist/esm/lib/config.d.ts +3 -3
  295. package/dist/esm/lib/config.js +3 -3
  296. package/dist/esm/lib/event-streams.d.ts +17 -0
  297. package/dist/esm/lib/event-streams.d.ts.map +1 -0
  298. package/dist/esm/lib/event-streams.js +215 -0
  299. package/dist/esm/lib/event-streams.js.map +1 -0
  300. package/dist/esm/lib/matchers.d.ts.map +1 -1
  301. package/dist/esm/lib/matchers.js +4 -1
  302. package/dist/esm/lib/matchers.js.map +1 -1
  303. package/dist/esm/lib/sdks.d.ts +3 -1
  304. package/dist/esm/lib/sdks.d.ts.map +1 -1
  305. package/dist/esm/lib/sdks.js +6 -11
  306. package/dist/esm/lib/sdks.js.map +1 -1
  307. package/dist/esm/mcp-server/mcp-server.js +1 -1
  308. package/dist/esm/mcp-server/server.d.ts.map +1 -1
  309. package/dist/esm/mcp-server/server.js +11 -1
  310. package/dist/esm/mcp-server/server.js.map +1 -1
  311. package/dist/esm/mcp-server/tools/basinsCreateBasin.d.ts +8 -0
  312. package/dist/esm/mcp-server/tools/basinsCreateBasin.d.ts.map +1 -0
  313. package/dist/esm/mcp-server/tools/basinsCreateBasin.js +27 -0
  314. package/dist/esm/mcp-server/tools/basinsCreateBasin.js.map +1 -0
  315. package/dist/esm/mcp-server/tools/recordsAppend.d.ts +8 -0
  316. package/dist/esm/mcp-server/tools/recordsAppend.d.ts.map +1 -0
  317. package/dist/esm/mcp-server/tools/recordsAppend.js +29 -0
  318. package/dist/esm/mcp-server/tools/recordsAppend.js.map +1 -0
  319. package/dist/esm/mcp-server/tools/recordsCheckTail.d.ts +8 -0
  320. package/dist/esm/mcp-server/tools/recordsCheckTail.d.ts.map +1 -0
  321. package/dist/esm/mcp-server/tools/recordsCheckTail.js +29 -0
  322. package/dist/esm/mcp-server/tools/recordsCheckTail.js.map +1 -0
  323. package/dist/esm/mcp-server/tools/recordsRead.d.ts +8 -0
  324. package/dist/esm/mcp-server/tools/recordsRead.d.ts.map +1 -0
  325. package/dist/esm/mcp-server/tools/recordsRead.js +29 -0
  326. package/dist/esm/mcp-server/tools/recordsRead.js.map +1 -0
  327. package/dist/esm/mcp-server/tools/streamsCreateStream.d.ts +8 -0
  328. package/dist/esm/mcp-server/tools/streamsCreateStream.d.ts.map +1 -0
  329. package/dist/esm/mcp-server/tools/streamsCreateStream.js +27 -0
  330. package/dist/esm/mcp-server/tools/streamsCreateStream.js.map +1 -0
  331. package/dist/esm/models/components/accesstokeninfo.d.ts +2 -2
  332. package/dist/esm/models/components/appendack.d.ts +46 -0
  333. package/dist/esm/models/components/appendack.d.ts.map +1 -0
  334. package/dist/esm/models/components/appendack.js +36 -0
  335. package/dist/esm/models/components/appendack.js.map +1 -0
  336. package/dist/esm/models/components/appendinput.d.ts +46 -0
  337. package/dist/esm/models/components/appendinput.d.ts.map +1 -0
  338. package/dist/esm/models/components/appendinput.js +47 -0
  339. package/dist/esm/models/components/appendinput.js.map +1 -0
  340. package/dist/esm/models/components/appendrecord.d.ts +43 -0
  341. package/dist/esm/models/components/appendrecord.d.ts.map +1 -0
  342. package/dist/esm/models/components/appendrecord.js +36 -0
  343. package/dist/esm/models/components/appendrecord.js.map +1 -0
  344. package/dist/esm/models/components/basinconfig.d.ts +4 -4
  345. package/dist/esm/models/components/basinconfig.d.ts.map +1 -1
  346. package/dist/esm/models/components/basinconfig.js +4 -4
  347. package/dist/esm/models/components/basinconfig.js.map +1 -1
  348. package/dist/esm/models/components/createbasinrequest.d.ts +5 -0
  349. package/dist/esm/models/components/createbasinrequest.d.ts.map +1 -1
  350. package/dist/esm/models/components/createbasinrequest.js +2 -0
  351. package/dist/esm/models/components/createbasinrequest.js.map +1 -1
  352. package/dist/esm/models/components/createorreconfigurebasinrequest.d.ts +54 -0
  353. package/dist/esm/models/components/createorreconfigurebasinrequest.d.ts.map +1 -0
  354. package/dist/esm/models/components/createorreconfigurebasinrequest.js +56 -0
  355. package/dist/esm/models/components/createorreconfigurebasinrequest.js.map +1 -0
  356. package/dist/esm/models/components/createstreamrequest.d.ts +35 -0
  357. package/dist/esm/models/components/createstreamrequest.d.ts.map +1 -0
  358. package/dist/esm/models/components/createstreamrequest.js +34 -0
  359. package/dist/esm/models/components/createstreamrequest.js.map +1 -0
  360. package/dist/esm/models/components/header.d.ts +43 -0
  361. package/dist/esm/models/components/header.d.ts.map +1 -0
  362. package/dist/esm/models/components/header.js +34 -0
  363. package/dist/esm/models/components/header.js.map +1 -0
  364. package/dist/esm/models/components/index.d.ts +15 -0
  365. package/dist/esm/models/components/index.d.ts.map +1 -1
  366. package/dist/esm/models/components/index.js +15 -0
  367. package/dist/esm/models/components/index.js.map +1 -1
  368. package/dist/esm/models/components/listaccesstokensresponse.d.ts +5 -5
  369. package/dist/esm/models/components/listaccesstokensresponse.d.ts.map +1 -1
  370. package/dist/esm/models/components/listaccesstokensresponse.js +4 -2
  371. package/dist/esm/models/components/listaccesstokensresponse.js.map +1 -1
  372. package/dist/esm/models/components/listbasinsresponse.d.ts +1 -1
  373. package/dist/esm/models/components/liststreamsresponse.d.ts +1 -1
  374. package/dist/esm/models/components/readbatch.d.ts +30 -0
  375. package/dist/esm/models/components/readbatch.d.ts.map +1 -0
  376. package/dist/esm/models/components/readbatch.js +32 -0
  377. package/dist/esm/models/components/readbatch.js.map +1 -0
  378. package/dist/esm/models/components/readevent.d.ts +107 -0
  379. package/dist/esm/models/components/readevent.d.ts.map +1 -0
  380. package/dist/esm/models/components/readevent.js +131 -0
  381. package/dist/esm/models/components/readevent.js.map +1 -0
  382. package/dist/esm/models/components/s2format.d.ts +28 -0
  383. package/dist/esm/models/components/s2format.d.ts.map +1 -0
  384. package/dist/esm/models/components/s2format.js +25 -0
  385. package/dist/esm/models/components/s2format.js.map +1 -0
  386. package/dist/esm/models/components/sequencedrecord.d.ts +45 -0
  387. package/dist/esm/models/components/sequencedrecord.d.ts.map +1 -0
  388. package/dist/esm/models/components/sequencedrecord.js +47 -0
  389. package/dist/esm/models/components/sequencedrecord.js.map +1 -0
  390. package/dist/esm/models/components/streamconfig.d.ts +3 -18
  391. package/dist/esm/models/components/streamconfig.d.ts.map +1 -1
  392. package/dist/esm/models/components/streamconfig.js +3 -8
  393. package/dist/esm/models/components/streamconfig.js.map +1 -1
  394. package/dist/esm/models/components/streaminfo.d.ts +2 -2
  395. package/dist/esm/models/components/streamposition.d.ts +43 -0
  396. package/dist/esm/models/components/streamposition.d.ts.map +1 -0
  397. package/dist/esm/models/components/streamposition.js +42 -0
  398. package/dist/esm/models/components/streamposition.js.map +1 -0
  399. package/dist/esm/models/components/streamreconfiguration.d.ts +3 -18
  400. package/dist/esm/models/components/streamreconfiguration.d.ts.map +1 -1
  401. package/dist/esm/models/components/streamreconfiguration.js +5 -8
  402. package/dist/esm/models/components/streamreconfiguration.js.map +1 -1
  403. package/dist/esm/models/components/tailresponse.d.ts +33 -0
  404. package/dist/esm/models/components/tailresponse.d.ts.map +1 -0
  405. package/dist/esm/models/components/tailresponse.js +32 -0
  406. package/dist/esm/models/components/tailresponse.js.map +1 -0
  407. package/dist/esm/models/components/timestampingconfig.d.ts +38 -0
  408. package/dist/esm/models/components/timestampingconfig.d.ts.map +1 -0
  409. package/dist/esm/models/components/timestampingconfig.js +34 -0
  410. package/dist/esm/models/components/timestampingconfig.js.map +1 -0
  411. package/dist/esm/models/components/timestampingmode.d.ts +31 -0
  412. package/dist/esm/models/components/timestampingmode.d.ts.map +1 -0
  413. package/dist/esm/models/components/timestampingmode.js +25 -0
  414. package/dist/esm/models/components/timestampingmode.js.map +1 -0
  415. package/dist/esm/models/components/timestampingreconfiguration.d.ts +35 -0
  416. package/dist/esm/models/components/timestampingreconfiguration.d.ts.map +1 -0
  417. package/dist/esm/models/components/timestampingreconfiguration.js +34 -0
  418. package/dist/esm/models/components/timestampingreconfiguration.js.map +1 -0
  419. package/dist/esm/models/errors/appendconditionfailed.d.ts +134 -0
  420. package/dist/esm/models/errors/appendconditionfailed.d.ts.map +1 -0
  421. package/dist/esm/models/errors/appendconditionfailed.js +131 -0
  422. package/dist/esm/models/errors/appendconditionfailed.js.map +1 -0
  423. package/dist/esm/models/errors/index.d.ts +3 -0
  424. package/dist/esm/models/errors/index.d.ts.map +1 -1
  425. package/dist/esm/models/errors/index.js +3 -0
  426. package/dist/esm/models/errors/index.js.map +1 -1
  427. package/dist/esm/models/errors/notfounderror.d.ts +31 -0
  428. package/dist/esm/models/errors/notfounderror.d.ts.map +1 -0
  429. package/dist/esm/models/errors/notfounderror.js +38 -0
  430. package/dist/esm/models/errors/notfounderror.js.map +1 -0
  431. package/dist/esm/models/errors/tailresponse.d.ts +38 -0
  432. package/dist/esm/models/errors/tailresponse.d.ts.map +1 -0
  433. package/dist/esm/models/errors/tailresponse.js +41 -0
  434. package/dist/esm/models/errors/tailresponse.js.map +1 -0
  435. package/dist/esm/models/operations/append.d.ts +48 -0
  436. package/dist/esm/models/operations/append.d.ts.map +1 -0
  437. package/dist/esm/models/operations/append.js +53 -0
  438. package/dist/esm/models/operations/append.js.map +1 -0
  439. package/dist/esm/models/operations/checktail.d.ts +36 -0
  440. package/dist/esm/models/operations/checktail.d.ts.map +1 -0
  441. package/dist/esm/models/operations/checktail.js +37 -0
  442. package/dist/esm/models/operations/checktail.js.map +1 -0
  443. package/dist/esm/models/operations/createorreconfigurebasin.d.ts +7 -7
  444. package/dist/esm/models/operations/createorreconfigurebasin.d.ts.map +1 -1
  445. package/dist/esm/models/operations/createorreconfigurebasin.js +6 -6
  446. package/dist/esm/models/operations/createorreconfigurebasin.js.map +1 -1
  447. package/dist/esm/models/operations/createorreconfigurestream.d.ts +3 -4
  448. package/dist/esm/models/operations/createorreconfigurestream.d.ts.map +1 -1
  449. package/dist/esm/models/operations/createorreconfigurestream.js +2 -2
  450. package/dist/esm/models/operations/createorreconfigurestream.js.map +1 -1
  451. package/dist/esm/models/operations/createstream.d.ts +2 -0
  452. package/dist/esm/models/operations/createstream.d.ts.map +1 -0
  453. package/dist/esm/models/operations/createstream.js +10 -0
  454. package/dist/esm/models/operations/createstream.js.map +1 -0
  455. package/dist/esm/models/operations/deletestream.d.ts +1 -2
  456. package/dist/esm/models/operations/deletestream.d.ts.map +1 -1
  457. package/dist/esm/models/operations/deletestream.js.map +1 -1
  458. package/dist/esm/models/operations/getstreamconfig.d.ts +1 -2
  459. package/dist/esm/models/operations/getstreamconfig.d.ts.map +1 -1
  460. package/dist/esm/models/operations/getstreamconfig.js.map +1 -1
  461. package/dist/esm/models/operations/index.d.ts +4 -0
  462. package/dist/esm/models/operations/index.d.ts.map +1 -1
  463. package/dist/esm/models/operations/index.js +4 -0
  464. package/dist/esm/models/operations/index.js.map +1 -1
  465. package/dist/esm/models/operations/listbasins.d.ts +1 -1
  466. package/dist/esm/models/operations/read.d.ts +93 -0
  467. package/dist/esm/models/operations/read.d.ts.map +1 -0
  468. package/dist/esm/models/operations/read.js +96 -0
  469. package/dist/esm/models/operations/read.js.map +1 -0
  470. package/dist/esm/models/operations/reconfigurestream.d.ts +1 -2
  471. package/dist/esm/models/operations/reconfigurestream.d.ts.map +1 -1
  472. package/dist/esm/models/operations/reconfigurestream.js.map +1 -1
  473. package/dist/esm/models/operations/revokeaccesstoken.d.ts +1 -1
  474. package/dist/esm/sdk/basins.d.ts +4 -0
  475. package/dist/esm/sdk/basins.d.ts.map +1 -1
  476. package/dist/esm/sdk/basins.js +7 -0
  477. package/dist/esm/sdk/basins.js.map +1 -1
  478. package/dist/esm/sdk/records.d.ts +31 -0
  479. package/dist/esm/sdk/records.d.ts.map +1 -0
  480. package/dist/esm/sdk/records.js +39 -0
  481. package/dist/esm/sdk/records.js.map +1 -0
  482. package/dist/esm/sdk/sdk.d.ts +3 -0
  483. package/dist/esm/sdk/sdk.d.ts.map +1 -1
  484. package/dist/esm/sdk/sdk.js +4 -0
  485. package/dist/esm/sdk/sdk.js.map +1 -1
  486. package/dist/esm/sdk/streams.d.ts +4 -0
  487. package/dist/esm/sdk/streams.d.ts.map +1 -1
  488. package/dist/esm/sdk/streams.js +7 -0
  489. package/dist/esm/sdk/streams.js.map +1 -1
  490. package/docs/sdks/accesstokens/README.md +3 -3
  491. package/docs/sdks/basins/README.md +86 -7
  492. package/docs/sdks/records/README.md +271 -0
  493. package/docs/sdks/streams/README.md +87 -7
  494. package/jsr.json +2 -1
  495. package/package.json +1 -1
  496. package/src/funcs/accessTokensIssueAccessToken.ts +2 -2
  497. package/src/funcs/accessTokensListAccessTokens.ts +2 -2
  498. package/src/funcs/accessTokensRevokeAccessToken.ts +2 -2
  499. package/src/funcs/basinsCreateBasin.ts +179 -0
  500. package/src/funcs/basinsCreateOrReconfigureBasin.ts +3 -3
  501. package/src/funcs/basinsDeleteBasin.ts +17 -2
  502. package/src/funcs/basinsGetBasinConfig.ts +2 -2
  503. package/src/funcs/basinsListBasins.ts +2 -2
  504. package/src/funcs/basinsReconfigureBasin.ts +2 -2
  505. package/src/funcs/recordsAppend.ts +205 -0
  506. package/src/funcs/recordsCheckTail.ts +195 -0
  507. package/src/funcs/recordsRead.ts +219 -0
  508. package/src/funcs/streamsCreateOrReconfigureStream.ts +14 -3
  509. package/src/funcs/streamsCreateStream.ts +185 -0
  510. package/src/funcs/streamsDeleteStream.ts +6 -2
  511. package/src/funcs/streamsGetStreamConfig.ts +13 -2
  512. package/src/funcs/streamsListStreams.ts +2 -2
  513. package/src/funcs/streamsReconfigureStream.ts +13 -2
  514. package/src/lib/config.ts +3 -3
  515. package/src/lib/event-streams.ts +264 -0
  516. package/src/lib/matchers.ts +4 -1
  517. package/src/lib/sdks.ts +11 -11
  518. package/src/mcp-server/mcp-server.ts +1 -1
  519. package/src/mcp-server/server.ts +11 -1
  520. package/src/mcp-server/tools/basinsCreateBasin.ts +36 -0
  521. package/src/mcp-server/tools/recordsAppend.ts +38 -0
  522. package/src/mcp-server/tools/recordsCheckTail.ts +38 -0
  523. package/src/mcp-server/tools/recordsRead.ts +38 -0
  524. package/src/mcp-server/tools/streamsCreateStream.ts +36 -0
  525. package/src/models/components/accesstokeninfo.ts +2 -2
  526. package/src/models/components/appendack.ts +88 -0
  527. package/src/models/components/appendinput.ts +99 -0
  528. package/src/models/components/appendrecord.ts +85 -0
  529. package/src/models/components/basinconfig.ts +8 -8
  530. package/src/models/components/createbasinrequest.ts +7 -0
  531. package/src/models/components/createorreconfigurebasinrequest.ts +138 -0
  532. package/src/models/components/createstreamrequest.ts +79 -0
  533. package/src/models/components/header.ts +75 -0
  534. package/src/models/components/index.ts +15 -0
  535. package/src/models/components/listaccesstokensresponse.ts +9 -7
  536. package/src/models/components/listbasinsresponse.ts +1 -1
  537. package/src/models/components/liststreamsresponse.ts +1 -1
  538. package/src/models/components/readbatch.ts +68 -0
  539. package/src/models/components/readevent.ts +243 -0
  540. package/src/models/components/s2format.ts +31 -0
  541. package/src/models/components/sequencedrecord.ts +100 -0
  542. package/src/models/components/streamconfig.ts +10 -26
  543. package/src/models/components/streaminfo.ts +2 -2
  544. package/src/models/components/streamposition.ts +87 -0
  545. package/src/models/components/streamreconfiguration.ts +12 -26
  546. package/src/models/components/tailresponse.ts +71 -0
  547. package/src/models/components/timestampingconfig.ts +81 -0
  548. package/src/models/components/timestampingmode.ts +34 -0
  549. package/src/models/components/timestampingreconfiguration.ts +80 -0
  550. package/src/models/errors/appendconditionfailed.ts +249 -0
  551. package/src/models/errors/index.ts +3 -0
  552. package/src/models/errors/notfounderror.ts +67 -0
  553. package/src/models/errors/tailresponse.ts +76 -0
  554. package/src/models/operations/append.ts +102 -0
  555. package/src/models/operations/checktail.ts +79 -0
  556. package/src/models/operations/createorreconfigurebasin.ts +23 -13
  557. package/src/models/operations/createorreconfigurestream.ts +5 -6
  558. package/src/models/operations/createstream.ts +10 -0
  559. package/src/models/operations/deletestream.ts +1 -2
  560. package/src/models/operations/getstreamconfig.ts +1 -2
  561. package/src/models/operations/index.ts +4 -0
  562. package/src/models/operations/listbasins.ts +1 -1
  563. package/src/models/operations/read.ts +195 -0
  564. package/src/models/operations/reconfigurestream.ts +1 -2
  565. package/src/models/operations/revokeaccesstoken.ts +1 -1
  566. package/src/sdk/basins.ts +15 -0
  567. package/src/sdk/records.ts +66 -0
  568. package/src/sdk/sdk.ts +6 -0
  569. package/src/sdk/streams.ts +15 -0
@@ -8,6 +8,7 @@ Manage basins
8
8
  ### Available Operations
9
9
 
10
10
  * [listBasins](#listbasins) - List basins.
11
+ * [createBasin](#createbasin) - Create a basin.
11
12
  * [getBasinConfig](#getbasinconfig) - Get basin config.
12
13
  * [createOrReconfigureBasin](#createorreconfigurebasin) - Create or reconfigure a basin.
13
14
  * [deleteBasin](#deletebasin) - Delete a basin.
@@ -87,7 +88,86 @@ run();
87
88
 
88
89
  | Error Type | Status Code | Content Type |
89
90
  | --------------------- | --------------------- | --------------------- |
90
- | errors.ErrorResponse | 400, 401 | application/json |
91
+ | errors.ErrorResponse | 400, 403 | application/json |
92
+ | errors.RetryableError | 499 | application/json |
93
+ | errors.RetryableError | 500, 503, 504 | application/json |
94
+ | errors.APIError | 4XX, 5XX | \*/\* |
95
+
96
+ ## createBasin
97
+
98
+ Create a basin.
99
+
100
+ ### Example Usage
101
+
102
+ ```typescript
103
+ import { S2 } from "@s2-dev/streamstore";
104
+
105
+ const s2 = new S2({
106
+ accessToken: process.env["S2_ACCESS_TOKEN"] ?? "",
107
+ });
108
+
109
+ async function run() {
110
+ const result = await s2.basins.createBasin({
111
+ basin: "<value>",
112
+ });
113
+
114
+ // Handle the result
115
+ console.log(result);
116
+ }
117
+
118
+ run();
119
+ ```
120
+
121
+ ### Standalone function
122
+
123
+ The standalone function version of this method:
124
+
125
+ ```typescript
126
+ import { S2Core } from "@s2-dev/streamstore/core.js";
127
+ import { basinsCreateBasin } from "@s2-dev/streamstore/funcs/basinsCreateBasin.js";
128
+
129
+ // Use `S2Core` for best tree-shaking performance.
130
+ // You can create one instance of it to use across an application.
131
+ const s2 = new S2Core({
132
+ accessToken: process.env["S2_ACCESS_TOKEN"] ?? "",
133
+ });
134
+
135
+ async function run() {
136
+ const res = await basinsCreateBasin(s2, {
137
+ basin: "<value>",
138
+ });
139
+
140
+ if (!res.ok) {
141
+ throw res.error;
142
+ }
143
+
144
+ const { value: result } = res;
145
+
146
+ // Handle the result
147
+ console.log(result);
148
+ }
149
+
150
+ run();
151
+ ```
152
+
153
+ ### Parameters
154
+
155
+ | Parameter | Type | Required | Description |
156
+ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
157
+ | `request` | [components.CreateBasinRequest](../../models/components/createbasinrequest.md) | :heavy_check_mark: | The request object to use for the request. |
158
+ | `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
159
+ | `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. |
160
+ | `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
161
+
162
+ ### Response
163
+
164
+ **Promise\<[components.BasinInfo](../../models/components/basininfo.md)\>**
165
+
166
+ ### Errors
167
+
168
+ | Error Type | Status Code | Content Type |
169
+ | --------------------- | --------------------- | --------------------- |
170
+ | errors.ErrorResponse | 400, 401, 403, 409 | application/json |
91
171
  | errors.RetryableError | 499 | application/json |
92
172
  | errors.RetryableError | 500, 503, 504 | application/json |
93
173
  | errors.APIError | 4XX, 5XX | \*/\* |
@@ -166,7 +246,7 @@ run();
166
246
 
167
247
  | Error Type | Status Code | Content Type |
168
248
  | --------------------- | --------------------- | --------------------- |
169
- | errors.ErrorResponse | 400, 401 | application/json |
249
+ | errors.ErrorResponse | 400, 403, 404 | application/json |
170
250
  | errors.RetryableError | 499 | application/json |
171
251
  | errors.RetryableError | 500, 503, 504 | application/json |
172
252
  | errors.APIError | 4XX, 5XX | \*/\* |
@@ -187,7 +267,6 @@ const s2 = new S2({
187
267
  async function run() {
188
268
  const result = await s2.basins.createOrReconfigureBasin({
189
269
  basin: "<value>",
190
- createBasinRequest: {},
191
270
  });
192
271
 
193
272
  // Handle the result
@@ -214,7 +293,6 @@ const s2 = new S2Core({
214
293
  async function run() {
215
294
  const res = await basinsCreateOrReconfigureBasin(s2, {
216
295
  basin: "<value>",
217
- createBasinRequest: {},
218
296
  });
219
297
 
220
298
  if (!res.ok) {
@@ -247,7 +325,7 @@ run();
247
325
 
248
326
  | Error Type | Status Code | Content Type |
249
327
  | --------------------- | --------------------- | --------------------- |
250
- | errors.ErrorResponse | 400, 401 | application/json |
328
+ | errors.ErrorResponse | 400 | application/json |
251
329
  | errors.RetryableError | 499 | application/json |
252
330
  | errors.RetryableError | 500, 503, 504 | application/json |
253
331
  | errors.APIError | 4XX, 5XX | \*/\* |
@@ -324,7 +402,8 @@ run();
324
402
 
325
403
  | Error Type | Status Code | Content Type |
326
404
  | --------------------- | --------------------- | --------------------- |
327
- | errors.ErrorResponse | 400, 401 | application/json |
405
+ | errors.ErrorResponse | 400, 401, 403 | application/json |
406
+ | errors.NotFoundError | 404 | application/json |
328
407
  | errors.RetryableError | 499 | application/json |
329
408
  | errors.RetryableError | 500, 503, 504 | application/json |
330
409
  | errors.APIError | 4XX, 5XX | \*/\* |
@@ -405,7 +484,7 @@ run();
405
484
 
406
485
  | Error Type | Status Code | Content Type |
407
486
  | --------------------- | --------------------- | --------------------- |
408
- | errors.ErrorResponse | 400, 401 | application/json |
487
+ | errors.ErrorResponse | 400, 403, 404 | application/json |
409
488
  | errors.RetryableError | 499 | application/json |
410
489
  | errors.RetryableError | 500, 503, 504 | application/json |
411
490
  | errors.APIError | 4XX, 5XX | \*/\* |
@@ -0,0 +1,271 @@
1
+ # Records
2
+ (*records*)
3
+
4
+ ## Overview
5
+
6
+ Manage records
7
+
8
+ ### Available Operations
9
+
10
+ * [read](#read) - Retrieve records.
11
+ * [append](#append) - Append records.
12
+ * [checkTail](#checktail) - Check the tail.
13
+
14
+ ## read
15
+
16
+ Retrieve a batch of records, or set `Accept: text/event-stream` to stream using server-sent events.
17
+
18
+ ### Example Usage
19
+
20
+ ```typescript
21
+ import { S2 } from "@s2-dev/streamstore";
22
+
23
+ const s2 = new S2({
24
+ accessToken: process.env["S2_ACCESS_TOKEN"] ?? "",
25
+ });
26
+
27
+ async function run() {
28
+ const result = await s2.records.read({
29
+ stream: "<value>",
30
+ });
31
+
32
+ for await (const event of result) {
33
+ // Handle the event
34
+ console.log(event);
35
+ }
36
+ }
37
+
38
+ run();
39
+ ```
40
+
41
+ ### Standalone function
42
+
43
+ The standalone function version of this method:
44
+
45
+ ```typescript
46
+ import { S2Core } from "@s2-dev/streamstore/core.js";
47
+ import { recordsRead } from "@s2-dev/streamstore/funcs/recordsRead.js";
48
+
49
+ // Use `S2Core` for best tree-shaking performance.
50
+ // You can create one instance of it to use across an application.
51
+ const s2 = new S2Core({
52
+ accessToken: process.env["S2_ACCESS_TOKEN"] ?? "",
53
+ });
54
+
55
+ async function run() {
56
+ const res = await recordsRead(s2, {
57
+ stream: "<value>",
58
+ });
59
+
60
+ if (!res.ok) {
61
+ throw res.error;
62
+ }
63
+
64
+ const { value: result } = res;
65
+
66
+ for await (const event of result) {
67
+ // Handle the event
68
+ console.log(event);
69
+ }
70
+ }
71
+
72
+ run();
73
+ ```
74
+
75
+ ### Parameters
76
+
77
+ | Parameter | Type | Required | Description |
78
+ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
79
+ | `request` | [operations.ReadRequest](../../models/operations/readrequest.md) | :heavy_check_mark: | The request object to use for the request. |
80
+ | `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
81
+ | `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. |
82
+ | `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
83
+ | `options.serverURL` | *string* | :heavy_minus_sign: | An optional server URL to use. |
84
+
85
+ ### Response
86
+
87
+ **Promise\<[operations.ReadResponse](../../models/operations/readresponse.md)\>**
88
+
89
+ ### Errors
90
+
91
+ | Error Type | Status Code | Content Type |
92
+ | --------------------- | --------------------- | --------------------- |
93
+ | errors.ErrorResponse | 400, 401, 404, 409 | application/json |
94
+ | errors.TailResponse | 416 | application/json |
95
+ | errors.RetryableError | 499 | application/json |
96
+ | errors.RetryableError | 500, 503, 504 | application/json |
97
+ | errors.APIError | 4XX, 5XX | \*/\* |
98
+
99
+ ## append
100
+
101
+ Append a batch of records to a stream.
102
+
103
+ ### Example Usage
104
+
105
+ ```typescript
106
+ import { S2 } from "@s2-dev/streamstore";
107
+
108
+ const s2 = new S2({
109
+ accessToken: process.env["S2_ACCESS_TOKEN"] ?? "",
110
+ });
111
+
112
+ async function run() {
113
+ const result = await s2.records.append({
114
+ stream: "<value>",
115
+ appendInput: {
116
+ records: [
117
+ {},
118
+ {},
119
+ ],
120
+ },
121
+ });
122
+
123
+ // Handle the result
124
+ console.log(result);
125
+ }
126
+
127
+ run();
128
+ ```
129
+
130
+ ### Standalone function
131
+
132
+ The standalone function version of this method:
133
+
134
+ ```typescript
135
+ import { S2Core } from "@s2-dev/streamstore/core.js";
136
+ import { recordsAppend } from "@s2-dev/streamstore/funcs/recordsAppend.js";
137
+
138
+ // Use `S2Core` for best tree-shaking performance.
139
+ // You can create one instance of it to use across an application.
140
+ const s2 = new S2Core({
141
+ accessToken: process.env["S2_ACCESS_TOKEN"] ?? "",
142
+ });
143
+
144
+ async function run() {
145
+ const res = await recordsAppend(s2, {
146
+ stream: "<value>",
147
+ appendInput: {
148
+ records: [
149
+ {},
150
+ {},
151
+ ],
152
+ },
153
+ });
154
+
155
+ if (!res.ok) {
156
+ throw res.error;
157
+ }
158
+
159
+ const { value: result } = res;
160
+
161
+ // Handle the result
162
+ console.log(result);
163
+ }
164
+
165
+ run();
166
+ ```
167
+
168
+ ### Parameters
169
+
170
+ | Parameter | Type | Required | Description |
171
+ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
172
+ | `request` | [operations.AppendRequest](../../models/operations/appendrequest.md) | :heavy_check_mark: | The request object to use for the request. |
173
+ | `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
174
+ | `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. |
175
+ | `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
176
+ | `options.serverURL` | *string* | :heavy_minus_sign: | An optional server URL to use. |
177
+
178
+ ### Response
179
+
180
+ **Promise\<[components.AppendAck](../../models/components/appendack.md)\>**
181
+
182
+ ### Errors
183
+
184
+ | Error Type | Status Code | Content Type |
185
+ | --------------------- | --------------------- | --------------------- |
186
+ | errors.ErrorResponse | 400, 401, 404, 409 | application/json |
187
+ | errors.One | 412 | application/json |
188
+ | errors.Two | 412 | application/json |
189
+ | errors.RetryableError | 499 | application/json |
190
+ | errors.RetryableError | 500, 503, 504 | application/json |
191
+ | errors.APIError | 4XX, 5XX | \*/\* |
192
+
193
+ ## checkTail
194
+
195
+ Check the tail of a stream.
196
+
197
+ ### Example Usage
198
+
199
+ ```typescript
200
+ import { S2 } from "@s2-dev/streamstore";
201
+
202
+ const s2 = new S2({
203
+ accessToken: process.env["S2_ACCESS_TOKEN"] ?? "",
204
+ });
205
+
206
+ async function run() {
207
+ const result = await s2.records.checkTail({
208
+ stream: "<value>",
209
+ });
210
+
211
+ // Handle the result
212
+ console.log(result);
213
+ }
214
+
215
+ run();
216
+ ```
217
+
218
+ ### Standalone function
219
+
220
+ The standalone function version of this method:
221
+
222
+ ```typescript
223
+ import { S2Core } from "@s2-dev/streamstore/core.js";
224
+ import { recordsCheckTail } from "@s2-dev/streamstore/funcs/recordsCheckTail.js";
225
+
226
+ // Use `S2Core` for best tree-shaking performance.
227
+ // You can create one instance of it to use across an application.
228
+ const s2 = new S2Core({
229
+ accessToken: process.env["S2_ACCESS_TOKEN"] ?? "",
230
+ });
231
+
232
+ async function run() {
233
+ const res = await recordsCheckTail(s2, {
234
+ stream: "<value>",
235
+ });
236
+
237
+ if (!res.ok) {
238
+ throw res.error;
239
+ }
240
+
241
+ const { value: result } = res;
242
+
243
+ // Handle the result
244
+ console.log(result);
245
+ }
246
+
247
+ run();
248
+ ```
249
+
250
+ ### Parameters
251
+
252
+ | Parameter | Type | Required | Description |
253
+ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
254
+ | `request` | [operations.CheckTailRequest](../../models/operations/checktailrequest.md) | :heavy_check_mark: | The request object to use for the request. |
255
+ | `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
256
+ | `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. |
257
+ | `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
258
+ | `options.serverURL` | *string* | :heavy_minus_sign: | An optional server URL to use. |
259
+
260
+ ### Response
261
+
262
+ **Promise\<[components.TailResponse](../../models/components/tailresponse.md)\>**
263
+
264
+ ### Errors
265
+
266
+ | Error Type | Status Code | Content Type |
267
+ | --------------------- | --------------------- | --------------------- |
268
+ | errors.ErrorResponse | 400, 401, 404, 409 | application/json |
269
+ | errors.RetryableError | 499 | application/json |
270
+ | errors.RetryableError | 500, 503, 504 | application/json |
271
+ | errors.APIError | 4XX, 5XX | \*/\* |
@@ -8,6 +8,7 @@ Manage streams
8
8
  ### Available Operations
9
9
 
10
10
  * [listStreams](#liststreams) - List streams.
11
+ * [createStream](#createstream) - Create a stream.
11
12
  * [getStreamConfig](#getstreamconfig) - Get stream configuration.
12
13
  * [createOrReconfigureStream](#createorreconfigurestream) - Create or reconfigure a stream.
13
14
  * [deleteStream](#deletestream) - Delete a stream.
@@ -88,7 +89,87 @@ run();
88
89
 
89
90
  | Error Type | Status Code | Content Type |
90
91
  | --------------------- | --------------------- | --------------------- |
91
- | errors.ErrorResponse | 400, 401 | application/json |
92
+ | errors.ErrorResponse | 400, 403, 404 | application/json |
93
+ | errors.RetryableError | 499 | application/json |
94
+ | errors.RetryableError | 500, 503, 504 | application/json |
95
+ | errors.APIError | 4XX, 5XX | \*/\* |
96
+
97
+ ## createStream
98
+
99
+ Create a stream.
100
+
101
+ ### Example Usage
102
+
103
+ ```typescript
104
+ import { S2 } from "@s2-dev/streamstore";
105
+
106
+ const s2 = new S2({
107
+ accessToken: process.env["S2_ACCESS_TOKEN"] ?? "",
108
+ });
109
+
110
+ async function run() {
111
+ const result = await s2.streams.createStream({
112
+ stream: "<value>",
113
+ });
114
+
115
+ // Handle the result
116
+ console.log(result);
117
+ }
118
+
119
+ run();
120
+ ```
121
+
122
+ ### Standalone function
123
+
124
+ The standalone function version of this method:
125
+
126
+ ```typescript
127
+ import { S2Core } from "@s2-dev/streamstore/core.js";
128
+ import { streamsCreateStream } from "@s2-dev/streamstore/funcs/streamsCreateStream.js";
129
+
130
+ // Use `S2Core` for best tree-shaking performance.
131
+ // You can create one instance of it to use across an application.
132
+ const s2 = new S2Core({
133
+ accessToken: process.env["S2_ACCESS_TOKEN"] ?? "",
134
+ });
135
+
136
+ async function run() {
137
+ const res = await streamsCreateStream(s2, {
138
+ stream: "<value>",
139
+ });
140
+
141
+ if (!res.ok) {
142
+ throw res.error;
143
+ }
144
+
145
+ const { value: result } = res;
146
+
147
+ // Handle the result
148
+ console.log(result);
149
+ }
150
+
151
+ run();
152
+ ```
153
+
154
+ ### Parameters
155
+
156
+ | Parameter | Type | Required | Description |
157
+ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
158
+ | `request` | [components.CreateStreamRequest](../../models/components/createstreamrequest.md) | :heavy_check_mark: | The request object to use for the request. |
159
+ | `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
160
+ | `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. |
161
+ | `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
162
+ | `options.serverURL` | *string* | :heavy_minus_sign: | An optional server URL to use. |
163
+
164
+ ### Response
165
+
166
+ **Promise\<[components.StreamInfo](../../models/components/streaminfo.md)\>**
167
+
168
+ ### Errors
169
+
170
+ | Error Type | Status Code | Content Type |
171
+ | --------------------- | --------------------- | --------------------- |
172
+ | errors.ErrorResponse | 400, 403, 404, 409 | application/json |
92
173
  | errors.RetryableError | 499 | application/json |
93
174
  | errors.RetryableError | 500, 503, 504 | application/json |
94
175
  | errors.APIError | 4XX, 5XX | \*/\* |
@@ -168,7 +249,7 @@ run();
168
249
 
169
250
  | Error Type | Status Code | Content Type |
170
251
  | --------------------- | --------------------- | --------------------- |
171
- | errors.ErrorResponse | 400, 401 | application/json |
252
+ | errors.ErrorResponse | 400, 403, 404, 409 | application/json |
172
253
  | errors.RetryableError | 499 | application/json |
173
254
  | errors.RetryableError | 500, 503, 504 | application/json |
174
255
  | errors.APIError | 4XX, 5XX | \*/\* |
@@ -189,7 +270,6 @@ const s2 = new S2({
189
270
  async function run() {
190
271
  const result = await s2.streams.createOrReconfigureStream({
191
272
  stream: "<value>",
192
- streamConfig: {},
193
273
  });
194
274
 
195
275
  // Handle the result
@@ -216,7 +296,6 @@ const s2 = new S2Core({
216
296
  async function run() {
217
297
  const res = await streamsCreateOrReconfigureStream(s2, {
218
298
  stream: "<value>",
219
- streamConfig: {},
220
299
  });
221
300
 
222
301
  if (!res.ok) {
@@ -250,7 +329,7 @@ run();
250
329
 
251
330
  | Error Type | Status Code | Content Type |
252
331
  | --------------------- | --------------------- | --------------------- |
253
- | errors.ErrorResponse | 400, 401 | application/json |
332
+ | errors.ErrorResponse | 400, 403, 404, 409 | application/json |
254
333
  | errors.RetryableError | 499 | application/json |
255
334
  | errors.RetryableError | 500, 503, 504 | application/json |
256
335
  | errors.APIError | 4XX, 5XX | \*/\* |
@@ -328,7 +407,8 @@ run();
328
407
 
329
408
  | Error Type | Status Code | Content Type |
330
409
  | --------------------- | --------------------- | --------------------- |
331
- | errors.ErrorResponse | 400, 401 | application/json |
410
+ | errors.ErrorResponse | 400, 403 | application/json |
411
+ | errors.NotFoundError | 404 | application/json |
332
412
  | errors.RetryableError | 499 | application/json |
333
413
  | errors.RetryableError | 500, 503, 504 | application/json |
334
414
  | errors.APIError | 4XX, 5XX | \*/\* |
@@ -410,7 +490,7 @@ run();
410
490
 
411
491
  | Error Type | Status Code | Content Type |
412
492
  | --------------------- | --------------------- | --------------------- |
413
- | errors.ErrorResponse | 400, 401 | application/json |
493
+ | errors.ErrorResponse | 400, 403, 404, 409 | application/json |
414
494
  | errors.RetryableError | 499 | application/json |
415
495
  | errors.RetryableError | 500, 503, 504 | application/json |
416
496
  | errors.APIError | 4XX, 5XX | \*/\* |
package/jsr.json CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  {
4
4
  "name": "@s2-dev/streamstore",
5
- "version": "0.11.1",
5
+ "version": "0.12.0",
6
6
  "exports": {
7
7
  ".": "./src/index.ts",
8
8
  "./models/errors": "./src/models/errors/index.ts",
@@ -12,6 +12,7 @@
12
12
  "./lib/http": "./src/lib/http.ts",
13
13
  "./lib/retries": "./src/lib/retries.ts",
14
14
  "./lib/sdks": "./src/lib/sdks.ts",
15
+ "./lib/event-streams": "./src/lib/event-streams.ts",
15
16
  "./types": "./src/types/index.ts"
16
17
  },
17
18
  "publish": {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@s2-dev/streamstore",
3
- "version": "0.11.1",
3
+ "version": "0.12.0",
4
4
  "author": "Speakeasy",
5
5
  "type": "module",
6
6
  "bin": {
@@ -127,7 +127,7 @@ async function $do(
127
127
 
128
128
  const doResult = await client._do(req, {
129
129
  context,
130
- errorCodes: ["400", "401", "499", "4XX", "500", "503", "504", "5XX"],
130
+ errorCodes: ["400", "403", "409", "499", "4XX", "500", "503", "504", "5XX"],
131
131
  retryConfig: context.retryConfig,
132
132
  retryCodes: context.retryCodes,
133
133
  });
@@ -154,7 +154,7 @@ async function $do(
154
154
  | ConnectionError
155
155
  >(
156
156
  M.json(201, components.IssueAccessTokenResponse$inboundSchema),
157
- M.jsonErr([400, 401], errors.ErrorResponse$inboundSchema),
157
+ M.jsonErr([400, 403, 409], errors.ErrorResponse$inboundSchema),
158
158
  M.jsonErr(499, errors.RetryableError$inboundSchema),
159
159
  M.jsonErr([500, 503, 504], errors.RetryableError$inboundSchema),
160
160
  M.fail("4XX"),
@@ -134,7 +134,7 @@ async function $do(
134
134
 
135
135
  const doResult = await client._do(req, {
136
136
  context,
137
- errorCodes: ["400", "401", "499", "4XX", "500", "503", "504", "5XX"],
137
+ errorCodes: ["400", "403", "499", "4XX", "500", "503", "504", "5XX"],
138
138
  retryConfig: context.retryConfig,
139
139
  retryCodes: context.retryCodes,
140
140
  });
@@ -161,7 +161,7 @@ async function $do(
161
161
  | ConnectionError
162
162
  >(
163
163
  M.json(200, components.ListAccessTokensResponse$inboundSchema),
164
- M.jsonErr([400, 401], errors.ErrorResponse$inboundSchema),
164
+ M.jsonErr([400, 403], errors.ErrorResponse$inboundSchema),
165
165
  M.jsonErr(499, errors.RetryableError$inboundSchema),
166
166
  M.jsonErr([500, 503, 504], errors.RetryableError$inboundSchema),
167
167
  M.fail("4XX"),