@s2-dev/streamstore 0.11.1 → 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 (172) hide show
  1. package/README.md +5 -0
  2. package/bin/mcp-server.js +301 -75
  3. package/bin/mcp-server.js.map +22 -14
  4. package/dist/commonjs/funcs/recordsCheckTail.d.ts +18 -0
  5. package/dist/commonjs/funcs/recordsCheckTail.d.ts.map +1 -0
  6. package/dist/commonjs/funcs/recordsCheckTail.js +127 -0
  7. package/dist/commonjs/funcs/recordsCheckTail.js.map +1 -0
  8. package/dist/commonjs/lib/config.d.ts +3 -3
  9. package/dist/commonjs/lib/config.js +3 -3
  10. package/dist/commonjs/lib/sdks.d.ts +3 -1
  11. package/dist/commonjs/lib/sdks.d.ts.map +1 -1
  12. package/dist/commonjs/lib/sdks.js +6 -11
  13. package/dist/commonjs/lib/sdks.js.map +1 -1
  14. package/dist/commonjs/mcp-server/mcp-server.js +1 -1
  15. package/dist/commonjs/mcp-server/server.d.ts.map +1 -1
  16. package/dist/commonjs/mcp-server/server.js +3 -1
  17. package/dist/commonjs/mcp-server/server.js.map +1 -1
  18. package/dist/commonjs/mcp-server/tools/recordsCheckTail.d.ts +8 -0
  19. package/dist/commonjs/mcp-server/tools/recordsCheckTail.d.ts.map +1 -0
  20. package/dist/commonjs/mcp-server/tools/recordsCheckTail.js +65 -0
  21. package/dist/commonjs/mcp-server/tools/recordsCheckTail.js.map +1 -0
  22. package/dist/commonjs/models/components/accesstokeninfo.d.ts +1 -1
  23. package/dist/commonjs/models/components/checktailresponse.d.ts +33 -0
  24. package/dist/commonjs/models/components/checktailresponse.d.ts.map +1 -0
  25. package/dist/commonjs/models/components/checktailresponse.js +70 -0
  26. package/dist/commonjs/models/components/checktailresponse.js.map +1 -0
  27. package/dist/commonjs/models/components/index.d.ts +5 -0
  28. package/dist/commonjs/models/components/index.d.ts.map +1 -1
  29. package/dist/commonjs/models/components/index.js +5 -0
  30. package/dist/commonjs/models/components/index.js.map +1 -1
  31. package/dist/commonjs/models/components/listaccesstokensresponse.d.ts +5 -5
  32. package/dist/commonjs/models/components/listaccesstokensresponse.d.ts.map +1 -1
  33. package/dist/commonjs/models/components/listaccesstokensresponse.js +4 -2
  34. package/dist/commonjs/models/components/listaccesstokensresponse.js.map +1 -1
  35. package/dist/commonjs/models/components/streamconfig.d.ts +3 -18
  36. package/dist/commonjs/models/components/streamconfig.d.ts.map +1 -1
  37. package/dist/commonjs/models/components/streamconfig.js +3 -8
  38. package/dist/commonjs/models/components/streamconfig.js.map +1 -1
  39. package/dist/commonjs/models/components/streamposition.d.ts +43 -0
  40. package/dist/commonjs/models/components/streamposition.d.ts.map +1 -0
  41. package/dist/commonjs/models/components/streamposition.js +80 -0
  42. package/dist/commonjs/models/components/streamposition.js.map +1 -0
  43. package/dist/commonjs/models/components/streamreconfiguration.d.ts +3 -18
  44. package/dist/commonjs/models/components/streamreconfiguration.d.ts.map +1 -1
  45. package/dist/commonjs/models/components/streamreconfiguration.js +3 -8
  46. package/dist/commonjs/models/components/streamreconfiguration.js.map +1 -1
  47. package/dist/commonjs/models/components/timestampingconfig.d.ts +38 -0
  48. package/dist/commonjs/models/components/timestampingconfig.d.ts.map +1 -0
  49. package/dist/commonjs/models/components/timestampingconfig.js +72 -0
  50. package/dist/commonjs/models/components/timestampingconfig.js.map +1 -0
  51. package/dist/commonjs/models/components/timestampingmode.d.ts +31 -0
  52. package/dist/commonjs/models/components/timestampingmode.d.ts.map +1 -0
  53. package/dist/commonjs/models/components/timestampingmode.js +61 -0
  54. package/dist/commonjs/models/components/timestampingmode.js.map +1 -0
  55. package/dist/commonjs/models/components/timestampingreconfiguration.d.ts +35 -0
  56. package/dist/commonjs/models/components/timestampingreconfiguration.d.ts.map +1 -0
  57. package/dist/commonjs/models/components/timestampingreconfiguration.js +72 -0
  58. package/dist/commonjs/models/components/timestampingreconfiguration.js.map +1 -0
  59. package/dist/commonjs/models/operations/checktail.d.ts +37 -0
  60. package/dist/commonjs/models/operations/checktail.d.ts.map +1 -0
  61. package/dist/commonjs/models/operations/checktail.js +75 -0
  62. package/dist/commonjs/models/operations/checktail.js.map +1 -0
  63. package/dist/commonjs/models/operations/index.d.ts +1 -0
  64. package/dist/commonjs/models/operations/index.d.ts.map +1 -1
  65. package/dist/commonjs/models/operations/index.js +1 -0
  66. package/dist/commonjs/models/operations/index.js.map +1 -1
  67. package/dist/commonjs/models/operations/revokeaccesstoken.d.ts +1 -1
  68. package/dist/commonjs/sdk/records.d.ts +13 -0
  69. package/dist/commonjs/sdk/records.d.ts.map +1 -0
  70. package/dist/commonjs/sdk/records.js +22 -0
  71. package/dist/commonjs/sdk/records.js.map +1 -0
  72. package/dist/commonjs/sdk/sdk.d.ts +3 -0
  73. package/dist/commonjs/sdk/sdk.d.ts.map +1 -1
  74. package/dist/commonjs/sdk/sdk.js +4 -0
  75. package/dist/commonjs/sdk/sdk.js.map +1 -1
  76. package/dist/esm/funcs/recordsCheckTail.d.ts +18 -0
  77. package/dist/esm/funcs/recordsCheckTail.d.ts.map +1 -0
  78. package/dist/esm/funcs/recordsCheckTail.js +91 -0
  79. package/dist/esm/funcs/recordsCheckTail.js.map +1 -0
  80. package/dist/esm/lib/config.d.ts +3 -3
  81. package/dist/esm/lib/config.js +3 -3
  82. package/dist/esm/lib/sdks.d.ts +3 -1
  83. package/dist/esm/lib/sdks.d.ts.map +1 -1
  84. package/dist/esm/lib/sdks.js +6 -11
  85. package/dist/esm/lib/sdks.js.map +1 -1
  86. package/dist/esm/mcp-server/mcp-server.js +1 -1
  87. package/dist/esm/mcp-server/server.d.ts.map +1 -1
  88. package/dist/esm/mcp-server/server.js +3 -1
  89. package/dist/esm/mcp-server/server.js.map +1 -1
  90. package/dist/esm/mcp-server/tools/recordsCheckTail.d.ts +8 -0
  91. package/dist/esm/mcp-server/tools/recordsCheckTail.d.ts.map +1 -0
  92. package/dist/esm/mcp-server/tools/recordsCheckTail.js +29 -0
  93. package/dist/esm/mcp-server/tools/recordsCheckTail.js.map +1 -0
  94. package/dist/esm/models/components/accesstokeninfo.d.ts +1 -1
  95. package/dist/esm/models/components/checktailresponse.d.ts +33 -0
  96. package/dist/esm/models/components/checktailresponse.d.ts.map +1 -0
  97. package/dist/esm/models/components/checktailresponse.js +32 -0
  98. package/dist/esm/models/components/checktailresponse.js.map +1 -0
  99. package/dist/esm/models/components/index.d.ts +5 -0
  100. package/dist/esm/models/components/index.d.ts.map +1 -1
  101. package/dist/esm/models/components/index.js +5 -0
  102. package/dist/esm/models/components/index.js.map +1 -1
  103. package/dist/esm/models/components/listaccesstokensresponse.d.ts +5 -5
  104. package/dist/esm/models/components/listaccesstokensresponse.d.ts.map +1 -1
  105. package/dist/esm/models/components/listaccesstokensresponse.js +4 -2
  106. package/dist/esm/models/components/listaccesstokensresponse.js.map +1 -1
  107. package/dist/esm/models/components/streamconfig.d.ts +3 -18
  108. package/dist/esm/models/components/streamconfig.d.ts.map +1 -1
  109. package/dist/esm/models/components/streamconfig.js +3 -8
  110. package/dist/esm/models/components/streamconfig.js.map +1 -1
  111. package/dist/esm/models/components/streamposition.d.ts +43 -0
  112. package/dist/esm/models/components/streamposition.d.ts.map +1 -0
  113. package/dist/esm/models/components/streamposition.js +42 -0
  114. package/dist/esm/models/components/streamposition.js.map +1 -0
  115. package/dist/esm/models/components/streamreconfiguration.d.ts +3 -18
  116. package/dist/esm/models/components/streamreconfiguration.d.ts.map +1 -1
  117. package/dist/esm/models/components/streamreconfiguration.js +3 -8
  118. package/dist/esm/models/components/streamreconfiguration.js.map +1 -1
  119. package/dist/esm/models/components/timestampingconfig.d.ts +38 -0
  120. package/dist/esm/models/components/timestampingconfig.d.ts.map +1 -0
  121. package/dist/esm/models/components/timestampingconfig.js +34 -0
  122. package/dist/esm/models/components/timestampingconfig.js.map +1 -0
  123. package/dist/esm/models/components/timestampingmode.d.ts +31 -0
  124. package/dist/esm/models/components/timestampingmode.d.ts.map +1 -0
  125. package/dist/esm/models/components/timestampingmode.js +25 -0
  126. package/dist/esm/models/components/timestampingmode.js.map +1 -0
  127. package/dist/esm/models/components/timestampingreconfiguration.d.ts +35 -0
  128. package/dist/esm/models/components/timestampingreconfiguration.d.ts.map +1 -0
  129. package/dist/esm/models/components/timestampingreconfiguration.js +34 -0
  130. package/dist/esm/models/components/timestampingreconfiguration.js.map +1 -0
  131. package/dist/esm/models/operations/checktail.d.ts +37 -0
  132. package/dist/esm/models/operations/checktail.d.ts.map +1 -0
  133. package/dist/esm/models/operations/checktail.js +37 -0
  134. package/dist/esm/models/operations/checktail.js.map +1 -0
  135. package/dist/esm/models/operations/index.d.ts +1 -0
  136. package/dist/esm/models/operations/index.d.ts.map +1 -1
  137. package/dist/esm/models/operations/index.js +1 -0
  138. package/dist/esm/models/operations/index.js.map +1 -1
  139. package/dist/esm/models/operations/revokeaccesstoken.d.ts +1 -1
  140. package/dist/esm/sdk/records.d.ts +13 -0
  141. package/dist/esm/sdk/records.d.ts.map +1 -0
  142. package/dist/esm/sdk/records.js +18 -0
  143. package/dist/esm/sdk/records.js.map +1 -0
  144. package/dist/esm/sdk/sdk.d.ts +3 -0
  145. package/dist/esm/sdk/sdk.d.ts.map +1 -1
  146. package/dist/esm/sdk/sdk.js +4 -0
  147. package/dist/esm/sdk/sdk.js.map +1 -1
  148. package/docs/sdks/records/README.md +90 -0
  149. package/docs/sdks/streams/README.md +12 -4
  150. package/jsr.json +1 -1
  151. package/package.json +1 -1
  152. package/src/funcs/recordsCheckTail.ts +184 -0
  153. package/src/lib/config.ts +3 -3
  154. package/src/lib/sdks.ts +11 -11
  155. package/src/mcp-server/mcp-server.ts +1 -1
  156. package/src/mcp-server/server.ts +3 -1
  157. package/src/mcp-server/tools/recordsCheckTail.ts +38 -0
  158. package/src/models/components/accesstokeninfo.ts +1 -1
  159. package/src/models/components/checktailresponse.ts +75 -0
  160. package/src/models/components/index.ts +5 -0
  161. package/src/models/components/listaccesstokensresponse.ts +9 -7
  162. package/src/models/components/streamconfig.ts +10 -26
  163. package/src/models/components/streamposition.ts +87 -0
  164. package/src/models/components/streamreconfiguration.ts +10 -26
  165. package/src/models/components/timestampingconfig.ts +81 -0
  166. package/src/models/components/timestampingmode.ts +34 -0
  167. package/src/models/components/timestampingreconfiguration.ts +80 -0
  168. package/src/models/operations/checktail.ts +80 -0
  169. package/src/models/operations/index.ts +1 -0
  170. package/src/models/operations/revokeaccesstoken.ts +1 -1
  171. package/src/sdk/records.ts +28 -0
  172. package/src/sdk/sdk.ts +6 -0
@@ -189,7 +189,9 @@ const s2 = new S2({
189
189
  async function run() {
190
190
  const result = await s2.streams.createOrReconfigureStream({
191
191
  stream: "<value>",
192
- streamConfig: {},
192
+ streamConfig: {
193
+ timestamping: {},
194
+ },
193
195
  });
194
196
 
195
197
  // Handle the result
@@ -216,7 +218,9 @@ const s2 = new S2Core({
216
218
  async function run() {
217
219
  const res = await streamsCreateOrReconfigureStream(s2, {
218
220
  stream: "<value>",
219
- streamConfig: {},
221
+ streamConfig: {
222
+ timestamping: {},
223
+ },
220
224
  });
221
225
 
222
226
  if (!res.ok) {
@@ -349,7 +353,9 @@ const s2 = new S2({
349
353
  async function run() {
350
354
  const result = await s2.streams.reconfigureStream({
351
355
  stream: "<value>",
352
- streamReconfiguration: {},
356
+ streamReconfiguration: {
357
+ timestamping: {},
358
+ },
353
359
  });
354
360
 
355
361
  // Handle the result
@@ -376,7 +382,9 @@ const s2 = new S2Core({
376
382
  async function run() {
377
383
  const res = await streamsReconfigureStream(s2, {
378
384
  stream: "<value>",
379
- streamReconfiguration: {},
385
+ streamReconfiguration: {
386
+ timestamping: {},
387
+ },
380
388
  });
381
389
 
382
390
  if (!res.ok) {
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.11.2",
6
6
  "exports": {
7
7
  ".": "./src/index.ts",
8
8
  "./models/errors": "./src/models/errors/index.ts",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@s2-dev/streamstore",
3
- "version": "0.11.1",
3
+ "version": "0.11.2",
4
4
  "author": "Speakeasy",
5
5
  "type": "module",
6
6
  "bin": {
@@ -0,0 +1,184 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import { S2Core } from "../core.js";
6
+ import { encodeSimple } from "../lib/encodings.js";
7
+ import * as M from "../lib/matchers.js";
8
+ import { compactMap } from "../lib/primitives.js";
9
+ import { safeParse } from "../lib/schemas.js";
10
+ import { RequestOptions } from "../lib/sdks.js";
11
+ import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
12
+ import { pathToFunc } from "../lib/url.js";
13
+ import * as components from "../models/components/index.js";
14
+ import { APIError } from "../models/errors/apierror.js";
15
+ import {
16
+ ConnectionError,
17
+ InvalidRequestError,
18
+ RequestAbortedError,
19
+ RequestTimeoutError,
20
+ UnexpectedClientError,
21
+ } from "../models/errors/httpclienterrors.js";
22
+ import * as errors from "../models/errors/index.js";
23
+ import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
24
+ import { CheckTailServerList } from "../models/operations/checktail.js";
25
+ import * as operations from "../models/operations/index.js";
26
+ import { APICall, APIPromise } from "../types/async.js";
27
+ import { Result } from "../types/fp.js";
28
+
29
+ /**
30
+ * Check the tail.
31
+ *
32
+ * @remarks
33
+ * Check the tail of a stream.
34
+ */
35
+ export function recordsCheckTail(
36
+ client: S2Core,
37
+ request: operations.CheckTailRequest,
38
+ options?: RequestOptions,
39
+ ): APIPromise<
40
+ Result<
41
+ components.CheckTailResponse,
42
+ | errors.ErrorResponse
43
+ | errors.RetryableError
44
+ | errors.RetryableError
45
+ | APIError
46
+ | SDKValidationError
47
+ | UnexpectedClientError
48
+ | InvalidRequestError
49
+ | RequestAbortedError
50
+ | RequestTimeoutError
51
+ | ConnectionError
52
+ >
53
+ > {
54
+ return new APIPromise($do(
55
+ client,
56
+ request,
57
+ options,
58
+ ));
59
+ }
60
+
61
+ async function $do(
62
+ client: S2Core,
63
+ request: operations.CheckTailRequest,
64
+ options?: RequestOptions,
65
+ ): Promise<
66
+ [
67
+ Result<
68
+ components.CheckTailResponse,
69
+ | errors.ErrorResponse
70
+ | errors.RetryableError
71
+ | errors.RetryableError
72
+ | APIError
73
+ | SDKValidationError
74
+ | UnexpectedClientError
75
+ | InvalidRequestError
76
+ | RequestAbortedError
77
+ | RequestTimeoutError
78
+ | ConnectionError
79
+ >,
80
+ APICall,
81
+ ]
82
+ > {
83
+ const parsed = safeParse(
84
+ request,
85
+ (value) => operations.CheckTailRequest$outboundSchema.parse(value),
86
+ "Input validation failed",
87
+ );
88
+ if (!parsed.ok) {
89
+ return [parsed, { status: "invalid" }];
90
+ }
91
+ const payload = parsed.value;
92
+ const body = null;
93
+
94
+ const baseURL = options?.serverURL
95
+ || pathToFunc(CheckTailServerList[0], { charEncoding: "percent" })({
96
+ basin: "",
97
+ });
98
+
99
+ const pathParams = {
100
+ stream: encodeSimple("stream", payload.stream, {
101
+ explode: false,
102
+ charEncoding: "percent",
103
+ }),
104
+ };
105
+
106
+ const path = pathToFunc("/streams/{stream}/records/tail")(pathParams);
107
+
108
+ const headers = new Headers(compactMap({
109
+ Accept: "application/json",
110
+ }));
111
+
112
+ const secConfig = await extractSecurity(client._options.accessToken);
113
+ const securityInput = secConfig == null ? {} : { accessToken: secConfig };
114
+ const requestSecurity = resolveGlobalSecurity(securityInput);
115
+
116
+ const context = {
117
+ baseURL: baseURL ?? "",
118
+ operationID: "check_tail",
119
+ oAuth2Scopes: [],
120
+
121
+ resolvedSecurity: requestSecurity,
122
+
123
+ securitySource: client._options.accessToken,
124
+ retryConfig: options?.retries
125
+ || client._options.retryConfig
126
+ || { strategy: "none" },
127
+ retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
128
+ };
129
+
130
+ const requestRes = client._createRequest(context, {
131
+ security: requestSecurity,
132
+ method: "GET",
133
+ baseURL: baseURL,
134
+ path: path,
135
+ headers: headers,
136
+ body: body,
137
+ timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
138
+ }, options);
139
+ if (!requestRes.ok) {
140
+ return [requestRes, { status: "invalid" }];
141
+ }
142
+ const req = requestRes.value;
143
+
144
+ const doResult = await client._do(req, {
145
+ context,
146
+ errorCodes: ["400", "401", "404", "499", "4XX", "500", "503", "504", "5XX"],
147
+ retryConfig: context.retryConfig,
148
+ retryCodes: context.retryCodes,
149
+ });
150
+ if (!doResult.ok) {
151
+ return [doResult, { status: "request-error", request: req }];
152
+ }
153
+ const response = doResult.value;
154
+
155
+ const responseFields = {
156
+ HttpMeta: { Response: response, Request: req },
157
+ };
158
+
159
+ const [result] = await M.match<
160
+ components.CheckTailResponse,
161
+ | errors.ErrorResponse
162
+ | errors.RetryableError
163
+ | errors.RetryableError
164
+ | APIError
165
+ | SDKValidationError
166
+ | UnexpectedClientError
167
+ | InvalidRequestError
168
+ | RequestAbortedError
169
+ | RequestTimeoutError
170
+ | ConnectionError
171
+ >(
172
+ M.json(200, components.CheckTailResponse$inboundSchema),
173
+ M.jsonErr([400, 401, 404], errors.ErrorResponse$inboundSchema),
174
+ M.jsonErr(499, errors.RetryableError$inboundSchema),
175
+ M.jsonErr([500, 503, 504], errors.RetryableError$inboundSchema),
176
+ M.fail("4XX"),
177
+ M.fail("5XX"),
178
+ )(response, { extraFields: responseFields });
179
+ if (!result.ok) {
180
+ return [result, { status: "complete", request: req, response }];
181
+ }
182
+
183
+ return [result, { status: "complete", request: req, response }];
184
+ }
package/src/lib/config.ts CHANGED
@@ -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.1",
58
- genVersion: "2.593.4",
57
+ sdkVersion: "0.11.2",
58
+ genVersion: "2.597.9",
59
59
  userAgent:
60
- "speakeasy-sdk/typescript 0.11.1 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/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
 
@@ -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.1",
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";
@@ -37,7 +38,7 @@ export function createMCPServer(deps: {
37
38
  }) {
38
39
  const server = new McpServer({
39
40
  name: "S2",
40
- version: "0.11.1",
41
+ version: "0.11.2",
41
42
  });
42
43
 
43
44
  const client = new S2Core({
@@ -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
  });
@@ -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