@corti/sdk 1.0.0-alpha → 1.0.0-alpha.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +126 -44
- package/dist/cjs/BaseClient.js +2 -2
- package/dist/cjs/api/errors/ForbiddenError.d.ts +1 -2
- package/dist/cjs/api/errors/UnprocessableEntityError.d.ts +6 -0
- package/dist/cjs/api/errors/UnprocessableEntityError.js +54 -0
- package/dist/cjs/api/errors/index.d.ts +1 -0
- package/dist/cjs/api/errors/index.js +1 -0
- package/dist/cjs/api/resources/agents/client/Client.d.ts +6 -0
- package/dist/cjs/api/resources/agents/client/Client.js +42 -0
- package/dist/cjs/api/resources/codes/client/Client.d.ts +15 -3
- package/dist/cjs/api/resources/codes/client/Client.js +16 -10
- package/dist/cjs/api/resources/codes/client/requests/CodesGeneralPredictRequest.d.ts +16 -4
- package/dist/cjs/api/resources/documents/client/Client.js +5 -35
- package/dist/cjs/api/resources/interactions/client/Client.js +5 -35
- package/dist/cjs/api/resources/recordings/client/Client.js +4 -28
- package/dist/cjs/api/resources/stream/client/Client.d.ts +2 -2
- package/dist/cjs/api/resources/stream/client/Client.js +4 -2
- package/dist/cjs/api/resources/stream/client/Socket.d.ts +1 -1
- package/dist/cjs/api/resources/transcribe/client/Client.d.ts +2 -2
- package/dist/cjs/api/resources/transcribe/client/Client.js +4 -2
- package/dist/cjs/api/resources/transcribe/client/Socket.d.ts +1 -1
- package/dist/cjs/api/resources/transcripts/client/Client.js +4 -28
- package/dist/cjs/api/types/AgentsErrorResponse.d.ts +12 -0
- package/dist/cjs/api/types/AgentsErrorResponse.js +3 -0
- package/dist/cjs/api/types/AgentsValidationError.d.ts +8 -0
- package/dist/cjs/api/types/AgentsValidationError.js +3 -0
- package/dist/cjs/api/types/AgentsValidationErrorErrorsItem.d.ts +4 -0
- package/dist/cjs/api/types/AgentsValidationErrorErrorsItem.js +3 -0
- package/dist/cjs/api/types/AgentsValidationErrorResponse.d.ts +4 -0
- package/dist/cjs/api/types/AgentsValidationErrorResponse.js +3 -0
- package/dist/cjs/api/types/CodesFilter.d.ts +11 -0
- package/dist/cjs/api/types/CodesFilter.js +3 -0
- package/dist/cjs/api/types/CodesGeneralReadResponse.d.ts +2 -0
- package/dist/cjs/api/types/CodesGeneralReadResponseAlternativesItem.d.ts +9 -0
- package/dist/cjs/api/types/CodesGeneralReadResponseAlternativesItem.js +3 -0
- package/dist/cjs/api/types/CodesGeneralReadResponseEvidencesItem.d.ts +6 -2
- package/dist/cjs/api/types/CodesGeneralResponse.d.ts +2 -2
- package/dist/cjs/api/types/CommonCodingSystemEnum.d.ts +2 -1
- package/dist/cjs/api/types/CommonCodingSystemEnum.js +2 -1
- package/dist/cjs/api/types/StreamConfigMessage.d.ts +1 -1
- package/dist/cjs/api/types/StreamEndMessage.d.ts +1 -2
- package/dist/cjs/api/types/StreamEndedMessage.d.ts +1 -2
- package/dist/cjs/api/types/StreamErrorMessage.d.ts +1 -1
- package/dist/cjs/api/types/StreamFactsMessage.d.ts +1 -1
- package/dist/cjs/api/types/StreamFlushMessage.d.ts +1 -2
- package/dist/cjs/api/types/StreamFlushedMessage.d.ts +1 -2
- package/dist/cjs/api/types/StreamTranscriptMessage.d.ts +1 -1
- package/dist/cjs/api/types/StreamUsageMessage.d.ts +1 -2
- package/dist/cjs/api/types/TranscribeCommandMessage.d.ts +1 -1
- package/dist/cjs/api/types/TranscribeCommandVariable.d.ts +1 -2
- package/dist/cjs/api/types/TranscribeConfigMessage.d.ts +1 -1
- package/dist/cjs/api/types/TranscribeEndMessage.d.ts +1 -2
- package/dist/cjs/api/types/TranscribeEndedMessage.d.ts +1 -2
- package/dist/cjs/api/types/TranscribeErrorMessage.d.ts +1 -1
- package/dist/cjs/api/types/TranscribeFlushMessage.d.ts +1 -2
- package/dist/cjs/api/types/TranscribeFlushedMessage.d.ts +1 -2
- package/dist/cjs/api/types/TranscribeFormattingDates.d.ts +4 -4
- package/dist/cjs/api/types/TranscribeFormattingDates.js +4 -4
- package/dist/cjs/api/types/TranscribeFormattingNumbers.d.ts +2 -2
- package/dist/cjs/api/types/TranscribeFormattingNumbers.js +2 -2
- package/dist/cjs/api/types/TranscribeFormattingNumericRanges.d.ts +1 -1
- package/dist/cjs/api/types/TranscribeFormattingNumericRanges.js +1 -1
- package/dist/cjs/api/types/TranscribeFormattingOrdinals.d.ts +1 -0
- package/dist/cjs/api/types/TranscribeFormattingOrdinals.js +1 -0
- package/dist/cjs/api/types/TranscribeFormattingTimes.d.ts +3 -2
- package/dist/cjs/api/types/TranscribeFormattingTimes.js +3 -2
- package/dist/cjs/api/types/TranscribeTranscriptMessage.d.ts +1 -1
- package/dist/cjs/api/types/TranscribeUsageMessage.d.ts +1 -2
- package/dist/cjs/api/types/index.d.ts +6 -19
- package/dist/cjs/api/types/index.js +6 -19
- package/dist/cjs/auth/OAuthAuthProvider.d.ts +1 -99
- package/dist/cjs/auth/OAuthAuthProvider.js +4 -276
- package/dist/cjs/core/fetcher/index.d.ts +2 -11
- package/dist/cjs/core/fetcher/index.js +16 -15
- package/dist/cjs/custom/CortiClient.d.ts +15 -4
- package/dist/cjs/custom/CortiClient.js +8 -5
- package/dist/cjs/custom/CortiWebSocketProxyClient.d.ts +10 -40
- package/dist/cjs/custom/CortiWebSocketProxyClient.js +12 -74
- package/dist/cjs/custom/OAuthAuthProvider.d.ts +99 -0
- package/dist/cjs/custom/OAuthAuthProvider.js +290 -0
- package/dist/cjs/custom/auth/CortiAuth.d.ts +129 -0
- package/dist/cjs/custom/auth/CortiAuth.js +195 -0
- package/dist/cjs/custom/auth/OAuthAuthCodeAuthProvider.d.ts +23 -0
- package/dist/cjs/custom/auth/OAuthAuthCodeAuthProvider.js +164 -0
- package/dist/cjs/custom/auth/OAuthPkceAuthProvider.d.ts +23 -0
- package/dist/cjs/custom/auth/OAuthPkceAuthProvider.js +164 -0
- package/dist/cjs/custom/auth/OAuthRopcAuthProvider.d.ts +22 -0
- package/dist/cjs/custom/auth/OAuthRopcAuthProvider.js +137 -0
- package/dist/cjs/custom/fetcher.d.ts +3 -0
- package/dist/cjs/custom/fetcher.js +8 -0
- package/dist/cjs/custom/index.d.ts +10 -0
- package/dist/cjs/custom/index.js +55 -1
- package/dist/cjs/custom/overrides/OAuthAuthProvider.d.ts +99 -0
- package/dist/cjs/custom/overrides/OAuthAuthProvider.js +289 -0
- package/dist/cjs/custom/overrides/fetcher/index.d.ts +12 -0
- package/dist/cjs/custom/overrides/fetcher/index.js +18 -0
- package/dist/cjs/custom/overrides/index.d.ts +14 -0
- package/dist/cjs/custom/overrides/index.js +61 -0
- package/dist/cjs/custom/proxy/CustomProxyStream.d.ts +17 -0
- package/dist/cjs/custom/proxy/CustomProxyStream.js +18 -0
- package/dist/cjs/custom/proxy/CustomProxyTranscribe.d.ts +17 -0
- package/dist/cjs/custom/proxy/CustomProxyTranscribe.js +21 -0
- package/dist/cjs/custom/stream/CustomStream.d.ts +39 -0
- package/dist/cjs/custom/stream/CustomStream.js +183 -0
- package/dist/cjs/custom/stream/CustomStreamSocket.d.ts +7 -0
- package/dist/cjs/custom/stream/CustomStreamSocket.js +17 -0
- package/dist/cjs/custom/stream/parseStreamResponseType.d.ts +2 -0
- package/dist/cjs/custom/stream/parseStreamResponseType.js +49 -0
- package/dist/cjs/custom/transcribe/CustomTranscribe.d.ts +38 -0
- package/dist/cjs/custom/transcribe/CustomTranscribe.js +181 -0
- package/dist/cjs/custom/transcribe/CustomTranscribeSocket.d.ts +7 -0
- package/dist/cjs/custom/transcribe/CustomTranscribeSocket.js +17 -0
- package/dist/cjs/custom/transcribe/parseTranscribeResponseType.d.ts +2 -0
- package/dist/cjs/custom/transcribe/parseTranscribeResponseType.js +49 -0
- package/dist/cjs/custom/utils/encodeHeadersAsWsProtocols.d.ts +30 -0
- package/dist/cjs/custom/utils/encodeHeadersAsWsProtocols.js +102 -0
- package/dist/cjs/custom/utils/index.d.ts +3 -0
- package/dist/cjs/custom/utils/index.js +10 -0
- package/dist/cjs/custom/utils/localStorageHelpers.js +11 -9
- package/dist/cjs/custom/utils/withCredentialsConfig.d.ts +2 -0
- package/dist/cjs/custom/utils/withCredentialsConfig.js +15 -0
- package/dist/cjs/index.d.ts +1 -16
- package/dist/cjs/index.js +1 -47
- package/dist/cjs/serialization/resources/codes/client/requests/CodesGeneralPredictRequest.d.ts +2 -1
- package/dist/cjs/serialization/resources/codes/client/requests/CodesGeneralPredictRequest.js +2 -1
- package/dist/cjs/serialization/resources/stream/client/socket/StreamSocketResponse.d.ts +2 -2
- package/dist/cjs/serialization/resources/stream/client/socket/StreamSocketResponse.js +1 -1
- package/dist/cjs/serialization/resources/transcribe/client/socket/TranscribeSocketResponse.d.ts +2 -2
- package/dist/cjs/serialization/resources/transcribe/client/socket/TranscribeSocketResponse.js +1 -1
- package/dist/cjs/serialization/types/AgentsErrorResponse.d.ts +13 -0
- package/dist/cjs/serialization/types/AgentsErrorResponse.js +46 -0
- package/dist/cjs/serialization/types/AgentsValidationError.d.ts +14 -0
- package/dist/cjs/serialization/types/AgentsValidationError.js +46 -0
- package/dist/cjs/serialization/types/AgentsValidationErrorErrorsItem.d.ts +10 -0
- package/dist/cjs/serialization/types/AgentsValidationErrorErrorsItem.js +42 -0
- package/dist/cjs/serialization/types/AgentsValidationErrorResponse.d.ts +10 -0
- package/dist/cjs/serialization/types/AgentsValidationErrorResponse.js +45 -0
- package/dist/cjs/serialization/types/CodesFilter.d.ts +11 -0
- package/dist/cjs/serialization/types/CodesFilter.js +43 -0
- package/dist/cjs/serialization/types/CodesGeneralReadResponse.d.ts +2 -0
- package/dist/cjs/serialization/types/CodesGeneralReadResponse.js +2 -0
- package/dist/cjs/serialization/types/CodesGeneralReadResponseAlternativesItem.d.ts +10 -0
- package/dist/cjs/serialization/types/CodesGeneralReadResponseAlternativesItem.js +42 -0
- package/dist/cjs/serialization/types/CodesGeneralReadResponseEvidencesItem.d.ts +4 -2
- package/dist/cjs/serialization/types/CodesGeneralReadResponseEvidencesItem.js +4 -2
- package/dist/cjs/serialization/types/CommonCodingSystemEnum.d.ts +1 -1
- package/dist/cjs/serialization/types/CommonCodingSystemEnum.js +1 -1
- package/dist/cjs/serialization/types/StreamConfigMessage.d.ts +1 -2
- package/dist/cjs/serialization/types/StreamConfigMessage.js +1 -2
- package/dist/cjs/serialization/types/StreamEndMessage.d.ts +1 -2
- package/dist/cjs/serialization/types/StreamEndMessage.js +1 -2
- package/dist/cjs/serialization/types/StreamEndedMessage.d.ts +1 -2
- package/dist/cjs/serialization/types/StreamEndedMessage.js +1 -2
- package/dist/cjs/serialization/types/StreamErrorMessage.d.ts +1 -2
- package/dist/cjs/serialization/types/StreamErrorMessage.js +1 -2
- package/dist/cjs/serialization/types/StreamFactsMessage.d.ts +1 -2
- package/dist/cjs/serialization/types/StreamFactsMessage.js +1 -2
- package/dist/cjs/serialization/types/StreamFlushMessage.d.ts +1 -2
- package/dist/cjs/serialization/types/StreamFlushMessage.js +1 -2
- package/dist/cjs/serialization/types/StreamFlushedMessage.d.ts +1 -2
- package/dist/cjs/serialization/types/StreamFlushedMessage.js +1 -2
- package/dist/cjs/serialization/types/StreamTranscriptMessage.d.ts +1 -2
- package/dist/cjs/serialization/types/StreamTranscriptMessage.js +1 -2
- package/dist/cjs/serialization/types/StreamUsageMessage.d.ts +1 -2
- package/dist/cjs/serialization/types/StreamUsageMessage.js +1 -2
- package/dist/cjs/serialization/types/TranscribeCommandMessage.d.ts +1 -2
- package/dist/cjs/serialization/types/TranscribeCommandMessage.js +1 -2
- package/dist/cjs/serialization/types/TranscribeCommandVariable.d.ts +1 -2
- package/dist/cjs/serialization/types/TranscribeCommandVariable.js +1 -2
- package/dist/cjs/serialization/types/TranscribeConfigMessage.d.ts +1 -2
- package/dist/cjs/serialization/types/TranscribeConfigMessage.js +1 -2
- package/dist/cjs/serialization/types/TranscribeEndMessage.d.ts +1 -2
- package/dist/cjs/serialization/types/TranscribeEndMessage.js +1 -2
- package/dist/cjs/serialization/types/TranscribeEndedMessage.d.ts +1 -2
- package/dist/cjs/serialization/types/TranscribeEndedMessage.js +1 -2
- package/dist/cjs/serialization/types/TranscribeErrorMessage.d.ts +1 -2
- package/dist/cjs/serialization/types/TranscribeErrorMessage.js +1 -2
- package/dist/cjs/serialization/types/TranscribeFlushMessage.d.ts +1 -2
- package/dist/cjs/serialization/types/TranscribeFlushMessage.js +1 -2
- package/dist/cjs/serialization/types/TranscribeFlushedMessage.d.ts +1 -2
- package/dist/cjs/serialization/types/TranscribeFlushedMessage.js +1 -2
- package/dist/cjs/serialization/types/TranscribeFormattingDates.d.ts +1 -1
- package/dist/cjs/serialization/types/TranscribeFormattingDates.js +1 -1
- package/dist/cjs/serialization/types/TranscribeFormattingNumbers.d.ts +1 -1
- package/dist/cjs/serialization/types/TranscribeFormattingNumbers.js +1 -1
- package/dist/cjs/serialization/types/TranscribeFormattingNumericRanges.d.ts +1 -1
- package/dist/cjs/serialization/types/TranscribeFormattingNumericRanges.js +1 -1
- package/dist/cjs/serialization/types/TranscribeFormattingOrdinals.d.ts +1 -1
- package/dist/cjs/serialization/types/TranscribeFormattingOrdinals.js +1 -1
- package/dist/cjs/serialization/types/TranscribeFormattingTimes.d.ts +1 -1
- package/dist/cjs/serialization/types/TranscribeFormattingTimes.js +1 -1
- package/dist/cjs/serialization/types/TranscribeTranscriptMessage.d.ts +1 -2
- package/dist/cjs/serialization/types/TranscribeTranscriptMessage.js +1 -2
- package/dist/cjs/serialization/types/TranscribeUsageMessage.d.ts +1 -2
- package/dist/cjs/serialization/types/TranscribeUsageMessage.js +1 -2
- package/dist/cjs/serialization/types/index.d.ts +6 -19
- package/dist/cjs/serialization/types/index.js +6 -19
- package/dist/cjs/version.d.ts +1 -1
- package/dist/cjs/version.js +1 -1
- package/dist/esm/BaseClient.mjs +2 -2
- package/dist/esm/api/errors/ForbiddenError.d.mts +1 -2
- package/dist/esm/api/errors/UnprocessableEntityError.d.mts +6 -0
- package/dist/esm/api/errors/UnprocessableEntityError.mjs +17 -0
- package/dist/esm/api/errors/index.d.mts +1 -0
- package/dist/esm/api/errors/index.mjs +1 -0
- package/dist/esm/api/resources/agents/client/Client.d.mts +6 -0
- package/dist/esm/api/resources/agents/client/Client.mjs +42 -0
- package/dist/esm/api/resources/codes/client/Client.d.mts +15 -3
- package/dist/esm/api/resources/codes/client/Client.mjs +16 -10
- package/dist/esm/api/resources/codes/client/requests/CodesGeneralPredictRequest.d.mts +16 -4
- package/dist/esm/api/resources/documents/client/Client.mjs +5 -35
- package/dist/esm/api/resources/interactions/client/Client.mjs +5 -35
- package/dist/esm/api/resources/recordings/client/Client.mjs +4 -28
- package/dist/esm/api/resources/stream/client/Client.d.mts +2 -2
- package/dist/esm/api/resources/stream/client/Client.mjs +5 -3
- package/dist/esm/api/resources/stream/client/Socket.d.mts +1 -1
- package/dist/esm/api/resources/transcribe/client/Client.d.mts +2 -2
- package/dist/esm/api/resources/transcribe/client/Client.mjs +5 -3
- package/dist/esm/api/resources/transcribe/client/Socket.d.mts +1 -1
- package/dist/esm/api/resources/transcripts/client/Client.mjs +4 -28
- package/dist/esm/api/types/AgentsErrorResponse.d.mts +12 -0
- package/dist/esm/api/types/AgentsErrorResponse.mjs +2 -0
- package/dist/esm/api/types/AgentsValidationError.d.mts +8 -0
- package/dist/esm/api/types/AgentsValidationError.mjs +2 -0
- package/dist/esm/api/types/AgentsValidationErrorErrorsItem.d.mts +4 -0
- package/dist/esm/api/types/AgentsValidationErrorErrorsItem.mjs +2 -0
- package/dist/esm/api/types/AgentsValidationErrorResponse.d.mts +4 -0
- package/dist/esm/api/types/AgentsValidationErrorResponse.mjs +2 -0
- package/dist/esm/api/types/CodesFilter.d.mts +11 -0
- package/dist/esm/api/types/CodesFilter.mjs +2 -0
- package/dist/esm/api/types/CodesGeneralReadResponse.d.mts +2 -0
- package/dist/esm/api/types/CodesGeneralReadResponseAlternativesItem.d.mts +9 -0
- package/dist/esm/api/types/CodesGeneralReadResponseAlternativesItem.mjs +2 -0
- package/dist/esm/api/types/CodesGeneralReadResponseEvidencesItem.d.mts +6 -2
- package/dist/esm/api/types/CodesGeneralResponse.d.mts +2 -2
- package/dist/esm/api/types/CommonCodingSystemEnum.d.mts +2 -1
- package/dist/esm/api/types/CommonCodingSystemEnum.mjs +2 -1
- package/dist/esm/api/types/StreamConfigMessage.d.mts +1 -1
- package/dist/esm/api/types/StreamEndMessage.d.mts +1 -2
- package/dist/esm/api/types/StreamEndedMessage.d.mts +1 -2
- package/dist/esm/api/types/StreamErrorMessage.d.mts +1 -1
- package/dist/esm/api/types/StreamFactsMessage.d.mts +1 -1
- package/dist/esm/api/types/StreamFlushMessage.d.mts +1 -2
- package/dist/esm/api/types/StreamFlushedMessage.d.mts +1 -2
- package/dist/esm/api/types/StreamTranscriptMessage.d.mts +1 -1
- package/dist/esm/api/types/StreamUsageMessage.d.mts +1 -2
- package/dist/esm/api/types/TranscribeCommandMessage.d.mts +1 -1
- package/dist/esm/api/types/TranscribeCommandVariable.d.mts +1 -2
- package/dist/esm/api/types/TranscribeConfigMessage.d.mts +1 -1
- package/dist/esm/api/types/TranscribeEndMessage.d.mts +1 -2
- package/dist/esm/api/types/TranscribeEndedMessage.d.mts +1 -2
- package/dist/esm/api/types/TranscribeErrorMessage.d.mts +1 -1
- package/dist/esm/api/types/TranscribeFlushMessage.d.mts +1 -2
- package/dist/esm/api/types/TranscribeFlushedMessage.d.mts +1 -2
- package/dist/esm/api/types/TranscribeFormattingDates.d.mts +4 -4
- package/dist/esm/api/types/TranscribeFormattingDates.mjs +4 -4
- package/dist/esm/api/types/TranscribeFormattingNumbers.d.mts +2 -2
- package/dist/esm/api/types/TranscribeFormattingNumbers.mjs +2 -2
- package/dist/esm/api/types/TranscribeFormattingNumericRanges.d.mts +1 -1
- package/dist/esm/api/types/TranscribeFormattingNumericRanges.mjs +1 -1
- package/dist/esm/api/types/TranscribeFormattingOrdinals.d.mts +1 -0
- package/dist/esm/api/types/TranscribeFormattingOrdinals.mjs +1 -0
- package/dist/esm/api/types/TranscribeFormattingTimes.d.mts +3 -2
- package/dist/esm/api/types/TranscribeFormattingTimes.mjs +3 -2
- package/dist/esm/api/types/TranscribeTranscriptMessage.d.mts +1 -1
- package/dist/esm/api/types/TranscribeUsageMessage.d.mts +1 -2
- package/dist/esm/api/types/index.d.mts +6 -19
- package/dist/esm/api/types/index.mjs +6 -19
- package/dist/esm/auth/OAuthAuthProvider.d.mts +1 -99
- package/dist/esm/auth/OAuthAuthProvider.mjs +2 -239
- package/dist/esm/core/fetcher/index.d.mts +2 -11
- package/dist/esm/core/fetcher/index.mjs +2 -6
- package/dist/esm/custom/CortiClient.d.mts +15 -4
- package/dist/esm/custom/CortiClient.mjs +8 -5
- package/dist/esm/custom/CortiWebSocketProxyClient.d.mts +10 -40
- package/dist/esm/custom/CortiWebSocketProxyClient.mjs +10 -39
- package/dist/esm/custom/OAuthAuthProvider.d.mts +99 -0
- package/dist/esm/custom/OAuthAuthProvider.mjs +239 -0
- package/dist/esm/custom/auth/CortiAuth.d.mts +129 -0
- package/dist/esm/custom/auth/CortiAuth.mjs +158 -0
- package/dist/esm/custom/auth/OAuthAuthCodeAuthProvider.d.mts +23 -0
- package/dist/esm/custom/auth/OAuthAuthCodeAuthProvider.mjs +127 -0
- package/dist/esm/custom/auth/OAuthPkceAuthProvider.d.mts +23 -0
- package/dist/esm/custom/auth/OAuthPkceAuthProvider.mjs +127 -0
- package/dist/esm/custom/auth/OAuthRopcAuthProvider.d.mts +22 -0
- package/dist/esm/custom/auth/OAuthRopcAuthProvider.mjs +100 -0
- package/dist/esm/custom/fetcher.d.mts +3 -0
- package/dist/esm/custom/fetcher.mjs +4 -0
- package/dist/esm/custom/index.d.mts +10 -0
- package/dist/esm/custom/index.mjs +10 -0
- package/dist/esm/custom/overrides/OAuthAuthProvider.d.mts +99 -0
- package/dist/esm/custom/overrides/OAuthAuthProvider.mjs +238 -0
- package/dist/esm/custom/overrides/fetcher/index.d.mts +12 -0
- package/dist/esm/custom/overrides/fetcher/index.mjs +7 -0
- package/dist/esm/custom/overrides/index.d.mts +14 -0
- package/dist/esm/custom/overrides/index.mjs +14 -0
- package/dist/esm/custom/proxy/CustomProxyStream.d.mts +17 -0
- package/dist/esm/custom/proxy/CustomProxyStream.mjs +15 -0
- package/dist/esm/custom/proxy/CustomProxyTranscribe.d.mts +17 -0
- package/dist/esm/custom/proxy/CustomProxyTranscribe.mjs +18 -0
- package/dist/esm/custom/stream/CustomStream.d.mts +39 -0
- package/dist/esm/custom/stream/CustomStream.mjs +146 -0
- package/dist/esm/custom/stream/CustomStreamSocket.d.mts +7 -0
- package/dist/esm/custom/stream/CustomStreamSocket.mjs +13 -0
- package/dist/esm/custom/stream/parseStreamResponseType.d.mts +2 -0
- package/dist/esm/custom/stream/parseStreamResponseType.mjs +13 -0
- package/dist/esm/custom/transcribe/CustomTranscribe.d.mts +38 -0
- package/dist/esm/custom/transcribe/CustomTranscribe.mjs +144 -0
- package/dist/esm/custom/transcribe/CustomTranscribeSocket.d.mts +7 -0
- package/dist/esm/custom/transcribe/CustomTranscribeSocket.mjs +13 -0
- package/dist/esm/custom/transcribe/parseTranscribeResponseType.d.mts +2 -0
- package/dist/esm/custom/transcribe/parseTranscribeResponseType.mjs +13 -0
- package/dist/esm/custom/utils/encodeHeadersAsWsProtocols.d.mts +30 -0
- package/dist/esm/custom/utils/encodeHeadersAsWsProtocols.mjs +65 -0
- package/dist/esm/custom/utils/index.d.mts +3 -0
- package/dist/esm/custom/utils/index.mjs +3 -0
- package/dist/esm/custom/utils/localStorageHelpers.mjs +11 -9
- package/dist/esm/custom/utils/withCredentialsConfig.d.mts +2 -0
- package/dist/esm/custom/utils/withCredentialsConfig.mjs +11 -0
- package/dist/esm/index.d.mts +1 -16
- package/dist/esm/index.mjs +1 -15
- package/dist/esm/serialization/resources/codes/client/requests/CodesGeneralPredictRequest.d.mts +2 -1
- package/dist/esm/serialization/resources/codes/client/requests/CodesGeneralPredictRequest.mjs +2 -1
- package/dist/esm/serialization/resources/stream/client/socket/StreamSocketResponse.d.mts +2 -2
- package/dist/esm/serialization/resources/stream/client/socket/StreamSocketResponse.mjs +1 -1
- package/dist/esm/serialization/resources/transcribe/client/socket/TranscribeSocketResponse.d.mts +2 -2
- package/dist/esm/serialization/resources/transcribe/client/socket/TranscribeSocketResponse.mjs +1 -1
- package/dist/esm/serialization/types/AgentsErrorResponse.d.mts +13 -0
- package/dist/esm/serialization/types/AgentsErrorResponse.mjs +10 -0
- package/dist/esm/serialization/types/AgentsValidationError.d.mts +14 -0
- package/dist/esm/serialization/types/AgentsValidationError.mjs +10 -0
- package/dist/esm/serialization/types/AgentsValidationErrorErrorsItem.d.mts +10 -0
- package/dist/esm/serialization/types/AgentsValidationErrorErrorsItem.mjs +6 -0
- package/dist/esm/serialization/types/AgentsValidationErrorResponse.d.mts +10 -0
- package/dist/esm/serialization/types/AgentsValidationErrorResponse.mjs +9 -0
- package/dist/esm/serialization/types/CodesFilter.d.mts +11 -0
- package/dist/esm/serialization/types/CodesFilter.mjs +7 -0
- package/dist/esm/serialization/types/CodesGeneralReadResponse.d.mts +2 -0
- package/dist/esm/serialization/types/CodesGeneralReadResponse.mjs +2 -0
- package/dist/esm/serialization/types/CodesGeneralReadResponseAlternativesItem.d.mts +10 -0
- package/dist/esm/serialization/types/CodesGeneralReadResponseAlternativesItem.mjs +6 -0
- package/dist/esm/serialization/types/CodesGeneralReadResponseEvidencesItem.d.mts +4 -2
- package/dist/esm/serialization/types/CodesGeneralReadResponseEvidencesItem.mjs +4 -2
- package/dist/esm/serialization/types/CommonCodingSystemEnum.d.mts +1 -1
- package/dist/esm/serialization/types/CommonCodingSystemEnum.mjs +1 -1
- package/dist/esm/serialization/types/StreamConfigMessage.d.mts +1 -2
- package/dist/esm/serialization/types/StreamConfigMessage.mjs +1 -2
- package/dist/esm/serialization/types/StreamEndMessage.d.mts +1 -2
- package/dist/esm/serialization/types/StreamEndMessage.mjs +1 -2
- package/dist/esm/serialization/types/StreamEndedMessage.d.mts +1 -2
- package/dist/esm/serialization/types/StreamEndedMessage.mjs +1 -2
- package/dist/esm/serialization/types/StreamErrorMessage.d.mts +1 -2
- package/dist/esm/serialization/types/StreamErrorMessage.mjs +1 -2
- package/dist/esm/serialization/types/StreamFactsMessage.d.mts +1 -2
- package/dist/esm/serialization/types/StreamFactsMessage.mjs +1 -2
- package/dist/esm/serialization/types/StreamFlushMessage.d.mts +1 -2
- package/dist/esm/serialization/types/StreamFlushMessage.mjs +1 -2
- package/dist/esm/serialization/types/StreamFlushedMessage.d.mts +1 -2
- package/dist/esm/serialization/types/StreamFlushedMessage.mjs +1 -2
- package/dist/esm/serialization/types/StreamTranscriptMessage.d.mts +1 -2
- package/dist/esm/serialization/types/StreamTranscriptMessage.mjs +1 -2
- package/dist/esm/serialization/types/StreamUsageMessage.d.mts +1 -2
- package/dist/esm/serialization/types/StreamUsageMessage.mjs +1 -2
- package/dist/esm/serialization/types/TranscribeCommandMessage.d.mts +1 -2
- package/dist/esm/serialization/types/TranscribeCommandMessage.mjs +1 -2
- package/dist/esm/serialization/types/TranscribeCommandVariable.d.mts +1 -2
- package/dist/esm/serialization/types/TranscribeCommandVariable.mjs +1 -2
- package/dist/esm/serialization/types/TranscribeConfigMessage.d.mts +1 -2
- package/dist/esm/serialization/types/TranscribeConfigMessage.mjs +1 -2
- package/dist/esm/serialization/types/TranscribeEndMessage.d.mts +1 -2
- package/dist/esm/serialization/types/TranscribeEndMessage.mjs +1 -2
- package/dist/esm/serialization/types/TranscribeEndedMessage.d.mts +1 -2
- package/dist/esm/serialization/types/TranscribeEndedMessage.mjs +1 -2
- package/dist/esm/serialization/types/TranscribeErrorMessage.d.mts +1 -2
- package/dist/esm/serialization/types/TranscribeErrorMessage.mjs +1 -2
- package/dist/esm/serialization/types/TranscribeFlushMessage.d.mts +1 -2
- package/dist/esm/serialization/types/TranscribeFlushMessage.mjs +1 -2
- package/dist/esm/serialization/types/TranscribeFlushedMessage.d.mts +1 -2
- package/dist/esm/serialization/types/TranscribeFlushedMessage.mjs +1 -2
- package/dist/esm/serialization/types/TranscribeFormattingDates.d.mts +1 -1
- package/dist/esm/serialization/types/TranscribeFormattingDates.mjs +1 -1
- package/dist/esm/serialization/types/TranscribeFormattingNumbers.d.mts +1 -1
- package/dist/esm/serialization/types/TranscribeFormattingNumbers.mjs +1 -1
- package/dist/esm/serialization/types/TranscribeFormattingNumericRanges.d.mts +1 -1
- package/dist/esm/serialization/types/TranscribeFormattingNumericRanges.mjs +1 -1
- package/dist/esm/serialization/types/TranscribeFormattingOrdinals.d.mts +1 -1
- package/dist/esm/serialization/types/TranscribeFormattingOrdinals.mjs +1 -1
- package/dist/esm/serialization/types/TranscribeFormattingTimes.d.mts +1 -1
- package/dist/esm/serialization/types/TranscribeFormattingTimes.mjs +1 -1
- package/dist/esm/serialization/types/TranscribeTranscriptMessage.d.mts +1 -2
- package/dist/esm/serialization/types/TranscribeTranscriptMessage.mjs +1 -2
- package/dist/esm/serialization/types/TranscribeUsageMessage.d.mts +1 -2
- package/dist/esm/serialization/types/TranscribeUsageMessage.mjs +1 -2
- package/dist/esm/serialization/types/index.d.mts +6 -19
- package/dist/esm/serialization/types/index.mjs +6 -19
- package/dist/esm/version.d.mts +1 -1
- package/dist/esm/version.mjs +1 -1
- package/package.json +10 -120
- package/reference.md +0 -2748
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export * as Corti from "../../api/index.js";
|
|
2
|
+
export type { BaseClientOptions, BaseRequestOptions } from "../../BaseClient.js";
|
|
3
|
+
export { CortiEnvironment, type CortiEnvironmentUrls } from "../../environments.js";
|
|
4
|
+
export { CortiError, CortiTimeoutError } from "../../errors/index.js";
|
|
5
|
+
export * from "../../exports.js";
|
|
6
|
+
export * as serialization from "../../serialization/index.js";
|
|
7
|
+
export { CortiAuth } from "../auth/CortiAuth.js";
|
|
8
|
+
export { CortiClient } from "../CortiClient.js";
|
|
9
|
+
export { CortiWebSocketProxyClient } from "../CortiWebSocketProxyClient.js";
|
|
10
|
+
export { type ProxyOptions } from "../utils/encodeHeadersAsWsProtocols.js";
|
|
11
|
+
export { type CortiInternalEnvironment, type Environment } from "../utils/environment.js";
|
|
12
|
+
export { CortiSDKError, CortiSDKErrorCodes } from "../CortiSDKError.js";
|
|
13
|
+
export { ParseError } from "../../core/schemas/builders/schema-utils/ParseError.js";
|
|
14
|
+
export { JsonError } from "../../core/schemas/builders/schema-utils/JsonError.js";
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
36
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
37
|
+
};
|
|
38
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
+
exports.JsonError = exports.ParseError = exports.CortiSDKErrorCodes = exports.CortiSDKError = exports.CortiWebSocketProxyClient = exports.CortiClient = exports.CortiAuth = exports.serialization = exports.CortiTimeoutError = exports.CortiError = exports.CortiEnvironment = exports.Corti = void 0;
|
|
40
|
+
exports.Corti = __importStar(require("../../api/index.js"));
|
|
41
|
+
var environments_js_1 = require("../../environments.js");
|
|
42
|
+
Object.defineProperty(exports, "CortiEnvironment", { enumerable: true, get: function () { return environments_js_1.CortiEnvironment; } });
|
|
43
|
+
var index_js_1 = require("../../errors/index.js");
|
|
44
|
+
Object.defineProperty(exports, "CortiError", { enumerable: true, get: function () { return index_js_1.CortiError; } });
|
|
45
|
+
Object.defineProperty(exports, "CortiTimeoutError", { enumerable: true, get: function () { return index_js_1.CortiTimeoutError; } });
|
|
46
|
+
__exportStar(require("../../exports.js"), exports);
|
|
47
|
+
exports.serialization = __importStar(require("../../serialization/index.js"));
|
|
48
|
+
// Custom additions / replacements
|
|
49
|
+
var CortiAuth_js_1 = require("../auth/CortiAuth.js");
|
|
50
|
+
Object.defineProperty(exports, "CortiAuth", { enumerable: true, get: function () { return CortiAuth_js_1.CortiAuth; } });
|
|
51
|
+
var CortiClient_js_1 = require("../CortiClient.js");
|
|
52
|
+
Object.defineProperty(exports, "CortiClient", { enumerable: true, get: function () { return CortiClient_js_1.CortiClient; } });
|
|
53
|
+
var CortiWebSocketProxyClient_js_1 = require("../CortiWebSocketProxyClient.js");
|
|
54
|
+
Object.defineProperty(exports, "CortiWebSocketProxyClient", { enumerable: true, get: function () { return CortiWebSocketProxyClient_js_1.CortiWebSocketProxyClient; } });
|
|
55
|
+
var CortiSDKError_js_1 = require("../CortiSDKError.js");
|
|
56
|
+
Object.defineProperty(exports, "CortiSDKError", { enumerable: true, get: function () { return CortiSDKError_js_1.CortiSDKError; } });
|
|
57
|
+
Object.defineProperty(exports, "CortiSDKErrorCodes", { enumerable: true, get: function () { return CortiSDKError_js_1.CortiSDKErrorCodes; } });
|
|
58
|
+
var ParseError_js_1 = require("../../core/schemas/builders/schema-utils/ParseError.js");
|
|
59
|
+
Object.defineProperty(exports, "ParseError", { enumerable: true, get: function () { return ParseError_js_1.ParseError; } });
|
|
60
|
+
var JsonError_js_1 = require("../../core/schemas/builders/schema-utils/JsonError.js");
|
|
61
|
+
Object.defineProperty(exports, "JsonError", { enumerable: true, get: function () { return JsonError_js_1.JsonError; } });
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import * as Corti from "../../api/index.js";
|
|
2
|
+
import type { CustomStreamSocket } from "../stream/CustomStreamSocket.js";
|
|
3
|
+
import type { ProxyOptions } from "../utils/encodeHeadersAsWsProtocols.js";
|
|
4
|
+
/**
|
|
5
|
+
* Lightweight proxy stream client — no CortiClient or auth needed.
|
|
6
|
+
* Pass a proxy URL (and optionally protocols/queryParameters) directly in connect().
|
|
7
|
+
*/
|
|
8
|
+
export declare class CustomProxyStream {
|
|
9
|
+
private readonly _stream;
|
|
10
|
+
connect(args: {
|
|
11
|
+
proxy: ProxyOptions;
|
|
12
|
+
configuration?: Corti.StreamConfig;
|
|
13
|
+
awaitConfiguration?: boolean;
|
|
14
|
+
debug?: boolean;
|
|
15
|
+
reconnectAttempts?: number;
|
|
16
|
+
}): Promise<CustomStreamSocket>;
|
|
17
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CustomProxyStream = void 0;
|
|
4
|
+
const environments_js_1 = require("../../environments.js");
|
|
5
|
+
const CustomStream_js_1 = require("../stream/CustomStream.js");
|
|
6
|
+
/**
|
|
7
|
+
* Lightweight proxy stream client — no CortiClient or auth needed.
|
|
8
|
+
* Pass a proxy URL (and optionally protocols/queryParameters) directly in connect().
|
|
9
|
+
*/
|
|
10
|
+
class CustomProxyStream {
|
|
11
|
+
constructor() {
|
|
12
|
+
this._stream = new CustomStream_js_1.CustomStream({ environment: environments_js_1.CortiEnvironment.Eu, tenantName: "" });
|
|
13
|
+
}
|
|
14
|
+
connect(args) {
|
|
15
|
+
return this._stream.connect(Object.assign(Object.assign({}, args), { id: "" }));
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
exports.CustomProxyStream = CustomProxyStream;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import * as Corti from "../../api/index.js";
|
|
2
|
+
import type { CustomTranscribeSocket } from "../transcribe/CustomTranscribeSocket.js";
|
|
3
|
+
import type { ProxyOptions } from "../utils/encodeHeadersAsWsProtocols.js";
|
|
4
|
+
/**
|
|
5
|
+
* Lightweight proxy transcribe client — no CortiClient or auth needed.
|
|
6
|
+
* Pass a proxy URL (and optionally protocols/queryParameters) directly in connect().
|
|
7
|
+
*/
|
|
8
|
+
export declare class CustomProxyTranscribe {
|
|
9
|
+
private readonly _transcribe;
|
|
10
|
+
connect(args: {
|
|
11
|
+
proxy: ProxyOptions;
|
|
12
|
+
configuration?: Corti.TranscribeConfig;
|
|
13
|
+
awaitConfiguration?: boolean;
|
|
14
|
+
debug?: boolean;
|
|
15
|
+
reconnectAttempts?: number;
|
|
16
|
+
}): Promise<CustomTranscribeSocket>;
|
|
17
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CustomProxyTranscribe = void 0;
|
|
4
|
+
const environments_js_1 = require("../../environments.js");
|
|
5
|
+
const CustomTranscribe_js_1 = require("../transcribe/CustomTranscribe.js");
|
|
6
|
+
/**
|
|
7
|
+
* Lightweight proxy transcribe client — no CortiClient or auth needed.
|
|
8
|
+
* Pass a proxy URL (and optionally protocols/queryParameters) directly in connect().
|
|
9
|
+
*/
|
|
10
|
+
class CustomProxyTranscribe {
|
|
11
|
+
constructor() {
|
|
12
|
+
this._transcribe = new CustomTranscribe_js_1.CustomTranscribe({
|
|
13
|
+
environment: environments_js_1.CortiEnvironment.Eu,
|
|
14
|
+
tenantName: "",
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
connect(args) {
|
|
18
|
+
return this._transcribe.connect(args);
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
exports.CustomProxyTranscribe = CustomProxyTranscribe;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { StreamClient } from "../../api/resources/stream/client/Client.js";
|
|
2
|
+
import { CustomStreamSocket } from "./CustomStreamSocket.js";
|
|
3
|
+
import * as Corti from "../../api/index.js";
|
|
4
|
+
import { type ProxyOptions } from "../utils/encodeHeadersAsWsProtocols.js";
|
|
5
|
+
export type CustomStreamConnectArgs = {
|
|
6
|
+
id: string;
|
|
7
|
+
/** When provided, connect() resolves after CONFIG_ACCEPTED or rejects on failure. */
|
|
8
|
+
configuration?: Corti.StreamConfig;
|
|
9
|
+
/**
|
|
10
|
+
* When true (default), connect() resolves after CONFIG_ACCEPTED or rejects on failure.
|
|
11
|
+
* When false, returns socket immediately; config errors are dispatched as ErrorEvent.
|
|
12
|
+
*/
|
|
13
|
+
awaitConfiguration?: boolean;
|
|
14
|
+
/**
|
|
15
|
+
* When provided, bypasses normal URL construction and auth. The WebSocket connects
|
|
16
|
+
* directly to proxy.url. Useful for proxy backends that handle auth themselves.
|
|
17
|
+
*/
|
|
18
|
+
proxy?: ProxyOptions;
|
|
19
|
+
} & Partial<Omit<StreamClient.ConnectArgs, "id" | "tenantName" | "token">>;
|
|
20
|
+
export declare class CustomStream extends StreamClient {
|
|
21
|
+
private readonly _encodeHeadersAsWsProtocols;
|
|
22
|
+
constructor(options: StreamClient.Options & {
|
|
23
|
+
encodeHeadersAsWsProtocols?: boolean;
|
|
24
|
+
});
|
|
25
|
+
connect(args: CustomStreamConnectArgs): Promise<CustomStreamSocket>;
|
|
26
|
+
/**
|
|
27
|
+
* Sends configuration on open, then resolves after CONFIG_ACCEPTED.
|
|
28
|
+
* Rejects and closes socket on CONFIG_DENIED / CONFIG_MISSING / CONFIG_TIMEOUT /
|
|
29
|
+
* CONFIG_NOT_PROVIDED / connection error / ENDED.
|
|
30
|
+
*/
|
|
31
|
+
private _connectWithConfigAck;
|
|
32
|
+
/**
|
|
33
|
+
* Sends configuration on open and returns the socket immediately.
|
|
34
|
+
* Config errors are dispatched as ErrorEvent and the socket is closed.
|
|
35
|
+
*/
|
|
36
|
+
private _connectWithConfigListeners;
|
|
37
|
+
/** Resolves on CONFIG_ACCEPTED; rejects on rejection types, socket error, or ENDED. */
|
|
38
|
+
private _buildConfigAckPromise;
|
|
39
|
+
}
|
|
@@ -0,0 +1,183 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
36
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
37
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
38
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
39
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
40
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
41
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
42
|
+
});
|
|
43
|
+
};
|
|
44
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
45
|
+
var t = {};
|
|
46
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
47
|
+
t[p] = s[p];
|
|
48
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
49
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
50
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
51
|
+
t[p[i]] = s[p[i]];
|
|
52
|
+
}
|
|
53
|
+
return t;
|
|
54
|
+
};
|
|
55
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
56
|
+
exports.CustomStream = void 0;
|
|
57
|
+
const Client_js_1 = require("../../api/resources/stream/client/Client.js");
|
|
58
|
+
const CustomStreamSocket_js_1 = require("./CustomStreamSocket.js");
|
|
59
|
+
const Corti = __importStar(require("../../api/index.js"));
|
|
60
|
+
const events_js_1 = require("../../core/websocket/events.js");
|
|
61
|
+
const parseStreamResponseType_js_1 = require("./parseStreamResponseType.js");
|
|
62
|
+
const core = __importStar(require("../../core/index.js"));
|
|
63
|
+
const encodeHeadersAsWsProtocols_js_1 = require("../utils/encodeHeadersAsWsProtocols.js");
|
|
64
|
+
const STREAM_CONFIG_REJECTION_TYPES = [
|
|
65
|
+
Corti.StreamConfigStatusMessageType.ConfigDenied,
|
|
66
|
+
Corti.StreamConfigStatusMessageType.ConfigMissing,
|
|
67
|
+
Corti.StreamConfigStatusMessageType.ConfigTimeout,
|
|
68
|
+
Corti.StreamConfigStatusMessageType.ConfigNotProvided,
|
|
69
|
+
];
|
|
70
|
+
class CustomStream extends Client_js_1.StreamClient {
|
|
71
|
+
constructor(options) {
|
|
72
|
+
super(options);
|
|
73
|
+
this._encodeHeadersAsWsProtocols = options.encodeHeadersAsWsProtocols;
|
|
74
|
+
}
|
|
75
|
+
connect(args) {
|
|
76
|
+
const _super = Object.create(null, {
|
|
77
|
+
connect: { get: () => super.connect }
|
|
78
|
+
});
|
|
79
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
80
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
81
|
+
const { configuration, awaitConfiguration = true, proxy } = args, rest = __rest(args, ["configuration", "awaitConfiguration", "proxy"]);
|
|
82
|
+
const useProxyPath = proxy || this._encodeHeadersAsWsProtocols;
|
|
83
|
+
const protocols = yield (0, encodeHeadersAsWsProtocols_js_1.getWsProtocols)(Object.assign(Object.assign({}, this._options), { encodeHeadersAsWsProtocols: this._encodeHeadersAsWsProtocols }), proxy === null || proxy === void 0 ? void 0 : proxy.protocols);
|
|
84
|
+
const socket = useProxyPath
|
|
85
|
+
? new core.ReconnectingWebSocket({
|
|
86
|
+
url: (_a = proxy === null || proxy === void 0 ? void 0 : proxy.url) !== null && _a !== void 0 ? _a : core.url.join((_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment)).wss, `/interactions/${core.url.encodePathParam(rest.id)}/streams`),
|
|
87
|
+
protocols,
|
|
88
|
+
queryParameters: (_c = proxy === null || proxy === void 0 ? void 0 : proxy.queryParameters) !== null && _c !== void 0 ? _c : {},
|
|
89
|
+
headers: (_d = rest.headers) !== null && _d !== void 0 ? _d : {},
|
|
90
|
+
options: { debug: (_e = rest.debug) !== null && _e !== void 0 ? _e : false, maxRetries: (_f = rest.reconnectAttempts) !== null && _f !== void 0 ? _f : 30 },
|
|
91
|
+
})
|
|
92
|
+
: (yield _super.connect.call(this, Object.assign(Object.assign({}, rest), { token: ((_h = (yield ((_g = this._options.authProvider) === null || _g === void 0 ? void 0 : _g.getAuthRequest()))) === null || _h === void 0 ? void 0 : _h.headers.Authorization) || "", tenantName: yield core.Supplier.get(this._options.tenantName) }))).socket;
|
|
93
|
+
const ws = new CustomStreamSocket_js_1.CustomStreamSocket({ socket });
|
|
94
|
+
if (!configuration) {
|
|
95
|
+
return ws;
|
|
96
|
+
}
|
|
97
|
+
if (awaitConfiguration) {
|
|
98
|
+
return this._connectWithConfigAck(ws, configuration);
|
|
99
|
+
}
|
|
100
|
+
return this._connectWithConfigListeners(ws, configuration);
|
|
101
|
+
});
|
|
102
|
+
}
|
|
103
|
+
/**
|
|
104
|
+
* Sends configuration on open, then resolves after CONFIG_ACCEPTED.
|
|
105
|
+
* Rejects and closes socket on CONFIG_DENIED / CONFIG_MISSING / CONFIG_TIMEOUT /
|
|
106
|
+
* CONFIG_NOT_PROVIDED / connection error / ENDED.
|
|
107
|
+
*/
|
|
108
|
+
_connectWithConfigAck(socket, configuration) {
|
|
109
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
110
|
+
const configAck = this._buildConfigAckPromise(socket);
|
|
111
|
+
yield socket.waitForOpen();
|
|
112
|
+
socket.sendConfiguration({ type: "config", configuration });
|
|
113
|
+
try {
|
|
114
|
+
yield configAck;
|
|
115
|
+
}
|
|
116
|
+
catch (err) {
|
|
117
|
+
socket.close();
|
|
118
|
+
throw err;
|
|
119
|
+
}
|
|
120
|
+
// Persistent listener re-sends config on each reconnect
|
|
121
|
+
socket.socket.addEventListener("open", () => {
|
|
122
|
+
socket.sendConfiguration({ type: "config", configuration });
|
|
123
|
+
});
|
|
124
|
+
return socket;
|
|
125
|
+
});
|
|
126
|
+
}
|
|
127
|
+
/**
|
|
128
|
+
* Sends configuration on open and returns the socket immediately.
|
|
129
|
+
* Config errors are dispatched as ErrorEvent and the socket is closed.
|
|
130
|
+
*/
|
|
131
|
+
_connectWithConfigListeners(socket, configuration) {
|
|
132
|
+
socket.socket.addEventListener("open", () => {
|
|
133
|
+
socket.sendConfiguration({ type: "config", configuration });
|
|
134
|
+
});
|
|
135
|
+
socket.socket.addEventListener("message", (event) => {
|
|
136
|
+
const type = (0, parseStreamResponseType_js_1.parseStreamResponseType)(event.data);
|
|
137
|
+
if (type == null || type === Corti.StreamConfigStatusMessageType.ConfigAccepted) {
|
|
138
|
+
return;
|
|
139
|
+
}
|
|
140
|
+
if (STREAM_CONFIG_REJECTION_TYPES.includes(type) || type === "error") {
|
|
141
|
+
socket.socket.dispatchEvent(new events_js_1.ErrorEvent(new Error(type), socket.socket));
|
|
142
|
+
socket.close();
|
|
143
|
+
}
|
|
144
|
+
else if (type === "ENDED") {
|
|
145
|
+
socket.close();
|
|
146
|
+
}
|
|
147
|
+
});
|
|
148
|
+
return socket;
|
|
149
|
+
}
|
|
150
|
+
/** Resolves on CONFIG_ACCEPTED; rejects on rejection types, socket error, or ENDED. */
|
|
151
|
+
_buildConfigAckPromise(socket) {
|
|
152
|
+
return new Promise((resolve, reject) => {
|
|
153
|
+
const cleanup = () => {
|
|
154
|
+
socket.socket.removeEventListener("message", onMessage);
|
|
155
|
+
socket.socket.removeEventListener("error", onError);
|
|
156
|
+
};
|
|
157
|
+
const onError = (event) => {
|
|
158
|
+
cleanup();
|
|
159
|
+
reject(new Error(event.message));
|
|
160
|
+
};
|
|
161
|
+
const onMessage = (event) => {
|
|
162
|
+
const type = (0, parseStreamResponseType_js_1.parseStreamResponseType)(event.data);
|
|
163
|
+
if (type == null)
|
|
164
|
+
return;
|
|
165
|
+
if (type === Corti.StreamConfigStatusMessageType.ConfigAccepted) {
|
|
166
|
+
cleanup();
|
|
167
|
+
resolve();
|
|
168
|
+
}
|
|
169
|
+
else if (STREAM_CONFIG_REJECTION_TYPES.includes(type)) {
|
|
170
|
+
cleanup();
|
|
171
|
+
reject(new Error(type));
|
|
172
|
+
}
|
|
173
|
+
else if (type === "ENDED") {
|
|
174
|
+
cleanup();
|
|
175
|
+
reject(new Error("Connection ended before config was accepted"));
|
|
176
|
+
}
|
|
177
|
+
};
|
|
178
|
+
socket.socket.addEventListener("message", onMessage);
|
|
179
|
+
socket.socket.addEventListener("error", onError);
|
|
180
|
+
});
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
exports.CustomStream = CustomStream;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { StreamSocket } from "../../api/resources/stream/client/Socket.js";
|
|
2
|
+
export declare class CustomStreamSocket extends StreamSocket {
|
|
3
|
+
/** Remove the handler for an event. If callback is supplied, only removes if it matches. */
|
|
4
|
+
off<T extends keyof StreamSocket.EventHandlers>(event: T, callback?: StreamSocket.EventHandlers[T]): void;
|
|
5
|
+
/** Send raw data directly on the underlying WebSocket (e.g. binary audio, custom frames). */
|
|
6
|
+
send(data: string | ArrayBufferLike | Blob | ArrayBufferView): void;
|
|
7
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CustomStreamSocket = void 0;
|
|
4
|
+
const Socket_js_1 = require("../../api/resources/stream/client/Socket.js");
|
|
5
|
+
class CustomStreamSocket extends Socket_js_1.StreamSocket {
|
|
6
|
+
/** Remove the handler for an event. If callback is supplied, only removes if it matches. */
|
|
7
|
+
off(event, callback) {
|
|
8
|
+
if (callback === undefined || this.eventHandlers[event] === callback) {
|
|
9
|
+
this.eventHandlers[event] = undefined;
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
/** Send raw data directly on the underlying WebSocket (e.g. binary audio, custom frames). */
|
|
13
|
+
send(data) {
|
|
14
|
+
this.socket.send(data);
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
exports.CustomStreamSocket = CustomStreamSocket;
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.parseStreamResponseType = parseStreamResponseType;
|
|
37
|
+
const json_js_1 = require("../../core/json.js");
|
|
38
|
+
const serializers = __importStar(require("../../serialization/index.js"));
|
|
39
|
+
/** Parses a raw WebSocket message and returns its type string, or null on failure. */
|
|
40
|
+
function parseStreamResponseType(raw) {
|
|
41
|
+
const parsed = serializers.StreamSocketResponse.parse((0, json_js_1.fromJson)(raw), {
|
|
42
|
+
unrecognizedObjectKeys: "passthrough",
|
|
43
|
+
allowUnrecognizedUnionMembers: true,
|
|
44
|
+
allowUnrecognizedEnumValues: true,
|
|
45
|
+
skipValidation: true,
|
|
46
|
+
omitUndefined: true,
|
|
47
|
+
});
|
|
48
|
+
return parsed.ok ? parsed.value.type : null;
|
|
49
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { TranscribeClient } from "../../api/resources/transcribe/client/Client.js";
|
|
2
|
+
import { CustomTranscribeSocket } from "./CustomTranscribeSocket.js";
|
|
3
|
+
import * as Corti from "../../api/index.js";
|
|
4
|
+
import { type ProxyOptions } from "../utils/encodeHeadersAsWsProtocols.js";
|
|
5
|
+
export type CustomTranscribeConnectArgs = {
|
|
6
|
+
/** When provided, connect() resolves after CONFIG_ACCEPTED or rejects on failure. */
|
|
7
|
+
configuration?: Corti.TranscribeConfig;
|
|
8
|
+
/**
|
|
9
|
+
* When true (default), connect() resolves after CONFIG_ACCEPTED or rejects on failure.
|
|
10
|
+
* When false, returns socket immediately; config errors are dispatched as ErrorEvent.
|
|
11
|
+
*/
|
|
12
|
+
awaitConfiguration?: boolean;
|
|
13
|
+
/**
|
|
14
|
+
* When provided, bypasses normal URL construction and auth. The WebSocket connects
|
|
15
|
+
* directly to proxy.url. Useful for proxy backends that handle auth themselves.
|
|
16
|
+
*/
|
|
17
|
+
proxy?: ProxyOptions;
|
|
18
|
+
} & Partial<Omit<TranscribeClient.ConnectArgs, "tenantName" | "token">>;
|
|
19
|
+
export declare class CustomTranscribe extends TranscribeClient {
|
|
20
|
+
private readonly _encodeHeadersAsWsProtocols;
|
|
21
|
+
constructor(options: TranscribeClient.Options & {
|
|
22
|
+
encodeHeadersAsWsProtocols?: boolean;
|
|
23
|
+
});
|
|
24
|
+
connect(args?: CustomTranscribeConnectArgs): Promise<CustomTranscribeSocket>;
|
|
25
|
+
/**
|
|
26
|
+
* Sends configuration on open, then resolves after CONFIG_ACCEPTED.
|
|
27
|
+
* Rejects and closes socket on CONFIG_DENIED / CONFIG_TIMEOUT /
|
|
28
|
+
* connection error / ended.
|
|
29
|
+
*/
|
|
30
|
+
private _connectWithConfigAck;
|
|
31
|
+
/**
|
|
32
|
+
* Sends configuration on open and returns the socket immediately.
|
|
33
|
+
* Config errors are dispatched as ErrorEvent and the socket is closed.
|
|
34
|
+
*/
|
|
35
|
+
private _connectWithConfigListeners;
|
|
36
|
+
/** Resolves on CONFIG_ACCEPTED; rejects on rejection types, socket error, or ended. */
|
|
37
|
+
private _buildConfigAckPromise;
|
|
38
|
+
}
|