adminforth 2.50.0 → 2.51.0
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/dist/spa/src/types/adapters/AudioAdapter.ts +73 -0
- package/dist/spa/src/types/adapters/index.ts +10 -0
- package/dist/types/adapters/AudioAdapter.d.ts +52 -0
- package/dist/types/adapters/AudioAdapter.d.ts.map +1 -0
- package/dist/types/adapters/AudioAdapter.js +2 -0
- package/dist/types/adapters/AudioAdapter.js.map +1 -0
- package/dist/types/adapters/index.d.ts +1 -0
- package/dist/types/adapters/index.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
export type SpeechToTextInput = {
|
|
2
|
+
buffer: Buffer;
|
|
3
|
+
filename: string;
|
|
4
|
+
mimeType: string;
|
|
5
|
+
language?: string;
|
|
6
|
+
prompt?: string;
|
|
7
|
+
};
|
|
8
|
+
|
|
9
|
+
export type SpeechToTextResult = {
|
|
10
|
+
text: string;
|
|
11
|
+
language?: string;
|
|
12
|
+
raw?: unknown;
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
export interface SpeechToTextAdapter {
|
|
16
|
+
name: string;
|
|
17
|
+
|
|
18
|
+
validate(): void;
|
|
19
|
+
|
|
20
|
+
transcribe(input: SpeechToTextInput): Promise<SpeechToTextResult>;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export type TtsAudioFormat =
|
|
24
|
+
| "mp3"
|
|
25
|
+
| "opus"
|
|
26
|
+
| "aac"
|
|
27
|
+
| "flac"
|
|
28
|
+
| "wav"
|
|
29
|
+
| "pcm";
|
|
30
|
+
|
|
31
|
+
export type TextToSpeechInput<Voice extends string = string> = {
|
|
32
|
+
text: string;
|
|
33
|
+
voice?: Voice;
|
|
34
|
+
format?: TtsAudioFormat;
|
|
35
|
+
speed?: number;
|
|
36
|
+
instructions?: string;
|
|
37
|
+
stream?: false;
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
export type TextToSpeechResult = {
|
|
41
|
+
audio: Buffer;
|
|
42
|
+
mimeType: string;
|
|
43
|
+
format: TtsAudioFormat;
|
|
44
|
+
raw?: unknown;
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
export type TtsStreamFormat = "audio" | "sse";
|
|
48
|
+
|
|
49
|
+
export type TextToSpeechStreamInput<Voice extends string = string> =
|
|
50
|
+
Omit<TextToSpeechInput<Voice>, "stream"> & {
|
|
51
|
+
stream: true;
|
|
52
|
+
streamFormat?: TtsStreamFormat;
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
export type TextToSpeechStreamResult = {
|
|
56
|
+
audioStream: ReadableStream<Uint8Array>;
|
|
57
|
+
mimeType: string;
|
|
58
|
+
format: TtsAudioFormat;
|
|
59
|
+
streamFormat: TtsStreamFormat;
|
|
60
|
+
raw?: unknown;
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
export interface TextToSpeechAdapter<Voice extends string = string> {
|
|
64
|
+
name: string;
|
|
65
|
+
|
|
66
|
+
validate(): void;
|
|
67
|
+
|
|
68
|
+
synthesize(input: TextToSpeechStreamInput<Voice>): Promise<TextToSpeechStreamResult>;
|
|
69
|
+
synthesize(input: TextToSpeechInput<Voice>): Promise<TextToSpeechResult>;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
export type AudioAdapter<Voice extends string = string> =
|
|
73
|
+
SpeechToTextAdapter & TextToSpeechAdapter<Voice>;
|
|
@@ -15,3 +15,13 @@ export type { ImageVisionAdapter } from './ImageVisionAdapter.js';
|
|
|
15
15
|
export type { OAuth2Adapter } from './OAuth2Adapter.js';
|
|
16
16
|
export type { StorageAdapter } from './StorageAdapter.js';
|
|
17
17
|
export type { CaptchaAdapter } from './CaptchaAdapter.js';
|
|
18
|
+
export type {
|
|
19
|
+
AudioAdapter,
|
|
20
|
+
SpeechToTextAdapter,
|
|
21
|
+
SpeechToTextInput,
|
|
22
|
+
SpeechToTextResult,
|
|
23
|
+
TextToSpeechAdapter,
|
|
24
|
+
TextToSpeechInput,
|
|
25
|
+
TextToSpeechResult,
|
|
26
|
+
TtsAudioFormat,
|
|
27
|
+
} from './AudioAdapter.js';
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
export type SpeechToTextInput = {
|
|
2
|
+
buffer: Buffer;
|
|
3
|
+
filename: string;
|
|
4
|
+
mimeType: string;
|
|
5
|
+
language?: string;
|
|
6
|
+
prompt?: string;
|
|
7
|
+
};
|
|
8
|
+
export type SpeechToTextResult = {
|
|
9
|
+
text: string;
|
|
10
|
+
language?: string;
|
|
11
|
+
raw?: unknown;
|
|
12
|
+
};
|
|
13
|
+
export interface SpeechToTextAdapter {
|
|
14
|
+
name: string;
|
|
15
|
+
validate(): void;
|
|
16
|
+
transcribe(input: SpeechToTextInput): Promise<SpeechToTextResult>;
|
|
17
|
+
}
|
|
18
|
+
export type TtsAudioFormat = "mp3" | "opus" | "aac" | "flac" | "wav" | "pcm";
|
|
19
|
+
export type TextToSpeechInput<Voice extends string = string> = {
|
|
20
|
+
text: string;
|
|
21
|
+
voice?: Voice;
|
|
22
|
+
format?: TtsAudioFormat;
|
|
23
|
+
speed?: number;
|
|
24
|
+
instructions?: string;
|
|
25
|
+
stream?: false;
|
|
26
|
+
};
|
|
27
|
+
export type TextToSpeechResult = {
|
|
28
|
+
audio: Buffer;
|
|
29
|
+
mimeType: string;
|
|
30
|
+
format: TtsAudioFormat;
|
|
31
|
+
raw?: unknown;
|
|
32
|
+
};
|
|
33
|
+
export type TtsStreamFormat = "audio" | "sse";
|
|
34
|
+
export type TextToSpeechStreamInput<Voice extends string = string> = Omit<TextToSpeechInput<Voice>, "stream"> & {
|
|
35
|
+
stream: true;
|
|
36
|
+
streamFormat?: TtsStreamFormat;
|
|
37
|
+
};
|
|
38
|
+
export type TextToSpeechStreamResult = {
|
|
39
|
+
audioStream: ReadableStream<Uint8Array>;
|
|
40
|
+
mimeType: string;
|
|
41
|
+
format: TtsAudioFormat;
|
|
42
|
+
streamFormat: TtsStreamFormat;
|
|
43
|
+
raw?: unknown;
|
|
44
|
+
};
|
|
45
|
+
export interface TextToSpeechAdapter<Voice extends string = string> {
|
|
46
|
+
name: string;
|
|
47
|
+
validate(): void;
|
|
48
|
+
synthesize(input: TextToSpeechStreamInput<Voice>): Promise<TextToSpeechStreamResult>;
|
|
49
|
+
synthesize(input: TextToSpeechInput<Voice>): Promise<TextToSpeechResult>;
|
|
50
|
+
}
|
|
51
|
+
export type AudioAdapter<Voice extends string = string> = SpeechToTextAdapter & TextToSpeechAdapter<Voice>;
|
|
52
|
+
//# sourceMappingURL=AudioAdapter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AudioAdapter.d.ts","sourceRoot":"","sources":["../../../types/adapters/AudioAdapter.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,iBAAiB,GAAG;IAC9B,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF,MAAM,MAAM,kBAAkB,GAAG;IAC/B,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,GAAG,CAAC,EAAE,OAAO,CAAC;CACf,CAAC;AAEF,MAAM,WAAW,mBAAmB;IAClC,IAAI,EAAE,MAAM,CAAC;IAEb,QAAQ,IAAI,IAAI,CAAC;IAEjB,UAAU,CAAC,KAAK,EAAE,iBAAiB,GAAG,OAAO,CAAC,kBAAkB,CAAC,CAAC;CACnE;AAED,MAAM,MAAM,cAAc,GACtB,KAAK,GACL,MAAM,GACN,KAAK,GACL,MAAM,GACN,KAAK,GACL,KAAK,CAAC;AAEV,MAAM,MAAM,iBAAiB,CAAC,KAAK,SAAS,MAAM,GAAG,MAAM,IAAI;IAC7D,IAAI,EAAE,MAAM,CA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IACpD,mBAAmB,GAAG,mBAAmB,CAAC,KAAK,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AudioAdapter.js","sourceRoot":"","sources":["../../../types/adapters/AudioAdapter.ts"],"names":[],"mappings":""}
|
|
@@ -6,4 +6,5 @@ export type { ImageVisionAdapter } from './ImageVisionAdapter.js';
|
|
|
6
6
|
export type { OAuth2Adapter } from './OAuth2Adapter.js';
|
|
7
7
|
export type { StorageAdapter } from './StorageAdapter.js';
|
|
8
8
|
export type { CaptchaAdapter } from './CaptchaAdapter.js';
|
|
9
|
+
export type { AudioAdapter, SpeechToTextAdapter, SpeechToTextInput, SpeechToTextResult, TextToSpeechAdapter, TextToSpeechInput, TextToSpeechResult, TtsAudioFormat, } from './AudioAdapter.js';
|
|
9
10
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../types/adapters/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACtD,YAAY,EACX,iBAAiB,EACjB,sCAAsC,EACtC,mCAAmC,EACnC,yBAAyB,EACzB,+BAA+B,EAC/B,iBAAiB,EACjB,qBAAqB,EACrB,cAAc,GACd,MAAM,wBAAwB,CAAC;AAChC,YAAY,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAC;AAC1E,YAAY,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAC5D,YAAY,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAClE,YAAY,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACxD,YAAY,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAC1D,YAAY,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../types/adapters/index.ts"],"names":[],"mappings":"AA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