@vapi-ai/web 2.2.7 → 2.3.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/api.ts +959 -893
- package/dist/api.d.ts +830 -582
- package/dist/api.js +17 -0
- package/dist/vapi.d.ts +2 -2
- package/dist/vapi.js +5 -3
- package/package.json +3 -2
- package/vapi.ts +6 -2
package/dist/api.js
CHANGED
|
@@ -498,6 +498,23 @@ class Api extends HttpClient {
|
|
|
498
498
|
format: 'json',
|
|
499
499
|
...params,
|
|
500
500
|
}),
|
|
501
|
+
/**
|
|
502
|
+
* No description
|
|
503
|
+
*
|
|
504
|
+
* @tags Assistants
|
|
505
|
+
* @name AssistantControllerFindVersions
|
|
506
|
+
* @summary List Assistant Versions
|
|
507
|
+
* @request GET:/assistant/{id}/version
|
|
508
|
+
* @secure
|
|
509
|
+
*/
|
|
510
|
+
assistantControllerFindVersions: (id, query, params = {}) => this.request({
|
|
511
|
+
path: `/assistant/${id}/version`,
|
|
512
|
+
method: 'GET',
|
|
513
|
+
query: query,
|
|
514
|
+
secure: true,
|
|
515
|
+
format: 'json',
|
|
516
|
+
...params,
|
|
517
|
+
}),
|
|
501
518
|
};
|
|
502
519
|
phoneNumber = {
|
|
503
520
|
/**
|
package/dist/vapi.d.ts
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import type { ChatCompletionMessageParam } from 'openai/resources';
|
|
3
3
|
import { DailyCall, DailyAdvancedConfig, DailyFactoryOptions, DailyParticipant, DailyVideoSendSettings } from '@daily-co/daily-js';
|
|
4
4
|
import EventEmitter from 'events';
|
|
5
|
-
import { Call, CreateSquadDTO, CreateAssistantDTO, AssistantOverrides } from './api';
|
|
5
|
+
import { Call, CreateSquadDTO, CreateAssistantDTO, AssistantOverrides, CreateWorkflowDTO } from './api';
|
|
6
6
|
export interface AddMessageMessage {
|
|
7
7
|
type: 'add-message';
|
|
8
8
|
message: ChatCompletionMessageParam;
|
|
@@ -49,7 +49,7 @@ export default class Vapi extends VapiEventEmitter {
|
|
|
49
49
|
private cleanup;
|
|
50
50
|
private isMobileDevice;
|
|
51
51
|
private sleep;
|
|
52
|
-
start(assistant?: CreateAssistantDTO | string, assistantOverrides?: AssistantOverrides, squad?: CreateSquadDTO | string): Promise<Call | null>;
|
|
52
|
+
start(assistant?: CreateAssistantDTO | string, assistantOverrides?: AssistantOverrides, squad?: CreateSquadDTO | string, workflow?: CreateWorkflowDTO | string): Promise<Call | null>;
|
|
53
53
|
private onAppMessage;
|
|
54
54
|
private handleRemoteParticipantsAudioLevel;
|
|
55
55
|
stop(): void;
|
package/dist/vapi.js
CHANGED
|
@@ -87,9 +87,9 @@ class Vapi extends VapiEventEmitter {
|
|
|
87
87
|
async sleep(ms) {
|
|
88
88
|
return new Promise((resolve) => setTimeout(resolve, ms));
|
|
89
89
|
}
|
|
90
|
-
async start(assistant, assistantOverrides, squad) {
|
|
91
|
-
if (!assistant && !squad) {
|
|
92
|
-
throw new Error('Assistant or Squad must be provided.');
|
|
90
|
+
async start(assistant, assistantOverrides, squad, workflow) {
|
|
91
|
+
if (!assistant && !squad && !workflow) {
|
|
92
|
+
throw new Error('Assistant or Squad or Workflow must be provided.');
|
|
93
93
|
}
|
|
94
94
|
if (this.started) {
|
|
95
95
|
return null;
|
|
@@ -102,6 +102,8 @@ class Vapi extends VapiEventEmitter {
|
|
|
102
102
|
assistantOverrides,
|
|
103
103
|
squad: typeof squad === 'string' ? undefined : squad,
|
|
104
104
|
squadId: typeof squad === 'string' ? squad : undefined,
|
|
105
|
+
workflow: typeof workflow === 'string' ? undefined : workflow,
|
|
106
|
+
workflowId: typeof workflow === 'string' ? workflow : undefined,
|
|
105
107
|
})).data;
|
|
106
108
|
if (this.call) {
|
|
107
109
|
this.cleanup();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vapi-ai/web",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.3.0",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "dist/vapi.js",
|
|
6
6
|
"types": "dist/vapi.d.ts",
|
|
@@ -9,7 +9,8 @@
|
|
|
9
9
|
"build": "tsc && tsc --declaration",
|
|
10
10
|
"start": "npm run generate-api && npm run build && node dist/vapi.js",
|
|
11
11
|
"generate-api": "./generate-api.sh",
|
|
12
|
-
"update": "./update.sh"
|
|
12
|
+
"update": "./update.sh",
|
|
13
|
+
"generate-local-build": "npm install && npm run build && npm pack"
|
|
13
14
|
},
|
|
14
15
|
"repository": {
|
|
15
16
|
"type": "git",
|
package/vapi.ts
CHANGED
|
@@ -17,6 +17,7 @@ import {
|
|
|
17
17
|
CreateSquadDTO,
|
|
18
18
|
CreateAssistantDTO,
|
|
19
19
|
AssistantOverrides,
|
|
20
|
+
CreateWorkflowDTO,
|
|
20
21
|
} from './api';
|
|
21
22
|
import { client } from './client';
|
|
22
23
|
|
|
@@ -197,9 +198,10 @@ export default class Vapi extends VapiEventEmitter {
|
|
|
197
198
|
assistant?: CreateAssistantDTO | string,
|
|
198
199
|
assistantOverrides?: AssistantOverrides,
|
|
199
200
|
squad?: CreateSquadDTO | string,
|
|
201
|
+
workflow?: CreateWorkflowDTO | string,
|
|
200
202
|
): Promise<Call | null> {
|
|
201
|
-
if (!assistant && !squad) {
|
|
202
|
-
throw new Error('Assistant or Squad must be provided.');
|
|
203
|
+
if (!assistant && !squad && !workflow) {
|
|
204
|
+
throw new Error('Assistant or Squad or Workflow must be provided.');
|
|
203
205
|
}
|
|
204
206
|
|
|
205
207
|
if (this.started) {
|
|
@@ -215,6 +217,8 @@ export default class Vapi extends VapiEventEmitter {
|
|
|
215
217
|
assistantOverrides,
|
|
216
218
|
squad: typeof squad === 'string' ? undefined : squad,
|
|
217
219
|
squadId: typeof squad === 'string' ? squad : undefined,
|
|
220
|
+
workflow: typeof workflow === 'string' ? undefined : workflow,
|
|
221
|
+
workflowId: typeof workflow === 'string' ? workflow : undefined,
|
|
218
222
|
})
|
|
219
223
|
).data;
|
|
220
224
|
|