@pattern-stack/codegen 0.13.0 → 0.13.1

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.
@@ -26,7 +26,7 @@ export { IntegrationRunSummary } from './integration/integration-run-recorder.pr
26
26
  export { IEntityChangeSourceRegistry, UnknownEntityError } from './integration/entity-change-source-registry.protocol.js';
27
27
  export { MemoryEntityChangeSourceRegistry } from './integration/entity-change-source-registry.memory.js';
28
28
  export { CURSOR_DIVISIBILITY, ResolvedFilter, isDivisibleCursor } from './integration/detection-config.schema.js';
29
- export { IncrementalRead, IncrementalReadBase, RandomRead, ReadMode, ReadRequest, Ref, SourcedRecord, mapConcurrent } from './integration/incremental-read.js';
29
+ export { IncrementalRead, IncrementalReadBase, RandomRead, ReadContext, ReadMode, ReadRequest, Ref, SourcedRecord, mapConcurrent } from './integration/incremental-read.js';
30
30
  export { ENTITY_CHANGE_SOURCE_REGISTRY, INTEGRATION_CHANGE_SOURCE, INTEGRATION_SINK } from './integration/integration.tokens.js';
31
31
  export { ExecuteIntegrationUseCase } from './integration/execute-integration.use-case.js';
32
32
  export { AuthCredentials, AuthResolveOptions, IAuthStrategy } from './auth/protocols/auth-strategy.js';
@@ -4483,11 +4483,14 @@ var IncrementalReadBase = class {
4483
4483
  * adapter cannot hydrate-then-discard. A hydrate miss (deleted mid-run) is
4484
4484
  * skipped, never fabricated.
4485
4485
  */
4486
- async *read(req) {
4487
- for await (const refPage of this.enumerate(req.mode, req.filter, req.pageSize)) {
4486
+ async *read(req, ctx) {
4487
+ for await (const refPage of this.enumerate(req.mode, req.filter, req.pageSize, ctx)) {
4488
4488
  const kept = refPage.filter((ref) => this.matchesRef(ref, req.filter));
4489
4489
  if (kept.length === 0) continue;
4490
- const raws = await this.hydrate(kept.map((ref) => ref.externalId));
4490
+ const raws = await this.hydrate(
4491
+ kept.map((ref) => ref.externalId),
4492
+ ctx
4493
+ );
4491
4494
  for (const ref of kept) {
4492
4495
  const raw = raws.get(ref.externalId);
4493
4496
  if (raw === void 0 || raw === null) continue;
@@ -4503,8 +4506,8 @@ var IncrementalReadBase = class {
4503
4506
  * `toCanonical ∘ hydrate([id])`. Reuses the adapter's batched fetch + miss
4504
4507
  * tolerance; returns `null` for a missing or undecodable record.
4505
4508
  */
4506
- async get(id) {
4507
- const raws = await this.hydrate([id]);
4509
+ async get(id, ctx) {
4510
+ const raws = await this.hydrate([id], ctx);
4508
4511
  const raw = raws.get(id);
4509
4512
  if (raw === void 0 || raw === null) return null;
4510
4513
  return this.toCanonical(raw);
@@ -4527,7 +4530,7 @@ var IncrementalReadBase = class {
4527
4530
  async *listChanges(subscription, cursor) {
4528
4531
  const mode = cursor === null || cursor === void 0 ? { kind: "full" } : { kind: "delta", cursor };
4529
4532
  const filter = this.filterFor(subscription);
4530
- const stream = this.read({ mode, filter });
4533
+ const stream = this.read({ mode, filter }, { subscription });
4531
4534
  if (this.cursorDivisible) {
4532
4535
  for await (const sourced of stream) {
4533
4536
  yield this.toChange(sourced, sourced.cursor);