@absolutejs/voice 0.0.22-beta.106 → 0.0.22-beta.108
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/dist/campaign.d.ts +449 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +460 -88
- package/dist/simulationSuite.d.ts +15 -0
- package/package.json +1 -1
|
@@ -0,0 +1,449 @@
|
|
|
1
|
+
import { Elysia } from 'elysia';
|
|
2
|
+
export type VoiceCampaignStatus = 'canceled' | 'completed' | 'draft' | 'paused' | 'running';
|
|
3
|
+
export type VoiceCampaignRecipientStatus = 'canceled' | 'completed' | 'failed' | 'pending' | 'queued';
|
|
4
|
+
export type VoiceCampaignAttemptStatus = 'canceled' | 'failed' | 'queued' | 'running' | 'succeeded';
|
|
5
|
+
export type VoiceCampaignRecipient = {
|
|
6
|
+
attempts: number;
|
|
7
|
+
completedAt?: number;
|
|
8
|
+
createdAt: number;
|
|
9
|
+
error?: string;
|
|
10
|
+
id: string;
|
|
11
|
+
metadata?: Record<string, unknown>;
|
|
12
|
+
name?: string;
|
|
13
|
+
phone: string;
|
|
14
|
+
status: VoiceCampaignRecipientStatus;
|
|
15
|
+
updatedAt: number;
|
|
16
|
+
variables?: Record<string, string | number | boolean | undefined>;
|
|
17
|
+
};
|
|
18
|
+
export type VoiceCampaignAttempt = {
|
|
19
|
+
campaignId: string;
|
|
20
|
+
completedAt?: number;
|
|
21
|
+
createdAt: number;
|
|
22
|
+
error?: string;
|
|
23
|
+
externalCallId?: string;
|
|
24
|
+
id: string;
|
|
25
|
+
metadata?: Record<string, unknown>;
|
|
26
|
+
recipientId: string;
|
|
27
|
+
startedAt?: number;
|
|
28
|
+
status: VoiceCampaignAttemptStatus;
|
|
29
|
+
updatedAt: number;
|
|
30
|
+
};
|
|
31
|
+
export type VoiceCampaign = {
|
|
32
|
+
createdAt: number;
|
|
33
|
+
description?: string;
|
|
34
|
+
id: string;
|
|
35
|
+
maxAttempts: number;
|
|
36
|
+
maxConcurrentAttempts: number;
|
|
37
|
+
metadata?: Record<string, unknown>;
|
|
38
|
+
name: string;
|
|
39
|
+
status: VoiceCampaignStatus;
|
|
40
|
+
updatedAt: number;
|
|
41
|
+
};
|
|
42
|
+
export type VoiceCampaignRecord = {
|
|
43
|
+
attempts: VoiceCampaignAttempt[];
|
|
44
|
+
campaign: VoiceCampaign;
|
|
45
|
+
recipients: VoiceCampaignRecipient[];
|
|
46
|
+
};
|
|
47
|
+
export type VoiceCampaignStore = {
|
|
48
|
+
get: (id: string) => Promise<VoiceCampaignRecord | undefined> | VoiceCampaignRecord | undefined;
|
|
49
|
+
list: () => Promise<VoiceCampaignRecord[]> | VoiceCampaignRecord[];
|
|
50
|
+
remove: (id: string) => Promise<void> | void;
|
|
51
|
+
set: (id: string, record: VoiceCampaignRecord) => Promise<void> | void;
|
|
52
|
+
};
|
|
53
|
+
export type VoiceCampaignDialerInput = {
|
|
54
|
+
attempt: VoiceCampaignAttempt;
|
|
55
|
+
campaign: VoiceCampaign;
|
|
56
|
+
recipient: VoiceCampaignRecipient;
|
|
57
|
+
};
|
|
58
|
+
export type VoiceCampaignDialerResult = {
|
|
59
|
+
externalCallId?: string;
|
|
60
|
+
metadata?: Record<string, unknown>;
|
|
61
|
+
status?: 'queued' | 'running' | 'succeeded';
|
|
62
|
+
};
|
|
63
|
+
export type VoiceCampaignDialer = (input: VoiceCampaignDialerInput) => Promise<VoiceCampaignDialerResult> | VoiceCampaignDialerResult;
|
|
64
|
+
export type VoiceCampaignCreateInput = {
|
|
65
|
+
description?: string;
|
|
66
|
+
id?: string;
|
|
67
|
+
maxAttempts?: number;
|
|
68
|
+
maxConcurrentAttempts?: number;
|
|
69
|
+
metadata?: Record<string, unknown>;
|
|
70
|
+
name: string;
|
|
71
|
+
};
|
|
72
|
+
export type VoiceCampaignRecipientInput = {
|
|
73
|
+
id?: string;
|
|
74
|
+
metadata?: Record<string, unknown>;
|
|
75
|
+
name?: string;
|
|
76
|
+
phone: string;
|
|
77
|
+
variables?: VoiceCampaignRecipient['variables'];
|
|
78
|
+
};
|
|
79
|
+
export type VoiceCampaignAttemptResultInput = {
|
|
80
|
+
error?: string;
|
|
81
|
+
externalCallId?: string;
|
|
82
|
+
metadata?: Record<string, unknown>;
|
|
83
|
+
status: 'failed' | 'succeeded';
|
|
84
|
+
};
|
|
85
|
+
export type VoiceCampaignTickResult = {
|
|
86
|
+
attempted: number;
|
|
87
|
+
campaignId: string;
|
|
88
|
+
errors: Array<{
|
|
89
|
+
error: string;
|
|
90
|
+
recipientId: string;
|
|
91
|
+
}>;
|
|
92
|
+
started: VoiceCampaignAttempt[];
|
|
93
|
+
};
|
|
94
|
+
export type VoiceCampaignSummary = {
|
|
95
|
+
attempts: {
|
|
96
|
+
failed: number;
|
|
97
|
+
queued: number;
|
|
98
|
+
running: number;
|
|
99
|
+
succeeded: number;
|
|
100
|
+
total: number;
|
|
101
|
+
};
|
|
102
|
+
campaigns: {
|
|
103
|
+
canceled: number;
|
|
104
|
+
completed: number;
|
|
105
|
+
draft: number;
|
|
106
|
+
paused: number;
|
|
107
|
+
running: number;
|
|
108
|
+
total: number;
|
|
109
|
+
};
|
|
110
|
+
recipients: {
|
|
111
|
+
canceled: number;
|
|
112
|
+
completed: number;
|
|
113
|
+
failed: number;
|
|
114
|
+
pending: number;
|
|
115
|
+
queued: number;
|
|
116
|
+
total: number;
|
|
117
|
+
};
|
|
118
|
+
};
|
|
119
|
+
export type VoiceCampaignRuntimeOptions = {
|
|
120
|
+
dialer?: VoiceCampaignDialer;
|
|
121
|
+
store: VoiceCampaignStore;
|
|
122
|
+
};
|
|
123
|
+
export type VoiceCampaignRuntime = {
|
|
124
|
+
addRecipients: (campaignId: string, recipients: VoiceCampaignRecipientInput[]) => Promise<VoiceCampaignRecord>;
|
|
125
|
+
cancel: (campaignId: string) => Promise<VoiceCampaignRecord>;
|
|
126
|
+
completeAttempt: (campaignId: string, attemptId: string, result: VoiceCampaignAttemptResultInput) => Promise<VoiceCampaignRecord>;
|
|
127
|
+
create: (input: VoiceCampaignCreateInput) => Promise<VoiceCampaignRecord>;
|
|
128
|
+
enqueue: (campaignId: string) => Promise<VoiceCampaignRecord>;
|
|
129
|
+
get: (campaignId: string) => Promise<VoiceCampaignRecord | undefined>;
|
|
130
|
+
list: () => Promise<VoiceCampaignRecord[]>;
|
|
131
|
+
pause: (campaignId: string) => Promise<VoiceCampaignRecord>;
|
|
132
|
+
remove: (campaignId: string) => Promise<void>;
|
|
133
|
+
resume: (campaignId: string) => Promise<VoiceCampaignRecord>;
|
|
134
|
+
summarize: () => Promise<VoiceCampaignSummary>;
|
|
135
|
+
tick: (campaignId: string) => Promise<VoiceCampaignTickResult>;
|
|
136
|
+
};
|
|
137
|
+
export type VoiceCampaignRoutesOptions = VoiceCampaignRuntimeOptions & {
|
|
138
|
+
headers?: HeadersInit;
|
|
139
|
+
htmlPath?: false | string;
|
|
140
|
+
name?: string;
|
|
141
|
+
path?: string;
|
|
142
|
+
title?: string;
|
|
143
|
+
};
|
|
144
|
+
export declare const createVoiceMemoryCampaignStore: () => VoiceCampaignStore;
|
|
145
|
+
export declare const summarizeVoiceCampaigns: (records: VoiceCampaignRecord[]) => VoiceCampaignSummary;
|
|
146
|
+
export declare const createVoiceCampaign: (options: VoiceCampaignRuntimeOptions) => VoiceCampaignRuntime;
|
|
147
|
+
export declare const renderVoiceCampaignsHTML: (records: VoiceCampaignRecord[], options?: {
|
|
148
|
+
title?: string;
|
|
149
|
+
}) => string;
|
|
150
|
+
export declare const createVoiceCampaignRoutes: (options: VoiceCampaignRoutesOptions) => Elysia<"", {
|
|
151
|
+
decorator: {};
|
|
152
|
+
store: {};
|
|
153
|
+
derive: {};
|
|
154
|
+
resolve: {};
|
|
155
|
+
}, {
|
|
156
|
+
typebox: {};
|
|
157
|
+
error: {};
|
|
158
|
+
}, {
|
|
159
|
+
schema: {};
|
|
160
|
+
standaloneSchema: {};
|
|
161
|
+
macro: {};
|
|
162
|
+
macroFn: {};
|
|
163
|
+
parser: {};
|
|
164
|
+
response: {};
|
|
165
|
+
}, {
|
|
166
|
+
[x: string]: {
|
|
167
|
+
get: {
|
|
168
|
+
body: unknown;
|
|
169
|
+
params: {};
|
|
170
|
+
query: unknown;
|
|
171
|
+
headers: unknown;
|
|
172
|
+
response: {
|
|
173
|
+
200: {
|
|
174
|
+
campaigns: VoiceCampaignRecord[];
|
|
175
|
+
summary: VoiceCampaignSummary;
|
|
176
|
+
};
|
|
177
|
+
};
|
|
178
|
+
};
|
|
179
|
+
};
|
|
180
|
+
} & {
|
|
181
|
+
[x: string]: {
|
|
182
|
+
post: {
|
|
183
|
+
body: unknown;
|
|
184
|
+
params: {};
|
|
185
|
+
query: unknown;
|
|
186
|
+
headers: unknown;
|
|
187
|
+
response: {
|
|
188
|
+
200: VoiceCampaignRecord;
|
|
189
|
+
};
|
|
190
|
+
};
|
|
191
|
+
};
|
|
192
|
+
} & {
|
|
193
|
+
[x: string]: {
|
|
194
|
+
":campaignId": {
|
|
195
|
+
get: {
|
|
196
|
+
body: unknown;
|
|
197
|
+
params: {
|
|
198
|
+
campaignId: string;
|
|
199
|
+
} & {};
|
|
200
|
+
query: unknown;
|
|
201
|
+
headers: unknown;
|
|
202
|
+
response: {
|
|
203
|
+
422: {
|
|
204
|
+
type: "validation";
|
|
205
|
+
on: string;
|
|
206
|
+
summary?: string;
|
|
207
|
+
message?: string;
|
|
208
|
+
found?: unknown;
|
|
209
|
+
property?: string;
|
|
210
|
+
expected?: string;
|
|
211
|
+
};
|
|
212
|
+
};
|
|
213
|
+
};
|
|
214
|
+
};
|
|
215
|
+
};
|
|
216
|
+
} & {
|
|
217
|
+
[x: string]: {
|
|
218
|
+
":campaignId": {
|
|
219
|
+
delete: {
|
|
220
|
+
body: unknown;
|
|
221
|
+
params: {
|
|
222
|
+
campaignId: string;
|
|
223
|
+
} & {};
|
|
224
|
+
query: unknown;
|
|
225
|
+
headers: unknown;
|
|
226
|
+
response: {
|
|
227
|
+
200: {
|
|
228
|
+
ok: boolean;
|
|
229
|
+
};
|
|
230
|
+
422: {
|
|
231
|
+
type: "validation";
|
|
232
|
+
on: string;
|
|
233
|
+
summary?: string;
|
|
234
|
+
message?: string;
|
|
235
|
+
found?: unknown;
|
|
236
|
+
property?: string;
|
|
237
|
+
expected?: string;
|
|
238
|
+
};
|
|
239
|
+
};
|
|
240
|
+
};
|
|
241
|
+
};
|
|
242
|
+
};
|
|
243
|
+
} & {
|
|
244
|
+
[x: string]: {
|
|
245
|
+
":campaignId": {
|
|
246
|
+
recipients: {
|
|
247
|
+
post: {
|
|
248
|
+
body: unknown;
|
|
249
|
+
params: {
|
|
250
|
+
campaignId: string;
|
|
251
|
+
} & {};
|
|
252
|
+
query: unknown;
|
|
253
|
+
headers: unknown;
|
|
254
|
+
response: {
|
|
255
|
+
200: VoiceCampaignRecord;
|
|
256
|
+
422: {
|
|
257
|
+
type: "validation";
|
|
258
|
+
on: string;
|
|
259
|
+
summary?: string;
|
|
260
|
+
message?: string;
|
|
261
|
+
found?: unknown;
|
|
262
|
+
property?: string;
|
|
263
|
+
expected?: string;
|
|
264
|
+
};
|
|
265
|
+
};
|
|
266
|
+
};
|
|
267
|
+
};
|
|
268
|
+
};
|
|
269
|
+
};
|
|
270
|
+
} & {
|
|
271
|
+
[x: string]: {
|
|
272
|
+
":campaignId": {
|
|
273
|
+
enqueue: {
|
|
274
|
+
post: {
|
|
275
|
+
body: unknown;
|
|
276
|
+
params: {
|
|
277
|
+
campaignId: string;
|
|
278
|
+
} & {};
|
|
279
|
+
query: unknown;
|
|
280
|
+
headers: unknown;
|
|
281
|
+
response: {
|
|
282
|
+
200: VoiceCampaignRecord;
|
|
283
|
+
422: {
|
|
284
|
+
type: "validation";
|
|
285
|
+
on: string;
|
|
286
|
+
summary?: string;
|
|
287
|
+
message?: string;
|
|
288
|
+
found?: unknown;
|
|
289
|
+
property?: string;
|
|
290
|
+
expected?: string;
|
|
291
|
+
};
|
|
292
|
+
};
|
|
293
|
+
};
|
|
294
|
+
};
|
|
295
|
+
};
|
|
296
|
+
};
|
|
297
|
+
} & {
|
|
298
|
+
[x: string]: {
|
|
299
|
+
":campaignId": {
|
|
300
|
+
pause: {
|
|
301
|
+
post: {
|
|
302
|
+
body: unknown;
|
|
303
|
+
params: {
|
|
304
|
+
campaignId: string;
|
|
305
|
+
} & {};
|
|
306
|
+
query: unknown;
|
|
307
|
+
headers: unknown;
|
|
308
|
+
response: {
|
|
309
|
+
200: VoiceCampaignRecord;
|
|
310
|
+
422: {
|
|
311
|
+
type: "validation";
|
|
312
|
+
on: string;
|
|
313
|
+
summary?: string;
|
|
314
|
+
message?: string;
|
|
315
|
+
found?: unknown;
|
|
316
|
+
property?: string;
|
|
317
|
+
expected?: string;
|
|
318
|
+
};
|
|
319
|
+
};
|
|
320
|
+
};
|
|
321
|
+
};
|
|
322
|
+
};
|
|
323
|
+
};
|
|
324
|
+
} & {
|
|
325
|
+
[x: string]: {
|
|
326
|
+
":campaignId": {
|
|
327
|
+
resume: {
|
|
328
|
+
post: {
|
|
329
|
+
body: unknown;
|
|
330
|
+
params: {
|
|
331
|
+
campaignId: string;
|
|
332
|
+
} & {};
|
|
333
|
+
query: unknown;
|
|
334
|
+
headers: unknown;
|
|
335
|
+
response: {
|
|
336
|
+
200: VoiceCampaignRecord;
|
|
337
|
+
422: {
|
|
338
|
+
type: "validation";
|
|
339
|
+
on: string;
|
|
340
|
+
summary?: string;
|
|
341
|
+
message?: string;
|
|
342
|
+
found?: unknown;
|
|
343
|
+
property?: string;
|
|
344
|
+
expected?: string;
|
|
345
|
+
};
|
|
346
|
+
};
|
|
347
|
+
};
|
|
348
|
+
};
|
|
349
|
+
};
|
|
350
|
+
};
|
|
351
|
+
} & {
|
|
352
|
+
[x: string]: {
|
|
353
|
+
":campaignId": {
|
|
354
|
+
cancel: {
|
|
355
|
+
post: {
|
|
356
|
+
body: unknown;
|
|
357
|
+
params: {
|
|
358
|
+
campaignId: string;
|
|
359
|
+
} & {};
|
|
360
|
+
query: unknown;
|
|
361
|
+
headers: unknown;
|
|
362
|
+
response: {
|
|
363
|
+
200: VoiceCampaignRecord;
|
|
364
|
+
422: {
|
|
365
|
+
type: "validation";
|
|
366
|
+
on: string;
|
|
367
|
+
summary?: string;
|
|
368
|
+
message?: string;
|
|
369
|
+
found?: unknown;
|
|
370
|
+
property?: string;
|
|
371
|
+
expected?: string;
|
|
372
|
+
};
|
|
373
|
+
};
|
|
374
|
+
};
|
|
375
|
+
};
|
|
376
|
+
};
|
|
377
|
+
};
|
|
378
|
+
} & {
|
|
379
|
+
[x: string]: {
|
|
380
|
+
":campaignId": {
|
|
381
|
+
tick: {
|
|
382
|
+
post: {
|
|
383
|
+
body: unknown;
|
|
384
|
+
params: {
|
|
385
|
+
campaignId: string;
|
|
386
|
+
} & {};
|
|
387
|
+
query: unknown;
|
|
388
|
+
headers: unknown;
|
|
389
|
+
response: {
|
|
390
|
+
200: VoiceCampaignTickResult;
|
|
391
|
+
422: {
|
|
392
|
+
type: "validation";
|
|
393
|
+
on: string;
|
|
394
|
+
summary?: string;
|
|
395
|
+
message?: string;
|
|
396
|
+
found?: unknown;
|
|
397
|
+
property?: string;
|
|
398
|
+
expected?: string;
|
|
399
|
+
};
|
|
400
|
+
};
|
|
401
|
+
};
|
|
402
|
+
};
|
|
403
|
+
};
|
|
404
|
+
};
|
|
405
|
+
} & {
|
|
406
|
+
[x: string]: {
|
|
407
|
+
":campaignId": {
|
|
408
|
+
attempts: {
|
|
409
|
+
":attemptId": {
|
|
410
|
+
result: {
|
|
411
|
+
post: {
|
|
412
|
+
body: unknown;
|
|
413
|
+
params: {
|
|
414
|
+
campaignId: string;
|
|
415
|
+
attemptId: string;
|
|
416
|
+
} & {};
|
|
417
|
+
query: unknown;
|
|
418
|
+
headers: unknown;
|
|
419
|
+
response: {
|
|
420
|
+
200: VoiceCampaignRecord;
|
|
421
|
+
422: {
|
|
422
|
+
type: "validation";
|
|
423
|
+
on: string;
|
|
424
|
+
summary?: string;
|
|
425
|
+
message?: string;
|
|
426
|
+
found?: unknown;
|
|
427
|
+
property?: string;
|
|
428
|
+
expected?: string;
|
|
429
|
+
};
|
|
430
|
+
};
|
|
431
|
+
};
|
|
432
|
+
};
|
|
433
|
+
};
|
|
434
|
+
};
|
|
435
|
+
};
|
|
436
|
+
};
|
|
437
|
+
}, {
|
|
438
|
+
derive: {};
|
|
439
|
+
resolve: {};
|
|
440
|
+
schema: {};
|
|
441
|
+
standaloneSchema: {};
|
|
442
|
+
response: {};
|
|
443
|
+
}, {
|
|
444
|
+
derive: {};
|
|
445
|
+
resolve: {};
|
|
446
|
+
schema: {};
|
|
447
|
+
standaloneSchema: {};
|
|
448
|
+
response: {};
|
|
449
|
+
}>;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export { voice } from './plugin';
|
|
2
2
|
export { createVoiceAppKit, createVoiceAppKitRoutes, summarizeVoiceAppKitStatus } from './appKit';
|
|
3
|
+
export { createVoiceCampaign, createVoiceCampaignRoutes, createVoiceMemoryCampaignStore, renderVoiceCampaignsHTML, summarizeVoiceCampaigns } from './campaign';
|
|
3
4
|
export { createVoiceAssistant, createVoiceExperiment, summarizeVoiceAssistantRuns } from './assistant';
|
|
4
5
|
export { createVoiceAssistantHealthHTMLHandler, createVoiceAssistantHealthJSONHandler, createVoiceAssistantHealthRoutes, renderVoiceAssistantHealthHTML, summarizeVoiceAssistantHealth } from './assistantHealth';
|
|
5
6
|
export { createVoiceBargeInRoutes, renderVoiceBargeInHTML, summarizeVoiceBargeIn } from './bargeInRoutes';
|
|
@@ -53,6 +54,7 @@ export { resolveVoiceRuntimePreset } from './presets';
|
|
|
53
54
|
export { resolveTurnDetectionConfig, TURN_PROFILE_DEFAULTS } from './turnProfiles';
|
|
54
55
|
export { createVoiceCallReviewFromLiveTelephonyReport, createVoiceCallReviewRecorder, renderVoiceCallReviewHTML, renderVoiceCallReviewMarkdown } from './testing/review';
|
|
55
56
|
export type { VoiceAppKitLink, VoiceAppKitRoutes, VoiceAppKitRoutesOptions, VoiceAppKitStatus, VoiceAppKitStatusOptions, VoiceAppKitStatusReport, VoiceAppKitSurface } from './appKit';
|
|
57
|
+
export type { VoiceCampaign, VoiceCampaignAttempt, VoiceCampaignAttemptResultInput, VoiceCampaignAttemptStatus, VoiceCampaignCreateInput, VoiceCampaignDialer, VoiceCampaignDialerInput, VoiceCampaignDialerResult, VoiceCampaignRecipient, VoiceCampaignRecipientInput, VoiceCampaignRecipientStatus, VoiceCampaignRecord, VoiceCampaignRoutesOptions, VoiceCampaignRuntime, VoiceCampaignRuntimeOptions, VoiceCampaignStatus, VoiceCampaignStore, VoiceCampaignSummary, VoiceCampaignTickResult } from './campaign';
|
|
56
58
|
export type { VoiceBargeInReport, VoiceBargeInRoutesOptions } from './bargeInRoutes';
|
|
57
59
|
export type { VoiceAssistant, VoiceAssistantArtifactPlan, VoiceAssistantExperiment, VoiceAssistantExperimentOptions, VoiceAssistantGuardrailInput, VoiceAssistantGuardrails, VoiceAssistantMemoryLifecycle, VoiceAssistantMemoryLifecycleInput, VoiceAssistantOptions, VoiceAssistantOutputGuardrailInput, VoiceAssistantPreset, VoiceAssistantRunsSummary, VoiceAssistantRunSummary, VoiceAssistantVariant } from './assistant';
|
|
58
60
|
export type { VoiceAssistantHealthFailure, VoiceAssistantHealthHTMLHandlerOptions, VoiceAssistantHealthRoutesOptions, VoiceAssistantHealthSummary, VoiceAssistantHealthSummaryOptions } from './assistantHealth';
|