@vapi-ai/web 1.0.211 → 1.0.213
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 +376 -138
- package/dist/api.d.ts +318 -95
- package/dist/api.js +30 -15
- package/dist/vapi.js +6 -2
- package/package.json +2 -2
- package/vapi.ts +6 -2
package/dist/api.js
CHANGED
|
@@ -171,8 +171,9 @@ class Api extends HttpClient {
|
|
|
171
171
|
* @name CallControllerFindAll
|
|
172
172
|
* @summary List Calls
|
|
173
173
|
* @request GET:/call
|
|
174
|
+
* @secure
|
|
174
175
|
*/
|
|
175
|
-
callControllerFindAll: (params = {}) => this.request(Object.assign({ path: `/call`, method: "GET", format: "json" }, params)),
|
|
176
|
+
callControllerFindAll: (params = {}) => this.request(Object.assign({ path: `/call`, method: "GET", secure: true, format: "json" }, params)),
|
|
176
177
|
/**
|
|
177
178
|
* No description
|
|
178
179
|
*
|
|
@@ -180,8 +181,9 @@ class Api extends HttpClient {
|
|
|
180
181
|
* @name CallControllerFindOne
|
|
181
182
|
* @summary Get Call
|
|
182
183
|
* @request GET:/call/{id}
|
|
184
|
+
* @secure
|
|
183
185
|
*/
|
|
184
|
-
callControllerFindOne: (id, params = {}) => this.request(Object.assign({ path: `/call/${id}`, method: "GET", format: "json" }, params)),
|
|
186
|
+
callControllerFindOne: (id, params = {}) => this.request(Object.assign({ path: `/call/${id}`, method: "GET", secure: true, format: "json" }, params)),
|
|
185
187
|
/**
|
|
186
188
|
* No description
|
|
187
189
|
*
|
|
@@ -189,8 +191,9 @@ class Api extends HttpClient {
|
|
|
189
191
|
* @name CallControllerCreatePhoneCall
|
|
190
192
|
* @summary Create Phone Call
|
|
191
193
|
* @request POST:/call/phone
|
|
194
|
+
* @secure
|
|
192
195
|
*/
|
|
193
|
-
callControllerCreatePhoneCall: (data, params = {}) => this.request(Object.assign({ path: `/call/phone`, method: "POST", body: data, type: ContentType.Json, format: "json" }, params)),
|
|
196
|
+
callControllerCreatePhoneCall: (data, params = {}) => this.request(Object.assign({ path: `/call/phone`, method: "POST", body: data, secure: true, type: ContentType.Json, format: "json" }, params)),
|
|
194
197
|
/**
|
|
195
198
|
* No description
|
|
196
199
|
*
|
|
@@ -198,8 +201,9 @@ class Api extends HttpClient {
|
|
|
198
201
|
* @name CallControllerCreateWebCall
|
|
199
202
|
* @summary Create Web Call
|
|
200
203
|
* @request POST:/call/web
|
|
204
|
+
* @secure
|
|
201
205
|
*/
|
|
202
|
-
callControllerCreateWebCall: (data, params = {}) => this.request(Object.assign({ path: `/call/web`, method: "POST", body: data, type: ContentType.Json, format: "json" }, params)),
|
|
206
|
+
callControllerCreateWebCall: (data, params = {}) => this.request(Object.assign({ path: `/call/web`, method: "POST", body: data, secure: true, type: ContentType.Json, format: "json" }, params)),
|
|
203
207
|
};
|
|
204
208
|
this.assistant = {
|
|
205
209
|
/**
|
|
@@ -209,8 +213,9 @@ class Api extends HttpClient {
|
|
|
209
213
|
* @name AssistantControllerCreate
|
|
210
214
|
* @summary Create Assistant
|
|
211
215
|
* @request POST:/assistant
|
|
216
|
+
* @secure
|
|
212
217
|
*/
|
|
213
|
-
assistantControllerCreate: (data, params = {}) => this.request(Object.assign({ path: `/assistant`, method: "POST", body: data, type: ContentType.Json, format: "json" }, params)),
|
|
218
|
+
assistantControllerCreate: (data, params = {}) => this.request(Object.assign({ path: `/assistant`, method: "POST", body: data, secure: true, type: ContentType.Json, format: "json" }, params)),
|
|
214
219
|
/**
|
|
215
220
|
* No description
|
|
216
221
|
*
|
|
@@ -218,8 +223,9 @@ class Api extends HttpClient {
|
|
|
218
223
|
* @name AssistantControllerFindAll
|
|
219
224
|
* @summary List Assistants
|
|
220
225
|
* @request GET:/assistant
|
|
226
|
+
* @secure
|
|
221
227
|
*/
|
|
222
|
-
assistantControllerFindAll: (params = {}) => this.request(Object.assign({ path: `/assistant`, method: "GET", format: "json" }, params)),
|
|
228
|
+
assistantControllerFindAll: (params = {}) => this.request(Object.assign({ path: `/assistant`, method: "GET", secure: true, format: "json" }, params)),
|
|
223
229
|
/**
|
|
224
230
|
* No description
|
|
225
231
|
*
|
|
@@ -227,8 +233,9 @@ class Api extends HttpClient {
|
|
|
227
233
|
* @name AssistantControllerFindOne
|
|
228
234
|
* @summary Get Assistant
|
|
229
235
|
* @request GET:/assistant/{id}
|
|
236
|
+
* @secure
|
|
230
237
|
*/
|
|
231
|
-
assistantControllerFindOne: (id, params = {}) => this.request(Object.assign({ path: `/assistant/${id}`, method: "GET", format: "json" }, params)),
|
|
238
|
+
assistantControllerFindOne: (id, params = {}) => this.request(Object.assign({ path: `/assistant/${id}`, method: "GET", secure: true, format: "json" }, params)),
|
|
232
239
|
/**
|
|
233
240
|
* No description
|
|
234
241
|
*
|
|
@@ -236,8 +243,9 @@ class Api extends HttpClient {
|
|
|
236
243
|
* @name AssistantControllerUpdate
|
|
237
244
|
* @summary Update Assistant
|
|
238
245
|
* @request PATCH:/assistant/{id}
|
|
246
|
+
* @secure
|
|
239
247
|
*/
|
|
240
|
-
assistantControllerUpdate: (id, data, params = {}) => this.request(Object.assign({ path: `/assistant/${id}`, method: "PATCH", body: data, type: ContentType.Json, format: "json" }, params)),
|
|
248
|
+
assistantControllerUpdate: (id, data, params = {}) => this.request(Object.assign({ path: `/assistant/${id}`, method: "PATCH", body: data, secure: true, type: ContentType.Json, format: "json" }, params)),
|
|
241
249
|
/**
|
|
242
250
|
* No description
|
|
243
251
|
*
|
|
@@ -245,8 +253,9 @@ class Api extends HttpClient {
|
|
|
245
253
|
* @name AssistantControllerRemove
|
|
246
254
|
* @summary Delete Assistant
|
|
247
255
|
* @request DELETE:/assistant/{id}
|
|
256
|
+
* @secure
|
|
248
257
|
*/
|
|
249
|
-
assistantControllerRemove: (id, params = {}) => this.request(Object.assign({ path: `/assistant/${id}`, method: "DELETE" }, params)),
|
|
258
|
+
assistantControllerRemove: (id, params = {}) => this.request(Object.assign({ path: `/assistant/${id}`, method: "DELETE", secure: true, format: "json" }, params)),
|
|
250
259
|
};
|
|
251
260
|
this.phoneNumber = {
|
|
252
261
|
/**
|
|
@@ -256,8 +265,9 @@ class Api extends HttpClient {
|
|
|
256
265
|
* @name PhoneNumberControllerBuy
|
|
257
266
|
* @summary Buy Phone Number
|
|
258
267
|
* @request POST:/phone-number/buy
|
|
268
|
+
* @secure
|
|
259
269
|
*/
|
|
260
|
-
phoneNumberControllerBuy: (data, params = {}) => this.request(Object.assign({ path: `/phone-number/buy`, method: "POST", body: data, type: ContentType.Json, format: "json" }, params)),
|
|
270
|
+
phoneNumberControllerBuy: (data, params = {}) => this.request(Object.assign({ path: `/phone-number/buy`, method: "POST", body: data, secure: true, type: ContentType.Json, format: "json" }, params)),
|
|
261
271
|
/**
|
|
262
272
|
* No description
|
|
263
273
|
*
|
|
@@ -265,8 +275,9 @@ class Api extends HttpClient {
|
|
|
265
275
|
* @name PhoneNumberControllerImport
|
|
266
276
|
* @summary Import Twilio Number
|
|
267
277
|
* @request POST:/phone-number/import
|
|
278
|
+
* @secure
|
|
268
279
|
*/
|
|
269
|
-
phoneNumberControllerImport: (data, params = {}) => this.request(Object.assign({ path: `/phone-number/import`, method: "POST", body: data, type: ContentType.Json, format: "json" }, params)),
|
|
280
|
+
phoneNumberControllerImport: (data, params = {}) => this.request(Object.assign({ path: `/phone-number/import`, method: "POST", body: data, secure: true, type: ContentType.Json, format: "json" }, params)),
|
|
270
281
|
/**
|
|
271
282
|
* No description
|
|
272
283
|
*
|
|
@@ -274,8 +285,9 @@ class Api extends HttpClient {
|
|
|
274
285
|
* @name PhoneNumberControllerFindAll
|
|
275
286
|
* @summary List Phone Numbers
|
|
276
287
|
* @request GET:/phone-number
|
|
288
|
+
* @secure
|
|
277
289
|
*/
|
|
278
|
-
phoneNumberControllerFindAll: (params = {}) => this.request(Object.assign({ path: `/phone-number`, method: "GET", format: "json" }, params)),
|
|
290
|
+
phoneNumberControllerFindAll: (params = {}) => this.request(Object.assign({ path: `/phone-number`, method: "GET", secure: true, format: "json" }, params)),
|
|
279
291
|
/**
|
|
280
292
|
* No description
|
|
281
293
|
*
|
|
@@ -283,8 +295,9 @@ class Api extends HttpClient {
|
|
|
283
295
|
* @name PhoneNumberControllerFindOne
|
|
284
296
|
* @summary Get Phone Number
|
|
285
297
|
* @request GET:/phone-number/{id}
|
|
298
|
+
* @secure
|
|
286
299
|
*/
|
|
287
|
-
phoneNumberControllerFindOne: (id, params = {}) => this.request(Object.assign({ path: `/phone-number/${id}`, method: "GET", format: "json" }, params)),
|
|
300
|
+
phoneNumberControllerFindOne: (id, params = {}) => this.request(Object.assign({ path: `/phone-number/${id}`, method: "GET", secure: true, format: "json" }, params)),
|
|
288
301
|
/**
|
|
289
302
|
* No description
|
|
290
303
|
*
|
|
@@ -292,8 +305,9 @@ class Api extends HttpClient {
|
|
|
292
305
|
* @name PhoneNumberControllerUpdate
|
|
293
306
|
* @summary Update Phone Number
|
|
294
307
|
* @request PATCH:/phone-number/{id}
|
|
308
|
+
* @secure
|
|
295
309
|
*/
|
|
296
|
-
phoneNumberControllerUpdate: (id, data, params = {}) => this.request(Object.assign({ path: `/phone-number/${id}`, method: "PATCH", body: data, type: ContentType.Json, format: "json" }, params)),
|
|
310
|
+
phoneNumberControllerUpdate: (id, data, params = {}) => this.request(Object.assign({ path: `/phone-number/${id}`, method: "PATCH", body: data, secure: true, type: ContentType.Json, format: "json" }, params)),
|
|
297
311
|
/**
|
|
298
312
|
* No description
|
|
299
313
|
*
|
|
@@ -301,8 +315,9 @@ class Api extends HttpClient {
|
|
|
301
315
|
* @name PhoneNumberControllerRemove
|
|
302
316
|
* @summary Delete Phone Number
|
|
303
317
|
* @request DELETE:/phone-number/{id}
|
|
318
|
+
* @secure
|
|
304
319
|
*/
|
|
305
|
-
phoneNumberControllerRemove: (id, params = {}) => this.request(Object.assign({ path: `/phone-number/${id}`, method: "DELETE" }, params)),
|
|
320
|
+
phoneNumberControllerRemove: (id, params = {}) => this.request(Object.assign({ path: `/phone-number/${id}`, method: "DELETE", secure: true }, params)),
|
|
306
321
|
};
|
|
307
322
|
}
|
|
308
323
|
}
|
package/dist/vapi.js
CHANGED
|
@@ -69,7 +69,7 @@ class Vapi extends events_1.default {
|
|
|
69
69
|
})
|
|
70
70
|
.then(({ data }) => __awaiter(this, void 0, void 0, function* () {
|
|
71
71
|
var _a;
|
|
72
|
-
const {
|
|
72
|
+
const { webCallUrl } = data;
|
|
73
73
|
this.call = daily_js_1.default.createCallObject({
|
|
74
74
|
audioSource: true,
|
|
75
75
|
videoSource: false,
|
|
@@ -105,7 +105,10 @@ class Vapi extends events_1.default {
|
|
|
105
105
|
return;
|
|
106
106
|
subscribeToTracks(e, this.call);
|
|
107
107
|
});
|
|
108
|
-
yield this.call.join({
|
|
108
|
+
yield this.call.join({
|
|
109
|
+
url: webCallUrl,
|
|
110
|
+
subscribeToTracksAutomatically: false,
|
|
111
|
+
});
|
|
109
112
|
this.call.startRemoteParticipantsAudioLevelObserver();
|
|
110
113
|
this.call.on("remote-participants-audio-level", (e) => this.handleRemoteParticipantsAudioLevel(e));
|
|
111
114
|
this.call.updateInputSettings({
|
|
@@ -119,6 +122,7 @@ class Vapi extends events_1.default {
|
|
|
119
122
|
.catch((res) => {
|
|
120
123
|
console.error(res.error);
|
|
121
124
|
this.emit("error", res.error);
|
|
125
|
+
this.started = false;
|
|
122
126
|
});
|
|
123
127
|
}
|
|
124
128
|
handleRemoteParticipantsAudioLevel(e) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vapi-ai/web",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.213",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "dist/vapi.js",
|
|
6
6
|
"types": "dist/vapi.d.ts",
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
},
|
|
23
23
|
"homepage": "https://github.com/VapiAI/snippet#readme",
|
|
24
24
|
"dependencies": {
|
|
25
|
-
"@daily-co/daily-js": "^0.
|
|
25
|
+
"@daily-co/daily-js": "^0.53.0",
|
|
26
26
|
"events": "^3.3.0"
|
|
27
27
|
},
|
|
28
28
|
"devDependencies": {
|
package/vapi.ts
CHANGED
|
@@ -65,7 +65,7 @@ export default class Vapi extends EventEmitter {
|
|
|
65
65
|
assistantId: typeof assistant === "string" ? assistant : undefined,
|
|
66
66
|
})
|
|
67
67
|
.then(async ({ data }) => {
|
|
68
|
-
const {
|
|
68
|
+
const { webCallUrl } = data;
|
|
69
69
|
|
|
70
70
|
this.call = DailyIframe.createCallObject({
|
|
71
71
|
audioSource: true,
|
|
@@ -103,7 +103,10 @@ export default class Vapi extends EventEmitter {
|
|
|
103
103
|
subscribeToTracks(e, this.call);
|
|
104
104
|
});
|
|
105
105
|
|
|
106
|
-
await this.call.join({
|
|
106
|
+
await this.call.join({
|
|
107
|
+
url: webCallUrl,
|
|
108
|
+
subscribeToTracksAutomatically: false,
|
|
109
|
+
});
|
|
107
110
|
|
|
108
111
|
this.call.startRemoteParticipantsAudioLevelObserver();
|
|
109
112
|
this.call.on("remote-participants-audio-level", (e) =>
|
|
@@ -121,6 +124,7 @@ export default class Vapi extends EventEmitter {
|
|
|
121
124
|
.catch((res) => {
|
|
122
125
|
console.error(res.error);
|
|
123
126
|
this.emit("error", res.error);
|
|
127
|
+
this.started = false;
|
|
124
128
|
});
|
|
125
129
|
}
|
|
126
130
|
|