effect 4.0.0-beta.70 → 4.0.0-beta.72
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/dist/Array.d.ts +1483 -239
- package/dist/Array.d.ts.map +1 -1
- package/dist/Array.js +617 -164
- package/dist/Array.js.map +1 -1
- package/dist/BigDecimal.d.ts +646 -52
- package/dist/BigDecimal.d.ts.map +1 -1
- package/dist/BigDecimal.js +331 -28
- package/dist/BigDecimal.js.map +1 -1
- package/dist/BigInt.d.ts +474 -18
- package/dist/BigInt.d.ts.map +1 -1
- package/dist/BigInt.js +292 -14
- package/dist/BigInt.js.map +1 -1
- package/dist/Boolean.d.ts +239 -19
- package/dist/Boolean.d.ts.map +1 -1
- package/dist/Boolean.js +163 -13
- package/dist/Boolean.js.map +1 -1
- package/dist/Brand.d.ts +53 -8
- package/dist/Brand.d.ts.map +1 -1
- package/dist/Brand.js +82 -11
- package/dist/Brand.js.map +1 -1
- package/dist/Cache.d.ts +73 -12
- package/dist/Cache.d.ts.map +1 -1
- package/dist/Cache.js +53 -15
- package/dist/Cache.js.map +1 -1
- package/dist/Cause.d.ts +488 -200
- package/dist/Cause.d.ts.map +1 -1
- package/dist/Cause.js +349 -129
- package/dist/Cause.js.map +1 -1
- package/dist/Channel.d.ts +539 -158
- package/dist/Channel.d.ts.map +1 -1
- package/dist/Channel.js +222 -89
- package/dist/Channel.js.map +1 -1
- package/dist/ChannelSchema.d.ts +81 -6
- package/dist/ChannelSchema.d.ts.map +1 -1
- package/dist/ChannelSchema.js +45 -4
- package/dist/ChannelSchema.js.map +1 -1
- package/dist/Chunk.d.ts +179 -54
- package/dist/Chunk.d.ts.map +1 -1
- package/dist/Chunk.js +65 -22
- package/dist/Chunk.js.map +1 -1
- package/dist/Clock.d.ts +60 -3
- package/dist/Clock.d.ts.map +1 -1
- package/dist/Clock.js +31 -1
- package/dist/Clock.js.map +1 -1
- package/dist/Combiner.d.ts +21 -21
- package/dist/Combiner.d.ts.map +1 -1
- package/dist/Combiner.js +14 -18
- package/dist/Combiner.js.map +1 -1
- package/dist/Config.d.ts +135 -50
- package/dist/Config.d.ts.map +1 -1
- package/dist/Config.js +109 -37
- package/dist/Config.js.map +1 -1
- package/dist/ConfigProvider.d.ts +52 -29
- package/dist/ConfigProvider.d.ts.map +1 -1
- package/dist/ConfigProvider.js +21 -21
- package/dist/ConfigProvider.js.map +1 -1
- package/dist/Console.d.ts +32 -7
- package/dist/Console.d.ts.map +1 -1
- package/dist/Console.js +32 -7
- package/dist/Console.js.map +1 -1
- package/dist/Context.d.ts +503 -48
- package/dist/Context.d.ts.map +1 -1
- package/dist/Context.js +191 -17
- package/dist/Context.js.map +1 -1
- package/dist/Cron.d.ts +116 -6
- package/dist/Cron.d.ts.map +1 -1
- package/dist/Cron.js +92 -6
- package/dist/Cron.js.map +1 -1
- package/dist/Crypto.d.ts +30 -1
- package/dist/Crypto.d.ts.map +1 -1
- package/dist/Crypto.js +30 -1
- package/dist/Crypto.js.map +1 -1
- package/dist/Data.d.ts +92 -47
- package/dist/Data.d.ts.map +1 -1
- package/dist/Data.js +16 -12
- package/dist/Data.js.map +1 -1
- package/dist/DateTime.d.ts +313 -128
- package/dist/DateTime.d.ts.map +1 -1
- package/dist/DateTime.js +167 -68
- package/dist/DateTime.js.map +1 -1
- package/dist/Deferred.d.ts +345 -79
- package/dist/Deferred.d.ts.map +1 -1
- package/dist/Deferred.js +131 -12
- package/dist/Deferred.js.map +1 -1
- package/dist/Differ.d.ts +5 -0
- package/dist/Differ.d.ts.map +1 -1
- package/dist/Duration.d.ts +203 -50
- package/dist/Duration.d.ts.map +1 -1
- package/dist/Duration.js +112 -32
- package/dist/Duration.js.map +1 -1
- package/dist/Effect.d.ts +2006 -810
- package/dist/Effect.d.ts.map +1 -1
- package/dist/Effect.js +785 -350
- package/dist/Effect.js.map +1 -1
- package/dist/Effectable.d.ts +16 -2
- package/dist/Effectable.d.ts.map +1 -1
- package/dist/Effectable.js +16 -2
- package/dist/Effectable.js.map +1 -1
- package/dist/Encoding.d.ts +100 -8
- package/dist/Encoding.d.ts.map +1 -1
- package/dist/Encoding.js +141 -8
- package/dist/Encoding.js.map +1 -1
- package/dist/Equal.d.ts +10 -11
- package/dist/Equal.d.ts.map +1 -1
- package/dist/Equal.js +7 -8
- package/dist/Equal.js.map +1 -1
- package/dist/Equivalence.d.ts +46 -43
- package/dist/Equivalence.d.ts.map +1 -1
- package/dist/Equivalence.js +43 -35
- package/dist/Equivalence.js.map +1 -1
- package/dist/ErrorReporter.d.ts +135 -16
- package/dist/ErrorReporter.d.ts.map +1 -1
- package/dist/ErrorReporter.js +93 -12
- package/dist/ErrorReporter.js.map +1 -1
- package/dist/ExecutionPlan.d.ts +96 -26
- package/dist/ExecutionPlan.d.ts.map +1 -1
- package/dist/ExecutionPlan.js +28 -2
- package/dist/ExecutionPlan.js.map +1 -1
- package/dist/Exit.d.ts +149 -101
- package/dist/Exit.d.ts.map +1 -1
- package/dist/Exit.js +117 -80
- package/dist/Exit.js.map +1 -1
- package/dist/Fiber.d.ts +321 -72
- package/dist/Fiber.d.ts.map +1 -1
- package/dist/Fiber.js +152 -3
- package/dist/Fiber.js.map +1 -1
- package/dist/FiberHandle.d.ts +6 -6
- package/dist/FiberHandle.js +4 -4
- package/dist/FiberMap.d.ts +18 -18
- package/dist/FiberMap.js +8 -8
- package/dist/FiberSet.d.ts +21 -13
- package/dist/FiberSet.d.ts.map +1 -1
- package/dist/FiberSet.js +17 -9
- package/dist/FiberSet.js.map +1 -1
- package/dist/FileSystem.d.ts +79 -16
- package/dist/FileSystem.d.ts.map +1 -1
- package/dist/FileSystem.js +93 -33
- package/dist/FileSystem.js.map +1 -1
- package/dist/Filter.d.ts +221 -2
- package/dist/Filter.d.ts.map +1 -1
- package/dist/Filter.js +155 -2
- package/dist/Filter.js.map +1 -1
- package/dist/Formatter.d.ts +4 -6
- package/dist/Formatter.d.ts.map +1 -1
- package/dist/Formatter.js +3 -5
- package/dist/Formatter.js.map +1 -1
- package/dist/Function.d.ts +164 -18
- package/dist/Function.d.ts.map +1 -1
- package/dist/Function.js +116 -15
- package/dist/Function.js.map +1 -1
- package/dist/Graph.d.ts +297 -25
- package/dist/Graph.d.ts.map +1 -1
- package/dist/Graph.js +75 -12
- package/dist/Graph.js.map +1 -1
- package/dist/HKT.d.ts +59 -26
- package/dist/HKT.d.ts.map +1 -1
- package/dist/Hash.d.ts +95 -19
- package/dist/Hash.d.ts.map +1 -1
- package/dist/Hash.js +119 -17
- package/dist/Hash.js.map +1 -1
- package/dist/HashMap.d.ts +35 -37
- package/dist/HashMap.d.ts.map +1 -1
- package/dist/HashMap.js +13 -15
- package/dist/HashMap.js.map +1 -1
- package/dist/HashRing.d.ts +210 -9
- package/dist/HashRing.d.ts.map +1 -1
- package/dist/HashRing.js +95 -5
- package/dist/HashRing.js.map +1 -1
- package/dist/HashSet.d.ts +16 -16
- package/dist/HashSet.js +6 -6
- package/dist/Inspectable.d.ts +47 -4
- package/dist/Inspectable.d.ts.map +1 -1
- package/dist/Inspectable.js +74 -17
- package/dist/Inspectable.js.map +1 -1
- package/dist/Iterable.d.ts +261 -81
- package/dist/Iterable.d.ts.map +1 -1
- package/dist/Iterable.js +123 -43
- package/dist/Iterable.js.map +1 -1
- package/dist/JsonPatch.d.ts +34 -19
- package/dist/JsonPatch.d.ts.map +1 -1
- package/dist/JsonPatch.js +52 -44
- package/dist/JsonPatch.js.map +1 -1
- package/dist/JsonPointer.d.ts +5 -5
- package/dist/JsonPointer.js +5 -5
- package/dist/JsonSchema.d.ts +77 -33
- package/dist/JsonSchema.d.ts.map +1 -1
- package/dist/JsonSchema.js +45 -31
- package/dist/JsonSchema.js.map +1 -1
- package/dist/Latch.d.ts +158 -13
- package/dist/Latch.d.ts.map +1 -1
- package/dist/Latch.js +79 -4
- package/dist/Latch.js.map +1 -1
- package/dist/Layer.d.ts +297 -101
- package/dist/Layer.d.ts.map +1 -1
- package/dist/Layer.js +94 -36
- package/dist/Layer.js.map +1 -1
- package/dist/LayerMap.d.ts +9 -2
- package/dist/LayerMap.d.ts.map +1 -1
- package/dist/LayerMap.js +1 -2
- package/dist/LayerMap.js.map +1 -1
- package/dist/LogLevel.d.ts +96 -21
- package/dist/LogLevel.d.ts.map +1 -1
- package/dist/LogLevel.js +68 -9
- package/dist/LogLevel.js.map +1 -1
- package/dist/Logger.d.ts +21 -7
- package/dist/Logger.d.ts.map +1 -1
- package/dist/Logger.js +26 -13
- package/dist/Logger.js.map +1 -1
- package/dist/ManagedRuntime.d.ts +82 -10
- package/dist/ManagedRuntime.d.ts.map +1 -1
- package/dist/ManagedRuntime.js +33 -2
- package/dist/ManagedRuntime.js.map +1 -1
- package/dist/Match.d.ts +215 -42
- package/dist/Match.d.ts.map +1 -1
- package/dist/Match.js +242 -59
- package/dist/Match.js.map +1 -1
- package/dist/Metric.d.ts +68 -41
- package/dist/Metric.d.ts.map +1 -1
- package/dist/Metric.js +60 -33
- package/dist/Metric.js.map +1 -1
- package/dist/MutableHashMap.d.ts +285 -40
- package/dist/MutableHashMap.d.ts.map +1 -1
- package/dist/MutableHashMap.js +128 -7
- package/dist/MutableHashMap.js.map +1 -1
- package/dist/MutableHashSet.d.ts +111 -4
- package/dist/MutableHashSet.d.ts.map +1 -1
- package/dist/MutableHashSet.js +98 -39
- package/dist/MutableHashSet.js.map +1 -1
- package/dist/MutableList.d.ts +24 -6
- package/dist/MutableList.d.ts.map +1 -1
- package/dist/MutableList.js +23 -5
- package/dist/MutableList.js.map +1 -1
- package/dist/MutableRef.d.ts +141 -4
- package/dist/MutableRef.d.ts.map +1 -1
- package/dist/MutableRef.js +73 -2
- package/dist/MutableRef.js.map +1 -1
- package/dist/Newtype.d.ts +20 -11
- package/dist/Newtype.d.ts.map +1 -1
- package/dist/Newtype.js +6 -6
- package/dist/Newtype.js.map +1 -1
- package/dist/NonEmptyIterable.d.ts +22 -6
- package/dist/NonEmptyIterable.d.ts.map +1 -1
- package/dist/NonEmptyIterable.js +6 -1
- package/dist/NonEmptyIterable.js.map +1 -1
- package/dist/Number.d.ts +434 -17
- package/dist/Number.d.ts.map +1 -1
- package/dist/Number.js +268 -13
- package/dist/Number.js.map +1 -1
- package/dist/Optic.d.ts +26 -33
- package/dist/Optic.d.ts.map +1 -1
- package/dist/Optic.js +18 -25
- package/dist/Optic.js.map +1 -1
- package/dist/Option.d.ts +186 -150
- package/dist/Option.d.ts.map +1 -1
- package/dist/Option.js +75 -72
- package/dist/Option.js.map +1 -1
- package/dist/Order.d.ts +93 -120
- package/dist/Order.d.ts.map +1 -1
- package/dist/Order.js +149 -142
- package/dist/Order.js.map +1 -1
- package/dist/Ordering.d.ts +37 -5
- package/dist/Ordering.d.ts.map +1 -1
- package/dist/Ordering.js +22 -3
- package/dist/Ordering.js.map +1 -1
- package/dist/PartitionedSemaphore.d.ts +238 -15
- package/dist/PartitionedSemaphore.d.ts.map +1 -1
- package/dist/PartitionedSemaphore.js +106 -8
- package/dist/PartitionedSemaphore.js.map +1 -1
- package/dist/Path.d.ts +34 -6
- package/dist/Path.d.ts.map +1 -1
- package/dist/Path.js +19 -5
- package/dist/Path.js.map +1 -1
- package/dist/Pipeable.d.ts +29 -4
- package/dist/Pipeable.d.ts.map +1 -1
- package/dist/Pipeable.js +16 -4
- package/dist/Pipeable.js.map +1 -1
- package/dist/PlatformError.d.ts +53 -4
- package/dist/PlatformError.d.ts.map +1 -1
- package/dist/PlatformError.js +45 -4
- package/dist/PlatformError.js.map +1 -1
- package/dist/Pool.d.ts +140 -14
- package/dist/Pool.d.ts.map +1 -1
- package/dist/Pool.js +63 -8
- package/dist/Pool.js.map +1 -1
- package/dist/Predicate.d.ts +98 -168
- package/dist/Predicate.d.ts.map +1 -1
- package/dist/Predicate.js +109 -120
- package/dist/Predicate.js.map +1 -1
- package/dist/PrimaryKey.d.ts +75 -9
- package/dist/PrimaryKey.d.ts.map +1 -1
- package/dist/PrimaryKey.js +70 -9
- package/dist/PrimaryKey.js.map +1 -1
- package/dist/PubSub.d.ts +241 -66
- package/dist/PubSub.d.ts.map +1 -1
- package/dist/PubSub.js +187 -52
- package/dist/PubSub.js.map +1 -1
- package/dist/Pull.d.ts +148 -3
- package/dist/Pull.d.ts.map +1 -1
- package/dist/Pull.js +69 -2
- package/dist/Pull.js.map +1 -1
- package/dist/Queue.d.ts +167 -59
- package/dist/Queue.d.ts.map +1 -1
- package/dist/Queue.js +163 -55
- package/dist/Queue.js.map +1 -1
- package/dist/Random.d.ts +71 -16
- package/dist/Random.d.ts.map +1 -1
- package/dist/Random.js +35 -0
- package/dist/Random.js.map +1 -1
- package/dist/RcMap.d.ts +171 -9
- package/dist/RcMap.d.ts.map +1 -1
- package/dist/RcMap.js +49 -3
- package/dist/RcMap.js.map +1 -1
- package/dist/RcRef.d.ts +73 -18
- package/dist/RcRef.d.ts.map +1 -1
- package/dist/RcRef.js +23 -3
- package/dist/RcRef.js.map +1 -1
- package/dist/Record.d.ts +174 -53
- package/dist/Record.d.ts.map +1 -1
- package/dist/Record.js +128 -23
- package/dist/Record.js.map +1 -1
- package/dist/Redactable.d.ts +27 -23
- package/dist/Redactable.d.ts.map +1 -1
- package/dist/Redactable.js +22 -18
- package/dist/Redactable.js.map +1 -1
- package/dist/Redacted.d.ts +82 -4
- package/dist/Redacted.d.ts.map +1 -1
- package/dist/Redacted.js +64 -4
- package/dist/Redacted.js.map +1 -1
- package/dist/Reducer.d.ts +17 -7
- package/dist/Reducer.d.ts.map +1 -1
- package/dist/Reducer.js +2 -4
- package/dist/Reducer.js.map +1 -1
- package/dist/Ref.d.ts +168 -32
- package/dist/Ref.d.ts.map +1 -1
- package/dist/Ref.js +135 -30
- package/dist/Ref.js.map +1 -1
- package/dist/References.d.ts +226 -30
- package/dist/References.d.ts.map +1 -1
- package/dist/References.js +162 -23
- package/dist/References.js.map +1 -1
- package/dist/RegExp.d.ts +15 -2
- package/dist/RegExp.d.ts.map +1 -1
- package/dist/RegExp.js +49 -3
- package/dist/RegExp.js.map +1 -1
- package/dist/Request.d.ts +218 -35
- package/dist/Request.d.ts.map +1 -1
- package/dist/Request.js +57 -10
- package/dist/Request.js.map +1 -1
- package/dist/RequestResolver.d.ts +213 -29
- package/dist/RequestResolver.d.ts.map +1 -1
- package/dist/RequestResolver.js +99 -11
- package/dist/RequestResolver.js.map +1 -1
- package/dist/Resource.d.ts +62 -3
- package/dist/Resource.d.ts.map +1 -1
- package/dist/Resource.js +52 -3
- package/dist/Resource.js.map +1 -1
- package/dist/Result.d.ts +380 -57
- package/dist/Result.d.ts.map +1 -1
- package/dist/Result.js +176 -32
- package/dist/Result.js.map +1 -1
- package/dist/Runtime.d.ts +124 -14
- package/dist/Runtime.d.ts.map +1 -1
- package/dist/Runtime.js +150 -25
- package/dist/Runtime.js.map +1 -1
- package/dist/Schedule.d.ts +436 -115
- package/dist/Schedule.d.ts.map +1 -1
- package/dist/Schedule.js +344 -107
- package/dist/Schedule.js.map +1 -1
- package/dist/Scheduler.d.ts +53 -4
- package/dist/Scheduler.d.ts.map +1 -1
- package/dist/Scheduler.js +42 -3
- package/dist/Scheduler.js.map +1 -1
- package/dist/Schema.d.ts +934 -239
- package/dist/Schema.d.ts.map +1 -1
- package/dist/Schema.js +655 -217
- package/dist/Schema.js.map +1 -1
- package/dist/SchemaAST.d.ts +239 -28
- package/dist/SchemaAST.d.ts.map +1 -1
- package/dist/SchemaAST.js +239 -28
- package/dist/SchemaAST.js.map +1 -1
- package/dist/SchemaGetter.d.ts +127 -129
- package/dist/SchemaGetter.d.ts.map +1 -1
- package/dist/SchemaGetter.js +115 -117
- package/dist/SchemaGetter.js.map +1 -1
- package/dist/SchemaIssue.d.ts +45 -56
- package/dist/SchemaIssue.d.ts.map +1 -1
- package/dist/SchemaIssue.js +39 -50
- package/dist/SchemaIssue.js.map +1 -1
- package/dist/SchemaParser.d.ts +254 -15
- package/dist/SchemaParser.d.ts.map +1 -1
- package/dist/SchemaParser.js +295 -33
- package/dist/SchemaParser.js.map +1 -1
- package/dist/SchemaRepresentation.d.ts +106 -77
- package/dist/SchemaRepresentation.d.ts.map +1 -1
- package/dist/SchemaRepresentation.js +101 -71
- package/dist/SchemaRepresentation.js.map +1 -1
- package/dist/SchemaTransformation.d.ts +92 -56
- package/dist/SchemaTransformation.d.ts.map +1 -1
- package/dist/SchemaTransformation.js +86 -50
- package/dist/SchemaTransformation.js.map +1 -1
- package/dist/SchemaUtils.d.ts +9 -0
- package/dist/SchemaUtils.d.ts.map +1 -1
- package/dist/SchemaUtils.js +38 -11
- package/dist/SchemaUtils.js.map +1 -1
- package/dist/Scope.d.ts +127 -25
- package/dist/Scope.d.ts.map +1 -1
- package/dist/Scope.js +91 -21
- package/dist/Scope.js.map +1 -1
- package/dist/ScopedCache.d.ts +364 -19
- package/dist/ScopedCache.d.ts.map +1 -1
- package/dist/ScopedCache.js +155 -7
- package/dist/ScopedCache.js.map +1 -1
- package/dist/ScopedRef.d.ts +69 -7
- package/dist/ScopedRef.d.ts.map +1 -1
- package/dist/ScopedRef.js +49 -5
- package/dist/ScopedRef.js.map +1 -1
- package/dist/Semaphore.d.ts +348 -29
- package/dist/Semaphore.d.ts.map +1 -1
- package/dist/Semaphore.js +103 -8
- package/dist/Semaphore.js.map +1 -1
- package/dist/Sink.d.ts +343 -45
- package/dist/Sink.d.ts.map +1 -1
- package/dist/Sink.js +194 -26
- package/dist/Sink.js.map +1 -1
- package/dist/Stdio.d.ts +72 -17
- package/dist/Stdio.d.ts.map +1 -1
- package/dist/Stdio.js +62 -16
- package/dist/Stdio.js.map +1 -1
- package/dist/Stream.d.ts +774 -224
- package/dist/Stream.d.ts.map +1 -1
- package/dist/Stream.js +333 -91
- package/dist/Stream.js.map +1 -1
- package/dist/String.d.ts +219 -47
- package/dist/String.d.ts.map +1 -1
- package/dist/String.js +179 -29
- package/dist/String.js.map +1 -1
- package/dist/Struct.d.ts +54 -110
- package/dist/Struct.d.ts.map +1 -1
- package/dist/Struct.js +26 -42
- package/dist/Struct.js.map +1 -1
- package/dist/SubscriptionRef.d.ts +341 -105
- package/dist/SubscriptionRef.d.ts.map +1 -1
- package/dist/SubscriptionRef.js +162 -44
- package/dist/SubscriptionRef.js.map +1 -1
- package/dist/Symbol.d.ts +25 -7
- package/dist/Symbol.d.ts.map +1 -1
- package/dist/Symbol.js +25 -7
- package/dist/Symbol.js.map +1 -1
- package/dist/SynchronizedRef.d.ts +529 -29
- package/dist/SynchronizedRef.d.ts.map +1 -1
- package/dist/SynchronizedRef.js +193 -11
- package/dist/SynchronizedRef.js.map +1 -1
- package/dist/Take.d.ts +36 -13
- package/dist/Take.d.ts.map +1 -1
- package/dist/Take.js +5 -0
- package/dist/Take.js.map +1 -1
- package/dist/Terminal.d.ts +76 -20
- package/dist/Terminal.d.ts.map +1 -1
- package/dist/Terminal.js +41 -5
- package/dist/Terminal.js.map +1 -1
- package/dist/Tracer.d.ts +74 -7
- package/dist/Tracer.d.ts.map +1 -1
- package/dist/Tracer.js +74 -7
- package/dist/Tracer.js.map +1 -1
- package/dist/Trie.d.ts +67 -30
- package/dist/Trie.d.ts.map +1 -1
- package/dist/Trie.js +7 -7
- package/dist/Trie.js.map +1 -1
- package/dist/Tuple.d.ts +96 -108
- package/dist/Tuple.d.ts.map +1 -1
- package/dist/Tuple.js +42 -52
- package/dist/Tuple.js.map +1 -1
- package/dist/TxChunk.d.ts +42 -9
- package/dist/TxChunk.d.ts.map +1 -1
- package/dist/TxChunk.js +42 -9
- package/dist/TxChunk.js.map +1 -1
- package/dist/TxDeferred.d.ts +85 -2
- package/dist/TxDeferred.d.ts.map +1 -1
- package/dist/TxDeferred.js +56 -2
- package/dist/TxDeferred.js.map +1 -1
- package/dist/TxHashMap.d.ts +20 -20
- package/dist/TxHashMap.js +8 -8
- package/dist/TxHashSet.d.ts +14 -14
- package/dist/TxHashSet.js +6 -6
- package/dist/TxPriorityQueue.d.ts +43 -8
- package/dist/TxPriorityQueue.d.ts.map +1 -1
- package/dist/TxPriorityQueue.js +41 -6
- package/dist/TxPriorityQueue.js.map +1 -1
- package/dist/TxPubSub.d.ts +98 -8
- package/dist/TxPubSub.d.ts.map +1 -1
- package/dist/TxPubSub.js +70 -8
- package/dist/TxPubSub.js.map +1 -1
- package/dist/TxQueue.d.ts +58 -17
- package/dist/TxQueue.d.ts.map +1 -1
- package/dist/TxQueue.js +10 -10
- package/dist/TxQueue.js.map +1 -1
- package/dist/TxReentrantLock.d.ts +88 -16
- package/dist/TxReentrantLock.d.ts.map +1 -1
- package/dist/TxReentrantLock.js +78 -14
- package/dist/TxReentrantLock.js.map +1 -1
- package/dist/TxRef.d.ts +113 -8
- package/dist/TxRef.d.ts.map +1 -1
- package/dist/TxRef.js +82 -8
- package/dist/TxRef.js.map +1 -1
- package/dist/TxSemaphore.d.ts +173 -14
- package/dist/TxSemaphore.d.ts.map +1 -1
- package/dist/TxSemaphore.js +130 -14
- package/dist/TxSemaphore.js.map +1 -1
- package/dist/TxSubscriptionRef.d.ts +206 -3
- package/dist/TxSubscriptionRef.d.ts.map +1 -1
- package/dist/TxSubscriptionRef.js +111 -3
- package/dist/TxSubscriptionRef.js.map +1 -1
- package/dist/Types.d.ts +68 -13
- package/dist/Types.d.ts.map +1 -1
- package/dist/UndefinedOr.d.ts +171 -30
- package/dist/UndefinedOr.d.ts.map +1 -1
- package/dist/UndefinedOr.js +115 -30
- package/dist/UndefinedOr.js.map +1 -1
- package/dist/Unify.d.ts +130 -22
- package/dist/Unify.d.ts.map +1 -1
- package/dist/Unify.js +36 -12
- package/dist/Unify.js.map +1 -1
- package/dist/Utils.d.ts +21 -16
- package/dist/Utils.d.ts.map +1 -1
- package/dist/Utils.js +14 -6
- package/dist/Utils.js.map +1 -1
- package/dist/index.d.ts +0 -5205
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +0 -5205
- package/dist/index.js.map +1 -1
- package/dist/internal/effect.js.map +1 -1
- package/dist/internal/request.js +3 -1
- package/dist/internal/request.js.map +1 -1
- package/dist/internal/schema/arbitrary.js +11 -1
- package/dist/internal/schema/arbitrary.js.map +1 -1
- package/dist/internal/schema/representation.js +21 -12
- package/dist/internal/schema/representation.js.map +1 -1
- package/dist/testing/TestConsole.d.ts +69 -0
- package/dist/testing/TestConsole.d.ts.map +1 -1
- package/dist/testing/TestConsole.js +73 -9
- package/dist/testing/TestConsole.js.map +1 -1
- package/dist/testing/TestSchema.d.ts +79 -30
- package/dist/testing/TestSchema.d.ts.map +1 -1
- package/dist/testing/TestSchema.js +69 -31
- package/dist/testing/TestSchema.js.map +1 -1
- package/dist/testing/index.d.ts +0 -107
- package/dist/testing/index.d.ts.map +1 -1
- package/dist/testing/index.js +0 -107
- package/dist/testing/index.js.map +1 -1
- package/dist/unstable/ai/AiError.d.ts +33 -5
- package/dist/unstable/ai/AiError.d.ts.map +1 -1
- package/dist/unstable/ai/AiError.js +33 -5
- package/dist/unstable/ai/AiError.js.map +1 -1
- package/dist/unstable/ai/AnthropicStructuredOutput.d.ts +9 -0
- package/dist/unstable/ai/AnthropicStructuredOutput.d.ts.map +1 -1
- package/dist/unstable/ai/AnthropicStructuredOutput.js +43 -11
- package/dist/unstable/ai/AnthropicStructuredOutput.js.map +1 -1
- package/dist/unstable/ai/Chat.d.ts +45 -6
- package/dist/unstable/ai/Chat.d.ts.map +1 -1
- package/dist/unstable/ai/Chat.js +73 -33
- package/dist/unstable/ai/Chat.js.map +1 -1
- package/dist/unstable/ai/EmbeddingModel.d.ts +104 -8
- package/dist/unstable/ai/EmbeddingModel.d.ts.map +1 -1
- package/dist/unstable/ai/EmbeddingModel.js +103 -7
- package/dist/unstable/ai/EmbeddingModel.js.map +1 -1
- package/dist/unstable/ai/IdGenerator.d.ts +8 -3
- package/dist/unstable/ai/IdGenerator.d.ts.map +1 -1
- package/dist/unstable/ai/IdGenerator.js +8 -3
- package/dist/unstable/ai/IdGenerator.js.map +1 -1
- package/dist/unstable/ai/LanguageModel.d.ts +51 -7
- package/dist/unstable/ai/LanguageModel.d.ts.map +1 -1
- package/dist/unstable/ai/LanguageModel.js +50 -6
- package/dist/unstable/ai/LanguageModel.js.map +1 -1
- package/dist/unstable/ai/McpSchema.d.ts +299 -169
- package/dist/unstable/ai/McpSchema.d.ts.map +1 -1
- package/dist/unstable/ai/McpSchema.js +278 -147
- package/dist/unstable/ai/McpSchema.js.map +1 -1
- package/dist/unstable/ai/McpServer.d.ts +108 -14
- package/dist/unstable/ai/McpServer.d.ts.map +1 -1
- package/dist/unstable/ai/McpServer.js +80 -10
- package/dist/unstable/ai/McpServer.js.map +1 -1
- package/dist/unstable/ai/Model.d.ts +35 -13
- package/dist/unstable/ai/Model.d.ts.map +1 -1
- package/dist/unstable/ai/Model.js +34 -12
- package/dist/unstable/ai/Model.js.map +1 -1
- package/dist/unstable/ai/OpenAiStructuredOutput.d.ts.map +1 -1
- package/dist/unstable/ai/OpenAiStructuredOutput.js +48 -1
- package/dist/unstable/ai/OpenAiStructuredOutput.js.map +1 -1
- package/dist/unstable/ai/Prompt.d.ts +24 -3
- package/dist/unstable/ai/Prompt.d.ts.map +1 -1
- package/dist/unstable/ai/Prompt.js +23 -2
- package/dist/unstable/ai/Prompt.js.map +1 -1
- package/dist/unstable/ai/Response.d.ts +71 -13
- package/dist/unstable/ai/Response.d.ts.map +1 -1
- package/dist/unstable/ai/Response.js +35 -1
- package/dist/unstable/ai/Response.js.map +1 -1
- package/dist/unstable/ai/ResponseIdTracker.d.ts +34 -12
- package/dist/unstable/ai/ResponseIdTracker.d.ts.map +1 -1
- package/dist/unstable/ai/ResponseIdTracker.js +33 -11
- package/dist/unstable/ai/ResponseIdTracker.js.map +1 -1
- package/dist/unstable/ai/Telemetry.d.ts +40 -27
- package/dist/unstable/ai/Telemetry.d.ts.map +1 -1
- package/dist/unstable/ai/Telemetry.js +34 -26
- package/dist/unstable/ai/Telemetry.js.map +1 -1
- package/dist/unstable/ai/Tokenizer.d.ts +41 -25
- package/dist/unstable/ai/Tokenizer.d.ts.map +1 -1
- package/dist/unstable/ai/Tokenizer.js +41 -25
- package/dist/unstable/ai/Tokenizer.js.map +1 -1
- package/dist/unstable/ai/Tool.d.ts +85 -24
- package/dist/unstable/ai/Tool.d.ts.map +1 -1
- package/dist/unstable/ai/Tool.js +84 -23
- package/dist/unstable/ai/Tool.js.map +1 -1
- package/dist/unstable/ai/Toolkit.d.ts +1 -1
- package/dist/unstable/ai/Toolkit.d.ts.map +1 -1
- package/dist/unstable/ai/Toolkit.js +1 -1
- package/dist/unstable/ai/Toolkit.js.map +1 -1
- package/dist/unstable/ai/index.d.ts +0 -560
- package/dist/unstable/ai/index.d.ts.map +1 -1
- package/dist/unstable/ai/index.js +0 -560
- package/dist/unstable/ai/index.js.map +1 -1
- package/dist/unstable/cli/Argument.js +1 -1
- package/dist/unstable/cli/Argument.js.map +1 -1
- package/dist/unstable/cli/CliError.d.ts +3 -3
- package/dist/unstable/cli/CliError.js +3 -3
- package/dist/unstable/cli/CliOutput.d.ts +1 -1
- package/dist/unstable/cli/Command.d.ts +136 -8
- package/dist/unstable/cli/Command.d.ts.map +1 -1
- package/dist/unstable/cli/Command.js +50 -4
- package/dist/unstable/cli/Command.js.map +1 -1
- package/dist/unstable/cli/Completions.d.ts +13 -0
- package/dist/unstable/cli/Completions.d.ts.map +1 -1
- package/dist/unstable/cli/Completions.js +41 -1
- package/dist/unstable/cli/Completions.js.map +1 -1
- package/dist/unstable/cli/Flag.d.ts +24 -12
- package/dist/unstable/cli/Flag.d.ts.map +1 -1
- package/dist/unstable/cli/Flag.js +18 -6
- package/dist/unstable/cli/Flag.js.map +1 -1
- package/dist/unstable/cli/GlobalFlag.d.ts +39 -8
- package/dist/unstable/cli/GlobalFlag.d.ts.map +1 -1
- package/dist/unstable/cli/GlobalFlag.js +39 -8
- package/dist/unstable/cli/GlobalFlag.js.map +1 -1
- package/dist/unstable/cli/Param.d.ts +128 -2
- package/dist/unstable/cli/Param.d.ts.map +1 -1
- package/dist/unstable/cli/Param.js +59 -7
- package/dist/unstable/cli/Param.js.map +1 -1
- package/dist/unstable/cli/Primitive.d.ts +3 -3
- package/dist/unstable/cli/Primitive.d.ts.map +1 -1
- package/dist/unstable/cli/Primitive.js +59 -10
- package/dist/unstable/cli/Primitive.js.map +1 -1
- package/dist/unstable/cli/Prompt.d.ts +37 -7
- package/dist/unstable/cli/Prompt.d.ts.map +1 -1
- package/dist/unstable/cli/Prompt.js +51 -9
- package/dist/unstable/cli/Prompt.js.map +1 -1
- package/dist/unstable/cli/index.d.ts +0 -220
- package/dist/unstable/cli/index.d.ts.map +1 -1
- package/dist/unstable/cli/index.js +0 -220
- package/dist/unstable/cli/index.js.map +1 -1
- package/dist/unstable/cli/internal/parser.js +1 -1
- package/dist/unstable/cluster/ClusterCron.d.ts +1 -1
- package/dist/unstable/cluster/ClusterError.d.ts +61 -22
- package/dist/unstable/cluster/ClusterError.d.ts.map +1 -1
- package/dist/unstable/cluster/ClusterError.js +61 -22
- package/dist/unstable/cluster/ClusterError.js.map +1 -1
- package/dist/unstable/cluster/ClusterMetrics.d.ts +58 -5
- package/dist/unstable/cluster/ClusterMetrics.d.ts.map +1 -1
- package/dist/unstable/cluster/ClusterMetrics.js +58 -5
- package/dist/unstable/cluster/ClusterMetrics.js.map +1 -1
- package/dist/unstable/cluster/ClusterSchema.d.ts +87 -26
- package/dist/unstable/cluster/ClusterSchema.d.ts.map +1 -1
- package/dist/unstable/cluster/ClusterSchema.js +87 -26
- package/dist/unstable/cluster/ClusterSchema.js.map +1 -1
- package/dist/unstable/cluster/ClusterWorkflowEngine.d.ts.map +1 -1
- package/dist/unstable/cluster/ClusterWorkflowEngine.js +49 -10
- package/dist/unstable/cluster/ClusterWorkflowEngine.js.map +1 -1
- package/dist/unstable/cluster/DeliverAt.d.ts +6 -1
- package/dist/unstable/cluster/DeliverAt.d.ts.map +1 -1
- package/dist/unstable/cluster/DeliverAt.js +6 -1
- package/dist/unstable/cluster/DeliverAt.js.map +1 -1
- package/dist/unstable/cluster/Entity.d.ts +33 -6
- package/dist/unstable/cluster/Entity.d.ts.map +1 -1
- package/dist/unstable/cluster/Entity.js +32 -5
- package/dist/unstable/cluster/Entity.js.map +1 -1
- package/dist/unstable/cluster/EntityAddress.d.ts +19 -0
- package/dist/unstable/cluster/EntityAddress.d.ts.map +1 -1
- package/dist/unstable/cluster/EntityAddress.js +19 -0
- package/dist/unstable/cluster/EntityAddress.js.map +1 -1
- package/dist/unstable/cluster/EntityId.d.ts +44 -7
- package/dist/unstable/cluster/EntityId.d.ts.map +1 -1
- package/dist/unstable/cluster/EntityId.js +44 -7
- package/dist/unstable/cluster/EntityId.js.map +1 -1
- package/dist/unstable/cluster/EntityResource.d.ts +5 -6
- package/dist/unstable/cluster/EntityResource.d.ts.map +1 -1
- package/dist/unstable/cluster/EntityResource.js +4 -5
- package/dist/unstable/cluster/EntityResource.js.map +1 -1
- package/dist/unstable/cluster/EntityType.d.ts +19 -0
- package/dist/unstable/cluster/EntityType.d.ts.map +1 -1
- package/dist/unstable/cluster/EntityType.js +19 -0
- package/dist/unstable/cluster/EntityType.js.map +1 -1
- package/dist/unstable/cluster/Envelope.d.ts +11 -11
- package/dist/unstable/cluster/Envelope.d.ts.map +1 -1
- package/dist/unstable/cluster/Envelope.js +11 -11
- package/dist/unstable/cluster/Envelope.js.map +1 -1
- package/dist/unstable/cluster/HttpRunner.d.ts +42 -22
- package/dist/unstable/cluster/HttpRunner.d.ts.map +1 -1
- package/dist/unstable/cluster/HttpRunner.js +42 -22
- package/dist/unstable/cluster/HttpRunner.js.map +1 -1
- package/dist/unstable/cluster/K8sHttpClient.d.ts +33 -14
- package/dist/unstable/cluster/K8sHttpClient.d.ts.map +1 -1
- package/dist/unstable/cluster/K8sHttpClient.js.map +1 -1
- package/dist/unstable/cluster/MachineId.d.ts +35 -9
- package/dist/unstable/cluster/MachineId.d.ts.map +1 -1
- package/dist/unstable/cluster/MachineId.js +35 -9
- package/dist/unstable/cluster/MachineId.js.map +1 -1
- package/dist/unstable/cluster/Message.d.ts +11 -11
- package/dist/unstable/cluster/Message.js +11 -11
- package/dist/unstable/cluster/MessageStorage.d.ts +38 -24
- package/dist/unstable/cluster/MessageStorage.d.ts.map +1 -1
- package/dist/unstable/cluster/MessageStorage.js +37 -23
- package/dist/unstable/cluster/MessageStorage.js.map +1 -1
- package/dist/unstable/cluster/Reply.d.ts +18 -8
- package/dist/unstable/cluster/Reply.d.ts.map +1 -1
- package/dist/unstable/cluster/Reply.js +18 -8
- package/dist/unstable/cluster/Reply.js.map +1 -1
- package/dist/unstable/cluster/Runner.d.ts +47 -14
- package/dist/unstable/cluster/Runner.d.ts.map +1 -1
- package/dist/unstable/cluster/Runner.js +47 -14
- package/dist/unstable/cluster/Runner.js.map +1 -1
- package/dist/unstable/cluster/RunnerAddress.d.ts +52 -10
- package/dist/unstable/cluster/RunnerAddress.d.ts.map +1 -1
- package/dist/unstable/cluster/RunnerAddress.js +52 -10
- package/dist/unstable/cluster/RunnerAddress.js.map +1 -1
- package/dist/unstable/cluster/RunnerHealth.d.ts +33 -16
- package/dist/unstable/cluster/RunnerHealth.d.ts.map +1 -1
- package/dist/unstable/cluster/RunnerHealth.js +33 -16
- package/dist/unstable/cluster/RunnerHealth.js.map +1 -1
- package/dist/unstable/cluster/RunnerServer.d.ts +19 -4
- package/dist/unstable/cluster/RunnerServer.d.ts.map +1 -1
- package/dist/unstable/cluster/RunnerServer.js +19 -4
- package/dist/unstable/cluster/RunnerServer.js.map +1 -1
- package/dist/unstable/cluster/Runners.d.ts +25 -1
- package/dist/unstable/cluster/Runners.d.ts.map +1 -1
- package/dist/unstable/cluster/Runners.js +24 -0
- package/dist/unstable/cluster/Runners.js.map +1 -1
- package/dist/unstable/cluster/ShardId.d.ts +24 -2
- package/dist/unstable/cluster/ShardId.d.ts.map +1 -1
- package/dist/unstable/cluster/ShardId.js +24 -2
- package/dist/unstable/cluster/ShardId.js.map +1 -1
- package/dist/unstable/cluster/Sharding.d.ts +27 -3
- package/dist/unstable/cluster/Sharding.d.ts.map +1 -1
- package/dist/unstable/cluster/Sharding.js +63 -20
- package/dist/unstable/cluster/Sharding.js.map +1 -1
- package/dist/unstable/cluster/ShardingConfig.d.ts +60 -16
- package/dist/unstable/cluster/ShardingConfig.d.ts.map +1 -1
- package/dist/unstable/cluster/ShardingConfig.js +61 -17
- package/dist/unstable/cluster/ShardingConfig.js.map +1 -1
- package/dist/unstable/cluster/ShardingRegistrationEvent.d.ts +27 -14
- package/dist/unstable/cluster/ShardingRegistrationEvent.d.ts.map +1 -1
- package/dist/unstable/cluster/ShardingRegistrationEvent.js +28 -15
- package/dist/unstable/cluster/ShardingRegistrationEvent.js.map +1 -1
- package/dist/unstable/cluster/SingleRunner.d.ts +26 -1
- package/dist/unstable/cluster/SingleRunner.d.ts.map +1 -1
- package/dist/unstable/cluster/SingleRunner.js +26 -1
- package/dist/unstable/cluster/SingleRunner.js.map +1 -1
- package/dist/unstable/cluster/Singleton.d.ts +51 -9
- package/dist/unstable/cluster/Singleton.d.ts.map +1 -1
- package/dist/unstable/cluster/Singleton.js +51 -9
- package/dist/unstable/cluster/Singleton.js.map +1 -1
- package/dist/unstable/cluster/SingletonAddress.d.ts +27 -13
- package/dist/unstable/cluster/SingletonAddress.d.ts.map +1 -1
- package/dist/unstable/cluster/SingletonAddress.js +27 -13
- package/dist/unstable/cluster/SingletonAddress.js.map +1 -1
- package/dist/unstable/cluster/Snowflake.d.ts +19 -5
- package/dist/unstable/cluster/Snowflake.d.ts.map +1 -1
- package/dist/unstable/cluster/Snowflake.js +19 -5
- package/dist/unstable/cluster/Snowflake.js.map +1 -1
- package/dist/unstable/cluster/SocketRunner.d.ts +27 -1
- package/dist/unstable/cluster/SocketRunner.d.ts.map +1 -1
- package/dist/unstable/cluster/SocketRunner.js +27 -1
- package/dist/unstable/cluster/SocketRunner.js.map +1 -1
- package/dist/unstable/cluster/SqlMessageStorage.d.ts +38 -0
- package/dist/unstable/cluster/SqlMessageStorage.d.ts.map +1 -1
- package/dist/unstable/cluster/SqlMessageStorage.js +73 -13
- package/dist/unstable/cluster/SqlMessageStorage.js.map +1 -1
- package/dist/unstable/cluster/SqlRunnerStorage.d.ts +20 -0
- package/dist/unstable/cluster/SqlRunnerStorage.d.ts.map +1 -1
- package/dist/unstable/cluster/SqlRunnerStorage.js +20 -0
- package/dist/unstable/cluster/SqlRunnerStorage.js.map +1 -1
- package/dist/unstable/cluster/TestRunner.d.ts +25 -14
- package/dist/unstable/cluster/TestRunner.d.ts.map +1 -1
- package/dist/unstable/cluster/TestRunner.js +25 -14
- package/dist/unstable/cluster/TestRunner.js.map +1 -1
- package/dist/unstable/cluster/index.d.ts +0 -790
- package/dist/unstable/cluster/index.d.ts.map +1 -1
- package/dist/unstable/cluster/index.js +0 -790
- package/dist/unstable/cluster/index.js.map +1 -1
- package/dist/unstable/devtools/DevTools.d.ts +41 -11
- package/dist/unstable/devtools/DevTools.d.ts.map +1 -1
- package/dist/unstable/devtools/DevTools.js +41 -11
- package/dist/unstable/devtools/DevTools.js.map +1 -1
- package/dist/unstable/devtools/DevToolsClient.d.ts +38 -0
- package/dist/unstable/devtools/DevToolsClient.d.ts.map +1 -1
- package/dist/unstable/devtools/DevToolsClient.js +68 -11
- package/dist/unstable/devtools/DevToolsClient.js.map +1 -1
- package/dist/unstable/devtools/DevToolsSchema.d.ts.map +1 -1
- package/dist/unstable/devtools/DevToolsSchema.js +24 -16
- package/dist/unstable/devtools/DevToolsSchema.js.map +1 -1
- package/dist/unstable/devtools/DevToolsServer.d.ts +20 -13
- package/dist/unstable/devtools/DevToolsServer.d.ts.map +1 -1
- package/dist/unstable/devtools/DevToolsServer.js +20 -13
- package/dist/unstable/devtools/DevToolsServer.js.map +1 -1
- package/dist/unstable/devtools/index.d.ts +0 -58
- package/dist/unstable/devtools/index.d.ts.map +1 -1
- package/dist/unstable/devtools/index.js +0 -58
- package/dist/unstable/devtools/index.js.map +1 -1
- package/dist/unstable/encoding/Msgpack.d.ts +2 -1
- package/dist/unstable/encoding/Msgpack.d.ts.map +1 -1
- package/dist/unstable/encoding/Msgpack.js +30 -14
- package/dist/unstable/encoding/Msgpack.js.map +1 -1
- package/dist/unstable/encoding/Ndjson.d.ts +28 -14
- package/dist/unstable/encoding/Ndjson.d.ts.map +1 -1
- package/dist/unstable/encoding/Ndjson.js +28 -14
- package/dist/unstable/encoding/Ndjson.js.map +1 -1
- package/dist/unstable/encoding/Sse.d.ts +38 -17
- package/dist/unstable/encoding/Sse.d.ts.map +1 -1
- package/dist/unstable/encoding/Sse.js +3 -3
- package/dist/unstable/encoding/Sse.js.map +1 -1
- package/dist/unstable/encoding/index.d.ts +0 -49
- package/dist/unstable/encoding/index.d.ts.map +1 -1
- package/dist/unstable/encoding/index.js +0 -49
- package/dist/unstable/encoding/index.js.map +1 -1
- package/dist/unstable/eventlog/Event.d.ts.map +1 -1
- package/dist/unstable/eventlog/Event.js +28 -13
- package/dist/unstable/eventlog/Event.js.map +1 -1
- package/dist/unstable/eventlog/EventGroup.d.ts +23 -15
- package/dist/unstable/eventlog/EventGroup.d.ts.map +1 -1
- package/dist/unstable/eventlog/EventGroup.js +22 -14
- package/dist/unstable/eventlog/EventGroup.js.map +1 -1
- package/dist/unstable/eventlog/EventJournal.d.ts +7 -7
- package/dist/unstable/eventlog/EventJournal.d.ts.map +1 -1
- package/dist/unstable/eventlog/EventJournal.js +36 -19
- package/dist/unstable/eventlog/EventJournal.js.map +1 -1
- package/dist/unstable/eventlog/EventLog.d.ts +63 -25
- package/dist/unstable/eventlog/EventLog.d.ts.map +1 -1
- package/dist/unstable/eventlog/EventLog.js +61 -23
- package/dist/unstable/eventlog/EventLog.js.map +1 -1
- package/dist/unstable/eventlog/EventLogEncryption.d.ts +8 -3
- package/dist/unstable/eventlog/EventLogEncryption.d.ts.map +1 -1
- package/dist/unstable/eventlog/EventLogEncryption.js +8 -3
- package/dist/unstable/eventlog/EventLogEncryption.js.map +1 -1
- package/dist/unstable/eventlog/EventLogMessage.d.ts +49 -40
- package/dist/unstable/eventlog/EventLogMessage.d.ts.map +1 -1
- package/dist/unstable/eventlog/EventLogMessage.js +28 -28
- package/dist/unstable/eventlog/EventLogMessage.js.map +1 -1
- package/dist/unstable/eventlog/EventLogRemote.d.ts +14 -4
- package/dist/unstable/eventlog/EventLogRemote.d.ts.map +1 -1
- package/dist/unstable/eventlog/EventLogRemote.js +14 -4
- package/dist/unstable/eventlog/EventLogRemote.js.map +1 -1
- package/dist/unstable/eventlog/EventLogServer.d.ts +7 -2
- package/dist/unstable/eventlog/EventLogServer.d.ts.map +1 -1
- package/dist/unstable/eventlog/EventLogServer.js +7 -2
- package/dist/unstable/eventlog/EventLogServer.js.map +1 -1
- package/dist/unstable/eventlog/EventLogServerEncrypted.d.ts +24 -2
- package/dist/unstable/eventlog/EventLogServerEncrypted.d.ts.map +1 -1
- package/dist/unstable/eventlog/EventLogServerEncrypted.js +24 -2
- package/dist/unstable/eventlog/EventLogServerEncrypted.js.map +1 -1
- package/dist/unstable/eventlog/EventLogServerUnencrypted.d.ts +82 -7
- package/dist/unstable/eventlog/EventLogServerUnencrypted.d.ts.map +1 -1
- package/dist/unstable/eventlog/EventLogServerUnencrypted.js +119 -22
- package/dist/unstable/eventlog/EventLogServerUnencrypted.js.map +1 -1
- package/dist/unstable/eventlog/EventLogSessionAuth.d.ts +33 -7
- package/dist/unstable/eventlog/EventLogSessionAuth.d.ts.map +1 -1
- package/dist/unstable/eventlog/EventLogSessionAuth.js +68 -24
- package/dist/unstable/eventlog/EventLogSessionAuth.js.map +1 -1
- package/dist/unstable/eventlog/SqlEventJournal.d.ts +21 -0
- package/dist/unstable/eventlog/SqlEventJournal.d.ts.map +1 -1
- package/dist/unstable/eventlog/SqlEventJournal.js +50 -14
- package/dist/unstable/eventlog/SqlEventJournal.js.map +1 -1
- package/dist/unstable/eventlog/SqlEventLogServerEncrypted.d.ts +39 -15
- package/dist/unstable/eventlog/SqlEventLogServerEncrypted.d.ts.map +1 -1
- package/dist/unstable/eventlog/SqlEventLogServerEncrypted.js +39 -15
- package/dist/unstable/eventlog/SqlEventLogServerEncrypted.js.map +1 -1
- package/dist/unstable/eventlog/SqlEventLogServerUnencrypted.d.ts.map +1 -1
- package/dist/unstable/eventlog/SqlEventLogServerUnencrypted.js +30 -11
- package/dist/unstable/eventlog/SqlEventLogServerUnencrypted.js.map +1 -1
- package/dist/unstable/eventlog/index.d.ts +0 -240
- package/dist/unstable/eventlog/index.d.ts.map +1 -1
- package/dist/unstable/eventlog/index.js +0 -240
- package/dist/unstable/eventlog/index.js.map +1 -1
- package/dist/unstable/http/Cookies.d.ts +99 -52
- package/dist/unstable/http/Cookies.d.ts.map +1 -1
- package/dist/unstable/http/Cookies.js +77 -30
- package/dist/unstable/http/Cookies.js.map +1 -1
- package/dist/unstable/http/Etag.d.ts +43 -13
- package/dist/unstable/http/Etag.d.ts.map +1 -1
- package/dist/unstable/http/Etag.js +43 -13
- package/dist/unstable/http/Etag.js.map +1 -1
- package/dist/unstable/http/FetchHttpClient.d.ts +59 -17
- package/dist/unstable/http/FetchHttpClient.d.ts.map +1 -1
- package/dist/unstable/http/FetchHttpClient.js +59 -17
- package/dist/unstable/http/FetchHttpClient.js.map +1 -1
- package/dist/unstable/http/Headers.d.ts +60 -22
- package/dist/unstable/http/Headers.d.ts.map +1 -1
- package/dist/unstable/http/Headers.js +58 -20
- package/dist/unstable/http/Headers.js.map +1 -1
- package/dist/unstable/http/HttpBody.d.ts +6 -2
- package/dist/unstable/http/HttpBody.d.ts.map +1 -1
- package/dist/unstable/http/HttpBody.js +59 -15
- package/dist/unstable/http/HttpBody.js.map +1 -1
- package/dist/unstable/http/HttpClient.d.ts +66 -30
- package/dist/unstable/http/HttpClient.d.ts.map +1 -1
- package/dist/unstable/http/HttpClient.js +17 -7
- package/dist/unstable/http/HttpClient.js.map +1 -1
- package/dist/unstable/http/HttpClientError.d.ts +15 -14
- package/dist/unstable/http/HttpClientError.d.ts.map +1 -1
- package/dist/unstable/http/HttpClientError.js +39 -22
- package/dist/unstable/http/HttpClientError.js.map +1 -1
- package/dist/unstable/http/HttpClientRequest.d.ts +37 -16
- package/dist/unstable/http/HttpClientRequest.d.ts.map +1 -1
- package/dist/unstable/http/HttpClientRequest.js +37 -16
- package/dist/unstable/http/HttpClientRequest.js.map +1 -1
- package/dist/unstable/http/HttpClientResponse.d.ts +35 -16
- package/dist/unstable/http/HttpClientResponse.d.ts.map +1 -1
- package/dist/unstable/http/HttpClientResponse.js +33 -14
- package/dist/unstable/http/HttpClientResponse.js.map +1 -1
- package/dist/unstable/http/HttpEffect.d.ts +3 -3
- package/dist/unstable/http/HttpEffect.d.ts.map +1 -1
- package/dist/unstable/http/HttpEffect.js +3 -3
- package/dist/unstable/http/HttpEffect.js.map +1 -1
- package/dist/unstable/http/HttpMethod.d.ts +46 -20
- package/dist/unstable/http/HttpMethod.d.ts.map +1 -1
- package/dist/unstable/http/HttpMethod.js +46 -20
- package/dist/unstable/http/HttpMethod.js.map +1 -1
- package/dist/unstable/http/HttpRouter.d.ts +19 -14
- package/dist/unstable/http/HttpRouter.d.ts.map +1 -1
- package/dist/unstable/http/HttpRouter.js +54 -26
- package/dist/unstable/http/HttpRouter.js.map +1 -1
- package/dist/unstable/http/HttpServer.d.ts +34 -21
- package/dist/unstable/http/HttpServer.d.ts.map +1 -1
- package/dist/unstable/http/HttpServer.js +34 -21
- package/dist/unstable/http/HttpServer.js.map +1 -1
- package/dist/unstable/http/HttpServerError.d.ts +41 -28
- package/dist/unstable/http/HttpServerError.d.ts.map +1 -1
- package/dist/unstable/http/HttpServerError.js +39 -26
- package/dist/unstable/http/HttpServerError.js.map +1 -1
- package/dist/unstable/http/HttpServerRequest.d.ts +53 -21
- package/dist/unstable/http/HttpServerRequest.d.ts.map +1 -1
- package/dist/unstable/http/HttpServerRequest.js +20 -5
- package/dist/unstable/http/HttpServerRequest.js.map +1 -1
- package/dist/unstable/http/HttpServerRespondable.d.ts.map +1 -1
- package/dist/unstable/http/HttpServerRespondable.js +28 -14
- package/dist/unstable/http/HttpServerRespondable.js.map +1 -1
- package/dist/unstable/http/HttpServerResponse.d.ts +64 -42
- package/dist/unstable/http/HttpServerResponse.d.ts.map +1 -1
- package/dist/unstable/http/HttpServerResponse.js +48 -26
- package/dist/unstable/http/HttpServerResponse.js.map +1 -1
- package/dist/unstable/http/HttpStaticServer.d.ts +30 -13
- package/dist/unstable/http/HttpStaticServer.d.ts.map +1 -1
- package/dist/unstable/http/HttpStaticServer.js +29 -12
- package/dist/unstable/http/HttpStaticServer.js.map +1 -1
- package/dist/unstable/http/HttpTraceContext.d.ts +32 -19
- package/dist/unstable/http/HttpTraceContext.d.ts.map +1 -1
- package/dist/unstable/http/HttpTraceContext.js +32 -19
- package/dist/unstable/http/HttpTraceContext.js.map +1 -1
- package/dist/unstable/http/Multipart.d.ts +39 -19
- package/dist/unstable/http/Multipart.d.ts.map +1 -1
- package/dist/unstable/http/Multipart.js +39 -19
- package/dist/unstable/http/Multipart.js.map +1 -1
- package/dist/unstable/http/Template.d.ts +27 -14
- package/dist/unstable/http/Template.d.ts.map +1 -1
- package/dist/unstable/http/Template.js +25 -12
- package/dist/unstable/http/Template.js.map +1 -1
- package/dist/unstable/http/Url.d.ts +41 -28
- package/dist/unstable/http/Url.d.ts.map +1 -1
- package/dist/unstable/http/Url.js +32 -17
- package/dist/unstable/http/Url.js.map +1 -1
- package/dist/unstable/http/UrlParams.d.ts +43 -28
- package/dist/unstable/http/UrlParams.d.ts.map +1 -1
- package/dist/unstable/http/UrlParams.js +40 -25
- package/dist/unstable/http/UrlParams.js.map +1 -1
- package/dist/unstable/http/index.d.ts +0 -452
- package/dist/unstable/http/index.d.ts.map +1 -1
- package/dist/unstable/http/index.js +0 -452
- package/dist/unstable/http/index.js.map +1 -1
- package/dist/unstable/httpapi/HttpApi.d.ts +50 -26
- package/dist/unstable/httpapi/HttpApi.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApi.js +3 -3
- package/dist/unstable/httpapi/HttpApi.js.map +1 -1
- package/dist/unstable/httpapi/HttpApiBuilder.d.ts +3 -3
- package/dist/unstable/httpapi/HttpApiBuilder.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApiBuilder.js +39 -25
- package/dist/unstable/httpapi/HttpApiBuilder.js.map +1 -1
- package/dist/unstable/httpapi/HttpApiClient.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApiClient.js +28 -16
- package/dist/unstable/httpapi/HttpApiClient.js.map +1 -1
- package/dist/unstable/httpapi/HttpApiEndpoint.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApiEndpoint.js +51 -23
- package/dist/unstable/httpapi/HttpApiEndpoint.js.map +1 -1
- package/dist/unstable/httpapi/HttpApiError.d.ts +2 -2
- package/dist/unstable/httpapi/HttpApiError.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApiError.js +37 -17
- package/dist/unstable/httpapi/HttpApiError.js.map +1 -1
- package/dist/unstable/httpapi/HttpApiGroup.d.ts +34 -23
- package/dist/unstable/httpapi/HttpApiGroup.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApiGroup.js.map +1 -1
- package/dist/unstable/httpapi/HttpApiMiddleware.d.ts +49 -25
- package/dist/unstable/httpapi/HttpApiMiddleware.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApiMiddleware.js +49 -25
- package/dist/unstable/httpapi/HttpApiMiddleware.js.map +1 -1
- package/dist/unstable/httpapi/HttpApiScalar.d.ts +4 -1
- package/dist/unstable/httpapi/HttpApiScalar.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApiScalar.js +28 -16
- package/dist/unstable/httpapi/HttpApiScalar.js.map +1 -1
- package/dist/unstable/httpapi/HttpApiSchema.d.ts +43 -43
- package/dist/unstable/httpapi/HttpApiSchema.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApiSchema.js +42 -42
- package/dist/unstable/httpapi/HttpApiSchema.js.map +1 -1
- package/dist/unstable/httpapi/HttpApiSecurity.d.ts +54 -24
- package/dist/unstable/httpapi/HttpApiSecurity.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApiSecurity.js +54 -24
- package/dist/unstable/httpapi/HttpApiSecurity.js.map +1 -1
- package/dist/unstable/httpapi/HttpApiSwagger.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApiSwagger.js +28 -16
- package/dist/unstable/httpapi/HttpApiSwagger.js.map +1 -1
- package/dist/unstable/httpapi/HttpApiTest.d.ts +1 -1
- package/dist/unstable/httpapi/HttpApiTest.js +1 -1
- package/dist/unstable/httpapi/OpenApi.d.ts +7 -1
- package/dist/unstable/httpapi/OpenApi.d.ts.map +1 -1
- package/dist/unstable/httpapi/OpenApi.js +45 -27
- package/dist/unstable/httpapi/OpenApi.js.map +1 -1
- package/dist/unstable/httpapi/index.d.ts +0 -311
- package/dist/unstable/httpapi/index.d.ts.map +1 -1
- package/dist/unstable/httpapi/index.js +0 -311
- package/dist/unstable/httpapi/index.js.map +1 -1
- package/dist/unstable/observability/Otlp.d.ts +31 -16
- package/dist/unstable/observability/Otlp.d.ts.map +1 -1
- package/dist/unstable/observability/Otlp.js.map +1 -1
- package/dist/unstable/observability/OtlpLogger.d.ts +1 -1
- package/dist/unstable/observability/OtlpLogger.d.ts.map +1 -1
- package/dist/unstable/observability/OtlpLogger.js +31 -15
- package/dist/unstable/observability/OtlpLogger.js.map +1 -1
- package/dist/unstable/observability/OtlpResource.d.ts.map +1 -1
- package/dist/unstable/observability/OtlpResource.js +33 -15
- package/dist/unstable/observability/OtlpResource.js.map +1 -1
- package/dist/unstable/observability/OtlpSerialization.d.ts +27 -16
- package/dist/unstable/observability/OtlpSerialization.d.ts.map +1 -1
- package/dist/unstable/observability/OtlpSerialization.js +27 -16
- package/dist/unstable/observability/OtlpSerialization.js.map +1 -1
- package/dist/unstable/observability/PrometheusMetrics.d.ts +3 -3
- package/dist/unstable/observability/PrometheusMetrics.js +3 -3
- package/dist/unstable/observability/index.d.ts +0 -183
- package/dist/unstable/observability/index.d.ts.map +1 -1
- package/dist/unstable/observability/index.js +0 -183
- package/dist/unstable/observability/index.js.map +1 -1
- package/dist/unstable/persistence/KeyValueStore.d.ts +12 -4
- package/dist/unstable/persistence/KeyValueStore.d.ts.map +1 -1
- package/dist/unstable/persistence/KeyValueStore.js +10 -2
- package/dist/unstable/persistence/KeyValueStore.js.map +1 -1
- package/dist/unstable/persistence/Persistable.d.ts +8 -3
- package/dist/unstable/persistence/Persistable.d.ts.map +1 -1
- package/dist/unstable/persistence/Persistable.js +8 -3
- package/dist/unstable/persistence/Persistable.js.map +1 -1
- package/dist/unstable/persistence/PersistedCache.d.ts +29 -16
- package/dist/unstable/persistence/PersistedCache.d.ts.map +1 -1
- package/dist/unstable/persistence/PersistedCache.js +27 -14
- package/dist/unstable/persistence/PersistedCache.js.map +1 -1
- package/dist/unstable/persistence/PersistedQueue.d.ts +10 -5
- package/dist/unstable/persistence/PersistedQueue.d.ts.map +1 -1
- package/dist/unstable/persistence/PersistedQueue.js +9 -4
- package/dist/unstable/persistence/PersistedQueue.js.map +1 -1
- package/dist/unstable/persistence/RateLimiter.d.ts +20 -10
- package/dist/unstable/persistence/RateLimiter.d.ts.map +1 -1
- package/dist/unstable/persistence/RateLimiter.js +19 -9
- package/dist/unstable/persistence/RateLimiter.js.map +1 -1
- package/dist/unstable/persistence/Redis.d.ts.map +1 -1
- package/dist/unstable/persistence/Redis.js +33 -15
- package/dist/unstable/persistence/Redis.js.map +1 -1
- package/dist/unstable/persistence/index.d.ts +0 -147
- package/dist/unstable/persistence/index.d.ts.map +1 -1
- package/dist/unstable/persistence/index.js +0 -147
- package/dist/unstable/persistence/index.js.map +1 -1
- package/dist/unstable/process/ChildProcess.d.ts +14 -14
- package/dist/unstable/process/ChildProcess.js +7 -7
- package/dist/unstable/process/ChildProcessSpawner.d.ts +17 -5
- package/dist/unstable/process/ChildProcessSpawner.d.ts.map +1 -1
- package/dist/unstable/process/ChildProcessSpawner.js +17 -5
- package/dist/unstable/process/ChildProcessSpawner.js.map +1 -1
- package/dist/unstable/process/index.d.ts +0 -45
- package/dist/unstable/process/index.d.ts.map +1 -1
- package/dist/unstable/process/index.js +0 -45
- package/dist/unstable/process/index.js.map +1 -1
- package/dist/unstable/reactivity/AsyncResult.d.ts +74 -22
- package/dist/unstable/reactivity/AsyncResult.d.ts.map +1 -1
- package/dist/unstable/reactivity/AsyncResult.js +52 -20
- package/dist/unstable/reactivity/AsyncResult.js.map +1 -1
- package/dist/unstable/reactivity/Atom.d.ts +81 -35
- package/dist/unstable/reactivity/Atom.d.ts.map +1 -1
- package/dist/unstable/reactivity/Atom.js +70 -32
- package/dist/unstable/reactivity/Atom.js.map +1 -1
- package/dist/unstable/reactivity/AtomRef.d.ts +32 -16
- package/dist/unstable/reactivity/AtomRef.d.ts.map +1 -1
- package/dist/unstable/reactivity/AtomRef.js +52 -25
- package/dist/unstable/reactivity/AtomRef.js.map +1 -1
- package/dist/unstable/reactivity/AtomRegistry.d.ts +81 -20
- package/dist/unstable/reactivity/AtomRegistry.d.ts.map +1 -1
- package/dist/unstable/reactivity/AtomRegistry.js +81 -20
- package/dist/unstable/reactivity/AtomRegistry.js.map +1 -1
- package/dist/unstable/reactivity/Hydration.d.ts +6 -1
- package/dist/unstable/reactivity/Hydration.d.ts.map +1 -1
- package/dist/unstable/reactivity/Hydration.js +37 -17
- package/dist/unstable/reactivity/Hydration.js.map +1 -1
- package/dist/unstable/reactivity/Reactivity.d.ts +44 -21
- package/dist/unstable/reactivity/Reactivity.d.ts.map +1 -1
- package/dist/unstable/reactivity/Reactivity.js +44 -21
- package/dist/unstable/reactivity/Reactivity.js.map +1 -1
- package/dist/unstable/reactivity/index.d.ts +0 -166
- package/dist/unstable/reactivity/index.d.ts.map +1 -1
- package/dist/unstable/reactivity/index.js +0 -166
- package/dist/unstable/reactivity/index.js.map +1 -1
- package/dist/unstable/rpc/Rpc.d.ts +47 -32
- package/dist/unstable/rpc/Rpc.d.ts.map +1 -1
- package/dist/unstable/rpc/Rpc.js +15 -11
- package/dist/unstable/rpc/Rpc.js.map +1 -1
- package/dist/unstable/rpc/RpcClient.d.ts +27 -12
- package/dist/unstable/rpc/RpcClient.d.ts.map +1 -1
- package/dist/unstable/rpc/RpcClient.js +27 -12
- package/dist/unstable/rpc/RpcClient.js.map +1 -1
- package/dist/unstable/rpc/RpcClientError.d.ts +31 -17
- package/dist/unstable/rpc/RpcClientError.d.ts.map +1 -1
- package/dist/unstable/rpc/RpcClientError.js +31 -17
- package/dist/unstable/rpc/RpcClientError.js.map +1 -1
- package/dist/unstable/rpc/RpcGroup.d.ts +29 -18
- package/dist/unstable/rpc/RpcGroup.d.ts.map +1 -1
- package/dist/unstable/rpc/RpcGroup.js.map +1 -1
- package/dist/unstable/rpc/RpcMessage.d.ts +37 -19
- package/dist/unstable/rpc/RpcMessage.d.ts.map +1 -1
- package/dist/unstable/rpc/RpcMessage.js +4 -4
- package/dist/unstable/rpc/RpcMessage.js.map +1 -1
- package/dist/unstable/rpc/RpcMiddleware.d.ts +31 -21
- package/dist/unstable/rpc/RpcMiddleware.d.ts.map +1 -1
- package/dist/unstable/rpc/RpcMiddleware.js +31 -21
- package/dist/unstable/rpc/RpcMiddleware.js.map +1 -1
- package/dist/unstable/rpc/RpcSchema.d.ts +30 -20
- package/dist/unstable/rpc/RpcSchema.d.ts.map +1 -1
- package/dist/unstable/rpc/RpcSchema.js +30 -20
- package/dist/unstable/rpc/RpcSchema.js.map +1 -1
- package/dist/unstable/rpc/RpcSerialization.d.ts +50 -33
- package/dist/unstable/rpc/RpcSerialization.d.ts.map +1 -1
- package/dist/unstable/rpc/RpcSerialization.js +48 -31
- package/dist/unstable/rpc/RpcSerialization.js.map +1 -1
- package/dist/unstable/rpc/RpcServer.d.ts +22 -17
- package/dist/unstable/rpc/RpcServer.d.ts.map +1 -1
- package/dist/unstable/rpc/RpcServer.js +22 -17
- package/dist/unstable/rpc/RpcServer.js.map +1 -1
- package/dist/unstable/rpc/RpcTest.d.ts +31 -15
- package/dist/unstable/rpc/RpcTest.d.ts.map +1 -1
- package/dist/unstable/rpc/RpcTest.js +31 -15
- package/dist/unstable/rpc/RpcTest.js.map +1 -1
- package/dist/unstable/rpc/RpcWorker.d.ts +29 -14
- package/dist/unstable/rpc/RpcWorker.d.ts.map +1 -1
- package/dist/unstable/rpc/RpcWorker.js.map +1 -1
- package/dist/unstable/rpc/index.d.ts +0 -272
- package/dist/unstable/rpc/index.d.ts.map +1 -1
- package/dist/unstable/rpc/index.js +0 -272
- package/dist/unstable/rpc/index.js.map +1 -1
- package/dist/unstable/schema/Model.d.ts +32 -33
- package/dist/unstable/schema/Model.d.ts.map +1 -1
- package/dist/unstable/schema/Model.js +25 -26
- package/dist/unstable/schema/Model.js.map +1 -1
- package/dist/unstable/schema/VariantSchema.d.ts +1 -1
- package/dist/unstable/schema/VariantSchema.js +1 -1
- package/dist/unstable/schema/index.d.ts +0 -37
- package/dist/unstable/schema/index.d.ts.map +1 -1
- package/dist/unstable/schema/index.js +0 -37
- package/dist/unstable/schema/index.js.map +1 -1
- package/dist/unstable/socket/Socket.d.ts +8 -2
- package/dist/unstable/socket/Socket.d.ts.map +1 -1
- package/dist/unstable/socket/Socket.js +8 -2
- package/dist/unstable/socket/Socket.js.map +1 -1
- package/dist/unstable/socket/SocketServer.d.ts +2 -2
- package/dist/unstable/socket/SocketServer.js +1 -1
- package/dist/unstable/socket/index.d.ts +0 -44
- package/dist/unstable/socket/index.d.ts.map +1 -1
- package/dist/unstable/socket/index.js +0 -44
- package/dist/unstable/socket/index.js.map +1 -1
- package/dist/unstable/sql/Migrator.d.ts.map +1 -1
- package/dist/unstable/sql/Migrator.js +39 -18
- package/dist/unstable/sql/Migrator.js.map +1 -1
- package/dist/unstable/sql/SqlClient.d.ts +7 -2
- package/dist/unstable/sql/SqlClient.d.ts.map +1 -1
- package/dist/unstable/sql/SqlClient.js +7 -2
- package/dist/unstable/sql/SqlClient.js.map +1 -1
- package/dist/unstable/sql/SqlConnection.d.ts +1 -1
- package/dist/unstable/sql/SqlConnection.js +1 -1
- package/dist/unstable/sql/SqlError.d.ts +2 -2
- package/dist/unstable/sql/SqlError.d.ts.map +1 -1
- package/dist/unstable/sql/SqlError.js +33 -17
- package/dist/unstable/sql/SqlError.js.map +1 -1
- package/dist/unstable/sql/SqlResolver.d.ts +3 -3
- package/dist/unstable/sql/SqlResolver.js +1 -1
- package/dist/unstable/sql/SqlSchema.d.ts +51 -21
- package/dist/unstable/sql/SqlSchema.d.ts.map +1 -1
- package/dist/unstable/sql/SqlSchema.js +51 -21
- package/dist/unstable/sql/SqlSchema.js.map +1 -1
- package/dist/unstable/sql/Statement.d.ts +1 -1
- package/dist/unstable/sql/Statement.d.ts.map +1 -1
- package/dist/unstable/sql/Statement.js +34 -14
- package/dist/unstable/sql/Statement.js.map +1 -1
- package/dist/unstable/sql/index.d.ts +0 -178
- package/dist/unstable/sql/index.d.ts.map +1 -1
- package/dist/unstable/sql/index.js +0 -178
- package/dist/unstable/sql/index.js.map +1 -1
- package/dist/unstable/workers/Transferable.d.ts +32 -21
- package/dist/unstable/workers/Transferable.d.ts.map +1 -1
- package/dist/unstable/workers/Transferable.js +32 -21
- package/dist/unstable/workers/Transferable.js.map +1 -1
- package/dist/unstable/workers/Worker.d.ts +37 -24
- package/dist/unstable/workers/Worker.d.ts.map +1 -1
- package/dist/unstable/workers/Worker.js +35 -22
- package/dist/unstable/workers/Worker.js.map +1 -1
- package/dist/unstable/workers/WorkerError.d.ts +1 -1
- package/dist/unstable/workers/WorkerError.d.ts.map +1 -1
- package/dist/unstable/workers/WorkerError.js +32 -16
- package/dist/unstable/workers/WorkerError.js.map +1 -1
- package/dist/unstable/workers/WorkerRunner.d.ts +31 -20
- package/dist/unstable/workers/WorkerRunner.d.ts.map +1 -1
- package/dist/unstable/workers/WorkerRunner.js +31 -20
- package/dist/unstable/workers/WorkerRunner.js.map +1 -1
- package/dist/unstable/workers/index.d.ts +0 -80
- package/dist/unstable/workers/index.d.ts.map +1 -1
- package/dist/unstable/workers/index.js +0 -80
- package/dist/unstable/workers/index.js.map +1 -1
- package/dist/unstable/workflow/DurableClock.d.ts +2 -2
- package/dist/unstable/workflow/DurableClock.d.ts.map +1 -1
- package/dist/unstable/workflow/DurableClock.js +25 -13
- package/dist/unstable/workflow/DurableClock.js.map +1 -1
- package/dist/unstable/workflow/DurableDeferred.d.ts +12 -12
- package/dist/unstable/workflow/DurableDeferred.js +7 -7
- package/dist/unstable/workflow/DurableQueue.d.ts +36 -18
- package/dist/unstable/workflow/DurableQueue.d.ts.map +1 -1
- package/dist/unstable/workflow/DurableQueue.js +36 -18
- package/dist/unstable/workflow/DurableQueue.js.map +1 -1
- package/dist/unstable/workflow/Workflow.d.ts +22 -23
- package/dist/unstable/workflow/Workflow.d.ts.map +1 -1
- package/dist/unstable/workflow/Workflow.js +17 -18
- package/dist/unstable/workflow/Workflow.js.map +1 -1
- package/dist/unstable/workflow/WorkflowEngine.d.ts +26 -8
- package/dist/unstable/workflow/WorkflowEngine.d.ts.map +1 -1
- package/dist/unstable/workflow/WorkflowEngine.js +25 -7
- package/dist/unstable/workflow/WorkflowEngine.js.map +1 -1
- package/dist/unstable/workflow/index.d.ts +0 -160
- package/dist/unstable/workflow/index.d.ts.map +1 -1
- package/dist/unstable/workflow/index.js +0 -160
- package/dist/unstable/workflow/index.js.map +1 -1
- package/package.json +1 -1
- package/src/Array.ts +1557 -312
- package/src/BigDecimal.ts +646 -52
- package/src/BigInt.ts +474 -18
- package/src/Boolean.ts +239 -19
- package/src/Brand.ts +102 -11
- package/src/Cache.ts +96 -24
- package/src/Cause.ts +488 -200
- package/src/Channel.ts +647 -191
- package/src/ChannelSchema.ts +99 -6
- package/src/Chunk.ts +187 -54
- package/src/Clock.ts +60 -3
- package/src/Combiner.ts +21 -21
- package/src/Config.ts +135 -50
- package/src/ConfigProvider.ts +52 -29
- package/src/Console.ts +32 -7
- package/src/Context.ts +516 -50
- package/src/Cron.ts +116 -6
- package/src/Crypto.ts +30 -1
- package/src/Data.ts +92 -47
- package/src/DateTime.ts +313 -128
- package/src/Deferred.ts +345 -79
- package/src/Differ.ts +5 -0
- package/src/Duration.ts +203 -50
- package/src/Effect.ts +2044 -816
- package/src/Effectable.ts +16 -2
- package/src/Encoding.ts +146 -9
- package/src/Equal.ts +10 -11
- package/src/Equivalence.ts +49 -46
- package/src/ErrorReporter.ts +135 -16
- package/src/ExecutionPlan.ts +96 -26
- package/src/Exit.ts +149 -101
- package/src/Fiber.ts +321 -72
- package/src/FiberHandle.ts +6 -6
- package/src/FiberMap.ts +20 -20
- package/src/FiberSet.ts +21 -13
- package/src/FileSystem.ts +119 -39
- package/src/Filter.ts +221 -2
- package/src/Formatter.ts +4 -6
- package/src/Function.ts +164 -18
- package/src/Graph.ts +297 -25
- package/src/HKT.ts +59 -26
- package/src/Hash.ts +143 -23
- package/src/HashMap.ts +35 -37
- package/src/HashRing.ts +210 -9
- package/src/HashSet.ts +16 -16
- package/src/Inspectable.ts +86 -17
- package/src/Iterable.ts +261 -81
- package/src/JsonPatch.ts +79 -56
- package/src/JsonPointer.ts +5 -5
- package/src/JsonSchema.ts +77 -33
- package/src/Latch.ts +164 -13
- package/src/Layer.ts +297 -101
- package/src/LayerMap.ts +9 -2
- package/src/LogLevel.ts +96 -21
- package/src/Logger.ts +31 -15
- package/src/ManagedRuntime.ts +82 -10
- package/src/Match.ts +250 -59
- package/src/Metric.ts +68 -41
- package/src/MutableHashMap.ts +381 -52
- package/src/MutableHashSet.ts +145 -41
- package/src/MutableList.ts +24 -6
- package/src/MutableRef.ts +141 -4
- package/src/Newtype.ts +20 -11
- package/src/NonEmptyIterable.ts +22 -6
- package/src/Number.ts +434 -17
- package/src/Optic.ts +26 -33
- package/src/Option.ts +186 -150
- package/src/Order.ts +163 -161
- package/src/Ordering.ts +37 -5
- package/src/PartitionedSemaphore.ts +238 -15
- package/src/Path.ts +34 -6
- package/src/Pipeable.ts +29 -4
- package/src/PlatformError.ts +53 -4
- package/src/Pool.ts +174 -32
- package/src/Predicate.ts +151 -196
- package/src/PrimaryKey.ts +75 -9
- package/src/PubSub.ts +241 -66
- package/src/Pull.ts +148 -3
- package/src/Queue.ts +167 -59
- package/src/Random.ts +71 -16
- package/src/RcMap.ts +171 -9
- package/src/RcRef.ts +73 -18
- package/src/Record.ts +174 -53
- package/src/Redactable.ts +27 -23
- package/src/Redacted.ts +82 -4
- package/src/Reducer.ts +17 -7
- package/src/Ref.ts +332 -54
- package/src/References.ts +226 -30
- package/src/RegExp.ts +49 -3
- package/src/Request.ts +218 -35
- package/src/RequestResolver.ts +268 -36
- package/src/Resource.ts +62 -3
- package/src/Result.ts +380 -57
- package/src/Runtime.ts +172 -32
- package/src/Schedule.ts +510 -145
- package/src/Scheduler.ts +53 -4
- package/src/Schema.ts +975 -264
- package/src/SchemaAST.ts +239 -28
- package/src/SchemaGetter.ts +127 -129
- package/src/SchemaIssue.ts +45 -56
- package/src/SchemaParser.ts +295 -33
- package/src/SchemaRepresentation.ts +106 -77
- package/src/SchemaTransformation.ts +92 -56
- package/src/SchemaUtils.ts +38 -11
- package/src/Scope.ts +127 -25
- package/src/ScopedCache.ts +418 -21
- package/src/ScopedRef.ts +69 -7
- package/src/Semaphore.ts +348 -29
- package/src/Sink.ts +343 -45
- package/src/Stdio.ts +72 -17
- package/src/Stream.ts +880 -242
- package/src/String.ts +221 -49
- package/src/Struct.ts +54 -110
- package/src/SubscriptionRef.ts +341 -105
- package/src/Symbol.ts +25 -7
- package/src/SynchronizedRef.ts +529 -29
- package/src/Take.ts +36 -13
- package/src/Terminal.ts +76 -20
- package/src/Tracer.ts +74 -7
- package/src/Trie.ts +67 -30
- package/src/Tuple.ts +96 -108
- package/src/TxChunk.ts +42 -9
- package/src/TxDeferred.ts +85 -2
- package/src/TxHashMap.ts +22 -22
- package/src/TxHashSet.ts +22 -22
- package/src/TxPriorityQueue.ts +43 -8
- package/src/TxPubSub.ts +98 -8
- package/src/TxQueue.ts +58 -17
- package/src/TxReentrantLock.ts +88 -16
- package/src/TxRef.ts +113 -8
- package/src/TxSemaphore.ts +173 -14
- package/src/TxSubscriptionRef.ts +206 -3
- package/src/Types.ts +68 -13
- package/src/UndefinedOr.ts +171 -30
- package/src/Unify.ts +130 -22
- package/src/Utils.ts +21 -16
- package/src/index.ts +0 -5205
- package/src/internal/effect.ts +59 -29
- package/src/internal/request.ts +3 -1
- package/src/internal/schema/arbitrary.ts +14 -1
- package/src/internal/schema/representation.ts +37 -14
- package/src/testing/TestConsole.ts +105 -9
- package/src/testing/TestSchema.ts +81 -31
- package/src/testing/index.ts +0 -107
- package/src/unstable/ai/AiError.ts +33 -5
- package/src/unstable/ai/AnthropicStructuredOutput.ts +43 -11
- package/src/unstable/ai/Chat.ts +82 -33
- package/src/unstable/ai/EmbeddingModel.ts +104 -8
- package/src/unstable/ai/IdGenerator.ts +8 -3
- package/src/unstable/ai/LanguageModel.ts +51 -7
- package/src/unstable/ai/McpSchema.ts +299 -169
- package/src/unstable/ai/McpServer.ts +108 -14
- package/src/unstable/ai/Model.ts +35 -13
- package/src/unstable/ai/OpenAiStructuredOutput.ts +48 -1
- package/src/unstable/ai/Prompt.ts +24 -3
- package/src/unstable/ai/Response.ts +71 -13
- package/src/unstable/ai/ResponseIdTracker.ts +34 -12
- package/src/unstable/ai/Telemetry.ts +40 -27
- package/src/unstable/ai/Tokenizer.ts +41 -25
- package/src/unstable/ai/Tool.ts +85 -24
- package/src/unstable/ai/Toolkit.ts +32 -4
- package/src/unstable/ai/index.ts +0 -560
- package/src/unstable/cli/Argument.ts +1 -1
- package/src/unstable/cli/CliError.ts +3 -3
- package/src/unstable/cli/CliOutput.ts +1 -1
- package/src/unstable/cli/Command.ts +136 -8
- package/src/unstable/cli/Completions.ts +41 -1
- package/src/unstable/cli/Flag.ts +24 -12
- package/src/unstable/cli/GlobalFlag.ts +39 -8
- package/src/unstable/cli/Param.ts +137 -11
- package/src/unstable/cli/Primitive.ts +59 -10
- package/src/unstable/cli/Prompt.ts +63 -14
- package/src/unstable/cli/index.ts +0 -220
- package/src/unstable/cli/internal/parser.ts +1 -1
- package/src/unstable/cluster/ClusterCron.ts +1 -1
- package/src/unstable/cluster/ClusterError.ts +61 -22
- package/src/unstable/cluster/ClusterMetrics.ts +58 -5
- package/src/unstable/cluster/ClusterSchema.ts +87 -26
- package/src/unstable/cluster/ClusterWorkflowEngine.ts +63 -11
- package/src/unstable/cluster/DeliverAt.ts +6 -1
- package/src/unstable/cluster/Entity.ts +33 -6
- package/src/unstable/cluster/EntityAddress.ts +19 -0
- package/src/unstable/cluster/EntityId.ts +44 -7
- package/src/unstable/cluster/EntityResource.ts +5 -6
- package/src/unstable/cluster/EntityType.ts +19 -0
- package/src/unstable/cluster/Envelope.ts +11 -11
- package/src/unstable/cluster/HttpRunner.ts +42 -22
- package/src/unstable/cluster/K8sHttpClient.ts +32 -13
- package/src/unstable/cluster/MachineId.ts +35 -9
- package/src/unstable/cluster/Message.ts +11 -11
- package/src/unstable/cluster/MessageStorage.ts +38 -24
- package/src/unstable/cluster/Reply.ts +18 -8
- package/src/unstable/cluster/Runner.ts +47 -14
- package/src/unstable/cluster/RunnerAddress.ts +52 -10
- package/src/unstable/cluster/RunnerHealth.ts +33 -16
- package/src/unstable/cluster/RunnerServer.ts +19 -4
- package/src/unstable/cluster/Runners.ts +25 -1
- package/src/unstable/cluster/ShardId.ts +24 -2
- package/src/unstable/cluster/Sharding.ts +63 -20
- package/src/unstable/cluster/ShardingConfig.ts +60 -16
- package/src/unstable/cluster/ShardingRegistrationEvent.ts +27 -14
- package/src/unstable/cluster/SingleRunner.ts +26 -1
- package/src/unstable/cluster/Singleton.ts +51 -9
- package/src/unstable/cluster/SingletonAddress.ts +27 -13
- package/src/unstable/cluster/Snowflake.ts +19 -5
- package/src/unstable/cluster/SocketRunner.ts +27 -1
- package/src/unstable/cluster/SqlMessageStorage.ts +73 -13
- package/src/unstable/cluster/SqlRunnerStorage.ts +20 -0
- package/src/unstable/cluster/TestRunner.ts +25 -14
- package/src/unstable/cluster/index.ts +0 -790
- package/src/unstable/devtools/DevTools.ts +41 -11
- package/src/unstable/devtools/DevToolsClient.ts +68 -11
- package/src/unstable/devtools/DevToolsSchema.ts +24 -16
- package/src/unstable/devtools/DevToolsServer.ts +18 -11
- package/src/unstable/devtools/index.ts +0 -58
- package/src/unstable/encoding/Msgpack.ts +30 -14
- package/src/unstable/encoding/Ndjson.ts +28 -14
- package/src/unstable/encoding/Sse.ts +38 -17
- package/src/unstable/encoding/index.ts +0 -49
- package/src/unstable/eventlog/Event.ts +30 -15
- package/src/unstable/eventlog/EventGroup.ts +23 -15
- package/src/unstable/eventlog/EventJournal.ts +38 -21
- package/src/unstable/eventlog/EventLog.ts +63 -25
- package/src/unstable/eventlog/EventLogEncryption.ts +8 -3
- package/src/unstable/eventlog/EventLogMessage.ts +49 -40
- package/src/unstable/eventlog/EventLogRemote.ts +14 -4
- package/src/unstable/eventlog/EventLogServer.ts +36 -17
- package/src/unstable/eventlog/EventLogServerEncrypted.ts +24 -2
- package/src/unstable/eventlog/EventLogServerUnencrypted.ts +119 -22
- package/src/unstable/eventlog/EventLogSessionAuth.ts +68 -24
- package/src/unstable/eventlog/SqlEventJournal.ts +50 -14
- package/src/unstable/eventlog/SqlEventLogServerEncrypted.ts +39 -15
- package/src/unstable/eventlog/SqlEventLogServerUnencrypted.ts +30 -11
- package/src/unstable/eventlog/index.ts +0 -240
- package/src/unstable/http/Cookies.ts +97 -50
- package/src/unstable/http/Etag.ts +43 -13
- package/src/unstable/http/FetchHttpClient.ts +59 -17
- package/src/unstable/http/Headers.ts +62 -24
- package/src/unstable/http/HttpBody.ts +59 -15
- package/src/unstable/http/HttpClient.ts +119 -33
- package/src/unstable/http/HttpClientError.ts +41 -24
- package/src/unstable/http/HttpClientRequest.ts +37 -16
- package/src/unstable/http/HttpClientResponse.ts +33 -14
- package/src/unstable/http/HttpEffect.ts +35 -18
- package/src/unstable/http/HttpMethod.ts +46 -20
- package/src/unstable/http/HttpRouter.ts +58 -30
- package/src/unstable/http/HttpServer.ts +34 -21
- package/src/unstable/http/HttpServerError.ts +41 -28
- package/src/unstable/http/HttpServerRequest.ts +51 -19
- package/src/unstable/http/HttpServerRespondable.ts +28 -14
- package/src/unstable/http/HttpServerResponse.ts +66 -44
- package/src/unstable/http/HttpStaticServer.ts +29 -12
- package/src/unstable/http/HttpTraceContext.ts +32 -19
- package/src/unstable/http/Multipart.ts +39 -19
- package/src/unstable/http/Template.ts +25 -12
- package/src/unstable/http/Url.ts +41 -28
- package/src/unstable/http/UrlParams.ts +43 -28
- package/src/unstable/http/index.ts +0 -452
- package/src/unstable/httpapi/HttpApi.ts +48 -24
- package/src/unstable/httpapi/HttpApiBuilder.ts +40 -26
- package/src/unstable/httpapi/HttpApiClient.ts +28 -16
- package/src/unstable/httpapi/HttpApiEndpoint.ts +51 -23
- package/src/unstable/httpapi/HttpApiError.ts +38 -18
- package/src/unstable/httpapi/HttpApiGroup.ts +34 -23
- package/src/unstable/httpapi/HttpApiMiddleware.ts +49 -25
- package/src/unstable/httpapi/HttpApiScalar.ts +32 -17
- package/src/unstable/httpapi/HttpApiSchema.ts +43 -43
- package/src/unstable/httpapi/HttpApiSecurity.ts +54 -24
- package/src/unstable/httpapi/HttpApiSwagger.ts +28 -16
- package/src/unstable/httpapi/HttpApiTest.ts +1 -1
- package/src/unstable/httpapi/OpenApi.ts +43 -25
- package/src/unstable/httpapi/index.ts +0 -311
- package/src/unstable/observability/Otlp.ts +31 -16
- package/src/unstable/observability/OtlpLogger.ts +31 -15
- package/src/unstable/observability/OtlpResource.ts +33 -15
- package/src/unstable/observability/OtlpSerialization.ts +25 -14
- package/src/unstable/observability/PrometheusMetrics.ts +3 -3
- package/src/unstable/observability/index.ts +0 -183
- package/src/unstable/persistence/KeyValueStore.ts +12 -4
- package/src/unstable/persistence/Persistable.ts +8 -3
- package/src/unstable/persistence/PersistedCache.ts +27 -14
- package/src/unstable/persistence/PersistedQueue.ts +10 -5
- package/src/unstable/persistence/RateLimiter.ts +20 -10
- package/src/unstable/persistence/Redis.ts +33 -15
- package/src/unstable/persistence/index.ts +0 -147
- package/src/unstable/process/ChildProcess.ts +14 -14
- package/src/unstable/process/ChildProcessSpawner.ts +17 -5
- package/src/unstable/process/index.ts +0 -45
- package/src/unstable/reactivity/AsyncResult.ts +96 -24
- package/src/unstable/reactivity/Atom.ts +89 -35
- package/src/unstable/reactivity/AtomRef.ts +58 -25
- package/src/unstable/reactivity/AtomRegistry.ts +79 -18
- package/src/unstable/reactivity/Hydration.ts +37 -17
- package/src/unstable/reactivity/Reactivity.ts +42 -19
- package/src/unstable/reactivity/index.ts +0 -166
- package/src/unstable/rpc/Rpc.ts +47 -32
- package/src/unstable/rpc/RpcClient.ts +58 -34
- package/src/unstable/rpc/RpcClientError.ts +29 -15
- package/src/unstable/rpc/RpcGroup.ts +28 -17
- package/src/unstable/rpc/RpcMessage.ts +37 -19
- package/src/unstable/rpc/RpcMiddleware.ts +31 -21
- package/src/unstable/rpc/RpcSchema.ts +30 -20
- package/src/unstable/rpc/RpcSerialization.ts +48 -31
- package/src/unstable/rpc/RpcServer.ts +53 -40
- package/src/unstable/rpc/RpcTest.ts +29 -13
- package/src/unstable/rpc/RpcWorker.ts +29 -14
- package/src/unstable/rpc/index.ts +0 -272
- package/src/unstable/schema/Model.ts +32 -33
- package/src/unstable/schema/VariantSchema.ts +1 -1
- package/src/unstable/schema/index.ts +0 -37
- package/src/unstable/socket/Socket.ts +8 -2
- package/src/unstable/socket/SocketServer.ts +2 -2
- package/src/unstable/socket/index.ts +0 -44
- package/src/unstable/sql/Migrator.ts +39 -18
- package/src/unstable/sql/SqlClient.ts +7 -2
- package/src/unstable/sql/SqlConnection.ts +1 -1
- package/src/unstable/sql/SqlError.ts +33 -17
- package/src/unstable/sql/SqlResolver.ts +3 -3
- package/src/unstable/sql/SqlSchema.ts +51 -21
- package/src/unstable/sql/Statement.ts +35 -15
- package/src/unstable/sql/index.ts +0 -178
- package/src/unstable/workers/Transferable.ts +32 -21
- package/src/unstable/workers/Worker.ts +35 -22
- package/src/unstable/workers/WorkerError.ts +35 -19
- package/src/unstable/workers/WorkerRunner.ts +29 -18
- package/src/unstable/workers/index.ts +0 -80
- package/src/unstable/workflow/DurableClock.ts +25 -13
- package/src/unstable/workflow/DurableDeferred.ts +12 -12
- package/src/unstable/workflow/DurableQueue.ts +34 -16
- package/src/unstable/workflow/Workflow.ts +22 -23
- package/src/unstable/workflow/WorkflowEngine.ts +26 -8
- package/src/unstable/workflow/index.ts +0 -160
package/src/Schema.ts
CHANGED
|
@@ -176,7 +176,7 @@ export type ConstructorDefault = "no-default" | "with-default"
|
|
|
176
176
|
*
|
|
177
177
|
* **When to use**
|
|
178
178
|
*
|
|
179
|
-
*
|
|
179
|
+
* Use when passing `disableChecks: true` to skip validation when you trust the data.
|
|
180
180
|
* - Pass `parseOptions` to control error reporting behavior.
|
|
181
181
|
*
|
|
182
182
|
* @see {@link Bottom.makeEffect}
|
|
@@ -203,7 +203,7 @@ export interface MakeOptions {
|
|
|
203
203
|
*
|
|
204
204
|
* **When to use**
|
|
205
205
|
*
|
|
206
|
-
*
|
|
206
|
+
* Use when you are writing advanced generic schema utilities or performing schema
|
|
207
207
|
* introspection.
|
|
208
208
|
* - In user code, prefer {@link Schema}, {@link Codec}, {@link Decoder}, or
|
|
209
209
|
* {@link Encoder} instead.
|
|
@@ -258,10 +258,57 @@ export interface Bottom<
|
|
|
258
258
|
check(...checks: readonly [AST.Check<this["Type"]>, ...Array<AST.Check<this["Type"]>>]): this["Rebuild"]
|
|
259
259
|
rebuild(ast: this["ast"]): this["Rebuild"]
|
|
260
260
|
/**
|
|
261
|
-
* Constructs a value from the make input representation.
|
|
261
|
+
* Constructs a value from the make input representation synchronously.
|
|
262
|
+
*
|
|
263
|
+
* **When to use**
|
|
264
|
+
*
|
|
265
|
+
* Use when constructor input is trusted or when validation failure
|
|
266
|
+
* should abort with a thrown `Error`.
|
|
267
|
+
*
|
|
268
|
+
* **Details**
|
|
269
|
+
*
|
|
270
|
+
* Applies constructor defaults and type-side validation according to
|
|
271
|
+
* `MakeOptions`.
|
|
272
|
+
*
|
|
273
|
+
* **Gotchas**
|
|
274
|
+
*
|
|
275
|
+
* Throws an `Error` with the schema issue in its `cause` when validation
|
|
276
|
+
* fails.
|
|
277
|
+
*
|
|
278
|
+
* @see {@link Bottom.makeOption} — construct synchronously and discard validation details
|
|
279
|
+
* @see {@link Bottom.makeEffect} — construct through `Effect` when validation failure should stay in the error channel
|
|
262
280
|
*/
|
|
263
281
|
make(input: this["~type.make.in"], options?: MakeOptions): this["Type"]
|
|
282
|
+
/**
|
|
283
|
+
* Constructs a value from the make input representation, returning `Option.none`
|
|
284
|
+
* when validation fails.
|
|
285
|
+
*
|
|
286
|
+
* **When to use**
|
|
287
|
+
*
|
|
288
|
+
* Use when you only need to know whether construction succeeds
|
|
289
|
+
* and do not need validation details.
|
|
290
|
+
*
|
|
291
|
+
* **Details**
|
|
292
|
+
*
|
|
293
|
+
* Applies constructor defaults and type-side validation according to
|
|
294
|
+
* `MakeOptions`.
|
|
295
|
+
*
|
|
296
|
+
* @see {@link Bottom.make} — construct synchronously when validation failure should throw
|
|
297
|
+
* @see {@link Bottom.makeEffect} — construct through `Effect` when validation details should stay in the error channel
|
|
298
|
+
*/
|
|
264
299
|
makeOption(input: this["~type.make.in"], options?: MakeOptions): Option_.Option<this["Type"]>
|
|
300
|
+
/**
|
|
301
|
+
* Constructs a value from the make input representation, returning validation
|
|
302
|
+
* failures in the `Effect` error channel.
|
|
303
|
+
*
|
|
304
|
+
* **When to use**
|
|
305
|
+
*
|
|
306
|
+
* Use when constructor input may fail validation and you want to
|
|
307
|
+
* compose that failure with other `Effect` operations instead of throwing.
|
|
308
|
+
*
|
|
309
|
+
* @see {@link Bottom.make} — construct synchronously when validation failure should throw
|
|
310
|
+
* @see {@link Bottom.makeOption} — construct synchronously and discard validation details
|
|
311
|
+
*/
|
|
265
312
|
makeEffect(input: this["~type.make.in"], options?: MakeOptions): Effect.Effect<this["Type"], SchemaError>
|
|
266
313
|
}
|
|
267
314
|
|
|
@@ -413,7 +460,7 @@ export function declare<T, Iso = T>(
|
|
|
413
460
|
}
|
|
414
461
|
|
|
415
462
|
/**
|
|
416
|
-
*
|
|
463
|
+
* Returns a schema widened to the fully-parameterized {@link Bottom} interface,
|
|
417
464
|
* making all 14 type parameters visible to TypeScript.
|
|
418
465
|
*
|
|
419
466
|
* **Details**
|
|
@@ -842,8 +889,8 @@ export interface Encoder<out E, out RE = never> extends Codec<unknown, E, unknow
|
|
|
842
889
|
}
|
|
843
890
|
|
|
844
891
|
/**
|
|
845
|
-
*
|
|
846
|
-
*
|
|
892
|
+
* Returns a codec widened to the full {@link Codec} interface, prompting
|
|
893
|
+
* TypeScript to infer all four type parameters (`T`, `E`, `RD`, `RE`).
|
|
847
894
|
*
|
|
848
895
|
* **Details**
|
|
849
896
|
*
|
|
@@ -1068,7 +1115,7 @@ function toBaseStandardJSONSchemaV1(self: Top, target: StandardJSONSchemaV1.Targ
|
|
|
1068
1115
|
}
|
|
1069
1116
|
|
|
1070
1117
|
/**
|
|
1071
|
-
*
|
|
1118
|
+
* Converts a schema to an experimental Standard JSON Schema V1 representation.
|
|
1072
1119
|
*
|
|
1073
1120
|
* **Details**
|
|
1074
1121
|
*
|
|
@@ -1139,11 +1186,15 @@ export const is = Parser.is
|
|
|
1139
1186
|
* Creates an assertion function that throws an error if the input doesn't match
|
|
1140
1187
|
* the schema.
|
|
1141
1188
|
*
|
|
1189
|
+
* **When to use**
|
|
1190
|
+
*
|
|
1191
|
+
* Use to validate unknown input at runtime while narrowing the value with a
|
|
1192
|
+
* TypeScript `asserts` predicate.
|
|
1193
|
+
*
|
|
1142
1194
|
* **Details**
|
|
1143
1195
|
*
|
|
1144
|
-
*
|
|
1145
|
-
*
|
|
1146
|
-
* throws an error if it fails.
|
|
1196
|
+
* The input is narrowed if the assertion succeeds. If validation fails, the
|
|
1197
|
+
* assertion throws.
|
|
1147
1198
|
*
|
|
1148
1199
|
* **Example** (Basic Usage)
|
|
1149
1200
|
*
|
|
@@ -1172,9 +1223,16 @@ export const asserts: <S extends Top, I>(schema: S, input: I) => asserts input i
|
|
|
1172
1223
|
|
|
1173
1224
|
/**
|
|
1174
1225
|
* Decodes an `unknown` input against a schema, returning an `Effect` that
|
|
1175
|
-
* succeeds with the decoded value or fails with a {@link SchemaError}.
|
|
1176
|
-
*
|
|
1177
|
-
*
|
|
1226
|
+
* succeeds with the decoded value or fails with a {@link SchemaError}.
|
|
1227
|
+
*
|
|
1228
|
+
* **When to use**
|
|
1229
|
+
*
|
|
1230
|
+
* Use when decoding input whose type is not statically known.
|
|
1231
|
+
*
|
|
1232
|
+
* **Details**
|
|
1233
|
+
*
|
|
1234
|
+
* Prefer {@link decodeEffect} when the input is already typed as the schema's
|
|
1235
|
+
* `Encoded` type.
|
|
1178
1236
|
* Options may be provided either when creating the decoder or when applying it;
|
|
1179
1237
|
* application options override creation options.
|
|
1180
1238
|
*
|
|
@@ -1191,8 +1249,15 @@ export function decodeUnknownEffect<S extends Top>(schema: S, options?: AST.Pars
|
|
|
1191
1249
|
/**
|
|
1192
1250
|
* Decodes a typed input (the schema's `Encoded` type) against a schema,
|
|
1193
1251
|
* returning an `Effect` that succeeds with the decoded value or fails with a
|
|
1194
|
-
* {@link SchemaError}.
|
|
1195
|
-
*
|
|
1252
|
+
* {@link SchemaError}.
|
|
1253
|
+
*
|
|
1254
|
+
* **When to use**
|
|
1255
|
+
*
|
|
1256
|
+
* Use when the input is already typed as the schema's `Encoded` type.
|
|
1257
|
+
*
|
|
1258
|
+
* **Details**
|
|
1259
|
+
*
|
|
1260
|
+
* For `unknown` input use {@link decodeUnknownEffect}.
|
|
1196
1261
|
* Options may be provided either when creating the decoder or when applying it;
|
|
1197
1262
|
* application options override creation options.
|
|
1198
1263
|
*
|
|
@@ -1208,9 +1273,18 @@ export const decodeEffect: <S extends Top>(
|
|
|
1208
1273
|
/**
|
|
1209
1274
|
* Decodes an `unknown` input against a schema synchronously, returning an
|
|
1210
1275
|
* `Exit` that is either a `Success` with the decoded value or a `Failure` with
|
|
1211
|
-
* a {@link SchemaError}.
|
|
1212
|
-
*
|
|
1213
|
-
*
|
|
1276
|
+
* a {@link SchemaError}.
|
|
1277
|
+
*
|
|
1278
|
+
* **When to use**
|
|
1279
|
+
*
|
|
1280
|
+
* Use when the input type is not statically known and decoding should return an
|
|
1281
|
+
* `Exit` instead of failing or throwing.
|
|
1282
|
+
*
|
|
1283
|
+
* **Details**
|
|
1284
|
+
*
|
|
1285
|
+
* Only usable with schemas that have no `DecodingServices` requirement. Prefer
|
|
1286
|
+
* {@link decodeExit} when the input is already typed as the schema's `Encoded`
|
|
1287
|
+
* type.
|
|
1214
1288
|
* Options may be provided either when creating the decoder or when applying it;
|
|
1215
1289
|
* application options override creation options.
|
|
1216
1290
|
*
|
|
@@ -1227,9 +1301,17 @@ export function decodeUnknownExit<S extends Decoder<unknown>>(schema: S, options
|
|
|
1227
1301
|
/**
|
|
1228
1302
|
* Decodes a typed input (the schema's `Encoded` type) against a schema
|
|
1229
1303
|
* synchronously, returning an `Exit` that is either a `Success` with the
|
|
1230
|
-
* decoded value or a `Failure` with a {@link SchemaError}.
|
|
1231
|
-
*
|
|
1232
|
-
*
|
|
1304
|
+
* decoded value or a `Failure` with a {@link SchemaError}.
|
|
1305
|
+
*
|
|
1306
|
+
* **When to use**
|
|
1307
|
+
*
|
|
1308
|
+
* Use when typed input should be decoded into an `Exit` instead of failing or
|
|
1309
|
+
* throwing.
|
|
1310
|
+
*
|
|
1311
|
+
* **Details**
|
|
1312
|
+
*
|
|
1313
|
+
* Only usable with schemas that have no `DecodingServices` requirement. For
|
|
1314
|
+
* `unknown` input use {@link decodeUnknownExit}.
|
|
1233
1315
|
* Options may be provided either when creating the decoder or when applying it;
|
|
1234
1316
|
* application options override creation options.
|
|
1235
1317
|
*
|
|
@@ -1243,10 +1325,17 @@ export const decodeExit: <S extends Decoder<unknown>>(
|
|
|
1243
1325
|
|
|
1244
1326
|
/**
|
|
1245
1327
|
* Decodes an `unknown` input against a schema, returning an `Option` that is
|
|
1246
|
-
* `Some` with the decoded value on success or `None` on failure.
|
|
1247
|
-
*
|
|
1248
|
-
*
|
|
1249
|
-
*
|
|
1328
|
+
* `Some` with the decoded value on success or `None` on failure.
|
|
1329
|
+
*
|
|
1330
|
+
* **When to use**
|
|
1331
|
+
*
|
|
1332
|
+
* Use when the input type is not statically known and you only need to know
|
|
1333
|
+
* whether decoding succeeded.
|
|
1334
|
+
*
|
|
1335
|
+
* **Details**
|
|
1336
|
+
*
|
|
1337
|
+
* Prefer this over {@link decodeUnknownExit} or {@link decodeUnknownEffect}
|
|
1338
|
+
* when you don't need error details. For typed input use {@link decodeOption}.
|
|
1250
1339
|
* Options may be provided either when creating the decoder or when applying it;
|
|
1251
1340
|
* application options override creation options.
|
|
1252
1341
|
*
|
|
@@ -1258,7 +1347,15 @@ export const decodeUnknownOption = Parser.decodeUnknownOption
|
|
|
1258
1347
|
/**
|
|
1259
1348
|
* Decodes a typed input (the schema's `Encoded` type) against a schema,
|
|
1260
1349
|
* returning an `Option` that is `Some` with the decoded value on success or
|
|
1261
|
-
* `None` on failure.
|
|
1350
|
+
* `None` on failure.
|
|
1351
|
+
*
|
|
1352
|
+
* **When to use**
|
|
1353
|
+
*
|
|
1354
|
+
* Use when typed input should be decoded and only success or failure matters.
|
|
1355
|
+
*
|
|
1356
|
+
* **Details**
|
|
1357
|
+
*
|
|
1358
|
+
* For `unknown` input use {@link decodeUnknownOption}.
|
|
1262
1359
|
* Options may be provided either when creating the decoder or when applying it;
|
|
1263
1360
|
* application options override creation options.
|
|
1264
1361
|
*
|
|
@@ -1269,8 +1366,16 @@ export const decodeOption = Parser.decodeOption
|
|
|
1269
1366
|
|
|
1270
1367
|
/**
|
|
1271
1368
|
* Decodes an `unknown` input against a schema, returning a `Result` that
|
|
1272
|
-
* succeeds with the decoded value or fails with a schema issue.
|
|
1273
|
-
*
|
|
1369
|
+
* succeeds with the decoded value or fails with a schema issue.
|
|
1370
|
+
*
|
|
1371
|
+
* **When to use**
|
|
1372
|
+
*
|
|
1373
|
+
* Use when the input type is not statically known and decoding should return a
|
|
1374
|
+
* `Result` with structured issue data.
|
|
1375
|
+
*
|
|
1376
|
+
* **Details**
|
|
1377
|
+
*
|
|
1378
|
+
* For typed input use {@link decodeResult}.
|
|
1274
1379
|
* Options may be provided either when creating the decoder or when applying it;
|
|
1275
1380
|
* application options override creation options.
|
|
1276
1381
|
*
|
|
@@ -1282,7 +1387,16 @@ export const decodeUnknownResult = Parser.decodeUnknownResult
|
|
|
1282
1387
|
/**
|
|
1283
1388
|
* Decodes a typed input (the schema's `Encoded` type) against a schema,
|
|
1284
1389
|
* returning a `Result` that succeeds with the decoded value or fails with a
|
|
1285
|
-
* schema issue.
|
|
1390
|
+
* schema issue.
|
|
1391
|
+
*
|
|
1392
|
+
* **When to use**
|
|
1393
|
+
*
|
|
1394
|
+
* Use when typed input should be decoded into a `Result` with structured issue
|
|
1395
|
+
* data.
|
|
1396
|
+
*
|
|
1397
|
+
* **Details**
|
|
1398
|
+
*
|
|
1399
|
+
* For `unknown` input use {@link decodeUnknownResult}.
|
|
1286
1400
|
* Options may be provided either when creating the decoder or when applying it;
|
|
1287
1401
|
* application options override creation options.
|
|
1288
1402
|
*
|
|
@@ -1293,9 +1407,15 @@ export const decodeResult = Parser.decodeResult
|
|
|
1293
1407
|
|
|
1294
1408
|
/**
|
|
1295
1409
|
* Decodes an `unknown` input against a schema, returning a `Promise` that
|
|
1296
|
-
* resolves with the decoded value or rejects with a schema issue.
|
|
1297
|
-
*
|
|
1298
|
-
*
|
|
1410
|
+
* resolves with the decoded value or rejects with a schema issue.
|
|
1411
|
+
*
|
|
1412
|
+
* **When to use**
|
|
1413
|
+
*
|
|
1414
|
+
* Use when integrating unknown input validation with Promise-based APIs.
|
|
1415
|
+
*
|
|
1416
|
+
* **Details**
|
|
1417
|
+
*
|
|
1418
|
+
* For typed input use {@link decodePromise}.
|
|
1299
1419
|
* Options may be provided either when creating the decoder or when applying it;
|
|
1300
1420
|
* application options override creation options.
|
|
1301
1421
|
*
|
|
@@ -1307,10 +1427,15 @@ export const decodeUnknownPromise = Parser.decodeUnknownPromise
|
|
|
1307
1427
|
/**
|
|
1308
1428
|
* Decodes a typed input (the schema's `Encoded` type) against a schema,
|
|
1309
1429
|
* returning a `Promise` that resolves with the decoded value or rejects with a
|
|
1310
|
-
* schema issue.
|
|
1430
|
+
* schema issue.
|
|
1431
|
+
*
|
|
1432
|
+
* **When to use**
|
|
1433
|
+
*
|
|
1434
|
+
* Use when integrating typed input decoding with Promise-based APIs.
|
|
1311
1435
|
*
|
|
1312
1436
|
* **Details**
|
|
1313
1437
|
*
|
|
1438
|
+
* For `unknown` input use `decodeUnknownPromise`.
|
|
1314
1439
|
* Options may be provided either when creating the decoder or when applying it;
|
|
1315
1440
|
* application options override creation options.
|
|
1316
1441
|
*
|
|
@@ -1322,11 +1447,15 @@ export const decodePromise = Parser.decodePromise
|
|
|
1322
1447
|
/**
|
|
1323
1448
|
* Decodes an `unknown` input against a schema synchronously, returning the
|
|
1324
1449
|
* decoded value or throwing an `Error` whose cause contains the schema issue.
|
|
1325
|
-
*
|
|
1326
|
-
*
|
|
1450
|
+
*
|
|
1451
|
+
* **When to use**
|
|
1452
|
+
*
|
|
1453
|
+
* Use when validating unknown data at a boundary and treating schema mismatches
|
|
1454
|
+
* as exceptions.
|
|
1327
1455
|
*
|
|
1328
1456
|
* **Details**
|
|
1329
1457
|
*
|
|
1458
|
+
* For typed input use `decodeSync`.
|
|
1330
1459
|
* Only service-free schemas can be decoded synchronously. For non-throwing
|
|
1331
1460
|
* alternatives see `decodeUnknownOption`, `decodeUnknownExit`, or
|
|
1332
1461
|
* `decodeUnknownEffect`. Options may be provided either when creating the
|
|
@@ -1357,10 +1486,16 @@ export const decodeUnknownSync = Parser.decodeUnknownSync
|
|
|
1357
1486
|
/**
|
|
1358
1487
|
* Decodes a typed input (the schema's `Encoded` type) against a schema
|
|
1359
1488
|
* synchronously, returning the decoded value or throwing an `Error` whose cause
|
|
1360
|
-
* contains the schema issue.
|
|
1489
|
+
* contains the schema issue.
|
|
1490
|
+
*
|
|
1491
|
+
* **When to use**
|
|
1492
|
+
*
|
|
1493
|
+
* Use when typed input should be decoded synchronously and schema mismatches
|
|
1494
|
+
* should throw.
|
|
1361
1495
|
*
|
|
1362
1496
|
* **Details**
|
|
1363
1497
|
*
|
|
1498
|
+
* For `unknown` input use `decodeUnknownSync`.
|
|
1364
1499
|
* Only service-free schemas can be decoded synchronously. Options may be
|
|
1365
1500
|
* provided either when creating the decoder or when applying it; application
|
|
1366
1501
|
* options override creation options.
|
|
@@ -1372,9 +1507,16 @@ export const decodeSync = Parser.decodeSync
|
|
|
1372
1507
|
|
|
1373
1508
|
/**
|
|
1374
1509
|
* Encodes an `unknown` input against a schema, returning an `Effect` that
|
|
1375
|
-
* succeeds with the encoded value or fails with a {@link SchemaError}.
|
|
1376
|
-
*
|
|
1377
|
-
*
|
|
1510
|
+
* succeeds with the encoded value or fails with a {@link SchemaError}.
|
|
1511
|
+
*
|
|
1512
|
+
* **When to use**
|
|
1513
|
+
*
|
|
1514
|
+
* Use when encoding input whose type is not statically known.
|
|
1515
|
+
*
|
|
1516
|
+
* **Details**
|
|
1517
|
+
*
|
|
1518
|
+
* Prefer {@link encodeEffect} when the input is already typed as the schema's
|
|
1519
|
+
* `Type`.
|
|
1378
1520
|
* Options may be provided either when creating the encoder or when applying it;
|
|
1379
1521
|
* application options override creation options.
|
|
1380
1522
|
*
|
|
@@ -1405,8 +1547,15 @@ export function encodeUnknownEffect<S extends Top>(schema: S, options?: AST.Pars
|
|
|
1405
1547
|
/**
|
|
1406
1548
|
* Encodes a typed input (the schema's `Type`) against a schema, returning an
|
|
1407
1549
|
* `Effect` that succeeds with the encoded value or fails with a
|
|
1408
|
-
* {@link SchemaError}.
|
|
1409
|
-
*
|
|
1550
|
+
* {@link SchemaError}.
|
|
1551
|
+
*
|
|
1552
|
+
* **When to use**
|
|
1553
|
+
*
|
|
1554
|
+
* Use when the input is already typed as the schema's `Type`.
|
|
1555
|
+
*
|
|
1556
|
+
* **Details**
|
|
1557
|
+
*
|
|
1558
|
+
* For `unknown` input use {@link encodeUnknownEffect}.
|
|
1410
1559
|
* Options may be provided either when creating the encoder or when applying it;
|
|
1411
1560
|
* application options override creation options.
|
|
1412
1561
|
*
|
|
@@ -1422,9 +1571,17 @@ export const encodeEffect: <S extends Top>(
|
|
|
1422
1571
|
/**
|
|
1423
1572
|
* Encodes an `unknown` input against a schema synchronously, returning an
|
|
1424
1573
|
* `Exit` that is either a `Success` with the encoded value or a `Failure` with
|
|
1425
|
-
* a {@link SchemaError}.
|
|
1426
|
-
*
|
|
1427
|
-
*
|
|
1574
|
+
* a {@link SchemaError}.
|
|
1575
|
+
*
|
|
1576
|
+
* **When to use**
|
|
1577
|
+
*
|
|
1578
|
+
* Use when the input type is not statically known and encoding should return an
|
|
1579
|
+
* `Exit` instead of failing or throwing.
|
|
1580
|
+
*
|
|
1581
|
+
* **Details**
|
|
1582
|
+
*
|
|
1583
|
+
* Only usable with schemas that have no `EncodingServices` requirement. Prefer
|
|
1584
|
+
* {@link encodeExit} when the input is already typed as the schema's `Type`.
|
|
1428
1585
|
* Options may be provided either when creating the encoder or when applying it;
|
|
1429
1586
|
* application options override creation options.
|
|
1430
1587
|
*
|
|
@@ -1441,9 +1598,17 @@ export function encodeUnknownExit<S extends Encoder<unknown>>(schema: S, options
|
|
|
1441
1598
|
/**
|
|
1442
1599
|
* Encodes a typed input (the schema's `Type`) against a schema synchronously,
|
|
1443
1600
|
* returning an `Exit` that is either a `Success` with the encoded value or a
|
|
1444
|
-
* `Failure` with a {@link SchemaError}.
|
|
1445
|
-
*
|
|
1446
|
-
*
|
|
1601
|
+
* `Failure` with a {@link SchemaError}.
|
|
1602
|
+
*
|
|
1603
|
+
* **When to use**
|
|
1604
|
+
*
|
|
1605
|
+
* Use when typed input should be encoded into an `Exit` instead of failing or
|
|
1606
|
+
* throwing.
|
|
1607
|
+
*
|
|
1608
|
+
* **Details**
|
|
1609
|
+
*
|
|
1610
|
+
* Only usable with schemas that have no `EncodingServices` requirement. For
|
|
1611
|
+
* `unknown` input use {@link encodeUnknownExit}.
|
|
1447
1612
|
* Options may be provided either when creating the encoder or when applying it;
|
|
1448
1613
|
* application options override creation options.
|
|
1449
1614
|
*
|
|
@@ -1457,10 +1622,17 @@ export const encodeExit: <S extends Encoder<unknown>>(
|
|
|
1457
1622
|
|
|
1458
1623
|
/**
|
|
1459
1624
|
* Encodes an `unknown` input against a schema, returning an `Option` that is
|
|
1460
|
-
* `Some` with the encoded value on success or `None` on failure.
|
|
1461
|
-
*
|
|
1462
|
-
*
|
|
1463
|
-
*
|
|
1625
|
+
* `Some` with the encoded value on success or `None` on failure.
|
|
1626
|
+
*
|
|
1627
|
+
* **When to use**
|
|
1628
|
+
*
|
|
1629
|
+
* Use when the input type is not statically known and you only need to know
|
|
1630
|
+
* whether encoding succeeded.
|
|
1631
|
+
*
|
|
1632
|
+
* **Details**
|
|
1633
|
+
*
|
|
1634
|
+
* Prefer this over {@link encodeUnknownExit} or {@link encodeUnknownEffect}
|
|
1635
|
+
* when you don't need error details. For typed input use {@link encodeOption}.
|
|
1464
1636
|
* Options may be provided either when creating the encoder or when applying it;
|
|
1465
1637
|
* application options override creation options.
|
|
1466
1638
|
*
|
|
@@ -1472,7 +1644,15 @@ export const encodeUnknownOption = Parser.encodeUnknownOption
|
|
|
1472
1644
|
/**
|
|
1473
1645
|
* Encodes a typed input (the schema's `Type`) against a schema, returning an
|
|
1474
1646
|
* `Option` that is `Some` with the encoded value on success or `None` on
|
|
1475
|
-
* failure.
|
|
1647
|
+
* failure.
|
|
1648
|
+
*
|
|
1649
|
+
* **When to use**
|
|
1650
|
+
*
|
|
1651
|
+
* Use when typed input should be encoded and only success or failure matters.
|
|
1652
|
+
*
|
|
1653
|
+
* **Details**
|
|
1654
|
+
*
|
|
1655
|
+
* For `unknown` input use {@link encodeUnknownOption}.
|
|
1476
1656
|
* Options may be provided either when creating the encoder or when applying it;
|
|
1477
1657
|
* application options override creation options.
|
|
1478
1658
|
*
|
|
@@ -1483,8 +1663,16 @@ export const encodeOption = Parser.encodeOption
|
|
|
1483
1663
|
|
|
1484
1664
|
/**
|
|
1485
1665
|
* Encodes an `unknown` input against a schema, returning a `Result` that
|
|
1486
|
-
* succeeds with the encoded value or fails with a schema issue.
|
|
1487
|
-
*
|
|
1666
|
+
* succeeds with the encoded value or fails with a schema issue.
|
|
1667
|
+
*
|
|
1668
|
+
* **When to use**
|
|
1669
|
+
*
|
|
1670
|
+
* Use when the input type is not statically known and encoding should return a
|
|
1671
|
+
* `Result` with structured issue data.
|
|
1672
|
+
*
|
|
1673
|
+
* **Details**
|
|
1674
|
+
*
|
|
1675
|
+
* For typed input use {@link encodeResult}.
|
|
1488
1676
|
* Options may be provided either when creating the encoder or when applying it;
|
|
1489
1677
|
* application options override creation options.
|
|
1490
1678
|
*
|
|
@@ -1496,6 +1684,14 @@ export const encodeUnknownResult = Parser.encodeUnknownResult
|
|
|
1496
1684
|
/**
|
|
1497
1685
|
* Encodes a typed input (the schema's `Type`) against a schema, returning a
|
|
1498
1686
|
* `Result` that succeeds with the encoded value or fails with a schema issue.
|
|
1687
|
+
*
|
|
1688
|
+
* **When to use**
|
|
1689
|
+
*
|
|
1690
|
+
* Use when typed input should be encoded into a `Result` with structured issue
|
|
1691
|
+
* data.
|
|
1692
|
+
*
|
|
1693
|
+
* **Details**
|
|
1694
|
+
*
|
|
1499
1695
|
* For `unknown` input use {@link encodeUnknownResult}.
|
|
1500
1696
|
* Options may be provided either when creating the encoder or when applying it;
|
|
1501
1697
|
* application options override creation options.
|
|
@@ -1507,9 +1703,15 @@ export const encodeResult = Parser.encodeResult
|
|
|
1507
1703
|
|
|
1508
1704
|
/**
|
|
1509
1705
|
* Encodes an `unknown` input against a schema, returning a `Promise` that
|
|
1510
|
-
* resolves with the encoded value or rejects with a schema issue.
|
|
1511
|
-
*
|
|
1512
|
-
*
|
|
1706
|
+
* resolves with the encoded value or rejects with a schema issue.
|
|
1707
|
+
*
|
|
1708
|
+
* **When to use**
|
|
1709
|
+
*
|
|
1710
|
+
* Use when integrating unknown input serialization with Promise-based APIs.
|
|
1711
|
+
*
|
|
1712
|
+
* **Details**
|
|
1713
|
+
*
|
|
1714
|
+
* For typed input use {@link encodePromise}.
|
|
1513
1715
|
* Options may be provided either when creating the encoder or when applying it;
|
|
1514
1716
|
* application options override creation options.
|
|
1515
1717
|
*
|
|
@@ -1521,7 +1723,15 @@ export const encodeUnknownPromise = Parser.encodeUnknownPromise
|
|
|
1521
1723
|
/**
|
|
1522
1724
|
* Encodes a typed input (the schema's `Type`) against a schema, returning a
|
|
1523
1725
|
* `Promise` that resolves with the encoded value or rejects with a
|
|
1524
|
-
* {@link SchemaError}.
|
|
1726
|
+
* {@link SchemaError}.
|
|
1727
|
+
*
|
|
1728
|
+
* **When to use**
|
|
1729
|
+
*
|
|
1730
|
+
* Use when integrating typed input serialization with Promise-based APIs.
|
|
1731
|
+
*
|
|
1732
|
+
* **Details**
|
|
1733
|
+
*
|
|
1734
|
+
* For `unknown` input use {@link encodeUnknownPromise}.
|
|
1525
1735
|
* Options may be provided either when creating the encoder or when applying it;
|
|
1526
1736
|
* application options override creation options.
|
|
1527
1737
|
*
|
|
@@ -1532,9 +1742,16 @@ export const encodePromise = Parser.encodePromise
|
|
|
1532
1742
|
|
|
1533
1743
|
/**
|
|
1534
1744
|
* Encodes an `unknown` input against a schema synchronously, throwing a
|
|
1535
|
-
* {@link SchemaError} on failure.
|
|
1536
|
-
*
|
|
1537
|
-
*
|
|
1745
|
+
* {@link SchemaError} on failure.
|
|
1746
|
+
*
|
|
1747
|
+
* **When to use**
|
|
1748
|
+
*
|
|
1749
|
+
* Use when serializing unknown data at a boundary and treating schema
|
|
1750
|
+
* mismatches as unrecoverable errors.
|
|
1751
|
+
*
|
|
1752
|
+
* **Details**
|
|
1753
|
+
*
|
|
1754
|
+
* For non-throwing alternatives see {@link encodeUnknownOption},
|
|
1538
1755
|
* {@link encodeUnknownExit}, or {@link encodeUnknownEffect}. For typed input
|
|
1539
1756
|
* use {@link encodeSync}.
|
|
1540
1757
|
* Options may be provided either when creating the encoder or when applying it;
|
|
@@ -1547,8 +1764,16 @@ export const encodeUnknownSync = Parser.encodeUnknownSync
|
|
|
1547
1764
|
|
|
1548
1765
|
/**
|
|
1549
1766
|
* Encodes a typed input (the schema's `Type`) against a schema synchronously,
|
|
1550
|
-
* throwing a {@link SchemaError} on failure.
|
|
1551
|
-
*
|
|
1767
|
+
* throwing a {@link SchemaError} on failure.
|
|
1768
|
+
*
|
|
1769
|
+
* **When to use**
|
|
1770
|
+
*
|
|
1771
|
+
* Use when typed input should be encoded synchronously and schema mismatches
|
|
1772
|
+
* should throw.
|
|
1773
|
+
*
|
|
1774
|
+
* **Details**
|
|
1775
|
+
*
|
|
1776
|
+
* For `unknown` input use {@link encodeUnknownSync}.
|
|
1552
1777
|
* Options may be provided either when creating the encoder or when applying it;
|
|
1553
1778
|
* application options override creation options.
|
|
1554
1779
|
*
|
|
@@ -1604,7 +1829,7 @@ export function asClass<S extends Top>(schema: S): S & { new(_: never): {} } {
|
|
|
1604
1829
|
}
|
|
1605
1830
|
|
|
1606
1831
|
/**
|
|
1607
|
-
*
|
|
1832
|
+
* Checks whether a value is a `Schema`.
|
|
1608
1833
|
*
|
|
1609
1834
|
* @category guards
|
|
1610
1835
|
* @since 3.10.0
|
|
@@ -1679,8 +1904,12 @@ interface requiredKeyLambda extends Lambda {
|
|
|
1679
1904
|
}
|
|
1680
1905
|
|
|
1681
1906
|
/**
|
|
1682
|
-
* Reverses
|
|
1683
|
-
*
|
|
1907
|
+
* Reverses `optionalKey` and returns the inner required schema.
|
|
1908
|
+
*
|
|
1909
|
+
* **When to use**
|
|
1910
|
+
*
|
|
1911
|
+
* Use to remove optional-key wrapping from a schema field that was previously
|
|
1912
|
+
* wrapped with {@link optionalKey}.
|
|
1684
1913
|
*
|
|
1685
1914
|
* @category combinators
|
|
1686
1915
|
* @since 4.0.0
|
|
@@ -1741,8 +1970,16 @@ interface requiredLambda extends Lambda {
|
|
|
1741
1970
|
}
|
|
1742
1971
|
|
|
1743
1972
|
/**
|
|
1744
|
-
* Reverses
|
|
1745
|
-
*
|
|
1973
|
+
* Reverses `optional` and returns the inner schema.
|
|
1974
|
+
*
|
|
1975
|
+
* **When to use**
|
|
1976
|
+
*
|
|
1977
|
+
* Use to remove optional wrapping from a schema field that was previously
|
|
1978
|
+
* wrapped with {@link optional}.
|
|
1979
|
+
*
|
|
1980
|
+
* **Details**
|
|
1981
|
+
*
|
|
1982
|
+
* This also unwraps the `UndefinedOr` member added by `optional`.
|
|
1746
1983
|
*
|
|
1747
1984
|
* @category combinators
|
|
1748
1985
|
* @since 3.10.0
|
|
@@ -1799,8 +2036,12 @@ interface readonlyKeyLambda extends Lambda {
|
|
|
1799
2036
|
}
|
|
1800
2037
|
|
|
1801
2038
|
/**
|
|
1802
|
-
* Reverses
|
|
1803
|
-
*
|
|
2039
|
+
* Reverses `mutableKey` and returns the inner readonly schema.
|
|
2040
|
+
*
|
|
2041
|
+
* **When to use**
|
|
2042
|
+
*
|
|
2043
|
+
* Use to remove mutable-key wrapping from a schema field that was previously
|
|
2044
|
+
* wrapped with {@link mutableKey}.
|
|
1804
2045
|
*
|
|
1805
2046
|
* @category combinators
|
|
1806
2047
|
* @since 4.0.0
|
|
@@ -1926,8 +2167,15 @@ function isFlip$(schema: Top): schema is flip<any> {
|
|
|
1926
2167
|
}
|
|
1927
2168
|
|
|
1928
2169
|
/**
|
|
1929
|
-
* Swaps the
|
|
1930
|
-
*
|
|
2170
|
+
* Swaps the decoded and encoded sides of a schema.
|
|
2171
|
+
*
|
|
2172
|
+
* **When to use**
|
|
2173
|
+
*
|
|
2174
|
+
* Use to invert a schema transformation direction.
|
|
2175
|
+
*
|
|
2176
|
+
* **Details**
|
|
2177
|
+
*
|
|
2178
|
+
* Calling `flip` twice returns the original schema.
|
|
1931
2179
|
*
|
|
1932
2180
|
* **Example** (Flip a number-from-string schema)
|
|
1933
2181
|
*
|
|
@@ -2151,8 +2399,17 @@ export interface TemplateLiteralParser<Parts extends TemplateLiteral.Parts> exte
|
|
|
2151
2399
|
}
|
|
2152
2400
|
|
|
2153
2401
|
/**
|
|
2154
|
-
*
|
|
2155
|
-
*
|
|
2402
|
+
* Schema for parsing template literal matches into typed tuple parts.
|
|
2403
|
+
*
|
|
2404
|
+
* **When to use**
|
|
2405
|
+
*
|
|
2406
|
+
* Use to validate a template literal string and decode the matched parts into
|
|
2407
|
+
* typed values.
|
|
2408
|
+
*
|
|
2409
|
+
* **Details**
|
|
2410
|
+
*
|
|
2411
|
+
* Unlike {@link TemplateLiteral}, this schema decodes the matched string into a
|
|
2412
|
+
* readonly tuple with one element per schema part.
|
|
2156
2413
|
*
|
|
2157
2414
|
* **Example** (Parse path parameters)
|
|
2158
2415
|
*
|
|
@@ -2361,6 +2618,12 @@ export interface Boolean extends Bottom<boolean, boolean, never, never, AST.Bool
|
|
|
2361
2618
|
/**
|
|
2362
2619
|
* Schema for `boolean` values. Validates that the input is `typeof` `"boolean"`.
|
|
2363
2620
|
*
|
|
2621
|
+
* **When to use**
|
|
2622
|
+
*
|
|
2623
|
+
* Use to validate values that are already JavaScript booleans.
|
|
2624
|
+
*
|
|
2625
|
+
* @see {@link BooleanFromBit} for a schema that decodes bit literals `0` or `1` into a boolean
|
|
2626
|
+
*
|
|
2364
2627
|
* @category Boolean
|
|
2365
2628
|
* @since 4.0.0
|
|
2366
2629
|
*/
|
|
@@ -2396,6 +2659,13 @@ export interface BigInt extends Bottom<bigint, bigint, never, never, AST.BigInt,
|
|
|
2396
2659
|
/**
|
|
2397
2660
|
* Schema for `bigint` values. Validates that the input is `typeof` `"bigint"`.
|
|
2398
2661
|
*
|
|
2662
|
+
* **When to use**
|
|
2663
|
+
*
|
|
2664
|
+
* Use when the input is already a bigint and the schema should validate and
|
|
2665
|
+
* preserve bigint values without parsing from another representation.
|
|
2666
|
+
*
|
|
2667
|
+
* @see {@link BigIntFromString} for parsing string input into a bigint
|
|
2668
|
+
*
|
|
2399
2669
|
* @category schemas
|
|
2400
2670
|
* @since 4.0.0
|
|
2401
2671
|
*/
|
|
@@ -2761,8 +3031,16 @@ interface fieldsAssign<NewFields extends Struct.Fields> extends Lambda {
|
|
|
2761
3031
|
}
|
|
2762
3032
|
|
|
2763
3033
|
/**
|
|
2764
|
-
*
|
|
2765
|
-
*
|
|
3034
|
+
* Adds fields to a struct schema through a struct-mapping lambda.
|
|
3035
|
+
*
|
|
3036
|
+
* **When to use**
|
|
3037
|
+
*
|
|
3038
|
+
* Use to add the same fields to an existing struct or to every struct member of
|
|
3039
|
+
* a union.
|
|
3040
|
+
*
|
|
3041
|
+
* **Details**
|
|
3042
|
+
*
|
|
3043
|
+
* This is a shortcut for `MyStruct.mapFields(Struct.assign(fields))`.
|
|
2766
3044
|
*
|
|
2767
3045
|
* **Example** (Adding fields to a union of structs)
|
|
2768
3046
|
*
|
|
@@ -3053,6 +3331,14 @@ export declare namespace Record {
|
|
|
3053
3331
|
* Companion type for a key-value record (map) with a typed key and value schema.
|
|
3054
3332
|
* Produced by {@link Record}.
|
|
3055
3333
|
*
|
|
3334
|
+
* **When to use**
|
|
3335
|
+
*
|
|
3336
|
+
* Use as the concrete schema type returned by `Record` when an API needs to
|
|
3337
|
+
* accept or return a record schema with typed property keys and values.
|
|
3338
|
+
*
|
|
3339
|
+
* @see {@link Record} for constructing record schemas
|
|
3340
|
+
* @see {@link StructWithRest} for combining fixed struct fields with record index signatures
|
|
3341
|
+
*
|
|
3056
3342
|
* @category models
|
|
3057
3343
|
* @since 4.0.0
|
|
3058
3344
|
*/
|
|
@@ -3214,6 +3500,14 @@ export declare namespace StructWithRest {
|
|
|
3214
3500
|
* Companion type for a struct combined with one or more record schemas. Produced
|
|
3215
3501
|
* by {@link StructWithRest}.
|
|
3216
3502
|
*
|
|
3503
|
+
* **When to use**
|
|
3504
|
+
*
|
|
3505
|
+
* Use as the schema type when generic code needs to retain the base struct
|
|
3506
|
+
* schema and all rest record schemas.
|
|
3507
|
+
*
|
|
3508
|
+
* @see {@link StructWithRest} for constructing this schema type
|
|
3509
|
+
* @see {@link Record} for constructing record schemas used as rest index signatures
|
|
3510
|
+
*
|
|
3217
3511
|
* @category models
|
|
3218
3512
|
* @since 4.0.0
|
|
3219
3513
|
*/
|
|
@@ -3667,11 +3961,16 @@ export function TupleWithRest<S extends Tuple<Tuple.Elements>, const Rest extend
|
|
|
3667
3961
|
/**
|
|
3668
3962
|
* Schema interface produced by `Schema.Array` for readonly arrays.
|
|
3669
3963
|
*
|
|
3964
|
+
* **When to use**
|
|
3965
|
+
*
|
|
3966
|
+
* Use as the public companion type returned by `Schema.Array` when you need to
|
|
3967
|
+
* refer to a readonly array schema built from an element schema.
|
|
3968
|
+
*
|
|
3670
3969
|
* **Details**
|
|
3671
3970
|
*
|
|
3672
3971
|
* The decoded type is `ReadonlyArray<S["Type"]>`, the encoded type is
|
|
3673
3972
|
* `ReadonlyArray<S["Encoded"]>`, and the element schema is available as
|
|
3674
|
-
* `
|
|
3973
|
+
* `value`.
|
|
3675
3974
|
*
|
|
3676
3975
|
* @category models
|
|
3677
3976
|
* @since 4.0.0
|
|
@@ -3688,7 +3987,7 @@ export interface $Array<S extends Top> extends
|
|
|
3688
3987
|
ReadonlyArray<S["Iso"]>
|
|
3689
3988
|
>
|
|
3690
3989
|
{
|
|
3691
|
-
readonly
|
|
3990
|
+
readonly value: S
|
|
3692
3991
|
}
|
|
3693
3992
|
|
|
3694
3993
|
interface ArrayLambda extends Lambda {
|
|
@@ -3700,7 +3999,9 @@ interface ArrayLambda extends Lambda {
|
|
|
3700
3999
|
* @category constructors
|
|
3701
4000
|
* @since 4.0.0
|
|
3702
4001
|
*/
|
|
3703
|
-
const ArraySchema = Struct_.lambda<ArrayLambda>((schema) =>
|
|
4002
|
+
const ArraySchema = Struct_.lambda<ArrayLambda>((schema) =>
|
|
4003
|
+
make(new AST.Arrays(false, [], [schema.ast]), { value: schema })
|
|
4004
|
+
)
|
|
3704
4005
|
|
|
3705
4006
|
export {
|
|
3706
4007
|
/**
|
|
@@ -3727,6 +4028,12 @@ export {
|
|
|
3727
4028
|
/**
|
|
3728
4029
|
* Companion type for a non-empty `ReadonlyArray`. Produced by {@link NonEmptyArray}.
|
|
3729
4030
|
*
|
|
4031
|
+
* **Details**
|
|
4032
|
+
*
|
|
4033
|
+
* The decoded type is `readonly [S["Type"], ...Array<S["Type"]>]`, the encoded type is
|
|
4034
|
+
* `readonly [S["Encoded"], ...Array<S["Encoded"]>]`, and the element schema is available as
|
|
4035
|
+
* `value`.
|
|
4036
|
+
*
|
|
3730
4037
|
* @category models
|
|
3731
4038
|
* @since 3.10.0
|
|
3732
4039
|
*/
|
|
@@ -3742,7 +4049,7 @@ export interface NonEmptyArray<S extends Top> extends
|
|
|
3742
4049
|
readonly [S["Iso"], ...Array<S["Iso"]>]
|
|
3743
4050
|
>
|
|
3744
4051
|
{
|
|
3745
|
-
readonly
|
|
4052
|
+
readonly value: S
|
|
3746
4053
|
}
|
|
3747
4054
|
|
|
3748
4055
|
interface NonEmptyArrayLambda extends Lambda {
|
|
@@ -3769,19 +4076,26 @@ interface NonEmptyArrayLambda extends Lambda {
|
|
|
3769
4076
|
* @since 3.10.0
|
|
3770
4077
|
*/
|
|
3771
4078
|
export const NonEmptyArray = Struct_.lambda<NonEmptyArrayLambda>((schema) =>
|
|
3772
|
-
make(new AST.Arrays(false, [schema.ast], [schema.ast]), { schema })
|
|
4079
|
+
make(new AST.Arrays(false, [schema.ast], [schema.ast]), { value: schema })
|
|
3773
4080
|
)
|
|
3774
4081
|
|
|
3775
4082
|
/**
|
|
3776
4083
|
* Schema interface returned by `ArrayEnsure`, which normalizes a single item or
|
|
3777
4084
|
* an array of items into a readonly array.
|
|
3778
4085
|
*
|
|
4086
|
+
* **When to use**
|
|
4087
|
+
*
|
|
4088
|
+
* Use as the schema type when generic code needs to retain the original item
|
|
4089
|
+
* schema.
|
|
4090
|
+
*
|
|
3779
4091
|
* **Details**
|
|
3780
4092
|
*
|
|
3781
4093
|
* The schema decodes from `S` or `Schema.Array(S)` and produces
|
|
3782
4094
|
* `ReadonlyArray<S["Type"]>`.
|
|
3783
4095
|
*
|
|
3784
|
-
* @
|
|
4096
|
+
* @see {@link ArrayEnsure} for constructing this schema type
|
|
4097
|
+
*
|
|
4098
|
+
* @category constructors
|
|
3785
4099
|
* @since 3.10.0
|
|
3786
4100
|
*/
|
|
3787
4101
|
export interface ArrayEnsure<S extends Top> extends decodeTo<$Array<toType<S>>, Union<readonly [S, $Array<S>]>> {
|
|
@@ -3792,16 +4106,26 @@ export interface ArrayEnsure<S extends Top> extends decodeTo<$Array<toType<S>>,
|
|
|
3792
4106
|
* Creates a schema that accepts either a value decoded by `schema` or an array
|
|
3793
4107
|
* decoded by `Schema.Array(schema)`, then returns an array.
|
|
3794
4108
|
*
|
|
4109
|
+
* **When to use**
|
|
4110
|
+
*
|
|
4111
|
+
* Use to accept input that may be provided either as one item or as an array,
|
|
4112
|
+
* while normalizing decoded values to a readonly array.
|
|
4113
|
+
*
|
|
3795
4114
|
* **Details**
|
|
3796
4115
|
*
|
|
4116
|
+
* During encoding, one-element arrays are encoded as the single element. Empty
|
|
4117
|
+
* arrays and arrays with two or more elements are encoded as arrays.
|
|
4118
|
+
*
|
|
4119
|
+
* **Gotchas**
|
|
4120
|
+
*
|
|
3797
4121
|
* The single-value branch is tried before the array branch. If `schema` itself
|
|
3798
4122
|
* accepts arrays, an array input can be treated as one value and wrapped in a
|
|
3799
4123
|
* one-element array.
|
|
3800
4124
|
*
|
|
3801
|
-
*
|
|
3802
|
-
*
|
|
4125
|
+
* @see {@link Array} for accepting only array input
|
|
4126
|
+
* @see {@link NonEmptyArray} for requiring at least one decoded element
|
|
3803
4127
|
*
|
|
3804
|
-
* @category
|
|
4128
|
+
* @category constructors
|
|
3805
4129
|
* @since 3.10.0
|
|
3806
4130
|
*/
|
|
3807
4131
|
export function ArrayEnsure<S extends Top>(schema: S): ArrayEnsure<S> {
|
|
@@ -4178,8 +4502,8 @@ export function suspend<S extends Top>(f: () => S): suspend<S> {
|
|
|
4178
4502
|
}
|
|
4179
4503
|
|
|
4180
4504
|
/**
|
|
4181
|
-
*
|
|
4182
|
-
*
|
|
4505
|
+
* Attaches one or more filter checks to a schema without changing the
|
|
4506
|
+
* TypeScript type.
|
|
4183
4507
|
*
|
|
4184
4508
|
* **Example** (Adding checks to a schema)
|
|
4185
4509
|
*
|
|
@@ -4256,6 +4580,13 @@ type DistributeBrands<B> = UnionToIntersection<B extends infer U extends string
|
|
|
4256
4580
|
* The output type of {@link brand}, intersecting the schema's `Type` with one or
|
|
4257
4581
|
* more {@link Brand.Brand} tags.
|
|
4258
4582
|
*
|
|
4583
|
+
* **When to use**
|
|
4584
|
+
*
|
|
4585
|
+
* Use as the schema type when generic code needs to retain the wrapped schema
|
|
4586
|
+
* and nominal brand type.
|
|
4587
|
+
*
|
|
4588
|
+
* @see {@link brand} for adding the brand tag to an existing schema
|
|
4589
|
+
*
|
|
4259
4590
|
* @category branding
|
|
4260
4591
|
* @since 3.10.0
|
|
4261
4592
|
*/
|
|
@@ -4286,6 +4617,18 @@ export interface brand<S extends Top, B> extends
|
|
|
4286
4617
|
* Adds a nominal brand to a schema, intersecting the output type with
|
|
4287
4618
|
* `Brand.Brand<B>` to prevent accidental mixing of structurally identical types.
|
|
4288
4619
|
*
|
|
4620
|
+
* **When to use**
|
|
4621
|
+
*
|
|
4622
|
+
* Use to make values decoded by an existing schema nominally distinct when the
|
|
4623
|
+
* schema already carries the runtime validation you need.
|
|
4624
|
+
*
|
|
4625
|
+
* **Gotchas**
|
|
4626
|
+
*
|
|
4627
|
+
* `brand` adds brand metadata and narrows the TypeScript output type, but it
|
|
4628
|
+
* does not add runtime checks.
|
|
4629
|
+
*
|
|
4630
|
+
* @see {@link fromBrand} for applying a Brand constructor's checks along with the brand tag
|
|
4631
|
+
*
|
|
4289
4632
|
* @category branding
|
|
4290
4633
|
* @since 3.10.0
|
|
4291
4634
|
*/
|
|
@@ -4482,7 +4825,20 @@ export function catchDecoding<S extends Top>(
|
|
|
4482
4825
|
}
|
|
4483
4826
|
|
|
4484
4827
|
/**
|
|
4485
|
-
*
|
|
4828
|
+
* Recovers from a decoding error with a handler that may require Effect services.
|
|
4829
|
+
*
|
|
4830
|
+
* **When to use**
|
|
4831
|
+
*
|
|
4832
|
+
* Use when decoding fallback logic needs services from the Effect context.
|
|
4833
|
+
*
|
|
4834
|
+
* **Details**
|
|
4835
|
+
*
|
|
4836
|
+
* The handler receives the `Issue` and returns an `Effect` that either succeeds
|
|
4837
|
+
* with a fallback value or re-fails with a (possibly different) issue. The
|
|
4838
|
+
* handler's services are added to the schema's decoding services.
|
|
4839
|
+
*
|
|
4840
|
+
* @see {@link catchDecoding} for recovery handlers that do not require services
|
|
4841
|
+
* @see {@link middlewareDecoding} for intercepting or replacing the full decoding pipeline
|
|
4486
4842
|
*
|
|
4487
4843
|
* @category error handling
|
|
4488
4844
|
* @since 4.0.0
|
|
@@ -4513,7 +4869,20 @@ export function catchEncoding<S extends Top>(
|
|
|
4513
4869
|
}
|
|
4514
4870
|
|
|
4515
4871
|
/**
|
|
4516
|
-
*
|
|
4872
|
+
* Recovers from an encoding error with a handler that may require Effect services.
|
|
4873
|
+
*
|
|
4874
|
+
* **When to use**
|
|
4875
|
+
*
|
|
4876
|
+
* Use when encoding fallback logic needs services from the Effect context.
|
|
4877
|
+
*
|
|
4878
|
+
* **Details**
|
|
4879
|
+
*
|
|
4880
|
+
* The handler receives the `Issue` and returns an `Effect` that either succeeds
|
|
4881
|
+
* with a fallback encoded value or re-fails with a (possibly different) issue.
|
|
4882
|
+
* The handler's services are added to the schema's encoding services.
|
|
4883
|
+
*
|
|
4884
|
+
* @see {@link catchEncoding} for recovery handlers that do not require services
|
|
4885
|
+
* @see {@link middlewareEncoding} for intercepting or replacing the full encoding pipeline
|
|
4517
4886
|
*
|
|
4518
4887
|
* @category error handling
|
|
4519
4888
|
* @since 4.0.0
|
|
@@ -4701,13 +5070,17 @@ export function decode<S extends Top, RD = never, RE = never>(transformation: {
|
|
|
4701
5070
|
}
|
|
4702
5071
|
|
|
4703
5072
|
/**
|
|
4704
|
-
*
|
|
4705
|
-
*
|
|
5073
|
+
* Reverses a schema transformation so the encoded schema is supplied first.
|
|
5074
|
+
*
|
|
5075
|
+
* **When to use**
|
|
5076
|
+
*
|
|
5077
|
+
* Use to define a transformation by naming the encoded schema before the
|
|
5078
|
+
* decoded schema.
|
|
4706
5079
|
*
|
|
4707
5080
|
* **Details**
|
|
4708
5081
|
*
|
|
4709
|
-
* `encodeTo(to)(from)` is equivalent to `to.pipe(decodeTo(from))
|
|
4710
|
-
*
|
|
5082
|
+
* `encodeTo(to)(from)` is equivalent to `to.pipe(decodeTo(from))`. The `from`
|
|
5083
|
+
* schema acts as the target decoded schema and `to` acts as the encoded source.
|
|
4711
5084
|
*
|
|
4712
5085
|
* **Example** (Encode a number back to string)
|
|
4713
5086
|
*
|
|
@@ -5142,9 +5515,17 @@ export function tag<Tag extends AST.LiteralValue>(literal: Tag): tag<Tag> {
|
|
|
5142
5515
|
}
|
|
5143
5516
|
|
|
5144
5517
|
/**
|
|
5145
|
-
*
|
|
5146
|
-
*
|
|
5147
|
-
*
|
|
5518
|
+
* Creates a literal `_tag` schema that is omitted from encoded output.
|
|
5519
|
+
*
|
|
5520
|
+
* **When to use**
|
|
5521
|
+
*
|
|
5522
|
+
* Use to decode data that omits the discriminator field while still constructing
|
|
5523
|
+
* values with a `_tag` for tagged union matching.
|
|
5524
|
+
*
|
|
5525
|
+
* **Details**
|
|
5526
|
+
*
|
|
5527
|
+
* The tag is filled during decoding and construction, like {@link tag}, but is
|
|
5528
|
+
* omitted when encoding.
|
|
5148
5529
|
*
|
|
5149
5530
|
* **Example** (Tag omitted during encoding)
|
|
5150
5531
|
*
|
|
@@ -5181,9 +5562,11 @@ export type TaggedStruct<Tag extends AST.LiteralValue, Fields extends Struct.Fie
|
|
|
5181
5562
|
>
|
|
5182
5563
|
|
|
5183
5564
|
/**
|
|
5184
|
-
*
|
|
5185
|
-
*
|
|
5186
|
-
*
|
|
5565
|
+
* Creates a struct schema with an automatically populated `_tag` field.
|
|
5566
|
+
*
|
|
5567
|
+
* **When to use**
|
|
5568
|
+
*
|
|
5569
|
+
* Use to define a tagged union case from a literal tag and a set of fields.
|
|
5187
5570
|
*
|
|
5188
5571
|
* **Details**
|
|
5189
5572
|
*
|
|
@@ -6213,8 +6596,8 @@ export function isFinite(annotations?: Annotations.Filter) {
|
|
|
6213
6596
|
}
|
|
6214
6597
|
|
|
6215
6598
|
/**
|
|
6216
|
-
*
|
|
6217
|
-
*
|
|
6599
|
+
* Creates a greater-than (`>`) check for any ordered type from an
|
|
6600
|
+
* `Order.Order` instance.
|
|
6218
6601
|
*
|
|
6219
6602
|
* @category Order checks
|
|
6220
6603
|
* @since 4.0.0
|
|
@@ -6239,8 +6622,8 @@ export function makeIsGreaterThan<T>(options: {
|
|
|
6239
6622
|
}
|
|
6240
6623
|
|
|
6241
6624
|
/**
|
|
6242
|
-
*
|
|
6243
|
-
*
|
|
6625
|
+
* Creates a greater-than-or-equal-to (`>=`) check for any ordered type from an
|
|
6626
|
+
* `Order.Order` instance.
|
|
6244
6627
|
*
|
|
6245
6628
|
* @category Order checks
|
|
6246
6629
|
* @since 4.0.0
|
|
@@ -6265,8 +6648,8 @@ export function makeIsGreaterThanOrEqualTo<T>(options: {
|
|
|
6265
6648
|
}
|
|
6266
6649
|
|
|
6267
6650
|
/**
|
|
6268
|
-
*
|
|
6269
|
-
*
|
|
6651
|
+
* Creates a less-than (`<`) check for any ordered type from an `Order.Order`
|
|
6652
|
+
* instance.
|
|
6270
6653
|
*
|
|
6271
6654
|
* @category Order checks
|
|
6272
6655
|
* @since 4.0.0
|
|
@@ -6291,8 +6674,8 @@ export function makeIsLessThan<T>(options: {
|
|
|
6291
6674
|
}
|
|
6292
6675
|
|
|
6293
6676
|
/**
|
|
6294
|
-
*
|
|
6295
|
-
*
|
|
6677
|
+
* Creates a less-than-or-equal-to (`<=`) check for any ordered type from an
|
|
6678
|
+
* `Order.Order` instance.
|
|
6296
6679
|
*
|
|
6297
6680
|
* @category Order checks
|
|
6298
6681
|
* @since 4.0.0
|
|
@@ -6317,8 +6700,8 @@ export function makeIsLessThanOrEqualTo<T>(options: {
|
|
|
6317
6700
|
}
|
|
6318
6701
|
|
|
6319
6702
|
/**
|
|
6320
|
-
*
|
|
6321
|
-
*
|
|
6703
|
+
* Creates an inclusive or exclusive range check for any ordered type from an
|
|
6704
|
+
* `Order.Order` instance.
|
|
6322
6705
|
*
|
|
6323
6706
|
* @category Order checks
|
|
6324
6707
|
* @since 4.0.0
|
|
@@ -6362,8 +6745,8 @@ export function makeIsBetween<T>(deriveOptions: {
|
|
|
6362
6745
|
}
|
|
6363
6746
|
|
|
6364
6747
|
/**
|
|
6365
|
-
*
|
|
6366
|
-
*
|
|
6748
|
+
* Creates a divisibility check for any numeric type from a remainder function
|
|
6749
|
+
* and a zero value.
|
|
6367
6750
|
*
|
|
6368
6751
|
* @category Numeric checks
|
|
6369
6752
|
* @since 4.0.0
|
|
@@ -6727,6 +7110,10 @@ export function isDateValid(annotations?: Annotations.Filter) {
|
|
|
6727
7110
|
)
|
|
6728
7111
|
}
|
|
6729
7112
|
|
|
7113
|
+
const nextDate = (date: globalThis.Date) => new globalThis.Date(date.getTime() + 1)
|
|
7114
|
+
|
|
7115
|
+
const previousDate = (date: globalThis.Date) => new globalThis.Date(date.getTime() - 1)
|
|
7116
|
+
|
|
6730
7117
|
/**
|
|
6731
7118
|
* Validates that a Date is greater than the specified value (exclusive).
|
|
6732
7119
|
*
|
|
@@ -6734,9 +7121,9 @@ export function isDateValid(annotations?: Annotations.Filter) {
|
|
|
6734
7121
|
*
|
|
6735
7122
|
* Arbitrary:
|
|
6736
7123
|
*
|
|
6737
|
-
* When generating test data with fast-check, this applies a `min` constraint
|
|
6738
|
-
*
|
|
6739
|
-
*
|
|
7124
|
+
* When generating test data with fast-check, this applies a `min` constraint of
|
|
7125
|
+
* one millisecond after the specified value to ensure generated Date objects are
|
|
7126
|
+
* greater than it.
|
|
6740
7127
|
*
|
|
6741
7128
|
* @category Date checks
|
|
6742
7129
|
* @since 4.0.0
|
|
@@ -6750,8 +7137,7 @@ export const isGreaterThanDate = makeIsGreaterThan({
|
|
|
6750
7137
|
},
|
|
6751
7138
|
toArbitraryConstraint: {
|
|
6752
7139
|
date: {
|
|
6753
|
-
min: exclusiveMinimum
|
|
6754
|
-
minExcluded: true
|
|
7140
|
+
min: nextDate(exclusiveMinimum)
|
|
6755
7141
|
}
|
|
6756
7142
|
}
|
|
6757
7143
|
})
|
|
@@ -6799,9 +7185,9 @@ export const isGreaterThanOrEqualToDate = makeIsGreaterThanOrEqualTo({
|
|
|
6799
7185
|
*
|
|
6800
7186
|
* Arbitrary:
|
|
6801
7187
|
*
|
|
6802
|
-
* When generating test data with fast-check, this applies a `max` constraint
|
|
6803
|
-
*
|
|
6804
|
-
*
|
|
7188
|
+
* When generating test data with fast-check, this applies a `max` constraint of
|
|
7189
|
+
* one millisecond before the specified value to ensure generated Date objects
|
|
7190
|
+
* are less than it.
|
|
6805
7191
|
*
|
|
6806
7192
|
* @category Date checks
|
|
6807
7193
|
* @since 4.0.0
|
|
@@ -6815,8 +7201,7 @@ export const isLessThanDate = makeIsLessThan({
|
|
|
6815
7201
|
},
|
|
6816
7202
|
toArbitraryConstraint: {
|
|
6817
7203
|
date: {
|
|
6818
|
-
max: exclusiveMaximum
|
|
6819
|
-
maxExcluded: true
|
|
7204
|
+
max: previousDate(exclusiveMaximum)
|
|
6820
7205
|
}
|
|
6821
7206
|
}
|
|
6822
7207
|
})
|
|
@@ -6871,7 +7256,8 @@ export const isLessThanOrEqualToDate = makeIsLessThanOrEqualTo({
|
|
|
6871
7256
|
* Arbitrary:
|
|
6872
7257
|
*
|
|
6873
7258
|
* When generating test data with fast-check, this applies `min` and `max`
|
|
6874
|
-
* constraints to ensure generated Date objects fall within the specified range
|
|
7259
|
+
* constraints to ensure generated Date objects fall within the specified range,
|
|
7260
|
+
* shifting exclusive bounds by one millisecond.
|
|
6875
7261
|
*
|
|
6876
7262
|
* @category Date checks
|
|
6877
7263
|
* @since 4.0.0
|
|
@@ -6885,13 +7271,17 @@ export const isBetweenDate = makeIsBetween({
|
|
|
6885
7271
|
},
|
|
6886
7272
|
toArbitraryConstraint: {
|
|
6887
7273
|
date: {
|
|
6888
|
-
min: options.minimum,
|
|
6889
|
-
max: options.maximum
|
|
7274
|
+
min: options.exclusiveMinimum ? nextDate(options.minimum) : options.minimum,
|
|
7275
|
+
max: options.exclusiveMaximum ? previousDate(options.maximum) : options.maximum
|
|
6890
7276
|
}
|
|
6891
7277
|
}
|
|
6892
7278
|
})
|
|
6893
7279
|
})
|
|
6894
7280
|
|
|
7281
|
+
const nextBigInt = (n: bigint) => n + globalThis.BigInt(1)
|
|
7282
|
+
|
|
7283
|
+
const previousBigInt = (n: bigint) => n - globalThis.BigInt(1)
|
|
7284
|
+
|
|
6895
7285
|
/**
|
|
6896
7286
|
* Validates that a BigInt is greater than the specified value (exclusive).
|
|
6897
7287
|
*
|
|
@@ -6899,8 +7289,8 @@ export const isBetweenDate = makeIsBetween({
|
|
|
6899
7289
|
*
|
|
6900
7290
|
* Arbitrary:
|
|
6901
7291
|
*
|
|
6902
|
-
* When generating test data with fast-check, this applies a `min` constraint
|
|
6903
|
-
*
|
|
7292
|
+
* When generating test data with fast-check, this applies a `min` constraint of
|
|
7293
|
+
* `exclusiveMinimum + 1n` to ensure generated BigInts are greater than the
|
|
6904
7294
|
* specified value.
|
|
6905
7295
|
*
|
|
6906
7296
|
* @category BigInt checks
|
|
@@ -6915,8 +7305,7 @@ export const isGreaterThanBigInt = makeIsGreaterThan({
|
|
|
6915
7305
|
},
|
|
6916
7306
|
toArbitraryConstraint: {
|
|
6917
7307
|
bigint: {
|
|
6918
|
-
min: exclusiveMinimum
|
|
6919
|
-
minExcluded: true
|
|
7308
|
+
min: nextBigInt(exclusiveMinimum)
|
|
6920
7309
|
}
|
|
6921
7310
|
}
|
|
6922
7311
|
})
|
|
@@ -6959,8 +7348,8 @@ export const isGreaterThanOrEqualToBigInt = makeIsGreaterThanOrEqualTo({
|
|
|
6959
7348
|
*
|
|
6960
7349
|
* Arbitrary:
|
|
6961
7350
|
*
|
|
6962
|
-
* When generating test data with fast-check, this applies a `max` constraint
|
|
6963
|
-
*
|
|
7351
|
+
* When generating test data with fast-check, this applies a `max` constraint of
|
|
7352
|
+
* `exclusiveMaximum - 1n` to ensure generated BigInts are less than the
|
|
6964
7353
|
* specified value.
|
|
6965
7354
|
*
|
|
6966
7355
|
* @category BigInt checks
|
|
@@ -6975,8 +7364,7 @@ export const isLessThanBigInt = makeIsLessThan({
|
|
|
6975
7364
|
},
|
|
6976
7365
|
toArbitraryConstraint: {
|
|
6977
7366
|
bigint: {
|
|
6978
|
-
max: exclusiveMaximum
|
|
6979
|
-
maxExcluded: true
|
|
7367
|
+
max: previousBigInt(exclusiveMaximum)
|
|
6980
7368
|
}
|
|
6981
7369
|
}
|
|
6982
7370
|
})
|
|
@@ -7036,8 +7424,8 @@ export const isBetweenBigInt = makeIsBetween({
|
|
|
7036
7424
|
},
|
|
7037
7425
|
toArbitraryConstraint: {
|
|
7038
7426
|
bigint: {
|
|
7039
|
-
min: options.minimum,
|
|
7040
|
-
max: options.maximum
|
|
7427
|
+
min: options.exclusiveMinimum ? nextBigInt(options.minimum) : options.minimum,
|
|
7428
|
+
max: options.exclusiveMaximum ? previousBigInt(options.maximum) : options.maximum
|
|
7041
7429
|
}
|
|
7042
7430
|
}
|
|
7043
7431
|
})
|
|
@@ -7629,7 +8017,7 @@ export interface NonEmptyString extends String {
|
|
|
7629
8017
|
}
|
|
7630
8018
|
|
|
7631
8019
|
/**
|
|
7632
|
-
*
|
|
8020
|
+
* Schema for non-empty strings. Validates that a string has at least one
|
|
7633
8021
|
* character.
|
|
7634
8022
|
*
|
|
7635
8023
|
* @category String
|
|
@@ -7649,7 +8037,20 @@ export interface Char extends String {
|
|
|
7649
8037
|
}
|
|
7650
8038
|
|
|
7651
8039
|
/**
|
|
7652
|
-
*
|
|
8040
|
+
* Schema for strings whose JavaScript `length` is exactly `1`.
|
|
8041
|
+
*
|
|
8042
|
+
* **When to use**
|
|
8043
|
+
*
|
|
8044
|
+
* Use to validate string values that must have `length === 1`.
|
|
8045
|
+
*
|
|
8046
|
+
* **Gotchas**
|
|
8047
|
+
*
|
|
8048
|
+
* This schema uses JavaScript `String.length`, so visible characters made from
|
|
8049
|
+
* multiple UTF-16 code units do not satisfy `length === 1`.
|
|
8050
|
+
*
|
|
8051
|
+
* @see {@link String} for unconstrained string values
|
|
8052
|
+
* @see {@link NonEmptyString} for strings with length greater than zero
|
|
8053
|
+
* @see {@link isLengthBetween} for the underlying length check
|
|
7653
8054
|
*
|
|
7654
8055
|
* @category String
|
|
7655
8056
|
* @since 3.10.0
|
|
@@ -7704,7 +8105,7 @@ export type OptionIso<A extends Top> =
|
|
|
7704
8105
|
| { readonly _tag: "Some"; readonly value: A["Iso"] }
|
|
7705
8106
|
|
|
7706
8107
|
/**
|
|
7707
|
-
*
|
|
8108
|
+
* Schema for `Option<A>` values.
|
|
7708
8109
|
*
|
|
7709
8110
|
* @category Option
|
|
7710
8111
|
* @since 3.10.0
|
|
@@ -8004,7 +8405,7 @@ export function OptionFromOptionalNullOr<S extends Top>(
|
|
|
8004
8405
|
* Schema for the `Result<A, E>` type, representing a computation that either
|
|
8005
8406
|
* succeeds with `A` or fails with `E`.
|
|
8006
8407
|
*
|
|
8007
|
-
* @category
|
|
8408
|
+
* @category schemas
|
|
8008
8409
|
* @since 4.0.0
|
|
8009
8410
|
*/
|
|
8010
8411
|
export interface Result<A extends Top, E extends Top> extends
|
|
@@ -8028,7 +8429,7 @@ export interface Result<A extends Top, E extends Top> extends
|
|
|
8028
8429
|
* Successful results are represented as `{ _tag: "Success", success }`, while
|
|
8029
8430
|
* failed results are represented as `{ _tag: "Failure", failure }`.
|
|
8030
8431
|
*
|
|
8031
|
-
* @category
|
|
8432
|
+
* @category schemas
|
|
8032
8433
|
* @since 4.0.0
|
|
8033
8434
|
*/
|
|
8034
8435
|
export type ResultIso<A extends Top, E extends Top> =
|
|
@@ -8036,9 +8437,9 @@ export type ResultIso<A extends Top, E extends Top> =
|
|
|
8036
8437
|
| { readonly _tag: "Failure"; readonly failure: E["Iso"] }
|
|
8037
8438
|
|
|
8038
8439
|
/**
|
|
8039
|
-
*
|
|
8440
|
+
* Schema for `Result<A, E>` values.
|
|
8040
8441
|
*
|
|
8041
|
-
* @category
|
|
8442
|
+
* @category schemas
|
|
8042
8443
|
* @since 4.0.0
|
|
8043
8444
|
*/
|
|
8044
8445
|
export function Result<A extends Top, E extends Top>(
|
|
@@ -8130,8 +8531,8 @@ export interface Redacted<S extends Top> extends
|
|
|
8130
8531
|
}
|
|
8131
8532
|
|
|
8132
8533
|
/**
|
|
8133
|
-
*
|
|
8134
|
-
*
|
|
8534
|
+
* Schema for values that hide sensitive information from error output and
|
|
8535
|
+
* inspection.
|
|
8135
8536
|
*
|
|
8136
8537
|
* **Details**
|
|
8137
8538
|
*
|
|
@@ -8145,17 +8546,16 @@ export interface Redacted<S extends Top> extends
|
|
|
8145
8546
|
* - The default JSON serializer will deserialize into a `Redacted` instance with the label
|
|
8146
8547
|
* - The arbitrary generator will produce a `Redacted` instance with the label
|
|
8147
8548
|
* - The formatter will return the label
|
|
8148
|
-
*
|
|
8149
|
-
*
|
|
8150
|
-
*
|
|
8151
|
-
* The default JSON serializer will fail when attempting to serialize a `Redacted` value,
|
|
8152
|
-
* but it will deserialize a value into a `Redacted` instance.
|
|
8549
|
+
* - `disallowJsonEncode`: When set to `true`, when attempting to encode a `Redacted` instance
|
|
8550
|
+
* into JSON, it will fail with an error. This is useful when the wrapped schema is
|
|
8551
|
+
* sensitive and should not be exposed in JSON.
|
|
8153
8552
|
*
|
|
8154
8553
|
* @category Redacted
|
|
8155
8554
|
* @since 3.10.0
|
|
8156
8555
|
*/
|
|
8157
8556
|
export function Redacted<S extends Top>(value: S, options?: {
|
|
8158
8557
|
readonly label?: string | undefined
|
|
8558
|
+
readonly disallowJsonEncode?: boolean | undefined
|
|
8159
8559
|
}): Redacted<S> {
|
|
8160
8560
|
const decodeLabel = typeof options?.label === "string"
|
|
8161
8561
|
? Parser.decodeUnknownEffect(Literal(options.label))
|
|
@@ -8204,10 +8604,12 @@ export function Redacted<S extends Top>(value: S, options?: {
|
|
|
8204
8604
|
redact(value),
|
|
8205
8605
|
{
|
|
8206
8606
|
decode: Getter.transform((e) => Redacted_.make(e, { label: options?.label })),
|
|
8207
|
-
encode:
|
|
8208
|
-
|
|
8209
|
-
|
|
8210
|
-
|
|
8607
|
+
encode: options?.disallowJsonEncode ?
|
|
8608
|
+
Getter.forbidden((oe) =>
|
|
8609
|
+
"Cannot serialize Redacted" +
|
|
8610
|
+
(Option_.isSome(oe) && typeof oe.value.label === "string" ? ` with label: "${oe.value.label}"` : "")
|
|
8611
|
+
) :
|
|
8612
|
+
Getter.transform(Redacted_.value)
|
|
8211
8613
|
}
|
|
8212
8614
|
),
|
|
8213
8615
|
toArbitrary: ([value]) => () => value.map((a) => Redacted_.make(a, { label: options?.label })),
|
|
@@ -8252,15 +8654,24 @@ export function redact<S extends Top>(schema: S): middlewareDecoding<S, S["Decod
|
|
|
8252
8654
|
*/
|
|
8253
8655
|
export function RedactedFromValue<S extends Top>(value: S, options?: {
|
|
8254
8656
|
readonly label?: string | undefined
|
|
8657
|
+
readonly disallowEncode?: boolean | undefined
|
|
8255
8658
|
}): RedactedFromValue<S> {
|
|
8256
8659
|
return redact(value).pipe(
|
|
8257
|
-
decodeTo(
|
|
8258
|
-
|
|
8259
|
-
|
|
8260
|
-
|
|
8261
|
-
|
|
8262
|
-
|
|
8263
|
-
|
|
8660
|
+
decodeTo(
|
|
8661
|
+
Redacted(toType(value), {
|
|
8662
|
+
label: options?.label,
|
|
8663
|
+
disallowJsonEncode: options?.disallowEncode
|
|
8664
|
+
}),
|
|
8665
|
+
{
|
|
8666
|
+
decode: Getter.transform((t) => Redacted_.make(t, { label: options?.label })),
|
|
8667
|
+
encode: options?.disallowEncode ?
|
|
8668
|
+
Getter.forbidden((oe) =>
|
|
8669
|
+
"Cannot encode Redacted" +
|
|
8670
|
+
(Option_.isSome(oe) && typeof oe.value.label === "string" ? ` with label: "${oe.value.label}"` : "")
|
|
8671
|
+
) :
|
|
8672
|
+
Getter.transform(Redacted_.value)
|
|
8673
|
+
}
|
|
8674
|
+
)
|
|
8264
8675
|
)
|
|
8265
8676
|
}
|
|
8266
8677
|
|
|
@@ -8269,11 +8680,19 @@ export function RedactedFromValue<S extends Top>(value: S, options?: {
|
|
|
8269
8680
|
* a typed error (`Fail`), an unexpected defect (`Die`), or an interrupt
|
|
8270
8681
|
* (`Interrupt`).
|
|
8271
8682
|
*
|
|
8683
|
+
* **When to use**
|
|
8684
|
+
*
|
|
8685
|
+
* Use as the schema type when generic code needs to retain the typed failure
|
|
8686
|
+
* and defect schemas for a single cause reason.
|
|
8687
|
+
*
|
|
8272
8688
|
* **Details**
|
|
8273
8689
|
*
|
|
8274
8690
|
* The `error` schema validates typed failures and the `defect` schema validates
|
|
8275
8691
|
* unexpected defects.
|
|
8276
8692
|
*
|
|
8693
|
+
* @see {@link CauseReason} for constructing this schema type
|
|
8694
|
+
* @see {@link CauseReasonIso} for the ISO shape of each cause reason
|
|
8695
|
+
*
|
|
8277
8696
|
* @category CauseReason
|
|
8278
8697
|
* @since 4.0.0
|
|
8279
8698
|
*/
|
|
@@ -8316,6 +8735,19 @@ export type CauseReasonIso<E extends Top, D extends Top> = {
|
|
|
8316
8735
|
* Creates a schema for `Cause.Reason` values using separate schemas for typed
|
|
8317
8736
|
* failures and unexpected defects.
|
|
8318
8737
|
*
|
|
8738
|
+
* **When to use**
|
|
8739
|
+
*
|
|
8740
|
+
* Use to validate, transform, or serialize individual `Cause.Reason` values
|
|
8741
|
+
* when typed failures and unexpected defects need separate schemas.
|
|
8742
|
+
*
|
|
8743
|
+
* **Details**
|
|
8744
|
+
*
|
|
8745
|
+
* `Fail` reasons use the `error` schema, `Die` reasons use the `defect` schema,
|
|
8746
|
+
* and `Interrupt` reasons carry only an optional fiber id.
|
|
8747
|
+
*
|
|
8748
|
+
* @see {@link Cause} for constructing schemas for full Cause values
|
|
8749
|
+
* @see {@link CauseReasonIso} for the ISO shape of each cause reason
|
|
8750
|
+
*
|
|
8319
8751
|
* @category CauseReason
|
|
8320
8752
|
* @since 4.0.0
|
|
8321
8753
|
*/
|
|
@@ -8430,11 +8862,19 @@ function causeReasonToFormatter<E>(error: Formatter<E>, defect: Formatter<unknow
|
|
|
8430
8862
|
* Schema for `Cause` values, represented as an ordered collection of failure
|
|
8431
8863
|
* reasons combining typed errors, defects, and interrupts.
|
|
8432
8864
|
*
|
|
8865
|
+
* **When to use**
|
|
8866
|
+
*
|
|
8867
|
+
* Use as the schema type when generic code needs to retain the typed failure
|
|
8868
|
+
* and defect schemas for a full cause.
|
|
8869
|
+
*
|
|
8433
8870
|
* **Details**
|
|
8434
8871
|
*
|
|
8435
8872
|
* The `error` schema validates typed failures and the `defect` schema validates
|
|
8436
8873
|
* unexpected defects.
|
|
8437
8874
|
*
|
|
8875
|
+
* @see {@link Cause} for constructing this schema type
|
|
8876
|
+
* @see {@link CauseIso} for the ordered array representation used by the schema ISO
|
|
8877
|
+
*
|
|
8438
8878
|
* @category Cause
|
|
8439
8879
|
* @since 3.10.0
|
|
8440
8880
|
*/
|
|
@@ -8455,6 +8895,14 @@ export interface Cause<E extends Top, D extends Top> extends
|
|
|
8455
8895
|
* Iso representation used for `Cause` schemas: an ordered array of
|
|
8456
8896
|
* `CauseReasonIso` values.
|
|
8457
8897
|
*
|
|
8898
|
+
* **When to use**
|
|
8899
|
+
*
|
|
8900
|
+
* Use when working with the ISO shape of a `Cause` schema, such as `toIso`
|
|
8901
|
+
* optics or codecs that expose a cause as its ordered array of encoded reasons.
|
|
8902
|
+
*
|
|
8903
|
+
* @see {@link Cause} for constructing schemas for full Cause values
|
|
8904
|
+
* @see {@link CauseReasonIso} for the ISO shape of each array element
|
|
8905
|
+
*
|
|
8458
8906
|
* @category Cause
|
|
8459
8907
|
* @since 4.0.0
|
|
8460
8908
|
*/
|
|
@@ -8464,6 +8912,20 @@ export type CauseIso<E extends Top, D extends Top> = ReadonlyArray<CauseReasonIs
|
|
|
8464
8912
|
* Creates a schema for `Cause` values using separate schemas for typed failures
|
|
8465
8913
|
* and unexpected defects.
|
|
8466
8914
|
*
|
|
8915
|
+
* **When to use**
|
|
8916
|
+
*
|
|
8917
|
+
* Use to validate, transform, or serialize Effect failure causes when typed
|
|
8918
|
+
* failures and unexpected defects need separate schemas.
|
|
8919
|
+
*
|
|
8920
|
+
* **Details**
|
|
8921
|
+
*
|
|
8922
|
+
* The `error` schema is applied to `Fail` reasons and the `defect` schema is
|
|
8923
|
+
* applied to `Die` reasons. Interrupt reasons do not use either schema and
|
|
8924
|
+
* carry only an optional fiber id.
|
|
8925
|
+
*
|
|
8926
|
+
* @see {@link CauseReason} for the schema used by each individual cause reason
|
|
8927
|
+
* @see {@link CauseIso} for the ordered array representation used by the schema ISO
|
|
8928
|
+
*
|
|
8467
8929
|
* @category Cause
|
|
8468
8930
|
* @since 3.10.0
|
|
8469
8931
|
*/
|
|
@@ -8541,7 +9003,7 @@ const ErrorJsonEncoded = Struct({
|
|
|
8541
9003
|
})
|
|
8542
9004
|
|
|
8543
9005
|
/**
|
|
8544
|
-
*
|
|
9006
|
+
* Schema for JavaScript `Error` objects.
|
|
8545
9007
|
*
|
|
8546
9008
|
* **Details**
|
|
8547
9009
|
*
|
|
@@ -8567,7 +9029,7 @@ export const Error: Error = instanceOf(globalThis.Error, {
|
|
|
8567
9029
|
})
|
|
8568
9030
|
|
|
8569
9031
|
/**
|
|
8570
|
-
*
|
|
9032
|
+
* Schema for JavaScript `Error` objects that preserves stack traces in the JSON
|
|
8571
9033
|
* encoded form.
|
|
8572
9034
|
*
|
|
8573
9035
|
* **Details**
|
|
@@ -8635,7 +9097,7 @@ const defectTransformation = new Transformation.Transformation(
|
|
|
8635
9097
|
)
|
|
8636
9098
|
|
|
8637
9099
|
/**
|
|
8638
|
-
*
|
|
9100
|
+
* Schema for defect values, accepting either JavaScript `Error` values encoded
|
|
8639
9101
|
* with `message` and optional `name`, or arbitrary unknown defect values.
|
|
8640
9102
|
*
|
|
8641
9103
|
* **Details**
|
|
@@ -8659,8 +9121,7 @@ export const Defect: Defect = Union([
|
|
|
8659
9121
|
])
|
|
8660
9122
|
|
|
8661
9123
|
/**
|
|
8662
|
-
*
|
|
8663
|
-
* encoded form.
|
|
9124
|
+
* Schema for defects that also includes stack traces in the encoded form.
|
|
8664
9125
|
*
|
|
8665
9126
|
* @category Defect
|
|
8666
9127
|
* @since 4.0.0
|
|
@@ -8826,6 +9287,15 @@ export function Exit<A extends Top, E extends Top, D extends Top>(value: A, erro
|
|
|
8826
9287
|
* Type-level representation of a `ReadonlyMap` schema whose keys and values are
|
|
8827
9288
|
* validated by the provided schemas.
|
|
8828
9289
|
*
|
|
9290
|
+
* **When to use**
|
|
9291
|
+
*
|
|
9292
|
+
* Use as a type annotation for a `ReadonlyMap` schema when exposing or returning
|
|
9293
|
+
* the schema while preserving its key schema, value schema, and ISO
|
|
9294
|
+
* representation.
|
|
9295
|
+
*
|
|
9296
|
+
* @see {@link ReadonlyMap} for constructing this schema type from key and value schemas
|
|
9297
|
+
* @see {@link ReadonlyMapIso} for the readonly tuple-array ISO representation used by this schema
|
|
9298
|
+
*
|
|
8829
9299
|
* @category ReadonlyMap
|
|
8830
9300
|
* @since 4.0.0
|
|
8831
9301
|
*/
|
|
@@ -8852,8 +9322,8 @@ export interface $ReadonlyMap<Key extends Top, Value extends Top> extends
|
|
|
8852
9322
|
export type ReadonlyMapIso<Key extends Top, Value extends Top> = ReadonlyArray<readonly [Key["Iso"], Value["Iso"]]>
|
|
8853
9323
|
|
|
8854
9324
|
/**
|
|
8855
|
-
*
|
|
8856
|
-
*
|
|
9325
|
+
* Schema for readonly maps whose keys and values conform to the provided
|
|
9326
|
+
* schemas.
|
|
8857
9327
|
*
|
|
8858
9328
|
* @category ReadonlyMap
|
|
8859
9329
|
* @since 3.10.0
|
|
@@ -8949,8 +9419,7 @@ export interface HashMap<Key extends Top, Value extends Top> extends
|
|
|
8949
9419
|
export type HashMapIso<Key extends Top, Value extends Top> = ReadonlyArray<readonly [Key["Iso"], Value["Iso"]]>
|
|
8950
9420
|
|
|
8951
9421
|
/**
|
|
8952
|
-
*
|
|
8953
|
-
* conform to the provided schemas.
|
|
9422
|
+
* Schema for hash maps whose keys and values conform to the provided schemas.
|
|
8954
9423
|
*
|
|
8955
9424
|
* @category HashMap
|
|
8956
9425
|
* @since 3.10.0
|
|
@@ -9021,6 +9490,14 @@ export function HashMap<Key extends Top, Value extends Top>(key: Key, value: Val
|
|
|
9021
9490
|
* Type-level representation of a `ReadonlySet` schema whose values are validated
|
|
9022
9491
|
* by the provided element schema.
|
|
9023
9492
|
*
|
|
9493
|
+
* **When to use**
|
|
9494
|
+
*
|
|
9495
|
+
* Use to name or constrain the schema type produced by `ReadonlySet` when
|
|
9496
|
+
* generic code needs to retain the element schema type.
|
|
9497
|
+
*
|
|
9498
|
+
* @see {@link ReadonlySet} for constructing this schema type
|
|
9499
|
+
* @see {@link ReadonlySetIso} for the array representation used by this schema's ISO
|
|
9500
|
+
*
|
|
9024
9501
|
* @category ReadonlySet
|
|
9025
9502
|
* @since 4.0.0
|
|
9026
9503
|
*/
|
|
@@ -9046,8 +9523,7 @@ export interface $ReadonlySet<Value extends Top> extends
|
|
|
9046
9523
|
export type ReadonlySetIso<Value extends Top> = ReadonlyArray<Value["Iso"]>
|
|
9047
9524
|
|
|
9048
9525
|
/**
|
|
9049
|
-
*
|
|
9050
|
-
* provided element schema.
|
|
9526
|
+
* Schema for readonly sets whose values conform to the provided element schema.
|
|
9051
9527
|
*
|
|
9052
9528
|
* @category ReadonlySet
|
|
9053
9529
|
* @since 3.10.0
|
|
@@ -9142,8 +9618,7 @@ export interface HashSet<Value extends Top> extends
|
|
|
9142
9618
|
export type HashSetIso<Value extends Top> = ReadonlyArray<Value["Iso"]>
|
|
9143
9619
|
|
|
9144
9620
|
/**
|
|
9145
|
-
*
|
|
9146
|
-
* provided schema.
|
|
9621
|
+
* Schema for hash sets whose values conform to the provided element schema.
|
|
9147
9622
|
*
|
|
9148
9623
|
* @category HashSet
|
|
9149
9624
|
* @since 3.10.0
|
|
@@ -9232,14 +9707,20 @@ export interface Chunk<Value extends Top> extends
|
|
|
9232
9707
|
* Iso representation used for `Chunk` schemas: an array of element values using
|
|
9233
9708
|
* the element schema's `Iso` type.
|
|
9234
9709
|
*
|
|
9710
|
+
* **When to use**
|
|
9711
|
+
*
|
|
9712
|
+
* Use when annotating type-level helpers that work with the readonly-array ISO
|
|
9713
|
+
* shape of a `Chunk` schema.
|
|
9714
|
+
*
|
|
9715
|
+
* @see {@link Chunk} for the schema interface and constructor that use this ISO representation
|
|
9716
|
+
*
|
|
9235
9717
|
* @category Chunk
|
|
9236
9718
|
* @since 4.0.0
|
|
9237
9719
|
*/
|
|
9238
9720
|
export type ChunkIso<Value extends Top> = ReadonlyArray<Value["Iso"]>
|
|
9239
9721
|
|
|
9240
9722
|
/**
|
|
9241
|
-
*
|
|
9242
|
-
* provided schema.
|
|
9723
|
+
* Schema for chunks whose values conform to the provided element schema.
|
|
9243
9724
|
*
|
|
9244
9725
|
* @category Chunk
|
|
9245
9726
|
* @since 3.10.0
|
|
@@ -9394,7 +9875,7 @@ export interface URL extends instanceOf<globalThis.URL> {
|
|
|
9394
9875
|
const URLString = String.annotate({ expected: "a string that will be decoded as a URL" })
|
|
9395
9876
|
|
|
9396
9877
|
/**
|
|
9397
|
-
*
|
|
9878
|
+
* Schema for JavaScript `URL` objects.
|
|
9398
9879
|
*
|
|
9399
9880
|
* **Details**
|
|
9400
9881
|
*
|
|
@@ -9438,7 +9919,7 @@ export interface URLFromString extends decodeTo<URL, String> {
|
|
|
9438
9919
|
}
|
|
9439
9920
|
|
|
9440
9921
|
/**
|
|
9441
|
-
*
|
|
9922
|
+
* Schema that decodes a `string` into a `URL`.
|
|
9442
9923
|
*
|
|
9443
9924
|
* **Details**
|
|
9444
9925
|
*
|
|
@@ -9467,14 +9948,18 @@ export interface Date extends instanceOf<globalThis.Date> {
|
|
|
9467
9948
|
const DateString = String.annotate({ expected: "a string in ISO 8601 format that will be decoded as a Date" })
|
|
9468
9949
|
|
|
9469
9950
|
/**
|
|
9470
|
-
*
|
|
9951
|
+
* Schema for JavaScript `Date` objects.
|
|
9952
|
+
*
|
|
9953
|
+
* **When to use**
|
|
9954
|
+
*
|
|
9955
|
+
* Use to validate in-memory values that must already be JavaScript `Date`
|
|
9956
|
+
* instances.
|
|
9471
9957
|
*
|
|
9472
9958
|
* **Details**
|
|
9473
9959
|
*
|
|
9474
|
-
* This schema accepts any `Date` instance, including invalid dates.
|
|
9475
|
-
*
|
|
9476
|
-
*
|
|
9477
|
-
* `"Invalid Date"`.
|
|
9960
|
+
* This schema accepts any `Date` instance, including invalid dates. The default
|
|
9961
|
+
* JSON serializer encodes valid dates as ISO 8601 strings; invalid dates encode
|
|
9962
|
+
* as `"Invalid Date"`.
|
|
9478
9963
|
*
|
|
9479
9964
|
* **Example** (Date schema)
|
|
9480
9965
|
*
|
|
@@ -9485,6 +9970,8 @@ const DateString = String.annotate({ expected: "a string in ISO 8601 format that
|
|
|
9485
9970
|
* // => Date { 2024-01-01T00:00:00.000Z }
|
|
9486
9971
|
* ```
|
|
9487
9972
|
*
|
|
9973
|
+
* @see {@link DateValid} for accepting only valid Date instances
|
|
9974
|
+
*
|
|
9488
9975
|
* @category Date
|
|
9489
9976
|
* @since 4.0.0
|
|
9490
9977
|
*/
|
|
@@ -9520,18 +10007,29 @@ export interface DateFromString extends decodeTo<Date, String> {
|
|
|
9520
10007
|
}
|
|
9521
10008
|
|
|
9522
10009
|
/**
|
|
9523
|
-
*
|
|
10010
|
+
* Schema that decodes a string into a JavaScript `Date`.
|
|
10011
|
+
*
|
|
10012
|
+
* **When to use**
|
|
10013
|
+
*
|
|
10014
|
+
* Use to model string-encoded dates that decode to JavaScript `Date` objects
|
|
10015
|
+
* and encode back to strings.
|
|
9524
10016
|
*
|
|
9525
10017
|
* **Details**
|
|
9526
10018
|
*
|
|
9527
10019
|
* Decoding:
|
|
9528
|
-
* The string is passed to JavaScript `Date` construction
|
|
9529
|
-
* invalid `Date`. Compose with `DateValid` when invalid dates should be rejected.
|
|
10020
|
+
* The string is passed to JavaScript `Date` construction.
|
|
9530
10021
|
*
|
|
9531
10022
|
* Encoding:
|
|
9532
10023
|
* A valid `Date` is encoded as an ISO string; an invalid `Date` is encoded as
|
|
9533
10024
|
* `"Invalid Date"`.
|
|
9534
10025
|
*
|
|
10026
|
+
* **Gotchas**
|
|
10027
|
+
*
|
|
10028
|
+
* Invalid date strings can decode to invalid `Date` instances.
|
|
10029
|
+
*
|
|
10030
|
+
* @see {@link Date} for accepting Date instances directly
|
|
10031
|
+
* @see {@link DateValid} for rejecting invalid Date instances
|
|
10032
|
+
*
|
|
9535
10033
|
* @category Date
|
|
9536
10034
|
* @since 3.10.0
|
|
9537
10035
|
*/
|
|
@@ -9549,7 +10047,7 @@ export interface DateValid extends Date {
|
|
|
9549
10047
|
}
|
|
9550
10048
|
|
|
9551
10049
|
/**
|
|
9552
|
-
*
|
|
10050
|
+
* Schema for **valid** JavaScript `Date` objects.
|
|
9553
10051
|
*
|
|
9554
10052
|
* **Details**
|
|
9555
10053
|
*
|
|
@@ -9572,7 +10070,7 @@ export interface Duration extends declare<Duration_.Duration> {
|
|
|
9572
10070
|
}
|
|
9573
10071
|
|
|
9574
10072
|
/**
|
|
9575
|
-
*
|
|
10073
|
+
* Schema for `Duration` values.
|
|
9576
10074
|
*
|
|
9577
10075
|
* **Details**
|
|
9578
10076
|
*
|
|
@@ -9665,7 +10163,7 @@ export interface DurationFromString extends decodeTo<Duration, String> {
|
|
|
9665
10163
|
}
|
|
9666
10164
|
|
|
9667
10165
|
/**
|
|
9668
|
-
*
|
|
10166
|
+
* Schema that parses a string into a `Duration`.
|
|
9669
10167
|
*
|
|
9670
10168
|
* **Details**
|
|
9671
10169
|
*
|
|
@@ -9697,7 +10195,7 @@ export interface DurationFromNanos extends decodeTo<Duration, BigInt> {
|
|
|
9697
10195
|
const bigint0 = globalThis.BigInt(0)
|
|
9698
10196
|
|
|
9699
10197
|
/**
|
|
9700
|
-
*
|
|
10198
|
+
* Schema that decodes a non-negative `bigint` into a
|
|
9701
10199
|
* `Duration`, treating the bigint as nanoseconds.
|
|
9702
10200
|
*
|
|
9703
10201
|
* **Details**
|
|
@@ -9729,7 +10227,7 @@ export interface DurationFromMillis extends decodeTo<Duration, Number> {
|
|
|
9729
10227
|
}
|
|
9730
10228
|
|
|
9731
10229
|
/**
|
|
9732
|
-
*
|
|
10230
|
+
* Schema that decodes a non-negative (possibly infinite)
|
|
9733
10231
|
* integer into a `Duration`, treating the integer value as the duration in
|
|
9734
10232
|
* milliseconds.
|
|
9735
10233
|
*
|
|
@@ -9763,7 +10261,12 @@ export interface BigDecimal extends declare<BigDecimal_.BigDecimal> {
|
|
|
9763
10261
|
const BigDecimalString = String.annotate({ expected: "a string that will be decoded as a BigDecimal" })
|
|
9764
10262
|
|
|
9765
10263
|
/**
|
|
9766
|
-
*
|
|
10264
|
+
* Schema for `BigDecimal` values.
|
|
10265
|
+
*
|
|
10266
|
+
* **When to use**
|
|
10267
|
+
*
|
|
10268
|
+
* Use when values are already Effect decimal instances and need schema
|
|
10269
|
+
* validation, formatting, equivalence, and JSON string serialization.
|
|
9767
10270
|
*
|
|
9768
10271
|
* **Details**
|
|
9769
10272
|
*
|
|
@@ -9771,6 +10274,8 @@ const BigDecimalString = String.annotate({ expected: "a string that will be deco
|
|
|
9771
10274
|
*
|
|
9772
10275
|
* - encodes `BigDecimal` as a `string`
|
|
9773
10276
|
*
|
|
10277
|
+
* @see {@link BigDecimalFromString} for parsing string input into a BigDecimal
|
|
10278
|
+
*
|
|
9774
10279
|
* @category BigDecimal
|
|
9775
10280
|
* @since 3.10.0
|
|
9776
10281
|
*/
|
|
@@ -9811,15 +10316,28 @@ export interface BigDecimalFromString extends decodeTo<BigDecimal, String> {
|
|
|
9811
10316
|
}
|
|
9812
10317
|
|
|
9813
10318
|
/**
|
|
9814
|
-
*
|
|
10319
|
+
* Schema that parses a string into a `BigDecimal`.
|
|
10320
|
+
*
|
|
10321
|
+
* **When to use**
|
|
10322
|
+
*
|
|
10323
|
+
* Use to parse decimal or exponent-notation strings into arbitrary-precision
|
|
10324
|
+
* BigDecimal values while encoding them back to strings.
|
|
9815
10325
|
*
|
|
9816
10326
|
* **Details**
|
|
9817
10327
|
*
|
|
9818
10328
|
* Decoding:
|
|
9819
|
-
* - A `string` is decoded
|
|
10329
|
+
* - A `string` is decoded with `BigDecimal.fromString`.
|
|
9820
10330
|
*
|
|
9821
10331
|
* Encoding:
|
|
9822
|
-
* - A `BigDecimal` is encoded
|
|
10332
|
+
* - A `BigDecimal` is encoded with `BigDecimal.format`.
|
|
10333
|
+
*
|
|
10334
|
+
* **Gotchas**
|
|
10335
|
+
*
|
|
10336
|
+
* An empty string decodes as zero.
|
|
10337
|
+
*
|
|
10338
|
+
* @see {@link BigDecimal} for validating values that are already BigDecimal values
|
|
10339
|
+
* @see {@link BigIntFromString} for parsing base-10 integer strings into bigint values
|
|
10340
|
+
* @see {@link NumberFromString} for parsing JavaScript number strings
|
|
9823
10341
|
*
|
|
9824
10342
|
* @category BigDecimal
|
|
9825
10343
|
* @since 4.0.0
|
|
@@ -9840,7 +10358,7 @@ export interface UnknownFromJsonString extends fromJsonString<Unknown> {
|
|
|
9840
10358
|
}
|
|
9841
10359
|
|
|
9842
10360
|
/**
|
|
9843
|
-
*
|
|
10361
|
+
* Schema that decodes a JSON-encoded string into an `unknown` value.
|
|
9844
10362
|
*
|
|
9845
10363
|
* **Details**
|
|
9846
10364
|
*
|
|
@@ -10101,9 +10619,11 @@ export interface fromFormData<S extends Top> extends decodeTo<S, FormData> {
|
|
|
10101
10619
|
}
|
|
10102
10620
|
|
|
10103
10621
|
/**
|
|
10104
|
-
*
|
|
10105
|
-
*
|
|
10106
|
-
*
|
|
10622
|
+
* Schema for decoding `FormData` through a bracket-notation tree.
|
|
10623
|
+
*
|
|
10624
|
+
* **When to use**
|
|
10625
|
+
*
|
|
10626
|
+
* Use to decode browser or multipart form data into a structured schema value.
|
|
10107
10627
|
*
|
|
10108
10628
|
* **Details**
|
|
10109
10629
|
*
|
|
@@ -10242,9 +10762,11 @@ export interface fromURLSearchParams<S extends Top> extends decodeTo<S, URLSearc
|
|
|
10242
10762
|
}
|
|
10243
10763
|
|
|
10244
10764
|
/**
|
|
10245
|
-
*
|
|
10246
|
-
*
|
|
10247
|
-
*
|
|
10765
|
+
* Schema for decoding `URLSearchParams` through a bracket-notation tree.
|
|
10766
|
+
*
|
|
10767
|
+
* **When to use**
|
|
10768
|
+
*
|
|
10769
|
+
* Use to decode query parameters into a structured schema value.
|
|
10248
10770
|
*
|
|
10249
10771
|
* **Details**
|
|
10250
10772
|
*
|
|
@@ -10335,7 +10857,7 @@ export interface Finite extends Number {
|
|
|
10335
10857
|
}
|
|
10336
10858
|
|
|
10337
10859
|
/**
|
|
10338
|
-
*
|
|
10860
|
+
* Schema for finite numbers, rejecting `NaN`, `Infinity`, and `-Infinity`.
|
|
10339
10861
|
*
|
|
10340
10862
|
* @category Number
|
|
10341
10863
|
* @since 3.10.0
|
|
@@ -10354,7 +10876,7 @@ export interface Int extends Number {
|
|
|
10354
10876
|
}
|
|
10355
10877
|
|
|
10356
10878
|
/**
|
|
10357
|
-
*
|
|
10879
|
+
* Schema for integers, rejecting `NaN`, `Infinity`, and `-Infinity`.
|
|
10358
10880
|
*
|
|
10359
10881
|
* @category Number
|
|
10360
10882
|
* @since 3.10.0
|
|
@@ -10373,7 +10895,7 @@ export interface NumberFromString extends decodeTo<Finite, String> {
|
|
|
10373
10895
|
}
|
|
10374
10896
|
|
|
10375
10897
|
/**
|
|
10376
|
-
*
|
|
10898
|
+
* Schema that parses a string into a `number` using JavaScript
|
|
10377
10899
|
* number coercion.
|
|
10378
10900
|
*
|
|
10379
10901
|
* **Details**
|
|
@@ -10405,7 +10927,7 @@ export interface FiniteFromString extends decodeTo<Finite, String> {
|
|
|
10405
10927
|
}
|
|
10406
10928
|
|
|
10407
10929
|
/**
|
|
10408
|
-
*
|
|
10930
|
+
* Schema that parses a string into a finite number.
|
|
10409
10931
|
*
|
|
10410
10932
|
* **Details**
|
|
10411
10933
|
*
|
|
@@ -10435,7 +10957,12 @@ export interface BigIntFromString extends decodeTo<BigInt, String> {
|
|
|
10435
10957
|
}
|
|
10436
10958
|
|
|
10437
10959
|
/**
|
|
10438
|
-
*
|
|
10960
|
+
* Schema that parses a string into a `bigint`.
|
|
10961
|
+
*
|
|
10962
|
+
* **When to use**
|
|
10963
|
+
*
|
|
10964
|
+
* Use to parse signed base-10 integer strings into bigint values while encoding
|
|
10965
|
+
* bigint values back to decimal strings.
|
|
10439
10966
|
*
|
|
10440
10967
|
* **Details**
|
|
10441
10968
|
*
|
|
@@ -10445,6 +10972,15 @@ export interface BigIntFromString extends decodeTo<BigInt, String> {
|
|
|
10445
10972
|
* Encoding:
|
|
10446
10973
|
* - A `bigint` is encoded as a `string`.
|
|
10447
10974
|
*
|
|
10975
|
+
* **Gotchas**
|
|
10976
|
+
*
|
|
10977
|
+
* Decoding accepts only strings matching `^-?\d+$`.
|
|
10978
|
+
*
|
|
10979
|
+
* @see {@link isStringBigInt} for the string predicate used by this schema
|
|
10980
|
+
* @see {@link BigInt} for validating values that are already bigint values
|
|
10981
|
+
* @see {@link NumberFromString} for parsing JavaScript number strings, including non-finite values
|
|
10982
|
+
* @see {@link BigDecimalFromString} for parsing decimal number strings
|
|
10983
|
+
*
|
|
10448
10984
|
* @category BigInt
|
|
10449
10985
|
* @since 4.0.0
|
|
10450
10986
|
*/
|
|
@@ -10464,7 +11000,7 @@ export interface Trimmed extends String {
|
|
|
10464
11000
|
}
|
|
10465
11001
|
|
|
10466
11002
|
/**
|
|
10467
|
-
*
|
|
11003
|
+
* Schema for strings that contains no leading or trailing whitespaces.
|
|
10468
11004
|
*
|
|
10469
11005
|
* @category String
|
|
10470
11006
|
* @since 3.10.0
|
|
@@ -10483,7 +11019,7 @@ export interface Trim extends decodeTo<Trimmed, String> {
|
|
|
10483
11019
|
}
|
|
10484
11020
|
|
|
10485
11021
|
/**
|
|
10486
|
-
*
|
|
11022
|
+
* Schema that trims whitespace from a string.
|
|
10487
11023
|
*
|
|
10488
11024
|
* **Details**
|
|
10489
11025
|
*
|
|
@@ -10644,7 +11180,7 @@ export const StringFromUriComponent: StringFromUriComponent = String.annotate({
|
|
|
10644
11180
|
)
|
|
10645
11181
|
|
|
10646
11182
|
/**
|
|
10647
|
-
*
|
|
11183
|
+
* Schema for property keys accepted by Effect schemas: finite `number`,
|
|
10648
11184
|
* `symbol`, or `string`.
|
|
10649
11185
|
*
|
|
10650
11186
|
* @category PropertyKey
|
|
@@ -10682,7 +11218,20 @@ export interface BooleanFromBit extends decodeTo<Boolean, Literals<readonly [0,
|
|
|
10682
11218
|
}
|
|
10683
11219
|
|
|
10684
11220
|
/**
|
|
10685
|
-
*
|
|
11221
|
+
* Schema for a boolean parsed from 0 or 1.
|
|
11222
|
+
*
|
|
11223
|
+
* **When to use**
|
|
11224
|
+
*
|
|
11225
|
+
* Use when decoding data sources that represent booleans as `0 | 1` while
|
|
11226
|
+
* keeping boolean values in the decoded model.
|
|
11227
|
+
*
|
|
11228
|
+
* **Details**
|
|
11229
|
+
*
|
|
11230
|
+
* Decoding accepts only `0 | 1`, maps `1` to `true`, and maps `0` to `false`.
|
|
11231
|
+
* Encoding maps `true` to `1` and `false` to `0`.
|
|
11232
|
+
*
|
|
11233
|
+
* @see {@link Boolean} for validating values that are already booleans
|
|
11234
|
+
* @see {@link Literals} for keeping bit literals instead of decoding them
|
|
10686
11235
|
*
|
|
10687
11236
|
* @category Boolean
|
|
10688
11237
|
* @since 4.0.0
|
|
@@ -10715,7 +11264,7 @@ const Base64String = String.annotate({
|
|
|
10715
11264
|
})
|
|
10716
11265
|
|
|
10717
11266
|
/**
|
|
10718
|
-
*
|
|
11267
|
+
* Schema for JavaScript `Uint8Array` objects.
|
|
10719
11268
|
*
|
|
10720
11269
|
* **Details**
|
|
10721
11270
|
*
|
|
@@ -10755,7 +11304,7 @@ export interface Uint8ArrayFromBase64 extends decodeTo<Uint8Array, String> {
|
|
|
10755
11304
|
}
|
|
10756
11305
|
|
|
10757
11306
|
/**
|
|
10758
|
-
*
|
|
11307
|
+
* Schema that decodes a base64 encoded string into a
|
|
10759
11308
|
* `Uint8Array`.
|
|
10760
11309
|
*
|
|
10761
11310
|
* **Details**
|
|
@@ -10785,7 +11334,7 @@ export interface Uint8ArrayFromBase64Url extends decodeTo<Uint8Array, String> {
|
|
|
10785
11334
|
}
|
|
10786
11335
|
|
|
10787
11336
|
/**
|
|
10788
|
-
*
|
|
11337
|
+
* Schema that decodes a base64 (URL) encoded string into a
|
|
10789
11338
|
* `Uint8Array`.
|
|
10790
11339
|
*
|
|
10791
11340
|
* **Details**
|
|
@@ -10820,7 +11369,7 @@ export interface Uint8ArrayFromHex extends decodeTo<Uint8Array, String> {
|
|
|
10820
11369
|
}
|
|
10821
11370
|
|
|
10822
11371
|
/**
|
|
10823
|
-
*
|
|
11372
|
+
* Schema that decodes a hex encoded string into a
|
|
10824
11373
|
* `Uint8Array`.
|
|
10825
11374
|
*
|
|
10826
11375
|
* **Details**
|
|
@@ -10855,13 +11404,22 @@ export interface DateTimeUtc extends declare<DateTime.Utc> {
|
|
|
10855
11404
|
}
|
|
10856
11405
|
|
|
10857
11406
|
/**
|
|
10858
|
-
*
|
|
11407
|
+
* Schema for `DateTime.Utc` values.
|
|
11408
|
+
*
|
|
11409
|
+
* **When to use**
|
|
11410
|
+
*
|
|
11411
|
+
* Use to validate existing `DateTime.Utc` schema values and use the default JSON
|
|
11412
|
+
* codec that represents them as UTC ISO strings.
|
|
10859
11413
|
*
|
|
10860
11414
|
* **Details**
|
|
10861
11415
|
*
|
|
10862
|
-
*
|
|
11416
|
+
* The default JSON codec decodes UTC ISO strings into `DateTime.Utc` values and
|
|
11417
|
+
* encodes `DateTime.Utc` values as UTC ISO strings.
|
|
10863
11418
|
*
|
|
10864
|
-
*
|
|
11419
|
+
* @see {@link DateTimeUtcFromString} for decoding date-time strings into UTC values
|
|
11420
|
+
* @see {@link DateTimeUtcFromDate} for decoding JavaScript Date values into UTC values
|
|
11421
|
+
* @see {@link DateTimeUtcFromMillis} for decoding epoch milliseconds into UTC values
|
|
11422
|
+
* @see {@link DateTimeZoned} for preserving zoned DateTime values
|
|
10865
11423
|
*
|
|
10866
11424
|
* @category DateTime
|
|
10867
11425
|
* @since 3.10.0
|
|
@@ -10902,7 +11460,12 @@ export interface DateTimeUtcFromDate extends decodeTo<DateTimeUtc, Date> {
|
|
|
10902
11460
|
}
|
|
10903
11461
|
|
|
10904
11462
|
/**
|
|
10905
|
-
*
|
|
11463
|
+
* Schema that decodes a `Date` into a `DateTime.Utc`.
|
|
11464
|
+
*
|
|
11465
|
+
* **When to use**
|
|
11466
|
+
*
|
|
11467
|
+
* Use when a boundary provides valid JavaScript `Date` objects but the decoded
|
|
11468
|
+
* model should use `DateTime.Utc`.
|
|
10906
11469
|
*
|
|
10907
11470
|
* **Details**
|
|
10908
11471
|
*
|
|
@@ -10912,6 +11475,11 @@ export interface DateTimeUtcFromDate extends decodeTo<DateTimeUtc, Date> {
|
|
|
10912
11475
|
* Encoding:
|
|
10913
11476
|
* - A `DateTime.Utc` is encoded as a `Date`
|
|
10914
11477
|
*
|
|
11478
|
+
* @see {@link DateTimeUtc} for validating values that are already `DateTime.Utc`
|
|
11479
|
+
* @see {@link DateTimeUtcFromString} for decoding date-time strings into UTC values
|
|
11480
|
+
* @see {@link DateTimeUtcFromMillis} for decoding epoch milliseconds into UTC values
|
|
11481
|
+
* @see {@link DateValid} for validating Date instances without converting them
|
|
11482
|
+
*
|
|
10915
11483
|
* @category DateTime
|
|
10916
11484
|
* @since 3.12.0
|
|
10917
11485
|
*/
|
|
@@ -10934,7 +11502,7 @@ export interface DateTimeUtcFromString extends decodeTo<DateTimeUtc, String> {
|
|
|
10934
11502
|
}
|
|
10935
11503
|
|
|
10936
11504
|
/**
|
|
10937
|
-
*
|
|
11505
|
+
* Schema that decodes a date-time string into a `DateTime.Utc`.
|
|
10938
11506
|
*
|
|
10939
11507
|
* **Details**
|
|
10940
11508
|
*
|
|
@@ -10971,7 +11539,7 @@ export interface DateTimeUtcFromMillis extends decodeTo<instanceOf<DateTime.Utc>
|
|
|
10971
11539
|
}
|
|
10972
11540
|
|
|
10973
11541
|
/**
|
|
10974
|
-
*
|
|
11542
|
+
* Schema that decodes a number into a `DateTime.Utc`.
|
|
10975
11543
|
*
|
|
10976
11544
|
* **Details**
|
|
10977
11545
|
*
|
|
@@ -11003,7 +11571,7 @@ export interface TimeZoneOffset extends declare<DateTime.TimeZone.Offset> {
|
|
|
11003
11571
|
}
|
|
11004
11572
|
|
|
11005
11573
|
/**
|
|
11006
|
-
*
|
|
11574
|
+
* Schema for `DateTime.TimeZone.Offset` values.
|
|
11007
11575
|
*
|
|
11008
11576
|
* **Details**
|
|
11009
11577
|
*
|
|
@@ -11052,7 +11620,7 @@ export interface TimeZoneNamed extends declare<DateTime.TimeZone.Named> {
|
|
|
11052
11620
|
const TimeZoneNamedString = String.annotate({ expected: "an IANA time zone identifier" })
|
|
11053
11621
|
|
|
11054
11622
|
/**
|
|
11055
|
-
*
|
|
11623
|
+
* Schema for `DateTime.TimeZone.Named` values.
|
|
11056
11624
|
*
|
|
11057
11625
|
* **Details**
|
|
11058
11626
|
*
|
|
@@ -11103,7 +11671,7 @@ export interface TimeZoneNamedFromString extends decodeTo<TimeZoneNamed, String>
|
|
|
11103
11671
|
}
|
|
11104
11672
|
|
|
11105
11673
|
/**
|
|
11106
|
-
*
|
|
11674
|
+
* Schema that parses an IANA time zone identifier string into a `DateTime.TimeZone.Named`.
|
|
11107
11675
|
*
|
|
11108
11676
|
* **Details**
|
|
11109
11677
|
*
|
|
@@ -11136,7 +11704,7 @@ const TimeZoneString = String.annotate({
|
|
|
11136
11704
|
})
|
|
11137
11705
|
|
|
11138
11706
|
/**
|
|
11139
|
-
*
|
|
11707
|
+
* Schema for `DateTime.TimeZone` values.
|
|
11140
11708
|
*
|
|
11141
11709
|
* **Details**
|
|
11142
11710
|
*
|
|
@@ -11191,7 +11759,7 @@ export interface TimeZoneFromString extends decodeTo<TimeZone, String> {
|
|
|
11191
11759
|
}
|
|
11192
11760
|
|
|
11193
11761
|
/**
|
|
11194
|
-
*
|
|
11762
|
+
* Schema that parses a time zone string into a `DateTime.TimeZone`.
|
|
11195
11763
|
*
|
|
11196
11764
|
* **Details**
|
|
11197
11765
|
*
|
|
@@ -11224,7 +11792,7 @@ const DateTimeZonedString = String.annotate({
|
|
|
11224
11792
|
})
|
|
11225
11793
|
|
|
11226
11794
|
/**
|
|
11227
|
-
*
|
|
11795
|
+
* Schema for `DateTime.Zoned` values.
|
|
11228
11796
|
*
|
|
11229
11797
|
* **Details**
|
|
11230
11798
|
*
|
|
@@ -11282,7 +11850,7 @@ export interface DateTimeZonedFromString extends decodeTo<DateTimeZoned, String>
|
|
|
11282
11850
|
}
|
|
11283
11851
|
|
|
11284
11852
|
/**
|
|
11285
|
-
*
|
|
11853
|
+
* Schema that parses a zoned DateTime string into a `DateTime.Zoned`.
|
|
11286
11854
|
*
|
|
11287
11855
|
* **Details**
|
|
11288
11856
|
*
|
|
@@ -11535,13 +12103,23 @@ type MissingSelfGeneric<Usage extends string> =
|
|
|
11535
12103
|
/**
|
|
11536
12104
|
* Creates a schema-backed class whose constructor validates input against a
|
|
11537
12105
|
* {@link Struct} schema. Construction throws a {@link SchemaError} on invalid
|
|
11538
|
-
* input
|
|
12106
|
+
* input.
|
|
12107
|
+
*
|
|
12108
|
+
* **When to use**
|
|
12109
|
+
*
|
|
12110
|
+
* Use to define a schema-backed data class when you want validated
|
|
12111
|
+
* construction, schema-derived decoding/encoding, and class-style methods or
|
|
12112
|
+
* inheritance.
|
|
11539
12113
|
*
|
|
11540
12114
|
* **Details**
|
|
11541
12115
|
*
|
|
11542
12116
|
* Pass the desired class type as the first type parameter. The second optional
|
|
11543
12117
|
* type parameter can be used to add nominal brands.
|
|
11544
12118
|
*
|
|
12119
|
+
* **Gotchas**
|
|
12120
|
+
*
|
|
12121
|
+
* Passing `disableChecks` in the options skips constructor validation.
|
|
12122
|
+
*
|
|
11545
12123
|
* **Example** (Basic class)
|
|
11546
12124
|
*
|
|
11547
12125
|
* ```ts
|
|
@@ -11575,6 +12153,10 @@ type MissingSelfGeneric<Usage extends string> =
|
|
|
11575
12153
|
* console.log(dog.breed) // "Labrador"
|
|
11576
12154
|
* ```
|
|
11577
12155
|
*
|
|
12156
|
+
* @see {@link TaggedClass} for adding a `_tag` literal field to the class schema
|
|
12157
|
+
* @see {@link ErrorClass} for defining schema-backed error classes
|
|
12158
|
+
* @see {@link TaggedErrorClass} for defining tagged schema-backed error classes
|
|
12159
|
+
*
|
|
11578
12160
|
* @category constructors
|
|
11579
12161
|
* @since 3.10.0
|
|
11580
12162
|
*/
|
|
@@ -11582,13 +12164,23 @@ export const Class: {
|
|
|
11582
12164
|
/**
|
|
11583
12165
|
* Creates a schema-backed class whose constructor validates input against a
|
|
11584
12166
|
* {@link Struct} schema. Construction throws a {@link SchemaError} on invalid
|
|
11585
|
-
* input
|
|
12167
|
+
* input.
|
|
12168
|
+
*
|
|
12169
|
+
* **When to use**
|
|
12170
|
+
*
|
|
12171
|
+
* Use to define a schema-backed data class when you want validated
|
|
12172
|
+
* construction, schema-derived decoding/encoding, and class-style methods or
|
|
12173
|
+
* inheritance.
|
|
11586
12174
|
*
|
|
11587
12175
|
* **Details**
|
|
11588
12176
|
*
|
|
11589
12177
|
* Pass the desired class type as the first type parameter. The second optional
|
|
11590
12178
|
* type parameter can be used to add nominal brands.
|
|
11591
12179
|
*
|
|
12180
|
+
* **Gotchas**
|
|
12181
|
+
*
|
|
12182
|
+
* Passing `disableChecks` in the options skips constructor validation.
|
|
12183
|
+
*
|
|
11592
12184
|
* **Example** (Basic class)
|
|
11593
12185
|
*
|
|
11594
12186
|
* ```ts
|
|
@@ -11622,6 +12214,10 @@ export const Class: {
|
|
|
11622
12214
|
* console.log(dog.breed) // "Labrador"
|
|
11623
12215
|
* ```
|
|
11624
12216
|
*
|
|
12217
|
+
* @see {@link TaggedClass} for adding a `_tag` literal field to the class schema
|
|
12218
|
+
* @see {@link ErrorClass} for defining schema-backed error classes
|
|
12219
|
+
* @see {@link TaggedErrorClass} for defining tagged schema-backed error classes
|
|
12220
|
+
*
|
|
11625
12221
|
* @category constructors
|
|
11626
12222
|
* @since 3.10.0
|
|
11627
12223
|
*/
|
|
@@ -11629,13 +12225,23 @@ export const Class: {
|
|
|
11629
12225
|
/**
|
|
11630
12226
|
* Creates a schema-backed class whose constructor validates input against a
|
|
11631
12227
|
* {@link Struct} schema. Construction throws a {@link SchemaError} on invalid
|
|
11632
|
-
* input
|
|
12228
|
+
* input.
|
|
12229
|
+
*
|
|
12230
|
+
* **When to use**
|
|
12231
|
+
*
|
|
12232
|
+
* Use to define a schema-backed data class when you want validated
|
|
12233
|
+
* construction, schema-derived decoding/encoding, and class-style methods or
|
|
12234
|
+
* inheritance.
|
|
11633
12235
|
*
|
|
11634
12236
|
* **Details**
|
|
11635
12237
|
*
|
|
11636
12238
|
* Pass the desired class type as the first type parameter. The second optional
|
|
11637
12239
|
* type parameter can be used to add nominal brands.
|
|
11638
12240
|
*
|
|
12241
|
+
* **Gotchas**
|
|
12242
|
+
*
|
|
12243
|
+
* Passing `disableChecks` in the options skips constructor validation.
|
|
12244
|
+
*
|
|
11639
12245
|
* **Example** (Basic class)
|
|
11640
12246
|
*
|
|
11641
12247
|
* ```ts
|
|
@@ -11669,6 +12275,10 @@ export const Class: {
|
|
|
11669
12275
|
* console.log(dog.breed) // "Labrador"
|
|
11670
12276
|
* ```
|
|
11671
12277
|
*
|
|
12278
|
+
* @see {@link TaggedClass} for adding a `_tag` literal field to the class schema
|
|
12279
|
+
* @see {@link ErrorClass} for defining schema-backed error classes
|
|
12280
|
+
* @see {@link TaggedErrorClass} for defining tagged schema-backed error classes
|
|
12281
|
+
*
|
|
11672
12282
|
* @category constructors
|
|
11673
12283
|
* @since 3.10.0
|
|
11674
12284
|
*/
|
|
@@ -11679,13 +12289,23 @@ export const Class: {
|
|
|
11679
12289
|
/**
|
|
11680
12290
|
* Creates a schema-backed class whose constructor validates input against a
|
|
11681
12291
|
* {@link Struct} schema. Construction throws a {@link SchemaError} on invalid
|
|
11682
|
-
* input
|
|
12292
|
+
* input.
|
|
12293
|
+
*
|
|
12294
|
+
* **When to use**
|
|
12295
|
+
*
|
|
12296
|
+
* Use to define a schema-backed data class when you want validated
|
|
12297
|
+
* construction, schema-derived decoding/encoding, and class-style methods or
|
|
12298
|
+
* inheritance.
|
|
11683
12299
|
*
|
|
11684
12300
|
* **Details**
|
|
11685
12301
|
*
|
|
11686
12302
|
* Pass the desired class type as the first type parameter. The second optional
|
|
11687
12303
|
* type parameter can be used to add nominal brands.
|
|
11688
12304
|
*
|
|
12305
|
+
* **Gotchas**
|
|
12306
|
+
*
|
|
12307
|
+
* Passing `disableChecks` in the options skips constructor validation.
|
|
12308
|
+
*
|
|
11689
12309
|
* **Example** (Basic class)
|
|
11690
12310
|
*
|
|
11691
12311
|
* ```ts
|
|
@@ -11719,6 +12339,10 @@ export const Class: {
|
|
|
11719
12339
|
* console.log(dog.breed) // "Labrador"
|
|
11720
12340
|
* ```
|
|
11721
12341
|
*
|
|
12342
|
+
* @see {@link TaggedClass} for adding a `_tag` literal field to the class schema
|
|
12343
|
+
* @see {@link ErrorClass} for defining schema-backed error classes
|
|
12344
|
+
* @see {@link TaggedErrorClass} for defining tagged schema-backed error classes
|
|
12345
|
+
*
|
|
11722
12346
|
* @category constructors
|
|
11723
12347
|
* @since 3.10.0
|
|
11724
12348
|
*/
|
|
@@ -11744,9 +12368,12 @@ export const Class: {
|
|
|
11744
12368
|
}
|
|
11745
12369
|
|
|
11746
12370
|
/**
|
|
11747
|
-
*
|
|
11748
|
-
*
|
|
11749
|
-
*
|
|
12371
|
+
* Defines a schema-backed class with an automatically populated `_tag` field.
|
|
12372
|
+
*
|
|
12373
|
+
* **When to use**
|
|
12374
|
+
*
|
|
12375
|
+
* Use to define class instances that are validated by a schema and participate
|
|
12376
|
+
* in tagged union matching.
|
|
11750
12377
|
*
|
|
11751
12378
|
* **Details**
|
|
11752
12379
|
*
|
|
@@ -11772,9 +12399,12 @@ export const Class: {
|
|
|
11772
12399
|
*/
|
|
11773
12400
|
export const TaggedClass: {
|
|
11774
12401
|
/**
|
|
11775
|
-
*
|
|
11776
|
-
*
|
|
11777
|
-
*
|
|
12402
|
+
* Defines a schema-backed class with an automatically populated `_tag` field.
|
|
12403
|
+
*
|
|
12404
|
+
* **When to use**
|
|
12405
|
+
*
|
|
12406
|
+
* Use to define class instances that are validated by a schema and participate
|
|
12407
|
+
* in tagged union matching.
|
|
11778
12408
|
*
|
|
11779
12409
|
* **Details**
|
|
11780
12410
|
*
|
|
@@ -11800,9 +12430,12 @@ export const TaggedClass: {
|
|
|
11800
12430
|
*/
|
|
11801
12431
|
<Self = never, Brand = {}>(identifier?: string): {
|
|
11802
12432
|
/**
|
|
11803
|
-
*
|
|
11804
|
-
*
|
|
11805
|
-
*
|
|
12433
|
+
* Defines a schema-backed class with an automatically populated `_tag` field.
|
|
12434
|
+
*
|
|
12435
|
+
* **When to use**
|
|
12436
|
+
*
|
|
12437
|
+
* Use to define class instances that are validated by a schema and participate
|
|
12438
|
+
* in tagged union matching.
|
|
11806
12439
|
*
|
|
11807
12440
|
* **Details**
|
|
11808
12441
|
*
|
|
@@ -11832,9 +12465,12 @@ export const TaggedClass: {
|
|
|
11832
12465
|
annotations?: Annotations.Declaration<Self, readonly [TaggedStruct<Tag, Fields>]>
|
|
11833
12466
|
): [Self] extends [never] ? MissingSelfGeneric<"Schema.TaggedClass"> : Class<Self, TaggedStruct<Tag, Fields>, Brand>
|
|
11834
12467
|
/**
|
|
11835
|
-
*
|
|
11836
|
-
*
|
|
11837
|
-
*
|
|
12468
|
+
* Defines a schema-backed class with an automatically populated `_tag` field.
|
|
12469
|
+
*
|
|
12470
|
+
* **When to use**
|
|
12471
|
+
*
|
|
12472
|
+
* Use to define class instances that are validated by a schema and participate
|
|
12473
|
+
* in tagged union matching.
|
|
11838
12474
|
*
|
|
11839
12475
|
* **Details**
|
|
11840
12476
|
*
|
|
@@ -12008,9 +12644,13 @@ export const ErrorClass: {
|
|
|
12008
12644
|
}
|
|
12009
12645
|
|
|
12010
12646
|
/**
|
|
12011
|
-
*
|
|
12012
|
-
*
|
|
12013
|
-
*
|
|
12647
|
+
* Defines a schema-backed yieldable error class with an automatically populated
|
|
12648
|
+
* `_tag` field.
|
|
12649
|
+
*
|
|
12650
|
+
* **When to use**
|
|
12651
|
+
*
|
|
12652
|
+
* Use to define typed errors that are schema validated, yielded in `Effect.gen`,
|
|
12653
|
+
* and matched as tagged union members.
|
|
12014
12654
|
*
|
|
12015
12655
|
* **Example** (Tagged error class)
|
|
12016
12656
|
*
|
|
@@ -12031,9 +12671,13 @@ export const ErrorClass: {
|
|
|
12031
12671
|
*/
|
|
12032
12672
|
export const TaggedErrorClass: {
|
|
12033
12673
|
/**
|
|
12034
|
-
*
|
|
12035
|
-
*
|
|
12036
|
-
*
|
|
12674
|
+
* Defines a schema-backed yieldable error class with an automatically populated
|
|
12675
|
+
* `_tag` field.
|
|
12676
|
+
*
|
|
12677
|
+
* **When to use**
|
|
12678
|
+
*
|
|
12679
|
+
* Use to define typed errors that are schema validated, yielded in `Effect.gen`,
|
|
12680
|
+
* and matched as tagged union members.
|
|
12037
12681
|
*
|
|
12038
12682
|
* **Example** (Tagged error class)
|
|
12039
12683
|
*
|
|
@@ -12054,9 +12698,13 @@ export const TaggedErrorClass: {
|
|
|
12054
12698
|
*/
|
|
12055
12699
|
<Self = never, Brand = {}>(identifier?: string): {
|
|
12056
12700
|
/**
|
|
12057
|
-
*
|
|
12058
|
-
*
|
|
12059
|
-
*
|
|
12701
|
+
* Defines a schema-backed yieldable error class with an automatically populated
|
|
12702
|
+
* `_tag` field.
|
|
12703
|
+
*
|
|
12704
|
+
* **When to use**
|
|
12705
|
+
*
|
|
12706
|
+
* Use to define typed errors that are schema validated, yielded in `Effect.gen`,
|
|
12707
|
+
* and matched as tagged union members.
|
|
12060
12708
|
*
|
|
12061
12709
|
* **Example** (Tagged error class)
|
|
12062
12710
|
*
|
|
@@ -12082,9 +12730,13 @@ export const TaggedErrorClass: {
|
|
|
12082
12730
|
): [Self] extends [never] ? MissingSelfGeneric<"Schema.TaggedErrorClass">
|
|
12083
12731
|
: Class<Self, TaggedStruct<Tag, Fields>, Cause_.YieldableError & Brand>
|
|
12084
12732
|
/**
|
|
12085
|
-
*
|
|
12086
|
-
*
|
|
12087
|
-
*
|
|
12733
|
+
* Defines a schema-backed yieldable error class with an automatically populated
|
|
12734
|
+
* `_tag` field.
|
|
12735
|
+
*
|
|
12736
|
+
* **When to use**
|
|
12737
|
+
*
|
|
12738
|
+
* Use to define typed errors that are schema validated, yielded in `Effect.gen`,
|
|
12739
|
+
* and matched as tagged union members.
|
|
12088
12740
|
*
|
|
12089
12741
|
* **Example** (Tagged error class)
|
|
12090
12742
|
*
|
|
@@ -12192,7 +12844,7 @@ export function toArbitrary<S extends Top>(schema: S): FastCheck.Arbitrary<S["Ty
|
|
|
12192
12844
|
// -----------------------------------------------------------------------------
|
|
12193
12845
|
|
|
12194
12846
|
/**
|
|
12195
|
-
*
|
|
12847
|
+
* Attaches a custom formatter used by `toFormatter`.
|
|
12196
12848
|
*
|
|
12197
12849
|
* **Details**
|
|
12198
12850
|
*
|
|
@@ -12364,8 +13016,12 @@ export function toFormatter<T>(schema: Schema<T>, options?: {
|
|
|
12364
13016
|
|
|
12365
13017
|
/**
|
|
12366
13018
|
* Overrides the equivalence derivation for a schema by supplying a custom
|
|
12367
|
-
* `Equivalence`.
|
|
12368
|
-
*
|
|
13019
|
+
* `Equivalence`.
|
|
13020
|
+
*
|
|
13021
|
+
* **When to use**
|
|
13022
|
+
*
|
|
13023
|
+
* Use when the default structural equivalence derived by {@link toEquivalence}
|
|
13024
|
+
* is not appropriate for a type.
|
|
12369
13025
|
*
|
|
12370
13026
|
* @category Equivalence
|
|
12371
13027
|
* @since 4.0.0
|
|
@@ -12420,7 +13076,7 @@ export function toRepresentation(schema: Top): SchemaRepresentation.Document {
|
|
|
12420
13076
|
/**
|
|
12421
13077
|
* Options for {@link toJsonSchemaDocument}.
|
|
12422
13078
|
*
|
|
12423
|
-
* @category
|
|
13079
|
+
* @category JsonSchema
|
|
12424
13080
|
* @since 4.0.0
|
|
12425
13081
|
*/
|
|
12426
13082
|
export interface ToJsonSchemaOptions {
|
|
@@ -12441,6 +13097,54 @@ export interface ToJsonSchemaOptions {
|
|
|
12441
13097
|
* provided them) based on the `expected` annotation of the check.
|
|
12442
13098
|
*/
|
|
12443
13099
|
readonly generateDescriptions?: boolean | undefined
|
|
13100
|
+
/**
|
|
13101
|
+
* A predicate that controls which additional annotation keys (beyond the
|
|
13102
|
+
* standard JSON Schema keys) are included in the generated output.
|
|
13103
|
+
*
|
|
13104
|
+
* **When to use**
|
|
13105
|
+
*
|
|
13106
|
+
* Use when you need to include non-standard annotation keys in the generated
|
|
13107
|
+
* JSON Schema, such as Monaco Editor properties (`markdownDescription`,
|
|
13108
|
+
* `defaultSnippets`) or vendor extensions (`x-*`).
|
|
13109
|
+
*
|
|
13110
|
+
* **Details**
|
|
13111
|
+
*
|
|
13112
|
+
* Standard JSON Schema keys (`title`, `description`, `default`, `examples`,
|
|
13113
|
+
* `readOnly`, `writeOnly`, `format`, `contentEncoding`, `contentMediaType`,
|
|
13114
|
+
* `contentSchema`) are always included. This predicate is checked for any
|
|
13115
|
+
* *other* annotation key.
|
|
13116
|
+
*
|
|
13117
|
+
* **Gotchas**
|
|
13118
|
+
*
|
|
13119
|
+
* Prefer whitelisting the custom annotation keys you want to emit instead of
|
|
13120
|
+
* using a broad predicate such as `() => true`, because broad predicates can
|
|
13121
|
+
* include Effect-specific annotations that are preserved for internal schema
|
|
13122
|
+
* generation.
|
|
13123
|
+
*
|
|
13124
|
+
* **Example** (Including custom annotations)
|
|
13125
|
+
*
|
|
13126
|
+
* ```ts
|
|
13127
|
+
* import { Schema } from "effect"
|
|
13128
|
+
*
|
|
13129
|
+
* const schema = Schema.String.annotate({
|
|
13130
|
+
* description: "A name",
|
|
13131
|
+
* markdownDescription: "The **name** field"
|
|
13132
|
+
* })
|
|
13133
|
+
*
|
|
13134
|
+
* const doc = Schema.toJsonSchemaDocument(schema, {
|
|
13135
|
+
* includeAnnotationKey: (key) =>
|
|
13136
|
+
* key === "markdownDescription" || key.startsWith("x-")
|
|
13137
|
+
* })
|
|
13138
|
+
*
|
|
13139
|
+
* console.log(doc.schema)
|
|
13140
|
+
* // {
|
|
13141
|
+
* // type: "string",
|
|
13142
|
+
* // description: "A name",
|
|
13143
|
+
* // markdownDescription: "The **name** field"
|
|
13144
|
+
* // }
|
|
13145
|
+
* ```
|
|
13146
|
+
*/
|
|
13147
|
+
readonly includeAnnotationKey?: ((key: string) => boolean) | undefined
|
|
12444
13148
|
}
|
|
12445
13149
|
|
|
12446
13150
|
/**
|
|
@@ -12585,8 +13289,8 @@ function toCodecIsoBase(ast: AST.AST, recur: (ast: AST.AST) => AST.AST): AST.AST
|
|
|
12585
13289
|
export type StringTree = Tree<string | undefined>
|
|
12586
13290
|
|
|
12587
13291
|
/**
|
|
12588
|
-
*
|
|
12589
|
-
* preserving the original structure.
|
|
13292
|
+
* Converts a schema to the StringTree canonical codec, where every leaf value
|
|
13293
|
+
* becomes a string while preserving the original structure.
|
|
12590
13294
|
*
|
|
12591
13295
|
* **Details**
|
|
12592
13296
|
*
|
|
@@ -12965,12 +13669,19 @@ export interface overrideToCodecIso<S extends Top, Iso> extends
|
|
|
12965
13669
|
}
|
|
12966
13670
|
|
|
12967
13671
|
/**
|
|
12968
|
-
* Overrides
|
|
12969
|
-
*
|
|
12970
|
-
*
|
|
12971
|
-
*
|
|
13672
|
+
* Overrides a schema's derived ISO codec with an explicit target codec.
|
|
13673
|
+
*
|
|
13674
|
+
* **When to use**
|
|
13675
|
+
*
|
|
13676
|
+
* Use to provide a custom ISO transformation when the default derivation is not
|
|
12972
13677
|
* appropriate.
|
|
12973
13678
|
*
|
|
13679
|
+
* **Details**
|
|
13680
|
+
*
|
|
13681
|
+
* The resulting schema carries a custom `Iso` type parameter and uses the
|
|
13682
|
+
* provided `decode` and `encode` getters to transform between the schema type
|
|
13683
|
+
* and the target codec.
|
|
13684
|
+
*
|
|
12974
13685
|
* @category Optic
|
|
12975
13686
|
* @since 4.0.0
|
|
12976
13687
|
*/
|