@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.
- package/README.md +129 -9
- package/dist/main/DeepgramClient.d.ts +65 -12
- package/dist/main/DeepgramClient.d.ts.map +1 -1
- package/dist/main/DeepgramClient.js +73 -18
- package/dist/main/DeepgramClient.js.map +1 -1
- package/dist/main/index.d.ts +13 -4
- package/dist/main/index.d.ts.map +1 -1
- package/dist/main/index.js +18 -8
- package/dist/main/index.js.map +1 -1
- package/dist/main/lib/constants.d.ts +16 -7
- package/dist/main/lib/constants.d.ts.map +1 -1
- package/dist/main/lib/constants.js +26 -9
- package/dist/main/lib/constants.js.map +1 -1
- package/dist/main/lib/enums/LiveConnectionState.d.ts +5 -0
- package/dist/main/lib/enums/LiveConnectionState.d.ts.map +1 -1
- package/dist/main/lib/enums/LiveConnectionState.js +5 -0
- package/dist/main/lib/enums/LiveConnectionState.js.map +1 -1
- package/dist/main/lib/enums/LiveTranscriptionEvents.d.ts +24 -3
- package/dist/main/lib/enums/LiveTranscriptionEvents.d.ts.map +1 -1
- package/dist/main/lib/enums/LiveTranscriptionEvents.js +23 -2
- package/dist/main/lib/enums/LiveTranscriptionEvents.js.map +1 -1
- package/dist/main/lib/enums/index.d.ts +2 -2
- package/dist/main/lib/enums/index.d.ts.map +1 -1
- package/dist/main/lib/enums/index.js +16 -5
- package/dist/main/lib/enums/index.js.map +1 -1
- package/dist/main/lib/fetch.d.ts +19 -1
- package/dist/main/lib/fetch.d.ts.map +1 -1
- package/dist/main/lib/fetch.js +19 -1
- package/dist/main/lib/fetch.js.map +1 -1
- package/dist/main/lib/helpers.d.ts +9 -5
- package/dist/main/lib/helpers.d.ts.map +1 -1
- package/dist/main/lib/helpers.js +82 -7
- package/dist/main/lib/helpers.js.map +1 -1
- package/dist/main/lib/types/CreateProjectKeySchema.d.ts +0 -1
- package/dist/main/lib/types/CreateProjectKeySchema.d.ts.map +1 -1
- package/dist/main/lib/types/DeepgramClientOptions.d.ts +75 -8
- package/dist/main/lib/types/DeepgramClientOptions.d.ts.map +1 -1
- package/dist/main/lib/types/Fetch.d.ts +3 -13
- package/dist/main/lib/types/Fetch.d.ts.map +1 -1
- package/dist/main/lib/types/LiveConfigOptions.d.ts +6 -3
- package/dist/main/lib/types/LiveConfigOptions.d.ts.map +1 -1
- package/dist/main/lib/types/SyncPrerecordedResponse.d.ts +1 -0
- package/dist/main/lib/types/SyncPrerecordedResponse.d.ts.map +1 -1
- package/dist/main/lib/types/TranscriptionSchema.d.ts +0 -1
- package/dist/main/lib/types/TranscriptionSchema.d.ts.map +1 -1
- package/dist/main/lib/types/UpdateProjectMemberScopeSchema.d.ts +1 -1
- package/dist/main/lib/types/UpdateProjectMemberScopeSchema.d.ts.map +1 -1
- package/dist/main/lib/types/UpdateProjectSchema.d.ts +0 -1
- package/dist/main/lib/types/UpdateProjectSchema.d.ts.map +1 -1
- package/dist/main/lib/types/index.d.ts +39 -39
- package/dist/main/lib/types/index.d.ts.map +1 -1
- package/dist/main/lib/types/index.js +53 -0
- package/dist/main/lib/types/index.js.map +1 -1
- package/dist/main/lib/version.d.ts +1 -1
- package/dist/main/lib/version.js +1 -1
- package/dist/main/packages/AbstractClient.d.ts +63 -10
- package/dist/main/packages/AbstractClient.d.ts.map +1 -1
- package/dist/main/packages/AbstractClient.js +103 -50
- package/dist/main/packages/AbstractClient.js.map +1 -1
- package/dist/main/packages/AbstractLiveClient.d.ts +114 -0
- package/dist/main/packages/AbstractLiveClient.d.ts.map +1 -0
- package/dist/main/packages/AbstractLiveClient.js +238 -0
- package/dist/main/packages/AbstractLiveClient.js.map +1 -0
- package/dist/main/packages/AbstractRestClient.d.ts +105 -0
- package/dist/main/packages/AbstractRestClient.d.ts.map +1 -0
- package/dist/main/packages/AbstractRestClient.js +185 -0
- package/dist/main/packages/AbstractRestClient.js.map +1 -0
- package/dist/main/packages/ListenClient.d.ts +21 -4
- package/dist/main/packages/ListenClient.d.ts.map +1 -1
- package/dist/main/packages/ListenClient.js +25 -5
- package/dist/main/packages/ListenClient.js.map +1 -1
- package/dist/main/packages/ListenLiveClient.d.ts +58 -0
- package/dist/main/packages/ListenLiveClient.d.ts.map +1 -0
- package/dist/main/packages/ListenLiveClient.js +119 -0
- package/dist/main/packages/ListenLiveClient.js.map +1 -0
- package/dist/main/packages/ListenRestClient.d.ts +57 -0
- package/dist/main/packages/ListenRestClient.d.ts.map +1 -0
- package/dist/main/packages/ListenRestClient.js +167 -0
- package/dist/main/packages/ListenRestClient.js.map +1 -0
- package/dist/main/packages/ManageRestClient.d.ts +286 -0
- package/dist/main/packages/ManageRestClient.d.ts.map +1 -0
- package/dist/main/packages/ManageRestClient.js +628 -0
- package/dist/main/packages/ManageRestClient.js.map +1 -0
- package/dist/main/packages/ReadRestClient.d.ts +57 -0
- package/dist/main/packages/ReadRestClient.d.ts.map +1 -0
- package/dist/main/packages/ReadRestClient.js +165 -0
- package/dist/main/packages/ReadRestClient.js.map +1 -0
- package/dist/main/packages/SelfHostedRestClient.d.ts +47 -0
- package/dist/main/packages/SelfHostedRestClient.d.ts.map +1 -0
- package/dist/main/packages/SelfHostedRestClient.js +120 -0
- package/dist/main/packages/SelfHostedRestClient.js.map +1 -0
- package/dist/main/packages/SpeakRestClient.d.ts +36 -0
- package/dist/main/packages/SpeakRestClient.d.ts.map +1 -0
- package/dist/main/packages/SpeakRestClient.js +84 -0
- package/dist/main/packages/SpeakRestClient.js.map +1 -0
- package/dist/main/packages/index.d.ts +10 -8
- package/dist/main/packages/index.d.ts.map +1 -1
- package/dist/main/packages/index.js +24 -17
- package/dist/main/packages/index.js.map +1 -1
- package/dist/module/DeepgramClient.d.ts +65 -12
- package/dist/module/DeepgramClient.d.ts.map +1 -1
- package/dist/module/DeepgramClient.js +72 -17
- package/dist/module/DeepgramClient.js.map +1 -1
- package/dist/module/index.d.ts +13 -4
- package/dist/module/index.d.ts.map +1 -1
- package/dist/module/index.js +18 -8
- package/dist/module/index.js.map +1 -1
- package/dist/module/lib/constants.d.ts +16 -7
- package/dist/module/lib/constants.d.ts.map +1 -1
- package/dist/module/lib/constants.js +26 -9
- package/dist/module/lib/constants.js.map +1 -1
- package/dist/module/lib/enums/LiveConnectionState.d.ts +5 -0
- package/dist/module/lib/enums/LiveConnectionState.d.ts.map +1 -1
- package/dist/module/lib/enums/LiveConnectionState.js +5 -0
- package/dist/module/lib/enums/LiveConnectionState.js.map +1 -1
- package/dist/module/lib/enums/LiveTranscriptionEvents.d.ts +24 -3
- package/dist/module/lib/enums/LiveTranscriptionEvents.d.ts.map +1 -1
- package/dist/module/lib/enums/LiveTranscriptionEvents.js +23 -2
- package/dist/module/lib/enums/LiveTranscriptionEvents.js.map +1 -1
- package/dist/module/lib/enums/index.d.ts +2 -2
- package/dist/module/lib/enums/index.d.ts.map +1 -1
- package/dist/module/lib/enums/index.js +2 -2
- package/dist/module/lib/enums/index.js.map +1 -1
- package/dist/module/lib/fetch.d.ts +19 -1
- package/dist/module/lib/fetch.d.ts.map +1 -1
- package/dist/module/lib/fetch.js +19 -1
- package/dist/module/lib/fetch.js.map +1 -1
- package/dist/module/lib/helpers.d.ts +9 -5
- package/dist/module/lib/helpers.d.ts.map +1 -1
- package/dist/module/lib/helpers.js +75 -4
- package/dist/module/lib/helpers.js.map +1 -1
- package/dist/module/lib/types/CreateProjectKeySchema.d.ts +0 -1
- package/dist/module/lib/types/CreateProjectKeySchema.d.ts.map +1 -1
- package/dist/module/lib/types/DeepgramClientOptions.d.ts +75 -8
- package/dist/module/lib/types/DeepgramClientOptions.d.ts.map +1 -1
- package/dist/module/lib/types/Fetch.d.ts +3 -13
- package/dist/module/lib/types/Fetch.d.ts.map +1 -1
- package/dist/module/lib/types/LiveConfigOptions.d.ts +6 -3
- package/dist/module/lib/types/LiveConfigOptions.d.ts.map +1 -1
- package/dist/module/lib/types/SyncPrerecordedResponse.d.ts +1 -0
- package/dist/module/lib/types/SyncPrerecordedResponse.d.ts.map +1 -1
- package/dist/module/lib/types/TranscriptionSchema.d.ts +0 -1
- package/dist/module/lib/types/TranscriptionSchema.d.ts.map +1 -1
- package/dist/module/lib/types/UpdateProjectMemberScopeSchema.d.ts +1 -1
- package/dist/module/lib/types/UpdateProjectMemberScopeSchema.d.ts.map +1 -1
- package/dist/module/lib/types/UpdateProjectSchema.d.ts +0 -1
- package/dist/module/lib/types/UpdateProjectSchema.d.ts.map +1 -1
- package/dist/module/lib/types/index.d.ts +39 -39
- package/dist/module/lib/types/index.d.ts.map +1 -1
- package/dist/module/lib/types/index.js +39 -1
- package/dist/module/lib/types/index.js.map +1 -1
- package/dist/module/lib/version.d.ts +1 -1
- package/dist/module/lib/version.js +1 -1
- package/dist/module/packages/AbstractClient.d.ts +63 -10
- package/dist/module/packages/AbstractClient.d.ts.map +1 -1
- package/dist/module/packages/AbstractClient.js +99 -50
- package/dist/module/packages/AbstractClient.js.map +1 -1
- package/dist/module/packages/AbstractLiveClient.d.ts +114 -0
- package/dist/module/packages/AbstractLiveClient.d.ts.map +1 -0
- package/dist/module/packages/AbstractLiveClient.js +211 -0
- package/dist/module/packages/AbstractLiveClient.js.map +1 -0
- package/dist/module/packages/AbstractRestClient.d.ts +105 -0
- package/dist/module/packages/AbstractRestClient.d.ts.map +1 -0
- package/dist/module/packages/AbstractRestClient.js +178 -0
- package/dist/module/packages/AbstractRestClient.js.map +1 -0
- package/dist/module/packages/ListenClient.d.ts +21 -4
- package/dist/module/packages/ListenClient.d.ts.map +1 -1
- package/dist/module/packages/ListenClient.js +25 -5
- package/dist/module/packages/ListenClient.js.map +1 -1
- package/dist/module/packages/ListenLiveClient.d.ts +58 -0
- package/dist/module/packages/ListenLiveClient.d.ts.map +1 -0
- package/dist/module/packages/ListenLiveClient.js +115 -0
- package/dist/module/packages/ListenLiveClient.js.map +1 -0
- package/dist/module/packages/ListenRestClient.d.ts +57 -0
- package/dist/module/packages/ListenRestClient.d.ts.map +1 -0
- package/dist/module/packages/ListenRestClient.js +163 -0
- package/dist/module/packages/ListenRestClient.js.map +1 -0
- package/dist/module/packages/ManageRestClient.d.ts +286 -0
- package/dist/module/packages/ManageRestClient.d.ts.map +1 -0
- package/dist/module/packages/ManageRestClient.js +624 -0
- package/dist/module/packages/ManageRestClient.js.map +1 -0
- package/dist/module/packages/ReadRestClient.d.ts +57 -0
- package/dist/module/packages/ReadRestClient.d.ts.map +1 -0
- package/dist/module/packages/ReadRestClient.js +161 -0
- package/dist/module/packages/ReadRestClient.js.map +1 -0
- package/dist/module/packages/SelfHostedRestClient.d.ts +47 -0
- package/dist/module/packages/SelfHostedRestClient.d.ts.map +1 -0
- package/dist/module/packages/SelfHostedRestClient.js +116 -0
- package/dist/module/packages/SelfHostedRestClient.js.map +1 -0
- package/dist/module/packages/SpeakRestClient.d.ts +36 -0
- package/dist/module/packages/SpeakRestClient.d.ts.map +1 -0
- package/dist/module/packages/SpeakRestClient.js +80 -0
- package/dist/module/packages/SpeakRestClient.js.map +1 -0
- package/dist/module/packages/index.d.ts +10 -8
- package/dist/module/packages/index.d.ts.map +1 -1
- package/dist/module/packages/index.js +10 -8
- package/dist/module/packages/index.js.map +1 -1
- package/dist/umd/deepgram.js +1 -1
- package/package.json +8 -6
- package/src/DeepgramClient.ts +81 -17
- package/src/index.ts +32 -7
- package/src/lib/constants.ts +33 -13
- package/src/lib/enums/LiveConnectionState.ts +11 -4
- package/src/lib/enums/LiveTranscriptionEvents.ts +27 -4
- package/src/lib/enums/index.ts +2 -2
- package/src/lib/fetch.ts +22 -2
- package/src/lib/helpers.ts +98 -9
- package/src/lib/types/CreateProjectKeySchema.ts +0 -1
- package/src/lib/types/DeepgramClientOptions.ts +75 -11
- package/src/lib/types/Fetch.ts +2 -24
- package/src/lib/types/LiveConfigOptions.ts +7 -3
- package/src/lib/types/SyncPrerecordedResponse.ts +1 -0
- package/src/lib/types/TranscriptionSchema.ts +0 -2
- package/src/lib/types/UpdateProjectMemberScopeSchema.ts +1 -1
- package/src/lib/types/UpdateProjectSchema.ts +0 -1
- package/src/lib/types/index.ts +39 -54
- package/src/lib/version.ts +1 -1
- package/src/packages/AbstractClient.ts +129 -61
- package/src/packages/AbstractLiveClient.ts +280 -0
- package/src/packages/AbstractRestClient.ts +221 -0
- package/src/packages/ListenClient.ts +26 -5
- package/src/packages/ListenLiveClient.ts +133 -0
- package/src/packages/ListenRestClient.ts +201 -0
- package/src/packages/ManageRestClient.ts +760 -0
- package/src/packages/ReadRestClient.ts +200 -0
- package/src/packages/SelfHostedRestClient.ts +134 -0
- package/src/packages/SpeakRestClient.ts +79 -0
- package/src/packages/index.ts +10 -8
- package/dist/main/packages/AbstractRestfulClient.d.ts +0 -26
- package/dist/main/packages/AbstractRestfulClient.d.ts.map +0 -1
- package/dist/main/packages/AbstractRestfulClient.js +0 -118
- package/dist/main/packages/AbstractRestfulClient.js.map +0 -1
- package/dist/main/packages/AbstractWsClient.d.ts +0 -10
- package/dist/main/packages/AbstractWsClient.d.ts.map +0 -1
- package/dist/main/packages/AbstractWsClient.js +0 -33
- package/dist/main/packages/AbstractWsClient.js.map +0 -1
- package/dist/main/packages/LiveClient.d.ts +0 -28
- package/dist/main/packages/LiveClient.d.ts.map +0 -1
- package/dist/main/packages/LiveClient.js +0 -110
- package/dist/main/packages/LiveClient.js.map +0 -1
- package/dist/main/packages/ManageClient.d.ts +0 -97
- package/dist/main/packages/ManageClient.d.ts.map +0 -1
- package/dist/main/packages/ManageClient.js +0 -463
- package/dist/main/packages/ManageClient.js.map +0 -1
- package/dist/main/packages/OnPremClient.d.ts +0 -21
- package/dist/main/packages/OnPremClient.d.ts.map +0 -1
- package/dist/main/packages/OnPremClient.js +0 -99
- package/dist/main/packages/OnPremClient.js.map +0 -1
- package/dist/main/packages/PrerecordedClient.d.ts +0 -10
- package/dist/main/packages/PrerecordedClient.d.ts.map +0 -1
- package/dist/main/packages/PrerecordedClient.js +0 -125
- package/dist/main/packages/PrerecordedClient.js.map +0 -1
- package/dist/main/packages/ReadClient.d.ts +0 -10
- package/dist/main/packages/ReadClient.d.ts.map +0 -1
- package/dist/main/packages/ReadClient.js +0 -123
- package/dist/main/packages/ReadClient.js.map +0 -1
- package/dist/main/packages/SpeakClient.d.ts +0 -12
- package/dist/main/packages/SpeakClient.d.ts.map +0 -1
- package/dist/main/packages/SpeakClient.js +0 -57
- package/dist/main/packages/SpeakClient.js.map +0 -1
- package/dist/module/packages/AbstractRestfulClient.d.ts +0 -26
- package/dist/module/packages/AbstractRestfulClient.d.ts.map +0 -1
- package/dist/module/packages/AbstractRestfulClient.js +0 -114
- package/dist/module/packages/AbstractRestfulClient.js.map +0 -1
- package/dist/module/packages/AbstractWsClient.d.ts +0 -10
- package/dist/module/packages/AbstractWsClient.d.ts.map +0 -1
- package/dist/module/packages/AbstractWsClient.js +0 -29
- package/dist/module/packages/AbstractWsClient.js.map +0 -1
- package/dist/module/packages/LiveClient.d.ts +0 -28
- package/dist/module/packages/LiveClient.d.ts.map +0 -1
- package/dist/module/packages/LiveClient.js +0 -106
- package/dist/module/packages/LiveClient.js.map +0 -1
- package/dist/module/packages/ManageClient.d.ts +0 -97
- package/dist/module/packages/ManageClient.d.ts.map +0 -1
- package/dist/module/packages/ManageClient.js +0 -459
- package/dist/module/packages/ManageClient.js.map +0 -1
- package/dist/module/packages/OnPremClient.d.ts +0 -21
- package/dist/module/packages/OnPremClient.d.ts.map +0 -1
- package/dist/module/packages/OnPremClient.js +0 -95
- package/dist/module/packages/OnPremClient.js.map +0 -1
- package/dist/module/packages/PrerecordedClient.d.ts +0 -10
- package/dist/module/packages/PrerecordedClient.d.ts.map +0 -1
- package/dist/module/packages/PrerecordedClient.js +0 -121
- package/dist/module/packages/PrerecordedClient.js.map +0 -1
- package/dist/module/packages/ReadClient.d.ts +0 -10
- package/dist/module/packages/ReadClient.d.ts.map +0 -1
- package/dist/module/packages/ReadClient.js +0 -119
- package/dist/module/packages/ReadClient.js.map +0 -1
- package/dist/module/packages/SpeakClient.d.ts +0 -12
- package/dist/module/packages/SpeakClient.d.ts.map +0 -1
- package/dist/module/packages/SpeakClient.js +0 -53
- package/dist/module/packages/SpeakClient.js.map +0 -1
- package/src/packages/AbstractRestfulClient.ts +0 -160
- package/src/packages/AbstractWsClient.ts +0 -42
- package/src/packages/LiveClient.ts +0 -140
- package/src/packages/ManageClient.ts +0 -584
- package/src/packages/OnPremClient.ts +0 -113
- package/src/packages/PrerecordedClient.ts +0 -162
- package/src/packages/ReadClient.ts +0 -161
- package/src/packages/SpeakClient.ts +0 -50
|
@@ -1,33 +1,86 @@
|
|
|
1
|
-
import { AbstractClient } from "./packages
|
|
2
|
-
import { ListenClient } from "./packages/ListenClient";
|
|
3
|
-
import { ManageClient } from "./packages/ManageClient";
|
|
4
|
-
import { OnPremClient } from "./packages/OnPremClient";
|
|
5
|
-
import { ReadClient } from "./packages/ReadClient";
|
|
6
|
-
import { SpeakClient } from "./packages/SpeakClient";
|
|
1
|
+
import { AbstractClient, ListenClient, ManageClient, ReadClient, OnPremClient, SelfHostedRestClient, SpeakClient } from "./packages";
|
|
7
2
|
/**
|
|
8
|
-
* Deepgram
|
|
3
|
+
* The DeepgramClient class provides access to various Deepgram API clients, including ListenClient, ManageClient, SelfHostedRestClient, ReadClient, and SpeakClient.
|
|
9
4
|
*
|
|
10
|
-
*
|
|
11
|
-
* @see https://developers.deepgram.com/docs/js-sdk
|
|
5
|
+
* @see https://github.com/deepgram/deepgram-js-sdk
|
|
12
6
|
*/
|
|
13
7
|
export default class DeepgramClient extends AbstractClient {
|
|
8
|
+
/**
|
|
9
|
+
* Returns a new instance of the ListenClient, which provides access to the Deepgram API's listening functionality.
|
|
10
|
+
*
|
|
11
|
+
* @returns {ListenClient} A new instance of the ListenClient.
|
|
12
|
+
*/
|
|
14
13
|
get listen(): ListenClient;
|
|
14
|
+
/**
|
|
15
|
+
* Returns a new instance of the ManageClient, which provides access to the Deepgram API's management functionality.
|
|
16
|
+
*
|
|
17
|
+
* @returns {ManageClient} A new instance of the ManageClient.
|
|
18
|
+
*/
|
|
15
19
|
get manage(): ManageClient;
|
|
20
|
+
/**
|
|
21
|
+
* Returns a new instance of the SelfHostedRestClient, which provides access to the Deepgram API's self-hosted functionality.
|
|
22
|
+
*
|
|
23
|
+
* @returns {OnPremClient} A new instance of the SelfHostedRestClient named as OnPremClient.
|
|
24
|
+
* @deprecated use selfhosted() instead
|
|
25
|
+
*/
|
|
16
26
|
get onprem(): OnPremClient;
|
|
27
|
+
/**
|
|
28
|
+
* Returns a new instance of the SelfHostedRestClient, which provides access to the Deepgram API's self-hosted functionality.
|
|
29
|
+
*
|
|
30
|
+
* @returns {SelfHostedRestClient} A new instance of the SelfHostedRestClient.
|
|
31
|
+
*/
|
|
32
|
+
get selfhosted(): SelfHostedRestClient;
|
|
33
|
+
/**
|
|
34
|
+
* Returns a new instance of the ReadClient, which provides access to the Deepgram API's reading functionality.
|
|
35
|
+
*
|
|
36
|
+
* @returns {ReadClient} A new instance of the ReadClient.
|
|
37
|
+
*/
|
|
17
38
|
get read(): ReadClient;
|
|
18
|
-
get speak(): SpeakClient;
|
|
19
39
|
/**
|
|
20
|
-
*
|
|
40
|
+
* Returns a new instance of the SpeakClient, which provides access to the Deepgram API's speaking functionality.
|
|
21
41
|
*
|
|
22
|
-
* @
|
|
42
|
+
* @returns {SpeakClient} A new instance of the SpeakClient.
|
|
43
|
+
*/
|
|
44
|
+
get speak(): SpeakClient;
|
|
45
|
+
/**
|
|
46
|
+
* @deprecated
|
|
47
|
+
* @see https://dpgr.am/js-v3
|
|
23
48
|
*/
|
|
24
49
|
get transcription(): any;
|
|
50
|
+
/**
|
|
51
|
+
* @deprecated
|
|
52
|
+
* @see https://dpgr.am/js-v3
|
|
53
|
+
*/
|
|
25
54
|
get projects(): any;
|
|
55
|
+
/**
|
|
56
|
+
* @deprecated
|
|
57
|
+
* @see https://dpgr.am/js-v3
|
|
58
|
+
*/
|
|
26
59
|
get keys(): any;
|
|
60
|
+
/**
|
|
61
|
+
* @deprecated
|
|
62
|
+
* @see https://dpgr.am/js-v3
|
|
63
|
+
*/
|
|
27
64
|
get members(): any;
|
|
65
|
+
/**
|
|
66
|
+
* @deprecated
|
|
67
|
+
* @see https://dpgr.am/js-v3
|
|
68
|
+
*/
|
|
28
69
|
get scopes(): any;
|
|
70
|
+
/**
|
|
71
|
+
* @deprecated
|
|
72
|
+
* @see https://dpgr.am/js-v3
|
|
73
|
+
*/
|
|
29
74
|
get invitation(): any;
|
|
75
|
+
/**
|
|
76
|
+
* @deprecated
|
|
77
|
+
* @see https://dpgr.am/js-v3
|
|
78
|
+
*/
|
|
30
79
|
get usage(): any;
|
|
80
|
+
/**
|
|
81
|
+
* @deprecated
|
|
82
|
+
* @see https://dpgr.am/js-v3
|
|
83
|
+
*/
|
|
31
84
|
get billing(): any;
|
|
32
85
|
}
|
|
33
86
|
//# sourceMappingURL=DeepgramClient.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DeepgramClient.d.ts","sourceRoot":"","sources":["../../src/DeepgramClient.ts"],"names":[],"mappings":"AACA,OAAO,
|
|
1
|
+
{"version":3,"file":"DeepgramClient.d.ts","sourceRoot":"","sources":["../../src/DeepgramClient.ts"],"names":[],"mappings":"AACA,OAAO,EACL,cAAc,EACd,YAAY,EACZ,YAAY,EACZ,UAAU,EACV,YAAY,EACZ,oBAAoB,EACpB,WAAW,EACZ,MAAM,YAAY,CAAC;AAEpB;;;;GAIG;AACH,MAAM,CAAC,OAAO,OAAO,cAAe,SAAQ,cAAc;IACxD;;;;OAIG;IACH,IAAI,MAAM,IAAI,YAAY,CAEzB;IAED;;;;OAIG;IACH,IAAI,MAAM,IAAI,YAAY,CAEzB;IAED;;;;;OAKG;IACH,IAAI,MAAM,IAAI,YAAY,CAEzB;IAED;;;;OAIG;IACH,IAAI,UAAU,IAAI,oBAAoB,CAErC;IAED;;;;OAIG;IACH,IAAI,IAAI,IAAI,UAAU,CAErB;IAED;;;;OAIG;IACH,IAAI,KAAK,IAAI,WAAW,CAEvB;IAED;;;OAGG;IACH,IAAI,aAAa,IAAI,GAAG,CAEvB;IAED;;;OAGG;IACH,IAAI,QAAQ,IAAI,GAAG,CAElB;IAED;;;OAGG;IACH,IAAI,IAAI,IAAI,GAAG,CAEd;IAED;;;OAGG;IACH,IAAI,OAAO,IAAI,GAAG,CAEjB;IAED;;;OAGG;IACH,IAAI,MAAM,IAAI,GAAG,CAEhB;IAED;;;OAGG;IACH,IAAI,UAAU,IAAI,GAAG,CAEpB;IAED;;;OAGG;IACH,IAAI,KAAK,IAAI,GAAG,CAEf;IAED;;;OAGG;IACH,IAAI,OAAO,IAAI,GAAG,CAEjB;CACF"}
|
|
@@ -1,58 +1,113 @@
|
|
|
1
1
|
import { DeepgramVersionError } from "./lib/errors";
|
|
2
|
-
import { AbstractClient } from "./packages
|
|
3
|
-
import { ListenClient } from "./packages/ListenClient";
|
|
4
|
-
import { ManageClient } from "./packages/ManageClient";
|
|
5
|
-
import { OnPremClient } from "./packages/OnPremClient";
|
|
6
|
-
import { ReadClient } from "./packages/ReadClient";
|
|
7
|
-
import { SpeakClient } from "./packages/SpeakClient";
|
|
2
|
+
import { AbstractClient, ListenClient, ManageClient, ReadClient, SelfHostedRestClient, SpeakClient, } from "./packages";
|
|
8
3
|
/**
|
|
9
|
-
* Deepgram
|
|
4
|
+
* The DeepgramClient class provides access to various Deepgram API clients, including ListenClient, ManageClient, SelfHostedRestClient, ReadClient, and SpeakClient.
|
|
10
5
|
*
|
|
11
|
-
*
|
|
12
|
-
* @see https://developers.deepgram.com/docs/js-sdk
|
|
6
|
+
* @see https://github.com/deepgram/deepgram-js-sdk
|
|
13
7
|
*/
|
|
14
8
|
export default class DeepgramClient extends AbstractClient {
|
|
9
|
+
/**
|
|
10
|
+
* Returns a new instance of the ListenClient, which provides access to the Deepgram API's listening functionality.
|
|
11
|
+
*
|
|
12
|
+
* @returns {ListenClient} A new instance of the ListenClient.
|
|
13
|
+
*/
|
|
15
14
|
get listen() {
|
|
16
|
-
return new ListenClient(this.
|
|
15
|
+
return new ListenClient(this.options);
|
|
17
16
|
}
|
|
17
|
+
/**
|
|
18
|
+
* Returns a new instance of the ManageClient, which provides access to the Deepgram API's management functionality.
|
|
19
|
+
*
|
|
20
|
+
* @returns {ManageClient} A new instance of the ManageClient.
|
|
21
|
+
*/
|
|
18
22
|
get manage() {
|
|
19
|
-
return new ManageClient(this.
|
|
23
|
+
return new ManageClient(this.options);
|
|
20
24
|
}
|
|
25
|
+
/**
|
|
26
|
+
* Returns a new instance of the SelfHostedRestClient, which provides access to the Deepgram API's self-hosted functionality.
|
|
27
|
+
*
|
|
28
|
+
* @returns {OnPremClient} A new instance of the SelfHostedRestClient named as OnPremClient.
|
|
29
|
+
* @deprecated use selfhosted() instead
|
|
30
|
+
*/
|
|
21
31
|
get onprem() {
|
|
22
|
-
return
|
|
32
|
+
return this.selfhosted;
|
|
23
33
|
}
|
|
34
|
+
/**
|
|
35
|
+
* Returns a new instance of the SelfHostedRestClient, which provides access to the Deepgram API's self-hosted functionality.
|
|
36
|
+
*
|
|
37
|
+
* @returns {SelfHostedRestClient} A new instance of the SelfHostedRestClient.
|
|
38
|
+
*/
|
|
39
|
+
get selfhosted() {
|
|
40
|
+
return new SelfHostedRestClient(this.options);
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Returns a new instance of the ReadClient, which provides access to the Deepgram API's reading functionality.
|
|
44
|
+
*
|
|
45
|
+
* @returns {ReadClient} A new instance of the ReadClient.
|
|
46
|
+
*/
|
|
24
47
|
get read() {
|
|
25
|
-
return new ReadClient(this.
|
|
48
|
+
return new ReadClient(this.options);
|
|
26
49
|
}
|
|
50
|
+
/**
|
|
51
|
+
* Returns a new instance of the SpeakClient, which provides access to the Deepgram API's speaking functionality.
|
|
52
|
+
*
|
|
53
|
+
* @returns {SpeakClient} A new instance of the SpeakClient.
|
|
54
|
+
*/
|
|
27
55
|
get speak() {
|
|
28
|
-
return new SpeakClient(this.
|
|
56
|
+
return new SpeakClient(this.options);
|
|
29
57
|
}
|
|
30
58
|
/**
|
|
31
|
-
*
|
|
32
|
-
*
|
|
33
|
-
* @see https://developers.deepgram.com/docs/js-sdk-v2-to-v3-migration-guide
|
|
59
|
+
* @deprecated
|
|
60
|
+
* @see https://dpgr.am/js-v3
|
|
34
61
|
*/
|
|
35
62
|
get transcription() {
|
|
36
63
|
throw new DeepgramVersionError();
|
|
37
64
|
}
|
|
65
|
+
/**
|
|
66
|
+
* @deprecated
|
|
67
|
+
* @see https://dpgr.am/js-v3
|
|
68
|
+
*/
|
|
38
69
|
get projects() {
|
|
39
70
|
throw new DeepgramVersionError();
|
|
40
71
|
}
|
|
72
|
+
/**
|
|
73
|
+
* @deprecated
|
|
74
|
+
* @see https://dpgr.am/js-v3
|
|
75
|
+
*/
|
|
41
76
|
get keys() {
|
|
42
77
|
throw new DeepgramVersionError();
|
|
43
78
|
}
|
|
79
|
+
/**
|
|
80
|
+
* @deprecated
|
|
81
|
+
* @see https://dpgr.am/js-v3
|
|
82
|
+
*/
|
|
44
83
|
get members() {
|
|
45
84
|
throw new DeepgramVersionError();
|
|
46
85
|
}
|
|
86
|
+
/**
|
|
87
|
+
* @deprecated
|
|
88
|
+
* @see https://dpgr.am/js-v3
|
|
89
|
+
*/
|
|
47
90
|
get scopes() {
|
|
48
91
|
throw new DeepgramVersionError();
|
|
49
92
|
}
|
|
93
|
+
/**
|
|
94
|
+
* @deprecated
|
|
95
|
+
* @see https://dpgr.am/js-v3
|
|
96
|
+
*/
|
|
50
97
|
get invitation() {
|
|
51
98
|
throw new DeepgramVersionError();
|
|
52
99
|
}
|
|
100
|
+
/**
|
|
101
|
+
* @deprecated
|
|
102
|
+
* @see https://dpgr.am/js-v3
|
|
103
|
+
*/
|
|
53
104
|
get usage() {
|
|
54
105
|
throw new DeepgramVersionError();
|
|
55
106
|
}
|
|
107
|
+
/**
|
|
108
|
+
* @deprecated
|
|
109
|
+
* @see https://dpgr.am/js-v3
|
|
110
|
+
*/
|
|
56
111
|
get billing() {
|
|
57
112
|
throw new DeepgramVersionError();
|
|
58
113
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DeepgramClient.js","sourceRoot":"","sources":["../../src/DeepgramClient.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAC;AACpD,OAAO,
|
|
1
|
+
{"version":3,"file":"DeepgramClient.js","sourceRoot":"","sources":["../../src/DeepgramClient.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAC;AACpD,OAAO,EACL,cAAc,EACd,YAAY,EACZ,YAAY,EACZ,UAAU,EAEV,oBAAoB,EACpB,WAAW,GACZ,MAAM,YAAY,CAAC;AAEpB;;;;GAIG;AACH,MAAM,CAAC,OAAO,OAAO,cAAe,SAAQ,cAAc;IACxD;;;;OAIG;IACH,IAAI,MAAM;QACR,OAAO,IAAI,YAAY,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IACxC,CAAC;IAED;;;;OAIG;IACH,IAAI,MAAM;QACR,OAAO,IAAI,YAAY,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IACxC,CAAC;IAED;;;;;OAKG;IACH,IAAI,MAAM;QACR,OAAO,IAAI,CAAC,UAAU,CAAC;IACzB,CAAC;IAED;;;;OAIG;IACH,IAAI,UAAU;QACZ,OAAO,IAAI,oBAAoB,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IAChD,CAAC;IAED;;;;OAIG;IACH,IAAI,IAAI;QACN,OAAO,IAAI,UAAU,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IACtC,CAAC;IAED;;;;OAIG;IACH,IAAI,KAAK;QACP,OAAO,IAAI,WAAW,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IACvC,CAAC;IAED;;;OAGG;IACH,IAAI,aAAa;QACf,MAAM,IAAI,oBAAoB,EAAE,CAAC;IACnC,CAAC;IAED;;;OAGG;IACH,IAAI,QAAQ;QACV,MAAM,IAAI,oBAAoB,EAAE,CAAC;IACnC,CAAC;IAED;;;OAGG;IACH,IAAI,IAAI;QACN,MAAM,IAAI,oBAAoB,EAAE,CAAC;IACnC,CAAC;IAED;;;OAGG;IACH,IAAI,OAAO;QACT,MAAM,IAAI,oBAAoB,EAAE,CAAC;IACnC,CAAC;IAED;;;OAGG;IACH,IAAI,MAAM;QACR,MAAM,IAAI,oBAAoB,EAAE,CAAC;IACnC,CAAC;IAED;;;OAGG;IACH,IAAI,UAAU;QACZ,MAAM,IAAI,oBAAoB,EAAE,CAAC;IACnC,CAAC;IAED;;;OAGG;IACH,IAAI,KAAK;QACP,MAAM,IAAI,oBAAoB,EAAE,CAAC;IACnC,CAAC;IAED;;;OAGG;IACH,IAAI,OAAO;QACT,MAAM,IAAI,oBAAoB,EAAE,CAAC;IACnC,CAAC;CACF"}
|
package/dist/module/index.d.ts
CHANGED
|
@@ -1,7 +1,10 @@
|
|
|
1
|
+
import { DeepgramClientOptions, IKeyFactory } from "./lib/types/DeepgramClientOptions";
|
|
1
2
|
import DeepgramClient from "./DeepgramClient";
|
|
2
|
-
import type { DeepgramClientOptions } from "./lib/types";
|
|
3
3
|
/**
|
|
4
|
-
*
|
|
4
|
+
* This class is deprecated and should not be used. It throws a `DeepgramVersionError` when instantiated.
|
|
5
|
+
*
|
|
6
|
+
* @deprecated
|
|
7
|
+
* @see https://dpgr.am/js-v3
|
|
5
8
|
*/
|
|
6
9
|
declare class Deepgram {
|
|
7
10
|
protected apiKey: string;
|
|
@@ -10,9 +13,15 @@ declare class Deepgram {
|
|
|
10
13
|
constructor(apiKey: string, apiUrl?: string | undefined, requireSSL?: boolean | undefined);
|
|
11
14
|
}
|
|
12
15
|
/**
|
|
13
|
-
* Creates a new Deepgram
|
|
16
|
+
* Creates a new Deepgram client instance.
|
|
17
|
+
*
|
|
18
|
+
* @param {DeepgramClientArgs} args - Arguments to pass to the Deepgram client constructor.
|
|
19
|
+
* @returns A new Deepgram client instance.
|
|
14
20
|
*/
|
|
15
|
-
declare
|
|
21
|
+
declare function createClient(): DeepgramClient;
|
|
22
|
+
declare function createClient(key?: string | IKeyFactory): DeepgramClient;
|
|
23
|
+
declare function createClient(options?: DeepgramClientOptions): DeepgramClient;
|
|
24
|
+
declare function createClient(key?: string | IKeyFactory, options?: DeepgramClientOptions): DeepgramClient;
|
|
16
25
|
export { createClient, DeepgramClient, Deepgram };
|
|
17
26
|
/**
|
|
18
27
|
* Helpful exports.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,WAAW,EAAE,MAAM,mCAAmC,CAAC;AAEvF,OAAO,cAAc,MAAM,kBAAkB,CAAC;AAE9C;;;;;GAKG;AACH,cAAM,QAAQ;IACA,SAAS,CAAC,MAAM,EAAE,MAAM;IAAE,SAAS,CAAC,MAAM,CAAC;IAAU,SAAS,CAAC,UAAU,CAAC;gBAAhE,MAAM,EAAE,MAAM,EAAY,MAAM,CAAC,oBAAQ,EAAY,UAAU,CAAC,qBAAS;CAGhG;AAED;;;;;GAKG;AACH,iBAAS,YAAY,IAAI,cAAc,CAAC;AACxC,iBAAS,YAAY,CAAC,GAAG,CAAC,EAAE,MAAM,GAAG,WAAW,GAAG,cAAc,CAAC;AAClE,iBAAS,YAAY,CAAC,OAAO,CAAC,EAAE,qBAAqB,GAAG,cAAc,CAAC;AACvE,iBAAS,YAAY,CAAC,GAAG,CAAC,EAAE,MAAM,GAAG,WAAW,EAAE,OAAO,CAAC,EAAE,qBAAqB,GAAG,cAAc,CAAC;AAoBnG,OAAO,EAAE,YAAY,EAAE,cAAc,EAAE,QAAQ,EAAE,CAAC;AAElD;;GAEG;AACH,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,iBAAiB,CAAC;AAChC,cAAc,cAAc,CAAC;AAC7B,cAAc,eAAe,CAAC;AAE9B;;;;;;;;;GASG;AACH,OAAO,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,oBAAoB,CAAC"}
|
package/dist/module/index.js
CHANGED
|
@@ -1,7 +1,10 @@
|
|
|
1
|
-
import DeepgramClient from "./DeepgramClient";
|
|
2
1
|
import { DeepgramVersionError } from "./lib/errors";
|
|
2
|
+
import DeepgramClient from "./DeepgramClient";
|
|
3
3
|
/**
|
|
4
|
-
*
|
|
4
|
+
* This class is deprecated and should not be used. It throws a `DeepgramVersionError` when instantiated.
|
|
5
|
+
*
|
|
6
|
+
* @deprecated
|
|
7
|
+
* @see https://dpgr.am/js-v3
|
|
5
8
|
*/
|
|
6
9
|
class Deepgram {
|
|
7
10
|
constructor(apiKey, apiUrl, requireSSL) {
|
|
@@ -11,12 +14,19 @@ class Deepgram {
|
|
|
11
14
|
throw new DeepgramVersionError();
|
|
12
15
|
}
|
|
13
16
|
}
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
}
|
|
17
|
+
function createClient(keyOrOptions, options) {
|
|
18
|
+
let resolvedOptions = {};
|
|
19
|
+
if (typeof keyOrOptions === "string" || typeof keyOrOptions === "function") {
|
|
20
|
+
if (typeof options === "object") {
|
|
21
|
+
resolvedOptions = options;
|
|
22
|
+
}
|
|
23
|
+
resolvedOptions.key = keyOrOptions;
|
|
24
|
+
}
|
|
25
|
+
else if (typeof keyOrOptions === "object") {
|
|
26
|
+
resolvedOptions = keyOrOptions;
|
|
27
|
+
}
|
|
28
|
+
return new DeepgramClient(resolvedOptions);
|
|
29
|
+
}
|
|
20
30
|
export { createClient, DeepgramClient, Deepgram };
|
|
21
31
|
/**
|
|
22
32
|
* Helpful exports.
|
package/dist/module/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAC;AACpD,OAAO,cAAc,MAAM,kBAAkB,CAAC;AAE9C;;;;;GAKG;AACH,MAAM,QAAQ;IACZ,YAAsB,MAAc,EAAY,MAAe,EAAY,UAAoB;QAAzE,WAAM,GAAN,MAAM,CAAQ;QAAY,WAAM,GAAN,MAAM,CAAS;QAAY,eAAU,GAAV,UAAU,CAAU;QAC7F,MAAM,IAAI,oBAAoB,EAAE,CAAC;IACnC,CAAC;CACF;AAYD,SAAS,YAAY,CACnB,YAA2D,EAC3D,OAA+B;IAE/B,IAAI,eAAe,GAA0B,EAAE,CAAC;IAEhD,IAAI,OAAO,YAAY,KAAK,QAAQ,IAAI,OAAO,YAAY,KAAK,UAAU,EAAE;QAC1E,IAAI,OAAO,OAAO,KAAK,QAAQ,EAAE;YAC/B,eAAe,GAAG,OAAO,CAAC;SAC3B;QAED,eAAe,CAAC,GAAG,GAAG,YAAY,CAAC;KACpC;SAAM,IAAI,OAAO,YAAY,KAAK,QAAQ,EAAE;QAC3C,eAAe,GAAG,YAAY,CAAC;KAChC;IAED,OAAO,IAAI,cAAc,CAAC,eAAe,CAAC,CAAC;AAC7C,CAAC;AAED,OAAO,EAAE,YAAY,EAAE,cAAc,EAAE,QAAQ,EAAE,CAAC;AAElD;;GAEG;AACH,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,iBAAiB,CAAC;AAChC,cAAc,cAAc,CAAC;AAC7B,cAAc,eAAe,CAAC;AAE9B;;;;;;;;;GASG;AACH,OAAO,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,oBAAoB,CAAC"}
|
|
@@ -1,15 +1,24 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { FetchOptions } from "./types/Fetch";
|
|
1
|
+
import type { DefaultNamespaceOptions, DefaultClientOptions } from "./types";
|
|
3
2
|
export declare const NODE_VERSION: string;
|
|
3
|
+
export declare const BROWSER_AGENT: string;
|
|
4
4
|
export declare const DEFAULT_HEADERS: {
|
|
5
5
|
"Content-Type": string;
|
|
6
6
|
"X-Client-Info": string;
|
|
7
7
|
"User-Agent": string;
|
|
8
8
|
};
|
|
9
9
|
export declare const DEFAULT_URL = "https://api.deepgram.com";
|
|
10
|
-
export declare const DEFAULT_GLOBAL_OPTIONS:
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
10
|
+
export declare const DEFAULT_GLOBAL_OPTIONS: Partial<DefaultNamespaceOptions>;
|
|
11
|
+
export declare const DEFAULT_OPTIONS: DefaultClientOptions;
|
|
12
|
+
export declare enum SOCKET_STATES {
|
|
13
|
+
connecting = 0,
|
|
14
|
+
open = 1,
|
|
15
|
+
closing = 2,
|
|
16
|
+
closed = 3
|
|
17
|
+
}
|
|
18
|
+
export declare enum CONNECTION_STATE {
|
|
19
|
+
Connecting = "connecting",
|
|
20
|
+
Open = "open",
|
|
21
|
+
Closing = "closing",
|
|
22
|
+
Closed = "closed"
|
|
23
|
+
}
|
|
15
24
|
//# sourceMappingURL=constants.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../src/lib/constants.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../src/lib/constants.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,uBAAuB,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAC;AAE7E,eAAO,MAAM,YAAY,QAGV,CAAC;AAEhB,eAAO,MAAM,aAAa,QAGX,CAAC;AAEhB,eAAO,MAAM,eAAe;;;;CAM3B,CAAC;AAEF,eAAO,MAAM,WAAW,6BAA6B,CAAC;AAEtD,eAAO,MAAM,sBAAsB,EAAE,OAAO,CAAC,uBAAuB,CAKnE,CAAC;AAEF,eAAO,MAAM,eAAe,EAAE,oBAE7B,CAAC;AAEF,oBAAY,aAAa;IACvB,UAAU,IAAI;IACd,IAAI,IAAI;IACR,OAAO,IAAI;IACX,MAAM,IAAI;CACX;AAED,oBAAY,gBAAgB;IAC1B,UAAU,eAAe;IACzB,IAAI,SAAS;IACb,OAAO,YAAY;IACnB,MAAM,WAAW;CAClB"}
|
|
@@ -1,21 +1,38 @@
|
|
|
1
|
-
|
|
2
|
-
import { isBrowser } from "./helpers";
|
|
1
|
+
import { convertProtocolToWs, isBrowser } from "./helpers";
|
|
3
2
|
import { version } from "./version";
|
|
4
|
-
export const NODE_VERSION = typeof process
|
|
3
|
+
export const NODE_VERSION = typeof process !== "undefined" && process.versions && process.versions.node
|
|
4
|
+
? process.versions.node
|
|
5
|
+
: "unknown";
|
|
6
|
+
export const BROWSER_AGENT = typeof window !== "undefined" && window.navigator && window.navigator.userAgent
|
|
7
|
+
? window.navigator.userAgent
|
|
8
|
+
: "unknown";
|
|
5
9
|
export const DEFAULT_HEADERS = {
|
|
6
10
|
"Content-Type": `application/json`,
|
|
7
11
|
"X-Client-Info": `@deepgram/sdk; ${isBrowser() ? "browser" : "server"}; v${version}`,
|
|
8
|
-
"User-Agent": `@deepgram/sdk/${version} ${isBrowser() ?
|
|
12
|
+
"User-Agent": `@deepgram/sdk/${version} ${isBrowser() ? `javascript ${BROWSER_AGENT}` : `node/${NODE_VERSION}`}`,
|
|
9
13
|
};
|
|
10
14
|
export const DEFAULT_URL = "https://api.deepgram.com";
|
|
11
15
|
export const DEFAULT_GLOBAL_OPTIONS = {
|
|
12
|
-
url: DEFAULT_URL,
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
+
fetch: { options: { url: DEFAULT_URL, headers: DEFAULT_HEADERS } },
|
|
17
|
+
websocket: {
|
|
18
|
+
options: { url: convertProtocolToWs(DEFAULT_URL), _nodeOnlyHeaders: DEFAULT_HEADERS },
|
|
19
|
+
},
|
|
16
20
|
};
|
|
17
21
|
export const DEFAULT_OPTIONS = {
|
|
18
22
|
global: DEFAULT_GLOBAL_OPTIONS,
|
|
19
|
-
fetch: DEFAULT_FETCH_OPTIONS,
|
|
20
23
|
};
|
|
24
|
+
export var SOCKET_STATES;
|
|
25
|
+
(function (SOCKET_STATES) {
|
|
26
|
+
SOCKET_STATES[SOCKET_STATES["connecting"] = 0] = "connecting";
|
|
27
|
+
SOCKET_STATES[SOCKET_STATES["open"] = 1] = "open";
|
|
28
|
+
SOCKET_STATES[SOCKET_STATES["closing"] = 2] = "closing";
|
|
29
|
+
SOCKET_STATES[SOCKET_STATES["closed"] = 3] = "closed";
|
|
30
|
+
})(SOCKET_STATES || (SOCKET_STATES = {}));
|
|
31
|
+
export var CONNECTION_STATE;
|
|
32
|
+
(function (CONNECTION_STATE) {
|
|
33
|
+
CONNECTION_STATE["Connecting"] = "connecting";
|
|
34
|
+
CONNECTION_STATE["Open"] = "open";
|
|
35
|
+
CONNECTION_STATE["Closing"] = "closing";
|
|
36
|
+
CONNECTION_STATE["Closed"] = "closed";
|
|
37
|
+
})(CONNECTION_STATE || (CONNECTION_STATE = {}));
|
|
21
38
|
//# sourceMappingURL=constants.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../src/lib/constants.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../src/lib/constants.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAC3D,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAGpC,MAAM,CAAC,MAAM,YAAY,GACvB,OAAO,OAAO,KAAK,WAAW,IAAI,OAAO,CAAC,QAAQ,IAAI,OAAO,CAAC,QAAQ,CAAC,IAAI;IACzE,CAAC,CAAC,OAAO,CAAC,QAAQ,CAAC,IAAI;IACvB,CAAC,CAAC,SAAS,CAAC;AAEhB,MAAM,CAAC,MAAM,aAAa,GACxB,OAAO,MAAM,KAAK,WAAW,IAAI,MAAM,CAAC,SAAS,IAAI,MAAM,CAAC,SAAS,CAAC,SAAS;IAC7E,CAAC,CAAC,MAAM,CAAC,SAAS,CAAC,SAAS;IAC5B,CAAC,CAAC,SAAS,CAAC;AAEhB,MAAM,CAAC,MAAM,eAAe,GAAG;IAC7B,cAAc,EAAE,kBAAkB;IAClC,eAAe,EAAE,kBAAkB,SAAS,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,QAAQ,MAAM,OAAO,EAAE;IACpF,YAAY,EAAE,iBAAiB,OAAO,IACpC,SAAS,EAAE,CAAC,CAAC,CAAC,cAAc,aAAa,EAAE,CAAC,CAAC,CAAC,QAAQ,YAAY,EACpE,EAAE;CACH,CAAC;AAEF,MAAM,CAAC,MAAM,WAAW,GAAG,0BAA0B,CAAC;AAEtD,MAAM,CAAC,MAAM,sBAAsB,GAAqC;IACtE,KAAK,EAAE,EAAE,OAAO,EAAE,EAAE,GAAG,EAAE,WAAW,EAAE,OAAO,EAAE,eAAe,EAAE,EAAE;IAClE,SAAS,EAAE;QACT,OAAO,EAAE,EAAE,GAAG,EAAE,mBAAmB,CAAC,WAAW,CAAC,EAAE,gBAAgB,EAAE,eAAe,EAAE;KACtF;CACF,CAAC;AAEF,MAAM,CAAC,MAAM,eAAe,GAAyB;IACnD,MAAM,EAAE,sBAAsB;CAC/B,CAAC;AAEF,MAAM,CAAN,IAAY,aAKX;AALD,WAAY,aAAa;IACvB,6DAAc,CAAA;IACd,iDAAQ,CAAA;IACR,uDAAW,CAAA;IACX,qDAAU,CAAA;AACZ,CAAC,EALW,aAAa,KAAb,aAAa,QAKxB;AAED,MAAM,CAAN,IAAY,gBAKX;AALD,WAAY,gBAAgB;IAC1B,6CAAyB,CAAA;IACzB,iCAAa,CAAA;IACb,uCAAmB,CAAA;IACnB,qCAAiB,CAAA;AACnB,CAAC,EALW,gBAAgB,KAAhB,gBAAgB,QAK3B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LiveConnectionState.d.ts","sourceRoot":"","sources":["../../../../src/lib/enums/LiveConnectionState.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"LiveConnectionState.d.ts","sourceRoot":"","sources":["../../../../src/lib/enums/LiveConnectionState.ts"],"names":[],"mappings":"AAEA;;;;GAIG;AACH,oBAAY,mBAAmB;IAC7B,UAAU,IAA2B;IACrC,IAAI,IAAqB;IACzB,OAAO,IAAwB;IAC/B,MAAM,IAAuB;CAC9B"}
|
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Enum representing the different states of a live connection.
|
|
3
|
+
*
|
|
4
|
+
* @deprecated Since 3.4. Use `SOCKET_STATES` for generic socket connection states instead.
|
|
5
|
+
*/
|
|
1
6
|
export var LiveConnectionState;
|
|
2
7
|
(function (LiveConnectionState) {
|
|
3
8
|
LiveConnectionState[LiveConnectionState["CONNECTING"] = 0] = "CONNECTING";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LiveConnectionState.js","sourceRoot":"","sources":["../../../../src/lib/enums/LiveConnectionState.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"LiveConnectionState.js","sourceRoot":"","sources":["../../../../src/lib/enums/LiveConnectionState.ts"],"names":[],"mappings":"AAEA;;;;GAIG;AACH,MAAM,CAAN,IAAY,mBAKX;AALD,WAAY,mBAAmB;IAC7B,yEAAqC,CAAA;IACrC,6DAAyB,CAAA;IACzB,mEAA+B,CAAA;IAC/B,iEAA6B,CAAA;AAC/B,CAAC,EALW,mBAAmB,KAAnB,mBAAmB,QAK9B"}
|
|
@@ -1,11 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Enumeration of events related to live transcription.
|
|
3
|
+
*
|
|
4
|
+
* - `Open`: Built-in socket event for when the connection is opened.
|
|
5
|
+
* - `Close`: Built-in socket event for when the connection is closed.
|
|
6
|
+
* - `Error`: Built-in socket event for when an error occurs.
|
|
7
|
+
* - `Transcript`: Event for when a transcript message is received.
|
|
8
|
+
* - `Metadata`: Event for when metadata is received.
|
|
9
|
+
* - `UtteranceEnd`: Event for when an utterance ends.
|
|
10
|
+
* - `SpeechStarted`: Event for when speech is detected.
|
|
11
|
+
* - `Unhandled`: Catch-all event for any other message event.
|
|
12
|
+
*/
|
|
1
13
|
export declare enum LiveTranscriptionEvents {
|
|
14
|
+
/**
|
|
15
|
+
* Built in socket events.
|
|
16
|
+
*/
|
|
2
17
|
Open = "open",
|
|
3
18
|
Close = "close",
|
|
19
|
+
Error = "error",
|
|
20
|
+
/**
|
|
21
|
+
* Message { type: string }
|
|
22
|
+
*/
|
|
4
23
|
Transcript = "Results",
|
|
5
24
|
Metadata = "Metadata",
|
|
6
|
-
Error = "error",
|
|
7
|
-
Warning = "warning",
|
|
8
25
|
UtteranceEnd = "UtteranceEnd",
|
|
9
|
-
SpeechStarted = "SpeechStarted"
|
|
26
|
+
SpeechStarted = "SpeechStarted",
|
|
27
|
+
/**
|
|
28
|
+
* Catch all for any other message event
|
|
29
|
+
*/
|
|
30
|
+
Unhandled = "Unhandled"
|
|
10
31
|
}
|
|
11
32
|
//# sourceMappingURL=LiveTranscriptionEvents.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LiveTranscriptionEvents.d.ts","sourceRoot":"","sources":["../../../../src/lib/enums/LiveTranscriptionEvents.ts"],"names":[],"mappings":"AAAA,oBAAY,uBAAuB;IACjC,IAAI,SAAS;IACb,KAAK,UAAU;IACf,UAAU,YAAY;IACtB,QAAQ,aAAa;IACrB,
|
|
1
|
+
{"version":3,"file":"LiveTranscriptionEvents.d.ts","sourceRoot":"","sources":["../../../../src/lib/enums/LiveTranscriptionEvents.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AACH,oBAAY,uBAAuB;IACjC;;OAEG;IACH,IAAI,SAAS;IACb,KAAK,UAAU;IACf,KAAK,UAAU;IAEf;;OAEG;IACH,UAAU,YAAY;IACtB,QAAQ,aAAa;IACrB,YAAY,iBAAiB;IAC7B,aAAa,kBAAkB;IAE/B;;OAEG;IACH,SAAS,cAAc;CACxB"}
|
|
@@ -1,12 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Enumeration of events related to live transcription.
|
|
3
|
+
*
|
|
4
|
+
* - `Open`: Built-in socket event for when the connection is opened.
|
|
5
|
+
* - `Close`: Built-in socket event for when the connection is closed.
|
|
6
|
+
* - `Error`: Built-in socket event for when an error occurs.
|
|
7
|
+
* - `Transcript`: Event for when a transcript message is received.
|
|
8
|
+
* - `Metadata`: Event for when metadata is received.
|
|
9
|
+
* - `UtteranceEnd`: Event for when an utterance ends.
|
|
10
|
+
* - `SpeechStarted`: Event for when speech is detected.
|
|
11
|
+
* - `Unhandled`: Catch-all event for any other message event.
|
|
12
|
+
*/
|
|
1
13
|
export var LiveTranscriptionEvents;
|
|
2
14
|
(function (LiveTranscriptionEvents) {
|
|
15
|
+
/**
|
|
16
|
+
* Built in socket events.
|
|
17
|
+
*/
|
|
3
18
|
LiveTranscriptionEvents["Open"] = "open";
|
|
4
19
|
LiveTranscriptionEvents["Close"] = "close";
|
|
20
|
+
LiveTranscriptionEvents["Error"] = "error";
|
|
21
|
+
/**
|
|
22
|
+
* Message { type: string }
|
|
23
|
+
*/
|
|
5
24
|
LiveTranscriptionEvents["Transcript"] = "Results";
|
|
6
25
|
LiveTranscriptionEvents["Metadata"] = "Metadata";
|
|
7
|
-
LiveTranscriptionEvents["Error"] = "error";
|
|
8
|
-
LiveTranscriptionEvents["Warning"] = "warning";
|
|
9
26
|
LiveTranscriptionEvents["UtteranceEnd"] = "UtteranceEnd";
|
|
10
27
|
LiveTranscriptionEvents["SpeechStarted"] = "SpeechStarted";
|
|
28
|
+
/**
|
|
29
|
+
* Catch all for any other message event
|
|
30
|
+
*/
|
|
31
|
+
LiveTranscriptionEvents["Unhandled"] = "Unhandled";
|
|
11
32
|
})(LiveTranscriptionEvents || (LiveTranscriptionEvents = {}));
|
|
12
33
|
//# sourceMappingURL=LiveTranscriptionEvents.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LiveTranscriptionEvents.js","sourceRoot":"","sources":["../../../../src/lib/enums/LiveTranscriptionEvents.ts"],"names":[],"mappings":"AAAA,MAAM,CAAN,IAAY,
|
|
1
|
+
{"version":3,"file":"LiveTranscriptionEvents.js","sourceRoot":"","sources":["../../../../src/lib/enums/LiveTranscriptionEvents.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AACH,MAAM,CAAN,IAAY,uBAoBX;AApBD,WAAY,uBAAuB;IACjC;;OAEG;IACH,wCAAa,CAAA;IACb,0CAAe,CAAA;IACf,0CAAe,CAAA;IAEf;;OAEG;IACH,iDAAsB,CAAA;IACtB,gDAAqB,CAAA;IACrB,wDAA6B,CAAA;IAC7B,0DAA+B,CAAA;IAE/B;;OAEG;IACH,kDAAuB,CAAA;AACzB,CAAC,EApBW,uBAAuB,KAAvB,uBAAuB,QAoBlC"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export
|
|
2
|
-
export
|
|
1
|
+
export * from "./LiveConnectionState";
|
|
2
|
+
export * from "./LiveTranscriptionEvents";
|
|
3
3
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/lib/enums/index.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/lib/enums/index.ts"],"names":[],"mappings":"AAAA,cAAc,uBAAuB,CAAC;AACtC,cAAc,2BAA2B,CAAC"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export
|
|
2
|
-
export
|
|
1
|
+
export * from "./LiveConnectionState";
|
|
2
|
+
export * from "./LiveTranscriptionEvents";
|
|
3
3
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/lib/enums/index.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/lib/enums/index.ts"],"names":[],"mappings":"AAAA,cAAc,uBAAuB,CAAC;AACtC,cAAc,2BAA2B,CAAC"}
|
|
@@ -1,6 +1,24 @@
|
|
|
1
|
-
import type { Fetch } from "./types
|
|
1
|
+
import type { Fetch } from "./types";
|
|
2
|
+
/**
|
|
3
|
+
* Resolves the appropriate fetch function to use, either a custom fetch function provided as an argument, or the global fetch function if available, or the cross-fetch library if the global fetch function is not available.
|
|
4
|
+
*
|
|
5
|
+
* @param customFetch - An optional custom fetch function to use instead of the global fetch function.
|
|
6
|
+
* @returns A fetch function that can be used to make HTTP requests.
|
|
7
|
+
*/
|
|
2
8
|
export declare const resolveFetch: (customFetch?: Fetch) => Fetch;
|
|
9
|
+
/**
|
|
10
|
+
* Resolves a fetch function that includes an "Authorization" header with the provided API key.
|
|
11
|
+
*
|
|
12
|
+
* @param apiKey - The API key to include in the "Authorization" header.
|
|
13
|
+
* @param customFetch - An optional custom fetch function to use instead of the global fetch function.
|
|
14
|
+
* @returns A fetch function that can be used to make HTTP requests with the provided API key in the "Authorization" header.
|
|
15
|
+
*/
|
|
3
16
|
export declare const fetchWithAuth: (apiKey: string, customFetch?: Fetch) => Fetch;
|
|
17
|
+
/**
|
|
18
|
+
* Resolves the appropriate Response object to use, either the global Response object if available, or the Response object from the cross-fetch library if the global Response object is not available.
|
|
19
|
+
*
|
|
20
|
+
* @returns The appropriate Response object to use for making HTTP requests.
|
|
21
|
+
*/
|
|
4
22
|
export declare const resolveResponse: () => Promise<{
|
|
5
23
|
new (body?: BodyInit | null | undefined, init?: ResponseInit | undefined): Response;
|
|
6
24
|
prototype: Response;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fetch.d.ts","sourceRoot":"","sources":["../../../src/lib/fetch.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"fetch.d.ts","sourceRoot":"","sources":["../../../src/lib/fetch.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAErC;;;;;GAKG;AACH,eAAO,MAAM,YAAY,iBAAkB,KAAK,KAAG,KAYlD,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,aAAa,WAAY,MAAM,gBAAgB,KAAK,KAAG,KAanE,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,eAAe;;;;;EAM3B,CAAC"}
|