From 179030abea017d08fea8ba3ea1871e8d5d7aa952 Mon Sep 17 00:00:00 2001 From: fern-api <115122769+fern-api[bot]@users.noreply.github.com> Date: Fri, 23 May 2025 23:10:25 +0000 Subject: [PATCH] SDK regeneration --- package.json | 2 +- reference.md | 42 ---------- src/Client.ts | 81 +------------------ src/api/resources/analytics/client/Client.ts | 17 ++-- src/api/resources/assistants/client/Client.ts | 33 ++++---- src/api/resources/calls/client/Client.ts | 33 ++++---- src/api/resources/files/client/Client.ts | 33 ++++---- .../resources/knowledgeBases/client/Client.ts | 33 ++++---- src/api/resources/logs/client/Client.ts | 21 ++--- .../resources/phoneNumbers/client/Client.ts | 33 ++++---- src/api/resources/squads/client/Client.ts | 33 ++++---- .../resources/testSuiteRuns/client/Client.ts | 33 ++++---- .../resources/testSuiteTests/client/Client.ts | 33 ++++---- src/api/resources/testSuites/client/Client.ts | 33 ++++---- src/api/resources/tools/client/Client.ts | 33 ++++---- src/api/resources/workflow/client/Client.ts | 33 ++++---- src/version.ts | 2 +- yarn.lock | 12 +-- 18 files changed, 178 insertions(+), 362 deletions(-) diff --git a/package.json b/package.json index 5f86015..3af1344 100644 --- a/package.json +++ b/package.json @@ -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", diff --git a/reference.md b/reference.md index 6599cfb..89d25d7 100644 --- a/reference.md +++ b/reference.md @@ -1,47 +1,5 @@ # Reference -
client.prometheusControllerIndex() -> void -
-
- -#### 🔌 Usage - -
-
- -
-
- -```typescript -await client.prometheusControllerIndex(); -``` - -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**requestOptions:** `VapiClient.RequestOptions` - -
-
-
-
- -
-
-
- -## - ## Calls
client.calls.list({ ...params }) -> Vapi.Call[] diff --git a/src/Client.ts b/src/Client.ts index fbea6ce..c5a7e2b 100644 --- a/src/Client.ts +++ b/src/Client.ts @@ -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; /** Specify a custom URL to connect the client to. */ baseUrl?: core.Supplier; - token?: core.Supplier; + token: core.Supplier; 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 { - return core.HttpResponsePromise.fromPromise(this.__prometheusControllerIndex(requestOptions)); - } - - private async __prometheusControllerIndex( - requestOptions?: VapiClient.RequestOptions, - ): Promise> { - 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 { - const bearer = await core.Supplier.get(this._options.token); - if (bearer != null) { - return `Bearer ${bearer}`; - } - - return undefined; - } } diff --git a/src/api/resources/analytics/client/Client.ts b/src/api/resources/analytics/client/Client.ts index 3f9efa3..45890a4 100644 --- a/src/api/resources/analytics/client/Client.ts +++ b/src/api/resources/analytics/client/Client.ts @@ -13,7 +13,7 @@ export declare namespace Analytics { environment?: core.Supplier; /** Specify a custom URL to connect the client to. */ baseUrl?: core.Supplier; - token?: core.Supplier; + token: core.Supplier; 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 { - const bearer = await core.Supplier.get(this._options.token); - if (bearer != null) { - return `Bearer ${bearer}`; - } - - return undefined; + protected async _getAuthorizationHeader(): Promise { + return `Bearer ${await core.Supplier.get(this._options.token)}`; } } diff --git a/src/api/resources/assistants/client/Client.ts b/src/api/resources/assistants/client/Client.ts index bf8ac8c..1ea48b6 100644 --- a/src/api/resources/assistants/client/Client.ts +++ b/src/api/resources/assistants/client/Client.ts @@ -13,7 +13,7 @@ export declare namespace Assistants { environment?: core.Supplier; /** Specify a custom URL to connect the client to. */ baseUrl?: core.Supplier; - token?: core.Supplier; + token: core.Supplier; 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 { - const bearer = await core.Supplier.get(this._options.token); - if (bearer != null) { - return `Bearer ${bearer}`; - } - - return undefined; + protected async _getAuthorizationHeader(): Promise { + return `Bearer ${await core.Supplier.get(this._options.token)}`; } } diff --git a/src/api/resources/calls/client/Client.ts b/src/api/resources/calls/client/Client.ts index 9eb28d0..1da5721 100644 --- a/src/api/resources/calls/client/Client.ts +++ b/src/api/resources/calls/client/Client.ts @@ -13,7 +13,7 @@ export declare namespace Calls { environment?: core.Supplier; /** Specify a custom URL to connect the client to. */ baseUrl?: core.Supplier; - token?: core.Supplier; + token: core.Supplier; 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 { - const bearer = await core.Supplier.get(this._options.token); - if (bearer != null) { - return `Bearer ${bearer}`; - } - - return undefined; + protected async _getAuthorizationHeader(): Promise { + return `Bearer ${await core.Supplier.get(this._options.token)}`; } } diff --git a/src/api/resources/files/client/Client.ts b/src/api/resources/files/client/Client.ts index e16f680..ae09f86 100644 --- a/src/api/resources/files/client/Client.ts +++ b/src/api/resources/files/client/Client.ts @@ -15,7 +15,7 @@ export declare namespace Files { environment?: core.Supplier; /** Specify a custom URL to connect the client to. */ baseUrl?: core.Supplier; - token?: core.Supplier; + token: core.Supplier; 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 { - const bearer = await core.Supplier.get(this._options.token); - if (bearer != null) { - return `Bearer ${bearer}`; - } - - return undefined; + protected async _getAuthorizationHeader(): Promise { + return `Bearer ${await core.Supplier.get(this._options.token)}`; } } diff --git a/src/api/resources/knowledgeBases/client/Client.ts b/src/api/resources/knowledgeBases/client/Client.ts index cf8327b..1831d23 100644 --- a/src/api/resources/knowledgeBases/client/Client.ts +++ b/src/api/resources/knowledgeBases/client/Client.ts @@ -13,7 +13,7 @@ export declare namespace KnowledgeBases { environment?: core.Supplier; /** Specify a custom URL to connect the client to. */ baseUrl?: core.Supplier; - token?: core.Supplier; + token: core.Supplier; 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 { - const bearer = await core.Supplier.get(this._options.token); - if (bearer != null) { - return `Bearer ${bearer}`; - } - - return undefined; + protected async _getAuthorizationHeader(): Promise { + return `Bearer ${await core.Supplier.get(this._options.token)}`; } } diff --git a/src/api/resources/logs/client/Client.ts b/src/api/resources/logs/client/Client.ts index 0301cee..4adef4b 100644 --- a/src/api/resources/logs/client/Client.ts +++ b/src/api/resources/logs/client/Client.ts @@ -13,7 +13,7 @@ export declare namespace Logs { environment?: core.Supplier; /** Specify a custom URL to connect the client to. */ baseUrl?: core.Supplier; - token?: core.Supplier; + token: core.Supplier; 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 { - const bearer = await core.Supplier.get(this._options.token); - if (bearer != null) { - return `Bearer ${bearer}`; - } - - return undefined; + protected async _getAuthorizationHeader(): Promise { + return `Bearer ${await core.Supplier.get(this._options.token)}`; } } diff --git a/src/api/resources/phoneNumbers/client/Client.ts b/src/api/resources/phoneNumbers/client/Client.ts index de0435d..2bde9bf 100644 --- a/src/api/resources/phoneNumbers/client/Client.ts +++ b/src/api/resources/phoneNumbers/client/Client.ts @@ -13,7 +13,7 @@ export declare namespace PhoneNumbers { environment?: core.Supplier; /** Specify a custom URL to connect the client to. */ baseUrl?: core.Supplier; - token?: core.Supplier; + token: core.Supplier; 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 { - const bearer = await core.Supplier.get(this._options.token); - if (bearer != null) { - return `Bearer ${bearer}`; - } - - return undefined; + protected async _getAuthorizationHeader(): Promise { + return `Bearer ${await core.Supplier.get(this._options.token)}`; } } diff --git a/src/api/resources/squads/client/Client.ts b/src/api/resources/squads/client/Client.ts index 943d2ef..eed1363 100644 --- a/src/api/resources/squads/client/Client.ts +++ b/src/api/resources/squads/client/Client.ts @@ -13,7 +13,7 @@ export declare namespace Squads { environment?: core.Supplier; /** Specify a custom URL to connect the client to. */ baseUrl?: core.Supplier; - token?: core.Supplier; + token: core.Supplier; 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 { - const bearer = await core.Supplier.get(this._options.token); - if (bearer != null) { - return `Bearer ${bearer}`; - } - - return undefined; + protected async _getAuthorizationHeader(): Promise { + return `Bearer ${await core.Supplier.get(this._options.token)}`; } } diff --git a/src/api/resources/testSuiteRuns/client/Client.ts b/src/api/resources/testSuiteRuns/client/Client.ts index 7f070fb..bdbddb0 100644 --- a/src/api/resources/testSuiteRuns/client/Client.ts +++ b/src/api/resources/testSuiteRuns/client/Client.ts @@ -13,7 +13,7 @@ export declare namespace TestSuiteRuns { environment?: core.Supplier; /** Specify a custom URL to connect the client to. */ baseUrl?: core.Supplier; - token?: core.Supplier; + token: core.Supplier; 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 { - const bearer = await core.Supplier.get(this._options.token); - if (bearer != null) { - return `Bearer ${bearer}`; - } - - return undefined; + protected async _getAuthorizationHeader(): Promise { + return `Bearer ${await core.Supplier.get(this._options.token)}`; } } diff --git a/src/api/resources/testSuiteTests/client/Client.ts b/src/api/resources/testSuiteTests/client/Client.ts index a7f8f38..9635134 100644 --- a/src/api/resources/testSuiteTests/client/Client.ts +++ b/src/api/resources/testSuiteTests/client/Client.ts @@ -13,7 +13,7 @@ export declare namespace TestSuiteTests { environment?: core.Supplier; /** Specify a custom URL to connect the client to. */ baseUrl?: core.Supplier; - token?: core.Supplier; + token: core.Supplier; 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 { - const bearer = await core.Supplier.get(this._options.token); - if (bearer != null) { - return `Bearer ${bearer}`; - } - - return undefined; + protected async _getAuthorizationHeader(): Promise { + return `Bearer ${await core.Supplier.get(this._options.token)}`; } } diff --git a/src/api/resources/testSuites/client/Client.ts b/src/api/resources/testSuites/client/Client.ts index df86b3a..17d32d8 100644 --- a/src/api/resources/testSuites/client/Client.ts +++ b/src/api/resources/testSuites/client/Client.ts @@ -13,7 +13,7 @@ export declare namespace TestSuites { environment?: core.Supplier; /** Specify a custom URL to connect the client to. */ baseUrl?: core.Supplier; - token?: core.Supplier; + token: core.Supplier; 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 { - const bearer = await core.Supplier.get(this._options.token); - if (bearer != null) { - return `Bearer ${bearer}`; - } - - return undefined; + protected async _getAuthorizationHeader(): Promise { + return `Bearer ${await core.Supplier.get(this._options.token)}`; } } diff --git a/src/api/resources/tools/client/Client.ts b/src/api/resources/tools/client/Client.ts index b6d7e27..e479c82 100644 --- a/src/api/resources/tools/client/Client.ts +++ b/src/api/resources/tools/client/Client.ts @@ -13,7 +13,7 @@ export declare namespace Tools { environment?: core.Supplier; /** Specify a custom URL to connect the client to. */ baseUrl?: core.Supplier; - token?: core.Supplier; + token: core.Supplier; 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 { - const bearer = await core.Supplier.get(this._options.token); - if (bearer != null) { - return `Bearer ${bearer}`; - } - - return undefined; + protected async _getAuthorizationHeader(): Promise { + return `Bearer ${await core.Supplier.get(this._options.token)}`; } } diff --git a/src/api/resources/workflow/client/Client.ts b/src/api/resources/workflow/client/Client.ts index d50b996..fbd4a16 100644 --- a/src/api/resources/workflow/client/Client.ts +++ b/src/api/resources/workflow/client/Client.ts @@ -13,7 +13,7 @@ export declare namespace Workflow { environment?: core.Supplier; /** Specify a custom URL to connect the client to. */ baseUrl?: core.Supplier; - token?: core.Supplier; + token: core.Supplier; 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 { - const bearer = await core.Supplier.get(this._options.token); - if (bearer != null) { - return `Bearer ${bearer}`; - } - - return undefined; + protected async _getAuthorizationHeader(): Promise { + return `Bearer ${await core.Supplier.get(this._options.token)}`; } } diff --git a/src/version.ts b/src/version.ts index 09eb69d..9ba59d6 100644 --- a/src/version.ts +++ b/src/version.ts @@ -1 +1 @@ -export const SDK_VERSION = "0.8.1"; +export const SDK_VERSION = "0.9.1"; diff --git a/yarn.lock b/yarn.lock index efbcdb5..1680615 100644 --- a/yarn.lock +++ b/yarn.lock @@ -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"