Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@vapi-ai/server-sdk",
"version": "0.8.1",
"version": "0.9.1",
"private": false,
"repository": "https://github.com/VapiAI/server-sdk-typescript",
"main": "./index.js",
42 changes: 0 additions & 42 deletions reference.md
Original file line number Diff line number Diff line change
@@ -1,47 +1,5 @@
# Reference

<details><summary><code>client.<a href="/src/Client.ts">prometheusControllerIndex</a>() -> void</code></summary>
<dl>
<dd>

#### 🔌 Usage

<dl>
<dd>

<dl>
<dd>

```typescript
await client.prometheusControllerIndex();
```

</dd>
</dl>
</dd>
</dl>

#### ⚙️ Parameters

<dl>
<dd>

<dl>
<dd>

**requestOptions:** `VapiClient.RequestOptions`

</dd>
</dl>
</dd>
</dl>

</dd>
</dl>
</details>

##

## Calls

<details><summary><code>client.calls.<a href="/src/api/resources/calls/client/Client.ts">list</a>({ ...params }) -> Vapi.Call[]</code></summary>
81 changes: 2 additions & 79 deletions src/Client.ts
Original file line number Diff line number Diff line change
@@ -4,8 +4,6 @@

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

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

constructor(protected readonly _options: VapiClient.Options = {}) {}
constructor(protected readonly _options: VapiClient.Options) {}

public get calls(): Calls {
return (this._calls ??= new Calls(this._options));
@@ -109,79 +107,4 @@ export class VapiClient {
public get logs(): Logs {
return (this._logs ??= new Logs(this._options));
}

/**
* @param {VapiClient.RequestOptions} requestOptions - Request-specific configuration.
*
* @example
* await client.prometheusControllerIndex()
*/
public prometheusControllerIndex(requestOptions?: VapiClient.RequestOptions): core.HttpResponsePromise<void> {
return core.HttpResponsePromise.fromPromise(this.__prometheusControllerIndex(requestOptions));
}

private async __prometheusControllerIndex(
requestOptions?: VapiClient.RequestOptions,
): Promise<core.WithRawResponse<void>> {
const _response = await (this._options.fetcher ?? core.fetcher)({
url: urlJoin(
(await core.Supplier.get(this._options.baseUrl)) ??
(await core.Supplier.get(this._options.environment)) ??
environments.VapiEnvironment.Default,
"prometheus_metrics",
),
method: "GET",
headers: {
Authorization: await this._getAuthorizationHeader(),
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "@vapi-ai/server-sdk",
"X-Fern-SDK-Version": "0.8.1",
"User-Agent": "@vapi-ai/server-sdk/0.8.1",
"X-Fern-Runtime": core.RUNTIME.type,
"X-Fern-Runtime-Version": core.RUNTIME.version,
...requestOptions?.headers,
},
contentType: "application/json",
requestType: "json",
timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
maxRetries: requestOptions?.maxRetries,
abortSignal: requestOptions?.abortSignal,
});
if (_response.ok) {
return { data: undefined, rawResponse: _response.rawResponse };
}

if (_response.error.reason === "status-code") {
throw new errors.VapiError({
statusCode: _response.error.statusCode,
body: _response.error.body,
rawResponse: _response.rawResponse,
});
}

switch (_response.error.reason) {
case "non-json":
throw new errors.VapiError({
statusCode: _response.error.statusCode,
body: _response.error.rawBody,
rawResponse: _response.rawResponse,
});
case "timeout":
throw new errors.VapiTimeoutError("Timeout exceeded when calling GET /prometheus_metrics.");
case "unknown":
throw new errors.VapiError({
message: _response.error.errorMessage,
rawResponse: _response.rawResponse,
});
}
}

protected async _getAuthorizationHeader(): Promise<string | undefined> {
const bearer = await core.Supplier.get(this._options.token);
if (bearer != null) {
return `Bearer ${bearer}`;
}

return undefined;
}
}
17 changes: 6 additions & 11 deletions src/api/resources/analytics/client/Client.ts
Original file line number Diff line number Diff line change
@@ -13,7 +13,7 @@ export declare namespace Analytics {
environment?: core.Supplier<environments.VapiEnvironment | string>;
/** Specify a custom URL to connect the client to. */
baseUrl?: core.Supplier<string>;
token?: core.Supplier<core.BearerToken | undefined>;
token: core.Supplier<core.BearerToken>;
fetcher?: core.FetchFunction;
}

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

export class Analytics {
constructor(protected readonly _options: Analytics.Options = {}) {}
constructor(protected readonly _options: Analytics.Options) {}

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

protected async _getAuthorizationHeader(): Promise<string | undefined> {
const bearer = await core.Supplier.get(this._options.token);
if (bearer != null) {
return `Bearer ${bearer}`;
}

return undefined;
protected async _getAuthorizationHeader(): Promise<string> {
return `Bearer ${await core.Supplier.get(this._options.token)}`;
}
}
33 changes: 14 additions & 19 deletions src/api/resources/assistants/client/Client.ts
Original file line number Diff line number Diff line change
@@ -13,7 +13,7 @@ export declare namespace Assistants {
environment?: core.Supplier<environments.VapiEnvironment | string>;
/** Specify a custom URL to connect the client to. */
baseUrl?: core.Supplier<string>;
token?: core.Supplier<core.BearerToken | undefined>;
token: core.Supplier<core.BearerToken>;
fetcher?: core.FetchFunction;
}

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

export class Assistants {
constructor(protected readonly _options: Assistants.Options = {}) {}
constructor(protected readonly _options: Assistants.Options) {}

/**
* @param {Vapi.AssistantsListRequest} request
@@ -110,8 +110,8 @@ export class Assistants {
Authorization: await this._getAuthorizationHeader(),
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "@vapi-ai/server-sdk",
"X-Fern-SDK-Version": "0.8.1",
"User-Agent": "@vapi-ai/server-sdk/0.8.1",
"X-Fern-SDK-Version": "0.9.1",
"User-Agent": "@vapi-ai/server-sdk/0.9.1",
"X-Fern-Runtime": core.RUNTIME.type,
"X-Fern-Runtime-Version": core.RUNTIME.version,
...requestOptions?.headers,
@@ -182,8 +182,8 @@ export class Assistants {
Authorization: await this._getAuthorizationHeader(),
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "@vapi-ai/server-sdk",
"X-Fern-SDK-Version": "0.8.1",
"User-Agent": "@vapi-ai/server-sdk/0.8.1",
"X-Fern-SDK-Version": "0.9.1",
"User-Agent": "@vapi-ai/server-sdk/0.9.1",
"X-Fern-Runtime": core.RUNTIME.type,
"X-Fern-Runtime-Version": core.RUNTIME.version,
...requestOptions?.headers,
@@ -251,8 +251,8 @@ export class Assistants {
Authorization: await this._getAuthorizationHeader(),
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "@vapi-ai/server-sdk",
"X-Fern-SDK-Version": "0.8.1",
"User-Agent": "@vapi-ai/server-sdk/0.8.1",
"X-Fern-SDK-Version": "0.9.1",
"User-Agent": "@vapi-ai/server-sdk/0.9.1",
"X-Fern-Runtime": core.RUNTIME.type,
"X-Fern-Runtime-Version": core.RUNTIME.version,
...requestOptions?.headers,
@@ -319,8 +319,8 @@ export class Assistants {
Authorization: await this._getAuthorizationHeader(),
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "@vapi-ai/server-sdk",
"X-Fern-SDK-Version": "0.8.1",
"User-Agent": "@vapi-ai/server-sdk/0.8.1",
"X-Fern-SDK-Version": "0.9.1",
"User-Agent": "@vapi-ai/server-sdk/0.9.1",
"X-Fern-Runtime": core.RUNTIME.type,
"X-Fern-Runtime-Version": core.RUNTIME.version,
...requestOptions?.headers,
@@ -393,8 +393,8 @@ export class Assistants {
Authorization: await this._getAuthorizationHeader(),
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "@vapi-ai/server-sdk",
"X-Fern-SDK-Version": "0.8.1",
"User-Agent": "@vapi-ai/server-sdk/0.8.1",
"X-Fern-SDK-Version": "0.9.1",
"User-Agent": "@vapi-ai/server-sdk/0.9.1",
"X-Fern-Runtime": core.RUNTIME.type,
"X-Fern-Runtime-Version": core.RUNTIME.version,
...requestOptions?.headers,
@@ -435,12 +435,7 @@ export class Assistants {
}
}

protected async _getAuthorizationHeader(): Promise<string | undefined> {
const bearer = await core.Supplier.get(this._options.token);
if (bearer != null) {
return `Bearer ${bearer}`;
}

return undefined;
protected async _getAuthorizationHeader(): Promise<string> {
return `Bearer ${await core.Supplier.get(this._options.token)}`;
}
}
33 changes: 14 additions & 19 deletions src/api/resources/calls/client/Client.ts
Original file line number Diff line number Diff line change
@@ -13,7 +13,7 @@ export declare namespace Calls {
environment?: core.Supplier<environments.VapiEnvironment | string>;
/** Specify a custom URL to connect the client to. */
baseUrl?: core.Supplier<string>;
token?: core.Supplier<core.BearerToken | undefined>;
token: core.Supplier<core.BearerToken>;
fetcher?: core.FetchFunction;
}

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

export class Calls {
constructor(protected readonly _options: Calls.Options = {}) {}
constructor(protected readonly _options: Calls.Options) {}

/**
* @param {Vapi.CallsListRequest} request
@@ -125,8 +125,8 @@ export class Calls {
Authorization: await this._getAuthorizationHeader(),
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "@vapi-ai/server-sdk",
"X-Fern-SDK-Version": "0.8.1",
"User-Agent": "@vapi-ai/server-sdk/0.8.1",
"X-Fern-SDK-Version": "0.9.1",
"User-Agent": "@vapi-ai/server-sdk/0.9.1",
"X-Fern-Runtime": core.RUNTIME.type,
"X-Fern-Runtime-Version": core.RUNTIME.version,
...requestOptions?.headers,
@@ -197,8 +197,8 @@ export class Calls {
Authorization: await this._getAuthorizationHeader(),
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "@vapi-ai/server-sdk",
"X-Fern-SDK-Version": "0.8.1",
"User-Agent": "@vapi-ai/server-sdk/0.8.1",
"X-Fern-SDK-Version": "0.9.1",
"User-Agent": "@vapi-ai/server-sdk/0.9.1",
"X-Fern-Runtime": core.RUNTIME.type,
"X-Fern-Runtime-Version": core.RUNTIME.version,
...requestOptions?.headers,
@@ -263,8 +263,8 @@ export class Calls {
Authorization: await this._getAuthorizationHeader(),
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "@vapi-ai/server-sdk",
"X-Fern-SDK-Version": "0.8.1",
"User-Agent": "@vapi-ai/server-sdk/0.8.1",
"X-Fern-SDK-Version": "0.9.1",
"User-Agent": "@vapi-ai/server-sdk/0.9.1",
"X-Fern-Runtime": core.RUNTIME.type,
"X-Fern-Runtime-Version": core.RUNTIME.version,
...requestOptions?.headers,
@@ -331,8 +331,8 @@ export class Calls {
Authorization: await this._getAuthorizationHeader(),
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "@vapi-ai/server-sdk",
"X-Fern-SDK-Version": "0.8.1",
"User-Agent": "@vapi-ai/server-sdk/0.8.1",
"X-Fern-SDK-Version": "0.9.1",
"User-Agent": "@vapi-ai/server-sdk/0.9.1",
"X-Fern-Runtime": core.RUNTIME.type,
"X-Fern-Runtime-Version": core.RUNTIME.version,
...requestOptions?.headers,
@@ -405,8 +405,8 @@ export class Calls {
Authorization: await this._getAuthorizationHeader(),
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "@vapi-ai/server-sdk",
"X-Fern-SDK-Version": "0.8.1",
"User-Agent": "@vapi-ai/server-sdk/0.8.1",
"X-Fern-SDK-Version": "0.9.1",
"User-Agent": "@vapi-ai/server-sdk/0.9.1",
"X-Fern-Runtime": core.RUNTIME.type,
"X-Fern-Runtime-Version": core.RUNTIME.version,
...requestOptions?.headers,
@@ -447,12 +447,7 @@ export class Calls {
}
}

protected async _getAuthorizationHeader(): Promise<string | undefined> {
const bearer = await core.Supplier.get(this._options.token);
if (bearer != null) {
return `Bearer ${bearer}`;
}

return undefined;
protected async _getAuthorizationHeader(): Promise<string> {
return `Bearer ${await core.Supplier.get(this._options.token)}`;
}
}
33 changes: 14 additions & 19 deletions src/api/resources/files/client/Client.ts
Original file line number Diff line number Diff line change
@@ -15,7 +15,7 @@ export declare namespace Files {
environment?: core.Supplier<environments.VapiEnvironment | string>;
/** Specify a custom URL to connect the client to. */
baseUrl?: core.Supplier<string>;
token?: core.Supplier<core.BearerToken | undefined>;
token: core.Supplier<core.BearerToken>;
fetcher?: core.FetchFunction;
}

@@ -32,7 +32,7 @@ export declare namespace Files {
}

export class Files {
constructor(protected readonly _options: Files.Options = {}) {}
constructor(protected readonly _options: Files.Options) {}

/**
* @param {Files.RequestOptions} requestOptions - Request-specific configuration.
@@ -57,8 +57,8 @@ export class Files {
Authorization: await this._getAuthorizationHeader(),
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "@vapi-ai/server-sdk",
"X-Fern-SDK-Version": "0.8.1",
"User-Agent": "@vapi-ai/server-sdk/0.8.1",
"X-Fern-SDK-Version": "0.9.1",
"User-Agent": "@vapi-ai/server-sdk/0.9.1",
"X-Fern-Runtime": core.RUNTIME.type,
"X-Fern-Runtime-Version": core.RUNTIME.version,
...requestOptions?.headers,
@@ -133,8 +133,8 @@ export class Files {
Authorization: await this._getAuthorizationHeader(),
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "@vapi-ai/server-sdk",
"X-Fern-SDK-Version": "0.8.1",
"User-Agent": "@vapi-ai/server-sdk/0.8.1",
"X-Fern-SDK-Version": "0.9.1",
"User-Agent": "@vapi-ai/server-sdk/0.9.1",
"X-Fern-Runtime": core.RUNTIME.type,
"X-Fern-Runtime-Version": core.RUNTIME.version,
..._maybeEncodedRequest.headers,
@@ -205,8 +205,8 @@ export class Files {
Authorization: await this._getAuthorizationHeader(),
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "@vapi-ai/server-sdk",
"X-Fern-SDK-Version": "0.8.1",
"User-Agent": "@vapi-ai/server-sdk/0.8.1",
"X-Fern-SDK-Version": "0.9.1",
"User-Agent": "@vapi-ai/server-sdk/0.9.1",
"X-Fern-Runtime": core.RUNTIME.type,
"X-Fern-Runtime-Version": core.RUNTIME.version,
...requestOptions?.headers,
@@ -273,8 +273,8 @@ export class Files {
Authorization: await this._getAuthorizationHeader(),
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "@vapi-ai/server-sdk",
"X-Fern-SDK-Version": "0.8.1",
"User-Agent": "@vapi-ai/server-sdk/0.8.1",
"X-Fern-SDK-Version": "0.9.1",
"User-Agent": "@vapi-ai/server-sdk/0.9.1",
"X-Fern-Runtime": core.RUNTIME.type,
"X-Fern-Runtime-Version": core.RUNTIME.version,
...requestOptions?.headers,
@@ -347,8 +347,8 @@ export class Files {
Authorization: await this._getAuthorizationHeader(),
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "@vapi-ai/server-sdk",
"X-Fern-SDK-Version": "0.8.1",
"User-Agent": "@vapi-ai/server-sdk/0.8.1",
"X-Fern-SDK-Version": "0.9.1",
"User-Agent": "@vapi-ai/server-sdk/0.9.1",
"X-Fern-Runtime": core.RUNTIME.type,
"X-Fern-Runtime-Version": core.RUNTIME.version,
...requestOptions?.headers,
@@ -389,12 +389,7 @@ export class Files {
}
}

protected async _getAuthorizationHeader(): Promise<string | undefined> {
const bearer = await core.Supplier.get(this._options.token);
if (bearer != null) {
return `Bearer ${bearer}`;
}

return undefined;
protected async _getAuthorizationHeader(): Promise<string> {
return `Bearer ${await core.Supplier.get(this._options.token)}`;
}
}
33 changes: 14 additions & 19 deletions src/api/resources/knowledgeBases/client/Client.ts
Original file line number Diff line number Diff line change
@@ -13,7 +13,7 @@ export declare namespace KnowledgeBases {
environment?: core.Supplier<environments.VapiEnvironment | string>;
/** Specify a custom URL to connect the client to. */
baseUrl?: core.Supplier<string>;
token?: core.Supplier<core.BearerToken | undefined>;
token: core.Supplier<core.BearerToken>;
fetcher?: core.FetchFunction;
}

@@ -30,7 +30,7 @@ export declare namespace KnowledgeBases {
}

export class KnowledgeBases {
constructor(protected readonly _options: KnowledgeBases.Options = {}) {}
constructor(protected readonly _options: KnowledgeBases.Options) {}

/**
* @param {Vapi.KnowledgeBasesListRequest} request
@@ -110,8 +110,8 @@ export class KnowledgeBases {
Authorization: await this._getAuthorizationHeader(),
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "@vapi-ai/server-sdk",
"X-Fern-SDK-Version": "0.8.1",
"User-Agent": "@vapi-ai/server-sdk/0.8.1",
"X-Fern-SDK-Version": "0.9.1",
"User-Agent": "@vapi-ai/server-sdk/0.9.1",
"X-Fern-Runtime": core.RUNTIME.type,
"X-Fern-Runtime-Version": core.RUNTIME.version,
...requestOptions?.headers,
@@ -187,8 +187,8 @@ export class KnowledgeBases {
Authorization: await this._getAuthorizationHeader(),
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "@vapi-ai/server-sdk",
"X-Fern-SDK-Version": "0.8.1",
"User-Agent": "@vapi-ai/server-sdk/0.8.1",
"X-Fern-SDK-Version": "0.9.1",
"User-Agent": "@vapi-ai/server-sdk/0.9.1",
"X-Fern-Runtime": core.RUNTIME.type,
"X-Fern-Runtime-Version": core.RUNTIME.version,
...requestOptions?.headers,
@@ -259,8 +259,8 @@ export class KnowledgeBases {
Authorization: await this._getAuthorizationHeader(),
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "@vapi-ai/server-sdk",
"X-Fern-SDK-Version": "0.8.1",
"User-Agent": "@vapi-ai/server-sdk/0.8.1",
"X-Fern-SDK-Version": "0.9.1",
"User-Agent": "@vapi-ai/server-sdk/0.9.1",
"X-Fern-Runtime": core.RUNTIME.type,
"X-Fern-Runtime-Version": core.RUNTIME.version,
...requestOptions?.headers,
@@ -330,8 +330,8 @@ export class KnowledgeBases {
Authorization: await this._getAuthorizationHeader(),
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "@vapi-ai/server-sdk",
"X-Fern-SDK-Version": "0.8.1",
"User-Agent": "@vapi-ai/server-sdk/0.8.1",
"X-Fern-SDK-Version": "0.9.1",
"User-Agent": "@vapi-ai/server-sdk/0.9.1",
"X-Fern-Runtime": core.RUNTIME.type,
"X-Fern-Runtime-Version": core.RUNTIME.version,
...requestOptions?.headers,
@@ -404,8 +404,8 @@ export class KnowledgeBases {
Authorization: await this._getAuthorizationHeader(),
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "@vapi-ai/server-sdk",
"X-Fern-SDK-Version": "0.8.1",
"User-Agent": "@vapi-ai/server-sdk/0.8.1",
"X-Fern-SDK-Version": "0.9.1",
"User-Agent": "@vapi-ai/server-sdk/0.9.1",
"X-Fern-Runtime": core.RUNTIME.type,
"X-Fern-Runtime-Version": core.RUNTIME.version,
...requestOptions?.headers,
@@ -446,12 +446,7 @@ export class KnowledgeBases {
}
}

protected async _getAuthorizationHeader(): Promise<string | undefined> {
const bearer = await core.Supplier.get(this._options.token);
if (bearer != null) {
return `Bearer ${bearer}`;
}

return undefined;
protected async _getAuthorizationHeader(): Promise<string> {
return `Bearer ${await core.Supplier.get(this._options.token)}`;
}
}
21 changes: 8 additions & 13 deletions src/api/resources/logs/client/Client.ts
Original file line number Diff line number Diff line change
@@ -13,7 +13,7 @@ export declare namespace Logs {
environment?: core.Supplier<environments.VapiEnvironment | string>;
/** Specify a custom URL to connect the client to. */
baseUrl?: core.Supplier<string>;
token?: core.Supplier<core.BearerToken | undefined>;
token: core.Supplier<core.BearerToken>;
fetcher?: core.FetchFunction;
}

@@ -30,7 +30,7 @@ export declare namespace Logs {
}

export class Logs {
constructor(protected readonly _options: Logs.Options = {}) {}
constructor(protected readonly _options: Logs.Options) {}

/**
* @param {Vapi.LogsGetRequest} request
@@ -132,8 +132,8 @@ export class Logs {
Authorization: await this._getAuthorizationHeader(),
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "@vapi-ai/server-sdk",
"X-Fern-SDK-Version": "0.8.1",
"User-Agent": "@vapi-ai/server-sdk/0.8.1",
"X-Fern-SDK-Version": "0.9.1",
"User-Agent": "@vapi-ai/server-sdk/0.9.1",
"X-Fern-Runtime": core.RUNTIME.type,
"X-Fern-Runtime-Version": core.RUNTIME.version,
...requestOptions?.headers,
@@ -243,8 +243,8 @@ export class Logs {
Authorization: await this._getAuthorizationHeader(),
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "@vapi-ai/server-sdk",
"X-Fern-SDK-Version": "0.8.1",
"User-Agent": "@vapi-ai/server-sdk/0.8.1",
"X-Fern-SDK-Version": "0.9.1",
"User-Agent": "@vapi-ai/server-sdk/0.9.1",
"X-Fern-Runtime": core.RUNTIME.type,
"X-Fern-Runtime-Version": core.RUNTIME.version,
...requestOptions?.headers,
@@ -285,12 +285,7 @@ export class Logs {
}
}

protected async _getAuthorizationHeader(): Promise<string | undefined> {
const bearer = await core.Supplier.get(this._options.token);
if (bearer != null) {
return `Bearer ${bearer}`;
}

return undefined;
protected async _getAuthorizationHeader(): Promise<string> {
return `Bearer ${await core.Supplier.get(this._options.token)}`;
}
}
33 changes: 14 additions & 19 deletions src/api/resources/phoneNumbers/client/Client.ts
Original file line number Diff line number Diff line change
@@ -13,7 +13,7 @@ export declare namespace PhoneNumbers {
environment?: core.Supplier<environments.VapiEnvironment | string>;
/** Specify a custom URL to connect the client to. */
baseUrl?: core.Supplier<string>;
token?: core.Supplier<core.BearerToken | undefined>;
token: core.Supplier<core.BearerToken>;
fetcher?: core.FetchFunction;
}

@@ -30,7 +30,7 @@ export declare namespace PhoneNumbers {
}

export class PhoneNumbers {
constructor(protected readonly _options: PhoneNumbers.Options = {}) {}
constructor(protected readonly _options: PhoneNumbers.Options) {}

/**
* @param {Vapi.PhoneNumbersListRequest} request
@@ -110,8 +110,8 @@ export class PhoneNumbers {
Authorization: await this._getAuthorizationHeader(),
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "@vapi-ai/server-sdk",
"X-Fern-SDK-Version": "0.8.1",
"User-Agent": "@vapi-ai/server-sdk/0.8.1",
"X-Fern-SDK-Version": "0.9.1",
"User-Agent": "@vapi-ai/server-sdk/0.9.1",
"X-Fern-Runtime": core.RUNTIME.type,
"X-Fern-Runtime-Version": core.RUNTIME.version,
...requestOptions?.headers,
@@ -185,8 +185,8 @@ export class PhoneNumbers {
Authorization: await this._getAuthorizationHeader(),
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "@vapi-ai/server-sdk",
"X-Fern-SDK-Version": "0.8.1",
"User-Agent": "@vapi-ai/server-sdk/0.8.1",
"X-Fern-SDK-Version": "0.9.1",
"User-Agent": "@vapi-ai/server-sdk/0.9.1",
"X-Fern-Runtime": core.RUNTIME.type,
"X-Fern-Runtime-Version": core.RUNTIME.version,
...requestOptions?.headers,
@@ -257,8 +257,8 @@ export class PhoneNumbers {
Authorization: await this._getAuthorizationHeader(),
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "@vapi-ai/server-sdk",
"X-Fern-SDK-Version": "0.8.1",
"User-Agent": "@vapi-ai/server-sdk/0.8.1",
"X-Fern-SDK-Version": "0.9.1",
"User-Agent": "@vapi-ai/server-sdk/0.9.1",
"X-Fern-Runtime": core.RUNTIME.type,
"X-Fern-Runtime-Version": core.RUNTIME.version,
...requestOptions?.headers,
@@ -328,8 +328,8 @@ export class PhoneNumbers {
Authorization: await this._getAuthorizationHeader(),
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "@vapi-ai/server-sdk",
"X-Fern-SDK-Version": "0.8.1",
"User-Agent": "@vapi-ai/server-sdk/0.8.1",
"X-Fern-SDK-Version": "0.9.1",
"User-Agent": "@vapi-ai/server-sdk/0.9.1",
"X-Fern-Runtime": core.RUNTIME.type,
"X-Fern-Runtime-Version": core.RUNTIME.version,
...requestOptions?.headers,
@@ -402,8 +402,8 @@ export class PhoneNumbers {
Authorization: await this._getAuthorizationHeader(),
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "@vapi-ai/server-sdk",
"X-Fern-SDK-Version": "0.8.1",
"User-Agent": "@vapi-ai/server-sdk/0.8.1",
"X-Fern-SDK-Version": "0.9.1",
"User-Agent": "@vapi-ai/server-sdk/0.9.1",
"X-Fern-Runtime": core.RUNTIME.type,
"X-Fern-Runtime-Version": core.RUNTIME.version,
...requestOptions?.headers,
@@ -444,12 +444,7 @@ export class PhoneNumbers {
}
}

protected async _getAuthorizationHeader(): Promise<string | undefined> {
const bearer = await core.Supplier.get(this._options.token);
if (bearer != null) {
return `Bearer ${bearer}`;
}

return undefined;
protected async _getAuthorizationHeader(): Promise<string> {
return `Bearer ${await core.Supplier.get(this._options.token)}`;
}
}
33 changes: 14 additions & 19 deletions src/api/resources/squads/client/Client.ts
Original file line number Diff line number Diff line change
@@ -13,7 +13,7 @@ export declare namespace Squads {
environment?: core.Supplier<environments.VapiEnvironment | string>;
/** Specify a custom URL to connect the client to. */
baseUrl?: core.Supplier<string>;
token?: core.Supplier<core.BearerToken | undefined>;
token: core.Supplier<core.BearerToken>;
fetcher?: core.FetchFunction;
}

@@ -30,7 +30,7 @@ export declare namespace Squads {
}

export class Squads {
constructor(protected readonly _options: Squads.Options = {}) {}
constructor(protected readonly _options: Squads.Options) {}

/**
* @param {Vapi.SquadsListRequest} request
@@ -110,8 +110,8 @@ export class Squads {
Authorization: await this._getAuthorizationHeader(),
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "@vapi-ai/server-sdk",
"X-Fern-SDK-Version": "0.8.1",
"User-Agent": "@vapi-ai/server-sdk/0.8.1",
"X-Fern-SDK-Version": "0.9.1",
"User-Agent": "@vapi-ai/server-sdk/0.9.1",
"X-Fern-Runtime": core.RUNTIME.type,
"X-Fern-Runtime-Version": core.RUNTIME.version,
...requestOptions?.headers,
@@ -184,8 +184,8 @@ export class Squads {
Authorization: await this._getAuthorizationHeader(),
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "@vapi-ai/server-sdk",
"X-Fern-SDK-Version": "0.8.1",
"User-Agent": "@vapi-ai/server-sdk/0.8.1",
"X-Fern-SDK-Version": "0.9.1",
"User-Agent": "@vapi-ai/server-sdk/0.9.1",
"X-Fern-Runtime": core.RUNTIME.type,
"X-Fern-Runtime-Version": core.RUNTIME.version,
...requestOptions?.headers,
@@ -250,8 +250,8 @@ export class Squads {
Authorization: await this._getAuthorizationHeader(),
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "@vapi-ai/server-sdk",
"X-Fern-SDK-Version": "0.8.1",
"User-Agent": "@vapi-ai/server-sdk/0.8.1",
"X-Fern-SDK-Version": "0.9.1",
"User-Agent": "@vapi-ai/server-sdk/0.9.1",
"X-Fern-Runtime": core.RUNTIME.type,
"X-Fern-Runtime-Version": core.RUNTIME.version,
...requestOptions?.headers,
@@ -318,8 +318,8 @@ export class Squads {
Authorization: await this._getAuthorizationHeader(),
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "@vapi-ai/server-sdk",
"X-Fern-SDK-Version": "0.8.1",
"User-Agent": "@vapi-ai/server-sdk/0.8.1",
"X-Fern-SDK-Version": "0.9.1",
"User-Agent": "@vapi-ai/server-sdk/0.9.1",
"X-Fern-Runtime": core.RUNTIME.type,
"X-Fern-Runtime-Version": core.RUNTIME.version,
...requestOptions?.headers,
@@ -394,8 +394,8 @@ export class Squads {
Authorization: await this._getAuthorizationHeader(),
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "@vapi-ai/server-sdk",
"X-Fern-SDK-Version": "0.8.1",
"User-Agent": "@vapi-ai/server-sdk/0.8.1",
"X-Fern-SDK-Version": "0.9.1",
"User-Agent": "@vapi-ai/server-sdk/0.9.1",
"X-Fern-Runtime": core.RUNTIME.type,
"X-Fern-Runtime-Version": core.RUNTIME.version,
...requestOptions?.headers,
@@ -436,12 +436,7 @@ export class Squads {
}
}

protected async _getAuthorizationHeader(): Promise<string | undefined> {
const bearer = await core.Supplier.get(this._options.token);
if (bearer != null) {
return `Bearer ${bearer}`;
}

return undefined;
protected async _getAuthorizationHeader(): Promise<string> {
return `Bearer ${await core.Supplier.get(this._options.token)}`;
}
}
33 changes: 14 additions & 19 deletions src/api/resources/testSuiteRuns/client/Client.ts
Original file line number Diff line number Diff line change
@@ -13,7 +13,7 @@ export declare namespace TestSuiteRuns {
environment?: core.Supplier<environments.VapiEnvironment | string>;
/** Specify a custom URL to connect the client to. */
baseUrl?: core.Supplier<string>;
token?: core.Supplier<core.BearerToken | undefined>;
token: core.Supplier<core.BearerToken>;
fetcher?: core.FetchFunction;
}

@@ -30,7 +30,7 @@ export declare namespace TestSuiteRuns {
}

export class TestSuiteRuns {
constructor(protected readonly _options: TestSuiteRuns.Options = {}) {}
constructor(protected readonly _options: TestSuiteRuns.Options) {}

/**
* @param {string} testSuiteId
@@ -125,8 +125,8 @@ export class TestSuiteRuns {
Authorization: await this._getAuthorizationHeader(),
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "@vapi-ai/server-sdk",
"X-Fern-SDK-Version": "0.8.1",
"User-Agent": "@vapi-ai/server-sdk/0.8.1",
"X-Fern-SDK-Version": "0.9.1",
"User-Agent": "@vapi-ai/server-sdk/0.9.1",
"X-Fern-Runtime": core.RUNTIME.type,
"X-Fern-Runtime-Version": core.RUNTIME.version,
...requestOptions?.headers,
@@ -202,8 +202,8 @@ export class TestSuiteRuns {
Authorization: await this._getAuthorizationHeader(),
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "@vapi-ai/server-sdk",
"X-Fern-SDK-Version": "0.8.1",
"User-Agent": "@vapi-ai/server-sdk/0.8.1",
"X-Fern-SDK-Version": "0.9.1",
"User-Agent": "@vapi-ai/server-sdk/0.9.1",
"X-Fern-Runtime": core.RUNTIME.type,
"X-Fern-Runtime-Version": core.RUNTIME.version,
...requestOptions?.headers,
@@ -279,8 +279,8 @@ export class TestSuiteRuns {
Authorization: await this._getAuthorizationHeader(),
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "@vapi-ai/server-sdk",
"X-Fern-SDK-Version": "0.8.1",
"User-Agent": "@vapi-ai/server-sdk/0.8.1",
"X-Fern-SDK-Version": "0.9.1",
"User-Agent": "@vapi-ai/server-sdk/0.9.1",
"X-Fern-Runtime": core.RUNTIME.type,
"X-Fern-Runtime-Version": core.RUNTIME.version,
...requestOptions?.headers,
@@ -357,8 +357,8 @@ export class TestSuiteRuns {
Authorization: await this._getAuthorizationHeader(),
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "@vapi-ai/server-sdk",
"X-Fern-SDK-Version": "0.8.1",
"User-Agent": "@vapi-ai/server-sdk/0.8.1",
"X-Fern-SDK-Version": "0.9.1",
"User-Agent": "@vapi-ai/server-sdk/0.9.1",
"X-Fern-Runtime": core.RUNTIME.type,
"X-Fern-Runtime-Version": core.RUNTIME.version,
...requestOptions?.headers,
@@ -438,8 +438,8 @@ export class TestSuiteRuns {
Authorization: await this._getAuthorizationHeader(),
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "@vapi-ai/server-sdk",
"X-Fern-SDK-Version": "0.8.1",
"User-Agent": "@vapi-ai/server-sdk/0.8.1",
"X-Fern-SDK-Version": "0.9.1",
"User-Agent": "@vapi-ai/server-sdk/0.9.1",
"X-Fern-Runtime": core.RUNTIME.type,
"X-Fern-Runtime-Version": core.RUNTIME.version,
...requestOptions?.headers,
@@ -482,12 +482,7 @@ export class TestSuiteRuns {
}
}

protected async _getAuthorizationHeader(): Promise<string | undefined> {
const bearer = await core.Supplier.get(this._options.token);
if (bearer != null) {
return `Bearer ${bearer}`;
}

return undefined;
protected async _getAuthorizationHeader(): Promise<string> {
return `Bearer ${await core.Supplier.get(this._options.token)}`;
}
}
33 changes: 14 additions & 19 deletions src/api/resources/testSuiteTests/client/Client.ts
Original file line number Diff line number Diff line change
@@ -13,7 +13,7 @@ export declare namespace TestSuiteTests {
environment?: core.Supplier<environments.VapiEnvironment | string>;
/** Specify a custom URL to connect the client to. */
baseUrl?: core.Supplier<string>;
token?: core.Supplier<core.BearerToken | undefined>;
token: core.Supplier<core.BearerToken>;
fetcher?: core.FetchFunction;
}

@@ -30,7 +30,7 @@ export declare namespace TestSuiteTests {
}

export class TestSuiteTests {
constructor(protected readonly _options: TestSuiteTests.Options = {}) {}
constructor(protected readonly _options: TestSuiteTests.Options) {}

/**
* @param {string} testSuiteId
@@ -125,8 +125,8 @@ export class TestSuiteTests {
Authorization: await this._getAuthorizationHeader(),
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "@vapi-ai/server-sdk",
"X-Fern-SDK-Version": "0.8.1",
"User-Agent": "@vapi-ai/server-sdk/0.8.1",
"X-Fern-SDK-Version": "0.9.1",
"User-Agent": "@vapi-ai/server-sdk/0.9.1",
"X-Fern-Runtime": core.RUNTIME.type,
"X-Fern-Runtime-Version": core.RUNTIME.version,
...requestOptions?.headers,
@@ -209,8 +209,8 @@ export class TestSuiteTests {
Authorization: await this._getAuthorizationHeader(),
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "@vapi-ai/server-sdk",
"X-Fern-SDK-Version": "0.8.1",
"User-Agent": "@vapi-ai/server-sdk/0.8.1",
"X-Fern-SDK-Version": "0.9.1",
"User-Agent": "@vapi-ai/server-sdk/0.9.1",
"X-Fern-Runtime": core.RUNTIME.type,
"X-Fern-Runtime-Version": core.RUNTIME.version,
...requestOptions?.headers,
@@ -289,8 +289,8 @@ export class TestSuiteTests {
Authorization: await this._getAuthorizationHeader(),
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "@vapi-ai/server-sdk",
"X-Fern-SDK-Version": "0.8.1",
"User-Agent": "@vapi-ai/server-sdk/0.8.1",
"X-Fern-SDK-Version": "0.9.1",
"User-Agent": "@vapi-ai/server-sdk/0.9.1",
"X-Fern-Runtime": core.RUNTIME.type,
"X-Fern-Runtime-Version": core.RUNTIME.version,
...requestOptions?.headers,
@@ -370,8 +370,8 @@ export class TestSuiteTests {
Authorization: await this._getAuthorizationHeader(),
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "@vapi-ai/server-sdk",
"X-Fern-SDK-Version": "0.8.1",
"User-Agent": "@vapi-ai/server-sdk/0.8.1",
"X-Fern-SDK-Version": "0.9.1",
"User-Agent": "@vapi-ai/server-sdk/0.9.1",
"X-Fern-Runtime": core.RUNTIME.type,
"X-Fern-Runtime-Version": core.RUNTIME.version,
...requestOptions?.headers,
@@ -456,8 +456,8 @@ export class TestSuiteTests {
Authorization: await this._getAuthorizationHeader(),
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "@vapi-ai/server-sdk",
"X-Fern-SDK-Version": "0.8.1",
"User-Agent": "@vapi-ai/server-sdk/0.8.1",
"X-Fern-SDK-Version": "0.9.1",
"User-Agent": "@vapi-ai/server-sdk/0.9.1",
"X-Fern-Runtime": core.RUNTIME.type,
"X-Fern-Runtime-Version": core.RUNTIME.version,
...requestOptions?.headers,
@@ -503,12 +503,7 @@ export class TestSuiteTests {
}
}

protected async _getAuthorizationHeader(): Promise<string | undefined> {
const bearer = await core.Supplier.get(this._options.token);
if (bearer != null) {
return `Bearer ${bearer}`;
}

return undefined;
protected async _getAuthorizationHeader(): Promise<string> {
return `Bearer ${await core.Supplier.get(this._options.token)}`;
}
}
33 changes: 14 additions & 19 deletions src/api/resources/testSuites/client/Client.ts
Original file line number Diff line number Diff line change
@@ -13,7 +13,7 @@ export declare namespace TestSuites {
environment?: core.Supplier<environments.VapiEnvironment | string>;
/** Specify a custom URL to connect the client to. */
baseUrl?: core.Supplier<string>;
token?: core.Supplier<core.BearerToken | undefined>;
token: core.Supplier<core.BearerToken>;
fetcher?: core.FetchFunction;
}

@@ -30,7 +30,7 @@ export declare namespace TestSuites {
}

export class TestSuites {
constructor(protected readonly _options: TestSuites.Options = {}) {}
constructor(protected readonly _options: TestSuites.Options) {}

/**
* @param {Vapi.TestSuiteControllerFindAllPaginatedRequest} request
@@ -122,8 +122,8 @@ export class TestSuites {
Authorization: await this._getAuthorizationHeader(),
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "@vapi-ai/server-sdk",
"X-Fern-SDK-Version": "0.8.1",
"User-Agent": "@vapi-ai/server-sdk/0.8.1",
"X-Fern-SDK-Version": "0.9.1",
"User-Agent": "@vapi-ai/server-sdk/0.9.1",
"X-Fern-Runtime": core.RUNTIME.type,
"X-Fern-Runtime-Version": core.RUNTIME.version,
...requestOptions?.headers,
@@ -194,8 +194,8 @@ export class TestSuites {
Authorization: await this._getAuthorizationHeader(),
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "@vapi-ai/server-sdk",
"X-Fern-SDK-Version": "0.8.1",
"User-Agent": "@vapi-ai/server-sdk/0.8.1",
"X-Fern-SDK-Version": "0.9.1",
"User-Agent": "@vapi-ai/server-sdk/0.9.1",
"X-Fern-Runtime": core.RUNTIME.type,
"X-Fern-Runtime-Version": core.RUNTIME.version,
...requestOptions?.headers,
@@ -266,8 +266,8 @@ export class TestSuites {
Authorization: await this._getAuthorizationHeader(),
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "@vapi-ai/server-sdk",
"X-Fern-SDK-Version": "0.8.1",
"User-Agent": "@vapi-ai/server-sdk/0.8.1",
"X-Fern-SDK-Version": "0.9.1",
"User-Agent": "@vapi-ai/server-sdk/0.9.1",
"X-Fern-Runtime": core.RUNTIME.type,
"X-Fern-Runtime-Version": core.RUNTIME.version,
...requestOptions?.headers,
@@ -337,8 +337,8 @@ export class TestSuites {
Authorization: await this._getAuthorizationHeader(),
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "@vapi-ai/server-sdk",
"X-Fern-SDK-Version": "0.8.1",
"User-Agent": "@vapi-ai/server-sdk/0.8.1",
"X-Fern-SDK-Version": "0.9.1",
"User-Agent": "@vapi-ai/server-sdk/0.9.1",
"X-Fern-Runtime": core.RUNTIME.type,
"X-Fern-Runtime-Version": core.RUNTIME.version,
...requestOptions?.headers,
@@ -411,8 +411,8 @@ export class TestSuites {
Authorization: await this._getAuthorizationHeader(),
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "@vapi-ai/server-sdk",
"X-Fern-SDK-Version": "0.8.1",
"User-Agent": "@vapi-ai/server-sdk/0.8.1",
"X-Fern-SDK-Version": "0.9.1",
"User-Agent": "@vapi-ai/server-sdk/0.9.1",
"X-Fern-Runtime": core.RUNTIME.type,
"X-Fern-Runtime-Version": core.RUNTIME.version,
...requestOptions?.headers,
@@ -453,12 +453,7 @@ export class TestSuites {
}
}

protected async _getAuthorizationHeader(): Promise<string | undefined> {
const bearer = await core.Supplier.get(this._options.token);
if (bearer != null) {
return `Bearer ${bearer}`;
}

return undefined;
protected async _getAuthorizationHeader(): Promise<string> {
return `Bearer ${await core.Supplier.get(this._options.token)}`;
}
}
33 changes: 14 additions & 19 deletions src/api/resources/tools/client/Client.ts
Original file line number Diff line number Diff line change
@@ -13,7 +13,7 @@ export declare namespace Tools {
environment?: core.Supplier<environments.VapiEnvironment | string>;
/** Specify a custom URL to connect the client to. */
baseUrl?: core.Supplier<string>;
token?: core.Supplier<core.BearerToken | undefined>;
token: core.Supplier<core.BearerToken>;
fetcher?: core.FetchFunction;
}

@@ -30,7 +30,7 @@ export declare namespace Tools {
}

export class Tools {
constructor(protected readonly _options: Tools.Options = {}) {}
constructor(protected readonly _options: Tools.Options) {}

/**
* @param {Vapi.ToolsListRequest} request
@@ -110,8 +110,8 @@ export class Tools {
Authorization: await this._getAuthorizationHeader(),
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "@vapi-ai/server-sdk",
"X-Fern-SDK-Version": "0.8.1",
"User-Agent": "@vapi-ai/server-sdk/0.8.1",
"X-Fern-SDK-Version": "0.9.1",
"User-Agent": "@vapi-ai/server-sdk/0.9.1",
"X-Fern-Runtime": core.RUNTIME.type,
"X-Fern-Runtime-Version": core.RUNTIME.version,
...requestOptions?.headers,
@@ -184,8 +184,8 @@ export class Tools {
Authorization: await this._getAuthorizationHeader(),
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "@vapi-ai/server-sdk",
"X-Fern-SDK-Version": "0.8.1",
"User-Agent": "@vapi-ai/server-sdk/0.8.1",
"X-Fern-SDK-Version": "0.9.1",
"User-Agent": "@vapi-ai/server-sdk/0.9.1",
"X-Fern-Runtime": core.RUNTIME.type,
"X-Fern-Runtime-Version": core.RUNTIME.version,
...requestOptions?.headers,
@@ -253,8 +253,8 @@ export class Tools {
Authorization: await this._getAuthorizationHeader(),
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "@vapi-ai/server-sdk",
"X-Fern-SDK-Version": "0.8.1",
"User-Agent": "@vapi-ai/server-sdk/0.8.1",
"X-Fern-SDK-Version": "0.9.1",
"User-Agent": "@vapi-ai/server-sdk/0.9.1",
"X-Fern-Runtime": core.RUNTIME.type,
"X-Fern-Runtime-Version": core.RUNTIME.version,
...requestOptions?.headers,
@@ -324,8 +324,8 @@ export class Tools {
Authorization: await this._getAuthorizationHeader(),
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "@vapi-ai/server-sdk",
"X-Fern-SDK-Version": "0.8.1",
"User-Agent": "@vapi-ai/server-sdk/0.8.1",
"X-Fern-SDK-Version": "0.9.1",
"User-Agent": "@vapi-ai/server-sdk/0.9.1",
"X-Fern-Runtime": core.RUNTIME.type,
"X-Fern-Runtime-Version": core.RUNTIME.version,
...requestOptions?.headers,
@@ -398,8 +398,8 @@ export class Tools {
Authorization: await this._getAuthorizationHeader(),
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "@vapi-ai/server-sdk",
"X-Fern-SDK-Version": "0.8.1",
"User-Agent": "@vapi-ai/server-sdk/0.8.1",
"X-Fern-SDK-Version": "0.9.1",
"User-Agent": "@vapi-ai/server-sdk/0.9.1",
"X-Fern-Runtime": core.RUNTIME.type,
"X-Fern-Runtime-Version": core.RUNTIME.version,
...requestOptions?.headers,
@@ -440,12 +440,7 @@ export class Tools {
}
}

protected async _getAuthorizationHeader(): Promise<string | undefined> {
const bearer = await core.Supplier.get(this._options.token);
if (bearer != null) {
return `Bearer ${bearer}`;
}

return undefined;
protected async _getAuthorizationHeader(): Promise<string> {
return `Bearer ${await core.Supplier.get(this._options.token)}`;
}
}
33 changes: 14 additions & 19 deletions src/api/resources/workflow/client/Client.ts
Original file line number Diff line number Diff line change
@@ -13,7 +13,7 @@ export declare namespace Workflow {
environment?: core.Supplier<environments.VapiEnvironment | string>;
/** Specify a custom URL to connect the client to. */
baseUrl?: core.Supplier<string>;
token?: core.Supplier<core.BearerToken | undefined>;
token: core.Supplier<core.BearerToken>;
fetcher?: core.FetchFunction;
}

@@ -30,7 +30,7 @@ export declare namespace Workflow {
}

export class Workflow {
constructor(protected readonly _options: Workflow.Options = {}) {}
constructor(protected readonly _options: Workflow.Options) {}

/**
* @param {Workflow.RequestOptions} requestOptions - Request-specific configuration.
@@ -59,8 +59,8 @@ export class Workflow {
Authorization: await this._getAuthorizationHeader(),
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "@vapi-ai/server-sdk",
"X-Fern-SDK-Version": "0.8.1",
"User-Agent": "@vapi-ai/server-sdk/0.8.1",
"X-Fern-SDK-Version": "0.9.1",
"User-Agent": "@vapi-ai/server-sdk/0.9.1",
"X-Fern-Runtime": core.RUNTIME.type,
"X-Fern-Runtime-Version": core.RUNTIME.version,
...requestOptions?.headers,
@@ -140,8 +140,8 @@ export class Workflow {
Authorization: await this._getAuthorizationHeader(),
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "@vapi-ai/server-sdk",
"X-Fern-SDK-Version": "0.8.1",
"User-Agent": "@vapi-ai/server-sdk/0.8.1",
"X-Fern-SDK-Version": "0.9.1",
"User-Agent": "@vapi-ai/server-sdk/0.9.1",
"X-Fern-Runtime": core.RUNTIME.type,
"X-Fern-Runtime-Version": core.RUNTIME.version,
...requestOptions?.headers,
@@ -212,8 +212,8 @@ export class Workflow {
Authorization: await this._getAuthorizationHeader(),
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "@vapi-ai/server-sdk",
"X-Fern-SDK-Version": "0.8.1",
"User-Agent": "@vapi-ai/server-sdk/0.8.1",
"X-Fern-SDK-Version": "0.9.1",
"User-Agent": "@vapi-ai/server-sdk/0.9.1",
"X-Fern-Runtime": core.RUNTIME.type,
"X-Fern-Runtime-Version": core.RUNTIME.version,
...requestOptions?.headers,
@@ -283,8 +283,8 @@ export class Workflow {
Authorization: await this._getAuthorizationHeader(),
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "@vapi-ai/server-sdk",
"X-Fern-SDK-Version": "0.8.1",
"User-Agent": "@vapi-ai/server-sdk/0.8.1",
"X-Fern-SDK-Version": "0.9.1",
"User-Agent": "@vapi-ai/server-sdk/0.9.1",
"X-Fern-Runtime": core.RUNTIME.type,
"X-Fern-Runtime-Version": core.RUNTIME.version,
...requestOptions?.headers,
@@ -357,8 +357,8 @@ export class Workflow {
Authorization: await this._getAuthorizationHeader(),
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "@vapi-ai/server-sdk",
"X-Fern-SDK-Version": "0.8.1",
"User-Agent": "@vapi-ai/server-sdk/0.8.1",
"X-Fern-SDK-Version": "0.9.1",
"User-Agent": "@vapi-ai/server-sdk/0.9.1",
"X-Fern-Runtime": core.RUNTIME.type,
"X-Fern-Runtime-Version": core.RUNTIME.version,
...requestOptions?.headers,
@@ -399,12 +399,7 @@ export class Workflow {
}
}

protected async _getAuthorizationHeader(): Promise<string | undefined> {
const bearer = await core.Supplier.get(this._options.token);
if (bearer != null) {
return `Bearer ${bearer}`;
}

return undefined;
protected async _getAuthorizationHeader(): Promise<string> {
return `Bearer ${await core.Supplier.get(this._options.token)}`;
}
}
2 changes: 1 addition & 1 deletion src/version.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export const SDK_VERSION = "0.8.1";
export const SDK_VERSION = "0.9.1";
12 changes: 6 additions & 6 deletions yarn.lock
Original file line number Diff line number Diff line change
@@ -1309,9 +1309,9 @@ ejs@^3.1.10:
jake "^10.8.5"

electron-to-chromium@^1.5.149:
version "1.5.156"
resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.5.156.tgz#26bc1fe40d0f364410aaa92ffc13a3e9820f6aa5"
integrity sha512-QeOqv11TSASsY/3Ft3LUyDqEiEOph5/85srEPFUo9wuGFNTb0/z5fGE/+ZzTrYvSTGoXNkdQLTw3MKRmgyOyGA==
version "1.5.157"
resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.5.157.tgz#553b122522ac7bba6f1a0dd7d50b14f297736f75"
integrity sha512-/0ybgsQd1muo8QlnuTpKwtl0oX5YMlUGbm8xyqgDU00motRkKFFbUJySAQBWcY79rVqNLWIWa87BGVGClwAB2w==

emittery@^0.13.1:
version "0.13.1"
@@ -3072,9 +3072,9 @@ webidl-conversions@^7.0.0:
integrity sha512-VwddBukDzu71offAQR975unBIGqfKZpM+8ZX6ySk8nYhVoo5CYaZyzt3YBvYtRtO+aoGlqxPg/B87NGVZ/fu6g==

webpack-sources@^3.2.3:
version "3.2.3"
resolved "https://registry.yarnpkg.com/webpack-sources/-/webpack-sources-3.2.3.tgz#2d4daab8451fd4b240cc27055ff6a0c2ccea0cde"
integrity sha512-/DyMEOrDgLKKIG0fmvtz+4dUX/3Ghozwgm6iPp8KRhvn+eQf9+Q7GWxVNMk3+uCPWfdXYC4ExGBckIXdFEfH1w==
version "3.3.0"
resolved "https://registry.yarnpkg.com/webpack-sources/-/webpack-sources-3.3.0.tgz#8d3449f1ed3f254e722a529a0a344a37d2d17048"
integrity sha512-77R0RDmJfj9dyv5p3bM5pOHa+X8/ZkO9c7kpDstigkC4nIDobadsfSGCwB4bKhMVxqAok8tajaoR8rirM7+VFQ==

webpack@^5.97.1:
version "5.99.9"