@absolutejs/voice 0.0.22-beta.215 → 0.0.22-beta.216

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
@@ -22066,7 +22066,8 @@ var summarizeSessions = (events) => {
22066
22066
  };
22067
22067
  var buildVoiceProviderSloReport = async (options = {}) => {
22068
22068
  const rawEvents = options.events ?? await options.store?.list() ?? [];
22069
- const events = normalizeEvents2(rawEvents);
22069
+ const now = options.now ?? Date.now();
22070
+ const events = normalizeEvents2(rawEvents).filter((event) => typeof options.maxAgeMs !== "number" || now - event.at <= options.maxAgeMs);
22070
22071
  const thresholds = mergeThresholds(options.thresholds);
22071
22072
  const observedKinds = new Set(events.map((event) => event.kind));
22072
22073
  const requiredKinds = new Set(options.requiredKinds ?? [...observedKinds]);
@@ -62,6 +62,8 @@ export type VoiceProviderSloReport = {
62
62
  };
63
63
  export type VoiceProviderSloReportOptions = {
64
64
  events?: StoredVoiceTraceEvent[] | VoiceRoutingEvent[];
65
+ maxAgeMs?: number;
66
+ now?: number;
65
67
  requiredKinds?: readonly VoiceRoutingEventKind[];
66
68
  store?: VoiceTraceEventStore;
67
69
  thresholds?: VoiceProviderSloThresholdConfig;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@absolutejs/voice",
3
- "version": "0.0.22-beta.215",
3
+ "version": "0.0.22-beta.216",
4
4
  "description": "Voice primitives and Elysia plugin for AbsoluteJS",
5
5
  "repository": {
6
6
  "type": "git",