@futdevpro/nts-dynamo 1.15.262 → 1.15.263
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/build/_collections/get-environment-settings.util.d.ts.map +1 -1
- package/build/_collections/get-environment-settings.util.js +4 -4
- package/build/_collections/get-environment-settings.util.js.map +1 -1
- package/build/_models/interfaces/environment-settings.interface.d.ts +9 -0
- package/build/_models/interfaces/environment-settings.interface.d.ts.map +1 -1
- package/build/_modules/media-gen/_collections/elevenlabs-region.util.d.ts +22 -0
- package/build/_modules/media-gen/_collections/elevenlabs-region.util.d.ts.map +1 -0
- package/build/_modules/media-gen/_collections/elevenlabs-region.util.js +49 -0
- package/build/_modules/media-gen/_collections/elevenlabs-region.util.js.map +1 -0
- package/build/_modules/media-gen/_models/elevenlabs-settings.interface.d.ts +18 -0
- package/build/_modules/media-gen/_models/elevenlabs-settings.interface.d.ts.map +1 -0
- package/build/_modules/media-gen/_models/elevenlabs-settings.interface.js +3 -0
- package/build/_modules/media-gen/_models/elevenlabs-settings.interface.js.map +1 -0
- package/build/_modules/media-gen/_services/elevenlabs-speak.control-service.d.ts +23 -0
- package/build/_modules/media-gen/_services/elevenlabs-speak.control-service.d.ts.map +1 -0
- package/build/_modules/media-gen/_services/elevenlabs-speak.control-service.js +58 -0
- package/build/_modules/media-gen/_services/elevenlabs-speak.control-service.js.map +1 -0
- package/build/_modules/media-gen/_services/elevenlabs-transcribe.control-service.d.ts +23 -0
- package/build/_modules/media-gen/_services/elevenlabs-transcribe.control-service.d.ts.map +1 -0
- package/build/_modules/media-gen/_services/elevenlabs-transcribe.control-service.js +61 -0
- package/build/_modules/media-gen/_services/elevenlabs-transcribe.control-service.js.map +1 -0
- package/build/_modules/media-gen/_services/elevenlabs.service-base.d.ts +33 -0
- package/build/_modules/media-gen/_services/elevenlabs.service-base.d.ts.map +1 -0
- package/build/_modules/media-gen/_services/elevenlabs.service-base.js +85 -0
- package/build/_modules/media-gen/_services/elevenlabs.service-base.js.map +1 -0
- package/build/_modules/media-gen/index.d.ts +5 -0
- package/build/_modules/media-gen/index.d.ts.map +1 -1
- package/build/_modules/media-gen/index.js +5 -0
- package/build/_modules/media-gen/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-environment-settings.util.d.ts","sourceRoot":"","sources":["../../src/_collections/get-environment-settings.util.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,0BAA0B,EAAE,MAAM,sDAAsD,CAAC;AAElG,wBAAgB,6BAA6B,IAAI,0BAA0B,
|
|
1
|
+
{"version":3,"file":"get-environment-settings.util.d.ts","sourceRoot":"","sources":["../../src/_collections/get-environment-settings.util.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,0BAA0B,EAAE,MAAM,sDAAsD,CAAC;AAElG,wBAAgB,6BAA6B,IAAI,0BAA0B,CA8C1E"}
|
|
@@ -29,11 +29,11 @@ function DyNTS_getEnvironment_settings() {
|
|
|
29
29
|
project: process.env.OPENAI_PROJECT,
|
|
30
30
|
ttsApiKey: process.env.OPENAI_TTS_API_KEY,
|
|
31
31
|
},
|
|
32
|
-
|
|
33
|
-
|
|
32
|
+
elevenLabs: {
|
|
33
|
+
apiKey: process.env.ELEVENLABS_API_KEY,
|
|
34
|
+
environment: process.env.ELEVENLABS_ENVIRONMENT,
|
|
34
35
|
},
|
|
35
|
-
|
|
36
|
-
clickup: {
|
|
36
|
+
/* clickup: {
|
|
37
37
|
apiKey: process.env.CLICKUP_API_KEY,
|
|
38
38
|
workspaceId: process.env.CLICKUP_WORKSPACE_ID,
|
|
39
39
|
spaceId: process.env.CLICKUP_SPACE_ID,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-environment-settings.util.js","sourceRoot":"","sources":["../../src/_collections/get-environment-settings.util.ts"],"names":[],"mappings":";;AAMA,
|
|
1
|
+
{"version":3,"file":"get-environment-settings.util.js","sourceRoot":"","sources":["../../src/_collections/get-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C,GAAG,CAAC,kBAAkB;SAC1C;QAED,UAAU,EAAE;YACV,MAAM,EAAE,OAAO,CAAC,GAAG,CAAC,kBAAkB;YACtC,WAAW,EAAE,OAAO,CAAC,GAAG,CAAC,sBAAsB;SAChD;QAED;;;;;aAKK;KACN,CAAC;AACJ,CAAC"}
|
|
@@ -31,5 +31,14 @@ export interface DyNTS_Environment_Settings {
|
|
|
31
31
|
project: string;
|
|
32
32
|
ttsApiKey: string;
|
|
33
33
|
};
|
|
34
|
+
/**
|
|
35
|
+
* this is the elevenlabs settings of the system
|
|
36
|
+
*/
|
|
37
|
+
elevenLabs?: {
|
|
38
|
+
/** `ELEVENLABS_API_KEY` */
|
|
39
|
+
apiKey: string;
|
|
40
|
+
/** `ELEVENLABS_ENVIRONMENT`: global (default) | us | eu-residency | india-residency | singapore-residency */
|
|
41
|
+
environment?: string;
|
|
42
|
+
};
|
|
34
43
|
}
|
|
35
44
|
//# sourceMappingURL=environment-settings.interface.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"environment-settings.interface.d.ts","sourceRoot":"","sources":["../../../src/_models/interfaces/environment-settings.interface.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAC;AAI7D,MAAM,WAAW,0BAA0B;IACzC;;;;;;;OAOG;IACH,WAAW,EAAE,oBAAoB,CAAC;IAElC;;OAEG;IACH,OAAO,EAAE;QACP,KAAK,EAAE,MAAM,CAAC;QACd,QAAQ,EAAE,MAAM,CAAC;QACjB,OAAO,EAAE,MAAM,CAAC;QAChB,SAAS,EAAE,MAAM,CAAC;KACnB,CAAC;IAEF;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAC;IAEjB;;OAEG;IACH,MAAM,EAAE;QACN,MAAM,EAAE,MAAM,CAAC;QACf,YAAY,EAAE,MAAM,CAAC;QACrB,OAAO,EAAE,MAAM,CAAC;QAChB,SAAS,EAAE,MAAM,CAAC;KACnB,CAAC;
|
|
1
|
+
{"version":3,"file":"environment-settings.interface.d.ts","sourceRoot":"","sources":["../../../src/_models/interfaces/environment-settings.interface.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAC;AAI7D,MAAM,WAAW,0BAA0B;IACzC;;;;;;;OAOG;IACH,WAAW,EAAE,oBAAoB,CAAC;IAElC;;OAEG;IACH,OAAO,EAAE;QACP,KAAK,EAAE,MAAM,CAAC;QACd,QAAQ,EAAE,MAAM,CAAC;QACjB,OAAO,EAAE,MAAM,CAAC;QAChB,SAAS,EAAE,MAAM,CAAC;KACnB,CAAC;IAEF;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAC;IAEjB;;OAEG;IACH,MAAM,EAAE;QACN,MAAM,EAAE,MAAM,CAAC;QACf,YAAY,EAAE,MAAM,CAAC;QACrB,OAAO,EAAE,MAAM,CAAC;QAChB,SAAS,EAAE,MAAM,CAAC;KACnB,CAAC;IAEF;;OAEG;IACH,UAAU,CAAC,EAAE;QACX,2BAA2B;QAC3B,MAAM,EAAE,MAAM,CAAC;QACf,6GAA6G;QAC7G,WAAW,CAAC,EAAE,MAAM,CAAC;KACtB,CAAC;CAYH"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/** The ElevenLabs environments the provider documents. Anything else is refused rather than guessed at. */
|
|
2
|
+
export type DyNTS_ElevenLabs_Environment = 'global' | 'us' | 'eu-residency' | 'india-residency' | 'singapore-residency';
|
|
3
|
+
/**
|
|
4
|
+
* ElevenLabs region resolution: the environment name → the API host.
|
|
5
|
+
*
|
|
6
|
+
* The host table is the one `dynamo-cli` already runs in production (`DyCLI_MAP_ElevenLabsRegion_Util`),
|
|
7
|
+
* carried here unchanged, because the engine layer needs it too. A residency environment exists so the audio
|
|
8
|
+
* never leaves the region - so an unknown environment is an ERROR, never a silent fall back to the global host.
|
|
9
|
+
*/
|
|
10
|
+
export declare class DyNTS_ElevenLabsRegion_Util {
|
|
11
|
+
/** Host per environment. */
|
|
12
|
+
private static readonly baseUrls;
|
|
13
|
+
/**
|
|
14
|
+
* Accepts only the documented environments; `undefined` means `global`.
|
|
15
|
+
*
|
|
16
|
+
* @param value The raw value, typically `process.env.ELEVENLABS_ENVIRONMENT`.
|
|
17
|
+
*/
|
|
18
|
+
static resolveEnvironment(value: string | undefined): DyNTS_ElevenLabs_Environment;
|
|
19
|
+
/** The API host of one environment. */
|
|
20
|
+
static getBaseUrl(environment: DyNTS_ElevenLabs_Environment): string;
|
|
21
|
+
}
|
|
22
|
+
//# sourceMappingURL=elevenlabs-region.util.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"elevenlabs-region.util.d.ts","sourceRoot":"","sources":["../../../../src/_modules/media-gen/_collections/elevenlabs-region.util.ts"],"names":[],"mappings":"AAAA,2GAA2G;AAC3G,MAAM,MAAM,4BAA4B,GACpC,QAAQ,GACR,IAAI,GACJ,cAAc,GACd,iBAAiB,GACjB,qBAAqB,CAAC;AAE1B;;;;;;GAMG;AACH,qBAAa,2BAA2B;IAEtC,4BAA4B;IAC5B,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,QAAQ,CAM9B;IAEF;;;;OAIG;IACH,MAAM,CAAC,kBAAkB,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,GAAG,4BAA4B;IAqBlF,uCAAuC;IACvC,MAAM,CAAC,UAAU,CAAC,WAAW,EAAE,4BAA4B,GAAG,MAAM;CAGrE"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DyNTS_ElevenLabsRegion_Util = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* ElevenLabs region resolution: the environment name → the API host.
|
|
6
|
+
*
|
|
7
|
+
* The host table is the one `dynamo-cli` already runs in production (`DyCLI_MAP_ElevenLabsRegion_Util`),
|
|
8
|
+
* carried here unchanged, because the engine layer needs it too. A residency environment exists so the audio
|
|
9
|
+
* never leaves the region - so an unknown environment is an ERROR, never a silent fall back to the global host.
|
|
10
|
+
*/
|
|
11
|
+
class DyNTS_ElevenLabsRegion_Util {
|
|
12
|
+
/** Host per environment. */
|
|
13
|
+
static baseUrls = {
|
|
14
|
+
global: 'https://api.elevenlabs.io',
|
|
15
|
+
us: 'https://api.us.elevenlabs.io',
|
|
16
|
+
'eu-residency': 'https://api.eu.residency.elevenlabs.io',
|
|
17
|
+
'india-residency': 'https://api.in.residency.elevenlabs.io',
|
|
18
|
+
'singapore-residency': 'https://api.sg.residency.elevenlabs.io',
|
|
19
|
+
};
|
|
20
|
+
/**
|
|
21
|
+
* Accepts only the documented environments; `undefined` means `global`.
|
|
22
|
+
*
|
|
23
|
+
* @param value The raw value, typically `process.env.ELEVENLABS_ENVIRONMENT`.
|
|
24
|
+
*/
|
|
25
|
+
static resolveEnvironment(value) {
|
|
26
|
+
switch (value) {
|
|
27
|
+
case undefined:
|
|
28
|
+
case 'global':
|
|
29
|
+
return 'global';
|
|
30
|
+
case 'us':
|
|
31
|
+
return 'us';
|
|
32
|
+
case 'eu-residency':
|
|
33
|
+
return 'eu-residency';
|
|
34
|
+
case 'india-residency':
|
|
35
|
+
return 'india-residency';
|
|
36
|
+
case 'singapore-residency':
|
|
37
|
+
return 'singapore-residency';
|
|
38
|
+
default:
|
|
39
|
+
throw new Error(`DyNTS_ElevenLabsRegion_Util: unsupported ElevenLabs environment '${value}'. `
|
|
40
|
+
+ `Supported: ${Object.keys(DyNTS_ElevenLabsRegion_Util.baseUrls).join(', ')}.`);
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
/** The API host of one environment. */
|
|
44
|
+
static getBaseUrl(environment) {
|
|
45
|
+
return DyNTS_ElevenLabsRegion_Util.baseUrls[environment];
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
exports.DyNTS_ElevenLabsRegion_Util = DyNTS_ElevenLabsRegion_Util;
|
|
49
|
+
//# sourceMappingURL=elevenlabs-region.util.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"elevenlabs-region.util.js","sourceRoot":"","sources":["../../../../src/_modules/media-gen/_collections/elevenlabs-region.util.ts"],"names":[],"mappings":";;;AAQA;;;;;;GAMG;AACH,MAAa,2BAA2B;IAEtC,4BAA4B;IACpB,MAAM,CAAU,QAAQ,GAAiD;QAC/E,MAAM,EAAE,2BAA2B;QACnC,EAAE,EAAE,8BAA8B;QAClC,cAAc,EAAE,wCAAwC;QACxD,iBAAiB,EAAE,wCAAwC;QAC3D,qBAAqB,EAAE,wCAAwC;KAChE,CAAC;IAEF;;;;OAIG;IACH,MAAM,CAAC,kBAAkB,CAAC,KAAyB;QACjD,QAAQ,KAAK,EAAE,CAAC;YACd,KAAK,SAAS,CAAC;YACf,KAAK,QAAQ;gBACX,OAAO,QAAQ,CAAC;YAClB,KAAK,IAAI;gBACP,OAAO,IAAI,CAAC;YACd,KAAK,cAAc;gBACjB,OAAO,cAAc,CAAC;YACxB,KAAK,iBAAiB;gBACpB,OAAO,iBAAiB,CAAC;YAC3B,KAAK,qBAAqB;gBACxB,OAAO,qBAAqB,CAAC;YAC/B;gBACE,MAAM,IAAI,KAAK,CACb,oEAAoE,KAAK,KAAK;sBAC5E,cAAc,MAAM,CAAC,IAAI,CAAC,2BAA2B,CAAC,QAAQ,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAChF,CAAC;QACN,CAAC;IACH,CAAC;IAED,uCAAuC;IACvC,MAAM,CAAC,UAAU,CAAC,WAAyC;QACzD,OAAO,2BAA2B,CAAC,QAAQ,CAAC,WAAW,CAAC,CAAC;IAC3D,CAAC;;AAxCH,kEAyCC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/** The HTTP call an ElevenLabs adapter makes - injectable, so specs assert the request without a network or a key. */
|
|
2
|
+
export type DyNTS_ElevenLabs_Fetch = (url: string, init: RequestInit) => Promise<Response>;
|
|
3
|
+
/**
|
|
4
|
+
* Settings of the ElevenLabs adapters. Every field is optional; what is left out is read from the environment
|
|
5
|
+
* AT CALL TIME, so a rotated key or a changed region takes effect without rebuilding the adapter.
|
|
6
|
+
*/
|
|
7
|
+
export interface DyNTS_ElevenLabs_Settings {
|
|
8
|
+
/** API key. Falls back to `ELEVENLABS_API_KEY`. */
|
|
9
|
+
apiKey?: string;
|
|
10
|
+
/**
|
|
11
|
+
* Environment: `global` (default), `us`, `eu-residency`, `india-residency`, `singapore-residency`.
|
|
12
|
+
* Falls back to `ELEVENLABS_ENVIRONMENT`. An unknown value is refused, never mapped to the global host.
|
|
13
|
+
*/
|
|
14
|
+
environment?: string;
|
|
15
|
+
/** HTTP implementation. Defaults to the global `fetch`. */
|
|
16
|
+
fetchImpl?: DyNTS_ElevenLabs_Fetch;
|
|
17
|
+
}
|
|
18
|
+
//# sourceMappingURL=elevenlabs-settings.interface.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"elevenlabs-settings.interface.d.ts","sourceRoot":"","sources":["../../../../src/_modules/media-gen/_models/elevenlabs-settings.interface.ts"],"names":[],"mappings":"AAAA,sHAAsH;AACtH,MAAM,MAAM,sBAAsB,GAAG,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,WAAW,KAAK,OAAO,CAAC,QAAQ,CAAC,CAAC;AAE3F;;;GAGG;AACH,MAAM,WAAW,yBAAyB;IACxC,mDAAmD;IACnD,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;;OAGG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,2DAA2D;IAC3D,SAAS,CAAC,EAAE,sBAAsB,CAAC;CACpC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"elevenlabs-settings.interface.js","sourceRoot":"","sources":["../../../../src/_modules/media-gen/_models/elevenlabs-settings.interface.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { DyFM_AI_Speech_Request, DyFM_AI_Speech_Response } from '@futdevpro/fsm-dynamo/ai';
|
|
2
|
+
import { DyNTS_ElevenLabs_ServiceBase } from './elevenlabs.service-base';
|
|
3
|
+
import { DyNTS_MediaGen_Operation } from '../_models/media-gen-operation.type';
|
|
4
|
+
/**
|
|
5
|
+
* ElevenLabs text-to-speech adapter.
|
|
6
|
+
*
|
|
7
|
+
* Request shape verified against the provider's API reference (2026-09-14): `POST /v1/text-to-speech/{voice_id}`,
|
|
8
|
+
* `xi-api-key` header, `output_format` query parameter, JSON body `{ text, model_id }`, binary audio response.
|
|
9
|
+
* The same shape `dc media-speech` already sends.
|
|
10
|
+
*/
|
|
11
|
+
export declare class DyNTS_ElevenLabs_Speak_ControlService extends DyNTS_ElevenLabs_ServiceBase<DyFM_AI_Speech_Request, DyFM_AI_Speech_Response> {
|
|
12
|
+
/** The provider's documented default output format (API reference, 2026-09-14). */
|
|
13
|
+
static readonly defaultFormat: string;
|
|
14
|
+
readonly operations: readonly DyNTS_MediaGen_Operation[];
|
|
15
|
+
static getInstance(): DyNTS_ElevenLabs_Speak_ControlService;
|
|
16
|
+
/**
|
|
17
|
+
* Speaks `request.text` with `request.voice`, and returns the audio as base64 with the media type the provider
|
|
18
|
+
* reported. A voice is REQUIRED: the provider has no meaningful default, and a silently picked one would be a
|
|
19
|
+
* choice the caller never made.
|
|
20
|
+
*/
|
|
21
|
+
generate(operation: DyNTS_MediaGen_Operation, request: DyFM_AI_Speech_Request, issuer: string): Promise<DyFM_AI_Speech_Response>;
|
|
22
|
+
}
|
|
23
|
+
//# sourceMappingURL=elevenlabs-speak.control-service.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"elevenlabs-speak.control-service.d.ts","sourceRoot":"","sources":["../../../../src/_modules/media-gen/_services/elevenlabs-speak.control-service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,uBAAuB,EAAE,MAAM,0BAA0B,CAAC;AAE3F,OAAO,EAA+B,4BAA4B,EAAE,MAAM,2BAA2B,CAAC;AACtG,OAAO,EAAE,wBAAwB,EAAE,MAAM,qCAAqC,CAAC;AAE/E;;;;;;GAMG;AACH,qBAAa,qCACX,SAAQ,4BAA4B,CAAC,sBAAsB,EAAE,uBAAuB,CAAC;IAErF,mFAAmF;IACnF,MAAM,CAAC,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAmB;IAExD,QAAQ,CAAC,UAAU,EAAE,SAAS,wBAAwB,EAAE,CAAwB;IAEhF,MAAM,CAAC,WAAW,IAAI,qCAAqC;IAI3D;;;;OAIG;IACG,QAAQ,CACZ,SAAS,EAAE,wBAAwB,EACnC,OAAO,EAAE,sBAAsB,EAC/B,MAAM,EAAE,MAAM,GACb,OAAO,CAAC,uBAAuB,CAAC;CAuCpC"}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DyNTS_ElevenLabs_Speak_ControlService = void 0;
|
|
4
|
+
const elevenlabs_service_base_1 = require("./elevenlabs.service-base");
|
|
5
|
+
/**
|
|
6
|
+
* ElevenLabs text-to-speech adapter.
|
|
7
|
+
*
|
|
8
|
+
* Request shape verified against the provider's API reference (2026-09-14): `POST /v1/text-to-speech/{voice_id}`,
|
|
9
|
+
* `xi-api-key` header, `output_format` query parameter, JSON body `{ text, model_id }`, binary audio response.
|
|
10
|
+
* The same shape `dc media-speech` already sends.
|
|
11
|
+
*/
|
|
12
|
+
class DyNTS_ElevenLabs_Speak_ControlService extends elevenlabs_service_base_1.DyNTS_ElevenLabs_ServiceBase {
|
|
13
|
+
/** The provider's documented default output format (API reference, 2026-09-14). */
|
|
14
|
+
static defaultFormat = 'mp3_44100_128';
|
|
15
|
+
operations = ['text-to-speech'];
|
|
16
|
+
static getInstance() {
|
|
17
|
+
return DyNTS_ElevenLabs_Speak_ControlService.getSingletonInstance();
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Speaks `request.text` with `request.voice`, and returns the audio as base64 with the media type the provider
|
|
21
|
+
* reported. A voice is REQUIRED: the provider has no meaningful default, and a silently picked one would be a
|
|
22
|
+
* choice the caller never made.
|
|
23
|
+
*/
|
|
24
|
+
async generate(operation, request, issuer) {
|
|
25
|
+
this.assertOperation(operation, issuer);
|
|
26
|
+
if (!request.text) {
|
|
27
|
+
throw this.invalidRequest('The text to speak is empty.', issuer);
|
|
28
|
+
}
|
|
29
|
+
if (!request.voice) {
|
|
30
|
+
throw this.invalidRequest('A voice id is required: the provider has no default voice.', issuer);
|
|
31
|
+
}
|
|
32
|
+
const connection = this.connection(issuer);
|
|
33
|
+
const format = request.format ?? DyNTS_ElevenLabs_Speak_ControlService.defaultFormat;
|
|
34
|
+
const url = `${connection.baseUrl}/v1/text-to-speech/${encodeURIComponent(request.voice)}`
|
|
35
|
+
+ `?output_format=${encodeURIComponent(format)}`;
|
|
36
|
+
const response = await connection.doFetch(url, {
|
|
37
|
+
method: 'POST',
|
|
38
|
+
headers: { 'Content-Type': 'application/json', 'xi-api-key': connection.apiKey },
|
|
39
|
+
body: JSON.stringify({ text: request.text, model_id: request.model }),
|
|
40
|
+
});
|
|
41
|
+
await this.failOnHttpError(response, url, issuer);
|
|
42
|
+
const audio = Buffer.from(await response.arrayBuffer());
|
|
43
|
+
if (!audio.length) {
|
|
44
|
+
throw this.invalidRequest(`ElevenLabs returned an empty audio body (${url}).`, issuer);
|
|
45
|
+
}
|
|
46
|
+
return {
|
|
47
|
+
provider: this.provider,
|
|
48
|
+
model: request.model,
|
|
49
|
+
audio: {
|
|
50
|
+
mimeType: response.headers.get('content-type') ?? 'application/octet-stream',
|
|
51
|
+
base64: audio.toString('base64'),
|
|
52
|
+
},
|
|
53
|
+
format: format,
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
exports.DyNTS_ElevenLabs_Speak_ControlService = DyNTS_ElevenLabs_Speak_ControlService;
|
|
58
|
+
//# sourceMappingURL=elevenlabs-speak.control-service.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"elevenlabs-speak.control-service.js","sourceRoot":"","sources":["../../../../src/_modules/media-gen/_services/elevenlabs-speak.control-service.ts"],"names":[],"mappings":";;;AAEA,uEAAsG;AAGtG;;;;;;GAMG;AACH,MAAa,qCACX,SAAQ,sDAA6E;IAErF,mFAAmF;IACnF,MAAM,CAAU,aAAa,GAAW,eAAe,CAAC;IAE/C,UAAU,GAAwC,CAAE,gBAAgB,CAAE,CAAC;IAEhF,MAAM,CAAC,WAAW;QAChB,OAAO,qCAAqC,CAAC,oBAAoB,EAAE,CAAC;IACtE,CAAC;IAED;;;;OAIG;IACH,KAAK,CAAC,QAAQ,CACZ,SAAmC,EACnC,OAA+B,EAC/B,MAAc;QAEd,IAAI,CAAC,eAAe,CAAC,SAAS,EAAE,MAAM,CAAC,CAAC;QAExC,IAAI,CAAC,OAAO,CAAC,IAAI,EAAE,CAAC;YAClB,MAAM,IAAI,CAAC,cAAc,CAAC,6BAA6B,EAAE,MAAM,CAAC,CAAC;QACnE,CAAC;QAED,IAAI,CAAC,OAAO,CAAC,KAAK,EAAE,CAAC;YACnB,MAAM,IAAI,CAAC,cAAc,CAAC,4DAA4D,EAAE,MAAM,CAAC,CAAC;QAClG,CAAC;QAED,MAAM,UAAU,GAAgC,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC;QACxE,MAAM,MAAM,GAAW,OAAO,CAAC,MAAM,IAAI,qCAAqC,CAAC,aAAa,CAAC;QAC7F,MAAM,GAAG,GAAW,GAAG,UAAU,CAAC,OAAO,sBAAsB,kBAAkB,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE;cAC9F,kBAAkB,kBAAkB,CAAC,MAAM,CAAC,EAAE,CAAC;QACnD,MAAM,QAAQ,GAAa,MAAM,UAAU,CAAC,OAAO,CAAC,GAAG,EAAE;YACvD,MAAM,EAAE,MAAM;YACd,OAAO,EAAE,EAAE,cAAc,EAAE,kBAAkB,EAAE,YAAY,EAAE,UAAU,CAAC,MAAM,EAAE;YAChF,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,EAAE,IAAI,EAAE,OAAO,CAAC,IAAI,EAAE,QAAQ,EAAE,OAAO,CAAC,KAAK,EAAE,CAAC;SACtE,CAAC,CAAC;QAEH,MAAM,IAAI,CAAC,eAAe,CAAC,QAAQ,EAAE,GAAG,EAAE,MAAM,CAAC,CAAC;QAElD,MAAM,KAAK,GAAW,MAAM,CAAC,IAAI,CAAC,MAAM,QAAQ,CAAC,WAAW,EAAE,CAAC,CAAC;QAEhE,IAAI,CAAC,KAAK,CAAC,MAAM,EAAE,CAAC;YAClB,MAAM,IAAI,CAAC,cAAc,CAAC,4CAA4C,GAAG,IAAI,EAAE,MAAM,CAAC,CAAC;QACzF,CAAC;QAED,OAAO;YACL,QAAQ,EAAE,IAAI,CAAC,QAAQ;YACvB,KAAK,EAAE,OAAO,CAAC,KAAK;YACpB,KAAK,EAAE;gBACL,QAAQ,EAAE,QAAQ,CAAC,OAAO,CAAC,GAAG,CAAC,cAAc,CAAC,IAAI,0BAA0B;gBAC5E,MAAM,EAAE,KAAK,CAAC,QAAQ,CAAC,QAAQ,CAAC;aACjC;YACD,MAAM,EAAE,MAAM;SACf,CAAC;IACJ,CAAC;;AA3DH,sFA4DC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { DyFM_AI_Transcription_Request, DyFM_AI_Transcription_Response } from '@futdevpro/fsm-dynamo/ai';
|
|
2
|
+
import { DyNTS_ElevenLabs_ServiceBase } from './elevenlabs.service-base';
|
|
3
|
+
import { DyNTS_MediaGen_Operation } from '../_models/media-gen-operation.type';
|
|
4
|
+
/**
|
|
5
|
+
* ElevenLabs speech-to-text adapter.
|
|
6
|
+
*
|
|
7
|
+
* Request shape verified against the provider's API reference (2026-09-14): `POST /v1/speech-to-text`,
|
|
8
|
+
* `xi-api-key` header, `multipart/form-data` with the required `model_id`, the audio as `file`, and an optional
|
|
9
|
+
* `language_code`; the JSON response carries `text` and `language_code`.
|
|
10
|
+
* ⚠️ `dc media-speech` deliberately did not build this path, because no working call existed to copy - this
|
|
11
|
+
* adapter is built from the reference and exercised by specs; no live call has been made yet.
|
|
12
|
+
*/
|
|
13
|
+
export declare class DyNTS_ElevenLabs_Transcribe_ControlService extends DyNTS_ElevenLabs_ServiceBase<DyFM_AI_Transcription_Request, DyFM_AI_Transcription_Response> {
|
|
14
|
+
readonly operations: readonly DyNTS_MediaGen_Operation[];
|
|
15
|
+
static getInstance(): DyNTS_ElevenLabs_Transcribe_ControlService;
|
|
16
|
+
/** Reads a field of an unknown JSON value without assuming its shape. */
|
|
17
|
+
private static readField;
|
|
18
|
+
/**
|
|
19
|
+
* Transcribes `request.audio`, and returns the transcript with the language the provider reported.
|
|
20
|
+
*/
|
|
21
|
+
generate(operation: DyNTS_MediaGen_Operation, request: DyFM_AI_Transcription_Request, issuer: string): Promise<DyFM_AI_Transcription_Response>;
|
|
22
|
+
}
|
|
23
|
+
//# sourceMappingURL=elevenlabs-transcribe.control-service.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"elevenlabs-transcribe.control-service.d.ts","sourceRoot":"","sources":["../../../../src/_modules/media-gen/_services/elevenlabs-transcribe.control-service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,6BAA6B,EAAE,8BAA8B,EAAE,MAAM,0BAA0B,CAAC;AAEzG,OAAO,EAA+B,4BAA4B,EAAE,MAAM,2BAA2B,CAAC;AACtG,OAAO,EAAE,wBAAwB,EAAE,MAAM,qCAAqC,CAAC;AAE/E;;;;;;;;GAQG;AACH,qBAAa,0CACX,SAAQ,4BAA4B,CAAC,6BAA6B,EAAE,8BAA8B,CAAC;IAEnG,QAAQ,CAAC,UAAU,EAAE,SAAS,wBAAwB,EAAE,CAAwB;IAEhF,MAAM,CAAC,WAAW,IAAI,0CAA0C;IAIhE,yEAAyE;IACzE,OAAO,CAAC,MAAM,CAAC,SAAS;IAIxB;;OAEG;IACG,QAAQ,CACZ,SAAS,EAAE,wBAAwB,EACnC,OAAO,EAAE,6BAA6B,EACtC,MAAM,EAAE,MAAM,GACb,OAAO,CAAC,8BAA8B,CAAC;CA8C3C"}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DyNTS_ElevenLabs_Transcribe_ControlService = void 0;
|
|
4
|
+
const elevenlabs_service_base_1 = require("./elevenlabs.service-base");
|
|
5
|
+
/**
|
|
6
|
+
* ElevenLabs speech-to-text adapter.
|
|
7
|
+
*
|
|
8
|
+
* Request shape verified against the provider's API reference (2026-09-14): `POST /v1/speech-to-text`,
|
|
9
|
+
* `xi-api-key` header, `multipart/form-data` with the required `model_id`, the audio as `file`, and an optional
|
|
10
|
+
* `language_code`; the JSON response carries `text` and `language_code`.
|
|
11
|
+
* ⚠️ `dc media-speech` deliberately did not build this path, because no working call existed to copy - this
|
|
12
|
+
* adapter is built from the reference and exercised by specs; no live call has been made yet.
|
|
13
|
+
*/
|
|
14
|
+
class DyNTS_ElevenLabs_Transcribe_ControlService extends elevenlabs_service_base_1.DyNTS_ElevenLabs_ServiceBase {
|
|
15
|
+
operations = ['speech-to-text'];
|
|
16
|
+
static getInstance() {
|
|
17
|
+
return DyNTS_ElevenLabs_Transcribe_ControlService.getSingletonInstance();
|
|
18
|
+
}
|
|
19
|
+
/** Reads a field of an unknown JSON value without assuming its shape. */
|
|
20
|
+
static readField(json, key) {
|
|
21
|
+
return json !== null && typeof json === 'object' ? Reflect.get(json, key) : undefined;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Transcribes `request.audio`, and returns the transcript with the language the provider reported.
|
|
25
|
+
*/
|
|
26
|
+
async generate(operation, request, issuer) {
|
|
27
|
+
this.assertOperation(operation, issuer);
|
|
28
|
+
if (!request.audio?.base64) {
|
|
29
|
+
throw this.invalidRequest('The audio to transcribe is empty.', issuer);
|
|
30
|
+
}
|
|
31
|
+
const connection = this.connection(issuer);
|
|
32
|
+
const url = `${connection.baseUrl}/v1/speech-to-text`;
|
|
33
|
+
const form = new FormData();
|
|
34
|
+
form.append('model_id', request.model);
|
|
35
|
+
form.append('file', new Blob([new Uint8Array(Buffer.from(request.audio.base64, 'base64'))], { type: request.audio.mimeType }), request.audio.name ?? 'audio');
|
|
36
|
+
if (request.language) {
|
|
37
|
+
form.append('language_code', request.language);
|
|
38
|
+
}
|
|
39
|
+
const response = await connection.doFetch(url, {
|
|
40
|
+
method: 'POST',
|
|
41
|
+
headers: { 'xi-api-key': connection.apiKey },
|
|
42
|
+
body: form,
|
|
43
|
+
});
|
|
44
|
+
await this.failOnHttpError(response, url, issuer);
|
|
45
|
+
const json = await response.json();
|
|
46
|
+
const text = DyNTS_ElevenLabs_Transcribe_ControlService.readField(json, 'text');
|
|
47
|
+
const language = DyNTS_ElevenLabs_Transcribe_ControlService.readField(json, 'language_code');
|
|
48
|
+
if (typeof text !== 'string') {
|
|
49
|
+
throw this.invalidRequest(`ElevenLabs returned no transcript text (${url}).`, issuer);
|
|
50
|
+
}
|
|
51
|
+
return {
|
|
52
|
+
provider: this.provider,
|
|
53
|
+
model: request.model,
|
|
54
|
+
text: text,
|
|
55
|
+
...(typeof language === 'string' ? { language: language } : {}),
|
|
56
|
+
rawResponse: json,
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
exports.DyNTS_ElevenLabs_Transcribe_ControlService = DyNTS_ElevenLabs_Transcribe_ControlService;
|
|
61
|
+
//# sourceMappingURL=elevenlabs-transcribe.control-service.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"elevenlabs-transcribe.control-service.js","sourceRoot":"","sources":["../../../../src/_modules/media-gen/_services/elevenlabs-transcribe.control-service.ts"],"names":[],"mappings":";;;AAEA,uEAAsG;AAGtG;;;;;;;;GAQG;AACH,MAAa,0CACX,SAAQ,sDAA2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AC;YACrB,IAAI,CAAC,MAAM,CAAC,eAAe,EAAE,OAAO,CAAC,QAAQ,CAAC,CAAC;QACjD,CAAC;QAED,MAAM,QAAQ,GAAa,MAAM,UAAU,CAAC,OAAO,CAAC,GAAG,EAAE;YACvD,MAAM,EAAE,MAAM;YACd,OAAO,EAAE,EAAE,YAAY,EAAE,UAAU,CAAC,MAAM,EAAE;YAC5C,IAAI,EAAE,IAAI;SACX,CAAC,CAAC;QAEH,MAAM,IAAI,CAAC,eAAe,CAAC,QAAQ,EAAE,GAAG,EAAE,MAAM,CAAC,CAAC;QAElD,MAAM,IAAI,GAAY,MAAM,QAAQ,CAAC,IAAI,EAAE,CAAC;QAC5C,MAAM,IAAI,GAAY,0CAA0C,CAAC,SAAS,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;QACzF,MAAM,QAAQ,GAAY,0CAA0C,CAAC,SAAS,CAAC,IAAI,EAAE,eAAe,CAAC,CAAC;QAEtG,IAAI,OAAO,IAAI,KAAK,QAAQ,EAAE,CAAC;YAC7B,MAAM,IAAI,CAAC,cAAc,CAAC,2CAA2C,GAAG,IAAI,EAAE,MAAM,CAAC,CAAC;QACxF,CAAC;QAED,OAAO;YACL,QAAQ,EAAE,IAAI,CAAC,QAAQ;YACvB,KAAK,EAAE,OAAO,CAAC,KAAK;YACpB,IAAI,EAAE,IAAI;YACV,GAAG,CAAC,OAAO,QAAQ,KAAK,QAAQ,CAAC,CAAC,CAAC,EAAE,QAAQ,EAAE,QAAQ,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;YAC/D,WAAW,EAAE,IAAI;SAClB,CAAC;IACJ,CAAC;CACF;AAnED,gGAmEC"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { DyFM_Error } from '@futdevpro/fsm-dynamo';
|
|
2
|
+
import { DyNTS_ElevenLabs_Fetch, DyNTS_ElevenLabs_Settings } from '../_models/elevenlabs-settings.interface';
|
|
3
|
+
import { DyNTS_MediaGen_Operation } from '../_models/media-gen-operation.type';
|
|
4
|
+
import { DyNTS_MediaGen_ServiceBase } from './media-gen.service-base';
|
|
5
|
+
/** What one ElevenLabs call needs, resolved at call time. */
|
|
6
|
+
export interface DyNTS_ElevenLabs_Connection {
|
|
7
|
+
baseUrl: string;
|
|
8
|
+
apiKey: string;
|
|
9
|
+
doFetch: DyNTS_ElevenLabs_Fetch;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Shared part of the ElevenLabs adapters: connection resolution and HTTP error reporting.
|
|
13
|
+
*
|
|
14
|
+
* Every refusal happens BEFORE the paid call: an unknown environment, a missing key, an operation the adapter
|
|
15
|
+
* does not serve. The key travels only in the `xi-api-key` header, so the URLs recorded in errors carry no secret.
|
|
16
|
+
*/
|
|
17
|
+
export declare abstract class DyNTS_ElevenLabs_ServiceBase<T_Request, T_Response> extends DyNTS_MediaGen_ServiceBase<T_Request, T_Response> {
|
|
18
|
+
readonly provider: string;
|
|
19
|
+
protected readonly settings: DyNTS_ElevenLabs_Settings;
|
|
20
|
+
constructor(settings?: DyNTS_ElevenLabs_Settings);
|
|
21
|
+
/** Refuses an operation this adapter does not declare. */
|
|
22
|
+
protected assertOperation(operation: DyNTS_MediaGen_Operation, issuer: string): void;
|
|
23
|
+
/** Resolves the host, the key and the HTTP implementation for one call. */
|
|
24
|
+
protected connection(issuer: string): DyNTS_ElevenLabs_Connection;
|
|
25
|
+
/**
|
|
26
|
+
* Throws a detailed error for a non-2xx response. A 401 is named: its repeatedly hit cause is a key ID or
|
|
27
|
+
* a hint pasted instead of the full secret, which looks like a valid credential.
|
|
28
|
+
*/
|
|
29
|
+
protected failOnHttpError(response: Response, url: string, issuer: string): Promise<void>;
|
|
30
|
+
/** A refusal of the caller's request, reported with this adapter's error settings. */
|
|
31
|
+
protected invalidRequest(message: string, issuer: string): DyFM_Error;
|
|
32
|
+
}
|
|
33
|
+
//# sourceMappingURL=elevenlabs.service-base.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"elevenlabs.service-base.d.ts","sourceRoot":"","sources":["../../../../src/_modules/media-gen/_services/elevenlabs.service-base.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAInD,OAAO,EAAE,sBAAsB,EAAE,yBAAyB,EAAE,MAAM,0CAA0C,CAAC;AAC7G,OAAO,EAAE,wBAAwB,EAAE,MAAM,qCAAqC,CAAC;AAC/E,OAAO,EAAE,0BAA0B,EAAE,MAAM,0BAA0B,CAAC;AAEtE,6DAA6D;AAC7D,MAAM,WAAW,2BAA2B;IAC1C,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,sBAAsB,CAAC;CACjC;AAED;;;;;GAKG;AACH,8BAAsB,4BAA4B,CAAC,SAAS,EAAE,UAAU,CACtE,SAAQ,0BAA0B,CAAC,SAAS,EAAE,UAAU,CAAC;IAEzD,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAgB;IAEzC,SAAS,CAAC,QAAQ,CAAC,QAAQ,EAAE,yBAAyB,CAAC;gBAE3C,QAAQ,GAAE,yBAA8B;IAKpD,0DAA0D;IAC1D,SAAS,CAAC,eAAe,CAAC,SAAS,EAAE,wBAAwB,EAAE,MAAM,EAAE,MAAM,GAAG,IAAI;IAepF,2EAA2E;IAC3E,SAAS,CAAC,UAAU,CAAC,MAAM,EAAE,MAAM,GAAG,2BAA2B;IAkCjE;;;OAGG;cACa,eAAe,CAAC,QAAQ,EAAE,QAAQ,EAAE,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAwB/F,sFAAsF;IACtF,SAAS,CAAC,cAAc,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,UAAU;CAMtE"}
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DyNTS_ElevenLabs_ServiceBase = void 0;
|
|
4
|
+
const fsm_dynamo_1 = require("@futdevpro/fsm-dynamo");
|
|
5
|
+
const global_settings_const_1 = require("../../../_collections/global-settings.const");
|
|
6
|
+
const elevenlabs_region_util_1 = require("../_collections/elevenlabs-region.util");
|
|
7
|
+
const media_gen_service_base_1 = require("./media-gen.service-base");
|
|
8
|
+
/**
|
|
9
|
+
* Shared part of the ElevenLabs adapters: connection resolution and HTTP error reporting.
|
|
10
|
+
*
|
|
11
|
+
* Every refusal happens BEFORE the paid call: an unknown environment, a missing key, an operation the adapter
|
|
12
|
+
* does not serve. The key travels only in the `xi-api-key` header, so the URLs recorded in errors carry no secret.
|
|
13
|
+
*/
|
|
14
|
+
class DyNTS_ElevenLabs_ServiceBase extends media_gen_service_base_1.DyNTS_MediaGen_ServiceBase {
|
|
15
|
+
provider = 'elevenlabs';
|
|
16
|
+
settings;
|
|
17
|
+
constructor(settings = {}) {
|
|
18
|
+
super();
|
|
19
|
+
this.settings = settings;
|
|
20
|
+
}
|
|
21
|
+
/** Refuses an operation this adapter does not declare. */
|
|
22
|
+
assertOperation(operation, issuer) {
|
|
23
|
+
if (!this.operations.includes(operation)) {
|
|
24
|
+
throw new fsm_dynamo_1.DyFM_Error({
|
|
25
|
+
...this.getDefaultErrorSettings('generate', new Error(`${this.constructor.name} does not serve '${operation}'. It serves: ${this.operations.join(', ')}.`), issuer),
|
|
26
|
+
errorCode: `${global_settings_const_1.DyNTS_global_settings.systemShortCodeName}|DyNTS-MG-EL-OP`,
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
/** Resolves the host, the key and the HTTP implementation for one call. */
|
|
31
|
+
connection(issuer) {
|
|
32
|
+
let environment;
|
|
33
|
+
try {
|
|
34
|
+
environment = elevenlabs_region_util_1.DyNTS_ElevenLabsRegion_Util.resolveEnvironment(this.settings.environment ?? process.env.ELEVENLABS_ENVIRONMENT);
|
|
35
|
+
}
|
|
36
|
+
catch (error) {
|
|
37
|
+
throw new fsm_dynamo_1.DyFM_Error({
|
|
38
|
+
...this.getDefaultErrorSettings('connection', error, issuer),
|
|
39
|
+
errorCode: `${global_settings_const_1.DyNTS_global_settings.systemShortCodeName}|DyNTS-MG-EL-ENV`,
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
const apiKey = this.settings.apiKey ?? process.env.ELEVENLABS_API_KEY;
|
|
43
|
+
if (!apiKey) {
|
|
44
|
+
throw new fsm_dynamo_1.DyFM_Error({
|
|
45
|
+
...this.getDefaultErrorSettings('connection', new Error('Missing ElevenLabs API key: pass settings.apiKey or set ELEVENLABS_API_KEY.'), issuer),
|
|
46
|
+
errorCode: `${global_settings_const_1.DyNTS_global_settings.systemShortCodeName}|DyNTS-MG-EL-KEY`,
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
return {
|
|
50
|
+
baseUrl: elevenlabs_region_util_1.DyNTS_ElevenLabsRegion_Util.getBaseUrl(environment),
|
|
51
|
+
apiKey: apiKey,
|
|
52
|
+
doFetch: this.settings.fetchImpl ?? ((url, init) => fetch(url, init)),
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* Throws a detailed error for a non-2xx response. A 401 is named: its repeatedly hit cause is a key ID or
|
|
57
|
+
* a hint pasted instead of the full secret, which looks like a valid credential.
|
|
58
|
+
*/
|
|
59
|
+
async failOnHttpError(response, url, issuer) {
|
|
60
|
+
if (response.ok) {
|
|
61
|
+
return;
|
|
62
|
+
}
|
|
63
|
+
const detail = await response.text().catch(() => '');
|
|
64
|
+
const hint = response.status === 401
|
|
65
|
+
? ' (invalid_api_key - use the full secret shown once at key creation, not a key ID or hint)'
|
|
66
|
+
: '';
|
|
67
|
+
throw new fsm_dynamo_1.DyFM_Error({
|
|
68
|
+
...this.getDefaultErrorSettings('generate', new Error(`ElevenLabs HTTP ${response.status}${hint}: ${detail.slice(0, 500)}`), issuer),
|
|
69
|
+
errorCode: `${global_settings_const_1.DyNTS_global_settings.systemShortCodeName}|DyNTS-MG-EL-HTTP`,
|
|
70
|
+
additionalContent: {
|
|
71
|
+
status: response.status,
|
|
72
|
+
url: url,
|
|
73
|
+
},
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
/** A refusal of the caller's request, reported with this adapter's error settings. */
|
|
77
|
+
invalidRequest(message, issuer) {
|
|
78
|
+
return new fsm_dynamo_1.DyFM_Error({
|
|
79
|
+
...this.getDefaultErrorSettings('generate', new Error(message), issuer),
|
|
80
|
+
errorCode: `${global_settings_const_1.DyNTS_global_settings.systemShortCodeName}|DyNTS-MG-EL-REQ`,
|
|
81
|
+
});
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
exports.DyNTS_ElevenLabs_ServiceBase = DyNTS_ElevenLabs_ServiceBase;
|
|
85
|
+
//# sourceMappingURL=elevenlabs.service-base.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"elevenlabs.service-base.js","sourceRoot":"","sources":["../../../../src/_modules/media-gen/_services/elevenlabs.service-base.ts"],"names":[],"mappings":";;;AAAA,sDAAmD;AAEnD,uFAAoF;AACpF,mFAAmH;AAGnH,qEAAsE;AAStE;;;;;GAKG;AACH,MAAsB,4BACpB,SAAQ,mDAAiD;IAEhD,QAAQ,GAAW,YAAY,CAAC;IAEtB,QAAQ,CAA4B;IAEvD,YAAY,WAAsC,EAAE;QAClD,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;IAC3B,CAAC;IAED,0DAA0D;IAChD,eAAe,CAAC,SAAmC,EAAE,MAAc;QAC3E,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,QAAQ,CAAC,SAAS,CAAC,EAAE,CAAC;YACzC,MAAM,IAAI,uBAAU,CAAC;gBACnB,GAAG,IAAI,CAAC,uBAAuB,CAC7B,UAAU,EACV,IAAI,KAAK,CACP,GAAG,IAAI,CAAC,WAAW,CAAC,IAAI,oB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SAC9G,CAAC;IACJ,CAAC;IAED;;;OAGG;IACO,KAAK,CAAC,eAAe,CAAC,QAAkB,EAAE,GAAW,EAAE,MAAc;QAC7E,IAAI,QAAQ,CAAC,EAAE,EAAE,CAAC;YAChB,OAAO;QACT,CAAC;QAED,MAAM,MAAM,GAAW,MAAM,QAAQ,CAAC,IAAI,EAAE,CAAC,KAAK,CAAC,GAAW,EAAE,CAAC,EAAE,CAAC,CAAC;QACrE,MAAM,IAAI,GAAW,QAAQ,CAAC,MAAM,KAAK,GAAG;YAC1C,CAAC,CAAC,2FAA2F;YAC7F,CAAC,CAAC,EAAE,CAAC;QAEP,MAAM,IAAI,uBAAU,CAAC;YACnB,GAAG,IAAI,CAAC,uBAAuB,CAC7B,UAAU,EACV,IAAI,KAAK,CAAC,mBAAmB,QAAQ,CAAC,MAAM,GAAG,IAAI,KAAK,MAAM,CAAC,KAAK,CAAC,CAAC,EAAE,GAAG,CAAC,EAAE,CAAC,EAC/E,MAAM,CACP;YACD,SAAS,EAAE,GAAG,6CAAqB,CAAC,mBAAmB,mBAAmB;YAC1E,iBAAiB,EAAE;gBACjB,MAAM,EAAE,QAAQ,CAAC,MAAM;gBACvB,GAAG,EAAE,GAAG;aACT;SACF,CAAC,CAAC;IACL,CAAC;IAED,sFAAsF;IAC5E,cAAc,CAAC,OAAe,EAAE,MAAc;QACtD,OAAO,IAAI,uBAAU,CAAC;YACpB,GAAG,IAAI,CAAC,uBAAuB,CAAC,UAAU,EAAE,IAAI,KAAK,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC;YACvE,SAAS,EAAE,GAAG,6CAAqB,CAAC,mBAAmB,kBAAkB;SAC1E,CAAC,CAAC;IACL,CAAC;CACF;AAlGD,oEAkGC"}
|
|
@@ -1,5 +1,10 @@
|
|
|
1
|
+
export * from './_models/elevenlabs-settings.interface';
|
|
1
2
|
export * from './_models/media-gen-operation.type';
|
|
3
|
+
export * from './_collections/elevenlabs-region.util';
|
|
2
4
|
export * from './_collections/media-gen-prompt.util';
|
|
3
5
|
export * from './_services/media-gen.service-base';
|
|
4
6
|
export * from './_services/media-gen.registry';
|
|
7
|
+
export * from './_services/elevenlabs.service-base';
|
|
8
|
+
export * from './_services/elevenlabs-speak.control-service';
|
|
9
|
+
export * from './_services/elevenlabs-transcribe.control-service';
|
|
5
10
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/_modules/media-gen/index.ts"],"names":[],"mappings":"AAUA,cAAc,oCAAoC,CAAC;AAGnD,cAAc,sCAAsC,CAAC;AAGrD,cAAc,oCAAoC,CAAC;AACnD,cAAc,gCAAgC,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/_modules/media-gen/index.ts"],"names":[],"mappings":"AAUA,cAAc,yCAAyC,CAAC;AACxD,cAAc,oCAAoC,CAAC;AAGnD,cAAc,uCAAuC,CAAC;AACtD,cAAc,sCAAsC,CAAC;AAGrD,cAAc,oCAAoC,CAAC;AACnD,cAAc,gCAAgC,CAAC;AAC/C,cAAc,qCAAqC,CAAC;AACpD,cAAc,8CAA8C,CAAC;AAC7D,cAAc,mDAAmD,CAAC"}
|
|
@@ -8,10 +8,15 @@
|
|
|
8
8
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
9
|
const tslib_1 = require("tslib");
|
|
10
10
|
// MODELS
|
|
11
|
+
tslib_1.__exportStar(require("./_models/elevenlabs-settings.interface"), exports);
|
|
11
12
|
tslib_1.__exportStar(require("./_models/media-gen-operation.type"), exports);
|
|
12
13
|
// COLLECTIONS
|
|
14
|
+
tslib_1.__exportStar(require("./_collections/elevenlabs-region.util"), exports);
|
|
13
15
|
tslib_1.__exportStar(require("./_collections/media-gen-prompt.util"), exports);
|
|
14
16
|
// SERVICES
|
|
15
17
|
tslib_1.__exportStar(require("./_services/media-gen.service-base"), exports);
|
|
16
18
|
tslib_1.__exportStar(require("./_services/media-gen.registry"), exports);
|
|
19
|
+
tslib_1.__exportStar(require("./_services/elevenlabs.service-base"), exports);
|
|
20
|
+
tslib_1.__exportStar(require("./_services/elevenlabs-speak.control-service"), exports);
|
|
21
|
+
tslib_1.__exportStar(require("./_services/elevenlabs-transcribe.control-service"), exports);
|
|
17
22
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/_modules/media-gen/index.ts"],"names":[],"mappings":";AACA,EAAE;AACF,6DAA6D;AAC7D,EAAE;AACF,2GAA2G;AAC3G,6FAA6F;AAC7F,EAAE;;;AAGF,SAAS;AACT,6EAAmD;AAEnD,cAAc;AACd,+EAAqD;AAErD,WAAW;AACX,6EAAmD;AACnD,yEAA+C"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/_modules/media-gen/index.ts"],"names":[],"mappings":";AACA,EAAE;AACF,6DAA6D;AAC7D,EAAE;AACF,2GAA2G;AAC3G,6FAA6F;AAC7F,EAAE;;;AAGF,SAAS;AACT,kFAAwD;AACxD,6EAAmD;AAEnD,cAAc;AACd,gFAAsD;AACtD,+EAAqD;AAErD,WAAW;AACX,6EAAmD;AACnD,yEAA+C;AAC/C,8EAAoD;AACpD,uFAA6D;AAC7D,4FAAkE"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@futdevpro/nts-dynamo",
|
|
3
|
-
"version": "01.15.
|
|
3
|
+
"version": "01.15.263",
|
|
4
4
|
"description": "Dynamic NodeTS (NodeJS-Typescript), MongoDB Backend System Framework by Future Development Program Ltd.",
|
|
5
5
|
"DyBu_settings": {
|
|
6
6
|
"packageType": "server-package",
|