hume 0.15.8 → 0.15.10
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/dist/cjs/BaseClient.d.ts +13 -4
- package/dist/cjs/BaseClient.js +59 -0
- package/dist/cjs/Client.d.ts +13 -13
- package/dist/cjs/Client.js +8 -49
- package/dist/cjs/api/resources/empathicVoice/client/Client.d.ts +27 -27
- package/dist/cjs/api/resources/empathicVoice/client/Client.js +13 -12
- package/dist/cjs/api/resources/empathicVoice/errors/BadRequestError.js +5 -1
- package/dist/cjs/api/resources/empathicVoice/errors/UnprocessableEntityError.js +5 -1
- package/dist/cjs/api/resources/empathicVoice/resources/chat/client/Client.d.ts +5 -5
- package/dist/cjs/api/resources/empathicVoice/resources/chat/client/Client.js +3 -3
- package/dist/cjs/api/resources/empathicVoice/resources/chat/client/index.d.ts +1 -1
- package/dist/cjs/api/resources/empathicVoice/resources/chat/client/index.js +2 -2
- package/dist/cjs/api/resources/empathicVoice/resources/chatGroups/client/Client.d.ts +17 -26
- package/dist/cjs/api/resources/empathicVoice/resources/chatGroups/client/Client.js +48 -136
- package/dist/cjs/api/resources/empathicVoice/resources/chatGroups/client/requests/ChatGroupsGetAudioRequest.d.ts +1 -1
- package/dist/cjs/api/resources/empathicVoice/resources/chatGroups/client/requests/ChatGroupsGetChatGroupRequest.d.ts +1 -1
- package/dist/cjs/api/resources/empathicVoice/resources/chatGroups/client/requests/ChatGroupsListChatGroupEventsRequest.d.ts +1 -1
- package/dist/cjs/api/resources/empathicVoice/resources/chatGroups/client/requests/ChatGroupsListChatGroupsRequest.d.ts +2 -6
- package/dist/cjs/api/resources/empathicVoice/resources/chats/client/Client.d.ts +13 -20
- package/dist/cjs/api/resources/empathicVoice/resources/chats/client/Client.js +32 -95
- package/dist/cjs/api/resources/empathicVoice/resources/chats/client/requests/ChatsListChatEventsRequest.d.ts +1 -1
- package/dist/cjs/api/resources/empathicVoice/resources/chats/client/requests/ChatsListChatsRequest.d.ts +1 -1
- package/dist/cjs/api/resources/empathicVoice/resources/configs/client/Client.d.ts +34 -83
- package/dist/cjs/api/resources/empathicVoice/resources/configs/client/Client.js +64 -245
- package/dist/cjs/api/resources/empathicVoice/resources/configs/client/requests/ConfigsListConfigVersionsRequest.d.ts +1 -1
- package/dist/cjs/api/resources/empathicVoice/resources/configs/client/requests/PostedConfig.d.ts +4 -16
- package/dist/cjs/api/resources/empathicVoice/resources/configs/client/requests/PostedConfigVersion.d.ts +3 -14
- package/dist/cjs/api/resources/empathicVoice/resources/configs/client/requests/PostedConfigVersionDescription.d.ts +1 -1
- package/dist/cjs/api/resources/empathicVoice/resources/controlPlane/client/Client.d.ts +7 -7
- package/dist/cjs/api/resources/empathicVoice/resources/controlPlane/client/Client.js +6 -19
- package/dist/cjs/api/resources/empathicVoice/resources/prompts/client/Client.d.ts +34 -83
- package/dist/cjs/api/resources/empathicVoice/resources/prompts/client/Client.js +64 -245
- package/dist/cjs/api/resources/empathicVoice/resources/prompts/client/requests/PostedPrompt.d.ts +2 -8
- package/dist/cjs/api/resources/empathicVoice/resources/prompts/client/requests/PostedPromptVersion.d.ts +2 -8
- package/dist/cjs/api/resources/empathicVoice/resources/prompts/client/requests/PostedPromptVersionDescription.d.ts +1 -1
- package/dist/cjs/api/resources/empathicVoice/resources/prompts/client/requests/PromptsListPromptVersionsRequest.d.ts +1 -1
- package/dist/cjs/api/resources/empathicVoice/resources/tools/client/Client.d.ts +34 -83
- package/dist/cjs/api/resources/empathicVoice/resources/tools/client/Client.js +64 -245
- package/dist/cjs/api/resources/empathicVoice/resources/tools/client/requests/PostedUserDefinedTool.d.ts +4 -8
- package/dist/cjs/api/resources/empathicVoice/resources/tools/client/requests/PostedUserDefinedToolVersion.d.ts +4 -8
- package/dist/cjs/api/resources/empathicVoice/resources/tools/client/requests/PostedUserDefinedToolVersionDescription.d.ts +1 -1
- package/dist/cjs/api/resources/empathicVoice/types/AssistantEnd.d.ts +1 -1
- package/dist/cjs/api/resources/empathicVoice/types/AssistantInput.d.ts +2 -5
- package/dist/cjs/api/resources/empathicVoice/types/AssistantMessage.d.ts +2 -2
- package/dist/cjs/api/resources/empathicVoice/types/AssistantProsody.d.ts +1 -1
- package/dist/cjs/api/resources/empathicVoice/types/AudioInput.d.ts +6 -4
- package/dist/cjs/api/resources/empathicVoice/types/AudioOutput.d.ts +1 -4
- package/dist/cjs/api/resources/empathicVoice/types/ChatMetadata.d.ts +3 -5
- package/dist/cjs/api/resources/empathicVoice/types/ConnectSessionSettings.d.ts +8 -4
- package/dist/cjs/api/resources/empathicVoice/types/ConnectSessionSettingsAudio.d.ts +3 -3
- package/dist/cjs/api/resources/empathicVoice/types/ConnectSessionSettingsContext.d.ts +9 -3
- package/dist/cjs/api/resources/empathicVoice/types/Context.d.ts +9 -3
- package/dist/cjs/api/resources/empathicVoice/types/ControlPlanePublishEvent.d.ts +1 -36
- package/dist/cjs/api/resources/empathicVoice/types/JsonMessage.d.ts +1 -50
- package/dist/cjs/api/resources/empathicVoice/types/PauseAssistantMessage.d.ts +2 -4
- package/dist/cjs/api/resources/empathicVoice/types/PostedBuiltinTool.d.ts +1 -9
- package/dist/cjs/api/resources/empathicVoice/types/PostedBuiltinToolName.d.ts +0 -8
- package/dist/cjs/api/resources/empathicVoice/types/PostedBuiltinToolName.js +0 -8
- package/dist/cjs/api/resources/empathicVoice/types/PostedEllmModel.d.ts +1 -5
- package/dist/cjs/api/resources/empathicVoice/types/PostedEventMessageSpec.d.ts +2 -6
- package/dist/cjs/api/resources/empathicVoice/types/PostedEventMessageSpecs.d.ts +1 -14
- package/dist/cjs/api/resources/empathicVoice/types/PostedLanguageModel.d.ts +1 -7
- package/dist/cjs/api/resources/empathicVoice/types/PostedNudgeSpec.d.ts +2 -2
- package/dist/cjs/api/resources/empathicVoice/types/PostedTimeoutSpecs.d.ts +1 -13
- package/dist/cjs/api/resources/empathicVoice/types/PostedTimeoutSpecsInactivity.d.ts +0 -11
- package/dist/cjs/api/resources/empathicVoice/types/PostedTimeoutSpecsMaxDuration.d.ts +0 -11
- package/dist/cjs/api/resources/empathicVoice/types/PostedUserDefinedToolSpec.d.ts +1 -7
- package/dist/cjs/api/resources/empathicVoice/types/PostedWebhookSpec.d.ts +2 -6
- package/dist/cjs/api/resources/empathicVoice/types/ResumeAssistantMessage.d.ts +1 -3
- package/dist/cjs/api/resources/empathicVoice/types/ReturnBuiltinTool.d.ts +1 -2
- package/dist/cjs/api/resources/empathicVoice/types/ReturnBuiltinToolToolType.d.ts +0 -1
- package/dist/cjs/api/resources/empathicVoice/types/ReturnBuiltinToolToolType.js +0 -1
- package/dist/cjs/api/resources/empathicVoice/types/ReturnChat.d.ts +4 -19
- package/dist/cjs/api/resources/empathicVoice/types/ReturnChatAudioReconstruction.d.ts +0 -13
- package/dist/cjs/api/resources/empathicVoice/types/ReturnChatAudioReconstructionStatus.d.ts +0 -13
- package/dist/cjs/api/resources/empathicVoice/types/ReturnChatAudioReconstructionStatus.js +0 -13
- package/dist/cjs/api/resources/empathicVoice/types/ReturnChatEvent.d.ts +5 -30
- package/dist/cjs/api/resources/empathicVoice/types/ReturnChatEventRole.d.ts +0 -7
- package/dist/cjs/api/resources/empathicVoice/types/ReturnChatEventRole.js +0 -7
- package/dist/cjs/api/resources/empathicVoice/types/ReturnChatEventType.d.ts +0 -14
- package/dist/cjs/api/resources/empathicVoice/types/ReturnChatEventType.js +0 -14
- package/dist/cjs/api/resources/empathicVoice/types/ReturnChatGroup.d.ts +5 -6
- package/dist/cjs/api/resources/empathicVoice/types/ReturnChatGroupPagedAudioReconstructions.d.ts +1 -10
- package/dist/cjs/api/resources/empathicVoice/types/ReturnChatGroupPagedAudioReconstructionsPaginationDirection.d.ts +0 -5
- package/dist/cjs/api/resources/empathicVoice/types/ReturnChatGroupPagedAudioReconstructionsPaginationDirection.js +0 -5
- package/dist/cjs/api/resources/empathicVoice/types/ReturnChatGroupPagedChats.d.ts +6 -16
- package/dist/cjs/api/resources/empathicVoice/types/ReturnChatGroupPagedChatsPaginationDirection.d.ts +0 -5
- package/dist/cjs/api/resources/empathicVoice/types/ReturnChatGroupPagedChatsPaginationDirection.js +0 -5
- package/dist/cjs/api/resources/empathicVoice/types/ReturnChatGroupPagedEvents.d.ts +3 -12
- package/dist/cjs/api/resources/empathicVoice/types/ReturnChatGroupPagedEventsPaginationDirection.d.ts +0 -5
- package/dist/cjs/api/resources/empathicVoice/types/ReturnChatGroupPagedEventsPaginationDirection.js +0 -5
- package/dist/cjs/api/resources/empathicVoice/types/ReturnChatPagedEvents.d.ts +6 -30
- package/dist/cjs/api/resources/empathicVoice/types/ReturnChatPagedEventsPaginationDirection.d.ts +0 -5
- package/dist/cjs/api/resources/empathicVoice/types/ReturnChatPagedEventsPaginationDirection.js +0 -5
- package/dist/cjs/api/resources/empathicVoice/types/ReturnChatPagedEventsStatus.d.ts +0 -15
- package/dist/cjs/api/resources/empathicVoice/types/ReturnChatPagedEventsStatus.js +0 -15
- package/dist/cjs/api/resources/empathicVoice/types/ReturnChatStatus.d.ts +0 -15
- package/dist/cjs/api/resources/empathicVoice/types/ReturnChatStatus.js +0 -15
- package/dist/cjs/api/resources/empathicVoice/types/ReturnConfigSpec.d.ts +2 -8
- package/dist/cjs/api/resources/empathicVoice/types/ReturnEllmModel.d.ts +1 -5
- package/dist/cjs/api/resources/empathicVoice/types/ReturnEventMessageSpec.d.ts +2 -6
- package/dist/cjs/api/resources/empathicVoice/types/ReturnEventMessageSpecs.d.ts +1 -14
- package/dist/cjs/api/resources/empathicVoice/types/ReturnLanguageModel.d.ts +1 -7
- package/dist/cjs/api/resources/empathicVoice/types/ReturnPagedChatGroups.d.ts +2 -11
- package/dist/cjs/api/resources/empathicVoice/types/ReturnPagedChatGroupsPaginationDirection.d.ts +0 -5
- package/dist/cjs/api/resources/empathicVoice/types/ReturnPagedChatGroupsPaginationDirection.js +0 -5
- package/dist/cjs/api/resources/empathicVoice/types/ReturnPagedChats.d.ts +2 -11
- package/dist/cjs/api/resources/empathicVoice/types/ReturnPagedChatsPaginationDirection.d.ts +0 -5
- package/dist/cjs/api/resources/empathicVoice/types/ReturnPagedChatsPaginationDirection.js +0 -5
- package/dist/cjs/api/resources/empathicVoice/types/ReturnPagedConfigs.d.ts +2 -6
- package/dist/cjs/api/resources/empathicVoice/types/ReturnPagedPrompts.d.ts +2 -6
- package/dist/cjs/api/resources/empathicVoice/types/ReturnPagedUserDefinedTools.d.ts +2 -6
- package/dist/cjs/api/resources/empathicVoice/types/ReturnPromptVersionType.d.ts +0 -1
- package/dist/cjs/api/resources/empathicVoice/types/ReturnPromptVersionType.js +0 -1
- package/dist/cjs/api/resources/empathicVoice/types/ReturnTimeoutSpec.d.ts +2 -6
- package/dist/cjs/api/resources/empathicVoice/types/ReturnTimeoutSpecs.d.ts +1 -13
- package/dist/cjs/api/resources/empathicVoice/types/ReturnUserDefinedTool.d.ts +7 -19
- package/dist/cjs/api/resources/empathicVoice/types/ReturnUserDefinedToolToolType.d.ts +0 -1
- package/dist/cjs/api/resources/empathicVoice/types/ReturnUserDefinedToolToolType.js +0 -1
- package/dist/cjs/api/resources/empathicVoice/types/ReturnUserDefinedToolVersionType.d.ts +0 -1
- package/dist/cjs/api/resources/empathicVoice/types/ReturnUserDefinedToolVersionType.js +0 -1
- package/dist/cjs/api/resources/empathicVoice/types/ReturnVoice.d.ts +5 -3
- package/dist/cjs/api/resources/empathicVoice/types/ReturnWebhookSpec.d.ts +2 -6
- package/dist/cjs/api/resources/empathicVoice/types/SessionSettings.d.ts +10 -19
- package/dist/cjs/api/resources/empathicVoice/types/SubscribeEvent.d.ts +1 -55
- package/dist/cjs/api/resources/empathicVoice/types/ToolCallMessage.d.ts +3 -9
- package/dist/cjs/api/resources/empathicVoice/types/ToolErrorMessage.d.ts +3 -5
- package/dist/cjs/api/resources/empathicVoice/types/ToolResponseMessage.d.ts +3 -11
- package/dist/cjs/api/resources/empathicVoice/types/UserInput.d.ts +6 -2
- package/dist/cjs/api/resources/empathicVoice/types/UserInterruption.d.ts +1 -3
- package/dist/cjs/api/resources/empathicVoice/types/UserMessage.d.ts +3 -17
- package/dist/cjs/api/resources/empathicVoice/types/VoiceId.d.ts +11 -2
- package/dist/cjs/api/resources/empathicVoice/types/VoiceName.d.ts +11 -2
- package/dist/cjs/api/resources/empathicVoice/types/WebSocketError.d.ts +1 -3
- package/dist/cjs/api/resources/expressionMeasurement/client/Client.d.ts +9 -9
- package/dist/cjs/api/resources/expressionMeasurement/client/Client.js +7 -6
- package/dist/cjs/api/resources/expressionMeasurement/resources/batch/client/Client.d.ts +17 -18
- package/dist/cjs/api/resources/expressionMeasurement/resources/batch/client/Client.js +63 -151
- package/dist/cjs/api/resources/expressionMeasurement/resources/stream/resources/stream/client/Client.d.ts +7 -8
- package/dist/cjs/api/resources/expressionMeasurement/resources/stream/resources/stream/client/Client.js +7 -12
- package/dist/cjs/api/resources/tts/client/Client.d.ts +19 -20
- package/dist/cjs/api/resources/tts/client/Client.js +56 -138
- package/dist/cjs/api/resources/tts/errors/BadRequestError.js +5 -1
- package/dist/cjs/api/resources/tts/errors/UnprocessableEntityError.js +5 -1
- package/dist/cjs/api/resources/tts/resources/streamInput/client/Client.d.ts +15 -14
- package/dist/cjs/api/resources/tts/resources/streamInput/client/Client.js +10 -6
- package/dist/cjs/api/resources/tts/resources/voices/client/Client.d.ts +13 -14
- package/dist/cjs/api/resources/tts/resources/voices/client/Client.js +33 -87
- package/dist/cjs/api/resources/tts/resources/voices/client/requests/PostedVoice.d.ts +1 -1
- package/dist/cjs/api/resources/tts/resources/voices/client/requests/VoicesListRequest.d.ts +1 -1
- package/dist/cjs/api/resources/tts/types/OctaveVersion.d.ts +7 -3
- package/dist/cjs/api/resources/tts/types/OctaveVersion.js +7 -3
- package/dist/cjs/api/resources/tts/types/PostedTts.d.ts +0 -6
- package/dist/cjs/api/resources/tts/types/PostedUtteranceVoiceWithId.d.ts +1 -1
- package/dist/cjs/api/resources/tts/types/PostedUtteranceVoiceWithName.d.ts +1 -1
- package/dist/cjs/api/resources/tts/types/PublishTts.d.ts +14 -4
- package/dist/cjs/api/resources/tts/types/ReturnPagedVoices.d.ts +5 -9
- package/dist/cjs/api/resources/tts/types/ReturnVoice.d.ts +3 -3
- package/dist/cjs/auth/HeaderAuthProvider.d.ts +26 -0
- package/dist/cjs/auth/HeaderAuthProvider.js +91 -0
- package/dist/cjs/auth/index.d.ts +1 -0
- package/dist/cjs/auth/index.js +5 -0
- package/dist/cjs/core/auth/AuthProvider.d.ts +7 -0
- package/dist/cjs/core/auth/AuthProvider.js +2 -0
- package/dist/cjs/core/auth/AuthRequest.d.ts +9 -0
- package/dist/cjs/core/auth/AuthRequest.js +2 -0
- package/dist/cjs/core/auth/BasicAuth.d.ts +8 -0
- package/dist/cjs/core/auth/BasicAuth.js +27 -0
- package/dist/cjs/core/auth/BearerToken.d.ts +7 -0
- package/dist/cjs/core/auth/BearerToken.js +16 -0
- package/dist/cjs/core/auth/NoOpAuthProvider.d.ts +5 -0
- package/dist/cjs/core/auth/NoOpAuthProvider.js +9 -0
- package/dist/cjs/core/auth/index.d.ts +5 -0
- package/dist/cjs/core/auth/index.js +9 -0
- package/dist/cjs/core/base64.d.ts +2 -0
- package/dist/cjs/core/base64.js +26 -0
- package/dist/cjs/core/fetcher/BinaryResponse.d.ts +6 -7
- package/dist/cjs/core/fetcher/EndpointSupplier.d.ts +2 -2
- package/dist/cjs/core/fetcher/Fetcher.d.ts +6 -3
- package/dist/cjs/core/fetcher/Fetcher.js +42 -24
- package/dist/cjs/core/fetcher/getResponseBody.js +18 -4
- package/dist/cjs/core/fetcher/makeRequest.d.ts +1 -1
- package/dist/cjs/core/fetcher/makeRequest.js +0 -2
- package/dist/cjs/core/fetcher/requestWithRetries.js +0 -9
- package/dist/cjs/core/fetcher/signals.d.ts +1 -7
- package/dist/cjs/core/fetcher/signals.js +0 -12
- package/dist/cjs/core/headers.d.ts +2 -2
- package/dist/cjs/core/index.d.ts +2 -0
- package/dist/cjs/core/index.js +2 -0
- package/dist/cjs/core/logging/logger.js +1 -1
- package/dist/cjs/core/pagination/CustomPager.d.ts +67 -0
- package/dist/cjs/core/pagination/CustomPager.js +194 -0
- package/dist/cjs/core/pagination/index.d.ts +1 -0
- package/dist/cjs/core/pagination/index.js +4 -1
- package/dist/cjs/core/runtime/runtime.js +11 -10
- package/dist/cjs/core/schemas/Schema.d.ts +1 -0
- package/dist/cjs/core/schemas/Schema.js +1 -0
- package/dist/cjs/core/schemas/builders/object/object.js +14 -1
- package/dist/cjs/core/schemas/builders/primitives/index.d.ts +1 -0
- package/dist/cjs/core/schemas/builders/primitives/index.js +3 -1
- package/dist/cjs/core/schemas/builders/primitives/never.d.ts +2 -0
- package/dist/cjs/core/schemas/builders/primitives/never.js +14 -0
- package/dist/cjs/core/url/join.js +0 -1
- package/dist/cjs/errors/HumeError.js +5 -1
- package/dist/cjs/errors/HumeTimeoutError.js +5 -1
- package/dist/cjs/errors/handleNonStatusCodeError.d.ts +2 -0
- package/dist/cjs/errors/handleNonStatusCodeError.js +65 -0
- package/dist/cjs/serialization/resources/empathicVoice/types/ReturnVoice.d.ts +3 -3
- package/dist/cjs/serialization/resources/empathicVoice/types/ReturnVoice.js +3 -3
- package/dist/cjs/serialization/resources/tts/types/ReturnPagedVoices.d.ts +4 -4
- package/dist/cjs/serialization/resources/tts/types/ReturnPagedVoices.js +4 -4
- package/dist/cjs/serialization/resources/tts/types/ReturnVoice.d.ts +3 -3
- package/dist/cjs/serialization/resources/tts/types/ReturnVoice.js +3 -3
- package/dist/cjs/version.d.ts +1 -1
- package/dist/cjs/version.js +1 -1
- package/dist/cjs/wrapper/SilenceFiller.d.ts +64 -10
- package/dist/cjs/wrapper/SilenceFiller.js +109 -26
- package/dist/cjs/wrapper/expressionMeasurement/ExpressionMeasurementClient.d.ts +1 -1
- package/dist/cjs/wrapper/expressionMeasurement/ExpressionMeasurementClient.js +1 -1
- package/dist/cjs/wrapper/expressionMeasurement/batch/BatchClient.d.ts +1 -1
- package/dist/cjs/wrapper/expressionMeasurement/batch/BatchClient.js +1 -1
- package/dist/cjs/wrapper/fetchAccessToken.js +3 -0
- package/dist/cjs/wrapper/index.d.ts +5 -0
- package/dist/cjs/wrapper/index.js +6 -6
- package/dist/esm/BaseClient.d.mts +13 -4
- package/dist/esm/BaseClient.mjs +24 -1
- package/dist/esm/Client.d.mts +13 -13
- package/dist/esm/Client.mjs +11 -19
- package/dist/esm/api/resources/empathicVoice/client/Client.d.mts +27 -27
- package/dist/esm/api/resources/empathicVoice/client/Client.mjs +18 -17
- package/dist/esm/api/resources/empathicVoice/errors/BadRequestError.mjs +5 -1
- package/dist/esm/api/resources/empathicVoice/errors/UnprocessableEntityError.mjs +5 -1
- package/dist/esm/api/resources/empathicVoice/resources/chat/client/Client.d.mts +5 -5
- package/dist/esm/api/resources/empathicVoice/resources/chat/client/Client.mjs +1 -1
- package/dist/esm/api/resources/empathicVoice/resources/chat/client/index.d.mts +1 -1
- package/dist/esm/api/resources/empathicVoice/resources/chat/client/index.mjs +1 -1
- package/dist/esm/api/resources/empathicVoice/resources/chatGroups/client/Client.d.mts +17 -26
- package/dist/esm/api/resources/empathicVoice/resources/chatGroups/client/Client.mjs +47 -135
- package/dist/esm/api/resources/empathicVoice/resources/chatGroups/client/requests/ChatGroupsGetAudioRequest.d.mts +1 -1
- package/dist/esm/api/resources/empathicVoice/resources/chatGroups/client/requests/ChatGroupsGetChatGroupRequest.d.mts +1 -1
- package/dist/esm/api/resources/empathicVoice/resources/chatGroups/client/requests/ChatGroupsListChatGroupEventsRequest.d.mts +1 -1
- package/dist/esm/api/resources/empathicVoice/resources/chatGroups/client/requests/ChatGroupsListChatGroupsRequest.d.mts +2 -6
- package/dist/esm/api/resources/empathicVoice/resources/chats/client/Client.d.mts +13 -20
- package/dist/esm/api/resources/empathicVoice/resources/chats/client/Client.mjs +31 -94
- package/dist/esm/api/resources/empathicVoice/resources/chats/client/requests/ChatsListChatEventsRequest.d.mts +1 -1
- package/dist/esm/api/resources/empathicVoice/resources/chats/client/requests/ChatsListChatsRequest.d.mts +1 -1
- package/dist/esm/api/resources/empathicVoice/resources/configs/client/Client.d.mts +34 -83
- package/dist/esm/api/resources/empathicVoice/resources/configs/client/Client.mjs +63 -244
- package/dist/esm/api/resources/empathicVoice/resources/configs/client/requests/ConfigsListConfigVersionsRequest.d.mts +1 -1
- package/dist/esm/api/resources/empathicVoice/resources/configs/client/requests/PostedConfig.d.mts +4 -16
- package/dist/esm/api/resources/empathicVoice/resources/configs/client/requests/PostedConfigVersion.d.mts +3 -14
- package/dist/esm/api/resources/empathicVoice/resources/configs/client/requests/PostedConfigVersionDescription.d.mts +1 -1
- package/dist/esm/api/resources/empathicVoice/resources/controlPlane/client/Client.d.mts +7 -7
- package/dist/esm/api/resources/empathicVoice/resources/controlPlane/client/Client.mjs +4 -17
- package/dist/esm/api/resources/empathicVoice/resources/prompts/client/Client.d.mts +34 -83
- package/dist/esm/api/resources/empathicVoice/resources/prompts/client/Client.mjs +63 -244
- package/dist/esm/api/resources/empathicVoice/resources/prompts/client/requests/PostedPrompt.d.mts +2 -8
- package/dist/esm/api/resources/empathicVoice/resources/prompts/client/requests/PostedPromptVersion.d.mts +2 -8
- package/dist/esm/api/resources/empathicVoice/resources/prompts/client/requests/PostedPromptVersionDescription.d.mts +1 -1
- package/dist/esm/api/resources/empathicVoice/resources/prompts/client/requests/PromptsListPromptVersionsRequest.d.mts +1 -1
- package/dist/esm/api/resources/empathicVoice/resources/tools/client/Client.d.mts +34 -83
- package/dist/esm/api/resources/empathicVoice/resources/tools/client/Client.mjs +63 -244
- package/dist/esm/api/resources/empathicVoice/resources/tools/client/requests/PostedUserDefinedTool.d.mts +4 -8
- package/dist/esm/api/resources/empathicVoice/resources/tools/client/requests/PostedUserDefinedToolVersion.d.mts +4 -8
- package/dist/esm/api/resources/empathicVoice/resources/tools/client/requests/PostedUserDefinedToolVersionDescription.d.mts +1 -1
- package/dist/esm/api/resources/empathicVoice/types/AssistantEnd.d.mts +1 -1
- package/dist/esm/api/resources/empathicVoice/types/AssistantInput.d.mts +2 -5
- package/dist/esm/api/resources/empathicVoice/types/AssistantMessage.d.mts +2 -2
- package/dist/esm/api/resources/empathicVoice/types/AssistantProsody.d.mts +1 -1
- package/dist/esm/api/resources/empathicVoice/types/AudioInput.d.mts +6 -4
- package/dist/esm/api/resources/empathicVoice/types/AudioOutput.d.mts +1 -4
- package/dist/esm/api/resources/empathicVoice/types/ChatMetadata.d.mts +3 -5
- package/dist/esm/api/resources/empathicVoice/types/ConnectSessionSettings.d.mts +8 -4
- package/dist/esm/api/resources/empathicVoice/types/ConnectSessionSettingsAudio.d.mts +3 -3
- package/dist/esm/api/resources/empathicVoice/types/ConnectSessionSettingsContext.d.mts +9 -3
- package/dist/esm/api/resources/empathicVoice/types/Context.d.mts +9 -3
- package/dist/esm/api/resources/empathicVoice/types/ControlPlanePublishEvent.d.mts +1 -36
- package/dist/esm/api/resources/empathicVoice/types/JsonMessage.d.mts +1 -50
- package/dist/esm/api/resources/empathicVoice/types/PauseAssistantMessage.d.mts +2 -4
- package/dist/esm/api/resources/empathicVoice/types/PostedBuiltinTool.d.mts +1 -9
- package/dist/esm/api/resources/empathicVoice/types/PostedBuiltinToolName.d.mts +0 -8
- package/dist/esm/api/resources/empathicVoice/types/PostedBuiltinToolName.mjs +0 -8
- package/dist/esm/api/resources/empathicVoice/types/PostedEllmModel.d.mts +1 -5
- package/dist/esm/api/resources/empathicVoice/types/PostedEventMessageSpec.d.mts +2 -6
- package/dist/esm/api/resources/empathicVoice/types/PostedEventMessageSpecs.d.mts +1 -14
- package/dist/esm/api/resources/empathicVoice/types/PostedLanguageModel.d.mts +1 -7
- package/dist/esm/api/resources/empathicVoice/types/PostedNudgeSpec.d.mts +2 -2
- package/dist/esm/api/resources/empathicVoice/types/PostedTimeoutSpecs.d.mts +1 -13
- package/dist/esm/api/resources/empathicVoice/types/PostedTimeoutSpecsInactivity.d.mts +0 -11
- package/dist/esm/api/resources/empathicVoice/types/PostedTimeoutSpecsMaxDuration.d.mts +0 -11
- package/dist/esm/api/resources/empathicVoice/types/PostedUserDefinedToolSpec.d.mts +1 -7
- package/dist/esm/api/resources/empathicVoice/types/PostedWebhookSpec.d.mts +2 -6
- package/dist/esm/api/resources/empathicVoice/types/ResumeAssistantMessage.d.mts +1 -3
- package/dist/esm/api/resources/empathicVoice/types/ReturnBuiltinTool.d.mts +1 -2
- package/dist/esm/api/resources/empathicVoice/types/ReturnBuiltinToolToolType.d.mts +0 -1
- package/dist/esm/api/resources/empathicVoice/types/ReturnBuiltinToolToolType.mjs +0 -1
- package/dist/esm/api/resources/empathicVoice/types/ReturnChat.d.mts +4 -19
- package/dist/esm/api/resources/empathicVoice/types/ReturnChatAudioReconstruction.d.mts +0 -13
- package/dist/esm/api/resources/empathicVoice/types/ReturnChatAudioReconstructionStatus.d.mts +0 -13
- package/dist/esm/api/resources/empathicVoice/types/ReturnChatAudioReconstructionStatus.mjs +0 -13
- package/dist/esm/api/resources/empathicVoice/types/ReturnChatEvent.d.mts +5 -30
- package/dist/esm/api/resources/empathicVoice/types/ReturnChatEventRole.d.mts +0 -7
- package/dist/esm/api/resources/empathicVoice/types/ReturnChatEventRole.mjs +0 -7
- package/dist/esm/api/resources/empathicVoice/types/ReturnChatEventType.d.mts +0 -14
- package/dist/esm/api/resources/empathicVoice/types/ReturnChatEventType.mjs +0 -14
- package/dist/esm/api/resources/empathicVoice/types/ReturnChatGroup.d.mts +5 -6
- package/dist/esm/api/resources/empathicVoice/types/ReturnChatGroupPagedAudioReconstructions.d.mts +1 -10
- package/dist/esm/api/resources/empathicVoice/types/ReturnChatGroupPagedAudioReconstructionsPaginationDirection.d.mts +0 -5
- package/dist/esm/api/resources/empathicVoice/types/ReturnChatGroupPagedAudioReconstructionsPaginationDirection.mjs +0 -5
- package/dist/esm/api/resources/empathicVoice/types/ReturnChatGroupPagedChats.d.mts +6 -16
- package/dist/esm/api/resources/empathicVoice/types/ReturnChatGroupPagedChatsPaginationDirection.d.mts +0 -5
- package/dist/esm/api/resources/empathicVoice/types/ReturnChatGroupPagedChatsPaginationDirection.mjs +0 -5
- package/dist/esm/api/resources/empathicVoice/types/ReturnChatGroupPagedEvents.d.mts +3 -12
- package/dist/esm/api/resources/empathicVoice/types/ReturnChatGroupPagedEventsPaginationDirection.d.mts +0 -5
- package/dist/esm/api/resources/empathicVoice/types/ReturnChatGroupPagedEventsPaginationDirection.mjs +0 -5
- package/dist/esm/api/resources/empathicVoice/types/ReturnChatPagedEvents.d.mts +6 -30
- package/dist/esm/api/resources/empathicVoice/types/ReturnChatPagedEventsPaginationDirection.d.mts +0 -5
- package/dist/esm/api/resources/empathicVoice/types/ReturnChatPagedEventsPaginationDirection.mjs +0 -5
- package/dist/esm/api/resources/empathicVoice/types/ReturnChatPagedEventsStatus.d.mts +0 -15
- package/dist/esm/api/resources/empathicVoice/types/ReturnChatPagedEventsStatus.mjs +0 -15
- package/dist/esm/api/resources/empathicVoice/types/ReturnChatStatus.d.mts +0 -15
- package/dist/esm/api/resources/empathicVoice/types/ReturnChatStatus.mjs +0 -15
- package/dist/esm/api/resources/empathicVoice/types/ReturnConfigSpec.d.mts +2 -8
- package/dist/esm/api/resources/empathicVoice/types/ReturnEllmModel.d.mts +1 -5
- package/dist/esm/api/resources/empathicVoice/types/ReturnEventMessageSpec.d.mts +2 -6
- package/dist/esm/api/resources/empathicVoice/types/ReturnEventMessageSpecs.d.mts +1 -14
- package/dist/esm/api/resources/empathicVoice/types/ReturnLanguageModel.d.mts +1 -7
- package/dist/esm/api/resources/empathicVoice/types/ReturnPagedChatGroups.d.mts +2 -11
- package/dist/esm/api/resources/empathicVoice/types/ReturnPagedChatGroupsPaginationDirection.d.mts +0 -5
- package/dist/esm/api/resources/empathicVoice/types/ReturnPagedChatGroupsPaginationDirection.mjs +0 -5
- package/dist/esm/api/resources/empathicVoice/types/ReturnPagedChats.d.mts +2 -11
- package/dist/esm/api/resources/empathicVoice/types/ReturnPagedChatsPaginationDirection.d.mts +0 -5
- package/dist/esm/api/resources/empathicVoice/types/ReturnPagedChatsPaginationDirection.mjs +0 -5
- package/dist/esm/api/resources/empathicVoice/types/ReturnPagedConfigs.d.mts +2 -6
- package/dist/esm/api/resources/empathicVoice/types/ReturnPagedPrompts.d.mts +2 -6
- package/dist/esm/api/resources/empathicVoice/types/ReturnPagedUserDefinedTools.d.mts +2 -6
- package/dist/esm/api/resources/empathicVoice/types/ReturnPromptVersionType.d.mts +0 -1
- package/dist/esm/api/resources/empathicVoice/types/ReturnPromptVersionType.mjs +0 -1
- package/dist/esm/api/resources/empathicVoice/types/ReturnTimeoutSpec.d.mts +2 -6
- package/dist/esm/api/resources/empathicVoice/types/ReturnTimeoutSpecs.d.mts +1 -13
- package/dist/esm/api/resources/empathicVoice/types/ReturnUserDefinedTool.d.mts +7 -19
- package/dist/esm/api/resources/empathicVoice/types/ReturnUserDefinedToolToolType.d.mts +0 -1
- package/dist/esm/api/resources/empathicVoice/types/ReturnUserDefinedToolToolType.mjs +0 -1
- package/dist/esm/api/resources/empathicVoice/types/ReturnUserDefinedToolVersionType.d.mts +0 -1
- package/dist/esm/api/resources/empathicVoice/types/ReturnUserDefinedToolVersionType.mjs +0 -1
- package/dist/esm/api/resources/empathicVoice/types/ReturnVoice.d.mts +5 -3
- package/dist/esm/api/resources/empathicVoice/types/ReturnWebhookSpec.d.mts +2 -6
- package/dist/esm/api/resources/empathicVoice/types/SessionSettings.d.mts +10 -19
- package/dist/esm/api/resources/empathicVoice/types/SubscribeEvent.d.mts +1 -55
- package/dist/esm/api/resources/empathicVoice/types/ToolCallMessage.d.mts +3 -9
- package/dist/esm/api/resources/empathicVoice/types/ToolErrorMessage.d.mts +3 -5
- package/dist/esm/api/resources/empathicVoice/types/ToolResponseMessage.d.mts +3 -11
- package/dist/esm/api/resources/empathicVoice/types/UserInput.d.mts +6 -2
- package/dist/esm/api/resources/empathicVoice/types/UserInterruption.d.mts +1 -3
- package/dist/esm/api/resources/empathicVoice/types/UserMessage.d.mts +3 -17
- package/dist/esm/api/resources/empathicVoice/types/VoiceId.d.mts +11 -2
- package/dist/esm/api/resources/empathicVoice/types/VoiceName.d.mts +11 -2
- package/dist/esm/api/resources/empathicVoice/types/WebSocketError.d.mts +1 -3
- package/dist/esm/api/resources/expressionMeasurement/client/Client.d.mts +9 -9
- package/dist/esm/api/resources/expressionMeasurement/client/Client.mjs +6 -5
- package/dist/esm/api/resources/expressionMeasurement/resources/batch/client/Client.d.mts +17 -18
- package/dist/esm/api/resources/expressionMeasurement/resources/batch/client/Client.mjs +61 -149
- package/dist/esm/api/resources/expressionMeasurement/resources/stream/resources/stream/client/Client.d.mts +7 -8
- package/dist/esm/api/resources/expressionMeasurement/resources/stream/resources/stream/client/Client.mjs +5 -10
- package/dist/esm/api/resources/tts/client/Client.d.mts +19 -20
- package/dist/esm/api/resources/tts/client/Client.mjs +56 -138
- package/dist/esm/api/resources/tts/errors/BadRequestError.mjs +5 -1
- package/dist/esm/api/resources/tts/errors/UnprocessableEntityError.mjs +5 -1
- package/dist/esm/api/resources/tts/resources/streamInput/client/Client.d.mts +15 -14
- package/dist/esm/api/resources/tts/resources/streamInput/client/Client.mjs +8 -4
- package/dist/esm/api/resources/tts/resources/voices/client/Client.d.mts +13 -14
- package/dist/esm/api/resources/tts/resources/voices/client/Client.mjs +32 -86
- package/dist/esm/api/resources/tts/resources/voices/client/requests/PostedVoice.d.mts +1 -1
- package/dist/esm/api/resources/tts/resources/voices/client/requests/VoicesListRequest.d.mts +1 -1
- package/dist/esm/api/resources/tts/types/OctaveVersion.d.mts +7 -3
- package/dist/esm/api/resources/tts/types/OctaveVersion.mjs +7 -3
- package/dist/esm/api/resources/tts/types/PostedTts.d.mts +0 -6
- package/dist/esm/api/resources/tts/types/PostedUtteranceVoiceWithId.d.mts +1 -1
- package/dist/esm/api/resources/tts/types/PostedUtteranceVoiceWithName.d.mts +1 -1
- package/dist/esm/api/resources/tts/types/PublishTts.d.mts +14 -4
- package/dist/esm/api/resources/tts/types/ReturnPagedVoices.d.mts +5 -9
- package/dist/esm/api/resources/tts/types/ReturnVoice.d.mts +3 -3
- package/dist/esm/auth/HeaderAuthProvider.d.mts +26 -0
- package/dist/esm/auth/HeaderAuthProvider.mjs +54 -0
- package/dist/esm/auth/index.d.mts +1 -0
- package/dist/esm/auth/index.mjs +1 -0
- package/dist/esm/core/auth/AuthProvider.d.mts +7 -0
- package/dist/esm/core/auth/AuthProvider.mjs +1 -0
- package/dist/esm/core/auth/AuthRequest.d.mts +9 -0
- package/dist/esm/core/auth/AuthRequest.mjs +1 -0
- package/dist/esm/core/auth/BasicAuth.d.mts +8 -0
- package/dist/esm/core/auth/BasicAuth.mjs +24 -0
- package/dist/esm/core/auth/BearerToken.d.mts +7 -0
- package/dist/esm/core/auth/BearerToken.mjs +13 -0
- package/dist/esm/core/auth/NoOpAuthProvider.d.mts +5 -0
- package/dist/esm/core/auth/NoOpAuthProvider.mjs +5 -0
- package/dist/esm/core/auth/index.d.mts +5 -0
- package/dist/esm/core/auth/index.mjs +3 -0
- package/dist/esm/core/base64.d.mts +2 -0
- package/dist/esm/core/base64.mjs +22 -0
- package/dist/esm/core/fetcher/BinaryResponse.d.mts +6 -7
- package/dist/esm/core/fetcher/EndpointSupplier.d.mts +2 -2
- package/dist/esm/core/fetcher/Fetcher.d.mts +6 -3
- package/dist/esm/core/fetcher/Fetcher.mjs +42 -24
- package/dist/esm/core/fetcher/getResponseBody.mjs +18 -4
- package/dist/esm/core/fetcher/makeRequest.d.mts +1 -1
- package/dist/esm/core/fetcher/makeRequest.mjs +0 -2
- package/dist/esm/core/fetcher/requestWithRetries.mjs +0 -9
- package/dist/esm/core/fetcher/signals.d.mts +1 -7
- package/dist/esm/core/fetcher/signals.mjs +0 -12
- package/dist/esm/core/headers.d.mts +2 -2
- package/dist/esm/core/index.d.mts +2 -0
- package/dist/esm/core/index.mjs +2 -0
- package/dist/esm/core/logging/logger.mjs +1 -1
- package/dist/esm/core/pagination/CustomPager.d.mts +67 -0
- package/dist/esm/core/pagination/CustomPager.mjs +189 -0
- package/dist/esm/core/pagination/index.d.mts +1 -0
- package/dist/esm/core/pagination/index.mjs +1 -0
- package/dist/esm/core/runtime/runtime.mjs +11 -10
- package/dist/esm/core/schemas/Schema.d.mts +1 -0
- package/dist/esm/core/schemas/Schema.mjs +1 -0
- package/dist/esm/core/schemas/builders/object/object.mjs +14 -1
- package/dist/esm/core/schemas/builders/primitives/index.d.mts +1 -0
- package/dist/esm/core/schemas/builders/primitives/index.mjs +1 -0
- package/dist/esm/core/schemas/builders/primitives/never.d.mts +2 -0
- package/dist/esm/core/schemas/builders/primitives/never.mjs +11 -0
- package/dist/esm/core/url/join.mjs +0 -1
- package/dist/esm/errors/HumeError.mjs +5 -1
- package/dist/esm/errors/HumeTimeoutError.mjs +5 -1
- package/dist/esm/errors/handleNonStatusCodeError.d.mts +2 -0
- package/dist/esm/errors/handleNonStatusCodeError.mjs +29 -0
- package/dist/esm/serialization/resources/empathicVoice/types/ReturnVoice.d.mts +3 -3
- package/dist/esm/serialization/resources/empathicVoice/types/ReturnVoice.mjs +3 -3
- package/dist/esm/serialization/resources/tts/types/ReturnPagedVoices.d.mts +4 -4
- package/dist/esm/serialization/resources/tts/types/ReturnPagedVoices.mjs +4 -4
- package/dist/esm/serialization/resources/tts/types/ReturnVoice.d.mts +3 -3
- package/dist/esm/serialization/resources/tts/types/ReturnVoice.mjs +3 -3
- package/dist/esm/version.d.mts +1 -1
- package/dist/esm/version.mjs +1 -1
- package/dist/esm/wrapper/SilenceFiller.d.mts +64 -10
- package/dist/esm/wrapper/SilenceFiller.mjs +109 -26
- package/dist/esm/wrapper/expressionMeasurement/ExpressionMeasurementClient.d.mts +1 -1
- package/dist/esm/wrapper/expressionMeasurement/ExpressionMeasurementClient.mjs +1 -1
- package/dist/esm/wrapper/expressionMeasurement/batch/BatchClient.d.mts +1 -1
- package/dist/esm/wrapper/expressionMeasurement/batch/BatchClient.mjs +1 -1
- package/dist/esm/wrapper/fetchAccessToken.mjs +3 -0
- package/dist/esm/wrapper/index.d.mts +5 -0
- package/dist/esm/wrapper/index.mjs +4 -5
- package/package.json +5 -2
- package/reference.md +621 -1205
- package/dist/cjs/core/fetcher/ResponseWithBody.d.ts +0 -4
- package/dist/cjs/core/fetcher/ResponseWithBody.js +0 -6
- package/dist/esm/core/fetcher/ResponseWithBody.d.mts +0 -4
- package/dist/esm/core/fetcher/ResponseWithBody.mjs +0 -3
|
@@ -0,0 +1,194 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
var __await = (this && this.__await) || function (v) { return this instanceof __await ? (this.v = v, this) : new __await(v); }
|
|
12
|
+
var __asyncGenerator = (this && this.__asyncGenerator) || function (thisArg, _arguments, generator) {
|
|
13
|
+
if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
|
|
14
|
+
var g = generator.apply(thisArg, _arguments || []), i, q = [];
|
|
15
|
+
return i = Object.create((typeof AsyncIterator === "function" ? AsyncIterator : Object).prototype), verb("next"), verb("throw"), verb("return", awaitReturn), i[Symbol.asyncIterator] = function () { return this; }, i;
|
|
16
|
+
function awaitReturn(f) { return function (v) { return Promise.resolve(v).then(f, reject); }; }
|
|
17
|
+
function verb(n, f) { if (g[n]) { i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; if (f) i[n] = f(i[n]); } }
|
|
18
|
+
function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }
|
|
19
|
+
function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
|
|
20
|
+
function fulfill(value) { resume("next", value); }
|
|
21
|
+
function reject(value) { resume("throw", value); }
|
|
22
|
+
function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }
|
|
23
|
+
};
|
|
24
|
+
var __asyncValues = (this && this.__asyncValues) || function (o) {
|
|
25
|
+
if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
|
|
26
|
+
var m = o[Symbol.asyncIterator], i;
|
|
27
|
+
return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i);
|
|
28
|
+
function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }
|
|
29
|
+
function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }
|
|
30
|
+
};
|
|
31
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
32
|
+
exports.CustomPager = void 0;
|
|
33
|
+
exports.createCustomPager = createCustomPager;
|
|
34
|
+
/**
|
|
35
|
+
*
|
|
36
|
+
* @template TItem The type of the items in the page.
|
|
37
|
+
* @template TResponse The type of the API response.
|
|
38
|
+
*/
|
|
39
|
+
class CustomPager {
|
|
40
|
+
constructor(args) {
|
|
41
|
+
this.response = args.response;
|
|
42
|
+
this.rawResponse = args.rawResponse;
|
|
43
|
+
this.data = args.items;
|
|
44
|
+
this._hasNextPage = args.hasNextPage;
|
|
45
|
+
this._hasPreviousPage = args.hasPreviousPage;
|
|
46
|
+
this.nextRequest = args.nextRequest;
|
|
47
|
+
this.previousRequest = args.previousRequest;
|
|
48
|
+
this.sendRequest = args.sendRequest;
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* @returns whether there is a next page to load
|
|
52
|
+
*/
|
|
53
|
+
hasNextPage() {
|
|
54
|
+
return this._hasNextPage;
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* @returns whether there is a previous page to load
|
|
58
|
+
*/
|
|
59
|
+
hasPreviousPage() {
|
|
60
|
+
return this._hasPreviousPage;
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* Returns the current page data.
|
|
64
|
+
* This is an alias for the `data` property for consistency with other pagination APIs.
|
|
65
|
+
*
|
|
66
|
+
* @returns the items from the current page
|
|
67
|
+
*/
|
|
68
|
+
getCurrentPage() {
|
|
69
|
+
return this.data;
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* Retrieves the next page of results.
|
|
73
|
+
* @returns this pager with updated data
|
|
74
|
+
* @throws Error if there is no next page
|
|
75
|
+
*/
|
|
76
|
+
getNextPage() {
|
|
77
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
78
|
+
if (!this._hasNextPage || !this.nextRequest) {
|
|
79
|
+
throw new Error("No next page available");
|
|
80
|
+
}
|
|
81
|
+
const response = yield this.sendRequest(this.nextRequest);
|
|
82
|
+
if (!response.ok) {
|
|
83
|
+
const reason = response.error.reason === "status-code" ? `HTTP ${response.error.statusCode}` : response.error.reason;
|
|
84
|
+
throw new Error(`Failed to fetch next page: ${reason}`);
|
|
85
|
+
}
|
|
86
|
+
const data = response.body;
|
|
87
|
+
const rawResponse = response.rawResponse;
|
|
88
|
+
const parsed = yield parse({ request: this.nextRequest, data, rawResponse });
|
|
89
|
+
this.response = data;
|
|
90
|
+
this.rawResponse = rawResponse;
|
|
91
|
+
this.data = parsed.items;
|
|
92
|
+
this._hasNextPage = parsed.hasNextPage;
|
|
93
|
+
this._hasPreviousPage = parsed.hasPreviousPage;
|
|
94
|
+
this.nextRequest = parsed.nextRequest;
|
|
95
|
+
this.previousRequest = parsed.previousRequest;
|
|
96
|
+
return this;
|
|
97
|
+
});
|
|
98
|
+
}
|
|
99
|
+
/**
|
|
100
|
+
* Retrieves the previous page of results.
|
|
101
|
+
* @returns this pager with updated data
|
|
102
|
+
* @throws Error if there is no previous page
|
|
103
|
+
*/
|
|
104
|
+
getPreviousPage() {
|
|
105
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
106
|
+
if (!this._hasPreviousPage || !this.previousRequest) {
|
|
107
|
+
throw new Error("No previous page available");
|
|
108
|
+
}
|
|
109
|
+
const response = yield this.sendRequest(this.previousRequest);
|
|
110
|
+
if (!response.ok) {
|
|
111
|
+
const reason = response.error.reason === "status-code" ? `HTTP ${response.error.statusCode}` : response.error.reason;
|
|
112
|
+
throw new Error(`Failed to fetch previous page: ${reason}`);
|
|
113
|
+
}
|
|
114
|
+
const data = response.body;
|
|
115
|
+
const rawResponse = response.rawResponse;
|
|
116
|
+
const parsed = yield parse({ request: this.previousRequest, data, rawResponse });
|
|
117
|
+
this.response = data;
|
|
118
|
+
this.rawResponse = rawResponse;
|
|
119
|
+
this.data = parsed.items;
|
|
120
|
+
this._hasNextPage = parsed.hasNextPage;
|
|
121
|
+
this._hasPreviousPage = parsed.hasPreviousPage;
|
|
122
|
+
this.nextRequest = parsed.nextRequest;
|
|
123
|
+
this.previousRequest = parsed.previousRequest;
|
|
124
|
+
return this;
|
|
125
|
+
});
|
|
126
|
+
}
|
|
127
|
+
iterMessages() {
|
|
128
|
+
return __asyncGenerator(this, arguments, function* iterMessages_1() {
|
|
129
|
+
for (const item of this.data) {
|
|
130
|
+
yield yield __await(item);
|
|
131
|
+
}
|
|
132
|
+
while (this.hasNextPage()) {
|
|
133
|
+
yield __await(this.getNextPage());
|
|
134
|
+
for (const item of this.data) {
|
|
135
|
+
yield yield __await(item);
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
});
|
|
139
|
+
}
|
|
140
|
+
[Symbol.asyncIterator]() {
|
|
141
|
+
return __asyncGenerator(this, arguments, function* _a() {
|
|
142
|
+
var _b, e_1, _c, _d;
|
|
143
|
+
try {
|
|
144
|
+
for (var _e = true, _f = __asyncValues(this.iterMessages()), _g; _g = yield __await(_f.next()), _b = _g.done, !_b; _e = true) {
|
|
145
|
+
_d = _g.value;
|
|
146
|
+
_e = false;
|
|
147
|
+
const message = _d;
|
|
148
|
+
yield yield __await(message);
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
152
|
+
finally {
|
|
153
|
+
try {
|
|
154
|
+
if (!_e && !_b && (_c = _f.return)) yield __await(_c.call(_f));
|
|
155
|
+
}
|
|
156
|
+
finally { if (e_1) throw e_1.error; }
|
|
157
|
+
}
|
|
158
|
+
});
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
exports.CustomPager = CustomPager;
|
|
162
|
+
function createCustomPager(_a) {
|
|
163
|
+
return __awaiter(this, arguments, void 0, function* ({ sendRequest, initialHttpRequest, clientOptions, }) {
|
|
164
|
+
const response = yield sendRequest(initialHttpRequest);
|
|
165
|
+
if (!response.ok) {
|
|
166
|
+
const reason = response.error.reason === "status-code" ? `HTTP ${response.error.statusCode}` : response.error.reason;
|
|
167
|
+
throw new Error(`Failed to fetch initial page: ${reason}`);
|
|
168
|
+
}
|
|
169
|
+
const data = response.body;
|
|
170
|
+
const rawResponse = response.rawResponse;
|
|
171
|
+
const parsed = yield parse({ request: initialHttpRequest, data, rawResponse });
|
|
172
|
+
return new CustomPager({
|
|
173
|
+
response: data,
|
|
174
|
+
rawResponse,
|
|
175
|
+
items: parsed.items,
|
|
176
|
+
hasNextPage: parsed.hasNextPage,
|
|
177
|
+
hasPreviousPage: parsed.hasPreviousPage,
|
|
178
|
+
nextRequest: parsed.nextRequest,
|
|
179
|
+
previousRequest: parsed.previousRequest,
|
|
180
|
+
sendRequest: sendRequest,
|
|
181
|
+
});
|
|
182
|
+
});
|
|
183
|
+
}
|
|
184
|
+
function parse(_args) {
|
|
185
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
186
|
+
// Placeholder implementation.
|
|
187
|
+
// TODO: Replace this with actual parsing logic.
|
|
188
|
+
return {
|
|
189
|
+
items: [],
|
|
190
|
+
hasNextPage: false,
|
|
191
|
+
hasPreviousPage: false,
|
|
192
|
+
};
|
|
193
|
+
});
|
|
194
|
+
}
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.Page = void 0;
|
|
3
|
+
exports.Page = exports.createCustomPager = exports.CustomPager = void 0;
|
|
4
|
+
var CustomPager_js_1 = require("./CustomPager.js");
|
|
5
|
+
Object.defineProperty(exports, "CustomPager", { enumerable: true, get: function () { return CustomPager_js_1.CustomPager; } });
|
|
6
|
+
Object.defineProperty(exports, "createCustomPager", { enumerable: true, get: function () { return CustomPager_js_1.createCustomPager; } });
|
|
4
7
|
var Page_js_1 = require("./Page.js");
|
|
5
8
|
Object.defineProperty(exports, "Page", { enumerable: true, get: function () { return Page_js_1.Page; } });
|
|
@@ -71,6 +71,17 @@ function evaluateRuntime() {
|
|
|
71
71
|
version: Bun.version,
|
|
72
72
|
};
|
|
73
73
|
}
|
|
74
|
+
/**
|
|
75
|
+
* A constant that indicates whether the environment the code is running is in React-Native.
|
|
76
|
+
* This check should come before Node.js detection since React Native may have a process polyfill.
|
|
77
|
+
* https://github.com/facebook/react-native/blob/main/packages/react-native/Libraries/Core/setUpNavigator.js
|
|
78
|
+
*/
|
|
79
|
+
const isReactNative = typeof navigator !== "undefined" && (navigator === null || navigator === void 0 ? void 0 : navigator.product) === "ReactNative";
|
|
80
|
+
if (isReactNative) {
|
|
81
|
+
return {
|
|
82
|
+
type: "react-native",
|
|
83
|
+
};
|
|
84
|
+
}
|
|
74
85
|
/**
|
|
75
86
|
* A constant that indicates whether the environment the code is running is Node.JS.
|
|
76
87
|
*/
|
|
@@ -86,16 +97,6 @@ function evaluateRuntime() {
|
|
|
86
97
|
parsedVersion: Number(process.versions.node.split(".")[0]),
|
|
87
98
|
};
|
|
88
99
|
}
|
|
89
|
-
/**
|
|
90
|
-
* A constant that indicates whether the environment the code is running is in React-Native.
|
|
91
|
-
* https://github.com/facebook/react-native/blob/main/packages/react-native/Libraries/Core/setUpNavigator.js
|
|
92
|
-
*/
|
|
93
|
-
const isReactNative = typeof navigator !== "undefined" && (navigator === null || navigator === void 0 ? void 0 : navigator.product) === "ReactNative";
|
|
94
|
-
if (isReactNative) {
|
|
95
|
-
return {
|
|
96
|
-
type: "react-native",
|
|
97
|
-
};
|
|
98
|
-
}
|
|
99
100
|
return {
|
|
100
101
|
type: "unknown",
|
|
101
102
|
};
|
|
@@ -180,6 +180,7 @@ function getObjectUtils(schema) {
|
|
|
180
180
|
value: raw,
|
|
181
181
|
transformBase: (rawBase) => schema.parse(rawBase, opts),
|
|
182
182
|
transformExtension: (rawExtension) => extension.parse(rawExtension, opts),
|
|
183
|
+
breadcrumbsPrefix: opts === null || opts === void 0 ? void 0 : opts.breadcrumbsPrefix,
|
|
183
184
|
});
|
|
184
185
|
},
|
|
185
186
|
json: (parsed, opts) => {
|
|
@@ -188,6 +189,7 @@ function getObjectUtils(schema) {
|
|
|
188
189
|
value: parsed,
|
|
189
190
|
transformBase: (parsedBase) => schema.json(parsedBase, opts),
|
|
190
191
|
transformExtension: (parsedExtension) => extension.json(parsedExtension, opts),
|
|
192
|
+
breadcrumbsPrefix: opts === null || opts === void 0 ? void 0 : opts.breadcrumbsPrefix,
|
|
191
193
|
});
|
|
192
194
|
},
|
|
193
195
|
getType: () => Schema_js_1.SchemaType.OBJECT,
|
|
@@ -224,7 +226,18 @@ function getObjectUtils(schema) {
|
|
|
224
226
|
},
|
|
225
227
|
};
|
|
226
228
|
}
|
|
227
|
-
function validateAndTransformExtendedObject({ extensionKeys, value, transformBase, transformExtension, }) {
|
|
229
|
+
function validateAndTransformExtendedObject({ extensionKeys, value, transformBase, transformExtension, breadcrumbsPrefix = [], }) {
|
|
230
|
+
if (!(0, isPlainObject_js_1.isPlainObject)(value)) {
|
|
231
|
+
return {
|
|
232
|
+
ok: false,
|
|
233
|
+
errors: [
|
|
234
|
+
{
|
|
235
|
+
path: breadcrumbsPrefix,
|
|
236
|
+
message: (0, getErrorMessageForIncorrectType_js_1.getErrorMessageForIncorrectType)(value, "object"),
|
|
237
|
+
},
|
|
238
|
+
],
|
|
239
|
+
};
|
|
240
|
+
}
|
|
228
241
|
const extensionPropertiesSet = new Set(extensionKeys);
|
|
229
242
|
const [extensionProperties, baseProperties] = (0, partition_js_1.partition)((0, keys_js_1.keys)(value), (key) => extensionPropertiesSet.has(key));
|
|
230
243
|
const transformedBase = transformBase((0, filterObject_js_1.filterObject)(value, baseProperties));
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.unknown = exports.string = exports.number = exports.boolean = exports.any = void 0;
|
|
3
|
+
exports.unknown = exports.string = exports.number = exports.never = exports.boolean = exports.any = void 0;
|
|
4
4
|
var any_js_1 = require("./any.js");
|
|
5
5
|
Object.defineProperty(exports, "any", { enumerable: true, get: function () { return any_js_1.any; } });
|
|
6
6
|
var boolean_js_1 = require("./boolean.js");
|
|
7
7
|
Object.defineProperty(exports, "boolean", { enumerable: true, get: function () { return boolean_js_1.boolean; } });
|
|
8
|
+
var never_js_1 = require("./never.js");
|
|
9
|
+
Object.defineProperty(exports, "never", { enumerable: true, get: function () { return never_js_1.never; } });
|
|
8
10
|
var number_js_1 = require("./number.js");
|
|
9
11
|
Object.defineProperty(exports, "number", { enumerable: true, get: function () { return number_js_1.number; } });
|
|
10
12
|
var string_js_1 = require("./string.js");
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.never = void 0;
|
|
4
|
+
const Schema_js_1 = require("../../Schema.js");
|
|
5
|
+
const createIdentitySchemaCreator_js_1 = require("../../utils/createIdentitySchemaCreator.js");
|
|
6
|
+
exports.never = (0, createIdentitySchemaCreator_js_1.createIdentitySchemaCreator)(Schema_js_1.SchemaType.NEVER, (_value, { breadcrumbsPrefix = [] } = {}) => ({
|
|
7
|
+
ok: false,
|
|
8
|
+
errors: [
|
|
9
|
+
{
|
|
10
|
+
path: breadcrumbsPrefix,
|
|
11
|
+
message: "Expected never",
|
|
12
|
+
},
|
|
13
|
+
],
|
|
14
|
+
}));
|
|
@@ -6,7 +6,11 @@ const json_js_1 = require("../core/json.js");
|
|
|
6
6
|
class HumeError extends Error {
|
|
7
7
|
constructor({ message, statusCode, body, rawResponse, }) {
|
|
8
8
|
super(buildMessage({ message, statusCode, body }));
|
|
9
|
-
Object.setPrototypeOf(this,
|
|
9
|
+
Object.setPrototypeOf(this, new.target.prototype);
|
|
10
|
+
if (Error.captureStackTrace) {
|
|
11
|
+
Error.captureStackTrace(this, this.constructor);
|
|
12
|
+
}
|
|
13
|
+
this.name = this.constructor.name;
|
|
10
14
|
this.statusCode = statusCode;
|
|
11
15
|
this.body = body;
|
|
12
16
|
this.rawResponse = rawResponse;
|
|
@@ -5,7 +5,11 @@ exports.HumeTimeoutError = void 0;
|
|
|
5
5
|
class HumeTimeoutError extends Error {
|
|
6
6
|
constructor(message) {
|
|
7
7
|
super(message);
|
|
8
|
-
Object.setPrototypeOf(this,
|
|
8
|
+
Object.setPrototypeOf(this, new.target.prototype);
|
|
9
|
+
if (Error.captureStackTrace) {
|
|
10
|
+
Error.captureStackTrace(this, this.constructor);
|
|
11
|
+
}
|
|
12
|
+
this.name = this.constructor.name;
|
|
9
13
|
}
|
|
10
14
|
}
|
|
11
15
|
exports.HumeTimeoutError = HumeTimeoutError;
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
4
|
+
if (k2 === undefined) k2 = k;
|
|
5
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
6
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
7
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
8
|
+
}
|
|
9
|
+
Object.defineProperty(o, k2, desc);
|
|
10
|
+
}) : (function(o, m, k, k2) {
|
|
11
|
+
if (k2 === undefined) k2 = k;
|
|
12
|
+
o[k2] = m[k];
|
|
13
|
+
}));
|
|
14
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
15
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
16
|
+
}) : function(o, v) {
|
|
17
|
+
o["default"] = v;
|
|
18
|
+
});
|
|
19
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
20
|
+
var ownKeys = function(o) {
|
|
21
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
22
|
+
var ar = [];
|
|
23
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
24
|
+
return ar;
|
|
25
|
+
};
|
|
26
|
+
return ownKeys(o);
|
|
27
|
+
};
|
|
28
|
+
return function (mod) {
|
|
29
|
+
if (mod && mod.__esModule) return mod;
|
|
30
|
+
var result = {};
|
|
31
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
32
|
+
__setModuleDefault(result, mod);
|
|
33
|
+
return result;
|
|
34
|
+
};
|
|
35
|
+
})();
|
|
36
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
37
|
+
exports.handleNonStatusCodeError = handleNonStatusCodeError;
|
|
38
|
+
const errors = __importStar(require("./index.js"));
|
|
39
|
+
function handleNonStatusCodeError(error, rawResponse, method, path) {
|
|
40
|
+
switch (error.reason) {
|
|
41
|
+
case "non-json":
|
|
42
|
+
throw new errors.HumeError({
|
|
43
|
+
statusCode: error.statusCode,
|
|
44
|
+
body: error.rawBody,
|
|
45
|
+
rawResponse: rawResponse,
|
|
46
|
+
});
|
|
47
|
+
case "body-is-null":
|
|
48
|
+
throw new errors.HumeError({
|
|
49
|
+
statusCode: error.statusCode,
|
|
50
|
+
rawResponse: rawResponse,
|
|
51
|
+
});
|
|
52
|
+
case "timeout":
|
|
53
|
+
throw new errors.HumeTimeoutError(`Timeout exceeded when calling ${method} ${path}.`);
|
|
54
|
+
case "unknown":
|
|
55
|
+
throw new errors.HumeError({
|
|
56
|
+
message: error.errorMessage,
|
|
57
|
+
rawResponse: rawResponse,
|
|
58
|
+
});
|
|
59
|
+
default:
|
|
60
|
+
throw new errors.HumeError({
|
|
61
|
+
message: "Unknown error",
|
|
62
|
+
rawResponse: rawResponse,
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
}
|
|
@@ -6,8 +6,8 @@ export declare const ReturnVoice: core.serialization.ObjectSchema<serializers.em
|
|
|
6
6
|
export declare namespace ReturnVoice {
|
|
7
7
|
interface Raw {
|
|
8
8
|
compatible_octave_models?: string[] | null;
|
|
9
|
-
id
|
|
10
|
-
name
|
|
11
|
-
provider
|
|
9
|
+
id: string;
|
|
10
|
+
name: string;
|
|
11
|
+
provider: VoiceProvider.Raw;
|
|
12
12
|
}
|
|
13
13
|
}
|
|
@@ -39,7 +39,7 @@ const core = __importStar(require("../../../../core/index.js"));
|
|
|
39
39
|
const VoiceProvider_js_1 = require("./VoiceProvider.js");
|
|
40
40
|
exports.ReturnVoice = core.serialization.object({
|
|
41
41
|
compatibleOctaveModels: core.serialization.property("compatible_octave_models", core.serialization.list(core.serialization.string()).optional()),
|
|
42
|
-
id: core.serialization.string()
|
|
43
|
-
name: core.serialization.string()
|
|
44
|
-
provider: VoiceProvider_js_1.VoiceProvider
|
|
42
|
+
id: core.serialization.string(),
|
|
43
|
+
name: core.serialization.string(),
|
|
44
|
+
provider: VoiceProvider_js_1.VoiceProvider,
|
|
45
45
|
});
|
|
@@ -5,9 +5,9 @@ import { ReturnVoice } from "./ReturnVoice.js";
|
|
|
5
5
|
export declare const ReturnPagedVoices: core.serialization.ObjectSchema<serializers.tts.ReturnPagedVoices.Raw, Hume.tts.ReturnPagedVoices>;
|
|
6
6
|
export declare namespace ReturnPagedVoices {
|
|
7
7
|
interface Raw {
|
|
8
|
-
page_number
|
|
9
|
-
page_size
|
|
10
|
-
total_pages
|
|
11
|
-
voices_page
|
|
8
|
+
page_number: number;
|
|
9
|
+
page_size: number;
|
|
10
|
+
total_pages: number;
|
|
11
|
+
voices_page: ReturnVoice.Raw[];
|
|
12
12
|
}
|
|
13
13
|
}
|
|
@@ -38,8 +38,8 @@ exports.ReturnPagedVoices = void 0;
|
|
|
38
38
|
const core = __importStar(require("../../../../core/index.js"));
|
|
39
39
|
const ReturnVoice_js_1 = require("./ReturnVoice.js");
|
|
40
40
|
exports.ReturnPagedVoices = core.serialization.object({
|
|
41
|
-
pageNumber: core.serialization.property("page_number", core.serialization.number()
|
|
42
|
-
pageSize: core.serialization.property("page_size", core.serialization.number()
|
|
43
|
-
totalPages: core.serialization.property("total_pages", core.serialization.number()
|
|
44
|
-
voicesPage: core.serialization.property("voices_page", core.serialization.list(ReturnVoice_js_1.ReturnVoice)
|
|
41
|
+
pageNumber: core.serialization.property("page_number", core.serialization.number()),
|
|
42
|
+
pageSize: core.serialization.property("page_size", core.serialization.number()),
|
|
43
|
+
totalPages: core.serialization.property("total_pages", core.serialization.number()),
|
|
44
|
+
voicesPage: core.serialization.property("voices_page", core.serialization.list(ReturnVoice_js_1.ReturnVoice)),
|
|
45
45
|
});
|
|
@@ -6,8 +6,8 @@ export declare const ReturnVoice: core.serialization.ObjectSchema<serializers.tt
|
|
|
6
6
|
export declare namespace ReturnVoice {
|
|
7
7
|
interface Raw {
|
|
8
8
|
compatible_octave_models?: string[] | null;
|
|
9
|
-
id
|
|
10
|
-
name
|
|
11
|
-
provider
|
|
9
|
+
id: string;
|
|
10
|
+
name: string;
|
|
11
|
+
provider: VoiceProvider.Raw;
|
|
12
12
|
}
|
|
13
13
|
}
|
|
@@ -39,7 +39,7 @@ const core = __importStar(require("../../../../core/index.js"));
|
|
|
39
39
|
const VoiceProvider_js_1 = require("./VoiceProvider.js");
|
|
40
40
|
exports.ReturnVoice = core.serialization.object({
|
|
41
41
|
compatibleOctaveModels: core.serialization.property("compatible_octave_models", core.serialization.list(core.serialization.string()).optional()),
|
|
42
|
-
id: core.serialization.string()
|
|
43
|
-
name: core.serialization.string()
|
|
44
|
-
provider: VoiceProvider_js_1.VoiceProvider
|
|
42
|
+
id: core.serialization.string(),
|
|
43
|
+
name: core.serialization.string(),
|
|
44
|
+
provider: VoiceProvider_js_1.VoiceProvider,
|
|
45
45
|
});
|
package/dist/cjs/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const SDK_VERSION = "0.15.
|
|
1
|
+
export declare const SDK_VERSION = "0.15.10";
|
package/dist/cjs/version.js
CHANGED
|
@@ -1,10 +1,24 @@
|
|
|
1
|
-
import { Readable } from "stream";
|
|
2
1
|
/**
|
|
3
|
-
*
|
|
2
|
+
* A minimal Writable-like interface that SilenceFiller can pipe to.
|
|
3
|
+
* This matches the subset of Node.js Writable that we need.
|
|
4
|
+
*/
|
|
5
|
+
export interface PipeDestination {
|
|
6
|
+
write(chunk: Uint8Array): boolean;
|
|
7
|
+
end?(): void;
|
|
8
|
+
on?(event: "drain", listener: () => void): this;
|
|
9
|
+
once?(event: "drain", listener: () => void): this;
|
|
10
|
+
removeListener?(event: "drain", listener: () => void): this;
|
|
11
|
+
}
|
|
12
|
+
type EventListener = (...args: unknown[]) => void;
|
|
13
|
+
/**
|
|
14
|
+
* SilenceFiller is a pipeable stream that intersperses incoming audio data
|
|
4
15
|
* with bytes of silence. This is important in some cases to keep an audio
|
|
5
16
|
* stream "alive". Audio players, such as ffmpeg, can interpret inactivity as
|
|
6
17
|
* meaning the stream is ended, or disconnected.
|
|
7
18
|
*
|
|
19
|
+
* This implementation does not depend on Node.js built-ins and can work in
|
|
20
|
+
* any JavaScript environment, while still being pipeable to Node.js streams.
|
|
21
|
+
*
|
|
8
22
|
* @example
|
|
9
23
|
* ```typescript
|
|
10
24
|
* import { SilenceFiller } from 'hume';
|
|
@@ -29,12 +43,15 @@ import { Readable } from "stream";
|
|
|
29
43
|
* await silenceFiller.endStream();
|
|
30
44
|
* ```
|
|
31
45
|
*/
|
|
32
|
-
export declare class SilenceFiller
|
|
46
|
+
export declare class SilenceFiller {
|
|
33
47
|
private unclockedSilenceFiller;
|
|
34
48
|
private isStarted;
|
|
35
|
-
private
|
|
49
|
+
private pushIntervalId;
|
|
36
50
|
private bytesPerSample;
|
|
37
51
|
private pushIntervalMs;
|
|
52
|
+
private destination;
|
|
53
|
+
private eventListeners;
|
|
54
|
+
private ended;
|
|
38
55
|
/**
|
|
39
56
|
* Creates a new SilenceFiller instance.
|
|
40
57
|
*
|
|
@@ -46,16 +63,52 @@ export declare class SilenceFiller extends Readable {
|
|
|
46
63
|
* playback will take longer to start.
|
|
47
64
|
*/
|
|
48
65
|
constructor(pushIntervalMs?: number, sampleRate?: number, bytesPerSample?: number, bufferSize?: number);
|
|
66
|
+
/**
|
|
67
|
+
* Pipes the output of this SilenceFiller to a writable destination.
|
|
68
|
+
*
|
|
69
|
+
* @param destination - The destination to pipe to (e.g., a Node.js Writable stream).
|
|
70
|
+
* @returns The destination, for chaining.
|
|
71
|
+
*/
|
|
72
|
+
pipe<T extends PipeDestination>(destination: T): T;
|
|
73
|
+
/**
|
|
74
|
+
* Registers an event listener.
|
|
75
|
+
*
|
|
76
|
+
* @param event - The event name ('error', 'end').
|
|
77
|
+
* @param listener - The listener function.
|
|
78
|
+
* @returns This instance, for chaining.
|
|
79
|
+
*/
|
|
80
|
+
on(event: string, listener: EventListener): this;
|
|
81
|
+
/**
|
|
82
|
+
* Registers a one-time event listener.
|
|
83
|
+
*
|
|
84
|
+
* @param event - The event name ('error', 'end').
|
|
85
|
+
* @param listener - The listener function.
|
|
86
|
+
* @returns This instance, for chaining.
|
|
87
|
+
*/
|
|
88
|
+
once(event: string, listener: EventListener): this;
|
|
89
|
+
/**
|
|
90
|
+
* Removes an event listener.
|
|
91
|
+
*
|
|
92
|
+
* @param event - The event name.
|
|
93
|
+
* @param listener - The listener function to remove.
|
|
94
|
+
* @returns This instance, for chaining.
|
|
95
|
+
*/
|
|
96
|
+
off(event: string, listener: EventListener): this;
|
|
97
|
+
/**
|
|
98
|
+
* Emits an event to all registered listeners.
|
|
99
|
+
*
|
|
100
|
+
* @param event - The event name.
|
|
101
|
+
* @param args - Arguments to pass to listeners.
|
|
102
|
+
*/
|
|
103
|
+
private emit;
|
|
49
104
|
/**
|
|
50
105
|
* Writes audio data to the silence filler.
|
|
51
106
|
*
|
|
52
|
-
* @param audioBuffer - The audio buffer to write.
|
|
107
|
+
* @param audioBuffer - The audio buffer to write (Uint8Array or Buffer).
|
|
53
108
|
*/
|
|
54
|
-
writeAudio(audioBuffer:
|
|
109
|
+
writeAudio(audioBuffer: Uint8Array): void;
|
|
55
110
|
private startPushInterval;
|
|
56
111
|
private pushData;
|
|
57
|
-
_read(): void;
|
|
58
|
-
_destroy(error: Error | null, callback: (error?: Error | null) => void): void;
|
|
59
112
|
/**
|
|
60
113
|
* Ends the stream and drains all remaining audio data.
|
|
61
114
|
*
|
|
@@ -80,6 +133,7 @@ export declare class UnclockedSilenceFiller {
|
|
|
80
133
|
private sampleRate;
|
|
81
134
|
private bytesPerSample;
|
|
82
135
|
constructor(bufferSize: number, sampleRate: number, bytesPerSample: number);
|
|
83
|
-
writeAudio(audioBuffer:
|
|
84
|
-
readAudio(timestamp: number):
|
|
136
|
+
writeAudio(audioBuffer: Uint8Array, timestamp: number): void;
|
|
137
|
+
readAudio(timestamp: number): Uint8Array | null;
|
|
85
138
|
}
|
|
139
|
+
export {};
|