@absolutejs/voice 0.0.22-beta.417 → 0.0.22-beta.418

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
@@ -206,6 +206,6 @@ export type { PlivoInboundMessage, PlivoMediaStreamBridge, PlivoMediaStreamBridg
206
206
  export type { VoiceTelephonyCarrierMatrix, VoiceTelephonyCarrierMatrixEntry, VoiceTelephonyCarrierMatrixInput, VoiceTelephonyCarrierMatrixOptions, VoiceTelephonyCarrierMatrixRoutesOptions, VoiceTelephonyCarrierMatrixStatus } from './telephony/matrix';
207
207
  export { shapeTelephonyAssistantText } from './telephony/response';
208
208
  export type { TelephonyResponseShapeMode, TelephonyResponseShapeOptions } from './telephony/response';
209
- export { buildVoiceProofPack, buildVoiceProofPackFromObservabilityExport, createVoiceProofPackBuildContext, createVoiceProofPackStaleWhileRefreshSource, createVoiceProofPackArtifacts, createVoiceProofPackOperationsRecordSection, createVoiceProofPackProductionReadinessSection, createVoiceProofPackProviderSloSection, createVoiceProofPackRoutes, createVoiceProofPackSupportBundleSection, renderVoiceProofPackMarkdown, writeVoiceProofPack } from './proofPack';
210
- export type { VoiceProofPack, VoiceProofPackBuildContext, VoiceProofPackBuildContextOptions, VoiceProofPackBuildTiming, VoiceProofPackEvidence, VoiceProofPackInput, VoiceProofPackRefreshState, VoiceProofPackRefreshStatus, VoiceProofPackRoutesOptions, VoiceProofPackSection, VoiceProofPackSourceValue, VoiceProofPackStatus, VoiceProofPackStaleWhileRefreshSource, VoiceProofPackStaleWhileRefreshSourceOptions, VoiceProofPackWriteResult } from './proofPack';
209
+ export { buildVoiceProofPack, buildVoiceProofPackFromObservabilityExport, createVoiceProofPackBuildContext, createVoiceProofRefreshSnapshot, createVoiceProofPackStaleWhileRefreshSource, createVoiceProofPackArtifacts, createVoiceProofPackOperationsRecordSection, createVoiceProofPackProductionReadinessSection, createVoiceProofPackProviderSloSection, createVoiceProofPackRoutes, createVoiceProofPackSupportBundleSection, renderVoiceProofPackMarkdown, writeVoiceProofPack } from './proofPack';
210
+ export type { VoiceProofPack, VoiceProofPackBuildContext, VoiceProofPackBuildContextOptions, VoiceProofPackBuildTiming, VoiceProofPackEvidence, VoiceProofPackInput, VoiceProofPackRefreshState, VoiceProofPackRefreshStatus, VoiceProofPackRoutesOptions, VoiceProofPackSection, VoiceProofPackSourceValue, VoiceProofPackStatus, VoiceProofPackStaleWhileRefreshSource, VoiceProofPackStaleWhileRefreshSourceOptions, VoiceProofPackWriteResult, VoiceProofRefreshSnapshot, VoiceProofRefreshSnapshotOptions } from './proofPack';
211
211
  export * from './types';
package/dist/index.js CHANGED
@@ -40023,6 +40023,51 @@ var createVoiceProofPackBuildContext = (options = {}) => {
40023
40023
  time
40024
40024
  };
40025
40025
  };
40026
+ var createSnapshotTraceStore = (events) => ({
40027
+ append: async () => {
40028
+ throw new Error("Voice proof refresh snapshot trace store is read-only.");
40029
+ },
40030
+ get: async (id) => events.find((event) => event.id === id),
40031
+ list: async (filter) => filterVoiceTraceEvents([...events], filter),
40032
+ remove: async () => {
40033
+ throw new Error("Voice proof refresh snapshot trace store is read-only.");
40034
+ }
40035
+ });
40036
+ var createSnapshotAuditStore = (events) => ({
40037
+ append: async () => {
40038
+ throw new Error("Voice proof refresh snapshot audit store is read-only.");
40039
+ },
40040
+ get: async (id) => events.find((event) => event.id === id),
40041
+ list: async (filter) => filterVoiceAuditEvents([...events], filter)
40042
+ });
40043
+ var createSnapshotTraceDeliveryStore = (deliveries) => ({
40044
+ get: async (id) => deliveries.find((delivery) => delivery.id === id),
40045
+ list: async () => [...deliveries],
40046
+ remove: async () => {
40047
+ throw new Error("Voice proof refresh snapshot delivery store is read-only.");
40048
+ },
40049
+ set: async () => {
40050
+ throw new Error("Voice proof refresh snapshot delivery store is read-only.");
40051
+ }
40052
+ });
40053
+ var createVoiceProofRefreshSnapshot = async (options = {}) => {
40054
+ const [traceEvents, auditEvents, traceDeliveries, auditSinkDeliveries] = await Promise.all([
40055
+ options.events ?? await options.traceStore?.list(options.traceFilter) ?? [],
40056
+ options.audit ? await options.audit.list(options.auditFilter) : [],
40057
+ options.traceDeliveries ? await options.traceDeliveries.list() : [],
40058
+ options.auditSinkDeliveries ? await options.auditSinkDeliveries.list() : []
40059
+ ]);
40060
+ return {
40061
+ auditEvents,
40062
+ auditSinkDeliveries,
40063
+ auditStore: createSnapshotAuditStore(auditEvents),
40064
+ capturedAt: Date.now(),
40065
+ traceDeliveries,
40066
+ traceDeliveryStore: createSnapshotTraceDeliveryStore(traceDeliveries),
40067
+ traceEvents,
40068
+ traceStore: createSnapshotTraceStore(traceEvents)
40069
+ };
40070
+ };
40026
40071
  var toProofPackStatus = (status) => {
40027
40072
  if (status === "fail" || status === "failed") {
40028
40073
  return "fail";
@@ -40868,6 +40913,7 @@ export {
40868
40913
  createVoiceProofTrendRoutes,
40869
40914
  createVoiceProofTrendRecommendationRoutes,
40870
40915
  createVoiceProofTraceStore,
40916
+ createVoiceProofRefreshSnapshot,
40871
40917
  createVoiceProofPackSupportBundleSection,
40872
40918
  createVoiceProofPackStaleWhileRefreshSource,
40873
40919
  createVoiceProofPackRoutes,
@@ -1,10 +1,12 @@
1
1
  import { Elysia } from 'elysia';
2
+ import { type StoredVoiceAuditEvent, type VoiceAuditEventFilter, type VoiceAuditEventStore } from './audit';
2
3
  import type { VoiceObservabilityExportArtifact, VoiceObservabilityExportReport } from './observabilityExport';
3
4
  import type { VoiceCallDebuggerReport } from './callDebugger';
4
5
  import type { VoiceOperationsRecord } from './operationsRecord';
5
6
  import type { VoiceProductionReadinessReport } from './productionReadiness';
6
7
  import type { VoiceProviderSloReport } from './providerSlo';
7
8
  import type { VoiceSessionSnapshot } from './sessionSnapshot';
9
+ import { type StoredVoiceTraceEvent, type VoiceTraceEventFilter, type VoiceTraceEventStore, type VoiceTraceSinkDeliveryRecord, type VoiceTraceSinkDeliveryStore } from './trace';
8
10
  export type VoiceProofPackStatus = 'fail' | 'pass' | 'warn';
9
11
  export type VoiceProofPackEvidence = {
10
12
  detail?: string;
@@ -69,6 +71,27 @@ export type VoiceProofPackBuildContextOptions = {
69
71
  now?: () => number;
70
72
  onTiming?: (timing: VoiceProofPackBuildTiming) => void;
71
73
  };
74
+ export type VoiceProofRefreshSnapshotOptions = {
75
+ audit?: VoiceAuditEventStore;
76
+ auditFilter?: VoiceAuditEventFilter;
77
+ auditSinkDeliveries?: {
78
+ list: () => Promise<unknown[]> | unknown[];
79
+ };
80
+ events?: StoredVoiceTraceEvent[];
81
+ traceDeliveries?: VoiceTraceSinkDeliveryStore;
82
+ traceFilter?: VoiceTraceEventFilter;
83
+ traceStore?: VoiceTraceEventStore;
84
+ };
85
+ export type VoiceProofRefreshSnapshot = {
86
+ auditEvents: StoredVoiceAuditEvent[];
87
+ auditStore: VoiceAuditEventStore;
88
+ auditSinkDeliveries: unknown[];
89
+ capturedAt: number;
90
+ traceDeliveries: VoiceTraceSinkDeliveryRecord[];
91
+ traceDeliveryStore: VoiceTraceSinkDeliveryStore;
92
+ traceEvents: StoredVoiceTraceEvent[];
93
+ traceStore: VoiceTraceEventStore;
94
+ };
72
95
  export type VoiceProofPackSourceValue = VoiceProofPack | VoiceProofPackInput;
73
96
  export type VoiceProofPackStaleWhileRefreshSourceOptions = {
74
97
  maxAgeMs?: number;
@@ -100,6 +123,7 @@ export type VoiceProofPackRoutesOptions = {
100
123
  source: VoiceProofPackSourceValue | (() => VoiceProofPackSourceValue | Promise<VoiceProofPackSourceValue>);
101
124
  };
102
125
  export declare const createVoiceProofPackBuildContext: (options?: VoiceProofPackBuildContextOptions) => VoiceProofPackBuildContext;
126
+ export declare const createVoiceProofRefreshSnapshot: (options?: VoiceProofRefreshSnapshotOptions) => Promise<VoiceProofRefreshSnapshot>;
103
127
  export declare const createVoiceProofPackProviderSloSection: (report: VoiceProviderSloReport, options?: {
104
128
  href?: string;
105
129
  title?: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@absolutejs/voice",
3
- "version": "0.0.22-beta.417",
3
+ "version": "0.0.22-beta.418",
4
4
  "description": "Voice primitives and Elysia plugin for AbsoluteJS",
5
5
  "repository": {
6
6
  "type": "git",