@absolutejs/voice 0.0.22-beta.9 → 0.0.22-beta.90
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/README.md +205 -0
- package/dist/agent.d.ts +2 -0
- package/dist/angular/index.d.ts +6 -0
- package/dist/angular/index.js +833 -43
- package/dist/angular/voice-app-kit-status.service.d.ts +12 -0
- package/dist/angular/voice-ops-status.component.d.ts +15 -0
- package/dist/angular/voice-provider-capabilities.service.d.ts +12 -0
- package/dist/angular/voice-provider-status.service.d.ts +12 -0
- package/dist/angular/voice-routing-status.service.d.ts +11 -0
- package/dist/angular/voice-stream.service.d.ts +2 -0
- package/dist/angular/voice-turn-quality.service.d.ts +12 -0
- package/dist/angular/voice-workflow-status.service.d.ts +12 -0
- package/dist/appKit.d.ts +98 -0
- package/dist/assistantHealth.d.ts +81 -0
- package/dist/client/actions.d.ts +22 -0
- package/dist/client/appKitStatus.d.ts +19 -0
- package/dist/client/connection.d.ts +3 -0
- package/dist/client/htmxBootstrap.js +44 -2
- package/dist/client/index.d.ts +26 -0
- package/dist/client/index.js +1290 -2
- package/dist/client/opsStatusWidget.d.ts +40 -0
- package/dist/client/providerCapabilities.d.ts +19 -0
- package/dist/client/providerCapabilitiesWidget.d.ts +32 -0
- package/dist/client/providerSimulationControls.d.ts +33 -0
- package/dist/client/providerSimulationControlsWidget.d.ts +20 -0
- package/dist/client/providerStatus.d.ts +19 -0
- package/dist/client/providerStatusWidget.d.ts +32 -0
- package/dist/client/routingStatus.d.ts +19 -0
- package/dist/client/routingStatusWidget.d.ts +28 -0
- package/dist/client/turnQuality.d.ts +19 -0
- package/dist/client/turnQualityWidget.d.ts +32 -0
- package/dist/client/workflowStatus.d.ts +19 -0
- package/dist/diagnosticsRoutes.d.ts +44 -0
- package/dist/evalRoutes.d.ts +213 -0
- package/dist/handoff.d.ts +54 -0
- package/dist/handoffHealth.d.ts +94 -0
- package/dist/index.d.ts +62 -7
- package/dist/index.js +10382 -2574
- package/dist/modelAdapters.d.ts +75 -0
- package/dist/openaiTTS.d.ts +18 -0
- package/dist/opsConsoleRoutes.d.ts +77 -0
- package/dist/opsWebhook.d.ts +126 -0
- package/dist/outcomeContract.d.ts +112 -0
- package/dist/postgresStore.d.ts +2 -0
- package/dist/productionReadiness.d.ts +111 -0
- package/dist/providerAdapters.d.ts +48 -0
- package/dist/providerCapabilities.d.ts +92 -0
- package/dist/providerHealth.d.ts +79 -0
- package/dist/qualityRoutes.d.ts +76 -0
- package/dist/queue.d.ts +61 -0
- package/dist/react/VoiceOpsStatus.d.ts +6 -0
- package/dist/react/VoiceProviderCapabilities.d.ts +6 -0
- package/dist/react/VoiceProviderSimulationControls.d.ts +5 -0
- package/dist/react/VoiceProviderStatus.d.ts +6 -0
- package/dist/react/VoiceRoutingStatus.d.ts +6 -0
- package/dist/react/VoiceTurnQuality.d.ts +6 -0
- package/dist/react/index.d.ts +13 -0
- package/dist/react/index.js +1884 -11
- package/dist/react/useVoiceAppKitStatus.d.ts +8 -0
- package/dist/react/useVoiceController.d.ts +2 -0
- package/dist/react/useVoiceProviderCapabilities.d.ts +8 -0
- package/dist/react/useVoiceProviderSimulationControls.d.ts +10 -0
- package/dist/react/useVoiceProviderStatus.d.ts +8 -0
- package/dist/react/useVoiceRoutingStatus.d.ts +8 -0
- package/dist/react/useVoiceStream.d.ts +2 -0
- package/dist/react/useVoiceTurnQuality.d.ts +8 -0
- package/dist/react/useVoiceWorkflowStatus.d.ts +8 -0
- package/dist/resilienceRoutes.d.ts +142 -0
- package/dist/sessionReplay.d.ts +175 -0
- package/dist/sqliteStore.d.ts +2 -0
- package/dist/svelte/createVoiceAppKitStatus.d.ts +8 -0
- package/dist/svelte/createVoiceOpsStatus.d.ts +9 -0
- package/dist/svelte/createVoiceProviderCapabilities.d.ts +10 -0
- package/dist/svelte/createVoiceProviderSimulationControls.d.ts +11 -0
- package/dist/svelte/createVoiceProviderStatus.d.ts +10 -0
- package/dist/svelte/createVoiceRoutingStatus.d.ts +10 -0
- package/dist/svelte/createVoiceTurnQuality.d.ts +10 -0
- package/dist/svelte/createVoiceWorkflowStatus.d.ts +8 -0
- package/dist/svelte/index.d.ts +8 -0
- package/dist/svelte/index.js +1330 -3
- package/dist/telephony/contract.d.ts +61 -0
- package/dist/telephony/matrix.d.ts +97 -0
- package/dist/telephony/plivo.d.ts +254 -0
- package/dist/telephony/telnyx.d.ts +247 -0
- package/dist/telephony/twilio.d.ts +132 -0
- package/dist/telephonyOutcome.d.ts +201 -0
- package/dist/testing/index.d.ts +2 -0
- package/dist/testing/index.js +2543 -14
- package/dist/testing/ioProviderSimulator.d.ts +41 -0
- package/dist/testing/providerSimulator.d.ts +44 -0
- package/dist/toolContract.d.ts +130 -0
- package/dist/toolRuntime.d.ts +50 -0
- package/dist/trace.d.ts +1 -1
- package/dist/traceTimeline.d.ts +93 -0
- package/dist/turnQuality.d.ts +94 -0
- package/dist/types.d.ts +84 -2
- package/dist/vue/VoiceOpsStatus.d.ts +30 -0
- package/dist/vue/VoiceProviderCapabilities.d.ts +51 -0
- package/dist/vue/VoiceProviderSimulationControls.d.ts +88 -0
- package/dist/vue/VoiceProviderStatus.d.ts +51 -0
- package/dist/vue/VoiceRoutingStatus.d.ts +51 -0
- package/dist/vue/VoiceTurnQuality.d.ts +51 -0
- package/dist/vue/index.d.ts +13 -0
- package/dist/vue/index.js +1934 -25
- package/dist/vue/useVoiceAppKitStatus.d.ts +9 -0
- package/dist/vue/useVoiceProviderCapabilities.d.ts +9 -0
- package/dist/vue/useVoiceProviderSimulationControls.d.ts +24 -0
- package/dist/vue/useVoiceProviderStatus.d.ts +9 -0
- package/dist/vue/useVoiceRoutingStatus.d.ts +8 -0
- package/dist/vue/useVoiceStream.d.ts +2 -0
- package/dist/vue/useVoiceTurnQuality.d.ts +9 -0
- package/dist/vue/useVoiceWorkflowStatus.d.ts +9 -0
- package/dist/workflowContract.d.ts +91 -0
- package/package.json +1 -1
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
import { Elysia } from 'elysia';
|
|
2
|
+
import type { VoiceTelephonySetupStatus, VoiceTelephonySmokeCheck, VoiceTelephonySmokeReport } from './contract';
|
|
3
|
+
import { type VoiceTelephonyOutcomePolicy, type VoiceTelephonyWebhookRoutesOptions } from '../telephonyOutcome';
|
|
1
4
|
import { type VoiceCallReviewArtifact, type VoiceCallReviewConfig } from '../testing/review';
|
|
2
5
|
import type { AudioFormat, VoiceLogger, VoicePluginConfig, VoiceSessionRecord, VoiceServerMessage } from '../types';
|
|
3
6
|
type TwilioMediaPayload = {
|
|
@@ -107,10 +110,139 @@ export type TwilioVoiceResponseOptions = {
|
|
|
107
110
|
streamUrl: string;
|
|
108
111
|
track?: 'both_tracks' | 'inbound_track' | 'outbound_track';
|
|
109
112
|
};
|
|
113
|
+
export type TwilioVoiceRouteParameters = Record<string, string | number | boolean | undefined> | ((input: {
|
|
114
|
+
query: Record<string, unknown>;
|
|
115
|
+
request: Request;
|
|
116
|
+
}) => Promise<Record<string, string | number | boolean | undefined>> | Record<string, string | number | boolean | undefined>);
|
|
117
|
+
export type TwilioVoiceSetupStatus = VoiceTelephonySetupStatus<'twilio'> & {
|
|
118
|
+
urls: VoiceTelephonySetupStatus<'twilio'>['urls'] & {
|
|
119
|
+
twiml: string;
|
|
120
|
+
};
|
|
121
|
+
};
|
|
122
|
+
export type TwilioVoiceSetupOptions = {
|
|
123
|
+
path?: false | string;
|
|
124
|
+
requiredEnv?: Record<string, string | undefined>;
|
|
125
|
+
title?: string;
|
|
126
|
+
};
|
|
127
|
+
export type TwilioVoiceSmokeCheck = VoiceTelephonySmokeCheck;
|
|
128
|
+
export type TwilioVoiceSmokeReport = VoiceTelephonySmokeReport<'twilio'> & {
|
|
129
|
+
setup: TwilioVoiceSetupStatus;
|
|
130
|
+
};
|
|
131
|
+
export type TwilioVoiceSmokeOptions = {
|
|
132
|
+
callSid?: string;
|
|
133
|
+
path?: false | string;
|
|
134
|
+
scenarioId?: string;
|
|
135
|
+
sessionId?: string;
|
|
136
|
+
sipCode?: number;
|
|
137
|
+
status?: string;
|
|
138
|
+
title?: string;
|
|
139
|
+
};
|
|
140
|
+
export type TwilioVoiceRoutesOptions<TContext = unknown, TSession extends VoiceSessionRecord = VoiceSessionRecord, TResult = unknown> = TwilioMediaStreamBridgeOptions<TContext, TSession, TResult> & {
|
|
141
|
+
name?: string;
|
|
142
|
+
outcomePolicy?: VoiceTelephonyOutcomePolicy;
|
|
143
|
+
smoke?: TwilioVoiceSmokeOptions;
|
|
144
|
+
setup?: TwilioVoiceSetupOptions;
|
|
145
|
+
streamPath?: string;
|
|
146
|
+
twiml?: {
|
|
147
|
+
parameters?: TwilioVoiceRouteParameters;
|
|
148
|
+
path?: string;
|
|
149
|
+
streamName?: string;
|
|
150
|
+
streamUrl?: string | ((input: {
|
|
151
|
+
query: Record<string, unknown>;
|
|
152
|
+
request: Request;
|
|
153
|
+
streamPath: string;
|
|
154
|
+
}) => Promise<string> | string);
|
|
155
|
+
track?: TwilioVoiceResponseOptions['track'];
|
|
156
|
+
};
|
|
157
|
+
webhook?: Omit<VoiceTelephonyWebhookRoutesOptions<TContext, TSession, TResult>, 'context' | 'path' | 'policy' | 'provider'> & {
|
|
158
|
+
path?: string;
|
|
159
|
+
policy?: VoiceTelephonyOutcomePolicy;
|
|
160
|
+
};
|
|
161
|
+
};
|
|
110
162
|
export declare const decodeTwilioMulawBase64: (payload: string) => Int16Array<ArrayBuffer>;
|
|
111
163
|
export declare const encodeTwilioMulawBase64: (samples: Int16Array) => string;
|
|
112
164
|
export declare const transcodeTwilioInboundPayloadToPCM16: (payload: string) => Uint8Array<ArrayBuffer>;
|
|
113
165
|
export declare const transcodePCMToTwilioOutboundPayload: (chunk: Uint8Array, format: AudioFormat) => string;
|
|
114
166
|
export declare const createTwilioVoiceResponse: (options: TwilioVoiceResponseOptions) => string;
|
|
115
167
|
export declare const createTwilioMediaStreamBridge: <TContext = unknown, TSession extends VoiceSessionRecord = VoiceSessionRecord, TResult = unknown>(socket: TwilioMediaStreamSocket, options: TwilioMediaStreamBridgeOptions<TContext, TSession, TResult>) => TwilioMediaStreamBridge;
|
|
168
|
+
export declare const createTwilioVoiceRoutes: <TContext = unknown, TSession extends VoiceSessionRecord = VoiceSessionRecord, TResult = unknown>(options: TwilioVoiceRoutesOptions<TContext, TSession, TResult>) => Elysia<"", {
|
|
169
|
+
decorator: {};
|
|
170
|
+
store: {};
|
|
171
|
+
derive: {};
|
|
172
|
+
resolve: {};
|
|
173
|
+
}, {
|
|
174
|
+
typebox: {};
|
|
175
|
+
error: {};
|
|
176
|
+
}, {
|
|
177
|
+
schema: {};
|
|
178
|
+
standaloneSchema: {};
|
|
179
|
+
macro: {};
|
|
180
|
+
macroFn: {};
|
|
181
|
+
parser: {};
|
|
182
|
+
response: {};
|
|
183
|
+
}, {
|
|
184
|
+
[x: string]: {
|
|
185
|
+
get: {
|
|
186
|
+
body: unknown;
|
|
187
|
+
params: {};
|
|
188
|
+
query: unknown;
|
|
189
|
+
headers: unknown;
|
|
190
|
+
response: {
|
|
191
|
+
200: Response;
|
|
192
|
+
};
|
|
193
|
+
};
|
|
194
|
+
};
|
|
195
|
+
} & {
|
|
196
|
+
[x: string]: {
|
|
197
|
+
post: {
|
|
198
|
+
body: unknown;
|
|
199
|
+
params: {};
|
|
200
|
+
query: unknown;
|
|
201
|
+
headers: unknown;
|
|
202
|
+
response: {
|
|
203
|
+
200: Response;
|
|
204
|
+
};
|
|
205
|
+
};
|
|
206
|
+
};
|
|
207
|
+
} & {
|
|
208
|
+
[x: string]: {
|
|
209
|
+
subscribe: {
|
|
210
|
+
body: unknown;
|
|
211
|
+
params: {};
|
|
212
|
+
query: unknown;
|
|
213
|
+
headers: unknown;
|
|
214
|
+
response: {};
|
|
215
|
+
};
|
|
216
|
+
};
|
|
217
|
+
} & {
|
|
218
|
+
[x: string]: {
|
|
219
|
+
post: {
|
|
220
|
+
body: unknown;
|
|
221
|
+
params: {};
|
|
222
|
+
query: unknown;
|
|
223
|
+
headers: unknown;
|
|
224
|
+
response: {
|
|
225
|
+
200: Response | import("..").VoiceTelephonyWebhookDecision<TResult>;
|
|
226
|
+
};
|
|
227
|
+
};
|
|
228
|
+
};
|
|
229
|
+
}, {
|
|
230
|
+
derive: {};
|
|
231
|
+
resolve: {};
|
|
232
|
+
schema: {};
|
|
233
|
+
standaloneSchema: {};
|
|
234
|
+
response: {};
|
|
235
|
+
}, {
|
|
236
|
+
derive: {};
|
|
237
|
+
resolve: {};
|
|
238
|
+
schema: {};
|
|
239
|
+
standaloneSchema: {};
|
|
240
|
+
response: {};
|
|
241
|
+
} & {
|
|
242
|
+
derive: {};
|
|
243
|
+
resolve: {};
|
|
244
|
+
schema: {};
|
|
245
|
+
standaloneSchema: {};
|
|
246
|
+
response: {};
|
|
247
|
+
}>;
|
|
116
248
|
export {};
|
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
import { Elysia } from 'elysia';
|
|
2
|
+
import type { VoiceCallDisposition, VoiceRouteResult, VoiceSessionHandle, VoiceSessionRecord } from './types';
|
|
3
|
+
export type VoiceTelephonyOutcomeAction = 'complete' | 'escalate' | 'ignore' | 'no-answer' | 'transfer' | 'voicemail';
|
|
4
|
+
export type VoiceTelephonyOutcomeProviderEvent = {
|
|
5
|
+
answeredBy?: string;
|
|
6
|
+
durationMs?: number;
|
|
7
|
+
from?: string;
|
|
8
|
+
metadata?: Record<string, unknown>;
|
|
9
|
+
provider?: string;
|
|
10
|
+
reason?: string;
|
|
11
|
+
sipCode?: number;
|
|
12
|
+
status?: string;
|
|
13
|
+
target?: string;
|
|
14
|
+
to?: string;
|
|
15
|
+
};
|
|
16
|
+
export type VoiceTelephonyOutcomeDecision = {
|
|
17
|
+
action: VoiceTelephonyOutcomeAction;
|
|
18
|
+
confidence: 'high' | 'low' | 'medium';
|
|
19
|
+
disposition?: VoiceCallDisposition;
|
|
20
|
+
metadata?: Record<string, unknown>;
|
|
21
|
+
reason?: string;
|
|
22
|
+
source: 'answered-by' | 'duration' | 'explicit-target' | 'policy' | 'sip' | 'status';
|
|
23
|
+
target?: string;
|
|
24
|
+
};
|
|
25
|
+
export type VoiceTelephonyOutcomeStatusDecision = VoiceTelephonyOutcomeAction | Omit<VoiceTelephonyOutcomeDecision, 'confidence' | 'source'> & {
|
|
26
|
+
confidence?: VoiceTelephonyOutcomeDecision['confidence'];
|
|
27
|
+
source?: VoiceTelephonyOutcomeDecision['source'];
|
|
28
|
+
};
|
|
29
|
+
export type VoiceTelephonyOutcomePolicy = {
|
|
30
|
+
completedStatuses?: string[];
|
|
31
|
+
escalationStatuses?: string[];
|
|
32
|
+
failedAsNoAnswer?: boolean;
|
|
33
|
+
failedStatuses?: string[];
|
|
34
|
+
includeProviderPayload?: boolean;
|
|
35
|
+
machineDetectionVoicemailValues?: string[];
|
|
36
|
+
metadata?: Record<string, unknown>;
|
|
37
|
+
minAnsweredDurationMs?: number;
|
|
38
|
+
noAnswerOnZeroDuration?: boolean;
|
|
39
|
+
noAnswerSipCodes?: number[];
|
|
40
|
+
noAnswerStatuses?: string[];
|
|
41
|
+
statusMap?: Record<string, VoiceTelephonyOutcomeStatusDecision>;
|
|
42
|
+
transferStatuses?: string[];
|
|
43
|
+
transferTarget?: string | ((event: VoiceTelephonyOutcomeProviderEvent) => string | undefined);
|
|
44
|
+
voicemailStatuses?: string[];
|
|
45
|
+
};
|
|
46
|
+
export type VoiceTelephonyOutcomeRouteResult<TResult = unknown> = VoiceRouteResult<TResult>;
|
|
47
|
+
export type VoiceTelephonyWebhookProvider = 'generic' | 'plivo' | 'telnyx' | 'twilio';
|
|
48
|
+
export type VoiceTelephonyWebhookParseInput = {
|
|
49
|
+
body: unknown;
|
|
50
|
+
headers: Headers;
|
|
51
|
+
provider: VoiceTelephonyWebhookProvider;
|
|
52
|
+
query: Record<string, unknown>;
|
|
53
|
+
request: Request;
|
|
54
|
+
};
|
|
55
|
+
export type VoiceTelephonyWebhookDecision<TResult = unknown> = {
|
|
56
|
+
applied: boolean;
|
|
57
|
+
decision: VoiceTelephonyOutcomeDecision;
|
|
58
|
+
duplicate?: boolean;
|
|
59
|
+
event: VoiceTelephonyOutcomeProviderEvent;
|
|
60
|
+
idempotencyKey?: string;
|
|
61
|
+
routeResult: VoiceTelephonyOutcomeRouteResult<TResult>;
|
|
62
|
+
sessionId?: string;
|
|
63
|
+
};
|
|
64
|
+
export type StoredVoiceTelephonyWebhookDecision<TResult = unknown> = VoiceTelephonyWebhookDecision<TResult> & {
|
|
65
|
+
createdAt: number;
|
|
66
|
+
updatedAt: number;
|
|
67
|
+
};
|
|
68
|
+
export type VoiceTelephonyWebhookIdempotencyStore<TResult = unknown> = {
|
|
69
|
+
get: (key: string) => Promise<StoredVoiceTelephonyWebhookDecision<TResult> | undefined> | StoredVoiceTelephonyWebhookDecision<TResult> | undefined;
|
|
70
|
+
set: (key: string, decision: StoredVoiceTelephonyWebhookDecision<TResult>) => Promise<void> | void;
|
|
71
|
+
};
|
|
72
|
+
export type VoiceTelephonyWebhookVerificationResult = {
|
|
73
|
+
ok: true;
|
|
74
|
+
} | {
|
|
75
|
+
ok: false;
|
|
76
|
+
reason: 'invalid-signature' | 'missing-secret' | 'missing-signature' | 'unsupported-provider';
|
|
77
|
+
};
|
|
78
|
+
export type VoiceTelephonyWebhookHandlerOptions<TContext = unknown, TSession extends VoiceSessionRecord = VoiceSessionRecord, TResult = unknown> = {
|
|
79
|
+
apply?: boolean | ((input: VoiceTelephonyWebhookDecision<TResult>) => boolean);
|
|
80
|
+
context?: TContext;
|
|
81
|
+
getSessionHandle?: (input: {
|
|
82
|
+
context: TContext;
|
|
83
|
+
decision: VoiceTelephonyOutcomeDecision;
|
|
84
|
+
event: VoiceTelephonyOutcomeProviderEvent;
|
|
85
|
+
request: Request;
|
|
86
|
+
sessionId?: string;
|
|
87
|
+
}) => Promise<VoiceSessionHandle<TContext, TSession, TResult> | undefined> | VoiceSessionHandle<TContext, TSession, TResult> | undefined;
|
|
88
|
+
idempotency?: {
|
|
89
|
+
enabled?: boolean;
|
|
90
|
+
key?: (input: {
|
|
91
|
+
body: unknown;
|
|
92
|
+
event: VoiceTelephonyOutcomeProviderEvent;
|
|
93
|
+
provider: VoiceTelephonyWebhookProvider;
|
|
94
|
+
query: Record<string, unknown>;
|
|
95
|
+
request: Request;
|
|
96
|
+
sessionId?: string;
|
|
97
|
+
}) => Promise<string | undefined> | string | undefined;
|
|
98
|
+
store?: VoiceTelephonyWebhookIdempotencyStore<TResult>;
|
|
99
|
+
};
|
|
100
|
+
onDecision?: (input: VoiceTelephonyWebhookDecision<TResult> & {
|
|
101
|
+
context: TContext;
|
|
102
|
+
request: Request;
|
|
103
|
+
}) => Promise<void> | void;
|
|
104
|
+
parse?: (input: VoiceTelephonyWebhookParseInput) => Promise<VoiceTelephonyOutcomeProviderEvent> | VoiceTelephonyOutcomeProviderEvent;
|
|
105
|
+
policy?: VoiceTelephonyOutcomePolicy;
|
|
106
|
+
provider?: VoiceTelephonyWebhookProvider;
|
|
107
|
+
requireVerification?: boolean;
|
|
108
|
+
resolveSessionId?: (input: {
|
|
109
|
+
body: unknown;
|
|
110
|
+
event: VoiceTelephonyOutcomeProviderEvent;
|
|
111
|
+
query: Record<string, unknown>;
|
|
112
|
+
request: Request;
|
|
113
|
+
}) => Promise<string | undefined> | string | undefined;
|
|
114
|
+
result?: TResult | ((input: {
|
|
115
|
+
decision: VoiceTelephonyOutcomeDecision;
|
|
116
|
+
event: VoiceTelephonyOutcomeProviderEvent;
|
|
117
|
+
sessionId?: string;
|
|
118
|
+
}) => Promise<TResult | undefined> | TResult | undefined);
|
|
119
|
+
signingSecret?: string;
|
|
120
|
+
verificationUrl?: string | ((input: {
|
|
121
|
+
query: Record<string, unknown>;
|
|
122
|
+
request: Request;
|
|
123
|
+
}) => string);
|
|
124
|
+
verify?: (input: {
|
|
125
|
+
body: unknown;
|
|
126
|
+
headers: Headers;
|
|
127
|
+
provider: VoiceTelephonyWebhookProvider;
|
|
128
|
+
query: Record<string, unknown>;
|
|
129
|
+
rawBody: string;
|
|
130
|
+
request: Request;
|
|
131
|
+
}) => Promise<VoiceTelephonyWebhookVerificationResult> | VoiceTelephonyWebhookVerificationResult;
|
|
132
|
+
};
|
|
133
|
+
export type VoiceTelephonyWebhookRoutesOptions<TContext = unknown, TSession extends VoiceSessionRecord = VoiceSessionRecord, TResult = unknown> = VoiceTelephonyWebhookHandlerOptions<TContext, TSession, TResult> & {
|
|
134
|
+
name?: string;
|
|
135
|
+
path?: string;
|
|
136
|
+
};
|
|
137
|
+
export declare class VoiceTelephonyWebhookVerificationError extends Error {
|
|
138
|
+
result: VoiceTelephonyWebhookVerificationResult;
|
|
139
|
+
constructor(result: VoiceTelephonyWebhookVerificationResult);
|
|
140
|
+
}
|
|
141
|
+
export declare const createMemoryVoiceTelephonyWebhookIdempotencyStore: <TResult = unknown>() => VoiceTelephonyWebhookIdempotencyStore<TResult>;
|
|
142
|
+
export declare const createVoiceTelephonyOutcomePolicy: (policy?: VoiceTelephonyOutcomePolicy) => Required<Pick<VoiceTelephonyOutcomePolicy, "completedStatuses" | "escalationStatuses" | "failedAsNoAnswer" | "failedStatuses" | "includeProviderPayload" | "machineDetectionVoicemailValues" | "noAnswerOnZeroDuration" | "noAnswerSipCodes" | "noAnswerStatuses" | "transferStatuses" | "voicemailStatuses">> & VoiceTelephonyOutcomePolicy;
|
|
143
|
+
export declare const resolveVoiceTelephonyOutcome: (event: VoiceTelephonyOutcomeProviderEvent, policyInput?: VoiceTelephonyOutcomePolicy) => VoiceTelephonyOutcomeDecision;
|
|
144
|
+
export declare const voiceTelephonyOutcomeToRouteResult: <TResult = unknown>(decision: VoiceTelephonyOutcomeDecision, result?: TResult) => VoiceTelephonyOutcomeRouteResult<TResult>;
|
|
145
|
+
export declare const applyVoiceTelephonyOutcome: <TContext = unknown, TSession extends VoiceSessionRecord = VoiceSessionRecord, TResult = unknown>(api: VoiceSessionHandle<TContext, TSession, TResult>, decision: VoiceTelephonyOutcomeDecision, result?: TResult) => Promise<void>;
|
|
146
|
+
export declare const signVoiceTwilioWebhook: (input: {
|
|
147
|
+
authToken: string;
|
|
148
|
+
body?: unknown;
|
|
149
|
+
url: string;
|
|
150
|
+
}) => Promise<string>;
|
|
151
|
+
export declare const verifyVoiceTwilioWebhookSignature: (input: {
|
|
152
|
+
authToken?: string;
|
|
153
|
+
body?: unknown;
|
|
154
|
+
headers: Headers;
|
|
155
|
+
url: string;
|
|
156
|
+
}) => Promise<VoiceTelephonyWebhookVerificationResult>;
|
|
157
|
+
export declare const parseVoiceTelephonyWebhookEvent: (input: VoiceTelephonyWebhookParseInput) => VoiceTelephonyOutcomeProviderEvent;
|
|
158
|
+
export declare const createVoiceTelephonyWebhookHandler: <TContext = unknown, TSession extends VoiceSessionRecord = VoiceSessionRecord, TResult = unknown>(options?: VoiceTelephonyWebhookHandlerOptions<TContext, TSession, TResult>) => (input: {
|
|
159
|
+
query?: Record<string, unknown>;
|
|
160
|
+
request: Request;
|
|
161
|
+
}) => Promise<VoiceTelephonyWebhookDecision<TResult>>;
|
|
162
|
+
export declare const createVoiceTelephonyWebhookRoutes: <TContext = unknown, TSession extends VoiceSessionRecord = VoiceSessionRecord, TResult = unknown>(options?: VoiceTelephonyWebhookRoutesOptions<TContext, TSession, TResult>) => Elysia<"", {
|
|
163
|
+
decorator: {};
|
|
164
|
+
store: {};
|
|
165
|
+
derive: {};
|
|
166
|
+
resolve: {};
|
|
167
|
+
}, {
|
|
168
|
+
typebox: {};
|
|
169
|
+
error: {};
|
|
170
|
+
}, {
|
|
171
|
+
schema: {};
|
|
172
|
+
standaloneSchema: {};
|
|
173
|
+
macro: {};
|
|
174
|
+
macroFn: {};
|
|
175
|
+
parser: {};
|
|
176
|
+
response: {};
|
|
177
|
+
}, {
|
|
178
|
+
[x: string]: {
|
|
179
|
+
post: {
|
|
180
|
+
body: unknown;
|
|
181
|
+
params: {};
|
|
182
|
+
query: unknown;
|
|
183
|
+
headers: unknown;
|
|
184
|
+
response: {
|
|
185
|
+
200: Response | VoiceTelephonyWebhookDecision<TResult>;
|
|
186
|
+
};
|
|
187
|
+
};
|
|
188
|
+
};
|
|
189
|
+
}, {
|
|
190
|
+
derive: {};
|
|
191
|
+
resolve: {};
|
|
192
|
+
schema: {};
|
|
193
|
+
standaloneSchema: {};
|
|
194
|
+
response: {};
|
|
195
|
+
}, {
|
|
196
|
+
derive: {};
|
|
197
|
+
resolve: {};
|
|
198
|
+
schema: {};
|
|
199
|
+
standaloneSchema: {};
|
|
200
|
+
response: {};
|
|
201
|
+
}>;
|
package/dist/testing/index.d.ts
CHANGED
|
@@ -3,6 +3,8 @@ export * from './benchmark';
|
|
|
3
3
|
export * from './corrected';
|
|
4
4
|
export * from './duplex';
|
|
5
5
|
export * from './fixtures';
|
|
6
|
+
export * from './ioProviderSimulator';
|
|
7
|
+
export * from './providerSimulator';
|
|
6
8
|
export * from './resilience';
|
|
7
9
|
export * from './review';
|
|
8
10
|
export * from './sessionBenchmark';
|