@streamsy/core 0.16.0 → 0.17.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.
- package/dist/{create-validation-C_aJJm5u.js → create-validation-NKP81BC0.js} +1 -1
- package/dist/http/index.d.ts +1 -1
- package/dist/http/index.js +2 -2
- package/dist/{http-BNYNMGuk.js → http-aCMEaxro.js} +2 -2
- package/dist/{index-D-n48qXe.d.ts → index-DIx4D2t0.d.ts} +329 -152
- package/dist/index.d.ts +3 -3
- package/dist/index.js +52 -184
- package/dist/internal/index.d.ts +254 -26
- package/dist/internal/index.js +12 -3
- package/dist/{layer-pomDIajD.js → layer-DTOhxWkw.js} +19 -19
- package/dist/{layer-C-8GAL_W.js → layer-Dv_LBCgD.js} +15 -8
- package/dist/{program-DhW5In9U.js → program-gGLU50A1.js} +11 -9
- package/dist/protocol/index.d.ts +1 -2
- package/dist/protocol/index.js +3 -3
- package/dist/read-message-DP1UpEFl.js +660 -0
- package/dist/remote/index.d.ts +2 -2
- package/dist/remote/index.js +8 -8
- package/dist/{projection-marks-DcO_5VNd.d.ts → storage-xTb82JxJ.d.ts} +301 -462
- package/dist/{streamsy-IBFULoEr.js → streamsy-DiAjZWlT.js} +321 -94
- package/dist/testing/index.d.ts +7 -7
- package/dist/testing/index.js +28 -22
- package/package.json +4 -4
- package/dist/boundary-BTrhL8De.js +0 -371
- package/dist/read-message-CGHhOCMc.js +0 -193
package/dist/remote/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { t as __exportAll } from "../rolldown-runtime-D8jQpDG7.js";
|
|
2
|
-
import { A as
|
|
3
|
-
import {
|
|
4
|
-
import { n as validateCreateOptions } from "../create-validation-
|
|
2
|
+
import { A as ProducerGap, C as InvalidAppendRequest, D as InvalidReadRequest, E as InvalidForkRequest, F as StreamNotFound, H as isValid, K as Offset, L as StreamsReader, M as StreamBusy, N as StreamClosed, O as NotSupported, P as StreamGone, Q as StreamId, R as StreamsWriter, S as ForkSourceNotFound, b as AppendConflict, j as StaleEpoch, k as OffsetMismatch, n as bind, v as AppendResult, w as InvalidCreateRequest, x as CreateConflict, y as CreateResult } from "../streamsy-DiAjZWlT.js";
|
|
3
|
+
import { F as TransportFault } from "../read-message-DP1UpEFl.js";
|
|
4
|
+
import { n as validateCreateOptions } from "../create-validation-NKP81BC0.js";
|
|
5
5
|
import { Array, Context, DateTime, Effect, Exit, Fiber, Layer, Option, Pull, Schema, Scope, Semaphore, Stream } from "effect";
|
|
6
6
|
import { HttpClient, HttpClientRequest } from "effect/http";
|
|
7
7
|
import { Sse } from "effect/encoding";
|
|
@@ -162,13 +162,13 @@ const head = (operation, response, context) => Effect.gen(function* () {
|
|
|
162
162
|
if (response.status === 410) return yield* new StreamGone({ id: context.id });
|
|
163
163
|
if (response.status !== 200) return yield* unexpected(operation, response);
|
|
164
164
|
const contentType$2 = yield* contentType(operation, response);
|
|
165
|
-
const
|
|
165
|
+
const offset$2 = yield* offset(operation, response);
|
|
166
166
|
const ttlSeconds = yield* integer(operation, "stream-ttl", header(response, "stream-ttl"));
|
|
167
167
|
const expiresAt = header(response, "stream-expires-at");
|
|
168
168
|
if (expiresAt !== void 0 && Option.isNone(DateTime.make(expiresAt))) return yield* failure(operation, "response", `Invalid stream-expires-at header: ${expiresAt}`, void 0, response.status);
|
|
169
169
|
return {
|
|
170
170
|
contentType: contentType$2,
|
|
171
|
-
|
|
171
|
+
offset: offset$2,
|
|
172
172
|
ttlSeconds,
|
|
173
173
|
expiresAt,
|
|
174
174
|
closed: yield* closedHeader(operation, response)
|
|
@@ -178,7 +178,7 @@ const create = (operation, response, context) => Effect.gen(function* () {
|
|
|
178
178
|
if (response.status === 200 || response.status === 201) {
|
|
179
179
|
const contentType$1 = yield* contentType(operation, response);
|
|
180
180
|
const fields = {
|
|
181
|
-
|
|
181
|
+
offset: yield* offset(operation, response),
|
|
182
182
|
contentType: contentType$1,
|
|
183
183
|
closed: yield* closedHeader(operation, response)
|
|
184
184
|
};
|
|
@@ -359,7 +359,7 @@ const remove = (operation, response, context) => Effect.gen(function* () {
|
|
|
359
359
|
// src/remote/sse-response.ts
|
|
360
360
|
const operation = "readNext";
|
|
361
361
|
const control = Schema.fromJsonString(Schema.Struct({
|
|
362
|
-
streamNextOffset:
|
|
362
|
+
streamNextOffset: Offset,
|
|
363
363
|
streamCursor: Schema.optionalKey(Schema.String),
|
|
364
364
|
streamClosed: Schema.optionalKey(Schema.Boolean),
|
|
365
365
|
upToDate: Schema.optionalKey(Schema.Boolean)
|
|
@@ -448,7 +448,7 @@ const sseReadNext = (owner, open) => {
|
|
|
448
448
|
const read = (id, input, slot) => Effect.gen(function* () {
|
|
449
449
|
const connection = slot.connection;
|
|
450
450
|
if (connection?.pull !== void 0 && connection.offset === input.offset && (input.cursor === void 0 || connection.cursor === input.cursor)) {
|
|
451
|
-
const batch = yield* connection.pull.pipe(Effect.catchTag("TransportFault", (fault) => fault.
|
|
451
|
+
const batch = yield* connection.pull.pipe(Effect.catchTag("TransportFault", (fault) => fault.isRetryable ? Effect.void : Effect.fail(fault)));
|
|
452
452
|
if (batch !== void 0) return batch;
|
|
453
453
|
}
|
|
454
454
|
yield* discard(slot);
|