sarvamai 0.0.2
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/Client.d.ts +45 -0
- package/Client.js +37 -0
- package/README.md +159 -0
- package/api/errors/BadRequestError.d.ts +7 -0
- package/api/errors/BadRequestError.js +51 -0
- package/api/errors/ForbiddenError.d.ts +8 -0
- package/api/errors/ForbiddenError.js +51 -0
- package/api/errors/InternalServerError.d.ts +7 -0
- package/api/errors/InternalServerError.js +51 -0
- package/api/errors/ServiceUnavailableError.d.ts +8 -0
- package/api/errors/ServiceUnavailableError.js +51 -0
- package/api/errors/TooManyRequestsError.d.ts +8 -0
- package/api/errors/TooManyRequestsError.js +51 -0
- package/api/errors/UnprocessableEntityError.d.ts +7 -0
- package/api/errors/UnprocessableEntityError.js +51 -0
- package/api/errors/index.d.ts +6 -0
- package/api/errors/index.js +22 -0
- package/api/index.d.ts +3 -0
- package/api/index.js +19 -0
- package/api/resources/analytics/client/Client.d.ts +73 -0
- package/api/resources/analytics/client/Client.js +223 -0
- package/api/resources/analytics/client/index.d.ts +1 -0
- package/api/resources/analytics/client/index.js +17 -0
- package/api/resources/analytics/client/requests/CallAnalyticsRequest.d.ts +24 -0
- package/api/resources/analytics/client/requests/CallAnalyticsRequest.js +5 -0
- package/api/resources/analytics/client/requests/index.d.ts +1 -0
- package/api/resources/analytics/client/requests/index.js +2 -0
- package/api/resources/analytics/index.d.ts +1 -0
- package/api/resources/analytics/index.js +17 -0
- package/api/resources/index.d.ts +10 -0
- package/api/resources/index.js +49 -0
- package/api/resources/pdf/client/Client.d.ts +63 -0
- package/api/resources/pdf/client/Client.js +215 -0
- package/api/resources/pdf/client/index.d.ts +1 -0
- package/api/resources/pdf/client/index.js +17 -0
- package/api/resources/pdf/client/requests/ParsePdfRequest.d.ts +21 -0
- package/api/resources/pdf/client/requests/ParsePdfRequest.js +5 -0
- package/api/resources/pdf/client/requests/TranslatePdfRequest.d.ts +32 -0
- package/api/resources/pdf/client/requests/TranslatePdfRequest.js +5 -0
- package/api/resources/pdf/client/requests/index.d.ts +2 -0
- package/api/resources/pdf/client/requests/index.js +2 -0
- package/api/resources/pdf/index.d.ts +1 -0
- package/api/resources/pdf/index.js +17 -0
- package/api/resources/speechToText/client/Client.d.ts +93 -0
- package/api/resources/speechToText/client/Client.js +263 -0
- package/api/resources/speechToText/client/index.d.ts +1 -0
- package/api/resources/speechToText/client/index.js +17 -0
- package/api/resources/speechToText/client/requests/SpeechToTextTranscriptionRequest.d.ts +33 -0
- package/api/resources/speechToText/client/requests/SpeechToTextTranscriptionRequest.js +5 -0
- package/api/resources/speechToText/client/requests/SpeechToTextTranslationRequest.d.ts +22 -0
- package/api/resources/speechToText/client/requests/SpeechToTextTranslationRequest.js +5 -0
- package/api/resources/speechToText/client/requests/index.d.ts +2 -0
- package/api/resources/speechToText/client/requests/index.js +2 -0
- package/api/resources/speechToText/index.d.ts +1 -0
- package/api/resources/speechToText/index.js +17 -0
- package/api/resources/text/client/Client.d.ts +127 -0
- package/api/resources/text/client/Client.js +314 -0
- package/api/resources/text/client/index.d.ts +1 -0
- package/api/resources/text/client/index.js +17 -0
- package/api/resources/text/client/requests/LanguageIdentificationRequest.d.ts +13 -0
- package/api/resources/text/client/requests/LanguageIdentificationRequest.js +5 -0
- package/api/resources/text/client/requests/TranslationRequest.d.ts +77 -0
- package/api/resources/text/client/requests/TranslationRequest.js +5 -0
- package/api/resources/text/client/requests/TransliterationRequest.d.ts +68 -0
- package/api/resources/text/client/requests/TransliterationRequest.js +5 -0
- package/api/resources/text/client/requests/index.d.ts +3 -0
- package/api/resources/text/client/requests/index.js +2 -0
- package/api/resources/text/index.d.ts +1 -0
- package/api/resources/text/index.js +17 -0
- package/api/resources/textToSpeech/client/Client.d.ts +51 -0
- package/api/resources/textToSpeech/client/Client.js +134 -0
- package/api/resources/textToSpeech/client/index.d.ts +1 -0
- package/api/resources/textToSpeech/client/index.js +17 -0
- package/api/resources/textToSpeech/client/requests/TextToSpeechRequest.d.ts +35 -0
- package/api/resources/textToSpeech/client/requests/TextToSpeechRequest.js +5 -0
- package/api/resources/textToSpeech/client/requests/index.d.ts +1 -0
- package/api/resources/textToSpeech/client/requests/index.js +2 -0
- package/api/resources/textToSpeech/index.d.ts +1 -0
- package/api/resources/textToSpeech/index.js +17 -0
- package/api/types/CallAnalyticsJobParameters.d.ts +21 -0
- package/api/types/CallAnalyticsJobParameters.js +5 -0
- package/api/types/CallAnalyticsJobRequest.d.ts +10 -0
- package/api/types/CallAnalyticsJobRequest.js +5 -0
- package/api/types/CallAnalyticsResponse.d.ts +19 -0
- package/api/types/CallAnalyticsResponse.js +5 -0
- package/api/types/DiarizedEntry.d.ts +13 -0
- package/api/types/DiarizedEntry.js +5 -0
- package/api/types/DiarizedTranscript.d.ts +8 -0
- package/api/types/DiarizedTranscript.js +5 -0
- package/api/types/ErrorCode.d.ts +16 -0
- package/api/types/ErrorCode.js +18 -0
- package/api/types/ErrorDetails.d.ts +10 -0
- package/api/types/ErrorDetails.js +5 -0
- package/api/types/ErrorMessage.d.ts +8 -0
- package/api/types/ErrorMessage.js +5 -0
- package/api/types/Language.d.ts +17 -0
- package/api/types/Language.js +19 -0
- package/api/types/LanguageIdentificationResponse.d.ts +39 -0
- package/api/types/LanguageIdentificationResponse.js +5 -0
- package/api/types/NumeralsFormat.d.ts +8 -0
- package/api/types/NumeralsFormat.js +10 -0
- package/api/types/ParsedPageResponse.d.ts +7 -0
- package/api/types/ParsedPageResponse.js +5 -0
- package/api/types/PromptCaching.d.ts +8 -0
- package/api/types/PromptCaching.js +10 -0
- package/api/types/QnaResponse.d.ts +15 -0
- package/api/types/QnaResponse.js +5 -0
- package/api/types/Question.d.ts +23 -0
- package/api/types/Question.js +5 -0
- package/api/types/QuestionType.d.ts +11 -0
- package/api/types/QuestionType.js +13 -0
- package/api/types/SarvamMode.d.ts +8 -0
- package/api/types/SarvamMode.js +10 -0
- package/api/types/SpeechSampleRate.d.ts +4 -0
- package/api/types/SpeechSampleRate.js +5 -0
- package/api/types/SpeechToTextLanguage.d.ts +18 -0
- package/api/types/SpeechToTextLanguage.js +20 -0
- package/api/types/SpeechToTextModel.d.ts +9 -0
- package/api/types/SpeechToTextModel.js +11 -0
- package/api/types/SpeechToTextResponse.d.ts +15 -0
- package/api/types/SpeechToTextResponse.js +5 -0
- package/api/types/SpeechToTextTranslateLanguage.d.ts +17 -0
- package/api/types/SpeechToTextTranslateLanguage.js +19 -0
- package/api/types/SpeechToTextTranslateModel.d.ts +10 -0
- package/api/types/SpeechToTextTranslateModel.js +12 -0
- package/api/types/SpeechToTextTranslateResponse.d.ts +13 -0
- package/api/types/SpeechToTextTranslateResponse.js +5 -0
- package/api/types/SpokenFormNumeralsFormat.d.ts +8 -0
- package/api/types/SpokenFormNumeralsFormat.js +10 -0
- package/api/types/TextAnalyticsRequest.d.ts +9 -0
- package/api/types/TextAnalyticsRequest.js +5 -0
- package/api/types/TextAnalyticsResponse.d.ts +9 -0
- package/api/types/TextAnalyticsResponse.js +5 -0
- package/api/types/TextToSpeechLanguage.d.ts +17 -0
- package/api/types/TextToSpeechLanguage.js +19 -0
- package/api/types/TextToSpeechModel.d.ts +4 -0
- package/api/types/TextToSpeechModel.js +5 -0
- package/api/types/TextToSpeechResponse.d.ts +8 -0
- package/api/types/TextToSpeechResponse.js +5 -0
- package/api/types/TextToSpeechSpeaker.d.ts +18 -0
- package/api/types/TextToSpeechSpeaker.js +20 -0
- package/api/types/TimestampsModel.d.ts +11 -0
- package/api/types/TimestampsModel.js +5 -0
- package/api/types/TranslateMode.d.ts +10 -0
- package/api/types/TranslateMode.js +12 -0
- package/api/types/TranslateModel.d.ts +4 -0
- package/api/types/TranslateModel.js +5 -0
- package/api/types/TranslatePostprocessing.d.ts +9 -0
- package/api/types/TranslatePostprocessing.js +11 -0
- package/api/types/TranslateSourceLanguage.d.ts +18 -0
- package/api/types/TranslateSourceLanguage.js +20 -0
- package/api/types/TranslateSpeakerGender.d.ts +8 -0
- package/api/types/TranslateSpeakerGender.js +10 -0
- package/api/types/TranslateTargetLanguage.d.ts +17 -0
- package/api/types/TranslateTargetLanguage.js +19 -0
- package/api/types/TranslatedPage.d.ts +7 -0
- package/api/types/TranslatedPage.js +5 -0
- package/api/types/TranslationResponse.d.ts +10 -0
- package/api/types/TranslationResponse.js +5 -0
- package/api/types/TranslatiterateTargetLanguage.d.ts +17 -0
- package/api/types/TranslatiterateTargetLanguage.js +19 -0
- package/api/types/TransliterateSourceLanguage.d.ts +18 -0
- package/api/types/TransliterateSourceLanguage.js +20 -0
- package/api/types/TransliterationResponse.d.ts +10 -0
- package/api/types/TransliterationResponse.js +5 -0
- package/api/types/index.d.ts +43 -0
- package/api/types/index.js +59 -0
- package/core/fetcher/APIResponse.d.ts +10 -0
- package/core/fetcher/APIResponse.js +2 -0
- package/core/fetcher/Fetcher.d.ts +39 -0
- package/core/fetcher/Fetcher.js +100 -0
- package/core/fetcher/Supplier.d.ts +4 -0
- package/core/fetcher/Supplier.js +22 -0
- package/core/fetcher/createRequestUrl.d.ts +1 -0
- package/core/fetcher/createRequestUrl.js +12 -0
- package/core/fetcher/getFetchFn.d.ts +4 -0
- package/core/fetcher/getFetchFn.js +68 -0
- package/core/fetcher/getHeader.d.ts +1 -0
- package/core/fetcher/getHeader.js +11 -0
- package/core/fetcher/getRequestBody.d.ts +7 -0
- package/core/fetcher/getRequestBody.js +23 -0
- package/core/fetcher/getResponseBody.d.ts +1 -0
- package/core/fetcher/getResponseBody.js +54 -0
- package/core/fetcher/index.d.ts +5 -0
- package/core/fetcher/index.js +9 -0
- package/core/fetcher/makeRequest.d.ts +1 -0
- package/core/fetcher/makeRequest.js +42 -0
- package/core/fetcher/requestWithRetries.d.ts +1 -0
- package/core/fetcher/requestWithRetries.js +40 -0
- package/core/fetcher/signals.d.ts +11 -0
- package/core/fetcher/signals.js +36 -0
- package/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.d.ts +30 -0
- package/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.js +247 -0
- package/core/fetcher/stream-wrappers/NodePre18StreamWrapper.d.ts +21 -0
- package/core/fetcher/stream-wrappers/NodePre18StreamWrapper.js +126 -0
- package/core/fetcher/stream-wrappers/UndiciStreamWrapper.d.ts +31 -0
- package/core/fetcher/stream-wrappers/UndiciStreamWrapper.js +229 -0
- package/core/fetcher/stream-wrappers/chooseStreamWrapper.d.ts +18 -0
- package/core/fetcher/stream-wrappers/chooseStreamWrapper.js +59 -0
- package/core/form-data-utils/FormDataWrapper.d.ts +60 -0
- package/core/form-data-utils/FormDataWrapper.js +188 -0
- package/core/form-data-utils/encodeAsFormParameter.d.ts +4 -0
- package/core/form-data-utils/encodeAsFormParameter.js +18 -0
- package/core/form-data-utils/index.d.ts +2 -0
- package/core/form-data-utils/index.js +20 -0
- package/core/index.d.ts +3 -0
- package/core/index.js +19 -0
- package/core/json.d.ts +15 -0
- package/core/json.js +24 -0
- package/core/runtime/index.d.ts +1 -0
- package/core/runtime/index.js +5 -0
- package/core/runtime/runtime.d.ts +9 -0
- package/core/runtime/runtime.js +103 -0
- package/dist/Client.d.ts +45 -0
- package/dist/Client.js +37 -0
- package/dist/api/errors/BadRequestError.d.ts +7 -0
- package/dist/api/errors/BadRequestError.js +51 -0
- package/dist/api/errors/ForbiddenError.d.ts +8 -0
- package/dist/api/errors/ForbiddenError.js +51 -0
- package/dist/api/errors/InternalServerError.d.ts +7 -0
- package/dist/api/errors/InternalServerError.js +51 -0
- package/dist/api/errors/ServiceUnavailableError.d.ts +8 -0
- package/dist/api/errors/ServiceUnavailableError.js +51 -0
- package/dist/api/errors/TooManyRequestsError.d.ts +8 -0
- package/dist/api/errors/TooManyRequestsError.js +51 -0
- package/dist/api/errors/UnprocessableEntityError.d.ts +7 -0
- package/dist/api/errors/UnprocessableEntityError.js +51 -0
- package/dist/api/errors/index.d.ts +6 -0
- package/dist/api/errors/index.js +22 -0
- package/dist/api/index.d.ts +3 -0
- package/dist/api/index.js +19 -0
- package/dist/api/resources/analytics/client/Client.d.ts +73 -0
- package/dist/api/resources/analytics/client/Client.js +223 -0
- package/dist/api/resources/analytics/client/index.d.ts +1 -0
- package/dist/api/resources/analytics/client/index.js +17 -0
- package/dist/api/resources/analytics/client/requests/CallAnalyticsRequest.d.ts +24 -0
- package/dist/api/resources/analytics/client/requests/CallAnalyticsRequest.js +5 -0
- package/dist/api/resources/analytics/client/requests/index.d.ts +1 -0
- package/dist/api/resources/analytics/client/requests/index.js +2 -0
- package/dist/api/resources/analytics/index.d.ts +1 -0
- package/dist/api/resources/analytics/index.js +17 -0
- package/dist/api/resources/index.d.ts +10 -0
- package/dist/api/resources/index.js +49 -0
- package/dist/api/resources/pdf/client/Client.d.ts +63 -0
- package/dist/api/resources/pdf/client/Client.js +215 -0
- package/dist/api/resources/pdf/client/index.d.ts +1 -0
- package/dist/api/resources/pdf/client/index.js +17 -0
- package/dist/api/resources/pdf/client/requests/ParsePdfRequest.d.ts +21 -0
- package/dist/api/resources/pdf/client/requests/ParsePdfRequest.js +5 -0
- package/dist/api/resources/pdf/client/requests/TranslatePdfRequest.d.ts +32 -0
- package/dist/api/resources/pdf/client/requests/TranslatePdfRequest.js +5 -0
- package/dist/api/resources/pdf/client/requests/index.d.ts +2 -0
- package/dist/api/resources/pdf/client/requests/index.js +2 -0
- package/dist/api/resources/pdf/index.d.ts +1 -0
- package/dist/api/resources/pdf/index.js +17 -0
- package/dist/api/resources/speechToText/client/Client.d.ts +93 -0
- package/dist/api/resources/speechToText/client/Client.js +263 -0
- package/dist/api/resources/speechToText/client/index.d.ts +1 -0
- package/dist/api/resources/speechToText/client/index.js +17 -0
- package/dist/api/resources/speechToText/client/requests/SpeechToTextTranscriptionRequest.d.ts +33 -0
- package/dist/api/resources/speechToText/client/requests/SpeechToTextTranscriptionRequest.js +5 -0
- package/dist/api/resources/speechToText/client/requests/SpeechToTextTranslationRequest.d.ts +22 -0
- package/dist/api/resources/speechToText/client/requests/SpeechToTextTranslationRequest.js +5 -0
- package/dist/api/resources/speechToText/client/requests/index.d.ts +2 -0
- package/dist/api/resources/speechToText/client/requests/index.js +2 -0
- package/dist/api/resources/speechToText/index.d.ts +1 -0
- package/dist/api/resources/speechToText/index.js +17 -0
- package/dist/api/resources/text/client/Client.d.ts +127 -0
- package/dist/api/resources/text/client/Client.js +314 -0
- package/dist/api/resources/text/client/index.d.ts +1 -0
- package/dist/api/resources/text/client/index.js +17 -0
- package/dist/api/resources/text/client/requests/LanguageIdentificationRequest.d.ts +13 -0
- package/dist/api/resources/text/client/requests/LanguageIdentificationRequest.js +5 -0
- package/dist/api/resources/text/client/requests/TranslationRequest.d.ts +77 -0
- package/dist/api/resources/text/client/requests/TranslationRequest.js +5 -0
- package/dist/api/resources/text/client/requests/TransliterationRequest.d.ts +68 -0
- package/dist/api/resources/text/client/requests/TransliterationRequest.js +5 -0
- package/dist/api/resources/text/client/requests/index.d.ts +3 -0
- package/dist/api/resources/text/client/requests/index.js +2 -0
- package/dist/api/resources/text/index.d.ts +1 -0
- package/dist/api/resources/text/index.js +17 -0
- package/dist/api/resources/textToSpeech/client/Client.d.ts +51 -0
- package/dist/api/resources/textToSpeech/client/Client.js +134 -0
- package/dist/api/resources/textToSpeech/client/index.d.ts +1 -0
- package/dist/api/resources/textToSpeech/client/index.js +17 -0
- package/dist/api/resources/textToSpeech/client/requests/TextToSpeechRequest.d.ts +35 -0
- package/dist/api/resources/textToSpeech/client/requests/TextToSpeechRequest.js +5 -0
- package/dist/api/resources/textToSpeech/client/requests/index.d.ts +1 -0
- package/dist/api/resources/textToSpeech/client/requests/index.js +2 -0
- package/dist/api/resources/textToSpeech/index.d.ts +1 -0
- package/dist/api/resources/textToSpeech/index.js +17 -0
- package/dist/api/types/CallAnalyticsJobParameters.d.ts +21 -0
- package/dist/api/types/CallAnalyticsJobParameters.js +5 -0
- package/dist/api/types/CallAnalyticsJobRequest.d.ts +10 -0
- package/dist/api/types/CallAnalyticsJobRequest.js +5 -0
- package/dist/api/types/CallAnalyticsResponse.d.ts +19 -0
- package/dist/api/types/CallAnalyticsResponse.js +5 -0
- package/dist/api/types/DiarizedEntry.d.ts +13 -0
- package/dist/api/types/DiarizedEntry.js +5 -0
- package/dist/api/types/DiarizedTranscript.d.ts +8 -0
- package/dist/api/types/DiarizedTranscript.js +5 -0
- package/dist/api/types/ErrorCode.d.ts +16 -0
- package/dist/api/types/ErrorCode.js +18 -0
- package/dist/api/types/ErrorDetails.d.ts +10 -0
- package/dist/api/types/ErrorDetails.js +5 -0
- package/dist/api/types/ErrorMessage.d.ts +8 -0
- package/dist/api/types/ErrorMessage.js +5 -0
- package/dist/api/types/Language.d.ts +17 -0
- package/dist/api/types/Language.js +19 -0
- package/dist/api/types/LanguageIdentificationResponse.d.ts +39 -0
- package/dist/api/types/LanguageIdentificationResponse.js +5 -0
- package/dist/api/types/NumeralsFormat.d.ts +8 -0
- package/dist/api/types/NumeralsFormat.js +10 -0
- package/dist/api/types/ParsedPageResponse.d.ts +7 -0
- package/dist/api/types/ParsedPageResponse.js +5 -0
- package/dist/api/types/PromptCaching.d.ts +8 -0
- package/dist/api/types/PromptCaching.js +10 -0
- package/dist/api/types/QnaResponse.d.ts +15 -0
- package/dist/api/types/QnaResponse.js +5 -0
- package/dist/api/types/Question.d.ts +23 -0
- package/dist/api/types/Question.js +5 -0
- package/dist/api/types/QuestionType.d.ts +11 -0
- package/dist/api/types/QuestionType.js +13 -0
- package/dist/api/types/SarvamMode.d.ts +8 -0
- package/dist/api/types/SarvamMode.js +10 -0
- package/dist/api/types/SpeechSampleRate.d.ts +4 -0
- package/dist/api/types/SpeechSampleRate.js +5 -0
- package/dist/api/types/SpeechToTextLanguage.d.ts +18 -0
- package/dist/api/types/SpeechToTextLanguage.js +20 -0
- package/dist/api/types/SpeechToTextModel.d.ts +9 -0
- package/dist/api/types/SpeechToTextModel.js +11 -0
- package/dist/api/types/SpeechToTextResponse.d.ts +15 -0
- package/dist/api/types/SpeechToTextResponse.js +5 -0
- package/dist/api/types/SpeechToTextTranslateLanguage.d.ts +17 -0
- package/dist/api/types/SpeechToTextTranslateLanguage.js +19 -0
- package/dist/api/types/SpeechToTextTranslateModel.d.ts +10 -0
- package/dist/api/types/SpeechToTextTranslateModel.js +12 -0
- package/dist/api/types/SpeechToTextTranslateResponse.d.ts +13 -0
- package/dist/api/types/SpeechToTextTranslateResponse.js +5 -0
- package/dist/api/types/SpokenFormNumeralsFormat.d.ts +8 -0
- package/dist/api/types/SpokenFormNumeralsFormat.js +10 -0
- package/dist/api/types/TextAnalyticsRequest.d.ts +9 -0
- package/dist/api/types/TextAnalyticsRequest.js +5 -0
- package/dist/api/types/TextAnalyticsResponse.d.ts +9 -0
- package/dist/api/types/TextAnalyticsResponse.js +5 -0
- package/dist/api/types/TextToSpeechLanguage.d.ts +17 -0
- package/dist/api/types/TextToSpeechLanguage.js +19 -0
- package/dist/api/types/TextToSpeechModel.d.ts +4 -0
- package/dist/api/types/TextToSpeechModel.js +5 -0
- package/dist/api/types/TextToSpeechResponse.d.ts +8 -0
- package/dist/api/types/TextToSpeechResponse.js +5 -0
- package/dist/api/types/TextToSpeechSpeaker.d.ts +18 -0
- package/dist/api/types/TextToSpeechSpeaker.js +20 -0
- package/dist/api/types/TimestampsModel.d.ts +11 -0
- package/dist/api/types/TimestampsModel.js +5 -0
- package/dist/api/types/TranslateMode.d.ts +10 -0
- package/dist/api/types/TranslateMode.js +12 -0
- package/dist/api/types/TranslateModel.d.ts +4 -0
- package/dist/api/types/TranslateModel.js +5 -0
- package/dist/api/types/TranslatePostprocessing.d.ts +9 -0
- package/dist/api/types/TranslatePostprocessing.js +11 -0
- package/dist/api/types/TranslateSourceLanguage.d.ts +18 -0
- package/dist/api/types/TranslateSourceLanguage.js +20 -0
- package/dist/api/types/TranslateSpeakerGender.d.ts +8 -0
- package/dist/api/types/TranslateSpeakerGender.js +10 -0
- package/dist/api/types/TranslateTargetLanguage.d.ts +17 -0
- package/dist/api/types/TranslateTargetLanguage.js +19 -0
- package/dist/api/types/TranslatedPage.d.ts +7 -0
- package/dist/api/types/TranslatedPage.js +5 -0
- package/dist/api/types/TranslationResponse.d.ts +10 -0
- package/dist/api/types/TranslationResponse.js +5 -0
- package/dist/api/types/TranslatiterateTargetLanguage.d.ts +17 -0
- package/dist/api/types/TranslatiterateTargetLanguage.js +19 -0
- package/dist/api/types/TransliterateSourceLanguage.d.ts +18 -0
- package/dist/api/types/TransliterateSourceLanguage.js +20 -0
- package/dist/api/types/TransliterationResponse.d.ts +10 -0
- package/dist/api/types/TransliterationResponse.js +5 -0
- package/dist/api/types/index.d.ts +43 -0
- package/dist/api/types/index.js +59 -0
- package/dist/core/fetcher/APIResponse.d.ts +10 -0
- package/dist/core/fetcher/APIResponse.js +2 -0
- package/dist/core/fetcher/Fetcher.d.ts +39 -0
- package/dist/core/fetcher/Fetcher.js +100 -0
- package/dist/core/fetcher/Supplier.d.ts +4 -0
- package/dist/core/fetcher/Supplier.js +22 -0
- package/dist/core/fetcher/createRequestUrl.d.ts +1 -0
- package/dist/core/fetcher/createRequestUrl.js +12 -0
- package/dist/core/fetcher/getFetchFn.d.ts +4 -0
- package/dist/core/fetcher/getFetchFn.js +68 -0
- package/dist/core/fetcher/getHeader.d.ts +1 -0
- package/dist/core/fetcher/getHeader.js +11 -0
- package/dist/core/fetcher/getRequestBody.d.ts +7 -0
- package/dist/core/fetcher/getRequestBody.js +23 -0
- package/dist/core/fetcher/getResponseBody.d.ts +1 -0
- package/dist/core/fetcher/getResponseBody.js +54 -0
- package/dist/core/fetcher/index.d.ts +5 -0
- package/dist/core/fetcher/index.js +9 -0
- package/dist/core/fetcher/makeRequest.d.ts +1 -0
- package/dist/core/fetcher/makeRequest.js +42 -0
- package/dist/core/fetcher/requestWithRetries.d.ts +1 -0
- package/dist/core/fetcher/requestWithRetries.js +40 -0
- package/dist/core/fetcher/signals.d.ts +11 -0
- package/dist/core/fetcher/signals.js +36 -0
- package/dist/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.d.ts +30 -0
- package/dist/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.js +247 -0
- package/dist/core/fetcher/stream-wrappers/NodePre18StreamWrapper.d.ts +21 -0
- package/dist/core/fetcher/stream-wrappers/NodePre18StreamWrapper.js +126 -0
- package/dist/core/fetcher/stream-wrappers/UndiciStreamWrapper.d.ts +31 -0
- package/dist/core/fetcher/stream-wrappers/UndiciStreamWrapper.js +229 -0
- package/dist/core/fetcher/stream-wrappers/chooseStreamWrapper.d.ts +18 -0
- package/dist/core/fetcher/stream-wrappers/chooseStreamWrapper.js +59 -0
- package/dist/core/form-data-utils/FormDataWrapper.d.ts +60 -0
- package/dist/core/form-data-utils/FormDataWrapper.js +188 -0
- package/dist/core/form-data-utils/encodeAsFormParameter.d.ts +4 -0
- package/dist/core/form-data-utils/encodeAsFormParameter.js +18 -0
- package/dist/core/form-data-utils/index.d.ts +2 -0
- package/dist/core/form-data-utils/index.js +20 -0
- package/dist/core/index.d.ts +3 -0
- package/dist/core/index.js +19 -0
- package/dist/core/json.d.ts +15 -0
- package/dist/core/json.js +24 -0
- package/dist/core/runtime/index.d.ts +1 -0
- package/dist/core/runtime/index.js +5 -0
- package/dist/core/runtime/runtime.d.ts +9 -0
- package/dist/core/runtime/runtime.js +103 -0
- package/dist/environments.d.ts +8 -0
- package/dist/environments.js +10 -0
- package/dist/errors/SarvamError.d.ts +12 -0
- package/dist/errors/SarvamError.js +33 -0
- package/dist/errors/SarvamTimeoutError.d.ts +6 -0
- package/dist/errors/SarvamTimeoutError.js +13 -0
- package/dist/errors/index.d.ts +2 -0
- package/dist/errors/index.js +7 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.js +44 -0
- package/dist/version.d.ts +1 -0
- package/dist/version.js +4 -0
- package/environments.d.ts +8 -0
- package/environments.js +10 -0
- package/errors/SarvamError.d.ts +12 -0
- package/errors/SarvamError.js +33 -0
- package/errors/SarvamTimeoutError.d.ts +6 -0
- package/errors/SarvamTimeoutError.js +13 -0
- package/errors/index.d.ts +2 -0
- package/errors/index.js +7 -0
- package/index.d.ts +4 -0
- package/index.js +44 -0
- package/jest.config.mjs +8 -0
- package/package.json +43 -0
- package/reference.md +768 -0
- package/scripts/rename-to-esm-files.js +115 -0
- package/version.d.ts +1 -0
- package/version.js +4 -0
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A constant that indicates which environment and version the SDK is running in.
|
|
3
|
+
*/
|
|
4
|
+
export declare const RUNTIME: Runtime;
|
|
5
|
+
export interface Runtime {
|
|
6
|
+
type: "browser" | "web-worker" | "deno" | "bun" | "node" | "react-native" | "unknown" | "workerd" | "edge-runtime";
|
|
7
|
+
version?: string;
|
|
8
|
+
parsedVersion?: number;
|
|
9
|
+
}
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.RUNTIME = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* A constant that indicates which environment and version the SDK is running in.
|
|
6
|
+
*/
|
|
7
|
+
exports.RUNTIME = evaluateRuntime();
|
|
8
|
+
function evaluateRuntime() {
|
|
9
|
+
var _a, _b, _c, _d, _e;
|
|
10
|
+
/**
|
|
11
|
+
* A constant that indicates whether the environment the code is running is a Web Browser.
|
|
12
|
+
*/
|
|
13
|
+
const isBrowser = typeof window !== "undefined" && typeof window.document !== "undefined";
|
|
14
|
+
if (isBrowser) {
|
|
15
|
+
return {
|
|
16
|
+
type: "browser",
|
|
17
|
+
version: window.navigator.userAgent,
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* A constant that indicates whether the environment the code is running is Cloudflare.
|
|
22
|
+
* https://developers.cloudflare.com/workers/runtime-apis/web-standards/#navigatoruseragent
|
|
23
|
+
*/
|
|
24
|
+
const isCloudflare = typeof globalThis !== "undefined" && ((_a = globalThis === null || globalThis === void 0 ? void 0 : globalThis.navigator) === null || _a === void 0 ? void 0 : _a.userAgent) === "Cloudflare-Workers";
|
|
25
|
+
if (isCloudflare) {
|
|
26
|
+
return {
|
|
27
|
+
type: "workerd",
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* A constant that indicates whether the environment the code is running is Edge Runtime.
|
|
32
|
+
* https://vercel.com/docs/functions/runtimes/edge-runtime#check-if-you're-running-on-the-edge-runtime
|
|
33
|
+
*/
|
|
34
|
+
const isEdgeRuntime = typeof EdgeRuntime === "string";
|
|
35
|
+
if (isEdgeRuntime) {
|
|
36
|
+
return {
|
|
37
|
+
type: "edge-runtime",
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* A constant that indicates whether the environment the code is running is a Web Worker.
|
|
42
|
+
*/
|
|
43
|
+
const isWebWorker = typeof self === "object" &&
|
|
44
|
+
// @ts-ignore
|
|
45
|
+
typeof (self === null || self === void 0 ? void 0 : self.importScripts) === "function" &&
|
|
46
|
+
(((_b = self.constructor) === null || _b === void 0 ? void 0 : _b.name) === "DedicatedWorkerGlobalScope" ||
|
|
47
|
+
((_c = self.constructor) === null || _c === void 0 ? void 0 : _c.name) === "ServiceWorkerGlobalScope" ||
|
|
48
|
+
((_d = self.constructor) === null || _d === void 0 ? void 0 : _d.name) === "SharedWorkerGlobalScope");
|
|
49
|
+
if (isWebWorker) {
|
|
50
|
+
return {
|
|
51
|
+
type: "web-worker",
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* A constant that indicates whether the environment the code is running is Deno.
|
|
56
|
+
* FYI Deno spoofs process.versions.node, see https://deno.land/std@0.177.0/node/process.ts?s=versions
|
|
57
|
+
*/
|
|
58
|
+
const isDeno = typeof Deno !== "undefined" && typeof Deno.version !== "undefined" && typeof Deno.version.deno !== "undefined";
|
|
59
|
+
if (isDeno) {
|
|
60
|
+
return {
|
|
61
|
+
type: "deno",
|
|
62
|
+
version: Deno.version.deno,
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* A constant that indicates whether the environment the code is running is Bun.sh.
|
|
67
|
+
*/
|
|
68
|
+
const isBun = typeof Bun !== "undefined" && typeof Bun.version !== "undefined";
|
|
69
|
+
if (isBun) {
|
|
70
|
+
return {
|
|
71
|
+
type: "bun",
|
|
72
|
+
version: Bun.version,
|
|
73
|
+
};
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* A constant that indicates whether the environment the code is running is Node.JS.
|
|
77
|
+
*/
|
|
78
|
+
const isNode = typeof process !== "undefined" &&
|
|
79
|
+
"version" in process &&
|
|
80
|
+
!!process.version &&
|
|
81
|
+
"versions" in process &&
|
|
82
|
+
!!((_e = process.versions) === null || _e === void 0 ? void 0 : _e.node);
|
|
83
|
+
if (isNode) {
|
|
84
|
+
return {
|
|
85
|
+
type: "node",
|
|
86
|
+
version: process.versions.node,
|
|
87
|
+
parsedVersion: Number(process.versions.node.split(".")[0]),
|
|
88
|
+
};
|
|
89
|
+
}
|
|
90
|
+
/**
|
|
91
|
+
* A constant that indicates whether the environment the code is running is in React-Native.
|
|
92
|
+
* https://github.com/facebook/react-native/blob/main/packages/react-native/Libraries/Core/setUpNavigator.js
|
|
93
|
+
*/
|
|
94
|
+
const isReactNative = typeof navigator !== "undefined" && (navigator === null || navigator === void 0 ? void 0 : navigator.product) === "ReactNative";
|
|
95
|
+
if (isReactNative) {
|
|
96
|
+
return {
|
|
97
|
+
type: "react-native",
|
|
98
|
+
};
|
|
99
|
+
}
|
|
100
|
+
return {
|
|
101
|
+
type: "unknown",
|
|
102
|
+
};
|
|
103
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
*/
|
|
4
|
+
export declare const SarvamEnvironment: {
|
|
5
|
+
readonly Production: "https://api.sarvam.ai";
|
|
6
|
+
readonly Staging: "https://api-staging.sarvam.ai";
|
|
7
|
+
};
|
|
8
|
+
export type SarvamEnvironment = typeof SarvamEnvironment.Production | typeof SarvamEnvironment.Staging;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* This file was auto-generated by Fern from our API Definition.
|
|
4
|
+
*/
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.SarvamEnvironment = void 0;
|
|
7
|
+
exports.SarvamEnvironment = {
|
|
8
|
+
Production: "https://api.sarvam.ai",
|
|
9
|
+
Staging: "https://api-staging.sarvam.ai",
|
|
10
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
*/
|
|
4
|
+
export declare class SarvamError extends Error {
|
|
5
|
+
readonly statusCode?: number;
|
|
6
|
+
readonly body?: unknown;
|
|
7
|
+
constructor({ message, statusCode, body }: {
|
|
8
|
+
message?: string;
|
|
9
|
+
statusCode?: number;
|
|
10
|
+
body?: unknown;
|
|
11
|
+
});
|
|
12
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* This file was auto-generated by Fern from our API Definition.
|
|
4
|
+
*/
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.SarvamError = void 0;
|
|
7
|
+
const json_1 = require("../core/json");
|
|
8
|
+
class SarvamError extends Error {
|
|
9
|
+
constructor({ message, statusCode, body }) {
|
|
10
|
+
super(buildMessage({ message, statusCode, body }));
|
|
11
|
+
Object.setPrototypeOf(this, SarvamError.prototype);
|
|
12
|
+
if (statusCode != null) {
|
|
13
|
+
this.statusCode = statusCode;
|
|
14
|
+
}
|
|
15
|
+
if (body !== undefined) {
|
|
16
|
+
this.body = body;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
exports.SarvamError = SarvamError;
|
|
21
|
+
function buildMessage({ message, statusCode, body, }) {
|
|
22
|
+
let lines = [];
|
|
23
|
+
if (message != null) {
|
|
24
|
+
lines.push(message);
|
|
25
|
+
}
|
|
26
|
+
if (statusCode != null) {
|
|
27
|
+
lines.push(`Status code: ${statusCode.toString()}`);
|
|
28
|
+
}
|
|
29
|
+
if (body != null) {
|
|
30
|
+
lines.push(`Body: ${(0, json_1.toJson)(body, undefined, 2)}`);
|
|
31
|
+
}
|
|
32
|
+
return lines.join("\n");
|
|
33
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* This file was auto-generated by Fern from our API Definition.
|
|
4
|
+
*/
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.SarvamTimeoutError = void 0;
|
|
7
|
+
class SarvamTimeoutError extends Error {
|
|
8
|
+
constructor(message) {
|
|
9
|
+
super(message);
|
|
10
|
+
Object.setPrototypeOf(this, SarvamTimeoutError.prototype);
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
exports.SarvamTimeoutError = SarvamTimeoutError;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SarvamTimeoutError = exports.SarvamError = void 0;
|
|
4
|
+
var SarvamError_1 = require("./SarvamError");
|
|
5
|
+
Object.defineProperty(exports, "SarvamError", { enumerable: true, get: function () { return SarvamError_1.SarvamError; } });
|
|
6
|
+
var SarvamTimeoutError_1 = require("./SarvamTimeoutError");
|
|
7
|
+
Object.defineProperty(exports, "SarvamTimeoutError", { enumerable: true, get: function () { return SarvamTimeoutError_1.SarvamTimeoutError; } });
|
package/dist/index.d.ts
ADDED
package/dist/index.js
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.SarvamTimeoutError = exports.SarvamError = exports.SarvamEnvironment = exports.SarvamClient = exports.Sarvam = void 0;
|
|
37
|
+
exports.Sarvam = __importStar(require("./api"));
|
|
38
|
+
var Client_1 = require("./Client");
|
|
39
|
+
Object.defineProperty(exports, "SarvamClient", { enumerable: true, get: function () { return Client_1.SarvamClient; } });
|
|
40
|
+
var environments_1 = require("./environments");
|
|
41
|
+
Object.defineProperty(exports, "SarvamEnvironment", { enumerable: true, get: function () { return environments_1.SarvamEnvironment; } });
|
|
42
|
+
var errors_1 = require("./errors");
|
|
43
|
+
Object.defineProperty(exports, "SarvamError", { enumerable: true, get: function () { return errors_1.SarvamError; } });
|
|
44
|
+
Object.defineProperty(exports, "SarvamTimeoutError", { enumerable: true, get: function () { return errors_1.SarvamTimeoutError; } });
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const SDK_VERSION = "0.0.2";
|
package/dist/version.js
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
*/
|
|
4
|
+
export declare const SarvamEnvironment: {
|
|
5
|
+
readonly Production: "https://api.sarvam.ai";
|
|
6
|
+
readonly Staging: "https://api-staging.sarvam.ai";
|
|
7
|
+
};
|
|
8
|
+
export type SarvamEnvironment = typeof SarvamEnvironment.Production | typeof SarvamEnvironment.Staging;
|
package/environments.js
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* This file was auto-generated by Fern from our API Definition.
|
|
4
|
+
*/
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.SarvamEnvironment = void 0;
|
|
7
|
+
exports.SarvamEnvironment = {
|
|
8
|
+
Production: "https://api.sarvam.ai",
|
|
9
|
+
Staging: "https://api-staging.sarvam.ai",
|
|
10
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
*/
|
|
4
|
+
export declare class SarvamError extends Error {
|
|
5
|
+
readonly statusCode?: number;
|
|
6
|
+
readonly body?: unknown;
|
|
7
|
+
constructor({ message, statusCode, body }: {
|
|
8
|
+
message?: string;
|
|
9
|
+
statusCode?: number;
|
|
10
|
+
body?: unknown;
|
|
11
|
+
});
|
|
12
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* This file was auto-generated by Fern from our API Definition.
|
|
4
|
+
*/
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.SarvamError = void 0;
|
|
7
|
+
const json_1 = require("../core/json");
|
|
8
|
+
class SarvamError extends Error {
|
|
9
|
+
constructor({ message, statusCode, body }) {
|
|
10
|
+
super(buildMessage({ message, statusCode, body }));
|
|
11
|
+
Object.setPrototypeOf(this, SarvamError.prototype);
|
|
12
|
+
if (statusCode != null) {
|
|
13
|
+
this.statusCode = statusCode;
|
|
14
|
+
}
|
|
15
|
+
if (body !== undefined) {
|
|
16
|
+
this.body = body;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
exports.SarvamError = SarvamError;
|
|
21
|
+
function buildMessage({ message, statusCode, body, }) {
|
|
22
|
+
let lines = [];
|
|
23
|
+
if (message != null) {
|
|
24
|
+
lines.push(message);
|
|
25
|
+
}
|
|
26
|
+
if (statusCode != null) {
|
|
27
|
+
lines.push(`Status code: ${statusCode.toString()}`);
|
|
28
|
+
}
|
|
29
|
+
if (body != null) {
|
|
30
|
+
lines.push(`Body: ${(0, json_1.toJson)(body, undefined, 2)}`);
|
|
31
|
+
}
|
|
32
|
+
return lines.join("\n");
|
|
33
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* This file was auto-generated by Fern from our API Definition.
|
|
4
|
+
*/
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.SarvamTimeoutError = void 0;
|
|
7
|
+
class SarvamTimeoutError extends Error {
|
|
8
|
+
constructor(message) {
|
|
9
|
+
super(message);
|
|
10
|
+
Object.setPrototypeOf(this, SarvamTimeoutError.prototype);
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
exports.SarvamTimeoutError = SarvamTimeoutError;
|
package/errors/index.js
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SarvamTimeoutError = exports.SarvamError = void 0;
|
|
4
|
+
var SarvamError_1 = require("./SarvamError");
|
|
5
|
+
Object.defineProperty(exports, "SarvamError", { enumerable: true, get: function () { return SarvamError_1.SarvamError; } });
|
|
6
|
+
var SarvamTimeoutError_1 = require("./SarvamTimeoutError");
|
|
7
|
+
Object.defineProperty(exports, "SarvamTimeoutError", { enumerable: true, get: function () { return SarvamTimeoutError_1.SarvamTimeoutError; } });
|
package/index.d.ts
ADDED
package/index.js
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.SarvamTimeoutError = exports.SarvamError = exports.SarvamEnvironment = exports.SarvamClient = exports.Sarvam = void 0;
|
|
37
|
+
exports.Sarvam = __importStar(require("./api"));
|
|
38
|
+
var Client_1 = require("./Client");
|
|
39
|
+
Object.defineProperty(exports, "SarvamClient", { enumerable: true, get: function () { return Client_1.SarvamClient; } });
|
|
40
|
+
var environments_1 = require("./environments");
|
|
41
|
+
Object.defineProperty(exports, "SarvamEnvironment", { enumerable: true, get: function () { return environments_1.SarvamEnvironment; } });
|
|
42
|
+
var errors_1 = require("./errors");
|
|
43
|
+
Object.defineProperty(exports, "SarvamError", { enumerable: true, get: function () { return errors_1.SarvamError; } });
|
|
44
|
+
Object.defineProperty(exports, "SarvamTimeoutError", { enumerable: true, get: function () { return errors_1.SarvamTimeoutError; } });
|
package/jest.config.mjs
ADDED
package/package.json
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "sarvamai",
|
|
3
|
+
"version": "0.0.2",
|
|
4
|
+
"private": false,
|
|
5
|
+
"repository": "https://github.com/sarvamai/sarvam-javascript-sdk",
|
|
6
|
+
"main": "./index.js",
|
|
7
|
+
"types": "./index.d.ts",
|
|
8
|
+
"scripts": {
|
|
9
|
+
"format": "prettier . --write --ignore-unknown",
|
|
10
|
+
"build": "tsc",
|
|
11
|
+
"prepack": "cp -rv dist/. .",
|
|
12
|
+
"test": "jest"
|
|
13
|
+
},
|
|
14
|
+
"dependencies": {
|
|
15
|
+
"url-join": "4.0.1",
|
|
16
|
+
"form-data": "^4.0.0",
|
|
17
|
+
"formdata-node": "^6.0.3",
|
|
18
|
+
"node-fetch": "^2.7.0",
|
|
19
|
+
"qs": "^6.13.1",
|
|
20
|
+
"readable-stream": "^4.5.2",
|
|
21
|
+
"form-data-encoder": "^4.0.2"
|
|
22
|
+
},
|
|
23
|
+
"devDependencies": {
|
|
24
|
+
"@types/url-join": "4.0.1",
|
|
25
|
+
"@types/qs": "^6.9.17",
|
|
26
|
+
"@types/node-fetch": "^2.6.12",
|
|
27
|
+
"@types/readable-stream": "^4.0.18",
|
|
28
|
+
"webpack": "^5.97.1",
|
|
29
|
+
"ts-loader": "^9.5.1",
|
|
30
|
+
"jest": "^29.7.0",
|
|
31
|
+
"@types/jest": "^29.5.14",
|
|
32
|
+
"ts-jest": "^29.1.1",
|
|
33
|
+
"jest-environment-jsdom": "^29.7.0",
|
|
34
|
+
"@types/node": "^18.19.70",
|
|
35
|
+
"prettier": "^3.4.2",
|
|
36
|
+
"typescript": "~5.7.2"
|
|
37
|
+
},
|
|
38
|
+
"browser": {
|
|
39
|
+
"fs": false,
|
|
40
|
+
"os": false,
|
|
41
|
+
"path": false
|
|
42
|
+
}
|
|
43
|
+
}
|