@rotorsoft/act 1.31.29 → 1.32.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.
@@ -332,6 +332,7 @@ var QuerySchema = import_zod2.z.object({
332
332
  backward: import_zod2.z.boolean().optional(),
333
333
  correlation: import_zod2.z.string().optional(),
334
334
  with_snaps: import_zod2.z.boolean().optional(),
335
+ with_pii: import_zod2.z.boolean().optional(),
335
336
  stream_exact: import_zod2.z.boolean().optional()
336
337
  }).readonly();
337
338
 
@@ -718,7 +719,8 @@ var InMemoryStore = class {
718
719
  }
719
720
  // Attach the isolated PII payload (or null) to an event before handing it to
720
721
  // a caller. Allocation-free for events without PII — by far the common case.
721
- _with_pii(e) {
722
+ _with_pii(e, wanted = true) {
723
+ if (!wanted) return e;
722
724
  const pii = this._pii.get(e.stream)?.get(e.id);
723
725
  return pii ? { ...e, pii } : e;
724
726
  }
@@ -789,7 +791,12 @@ var InMemoryStore = class {
789
791
  if (floor_id >= 0 && e.id < floor_id) break;
790
792
  if (query.created_after && e.created <= query.created_after) continue;
791
793
  await Promise.resolve(
792
- callback(this._with_pii(e))
794
+ callback(
795
+ this._with_pii(
796
+ e,
797
+ query?.with_pii !== false
798
+ )
799
+ )
793
800
  );
794
801
  count++;
795
802
  if (query?.limit && count >= query.limit) break;
@@ -804,7 +811,12 @@ var InMemoryStore = class {
804
811
  if (query?.created_before && e.created >= query.created_before)
805
812
  continue;
806
813
  await Promise.resolve(
807
- callback(this._with_pii(e))
814
+ callback(
815
+ this._with_pii(
816
+ e,
817
+ query?.with_pii !== false
818
+ )
819
+ )
808
820
  );
809
821
  count++;
810
822
  if (query?.limit && count >= query.limit) break;