@absolutejs/voice 0.0.22-beta.505 → 0.0.22-beta.507

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,48 @@
1
+ export type VoiceWebhookSinkDeliveryResult = {
2
+ attempt: number;
3
+ durationMs: number;
4
+ error?: string;
5
+ ok: boolean;
6
+ sinkId: string;
7
+ status?: number;
8
+ };
9
+ export type VoiceWebhookSink = {
10
+ /** Apply only when this filter returns true. Default: accept all. */
11
+ acceptEvent?: (event: {
12
+ payload?: unknown;
13
+ type?: string;
14
+ }) => boolean;
15
+ /** Backoff between retries in ms. Default 1_000. */
16
+ backoffMs?: number;
17
+ /** Extra headers. */
18
+ headers?: Record<string, string>;
19
+ /** Stable id used for retry queues + dead-letter tracking. */
20
+ id: string;
21
+ /** Max retry attempts. Default 3. */
22
+ maxRetries?: number;
23
+ /** HMAC signing secret. When present, signature headers are emitted. */
24
+ signingSecret?: string;
25
+ /** Per-request fetch timeout in ms. Default 10_000. */
26
+ timeoutMs?: number;
27
+ /** Target URL. */
28
+ url: string;
29
+ };
30
+ export type VoiceWebhookFanoutOptions = {
31
+ /** Custom fetch — used for testing. */
32
+ fetch?: typeof fetch;
33
+ /** Sinks to deliver to. */
34
+ sinks: ReadonlyArray<VoiceWebhookSink>;
35
+ };
36
+ export type VoiceWebhookFanoutEvent = {
37
+ payload: unknown;
38
+ type?: string;
39
+ };
40
+ export type VoiceWebhookFanoutReport = {
41
+ deliveries: VoiceWebhookSinkDeliveryResult[];
42
+ failed: number;
43
+ succeeded: number;
44
+ };
45
+ export type VoiceWebhookFanout = {
46
+ deliver: (event: VoiceWebhookFanoutEvent) => Promise<VoiceWebhookFanoutReport>;
47
+ };
48
+ export declare const createVoiceWebhookFanout: (options: VoiceWebhookFanoutOptions) => VoiceWebhookFanout;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@absolutejs/voice",
3
- "version": "0.0.22-beta.505",
3
+ "version": "0.0.22-beta.507",
4
4
  "description": "Voice primitives and Elysia plugin for AbsoluteJS",
5
5
  "repository": {
6
6
  "type": "git",