@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.
@@ -1,7 +1,7 @@
1
1
  import { t as __exportAll } from "../rolldown-runtime-D8jQpDG7.js";
2
- import { A as StreamBusy, B as isValid, D as OffsetMismatch, E as NotSupported, F as StreamsReader, I as StreamsWriter, M as StreamGone, N as StreamNotFound, O as ProducerGap, S as InvalidCreateRequest, T as InvalidReadRequest, X as StreamId, _ as CreateResult, b as ForkSourceNotFound, g as AppendResult, j as StreamClosed, k as StaleEpoch, n as bind, v as AppendConflict, w as InvalidForkRequest, x as InvalidAppendRequest, y as CreateConflict } from "../streamsy-IBFULoEr.js";
3
- import { y as TransportFault } from "../read-message-CGHhOCMc.js";
4
- import { n as validateCreateOptions } from "../create-validation-C_aJJm5u.js";
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 nextOffset = yield* offset(operation, response);
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
- nextOffset,
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
- nextOffset: yield* offset(operation, response),
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: Schema.String.check(Schema.makeFilter(isValid)),
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.retryable ? Effect.void : Effect.fail(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);