@deepgram/sdk 5.0.0-alpha.3 → 5.0.0-beta.1

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 (157) hide show
  1. package/LICENSE +1 -1
  2. package/dist/browser/index.global.js +496 -1104
  3. package/dist/cjs/BaseClient.d.ts +7 -7
  4. package/dist/cjs/BaseClient.js +2 -2
  5. package/dist/cjs/Client.d.ts +1 -2
  6. package/dist/cjs/CustomClient.js +253 -249
  7. package/dist/cjs/api/resources/agent/client/Client.d.ts +1 -2
  8. package/dist/cjs/api/resources/agent/resources/v1/client/Client.d.ts +1 -2
  9. package/dist/cjs/api/resources/agent/resources/v1/client/Socket.d.ts +8 -8
  10. package/dist/cjs/api/resources/agent/resources/v1/client/Socket.js +9 -9
  11. package/dist/cjs/api/resources/agent/resources/v1/resources/settings/client/Client.d.ts +1 -2
  12. package/dist/cjs/api/resources/agent/resources/v1/resources/settings/resources/think/client/Client.d.ts +1 -2
  13. package/dist/cjs/api/resources/agent/resources/v1/resources/settings/resources/think/resources/models/client/Client.d.ts +1 -2
  14. package/dist/cjs/api/resources/auth/client/Client.d.ts +1 -2
  15. package/dist/cjs/api/resources/auth/resources/v1/client/Client.d.ts +1 -2
  16. package/dist/cjs/api/resources/auth/resources/v1/resources/tokens/client/Client.d.ts +1 -2
  17. package/dist/cjs/api/resources/listen/client/Client.d.ts +1 -2
  18. package/dist/cjs/api/resources/listen/resources/v1/client/Client.d.ts +1 -2
  19. package/dist/cjs/api/resources/listen/resources/v1/client/Client.js +29 -80
  20. package/dist/cjs/api/resources/listen/resources/v1/client/Socket.d.ts +4 -4
  21. package/dist/cjs/api/resources/listen/resources/v1/client/Socket.js +5 -5
  22. package/dist/cjs/api/resources/listen/resources/v1/resources/media/client/Client.d.ts +1 -2
  23. package/dist/cjs/api/resources/listen/resources/v1/resources/media/client/Client.js +76 -298
  24. package/dist/cjs/api/resources/listen/resources/v2/client/Client.d.ts +1 -2
  25. package/dist/cjs/api/resources/listen/resources/v2/client/Client.js +11 -26
  26. package/dist/cjs/api/resources/listen/resources/v2/client/Socket.d.ts +2 -2
  27. package/dist/cjs/api/resources/listen/resources/v2/client/Socket.js +3 -3
  28. package/dist/cjs/api/resources/manage/client/Client.d.ts +1 -2
  29. package/dist/cjs/api/resources/manage/resources/v1/client/Client.d.ts +1 -2
  30. package/dist/cjs/api/resources/manage/resources/v1/resources/models/client/Client.d.ts +1 -2
  31. package/dist/cjs/api/resources/manage/resources/v1/resources/models/client/Client.js +3 -4
  32. package/dist/cjs/api/resources/manage/resources/v1/resources/projects/client/Client.d.ts +1 -2
  33. package/dist/cjs/api/resources/manage/resources/v1/resources/projects/client/Client.js +4 -7
  34. package/dist/cjs/api/resources/manage/resources/v1/resources/projects/resources/billing/client/Client.d.ts +1 -2
  35. package/dist/cjs/api/resources/manage/resources/v1/resources/projects/resources/billing/resources/balances/client/Client.d.ts +1 -2
  36. package/dist/cjs/api/resources/manage/resources/v1/resources/projects/resources/billing/resources/breakdown/client/Client.d.ts +1 -2
  37. package/dist/cjs/api/resources/manage/resources/v1/resources/projects/resources/billing/resources/breakdown/client/Client.js +9 -27
  38. package/dist/cjs/api/resources/manage/resources/v1/resources/projects/resources/billing/resources/fields/client/Client.d.ts +1 -2
  39. package/dist/cjs/api/resources/manage/resources/v1/resources/projects/resources/billing/resources/fields/client/Client.js +4 -7
  40. package/dist/cjs/api/resources/manage/resources/v1/resources/projects/resources/billing/resources/purchases/client/Client.d.ts +1 -2
  41. package/dist/cjs/api/resources/manage/resources/v1/resources/projects/resources/billing/resources/purchases/client/Client.js +3 -4
  42. package/dist/cjs/api/resources/manage/resources/v1/resources/projects/resources/keys/client/Client.d.ts +1 -2
  43. package/dist/cjs/api/resources/manage/resources/v1/resources/projects/resources/keys/client/Client.js +3 -4
  44. package/dist/cjs/api/resources/manage/resources/v1/resources/projects/resources/members/client/Client.d.ts +1 -2
  45. package/dist/cjs/api/resources/manage/resources/v1/resources/projects/resources/members/resources/invites/client/Client.d.ts +1 -2
  46. package/dist/cjs/api/resources/manage/resources/v1/resources/projects/resources/members/resources/scopes/client/Client.d.ts +1 -2
  47. package/dist/cjs/api/resources/manage/resources/v1/resources/projects/resources/models/client/Client.d.ts +1 -2
  48. package/dist/cjs/api/resources/manage/resources/v1/resources/projects/resources/models/client/Client.js +3 -4
  49. package/dist/cjs/api/resources/manage/resources/v1/resources/projects/resources/requests/client/Client.d.ts +1 -2
  50. package/dist/cjs/api/resources/manage/resources/v1/resources/projects/resources/requests/client/Client.js +12 -31
  51. package/dist/cjs/api/resources/manage/resources/v1/resources/projects/resources/usage/client/Client.d.ts +1 -2
  52. package/dist/cjs/api/resources/manage/resources/v1/resources/projects/resources/usage/client/Client.js +46 -133
  53. package/dist/cjs/api/resources/manage/resources/v1/resources/projects/resources/usage/resources/breakdown/client/Client.d.ts +1 -2
  54. package/dist/cjs/api/resources/manage/resources/v1/resources/projects/resources/usage/resources/breakdown/client/Client.js +47 -136
  55. package/dist/cjs/api/resources/manage/resources/v1/resources/projects/resources/usage/resources/fields/client/Client.d.ts +1 -2
  56. package/dist/cjs/api/resources/manage/resources/v1/resources/projects/resources/usage/resources/fields/client/Client.js +4 -7
  57. package/dist/cjs/api/resources/read/client/Client.d.ts +1 -2
  58. package/dist/cjs/api/resources/read/resources/v1/client/Client.d.ts +1 -2
  59. package/dist/cjs/api/resources/read/resources/v1/resources/text/client/Client.d.ts +1 -2
  60. package/dist/cjs/api/resources/read/resources/v1/resources/text/client/Client.js +14 -52
  61. package/dist/cjs/api/resources/selfHosted/client/Client.d.ts +1 -2
  62. package/dist/cjs/api/resources/selfHosted/resources/v1/client/Client.d.ts +1 -2
  63. package/dist/cjs/api/resources/selfHosted/resources/v1/resources/distributionCredentials/client/Client.d.ts +1 -2
  64. package/dist/cjs/api/resources/selfHosted/resources/v1/resources/distributionCredentials/client/Client.js +4 -12
  65. package/dist/cjs/api/resources/speak/client/Client.d.ts +1 -2
  66. package/dist/cjs/api/resources/speak/resources/v1/client/Client.d.ts +1 -2
  67. package/dist/cjs/api/resources/speak/resources/v1/client/Client.js +6 -13
  68. package/dist/cjs/api/resources/speak/resources/v1/client/Socket.d.ts +4 -4
  69. package/dist/cjs/api/resources/speak/resources/v1/client/Socket.js +4 -4
  70. package/dist/cjs/api/resources/speak/resources/v1/resources/audio/client/Client.d.ts +1 -2
  71. package/dist/cjs/api/resources/speak/resources/v1/resources/audio/client/Client.js +11 -33
  72. package/dist/cjs/auth/HeaderAuthProvider.d.ts +14 -8
  73. package/dist/cjs/auth/HeaderAuthProvider.js +19 -9
  74. package/dist/cjs/core/fetcher/EndpointSupplier.d.ts +2 -2
  75. package/dist/cjs/core/fetcher/Fetcher.d.ts +1 -2
  76. package/dist/cjs/core/headers.d.ts +2 -2
  77. package/dist/cjs/core/websocket/ws.d.ts +1 -1
  78. package/dist/cjs/version.d.ts +1 -1
  79. package/dist/cjs/version.js +1 -1
  80. package/dist/esm/BaseClient.d.mts +7 -7
  81. package/dist/esm/BaseClient.mjs +2 -2
  82. package/dist/esm/Client.d.mts +1 -2
  83. package/dist/esm/CustomClient.mjs +254 -250
  84. package/dist/esm/api/resources/agent/client/Client.d.mts +1 -2
  85. package/dist/esm/api/resources/agent/resources/v1/client/Client.d.mts +1 -2
  86. package/dist/esm/api/resources/agent/resources/v1/client/Socket.d.mts +8 -8
  87. package/dist/esm/api/resources/agent/resources/v1/client/Socket.mjs +9 -9
  88. package/dist/esm/api/resources/agent/resources/v1/resources/settings/client/Client.d.mts +1 -2
  89. package/dist/esm/api/resources/agent/resources/v1/resources/settings/resources/think/client/Client.d.mts +1 -2
  90. package/dist/esm/api/resources/agent/resources/v1/resources/settings/resources/think/resources/models/client/Client.d.mts +1 -2
  91. package/dist/esm/api/resources/auth/client/Client.d.mts +1 -2
  92. package/dist/esm/api/resources/auth/resources/v1/client/Client.d.mts +1 -2
  93. package/dist/esm/api/resources/auth/resources/v1/resources/tokens/client/Client.d.mts +1 -2
  94. package/dist/esm/api/resources/listen/client/Client.d.mts +1 -2
  95. package/dist/esm/api/resources/listen/resources/v1/client/Client.d.mts +1 -2
  96. package/dist/esm/api/resources/listen/resources/v1/client/Client.mjs +29 -80
  97. package/dist/esm/api/resources/listen/resources/v1/client/Socket.d.mts +4 -4
  98. package/dist/esm/api/resources/listen/resources/v1/client/Socket.mjs +5 -5
  99. package/dist/esm/api/resources/listen/resources/v1/resources/media/client/Client.d.mts +1 -2
  100. package/dist/esm/api/resources/listen/resources/v1/resources/media/client/Client.mjs +76 -298
  101. package/dist/esm/api/resources/listen/resources/v2/client/Client.d.mts +1 -2
  102. package/dist/esm/api/resources/listen/resources/v2/client/Client.mjs +11 -26
  103. package/dist/esm/api/resources/listen/resources/v2/client/Socket.d.mts +2 -2
  104. package/dist/esm/api/resources/listen/resources/v2/client/Socket.mjs +3 -3
  105. package/dist/esm/api/resources/manage/client/Client.d.mts +1 -2
  106. package/dist/esm/api/resources/manage/resources/v1/client/Client.d.mts +1 -2
  107. package/dist/esm/api/resources/manage/resources/v1/resources/models/client/Client.d.mts +1 -2
  108. package/dist/esm/api/resources/manage/resources/v1/resources/models/client/Client.mjs +3 -4
  109. package/dist/esm/api/resources/manage/resources/v1/resources/projects/client/Client.d.mts +1 -2
  110. package/dist/esm/api/resources/manage/resources/v1/resources/projects/client/Client.mjs +4 -7
  111. package/dist/esm/api/resources/manage/resources/v1/resources/projects/resources/billing/client/Client.d.mts +1 -2
  112. package/dist/esm/api/resources/manage/resources/v1/resources/projects/resources/billing/resources/balances/client/Client.d.mts +1 -2
  113. package/dist/esm/api/resources/manage/resources/v1/resources/projects/resources/billing/resources/breakdown/client/Client.d.mts +1 -2
  114. package/dist/esm/api/resources/manage/resources/v1/resources/projects/resources/billing/resources/breakdown/client/Client.mjs +9 -27
  115. package/dist/esm/api/resources/manage/resources/v1/resources/projects/resources/billing/resources/fields/client/Client.d.mts +1 -2
  116. package/dist/esm/api/resources/manage/resources/v1/resources/projects/resources/billing/resources/fields/client/Client.mjs +4 -7
  117. package/dist/esm/api/resources/manage/resources/v1/resources/projects/resources/billing/resources/purchases/client/Client.d.mts +1 -2
  118. package/dist/esm/api/resources/manage/resources/v1/resources/projects/resources/billing/resources/purchases/client/Client.mjs +3 -4
  119. package/dist/esm/api/resources/manage/resources/v1/resources/projects/resources/keys/client/Client.d.mts +1 -2
  120. package/dist/esm/api/resources/manage/resources/v1/resources/projects/resources/keys/client/Client.mjs +3 -4
  121. package/dist/esm/api/resources/manage/resources/v1/resources/projects/resources/members/client/Client.d.mts +1 -2
  122. package/dist/esm/api/resources/manage/resources/v1/resources/projects/resources/members/resources/invites/client/Client.d.mts +1 -2
  123. package/dist/esm/api/resources/manage/resources/v1/resources/projects/resources/members/resources/scopes/client/Client.d.mts +1 -2
  124. package/dist/esm/api/resources/manage/resources/v1/resources/projects/resources/models/client/Client.d.mts +1 -2
  125. package/dist/esm/api/resources/manage/resources/v1/resources/projects/resources/models/client/Client.mjs +3 -4
  126. package/dist/esm/api/resources/manage/resources/v1/resources/projects/resources/requests/client/Client.d.mts +1 -2
  127. package/dist/esm/api/resources/manage/resources/v1/resources/projects/resources/requests/client/Client.mjs +12 -31
  128. package/dist/esm/api/resources/manage/resources/v1/resources/projects/resources/usage/client/Client.d.mts +1 -2
  129. package/dist/esm/api/resources/manage/resources/v1/resources/projects/resources/usage/client/Client.mjs +46 -133
  130. package/dist/esm/api/resources/manage/resources/v1/resources/projects/resources/usage/resources/breakdown/client/Client.d.mts +1 -2
  131. package/dist/esm/api/resources/manage/resources/v1/resources/projects/resources/usage/resources/breakdown/client/Client.mjs +47 -136
  132. package/dist/esm/api/resources/manage/resources/v1/resources/projects/resources/usage/resources/fields/client/Client.d.mts +1 -2
  133. package/dist/esm/api/resources/manage/resources/v1/resources/projects/resources/usage/resources/fields/client/Client.mjs +4 -7
  134. package/dist/esm/api/resources/read/client/Client.d.mts +1 -2
  135. package/dist/esm/api/resources/read/resources/v1/client/Client.d.mts +1 -2
  136. package/dist/esm/api/resources/read/resources/v1/resources/text/client/Client.d.mts +1 -2
  137. package/dist/esm/api/resources/read/resources/v1/resources/text/client/Client.mjs +14 -52
  138. package/dist/esm/api/resources/selfHosted/client/Client.d.mts +1 -2
  139. package/dist/esm/api/resources/selfHosted/resources/v1/client/Client.d.mts +1 -2
  140. package/dist/esm/api/resources/selfHosted/resources/v1/resources/distributionCredentials/client/Client.d.mts +1 -2
  141. package/dist/esm/api/resources/selfHosted/resources/v1/resources/distributionCredentials/client/Client.mjs +4 -12
  142. package/dist/esm/api/resources/speak/client/Client.d.mts +1 -2
  143. package/dist/esm/api/resources/speak/resources/v1/client/Client.d.mts +1 -2
  144. package/dist/esm/api/resources/speak/resources/v1/client/Client.mjs +6 -13
  145. package/dist/esm/api/resources/speak/resources/v1/client/Socket.d.mts +4 -4
  146. package/dist/esm/api/resources/speak/resources/v1/client/Socket.mjs +4 -4
  147. package/dist/esm/api/resources/speak/resources/v1/resources/audio/client/Client.d.mts +1 -2
  148. package/dist/esm/api/resources/speak/resources/v1/resources/audio/client/Client.mjs +11 -33
  149. package/dist/esm/auth/HeaderAuthProvider.d.mts +14 -8
  150. package/dist/esm/auth/HeaderAuthProvider.mjs +19 -9
  151. package/dist/esm/core/fetcher/EndpointSupplier.d.mts +2 -2
  152. package/dist/esm/core/fetcher/Fetcher.d.mts +1 -2
  153. package/dist/esm/core/headers.d.mts +2 -2
  154. package/dist/esm/core/websocket/ws.d.mts +1 -1
  155. package/dist/esm/version.d.mts +1 -1
  156. package/dist/esm/version.mjs +1 -1
  157. package/package.json +10 -7
@@ -2,8 +2,7 @@ import type { BaseClientOptions } from "../../../../BaseClient.js";
2
2
  import { type NormalizedClientOptions } from "../../../../BaseClient.js";
3
3
  import { V1Client } from "../resources/v1/client/Client.js";
4
4
  export declare namespace AgentClient {
5
- interface Options extends BaseClientOptions {
6
- }
5
+ type Options = BaseClientOptions;
7
6
  }
8
7
  export declare class AgentClient {
9
8
  protected readonly _options: NormalizedClientOptions<AgentClient.Options>;
@@ -3,8 +3,7 @@ import { type NormalizedClientOptions } from "../../../../../../BaseClient.js";
3
3
  import { SettingsClient } from "../resources/settings/client/Client.js";
4
4
  import { V1Socket } from "./Socket.js";
5
5
  export declare namespace V1Client {
6
- interface Options extends BaseClientOptions {
7
- }
6
+ type Options = BaseClientOptions;
8
7
  interface ConnectArgs {
9
8
  Authorization: string;
10
9
  /** Arbitrary headers to send with the websocket connect request. */
@@ -33,14 +33,14 @@ export declare class V1Socket {
33
33
  * ```
34
34
  */
35
35
  on<T extends keyof V1Socket.EventHandlers>(event: T, callback: V1Socket.EventHandlers[T]): void;
36
- sendAgentV1Settings(message: Deepgram.agent.AgentV1Settings): void;
37
- sendAgentV1UpdateSpeak(message: Deepgram.agent.AgentV1UpdateSpeak): void;
38
- sendAgentV1InjectUserMessage(message: Deepgram.agent.AgentV1InjectUserMessage): void;
39
- sendAgentV1InjectAgentMessage(message: Deepgram.agent.AgentV1InjectAgentMessage): void;
40
- sendAgentV1SendFunctionCallResponse(message: Deepgram.agent.AgentV1SendFunctionCallResponse): void;
41
- sendAgentV1KeepAlive(message: Deepgram.agent.AgentV1KeepAlive): void;
42
- sendAgentV1UpdatePrompt(message: Deepgram.agent.AgentV1UpdatePrompt): void;
43
- sendAgentV1Media(message: string): void;
36
+ sendSettings(message: Deepgram.agent.AgentV1Settings): void;
37
+ sendUpdateSpeak(message: Deepgram.agent.AgentV1UpdateSpeak): void;
38
+ sendInjectUserMessage(message: Deepgram.agent.AgentV1InjectUserMessage): void;
39
+ sendInjectAgentMessage(message: Deepgram.agent.AgentV1InjectAgentMessage): void;
40
+ sendFunctionCallResponse(message: Deepgram.agent.AgentV1SendFunctionCallResponse): void;
41
+ sendKeepAlive(message: Deepgram.agent.AgentV1KeepAlive): void;
42
+ sendUpdatePrompt(message: Deepgram.agent.AgentV1UpdatePrompt): void;
43
+ sendMedia(message: ArrayBufferLike | Blob | ArrayBufferView): void;
44
44
  /** Connect to the websocket and register event handlers. */
45
45
  connect(): V1Socket;
46
46
  /** Close the websocket and unregister event handlers. */
@@ -90,37 +90,37 @@ class V1Socket {
90
90
  on(event, callback) {
91
91
  this.eventHandlers[event] = callback;
92
92
  }
93
- sendAgentV1Settings(message) {
93
+ sendSettings(message) {
94
94
  this.assertSocketIsOpen();
95
95
  this.sendJson(message);
96
96
  }
97
- sendAgentV1UpdateSpeak(message) {
97
+ sendUpdateSpeak(message) {
98
98
  this.assertSocketIsOpen();
99
99
  this.sendJson(message);
100
100
  }
101
- sendAgentV1InjectUserMessage(message) {
101
+ sendInjectUserMessage(message) {
102
102
  this.assertSocketIsOpen();
103
103
  this.sendJson(message);
104
104
  }
105
- sendAgentV1InjectAgentMessage(message) {
105
+ sendInjectAgentMessage(message) {
106
106
  this.assertSocketIsOpen();
107
107
  this.sendJson(message);
108
108
  }
109
- sendAgentV1SendFunctionCallResponse(message) {
109
+ sendFunctionCallResponse(message) {
110
110
  this.assertSocketIsOpen();
111
111
  this.sendJson(message);
112
112
  }
113
- sendAgentV1KeepAlive(message) {
113
+ sendKeepAlive(message) {
114
114
  this.assertSocketIsOpen();
115
115
  this.sendJson(message);
116
116
  }
117
- sendAgentV1UpdatePrompt(message) {
117
+ sendUpdatePrompt(message) {
118
118
  this.assertSocketIsOpen();
119
119
  this.sendJson(message);
120
120
  }
121
- sendAgentV1Media(message) {
121
+ sendMedia(message) {
122
122
  this.assertSocketIsOpen();
123
- this.sendJson(message);
123
+ this.sendBinary(message);
124
124
  }
125
125
  /** Connect to the websocket and register event handlers. */
126
126
  connect() {
@@ -2,8 +2,7 @@ import type { BaseClientOptions } from "../../../../../../../../BaseClient.js";
2
2
  import { type NormalizedClientOptions } from "../../../../../../../../BaseClient.js";
3
3
  import { ThinkClient } from "../resources/think/client/Client.js";
4
4
  export declare namespace SettingsClient {
5
- interface Options extends BaseClientOptions {
6
- }
5
+ type Options = BaseClientOptions;
7
6
  }
8
7
  export declare class SettingsClient {
9
8
  protected readonly _options: NormalizedClientOptions<SettingsClient.Options>;
@@ -2,8 +2,7 @@ import type { BaseClientOptions } from "../../../../../../../../../../BaseClient
2
2
  import { type NormalizedClientOptions } from "../../../../../../../../../../BaseClient.js";
3
3
  import { ModelsClient } from "../resources/models/client/Client.js";
4
4
  export declare namespace ThinkClient {
5
- interface Options extends BaseClientOptions {
6
- }
5
+ type Options = BaseClientOptions;
7
6
  }
8
7
  export declare class ThinkClient {
9
8
  protected readonly _options: NormalizedClientOptions<ThinkClient.Options>;
@@ -3,8 +3,7 @@ import { type NormalizedClientOptions } from "../../../../../../../../../../../.
3
3
  import * as core from "../../../../../../../../../../../../core/index.js";
4
4
  import * as Deepgram from "../../../../../../../../../../../index.js";
5
5
  export declare namespace ModelsClient {
6
- interface Options extends BaseClientOptions {
7
- }
6
+ type Options = BaseClientOptions;
8
7
  interface RequestOptions extends BaseRequestOptions {
9
8
  }
10
9
  }
@@ -2,8 +2,7 @@ import type { BaseClientOptions } from "../../../../BaseClient.js";
2
2
  import { type NormalizedClientOptionsWithAuth } from "../../../../BaseClient.js";
3
3
  import { V1Client } from "../resources/v1/client/Client.js";
4
4
  export declare namespace AuthClient {
5
- interface Options extends BaseClientOptions {
6
- }
5
+ type Options = BaseClientOptions;
7
6
  }
8
7
  export declare class AuthClient {
9
8
  protected readonly _options: NormalizedClientOptionsWithAuth<AuthClient.Options>;
@@ -2,8 +2,7 @@ import type { BaseClientOptions } from "../../../../../../BaseClient.js";
2
2
  import { type NormalizedClientOptionsWithAuth } from "../../../../../../BaseClient.js";
3
3
  import { TokensClient } from "../resources/tokens/client/Client.js";
4
4
  export declare namespace V1Client {
5
- interface Options extends BaseClientOptions {
6
- }
5
+ type Options = BaseClientOptions;
7
6
  }
8
7
  export declare class V1Client {
9
8
  protected readonly _options: NormalizedClientOptionsWithAuth<V1Client.Options>;
@@ -3,8 +3,7 @@ import { type NormalizedClientOptionsWithAuth } from "../../../../../../../../Ba
3
3
  import * as core from "../../../../../../../../core/index.js";
4
4
  import * as Deepgram from "../../../../../../../index.js";
5
5
  export declare namespace TokensClient {
6
- interface Options extends BaseClientOptions {
7
- }
6
+ type Options = BaseClientOptions;
8
7
  interface RequestOptions extends BaseRequestOptions {
9
8
  }
10
9
  }
@@ -3,8 +3,7 @@ import { type NormalizedClientOptionsWithAuth } from "../../../../BaseClient.js"
3
3
  import { V1Client } from "../resources/v1/client/Client.js";
4
4
  import { V2Client } from "../resources/v2/client/Client.js";
5
5
  export declare namespace ListenClient {
6
- interface Options extends BaseClientOptions {
7
- }
6
+ type Options = BaseClientOptions;
8
7
  }
9
8
  export declare class ListenClient {
10
9
  protected readonly _options: NormalizedClientOptionsWithAuth<ListenClient.Options>;
@@ -3,8 +3,7 @@ import { type NormalizedClientOptionsWithAuth } from "../../../../../../BaseClie
3
3
  import { MediaClient } from "../resources/media/client/Client.js";
4
4
  import { V1Socket } from "./Socket.js";
5
5
  export declare namespace V1Client {
6
- interface Options extends BaseClientOptions {
7
- }
6
+ type Options = BaseClientOptions;
8
7
  interface ConnectArgs {
9
8
  callback?: string;
10
9
  callback_method?: string;
@@ -62,86 +62,35 @@ class V1Client {
62
62
  return __awaiter(this, void 0, void 0, function* () {
63
63
  var _a, _b;
64
64
  const { callback, callback_method: callbackMethod, channels, diarize, dictation, encoding, endpointing, extra, interim_results: interimResults, keyterm, keywords, language, mip_opt_out: mipOptOut, model, multichannel, numerals, profanity_filter: profanityFilter, punctuate, redact, replace, sample_rate: sampleRate, search, smart_format: smartFormat, tag, utterance_end_ms: utteranceEndMs, vad_events: vadEvents, version, headers, debug, reconnectAttempts, } = args;
65
- const _queryParams = {};
66
- if (callback != null) {
67
- _queryParams.callback = callback;
68
- }
69
- if (callbackMethod != null) {
70
- _queryParams.callback_method = callbackMethod;
71
- }
72
- if (channels != null) {
73
- _queryParams.channels = channels;
74
- }
75
- if (diarize != null) {
76
- _queryParams.diarize = diarize;
77
- }
78
- if (dictation != null) {
79
- _queryParams.dictation = dictation;
80
- }
81
- if (encoding != null) {
82
- _queryParams.encoding = encoding;
83
- }
84
- if (endpointing != null) {
85
- _queryParams.endpointing = endpointing;
86
- }
87
- if (extra != null) {
88
- _queryParams.extra = extra;
89
- }
90
- if (interimResults != null) {
91
- _queryParams.interim_results = interimResults;
92
- }
93
- if (keyterm != null) {
94
- _queryParams.keyterm = keyterm;
95
- }
96
- if (keywords != null) {
97
- _queryParams.keywords = keywords;
98
- }
99
- if (language != null) {
100
- _queryParams.language = language;
101
- }
102
- if (mipOptOut != null) {
103
- _queryParams.mip_opt_out = mipOptOut;
104
- }
105
- _queryParams.model = model;
106
- if (multichannel != null) {
107
- _queryParams.multichannel = multichannel;
108
- }
109
- if (numerals != null) {
110
- _queryParams.numerals = numerals;
111
- }
112
- if (profanityFilter != null) {
113
- _queryParams.profanity_filter = profanityFilter;
114
- }
115
- if (punctuate != null) {
116
- _queryParams.punctuate = punctuate;
117
- }
118
- if (redact != null) {
119
- _queryParams.redact = redact;
120
- }
121
- if (replace != null) {
122
- _queryParams.replace = replace;
123
- }
124
- if (sampleRate != null) {
125
- _queryParams.sample_rate = sampleRate;
126
- }
127
- if (search != null) {
128
- _queryParams.search = search;
129
- }
130
- if (smartFormat != null) {
131
- _queryParams.smart_format = smartFormat;
132
- }
133
- if (tag != null) {
134
- _queryParams.tag = tag;
135
- }
136
- if (utteranceEndMs != null) {
137
- _queryParams.utterance_end_ms = utteranceEndMs;
138
- }
139
- if (vadEvents != null) {
140
- _queryParams.vad_events = vadEvents;
141
- }
142
- if (version != null) {
143
- _queryParams.version = version;
144
- }
65
+ const _queryParams = {
66
+ callback,
67
+ callback_method: callbackMethod,
68
+ channels,
69
+ diarize,
70
+ dictation,
71
+ encoding,
72
+ endpointing,
73
+ extra,
74
+ interim_results: interimResults,
75
+ keyterm,
76
+ keywords,
77
+ language,
78
+ mip_opt_out: mipOptOut,
79
+ model,
80
+ multichannel,
81
+ numerals,
82
+ profanity_filter: profanityFilter,
83
+ punctuate,
84
+ redact,
85
+ replace,
86
+ sample_rate: sampleRate,
87
+ search,
88
+ smart_format: smartFormat,
89
+ tag,
90
+ utterance_end_ms: utteranceEndMs,
91
+ vad_events: vadEvents,
92
+ version,
93
+ };
145
94
  const _headers = (0, headers_js_1.mergeHeaders)((0, headers_js_1.mergeOnlyDefinedHeaders)({ Authorization: args.Authorization }), headers);
146
95
  const socket = new core.ReconnectingWebSocket({
147
96
  url: core.url.join((_a = (yield core.Supplier.get(this._options.baseUrl))) !== null && _a !== void 0 ? _a : ((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.DeepgramEnvironment.Production).production, "/v1/listen"),
@@ -33,10 +33,10 @@ export declare class V1Socket {
33
33
  * ```
34
34
  */
35
35
  on<T extends keyof V1Socket.EventHandlers>(event: T, callback: V1Socket.EventHandlers[T]): void;
36
- sendListenV1Media(message: string): void;
37
- sendListenV1Finalize(message: Deepgram.listen.ListenV1Finalize): void;
38
- sendListenV1CloseStream(message: Deepgram.listen.ListenV1CloseStream): void;
39
- sendListenV1KeepAlive(message: Deepgram.listen.ListenV1KeepAlive): void;
36
+ sendMedia(message: ArrayBufferLike | Blob | ArrayBufferView): void;
37
+ sendFinalize(message: Deepgram.listen.ListenV1Finalize): void;
38
+ sendCloseStream(message: Deepgram.listen.ListenV1CloseStream): void;
39
+ sendKeepAlive(message: Deepgram.listen.ListenV1KeepAlive): void;
40
40
  /** Connect to the websocket and register event handlers. */
41
41
  connect(): V1Socket;
42
42
  /** Close the websocket and unregister event handlers. */
@@ -90,19 +90,19 @@ class V1Socket {
90
90
  on(event, callback) {
91
91
  this.eventHandlers[event] = callback;
92
92
  }
93
- sendListenV1Media(message) {
93
+ sendMedia(message) {
94
94
  this.assertSocketIsOpen();
95
- this.sendJson(message);
95
+ this.sendBinary(message);
96
96
  }
97
- sendListenV1Finalize(message) {
97
+ sendFinalize(message) {
98
98
  this.assertSocketIsOpen();
99
99
  this.sendJson(message);
100
100
  }
101
- sendListenV1CloseStream(message) {
101
+ sendCloseStream(message) {
102
102
  this.assertSocketIsOpen();
103
103
  this.sendJson(message);
104
104
  }
105
- sendListenV1KeepAlive(message) {
105
+ sendKeepAlive(message) {
106
106
  this.assertSocketIsOpen();
107
107
  this.sendJson(message);
108
108
  }
@@ -3,8 +3,7 @@ import { type NormalizedClientOptionsWithAuth } from "../../../../../../../../Ba
3
3
  import * as core from "../../../../../../../../core/index.js";
4
4
  import * as Deepgram from "../../../../../../../index.js";
5
5
  export declare namespace MediaClient {
6
- interface Options extends BaseClientOptions {
7
- }
6
+ type Options = BaseClientOptions;
8
7
  interface RequestOptions extends BaseRequestOptions {
9
8
  }
10
9
  }