@deepgram/sdk 5.0.0-beta.3 → 5.0.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 +234 -1472
- package/dist/browser/index.global.js +288 -192
- package/dist/cjs/BaseClient.js +3 -3
- package/dist/cjs/CustomClient.js +90 -107
- package/dist/cjs/api/resources/agent/exports.d.ts +3 -0
- package/dist/cjs/api/resources/agent/exports.js +22 -0
- package/dist/cjs/api/resources/agent/resources/v1/client/Client.d.ts +6 -0
- package/dist/cjs/api/resources/agent/resources/v1/client/Client.js +8 -3
- package/dist/cjs/api/resources/agent/resources/v1/client/Socket.d.ts +3 -2
- package/dist/cjs/api/resources/agent/resources/v1/client/Socket.js +4 -0
- package/dist/cjs/api/resources/agent/resources/v1/exports.d.ts +3 -0
- package/dist/cjs/api/resources/agent/resources/v1/exports.js +22 -0
- package/dist/cjs/api/resources/agent/resources/v1/resources/settings/exports.d.ts +3 -0
- package/dist/cjs/api/resources/agent/resources/v1/resources/settings/exports.js +22 -0
- package/dist/cjs/api/resources/agent/resources/v1/resources/settings/resources/think/exports.d.ts +3 -0
- package/dist/cjs/api/resources/agent/resources/v1/resources/settings/resources/think/exports.js +22 -0
- package/dist/cjs/api/resources/agent/resources/v1/resources/settings/resources/think/resources/models/exports.d.ts +2 -0
- package/dist/cjs/api/resources/agent/resources/v1/resources/settings/resources/think/resources/models/exports.js +21 -0
- package/dist/cjs/api/resources/agent/resources/v1/types/AgentV1ReceiveFunctionCallResponse.d.ts +1 -1
- package/dist/cjs/api/resources/agent/resources/v1/types/AgentV1SendFunctionCallResponse.d.ts +1 -1
- package/dist/cjs/api/resources/agent/resources/v1/types/AgentV1Settings.d.ts +21 -51
- package/dist/cjs/api/resources/agent/resources/v1/types/AgentV1SettingsAgentListenProvider.d.ts +5 -5
- package/dist/cjs/api/resources/agent/resources/v1/types/AgentV1ThinkUpdated.d.ts +4 -0
- package/dist/cjs/api/resources/agent/resources/v1/types/AgentV1ThinkUpdated.js +3 -0
- package/dist/cjs/api/resources/agent/resources/v1/types/AgentV1UpdateSpeak.d.ts +2 -11
- package/dist/cjs/api/resources/agent/resources/v1/types/AgentV1UpdateThink.d.ts +9 -0
- package/dist/cjs/api/resources/agent/resources/v1/types/AgentV1UpdateThink.js +3 -0
- package/dist/cjs/api/resources/agent/resources/v1/types/index.d.ts +2 -0
- package/dist/cjs/api/resources/agent/resources/v1/types/index.js +2 -0
- package/dist/cjs/api/resources/auth/exports.d.ts +3 -0
- package/dist/cjs/api/resources/auth/exports.js +22 -0
- package/dist/cjs/api/resources/auth/resources/v1/exports.d.ts +3 -0
- package/dist/cjs/api/resources/auth/resources/v1/exports.js +22 -0
- package/dist/cjs/api/resources/auth/resources/v1/resources/tokens/exports.d.ts +2 -0
- package/dist/cjs/api/resources/auth/resources/v1/resources/tokens/exports.js +21 -0
- package/dist/cjs/api/resources/listen/exports.d.ts +3 -0
- package/dist/cjs/api/resources/listen/exports.js +22 -0
- package/dist/cjs/api/resources/listen/resources/v1/client/Client.d.ts +35 -28
- package/dist/cjs/api/resources/listen/resources/v1/client/Client.js +40 -30
- package/dist/cjs/api/resources/listen/resources/v1/exports.d.ts +3 -0
- package/dist/cjs/api/resources/listen/resources/v1/exports.js +22 -0
- package/dist/cjs/api/resources/listen/resources/v1/resources/media/client/requests/MediaTranscribeRequestOctetStream.d.ts +0 -3
- package/dist/cjs/api/resources/listen/resources/v1/resources/media/exports.d.ts +2 -0
- package/dist/cjs/api/resources/listen/resources/v1/resources/media/exports.js +21 -0
- package/dist/cjs/api/resources/listen/resources/v1/types/ListenV1Results.d.ts +8 -8
- package/dist/cjs/api/resources/listen/resources/v2/client/Client.d.ts +16 -9
- package/dist/cjs/api/resources/listen/resources/v2/client/Client.js +29 -11
- package/dist/cjs/api/resources/listen/resources/v2/client/Socket.d.ts +3 -2
- package/dist/cjs/api/resources/listen/resources/v2/client/Socket.js +4 -0
- package/dist/cjs/api/resources/listen/resources/v2/exports.d.ts +2 -0
- package/dist/cjs/api/resources/listen/resources/v2/exports.js +21 -0
- package/dist/cjs/api/resources/listen/resources/v2/types/ListenV2Configure.d.ts +22 -0
- package/dist/cjs/api/resources/listen/resources/v2/types/ListenV2Configure.js +3 -0
- package/dist/cjs/api/resources/listen/resources/v2/types/ListenV2ConfigureFailure.d.ts +12 -0
- package/dist/cjs/api/resources/listen/resources/v2/types/ListenV2ConfigureFailure.js +3 -0
- package/dist/cjs/api/resources/listen/resources/v2/types/ListenV2ConfigureSuccess.d.ts +30 -0
- package/dist/cjs/api/resources/listen/resources/v2/types/ListenV2ConfigureSuccess.js +3 -0
- package/dist/cjs/api/resources/listen/resources/v2/types/index.d.ts +3 -0
- package/dist/cjs/api/resources/listen/resources/v2/types/index.js +3 -0
- package/dist/cjs/api/resources/manage/exports.d.ts +3 -0
- package/dist/cjs/api/resources/manage/exports.js +22 -0
- package/dist/cjs/api/resources/manage/resources/v1/exports.d.ts +3 -0
- package/dist/cjs/api/resources/manage/resources/v1/exports.js +22 -0
- package/dist/cjs/api/resources/manage/resources/v1/resources/models/exports.d.ts +2 -0
- package/dist/cjs/api/resources/manage/resources/v1/resources/models/exports.js +21 -0
- package/dist/cjs/api/resources/manage/resources/v1/resources/projects/exports.d.ts +3 -0
- package/dist/cjs/api/resources/manage/resources/v1/resources/projects/exports.js +22 -0
- package/dist/cjs/api/resources/manage/resources/v1/resources/projects/resources/billing/exports.d.ts +3 -0
- package/dist/cjs/api/resources/manage/resources/v1/resources/projects/resources/billing/exports.js +22 -0
- package/dist/cjs/api/resources/manage/resources/v1/resources/projects/resources/billing/resources/balances/exports.d.ts +2 -0
- package/dist/cjs/api/resources/manage/resources/v1/resources/projects/resources/billing/resources/balances/exports.js +21 -0
- package/dist/cjs/api/resources/manage/resources/v1/resources/projects/resources/billing/resources/breakdown/exports.d.ts +2 -0
- package/dist/cjs/api/resources/manage/resources/v1/resources/projects/resources/billing/resources/breakdown/exports.js +21 -0
- package/dist/cjs/api/resources/manage/resources/v1/resources/projects/resources/billing/resources/fields/exports.d.ts +2 -0
- package/dist/cjs/api/resources/manage/resources/v1/resources/projects/resources/billing/resources/fields/exports.js +21 -0
- package/dist/cjs/api/resources/manage/resources/v1/resources/projects/resources/billing/resources/purchases/exports.d.ts +2 -0
- package/dist/cjs/api/resources/manage/resources/v1/resources/projects/resources/billing/resources/purchases/exports.js +21 -0
- package/dist/cjs/api/resources/manage/resources/v1/resources/projects/resources/keys/exports.d.ts +2 -0
- package/dist/cjs/api/resources/manage/resources/v1/resources/projects/resources/keys/exports.js +21 -0
- package/dist/cjs/api/resources/manage/resources/v1/resources/projects/resources/members/exports.d.ts +3 -0
- package/dist/cjs/api/resources/manage/resources/v1/resources/projects/resources/members/exports.js +22 -0
- package/dist/cjs/api/resources/manage/resources/v1/resources/projects/resources/members/resources/invites/exports.d.ts +2 -0
- package/dist/cjs/api/resources/manage/resources/v1/resources/projects/resources/members/resources/invites/exports.js +21 -0
- package/dist/cjs/api/resources/manage/resources/v1/resources/projects/resources/members/resources/scopes/exports.d.ts +2 -0
- package/dist/cjs/api/resources/manage/resources/v1/resources/projects/resources/members/resources/scopes/exports.js +21 -0
- package/dist/cjs/api/resources/manage/resources/v1/resources/projects/resources/models/exports.d.ts +2 -0
- package/dist/cjs/api/resources/manage/resources/v1/resources/projects/resources/models/exports.js +21 -0
- package/dist/cjs/api/resources/manage/resources/v1/resources/projects/resources/requests/exports.d.ts +2 -0
- package/dist/cjs/api/resources/manage/resources/v1/resources/projects/resources/requests/exports.js +21 -0
- package/dist/cjs/api/resources/manage/resources/v1/resources/projects/resources/usage/client/Client.d.ts +2 -0
- package/dist/cjs/api/resources/manage/resources/v1/resources/projects/resources/usage/client/Client.js +2 -0
- package/dist/cjs/api/resources/manage/resources/v1/resources/projects/resources/usage/exports.d.ts +3 -0
- package/dist/cjs/api/resources/manage/resources/v1/resources/projects/resources/usage/exports.js +22 -0
- package/dist/cjs/api/resources/manage/resources/v1/resources/projects/resources/usage/resources/breakdown/exports.d.ts +2 -0
- package/dist/cjs/api/resources/manage/resources/v1/resources/projects/resources/usage/resources/breakdown/exports.js +21 -0
- package/dist/cjs/api/resources/manage/resources/v1/resources/projects/resources/usage/resources/fields/exports.d.ts +2 -0
- package/dist/cjs/api/resources/manage/resources/v1/resources/projects/resources/usage/resources/fields/exports.js +21 -0
- package/dist/cjs/api/resources/read/exports.d.ts +3 -0
- package/dist/cjs/api/resources/read/exports.js +22 -0
- package/dist/cjs/api/resources/read/resources/v1/exports.d.ts +3 -0
- package/dist/cjs/api/resources/read/resources/v1/exports.js +22 -0
- package/dist/cjs/api/resources/read/resources/v1/resources/text/exports.d.ts +2 -0
- package/dist/cjs/api/resources/read/resources/v1/resources/text/exports.js +21 -0
- package/dist/cjs/api/resources/selfHosted/exports.d.ts +3 -0
- package/dist/cjs/api/resources/selfHosted/exports.js +22 -0
- package/dist/cjs/api/resources/selfHosted/resources/v1/exports.d.ts +3 -0
- package/dist/cjs/api/resources/selfHosted/resources/v1/exports.js +22 -0
- package/dist/cjs/api/resources/selfHosted/resources/v1/resources/distributionCredentials/exports.d.ts +2 -0
- package/dist/cjs/api/resources/selfHosted/resources/v1/resources/distributionCredentials/exports.js +21 -0
- package/dist/cjs/api/resources/speak/exports.d.ts +3 -0
- package/dist/cjs/api/resources/speak/exports.js +22 -0
- package/dist/cjs/api/resources/speak/resources/v1/client/Client.d.ts +11 -4
- package/dist/cjs/api/resources/speak/resources/v1/client/Client.js +13 -7
- package/dist/cjs/api/resources/speak/resources/v1/exports.d.ts +3 -0
- package/dist/cjs/api/resources/speak/resources/v1/exports.js +22 -0
- package/dist/cjs/api/resources/speak/resources/v1/resources/audio/client/Client.d.ts +1 -0
- package/dist/cjs/api/resources/speak/resources/v1/resources/audio/client/Client.js +1 -0
- package/dist/cjs/api/resources/speak/resources/v1/resources/audio/exports.d.ts +2 -0
- package/dist/cjs/api/resources/speak/resources/v1/resources/audio/exports.js +21 -0
- package/dist/cjs/api/resources/speak/resources/v1/types/SpeakV1Metadata.d.ts +4 -2
- package/dist/cjs/api/types/Anthropic.d.ts +2 -2
- package/dist/cjs/api/types/AwsBedrockThinkProvider.d.ts +7 -7
- package/dist/cjs/api/types/AwsPollySpeakProvider.d.ts +2 -2
- package/dist/cjs/api/types/BillingBreakdownV1Response.d.ts +6 -6
- package/dist/cjs/api/types/Cartesia.d.ts +2 -2
- package/dist/cjs/api/types/CreateKeyV1Response.d.ts +6 -6
- package/dist/cjs/api/types/CreateProjectDistributionCredentialsV1Response.d.ts +1 -1
- package/dist/cjs/api/types/CreateProjectInviteV1Response.d.ts +1 -1
- package/dist/cjs/api/types/Deepgram.d.ts +1 -1
- package/dist/cjs/api/types/DeleteProjectInviteV1Response.d.ts +1 -1
- package/dist/cjs/api/types/DeleteProjectKeyV1Response.d.ts +1 -1
- package/dist/cjs/api/types/DeleteProjectMemberV1Response.d.ts +1 -1
- package/dist/cjs/api/types/DeleteProjectV1Response.d.ts +1 -1
- package/dist/cjs/api/types/ElevenLabsSpeakProvider.d.ts +3 -3
- package/dist/cjs/api/types/ErrorResponseLegacyError.d.ts +3 -3
- package/dist/cjs/api/types/ErrorResponseModernError.d.ts +4 -4
- package/dist/cjs/api/types/GetProjectBalanceV1Response.d.ts +4 -4
- package/dist/cjs/api/types/GetProjectDistributionCredentialsV1Response.d.ts +1 -1
- package/dist/cjs/api/types/GetProjectKeyV1Response.d.ts +13 -13
- package/dist/cjs/api/types/GetProjectRequestV1Response.d.ts +1 -1
- package/dist/cjs/api/types/GetProjectV1Response.d.ts +3 -3
- package/dist/cjs/api/types/Google.d.ts +2 -2
- package/dist/cjs/api/types/GrantV1Response.d.ts +1 -1
- package/dist/cjs/api/types/Groq.d.ts +2 -2
- package/dist/cjs/api/types/LeaveProjectV1Response.d.ts +1 -1
- package/dist/cjs/api/types/ListBillingFieldsV1Response.d.ts +4 -4
- package/dist/cjs/api/types/ListModelsV1Response.d.ts +2 -2
- package/dist/cjs/api/types/ListModelsV1ResponseSttModels.d.ts +9 -9
- package/dist/cjs/api/types/ListModelsV1ResponseTtsModels.d.ts +14 -14
- package/dist/cjs/api/types/ListProjectBalancesV1Response.d.ts +5 -5
- package/dist/cjs/api/types/ListProjectDistributionCredentialsV1Response.d.ts +2 -2
- package/dist/cjs/api/types/ListProjectInvitesV1Response.d.ts +3 -3
- package/dist/cjs/api/types/ListProjectKeysV1Response.d.ts +9 -9
- package/dist/cjs/api/types/ListProjectMemberScopesV1Response.d.ts +1 -1
- package/dist/cjs/api/types/ListProjectMembersV1Response.d.ts +3 -3
- package/dist/cjs/api/types/ListProjectPurchasesV1Response.d.ts +7 -7
- package/dist/cjs/api/types/ListProjectRequestsV1Response.d.ts +3 -3
- package/dist/cjs/api/types/ListProjectsV1Response.d.ts +3 -3
- package/dist/cjs/api/types/ListenV1ResponseMetadata.d.ts +18 -18
- package/dist/cjs/api/types/ListenV1ResponseResults.d.ts +5 -5
- package/dist/cjs/api/types/ListenV1ResponseResultsChannelsItem.d.ts +43 -43
- package/dist/cjs/api/types/ListenV1ResponseResultsSummary.d.ts +2 -2
- package/dist/cjs/api/types/ListenV1ResponseResultsUtterancesItem.d.ts +15 -15
- package/dist/cjs/api/types/OpenAiSpeakProvider.d.ts +27 -0
- package/dist/cjs/api/types/OpenAiSpeakProvider.js +21 -0
- package/dist/cjs/api/types/OpenAiThinkProvider.d.ts +23 -0
- package/dist/cjs/api/types/OpenAiThinkProvider.js +18 -0
- package/dist/cjs/api/types/ProjectRequestResponse.d.ts +9 -9
- package/dist/cjs/api/types/ReadV1ResponseMetadata.d.ts +20 -20
- package/dist/cjs/api/types/ReadV1ResponseResults.d.ts +4 -4
- package/dist/cjs/api/types/ReadV1ResponseResultsSummary.d.ts +3 -3
- package/dist/cjs/api/types/SharedIntents.d.ts +9 -9
- package/dist/cjs/api/types/SharedSentiments.d.ts +9 -9
- package/dist/cjs/api/types/SharedTopics.d.ts +9 -9
- package/dist/cjs/api/types/SpeakSettingsV1.d.ts +3 -3
- package/dist/cjs/api/types/SpeakSettingsV1Provider.d.ts +1 -1
- package/dist/cjs/api/types/ThinkSettingsV1.d.ts +15 -15
- package/dist/cjs/api/types/ThinkSettingsV1Provider.d.ts +19 -0
- package/dist/cjs/api/types/ThinkSettingsV1Provider.js +3 -0
- package/dist/cjs/api/types/UpdateProjectMemberScopesV1Response.d.ts +1 -1
- package/dist/cjs/api/types/UpdateProjectV1Response.d.ts +1 -1
- package/dist/cjs/api/types/UsageBreakdownV1Response.d.ts +9 -9
- package/dist/cjs/api/types/UsageFieldsV1Response.d.ts +8 -8
- package/dist/cjs/api/types/UsageV1Response.d.ts +5 -5
- package/dist/cjs/api/types/index.d.ts +3 -1
- package/dist/cjs/api/types/index.js +3 -1
- package/dist/cjs/core/fetcher/Fetcher.js +8 -2
- package/dist/cjs/core/fetcher/makeRequest.d.ts +6 -1
- package/dist/cjs/core/fetcher/makeRequest.js +30 -9
- package/dist/cjs/core/runtime/runtime.js +8 -7
- package/dist/cjs/core/websocket/ws.d.ts +4 -1
- package/dist/cjs/core/websocket/ws.js +32 -2
- package/dist/cjs/environments.d.ts +3 -3
- package/dist/cjs/environments.js +2 -2
- package/dist/cjs/index.d.ts +2 -0
- package/dist/cjs/index.js +6 -0
- package/dist/cjs/middleware/adapters/express.d.ts +103 -0
- package/dist/cjs/middleware/adapters/express.js +141 -0
- package/dist/cjs/middleware/adapters/fastify.d.ts +32 -0
- package/dist/cjs/middleware/adapters/fastify.js +194 -0
- package/dist/cjs/middleware/adapters/http.d.ts +153 -0
- package/dist/cjs/middleware/adapters/http.js +192 -0
- package/dist/cjs/middleware/core/ProxyHandler.d.ts +35 -0
- package/dist/cjs/middleware/core/ProxyHandler.js +225 -0
- package/dist/cjs/middleware/core/TokenManager.d.ts +29 -0
- package/dist/cjs/middleware/core/TokenManager.js +110 -0
- package/dist/cjs/middleware/core/WebSocketProxy.d.ts +32 -0
- package/dist/cjs/middleware/core/WebSocketProxy.js +169 -0
- package/dist/cjs/middleware/core/jwt.d.ts +71 -0
- package/dist/cjs/middleware/core/jwt.js +136 -0
- package/dist/cjs/middleware/core/types.d.ts +37 -0
- package/dist/cjs/middleware/core/types.js +2 -0
- package/dist/cjs/middleware/index.d.ts +55 -0
- package/dist/cjs/middleware/index.js +75 -0
- package/dist/cjs/tests/manual/test-custom-baseurl.js +124 -0
- package/dist/cjs/version.d.ts +1 -1
- package/dist/cjs/version.js +1 -1
- package/dist/esm/BaseClient.mjs +3 -3
- package/dist/esm/CustomClient.mjs +90 -107
- package/dist/esm/api/resources/agent/exports.d.mts +3 -0
- package/dist/esm/api/resources/agent/exports.mjs +4 -0
- package/dist/esm/api/resources/agent/resources/v1/client/Client.d.mts +6 -0
- package/dist/esm/api/resources/agent/resources/v1/client/Client.mjs +8 -3
- package/dist/esm/api/resources/agent/resources/v1/client/Socket.d.mts +3 -2
- package/dist/esm/api/resources/agent/resources/v1/client/Socket.mjs +4 -0
- package/dist/esm/api/resources/agent/resources/v1/exports.d.mts +3 -0
- package/dist/esm/api/resources/agent/resources/v1/exports.mjs +4 -0
- package/dist/esm/api/resources/agent/resources/v1/resources/settings/exports.d.mts +3 -0
- package/dist/esm/api/resources/agent/resources/v1/resources/settings/exports.mjs +4 -0
- package/dist/esm/api/resources/agent/resources/v1/resources/settings/resources/think/exports.d.mts +3 -0
- package/dist/esm/api/resources/agent/resources/v1/resources/settings/resources/think/exports.mjs +4 -0
- package/dist/esm/api/resources/agent/resources/v1/resources/settings/resources/think/resources/models/exports.d.mts +2 -0
- package/dist/esm/api/resources/agent/resources/v1/resources/settings/resources/think/resources/models/exports.mjs +3 -0
- package/dist/esm/api/resources/agent/resources/v1/types/AgentV1ReceiveFunctionCallResponse.d.mts +1 -1
- package/dist/esm/api/resources/agent/resources/v1/types/AgentV1SendFunctionCallResponse.d.mts +1 -1
- package/dist/esm/api/resources/agent/resources/v1/types/AgentV1Settings.d.mts +21 -51
- package/dist/esm/api/resources/agent/resources/v1/types/AgentV1SettingsAgentListenProvider.d.mts +5 -5
- package/dist/esm/api/resources/agent/resources/v1/types/AgentV1ThinkUpdated.d.mts +4 -0
- package/dist/esm/api/resources/agent/resources/v1/types/AgentV1ThinkUpdated.mjs +2 -0
- package/dist/esm/api/resources/agent/resources/v1/types/AgentV1UpdateSpeak.d.mts +2 -11
- package/dist/esm/api/resources/agent/resources/v1/types/AgentV1UpdateThink.d.mts +9 -0
- package/dist/esm/api/resources/agent/resources/v1/types/AgentV1UpdateThink.mjs +2 -0
- package/dist/esm/api/resources/agent/resources/v1/types/index.d.mts +2 -0
- package/dist/esm/api/resources/agent/resources/v1/types/index.mjs +2 -0
- package/dist/esm/api/resources/auth/exports.d.mts +3 -0
- package/dist/esm/api/resources/auth/exports.mjs +4 -0
- package/dist/esm/api/resources/auth/resources/v1/exports.d.mts +3 -0
- package/dist/esm/api/resources/auth/resources/v1/exports.mjs +4 -0
- package/dist/esm/api/resources/auth/resources/v1/resources/tokens/exports.d.mts +2 -0
- package/dist/esm/api/resources/auth/resources/v1/resources/tokens/exports.mjs +3 -0
- package/dist/esm/api/resources/listen/exports.d.mts +3 -0
- package/dist/esm/api/resources/listen/exports.mjs +4 -0
- package/dist/esm/api/resources/listen/resources/v1/client/Client.d.mts +35 -28
- package/dist/esm/api/resources/listen/resources/v1/client/Client.mjs +40 -30
- package/dist/esm/api/resources/listen/resources/v1/exports.d.mts +3 -0
- package/dist/esm/api/resources/listen/resources/v1/exports.mjs +4 -0
- package/dist/esm/api/resources/listen/resources/v1/resources/media/client/requests/MediaTranscribeRequestOctetStream.d.mts +0 -3
- package/dist/esm/api/resources/listen/resources/v1/resources/media/exports.d.mts +2 -0
- package/dist/esm/api/resources/listen/resources/v1/resources/media/exports.mjs +3 -0
- package/dist/esm/api/resources/listen/resources/v1/types/ListenV1Results.d.mts +8 -8
- package/dist/esm/api/resources/listen/resources/v2/client/Client.d.mts +16 -9
- package/dist/esm/api/resources/listen/resources/v2/client/Client.mjs +29 -11
- package/dist/esm/api/resources/listen/resources/v2/client/Socket.d.mts +3 -2
- package/dist/esm/api/resources/listen/resources/v2/client/Socket.mjs +4 -0
- package/dist/esm/api/resources/listen/resources/v2/exports.d.mts +2 -0
- package/dist/esm/api/resources/listen/resources/v2/exports.mjs +3 -0
- package/dist/esm/api/resources/listen/resources/v2/types/ListenV2Configure.d.mts +22 -0
- package/dist/esm/api/resources/listen/resources/v2/types/ListenV2Configure.mjs +2 -0
- package/dist/esm/api/resources/listen/resources/v2/types/ListenV2ConfigureFailure.d.mts +12 -0
- package/dist/esm/api/resources/listen/resources/v2/types/ListenV2ConfigureFailure.mjs +2 -0
- package/dist/esm/api/resources/listen/resources/v2/types/ListenV2ConfigureSuccess.d.mts +30 -0
- package/dist/esm/api/resources/listen/resources/v2/types/ListenV2ConfigureSuccess.mjs +2 -0
- package/dist/esm/api/resources/listen/resources/v2/types/index.d.mts +3 -0
- package/dist/esm/api/resources/listen/resources/v2/types/index.mjs +3 -0
- package/dist/esm/api/resources/manage/exports.d.mts +3 -0
- package/dist/esm/api/resources/manage/exports.mjs +4 -0
- package/dist/esm/api/resources/manage/resources/v1/exports.d.mts +3 -0
- package/dist/esm/api/resources/manage/resources/v1/exports.mjs +4 -0
- package/dist/esm/api/resources/manage/resources/v1/resources/models/exports.d.mts +2 -0
- package/dist/esm/api/resources/manage/resources/v1/resources/models/exports.mjs +3 -0
- package/dist/esm/api/resources/manage/resources/v1/resources/projects/exports.d.mts +3 -0
- package/dist/esm/api/resources/manage/resources/v1/resources/projects/exports.mjs +4 -0
- package/dist/esm/api/resources/manage/resources/v1/resources/projects/resources/billing/exports.d.mts +3 -0
- package/dist/esm/api/resources/manage/resources/v1/resources/projects/resources/billing/exports.mjs +4 -0
- package/dist/esm/api/resources/manage/resources/v1/resources/projects/resources/billing/resources/balances/exports.d.mts +2 -0
- package/dist/esm/api/resources/manage/resources/v1/resources/projects/resources/billing/resources/balances/exports.mjs +3 -0
- package/dist/esm/api/resources/manage/resources/v1/resources/projects/resources/billing/resources/breakdown/exports.d.mts +2 -0
- package/dist/esm/api/resources/manage/resources/v1/resources/projects/resources/billing/resources/breakdown/exports.mjs +3 -0
- package/dist/esm/api/resources/manage/resources/v1/resources/projects/resources/billing/resources/fields/exports.d.mts +2 -0
- package/dist/esm/api/resources/manage/resources/v1/resources/projects/resources/billing/resources/fields/exports.mjs +3 -0
- package/dist/esm/api/resources/manage/resources/v1/resources/projects/resources/billing/resources/purchases/exports.d.mts +2 -0
- package/dist/esm/api/resources/manage/resources/v1/resources/projects/resources/billing/resources/purchases/exports.mjs +3 -0
- package/dist/esm/api/resources/manage/resources/v1/resources/projects/resources/keys/exports.d.mts +2 -0
- package/dist/esm/api/resources/manage/resources/v1/resources/projects/resources/keys/exports.mjs +3 -0
- package/dist/esm/api/resources/manage/resources/v1/resources/projects/resources/members/exports.d.mts +3 -0
- package/dist/esm/api/resources/manage/resources/v1/resources/projects/resources/members/exports.mjs +4 -0
- package/dist/esm/api/resources/manage/resources/v1/resources/projects/resources/members/resources/invites/exports.d.mts +2 -0
- package/dist/esm/api/resources/manage/resources/v1/resources/projects/resources/members/resources/invites/exports.mjs +3 -0
- package/dist/esm/api/resources/manage/resources/v1/resources/projects/resources/members/resources/scopes/exports.d.mts +2 -0
- package/dist/esm/api/resources/manage/resources/v1/resources/projects/resources/members/resources/scopes/exports.mjs +3 -0
- package/dist/esm/api/resources/manage/resources/v1/resources/projects/resources/models/exports.d.mts +2 -0
- package/dist/esm/api/resources/manage/resources/v1/resources/projects/resources/models/exports.mjs +3 -0
- package/dist/esm/api/resources/manage/resources/v1/resources/projects/resources/requests/exports.d.mts +2 -0
- package/dist/esm/api/resources/manage/resources/v1/resources/projects/resources/requests/exports.mjs +3 -0
- package/dist/esm/api/resources/manage/resources/v1/resources/projects/resources/usage/client/Client.d.mts +2 -0
- package/dist/esm/api/resources/manage/resources/v1/resources/projects/resources/usage/client/Client.mjs +2 -0
- package/dist/esm/api/resources/manage/resources/v1/resources/projects/resources/usage/exports.d.mts +3 -0
- package/dist/esm/api/resources/manage/resources/v1/resources/projects/resources/usage/exports.mjs +4 -0
- package/dist/esm/api/resources/manage/resources/v1/resources/projects/resources/usage/resources/breakdown/exports.d.mts +2 -0
- package/dist/esm/api/resources/manage/resources/v1/resources/projects/resources/usage/resources/breakdown/exports.mjs +3 -0
- package/dist/esm/api/resources/manage/resources/v1/resources/projects/resources/usage/resources/fields/exports.d.mts +2 -0
- package/dist/esm/api/resources/manage/resources/v1/resources/projects/resources/usage/resources/fields/exports.mjs +3 -0
- package/dist/esm/api/resources/read/exports.d.mts +3 -0
- package/dist/esm/api/resources/read/exports.mjs +4 -0
- package/dist/esm/api/resources/read/resources/v1/exports.d.mts +3 -0
- package/dist/esm/api/resources/read/resources/v1/exports.mjs +4 -0
- package/dist/esm/api/resources/read/resources/v1/resources/text/exports.d.mts +2 -0
- package/dist/esm/api/resources/read/resources/v1/resources/text/exports.mjs +3 -0
- package/dist/esm/api/resources/selfHosted/exports.d.mts +3 -0
- package/dist/esm/api/resources/selfHosted/exports.mjs +4 -0
- package/dist/esm/api/resources/selfHosted/resources/v1/exports.d.mts +3 -0
- package/dist/esm/api/resources/selfHosted/resources/v1/exports.mjs +4 -0
- package/dist/esm/api/resources/selfHosted/resources/v1/resources/distributionCredentials/exports.d.mts +2 -0
- package/dist/esm/api/resources/selfHosted/resources/v1/resources/distributionCredentials/exports.mjs +3 -0
- package/dist/esm/api/resources/speak/exports.d.mts +3 -0
- package/dist/esm/api/resources/speak/exports.mjs +4 -0
- package/dist/esm/api/resources/speak/resources/v1/client/Client.d.mts +11 -4
- package/dist/esm/api/resources/speak/resources/v1/client/Client.mjs +13 -7
- package/dist/esm/api/resources/speak/resources/v1/exports.d.mts +3 -0
- package/dist/esm/api/resources/speak/resources/v1/exports.mjs +4 -0
- package/dist/esm/api/resources/speak/resources/v1/resources/audio/client/Client.d.mts +1 -0
- package/dist/esm/api/resources/speak/resources/v1/resources/audio/client/Client.mjs +1 -0
- package/dist/esm/api/resources/speak/resources/v1/resources/audio/exports.d.mts +2 -0
- package/dist/esm/api/resources/speak/resources/v1/resources/audio/exports.mjs +3 -0
- package/dist/esm/api/resources/speak/resources/v1/types/SpeakV1Metadata.d.mts +4 -2
- package/dist/esm/api/types/Anthropic.d.mts +2 -2
- package/dist/esm/api/types/AwsBedrockThinkProvider.d.mts +7 -7
- package/dist/esm/api/types/AwsPollySpeakProvider.d.mts +2 -2
- package/dist/esm/api/types/BillingBreakdownV1Response.d.mts +6 -6
- package/dist/esm/api/types/Cartesia.d.mts +2 -2
- package/dist/esm/api/types/CreateKeyV1Response.d.mts +6 -6
- package/dist/esm/api/types/CreateProjectDistributionCredentialsV1Response.d.mts +1 -1
- package/dist/esm/api/types/CreateProjectInviteV1Response.d.mts +1 -1
- package/dist/esm/api/types/Deepgram.d.mts +1 -1
- package/dist/esm/api/types/DeleteProjectInviteV1Response.d.mts +1 -1
- package/dist/esm/api/types/DeleteProjectKeyV1Response.d.mts +1 -1
- package/dist/esm/api/types/DeleteProjectMemberV1Response.d.mts +1 -1
- package/dist/esm/api/types/DeleteProjectV1Response.d.mts +1 -1
- package/dist/esm/api/types/ElevenLabsSpeakProvider.d.mts +3 -3
- package/dist/esm/api/types/ErrorResponseLegacyError.d.mts +3 -3
- package/dist/esm/api/types/ErrorResponseModernError.d.mts +4 -4
- package/dist/esm/api/types/GetProjectBalanceV1Response.d.mts +4 -4
- package/dist/esm/api/types/GetProjectDistributionCredentialsV1Response.d.mts +1 -1
- package/dist/esm/api/types/GetProjectKeyV1Response.d.mts +13 -13
- package/dist/esm/api/types/GetProjectRequestV1Response.d.mts +1 -1
- package/dist/esm/api/types/GetProjectV1Response.d.mts +3 -3
- package/dist/esm/api/types/Google.d.mts +2 -2
- package/dist/esm/api/types/GrantV1Response.d.mts +1 -1
- package/dist/esm/api/types/Groq.d.mts +2 -2
- package/dist/esm/api/types/LeaveProjectV1Response.d.mts +1 -1
- package/dist/esm/api/types/ListBillingFieldsV1Response.d.mts +4 -4
- package/dist/esm/api/types/ListModelsV1Response.d.mts +2 -2
- package/dist/esm/api/types/ListModelsV1ResponseSttModels.d.mts +9 -9
- package/dist/esm/api/types/ListModelsV1ResponseTtsModels.d.mts +14 -14
- package/dist/esm/api/types/ListProjectBalancesV1Response.d.mts +5 -5
- package/dist/esm/api/types/ListProjectDistributionCredentialsV1Response.d.mts +2 -2
- package/dist/esm/api/types/ListProjectInvitesV1Response.d.mts +3 -3
- package/dist/esm/api/types/ListProjectKeysV1Response.d.mts +9 -9
- package/dist/esm/api/types/ListProjectMemberScopesV1Response.d.mts +1 -1
- package/dist/esm/api/types/ListProjectMembersV1Response.d.mts +3 -3
- package/dist/esm/api/types/ListProjectPurchasesV1Response.d.mts +7 -7
- package/dist/esm/api/types/ListProjectRequestsV1Response.d.mts +3 -3
- package/dist/esm/api/types/ListProjectsV1Response.d.mts +3 -3
- package/dist/esm/api/types/ListenV1ResponseMetadata.d.mts +18 -18
- package/dist/esm/api/types/ListenV1ResponseResults.d.mts +5 -5
- package/dist/esm/api/types/ListenV1ResponseResultsChannelsItem.d.mts +43 -43
- package/dist/esm/api/types/ListenV1ResponseResultsSummary.d.mts +2 -2
- package/dist/esm/api/types/ListenV1ResponseResultsUtterancesItem.d.mts +15 -15
- package/dist/esm/api/types/OpenAiSpeakProvider.d.mts +27 -0
- package/dist/esm/api/types/OpenAiSpeakProvider.mjs +18 -0
- package/dist/esm/api/types/OpenAiThinkProvider.d.mts +23 -0
- package/dist/esm/api/types/OpenAiThinkProvider.mjs +15 -0
- package/dist/esm/api/types/ProjectRequestResponse.d.mts +9 -9
- package/dist/esm/api/types/ReadV1ResponseMetadata.d.mts +20 -20
- package/dist/esm/api/types/ReadV1ResponseResults.d.mts +4 -4
- package/dist/esm/api/types/ReadV1ResponseResultsSummary.d.mts +3 -3
- package/dist/esm/api/types/SharedIntents.d.mts +9 -9
- package/dist/esm/api/types/SharedSentiments.d.mts +9 -9
- package/dist/esm/api/types/SharedTopics.d.mts +9 -9
- package/dist/esm/api/types/SpeakSettingsV1.d.mts +3 -3
- package/dist/esm/api/types/SpeakSettingsV1Provider.d.mts +1 -1
- package/dist/esm/api/types/ThinkSettingsV1.d.mts +15 -15
- package/dist/esm/api/types/ThinkSettingsV1Provider.d.mts +19 -0
- package/dist/esm/api/types/ThinkSettingsV1Provider.mjs +2 -0
- package/dist/esm/api/types/UpdateProjectMemberScopesV1Response.d.mts +1 -1
- package/dist/esm/api/types/UpdateProjectV1Response.d.mts +1 -1
- package/dist/esm/api/types/UsageBreakdownV1Response.d.mts +9 -9
- package/dist/esm/api/types/UsageFieldsV1Response.d.mts +8 -8
- package/dist/esm/api/types/UsageV1Response.d.mts +5 -5
- package/dist/esm/api/types/index.d.mts +3 -1
- package/dist/esm/api/types/index.mjs +3 -1
- package/dist/esm/core/fetcher/Fetcher.mjs +8 -2
- package/dist/esm/core/fetcher/makeRequest.d.mts +6 -1
- package/dist/esm/core/fetcher/makeRequest.mjs +28 -9
- package/dist/esm/core/runtime/runtime.mjs +8 -7
- package/dist/esm/core/websocket/ws.d.mts +4 -1
- package/dist/esm/core/websocket/ws.mjs +32 -2
- package/dist/esm/environments.d.mts +3 -3
- package/dist/esm/environments.mjs +2 -2
- package/dist/esm/index.d.mts +2 -0
- package/dist/esm/index.mjs +6 -0
- package/dist/esm/middleware/adapters/express.d.mts +103 -0
- package/dist/esm/middleware/adapters/express.mjs +136 -0
- package/dist/esm/middleware/adapters/fastify.d.mts +32 -0
- package/dist/esm/middleware/adapters/fastify.mjs +157 -0
- package/dist/esm/middleware/adapters/http.d.mts +153 -0
- package/dist/esm/middleware/adapters/http.mjs +187 -0
- package/dist/esm/middleware/core/ProxyHandler.d.mts +35 -0
- package/dist/esm/middleware/core/ProxyHandler.mjs +218 -0
- package/dist/esm/middleware/core/TokenManager.d.mts +29 -0
- package/dist/esm/middleware/core/TokenManager.mjs +106 -0
- package/dist/esm/middleware/core/WebSocketProxy.d.mts +32 -0
- package/dist/esm/middleware/core/WebSocketProxy.mjs +162 -0
- package/dist/esm/middleware/core/jwt.d.mts +71 -0
- package/dist/esm/middleware/core/jwt.mjs +99 -0
- package/dist/esm/middleware/core/types.d.mts +37 -0
- package/dist/esm/middleware/core/types.mjs +1 -0
- package/dist/esm/middleware/index.d.mts +55 -0
- package/dist/esm/middleware/index.mjs +59 -0
- package/dist/esm/version.d.mts +1 -1
- package/dist/esm/version.mjs +1 -1
- package/package.json +433 -4
- package/reference.md +1 -0
|
@@ -142,16 +142,57 @@ var Deepgram = (() => {
|
|
|
142
142
|
}
|
|
143
143
|
});
|
|
144
144
|
|
|
145
|
+
// (disabled):crypto
|
|
146
|
+
var require_crypto = __commonJS({
|
|
147
|
+
"(disabled):crypto"() {
|
|
148
|
+
"use strict";
|
|
149
|
+
}
|
|
150
|
+
});
|
|
151
|
+
|
|
145
152
|
// src/index.ts
|
|
146
153
|
var index_exports = {};
|
|
147
154
|
__export(index_exports, {
|
|
155
|
+
Anthropic: () => Anthropic,
|
|
156
|
+
AwsBedrockThinkProvider: () => AwsBedrockThinkProvider,
|
|
157
|
+
AwsPollySpeakProvider: () => AwsPollySpeakProvider,
|
|
158
|
+
Cartesia: () => Cartesia,
|
|
148
159
|
Deepgram: () => api_exports,
|
|
149
160
|
DeepgramClient: () => CustomDeepgramClient,
|
|
150
161
|
DeepgramEnvironment: () => DeepgramEnvironment,
|
|
151
162
|
DeepgramError: () => DeepgramError,
|
|
152
163
|
DeepgramTimeoutError: () => DeepgramTimeoutError,
|
|
153
164
|
DefaultDeepgramClient: () => DeepgramClient,
|
|
154
|
-
|
|
165
|
+
ElevenLabsSpeakProvider: () => ElevenLabsSpeakProvider,
|
|
166
|
+
Google: () => Google,
|
|
167
|
+
ListBillingFieldsV1Response: () => ListBillingFieldsV1Response,
|
|
168
|
+
ListenV1CallbackMethod: () => ListenV1CallbackMethod,
|
|
169
|
+
ListenV1DetectEntities: () => ListenV1DetectEntities,
|
|
170
|
+
ListenV1Diarize: () => ListenV1Diarize,
|
|
171
|
+
ListenV1Dictation: () => ListenV1Dictation,
|
|
172
|
+
ListenV1Encoding: () => ListenV1Encoding,
|
|
173
|
+
ListenV1InterimResults: () => ListenV1InterimResults,
|
|
174
|
+
ListenV1Model: () => ListenV1Model,
|
|
175
|
+
ListenV1Multichannel: () => ListenV1Multichannel,
|
|
176
|
+
ListenV1Numerals: () => ListenV1Numerals,
|
|
177
|
+
ListenV1ProfanityFilter: () => ListenV1ProfanityFilter,
|
|
178
|
+
ListenV1Punctuate: () => ListenV1Punctuate,
|
|
179
|
+
ListenV1Redact: () => ListenV1Redact,
|
|
180
|
+
ListenV1SmartFormat: () => ListenV1SmartFormat,
|
|
181
|
+
ListenV1VadEvents: () => ListenV1VadEvents,
|
|
182
|
+
ListenV2Encoding: () => ListenV2Encoding,
|
|
183
|
+
OpenAiSpeakProvider: () => OpenAiSpeakProvider,
|
|
184
|
+
OpenAiThinkProvider: () => OpenAiThinkProvider,
|
|
185
|
+
SpeakV1Encoding: () => SpeakV1Encoding,
|
|
186
|
+
SpeakV1Model: () => SpeakV1Model,
|
|
187
|
+
SpeakV1SampleRate: () => SpeakV1SampleRate,
|
|
188
|
+
agent: () => agent_exports,
|
|
189
|
+
auth: () => auth_exports,
|
|
190
|
+
listen: () => listen_exports,
|
|
191
|
+
logging: () => logging,
|
|
192
|
+
manage: () => manage_exports,
|
|
193
|
+
read: () => read_exports,
|
|
194
|
+
selfHosted: () => selfHosted_exports,
|
|
195
|
+
speak: () => speak_exports
|
|
155
196
|
});
|
|
156
197
|
|
|
157
198
|
// src/api/index.ts
|
|
@@ -181,7 +222,8 @@ var Deepgram = (() => {
|
|
|
181
222
|
ListenV1SmartFormat: () => ListenV1SmartFormat,
|
|
182
223
|
ListenV1VadEvents: () => ListenV1VadEvents,
|
|
183
224
|
ListenV2Encoding: () => ListenV2Encoding,
|
|
184
|
-
|
|
225
|
+
OpenAiSpeakProvider: () => OpenAiSpeakProvider,
|
|
226
|
+
OpenAiThinkProvider: () => OpenAiThinkProvider,
|
|
185
227
|
SpeakV1Encoding: () => SpeakV1Encoding,
|
|
186
228
|
SpeakV1Model: () => SpeakV1Model,
|
|
187
229
|
SpeakV1SampleRate: () => SpeakV1SampleRate,
|
|
@@ -1306,14 +1348,14 @@ var Deepgram = (() => {
|
|
|
1306
1348
|
OggOpus: "ogg-opus"
|
|
1307
1349
|
};
|
|
1308
1350
|
|
|
1309
|
-
// src/api/types/
|
|
1310
|
-
var
|
|
1311
|
-
((
|
|
1312
|
-
|
|
1351
|
+
// src/api/types/OpenAiSpeakProvider.ts
|
|
1352
|
+
var OpenAiSpeakProvider;
|
|
1353
|
+
((OpenAiSpeakProvider2) => {
|
|
1354
|
+
OpenAiSpeakProvider2.Model = {
|
|
1313
1355
|
Tts1: "tts-1",
|
|
1314
1356
|
Tts1Hd: "tts-1-hd"
|
|
1315
1357
|
};
|
|
1316
|
-
|
|
1358
|
+
OpenAiSpeakProvider2.Voice = {
|
|
1317
1359
|
Alloy: "alloy",
|
|
1318
1360
|
Echo: "echo",
|
|
1319
1361
|
Fable: "fable",
|
|
@@ -1321,7 +1363,22 @@ var Deepgram = (() => {
|
|
|
1321
1363
|
Nova: "nova",
|
|
1322
1364
|
Shimmer: "shimmer"
|
|
1323
1365
|
};
|
|
1324
|
-
})(
|
|
1366
|
+
})(OpenAiSpeakProvider || (OpenAiSpeakProvider = {}));
|
|
1367
|
+
|
|
1368
|
+
// src/api/types/OpenAiThinkProvider.ts
|
|
1369
|
+
var OpenAiThinkProvider;
|
|
1370
|
+
((OpenAiThinkProvider2) => {
|
|
1371
|
+
OpenAiThinkProvider2.Model = {
|
|
1372
|
+
Gpt5: "gpt-5",
|
|
1373
|
+
Gpt5Mini: "gpt-5-mini",
|
|
1374
|
+
Gpt5Nano: "gpt-5-nano",
|
|
1375
|
+
Gpt41: "gpt-4.1",
|
|
1376
|
+
Gpt41Mini: "gpt-4.1-mini",
|
|
1377
|
+
Gpt41Nano: "gpt-4.1-nano",
|
|
1378
|
+
Gpt4O: "gpt-4o",
|
|
1379
|
+
Gpt4OMini: "gpt-4o-mini"
|
|
1380
|
+
};
|
|
1381
|
+
})(OpenAiThinkProvider || (OpenAiThinkProvider = {}));
|
|
1325
1382
|
|
|
1326
1383
|
// src/api/types/SpeakV1Encoding.ts
|
|
1327
1384
|
var SpeakV1Encoding = {
|
|
@@ -1848,7 +1905,20 @@ var Deepgram = (() => {
|
|
|
1848
1905
|
}
|
|
1849
1906
|
|
|
1850
1907
|
// src/core/fetcher/makeRequest.ts
|
|
1851
|
-
var
|
|
1908
|
+
var _cacheNoStoreSupported;
|
|
1909
|
+
function isCacheNoStoreSupported() {
|
|
1910
|
+
if (_cacheNoStoreSupported != null) {
|
|
1911
|
+
return _cacheNoStoreSupported;
|
|
1912
|
+
}
|
|
1913
|
+
try {
|
|
1914
|
+
new Request("http://localhost", { cache: "no-store" });
|
|
1915
|
+
_cacheNoStoreSupported = true;
|
|
1916
|
+
} catch (e) {
|
|
1917
|
+
_cacheNoStoreSupported = false;
|
|
1918
|
+
}
|
|
1919
|
+
return _cacheNoStoreSupported;
|
|
1920
|
+
}
|
|
1921
|
+
var makeRequest = (fetchFn, url, method, headers, requestBody, timeoutMs, abortSignal, withCredentials, duplex, disableCache) => __async(null, null, function* () {
|
|
1852
1922
|
const signals = [];
|
|
1853
1923
|
let timeoutAbortId;
|
|
1854
1924
|
if (timeoutMs != null) {
|
|
@@ -1860,7 +1930,7 @@ var Deepgram = (() => {
|
|
|
1860
1930
|
signals.push(abortSignal);
|
|
1861
1931
|
}
|
|
1862
1932
|
const newSignals = anySignal(signals);
|
|
1863
|
-
const response = yield fetchFn(url, {
|
|
1933
|
+
const response = yield fetchFn(url, __spreadValues({
|
|
1864
1934
|
method,
|
|
1865
1935
|
headers,
|
|
1866
1936
|
body: requestBody,
|
|
@@ -1868,7 +1938,7 @@ var Deepgram = (() => {
|
|
|
1868
1938
|
credentials: withCredentials ? "include" : void 0,
|
|
1869
1939
|
// @ts-ignore
|
|
1870
1940
|
duplex
|
|
1871
|
-
});
|
|
1941
|
+
}, disableCache && isCacheNoStoreSupported() ? { cache: "no-store" } : {}));
|
|
1872
1942
|
if (timeoutAbortId != null) {
|
|
1873
1943
|
clearTimeout(timeoutAbortId);
|
|
1874
1944
|
}
|
|
@@ -2082,7 +2152,7 @@ var Deepgram = (() => {
|
|
|
2082
2152
|
const newHeaders = new Headers();
|
|
2083
2153
|
newHeaders.set(
|
|
2084
2154
|
"Accept",
|
|
2085
|
-
args.responseType === "json" ? "application/json" : args.responseType === "text" ? "text/plain" : "*/*"
|
|
2155
|
+
args.responseType === "json" ? "application/json" : args.responseType === "text" ? "text/plain" : args.responseType === "sse" ? "text/event-stream" : "*/*"
|
|
2086
2156
|
);
|
|
2087
2157
|
if (args.body !== void 0 && args.contentType != null) {
|
|
2088
2158
|
newHeaders.set("Content-Type", args.contentType);
|
|
@@ -2137,7 +2207,8 @@ var Deepgram = (() => {
|
|
|
2137
2207
|
args.timeoutMs,
|
|
2138
2208
|
args.abortSignal,
|
|
2139
2209
|
args.withCredentials,
|
|
2140
|
-
args.duplex
|
|
2210
|
+
args.duplex,
|
|
2211
|
+
args.responseType === "streaming" || args.responseType === "sse"
|
|
2141
2212
|
);
|
|
2142
2213
|
}),
|
|
2143
2214
|
args.maxRetries
|
|
@@ -2587,12 +2658,13 @@ var Deepgram = (() => {
|
|
|
2587
2658
|
type: "react-native"
|
|
2588
2659
|
};
|
|
2589
2660
|
}
|
|
2590
|
-
const
|
|
2661
|
+
const _process = typeof process !== "undefined" ? process : void 0;
|
|
2662
|
+
const isNode = typeof _process !== "undefined" && typeof ((_e = _process.versions) == null ? void 0 : _e.node) === "string";
|
|
2591
2663
|
if (isNode) {
|
|
2592
2664
|
return {
|
|
2593
2665
|
type: "node",
|
|
2594
|
-
version:
|
|
2595
|
-
parsedVersion: Number(
|
|
2666
|
+
version: _process.versions.node,
|
|
2667
|
+
parsedVersion: Number(_process.versions.node.split(".")[0])
|
|
2596
2668
|
};
|
|
2597
2669
|
}
|
|
2598
2670
|
return {
|
|
@@ -2739,7 +2811,7 @@ var Deepgram = (() => {
|
|
|
2739
2811
|
debug: false
|
|
2740
2812
|
};
|
|
2741
2813
|
var _ReconnectingWebSocket = class _ReconnectingWebSocket {
|
|
2742
|
-
constructor({ url, protocols, options, headers, queryParameters }) {
|
|
2814
|
+
constructor({ url, protocols, options, headers, queryParameters, abortSignal }) {
|
|
2743
2815
|
this._listeners = {
|
|
2744
2816
|
error: [],
|
|
2745
2817
|
message: [],
|
|
@@ -2773,6 +2845,23 @@ var Deepgram = (() => {
|
|
|
2773
2845
|
* this indicates that the connection is ready to send and receive data
|
|
2774
2846
|
*/
|
|
2775
2847
|
this.onopen = null;
|
|
2848
|
+
this._handleAbort = () => {
|
|
2849
|
+
if (this._closeCalled) {
|
|
2850
|
+
return;
|
|
2851
|
+
}
|
|
2852
|
+
this._debug("abort signal fired");
|
|
2853
|
+
this._shouldReconnect = false;
|
|
2854
|
+
this._closeCalled = true;
|
|
2855
|
+
this._clearTimeouts();
|
|
2856
|
+
if (this._ws) {
|
|
2857
|
+
this._removeListeners();
|
|
2858
|
+
try {
|
|
2859
|
+
this._ws.close(1e3, "aborted");
|
|
2860
|
+
this._handleClose(new CloseEvent(1e3, "aborted", this));
|
|
2861
|
+
} catch (_error) {
|
|
2862
|
+
}
|
|
2863
|
+
}
|
|
2864
|
+
};
|
|
2776
2865
|
this._handleOpen = (event) => {
|
|
2777
2866
|
this._debug("open event");
|
|
2778
2867
|
const { minUptime = DEFAULT_OPTIONS.minUptime } = this._options;
|
|
@@ -2825,6 +2914,10 @@ var Deepgram = (() => {
|
|
|
2825
2914
|
this._options = options != null ? options : DEFAULT_OPTIONS;
|
|
2826
2915
|
this._headers = headers;
|
|
2827
2916
|
this._queryParameters = queryParameters;
|
|
2917
|
+
this._abortSignal = abortSignal;
|
|
2918
|
+
if (this._abortSignal) {
|
|
2919
|
+
this._abortSignal.addEventListener("abort", this._handleAbort, { once: true });
|
|
2920
|
+
}
|
|
2828
2921
|
if (this._options.startClosed) {
|
|
2829
2922
|
this._shouldReconnect = false;
|
|
2830
2923
|
}
|
|
@@ -3012,9 +3105,14 @@ var Deepgram = (() => {
|
|
|
3012
3105
|
throw Error("Invalid URL");
|
|
3013
3106
|
}
|
|
3014
3107
|
_connect() {
|
|
3108
|
+
var _a;
|
|
3015
3109
|
if (this._connectLock || !this._shouldReconnect) {
|
|
3016
3110
|
return;
|
|
3017
3111
|
}
|
|
3112
|
+
if ((_a = this._abortSignal) == null ? void 0 : _a.aborted) {
|
|
3113
|
+
this._debug("connect aborted");
|
|
3114
|
+
return;
|
|
3115
|
+
}
|
|
3018
3116
|
this._connectLock = true;
|
|
3019
3117
|
const {
|
|
3020
3118
|
maxRetries = DEFAULT_OPTIONS.maxRetries,
|
|
@@ -3032,7 +3130,9 @@ var Deepgram = (() => {
|
|
|
3032
3130
|
throw Error("No valid WebSocket class provided");
|
|
3033
3131
|
}
|
|
3034
3132
|
this._wait().then(() => this._getNextUrl(this._url)).then((url) => {
|
|
3035
|
-
|
|
3133
|
+
var _a2;
|
|
3134
|
+
if (this._closeCalled || ((_a2 = this._abortSignal) == null ? void 0 : _a2.aborted)) {
|
|
3135
|
+
this._connectLock = false;
|
|
3036
3136
|
return;
|
|
3037
3137
|
}
|
|
3038
3138
|
const options = {};
|
|
@@ -3177,9 +3277,9 @@ var Deepgram = (() => {
|
|
|
3177
3277
|
const headers = mergeHeaders(
|
|
3178
3278
|
{
|
|
3179
3279
|
"X-Fern-Language": "JavaScript",
|
|
3180
|
-
"X-Fern-SDK-Name": "",
|
|
3181
|
-
"X-Fern-SDK-Version": "
|
|
3182
|
-
"User-Agent": "/
|
|
3280
|
+
"X-Fern-SDK-Name": "@deepgram/sdk",
|
|
3281
|
+
"X-Fern-SDK-Version": "4.11.4",
|
|
3282
|
+
"User-Agent": "@deepgram/sdk/4.11.4",
|
|
3183
3283
|
"X-Fern-Runtime": RUNTIME.type,
|
|
3184
3284
|
"X-Fern-Runtime-Version": RUNTIME.version
|
|
3185
3285
|
},
|
|
@@ -3207,13 +3307,13 @@ var Deepgram = (() => {
|
|
|
3207
3307
|
var DeepgramEnvironment = {
|
|
3208
3308
|
Production: {
|
|
3209
3309
|
base: "https://api.deepgram.com",
|
|
3210
|
-
|
|
3211
|
-
|
|
3310
|
+
agent: "wss://agent.deepgram.com",
|
|
3311
|
+
production: "wss://api.deepgram.com"
|
|
3212
3312
|
},
|
|
3213
3313
|
Agent: {
|
|
3214
3314
|
base: "https://agent.deepgram.com",
|
|
3215
|
-
|
|
3216
|
-
|
|
3315
|
+
agent: "wss://agent.deepgram.com",
|
|
3316
|
+
production: "wss://api.deepgram.com"
|
|
3217
3317
|
}
|
|
3218
3318
|
};
|
|
3219
3319
|
|
|
@@ -3382,6 +3482,10 @@ var Deepgram = (() => {
|
|
|
3382
3482
|
this.assertSocketIsOpen();
|
|
3383
3483
|
this.sendJson(message);
|
|
3384
3484
|
}
|
|
3485
|
+
sendUpdateThink(message) {
|
|
3486
|
+
this.assertSocketIsOpen();
|
|
3487
|
+
this.sendJson(message);
|
|
3488
|
+
}
|
|
3385
3489
|
sendInjectUserMessage(message) {
|
|
3386
3490
|
this.assertSocketIsOpen();
|
|
3387
3491
|
this.sendJson(message);
|
|
@@ -3472,7 +3576,7 @@ var Deepgram = (() => {
|
|
|
3472
3576
|
connect(args) {
|
|
3473
3577
|
return __async(this, null, function* () {
|
|
3474
3578
|
var _a, _b;
|
|
3475
|
-
const { headers, debug, reconnectAttempts } = args;
|
|
3579
|
+
const { queryParams, headers, debug, reconnectAttempts, connectionTimeoutInSeconds, abortSignal } = args;
|
|
3476
3580
|
const _headers = mergeHeaders(
|
|
3477
3581
|
mergeOnlyDefinedHeaders({ Authorization: args.Authorization }),
|
|
3478
3582
|
headers
|
|
@@ -3483,9 +3587,14 @@ var Deepgram = (() => {
|
|
|
3483
3587
|
"/v1/agent/converse"
|
|
3484
3588
|
),
|
|
3485
3589
|
protocols: [],
|
|
3486
|
-
queryParameters: {},
|
|
3590
|
+
queryParameters: queryParams != null ? queryParams : {},
|
|
3487
3591
|
headers: _headers,
|
|
3488
|
-
options: {
|
|
3592
|
+
options: {
|
|
3593
|
+
debug: debug != null ? debug : false,
|
|
3594
|
+
maxRetries: reconnectAttempts != null ? reconnectAttempts : 30,
|
|
3595
|
+
connectionTimeout: connectionTimeoutInSeconds != null ? connectionTimeoutInSeconds * 1e3 : void 0
|
|
3596
|
+
},
|
|
3597
|
+
abortSignal
|
|
3489
3598
|
});
|
|
3490
3599
|
return new V1Socket({ socket });
|
|
3491
3600
|
});
|
|
@@ -4068,39 +4177,42 @@ var Deepgram = (() => {
|
|
|
4068
4177
|
utterance_end_ms: utteranceEndMs,
|
|
4069
4178
|
vad_events: vadEvents,
|
|
4070
4179
|
version,
|
|
4180
|
+
queryParams,
|
|
4071
4181
|
headers,
|
|
4072
4182
|
debug,
|
|
4073
|
-
reconnectAttempts
|
|
4183
|
+
reconnectAttempts,
|
|
4184
|
+
connectionTimeoutInSeconds,
|
|
4185
|
+
abortSignal
|
|
4074
4186
|
} = args;
|
|
4075
4187
|
const _queryParams = {
|
|
4076
|
-
callback,
|
|
4077
|
-
callback_method: callbackMethod,
|
|
4078
|
-
channels,
|
|
4079
|
-
detect_entities: detectEntities,
|
|
4080
|
-
diarize,
|
|
4081
|
-
dictation,
|
|
4082
|
-
encoding,
|
|
4083
|
-
endpointing,
|
|
4084
|
-
extra,
|
|
4085
|
-
interim_results: interimResults,
|
|
4086
|
-
keyterm,
|
|
4087
|
-
keywords,
|
|
4088
|
-
language,
|
|
4089
|
-
mip_opt_out: mipOptOut,
|
|
4188
|
+
callback: callback != null ? typeof callback === "string" ? callback : toJson(callback) : void 0,
|
|
4189
|
+
callback_method: callbackMethod != null ? callbackMethod : void 0,
|
|
4190
|
+
channels: channels != null ? typeof channels === "string" ? channels : toJson(channels) : void 0,
|
|
4191
|
+
detect_entities: detectEntities != null ? detectEntities : void 0,
|
|
4192
|
+
diarize: diarize != null ? diarize : void 0,
|
|
4193
|
+
dictation: dictation != null ? dictation : void 0,
|
|
4194
|
+
encoding: encoding != null ? encoding : void 0,
|
|
4195
|
+
endpointing: endpointing != null ? typeof endpointing === "string" ? endpointing : toJson(endpointing) : void 0,
|
|
4196
|
+
extra: extra != null ? typeof extra === "string" ? extra : toJson(extra) : void 0,
|
|
4197
|
+
interim_results: interimResults != null ? interimResults : void 0,
|
|
4198
|
+
keyterm: keyterm != null ? typeof keyterm === "string" ? keyterm : toJson(keyterm) : void 0,
|
|
4199
|
+
keywords: keywords != null ? typeof keywords === "string" ? keywords : toJson(keywords) : void 0,
|
|
4200
|
+
language: language != null ? typeof language === "string" ? language : toJson(language) : void 0,
|
|
4201
|
+
mip_opt_out: mipOptOut != null ? typeof mipOptOut === "string" ? mipOptOut : toJson(mipOptOut) : void 0,
|
|
4090
4202
|
model,
|
|
4091
|
-
multichannel,
|
|
4092
|
-
numerals,
|
|
4093
|
-
profanity_filter: profanityFilter,
|
|
4094
|
-
punctuate,
|
|
4095
|
-
redact,
|
|
4096
|
-
replace,
|
|
4097
|
-
sample_rate: sampleRate,
|
|
4098
|
-
search,
|
|
4099
|
-
smart_format: smartFormat,
|
|
4100
|
-
tag,
|
|
4101
|
-
utterance_end_ms: utteranceEndMs,
|
|
4102
|
-
vad_events: vadEvents,
|
|
4103
|
-
version
|
|
4203
|
+
multichannel: multichannel != null ? multichannel : void 0,
|
|
4204
|
+
numerals: numerals != null ? numerals : void 0,
|
|
4205
|
+
profanity_filter: profanityFilter != null ? profanityFilter : void 0,
|
|
4206
|
+
punctuate: punctuate != null ? punctuate : void 0,
|
|
4207
|
+
redact: redact != null ? redact : void 0,
|
|
4208
|
+
replace: replace != null ? typeof replace === "string" ? replace : toJson(replace) : void 0,
|
|
4209
|
+
sample_rate: sampleRate != null ? typeof sampleRate === "string" ? sampleRate : toJson(sampleRate) : void 0,
|
|
4210
|
+
search: search != null ? typeof search === "string" ? search : toJson(search) : void 0,
|
|
4211
|
+
smart_format: smartFormat != null ? smartFormat : void 0,
|
|
4212
|
+
tag: tag != null ? typeof tag === "string" ? tag : toJson(tag) : void 0,
|
|
4213
|
+
utterance_end_ms: utteranceEndMs != null ? typeof utteranceEndMs === "string" ? utteranceEndMs : toJson(utteranceEndMs) : void 0,
|
|
4214
|
+
vad_events: vadEvents != null ? vadEvents : void 0,
|
|
4215
|
+
version: version != null ? typeof version === "string" ? version : toJson(version) : void 0
|
|
4104
4216
|
};
|
|
4105
4217
|
const _headers = mergeHeaders(
|
|
4106
4218
|
mergeOnlyDefinedHeaders({ Authorization: args.Authorization }),
|
|
@@ -4112,9 +4224,14 @@ var Deepgram = (() => {
|
|
|
4112
4224
|
"/v1/listen"
|
|
4113
4225
|
),
|
|
4114
4226
|
protocols: [],
|
|
4115
|
-
queryParameters: _queryParams,
|
|
4227
|
+
queryParameters: __spreadValues(__spreadValues({}, _queryParams), queryParams),
|
|
4116
4228
|
headers: _headers,
|
|
4117
|
-
options: {
|
|
4229
|
+
options: {
|
|
4230
|
+
debug: debug != null ? debug : false,
|
|
4231
|
+
maxRetries: reconnectAttempts != null ? reconnectAttempts : 30,
|
|
4232
|
+
connectionTimeout: connectionTimeoutInSeconds != null ? connectionTimeoutInSeconds * 1e3 : void 0
|
|
4233
|
+
},
|
|
4234
|
+
abortSignal
|
|
4118
4235
|
});
|
|
4119
4236
|
return new V1Socket2({ socket });
|
|
4120
4237
|
});
|
|
@@ -4174,6 +4291,10 @@ var Deepgram = (() => {
|
|
|
4174
4291
|
this.assertSocketIsOpen();
|
|
4175
4292
|
this.sendJson(message);
|
|
4176
4293
|
}
|
|
4294
|
+
sendListenV2Configure(message) {
|
|
4295
|
+
this.assertSocketIsOpen();
|
|
4296
|
+
this.sendJson(message);
|
|
4297
|
+
}
|
|
4177
4298
|
/** Connect to the websocket and register event handlers. */
|
|
4178
4299
|
connect() {
|
|
4179
4300
|
this.socket.reconnect();
|
|
@@ -4246,20 +4367,23 @@ var Deepgram = (() => {
|
|
|
4246
4367
|
keyterm,
|
|
4247
4368
|
mip_opt_out: mipOptOut,
|
|
4248
4369
|
tag,
|
|
4370
|
+
queryParams,
|
|
4249
4371
|
headers,
|
|
4250
4372
|
debug,
|
|
4251
|
-
reconnectAttempts
|
|
4373
|
+
reconnectAttempts,
|
|
4374
|
+
connectionTimeoutInSeconds,
|
|
4375
|
+
abortSignal
|
|
4252
4376
|
} = args;
|
|
4253
4377
|
const _queryParams = {
|
|
4254
4378
|
model,
|
|
4255
|
-
encoding,
|
|
4256
|
-
sample_rate: sampleRate,
|
|
4257
|
-
eager_eot_threshold: eagerEotThreshold,
|
|
4258
|
-
eot_threshold: eotThreshold,
|
|
4259
|
-
eot_timeout_ms: eotTimeoutMs,
|
|
4260
|
-
keyterm,
|
|
4261
|
-
mip_opt_out: mipOptOut,
|
|
4262
|
-
tag
|
|
4379
|
+
encoding: encoding != null ? encoding : void 0,
|
|
4380
|
+
sample_rate: sampleRate != null ? typeof sampleRate === "string" ? sampleRate : toJson(sampleRate) : void 0,
|
|
4381
|
+
eager_eot_threshold: eagerEotThreshold != null ? typeof eagerEotThreshold === "string" ? eagerEotThreshold : toJson(eagerEotThreshold) : void 0,
|
|
4382
|
+
eot_threshold: eotThreshold != null ? typeof eotThreshold === "string" ? eotThreshold : toJson(eotThreshold) : void 0,
|
|
4383
|
+
eot_timeout_ms: eotTimeoutMs != null ? typeof eotTimeoutMs === "string" ? eotTimeoutMs : toJson(eotTimeoutMs) : void 0,
|
|
4384
|
+
keyterm: keyterm != null ? typeof keyterm === "string" ? keyterm : toJson(keyterm) : void 0,
|
|
4385
|
+
mip_opt_out: mipOptOut != null ? typeof mipOptOut === "string" ? mipOptOut : toJson(mipOptOut) : void 0,
|
|
4386
|
+
tag: tag != null ? typeof tag === "string" ? tag : toJson(tag) : void 0
|
|
4263
4387
|
};
|
|
4264
4388
|
const _headers = mergeHeaders(
|
|
4265
4389
|
mergeOnlyDefinedHeaders({ Authorization: args.Authorization }),
|
|
@@ -4271,9 +4395,14 @@ var Deepgram = (() => {
|
|
|
4271
4395
|
"/v2/listen"
|
|
4272
4396
|
),
|
|
4273
4397
|
protocols: [],
|
|
4274
|
-
queryParameters: _queryParams,
|
|
4398
|
+
queryParameters: __spreadValues(__spreadValues({}, _queryParams), queryParams),
|
|
4275
4399
|
headers: _headers,
|
|
4276
|
-
options: {
|
|
4400
|
+
options: {
|
|
4401
|
+
debug: debug != null ? debug : false,
|
|
4402
|
+
maxRetries: reconnectAttempts != null ? reconnectAttempts : 30,
|
|
4403
|
+
connectionTimeout: connectionTimeoutInSeconds != null ? connectionTimeoutInSeconds * 1e3 : void 0
|
|
4404
|
+
},
|
|
4405
|
+
abortSignal
|
|
4277
4406
|
});
|
|
4278
4407
|
return new V2Socket({ socket });
|
|
4279
4408
|
});
|
|
@@ -6159,6 +6288,8 @@ var Deepgram = (() => {
|
|
|
6159
6288
|
return (_a = this._fields) != null ? _a : this._fields = new FieldsClient2(this._options);
|
|
6160
6289
|
}
|
|
6161
6290
|
/**
|
|
6291
|
+
* @deprecated
|
|
6292
|
+
*
|
|
6162
6293
|
* Retrieves the usage for a specific project. Use Get Project Usage Breakdown for a more comprehensive usage summary.
|
|
6163
6294
|
*
|
|
6164
6295
|
* @param {string} project_id - The unique identifier of the project
|
|
@@ -7144,6 +7275,7 @@ var Deepgram = (() => {
|
|
|
7144
7275
|
}
|
|
7145
7276
|
/**
|
|
7146
7277
|
* Convert text into natural-sounding speech using Deepgram's TTS REST API
|
|
7278
|
+
*
|
|
7147
7279
|
* @throws {@link Deepgram.BadRequestError}
|
|
7148
7280
|
*/
|
|
7149
7281
|
generate(request, requestOptions) {
|
|
@@ -7360,15 +7492,18 @@ var Deepgram = (() => {
|
|
|
7360
7492
|
mip_opt_out: mipOptOut,
|
|
7361
7493
|
model,
|
|
7362
7494
|
sample_rate: sampleRate,
|
|
7495
|
+
queryParams,
|
|
7363
7496
|
headers,
|
|
7364
7497
|
debug,
|
|
7365
|
-
reconnectAttempts
|
|
7498
|
+
reconnectAttempts,
|
|
7499
|
+
connectionTimeoutInSeconds,
|
|
7500
|
+
abortSignal
|
|
7366
7501
|
} = args;
|
|
7367
7502
|
const _queryParams = {
|
|
7368
|
-
encoding,
|
|
7369
|
-
mip_opt_out: mipOptOut,
|
|
7370
|
-
model,
|
|
7371
|
-
sample_rate: sampleRate
|
|
7503
|
+
encoding: encoding != null ? encoding : void 0,
|
|
7504
|
+
mip_opt_out: mipOptOut != null ? typeof mipOptOut === "string" ? mipOptOut : toJson(mipOptOut) : void 0,
|
|
7505
|
+
model: model != null ? model : void 0,
|
|
7506
|
+
sample_rate: sampleRate != null ? sampleRate : void 0
|
|
7372
7507
|
};
|
|
7373
7508
|
const _headers = mergeHeaders(
|
|
7374
7509
|
mergeOnlyDefinedHeaders({ Authorization: args.Authorization }),
|
|
@@ -7380,9 +7515,14 @@ var Deepgram = (() => {
|
|
|
7380
7515
|
"/v1/speak"
|
|
7381
7516
|
),
|
|
7382
7517
|
protocols: [],
|
|
7383
|
-
queryParameters: _queryParams,
|
|
7518
|
+
queryParameters: __spreadValues(__spreadValues({}, _queryParams), queryParams),
|
|
7384
7519
|
headers: _headers,
|
|
7385
|
-
options: {
|
|
7520
|
+
options: {
|
|
7521
|
+
debug: debug != null ? debug : false,
|
|
7522
|
+
maxRetries: reconnectAttempts != null ? reconnectAttempts : 30,
|
|
7523
|
+
connectionTimeout: connectionTimeoutInSeconds != null ? connectionTimeoutInSeconds * 1e3 : void 0
|
|
7524
|
+
},
|
|
7525
|
+
abortSignal
|
|
7386
7526
|
});
|
|
7387
7527
|
return new V1Socket3({ socket });
|
|
7388
7528
|
});
|
|
@@ -7437,12 +7577,35 @@ var Deepgram = (() => {
|
|
|
7437
7577
|
|
|
7438
7578
|
// src/CustomClient.ts
|
|
7439
7579
|
var DEFAULT_CONNECTION_TIMEOUT_MS = 1e4;
|
|
7580
|
+
var WEBSOCKET_OPTION_KEYS = /* @__PURE__ */ new Set([
|
|
7581
|
+
"Authorization",
|
|
7582
|
+
"headers",
|
|
7583
|
+
"debug",
|
|
7584
|
+
"reconnectAttempts",
|
|
7585
|
+
"connectionTimeoutInSeconds",
|
|
7586
|
+
"abortSignal",
|
|
7587
|
+
"queryParams"
|
|
7588
|
+
]);
|
|
7440
7589
|
var NodeWebSocket2;
|
|
7441
|
-
|
|
7442
|
-
|
|
7443
|
-
|
|
7444
|
-
|
|
7445
|
-
|
|
7590
|
+
var _wsInitialized = false;
|
|
7591
|
+
function loadNodeWebSocket() {
|
|
7592
|
+
return __async(this, null, function* () {
|
|
7593
|
+
var _a;
|
|
7594
|
+
if (_wsInitialized) return;
|
|
7595
|
+
_wsInitialized = true;
|
|
7596
|
+
try {
|
|
7597
|
+
if (typeof __require !== "undefined") {
|
|
7598
|
+
let ws = require_browser();
|
|
7599
|
+
NodeWebSocket2 = ws.WebSocket || ws.default || ws;
|
|
7600
|
+
} else if (typeof process !== "undefined" && ((_a = process.versions) == null ? void 0 : _a.node)) {
|
|
7601
|
+
const dynamicImport = new Function("specifier", "return import(specifier)");
|
|
7602
|
+
const ws = yield dynamicImport("ws");
|
|
7603
|
+
NodeWebSocket2 = ws.WebSocket || ws.default || ws;
|
|
7604
|
+
}
|
|
7605
|
+
} catch (e) {
|
|
7606
|
+
NodeWebSocket2 = void 0;
|
|
7607
|
+
}
|
|
7608
|
+
});
|
|
7446
7609
|
}
|
|
7447
7610
|
function generateUUID() {
|
|
7448
7611
|
if (typeof crypto !== "undefined" && typeof crypto.randomUUID === "function") {
|
|
@@ -7450,7 +7613,7 @@ var Deepgram = (() => {
|
|
|
7450
7613
|
}
|
|
7451
7614
|
if (RUNTIME.type === "node") {
|
|
7452
7615
|
try {
|
|
7453
|
-
const nodeCrypto =
|
|
7616
|
+
const nodeCrypto = require_crypto();
|
|
7454
7617
|
return nodeCrypto.randomUUID();
|
|
7455
7618
|
} catch (e) {
|
|
7456
7619
|
}
|
|
@@ -7589,6 +7752,18 @@ var Deepgram = (() => {
|
|
|
7589
7752
|
return resolved;
|
|
7590
7753
|
});
|
|
7591
7754
|
}
|
|
7755
|
+
function buildQueryParams(args) {
|
|
7756
|
+
const result = {};
|
|
7757
|
+
for (const [key, value] of Object.entries(args)) {
|
|
7758
|
+
if (!WEBSOCKET_OPTION_KEYS.has(key) && value != null) {
|
|
7759
|
+
result[key] = value;
|
|
7760
|
+
}
|
|
7761
|
+
}
|
|
7762
|
+
if (args.queryParams != null && typeof args.queryParams === "object") {
|
|
7763
|
+
Object.assign(result, args.queryParams);
|
|
7764
|
+
}
|
|
7765
|
+
return result;
|
|
7766
|
+
}
|
|
7592
7767
|
function getWebSocketOptions(headers) {
|
|
7593
7768
|
const options = {};
|
|
7594
7769
|
const isBrowser = RUNTIME.type === "browser" || RUNTIME.type === "web-worker";
|
|
@@ -7679,9 +7854,12 @@ var Deepgram = (() => {
|
|
|
7679
7854
|
queryParams,
|
|
7680
7855
|
headers,
|
|
7681
7856
|
debug,
|
|
7682
|
-
reconnectAttempts
|
|
7857
|
+
reconnectAttempts,
|
|
7858
|
+
connectionTimeoutInSeconds,
|
|
7859
|
+
abortSignal
|
|
7683
7860
|
}) {
|
|
7684
7861
|
var _a, _b, _c, _d, _e, _f;
|
|
7862
|
+
yield loadNodeWebSocket();
|
|
7685
7863
|
const authRequest = yield (_a = options.authProvider) == null ? void 0 : _a.getAuthRequest();
|
|
7686
7864
|
const mergedHeaders = mergeHeaders(
|
|
7687
7865
|
(_b = options.headers) != null ? _b : {},
|
|
@@ -7701,23 +7879,26 @@ var Deepgram = (() => {
|
|
|
7701
7879
|
debug: debug != null ? debug : false,
|
|
7702
7880
|
maxRetries: reconnectAttempts != null ? reconnectAttempts : 30,
|
|
7703
7881
|
startClosed: true,
|
|
7704
|
-
connectionTimeout: DEFAULT_CONNECTION_TIMEOUT_MS
|
|
7705
|
-
}
|
|
7882
|
+
connectionTimeout: connectionTimeoutInSeconds != null ? connectionTimeoutInSeconds * 1e3 : DEFAULT_CONNECTION_TIMEOUT_MS
|
|
7883
|
+
},
|
|
7884
|
+
abortSignal
|
|
7706
7885
|
});
|
|
7707
7886
|
});
|
|
7708
7887
|
}
|
|
7709
7888
|
var WrappedAgentV1Client = class extends V1Client {
|
|
7710
7889
|
connect() {
|
|
7711
7890
|
return __async(this, arguments, function* (args = {}) {
|
|
7712
|
-
const { headers, debug, reconnectAttempts } = args;
|
|
7891
|
+
const { headers, debug, reconnectAttempts, connectionTimeoutInSeconds, abortSignal } = args;
|
|
7713
7892
|
const socket = yield createWebSocketConnection({
|
|
7714
7893
|
options: this._options,
|
|
7715
7894
|
urlPath: "/v1/agent/converse",
|
|
7716
7895
|
environmentKey: "agent",
|
|
7717
|
-
queryParams:
|
|
7896
|
+
queryParams: buildQueryParams(args),
|
|
7718
7897
|
headers,
|
|
7719
7898
|
debug,
|
|
7720
|
-
reconnectAttempts
|
|
7899
|
+
reconnectAttempts,
|
|
7900
|
+
connectionTimeoutInSeconds,
|
|
7901
|
+
abortSignal
|
|
7721
7902
|
});
|
|
7722
7903
|
return new WrappedAgentV1Socket({ socket });
|
|
7723
7904
|
});
|
|
@@ -7766,74 +7947,17 @@ var Deepgram = (() => {
|
|
|
7766
7947
|
var WrappedListenV1Client = class extends V1Client3 {
|
|
7767
7948
|
connect(args) {
|
|
7768
7949
|
return __async(this, null, function* () {
|
|
7769
|
-
const {
|
|
7770
|
-
callback,
|
|
7771
|
-
callback_method: callbackMethod,
|
|
7772
|
-
channels,
|
|
7773
|
-
diarize,
|
|
7774
|
-
dictation,
|
|
7775
|
-
encoding,
|
|
7776
|
-
endpointing,
|
|
7777
|
-
extra,
|
|
7778
|
-
interim_results: interimResults,
|
|
7779
|
-
keyterm,
|
|
7780
|
-
keywords,
|
|
7781
|
-
language,
|
|
7782
|
-
mip_opt_out: mipOptOut,
|
|
7783
|
-
model,
|
|
7784
|
-
multichannel,
|
|
7785
|
-
numerals,
|
|
7786
|
-
profanity_filter: profanityFilter,
|
|
7787
|
-
punctuate,
|
|
7788
|
-
redact,
|
|
7789
|
-
replace,
|
|
7790
|
-
sample_rate: sampleRate,
|
|
7791
|
-
search,
|
|
7792
|
-
smart_format: smartFormat,
|
|
7793
|
-
tag,
|
|
7794
|
-
utterance_end_ms: utteranceEndMs,
|
|
7795
|
-
vad_events: vadEvents,
|
|
7796
|
-
version,
|
|
7797
|
-
headers,
|
|
7798
|
-
debug,
|
|
7799
|
-
reconnectAttempts
|
|
7800
|
-
} = args;
|
|
7801
|
-
const _queryParams = {};
|
|
7802
|
-
if (callback != null) _queryParams.callback = callback;
|
|
7803
|
-
if (callbackMethod != null) _queryParams.callback_method = callbackMethod;
|
|
7804
|
-
if (channels != null) _queryParams.channels = channels;
|
|
7805
|
-
if (diarize != null) _queryParams.diarize = diarize;
|
|
7806
|
-
if (dictation != null) _queryParams.dictation = dictation;
|
|
7807
|
-
if (encoding != null) _queryParams.encoding = encoding;
|
|
7808
|
-
if (endpointing != null) _queryParams.endpointing = endpointing;
|
|
7809
|
-
if (extra != null) _queryParams.extra = extra;
|
|
7810
|
-
if (interimResults != null) _queryParams.interim_results = interimResults;
|
|
7811
|
-
if (keyterm != null) _queryParams.keyterm = keyterm;
|
|
7812
|
-
if (keywords != null) _queryParams.keywords = keywords;
|
|
7813
|
-
if (language != null) _queryParams.language = language;
|
|
7814
|
-
if (mipOptOut != null) _queryParams.mip_opt_out = mipOptOut;
|
|
7815
|
-
_queryParams.model = model;
|
|
7816
|
-
if (multichannel != null) _queryParams.multichannel = multichannel;
|
|
7817
|
-
if (numerals != null) _queryParams.numerals = numerals;
|
|
7818
|
-
if (profanityFilter != null) _queryParams.profanity_filter = profanityFilter;
|
|
7819
|
-
if (punctuate != null) _queryParams.punctuate = punctuate;
|
|
7820
|
-
if (redact != null) _queryParams.redact = redact;
|
|
7821
|
-
if (replace != null) _queryParams.replace = replace;
|
|
7822
|
-
if (sampleRate != null) _queryParams.sample_rate = sampleRate;
|
|
7823
|
-
if (search != null) _queryParams.search = search;
|
|
7824
|
-
if (smartFormat != null) _queryParams.smart_format = smartFormat;
|
|
7825
|
-
if (tag != null) _queryParams.tag = tag;
|
|
7826
|
-
if (utteranceEndMs != null) _queryParams.utterance_end_ms = utteranceEndMs;
|
|
7827
|
-
if (vadEvents != null) _queryParams.vad_events = vadEvents;
|
|
7828
|
-
if (version != null) _queryParams.version = version;
|
|
7950
|
+
const { headers, debug, reconnectAttempts, connectionTimeoutInSeconds, abortSignal } = args;
|
|
7829
7951
|
const socket = yield createWebSocketConnection({
|
|
7830
7952
|
options: this._options,
|
|
7831
7953
|
urlPath: "/v1/listen",
|
|
7832
7954
|
environmentKey: "production",
|
|
7833
|
-
queryParams:
|
|
7955
|
+
queryParams: buildQueryParams(args),
|
|
7834
7956
|
headers,
|
|
7835
7957
|
debug,
|
|
7836
|
-
reconnectAttempts
|
|
7958
|
+
reconnectAttempts,
|
|
7959
|
+
connectionTimeoutInSeconds,
|
|
7960
|
+
abortSignal
|
|
7837
7961
|
});
|
|
7838
7962
|
return new WrappedListenV1Socket({ socket });
|
|
7839
7963
|
});
|
|
@@ -7882,38 +8006,17 @@ var Deepgram = (() => {
|
|
|
7882
8006
|
var WrappedListenV2Client = class extends V2Client {
|
|
7883
8007
|
connect(args) {
|
|
7884
8008
|
return __async(this, null, function* () {
|
|
7885
|
-
const {
|
|
7886
|
-
model,
|
|
7887
|
-
encoding,
|
|
7888
|
-
sample_rate: sampleRate,
|
|
7889
|
-
eager_eot_threshold: eagerEotThreshold,
|
|
7890
|
-
eot_threshold: eotThreshold,
|
|
7891
|
-
eot_timeout_ms: eotTimeoutMs,
|
|
7892
|
-
keyterm,
|
|
7893
|
-
mip_opt_out: mipOptOut,
|
|
7894
|
-
tag,
|
|
7895
|
-
headers,
|
|
7896
|
-
debug,
|
|
7897
|
-
reconnectAttempts
|
|
7898
|
-
} = args;
|
|
7899
|
-
const _queryParams = {};
|
|
7900
|
-
_queryParams.model = model;
|
|
7901
|
-
if (encoding != null) _queryParams.encoding = encoding;
|
|
7902
|
-
if (sampleRate != null) _queryParams.sample_rate = sampleRate;
|
|
7903
|
-
if (eagerEotThreshold != null) _queryParams.eager_eot_threshold = eagerEotThreshold;
|
|
7904
|
-
if (eotThreshold != null) _queryParams.eot_threshold = eotThreshold;
|
|
7905
|
-
if (eotTimeoutMs != null) _queryParams.eot_timeout_ms = eotTimeoutMs;
|
|
7906
|
-
if (keyterm != null) _queryParams.keyterm = keyterm;
|
|
7907
|
-
if (mipOptOut != null) _queryParams.mip_opt_out = mipOptOut;
|
|
7908
|
-
if (tag != null) _queryParams.tag = tag;
|
|
8009
|
+
const { headers, debug, reconnectAttempts, connectionTimeoutInSeconds, abortSignal } = args;
|
|
7909
8010
|
const socket = yield createWebSocketConnection({
|
|
7910
8011
|
options: this._options,
|
|
7911
8012
|
urlPath: "/v2/listen",
|
|
7912
8013
|
environmentKey: "production",
|
|
7913
|
-
queryParams:
|
|
8014
|
+
queryParams: buildQueryParams(args),
|
|
7914
8015
|
headers,
|
|
7915
8016
|
debug,
|
|
7916
|
-
reconnectAttempts
|
|
8017
|
+
reconnectAttempts,
|
|
8018
|
+
connectionTimeoutInSeconds,
|
|
8019
|
+
abortSignal
|
|
7917
8020
|
});
|
|
7918
8021
|
return new WrappedListenV2Socket({ socket });
|
|
7919
8022
|
});
|
|
@@ -7988,28 +8091,17 @@ var Deepgram = (() => {
|
|
|
7988
8091
|
var WrappedSpeakV1Client = class extends V1Client7 {
|
|
7989
8092
|
connect(args) {
|
|
7990
8093
|
return __async(this, null, function* () {
|
|
7991
|
-
const {
|
|
7992
|
-
encoding,
|
|
7993
|
-
mip_opt_out: mipOptOut,
|
|
7994
|
-
model,
|
|
7995
|
-
sample_rate: sampleRate,
|
|
7996
|
-
headers,
|
|
7997
|
-
debug,
|
|
7998
|
-
reconnectAttempts
|
|
7999
|
-
} = args;
|
|
8000
|
-
const _queryParams = {};
|
|
8001
|
-
if (encoding != null) _queryParams.encoding = encoding;
|
|
8002
|
-
if (mipOptOut != null) _queryParams.mip_opt_out = mipOptOut;
|
|
8003
|
-
if (model != null) _queryParams.model = model;
|
|
8004
|
-
if (sampleRate != null) _queryParams.sample_rate = sampleRate;
|
|
8094
|
+
const { headers, debug, reconnectAttempts, connectionTimeoutInSeconds, abortSignal } = args;
|
|
8005
8095
|
const socket = yield createWebSocketConnection({
|
|
8006
8096
|
options: this._options,
|
|
8007
8097
|
urlPath: "/v1/speak",
|
|
8008
8098
|
environmentKey: "production",
|
|
8009
|
-
queryParams:
|
|
8099
|
+
queryParams: buildQueryParams(args),
|
|
8010
8100
|
headers,
|
|
8011
8101
|
debug,
|
|
8012
|
-
reconnectAttempts
|
|
8102
|
+
reconnectAttempts,
|
|
8103
|
+
connectionTimeoutInSeconds,
|
|
8104
|
+
abortSignal
|
|
8013
8105
|
});
|
|
8014
8106
|
return new WrappedSpeakV1Socket({ socket });
|
|
8015
8107
|
});
|
|
@@ -8036,6 +8128,10 @@ var Deepgram = (() => {
|
|
|
8036
8128
|
var WrappedSpeakV1Socket = class extends V1Socket3 {
|
|
8037
8129
|
constructor(args) {
|
|
8038
8130
|
super(args);
|
|
8131
|
+
const socketAny = this;
|
|
8132
|
+
if (socketAny.handleMessage) {
|
|
8133
|
+
this.socket.removeEventListener("message", socketAny.handleMessage);
|
|
8134
|
+
}
|
|
8039
8135
|
this.setupBinaryHandling();
|
|
8040
8136
|
}
|
|
8041
8137
|
setupBinaryHandling() {
|