@vapi-ai/web 2.0.0 → 2.1.1

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/vapi.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  /// <reference types="node" />
2
2
  import { Call, CreateAssistantDTO, CreateSquadDTO, AssistantOverrides } from './api';
3
- import { DailyCall } from '@daily-co/daily-js';
3
+ import { DailyAdvancedConfig, DailyCall } from '@daily-co/daily-js';
4
4
  import type { ChatCompletionMessageParam } from 'openai/resources';
5
5
  import EventEmitter from 'events';
6
6
  export interface AddMessageMessage {
@@ -39,7 +39,8 @@ export default class Vapi extends VapiEventEmitter {
39
39
  private started;
40
40
  private call;
41
41
  private speakingTimeout;
42
- constructor(apiToken: string, apiBaseUrl?: string);
42
+ private dailyCallConfig;
43
+ constructor(apiToken: string, apiBaseUrl?: string, dailyCallConfig?: Pick<DailyAdvancedConfig, 'avoidEval'>);
43
44
  private cleanup;
44
45
  start(assistant?: CreateAssistantDTO | string, assistantOverrides?: AssistantOverrides, squad?: CreateSquadDTO | string): Promise<Call | null>;
45
46
  private onAppMessage;
@@ -51,5 +52,6 @@ export default class Vapi extends VapiEventEmitter {
51
52
  say(message: string, endCallAfterSpoken?: boolean): void;
52
53
  setInputDevicesAsync(options: Parameters<DailyCall['setInputDevicesAsync']>[0]): void;
53
54
  setOutputDeviceAsync(options: Parameters<DailyCall['setOutputDeviceAsync']>[0]): void;
55
+ getDailyCallObject(): DailyCall | null;
54
56
  }
55
57
  export {};
package/dist/vapi.js CHANGED
@@ -60,10 +60,12 @@ class Vapi extends VapiEventEmitter {
60
60
  started = false;
61
61
  call = null;
62
62
  speakingTimeout = null;
63
- constructor(apiToken, apiBaseUrl) {
63
+ dailyCallConfig = {};
64
+ constructor(apiToken, apiBaseUrl, dailyCallConfig) {
64
65
  super();
65
66
  client_1.client.baseUrl = apiBaseUrl ?? 'https://api.vapi.ai';
66
67
  client_1.client.setSecurityData(apiToken);
68
+ this.dailyCallConfig = dailyCallConfig ?? {};
67
69
  }
68
70
  cleanup() {
69
71
  this.started = false;
@@ -94,6 +96,7 @@ class Vapi extends VapiEventEmitter {
94
96
  this.call = daily_js_1.default.createCallObject({
95
97
  audioSource: true,
96
98
  videoSource: isVideoRecordingEnabled,
99
+ dailyConfig: this.dailyCallConfig
97
100
  });
98
101
  this.call.iframe()?.style.setProperty('display', 'none');
99
102
  this.call.on('left-meeting', () => {
@@ -276,5 +279,8 @@ class Vapi extends VapiEventEmitter {
276
279
  setOutputDeviceAsync(options) {
277
280
  this.call?.setOutputDeviceAsync(options);
278
281
  }
282
+ getDailyCallObject() {
283
+ return this.call;
284
+ }
279
285
  }
280
286
  exports.default = Vapi;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vapi-ai/web",
3
- "version": "2.0.0",
3
+ "version": "2.1.1",
4
4
  "description": "",
5
5
  "main": "dist/vapi.js",
6
6
  "types": "dist/vapi.d.ts",
package/update.sh CHANGED
@@ -1 +1 @@
1
- npm version major && npm run build && npm publish && cd ../landing && npm install @vapi-ai/web@latest && cd -
1
+ npm version patch && npm run build && npm publish && cd ../landing && npm install @vapi-ai/web@latest && cd -
package/vapi.ts CHANGED
@@ -1,5 +1,6 @@
1
1
  import { Call, CreateAssistantDTO, CreateSquadDTO, AssistantOverrides } from './api';
2
2
  import DailyIframe, {
3
+ DailyAdvancedConfig,
3
4
  DailyCall,
4
5
  DailyEventObjectAppMessage,
5
6
  DailyEventObjectParticipant,
@@ -108,11 +109,13 @@ export default class Vapi extends VapiEventEmitter {
108
109
  private started: boolean = false;
109
110
  private call: DailyCall | null = null;
110
111
  private speakingTimeout: NodeJS.Timeout | null = null;
112
+ private dailyCallConfig: DailyAdvancedConfig = {}
111
113
 
112
- constructor(apiToken: string, apiBaseUrl?: string) {
114
+ constructor(apiToken: string, apiBaseUrl?: string, dailyCallConfig?: Pick<DailyAdvancedConfig, 'avoidEval'>) {
113
115
  super();
114
116
  client.baseUrl = apiBaseUrl ?? 'https://api.vapi.ai';
115
117
  client.setSecurityData(apiToken);
118
+ this.dailyCallConfig = dailyCallConfig ?? {}
116
119
  }
117
120
 
118
121
  private cleanup() {
@@ -155,6 +158,7 @@ export default class Vapi extends VapiEventEmitter {
155
158
  this.call = DailyIframe.createCallObject({
156
159
  audioSource: true,
157
160
  videoSource: isVideoRecordingEnabled,
161
+ dailyConfig: this.dailyCallConfig
158
162
  });
159
163
  this.call.iframe()?.style.setProperty('display', 'none');
160
164
 
@@ -353,4 +357,8 @@ export default class Vapi extends VapiEventEmitter {
353
357
  public setOutputDeviceAsync(options: Parameters<DailyCall['setOutputDeviceAsync']>[0]) {
354
358
  this.call?.setOutputDeviceAsync(options);
355
359
  }
360
+
361
+ public getDailyCallObject(): DailyCall | null {
362
+ return this.call;
363
+ }
356
364
  }