Software: Apache. PHP/8.1.30 uname -a: Linux server1.tuhinhossain.com 5.15.0-163-generic #173-Ubuntu SMP Tue Oct 14 17:51:00 UTC uid=1002(picotech) gid=1003(picotech) groups=1003(picotech),0(root) Safe-mode: OFF (not secure) /home/picotech/domains/note.picotech.app/public_html/node_modules/@elevenlabs/elevenlabs-js/ drwxr-xr-x | |
| Viewing file: Select action/file-type: "use strict";
/**
* This file was auto-generated by Fern from our API Definition.
*/
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
o["default"] = v;
});
var __importStar = (this && this.__importStar) || (function () {
var ownKeys = function(o) {
ownKeys = Object.getOwnPropertyNames || function (o) {
var ar = [];
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
return ar;
};
return ownKeys(o);
};
return function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
__setModuleDefault(result, mod);
return result;
};
})();
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.ElevenLabsClient = void 0;
const environments = __importStar(require("./environments"));
const core = __importStar(require("./core"));
const headers_1 = require("./core/headers");
const errors = __importStar(require("./errors/index"));
const Client_1 = require("./api/resources/history/client/Client");
const Client_2 = require("./api/resources/textToSoundEffects/client/Client");
const Client_3 = require("./api/resources/audioIsolation/client/Client");
const Client_4 = require("./api/resources/samples/client/Client");
const Client_5 = require("./api/resources/textToSpeech/client/Client");
const Client_6 = require("./api/resources/textToDialogue/client/Client");
const Client_7 = require("./api/resources/speechToSpeech/client/Client");
const Client_8 = require("./api/resources/textToVoice/client/Client");
const Client_9 = require("./api/resources/user/client/Client");
const Client_10 = require("./api/resources/voices/client/Client");
const Client_11 = require("./api/resources/studio/client/Client");
const Client_12 = require("./api/resources/dubbing/client/Client");
const Client_13 = require("./api/resources/models/client/Client");
const Client_14 = require("./api/resources/audioNative/client/Client");
const Client_15 = require("./api/resources/usage/client/Client");
const Client_16 = require("./api/resources/pronunciationDictionaries/client/Client");
const Client_17 = require("./api/resources/serviceAccounts/client/Client");
const Client_18 = require("./api/resources/webhooks/client/Client");
const Client_19 = require("./api/resources/speechToText/client/Client");
const Client_20 = require("./api/resources/forcedAlignment/client/Client");
const Client_21 = require("./api/resources/conversationalAi/client/Client");
const Client_22 = require("./api/resources/music/client/Client");
const Client_23 = require("./api/resources/workspace/client/Client");
class ElevenLabsClient {
constructor(_options = {}) {
this._options = Object.assign(Object.assign({}, _options), { headers: (0, headers_1.mergeHeaders)({
"xi-api-key": _options === null || _options === void 0 ? void 0 : _options.apiKey,
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "@elevenlabs/elevenlabs-js",
"X-Fern-SDK-Version": "v2.15.0",
"User-Agent": "@elevenlabs/elevenlabs-js/v2.15.0",
"X-Fern-Runtime": core.RUNTIME.type,
"X-Fern-Runtime-Version": core.RUNTIME.version,
}, _options === null || _options === void 0 ? void 0 : _options.headers) });
}
get history() {
var _a;
return ((_a = this._history) !== null && _a !== void 0 ? _a : (this._history = new Client_1.History(this._options)));
}
get textToSoundEffects() {
var _a;
return ((_a = this._textToSoundEffects) !== null && _a !== void 0 ? _a : (this._textToSoundEffects = new Client_2.TextToSoundEffects(this._options)));
}
get audioIsolation() {
var _a;
return ((_a = this._audioIsolation) !== null && _a !== void 0 ? _a : (this._audioIsolation = new Client_3.AudioIsolation(this._options)));
}
get samples() {
var _a;
return ((_a = this._samples) !== null && _a !== void 0 ? _a : (this._samples = new Client_4.Samples(this._options)));
}
get textToSpeech() {
var _a;
return ((_a = this._textToSpeech) !== null && _a !== void 0 ? _a : (this._textToSpeech = new Client_5.TextToSpeech(this._options)));
}
get textToDialogue() {
var _a;
return ((_a = this._textToDialogue) !== null && _a !== void 0 ? _a : (this._textToDialogue = new Client_6.TextToDialogue(this._options)));
}
get speechToSpeech() {
var _a;
return ((_a = this._speechToSpeech) !== null && _a !== void 0 ? _a : (this._speechToSpeech = new Client_7.SpeechToSpeech(this._options)));
}
get textToVoice() {
var _a;
return ((_a = this._textToVoice) !== null && _a !== void 0 ? _a : (this._textToVoice = new Client_8.TextToVoice(this._options)));
}
get user() {
var _a;
return ((_a = this._user) !== null && _a !== void 0 ? _a : (this._user = new Client_9.User(this._options)));
}
get voices() {
var _a;
return ((_a = this._voices) !== null && _a !== void 0 ? _a : (this._voices = new Client_10.Voices(this._options)));
}
get studio() {
var _a;
return ((_a = this._studio) !== null && _a !== void 0 ? _a : (this._studio = new Client_11.Studio(this._options)));
}
get dubbing() {
var _a;
return ((_a = this._dubbing) !== null && _a !== void 0 ? _a : (this._dubbing = new Client_12.Dubbing(this._options)));
}
get models() {
var _a;
return ((_a = this._models) !== null && _a !== void 0 ? _a : (this._models = new Client_13.Models(this._options)));
}
get audioNative() {
var _a;
return ((_a = this._audioNative) !== null && _a !== void 0 ? _a : (this._audioNative = new Client_14.AudioNative(this._options)));
}
get usage() {
var _a;
return ((_a = this._usage) !== null && _a !== void 0 ? _a : (this._usage = new Client_15.Usage(this._options)));
}
get pronunciationDictionaries() {
var _a;
return ((_a = this._pronunciationDictionaries) !== null && _a !== void 0 ? _a : (this._pronunciationDictionaries = new Client_16.PronunciationDictionaries(this._options)));
}
get serviceAccounts() {
var _a;
return ((_a = this._serviceAccounts) !== null && _a !== void 0 ? _a : (this._serviceAccounts = new Client_17.ServiceAccounts(this._options)));
}
get webhooks() {
var _a;
return ((_a = this._webhooks) !== null && _a !== void 0 ? _a : (this._webhooks = new Client_18.Webhooks(this._options)));
}
get speechToText() {
var _a;
return ((_a = this._speechToText) !== null && _a !== void 0 ? _a : (this._speechToText = new Client_19.SpeechToText(this._options)));
}
get forcedAlignment() {
var _a;
return ((_a = this._forcedAlignment) !== null && _a !== void 0 ? _a : (this._forcedAlignment = new Client_20.ForcedAlignment(this._options)));
}
get conversationalAi() {
var _a;
return ((_a = this._conversationalAi) !== null && _a !== void 0 ? _a : (this._conversationalAi = new Client_21.ConversationalAi(this._options)));
}
get music() {
var _a;
return ((_a = this._music) !== null && _a !== void 0 ? _a : (this._music = new Client_22.Music(this._options)));
}
get workspace() {
var _a;
return ((_a = this._workspace) !== null && _a !== void 0 ? _a : (this._workspace = new Client_23.Workspace(this._options)));
}
/**
* Add a generated voice to the voice library.
*
* @param {ElevenLabsClient.RequestOptions} requestOptions - Request-specific configuration.
*
* @example
* await client.saveAVoicePreview()
*/
saveAVoicePreview(requestOptions) {
return core.HttpResponsePromise.fromPromise(this.__saveAVoicePreview(requestOptions));
}
__saveAVoicePreview(requestOptions) {
return __awaiter(this, void 0, void 0, function* () {
var _a, _b, _c;
const _response = yield core.fetcher({
url: core.url.join((_b = (_a = (yield core.Supplier.get(this._options.baseUrl))) !== null && _a !== void 0 ? _a : (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.ElevenLabsEnvironment.Production, "v1/text-to-voice/create-voice-from-preview"),
method: "POST",
headers: (0, headers_1.mergeHeaders)((_c = this._options) === null || _c === void 0 ? void 0 : _c.headers, (0, headers_1.mergeOnlyDefinedHeaders)({ "xi-api-key": requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.apiKey }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 240000,
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
});
if (_response.ok) {
return { data: undefined, rawResponse: _response.rawResponse };
}
if (_response.error.reason === "status-code") {
throw new errors.ElevenLabsError({
statusCode: _response.error.statusCode,
body: _response.error.body,
rawResponse: _response.rawResponse,
});
}
switch (_response.error.reason) {
case "non-json":
throw new errors.ElevenLabsError({
statusCode: _response.error.statusCode,
body: _response.error.rawBody,
rawResponse: _response.rawResponse,
});
case "timeout":
throw new errors.ElevenLabsTimeoutError("Timeout exceeded when calling POST /v1/text-to-voice/create-voice-from-preview.");
case "unknown":
throw new errors.ElevenLabsError({
message: _response.error.errorMessage,
rawResponse: _response.rawResponse,
});
}
});
}
}
exports.ElevenLabsClient = ElevenLabsClient;
|
:: Command execute :: | |
--[ c99shell v. 2.5 [PHP 8 Update] [24.05.2025] | Generation time: 0.0043 ]-- |