@breeze.blue/sdk 0.3.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/CHANGELOG.md +53 -0
- package/LICENSE +21 -0
- package/README.md +228 -0
- package/dist/_transform.d.ts +2 -0
- package/dist/_transform.js +38 -0
- package/dist/audio.d.ts +49 -0
- package/dist/audio.js +82 -0
- package/dist/client.d.ts +87 -0
- package/dist/client.js +331 -0
- package/dist/errors.d.ts +50 -0
- package/dist/errors.js +151 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.js +4 -0
- package/dist/node.d.ts +5 -0
- package/dist/node.js +74 -0
- package/dist/types.d.ts +275 -0
- package/dist/types.js +1 -0
- package/dist/version.d.ts +2 -0
- package/dist/version.js +2 -0
- package/package.json +52 -0
package/dist/types.d.ts
ADDED
|
@@ -0,0 +1,275 @@
|
|
|
1
|
+
export type JsonObject = Record<string, unknown>;
|
|
2
|
+
export type BreezeBlueFetch = typeof fetch;
|
|
3
|
+
export interface BreezeBlueClientOptions {
|
|
4
|
+
apiKey?: string;
|
|
5
|
+
baseUrl?: string;
|
|
6
|
+
fetch?: BreezeBlueFetch;
|
|
7
|
+
headers?: HeadersInit;
|
|
8
|
+
timeout?: number;
|
|
9
|
+
}
|
|
10
|
+
export interface RequestOptions {
|
|
11
|
+
headers?: HeadersInit;
|
|
12
|
+
signal?: AbortSignal;
|
|
13
|
+
timeout?: number;
|
|
14
|
+
}
|
|
15
|
+
export interface AudioRequestOptions extends RequestOptions {
|
|
16
|
+
outputFormat?: string;
|
|
17
|
+
}
|
|
18
|
+
export interface StreamTextToSpeechOptions extends AudioRequestOptions {
|
|
19
|
+
optimizeStreamingLatency?: number;
|
|
20
|
+
enableLogging?: boolean;
|
|
21
|
+
}
|
|
22
|
+
export interface VoiceSettings {
|
|
23
|
+
stability?: number;
|
|
24
|
+
similarityBoost?: number;
|
|
25
|
+
style?: number;
|
|
26
|
+
useSpeakerBoost?: boolean;
|
|
27
|
+
speed?: number;
|
|
28
|
+
guidanceScale?: number | null;
|
|
29
|
+
}
|
|
30
|
+
export interface PronunciationDictionaryLocator {
|
|
31
|
+
pronunciationDictionaryId: string;
|
|
32
|
+
versionId: string;
|
|
33
|
+
}
|
|
34
|
+
export interface TextToSpeechRequest {
|
|
35
|
+
text: string;
|
|
36
|
+
modelId?: string;
|
|
37
|
+
languageCode?: string;
|
|
38
|
+
instructions?: string;
|
|
39
|
+
voiceSettings?: VoiceSettings;
|
|
40
|
+
seed?: number;
|
|
41
|
+
pronunciationDictionaryLocators?: PronunciationDictionaryLocator[];
|
|
42
|
+
previousText?: string;
|
|
43
|
+
nextText?: string;
|
|
44
|
+
previousRequestIds?: string[];
|
|
45
|
+
nextRequestIds?: string[];
|
|
46
|
+
applyTextNormalization?: string;
|
|
47
|
+
applyLanguageTextNormalization?: boolean;
|
|
48
|
+
}
|
|
49
|
+
export interface AsyncTextToSpeechJob {
|
|
50
|
+
generationJobId: string;
|
|
51
|
+
historyItemId: string;
|
|
52
|
+
status: string;
|
|
53
|
+
}
|
|
54
|
+
export interface GenerationJobError {
|
|
55
|
+
code: string;
|
|
56
|
+
detail: string;
|
|
57
|
+
}
|
|
58
|
+
export interface GenerationJob {
|
|
59
|
+
generationJobId: string;
|
|
60
|
+
historyItemId: string;
|
|
61
|
+
status: string;
|
|
62
|
+
state: string;
|
|
63
|
+
source: string;
|
|
64
|
+
voiceId?: string | null;
|
|
65
|
+
voiceName?: string | null;
|
|
66
|
+
voiceCategory?: string | null;
|
|
67
|
+
modelId?: string | null;
|
|
68
|
+
text?: string | null;
|
|
69
|
+
contentType?: string | null;
|
|
70
|
+
downloadUrl?: string | null;
|
|
71
|
+
createdAt?: string | null;
|
|
72
|
+
completedAt?: string | null;
|
|
73
|
+
dateUnix?: number | null;
|
|
74
|
+
error?: GenerationJobError | null;
|
|
75
|
+
[key: string]: unknown;
|
|
76
|
+
}
|
|
77
|
+
export interface ModelLanguage {
|
|
78
|
+
languageId: string;
|
|
79
|
+
name: string;
|
|
80
|
+
}
|
|
81
|
+
export interface Model {
|
|
82
|
+
modelId: string;
|
|
83
|
+
name: string;
|
|
84
|
+
canDoTextToSpeech: boolean;
|
|
85
|
+
canDoVoiceConversion: boolean;
|
|
86
|
+
canUseStyle: boolean;
|
|
87
|
+
canUseSpeakerBoost: boolean;
|
|
88
|
+
servesProVoices: boolean;
|
|
89
|
+
languages: ModelLanguage[];
|
|
90
|
+
description: string;
|
|
91
|
+
}
|
|
92
|
+
export interface Voice {
|
|
93
|
+
voiceId: string;
|
|
94
|
+
name: string;
|
|
95
|
+
category: string;
|
|
96
|
+
voiceType: string;
|
|
97
|
+
labels: Record<string, string>;
|
|
98
|
+
previewUrl?: string | null;
|
|
99
|
+
settings: Required<VoiceSettings>;
|
|
100
|
+
description?: string | null;
|
|
101
|
+
createdAtUnix?: number | null;
|
|
102
|
+
[key: string]: unknown;
|
|
103
|
+
}
|
|
104
|
+
export interface VoiceList {
|
|
105
|
+
voices: Voice[];
|
|
106
|
+
hasMore: boolean;
|
|
107
|
+
nextPageToken?: string | null;
|
|
108
|
+
total: number;
|
|
109
|
+
page: number;
|
|
110
|
+
pageSize: number;
|
|
111
|
+
}
|
|
112
|
+
export interface VoiceSearchParams {
|
|
113
|
+
search?: string;
|
|
114
|
+
category?: "premade" | "generated" | "cloned" | string;
|
|
115
|
+
voiceType?: "all" | "default" | "personal" | string;
|
|
116
|
+
sort?: "created_at_unix" | "name" | string;
|
|
117
|
+
sortDirection?: "asc" | "desc";
|
|
118
|
+
nextPageToken?: string;
|
|
119
|
+
page?: number;
|
|
120
|
+
pageSize?: number;
|
|
121
|
+
}
|
|
122
|
+
export interface GenericStatus {
|
|
123
|
+
status: string;
|
|
124
|
+
}
|
|
125
|
+
export type UploadData = Blob | ArrayBuffer | Uint8Array | string;
|
|
126
|
+
export interface UploadFile {
|
|
127
|
+
data: UploadData;
|
|
128
|
+
filename?: string;
|
|
129
|
+
contentType?: string;
|
|
130
|
+
}
|
|
131
|
+
export interface VoiceClonePreviewRequest {
|
|
132
|
+
name: string;
|
|
133
|
+
file?: UploadData | UploadFile;
|
|
134
|
+
files?: Array<UploadData | UploadFile>;
|
|
135
|
+
description?: string;
|
|
136
|
+
labels?: Record<string, string>;
|
|
137
|
+
removeBackgroundNoise?: boolean;
|
|
138
|
+
text?: string;
|
|
139
|
+
instructions?: string;
|
|
140
|
+
}
|
|
141
|
+
export interface VoiceClonePreview {
|
|
142
|
+
generatedVoiceId: string;
|
|
143
|
+
requiresVerification: boolean;
|
|
144
|
+
}
|
|
145
|
+
export interface VoiceEditRequest {
|
|
146
|
+
name: string;
|
|
147
|
+
description?: string;
|
|
148
|
+
labels?: Record<string, string>;
|
|
149
|
+
file?: UploadData | UploadFile;
|
|
150
|
+
files?: Array<UploadData | UploadFile>;
|
|
151
|
+
}
|
|
152
|
+
export interface VoiceDesignRequest {
|
|
153
|
+
voiceDescription: string;
|
|
154
|
+
text?: string;
|
|
155
|
+
modelId?: string;
|
|
156
|
+
languageCode?: string;
|
|
157
|
+
autoGenerateText?: boolean;
|
|
158
|
+
loudness?: number;
|
|
159
|
+
quality?: number;
|
|
160
|
+
seed?: number;
|
|
161
|
+
guidanceScale?: number | null;
|
|
162
|
+
previewCount?: number;
|
|
163
|
+
}
|
|
164
|
+
export interface VoiceDesignPreview {
|
|
165
|
+
generatedVoiceId: string;
|
|
166
|
+
audioBase64: string;
|
|
167
|
+
mediaType: string;
|
|
168
|
+
durationSecs?: number | null;
|
|
169
|
+
}
|
|
170
|
+
export interface VoiceDesignResponse {
|
|
171
|
+
previews: VoiceDesignPreview[];
|
|
172
|
+
text: string;
|
|
173
|
+
}
|
|
174
|
+
export interface SaveVoiceRequest {
|
|
175
|
+
generatedVoiceId: string;
|
|
176
|
+
voiceName: string;
|
|
177
|
+
voiceDescription?: string | null;
|
|
178
|
+
labels?: Record<string, string>;
|
|
179
|
+
playedNotSelectedVoiceIds?: string[];
|
|
180
|
+
}
|
|
181
|
+
export interface HistoryItem {
|
|
182
|
+
historyItemId: string;
|
|
183
|
+
voiceId?: string | null;
|
|
184
|
+
voiceName?: string | null;
|
|
185
|
+
voiceCategory?: string | null;
|
|
186
|
+
modelId?: string | null;
|
|
187
|
+
text?: string | null;
|
|
188
|
+
source: string;
|
|
189
|
+
state?: string | null;
|
|
190
|
+
contentType?: string | null;
|
|
191
|
+
dateUnix?: number | null;
|
|
192
|
+
requestId?: string | null;
|
|
193
|
+
latencyMs?: number | null;
|
|
194
|
+
httpStatus?: number | null;
|
|
195
|
+
[key: string]: unknown;
|
|
196
|
+
}
|
|
197
|
+
export interface HistoryList {
|
|
198
|
+
history: HistoryItem[];
|
|
199
|
+
hasMore: boolean;
|
|
200
|
+
lastHistoryItemId?: string | null;
|
|
201
|
+
total: number;
|
|
202
|
+
page: number;
|
|
203
|
+
pageSize: number;
|
|
204
|
+
}
|
|
205
|
+
export interface HistoryListParams {
|
|
206
|
+
voiceId?: string;
|
|
207
|
+
modelId?: string;
|
|
208
|
+
search?: string;
|
|
209
|
+
source?: "TTS" | string;
|
|
210
|
+
sortDirection?: "asc" | "desc";
|
|
211
|
+
startAfterHistoryItemId?: string;
|
|
212
|
+
from?: string;
|
|
213
|
+
to?: string;
|
|
214
|
+
statusClass?: "2xx" | "4xx" | "5xx" | "other";
|
|
215
|
+
page?: number;
|
|
216
|
+
pageSize?: number;
|
|
217
|
+
}
|
|
218
|
+
export interface BalanceTopup {
|
|
219
|
+
topupId?: string | null;
|
|
220
|
+
amount?: number | null;
|
|
221
|
+
status?: string | null;
|
|
222
|
+
createdAt?: string | null;
|
|
223
|
+
[key: string]: unknown;
|
|
224
|
+
}
|
|
225
|
+
export interface Balance {
|
|
226
|
+
balance: number;
|
|
227
|
+
balanceMillicredits?: number | null;
|
|
228
|
+
topups: BalanceTopup[];
|
|
229
|
+
[key: string]: unknown;
|
|
230
|
+
}
|
|
231
|
+
export interface UsageSummary {
|
|
232
|
+
requestCount: number;
|
|
233
|
+
totalTextCharacters: number;
|
|
234
|
+
totalBillableUnits: number;
|
|
235
|
+
totalCost: number;
|
|
236
|
+
totalCostMillicredits: number;
|
|
237
|
+
}
|
|
238
|
+
export interface UsageDailyBucket {
|
|
239
|
+
date: string;
|
|
240
|
+
requestCount: number;
|
|
241
|
+
}
|
|
242
|
+
export interface UsageItem {
|
|
243
|
+
id: string;
|
|
244
|
+
endpoint: string;
|
|
245
|
+
method: string;
|
|
246
|
+
status: number;
|
|
247
|
+
model?: string | null;
|
|
248
|
+
billableUnits?: number | null;
|
|
249
|
+
cost?: number | null;
|
|
250
|
+
costMillicredits?: number | null;
|
|
251
|
+
latencyMs?: number | null;
|
|
252
|
+
traceId?: string | null;
|
|
253
|
+
requestId?: string | null;
|
|
254
|
+
textCharacters?: number | null;
|
|
255
|
+
actionCode?: string | null;
|
|
256
|
+
createdAt?: string | null;
|
|
257
|
+
[key: string]: unknown;
|
|
258
|
+
}
|
|
259
|
+
export interface Usage {
|
|
260
|
+
windowDays?: number | null;
|
|
261
|
+
summary: UsageSummary;
|
|
262
|
+
total: number;
|
|
263
|
+
page: number;
|
|
264
|
+
pageSize: number;
|
|
265
|
+
daily: UsageDailyBucket[];
|
|
266
|
+
items: UsageItem[];
|
|
267
|
+
[key: string]: unknown;
|
|
268
|
+
}
|
|
269
|
+
export interface UsageParams {
|
|
270
|
+
days?: number;
|
|
271
|
+
search?: string;
|
|
272
|
+
method?: string;
|
|
273
|
+
page?: number;
|
|
274
|
+
pageSize?: number;
|
|
275
|
+
}
|
package/dist/types.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/dist/version.js
ADDED
package/package.json
ADDED
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@breeze.blue/sdk",
|
|
3
|
+
"version": "0.3.0",
|
|
4
|
+
"description": "ESM-first TypeScript SDK for the Breeze Blue Developer API.",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"author": "Breeze Blue <support@breeze.blue>",
|
|
7
|
+
"homepage": "https://breeze.blue",
|
|
8
|
+
"keywords": [
|
|
9
|
+
"audio",
|
|
10
|
+
"breeze",
|
|
11
|
+
"breeze-blue",
|
|
12
|
+
"sdk",
|
|
13
|
+
"text-to-speech",
|
|
14
|
+
"tts",
|
|
15
|
+
"voice"
|
|
16
|
+
],
|
|
17
|
+
"type": "module",
|
|
18
|
+
"main": "./dist/index.js",
|
|
19
|
+
"types": "./dist/index.d.ts",
|
|
20
|
+
"exports": {
|
|
21
|
+
".": {
|
|
22
|
+
"types": "./dist/index.d.ts",
|
|
23
|
+
"import": "./dist/index.js"
|
|
24
|
+
},
|
|
25
|
+
"./node": {
|
|
26
|
+
"types": "./dist/node.d.ts",
|
|
27
|
+
"import": "./dist/node.js"
|
|
28
|
+
}
|
|
29
|
+
},
|
|
30
|
+
"files": [
|
|
31
|
+
"dist",
|
|
32
|
+
"README.md",
|
|
33
|
+
"CHANGELOG.md",
|
|
34
|
+
"LICENSE"
|
|
35
|
+
],
|
|
36
|
+
"publishConfig": {
|
|
37
|
+
"access": "public"
|
|
38
|
+
},
|
|
39
|
+
"engines": {
|
|
40
|
+
"node": ">=20"
|
|
41
|
+
},
|
|
42
|
+
"sideEffects": false,
|
|
43
|
+
"devDependencies": {
|
|
44
|
+
"@types/node": "^20.19.35",
|
|
45
|
+
"typescript": "^5.9.3"
|
|
46
|
+
},
|
|
47
|
+
"scripts": {
|
|
48
|
+
"build": "pnpm exec tsc -p tsconfig.json",
|
|
49
|
+
"typecheck": "pnpm exec tsc -p tsconfig.json --noEmit",
|
|
50
|
+
"test": "pnpm run build && node --test ./test/*.test.js"
|
|
51
|
+
}
|
|
52
|
+
}
|