Skip to content

Commit

Permalink
Release 0.0.42
Browse files Browse the repository at this point in the history
  • Loading branch information
fern-api[bot] committed Apr 15, 2024
1 parent 346a5f8 commit ae006b4
Show file tree
Hide file tree
Showing 82 changed files with 818 additions and 57 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.41",
"version": "0.0.42",
"private": false,
"repository": "https://github.com/vocodedev/vocode-api-node",
"main": "./index.js",
Expand Down
70 changes: 66 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.41",
"X-Fern-SDK-Version": "0.0.42",
},
contentType: "application/json",
queryParameters: _queryParams,
Expand Down Expand Up @@ -122,7 +122,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.41",
"X-Fern-SDK-Version": "0.0.42",
},
contentType: "application/json",
queryParameters: _queryParams,
Expand Down Expand Up @@ -187,7 +187,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.41",
"X-Fern-SDK-Version": "0.0.42",
},
contentType: "application/json",
body: await serializers.AccountConnectionParamsRequest.jsonOrThrow(request, {
Expand Down Expand Up @@ -257,7 +257,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.41",
"X-Fern-SDK-Version": "0.0.42",
},
contentType: "application/json",
queryParameters: _queryParams,
Expand Down Expand Up @@ -309,6 +309,68 @@ export class AccountConnections {
}
}

/**
* @throws {@link Vocode.UnprocessableEntityError}
*/
public async addToSteeringPool(request: Vocode.AddToSteeringPoolRequest): Promise<unknown> {
const { id, ..._body } = request;
const _queryParams = new URLSearchParams();
_queryParams.append("id", id);
const _response = await core.fetcher({
url: urlJoin(
(await core.Supplier.get(this._options.environment)) ?? environments.VocodeEnvironment.Production,
"v1/account_connections/add_to_steering_pool"
),
method: "POST",
headers: {
Authorization: await this._getAuthorizationHeader(),
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "@vocode/vocode-api",
"X-Fern-SDK-Version": "0.0.42",
},
contentType: "application/json",
queryParameters: _queryParams,
body: await serializers.AddToSteeringPoolRequest.jsonOrThrow(_body, { unrecognizedObjectKeys: "strip" }),
timeoutMs: 60000,
});
if (_response.ok) {
return _response.body;
}

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":
throw new errors.VocodeError({
message: _response.error.errorMessage,
});
}
}

protected async _getAuthorizationHeader() {
return `Bearer ${await core.Supplier.get(this._options.token)}`;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
/**
* This file was auto-generated by Fern from our API Definition.
*/

export interface AddToSteeringPoolRequest {
id: string;
phoneNumber?: string;
}
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
export { GetAccountConnectionRequest } from "./GetAccountConnectionRequest";
export { ListAccountConnectionsRequest } from "./ListAccountConnectionsRequest";
export { UpdateAccountConnectionRequest } from "./UpdateAccountConnectionRequest";
export { AddToSteeringPoolRequest } from "./AddToSteeringPoolRequest";
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.41",
"X-Fern-SDK-Version": "0.0.42",
},
contentType: "application/json",
queryParameters: _queryParams,
Expand Down Expand Up @@ -118,7 +118,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.41",
"X-Fern-SDK-Version": "0.0.42",
},
contentType: "application/json",
queryParameters: _queryParams,
Expand Down Expand Up @@ -181,7 +181,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.41",
"X-Fern-SDK-Version": "0.0.42",
},
contentType: "application/json",
body: await serializers.ActionParamsRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
Expand Down Expand Up @@ -247,7 +247,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.41",
"X-Fern-SDK-Version": "0.0.42",
},
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.41",
"X-Fern-SDK-Version": "0.0.42",
},
contentType: "application/json",
queryParameters: _queryParams,
Expand Down Expand Up @@ -118,7 +118,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.41",
"X-Fern-SDK-Version": "0.0.42",
},
contentType: "application/json",
queryParameters: _queryParams,
Expand Down Expand Up @@ -181,7 +181,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.41",
"X-Fern-SDK-Version": "0.0.42",
},
contentType: "application/json",
body: await serializers.AgentParams.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
Expand Down Expand Up @@ -247,7 +247,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.41",
"X-Fern-SDK-Version": "0.0.42",
},
contentType: "application/json",
queryParameters: _queryParams,
Expand Down
1 change: 1 addition & 0 deletions src/api/resources/agents/client/requests/AgentParams.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import * as Vocode from "../../../..";

export interface AgentParams {
name?: string;
prompt: Vocode.AgentParamsPrompt;
language?: Vocode.Language;
actions?: Vocode.AgentParamsActionsItem[];
Expand Down
7 changes: 6 additions & 1 deletion src/api/resources/agents/types/AgentParamsActionsItemOne.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ export type AgentParamsActionsItemOne =
| Vocode.AgentParamsActionsItemOne.ActionEndConversation
| Vocode.AgentParamsActionsItemOne.ActionDtmf
| Vocode.AgentParamsActionsItemOne.ActionAddToConference
| Vocode.AgentParamsActionsItemOne.ActionSetHold;
| Vocode.AgentParamsActionsItemOne.ActionSetHold
| Vocode.AgentParamsActionsItemOne.ActionExternal;

export declare namespace AgentParamsActionsItemOne {
interface ActionTransferCall extends Vocode.TransferCallActionParams {
Expand All @@ -31,4 +32,8 @@ export declare namespace AgentParamsActionsItemOne {
interface ActionSetHold extends Vocode.SetHoldActionParams {
type: "action_set_hold";
}

interface ActionExternal extends Vocode.ExternalActionParams {
type: "action_external";
}
}
10 changes: 5 additions & 5 deletions src/api/resources/calls/client/Client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,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.41",
"X-Fern-SDK-Version": "0.0.42",
},
contentType: "application/json",
queryParameters: _queryParams,
Expand Down Expand Up @@ -122,7 +122,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.41",
"X-Fern-SDK-Version": "0.0.42",
},
contentType: "application/json",
queryParameters: _queryParams,
Expand Down Expand Up @@ -188,7 +188,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.41",
"X-Fern-SDK-Version": "0.0.42",
},
contentType: "application/json",
queryParameters: _queryParams,
Expand Down Expand Up @@ -251,7 +251,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.41",
"X-Fern-SDK-Version": "0.0.42",
},
contentType: "application/json",
body: await serializers.CreateCallRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
Expand Down Expand Up @@ -314,7 +314,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.41",
"X-Fern-SDK-Version": "0.0.42",
},
queryParameters: _queryParams,
timeoutMs: 60000,
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 @@ -55,7 +55,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.41",
"X-Fern-SDK-Version": "0.0.42",
},
contentType: "application/json",
queryParameters: _queryParams,
Expand Down Expand Up @@ -121,7 +121,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.41",
"X-Fern-SDK-Version": "0.0.42",
},
contentType: "application/json",
queryParameters: _queryParams,
Expand Down Expand Up @@ -184,7 +184,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.41",
"X-Fern-SDK-Version": "0.0.42",
},
contentType: "application/json",
body: await serializers.BuyPhoneNumberRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
Expand Down Expand Up @@ -250,7 +250,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.41",
"X-Fern-SDK-Version": "0.0.42",
},
contentType: "application/json",
queryParameters: _queryParams,
Expand Down Expand Up @@ -317,7 +317,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.41",
"X-Fern-SDK-Version": "0.0.42",
},
contentType: "application/json",
queryParameters: _queryParams,
Expand Down Expand Up @@ -380,7 +380,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.41",
"X-Fern-SDK-Version": "0.0.42",
},
contentType: "application/json",
body: await serializers.LinkPhoneNumberRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
Expand Down
8 changes: 4 additions & 4 deletions src/api/resources/prompts/client/Client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ export class Prompts {
Authorization: await this._getAuthorizationHeader(),
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "@vocode/vocode-api",
"X-Fern-SDK-Version": "0.0.41",
"X-Fern-SDK-Version": "0.0.42",
},
contentType: "application/json",
queryParameters: _queryParams,
Expand Down Expand Up @@ -118,7 +118,7 @@ export class Prompts {
Authorization: await this._getAuthorizationHeader(),
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "@vocode/vocode-api",
"X-Fern-SDK-Version": "0.0.41",
"X-Fern-SDK-Version": "0.0.42",
},
contentType: "application/json",
queryParameters: _queryParams,
Expand Down Expand Up @@ -181,7 +181,7 @@ export class Prompts {
Authorization: await this._getAuthorizationHeader(),
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "@vocode/vocode-api",
"X-Fern-SDK-Version": "0.0.41",
"X-Fern-SDK-Version": "0.0.42",
},
contentType: "application/json",
body: await serializers.PromptParams.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
Expand Down Expand Up @@ -247,7 +247,7 @@ export class Prompts {
Authorization: await this._getAuthorizationHeader(),
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "@vocode/vocode-api",
"X-Fern-SDK-Version": "0.0.41",
"X-Fern-SDK-Version": "0.0.42",
},
contentType: "application/json",
queryParameters: _queryParams,
Expand Down
2 changes: 1 addition & 1 deletion src/api/resources/usage/client/Client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export class Usage {
Authorization: await this._getAuthorizationHeader(),
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "@vocode/vocode-api",
"X-Fern-SDK-Version": "0.0.41",
"X-Fern-SDK-Version": "0.0.42",
},
contentType: "application/json",
timeoutMs: 60000,
Expand Down
Loading

0 comments on commit ae006b4

Please sign in to comment.