Skip to content

Commit defe433

Browse files
SDK regeneration (#339)
Co-authored-by: fern-api[bot] <115122769+fern-api[bot]@users.noreply.github.com>
1 parent cdb1940 commit defe433

File tree

275 files changed

+3917
-229
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

275 files changed

+3917
-229
lines changed

.fern/metadata.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"cliVersion": "3.47.5",
2+
"cliVersion": "3.64.2",
33
"generatorName": "fernapi/fern-typescript-sdk",
44
"generatorVersion": "3.36.0",
55
"generatorConfig": {

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@elevenlabs/elevenlabs-js",
3-
"version": "v2.34.0",
3+
"version": "v2.35.0",
44
"private": false,
55
"repository": "github:elevenlabs/elevenlabs-js",
66
"license": "MIT",

reference.md

Lines changed: 138 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4695,6 +4695,81 @@ await client.conversationalAi.whatsapp.outboundCall({
46954695
</dl>
46964696

46974697

4698+
</dd>
4699+
</dl>
4700+
</details>
4701+
4702+
<details><summary><code>client.conversationalAi.whatsapp.<a href="/src/api/resources/conversationalAi/resources/whatsapp/client/Client.ts">outboundMessage</a>({ ...params }) -> ElevenLabs.WhatsAppOutboundMessageResponse</code></summary>
4703+
<dl>
4704+
<dd>
4705+
4706+
#### 📝 Description
4707+
4708+
<dl>
4709+
<dd>
4710+
4711+
<dl>
4712+
<dd>
4713+
4714+
Send an outbound message via WhatsApp
4715+
</dd>
4716+
</dl>
4717+
</dd>
4718+
</dl>
4719+
4720+
#### 🔌 Usage
4721+
4722+
<dl>
4723+
<dd>
4724+
4725+
<dl>
4726+
<dd>
4727+
4728+
```typescript
4729+
await client.conversationalAi.whatsapp.outboundMessage({
4730+
whatsappPhoneNumberId: "whatsapp_phone_number_id",
4731+
whatsappUserId: "whatsapp_user_id",
4732+
templateName: "template_name",
4733+
templateLanguageCode: "template_language_code",
4734+
templateParams: [{
4735+
type: "body",
4736+
parameters: [{
4737+
text: "text"
4738+
}]
4739+
}],
4740+
agentId: "agent_id"
4741+
});
4742+
4743+
```
4744+
</dd>
4745+
</dl>
4746+
</dd>
4747+
</dl>
4748+
4749+
#### ⚙️ Parameters
4750+
4751+
<dl>
4752+
<dd>
4753+
4754+
<dl>
4755+
<dd>
4756+
4757+
**request:** `ElevenLabs.conversationalAi.BodySendAnOutboundMessageViaWhatsAppV1ConvaiWhatsappOutboundMessagePost`
4758+
4759+
</dd>
4760+
</dl>
4761+
4762+
<dl>
4763+
<dd>
4764+
4765+
**requestOptions:** `WhatsappClient.RequestOptions`
4766+
4767+
</dd>
4768+
</dl>
4769+
</dd>
4770+
</dl>
4771+
4772+
46984773
</dd>
46994774
</dl>
47004775
</details>
@@ -13658,6 +13733,69 @@ await client.studio.projects.convert("21m00Tcm4TlvDq8ikWAM");
1365813733
</dl>
1365913734

1366013735

13736+
</dd>
13737+
</dl>
13738+
</details>
13739+
13740+
<details><summary><code>client.studio.projects.<a href="/src/api/resources/studio/resources/projects/client/Client.ts">getMutedTracks</a>(project_id) -> ElevenLabs.ProjectMutedTracksResponseModel</code></summary>
13741+
<dl>
13742+
<dd>
13743+
13744+
#### 📝 Description
13745+
13746+
<dl>
13747+
<dd>
13748+
13749+
<dl>
13750+
<dd>
13751+
13752+
Returns a list of chapter IDs that have muted tracks in a project.
13753+
</dd>
13754+
</dl>
13755+
</dd>
13756+
</dl>
13757+
13758+
#### 🔌 Usage
13759+
13760+
<dl>
13761+
<dd>
13762+
13763+
<dl>
13764+
<dd>
13765+
13766+
```typescript
13767+
await client.studio.projects.getMutedTracks("21m00Tcm4TlvDq8ikWAM");
13768+
13769+
```
13770+
</dd>
13771+
</dl>
13772+
</dd>
13773+
</dl>
13774+
13775+
#### ⚙️ Parameters
13776+
13777+
<dl>
13778+
<dd>
13779+
13780+
<dl>
13781+
<dd>
13782+
13783+
**project_id:** `string` — The ID of the Studio project.
13784+
13785+
</dd>
13786+
</dl>
13787+
13788+
<dl>
13789+
<dd>
13790+
13791+
**requestOptions:** `ProjectsClient.RequestOptions`
13792+
13793+
</dd>
13794+
</dl>
13795+
</dd>
13796+
</dl>
13797+
13798+
1366113799
</dd>
1366213800
</dl>
1366313801
</details>

src/BaseClient.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,8 @@ export function normalizeClientOptions<T extends BaseClientOptions>(options: T):
4747
{
4848
"X-Fern-Language": "JavaScript",
4949
"X-Fern-SDK-Name": "@elevenlabs/elevenlabs-js",
50-
"X-Fern-SDK-Version": "v2.34.0",
51-
"User-Agent": "@elevenlabs/elevenlabs-js/v2.34.0",
50+
"X-Fern-SDK-Version": "v2.35.0",
51+
"User-Agent": "@elevenlabs/elevenlabs-js/v2.35.0",
5252
"X-Fern-Runtime": core.RUNTIME.type,
5353
"X-Fern-Runtime-Version": core.RUNTIME.version,
5454
"xi-api-key": options?.apiKey,

src/Client.ts

Lines changed: 0 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -165,57 +165,6 @@ export class ElevenLabsClient {
165165
return (this._workspace ??= new WorkspaceClient(this._options));
166166
}
167167

168-
/**
169-
* @param {ElevenLabsClient.RequestOptions} requestOptions - Request-specific configuration.
170-
*
171-
* @example
172-
* await client.postV1ConvaiWhatsappAccounts()
173-
*/
174-
public postV1ConvaiWhatsappAccounts(
175-
requestOptions?: ElevenLabsClient.RequestOptions,
176-
): core.HttpResponsePromise<void> {
177-
return core.HttpResponsePromise.fromPromise(this.__postV1ConvaiWhatsappAccounts(requestOptions));
178-
}
179-
180-
private async __postV1ConvaiWhatsappAccounts(
181-
requestOptions?: ElevenLabsClient.RequestOptions,
182-
): Promise<core.WithRawResponse<void>> {
183-
const _headers: core.Fetcher.Args["headers"] = mergeHeaders(
184-
this._options?.headers,
185-
mergeOnlyDefinedHeaders({ "xi-api-key": requestOptions?.apiKey ?? this._options?.apiKey }),
186-
requestOptions?.headers,
187-
);
188-
const _response = await (this._options.fetcher ?? core.fetcher)({
189-
url: core.url.join(
190-
(await core.Supplier.get(this._options.baseUrl)) ??
191-
(await core.Supplier.get(this._options.environment)) ??
192-
environments.ElevenLabsEnvironment.Production,
193-
"v1/convai/whatsapp-accounts",
194-
),
195-
method: "POST",
196-
headers: _headers,
197-
queryParameters: requestOptions?.queryParams,
198-
timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 240) * 1000,
199-
maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
200-
abortSignal: requestOptions?.abortSignal,
201-
fetchFn: this._options?.fetch,
202-
logging: this._options.logging,
203-
});
204-
if (_response.ok) {
205-
return { data: undefined, rawResponse: _response.rawResponse };
206-
}
207-
208-
if (_response.error.reason === "status-code") {
209-
throw new errors.ElevenLabsError({
210-
statusCode: _response.error.statusCode,
211-
body: _response.error.body,
212-
rawResponse: _response.rawResponse,
213-
});
214-
}
215-
216-
return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/v1/convai/whatsapp-accounts");
217-
}
218-
219168
/**
220169
* @param {string} agent_id
221170
* @param {string} branch_id

src/api/resources/conversationalAi/resources/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,5 +35,6 @@ export * from "./twilio/client/requests";
3535
export * from "./twilio/types";
3636
export * as whatsapp from "./whatsapp";
3737
export * from "./whatsapp/client/requests";
38+
export * from "./whatsapp/types";
3839
export * as whatsappAccounts from "./whatsappAccounts";
3940
export * from "./whatsappAccounts/client/requests";

src/api/resources/conversationalAi/resources/whatsapp/client/Client.ts

Lines changed: 102 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,4 +118,106 @@ export class WhatsappClient {
118118
"/v1/convai/whatsapp/outbound-call",
119119
);
120120
}
121+
122+
/**
123+
* Send an outbound message via WhatsApp
124+
*
125+
* @param {ElevenLabs.conversationalAi.BodySendAnOutboundMessageViaWhatsAppV1ConvaiWhatsappOutboundMessagePost} request
126+
* @param {WhatsappClient.RequestOptions} requestOptions - Request-specific configuration.
127+
*
128+
* @throws {@link ElevenLabs.UnprocessableEntityError}
129+
*
130+
* @example
131+
* await client.conversationalAi.whatsapp.outboundMessage({
132+
* whatsappPhoneNumberId: "whatsapp_phone_number_id",
133+
* whatsappUserId: "whatsapp_user_id",
134+
* templateName: "template_name",
135+
* templateLanguageCode: "template_language_code",
136+
* templateParams: [{
137+
* type: "body",
138+
* parameters: [{
139+
* text: "text"
140+
* }]
141+
* }],
142+
* agentId: "agent_id"
143+
* })
144+
*/
145+
public outboundMessage(
146+
request: ElevenLabs.conversationalAi.BodySendAnOutboundMessageViaWhatsAppV1ConvaiWhatsappOutboundMessagePost,
147+
requestOptions?: WhatsappClient.RequestOptions,
148+
): core.HttpResponsePromise<ElevenLabs.WhatsAppOutboundMessageResponse> {
149+
return core.HttpResponsePromise.fromPromise(this.__outboundMessage(request, requestOptions));
150+
}
151+
152+
private async __outboundMessage(
153+
request: ElevenLabs.conversationalAi.BodySendAnOutboundMessageViaWhatsAppV1ConvaiWhatsappOutboundMessagePost,
154+
requestOptions?: WhatsappClient.RequestOptions,
155+
): Promise<core.WithRawResponse<ElevenLabs.WhatsAppOutboundMessageResponse>> {
156+
const _headers: core.Fetcher.Args["headers"] = mergeHeaders(
157+
this._options?.headers,
158+
mergeOnlyDefinedHeaders({ "xi-api-key": requestOptions?.apiKey ?? this._options?.apiKey }),
159+
requestOptions?.headers,
160+
);
161+
const _response = await (this._options.fetcher ?? core.fetcher)({
162+
url: core.url.join(
163+
(await core.Supplier.get(this._options.baseUrl)) ??
164+
(await core.Supplier.get(this._options.environment)) ??
165+
environments.ElevenLabsEnvironment.Production,
166+
"v1/convai/whatsapp/outbound-message",
167+
),
168+
method: "POST",
169+
headers: _headers,
170+
contentType: "application/json",
171+
queryParameters: requestOptions?.queryParams,
172+
requestType: "json",
173+
body: serializers.conversationalAi.BodySendAnOutboundMessageViaWhatsAppV1ConvaiWhatsappOutboundMessagePost.jsonOrThrow(
174+
request,
175+
{ unrecognizedObjectKeys: "strip" },
176+
),
177+
timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 240) * 1000,
178+
maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
179+
abortSignal: requestOptions?.abortSignal,
180+
fetchFn: this._options?.fetch,
181+
logging: this._options.logging,
182+
});
183+
if (_response.ok) {
184+
return {
185+
data: serializers.WhatsAppOutboundMessageResponse.parseOrThrow(_response.body, {
186+
unrecognizedObjectKeys: "passthrough",
187+
allowUnrecognizedUnionMembers: true,
188+
allowUnrecognizedEnumValues: true,
189+
breadcrumbsPrefix: ["response"],
190+
}),
191+
rawResponse: _response.rawResponse,
192+
};
193+
}
194+
195+
if (_response.error.reason === "status-code") {
196+
switch (_response.error.statusCode) {
197+
case 422:
198+
throw new ElevenLabs.UnprocessableEntityError(
199+
serializers.HttpValidationError.parseOrThrow(_response.error.body, {
200+
unrecognizedObjectKeys: "passthrough",
201+
allowUnrecognizedUnionMembers: true,
202+
allowUnrecognizedEnumValues: true,
203+
breadcrumbsPrefix: ["response"],
204+
}),
205+
_response.rawResponse,
206+
);
207+
default:
208+
throw new errors.ElevenLabsError({
209+
statusCode: _response.error.statusCode,
210+
body: _response.error.body,
211+
rawResponse: _response.rawResponse,
212+
});
213+
}
214+
}
215+
216+
return handleNonStatusCodeError(
217+
_response.error,
218+
_response.rawResponse,
219+
"POST",
220+
"/v1/convai/whatsapp/outbound-message",
221+
);
222+
}
121223
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
// This file was auto-generated by Fern from our API Definition.
2+
3+
import type * as ElevenLabs from "../../../../../../index";
4+
5+
/**
6+
* @example
7+
* {
8+
* whatsappPhoneNumberId: "whatsapp_phone_number_id",
9+
* whatsappUserId: "whatsapp_user_id",
10+
* templateName: "template_name",
11+
* templateLanguageCode: "template_language_code",
12+
* templateParams: [{
13+
* type: "body",
14+
* parameters: [{
15+
* text: "text"
16+
* }]
17+
* }],
18+
* agentId: "agent_id"
19+
* }
20+
*/
21+
export interface BodySendAnOutboundMessageViaWhatsAppV1ConvaiWhatsappOutboundMessagePost {
22+
whatsappPhoneNumberId: string;
23+
whatsappUserId: string;
24+
templateName: string;
25+
templateLanguageCode: string;
26+
templateParams: ElevenLabs.conversationalAi.BodySendAnOutboundMessageViaWhatsAppV1ConvaiWhatsappOutboundMessagePostTemplateParamsItem[];
27+
agentId: string;
28+
conversationInitiationClientData?: ElevenLabs.ConversationInitiationClientDataRequestInput;
29+
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
export type { BodyMakeAnOutboundCallViaWhatsAppV1ConvaiWhatsappOutboundCallPost } from "./BodyMakeAnOutboundCallViaWhatsAppV1ConvaiWhatsappOutboundCallPost";
2+
export type { BodySendAnOutboundMessageViaWhatsAppV1ConvaiWhatsappOutboundMessagePost } from "./BodySendAnOutboundMessageViaWhatsAppV1ConvaiWhatsappOutboundMessagePost";
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
export * from "./client";
2+
export * from "./types";

0 commit comments

Comments
 (0)