@cartesia/cartesia-js 2.1.3 → 2.1.5
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 +12 -5
- package/Client.js +11 -6
- package/api/resources/apiStatus/client/Client.d.ts +4 -0
- package/api/resources/apiStatus/client/Client.js +21 -11
- package/api/resources/datasets/client/Client.d.ts +4 -1
- package/api/resources/datasets/client/Client.js +34 -24
- package/api/resources/datasets/types/FilePurpose.d.ts +1 -1
- package/api/resources/embedding/types/Embedding.d.ts +1 -1
- package/api/resources/index.d.ts +2 -0
- package/api/resources/index.js +20 -8
- package/api/resources/infill/client/Client.d.ts +49 -0
- package/api/resources/infill/client/Client.js +148 -0
- package/api/resources/infill/client/index.d.ts +1 -0
- package/api/resources/infill/client/index.js +17 -0
- package/api/resources/infill/client/requests/InfillBytesRequest.d.ts +71 -0
- package/api/resources/infill/client/requests/InfillBytesRequest.js +5 -0
- package/api/resources/infill/client/requests/index.d.ts +1 -0
- package/api/resources/infill/client/requests/index.js +2 -0
- package/api/resources/infill/index.d.ts +1 -0
- package/api/resources/infill/index.js +17 -0
- package/api/resources/tts/client/Client.js +21 -11
- package/api/resources/tts/types/ContextId.d.ts +1 -1
- package/api/resources/tts/types/Emotion.d.ts +5 -1
- package/api/resources/tts/types/Emotion.js +4 -0
- package/api/resources/tts/types/FlushId.d.ts +9 -0
- package/api/resources/tts/types/FlushId.js +5 -0
- package/api/resources/tts/types/GenerationRequest.d.ts +7 -2
- package/api/resources/tts/types/NaturalSpecifier.d.ts +1 -1
- package/api/resources/tts/types/NumericalSpecifier.d.ts +1 -1
- package/api/resources/tts/types/OutputFormat.d.ts +1 -1
- package/api/resources/tts/types/PhonemeTimestamps.d.ts +8 -0
- package/api/resources/tts/types/PhonemeTimestamps.js +5 -0
- package/api/resources/tts/types/RawEncoding.d.ts +1 -1
- package/api/resources/tts/types/RawOutputFormat.d.ts +1 -0
- package/api/resources/tts/types/Speed.d.ts +1 -1
- package/api/resources/tts/types/SupportedLanguage.d.ts +1 -1
- package/api/resources/tts/types/TtsRequestVoiceSpecifier.d.ts +1 -1
- package/api/resources/tts/types/WebSocketFlushDoneResponse.d.ts +8 -0
- package/api/resources/tts/types/WebSocketFlushDoneResponse.js +5 -0
- package/api/resources/tts/types/WebSocketPhonemeTimestampsResponse.d.ts +7 -0
- package/api/resources/tts/types/WebSocketPhonemeTimestampsResponse.js +5 -0
- package/api/resources/tts/types/WebSocketRequest.d.ts +1 -1
- package/api/resources/tts/types/WebSocketResponse.d.ts +7 -1
- package/api/resources/tts/types/WebSocketTtsOutput.d.ts +3 -0
- package/api/resources/tts/types/WebSocketTtsRequest.d.ts +1 -0
- package/api/resources/tts/types/index.d.ts +4 -0
- package/api/resources/tts/types/index.js +4 -0
- package/api/resources/voiceChanger/client/Client.d.ts +3 -4
- package/api/resources/voiceChanger/client/Client.js +23 -13
- package/api/resources/voiceChanger/types/OutputFormatContainer.d.ts +1 -1
- package/api/resources/voiceChanger/types/StreamingResponse.d.ts +1 -1
- package/api/resources/voices/client/Client.d.ts +5 -3
- package/api/resources/voices/client/Client.js +56 -47
- package/api/resources/voices/types/BaseVoiceId.d.ts +1 -1
- package/api/resources/voices/types/CloneMode.d.ts +1 -1
- package/api/resources/voices/types/CreateVoiceRequest.d.ts +0 -1
- package/api/resources/voices/types/Gender.d.ts +1 -1
- package/api/resources/voices/types/LocalizeDialect.d.ts +12 -4
- package/api/resources/voices/types/LocalizeEnglishDialect.d.ts +1 -1
- package/api/resources/voices/types/LocalizePortugueseDialect.d.ts +8 -0
- package/api/resources/voices/types/LocalizePortugueseDialect.js +10 -0
- package/api/resources/voices/types/LocalizeSpanishDialect.d.ts +8 -0
- package/api/resources/voices/types/LocalizeSpanishDialect.js +10 -0
- package/api/resources/voices/types/LocalizeTargetLanguage.d.ts +1 -1
- package/api/resources/voices/types/MixVoiceSpecifier.d.ts +1 -1
- package/api/resources/voices/types/Voice.d.ts +0 -1
- package/api/resources/voices/types/VoiceId.d.ts +1 -1
- package/api/resources/voices/types/Weight.d.ts +1 -1
- package/api/resources/voices/types/index.d.ts +2 -0
- package/api/resources/voices/types/index.js +2 -0
- package/core/fetcher/APIResponse.d.ts +1 -1
- package/core/fetcher/Fetcher.d.ts +1 -1
- package/core/fetcher/Fetcher.js +2 -2
- package/core/fetcher/Supplier.d.ts +1 -1
- package/core/fetcher/createRequestUrl.d.ts +1 -1
- package/core/fetcher/createRequestUrl.js +1 -2
- package/core/fetcher/getFetchFn.js +18 -9
- package/core/fetcher/getHeader.js +1 -2
- package/core/fetcher/getRequestBody.js +5 -5
- package/core/fetcher/getResponseBody.js +1 -2
- package/core/fetcher/makeRequest.d.ts +1 -1
- package/core/fetcher/requestWithRetries.js +4 -5
- package/core/fetcher/signals.d.ts +0 -1
- package/core/fetcher/signals.js +2 -3
- package/core/fetcher/stream-wrappers/NodePre18StreamWrapper.d.ts +0 -1
- package/core/fetcher/stream-wrappers/NodePre18StreamWrapper.js +6 -4
- package/core/fetcher/stream-wrappers/UndiciStreamWrapper.d.ts +1 -1
- package/core/fetcher/stream-wrappers/chooseStreamWrapper.d.ts +1 -1
- package/core/fetcher/stream-wrappers/chooseStreamWrapper.js +18 -9
- package/core/form-data-utils/FormDataWrapper.d.ts +4 -4
- package/core/form-data-utils/FormDataWrapper.js +22 -12
- package/core/index.js +17 -7
- package/core/json.d.ts +15 -0
- package/core/json.js +24 -0
- package/core/runtime/runtime.d.ts +1 -1
- package/core/runtime/runtime.js +51 -41
- package/core/schemas/Schema.d.ts +7 -5
- package/core/schemas/Schema.js +2 -0
- package/core/schemas/builders/bigint/bigint.d.ts +1 -1
- package/core/schemas/builders/bigint/bigint.js +22 -19
- package/core/schemas/builders/date/date.js +1 -2
- package/core/schemas/builders/enum/enum.js +1 -2
- package/core/schemas/builders/lazy/lazy.d.ts +1 -1
- package/core/schemas/builders/lazy/lazy.js +3 -4
- package/core/schemas/builders/lazy/lazyObject.js +1 -2
- package/core/schemas/builders/list/list.js +1 -2
- package/core/schemas/builders/literals/booleanLiteral.js +1 -2
- package/core/schemas/builders/literals/stringLiteral.js +1 -2
- package/core/schemas/builders/object/object.d.ts +1 -1
- package/core/schemas/builders/object/object.js +31 -3
- package/core/schemas/builders/object/objectWithoutOptionalProperties.d.ts +3 -3
- package/core/schemas/builders/object/objectWithoutOptionalProperties.js +1 -2
- package/core/schemas/builders/object/property.js +2 -3
- package/core/schemas/builders/object/types.d.ts +16 -11
- package/core/schemas/builders/object-like/getObjectLikeUtils.js +2 -3
- package/core/schemas/builders/object-like/types.d.ts +1 -1
- package/core/schemas/builders/record/record.js +2 -4
- package/core/schemas/builders/record/types.d.ts +2 -2
- package/core/schemas/builders/schema-utils/getSchemaUtils.d.ts +4 -0
- package/core/schemas/builders/schema-utils/getSchemaUtils.js +67 -4
- package/core/schemas/builders/schema-utils/stringifyValidationErrors.js +1 -2
- package/core/schemas/builders/set/set.js +1 -2
- package/core/schemas/builders/undiscriminated-union/types.d.ts +4 -4
- package/core/schemas/builders/undiscriminated-union/undiscriminatedUnion.js +1 -2
- package/core/schemas/builders/union/discriminant.js +1 -2
- package/core/schemas/builders/union/types.d.ts +6 -6
- package/core/schemas/builders/union/union.d.ts +1 -1
- package/core/schemas/builders/union/union.js +1 -2
- package/core/schemas/utils/MaybePromise.d.ts +1 -1
- package/core/schemas/utils/addQuestionMarksToNullableProperties.d.ts +4 -4
- package/core/schemas/utils/createIdentitySchemaCreator.js +1 -2
- package/core/schemas/utils/entries.d.ts +1 -1
- package/core/schemas/utils/entries.js +1 -2
- package/core/schemas/utils/filterObject.d.ts +1 -1
- package/core/schemas/utils/filterObject.js +1 -2
- package/core/schemas/utils/getErrorMessageForIncorrectType.js +1 -2
- package/core/schemas/utils/isPlainObject.js +1 -2
- package/core/schemas/utils/keys.d.ts +1 -1
- package/core/schemas/utils/keys.js +1 -2
- package/core/schemas/utils/maybeSkipValidation.js +1 -2
- package/core/schemas/utils/partition.js +1 -2
- package/core/streaming-fetcher/Stream.d.ts +0 -1
- package/core/streaming-fetcher/Stream.js +20 -21
- package/core/websocket/ws.d.ts +7 -7
- package/core/websocket/ws.js +17 -7
- package/dist/Client.d.ts +12 -5
- package/dist/Client.js +11 -6
- package/dist/api/resources/apiStatus/client/Client.d.ts +4 -0
- package/dist/api/resources/apiStatus/client/Client.js +21 -11
- package/dist/api/resources/datasets/client/Client.d.ts +4 -1
- package/dist/api/resources/datasets/client/Client.js +34 -24
- package/dist/api/resources/datasets/types/FilePurpose.d.ts +1 -1
- package/dist/api/resources/embedding/types/Embedding.d.ts +1 -1
- package/dist/api/resources/index.d.ts +2 -0
- package/dist/api/resources/index.js +20 -8
- package/dist/api/resources/infill/client/Client.d.ts +49 -0
- package/dist/api/resources/infill/client/Client.js +148 -0
- package/dist/api/resources/infill/client/index.d.ts +1 -0
- package/dist/api/resources/infill/client/index.js +17 -0
- package/dist/api/resources/infill/client/requests/InfillBytesRequest.d.ts +71 -0
- package/dist/api/resources/infill/client/requests/InfillBytesRequest.js +5 -0
- package/dist/api/resources/infill/client/requests/index.d.ts +1 -0
- package/dist/api/resources/infill/client/requests/index.js +2 -0
- package/dist/api/resources/infill/index.d.ts +1 -0
- package/dist/api/resources/infill/index.js +17 -0
- package/dist/api/resources/tts/client/Client.js +21 -11
- package/dist/api/resources/tts/types/ContextId.d.ts +1 -1
- package/dist/api/resources/tts/types/Emotion.d.ts +5 -1
- package/dist/api/resources/tts/types/Emotion.js +4 -0
- package/dist/api/resources/tts/types/FlushId.d.ts +9 -0
- package/dist/api/resources/tts/types/FlushId.js +5 -0
- package/dist/api/resources/tts/types/GenerationRequest.d.ts +7 -2
- package/dist/api/resources/tts/types/NaturalSpecifier.d.ts +1 -1
- package/dist/api/resources/tts/types/NumericalSpecifier.d.ts +1 -1
- package/dist/api/resources/tts/types/OutputFormat.d.ts +1 -1
- package/dist/api/resources/tts/types/PhonemeTimestamps.d.ts +8 -0
- package/dist/api/resources/tts/types/PhonemeTimestamps.js +5 -0
- package/dist/api/resources/tts/types/RawEncoding.d.ts +1 -1
- package/dist/api/resources/tts/types/RawOutputFormat.d.ts +1 -0
- package/dist/api/resources/tts/types/Speed.d.ts +1 -1
- package/dist/api/resources/tts/types/SupportedLanguage.d.ts +1 -1
- package/dist/api/resources/tts/types/TtsRequestVoiceSpecifier.d.ts +1 -1
- package/dist/api/resources/tts/types/WebSocketFlushDoneResponse.d.ts +8 -0
- package/dist/api/resources/tts/types/WebSocketFlushDoneResponse.js +5 -0
- package/dist/api/resources/tts/types/WebSocketPhonemeTimestampsResponse.d.ts +7 -0
- package/dist/api/resources/tts/types/WebSocketPhonemeTimestampsResponse.js +5 -0
- package/dist/api/resources/tts/types/WebSocketRequest.d.ts +1 -1
- package/dist/api/resources/tts/types/WebSocketResponse.d.ts +7 -1
- package/dist/api/resources/tts/types/WebSocketTtsOutput.d.ts +3 -0
- package/dist/api/resources/tts/types/WebSocketTtsRequest.d.ts +1 -0
- package/dist/api/resources/tts/types/index.d.ts +4 -0
- package/dist/api/resources/tts/types/index.js +4 -0
- package/dist/api/resources/voiceChanger/client/Client.d.ts +3 -4
- package/dist/api/resources/voiceChanger/client/Client.js +23 -13
- package/dist/api/resources/voiceChanger/types/OutputFormatContainer.d.ts +1 -1
- package/dist/api/resources/voiceChanger/types/StreamingResponse.d.ts +1 -1
- package/dist/api/resources/voices/client/Client.d.ts +5 -3
- package/dist/api/resources/voices/client/Client.js +56 -47
- package/dist/api/resources/voices/types/BaseVoiceId.d.ts +1 -1
- package/dist/api/resources/voices/types/CloneMode.d.ts +1 -1
- package/dist/api/resources/voices/types/CreateVoiceRequest.d.ts +0 -1
- package/dist/api/resources/voices/types/Gender.d.ts +1 -1
- package/dist/api/resources/voices/types/LocalizeDialect.d.ts +12 -4
- package/dist/api/resources/voices/types/LocalizeEnglishDialect.d.ts +1 -1
- package/dist/api/resources/voices/types/LocalizePortugueseDialect.d.ts +8 -0
- package/dist/api/resources/voices/types/LocalizePortugueseDialect.js +10 -0
- package/dist/api/resources/voices/types/LocalizeSpanishDialect.d.ts +8 -0
- package/dist/api/resources/voices/types/LocalizeSpanishDialect.js +10 -0
- package/dist/api/resources/voices/types/LocalizeTargetLanguage.d.ts +1 -1
- package/dist/api/resources/voices/types/MixVoiceSpecifier.d.ts +1 -1
- package/dist/api/resources/voices/types/Voice.d.ts +0 -1
- package/dist/api/resources/voices/types/VoiceId.d.ts +1 -1
- package/dist/api/resources/voices/types/Weight.d.ts +1 -1
- package/dist/api/resources/voices/types/index.d.ts +2 -0
- package/dist/api/resources/voices/types/index.js +2 -0
- package/dist/core/fetcher/APIResponse.d.ts +1 -1
- package/dist/core/fetcher/Fetcher.d.ts +1 -1
- package/dist/core/fetcher/Fetcher.js +2 -2
- package/dist/core/fetcher/Supplier.d.ts +1 -1
- package/dist/core/fetcher/createRequestUrl.d.ts +1 -1
- package/dist/core/fetcher/createRequestUrl.js +1 -2
- package/dist/core/fetcher/getFetchFn.js +18 -9
- package/dist/core/fetcher/getHeader.js +1 -2
- package/dist/core/fetcher/getRequestBody.js +5 -5
- package/dist/core/fetcher/getResponseBody.js +1 -2
- package/dist/core/fetcher/makeRequest.d.ts +1 -1
- package/dist/core/fetcher/requestWithRetries.js +4 -5
- package/dist/core/fetcher/signals.d.ts +0 -1
- package/dist/core/fetcher/signals.js +2 -3
- package/dist/core/fetcher/stream-wrappers/NodePre18StreamWrapper.d.ts +0 -1
- package/dist/core/fetcher/stream-wrappers/NodePre18StreamWrapper.js +6 -4
- package/dist/core/fetcher/stream-wrappers/UndiciStreamWrapper.d.ts +1 -1
- package/dist/core/fetcher/stream-wrappers/chooseStreamWrapper.d.ts +1 -1
- package/dist/core/fetcher/stream-wrappers/chooseStreamWrapper.js +18 -9
- package/dist/core/form-data-utils/FormDataWrapper.d.ts +4 -4
- package/dist/core/form-data-utils/FormDataWrapper.js +22 -12
- package/dist/core/index.js +17 -7
- package/dist/core/json.d.ts +15 -0
- package/dist/core/json.js +24 -0
- package/dist/core/runtime/runtime.d.ts +1 -1
- package/dist/core/runtime/runtime.js +51 -41
- package/dist/core/schemas/Schema.d.ts +7 -5
- package/dist/core/schemas/Schema.js +2 -0
- package/dist/core/schemas/builders/bigint/bigint.d.ts +1 -1
- package/dist/core/schemas/builders/bigint/bigint.js +22 -19
- package/dist/core/schemas/builders/date/date.js +1 -2
- package/dist/core/schemas/builders/enum/enum.js +1 -2
- package/dist/core/schemas/builders/lazy/lazy.d.ts +1 -1
- package/dist/core/schemas/builders/lazy/lazy.js +3 -4
- package/dist/core/schemas/builders/lazy/lazyObject.js +1 -2
- package/dist/core/schemas/builders/list/list.js +1 -2
- package/dist/core/schemas/builders/literals/booleanLiteral.js +1 -2
- package/dist/core/schemas/builders/literals/stringLiteral.js +1 -2
- package/dist/core/schemas/builders/object/object.d.ts +1 -1
- package/dist/core/schemas/builders/object/object.js +31 -3
- package/dist/core/schemas/builders/object/objectWithoutOptionalProperties.d.ts +3 -3
- package/dist/core/schemas/builders/object/objectWithoutOptionalProperties.js +1 -2
- package/dist/core/schemas/builders/object/property.js +2 -3
- package/dist/core/schemas/builders/object/types.d.ts +16 -11
- package/dist/core/schemas/builders/object-like/getObjectLikeUtils.js +2 -3
- package/dist/core/schemas/builders/object-like/types.d.ts +1 -1
- package/dist/core/schemas/builders/record/record.js +2 -4
- package/dist/core/schemas/builders/record/types.d.ts +2 -2
- package/dist/core/schemas/builders/schema-utils/getSchemaUtils.d.ts +4 -0
- package/dist/core/schemas/builders/schema-utils/getSchemaUtils.js +67 -4
- package/dist/core/schemas/builders/schema-utils/stringifyValidationErrors.js +1 -2
- package/dist/core/schemas/builders/set/set.js +1 -2
- package/dist/core/schemas/builders/undiscriminated-union/types.d.ts +4 -4
- package/dist/core/schemas/builders/undiscriminated-union/undiscriminatedUnion.js +1 -2
- package/dist/core/schemas/builders/union/discriminant.js +1 -2
- package/dist/core/schemas/builders/union/types.d.ts +6 -6
- package/dist/core/schemas/builders/union/union.d.ts +1 -1
- package/dist/core/schemas/builders/union/union.js +1 -2
- package/dist/core/schemas/utils/MaybePromise.d.ts +1 -1
- package/dist/core/schemas/utils/addQuestionMarksToNullableProperties.d.ts +4 -4
- package/dist/core/schemas/utils/createIdentitySchemaCreator.js +1 -2
- package/dist/core/schemas/utils/entries.d.ts +1 -1
- package/dist/core/schemas/utils/entries.js +1 -2
- package/dist/core/schemas/utils/filterObject.d.ts +1 -1
- package/dist/core/schemas/utils/filterObject.js +1 -2
- package/dist/core/schemas/utils/getErrorMessageForIncorrectType.js +1 -2
- package/dist/core/schemas/utils/isPlainObject.js +1 -2
- package/dist/core/schemas/utils/keys.d.ts +1 -1
- package/dist/core/schemas/utils/keys.js +1 -2
- package/dist/core/schemas/utils/maybeSkipValidation.js +1 -2
- package/dist/core/schemas/utils/partition.js +1 -2
- package/dist/core/streaming-fetcher/Stream.d.ts +0 -1
- package/dist/core/streaming-fetcher/Stream.js +20 -21
- package/dist/core/websocket/ws.d.ts +7 -7
- package/dist/core/websocket/ws.js +17 -7
- package/dist/environments.d.ts +1 -1
- package/dist/errors/CartesiaError.js +2 -1
- package/dist/errors/CartesiaTimeoutError.d.ts +1 -1
- package/dist/errors/CartesiaTimeoutError.js +2 -2
- package/dist/index.js +17 -7
- package/dist/serialization/resources/apiStatus/types/ApiInfo.js +17 -7
- package/dist/serialization/resources/datasets/types/CreateDatasetRequest.js +17 -7
- package/dist/serialization/resources/datasets/types/Dataset.js +17 -7
- package/dist/serialization/resources/datasets/types/DatasetFile.js +17 -7
- package/dist/serialization/resources/datasets/types/FilePurpose.js +17 -7
- package/dist/serialization/resources/datasets/types/PaginatedDatasetFiles.js +17 -7
- package/dist/serialization/resources/datasets/types/PaginatedDatasets.js +17 -7
- package/dist/serialization/resources/embedding/types/Embedding.js +17 -7
- package/dist/serialization/resources/index.js +17 -7
- package/dist/serialization/resources/tts/types/CancelContextRequest.js +17 -7
- package/dist/serialization/resources/tts/types/ContextId.js +17 -7
- package/dist/serialization/resources/tts/types/Controls.js +17 -7
- package/dist/serialization/resources/tts/types/Emotion.d.ts +1 -1
- package/dist/serialization/resources/tts/types/Emotion.js +21 -7
- package/dist/serialization/resources/tts/types/FlushId.d.ts +10 -0
- package/dist/serialization/resources/tts/types/FlushId.js +41 -0
- package/dist/serialization/resources/tts/types/GenerationRequest.d.ts +4 -2
- package/dist/serialization/resources/tts/types/GenerationRequest.js +21 -9
- package/dist/serialization/resources/tts/types/Mp3OutputFormat.js +17 -7
- package/dist/serialization/resources/tts/types/NaturalSpecifier.js +17 -7
- package/dist/serialization/resources/tts/types/NumericalSpecifier.js +17 -7
- package/dist/serialization/resources/tts/types/OutputFormat.js +17 -7
- package/dist/serialization/resources/tts/types/PhonemeTimestamps.d.ts +14 -0
- package/dist/serialization/resources/tts/types/PhonemeTimestamps.js +45 -0
- package/dist/serialization/resources/tts/types/RawEncoding.js +17 -7
- package/dist/serialization/resources/tts/types/RawOutputFormat.d.ts +1 -0
- package/dist/serialization/resources/tts/types/RawOutputFormat.js +18 -7
- package/dist/serialization/resources/tts/types/Speed.js +17 -7
- package/dist/serialization/resources/tts/types/SupportedLanguage.js +17 -7
- package/dist/serialization/resources/tts/types/TtsRequest.js +17 -7
- package/dist/serialization/resources/tts/types/TtsRequestEmbeddingSpecifier.js +17 -7
- package/dist/serialization/resources/tts/types/TtsRequestIdSpecifier.js +17 -7
- package/dist/serialization/resources/tts/types/TtsRequestVoiceSpecifier.js +17 -7
- package/dist/serialization/resources/tts/types/WavOutputFormat.js +17 -7
- package/dist/serialization/resources/tts/types/WebSocketBaseResponse.js +17 -7
- package/dist/serialization/resources/tts/types/WebSocketChunkResponse.js +17 -7
- package/dist/serialization/resources/tts/types/WebSocketDoneResponse.js +17 -7
- package/dist/serialization/resources/tts/types/WebSocketErrorResponse.js +17 -7
- package/dist/serialization/resources/tts/types/WebSocketFlushDoneResponse.d.ts +15 -0
- package/dist/serialization/resources/tts/types/WebSocketFlushDoneResponse.js +48 -0
- package/dist/serialization/resources/tts/types/WebSocketPhonemeTimestampsResponse.d.ts +14 -0
- package/dist/serialization/resources/tts/types/WebSocketPhonemeTimestampsResponse.js +47 -0
- package/dist/serialization/resources/tts/types/WebSocketRawOutputFormat.js +17 -7
- package/dist/serialization/resources/tts/types/WebSocketRequest.js +17 -7
- package/dist/serialization/resources/tts/types/WebSocketResponse.d.ts +9 -1
- package/dist/serialization/resources/tts/types/WebSocketResponse.js +21 -7
- package/dist/serialization/resources/tts/types/WebSocketStreamOptions.js +17 -7
- package/dist/serialization/resources/tts/types/WebSocketTimestampsResponse.js +17 -7
- package/dist/serialization/resources/tts/types/WebSocketTtsOutput.d.ts +5 -0
- package/dist/serialization/resources/tts/types/WebSocketTtsOutput.js +22 -7
- package/dist/serialization/resources/tts/types/WebSocketTtsRequest.d.ts +1 -0
- package/dist/serialization/resources/tts/types/WebSocketTtsRequest.js +18 -7
- package/dist/serialization/resources/tts/types/WordTimestamps.js +17 -7
- package/dist/serialization/resources/tts/types/index.d.ts +4 -0
- package/dist/serialization/resources/tts/types/index.js +4 -0
- package/dist/serialization/resources/voiceChanger/types/OutputFormatContainer.js +17 -7
- package/dist/serialization/resources/voiceChanger/types/StreamingResponse.js +17 -7
- package/dist/serialization/resources/voices/client/index.js +17 -7
- package/dist/serialization/resources/voices/client/list.js +17 -7
- package/dist/serialization/resources/voices/types/CloneMode.js +17 -7
- package/dist/serialization/resources/voices/types/CreateVoiceRequest.d.ts +0 -2
- package/dist/serialization/resources/voices/types/CreateVoiceRequest.js +17 -9
- package/dist/serialization/resources/voices/types/EmbeddingResponse.js +17 -7
- package/dist/serialization/resources/voices/types/EmbeddingSpecifier.js +17 -7
- package/dist/serialization/resources/voices/types/Gender.js +17 -7
- package/dist/serialization/resources/voices/types/IdSpecifier.js +17 -7
- package/dist/serialization/resources/voices/types/LocalizeDialect.d.ts +3 -1
- package/dist/serialization/resources/voices/types/LocalizeDialect.js +24 -8
- package/dist/serialization/resources/voices/types/LocalizeEnglishDialect.js +17 -7
- package/dist/serialization/resources/voices/types/LocalizePortugueseDialect.d.ts +10 -0
- package/dist/serialization/resources/voices/types/LocalizePortugueseDialect.js +41 -0
- package/dist/serialization/resources/voices/types/LocalizeSpanishDialect.d.ts +10 -0
- package/dist/serialization/resources/voices/types/LocalizeSpanishDialect.js +41 -0
- package/dist/serialization/resources/voices/types/LocalizeTargetLanguage.js +17 -7
- package/dist/serialization/resources/voices/types/LocalizeVoiceRequest.js +17 -7
- package/dist/serialization/resources/voices/types/MixVoiceSpecifier.js +17 -7
- package/dist/serialization/resources/voices/types/MixVoicesRequest.js +17 -7
- package/dist/serialization/resources/voices/types/UpdateVoiceRequest.js +17 -7
- package/dist/serialization/resources/voices/types/Voice.d.ts +0 -2
- package/dist/serialization/resources/voices/types/Voice.js +17 -9
- package/dist/serialization/resources/voices/types/VoiceId.js +17 -7
- package/dist/serialization/resources/voices/types/VoiceMetadata.js +17 -7
- package/dist/serialization/resources/voices/types/Weight.js +17 -7
- package/dist/serialization/resources/voices/types/index.d.ts +2 -0
- package/dist/serialization/resources/voices/types/index.js +2 -0
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/dist/wrapper/WebPlayer.js +1 -1
- package/dist/wrapper/Websocket.js +25 -15
- package/dist/wrapper/source.js +1 -1
- package/dist/wrapper/utils.d.ts +9 -9
- package/dist/wrapper/utils.js +10 -10
- package/environments.d.ts +1 -1
- package/errors/CartesiaError.js +2 -1
- package/errors/CartesiaTimeoutError.d.ts +1 -1
- package/errors/CartesiaTimeoutError.js +2 -2
- package/index.js +17 -7
- package/{jest.config.js → jest.config.mjs} +4 -1
- package/package.json +15 -16
- package/reference.md +97 -1
- package/scripts/rename-to-esm-files.js +115 -0
- package/serialization/resources/apiStatus/types/ApiInfo.js +17 -7
- package/serialization/resources/datasets/types/CreateDatasetRequest.js +17 -7
- package/serialization/resources/datasets/types/Dataset.js +17 -7
- package/serialization/resources/datasets/types/DatasetFile.js +17 -7
- package/serialization/resources/datasets/types/FilePurpose.js +17 -7
- package/serialization/resources/datasets/types/PaginatedDatasetFiles.js +17 -7
- package/serialization/resources/datasets/types/PaginatedDatasets.js +17 -7
- package/serialization/resources/embedding/types/Embedding.js +17 -7
- package/serialization/resources/index.js +17 -7
- package/serialization/resources/tts/types/CancelContextRequest.js +17 -7
- package/serialization/resources/tts/types/ContextId.js +17 -7
- package/serialization/resources/tts/types/Controls.js +17 -7
- package/serialization/resources/tts/types/Emotion.d.ts +1 -1
- package/serialization/resources/tts/types/Emotion.js +21 -7
- package/serialization/resources/tts/types/FlushId.d.ts +10 -0
- package/serialization/resources/tts/types/FlushId.js +41 -0
- package/serialization/resources/tts/types/GenerationRequest.d.ts +4 -2
- package/serialization/resources/tts/types/GenerationRequest.js +21 -9
- package/serialization/resources/tts/types/Mp3OutputFormat.js +17 -7
- package/serialization/resources/tts/types/NaturalSpecifier.js +17 -7
- package/serialization/resources/tts/types/NumericalSpecifier.js +17 -7
- package/serialization/resources/tts/types/OutputFormat.js +17 -7
- package/serialization/resources/tts/types/PhonemeTimestamps.d.ts +14 -0
- package/serialization/resources/tts/types/PhonemeTimestamps.js +45 -0
- package/serialization/resources/tts/types/RawEncoding.js +17 -7
- package/serialization/resources/tts/types/RawOutputFormat.d.ts +1 -0
- package/serialization/resources/tts/types/RawOutputFormat.js +18 -7
- package/serialization/resources/tts/types/Speed.js +17 -7
- package/serialization/resources/tts/types/SupportedLanguage.js +17 -7
- package/serialization/resources/tts/types/TtsRequest.js +17 -7
- package/serialization/resources/tts/types/TtsRequestEmbeddingSpecifier.js +17 -7
- package/serialization/resources/tts/types/TtsRequestIdSpecifier.js +17 -7
- package/serialization/resources/tts/types/TtsRequestVoiceSpecifier.js +17 -7
- package/serialization/resources/tts/types/WavOutputFormat.js +17 -7
- package/serialization/resources/tts/types/WebSocketBaseResponse.js +17 -7
- package/serialization/resources/tts/types/WebSocketChunkResponse.js +17 -7
- package/serialization/resources/tts/types/WebSocketDoneResponse.js +17 -7
- package/serialization/resources/tts/types/WebSocketErrorResponse.js +17 -7
- package/serialization/resources/tts/types/WebSocketFlushDoneResponse.d.ts +15 -0
- package/serialization/resources/tts/types/WebSocketFlushDoneResponse.js +48 -0
- package/serialization/resources/tts/types/WebSocketPhonemeTimestampsResponse.d.ts +14 -0
- package/serialization/resources/tts/types/WebSocketPhonemeTimestampsResponse.js +47 -0
- package/serialization/resources/tts/types/WebSocketRawOutputFormat.js +17 -7
- package/serialization/resources/tts/types/WebSocketRequest.js +17 -7
- package/serialization/resources/tts/types/WebSocketResponse.d.ts +9 -1
- package/serialization/resources/tts/types/WebSocketResponse.js +21 -7
- package/serialization/resources/tts/types/WebSocketStreamOptions.js +17 -7
- package/serialization/resources/tts/types/WebSocketTimestampsResponse.js +17 -7
- package/serialization/resources/tts/types/WebSocketTtsOutput.d.ts +5 -0
- package/serialization/resources/tts/types/WebSocketTtsOutput.js +22 -7
- package/serialization/resources/tts/types/WebSocketTtsRequest.d.ts +1 -0
- package/serialization/resources/tts/types/WebSocketTtsRequest.js +18 -7
- package/serialization/resources/tts/types/WordTimestamps.js +17 -7
- package/serialization/resources/tts/types/index.d.ts +4 -0
- package/serialization/resources/tts/types/index.js +4 -0
- package/serialization/resources/voiceChanger/types/OutputFormatContainer.js +17 -7
- package/serialization/resources/voiceChanger/types/StreamingResponse.js +17 -7
- package/serialization/resources/voices/client/index.js +17 -7
- package/serialization/resources/voices/client/list.js +17 -7
- package/serialization/resources/voices/types/CloneMode.js +17 -7
- package/serialization/resources/voices/types/CreateVoiceRequest.d.ts +0 -2
- package/serialization/resources/voices/types/CreateVoiceRequest.js +17 -9
- package/serialization/resources/voices/types/EmbeddingResponse.js +17 -7
- package/serialization/resources/voices/types/EmbeddingSpecifier.js +17 -7
- package/serialization/resources/voices/types/Gender.js +17 -7
- package/serialization/resources/voices/types/IdSpecifier.js +17 -7
- package/serialization/resources/voices/types/LocalizeDialect.d.ts +3 -1
- package/serialization/resources/voices/types/LocalizeDialect.js +24 -8
- package/serialization/resources/voices/types/LocalizeEnglishDialect.js +17 -7
- package/serialization/resources/voices/types/LocalizePortugueseDialect.d.ts +10 -0
- package/serialization/resources/voices/types/LocalizePortugueseDialect.js +41 -0
- package/serialization/resources/voices/types/LocalizeSpanishDialect.d.ts +10 -0
- package/serialization/resources/voices/types/LocalizeSpanishDialect.js +41 -0
- package/serialization/resources/voices/types/LocalizeTargetLanguage.js +17 -7
- package/serialization/resources/voices/types/LocalizeVoiceRequest.js +17 -7
- package/serialization/resources/voices/types/MixVoiceSpecifier.js +17 -7
- package/serialization/resources/voices/types/MixVoicesRequest.js +17 -7
- package/serialization/resources/voices/types/UpdateVoiceRequest.js +17 -7
- package/serialization/resources/voices/types/Voice.d.ts +0 -2
- package/serialization/resources/voices/types/Voice.js +17 -9
- package/serialization/resources/voices/types/VoiceId.js +17 -7
- package/serialization/resources/voices/types/VoiceMetadata.js +17 -7
- package/serialization/resources/voices/types/Weight.js +17 -7
- package/serialization/resources/voices/types/index.d.ts +2 -0
- package/serialization/resources/voices/types/index.js +2 -0
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/wrapper/WebPlayer.js +1 -1
- package/wrapper/Websocket.js +25 -15
- package/wrapper/source.js +1 -1
- package/wrapper/utils.d.ts +9 -9
- package/wrapper/utils.js +10 -10
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
*/
|
|
4
|
+
import * as Cartesia from "../../../index";
|
|
5
|
+
export interface WebSocketPhonemeTimestampsResponse extends Cartesia.WebSocketBaseResponse {
|
|
6
|
+
phonemeTimestamps?: Cartesia.PhonemeTimestamps;
|
|
7
|
+
}
|
|
@@ -2,11 +2,14 @@
|
|
|
2
2
|
* This file was auto-generated by Fern from our API Definition.
|
|
3
3
|
*/
|
|
4
4
|
import * as Cartesia from "../../../index";
|
|
5
|
-
export
|
|
5
|
+
export type WebSocketResponse = Cartesia.WebSocketResponse.Chunk | Cartesia.WebSocketResponse.FlushDone | Cartesia.WebSocketResponse.Done | Cartesia.WebSocketResponse.Timestamps | Cartesia.WebSocketResponse.Error_ | Cartesia.WebSocketResponse.PhonemeTimestamps;
|
|
6
6
|
export declare namespace WebSocketResponse {
|
|
7
7
|
interface Chunk extends Cartesia.WebSocketChunkResponse {
|
|
8
8
|
type: "chunk";
|
|
9
9
|
}
|
|
10
|
+
interface FlushDone extends Cartesia.WebSocketFlushDoneResponse {
|
|
11
|
+
type: "flush_done";
|
|
12
|
+
}
|
|
10
13
|
interface Done extends Cartesia.WebSocketDoneResponse {
|
|
11
14
|
type: "done";
|
|
12
15
|
}
|
|
@@ -16,4 +19,7 @@ export declare namespace WebSocketResponse {
|
|
|
16
19
|
interface Error_ extends Cartesia.WebSocketErrorResponse {
|
|
17
20
|
type: "error";
|
|
18
21
|
}
|
|
22
|
+
interface PhonemeTimestamps extends Cartesia.WebSocketPhonemeTimestampsResponse {
|
|
23
|
+
type: "phoneme_timestamps";
|
|
24
|
+
}
|
|
19
25
|
}
|
|
@@ -4,6 +4,9 @@
|
|
|
4
4
|
import * as Cartesia from "../../../index";
|
|
5
5
|
export interface WebSocketTtsOutput {
|
|
6
6
|
wordTimestamps?: Cartesia.WordTimestamps;
|
|
7
|
+
phonemeTimestamps?: Cartesia.PhonemeTimestamps;
|
|
7
8
|
audio?: unknown;
|
|
8
9
|
contextId?: Cartesia.ContextId;
|
|
10
|
+
flushId?: Cartesia.FlushId;
|
|
11
|
+
flushDone?: boolean;
|
|
9
12
|
}
|
|
@@ -1,13 +1,17 @@
|
|
|
1
1
|
export * from "./ContextId";
|
|
2
|
+
export * from "./FlushId";
|
|
2
3
|
export * from "./WebSocketBaseResponse";
|
|
3
4
|
export * from "./WebSocketResponse";
|
|
4
5
|
export * from "./WebSocketErrorResponse";
|
|
5
6
|
export * from "./WebSocketChunkResponse";
|
|
6
7
|
export * from "./WebSocketTimestampsResponse";
|
|
8
|
+
export * from "./WebSocketPhonemeTimestampsResponse";
|
|
7
9
|
export * from "./WebSocketTtsOutput";
|
|
8
10
|
export * from "./WebSocketStreamOptions";
|
|
9
11
|
export * from "./WordTimestamps";
|
|
12
|
+
export * from "./PhonemeTimestamps";
|
|
10
13
|
export * from "./WebSocketDoneResponse";
|
|
14
|
+
export * from "./WebSocketFlushDoneResponse";
|
|
11
15
|
export * from "./CancelContextRequest";
|
|
12
16
|
export * from "./GenerationRequest";
|
|
13
17
|
export * from "./WebSocketRawOutputFormat";
|
|
@@ -15,15 +15,19 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
__exportStar(require("./ContextId"), exports);
|
|
18
|
+
__exportStar(require("./FlushId"), exports);
|
|
18
19
|
__exportStar(require("./WebSocketBaseResponse"), exports);
|
|
19
20
|
__exportStar(require("./WebSocketResponse"), exports);
|
|
20
21
|
__exportStar(require("./WebSocketErrorResponse"), exports);
|
|
21
22
|
__exportStar(require("./WebSocketChunkResponse"), exports);
|
|
22
23
|
__exportStar(require("./WebSocketTimestampsResponse"), exports);
|
|
24
|
+
__exportStar(require("./WebSocketPhonemeTimestampsResponse"), exports);
|
|
23
25
|
__exportStar(require("./WebSocketTtsOutput"), exports);
|
|
24
26
|
__exportStar(require("./WebSocketStreamOptions"), exports);
|
|
25
27
|
__exportStar(require("./WordTimestamps"), exports);
|
|
28
|
+
__exportStar(require("./PhonemeTimestamps"), exports);
|
|
26
29
|
__exportStar(require("./WebSocketDoneResponse"), exports);
|
|
30
|
+
__exportStar(require("./WebSocketFlushDoneResponse"), exports);
|
|
27
31
|
__exportStar(require("./CancelContextRequest"), exports);
|
|
28
32
|
__exportStar(require("./GenerationRequest"), exports);
|
|
29
33
|
__exportStar(require("./WebSocketRawOutputFormat"), exports);
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* This file was auto-generated by Fern from our API Definition.
|
|
3
3
|
*/
|
|
4
|
-
/// <reference types="node" />
|
|
5
|
-
import * as environments from "../../../../environments";
|
|
6
|
-
import * as core from "../../../../core";
|
|
7
|
-
import * as fs from "fs";
|
|
8
4
|
import { Blob } from "buffer";
|
|
5
|
+
import * as fs from "fs";
|
|
6
|
+
import * as core from "../../../../core";
|
|
7
|
+
import * as environments from "../../../../environments";
|
|
9
8
|
import * as Cartesia from "../../../index";
|
|
10
9
|
export declare namespace VoiceChanger {
|
|
11
10
|
interface Options {
|
|
@@ -18,13 +18,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
18
18
|
}) : function(o, v) {
|
|
19
19
|
o["default"] = v;
|
|
20
20
|
});
|
|
21
|
-
var __importStar = (this && this.__importStar) || function (
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
};
|
|
21
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
22
|
+
var ownKeys = function(o) {
|
|
23
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
24
|
+
var ar = [];
|
|
25
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
26
|
+
return ar;
|
|
27
|
+
};
|
|
28
|
+
return ownKeys(o);
|
|
29
|
+
};
|
|
30
|
+
return function (mod) {
|
|
31
|
+
if (mod && mod.__esModule) return mod;
|
|
32
|
+
var result = {};
|
|
33
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
34
|
+
__setModuleDefault(result, mod);
|
|
35
|
+
return result;
|
|
36
|
+
};
|
|
37
|
+
})();
|
|
28
38
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
29
39
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
30
40
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
@@ -39,9 +49,9 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
39
49
|
};
|
|
40
50
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
41
51
|
exports.VoiceChanger = void 0;
|
|
42
|
-
const environments = __importStar(require("../../../../environments"));
|
|
43
|
-
const core = __importStar(require("../../../../core"));
|
|
44
52
|
const url_join_1 = __importDefault(require("url-join"));
|
|
53
|
+
const core = __importStar(require("../../../../core"));
|
|
54
|
+
const environments = __importStar(require("../../../../environments"));
|
|
45
55
|
const errors = __importStar(require("../../../../errors/index"));
|
|
46
56
|
const serializers = __importStar(require("../../../../serialization/index"));
|
|
47
57
|
class VoiceChanger {
|
|
@@ -54,8 +64,8 @@ class VoiceChanger {
|
|
|
54
64
|
* This endpoint is priced at 15 characters per second of input audio.
|
|
55
65
|
*/
|
|
56
66
|
bytes(clip, request, requestOptions) {
|
|
57
|
-
var _a, _b, _c, _d, _e;
|
|
58
67
|
return __awaiter(this, void 0, void 0, function* () {
|
|
68
|
+
var _a, _b, _c, _d, _e;
|
|
59
69
|
const _request = yield core.newFormData();
|
|
60
70
|
yield _request.appendFile("clip", clip);
|
|
61
71
|
yield _request.append("voice[id]", request.voiceId);
|
|
@@ -96,7 +106,7 @@ class VoiceChanger {
|
|
|
96
106
|
body: _response.error.rawBody,
|
|
97
107
|
});
|
|
98
108
|
case "timeout":
|
|
99
|
-
throw new errors.CartesiaTimeoutError();
|
|
109
|
+
throw new errors.CartesiaTimeoutError("Timeout exceeded when calling POST /voice-changer/bytes.");
|
|
100
110
|
case "unknown":
|
|
101
111
|
throw new errors.CartesiaError({
|
|
102
112
|
message: _response.error.errorMessage,
|
|
@@ -105,8 +115,8 @@ class VoiceChanger {
|
|
|
105
115
|
});
|
|
106
116
|
}
|
|
107
117
|
sse(clip, request, requestOptions) {
|
|
108
|
-
var _a, _b, _c, _d, _e;
|
|
109
118
|
return __awaiter(this, void 0, void 0, function* () {
|
|
119
|
+
var _a, _b, _c, _d, _e;
|
|
110
120
|
const _request = yield core.newFormData();
|
|
111
121
|
yield _request.appendFile("clip", clip);
|
|
112
122
|
yield _request.append("voice[id]", request.voiceId);
|
|
@@ -163,7 +173,7 @@ class VoiceChanger {
|
|
|
163
173
|
body: _response.error.rawBody,
|
|
164
174
|
});
|
|
165
175
|
case "timeout":
|
|
166
|
-
throw new errors.CartesiaTimeoutError();
|
|
176
|
+
throw new errors.CartesiaTimeoutError("Timeout exceeded when calling POST /voice-changer/sse.");
|
|
167
177
|
case "unknown":
|
|
168
178
|
throw new errors.CartesiaError({
|
|
169
179
|
message: _response.error.errorMessage,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* This file was auto-generated by Fern from our API Definition.
|
|
3
3
|
*/
|
|
4
|
-
export
|
|
4
|
+
export type OutputFormatContainer = "raw" | "wav" | "mp3";
|
|
5
5
|
export declare const OutputFormatContainer: {
|
|
6
6
|
readonly Raw: "raw";
|
|
7
7
|
readonly Wav: "wav";
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* This file was auto-generated by Fern from our API Definition.
|
|
3
3
|
*/
|
|
4
4
|
import * as Cartesia from "../../../index";
|
|
5
|
-
export
|
|
5
|
+
export type StreamingResponse = Cartesia.StreamingResponse.Chunk | Cartesia.StreamingResponse.Done | Cartesia.StreamingResponse.Error_;
|
|
6
6
|
export declare namespace StreamingResponse {
|
|
7
7
|
interface Chunk extends Cartesia.WebSocketChunkResponse {
|
|
8
8
|
type: "chunk";
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* This file was auto-generated by Fern from our API Definition.
|
|
3
3
|
*/
|
|
4
|
-
/// <reference types="node" />
|
|
5
4
|
import * as environments from "../../../../environments";
|
|
6
5
|
import * as core from "../../../../core";
|
|
7
6
|
import * as Cartesia from "../../../index";
|
|
@@ -10,6 +9,8 @@ import { Blob } from "buffer";
|
|
|
10
9
|
export declare namespace Voices {
|
|
11
10
|
interface Options {
|
|
12
11
|
environment?: core.Supplier<environments.CartesiaEnvironment | string>;
|
|
12
|
+
/** Specify a custom URL to connect the client to. */
|
|
13
|
+
baseUrl?: core.Supplier<string>;
|
|
13
14
|
apiKey?: core.Supplier<string | undefined>;
|
|
14
15
|
/** Override the Cartesia-Version header */
|
|
15
16
|
cartesiaVersion?: "2024-06-10";
|
|
@@ -24,6 +25,8 @@ export declare namespace Voices {
|
|
|
24
25
|
abortSignal?: AbortSignal;
|
|
25
26
|
/** Override the Cartesia-Version header */
|
|
26
27
|
cartesiaVersion?: "2024-06-10";
|
|
28
|
+
/** Additional headers to include in the request. */
|
|
29
|
+
headers?: Record<string, string>;
|
|
27
30
|
}
|
|
28
31
|
}
|
|
29
32
|
export declare class Voices {
|
|
@@ -45,8 +48,7 @@ export declare class Voices {
|
|
|
45
48
|
* name: "string",
|
|
46
49
|
* description: "string",
|
|
47
50
|
* embedding: [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1],
|
|
48
|
-
* language: "en"
|
|
49
|
-
* baseVoiceId: "string"
|
|
51
|
+
* language: "en"
|
|
50
52
|
* })
|
|
51
53
|
*/
|
|
52
54
|
create(request: Cartesia.CreateVoiceRequest, requestOptions?: Voices.RequestOptions): Promise<Cartesia.Voice>;
|
|
@@ -18,13 +18,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
18
18
|
}) : function(o, v) {
|
|
19
19
|
o["default"] = v;
|
|
20
20
|
});
|
|
21
|
-
var __importStar = (this && this.__importStar) || function (
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
};
|
|
21
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
22
|
+
var ownKeys = function(o) {
|
|
23
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
24
|
+
var ar = [];
|
|
25
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
26
|
+
return ar;
|
|
27
|
+
};
|
|
28
|
+
return ownKeys(o);
|
|
29
|
+
};
|
|
30
|
+
return function (mod) {
|
|
31
|
+
if (mod && mod.__esModule) return mod;
|
|
32
|
+
var result = {};
|
|
33
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
34
|
+
__setModuleDefault(result, mod);
|
|
35
|
+
return result;
|
|
36
|
+
};
|
|
37
|
+
})();
|
|
28
38
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
29
39
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
30
40
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
@@ -55,12 +65,12 @@ class Voices {
|
|
|
55
65
|
* await client.voices.list()
|
|
56
66
|
*/
|
|
57
67
|
list(requestOptions) {
|
|
58
|
-
var _a, _b, _c, _d, _e;
|
|
59
68
|
return __awaiter(this, void 0, void 0, function* () {
|
|
69
|
+
var _a, _b, _c, _d, _e, _f;
|
|
60
70
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
61
|
-
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.
|
|
71
|
+
url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.CartesiaEnvironment.Production, "/voices/"),
|
|
62
72
|
method: "GET",
|
|
63
|
-
headers: Object.assign({ "Cartesia-Version": (
|
|
73
|
+
headers: Object.assign(Object.assign({ "Cartesia-Version": (_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.cartesiaVersion) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.cartesiaVersion) !== null && _f !== void 0 ? _f : "2024-06-10", "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@cartesia/cartesia-js", "X-Fern-SDK-Version": "2.1.5", "User-Agent": "@cartesia/cartesia-js/2.1.5", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
64
74
|
contentType: "application/json",
|
|
65
75
|
requestType: "json",
|
|
66
76
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
@@ -89,7 +99,7 @@ class Voices {
|
|
|
89
99
|
body: _response.error.rawBody,
|
|
90
100
|
});
|
|
91
101
|
case "timeout":
|
|
92
|
-
throw new errors.CartesiaTimeoutError();
|
|
102
|
+
throw new errors.CartesiaTimeoutError("Timeout exceeded when calling GET /voices/.");
|
|
93
103
|
case "unknown":
|
|
94
104
|
throw new errors.CartesiaError({
|
|
95
105
|
message: _response.error.errorMessage,
|
|
@@ -106,17 +116,16 @@ class Voices {
|
|
|
106
116
|
* name: "string",
|
|
107
117
|
* description: "string",
|
|
108
118
|
* embedding: [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1],
|
|
109
|
-
* language: "en"
|
|
110
|
-
* baseVoiceId: "string"
|
|
119
|
+
* language: "en"
|
|
111
120
|
* })
|
|
112
121
|
*/
|
|
113
122
|
create(request, requestOptions) {
|
|
114
|
-
var _a, _b, _c, _d, _e;
|
|
115
123
|
return __awaiter(this, void 0, void 0, function* () {
|
|
124
|
+
var _a, _b, _c, _d, _e, _f;
|
|
116
125
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
117
|
-
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.
|
|
126
|
+
url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.CartesiaEnvironment.Production, "/voices/"),
|
|
118
127
|
method: "POST",
|
|
119
|
-
headers: Object.assign({ "Cartesia-Version": (
|
|
128
|
+
headers: Object.assign(Object.assign({ "Cartesia-Version": (_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.cartesiaVersion) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.cartesiaVersion) !== null && _f !== void 0 ? _f : "2024-06-10", "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@cartesia/cartesia-js", "X-Fern-SDK-Version": "2.1.5", "User-Agent": "@cartesia/cartesia-js/2.1.5", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
120
129
|
contentType: "application/json",
|
|
121
130
|
requestType: "json",
|
|
122
131
|
body: serializers.CreateVoiceRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
|
@@ -146,7 +155,7 @@ class Voices {
|
|
|
146
155
|
body: _response.error.rawBody,
|
|
147
156
|
});
|
|
148
157
|
case "timeout":
|
|
149
|
-
throw new errors.CartesiaTimeoutError();
|
|
158
|
+
throw new errors.CartesiaTimeoutError("Timeout exceeded when calling POST /voices/.");
|
|
150
159
|
case "unknown":
|
|
151
160
|
throw new errors.CartesiaError({
|
|
152
161
|
message: _response.error.errorMessage,
|
|
@@ -162,12 +171,12 @@ class Voices {
|
|
|
162
171
|
* await client.voices.delete("string")
|
|
163
172
|
*/
|
|
164
173
|
delete(id, requestOptions) {
|
|
165
|
-
var _a, _b, _c, _d, _e;
|
|
166
174
|
return __awaiter(this, void 0, void 0, function* () {
|
|
175
|
+
var _a, _b, _c, _d, _e, _f;
|
|
167
176
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
168
|
-
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.
|
|
177
|
+
url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.CartesiaEnvironment.Production, `/voices/${encodeURIComponent(serializers.VoiceId.jsonOrThrow(id))}`),
|
|
169
178
|
method: "DELETE",
|
|
170
|
-
headers: Object.assign({ "Cartesia-Version": (
|
|
179
|
+
headers: Object.assign(Object.assign({ "Cartesia-Version": (_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.cartesiaVersion) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.cartesiaVersion) !== null && _f !== void 0 ? _f : "2024-06-10", "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@cartesia/cartesia-js", "X-Fern-SDK-Version": "2.1.5", "User-Agent": "@cartesia/cartesia-js/2.1.5", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
171
180
|
contentType: "application/json",
|
|
172
181
|
requestType: "json",
|
|
173
182
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
@@ -190,7 +199,7 @@ class Voices {
|
|
|
190
199
|
body: _response.error.rawBody,
|
|
191
200
|
});
|
|
192
201
|
case "timeout":
|
|
193
|
-
throw new errors.CartesiaTimeoutError();
|
|
202
|
+
throw new errors.CartesiaTimeoutError("Timeout exceeded when calling DELETE /voices/{id}.");
|
|
194
203
|
case "unknown":
|
|
195
204
|
throw new errors.CartesiaError({
|
|
196
205
|
message: _response.error.errorMessage,
|
|
@@ -210,12 +219,12 @@ class Voices {
|
|
|
210
219
|
* })
|
|
211
220
|
*/
|
|
212
221
|
update(id, request, requestOptions) {
|
|
213
|
-
var _a, _b, _c, _d, _e;
|
|
214
222
|
return __awaiter(this, void 0, void 0, function* () {
|
|
223
|
+
var _a, _b, _c, _d, _e, _f;
|
|
215
224
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
216
|
-
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.
|
|
225
|
+
url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.CartesiaEnvironment.Production, `/voices/${encodeURIComponent(serializers.VoiceId.jsonOrThrow(id))}`),
|
|
217
226
|
method: "PATCH",
|
|
218
|
-
headers: Object.assign({ "Cartesia-Version": (
|
|
227
|
+
headers: Object.assign(Object.assign({ "Cartesia-Version": (_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.cartesiaVersion) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.cartesiaVersion) !== null && _f !== void 0 ? _f : "2024-06-10", "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@cartesia/cartesia-js", "X-Fern-SDK-Version": "2.1.5", "User-Agent": "@cartesia/cartesia-js/2.1.5", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
219
228
|
contentType: "application/json",
|
|
220
229
|
requestType: "json",
|
|
221
230
|
body: serializers.UpdateVoiceRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
|
@@ -245,7 +254,7 @@ class Voices {
|
|
|
245
254
|
body: _response.error.rawBody,
|
|
246
255
|
});
|
|
247
256
|
case "timeout":
|
|
248
|
-
throw new errors.CartesiaTimeoutError();
|
|
257
|
+
throw new errors.CartesiaTimeoutError("Timeout exceeded when calling PATCH /voices/{id}.");
|
|
249
258
|
case "unknown":
|
|
250
259
|
throw new errors.CartesiaError({
|
|
251
260
|
message: _response.error.errorMessage,
|
|
@@ -261,12 +270,12 @@ class Voices {
|
|
|
261
270
|
* await client.voices.get("string")
|
|
262
271
|
*/
|
|
263
272
|
get(id, requestOptions) {
|
|
264
|
-
var _a, _b, _c, _d, _e;
|
|
265
273
|
return __awaiter(this, void 0, void 0, function* () {
|
|
274
|
+
var _a, _b, _c, _d, _e, _f;
|
|
266
275
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
267
|
-
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.
|
|
276
|
+
url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.CartesiaEnvironment.Production, `/voices/${encodeURIComponent(serializers.VoiceId.jsonOrThrow(id))}`),
|
|
268
277
|
method: "GET",
|
|
269
|
-
headers: Object.assign({ "Cartesia-Version": (
|
|
278
|
+
headers: Object.assign(Object.assign({ "Cartesia-Version": (_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.cartesiaVersion) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.cartesiaVersion) !== null && _f !== void 0 ? _f : "2024-06-10", "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@cartesia/cartesia-js", "X-Fern-SDK-Version": "2.1.5", "User-Agent": "@cartesia/cartesia-js/2.1.5", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
270
279
|
contentType: "application/json",
|
|
271
280
|
requestType: "json",
|
|
272
281
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
@@ -295,7 +304,7 @@ class Voices {
|
|
|
295
304
|
body: _response.error.rawBody,
|
|
296
305
|
});
|
|
297
306
|
case "timeout":
|
|
298
|
-
throw new errors.CartesiaTimeoutError();
|
|
307
|
+
throw new errors.CartesiaTimeoutError("Timeout exceeded when calling GET /voices/{id}.");
|
|
299
308
|
case "unknown":
|
|
300
309
|
throw new errors.CartesiaError({
|
|
301
310
|
message: _response.error.errorMessage,
|
|
@@ -316,12 +325,12 @@ class Voices {
|
|
|
316
325
|
* })
|
|
317
326
|
*/
|
|
318
327
|
localize(request, requestOptions) {
|
|
319
|
-
var _a, _b, _c, _d, _e;
|
|
320
328
|
return __awaiter(this, void 0, void 0, function* () {
|
|
329
|
+
var _a, _b, _c, _d, _e, _f;
|
|
321
330
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
322
|
-
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.
|
|
331
|
+
url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.CartesiaEnvironment.Production, "/voices/localize"),
|
|
323
332
|
method: "POST",
|
|
324
|
-
headers: Object.assign({ "Cartesia-Version": (
|
|
333
|
+
headers: Object.assign(Object.assign({ "Cartesia-Version": (_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.cartesiaVersion) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.cartesiaVersion) !== null && _f !== void 0 ? _f : "2024-06-10", "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@cartesia/cartesia-js", "X-Fern-SDK-Version": "2.1.5", "User-Agent": "@cartesia/cartesia-js/2.1.5", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
325
334
|
contentType: "application/json",
|
|
326
335
|
requestType: "json",
|
|
327
336
|
body: serializers.LocalizeVoiceRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
|
@@ -351,7 +360,7 @@ class Voices {
|
|
|
351
360
|
body: _response.error.rawBody,
|
|
352
361
|
});
|
|
353
362
|
case "timeout":
|
|
354
|
-
throw new errors.CartesiaTimeoutError();
|
|
363
|
+
throw new errors.CartesiaTimeoutError("Timeout exceeded when calling POST /voices/localize.");
|
|
355
364
|
case "unknown":
|
|
356
365
|
throw new errors.CartesiaError({
|
|
357
366
|
message: _response.error.errorMessage,
|
|
@@ -372,12 +381,12 @@ class Voices {
|
|
|
372
381
|
* })
|
|
373
382
|
*/
|
|
374
383
|
mix(request, requestOptions) {
|
|
375
|
-
var _a, _b, _c, _d, _e;
|
|
376
384
|
return __awaiter(this, void 0, void 0, function* () {
|
|
385
|
+
var _a, _b, _c, _d, _e, _f;
|
|
377
386
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
378
|
-
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.
|
|
387
|
+
url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.CartesiaEnvironment.Production, "/voices/mix"),
|
|
379
388
|
method: "POST",
|
|
380
|
-
headers: Object.assign({ "Cartesia-Version": (
|
|
389
|
+
headers: Object.assign(Object.assign({ "Cartesia-Version": (_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.cartesiaVersion) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.cartesiaVersion) !== null && _f !== void 0 ? _f : "2024-06-10", "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@cartesia/cartesia-js", "X-Fern-SDK-Version": "2.1.5", "User-Agent": "@cartesia/cartesia-js/2.1.5", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
381
390
|
contentType: "application/json",
|
|
382
391
|
requestType: "json",
|
|
383
392
|
body: serializers.MixVoicesRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
|
@@ -407,7 +416,7 @@ class Voices {
|
|
|
407
416
|
body: _response.error.rawBody,
|
|
408
417
|
});
|
|
409
418
|
case "timeout":
|
|
410
|
-
throw new errors.CartesiaTimeoutError();
|
|
419
|
+
throw new errors.CartesiaTimeoutError("Timeout exceeded when calling POST /voices/mix.");
|
|
411
420
|
case "unknown":
|
|
412
421
|
throw new errors.CartesiaError({
|
|
413
422
|
message: _response.error.errorMessage,
|
|
@@ -446,25 +455,25 @@ class Voices {
|
|
|
446
455
|
* })
|
|
447
456
|
*/
|
|
448
457
|
clone(clip, request, requestOptions) {
|
|
449
|
-
var _a, _b, _c, _d, _e;
|
|
450
458
|
return __awaiter(this, void 0, void 0, function* () {
|
|
459
|
+
var _a, _b, _c, _d, _e, _f;
|
|
451
460
|
const _request = yield core.newFormData();
|
|
452
461
|
yield _request.appendFile("clip", clip);
|
|
453
|
-
|
|
462
|
+
_request.append("name", request.name);
|
|
454
463
|
if (request.description != null) {
|
|
455
|
-
|
|
464
|
+
_request.append("description", request.description);
|
|
456
465
|
}
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
466
|
+
_request.append("language", serializers.SupportedLanguage.jsonOrThrow(request.language, { unrecognizedObjectKeys: "strip" }));
|
|
467
|
+
_request.append("mode", serializers.CloneMode.jsonOrThrow(request.mode, { unrecognizedObjectKeys: "strip" }));
|
|
468
|
+
_request.append("enhance", request.enhance.toString());
|
|
460
469
|
if (request.transcript != null) {
|
|
461
|
-
|
|
470
|
+
_request.append("transcript", request.transcript);
|
|
462
471
|
}
|
|
463
472
|
const _maybeEncodedRequest = yield _request.getRequest();
|
|
464
473
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
465
|
-
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.
|
|
474
|
+
url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.CartesiaEnvironment.Production, "/voices/clone"),
|
|
466
475
|
method: "POST",
|
|
467
|
-
headers: Object.assign(Object.assign({ "Cartesia-Version": (
|
|
476
|
+
headers: Object.assign(Object.assign(Object.assign({ "Cartesia-Version": (_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.cartesiaVersion) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.cartesiaVersion) !== null && _f !== void 0 ? _f : "2024-06-10", "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@cartesia/cartesia-js", "X-Fern-SDK-Version": "2.1.5", "User-Agent": "@cartesia/cartesia-js/2.1.5", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), _maybeEncodedRequest.headers), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
468
477
|
requestType: "file",
|
|
469
478
|
duplex: _maybeEncodedRequest.duplex,
|
|
470
479
|
body: _maybeEncodedRequest.body,
|
|
@@ -494,7 +503,7 @@ class Voices {
|
|
|
494
503
|
body: _response.error.rawBody,
|
|
495
504
|
});
|
|
496
505
|
case "timeout":
|
|
497
|
-
throw new errors.CartesiaTimeoutError();
|
|
506
|
+
throw new errors.CartesiaTimeoutError("Timeout exceeded when calling POST /voices/clone.");
|
|
498
507
|
case "unknown":
|
|
499
508
|
throw new errors.CartesiaError({
|
|
500
509
|
message: _response.error.errorMessage,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* This file was auto-generated by Fern from our API Definition.
|
|
3
3
|
*/
|
|
4
|
-
export
|
|
4
|
+
export type CloneMode = "similarity" | "stability";
|
|
5
5
|
export declare const CloneMode: {
|
|
6
6
|
readonly Similarity: "similarity";
|
|
7
7
|
readonly Stability: "stability";
|
|
@@ -3,10 +3,18 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import * as Cartesia from "../../../index";
|
|
5
5
|
/**
|
|
6
|
-
* The dialect to localize to. Only supported for English (`en`).
|
|
6
|
+
* The dialect to localize to. Only supported for English (`en`), Spanish (`es`), and Portuguese (`pt`).
|
|
7
7
|
*/
|
|
8
|
-
export
|
|
8
|
+
export type LocalizeDialect =
|
|
9
9
|
/**
|
|
10
|
-
* Only available when language is set to English (`en`).
|
|
10
|
+
* Only available when language is set to English (`en`). Options: Australian (`au`), Indian (`in`), Southern (`so`), British (`uk`), or American (`us`).
|
|
11
11
|
* */
|
|
12
|
-
Cartesia.LocalizeEnglishDialect
|
|
12
|
+
Cartesia.LocalizeEnglishDialect
|
|
13
|
+
/**
|
|
14
|
+
* Only available when language is set to Spanish (`es`). Options: Mexican (`mx`) and Peninsular (`pe`).
|
|
15
|
+
* */
|
|
16
|
+
| Cartesia.LocalizeSpanishDialect
|
|
17
|
+
/**
|
|
18
|
+
* Only available when language is set to Portuguese (`pt`). Options: Brazilian (`br`) and European Portuguese (`eu`).
|
|
19
|
+
* */
|
|
20
|
+
| Cartesia.LocalizePortugueseDialect;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* This file was auto-generated by Fern from our API Definition.
|
|
3
3
|
*/
|
|
4
|
-
export
|
|
4
|
+
export type LocalizeEnglishDialect = "au" | "in" | "so" | "uk" | "us";
|
|
5
5
|
export declare const LocalizeEnglishDialect: {
|
|
6
6
|
readonly Au: "au";
|
|
7
7
|
readonly In: "in";
|