@speechall/sdk 0.0.1 → 2.0.4

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.
Files changed (151) hide show
  1. package/.beads/README.md +81 -0
  2. package/.beads/config.yaml +62 -0
  3. package/.beads/issues.jsonl +46 -0
  4. package/.beads/metadata.json +4 -0
  5. package/.env.example +5 -0
  6. package/.fernignore +45 -0
  7. package/.gitattributes +3 -0
  8. package/.github/copilot-instructions.md +78 -0
  9. package/.github/workflows/auto-release-simple.yml.deprecated +106 -0
  10. package/.github/workflows/auto-release.yml +67 -0
  11. package/.github/workflows/ci.yml +41 -0
  12. package/.github/workflows/release.yml +57 -0
  13. package/AGENTS.md +94 -0
  14. package/CHANGELOG.md +58 -0
  15. package/CLAUDE.md +75 -0
  16. package/README.md +294 -155
  17. package/examples/CLAUDE.md +136 -0
  18. package/examples/advanced-options.ts +213 -0
  19. package/examples/basic-transcription.ts +66 -0
  20. package/examples/error-handling.ts +251 -0
  21. package/examples/list-models.ts +112 -0
  22. package/examples/remote-transcription.ts +60 -0
  23. package/fern/fern.config.json +4 -0
  24. package/fern/generators.yml +43 -0
  25. package/jest.config.js +11 -0
  26. package/package.json +26 -44
  27. package/regenerate.sh +45 -0
  28. package/scripts/fix-generated-code.sh +25 -0
  29. package/src/BaseClient.ts +82 -0
  30. package/src/Client.ts +30 -0
  31. package/src/api/errors/BadRequestError.ts +22 -0
  32. package/src/api/errors/GatewayTimeoutError.ts +22 -0
  33. package/src/api/errors/InternalServerError.ts +22 -0
  34. package/src/api/errors/NotFoundError.ts +22 -0
  35. package/src/api/errors/PaymentRequiredError.ts +22 -0
  36. package/src/api/errors/ServiceUnavailableError.ts +22 -0
  37. package/src/api/errors/TooManyRequestsError.ts +22 -0
  38. package/src/api/errors/UnauthorizedError.ts +22 -0
  39. package/src/api/errors/index.ts +8 -0
  40. package/src/api/index.ts +3 -0
  41. package/src/api/resources/index.ts +5 -0
  42. package/src/api/resources/replacementRules/client/Client.ts +148 -0
  43. package/src/api/resources/replacementRules/client/index.ts +1 -0
  44. package/src/api/resources/replacementRules/client/requests/CreateReplacementRulesetRequest.ts +25 -0
  45. package/src/api/resources/replacementRules/client/requests/index.ts +1 -0
  46. package/src/api/resources/replacementRules/index.ts +2 -0
  47. package/src/api/resources/replacementRules/types/CreateReplacementRulesetResponse.ts +6 -0
  48. package/src/api/resources/replacementRules/types/index.ts +1 -0
  49. package/src/api/resources/speechToText/client/Client.ts +275 -0
  50. package/src/api/resources/speechToText/client/index.ts +1 -0
  51. package/src/api/resources/speechToText/client/requests/RemoteTranscriptionConfiguration.ts +20 -0
  52. package/src/api/resources/speechToText/client/requests/TranscribeRequest.ts +26 -0
  53. package/src/api/resources/speechToText/client/requests/index.ts +2 -0
  54. package/src/api/resources/speechToText/index.ts +1 -0
  55. package/src/api/types/BaseTranscriptionConfiguration.ts +29 -0
  56. package/src/api/types/ErrorResponse.ts +11 -0
  57. package/src/api/types/ExactRule.ts +13 -0
  58. package/src/api/types/RegexGroupRule.ts +28 -0
  59. package/src/api/types/RegexRule.ts +28 -0
  60. package/src/api/types/ReplacementRule.ts +25 -0
  61. package/src/api/types/SpeechToTextModel.ts +90 -0
  62. package/src/api/types/TranscriptLanguageCode.ts +114 -0
  63. package/src/api/types/TranscriptOutputFormat.ts +18 -0
  64. package/src/api/types/TranscriptionDetailed.ts +19 -0
  65. package/src/api/types/TranscriptionModelIdentifier.ts +80 -0
  66. package/src/api/types/TranscriptionOnlyText.ts +11 -0
  67. package/src/api/types/TranscriptionProvider.ts +23 -0
  68. package/src/api/types/TranscriptionResponse.ts +8 -0
  69. package/src/api/types/TranscriptionSegment.ts +17 -0
  70. package/src/api/types/TranscriptionWord.ts +17 -0
  71. package/src/api/types/index.ts +16 -0
  72. package/src/auth/BearerAuthProvider.ts +37 -0
  73. package/src/auth/index.ts +1 -0
  74. package/src/core/auth/AuthProvider.ts +6 -0
  75. package/src/core/auth/AuthRequest.ts +9 -0
  76. package/src/core/auth/BasicAuth.ts +32 -0
  77. package/src/core/auth/BearerToken.ts +20 -0
  78. package/src/core/auth/NoOpAuthProvider.ts +8 -0
  79. package/src/core/auth/index.ts +5 -0
  80. package/src/core/base64.ts +27 -0
  81. package/src/core/exports.ts +2 -0
  82. package/src/core/fetcher/APIResponse.ts +23 -0
  83. package/src/core/fetcher/BinaryResponse.ts +34 -0
  84. package/src/core/fetcher/EndpointMetadata.ts +13 -0
  85. package/src/core/fetcher/EndpointSupplier.ts +14 -0
  86. package/src/core/fetcher/Fetcher.ts +391 -0
  87. package/src/core/fetcher/Headers.ts +93 -0
  88. package/src/core/fetcher/HttpResponsePromise.ts +116 -0
  89. package/src/core/fetcher/RawResponse.ts +61 -0
  90. package/src/core/fetcher/Supplier.ts +11 -0
  91. package/src/core/fetcher/createRequestUrl.ts +6 -0
  92. package/src/core/fetcher/getErrorResponseBody.ts +33 -0
  93. package/src/core/fetcher/getFetchFn.ts +3 -0
  94. package/src/core/fetcher/getHeader.ts +8 -0
  95. package/src/core/fetcher/getRequestBody.ts +20 -0
  96. package/src/core/fetcher/getResponseBody.ts +58 -0
  97. package/src/core/fetcher/index.ts +11 -0
  98. package/src/core/fetcher/makeRequest.ts +42 -0
  99. package/src/core/fetcher/requestWithRetries.ts +64 -0
  100. package/src/core/fetcher/signals.ts +26 -0
  101. package/src/core/file/exports.ts +1 -0
  102. package/src/core/file/file.ts +217 -0
  103. package/src/core/file/index.ts +2 -0
  104. package/src/core/file/types.ts +81 -0
  105. package/src/core/headers.ts +35 -0
  106. package/src/core/index.ts +7 -0
  107. package/src/core/json.ts +27 -0
  108. package/src/core/logging/exports.ts +19 -0
  109. package/src/core/logging/index.ts +1 -0
  110. package/src/core/logging/logger.ts +203 -0
  111. package/src/core/runtime/index.ts +1 -0
  112. package/src/core/runtime/runtime.ts +134 -0
  113. package/src/core/url/encodePathParam.ts +18 -0
  114. package/src/core/url/index.ts +3 -0
  115. package/src/core/url/join.ts +79 -0
  116. package/src/core/url/qs.ts +74 -0
  117. package/src/environments.ts +7 -0
  118. package/src/errors/SpeechallError.ts +58 -0
  119. package/src/errors/SpeechallTimeoutError.ts +13 -0
  120. package/src/errors/handleNonStatusCodeError.ts +37 -0
  121. package/src/errors/index.ts +2 -0
  122. package/src/exports.ts +1 -0
  123. package/src/index.ts +6 -0
  124. package/test-import.ts +17 -0
  125. package/tests/integration/api.test.ts +93 -0
  126. package/tests/unit/client.test.ts +91 -0
  127. package/tsconfig.json +20 -0
  128. package/dist/api.d.ts +0 -467
  129. package/dist/api.d.ts.map +0 -1
  130. package/dist/api.js +0 -592
  131. package/dist/base.d.ts +0 -32
  132. package/dist/base.d.ts.map +0 -1
  133. package/dist/base.js +0 -35
  134. package/dist/common.d.ts +0 -14
  135. package/dist/common.d.ts.map +0 -1
  136. package/dist/common.js +0 -91
  137. package/dist/configuration.d.ts +0 -23
  138. package/dist/configuration.d.ts.map +0 -1
  139. package/dist/configuration.js +0 -25
  140. package/dist/esm/api.js +0 -574
  141. package/dist/esm/base.js +0 -27
  142. package/dist/esm/common.js +0 -79
  143. package/dist/esm/configuration.js +0 -21
  144. package/dist/esm/example.js +0 -131
  145. package/dist/esm/index.js +0 -2
  146. package/dist/example.d.ts +0 -3
  147. package/dist/example.d.ts.map +0 -1
  148. package/dist/example.js +0 -133
  149. package/dist/index.d.ts +0 -3
  150. package/dist/index.d.ts.map +0 -1
  151. package/dist/index.js +0 -18
package/dist/api.js DELETED
@@ -1,592 +0,0 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.TranscribeTimestampGranularityEnum = exports.SpeechToTextApi = exports.SpeechToTextApiFactory = exports.SpeechToTextApiFp = exports.SpeechToTextApiAxiosParamCreator = exports.ReplacementRulesApi = exports.ReplacementRulesApiFactory = exports.ReplacementRulesApiFp = exports.ReplacementRulesApiAxiosParamCreator = exports.OpenaiCompatibleCreateTranscriptionTimestampGranularitiesEnum = exports.OpenAICompatibleSpeechToTextApi = exports.OpenAICompatibleSpeechToTextApiFactory = exports.OpenAICompatibleSpeechToTextApiFp = exports.OpenAICompatibleSpeechToTextApiAxiosParamCreator = exports.TranscriptionProvider = exports.TranscriptionOptionsTimestampGranularityEnum = exports.TranscriptionModelIdentifier = exports.TranscriptOutputFormat = exports.TranscriptLanguageCode = exports.SpeechToTextModelAccuracyTierEnum = exports.SpeechToTextModelModelTypeEnum = exports.RegexRuleFlagsEnum = exports.RegexRuleKindEnum = exports.RegexGroupRuleFlagsEnum = exports.RegexGroupRuleKindEnum = exports.OpenAIAudioResponseFormat = exports.ExactRuleKindEnum = void 0;
7
- const axios_1 = __importDefault(require("axios"));
8
- const common_1 = require("./common");
9
- const base_1 = require("./base");
10
- exports.ExactRuleKindEnum = {
11
- Exact: 'exact'
12
- };
13
- exports.OpenAIAudioResponseFormat = {
14
- Json: 'json',
15
- Text: 'text',
16
- Srt: 'srt',
17
- VerboseJson: 'verbose_json',
18
- Vtt: 'vtt'
19
- };
20
- exports.RegexGroupRuleKindEnum = {
21
- RegexGroup: 'regex_group'
22
- };
23
- exports.RegexGroupRuleFlagsEnum = {
24
- I: 'i',
25
- M: 'm',
26
- S: 's',
27
- X: 'x',
28
- U: 'u'
29
- };
30
- exports.RegexRuleKindEnum = {
31
- Regex: 'regex'
32
- };
33
- exports.RegexRuleFlagsEnum = {
34
- I: 'i',
35
- M: 'm',
36
- S: 's',
37
- X: 'x',
38
- U: 'u'
39
- };
40
- exports.SpeechToTextModelModelTypeEnum = {
41
- General: 'general',
42
- PhoneCall: 'phone_call',
43
- Video: 'video',
44
- CommandAndSearch: 'command_and_search',
45
- Medical: 'medical',
46
- Legal: 'legal',
47
- Voicemail: 'voicemail',
48
- Meeting: 'meeting'
49
- };
50
- exports.SpeechToTextModelAccuracyTierEnum = {
51
- Basic: 'basic',
52
- Standard: 'standard',
53
- Enhanced: 'enhanced',
54
- Premium: 'premium'
55
- };
56
- exports.TranscriptLanguageCode = {
57
- Auto: 'auto',
58
- En: 'en',
59
- EnAu: 'en_au',
60
- EnUk: 'en_uk',
61
- EnUs: 'en_us',
62
- Af: 'af',
63
- Am: 'am',
64
- Ar: 'ar',
65
- As: 'as',
66
- Az: 'az',
67
- Ba: 'ba',
68
- Be: 'be',
69
- Bg: 'bg',
70
- Bn: 'bn',
71
- Bo: 'bo',
72
- Br: 'br',
73
- Bs: 'bs',
74
- Ca: 'ca',
75
- Cs: 'cs',
76
- Cy: 'cy',
77
- Da: 'da',
78
- De: 'de',
79
- El: 'el',
80
- Es: 'es',
81
- Et: 'et',
82
- Eu: 'eu',
83
- Fa: 'fa',
84
- Fi: 'fi',
85
- Fo: 'fo',
86
- Fr: 'fr',
87
- Gl: 'gl',
88
- Gu: 'gu',
89
- Ha: 'ha',
90
- Haw: 'haw',
91
- He: 'he',
92
- Hi: 'hi',
93
- Hr: 'hr',
94
- Ht: 'ht',
95
- Hu: 'hu',
96
- Hy: 'hy',
97
- Id: 'id',
98
- Is: 'is',
99
- It: 'it',
100
- Ja: 'ja',
101
- Jw: 'jw',
102
- Ka: 'ka',
103
- Kk: 'kk',
104
- Km: 'km',
105
- Kn: 'kn',
106
- Ko: 'ko',
107
- La: 'la',
108
- Lb: 'lb',
109
- Ln: 'ln',
110
- Lo: 'lo',
111
- Lt: 'lt',
112
- Lv: 'lv',
113
- Mg: 'mg',
114
- Mi: 'mi',
115
- Mk: 'mk',
116
- Ml: 'ml',
117
- Mn: 'mn',
118
- Mr: 'mr',
119
- Ms: 'ms',
120
- Mt: 'mt',
121
- My: 'my',
122
- Ne: 'ne',
123
- Nl: 'nl',
124
- Nn: 'nn',
125
- False: 'false',
126
- Oc: 'oc',
127
- Pa: 'pa',
128
- Pl: 'pl',
129
- Ps: 'ps',
130
- Pt: 'pt',
131
- Ro: 'ro',
132
- Ru: 'ru',
133
- Sa: 'sa',
134
- Sd: 'sd',
135
- Si: 'si',
136
- Sk: 'sk',
137
- Sl: 'sl',
138
- Sn: 'sn',
139
- So: 'so',
140
- Sq: 'sq',
141
- Sr: 'sr',
142
- Su: 'su',
143
- Sv: 'sv',
144
- Sw: 'sw',
145
- Ta: 'ta',
146
- Te: 'te',
147
- Tg: 'tg',
148
- Th: 'th',
149
- Tk: 'tk',
150
- Tl: 'tl',
151
- Tr: 'tr',
152
- Tt: 'tt',
153
- Uk: 'uk',
154
- Ur: 'ur',
155
- Uz: 'uz',
156
- Vi: 'vi',
157
- Yi: 'yi',
158
- Yo: 'yo',
159
- Zh: 'zh'
160
- };
161
- exports.TranscriptOutputFormat = {
162
- Text: 'text',
163
- JsonText: 'json_text',
164
- Json: 'json',
165
- Srt: 'srt',
166
- Vtt: 'vtt'
167
- };
168
- exports.TranscriptionModelIdentifier = {
169
- AmazonTranscribe: 'amazon.transcribe',
170
- AssemblyaiBest: 'assemblyai.best',
171
- AssemblyaiNano: 'assemblyai.nano',
172
- AzureStandard: 'azure.standard',
173
- CloudflareWhisper: 'cloudflare.whisper',
174
- DeepgramBase: 'deepgram.base',
175
- DeepgramBaseConversationalai: 'deepgram.base-conversationalai',
176
- DeepgramBaseFinance: 'deepgram.base-finance',
177
- DeepgramBaseGeneral: 'deepgram.base-general',
178
- DeepgramBaseMeeting: 'deepgram.base-meeting',
179
- DeepgramBasePhonecall: 'deepgram.base-phonecall',
180
- DeepgramBaseVideo: 'deepgram.base-video',
181
- DeepgramBaseVoicemail: 'deepgram.base-voicemail',
182
- DeepgramEnhanced: 'deepgram.enhanced',
183
- DeepgramEnhancedFinance: 'deepgram.enhanced-finance',
184
- DeepgramEnhancedGeneral: 'deepgram.enhanced-general',
185
- DeepgramEnhancedMeeting: 'deepgram.enhanced-meeting',
186
- DeepgramEnhancedPhonecall: 'deepgram.enhanced-phonecall',
187
- DeepgramNova: 'deepgram.nova',
188
- DeepgramNova2: 'deepgram.nova-2',
189
- DeepgramNova2Atc: 'deepgram.nova-2-atc',
190
- DeepgramNova2Automotive: 'deepgram.nova-2-automotive',
191
- DeepgramNova2Conversationalai: 'deepgram.nova-2-conversationalai',
192
- DeepgramNova2Drivethru: 'deepgram.nova-2-drivethru',
193
- DeepgramNova2Finance: 'deepgram.nova-2-finance',
194
- DeepgramNova2General: 'deepgram.nova-2-general',
195
- DeepgramNova2Medical: 'deepgram.nova-2-medical',
196
- DeepgramNova2Meeting: 'deepgram.nova-2-meeting',
197
- DeepgramNova2Phonecall: 'deepgram.nova-2-phonecall',
198
- DeepgramNova2Video: 'deepgram.nova-2-video',
199
- DeepgramNova2Voicemail: 'deepgram.nova-2-voicemail',
200
- DeepgramNova3: 'deepgram.nova-3',
201
- DeepgramNovaGeneral: 'deepgram.nova-general',
202
- DeepgramNovaPhonecall: 'deepgram.nova-phonecall',
203
- DeepgramWhisper: 'deepgram.whisper',
204
- DeepgramWhisperBase: 'deepgram.whisper-base',
205
- DeepgramWhisperLarge: 'deepgram.whisper-large',
206
- DeepgramWhisperMedium: 'deepgram.whisper-medium',
207
- DeepgramWhisperSmall: 'deepgram.whisper-small',
208
- DeepgramWhisperTiny: 'deepgram.whisper-tiny',
209
- FalaiWhisper: 'falai.whisper',
210
- FalaiWizper: 'falai.wizper',
211
- FireworksaiWhisperV3: 'fireworksai.whisper-v3',
212
- FireworksaiWhisperV3Turbo: 'fireworksai.whisper-v3-turbo',
213
- GladiaStandard: 'gladia.standard',
214
- GoogleEnhanced: 'google.enhanced',
215
- GoogleStandard: 'google.standard',
216
- GroqDistilWhisperLargeV3En: 'groq.distil-whisper-large-v3-en',
217
- GroqWhisperLargeV3: 'groq.whisper-large-v3',
218
- GroqWhisperLargeV3Turbo: 'groq.whisper-large-v3-turbo',
219
- IbmStandard: 'ibm.standard',
220
- OpenaiWhisper1: 'openai.whisper-1',
221
- OpenaiGpt4oTranscribe: 'openai.gpt-4o-transcribe',
222
- OpenaiGpt4oMiniTranscribe: 'openai.gpt-4o-mini-transcribe',
223
- RevaiMachine: 'revai.machine',
224
- SpeechmaticsEnhanced: 'speechmatics.enhanced',
225
- SpeechmaticsStandard: 'speechmatics.standard'
226
- };
227
- exports.TranscriptionOptionsTimestampGranularityEnum = {
228
- Word: 'word',
229
- Segment: 'segment'
230
- };
231
- exports.TranscriptionProvider = {
232
- Amazon: 'amazon',
233
- Assemblyai: 'assemblyai',
234
- Azure: 'azure',
235
- Cloudflare: 'cloudflare',
236
- Deepgram: 'deepgram',
237
- Falai: 'falai',
238
- Fireworksai: 'fireworksai',
239
- Gladia: 'gladia',
240
- Google: 'google',
241
- Groq: 'groq',
242
- Ibm: 'ibm',
243
- Openai: 'openai',
244
- Revai: 'revai',
245
- Speechmatics: 'speechmatics'
246
- };
247
- const OpenAICompatibleSpeechToTextApiAxiosParamCreator = function (configuration) {
248
- return {
249
- openaiCompatibleCreateTranscription: async (file, model, language, prompt, responseFormat, temperature, timestampGranularities, options = {}) => {
250
- (0, common_1.assertParamExists)('openaiCompatibleCreateTranscription', 'file', file);
251
- (0, common_1.assertParamExists)('openaiCompatibleCreateTranscription', 'model', model);
252
- const localVarPath = `/openai-compatible/audio/transcriptions`;
253
- const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
254
- let baseOptions;
255
- if (configuration) {
256
- baseOptions = configuration.baseOptions;
257
- }
258
- const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options };
259
- const localVarHeaderParameter = {};
260
- const localVarQueryParameter = {};
261
- const localVarFormParams = new ((configuration && configuration.formDataCtor) || FormData)();
262
- await (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration);
263
- if (file !== undefined) {
264
- localVarFormParams.append('file', file);
265
- }
266
- if (model !== undefined) {
267
- localVarFormParams.append('model', model);
268
- }
269
- if (language !== undefined) {
270
- localVarFormParams.append('language', language);
271
- }
272
- if (prompt !== undefined) {
273
- localVarFormParams.append('prompt', prompt);
274
- }
275
- if (responseFormat !== undefined) {
276
- localVarFormParams.append('response_format', responseFormat);
277
- }
278
- if (temperature !== undefined) {
279
- localVarFormParams.append('temperature', temperature);
280
- }
281
- if (timestampGranularities) {
282
- localVarFormParams.append('timestamp_granularities[]', timestampGranularities.join(base_1.COLLECTION_FORMATS.csv));
283
- }
284
- localVarHeaderParameter['Content-Type'] = 'multipart/form-data';
285
- (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
286
- let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
287
- localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
288
- localVarRequestOptions.data = localVarFormParams;
289
- return {
290
- url: (0, common_1.toPathString)(localVarUrlObj),
291
- options: localVarRequestOptions,
292
- };
293
- },
294
- openaiCompatibleCreateTranslation: async (file, model, prompt, responseFormat, temperature, options = {}) => {
295
- (0, common_1.assertParamExists)('openaiCompatibleCreateTranslation', 'file', file);
296
- (0, common_1.assertParamExists)('openaiCompatibleCreateTranslation', 'model', model);
297
- const localVarPath = `/openai-compatible/audio/translations`;
298
- const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
299
- let baseOptions;
300
- if (configuration) {
301
- baseOptions = configuration.baseOptions;
302
- }
303
- const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options };
304
- const localVarHeaderParameter = {};
305
- const localVarQueryParameter = {};
306
- const localVarFormParams = new ((configuration && configuration.formDataCtor) || FormData)();
307
- await (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration);
308
- if (file !== undefined) {
309
- localVarFormParams.append('file', file);
310
- }
311
- if (model !== undefined) {
312
- localVarFormParams.append('model', new Blob([JSON.stringify(model)], { type: "application/json", }));
313
- }
314
- if (prompt !== undefined) {
315
- localVarFormParams.append('prompt', prompt);
316
- }
317
- if (responseFormat !== undefined) {
318
- localVarFormParams.append('response_format', responseFormat);
319
- }
320
- if (temperature !== undefined) {
321
- localVarFormParams.append('temperature', temperature);
322
- }
323
- localVarHeaderParameter['Content-Type'] = 'multipart/form-data';
324
- (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
325
- let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
326
- localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
327
- localVarRequestOptions.data = localVarFormParams;
328
- return {
329
- url: (0, common_1.toPathString)(localVarUrlObj),
330
- options: localVarRequestOptions,
331
- };
332
- },
333
- };
334
- };
335
- exports.OpenAICompatibleSpeechToTextApiAxiosParamCreator = OpenAICompatibleSpeechToTextApiAxiosParamCreator;
336
- const OpenAICompatibleSpeechToTextApiFp = function (configuration) {
337
- const localVarAxiosParamCreator = (0, exports.OpenAICompatibleSpeechToTextApiAxiosParamCreator)(configuration);
338
- return {
339
- async openaiCompatibleCreateTranscription(file, model, language, prompt, responseFormat, temperature, timestampGranularities, options) {
340
- const localVarAxiosArgs = await localVarAxiosParamCreator.openaiCompatibleCreateTranscription(file, model, language, prompt, responseFormat, temperature, timestampGranularities, options);
341
- const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
342
- const localVarOperationServerBasePath = base_1.operationServerMap['OpenAICompatibleSpeechToTextApi.openaiCompatibleCreateTranscription']?.[localVarOperationServerIndex]?.url;
343
- return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
344
- },
345
- async openaiCompatibleCreateTranslation(file, model, prompt, responseFormat, temperature, options) {
346
- const localVarAxiosArgs = await localVarAxiosParamCreator.openaiCompatibleCreateTranslation(file, model, prompt, responseFormat, temperature, options);
347
- const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
348
- const localVarOperationServerBasePath = base_1.operationServerMap['OpenAICompatibleSpeechToTextApi.openaiCompatibleCreateTranslation']?.[localVarOperationServerIndex]?.url;
349
- return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
350
- },
351
- };
352
- };
353
- exports.OpenAICompatibleSpeechToTextApiFp = OpenAICompatibleSpeechToTextApiFp;
354
- const OpenAICompatibleSpeechToTextApiFactory = function (configuration, basePath, axios) {
355
- const localVarFp = (0, exports.OpenAICompatibleSpeechToTextApiFp)(configuration);
356
- return {
357
- openaiCompatibleCreateTranscription(file, model, language, prompt, responseFormat, temperature, timestampGranularities, options) {
358
- return localVarFp.openaiCompatibleCreateTranscription(file, model, language, prompt, responseFormat, temperature, timestampGranularities, options).then((request) => request(axios, basePath));
359
- },
360
- openaiCompatibleCreateTranslation(file, model, prompt, responseFormat, temperature, options) {
361
- return localVarFp.openaiCompatibleCreateTranslation(file, model, prompt, responseFormat, temperature, options).then((request) => request(axios, basePath));
362
- },
363
- };
364
- };
365
- exports.OpenAICompatibleSpeechToTextApiFactory = OpenAICompatibleSpeechToTextApiFactory;
366
- class OpenAICompatibleSpeechToTextApi extends base_1.BaseAPI {
367
- openaiCompatibleCreateTranscription(file, model, language, prompt, responseFormat, temperature, timestampGranularities, options) {
368
- return (0, exports.OpenAICompatibleSpeechToTextApiFp)(this.configuration).openaiCompatibleCreateTranscription(file, model, language, prompt, responseFormat, temperature, timestampGranularities, options).then((request) => request(this.axios, this.basePath));
369
- }
370
- openaiCompatibleCreateTranslation(file, model, prompt, responseFormat, temperature, options) {
371
- return (0, exports.OpenAICompatibleSpeechToTextApiFp)(this.configuration).openaiCompatibleCreateTranslation(file, model, prompt, responseFormat, temperature, options).then((request) => request(this.axios, this.basePath));
372
- }
373
- }
374
- exports.OpenAICompatibleSpeechToTextApi = OpenAICompatibleSpeechToTextApi;
375
- exports.OpenaiCompatibleCreateTranscriptionTimestampGranularitiesEnum = {
376
- Word: 'word',
377
- Segment: 'segment'
378
- };
379
- const ReplacementRulesApiAxiosParamCreator = function (configuration) {
380
- return {
381
- createReplacementRuleset: async (createReplacementRulesetRequest, options = {}) => {
382
- (0, common_1.assertParamExists)('createReplacementRuleset', 'createReplacementRulesetRequest', createReplacementRulesetRequest);
383
- const localVarPath = `/replacement-rulesets`;
384
- const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
385
- let baseOptions;
386
- if (configuration) {
387
- baseOptions = configuration.baseOptions;
388
- }
389
- const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options };
390
- const localVarHeaderParameter = {};
391
- const localVarQueryParameter = {};
392
- await (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration);
393
- localVarHeaderParameter['Content-Type'] = 'application/json';
394
- (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
395
- let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
396
- localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
397
- localVarRequestOptions.data = (0, common_1.serializeDataIfNeeded)(createReplacementRulesetRequest, localVarRequestOptions, configuration);
398
- return {
399
- url: (0, common_1.toPathString)(localVarUrlObj),
400
- options: localVarRequestOptions,
401
- };
402
- },
403
- };
404
- };
405
- exports.ReplacementRulesApiAxiosParamCreator = ReplacementRulesApiAxiosParamCreator;
406
- const ReplacementRulesApiFp = function (configuration) {
407
- const localVarAxiosParamCreator = (0, exports.ReplacementRulesApiAxiosParamCreator)(configuration);
408
- return {
409
- async createReplacementRuleset(createReplacementRulesetRequest, options) {
410
- const localVarAxiosArgs = await localVarAxiosParamCreator.createReplacementRuleset(createReplacementRulesetRequest, options);
411
- const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
412
- const localVarOperationServerBasePath = base_1.operationServerMap['ReplacementRulesApi.createReplacementRuleset']?.[localVarOperationServerIndex]?.url;
413
- return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
414
- },
415
- };
416
- };
417
- exports.ReplacementRulesApiFp = ReplacementRulesApiFp;
418
- const ReplacementRulesApiFactory = function (configuration, basePath, axios) {
419
- const localVarFp = (0, exports.ReplacementRulesApiFp)(configuration);
420
- return {
421
- createReplacementRuleset(createReplacementRulesetRequest, options) {
422
- return localVarFp.createReplacementRuleset(createReplacementRulesetRequest, options).then((request) => request(axios, basePath));
423
- },
424
- };
425
- };
426
- exports.ReplacementRulesApiFactory = ReplacementRulesApiFactory;
427
- class ReplacementRulesApi extends base_1.BaseAPI {
428
- createReplacementRuleset(createReplacementRulesetRequest, options) {
429
- return (0, exports.ReplacementRulesApiFp)(this.configuration).createReplacementRuleset(createReplacementRulesetRequest, options).then((request) => request(this.axios, this.basePath));
430
- }
431
- }
432
- exports.ReplacementRulesApi = ReplacementRulesApi;
433
- const SpeechToTextApiAxiosParamCreator = function (configuration) {
434
- return {
435
- listSpeechToTextModels: async (options = {}) => {
436
- const localVarPath = `/speech-to-text-models`;
437
- const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
438
- let baseOptions;
439
- if (configuration) {
440
- baseOptions = configuration.baseOptions;
441
- }
442
- const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options };
443
- const localVarHeaderParameter = {};
444
- const localVarQueryParameter = {};
445
- await (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration);
446
- (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
447
- let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
448
- localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
449
- return {
450
- url: (0, common_1.toPathString)(localVarUrlObj),
451
- options: localVarRequestOptions,
452
- };
453
- },
454
- transcribe: async (model, body, language, outputFormat, rulesetId, punctuation, timestampGranularity, diarization, initialPrompt, temperature, smartFormat, speakersExpected, customVocabulary, options = {}) => {
455
- (0, common_1.assertParamExists)('transcribe', 'model', model);
456
- (0, common_1.assertParamExists)('transcribe', 'body', body);
457
- const localVarPath = `/transcribe`;
458
- const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
459
- let baseOptions;
460
- if (configuration) {
461
- baseOptions = configuration.baseOptions;
462
- }
463
- const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options };
464
- const localVarHeaderParameter = {};
465
- const localVarQueryParameter = {};
466
- await (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration);
467
- if (model !== undefined) {
468
- localVarQueryParameter['model'] = model;
469
- }
470
- if (language !== undefined) {
471
- localVarQueryParameter['language'] = language;
472
- }
473
- if (outputFormat !== undefined) {
474
- localVarQueryParameter['output_format'] = outputFormat;
475
- }
476
- if (rulesetId !== undefined) {
477
- localVarQueryParameter['ruleset_id'] = rulesetId;
478
- }
479
- if (punctuation !== undefined) {
480
- localVarQueryParameter['punctuation'] = punctuation;
481
- }
482
- if (timestampGranularity !== undefined) {
483
- localVarQueryParameter['timestamp_granularity'] = timestampGranularity;
484
- }
485
- if (diarization !== undefined) {
486
- localVarQueryParameter['diarization'] = diarization;
487
- }
488
- if (initialPrompt !== undefined) {
489
- localVarQueryParameter['initial_prompt'] = initialPrompt;
490
- }
491
- if (temperature !== undefined) {
492
- localVarQueryParameter['temperature'] = temperature;
493
- }
494
- if (smartFormat !== undefined) {
495
- localVarQueryParameter['smart_format'] = smartFormat;
496
- }
497
- if (speakersExpected !== undefined) {
498
- localVarQueryParameter['speakers_expected'] = speakersExpected;
499
- }
500
- if (customVocabulary) {
501
- localVarQueryParameter['custom_vocabulary'] = customVocabulary;
502
- }
503
- localVarHeaderParameter['Content-Type'] = 'audio/*';
504
- (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
505
- let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
506
- localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
507
- localVarRequestOptions.data = (0, common_1.serializeDataIfNeeded)(body, localVarRequestOptions, configuration);
508
- return {
509
- url: (0, common_1.toPathString)(localVarUrlObj),
510
- options: localVarRequestOptions,
511
- };
512
- },
513
- transcribeRemote: async (transcriptionOptions, options = {}) => {
514
- (0, common_1.assertParamExists)('transcribeRemote', 'transcriptionOptions', transcriptionOptions);
515
- const localVarPath = `/transcribe-remote`;
516
- const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
517
- let baseOptions;
518
- if (configuration) {
519
- baseOptions = configuration.baseOptions;
520
- }
521
- const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options };
522
- const localVarHeaderParameter = {};
523
- const localVarQueryParameter = {};
524
- await (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration);
525
- localVarHeaderParameter['Content-Type'] = 'application/json';
526
- (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
527
- let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
528
- localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
529
- localVarRequestOptions.data = (0, common_1.serializeDataIfNeeded)(transcriptionOptions, localVarRequestOptions, configuration);
530
- return {
531
- url: (0, common_1.toPathString)(localVarUrlObj),
532
- options: localVarRequestOptions,
533
- };
534
- },
535
- };
536
- };
537
- exports.SpeechToTextApiAxiosParamCreator = SpeechToTextApiAxiosParamCreator;
538
- const SpeechToTextApiFp = function (configuration) {
539
- const localVarAxiosParamCreator = (0, exports.SpeechToTextApiAxiosParamCreator)(configuration);
540
- return {
541
- async listSpeechToTextModels(options) {
542
- const localVarAxiosArgs = await localVarAxiosParamCreator.listSpeechToTextModels(options);
543
- const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
544
- const localVarOperationServerBasePath = base_1.operationServerMap['SpeechToTextApi.listSpeechToTextModels']?.[localVarOperationServerIndex]?.url;
545
- return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
546
- },
547
- async transcribe(model, body, language, outputFormat, rulesetId, punctuation, timestampGranularity, diarization, initialPrompt, temperature, smartFormat, speakersExpected, customVocabulary, options) {
548
- const localVarAxiosArgs = await localVarAxiosParamCreator.transcribe(model, body, language, outputFormat, rulesetId, punctuation, timestampGranularity, diarization, initialPrompt, temperature, smartFormat, speakersExpected, customVocabulary, options);
549
- const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
550
- const localVarOperationServerBasePath = base_1.operationServerMap['SpeechToTextApi.transcribe']?.[localVarOperationServerIndex]?.url;
551
- return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
552
- },
553
- async transcribeRemote(transcriptionOptions, options) {
554
- const localVarAxiosArgs = await localVarAxiosParamCreator.transcribeRemote(transcriptionOptions, options);
555
- const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
556
- const localVarOperationServerBasePath = base_1.operationServerMap['SpeechToTextApi.transcribeRemote']?.[localVarOperationServerIndex]?.url;
557
- return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
558
- },
559
- };
560
- };
561
- exports.SpeechToTextApiFp = SpeechToTextApiFp;
562
- const SpeechToTextApiFactory = function (configuration, basePath, axios) {
563
- const localVarFp = (0, exports.SpeechToTextApiFp)(configuration);
564
- return {
565
- listSpeechToTextModels(options) {
566
- return localVarFp.listSpeechToTextModels(options).then((request) => request(axios, basePath));
567
- },
568
- transcribe(model, body, language, outputFormat, rulesetId, punctuation, timestampGranularity, diarization, initialPrompt, temperature, smartFormat, speakersExpected, customVocabulary, options) {
569
- return localVarFp.transcribe(model, body, language, outputFormat, rulesetId, punctuation, timestampGranularity, diarization, initialPrompt, temperature, smartFormat, speakersExpected, customVocabulary, options).then((request) => request(axios, basePath));
570
- },
571
- transcribeRemote(transcriptionOptions, options) {
572
- return localVarFp.transcribeRemote(transcriptionOptions, options).then((request) => request(axios, basePath));
573
- },
574
- };
575
- };
576
- exports.SpeechToTextApiFactory = SpeechToTextApiFactory;
577
- class SpeechToTextApi extends base_1.BaseAPI {
578
- listSpeechToTextModels(options) {
579
- return (0, exports.SpeechToTextApiFp)(this.configuration).listSpeechToTextModels(options).then((request) => request(this.axios, this.basePath));
580
- }
581
- transcribe(model, body, language, outputFormat, rulesetId, punctuation, timestampGranularity, diarization, initialPrompt, temperature, smartFormat, speakersExpected, customVocabulary, options) {
582
- return (0, exports.SpeechToTextApiFp)(this.configuration).transcribe(model, body, language, outputFormat, rulesetId, punctuation, timestampGranularity, diarization, initialPrompt, temperature, smartFormat, speakersExpected, customVocabulary, options).then((request) => request(this.axios, this.basePath));
583
- }
584
- transcribeRemote(transcriptionOptions, options) {
585
- return (0, exports.SpeechToTextApiFp)(this.configuration).transcribeRemote(transcriptionOptions, options).then((request) => request(this.axios, this.basePath));
586
- }
587
- }
588
- exports.SpeechToTextApi = SpeechToTextApi;
589
- exports.TranscribeTimestampGranularityEnum = {
590
- Word: 'word',
591
- Segment: 'segment'
592
- };
package/dist/base.d.ts DELETED
@@ -1,32 +0,0 @@
1
- import type { Configuration } from './configuration';
2
- import type { AxiosInstance, RawAxiosRequestConfig } from 'axios';
3
- export declare const BASE_PATH: string;
4
- export declare const COLLECTION_FORMATS: {
5
- csv: string;
6
- ssv: string;
7
- tsv: string;
8
- pipes: string;
9
- };
10
- export interface RequestArgs {
11
- url: string;
12
- options: RawAxiosRequestConfig;
13
- }
14
- export declare class BaseAPI {
15
- protected basePath: string;
16
- protected axios: AxiosInstance;
17
- protected configuration: Configuration | undefined;
18
- constructor(configuration?: Configuration, basePath?: string, axios?: AxiosInstance);
19
- }
20
- export declare class RequiredError extends Error {
21
- field: string;
22
- constructor(field: string, msg?: string);
23
- }
24
- interface ServerMap {
25
- [key: string]: {
26
- url: string;
27
- description: string;
28
- }[];
29
- }
30
- export declare const operationServerMap: ServerMap;
31
- export {};
32
- //# sourceMappingURL=base.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"base.d.ts","sourceRoot":"","sources":["../base.ts"],"names":[],"mappings":"AAeA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAGrD,OAAO,KAAK,EAAgB,aAAa,EAAE,qBAAqB,EAAE,MAAM,OAAO,CAAC;AAGhF,eAAO,MAAM,SAAS,QAAqD,CAAC;AAM5E,eAAO,MAAM,kBAAkB;;;;;CAK9B,CAAC;AAOF,MAAM,WAAW,WAAW;IACxB,GAAG,EAAE,MAAM,CAAC;IACZ,OAAO,EAAE,qBAAqB,CAAC;CAClC;AAOD,qBAAa,OAAO;IAG2B,SAAS,CAAC,QAAQ,EAAE,MAAM;IAAc,SAAS,CAAC,KAAK,EAAE,aAAa;IAFjH,SAAS,CAAC,aAAa,EAAE,aAAa,GAAG,SAAS,CAAC;gBAEvC,aAAa,CAAC,EAAE,aAAa,EAAY,QAAQ,GAAE,MAAkB,EAAY,KAAK,GAAE,aAA2B;CAMlI;AAQD,qBAAa,aAAc,SAAQ,KAAK;IACjB,KAAK,EAAE,MAAM;gBAAb,KAAK,EAAE,MAAM,EAAE,GAAG,CAAC,EAAE,MAAM;CAIjD;AAED,UAAU,SAAS;IACf,CAAC,GAAG,EAAE,MAAM,GAAG;QACX,GAAG,EAAE,MAAM,CAAC;QACZ,WAAW,EAAE,MAAM,CAAC;KACvB,EAAE,CAAC;CACP;AAMD,eAAO,MAAM,kBAAkB,EAAE,SAChC,CAAA"}
package/dist/base.js DELETED
@@ -1,35 +0,0 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.operationServerMap = exports.RequiredError = exports.BaseAPI = exports.COLLECTION_FORMATS = exports.BASE_PATH = void 0;
7
- const axios_1 = __importDefault(require("axios"));
8
- exports.BASE_PATH = "https://api.speechall.com/v1".replace(/\/+$/, "");
9
- exports.COLLECTION_FORMATS = {
10
- csv: ",",
11
- ssv: " ",
12
- tsv: "\t",
13
- pipes: "|",
14
- };
15
- class BaseAPI {
16
- constructor(configuration, basePath = exports.BASE_PATH, axios = axios_1.default) {
17
- this.basePath = basePath;
18
- this.axios = axios;
19
- if (configuration) {
20
- this.configuration = configuration;
21
- this.basePath = configuration.basePath ?? basePath;
22
- }
23
- }
24
- }
25
- exports.BaseAPI = BaseAPI;
26
- ;
27
- class RequiredError extends Error {
28
- constructor(field, msg) {
29
- super(msg);
30
- this.field = field;
31
- this.name = "RequiredError";
32
- }
33
- }
34
- exports.RequiredError = RequiredError;
35
- exports.operationServerMap = {};