effect 4.0.0-beta.93 → 4.0.0-beta.97
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.map +1 -1
- package/dist/BigDecimal.d.ts.map +1 -1
- package/dist/BigDecimal.js.map +1 -1
- package/dist/BigInt.d.ts.map +1 -1
- package/dist/Boolean.d.ts.map +1 -1
- package/dist/Brand.d.ts.map +1 -1
- package/dist/Cache.d.ts.map +1 -1
- package/dist/Cause.d.ts.map +1 -1
- package/dist/Channel.d.ts.map +1 -1
- package/dist/ChannelSchema.d.ts.map +1 -1
- package/dist/Chunk.d.ts.map +1 -1
- package/dist/Combiner.d.ts.map +1 -1
- package/dist/Config.d.ts +1 -1
- package/dist/Config.d.ts.map +1 -1
- package/dist/Config.js.map +1 -1
- package/dist/ConfigProvider.d.ts +44 -6
- package/dist/ConfigProvider.d.ts.map +1 -1
- package/dist/ConfigProvider.js +63 -24
- package/dist/ConfigProvider.js.map +1 -1
- package/dist/Console.d.ts.map +1 -1
- package/dist/Context.d.ts.map +1 -1
- package/dist/Cron.d.ts +4 -1
- package/dist/Cron.d.ts.map +1 -1
- package/dist/Cron.js +98 -53
- package/dist/Cron.js.map +1 -1
- package/dist/Crypto.d.ts.map +1 -1
- package/dist/Data.d.ts.map +1 -1
- package/dist/DateTime.d.ts +12 -12
- package/dist/DateTime.d.ts.map +1 -1
- package/dist/Deferred.d.ts.map +1 -1
- package/dist/Duration.d.ts.map +1 -1
- package/dist/Effect.d.ts +130 -0
- package/dist/Effect.d.ts.map +1 -1
- package/dist/Effect.js +43 -0
- package/dist/Effect.js.map +1 -1
- package/dist/Effectable.d.ts.map +1 -1
- package/dist/Encoding.d.ts.map +1 -1
- package/dist/Equal.d.ts.map +1 -1
- package/dist/Equivalence.d.ts.map +1 -1
- package/dist/ErrorReporter.d.ts.map +1 -1
- package/dist/ExecutionPlan.d.ts +2 -2
- package/dist/ExecutionPlan.d.ts.map +1 -1
- package/dist/Fiber.d.ts.map +1 -1
- package/dist/FiberHandle.d.ts +8 -8
- package/dist/FiberHandle.d.ts.map +1 -1
- package/dist/FiberMap.d.ts +8 -8
- package/dist/FiberMap.d.ts.map +1 -1
- package/dist/FiberSet.d.ts +4 -4
- package/dist/FiberSet.d.ts.map +1 -1
- package/dist/FileSystem.d.ts +7 -0
- package/dist/FileSystem.d.ts.map +1 -1
- package/dist/FileSystem.js +3 -0
- package/dist/FileSystem.js.map +1 -1
- package/dist/Filter.d.ts.map +1 -1
- package/dist/Function.d.ts.map +1 -1
- package/dist/Graph.d.ts.map +1 -1
- package/dist/Graph.js.map +1 -1
- package/dist/Hash.d.ts.map +1 -1
- package/dist/HashMap.d.ts.map +1 -1
- package/dist/HashRing.d.ts.map +1 -1
- package/dist/Inspectable.d.ts.map +1 -1
- package/dist/Inspectable.js.map +1 -1
- package/dist/Iterable.d.ts.map +1 -1
- package/dist/Latch.d.ts.map +1 -1
- package/dist/Layer.d.ts +1 -1
- package/dist/Layer.d.ts.map +1 -1
- package/dist/Layer.js +6 -3
- package/dist/Layer.js.map +1 -1
- package/dist/LayerMap.d.ts.map +1 -1
- package/dist/LayerMap.js +1 -1
- package/dist/LayerMap.js.map +1 -1
- package/dist/LayerRef.d.ts +252 -0
- package/dist/LayerRef.d.ts.map +1 -0
- package/dist/LayerRef.js +171 -0
- package/dist/LayerRef.js.map +1 -0
- package/dist/LogLevel.d.ts.map +1 -1
- package/dist/Logger.d.ts.map +1 -1
- package/dist/ManagedRuntime.d.ts.map +1 -1
- package/dist/Metric.d.ts.map +1 -1
- package/dist/MutableHashMap.d.ts.map +1 -1
- package/dist/MutableHashSet.d.ts.map +1 -1
- package/dist/MutableList.d.ts.map +1 -1
- package/dist/MutableRef.d.ts.map +1 -1
- package/dist/NonEmptyIterable.d.ts.map +1 -1
- package/dist/Number.d.ts.map +1 -1
- package/dist/Optic.d.ts.map +1 -1
- package/dist/Option.d.ts.map +1 -1
- package/dist/Order.d.ts.map +1 -1
- package/dist/Ordering.d.ts.map +1 -1
- package/dist/PartitionedSemaphore.d.ts.map +1 -1
- package/dist/Pipeable.d.ts.map +1 -1
- package/dist/PlatformError.d.ts.map +1 -1
- package/dist/Pool.d.ts.map +1 -1
- package/dist/PrimaryKey.d.ts.map +1 -1
- package/dist/PubSub.d.ts.map +1 -1
- package/dist/Pull.d.ts.map +1 -1
- package/dist/Queue.d.ts.map +1 -1
- package/dist/Random.d.ts.map +1 -1
- package/dist/RcMap.d.ts.map +1 -1
- package/dist/Record.d.ts.map +1 -1
- package/dist/Redactable.d.ts.map +1 -1
- package/dist/Redacted.d.ts.map +1 -1
- package/dist/Ref.d.ts.map +1 -1
- package/dist/RegExp.d.ts.map +1 -1
- package/dist/Request.d.ts +1 -1
- package/dist/Request.d.ts.map +1 -1
- package/dist/RequestResolver.d.ts.map +1 -1
- package/dist/Resource.d.ts.map +1 -1
- package/dist/Result.d.ts.map +1 -1
- package/dist/Runtime.d.ts.map +1 -1
- package/dist/Schedule.d.ts +1206 -4013
- package/dist/Schedule.d.ts.map +1 -1
- package/dist/Schedule.js +244 -1348
- package/dist/Schedule.js.map +1 -1
- package/dist/Scheduler.d.ts.map +1 -1
- package/dist/Scheduler.js.map +1 -1
- package/dist/Schema.d.ts +123 -30
- package/dist/Schema.d.ts.map +1 -1
- package/dist/Schema.js +40 -0
- package/dist/Schema.js.map +1 -1
- package/dist/SchemaAST.d.ts.map +1 -1
- package/dist/SchemaAST.js.map +1 -1
- package/dist/SchemaGetter.d.ts.map +1 -1
- package/dist/SchemaIssue.d.ts.map +1 -1
- package/dist/SchemaIssue.js.map +1 -1
- package/dist/SchemaParser.d.ts +1 -1
- package/dist/SchemaParser.d.ts.map +1 -1
- package/dist/SchemaParser.js.map +1 -1
- package/dist/SchemaRepresentation.d.ts +106 -106
- package/dist/SchemaTransformation.d.ts +38 -2
- package/dist/SchemaTransformation.d.ts.map +1 -1
- package/dist/SchemaTransformation.js +38 -2
- package/dist/SchemaTransformation.js.map +1 -1
- package/dist/ScopedCache.d.ts.map +1 -1
- package/dist/ScopedRef.d.ts.map +1 -1
- package/dist/Semaphore.d.ts.map +1 -1
- package/dist/Sink.d.ts.map +1 -1
- package/dist/Stdio.d.ts.map +1 -1
- package/dist/Stream.d.ts +2 -2
- package/dist/Stream.d.ts.map +1 -1
- package/dist/Stream.js +1 -1
- package/dist/String.d.ts.map +1 -1
- package/dist/String.js.map +1 -1
- package/dist/Struct.d.ts.map +1 -1
- package/dist/SubscriptionRef.d.ts.map +1 -1
- package/dist/SynchronizedRef.d.ts.map +1 -1
- package/dist/Take.d.ts.map +1 -1
- package/dist/Terminal.d.ts.map +1 -1
- package/dist/Tracer.d.ts.map +1 -1
- package/dist/Trie.d.ts.map +1 -1
- package/dist/Tuple.d.ts.map +1 -1
- package/dist/TxChunk.d.ts.map +1 -1
- package/dist/TxDeferred.d.ts.map +1 -1
- package/dist/TxHashMap.d.ts.map +1 -1
- package/dist/TxHashSet.d.ts.map +1 -1
- package/dist/TxPriorityQueue.d.ts.map +1 -1
- package/dist/TxPubSub.d.ts.map +1 -1
- package/dist/TxQueue.d.ts.map +1 -1
- package/dist/TxReentrantLock.d.ts.map +1 -1
- package/dist/TxRef.d.ts.map +1 -1
- package/dist/TxSemaphore.d.ts.map +1 -1
- package/dist/TxSubscriptionRef.d.ts.map +1 -1
- package/dist/Types.d.ts +1 -1
- package/dist/Types.d.ts.map +1 -1
- package/dist/UndefinedOr.d.ts.map +1 -1
- package/dist/Utils.d.ts.map +1 -1
- package/dist/internal/effect.js +2 -0
- package/dist/internal/effect.js.map +1 -1
- package/dist/internal/schema/schema.d.ts.map +1 -1
- package/dist/testing/TestClock.d.ts.map +1 -1
- package/dist/testing/TestConsole.d.ts.map +1 -1
- package/dist/testing/TestSchema.d.ts +2 -2
- package/dist/testing/TestSchema.d.ts.map +1 -1
- package/dist/testing/TestSchema.js.map +1 -1
- package/dist/unstable/ai/AiError.d.ts +1 -1
- package/dist/unstable/ai/AiError.d.ts.map +1 -1
- package/dist/unstable/ai/Chat.d.ts +2 -2
- package/dist/unstable/ai/Chat.d.ts.map +1 -1
- package/dist/unstable/ai/IdGenerator.d.ts.map +1 -1
- package/dist/unstable/ai/LanguageModel.d.ts +2 -2
- package/dist/unstable/ai/LanguageModel.d.ts.map +1 -1
- package/dist/unstable/ai/McpSchema.d.ts +221 -221
- package/dist/unstable/ai/McpSchema.d.ts.map +1 -1
- package/dist/unstable/ai/McpServer.d.ts.map +1 -1
- package/dist/unstable/ai/Model.d.ts.map +1 -1
- package/dist/unstable/ai/Prompt.d.ts.map +1 -1
- package/dist/unstable/ai/Response.d.ts.map +1 -1
- package/dist/unstable/ai/Telemetry.d.ts.map +1 -1
- package/dist/unstable/ai/Tokenizer.d.ts.map +1 -1
- package/dist/unstable/ai/Tool.d.ts.map +1 -1
- package/dist/unstable/ai/Toolkit.d.ts.map +1 -1
- package/dist/unstable/cli/Argument.d.ts +2 -2
- package/dist/unstable/cli/Argument.d.ts.map +1 -1
- package/dist/unstable/cli/Argument.js.map +1 -1
- package/dist/unstable/cli/CliError.d.ts.map +1 -1
- package/dist/unstable/cli/CliOutput.d.ts.map +1 -1
- package/dist/unstable/cli/Command.d.ts.map +1 -1
- package/dist/unstable/cli/Completions.d.ts.map +1 -1
- package/dist/unstable/cli/Flag.d.ts +2 -2
- package/dist/unstable/cli/Flag.d.ts.map +1 -1
- package/dist/unstable/cli/Flag.js.map +1 -1
- package/dist/unstable/cli/GlobalFlag.d.ts.map +1 -1
- package/dist/unstable/cli/Param.d.ts +2 -2
- package/dist/unstable/cli/Param.d.ts.map +1 -1
- package/dist/unstable/cli/Param.js.map +1 -1
- package/dist/unstable/cli/Primitive.d.ts.map +1 -1
- package/dist/unstable/cli/Primitive.js.map +1 -1
- package/dist/unstable/cli/Prompt.d.ts.map +1 -1
- package/dist/unstable/cli/Prompt.js.map +1 -1
- package/dist/unstable/cli/internal/ansi.d.ts.map +1 -1
- package/dist/unstable/cli/internal/ansi.js.map +1 -1
- package/dist/unstable/cli/internal/command.d.ts.map +1 -1
- package/dist/unstable/cli/internal/help.d.ts.map +1 -1
- package/dist/unstable/cli/internal/parser.js.map +1 -1
- package/dist/unstable/cluster/ClusterCron.d.ts.map +1 -1
- package/dist/unstable/cluster/ClusterCron.js +1 -1
- package/dist/unstable/cluster/ClusterCron.js.map +1 -1
- package/dist/unstable/cluster/ClusterError.d.ts.map +1 -1
- package/dist/unstable/cluster/ClusterSchema.d.ts +1 -1
- package/dist/unstable/cluster/ClusterSchema.d.ts.map +1 -1
- package/dist/unstable/cluster/ClusterWorkflowEngine.d.ts +1 -1
- package/dist/unstable/cluster/ClusterWorkflowEngine.d.ts.map +1 -1
- package/dist/unstable/cluster/ClusterWorkflowEngine.js +2 -1
- package/dist/unstable/cluster/ClusterWorkflowEngine.js.map +1 -1
- package/dist/unstable/cluster/DeliverAt.d.ts.map +1 -1
- package/dist/unstable/cluster/Entity.d.ts.map +1 -1
- package/dist/unstable/cluster/Entity.js +5 -3
- package/dist/unstable/cluster/Entity.js.map +1 -1
- package/dist/unstable/cluster/EntityAddress.d.ts.map +1 -1
- package/dist/unstable/cluster/EntityId.d.ts.map +1 -1
- package/dist/unstable/cluster/EntityProxy.d.ts.map +1 -1
- package/dist/unstable/cluster/EntityProxyServer.d.ts.map +1 -1
- package/dist/unstable/cluster/EntityType.d.ts.map +1 -1
- package/dist/unstable/cluster/Envelope.d.ts.map +1 -1
- package/dist/unstable/cluster/HttpRunner.d.ts.map +1 -1
- package/dist/unstable/cluster/MachineId.d.ts.map +1 -1
- package/dist/unstable/cluster/Message.d.ts.map +1 -1
- package/dist/unstable/cluster/MessageStorage.d.ts +25 -29
- package/dist/unstable/cluster/MessageStorage.d.ts.map +1 -1
- package/dist/unstable/cluster/Reply.d.ts.map +1 -1
- package/dist/unstable/cluster/Runner.d.ts.map +1 -1
- package/dist/unstable/cluster/RunnerAddress.d.ts.map +1 -1
- package/dist/unstable/cluster/RunnerHealth.d.ts.map +1 -1
- package/dist/unstable/cluster/RunnerServer.d.ts +1 -1
- package/dist/unstable/cluster/RunnerStorage.d.ts.map +1 -1
- package/dist/unstable/cluster/Runners.d.ts +8 -8
- package/dist/unstable/cluster/ShardId.d.ts.map +1 -1
- package/dist/unstable/cluster/Sharding.d.ts.map +1 -1
- package/dist/unstable/cluster/Sharding.js +6 -5
- package/dist/unstable/cluster/Sharding.js.map +1 -1
- package/dist/unstable/cluster/ShardingConfig.d.ts.map +1 -1
- package/dist/unstable/cluster/ShardingRegistrationEvent.d.ts +6 -8
- package/dist/unstable/cluster/ShardingRegistrationEvent.d.ts.map +1 -1
- package/dist/unstable/cluster/SingleRunner.d.ts.map +1 -1
- package/dist/unstable/cluster/Singleton.d.ts.map +1 -1
- package/dist/unstable/cluster/SingletonAddress.d.ts.map +1 -1
- package/dist/unstable/cluster/Snowflake.d.ts +1 -1
- package/dist/unstable/cluster/Snowflake.d.ts.map +1 -1
- package/dist/unstable/cluster/Snowflake.js +1 -1
- package/dist/unstable/cluster/Snowflake.js.map +1 -1
- package/dist/unstable/cluster/SqlMessageStorage.d.ts.map +1 -1
- package/dist/unstable/cluster/SqlRunnerStorage.d.ts +1 -1
- package/dist/unstable/cluster/SqlRunnerStorage.d.ts.map +1 -1
- package/dist/unstable/cluster/internal/entityManager.js +14 -14
- package/dist/unstable/cluster/internal/entityManager.js.map +1 -1
- package/dist/unstable/cluster/internal/resourceMap.js +39 -14
- package/dist/unstable/cluster/internal/resourceMap.js.map +1 -1
- package/dist/unstable/devtools/DevTools.d.ts.map +1 -1
- package/dist/unstable/encoding/Msgpack.d.ts.map +1 -1
- package/dist/unstable/encoding/Ndjson.d.ts.map +1 -1
- package/dist/unstable/encoding/Sse.d.ts +2 -2
- package/dist/unstable/encoding/Sse.d.ts.map +1 -1
- package/dist/unstable/eventlog/Event.d.ts.map +1 -1
- package/dist/unstable/eventlog/EventGroup.d.ts.map +1 -1
- package/dist/unstable/eventlog/EventJournal.d.ts.map +1 -1
- package/dist/unstable/eventlog/EventJournal.js.map +1 -1
- package/dist/unstable/eventlog/EventLog.d.ts.map +1 -1
- package/dist/unstable/eventlog/EventLog.js +2 -2
- package/dist/unstable/eventlog/EventLog.js.map +1 -1
- package/dist/unstable/eventlog/EventLogEncryption.d.ts.map +1 -1
- package/dist/unstable/eventlog/EventLogMessage.d.ts.map +1 -1
- package/dist/unstable/eventlog/EventLogRemote.d.ts +21 -21
- package/dist/unstable/eventlog/EventLogServer.d.ts.map +1 -1
- package/dist/unstable/eventlog/EventLogServerEncrypted.d.ts +1 -1
- package/dist/unstable/eventlog/EventLogServerUnencrypted.d.ts +3 -4
- package/dist/unstable/eventlog/EventLogServerUnencrypted.d.ts.map +1 -1
- package/dist/unstable/eventlog/EventLogSessionAuth.d.ts.map +1 -1
- package/dist/unstable/eventlog/SqlEventJournal.d.ts.map +1 -1
- package/dist/unstable/eventlog/SqlEventLogServerEncrypted.d.ts.map +1 -1
- package/dist/unstable/eventlog/SqlEventLogServerUnencrypted.d.ts.map +1 -1
- package/dist/unstable/http/Cookies.d.ts +1 -1
- package/dist/unstable/http/Cookies.d.ts.map +1 -1
- package/dist/unstable/http/Etag.d.ts.map +1 -1
- package/dist/unstable/http/Headers.d.ts.map +1 -1
- package/dist/unstable/http/HttpBody.d.ts.map +1 -1
- package/dist/unstable/http/HttpClient.d.ts.map +1 -1
- package/dist/unstable/http/HttpClientError.d.ts +1 -1
- package/dist/unstable/http/HttpClientError.d.ts.map +1 -1
- package/dist/unstable/http/HttpClientRequest.d.ts.map +1 -1
- package/dist/unstable/http/HttpClientResponse.d.ts +1 -1
- package/dist/unstable/http/HttpClientResponse.d.ts.map +1 -1
- package/dist/unstable/http/HttpClientResponse.js.map +1 -1
- package/dist/unstable/http/HttpEffect.d.ts.map +1 -1
- package/dist/unstable/http/HttpIncomingMessage.d.ts +2 -2
- package/dist/unstable/http/HttpIncomingMessage.d.ts.map +1 -1
- package/dist/unstable/http/HttpIncomingMessage.js.map +1 -1
- package/dist/unstable/http/HttpMethod.d.ts.map +1 -1
- package/dist/unstable/http/HttpMiddleware.d.ts +1 -1
- package/dist/unstable/http/HttpMiddleware.d.ts.map +1 -1
- package/dist/unstable/http/HttpRouter.d.ts +4 -4
- package/dist/unstable/http/HttpRouter.d.ts.map +1 -1
- package/dist/unstable/http/HttpRouter.js.map +1 -1
- package/dist/unstable/http/HttpServer.d.ts.map +1 -1
- package/dist/unstable/http/HttpServerError.d.ts +1 -1
- package/dist/unstable/http/HttpServerError.d.ts.map +1 -1
- package/dist/unstable/http/HttpServerRequest.d.ts +8 -8
- package/dist/unstable/http/HttpServerRequest.d.ts.map +1 -1
- package/dist/unstable/http/HttpServerRequest.js.map +1 -1
- package/dist/unstable/http/HttpServerRespondable.d.ts.map +1 -1
- package/dist/unstable/http/HttpServerResponse.d.ts +1 -1
- package/dist/unstable/http/HttpServerResponse.d.ts.map +1 -1
- package/dist/unstable/http/HttpServerResponse.js.map +1 -1
- package/dist/unstable/http/HttpStaticServer.d.ts.map +1 -1
- package/dist/unstable/http/HttpTraceContext.d.ts.map +1 -1
- package/dist/unstable/http/Multipart.d.ts +4 -3
- package/dist/unstable/http/Multipart.d.ts.map +1 -1
- package/dist/unstable/http/Multipart.js.map +1 -1
- package/dist/unstable/http/Url.d.ts.map +1 -1
- package/dist/unstable/http/UrlParams.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApi.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApi.js +2 -4
- package/dist/unstable/httpapi/HttpApi.js.map +1 -1
- package/dist/unstable/httpapi/HttpApiBuilder.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApiClient.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApiClient.js.map +1 -1
- package/dist/unstable/httpapi/HttpApiEndpoint.d.ts +26 -26
- package/dist/unstable/httpapi/HttpApiEndpoint.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApiError.d.ts +1 -1
- package/dist/unstable/httpapi/HttpApiError.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApiGroup.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApiMiddleware.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApiScalar.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApiSchema.d.ts +1 -1
- package/dist/unstable/httpapi/HttpApiSchema.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApiSecurity.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApiSwagger.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApiTest.d.ts +1 -1
- package/dist/unstable/observability/Otlp.d.ts.map +1 -1
- package/dist/unstable/observability/OtlpExporter.js +3 -1
- package/dist/unstable/observability/OtlpExporter.js.map +1 -1
- package/dist/unstable/observability/OtlpLogger.d.ts.map +1 -1
- package/dist/unstable/observability/OtlpMetrics.d.ts.map +1 -1
- package/dist/unstable/observability/OtlpResource.d.ts.map +1 -1
- package/dist/unstable/observability/OtlpTracer.d.ts.map +1 -1
- package/dist/unstable/observability/PrometheusMetrics.d.ts.map +1 -1
- package/dist/unstable/observability/internal/otlpEnv.d.ts.map +1 -1
- package/dist/unstable/persistence/KeyValueStore.d.ts.map +1 -1
- package/dist/unstable/persistence/KeyValueStore.js.map +1 -1
- package/dist/unstable/persistence/Persistable.d.ts.map +1 -1
- package/dist/unstable/persistence/PersistedQueue.d.ts +1 -1
- package/dist/unstable/persistence/PersistedQueue.d.ts.map +1 -1
- package/dist/unstable/persistence/Persistence.d.ts.map +1 -1
- package/dist/unstable/persistence/RateLimiter.d.ts.map +1 -1
- package/dist/unstable/persistence/Redis.d.ts.map +1 -1
- package/dist/unstable/process/ChildProcess.d.ts.map +1 -1
- package/dist/unstable/process/ChildProcess.js.map +1 -1
- package/dist/unstable/process/ChildProcessSpawner.d.ts.map +1 -1
- package/dist/unstable/reactivity/AsyncResult.d.ts +2 -2
- package/dist/unstable/reactivity/AsyncResult.d.ts.map +1 -1
- package/dist/unstable/reactivity/Atom.d.ts +4 -4
- package/dist/unstable/reactivity/Atom.d.ts.map +1 -1
- package/dist/unstable/reactivity/Atom.js.map +1 -1
- package/dist/unstable/reactivity/AtomHttpApi.d.ts.map +1 -1
- package/dist/unstable/reactivity/AtomRef.d.ts.map +1 -1
- package/dist/unstable/reactivity/AtomRegistry.d.ts +2 -2
- package/dist/unstable/reactivity/AtomRegistry.d.ts.map +1 -1
- package/dist/unstable/reactivity/AtomRegistry.js +28 -37
- package/dist/unstable/reactivity/AtomRegistry.js.map +1 -1
- package/dist/unstable/reactivity/AtomRpc.d.ts.map +1 -1
- package/dist/unstable/reactivity/Hydration.d.ts.map +1 -1
- package/dist/unstable/reactivity/Reactivity.d.ts.map +1 -1
- package/dist/unstable/rpc/Rpc.d.ts.map +1 -1
- package/dist/unstable/rpc/RpcClient.d.ts +2 -1
- package/dist/unstable/rpc/RpcClient.d.ts.map +1 -1
- package/dist/unstable/rpc/RpcClient.js +5 -5
- package/dist/unstable/rpc/RpcClient.js.map +1 -1
- package/dist/unstable/rpc/RpcGroup.d.ts.map +1 -1
- package/dist/unstable/rpc/RpcMessage.d.ts +7 -7
- package/dist/unstable/rpc/RpcMessage.d.ts.map +1 -1
- package/dist/unstable/rpc/RpcMessage.js +2 -2
- package/dist/unstable/rpc/RpcMessage.js.map +1 -1
- package/dist/unstable/rpc/RpcMiddleware.d.ts.map +1 -1
- package/dist/unstable/rpc/RpcSchema.d.ts +1 -1
- package/dist/unstable/rpc/RpcSerialization.d.ts.map +1 -1
- package/dist/unstable/rpc/RpcSerialization.js +8 -8
- package/dist/unstable/rpc/RpcSerialization.js.map +1 -1
- package/dist/unstable/rpc/RpcServer.d.ts +2 -2
- package/dist/unstable/rpc/RpcServer.d.ts.map +1 -1
- package/dist/unstable/rpc/RpcServer.js +5 -5
- package/dist/unstable/rpc/RpcServer.js.map +1 -1
- package/dist/unstable/rpc/RpcWorker.d.ts.map +1 -1
- package/dist/unstable/rpc/Utils.d.ts.map +1 -1
- package/dist/unstable/schema/Model.d.ts +24 -38
- package/dist/unstable/schema/Model.d.ts.map +1 -1
- package/dist/unstable/schema/VariantSchema.d.ts +1 -1
- package/dist/unstable/schema/VariantSchema.d.ts.map +1 -1
- package/dist/unstable/socket/Socket.d.ts +1 -1
- package/dist/unstable/socket/Socket.d.ts.map +1 -1
- package/dist/unstable/socket/SocketServer.d.ts.map +1 -1
- package/dist/unstable/sql/Migrator.d.ts.map +1 -1
- package/dist/unstable/sql/SqlClient.d.ts.map +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.map +1 -1
- package/dist/unstable/sql/SqlModel.d.ts.map +1 -1
- package/dist/unstable/sql/SqlResolver.d.ts.map +1 -1
- package/dist/unstable/sql/SqlSchema.d.ts.map +1 -1
- package/dist/unstable/sql/SqlStream.d.ts.map +1 -1
- package/dist/unstable/sql/Statement.d.ts.map +1 -1
- package/dist/unstable/workers/Transferable.d.ts.map +1 -1
- package/dist/unstable/workers/Worker.d.ts.map +1 -1
- package/dist/unstable/workers/WorkerError.d.ts.map +1 -1
- package/dist/unstable/workflow/Activity.d.ts +1 -1
- package/dist/unstable/workflow/Activity.d.ts.map +1 -1
- package/dist/unstable/workflow/Activity.js +1 -1
- package/dist/unstable/workflow/Activity.js.map +1 -1
- package/dist/unstable/workflow/DurableClock.d.ts.map +1 -1
- package/dist/unstable/workflow/DurableDeferred.d.ts.map +1 -1
- package/dist/unstable/workflow/DurableQueue.d.ts.map +1 -1
- package/dist/unstable/workflow/DurableQueue.js +1 -1
- package/dist/unstable/workflow/DurableQueue.js.map +1 -1
- package/dist/unstable/workflow/Workflow.d.ts.map +1 -1
- package/dist/unstable/workflow/WorkflowEngine.d.ts.map +1 -1
- package/dist/unstable/workflow/WorkflowEngine.js +1 -1
- package/dist/unstable/workflow/WorkflowEngine.js.map +1 -1
- package/dist/unstable/workflow/WorkflowProxy.d.ts.map +1 -1
- package/dist/unstable/workflow/WorkflowProxyServer.d.ts.map +1 -1
- package/package.json +11 -12
- package/src/Config.ts +1 -1
- package/src/ConfigProvider.ts +79 -27
- package/src/Cron.ts +109 -57
- package/src/Effect.ts +131 -0
- package/src/FileSystem.ts +13 -0
- package/src/Layer.ts +6 -6
- package/src/LayerMap.ts +1 -1
- package/src/LayerRef.ts +379 -0
- package/src/Schedule.ts +1437 -4445
- package/src/Schema.ts +133 -33
- package/src/SchemaParser.ts +2 -2
- package/src/SchemaTransformation.ts +42 -2
- package/src/Stream.ts +1 -1
- package/src/internal/effect.ts +19 -0
- package/src/testing/TestSchema.ts +2 -2
- package/src/unstable/ai/Chat.ts +1 -1
- package/src/unstable/ai/LanguageModel.ts +3 -3
- package/src/unstable/cli/Argument.ts +14 -7
- package/src/unstable/cli/Flag.ts +6 -3
- package/src/unstable/cli/Param.ts +6 -3
- package/src/unstable/cli/Primitive.ts +2 -2
- package/src/unstable/cluster/ClusterCron.ts +4 -3
- package/src/unstable/cluster/ClusterWorkflowEngine.ts +5 -3
- package/src/unstable/cluster/Entity.ts +13 -14
- package/src/unstable/cluster/Sharding.ts +137 -134
- package/src/unstable/cluster/Snowflake.ts +2 -2
- package/src/unstable/cluster/internal/entityManager.ts +27 -25
- package/src/unstable/cluster/internal/resourceMap.ts +59 -25
- package/src/unstable/encoding/Sse.ts +3 -3
- package/src/unstable/eventlog/EventLog.ts +4 -3
- package/src/unstable/http/HttpClientResponse.ts +2 -3
- package/src/unstable/http/HttpIncomingMessage.ts +4 -5
- package/src/unstable/http/HttpRouter.ts +8 -10
- package/src/unstable/http/HttpServerRequest.ts +20 -19
- package/src/unstable/http/HttpServerResponse.ts +2 -2
- package/src/unstable/http/Multipart.ts +3 -3
- package/src/unstable/httpapi/HttpApi.ts +2 -4
- package/src/unstable/httpapi/HttpApiClient.ts +2 -2
- package/src/unstable/httpapi/HttpApiEndpoint.ts +7 -7
- package/src/unstable/httpapi/HttpApiSchema.ts +1 -1
- package/src/unstable/observability/OtlpExporter.ts +1 -1
- package/src/unstable/reactivity/Atom.ts +10 -7
- package/src/unstable/reactivity/AtomRegistry.ts +35 -44
- package/src/unstable/rpc/RpcClient.ts +10 -9
- package/src/unstable/rpc/RpcMessage.ts +8 -9
- package/src/unstable/rpc/RpcSerialization.ts +16 -16
- package/src/unstable/rpc/RpcServer.ts +5 -5
- package/src/unstable/workflow/Activity.ts +6 -5
- package/src/unstable/workflow/DurableQueue.ts +4 -3
- package/src/unstable/workflow/WorkflowEngine.ts +4 -3
package/src/Schema.ts
CHANGED
|
@@ -888,31 +888,6 @@ export declare namespace Codec {
|
|
|
888
888
|
export type EncodingServices<S> = S extends { readonly "EncodingServices": infer R } ? R : never
|
|
889
889
|
}
|
|
890
890
|
|
|
891
|
-
/**
|
|
892
|
-
* A schema that additionally supports optic (lens/prism) operations.
|
|
893
|
-
*
|
|
894
|
-
* **Details**
|
|
895
|
-
*
|
|
896
|
-
* `Optic<T, Iso>` extends {@link Schema}`<T>` with an `Iso` type that
|
|
897
|
-
* describes the isomorphic counterpart used by the optic layer. Crucially,
|
|
898
|
-
* decoding and encoding require *no* Effect services (`DecodingServices` and
|
|
899
|
-
* `EncodingServices` are both `never`), which means the optic can operate
|
|
900
|
-
* purely without an Effect runtime.
|
|
901
|
-
*
|
|
902
|
-
* Most primitive schemas (e.g. `Schema.String`, `Schema.Number`) implement
|
|
903
|
-
* `Optic` automatically. You normally interact with this interface through
|
|
904
|
-
* {@link Optic_} utilities rather than constructing it directly.
|
|
905
|
-
*
|
|
906
|
-
* @category models
|
|
907
|
-
* @since 4.0.0
|
|
908
|
-
*/
|
|
909
|
-
export interface Optic<out T, out Iso> extends Schema<T> {
|
|
910
|
-
readonly "Iso": Iso
|
|
911
|
-
readonly "DecodingServices": never
|
|
912
|
-
readonly "EncodingServices": never
|
|
913
|
-
readonly "Rebuild": Optic<T, Iso>
|
|
914
|
-
}
|
|
915
|
-
|
|
916
891
|
/**
|
|
917
892
|
* A schema that tracks the decoded type `T`, the encoded type `E`, and the
|
|
918
893
|
* Effect services required during decoding (`RD`) and encoding (`RE`).
|
|
@@ -924,8 +899,8 @@ export interface Optic<out T, out Iso> extends Schema<T> {
|
|
|
924
899
|
* Most concrete schemas produced by this module implement `Codec`.
|
|
925
900
|
*
|
|
926
901
|
* For APIs that only need one direction, prefer the narrower views:
|
|
927
|
-
* - {@link
|
|
928
|
-
* - {@link
|
|
902
|
+
* - {@link Decoder}`<T, RD>` — decode-only
|
|
903
|
+
* - {@link Encoder}`<E, RE>` — encode-only
|
|
929
904
|
* - {@link Schema}`<T>` — type-only (no encoded representation)
|
|
930
905
|
*
|
|
931
906
|
* **Example** (Accepting a codec that decodes to `number` from `string`)
|
|
@@ -953,6 +928,52 @@ export interface Codec<out T, out E = T, out RD = never, out RE = never> extends
|
|
|
953
928
|
readonly "Rebuild": Codec<T, E, RD, RE>
|
|
954
929
|
}
|
|
955
930
|
|
|
931
|
+
/**
|
|
932
|
+
* A schema that tracks the decoded type `T` and the Effect services required
|
|
933
|
+
* during decoding (`RD`).
|
|
934
|
+
*
|
|
935
|
+
* **When to use**
|
|
936
|
+
*
|
|
937
|
+
* Use when you need to preserve a schema's decoded type and decoding service
|
|
938
|
+
* requirements, but do not need to constrain its encoded representation or
|
|
939
|
+
* encoding services.
|
|
940
|
+
*
|
|
941
|
+
* @see {@link Codec} for preserving both decoded and encoded type information.
|
|
942
|
+
* @see {@link Encoder} for the encode-only view.
|
|
943
|
+
*
|
|
944
|
+
* @category models
|
|
945
|
+
* @since 4.0.0
|
|
946
|
+
*/
|
|
947
|
+
export interface Decoder<out T, out RD = never> extends Schema<T> {
|
|
948
|
+
readonly "Encoded": unknown
|
|
949
|
+
readonly "DecodingServices": RD
|
|
950
|
+
readonly "EncodingServices": unknown
|
|
951
|
+
readonly "Rebuild": Decoder<T, RD>
|
|
952
|
+
}
|
|
953
|
+
|
|
954
|
+
/**
|
|
955
|
+
* A schema that tracks the encoded type `E` and the Effect services required
|
|
956
|
+
* during encoding (`RE`).
|
|
957
|
+
*
|
|
958
|
+
* **When to use**
|
|
959
|
+
*
|
|
960
|
+
* Use when you need to preserve a schema's encoded type and encoding service
|
|
961
|
+
* requirements, but do not need to constrain its decoded representation or
|
|
962
|
+
* decoding services.
|
|
963
|
+
*
|
|
964
|
+
* @see {@link Codec} for preserving both decoded and encoded type information.
|
|
965
|
+
* @see {@link Decoder} for the decode-only view.
|
|
966
|
+
*
|
|
967
|
+
* @category models
|
|
968
|
+
* @since 4.0.0
|
|
969
|
+
*/
|
|
970
|
+
export interface Encoder<out E, out RE = never> extends Schema<unknown> {
|
|
971
|
+
readonly "Encoded": E
|
|
972
|
+
readonly "DecodingServices": unknown
|
|
973
|
+
readonly "EncodingServices": RE
|
|
974
|
+
readonly "Rebuild": Encoder<E, RE>
|
|
975
|
+
}
|
|
976
|
+
|
|
956
977
|
/**
|
|
957
978
|
* Returns a codec widened to the full {@link Codec} interface, prompting
|
|
958
979
|
* TypeScript to infer all four type parameters (`T`, `E`, `RD`, `RE`).
|
|
@@ -982,6 +1003,31 @@ export function revealCodec<T, E, RD, RE>(codec: Codec<T, E, RD, RE>) {
|
|
|
982
1003
|
return codec
|
|
983
1004
|
}
|
|
984
1005
|
|
|
1006
|
+
/**
|
|
1007
|
+
* A schema that additionally supports optic (lens/prism) operations.
|
|
1008
|
+
*
|
|
1009
|
+
* **Details**
|
|
1010
|
+
*
|
|
1011
|
+
* `Optic<T, Iso>` extends {@link Schema}`<T>` with an `Iso` type that
|
|
1012
|
+
* describes the isomorphic counterpart used by the optic layer. Crucially,
|
|
1013
|
+
* decoding and encoding require *no* Effect services (`DecodingServices` and
|
|
1014
|
+
* `EncodingServices` are both `never`), which means the optic can operate
|
|
1015
|
+
* purely without an Effect runtime.
|
|
1016
|
+
*
|
|
1017
|
+
* Most primitive schemas (e.g. `Schema.String`, `Schema.Number`) implement
|
|
1018
|
+
* `Optic` automatically. You normally interact with this interface through
|
|
1019
|
+
* {@link Optic_} utilities rather than constructing it directly.
|
|
1020
|
+
*
|
|
1021
|
+
* @category models
|
|
1022
|
+
* @since 4.0.0
|
|
1023
|
+
*/
|
|
1024
|
+
export interface Optic<out T, out Iso> extends Schema<T> {
|
|
1025
|
+
readonly "Iso": Iso
|
|
1026
|
+
readonly "DecodingServices": never
|
|
1027
|
+
readonly "EncodingServices": never
|
|
1028
|
+
readonly "Rebuild": Optic<T, Iso>
|
|
1029
|
+
}
|
|
1030
|
+
|
|
985
1031
|
export {
|
|
986
1032
|
/**
|
|
987
1033
|
* Error thrown (or returned as the error channel value) when schema decoding
|
|
@@ -2757,7 +2803,7 @@ export declare namespace TemplateLiteralParser {
|
|
|
2757
2803
|
*/
|
|
2758
2804
|
export type Type<Parts> = Parts extends readonly [infer Head, ...infer Tail] ? readonly [
|
|
2759
2805
|
Head extends TemplateLiteral.LiteralPart ? Head :
|
|
2760
|
-
Head extends
|
|
2806
|
+
Head extends ConstraintDecoder<infer T, unknown> ? T
|
|
2761
2807
|
: never,
|
|
2762
2808
|
...Type<Tail>
|
|
2763
2809
|
]
|
|
@@ -10405,6 +10451,8 @@ const DateString = String.annotate({ expected: "a string in ISO 8601 format that
|
|
|
10405
10451
|
* ```
|
|
10406
10452
|
*
|
|
10407
10453
|
* @see {@link DateValid} for accepting only valid Date instances
|
|
10454
|
+
* @see {@link DateFromString} for decoding strings into Date instances
|
|
10455
|
+
* @see {@link DateFromMillis} for decoding epoch milliseconds into Date instances
|
|
10408
10456
|
*
|
|
10409
10457
|
* @category Date
|
|
10410
10458
|
* @since 4.0.0
|
|
@@ -10464,6 +10512,8 @@ export interface DateFromString extends decodeTo<Date, String> {
|
|
|
10464
10512
|
*
|
|
10465
10513
|
* Invalid date strings can decode to invalid `Date` instances.
|
|
10466
10514
|
*
|
|
10515
|
+
* @see {@link DateFromMillis} for decoding epoch milliseconds into Date instances
|
|
10516
|
+
* @see {@link DateTimeUtcFromString} for decoding date-time strings into UTC values
|
|
10467
10517
|
* @see {@link Date} for accepting Date instances directly
|
|
10468
10518
|
* @see {@link DateValid} for rejecting invalid Date instances
|
|
10469
10519
|
*
|
|
@@ -10472,6 +10522,47 @@ export interface DateFromString extends decodeTo<Date, String> {
|
|
|
10472
10522
|
*/
|
|
10473
10523
|
export const DateFromString: DateFromString = DateString.pipe(decodeTo(Date, SchemaTransformation.dateFromString))
|
|
10474
10524
|
|
|
10525
|
+
/**
|
|
10526
|
+
* Type-level representation of {@link DateFromMillis}.
|
|
10527
|
+
*
|
|
10528
|
+
* @category Date
|
|
10529
|
+
* @since 4.0.0
|
|
10530
|
+
*/
|
|
10531
|
+
export interface DateFromMillis extends decodeTo<Date, Number> {
|
|
10532
|
+
readonly "Rebuild": DateFromMillis
|
|
10533
|
+
}
|
|
10534
|
+
|
|
10535
|
+
/**
|
|
10536
|
+
* Schema that decodes epoch milliseconds into a JavaScript `Date`.
|
|
10537
|
+
*
|
|
10538
|
+
* **When to use**
|
|
10539
|
+
*
|
|
10540
|
+
* Use to model numeric millisecond timestamps that decode to JavaScript `Date`
|
|
10541
|
+
* objects and encode back to numbers.
|
|
10542
|
+
*
|
|
10543
|
+
* **Details**
|
|
10544
|
+
*
|
|
10545
|
+
* Decoding:
|
|
10546
|
+
* A number of milliseconds since the Unix epoch is decoded as a `Date`.
|
|
10547
|
+
*
|
|
10548
|
+
* Encoding:
|
|
10549
|
+
* A `Date` is encoded as its millisecond timestamp.
|
|
10550
|
+
*
|
|
10551
|
+
* **Gotchas**
|
|
10552
|
+
*
|
|
10553
|
+
* This schema accepts any number, including `NaN`, `Infinity`, and `-Infinity`.
|
|
10554
|
+
* Those values decode to invalid `Date` instances.
|
|
10555
|
+
*
|
|
10556
|
+
* @see {@link DateFromString} for decoding string-encoded dates
|
|
10557
|
+
* @see {@link DateTimeUtcFromMillis} for decoding epoch milliseconds into UTC values
|
|
10558
|
+
*
|
|
10559
|
+
* @category Date
|
|
10560
|
+
* @since 4.0.0
|
|
10561
|
+
*/
|
|
10562
|
+
export const DateFromMillis: DateFromMillis = Number.pipe(
|
|
10563
|
+
decodeTo(Date, SchemaTransformation.dateFromMillis)
|
|
10564
|
+
)
|
|
10565
|
+
|
|
10475
10566
|
/**
|
|
10476
10567
|
* Type-level representation of {@link DateValid}.
|
|
10477
10568
|
*
|
|
@@ -12018,6 +12109,10 @@ export interface DateTimeUtcFromString extends decodeTo<DateTimeUtc, String> {
|
|
|
12018
12109
|
*
|
|
12019
12110
|
* - A `DateTime.Utc` is encoded as a UTC ISO 8601 string.
|
|
12020
12111
|
*
|
|
12112
|
+
* @see {@link DateTimeUtcFromDate} for decoding JavaScript Date values into UTC values
|
|
12113
|
+
* @see {@link DateTimeUtcFromMillis} for decoding epoch milliseconds into UTC values
|
|
12114
|
+
* @see {@link DateFromString} for decoding strings into JavaScript Date instances
|
|
12115
|
+
*
|
|
12021
12116
|
* @category DateTime
|
|
12022
12117
|
* @since 4.0.0
|
|
12023
12118
|
*/
|
|
@@ -12051,6 +12146,10 @@ export interface DateTimeUtcFromMillis extends decodeTo<instanceOf<DateTime.Utc>
|
|
|
12051
12146
|
* Encoding:
|
|
12052
12147
|
* - A `DateTime.Utc` is encoded as a number of milliseconds since the Unix epoch.
|
|
12053
12148
|
*
|
|
12149
|
+
* @see {@link DateTimeUtcFromDate} for decoding JavaScript Date values into UTC values
|
|
12150
|
+
* @see {@link DateTimeUtcFromString} for decoding date-time strings into UTC values
|
|
12151
|
+
* @see {@link DateFromMillis} for decoding epoch milliseconds into JavaScript Date instances
|
|
12152
|
+
*
|
|
12054
12153
|
* @category DateTime
|
|
12055
12154
|
* @since 4.0.0
|
|
12056
12155
|
*/
|
|
@@ -12612,7 +12711,8 @@ function getClassSchemaFactory<S extends Constraint>(
|
|
|
12612
12711
|
{
|
|
12613
12712
|
identifier,
|
|
12614
12713
|
[SchemaAST.ClassTypeId]: ([from]: readonly [SchemaAST.AST]) => new SchemaAST.Link(from, transformation),
|
|
12615
|
-
toCodec: ([from]: readonly [
|
|
12714
|
+
toCodec: ([from]: readonly [ConstraintCodec<S["Encoded"], S["Encoded"]>]) =>
|
|
12715
|
+
new SchemaAST.Link(from.ast, transformation),
|
|
12616
12716
|
toArbitrary: ([from]: readonly [Annotations.ToArbitrary.TypeParameter<S["Type"]>]) => () => ({
|
|
12617
12717
|
arbitrary: from.arbitrary.map((args: S["Type"]) => new self(args)),
|
|
12618
12718
|
terminal: from.terminal?.map((args: S["Type"]) => new self(args))
|
|
@@ -14002,8 +14102,8 @@ type XmlEncoderOptions = {
|
|
|
14002
14102
|
* @category Canonical Codecs
|
|
14003
14103
|
* @since 4.0.0
|
|
14004
14104
|
*/
|
|
14005
|
-
export function toEncoderXml<T,
|
|
14006
|
-
codec:
|
|
14105
|
+
export function toEncoderXml<T, RE>(
|
|
14106
|
+
codec: ConstraintCodec<T, unknown, unknown, RE>,
|
|
14007
14107
|
options?: XmlEncoderOptions
|
|
14008
14108
|
) {
|
|
14009
14109
|
const rootName = InternalAnnotations.resolveIdentifier(codec.ast) ?? InternalAnnotations.resolveTitle(codec.ast)
|
|
@@ -14338,7 +14438,7 @@ export interface overrideToCodecIso<S extends Constraint, Iso> extends
|
|
|
14338
14438
|
* @since 4.0.0
|
|
14339
14439
|
*/
|
|
14340
14440
|
export function overrideToCodecIso<S extends Constraint, Iso>(
|
|
14341
|
-
to:
|
|
14441
|
+
to: ConstraintCodec<Iso>,
|
|
14342
14442
|
transformation: {
|
|
14343
14443
|
readonly decode: SchemaGetter.Getter<S["Type"], Iso>
|
|
14344
14444
|
readonly encode: SchemaGetter.Getter<Iso, S["Type"]>
|
|
@@ -14366,7 +14466,7 @@ export function overrideToCodecIso<S extends Constraint, Iso>(
|
|
|
14366
14466
|
* @category converting
|
|
14367
14467
|
* @since 4.0.0
|
|
14368
14468
|
*/
|
|
14369
|
-
export function toDifferJsonPatch<T
|
|
14469
|
+
export function toDifferJsonPatch<T>(schema: ConstraintCodec<T, unknown>): Differ<T, JsonPatch.JsonPatch> {
|
|
14370
14470
|
const serializer = toCodecJson(schema)
|
|
14371
14471
|
const get = SchemaParser.encodeSync(serializer)
|
|
14372
14472
|
const set = SchemaParser.decodeSync(serializer)
|
package/src/SchemaParser.ts
CHANGED
|
@@ -170,8 +170,8 @@ export function make<S extends Schema.Constraint>(schema: S) {
|
|
|
170
170
|
* @category Asserting
|
|
171
171
|
* @since 3.10.0
|
|
172
172
|
*/
|
|
173
|
-
export function is<
|
|
174
|
-
return _is<
|
|
173
|
+
export function is<S extends Schema.Constraint>(schema: S): <I>(input: I) => input is I & S["Type"] {
|
|
174
|
+
return _is<S["Type"]>(schema.ast)
|
|
175
175
|
}
|
|
176
176
|
|
|
177
177
|
/** @internal */
|
|
@@ -871,7 +871,7 @@ export const bigintFromString = new Transformation(
|
|
|
871
871
|
* )
|
|
872
872
|
* ```
|
|
873
873
|
*
|
|
874
|
-
* @see {@link
|
|
874
|
+
* @see {@link dateFromMillis}
|
|
875
875
|
* @see {@link dateTimeUtcFromString}
|
|
876
876
|
*
|
|
877
877
|
* @category Coercions
|
|
@@ -882,6 +882,46 @@ export const dateFromString: Transformation<globalThis.Date, string> = new Trans
|
|
|
882
882
|
SchemaGetter.transform(formatDate)
|
|
883
883
|
)
|
|
884
884
|
|
|
885
|
+
/**
|
|
886
|
+
* Decodes epoch milliseconds into a `Date` and encodes a `Date` back to epoch
|
|
887
|
+
* milliseconds.
|
|
888
|
+
*
|
|
889
|
+
* **When to use**
|
|
890
|
+
*
|
|
891
|
+
* Use when you need a schema transformation for numeric timestamps represented
|
|
892
|
+
* as milliseconds since the Unix epoch.
|
|
893
|
+
*
|
|
894
|
+
* **Details**
|
|
895
|
+
*
|
|
896
|
+
* Decoding creates a `Date` from the number like `new Date(ms)`. Encoding
|
|
897
|
+
* returns the `Date` timestamp like `date.getTime()`.
|
|
898
|
+
*
|
|
899
|
+
* **Gotchas**
|
|
900
|
+
*
|
|
901
|
+
* This transformation does not validate date validity. `NaN`, `Infinity`, and
|
|
902
|
+
* `-Infinity` decode to invalid `Date` instances.
|
|
903
|
+
*
|
|
904
|
+
* **Example** (Converting milliseconds to a Date)
|
|
905
|
+
*
|
|
906
|
+
* ```ts
|
|
907
|
+
* import { Schema, SchemaTransformation } from "effect"
|
|
908
|
+
*
|
|
909
|
+
* const schema = Schema.Number.pipe(
|
|
910
|
+
* Schema.decodeTo(Schema.Date, SchemaTransformation.dateFromMillis)
|
|
911
|
+
* )
|
|
912
|
+
* ```
|
|
913
|
+
*
|
|
914
|
+
* @see {@link dateFromString}
|
|
915
|
+
* @see {@link SchemaGetter.dateTimeUtcFromInput}
|
|
916
|
+
*
|
|
917
|
+
* @category Coercions
|
|
918
|
+
* @since 4.0.0
|
|
919
|
+
*/
|
|
920
|
+
export const dateFromMillis: Transformation<globalThis.Date, number> = new Transformation(
|
|
921
|
+
SchemaGetter.Date(),
|
|
922
|
+
SchemaGetter.transform((date) => date.getTime())
|
|
923
|
+
)
|
|
924
|
+
|
|
885
925
|
/**
|
|
886
926
|
* Decodes a `string` into a `Duration` and encodes a `Duration` back to a
|
|
887
927
|
* parseable `string`.
|
|
@@ -1762,8 +1802,8 @@ export const timeZoneFromString: Transformation<DateTime.TimeZone, string> = tra
|
|
|
1762
1802
|
* UTC, and fails with `InvalidValue` when parsing fails. Encode uses
|
|
1763
1803
|
* `DateTime.formatIso`.
|
|
1764
1804
|
*
|
|
1765
|
-
* @see {@link dateTimeZonedFromString} for ISO strings that should preserve zoned date-time information
|
|
1766
1805
|
* @see {@link dateFromString} for decoding into JavaScript `Date`
|
|
1806
|
+
* @see {@link dateTimeZonedFromString} for ISO strings that should preserve zoned date-time information
|
|
1767
1807
|
*
|
|
1768
1808
|
* @category transforming
|
|
1769
1809
|
* @since 4.0.0
|
package/src/Stream.ts
CHANGED
|
@@ -1471,7 +1471,7 @@ export const fromAsyncIterable = <A, E>(
|
|
|
1471
1471
|
*
|
|
1472
1472
|
* const program = Effect.gen(function*() {
|
|
1473
1473
|
* const schedule = Schedule.spaced("50 millis").pipe(
|
|
1474
|
-
* Schedule.
|
|
1474
|
+
* Schedule.upTo({ times: 3 })
|
|
1475
1475
|
* )
|
|
1476
1476
|
* const stream = Stream.fromSchedule(schedule)
|
|
1477
1477
|
* const values = yield* Stream.runCollect(stream)
|
package/src/internal/effect.ts
CHANGED
|
@@ -2081,6 +2081,25 @@ export const contextWith = <R, A, E, R2>(
|
|
|
2081
2081
|
f: (context: Context.Context<R>) => Effect.Effect<A, E, R2>
|
|
2082
2082
|
): Effect.Effect<A, E, R | R2> => withFiber((fiber) => f(fiber.context as Context.Context<R>))
|
|
2083
2083
|
|
|
2084
|
+
/** @internal */
|
|
2085
|
+
export const setContext: {
|
|
2086
|
+
<R>(
|
|
2087
|
+
context: Context.Context<R>
|
|
2088
|
+
): <A, E>(
|
|
2089
|
+
self: Effect.Effect<A, E, R>
|
|
2090
|
+
) => Effect.Effect<A, E>
|
|
2091
|
+
<A, E, R>(
|
|
2092
|
+
self: Effect.Effect<A, E, R>,
|
|
2093
|
+
context: Context.Context<R>
|
|
2094
|
+
): Effect.Effect<A, E>
|
|
2095
|
+
} = dual(
|
|
2096
|
+
2,
|
|
2097
|
+
<A, E, R>(
|
|
2098
|
+
self: Effect.Effect<A, E, R>,
|
|
2099
|
+
context: Context.Context<R>
|
|
2100
|
+
): Effect.Effect<A, E> => updateContext(self, constant(context))
|
|
2101
|
+
)
|
|
2102
|
+
|
|
2084
2103
|
/** @internal */
|
|
2085
2104
|
export const provideContext: {
|
|
2086
2105
|
<XR>(
|
|
@@ -167,7 +167,7 @@ export class Asserts<S extends Schema.Constraint> {
|
|
|
167
167
|
*
|
|
168
168
|
* @see {@link arbitrary} for checking that generated values satisfy the schema
|
|
169
169
|
*/
|
|
170
|
-
verifyLosslessTransformation<S extends Schema.
|
|
170
|
+
verifyLosslessTransformation<S extends Schema.ConstraintCodec<unknown, unknown>>(this: Asserts<S>, options?: {
|
|
171
171
|
readonly params?: FastCheck.Parameters<[S["Type"]]>
|
|
172
172
|
}) {
|
|
173
173
|
const decodeUnknownEffect = SchemaParser.decodeUnknownEffect(this.schema)
|
|
@@ -272,7 +272,7 @@ export class Asserts<S extends Schema.Constraint> {
|
|
|
272
272
|
*
|
|
273
273
|
* @see {@link verifyLosslessTransformation} for property-based round-trip checks
|
|
274
274
|
*/
|
|
275
|
-
arbitrary<S extends Schema.
|
|
275
|
+
arbitrary<S extends Schema.ConstraintCodec<unknown, unknown>>(this: Asserts<S>) {
|
|
276
276
|
const schema = this.schema
|
|
277
277
|
return {
|
|
278
278
|
verifyGeneration(options?: {
|
package/src/unstable/ai/Chat.ts
CHANGED
|
@@ -336,7 +336,7 @@ export interface Service {
|
|
|
336
336
|
*/
|
|
337
337
|
readonly generateObject: <
|
|
338
338
|
ObjectEncoded extends Record<string, any>,
|
|
339
|
-
ObjectSchema extends Schema.
|
|
339
|
+
ObjectSchema extends Schema.Encoder<ObjectEncoded, unknown>,
|
|
340
340
|
Options extends NoExcessProperties<LanguageModel.GenerateObjectOptions<any, ObjectSchema>, Options>
|
|
341
341
|
>(
|
|
342
342
|
options: Options & LanguageModel.GenerateObjectOptions<LanguageModel.ExtractTools<Options>, ObjectSchema>
|
|
@@ -124,7 +124,7 @@ export interface Service {
|
|
|
124
124
|
*/
|
|
125
125
|
readonly generateObject: <
|
|
126
126
|
ObjectEncoded extends Record<string, any>,
|
|
127
|
-
StructuredOutputSchema extends Schema.
|
|
127
|
+
StructuredOutputSchema extends Schema.Encoder<ObjectEncoded, unknown>,
|
|
128
128
|
Options extends NoExcessProperties<
|
|
129
129
|
GenerateObjectOptions<any, StructuredOutputSchema>,
|
|
130
130
|
Options
|
|
@@ -835,7 +835,7 @@ export const make: (params: {
|
|
|
835
835
|
|
|
836
836
|
const generateObject = <
|
|
837
837
|
ObjectEncoded extends Record<string, any>,
|
|
838
|
-
StructuredOutputSchema extends Schema.
|
|
838
|
+
StructuredOutputSchema extends Schema.Encoder<ObjectEncoded, unknown>,
|
|
839
839
|
Options extends NoExcessProperties<
|
|
840
840
|
GenerateObjectOptions<any, StructuredOutputSchema>,
|
|
841
841
|
Options
|
|
@@ -1691,7 +1691,7 @@ export const generateText: {
|
|
|
1691
1691
|
*/
|
|
1692
1692
|
export const generateObject = <
|
|
1693
1693
|
ObjectEncoded extends Record<string, any>,
|
|
1694
|
-
StructuredOutputSchema extends Schema.
|
|
1694
|
+
StructuredOutputSchema extends Schema.Encoder<ObjectEncoded, unknown>,
|
|
1695
1695
|
Options extends NoExcessProperties<
|
|
1696
1696
|
GenerateObjectOptions<any, StructuredOutputSchema>,
|
|
1697
1697
|
Options
|
|
@@ -401,8 +401,8 @@ export const withDefault: {
|
|
|
401
401
|
* @since 4.0.0
|
|
402
402
|
*/
|
|
403
403
|
<A, const B>(
|
|
404
|
-
|
|
405
|
-
|
|
404
|
+
self: Argument<A>,
|
|
405
|
+
defaultValue: B | Effect.Effect<B, CliError.CliError, Environment>
|
|
406
406
|
): Argument<A | B>
|
|
407
407
|
} = Param.withDefault
|
|
408
408
|
|
|
@@ -729,8 +729,8 @@ export const mapEffect: {
|
|
|
729
729
|
* @since 4.0.0
|
|
730
730
|
*/
|
|
731
731
|
<A, B>(
|
|
732
|
-
|
|
733
|
-
|
|
732
|
+
self: Argument<A>,
|
|
733
|
+
f: (a: A) => Effect.Effect<B, CliError.CliError, Environment>
|
|
734
734
|
): Argument<B>
|
|
735
735
|
} = dual(2, <A, B>(
|
|
736
736
|
self: Argument<A>,
|
|
@@ -982,7 +982,7 @@ export const withSchema: {
|
|
|
982
982
|
* @category combinators
|
|
983
983
|
* @since 4.0.0
|
|
984
984
|
*/
|
|
985
|
-
<A, B>(schema: Schema.
|
|
985
|
+
<A, B>(schema: Schema.ConstraintCodec<B, A, Environment, unknown>): (self: Argument<A>) => Argument<B>
|
|
986
986
|
/**
|
|
987
987
|
* Validates parsed values against a Schema.
|
|
988
988
|
*
|
|
@@ -1000,8 +1000,15 @@ export const withSchema: {
|
|
|
1000
1000
|
* @category combinators
|
|
1001
1001
|
* @since 4.0.0
|
|
1002
1002
|
*/
|
|
1003
|
-
<A, B>(
|
|
1004
|
-
|
|
1003
|
+
<A, B>(
|
|
1004
|
+
self: Argument<A>,
|
|
1005
|
+
schema: Schema.ConstraintCodec<B, A, Environment, unknown>
|
|
1006
|
+
): Argument<B>
|
|
1007
|
+
} = dual(
|
|
1008
|
+
2,
|
|
1009
|
+
<A, B>(self: Argument<A>, schema: Schema.ConstraintCodec<B, A, Environment, unknown>): Argument<B> =>
|
|
1010
|
+
Param.withSchema(self, schema)
|
|
1011
|
+
)
|
|
1005
1012
|
|
|
1006
1013
|
/**
|
|
1007
1014
|
* Creates a positional choice argument with custom value mapping.
|
package/src/unstable/cli/Flag.ts
CHANGED
|
@@ -1782,7 +1782,7 @@ export const withSchema: {
|
|
|
1782
1782
|
* @category schemas
|
|
1783
1783
|
* @since 4.0.0
|
|
1784
1784
|
*/
|
|
1785
|
-
<A, B>(schema: Schema.
|
|
1785
|
+
<A, B>(schema: Schema.ConstraintCodec<B, A, Environment, unknown>): (self: Flag<A>) => Flag<B>
|
|
1786
1786
|
/**
|
|
1787
1787
|
* Validates and transforms a flag value using a Schema codec.
|
|
1788
1788
|
*
|
|
@@ -1820,5 +1820,8 @@ export const withSchema: {
|
|
|
1820
1820
|
* @category schemas
|
|
1821
1821
|
* @since 4.0.0
|
|
1822
1822
|
*/
|
|
1823
|
-
<A, B>(self: Flag<A>, schema: Schema.
|
|
1824
|
-
} = dual(
|
|
1823
|
+
<A, B>(self: Flag<A>, schema: Schema.ConstraintCodec<B, A, Environment, unknown>): Flag<B>
|
|
1824
|
+
} = dual(
|
|
1825
|
+
2,
|
|
1826
|
+
<A, B>(self: Flag<A>, schema: Schema.ConstraintCodec<B, A, Environment, unknown>) => Param.withSchema(self, schema)
|
|
1827
|
+
)
|
|
@@ -2430,7 +2430,7 @@ export const withSchema: {
|
|
|
2430
2430
|
* @category combinators
|
|
2431
2431
|
* @since 4.0.0
|
|
2432
2432
|
*/
|
|
2433
|
-
<A, B>(schema: Schema.
|
|
2433
|
+
<A, B>(schema: Schema.ConstraintCodec<B, A, Environment, unknown>): <Kind extends ParamKind>(
|
|
2434
2434
|
self: Param<Kind, A>
|
|
2435
2435
|
) => Param<Kind, B>
|
|
2436
2436
|
/**
|
|
@@ -2455,10 +2455,13 @@ export const withSchema: {
|
|
|
2455
2455
|
* @category combinators
|
|
2456
2456
|
* @since 4.0.0
|
|
2457
2457
|
*/
|
|
2458
|
-
<Kind extends ParamKind, A, B>(
|
|
2458
|
+
<Kind extends ParamKind, A, B>(
|
|
2459
|
+
self: Param<Kind, A>,
|
|
2460
|
+
schema: Schema.ConstraintCodec<B, A, Environment, unknown>
|
|
2461
|
+
): Param<Kind, B>
|
|
2459
2462
|
} = dual(2, <Kind extends ParamKind, A, B>(
|
|
2460
2463
|
self: Param<Kind, A>,
|
|
2461
|
-
schema: Schema.
|
|
2464
|
+
schema: Schema.ConstraintCodec<B, A, Environment, unknown>
|
|
2462
2465
|
) => {
|
|
2463
2466
|
const decodeParam = Schema.decodeUnknownEffect(schema)
|
|
2464
2467
|
return mapEffect(self, (value) =>
|
|
@@ -105,9 +105,9 @@ const makePrimitive = <A>(
|
|
|
105
105
|
parse
|
|
106
106
|
})
|
|
107
107
|
|
|
108
|
-
const makeSchemaPrimitive = <T
|
|
108
|
+
const makeSchemaPrimitive = <T>(
|
|
109
109
|
tag: string,
|
|
110
|
-
schema: Schema.
|
|
110
|
+
schema: Schema.ConstraintDecoder<T, Environment>
|
|
111
111
|
): Primitive<T> => {
|
|
112
112
|
const toCodecStringTree = Schema.toCodecStringTree(schema)
|
|
113
113
|
const decode = Schema.decodeUnknownEffect(toCodecStringTree)
|
|
@@ -147,9 +147,10 @@ export const make = <E, R>(options: {
|
|
|
147
147
|
return Layer.merge(InitialRun, EntityLayer)
|
|
148
148
|
}
|
|
149
149
|
|
|
150
|
-
const retryPolicy = Schedule.
|
|
151
|
-
Schedule.
|
|
152
|
-
)
|
|
150
|
+
const retryPolicy = Schedule.min([
|
|
151
|
+
Schedule.exponential(200, 1.5),
|
|
152
|
+
Schedule.spaced("1 minute")
|
|
153
|
+
])
|
|
153
154
|
|
|
154
155
|
class CronPayload extends Schema.Class<CronPayload>("effect/cluster/ClusterCron/CronPayload")({
|
|
155
156
|
dateTime: Schema.DateTimeUtc
|
|
@@ -133,6 +133,7 @@ export const make = Effect.gen(function*() {
|
|
|
133
133
|
if (!entity) {
|
|
134
134
|
return yield* Effect.die(`Workflow ${workflowName} not registered`)
|
|
135
135
|
}
|
|
136
|
+
yield* RcMap.invalidate(clientsPartial, workflowName)
|
|
136
137
|
return yield* entity.client
|
|
137
138
|
}),
|
|
138
139
|
idleTimeToLive: "5 minutes"
|
|
@@ -625,9 +626,10 @@ export const make = Effect.gen(function*() {
|
|
|
625
626
|
return engine
|
|
626
627
|
})
|
|
627
628
|
|
|
628
|
-
const retryPolicy = Schedule.
|
|
629
|
-
Schedule.
|
|
630
|
-
)
|
|
629
|
+
const retryPolicy = Schedule.min([
|
|
630
|
+
Schedule.exponential(200, 1.5),
|
|
631
|
+
Schedule.spaced("1 minute")
|
|
632
|
+
])
|
|
631
633
|
|
|
632
634
|
const ensureSuccess = <A, E, R>(effect: Effect.Effect<A, E, R>) =>
|
|
633
635
|
effect.pipe(
|
|
@@ -618,11 +618,7 @@ export const makeTestClient: <Type extends string, Rpcs extends Rpc.Any, LA, LE,
|
|
|
618
618
|
Rpc.ServicesClient<Rpcs> | Rpc.ServicesServer<Rpcs> | Rpc.Middleware<Rpcs> | LR
|
|
619
619
|
>
|
|
620
620
|
readonly concurrency: number | "unbounded"
|
|
621
|
-
readonly build: Effect.Effect<
|
|
622
|
-
Context.Context<Rpc.ToHandler<Rpcs>>,
|
|
623
|
-
never,
|
|
624
|
-
Scope | CurrentAddress
|
|
625
|
-
>
|
|
621
|
+
readonly build: Effect.Effect<Context.Context<Rpc.ToHandler<Rpcs>>>
|
|
626
622
|
}>()
|
|
627
623
|
const sharding = shardingTag.of({
|
|
628
624
|
...({} as Sharding["Service"]),
|
|
@@ -631,13 +627,7 @@ export const makeTestClient: <Type extends string, Rpcs extends Rpc.Any, LA, LE,
|
|
|
631
627
|
entityMap.set(entity.type, {
|
|
632
628
|
context: context as any,
|
|
633
629
|
concurrency: options?.concurrency ?? 1,
|
|
634
|
-
build: entity.protocol.toHandlers(handlers as any)
|
|
635
|
-
Effect.provideContext(Context.mutate(context, (context) =>
|
|
636
|
-
context.pipe(
|
|
637
|
-
Context.add(CurrentRunnerAddress, runnerAddress),
|
|
638
|
-
Context.omit(Scope)
|
|
639
|
-
)))
|
|
640
|
-
) as any
|
|
630
|
+
build: entity.protocol.toHandlers(handlers as any) as any
|
|
641
631
|
})
|
|
642
632
|
return Effect.void
|
|
643
633
|
})
|
|
@@ -654,8 +644,15 @@ export const makeTestClient: <Type extends string, Rpcs extends Rpc.Any, LA, LE,
|
|
|
654
644
|
entityId: entityId as EntityId,
|
|
655
645
|
shardId: makeShardId(entityId)
|
|
656
646
|
})
|
|
647
|
+
const scope = yield* Effect.scope
|
|
648
|
+
const handlerContext = Context.mutate(entityEntry.context, (context) =>
|
|
649
|
+
context.pipe(
|
|
650
|
+
Context.add(CurrentRunnerAddress, runnerAddress),
|
|
651
|
+
Context.add(CurrentAddress, address),
|
|
652
|
+
Context.add(Scope, scope)
|
|
653
|
+
))
|
|
657
654
|
const handlers = yield* entityEntry.build.pipe(
|
|
658
|
-
Effect.
|
|
655
|
+
Effect.setContext(handlerContext as Context.Context<any>)
|
|
659
656
|
)
|
|
660
657
|
|
|
661
658
|
// oxlint-disable-next-line prefer-const
|
|
@@ -665,7 +662,9 @@ export const makeTestClient: <Type extends string, Rpcs extends Rpc.Any, LA, LE,
|
|
|
665
662
|
onFromServer(response) {
|
|
666
663
|
return client.write(response)
|
|
667
664
|
}
|
|
668
|
-
}).pipe(
|
|
665
|
+
}).pipe(
|
|
666
|
+
Effect.setContext(Context.merge(handlerContext, handlers))
|
|
667
|
+
)
|
|
669
668
|
|
|
670
669
|
client = yield* RpcClient.makeNoSerialization(entity.protocol, {
|
|
671
670
|
supportsAck: true,
|