@deepgram/sdk 3.3.4 → 3.4.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.
Files changed (300) hide show
  1. package/README.md +129 -9
  2. package/dist/main/DeepgramClient.d.ts +65 -12
  3. package/dist/main/DeepgramClient.d.ts.map +1 -1
  4. package/dist/main/DeepgramClient.js +73 -18
  5. package/dist/main/DeepgramClient.js.map +1 -1
  6. package/dist/main/index.d.ts +13 -4
  7. package/dist/main/index.d.ts.map +1 -1
  8. package/dist/main/index.js +18 -8
  9. package/dist/main/index.js.map +1 -1
  10. package/dist/main/lib/constants.d.ts +16 -7
  11. package/dist/main/lib/constants.d.ts.map +1 -1
  12. package/dist/main/lib/constants.js +26 -9
  13. package/dist/main/lib/constants.js.map +1 -1
  14. package/dist/main/lib/enums/LiveConnectionState.d.ts +5 -0
  15. package/dist/main/lib/enums/LiveConnectionState.d.ts.map +1 -1
  16. package/dist/main/lib/enums/LiveConnectionState.js +5 -0
  17. package/dist/main/lib/enums/LiveConnectionState.js.map +1 -1
  18. package/dist/main/lib/enums/LiveTranscriptionEvents.d.ts +24 -3
  19. package/dist/main/lib/enums/LiveTranscriptionEvents.d.ts.map +1 -1
  20. package/dist/main/lib/enums/LiveTranscriptionEvents.js +23 -2
  21. package/dist/main/lib/enums/LiveTranscriptionEvents.js.map +1 -1
  22. package/dist/main/lib/enums/index.d.ts +2 -2
  23. package/dist/main/lib/enums/index.d.ts.map +1 -1
  24. package/dist/main/lib/enums/index.js +16 -5
  25. package/dist/main/lib/enums/index.js.map +1 -1
  26. package/dist/main/lib/fetch.d.ts +19 -1
  27. package/dist/main/lib/fetch.d.ts.map +1 -1
  28. package/dist/main/lib/fetch.js +19 -1
  29. package/dist/main/lib/fetch.js.map +1 -1
  30. package/dist/main/lib/helpers.d.ts +9 -5
  31. package/dist/main/lib/helpers.d.ts.map +1 -1
  32. package/dist/main/lib/helpers.js +82 -7
  33. package/dist/main/lib/helpers.js.map +1 -1
  34. package/dist/main/lib/types/CreateProjectKeySchema.d.ts +0 -1
  35. package/dist/main/lib/types/CreateProjectKeySchema.d.ts.map +1 -1
  36. package/dist/main/lib/types/DeepgramClientOptions.d.ts +75 -8
  37. package/dist/main/lib/types/DeepgramClientOptions.d.ts.map +1 -1
  38. package/dist/main/lib/types/Fetch.d.ts +3 -13
  39. package/dist/main/lib/types/Fetch.d.ts.map +1 -1
  40. package/dist/main/lib/types/LiveConfigOptions.d.ts +6 -3
  41. package/dist/main/lib/types/LiveConfigOptions.d.ts.map +1 -1
  42. package/dist/main/lib/types/SyncPrerecordedResponse.d.ts +1 -0
  43. package/dist/main/lib/types/SyncPrerecordedResponse.d.ts.map +1 -1
  44. package/dist/main/lib/types/TranscriptionSchema.d.ts +0 -1
  45. package/dist/main/lib/types/TranscriptionSchema.d.ts.map +1 -1
  46. package/dist/main/lib/types/UpdateProjectMemberScopeSchema.d.ts +1 -1
  47. package/dist/main/lib/types/UpdateProjectMemberScopeSchema.d.ts.map +1 -1
  48. package/dist/main/lib/types/UpdateProjectSchema.d.ts +0 -1
  49. package/dist/main/lib/types/UpdateProjectSchema.d.ts.map +1 -1
  50. package/dist/main/lib/types/index.d.ts +39 -39
  51. package/dist/main/lib/types/index.d.ts.map +1 -1
  52. package/dist/main/lib/types/index.js +53 -0
  53. package/dist/main/lib/types/index.js.map +1 -1
  54. package/dist/main/lib/version.d.ts +1 -1
  55. package/dist/main/lib/version.js +1 -1
  56. package/dist/main/packages/AbstractClient.d.ts +63 -10
  57. package/dist/main/packages/AbstractClient.d.ts.map +1 -1
  58. package/dist/main/packages/AbstractClient.js +103 -50
  59. package/dist/main/packages/AbstractClient.js.map +1 -1
  60. package/dist/main/packages/AbstractLiveClient.d.ts +114 -0
  61. package/dist/main/packages/AbstractLiveClient.d.ts.map +1 -0
  62. package/dist/main/packages/AbstractLiveClient.js +238 -0
  63. package/dist/main/packages/AbstractLiveClient.js.map +1 -0
  64. package/dist/main/packages/AbstractRestClient.d.ts +105 -0
  65. package/dist/main/packages/AbstractRestClient.d.ts.map +1 -0
  66. package/dist/main/packages/AbstractRestClient.js +185 -0
  67. package/dist/main/packages/AbstractRestClient.js.map +1 -0
  68. package/dist/main/packages/ListenClient.d.ts +21 -4
  69. package/dist/main/packages/ListenClient.d.ts.map +1 -1
  70. package/dist/main/packages/ListenClient.js +25 -5
  71. package/dist/main/packages/ListenClient.js.map +1 -1
  72. package/dist/main/packages/ListenLiveClient.d.ts +58 -0
  73. package/dist/main/packages/ListenLiveClient.d.ts.map +1 -0
  74. package/dist/main/packages/ListenLiveClient.js +119 -0
  75. package/dist/main/packages/ListenLiveClient.js.map +1 -0
  76. package/dist/main/packages/ListenRestClient.d.ts +57 -0
  77. package/dist/main/packages/ListenRestClient.d.ts.map +1 -0
  78. package/dist/main/packages/ListenRestClient.js +167 -0
  79. package/dist/main/packages/ListenRestClient.js.map +1 -0
  80. package/dist/main/packages/ManageRestClient.d.ts +286 -0
  81. package/dist/main/packages/ManageRestClient.d.ts.map +1 -0
  82. package/dist/main/packages/ManageRestClient.js +628 -0
  83. package/dist/main/packages/ManageRestClient.js.map +1 -0
  84. package/dist/main/packages/ReadRestClient.d.ts +57 -0
  85. package/dist/main/packages/ReadRestClient.d.ts.map +1 -0
  86. package/dist/main/packages/ReadRestClient.js +165 -0
  87. package/dist/main/packages/ReadRestClient.js.map +1 -0
  88. package/dist/main/packages/SelfHostedRestClient.d.ts +47 -0
  89. package/dist/main/packages/SelfHostedRestClient.d.ts.map +1 -0
  90. package/dist/main/packages/SelfHostedRestClient.js +120 -0
  91. package/dist/main/packages/SelfHostedRestClient.js.map +1 -0
  92. package/dist/main/packages/SpeakRestClient.d.ts +36 -0
  93. package/dist/main/packages/SpeakRestClient.d.ts.map +1 -0
  94. package/dist/main/packages/SpeakRestClient.js +84 -0
  95. package/dist/main/packages/SpeakRestClient.js.map +1 -0
  96. package/dist/main/packages/index.d.ts +10 -8
  97. package/dist/main/packages/index.d.ts.map +1 -1
  98. package/dist/main/packages/index.js +24 -17
  99. package/dist/main/packages/index.js.map +1 -1
  100. package/dist/module/DeepgramClient.d.ts +65 -12
  101. package/dist/module/DeepgramClient.d.ts.map +1 -1
  102. package/dist/module/DeepgramClient.js +72 -17
  103. package/dist/module/DeepgramClient.js.map +1 -1
  104. package/dist/module/index.d.ts +13 -4
  105. package/dist/module/index.d.ts.map +1 -1
  106. package/dist/module/index.js +18 -8
  107. package/dist/module/index.js.map +1 -1
  108. package/dist/module/lib/constants.d.ts +16 -7
  109. package/dist/module/lib/constants.d.ts.map +1 -1
  110. package/dist/module/lib/constants.js +26 -9
  111. package/dist/module/lib/constants.js.map +1 -1
  112. package/dist/module/lib/enums/LiveConnectionState.d.ts +5 -0
  113. package/dist/module/lib/enums/LiveConnectionState.d.ts.map +1 -1
  114. package/dist/module/lib/enums/LiveConnectionState.js +5 -0
  115. package/dist/module/lib/enums/LiveConnectionState.js.map +1 -1
  116. package/dist/module/lib/enums/LiveTranscriptionEvents.d.ts +24 -3
  117. package/dist/module/lib/enums/LiveTranscriptionEvents.d.ts.map +1 -1
  118. package/dist/module/lib/enums/LiveTranscriptionEvents.js +23 -2
  119. package/dist/module/lib/enums/LiveTranscriptionEvents.js.map +1 -1
  120. package/dist/module/lib/enums/index.d.ts +2 -2
  121. package/dist/module/lib/enums/index.d.ts.map +1 -1
  122. package/dist/module/lib/enums/index.js +2 -2
  123. package/dist/module/lib/enums/index.js.map +1 -1
  124. package/dist/module/lib/fetch.d.ts +19 -1
  125. package/dist/module/lib/fetch.d.ts.map +1 -1
  126. package/dist/module/lib/fetch.js +19 -1
  127. package/dist/module/lib/fetch.js.map +1 -1
  128. package/dist/module/lib/helpers.d.ts +9 -5
  129. package/dist/module/lib/helpers.d.ts.map +1 -1
  130. package/dist/module/lib/helpers.js +75 -4
  131. package/dist/module/lib/helpers.js.map +1 -1
  132. package/dist/module/lib/types/CreateProjectKeySchema.d.ts +0 -1
  133. package/dist/module/lib/types/CreateProjectKeySchema.d.ts.map +1 -1
  134. package/dist/module/lib/types/DeepgramClientOptions.d.ts +75 -8
  135. package/dist/module/lib/types/DeepgramClientOptions.d.ts.map +1 -1
  136. package/dist/module/lib/types/Fetch.d.ts +3 -13
  137. package/dist/module/lib/types/Fetch.d.ts.map +1 -1
  138. package/dist/module/lib/types/LiveConfigOptions.d.ts +6 -3
  139. package/dist/module/lib/types/LiveConfigOptions.d.ts.map +1 -1
  140. package/dist/module/lib/types/SyncPrerecordedResponse.d.ts +1 -0
  141. package/dist/module/lib/types/SyncPrerecordedResponse.d.ts.map +1 -1
  142. package/dist/module/lib/types/TranscriptionSchema.d.ts +0 -1
  143. package/dist/module/lib/types/TranscriptionSchema.d.ts.map +1 -1
  144. package/dist/module/lib/types/UpdateProjectMemberScopeSchema.d.ts +1 -1
  145. package/dist/module/lib/types/UpdateProjectMemberScopeSchema.d.ts.map +1 -1
  146. package/dist/module/lib/types/UpdateProjectSchema.d.ts +0 -1
  147. package/dist/module/lib/types/UpdateProjectSchema.d.ts.map +1 -1
  148. package/dist/module/lib/types/index.d.ts +39 -39
  149. package/dist/module/lib/types/index.d.ts.map +1 -1
  150. package/dist/module/lib/types/index.js +39 -1
  151. package/dist/module/lib/types/index.js.map +1 -1
  152. package/dist/module/lib/version.d.ts +1 -1
  153. package/dist/module/lib/version.js +1 -1
  154. package/dist/module/packages/AbstractClient.d.ts +63 -10
  155. package/dist/module/packages/AbstractClient.d.ts.map +1 -1
  156. package/dist/module/packages/AbstractClient.js +99 -50
  157. package/dist/module/packages/AbstractClient.js.map +1 -1
  158. package/dist/module/packages/AbstractLiveClient.d.ts +114 -0
  159. package/dist/module/packages/AbstractLiveClient.d.ts.map +1 -0
  160. package/dist/module/packages/AbstractLiveClient.js +211 -0
  161. package/dist/module/packages/AbstractLiveClient.js.map +1 -0
  162. package/dist/module/packages/AbstractRestClient.d.ts +105 -0
  163. package/dist/module/packages/AbstractRestClient.d.ts.map +1 -0
  164. package/dist/module/packages/AbstractRestClient.js +178 -0
  165. package/dist/module/packages/AbstractRestClient.js.map +1 -0
  166. package/dist/module/packages/ListenClient.d.ts +21 -4
  167. package/dist/module/packages/ListenClient.d.ts.map +1 -1
  168. package/dist/module/packages/ListenClient.js +25 -5
  169. package/dist/module/packages/ListenClient.js.map +1 -1
  170. package/dist/module/packages/ListenLiveClient.d.ts +58 -0
  171. package/dist/module/packages/ListenLiveClient.d.ts.map +1 -0
  172. package/dist/module/packages/ListenLiveClient.js +115 -0
  173. package/dist/module/packages/ListenLiveClient.js.map +1 -0
  174. package/dist/module/packages/ListenRestClient.d.ts +57 -0
  175. package/dist/module/packages/ListenRestClient.d.ts.map +1 -0
  176. package/dist/module/packages/ListenRestClient.js +163 -0
  177. package/dist/module/packages/ListenRestClient.js.map +1 -0
  178. package/dist/module/packages/ManageRestClient.d.ts +286 -0
  179. package/dist/module/packages/ManageRestClient.d.ts.map +1 -0
  180. package/dist/module/packages/ManageRestClient.js +624 -0
  181. package/dist/module/packages/ManageRestClient.js.map +1 -0
  182. package/dist/module/packages/ReadRestClient.d.ts +57 -0
  183. package/dist/module/packages/ReadRestClient.d.ts.map +1 -0
  184. package/dist/module/packages/ReadRestClient.js +161 -0
  185. package/dist/module/packages/ReadRestClient.js.map +1 -0
  186. package/dist/module/packages/SelfHostedRestClient.d.ts +47 -0
  187. package/dist/module/packages/SelfHostedRestClient.d.ts.map +1 -0
  188. package/dist/module/packages/SelfHostedRestClient.js +116 -0
  189. package/dist/module/packages/SelfHostedRestClient.js.map +1 -0
  190. package/dist/module/packages/SpeakRestClient.d.ts +36 -0
  191. package/dist/module/packages/SpeakRestClient.d.ts.map +1 -0
  192. package/dist/module/packages/SpeakRestClient.js +80 -0
  193. package/dist/module/packages/SpeakRestClient.js.map +1 -0
  194. package/dist/module/packages/index.d.ts +10 -8
  195. package/dist/module/packages/index.d.ts.map +1 -1
  196. package/dist/module/packages/index.js +10 -8
  197. package/dist/module/packages/index.js.map +1 -1
  198. package/dist/umd/deepgram.js +1 -1
  199. package/package.json +8 -6
  200. package/src/DeepgramClient.ts +81 -17
  201. package/src/index.ts +32 -7
  202. package/src/lib/constants.ts +33 -13
  203. package/src/lib/enums/LiveConnectionState.ts +11 -4
  204. package/src/lib/enums/LiveTranscriptionEvents.ts +27 -4
  205. package/src/lib/enums/index.ts +2 -2
  206. package/src/lib/fetch.ts +22 -2
  207. package/src/lib/helpers.ts +98 -9
  208. package/src/lib/types/CreateProjectKeySchema.ts +0 -1
  209. package/src/lib/types/DeepgramClientOptions.ts +75 -11
  210. package/src/lib/types/Fetch.ts +2 -24
  211. package/src/lib/types/LiveConfigOptions.ts +7 -3
  212. package/src/lib/types/SyncPrerecordedResponse.ts +1 -0
  213. package/src/lib/types/TranscriptionSchema.ts +0 -2
  214. package/src/lib/types/UpdateProjectMemberScopeSchema.ts +1 -1
  215. package/src/lib/types/UpdateProjectSchema.ts +0 -1
  216. package/src/lib/types/index.ts +39 -54
  217. package/src/lib/version.ts +1 -1
  218. package/src/packages/AbstractClient.ts +129 -61
  219. package/src/packages/AbstractLiveClient.ts +280 -0
  220. package/src/packages/AbstractRestClient.ts +221 -0
  221. package/src/packages/ListenClient.ts +26 -5
  222. package/src/packages/ListenLiveClient.ts +133 -0
  223. package/src/packages/ListenRestClient.ts +201 -0
  224. package/src/packages/ManageRestClient.ts +760 -0
  225. package/src/packages/ReadRestClient.ts +200 -0
  226. package/src/packages/SelfHostedRestClient.ts +134 -0
  227. package/src/packages/SpeakRestClient.ts +79 -0
  228. package/src/packages/index.ts +10 -8
  229. package/dist/main/packages/AbstractRestfulClient.d.ts +0 -26
  230. package/dist/main/packages/AbstractRestfulClient.d.ts.map +0 -1
  231. package/dist/main/packages/AbstractRestfulClient.js +0 -118
  232. package/dist/main/packages/AbstractRestfulClient.js.map +0 -1
  233. package/dist/main/packages/AbstractWsClient.d.ts +0 -10
  234. package/dist/main/packages/AbstractWsClient.d.ts.map +0 -1
  235. package/dist/main/packages/AbstractWsClient.js +0 -33
  236. package/dist/main/packages/AbstractWsClient.js.map +0 -1
  237. package/dist/main/packages/LiveClient.d.ts +0 -28
  238. package/dist/main/packages/LiveClient.d.ts.map +0 -1
  239. package/dist/main/packages/LiveClient.js +0 -110
  240. package/dist/main/packages/LiveClient.js.map +0 -1
  241. package/dist/main/packages/ManageClient.d.ts +0 -97
  242. package/dist/main/packages/ManageClient.d.ts.map +0 -1
  243. package/dist/main/packages/ManageClient.js +0 -463
  244. package/dist/main/packages/ManageClient.js.map +0 -1
  245. package/dist/main/packages/OnPremClient.d.ts +0 -21
  246. package/dist/main/packages/OnPremClient.d.ts.map +0 -1
  247. package/dist/main/packages/OnPremClient.js +0 -99
  248. package/dist/main/packages/OnPremClient.js.map +0 -1
  249. package/dist/main/packages/PrerecordedClient.d.ts +0 -10
  250. package/dist/main/packages/PrerecordedClient.d.ts.map +0 -1
  251. package/dist/main/packages/PrerecordedClient.js +0 -125
  252. package/dist/main/packages/PrerecordedClient.js.map +0 -1
  253. package/dist/main/packages/ReadClient.d.ts +0 -10
  254. package/dist/main/packages/ReadClient.d.ts.map +0 -1
  255. package/dist/main/packages/ReadClient.js +0 -123
  256. package/dist/main/packages/ReadClient.js.map +0 -1
  257. package/dist/main/packages/SpeakClient.d.ts +0 -12
  258. package/dist/main/packages/SpeakClient.d.ts.map +0 -1
  259. package/dist/main/packages/SpeakClient.js +0 -57
  260. package/dist/main/packages/SpeakClient.js.map +0 -1
  261. package/dist/module/packages/AbstractRestfulClient.d.ts +0 -26
  262. package/dist/module/packages/AbstractRestfulClient.d.ts.map +0 -1
  263. package/dist/module/packages/AbstractRestfulClient.js +0 -114
  264. package/dist/module/packages/AbstractRestfulClient.js.map +0 -1
  265. package/dist/module/packages/AbstractWsClient.d.ts +0 -10
  266. package/dist/module/packages/AbstractWsClient.d.ts.map +0 -1
  267. package/dist/module/packages/AbstractWsClient.js +0 -29
  268. package/dist/module/packages/AbstractWsClient.js.map +0 -1
  269. package/dist/module/packages/LiveClient.d.ts +0 -28
  270. package/dist/module/packages/LiveClient.d.ts.map +0 -1
  271. package/dist/module/packages/LiveClient.js +0 -106
  272. package/dist/module/packages/LiveClient.js.map +0 -1
  273. package/dist/module/packages/ManageClient.d.ts +0 -97
  274. package/dist/module/packages/ManageClient.d.ts.map +0 -1
  275. package/dist/module/packages/ManageClient.js +0 -459
  276. package/dist/module/packages/ManageClient.js.map +0 -1
  277. package/dist/module/packages/OnPremClient.d.ts +0 -21
  278. package/dist/module/packages/OnPremClient.d.ts.map +0 -1
  279. package/dist/module/packages/OnPremClient.js +0 -95
  280. package/dist/module/packages/OnPremClient.js.map +0 -1
  281. package/dist/module/packages/PrerecordedClient.d.ts +0 -10
  282. package/dist/module/packages/PrerecordedClient.d.ts.map +0 -1
  283. package/dist/module/packages/PrerecordedClient.js +0 -121
  284. package/dist/module/packages/PrerecordedClient.js.map +0 -1
  285. package/dist/module/packages/ReadClient.d.ts +0 -10
  286. package/dist/module/packages/ReadClient.d.ts.map +0 -1
  287. package/dist/module/packages/ReadClient.js +0 -119
  288. package/dist/module/packages/ReadClient.js.map +0 -1
  289. package/dist/module/packages/SpeakClient.d.ts +0 -12
  290. package/dist/module/packages/SpeakClient.d.ts.map +0 -1
  291. package/dist/module/packages/SpeakClient.js +0 -53
  292. package/dist/module/packages/SpeakClient.js.map +0 -1
  293. package/src/packages/AbstractRestfulClient.ts +0 -160
  294. package/src/packages/AbstractWsClient.ts +0 -42
  295. package/src/packages/LiveClient.ts +0 -140
  296. package/src/packages/ManageClient.ts +0 -584
  297. package/src/packages/OnPremClient.ts +0 -113
  298. package/src/packages/PrerecordedClient.ts +0 -162
  299. package/src/packages/ReadClient.ts +0 -161
  300. package/src/packages/SpeakClient.ts +0 -50
@@ -0,0 +1,238 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || function (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
24
+ };
25
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
26
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
27
+ return new (P || (P = Promise))(function (resolve, reject) {
28
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
29
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
30
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
31
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
32
+ });
33
+ };
34
+ Object.defineProperty(exports, "__esModule", { value: true });
35
+ exports.AbstractWsClient = exports.AbstractLiveClient = void 0;
36
+ const AbstractClient_1 = require("./AbstractClient");
37
+ const constants_1 = require("../lib/constants");
38
+ /**
39
+ * Indicates whether a native WebSocket implementation is available in the current environment.
40
+ */
41
+ const NATIVE_WEBSOCKET_AVAILABLE = typeof WebSocket !== "undefined";
42
+ /**
43
+ * Represents an abstract live client that extends the AbstractClient class.
44
+ * The AbstractLiveClient class provides functionality for connecting, reconnecting, and disconnecting a WebSocket connection, as well as sending data over the connection.
45
+ * Subclasses of this class are responsible for setting up the connection event handlers.
46
+ *
47
+ * @abstract
48
+ */
49
+ class AbstractLiveClient extends AbstractClient_1.AbstractClient {
50
+ constructor(options) {
51
+ super(options);
52
+ this.conn = null;
53
+ this.sendBuffer = [];
54
+ /**
55
+ * Reconnects the socket using new or existing transcription options.
56
+ *
57
+ * @param options - The transcription options to use when reconnecting the socket.
58
+ */
59
+ this.reconnect = AbstractClient_1.noop;
60
+ const { key, websocket: { options: websocketOptions, client }, } = this.namespaceOptions;
61
+ if (this.proxy) {
62
+ this.baseUrl = websocketOptions.proxy.url;
63
+ }
64
+ else {
65
+ this.baseUrl = websocketOptions.url;
66
+ }
67
+ if (client) {
68
+ this.transport = client;
69
+ }
70
+ else {
71
+ this.transport = null;
72
+ }
73
+ if (websocketOptions._nodeOnlyHeaders) {
74
+ this.headers = websocketOptions._nodeOnlyHeaders;
75
+ }
76
+ else {
77
+ this.headers = {};
78
+ }
79
+ if (!("Authorization" in this.headers)) {
80
+ this.headers["Authorization"] = `Token ${key}`; // Add default token
81
+ }
82
+ }
83
+ /**
84
+ * Connects the socket, unless already connected.
85
+ *
86
+ * @protected Can only be called from within the class.
87
+ */
88
+ connect(transcriptionOptions, endpoint) {
89
+ if (this.conn) {
90
+ return;
91
+ }
92
+ this.reconnect = (options = transcriptionOptions) => {
93
+ this.connect(options, endpoint);
94
+ };
95
+ const requestUrl = this.getRequestUrl(endpoint, {}, transcriptionOptions);
96
+ /**
97
+ * Custom websocket transport
98
+ */
99
+ if (this.transport) {
100
+ this.conn = new this.transport(requestUrl, undefined, {
101
+ headers: this.headers,
102
+ });
103
+ return;
104
+ }
105
+ /**
106
+ * Native websocket transport (browser)
107
+ */
108
+ if (NATIVE_WEBSOCKET_AVAILABLE) {
109
+ this.conn = new WebSocket(requestUrl, ["token", this.namespaceOptions.key]);
110
+ this.setupConnection();
111
+ return;
112
+ }
113
+ /**
114
+ * Dummy websocket
115
+ */
116
+ this.conn = new WSWebSocketDummy(requestUrl, undefined, {
117
+ close: () => {
118
+ this.conn = null;
119
+ },
120
+ });
121
+ /**
122
+ * WS package for node environment
123
+ */
124
+ Promise.resolve().then(() => __importStar(require("ws"))).then(({ default: WS }) => {
125
+ this.conn = new WS(requestUrl, undefined, {
126
+ headers: this.headers,
127
+ });
128
+ this.setupConnection();
129
+ });
130
+ }
131
+ /**
132
+ * Disconnects the socket from the client.
133
+ *
134
+ * @param code A numeric status code to send on disconnect.
135
+ * @param reason A custom reason for the disconnect.
136
+ */
137
+ disconnect(code, reason) {
138
+ if (this.conn) {
139
+ this.conn.onclose = function () { }; // noop
140
+ if (code) {
141
+ this.conn.close(code, reason !== null && reason !== void 0 ? reason : "");
142
+ }
143
+ else {
144
+ this.conn.close();
145
+ }
146
+ this.conn = null;
147
+ }
148
+ }
149
+ /**
150
+ * Returns the current connection state of the WebSocket connection.
151
+ *
152
+ * @returns The current connection state of the WebSocket connection.
153
+ */
154
+ connectionState() {
155
+ switch (this.conn && this.conn.readyState) {
156
+ case constants_1.SOCKET_STATES.connecting:
157
+ return constants_1.CONNECTION_STATE.Connecting;
158
+ case constants_1.SOCKET_STATES.open:
159
+ return constants_1.CONNECTION_STATE.Open;
160
+ case constants_1.SOCKET_STATES.closing:
161
+ return constants_1.CONNECTION_STATE.Closing;
162
+ default:
163
+ return constants_1.CONNECTION_STATE.Closed;
164
+ }
165
+ }
166
+ /**
167
+ * Returns the current ready state of the WebSocket connection.
168
+ *
169
+ * @returns The current ready state of the WebSocket connection.
170
+ */
171
+ getReadyState() {
172
+ var _a, _b;
173
+ return (_b = (_a = this.conn) === null || _a === void 0 ? void 0 : _a.readyState) !== null && _b !== void 0 ? _b : constants_1.SOCKET_STATES.closed;
174
+ }
175
+ /**
176
+ * Returns `true` is the connection is open.
177
+ */
178
+ isConnected() {
179
+ return this.connectionState() === constants_1.CONNECTION_STATE.Open;
180
+ }
181
+ /**
182
+ * Sends data to the Deepgram API via websocket connection
183
+ * @param data Audio data to send to Deepgram
184
+ *
185
+ * Conforms to RFC #146 for Node.js - does not send an empty byte.
186
+ * @see https://github.com/deepgram/deepgram-python-sdk/issues/146
187
+ */
188
+ send(data) {
189
+ const callback = () => __awaiter(this, void 0, void 0, function* () {
190
+ var _a;
191
+ if (data instanceof Blob) {
192
+ if (data.size === 0) {
193
+ this.log("warn", "skipping `send` for zero-byte blob", data);
194
+ return;
195
+ }
196
+ data = yield data.arrayBuffer();
197
+ }
198
+ if (typeof data !== "string") {
199
+ if (data.byteLength === 0) {
200
+ this.log("warn", "skipping `send` for zero-byte blob", data);
201
+ return;
202
+ }
203
+ }
204
+ (_a = this.conn) === null || _a === void 0 ? void 0 : _a.send(data);
205
+ });
206
+ if (this.isConnected()) {
207
+ callback();
208
+ }
209
+ else {
210
+ this.sendBuffer.push(callback);
211
+ }
212
+ }
213
+ /**
214
+ * Determines whether the current instance should proxy requests.
215
+ * @returns {boolean} true if the current instance should proxy requests; otherwise, false
216
+ */
217
+ get proxy() {
218
+ var _a;
219
+ return this.key === "proxy" && !!((_a = this.namespaceOptions.websocket.options.proxy) === null || _a === void 0 ? void 0 : _a.url);
220
+ }
221
+ }
222
+ exports.AbstractLiveClient = AbstractLiveClient;
223
+ exports.AbstractWsClient = AbstractLiveClient;
224
+ class WSWebSocketDummy {
225
+ constructor(address, _protocols, options) {
226
+ this.binaryType = "arraybuffer";
227
+ this.onclose = () => { };
228
+ this.onerror = () => { };
229
+ this.onmessage = () => { };
230
+ this.onopen = () => { };
231
+ this.readyState = constants_1.SOCKET_STATES.connecting;
232
+ this.send = () => { };
233
+ this.url = null;
234
+ this.url = address.toString();
235
+ this.close = options.close;
236
+ }
237
+ }
238
+ //# sourceMappingURL=AbstractLiveClient.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AbstractLiveClient.js","sourceRoot":"","sources":["../../../src/packages/AbstractLiveClient.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,qDAAwD;AACxD,gDAAmE;AA6CnE;;GAEG;AACH,MAAM,0BAA0B,GAAG,OAAO,SAAS,KAAK,WAAW,CAAC;AAEpE;;;;;;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,oCAAoC,EAAE,IAAI,CAAC,CAAC;oBAE7D,OAAO;iBACR;aACF;YAED,MAAA,IAAI,CAAC,IAAI,0CAAE,IAAI,CAAC,IAAI,CAAC,CAAC;QACxB,CAAC,CAAA,CAAC;QAEF,IAAI,IAAI,CAAC,WAAW,EAAE,EAAE;YACtB,QAAQ,EAAE,CAAC;SACZ;aAAM;YACL,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;SAChC;IACH,CAAC;IAED;;;OAGG;IACH,IAAI,KAAK;;QACP,OAAO,IAAI,CAAC,GAAG,KAAK,OAAO,IAAI,CAAC,CAAC,CAAA,MAAA,IAAI,CAAC,gBAAgB,CAAC,SAAS,CAAC,OAAO,CAAC,KAAK,0CAAE,GAAG,CAAA,CAAC;IACtF,CAAC;CAQF;AA1MD,gDA0MC;AAmB8B,8CAAgB;AAjB/C,MAAM,gBAAgB;IAWpB,YAAY,OAAY,EAAE,UAAqB,EAAE,OAA4B;QAV7E,eAAU,GAAW,aAAa,CAAC;QAEnC,YAAO,GAAa,GAAG,EAAE,GAAE,CAAC,CAAC;QAC7B,YAAO,GAAa,GAAG,EAAE,GAAE,CAAC,CAAC;QAC7B,cAAS,GAAa,GAAG,EAAE,GAAE,CAAC,CAAC;QAC/B,WAAM,GAAa,GAAG,EAAE,GAAE,CAAC,CAAC;QAC5B,eAAU,GAAW,yBAAa,CAAC,UAAU,CAAC;QAC9C,SAAI,GAAa,GAAG,EAAE,GAAE,CAAC,CAAC;QAC1B,QAAG,GAAwB,IAAI,CAAC;QAG9B,IAAI,CAAC,GAAG,GAAG,OAAO,CAAC,QAAQ,EAAE,CAAC;QAC9B,IAAI,CAAC,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC;IAC7B,CAAC;CACF"}
@@ -0,0 +1,105 @@
1
+ /// <reference types="node" />
2
+ /// <reference types="node" />
3
+ import { Readable } from "stream";
4
+ import type { Fetch, FetchOptions, RequestMethodType } from "../lib/types/Fetch";
5
+ import { AbstractClient } from "./AbstractClient";
6
+ import { DeepgramClientOptions } from "../lib/types";
7
+ /**
8
+ * An abstract class that extends `AbstractClient` and provides a base implementation for a REST-based API client.
9
+ * This class handles authentication, error handling, and other common functionality for REST API clients.
10
+ */
11
+ export declare abstract class AbstractRestClient extends AbstractClient {
12
+ protected fetch: Fetch;
13
+ /**
14
+ * Constructs a new instance of the `AbstractRestClient` class with the provided options.
15
+ *
16
+ * @param options - The client options to use for this instance.
17
+ * @throws {DeepgramError} If the client is being used in a browser and no proxy is provided.
18
+ */
19
+ constructor(options: DeepgramClientOptions);
20
+ /**
21
+ * Constructs an error message from the provided error object.
22
+ *
23
+ * @param err - The error object to extract the error message from.
24
+ * @returns The constructed error message.
25
+ */
26
+ protected _getErrorMessage(err: any): string;
27
+ /**
28
+ * Handles an error that occurred during a request.
29
+ *
30
+ * @param error - The error that occurred during the request.
31
+ * @param reject - The rejection function to call with the error.
32
+ * @returns A Promise that resolves when the error has been handled.
33
+ */
34
+ protected _handleError(error: unknown, reject: (reason?: any) => void): Promise<void>;
35
+ /**
36
+ * Constructs the options object to be used for a fetch request.
37
+ *
38
+ * @param method - The HTTP method to use for the request, such as "GET", "POST", "PUT", "PATCH", or "DELETE".
39
+ * @param bodyOrOptions - For "POST", "PUT", and "PATCH" requests, the request body as a string, Buffer, or Readable stream. For "GET" and "DELETE" requests, the fetch options to use.
40
+ * @param options - Additional fetch options to use for the request.
41
+ * @returns The constructed fetch options object.
42
+ */
43
+ protected _getRequestOptions(method: RequestMethodType, bodyOrOptions?: string | Buffer | Readable | FetchOptions, options?: FetchOptions): FetchOptions;
44
+ /**
45
+ * Handles an HTTP request using the provided method, URL, and optional request body and options.
46
+ *
47
+ * @param method - The HTTP method to use for the request, such as "GET", "POST", "PUT", "PATCH", or "DELETE".
48
+ * @param url - The URL to send the request to.
49
+ * @param bodyOrOptions - For "POST", "PUT", and "PATCH" requests, the request body as a string, Buffer, or Readable stream. For "GET" and "DELETE" requests, the fetch options to use.
50
+ * @param options - Additional fetch options to use for the request.
51
+ * @returns A Promise that resolves to the Response object for the request.
52
+ */
53
+ protected _handleRequest(method: "GET" | "DELETE", url: URL, options?: FetchOptions): Promise<Response>;
54
+ protected _handleRequest(method: "POST" | "PUT" | "PATCH", url: URL, body: string | Buffer | Readable, options?: FetchOptions): Promise<Response>;
55
+ /**
56
+ * Handles an HTTP GET request using the provided URL and optional request options.
57
+ *
58
+ * @param url - The URL to send the GET request to.
59
+ * @param options - Additional fetch options to use for the GET request.
60
+ * @returns A Promise that resolves to the Response object for the GET request.
61
+ */
62
+ protected get(url: URL, options?: FetchOptions): Promise<any>;
63
+ /**
64
+ * Handles an HTTP POST request using the provided URL, request body, and optional request options.
65
+ *
66
+ * @param url - The URL to send the POST request to.
67
+ * @param body - The request body as a string, Buffer, or Readable stream.
68
+ * @param options - Additional fetch options to use for the POST request.
69
+ * @returns A Promise that resolves to the Response object for the POST request.
70
+ */
71
+ protected post(url: URL, body: string | Buffer | Readable, options?: FetchOptions): Promise<any>;
72
+ /**
73
+ * Handles an HTTP PUT request using the provided URL, request body, and optional request options.
74
+ *
75
+ * @param url - The URL to send the PUT request to.
76
+ * @param body - The request body as a string, Buffer, or Readable stream.
77
+ * @param options - Additional fetch options to use for the PUT request.
78
+ * @returns A Promise that resolves to the Response object for the PUT request.
79
+ */
80
+ protected put(url: URL, body: string | Buffer | Readable, options?: FetchOptions): Promise<any>;
81
+ /**
82
+ * Handles an HTTP PATCH request using the provided URL, request body, and optional request options.
83
+ *
84
+ * @param url - The URL to send the PATCH request to.
85
+ * @param body - The request body as a string, Buffer, or Readable stream.
86
+ * @param options - Additional fetch options to use for the PATCH request.
87
+ * @returns A Promise that resolves to the Response object for the PATCH request.
88
+ */
89
+ protected patch(url: URL, body: string | Buffer | Readable, options?: FetchOptions): Promise<any>;
90
+ /**
91
+ * Handles an HTTP DELETE request using the provided URL and optional request options.
92
+ *
93
+ * @param url - The URL to send the DELETE request to.
94
+ * @param options - Additional fetch options to use for the DELETE request.
95
+ * @returns A Promise that resolves to the Response object for the DELETE request.
96
+ */
97
+ protected delete(url: URL, options?: FetchOptions): Promise<any>;
98
+ /**
99
+ * Determines whether the current instance should proxy requests.
100
+ * @returns {boolean} true if the current instance should proxy requests; otherwise, false
101
+ */
102
+ get proxy(): boolean;
103
+ }
104
+ export { AbstractRestClient as AbstractRestfulClient };
105
+ //# sourceMappingURL=AbstractRestClient.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AbstractRestClient.d.ts","sourceRoot":"","sources":["../../../src/packages/AbstractRestClient.ts"],"names":[],"mappings":";;AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,QAAQ,CAAC;AAElC,OAAO,KAAK,EAAE,KAAK,EAAE,YAAY,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AACjF,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,qBAAqB,EAAE,MAAM,cAAc,CAAC;AAIrD;;;GAGG;AACH,8BAAsB,kBAAmB,SAAQ,cAAc;IAC7D,SAAS,CAAC,KAAK,EAAE,KAAK,CAAC;IAEvB;;;;;OAKG;gBACS,OAAO,EAAE,qBAAqB;IAkB1C;;;;;OAKG;IACH,SAAS,CAAC,gBAAgB,CAAC,GAAG,EAAE,GAAG,GAAG,MAAM;IAI5C;;;;;;OAMG;cACa,YAAY,CAAC,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE,CAAC,MAAM,CAAC,EAAE,GAAG,KAAK,IAAI;IAiB3E;;;;;;;OAOG;IACH,SAAS,CAAC,kBAAkB,CAC1B,MAAM,EAAE,iBAAiB,EACzB,aAAa,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,QAAQ,GAAG,YAAY,EACzD,OAAO,CAAC,EAAE,YAAY,GACrB,YAAY;IAiBf;;;;;;;;OAQG;cACa,cAAc,CAC5B,MAAM,EAAE,KAAK,GAAG,QAAQ,EACxB,GAAG,EAAE,GAAG,EACR,OAAO,CAAC,EAAE,YAAY,GACrB,OAAO,CAAC,QAAQ,CAAC;cACJ,cAAc,CAC5B,MAAM,EAAE,MAAM,GAAG,KAAK,GAAG,OAAO,EAChC,GAAG,EAAE,GAAG,EACR,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,QAAQ,EAChC,OAAO,CAAC,EAAE,YAAY,GACrB,OAAO,CAAC,QAAQ,CAAC;IAmBpB;;;;;;OAMG;cACa,GAAG,CAAC,GAAG,EAAE,GAAG,EAAE,OAAO,CAAC,EAAE,YAAY,GAAG,OAAO,CAAC,GAAG,CAAC;IAInE;;;;;;;OAOG;cACa,IAAI,CAClB,GAAG,EAAE,GAAG,EACR,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,QAAQ,EAChC,OAAO,CAAC,EAAE,YAAY,GACrB,OAAO,CAAC,GAAG,CAAC;IAIf;;;;;;;OAOG;cACa,GAAG,CACjB,GAAG,EAAE,GAAG,EACR,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,QAAQ,EAChC,OAAO,CAAC,EAAE,YAAY,GACrB,OAAO,CAAC,GAAG,CAAC;IAIf;;;;;;;OAOG;cACa,KAAK,CACnB,GAAG,EAAE,GAAG,EACR,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,QAAQ,EAChC,OAAO,CAAC,EAAE,YAAY,GACrB,OAAO,CAAC,GAAG,CAAC;IAIf;;;;;;OAMG;cACa,MAAM,CAAC,GAAG,EAAE,GAAG,EAAE,OAAO,CAAC,EAAE,YAAY,GAAG,OAAO,CAAC,GAAG,CAAC;IAItE;;;OAGG;IACH,IAAI,KAAK,IAAI,OAAO,CAEnB;CACF;AAED,OAAO,EAAE,kBAAkB,IAAI,qBAAqB,EAAE,CAAC"}
@@ -0,0 +1,185 @@
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ var __importDefault = (this && this.__importDefault) || function (mod) {
12
+ return (mod && mod.__esModule) ? mod : { "default": mod };
13
+ };
14
+ Object.defineProperty(exports, "__esModule", { value: true });
15
+ exports.AbstractRestfulClient = exports.AbstractRestClient = void 0;
16
+ const errors_1 = require("../lib/errors");
17
+ const fetch_1 = require("../lib/fetch");
18
+ const AbstractClient_1 = require("./AbstractClient");
19
+ const helpers_1 = require("../lib/helpers");
20
+ const deepmerge_1 = __importDefault(require("deepmerge"));
21
+ /**
22
+ * An abstract class that extends `AbstractClient` and provides a base implementation for a REST-based API client.
23
+ * This class handles authentication, error handling, and other common functionality for REST API clients.
24
+ */
25
+ class AbstractRestClient extends AbstractClient_1.AbstractClient {
26
+ /**
27
+ * Constructs a new instance of the `AbstractRestClient` class with the provided options.
28
+ *
29
+ * @param options - The client options to use for this instance.
30
+ * @throws {DeepgramError} If the client is being used in a browser and no proxy is provided.
31
+ */
32
+ constructor(options) {
33
+ super(options);
34
+ if ((0, helpers_1.isBrowser)() && !this.proxy) {
35
+ throw new errors_1.DeepgramError("Due to CORS we are unable to support REST-based API calls to our API from the browser. Please consider using a proxy: https://dpgr.am/js-proxy for more information.");
36
+ }
37
+ this.fetch = (0, fetch_1.fetchWithAuth)(this.key, this.namespaceOptions.fetch.client);
38
+ if (this.proxy) {
39
+ this.baseUrl = this.namespaceOptions.fetch.options.proxy.url;
40
+ }
41
+ else {
42
+ this.baseUrl = this.namespaceOptions.fetch.options.url;
43
+ }
44
+ }
45
+ /**
46
+ * Constructs an error message from the provided error object.
47
+ *
48
+ * @param err - The error object to extract the error message from.
49
+ * @returns The constructed error message.
50
+ */
51
+ _getErrorMessage(err) {
52
+ return err.msg || err.message || err.error_description || err.error || JSON.stringify(err);
53
+ }
54
+ /**
55
+ * Handles an error that occurred during a request.
56
+ *
57
+ * @param error - The error that occurred during the request.
58
+ * @param reject - The rejection function to call with the error.
59
+ * @returns A Promise that resolves when the error has been handled.
60
+ */
61
+ _handleError(error, reject) {
62
+ return __awaiter(this, void 0, void 0, function* () {
63
+ const Res = yield (0, fetch_1.resolveResponse)();
64
+ if (error instanceof Res) {
65
+ error
66
+ .json()
67
+ .then((err) => {
68
+ reject(new errors_1.DeepgramApiError(this._getErrorMessage(err), error.status || 500));
69
+ })
70
+ .catch((err) => {
71
+ reject(new errors_1.DeepgramUnknownError(this._getErrorMessage(err), err));
72
+ });
73
+ }
74
+ else {
75
+ reject(new errors_1.DeepgramUnknownError(this._getErrorMessage(error), error));
76
+ }
77
+ });
78
+ }
79
+ /**
80
+ * Constructs the options object to be used for a fetch request.
81
+ *
82
+ * @param method - The HTTP method to use for the request, such as "GET", "POST", "PUT", "PATCH", or "DELETE".
83
+ * @param bodyOrOptions - For "POST", "PUT", and "PATCH" requests, the request body as a string, Buffer, or Readable stream. For "GET" and "DELETE" requests, the fetch options to use.
84
+ * @param options - Additional fetch options to use for the request.
85
+ * @returns The constructed fetch options object.
86
+ */
87
+ _getRequestOptions(method, bodyOrOptions, options) {
88
+ let reqOptions = { method };
89
+ if (method === "GET" || method === "DELETE") {
90
+ reqOptions = Object.assign(Object.assign({}, reqOptions), bodyOrOptions);
91
+ }
92
+ else {
93
+ reqOptions = Object.assign(Object.assign({ duplex: "half", body: bodyOrOptions }, reqOptions), options);
94
+ }
95
+ return (0, deepmerge_1.default)(this.namespaceOptions.fetch.options, reqOptions, { clone: false });
96
+ }
97
+ _handleRequest(method, url, bodyOrOptions, options) {
98
+ return __awaiter(this, void 0, void 0, function* () {
99
+ return new Promise((resolve, reject) => {
100
+ const fetcher = this.fetch;
101
+ fetcher(url, this._getRequestOptions(method, bodyOrOptions, options))
102
+ .then((result) => {
103
+ if (!result.ok)
104
+ throw result;
105
+ resolve(result);
106
+ })
107
+ .catch((error) => this._handleError(error, reject));
108
+ });
109
+ });
110
+ }
111
+ /**
112
+ * Handles an HTTP GET request using the provided URL and optional request options.
113
+ *
114
+ * @param url - The URL to send the GET request to.
115
+ * @param options - Additional fetch options to use for the GET request.
116
+ * @returns A Promise that resolves to the Response object for the GET request.
117
+ */
118
+ get(url, options) {
119
+ return __awaiter(this, void 0, void 0, function* () {
120
+ return this._handleRequest("GET", url, options);
121
+ });
122
+ }
123
+ /**
124
+ * Handles an HTTP POST request using the provided URL, request body, and optional request options.
125
+ *
126
+ * @param url - The URL to send the POST request to.
127
+ * @param body - The request body as a string, Buffer, or Readable stream.
128
+ * @param options - Additional fetch options to use for the POST request.
129
+ * @returns A Promise that resolves to the Response object for the POST request.
130
+ */
131
+ post(url, body, options) {
132
+ return __awaiter(this, void 0, void 0, function* () {
133
+ return this._handleRequest("POST", url, body, options);
134
+ });
135
+ }
136
+ /**
137
+ * Handles an HTTP PUT request using the provided URL, request body, and optional request options.
138
+ *
139
+ * @param url - The URL to send the PUT request to.
140
+ * @param body - The request body as a string, Buffer, or Readable stream.
141
+ * @param options - Additional fetch options to use for the PUT request.
142
+ * @returns A Promise that resolves to the Response object for the PUT request.
143
+ */
144
+ put(url, body, options) {
145
+ return __awaiter(this, void 0, void 0, function* () {
146
+ return this._handleRequest("PUT", url, body, options);
147
+ });
148
+ }
149
+ /**
150
+ * Handles an HTTP PATCH request using the provided URL, request body, and optional request options.
151
+ *
152
+ * @param url - The URL to send the PATCH request to.
153
+ * @param body - The request body as a string, Buffer, or Readable stream.
154
+ * @param options - Additional fetch options to use for the PATCH request.
155
+ * @returns A Promise that resolves to the Response object for the PATCH request.
156
+ */
157
+ patch(url, body, options) {
158
+ return __awaiter(this, void 0, void 0, function* () {
159
+ return this._handleRequest("PATCH", url, body, options);
160
+ });
161
+ }
162
+ /**
163
+ * Handles an HTTP DELETE request using the provided URL and optional request options.
164
+ *
165
+ * @param url - The URL to send the DELETE request to.
166
+ * @param options - Additional fetch options to use for the DELETE request.
167
+ * @returns A Promise that resolves to the Response object for the DELETE request.
168
+ */
169
+ delete(url, options) {
170
+ return __awaiter(this, void 0, void 0, function* () {
171
+ return this._handleRequest("DELETE", url, options);
172
+ });
173
+ }
174
+ /**
175
+ * Determines whether the current instance should proxy requests.
176
+ * @returns {boolean} true if the current instance should proxy requests; otherwise, false
177
+ */
178
+ get proxy() {
179
+ var _a;
180
+ return this.key === "proxy" && !!((_a = this.namespaceOptions.fetch.options.proxy) === null || _a === void 0 ? void 0 : _a.url);
181
+ }
182
+ }
183
+ exports.AbstractRestClient = AbstractRestClient;
184
+ exports.AbstractRestfulClient = AbstractRestClient;
185
+ //# sourceMappingURL=AbstractRestClient.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AbstractRestClient.js","sourceRoot":"","sources":["../../../src/packages/AbstractRestClient.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,0CAAsF;AAEtF,wCAA8D;AAE9D,qDAAkD;AAElD,4CAA2C;AAC3C,0DAA8B;AAE9B;;;GAGG;AACH,MAAsB,kBAAmB,SAAQ,+BAAc;IAG7D;;;;;OAKG;IACH,YAAY,OAA8B;QACxC,KAAK,CAAC,OAAO,CAAC,CAAC;QAEf,IAAI,IAAA,mBAAS,GAAE,IAAI,CAAC,IAAI,CAAC,KAAK,EAAE;YAC9B,MAAM,IAAI,sBAAa,CACrB,sKAAsK,CACvK,CAAC;SACH;QAED,IAAI,CAAC,KAAK,GAAG,IAAA,qBAAa,EAAC,IAAI,CAAC,GAAG,EAAE,IAAI,CAAC,gBAAgB,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;QAEzE,IAAI,IAAI,CAAC,KAAK,EAAE;YACd,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,gBAAgB,CAAC,KAAK,CAAC,OAAO,CAAC,KAAM,CAAC,GAAG,CAAC;SAC/D;aAAM;YACL,IAAI,CAAC,OAAO,GAA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sB;;YAEtB,OAAO,IAAI,CAAC,cAAc,CAAC,KAAK,EAAE,GAAG,EAAE,IAAI,EAAE,OAAO,CAAC,CAAC;QACxD,CAAC;KAAA;IAED;;;;;;;OAOG;IACa,KAAK,CACnB,GAAQ,EACR,IAAgC,EAChC,OAAsB;;YAEtB,OAAO,IAAI,CAAC,cAAc,CAAC,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,OAAO,CAAC,CAAC;QAC1D,CAAC;KAAA;IAED;;;;;;OAMG;IACa,MAAM,CAAC,GAAQ,EAAE,OAAsB;;YACrD,OAAO,IAAI,CAAC,cAAc,CAAC,QAAQ,EAAE,GAAG,EAAE,OAAO,CAAC,CAAC;QACrD,CAAC;KAAA;IAED;;;OAGG;IACH,IAAI,KAAK;;QACP,OAAO,IAAI,CAAC,GAAG,KAAK,OAAO,IAAI,CAAC,CAAC,CAAA,MAAA,IAAI,CAAC,gBAAgB,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,0CAAE,GAAG,CAAA,CAAC;IAClF,CAAC;CACF;AA7MD,gDA6MC;AAE8B,mDAAqB"}
@@ -1,9 +1,26 @@
1
1
  import { AbstractClient } from "./AbstractClient";
2
- import { LiveClient } from "./LiveClient";
2
+ import { ListenLiveClient } from "./ListenLiveClient";
3
+ import { ListenRestClient } from "./ListenRestClient";
3
4
  import { LiveSchema } from "../lib/types";
4
- import { PrerecordedClient } from "./PrerecordedClient";
5
+ /**
6
+ * The `ListenClient` class extends the `AbstractClient` class and provides access to the "listen" namespace.
7
+ * It exposes two methods:
8
+ *
9
+ * 1. `prerecorded()`: Returns a `ListenRestClient` instance for interacting with the prerecorded listen API.
10
+ * 2. `live(transcriptionOptions: LiveSchema = {}, endpoint = ":version/listen")`: Returns a `ListenLiveClient` instance for interacting with the live listen API, with the provided transcription options and endpoint.
11
+ */
5
12
  export declare class ListenClient extends AbstractClient {
6
- get prerecorded(): PrerecordedClient;
7
- live(transcriptionOptions: LiveSchema, endpoint?: string): LiveClient;
13
+ namespace: string;
14
+ /**
15
+ * Returns a `ListenRestClient` instance for interacting with the prerecorded listen API.
16
+ */
17
+ get prerecorded(): ListenRestClient;
18
+ /**
19
+ * Returns a `ListenLiveClient` instance for interacting with the live listen API, with the provided transcription options and endpoint.
20
+ * @param {LiveSchema} [transcriptionOptions={}] - The transcription options to use for the live listen API.
21
+ * @param {string} [endpoint=":version/listen"] - The endpoint to use for the live listen API.
22
+ * @returns {ListenLiveClient} - A `ListenLiveClient` instance for interacting with the live listen API.
23
+ */
24
+ live(transcriptionOptions?: LiveSchema, endpoint?: string): ListenLiveClient;
8
25
  }
9
26
  //# sourceMappingURL=ListenClient.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ListenClient.d.ts","sourceRoot":"","sources":["../../../src/packages/ListenClient.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAExD,qBAAa,YAAa,SAAQ,cAAc;IAC9C,IAAI,WAAW,sBAEd;IAEM,IAAI,CAAC,oBAAoB,EAAE,UAAU,EAAE,QAAQ,SAAc;CAGrE"}
1
+ {"version":3,"file":"ListenClient.d.ts","sourceRoot":"","sources":["../../../src/packages/ListenClient.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE1C;;;;;;GAMG;AACH,qBAAa,YAAa,SAAQ,cAAc;IACvC,SAAS,EAAE,MAAM,CAAY;IAEpC;;OAEG;IACH,IAAI,WAAW,qBAEd;IAED;;;;;OAKG;IACI,IAAI,CACT,oBAAoB,GAAE,UAAe,EACrC,QAAQ,GAAE,MAA0B,GACnC,gBAAgB;CAGpB"}
@@ -2,14 +2,34 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.ListenClient = void 0;
4
4
  const AbstractClient_1 = require("./AbstractClient");
5
- const LiveClient_1 = require("./LiveClient");
6
- const PrerecordedClient_1 = require("./PrerecordedClient");
5
+ const ListenLiveClient_1 = require("./ListenLiveClient");
6
+ const ListenRestClient_1 = require("./ListenRestClient");
7
+ /**
8
+ * The `ListenClient` class extends the `AbstractClient` class and provides access to the "listen" namespace.
9
+ * It exposes two methods:
10
+ *
11
+ * 1. `prerecorded()`: Returns a `ListenRestClient` instance for interacting with the prerecorded listen API.
12
+ * 2. `live(transcriptionOptions: LiveSchema = {}, endpoint = ":version/listen")`: Returns a `ListenLiveClient` instance for interacting with the live listen API, with the provided transcription options and endpoint.
13
+ */
7
14
  class ListenClient extends AbstractClient_1.AbstractClient {
15
+ constructor() {
16
+ super(...arguments);
17
+ this.namespace = "listen";
18
+ }
19
+ /**
20
+ * Returns a `ListenRestClient` instance for interacting with the prerecorded listen API.
21
+ */
8
22
  get prerecorded() {
9
- return new PrerecordedClient_1.PrerecordedClient(this.key, this.options);
23
+ return new ListenRestClient_1.ListenRestClient(this.options);
10
24
  }
11
- live(transcriptionOptions, endpoint = "v1/listen") {
12
- return new LiveClient_1.LiveClient(this.key, this.options, transcriptionOptions, endpoint);
25
+ /**
26
+ * Returns a `ListenLiveClient` instance for interacting with the live listen API, with the provided transcription options and endpoint.
27
+ * @param {LiveSchema} [transcriptionOptions={}] - The transcription options to use for the live listen API.
28
+ * @param {string} [endpoint=":version/listen"] - The endpoint to use for the live listen API.
29
+ * @returns {ListenLiveClient} - A `ListenLiveClient` instance for interacting with the live listen API.
30
+ */
31
+ live(transcriptionOptions = {}, endpoint = ":version/listen") {
32
+ return new ListenLiveClient_1.ListenLiveClient(this.options, transcriptionOptions, endpoint);
13
33
  }
14
34
  }
15
35
  exports.ListenClient = ListenClient;
@@ -1 +1 @@
1
- {"version":3,"file":"ListenClient.js","sourceRoot":"","sources":["../../../src/packages/ListenClient.ts"],"names":[],"mappings":";;;AAAA,qDAAkD;AAClD,6CAA0C;AAE1C,2DAAwD;AAExD,MAAa,YAAa,SAAQ,+BAAc;IAC9C,IAAI,WAAW;QACb,OAAO,IAAI,qCAAiB,CAAC,IAAI,CAAC,GAAG,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC;IACvD,CAAC;IAEM,IAAI,CAAC,oBAAgC,EAAE,QAAQ,GAAG,WAAW;QAClE,OAAO,IAAI,uBAAU,CAAC,IAAI,CAAC,GAAG,EAAE,IAAI,CAAC,OAAO,EAAE,oBAAoB,EAAE,QAAQ,CAAC,CAAC;IAChF,CAAC;CACF;AARD,oCAQC"}
1
+ {"version":3,"file":"ListenClient.js","sourceRoot":"","sources":["../../../src/packages/ListenClient.ts"],"names":[],"mappings":";;;AAAA,qDAAkD;AAClD,yDAAsD;AACtD,yDAAsD;AAGtD;;;;;;GAMG;AACH,MAAa,YAAa,SAAQ,+BAAc;IAAhD;;QACS,cAAS,GAAW,QAAQ,CAAC;IAqBtC,CAAC;IAnBC;;OAEG;IACH,IAAI,WAAW;QACb,OAAO,IAAI,mCAAgB,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IAC5C,CAAC;IAED;;;;;OAKG;IACI,IAAI,CACT,uBAAmC,EAAE,EACrC,WAAmB,iBAAiB;QAEpC,OAAO,IAAI,mCAAgB,CAAC,IAAI,CAAC,OAAO,EAAE,oBAAoB,EAAE,QAAQ,CAAC,CAAC;IAC5E,CAAC;CACF;AAtBD,oCAsBC"}