@burki.dev/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 +476 -0
- package/dist/index.d.mts +1616 -0
- package/dist/index.d.ts +1616 -0
- package/dist/index.js +1552 -0
- package/dist/index.mjs +1507 -0
- package/package.json +59 -0
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,1616 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Authentication module for Burki SDK.
|
|
3
|
+
*/
|
|
4
|
+
declare class BurkiAuth {
|
|
5
|
+
private apiKey;
|
|
6
|
+
constructor(apiKey: string);
|
|
7
|
+
/**
|
|
8
|
+
* Get authentication headers for API requests.
|
|
9
|
+
*/
|
|
10
|
+
get headers(): Record<string, string>;
|
|
11
|
+
/**
|
|
12
|
+
* Get the token for WebSocket authentication.
|
|
13
|
+
*/
|
|
14
|
+
getWebSocketToken(): string;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* HTTP client module for Burki SDK.
|
|
19
|
+
*/
|
|
20
|
+
|
|
21
|
+
interface HTTPClientOptions {
|
|
22
|
+
auth: BurkiAuth;
|
|
23
|
+
baseUrl?: string;
|
|
24
|
+
timeout?: number;
|
|
25
|
+
}
|
|
26
|
+
declare class HTTPClient {
|
|
27
|
+
private auth;
|
|
28
|
+
private baseUrl;
|
|
29
|
+
private timeout;
|
|
30
|
+
constructor(options: HTTPClientOptions);
|
|
31
|
+
private handleResponse;
|
|
32
|
+
private buildUrl;
|
|
33
|
+
request<T>(method: string, path: string, options?: {
|
|
34
|
+
params?: Record<string, unknown>;
|
|
35
|
+
body?: unknown;
|
|
36
|
+
headers?: Record<string, string>;
|
|
37
|
+
}): Promise<T>;
|
|
38
|
+
get<T>(path: string, params?: Record<string, unknown>): Promise<T>;
|
|
39
|
+
post<T>(path: string, body?: unknown, params?: Record<string, unknown>): Promise<T>;
|
|
40
|
+
put<T>(path: string, body?: unknown, params?: Record<string, unknown>): Promise<T>;
|
|
41
|
+
patch<T>(path: string, body?: unknown, params?: Record<string, unknown>): Promise<T>;
|
|
42
|
+
delete<T>(path: string, params?: Record<string, unknown>): Promise<T>;
|
|
43
|
+
uploadFile<T>(path: string, file: File | Blob, filename: string, additionalData?: Record<string, string>): Promise<T>;
|
|
44
|
+
/**
|
|
45
|
+
* Get the base URL for constructing external URLs.
|
|
46
|
+
*/
|
|
47
|
+
get baseUrlValue(): string;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* Base resource class for Burki SDK.
|
|
52
|
+
*/
|
|
53
|
+
|
|
54
|
+
declare class BaseResource {
|
|
55
|
+
protected http: HTTPClient;
|
|
56
|
+
constructor(httpClient: HTTPClient);
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* Assistant models for the Burki SDK.
|
|
61
|
+
*/
|
|
62
|
+
interface LLMProviderConfig {
|
|
63
|
+
apiKey?: string;
|
|
64
|
+
baseUrl?: string;
|
|
65
|
+
model?: string;
|
|
66
|
+
customConfig?: Record<string, unknown>;
|
|
67
|
+
}
|
|
68
|
+
interface LLMSettings {
|
|
69
|
+
temperature?: number;
|
|
70
|
+
maxTokens?: number;
|
|
71
|
+
systemPrompt?: string;
|
|
72
|
+
welcomeMessage?: string;
|
|
73
|
+
topP?: number;
|
|
74
|
+
frequencyPenalty?: number;
|
|
75
|
+
presencePenalty?: number;
|
|
76
|
+
stopSequences?: string[];
|
|
77
|
+
}
|
|
78
|
+
interface BackgroundSoundSettings {
|
|
79
|
+
enabled?: boolean;
|
|
80
|
+
storageKey?: string;
|
|
81
|
+
soundUrl?: string;
|
|
82
|
+
volume?: number;
|
|
83
|
+
loop?: boolean;
|
|
84
|
+
}
|
|
85
|
+
interface TTSSettings {
|
|
86
|
+
provider?: string;
|
|
87
|
+
voiceId?: string;
|
|
88
|
+
modelId?: string;
|
|
89
|
+
latency?: number;
|
|
90
|
+
stability?: number;
|
|
91
|
+
similarityBoost?: number;
|
|
92
|
+
style?: number;
|
|
93
|
+
useSpeakerBoost?: boolean;
|
|
94
|
+
providerConfig?: Record<string, unknown>;
|
|
95
|
+
backgroundSound?: BackgroundSoundSettings;
|
|
96
|
+
}
|
|
97
|
+
interface STTEndpointingSettings {
|
|
98
|
+
silenceThreshold?: number;
|
|
99
|
+
minSilenceDuration?: number;
|
|
100
|
+
}
|
|
101
|
+
interface Keyword {
|
|
102
|
+
keyword: string;
|
|
103
|
+
intensifier?: number;
|
|
104
|
+
}
|
|
105
|
+
/**
|
|
106
|
+
* Configuration for Deepgram Flux models (AI-powered turn detection).
|
|
107
|
+
*/
|
|
108
|
+
interface FluxConfig {
|
|
109
|
+
eotTimeoutMs?: number;
|
|
110
|
+
eagerEotThreshold?: number;
|
|
111
|
+
eotThreshold?: number;
|
|
112
|
+
tag?: string;
|
|
113
|
+
mipOptOut?: boolean;
|
|
114
|
+
}
|
|
115
|
+
interface STTSettings {
|
|
116
|
+
provider?: string;
|
|
117
|
+
model?: string;
|
|
118
|
+
language?: string;
|
|
119
|
+
punctuate?: boolean;
|
|
120
|
+
interimResults?: boolean;
|
|
121
|
+
endpointing?: STTEndpointingSettings;
|
|
122
|
+
utteranceEndMs?: number;
|
|
123
|
+
vadTurnoff?: number;
|
|
124
|
+
smartFormat?: boolean;
|
|
125
|
+
keywords?: Keyword[];
|
|
126
|
+
keyterms?: string[];
|
|
127
|
+
audioDenoising?: boolean;
|
|
128
|
+
fluxConfig?: FluxConfig;
|
|
129
|
+
providerConfig?: Record<string, unknown>;
|
|
130
|
+
}
|
|
131
|
+
interface EndCallTool {
|
|
132
|
+
enabled?: boolean;
|
|
133
|
+
scenarios?: string[];
|
|
134
|
+
customMessage?: string;
|
|
135
|
+
}
|
|
136
|
+
interface TransferCallTool {
|
|
137
|
+
enabled?: boolean;
|
|
138
|
+
scenarios?: string[];
|
|
139
|
+
transferNumbers?: string[];
|
|
140
|
+
customMessage?: string;
|
|
141
|
+
}
|
|
142
|
+
/**
|
|
143
|
+
* Configuration for the DTMF solver tool - allows AI to send DTMF tones.
|
|
144
|
+
*/
|
|
145
|
+
interface DtmfSolverTool {
|
|
146
|
+
enabled?: boolean;
|
|
147
|
+
scenarios?: string[];
|
|
148
|
+
}
|
|
149
|
+
interface ToolsSettings {
|
|
150
|
+
enabledTools?: string[];
|
|
151
|
+
endCall?: EndCallTool;
|
|
152
|
+
transferCall?: TransferCallTool;
|
|
153
|
+
dtmfSolver?: DtmfSolverTool;
|
|
154
|
+
customTools?: Record<string, unknown>[];
|
|
155
|
+
}
|
|
156
|
+
interface RAGSettings {
|
|
157
|
+
enabled?: boolean;
|
|
158
|
+
searchLimit?: number;
|
|
159
|
+
similarityThreshold?: number;
|
|
160
|
+
embeddingModel?: string;
|
|
161
|
+
chunkingStrategy?: string;
|
|
162
|
+
chunkSize?: number;
|
|
163
|
+
chunkOverlap?: number;
|
|
164
|
+
autoProcess?: boolean;
|
|
165
|
+
includeMetadata?: boolean;
|
|
166
|
+
contextWindowTokens?: number;
|
|
167
|
+
}
|
|
168
|
+
interface InterruptionSettings {
|
|
169
|
+
interruptionThreshold?: number;
|
|
170
|
+
minSpeakingTime?: number;
|
|
171
|
+
interruptionCooldown?: number;
|
|
172
|
+
}
|
|
173
|
+
interface RecordingSettings {
|
|
174
|
+
enabled?: boolean;
|
|
175
|
+
format?: string;
|
|
176
|
+
channels?: string;
|
|
177
|
+
}
|
|
178
|
+
/**
|
|
179
|
+
* Configuration for a single LLM fallback provider.
|
|
180
|
+
*/
|
|
181
|
+
interface LLMFallbackProvider {
|
|
182
|
+
provider: string;
|
|
183
|
+
apiKey?: string;
|
|
184
|
+
baseUrl?: string;
|
|
185
|
+
model?: string;
|
|
186
|
+
}
|
|
187
|
+
/**
|
|
188
|
+
* Settings for LLM fallback providers.
|
|
189
|
+
*/
|
|
190
|
+
interface LLMFallbackSettings {
|
|
191
|
+
enabled?: boolean;
|
|
192
|
+
fallbacks?: LLMFallbackProvider[];
|
|
193
|
+
}
|
|
194
|
+
interface Assistant {
|
|
195
|
+
id: number;
|
|
196
|
+
name: string;
|
|
197
|
+
description?: string;
|
|
198
|
+
organizationId?: number;
|
|
199
|
+
isActive?: boolean;
|
|
200
|
+
llmProvider?: string;
|
|
201
|
+
llmProviderConfig?: LLMProviderConfig;
|
|
202
|
+
llmSettings?: LLMSettings;
|
|
203
|
+
ttsSettings?: TTSSettings;
|
|
204
|
+
sttSettings?: STTSettings;
|
|
205
|
+
ragSettings?: RAGSettings;
|
|
206
|
+
toolsSettings?: ToolsSettings;
|
|
207
|
+
interruptionSettings?: InterruptionSettings;
|
|
208
|
+
recordingSettings?: RecordingSettings;
|
|
209
|
+
webhookUrl?: string;
|
|
210
|
+
webhookHeaders?: Record<string, string>;
|
|
211
|
+
smsWebhookUrl?: string;
|
|
212
|
+
messagingServiceSid?: string;
|
|
213
|
+
endCallMessage?: string;
|
|
214
|
+
transferCallMessage?: string;
|
|
215
|
+
idleMessage?: string;
|
|
216
|
+
maxIdleMessages?: number;
|
|
217
|
+
idleTimeout?: number;
|
|
218
|
+
maxCallLength?: number;
|
|
219
|
+
conversationContinuityEnabled?: boolean;
|
|
220
|
+
llmFallbackProviders?: LLMFallbackSettings;
|
|
221
|
+
customSettings?: Record<string, unknown>;
|
|
222
|
+
createdAt?: string;
|
|
223
|
+
updatedAt?: string;
|
|
224
|
+
callCount?: number;
|
|
225
|
+
totalDuration?: number;
|
|
226
|
+
phoneNumbers?: string[];
|
|
227
|
+
}
|
|
228
|
+
interface AssistantCreateParams {
|
|
229
|
+
name: string;
|
|
230
|
+
description?: string;
|
|
231
|
+
llmProvider?: string;
|
|
232
|
+
llmProviderConfig?: LLMProviderConfig;
|
|
233
|
+
llmSettings?: LLMSettings;
|
|
234
|
+
ttsSettings?: TTSSettings;
|
|
235
|
+
sttSettings?: STTSettings;
|
|
236
|
+
ragSettings?: RAGSettings;
|
|
237
|
+
toolsSettings?: ToolsSettings;
|
|
238
|
+
interruptionSettings?: InterruptionSettings;
|
|
239
|
+
recordingSettings?: RecordingSettings;
|
|
240
|
+
webhookUrl?: string;
|
|
241
|
+
webhookHeaders?: Record<string, string>;
|
|
242
|
+
smsWebhookUrl?: string;
|
|
243
|
+
messagingServiceSid?: string;
|
|
244
|
+
endCallMessage?: string;
|
|
245
|
+
transferCallMessage?: string;
|
|
246
|
+
idleMessage?: string;
|
|
247
|
+
maxIdleMessages?: number;
|
|
248
|
+
idleTimeout?: number;
|
|
249
|
+
maxCallLength?: number;
|
|
250
|
+
conversationContinuityEnabled?: boolean;
|
|
251
|
+
llmFallbackProviders?: LLMFallbackSettings;
|
|
252
|
+
customSettings?: Record<string, unknown>;
|
|
253
|
+
isActive?: boolean;
|
|
254
|
+
}
|
|
255
|
+
interface AssistantUpdateParams {
|
|
256
|
+
name?: string;
|
|
257
|
+
description?: string;
|
|
258
|
+
isActive?: boolean;
|
|
259
|
+
llmProvider?: string;
|
|
260
|
+
llmProviderConfig?: LLMProviderConfig;
|
|
261
|
+
llmSettings?: LLMSettings;
|
|
262
|
+
ttsSettings?: TTSSettings;
|
|
263
|
+
sttSettings?: STTSettings;
|
|
264
|
+
ragSettings?: RAGSettings;
|
|
265
|
+
toolsSettings?: ToolsSettings;
|
|
266
|
+
interruptionSettings?: InterruptionSettings;
|
|
267
|
+
recordingSettings?: RecordingSettings;
|
|
268
|
+
webhookUrl?: string;
|
|
269
|
+
webhookHeaders?: Record<string, string>;
|
|
270
|
+
smsWebhookUrl?: string;
|
|
271
|
+
messagingServiceSid?: string;
|
|
272
|
+
endCallMessage?: string;
|
|
273
|
+
transferCallMessage?: string;
|
|
274
|
+
idleMessage?: string;
|
|
275
|
+
maxIdleMessages?: number;
|
|
276
|
+
idleTimeout?: number;
|
|
277
|
+
maxCallLength?: number;
|
|
278
|
+
conversationContinuityEnabled?: boolean;
|
|
279
|
+
llmFallbackProviders?: LLMFallbackSettings;
|
|
280
|
+
customSettings?: Record<string, unknown>;
|
|
281
|
+
}
|
|
282
|
+
interface AssistantListParams {
|
|
283
|
+
skip?: number;
|
|
284
|
+
limit?: number;
|
|
285
|
+
activeOnly?: boolean;
|
|
286
|
+
myAssistantsOnly?: boolean;
|
|
287
|
+
includeStats?: boolean;
|
|
288
|
+
}
|
|
289
|
+
interface AssistantList {
|
|
290
|
+
items: Assistant[];
|
|
291
|
+
total: number;
|
|
292
|
+
skip: number;
|
|
293
|
+
limit: number;
|
|
294
|
+
}
|
|
295
|
+
/**
|
|
296
|
+
* Cloned voice information.
|
|
297
|
+
*/
|
|
298
|
+
interface ClonedVoice {
|
|
299
|
+
id: string;
|
|
300
|
+
name: string;
|
|
301
|
+
provider: string;
|
|
302
|
+
status: string;
|
|
303
|
+
createdAt?: string;
|
|
304
|
+
}
|
|
305
|
+
/**
|
|
306
|
+
* Provider configuration information.
|
|
307
|
+
*/
|
|
308
|
+
interface ProviderInfo {
|
|
309
|
+
name: string;
|
|
310
|
+
models: string[];
|
|
311
|
+
defaultModel?: string;
|
|
312
|
+
supportsStreaming?: boolean;
|
|
313
|
+
}
|
|
314
|
+
|
|
315
|
+
/**
|
|
316
|
+
* Assistants resource for the Burki SDK.
|
|
317
|
+
*/
|
|
318
|
+
|
|
319
|
+
interface AssistantExportParams {
|
|
320
|
+
format?: 'csv' | 'json';
|
|
321
|
+
assistantIds?: number[];
|
|
322
|
+
search?: string;
|
|
323
|
+
status?: 'active' | 'inactive' | 'all';
|
|
324
|
+
}
|
|
325
|
+
declare class AssistantsResource extends BaseResource {
|
|
326
|
+
/**
|
|
327
|
+
* List all assistants in your organization.
|
|
328
|
+
*/
|
|
329
|
+
list(params?: AssistantListParams): Promise<Assistant[]>;
|
|
330
|
+
/**
|
|
331
|
+
* Get a specific assistant by ID.
|
|
332
|
+
*/
|
|
333
|
+
get(assistantId: number): Promise<Assistant>;
|
|
334
|
+
/**
|
|
335
|
+
* Get an assistant by its assigned phone number.
|
|
336
|
+
*/
|
|
337
|
+
getByPhone(phoneNumber: string): Promise<Assistant>;
|
|
338
|
+
/**
|
|
339
|
+
* Create a new assistant.
|
|
340
|
+
*/
|
|
341
|
+
create(params: AssistantCreateParams): Promise<Assistant>;
|
|
342
|
+
/**
|
|
343
|
+
* Update an existing assistant (PATCH - partial update with merge).
|
|
344
|
+
*/
|
|
345
|
+
update(assistantId: number, params: AssistantUpdateParams): Promise<Assistant>;
|
|
346
|
+
/**
|
|
347
|
+
* Quick method to update just the active status of an assistant.
|
|
348
|
+
*/
|
|
349
|
+
updateStatus(assistantId: number, isActive: boolean): Promise<Assistant>;
|
|
350
|
+
/**
|
|
351
|
+
* Delete an assistant.
|
|
352
|
+
*/
|
|
353
|
+
delete(assistantId: number): Promise<void>;
|
|
354
|
+
/**
|
|
355
|
+
* Get the total count of assistants.
|
|
356
|
+
*/
|
|
357
|
+
getCount(activeOnly?: boolean): Promise<number>;
|
|
358
|
+
/**
|
|
359
|
+
* Export assistants data in CSV or JSON format.
|
|
360
|
+
*/
|
|
361
|
+
export(params?: AssistantExportParams): Promise<Blob>;
|
|
362
|
+
/**
|
|
363
|
+
* List cloned voices for your organization.
|
|
364
|
+
*/
|
|
365
|
+
getClonedVoices(params?: {
|
|
366
|
+
status?: string;
|
|
367
|
+
provider?: string;
|
|
368
|
+
}): Promise<ClonedVoice[]>;
|
|
369
|
+
/**
|
|
370
|
+
* Get list of supported LLM providers.
|
|
371
|
+
*/
|
|
372
|
+
getProviders(): Promise<Record<string, ProviderInfo>>;
|
|
373
|
+
/**
|
|
374
|
+
* Get information about your organization.
|
|
375
|
+
*/
|
|
376
|
+
getOrganizationInfo(): Promise<Record<string, unknown>>;
|
|
377
|
+
}
|
|
378
|
+
|
|
379
|
+
/**
|
|
380
|
+
* Call models for the Burki SDK.
|
|
381
|
+
*/
|
|
382
|
+
interface Call {
|
|
383
|
+
id: number;
|
|
384
|
+
organizationId?: number;
|
|
385
|
+
assistantId?: number;
|
|
386
|
+
callSid?: string;
|
|
387
|
+
streamSid?: string;
|
|
388
|
+
status: string;
|
|
389
|
+
direction: string;
|
|
390
|
+
customerPhone?: string;
|
|
391
|
+
twilioPhone?: string;
|
|
392
|
+
telephonyProvider?: string;
|
|
393
|
+
duration?: number;
|
|
394
|
+
startedAt?: string;
|
|
395
|
+
endedAt?: string;
|
|
396
|
+
createdAt?: string;
|
|
397
|
+
updatedAt?: string;
|
|
398
|
+
welcomeMessage?: string;
|
|
399
|
+
agenda?: string;
|
|
400
|
+
metadata?: Record<string, unknown>;
|
|
401
|
+
errorMessage?: string;
|
|
402
|
+
endReason?: string;
|
|
403
|
+
transferredTo?: string;
|
|
404
|
+
assistantName?: string;
|
|
405
|
+
transcriptCount?: number;
|
|
406
|
+
recordingCount?: number;
|
|
407
|
+
cost?: number;
|
|
408
|
+
costBreakdown?: {
|
|
409
|
+
llm?: number;
|
|
410
|
+
tts?: number;
|
|
411
|
+
stt?: number;
|
|
412
|
+
telephony?: number;
|
|
413
|
+
};
|
|
414
|
+
}
|
|
415
|
+
interface PaginatedCalls {
|
|
416
|
+
items: Call[];
|
|
417
|
+
total: number;
|
|
418
|
+
skip: number;
|
|
419
|
+
limit: number;
|
|
420
|
+
}
|
|
421
|
+
interface CallTranscript {
|
|
422
|
+
id: number;
|
|
423
|
+
callId: number;
|
|
424
|
+
speaker: string;
|
|
425
|
+
text: string;
|
|
426
|
+
timestamp?: string;
|
|
427
|
+
isFinal: boolean;
|
|
428
|
+
confidence?: number;
|
|
429
|
+
language?: string;
|
|
430
|
+
createdAt?: string;
|
|
431
|
+
}
|
|
432
|
+
interface CallRecording {
|
|
433
|
+
id: number;
|
|
434
|
+
callId: number;
|
|
435
|
+
recordingType: string;
|
|
436
|
+
url?: string;
|
|
437
|
+
duration?: number;
|
|
438
|
+
sizeBytes?: number;
|
|
439
|
+
format?: string;
|
|
440
|
+
createdAt?: string;
|
|
441
|
+
}
|
|
442
|
+
interface CallMetrics {
|
|
443
|
+
callId: number;
|
|
444
|
+
durationSeconds?: number;
|
|
445
|
+
talkTimeUser?: number;
|
|
446
|
+
talkTimeAssistant?: number;
|
|
447
|
+
silenceTime?: number;
|
|
448
|
+
interruptions?: number;
|
|
449
|
+
averageResponseTime?: number;
|
|
450
|
+
sentimentScore?: number;
|
|
451
|
+
emotionDetected?: string;
|
|
452
|
+
topicsDiscussed?: string[];
|
|
453
|
+
summary?: string;
|
|
454
|
+
costEstimate?: number;
|
|
455
|
+
tokensUsed?: number;
|
|
456
|
+
avgResponseTime?: number;
|
|
457
|
+
fastestResponseTime?: number;
|
|
458
|
+
responseTimeStd?: number;
|
|
459
|
+
avgCustomerResponseTime?: number;
|
|
460
|
+
avgAiResponseTime?: number;
|
|
461
|
+
conversationFlowScore?: number;
|
|
462
|
+
engagementScore?: number;
|
|
463
|
+
userPercentage?: number;
|
|
464
|
+
aiPercentage?: number;
|
|
465
|
+
userTurns?: number;
|
|
466
|
+
aiTurns?: number;
|
|
467
|
+
avgSilenceDuration?: number;
|
|
468
|
+
awkwardSilencesCount?: number;
|
|
469
|
+
totalSilenceTime?: number;
|
|
470
|
+
silencePercentage?: number;
|
|
471
|
+
totalCustomerWords?: number;
|
|
472
|
+
totalAiWords?: number;
|
|
473
|
+
speakingTimeRatio?: number;
|
|
474
|
+
interruptionCount?: number;
|
|
475
|
+
avgUserFrustration?: number;
|
|
476
|
+
avgUserStress?: number;
|
|
477
|
+
primaryIntent?: string;
|
|
478
|
+
intentResolved?: boolean;
|
|
479
|
+
aiResponseAccuracy?: number;
|
|
480
|
+
}
|
|
481
|
+
interface ChatMessage {
|
|
482
|
+
id: number;
|
|
483
|
+
callId: number;
|
|
484
|
+
role: string;
|
|
485
|
+
content: string;
|
|
486
|
+
name?: string;
|
|
487
|
+
toolCallId?: string;
|
|
488
|
+
toolCalls?: Array<Record<string, unknown>>;
|
|
489
|
+
timestamp?: string;
|
|
490
|
+
createdAt?: string;
|
|
491
|
+
}
|
|
492
|
+
interface WebhookLog {
|
|
493
|
+
id: number;
|
|
494
|
+
callId: number;
|
|
495
|
+
webhookType: string;
|
|
496
|
+
url: string;
|
|
497
|
+
requestBody?: Record<string, unknown>;
|
|
498
|
+
responseStatus?: number;
|
|
499
|
+
responseBody?: string;
|
|
500
|
+
error?: string;
|
|
501
|
+
latencyMs?: number;
|
|
502
|
+
createdAt?: string;
|
|
503
|
+
}
|
|
504
|
+
interface CallAnalytics {
|
|
505
|
+
period: string;
|
|
506
|
+
totalCalls: number;
|
|
507
|
+
completedCalls: number;
|
|
508
|
+
failedCalls: number;
|
|
509
|
+
ongoingCalls?: number;
|
|
510
|
+
averageDuration?: number;
|
|
511
|
+
totalDuration?: number;
|
|
512
|
+
totalCost?: number;
|
|
513
|
+
successRate?: number;
|
|
514
|
+
callsByDay?: Array<Record<string, unknown>>;
|
|
515
|
+
callsByAssistant?: Array<Record<string, unknown>>;
|
|
516
|
+
callsByStatus?: Record<string, number>;
|
|
517
|
+
sentimentDistribution?: Record<string, number>;
|
|
518
|
+
averageSentiment?: number;
|
|
519
|
+
topTopics?: Array<Record<string, unknown>>;
|
|
520
|
+
peakHours?: Array<Record<string, unknown>>;
|
|
521
|
+
dailyStats?: Record<string, {
|
|
522
|
+
total: number;
|
|
523
|
+
completed: number;
|
|
524
|
+
failed: number;
|
|
525
|
+
}>;
|
|
526
|
+
topAssistants?: Array<{
|
|
527
|
+
assistantId: number;
|
|
528
|
+
assistantName: string;
|
|
529
|
+
calls: number;
|
|
530
|
+
duration: number;
|
|
531
|
+
}>;
|
|
532
|
+
}
|
|
533
|
+
interface CallStats {
|
|
534
|
+
totalCalls: number;
|
|
535
|
+
ongoingCalls?: number;
|
|
536
|
+
completedCalls?: number;
|
|
537
|
+
failedCalls?: number;
|
|
538
|
+
averageDuration?: number;
|
|
539
|
+
totalDuration?: number;
|
|
540
|
+
}
|
|
541
|
+
interface CallListParams {
|
|
542
|
+
skip?: number;
|
|
543
|
+
limit?: number;
|
|
544
|
+
status?: string;
|
|
545
|
+
assistantId?: number;
|
|
546
|
+
customerPhone?: string;
|
|
547
|
+
dateFrom?: string;
|
|
548
|
+
dateTo?: string;
|
|
549
|
+
minDuration?: number;
|
|
550
|
+
maxDuration?: number;
|
|
551
|
+
}
|
|
552
|
+
/**
|
|
553
|
+
* Response from initiating an outbound call.
|
|
554
|
+
*/
|
|
555
|
+
interface InitiateCallResponse {
|
|
556
|
+
success: boolean;
|
|
557
|
+
message: string;
|
|
558
|
+
callSid?: string;
|
|
559
|
+
callId?: number;
|
|
560
|
+
status?: string;
|
|
561
|
+
fromNumber?: string;
|
|
562
|
+
toNumber?: string;
|
|
563
|
+
}
|
|
564
|
+
/**
|
|
565
|
+
* Parameters for initiating an outbound call.
|
|
566
|
+
*/
|
|
567
|
+
interface InitiateCallParams {
|
|
568
|
+
fromPhoneNumber: string;
|
|
569
|
+
toPhoneNumber: string;
|
|
570
|
+
welcomeMessage?: string;
|
|
571
|
+
agenda?: string;
|
|
572
|
+
assistantId?: number;
|
|
573
|
+
variables?: Record<string, unknown>;
|
|
574
|
+
}
|
|
575
|
+
/**
|
|
576
|
+
* Parameters for exporting calls.
|
|
577
|
+
*/
|
|
578
|
+
interface CallExportParams {
|
|
579
|
+
format?: 'csv' | 'json';
|
|
580
|
+
status?: string;
|
|
581
|
+
assistantId?: number;
|
|
582
|
+
dateFrom?: string;
|
|
583
|
+
dateTo?: string;
|
|
584
|
+
}
|
|
585
|
+
|
|
586
|
+
/**
|
|
587
|
+
* Calls resource for the Burki SDK.
|
|
588
|
+
*/
|
|
589
|
+
|
|
590
|
+
declare class CallsResource extends BaseResource {
|
|
591
|
+
/**
|
|
592
|
+
* Initiate an outbound call from an assistant.
|
|
593
|
+
*/
|
|
594
|
+
initiate(params: InitiateCallParams): Promise<InitiateCallResponse>;
|
|
595
|
+
/**
|
|
596
|
+
* List calls with filtering options.
|
|
597
|
+
*/
|
|
598
|
+
list(params?: CallListParams): Promise<Call[]>;
|
|
599
|
+
/**
|
|
600
|
+
* Get a specific call by ID.
|
|
601
|
+
*/
|
|
602
|
+
get(callId: number): Promise<Call>;
|
|
603
|
+
/**
|
|
604
|
+
* Get a specific call by SID.
|
|
605
|
+
*/
|
|
606
|
+
getBySid(callSid: string): Promise<Call>;
|
|
607
|
+
/**
|
|
608
|
+
* Update the metadata for a specific call.
|
|
609
|
+
*/
|
|
610
|
+
updateMetadata(callId: number, metadata: Record<string, unknown>): Promise<Call>;
|
|
611
|
+
/**
|
|
612
|
+
* Get transcripts for a call.
|
|
613
|
+
*/
|
|
614
|
+
getTranscripts(callId: number, params?: {
|
|
615
|
+
speaker?: string;
|
|
616
|
+
includeInterim?: boolean;
|
|
617
|
+
}): Promise<CallTranscript[]>;
|
|
618
|
+
/**
|
|
619
|
+
* Get transcripts for a call by SID.
|
|
620
|
+
*/
|
|
621
|
+
getTranscriptsBySid(callSid: string, params?: {
|
|
622
|
+
speaker?: string;
|
|
623
|
+
includeInterim?: boolean;
|
|
624
|
+
}): Promise<CallTranscript[]>;
|
|
625
|
+
/**
|
|
626
|
+
* Export call transcripts in various formats.
|
|
627
|
+
*/
|
|
628
|
+
exportTranscripts(callId: number, params?: {
|
|
629
|
+
format?: 'txt' | 'json' | 'csv';
|
|
630
|
+
speaker?: string;
|
|
631
|
+
}): Promise<Blob>;
|
|
632
|
+
/**
|
|
633
|
+
* Get recordings for a call.
|
|
634
|
+
*/
|
|
635
|
+
getRecordings(callId: number, params?: {
|
|
636
|
+
recordingType?: string;
|
|
637
|
+
}): Promise<CallRecording[]>;
|
|
638
|
+
/**
|
|
639
|
+
* Get recordings for a call by SID.
|
|
640
|
+
*/
|
|
641
|
+
getRecordingsBySid(callSid: string, params?: {
|
|
642
|
+
recordingType?: string;
|
|
643
|
+
}): Promise<CallRecording[]>;
|
|
644
|
+
/**
|
|
645
|
+
* Get the streaming URL for a recording.
|
|
646
|
+
*/
|
|
647
|
+
getRecordingUrl(callId: number, recordingId: number): string;
|
|
648
|
+
/**
|
|
649
|
+
* Get calculated metrics for a call.
|
|
650
|
+
*/
|
|
651
|
+
getMetrics(callId: number): Promise<CallMetrics>;
|
|
652
|
+
/**
|
|
653
|
+
* Get chat messages (LLM conversation) for a call.
|
|
654
|
+
*/
|
|
655
|
+
getMessages(callId: number, params?: {
|
|
656
|
+
role?: string;
|
|
657
|
+
}): Promise<ChatMessage[]>;
|
|
658
|
+
/**
|
|
659
|
+
* Get webhook logs for a call.
|
|
660
|
+
*/
|
|
661
|
+
getWebhookLogs(callId: number, params?: {
|
|
662
|
+
webhookType?: string;
|
|
663
|
+
}): Promise<WebhookLog[]>;
|
|
664
|
+
/**
|
|
665
|
+
* Terminate an ongoing call.
|
|
666
|
+
*/
|
|
667
|
+
terminate(callSid: string): Promise<Record<string, unknown>>;
|
|
668
|
+
/**
|
|
669
|
+
* Get call analytics for your organization.
|
|
670
|
+
*/
|
|
671
|
+
getAnalytics(period?: string): Promise<CallAnalytics>;
|
|
672
|
+
/**
|
|
673
|
+
* Get basic call statistics.
|
|
674
|
+
*/
|
|
675
|
+
getStats(): Promise<CallStats>;
|
|
676
|
+
/**
|
|
677
|
+
* Get the count of calls with optional filters.
|
|
678
|
+
*/
|
|
679
|
+
getCount(params?: Partial<CallListParams>): Promise<number>;
|
|
680
|
+
/**
|
|
681
|
+
* Search calls by various criteria.
|
|
682
|
+
*/
|
|
683
|
+
search(query: string, limit?: number): Promise<Call[]>;
|
|
684
|
+
/**
|
|
685
|
+
* Export calls data.
|
|
686
|
+
*/
|
|
687
|
+
export(params?: CallExportParams): Promise<Blob>;
|
|
688
|
+
}
|
|
689
|
+
|
|
690
|
+
/**
|
|
691
|
+
* Phone number models for the Burki SDK.
|
|
692
|
+
*/
|
|
693
|
+
interface PhoneNumberCapabilities {
|
|
694
|
+
voice?: boolean;
|
|
695
|
+
sms?: boolean;
|
|
696
|
+
mms?: boolean;
|
|
697
|
+
fax?: boolean;
|
|
698
|
+
}
|
|
699
|
+
interface PhoneNumber {
|
|
700
|
+
id: number;
|
|
701
|
+
organizationId?: number;
|
|
702
|
+
assistantId?: number;
|
|
703
|
+
phoneNumber: string;
|
|
704
|
+
friendlyName?: string;
|
|
705
|
+
provider: string;
|
|
706
|
+
providerPhoneId?: string;
|
|
707
|
+
capabilities?: PhoneNumberCapabilities;
|
|
708
|
+
phoneMetadata?: Record<string, unknown>;
|
|
709
|
+
isActive: boolean;
|
|
710
|
+
createdAt?: string;
|
|
711
|
+
updatedAt?: string;
|
|
712
|
+
assistantName?: string;
|
|
713
|
+
}
|
|
714
|
+
interface AvailableNumber {
|
|
715
|
+
phoneNumber: string;
|
|
716
|
+
friendlyName?: string;
|
|
717
|
+
region?: string;
|
|
718
|
+
locality?: string;
|
|
719
|
+
isoCountry?: string;
|
|
720
|
+
capabilities?: PhoneNumberCapabilities;
|
|
721
|
+
monthlyCost?: number;
|
|
722
|
+
setupCost?: number;
|
|
723
|
+
provider?: string;
|
|
724
|
+
}
|
|
725
|
+
interface PhoneNumberSearchParams {
|
|
726
|
+
provider: string;
|
|
727
|
+
countryCode?: string;
|
|
728
|
+
areaCode?: string;
|
|
729
|
+
contains?: string;
|
|
730
|
+
locality?: string;
|
|
731
|
+
region?: string;
|
|
732
|
+
limit?: number;
|
|
733
|
+
}
|
|
734
|
+
interface PhoneNumberPurchaseParams {
|
|
735
|
+
phoneNumber: string;
|
|
736
|
+
provider: string;
|
|
737
|
+
friendlyName?: string;
|
|
738
|
+
assistantId?: number;
|
|
739
|
+
countryCode?: string;
|
|
740
|
+
}
|
|
741
|
+
interface PhoneNumberAssignParams {
|
|
742
|
+
assistantId?: number;
|
|
743
|
+
assistantGraphId?: number;
|
|
744
|
+
}
|
|
745
|
+
interface CountryInfo {
|
|
746
|
+
code: string;
|
|
747
|
+
name: string;
|
|
748
|
+
phoneCode?: string;
|
|
749
|
+
}
|
|
750
|
+
/**
|
|
751
|
+
* Response from searching for available phone numbers.
|
|
752
|
+
*/
|
|
753
|
+
interface SearchPhoneNumbersResponse {
|
|
754
|
+
success: boolean;
|
|
755
|
+
numbers: AvailableNumber[];
|
|
756
|
+
totalFound: number;
|
|
757
|
+
provider: string;
|
|
758
|
+
}
|
|
759
|
+
/**
|
|
760
|
+
* Response from purchasing a phone number.
|
|
761
|
+
*/
|
|
762
|
+
interface PurchasePhoneNumberResponse {
|
|
763
|
+
success: boolean;
|
|
764
|
+
phoneNumber: string;
|
|
765
|
+
provider: string;
|
|
766
|
+
purchaseDetails?: Record<string, unknown>;
|
|
767
|
+
message: string;
|
|
768
|
+
}
|
|
769
|
+
/**
|
|
770
|
+
* Response from releasing a phone number.
|
|
771
|
+
*/
|
|
772
|
+
interface ReleasePhoneNumberResponse {
|
|
773
|
+
success: boolean;
|
|
774
|
+
phoneNumber: string;
|
|
775
|
+
provider: string;
|
|
776
|
+
message: string;
|
|
777
|
+
}
|
|
778
|
+
/**
|
|
779
|
+
* Response from listing available country codes.
|
|
780
|
+
*/
|
|
781
|
+
interface CountryCodesResponse {
|
|
782
|
+
success: boolean;
|
|
783
|
+
countryCodes: Array<Record<string, unknown>>;
|
|
784
|
+
provider: string;
|
|
785
|
+
}
|
|
786
|
+
/**
|
|
787
|
+
* Webhook configuration for a phone number.
|
|
788
|
+
*/
|
|
789
|
+
interface WebhookConfig {
|
|
790
|
+
success: boolean;
|
|
791
|
+
phoneNumber: string;
|
|
792
|
+
provider: string;
|
|
793
|
+
voiceWebhookUrl?: string;
|
|
794
|
+
smsWebhookUrl?: string;
|
|
795
|
+
configuration?: Record<string, unknown>;
|
|
796
|
+
}
|
|
797
|
+
/**
|
|
798
|
+
* Parameters for updating webhooks.
|
|
799
|
+
*/
|
|
800
|
+
interface UpdateWebhooksParams {
|
|
801
|
+
phoneNumber: string;
|
|
802
|
+
voiceWebhookUrl?: string;
|
|
803
|
+
disableSms?: boolean;
|
|
804
|
+
enableSms?: boolean;
|
|
805
|
+
provider?: string;
|
|
806
|
+
}
|
|
807
|
+
/**
|
|
808
|
+
* Response from updating phone number webhooks.
|
|
809
|
+
*/
|
|
810
|
+
interface UpdateWebhookResponse {
|
|
811
|
+
success: boolean;
|
|
812
|
+
phoneNumber: string;
|
|
813
|
+
provider: string;
|
|
814
|
+
updatedWebhooks: Record<string, string>;
|
|
815
|
+
message: string;
|
|
816
|
+
}
|
|
817
|
+
/**
|
|
818
|
+
* Parameters for adding a verified caller ID.
|
|
819
|
+
*/
|
|
820
|
+
interface AddVerifiedCallerIdParams {
|
|
821
|
+
phoneNumber: string;
|
|
822
|
+
friendlyName?: string;
|
|
823
|
+
}
|
|
824
|
+
|
|
825
|
+
/**
|
|
826
|
+
* Phone Numbers resource for the Burki SDK.
|
|
827
|
+
*/
|
|
828
|
+
|
|
829
|
+
declare class PhoneNumbersResource extends BaseResource {
|
|
830
|
+
/**
|
|
831
|
+
* List all phone numbers in your organization.
|
|
832
|
+
*/
|
|
833
|
+
list(): Promise<PhoneNumber[]>;
|
|
834
|
+
/**
|
|
835
|
+
* Search for available phone numbers to purchase.
|
|
836
|
+
*/
|
|
837
|
+
search(params: PhoneNumberSearchParams): Promise<SearchPhoneNumbersResponse>;
|
|
838
|
+
/**
|
|
839
|
+
* Purchase a phone number.
|
|
840
|
+
*/
|
|
841
|
+
purchase(params: PhoneNumberPurchaseParams): Promise<PurchasePhoneNumberResponse>;
|
|
842
|
+
/**
|
|
843
|
+
* Release a phone number.
|
|
844
|
+
*/
|
|
845
|
+
release(phoneNumber: string, provider?: string): Promise<ReleasePhoneNumberResponse>;
|
|
846
|
+
/**
|
|
847
|
+
* Assign a phone number to an assistant.
|
|
848
|
+
*/
|
|
849
|
+
assign(phoneNumberId: number, params: PhoneNumberAssignParams): Promise<PhoneNumber>;
|
|
850
|
+
/**
|
|
851
|
+
* Unassign a phone number from its assistant.
|
|
852
|
+
*/
|
|
853
|
+
unassign(phoneNumberId: number): Promise<PhoneNumber>;
|
|
854
|
+
/**
|
|
855
|
+
* Get available country codes for phone number search.
|
|
856
|
+
*/
|
|
857
|
+
getCountries(provider?: string): Promise<CountryCodesResponse>;
|
|
858
|
+
/**
|
|
859
|
+
* Diagnose the connection status of a phone number (Telnyx).
|
|
860
|
+
*/
|
|
861
|
+
diagnose(phoneNumber: string): Promise<Record<string, unknown>>;
|
|
862
|
+
/**
|
|
863
|
+
* Get current webhook configuration for a phone number.
|
|
864
|
+
*/
|
|
865
|
+
getWebhooks(phoneNumber: string, provider?: string): Promise<WebhookConfig>;
|
|
866
|
+
/**
|
|
867
|
+
* Update voice webhook URL and/or SMS settings for a phone number.
|
|
868
|
+
*/
|
|
869
|
+
updateWebhooks(params: UpdateWebhooksParams): Promise<Record<string, unknown>>;
|
|
870
|
+
/**
|
|
871
|
+
* Sync verified caller IDs from Twilio for your organization.
|
|
872
|
+
*/
|
|
873
|
+
syncVerifiedCallerIds(): Promise<Record<string, unknown>>;
|
|
874
|
+
/**
|
|
875
|
+
* Add a new verified caller ID (for outbound calls with unowned numbers).
|
|
876
|
+
*/
|
|
877
|
+
addVerifiedCallerId(params: AddVerifiedCallerIdParams): Promise<Record<string, unknown>>;
|
|
878
|
+
/**
|
|
879
|
+
* Sync phone numbers from telephony providers.
|
|
880
|
+
*/
|
|
881
|
+
sync(): Promise<Record<string, unknown>>;
|
|
882
|
+
}
|
|
883
|
+
|
|
884
|
+
/**
|
|
885
|
+
* Document models for the Burki SDK (RAG).
|
|
886
|
+
*/
|
|
887
|
+
interface Document {
|
|
888
|
+
id: number;
|
|
889
|
+
assistantId: number;
|
|
890
|
+
organizationId: number;
|
|
891
|
+
filename: string;
|
|
892
|
+
originalFilename?: string;
|
|
893
|
+
fileType?: string;
|
|
894
|
+
fileSize?: number;
|
|
895
|
+
status: string;
|
|
896
|
+
processingProgress: number;
|
|
897
|
+
errorMessage?: string;
|
|
898
|
+
chunkCount?: number;
|
|
899
|
+
totalTokens?: number;
|
|
900
|
+
storageKey?: string;
|
|
901
|
+
createdAt?: string;
|
|
902
|
+
updatedAt?: string;
|
|
903
|
+
}
|
|
904
|
+
interface DocumentStatus {
|
|
905
|
+
id: number;
|
|
906
|
+
status: string;
|
|
907
|
+
processingProgress: number;
|
|
908
|
+
errorMessage?: string;
|
|
909
|
+
chunkCount?: number;
|
|
910
|
+
totalTokens?: number;
|
|
911
|
+
}
|
|
912
|
+
interface DocumentUploadParams {
|
|
913
|
+
assistantId: number;
|
|
914
|
+
autoProcess?: boolean;
|
|
915
|
+
}
|
|
916
|
+
interface DocumentUrlUploadParams {
|
|
917
|
+
assistantId: number;
|
|
918
|
+
url: string;
|
|
919
|
+
filename?: string;
|
|
920
|
+
autoProcess?: boolean;
|
|
921
|
+
}
|
|
922
|
+
|
|
923
|
+
/**
|
|
924
|
+
* Documents resource for the Burki SDK (RAG).
|
|
925
|
+
*/
|
|
926
|
+
|
|
927
|
+
declare class DocumentsResource extends BaseResource {
|
|
928
|
+
/**
|
|
929
|
+
* List all documents for an assistant.
|
|
930
|
+
*/
|
|
931
|
+
list(assistantId: number): Promise<Document[]>;
|
|
932
|
+
/**
|
|
933
|
+
* Upload a document to an assistant's knowledge base.
|
|
934
|
+
*
|
|
935
|
+
* Note: For browser usage, pass a File object. For Node.js, use uploadFromUrl instead.
|
|
936
|
+
*/
|
|
937
|
+
upload(assistantId: number, file: File | Blob, filename: string, autoProcess?: boolean): Promise<Document>;
|
|
938
|
+
/**
|
|
939
|
+
* Upload a document from a URL.
|
|
940
|
+
*/
|
|
941
|
+
uploadFromUrl(params: DocumentUrlUploadParams): Promise<Document>;
|
|
942
|
+
/**
|
|
943
|
+
* Get the processing status of a document.
|
|
944
|
+
*/
|
|
945
|
+
getStatus(documentId: number): Promise<DocumentStatus>;
|
|
946
|
+
/**
|
|
947
|
+
* Delete a document.
|
|
948
|
+
*/
|
|
949
|
+
delete(documentId: number): Promise<void>;
|
|
950
|
+
/**
|
|
951
|
+
* Reprocess a document.
|
|
952
|
+
*/
|
|
953
|
+
reprocess(documentId: number): Promise<Document>;
|
|
954
|
+
}
|
|
955
|
+
|
|
956
|
+
/**
|
|
957
|
+
* Tool models for the Burki SDK.
|
|
958
|
+
*/
|
|
959
|
+
interface HTTPToolConfig {
|
|
960
|
+
method: string;
|
|
961
|
+
url: string;
|
|
962
|
+
headers?: Record<string, string>;
|
|
963
|
+
bodyTemplate?: string;
|
|
964
|
+
timeout?: number;
|
|
965
|
+
}
|
|
966
|
+
interface PythonToolConfig {
|
|
967
|
+
code: string;
|
|
968
|
+
requirements?: string[];
|
|
969
|
+
timeout?: number;
|
|
970
|
+
}
|
|
971
|
+
interface LambdaToolConfig {
|
|
972
|
+
functionArn: string;
|
|
973
|
+
region?: string;
|
|
974
|
+
invocationType?: string;
|
|
975
|
+
timeout?: number;
|
|
976
|
+
}
|
|
977
|
+
interface ToolParameter {
|
|
978
|
+
name: string;
|
|
979
|
+
type?: string;
|
|
980
|
+
description?: string;
|
|
981
|
+
required?: boolean;
|
|
982
|
+
default?: unknown;
|
|
983
|
+
enum?: string[];
|
|
984
|
+
}
|
|
985
|
+
interface Tool {
|
|
986
|
+
id: number;
|
|
987
|
+
organizationId: number;
|
|
988
|
+
name: string;
|
|
989
|
+
description?: string;
|
|
990
|
+
toolType: string;
|
|
991
|
+
parameters: ToolParameter[];
|
|
992
|
+
httpConfig?: HTTPToolConfig;
|
|
993
|
+
pythonConfig?: PythonToolConfig;
|
|
994
|
+
lambdaConfig?: LambdaToolConfig;
|
|
995
|
+
isActive: boolean;
|
|
996
|
+
executionCount: number;
|
|
997
|
+
successCount: number;
|
|
998
|
+
failureCount: number;
|
|
999
|
+
avgExecutionTime?: number;
|
|
1000
|
+
createdAt?: string;
|
|
1001
|
+
updatedAt?: string;
|
|
1002
|
+
}
|
|
1003
|
+
interface ToolCreateParams {
|
|
1004
|
+
name: string;
|
|
1005
|
+
toolType: string;
|
|
1006
|
+
description?: string;
|
|
1007
|
+
parameters?: ToolParameter[];
|
|
1008
|
+
httpConfig?: HTTPToolConfig;
|
|
1009
|
+
pythonConfig?: PythonToolConfig;
|
|
1010
|
+
lambdaConfig?: LambdaToolConfig;
|
|
1011
|
+
}
|
|
1012
|
+
interface ToolUpdateParams {
|
|
1013
|
+
name?: string;
|
|
1014
|
+
description?: string;
|
|
1015
|
+
isActive?: boolean;
|
|
1016
|
+
parameters?: ToolParameter[];
|
|
1017
|
+
httpConfig?: HTTPToolConfig;
|
|
1018
|
+
pythonConfig?: PythonToolConfig;
|
|
1019
|
+
lambdaConfig?: LambdaToolConfig;
|
|
1020
|
+
}
|
|
1021
|
+
interface LambdaFunction {
|
|
1022
|
+
functionName: string;
|
|
1023
|
+
functionArn: string;
|
|
1024
|
+
description?: string;
|
|
1025
|
+
runtime?: string;
|
|
1026
|
+
handler?: string;
|
|
1027
|
+
memorySize?: number;
|
|
1028
|
+
timeout?: number;
|
|
1029
|
+
lastModified?: string;
|
|
1030
|
+
}
|
|
1031
|
+
|
|
1032
|
+
/**
|
|
1033
|
+
* Tools resource for the Burki SDK.
|
|
1034
|
+
*/
|
|
1035
|
+
|
|
1036
|
+
declare class ToolsResource extends BaseResource {
|
|
1037
|
+
/**
|
|
1038
|
+
* List all tools in your organization.
|
|
1039
|
+
*/
|
|
1040
|
+
list(): Promise<Tool[]>;
|
|
1041
|
+
/**
|
|
1042
|
+
* Get a specific tool by ID.
|
|
1043
|
+
*/
|
|
1044
|
+
get(toolId: number): Promise<Tool>;
|
|
1045
|
+
/**
|
|
1046
|
+
* Create a new tool.
|
|
1047
|
+
*/
|
|
1048
|
+
create(params: ToolCreateParams): Promise<Tool>;
|
|
1049
|
+
/**
|
|
1050
|
+
* Update an existing tool.
|
|
1051
|
+
*/
|
|
1052
|
+
update(toolId: number, params: ToolUpdateParams): Promise<Tool>;
|
|
1053
|
+
/**
|
|
1054
|
+
* Delete a tool.
|
|
1055
|
+
*/
|
|
1056
|
+
delete(toolId: number): Promise<void>;
|
|
1057
|
+
/**
|
|
1058
|
+
* Assign a tool to an assistant.
|
|
1059
|
+
*/
|
|
1060
|
+
assign(toolId: number, assistantId: number): Promise<Record<string, unknown>>;
|
|
1061
|
+
/**
|
|
1062
|
+
* Unassign a tool from an assistant.
|
|
1063
|
+
*/
|
|
1064
|
+
unassign(toolId: number, assistantId: number): Promise<Record<string, unknown>>;
|
|
1065
|
+
/**
|
|
1066
|
+
* Discover AWS Lambda functions for creating Lambda tools.
|
|
1067
|
+
*/
|
|
1068
|
+
discoverLambda(region?: string): Promise<LambdaFunction[]>;
|
|
1069
|
+
}
|
|
1070
|
+
|
|
1071
|
+
/**
|
|
1072
|
+
* SMS models for the Burki SDK.
|
|
1073
|
+
*/
|
|
1074
|
+
interface SMSMessage {
|
|
1075
|
+
id: number;
|
|
1076
|
+
conversationId?: number;
|
|
1077
|
+
messageSid?: string;
|
|
1078
|
+
direction: string;
|
|
1079
|
+
sender: string;
|
|
1080
|
+
body: string;
|
|
1081
|
+
status?: string;
|
|
1082
|
+
mediaUrls?: string[];
|
|
1083
|
+
createdAt?: string;
|
|
1084
|
+
}
|
|
1085
|
+
interface SMSConversation {
|
|
1086
|
+
id: number;
|
|
1087
|
+
organizationId?: number;
|
|
1088
|
+
assistantId?: number;
|
|
1089
|
+
customerPhone: string;
|
|
1090
|
+
twilioPhone: string;
|
|
1091
|
+
status: string;
|
|
1092
|
+
messageCount?: number;
|
|
1093
|
+
lastMessageAt?: string;
|
|
1094
|
+
createdAt?: string;
|
|
1095
|
+
updatedAt?: string;
|
|
1096
|
+
assistantName?: string;
|
|
1097
|
+
}
|
|
1098
|
+
interface SMSConversationDetail extends SMSConversation {
|
|
1099
|
+
messages?: SMSMessage[];
|
|
1100
|
+
}
|
|
1101
|
+
interface SMSSendParams {
|
|
1102
|
+
fromPhoneNumber: string;
|
|
1103
|
+
toPhoneNumber: string;
|
|
1104
|
+
message: string;
|
|
1105
|
+
mediaUrls?: string[];
|
|
1106
|
+
queue?: boolean;
|
|
1107
|
+
idempotencyKey?: string;
|
|
1108
|
+
}
|
|
1109
|
+
/**
|
|
1110
|
+
* Response from sending an SMS.
|
|
1111
|
+
*/
|
|
1112
|
+
interface SMSSendResponse {
|
|
1113
|
+
success: boolean;
|
|
1114
|
+
message: string;
|
|
1115
|
+
messageId?: string;
|
|
1116
|
+
status?: string;
|
|
1117
|
+
queuedAt?: string;
|
|
1118
|
+
}
|
|
1119
|
+
/**
|
|
1120
|
+
* Response from getting SMS status.
|
|
1121
|
+
*/
|
|
1122
|
+
interface SMSStatusResponse {
|
|
1123
|
+
messageId: string;
|
|
1124
|
+
status: string;
|
|
1125
|
+
deliveredAt?: string;
|
|
1126
|
+
errorCode?: string;
|
|
1127
|
+
errorMessage?: string;
|
|
1128
|
+
provider?: string;
|
|
1129
|
+
}
|
|
1130
|
+
/**
|
|
1131
|
+
* SMS queue statistics.
|
|
1132
|
+
*/
|
|
1133
|
+
interface SMSQueueStats {
|
|
1134
|
+
pending: number;
|
|
1135
|
+
processing: number;
|
|
1136
|
+
failed: number;
|
|
1137
|
+
totalQueued: number;
|
|
1138
|
+
averageWaitTime?: number;
|
|
1139
|
+
oldestMessageAge?: number;
|
|
1140
|
+
providerStats?: Record<string, {
|
|
1141
|
+
pending: number;
|
|
1142
|
+
rateLimit: number;
|
|
1143
|
+
}>;
|
|
1144
|
+
}
|
|
1145
|
+
interface SMSConversationListParams {
|
|
1146
|
+
skip?: number;
|
|
1147
|
+
limit?: number;
|
|
1148
|
+
status?: string;
|
|
1149
|
+
assistantId?: number;
|
|
1150
|
+
customerPhone?: string;
|
|
1151
|
+
dateFrom?: string;
|
|
1152
|
+
dateTo?: string;
|
|
1153
|
+
}
|
|
1154
|
+
/**
|
|
1155
|
+
* Parameters for exporting a conversation.
|
|
1156
|
+
*/
|
|
1157
|
+
interface SMSExportParams {
|
|
1158
|
+
format?: 'txt' | 'csv' | 'json';
|
|
1159
|
+
}
|
|
1160
|
+
|
|
1161
|
+
/**
|
|
1162
|
+
* SMS resource for the Burki SDK.
|
|
1163
|
+
*/
|
|
1164
|
+
|
|
1165
|
+
declare class SMSResource extends BaseResource {
|
|
1166
|
+
/**
|
|
1167
|
+
* Send an SMS message through an assistant.
|
|
1168
|
+
*
|
|
1169
|
+
* The system will automatically:
|
|
1170
|
+
* 1. Find the assistant associated with the from_phone_number
|
|
1171
|
+
* 2. Use the assistant's configured telephony provider
|
|
1172
|
+
* 3. Queue the SMS for delivery with per-provider rate limiting (default)
|
|
1173
|
+
* 4. Persist the outbound message to the SMS conversation
|
|
1174
|
+
*/
|
|
1175
|
+
send(params: SMSSendParams): Promise<SMSSendResponse>;
|
|
1176
|
+
/**
|
|
1177
|
+
* Get the status of a sent SMS message.
|
|
1178
|
+
*/
|
|
1179
|
+
getStatus(messageId: string): Promise<SMSStatusResponse>;
|
|
1180
|
+
/**
|
|
1181
|
+
* Cancel a queued SMS message (before it's sent).
|
|
1182
|
+
*/
|
|
1183
|
+
cancel(messageId: string): Promise<Record<string, unknown>>;
|
|
1184
|
+
/**
|
|
1185
|
+
* Get SMS queue statistics.
|
|
1186
|
+
*/
|
|
1187
|
+
getQueueStats(): Promise<SMSQueueStats>;
|
|
1188
|
+
/**
|
|
1189
|
+
* List SMS conversations.
|
|
1190
|
+
*/
|
|
1191
|
+
listConversations(params?: SMSConversationListParams): Promise<SMSConversation[]>;
|
|
1192
|
+
/**
|
|
1193
|
+
* Get a specific SMS conversation by ID.
|
|
1194
|
+
*/
|
|
1195
|
+
getConversation(conversationId: string): Promise<SMSConversationDetail>;
|
|
1196
|
+
/**
|
|
1197
|
+
* Get all messages in an SMS conversation.
|
|
1198
|
+
*/
|
|
1199
|
+
getMessages(conversationId: string): Promise<SMSMessage[]>;
|
|
1200
|
+
/**
|
|
1201
|
+
* Get related calls and SMS conversations that share the same unified session.
|
|
1202
|
+
*/
|
|
1203
|
+
getRelatedConversations(conversationId: string): Promise<Array<Record<string, unknown>>>;
|
|
1204
|
+
/**
|
|
1205
|
+
* Archive an SMS conversation and purge associated data.
|
|
1206
|
+
*/
|
|
1207
|
+
deleteConversation(conversationId: string): Promise<Record<string, unknown>>;
|
|
1208
|
+
/**
|
|
1209
|
+
* Export an SMS conversation in various formats.
|
|
1210
|
+
*/
|
|
1211
|
+
exportConversation(conversationId: string, params?: SMSExportParams): Promise<Blob>;
|
|
1212
|
+
/**
|
|
1213
|
+
* @deprecated Use listConversations() instead
|
|
1214
|
+
*/
|
|
1215
|
+
getConversations(params?: SMSConversationListParams): Promise<SMSConversation[]>;
|
|
1216
|
+
}
|
|
1217
|
+
|
|
1218
|
+
/**
|
|
1219
|
+
* Campaign models for the Burki SDK.
|
|
1220
|
+
*/
|
|
1221
|
+
interface CampaignContact {
|
|
1222
|
+
id?: number;
|
|
1223
|
+
campaignId?: number;
|
|
1224
|
+
phoneNumber: string;
|
|
1225
|
+
name?: string;
|
|
1226
|
+
email?: string;
|
|
1227
|
+
variables?: Record<string, unknown>;
|
|
1228
|
+
status?: string;
|
|
1229
|
+
callSid?: string;
|
|
1230
|
+
callDuration?: number;
|
|
1231
|
+
callStatus?: string;
|
|
1232
|
+
attempts?: number;
|
|
1233
|
+
lastAttemptAt?: string;
|
|
1234
|
+
completedAt?: string;
|
|
1235
|
+
errorMessage?: string;
|
|
1236
|
+
}
|
|
1237
|
+
interface CampaignSchedule {
|
|
1238
|
+
scheduleType?: string;
|
|
1239
|
+
scheduledAt?: string;
|
|
1240
|
+
timezone?: string;
|
|
1241
|
+
daysOfWeek?: number[];
|
|
1242
|
+
startTime?: string;
|
|
1243
|
+
endTime?: string;
|
|
1244
|
+
}
|
|
1245
|
+
interface CampaignSettings {
|
|
1246
|
+
maxConcurrentCalls?: number;
|
|
1247
|
+
callsPerMinute?: number;
|
|
1248
|
+
maxAttempts?: number;
|
|
1249
|
+
retryDelayMinutes?: number;
|
|
1250
|
+
leaveVoicemail?: boolean;
|
|
1251
|
+
voicemailMessage?: string;
|
|
1252
|
+
welcomeTemplate?: string;
|
|
1253
|
+
agendaTemplate?: string;
|
|
1254
|
+
}
|
|
1255
|
+
interface Campaign {
|
|
1256
|
+
id: number;
|
|
1257
|
+
organizationId: number;
|
|
1258
|
+
assistantId: number;
|
|
1259
|
+
name: string;
|
|
1260
|
+
description?: string;
|
|
1261
|
+
campaignType: string;
|
|
1262
|
+
status: string;
|
|
1263
|
+
totalContacts: number;
|
|
1264
|
+
completedContacts: number;
|
|
1265
|
+
failedContacts: number;
|
|
1266
|
+
schedule: CampaignSchedule;
|
|
1267
|
+
settings: CampaignSettings;
|
|
1268
|
+
phoneNumberId?: number;
|
|
1269
|
+
fromPhoneNumber?: string;
|
|
1270
|
+
startedAt?: string;
|
|
1271
|
+
completedAt?: string;
|
|
1272
|
+
createdAt?: string;
|
|
1273
|
+
updatedAt?: string;
|
|
1274
|
+
}
|
|
1275
|
+
interface CampaignCreateParams {
|
|
1276
|
+
name: string;
|
|
1277
|
+
assistantId: number;
|
|
1278
|
+
contacts: CampaignContact[];
|
|
1279
|
+
description?: string;
|
|
1280
|
+
campaignType?: string;
|
|
1281
|
+
phoneNumberId?: number;
|
|
1282
|
+
schedule?: CampaignSchedule;
|
|
1283
|
+
settings?: CampaignSettings;
|
|
1284
|
+
}
|
|
1285
|
+
interface CampaignUpdateParams {
|
|
1286
|
+
name?: string;
|
|
1287
|
+
description?: string;
|
|
1288
|
+
schedule?: CampaignSchedule;
|
|
1289
|
+
settings?: CampaignSettings;
|
|
1290
|
+
}
|
|
1291
|
+
interface CampaignProgress {
|
|
1292
|
+
campaignId: number;
|
|
1293
|
+
status: string;
|
|
1294
|
+
totalContacts: number;
|
|
1295
|
+
completedContacts: number;
|
|
1296
|
+
failedContacts: number;
|
|
1297
|
+
pendingContacts: number;
|
|
1298
|
+
inProgressContacts: number;
|
|
1299
|
+
completionPercentage: number;
|
|
1300
|
+
successRate: number;
|
|
1301
|
+
totalCost: number;
|
|
1302
|
+
startedAt?: string;
|
|
1303
|
+
estimatedCompletion?: string;
|
|
1304
|
+
}
|
|
1305
|
+
interface CampaignListParams {
|
|
1306
|
+
status?: string;
|
|
1307
|
+
skip?: number;
|
|
1308
|
+
limit?: number;
|
|
1309
|
+
}
|
|
1310
|
+
interface CampaignContactListParams {
|
|
1311
|
+
status?: string;
|
|
1312
|
+
skip?: number;
|
|
1313
|
+
limit?: number;
|
|
1314
|
+
}
|
|
1315
|
+
|
|
1316
|
+
/**
|
|
1317
|
+
* Campaigns resource for the Burki SDK.
|
|
1318
|
+
*/
|
|
1319
|
+
|
|
1320
|
+
declare class CampaignsResource extends BaseResource {
|
|
1321
|
+
/**
|
|
1322
|
+
* List campaigns.
|
|
1323
|
+
*/
|
|
1324
|
+
list(params?: CampaignListParams): Promise<Campaign[]>;
|
|
1325
|
+
/**
|
|
1326
|
+
* Get a specific campaign by ID.
|
|
1327
|
+
*/
|
|
1328
|
+
get(campaignId: number): Promise<Campaign>;
|
|
1329
|
+
/**
|
|
1330
|
+
* Create a new campaign.
|
|
1331
|
+
*/
|
|
1332
|
+
create(params: CampaignCreateParams): Promise<Campaign>;
|
|
1333
|
+
/**
|
|
1334
|
+
* Update a campaign.
|
|
1335
|
+
*/
|
|
1336
|
+
update(campaignId: number, params: CampaignUpdateParams): Promise<Campaign>;
|
|
1337
|
+
/**
|
|
1338
|
+
* Delete a campaign.
|
|
1339
|
+
*/
|
|
1340
|
+
delete(campaignId: number): Promise<void>;
|
|
1341
|
+
/**
|
|
1342
|
+
* Start a campaign.
|
|
1343
|
+
*/
|
|
1344
|
+
start(campaignId: number): Promise<Campaign>;
|
|
1345
|
+
/**
|
|
1346
|
+
* Pause a running campaign.
|
|
1347
|
+
*/
|
|
1348
|
+
pause(campaignId: number): Promise<Campaign>;
|
|
1349
|
+
/**
|
|
1350
|
+
* Resume a paused campaign.
|
|
1351
|
+
*/
|
|
1352
|
+
resume(campaignId: number): Promise<Campaign>;
|
|
1353
|
+
/**
|
|
1354
|
+
* Cancel a campaign.
|
|
1355
|
+
*/
|
|
1356
|
+
cancel(campaignId: number): Promise<Campaign>;
|
|
1357
|
+
/**
|
|
1358
|
+
* Get the progress of a campaign.
|
|
1359
|
+
*/
|
|
1360
|
+
getProgress(campaignId: number): Promise<CampaignProgress>;
|
|
1361
|
+
/**
|
|
1362
|
+
* Get contacts in a campaign.
|
|
1363
|
+
*/
|
|
1364
|
+
getContacts(campaignId: number, params?: CampaignContactListParams): Promise<CampaignContact[]>;
|
|
1365
|
+
/**
|
|
1366
|
+
* Add contacts to a campaign.
|
|
1367
|
+
*/
|
|
1368
|
+
addContacts(campaignId: number, contacts: CampaignContact[]): Promise<Record<string, unknown>>;
|
|
1369
|
+
}
|
|
1370
|
+
|
|
1371
|
+
/**
|
|
1372
|
+
* Realtime event models for the Burki SDK.
|
|
1373
|
+
*/
|
|
1374
|
+
interface TranscriptEvent {
|
|
1375
|
+
type: 'transcript';
|
|
1376
|
+
callSid: string;
|
|
1377
|
+
timestamp: string;
|
|
1378
|
+
content: string;
|
|
1379
|
+
speaker: string;
|
|
1380
|
+
isFinal: boolean;
|
|
1381
|
+
confidence?: number;
|
|
1382
|
+
segmentStart?: number;
|
|
1383
|
+
segmentEnd?: number;
|
|
1384
|
+
}
|
|
1385
|
+
interface CallStatusEvent {
|
|
1386
|
+
type: 'call_status';
|
|
1387
|
+
callSid: string;
|
|
1388
|
+
timestamp: string;
|
|
1389
|
+
status: string;
|
|
1390
|
+
metadata: Record<string, unknown>;
|
|
1391
|
+
}
|
|
1392
|
+
interface CampaignProgressEvent {
|
|
1393
|
+
type: 'progress';
|
|
1394
|
+
campaignId: number;
|
|
1395
|
+
timestamp: string;
|
|
1396
|
+
totalContacts: number;
|
|
1397
|
+
completedContacts: number;
|
|
1398
|
+
failedContacts: number;
|
|
1399
|
+
pendingContacts: number;
|
|
1400
|
+
inProgressContacts: number;
|
|
1401
|
+
completionPercentage: number;
|
|
1402
|
+
contactId?: number;
|
|
1403
|
+
contactPhone?: string;
|
|
1404
|
+
contactStatus?: string;
|
|
1405
|
+
contactError?: string;
|
|
1406
|
+
}
|
|
1407
|
+
interface CampaignContactEvent {
|
|
1408
|
+
type: 'contact_update';
|
|
1409
|
+
campaignId: number;
|
|
1410
|
+
timestamp: string;
|
|
1411
|
+
contactId: number;
|
|
1412
|
+
phoneNumber: string;
|
|
1413
|
+
status: string;
|
|
1414
|
+
callSid?: string;
|
|
1415
|
+
callDuration?: number;
|
|
1416
|
+
errorMessage?: string;
|
|
1417
|
+
}
|
|
1418
|
+
interface CampaignCompletedEvent {
|
|
1419
|
+
type: 'campaign_completed';
|
|
1420
|
+
campaignId: number;
|
|
1421
|
+
timestamp: string;
|
|
1422
|
+
totalContacts: number;
|
|
1423
|
+
completedContacts: number;
|
|
1424
|
+
failedContacts: number;
|
|
1425
|
+
successRate: number;
|
|
1426
|
+
totalDuration: number;
|
|
1427
|
+
totalCost: number;
|
|
1428
|
+
}
|
|
1429
|
+
type RealtimeEvent = TranscriptEvent | CallStatusEvent | CampaignProgressEvent | CampaignContactEvent | CampaignCompletedEvent;
|
|
1430
|
+
|
|
1431
|
+
/**
|
|
1432
|
+
* Live transcript WebSocket stream.
|
|
1433
|
+
*/
|
|
1434
|
+
|
|
1435
|
+
type LiveTranscriptEvent = TranscriptEvent | CallStatusEvent;
|
|
1436
|
+
declare class LiveTranscriptStream {
|
|
1437
|
+
private wsUrl;
|
|
1438
|
+
private token;
|
|
1439
|
+
private websocket;
|
|
1440
|
+
private running;
|
|
1441
|
+
constructor(wsUrl: string, token: string);
|
|
1442
|
+
/**
|
|
1443
|
+
* Connect to the WebSocket.
|
|
1444
|
+
*/
|
|
1445
|
+
connect(): Promise<void>;
|
|
1446
|
+
/**
|
|
1447
|
+
* Disconnect from the WebSocket.
|
|
1448
|
+
*/
|
|
1449
|
+
disconnect(): void;
|
|
1450
|
+
/**
|
|
1451
|
+
* Iterate over incoming events using async iteration.
|
|
1452
|
+
*/
|
|
1453
|
+
[Symbol.asyncIterator](): AsyncIterator<LiveTranscriptEvent>;
|
|
1454
|
+
private parseEvent;
|
|
1455
|
+
/**
|
|
1456
|
+
* Check if the WebSocket is connected.
|
|
1457
|
+
*/
|
|
1458
|
+
get connected(): boolean;
|
|
1459
|
+
}
|
|
1460
|
+
|
|
1461
|
+
/**
|
|
1462
|
+
* Campaign progress WebSocket stream.
|
|
1463
|
+
*/
|
|
1464
|
+
|
|
1465
|
+
type CampaignEvent = CampaignProgressEvent | CampaignContactEvent | CampaignCompletedEvent;
|
|
1466
|
+
declare class CampaignProgressStream {
|
|
1467
|
+
private wsUrl;
|
|
1468
|
+
private token;
|
|
1469
|
+
private websocket;
|
|
1470
|
+
private running;
|
|
1471
|
+
constructor(wsUrl: string, token: string);
|
|
1472
|
+
/**
|
|
1473
|
+
* Connect to the WebSocket.
|
|
1474
|
+
*/
|
|
1475
|
+
connect(): Promise<void>;
|
|
1476
|
+
/**
|
|
1477
|
+
* Disconnect from the WebSocket.
|
|
1478
|
+
*/
|
|
1479
|
+
disconnect(): void;
|
|
1480
|
+
/**
|
|
1481
|
+
* Iterate over incoming events using async iteration.
|
|
1482
|
+
*/
|
|
1483
|
+
[Symbol.asyncIterator](): AsyncIterator<CampaignEvent>;
|
|
1484
|
+
private parseEvent;
|
|
1485
|
+
/**
|
|
1486
|
+
* Send a ping message to keep the connection alive.
|
|
1487
|
+
*/
|
|
1488
|
+
sendPing(): void;
|
|
1489
|
+
/**
|
|
1490
|
+
* Check if the WebSocket is connected.
|
|
1491
|
+
*/
|
|
1492
|
+
get connected(): boolean;
|
|
1493
|
+
}
|
|
1494
|
+
|
|
1495
|
+
/**
|
|
1496
|
+
* Realtime client for WebSocket connections.
|
|
1497
|
+
*/
|
|
1498
|
+
|
|
1499
|
+
declare class RealtimeClient {
|
|
1500
|
+
private auth;
|
|
1501
|
+
private wsBaseUrl;
|
|
1502
|
+
constructor(auth: BurkiAuth, baseUrl: string);
|
|
1503
|
+
/**
|
|
1504
|
+
* Create a live transcript stream for a call.
|
|
1505
|
+
*/
|
|
1506
|
+
liveTranscript(callSid: string): LiveTranscriptStream;
|
|
1507
|
+
/**
|
|
1508
|
+
* Create a campaign progress stream.
|
|
1509
|
+
*/
|
|
1510
|
+
campaignProgress(campaignId: number): CampaignProgressStream;
|
|
1511
|
+
}
|
|
1512
|
+
|
|
1513
|
+
/**
|
|
1514
|
+
* Main Burki client module.
|
|
1515
|
+
*/
|
|
1516
|
+
|
|
1517
|
+
interface BurkiClientOptions {
|
|
1518
|
+
apiKey: string;
|
|
1519
|
+
baseUrl?: string;
|
|
1520
|
+
timeout?: number;
|
|
1521
|
+
}
|
|
1522
|
+
/**
|
|
1523
|
+
* Main client for interacting with the Burki Voice AI API.
|
|
1524
|
+
*
|
|
1525
|
+
* @example
|
|
1526
|
+
* ```typescript
|
|
1527
|
+
* import { BurkiClient } from '@burki/sdk';
|
|
1528
|
+
*
|
|
1529
|
+
* const client = new BurkiClient({ apiKey: 'your-api-key' });
|
|
1530
|
+
*
|
|
1531
|
+
* // List assistants
|
|
1532
|
+
* const assistants = await client.assistants.list();
|
|
1533
|
+
*
|
|
1534
|
+
* // Create an assistant
|
|
1535
|
+
* const assistant = await client.assistants.create({
|
|
1536
|
+
* name: 'My Bot',
|
|
1537
|
+
* llmSettings: { model: 'gpt-4o-mini' }
|
|
1538
|
+
* });
|
|
1539
|
+
* ```
|
|
1540
|
+
*/
|
|
1541
|
+
declare class BurkiClient {
|
|
1542
|
+
private auth;
|
|
1543
|
+
private httpClient;
|
|
1544
|
+
private baseUrl;
|
|
1545
|
+
private _assistants?;
|
|
1546
|
+
private _calls?;
|
|
1547
|
+
private _phoneNumbers?;
|
|
1548
|
+
private _documents?;
|
|
1549
|
+
private _tools?;
|
|
1550
|
+
private _sms?;
|
|
1551
|
+
private _campaigns?;
|
|
1552
|
+
private _realtime?;
|
|
1553
|
+
constructor(options: BurkiClientOptions);
|
|
1554
|
+
/**
|
|
1555
|
+
* Access the Assistants resource.
|
|
1556
|
+
*/
|
|
1557
|
+
get assistants(): AssistantsResource;
|
|
1558
|
+
/**
|
|
1559
|
+
* Access the Calls resource.
|
|
1560
|
+
*/
|
|
1561
|
+
get calls(): CallsResource;
|
|
1562
|
+
/**
|
|
1563
|
+
* Access the Phone Numbers resource.
|
|
1564
|
+
*/
|
|
1565
|
+
get phoneNumbers(): PhoneNumbersResource;
|
|
1566
|
+
/**
|
|
1567
|
+
* Access the Documents resource.
|
|
1568
|
+
*/
|
|
1569
|
+
get documents(): DocumentsResource;
|
|
1570
|
+
/**
|
|
1571
|
+
* Access the Tools resource.
|
|
1572
|
+
*/
|
|
1573
|
+
get tools(): ToolsResource;
|
|
1574
|
+
/**
|
|
1575
|
+
* Access the SMS resource.
|
|
1576
|
+
*/
|
|
1577
|
+
get sms(): SMSResource;
|
|
1578
|
+
/**
|
|
1579
|
+
* Access the Campaigns resource.
|
|
1580
|
+
*/
|
|
1581
|
+
get campaigns(): CampaignsResource;
|
|
1582
|
+
/**
|
|
1583
|
+
* Access the Realtime (WebSocket) client.
|
|
1584
|
+
*/
|
|
1585
|
+
get realtime(): RealtimeClient;
|
|
1586
|
+
}
|
|
1587
|
+
|
|
1588
|
+
/**
|
|
1589
|
+
* Burki SDK Error classes.
|
|
1590
|
+
*/
|
|
1591
|
+
declare class BurkiError extends Error {
|
|
1592
|
+
statusCode?: number;
|
|
1593
|
+
responseBody?: unknown;
|
|
1594
|
+
constructor(message: string, statusCode?: number, responseBody?: unknown);
|
|
1595
|
+
}
|
|
1596
|
+
declare class AuthenticationError extends BurkiError {
|
|
1597
|
+
constructor(message?: string, responseBody?: unknown);
|
|
1598
|
+
}
|
|
1599
|
+
declare class NotFoundError extends BurkiError {
|
|
1600
|
+
constructor(message?: string, responseBody?: unknown);
|
|
1601
|
+
}
|
|
1602
|
+
declare class ValidationError extends BurkiError {
|
|
1603
|
+
constructor(message?: string, statusCode?: number, responseBody?: unknown);
|
|
1604
|
+
}
|
|
1605
|
+
declare class RateLimitError extends BurkiError {
|
|
1606
|
+
retryAfter?: number;
|
|
1607
|
+
constructor(message?: string, responseBody?: unknown, retryAfter?: number);
|
|
1608
|
+
}
|
|
1609
|
+
declare class ServerError extends BurkiError {
|
|
1610
|
+
constructor(message?: string, statusCode?: number, responseBody?: unknown);
|
|
1611
|
+
}
|
|
1612
|
+
declare class WebSocketError extends BurkiError {
|
|
1613
|
+
constructor(message?: string, responseBody?: unknown);
|
|
1614
|
+
}
|
|
1615
|
+
|
|
1616
|
+
export { type AddVerifiedCallerIdParams, type Assistant, type AssistantCreateParams, type AssistantList, type AssistantListParams, type AssistantUpdateParams, AssistantsResource, AuthenticationError, type AvailableNumber, type BackgroundSoundSettings, BurkiAuth, BurkiClient, type BurkiClientOptions, BurkiError, type Call, type CallAnalytics, type CallExportParams, type CallListParams, type CallMetrics, type CallRecording, type CallStats, type CallStatusEvent, type CallTranscript, CallsResource, type Campaign, type CampaignCompletedEvent, type CampaignContact, type CampaignContactEvent, type CampaignContactListParams, type CampaignCreateParams, type CampaignListParams, type CampaignProgress, type CampaignProgressEvent, CampaignProgressStream, type CampaignSchedule, type CampaignSettings, type CampaignUpdateParams, CampaignsResource, type ChatMessage, type ClonedVoice, type CountryCodesResponse, type CountryInfo, type Document, type DocumentStatus, type DocumentUploadParams, type DocumentUrlUploadParams, DocumentsResource, type DtmfSolverTool, type EndCallTool, type FluxConfig, type HTTPToolConfig, type InitiateCallParams, type InitiateCallResponse, type InterruptionSettings, type Keyword, type LLMFallbackProvider, type LLMFallbackSettings, type LLMProviderConfig, type LLMSettings, type LambdaFunction, type LambdaToolConfig, LiveTranscriptStream, NotFoundError, type PaginatedCalls, type PhoneNumber, type PhoneNumberAssignParams, type PhoneNumberCapabilities, type PhoneNumberPurchaseParams, type PhoneNumberSearchParams, PhoneNumbersResource, type ProviderInfo, type PurchasePhoneNumberResponse, type PythonToolConfig, type RAGSettings, RateLimitError, RealtimeClient, type RealtimeEvent, type RecordingSettings, type ReleasePhoneNumberResponse, type SMSConversation, type SMSConversationDetail, type SMSConversationListParams, type SMSExportParams, type SMSMessage, type SMSQueueStats, SMSResource, type SMSSendParams, type SMSSendResponse, type SMSStatusResponse, type STTEndpointingSettings, type STTSettings, type SearchPhoneNumbersResponse, ServerError, type TTSSettings, type Tool, type ToolCreateParams, type ToolParameter, type ToolUpdateParams, ToolsResource, type ToolsSettings, type TranscriptEvent, type TransferCallTool, type UpdateWebhookResponse, type UpdateWebhooksParams, ValidationError, WebSocketError, type WebhookConfig, type WebhookLog };
|