@rotorsoft/act 0.25.0 → 0.25.2

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.js CHANGED
@@ -225,7 +225,8 @@ var QuerySchema = z.object({
225
225
  created_after: z.date().optional(),
226
226
  backward: z.boolean().optional(),
227
227
  correlation: z.string().optional(),
228
- with_snaps: z.boolean().optional()
228
+ with_snaps: z.boolean().optional(),
229
+ stream_exact: z.boolean().optional()
229
230
  }).readonly();
230
231
 
231
232
  // src/types/index.ts
@@ -406,8 +407,11 @@ var InMemoryStore = class {
406
407
  this._streams = /* @__PURE__ */ new Map();
407
408
  }
408
409
  in_query(query, e) {
409
- if (query.stream && !RegExp(`^${query.stream}$`).test(e.stream))
410
- return false;
410
+ if (query.stream) {
411
+ if (query.stream_exact) {
412
+ if (e.stream !== query.stream) return false;
413
+ } else if (!RegExp(`^${query.stream}$`).test(e.stream)) return false;
414
+ }
411
415
  if (query.names && !query.names.includes(e.name)) return false;
412
416
  if (query.correlation && e.meta?.correlation !== query.correlation)
413
417
  return false;
@@ -730,7 +734,7 @@ async function load(me, stream, callback) {
730
734
  }
731
735
  callback && callback({ event, state: state2, patches, snaps });
732
736
  },
733
- { stream, with_snaps: !cached, after: cached?.event_id }
737
+ { stream, with_snaps: !cached, after: cached?.event_id, stream_exact: true }
734
738
  );
735
739
  logger2.trace(
736
740
  state2,