@s2-dev/streamstore 0.11.0 → 0.11.2

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 (290) hide show
  1. package/FUNCTIONS.md +1 -1
  2. package/README.md +19 -14
  3. package/bin/mcp-server.js +359 -124
  4. package/bin/mcp-server.js.map +41 -33
  5. package/dist/commonjs/funcs/accessTokensIssueAccessToken.js +3 -3
  6. package/dist/commonjs/funcs/accessTokensIssueAccessToken.js.map +1 -1
  7. package/dist/commonjs/funcs/accessTokensListAccessTokens.js +3 -3
  8. package/dist/commonjs/funcs/accessTokensListAccessTokens.js.map +1 -1
  9. package/dist/commonjs/funcs/accessTokensRevokeAccessToken.js +3 -3
  10. package/dist/commonjs/funcs/accessTokensRevokeAccessToken.js.map +1 -1
  11. package/dist/commonjs/funcs/basinsCreateOrReconfigureBasin.js +3 -3
  12. package/dist/commonjs/funcs/basinsCreateOrReconfigureBasin.js.map +1 -1
  13. package/dist/commonjs/funcs/basinsDeleteBasin.js +3 -3
  14. package/dist/commonjs/funcs/basinsDeleteBasin.js.map +1 -1
  15. package/dist/commonjs/funcs/basinsGetBasinConfig.js +3 -3
  16. package/dist/commonjs/funcs/basinsGetBasinConfig.js.map +1 -1
  17. package/dist/commonjs/funcs/basinsListBasins.js +3 -3
  18. package/dist/commonjs/funcs/basinsListBasins.js.map +1 -1
  19. package/dist/commonjs/funcs/basinsReconfigureBasin.js +3 -3
  20. package/dist/commonjs/funcs/basinsReconfigureBasin.js.map +1 -1
  21. package/dist/commonjs/funcs/recordsCheckTail.d.ts +18 -0
  22. package/dist/commonjs/funcs/recordsCheckTail.d.ts.map +1 -0
  23. package/dist/commonjs/funcs/recordsCheckTail.js +127 -0
  24. package/dist/commonjs/funcs/recordsCheckTail.js.map +1 -0
  25. package/dist/commonjs/funcs/streamsCreateOrReconfigureStream.js +3 -3
  26. package/dist/commonjs/funcs/streamsCreateOrReconfigureStream.js.map +1 -1
  27. package/dist/commonjs/funcs/streamsDeleteStream.js +3 -3
  28. package/dist/commonjs/funcs/streamsDeleteStream.js.map +1 -1
  29. package/dist/commonjs/funcs/streamsGetStreamConfig.js +3 -3
  30. package/dist/commonjs/funcs/streamsGetStreamConfig.js.map +1 -1
  31. package/dist/commonjs/funcs/streamsListStreams.js +3 -3
  32. package/dist/commonjs/funcs/streamsListStreams.js.map +1 -1
  33. package/dist/commonjs/funcs/streamsReconfigureStream.js +3 -3
  34. package/dist/commonjs/funcs/streamsReconfigureStream.js.map +1 -1
  35. package/dist/commonjs/lib/config.d.ts +4 -4
  36. package/dist/commonjs/lib/config.d.ts.map +1 -1
  37. package/dist/commonjs/lib/config.js +3 -3
  38. package/dist/commonjs/lib/env.d.ts +1 -1
  39. package/dist/commonjs/lib/env.d.ts.map +1 -1
  40. package/dist/commonjs/lib/env.js +1 -1
  41. package/dist/commonjs/lib/env.js.map +1 -1
  42. package/dist/commonjs/lib/sdks.d.ts +3 -1
  43. package/dist/commonjs/lib/sdks.d.ts.map +1 -1
  44. package/dist/commonjs/lib/sdks.js +6 -11
  45. package/dist/commonjs/lib/sdks.js.map +1 -1
  46. package/dist/commonjs/lib/security.js +1 -1
  47. package/dist/commonjs/lib/security.js.map +1 -1
  48. package/dist/commonjs/mcp-server/cli/start/command.js +2 -2
  49. package/dist/commonjs/mcp-server/cli/start/command.js.map +1 -1
  50. package/dist/commonjs/mcp-server/cli/start/impl.d.ts +1 -1
  51. package/dist/commonjs/mcp-server/cli/start/impl.d.ts.map +1 -1
  52. package/dist/commonjs/mcp-server/cli/start/impl.js +2 -2
  53. package/dist/commonjs/mcp-server/cli/start/impl.js.map +1 -1
  54. package/dist/commonjs/mcp-server/mcp-server.js +1 -1
  55. package/dist/commonjs/mcp-server/server.d.ts +1 -1
  56. package/dist/commonjs/mcp-server/server.d.ts.map +1 -1
  57. package/dist/commonjs/mcp-server/server.js +4 -2
  58. package/dist/commonjs/mcp-server/server.js.map +1 -1
  59. package/dist/commonjs/mcp-server/tools/recordsCheckTail.d.ts +8 -0
  60. package/dist/commonjs/mcp-server/tools/recordsCheckTail.d.ts.map +1 -0
  61. package/dist/commonjs/mcp-server/tools/recordsCheckTail.js +65 -0
  62. package/dist/commonjs/mcp-server/tools/recordsCheckTail.js.map +1 -0
  63. package/dist/commonjs/models/components/accesstokeninfo.d.ts +1 -1
  64. package/dist/commonjs/models/components/checktailresponse.d.ts +33 -0
  65. package/dist/commonjs/models/components/checktailresponse.d.ts.map +1 -0
  66. package/dist/commonjs/models/components/checktailresponse.js +70 -0
  67. package/dist/commonjs/models/components/checktailresponse.js.map +1 -0
  68. package/dist/commonjs/models/components/index.d.ts +5 -0
  69. package/dist/commonjs/models/components/index.d.ts.map +1 -1
  70. package/dist/commonjs/models/components/index.js +5 -0
  71. package/dist/commonjs/models/components/index.js.map +1 -1
  72. package/dist/commonjs/models/components/listaccesstokensresponse.d.ts +5 -5
  73. package/dist/commonjs/models/components/listaccesstokensresponse.d.ts.map +1 -1
  74. package/dist/commonjs/models/components/listaccesstokensresponse.js +4 -2
  75. package/dist/commonjs/models/components/listaccesstokensresponse.js.map +1 -1
  76. package/dist/commonjs/models/components/security.d.ts +2 -2
  77. package/dist/commonjs/models/components/security.d.ts.map +1 -1
  78. package/dist/commonjs/models/components/security.js +11 -2
  79. package/dist/commonjs/models/components/security.js.map +1 -1
  80. package/dist/commonjs/models/components/streamconfig.d.ts +3 -18
  81. package/dist/commonjs/models/components/streamconfig.d.ts.map +1 -1
  82. package/dist/commonjs/models/components/streamconfig.js +3 -8
  83. package/dist/commonjs/models/components/streamconfig.js.map +1 -1
  84. package/dist/commonjs/models/components/streamposition.d.ts +43 -0
  85. package/dist/commonjs/models/components/streamposition.d.ts.map +1 -0
  86. package/dist/commonjs/models/components/streamposition.js +80 -0
  87. package/dist/commonjs/models/components/streamposition.js.map +1 -0
  88. package/dist/commonjs/models/components/streamreconfiguration.d.ts +3 -18
  89. package/dist/commonjs/models/components/streamreconfiguration.d.ts.map +1 -1
  90. package/dist/commonjs/models/components/streamreconfiguration.js +3 -8
  91. package/dist/commonjs/models/components/streamreconfiguration.js.map +1 -1
  92. package/dist/commonjs/models/components/timestampingconfig.d.ts +38 -0
  93. package/dist/commonjs/models/components/timestampingconfig.d.ts.map +1 -0
  94. package/dist/commonjs/models/components/timestampingconfig.js +72 -0
  95. package/dist/commonjs/models/components/timestampingconfig.js.map +1 -0
  96. package/dist/commonjs/models/components/timestampingmode.d.ts +31 -0
  97. package/dist/commonjs/models/components/timestampingmode.d.ts.map +1 -0
  98. package/dist/commonjs/models/components/timestampingmode.js +61 -0
  99. package/dist/commonjs/models/components/timestampingmode.js.map +1 -0
  100. package/dist/commonjs/models/components/timestampingreconfiguration.d.ts +35 -0
  101. package/dist/commonjs/models/components/timestampingreconfiguration.d.ts.map +1 -0
  102. package/dist/commonjs/models/components/timestampingreconfiguration.js +72 -0
  103. package/dist/commonjs/models/components/timestampingreconfiguration.js.map +1 -0
  104. package/dist/commonjs/models/operations/checktail.d.ts +37 -0
  105. package/dist/commonjs/models/operations/checktail.d.ts.map +1 -0
  106. package/dist/commonjs/models/operations/checktail.js +75 -0
  107. package/dist/commonjs/models/operations/checktail.js.map +1 -0
  108. package/dist/commonjs/models/operations/index.d.ts +1 -0
  109. package/dist/commonjs/models/operations/index.d.ts.map +1 -1
  110. package/dist/commonjs/models/operations/index.js +1 -0
  111. package/dist/commonjs/models/operations/index.js.map +1 -1
  112. package/dist/commonjs/models/operations/liststreams.d.ts +1 -1
  113. package/dist/commonjs/models/operations/liststreams.d.ts.map +1 -1
  114. package/dist/commonjs/models/operations/liststreams.js +1 -1
  115. package/dist/commonjs/models/operations/liststreams.js.map +1 -1
  116. package/dist/commonjs/models/operations/revokeaccesstoken.d.ts +1 -1
  117. package/dist/commonjs/sdk/records.d.ts +13 -0
  118. package/dist/commonjs/sdk/records.d.ts.map +1 -0
  119. package/dist/commonjs/sdk/records.js +22 -0
  120. package/dist/commonjs/sdk/records.js.map +1 -0
  121. package/dist/commonjs/sdk/sdk.d.ts +3 -0
  122. package/dist/commonjs/sdk/sdk.d.ts.map +1 -1
  123. package/dist/commonjs/sdk/sdk.js +4 -0
  124. package/dist/commonjs/sdk/sdk.js.map +1 -1
  125. package/dist/esm/funcs/accessTokensIssueAccessToken.js +3 -3
  126. package/dist/esm/funcs/accessTokensIssueAccessToken.js.map +1 -1
  127. package/dist/esm/funcs/accessTokensListAccessTokens.js +3 -3
  128. package/dist/esm/funcs/accessTokensListAccessTokens.js.map +1 -1
  129. package/dist/esm/funcs/accessTokensRevokeAccessToken.js +3 -3
  130. package/dist/esm/funcs/accessTokensRevokeAccessToken.js.map +1 -1
  131. package/dist/esm/funcs/basinsCreateOrReconfigureBasin.js +3 -3
  132. package/dist/esm/funcs/basinsCreateOrReconfigureBasin.js.map +1 -1
  133. package/dist/esm/funcs/basinsDeleteBasin.js +3 -3
  134. package/dist/esm/funcs/basinsDeleteBasin.js.map +1 -1
  135. package/dist/esm/funcs/basinsGetBasinConfig.js +3 -3
  136. package/dist/esm/funcs/basinsGetBasinConfig.js.map +1 -1
  137. package/dist/esm/funcs/basinsListBasins.js +3 -3
  138. package/dist/esm/funcs/basinsListBasins.js.map +1 -1
  139. package/dist/esm/funcs/basinsReconfigureBasin.js +3 -3
  140. package/dist/esm/funcs/basinsReconfigureBasin.js.map +1 -1
  141. package/dist/esm/funcs/recordsCheckTail.d.ts +18 -0
  142. package/dist/esm/funcs/recordsCheckTail.d.ts.map +1 -0
  143. package/dist/esm/funcs/recordsCheckTail.js +91 -0
  144. package/dist/esm/funcs/recordsCheckTail.js.map +1 -0
  145. package/dist/esm/funcs/streamsCreateOrReconfigureStream.js +3 -3
  146. package/dist/esm/funcs/streamsCreateOrReconfigureStream.js.map +1 -1
  147. package/dist/esm/funcs/streamsDeleteStream.js +3 -3
  148. package/dist/esm/funcs/streamsDeleteStream.js.map +1 -1
  149. package/dist/esm/funcs/streamsGetStreamConfig.js +3 -3
  150. package/dist/esm/funcs/streamsGetStreamConfig.js.map +1 -1
  151. package/dist/esm/funcs/streamsListStreams.js +3 -3
  152. package/dist/esm/funcs/streamsListStreams.js.map +1 -1
  153. package/dist/esm/funcs/streamsReconfigureStream.js +3 -3
  154. package/dist/esm/funcs/streamsReconfigureStream.js.map +1 -1
  155. package/dist/esm/lib/config.d.ts +4 -4
  156. package/dist/esm/lib/config.d.ts.map +1 -1
  157. package/dist/esm/lib/config.js +3 -3
  158. package/dist/esm/lib/env.d.ts +1 -1
  159. package/dist/esm/lib/env.d.ts.map +1 -1
  160. package/dist/esm/lib/env.js +1 -1
  161. package/dist/esm/lib/env.js.map +1 -1
  162. package/dist/esm/lib/sdks.d.ts +3 -1
  163. package/dist/esm/lib/sdks.d.ts.map +1 -1
  164. package/dist/esm/lib/sdks.js +6 -11
  165. package/dist/esm/lib/sdks.js.map +1 -1
  166. package/dist/esm/lib/security.js +1 -1
  167. package/dist/esm/lib/security.js.map +1 -1
  168. package/dist/esm/mcp-server/cli/start/command.js +2 -2
  169. package/dist/esm/mcp-server/cli/start/command.js.map +1 -1
  170. package/dist/esm/mcp-server/cli/start/impl.d.ts +1 -1
  171. package/dist/esm/mcp-server/cli/start/impl.d.ts.map +1 -1
  172. package/dist/esm/mcp-server/cli/start/impl.js +2 -2
  173. package/dist/esm/mcp-server/cli/start/impl.js.map +1 -1
  174. package/dist/esm/mcp-server/mcp-server.js +1 -1
  175. package/dist/esm/mcp-server/server.d.ts +1 -1
  176. package/dist/esm/mcp-server/server.d.ts.map +1 -1
  177. package/dist/esm/mcp-server/server.js +4 -2
  178. package/dist/esm/mcp-server/server.js.map +1 -1
  179. package/dist/esm/mcp-server/tools/recordsCheckTail.d.ts +8 -0
  180. package/dist/esm/mcp-server/tools/recordsCheckTail.d.ts.map +1 -0
  181. package/dist/esm/mcp-server/tools/recordsCheckTail.js +29 -0
  182. package/dist/esm/mcp-server/tools/recordsCheckTail.js.map +1 -0
  183. package/dist/esm/models/components/accesstokeninfo.d.ts +1 -1
  184. package/dist/esm/models/components/checktailresponse.d.ts +33 -0
  185. package/dist/esm/models/components/checktailresponse.d.ts.map +1 -0
  186. package/dist/esm/models/components/checktailresponse.js +32 -0
  187. package/dist/esm/models/components/checktailresponse.js.map +1 -0
  188. package/dist/esm/models/components/index.d.ts +5 -0
  189. package/dist/esm/models/components/index.d.ts.map +1 -1
  190. package/dist/esm/models/components/index.js +5 -0
  191. package/dist/esm/models/components/index.js.map +1 -1
  192. package/dist/esm/models/components/listaccesstokensresponse.d.ts +5 -5
  193. package/dist/esm/models/components/listaccesstokensresponse.d.ts.map +1 -1
  194. package/dist/esm/models/components/listaccesstokensresponse.js +4 -2
  195. package/dist/esm/models/components/listaccesstokensresponse.js.map +1 -1
  196. package/dist/esm/models/components/security.d.ts +2 -2
  197. package/dist/esm/models/components/security.d.ts.map +1 -1
  198. package/dist/esm/models/components/security.js +11 -2
  199. package/dist/esm/models/components/security.js.map +1 -1
  200. package/dist/esm/models/components/streamconfig.d.ts +3 -18
  201. package/dist/esm/models/components/streamconfig.d.ts.map +1 -1
  202. package/dist/esm/models/components/streamconfig.js +3 -8
  203. package/dist/esm/models/components/streamconfig.js.map +1 -1
  204. package/dist/esm/models/components/streamposition.d.ts +43 -0
  205. package/dist/esm/models/components/streamposition.d.ts.map +1 -0
  206. package/dist/esm/models/components/streamposition.js +42 -0
  207. package/dist/esm/models/components/streamposition.js.map +1 -0
  208. package/dist/esm/models/components/streamreconfiguration.d.ts +3 -18
  209. package/dist/esm/models/components/streamreconfiguration.d.ts.map +1 -1
  210. package/dist/esm/models/components/streamreconfiguration.js +3 -8
  211. package/dist/esm/models/components/streamreconfiguration.js.map +1 -1
  212. package/dist/esm/models/components/timestampingconfig.d.ts +38 -0
  213. package/dist/esm/models/components/timestampingconfig.d.ts.map +1 -0
  214. package/dist/esm/models/components/timestampingconfig.js +34 -0
  215. package/dist/esm/models/components/timestampingconfig.js.map +1 -0
  216. package/dist/esm/models/components/timestampingmode.d.ts +31 -0
  217. package/dist/esm/models/components/timestampingmode.d.ts.map +1 -0
  218. package/dist/esm/models/components/timestampingmode.js +25 -0
  219. package/dist/esm/models/components/timestampingmode.js.map +1 -0
  220. package/dist/esm/models/components/timestampingreconfiguration.d.ts +35 -0
  221. package/dist/esm/models/components/timestampingreconfiguration.d.ts.map +1 -0
  222. package/dist/esm/models/components/timestampingreconfiguration.js +34 -0
  223. package/dist/esm/models/components/timestampingreconfiguration.js.map +1 -0
  224. package/dist/esm/models/operations/checktail.d.ts +37 -0
  225. package/dist/esm/models/operations/checktail.d.ts.map +1 -0
  226. package/dist/esm/models/operations/checktail.js +37 -0
  227. package/dist/esm/models/operations/checktail.js.map +1 -0
  228. package/dist/esm/models/operations/index.d.ts +1 -0
  229. package/dist/esm/models/operations/index.d.ts.map +1 -1
  230. package/dist/esm/models/operations/index.js +1 -0
  231. package/dist/esm/models/operations/index.js.map +1 -1
  232. package/dist/esm/models/operations/liststreams.d.ts +1 -1
  233. package/dist/esm/models/operations/liststreams.d.ts.map +1 -1
  234. package/dist/esm/models/operations/liststreams.js +1 -1
  235. package/dist/esm/models/operations/liststreams.js.map +1 -1
  236. package/dist/esm/models/operations/revokeaccesstoken.d.ts +1 -1
  237. package/dist/esm/sdk/records.d.ts +13 -0
  238. package/dist/esm/sdk/records.d.ts.map +1 -0
  239. package/dist/esm/sdk/records.js +18 -0
  240. package/dist/esm/sdk/records.js.map +1 -0
  241. package/dist/esm/sdk/sdk.d.ts +3 -0
  242. package/dist/esm/sdk/sdk.d.ts.map +1 -1
  243. package/dist/esm/sdk/sdk.js +4 -0
  244. package/dist/esm/sdk/sdk.js.map +1 -1
  245. package/docs/sdks/accesstokens/README.md +6 -6
  246. package/docs/sdks/basins/README.md +10 -10
  247. package/docs/sdks/records/README.md +90 -0
  248. package/docs/sdks/streams/README.md +22 -14
  249. package/jsr.json +1 -1
  250. package/package.json +1 -1
  251. package/src/funcs/accessTokensIssueAccessToken.ts +3 -3
  252. package/src/funcs/accessTokensListAccessTokens.ts +3 -3
  253. package/src/funcs/accessTokensRevokeAccessToken.ts +3 -3
  254. package/src/funcs/basinsCreateOrReconfigureBasin.ts +3 -3
  255. package/src/funcs/basinsDeleteBasin.ts +3 -3
  256. package/src/funcs/basinsGetBasinConfig.ts +3 -3
  257. package/src/funcs/basinsListBasins.ts +3 -3
  258. package/src/funcs/basinsReconfigureBasin.ts +3 -3
  259. package/src/funcs/recordsCheckTail.ts +184 -0
  260. package/src/funcs/streamsCreateOrReconfigureStream.ts +3 -3
  261. package/src/funcs/streamsDeleteStream.ts +3 -3
  262. package/src/funcs/streamsGetStreamConfig.ts +3 -3
  263. package/src/funcs/streamsListStreams.ts +3 -3
  264. package/src/funcs/streamsReconfigureStream.ts +3 -3
  265. package/src/lib/config.ts +4 -4
  266. package/src/lib/env.ts +2 -2
  267. package/src/lib/sdks.ts +11 -11
  268. package/src/lib/security.ts +1 -1
  269. package/src/mcp-server/cli/start/command.ts +2 -2
  270. package/src/mcp-server/cli/start/impl.ts +3 -3
  271. package/src/mcp-server/mcp-server.ts +1 -1
  272. package/src/mcp-server/server.ts +5 -3
  273. package/src/mcp-server/tools/recordsCheckTail.ts +38 -0
  274. package/src/models/components/accesstokeninfo.ts +1 -1
  275. package/src/models/components/checktailresponse.ts +75 -0
  276. package/src/models/components/index.ts +5 -0
  277. package/src/models/components/listaccesstokensresponse.ts +9 -7
  278. package/src/models/components/security.ts +13 -4
  279. package/src/models/components/streamconfig.ts +10 -26
  280. package/src/models/components/streamposition.ts +87 -0
  281. package/src/models/components/streamreconfiguration.ts +10 -26
  282. package/src/models/components/timestampingconfig.ts +81 -0
  283. package/src/models/components/timestampingmode.ts +34 -0
  284. package/src/models/components/timestampingreconfiguration.ts +80 -0
  285. package/src/models/operations/checktail.ts +80 -0
  286. package/src/models/operations/index.ts +1 -0
  287. package/src/models/operations/liststreams.ts +1 -1
  288. package/src/models/operations/revokeaccesstoken.ts +1 -1
  289. package/src/sdk/records.ts +28 -0
  290. package/src/sdk/sdk.ts +6 -0
@@ -109,8 +109,8 @@ async function $do(
109
109
  Accept: "application/json",
110
110
  }));
111
111
 
112
- const secConfig = await extractSecurity(client._options.bearerAuth);
113
- const securityInput = secConfig == null ? {} : { bearerAuth: secConfig };
112
+ const secConfig = await extractSecurity(client._options.accessToken);
113
+ const securityInput = secConfig == null ? {} : { accessToken: secConfig };
114
114
  const requestSecurity = resolveGlobalSecurity(securityInput);
115
115
 
116
116
  const context = {
@@ -120,7 +120,7 @@ async function $do(
120
120
 
121
121
  resolvedSecurity: requestSecurity,
122
122
 
123
- securitySource: client._options.bearerAuth,
123
+ securitySource: client._options.accessToken,
124
124
  retryConfig: options?.retries
125
125
  || client._options.retryConfig
126
126
  || { strategy: "none" },
package/src/lib/config.ts CHANGED
@@ -15,7 +15,7 @@ export const ServerList = [
15
15
  ] as const;
16
16
 
17
17
  export type SDKOptions = {
18
- bearerAuth?: string | (() => Promise<string>) | undefined;
18
+ accessToken?: string | (() => Promise<string>) | undefined;
19
19
 
20
20
  httpClient?: HTTPClient;
21
21
  /**
@@ -54,8 +54,8 @@ export function serverURLFromOptions(options: SDKOptions): URL | null {
54
54
  export const SDK_METADATA = {
55
55
  language: "typescript",
56
56
  openapiDocVersion: "1.0.0",
57
- sdkVersion: "0.11.0",
58
- genVersion: "2.593.4",
57
+ sdkVersion: "0.11.2",
58
+ genVersion: "2.597.9",
59
59
  userAgent:
60
- "speakeasy-sdk/typescript 0.11.0 2.593.4 1.0.0 @s2-dev/streamstore",
60
+ "speakeasy-sdk/typescript 0.11.2 2.597.9 1.0.0 @s2-dev/streamstore",
61
61
  } as const;
package/src/lib/env.ts CHANGED
@@ -7,13 +7,13 @@ import { dlv } from "./dlv.js";
7
7
  import * as z from "zod";
8
8
 
9
9
  export interface Env {
10
- S2_BEARER_AUTH?: string | undefined;
10
+ S2_ACCESS_TOKEN?: string | undefined;
11
11
 
12
12
  S2_DEBUG?: boolean | undefined;
13
13
  }
14
14
 
15
15
  export const envSchema: z.ZodType<Env, z.ZodTypeDef, unknown> = z.object({
16
- S2_BEARER_AUTH: z.string().optional(),
16
+ S2_ACCESS_TOKEN: z.string().optional(),
17
17
 
18
18
  S2_DEBUG: z.coerce.boolean().optional(),
19
19
  });
package/src/lib/sdks.ts CHANGED
@@ -47,12 +47,14 @@ export type RequestOptions = {
47
47
  */
48
48
  serverURL?: string | URL;
49
49
  /**
50
+ * @deprecated `fetchOptions` has been flattened into `RequestOptions`.
51
+ *
50
52
  * Sets various request options on the `fetch` call made by an SDK method.
51
53
  *
52
54
  * @see {@link https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options|Request}
53
55
  */
54
56
  fetchOptions?: Omit<RequestInit, "method" | "body">;
55
- };
57
+ } & Omit<RequestInit, "method" | "body">;
56
58
 
57
59
  type RequestConfig = {
58
60
  method: string;
@@ -172,7 +174,9 @@ export class ClientSDK {
172
174
  cookie = cookie.startsWith("; ") ? cookie.slice(2) : cookie;
173
175
  headers.set("cookie", cookie);
174
176
 
175
- const userHeaders = new Headers(options?.fetchOptions?.headers);
177
+ const userHeaders = new Headers(
178
+ options?.headers ?? options?.fetchOptions?.headers,
179
+ );
176
180
  for (const [k, v] of userHeaders) {
177
181
  headers.set(k, v);
178
182
  }
@@ -183,20 +187,16 @@ export class ClientSDK {
183
187
  headers.set(conf.uaHeader ?? "user-agent", SDK_METADATA.userAgent);
184
188
  }
185
189
 
186
- let fetchOptions = options?.fetchOptions;
190
+ const fetchOptions: Omit<RequestInit, "method" | "body"> = {
191
+ ...options?.fetchOptions,
192
+ ...options,
193
+ };
187
194
  if (!fetchOptions?.signal && conf.timeoutMs && conf.timeoutMs > 0) {
188
195
  const timeoutSignal = AbortSignal.timeout(conf.timeoutMs);
189
- if (!fetchOptions) {
190
- fetchOptions = { signal: timeoutSignal };
191
- } else {
192
- fetchOptions.signal = timeoutSignal;
193
- }
196
+ fetchOptions.signal = timeoutSignal;
194
197
  }
195
198
 
196
199
  if (conf.body instanceof ReadableStream) {
197
- if (!fetchOptions) {
198
- fetchOptions = {};
199
- }
200
200
  Object.assign(fetchOptions, { duplex: "half" });
201
201
  }
202
202
 
@@ -244,7 +244,7 @@ export function resolveGlobalSecurity(
244
244
  {
245
245
  fieldName: "Authorization",
246
246
  type: "http:bearer",
247
- value: security?.bearerAuth ?? env().S2_BEARER_AUTH,
247
+ value: security?.accessToken ?? env().S2_ACCESS_TOKEN,
248
248
  },
249
249
  ],
250
250
  );
@@ -49,9 +49,9 @@ export const startCommand = buildCommand({
49
49
  },
50
50
  }
51
51
  : {}),
52
- "bearer-auth": {
52
+ "access-token": {
53
53
  kind: "parsed",
54
- brief: "Sets the bearerAuth auth field for the API",
54
+ brief: "Sets the accessToken auth field for the API",
55
55
  optional: true,
56
56
  parse: (value) => {
57
57
  return z.string().parse(value);
@@ -19,7 +19,7 @@ interface StartCommandFlags {
19
19
  readonly port: number;
20
20
  readonly tool?: string[];
21
21
  readonly scope?: MCPScope[];
22
- readonly "bearer-auth"?: string | undefined;
22
+ readonly "access-token"?: string | undefined;
23
23
  readonly "server-url"?: string;
24
24
  readonly "server-index"?: SDKOptions["serverIdx"];
25
25
  readonly "log-level": ConsoleLoggerLevel;
@@ -50,7 +50,7 @@ async function startStdio(flags: StartCommandFlags) {
50
50
  logger,
51
51
  allowedTools: flags.tool,
52
52
  scopes: flags.scope,
53
- ...{ bearerAuth: flags["bearer-auth"] },
53
+ ...{ accessToken: flags["access-token"] },
54
54
  serverURL: flags["server-url"],
55
55
  serverIdx: flags["server-index"],
56
56
  });
@@ -71,7 +71,7 @@ async function startSSE(flags: StartCommandFlags) {
71
71
  logger,
72
72
  allowedTools: flags.tool,
73
73
  scopes: flags.scope,
74
- ...{ bearerAuth: flags["bearer-auth"] },
74
+ ...{ accessToken: flags["access-token"] },
75
75
  serverURL: flags["server-url"],
76
76
  serverIdx: flags["server-index"],
77
77
  });
@@ -19,7 +19,7 @@ const routes = buildRouteMap({
19
19
  export const app = buildApplication(routes, {
20
20
  name: "mcp",
21
21
  versionInfo: {
22
- currentVersion: "0.11.0",
22
+ currentVersion: "0.11.2",
23
23
  },
24
24
  });
25
25
 
@@ -21,6 +21,7 @@ import { tool$basinsDeleteBasin } from "./tools/basinsDeleteBasin.js";
21
21
  import { tool$basinsGetBasinConfig } from "./tools/basinsGetBasinConfig.js";
22
22
  import { tool$basinsListBasins } from "./tools/basinsListBasins.js";
23
23
  import { tool$basinsReconfigureBasin } from "./tools/basinsReconfigureBasin.js";
24
+ import { tool$recordsCheckTail } from "./tools/recordsCheckTail.js";
24
25
  import { tool$streamsCreateOrReconfigureStream } from "./tools/streamsCreateOrReconfigureStream.js";
25
26
  import { tool$streamsDeleteStream } from "./tools/streamsDeleteStream.js";
26
27
  import { tool$streamsGetStreamConfig } from "./tools/streamsGetStreamConfig.js";
@@ -32,16 +33,16 @@ export function createMCPServer(deps: {
32
33
  allowedTools?: string[] | undefined;
33
34
  scopes?: MCPScope[] | undefined;
34
35
  serverURL?: string | undefined;
35
- bearerAuth?: SDKOptions["bearerAuth"] | undefined;
36
+ accessToken?: SDKOptions["accessToken"] | undefined;
36
37
  serverIdx?: SDKOptions["serverIdx"] | undefined;
37
38
  }) {
38
39
  const server = new McpServer({
39
40
  name: "S2",
40
- version: "0.11.0",
41
+ version: "0.11.2",
41
42
  });
42
43
 
43
44
  const client = new S2Core({
44
- bearerAuth: deps.bearerAuth,
45
+ accessToken: deps.accessToken,
45
46
  serverURL: deps.serverURL,
46
47
  serverIdx: deps.serverIdx,
47
48
  });
@@ -80,6 +81,7 @@ export function createMCPServer(deps: {
80
81
  tool(tool$streamsCreateOrReconfigureStream);
81
82
  tool(tool$streamsDeleteStream);
82
83
  tool(tool$streamsReconfigureStream);
84
+ tool(tool$recordsCheckTail);
83
85
 
84
86
  return server;
85
87
  }
@@ -0,0 +1,38 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import { recordsCheckTail } from "../../funcs/recordsCheckTail.js";
6
+ import * as operations from "../../models/operations/index.js";
7
+ import { formatResult, ToolDefinition } from "../tools.js";
8
+
9
+ const args = {
10
+ request: operations.CheckTailRequest$inboundSchema,
11
+ };
12
+
13
+ export const tool$recordsCheckTail: ToolDefinition<typeof args> = {
14
+ name: "records-check-tail",
15
+ description: `Check the tail.
16
+
17
+ Check the tail of a stream.`,
18
+ scopes: ["read"],
19
+ args,
20
+ tool: async (client, args, ctx) => {
21
+ const [result, apiCall] = await recordsCheckTail(
22
+ client,
23
+ args.request,
24
+ { fetchOptions: { signal: ctx.signal } },
25
+ ).$inspect();
26
+
27
+ if (!result.ok) {
28
+ return {
29
+ content: [{ type: "text", text: result.error.message }],
30
+ isError: true,
31
+ };
32
+ }
33
+
34
+ const value = result.value;
35
+
36
+ return formatResult(value, apiCall);
37
+ },
38
+ };
@@ -34,7 +34,7 @@ export type AccessTokenInfo = {
34
34
  * Access token ID.
35
35
  *
36
36
  * @remarks
37
- * It must be unique to the account and between 1 and 50 characters.
37
+ * It must be unique to the account and between 1 and 96 characters.
38
38
  */
39
39
  id: string;
40
40
  scope: AccessTokenScope;
@@ -0,0 +1,75 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import * as z from "zod";
6
+ import { safeParse } from "../../lib/schemas.js";
7
+ import { Result as SafeParseResult } from "../../types/fp.js";
8
+ import { SDKValidationError } from "../errors/sdkvalidationerror.js";
9
+ import {
10
+ StreamPosition,
11
+ StreamPosition$inboundSchema,
12
+ StreamPosition$Outbound,
13
+ StreamPosition$outboundSchema,
14
+ } from "./streamposition.js";
15
+
16
+ export type CheckTailResponse = {
17
+ /**
18
+ * Position of a record in a stream.
19
+ */
20
+ tail: StreamPosition;
21
+ };
22
+
23
+ /** @internal */
24
+ export const CheckTailResponse$inboundSchema: z.ZodType<
25
+ CheckTailResponse,
26
+ z.ZodTypeDef,
27
+ unknown
28
+ > = z.object({
29
+ tail: StreamPosition$inboundSchema,
30
+ });
31
+
32
+ /** @internal */
33
+ export type CheckTailResponse$Outbound = {
34
+ tail: StreamPosition$Outbound;
35
+ };
36
+
37
+ /** @internal */
38
+ export const CheckTailResponse$outboundSchema: z.ZodType<
39
+ CheckTailResponse$Outbound,
40
+ z.ZodTypeDef,
41
+ CheckTailResponse
42
+ > = z.object({
43
+ tail: StreamPosition$outboundSchema,
44
+ });
45
+
46
+ /**
47
+ * @internal
48
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
49
+ */
50
+ export namespace CheckTailResponse$ {
51
+ /** @deprecated use `CheckTailResponse$inboundSchema` instead. */
52
+ export const inboundSchema = CheckTailResponse$inboundSchema;
53
+ /** @deprecated use `CheckTailResponse$outboundSchema` instead. */
54
+ export const outboundSchema = CheckTailResponse$outboundSchema;
55
+ /** @deprecated use `CheckTailResponse$Outbound` instead. */
56
+ export type Outbound = CheckTailResponse$Outbound;
57
+ }
58
+
59
+ export function checkTailResponseToJSON(
60
+ checkTailResponse: CheckTailResponse,
61
+ ): string {
62
+ return JSON.stringify(
63
+ CheckTailResponse$outboundSchema.parse(checkTailResponse),
64
+ );
65
+ }
66
+
67
+ export function checkTailResponseFromJSON(
68
+ jsonString: string,
69
+ ): SafeParseResult<CheckTailResponse, SDKValidationError> {
70
+ return safeParse(
71
+ jsonString,
72
+ (x) => CheckTailResponse$inboundSchema.parse(JSON.parse(x)),
73
+ `Failed to parse 'CheckTailResponse' from JSON`,
74
+ );
75
+ }
@@ -9,6 +9,7 @@ export * from "./basininfo.js";
9
9
  export * from "./basinreconfiguration.js";
10
10
  export * from "./basinscope.js";
11
11
  export * from "./basinstate.js";
12
+ export * from "./checktailresponse.js";
12
13
  export * from "./createbasinrequest.js";
13
14
  export * from "./issueaccesstokenresponse.js";
14
15
  export * from "./listaccesstokensresponse.js";
@@ -23,4 +24,8 @@ export * from "./security.js";
23
24
  export * from "./storageclass.js";
24
25
  export * from "./streamconfig.js";
25
26
  export * from "./streaminfo.js";
27
+ export * from "./streamposition.js";
26
28
  export * from "./streamreconfiguration.js";
29
+ export * from "./timestampingconfig.js";
30
+ export * from "./timestampingmode.js";
31
+ export * from "./timestampingreconfiguration.js";
@@ -16,13 +16,13 @@ import {
16
16
 
17
17
  export type ListAccessTokensResponse = {
18
18
  /**
19
- * If set, indicates there are more results that can be listed with `start_after`.
19
+ * Access tokens information.
20
20
  */
21
- hasMore: boolean;
21
+ accessTokens: Array<AccessTokenInfo>;
22
22
  /**
23
- * Access tokens information.
23
+ * If set, indicates there are more results that can be listed with `start_after`.
24
24
  */
25
- tokens: Array<AccessTokenInfo>;
25
+ hasMore: boolean;
26
26
  };
27
27
 
28
28
  /** @internal */
@@ -31,18 +31,19 @@ export const ListAccessTokensResponse$inboundSchema: z.ZodType<
31
31
  z.ZodTypeDef,
32
32
  unknown
33
33
  > = z.object({
34
+ access_tokens: z.array(AccessTokenInfo$inboundSchema),
34
35
  has_more: z.boolean(),
35
- tokens: z.array(AccessTokenInfo$inboundSchema),
36
36
  }).transform((v) => {
37
37
  return remap$(v, {
38
+ "access_tokens": "accessTokens",
38
39
  "has_more": "hasMore",
39
40
  });
40
41
  });
41
42
 
42
43
  /** @internal */
43
44
  export type ListAccessTokensResponse$Outbound = {
45
+ access_tokens: Array<AccessTokenInfo$Outbound>;
44
46
  has_more: boolean;
45
- tokens: Array<AccessTokenInfo$Outbound>;
46
47
  };
47
48
 
48
49
  /** @internal */
@@ -51,10 +52,11 @@ export const ListAccessTokensResponse$outboundSchema: z.ZodType<
51
52
  z.ZodTypeDef,
52
53
  ListAccessTokensResponse
53
54
  > = z.object({
55
+ accessTokens: z.array(AccessTokenInfo$outboundSchema),
54
56
  hasMore: z.boolean(),
55
- tokens: z.array(AccessTokenInfo$outboundSchema),
56
57
  }).transform((v) => {
57
58
  return remap$(v, {
59
+ accessTokens: "access_tokens",
58
60
  hasMore: "has_more",
59
61
  });
60
62
  });
@@ -3,12 +3,13 @@
3
3
  */
4
4
 
5
5
  import * as z from "zod";
6
+ import { remap as remap$ } from "../../lib/primitives.js";
6
7
  import { safeParse } from "../../lib/schemas.js";
7
8
  import { Result as SafeParseResult } from "../../types/fp.js";
8
9
  import { SDKValidationError } from "../errors/sdkvalidationerror.js";
9
10
 
10
11
  export type Security = {
11
- bearerAuth?: string | undefined;
12
+ accessToken?: string | undefined;
12
13
  };
13
14
 
14
15
  /** @internal */
@@ -17,12 +18,16 @@ export const Security$inboundSchema: z.ZodType<
17
18
  z.ZodTypeDef,
18
19
  unknown
19
20
  > = z.object({
20
- bearerAuth: z.string().optional(),
21
+ access_token: z.string().optional(),
22
+ }).transform((v) => {
23
+ return remap$(v, {
24
+ "access_token": "accessToken",
25
+ });
21
26
  });
22
27
 
23
28
  /** @internal */
24
29
  export type Security$Outbound = {
25
- bearerAuth?: string | undefined;
30
+ access_token?: string | undefined;
26
31
  };
27
32
 
28
33
  /** @internal */
@@ -31,7 +36,11 @@ export const Security$outboundSchema: z.ZodType<
31
36
  z.ZodTypeDef,
32
37
  Security
33
38
  > = z.object({
34
- bearerAuth: z.string().optional(),
39
+ accessToken: z.string().optional(),
40
+ }).transform((v) => {
41
+ return remap$(v, {
42
+ accessToken: "access_token",
43
+ });
35
44
  });
36
45
 
37
46
  /**
@@ -18,26 +18,17 @@ import {
18
18
  StorageClass$inboundSchema,
19
19
  StorageClass$outboundSchema,
20
20
  } from "./storageclass.js";
21
+ import {
22
+ TimestampingConfig,
23
+ TimestampingConfig$inboundSchema,
24
+ TimestampingConfig$Outbound,
25
+ TimestampingConfig$outboundSchema,
26
+ } from "./timestampingconfig.js";
21
27
 
22
28
  export type StreamConfig = {
23
- /**
24
- * Controls how to handle timestamps when they are not provided by the client.
25
- *
26
- * @remarks
27
- * If this is false (or not set), the record's arrival time in milliseconds since Unix epoch
28
- * will be assigned as its timestamp. If this is true, then any append without a
29
- * client-specified timestamp will be rejected as invalid.
30
- */
31
- requireClientTimestamps?: boolean | null | undefined;
32
29
  retentionPolicy?: RetentionPolicy | null | undefined;
33
30
  storageClass?: StorageClass | null | undefined;
34
- /**
35
- * Allow client timestamps to exceed the arrival time in milliseconds since Unix epoch.
36
- *
37
- * @remarks
38
- * If this is false (or not set), client timestamps will be capped at the arrival time.
39
- */
40
- uncappedClientTimestamps?: boolean | null | undefined;
31
+ timestamping: TimestampingConfig;
41
32
  };
42
33
 
43
34
  /** @internal */
@@ -46,25 +37,21 @@ export const StreamConfig$inboundSchema: z.ZodType<
46
37
  z.ZodTypeDef,
47
38
  unknown
48
39
  > = z.object({
49
- require_client_timestamps: z.nullable(z.boolean()).optional(),
50
40
  retention_policy: z.nullable(RetentionPolicy$inboundSchema).optional(),
51
41
  storage_class: z.nullable(StorageClass$inboundSchema).optional(),
52
- uncapped_client_timestamps: z.nullable(z.boolean()).optional(),
42
+ timestamping: TimestampingConfig$inboundSchema,
53
43
  }).transform((v) => {
54
44
  return remap$(v, {
55
- "require_client_timestamps": "requireClientTimestamps",
56
45
  "retention_policy": "retentionPolicy",
57
46
  "storage_class": "storageClass",
58
- "uncapped_client_timestamps": "uncappedClientTimestamps",
59
47
  });
60
48
  });
61
49
 
62
50
  /** @internal */
63
51
  export type StreamConfig$Outbound = {
64
- require_client_timestamps?: boolean | null | undefined;
65
52
  retention_policy?: RetentionPolicy$Outbound | null | undefined;
66
53
  storage_class?: string | null | undefined;
67
- uncapped_client_timestamps?: boolean | null | undefined;
54
+ timestamping: TimestampingConfig$Outbound;
68
55
  };
69
56
 
70
57
  /** @internal */
@@ -73,16 +60,13 @@ export const StreamConfig$outboundSchema: z.ZodType<
73
60
  z.ZodTypeDef,
74
61
  StreamConfig
75
62
  > = z.object({
76
- requireClientTimestamps: z.nullable(z.boolean()).optional(),
77
63
  retentionPolicy: z.nullable(RetentionPolicy$outboundSchema).optional(),
78
64
  storageClass: z.nullable(StorageClass$outboundSchema).optional(),
79
- uncappedClientTimestamps: z.nullable(z.boolean()).optional(),
65
+ timestamping: TimestampingConfig$outboundSchema,
80
66
  }).transform((v) => {
81
67
  return remap$(v, {
82
- requireClientTimestamps: "require_client_timestamps",
83
68
  retentionPolicy: "retention_policy",
84
69
  storageClass: "storage_class",
85
- uncappedClientTimestamps: "uncapped_client_timestamps",
86
70
  });
87
71
  });
88
72
 
@@ -0,0 +1,87 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import * as z from "zod";
6
+ import { remap as remap$ } from "../../lib/primitives.js";
7
+ import { safeParse } from "../../lib/schemas.js";
8
+ import { Result as SafeParseResult } from "../../types/fp.js";
9
+ import { SDKValidationError } from "../errors/sdkvalidationerror.js";
10
+
11
+ /**
12
+ * Position of a record in a stream.
13
+ */
14
+ export type StreamPosition = {
15
+ /**
16
+ * Sequence number assigned by the service.
17
+ */
18
+ seqNum: number;
19
+ /**
20
+ * Timestamp, which may be user-specified or assigned by the service.
21
+ *
22
+ * @remarks
23
+ * If it is assigned by the service, it will represent milliseconds since Unix epoch.
24
+ */
25
+ timestamp: number;
26
+ };
27
+
28
+ /** @internal */
29
+ export const StreamPosition$inboundSchema: z.ZodType<
30
+ StreamPosition,
31
+ z.ZodTypeDef,
32
+ unknown
33
+ > = z.object({
34
+ seq_num: z.number().int(),
35
+ timestamp: z.number().int(),
36
+ }).transform((v) => {
37
+ return remap$(v, {
38
+ "seq_num": "seqNum",
39
+ });
40
+ });
41
+
42
+ /** @internal */
43
+ export type StreamPosition$Outbound = {
44
+ seq_num: number;
45
+ timestamp: number;
46
+ };
47
+
48
+ /** @internal */
49
+ export const StreamPosition$outboundSchema: z.ZodType<
50
+ StreamPosition$Outbound,
51
+ z.ZodTypeDef,
52
+ StreamPosition
53
+ > = z.object({
54
+ seqNum: z.number().int(),
55
+ timestamp: z.number().int(),
56
+ }).transform((v) => {
57
+ return remap$(v, {
58
+ seqNum: "seq_num",
59
+ });
60
+ });
61
+
62
+ /**
63
+ * @internal
64
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
65
+ */
66
+ export namespace StreamPosition$ {
67
+ /** @deprecated use `StreamPosition$inboundSchema` instead. */
68
+ export const inboundSchema = StreamPosition$inboundSchema;
69
+ /** @deprecated use `StreamPosition$outboundSchema` instead. */
70
+ export const outboundSchema = StreamPosition$outboundSchema;
71
+ /** @deprecated use `StreamPosition$Outbound` instead. */
72
+ export type Outbound = StreamPosition$Outbound;
73
+ }
74
+
75
+ export function streamPositionToJSON(streamPosition: StreamPosition): string {
76
+ return JSON.stringify(StreamPosition$outboundSchema.parse(streamPosition));
77
+ }
78
+
79
+ export function streamPositionFromJSON(
80
+ jsonString: string,
81
+ ): SafeParseResult<StreamPosition, SDKValidationError> {
82
+ return safeParse(
83
+ jsonString,
84
+ (x) => StreamPosition$inboundSchema.parse(JSON.parse(x)),
85
+ `Failed to parse 'StreamPosition' from JSON`,
86
+ );
87
+ }