@tapra/sdk 0.0.0-stage → 0.1.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/README.md +60 -2
- package/dist/lib/index.d.ts +5 -0
- package/dist/lib/index.js +7 -0
- package/dist/lib/index.js.map +1 -0
- package/dist/lib/pricing.d.ts +70 -0
- package/dist/lib/pricing.js +67 -0
- package/dist/lib/pricing.js.map +1 -0
- package/dist/lib/realtime.d.ts +99 -0
- package/dist/lib/realtime.js +230 -0
- package/dist/lib/realtime.js.map +1 -0
- package/dist/src/BaseClient.d.ts +57 -0
- package/dist/src/BaseClient.js +37 -0
- package/dist/src/BaseClient.js.map +1 -0
- package/dist/src/Client.d.ts +41 -0
- package/dist/src/Client.js +61 -0
- package/dist/src/Client.js.map +1 -0
- package/dist/src/api/errors/BadRequestError.d.ts +7 -0
- package/dist/src/api/errors/BadRequestError.js +18 -0
- package/dist/src/api/errors/BadRequestError.js.map +1 -0
- package/dist/src/api/errors/ContentTooLargeError.d.ts +7 -0
- package/dist/src/api/errors/ContentTooLargeError.js +18 -0
- package/dist/src/api/errors/ContentTooLargeError.js.map +1 -0
- package/dist/src/api/errors/ForbiddenError.d.ts +7 -0
- package/dist/src/api/errors/ForbiddenError.js +18 -0
- package/dist/src/api/errors/ForbiddenError.js.map +1 -0
- package/dist/src/api/errors/InternalServerError.d.ts +7 -0
- package/dist/src/api/errors/InternalServerError.js +18 -0
- package/dist/src/api/errors/InternalServerError.js.map +1 -0
- package/dist/src/api/errors/PaymentRequiredError.d.ts +7 -0
- package/dist/src/api/errors/PaymentRequiredError.js +18 -0
- package/dist/src/api/errors/PaymentRequiredError.js.map +1 -0
- package/dist/src/api/errors/ServiceUnavailableError.d.ts +7 -0
- package/dist/src/api/errors/ServiceUnavailableError.js +18 -0
- package/dist/src/api/errors/ServiceUnavailableError.js.map +1 -0
- package/dist/src/api/errors/TooManyRequestsError.d.ts +7 -0
- package/dist/src/api/errors/TooManyRequestsError.js +18 -0
- package/dist/src/api/errors/TooManyRequestsError.js.map +1 -0
- package/dist/src/api/errors/UnauthorizedError.d.ts +7 -0
- package/dist/src/api/errors/UnauthorizedError.js +18 -0
- package/dist/src/api/errors/UnauthorizedError.js.map +1 -0
- package/dist/src/api/errors/index.d.ts +8 -0
- package/dist/src/api/errors/index.js +9 -0
- package/dist/src/api/errors/index.js.map +1 -0
- package/dist/src/api/index.d.ts +3 -0
- package/dist/src/api/index.js +4 -0
- package/dist/src/api/index.js.map +1 -0
- package/dist/src/api/resources/diarization/client/Client.d.ts +40 -0
- package/dist/src/api/resources/diarization/client/Client.js +97 -0
- package/dist/src/api/resources/diarization/client/Client.js.map +1 -0
- package/dist/src/api/resources/diarization/client/index.d.ts +1 -0
- package/dist/src/api/resources/diarization/client/index.js +2 -0
- package/dist/src/api/resources/diarization/client/index.js.map +1 -0
- package/dist/src/api/resources/diarization/client/requests/DiarizationRequest.d.ts +11 -0
- package/dist/src/api/resources/diarization/client/requests/DiarizationRequest.js +3 -0
- package/dist/src/api/resources/diarization/client/requests/DiarizationRequest.js.map +1 -0
- package/dist/src/api/resources/diarization/client/requests/index.d.ts +1 -0
- package/dist/src/api/resources/diarization/client/requests/index.js +2 -0
- package/dist/src/api/resources/diarization/client/requests/index.js.map +1 -0
- package/dist/src/api/resources/diarization/exports.d.ts +2 -0
- package/dist/src/api/resources/diarization/exports.js +4 -0
- package/dist/src/api/resources/diarization/exports.js.map +1 -0
- package/dist/src/api/resources/diarization/index.d.ts +1 -0
- package/dist/src/api/resources/diarization/index.js +2 -0
- package/dist/src/api/resources/diarization/index.js.map +1 -0
- package/dist/src/api/resources/index.d.ts +11 -0
- package/dist/src/api/resources/index.js +12 -0
- package/dist/src/api/resources/index.js.map +1 -0
- package/dist/src/api/resources/models/client/Client.d.ts +27 -0
- package/dist/src/api/resources/models/client/Client.js +56 -0
- package/dist/src/api/resources/models/client/Client.js.map +1 -0
- package/dist/src/api/resources/models/client/index.d.ts +1 -0
- package/dist/src/api/resources/models/client/index.js +2 -0
- package/dist/src/api/resources/models/client/index.js.map +1 -0
- package/dist/src/api/resources/models/exports.d.ts +2 -0
- package/dist/src/api/resources/models/exports.js +4 -0
- package/dist/src/api/resources/models/exports.js.map +1 -0
- package/dist/src/api/resources/models/index.d.ts +1 -0
- package/dist/src/api/resources/models/index.js +2 -0
- package/dist/src/api/resources/models/index.js.map +1 -0
- package/dist/src/api/resources/script/client/Client.d.ts +47 -0
- package/dist/src/api/resources/script/client/Client.js +99 -0
- package/dist/src/api/resources/script/client/Client.js.map +1 -0
- package/dist/src/api/resources/script/client/index.d.ts +1 -0
- package/dist/src/api/resources/script/client/index.js +2 -0
- package/dist/src/api/resources/script/client/index.js.map +1 -0
- package/dist/src/api/resources/script/client/requests/ConversionRequest.d.ts +26 -0
- package/dist/src/api/resources/script/client/requests/ConversionRequest.js +10 -0
- package/dist/src/api/resources/script/client/requests/ConversionRequest.js.map +1 -0
- package/dist/src/api/resources/script/client/requests/index.d.ts +1 -0
- package/dist/src/api/resources/script/client/requests/index.js +2 -0
- package/dist/src/api/resources/script/client/requests/index.js.map +1 -0
- package/dist/src/api/resources/script/exports.d.ts +2 -0
- package/dist/src/api/resources/script/exports.js +4 -0
- package/dist/src/api/resources/script/exports.js.map +1 -0
- package/dist/src/api/resources/script/index.d.ts +1 -0
- package/dist/src/api/resources/script/index.js +2 -0
- package/dist/src/api/resources/script/index.js.map +1 -0
- package/dist/src/api/resources/speech/client/Client.d.ts +43 -0
- package/dist/src/api/resources/speech/client/Client.js +136 -0
- package/dist/src/api/resources/speech/client/Client.js.map +1 -0
- package/dist/src/api/resources/speech/client/index.d.ts +1 -0
- package/dist/src/api/resources/speech/client/index.js +2 -0
- package/dist/src/api/resources/speech/client/index.js.map +1 -0
- package/dist/src/api/resources/speech/client/requests/SpeechRequest.d.ts +50 -0
- package/dist/src/api/resources/speech/client/requests/SpeechRequest.js +23 -0
- package/dist/src/api/resources/speech/client/requests/SpeechRequest.js.map +1 -0
- package/dist/src/api/resources/speech/client/requests/index.d.ts +1 -0
- package/dist/src/api/resources/speech/client/requests/index.js +2 -0
- package/dist/src/api/resources/speech/client/requests/index.js.map +1 -0
- package/dist/src/api/resources/speech/exports.d.ts +2 -0
- package/dist/src/api/resources/speech/exports.js +4 -0
- package/dist/src/api/resources/speech/exports.js.map +1 -0
- package/dist/src/api/resources/speech/index.d.ts +1 -0
- package/dist/src/api/resources/speech/index.js +2 -0
- package/dist/src/api/resources/speech/index.js.map +1 -0
- package/dist/src/api/resources/transcriptions/client/Client.d.ts +40 -0
- package/dist/src/api/resources/transcriptions/client/Client.js +118 -0
- package/dist/src/api/resources/transcriptions/client/Client.js.map +1 -0
- package/dist/src/api/resources/transcriptions/client/index.d.ts +1 -0
- package/dist/src/api/resources/transcriptions/client/index.js +2 -0
- package/dist/src/api/resources/transcriptions/client/index.js.map +1 -0
- package/dist/src/api/resources/transcriptions/client/requests/TranscriptionRequest.d.ts +32 -0
- package/dist/src/api/resources/transcriptions/client/requests/TranscriptionRequest.js +10 -0
- package/dist/src/api/resources/transcriptions/client/requests/TranscriptionRequest.js.map +1 -0
- package/dist/src/api/resources/transcriptions/client/requests/index.d.ts +1 -0
- package/dist/src/api/resources/transcriptions/client/requests/index.js +2 -0
- package/dist/src/api/resources/transcriptions/client/requests/index.js.map +1 -0
- package/dist/src/api/resources/transcriptions/exports.d.ts +2 -0
- package/dist/src/api/resources/transcriptions/exports.js +4 -0
- package/dist/src/api/resources/transcriptions/exports.js.map +1 -0
- package/dist/src/api/resources/transcriptions/index.d.ts +1 -0
- package/dist/src/api/resources/transcriptions/index.js +2 -0
- package/dist/src/api/resources/transcriptions/index.js.map +1 -0
- package/dist/src/api/resources/translations/client/Client.d.ts +57 -0
- package/dist/src/api/resources/translations/client/Client.js +208 -0
- package/dist/src/api/resources/translations/client/Client.js.map +1 -0
- package/dist/src/api/resources/translations/client/index.d.ts +1 -0
- package/dist/src/api/resources/translations/client/index.js +2 -0
- package/dist/src/api/resources/translations/client/index.js.map +1 -0
- package/dist/src/api/resources/translations/client/requests/CreateTranslationsRequest.d.ts +26 -0
- package/dist/src/api/resources/translations/client/requests/CreateTranslationsRequest.js +11 -0
- package/dist/src/api/resources/translations/client/requests/CreateTranslationsRequest.js.map +1 -0
- package/dist/src/api/resources/translations/client/requests/CreateTranslationsStreamRequest.d.ts +26 -0
- package/dist/src/api/resources/translations/client/requests/CreateTranslationsStreamRequest.js +11 -0
- package/dist/src/api/resources/translations/client/requests/CreateTranslationsStreamRequest.js.map +1 -0
- package/dist/src/api/resources/translations/client/requests/index.d.ts +2 -0
- package/dist/src/api/resources/translations/client/requests/index.js +3 -0
- package/dist/src/api/resources/translations/client/requests/index.js.map +1 -0
- package/dist/src/api/resources/translations/exports.d.ts +2 -0
- package/dist/src/api/resources/translations/exports.js +4 -0
- package/dist/src/api/resources/translations/exports.js.map +1 -0
- package/dist/src/api/resources/translations/index.d.ts +1 -0
- package/dist/src/api/resources/translations/index.js +2 -0
- package/dist/src/api/resources/translations/index.js.map +1 -0
- package/dist/src/api/types/Conversion.d.ts +20 -0
- package/dist/src/api/types/Conversion.js +9 -0
- package/dist/src/api/types/Conversion.js.map +1 -0
- package/dist/src/api/types/ConversionSegment.d.ts +10 -0
- package/dist/src/api/types/ConversionSegment.js +3 -0
- package/dist/src/api/types/ConversionSegment.js.map +1 -0
- package/dist/src/api/types/Diarization.d.ts +12 -0
- package/dist/src/api/types/Diarization.js +3 -0
- package/dist/src/api/types/Diarization.js.map +1 -0
- package/dist/src/api/types/ErrorObject.d.ts +18 -0
- package/dist/src/api/types/ErrorObject.js +16 -0
- package/dist/src/api/types/ErrorObject.js.map +1 -0
- package/dist/src/api/types/Error_.d.ts +6 -0
- package/dist/src/api/types/Error_.js +3 -0
- package/dist/src/api/types/Error_.js.map +1 -0
- package/dist/src/api/types/Model.d.ts +17 -0
- package/dist/src/api/types/Model.js +11 -0
- package/dist/src/api/types/Model.js.map +1 -0
- package/dist/src/api/types/ModelList.d.ts +13 -0
- package/dist/src/api/types/ModelList.js +8 -0
- package/dist/src/api/types/ModelList.js.map +1 -0
- package/dist/src/api/types/RealtimeClientMessage.d.ts +13 -0
- package/dist/src/api/types/RealtimeClientMessage.js +9 -0
- package/dist/src/api/types/RealtimeClientMessage.js.map +1 -0
- package/dist/src/api/types/RealtimeEvent.d.ts +39 -0
- package/dist/src/api/types/RealtimeEvent.js +13 -0
- package/dist/src/api/types/RealtimeEvent.js.map +1 -0
- package/dist/src/api/types/Segment.d.ts +10 -0
- package/dist/src/api/types/Segment.js +3 -0
- package/dist/src/api/types/Segment.js.map +1 -0
- package/dist/src/api/types/Speaker.d.ts +9 -0
- package/dist/src/api/types/Speaker.js +3 -0
- package/dist/src/api/types/Speaker.js.map +1 -0
- package/dist/src/api/types/SpeakerTurn.d.ts +7 -0
- package/dist/src/api/types/SpeakerTurn.js +3 -0
- package/dist/src/api/types/SpeakerTurn.js.map +1 -0
- package/dist/src/api/types/Speech.d.ts +25 -0
- package/dist/src/api/types/Speech.js +8 -0
- package/dist/src/api/types/Speech.js.map +1 -0
- package/dist/src/api/types/Transcription.d.ts +21 -0
- package/dist/src/api/types/Transcription.js +3 -0
- package/dist/src/api/types/Transcription.js.map +1 -0
- package/dist/src/api/types/Translation.d.ts +16 -0
- package/dist/src/api/types/Translation.js +3 -0
- package/dist/src/api/types/Translation.js.map +1 -0
- package/dist/src/api/types/TranslationLanguage.d.ts +8 -0
- package/dist/src/api/types/TranslationLanguage.js +3 -0
- package/dist/src/api/types/TranslationLanguage.js.map +1 -0
- package/dist/src/api/types/TranslationLanguageList.d.ts +14 -0
- package/dist/src/api/types/TranslationLanguageList.js +8 -0
- package/dist/src/api/types/TranslationLanguageList.js.map +1 -0
- package/dist/src/api/types/TranslationRequest.d.ts +22 -0
- package/dist/src/api/types/TranslationRequest.js +11 -0
- package/dist/src/api/types/TranslationRequest.js.map +1 -0
- package/dist/src/api/types/TranslationStreamEvent.d.ts +19 -0
- package/dist/src/api/types/TranslationStreamEvent.js +11 -0
- package/dist/src/api/types/TranslationStreamEvent.js.map +1 -0
- package/dist/src/api/types/Usage.d.ts +8 -0
- package/dist/src/api/types/Usage.js +3 -0
- package/dist/src/api/types/Usage.js.map +1 -0
- package/dist/src/api/types/Word.d.ts +9 -0
- package/dist/src/api/types/Word.js +3 -0
- package/dist/src/api/types/Word.js.map +1 -0
- package/dist/src/api/types/index.d.ts +21 -0
- package/dist/src/api/types/index.js +22 -0
- package/dist/src/api/types/index.js.map +1 -0
- package/dist/src/auth/BearerAuthProvider.d.ts +20 -0
- package/dist/src/auth/BearerAuthProvider.js +34 -0
- package/dist/src/auth/BearerAuthProvider.js.map +1 -0
- package/dist/src/auth/index.d.ts +1 -0
- package/dist/src/auth/index.js +2 -0
- package/dist/src/auth/index.js.map +1 -0
- package/dist/src/core/auth/AuthProvider.d.ts +8 -0
- package/dist/src/core/auth/AuthProvider.js +7 -0
- package/dist/src/core/auth/AuthProvider.js.map +1 -0
- package/dist/src/core/auth/AuthRequest.d.ts +9 -0
- package/dist/src/core/auth/AuthRequest.js +2 -0
- package/dist/src/core/auth/AuthRequest.js.map +1 -0
- package/dist/src/core/auth/BasicAuth.d.ts +8 -0
- package/dist/src/core/auth/BasicAuth.js +30 -0
- package/dist/src/core/auth/BasicAuth.js.map +1 -0
- package/dist/src/core/auth/BearerToken.d.ts +7 -0
- package/dist/src/core/auth/BearerToken.js +14 -0
- package/dist/src/core/auth/BearerToken.js.map +1 -0
- package/dist/src/core/auth/NoOpAuthProvider.d.ts +5 -0
- package/dist/src/core/auth/NoOpAuthProvider.js +6 -0
- package/dist/src/core/auth/NoOpAuthProvider.js.map +1 -0
- package/dist/src/core/auth/index.d.ts +5 -0
- package/dist/src/core/auth/index.js +5 -0
- package/dist/src/core/auth/index.js.map +1 -0
- package/dist/src/core/base64.d.ts +2 -0
- package/dist/src/core/base64.js +23 -0
- package/dist/src/core/base64.js.map +1 -0
- package/dist/src/core/exports.d.ts +2 -0
- package/dist/src/core/exports.js +3 -0
- package/dist/src/core/exports.js.map +1 -0
- package/dist/src/core/fetcher/APIResponse.d.ts +20 -0
- package/dist/src/core/fetcher/APIResponse.js +2 -0
- package/dist/src/core/fetcher/APIResponse.js.map +1 -0
- package/dist/src/core/fetcher/BinaryResponse.d.ts +19 -0
- package/dist/src/core/fetcher/BinaryResponse.js +15 -0
- package/dist/src/core/fetcher/BinaryResponse.js.map +1 -0
- package/dist/src/core/fetcher/EndpointMetadata.d.ts +13 -0
- package/dist/src/core/fetcher/EndpointMetadata.js +2 -0
- package/dist/src/core/fetcher/EndpointMetadata.js.map +1 -0
- package/dist/src/core/fetcher/EndpointSupplier.d.ts +12 -0
- package/dist/src/core/fetcher/EndpointSupplier.js +11 -0
- package/dist/src/core/fetcher/EndpointSupplier.js.map +1 -0
- package/dist/src/core/fetcher/Fetcher.d.ts +56 -0
- package/dist/src/core/fetcher/Fetcher.js +224 -0
- package/dist/src/core/fetcher/Fetcher.js.map +1 -0
- package/dist/src/core/fetcher/Headers.d.ts +2 -0
- package/dist/src/core/fetcher/Headers.js +84 -0
- package/dist/src/core/fetcher/Headers.js.map +1 -0
- package/dist/src/core/fetcher/HttpResponsePromise.d.ts +58 -0
- package/dist/src/core/fetcher/HttpResponsePromise.js +91 -0
- package/dist/src/core/fetcher/HttpResponsePromise.js.map +1 -0
- package/dist/src/core/fetcher/RawResponse.d.ts +29 -0
- package/dist/src/core/fetcher/RawResponse.js +41 -0
- package/dist/src/core/fetcher/RawResponse.js.map +1 -0
- package/dist/src/core/fetcher/Supplier.d.ts +4 -0
- package/dist/src/core/fetcher/Supplier.js +11 -0
- package/dist/src/core/fetcher/Supplier.js.map +1 -0
- package/dist/src/core/fetcher/createRequestUrl.d.ts +1 -0
- package/dist/src/core/fetcher/createRequestUrl.js +6 -0
- package/dist/src/core/fetcher/createRequestUrl.js.map +1 -0
- package/dist/src/core/fetcher/getErrorResponseBody.d.ts +1 -0
- package/dist/src/core/fetcher/getErrorResponseBody.js +31 -0
- package/dist/src/core/fetcher/getErrorResponseBody.js.map +1 -0
- package/dist/src/core/fetcher/getFetchFn.d.ts +1 -0
- package/dist/src/core/fetcher/getFetchFn.js +4 -0
- package/dist/src/core/fetcher/getFetchFn.js.map +1 -0
- package/dist/src/core/fetcher/getHeader.d.ts +1 -0
- package/dist/src/core/fetcher/getHeader.js +9 -0
- package/dist/src/core/fetcher/getHeader.js.map +1 -0
- package/dist/src/core/fetcher/getRequestBody.d.ts +7 -0
- package/dist/src/core/fetcher/getRequestBody.js +14 -0
- package/dist/src/core/fetcher/getRequestBody.js.map +1 -0
- package/dist/src/core/fetcher/getResponseBody.d.ts +1 -0
- package/dist/src/core/fetcher/getResponseBody.js +67 -0
- package/dist/src/core/fetcher/getResponseBody.js.map +1 -0
- package/dist/src/core/fetcher/index.d.ts +13 -0
- package/dist/src/core/fetcher/index.js +8 -0
- package/dist/src/core/fetcher/index.js.map +1 -0
- package/dist/src/core/fetcher/makePassthroughRequest.d.ts +49 -0
- package/dist/src/core/fetcher/makePassthroughRequest.js +142 -0
- package/dist/src/core/fetcher/makePassthroughRequest.js.map +1 -0
- package/dist/src/core/fetcher/makeRequest.d.ts +6 -0
- package/dist/src/core/fetcher/makeRequest.js +54 -0
- package/dist/src/core/fetcher/makeRequest.js.map +1 -0
- package/dist/src/core/fetcher/redactUrl.d.ts +2 -0
- package/dist/src/core/fetcher/redactUrl.js +85 -0
- package/dist/src/core/fetcher/redactUrl.js.map +1 -0
- package/dist/src/core/fetcher/requestWithRetries.d.ts +1 -0
- package/dist/src/core/fetcher/requestWithRetries.js +57 -0
- package/dist/src/core/fetcher/requestWithRetries.js.map +1 -0
- package/dist/src/core/fetcher/signals.d.ts +5 -0
- package/dist/src/core/fetcher/signals.js +29 -0
- package/dist/src/core/fetcher/signals.js.map +1 -0
- package/dist/src/core/file/exports.d.ts +1 -0
- package/dist/src/core/file/exports.js +2 -0
- package/dist/src/core/file/exports.js.map +1 -0
- package/dist/src/core/file/file.d.ts +10 -0
- package/dist/src/core/file/file.js +169 -0
- package/dist/src/core/file/file.js.map +1 -0
- package/dist/src/core/file/index.d.ts +2 -0
- package/dist/src/core/file/index.js +3 -0
- package/dist/src/core/file/index.js.map +1 -0
- package/dist/src/core/file/types.d.ts +66 -0
- package/dist/src/core/file/types.js +2 -0
- package/dist/src/core/file/types.js.map +1 -0
- package/dist/src/core/form-data-utils/FormDataWrapper.d.ts +15 -0
- package/dist/src/core/form-data-utils/FormDataWrapper.js +109 -0
- package/dist/src/core/form-data-utils/FormDataWrapper.js.map +1 -0
- package/dist/src/core/form-data-utils/encodeAsFormParameter.d.ts +1 -0
- package/dist/src/core/form-data-utils/encodeAsFormParameter.js +10 -0
- package/dist/src/core/form-data-utils/encodeAsFormParameter.js.map +1 -0
- package/dist/src/core/form-data-utils/index.d.ts +2 -0
- package/dist/src/core/form-data-utils/index.js +3 -0
- package/dist/src/core/form-data-utils/index.js.map +1 -0
- package/dist/src/core/headers.d.ts +2 -0
- package/dist/src/core/headers.js +28 -0
- package/dist/src/core/headers.js.map +1 -0
- package/dist/src/core/index.d.ts +9 -0
- package/dist/src/core/index.js +10 -0
- package/dist/src/core/index.js.map +1 -0
- package/dist/src/core/json.d.ts +15 -0
- package/dist/src/core/json.js +20 -0
- package/dist/src/core/json.js.map +1 -0
- package/dist/src/core/logging/exports.d.ts +18 -0
- package/dist/src/core/logging/exports.js +10 -0
- package/dist/src/core/logging/exports.js.map +1 -0
- package/dist/src/core/logging/index.d.ts +1 -0
- package/dist/src/core/logging/index.js +2 -0
- package/dist/src/core/logging/index.js.map +1 -0
- package/dist/src/core/logging/logger.d.ts +126 -0
- package/dist/src/core/logging/logger.js +141 -0
- package/dist/src/core/logging/logger.js.map +1 -0
- package/dist/src/core/requestBody.d.ts +12 -0
- package/dist/src/core/requestBody.js +24 -0
- package/dist/src/core/requestBody.js.map +1 -0
- package/dist/src/core/runtime/index.d.ts +1 -0
- package/dist/src/core/runtime/index.js +2 -0
- package/dist/src/core/runtime/index.js.map +1 -0
- package/dist/src/core/runtime/runtime.d.ts +28 -0
- package/dist/src/core/runtime/runtime.js +172 -0
- package/dist/src/core/runtime/runtime.js.map +1 -0
- package/dist/src/core/stream/Stream.d.ts +100 -0
- package/dist/src/core/stream/Stream.js +427 -0
- package/dist/src/core/stream/Stream.js.map +1 -0
- package/dist/src/core/stream/index.d.ts +2 -0
- package/dist/src/core/stream/index.js +2 -0
- package/dist/src/core/stream/index.js.map +1 -0
- package/dist/src/core/url/QueryStringBuilder.d.ts +47 -0
- package/dist/src/core/url/QueryStringBuilder.js +79 -0
- package/dist/src/core/url/QueryStringBuilder.js.map +1 -0
- package/dist/src/core/url/encodePathParam.d.ts +1 -0
- package/dist/src/core/url/encodePathParam.js +19 -0
- package/dist/src/core/url/encodePathParam.js.map +1 -0
- package/dist/src/core/url/index.d.ts +4 -0
- package/dist/src/core/url/index.js +5 -0
- package/dist/src/core/url/index.js.map +1 -0
- package/dist/src/core/url/join.d.ts +1 -0
- package/dist/src/core/url/join.js +66 -0
- package/dist/src/core/url/join.js.map +1 -0
- package/dist/src/core/url/qs.d.ts +7 -0
- package/dist/src/core/url/qs.js +77 -0
- package/dist/src/core/url/qs.js.map +1 -0
- package/dist/src/environments.d.ts +4 -0
- package/dist/src/environments.js +5 -0
- package/dist/src/environments.js.map +1 -0
- package/dist/src/errors/TapraError.d.ts +15 -0
- package/dist/src/errors/TapraError.js +39 -0
- package/dist/src/errors/TapraError.js.map +1 -0
- package/dist/src/errors/TapraTimeoutError.d.ts +6 -0
- package/dist/src/errors/TapraTimeoutError.js +16 -0
- package/dist/src/errors/TapraTimeoutError.js.map +1 -0
- package/dist/src/errors/handleNonStatusCodeError.d.ts +2 -0
- package/dist/src/errors/handleNonStatusCodeError.js +33 -0
- package/dist/src/errors/handleNonStatusCodeError.js.map +1 -0
- package/dist/src/errors/index.d.ts +2 -0
- package/dist/src/errors/index.js +3 -0
- package/dist/src/errors/index.js.map +1 -0
- package/dist/src/exports.d.ts +1 -0
- package/dist/src/exports.js +2 -0
- package/dist/src/exports.js.map +1 -0
- package/dist/src/index.d.ts +6 -0
- package/dist/src/index.js +6 -0
- package/dist/src/index.js.map +1 -0
- package/package.json +28 -4
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
import { toMultipartDataPart } from "../../core/file/index.js";
|
|
2
|
+
import { toJson } from "../../core/json.js";
|
|
3
|
+
import { RUNTIME } from "../runtime/index.js";
|
|
4
|
+
export async function newFormData() {
|
|
5
|
+
return new FormDataWrapper();
|
|
6
|
+
}
|
|
7
|
+
export class FormDataWrapper {
|
|
8
|
+
fd = new FormData();
|
|
9
|
+
async setup() {
|
|
10
|
+
// noop
|
|
11
|
+
}
|
|
12
|
+
append(key, value) {
|
|
13
|
+
this.fd.append(key, String(value));
|
|
14
|
+
}
|
|
15
|
+
async appendFile(key, value) {
|
|
16
|
+
if (value == null) {
|
|
17
|
+
throw new Error(`File upload for "${key}" received ${value === null ? "null" : "undefined"}. The generated code should not call appendFile with null/undefined — check that optional file fields are guarded before this call.`);
|
|
18
|
+
}
|
|
19
|
+
const { data, filename, contentType } = await toMultipartDataPart(value);
|
|
20
|
+
const blob = await convertToBlob(data, contentType);
|
|
21
|
+
if (filename) {
|
|
22
|
+
this.fd.append(key, blob, filename);
|
|
23
|
+
}
|
|
24
|
+
else {
|
|
25
|
+
this.fd.append(key, blob);
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
getRequest() {
|
|
29
|
+
return {
|
|
30
|
+
body: this.fd,
|
|
31
|
+
headers: {},
|
|
32
|
+
duplex: "half",
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
function isStreamLike(value) {
|
|
37
|
+
return typeof value === "object" && value != null && ("read" in value || "pipe" in value);
|
|
38
|
+
}
|
|
39
|
+
function isReadableStream(value) {
|
|
40
|
+
return typeof value === "object" && value != null && "getReader" in value;
|
|
41
|
+
}
|
|
42
|
+
function isBuffer(value) {
|
|
43
|
+
return typeof Buffer !== "undefined" && Buffer.isBuffer && Buffer.isBuffer(value);
|
|
44
|
+
}
|
|
45
|
+
function isArrayBufferView(value) {
|
|
46
|
+
return ArrayBuffer.isView(value);
|
|
47
|
+
}
|
|
48
|
+
async function streamToBuffer(stream) {
|
|
49
|
+
if (RUNTIME.type === "node") {
|
|
50
|
+
const { Readable } = await import("stream");
|
|
51
|
+
if (stream instanceof Readable) {
|
|
52
|
+
const chunks = [];
|
|
53
|
+
for await (const chunk of stream) {
|
|
54
|
+
chunks.push(Buffer.isBuffer(chunk) ? chunk : Buffer.from(chunk));
|
|
55
|
+
}
|
|
56
|
+
return Buffer.concat(chunks);
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
if (isReadableStream(stream)) {
|
|
60
|
+
const reader = stream.getReader();
|
|
61
|
+
const chunks = [];
|
|
62
|
+
try {
|
|
63
|
+
while (true) {
|
|
64
|
+
const { done, value } = await reader.read();
|
|
65
|
+
if (done)
|
|
66
|
+
break;
|
|
67
|
+
chunks.push(value);
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
finally {
|
|
71
|
+
reader.releaseLock();
|
|
72
|
+
}
|
|
73
|
+
const totalLength = chunks.reduce((sum, chunk) => sum + chunk.length, 0);
|
|
74
|
+
const result = new Uint8Array(totalLength);
|
|
75
|
+
let offset = 0;
|
|
76
|
+
for (const chunk of chunks) {
|
|
77
|
+
result.set(chunk, offset);
|
|
78
|
+
offset += chunk.length;
|
|
79
|
+
}
|
|
80
|
+
return Buffer.from(result);
|
|
81
|
+
}
|
|
82
|
+
throw new Error(`Unsupported stream type: ${typeof stream}. Expected Node.js Readable stream or Web ReadableStream.`);
|
|
83
|
+
}
|
|
84
|
+
async function convertToBlob(value, contentType) {
|
|
85
|
+
if (isStreamLike(value) || isReadableStream(value)) {
|
|
86
|
+
const buffer = await streamToBuffer(value);
|
|
87
|
+
return new Blob([buffer], { type: contentType });
|
|
88
|
+
}
|
|
89
|
+
if (value instanceof Blob) {
|
|
90
|
+
return value;
|
|
91
|
+
}
|
|
92
|
+
if (isBuffer(value)) {
|
|
93
|
+
return new Blob([value], { type: contentType });
|
|
94
|
+
}
|
|
95
|
+
if (value instanceof ArrayBuffer) {
|
|
96
|
+
return new Blob([value], { type: contentType });
|
|
97
|
+
}
|
|
98
|
+
if (isArrayBufferView(value)) {
|
|
99
|
+
return new Blob([value], { type: contentType });
|
|
100
|
+
}
|
|
101
|
+
if (typeof value === "string") {
|
|
102
|
+
return new Blob([value], { type: contentType });
|
|
103
|
+
}
|
|
104
|
+
if (typeof value === "object" && value !== null) {
|
|
105
|
+
return new Blob([toJson(value)], { type: contentType ?? "application/json" });
|
|
106
|
+
}
|
|
107
|
+
return new Blob([String(value)], { type: contentType });
|
|
108
|
+
}
|
|
109
|
+
//# sourceMappingURL=FormDataWrapper.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FormDataWrapper.js","sourceRoot":"","sources":["../../../../src/core/form-data-utils/FormDataWrapper.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAmB,MAAM,0BAA0B,CAAC;AAChF,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAC5C,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAQ9C,MAAM,CAAC,KAAK,UAAU,WAAW;IAC7B,OAAO,IAAI,eAAe,EAAE,CAAC;AACjC,CAAC;AAED,MAAM,OAAO,eAAe;IAChB,EAAE,GAAa,IAAI,QAAQ,EAAE,CAAC;IAE/B,KAAK,CAAC,KAAK;QACd,OAAO;IACX,CAAC;IAEM,MAAM,CAAC,GAAW,EAAE,KAAc;QACrC,IAAI,CAAC,EAAE,CAAC,MAAM,CAAC,GAAG,EAAE,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC;IACvC,CAAC;IAEM,KAAK,CAAC,UAAU,CAAC,GAAW,EAAE,KAAiB;QAClD,IAAI,KAAK,IAAI,IAAI,EAAE,CAAC;YAChB,MAAM,IAAI,KAAK,CACX,oBAAoB,GAA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AE,EAAE,IAAI,EAAE,WAAW,EAAE,CAAC,CAAC;IACpD,CAAC;IAED,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI,EAAE,CAAC;QAC9C,OAAO,IAAI,IAAI,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,IAAI,EAAE,WAAW,IAAI,kBAAkB,EAAE,CAAC,CAAC;IAClF,CAAC;IAED,OAAO,IAAI,IAAI,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,IAAI,EAAE,WAAW,EAAE,CAAC,CAAC;AAC5D,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function encodeAsFormParameter(value: unknown): Record<string, string>;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { toQueryString } from "../url/qs.js";
|
|
2
|
+
export function encodeAsFormParameter(value) {
|
|
3
|
+
const stringified = toQueryString(value, { encode: false });
|
|
4
|
+
const keyValuePairs = stringified.split("&").map((pair) => {
|
|
5
|
+
const [key, value] = pair.split("=");
|
|
6
|
+
return [key, value];
|
|
7
|
+
});
|
|
8
|
+
return Object.fromEntries(keyValuePairs);
|
|
9
|
+
}
|
|
10
|
+
//# sourceMappingURL=encodeAsFormParameter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"encodeAsFormParameter.js","sourceRoot":"","sources":["../../../../src/core/form-data-utils/encodeAsFormParameter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAE7C,MAAM,UAAU,qBAAqB,CAAC,KAAc;IAChD,MAAM,WAAW,GAAG,aAAa,CAAC,KAAK,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC,CAAC;IAE5D,MAAM,aAAa,GAAG,WAAW,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE;QACtD,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QACrC,OAAO,CAAC,GAAG,EAAE,KAAK,CAAU,CAAC;IACjC,CAAC,CAAC,CAAC;IAEH,OAAO,MAAM,CAAC,WAAW,CAAC,aAAa,CAAC,CAAC;AAC7C,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/core/form-data-utils/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAC;AACnE,cAAc,sBAAsB,CAAC"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
export function mergeHeaders(...headersArray) {
|
|
2
|
+
const result = {};
|
|
3
|
+
for (const [key, value] of headersArray
|
|
4
|
+
.filter((headers) => headers != null)
|
|
5
|
+
.flatMap((headers) => Object.entries(headers))) {
|
|
6
|
+
const insensitiveKey = key.toLowerCase();
|
|
7
|
+
if (value != null) {
|
|
8
|
+
result[insensitiveKey] = value;
|
|
9
|
+
}
|
|
10
|
+
else if (insensitiveKey in result) {
|
|
11
|
+
delete result[insensitiveKey];
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
return result;
|
|
15
|
+
}
|
|
16
|
+
export function mergeOnlyDefinedHeaders(...headersArray) {
|
|
17
|
+
const result = {};
|
|
18
|
+
for (const [key, value] of headersArray
|
|
19
|
+
.filter((headers) => headers != null)
|
|
20
|
+
.flatMap((headers) => Object.entries(headers))) {
|
|
21
|
+
const insensitiveKey = key.toLowerCase();
|
|
22
|
+
if (value != null) {
|
|
23
|
+
result[insensitiveKey] = value;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
return result;
|
|
27
|
+
}
|
|
28
|
+
//# sourceMappingURL=headers.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"headers.js","sourceRoot":"","sources":["../../../src/core/headers.ts"],"names":[],"mappings":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* from "./fetcher/index.js";
|
|
4
|
+
export * as file from "./file/index.js";
|
|
5
|
+
export * from "./form-data-utils/index.js";
|
|
6
|
+
export * as logging from "./logging/index.js";
|
|
7
|
+
export * from "./runtime/index.js";
|
|
8
|
+
export * from "./stream/index.js";
|
|
9
|
+
export * as url from "./url/index.js";
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export * from "./auth/index.js";
|
|
2
|
+
export * from "./base64.js";
|
|
3
|
+
export * from "./fetcher/index.js";
|
|
4
|
+
export * as file from "./file/index.js";
|
|
5
|
+
export * from "./form-data-utils/index.js";
|
|
6
|
+
export * as logging from "./logging/index.js";
|
|
7
|
+
export * from "./runtime/index.js";
|
|
8
|
+
export * from "./stream/index.js";
|
|
9
|
+
export * as url from "./url/index.js";
|
|
10
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/core/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAC;AAChC,cAAc,aAAa,CAAC;AAC5B,cAAc,oBAAoB,CAAC;AACnC,OAAO,KAAK,IAAI,MAAM,iBAAiB,CAAC;AACxC,cAAc,4BAA4B,CAAC;AAC3C,OAAO,KAAK,OAAO,MAAM,oBAAoB,CAAC;AAC9C,cAAc,oBAAoB,CAAC;AACnC,cAAc,mBAAmB,CAAC;AAClC,OAAO,KAAK,GAAG,MAAM,gBAAgB,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Serialize a value to JSON
|
|
3
|
+
* @param value A JavaScript value, usually an object or array, to be converted.
|
|
4
|
+
* @param replacer A function that transforms the results.
|
|
5
|
+
* @param space Adds indentation, white space, and line break characters to the return-value JSON text to make it easier to read.
|
|
6
|
+
* @returns JSON string
|
|
7
|
+
*/
|
|
8
|
+
export declare const toJson: (value: unknown, replacer?: (this: unknown, key: string, value: unknown) => unknown, space?: string | number) => string;
|
|
9
|
+
/**
|
|
10
|
+
* Parse JSON string to object, array, or other type
|
|
11
|
+
* @param text A valid JSON string.
|
|
12
|
+
* @param reviver A function that transforms the results. This function is called for each member of the object. If a member contains nested objects, the nested objects are transformed before the parent object is.
|
|
13
|
+
* @returns Parsed object, array, or other type
|
|
14
|
+
*/
|
|
15
|
+
export declare function fromJson<T = unknown>(text: string, reviver?: (this: unknown, key: string, value: unknown) => unknown): T;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Serialize a value to JSON
|
|
3
|
+
* @param value A JavaScript value, usually an object or array, to be converted.
|
|
4
|
+
* @param replacer A function that transforms the results.
|
|
5
|
+
* @param space Adds indentation, white space, and line break characters to the return-value JSON text to make it easier to read.
|
|
6
|
+
* @returns JSON string
|
|
7
|
+
*/
|
|
8
|
+
export const toJson = (value, replacer, space) => {
|
|
9
|
+
return JSON.stringify(value, replacer, space);
|
|
10
|
+
};
|
|
11
|
+
/**
|
|
12
|
+
* Parse JSON string to object, array, or other type
|
|
13
|
+
* @param text A valid JSON string.
|
|
14
|
+
* @param reviver A function that transforms the results. This function is called for each member of the object. If a member contains nested objects, the nested objects are transformed before the parent object is.
|
|
15
|
+
* @returns Parsed object, array, or other type
|
|
16
|
+
*/
|
|
17
|
+
export function fromJson(text, reviver) {
|
|
18
|
+
return JSON.parse(text, reviver);
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=json.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"json.js","sourceRoot":"","sources":["../../../src/core/json.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,MAAM,GAAG,CAClB,KAAc,EACd,QAAkE,EAClE,KAAuB,EACjB,EAAE;IACR,OAAO,IAAI,CAAC,SAAS,CAAC,KAAK,EAAE,QAAQ,EAAE,KAAK,CAAC,CAAC;AAClD,CAAC,CAAC;AAEF;;;;;GAKG;AACH,MAAM,UAAU,QAAQ,CACpB,IAAY,EACZ,OAAiE;IAEjE,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;AACrC,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import * as logger from "./logger.js";
|
|
2
|
+
export declare namespace logging {
|
|
3
|
+
/**
|
|
4
|
+
* Configuration for logger instances.
|
|
5
|
+
*/
|
|
6
|
+
type LogConfig = logger.LogConfig;
|
|
7
|
+
type LogLevel = logger.LogLevel;
|
|
8
|
+
const LogLevel: typeof logger.LogLevel;
|
|
9
|
+
type ILogger = logger.ILogger;
|
|
10
|
+
/**
|
|
11
|
+
* Console logger implementation that outputs to the console.
|
|
12
|
+
*/
|
|
13
|
+
type ConsoleLogger = logger.ConsoleLogger;
|
|
14
|
+
/**
|
|
15
|
+
* Console logger implementation that outputs to the console.
|
|
16
|
+
*/
|
|
17
|
+
const ConsoleLogger: typeof logger.ConsoleLogger;
|
|
18
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import * as logger from "./logger.js";
|
|
2
|
+
export var logging;
|
|
3
|
+
(function (logging) {
|
|
4
|
+
logging.LogLevel = logger.LogLevel;
|
|
5
|
+
/**
|
|
6
|
+
* Console logger implementation that outputs to the console.
|
|
7
|
+
*/
|
|
8
|
+
logging.ConsoleLogger = logger.ConsoleLogger;
|
|
9
|
+
})(logging || (logging = {}));
|
|
10
|
+
//# sourceMappingURL=exports.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"exports.js","sourceRoot":"","sources":["../../../../src/core/logging/exports.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,aAAa,CAAC;AAEtC,MAAM,KAAW,OAAO,CAgBvB;AAhBD,WAAiB,OAAO;IAMP,gBAAQ,GAA2B,MAAM,CAAC,QAAQ,CAAC;IAMhE;;OAEG;IACU,qBAAa,GAAgC,MAAM,CAAC,aAAa,CAAC;AACnF,CAAC,EAhBgB,OAAO,KAAP,OAAO,QAgBvB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./logger.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/core/logging/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC"}
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
export declare const LogLevel: {
|
|
2
|
+
readonly Debug: "debug";
|
|
3
|
+
readonly Info: "info";
|
|
4
|
+
readonly Warn: "warn";
|
|
5
|
+
readonly Error: "error";
|
|
6
|
+
};
|
|
7
|
+
export type LogLevel = (typeof LogLevel)[keyof typeof LogLevel];
|
|
8
|
+
export interface ILogger {
|
|
9
|
+
/**
|
|
10
|
+
* Logs a debug message.
|
|
11
|
+
* @param message - The message to log
|
|
12
|
+
* @param args - Additional arguments to log
|
|
13
|
+
*/
|
|
14
|
+
debug(message: string, ...args: unknown[]): void;
|
|
15
|
+
/**
|
|
16
|
+
* Logs an info message.
|
|
17
|
+
* @param message - The message to log
|
|
18
|
+
* @param args - Additional arguments to log
|
|
19
|
+
*/
|
|
20
|
+
info(message: string, ...args: unknown[]): void;
|
|
21
|
+
/**
|
|
22
|
+
* Logs a warning message.
|
|
23
|
+
* @param message - The message to log
|
|
24
|
+
* @param args - Additional arguments to log
|
|
25
|
+
*/
|
|
26
|
+
warn(message: string, ...args: unknown[]): void;
|
|
27
|
+
/**
|
|
28
|
+
* Logs an error message.
|
|
29
|
+
* @param message - The message to log
|
|
30
|
+
* @param args - Additional arguments to log
|
|
31
|
+
*/
|
|
32
|
+
error(message: string, ...args: unknown[]): void;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Configuration for logger initialization.
|
|
36
|
+
*/
|
|
37
|
+
export interface LogConfig {
|
|
38
|
+
/**
|
|
39
|
+
* Minimum log level to output.
|
|
40
|
+
* @default LogLevel.Info
|
|
41
|
+
*/
|
|
42
|
+
level?: LogLevel;
|
|
43
|
+
/**
|
|
44
|
+
* Logger implementation to use.
|
|
45
|
+
* @default new ConsoleLogger()
|
|
46
|
+
*/
|
|
47
|
+
logger?: ILogger;
|
|
48
|
+
/**
|
|
49
|
+
* Whether logging should be silenced.
|
|
50
|
+
* @default true
|
|
51
|
+
*/
|
|
52
|
+
silent?: boolean;
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Default console-based logger implementation.
|
|
56
|
+
*/
|
|
57
|
+
export declare class ConsoleLogger implements ILogger {
|
|
58
|
+
debug(message: string, ...args: unknown[]): void;
|
|
59
|
+
info(message: string, ...args: unknown[]): void;
|
|
60
|
+
warn(message: string, ...args: unknown[]): void;
|
|
61
|
+
error(message: string, ...args: unknown[]): void;
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* Logger class that provides level-based logging functionality.
|
|
65
|
+
*/
|
|
66
|
+
export declare class Logger {
|
|
67
|
+
private readonly level;
|
|
68
|
+
private readonly logger;
|
|
69
|
+
private readonly silent;
|
|
70
|
+
/**
|
|
71
|
+
* Creates a new logger instance.
|
|
72
|
+
* @param config - Logger configuration
|
|
73
|
+
*/
|
|
74
|
+
constructor(config: Required<LogConfig>);
|
|
75
|
+
/**
|
|
76
|
+
* Checks if a log level should be output based on configuration.
|
|
77
|
+
* @param level - The log level to check
|
|
78
|
+
* @returns True if the level should be logged
|
|
79
|
+
*/
|
|
80
|
+
shouldLog(level: LogLevel): boolean;
|
|
81
|
+
/**
|
|
82
|
+
* Checks if debug logging is enabled.
|
|
83
|
+
* @returns True if debug logs should be output
|
|
84
|
+
*/
|
|
85
|
+
isDebug(): boolean;
|
|
86
|
+
/**
|
|
87
|
+
* Logs a debug message if debug logging is enabled.
|
|
88
|
+
* @param message - The message to log
|
|
89
|
+
* @param args - Additional arguments to log
|
|
90
|
+
*/
|
|
91
|
+
debug(message: string, ...args: unknown[]): void;
|
|
92
|
+
/**
|
|
93
|
+
* Checks if info logging is enabled.
|
|
94
|
+
* @returns True if info logs should be output
|
|
95
|
+
*/
|
|
96
|
+
isInfo(): boolean;
|
|
97
|
+
/**
|
|
98
|
+
* Logs an info message if info logging is enabled.
|
|
99
|
+
* @param message - The message to log
|
|
100
|
+
* @param args - Additional arguments to log
|
|
101
|
+
*/
|
|
102
|
+
info(message: string, ...args: unknown[]): void;
|
|
103
|
+
/**
|
|
104
|
+
* Checks if warning logging is enabled.
|
|
105
|
+
* @returns True if warning logs should be output
|
|
106
|
+
*/
|
|
107
|
+
isWarn(): boolean;
|
|
108
|
+
/**
|
|
109
|
+
* Logs a warning message if warning logging is enabled.
|
|
110
|
+
* @param message - The message to log
|
|
111
|
+
* @param args - Additional arguments to log
|
|
112
|
+
*/
|
|
113
|
+
warn(message: string, ...args: unknown[]): void;
|
|
114
|
+
/**
|
|
115
|
+
* Checks if error logging is enabled.
|
|
116
|
+
* @returns True if error logs should be output
|
|
117
|
+
*/
|
|
118
|
+
isError(): boolean;
|
|
119
|
+
/**
|
|
120
|
+
* Logs an error message if error logging is enabled.
|
|
121
|
+
* @param message - The message to log
|
|
122
|
+
* @param args - Additional arguments to log
|
|
123
|
+
*/
|
|
124
|
+
error(message: string, ...args: unknown[]): void;
|
|
125
|
+
}
|
|
126
|
+
export declare function createLogger(config?: LogConfig | Logger): Logger;
|
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
export const LogLevel = {
|
|
2
|
+
Debug: "debug",
|
|
3
|
+
Info: "info",
|
|
4
|
+
Warn: "warn",
|
|
5
|
+
Error: "error",
|
|
6
|
+
};
|
|
7
|
+
const logLevelMap = {
|
|
8
|
+
[LogLevel.Debug]: 1,
|
|
9
|
+
[LogLevel.Info]: 2,
|
|
10
|
+
[LogLevel.Warn]: 3,
|
|
11
|
+
[LogLevel.Error]: 4,
|
|
12
|
+
};
|
|
13
|
+
/**
|
|
14
|
+
* Default console-based logger implementation.
|
|
15
|
+
*/
|
|
16
|
+
export class ConsoleLogger {
|
|
17
|
+
debug(message, ...args) {
|
|
18
|
+
console.debug(message, ...args);
|
|
19
|
+
}
|
|
20
|
+
info(message, ...args) {
|
|
21
|
+
console.info(message, ...args);
|
|
22
|
+
}
|
|
23
|
+
warn(message, ...args) {
|
|
24
|
+
console.warn(message, ...args);
|
|
25
|
+
}
|
|
26
|
+
error(message, ...args) {
|
|
27
|
+
console.error(message, ...args);
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Logger class that provides level-based logging functionality.
|
|
32
|
+
*/
|
|
33
|
+
export class Logger {
|
|
34
|
+
level;
|
|
35
|
+
logger;
|
|
36
|
+
silent;
|
|
37
|
+
/**
|
|
38
|
+
* Creates a new logger instance.
|
|
39
|
+
* @param config - Logger configuration
|
|
40
|
+
*/
|
|
41
|
+
constructor(config) {
|
|
42
|
+
this.level = logLevelMap[config.level];
|
|
43
|
+
this.logger = config.logger;
|
|
44
|
+
this.silent = config.silent;
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Checks if a log level should be output based on configuration.
|
|
48
|
+
* @param level - The log level to check
|
|
49
|
+
* @returns True if the level should be logged
|
|
50
|
+
*/
|
|
51
|
+
shouldLog(level) {
|
|
52
|
+
return !this.silent && this.level <= logLevelMap[level];
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Checks if debug logging is enabled.
|
|
56
|
+
* @returns True if debug logs should be output
|
|
57
|
+
*/
|
|
58
|
+
isDebug() {
|
|
59
|
+
return this.shouldLog(LogLevel.Debug);
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* Logs a debug message if debug logging is enabled.
|
|
63
|
+
* @param message - The message to log
|
|
64
|
+
* @param args - Additional arguments to log
|
|
65
|
+
*/
|
|
66
|
+
debug(message, ...args) {
|
|
67
|
+
if (this.isDebug()) {
|
|
68
|
+
this.logger.debug(message, ...args);
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* Checks if info logging is enabled.
|
|
73
|
+
* @returns True if info logs should be output
|
|
74
|
+
*/
|
|
75
|
+
isInfo() {
|
|
76
|
+
return this.shouldLog(LogLevel.Info);
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* Logs an info message if info logging is enabled.
|
|
80
|
+
* @param message - The message to log
|
|
81
|
+
* @param args - Additional arguments to log
|
|
82
|
+
*/
|
|
83
|
+
info(message, ...args) {
|
|
84
|
+
if (this.isInfo()) {
|
|
85
|
+
this.logger.info(message, ...args);
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
/**
|
|
89
|
+
* Checks if warning logging is enabled.
|
|
90
|
+
* @returns True if warning logs should be output
|
|
91
|
+
*/
|
|
92
|
+
isWarn() {
|
|
93
|
+
return this.shouldLog(LogLevel.Warn);
|
|
94
|
+
}
|
|
95
|
+
/**
|
|
96
|
+
* Logs a warning message if warning logging is enabled.
|
|
97
|
+
* @param message - The message to log
|
|
98
|
+
* @param args - Additional arguments to log
|
|
99
|
+
*/
|
|
100
|
+
warn(message, ...args) {
|
|
101
|
+
if (this.isWarn()) {
|
|
102
|
+
this.logger.warn(message, ...args);
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
/**
|
|
106
|
+
* Checks if error logging is enabled.
|
|
107
|
+
* @returns True if error logs should be output
|
|
108
|
+
*/
|
|
109
|
+
isError() {
|
|
110
|
+
return this.shouldLog(LogLevel.Error);
|
|
111
|
+
}
|
|
112
|
+
/**
|
|
113
|
+
* Logs an error message if error logging is enabled.
|
|
114
|
+
* @param message - The message to log
|
|
115
|
+
* @param args - Additional arguments to log
|
|
116
|
+
*/
|
|
117
|
+
error(message, ...args) {
|
|
118
|
+
if (this.isError()) {
|
|
119
|
+
this.logger.error(message, ...args);
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
export function createLogger(config) {
|
|
124
|
+
if (config == null) {
|
|
125
|
+
return defaultLogger;
|
|
126
|
+
}
|
|
127
|
+
if (config instanceof Logger) {
|
|
128
|
+
return config;
|
|
129
|
+
}
|
|
130
|
+
config = config ?? {};
|
|
131
|
+
config.level ??= LogLevel.Info;
|
|
132
|
+
config.logger ??= new ConsoleLogger();
|
|
133
|
+
config.silent ??= true;
|
|
134
|
+
return new Logger(config);
|
|
135
|
+
}
|
|
136
|
+
const defaultLogger = new Logger({
|
|
137
|
+
level: LogLevel.Info,
|
|
138
|
+
logger: new ConsoleLogger(),
|
|
139
|
+
silent: true,
|
|
140
|
+
});
|
|
141
|
+
//# sourceMappingURL=logger.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"logger.js","sourceRoot":"","sources":["../../../../src/core/logging/logger.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,QAAQ,GAAG;IACpB,KAAK,EAAE,OAAO;IACd,IAAI,EAAE,MAAM;IACZ,IAAI,EAAE,MAAM;IACZ,KAAK,EAAE,OAAO;CACR,CAAC;AAEX,MAAM,WAAW,GAA6B;IAC1C,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE,CAAC;IACnB,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC;IAClB,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC;IAClB,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE,CAAC;CACtB,CAAC;AAkDF;;GAEG;AACH,MAAM,OAAO,aAAa;IACtB,KAAK,CAAC,OAAe,EAAE,GAAG,IAAe;QACrC,OAAO,CAAC,KAAK,CAAC,OAAO,EAAE,GAAG,IAAI,CAAC,CAAC;IACpC,CAAC;IACD,IAAI,CAAC,OAAe,EAAE,GAAG,IAAe;QACpC,OAAO,CAAC,IAAI,CAAC,OAAO,EAAE,GAAG,IAAI,CAAC,CAAC;IACnC,CAAC;IACD,IAAI,CAAC,OAAe,EAAE,GAAG,IAAe;QACpC,OAAO,CAAC,IAAI,CAAC,OAAO,EAAE,GAAG,IAAI,CAAC,CAAC;IACnC,CAAC;IACD,KAAK,CAAC,OAAe,EAAE,GAAG,IAAe;QACrC,OAAO,CAAC,KAAK,CAAC,OAA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
|
|
3
|
+
* on top of the request body. Caller-supplied properties win over the endpoint body. When no
|
|
4
|
+
* additional body parameters are provided, the original body is returned unchanged so serialization
|
|
5
|
+
* is unaffected.
|
|
6
|
+
*
|
|
7
|
+
* The merge only applies to plain-object (JSON object) bodies. When the body is `null`/`undefined`
|
|
8
|
+
* the additional parameters become the body; when the body is an array or a primitive JSON value it
|
|
9
|
+
* is returned unchanged, since object properties cannot be spread into it. This mirrors the Python
|
|
10
|
+
* SDK, which only merges additional body parameters into mapping bodies.
|
|
11
|
+
*/
|
|
12
|
+
export declare function mergeAdditionalBodyParameters(body: unknown, additionalBodyParameters: Record<string, unknown> | undefined): unknown;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Spreads caller-supplied `additionalBodyParameters` (from `requestOptions.additionalBodyParameters`)
|
|
3
|
+
* on top of the request body. Caller-supplied properties win over the endpoint body. When no
|
|
4
|
+
* additional body parameters are provided, the original body is returned unchanged so serialization
|
|
5
|
+
* is unaffected.
|
|
6
|
+
*
|
|
7
|
+
* The merge only applies to plain-object (JSON object) bodies. When the body is `null`/`undefined`
|
|
8
|
+
* the additional parameters become the body; when the body is an array or a primitive JSON value it
|
|
9
|
+
* is returned unchanged, since object properties cannot be spread into it. This mirrors the Python
|
|
10
|
+
* SDK, which only merges additional body parameters into mapping bodies.
|
|
11
|
+
*/
|
|
12
|
+
export function mergeAdditionalBodyParameters(body, additionalBodyParameters) {
|
|
13
|
+
if (additionalBodyParameters == null) {
|
|
14
|
+
return body;
|
|
15
|
+
}
|
|
16
|
+
if (body == null) {
|
|
17
|
+
return { ...additionalBodyParameters };
|
|
18
|
+
}
|
|
19
|
+
if (typeof body === "object" && !Array.isArray(body)) {
|
|
20
|
+
return { ...body, ...additionalBodyParameters };
|
|
21
|
+
}
|
|
22
|
+
return body;
|
|
23
|
+
}
|
|
24
|
+
//# sourceMappingURL=requestBody.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"requestBody.js","sourceRoot":"","sources":["../../../src/core/requestBody.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,MAAM,UAAU,6BAA6B,CACzC,IAAa,EACb,wBAA6D;IAE7D,IAAI,wBAAwB,IAAI,IAAI,EAAE,CAAC;QACnC,OAAO,IAAI,CAAC;IAChB,CAAC;IACD,IAAI,IAAI,IAAI,IAAI,EAAE,CAAC;QACf,OAAO,EAAE,GAAG,wBAAwB,EAAE,CAAC;IAC3C,CAAC;IACD,IAAI,OAAO,IAAI,KAAK,QAAQ,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,CAAC;QACnD,OAAO,EAAE,GAAG,IAAI,EAAE,GAAG,wBAAwB,EAAE,CAAC;IACpD,CAAC;IACD,OAAO,IAAI,CAAC;AAChB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { getUserAgent, RUNTIME } from "./runtime.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/core/runtime/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC"}
|