Skip to content

Commit e885438

Browse files
Merge pull request #17 from VapiAI/fern-bot/05-23-2025-1110PM
🌿 Fern Regeneration -- May 23, 2025
2 parents 57dab8a + 179030a commit e885438

File tree

18 files changed

+178
-362
lines changed

18 files changed

+178
-362
lines changed

package.json

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

reference.md

Lines changed: 0 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -1,47 +1,5 @@
11
# Reference
22

3-
<details><summary><code>client.<a href="/src/Client.ts">prometheusControllerIndex</a>() -> void</code></summary>
4-
<dl>
5-
<dd>
6-
7-
#### 🔌 Usage
8-
9-
<dl>
10-
<dd>
11-
12-
<dl>
13-
<dd>
14-
15-
```typescript
16-
await client.prometheusControllerIndex();
17-
```
18-
19-
</dd>
20-
</dl>
21-
</dd>
22-
</dl>
23-
24-
#### ⚙️ Parameters
25-
26-
<dl>
27-
<dd>
28-
29-
<dl>
30-
<dd>
31-
32-
**requestOptions:** `VapiClient.RequestOptions`
33-
34-
</dd>
35-
</dl>
36-
</dd>
37-
</dl>
38-
39-
</dd>
40-
</dl>
41-
</details>
42-
43-
##
44-
453
## Calls
464

475
<details><summary><code>client.calls.<a href="/src/api/resources/calls/client/Client.ts">list</a>({ ...params }) -> Vapi.Call[]</code></summary>

src/Client.ts

Lines changed: 2 additions & 79 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@
44

55
import * as environments from "./environments";
66
import * as core from "./core";
7-
import urlJoin from "url-join";
8-
import * as errors from "./errors/index";
97
import { Calls } from "./api/resources/calls/client/Client";
108
import { Assistants } from "./api/resources/assistants/client/Client";
119
import { PhoneNumbers } from "./api/resources/phoneNumbers/client/Client";
@@ -25,7 +23,7 @@ export declare namespace VapiClient {
2523
environment?: core.Supplier<environments.VapiEnvironment | string>;
2624
/** Specify a custom URL to connect the client to. */
2725
baseUrl?: core.Supplier<string>;
28-
token?: core.Supplier<core.BearerToken | undefined>;
26+
token: core.Supplier<core.BearerToken>;
2927
fetcher?: core.FetchFunction;
3028
}
3129

@@ -56,7 +54,7 @@ export class VapiClient {
5654
protected _analytics: Analytics | undefined;
5755
protected _logs: Logs | undefined;
5856

59-
constructor(protected readonly _options: VapiClient.Options = {}) {}
57+
constructor(protected readonly _options: VapiClient.Options) {}
6058

6159
public get calls(): Calls {
6260
return (this._calls ??= new Calls(this._options));
@@ -109,79 +107,4 @@ export class VapiClient {
109107
public get logs(): Logs {
110108
return (this._logs ??= new Logs(this._options));
111109
}
112-
113-
/**
114-
* @param {VapiClient.RequestOptions} requestOptions - Request-specific configuration.
115-
*
116-
* @example
117-
* await client.prometheusControllerIndex()
118-
*/
119-
public prometheusControllerIndex(requestOptions?: VapiClient.RequestOptions): core.HttpResponsePromise<void> {
120-
return core.HttpResponsePromise.fromPromise(this.__prometheusControllerIndex(requestOptions));
121-
}
122-
123-
private async __prometheusControllerIndex(
124-
requestOptions?: VapiClient.RequestOptions,
125-
): Promise<core.WithRawResponse<void>> {
126-
const _response = await (this._options.fetcher ?? core.fetcher)({
127-
url: urlJoin(
128-
(await core.Supplier.get(this._options.baseUrl)) ??
129-
(await core.Supplier.get(this._options.environment)) ??
130-
environments.VapiEnvironment.Default,
131-
"prometheus_metrics",
132-
),
133-
method: "GET",
134-
headers: {
135-
Authorization: await this._getAuthorizationHeader(),
136-
"X-Fern-Language": "JavaScript",
137-
"X-Fern-SDK-Name": "@vapi-ai/server-sdk",
138-
"X-Fern-SDK-Version": "0.8.1",
139-
"User-Agent": "@vapi-ai/server-sdk/0.8.1",
140-
"X-Fern-Runtime": core.RUNTIME.type,
141-
"X-Fern-Runtime-Version": core.RUNTIME.version,
142-
...requestOptions?.headers,
143-
},
144-
contentType: "application/json",
145-
requestType: "json",
146-
timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
147-
maxRetries: requestOptions?.maxRetries,
148-
abortSignal: requestOptions?.abortSignal,
149-
});
150-
if (_response.ok) {
151-
return { data: undefined, rawResponse: _response.rawResponse };
152-
}
153-
154-
if (_response.error.reason === "status-code") {
155-
throw new errors.VapiError({
156-
statusCode: _response.error.statusCode,
157-
body: _response.error.body,
158-
rawResponse: _response.rawResponse,
159-
});
160-
}
161-
162-
switch (_response.error.reason) {
163-
case "non-json":
164-
throw new errors.VapiError({
165-
statusCode: _response.error.statusCode,
166-
body: _response.error.rawBody,
167-
rawResponse: _response.rawResponse,
168-
});
169-
case "timeout":
170-
throw new errors.VapiTimeoutError("Timeout exceeded when calling GET /prometheus_metrics.");
171-
case "unknown":
172-
throw new errors.VapiError({
173-
message: _response.error.errorMessage,
174-
rawResponse: _response.rawResponse,
175-
});
176-
}
177-
}
178-
179-
protected async _getAuthorizationHeader(): Promise<string | undefined> {
180-
const bearer = await core.Supplier.get(this._options.token);
181-
if (bearer != null) {
182-
return `Bearer ${bearer}`;
183-
}
184-
185-
return undefined;
186-
}
187110
}

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

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ export declare namespace Analytics {
1313
environment?: core.Supplier<environments.VapiEnvironment | string>;
1414
/** Specify a custom URL to connect the client to. */
1515
baseUrl?: core.Supplier<string>;
16-
token?: core.Supplier<core.BearerToken | undefined>;
16+
token: core.Supplier<core.BearerToken>;
1717
fetcher?: core.FetchFunction;
1818
}
1919

@@ -30,7 +30,7 @@ export declare namespace Analytics {
3030
}
3131

3232
export class Analytics {
33-
constructor(protected readonly _options: Analytics.Options = {}) {}
33+
constructor(protected readonly _options: Analytics.Options) {}
3434

3535
/**
3636
* @param {Vapi.AnalyticsQueryDto} request
@@ -71,8 +71,8 @@ export class Analytics {
7171
Authorization: await this._getAuthorizationHeader(),
7272
"X-Fern-Language": "JavaScript",
7373
"X-Fern-SDK-Name": "@vapi-ai/server-sdk",
74-
"X-Fern-SDK-Version": "0.8.1",
75-
"User-Agent": "@vapi-ai/server-sdk/0.8.1",
74+
"X-Fern-SDK-Version": "0.9.1",
75+
"User-Agent": "@vapi-ai/server-sdk/0.9.1",
7676
"X-Fern-Runtime": core.RUNTIME.type,
7777
"X-Fern-Runtime-Version": core.RUNTIME.version,
7878
...requestOptions?.headers,
@@ -113,12 +113,7 @@ export class Analytics {
113113
}
114114
}
115115

116-
protected async _getAuthorizationHeader(): Promise<string | undefined> {
117-
const bearer = await core.Supplier.get(this._options.token);
118-
if (bearer != null) {
119-
return `Bearer ${bearer}`;
120-
}
121-
122-
return undefined;
116+
protected async _getAuthorizationHeader(): Promise<string> {
117+
return `Bearer ${await core.Supplier.get(this._options.token)}`;
123118
}
124119
}

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

Lines changed: 14 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ export declare namespace Assistants {
1313
environment?: core.Supplier<environments.VapiEnvironment | string>;
1414
/** Specify a custom URL to connect the client to. */
1515
baseUrl?: core.Supplier<string>;
16-
token?: core.Supplier<core.BearerToken | undefined>;
16+
token: core.Supplier<core.BearerToken>;
1717
fetcher?: core.FetchFunction;
1818
}
1919

@@ -30,7 +30,7 @@ export declare namespace Assistants {
3030
}
3131

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

3535
/**
3636
* @param {Vapi.AssistantsListRequest} request
@@ -110,8 +110,8 @@ export class Assistants {
110110
Authorization: await this._getAuthorizationHeader(),
111111
"X-Fern-Language": "JavaScript",
112112
"X-Fern-SDK-Name": "@vapi-ai/server-sdk",
113-
"X-Fern-SDK-Version": "0.8.1",
114-
"User-Agent": "@vapi-ai/server-sdk/0.8.1",
113+
"X-Fern-SDK-Version": "0.9.1",
114+
"User-Agent": "@vapi-ai/server-sdk/0.9.1",
115115
"X-Fern-Runtime": core.RUNTIME.type,
116116
"X-Fern-Runtime-Version": core.RUNTIME.version,
117117
...requestOptions?.headers,
@@ -182,8 +182,8 @@ export class Assistants {
182182
Authorization: await this._getAuthorizationHeader(),
183183
"X-Fern-Language": "JavaScript",
184184
"X-Fern-SDK-Name": "@vapi-ai/server-sdk",
185-
"X-Fern-SDK-Version": "0.8.1",
186-
"User-Agent": "@vapi-ai/server-sdk/0.8.1",
185+
"X-Fern-SDK-Version": "0.9.1",
186+
"User-Agent": "@vapi-ai/server-sdk/0.9.1",
187187
"X-Fern-Runtime": core.RUNTIME.type,
188188
"X-Fern-Runtime-Version": core.RUNTIME.version,
189189
...requestOptions?.headers,
@@ -251,8 +251,8 @@ export class Assistants {
251251
Authorization: await this._getAuthorizationHeader(),
252252
"X-Fern-Language": "JavaScript",
253253
"X-Fern-SDK-Name": "@vapi-ai/server-sdk",
254-
"X-Fern-SDK-Version": "0.8.1",
255-
"User-Agent": "@vapi-ai/server-sdk/0.8.1",
254+
"X-Fern-SDK-Version": "0.9.1",
255+
"User-Agent": "@vapi-ai/server-sdk/0.9.1",
256256
"X-Fern-Runtime": core.RUNTIME.type,
257257
"X-Fern-Runtime-Version": core.RUNTIME.version,
258258
...requestOptions?.headers,
@@ -319,8 +319,8 @@ export class Assistants {
319319
Authorization: await this._getAuthorizationHeader(),
320320
"X-Fern-Language": "JavaScript",
321321
"X-Fern-SDK-Name": "@vapi-ai/server-sdk",
322-
"X-Fern-SDK-Version": "0.8.1",
323-
"User-Agent": "@vapi-ai/server-sdk/0.8.1",
322+
"X-Fern-SDK-Version": "0.9.1",
323+
"User-Agent": "@vapi-ai/server-sdk/0.9.1",
324324
"X-Fern-Runtime": core.RUNTIME.type,
325325
"X-Fern-Runtime-Version": core.RUNTIME.version,
326326
...requestOptions?.headers,
@@ -393,8 +393,8 @@ export class Assistants {
393393
Authorization: await this._getAuthorizationHeader(),
394394
"X-Fern-Language": "JavaScript",
395395
"X-Fern-SDK-Name": "@vapi-ai/server-sdk",
396-
"X-Fern-SDK-Version": "0.8.1",
397-
"User-Agent": "@vapi-ai/server-sdk/0.8.1",
396+
"X-Fern-SDK-Version": "0.9.1",
397+
"User-Agent": "@vapi-ai/server-sdk/0.9.1",
398398
"X-Fern-Runtime": core.RUNTIME.type,
399399
"X-Fern-Runtime-Version": core.RUNTIME.version,
400400
...requestOptions?.headers,
@@ -435,12 +435,7 @@ export class Assistants {
435435
}
436436
}
437437

438-
protected async _getAuthorizationHeader(): Promise<string | undefined> {
439-
const bearer = await core.Supplier.get(this._options.token);
440-
if (bearer != null) {
441-
return `Bearer ${bearer}`;
442-
}
443-
444-
return undefined;
438+
protected async _getAuthorizationHeader(): Promise<string> {
439+
return `Bearer ${await core.Supplier.get(this._options.token)}`;
445440
}
446441
}

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

Lines changed: 14 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ export declare namespace Calls {
1313
environment?: core.Supplier<environments.VapiEnvironment | string>;
1414
/** Specify a custom URL to connect the client to. */
1515
baseUrl?: core.Supplier<string>;
16-
token?: core.Supplier<core.BearerToken | undefined>;
16+
token: core.Supplier<core.BearerToken>;
1717
fetcher?: core.FetchFunction;
1818
}
1919

@@ -30,7 +30,7 @@ export declare namespace Calls {
3030
}
3131

3232
export class Calls {
33-
constructor(protected readonly _options: Calls.Options = {}) {}
33+
constructor(protected readonly _options: Calls.Options) {}
3434

3535
/**
3636
* @param {Vapi.CallsListRequest} request
@@ -125,8 +125,8 @@ export class Calls {
125125
Authorization: await this._getAuthorizationHeader(),
126126
"X-Fern-Language": "JavaScript",
127127
"X-Fern-SDK-Name": "@vapi-ai/server-sdk",
128-
"X-Fern-SDK-Version": "0.8.1",
129-
"User-Agent": "@vapi-ai/server-sdk/0.8.1",
128+
"X-Fern-SDK-Version": "0.9.1",
129+
"User-Agent": "@vapi-ai/server-sdk/0.9.1",
130130
"X-Fern-Runtime": core.RUNTIME.type,
131131
"X-Fern-Runtime-Version": core.RUNTIME.version,
132132
...requestOptions?.headers,
@@ -197,8 +197,8 @@ export class Calls {
197197
Authorization: await this._getAuthorizationHeader(),
198198
"X-Fern-Language": "JavaScript",
199199
"X-Fern-SDK-Name": "@vapi-ai/server-sdk",
200-
"X-Fern-SDK-Version": "0.8.1",
201-
"User-Agent": "@vapi-ai/server-sdk/0.8.1",
200+
"X-Fern-SDK-Version": "0.9.1",
201+
"User-Agent": "@vapi-ai/server-sdk/0.9.1",
202202
"X-Fern-Runtime": core.RUNTIME.type,
203203
"X-Fern-Runtime-Version": core.RUNTIME.version,
204204
...requestOptions?.headers,
@@ -263,8 +263,8 @@ export class Calls {
263263
Authorization: await this._getAuthorizationHeader(),
264264
"X-Fern-Language": "JavaScript",
265265
"X-Fern-SDK-Name": "@vapi-ai/server-sdk",
266-
"X-Fern-SDK-Version": "0.8.1",
267-
"User-Agent": "@vapi-ai/server-sdk/0.8.1",
266+
"X-Fern-SDK-Version": "0.9.1",
267+
"User-Agent": "@vapi-ai/server-sdk/0.9.1",
268268
"X-Fern-Runtime": core.RUNTIME.type,
269269
"X-Fern-Runtime-Version": core.RUNTIME.version,
270270
...requestOptions?.headers,
@@ -331,8 +331,8 @@ export class Calls {
331331
Authorization: await this._getAuthorizationHeader(),
332332
"X-Fern-Language": "JavaScript",
333333
"X-Fern-SDK-Name": "@vapi-ai/server-sdk",
334-
"X-Fern-SDK-Version": "0.8.1",
335-
"User-Agent": "@vapi-ai/server-sdk/0.8.1",
334+
"X-Fern-SDK-Version": "0.9.1",
335+
"User-Agent": "@vapi-ai/server-sdk/0.9.1",
336336
"X-Fern-Runtime": core.RUNTIME.type,
337337
"X-Fern-Runtime-Version": core.RUNTIME.version,
338338
...requestOptions?.headers,
@@ -405,8 +405,8 @@ export class Calls {
405405
Authorization: await this._getAuthorizationHeader(),
406406
"X-Fern-Language": "JavaScript",
407407
"X-Fern-SDK-Name": "@vapi-ai/server-sdk",
408-
"X-Fern-SDK-Version": "0.8.1",
409-
"User-Agent": "@vapi-ai/server-sdk/0.8.1",
408+
"X-Fern-SDK-Version": "0.9.1",
409+
"User-Agent": "@vapi-ai/server-sdk/0.9.1",
410410
"X-Fern-Runtime": core.RUNTIME.type,
411411
"X-Fern-Runtime-Version": core.RUNTIME.version,
412412
...requestOptions?.headers,
@@ -447,12 +447,7 @@ export class Calls {
447447
}
448448
}
449449

450-
protected async _getAuthorizationHeader(): Promise<string | undefined> {
451-
const bearer = await core.Supplier.get(this._options.token);
452-
if (bearer != null) {
453-
return `Bearer ${bearer}`;
454-
}
455-
456-
return undefined;
450+
protected async _getAuthorizationHeader(): Promise<string> {
451+
return `Bearer ${await core.Supplier.get(this._options.token)}`;
457452
}
458453
}

0 commit comments

Comments
 (0)