Skip to content
This repository was archived by the owner on Oct 23, 2025. It is now read-only.

Commit 8bad257

Browse files
chore: regen
1 parent fb8dcc7 commit 8bad257

File tree

11 files changed

+40
-51
lines changed

11 files changed

+40
-51
lines changed

.speakeasy/gen.lock

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@ id: 2d20490e-9921-47d5-9711-d3c4b91c8cfa
33
management:
44
docChecksum: 76d8867e9c1fc8897fc8f35f456e5c46
55
docVersion: 1.0.0
6-
speakeasyVersion: 1.595.2
7-
generationVersion: 2.670.5
8-
releaseVersion: 0.15.8
9-
configChecksum: 606c5da2e375003210f91dca4bf0e2aa
6+
speakeasyVersion: 1.595.3
7+
generationVersion: 2.671.2
8+
releaseVersion: 0.15.9
9+
configChecksum: 0d493ad883ee21ddbe9e1946cb3aa08f
1010
repoURL: https://github.com/s2-streamstore/s2-sdk-typescript.git
1111
installationURL: https://github.com/s2-streamstore/s2-sdk-typescript
1212
published: true
@@ -32,7 +32,7 @@ features:
3232
responseFormat: 0.2.3
3333
retries: 2.83.0
3434
sdkHooks: 0.3.0
35-
serverEvents: 0.1.7
35+
serverEvents: 0.1.8
3636
serverEventsSentinels: 0.1.0
3737
unions: 2.85.11
3838
generatedFiles:
@@ -325,6 +325,7 @@ generatedFiles:
325325
- src/types/operations.ts
326326
- src/types/rfcdate.ts
327327
- src/types/streams.ts
328+
- temp/example.ts
328329
- tsconfig.json
329330
examples:
330331
list_access_tokens:

.speakeasy/gen.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ generation:
2424
generateNewTests: false
2525
skipResponseBodyAssertions: false
2626
typescript:
27-
version: 0.15.8
27+
version: 0.15.9
2828
additionalDependencies:
2929
dependencies:
3030
uuid: ^9.0.1

.speakeasy/workflow.lock

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
speakeasyVersion: 1.595.2
1+
speakeasyVersion: 1.595.3
22
sources:
33
S2 API:
44
sourceNamespace: s-2-api
@@ -14,7 +14,7 @@ targets:
1414
sourceRevisionDigest: sha256:1e3f9a236e5b03e8b366389aecef8db454f5ab6e8e80b790e144e843cefdf85f
1515
sourceBlobDigest: sha256:a88b5983bb9a8349bc854e15958c127df65ddd0178d52938020049aefd84040d
1616
codeSamplesNamespace: s-2-api-typescript-code-samples
17-
codeSamplesRevisionDigest: sha256:42b3d065745e252275058740b8605abf7e01e5d40b3e2cdce73445f7b5d14473
17+
codeSamplesRevisionDigest: sha256:f315e03e69d0a46fd091d1f7bb1e09a03fd7ac8278d9664fee3d74a3e1847549
1818
workflow:
1919
workflowVersion: 1.0.0
2020
speakeasyVersion: latest

examples/package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

jsr.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
{
44
"name": "@s2-dev/streamstore",
5-
"version": "0.15.8",
5+
"version": "0.15.9",
66
"exports": {
77
".": "./src/index.ts",
88
"./models/errors": "./src/models/errors/index.ts",

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@s2-dev/streamstore",
3-
"version": "0.15.8",
3+
"version": "0.15.9",
44
"author": "Speakeasy",
55
"type": "module",
66
"bin": {

src/lib/config.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,8 @@ export function serverURLFromOptions(options: SDKOptions): URL | null {
5858
export const SDK_METADATA = {
5959
language: "typescript",
6060
openapiDocVersion: "1.0.0",
61-
sdkVersion: "0.15.8",
62-
genVersion: "2.670.5",
61+
sdkVersion: "0.15.9",
62+
genVersion: "2.671.2",
6363
userAgent:
64-
"speakeasy-sdk/typescript 0.15.8 2.670.5 1.0.0 @s2-dev/streamstore",
64+
"speakeasy-sdk/typescript 0.15.9 2.671.2 1.0.0 @s2-dev/streamstore",
6565
} as const;

src/lib/event-streams.ts

Lines changed: 21 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -13,34 +13,37 @@ export class EventStream<T extends ServerEvent<unknown>>
1313
extends ReadableStream<T>
1414
{
1515
constructor(
16-
stream: ReadableStream<Uint8Array>,
16+
responseBody: ReadableStream<Uint8Array>,
1717
parse: (x: ServerEvent<string>) => IteratorResult<T, undefined>,
1818
) {
19-
const reader = stream.getReader();
19+
const upstream = responseBody.getReader();
2020
let buffer: Uint8Array = new Uint8Array();
2121
super({
22-
async pull(controller) {
22+
async pull(downstream) {
2323
try {
2424
while (true) {
25-
const r = await reader.read();
26-
if (r.done) return controller.close();
27-
buffer = concatBuffer(buffer, r.value);
28-
for (const { chunk, remainder } of chunks(buffer)) {
29-
buffer = remainder;
30-
const item = parseChunk(chunk, parse);
31-
if (item?.value) controller.enqueue(item.value);
32-
if (item?.done) {
33-
await reader.cancel("done");
34-
return controller.close();
35-
}
25+
const match = findBoundary(buffer);
26+
if (!match) {
27+
const chunk = await upstream.read();
28+
if (chunk.done) return downstream.close();
29+
buffer = concatBuffer(buffer, chunk.value);
30+
continue;
31+
}
32+
const message = buffer.slice(0, match.index);
33+
buffer = buffer.slice(match.index + match.length);
34+
const item = parseMessage(message, parse);
35+
if (item?.value) return downstream.enqueue(item.value);
36+
if (item?.done) {
37+
await upstream.cancel("done");
38+
return downstream.close();
3639
}
3740
}
3841
} catch (e) {
39-
await reader.cancel(e);
40-
controller.error(e);
42+
downstream.error(e);
43+
await upstream.cancel(e);
4144
}
4245
},
43-
cancel: reason => reader.cancel(reason),
46+
cancel: reason => upstream.cancel(reason),
4447
});
4548
}
4649

@@ -105,22 +108,7 @@ function findBoundary(
105108
return null;
106109
}
107110

108-
function* chunks(
109-
remainder: Uint8Array,
110-
): Generator<{ chunk: Uint8Array; remainder: Uint8Array }> {
111-
while (true) {
112-
const match = findBoundary(remainder);
113-
if (!match) {
114-
yield { chunk: new Uint8Array(), remainder };
115-
return;
116-
}
117-
const chunk = remainder.slice(0, match.index);
118-
remainder = remainder.slice(match.index + match.length);
119-
yield { chunk, remainder };
120-
}
121-
}
122-
123-
function parseChunk<T extends ServerEvent<unknown>>(
111+
function parseMessage<T extends ServerEvent<unknown>>(
124112
chunk: Uint8Array,
125113
parse: (x: ServerEvent<string>) => IteratorResult<T, undefined>,
126114
) {

src/mcp-server/mcp-server.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ const routes = buildRouteMap({
1919
export const app = buildApplication(routes, {
2020
name: "mcp",
2121
versionInfo: {
22-
currentVersion: "0.15.8",
22+
currentVersion: "0.15.9",
2323
},
2424
});
2525

0 commit comments

Comments
 (0)