Skip to content

Commit

Permalink
Release 0.0.22
Browse files Browse the repository at this point in the history
  • Loading branch information
fern-api[bot] committed Sep 19, 2023
1 parent eac8ead commit fbb31e1
Show file tree
Hide file tree
Showing 29 changed files with 135 additions and 44 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.21",
"version": "0.0.22",
"private": false,
"repository": "https://github.com/vocodedev/vocode-api-node",
"main": "./index.js",
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.21",
"X-Fern-SDK-Version": "0.0.22",
},
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.21",
"X-Fern-SDK-Version": "0.0.22",
},
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.21",
"X-Fern-SDK-Version": "0.0.22",
},
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.21",
"X-Fern-SDK-Version": "0.0.22",
},
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.21",
"X-Fern-SDK-Version": "0.0.22",
},
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.21",
"X-Fern-SDK-Version": "0.0.22",
},
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.21",
"X-Fern-SDK-Version": "0.0.22",
},
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.21",
"X-Fern-SDK-Version": "0.0.22",
},
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 @@ -17,4 +17,5 @@ export interface AgentParams {
noiseSuppression?: boolean;
endpointingSensitivity?: Vocode.AgentParamsEndpointingSensitivity;
ivrNavigationMode?: Vocode.AgentParamsIvrNavigationMode;
conversationSpeed?: number;
}
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 @@ -47,7 +47,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.21",
"X-Fern-SDK-Version": "0.0.22",
},
contentType: "application/json",
queryParameters: _queryParams,
Expand Down Expand Up @@ -113,7 +113,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.21",
"X-Fern-SDK-Version": "0.0.22",
},
contentType: "application/json",
queryParameters: _queryParams,
Expand Down Expand Up @@ -179,7 +179,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.21",
"X-Fern-SDK-Version": "0.0.22",
},
contentType: "application/json",
queryParameters: _queryParams,
Expand Down Expand Up @@ -242,7 +242,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.21",
"X-Fern-SDK-Version": "0.0.22",
},
contentType: "application/json",
body: await serializers.CreateCallRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
Expand Down Expand Up @@ -308,7 +308,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.21",
"X-Fern-SDK-Version": "0.0.22",
},
contentType: "application/json",
queryParameters: _queryParams,
Expand Down
36 changes: 26 additions & 10 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.21",
"X-Fern-SDK-Version": "0.0.22",
},
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.21",
"X-Fern-SDK-Version": "0.0.22",
},
contentType: "application/json",
queryParameters: _queryParams,
Expand Down Expand Up @@ -162,7 +162,10 @@ export class Numbers {
}
}

public async buyNumber(): Promise<Vocode.PhoneNumber> {
/**
* @throws {@link Vocode.UnprocessableEntityError}
*/
public async buyNumber(request: Vocode.BuyPhoneNumberRequest = {}): Promise<Vocode.PhoneNumber> {
const _response = await core.fetcher({
url: urlJoin(
(await core.Supplier.get(this._options.environment)) ?? environments.VocodeEnvironment.Production,
Expand All @@ -173,9 +176,10 @@ export class Numbers {
Authorization: await this._getAuthorizationHeader(),
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "@vocode/vocode-api",
"X-Fern-SDK-Version": "0.0.21",
"X-Fern-SDK-Version": "0.0.22",
},
contentType: "application/json",
body: await serializers.BuyPhoneNumberRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
timeoutMs: 60000,
});
if (_response.ok) {
Expand All @@ -188,10 +192,22 @@ export class Numbers {
}

if (_response.error.reason === "status-code") {
throw new errors.VocodeError({
statusCode: _response.error.statusCode,
body: _response.error.body,
});
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) {
Expand Down Expand Up @@ -226,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.21",
"X-Fern-SDK-Version": "0.0.22",
},
contentType: "application/json",
queryParameters: _queryParams,
Expand Down Expand Up @@ -293,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.21",
"X-Fern-SDK-Version": "0.0.22",
},
contentType: "application/json",
queryParameters: _queryParams,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
/**
* This file was auto-generated by Fern from our API Definition.
*/

export interface BuyPhoneNumberRequest {
areaCode?: string;
}
1 change: 1 addition & 0 deletions src/api/resources/numbers/client/requests/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
export { ListNumbersRequest } from "./ListNumbersRequest";
export { GetNumberRequest } from "./GetNumberRequest";
export { BuyPhoneNumberRequest } from "./BuyPhoneNumberRequest";
export { UpdateNumberRequest } from "./UpdateNumberRequest";
export { CancelNumberRequest } from "./CancelNumberRequest";
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.21",
"X-Fern-SDK-Version": "0.0.22",
},
contentType: "application/json",
queryParameters: _queryParams,
Expand Down Expand Up @@ -110,7 +110,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.21",
"X-Fern-SDK-Version": "0.0.22",
},
contentType: "application/json",
queryParameters: _queryParams,
Expand Down Expand Up @@ -173,7 +173,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.21",
"X-Fern-SDK-Version": "0.0.22",
},
contentType: "application/json",
body: await serializers.PromptParams.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
Expand Down Expand Up @@ -239,7 +239,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.21",
"X-Fern-SDK-Version": "0.0.22",
},
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.21",
"X-Fern-SDK-Version": "0.0.22",
},
contentType: "application/json",
timeoutMs: 60000,
Expand Down
8 changes: 4 additions & 4 deletions src/api/resources/vectorDatabases/client/Client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ export class VectorDatabases {
Authorization: await this._getAuthorizationHeader(),
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "@vocode/vocode-api",
"X-Fern-SDK-Version": "0.0.21",
"X-Fern-SDK-Version": "0.0.22",
},
contentType: "application/json",
queryParameters: _queryParams,
Expand Down Expand Up @@ -112,7 +112,7 @@ export class VectorDatabases {
Authorization: await this._getAuthorizationHeader(),
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "@vocode/vocode-api",
"X-Fern-SDK-Version": "0.0.21",
"X-Fern-SDK-Version": "0.0.22",
},
contentType: "application/json",
queryParameters: _queryParams,
Expand Down Expand Up @@ -177,7 +177,7 @@ export class VectorDatabases {
Authorization: await this._getAuthorizationHeader(),
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "@vocode/vocode-api",
"X-Fern-SDK-Version": "0.0.21",
"X-Fern-SDK-Version": "0.0.22",
},
contentType: "application/json",
body: await serializers.PineconeVectorDatabaseParams.jsonOrThrow(request, {
Expand Down Expand Up @@ -247,7 +247,7 @@ export class VectorDatabases {
Authorization: await this._getAuthorizationHeader(),
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "@vocode/vocode-api",
"X-Fern-SDK-Version": "0.0.21",
"X-Fern-SDK-Version": "0.0.22",
},
contentType: "application/json",
queryParameters: _queryParams,
Expand Down
8 changes: 4 additions & 4 deletions src/api/resources/voices/client/Client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ export class Voices {
Authorization: await this._getAuthorizationHeader(),
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "@vocode/vocode-api",
"X-Fern-SDK-Version": "0.0.21",
"X-Fern-SDK-Version": "0.0.22",
},
contentType: "application/json",
queryParameters: _queryParams,
Expand Down Expand Up @@ -110,7 +110,7 @@ export class Voices {
Authorization: await this._getAuthorizationHeader(),
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "@vocode/vocode-api",
"X-Fern-SDK-Version": "0.0.21",
"X-Fern-SDK-Version": "0.0.22",
},
contentType: "application/json",
queryParameters: _queryParams,
Expand Down Expand Up @@ -173,7 +173,7 @@ export class Voices {
Authorization: await this._getAuthorizationHeader(),
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "@vocode/vocode-api",
"X-Fern-SDK-Version": "0.0.21",
"X-Fern-SDK-Version": "0.0.22",
},
contentType: "application/json",
body: await serializers.VoiceParamsRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
Expand Down Expand Up @@ -239,7 +239,7 @@ export class Voices {
Authorization: await this._getAuthorizationHeader(),
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "@vocode/vocode-api",
"X-Fern-SDK-Version": "0.0.21",
"X-Fern-SDK-Version": "0.0.22",
},
contentType: "application/json",
queryParameters: _queryParams,
Expand Down
8 changes: 4 additions & 4 deletions src/api/resources/webhooks/client/Client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ export class Webhooks {
Authorization: await this._getAuthorizationHeader(),
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "@vocode/vocode-api",
"X-Fern-SDK-Version": "0.0.21",
"X-Fern-SDK-Version": "0.0.22",
},
contentType: "application/json",
queryParameters: _queryParams,
Expand Down Expand Up @@ -110,7 +110,7 @@ export class Webhooks {
Authorization: await this._getAuthorizationHeader(),
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "@vocode/vocode-api",
"X-Fern-SDK-Version": "0.0.21",
"X-Fern-SDK-Version": "0.0.22",
},
contentType: "application/json",
queryParameters: _queryParams,
Expand Down Expand Up @@ -173,7 +173,7 @@ export class Webhooks {
Authorization: await this._getAuthorizationHeader(),
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "@vocode/vocode-api",
"X-Fern-SDK-Version": "0.0.21",
"X-Fern-SDK-Version": "0.0.22",
},
contentType: "application/json",
body: await serializers.WebhookParams.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
Expand Down Expand Up @@ -239,7 +239,7 @@ export class Webhooks {
Authorization: await this._getAuthorizationHeader(),
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "@vocode/vocode-api",
"X-Fern-SDK-Version": "0.0.21",
"X-Fern-SDK-Version": "0.0.22",
},
contentType: "application/json",
queryParameters: _queryParams,
Expand Down
1 change: 1 addition & 0 deletions src/api/types/Agent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,5 @@ export interface Agent {
noiseSuppression?: boolean;
endpointingSensitivity?: Vocode.AgentEndpointingSensitivity;
ivrNavigationMode?: Vocode.AgentIvrNavigationMode;
conversationSpeed?: number;
}
1 change: 1 addition & 0 deletions src/api/types/AgentUpdateParams.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,5 @@ export interface AgentUpdateParams {
noiseSuppression?: Vocode.AgentUpdateParamsNoiseSuppression;
endpointingSensitivity?: Vocode.AgentUpdateParamsEndpointingSensitivity;
ivrNavigationMode?: Vocode.AgentUpdateParamsIvrNavigationMode;
conversationSpeed?: Vocode.AgentUpdateParamsConversationSpeed;
}
Loading

0 comments on commit fbb31e1

Please sign in to comment.