@streamsy/core 0.8.0 → 0.9.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/README.md CHANGED
@@ -3,7 +3,7 @@
3
3
  An Effect implementation of the [Durable Streams](https://durablestreams.com)
4
4
  protocol. Typed stream declarations, stream services, an in-process memory Layer, an
5
5
  HTTP app, and a client for remote hosts. Requires
6
- `effect@4.0.5`.
6
+ `effect@4.1.2`.
7
7
 
8
8
  ```sh
9
9
  bun add @streamsy/core effect
@@ -1,2 +1,2 @@
1
- import { H as HttpOptions, U as app, V as streamPath, a as securityHeaders, c as read, d as routes, i as layerShutdownSignal, l as Access, n as ShutdownSignal, o as ReadOptions, r as ShutdownSignalService, s as checkReadOptions, u as RoutesOptions } from "../index-DzptR3sL.js";
1
+ import { H as HttpOptions, U as app, V as streamPath, a as securityHeaders, c as read, d as routes, i as layerShutdownSignal, l as Access, n as ShutdownSignal, o as ReadOptions, r as ShutdownSignalService, s as checkReadOptions, u as RoutesOptions } from "../index-CtXiBkjV.js";
2
2
  export { type Access, type HttpOptions, type ReadOptions, type RoutesOptions, ShutdownSignal, type ShutdownSignalService, app, checkReadOptions, layerShutdownSignal, read, routes, securityHeaders, streamPath };
@@ -1,4 +1,4 @@
1
- import { A as ReadNextResult, B as HeadError, C as StreamsReader, Ct as EncodeFault, D as CreateResult, E as AppendResult, Et as TransportFault, F as AppendErrorFor, G as InvalidReadRequest, K as NotSupported, N as AppendConflict, O as HeadResult, Q as RemoveError, R as CreateError, S as Reader, St as DecodeFault, T as Writer, Tt as StreamsFault, Z as ReadNextError, a as CommitHooks, at as AppendCallOptions, c as OwnerRecords, ct as ReadNextOptions, et as StreamBusy, lt as ReadOptions$1, n as ProjectionMarks, nt as StreamGone, q as OffsetMismatch, rt as StreamNotFound, st as ProducerOptions, tt as StreamClosed, u as Storage, ut as CreateOptions, w as StreamsWriter, wt as StorageFault, yt as StreamId } from "./projection-marks-OtKtjFLH.js";
1
+ import { A as ReadNextResult, B as HeadError, C as StreamsReader, Ct as EncodeFault, D as CreateResult, E as AppendResult, Et as TransportFault, F as AppendErrorFor, G as InvalidReadRequest, K as NotSupported, N as AppendConflict, O as HeadResult, Q as RemoveError, R as CreateError, S as Reader, St as DecodeFault, T as Writer, Tt as StreamsFault, Z as ReadNextError, a as CommitHooks, at as AppendCallOptions, c as OwnerRecords, ct as ReadNextOptions, et as StreamBusy, lt as ReadOptions$1, n as ProjectionMarks, nt as StreamGone, q as OffsetMismatch, rt as StreamNotFound, st as ProducerOptions, tt as StreamClosed, u as Storage, ut as CreateOptions, w as StreamsWriter, wt as StorageFault, yt as StreamId } from "./projection-marks-Ca0Q-L9H.js";
2
2
  import { Array, Context, Data, Duration, Effect, Function, Layer, Option, Schedule, Schema, Stream } from "effect";
3
3
  import { HttpRouter, HttpServerRequest, HttpServerResponse } from "effect/http";
4
4
  import { SqlError } from "effect/sql";
@@ -414,113 +414,21 @@ type WakeItem = Data.TaggedEnum<{
414
414
  };
415
415
  }>;
416
416
  /** Constructors and matchers for `WakeItem`. */
417
- declare const WakeItem: {
418
- readonly $is: <Tag extends "Dirty" | "Removed" | "Reset" | "Snapshot">(tag: Tag) => (u: unknown) => u is Extract<{
419
- readonly _tag: "Dirty";
420
- readonly stream: StreamId;
421
- readonly from: string;
422
- readonly offset: string;
423
- readonly closed: boolean;
424
- }, {
425
- readonly _tag: Tag;
426
- }> | Extract<{
427
- readonly _tag: "Removed";
428
- readonly stream: StreamId;
429
- }, {
430
- readonly _tag: Tag;
431
- }> | Extract<{
432
- readonly _tag: "Reset";
433
- }, {
434
- readonly _tag: Tag;
435
- }> | Extract<{
436
- readonly _tag: "Snapshot";
437
- readonly streams: ReadonlySet<StreamId>;
438
- }, {
439
- readonly _tag: Tag;
440
- }>;
441
- readonly $match: {
442
- <Cases extends { readonly [Tag in "Dirty" | "Removed" | "Reset" | "Snapshot"]: (args: Extract<{
443
- readonly _tag: "Dirty";
444
- readonly stream: StreamId;
445
- readonly from: string;
446
- readonly offset: string;
447
- readonly closed: boolean;
448
- } | {
449
- readonly _tag: "Removed";
450
- readonly stream: StreamId;
451
- } | {
452
- readonly _tag: "Reset";
453
- } | {
454
- readonly _tag: "Snapshot";
455
- readonly streams: ReadonlySet<StreamId>;
456
- }, {
457
- readonly _tag: Tag;
458
- }>) => any; }>(cases: Cases): (value: {
459
- readonly _tag: "Dirty";
460
- readonly stream: StreamId;
461
- readonly from: string;
462
- readonly offset: string;
463
- readonly closed: boolean;
464
- } | {
465
- readonly _tag: "Removed";
466
- readonly stream: StreamId;
467
- } | {
468
- readonly _tag: "Reset";
469
- } | {
470
- readonly _tag: "Snapshot";
471
- readonly streams: ReadonlySet<StreamId>;
472
- }) => import("effect/Unify").Unify<ReturnType<Cases["Dirty" | "Removed" | "Reset" | "Snapshot"]>>;
473
- <Cases extends { readonly [Tag in "Dirty" | "Removed" | "Reset" | "Snapshot"]: (args: Extract<{
474
- readonly _tag: "Dirty";
475
- readonly stream: StreamId;
476
- readonly from: string;
477
- readonly offset: string;
478
- readonly closed: boolean;
479
- } | {
480
- readonly _tag: "Removed";
481
- readonly stream: StreamId;
482
- } | {
483
- readonly _tag: "Reset";
484
- } | {
485
- readonly _tag: "Snapshot";
486
- readonly streams: ReadonlySet<StreamId>;
487
- }, {
488
- readonly _tag: Tag;
489
- }>) => any; }>(value: {
490
- readonly _tag: "Dirty";
491
- readonly stream: StreamId;
492
- readonly from: string;
493
- readonly offset: string;
494
- readonly closed: boolean;
495
- } | {
496
- readonly _tag: "Removed";
497
- readonly stream: StreamId;
498
- } | {
499
- readonly _tag: "Reset";
500
- } | {
501
- readonly _tag: "Snapshot";
502
- readonly streams: ReadonlySet<StreamId>;
503
- }, cases: Cases): import("effect/Unify").Unify<ReturnType<Cases["Dirty" | "Removed" | "Reset" | "Snapshot"]>>;
504
- };
505
- readonly Dirty: Data.TaggedEnum.ConstructorFrom<{
506
- readonly _tag: "Dirty";
507
- readonly stream: StreamId;
508
- readonly from: string;
509
- readonly offset: string;
510
- readonly closed: boolean;
511
- }, "_tag">;
512
- readonly Removed: Data.TaggedEnum.ConstructorFrom<{
513
- readonly _tag: "Removed";
514
- readonly stream: StreamId;
515
- }, "_tag">;
516
- readonly Reset: Data.TaggedEnum.ConstructorFrom<{
517
- readonly _tag: "Reset";
518
- }, "_tag">;
519
- readonly Snapshot: Data.TaggedEnum.ConstructorFrom<{
520
- readonly _tag: "Snapshot";
521
- readonly streams: ReadonlySet<StreamId>;
522
- }, "_tag">;
523
- };
417
+ declare const WakeItem: Data.TaggedEnum.Constructor<{
418
+ readonly _tag: "Dirty";
419
+ readonly stream: StreamId;
420
+ readonly from: string;
421
+ readonly offset: string;
422
+ readonly closed: boolean;
423
+ } | {
424
+ readonly _tag: "Removed";
425
+ readonly stream: StreamId;
426
+ } | {
427
+ readonly _tag: "Reset";
428
+ } | {
429
+ readonly _tag: "Snapshot";
430
+ readonly streams: ReadonlySet<StreamId>;
431
+ }>;
524
432
  /** One batch of wake actions. Save `offset` as the wake cursor after every item is handled. */
525
433
  interface WakeBatch {
526
434
  readonly items: ReadonlyArray<WakeItem>;
package/dist/index.d.ts CHANGED
@@ -1,3 +1,3 @@
1
- import { $ as StaleEpoch, A as ReadNextResult, B as HeadError, Ct as EncodeFault, D as CreateResult, Dt as isRetryableFault, E as AppendResult, Et as TransportFault, F as AppendErrorFor, G as InvalidReadRequest, H as InvalidCreateRequest, I as CreateConflict, J as ProducerGap, K as NotSupported, L as CreateConflictReason, M as AppendBaseError, N as AppendConflict, O as HeadResult, Ot as isStreamsFault, P as AppendError, Q as RemoveError, R as CreateError, St as DecodeFault, Tt as StreamsFault, U as InvalidEpochSeq, V as InvalidAppendRequest, W as InvalidForkRequest, X as ReadError, Y as ProtocolError, Z as ReadNextError, _ as OperationResult, _t as StoredMessage, at as AppendCallOptions, b as ProducerPrecondition, bt as StreamLifecycle, ct as ReadNextOptions, d as StorageShape, dt as ChangeSnapshot, et as StreamBusy, f as Mutation, ft as MessageWindow, g as Operation, gt as RecordPatch, h as Mutations, ht as ProducerState, it as isProtocolError, j as ReadResult, k as ReadMessage, lt as ReadOptions, m as MutationRejected, mt as ProducerId, nt as StreamGone, ot as AppendOptions, p as MutationApplied, pt as Offset, q as OffsetMismatch, rt as StreamNotFound, st as ProducerOptions, tt as StreamClosed, u as Storage, ut as CreateOptions, v as OperationResults, vt as StreamConfig, wt as StorageFault, x as StorageCapabilities, xt as StreamRecord, y as Operations, yt as StreamId, z as ForkSourceNotFound } from "./projection-marks-OtKtjFLH.js";
2
- import { A as durable_state_d_exports, B as address_d_exports, C as FollowFailure, E as RemoveFailure, F as CommitBoundary, I as CommitBoundaryApi, L as ZERO_OFFSET, O as streamsy_d_exports, R as compare, S as Folded, T as ReadFailure, _ as Collected, b as Decided, g as Batch, h as AppendFailure, j as streams_d_exports, k as producer_d_exports, t as index_d_exports, v as CreateFailure, w as HeadFailure, x as Decision, y as DecideSpec } from "./index-DzptR3sL.js";
1
+ import { $ as StaleEpoch, A as ReadNextResult, B as HeadError, Ct as EncodeFault, D as CreateResult, Dt as isRetryableFault, E as AppendResult, Et as TransportFault, F as AppendErrorFor, G as InvalidReadRequest, H as InvalidCreateRequest, I as CreateConflict, J as ProducerGap, K as NotSupported, L as CreateConflictReason, M as AppendBaseError, N as AppendConflict, O as HeadResult, Ot as isStreamsFault, P as AppendError, Q as RemoveError, R as CreateError, St as DecodeFault, Tt as StreamsFault, U as InvalidEpochSeq, V as InvalidAppendRequest, W as InvalidForkRequest, X as ReadError, Y as ProtocolError, Z as ReadNextError, _ as OperationResult, _t as StoredMessage, at as AppendCallOptions, b as ProducerPrecondition, bt as StreamLifecycle, ct as ReadNextOptions, d as StorageShape, dt as ChangeSnapshot, et as StreamBusy, f as Mutation, ft as MessageWindow, g as Operation, gt as RecordPatch, h as Mutations, ht as ProducerState, it as isProtocolError, j as ReadResult, k as ReadMessage, lt as ReadOptions, m as MutationRejected, mt as ProducerId, nt as StreamGone, ot as AppendOptions, p as MutationApplied, pt as Offset, q as OffsetMismatch, rt as StreamNotFound, st as ProducerOptions, tt as StreamClosed, u as Storage, ut as CreateOptions, v as OperationResults, vt as StreamConfig, wt as StorageFault, x as StorageCapabilities, xt as StreamRecord, y as Operations, yt as StreamId, z as ForkSourceNotFound } from "./projection-marks-Ca0Q-L9H.js";
2
+ import { A as durable_state_d_exports, B as address_d_exports, C as FollowFailure, E as RemoveFailure, F as CommitBoundary, I as CommitBoundaryApi, L as ZERO_OFFSET, O as streamsy_d_exports, R as compare, S as Folded, T as ReadFailure, _ as Collected, b as Decided, g as Batch, h as AppendFailure, j as streams_d_exports, k as producer_d_exports, t as index_d_exports, v as CreateFailure, w as HeadFailure, x as Decision, y as DecideSpec } from "./index-CtXiBkjV.js";
3
3
  export { AppendBaseError, type AppendCallOptions, AppendConflict, AppendError, AppendErrorFor, type AppendFailure, type AppendOptions, AppendResult, type Batch, ChangeSnapshot, type Collected, CommitBoundary, type CommitBoundaryApi, CreateConflict, CreateConflictReason, CreateError, type CreateFailure, type CreateOptions, CreateResult, type DecideSpec, type Decided, type Decision, DecodeFault, durable_state_d_exports as DurableState, EncodeFault, type Folded, type FollowFailure, ForkSourceNotFound, HeadError, type HeadFailure, type HeadResult, index_d_exports as Http, InvalidAppendRequest, InvalidCreateRequest, InvalidEpochSeq, InvalidForkRequest, InvalidReadRequest, streams_d_exports as MemoryStorage, MessageWindow, Mutation, MutationApplied, MutationRejected, Mutations, NotSupported, Offset, OffsetMismatch, Operation, OperationResult, OperationResults, Operations, producer_d_exports as Producer, ProducerGap, ProducerId, type ProducerOptions, ProducerPrecondition, ProducerState, ProtocolError, ReadError, type ReadFailure, type ReadMessage, ReadNextError, type ReadNextOptions, type ReadNextResult, type ReadOptions, type ReadResult, RecordPatch, RemoveError, type RemoveFailure, StaleEpoch, Storage, StorageCapabilities, StorageFault, type StorageShape, StoredMessage, address_d_exports as StreamAddress, StreamBusy, StreamClosed, StreamConfig, StreamGone, StreamId, StreamLifecycle, StreamNotFound, StreamRecord, StreamsFault, streamsy_d_exports as Streamsy, TransportFault, ZERO_OFFSET, compare, isProtocolError, isRetryableFault, isStreamsFault };
@@ -1,4 +1,4 @@
1
- import { a as CommitHooks, c as OwnerRecords, i as CommitHook, l as OwnerRecordsApi, n as ProjectionMarks, o as CommitHooksApi, r as ProjectionMarksApi, s as commitHookRegistry, t as PendingMark } from "../projection-marks-OtKtjFLH.js";
1
+ import { a as CommitHooks, c as OwnerRecords, i as CommitHook, l as OwnerRecordsApi, n as ProjectionMarks, o as CommitHooksApi, r as ProjectionMarksApi, s as commitHookRegistry, t as PendingMark } from "../projection-marks-Ca0Q-L9H.js";
2
2
  import { Context, Effect } from "effect";
3
3
  /** Private bridge: a stream guard dies with this sentinel; the atomic runner translates it. */
4
4
  declare const ForeignOwnerType: unique symbol;