@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
|
@@ -22,6 +22,7 @@ export * from "./AgentsCreateMcpServerAuthorizationType.mjs";
|
|
|
22
22
|
export * from "./AgentsCreateMcpServerTransportType.mjs";
|
|
23
23
|
export * from "./AgentsDataPart.mjs";
|
|
24
24
|
export * from "./AgentsDataPartKind.mjs";
|
|
25
|
+
export * from "./AgentsErrorResponse.mjs";
|
|
25
26
|
export * from "./AgentsExpert.mjs";
|
|
26
27
|
export * from "./AgentsExpertReference.mjs";
|
|
27
28
|
export * from "./AgentsExpertReferenceType.mjs";
|
|
@@ -51,13 +52,18 @@ export * from "./AgentsTaskStatus.mjs";
|
|
|
51
52
|
export * from "./AgentsTaskStatusState.mjs";
|
|
52
53
|
export * from "./AgentsTextPart.mjs";
|
|
53
54
|
export * from "./AgentsTextPartKind.mjs";
|
|
55
|
+
export * from "./AgentsValidationError.mjs";
|
|
56
|
+
export * from "./AgentsValidationErrorErrorsItem.mjs";
|
|
57
|
+
export * from "./AgentsValidationErrorResponse.mjs";
|
|
54
58
|
export * from "./AuthTokenRequestAuthorizationCode.mjs";
|
|
55
59
|
export * from "./AuthTokenRequestAuthorizationPkce.mjs";
|
|
56
60
|
export * from "./AuthTokenRequestClientCredentials.mjs";
|
|
57
61
|
export * from "./AuthTokenRequestRefresh.mjs";
|
|
58
62
|
export * from "./AuthTokenRequestRopc.mjs";
|
|
59
63
|
export * from "./AuthTokenResponse.mjs";
|
|
64
|
+
export * from "./CodesFilter.mjs";
|
|
60
65
|
export * from "./CodesGeneralReadResponse.mjs";
|
|
66
|
+
export * from "./CodesGeneralReadResponseAlternativesItem.mjs";
|
|
61
67
|
export * from "./CodesGeneralReadResponseEvidencesItem.mjs";
|
|
62
68
|
export * from "./CodesGeneralResponse.mjs";
|
|
63
69
|
export * from "./CommonAiContext.mjs";
|
|
@@ -122,7 +128,6 @@ export * from "./RecordingsCreateResponse.mjs";
|
|
|
122
128
|
export * from "./RecordingsListResponse.mjs";
|
|
123
129
|
export * from "./StreamConfig.mjs";
|
|
124
130
|
export * from "./StreamConfigMessage.mjs";
|
|
125
|
-
export * from "./StreamConfigMessageType.mjs";
|
|
126
131
|
export * from "./StreamConfigMode.mjs";
|
|
127
132
|
export * from "./StreamConfigModeType.mjs";
|
|
128
133
|
export * from "./StreamConfigParticipant.mjs";
|
|
@@ -131,27 +136,19 @@ export * from "./StreamConfigStatusMessage.mjs";
|
|
|
131
136
|
export * from "./StreamConfigStatusMessageType.mjs";
|
|
132
137
|
export * from "./StreamConfigTranscription.mjs";
|
|
133
138
|
export * from "./StreamEndedMessage.mjs";
|
|
134
|
-
export * from "./StreamEndedMessageType.mjs";
|
|
135
139
|
export * from "./StreamEndMessage.mjs";
|
|
136
|
-
export * from "./StreamEndMessageType.mjs";
|
|
137
140
|
export * from "./StreamErrorDetail.mjs";
|
|
138
141
|
export * from "./StreamErrorMessage.mjs";
|
|
139
|
-
export * from "./StreamErrorMessageType.mjs";
|
|
140
142
|
export * from "./StreamFact.mjs";
|
|
141
143
|
export * from "./StreamFactsMessage.mjs";
|
|
142
|
-
export * from "./StreamFactsMessageType.mjs";
|
|
143
144
|
export * from "./StreamFlushedMessage.mjs";
|
|
144
|
-
export * from "./StreamFlushedMessageType.mjs";
|
|
145
145
|
export * from "./StreamFlushMessage.mjs";
|
|
146
|
-
export * from "./StreamFlushMessageType.mjs";
|
|
147
146
|
export * from "./StreamParticipant.mjs";
|
|
148
147
|
export * from "./StreamSupportedLanguage.mjs";
|
|
149
148
|
export * from "./StreamTranscript.mjs";
|
|
150
149
|
export * from "./StreamTranscriptMessage.mjs";
|
|
151
|
-
export * from "./StreamTranscriptMessageType.mjs";
|
|
152
150
|
export * from "./StreamTranscriptTime.mjs";
|
|
153
151
|
export * from "./StreamUsageMessage.mjs";
|
|
154
|
-
export * from "./StreamUsageMessageType.mjs";
|
|
155
152
|
export * from "./TemplatesDocumentationModeEnum.mjs";
|
|
156
153
|
export * from "./TemplatesFormatRule.mjs";
|
|
157
154
|
export * from "./TemplatesItem.mjs";
|
|
@@ -165,25 +162,17 @@ export * from "./TemplatesWritingStyle.mjs";
|
|
|
165
162
|
export * from "./TranscribeCommand.mjs";
|
|
166
163
|
export * from "./TranscribeCommandData.mjs";
|
|
167
164
|
export * from "./TranscribeCommandMessage.mjs";
|
|
168
|
-
export * from "./TranscribeCommandMessageType.mjs";
|
|
169
165
|
export * from "./TranscribeCommandVariable.mjs";
|
|
170
|
-
export * from "./TranscribeCommandVariableType.mjs";
|
|
171
166
|
export * from "./TranscribeConfig.mjs";
|
|
172
167
|
export * from "./TranscribeConfigMessage.mjs";
|
|
173
|
-
export * from "./TranscribeConfigMessageType.mjs";
|
|
174
168
|
export * from "./TranscribeConfigStatusMessage.mjs";
|
|
175
169
|
export * from "./TranscribeConfigStatusMessageType.mjs";
|
|
176
170
|
export * from "./TranscribeEndedMessage.mjs";
|
|
177
|
-
export * from "./TranscribeEndedMessageType.mjs";
|
|
178
171
|
export * from "./TranscribeEndMessage.mjs";
|
|
179
|
-
export * from "./TranscribeEndMessageType.mjs";
|
|
180
172
|
export * from "./TranscribeErrorMessage.mjs";
|
|
181
173
|
export * from "./TranscribeErrorMessageError.mjs";
|
|
182
|
-
export * from "./TranscribeErrorMessageType.mjs";
|
|
183
174
|
export * from "./TranscribeFlushedMessage.mjs";
|
|
184
|
-
export * from "./TranscribeFlushedMessageType.mjs";
|
|
185
175
|
export * from "./TranscribeFlushMessage.mjs";
|
|
186
|
-
export * from "./TranscribeFlushMessageType.mjs";
|
|
187
176
|
export * from "./TranscribeFormatting.mjs";
|
|
188
177
|
export * from "./TranscribeFormattingDates.mjs";
|
|
189
178
|
export * from "./TranscribeFormattingMeasurements.mjs";
|
|
@@ -194,9 +183,7 @@ export * from "./TranscribeFormattingTimes.mjs";
|
|
|
194
183
|
export * from "./TranscribeSupportedLanguage.mjs";
|
|
195
184
|
export * from "./TranscribeTranscriptData.mjs";
|
|
196
185
|
export * from "./TranscribeTranscriptMessage.mjs";
|
|
197
|
-
export * from "./TranscribeTranscriptMessageType.mjs";
|
|
198
186
|
export * from "./TranscribeUsageMessage.mjs";
|
|
199
|
-
export * from "./TranscribeUsageMessageType.mjs";
|
|
200
187
|
export * from "./TranscriptsData.mjs";
|
|
201
188
|
export * from "./TranscriptsListItem.mjs";
|
|
202
189
|
export * from "./TranscriptsListResponse.mjs";
|
|
@@ -1,99 +1 @@
|
|
|
1
|
-
|
|
2
|
-
import type { BaseClientOptions } from "../BaseClient.mjs";
|
|
3
|
-
import * as core from "../core/index.mjs";
|
|
4
|
-
import { CLIENT_ID_PARAM, CLIENT_SECRET_PARAM, CODE_PARAM, CODE_VERIFIER_PARAM, PASSWORD_PARAM, REDIRECT_URI_PARAM, USERNAME_PARAM } from "../custom/utils/oauthAuthHelpers.mjs";
|
|
5
|
-
/** Patch: Re-export for consumers; implementation shared with OAuthRopcAuthProvider, OAuthAuthCodeAuthProvider and OAuthPkceAuthProvider. */
|
|
6
|
-
export { BUFFER_IN_MINUTES, CLIENT_ID_PARAM, CLIENT_ID_REQUIRED_ERROR_MESSAGE, CLIENT_SECRET_PARAM, CLIENT_SECRET_REQUIRED_ERROR_MESSAGE, CODE_PARAM, CODE_VERIFIER_PARAM, getExpiresAt, PASSWORD_PARAM, PASSWORD_REQUIRED_ERROR_MESSAGE, REDIRECT_URI_PARAM, USERNAME_PARAM, USERNAME_REQUIRED_ERROR_MESSAGE, } from "../custom/utils/oauthAuthHelpers.mjs";
|
|
7
|
-
declare const TOKEN_PARAM: "token";
|
|
8
|
-
export declare class OAuthAuthProvider implements core.AuthProvider {
|
|
9
|
-
private readonly options;
|
|
10
|
-
/**
|
|
11
|
-
* Patch: Use CortiAuth (real token endpoint) instead of AuthClient (fake-token).
|
|
12
|
-
*/
|
|
13
|
-
private readonly authClient;
|
|
14
|
-
private accessToken;
|
|
15
|
-
private expiresAt;
|
|
16
|
-
private refreshPromise;
|
|
17
|
-
private storedRefreshToken;
|
|
18
|
-
private refreshExpiresAt;
|
|
19
|
-
constructor(options: OAuthAuthProvider.Options & OAuthAuthProvider.ClientCredentials);
|
|
20
|
-
static canCreate(options?: Partial<OAuthAuthProvider.ClientCredentials & BaseClientOptions>): boolean;
|
|
21
|
-
private clientIdSupplier;
|
|
22
|
-
private clientSecretSupplier;
|
|
23
|
-
getAuthRequest({ endpointMetadata, }?: {
|
|
24
|
-
endpointMetadata?: core.EndpointMetadata;
|
|
25
|
-
}): Promise<core.AuthRequest>;
|
|
26
|
-
private getToken;
|
|
27
|
-
private refresh;
|
|
28
|
-
}
|
|
29
|
-
export declare class OAuthTokenOverrideAuthProvider implements core.AuthProvider {
|
|
30
|
-
private readonly authClient;
|
|
31
|
-
private readonly _tokenSupplier;
|
|
32
|
-
private readonly _clientIdSupplier;
|
|
33
|
-
private readonly _refreshAccessToken;
|
|
34
|
-
private accessToken;
|
|
35
|
-
private expiresAt;
|
|
36
|
-
private storedRefreshToken;
|
|
37
|
-
private refreshExpiresAt;
|
|
38
|
-
private _seedPromise;
|
|
39
|
-
constructor(options: OAuthAuthProvider.TokenOverride & BaseClientOptions);
|
|
40
|
-
static canCreate(options?: Partial<OAuthAuthProvider.TokenOverride & BaseClientOptions>): options is OAuthAuthProvider.TokenOverride & BaseClientOptions;
|
|
41
|
-
getAuthRequest({ endpointMetadata, }?: {
|
|
42
|
-
endpointMetadata?: core.EndpointMetadata;
|
|
43
|
-
}): Promise<core.AuthRequest>;
|
|
44
|
-
}
|
|
45
|
-
export declare namespace OAuthAuthProvider {
|
|
46
|
-
const AUTH_SCHEME: "OAuth";
|
|
47
|
-
/** Patch: Message extended to mention ROPC (clientId, username, password). */
|
|
48
|
-
const AUTH_CONFIG_ERROR_MESSAGE: string;
|
|
49
|
-
type ClientCredentials = {
|
|
50
|
-
[CLIENT_ID_PARAM]: core.Supplier<string>;
|
|
51
|
-
[CLIENT_SECRET_PARAM]: core.Supplier<string>;
|
|
52
|
-
};
|
|
53
|
-
/**
|
|
54
|
-
* Patch: tokenType and expiresIn made optional — the provider only strictly needs accessToken.
|
|
55
|
-
* Mirrors AuthTokenResponse but relaxes the two required fields so custom refresh functions
|
|
56
|
-
* don't need to return fields the provider doesn't use.
|
|
57
|
-
*/
|
|
58
|
-
type ExpectedTokenResponse = Omit<Corti.AuthTokenResponse, "tokenType" | "expiresIn"> & {
|
|
59
|
-
tokenType?: string;
|
|
60
|
-
expiresIn?: number;
|
|
61
|
-
};
|
|
62
|
-
/** Patch: Custom refresh function — sync or async, receives the last known refresh token. */
|
|
63
|
-
type RefreshAccessTokenFunction = (refreshToken?: string) => Promise<OAuthAuthProvider.ExpectedTokenResponse> | OAuthAuthProvider.ExpectedTokenResponse;
|
|
64
|
-
type TokenOverride = {
|
|
65
|
-
[TOKEN_PARAM]?: core.Supplier<string>;
|
|
66
|
-
/** Patch: Custom callback called to obtain/renew the access token. Takes priority over built-in clientId+refreshToken path. */
|
|
67
|
-
refreshAccessToken?: OAuthAuthProvider.RefreshAccessTokenFunction;
|
|
68
|
-
expiresIn?: number;
|
|
69
|
-
refreshToken?: string;
|
|
70
|
-
refreshExpiresIn?: number;
|
|
71
|
-
clientId?: core.Supplier<string>;
|
|
72
|
-
/** Patch: Pre-seeded token response from resolveClientOptions — avoids a second refreshAccessToken call on first API request. */
|
|
73
|
-
initialTokenResponse?: Promise<OAuthAuthProvider.ExpectedTokenResponse>;
|
|
74
|
-
};
|
|
75
|
-
/** Patch: ROPC grant credentials (clientId + username + password) */
|
|
76
|
-
type RopcCredentials = {
|
|
77
|
-
[CLIENT_ID_PARAM]: core.Supplier<string>;
|
|
78
|
-
[USERNAME_PARAM]: core.Supplier<string>;
|
|
79
|
-
[PASSWORD_PARAM]: core.Supplier<string>;
|
|
80
|
-
};
|
|
81
|
-
/** Patch: Authorization code credentials (clientId + clientSecret + code + redirectUri) */
|
|
82
|
-
type AuthCodeCredentials = {
|
|
83
|
-
[CLIENT_ID_PARAM]: core.Supplier<string>;
|
|
84
|
-
[CLIENT_SECRET_PARAM]: core.Supplier<string>;
|
|
85
|
-
[CODE_PARAM]: core.Supplier<string>;
|
|
86
|
-
[REDIRECT_URI_PARAM]: core.Supplier<string>;
|
|
87
|
-
};
|
|
88
|
-
/** Patch: PKCE credentials (clientId + code + redirectUri; no clientSecret) */
|
|
89
|
-
type PkceCredentials = {
|
|
90
|
-
[CLIENT_ID_PARAM]: core.Supplier<string>;
|
|
91
|
-
[CODE_PARAM]: core.Supplier<string>;
|
|
92
|
-
[REDIRECT_URI_PARAM]: core.Supplier<string>;
|
|
93
|
-
[CODE_VERIFIER_PARAM]?: core.Supplier<string>;
|
|
94
|
-
};
|
|
95
|
-
/** Patch: Include RopcCredentials, AuthCodeCredentials and PkceCredentials so CortiClient can use those auth flows. */
|
|
96
|
-
type AuthOptions = ClientCredentials | TokenOverride | RopcCredentials | AuthCodeCredentials | PkceCredentials;
|
|
97
|
-
type Options = BaseClientOptions & AuthOptions;
|
|
98
|
-
function createInstance(options: Options): core.AuthProvider;
|
|
99
|
-
}
|
|
1
|
+
export * from "../custom/overrides/OAuthAuthProvider.mjs";
|
|
@@ -1,239 +1,2 @@
|
|
|
1
|
-
//
|
|
2
|
-
|
|
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
|
-
import * as core from "../core/index.mjs";
|
|
12
|
-
import { CortiAuth } from "../custom/CortiAuth.mjs";
|
|
13
|
-
import { OAuthAuthCodeAuthProvider } from "../custom/OAuthAuthCodeAuthProvider.mjs";
|
|
14
|
-
import { OAuthPkceAuthProvider } from "../custom/OAuthPkceAuthProvider.mjs";
|
|
15
|
-
import { OAuthRopcAuthProvider } from "../custom/OAuthRopcAuthProvider.mjs";
|
|
16
|
-
import { BUFFER_IN_MINUTES, CLIENT_ID_PARAM, CLIENT_ID_REQUIRED_ERROR_MESSAGE, CLIENT_SECRET_PARAM, CLIENT_SECRET_REQUIRED_ERROR_MESSAGE, CODE_PARAM, CODE_VERIFIER_PARAM, getExpiresAt, PASSWORD_PARAM, REDIRECT_URI_PARAM, USERNAME_PARAM, } from "../custom/utils/oauthAuthHelpers.mjs";
|
|
17
|
-
import * as errors from "../errors/index.mjs";
|
|
18
|
-
/** Patch: Re-export for consumers; implementation shared with OAuthRopcAuthProvider, OAuthAuthCodeAuthProvider and OAuthPkceAuthProvider. */
|
|
19
|
-
export { BUFFER_IN_MINUTES, CLIENT_ID_PARAM, CLIENT_ID_REQUIRED_ERROR_MESSAGE, CLIENT_SECRET_PARAM, CLIENT_SECRET_REQUIRED_ERROR_MESSAGE, CODE_PARAM, CODE_VERIFIER_PARAM, getExpiresAt, PASSWORD_PARAM, PASSWORD_REQUIRED_ERROR_MESSAGE, REDIRECT_URI_PARAM, USERNAME_PARAM, USERNAME_REQUIRED_ERROR_MESSAGE, } from "../custom/utils/oauthAuthHelpers.mjs";
|
|
20
|
-
const TOKEN_PARAM = "token";
|
|
21
|
-
const TOKEN_PARAM_REQUIRED_ERROR_MESSAGE = `${TOKEN_PARAM} is required. Please provide it in options.`;
|
|
22
|
-
export class OAuthAuthProvider {
|
|
23
|
-
constructor(options) {
|
|
24
|
-
this.options = options;
|
|
25
|
-
/**
|
|
26
|
-
* Patch: Use CortiAuth (real token endpoint) instead of AuthClient (fake-token).
|
|
27
|
-
*/
|
|
28
|
-
this.authClient = new CortiAuth(options);
|
|
29
|
-
this.expiresAt = new Date();
|
|
30
|
-
}
|
|
31
|
-
static canCreate(options) {
|
|
32
|
-
return (options === null || options === void 0 ? void 0 : options[CLIENT_ID_PARAM]) != null && (options === null || options === void 0 ? void 0 : options[CLIENT_SECRET_PARAM]) != null;
|
|
33
|
-
}
|
|
34
|
-
clientIdSupplier() {
|
|
35
|
-
return __awaiter(this, arguments, void 0, function* ({ endpointMetadata, } = {}) {
|
|
36
|
-
const supplier = this.options[CLIENT_ID_PARAM];
|
|
37
|
-
if (supplier == null) {
|
|
38
|
-
throw new errors.CortiError({
|
|
39
|
-
message: CLIENT_ID_REQUIRED_ERROR_MESSAGE,
|
|
40
|
-
});
|
|
41
|
-
}
|
|
42
|
-
return core.EndpointSupplier.get(supplier, { endpointMetadata });
|
|
43
|
-
});
|
|
44
|
-
}
|
|
45
|
-
clientSecretSupplier() {
|
|
46
|
-
return __awaiter(this, arguments, void 0, function* ({ endpointMetadata, } = {}) {
|
|
47
|
-
const supplier = this.options[CLIENT_SECRET_PARAM];
|
|
48
|
-
if (supplier == null) {
|
|
49
|
-
throw new errors.CortiError({
|
|
50
|
-
message: CLIENT_SECRET_REQUIRED_ERROR_MESSAGE,
|
|
51
|
-
});
|
|
52
|
-
}
|
|
53
|
-
return core.EndpointSupplier.get(supplier, { endpointMetadata });
|
|
54
|
-
});
|
|
55
|
-
}
|
|
56
|
-
getAuthRequest() {
|
|
57
|
-
return __awaiter(this, arguments, void 0, function* ({ endpointMetadata, } = {}) {
|
|
58
|
-
const token = yield this.getToken({ endpointMetadata });
|
|
59
|
-
return {
|
|
60
|
-
headers: {
|
|
61
|
-
Authorization: `Bearer ${token}`,
|
|
62
|
-
},
|
|
63
|
-
};
|
|
64
|
-
});
|
|
65
|
-
}
|
|
66
|
-
getToken() {
|
|
67
|
-
return __awaiter(this, arguments, void 0, function* ({ endpointMetadata } = {}) {
|
|
68
|
-
if (this.accessToken && this.expiresAt > new Date()) {
|
|
69
|
-
return this.accessToken;
|
|
70
|
-
}
|
|
71
|
-
// If a refresh is already in progress, return the existing promise
|
|
72
|
-
if (this.refreshPromise != null) {
|
|
73
|
-
return this.refreshPromise;
|
|
74
|
-
}
|
|
75
|
-
return this.refresh({ endpointMetadata });
|
|
76
|
-
});
|
|
77
|
-
}
|
|
78
|
-
refresh() {
|
|
79
|
-
return __awaiter(this, arguments, void 0, function* ({ endpointMetadata } = {}) {
|
|
80
|
-
this.refreshPromise = (() => __awaiter(this, void 0, void 0, function* () {
|
|
81
|
-
try {
|
|
82
|
-
const clientId = yield this.clientIdSupplier({ endpointMetadata });
|
|
83
|
-
const clientSecret = yield this.clientSecretSupplier({ endpointMetadata });
|
|
84
|
-
const tokenResponse = clientId && this.storedRefreshToken && this.refreshExpiresAt && this.refreshExpiresAt > new Date()
|
|
85
|
-
? yield this.authClient.refreshToken({
|
|
86
|
-
clientId,
|
|
87
|
-
refreshToken: this.storedRefreshToken,
|
|
88
|
-
})
|
|
89
|
-
: yield this.authClient.getToken({ clientId, clientSecret });
|
|
90
|
-
this.accessToken = tokenResponse.accessToken;
|
|
91
|
-
this.expiresAt = getExpiresAt(tokenResponse.expiresIn, BUFFER_IN_MINUTES);
|
|
92
|
-
if (tokenResponse.refreshToken) {
|
|
93
|
-
this.storedRefreshToken = tokenResponse.refreshToken;
|
|
94
|
-
this.refreshExpiresAt = tokenResponse.refreshExpiresIn
|
|
95
|
-
? getExpiresAt(tokenResponse.refreshExpiresIn, BUFFER_IN_MINUTES)
|
|
96
|
-
: undefined;
|
|
97
|
-
}
|
|
98
|
-
return this.accessToken;
|
|
99
|
-
}
|
|
100
|
-
finally {
|
|
101
|
-
this.refreshPromise = undefined;
|
|
102
|
-
}
|
|
103
|
-
}))();
|
|
104
|
-
return this.refreshPromise;
|
|
105
|
-
});
|
|
106
|
-
}
|
|
107
|
-
}
|
|
108
|
-
export class OAuthTokenOverrideAuthProvider {
|
|
109
|
-
constructor(options) {
|
|
110
|
-
this._tokenSupplier = options[TOKEN_PARAM];
|
|
111
|
-
this._clientIdSupplier = options.clientId;
|
|
112
|
-
// Patch: store custom refresh callback
|
|
113
|
-
this._refreshAccessToken = options.refreshAccessToken;
|
|
114
|
-
this.expiresAt = options.expiresIn ? getExpiresAt(options.expiresIn, BUFFER_IN_MINUTES) : undefined;
|
|
115
|
-
this.storedRefreshToken = options.refreshToken;
|
|
116
|
-
this.refreshExpiresAt = options.refreshExpiresIn
|
|
117
|
-
? getExpiresAt(options.refreshExpiresIn, BUFFER_IN_MINUTES)
|
|
118
|
-
: undefined;
|
|
119
|
-
if (options.clientId && options.refreshToken) {
|
|
120
|
-
this.authClient = new CortiAuth(options);
|
|
121
|
-
}
|
|
122
|
-
// Patch: pre-seed token from discovery promise so getAuthRequest doesn't call refreshAccessToken again
|
|
123
|
-
if (options.initialTokenResponse) {
|
|
124
|
-
this._seedPromise = options.initialTokenResponse
|
|
125
|
-
.then((resp) => {
|
|
126
|
-
this.accessToken = resp.accessToken;
|
|
127
|
-
this.expiresAt = resp.expiresIn ? getExpiresAt(resp.expiresIn, BUFFER_IN_MINUTES) : undefined;
|
|
128
|
-
if (resp.refreshToken) {
|
|
129
|
-
this.storedRefreshToken = resp.refreshToken;
|
|
130
|
-
this.refreshExpiresAt = resp.refreshExpiresIn
|
|
131
|
-
? getExpiresAt(resp.refreshExpiresIn, BUFFER_IN_MINUTES)
|
|
132
|
-
: undefined;
|
|
133
|
-
}
|
|
134
|
-
})
|
|
135
|
-
.finally(() => {
|
|
136
|
-
this._seedPromise = undefined;
|
|
137
|
-
});
|
|
138
|
-
}
|
|
139
|
-
}
|
|
140
|
-
static canCreate(options) {
|
|
141
|
-
// Patch: either token or refreshAccessToken is sufficient
|
|
142
|
-
return (options === null || options === void 0 ? void 0 : options[TOKEN_PARAM]) != null || (options === null || options === void 0 ? void 0 : options.refreshAccessToken) != null;
|
|
143
|
-
}
|
|
144
|
-
getAuthRequest() {
|
|
145
|
-
return __awaiter(this, arguments, void 0, function* ({ endpointMetadata, } = {}) {
|
|
146
|
-
// Patch: await seed promise so the initial token from resolveClientOptions is set before checking expiry
|
|
147
|
-
if (this._seedPromise) {
|
|
148
|
-
yield this._seedPromise;
|
|
149
|
-
}
|
|
150
|
-
const isExpiredOrAbsent = !this.accessToken || (this.expiresAt != null && this.expiresAt <= new Date());
|
|
151
|
-
// Patch: custom refreshAccessToken takes priority — call it when token is absent or expired
|
|
152
|
-
if (this._refreshAccessToken && isExpiredOrAbsent) {
|
|
153
|
-
const result = yield this._refreshAccessToken(this.storedRefreshToken);
|
|
154
|
-
this.accessToken = result.accessToken;
|
|
155
|
-
this.expiresAt = result.expiresIn ? getExpiresAt(result.expiresIn, BUFFER_IN_MINUTES) : undefined;
|
|
156
|
-
if (result.refreshToken) {
|
|
157
|
-
this.storedRefreshToken = result.refreshToken;
|
|
158
|
-
this.refreshExpiresAt = result.refreshExpiresIn
|
|
159
|
-
? getExpiresAt(result.refreshExpiresIn, BUFFER_IN_MINUTES)
|
|
160
|
-
: undefined;
|
|
161
|
-
}
|
|
162
|
-
return { headers: { Authorization: `Bearer ${this.accessToken}` } };
|
|
163
|
-
}
|
|
164
|
-
// Built-in: if access token is expired and we have a valid SDK refresh token, use it
|
|
165
|
-
if (this.expiresAt != null &&
|
|
166
|
-
this.expiresAt <= new Date() &&
|
|
167
|
-
this._clientIdSupplier &&
|
|
168
|
-
this.storedRefreshToken &&
|
|
169
|
-
this.refreshExpiresAt &&
|
|
170
|
-
this.refreshExpiresAt > new Date() &&
|
|
171
|
-
this.authClient) {
|
|
172
|
-
const clientId = yield core.EndpointSupplier.get(this._clientIdSupplier, { endpointMetadata });
|
|
173
|
-
const tokenResponse = yield this.authClient.refreshToken({
|
|
174
|
-
clientId,
|
|
175
|
-
refreshToken: this.storedRefreshToken,
|
|
176
|
-
});
|
|
177
|
-
this.accessToken = tokenResponse.accessToken;
|
|
178
|
-
this.expiresAt = getExpiresAt(tokenResponse.expiresIn, BUFFER_IN_MINUTES);
|
|
179
|
-
if (tokenResponse.refreshToken) {
|
|
180
|
-
this.storedRefreshToken = tokenResponse.refreshToken;
|
|
181
|
-
this.refreshExpiresAt = tokenResponse.refreshExpiresIn
|
|
182
|
-
? getExpiresAt(tokenResponse.refreshExpiresIn, BUFFER_IN_MINUTES)
|
|
183
|
-
: undefined;
|
|
184
|
-
}
|
|
185
|
-
return { headers: { Authorization: `Bearer ${this.accessToken}` } };
|
|
186
|
-
}
|
|
187
|
-
// Token not yet acquired — resolve from supplier (static token / initial value)
|
|
188
|
-
if (!this.accessToken) {
|
|
189
|
-
if (this._tokenSupplier == null) {
|
|
190
|
-
throw new errors.CortiError({ message: TOKEN_PARAM_REQUIRED_ERROR_MESSAGE });
|
|
191
|
-
}
|
|
192
|
-
this.accessToken = yield core.EndpointSupplier.get(this._tokenSupplier, { endpointMetadata });
|
|
193
|
-
}
|
|
194
|
-
if (!this.accessToken) {
|
|
195
|
-
throw new errors.CortiError({ message: TOKEN_PARAM_REQUIRED_ERROR_MESSAGE });
|
|
196
|
-
}
|
|
197
|
-
return { headers: { Authorization: `Bearer ${this.accessToken}` } };
|
|
198
|
-
});
|
|
199
|
-
}
|
|
200
|
-
}
|
|
201
|
-
(function (OAuthAuthProvider) {
|
|
202
|
-
OAuthAuthProvider.AUTH_SCHEME = "OAuth";
|
|
203
|
-
/** Patch: Message extended to mention ROPC (clientId, username, password). */
|
|
204
|
-
OAuthAuthProvider.AUTH_CONFIG_ERROR_MESSAGE = `Insufficient options to create OAuthAuthProvider. Please provide '${CLIENT_ID_PARAM}' and '${CLIENT_SECRET_PARAM}', or ${TOKEN_PARAM}, or ROPC (${CLIENT_ID_PARAM}, username, password).`;
|
|
205
|
-
function createInstance(options) {
|
|
206
|
-
if (OAuthTokenOverrideAuthProvider.canCreate(options)) {
|
|
207
|
-
return new OAuthTokenOverrideAuthProvider(options);
|
|
208
|
-
}
|
|
209
|
-
/** Patch: ROPC provider before client credentials so ROPC auth is used when username+password provided. */
|
|
210
|
-
if (OAuthRopcAuthProvider.canCreate(options)) {
|
|
211
|
-
return new OAuthRopcAuthProvider(options);
|
|
212
|
-
}
|
|
213
|
-
/** Patch: PKCE provider before auth code — both have clientId+code+redirectUri, but PKCE has no clientSecret. */
|
|
214
|
-
if (OAuthPkceAuthProvider.canCreate(options)) {
|
|
215
|
-
return new OAuthPkceAuthProvider(options);
|
|
216
|
-
}
|
|
217
|
-
/** Patch: Auth code provider before client credentials — both have clientId+clientSecret, code+redirectUri distinguishes auth code. */
|
|
218
|
-
if (OAuthAuthCodeAuthProvider.canCreate(options)) {
|
|
219
|
-
return new OAuthAuthCodeAuthProvider(options);
|
|
220
|
-
}
|
|
221
|
-
if (OAuthAuthProvider.canCreate(options)) {
|
|
222
|
-
return new OAuthAuthProvider(options);
|
|
223
|
-
}
|
|
224
|
-
/** Patch: No credentials provided — proxy/passthrough mode; requests are sent without an Authorization header. */
|
|
225
|
-
const partialOptions = options;
|
|
226
|
-
const hasNoCredentials = partialOptions[CLIENT_ID_PARAM] == null &&
|
|
227
|
-
partialOptions[CLIENT_SECRET_PARAM] == null &&
|
|
228
|
-
partialOptions[TOKEN_PARAM] == null &&
|
|
229
|
-
partialOptions.refreshAccessToken == null &&
|
|
230
|
-
partialOptions[USERNAME_PARAM] == null;
|
|
231
|
-
if (hasNoCredentials) {
|
|
232
|
-
return new core.NoOpAuthProvider();
|
|
233
|
-
}
|
|
234
|
-
throw new errors.CortiError({
|
|
235
|
-
message: OAuthAuthProvider.AUTH_CONFIG_ERROR_MESSAGE,
|
|
236
|
-
});
|
|
237
|
-
}
|
|
238
|
-
OAuthAuthProvider.createInstance = createInstance;
|
|
239
|
-
})(OAuthAuthProvider || (OAuthAuthProvider = {}));
|
|
1
|
+
// Custom implementation lives in src/custom/overrides/OAuthAuthProvider.ts
|
|
2
|
+
export * from "../custom/overrides/OAuthAuthProvider.mjs";
|
|
@@ -1,11 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
export
|
|
3
|
-
export type { EndpointMetadata } from "./EndpointMetadata.mjs";
|
|
4
|
-
export { EndpointSupplier } from "./EndpointSupplier.mjs";
|
|
5
|
-
export type { Fetcher, FetchFunction } from "./Fetcher.mjs";
|
|
6
|
-
export { fetcher } from "./Fetcher.mjs";
|
|
7
|
-
export { getHeader } from "./getHeader.mjs";
|
|
8
|
-
export { HttpResponsePromise } from "./HttpResponsePromise.mjs";
|
|
9
|
-
export type { RawResponse, WithRawResponse } from "./RawResponse.mjs";
|
|
10
|
-
export { abortRawResponse, toRawResponse, unknownRawResponse } from "./RawResponse.mjs";
|
|
11
|
-
export { Supplier } from "./Supplier.mjs";
|
|
1
|
+
/** Patch: withCredentials - re-export from custom barrel; fetcher uses global withCredentials default */
|
|
2
|
+
export * from "../../custom/overrides/fetcher/index.mjs";
|
|
@@ -1,6 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
export
|
|
3
|
-
export { getHeader } from "./getHeader.mjs";
|
|
4
|
-
export { HttpResponsePromise } from "./HttpResponsePromise.mjs";
|
|
5
|
-
export { abortRawResponse, toRawResponse, unknownRawResponse } from "./RawResponse.mjs";
|
|
6
|
-
export { Supplier } from "./Supplier.mjs";
|
|
1
|
+
/** Patch: withCredentials - re-export from custom barrel; fetcher uses global withCredentials default */
|
|
2
|
+
export * from "../../custom/overrides/fetcher/index.mjs";
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import type { OAuthAuthProvider } from "../auth/OAuthAuthProvider.mjs";
|
|
2
2
|
import { CortiClient as BaseCortiClient } from "../Client.mjs";
|
|
3
3
|
import type * as environments from "../environments.mjs";
|
|
4
|
-
import { CortiAuth } from "./CortiAuth.mjs";
|
|
5
|
-
import { CustomStream } from "./CustomStream.mjs";
|
|
6
|
-
import { CustomTranscribe } from "./CustomTranscribe.mjs";
|
|
4
|
+
import { CortiAuth } from "./auth/CortiAuth.mjs";
|
|
5
|
+
import { CustomStream } from "./stream/CustomStream.mjs";
|
|
6
|
+
import { CustomTranscribe } from "./transcribe/CustomTranscribe.mjs";
|
|
7
7
|
import { type Environment } from "./utils/environment.mjs";
|
|
8
8
|
type TokenDerivableAuth = {
|
|
9
9
|
accessToken: string;
|
|
@@ -20,7 +20,15 @@ type TokenDerivableAuth = {
|
|
|
20
20
|
refreshExpiresIn?: number;
|
|
21
21
|
clientId?: string;
|
|
22
22
|
};
|
|
23
|
-
type OptionsBase = Omit<BaseCortiClient.Options, "clientId" | "clientSecret" | "token" | "environment" | "tenantName" | "baseUrl"
|
|
23
|
+
type OptionsBase = Omit<BaseCortiClient.Options, "clientId" | "clientSecret" | "token" | "environment" | "tenantName" | "baseUrl"> & {
|
|
24
|
+
withCredentials?: boolean;
|
|
25
|
+
/**
|
|
26
|
+
* When true, encodes the client's auth headers as WebSocket subprotocol pairs instead of
|
|
27
|
+
* HTTP headers on every WebSocket connection. Useful when connecting through a gateway
|
|
28
|
+
* that strips HTTP headers but passes WS protocols through.
|
|
29
|
+
*/
|
|
30
|
+
encodeHeadersAsWsProtocols?: boolean;
|
|
31
|
+
};
|
|
24
32
|
export declare namespace CortiClient {
|
|
25
33
|
type Auth = {
|
|
26
34
|
clientId: string;
|
|
@@ -94,6 +102,9 @@ export declare namespace CortiClient {
|
|
|
94
102
|
}
|
|
95
103
|
export declare class CortiClient extends BaseCortiClient {
|
|
96
104
|
protected _auth: CortiAuth | undefined;
|
|
105
|
+
protected _stream: CustomStream | undefined;
|
|
106
|
+
protected _transcribe: CustomTranscribe | undefined;
|
|
107
|
+
private readonly _encodeHeadersAsWsProtocols;
|
|
97
108
|
constructor(options: CortiClient.Options);
|
|
98
109
|
get auth(): CortiAuth;
|
|
99
110
|
get stream(): CustomStream;
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { CortiClient as BaseCortiClient } from "../Client.mjs";
|
|
2
|
-
import { CortiAuth } from "./CortiAuth.mjs";
|
|
3
|
-
import { CustomStream } from "./CustomStream.mjs";
|
|
4
|
-
import { CustomTranscribe } from "./CustomTranscribe.mjs";
|
|
2
|
+
import { CortiAuth } from "./auth/CortiAuth.mjs";
|
|
3
|
+
import { CustomStream } from "./stream/CustomStream.mjs";
|
|
4
|
+
import { CustomTranscribe } from "./transcribe/CustomTranscribe.mjs";
|
|
5
5
|
import { authToBaseOptions } from "./utils/authToBaseOptions.mjs";
|
|
6
|
+
import { setDefaultWithCredentials } from "./utils/withCredentialsConfig.mjs";
|
|
6
7
|
import { getEnvironment } from "./utils/environment.mjs";
|
|
7
8
|
import { resolveClientOptions } from "./utils/resolveClientOptions.mjs";
|
|
8
9
|
export class CortiClient extends BaseCortiClient {
|
|
@@ -11,6 +12,8 @@ export class CortiClient extends BaseCortiClient {
|
|
|
11
12
|
const ctx = resolveClientOptions(options);
|
|
12
13
|
const restOptions = Object.assign(Object.assign(Object.assign({}, opts), { tenantName: ctx.tenantName, environment: getEnvironment(ctx.environment) }), (ctx.initialTokenResponse != null ? { initialTokenResponse: ctx.initialTokenResponse } : {}));
|
|
13
14
|
super(authToBaseOptions(opts.auth, restOptions));
|
|
15
|
+
setDefaultWithCredentials(options.withCredentials);
|
|
16
|
+
this._encodeHeadersAsWsProtocols = options.encodeHeadersAsWsProtocols;
|
|
14
17
|
}
|
|
15
18
|
get auth() {
|
|
16
19
|
var _a;
|
|
@@ -18,10 +21,10 @@ export class CortiClient extends BaseCortiClient {
|
|
|
18
21
|
}
|
|
19
22
|
get stream() {
|
|
20
23
|
var _a;
|
|
21
|
-
return ((_a = this._stream) !== null && _a !== void 0 ? _a : (this._stream = new CustomStream(this._options)));
|
|
24
|
+
return ((_a = this._stream) !== null && _a !== void 0 ? _a : (this._stream = new CustomStream(Object.assign(Object.assign({}, this._options), { encodeHeadersAsWsProtocols: this._encodeHeadersAsWsProtocols }))));
|
|
22
25
|
}
|
|
23
26
|
get transcribe() {
|
|
24
27
|
var _a;
|
|
25
|
-
return ((_a = this._transcribe) !== null && _a !== void 0 ? _a : (this._transcribe = new CustomTranscribe(this._options)));
|
|
28
|
+
return ((_a = this._transcribe) !== null && _a !== void 0 ? _a : (this._transcribe = new CustomTranscribe(Object.assign(Object.assign({}, this._options), { encodeHeadersAsWsProtocols: this._encodeHeadersAsWsProtocols }))));
|
|
26
29
|
}
|
|
27
30
|
}
|
|
@@ -1,45 +1,15 @@
|
|
|
1
|
+
import { CustomProxyStream } from "./proxy/CustomProxyStream.mjs";
|
|
2
|
+
import { CustomProxyTranscribe } from "./proxy/CustomProxyTranscribe.mjs";
|
|
1
3
|
/**
|
|
2
|
-
* Lightweight
|
|
3
|
-
*
|
|
4
|
+
* Lightweight WebSocket-only client for proxy scenarios.
|
|
5
|
+
* No environment, tenantName, or auth required — supply the proxy URL at connect() time.
|
|
4
6
|
*
|
|
5
|
-
*
|
|
7
|
+
* @example
|
|
8
|
+
* const socket = await CortiWebSocketProxyClient.stream.connect({
|
|
9
|
+
* proxy: { url: "wss://my-proxy/stream" },
|
|
10
|
+
* });
|
|
6
11
|
*/
|
|
7
|
-
import * as api from "../api/index.mjs";
|
|
8
|
-
import { StreamSocket } from "./CustomStreamSocket.mjs";
|
|
9
|
-
import { TranscribeSocket } from "./CustomTranscribeSocket.mjs";
|
|
10
|
-
type ProxyOptions = {
|
|
11
|
-
url: string;
|
|
12
|
-
protocols?: string[];
|
|
13
|
-
queryParameters?: Record<string, string>;
|
|
14
|
-
};
|
|
15
|
-
/** Stream with proxy required */
|
|
16
|
-
declare class ProxyStream {
|
|
17
|
-
private _stream;
|
|
18
|
-
constructor();
|
|
19
|
-
connect(args: {
|
|
20
|
-
proxy: ProxyOptions;
|
|
21
|
-
configuration?: api.StreamConfig;
|
|
22
|
-
headers?: Record<string, string>;
|
|
23
|
-
debug?: boolean;
|
|
24
|
-
reconnectAttempts?: number;
|
|
25
|
-
}): Promise<StreamSocket>;
|
|
26
|
-
}
|
|
27
|
-
/** Transcribe with proxy required */
|
|
28
|
-
declare class ProxyTranscribe {
|
|
29
|
-
private _transcribe;
|
|
30
|
-
constructor();
|
|
31
|
-
connect(args: {
|
|
32
|
-
proxy: ProxyOptions;
|
|
33
|
-
configuration?: api.TranscribeConfig;
|
|
34
|
-
headers?: Record<string, string>;
|
|
35
|
-
debug?: boolean;
|
|
36
|
-
reconnectAttempts?: number;
|
|
37
|
-
}): Promise<TranscribeSocket>;
|
|
38
|
-
}
|
|
39
12
|
export declare class CortiWebSocketProxyClient {
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
static get stream(): ProxyStream;
|
|
43
|
-
static get transcribe(): ProxyTranscribe;
|
|
13
|
+
static readonly stream: CustomProxyStream;
|
|
14
|
+
static readonly transcribe: CustomProxyTranscribe;
|
|
44
15
|
}
|
|
45
|
-
export {};
|
|
@@ -1,44 +1,15 @@
|
|
|
1
|
+
import { CustomProxyStream } from "./proxy/CustomProxyStream.mjs";
|
|
2
|
+
import { CustomProxyTranscribe } from "./proxy/CustomProxyTranscribe.mjs";
|
|
1
3
|
/**
|
|
2
|
-
* Lightweight
|
|
3
|
-
*
|
|
4
|
+
* Lightweight WebSocket-only client for proxy scenarios.
|
|
5
|
+
* No environment, tenantName, or auth required — supply the proxy URL at connect() time.
|
|
4
6
|
*
|
|
5
|
-
*
|
|
7
|
+
* @example
|
|
8
|
+
* const socket = await CortiWebSocketProxyClient.stream.connect({
|
|
9
|
+
* proxy: { url: "wss://my-proxy/stream" },
|
|
10
|
+
* });
|
|
6
11
|
*/
|
|
7
|
-
import * as environments from "../environments.mjs";
|
|
8
|
-
import { Stream } from "./CustomStream.mjs";
|
|
9
|
-
import { Transcribe } from "./CustomTranscribe.mjs";
|
|
10
|
-
/** Stream with proxy required */
|
|
11
|
-
class ProxyStream {
|
|
12
|
-
constructor() {
|
|
13
|
-
this._stream = new Stream({
|
|
14
|
-
environment: environments.CortiEnvironment.Eu,
|
|
15
|
-
tenantName: "",
|
|
16
|
-
});
|
|
17
|
-
}
|
|
18
|
-
connect(args) {
|
|
19
|
-
// id is not used in proxy mode, but required by the underlying type
|
|
20
|
-
return this._stream.connect(Object.assign(Object.assign({}, args), { id: "" }));
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
/** Transcribe with proxy required */
|
|
24
|
-
class ProxyTranscribe {
|
|
25
|
-
constructor() {
|
|
26
|
-
this._transcribe = new Transcribe({
|
|
27
|
-
environment: environments.CortiEnvironment.Eu,
|
|
28
|
-
tenantName: "",
|
|
29
|
-
});
|
|
30
|
-
}
|
|
31
|
-
connect(args) {
|
|
32
|
-
return this._transcribe.connect(args);
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
12
|
export class CortiWebSocketProxyClient {
|
|
36
|
-
static get stream() {
|
|
37
|
-
var _a;
|
|
38
|
-
return ((_a = this._stream) !== null && _a !== void 0 ? _a : (this._stream = new ProxyStream()));
|
|
39
|
-
}
|
|
40
|
-
static get transcribe() {
|
|
41
|
-
var _a;
|
|
42
|
-
return ((_a = this._transcribe) !== null && _a !== void 0 ? _a : (this._transcribe = new ProxyTranscribe()));
|
|
43
|
-
}
|
|
44
13
|
}
|
|
14
|
+
CortiWebSocketProxyClient.stream = new CustomProxyStream();
|
|
15
|
+
CortiWebSocketProxyClient.transcribe = new CustomProxyTranscribe();
|