@secondlayer/sdk 6.23.1 → 6.24.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/index.d.ts CHANGED
@@ -649,6 +649,13 @@ type StreamsEventsReplayParams = {
649
649
  onDumpFile: (file: StreamsDumpFile) => Promise<void> | void
650
650
  /** Called per live page after the dump phase, like `consume`. */
651
651
  onBatch: (events: StreamsEvent[], envelope: StreamsEventsEnvelope) => Promise<string | null | undefined> | string | null | undefined
652
+ /**
653
+ * Called when the live-tail phase (after the dump backfill) crosses a reorg,
654
+ * before the cursor rewinds and re-reads the now-canonical events — same
655
+ * contract as `consume`. The dump-backfill phase is finalized and never
656
+ * reorgs; omit this to leave stale rows from an orphaned fork in place.
657
+ */
658
+ onReorg?: (reorg: StreamsReorg, ctx: StreamsReorgContext) => Promise<void> | void
652
659
  mode?: "tail" | "bounded"
653
660
  batchSize?: number
654
661
  emptyBackoffMs?: number
package/dist/index.js CHANGED
@@ -1637,6 +1637,7 @@ function createStreamsClient(options) {
1637
1637
  batchSize: params.batchSize ?? 100,
1638
1638
  fetchEvents,
1639
1639
  onBatch: params.onBatch,
1640
+ onReorg: params.onReorg,
1640
1641
  emptyBackoffMs: params.emptyBackoffMs,
1641
1642
  maxPages: params.maxPages,
1642
1643
  maxEmptyPolls: params.maxEmptyPolls,
@@ -2501,5 +2502,5 @@ export {
2501
2502
  ApiError
2502
2503
  };
2503
2504
 
2504
- //# debugId=949AD5368987433264756E2164756E21
2505
+ //# debugId=3115754A9CBB338064756E2164756E21
2505
2506
  //# sourceMappingURL=index.js.map