@s2-dev/streamstore 0.15.11 → 0.15.12
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.
- package/README.md +3 -9
- package/bin/mcp-server.js +14 -10
- package/bin/mcp-server.js.map +10 -10
- package/dist/commonjs/funcs/recordsRead.js +1 -0
- package/dist/commonjs/funcs/recordsRead.js.map +1 -1
- package/dist/commonjs/lib/config.d.ts +3 -3
- package/dist/commonjs/lib/config.js +3 -3
- package/dist/commonjs/lib/config.js.map +1 -1
- package/dist/commonjs/lib/event-streams.d.ts +3 -3
- package/dist/commonjs/lib/event-streams.d.ts.map +1 -1
- package/dist/commonjs/lib/event-streams.js.map +1 -1
- package/dist/commonjs/lib/url.js +1 -1
- package/dist/commonjs/lib/url.js.map +1 -1
- package/dist/commonjs/mcp-server/mcp-server.js +1 -1
- package/dist/commonjs/mcp-server/server.js +1 -1
- package/dist/commonjs/models/errors/index.d.ts +1 -0
- package/dist/commonjs/models/errors/index.d.ts.map +1 -1
- package/dist/commonjs/models/errors/index.js +1 -0
- package/dist/commonjs/models/errors/index.js.map +1 -1
- package/dist/commonjs/models/operations/read.d.ts +18 -11
- package/dist/commonjs/models/operations/read.d.ts.map +1 -1
- package/dist/commonjs/models/operations/read.js +7 -3
- package/dist/commonjs/models/operations/read.js.map +1 -1
- package/dist/esm/funcs/recordsRead.js +1 -0
- package/dist/esm/funcs/recordsRead.js.map +1 -1
- package/dist/esm/lib/config.d.ts +3 -3
- package/dist/esm/lib/config.js +3 -3
- package/dist/esm/lib/config.js.map +1 -1
- package/dist/esm/lib/event-streams.d.ts +3 -3
- package/dist/esm/lib/event-streams.d.ts.map +1 -1
- package/dist/esm/lib/event-streams.js.map +1 -1
- package/dist/esm/lib/url.js +1 -1
- package/dist/esm/lib/url.js.map +1 -1
- package/dist/esm/mcp-server/mcp-server.js +1 -1
- package/dist/esm/mcp-server/server.js +1 -1
- package/dist/esm/models/errors/index.d.ts +1 -0
- package/dist/esm/models/errors/index.d.ts.map +1 -1
- package/dist/esm/models/errors/index.js +1 -0
- package/dist/esm/models/errors/index.js.map +1 -1
- package/dist/esm/models/operations/read.d.ts +18 -11
- package/dist/esm/models/operations/read.d.ts.map +1 -1
- package/dist/esm/models/operations/read.js +7 -3
- package/dist/esm/models/operations/read.js.map +1 -1
- package/docs/sdks/records/README.md +2 -8
- package/examples/accessTokensListAccessTokens.example.ts +1 -1
- package/examples/package-lock.json +1 -1
- package/jsr.json +1 -1
- package/package.json +1 -1
- package/src/funcs/recordsRead.ts +1 -0
- package/src/lib/config.ts +3 -3
- package/src/lib/event-streams.ts +6 -8
- package/src/lib/url.ts +1 -1
- package/src/mcp-server/mcp-server.ts +1 -1
- package/src/mcp-server/server.ts +1 -1
- package/src/models/errors/index.ts +1 -0
- package/src/models/operations/read.ts +30 -19
- package/temp/example.ts +0 -5
|
@@ -19,10 +19,11 @@ export const ReadRequest$inboundSchema = z.object({
|
|
|
19
19
|
seq_num: z.number().int().optional(),
|
|
20
20
|
timestamp: z.number().int().optional(),
|
|
21
21
|
tail_offset: z.number().int().optional(),
|
|
22
|
+
clamp: z.boolean().optional(),
|
|
22
23
|
count: z.number().int().optional(),
|
|
23
24
|
bytes: z.number().int().optional(),
|
|
24
25
|
until: z.number().int().optional(),
|
|
25
|
-
|
|
26
|
+
wait: z.number().int().optional(),
|
|
26
27
|
"s2-basin": z.string(),
|
|
27
28
|
}).transform((v) => {
|
|
28
29
|
return remap$(v, {
|
|
@@ -39,10 +40,11 @@ export const ReadRequest$outboundSchema = z.object({
|
|
|
39
40
|
seqNum: z.number().int().optional(),
|
|
40
41
|
timestamp: z.number().int().optional(),
|
|
41
42
|
tailOffset: z.number().int().optional(),
|
|
43
|
+
clamp: z.boolean().optional(),
|
|
42
44
|
count: z.number().int().optional(),
|
|
43
45
|
bytes: z.number().int().optional(),
|
|
44
46
|
until: z.number().int().optional(),
|
|
45
|
-
|
|
47
|
+
wait: z.number().int().optional(),
|
|
46
48
|
s2Basin: z.string(),
|
|
47
49
|
}).transform((v) => {
|
|
48
50
|
return remap$(v, {
|
|
@@ -72,7 +74,9 @@ export function readRequestFromJSON(jsonString) {
|
|
|
72
74
|
/** @internal */
|
|
73
75
|
export const ReadResponse$inboundSchema = z.union([
|
|
74
76
|
components.ReadBatch$inboundSchema,
|
|
75
|
-
z
|
|
77
|
+
z
|
|
78
|
+
.instanceof((ReadableStream))
|
|
79
|
+
.transform(stream => {
|
|
76
80
|
return new EventStream(stream, rawEvent => {
|
|
77
81
|
if (rawEvent.data === "[DONE]")
|
|
78
82
|
return { done: true };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"read.js","sourceRoot":"","sources":["../../../../src/models/operations/read.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,CAAC,MAAM,KAAK,CAAC;AACzB,OAAO,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AACzD,OAAO,EAAE,KAAK,IAAI,MAAM,EAAE,MAAM,yBAAyB,CAAC;AAC1D,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAEjD,OAAO,KAAK,UAAU,MAAM,wBAAwB,CAAC;AAGrD,MAAM,CAAC,MAAM,cAAc,GAAG;IAC5B;;OAEG;IACH,iCAAiC;CACzB,CAAC;
|
|
1
|
+
{"version":3,"file":"read.js","sourceRoot":"","sources":["../../../../src/models/operations/read.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,CAAC,MAAM,KAAK,CAAC;AACzB,OAAO,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AACzD,OAAO,EAAE,KAAK,IAAI,MAAM,EAAE,MAAM,yBAAyB,CAAC;AAC1D,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAEjD,OAAO,KAAK,UAAU,MAAM,wBAAwB,CAAC;AAGrD,MAAM,CAAC,MAAM,cAAc,GAAG;IAC5B;;OAEG;IACH,iCAAiC;CACzB,CAAC;A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AM,UAAU,oBAAoB,CAClC,UAAkB;IAElB,OAAO,SAAS,CACd,UAAU,EACV,CAAC,CAAC,EAAE,EAAE,CAAC,0BAA0B,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,EACtD,0CAA0C,CAC3C,CAAC;AACJ,CAAC"}
|
|
@@ -31,10 +31,7 @@ async function run() {
|
|
|
31
31
|
s2Basin: "<value>",
|
|
32
32
|
});
|
|
33
33
|
|
|
34
|
-
|
|
35
|
-
// Handle the event
|
|
36
|
-
console.log(event);
|
|
37
|
-
}
|
|
34
|
+
console.log(result);
|
|
38
35
|
}
|
|
39
36
|
|
|
40
37
|
run();
|
|
@@ -61,10 +58,7 @@ async function run() {
|
|
|
61
58
|
});
|
|
62
59
|
if (res.ok) {
|
|
63
60
|
const { value: result } = res;
|
|
64
|
-
|
|
65
|
-
// Handle the event
|
|
66
|
-
console.log(event);
|
|
67
|
-
}
|
|
61
|
+
console.log(result);
|
|
68
62
|
} else {
|
|
69
63
|
console.log("recordsRead failed:", res.error);
|
|
70
64
|
}
|
package/jsr.json
CHANGED
package/package.json
CHANGED
package/src/funcs/recordsRead.ts
CHANGED
package/src/lib/config.ts
CHANGED
|
@@ -58,8 +58,8 @@ export function serverURLFromOptions(options: SDKOptions): URL | null {
|
|
|
58
58
|
export const SDK_METADATA = {
|
|
59
59
|
language: "typescript",
|
|
60
60
|
openapiDocVersion: "1.0.0",
|
|
61
|
-
sdkVersion: "0.15.
|
|
62
|
-
genVersion: "2.
|
|
61
|
+
sdkVersion: "0.15.12",
|
|
62
|
+
genVersion: "2.716.10",
|
|
63
63
|
userAgent:
|
|
64
|
-
"speakeasy-sdk/typescript 0.15.
|
|
64
|
+
"speakeasy-sdk/typescript 0.15.12 2.716.10 1.0.0 @s2-dev/streamstore",
|
|
65
65
|
} as const;
|
package/src/lib/event-streams.ts
CHANGED
|
@@ -2,19 +2,18 @@
|
|
|
2
2
|
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
|
-
export type
|
|
5
|
+
export type SseMessage<T> = {
|
|
6
6
|
data?: T | undefined;
|
|
7
7
|
event?: string | undefined;
|
|
8
8
|
id?: string | undefined;
|
|
9
9
|
retry?: number | undefined;
|
|
10
10
|
};
|
|
11
|
-
|
|
12
|
-
export class EventStream<T extends ServerEvent<unknown>>
|
|
11
|
+
export class EventStream<T extends SseMessage<unknown>>
|
|
13
12
|
extends ReadableStream<T>
|
|
14
13
|
{
|
|
15
14
|
constructor(
|
|
16
15
|
responseBody: ReadableStream<Uint8Array>,
|
|
17
|
-
parse: (x:
|
|
16
|
+
parse: (x: SseMessage<string>) => IteratorResult<T, undefined>,
|
|
18
17
|
) {
|
|
19
18
|
const upstream = responseBody.getReader();
|
|
20
19
|
let buffer: Uint8Array = new Uint8Array();
|
|
@@ -107,15 +106,14 @@ function findBoundary(
|
|
|
107
106
|
}
|
|
108
107
|
return null;
|
|
109
108
|
}
|
|
110
|
-
|
|
111
|
-
function parseMessage<T extends ServerEvent<unknown>>(
|
|
109
|
+
function parseMessage<T extends SseMessage<unknown>>(
|
|
112
110
|
chunk: Uint8Array,
|
|
113
|
-
parse: (x:
|
|
111
|
+
parse: (x: SseMessage<string>) => IteratorResult<T, undefined>,
|
|
114
112
|
) {
|
|
115
113
|
const text = new TextDecoder().decode(chunk);
|
|
116
114
|
const lines = text.split(/\r\n|\r|\n/);
|
|
117
115
|
const dataLines: string[] = [];
|
|
118
|
-
const ret:
|
|
116
|
+
const ret: SseMessage<string> = {};
|
|
119
117
|
let ignore = true;
|
|
120
118
|
for (const line of lines) {
|
|
121
119
|
if (!line || line.startsWith(":")) continue;
|
package/src/lib/url.ts
CHANGED
|
@@ -10,7 +10,7 @@ export function pathToFunc(
|
|
|
10
10
|
pathPattern: string,
|
|
11
11
|
options?: { charEncoding?: "percent" | "none" },
|
|
12
12
|
): (params?: Params) => string {
|
|
13
|
-
const paramRE = /\{([a-zA-Z0-9_]
|
|
13
|
+
const paramRE = /\{([a-zA-Z0-9_][a-zA-Z0-9_-]*?)\}/g;
|
|
14
14
|
|
|
15
15
|
return function buildURLPath(params: Record<string, unknown> = {}): string {
|
|
16
16
|
return pathPattern.replace(paramRE, function (_, placeholder) {
|
package/src/mcp-server/server.ts
CHANGED
|
@@ -7,5 +7,6 @@ export * from "./appendconditionfailed.js";
|
|
|
7
7
|
export * from "./errorresponse.js";
|
|
8
8
|
export * from "./httpclienterrors.js";
|
|
9
9
|
export * from "./responsevalidationerror.js";
|
|
10
|
+
export * from "./s2error.js";
|
|
10
11
|
export * from "./sdkvalidationerror.js";
|
|
11
12
|
export * from "./tailresponse.js";
|
|
@@ -43,33 +43,39 @@ export type ReadRequest = {
|
|
|
43
43
|
*/
|
|
44
44
|
tailOffset?: number | undefined;
|
|
45
45
|
/**
|
|
46
|
-
*
|
|
46
|
+
* Start reading from the tail if the requested position is beyond it.
|
|
47
47
|
*
|
|
48
48
|
* @remarks
|
|
49
|
-
*
|
|
49
|
+
* Otherwise, a `416 Range Not Satisfiable` response is returned.
|
|
50
|
+
*/
|
|
51
|
+
clamp?: boolean | undefined;
|
|
52
|
+
/**
|
|
53
|
+
* Record count limit.
|
|
54
|
+
*
|
|
55
|
+
* @remarks
|
|
56
|
+
* Non-streaming reads are capped by the default limit of 1000 records.
|
|
50
57
|
*/
|
|
51
58
|
count?: number | undefined;
|
|
52
59
|
/**
|
|
53
|
-
*
|
|
60
|
+
* Metered bytes limit.
|
|
54
61
|
*
|
|
55
62
|
* @remarks
|
|
56
|
-
*
|
|
63
|
+
* Non-streaming reads are capped by the default limit of 1 MiB.
|
|
57
64
|
*/
|
|
58
65
|
bytes?: number | undefined;
|
|
59
66
|
/**
|
|
60
67
|
* Exclusive timestamp to read until.
|
|
61
|
-
*
|
|
62
|
-
* @remarks
|
|
63
|
-
* If this is provided, tailing will be disabled.
|
|
64
68
|
*/
|
|
65
69
|
until?: number | undefined;
|
|
66
70
|
/**
|
|
67
|
-
*
|
|
71
|
+
* Duration in seconds to wait for new records.
|
|
68
72
|
*
|
|
69
73
|
* @remarks
|
|
70
|
-
*
|
|
74
|
+
* The default duration is 0 if there is a bound on `count`, `bytes`, or `until`, and otherwise infinite.
|
|
75
|
+
* Non-streaming reads are always bounded on `count` and `bytes`, so you can achieve long poll semantics by specifying a non-zero duration up to 60 seconds.
|
|
76
|
+
* In the context of an SSE or S2S streaming read, the duration will bound how much time can elapse between records throughout the lifetime of the session.
|
|
71
77
|
*/
|
|
72
|
-
|
|
78
|
+
wait?: number | undefined;
|
|
73
79
|
/**
|
|
74
80
|
* Basin name for basin-specific endpoints
|
|
75
81
|
*/
|
|
@@ -91,10 +97,11 @@ export const ReadRequest$inboundSchema: z.ZodType<
|
|
|
91
97
|
seq_num: z.number().int().optional(),
|
|
92
98
|
timestamp: z.number().int().optional(),
|
|
93
99
|
tail_offset: z.number().int().optional(),
|
|
100
|
+
clamp: z.boolean().optional(),
|
|
94
101
|
count: z.number().int().optional(),
|
|
95
102
|
bytes: z.number().int().optional(),
|
|
96
103
|
until: z.number().int().optional(),
|
|
97
|
-
|
|
104
|
+
wait: z.number().int().optional(),
|
|
98
105
|
"s2-basin": z.string(),
|
|
99
106
|
}).transform((v) => {
|
|
100
107
|
return remap$(v, {
|
|
@@ -112,10 +119,11 @@ export type ReadRequest$Outbound = {
|
|
|
112
119
|
seq_num?: number | undefined;
|
|
113
120
|
timestamp?: number | undefined;
|
|
114
121
|
tail_offset?: number | undefined;
|
|
122
|
+
clamp?: boolean | undefined;
|
|
115
123
|
count?: number | undefined;
|
|
116
124
|
bytes?: number | undefined;
|
|
117
125
|
until?: number | undefined;
|
|
118
|
-
|
|
126
|
+
wait?: number | undefined;
|
|
119
127
|
"s2-basin": string;
|
|
120
128
|
};
|
|
121
129
|
|
|
@@ -130,10 +138,11 @@ export const ReadRequest$outboundSchema: z.ZodType<
|
|
|
130
138
|
seqNum: z.number().int().optional(),
|
|
131
139
|
timestamp: z.number().int().optional(),
|
|
132
140
|
tailOffset: z.number().int().optional(),
|
|
141
|
+
clamp: z.boolean().optional(),
|
|
133
142
|
count: z.number().int().optional(),
|
|
134
143
|
bytes: z.number().int().optional(),
|
|
135
144
|
until: z.number().int().optional(),
|
|
136
|
-
|
|
145
|
+
wait: z.number().int().optional(),
|
|
137
146
|
s2Basin: z.string(),
|
|
138
147
|
}).transform((v) => {
|
|
139
148
|
return remap$(v, {
|
|
@@ -178,12 +187,14 @@ export const ReadResponse$inboundSchema: z.ZodType<
|
|
|
178
187
|
unknown
|
|
179
188
|
> = z.union([
|
|
180
189
|
components.ReadBatch$inboundSchema,
|
|
181
|
-
z
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
return
|
|
185
|
-
|
|
186
|
-
|
|
190
|
+
z
|
|
191
|
+
.instanceof(ReadableStream<Uint8Array>)
|
|
192
|
+
.transform(stream => {
|
|
193
|
+
return new EventStream(stream, rawEvent => {
|
|
194
|
+
if (rawEvent.data === "[DONE]") return { done: true };
|
|
195
|
+
return { value: components.ReadEvent$inboundSchema.parse(rawEvent) };
|
|
196
|
+
});
|
|
197
|
+
}),
|
|
187
198
|
]);
|
|
188
199
|
|
|
189
200
|
/** @internal */
|