eventsourcingdb 1.9.0 → 1.10.0

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 (46) hide show
  1. package/README.md +77 -6
  2. package/dist/Client.d.ts +7 -6
  3. package/dist/Client.js +189 -204
  4. package/dist/ClientOptions.d.ts +4 -0
  5. package/dist/ClientOptions.js +1 -0
  6. package/dist/ConnectionStalledError.d.ts +4 -0
  7. package/dist/ConnectionStalledError.js +13 -0
  8. package/dist/Event.d.ts +2 -1
  9. package/dist/Event.js +58 -11
  10. package/dist/HashVerificationFailedError.d.ts +4 -0
  11. package/dist/HashVerificationFailedError.js +7 -0
  12. package/dist/HeartbeatTimeoutError.d.ts +1 -1
  13. package/dist/HeartbeatTimeoutError.js +4 -2
  14. package/dist/SignatureVerificationFailedError.d.ts +4 -0
  15. package/dist/SignatureVerificationFailedError.js +7 -0
  16. package/dist/UnsupportedHashVersionError.d.ts +4 -0
  17. package/dist/UnsupportedHashVersionError.js +7 -0
  18. package/dist/convertCloudEventToEvent.d.ts +1 -1
  19. package/dist/convertCloudEventToEvent.js +6 -1
  20. package/dist/getImageTag.d.ts +2 -0
  21. package/dist/getImageTag.js +13 -0
  22. package/dist/index.d.ts +7 -2
  23. package/dist/index.js +5 -1
  24. package/dist/json/getRawJsonElements.d.ts +2 -0
  25. package/dist/json/getRawJsonElements.js +22 -0
  26. package/dist/json/getRawJsonMember.d.ts +2 -0
  27. package/dist/json/getRawJsonMember.js +29 -0
  28. package/dist/json/scanJson.d.ts +4 -0
  29. package/dist/json/scanJson.js +65 -0
  30. package/dist/ndjson/readNdJsonStream.d.ts +7 -1
  31. package/dist/ndjson/readNdJsonStream.js +7 -28
  32. package/dist/stall/StallGuard.d.ts +14 -0
  33. package/dist/stall/StallGuard.js +83 -0
  34. package/dist/stall/createFetchTimeoutError.d.ts +2 -0
  35. package/dist/stall/createFetchTimeoutError.js +16 -0
  36. package/dist/stall/defaultStallTimeout.d.ts +3 -0
  37. package/dist/stall/defaultStallTimeout.js +6 -0
  38. package/dist/stall/formatDuration.d.ts +2 -0
  39. package/dist/stall/formatDuration.js +9 -0
  40. package/dist/stall/readResponseText.d.ts +3 -0
  41. package/dist/stall/readResponseText.js +26 -0
  42. package/dist/stall/runWithStallGuard.d.ts +6 -0
  43. package/dist/stall/runWithStallGuard.js +18 -0
  44. package/package.json +4 -4
  45. package/dist/heartbeatTimeout.d.ts +0 -4
  46. package/dist/heartbeatTimeout.js +0 -6
@@ -0,0 +1,18 @@
1
+ import { StallGuard } from './StallGuard.js';
2
+ // Runs a request that is not a stream under a stall guard. If the request
3
+ // stalls, it fails with the error of the stall, whatever fetch throws then.
4
+ const runWithStallGuard = async ({ stallTimeout, signal }, run) => {
5
+ const stallGuard = new StallGuard(stallTimeout, signal);
6
+ try {
7
+ stallGuard.restart();
8
+ return await run(stallGuard);
9
+ }
10
+ catch (error) {
11
+ stallGuard.throwIfStalled();
12
+ throw error;
13
+ }
14
+ finally {
15
+ stallGuard.dispose({ abortRequest: false });
16
+ }
17
+ };
18
+ export { runWithStallGuard };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "eventsourcingdb",
3
- "version": "1.9.0",
3
+ "version": "1.10.0",
4
4
  "description": "The official JavaScript client SDK for EventSourcingDB.",
5
5
  "author": {
6
6
  "name": "the native web GmbH",
@@ -18,11 +18,11 @@
18
18
  "dist"
19
19
  ],
20
20
  "dependencies": {
21
- "testcontainers": "12.1.0"
21
+ "testcontainers": "12.2.0"
22
22
  },
23
23
  "devDependencies": {
24
- "@biomejs/biome": "2.5.14",
25
- "@types/node": "26.6.2",
24
+ "@biomejs/biome": "2.5.15",
25
+ "@types/node": "26.6.4",
26
26
  "get-port": "7.2.0",
27
27
  "tsx": "4.23.15",
28
28
  "typescript": "7.0.2"
@@ -1,4 +0,0 @@
1
- declare const heartbeatTimeout: {
2
- milliseconds: number;
3
- };
4
- export { heartbeatTimeout };
@@ -1,6 +0,0 @@
1
- // A stream that carries heartbeats ends with a HeartbeatTimeoutError if no line
2
- // arrives for this long. The package does not export this, only tests shorten it.
3
- const heartbeatTimeout = {
4
- milliseconds: 30_000,
5
- };
6
- export { heartbeatTimeout };