@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
package/README.md
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
# Corti
|
|
1
|
+
# Corti JavaScript Library
|
|
2
2
|
|
|
3
3
|
[](https://buildwithfern.com?utm_source=github&utm_medium=github&utm_campaign=readme&utm_source=https%3A%2F%2Fgithub.com%2Fcorticph%2Fcorti-sdk-javascript)
|
|
4
4
|
[](https://www.npmjs.com/package/@corti/sdk)
|
|
5
5
|
|
|
6
|
-
The Corti
|
|
6
|
+
The Corti JavaScript library provides convenient access to the Corti APIs from JavaScript and TypeScript.
|
|
7
7
|
|
|
8
8
|
## Table of Contents
|
|
9
9
|
|
|
10
|
+
- [Documentation](#documentation)
|
|
10
11
|
- [Installation](#installation)
|
|
11
|
-
- [Reference](#reference)
|
|
12
12
|
- [Usage](#usage)
|
|
13
13
|
- [Authentication](#authentication)
|
|
14
14
|
- [Request and Response Types](#request-and-response-types)
|
|
@@ -17,7 +17,6 @@ The Corti TypeScript library provides convenient access to the Corti APIs from T
|
|
|
17
17
|
- [Binary Response](#binary-response)
|
|
18
18
|
- [Pagination](#pagination)
|
|
19
19
|
- [Advanced](#advanced)
|
|
20
|
-
- [Subpackage Exports](#subpackage-exports)
|
|
21
20
|
- [Additional Headers](#additional-headers)
|
|
22
21
|
- [Additional Query String Parameters](#additional-query-string-parameters)
|
|
23
22
|
- [Retries](#retries)
|
|
@@ -28,58 +27,133 @@ The Corti TypeScript library provides convenient access to the Corti APIs from T
|
|
|
28
27
|
- [Runtime Compatibility](#runtime-compatibility)
|
|
29
28
|
- [Contributing](#contributing)
|
|
30
29
|
|
|
30
|
+
## Documentation
|
|
31
|
+
|
|
32
|
+
- [Documentation](https://docs.corti.ai/)
|
|
33
|
+
- [API Reference](https://docs.corti.ai/api-reference)
|
|
34
|
+
- [Console](https://console.corti.app/) — get your credentials here
|
|
35
|
+
- [Examples](https://github.com/corticph/corti-examples)
|
|
36
|
+
|
|
31
37
|
## Installation
|
|
32
38
|
|
|
33
39
|
```sh
|
|
34
40
|
npm i -s @corti/sdk
|
|
35
41
|
```
|
|
36
42
|
|
|
37
|
-
## Reference
|
|
38
|
-
|
|
39
|
-
A full reference for this library is available [here](https://github.com/corticph/corti-sdk-javascript/blob/HEAD/./reference.md).
|
|
40
|
-
|
|
41
43
|
## Usage
|
|
42
44
|
|
|
43
45
|
Instantiate and use the client with the following:
|
|
44
46
|
|
|
45
47
|
```typescript
|
|
46
|
-
import { CortiClient
|
|
48
|
+
import { CortiClient } from "@corti/sdk";
|
|
47
49
|
|
|
48
|
-
const client = new CortiClient({
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
clientSecret: "
|
|
50
|
+
const client = new CortiClient({
|
|
51
|
+
tenantName: "YOUR_TENANT_NAME",
|
|
52
|
+
environment: "YOUR_ENVIRONMENT_ID",
|
|
53
|
+
auth: { clientId: "YOUR_CLIENT_ID", clientSecret: "YOUR_CLIENT_SECRET" },
|
|
54
|
+
});
|
|
55
|
+
await client.interactions.create({
|
|
56
|
+
encounter: {
|
|
57
|
+
identifier: "identifier",
|
|
58
|
+
status: "planned",
|
|
59
|
+
type: "first_consultation"
|
|
60
|
+
}
|
|
52
61
|
});
|
|
53
62
|
```
|
|
54
63
|
|
|
55
64
|
## Authentication
|
|
56
65
|
|
|
57
|
-
The SDK supports OAuth
|
|
66
|
+
The SDK supports several OAuth 2.0 flows. In all cases the SDK manages tokens in memory — before each request it checks whether the stored access token is still valid, and if not, calls the appropriate token endpoint transparently. No manual token management is needed.
|
|
58
67
|
|
|
59
|
-
|
|
68
|
+
### Client Credentials (recommended for server-side apps)
|
|
60
69
|
|
|
61
|
-
|
|
70
|
+
The SDK fetches and refreshes tokens automatically using your client credentials.
|
|
62
71
|
|
|
63
72
|
```typescript
|
|
64
73
|
import { CortiClient } from "@corti/sdk";
|
|
65
74
|
|
|
66
75
|
const client = new CortiClient({
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
76
|
+
tenantName: "YOUR_TENANT_NAME",
|
|
77
|
+
environment: "YOUR_ENVIRONMENT_ID",
|
|
78
|
+
auth: { clientId: "YOUR_CLIENT_ID", clientSecret: "YOUR_CLIENT_SECRET" },
|
|
70
79
|
});
|
|
71
80
|
```
|
|
72
81
|
|
|
73
|
-
|
|
82
|
+
### Bearer token (pre-obtained)
|
|
74
83
|
|
|
75
|
-
Use
|
|
84
|
+
Use when you already have a valid access token. Pass `refreshToken` + `clientId` to enable automatic renewal when the token expires.
|
|
76
85
|
|
|
77
86
|
```typescript
|
|
78
|
-
|
|
87
|
+
// Static token — no automatic renewal
|
|
88
|
+
const client = new CortiClient({
|
|
89
|
+
auth: { accessToken: "YOUR_ACCESS_TOKEN" },
|
|
90
|
+
});
|
|
79
91
|
|
|
92
|
+
// Token with automatic refresh via stored refresh token
|
|
80
93
|
const client = new CortiClient({
|
|
81
|
-
|
|
82
|
-
|
|
94
|
+
auth: {
|
|
95
|
+
accessToken: "YOUR_ACCESS_TOKEN",
|
|
96
|
+
clientId: "YOUR_CLIENT_ID",
|
|
97
|
+
refreshToken: "YOUR_REFRESH_TOKEN",
|
|
98
|
+
expiresIn: 300, // seconds until access token expires
|
|
99
|
+
refreshExpiresIn: 1800, // seconds until refresh token expires
|
|
100
|
+
},
|
|
101
|
+
});
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
### Bearer token with custom refresh
|
|
105
|
+
|
|
106
|
+
Use when your application manages token renewal (e.g. via a proxy or an external identity provider). The SDK calls `refreshAccessToken` whenever the stored token expires.
|
|
107
|
+
|
|
108
|
+
```typescript
|
|
109
|
+
const client = new CortiClient({
|
|
110
|
+
auth: {
|
|
111
|
+
accessToken: "YOUR_ACCESS_TOKEN",
|
|
112
|
+
refreshAccessToken: async (refreshToken) => {
|
|
113
|
+
// call your own token endpoint and return the new token
|
|
114
|
+
return { accessToken: "NEW_TOKEN", expiresIn: 300 };
|
|
115
|
+
},
|
|
116
|
+
},
|
|
117
|
+
});
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
### Resource Owner Password Credentials (ROPC)
|
|
121
|
+
|
|
122
|
+
```typescript
|
|
123
|
+
const client = new CortiClient({
|
|
124
|
+
tenantName: "YOUR_TENANT_NAME",
|
|
125
|
+
environment: "YOUR_ENVIRONMENT_ID",
|
|
126
|
+
auth: { clientId: "YOUR_CLIENT_ID", username: "USERNAME", password: "PASSWORD" },
|
|
127
|
+
});
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
### Authorization Code
|
|
131
|
+
|
|
132
|
+
```typescript
|
|
133
|
+
const client = new CortiClient({
|
|
134
|
+
tenantName: "YOUR_TENANT_NAME",
|
|
135
|
+
environment: "YOUR_ENVIRONMENT_ID",
|
|
136
|
+
auth: {
|
|
137
|
+
clientId: "YOUR_CLIENT_ID",
|
|
138
|
+
clientSecret: "YOUR_CLIENT_SECRET",
|
|
139
|
+
code: "AUTH_CODE",
|
|
140
|
+
redirectUri: "YOUR_REDIRECT_URI",
|
|
141
|
+
},
|
|
142
|
+
});
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
### PKCE
|
|
146
|
+
|
|
147
|
+
```typescript
|
|
148
|
+
const client = new CortiClient({
|
|
149
|
+
tenantName: "YOUR_TENANT_NAME",
|
|
150
|
+
environment: "YOUR_ENVIRONMENT_ID",
|
|
151
|
+
auth: {
|
|
152
|
+
clientId: "YOUR_CLIENT_ID",
|
|
153
|
+
code: "AUTH_CODE",
|
|
154
|
+
redirectUri: "YOUR_REDIRECT_URI",
|
|
155
|
+
codeVerifier: "YOUR_CODE_VERIFIER",
|
|
156
|
+
},
|
|
83
157
|
});
|
|
84
158
|
```
|
|
85
159
|
|
|
@@ -102,16 +176,30 @@ When the API returns a non-success status code (4xx or 5xx response), a subclass
|
|
|
102
176
|
will be thrown.
|
|
103
177
|
|
|
104
178
|
```typescript
|
|
105
|
-
import { CortiError } from "@corti/sdk";
|
|
179
|
+
import { CortiError, CortiSDKError, CortiSDKErrorCodes, ParseError, JsonError } from "@corti/sdk";
|
|
106
180
|
|
|
107
181
|
try {
|
|
108
|
-
await client.
|
|
182
|
+
await client.interactions.create(...);
|
|
109
183
|
} catch (err) {
|
|
110
184
|
if (err instanceof CortiError) {
|
|
185
|
+
// HTTP API error (4xx / 5xx)
|
|
111
186
|
console.log(err.statusCode);
|
|
112
187
|
console.log(err.message);
|
|
113
188
|
console.log(err.body);
|
|
114
189
|
console.log(err.rawResponse);
|
|
190
|
+
} else if (err instanceof CortiSDKError) {
|
|
191
|
+
// SDK infrastructure error (e.g. localStorage unavailable)
|
|
192
|
+
console.log(err.code); // e.g. CortiSDKErrorCodes.LOCAL_STORAGE_ERROR
|
|
193
|
+
console.log(err.message);
|
|
194
|
+
console.log(err.cause); // original Error, if any
|
|
195
|
+
} else if (err instanceof ParseError) {
|
|
196
|
+
// Input validation failed (e.g. missing PKCE verifier, invalid JWT)
|
|
197
|
+
console.log(err.errors); // ValidationError[]
|
|
198
|
+
console.log(err.message);
|
|
199
|
+
} else if (err instanceof JsonError) {
|
|
200
|
+
// Response body could not be parsed as JSON
|
|
201
|
+
console.log(err.errors); // ValidationError[]
|
|
202
|
+
console.log(err.message);
|
|
115
203
|
}
|
|
116
204
|
}
|
|
117
205
|
```
|
|
@@ -555,9 +643,13 @@ const text = new TextDecoder().decode(bytes);
|
|
|
555
643
|
List endpoints are paginated. The SDK provides an iterator so that you can simply loop over the items:
|
|
556
644
|
|
|
557
645
|
```typescript
|
|
558
|
-
import { CortiClient
|
|
646
|
+
import { CortiClient } from "@corti/sdk";
|
|
559
647
|
|
|
560
|
-
const client = new CortiClient({
|
|
648
|
+
const client = new CortiClient({
|
|
649
|
+
tenantName: "YOUR_TENANT_NAME",
|
|
650
|
+
environment: "YOUR_ENVIRONMENT_ID",
|
|
651
|
+
auth: { clientId: "YOUR_CLIENT_ID", clientSecret: "YOUR_CLIENT_SECRET" },
|
|
652
|
+
});
|
|
561
653
|
const pageableResponse = await client.interactions.list();
|
|
562
654
|
for await (const item of pageableResponse) {
|
|
563
655
|
console.log(item);
|
|
@@ -575,16 +667,6 @@ const response = page.response;
|
|
|
575
667
|
|
|
576
668
|
## Advanced
|
|
577
669
|
|
|
578
|
-
### Subpackage Exports
|
|
579
|
-
|
|
580
|
-
This SDK supports direct imports of subpackage clients, which allows JavaScript bundlers to tree-shake and include only the imported subpackage code. This results in much smaller bundle sizes.
|
|
581
|
-
|
|
582
|
-
```typescript
|
|
583
|
-
import { AuthClient } from '@corti/sdk/auth';
|
|
584
|
-
|
|
585
|
-
const client = new AuthClient({...});
|
|
586
|
-
```
|
|
587
|
-
|
|
588
670
|
### Additional Headers
|
|
589
671
|
|
|
590
672
|
If you would like to send additional headers as part of the request, use the `headers` request option.
|
|
@@ -599,7 +681,7 @@ const client = new CortiClient({
|
|
|
599
681
|
}
|
|
600
682
|
});
|
|
601
683
|
|
|
602
|
-
const response = await client.
|
|
684
|
+
const response = await client.interactions.create(..., {
|
|
603
685
|
headers: {
|
|
604
686
|
'X-Custom-Header': 'custom value'
|
|
605
687
|
}
|
|
@@ -611,7 +693,7 @@ const response = await client.auth.getToken(..., {
|
|
|
611
693
|
If you would like to send additional query string parameters as part of the request, use the `queryParams` request option.
|
|
612
694
|
|
|
613
695
|
```typescript
|
|
614
|
-
const response = await client.
|
|
696
|
+
const response = await client.interactions.create(..., {
|
|
615
697
|
queryParams: {
|
|
616
698
|
'customQueryParamKey': 'custom query param value'
|
|
617
699
|
}
|
|
@@ -633,7 +715,7 @@ A request is deemed retryable when any of the following HTTP status codes is ret
|
|
|
633
715
|
Use the `maxRetries` request option to configure this behavior.
|
|
634
716
|
|
|
635
717
|
```typescript
|
|
636
|
-
const response = await client.
|
|
718
|
+
const response = await client.interactions.create(..., {
|
|
637
719
|
maxRetries: 0 // override maxRetries at the request level
|
|
638
720
|
});
|
|
639
721
|
```
|
|
@@ -643,7 +725,7 @@ const response = await client.auth.getToken(..., {
|
|
|
643
725
|
The SDK defaults to a 60 second timeout. Use the `timeoutInSeconds` option to configure this behavior.
|
|
644
726
|
|
|
645
727
|
```typescript
|
|
646
|
-
const response = await client.
|
|
728
|
+
const response = await client.interactions.create(..., {
|
|
647
729
|
timeoutInSeconds: 30 // override timeout to 30s
|
|
648
730
|
});
|
|
649
731
|
```
|
|
@@ -654,7 +736,7 @@ The SDK allows users to abort requests at any point by passing in an abort signa
|
|
|
654
736
|
|
|
655
737
|
```typescript
|
|
656
738
|
const controller = new AbortController();
|
|
657
|
-
const response = await client.
|
|
739
|
+
const response = await client.interactions.create(..., {
|
|
658
740
|
abortSignal: controller.signal
|
|
659
741
|
});
|
|
660
742
|
controller.abort(); // aborts the request
|
|
@@ -666,7 +748,7 @@ The SDK provides access to raw response data, including headers, through the `.w
|
|
|
666
748
|
The `.withRawResponse()` method returns a promise that results to an object with a `data` and a `rawResponse` property.
|
|
667
749
|
|
|
668
750
|
```typescript
|
|
669
|
-
const { data, rawResponse } = await client.
|
|
751
|
+
const { data, rawResponse } = await client.interactions.create(...).withRawResponse();
|
|
670
752
|
|
|
671
753
|
console.log(data);
|
|
672
754
|
console.log(rawResponse.headers['X-My-Header']);
|
package/dist/cjs/BaseClient.js
CHANGED
|
@@ -43,8 +43,8 @@ function normalizeClientOptions(options) {
|
|
|
43
43
|
const headers = (0, headers_js_1.mergeHeaders)({
|
|
44
44
|
"X-Fern-Language": "JavaScript",
|
|
45
45
|
"X-Fern-SDK-Name": "@corti/sdk",
|
|
46
|
-
"X-Fern-SDK-Version": "1.0.0-alpha",
|
|
47
|
-
"User-Agent": "@corti/sdk/1.0.0-alpha",
|
|
46
|
+
"X-Fern-SDK-Version": "1.0.0-alpha.1",
|
|
47
|
+
"User-Agent": "@corti/sdk/1.0.0-alpha.1",
|
|
48
48
|
"X-Fern-Runtime": core.RUNTIME.type,
|
|
49
49
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
50
50
|
"Tenant-Name": options === null || options === void 0 ? void 0 : options.tenantName,
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import type * as core from "../../core/index.js";
|
|
2
2
|
import * as errors from "../../errors/index.js";
|
|
3
|
-
import type * as Corti from "../index.js";
|
|
4
3
|
export declare class ForbiddenError extends errors.CortiError {
|
|
5
|
-
constructor(body
|
|
4
|
+
constructor(body?: unknown, rawResponse?: core.RawResponse);
|
|
6
5
|
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type * as core from "../../core/index.js";
|
|
2
|
+
import * as errors from "../../errors/index.js";
|
|
3
|
+
import type * as Corti from "../index.js";
|
|
4
|
+
export declare class UnprocessableEntityError extends errors.CortiError {
|
|
5
|
+
constructor(body: Corti.AgentsValidationErrorResponse, rawResponse?: core.RawResponse);
|
|
6
|
+
}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
4
|
+
if (k2 === undefined) k2 = k;
|
|
5
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
6
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
7
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
8
|
+
}
|
|
9
|
+
Object.defineProperty(o, k2, desc);
|
|
10
|
+
}) : (function(o, m, k, k2) {
|
|
11
|
+
if (k2 === undefined) k2 = k;
|
|
12
|
+
o[k2] = m[k];
|
|
13
|
+
}));
|
|
14
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
15
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
16
|
+
}) : function(o, v) {
|
|
17
|
+
o["default"] = v;
|
|
18
|
+
});
|
|
19
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
20
|
+
var ownKeys = function(o) {
|
|
21
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
22
|
+
var ar = [];
|
|
23
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
24
|
+
return ar;
|
|
25
|
+
};
|
|
26
|
+
return ownKeys(o);
|
|
27
|
+
};
|
|
28
|
+
return function (mod) {
|
|
29
|
+
if (mod && mod.__esModule) return mod;
|
|
30
|
+
var result = {};
|
|
31
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
32
|
+
__setModuleDefault(result, mod);
|
|
33
|
+
return result;
|
|
34
|
+
};
|
|
35
|
+
})();
|
|
36
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
37
|
+
exports.UnprocessableEntityError = void 0;
|
|
38
|
+
const errors = __importStar(require("../../errors/index.js"));
|
|
39
|
+
class UnprocessableEntityError extends errors.CortiError {
|
|
40
|
+
constructor(body, rawResponse) {
|
|
41
|
+
super({
|
|
42
|
+
message: "UnprocessableEntityError",
|
|
43
|
+
statusCode: 422,
|
|
44
|
+
body: body,
|
|
45
|
+
rawResponse: rawResponse,
|
|
46
|
+
});
|
|
47
|
+
Object.setPrototypeOf(this, new.target.prototype);
|
|
48
|
+
if (Error.captureStackTrace) {
|
|
49
|
+
Error.captureStackTrace(this, this.constructor);
|
|
50
|
+
}
|
|
51
|
+
this.name = this.constructor.name;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
exports.UnprocessableEntityError = UnprocessableEntityError;
|
|
@@ -21,3 +21,4 @@ __exportStar(require("./GatewayTimeoutError.js"), exports);
|
|
|
21
21
|
__exportStar(require("./InternalServerError.js"), exports);
|
|
22
22
|
__exportStar(require("./NotFoundError.js"), exports);
|
|
23
23
|
__exportStar(require("./UnauthorizedError.js"), exports);
|
|
24
|
+
__exportStar(require("./UnprocessableEntityError.js"), exports);
|
|
@@ -32,6 +32,7 @@ export declare class AgentsClient {
|
|
|
32
32
|
*
|
|
33
33
|
* @throws {@link Corti.BadRequestError}
|
|
34
34
|
* @throws {@link Corti.UnauthorizedError}
|
|
35
|
+
* @throws {@link Corti.UnprocessableEntityError}
|
|
35
36
|
*
|
|
36
37
|
* @example
|
|
37
38
|
* await client.agents.create({
|
|
@@ -81,6 +82,7 @@ export declare class AgentsClient {
|
|
|
81
82
|
* @throws {@link Corti.BadRequestError}
|
|
82
83
|
* @throws {@link Corti.UnauthorizedError}
|
|
83
84
|
* @throws {@link Corti.NotFoundError}
|
|
85
|
+
* @throws {@link Corti.UnprocessableEntityError}
|
|
84
86
|
*
|
|
85
87
|
* @example
|
|
86
88
|
* await client.agents.update("12345678-90ab-cdef-gh12-34567890abc")
|
|
@@ -111,7 +113,9 @@ export declare class AgentsClient {
|
|
|
111
113
|
*
|
|
112
114
|
* @throws {@link Corti.BadRequestError}
|
|
113
115
|
* @throws {@link Corti.UnauthorizedError}
|
|
116
|
+
* @throws {@link Corti.ForbiddenError}
|
|
114
117
|
* @throws {@link Corti.NotFoundError}
|
|
118
|
+
* @throws {@link Corti.UnprocessableEntityError}
|
|
115
119
|
*
|
|
116
120
|
* @example
|
|
117
121
|
* await client.agents.messageSend("12345678-90ab-cdef-gh12-34567890abc", {
|
|
@@ -138,6 +142,7 @@ export declare class AgentsClient {
|
|
|
138
142
|
*
|
|
139
143
|
* @throws {@link Corti.BadRequestError}
|
|
140
144
|
* @throws {@link Corti.UnauthorizedError}
|
|
145
|
+
* @throws {@link Corti.ForbiddenError}
|
|
141
146
|
* @throws {@link Corti.NotFoundError}
|
|
142
147
|
*
|
|
143
148
|
* @example
|
|
@@ -170,6 +175,7 @@ export declare class AgentsClient {
|
|
|
170
175
|
*
|
|
171
176
|
* @throws {@link Corti.BadRequestError}
|
|
172
177
|
* @throws {@link Corti.UnauthorizedError}
|
|
178
|
+
* @throws {@link Corti.UnprocessableEntityError}
|
|
173
179
|
*
|
|
174
180
|
* @example
|
|
175
181
|
* await client.agents.getRegistryExperts({
|
|
@@ -140,6 +140,7 @@ class AgentsClient {
|
|
|
140
140
|
*
|
|
141
141
|
* @throws {@link Corti.BadRequestError}
|
|
142
142
|
* @throws {@link Corti.UnauthorizedError}
|
|
143
|
+
* @throws {@link Corti.UnprocessableEntityError}
|
|
143
144
|
*
|
|
144
145
|
* @example
|
|
145
146
|
* await client.agents.create({
|
|
@@ -194,6 +195,14 @@ class AgentsClient {
|
|
|
194
195
|
throw new Corti.BadRequestError(_response.error.body, _response.rawResponse);
|
|
195
196
|
case 401:
|
|
196
197
|
throw new Corti.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
198
|
+
case 422:
|
|
199
|
+
throw new Corti.UnprocessableEntityError(serializers.AgentsValidationErrorResponse.parseOrThrow(_response.error.body, {
|
|
200
|
+
unrecognizedObjectKeys: "passthrough",
|
|
201
|
+
allowUnrecognizedUnionMembers: true,
|
|
202
|
+
allowUnrecognizedEnumValues: true,
|
|
203
|
+
skipValidation: true,
|
|
204
|
+
breadcrumbsPrefix: ["response"],
|
|
205
|
+
}), _response.rawResponse);
|
|
197
206
|
default:
|
|
198
207
|
throw new errors.CortiError({
|
|
199
208
|
statusCode: _response.error.statusCode,
|
|
@@ -332,6 +341,7 @@ class AgentsClient {
|
|
|
332
341
|
* @throws {@link Corti.BadRequestError}
|
|
333
342
|
* @throws {@link Corti.UnauthorizedError}
|
|
334
343
|
* @throws {@link Corti.NotFoundError}
|
|
344
|
+
* @throws {@link Corti.UnprocessableEntityError}
|
|
335
345
|
*
|
|
336
346
|
* @example
|
|
337
347
|
* await client.agents.update("12345678-90ab-cdef-gh12-34567890abc")
|
|
@@ -381,6 +391,14 @@ class AgentsClient {
|
|
|
381
391
|
throw new Corti.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
382
392
|
case 404:
|
|
383
393
|
throw new Corti.NotFoundError(_response.error.body, _response.rawResponse);
|
|
394
|
+
case 422:
|
|
395
|
+
throw new Corti.UnprocessableEntityError(serializers.AgentsValidationErrorResponse.parseOrThrow(_response.error.body, {
|
|
396
|
+
unrecognizedObjectKeys: "passthrough",
|
|
397
|
+
allowUnrecognizedUnionMembers: true,
|
|
398
|
+
allowUnrecognizedEnumValues: true,
|
|
399
|
+
skipValidation: true,
|
|
400
|
+
breadcrumbsPrefix: ["response"],
|
|
401
|
+
}), _response.rawResponse);
|
|
384
402
|
default:
|
|
385
403
|
throw new errors.CortiError({
|
|
386
404
|
statusCode: _response.error.statusCode,
|
|
@@ -464,7 +482,9 @@ class AgentsClient {
|
|
|
464
482
|
*
|
|
465
483
|
* @throws {@link Corti.BadRequestError}
|
|
466
484
|
* @throws {@link Corti.UnauthorizedError}
|
|
485
|
+
* @throws {@link Corti.ForbiddenError}
|
|
467
486
|
* @throws {@link Corti.NotFoundError}
|
|
487
|
+
* @throws {@link Corti.UnprocessableEntityError}
|
|
468
488
|
*
|
|
469
489
|
* @example
|
|
470
490
|
* await client.agents.messageSend("12345678-90ab-cdef-gh12-34567890abc", {
|
|
@@ -522,8 +542,18 @@ class AgentsClient {
|
|
|
522
542
|
throw new Corti.BadRequestError(_response.error.body, _response.rawResponse);
|
|
523
543
|
case 401:
|
|
524
544
|
throw new Corti.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
545
|
+
case 403:
|
|
546
|
+
throw new Corti.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
525
547
|
case 404:
|
|
526
548
|
throw new Corti.NotFoundError(_response.error.body, _response.rawResponse);
|
|
549
|
+
case 422:
|
|
550
|
+
throw new Corti.UnprocessableEntityError(serializers.AgentsValidationErrorResponse.parseOrThrow(_response.error.body, {
|
|
551
|
+
unrecognizedObjectKeys: "passthrough",
|
|
552
|
+
allowUnrecognizedUnionMembers: true,
|
|
553
|
+
allowUnrecognizedEnumValues: true,
|
|
554
|
+
skipValidation: true,
|
|
555
|
+
breadcrumbsPrefix: ["response"],
|
|
556
|
+
}), _response.rawResponse);
|
|
527
557
|
default:
|
|
528
558
|
throw new errors.CortiError({
|
|
529
559
|
statusCode: _response.error.statusCode,
|
|
@@ -545,6 +575,7 @@ class AgentsClient {
|
|
|
545
575
|
*
|
|
546
576
|
* @throws {@link Corti.BadRequestError}
|
|
547
577
|
* @throws {@link Corti.UnauthorizedError}
|
|
578
|
+
* @throws {@link Corti.ForbiddenError}
|
|
548
579
|
* @throws {@link Corti.NotFoundError}
|
|
549
580
|
*
|
|
550
581
|
* @example
|
|
@@ -591,6 +622,8 @@ class AgentsClient {
|
|
|
591
622
|
throw new Corti.BadRequestError(_response.error.body, _response.rawResponse);
|
|
592
623
|
case 401:
|
|
593
624
|
throw new Corti.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
625
|
+
case 403:
|
|
626
|
+
throw new Corti.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
594
627
|
case 404:
|
|
595
628
|
throw new Corti.NotFoundError(_response.error.body, _response.rawResponse);
|
|
596
629
|
default:
|
|
@@ -682,6 +715,7 @@ class AgentsClient {
|
|
|
682
715
|
*
|
|
683
716
|
* @throws {@link Corti.BadRequestError}
|
|
684
717
|
* @throws {@link Corti.UnauthorizedError}
|
|
718
|
+
* @throws {@link Corti.UnprocessableEntityError}
|
|
685
719
|
*
|
|
686
720
|
* @example
|
|
687
721
|
* await client.agents.getRegistryExperts({
|
|
@@ -731,6 +765,14 @@ class AgentsClient {
|
|
|
731
765
|
throw new Corti.BadRequestError(_response.error.body, _response.rawResponse);
|
|
732
766
|
case 401:
|
|
733
767
|
throw new Corti.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
768
|
+
case 422:
|
|
769
|
+
throw new Corti.UnprocessableEntityError(serializers.AgentsValidationErrorResponse.parseOrThrow(_response.error.body, {
|
|
770
|
+
unrecognizedObjectKeys: "passthrough",
|
|
771
|
+
allowUnrecognizedUnionMembers: true,
|
|
772
|
+
allowUnrecognizedEnumValues: true,
|
|
773
|
+
skipValidation: true,
|
|
774
|
+
breadcrumbsPrefix: ["response"],
|
|
775
|
+
}), _response.rawResponse);
|
|
734
776
|
default:
|
|
735
777
|
throw new errors.CortiError({
|
|
736
778
|
statusCode: _response.error.statusCode,
|
|
@@ -11,7 +11,7 @@ export declare class CodesClient {
|
|
|
11
11
|
protected readonly _options: NormalizedClientOptionsWithAuth<CodesClient.Options>;
|
|
12
12
|
constructor(options: CodesClient.Options);
|
|
13
13
|
/**
|
|
14
|
-
* Predict medical codes from provided context.<br/><Note>This is a stateless endpoint, designed to predict ICD-10-CM, ICD-10-PCS, and CPT codes based on input text string or documentId.<br/><br/>More than one code system may be defined in a single request
|
|
14
|
+
* Predict medical codes from provided context.<br/><Note>This is a stateless endpoint, designed to predict ICD-10-CM, ICD-10-PCS, and CPT codes based on input text string or documentId.<br/><br/>More than one code system may be defined in a single request.<br/><br/>Code prediction requests have two possible values for context:<br/>- `text`: One set of code prediction results will be returned based on all input text defined.<br/>- `documentId`: Code prediction will be based on that defined document only.<br/><br/>The response includes two sets of results:<br/>- `Codes`: Codes predicted by the model.<br/>- `Candidates`: Lower-confidence codes the model considered potentially relevant but excluded from the predicted set.<br/><br/>All predicted code results are based on input context defined in the request only (not other external data or assets associated with an interaction).</Note>
|
|
15
15
|
*
|
|
16
16
|
* @param {Corti.CodesGeneralPredictRequest} request
|
|
17
17
|
* @param {CodesClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
@@ -24,12 +24,24 @@ export declare class CodesClient {
|
|
|
24
24
|
*
|
|
25
25
|
* @example
|
|
26
26
|
* await client.codes.predict({
|
|
27
|
-
* system: ["icd10cm", "cpt"],
|
|
27
|
+
* system: ["icd10cm-outpatient", "cpt"],
|
|
28
28
|
* context: [{
|
|
29
29
|
* type: "text",
|
|
30
30
|
* text: "Short arm splint applied in ED for pain control."
|
|
31
|
+
* }]
|
|
32
|
+
* })
|
|
33
|
+
*
|
|
34
|
+
* @example
|
|
35
|
+
* await client.codes.predict({
|
|
36
|
+
* system: ["icd10cm-outpatient"],
|
|
37
|
+
* context: [{
|
|
38
|
+
* type: "text",
|
|
39
|
+
* text: "Patient presents with uncontrolled type 2 diabetes."
|
|
31
40
|
* }],
|
|
32
|
-
*
|
|
41
|
+
* filter: {
|
|
42
|
+
* include: ["E11"],
|
|
43
|
+
* exclude: ["exclude"]
|
|
44
|
+
* }
|
|
33
45
|
* })
|
|
34
46
|
*/
|
|
35
47
|
predict(request: Corti.CodesGeneralPredictRequest, requestOptions?: CodesClient.RequestOptions): core.HttpResponsePromise<Corti.CodesGeneralResponse>;
|
|
@@ -56,7 +56,7 @@ class CodesClient {
|
|
|
56
56
|
this._options = (0, BaseClient_js_1.normalizeClientOptionsWithAuth)(options);
|
|
57
57
|
}
|
|
58
58
|
/**
|
|
59
|
-
* Predict medical codes from provided context.<br/><Note>This is a stateless endpoint, designed to predict ICD-10-CM, ICD-10-PCS, and CPT codes based on input text string or documentId.<br/><br/>More than one code system may be defined in a single request
|
|
59
|
+
* Predict medical codes from provided context.<br/><Note>This is a stateless endpoint, designed to predict ICD-10-CM, ICD-10-PCS, and CPT codes based on input text string or documentId.<br/><br/>More than one code system may be defined in a single request.<br/><br/>Code prediction requests have two possible values for context:<br/>- `text`: One set of code prediction results will be returned based on all input text defined.<br/>- `documentId`: Code prediction will be based on that defined document only.<br/><br/>The response includes two sets of results:<br/>- `Codes`: Codes predicted by the model.<br/>- `Candidates`: Lower-confidence codes the model considered potentially relevant but excluded from the predicted set.<br/><br/>All predicted code results are based on input context defined in the request only (not other external data or assets associated with an interaction).</Note>
|
|
60
60
|
*
|
|
61
61
|
* @param {Corti.CodesGeneralPredictRequest} request
|
|
62
62
|
* @param {CodesClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
@@ -69,12 +69,24 @@ class CodesClient {
|
|
|
69
69
|
*
|
|
70
70
|
* @example
|
|
71
71
|
* await client.codes.predict({
|
|
72
|
-
* system: ["icd10cm", "cpt"],
|
|
72
|
+
* system: ["icd10cm-outpatient", "cpt"],
|
|
73
73
|
* context: [{
|
|
74
74
|
* type: "text",
|
|
75
75
|
* text: "Short arm splint applied in ED for pain control."
|
|
76
|
+
* }]
|
|
77
|
+
* })
|
|
78
|
+
*
|
|
79
|
+
* @example
|
|
80
|
+
* await client.codes.predict({
|
|
81
|
+
* system: ["icd10cm-outpatient"],
|
|
82
|
+
* context: [{
|
|
83
|
+
* type: "text",
|
|
84
|
+
* text: "Patient presents with uncontrolled type 2 diabetes."
|
|
76
85
|
* }],
|
|
77
|
-
*
|
|
86
|
+
* filter: {
|
|
87
|
+
* include: ["E11"],
|
|
88
|
+
* exclude: ["exclude"]
|
|
89
|
+
* }
|
|
78
90
|
* })
|
|
79
91
|
*/
|
|
80
92
|
predict(request, requestOptions) {
|
|
@@ -119,13 +131,7 @@ class CodesClient {
|
|
|
119
131
|
case 400:
|
|
120
132
|
throw new Corti.BadRequestError(_response.error.body, _response.rawResponse);
|
|
121
133
|
case 403:
|
|
122
|
-
throw new Corti.ForbiddenError(
|
|
123
|
-
unrecognizedObjectKeys: "passthrough",
|
|
124
|
-
allowUnrecognizedUnionMembers: true,
|
|
125
|
-
allowUnrecognizedEnumValues: true,
|
|
126
|
-
skipValidation: true,
|
|
127
|
-
breadcrumbsPrefix: ["response"],
|
|
128
|
-
}), _response.rawResponse);
|
|
134
|
+
throw new Corti.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
129
135
|
case 500:
|
|
130
136
|
throw new Corti.InternalServerError(serializers.ErrorResponse.parseOrThrow(_response.error.body, {
|
|
131
137
|
unrecognizedObjectKeys: "passthrough",
|