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

Commit 36ecc93

Browse files
feat: append retries
1 parent 083ade6 commit 36ecc93

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

78 files changed

+705
-1485
lines changed

.speakeasy/gen.lock

Lines changed: 32 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
lockVersion: 2.0.0
22
id: 2d20490e-9921-47d5-9711-d3c4b91c8cfa
33
management:
4-
docChecksum: bbcb28d2548a56b38ad64847eb7a88d2
4+
docChecksum: 9e7339e5177c40c4866ea6111dc794d6
55
docVersion: 1.0.0
6-
speakeasyVersion: 1.487.0
6+
speakeasyVersion: 1.487.1
77
generationVersion: 2.506.0
8-
releaseVersion: 0.3.9
9-
configChecksum: 2df4142ae1198abc894789b95b9611b9
8+
releaseVersion: 0.3.13
9+
configChecksum: a2cdc39cee0d581da5f5c6a903782e39
1010
repoURL: https://github.com/s2-streamstore/s2-sdk-typescript.git
1111
installationURL: https://github.com/s2-streamstore/s2-sdk-typescript
1212
published: true
@@ -58,7 +58,6 @@ generatedFiles:
5858
- docs/models/components/firstseqnum.md
5959
- docs/models/components/formatoption.md
6060
- docs/models/components/header.md
61-
- docs/models/components/httpmetadata.md
6261
- docs/models/components/listbasinsresponse.md
6362
- docs/models/components/liststreamsresponse.md
6463
- docs/models/components/nextseqnum.md
@@ -75,22 +74,15 @@ generatedFiles:
7574
- docs/models/components/streaminfo.md
7675
- docs/models/errors/errorresponse.md
7776
- docs/models/errors/notfounderror.md
77+
- docs/models/errors/retryableerror.md
7878
- docs/models/operations/appendrequest.md
79-
- docs/models/operations/appendresponse.md
8079
- docs/models/operations/checktailrequest.md
81-
- docs/models/operations/checktailresponse.md
8280
- docs/models/operations/createbasinrequest.md
83-
- docs/models/operations/createbasinresponse.md
8481
- docs/models/operations/createstreamrequest.md
85-
- docs/models/operations/createstreamresponse.md
8682
- docs/models/operations/deletebasinrequest.md
87-
- docs/models/operations/deletebasinresponse.md
8883
- docs/models/operations/deletestreamrequest.md
89-
- docs/models/operations/deletestreamresponse.md
9084
- docs/models/operations/getbasinconfigrequest.md
91-
- docs/models/operations/getbasinconfigresponse.md
9285
- docs/models/operations/getstreamconfigrequest.md
93-
- docs/models/operations/getstreamconfigresponse.md
9486
- docs/models/operations/headers2format.md
9587
- docs/models/operations/limit.md
9688
- docs/models/operations/listbasinsrequest.md
@@ -100,9 +92,7 @@ generatedFiles:
10092
- docs/models/operations/readrequest.md
10193
- docs/models/operations/readresponse.md
10294
- docs/models/operations/reconfigurebasinrequest.md
103-
- docs/models/operations/reconfigurebasinresponse.md
10495
- docs/models/operations/reconfigurestreamrequest.md
105-
- docs/models/operations/reconfigurestreamresponse.md
10696
- docs/models/operations/s2format.md
10797
- docs/sdks/account/README.md
10898
- docs/sdks/basin/README.md
@@ -158,7 +148,6 @@ generatedFiles:
158148
- src/models/components/createstreamrequest.ts
159149
- src/models/components/formatoption.ts
160150
- src/models/components/header.ts
161-
- src/models/components/httpmetadata.ts
162151
- src/models/components/index.ts
163152
- src/models/components/listbasinsresponse.ts
164153
- src/models/components/liststreamsresponse.ts
@@ -176,6 +165,7 @@ generatedFiles:
176165
- src/models/errors/httpclienterrors.ts
177166
- src/models/errors/index.ts
178167
- src/models/errors/notfounderror.ts
168+
- src/models/errors/retryableerror.ts
179169
- src/models/errors/sdkvalidationerror.ts
180170
- src/models/operations/append.ts
181171
- src/models/operations/checktail.ts
@@ -215,6 +205,8 @@ examples:
215205
application/json: {"error": "<value>"}
216206
"500":
217207
application/json: {"error": "<value>"}
208+
"499":
209+
application/json: {"error": "<value>"}
218210
get_basin_config:
219211
speakeasy-default-get-basin-config:
220212
parameters:
@@ -227,6 +219,8 @@ examples:
227219
application/json: {"error": "<value>"}
228220
"500":
229221
application/json: {"error": "<value>"}
222+
"499":
223+
application/json: {"error": "<value>"}
230224
create_basin:
231225
speakeasy-default-create-basin:
232226
parameters:
@@ -242,6 +236,8 @@ examples:
242236
application/json: {"error": "<value>"}
243237
"500":
244238
application/json: {"error": "<value>"}
239+
"499":
240+
application/json: {"error": "<value>"}
245241
delete_basin:
246242
speakeasy-default-delete-basin:
247243
parameters:
@@ -254,6 +250,8 @@ examples:
254250
application/json: {"error": "<value>"}
255251
"404":
256252
application/json: {"error": "<value>"}
253+
"499":
254+
application/json: {"error": "<value>"}
257255
list_streams:
258256
speakeasy-default-list-streams:
259257
responses:
@@ -263,6 +261,8 @@ examples:
263261
application/json: {"error": "<value>"}
264262
"500":
265263
application/json: {"error": "<value>"}
264+
"499":
265+
application/json: {"error": "<value>"}
266266
get_stream_config:
267267
speakeasy-default-get-stream-config:
268268
parameters:
@@ -275,6 +275,8 @@ examples:
275275
application/json: {"error": "<value>"}
276276
"500":
277277
application/json: {"error": "<value>"}
278+
"499":
279+
application/json: {"error": "<value>"}
278280
create_stream:
279281
speakeasy-default-create-stream:
280282
parameters:
@@ -290,6 +292,8 @@ examples:
290292
application/json: {"error": "<value>"}
291293
"500":
292294
application/json: {"error": "<value>"}
295+
"499":
296+
application/json: {"error": "<value>"}
293297
delete_stream:
294298
speakeasy-default-delete-stream:
295299
parameters:
@@ -302,6 +306,8 @@ examples:
302306
application/json: {"error": "<value>"}
303307
"404":
304308
application/json: {"error": "<value>"}
309+
"499":
310+
application/json: {"error": "<value>"}
305311
read:
306312
speakeasy-default-read:
307313
parameters:
@@ -316,6 +322,8 @@ examples:
316322
application/json: {"error": "<value>"}
317323
"500":
318324
application/json: {"error": "<value>"}
325+
"499":
326+
application/json: {"error": "<value>"}
319327
append:
320328
speakeasy-default-append:
321329
parameters:
@@ -331,6 +339,8 @@ examples:
331339
application/json: {"error": "<value>"}
332340
"500":
333341
application/json: {"error": "<value>"}
342+
"499":
343+
application/json: {"error": "<value>"}
334344
check_tail:
335345
speakeasy-default-check-tail:
336346
parameters:
@@ -343,6 +353,8 @@ examples:
343353
application/json: {"error": "<value>"}
344354
"500":
345355
application/json: {"error": "<value>"}
356+
"499":
357+
application/json: {"error": "<value>"}
346358
reconfigure_basin:
347359
speakeasy-default-reconfigure-basin:
348360
parameters:
@@ -357,6 +369,8 @@ examples:
357369
application/json: {"error": "<value>"}
358370
"500":
359371
application/json: {"error": "<value>"}
372+
"499":
373+
application/json: {"error": "<value>"}
360374
reconfigure_stream:
361375
speakeasy-default-reconfigure-stream:
362376
parameters:
@@ -371,5 +385,7 @@ examples:
371385
application/json: {"error": "<value>"}
372386
"500":
373387
application/json: {"error": "<value>"}
388+
"499":
389+
application/json: {"error": "<value>"}
374390
examplesVersion: 1.0.0
375391
generatedTests: {}

.speakeasy/gen.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ generation:
1616
oAuth2ClientCredentialsEnabled: true
1717
oAuth2PasswordEnabled: true
1818
typescript:
19-
version: 0.3.9
19+
version: 0.3.13
2020
additionalDependencies:
2121
dependencies:
2222
uuid: ^9.0.1
@@ -48,6 +48,6 @@ typescript:
4848
moduleFormat: commonjs
4949
outputModelSuffix: output
5050
packageName: '@s2-dev/streamstore'
51-
responseFormat: envelope-http
51+
responseFormat: flat
5252
templateVersion: v2
5353
useIndexModules: true

.speakeasy/workflow.lock

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
1-
speakeasyVersion: 1.487.0
1+
speakeasyVersion: 1.487.1
22
sources:
33
S2 API:
44
sourceNamespace: s-2-api
5-
sourceRevisionDigest: sha256:d03ee4e15b5b1ab905c13df4f9f09d9add26b87a0e23eacd68ae64a999c7b37b
6-
sourceBlobDigest: sha256:eda67f586b78ceb1300a3662669e008175f0667b68ff804d4de23fcab20998d1
5+
sourceRevisionDigest: sha256:bd08c3ccd5d5347310d96e50095603fed7338051f50fd6a653219163e2bed605
6+
sourceBlobDigest: sha256:1916df0ae96a183ac624477f5f040a1414053315f7d583bf3638d7ec5fd1c040
77
tags:
88
- latest
99
- 1.0.0
1010
targets:
1111
streamstore:
1212
source: S2 API
1313
sourceNamespace: s-2-api
14-
sourceRevisionDigest: sha256:d03ee4e15b5b1ab905c13df4f9f09d9add26b87a0e23eacd68ae64a999c7b37b
15-
sourceBlobDigest: sha256:eda67f586b78ceb1300a3662669e008175f0667b68ff804d4de23fcab20998d1
14+
sourceRevisionDigest: sha256:bd08c3ccd5d5347310d96e50095603fed7338051f50fd6a653219163e2bed605
15+
sourceBlobDigest: sha256:1916df0ae96a183ac624477f5f040a1414053315f7d583bf3638d7ec5fd1c040
1616
codeSamplesNamespace: s-2-api-typescript-code-samples
17-
codeSamplesRevisionDigest: sha256:2fdd955e5e57b6d282f7b6c9254454745e1430ba10fb78cfcde38d37d57a43d2
17+
codeSamplesRevisionDigest: sha256:ae55ab81c7e9a2650b87f14d6138db98c7f3a77bf8b4731237cfdf92af078d5d
1818
workflow:
1919
workflowVersion: 1.0.0
2020
speakeasyVersion: latest

README.md

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -242,11 +242,7 @@ async function run() {
242242
stream: "<value>",
243243
});
244244

245-
if (result.readResponse == null) {
246-
throw new Error("failed to create stream: received null value");
247-
}
248-
249-
for await (const event of result.readResponse) {
245+
for await (const event of result) {
250246
// Handle the event
251247
console.log(event);
252248
}
@@ -367,18 +363,20 @@ run();
367363

368364
Some methods specify known errors which can be thrown. All the known errors are enumerated in the `models/errors/errors.ts` module. The known errors for a method are documented under the *Errors* tables in SDK docs. For example, the `listBasins` method may throw the following errors:
369365

370-
| Error Type | Status Code | Content Type |
371-
| -------------------- | ----------- | ---------------- |
372-
| errors.ErrorResponse | 400, 401 | application/json |
373-
| errors.ErrorResponse | 500 | application/json |
374-
| errors.APIError | 4XX, 5XX | \*/\* |
366+
| Error Type | Status Code | Content Type |
367+
| --------------------- | ------------- | ---------------- |
368+
| errors.ErrorResponse | 400, 401 | application/json |
369+
| errors.RetryableError | 499 | application/json |
370+
| errors.RetryableError | 500, 503, 504 | application/json |
371+
| errors.APIError | 4XX, 5XX | \*/\* |
375372

376373
If the method throws an error and it is not captured by the known errors, it will default to throwing a `APIError`.
377374

378375
```typescript
379376
import { S2 } from "@s2-dev/streamstore";
380377
import {
381378
ErrorResponse,
379+
RetryableError,
382380
SDKValidationError,
383381
} from "@s2-dev/streamstore/models/errors";
384382

@@ -410,8 +408,13 @@ async function run() {
410408
console.error(err);
411409
return;
412410
}
413-
case (err instanceof ErrorResponse): {
414-
// Handle err.data$: ErrorResponseData
411+
case (err instanceof RetryableError): {
412+
// Handle err.data$: RetryableErrorData
413+
console.error(err);
414+
return;
415+
}
416+
case (err instanceof RetryableError): {
417+
// Handle err.data$: RetryableErrorData
415418
console.error(err);
416419
return;
417420
}

docs/models/components/age.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ If set to 0, the stream will have infinite retention.
99
import { Age } from "@s2-dev/streamstore/models/components";
1010

1111
let value: Age = {
12-
age: 97,
12+
age: 57,
1313
};
1414
```
1515

docs/models/components/appendoutput.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@ Output from append response.
88
import { AppendOutput } from "@s2-dev/streamstore/models/components";
99

1010
let value: AppendOutput = {
11-
endSeqNum: 639921,
12-
nextSeqNum: 143353,
13-
startSeqNum: 944669,
11+
endSeqNum: 414662,
12+
nextSeqNum: 264555,
13+
startSeqNum: 774234,
1414
};
1515
```
1616

docs/models/components/basininfo.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ let value: BasinInfo = {
1111
cell: "<value>",
1212
name: "<value>",
1313
scope: "<value>",
14-
state: "active",
14+
state: "deleting",
1515
};
1616
```
1717

docs/models/components/basinstate.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ Current state of the basin.
77
```typescript
88
import { BasinState } from "@s2-dev/streamstore/models/components";
99

10-
let value: BasinState = "creating";
10+
let value: BasinState = "active";
1111
```
1212

1313
## Values

docs/models/components/checktailresponse.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ Check tail response.
88
import { CheckTailResponse } from "@s2-dev/streamstore/models/components";
99

1010
let value: CheckTailResponse = {
11-
nextSeqNum: 521848,
11+
nextSeqNum: 456150,
1212
};
1313
```
1414

docs/models/components/formatoption.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
```typescript
66
import { FormatOption } from "@s2-dev/streamstore/models/components";
77

8-
let value: FormatOption = "json";
8+
let value: FormatOption = "json-binsafe";
99
```
1010

1111
## Values

0 commit comments

Comments
 (0)