@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,99 @@
|
|
|
1
|
+
import type * as Corti from "../api/index.js";
|
|
2
|
+
import type { BaseClientOptions } from "../BaseClient.js";
|
|
3
|
+
import * as core from "../core/index.js";
|
|
4
|
+
import { CLIENT_ID_PARAM, CLIENT_SECRET_PARAM, CODE_PARAM, CODE_VERIFIER_PARAM, PASSWORD_PARAM, REDIRECT_URI_PARAM, USERNAME_PARAM } from "./utils/oauthAuthHelpers.js";
|
|
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 "./utils/oauthAuthHelpers.js";
|
|
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
|
+
}
|
|
@@ -0,0 +1,290 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
4
|
+
if (k2 === undefined) k2 = k;
|
|
5
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
6
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
7
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
8
|
+
}
|
|
9
|
+
Object.defineProperty(o, k2, desc);
|
|
10
|
+
}) : (function(o, m, k, k2) {
|
|
11
|
+
if (k2 === undefined) k2 = k;
|
|
12
|
+
o[k2] = m[k];
|
|
13
|
+
}));
|
|
14
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
15
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
16
|
+
}) : function(o, v) {
|
|
17
|
+
o["default"] = v;
|
|
18
|
+
});
|
|
19
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
20
|
+
var ownKeys = function(o) {
|
|
21
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
22
|
+
var ar = [];
|
|
23
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
24
|
+
return ar;
|
|
25
|
+
};
|
|
26
|
+
return ownKeys(o);
|
|
27
|
+
};
|
|
28
|
+
return function (mod) {
|
|
29
|
+
if (mod && mod.__esModule) return mod;
|
|
30
|
+
var result = {};
|
|
31
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
32
|
+
__setModuleDefault(result, mod);
|
|
33
|
+
return result;
|
|
34
|
+
};
|
|
35
|
+
})();
|
|
36
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
37
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
38
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
39
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
40
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
41
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
42
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
43
|
+
});
|
|
44
|
+
};
|
|
45
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
46
|
+
exports.OAuthTokenOverrideAuthProvider = exports.OAuthAuthProvider = exports.USERNAME_REQUIRED_ERROR_MESSAGE = exports.USERNAME_PARAM = exports.REDIRECT_URI_PARAM = exports.PASSWORD_REQUIRED_ERROR_MESSAGE = exports.PASSWORD_PARAM = exports.getExpiresAt = exports.CODE_VERIFIER_PARAM = exports.CODE_PARAM = exports.CLIENT_SECRET_REQUIRED_ERROR_MESSAGE = exports.CLIENT_SECRET_PARAM = exports.CLIENT_ID_REQUIRED_ERROR_MESSAGE = exports.CLIENT_ID_PARAM = exports.BUFFER_IN_MINUTES = void 0;
|
|
47
|
+
const core = __importStar(require("../core/index.js"));
|
|
48
|
+
const CortiAuth_js_1 = require("./CortiAuth.js");
|
|
49
|
+
const OAuthAuthCodeAuthProvider_js_1 = require("./OAuthAuthCodeAuthProvider.js");
|
|
50
|
+
const OAuthPkceAuthProvider_js_1 = require("./OAuthPkceAuthProvider.js");
|
|
51
|
+
const OAuthRopcAuthProvider_js_1 = require("./OAuthRopcAuthProvider.js");
|
|
52
|
+
const oauthAuthHelpers_js_1 = require("./utils/oauthAuthHelpers.js");
|
|
53
|
+
const errors = __importStar(require("../errors/index.js"));
|
|
54
|
+
/** Patch: Re-export for consumers; implementation shared with OAuthRopcAuthProvider, OAuthAuthCodeAuthProvider and OAuthPkceAuthProvider. */
|
|
55
|
+
var oauthAuthHelpers_js_2 = require("./utils/oauthAuthHelpers.js");
|
|
56
|
+
Object.defineProperty(exports, "BUFFER_IN_MINUTES", { enumerable: true, get: function () { return oauthAuthHelpers_js_2.BUFFER_IN_MINUTES; } });
|
|
57
|
+
Object.defineProperty(exports, "CLIENT_ID_PARAM", { enumerable: true, get: function () { return oauthAuthHelpers_js_2.CLIENT_ID_PARAM; } });
|
|
58
|
+
Object.defineProperty(exports, "CLIENT_ID_REQUIRED_ERROR_MESSAGE", { enumerable: true, get: function () { return oauthAuthHelpers_js_2.CLIENT_ID_REQUIRED_ERROR_MESSAGE; } });
|
|
59
|
+
Object.defineProperty(exports, "CLIENT_SECRET_PARAM", { enumerable: true, get: function () { return oauthAuthHelpers_js_2.CLIENT_SECRET_PARAM; } });
|
|
60
|
+
Object.defineProperty(exports, "CLIENT_SECRET_REQUIRED_ERROR_MESSAGE", { enumerable: true, get: function () { return oauthAuthHelpers_js_2.CLIENT_SECRET_REQUIRED_ERROR_MESSAGE; } });
|
|
61
|
+
Object.defineProperty(exports, "CODE_PARAM", { enumerable: true, get: function () { return oauthAuthHelpers_js_2.CODE_PARAM; } });
|
|
62
|
+
Object.defineProperty(exports, "CODE_VERIFIER_PARAM", { enumerable: true, get: function () { return oauthAuthHelpers_js_2.CODE_VERIFIER_PARAM; } });
|
|
63
|
+
Object.defineProperty(exports, "getExpiresAt", { enumerable: true, get: function () { return oauthAuthHelpers_js_2.getExpiresAt; } });
|
|
64
|
+
Object.defineProperty(exports, "PASSWORD_PARAM", { enumerable: true, get: function () { return oauthAuthHelpers_js_2.PASSWORD_PARAM; } });
|
|
65
|
+
Object.defineProperty(exports, "PASSWORD_REQUIRED_ERROR_MESSAGE", { enumerable: true, get: function () { return oauthAuthHelpers_js_2.PASSWORD_REQUIRED_ERROR_MESSAGE; } });
|
|
66
|
+
Object.defineProperty(exports, "REDIRECT_URI_PARAM", { enumerable: true, get: function () { return oauthAuthHelpers_js_2.REDIRECT_URI_PARAM; } });
|
|
67
|
+
Object.defineProperty(exports, "USERNAME_PARAM", { enumerable: true, get: function () { return oauthAuthHelpers_js_2.USERNAME_PARAM; } });
|
|
68
|
+
Object.defineProperty(exports, "USERNAME_REQUIRED_ERROR_MESSAGE", { enumerable: true, get: function () { return oauthAuthHelpers_js_2.USERNAME_REQUIRED_ERROR_MESSAGE; } });
|
|
69
|
+
const TOKEN_PARAM = "token";
|
|
70
|
+
const TOKEN_PARAM_REQUIRED_ERROR_MESSAGE = `${TOKEN_PARAM} is required. Please provide it in options.`;
|
|
71
|
+
class OAuthAuthProvider {
|
|
72
|
+
constructor(options) {
|
|
73
|
+
this.options = options;
|
|
74
|
+
/**
|
|
75
|
+
* Patch: Use CortiAuth (real token endpoint) instead of AuthClient (fake-token).
|
|
76
|
+
*/
|
|
77
|
+
this.authClient = new CortiAuth_js_1.CortiAuth(options);
|
|
78
|
+
this.expiresAt = new Date();
|
|
79
|
+
}
|
|
80
|
+
static canCreate(options) {
|
|
81
|
+
return (options === null || options === void 0 ? void 0 : options[oauthAuthHelpers_js_1.CLIENT_ID_PARAM]) != null && (options === null || options === void 0 ? void 0 : options[oauthAuthHelpers_js_1.CLIENT_SECRET_PARAM]) != null;
|
|
82
|
+
}
|
|
83
|
+
clientIdSupplier() {
|
|
84
|
+
return __awaiter(this, arguments, void 0, function* ({ endpointMetadata, } = {}) {
|
|
85
|
+
const supplier = this.options[oauthAuthHelpers_js_1.CLIENT_ID_PARAM];
|
|
86
|
+
if (supplier == null) {
|
|
87
|
+
throw new errors.CortiError({
|
|
88
|
+
message: oauthAuthHelpers_js_1.CLIENT_ID_REQUIRED_ERROR_MESSAGE,
|
|
89
|
+
});
|
|
90
|
+
}
|
|
91
|
+
return core.EndpointSupplier.get(supplier, { endpointMetadata });
|
|
92
|
+
});
|
|
93
|
+
}
|
|
94
|
+
clientSecretSupplier() {
|
|
95
|
+
return __awaiter(this, arguments, void 0, function* ({ endpointMetadata, } = {}) {
|
|
96
|
+
const supplier = this.options[oauthAuthHelpers_js_1.CLIENT_SECRET_PARAM];
|
|
97
|
+
if (supplier == null) {
|
|
98
|
+
throw new errors.CortiError({
|
|
99
|
+
message: oauthAuthHelpers_js_1.CLIENT_SECRET_REQUIRED_ERROR_MESSAGE,
|
|
100
|
+
});
|
|
101
|
+
}
|
|
102
|
+
return core.EndpointSupplier.get(supplier, { endpointMetadata });
|
|
103
|
+
});
|
|
104
|
+
}
|
|
105
|
+
getAuthRequest() {
|
|
106
|
+
return __awaiter(this, arguments, void 0, function* ({ endpointMetadata, } = {}) {
|
|
107
|
+
const token = yield this.getToken({ endpointMetadata });
|
|
108
|
+
return {
|
|
109
|
+
headers: {
|
|
110
|
+
Authorization: `Bearer ${token}`,
|
|
111
|
+
},
|
|
112
|
+
};
|
|
113
|
+
});
|
|
114
|
+
}
|
|
115
|
+
getToken() {
|
|
116
|
+
return __awaiter(this, arguments, void 0, function* ({ endpointMetadata } = {}) {
|
|
117
|
+
if (this.accessToken && this.expiresAt > new Date()) {
|
|
118
|
+
return this.accessToken;
|
|
119
|
+
}
|
|
120
|
+
// If a refresh is already in progress, return the existing promise
|
|
121
|
+
if (this.refreshPromise != null) {
|
|
122
|
+
return this.refreshPromise;
|
|
123
|
+
}
|
|
124
|
+
return this.refresh({ endpointMetadata });
|
|
125
|
+
});
|
|
126
|
+
}
|
|
127
|
+
refresh() {
|
|
128
|
+
return __awaiter(this, arguments, void 0, function* ({ endpointMetadata } = {}) {
|
|
129
|
+
this.refreshPromise = (() => __awaiter(this, void 0, void 0, function* () {
|
|
130
|
+
try {
|
|
131
|
+
const clientId = yield this.clientIdSupplier({ endpointMetadata });
|
|
132
|
+
const clientSecret = yield this.clientSecretSupplier({ endpointMetadata });
|
|
133
|
+
const tokenResponse = clientId && this.storedRefreshToken && this.refreshExpiresAt && this.refreshExpiresAt > new Date()
|
|
134
|
+
? yield this.authClient.refreshToken({
|
|
135
|
+
clientId,
|
|
136
|
+
refreshToken: this.storedRefreshToken,
|
|
137
|
+
})
|
|
138
|
+
: yield this.authClient.getToken({ clientId, clientSecret });
|
|
139
|
+
this.accessToken = tokenResponse.accessToken;
|
|
140
|
+
this.expiresAt = (0, oauthAuthHelpers_js_1.getExpiresAt)(tokenResponse.expiresIn, oauthAuthHelpers_js_1.BUFFER_IN_MINUTES);
|
|
141
|
+
if (tokenResponse.refreshToken) {
|
|
142
|
+
this.storedRefreshToken = tokenResponse.refreshToken;
|
|
143
|
+
this.refreshExpiresAt = tokenResponse.refreshExpiresIn
|
|
144
|
+
? (0, oauthAuthHelpers_js_1.getExpiresAt)(tokenResponse.refreshExpiresIn, oauthAuthHelpers_js_1.BUFFER_IN_MINUTES)
|
|
145
|
+
: undefined;
|
|
146
|
+
}
|
|
147
|
+
return this.accessToken;
|
|
148
|
+
}
|
|
149
|
+
finally {
|
|
150
|
+
this.refreshPromise = undefined;
|
|
151
|
+
}
|
|
152
|
+
}))();
|
|
153
|
+
return this.refreshPromise;
|
|
154
|
+
});
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
exports.OAuthAuthProvider = OAuthAuthProvider;
|
|
158
|
+
class OAuthTokenOverrideAuthProvider {
|
|
159
|
+
constructor(options) {
|
|
160
|
+
this._tokenSupplier = options[TOKEN_PARAM];
|
|
161
|
+
this._clientIdSupplier = options.clientId;
|
|
162
|
+
// Patch: store custom refresh callback
|
|
163
|
+
this._refreshAccessToken = options.refreshAccessToken;
|
|
164
|
+
this.expiresAt = options.expiresIn ? (0, oauthAuthHelpers_js_1.getExpiresAt)(options.expiresIn, oauthAuthHelpers_js_1.BUFFER_IN_MINUTES) : undefined;
|
|
165
|
+
this.storedRefreshToken = options.refreshToken;
|
|
166
|
+
this.refreshExpiresAt = options.refreshExpiresIn
|
|
167
|
+
? (0, oauthAuthHelpers_js_1.getExpiresAt)(options.refreshExpiresIn, oauthAuthHelpers_js_1.BUFFER_IN_MINUTES)
|
|
168
|
+
: undefined;
|
|
169
|
+
if (options.clientId && options.refreshToken) {
|
|
170
|
+
this.authClient = new CortiAuth_js_1.CortiAuth(options);
|
|
171
|
+
}
|
|
172
|
+
// Patch: pre-seed token from discovery promise so getAuthRequest doesn't call refreshAccessToken again
|
|
173
|
+
if (options.initialTokenResponse) {
|
|
174
|
+
this._seedPromise = options.initialTokenResponse
|
|
175
|
+
.then((resp) => {
|
|
176
|
+
this.accessToken = resp.accessToken;
|
|
177
|
+
this.expiresAt = resp.expiresIn ? (0, oauthAuthHelpers_js_1.getExpiresAt)(resp.expiresIn, oauthAuthHelpers_js_1.BUFFER_IN_MINUTES) : undefined;
|
|
178
|
+
if (resp.refreshToken) {
|
|
179
|
+
this.storedRefreshToken = resp.refreshToken;
|
|
180
|
+
this.refreshExpiresAt = resp.refreshExpiresIn
|
|
181
|
+
? (0, oauthAuthHelpers_js_1.getExpiresAt)(resp.refreshExpiresIn, oauthAuthHelpers_js_1.BUFFER_IN_MINUTES)
|
|
182
|
+
: undefined;
|
|
183
|
+
}
|
|
184
|
+
})
|
|
185
|
+
.finally(() => {
|
|
186
|
+
this._seedPromise = undefined;
|
|
187
|
+
});
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
static canCreate(options) {
|
|
191
|
+
// Patch: either token or refreshAccessToken is sufficient
|
|
192
|
+
return (options === null || options === void 0 ? void 0 : options[TOKEN_PARAM]) != null || (options === null || options === void 0 ? void 0 : options.refreshAccessToken) != null;
|
|
193
|
+
}
|
|
194
|
+
getAuthRequest() {
|
|
195
|
+
return __awaiter(this, arguments, void 0, function* ({ endpointMetadata, } = {}) {
|
|
196
|
+
// Patch: await seed promise so the initial token from resolveClientOptions is set before checking expiry
|
|
197
|
+
if (this._seedPromise) {
|
|
198
|
+
yield this._seedPromise;
|
|
199
|
+
}
|
|
200
|
+
const isExpiredOrAbsent = !this.accessToken || (this.expiresAt != null && this.expiresAt <= new Date());
|
|
201
|
+
// Patch: custom refreshAccessToken takes priority — call it when token is absent or expired
|
|
202
|
+
if (this._refreshAccessToken && isExpiredOrAbsent) {
|
|
203
|
+
const result = yield this._refreshAccessToken(this.storedRefreshToken);
|
|
204
|
+
this.accessToken = result.accessToken;
|
|
205
|
+
this.expiresAt = result.expiresIn ? (0, oauthAuthHelpers_js_1.getExpiresAt)(result.expiresIn, oauthAuthHelpers_js_1.BUFFER_IN_MINUTES) : undefined;
|
|
206
|
+
if (result.refreshToken) {
|
|
207
|
+
this.storedRefreshToken = result.refreshToken;
|
|
208
|
+
this.refreshExpiresAt = result.refreshExpiresIn
|
|
209
|
+
? (0, oauthAuthHelpers_js_1.getExpiresAt)(result.refreshExpiresIn, oauthAuthHelpers_js_1.BUFFER_IN_MINUTES)
|
|
210
|
+
: undefined;
|
|
211
|
+
}
|
|
212
|
+
return { headers: { Authorization: `Bearer ${this.accessToken}` } };
|
|
213
|
+
}
|
|
214
|
+
// Built-in: if access token is expired and we have a valid SDK refresh token, use it
|
|
215
|
+
if (this.expiresAt != null &&
|
|
216
|
+
this.expiresAt <= new Date() &&
|
|
217
|
+
this._clientIdSupplier &&
|
|
218
|
+
this.storedRefreshToken &&
|
|
219
|
+
this.refreshExpiresAt &&
|
|
220
|
+
this.refreshExpiresAt > new Date() &&
|
|
221
|
+
this.authClient) {
|
|
222
|
+
const clientId = yield core.EndpointSupplier.get(this._clientIdSupplier, { endpointMetadata });
|
|
223
|
+
const tokenResponse = yield this.authClient.refreshToken({
|
|
224
|
+
clientId,
|
|
225
|
+
refreshToken: this.storedRefreshToken,
|
|
226
|
+
});
|
|
227
|
+
this.accessToken = tokenResponse.accessToken;
|
|
228
|
+
this.expiresAt = (0, oauthAuthHelpers_js_1.getExpiresAt)(tokenResponse.expiresIn, oauthAuthHelpers_js_1.BUFFER_IN_MINUTES);
|
|
229
|
+
if (tokenResponse.refreshToken) {
|
|
230
|
+
this.storedRefreshToken = tokenResponse.refreshToken;
|
|
231
|
+
this.refreshExpiresAt = tokenResponse.refreshExpiresIn
|
|
232
|
+
? (0, oauthAuthHelpers_js_1.getExpiresAt)(tokenResponse.refreshExpiresIn, oauthAuthHelpers_js_1.BUFFER_IN_MINUTES)
|
|
233
|
+
: undefined;
|
|
234
|
+
}
|
|
235
|
+
return { headers: { Authorization: `Bearer ${this.accessToken}` } };
|
|
236
|
+
}
|
|
237
|
+
// Token not yet acquired — resolve from supplier (static token / initial value)
|
|
238
|
+
if (!this.accessToken) {
|
|
239
|
+
if (this._tokenSupplier == null) {
|
|
240
|
+
throw new errors.CortiError({ message: TOKEN_PARAM_REQUIRED_ERROR_MESSAGE });
|
|
241
|
+
}
|
|
242
|
+
this.accessToken = yield core.EndpointSupplier.get(this._tokenSupplier, { endpointMetadata });
|
|
243
|
+
}
|
|
244
|
+
if (!this.accessToken) {
|
|
245
|
+
throw new errors.CortiError({ message: TOKEN_PARAM_REQUIRED_ERROR_MESSAGE });
|
|
246
|
+
}
|
|
247
|
+
return { headers: { Authorization: `Bearer ${this.accessToken}` } };
|
|
248
|
+
});
|
|
249
|
+
}
|
|
250
|
+
}
|
|
251
|
+
exports.OAuthTokenOverrideAuthProvider = OAuthTokenOverrideAuthProvider;
|
|
252
|
+
(function (OAuthAuthProvider) {
|
|
253
|
+
OAuthAuthProvider.AUTH_SCHEME = "OAuth";
|
|
254
|
+
/** Patch: Message extended to mention ROPC (clientId, username, password). */
|
|
255
|
+
OAuthAuthProvider.AUTH_CONFIG_ERROR_MESSAGE = `Insufficient options to create OAuthAuthProvider. Please provide '${oauthAuthHelpers_js_1.CLIENT_ID_PARAM}' and '${oauthAuthHelpers_js_1.CLIENT_SECRET_PARAM}', or ${TOKEN_PARAM}, or ROPC (${oauthAuthHelpers_js_1.CLIENT_ID_PARAM}, username, password).`;
|
|
256
|
+
function createInstance(options) {
|
|
257
|
+
if (OAuthTokenOverrideAuthProvider.canCreate(options)) {
|
|
258
|
+
return new OAuthTokenOverrideAuthProvider(options);
|
|
259
|
+
}
|
|
260
|
+
/** Patch: ROPC provider before client credentials so ROPC auth is used when username+password provided. */
|
|
261
|
+
if (OAuthRopcAuthProvider_js_1.OAuthRopcAuthProvider.canCreate(options)) {
|
|
262
|
+
return new OAuthRopcAuthProvider_js_1.OAuthRopcAuthProvider(options);
|
|
263
|
+
}
|
|
264
|
+
/** Patch: PKCE provider before auth code — both have clientId+code+redirectUri, but PKCE has no clientSecret. */
|
|
265
|
+
if (OAuthPkceAuthProvider_js_1.OAuthPkceAuthProvider.canCreate(options)) {
|
|
266
|
+
return new OAuthPkceAuthProvider_js_1.OAuthPkceAuthProvider(options);
|
|
267
|
+
}
|
|
268
|
+
/** Patch: Auth code provider before client credentials — both have clientId+clientSecret, code+redirectUri distinguishes auth code. */
|
|
269
|
+
if (OAuthAuthCodeAuthProvider_js_1.OAuthAuthCodeAuthProvider.canCreate(options)) {
|
|
270
|
+
return new OAuthAuthCodeAuthProvider_js_1.OAuthAuthCodeAuthProvider(options);
|
|
271
|
+
}
|
|
272
|
+
if (OAuthAuthProvider.canCreate(options)) {
|
|
273
|
+
return new OAuthAuthProvider(options);
|
|
274
|
+
}
|
|
275
|
+
/** Patch: No credentials provided — proxy/passthrough mode; requests are sent without an Authorization header. */
|
|
276
|
+
const partialOptions = options;
|
|
277
|
+
const hasNoCredentials = partialOptions[oauthAuthHelpers_js_1.CLIENT_ID_PARAM] == null &&
|
|
278
|
+
partialOptions[oauthAuthHelpers_js_1.CLIENT_SECRET_PARAM] == null &&
|
|
279
|
+
partialOptions[TOKEN_PARAM] == null &&
|
|
280
|
+
partialOptions.refreshAccessToken == null &&
|
|
281
|
+
partialOptions[oauthAuthHelpers_js_1.USERNAME_PARAM] == null;
|
|
282
|
+
if (hasNoCredentials) {
|
|
283
|
+
return new core.NoOpAuthProvider();
|
|
284
|
+
}
|
|
285
|
+
throw new errors.CortiError({
|
|
286
|
+
message: OAuthAuthProvider.AUTH_CONFIG_ERROR_MESSAGE,
|
|
287
|
+
});
|
|
288
|
+
}
|
|
289
|
+
OAuthAuthProvider.createInstance = createInstance;
|
|
290
|
+
})(OAuthAuthProvider || (exports.OAuthAuthProvider = OAuthAuthProvider = {}));
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
import type * as Corti from "../../api/index.js";
|
|
2
|
+
import { AuthClient } from "../../api/resources/auth/client/Client.js";
|
|
3
|
+
import type { OAuthAuthProvider } from "../../auth/OAuthAuthProvider.js";
|
|
4
|
+
import * as core from "../../core/index.js";
|
|
5
|
+
import { type Environment } from "../utils/environment.js";
|
|
6
|
+
interface Options {
|
|
7
|
+
skipRedirect?: boolean;
|
|
8
|
+
}
|
|
9
|
+
export declare namespace CortiAuth {
|
|
10
|
+
/** Auth (clientId/clientSecret or token) is optional; credentials can be passed to getToken() instead. */
|
|
11
|
+
type Options = Omit<AuthClient.Options, "clientId" | "clientSecret" | "token" | "environment"> & Partial<OAuthAuthProvider.ClientCredentials> & Partial<OAuthAuthProvider.TokenOverride> & {
|
|
12
|
+
environment: Environment;
|
|
13
|
+
};
|
|
14
|
+
/** Optional scopes on getToken request. */
|
|
15
|
+
interface GetTokenRequest extends Corti.OAuthTokenRequest {
|
|
16
|
+
scopes?: string[];
|
|
17
|
+
}
|
|
18
|
+
/** ROPC (resource owner password credentials) request for getRopcFlowToken. */
|
|
19
|
+
interface GetRopcFlowTokenRequest {
|
|
20
|
+
clientId: string;
|
|
21
|
+
username: string;
|
|
22
|
+
password: string;
|
|
23
|
+
scopes?: string[];
|
|
24
|
+
}
|
|
25
|
+
/** Refresh token request for refreshToken. */
|
|
26
|
+
interface RefreshTokenRequest {
|
|
27
|
+
clientId: string;
|
|
28
|
+
refreshToken: string;
|
|
29
|
+
clientSecret?: string;
|
|
30
|
+
scopes?: string[];
|
|
31
|
+
}
|
|
32
|
+
/** Authorization code grant request for getCodeFlowToken. */
|
|
33
|
+
interface GetCodeFlowTokenRequest {
|
|
34
|
+
clientId: string;
|
|
35
|
+
clientSecret: string;
|
|
36
|
+
redirectUri: string;
|
|
37
|
+
code: string;
|
|
38
|
+
scopes?: string[];
|
|
39
|
+
}
|
|
40
|
+
/** PKCE grant request for getPkceFlowToken. codeVerifier is optional — if omitted, reads from localStorage. */
|
|
41
|
+
interface GetPkceFlowTokenRequest {
|
|
42
|
+
clientId: string;
|
|
43
|
+
redirectUri: string;
|
|
44
|
+
code: string;
|
|
45
|
+
codeVerifier?: string;
|
|
46
|
+
scopes?: string[];
|
|
47
|
+
}
|
|
48
|
+
/** Parameters for authorizeURL — builds the Keycloak authorization endpoint URL. */
|
|
49
|
+
interface AuthorizationCodeClient {
|
|
50
|
+
clientId: string;
|
|
51
|
+
redirectUri: string;
|
|
52
|
+
codeChallenge?: string;
|
|
53
|
+
scopes?: string[];
|
|
54
|
+
}
|
|
55
|
+
/** Parameters for authorizePkceUrl — like AuthorizationCodeClient but without codeChallenge (generated internally). */
|
|
56
|
+
interface PkceClient {
|
|
57
|
+
clientId: string;
|
|
58
|
+
redirectUri: string;
|
|
59
|
+
scopes?: string[];
|
|
60
|
+
codeVerifier?: string;
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
export declare class CortiAuth extends AuthClient {
|
|
64
|
+
/** No-op auth provider so super.token() does not trigger OAuth refresh. When auth is omitted, a dummy token is passed so the base constructor does not throw. */
|
|
65
|
+
constructor(options: CortiAuth.Options);
|
|
66
|
+
/**
|
|
67
|
+
* Exchange credentials for a short-lived access token using the tenant token endpoint (client_credentials).
|
|
68
|
+
* Resolves tenant from client options. Supports optional scopes (openid is always included).
|
|
69
|
+
*
|
|
70
|
+
* @param request - Client credentials and optional scopes
|
|
71
|
+
* @param requestOptions - Request-specific configuration
|
|
72
|
+
*
|
|
73
|
+
* @throws {@link Corti.BadRequestError}
|
|
74
|
+
* @throws {@link Corti.UnauthorizedError}
|
|
75
|
+
*
|
|
76
|
+
* @example
|
|
77
|
+
* const response = await auth.getToken({
|
|
78
|
+
* clientId: "client_id",
|
|
79
|
+
* clientSecret: "client_secret",
|
|
80
|
+
* scopes: ["profile"]
|
|
81
|
+
* });
|
|
82
|
+
*/
|
|
83
|
+
getToken(request: CortiAuth.GetTokenRequest, requestOptions?: AuthClient.RequestOptions): core.HttpResponsePromise<Corti.AuthTokenResponse>;
|
|
84
|
+
private _getTokenWithTenant;
|
|
85
|
+
/** Exchange username/password for access token via ROPC (resource owner password credentials). */
|
|
86
|
+
getRopcFlowToken(request: CortiAuth.GetRopcFlowTokenRequest, requestOptions?: AuthClient.RequestOptions): core.HttpResponsePromise<Corti.AuthTokenResponse>;
|
|
87
|
+
/**
|
|
88
|
+
* Exchange a refresh token for a new access token (refresh_token grant).
|
|
89
|
+
* Resolves tenant from client options.
|
|
90
|
+
*
|
|
91
|
+
* @param request - Client ID, refresh token, and optional scopes
|
|
92
|
+
* @param requestOptions - Request-specific configuration
|
|
93
|
+
*
|
|
94
|
+
* @throws {@link Corti.BadRequestError}
|
|
95
|
+
* @throws {@link Corti.UnauthorizedError}
|
|
96
|
+
*
|
|
97
|
+
* @example
|
|
98
|
+
* const response = await auth.refreshToken({
|
|
99
|
+
* clientId: "client_id",
|
|
100
|
+
* refreshToken: "refresh_token",
|
|
101
|
+
* });
|
|
102
|
+
*/
|
|
103
|
+
refreshToken(request: CortiAuth.RefreshTokenRequest, requestOptions?: AuthClient.RequestOptions): core.HttpResponsePromise<Corti.AuthTokenResponse>;
|
|
104
|
+
/** Exchange an authorization code for an access token (authorization_code grant). */
|
|
105
|
+
getCodeFlowToken(request: CortiAuth.GetCodeFlowTokenRequest, requestOptions?: AuthClient.RequestOptions): core.HttpResponsePromise<Corti.AuthTokenResponse>;
|
|
106
|
+
/**
|
|
107
|
+
* Exchange a PKCE authorization code for an access token (authorization_code grant with code_verifier).
|
|
108
|
+
* If codeVerifier is omitted, it is read from localStorage (set by authorizePkceUrl).
|
|
109
|
+
*/
|
|
110
|
+
getPkceFlowToken(request: CortiAuth.GetPkceFlowTokenRequest, requestOptions?: AuthClient.RequestOptions): core.HttpResponsePromise<Corti.AuthTokenResponse>;
|
|
111
|
+
/**
|
|
112
|
+
* Build the Keycloak authorization endpoint URL for the PKCE flow.
|
|
113
|
+
* Generates a code verifier if not provided, stores it in localStorage, and computes the challenge.
|
|
114
|
+
* In a browser environment, redirects to the URL unless skipRedirect is true.
|
|
115
|
+
*/
|
|
116
|
+
authorizePkceUrl({ clientId, redirectUri, scopes, codeVerifier }: CortiAuth.PkceClient, options?: Options): Promise<string>;
|
|
117
|
+
/** Read the PKCE code verifier stored in localStorage by authorizePkceUrl. Returns null if not found. */
|
|
118
|
+
static getCodeVerifier(): string | null;
|
|
119
|
+
/**
|
|
120
|
+
* Build the Keycloak authorization endpoint URL for the authorization code flow.
|
|
121
|
+
* In a browser environment, redirects to the URL unless skipRedirect is true.
|
|
122
|
+
* In a server environment (no window), always returns the URL string.
|
|
123
|
+
*
|
|
124
|
+
* @param client - clientId, redirectUri, and optional codeChallenge/scopes
|
|
125
|
+
* @param options - { skipRedirect?: boolean }
|
|
126
|
+
*/
|
|
127
|
+
authorizeURL({ clientId, redirectUri, codeChallenge, scopes }: CortiAuth.AuthorizationCodeClient, options?: Options): Promise<string>;
|
|
128
|
+
}
|
|
129
|
+
export {};
|