@vapi-ai/web 2.2.4 → 2.2.6
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/api.ts +11566 -6375
- package/dist/api.d.ts +3184 -648
- package/dist/api.js +67 -0
- package/dist/vapi.d.ts +3 -2
- package/dist/vapi.js +3 -2
- package/generate-api.sh +11 -0
- package/package.json +2 -2
- package/vapi.ts +5 -3
package/dist/api.js
CHANGED
|
@@ -1783,6 +1783,56 @@ class Api extends HttpClient {
|
|
|
1783
1783
|
format: 'json',
|
|
1784
1784
|
...params,
|
|
1785
1785
|
}),
|
|
1786
|
+
/**
|
|
1787
|
+
* No description
|
|
1788
|
+
*
|
|
1789
|
+
* @tags Credentials
|
|
1790
|
+
* @name CredentialControllerGenerateSession
|
|
1791
|
+
* @summary Generate a credential session
|
|
1792
|
+
* @request POST:/credential/session
|
|
1793
|
+
* @secure
|
|
1794
|
+
*/
|
|
1795
|
+
credentialControllerGenerateSession: (data, params = {}) => this.request({
|
|
1796
|
+
path: `/credential/session`,
|
|
1797
|
+
method: 'POST',
|
|
1798
|
+
body: data,
|
|
1799
|
+
secure: true,
|
|
1800
|
+
type: ContentType.Json,
|
|
1801
|
+
format: 'json',
|
|
1802
|
+
...params,
|
|
1803
|
+
}),
|
|
1804
|
+
/**
|
|
1805
|
+
* No description
|
|
1806
|
+
*
|
|
1807
|
+
* @tags Credentials
|
|
1808
|
+
* @name CredentialControllerHandleWebhook
|
|
1809
|
+
* @summary Handle credential webhook
|
|
1810
|
+
* @request POST:/credential/webhook
|
|
1811
|
+
*/
|
|
1812
|
+
credentialControllerHandleWebhook: (data, params = {}) => this.request({
|
|
1813
|
+
path: `/credential/webhook`,
|
|
1814
|
+
method: 'POST',
|
|
1815
|
+
body: data,
|
|
1816
|
+
type: ContentType.Json,
|
|
1817
|
+
...params,
|
|
1818
|
+
}),
|
|
1819
|
+
/**
|
|
1820
|
+
* No description
|
|
1821
|
+
*
|
|
1822
|
+
* @tags Credentials
|
|
1823
|
+
* @name CredentialControllerTriggerCredentialAction
|
|
1824
|
+
* @summary Trigger a credential action
|
|
1825
|
+
* @request POST:/credential/trigger
|
|
1826
|
+
* @secure
|
|
1827
|
+
*/
|
|
1828
|
+
credentialControllerTriggerCredentialAction: (data, params = {}) => this.request({
|
|
1829
|
+
path: `/credential/trigger`,
|
|
1830
|
+
method: 'POST',
|
|
1831
|
+
body: data,
|
|
1832
|
+
secure: true,
|
|
1833
|
+
type: ContentType.Json,
|
|
1834
|
+
...params,
|
|
1835
|
+
}),
|
|
1786
1836
|
};
|
|
1787
1837
|
template = {
|
|
1788
1838
|
/**
|
|
@@ -1955,6 +2005,23 @@ class Api extends HttpClient {
|
|
|
1955
2005
|
format: 'json',
|
|
1956
2006
|
...params,
|
|
1957
2007
|
}),
|
|
2008
|
+
/**
|
|
2009
|
+
* No description
|
|
2010
|
+
*
|
|
2011
|
+
* @tags Voice Library
|
|
2012
|
+
* @name VoiceLibraryControllerVoiceLibraryCreateSesameVoice
|
|
2013
|
+
* @summary Create a new voice in the Voice Library using Sesame
|
|
2014
|
+
* @request POST:/voice-library/create-sesame-voice
|
|
2015
|
+
* @secure
|
|
2016
|
+
*/
|
|
2017
|
+
voiceLibraryControllerVoiceLibraryCreateSesameVoice: (data, params = {}) => this.request({
|
|
2018
|
+
path: `/voice-library/create-sesame-voice`,
|
|
2019
|
+
method: 'POST',
|
|
2020
|
+
body: data,
|
|
2021
|
+
secure: true,
|
|
2022
|
+
type: ContentType.Json,
|
|
2023
|
+
...params,
|
|
2024
|
+
}),
|
|
1958
2025
|
};
|
|
1959
2026
|
provider = {
|
|
1960
2027
|
/**
|
package/dist/vapi.d.ts
CHANGED
|
@@ -16,6 +16,7 @@ export interface SayMessage {
|
|
|
16
16
|
type: 'say';
|
|
17
17
|
message: string;
|
|
18
18
|
endCallAfterSpoken?: boolean;
|
|
19
|
+
interruptionsEnabled?: boolean;
|
|
19
20
|
}
|
|
20
21
|
type VapiClientToServerMessage = AddMessageMessage | ControlMessages | SayMessage;
|
|
21
22
|
type VapiEventNames = 'call-end' | 'call-start' | 'volume-level' | 'speech-start' | 'speech-end' | 'message' | 'video' | 'error' | 'daily-participant-updated';
|
|
@@ -44,7 +45,7 @@ export default class Vapi extends VapiEventEmitter {
|
|
|
44
45
|
private dailyCallConfig;
|
|
45
46
|
private dailyCallObject;
|
|
46
47
|
private hasEmittedCallEndedStatus;
|
|
47
|
-
constructor(apiToken: string, apiBaseUrl?: string, dailyCallConfig?: Pick<DailyAdvancedConfig, 'avoidEval' | 'alwaysIncludeMicInPermissionPrompt'>, dailyCallObject?: Pick<DailyFactoryOptions, 'audioSource'>);
|
|
48
|
+
constructor(apiToken: string, apiBaseUrl?: string, dailyCallConfig?: Pick<DailyAdvancedConfig, 'avoidEval' | 'alwaysIncludeMicInPermissionPrompt'>, dailyCallObject?: Pick<DailyFactoryOptions, 'audioSource' | 'startAudioOff'>);
|
|
48
49
|
private cleanup;
|
|
49
50
|
private isMobileDevice;
|
|
50
51
|
private sleep;
|
|
@@ -55,7 +56,7 @@ export default class Vapi extends VapiEventEmitter {
|
|
|
55
56
|
send(message: VapiClientToServerMessage): void;
|
|
56
57
|
setMuted(mute: boolean): void;
|
|
57
58
|
isMuted(): boolean;
|
|
58
|
-
say(message: string, endCallAfterSpoken?: boolean): void;
|
|
59
|
+
say(message: string, endCallAfterSpoken?: boolean, interruptionsEnabled?: boolean): void;
|
|
59
60
|
setInputDevicesAsync(options: Parameters<DailyCall['setInputDevicesAsync']>[0]): void;
|
|
60
61
|
increaseMicLevel(gain: number): Promise<void>;
|
|
61
62
|
setOutputDeviceAsync(options: Parameters<DailyCall['setOutputDeviceAsync']>[0]): void;
|
package/dist/vapi.js
CHANGED
|
@@ -107,7 +107,7 @@ class Vapi extends VapiEventEmitter {
|
|
|
107
107
|
this.cleanup();
|
|
108
108
|
}
|
|
109
109
|
const isVideoRecordingEnabled = webCall?.artifactPlan?.videoRecordingEnabled ?? false;
|
|
110
|
-
const isVideoEnabled = webCall
|
|
110
|
+
const isVideoEnabled = webCall?.assistant?.voice?.provider === 'tavus';
|
|
111
111
|
this.call = daily_js_1.default.createCallObject({
|
|
112
112
|
audioSource: this.dailyCallObject.audioSource ?? true,
|
|
113
113
|
videoSource: this.dailyCallObject.videoSource ?? isVideoRecordingEnabled,
|
|
@@ -303,11 +303,12 @@ class Vapi extends VapiEventEmitter {
|
|
|
303
303
|
}
|
|
304
304
|
return this.call.localAudio() === false;
|
|
305
305
|
}
|
|
306
|
-
say(message, endCallAfterSpoken) {
|
|
306
|
+
say(message, endCallAfterSpoken, interruptionsEnabled) {
|
|
307
307
|
this.send({
|
|
308
308
|
type: 'say',
|
|
309
309
|
message,
|
|
310
310
|
endCallAfterSpoken,
|
|
311
|
+
interruptionsEnabled: interruptionsEnabled ?? false,
|
|
311
312
|
});
|
|
312
313
|
}
|
|
313
314
|
setInputDevicesAsync(options) {
|
package/generate-api.sh
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
# Step 1: Manually download the Swagger JSON file
|
|
2
|
+
curl -o ./api-extended-json.json https://api.vapi.ai/api-extended-json
|
|
3
|
+
|
|
4
|
+
# Step 2: Find and replace transcript[transcriptType=\"final\"] with transcript[transcriptType='final']
|
|
5
|
+
sed -i '' 's/transcript\[transcriptType=\\"final\\"\]/transcript[transcriptType='\''final'\'']/g' ./api-extended-json.json
|
|
6
|
+
|
|
7
|
+
# Step 3: Generate TypeScript API using the edited JSON file
|
|
8
|
+
npx swagger-typescript-api -p ./api-extended-json.json -o . -n api.ts
|
|
9
|
+
|
|
10
|
+
# Step 4: Remove the edited JSON file
|
|
11
|
+
rm ./api-extended-json.json
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vapi-ai/web",
|
|
3
|
-
"version": "2.2.
|
|
3
|
+
"version": "2.2.6",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "dist/vapi.js",
|
|
6
6
|
"types": "dist/vapi.d.ts",
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
"test": "jest",
|
|
9
9
|
"build": "tsc && tsc --declaration",
|
|
10
10
|
"start": "npm run generate-api && npm run build && node dist/vapi.js",
|
|
11
|
-
"generate-api": "
|
|
11
|
+
"generate-api": "./generate-api.sh",
|
|
12
12
|
"update": "./update.sh"
|
|
13
13
|
},
|
|
14
14
|
"repository": {
|
package/vapi.ts
CHANGED
|
@@ -35,6 +35,7 @@ export interface SayMessage {
|
|
|
35
35
|
type: 'say';
|
|
36
36
|
message: string;
|
|
37
37
|
endCallAfterSpoken?: boolean;
|
|
38
|
+
interruptionsEnabled?: boolean;
|
|
38
39
|
}
|
|
39
40
|
|
|
40
41
|
type VapiClientToServerMessage =
|
|
@@ -161,7 +162,7 @@ export default class Vapi extends VapiEventEmitter {
|
|
|
161
162
|
DailyAdvancedConfig,
|
|
162
163
|
'avoidEval' | 'alwaysIncludeMicInPermissionPrompt'
|
|
163
164
|
>,
|
|
164
|
-
dailyCallObject?: Pick<DailyFactoryOptions, 'audioSource'>,
|
|
165
|
+
dailyCallObject?: Pick<DailyFactoryOptions, 'audioSource' | 'startAudioOff'>,
|
|
165
166
|
) {
|
|
166
167
|
super();
|
|
167
168
|
client.baseUrl = apiBaseUrl ?? 'https://api.vapi.ai';
|
|
@@ -224,7 +225,7 @@ export default class Vapi extends VapiEventEmitter {
|
|
|
224
225
|
const isVideoRecordingEnabled =
|
|
225
226
|
webCall?.artifactPlan?.videoRecordingEnabled ?? false;
|
|
226
227
|
|
|
227
|
-
const isVideoEnabled = webCall
|
|
228
|
+
const isVideoEnabled = webCall?.assistant?.voice?.provider === 'tavus';
|
|
228
229
|
|
|
229
230
|
this.call = DailyIframe.createCallObject({
|
|
230
231
|
audioSource: this.dailyCallObject.audioSource ?? true,
|
|
@@ -455,11 +456,12 @@ export default class Vapi extends VapiEventEmitter {
|
|
|
455
456
|
return this.call.localAudio() === false;
|
|
456
457
|
}
|
|
457
458
|
|
|
458
|
-
public say(message: string, endCallAfterSpoken?: boolean) {
|
|
459
|
+
public say(message: string, endCallAfterSpoken?: boolean, interruptionsEnabled?: boolean) {
|
|
459
460
|
this.send({
|
|
460
461
|
type: 'say',
|
|
461
462
|
message,
|
|
462
463
|
endCallAfterSpoken,
|
|
464
|
+
interruptionsEnabled: interruptionsEnabled ?? false,
|
|
463
465
|
});
|
|
464
466
|
}
|
|
465
467
|
|