@cartesia/cartesia-js 2.1.4 → 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 +10 -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.js +17 -7
- package/api/resources/infill/client/Client.d.ts +6 -1
- package/api/resources/infill/client/Client.js +44 -23
- package/api/resources/infill/client/requests/InfillBytesRequest.d.ts +7 -3
- 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 +1 -1
- 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 +5 -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/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/WebSocketRequest.d.ts +1 -1
- package/api/resources/tts/types/WebSocketResponse.d.ts +4 -1
- package/api/resources/tts/types/WebSocketTtsOutput.d.ts +2 -0
- package/api/resources/tts/types/index.d.ts +2 -0
- package/api/resources/tts/types/index.js +2 -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 +4 -1
- package/api/resources/voices/client/Client.js +55 -45
- 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/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/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 +10 -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.js +17 -7
- package/dist/api/resources/infill/client/Client.d.ts +6 -1
- package/dist/api/resources/infill/client/Client.js +44 -23
- package/dist/api/resources/infill/client/requests/InfillBytesRequest.d.ts +7 -3
- 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 +1 -1
- 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 +5 -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/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/WebSocketRequest.d.ts +1 -1
- package/dist/api/resources/tts/types/WebSocketResponse.d.ts +4 -1
- package/dist/api/resources/tts/types/WebSocketTtsOutput.d.ts +2 -0
- package/dist/api/resources/tts/types/index.d.ts +2 -0
- package/dist/api/resources/tts/types/index.js +2 -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 +4 -1
- package/dist/api/resources/voices/client/Client.js +55 -45
- 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/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/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.js +17 -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 +3 -2
- package/dist/serialization/resources/tts/types/GenerationRequest.js +20 -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.js +17 -7
- 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.js +17 -7
- 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 +5 -1
- package/dist/serialization/resources/tts/types/WebSocketResponse.js +19 -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 +3 -0
- package/dist/serialization/resources/tts/types/WebSocketTtsOutput.js +20 -7
- package/dist/serialization/resources/tts/types/WebSocketTtsRequest.js +17 -7
- package/dist/serialization/resources/tts/types/WordTimestamps.js +17 -7
- package/dist/serialization/resources/tts/types/index.d.ts +2 -0
- package/dist/serialization/resources/tts/types/index.js +2 -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.js +17 -7
- 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.js +17 -7
- 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 +4 -0
- 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.js +17 -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 +3 -2
- package/serialization/resources/tts/types/GenerationRequest.js +20 -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.js +17 -7
- 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.js +17 -7
- 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 +5 -1
- package/serialization/resources/tts/types/WebSocketResponse.js +19 -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 +3 -0
- package/serialization/resources/tts/types/WebSocketTtsOutput.js +20 -7
- package/serialization/resources/tts/types/WebSocketTtsRequest.js +17 -7
- package/serialization/resources/tts/types/WordTimestamps.js +17 -7
- package/serialization/resources/tts/types/index.d.ts +2 -0
- package/serialization/resources/tts/types/index.js +2 -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.js +17 -7
- 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.js +17 -7
- 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
|
@@ -1,80 +1,85 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var _a, _b, _c, _d, _e;
|
|
3
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
3
|
exports.RUNTIME = void 0;
|
|
5
|
-
/**
|
|
6
|
-
* A constant that indicates whether the environment the code is running is a Web Browser.
|
|
7
|
-
*/
|
|
8
|
-
const isBrowser = typeof window !== "undefined" && typeof window.document !== "undefined";
|
|
9
|
-
/**
|
|
10
|
-
* A constant that indicates whether the environment the code is running is a Web Worker.
|
|
11
|
-
*/
|
|
12
|
-
const isWebWorker = typeof self === "object" &&
|
|
13
|
-
// @ts-ignore
|
|
14
|
-
typeof (self === null || self === void 0 ? void 0 : self.importScripts) === "function" &&
|
|
15
|
-
(((_a = self.constructor) === null || _a === void 0 ? void 0 : _a.name) === "DedicatedWorkerGlobalScope" ||
|
|
16
|
-
((_b = self.constructor) === null || _b === void 0 ? void 0 : _b.name) === "ServiceWorkerGlobalScope" ||
|
|
17
|
-
((_c = self.constructor) === null || _c === void 0 ? void 0 : _c.name) === "SharedWorkerGlobalScope");
|
|
18
|
-
/**
|
|
19
|
-
* A constant that indicates whether the environment the code is running is Deno.
|
|
20
|
-
*/
|
|
21
|
-
const isDeno = typeof Deno !== "undefined" && typeof Deno.version !== "undefined" && typeof Deno.version.deno !== "undefined";
|
|
22
|
-
/**
|
|
23
|
-
* A constant that indicates whether the environment the code is running is Bun.sh.
|
|
24
|
-
*/
|
|
25
|
-
const isBun = typeof Bun !== "undefined" && typeof Bun.version !== "undefined";
|
|
26
|
-
/**
|
|
27
|
-
* A constant that indicates whether the environment the code is running is Node.JS.
|
|
28
|
-
*/
|
|
29
|
-
const isNode = typeof process !== "undefined" &&
|
|
30
|
-
Boolean(process.version) &&
|
|
31
|
-
Boolean((_d = process.versions) === null || _d === void 0 ? void 0 : _d.node) &&
|
|
32
|
-
// Deno spoofs process.versions.node, see https://deno.land/std@0.177.0/node/process.ts?s=versions
|
|
33
|
-
!isDeno &&
|
|
34
|
-
!isBun;
|
|
35
|
-
/**
|
|
36
|
-
* A constant that indicates whether the environment the code is running is in React-Native.
|
|
37
|
-
* https://github.com/facebook/react-native/blob/main/packages/react-native/Libraries/Core/setUpNavigator.js
|
|
38
|
-
*/
|
|
39
|
-
const isReactNative = typeof navigator !== "undefined" && (navigator === null || navigator === void 0 ? void 0 : navigator.product) === "ReactNative";
|
|
40
|
-
/**
|
|
41
|
-
* A constant that indicates whether the environment the code is running is Cloudflare.
|
|
42
|
-
* https://developers.cloudflare.com/workers/runtime-apis/web-standards/#navigatoruseragent
|
|
43
|
-
*/
|
|
44
|
-
const isCloudflare = typeof globalThis !== "undefined" && ((_e = globalThis === null || globalThis === void 0 ? void 0 : globalThis.navigator) === null || _e === void 0 ? void 0 : _e.userAgent) === "Cloudflare-Workers";
|
|
45
4
|
/**
|
|
46
5
|
* A constant that indicates which environment and version the SDK is running in.
|
|
47
6
|
*/
|
|
48
7
|
exports.RUNTIME = evaluateRuntime();
|
|
49
8
|
function evaluateRuntime() {
|
|
9
|
+
var _a, _b, _c, _d, _e;
|
|
10
|
+
/**
|
|
11
|
+
* A constant that indicates whether the environment the code is running is a Web Browser.
|
|
12
|
+
*/
|
|
13
|
+
const isBrowser = typeof window !== "undefined" && typeof window.document !== "undefined";
|
|
50
14
|
if (isBrowser) {
|
|
51
15
|
return {
|
|
52
16
|
type: "browser",
|
|
53
17
|
version: window.navigator.userAgent,
|
|
54
18
|
};
|
|
55
19
|
}
|
|
20
|
+
/**
|
|
21
|
+
* A constant that indicates whether the environment the code is running is Cloudflare.
|
|
22
|
+
* https://developers.cloudflare.com/workers/runtime-apis/web-standards/#navigatoruseragent
|
|
23
|
+
*/
|
|
24
|
+
const isCloudflare = typeof globalThis !== "undefined" && ((_a = globalThis === null || globalThis === void 0 ? void 0 : globalThis.navigator) === null || _a === void 0 ? void 0 : _a.userAgent) === "Cloudflare-Workers";
|
|
56
25
|
if (isCloudflare) {
|
|
57
26
|
return {
|
|
58
27
|
type: "workerd",
|
|
59
28
|
};
|
|
60
29
|
}
|
|
30
|
+
/**
|
|
31
|
+
* A constant that indicates whether the environment the code is running is Edge Runtime.
|
|
32
|
+
* https://vercel.com/docs/functions/runtimes/edge-runtime#check-if-you're-running-on-the-edge-runtime
|
|
33
|
+
*/
|
|
34
|
+
const isEdgeRuntime = typeof EdgeRuntime === "string";
|
|
35
|
+
if (isEdgeRuntime) {
|
|
36
|
+
return {
|
|
37
|
+
type: "edge-runtime",
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* A constant that indicates whether the environment the code is running is a Web Worker.
|
|
42
|
+
*/
|
|
43
|
+
const isWebWorker = typeof self === "object" &&
|
|
44
|
+
// @ts-ignore
|
|
45
|
+
typeof (self === null || self === void 0 ? void 0 : self.importScripts) === "function" &&
|
|
46
|
+
(((_b = self.constructor) === null || _b === void 0 ? void 0 : _b.name) === "DedicatedWorkerGlobalScope" ||
|
|
47
|
+
((_c = self.constructor) === null || _c === void 0 ? void 0 : _c.name) === "ServiceWorkerGlobalScope" ||
|
|
48
|
+
((_d = self.constructor) === null || _d === void 0 ? void 0 : _d.name) === "SharedWorkerGlobalScope");
|
|
61
49
|
if (isWebWorker) {
|
|
62
50
|
return {
|
|
63
51
|
type: "web-worker",
|
|
64
52
|
};
|
|
65
53
|
}
|
|
54
|
+
/**
|
|
55
|
+
* A constant that indicates whether the environment the code is running is Deno.
|
|
56
|
+
* FYI Deno spoofs process.versions.node, see https://deno.land/std@0.177.0/node/process.ts?s=versions
|
|
57
|
+
*/
|
|
58
|
+
const isDeno = typeof Deno !== "undefined" && typeof Deno.version !== "undefined" && typeof Deno.version.deno !== "undefined";
|
|
66
59
|
if (isDeno) {
|
|
67
60
|
return {
|
|
68
61
|
type: "deno",
|
|
69
62
|
version: Deno.version.deno,
|
|
70
63
|
};
|
|
71
64
|
}
|
|
65
|
+
/**
|
|
66
|
+
* A constant that indicates whether the environment the code is running is Bun.sh.
|
|
67
|
+
*/
|
|
68
|
+
const isBun = typeof Bun !== "undefined" && typeof Bun.version !== "undefined";
|
|
72
69
|
if (isBun) {
|
|
73
70
|
return {
|
|
74
71
|
type: "bun",
|
|
75
72
|
version: Bun.version,
|
|
76
73
|
};
|
|
77
74
|
}
|
|
75
|
+
/**
|
|
76
|
+
* A constant that indicates whether the environment the code is running is Node.JS.
|
|
77
|
+
*/
|
|
78
|
+
const isNode = typeof process !== "undefined" &&
|
|
79
|
+
"version" in process &&
|
|
80
|
+
!!process.version &&
|
|
81
|
+
"versions" in process &&
|
|
82
|
+
!!((_e = process.versions) === null || _e === void 0 ? void 0 : _e.node);
|
|
78
83
|
if (isNode) {
|
|
79
84
|
return {
|
|
80
85
|
type: "node",
|
|
@@ -82,6 +87,11 @@ function evaluateRuntime() {
|
|
|
82
87
|
parsedVersion: Number(process.versions.node.split(".")[0]),
|
|
83
88
|
};
|
|
84
89
|
}
|
|
90
|
+
/**
|
|
91
|
+
* A constant that indicates whether the environment the code is running is in React-Native.
|
|
92
|
+
* https://github.com/facebook/react-native/blob/main/packages/react-native/Libraries/Core/setUpNavigator.js
|
|
93
|
+
*/
|
|
94
|
+
const isReactNative = typeof navigator !== "undefined" && (navigator === null || navigator === void 0 ? void 0 : navigator.product) === "ReactNative";
|
|
85
95
|
if (isReactNative) {
|
|
86
96
|
return {
|
|
87
97
|
type: "react-native",
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { SchemaUtils } from "./builders";
|
|
2
|
-
export
|
|
3
|
-
export
|
|
4
|
-
export
|
|
2
|
+
export type Schema<Raw = unknown, Parsed = unknown> = BaseSchema<Raw, Parsed> & SchemaUtils<Raw, Parsed>;
|
|
3
|
+
export type inferRaw<S extends Schema> = S extends Schema<infer Raw, any> ? Raw : never;
|
|
4
|
+
export type inferParsed<S extends Schema> = S extends Schema<any, infer Parsed> ? Parsed : never;
|
|
5
5
|
export interface BaseSchema<Raw, Parsed> {
|
|
6
6
|
parse: (raw: unknown, opts?: SchemaOptions) => MaybeValid<Parsed>;
|
|
7
7
|
json: (parsed: unknown, opts?: SchemaOptions) => MaybeValid<Raw>;
|
|
@@ -24,10 +24,12 @@ export declare const SchemaType: {
|
|
|
24
24
|
readonly SET: "set";
|
|
25
25
|
readonly UNION: "union";
|
|
26
26
|
readonly UNDISCRIMINATED_UNION: "undiscriminatedUnion";
|
|
27
|
+
readonly NULLABLE: "nullable";
|
|
27
28
|
readonly OPTIONAL: "optional";
|
|
29
|
+
readonly OPTIONAL_NULLABLE: "optionalNullable";
|
|
28
30
|
};
|
|
29
|
-
export
|
|
30
|
-
export
|
|
31
|
+
export type SchemaType = (typeof SchemaType)[keyof typeof SchemaType];
|
|
32
|
+
export type MaybeValid<T> = Valid<T> | Invalid;
|
|
31
33
|
export interface Valid<T> {
|
|
32
34
|
ok: true;
|
|
33
35
|
value: T;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { Schema } from "../../Schema";
|
|
2
|
-
export declare function bigint(): Schema<
|
|
2
|
+
export declare function bigint(): Schema<bigint | number, bigint>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.bigint =
|
|
3
|
+
exports.bigint = bigint;
|
|
4
4
|
const Schema_1 = require("../../Schema");
|
|
5
5
|
const getErrorMessageForIncorrectType_1 = require("../../utils/getErrorMessageForIncorrectType");
|
|
6
6
|
const maybeSkipValidation_1 = require("../../utils/maybeSkipValidation");
|
|
@@ -8,30 +8,30 @@ const schema_utils_1 = require("../schema-utils");
|
|
|
8
8
|
function bigint() {
|
|
9
9
|
const baseSchema = {
|
|
10
10
|
parse: (raw, { breadcrumbsPrefix = [] } = {}) => {
|
|
11
|
-
if (typeof raw
|
|
11
|
+
if (typeof raw === "bigint") {
|
|
12
12
|
return {
|
|
13
|
-
ok:
|
|
14
|
-
|
|
15
|
-
{
|
|
16
|
-
path: breadcrumbsPrefix,
|
|
17
|
-
message: (0, getErrorMessageForIncorrectType_1.getErrorMessageForIncorrectType)(raw, "string"),
|
|
18
|
-
},
|
|
19
|
-
],
|
|
13
|
+
ok: true,
|
|
14
|
+
value: raw,
|
|
20
15
|
};
|
|
21
16
|
}
|
|
22
|
-
|
|
23
|
-
ok: true,
|
|
24
|
-
value: BigInt(raw),
|
|
25
|
-
};
|
|
26
|
-
},
|
|
27
|
-
json: (bigint, { breadcrumbsPrefix = [] } = {}) => {
|
|
28
|
-
if (typeof bigint === "bigint") {
|
|
17
|
+
if (typeof raw === "number") {
|
|
29
18
|
return {
|
|
30
19
|
ok: true,
|
|
31
|
-
value:
|
|
20
|
+
value: BigInt(raw),
|
|
32
21
|
};
|
|
33
22
|
}
|
|
34
|
-
|
|
23
|
+
return {
|
|
24
|
+
ok: false,
|
|
25
|
+
errors: [
|
|
26
|
+
{
|
|
27
|
+
path: breadcrumbsPrefix,
|
|
28
|
+
message: (0, getErrorMessageForIncorrectType_1.getErrorMessageForIncorrectType)(raw, "bigint | number"),
|
|
29
|
+
},
|
|
30
|
+
],
|
|
31
|
+
};
|
|
32
|
+
},
|
|
33
|
+
json: (bigint, { breadcrumbsPrefix = [] } = {}) => {
|
|
34
|
+
if (typeof bigint !== "bigint") {
|
|
35
35
|
return {
|
|
36
36
|
ok: false,
|
|
37
37
|
errors: [
|
|
@@ -42,9 +42,12 @@ function bigint() {
|
|
|
42
42
|
],
|
|
43
43
|
};
|
|
44
44
|
}
|
|
45
|
+
return {
|
|
46
|
+
ok: true,
|
|
47
|
+
value: bigint,
|
|
48
|
+
};
|
|
45
49
|
},
|
|
46
50
|
getType: () => Schema_1.SchemaType.BIGINT,
|
|
47
51
|
};
|
|
48
52
|
return Object.assign(Object.assign({}, (0, maybeSkipValidation_1.maybeSkipValidation)(baseSchema)), (0, schema_utils_1.getSchemaUtils)(baseSchema));
|
|
49
53
|
}
|
|
50
|
-
exports.bigint = bigint;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.date =
|
|
3
|
+
exports.date = date;
|
|
4
4
|
const Schema_1 = require("../../Schema");
|
|
5
5
|
const getErrorMessageForIncorrectType_1 = require("../../utils/getErrorMessageForIncorrectType");
|
|
6
6
|
const maybeSkipValidation_1 = require("../../utils/maybeSkipValidation");
|
|
@@ -60,4 +60,3 @@ function date() {
|
|
|
60
60
|
};
|
|
61
61
|
return Object.assign(Object.assign({}, (0, maybeSkipValidation_1.maybeSkipValidation)(baseSchema)), (0, schema_utils_1.getSchemaUtils)(baseSchema));
|
|
62
62
|
}
|
|
63
|
-
exports.date = date;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.enum_ =
|
|
3
|
+
exports.enum_ = enum_;
|
|
4
4
|
const Schema_1 = require("../../Schema");
|
|
5
5
|
const createIdentitySchemaCreator_1 = require("../../utils/createIdentitySchemaCreator");
|
|
6
6
|
const getErrorMessageForIncorrectType_1 = require("../../utils/getErrorMessageForIncorrectType");
|
|
@@ -36,4 +36,3 @@ function enum_(values) {
|
|
|
36
36
|
});
|
|
37
37
|
return schemaCreator();
|
|
38
38
|
}
|
|
39
|
-
exports.enum_ = enum_;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { BaseSchema, Schema } from "../../Schema";
|
|
2
|
-
export
|
|
2
|
+
export type SchemaGetter<SchemaType extends Schema<any, any>> = () => SchemaType;
|
|
3
3
|
export declare function lazy<Raw, Parsed>(getter: SchemaGetter<Schema<Raw, Parsed>>): Schema<Raw, Parsed>;
|
|
4
4
|
export declare function constructLazyBaseSchema<Raw, Parsed>(getter: SchemaGetter<Schema<Raw, Parsed>>): BaseSchema<Raw, Parsed>;
|
|
5
5
|
export declare function getMemoizedSchema<SchemaType extends Schema<any, any>>(getter: SchemaGetter<SchemaType>): SchemaType;
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.lazy = lazy;
|
|
4
|
+
exports.constructLazyBaseSchema = constructLazyBaseSchema;
|
|
5
|
+
exports.getMemoizedSchema = getMemoizedSchema;
|
|
4
6
|
const schema_utils_1 = require("../schema-utils");
|
|
5
7
|
function lazy(getter) {
|
|
6
8
|
const baseSchema = constructLazyBaseSchema(getter);
|
|
7
9
|
return Object.assign(Object.assign({}, baseSchema), (0, schema_utils_1.getSchemaUtils)(baseSchema));
|
|
8
10
|
}
|
|
9
|
-
exports.lazy = lazy;
|
|
10
11
|
function constructLazyBaseSchema(getter) {
|
|
11
12
|
return {
|
|
12
13
|
parse: (raw, opts) => getMemoizedSchema(getter).parse(raw, opts),
|
|
@@ -14,7 +15,6 @@ function constructLazyBaseSchema(getter) {
|
|
|
14
15
|
getType: () => getMemoizedSchema(getter).getType(),
|
|
15
16
|
};
|
|
16
17
|
}
|
|
17
|
-
exports.constructLazyBaseSchema = constructLazyBaseSchema;
|
|
18
18
|
function getMemoizedSchema(getter) {
|
|
19
19
|
const castedGetter = getter;
|
|
20
20
|
if (castedGetter.__zurg_memoized == null) {
|
|
@@ -22,4 +22,3 @@ function getMemoizedSchema(getter) {
|
|
|
22
22
|
}
|
|
23
23
|
return castedGetter.__zurg_memoized;
|
|
24
24
|
}
|
|
25
|
-
exports.getMemoizedSchema = getMemoizedSchema;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.lazyObject =
|
|
3
|
+
exports.lazyObject = lazyObject;
|
|
4
4
|
const object_1 = require("../object");
|
|
5
5
|
const object_like_1 = require("../object-like");
|
|
6
6
|
const schema_utils_1 = require("../schema-utils");
|
|
@@ -9,4 +9,3 @@ function lazyObject(getter) {
|
|
|
9
9
|
const baseSchema = Object.assign(Object.assign({}, (0, lazy_1.constructLazyBaseSchema)(getter)), { _getRawProperties: () => (0, lazy_1.getMemoizedSchema)(getter)._getRawProperties(), _getParsedProperties: () => (0, lazy_1.getMemoizedSchema)(getter)._getParsedProperties() });
|
|
10
10
|
return Object.assign(Object.assign(Object.assign(Object.assign({}, baseSchema), (0, schema_utils_1.getSchemaUtils)(baseSchema)), (0, object_like_1.getObjectLikeUtils)(baseSchema)), (0, object_1.getObjectUtils)(baseSchema));
|
|
11
11
|
}
|
|
12
|
-
exports.lazyObject = lazyObject;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.list =
|
|
3
|
+
exports.list = list;
|
|
4
4
|
const Schema_1 = require("../../Schema");
|
|
5
5
|
const getErrorMessageForIncorrectType_1 = require("../../utils/getErrorMessageForIncorrectType");
|
|
6
6
|
const maybeSkipValidation_1 = require("../../utils/maybeSkipValidation");
|
|
@@ -19,7 +19,6 @@ function list(schema) {
|
|
|
19
19
|
};
|
|
20
20
|
return Object.assign(Object.assign({}, (0, maybeSkipValidation_1.maybeSkipValidation)(baseSchema)), (0, schema_utils_1.getSchemaUtils)(baseSchema));
|
|
21
21
|
}
|
|
22
|
-
exports.list = list;
|
|
23
22
|
function validateAndTransformArray(value, transformItem) {
|
|
24
23
|
if (!Array.isArray(value)) {
|
|
25
24
|
return {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.booleanLiteral =
|
|
3
|
+
exports.booleanLiteral = booleanLiteral;
|
|
4
4
|
const Schema_1 = require("../../Schema");
|
|
5
5
|
const createIdentitySchemaCreator_1 = require("../../utils/createIdentitySchemaCreator");
|
|
6
6
|
const getErrorMessageForIncorrectType_1 = require("../../utils/getErrorMessageForIncorrectType");
|
|
@@ -26,4 +26,3 @@ function booleanLiteral(literal) {
|
|
|
26
26
|
});
|
|
27
27
|
return schemaCreator();
|
|
28
28
|
}
|
|
29
|
-
exports.booleanLiteral = booleanLiteral;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.stringLiteral =
|
|
3
|
+
exports.stringLiteral = stringLiteral;
|
|
4
4
|
const Schema_1 = require("../../Schema");
|
|
5
5
|
const createIdentitySchemaCreator_1 = require("../../utils/createIdentitySchemaCreator");
|
|
6
6
|
const getErrorMessageForIncorrectType_1 = require("../../utils/getErrorMessageForIncorrectType");
|
|
@@ -26,4 +26,3 @@ function stringLiteral(literal) {
|
|
|
26
26
|
});
|
|
27
27
|
return schemaCreator();
|
|
28
28
|
}
|
|
29
|
-
exports.stringLiteral = stringLiteral;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { BaseObjectSchema,
|
|
1
|
+
import { BaseObjectSchema, ObjectUtils, PropertySchemas, inferObjectSchemaFromPropertySchemas } from "./types";
|
|
2
2
|
export declare function object<ParsedKeys extends string, T extends PropertySchemas<ParsedKeys>>(schemas: T): inferObjectSchemaFromPropertySchemas<T>;
|
|
3
3
|
export declare function getObjectUtils<Raw, Parsed>(schema: BaseObjectSchema<Raw, Parsed>): ObjectUtils<Raw, Parsed>;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.object = object;
|
|
4
|
+
exports.getObjectUtils = getObjectUtils;
|
|
4
5
|
const Schema_1 = require("../../Schema");
|
|
5
6
|
const entries_1 = require("../../utils/entries");
|
|
6
7
|
const filterObject_1 = require("../../utils/filterObject");
|
|
@@ -104,7 +105,6 @@ function object(schemas) {
|
|
|
104
105
|
};
|
|
105
106
|
return Object.assign(Object.assign(Object.assign(Object.assign({}, (0, maybeSkipValidation_1.maybeSkipValidation)(baseSchema)), (0, schema_utils_1.getSchemaUtils)(baseSchema)), (0, object_like_1.getObjectLikeUtils)(baseSchema)), getObjectUtils(baseSchema));
|
|
106
107
|
}
|
|
107
|
-
exports.object = object;
|
|
108
108
|
function validateAndTransformObject({ value, requiredKeys, getProperty, unrecognizedObjectKeys = "fail", skipValidation = false, breadcrumbsPrefix = [], }) {
|
|
109
109
|
if (!(0, isPlainObject_1.isPlainObject)(value)) {
|
|
110
110
|
return {
|
|
@@ -194,9 +194,36 @@ function getObjectUtils(schema) {
|
|
|
194
194
|
};
|
|
195
195
|
return Object.assign(Object.assign(Object.assign(Object.assign({}, baseSchema), (0, schema_utils_1.getSchemaUtils)(baseSchema)), (0, object_like_1.getObjectLikeUtils)(baseSchema)), getObjectUtils(baseSchema));
|
|
196
196
|
},
|
|
197
|
+
passthrough: () => {
|
|
198
|
+
const baseSchema = {
|
|
199
|
+
_getParsedProperties: () => schema._getParsedProperties(),
|
|
200
|
+
_getRawProperties: () => schema._getRawProperties(),
|
|
201
|
+
parse: (raw, opts) => {
|
|
202
|
+
const transformed = schema.parse(raw, Object.assign(Object.assign({}, opts), { unrecognizedObjectKeys: "passthrough" }));
|
|
203
|
+
if (!transformed.ok) {
|
|
204
|
+
return transformed;
|
|
205
|
+
}
|
|
206
|
+
return {
|
|
207
|
+
ok: true,
|
|
208
|
+
value: Object.assign(Object.assign({}, raw), transformed.value),
|
|
209
|
+
};
|
|
210
|
+
},
|
|
211
|
+
json: (parsed, opts) => {
|
|
212
|
+
const transformed = schema.json(parsed, Object.assign(Object.assign({}, opts), { unrecognizedObjectKeys: "passthrough" }));
|
|
213
|
+
if (!transformed.ok) {
|
|
214
|
+
return transformed;
|
|
215
|
+
}
|
|
216
|
+
return {
|
|
217
|
+
ok: true,
|
|
218
|
+
value: Object.assign(Object.assign({}, parsed), transformed.value),
|
|
219
|
+
};
|
|
220
|
+
},
|
|
221
|
+
getType: () => Schema_1.SchemaType.OBJECT,
|
|
222
|
+
};
|
|
223
|
+
return Object.assign(Object.assign(Object.assign(Object.assign({}, baseSchema), (0, schema_utils_1.getSchemaUtils)(baseSchema)), (0, object_like_1.getObjectLikeUtils)(baseSchema)), getObjectUtils(baseSchema));
|
|
224
|
+
},
|
|
197
225
|
};
|
|
198
226
|
}
|
|
199
|
-
exports.getObjectUtils = getObjectUtils;
|
|
200
227
|
function validateAndTransformExtendedObject({ extensionKeys, value, transformBase, transformExtension, }) {
|
|
201
228
|
const extensionPropertiesSet = new Set(extensionKeys);
|
|
202
229
|
const [extensionProperties, baseProperties] = (0, partition_1.partition)((0, keys_1.keys)(value), (key) => extensionPropertiesSet.has(key));
|
|
@@ -226,6 +253,7 @@ function isSchemaOptional(schema) {
|
|
|
226
253
|
case Schema_1.SchemaType.ANY:
|
|
227
254
|
case Schema_1.SchemaType.UNKNOWN:
|
|
228
255
|
case Schema_1.SchemaType.OPTIONAL:
|
|
256
|
+
case Schema_1.SchemaType.OPTIONAL_NULLABLE:
|
|
229
257
|
return true;
|
|
230
258
|
default:
|
|
231
259
|
return false;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ObjectSchema, PropertySchemas, inferParsedPropertySchema, inferRawObjectFromPropertySchemas } from "./types";
|
|
2
2
|
export declare function objectWithoutOptionalProperties<ParsedKeys extends string, T extends PropertySchemas<ParsedKeys>>(schemas: T): inferObjectWithoutOptionalPropertiesSchemaFromPropertySchemas<T>;
|
|
3
|
-
export
|
|
4
|
-
export
|
|
3
|
+
export type inferObjectWithoutOptionalPropertiesSchemaFromPropertySchemas<T extends PropertySchemas<keyof T>> = ObjectSchema<inferRawObjectFromPropertySchemas<T>, inferParsedObjectWithoutOptionalPropertiesFromPropertySchemas<T>>;
|
|
4
|
+
export type inferParsedObjectWithoutOptionalPropertiesFromPropertySchemas<T extends PropertySchemas<keyof T>> = {
|
|
5
5
|
[K in keyof T]: inferParsedPropertySchema<T[K]>;
|
|
6
6
|
};
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.objectWithoutOptionalProperties =
|
|
3
|
+
exports.objectWithoutOptionalProperties = objectWithoutOptionalProperties;
|
|
4
4
|
const object_1 = require("./object");
|
|
5
5
|
function objectWithoutOptionalProperties(schemas) {
|
|
6
6
|
return (0, object_1.object)(schemas);
|
|
7
7
|
}
|
|
8
|
-
exports.objectWithoutOptionalProperties = objectWithoutOptionalProperties;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.property = property;
|
|
4
|
+
exports.isProperty = isProperty;
|
|
4
5
|
function property(rawKey, valueSchema) {
|
|
5
6
|
return {
|
|
6
7
|
rawKey,
|
|
@@ -8,9 +9,7 @@ function property(rawKey, valueSchema) {
|
|
|
8
9
|
isProperty: true,
|
|
9
10
|
};
|
|
10
11
|
}
|
|
11
|
-
exports.property = property;
|
|
12
12
|
function isProperty(maybeProperty) {
|
|
13
13
|
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
|
|
14
14
|
return maybeProperty.isProperty;
|
|
15
15
|
}
|
|
16
|
-
exports.isProperty = isProperty;
|
|
@@ -1,26 +1,31 @@
|
|
|
1
|
-
import { BaseSchema, inferParsed, inferRaw
|
|
1
|
+
import { BaseSchema, Schema, inferParsed, inferRaw } from "../../Schema";
|
|
2
2
|
import { addQuestionMarksToNullableProperties } from "../../utils/addQuestionMarksToNullableProperties";
|
|
3
3
|
import { ObjectLikeUtils } from "../object-like";
|
|
4
4
|
import { SchemaUtils } from "../schema-utils";
|
|
5
5
|
import { Property } from "./property";
|
|
6
|
-
export
|
|
6
|
+
export type ObjectSchema<Raw, Parsed> = BaseObjectSchema<Raw, Parsed> & ObjectLikeUtils<Raw, Parsed> & ObjectUtils<Raw, Parsed> & SchemaUtils<Raw, Parsed>;
|
|
7
7
|
export interface BaseObjectSchema<Raw, Parsed> extends BaseSchema<Raw, Parsed> {
|
|
8
8
|
_getRawProperties: () => (keyof Raw)[];
|
|
9
9
|
_getParsedProperties: () => (keyof Parsed)[];
|
|
10
10
|
}
|
|
11
11
|
export interface ObjectUtils<Raw, Parsed> {
|
|
12
12
|
extend: <RawExtension, ParsedExtension>(schemas: ObjectSchema<RawExtension, ParsedExtension>) => ObjectSchema<Raw & RawExtension, Parsed & ParsedExtension>;
|
|
13
|
+
passthrough: () => ObjectSchema<Raw & {
|
|
14
|
+
[key: string]: unknown;
|
|
15
|
+
}, Parsed & {
|
|
16
|
+
[key: string]: unknown;
|
|
17
|
+
}>;
|
|
13
18
|
}
|
|
14
|
-
export
|
|
15
|
-
export
|
|
16
|
-
export
|
|
17
|
-
export
|
|
19
|
+
export type inferRawObject<O extends ObjectSchema<any, any>> = O extends ObjectSchema<infer Raw, any> ? Raw : never;
|
|
20
|
+
export type inferParsedObject<O extends ObjectSchema<any, any>> = O extends ObjectSchema<any, infer Parsed> ? Parsed : never;
|
|
21
|
+
export type inferObjectSchemaFromPropertySchemas<T extends PropertySchemas<keyof T>> = ObjectSchema<inferRawObjectFromPropertySchemas<T>, inferParsedObjectFromPropertySchemas<T>>;
|
|
22
|
+
export type inferRawObjectFromPropertySchemas<T extends PropertySchemas<keyof T>> = addQuestionMarksToNullableProperties<{
|
|
18
23
|
[ParsedKey in keyof T as inferRawKey<ParsedKey, T[ParsedKey]>]: inferRawPropertySchema<T[ParsedKey]>;
|
|
19
24
|
}>;
|
|
20
|
-
export
|
|
25
|
+
export type inferParsedObjectFromPropertySchemas<T extends PropertySchemas<keyof T>> = addQuestionMarksToNullableProperties<{
|
|
21
26
|
[K in keyof T]: inferParsedPropertySchema<T[K]>;
|
|
22
27
|
}>;
|
|
23
|
-
export
|
|
24
|
-
export
|
|
25
|
-
export
|
|
26
|
-
export
|
|
28
|
+
export type PropertySchemas<ParsedKeys extends string | number | symbol> = Record<ParsedKeys, Property<any, any, any> | Schema<any, any>>;
|
|
29
|
+
export type inferRawPropertySchema<P extends Property<any, any, any> | Schema<any, any>> = P extends Property<any, infer Raw, any> ? Raw : P extends Schema<any, any> ? inferRaw<P> : never;
|
|
30
|
+
export type inferParsedPropertySchema<P extends Property<any, any, any> | Schema<any, any>> = P extends Property<any, any, infer Parsed> ? Parsed : P extends Schema<any, any> ? inferParsed<P> : never;
|
|
31
|
+
export type inferRawKey<ParsedKey extends string | number | symbol, P extends Property<any, any, any> | Schema<any, any>> = P extends Property<infer Raw, any, any> ? Raw : ParsedKey;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.getObjectLikeUtils = getObjectLikeUtils;
|
|
4
|
+
exports.withParsedProperties = withParsedProperties;
|
|
4
5
|
const filterObject_1 = require("../../utils/filterObject");
|
|
5
6
|
const getErrorMessageForIncorrectType_1 = require("../../utils/getErrorMessageForIncorrectType");
|
|
6
7
|
const isPlainObject_1 = require("../../utils/isPlainObject");
|
|
@@ -10,7 +11,6 @@ function getObjectLikeUtils(schema) {
|
|
|
10
11
|
withParsedProperties: (properties) => withParsedProperties(schema, properties),
|
|
11
12
|
};
|
|
12
13
|
}
|
|
13
|
-
exports.getObjectLikeUtils = getObjectLikeUtils;
|
|
14
14
|
/**
|
|
15
15
|
* object-like utils are defined in one file to resolve issues with circular imports
|
|
16
16
|
*/
|
|
@@ -51,4 +51,3 @@ function withParsedProperties(objectLike, properties) {
|
|
|
51
51
|
};
|
|
52
52
|
return Object.assign(Object.assign(Object.assign({}, objectSchema), (0, schema_utils_1.getSchemaUtils)(objectSchema)), getObjectLikeUtils(objectSchema));
|
|
53
53
|
}
|
|
54
|
-
exports.withParsedProperties = withParsedProperties;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { BaseSchema, Schema } from "../../Schema";
|
|
2
|
-
export
|
|
2
|
+
export type ObjectLikeSchema<Raw, Parsed> = Schema<Raw, Parsed> & BaseSchema<Raw, Parsed> & ObjectLikeUtils<Raw, Parsed>;
|
|
3
3
|
export interface ObjectLikeUtils<Raw, Parsed> {
|
|
4
4
|
withParsedProperties: <T extends Record<string, any>>(properties: {
|
|
5
5
|
[K in keyof T]: T[K] | ((parsed: Parsed) => T[K]);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.record =
|
|
3
|
+
exports.record = record;
|
|
4
4
|
const Schema_1 = require("../../Schema");
|
|
5
5
|
const entries_1 = require("../../utils/entries");
|
|
6
6
|
const getErrorMessageForIncorrectType_1 = require("../../utils/getErrorMessageForIncorrectType");
|
|
@@ -43,7 +43,6 @@ function record(keySchema, valueSchema) {
|
|
|
43
43
|
};
|
|
44
44
|
return Object.assign(Object.assign({}, (0, maybeSkipValidation_1.maybeSkipValidation)(baseSchema)), (0, schema_utils_1.getSchemaUtils)(baseSchema));
|
|
45
45
|
}
|
|
46
|
-
exports.record = record;
|
|
47
46
|
function validateAndTransformRecord({ value, isKeyNumeric, transformKey, transformValue, breadcrumbsPrefix = [], }) {
|
|
48
47
|
if (!(0, isPlainObject_1.isPlainObject)(value)) {
|
|
49
48
|
return {
|
|
@@ -57,8 +56,7 @@ function validateAndTransformRecord({ value, isKeyNumeric, transformKey, transfo
|
|
|
57
56
|
};
|
|
58
57
|
}
|
|
59
58
|
return (0, entries_1.entries)(value).reduce((accPromise, [stringKey, value]) => {
|
|
60
|
-
|
|
61
|
-
if (value == null) {
|
|
59
|
+
if (value === undefined) {
|
|
62
60
|
return accPromise;
|
|
63
61
|
}
|
|
64
62
|
const acc = accPromise;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { BaseSchema } from "../../Schema";
|
|
2
2
|
import { SchemaUtils } from "../schema-utils";
|
|
3
|
-
export
|
|
4
|
-
export
|
|
3
|
+
export type RecordSchema<RawKey extends string | number, RawValue, ParsedKey extends string | number, ParsedValue> = BaseRecordSchema<RawKey, RawValue, ParsedKey, ParsedValue> & SchemaUtils<Record<RawKey, RawValue>, Record<ParsedKey, ParsedValue>>;
|
|
4
|
+
export type BaseRecordSchema<RawKey extends string | number, RawValue, ParsedKey extends string | number, ParsedValue> = BaseSchema<Record<RawKey, RawValue>, Record<ParsedKey, ParsedValue>>;
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { BaseSchema, Schema, SchemaOptions } from "../../Schema";
|
|
2
2
|
export interface SchemaUtils<Raw, Parsed> {
|
|
3
|
+
nullable: () => Schema<Raw | null, Parsed | null>;
|
|
3
4
|
optional: () => Schema<Raw | null | undefined, Parsed | undefined>;
|
|
5
|
+
optionalNullable: () => Schema<Raw | null | undefined, Parsed | null | undefined>;
|
|
4
6
|
transform: <Transformed>(transformer: SchemaTransformer<Parsed, Transformed>) => Schema<Raw, Transformed>;
|
|
5
7
|
parseOrThrow: (raw: unknown, opts?: SchemaOptions) => Parsed;
|
|
6
8
|
jsonOrThrow: (raw: unknown, opts?: SchemaOptions) => Raw;
|
|
@@ -13,5 +15,7 @@ export declare function getSchemaUtils<Raw, Parsed>(schema: BaseSchema<Raw, Pars
|
|
|
13
15
|
/**
|
|
14
16
|
* schema utils are defined in one file to resolve issues with circular imports
|
|
15
17
|
*/
|
|
18
|
+
export declare function nullable<Raw, Parsed>(schema: BaseSchema<Raw, Parsed>): Schema<Raw | null, Parsed | null>;
|
|
16
19
|
export declare function optional<Raw, Parsed>(schema: BaseSchema<Raw, Parsed>): Schema<Raw | null | undefined, Parsed | undefined>;
|
|
20
|
+
export declare function optionalNullable<Raw, Parsed>(schema: BaseSchema<Raw, Parsed>): Schema<Raw | null | undefined, Parsed | null | undefined>;
|
|
17
21
|
export declare function transform<Raw, Parsed, Transformed>(schema: BaseSchema<Raw, Parsed>, transformer: SchemaTransformer<Parsed, Transformed>): Schema<Raw, Transformed>;
|