Skip to content

Commit 541ed6c

Browse files
committed
Release 0.5.0
1 parent 6d1a136 commit 541ed6c

File tree

172 files changed

+2900
-642
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

172 files changed

+2900
-642
lines changed

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@vapi-ai/server-sdk",
3-
"version": "0.4.0",
3+
"version": "0.5.0",
44
"private": false,
55
"repository": "https://github.com/VapiAI/server-sdk-typescript",
66
"main": "./index.js",

reference.md

+6
Original file line numberDiff line numberDiff line change
@@ -19,3 +19,9 @@
1919
## Analytics
2020

2121
## Logs
22+
23+
## TestSuites
24+
25+
## TestSuiteTests
26+
27+
## TestSuiteRuns

src/Client.ts

+23-2
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,14 @@ import { Tools } from "./api/resources/tools/client/Client";
1414
import { Files } from "./api/resources/files/client/Client";
1515
import { Analytics } from "./api/resources/analytics/client/Client";
1616
import { Logs } from "./api/resources/logs/client/Client";
17+
import { TestSuites } from "./api/resources/testSuites/client/Client";
18+
import { TestSuiteTests } from "./api/resources/testSuiteTests/client/Client";
19+
import { TestSuiteRuns } from "./api/resources/testSuiteRuns/client/Client";
1720

1821
export declare namespace VapiClient {
1922
interface Options {
2023
environment?: core.Supplier<environments.VapiEnvironment | string>;
21-
token?: core.Supplier<core.BearerToken | undefined>;
24+
token: core.Supplier<core.BearerToken>;
2225
fetcher?: core.FetchFunction;
2326
}
2427

@@ -35,7 +38,7 @@ export declare namespace VapiClient {
3538
}
3639

3740
export class VapiClient {
38-
constructor(protected readonly _options: VapiClient.Options = {}) {}
41+
constructor(protected readonly _options: VapiClient.Options) {}
3942

4043
protected _calls: Calls | undefined;
4144

@@ -96,4 +99,22 @@ export class VapiClient {
9699
public get logs(): Logs {
97100
return (this._logs ??= new Logs(this._options));
98101
}
102+
103+
protected _testSuites: TestSuites | undefined;
104+
105+
public get testSuites(): TestSuites {
106+
return (this._testSuites ??= new TestSuites(this._options));
107+
}
108+
109+
protected _testSuiteTests: TestSuiteTests | undefined;
110+
111+
public get testSuiteTests(): TestSuiteTests {
112+
return (this._testSuiteTests ??= new TestSuiteTests(this._options));
113+
}
114+
115+
protected _testSuiteRuns: TestSuiteRuns | undefined;
116+
117+
public get testSuiteRuns(): TestSuiteRuns {
118+
return (this._testSuiteRuns ??= new TestSuiteRuns(this._options));
119+
}
99120
}

src/api/resources/analytics/client/Client.ts

+14-13
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,14 @@
44

55
import * as environments from "../../../../environments";
66
import * as core from "../../../../core";
7+
import * as Vapi from "../../../index";
78
import urlJoin from "url-join";
89
import * as errors from "../../../../errors/index";
910

1011
export declare namespace Analytics {
1112
interface Options {
1213
environment?: core.Supplier<environments.VapiEnvironment | string>;
13-
token?: core.Supplier<core.BearerToken | undefined>;
14+
token: core.Supplier<core.BearerToken>;
1415
fetcher?: core.FetchFunction;
1516
}
1617

@@ -27,12 +28,16 @@ export declare namespace Analytics {
2728
}
2829

2930
export class Analytics {
30-
constructor(protected readonly _options: Analytics.Options = {}) {}
31+
constructor(protected readonly _options: Analytics.Options) {}
3132

3233
/**
34+
* @param {Vapi.AnalyticsQueryDto} request
3335
* @param {Analytics.RequestOptions} requestOptions - Request-specific configuration.
3436
*/
35-
public async get(requestOptions?: Analytics.RequestOptions): Promise<void> {
37+
public async get(
38+
request: Vapi.AnalyticsQueryDto,
39+
requestOptions?: Analytics.RequestOptions
40+
): Promise<Vapi.AnalyticsQueryResult[]> {
3641
const _response = await (this._options.fetcher ?? core.fetcher)({
3742
url: urlJoin(
3843
(await core.Supplier.get(this._options.environment)) ?? environments.VapiEnvironment.Default,
@@ -43,20 +48,21 @@ export class Analytics {
4348
Authorization: await this._getAuthorizationHeader(),
4449
"X-Fern-Language": "JavaScript",
4550
"X-Fern-SDK-Name": "@vapi-ai/server-sdk",
46-
"X-Fern-SDK-Version": "0.4.0",
47-
"User-Agent": "@vapi-ai/server-sdk/0.4.0",
51+
"X-Fern-SDK-Version": "0.5.0",
52+
"User-Agent": "@vapi-ai/server-sdk/0.5.0",
4853
"X-Fern-Runtime": core.RUNTIME.type,
4954
"X-Fern-Runtime-Version": core.RUNTIME.version,
5055
...requestOptions?.headers,
5156
},
5257
contentType: "application/json",
5358
requestType: "json",
59+
body: request,
5460
timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
5561
maxRetries: requestOptions?.maxRetries,
5662
abortSignal: requestOptions?.abortSignal,
5763
});
5864
if (_response.ok) {
59-
return;
65+
return _response.body as Vapi.AnalyticsQueryResult[];
6066
}
6167

6268
if (_response.error.reason === "status-code") {
@@ -81,12 +87,7 @@ export class Analytics {
8187
}
8288
}
8389

84-
protected async _getAuthorizationHeader(): Promise<string | undefined> {
85-
const bearer = await core.Supplier.get(this._options.token);
86-
if (bearer != null) {
87-
return `Bearer ${bearer}`;
88-
}
89-
90-
return undefined;
90+
protected async _getAuthorizationHeader(): Promise<string> {
91+
return `Bearer ${await core.Supplier.get(this._options.token)}`;
9192
}
9293
}
+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
export {};
1+
export * from "./requests";

src/api/types/AnalyticsQueryDto.ts src/api/resources/analytics/client/requests/AnalyticsQueryDto.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
* This file was auto-generated by Fern from our API Definition.
33
*/
44

5-
import * as Vapi from "../index";
5+
import * as Vapi from "../../../../index";
66

77
export interface AnalyticsQueryDto {
88
/** This is the list of metric queries you want to perform. */
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export { type AnalyticsQueryDto } from "./AnalyticsQueryDto";

src/api/resources/assistants/client/Client.ts

+14-19
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import * as errors from "../../../../errors/index";
1111
export declare namespace Assistants {
1212
interface Options {
1313
environment?: core.Supplier<environments.VapiEnvironment | string>;
14-
token?: core.Supplier<core.BearerToken | undefined>;
14+
token: core.Supplier<core.BearerToken>;
1515
fetcher?: core.FetchFunction;
1616
}
1717

@@ -28,7 +28,7 @@ export declare namespace Assistants {
2828
}
2929

3030
export class Assistants {
31-
constructor(protected readonly _options: Assistants.Options = {}) {}
31+
constructor(protected readonly _options: Assistants.Options) {}
3232

3333
/**
3434
* @param {Vapi.AssistantsListRequest} request
@@ -96,8 +96,8 @@ export class Assistants {
9696
Authorization: await this._getAuthorizationHeader(),
9797
"X-Fern-Language": "JavaScript",
9898
"X-Fern-SDK-Name": "@vapi-ai/server-sdk",
99-
"X-Fern-SDK-Version": "0.4.0",
100-
"User-Agent": "@vapi-ai/server-sdk/0.4.0",
99+
"X-Fern-SDK-Version": "0.5.0",
100+
"User-Agent": "@vapi-ai/server-sdk/0.5.0",
101101
"X-Fern-Runtime": core.RUNTIME.type,
102102
"X-Fern-Runtime-Version": core.RUNTIME.version,
103103
...requestOptions?.headers,
@@ -153,8 +153,8 @@ export class Assistants {
153153
Authorization: await this._getAuthorizationHeader(),
154154
"X-Fern-Language": "JavaScript",
155155
"X-Fern-SDK-Name": "@vapi-ai/server-sdk",
156-
"X-Fern-SDK-Version": "0.4.0",
157-
"User-Agent": "@vapi-ai/server-sdk/0.4.0",
156+
"X-Fern-SDK-Version": "0.5.0",
157+
"User-Agent": "@vapi-ai/server-sdk/0.5.0",
158158
"X-Fern-Runtime": core.RUNTIME.type,
159159
"X-Fern-Runtime-Version": core.RUNTIME.version,
160160
...requestOptions?.headers,
@@ -207,8 +207,8 @@ export class Assistants {
207207
Authorization: await this._getAuthorizationHeader(),
208208
"X-Fern-Language": "JavaScript",
209209
"X-Fern-SDK-Name": "@vapi-ai/server-sdk",
210-
"X-Fern-SDK-Version": "0.4.0",
211-
"User-Agent": "@vapi-ai/server-sdk/0.4.0",
210+
"X-Fern-SDK-Version": "0.5.0",
211+
"User-Agent": "@vapi-ai/server-sdk/0.5.0",
212212
"X-Fern-Runtime": core.RUNTIME.type,
213213
"X-Fern-Runtime-Version": core.RUNTIME.version,
214214
...requestOptions?.headers,
@@ -260,8 +260,8 @@ export class Assistants {
260260
Authorization: await this._getAuthorizationHeader(),
261261
"X-Fern-Language": "JavaScript",
262262
"X-Fern-SDK-Name": "@vapi-ai/server-sdk",
263-
"X-Fern-SDK-Version": "0.4.0",
264-
"User-Agent": "@vapi-ai/server-sdk/0.4.0",
263+
"X-Fern-SDK-Version": "0.5.0",
264+
"User-Agent": "@vapi-ai/server-sdk/0.5.0",
265265
"X-Fern-Runtime": core.RUNTIME.type,
266266
"X-Fern-Runtime-Version": core.RUNTIME.version,
267267
...requestOptions?.headers,
@@ -318,8 +318,8 @@ export class Assistants {
318318
Authorization: await this._getAuthorizationHeader(),
319319
"X-Fern-Language": "JavaScript",
320320
"X-Fern-SDK-Name": "@vapi-ai/server-sdk",
321-
"X-Fern-SDK-Version": "0.4.0",
322-
"User-Agent": "@vapi-ai/server-sdk/0.4.0",
321+
"X-Fern-SDK-Version": "0.5.0",
322+
"User-Agent": "@vapi-ai/server-sdk/0.5.0",
323323
"X-Fern-Runtime": core.RUNTIME.type,
324324
"X-Fern-Runtime-Version": core.RUNTIME.version,
325325
...requestOptions?.headers,
@@ -357,12 +357,7 @@ export class Assistants {
357357
}
358358
}
359359

360-
protected async _getAuthorizationHeader(): Promise<string | undefined> {
361-
const bearer = await core.Supplier.get(this._options.token);
362-
if (bearer != null) {
363-
return `Bearer ${bearer}`;
364-
}
365-
366-
return undefined;
360+
protected async _getAuthorizationHeader(): Promise<string> {
361+
return `Bearer ${await core.Supplier.get(this._options.token)}`;
367362
}
368363
}

src/api/resources/assistants/client/requests/UpdateAssistantDto.ts

+3-2
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,6 @@ export interface UpdateAssistantDto {
2828
* @default 'assistant-speaks-first'
2929
*/
3030
firstMessageMode?: Vapi.UpdateAssistantDtoFirstMessageMode;
31-
/** When this is enabled, no logs, recordings, or transcriptions will be stored. At the end of the call, you will still receive an end-of-call-report message to store on your server. Defaults to false. */
32-
hipaaEnabled?: boolean;
3331
/** These are the messages that will be sent to your Client SDKs. Default is conversation-update,function-call,hang,model-output,speech-update,status-update,transfer-update,transcript,tool-calls,user-interrupted,voice-input. You can check the shape of the messages in ClientMessage schema. */
3432
clientMessages?: Vapi.UpdateAssistantDtoClientMessagesItem[];
3533
/** These are the messages that will be sent to your Server URL. Default is conversation-update,end-of-call-report,function-call,hang,speech-update,status-update,tool-calls,transfer-destination-request,user-interrupted. You can check the shape of the messages in ServerMessage schema. */
@@ -94,6 +92,7 @@ export interface UpdateAssistantDto {
9492
endCallMessage?: string;
9593
/** This list contains phrases that, if spoken by the assistant, will trigger the call to be hung up. Case insensitive. */
9694
endCallPhrases?: string[];
95+
compliancePlan?: Vapi.CompliancePlan;
9796
/** This is for metadata you want to store on the assistant. */
9897
metadata?: Record<string, unknown>;
9998
/** This is the plan for analysis of assistant's calls. Stored in `call.analysis`. */
@@ -152,4 +151,6 @@ export interface UpdateAssistantDto {
152151
* 3. org.serverUrl
153152
*/
154153
server?: Vapi.Server;
154+
/** This is a set of actions that will be performed on certain events. */
155+
hooks?: Vapi.AssistantHooks[];
155156
}

src/api/resources/assistants/types/UpdateAssistantDtoServerMessagesItem.ts

+2
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ export type UpdateAssistantDtoServerMessagesItem =
1414
| "speech-update"
1515
| "status-update"
1616
| "transcript"
17+
| "transcript[transcriptType='final']"
1718
| "tool-calls"
1819
| "transfer-destination-request"
1920
| "transfer-update"
@@ -32,6 +33,7 @@ export const UpdateAssistantDtoServerMessagesItem = {
3233
SpeechUpdate: "speech-update",
3334
StatusUpdate: "status-update",
3435
Transcript: "transcript",
36+
TranscriptTranscriptTypeFinal: "transcript[transcriptType='final']",
3537
ToolCalls: "tool-calls",
3638
TransferDestinationRequest: "transfer-destination-request",
3739
TransferUpdate: "transfer-update",

src/api/resources/blocks/client/Client.ts

+14-19
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import * as errors from "../../../../errors/index";
1111
export declare namespace Blocks {
1212
interface Options {
1313
environment?: core.Supplier<environments.VapiEnvironment | string>;
14-
token?: core.Supplier<core.BearerToken | undefined>;
14+
token: core.Supplier<core.BearerToken>;
1515
fetcher?: core.FetchFunction;
1616
}
1717

@@ -28,7 +28,7 @@ export declare namespace Blocks {
2828
}
2929

3030
export class Blocks {
31-
constructor(protected readonly _options: Blocks.Options = {}) {}
31+
constructor(protected readonly _options: Blocks.Options) {}
3232

3333
/**
3434
* @param {Vapi.BlocksListRequest} request
@@ -96,8 +96,8 @@ export class Blocks {
9696
Authorization: await this._getAuthorizationHeader(),
9797
"X-Fern-Language": "JavaScript",
9898
"X-Fern-SDK-Name": "@vapi-ai/server-sdk",
99-
"X-Fern-SDK-Version": "0.4.0",
100-
"User-Agent": "@vapi-ai/server-sdk/0.4.0",
99+
"X-Fern-SDK-Version": "0.5.0",
100+
"User-Agent": "@vapi-ai/server-sdk/0.5.0",
101101
"X-Fern-Runtime": core.RUNTIME.type,
102102
"X-Fern-Runtime-Version": core.RUNTIME.version,
103103
...requestOptions?.headers,
@@ -153,8 +153,8 @@ export class Blocks {
153153
Authorization: await this._getAuthorizationHeader(),
154154
"X-Fern-Language": "JavaScript",
155155
"X-Fern-SDK-Name": "@vapi-ai/server-sdk",
156-
"X-Fern-SDK-Version": "0.4.0",
157-
"User-Agent": "@vapi-ai/server-sdk/0.4.0",
156+
"X-Fern-SDK-Version": "0.5.0",
157+
"User-Agent": "@vapi-ai/server-sdk/0.5.0",
158158
"X-Fern-Runtime": core.RUNTIME.type,
159159
"X-Fern-Runtime-Version": core.RUNTIME.version,
160160
...requestOptions?.headers,
@@ -207,8 +207,8 @@ export class Blocks {
207207
Authorization: await this._getAuthorizationHeader(),
208208
"X-Fern-Language": "JavaScript",
209209
"X-Fern-SDK-Name": "@vapi-ai/server-sdk",
210-
"X-Fern-SDK-Version": "0.4.0",
211-
"User-Agent": "@vapi-ai/server-sdk/0.4.0",
210+
"X-Fern-SDK-Version": "0.5.0",
211+
"User-Agent": "@vapi-ai/server-sdk/0.5.0",
212212
"X-Fern-Runtime": core.RUNTIME.type,
213213
"X-Fern-Runtime-Version": core.RUNTIME.version,
214214
...requestOptions?.headers,
@@ -260,8 +260,8 @@ export class Blocks {
260260
Authorization: await this._getAuthorizationHeader(),
261261
"X-Fern-Language": "JavaScript",
262262
"X-Fern-SDK-Name": "@vapi-ai/server-sdk",
263-
"X-Fern-SDK-Version": "0.4.0",
264-
"User-Agent": "@vapi-ai/server-sdk/0.4.0",
263+
"X-Fern-SDK-Version": "0.5.0",
264+
"User-Agent": "@vapi-ai/server-sdk/0.5.0",
265265
"X-Fern-Runtime": core.RUNTIME.type,
266266
"X-Fern-Runtime-Version": core.RUNTIME.version,
267267
...requestOptions?.headers,
@@ -318,8 +318,8 @@ export class Blocks {
318318
Authorization: await this._getAuthorizationHeader(),
319319
"X-Fern-Language": "JavaScript",
320320
"X-Fern-SDK-Name": "@vapi-ai/server-sdk",
321-
"X-Fern-SDK-Version": "0.4.0",
322-
"User-Agent": "@vapi-ai/server-sdk/0.4.0",
321+
"X-Fern-SDK-Version": "0.5.0",
322+
"User-Agent": "@vapi-ai/server-sdk/0.5.0",
323323
"X-Fern-Runtime": core.RUNTIME.type,
324324
"X-Fern-Runtime-Version": core.RUNTIME.version,
325325
...requestOptions?.headers,
@@ -357,12 +357,7 @@ export class Blocks {
357357
}
358358
}
359359

360-
protected async _getAuthorizationHeader(): Promise<string | undefined> {
361-
const bearer = await core.Supplier.get(this._options.token);
362-
if (bearer != null) {
363-
return `Bearer ${bearer}`;
364-
}
365-
366-
return undefined;
360+
protected async _getAuthorizationHeader(): Promise<string> {
361+
return `Bearer ${await core.Supplier.get(this._options.token)}`;
367362
}
368363
}

0 commit comments

Comments
 (0)