@absolutejs/voice 0.0.22-beta.35 → 0.0.22-beta.36
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/testing/index.js
CHANGED
|
@@ -3536,8 +3536,8 @@ var createVoiceIOProviderFailureSimulator = (options) => {
|
|
|
3536
3536
|
const now = options.now ?? Date.now;
|
|
3537
3537
|
const operation = options.operation ?? "open";
|
|
3538
3538
|
const cooldownMs = Math.max(0, options.cooldownMs ?? 30000);
|
|
3539
|
-
const emit = async (event) => {
|
|
3540
|
-
await options.onProviderEvent?.(event);
|
|
3539
|
+
const emit = async (event, input) => {
|
|
3540
|
+
await options.onProviderEvent?.(event, input);
|
|
3541
3541
|
};
|
|
3542
3542
|
const run = async (provider, mode) => {
|
|
3543
3543
|
if (!options.providers.includes(provider)) {
|
|
@@ -3561,7 +3561,7 @@ var createVoiceIOProviderFailureSimulator = (options) => {
|
|
|
3561
3561
|
}),
|
|
3562
3562
|
selectedProvider: provider,
|
|
3563
3563
|
status: "success"
|
|
3564
|
-
});
|
|
3564
|
+
}, { mode, provider, sessionId });
|
|
3565
3565
|
return {
|
|
3566
3566
|
mode,
|
|
3567
3567
|
provider,
|
|
@@ -3594,7 +3594,7 @@ var createVoiceIOProviderFailureSimulator = (options) => {
|
|
|
3594
3594
|
selectedProvider: provider,
|
|
3595
3595
|
status: "error",
|
|
3596
3596
|
suppressedUntil
|
|
3597
|
-
});
|
|
3597
|
+
}, { mode, provider, sessionId });
|
|
3598
3598
|
if (fallbackProvider) {
|
|
3599
3599
|
await emit({
|
|
3600
3600
|
at: startedAt + 1,
|
|
@@ -3612,7 +3612,7 @@ var createVoiceIOProviderFailureSimulator = (options) => {
|
|
|
3612
3612
|
}),
|
|
3613
3613
|
selectedProvider: provider,
|
|
3614
3614
|
status: "fallback"
|
|
3615
|
-
});
|
|
3615
|
+
}, { mode, provider, sessionId });
|
|
3616
3616
|
}
|
|
3617
3617
|
return {
|
|
3618
3618
|
fallbackProvider,
|
|
@@ -22,7 +22,11 @@ export type VoiceIOProviderFailureSimulatorOptions<TProvider extends string = st
|
|
|
22
22
|
kind: VoiceIOProviderFailureSimulationKind;
|
|
23
23
|
latencyBudgets?: Partial<Record<TProvider, number>>;
|
|
24
24
|
now?: () => number;
|
|
25
|
-
onProviderEvent?: (event: VoiceIOProviderRouterEvent<TProvider
|
|
25
|
+
onProviderEvent?: (event: VoiceIOProviderRouterEvent<TProvider>, input: {
|
|
26
|
+
mode: VoiceIOProviderFailureSimulationMode;
|
|
27
|
+
provider: TProvider;
|
|
28
|
+
sessionId: string;
|
|
29
|
+
}) => Promise<void> | void;
|
|
26
30
|
operation?: VoiceIOProviderFailureSimulationOperation;
|
|
27
31
|
providers: readonly TProvider[];
|
|
28
32
|
recoveryElapsedMs?: number | Partial<Record<TProvider, number>>;
|