@cartesia/cartesia-js 2.0.0 → 2.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Client.js +9 -13
- package/api/index.js +1 -17
- package/api/resources/apiStatus/client/Client.js +6 -33
- package/api/resources/apiStatus/client/index.js +1 -2
- package/api/resources/apiStatus/index.js +2 -18
- package/api/resources/apiStatus/types/ApiInfo.js +1 -2
- package/api/resources/apiStatus/types/index.js +1 -17
- package/api/resources/embedding/index.js +1 -17
- package/api/resources/embedding/types/Embedding.js +1 -2
- package/api/resources/embedding/types/index.js +1 -17
- package/api/resources/index.js +12 -41
- package/api/resources/tts/client/Client.js +10 -40
- package/api/resources/tts/client/index.js +1 -2
- package/api/resources/tts/index.js +2 -18
- package/api/resources/tts/types/CancelContextRequest.js +1 -2
- package/api/resources/tts/types/ContextId.js +1 -2
- package/api/resources/tts/types/Controls.js +1 -2
- package/api/resources/tts/types/Emotion.js +1 -4
- package/api/resources/tts/types/GenerationRequest.js +1 -2
- package/api/resources/tts/types/Mp3OutputFormat.js +1 -2
- package/api/resources/tts/types/NaturalSpecifier.js +1 -4
- package/api/resources/tts/types/NumericalSpecifier.js +1 -2
- package/api/resources/tts/types/OutputFormat.js +1 -2
- package/api/resources/tts/types/RawEncoding.js +1 -4
- package/api/resources/tts/types/RawOutputFormat.js +1 -2
- package/api/resources/tts/types/Speed.js +1 -2
- package/api/resources/tts/types/SupportedLanguage.js +1 -4
- package/api/resources/tts/types/TtsRequest.js +1 -2
- package/api/resources/tts/types/TtsRequestEmbeddingSpecifier.js +1 -2
- package/api/resources/tts/types/TtsRequestIdSpecifier.js +1 -2
- package/api/resources/tts/types/TtsRequestVoiceSpecifier.js +1 -2
- package/api/resources/tts/types/WavOutputFormat.js +1 -2
- package/api/resources/tts/types/WebSocketBaseResponse.js +1 -2
- package/api/resources/tts/types/WebSocketChunkResponse.js +1 -2
- package/api/resources/tts/types/WebSocketDoneResponse.js +1 -2
- package/api/resources/tts/types/WebSocketErrorResponse.js +1 -2
- package/api/resources/tts/types/WebSocketRawOutputFormat.js +1 -2
- package/api/resources/tts/types/WebSocketRequest.js +1 -2
- package/api/resources/tts/types/WebSocketResponse.js +1 -2
- package/api/resources/tts/types/WebSocketStreamOptions.js +1 -2
- package/api/resources/tts/types/WebSocketTimestampsResponse.js +1 -2
- package/api/resources/tts/types/WebSocketTtsOutput.js +1 -2
- package/api/resources/tts/types/WebSocketTtsRequest.js +1 -2
- package/api/resources/tts/types/WordTimestamps.js +1 -2
- package/api/resources/tts/types/index.js +30 -46
- package/api/resources/voiceChanger/client/Client.js +10 -40
- package/api/resources/voiceChanger/client/index.js +1 -17
- package/api/resources/voiceChanger/client/requests/VoiceChangerBytesRequest.js +1 -2
- package/api/resources/voiceChanger/client/requests/VoiceChangerSseRequest.js +1 -2
- package/api/resources/voiceChanger/client/requests/index.js +1 -2
- package/api/resources/voiceChanger/index.js +2 -18
- package/api/resources/voiceChanger/types/OutputFormatContainer.js +1 -4
- package/api/resources/voiceChanger/types/StreamingResponse.js +1 -2
- package/api/resources/voiceChanger/types/index.js +2 -18
- package/api/resources/voices/client/Client.js +22 -52
- package/api/resources/voices/client/index.js +1 -17
- package/api/resources/voices/client/requests/CloneVoiceRequest.js +1 -2
- package/api/resources/voices/client/requests/index.js +1 -2
- package/api/resources/voices/index.js +2 -18
- package/api/resources/voices/types/BaseVoiceId.js +1 -2
- package/api/resources/voices/types/CloneMode.js +1 -4
- package/api/resources/voices/types/CreateVoiceRequest.js +1 -2
- package/api/resources/voices/types/EmbeddingResponse.js +1 -2
- package/api/resources/voices/types/EmbeddingSpecifier.js +1 -2
- package/api/resources/voices/types/Gender.js +1 -4
- package/api/resources/voices/types/IdSpecifier.js +1 -2
- package/api/resources/voices/types/LocalizeDialect.js +1 -4
- package/api/resources/voices/types/LocalizeTargetLanguage.js +1 -4
- package/api/resources/voices/types/LocalizeVoiceRequest.js +1 -2
- package/api/resources/voices/types/MixVoiceSpecifier.js +1 -2
- package/api/resources/voices/types/MixVoicesRequest.js +1 -2
- package/api/resources/voices/types/UpdateVoiceRequest.js +1 -2
- package/api/resources/voices/types/Voice.js +1 -2
- package/api/resources/voices/types/VoiceId.js +1 -2
- package/api/resources/voices/types/VoiceMetadata.js +1 -2
- package/api/resources/voices/types/Weight.js +1 -2
- package/api/resources/voices/types/index.js +17 -33
- package/core/fetcher/APIResponse.js +1 -2
- package/core/fetcher/Fetcher.js +14 -18
- package/core/fetcher/Supplier.js +1 -4
- package/core/fetcher/createRequestUrl.js +3 -10
- package/core/fetcher/getFetchFn.js +6 -33
- package/core/fetcher/getHeader.js +1 -5
- package/core/fetcher/getRequestBody.js +1 -5
- package/core/fetcher/getResponseBody.js +3 -7
- package/core/fetcher/index.js +3 -9
- package/core/fetcher/makeRequest.js +4 -8
- package/core/fetcher/requestWithRetries.js +1 -5
- package/core/fetcher/signals.js +2 -7
- package/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.js +1 -5
- package/core/fetcher/stream-wrappers/NodePre18StreamWrapper.js +1 -5
- package/core/fetcher/stream-wrappers/UndiciStreamWrapper.js +1 -5
- package/core/fetcher/stream-wrappers/chooseStreamWrapper.js +7 -34
- package/core/form-data-utils/FormDataWrapper.js +11 -41
- package/core/form-data-utils/index.js +1 -17
- package/core/index.js +5 -34
- package/core/runtime/index.js +1 -5
- package/core/runtime/runtime.js +1 -4
- package/core/schemas/Schema.js +1 -4
- package/core/schemas/builders/bigint/bigint.js +9 -13
- package/core/schemas/builders/bigint/index.js +1 -5
- package/core/schemas/builders/date/date.js +10 -14
- package/core/schemas/builders/date/index.js +1 -5
- package/core/schemas/builders/enum/enum.js +7 -11
- package/core/schemas/builders/enum/index.js +1 -5
- package/core/schemas/builders/index.js +14 -30
- package/core/schemas/builders/lazy/index.js +2 -7
- package/core/schemas/builders/lazy/lazy.js +5 -11
- package/core/schemas/builders/lazy/lazyObject.js +7 -11
- package/core/schemas/builders/list/index.js +1 -5
- package/core/schemas/builders/list/list.js +8 -12
- package/core/schemas/builders/literals/booleanLiteral.js +6 -10
- package/core/schemas/builders/literals/index.js +2 -7
- package/core/schemas/builders/literals/stringLiteral.js +6 -10
- package/core/schemas/builders/object/index.js +3 -11
- package/core/schemas/builders/object/object.js +33 -38
- package/core/schemas/builders/object/objectWithoutOptionalProperties.js +3 -7
- package/core/schemas/builders/object/property.js +2 -7
- package/core/schemas/builders/object/types.js +1 -2
- package/core/schemas/builders/object-like/getObjectLikeUtils.js +10 -15
- package/core/schemas/builders/object-like/index.js +1 -6
- package/core/schemas/builders/object-like/types.js +1 -2
- package/core/schemas/builders/primitives/any.js +3 -6
- package/core/schemas/builders/primitives/boolean.js +5 -8
- package/core/schemas/builders/primitives/index.js +5 -13
- package/core/schemas/builders/primitives/number.js +5 -8
- package/core/schemas/builders/primitives/string.js +5 -8
- package/core/schemas/builders/primitives/unknown.js +3 -6
- package/core/schemas/builders/record/index.js +1 -5
- package/core/schemas/builders/record/record.js +14 -18
- package/core/schemas/builders/record/types.js +1 -2
- package/core/schemas/builders/schema-utils/JsonError.js +3 -7
- package/core/schemas/builders/schema-utils/ParseError.js +3 -7
- package/core/schemas/builders/schema-utils/getSchemaUtils.js +9 -15
- package/core/schemas/builders/schema-utils/index.js +3 -11
- package/core/schemas/builders/schema-utils/stringifyValidationErrors.js +1 -5
- package/core/schemas/builders/set/index.js +1 -5
- package/core/schemas/builders/set/set.js +10 -14
- package/core/schemas/builders/undiscriminated-union/index.js +1 -5
- package/core/schemas/builders/undiscriminated-union/types.js +1 -2
- package/core/schemas/builders/undiscriminated-union/undiscriminatedUnion.js +6 -10
- package/core/schemas/builders/union/discriminant.js +1 -5
- package/core/schemas/builders/union/index.js +2 -7
- package/core/schemas/builders/union/types.js +1 -2
- package/core/schemas/builders/union/union.js +14 -18
- package/core/schemas/index.js +1 -17
- package/core/schemas/utils/MaybePromise.js +1 -2
- package/core/schemas/utils/addQuestionMarksToNullableProperties.js +1 -2
- package/core/schemas/utils/createIdentitySchemaCreator.js +4 -8
- package/core/schemas/utils/entries.js +1 -5
- package/core/schemas/utils/filterObject.js +1 -5
- package/core/schemas/utils/getErrorMessageForIncorrectType.js +1 -5
- package/core/schemas/utils/isPlainObject.js +1 -5
- package/core/schemas/utils/keys.js +1 -5
- package/core/schemas/utils/maybeSkipValidation.js +1 -5
- package/core/schemas/utils/partition.js +1 -5
- package/core/streaming-fetcher/Stream.js +4 -9
- package/core/streaming-fetcher/index.js +1 -5
- package/core/websocket/events.js +3 -9
- package/core/websocket/index.js +1 -17
- package/core/websocket/ws.js +6 -33
- package/dist/Client.js +9 -13
- package/dist/api/index.js +1 -17
- package/dist/api/resources/apiStatus/client/Client.js +6 -33
- package/dist/api/resources/apiStatus/client/index.js +1 -2
- package/dist/api/resources/apiStatus/index.js +2 -18
- package/dist/api/resources/apiStatus/types/ApiInfo.js +1 -2
- package/dist/api/resources/apiStatus/types/index.js +1 -17
- package/dist/api/resources/embedding/index.js +1 -17
- package/dist/api/resources/embedding/types/Embedding.js +1 -2
- package/dist/api/resources/embedding/types/index.js +1 -17
- package/dist/api/resources/index.js +12 -41
- package/dist/api/resources/tts/client/Client.js +10 -40
- package/dist/api/resources/tts/client/index.js +1 -2
- package/dist/api/resources/tts/index.js +2 -18
- package/dist/api/resources/tts/types/CancelContextRequest.js +1 -2
- package/dist/api/resources/tts/types/ContextId.js +1 -2
- package/dist/api/resources/tts/types/Controls.js +1 -2
- package/dist/api/resources/tts/types/Emotion.js +1 -4
- package/dist/api/resources/tts/types/GenerationRequest.js +1 -2
- package/dist/api/resources/tts/types/Mp3OutputFormat.js +1 -2
- package/dist/api/resources/tts/types/NaturalSpecifier.js +1 -4
- package/dist/api/resources/tts/types/NumericalSpecifier.js +1 -2
- package/dist/api/resources/tts/types/OutputFormat.js +1 -2
- package/dist/api/resources/tts/types/RawEncoding.js +1 -4
- package/dist/api/resources/tts/types/RawOutputFormat.js +1 -2
- package/dist/api/resources/tts/types/Speed.js +1 -2
- package/dist/api/resources/tts/types/SupportedLanguage.js +1 -4
- package/dist/api/resources/tts/types/TtsRequest.js +1 -2
- package/dist/api/resources/tts/types/TtsRequestEmbeddingSpecifier.js +1 -2
- package/dist/api/resources/tts/types/TtsRequestIdSpecifier.js +1 -2
- package/dist/api/resources/tts/types/TtsRequestVoiceSpecifier.js +1 -2
- package/dist/api/resources/tts/types/WavOutputFormat.js +1 -2
- package/dist/api/resources/tts/types/WebSocketBaseResponse.js +1 -2
- package/dist/api/resources/tts/types/WebSocketChunkResponse.js +1 -2
- package/dist/api/resources/tts/types/WebSocketDoneResponse.js +1 -2
- package/dist/api/resources/tts/types/WebSocketErrorResponse.js +1 -2
- package/dist/api/resources/tts/types/WebSocketRawOutputFormat.js +1 -2
- package/dist/api/resources/tts/types/WebSocketRequest.js +1 -2
- package/dist/api/resources/tts/types/WebSocketResponse.js +1 -2
- package/dist/api/resources/tts/types/WebSocketStreamOptions.js +1 -2
- package/dist/api/resources/tts/types/WebSocketTimestampsResponse.js +1 -2
- package/dist/api/resources/tts/types/WebSocketTtsOutput.js +1 -2
- package/dist/api/resources/tts/types/WebSocketTtsRequest.js +1 -2
- package/dist/api/resources/tts/types/WordTimestamps.js +1 -2
- package/dist/api/resources/tts/types/index.js +30 -46
- package/dist/api/resources/voiceChanger/client/Client.js +10 -40
- package/dist/api/resources/voiceChanger/client/index.js +1 -17
- package/dist/api/resources/voiceChanger/client/requests/VoiceChangerBytesRequest.js +1 -2
- package/dist/api/resources/voiceChanger/client/requests/VoiceChangerSseRequest.js +1 -2
- package/dist/api/resources/voiceChanger/client/requests/index.js +1 -2
- package/dist/api/resources/voiceChanger/index.js +2 -18
- package/dist/api/resources/voiceChanger/types/OutputFormatContainer.js +1 -4
- package/dist/api/resources/voiceChanger/types/StreamingResponse.js +1 -2
- package/dist/api/resources/voiceChanger/types/index.js +2 -18
- package/dist/api/resources/voices/client/Client.js +22 -52
- package/dist/api/resources/voices/client/index.js +1 -17
- package/dist/api/resources/voices/client/requests/CloneVoiceRequest.js +1 -2
- package/dist/api/resources/voices/client/requests/index.js +1 -2
- package/dist/api/resources/voices/index.js +2 -18
- package/dist/api/resources/voices/types/BaseVoiceId.js +1 -2
- package/dist/api/resources/voices/types/CloneMode.js +1 -4
- package/dist/api/resources/voices/types/CreateVoiceRequest.js +1 -2
- package/dist/api/resources/voices/types/EmbeddingResponse.js +1 -2
- package/dist/api/resources/voices/types/EmbeddingSpecifier.js +1 -2
- package/dist/api/resources/voices/types/Gender.js +1 -4
- package/dist/api/resources/voices/types/IdSpecifier.js +1 -2
- package/dist/api/resources/voices/types/LocalizeDialect.js +1 -4
- package/dist/api/resources/voices/types/LocalizeTargetLanguage.js +1 -4
- package/dist/api/resources/voices/types/LocalizeVoiceRequest.js +1 -2
- package/dist/api/resources/voices/types/MixVoiceSpecifier.js +1 -2
- package/dist/api/resources/voices/types/MixVoicesRequest.js +1 -2
- package/dist/api/resources/voices/types/UpdateVoiceRequest.js +1 -2
- package/dist/api/resources/voices/types/Voice.js +1 -2
- package/dist/api/resources/voices/types/VoiceId.js +1 -2
- package/dist/api/resources/voices/types/VoiceMetadata.js +1 -2
- package/dist/api/resources/voices/types/Weight.js +1 -2
- package/dist/api/resources/voices/types/index.js +17 -33
- package/dist/core/fetcher/APIResponse.js +1 -2
- package/dist/core/fetcher/Fetcher.js +14 -18
- package/dist/core/fetcher/Supplier.js +1 -4
- package/dist/core/fetcher/createRequestUrl.js +3 -10
- package/dist/core/fetcher/getFetchFn.js +6 -33
- package/dist/core/fetcher/getHeader.js +1 -5
- package/dist/core/fetcher/getRequestBody.js +1 -5
- package/dist/core/fetcher/getResponseBody.js +3 -7
- package/dist/core/fetcher/index.js +3 -9
- package/dist/core/fetcher/makeRequest.js +4 -8
- package/dist/core/fetcher/requestWithRetries.js +1 -5
- package/dist/core/fetcher/signals.js +2 -7
- package/dist/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.js +1 -5
- package/dist/core/fetcher/stream-wrappers/NodePre18StreamWrapper.js +1 -5
- package/dist/core/fetcher/stream-wrappers/UndiciStreamWrapper.js +1 -5
- package/dist/core/fetcher/stream-wrappers/chooseStreamWrapper.js +7 -34
- package/dist/core/form-data-utils/FormDataWrapper.js +11 -41
- package/dist/core/form-data-utils/index.js +1 -17
- package/dist/core/index.js +5 -34
- package/dist/core/runtime/index.js +1 -5
- package/dist/core/runtime/runtime.js +1 -4
- package/dist/core/schemas/Schema.js +1 -4
- package/dist/core/schemas/builders/bigint/bigint.js +9 -13
- package/dist/core/schemas/builders/bigint/index.js +1 -5
- package/dist/core/schemas/builders/date/date.js +10 -14
- package/dist/core/schemas/builders/date/index.js +1 -5
- package/dist/core/schemas/builders/enum/enum.js +7 -11
- package/dist/core/schemas/builders/enum/index.js +1 -5
- package/dist/core/schemas/builders/index.js +14 -30
- package/dist/core/schemas/builders/lazy/index.js +2 -7
- package/dist/core/schemas/builders/lazy/lazy.js +5 -11
- package/dist/core/schemas/builders/lazy/lazyObject.js +7 -11
- package/dist/core/schemas/builders/list/index.js +1 -5
- package/dist/core/schemas/builders/list/list.js +8 -12
- package/dist/core/schemas/builders/literals/booleanLiteral.js +6 -10
- package/dist/core/schemas/builders/literals/index.js +2 -7
- package/dist/core/schemas/builders/literals/stringLiteral.js +6 -10
- package/dist/core/schemas/builders/object/index.js +3 -11
- package/dist/core/schemas/builders/object/object.js +33 -38
- package/dist/core/schemas/builders/object/objectWithoutOptionalProperties.js +3 -7
- package/dist/core/schemas/builders/object/property.js +2 -7
- package/dist/core/schemas/builders/object/types.js +1 -2
- package/dist/core/schemas/builders/object-like/getObjectLikeUtils.js +10 -15
- package/dist/core/schemas/builders/object-like/index.js +1 -6
- package/dist/core/schemas/builders/object-like/types.js +1 -2
- package/dist/core/schemas/builders/primitives/any.js +3 -6
- package/dist/core/schemas/builders/primitives/boolean.js +5 -8
- package/dist/core/schemas/builders/primitives/index.js +5 -13
- package/dist/core/schemas/builders/primitives/number.js +5 -8
- package/dist/core/schemas/builders/primitives/string.js +5 -8
- package/dist/core/schemas/builders/primitives/unknown.js +3 -6
- package/dist/core/schemas/builders/record/index.js +1 -5
- package/dist/core/schemas/builders/record/record.js +14 -18
- package/dist/core/schemas/builders/record/types.js +1 -2
- package/dist/core/schemas/builders/schema-utils/JsonError.js +3 -7
- package/dist/core/schemas/builders/schema-utils/ParseError.js +3 -7
- package/dist/core/schemas/builders/schema-utils/getSchemaUtils.js +9 -15
- package/dist/core/schemas/builders/schema-utils/index.js +3 -11
- package/dist/core/schemas/builders/schema-utils/stringifyValidationErrors.js +1 -5
- package/dist/core/schemas/builders/set/index.js +1 -5
- package/dist/core/schemas/builders/set/set.js +10 -14
- package/dist/core/schemas/builders/undiscriminated-union/index.js +1 -5
- package/dist/core/schemas/builders/undiscriminated-union/types.js +1 -2
- package/dist/core/schemas/builders/undiscriminated-union/undiscriminatedUnion.js +6 -10
- package/dist/core/schemas/builders/union/discriminant.js +1 -5
- package/dist/core/schemas/builders/union/index.js +2 -7
- package/dist/core/schemas/builders/union/types.js +1 -2
- package/dist/core/schemas/builders/union/union.js +14 -18
- package/dist/core/schemas/index.js +1 -17
- package/dist/core/schemas/utils/MaybePromise.js +1 -2
- package/dist/core/schemas/utils/addQuestionMarksToNullableProperties.js +1 -2
- package/dist/core/schemas/utils/createIdentitySchemaCreator.js +4 -8
- package/dist/core/schemas/utils/entries.js +1 -5
- package/dist/core/schemas/utils/filterObject.js +1 -5
- package/dist/core/schemas/utils/getErrorMessageForIncorrectType.js +1 -5
- package/dist/core/schemas/utils/isPlainObject.js +1 -5
- package/dist/core/schemas/utils/keys.js +1 -5
- package/dist/core/schemas/utils/maybeSkipValidation.js +1 -5
- package/dist/core/schemas/utils/partition.js +1 -5
- package/dist/core/streaming-fetcher/Stream.js +4 -9
- package/dist/core/streaming-fetcher/index.js +1 -5
- package/dist/core/websocket/events.js +3 -9
- package/dist/core/websocket/index.js +1 -17
- package/dist/core/websocket/ws.js +6 -33
- package/dist/environments.js +1 -4
- package/dist/errors/CartesiaError.js +1 -5
- package/dist/errors/CartesiaTimeoutError.js +1 -5
- package/dist/errors/index.js +2 -7
- package/dist/index.js +4 -34
- package/dist/serialization/index.js +1 -17
- package/dist/serialization/resources/apiStatus/index.js +1 -17
- package/dist/serialization/resources/apiStatus/types/ApiInfo.js +2 -28
- package/dist/serialization/resources/apiStatus/types/index.js +1 -17
- package/dist/serialization/resources/embedding/index.js +1 -17
- package/dist/serialization/resources/embedding/types/Embedding.js +2 -28
- package/dist/serialization/resources/embedding/types/index.js +1 -17
- package/dist/serialization/resources/index.js +10 -39
- package/dist/serialization/resources/tts/index.js +1 -17
- package/dist/serialization/resources/tts/types/CancelContextRequest.js +4 -30
- package/dist/serialization/resources/tts/types/ContextId.js +2 -28
- package/dist/serialization/resources/tts/types/Controls.js +6 -32
- package/dist/serialization/resources/tts/types/Emotion.js +2 -28
- package/dist/serialization/resources/tts/types/GenerationRequest.js +10 -36
- package/dist/serialization/resources/tts/types/Mp3OutputFormat.js +2 -28
- package/dist/serialization/resources/tts/types/NaturalSpecifier.js +2 -28
- package/dist/serialization/resources/tts/types/NumericalSpecifier.js +2 -28
- package/dist/serialization/resources/tts/types/OutputFormat.js +8 -34
- package/dist/serialization/resources/tts/types/RawEncoding.js +2 -28
- package/dist/serialization/resources/tts/types/RawOutputFormat.js +4 -30
- package/dist/serialization/resources/tts/types/Speed.js +4 -30
- package/dist/serialization/resources/tts/types/SupportedLanguage.js +2 -28
- package/dist/serialization/resources/tts/types/TtsRequest.js +8 -34
- package/dist/serialization/resources/tts/types/TtsRequestEmbeddingSpecifier.js +6 -32
- package/dist/serialization/resources/tts/types/TtsRequestIdSpecifier.js +6 -32
- package/dist/serialization/resources/tts/types/TtsRequestVoiceSpecifier.js +4 -30
- package/dist/serialization/resources/tts/types/WavOutputFormat.js +3 -29
- package/dist/serialization/resources/tts/types/WebSocketBaseResponse.js +4 -30
- package/dist/serialization/resources/tts/types/WebSocketChunkResponse.js +4 -30
- package/dist/serialization/resources/tts/types/WebSocketDoneResponse.js +3 -29
- package/dist/serialization/resources/tts/types/WebSocketErrorResponse.js +4 -30
- package/dist/serialization/resources/tts/types/WebSocketRawOutputFormat.js +4 -30
- package/dist/serialization/resources/tts/types/WebSocketRequest.js +4 -30
- package/dist/serialization/resources/tts/types/WebSocketResponse.js +10 -36
- package/dist/serialization/resources/tts/types/WebSocketStreamOptions.js +2 -28
- package/dist/serialization/resources/tts/types/WebSocketTimestampsResponse.js +6 -32
- package/dist/serialization/resources/tts/types/WebSocketTtsOutput.js +6 -32
- package/dist/serialization/resources/tts/types/WebSocketTtsRequest.js +6 -32
- package/dist/serialization/resources/tts/types/WordTimestamps.js +2 -28
- package/dist/serialization/resources/tts/types/index.js +30 -46
- package/dist/serialization/resources/voiceChanger/index.js +1 -17
- package/dist/serialization/resources/voiceChanger/types/OutputFormatContainer.js +2 -28
- package/dist/serialization/resources/voiceChanger/types/StreamingResponse.js +8 -34
- package/dist/serialization/resources/voiceChanger/types/index.js +2 -18
- package/dist/serialization/resources/voices/client/index.js +1 -27
- package/dist/serialization/resources/voices/client/list.js +3 -29
- package/dist/serialization/resources/voices/index.js +2 -18
- package/dist/serialization/resources/voices/types/BaseVoiceId.js +2 -5
- package/dist/serialization/resources/voices/types/CloneMode.js +2 -28
- package/dist/serialization/resources/voices/types/CreateVoiceRequest.js +8 -34
- package/dist/serialization/resources/voices/types/EmbeddingResponse.js +4 -30
- package/dist/serialization/resources/voices/types/EmbeddingSpecifier.js +6 -32
- package/dist/serialization/resources/voices/types/Gender.js +2 -28
- package/dist/serialization/resources/voices/types/IdSpecifier.js +6 -32
- package/dist/serialization/resources/voices/types/LocalizeDialect.js +2 -28
- package/dist/serialization/resources/voices/types/LocalizeTargetLanguage.js +2 -28
- package/dist/serialization/resources/voices/types/LocalizeVoiceRequest.js +10 -36
- package/dist/serialization/resources/voices/types/MixVoiceSpecifier.js +4 -30
- package/dist/serialization/resources/voices/types/MixVoicesRequest.js +4 -30
- package/dist/serialization/resources/voices/types/UpdateVoiceRequest.js +2 -28
- package/dist/serialization/resources/voices/types/Voice.js +10 -36
- package/dist/serialization/resources/voices/types/VoiceId.js +2 -28
- package/dist/serialization/resources/voices/types/VoiceMetadata.js +6 -32
- package/dist/serialization/resources/voices/types/Weight.js +2 -28
- package/dist/serialization/resources/voices/types/index.js +17 -33
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -4
- package/dist/wrapper/Client.js +4 -8
- package/dist/wrapper/StreamingTTSClient.js +4 -11
- package/dist/wrapper/WebPlayer.js +3 -7
- package/dist/wrapper/Websocket.js +23 -52
- package/dist/wrapper/source.js +5 -11
- package/dist/wrapper/utils.js +13 -28
- package/environments.js +1 -4
- package/errors/CartesiaError.js +1 -5
- package/errors/CartesiaTimeoutError.js +1 -5
- package/errors/index.js +2 -7
- package/index.js +4 -34
- package/package.json +3 -2
- package/serialization/index.js +1 -17
- package/serialization/resources/apiStatus/index.js +1 -17
- package/serialization/resources/apiStatus/types/ApiInfo.js +2 -28
- package/serialization/resources/apiStatus/types/index.js +1 -17
- package/serialization/resources/embedding/index.js +1 -17
- package/serialization/resources/embedding/types/Embedding.js +2 -28
- package/serialization/resources/embedding/types/index.js +1 -17
- package/serialization/resources/index.js +10 -39
- package/serialization/resources/tts/index.js +1 -17
- package/serialization/resources/tts/types/CancelContextRequest.js +4 -30
- package/serialization/resources/tts/types/ContextId.js +2 -28
- package/serialization/resources/tts/types/Controls.js +6 -32
- package/serialization/resources/tts/types/Emotion.js +2 -28
- package/serialization/resources/tts/types/GenerationRequest.js +10 -36
- package/serialization/resources/tts/types/Mp3OutputFormat.js +2 -28
- package/serialization/resources/tts/types/NaturalSpecifier.js +2 -28
- package/serialization/resources/tts/types/NumericalSpecifier.js +2 -28
- package/serialization/resources/tts/types/OutputFormat.js +8 -34
- package/serialization/resources/tts/types/RawEncoding.js +2 -28
- package/serialization/resources/tts/types/RawOutputFormat.js +4 -30
- package/serialization/resources/tts/types/Speed.js +4 -30
- package/serialization/resources/tts/types/SupportedLanguage.js +2 -28
- package/serialization/resources/tts/types/TtsRequest.js +8 -34
- package/serialization/resources/tts/types/TtsRequestEmbeddingSpecifier.js +6 -32
- package/serialization/resources/tts/types/TtsRequestIdSpecifier.js +6 -32
- package/serialization/resources/tts/types/TtsRequestVoiceSpecifier.js +4 -30
- package/serialization/resources/tts/types/WavOutputFormat.js +3 -29
- package/serialization/resources/tts/types/WebSocketBaseResponse.js +4 -30
- package/serialization/resources/tts/types/WebSocketChunkResponse.js +4 -30
- package/serialization/resources/tts/types/WebSocketDoneResponse.js +3 -29
- package/serialization/resources/tts/types/WebSocketErrorResponse.js +4 -30
- package/serialization/resources/tts/types/WebSocketRawOutputFormat.js +4 -30
- package/serialization/resources/tts/types/WebSocketRequest.js +4 -30
- package/serialization/resources/tts/types/WebSocketResponse.js +10 -36
- package/serialization/resources/tts/types/WebSocketStreamOptions.js +2 -28
- package/serialization/resources/tts/types/WebSocketTimestampsResponse.js +6 -32
- package/serialization/resources/tts/types/WebSocketTtsOutput.js +6 -32
- package/serialization/resources/tts/types/WebSocketTtsRequest.js +6 -32
- package/serialization/resources/tts/types/WordTimestamps.js +2 -28
- package/serialization/resources/tts/types/index.js +30 -46
- package/serialization/resources/voiceChanger/index.js +1 -17
- package/serialization/resources/voiceChanger/types/OutputFormatContainer.js +2 -28
- package/serialization/resources/voiceChanger/types/StreamingResponse.js +8 -34
- package/serialization/resources/voiceChanger/types/index.js +2 -18
- package/serialization/resources/voices/client/index.js +1 -27
- package/serialization/resources/voices/client/list.js +3 -29
- package/serialization/resources/voices/index.js +2 -18
- package/serialization/resources/voices/types/BaseVoiceId.js +2 -5
- package/serialization/resources/voices/types/CloneMode.js +2 -28
- package/serialization/resources/voices/types/CreateVoiceRequest.js +8 -34
- package/serialization/resources/voices/types/EmbeddingResponse.js +4 -30
- package/serialization/resources/voices/types/EmbeddingSpecifier.js +6 -32
- package/serialization/resources/voices/types/Gender.js +2 -28
- package/serialization/resources/voices/types/IdSpecifier.js +6 -32
- package/serialization/resources/voices/types/LocalizeDialect.js +2 -28
- package/serialization/resources/voices/types/LocalizeTargetLanguage.js +2 -28
- package/serialization/resources/voices/types/LocalizeVoiceRequest.js +10 -36
- package/serialization/resources/voices/types/MixVoiceSpecifier.js +4 -30
- package/serialization/resources/voices/types/MixVoicesRequest.js +4 -30
- package/serialization/resources/voices/types/UpdateVoiceRequest.js +2 -28
- package/serialization/resources/voices/types/Voice.js +10 -36
- package/serialization/resources/voices/types/VoiceId.js +2 -28
- package/serialization/resources/voices/types/VoiceMetadata.js +6 -32
- package/serialization/resources/voices/types/Weight.js +2 -28
- package/serialization/resources/voices/types/index.js +17 -33
- package/version.d.ts +1 -1
- package/version.js +1 -4
- package/wrapper/Client.js +4 -8
- package/wrapper/StreamingTTSClient.js +4 -11
- package/wrapper/WebPlayer.js +3 -7
- package/wrapper/Websocket.js +23 -52
- package/wrapper/source.js +5 -11
- package/wrapper/utils.js +13 -28
|
@@ -1,17 +1 @@
|
|
|
1
|
-
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
-
};
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("./builders"), exports);
|
|
1
|
+
export * from "./builders";
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1
|
+
export {};
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1
|
+
export {};
|
|
@@ -1,16 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
const schema_utils_1 = require("../builders/schema-utils");
|
|
5
|
-
const maybeSkipValidation_1 = require("./maybeSkipValidation");
|
|
6
|
-
function createIdentitySchemaCreator(schemaType, validate) {
|
|
1
|
+
import { getSchemaUtils } from "../builders/schema-utils";
|
|
2
|
+
import { maybeSkipValidation } from "./maybeSkipValidation";
|
|
3
|
+
export function createIdentitySchemaCreator(schemaType, validate) {
|
|
7
4
|
return () => {
|
|
8
5
|
const baseSchema = {
|
|
9
6
|
parse: validate,
|
|
10
7
|
json: validate,
|
|
11
8
|
getType: () => schemaType,
|
|
12
9
|
};
|
|
13
|
-
return Object.assign(Object.assign({},
|
|
10
|
+
return Object.assign(Object.assign({}, maybeSkipValidation(baseSchema)), getSchemaUtils(baseSchema));
|
|
14
11
|
};
|
|
15
12
|
}
|
|
16
|
-
exports.createIdentitySchemaCreator = createIdentitySchemaCreator;
|
|
@@ -1,7 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.filterObject = void 0;
|
|
4
|
-
function filterObject(obj, keysToInclude) {
|
|
1
|
+
export function filterObject(obj, keysToInclude) {
|
|
5
2
|
const keysToIncludeSet = new Set(keysToInclude);
|
|
6
3
|
return Object.entries(obj).reduce((acc, [key, value]) => {
|
|
7
4
|
if (keysToIncludeSet.has(key)) {
|
|
@@ -11,4 +8,3 @@ function filterObject(obj, keysToInclude) {
|
|
|
11
8
|
// eslint-disable-next-line @typescript-eslint/prefer-reduce-type-parameter
|
|
12
9
|
}, {});
|
|
13
10
|
}
|
|
14
|
-
exports.filterObject = filterObject;
|
|
@@ -1,10 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getErrorMessageForIncorrectType = void 0;
|
|
4
|
-
function getErrorMessageForIncorrectType(value, expectedType) {
|
|
1
|
+
export function getErrorMessageForIncorrectType(value, expectedType) {
|
|
5
2
|
return `Expected ${expectedType}. Received ${getTypeAsString(value)}.`;
|
|
6
3
|
}
|
|
7
|
-
exports.getErrorMessageForIncorrectType = getErrorMessageForIncorrectType;
|
|
8
4
|
function getTypeAsString(value) {
|
|
9
5
|
if (Array.isArray(value)) {
|
|
10
6
|
return "list";
|
|
@@ -1,8 +1,5 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.isPlainObject = void 0;
|
|
4
1
|
// borrowed from https://github.com/lodash/lodash/blob/master/isPlainObject.js
|
|
5
|
-
function isPlainObject(value) {
|
|
2
|
+
export function isPlainObject(value) {
|
|
6
3
|
if (typeof value !== "object" || value === null) {
|
|
7
4
|
return false;
|
|
8
5
|
}
|
|
@@ -15,4 +12,3 @@ function isPlainObject(value) {
|
|
|
15
12
|
}
|
|
16
13
|
return Object.getPrototypeOf(value) === proto;
|
|
17
14
|
}
|
|
18
|
-
exports.isPlainObject = isPlainObject;
|
|
@@ -1,10 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.maybeSkipValidation = void 0;
|
|
4
|
-
function maybeSkipValidation(schema) {
|
|
1
|
+
export function maybeSkipValidation(schema) {
|
|
5
2
|
return Object.assign(Object.assign({}, schema), { json: transformAndMaybeSkipValidation(schema.json), parse: transformAndMaybeSkipValidation(schema.parse) });
|
|
6
3
|
}
|
|
7
|
-
exports.maybeSkipValidation = maybeSkipValidation;
|
|
8
4
|
function transformAndMaybeSkipValidation(transform) {
|
|
9
5
|
return (value, opts) => {
|
|
10
6
|
const transformed = transform(value, opts);
|
|
@@ -1,7 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.partition = void 0;
|
|
4
|
-
function partition(items, predicate) {
|
|
1
|
+
export function partition(items, predicate) {
|
|
5
2
|
const trueItems = [], falseItems = [];
|
|
6
3
|
for (const item of items) {
|
|
7
4
|
if (predicate(item)) {
|
|
@@ -13,4 +10,3 @@ function partition(items, predicate) {
|
|
|
13
10
|
}
|
|
14
11
|
return [trueItems, falseItems];
|
|
15
12
|
}
|
|
16
|
-
exports.partition = partition;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
2
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
3
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
@@ -27,11 +26,9 @@ var __asyncGenerator = (this && this.__asyncGenerator) || function (thisArg, _ar
|
|
|
27
26
|
function reject(value) { resume("throw", value); }
|
|
28
27
|
function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }
|
|
29
28
|
};
|
|
30
|
-
|
|
31
|
-
exports.readableStreamAsyncIterable = exports.Stream = void 0;
|
|
32
|
-
const runtime_1 = require("../runtime");
|
|
29
|
+
import { RUNTIME } from "../runtime";
|
|
33
30
|
const DATA_PREFIX = "data:";
|
|
34
|
-
class Stream {
|
|
31
|
+
export class Stream {
|
|
35
32
|
constructor({ stream, parse, eventShape, signal }) {
|
|
36
33
|
this.controller = new AbortController();
|
|
37
34
|
this.stream = stream;
|
|
@@ -122,18 +119,17 @@ class Stream {
|
|
|
122
119
|
decoded += decoder.decode(chunk);
|
|
123
120
|
}
|
|
124
121
|
// Buffer is present in Node.js environment
|
|
125
|
-
else if (
|
|
122
|
+
else if (RUNTIME.type === "node" && typeof chunk != "undefined") {
|
|
126
123
|
decoded += Buffer.isBuffer(chunk) ? chunk : Buffer.from(chunk);
|
|
127
124
|
}
|
|
128
125
|
return decoded;
|
|
129
126
|
}
|
|
130
127
|
}
|
|
131
|
-
exports.Stream = Stream;
|
|
132
128
|
/**
|
|
133
129
|
* Browser polyfill for ReadableStream
|
|
134
130
|
*/
|
|
135
131
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
136
|
-
function readableStreamAsyncIterable(stream) {
|
|
132
|
+
export function readableStreamAsyncIterable(stream) {
|
|
137
133
|
if (stream[Symbol.asyncIterator]) {
|
|
138
134
|
return stream;
|
|
139
135
|
}
|
|
@@ -167,4 +163,3 @@ function readableStreamAsyncIterable(stream) {
|
|
|
167
163
|
},
|
|
168
164
|
};
|
|
169
165
|
}
|
|
170
|
-
exports.readableStreamAsyncIterable = readableStreamAsyncIterable;
|
|
@@ -1,5 +1 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.Stream = void 0;
|
|
4
|
-
var Stream_1 = require("./Stream");
|
|
5
|
-
Object.defineProperty(exports, "Stream", { enumerable: true, get: function () { return Stream_1.Stream; } });
|
|
1
|
+
export { Stream } from "./Stream";
|
|
@@ -1,22 +1,17 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.CloseEvent = exports.ErrorEvent = exports.Event = void 0;
|
|
4
|
-
class Event {
|
|
1
|
+
export class Event {
|
|
5
2
|
constructor(type, target) {
|
|
6
3
|
this.target = target;
|
|
7
4
|
this.type = type;
|
|
8
5
|
}
|
|
9
6
|
}
|
|
10
|
-
|
|
11
|
-
class ErrorEvent extends Event {
|
|
7
|
+
export class ErrorEvent extends Event {
|
|
12
8
|
constructor(error, target) {
|
|
13
9
|
super("error", target);
|
|
14
10
|
this.message = error.message;
|
|
15
11
|
this.error = error;
|
|
16
12
|
}
|
|
17
13
|
}
|
|
18
|
-
|
|
19
|
-
class CloseEvent extends Event {
|
|
14
|
+
export class CloseEvent extends Event {
|
|
20
15
|
constructor(code = 1000, reason = "", target) {
|
|
21
16
|
super("close", target);
|
|
22
17
|
this.wasClean = true;
|
|
@@ -24,4 +19,3 @@ class CloseEvent extends Event {
|
|
|
24
19
|
this.reason = reason;
|
|
25
20
|
}
|
|
26
21
|
}
|
|
27
|
-
exports.CloseEvent = CloseEvent;
|
|
@@ -1,17 +1 @@
|
|
|
1
|
-
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
-
};
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("./ws"), exports);
|
|
1
|
+
export * from "./ws";
|
|
@@ -1,39 +1,13 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
-
if (mod && mod.__esModule) return mod;
|
|
20
|
-
var result = {};
|
|
21
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
-
__setModuleDefault(result, mod);
|
|
23
|
-
return result;
|
|
24
|
-
};
|
|
25
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
-
exports.ReconnectingWebSocket = void 0;
|
|
27
|
-
const runtime_1 = require("../runtime");
|
|
28
|
-
const Events = __importStar(require("./events"));
|
|
29
|
-
const ws_1 = require("ws");
|
|
1
|
+
import { RUNTIME } from "../runtime";
|
|
2
|
+
import * as Events from "./events";
|
|
3
|
+
import { WebSocket as NodeWebSocket } from "ws";
|
|
30
4
|
const getGlobalWebSocket = () => {
|
|
31
5
|
if (typeof WebSocket !== "undefined") {
|
|
32
6
|
// @ts-ignore
|
|
33
7
|
return WebSocket;
|
|
34
8
|
}
|
|
35
|
-
else if (
|
|
36
|
-
return
|
|
9
|
+
else if (RUNTIME.type === "node") {
|
|
10
|
+
return NodeWebSocket;
|
|
37
11
|
}
|
|
38
12
|
return undefined;
|
|
39
13
|
};
|
|
@@ -52,7 +26,7 @@ const DEFAULT = {
|
|
|
52
26
|
startClosed: false,
|
|
53
27
|
debug: false,
|
|
54
28
|
};
|
|
55
|
-
class ReconnectingWebSocket {
|
|
29
|
+
export class ReconnectingWebSocket {
|
|
56
30
|
constructor(url, protocols, options = {}) {
|
|
57
31
|
this._listeners = {
|
|
58
32
|
error: [],
|
|
@@ -435,4 +409,3 @@ class ReconnectingWebSocket {
|
|
|
435
409
|
clearTimeout(this._uptimeTimeout);
|
|
436
410
|
}
|
|
437
411
|
}
|
|
438
|
-
exports.ReconnectingWebSocket = ReconnectingWebSocket;
|
package/dist/environments.js
CHANGED
|
@@ -1,9 +1,6 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
/**
|
|
3
2
|
* This file was auto-generated by Fern from our API Definition.
|
|
4
3
|
*/
|
|
5
|
-
|
|
6
|
-
exports.CartesiaEnvironment = void 0;
|
|
7
|
-
exports.CartesiaEnvironment = {
|
|
4
|
+
export const CartesiaEnvironment = {
|
|
8
5
|
Production: "https://api.cartesia.ai",
|
|
9
6
|
};
|
|
@@ -1,10 +1,7 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
/**
|
|
3
2
|
* This file was auto-generated by Fern from our API Definition.
|
|
4
3
|
*/
|
|
5
|
-
|
|
6
|
-
exports.CartesiaError = void 0;
|
|
7
|
-
class CartesiaError extends Error {
|
|
4
|
+
export class CartesiaError extends Error {
|
|
8
5
|
constructor({ message, statusCode, body }) {
|
|
9
6
|
super(buildMessage({ message, statusCode, body }));
|
|
10
7
|
Object.setPrototypeOf(this, CartesiaError.prototype);
|
|
@@ -16,7 +13,6 @@ class CartesiaError extends Error {
|
|
|
16
13
|
}
|
|
17
14
|
}
|
|
18
15
|
}
|
|
19
|
-
exports.CartesiaError = CartesiaError;
|
|
20
16
|
function buildMessage({ message, statusCode, body, }) {
|
|
21
17
|
let lines = [];
|
|
22
18
|
if (message != null) {
|
|
@@ -1,13 +1,9 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
/**
|
|
3
2
|
* This file was auto-generated by Fern from our API Definition.
|
|
4
3
|
*/
|
|
5
|
-
|
|
6
|
-
exports.CartesiaTimeoutError = void 0;
|
|
7
|
-
class CartesiaTimeoutError extends Error {
|
|
4
|
+
export class CartesiaTimeoutError extends Error {
|
|
8
5
|
constructor() {
|
|
9
6
|
super("Timeout");
|
|
10
7
|
Object.setPrototypeOf(this, CartesiaTimeoutError.prototype);
|
|
11
8
|
}
|
|
12
9
|
}
|
|
13
|
-
exports.CartesiaTimeoutError = CartesiaTimeoutError;
|
package/dist/errors/index.js
CHANGED
|
@@ -1,7 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
exports.CartesiaTimeoutError = exports.CartesiaError = void 0;
|
|
4
|
-
var CartesiaError_1 = require("./CartesiaError");
|
|
5
|
-
Object.defineProperty(exports, "CartesiaError", { enumerable: true, get: function () { return CartesiaError_1.CartesiaError; } });
|
|
6
|
-
var CartesiaTimeoutError_1 = require("./CartesiaTimeoutError");
|
|
7
|
-
Object.defineProperty(exports, "CartesiaTimeoutError", { enumerable: true, get: function () { return CartesiaTimeoutError_1.CartesiaTimeoutError; } });
|
|
1
|
+
export { CartesiaError } from "./CartesiaError";
|
|
2
|
+
export { CartesiaTimeoutError } from "./CartesiaTimeoutError";
|
package/dist/index.js
CHANGED
|
@@ -1,34 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
-
if (mod && mod.__esModule) return mod;
|
|
20
|
-
var result = {};
|
|
21
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
-
__setModuleDefault(result, mod);
|
|
23
|
-
return result;
|
|
24
|
-
};
|
|
25
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
-
exports.CartesiaTimeoutError = exports.CartesiaError = exports.CartesiaEnvironment = exports.CartesiaClient = exports.Cartesia = void 0;
|
|
27
|
-
exports.Cartesia = __importStar(require("./api"));
|
|
28
|
-
var Client_1 = require("./wrapper/Client");
|
|
29
|
-
Object.defineProperty(exports, "CartesiaClient", { enumerable: true, get: function () { return Client_1.CartesiaClient; } });
|
|
30
|
-
var environments_1 = require("./environments");
|
|
31
|
-
Object.defineProperty(exports, "CartesiaEnvironment", { enumerable: true, get: function () { return environments_1.CartesiaEnvironment; } });
|
|
32
|
-
var errors_1 = require("./errors");
|
|
33
|
-
Object.defineProperty(exports, "CartesiaError", { enumerable: true, get: function () { return errors_1.CartesiaError; } });
|
|
34
|
-
Object.defineProperty(exports, "CartesiaTimeoutError", { enumerable: true, get: function () { return errors_1.CartesiaTimeoutError; } });
|
|
1
|
+
export * as Cartesia from "./api";
|
|
2
|
+
export { CartesiaClient } from "./wrapper/Client";
|
|
3
|
+
export { CartesiaEnvironment } from "./environments";
|
|
4
|
+
export { CartesiaError, CartesiaTimeoutError } from "./errors";
|
|
@@ -1,17 +1 @@
|
|
|
1
|
-
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
-
};
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("./resources"), exports);
|
|
1
|
+
export * from "./resources";
|
|
@@ -1,17 +1 @@
|
|
|
1
|
-
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
-
};
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("./types"), exports);
|
|
1
|
+
export * from "./types";
|
|
@@ -1,34 +1,8 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
/**
|
|
3
2
|
* This file was auto-generated by Fern from our API Definition.
|
|
4
3
|
*/
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
8
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
9
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
10
|
-
}
|
|
11
|
-
Object.defineProperty(o, k2, desc);
|
|
12
|
-
}) : (function(o, m, k, k2) {
|
|
13
|
-
if (k2 === undefined) k2 = k;
|
|
14
|
-
o[k2] = m[k];
|
|
15
|
-
}));
|
|
16
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
17
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
18
|
-
}) : function(o, v) {
|
|
19
|
-
o["default"] = v;
|
|
20
|
-
});
|
|
21
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
22
|
-
if (mod && mod.__esModule) return mod;
|
|
23
|
-
var result = {};
|
|
24
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
25
|
-
__setModuleDefault(result, mod);
|
|
26
|
-
return result;
|
|
27
|
-
};
|
|
28
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
-
exports.ApiInfo = void 0;
|
|
30
|
-
const core = __importStar(require("../../../../core"));
|
|
31
|
-
exports.ApiInfo = core.serialization.object({
|
|
4
|
+
import * as core from "../../../../core";
|
|
5
|
+
export const ApiInfo = core.serialization.object({
|
|
32
6
|
ok: core.serialization.boolean(),
|
|
33
7
|
version: core.serialization.string(),
|
|
34
8
|
});
|
|
@@ -1,17 +1 @@
|
|
|
1
|
-
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
-
};
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("./ApiInfo"), exports);
|
|
1
|
+
export * from "./ApiInfo";
|
|
@@ -1,17 +1 @@
|
|
|
1
|
-
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
-
};
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("./types"), exports);
|
|
1
|
+
export * from "./types";
|
|
@@ -1,31 +1,5 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
/**
|
|
3
2
|
* This file was auto-generated by Fern from our API Definition.
|
|
4
3
|
*/
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
8
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
9
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
10
|
-
}
|
|
11
|
-
Object.defineProperty(o, k2, desc);
|
|
12
|
-
}) : (function(o, m, k, k2) {
|
|
13
|
-
if (k2 === undefined) k2 = k;
|
|
14
|
-
o[k2] = m[k];
|
|
15
|
-
}));
|
|
16
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
17
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
18
|
-
}) : function(o, v) {
|
|
19
|
-
o["default"] = v;
|
|
20
|
-
});
|
|
21
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
22
|
-
if (mod && mod.__esModule) return mod;
|
|
23
|
-
var result = {};
|
|
24
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
25
|
-
__setModuleDefault(result, mod);
|
|
26
|
-
return result;
|
|
27
|
-
};
|
|
28
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
-
exports.Embedding = void 0;
|
|
30
|
-
const core = __importStar(require("../../../../core"));
|
|
31
|
-
exports.Embedding = core.serialization.list(core.serialization.number());
|
|
4
|
+
import * as core from "../../../../core";
|
|
5
|
+
export const Embedding = core.serialization.list(core.serialization.number());
|
|
@@ -1,17 +1 @@
|
|
|
1
|
-
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
-
};
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("./Embedding"), exports);
|
|
1
|
+
export * from "./Embedding";
|
|
@@ -1,39 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
-
if (mod && mod.__esModule) return mod;
|
|
20
|
-
var result = {};
|
|
21
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
-
__setModuleDefault(result, mod);
|
|
23
|
-
return result;
|
|
24
|
-
};
|
|
25
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
26
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
27
|
-
};
|
|
28
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
-
exports.voices = exports.voiceChanger = exports.tts = exports.embedding = exports.apiStatus = void 0;
|
|
30
|
-
exports.apiStatus = __importStar(require("./apiStatus"));
|
|
31
|
-
__exportStar(require("./apiStatus/types"), exports);
|
|
32
|
-
exports.embedding = __importStar(require("./embedding"));
|
|
33
|
-
__exportStar(require("./embedding/types"), exports);
|
|
34
|
-
exports.tts = __importStar(require("./tts"));
|
|
35
|
-
__exportStar(require("./tts/types"), exports);
|
|
36
|
-
exports.voiceChanger = __importStar(require("./voiceChanger"));
|
|
37
|
-
__exportStar(require("./voiceChanger/types"), exports);
|
|
38
|
-
exports.voices = __importStar(require("./voices"));
|
|
39
|
-
__exportStar(require("./voices/types"), exports);
|
|
1
|
+
export * as apiStatus from "./apiStatus";
|
|
2
|
+
export * from "./apiStatus/types";
|
|
3
|
+
export * as embedding from "./embedding";
|
|
4
|
+
export * from "./embedding/types";
|
|
5
|
+
export * as tts from "./tts";
|
|
6
|
+
export * from "./tts/types";
|
|
7
|
+
export * as voiceChanger from "./voiceChanger";
|
|
8
|
+
export * from "./voiceChanger/types";
|
|
9
|
+
export * as voices from "./voices";
|
|
10
|
+
export * from "./voices/types";
|