@veroai/sdk 0.1.0
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 +291 -0
- package/dist/index.cjs +1946 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +1569 -0
- package/dist/index.d.ts +1569 -0
- package/dist/index.js +1926 -0
- package/dist/index.js.map +1 -0
- package/package.json +81 -0
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,1569 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* VeroAI SDK Types
|
|
3
|
+
*/
|
|
4
|
+
interface VeroAIConfig {
|
|
5
|
+
/** API key (sk_live_*, sk_test_*, or sk_dev_*) */
|
|
6
|
+
apiKey: string;
|
|
7
|
+
/** Base URL for API requests (default: https://api.veroai.dev) */
|
|
8
|
+
baseUrl?: string;
|
|
9
|
+
/** Request timeout in milliseconds (default: 30000) */
|
|
10
|
+
timeout?: number;
|
|
11
|
+
/** Maximum number of retries for failed requests (default: 3) */
|
|
12
|
+
maxRetries?: number;
|
|
13
|
+
/** Custom fetch implementation (for Node.js < 18 or testing) */
|
|
14
|
+
fetch?: typeof fetch;
|
|
15
|
+
}
|
|
16
|
+
interface PaginationParams {
|
|
17
|
+
limit?: number;
|
|
18
|
+
offset?: number;
|
|
19
|
+
}
|
|
20
|
+
interface PaginatedResponse<T> {
|
|
21
|
+
data: T[];
|
|
22
|
+
total: number;
|
|
23
|
+
hasMore: boolean;
|
|
24
|
+
nextOffset?: number;
|
|
25
|
+
}
|
|
26
|
+
interface DateRangeParams {
|
|
27
|
+
startDate?: string | Date;
|
|
28
|
+
endDate?: string | Date;
|
|
29
|
+
}
|
|
30
|
+
type AdapterType = 'email_mx' | 'gmail-oauth' | 'sms_twilio' | 'whatsapp' | 'instagram' | 'messenger' | 'voice_twilio' | 'voice_jambonz' | 'vero-voice';
|
|
31
|
+
type ChannelDirection = 'inbound' | 'outbound' | 'bidirectional';
|
|
32
|
+
type ChannelStatus = 'pending' | 'active' | 'paused' | 'error' | 'suspended';
|
|
33
|
+
interface Channel {
|
|
34
|
+
id: string;
|
|
35
|
+
tenantId: string;
|
|
36
|
+
name: string;
|
|
37
|
+
description: string | null;
|
|
38
|
+
adapterType: AdapterType;
|
|
39
|
+
direction: ChannelDirection;
|
|
40
|
+
status: ChannelStatus;
|
|
41
|
+
createdAt: string;
|
|
42
|
+
updatedAt: string;
|
|
43
|
+
}
|
|
44
|
+
interface CreateChannelParams {
|
|
45
|
+
name: string;
|
|
46
|
+
description?: string;
|
|
47
|
+
adapterType: AdapterType;
|
|
48
|
+
direction: ChannelDirection;
|
|
49
|
+
config: Record<string, unknown>;
|
|
50
|
+
}
|
|
51
|
+
interface UpdateChannelParams {
|
|
52
|
+
name?: string;
|
|
53
|
+
description?: string;
|
|
54
|
+
status?: 'active' | 'paused';
|
|
55
|
+
config?: Record<string, unknown>;
|
|
56
|
+
}
|
|
57
|
+
interface ChannelHealth {
|
|
58
|
+
status: 'healthy' | 'degraded' | 'unhealthy';
|
|
59
|
+
lastEventAt: string | null;
|
|
60
|
+
errorCount24h: number;
|
|
61
|
+
successRate: number;
|
|
62
|
+
}
|
|
63
|
+
type CanonicalType = 'message' | 'call' | 'status' | 'system' | 'ai';
|
|
64
|
+
type EventDirection = 'inbound' | 'outbound' | 'internal';
|
|
65
|
+
interface ActivityEvent {
|
|
66
|
+
eventId: string;
|
|
67
|
+
tenantId: string;
|
|
68
|
+
channelId: string;
|
|
69
|
+
eventType: string;
|
|
70
|
+
canonicalType: CanonicalType;
|
|
71
|
+
direction: EventDirection;
|
|
72
|
+
adapterType: string;
|
|
73
|
+
occurredAt: string;
|
|
74
|
+
ingestedAt: string;
|
|
75
|
+
payload: Record<string, unknown>;
|
|
76
|
+
}
|
|
77
|
+
interface ListEventsParams extends PaginationParams, DateRangeParams {
|
|
78
|
+
channelId?: string;
|
|
79
|
+
eventType?: string;
|
|
80
|
+
canonicalType?: CanonicalType;
|
|
81
|
+
direction?: EventDirection;
|
|
82
|
+
}
|
|
83
|
+
interface EventStats {
|
|
84
|
+
totalEvents: number;
|
|
85
|
+
eventsByType: Record<string, number>;
|
|
86
|
+
eventsByChannel: Record<string, number>;
|
|
87
|
+
}
|
|
88
|
+
interface TimeSeriesDataPoint {
|
|
89
|
+
timestamp: string;
|
|
90
|
+
value: number;
|
|
91
|
+
}
|
|
92
|
+
type TimeSeriesGranularity = 'minute' | 'hour' | 'day';
|
|
93
|
+
interface SendMessageParams {
|
|
94
|
+
channelId: string;
|
|
95
|
+
to: string | string[];
|
|
96
|
+
subject?: string;
|
|
97
|
+
content: {
|
|
98
|
+
type: 'text' | 'html' | 'markdown';
|
|
99
|
+
text?: string;
|
|
100
|
+
html?: string;
|
|
101
|
+
};
|
|
102
|
+
metadata?: Record<string, unknown>;
|
|
103
|
+
}
|
|
104
|
+
interface SendMessageResult {
|
|
105
|
+
messageId: string;
|
|
106
|
+
eventId: string;
|
|
107
|
+
status: 'queued' | 'sent';
|
|
108
|
+
providerMessageId?: string;
|
|
109
|
+
}
|
|
110
|
+
type WebhookStatus = 'active' | 'paused' | 'suspended';
|
|
111
|
+
interface RetryConfig {
|
|
112
|
+
enabled: boolean;
|
|
113
|
+
maxAttempts: number;
|
|
114
|
+
backoff: 'linear' | 'exponential';
|
|
115
|
+
}
|
|
116
|
+
interface Webhook {
|
|
117
|
+
id: string;
|
|
118
|
+
tenantId: string;
|
|
119
|
+
name: string;
|
|
120
|
+
url: string;
|
|
121
|
+
events: string[];
|
|
122
|
+
channelId: string | null;
|
|
123
|
+
headers: Record<string, string>;
|
|
124
|
+
status: WebhookStatus;
|
|
125
|
+
retryConfig: RetryConfig;
|
|
126
|
+
createdAt: string;
|
|
127
|
+
updatedAt: string;
|
|
128
|
+
}
|
|
129
|
+
interface CreateWebhookParams {
|
|
130
|
+
name: string;
|
|
131
|
+
url: string;
|
|
132
|
+
events: string[];
|
|
133
|
+
channelId?: string | null;
|
|
134
|
+
headers?: Record<string, string>;
|
|
135
|
+
retryConfig?: Partial<RetryConfig>;
|
|
136
|
+
}
|
|
137
|
+
interface UpdateWebhookParams {
|
|
138
|
+
name?: string;
|
|
139
|
+
url?: string;
|
|
140
|
+
events?: string[];
|
|
141
|
+
channelId?: string | null;
|
|
142
|
+
headers?: Record<string, string>;
|
|
143
|
+
status?: 'active' | 'paused';
|
|
144
|
+
retryConfig?: Partial<RetryConfig>;
|
|
145
|
+
}
|
|
146
|
+
interface WebhookDelivery {
|
|
147
|
+
id: string;
|
|
148
|
+
webhookId: string;
|
|
149
|
+
eventId: string;
|
|
150
|
+
eventType?: string;
|
|
151
|
+
status: 'pending' | 'success' | 'failed';
|
|
152
|
+
attempts: number;
|
|
153
|
+
responseCode: number | null;
|
|
154
|
+
responseBody: string | null;
|
|
155
|
+
responseTimeMs: number | null;
|
|
156
|
+
createdAt: string;
|
|
157
|
+
completedAt: string | null;
|
|
158
|
+
}
|
|
159
|
+
interface WebhookStats {
|
|
160
|
+
total: number;
|
|
161
|
+
success: number;
|
|
162
|
+
failed: number;
|
|
163
|
+
pending: number;
|
|
164
|
+
successRate: number;
|
|
165
|
+
averageResponseTimeMs: number;
|
|
166
|
+
timeRange: '1h' | '24h' | '7d';
|
|
167
|
+
}
|
|
168
|
+
type ApiKeyEnvironment = 'production' | 'development' | 'testing';
|
|
169
|
+
interface ApiKey {
|
|
170
|
+
id: string;
|
|
171
|
+
tenantId: string;
|
|
172
|
+
name: string;
|
|
173
|
+
keyPrefix: string;
|
|
174
|
+
environment: ApiKeyEnvironment;
|
|
175
|
+
scopes: string[];
|
|
176
|
+
expiresAt: string | null;
|
|
177
|
+
lastUsedAt: string | null;
|
|
178
|
+
createdAt: string;
|
|
179
|
+
}
|
|
180
|
+
interface CreateApiKeyParams {
|
|
181
|
+
name: string;
|
|
182
|
+
environment: ApiKeyEnvironment;
|
|
183
|
+
scopes: string[];
|
|
184
|
+
expiresAt?: string | Date;
|
|
185
|
+
}
|
|
186
|
+
interface CreateApiKeyResult {
|
|
187
|
+
apiKey: ApiKey;
|
|
188
|
+
/** The plaintext key - only returned once at creation */
|
|
189
|
+
key: string;
|
|
190
|
+
}
|
|
191
|
+
type DomainStatus = 'pending' | 'verified' | 'failed';
|
|
192
|
+
interface Domain {
|
|
193
|
+
id: string;
|
|
194
|
+
tenantId: string;
|
|
195
|
+
domain: string;
|
|
196
|
+
status: DomainStatus;
|
|
197
|
+
verificationRecord: string | null;
|
|
198
|
+
verificationStatus: {
|
|
199
|
+
dkim: boolean;
|
|
200
|
+
spf: boolean;
|
|
201
|
+
dmarc: boolean;
|
|
202
|
+
mx: boolean;
|
|
203
|
+
lastCheckedAt?: string | null;
|
|
204
|
+
};
|
|
205
|
+
dnsRecords: DnsRecord[];
|
|
206
|
+
createdAt: string;
|
|
207
|
+
updatedAt: string;
|
|
208
|
+
}
|
|
209
|
+
interface DnsRecord {
|
|
210
|
+
type: 'MX' | 'TXT' | 'CNAME';
|
|
211
|
+
name: string;
|
|
212
|
+
value: string;
|
|
213
|
+
priority?: number;
|
|
214
|
+
verified: boolean;
|
|
215
|
+
}
|
|
216
|
+
interface CreateDomainParams {
|
|
217
|
+
domain: string;
|
|
218
|
+
verificationMethod: 'cloudflare' | 'manual';
|
|
219
|
+
cloudflareApiToken?: string;
|
|
220
|
+
}
|
|
221
|
+
interface VerifyDomainResult {
|
|
222
|
+
domain: Domain;
|
|
223
|
+
verificationResults: {
|
|
224
|
+
dkim: {
|
|
225
|
+
verified: boolean;
|
|
226
|
+
error?: string;
|
|
227
|
+
};
|
|
228
|
+
spf: {
|
|
229
|
+
verified: boolean;
|
|
230
|
+
error?: string;
|
|
231
|
+
};
|
|
232
|
+
dmarc: {
|
|
233
|
+
verified: boolean;
|
|
234
|
+
error?: string;
|
|
235
|
+
};
|
|
236
|
+
mx: {
|
|
237
|
+
verified: boolean;
|
|
238
|
+
error?: string;
|
|
239
|
+
};
|
|
240
|
+
};
|
|
241
|
+
}
|
|
242
|
+
interface EnrichmentConfig {
|
|
243
|
+
id: string;
|
|
244
|
+
tenantId: string;
|
|
245
|
+
name: string;
|
|
246
|
+
description: string | null;
|
|
247
|
+
status: 'draft' | 'active' | 'archived';
|
|
248
|
+
intents: IntentDefinition[];
|
|
249
|
+
entities: EntityDefinition[];
|
|
250
|
+
sentiment: SentimentConfig;
|
|
251
|
+
language: LanguageConfig;
|
|
252
|
+
channelOverrides: Record<string, ChannelOverride>;
|
|
253
|
+
version: number;
|
|
254
|
+
createdAt: string;
|
|
255
|
+
updatedAt: string;
|
|
256
|
+
}
|
|
257
|
+
interface IntentDefinition {
|
|
258
|
+
id: string;
|
|
259
|
+
name: string;
|
|
260
|
+
description: string;
|
|
261
|
+
examples: string[];
|
|
262
|
+
priority: number;
|
|
263
|
+
}
|
|
264
|
+
interface EntityDefinition {
|
|
265
|
+
id: string;
|
|
266
|
+
name: string;
|
|
267
|
+
type: 'custom' | 'builtin';
|
|
268
|
+
extractionType: 'keyword' | 'pattern' | 'llm';
|
|
269
|
+
values?: string[];
|
|
270
|
+
pattern?: string;
|
|
271
|
+
}
|
|
272
|
+
interface SentimentConfig {
|
|
273
|
+
enabled: boolean;
|
|
274
|
+
includeUrgency: boolean;
|
|
275
|
+
}
|
|
276
|
+
interface LanguageConfig {
|
|
277
|
+
enabled: boolean;
|
|
278
|
+
supportedLanguages: string[];
|
|
279
|
+
translateToEnglish: boolean;
|
|
280
|
+
}
|
|
281
|
+
interface ChannelOverride {
|
|
282
|
+
intents?: string[];
|
|
283
|
+
entities?: string[];
|
|
284
|
+
sentiment?: boolean;
|
|
285
|
+
language?: boolean;
|
|
286
|
+
}
|
|
287
|
+
interface EnrichmentResult {
|
|
288
|
+
intent: string;
|
|
289
|
+
intentConfidence: number;
|
|
290
|
+
entities: ExtractedEntity[];
|
|
291
|
+
sentiment?: {
|
|
292
|
+
label: 'positive' | 'negative' | 'neutral';
|
|
293
|
+
score: number;
|
|
294
|
+
};
|
|
295
|
+
language?: {
|
|
296
|
+
detected: string;
|
|
297
|
+
confidence: number;
|
|
298
|
+
};
|
|
299
|
+
urgency?: 'low' | 'medium' | 'high' | 'critical';
|
|
300
|
+
processedAt: string;
|
|
301
|
+
modelVersion: string;
|
|
302
|
+
}
|
|
303
|
+
interface ExtractedEntity {
|
|
304
|
+
type: string;
|
|
305
|
+
value: string;
|
|
306
|
+
confidence: number;
|
|
307
|
+
position?: {
|
|
308
|
+
start: number;
|
|
309
|
+
end: number;
|
|
310
|
+
};
|
|
311
|
+
}
|
|
312
|
+
type PhoneNumberStatus = 'active' | 'pending' | 'released';
|
|
313
|
+
type PhoneNumberCapability = 'voice' | 'sms' | 'mms';
|
|
314
|
+
interface PhoneNumber {
|
|
315
|
+
id: string;
|
|
316
|
+
number: string;
|
|
317
|
+
country: string;
|
|
318
|
+
region: string | null;
|
|
319
|
+
locality: string | null;
|
|
320
|
+
capabilities: PhoneNumberCapability[];
|
|
321
|
+
channelId: string | null;
|
|
322
|
+
channelName?: string | null;
|
|
323
|
+
status: PhoneNumberStatus;
|
|
324
|
+
monthlyCostCents: number | null;
|
|
325
|
+
setupCostCents: number | null;
|
|
326
|
+
createdAt: string;
|
|
327
|
+
updatedAt: string;
|
|
328
|
+
}
|
|
329
|
+
interface AvailableNumber {
|
|
330
|
+
number: string;
|
|
331
|
+
country: string;
|
|
332
|
+
region: string | null;
|
|
333
|
+
locality: string | null;
|
|
334
|
+
capabilities: PhoneNumberCapability[];
|
|
335
|
+
monthlyCostCents: number;
|
|
336
|
+
setupCostCents: number;
|
|
337
|
+
provider: string;
|
|
338
|
+
}
|
|
339
|
+
interface SearchNumbersParams {
|
|
340
|
+
country: string;
|
|
341
|
+
areaCode?: string;
|
|
342
|
+
contains?: string;
|
|
343
|
+
capabilities?: PhoneNumberCapability[];
|
|
344
|
+
limit?: number;
|
|
345
|
+
}
|
|
346
|
+
interface PurchaseNumberParams {
|
|
347
|
+
number: string;
|
|
348
|
+
channelId?: string;
|
|
349
|
+
}
|
|
350
|
+
interface UpdateNumberParams {
|
|
351
|
+
channelId?: string | null;
|
|
352
|
+
}
|
|
353
|
+
interface ListNumbersParams extends PaginationParams {
|
|
354
|
+
channelId?: string;
|
|
355
|
+
status?: PhoneNumberStatus;
|
|
356
|
+
country?: string;
|
|
357
|
+
capabilities?: PhoneNumberCapability[];
|
|
358
|
+
}
|
|
359
|
+
type CallDirection = 'inbound' | 'outbound';
|
|
360
|
+
type CallStatus = 'initiated' | 'ringing' | 'answered' | 'ended';
|
|
361
|
+
type CallEndReason = 'completed' | 'busy' | 'no-answer' | 'failed' | 'canceled';
|
|
362
|
+
interface Call {
|
|
363
|
+
id: string;
|
|
364
|
+
channelId: string;
|
|
365
|
+
providerCallSid: string;
|
|
366
|
+
fromNumber: string;
|
|
367
|
+
toNumber: string;
|
|
368
|
+
direction: CallDirection;
|
|
369
|
+
status: CallStatus;
|
|
370
|
+
endReason: CallEndReason | null;
|
|
371
|
+
initiatedAt: string;
|
|
372
|
+
ringingAt: string | null;
|
|
373
|
+
answeredAt: string | null;
|
|
374
|
+
endedAt: string | null;
|
|
375
|
+
durationSeconds: number | null;
|
|
376
|
+
recordingUrl: string | null;
|
|
377
|
+
transcriptionUrl: string | null;
|
|
378
|
+
agentId: string | null;
|
|
379
|
+
metadata: Record<string, unknown> | null;
|
|
380
|
+
}
|
|
381
|
+
interface DialParams {
|
|
382
|
+
channelId: string;
|
|
383
|
+
to: string;
|
|
384
|
+
from?: string;
|
|
385
|
+
timeout?: number;
|
|
386
|
+
metadata?: Record<string, unknown>;
|
|
387
|
+
}
|
|
388
|
+
interface ListCallsParams extends PaginationParams, DateRangeParams {
|
|
389
|
+
channelId?: string;
|
|
390
|
+
direction?: CallDirection;
|
|
391
|
+
status?: CallStatus;
|
|
392
|
+
fromNumber?: string;
|
|
393
|
+
toNumber?: string;
|
|
394
|
+
}
|
|
395
|
+
type InboundHandler = 'agent' | 'webhook' | 'forward' | 'voicemail';
|
|
396
|
+
interface TtsConfig {
|
|
397
|
+
vendor: 'elevenlabs' | 'google' | 'azure' | 'aws' | 'deepgram';
|
|
398
|
+
voice: string;
|
|
399
|
+
language?: string;
|
|
400
|
+
}
|
|
401
|
+
interface SttConfig {
|
|
402
|
+
vendor: 'deepgram' | 'google' | 'azure' | 'aws' | 'assembly';
|
|
403
|
+
model: string;
|
|
404
|
+
language: string;
|
|
405
|
+
}
|
|
406
|
+
interface RecordingConfig {
|
|
407
|
+
enabled: boolean;
|
|
408
|
+
stereo: boolean;
|
|
409
|
+
}
|
|
410
|
+
interface InboundConfig {
|
|
411
|
+
forwardTo?: string;
|
|
412
|
+
webhookUrl?: string;
|
|
413
|
+
voicemailGreeting?: string;
|
|
414
|
+
agentId?: string;
|
|
415
|
+
}
|
|
416
|
+
interface VoiceChannelConfig {
|
|
417
|
+
inboundHandler: InboundHandler;
|
|
418
|
+
inboundConfig?: InboundConfig;
|
|
419
|
+
tts?: TtsConfig;
|
|
420
|
+
stt?: SttConfig;
|
|
421
|
+
recording?: RecordingConfig;
|
|
422
|
+
transcriptionEnabled?: boolean;
|
|
423
|
+
}
|
|
424
|
+
interface CreateVoiceChannelParams {
|
|
425
|
+
name: string;
|
|
426
|
+
description?: string;
|
|
427
|
+
config: VoiceChannelConfig;
|
|
428
|
+
}
|
|
429
|
+
interface UpdateVoiceChannelParams {
|
|
430
|
+
name?: string;
|
|
431
|
+
description?: string;
|
|
432
|
+
status?: 'active' | 'paused';
|
|
433
|
+
config?: Partial<VoiceChannelConfig>;
|
|
434
|
+
}
|
|
435
|
+
interface CreateRoomParams {
|
|
436
|
+
/** Room name (unique identifier) */
|
|
437
|
+
name: string;
|
|
438
|
+
/** Time in seconds before empty room is deleted (default: 300) */
|
|
439
|
+
emptyTimeout?: number;
|
|
440
|
+
/** Maximum number of participants (default: 10) */
|
|
441
|
+
maxParticipants?: number;
|
|
442
|
+
/** Optional metadata to attach to the room */
|
|
443
|
+
metadata?: Record<string, unknown>;
|
|
444
|
+
}
|
|
445
|
+
interface JoinRoomParams {
|
|
446
|
+
/** Name of the room to join */
|
|
447
|
+
roomName: string;
|
|
448
|
+
/** Display name for the participant */
|
|
449
|
+
participantName: string;
|
|
450
|
+
/** Unique identifier for the participant (defaults to participantName) */
|
|
451
|
+
participantIdentity?: string;
|
|
452
|
+
/** Whether participant can publish audio/video (default: true) */
|
|
453
|
+
canPublish?: boolean;
|
|
454
|
+
/** Whether participant can subscribe to others (default: true) */
|
|
455
|
+
canSubscribe?: boolean;
|
|
456
|
+
/** Whether participant can send data messages (default: true) */
|
|
457
|
+
canPublishData?: boolean;
|
|
458
|
+
/** Optional metadata to attach to the participant */
|
|
459
|
+
metadata?: Record<string, unknown>;
|
|
460
|
+
}
|
|
461
|
+
interface LiveKitRoomInfo {
|
|
462
|
+
/** Server-assigned room ID */
|
|
463
|
+
sid: string;
|
|
464
|
+
/** Room name */
|
|
465
|
+
name: string;
|
|
466
|
+
/** WebSocket URL for client connection */
|
|
467
|
+
wsUrl: string;
|
|
468
|
+
/** Access token for joining the room */
|
|
469
|
+
token: string;
|
|
470
|
+
/** Current number of participants */
|
|
471
|
+
numParticipants: number;
|
|
472
|
+
/** Room metadata */
|
|
473
|
+
metadata?: Record<string, unknown>;
|
|
474
|
+
}
|
|
475
|
+
interface LiveKitRoom {
|
|
476
|
+
/** Server-assigned room ID */
|
|
477
|
+
sid: string;
|
|
478
|
+
/** Room name */
|
|
479
|
+
name: string;
|
|
480
|
+
/** Time in seconds before empty room is deleted */
|
|
481
|
+
emptyTimeout: number;
|
|
482
|
+
/** Maximum number of participants */
|
|
483
|
+
maxParticipants: number;
|
|
484
|
+
/** Room creation timestamp */
|
|
485
|
+
creationTime: string;
|
|
486
|
+
/** Current number of participants */
|
|
487
|
+
numParticipants: number;
|
|
488
|
+
/** Room metadata */
|
|
489
|
+
metadata?: string;
|
|
490
|
+
}
|
|
491
|
+
type ParticipantState = 'JOINING' | 'ACTIVE' | 'DISCONNECTED';
|
|
492
|
+
interface LiveKitParticipant {
|
|
493
|
+
/** Server-assigned participant ID */
|
|
494
|
+
sid: string;
|
|
495
|
+
/** Participant identity */
|
|
496
|
+
identity: string;
|
|
497
|
+
/** Participant display name */
|
|
498
|
+
name: string;
|
|
499
|
+
/** Current connection state */
|
|
500
|
+
state: ParticipantState;
|
|
501
|
+
/** Participant metadata */
|
|
502
|
+
metadata?: string;
|
|
503
|
+
/** Timestamp when participant joined */
|
|
504
|
+
joinedAt: string;
|
|
505
|
+
/** Whether participant is publishing any tracks */
|
|
506
|
+
isPublisher: boolean;
|
|
507
|
+
}
|
|
508
|
+
interface ListRoomsParams {
|
|
509
|
+
/** Filter by room names */
|
|
510
|
+
names?: string[];
|
|
511
|
+
}
|
|
512
|
+
interface AgentConfig {
|
|
513
|
+
/** Agent configuration ID */
|
|
514
|
+
id: string;
|
|
515
|
+
/** Agent name */
|
|
516
|
+
name: string;
|
|
517
|
+
/** Agent description */
|
|
518
|
+
description: string | null;
|
|
519
|
+
/** Whether agent is enabled */
|
|
520
|
+
enabled: boolean;
|
|
521
|
+
/** Model configuration */
|
|
522
|
+
modelConfig: {
|
|
523
|
+
provider: 'anthropic' | 'openai';
|
|
524
|
+
modelId: string;
|
|
525
|
+
temperature: number;
|
|
526
|
+
maxTokens: number;
|
|
527
|
+
};
|
|
528
|
+
/** System prompt */
|
|
529
|
+
systemPrompt: string;
|
|
530
|
+
/** Status */
|
|
531
|
+
status: 'draft' | 'active' | 'archived';
|
|
532
|
+
}
|
|
533
|
+
interface ListAgentsParams extends PaginationParams {
|
|
534
|
+
/** Filter by status */
|
|
535
|
+
status?: 'draft' | 'active' | 'archived';
|
|
536
|
+
/** Filter by enabled state */
|
|
537
|
+
enabled?: boolean;
|
|
538
|
+
}
|
|
539
|
+
interface CreateAgentParams {
|
|
540
|
+
/** Agent name */
|
|
541
|
+
name: string;
|
|
542
|
+
/** Agent description */
|
|
543
|
+
description?: string;
|
|
544
|
+
/** Model configuration */
|
|
545
|
+
modelConfig: {
|
|
546
|
+
provider: 'anthropic' | 'openai';
|
|
547
|
+
modelId: string;
|
|
548
|
+
temperature?: number;
|
|
549
|
+
maxTokens?: number;
|
|
550
|
+
};
|
|
551
|
+
/** System prompt */
|
|
552
|
+
systemPrompt: string;
|
|
553
|
+
/** Whether to enable immediately */
|
|
554
|
+
enabled?: boolean;
|
|
555
|
+
}
|
|
556
|
+
interface UpdateAgentParams {
|
|
557
|
+
/** Agent name */
|
|
558
|
+
name?: string;
|
|
559
|
+
/** Agent description */
|
|
560
|
+
description?: string;
|
|
561
|
+
/** Model configuration */
|
|
562
|
+
modelConfig?: {
|
|
563
|
+
provider?: 'anthropic' | 'openai';
|
|
564
|
+
modelId?: string;
|
|
565
|
+
temperature?: number;
|
|
566
|
+
maxTokens?: number;
|
|
567
|
+
};
|
|
568
|
+
/** System prompt */
|
|
569
|
+
systemPrompt?: string;
|
|
570
|
+
/** Whether agent is enabled */
|
|
571
|
+
enabled?: boolean;
|
|
572
|
+
/** Status */
|
|
573
|
+
status?: 'draft' | 'active' | 'archived';
|
|
574
|
+
}
|
|
575
|
+
interface VeroAIErrorDetails {
|
|
576
|
+
code: string;
|
|
577
|
+
message: string;
|
|
578
|
+
details?: Record<string, unknown>;
|
|
579
|
+
}
|
|
580
|
+
|
|
581
|
+
/**
|
|
582
|
+
* HTTP Client for VeroAI SDK
|
|
583
|
+
*/
|
|
584
|
+
|
|
585
|
+
interface RequestOptions {
|
|
586
|
+
method: 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE';
|
|
587
|
+
path: string;
|
|
588
|
+
body?: unknown;
|
|
589
|
+
query?: Record<string, string | number | boolean | undefined>;
|
|
590
|
+
headers?: Record<string, string>;
|
|
591
|
+
timeout?: number;
|
|
592
|
+
}
|
|
593
|
+
declare class HttpClient {
|
|
594
|
+
private readonly apiKey;
|
|
595
|
+
private readonly baseUrl;
|
|
596
|
+
private readonly timeout;
|
|
597
|
+
private readonly maxRetries;
|
|
598
|
+
private readonly fetchFn;
|
|
599
|
+
constructor(config: VeroAIConfig);
|
|
600
|
+
request<T>(options: RequestOptions): Promise<T>;
|
|
601
|
+
private executeRequest;
|
|
602
|
+
private buildUrl;
|
|
603
|
+
private buildHeaders;
|
|
604
|
+
private handleErrorResponse;
|
|
605
|
+
private getRetryAfter;
|
|
606
|
+
private calculateBackoff;
|
|
607
|
+
private sleep;
|
|
608
|
+
get<T>(path: string, query?: Record<string, string | number | boolean | undefined>): Promise<T>;
|
|
609
|
+
post<T>(path: string, body?: unknown): Promise<T>;
|
|
610
|
+
put<T>(path: string, body?: unknown): Promise<T>;
|
|
611
|
+
patch<T>(path: string, body?: unknown): Promise<T>;
|
|
612
|
+
delete<T>(path: string): Promise<T>;
|
|
613
|
+
}
|
|
614
|
+
|
|
615
|
+
/**
|
|
616
|
+
* Channels Resource
|
|
617
|
+
*/
|
|
618
|
+
|
|
619
|
+
declare class ChannelsResource {
|
|
620
|
+
private readonly http;
|
|
621
|
+
constructor(http: HttpClient);
|
|
622
|
+
/**
|
|
623
|
+
* List all channels
|
|
624
|
+
*/
|
|
625
|
+
list(): Promise<PaginatedResponse<Channel>>;
|
|
626
|
+
/**
|
|
627
|
+
* Get a channel by ID
|
|
628
|
+
*/
|
|
629
|
+
get(channelId: string): Promise<Channel>;
|
|
630
|
+
/**
|
|
631
|
+
* Create a new channel
|
|
632
|
+
* @returns The created channel and optionally an OAuth URL for OAuth-based adapters
|
|
633
|
+
*/
|
|
634
|
+
create(params: CreateChannelParams): Promise<{
|
|
635
|
+
channel: Channel;
|
|
636
|
+
oauthUrl?: string;
|
|
637
|
+
}>;
|
|
638
|
+
/**
|
|
639
|
+
* Update a channel
|
|
640
|
+
*/
|
|
641
|
+
update(channelId: string, params: UpdateChannelParams): Promise<Channel>;
|
|
642
|
+
/**
|
|
643
|
+
* Delete a channel
|
|
644
|
+
*/
|
|
645
|
+
delete(channelId: string): Promise<void>;
|
|
646
|
+
/**
|
|
647
|
+
* Test channel connectivity
|
|
648
|
+
*/
|
|
649
|
+
test(channelId: string): Promise<{
|
|
650
|
+
success: boolean;
|
|
651
|
+
message?: string;
|
|
652
|
+
}>;
|
|
653
|
+
/**
|
|
654
|
+
* Get channel health metrics
|
|
655
|
+
*/
|
|
656
|
+
health(channelId: string): Promise<ChannelHealth>;
|
|
657
|
+
}
|
|
658
|
+
|
|
659
|
+
/**
|
|
660
|
+
* Events Resource
|
|
661
|
+
*/
|
|
662
|
+
|
|
663
|
+
declare class EventsResource {
|
|
664
|
+
private readonly http;
|
|
665
|
+
constructor(http: HttpClient);
|
|
666
|
+
/**
|
|
667
|
+
* List activity events with optional filters
|
|
668
|
+
*/
|
|
669
|
+
list(params?: ListEventsParams): Promise<PaginatedResponse<ActivityEvent>>;
|
|
670
|
+
/**
|
|
671
|
+
* Get a single event by ID
|
|
672
|
+
*/
|
|
673
|
+
get(eventId: string): Promise<ActivityEvent>;
|
|
674
|
+
/**
|
|
675
|
+
* Get event statistics summary
|
|
676
|
+
*/
|
|
677
|
+
stats(options?: {
|
|
678
|
+
days?: number;
|
|
679
|
+
}): Promise<EventStats>;
|
|
680
|
+
/**
|
|
681
|
+
* Get time series data for charts
|
|
682
|
+
*/
|
|
683
|
+
timeseries(options?: {
|
|
684
|
+
days?: number;
|
|
685
|
+
granularity?: TimeSeriesGranularity;
|
|
686
|
+
}): Promise<TimeSeriesDataPoint[]>;
|
|
687
|
+
}
|
|
688
|
+
|
|
689
|
+
/**
|
|
690
|
+
* Messages Resource
|
|
691
|
+
*/
|
|
692
|
+
|
|
693
|
+
declare class MessagesResource {
|
|
694
|
+
private readonly http;
|
|
695
|
+
constructor(http: HttpClient);
|
|
696
|
+
/**
|
|
697
|
+
* Send a message through a channel
|
|
698
|
+
*
|
|
699
|
+
* @example
|
|
700
|
+
* ```typescript
|
|
701
|
+
* // Send an SMS
|
|
702
|
+
* const result = await veroai.messages.send({
|
|
703
|
+
* channelId: 'ch_abc123',
|
|
704
|
+
* to: '+15551234567',
|
|
705
|
+
* content: { type: 'text', text: 'Hello from VeroAI!' }
|
|
706
|
+
* });
|
|
707
|
+
*
|
|
708
|
+
* // Send an email
|
|
709
|
+
* const result = await veroai.messages.send({
|
|
710
|
+
* channelId: 'ch_def456',
|
|
711
|
+
* to: 'user@example.com',
|
|
712
|
+
* subject: 'Welcome!',
|
|
713
|
+
* content: {
|
|
714
|
+
* type: 'html',
|
|
715
|
+
* html: '<h1>Welcome to our platform</h1>'
|
|
716
|
+
* }
|
|
717
|
+
* });
|
|
718
|
+
* ```
|
|
719
|
+
*/
|
|
720
|
+
send(params: SendMessageParams): Promise<SendMessageResult>;
|
|
721
|
+
/**
|
|
722
|
+
* Send a message to multiple recipients (batch)
|
|
723
|
+
*
|
|
724
|
+
* @example
|
|
725
|
+
* ```typescript
|
|
726
|
+
* const results = await veroai.messages.sendBatch({
|
|
727
|
+
* channelId: 'ch_abc123',
|
|
728
|
+
* messages: [
|
|
729
|
+
* { to: '+15551234567', content: { type: 'text', text: 'Hello!' } },
|
|
730
|
+
* { to: '+15559876543', content: { type: 'text', text: 'Hi there!' } },
|
|
731
|
+
* ]
|
|
732
|
+
* });
|
|
733
|
+
* ```
|
|
734
|
+
*/
|
|
735
|
+
sendBatch(params: {
|
|
736
|
+
channelId: string;
|
|
737
|
+
messages: Array<{
|
|
738
|
+
to: string;
|
|
739
|
+
subject?: string;
|
|
740
|
+
content: SendMessageParams['content'];
|
|
741
|
+
metadata?: Record<string, unknown>;
|
|
742
|
+
}>;
|
|
743
|
+
}): Promise<SendMessageResult[]>;
|
|
744
|
+
}
|
|
745
|
+
|
|
746
|
+
/**
|
|
747
|
+
* Webhooks Resource
|
|
748
|
+
*/
|
|
749
|
+
|
|
750
|
+
declare class WebhooksResource {
|
|
751
|
+
private readonly http;
|
|
752
|
+
constructor(http: HttpClient);
|
|
753
|
+
/**
|
|
754
|
+
* List all webhooks
|
|
755
|
+
*/
|
|
756
|
+
list(): Promise<PaginatedResponse<Webhook>>;
|
|
757
|
+
/**
|
|
758
|
+
* Get a webhook by ID
|
|
759
|
+
*/
|
|
760
|
+
get(webhookId: string): Promise<Webhook>;
|
|
761
|
+
/**
|
|
762
|
+
* Create a new webhook
|
|
763
|
+
* @returns The created webhook and the signing secret (only returned once)
|
|
764
|
+
*/
|
|
765
|
+
create(params: CreateWebhookParams): Promise<{
|
|
766
|
+
webhook: Webhook;
|
|
767
|
+
secret: string;
|
|
768
|
+
}>;
|
|
769
|
+
/**
|
|
770
|
+
* Update a webhook
|
|
771
|
+
*/
|
|
772
|
+
update(webhookId: string, params: UpdateWebhookParams): Promise<Webhook>;
|
|
773
|
+
/**
|
|
774
|
+
* Delete a webhook
|
|
775
|
+
*/
|
|
776
|
+
delete(webhookId: string): Promise<void>;
|
|
777
|
+
/**
|
|
778
|
+
* Regenerate webhook signing secret
|
|
779
|
+
* @returns The new signing secret (only returned once)
|
|
780
|
+
*/
|
|
781
|
+
regenerateSecret(webhookId: string): Promise<{
|
|
782
|
+
webhook: Webhook;
|
|
783
|
+
secret: string;
|
|
784
|
+
}>;
|
|
785
|
+
/**
|
|
786
|
+
* List delivery history for a webhook
|
|
787
|
+
*/
|
|
788
|
+
deliveries(webhookId: string, options?: {
|
|
789
|
+
limit?: number;
|
|
790
|
+
cursor?: string;
|
|
791
|
+
}): Promise<PaginatedResponse<WebhookDelivery> & {
|
|
792
|
+
nextCursor?: string;
|
|
793
|
+
}>;
|
|
794
|
+
/**
|
|
795
|
+
* Get webhook delivery statistics
|
|
796
|
+
*/
|
|
797
|
+
stats(webhookId: string, options?: {
|
|
798
|
+
timeRange?: '1h' | '24h' | '7d';
|
|
799
|
+
}): Promise<WebhookStats>;
|
|
800
|
+
}
|
|
801
|
+
|
|
802
|
+
/**
|
|
803
|
+
* API Keys Resource
|
|
804
|
+
*/
|
|
805
|
+
|
|
806
|
+
declare class ApiKeysResource {
|
|
807
|
+
private readonly http;
|
|
808
|
+
constructor(http: HttpClient);
|
|
809
|
+
/**
|
|
810
|
+
* List all API keys
|
|
811
|
+
*/
|
|
812
|
+
list(): Promise<PaginatedResponse<ApiKey>>;
|
|
813
|
+
/**
|
|
814
|
+
* Get an API key by ID
|
|
815
|
+
*/
|
|
816
|
+
get(keyId: string): Promise<ApiKey>;
|
|
817
|
+
/**
|
|
818
|
+
* Create a new API key
|
|
819
|
+
* @returns The created API key and the plaintext key (only returned once)
|
|
820
|
+
*
|
|
821
|
+
* @example
|
|
822
|
+
* ```typescript
|
|
823
|
+
* const { apiKey, key } = await veroai.apiKeys.create({
|
|
824
|
+
* name: 'Production Key',
|
|
825
|
+
* environment: 'production',
|
|
826
|
+
* scopes: ['channels:read', 'channels:write', 'messages:send'],
|
|
827
|
+
* });
|
|
828
|
+
*
|
|
829
|
+
* // Save this key securely - it won't be shown again!
|
|
830
|
+
* console.log('API Key:', key); // sk_live_abc123...
|
|
831
|
+
* ```
|
|
832
|
+
*/
|
|
833
|
+
create(params: CreateApiKeyParams): Promise<CreateApiKeyResult>;
|
|
834
|
+
/**
|
|
835
|
+
* Delete (revoke) an API key
|
|
836
|
+
*/
|
|
837
|
+
delete(keyId: string): Promise<void>;
|
|
838
|
+
/**
|
|
839
|
+
* Alias for delete - revoke an API key
|
|
840
|
+
*/
|
|
841
|
+
revoke(keyId: string): Promise<void>;
|
|
842
|
+
}
|
|
843
|
+
|
|
844
|
+
/**
|
|
845
|
+
* Domains Resource
|
|
846
|
+
*/
|
|
847
|
+
|
|
848
|
+
declare class DomainsResource {
|
|
849
|
+
private readonly http;
|
|
850
|
+
constructor(http: HttpClient);
|
|
851
|
+
/**
|
|
852
|
+
* List all domains
|
|
853
|
+
*/
|
|
854
|
+
list(): Promise<PaginatedResponse<Domain>>;
|
|
855
|
+
/**
|
|
856
|
+
* Get a domain by ID
|
|
857
|
+
*/
|
|
858
|
+
get(domainId: string): Promise<Domain>;
|
|
859
|
+
/**
|
|
860
|
+
* Add a new domain
|
|
861
|
+
*
|
|
862
|
+
* @example
|
|
863
|
+
* ```typescript
|
|
864
|
+
* // Manual DNS verification
|
|
865
|
+
* const { domain } = await veroai.domains.create({
|
|
866
|
+
* domain: 'example.com',
|
|
867
|
+
* verificationMethod: 'manual',
|
|
868
|
+
* });
|
|
869
|
+
*
|
|
870
|
+
* // Automatic via Cloudflare
|
|
871
|
+
* const { domain } = await veroai.domains.create({
|
|
872
|
+
* domain: 'example.com',
|
|
873
|
+
* verificationMethod: 'cloudflare',
|
|
874
|
+
* cloudflareApiToken: 'your_cf_token',
|
|
875
|
+
* });
|
|
876
|
+
* ```
|
|
877
|
+
*/
|
|
878
|
+
create(params: CreateDomainParams): Promise<{
|
|
879
|
+
domain: Domain;
|
|
880
|
+
verificationRecord?: {
|
|
881
|
+
type: string;
|
|
882
|
+
name: string;
|
|
883
|
+
value: string;
|
|
884
|
+
};
|
|
885
|
+
}>;
|
|
886
|
+
/**
|
|
887
|
+
* Delete a domain
|
|
888
|
+
*/
|
|
889
|
+
delete(domainId: string): Promise<void>;
|
|
890
|
+
/**
|
|
891
|
+
* Verify domain DNS records
|
|
892
|
+
*/
|
|
893
|
+
verify(domainId: string): Promise<VerifyDomainResult>;
|
|
894
|
+
/**
|
|
895
|
+
* Get DNS records that need to be configured
|
|
896
|
+
*/
|
|
897
|
+
dnsRecords(domainId: string): Promise<Domain['dnsRecords']>;
|
|
898
|
+
}
|
|
899
|
+
|
|
900
|
+
/**
|
|
901
|
+
* Voice Numbers Resource
|
|
902
|
+
*
|
|
903
|
+
* Manages phone number operations for voice channels
|
|
904
|
+
*/
|
|
905
|
+
|
|
906
|
+
declare class VoiceNumbersResource {
|
|
907
|
+
private readonly http;
|
|
908
|
+
constructor(http: HttpClient);
|
|
909
|
+
/**
|
|
910
|
+
* Search for available phone numbers to purchase
|
|
911
|
+
*/
|
|
912
|
+
search(params: SearchNumbersParams): Promise<AvailableNumber[]>;
|
|
913
|
+
/**
|
|
914
|
+
* Purchase a phone number
|
|
915
|
+
*/
|
|
916
|
+
purchase(params: PurchaseNumberParams): Promise<PhoneNumber>;
|
|
917
|
+
/**
|
|
918
|
+
* List owned phone numbers
|
|
919
|
+
*/
|
|
920
|
+
list(params?: ListNumbersParams): Promise<PaginatedResponse<PhoneNumber>>;
|
|
921
|
+
/**
|
|
922
|
+
* Get a phone number by ID
|
|
923
|
+
*/
|
|
924
|
+
get(numberId: string): Promise<PhoneNumber>;
|
|
925
|
+
/**
|
|
926
|
+
* Update a phone number (assign/unassign to channel)
|
|
927
|
+
*/
|
|
928
|
+
update(numberId: string, params: UpdateNumberParams): Promise<PhoneNumber>;
|
|
929
|
+
/**
|
|
930
|
+
* Release a phone number
|
|
931
|
+
*/
|
|
932
|
+
release(numberId: string): Promise<void>;
|
|
933
|
+
/**
|
|
934
|
+
* Assign a phone number to a channel
|
|
935
|
+
*/
|
|
936
|
+
assignToChannel(numberId: string, channelId: string): Promise<PhoneNumber>;
|
|
937
|
+
/**
|
|
938
|
+
* Unassign a phone number from its channel
|
|
939
|
+
*/
|
|
940
|
+
unassignFromChannel(numberId: string): Promise<PhoneNumber>;
|
|
941
|
+
}
|
|
942
|
+
|
|
943
|
+
/**
|
|
944
|
+
* Voice Calls Resource
|
|
945
|
+
*
|
|
946
|
+
* Manages voice call operations
|
|
947
|
+
*/
|
|
948
|
+
|
|
949
|
+
declare class VoiceCallsResource {
|
|
950
|
+
private readonly http;
|
|
951
|
+
constructor(http: HttpClient);
|
|
952
|
+
/**
|
|
953
|
+
* Initiate an outbound call
|
|
954
|
+
*/
|
|
955
|
+
dial(params: DialParams): Promise<Call>;
|
|
956
|
+
/**
|
|
957
|
+
* List calls
|
|
958
|
+
*/
|
|
959
|
+
list(params?: ListCallsParams): Promise<PaginatedResponse<Call>>;
|
|
960
|
+
/**
|
|
961
|
+
* Get a call by ID
|
|
962
|
+
*/
|
|
963
|
+
get(callId: string): Promise<Call>;
|
|
964
|
+
/**
|
|
965
|
+
* Hang up an active call
|
|
966
|
+
*/
|
|
967
|
+
hangup(callId: string): Promise<void>;
|
|
968
|
+
}
|
|
969
|
+
|
|
970
|
+
/**
|
|
971
|
+
* Voice Rooms Resource
|
|
972
|
+
*
|
|
973
|
+
* LiveKit WebRTC room management for browser-based voice/video calls
|
|
974
|
+
*/
|
|
975
|
+
|
|
976
|
+
declare class VoiceRoomsResource {
|
|
977
|
+
private readonly http;
|
|
978
|
+
constructor(http: HttpClient);
|
|
979
|
+
/**
|
|
980
|
+
* Create a new WebRTC room
|
|
981
|
+
*
|
|
982
|
+
* @example
|
|
983
|
+
* ```typescript
|
|
984
|
+
* const roomInfo = await veroai.voice.rooms.create({
|
|
985
|
+
* name: 'support-call-123',
|
|
986
|
+
* emptyTimeout: 300,
|
|
987
|
+
* maxParticipants: 2,
|
|
988
|
+
* });
|
|
989
|
+
* // Connect to room using roomInfo.wsUrl and roomInfo.token
|
|
990
|
+
* ```
|
|
991
|
+
*/
|
|
992
|
+
create(params: CreateRoomParams): Promise<LiveKitRoomInfo>;
|
|
993
|
+
/**
|
|
994
|
+
* Join an existing room or create and join if it doesn't exist
|
|
995
|
+
*
|
|
996
|
+
* @example
|
|
997
|
+
* ```typescript
|
|
998
|
+
* const roomInfo = await veroai.voice.rooms.join({
|
|
999
|
+
* roomName: 'support-call-123',
|
|
1000
|
+
* participantName: 'Agent Smith',
|
|
1001
|
+
* });
|
|
1002
|
+
* // Use roomInfo.token to connect via LiveKit client SDK
|
|
1003
|
+
* ```
|
|
1004
|
+
*/
|
|
1005
|
+
join(params: JoinRoomParams): Promise<LiveKitRoomInfo>;
|
|
1006
|
+
/**
|
|
1007
|
+
* Get room details
|
|
1008
|
+
*
|
|
1009
|
+
* @example
|
|
1010
|
+
* ```typescript
|
|
1011
|
+
* const room = await veroai.voice.rooms.get('support-call-123');
|
|
1012
|
+
* console.log(`Room: ${room.name}`);
|
|
1013
|
+
* ```
|
|
1014
|
+
*/
|
|
1015
|
+
get(roomName: string): Promise<LiveKitRoom>;
|
|
1016
|
+
/**
|
|
1017
|
+
* List all active rooms
|
|
1018
|
+
*
|
|
1019
|
+
* @example
|
|
1020
|
+
* ```typescript
|
|
1021
|
+
* const rooms = await veroai.voice.rooms.list();
|
|
1022
|
+
* for (const room of rooms) {
|
|
1023
|
+
* console.log(`${room.name}`);
|
|
1024
|
+
* }
|
|
1025
|
+
* ```
|
|
1026
|
+
*/
|
|
1027
|
+
list(params?: ListRoomsParams): Promise<LiveKitRoom[]>;
|
|
1028
|
+
/**
|
|
1029
|
+
* Delete a room and disconnect all participants
|
|
1030
|
+
*
|
|
1031
|
+
* @example
|
|
1032
|
+
* ```typescript
|
|
1033
|
+
* await veroai.voice.rooms.delete('support-call-123');
|
|
1034
|
+
* ```
|
|
1035
|
+
*/
|
|
1036
|
+
delete(roomName: string): Promise<void>;
|
|
1037
|
+
/**
|
|
1038
|
+
* List participants in a room
|
|
1039
|
+
*
|
|
1040
|
+
* @example
|
|
1041
|
+
* ```typescript
|
|
1042
|
+
* const participants = await veroai.voice.rooms.listParticipants('support-call-123');
|
|
1043
|
+
* for (const p of participants) {
|
|
1044
|
+
* console.log(`${p.name} (${p.state})`);
|
|
1045
|
+
* }
|
|
1046
|
+
* ```
|
|
1047
|
+
*/
|
|
1048
|
+
listParticipants(roomName: string): Promise<LiveKitParticipant[]>;
|
|
1049
|
+
/**
|
|
1050
|
+
* Remove a participant from a room
|
|
1051
|
+
*
|
|
1052
|
+
* @example
|
|
1053
|
+
* ```typescript
|
|
1054
|
+
* await veroai.voice.rooms.removeParticipant('support-call-123', 'user-456');
|
|
1055
|
+
* ```
|
|
1056
|
+
*/
|
|
1057
|
+
removeParticipant(roomName: string, identity: string): Promise<void>;
|
|
1058
|
+
/**
|
|
1059
|
+
* Mute or unmute a participant's audio
|
|
1060
|
+
*
|
|
1061
|
+
* @example
|
|
1062
|
+
* ```typescript
|
|
1063
|
+
* // Mute participant
|
|
1064
|
+
* await veroai.voice.rooms.muteParticipant('support-call-123', 'user-456', true);
|
|
1065
|
+
*
|
|
1066
|
+
* // Unmute participant
|
|
1067
|
+
* await veroai.voice.rooms.muteParticipant('support-call-123', 'user-456', false);
|
|
1068
|
+
* ```
|
|
1069
|
+
*/
|
|
1070
|
+
muteParticipant(roomName: string, identity: string, muted: boolean): Promise<void>;
|
|
1071
|
+
/**
|
|
1072
|
+
* Send a data message to participants in a room
|
|
1073
|
+
*
|
|
1074
|
+
* @example
|
|
1075
|
+
* ```typescript
|
|
1076
|
+
* // Send to all participants
|
|
1077
|
+
* await veroai.voice.rooms.sendData('support-call-123', { type: 'notification', message: 'Recording started' });
|
|
1078
|
+
*
|
|
1079
|
+
* // Send to specific participants
|
|
1080
|
+
* await veroai.voice.rooms.sendData('support-call-123', { type: 'private' }, ['user-456']);
|
|
1081
|
+
* ```
|
|
1082
|
+
*/
|
|
1083
|
+
sendData(roomName: string, data: Record<string, unknown>, destinationIdentities?: string[]): Promise<void>;
|
|
1084
|
+
}
|
|
1085
|
+
|
|
1086
|
+
/**
|
|
1087
|
+
* Voice Resource
|
|
1088
|
+
*
|
|
1089
|
+
* Combines voice numbers, calls, and rooms resources
|
|
1090
|
+
*/
|
|
1091
|
+
|
|
1092
|
+
declare class VoiceResource {
|
|
1093
|
+
/**
|
|
1094
|
+
* Phone number management
|
|
1095
|
+
*/
|
|
1096
|
+
readonly numbers: VoiceNumbersResource;
|
|
1097
|
+
/**
|
|
1098
|
+
* Call management
|
|
1099
|
+
*/
|
|
1100
|
+
readonly calls: VoiceCallsResource;
|
|
1101
|
+
/**
|
|
1102
|
+
* LiveKit WebRTC room management for browser-based voice/video calls
|
|
1103
|
+
*/
|
|
1104
|
+
readonly rooms: VoiceRoomsResource;
|
|
1105
|
+
constructor(http: HttpClient);
|
|
1106
|
+
}
|
|
1107
|
+
|
|
1108
|
+
/**
|
|
1109
|
+
* Agents Resource
|
|
1110
|
+
*
|
|
1111
|
+
* Manage AI agent configurations for voice and messaging
|
|
1112
|
+
*/
|
|
1113
|
+
|
|
1114
|
+
declare class AgentsResource {
|
|
1115
|
+
private readonly http;
|
|
1116
|
+
constructor(http: HttpClient);
|
|
1117
|
+
/**
|
|
1118
|
+
* List AI agents
|
|
1119
|
+
*
|
|
1120
|
+
* @example
|
|
1121
|
+
* ```typescript
|
|
1122
|
+
* const agents = await veroai.agents.list({ status: 'active' });
|
|
1123
|
+
* for (const agent of agents.data) {
|
|
1124
|
+
* console.log(`${agent.name} (${agent.modelConfig.provider})`);
|
|
1125
|
+
* }
|
|
1126
|
+
* ```
|
|
1127
|
+
*/
|
|
1128
|
+
list(params?: ListAgentsParams): Promise<PaginatedResponse<AgentConfig>>;
|
|
1129
|
+
/**
|
|
1130
|
+
* Get an agent by ID
|
|
1131
|
+
*
|
|
1132
|
+
* @example
|
|
1133
|
+
* ```typescript
|
|
1134
|
+
* const agent = await veroai.agents.get('agent_123');
|
|
1135
|
+
* console.log(`System prompt: ${agent.systemPrompt}`);
|
|
1136
|
+
* ```
|
|
1137
|
+
*/
|
|
1138
|
+
get(agentId: string): Promise<AgentConfig>;
|
|
1139
|
+
/**
|
|
1140
|
+
* Create a new AI agent
|
|
1141
|
+
*
|
|
1142
|
+
* @example
|
|
1143
|
+
* ```typescript
|
|
1144
|
+
* const agent = await veroai.agents.create({
|
|
1145
|
+
* name: 'Support Agent',
|
|
1146
|
+
* modelConfig: {
|
|
1147
|
+
* provider: 'anthropic',
|
|
1148
|
+
* modelId: 'claude-3-5-sonnet-20241022',
|
|
1149
|
+
* temperature: 0.7,
|
|
1150
|
+
* },
|
|
1151
|
+
* systemPrompt: 'You are a helpful support agent...',
|
|
1152
|
+
* enabled: true,
|
|
1153
|
+
* });
|
|
1154
|
+
* ```
|
|
1155
|
+
*/
|
|
1156
|
+
create(params: CreateAgentParams): Promise<AgentConfig>;
|
|
1157
|
+
/**
|
|
1158
|
+
* Update an agent
|
|
1159
|
+
*
|
|
1160
|
+
* @example
|
|
1161
|
+
* ```typescript
|
|
1162
|
+
* const agent = await veroai.agents.update('agent_123', {
|
|
1163
|
+
* systemPrompt: 'Updated prompt...',
|
|
1164
|
+
* enabled: true,
|
|
1165
|
+
* });
|
|
1166
|
+
* ```
|
|
1167
|
+
*/
|
|
1168
|
+
update(agentId: string, params: UpdateAgentParams): Promise<AgentConfig>;
|
|
1169
|
+
/**
|
|
1170
|
+
* Delete an agent
|
|
1171
|
+
*
|
|
1172
|
+
* @example
|
|
1173
|
+
* ```typescript
|
|
1174
|
+
* await veroai.agents.delete('agent_123');
|
|
1175
|
+
* ```
|
|
1176
|
+
*/
|
|
1177
|
+
delete(agentId: string): Promise<void>;
|
|
1178
|
+
/**
|
|
1179
|
+
* Enable an agent
|
|
1180
|
+
*
|
|
1181
|
+
* @example
|
|
1182
|
+
* ```typescript
|
|
1183
|
+
* const agent = await veroai.agents.enable('agent_123');
|
|
1184
|
+
* ```
|
|
1185
|
+
*/
|
|
1186
|
+
enable(agentId: string): Promise<AgentConfig>;
|
|
1187
|
+
/**
|
|
1188
|
+
* Disable an agent
|
|
1189
|
+
*
|
|
1190
|
+
* @example
|
|
1191
|
+
* ```typescript
|
|
1192
|
+
* const agent = await veroai.agents.disable('agent_123');
|
|
1193
|
+
* ```
|
|
1194
|
+
*/
|
|
1195
|
+
disable(agentId: string): Promise<AgentConfig>;
|
|
1196
|
+
}
|
|
1197
|
+
|
|
1198
|
+
/**
|
|
1199
|
+
* Realtime Types
|
|
1200
|
+
*
|
|
1201
|
+
* Types for WebSocket real-time event subscriptions
|
|
1202
|
+
*/
|
|
1203
|
+
/**
|
|
1204
|
+
* Subscription type
|
|
1205
|
+
*/
|
|
1206
|
+
type SubscriptionType = 'event_type' | 'channel' | 'all';
|
|
1207
|
+
/**
|
|
1208
|
+
* Subscription options
|
|
1209
|
+
*/
|
|
1210
|
+
interface SubscribeOptions {
|
|
1211
|
+
/** Subscribe to specific event types */
|
|
1212
|
+
eventTypes?: string[];
|
|
1213
|
+
/** Subscribe to specific channel IDs */
|
|
1214
|
+
channels?: string[];
|
|
1215
|
+
}
|
|
1216
|
+
/**
|
|
1217
|
+
* Realtime connection state
|
|
1218
|
+
*/
|
|
1219
|
+
type ConnectionState = 'disconnected' | 'connecting' | 'connected' | 'reconnecting';
|
|
1220
|
+
/**
|
|
1221
|
+
* Subscription confirmation from server
|
|
1222
|
+
*/
|
|
1223
|
+
interface SubscriptionConfirmation {
|
|
1224
|
+
type: 'subscription_confirmed' | 'subscription_error';
|
|
1225
|
+
/** The action that was confirmed (matches the 'type' field from the command) */
|
|
1226
|
+
action: 'subscribe' | 'unsubscribe';
|
|
1227
|
+
subscriptionType: SubscriptionType;
|
|
1228
|
+
items: string[];
|
|
1229
|
+
error?: string;
|
|
1230
|
+
}
|
|
1231
|
+
/**
|
|
1232
|
+
* Real-time event received from WebSocket
|
|
1233
|
+
*/
|
|
1234
|
+
interface RealtimeEvent {
|
|
1235
|
+
/** Event ID */
|
|
1236
|
+
id: string;
|
|
1237
|
+
/** Tenant ID */
|
|
1238
|
+
tenantId: string;
|
|
1239
|
+
/** Channel ID */
|
|
1240
|
+
channelId: string;
|
|
1241
|
+
/** Canonical event type */
|
|
1242
|
+
canonicalType: string;
|
|
1243
|
+
/** Original event type from adapter */
|
|
1244
|
+
eventType: string;
|
|
1245
|
+
/** Event direction */
|
|
1246
|
+
direction: 'inbound' | 'outbound';
|
|
1247
|
+
/** Event payload */
|
|
1248
|
+
payload: Record<string, unknown>;
|
|
1249
|
+
/** Enrichment data (if available) */
|
|
1250
|
+
enrichment?: {
|
|
1251
|
+
intent?: {
|
|
1252
|
+
intent: string;
|
|
1253
|
+
confidence: number;
|
|
1254
|
+
};
|
|
1255
|
+
sentiment?: {
|
|
1256
|
+
sentiment: string;
|
|
1257
|
+
score: number;
|
|
1258
|
+
};
|
|
1259
|
+
language?: {
|
|
1260
|
+
code: string;
|
|
1261
|
+
confidence: number;
|
|
1262
|
+
};
|
|
1263
|
+
entities?: Array<{
|
|
1264
|
+
type: string;
|
|
1265
|
+
value: string;
|
|
1266
|
+
confidence: number;
|
|
1267
|
+
}>;
|
|
1268
|
+
};
|
|
1269
|
+
/** Event timestamp */
|
|
1270
|
+
timestamp: string;
|
|
1271
|
+
/** Processing timestamp */
|
|
1272
|
+
processedAt: string;
|
|
1273
|
+
}
|
|
1274
|
+
/**
|
|
1275
|
+
* Event handler function
|
|
1276
|
+
*/
|
|
1277
|
+
type EventHandler = (event: RealtimeEvent) => void;
|
|
1278
|
+
/**
|
|
1279
|
+
* Connection state change handler
|
|
1280
|
+
*/
|
|
1281
|
+
type StateChangeHandler = (state: ConnectionState) => void;
|
|
1282
|
+
/**
|
|
1283
|
+
* Error handler
|
|
1284
|
+
*/
|
|
1285
|
+
type ErrorHandler = (error: Error) => void;
|
|
1286
|
+
/**
|
|
1287
|
+
* Realtime configuration options
|
|
1288
|
+
*/
|
|
1289
|
+
interface RealtimeConfig {
|
|
1290
|
+
/** WebSocket URL (default: wss://realtime.veroai.dev/ws) */
|
|
1291
|
+
url?: string;
|
|
1292
|
+
/** Auto-reconnect on disconnect (default: true) */
|
|
1293
|
+
autoReconnect?: boolean;
|
|
1294
|
+
/** Reconnect interval in ms (default: 1000, max: 30000) */
|
|
1295
|
+
reconnectInterval?: number;
|
|
1296
|
+
/** Max reconnection attempts (default: 10, 0 for infinite) */
|
|
1297
|
+
maxReconnectAttempts?: number;
|
|
1298
|
+
/** Heartbeat interval in ms (default: 30000) */
|
|
1299
|
+
heartbeatInterval?: number;
|
|
1300
|
+
}
|
|
1301
|
+
/**
|
|
1302
|
+
* Token fetcher function type
|
|
1303
|
+
* Used to get a short-lived WebSocket token from the API
|
|
1304
|
+
*/
|
|
1305
|
+
type TokenFetcher = () => Promise<string>;
|
|
1306
|
+
|
|
1307
|
+
/**
|
|
1308
|
+
* Realtime Resource
|
|
1309
|
+
*
|
|
1310
|
+
* WebSocket-based real-time event subscription for the VeroAI SDK.
|
|
1311
|
+
* Supports subscribing to channels, event types, or all events.
|
|
1312
|
+
*/
|
|
1313
|
+
|
|
1314
|
+
declare class RealtimeResource {
|
|
1315
|
+
private readonly config;
|
|
1316
|
+
private readonly tokenFetcher;
|
|
1317
|
+
private ws;
|
|
1318
|
+
private state;
|
|
1319
|
+
private reconnectAttempts;
|
|
1320
|
+
private reconnectTimeout;
|
|
1321
|
+
private heartbeatInterval;
|
|
1322
|
+
private eventHandlers;
|
|
1323
|
+
private stateHandlers;
|
|
1324
|
+
private errorHandlers;
|
|
1325
|
+
private activeSubscriptions;
|
|
1326
|
+
private pendingSubscriptions;
|
|
1327
|
+
constructor(tokenFetcher: TokenFetcher, config?: RealtimeConfig);
|
|
1328
|
+
/**
|
|
1329
|
+
* Get current connection state
|
|
1330
|
+
*/
|
|
1331
|
+
getState(): ConnectionState;
|
|
1332
|
+
/**
|
|
1333
|
+
* Connect to the WebSocket server
|
|
1334
|
+
*/
|
|
1335
|
+
connect(): Promise<void>;
|
|
1336
|
+
/**
|
|
1337
|
+
* Disconnect from the WebSocket server
|
|
1338
|
+
*/
|
|
1339
|
+
disconnect(): void;
|
|
1340
|
+
/**
|
|
1341
|
+
* Subscribe to all events for the tenant
|
|
1342
|
+
*/
|
|
1343
|
+
subscribeAll(): Promise<SubscriptionConfirmation>;
|
|
1344
|
+
/**
|
|
1345
|
+
* Unsubscribe from all events
|
|
1346
|
+
*/
|
|
1347
|
+
unsubscribeAll(): Promise<SubscriptionConfirmation>;
|
|
1348
|
+
/**
|
|
1349
|
+
* Subscribe to specific channels
|
|
1350
|
+
*/
|
|
1351
|
+
subscribeChannels(channelIds: string[]): Promise<SubscriptionConfirmation>;
|
|
1352
|
+
/**
|
|
1353
|
+
* Unsubscribe from specific channels
|
|
1354
|
+
*/
|
|
1355
|
+
unsubscribeChannels(channelIds: string[]): Promise<SubscriptionConfirmation>;
|
|
1356
|
+
/**
|
|
1357
|
+
* Subscribe to specific event types
|
|
1358
|
+
*/
|
|
1359
|
+
subscribeEventTypes(eventTypes: string[]): Promise<SubscriptionConfirmation>;
|
|
1360
|
+
/**
|
|
1361
|
+
* Unsubscribe from specific event types
|
|
1362
|
+
*/
|
|
1363
|
+
unsubscribeEventTypes(eventTypes: string[]): Promise<SubscriptionConfirmation>;
|
|
1364
|
+
/**
|
|
1365
|
+
* Subscribe to channels and/or event types
|
|
1366
|
+
*/
|
|
1367
|
+
subscribe(options: SubscribeOptions): Promise<void>;
|
|
1368
|
+
/**
|
|
1369
|
+
* Unsubscribe from channels and/or event types
|
|
1370
|
+
*/
|
|
1371
|
+
unsubscribe(options: SubscribeOptions): Promise<void>;
|
|
1372
|
+
/**
|
|
1373
|
+
* Add event handler
|
|
1374
|
+
*/
|
|
1375
|
+
onEvent(handler: EventHandler): () => void;
|
|
1376
|
+
/**
|
|
1377
|
+
* Add connection state change handler
|
|
1378
|
+
*/
|
|
1379
|
+
onStateChange(handler: StateChangeHandler): () => void;
|
|
1380
|
+
/**
|
|
1381
|
+
* Add error handler
|
|
1382
|
+
*/
|
|
1383
|
+
onError(handler: ErrorHandler): () => void;
|
|
1384
|
+
/**
|
|
1385
|
+
* Remove all handlers
|
|
1386
|
+
*/
|
|
1387
|
+
removeAllHandlers(): void;
|
|
1388
|
+
private setState;
|
|
1389
|
+
private emitError;
|
|
1390
|
+
private emitEvent;
|
|
1391
|
+
private handleMessage;
|
|
1392
|
+
private sendSubscription;
|
|
1393
|
+
private getSubscriptionKey;
|
|
1394
|
+
private shouldReconnect;
|
|
1395
|
+
private scheduleReconnect;
|
|
1396
|
+
private clearReconnectTimeout;
|
|
1397
|
+
private resubscribe;
|
|
1398
|
+
private startHeartbeat;
|
|
1399
|
+
private stopHeartbeat;
|
|
1400
|
+
}
|
|
1401
|
+
/**
|
|
1402
|
+
* Factory function to create a realtime resource
|
|
1403
|
+
*/
|
|
1404
|
+
declare function createRealtimeResource(tokenFetcher: TokenFetcher, config?: RealtimeConfig): RealtimeResource;
|
|
1405
|
+
|
|
1406
|
+
/**
|
|
1407
|
+
* VeroAI SDK Client
|
|
1408
|
+
*
|
|
1409
|
+
* The main entry point for interacting with the VeroAI API.
|
|
1410
|
+
*
|
|
1411
|
+
* @example
|
|
1412
|
+
* ```typescript
|
|
1413
|
+
* import { VeroAI } from '@veroai/sdk';
|
|
1414
|
+
*
|
|
1415
|
+
* const veroai = new VeroAI({ apiKey: 'sk_live_...' });
|
|
1416
|
+
*
|
|
1417
|
+
* // List channels
|
|
1418
|
+
* const { data: channels } = await veroai.channels.list();
|
|
1419
|
+
*
|
|
1420
|
+
* // Send a message
|
|
1421
|
+
* const result = await veroai.messages.send({
|
|
1422
|
+
* channelId: 'ch_abc123',
|
|
1423
|
+
* to: '+15551234567',
|
|
1424
|
+
* content: { type: 'text', text: 'Hello from VeroAI!' }
|
|
1425
|
+
* });
|
|
1426
|
+
*
|
|
1427
|
+
* // Query events
|
|
1428
|
+
* const { data: events } = await veroai.events.list({
|
|
1429
|
+
* channelId: 'ch_abc123',
|
|
1430
|
+
* startDate: new Date('2024-01-01'),
|
|
1431
|
+
* });
|
|
1432
|
+
* ```
|
|
1433
|
+
*/
|
|
1434
|
+
|
|
1435
|
+
declare class VeroAI {
|
|
1436
|
+
private readonly http;
|
|
1437
|
+
/** Manage communication channels (email, SMS, WhatsApp, etc.) */
|
|
1438
|
+
readonly channels: ChannelsResource;
|
|
1439
|
+
/** Query activity events and analytics */
|
|
1440
|
+
readonly events: EventsResource;
|
|
1441
|
+
/** Send messages through channels */
|
|
1442
|
+
readonly messages: MessagesResource;
|
|
1443
|
+
/** Manage webhook endpoints for real-time notifications */
|
|
1444
|
+
readonly webhooks: WebhooksResource;
|
|
1445
|
+
/** Manage API keys for authentication */
|
|
1446
|
+
readonly apiKeys: ApiKeysResource;
|
|
1447
|
+
/** Manage email domains for sending */
|
|
1448
|
+
readonly domains: DomainsResource;
|
|
1449
|
+
/** Voice phone numbers and call management */
|
|
1450
|
+
readonly voice: VoiceResource;
|
|
1451
|
+
/** AI agent configurations */
|
|
1452
|
+
readonly agents: AgentsResource;
|
|
1453
|
+
/** Real-time event subscriptions via WebSocket */
|
|
1454
|
+
readonly realtime: RealtimeResource;
|
|
1455
|
+
/**
|
|
1456
|
+
* Create a new VeroAI client instance
|
|
1457
|
+
*
|
|
1458
|
+
* @param config - Configuration options
|
|
1459
|
+
* @param config.apiKey - Your API key (required)
|
|
1460
|
+
* @param config.baseUrl - Custom API base URL (optional)
|
|
1461
|
+
* @param config.timeout - Request timeout in ms (default: 30000)
|
|
1462
|
+
* @param config.maxRetries - Max retry attempts (default: 3)
|
|
1463
|
+
* @param config.realtime - Realtime WebSocket configuration
|
|
1464
|
+
*
|
|
1465
|
+
* @example
|
|
1466
|
+
* ```typescript
|
|
1467
|
+
* // Basic usage
|
|
1468
|
+
* const veroai = new VeroAI({ apiKey: 'sk_live_...' });
|
|
1469
|
+
*
|
|
1470
|
+
* // With custom options
|
|
1471
|
+
* const veroai = new VeroAI({
|
|
1472
|
+
* apiKey: 'sk_test_...',
|
|
1473
|
+
* baseUrl: 'https://api.staging.veroai.dev',
|
|
1474
|
+
* timeout: 60000,
|
|
1475
|
+
* maxRetries: 5,
|
|
1476
|
+
* });
|
|
1477
|
+
* ```
|
|
1478
|
+
*/
|
|
1479
|
+
constructor(config: VeroAIConfig & {
|
|
1480
|
+
realtime?: RealtimeConfig;
|
|
1481
|
+
});
|
|
1482
|
+
/**
|
|
1483
|
+
* Create a client from environment variables
|
|
1484
|
+
*
|
|
1485
|
+
* Looks for VEROAI_API_KEY environment variable
|
|
1486
|
+
*
|
|
1487
|
+
* @example
|
|
1488
|
+
* ```typescript
|
|
1489
|
+
* // Reads VEROAI_API_KEY from environment
|
|
1490
|
+
* const veroai = VeroAI.fromEnv();
|
|
1491
|
+
* ```
|
|
1492
|
+
*/
|
|
1493
|
+
static fromEnv(overrides?: Partial<VeroAIConfig & {
|
|
1494
|
+
realtime?: RealtimeConfig;
|
|
1495
|
+
}>): VeroAI;
|
|
1496
|
+
}
|
|
1497
|
+
|
|
1498
|
+
/**
|
|
1499
|
+
* VeroAI SDK Error Classes
|
|
1500
|
+
*/
|
|
1501
|
+
|
|
1502
|
+
/**
|
|
1503
|
+
* Base error class for all VeroAI SDK errors
|
|
1504
|
+
*/
|
|
1505
|
+
declare class VeroAIError extends Error {
|
|
1506
|
+
readonly code: string;
|
|
1507
|
+
readonly details?: Record<string, unknown>;
|
|
1508
|
+
readonly statusCode?: number;
|
|
1509
|
+
constructor(message: string, code?: string, statusCode?: number, details?: Record<string, unknown>);
|
|
1510
|
+
toJSON(): VeroAIErrorDetails;
|
|
1511
|
+
}
|
|
1512
|
+
/**
|
|
1513
|
+
* Thrown when the API returns an error response
|
|
1514
|
+
*/
|
|
1515
|
+
declare class APIError extends VeroAIError {
|
|
1516
|
+
readonly response?: Response;
|
|
1517
|
+
constructor(message: string, code: string, statusCode: number, details?: Record<string, unknown>, response?: Response);
|
|
1518
|
+
}
|
|
1519
|
+
/**
|
|
1520
|
+
* Thrown when authentication fails (401)
|
|
1521
|
+
*/
|
|
1522
|
+
declare class AuthenticationError extends APIError {
|
|
1523
|
+
constructor(message?: string, details?: Record<string, unknown>);
|
|
1524
|
+
}
|
|
1525
|
+
/**
|
|
1526
|
+
* Thrown when authorization fails (403)
|
|
1527
|
+
*/
|
|
1528
|
+
declare class AuthorizationError extends APIError {
|
|
1529
|
+
constructor(message?: string, details?: Record<string, unknown>);
|
|
1530
|
+
}
|
|
1531
|
+
/**
|
|
1532
|
+
* Thrown when a resource is not found (404)
|
|
1533
|
+
*/
|
|
1534
|
+
declare class NotFoundError extends APIError {
|
|
1535
|
+
constructor(message?: string, details?: Record<string, unknown>);
|
|
1536
|
+
}
|
|
1537
|
+
/**
|
|
1538
|
+
* Thrown when request validation fails (400)
|
|
1539
|
+
*/
|
|
1540
|
+
declare class ValidationError extends APIError {
|
|
1541
|
+
constructor(message?: string, details?: Record<string, unknown>);
|
|
1542
|
+
}
|
|
1543
|
+
/**
|
|
1544
|
+
* Thrown when rate limit is exceeded (429)
|
|
1545
|
+
*/
|
|
1546
|
+
declare class RateLimitError extends APIError {
|
|
1547
|
+
readonly retryAfter?: number;
|
|
1548
|
+
constructor(message?: string, retryAfter?: number, details?: Record<string, unknown>);
|
|
1549
|
+
}
|
|
1550
|
+
/**
|
|
1551
|
+
* Thrown when the server returns an error (5xx)
|
|
1552
|
+
*/
|
|
1553
|
+
declare class ServerError extends APIError {
|
|
1554
|
+
constructor(message?: string, statusCode?: number, details?: Record<string, unknown>);
|
|
1555
|
+
}
|
|
1556
|
+
/**
|
|
1557
|
+
* Thrown when a request times out
|
|
1558
|
+
*/
|
|
1559
|
+
declare class TimeoutError extends VeroAIError {
|
|
1560
|
+
constructor(message?: string);
|
|
1561
|
+
}
|
|
1562
|
+
/**
|
|
1563
|
+
* Thrown when there's a network connectivity issue
|
|
1564
|
+
*/
|
|
1565
|
+
declare class NetworkError extends VeroAIError {
|
|
1566
|
+
constructor(message?: string, cause?: Error);
|
|
1567
|
+
}
|
|
1568
|
+
|
|
1569
|
+
export { APIError, type ActivityEvent, type AdapterType, type ApiKey, type ApiKeyEnvironment, AuthenticationError, AuthorizationError, type AvailableNumber, type Call, type CallDirection, type CallEndReason, type CallStatus, type CanonicalType, type Channel, type ChannelDirection, type ChannelHealth, type ChannelOverride, type ChannelStatus, type ConnectionState, type CreateApiKeyParams, type CreateApiKeyResult, type CreateChannelParams, type CreateDomainParams, type CreateVoiceChannelParams, type CreateWebhookParams, type DateRangeParams, type DialParams, type DnsRecord, type Domain, type DomainStatus, type EnrichmentConfig, type EnrichmentResult, type EntityDefinition, type ErrorHandler, type EventDirection, type EventHandler, type EventStats, type ExtractedEntity, type InboundConfig, type InboundHandler, type IntentDefinition, type LanguageConfig, type ListCallsParams, type ListEventsParams, type ListNumbersParams, NetworkError, NotFoundError, type PaginatedResponse, type PaginationParams, type PhoneNumber, type PhoneNumberCapability, type PhoneNumberStatus, type PurchaseNumberParams, RateLimitError, type RealtimeConfig, type RealtimeEvent, RealtimeResource, type RecordingConfig, type RetryConfig, type SearchNumbersParams, type SendMessageParams, type SendMessageResult, type SentimentConfig, ServerError, type StateChangeHandler, type SttConfig, type SubscribeOptions, type SubscriptionType, type TimeSeriesDataPoint, type TimeSeriesGranularity, TimeoutError, type TtsConfig, type UpdateChannelParams, type UpdateNumberParams, type UpdateVoiceChannelParams, type UpdateWebhookParams, ValidationError, type VerifyDomainResult, VeroAI, type VeroAIConfig, VeroAIError, type VeroAIErrorDetails, VoiceCallsResource, type VoiceChannelConfig, VoiceNumbersResource, VoiceResource, type Webhook, type WebhookDelivery, type WebhookStats, type WebhookStatus, createRealtimeResource, VeroAI as default };
|