@absolutejs/voice 0.0.22-beta.290 → 0.0.22-beta.291

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.
@@ -0,0 +1,8 @@
1
+ import { type VoiceReadinessFailuresClientOptions } from '../client/readinessFailures';
2
+ export declare const useVoiceReadinessFailures: (path?: string, options?: VoiceReadinessFailuresClientOptions) => {
3
+ refresh: () => Promise<import("..").VoiceProductionReadinessReport | undefined>;
4
+ error: string | null;
5
+ isLoading: boolean;
6
+ report?: import("..").VoiceProductionReadinessReport;
7
+ updatedAt?: number;
8
+ };
@@ -0,0 +1,7 @@
1
+ import type { VoiceReadinessFailuresClientOptions } from '../client/readinessFailures';
2
+ export declare const createVoiceReadinessFailures: (path?: string, options?: VoiceReadinessFailuresClientOptions) => {
3
+ close: () => void;
4
+ getSnapshot: () => import("../client").VoiceReadinessFailuresSnapshot;
5
+ refresh: () => Promise<import("..").VoiceProductionReadinessReport | undefined>;
6
+ subscribe: (listener: () => void) => () => void;
7
+ };
@@ -5,6 +5,7 @@ export { createVoiceLiveOps } from './createVoiceLiveOps';
5
5
  export { createVoiceOpsStatus } from './createVoiceOpsStatus';
6
6
  export { createVoicePlatformCoverage } from './createVoicePlatformCoverage';
7
7
  export { createVoiceProofTrends } from './createVoiceProofTrends';
8
+ export { createVoiceReadinessFailures } from './createVoiceReadinessFailures';
8
9
  export { createVoiceProviderSimulationControls } from './createVoiceProviderSimulationControls';
9
10
  export { createVoiceProviderCapabilities } from './createVoiceProviderCapabilities';
10
11
  export { createVoiceProviderContracts } from './createVoiceProviderContracts';
@@ -2588,6 +2588,91 @@ var createVoiceProofTrends = (path = "/api/voice/proof-trends", options = {}) =>
2588
2588
  subscribe: store.subscribe
2589
2589
  };
2590
2590
  };
2591
+ // src/client/readinessFailures.ts
2592
+ var fetchVoiceReadinessFailures = async (path = "/api/production-readiness", options = {}) => {
2593
+ const fetchImpl = options.fetch ?? globalThis.fetch;
2594
+ const response = await fetchImpl(path);
2595
+ if (!response.ok) {
2596
+ throw new Error(`Voice readiness failed: HTTP ${response.status}`);
2597
+ }
2598
+ return await response.json();
2599
+ };
2600
+ var createVoiceReadinessFailuresStore = (path = "/api/production-readiness", options = {}) => {
2601
+ const listeners = new Set;
2602
+ let closed = false;
2603
+ let timer;
2604
+ let snapshot = {
2605
+ error: null,
2606
+ isLoading: false
2607
+ };
2608
+ const emit = () => {
2609
+ for (const listener of listeners) {
2610
+ listener();
2611
+ }
2612
+ };
2613
+ const refresh = async () => {
2614
+ if (closed) {
2615
+ return snapshot.report;
2616
+ }
2617
+ snapshot = { ...snapshot, error: null, isLoading: true };
2618
+ emit();
2619
+ try {
2620
+ const report = await fetchVoiceReadinessFailures(path, options);
2621
+ snapshot = {
2622
+ error: null,
2623
+ isLoading: false,
2624
+ report,
2625
+ updatedAt: Date.now()
2626
+ };
2627
+ emit();
2628
+ return report;
2629
+ } catch (error) {
2630
+ snapshot = {
2631
+ ...snapshot,
2632
+ error: error instanceof Error ? error.message : String(error),
2633
+ isLoading: false
2634
+ };
2635
+ emit();
2636
+ throw error;
2637
+ }
2638
+ };
2639
+ const close = () => {
2640
+ closed = true;
2641
+ if (timer) {
2642
+ clearInterval(timer);
2643
+ timer = undefined;
2644
+ }
2645
+ listeners.clear();
2646
+ };
2647
+ if (typeof window !== "undefined" && options.intervalMs && options.intervalMs > 0) {
2648
+ timer = setInterval(() => {
2649
+ refresh().catch(() => {});
2650
+ }, options.intervalMs);
2651
+ }
2652
+ return {
2653
+ close,
2654
+ getServerSnapshot: () => snapshot,
2655
+ getSnapshot: () => snapshot,
2656
+ refresh,
2657
+ subscribe: (listener) => {
2658
+ listeners.add(listener);
2659
+ return () => {
2660
+ listeners.delete(listener);
2661
+ };
2662
+ }
2663
+ };
2664
+ };
2665
+
2666
+ // src/svelte/createVoiceReadinessFailures.ts
2667
+ var createVoiceReadinessFailures = (path = "/api/production-readiness", options = {}) => {
2668
+ const store = createVoiceReadinessFailuresStore(path, options);
2669
+ return {
2670
+ close: store.close,
2671
+ getSnapshot: store.getSnapshot,
2672
+ refresh: store.refresh,
2673
+ subscribe: store.subscribe
2674
+ };
2675
+ };
2591
2676
  // src/client/providerSimulationControls.ts
2592
2677
  var postSimulation = async (pathPrefix, mode, provider, fetchImpl) => {
2593
2678
  const response = await fetchImpl(`${pathPrefix}/${mode}?provider=${encodeURIComponent(provider)}`, { method: "POST" });
@@ -5704,6 +5789,7 @@ export {
5704
5789
  createVoiceTraceTimeline,
5705
5790
  createVoiceStream2 as createVoiceStream,
5706
5791
  createVoiceRoutingStatus,
5792
+ createVoiceReadinessFailures,
5707
5793
  createVoiceProviderStatus,
5708
5794
  createVoiceProviderSimulationControls,
5709
5795
  createVoiceProviderContracts,
@@ -0,0 +1,21 @@
1
+ export declare const VoiceReadinessFailures: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
2
+ description: StringConstructor;
3
+ intervalMs: NumberConstructor;
4
+ path: {
5
+ default: string;
6
+ type: StringConstructor;
7
+ };
8
+ title: StringConstructor;
9
+ }>, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
10
+ [key: string]: any;
11
+ }>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
12
+ description: StringConstructor;
13
+ intervalMs: NumberConstructor;
14
+ path: {
15
+ default: string;
16
+ type: StringConstructor;
17
+ };
18
+ title: StringConstructor;
19
+ }>> & Readonly<{}>, {
20
+ path: string;
21
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
@@ -3,6 +3,7 @@ export { VoiceOpsActionCenter } from './VoiceOpsActionCenter';
3
3
  export { VoiceDeliveryRuntime } from './VoiceDeliveryRuntime';
4
4
  export { VoicePlatformCoverage } from './VoicePlatformCoverage';
5
5
  export { VoiceProofTrends } from './VoiceProofTrends';
6
+ export { VoiceReadinessFailures } from './VoiceReadinessFailures';
6
7
  export { VoiceProviderSimulationControls } from './VoiceProviderSimulationControls';
7
8
  export { VoiceProviderCapabilities } from './VoiceProviderCapabilities';
8
9
  export { VoiceProviderContracts } from './VoiceProviderContracts';
@@ -14,6 +15,7 @@ export { VoiceTurnQuality } from './VoiceTurnQuality';
14
15
  export { useVoiceOpsStatus } from './useVoiceOpsStatus';
15
16
  export { useVoicePlatformCoverage } from './useVoicePlatformCoverage';
16
17
  export { useVoiceProofTrends } from './useVoiceProofTrends';
18
+ export { useVoiceReadinessFailures } from './useVoiceReadinessFailures';
17
19
  export { useVoiceOpsActionCenter } from './useVoiceOpsActionCenter';
18
20
  export { useVoiceLiveOps } from './useVoiceLiveOps';
19
21
  export { useVoiceDeliveryRuntime } from './useVoiceDeliveryRuntime';