Skip to content

Commit

Permalink
Release 0.0.37
Browse files Browse the repository at this point in the history
  • Loading branch information
fern-api[bot] committed Jan 9, 2024
1 parent 493e6d5 commit 59e8631
Show file tree
Hide file tree
Showing 71 changed files with 478 additions and 391 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@vocode/vocode-api",
"version": "0.0.36",
"version": "0.0.37",
"private": false,
"repository": "https://github.com/vocodedev/vocode-api-node",
"main": "./index.js",
Expand Down
2 changes: 1 addition & 1 deletion src/api/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
export * from "./resources";
export * from "./types";
export * from "./errors";
export * from "./resources";
8 changes: 4 additions & 4 deletions src/api/resources/accountConnections/client/Client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export class AccountConnections {
Authorization: await this._getAuthorizationHeader(),
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "@vocode/vocode-api",
"X-Fern-SDK-Version": "0.0.36",
"X-Fern-SDK-Version": "0.0.37",
},
contentType: "application/json",
queryParameters: _queryParams,
Expand Down Expand Up @@ -114,7 +114,7 @@ export class AccountConnections {
Authorization: await this._getAuthorizationHeader(),
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "@vocode/vocode-api",
"X-Fern-SDK-Version": "0.0.36",
"X-Fern-SDK-Version": "0.0.37",
},
contentType: "application/json",
queryParameters: _queryParams,
Expand Down Expand Up @@ -179,7 +179,7 @@ export class AccountConnections {
Authorization: await this._getAuthorizationHeader(),
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "@vocode/vocode-api",
"X-Fern-SDK-Version": "0.0.36",
"X-Fern-SDK-Version": "0.0.37",
},
contentType: "application/json",
body: await serializers.AccountConnectionParamsRequest.jsonOrThrow(request, {
Expand Down Expand Up @@ -249,7 +249,7 @@ export class AccountConnections {
Authorization: await this._getAuthorizationHeader(),
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "@vocode/vocode-api",
"X-Fern-SDK-Version": "0.0.36",
"X-Fern-SDK-Version": "0.0.37",
},
contentType: "application/json",
queryParameters: _queryParams,
Expand Down
8 changes: 4 additions & 4 deletions src/api/resources/actions/client/Client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ export class Actions {
Authorization: await this._getAuthorizationHeader(),
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "@vocode/vocode-api",
"X-Fern-SDK-Version": "0.0.36",
"X-Fern-SDK-Version": "0.0.37",
},
contentType: "application/json",
queryParameters: _queryParams,
Expand Down Expand Up @@ -110,7 +110,7 @@ export class Actions {
Authorization: await this._getAuthorizationHeader(),
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "@vocode/vocode-api",
"X-Fern-SDK-Version": "0.0.36",
"X-Fern-SDK-Version": "0.0.37",
},
contentType: "application/json",
queryParameters: _queryParams,
Expand Down Expand Up @@ -173,7 +173,7 @@ export class Actions {
Authorization: await this._getAuthorizationHeader(),
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "@vocode/vocode-api",
"X-Fern-SDK-Version": "0.0.36",
"X-Fern-SDK-Version": "0.0.37",
},
contentType: "application/json",
body: await serializers.ActionParamsRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
Expand Down Expand Up @@ -239,7 +239,7 @@ export class Actions {
Authorization: await this._getAuthorizationHeader(),
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "@vocode/vocode-api",
"X-Fern-SDK-Version": "0.0.36",
"X-Fern-SDK-Version": "0.0.37",
},
contentType: "application/json",
queryParameters: _queryParams,
Expand Down
8 changes: 4 additions & 4 deletions src/api/resources/agents/client/Client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ export class Agents {
Authorization: await this._getAuthorizationHeader(),
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "@vocode/vocode-api",
"X-Fern-SDK-Version": "0.0.36",
"X-Fern-SDK-Version": "0.0.37",
},
contentType: "application/json",
queryParameters: _queryParams,
Expand Down Expand Up @@ -110,7 +110,7 @@ export class Agents {
Authorization: await this._getAuthorizationHeader(),
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "@vocode/vocode-api",
"X-Fern-SDK-Version": "0.0.36",
"X-Fern-SDK-Version": "0.0.37",
},
contentType: "application/json",
queryParameters: _queryParams,
Expand Down Expand Up @@ -173,7 +173,7 @@ export class Agents {
Authorization: await this._getAuthorizationHeader(),
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "@vocode/vocode-api",
"X-Fern-SDK-Version": "0.0.36",
"X-Fern-SDK-Version": "0.0.37",
},
contentType: "application/json",
body: await serializers.AgentParams.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
Expand Down Expand Up @@ -239,7 +239,7 @@ export class Agents {
Authorization: await this._getAuthorizationHeader(),
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "@vocode/vocode-api",
"X-Fern-SDK-Version": "0.0.36",
"X-Fern-SDK-Version": "0.0.37",
},
contentType: "application/json",
queryParameters: _queryParams,
Expand Down
1 change: 1 addition & 0 deletions src/api/resources/agents/index.ts
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
export * from "./types";
export * from "./client";
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
* This file was auto-generated by Fern from our API Definition.
*/

import * as Vocode from "..";
import * as Vocode from "../../..";

export type AgentParamsActionsItem = string | Vocode.AgentParamsActionsItemOne;
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* This file was auto-generated by Fern from our API Definition.
*/

import * as Vocode from "..";
import * as Vocode from "../../..";

export type AgentParamsActionsItemOne =
| Vocode.AgentParamsActionsItemOne.ActionTransferCall
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
* This file was auto-generated by Fern from our API Definition.
*/

import * as Vocode from "..";
import * as Vocode from "../../..";

export type AgentParamsOpenaiAccountConnection = Vocode.OpenAiAccountConnection | string;
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
* This file was auto-generated by Fern from our API Definition.
*/

import * as Vocode from "..";
import * as Vocode from "../../..";

export type AgentParamsPrompt = string | Vocode.PromptParams;
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
* This file was auto-generated by Fern from our API Definition.
*/

import * as Vocode from "..";
import * as Vocode from "../../..";

export type AgentParamsVectorDatabase = string | Vocode.PineconeVectorDatabaseParams;
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
* This file was auto-generated by Fern from our API Definition.
*/

import * as Vocode from "..";
import * as Vocode from "../../..";

export type AgentParamsVoice = string | Vocode.AgentParamsVoiceOne;
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* This file was auto-generated by Fern from our API Definition.
*/

import * as Vocode from "..";
import * as Vocode from "../../..";

export type AgentParamsVoiceOne =
| Vocode.AgentParamsVoiceOne.VoiceAzure
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
* This file was auto-generated by Fern from our API Definition.
*/

import * as Vocode from "..";
import * as Vocode from "../../..";

export type AgentParamsWebhook = string | Vocode.WebhookParams;
10 changes: 10 additions & 0 deletions src/api/resources/agents/types/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
export * from "./AgentParamsPrompt";
export * from "./AgentParamsActionsItemOne";
export * from "./AgentParamsActionsItem";
export * from "./AgentParamsVoiceOne";
export * from "./AgentParamsVoice";
export * from "./AgentParamsWebhook";
export * from "./AgentParamsVectorDatabase";
export * from "./AgentParamsEndpointingSensitivity";
export * from "./AgentParamsIvrNavigationMode";
export * from "./AgentParamsOpenaiAccountConnection";
59 changes: 13 additions & 46 deletions src/api/resources/calls/client/Client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import { default as URLSearchParams } from "@ungap/url-search-params";
import urlJoin from "url-join";
import * as serializers from "../../../../serialization";
import * as errors from "../../../../errors";
import * as stream from "stream";

export declare namespace Calls {
interface Options {
Expand Down Expand Up @@ -47,7 +48,7 @@ export class Calls {
Authorization: await this._getAuthorizationHeader(),
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "@vocode/vocode-api",
"X-Fern-SDK-Version": "0.0.36",
"X-Fern-SDK-Version": "0.0.37",
},
contentType: "application/json",
queryParameters: _queryParams,
Expand Down Expand Up @@ -113,7 +114,7 @@ export class Calls {
Authorization: await this._getAuthorizationHeader(),
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "@vocode/vocode-api",
"X-Fern-SDK-Version": "0.0.36",
"X-Fern-SDK-Version": "0.0.37",
},
contentType: "application/json",
queryParameters: _queryParams,
Expand Down Expand Up @@ -179,7 +180,7 @@ export class Calls {
Authorization: await this._getAuthorizationHeader(),
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "@vocode/vocode-api",
"X-Fern-SDK-Version": "0.0.36",
"X-Fern-SDK-Version": "0.0.37",
},
contentType: "application/json",
queryParameters: _queryParams,
Expand Down Expand Up @@ -242,7 +243,7 @@ export class Calls {
Authorization: await this._getAuthorizationHeader(),
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "@vocode/vocode-api",
"X-Fern-SDK-Version": "0.0.36",
"X-Fern-SDK-Version": "0.0.37",
},
contentType: "application/json",
body: await serializers.CreateCallRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
Expand Down Expand Up @@ -291,14 +292,11 @@ export class Calls {
}
}

/**
* @throws {@link Vocode.UnprocessableEntityError}
*/
public async getRecording(request: Vocode.GetRecordingRequest): Promise<void> {
public async getRecording(request: Vocode.GetRecordingRequest): Promise<stream.Readable> {
const { id } = request;
const _queryParams = new URLSearchParams();
_queryParams.append("id", id);
const _response = await core.fetcher({
const _response = await core.streamingFetcher({
url: urlJoin(
(await core.Supplier.get(this._options.environment)) ?? environments.VocodeEnvironment.Production,
"v1/calls/recording"
Expand All @@ -308,48 +306,17 @@ export class Calls {
Authorization: await this._getAuthorizationHeader(),
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "@vocode/vocode-api",
"X-Fern-SDK-Version": "0.0.36",
"X-Fern-SDK-Version": "0.0.37",
},
contentType: "application/json",
queryParameters: _queryParams,
timeoutMs: 60000,
});
if (_response.ok) {
return;
}

if (_response.error.reason === "status-code") {
switch (_response.error.statusCode) {
case 422:
throw new Vocode.UnprocessableEntityError(
await serializers.HttpValidationError.parseOrThrow(_response.error.body, {
unrecognizedObjectKeys: "passthrough",
allowUnrecognizedUnionMembers: true,
allowUnrecognizedEnumValues: true,
breadcrumbsPrefix: ["response"],
})
);
default:
throw new errors.VocodeError({
statusCode: _response.error.statusCode,
body: _response.error.body,
});
}
}

switch (_response.error.reason) {
case "non-json":
throw new errors.VocodeError({
statusCode: _response.error.statusCode,
body: _response.error.rawBody,
});
case "timeout":
throw new errors.VocodeTimeoutError();
case "unknown":
onError: (error) => {
throw new errors.VocodeError({
message: _response.error.errorMessage,
message: (error as any)?.message,
});
}
},
});
return _response.data;
}

protected async _getAuthorizationHeader() {
Expand Down
1 change: 1 addition & 0 deletions src/api/resources/calls/index.ts
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
export * from "./types";
export * from "./client";
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
* This file was auto-generated by Fern from our API Definition.
*/

import * as Vocode from "..";
import * as Vocode from "../../..";

export type CreateCallRequestAgent = string | Vocode.CreateCallAgentParams;
2 changes: 2 additions & 0 deletions src/api/resources/calls/types/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
export * from "./CreateCallRequestAgent";
export * from "./CreateCallRequestOnNoHumanAnswer";
5 changes: 4 additions & 1 deletion src/api/resources/index.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
export * as numbers from "./numbers";
export * from "./numbers/types";
export * as calls from "./calls";
export * from "./calls/types";
export * as agents from "./agents";
export * from "./agents/types";
export * as usage from "./usage";
export * as actions from "./actions";
export * as agents from "./agents";
export * as voices from "./voices";
export * as webhooks from "./webhooks";
export * as prompts from "./prompts";
Expand Down
12 changes: 6 additions & 6 deletions src/api/resources/numbers/client/Client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ export class Numbers {
Authorization: await this._getAuthorizationHeader(),
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "@vocode/vocode-api",
"X-Fern-SDK-Version": "0.0.36",
"X-Fern-SDK-Version": "0.0.37",
},
contentType: "application/json",
queryParameters: _queryParams,
Expand Down Expand Up @@ -113,7 +113,7 @@ export class Numbers {
Authorization: await this._getAuthorizationHeader(),
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "@vocode/vocode-api",
"X-Fern-SDK-Version": "0.0.36",
"X-Fern-SDK-Version": "0.0.37",
},
contentType: "application/json",
queryParameters: _queryParams,
Expand Down Expand Up @@ -176,7 +176,7 @@ export class Numbers {
Authorization: await this._getAuthorizationHeader(),
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "@vocode/vocode-api",
"X-Fern-SDK-Version": "0.0.36",
"X-Fern-SDK-Version": "0.0.37",
},
contentType: "application/json",
body: await serializers.BuyPhoneNumberRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
Expand Down Expand Up @@ -242,7 +242,7 @@ export class Numbers {
Authorization: await this._getAuthorizationHeader(),
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "@vocode/vocode-api",
"X-Fern-SDK-Version": "0.0.36",
"X-Fern-SDK-Version": "0.0.37",
},
contentType: "application/json",
queryParameters: _queryParams,
Expand Down Expand Up @@ -309,7 +309,7 @@ export class Numbers {
Authorization: await this._getAuthorizationHeader(),
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "@vocode/vocode-api",
"X-Fern-SDK-Version": "0.0.36",
"X-Fern-SDK-Version": "0.0.37",
},
contentType: "application/json",
queryParameters: _queryParams,
Expand Down Expand Up @@ -372,7 +372,7 @@ export class Numbers {
Authorization: await this._getAuthorizationHeader(),
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "@vocode/vocode-api",
"X-Fern-SDK-Version": "0.0.36",
"X-Fern-SDK-Version": "0.0.37",
},
contentType: "application/json",
body: await serializers.LinkPhoneNumberRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
Expand Down
Loading

0 comments on commit 59e8631

Please sign in to comment.