@elevenlabs/elevenlabs-js 2.49.0 → 2.49.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/BaseClient.js CHANGED
@@ -41,8 +41,8 @@ function normalizeClientOptions(options) {
41
41
  const headers = (0, headers_1.mergeHeaders)({
42
42
  "X-Fern-Language": "JavaScript",
43
43
  "X-Fern-SDK-Name": "@elevenlabs/elevenlabs-js",
44
- "X-Fern-SDK-Version": "2.49.0",
45
- "User-Agent": "@elevenlabs/elevenlabs-js/2.49.0",
44
+ "X-Fern-SDK-Version": "2.49.1",
45
+ "User-Agent": "@elevenlabs/elevenlabs-js/2.49.1",
46
46
  "X-Fern-Runtime": core.RUNTIME.type,
47
47
  "X-Fern-Runtime-Version": core.RUNTIME.version,
48
48
  "xi-api-key": options === null || options === void 0 ? void 0 : options.apiKey,
@@ -41,8 +41,8 @@ function normalizeClientOptions(options) {
41
41
  const headers = (0, headers_1.mergeHeaders)({
42
42
  "X-Fern-Language": "JavaScript",
43
43
  "X-Fern-SDK-Name": "@elevenlabs/elevenlabs-js",
44
- "X-Fern-SDK-Version": "2.49.0",
45
- "User-Agent": "@elevenlabs/elevenlabs-js/2.49.0",
44
+ "X-Fern-SDK-Version": "2.49.1",
45
+ "User-Agent": "@elevenlabs/elevenlabs-js/2.49.1",
46
46
  "X-Fern-Runtime": core.RUNTIME.type,
47
47
  "X-Fern-Runtime-Version": core.RUNTIME.version,
48
48
  "xi-api-key": options === null || options === void 0 ? void 0 : options.apiKey,
package/dist/version.d.ts CHANGED
@@ -1 +1 @@
1
- export declare const SDK_VERSION = "2.49.0";
1
+ export declare const SDK_VERSION = "2.49.1";
package/dist/version.js CHANGED
@@ -1,4 +1,4 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.SDK_VERSION = void 0;
4
- exports.SDK_VERSION = "2.49.0";
4
+ exports.SDK_VERSION = "2.49.1";
@@ -62,7 +62,7 @@ class SpeechEngineClientWrapper extends Client_1.SpeechEngineClient {
62
62
  });
63
63
  return __awaiter(this, void 0, void 0, function* () {
64
64
  const response = yield _super.create.call(this, request, requestOptions);
65
- return new SpeechEngineResource_1.SpeechEngineResource(response.speechEngineId, this._options);
65
+ return new SpeechEngineResource_1.SpeechEngineResource(response.speechEngineId, this._options, response);
66
66
  });
67
67
  }
68
68
  /**
@@ -88,8 +88,8 @@ class SpeechEngineClientWrapper extends Client_1.SpeechEngineClient {
88
88
  get: { get: () => super.get }
89
89
  });
90
90
  return __awaiter(this, void 0, void 0, function* () {
91
- yield _super.get.call(this, speechEngineId, requestOptions);
92
- return new SpeechEngineResource_1.SpeechEngineResource(speechEngineId, this._options);
91
+ const response = yield _super.get.call(this, speechEngineId, requestOptions);
92
+ return new SpeechEngineResource_1.SpeechEngineResource(speechEngineId, this._options, response);
93
93
  });
94
94
  }
95
95
  /**
@@ -115,8 +115,8 @@ class SpeechEngineClientWrapper extends Client_1.SpeechEngineClient {
115
115
  update: { get: () => super.update }
116
116
  });
117
117
  return __awaiter(this, arguments, void 0, function* (speechEngineId, request = {}, requestOptions) {
118
- yield _super.update.call(this, speechEngineId, request, requestOptions);
119
- return new SpeechEngineResource_1.SpeechEngineResource(speechEngineId, this._options);
118
+ const response = yield _super.update.call(this, speechEngineId, request, requestOptions);
119
+ return new SpeechEngineResource_1.SpeechEngineResource(speechEngineId, this._options, response);
120
120
  });
121
121
  }
122
122
  /**
@@ -1,6 +1,7 @@
1
1
  import type { Server as HttpServer } from "node:http";
2
2
  import WebSocket from "ws";
3
3
  import type { BaseClientOptions, NormalizedClientOptions } from "../../BaseClient";
4
+ import type * as ElevenLabs from "../../api/types";
4
5
  import { type SpeechEngineCallbacks } from "./types";
5
6
  import { SpeechEngineSession } from "./SpeechEngineSession";
6
7
  import { SpeechEngineAttachment } from "./SpeechEngineAttachment";
@@ -24,10 +25,18 @@ import { SpeechEngineAttachment } from "./SpeechEngineAttachment";
24
25
  */
25
26
  export declare class SpeechEngineResource {
26
27
  readonly engineId: string;
28
+ /**
29
+ * Full configuration returned by the API. Populated when the resource is
30
+ * returned from `create()`, `get()`, or `update()`.
31
+ *
32
+ * `undefined` when using the `attach()` shortcut directly, since no API
33
+ * call is made in that case.
34
+ */
35
+ readonly config: Omit<ElevenLabs.SpeechEngineResponse, "speechEngineId"> | undefined;
27
36
  /** @internal */
28
37
  readonly _options: NormalizedClientOptions<BaseClientOptions>;
29
38
  /** @internal */
30
- constructor(engineId: string, options: NormalizedClientOptions<BaseClientOptions>);
39
+ constructor(engineId: string, options: NormalizedClientOptions<BaseClientOptions>, response?: ElevenLabs.SpeechEngineResponse);
31
40
  /**
32
41
  * Attach to an existing HTTP server and begin accepting Speech Engine
33
42
  * connections at the given path.
@@ -41,6 +41,17 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
41
41
  step((generator = generator.apply(thisArg, _arguments || [])).next());
42
42
  });
43
43
  };
44
+ var __rest = (this && this.__rest) || function (s, e) {
45
+ var t = {};
46
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
47
+ t[p] = s[p];
48
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
49
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
50
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
51
+ t[p[i]] = s[p[i]];
52
+ }
53
+ return t;
54
+ };
44
55
  var __importDefault = (this && this.__importDefault) || function (mod) {
45
56
  return (mod && mod.__esModule) ? mod : { "default": mod };
46
57
  };
@@ -73,9 +84,13 @@ const SpeechEngineAttachment_1 = require("./SpeechEngineAttachment");
73
84
  */
74
85
  class SpeechEngineResource {
75
86
  /** @internal */
76
- constructor(engineId, options) {
87
+ constructor(engineId, options, response) {
77
88
  this.engineId = engineId;
78
89
  this._options = options;
90
+ if (response) {
91
+ const { speechEngineId: _id } = response, config = __rest(response, ["speechEngineId"]);
92
+ this.config = config;
93
+ }
79
94
  }
80
95
  /**
81
96
  * Attach to an existing HTTP server and begin accepting Speech Engine
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@elevenlabs/elevenlabs-js",
3
- "version": "2.49.0",
3
+ "version": "2.49.1",
4
4
  "private": false,
5
5
  "repository": "github:elevenlabs/elevenlabs-js",
6
6
  "license": "MIT",
package/version.d.ts CHANGED
@@ -1 +1 @@
1
- export declare const SDK_VERSION = "2.49.0";
1
+ export declare const SDK_VERSION = "2.49.1";
package/version.js CHANGED
@@ -1,4 +1,4 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.SDK_VERSION = void 0;
4
- exports.SDK_VERSION = "2.49.0";
4
+ exports.SDK_VERSION = "2.49.1";
@@ -62,7 +62,7 @@ class SpeechEngineClientWrapper extends Client_1.SpeechEngineClient {
62
62
  });
63
63
  return __awaiter(this, void 0, void 0, function* () {
64
64
  const response = yield _super.create.call(this, request, requestOptions);
65
- return new SpeechEngineResource_1.SpeechEngineResource(response.speechEngineId, this._options);
65
+ return new SpeechEngineResource_1.SpeechEngineResource(response.speechEngineId, this._options, response);
66
66
  });
67
67
  }
68
68
  /**
@@ -88,8 +88,8 @@ class SpeechEngineClientWrapper extends Client_1.SpeechEngineClient {
88
88
  get: { get: () => super.get }
89
89
  });
90
90
  return __awaiter(this, void 0, void 0, function* () {
91
- yield _super.get.call(this, speechEngineId, requestOptions);
92
- return new SpeechEngineResource_1.SpeechEngineResource(speechEngineId, this._options);
91
+ const response = yield _super.get.call(this, speechEngineId, requestOptions);
92
+ return new SpeechEngineResource_1.SpeechEngineResource(speechEngineId, this._options, response);
93
93
  });
94
94
  }
95
95
  /**
@@ -115,8 +115,8 @@ class SpeechEngineClientWrapper extends Client_1.SpeechEngineClient {
115
115
  update: { get: () => super.update }
116
116
  });
117
117
  return __awaiter(this, arguments, void 0, function* (speechEngineId, request = {}, requestOptions) {
118
- yield _super.update.call(this, speechEngineId, request, requestOptions);
119
- return new SpeechEngineResource_1.SpeechEngineResource(speechEngineId, this._options);
118
+ const response = yield _super.update.call(this, speechEngineId, request, requestOptions);
119
+ return new SpeechEngineResource_1.SpeechEngineResource(speechEngineId, this._options, response);
120
120
  });
121
121
  }
122
122
  /**
@@ -1,6 +1,7 @@
1
1
  import type { Server as HttpServer } from "node:http";
2
2
  import WebSocket from "ws";
3
3
  import type { BaseClientOptions, NormalizedClientOptions } from "../../BaseClient";
4
+ import type * as ElevenLabs from "../../api/types";
4
5
  import { type SpeechEngineCallbacks } from "./types";
5
6
  import { SpeechEngineSession } from "./SpeechEngineSession";
6
7
  import { SpeechEngineAttachment } from "./SpeechEngineAttachment";
@@ -24,10 +25,18 @@ import { SpeechEngineAttachment } from "./SpeechEngineAttachment";
24
25
  */
25
26
  export declare class SpeechEngineResource {
26
27
  readonly engineId: string;
28
+ /**
29
+ * Full configuration returned by the API. Populated when the resource is
30
+ * returned from `create()`, `get()`, or `update()`.
31
+ *
32
+ * `undefined` when using the `attach()` shortcut directly, since no API
33
+ * call is made in that case.
34
+ */
35
+ readonly config: Omit<ElevenLabs.SpeechEngineResponse, "speechEngineId"> | undefined;
27
36
  /** @internal */
28
37
  readonly _options: NormalizedClientOptions<BaseClientOptions>;
29
38
  /** @internal */
30
- constructor(engineId: string, options: NormalizedClientOptions<BaseClientOptions>);
39
+ constructor(engineId: string, options: NormalizedClientOptions<BaseClientOptions>, response?: ElevenLabs.SpeechEngineResponse);
31
40
  /**
32
41
  * Attach to an existing HTTP server and begin accepting Speech Engine
33
42
  * connections at the given path.
@@ -41,6 +41,17 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
41
41
  step((generator = generator.apply(thisArg, _arguments || [])).next());
42
42
  });
43
43
  };
44
+ var __rest = (this && this.__rest) || function (s, e) {
45
+ var t = {};
46
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
47
+ t[p] = s[p];
48
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
49
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
50
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
51
+ t[p[i]] = s[p[i]];
52
+ }
53
+ return t;
54
+ };
44
55
  var __importDefault = (this && this.__importDefault) || function (mod) {
45
56
  return (mod && mod.__esModule) ? mod : { "default": mod };
46
57
  };
@@ -73,9 +84,13 @@ const SpeechEngineAttachment_1 = require("./SpeechEngineAttachment");
73
84
  */
74
85
  class SpeechEngineResource {
75
86
  /** @internal */
76
- constructor(engineId, options) {
87
+ constructor(engineId, options, response) {
77
88
  this.engineId = engineId;
78
89
  this._options = options;
90
+ if (response) {
91
+ const { speechEngineId: _id } = response, config = __rest(response, ["speechEngineId"]);
92
+ this.config = config;
93
+ }
79
94
  }
80
95
  /**
81
96
  * Attach to an existing HTTP server and begin accepting Speech Engine