effect 4.0.0-beta.94 → 4.0.0-beta.98
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.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.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.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.map +1 -1
- package/dist/LayerMap.d.ts.map +1 -1
- package/dist/LayerRef.d.ts +5 -7
- package/dist/LayerRef.d.ts.map +1 -1
- package/dist/LayerRef.js +4 -6
- package/dist/LayerRef.js.map +1 -1
- 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/Number.js +28 -10
- package/dist/Number.js.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 +71 -22
- package/dist/Schema.d.ts.map +1 -1
- package/dist/Schema.js +76 -33
- package/dist/Schema.js.map +1 -1
- package/dist/SchemaAST.d.ts.map +1 -1
- package/dist/SchemaAST.js +25 -10
- package/dist/SchemaAST.js.map +1 -1
- package/dist/SchemaError.d.ts +53 -0
- package/dist/SchemaError.d.ts.map +1 -0
- package/dist/SchemaError.js +61 -0
- package/dist/SchemaError.js.map +1 -0
- package/dist/SchemaGetter.d.ts.map +1 -1
- package/dist/SchemaGetter.js +17 -12
- package/dist/SchemaGetter.js.map +1 -1
- package/dist/SchemaIssue.d.ts.map +1 -1
- package/dist/SchemaIssue.js.map +1 -1
- package/dist/SchemaParser.d.ts.map +1 -1
- package/dist/SchemaRepresentation.d.ts +106 -106
- package/dist/SchemaRepresentation.d.ts.map +1 -1
- package/dist/SchemaRepresentation.js +186 -224
- package/dist/SchemaRepresentation.js.map +1 -1
- 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/index.d.ts +8 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +8 -0
- package/dist/index.js.map +1 -1
- package/dist/internal/effect.js +26 -8
- package/dist/internal/effect.js.map +1 -1
- package/dist/internal/schema/equivalence.js +1 -2
- package/dist/internal/schema/equivalence.js.map +1 -1
- package/dist/internal/schema/representation.js +1 -3
- package/dist/internal/schema/representation.js.map +1 -1
- package/dist/internal/schema/schema.d.ts +0 -13
- package/dist/internal/schema/schema.d.ts.map +1 -1
- package/dist/internal/schema/schema.js +4 -29
- package/dist/internal/schema/schema.js.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.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 +1 -1
- 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.map +1 -1
- package/dist/unstable/ai/McpSchema.d.ts +278 -278
- 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.map +1 -1
- package/dist/unstable/cli/CliError.d.ts +8 -16
- package/dist/unstable/cli/CliError.d.ts.map +1 -1
- package/dist/unstable/cli/CliError.js +8 -16
- package/dist/unstable/cli/CliError.js.map +1 -1
- package/dist/unstable/cli/CliOutput.d.ts.map +1 -1
- package/dist/unstable/cli/Command.d.ts +4 -3
- package/dist/unstable/cli/Command.d.ts.map +1 -1
- package/dist/unstable/cli/Command.js +3 -3
- package/dist/unstable/cli/Command.js.map +1 -1
- package/dist/unstable/cli/Completions.d.ts.map +1 -1
- package/dist/unstable/cli/Flag.d.ts.map +1 -1
- package/dist/unstable/cli/GlobalFlag.d.ts +6 -8
- package/dist/unstable/cli/GlobalFlag.d.ts.map +1 -1
- package/dist/unstable/cli/GlobalFlag.js +6 -6
- package/dist/unstable/cli/GlobalFlag.js.map +1 -1
- package/dist/unstable/cli/Param.d.ts.map +1 -1
- package/dist/unstable/cli/Primitive.d.ts.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 +1 -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/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 +1 -1
- package/dist/unstable/cluster/EntityProxyServer.d.ts.map +1 -1
- package/dist/unstable/cluster/EntityProxyServer.js +2 -4
- package/dist/unstable/cluster/EntityProxyServer.js.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.js +3 -4
- 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 +26 -24
- package/dist/unstable/cluster/internal/entityManager.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.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.map +1 -1
- package/dist/unstable/http/HttpEffect.d.ts.map +1 -1
- package/dist/unstable/http/HttpIncomingMessage.d.ts.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.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 +2 -2
- package/dist/unstable/http/HttpServerRequest.d.ts.map +1 -1
- package/dist/unstable/http/HttpServerRespondable.d.ts.map +1 -1
- package/dist/unstable/http/HttpServerResponse.d.ts.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 +2 -1
- package/dist/unstable/http/Multipart.d.ts.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 +36 -15
- package/dist/unstable/httpapi/HttpApi.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApi.js +19 -20
- package/dist/unstable/httpapi/HttpApi.js.map +1 -1
- package/dist/unstable/httpapi/HttpApiBuilder.d.ts +51 -62
- package/dist/unstable/httpapi/HttpApiBuilder.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApiBuilder.js +68 -58
- package/dist/unstable/httpapi/HttpApiBuilder.js.map +1 -1
- package/dist/unstable/httpapi/HttpApiClient.d.ts +53 -53
- package/dist/unstable/httpapi/HttpApiClient.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApiClient.js +40 -30
- package/dist/unstable/httpapi/HttpApiClient.js.map +1 -1
- package/dist/unstable/httpapi/HttpApiEndpoint.d.ts +171 -170
- package/dist/unstable/httpapi/HttpApiEndpoint.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApiEndpoint.js +31 -19
- package/dist/unstable/httpapi/HttpApiEndpoint.js.map +1 -1
- package/dist/unstable/httpapi/HttpApiError.d.ts +23 -1
- package/dist/unstable/httpapi/HttpApiError.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApiError.js +31 -0
- package/dist/unstable/httpapi/HttpApiError.js.map +1 -1
- package/dist/unstable/httpapi/HttpApiGroup.d.ts +55 -30
- package/dist/unstable/httpapi/HttpApiGroup.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApiGroup.js +22 -29
- package/dist/unstable/httpapi/HttpApiGroup.js.map +1 -1
- package/dist/unstable/httpapi/HttpApiMiddleware.d.ts +8 -8
- package/dist/unstable/httpapi/HttpApiMiddleware.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApiMiddleware.js.map +1 -1
- package/dist/unstable/httpapi/HttpApiScalar.d.ts +2 -2
- package/dist/unstable/httpapi/HttpApiScalar.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApiScalar.js +4 -3
- package/dist/unstable/httpapi/HttpApiScalar.js.map +1 -1
- package/dist/unstable/httpapi/HttpApiSchema.d.ts +8 -0
- package/dist/unstable/httpapi/HttpApiSchema.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApiSchema.js.map +1 -1
- package/dist/unstable/httpapi/HttpApiSecurity.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApiSwagger.d.ts +1 -1
- package/dist/unstable/httpapi/HttpApiSwagger.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApiSwagger.js.map +1 -1
- package/dist/unstable/httpapi/HttpApiTest.d.ts +4 -4
- package/dist/unstable/httpapi/HttpApiTest.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApiTest.js +9 -8
- package/dist/unstable/httpapi/HttpApiTest.js.map +1 -1
- package/dist/unstable/httpapi/OpenApi.d.ts +1 -1
- package/dist/unstable/httpapi/OpenApi.d.ts.map +1 -1
- package/dist/unstable/httpapi/OpenApi.js +77 -37
- package/dist/unstable/httpapi/OpenApi.js.map +1 -1
- package/dist/unstable/httpapi/internal/html.js +6 -2
- package/dist/unstable/httpapi/internal/html.js.map +1 -1
- package/dist/unstable/httpapi/internal/mediaType.d.ts +2 -0
- package/dist/unstable/httpapi/internal/mediaType.d.ts.map +1 -0
- package/dist/unstable/httpapi/internal/mediaType.js +7 -0
- package/dist/unstable/httpapi/internal/mediaType.js.map +1 -0
- 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/PersistedQueue.js +16 -12
- package/dist/unstable/persistence/PersistedQueue.js.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.map +1 -1
- package/dist/unstable/reactivity/Atom.js +1 -1
- package/dist/unstable/reactivity/Atom.js.map +1 -1
- package/dist/unstable/reactivity/AtomHttpApi.d.ts +7 -7
- package/dist/unstable/reactivity/AtomHttpApi.d.ts.map +1 -1
- package/dist/unstable/reactivity/AtomHttpApi.js +3 -2
- package/dist/unstable/reactivity/AtomHttpApi.js.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 +5 -3
- package/dist/unstable/rpc/RpcServer.d.ts.map +1 -1
- package/dist/unstable/rpc/RpcServer.js +11 -8
- 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/DurableDeferred.js +1 -1
- package/dist/unstable/workflow/DurableDeferred.js.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 +1 -1
- package/dist/unstable/workflow/WorkflowProxyServer.d.ts.map +1 -1
- package/dist/unstable/workflow/WorkflowProxyServer.js +1 -2
- package/dist/unstable/workflow/WorkflowProxyServer.js.map +1 -1
- package/package.json +11 -12
- package/src/ConfigProvider.ts +79 -27
- package/src/Cron.ts +109 -57
- package/src/LayerRef.ts +4 -6
- package/src/Number.ts +29 -10
- package/src/Schedule.ts +1437 -4445
- package/src/Schema.ts +95 -34
- package/src/SchemaAST.ts +25 -13
- package/src/SchemaError.ts +64 -0
- package/src/SchemaGetter.ts +22 -16
- package/src/SchemaRepresentation.ts +165 -202
- package/src/SchemaTransformation.ts +42 -2
- package/src/Stream.ts +1 -1
- package/src/index.ts +10 -0
- package/src/internal/effect.ts +39 -22
- package/src/internal/schema/equivalence.ts +1 -2
- package/src/internal/schema/representation.ts +4 -4
- package/src/internal/schema/schema.ts +4 -37
- package/src/unstable/cli/CliError.ts +24 -16
- package/src/unstable/cli/Command.ts +8 -8
- package/src/unstable/cli/GlobalFlag.ts +22 -33
- package/src/unstable/cluster/ClusterCron.ts +4 -3
- package/src/unstable/cluster/ClusterWorkflowEngine.ts +4 -3
- package/src/unstable/cluster/EntityProxyServer.ts +15 -17
- package/src/unstable/cluster/Sharding.ts +4 -4
- package/src/unstable/cluster/Snowflake.ts +2 -2
- package/src/unstable/cluster/internal/entityManager.ts +61 -47
- package/src/unstable/eventlog/EventLog.ts +4 -3
- package/src/unstable/httpapi/HttpApi.ts +72 -47
- package/src/unstable/httpapi/HttpApiBuilder.ts +320 -217
- package/src/unstable/httpapi/HttpApiClient.ts +196 -151
- package/src/unstable/httpapi/HttpApiEndpoint.ts +251 -447
- package/src/unstable/httpapi/HttpApiError.ts +33 -0
- package/src/unstable/httpapi/HttpApiGroup.ts +95 -74
- package/src/unstable/httpapi/HttpApiMiddleware.ts +10 -7
- package/src/unstable/httpapi/HttpApiScalar.ts +15 -12
- package/src/unstable/httpapi/HttpApiSchema.ts +8 -0
- package/src/unstable/httpapi/HttpApiSwagger.ts +2 -2
- package/src/unstable/httpapi/HttpApiTest.ts +15 -14
- package/src/unstable/httpapi/OpenApi.ts +74 -36
- package/src/unstable/httpapi/internal/html.ts +9 -2
- package/src/unstable/httpapi/internal/mediaType.ts +6 -0
- package/src/unstable/observability/OtlpExporter.ts +1 -1
- package/src/unstable/persistence/PersistedQueue.ts +16 -14
- package/src/unstable/reactivity/Atom.ts +1 -1
- package/src/unstable/reactivity/AtomHttpApi.ts +164 -162
- 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 +15 -9
- package/src/unstable/workflow/Activity.ts +6 -5
- package/src/unstable/workflow/DurableDeferred.ts +1 -1
- package/src/unstable/workflow/DurableQueue.ts +4 -3
- package/src/unstable/workflow/WorkflowEngine.ts +4 -3
- package/src/unstable/workflow/WorkflowProxyServer.ts +11 -12
package/src/internal/effect.ts
CHANGED
|
@@ -4585,17 +4585,20 @@ const forEachSequential = <A, B, E, R>(
|
|
|
4585
4585
|
)
|
|
4586
4586
|
})
|
|
4587
4587
|
|
|
4588
|
+
type IterateEagerOptions = {
|
|
4589
|
+
readonly concurrency?: number | undefined
|
|
4590
|
+
readonly start?: number | undefined
|
|
4591
|
+
readonly end?: number | undefined
|
|
4592
|
+
readonly orderedStep?: boolean | undefined
|
|
4593
|
+
}
|
|
4594
|
+
|
|
4588
4595
|
const iterateEagerImpl = <S, A, X, E, R, E2>(options: {
|
|
4589
4596
|
readonly onItem: (state: S, item: A, index: number) => Effect.Effect<X, E, R>
|
|
4590
4597
|
readonly step: (state: NoInfer<S>, item: A, exit: Exit.Exit<X, E>, index: number) => Exit.Exit<void, E2> | void
|
|
4591
4598
|
}): (
|
|
4592
4599
|
initialState: S,
|
|
4593
4600
|
items: ReadonlyArray<A>,
|
|
4594
|
-
options?:
|
|
4595
|
-
readonly concurrency?: number | undefined
|
|
4596
|
-
readonly start?: number | undefined
|
|
4597
|
-
readonly end?: number | undefined
|
|
4598
|
-
}
|
|
4601
|
+
options?: IterateEagerOptions
|
|
4599
4602
|
) => Effect.Effect<void, E | E2, R> | undefined => {
|
|
4600
4603
|
const onItem = options.onItem
|
|
4601
4604
|
const step = options.step
|
|
@@ -4603,15 +4606,12 @@ const iterateEagerImpl = <S, A, X, E, R, E2>(options: {
|
|
|
4603
4606
|
return (
|
|
4604
4607
|
state: S,
|
|
4605
4608
|
items: ReadonlyArray<A>,
|
|
4606
|
-
opts:
|
|
4607
|
-
readonly concurrency?: number | undefined
|
|
4608
|
-
readonly start?: number | undefined
|
|
4609
|
-
readonly end?: number | undefined
|
|
4610
|
-
} | undefined
|
|
4609
|
+
opts: IterateEagerOptions | undefined
|
|
4611
4610
|
): Effect.Effect<void, E | E2, R> | undefined => {
|
|
4612
4611
|
let index = opts?.start ?? 0
|
|
4613
4612
|
const end = opts?.end ?? items.length
|
|
4614
4613
|
const concurrency = opts?.concurrency ?? 1
|
|
4614
|
+
const orderedStep = opts?.orderedStep === true && concurrency > 1
|
|
4615
4615
|
let done = false
|
|
4616
4616
|
let parentFiber: Fiber.Fiber<any, any> | undefined
|
|
4617
4617
|
let fibers: Set<Fiber.Fiber<any, any>> | undefined
|
|
@@ -4619,6 +4619,22 @@ const iterateEagerImpl = <S, A, X, E, R, E2>(options: {
|
|
|
4619
4619
|
let interrupted = false
|
|
4620
4620
|
let terminal: Exit.Exit<void, E | E2> | void
|
|
4621
4621
|
let effect: Effect.Effect<X, E, R> | undefined
|
|
4622
|
+
let nextIndex = index
|
|
4623
|
+
const exits: Array<Exit.Exit<X, E> | undefined> | undefined = orderedStep ? new Array(end) : undefined
|
|
4624
|
+
|
|
4625
|
+
const runStep = (item: A, exit: Exit.Exit<X, E>, currentIndex: number): Exit.Exit<void, E | E2> | void => {
|
|
4626
|
+
if (!orderedStep) return step(state, item, exit, currentIndex)
|
|
4627
|
+
if (terminal) return terminal
|
|
4628
|
+
exits![currentIndex] = exit
|
|
4629
|
+
while (nextIndex < end) {
|
|
4630
|
+
const nextExit = exits![nextIndex]
|
|
4631
|
+
if (nextExit === undefined) return
|
|
4632
|
+
exits![nextIndex] = undefined
|
|
4633
|
+
const index = nextIndex++
|
|
4634
|
+
const result = step(state, items[index], nextExit, index)
|
|
4635
|
+
if (result) return result
|
|
4636
|
+
}
|
|
4637
|
+
}
|
|
4622
4638
|
|
|
4623
4639
|
const go = (): Effect.Effect<void, E | E2, R> | undefined => {
|
|
4624
4640
|
let paused = false
|
|
@@ -4628,13 +4644,13 @@ const iterateEagerImpl = <S, A, X, E, R, E2>(options: {
|
|
|
4628
4644
|
|
|
4629
4645
|
// fast case (already an exit)
|
|
4630
4646
|
if (effectIsExit(eff)) {
|
|
4631
|
-
terminal =
|
|
4647
|
+
terminal = runStep(item, eff, index)
|
|
4632
4648
|
if (terminal) break
|
|
4633
4649
|
|
|
4634
4650
|
// Use flatMap for concurrency of 1
|
|
4635
4651
|
} else if (concurrency === 1) {
|
|
4636
4652
|
return flatMap(exit(eff), (exit) => {
|
|
4637
|
-
terminal =
|
|
4653
|
+
terminal = runStep(item, exit, index)
|
|
4638
4654
|
index++
|
|
4639
4655
|
return terminal ?? go() ?? void_
|
|
4640
4656
|
})
|
|
@@ -4661,7 +4677,7 @@ const iterateEagerImpl = <S, A, X, E, R, E2>(options: {
|
|
|
4661
4677
|
|
|
4662
4678
|
const fiber = forkUnsafe(parentFiber, eff, true, true, "inherit")
|
|
4663
4679
|
if (fiber._exit) {
|
|
4664
|
-
terminal =
|
|
4680
|
+
terminal = runStep(item, fiber._exit, index)
|
|
4665
4681
|
if (terminal) break
|
|
4666
4682
|
continue
|
|
4667
4683
|
}
|
|
@@ -4685,7 +4701,7 @@ const iterateEagerImpl = <S, A, X, E, R, E2>(options: {
|
|
|
4685
4701
|
}
|
|
4686
4702
|
}
|
|
4687
4703
|
} else {
|
|
4688
|
-
const result =
|
|
4704
|
+
const result = runStep(item, exit, currentIndex)
|
|
4689
4705
|
if (result) {
|
|
4690
4706
|
terminal = result._tag === "Failure"
|
|
4691
4707
|
? exitFailCause(causeFromReasons(result.cause.reasons.slice()))
|
|
@@ -4741,11 +4757,7 @@ export const iterateEager = <S, A>(): <X, E, R, E2>(options: {
|
|
|
4741
4757
|
}) => (
|
|
4742
4758
|
initialState: S,
|
|
4743
4759
|
items: ReadonlyArray<A>,
|
|
4744
|
-
options?:
|
|
4745
|
-
readonly concurrency?: number | undefined
|
|
4746
|
-
readonly start?: number | undefined
|
|
4747
|
-
readonly end?: number | undefined
|
|
4748
|
-
}
|
|
4760
|
+
options?: IterateEagerOptions
|
|
4749
4761
|
) => Effect.Effect<void, E | E2, R> | undefined => iterateEagerImpl
|
|
4750
4762
|
|
|
4751
4763
|
const forEachConcurrent = iterateEagerImpl({
|
|
@@ -5835,11 +5847,16 @@ class ClockImpl implements Clock.Clock {
|
|
|
5835
5847
|
}
|
|
5836
5848
|
readonly currentTimeNanos: Effect.Effect<bigint> = sync(() => this.currentTimeNanosUnsafe())
|
|
5837
5849
|
sleep(duration: Duration.Duration): Effect.Effect<void> {
|
|
5838
|
-
|
|
5850
|
+
return this.sleepMillis(Duration.toMillis(duration))
|
|
5851
|
+
}
|
|
5852
|
+
private sleepMillis(millis: number): Effect.Effect<void> {
|
|
5839
5853
|
if (millis <= 0) return yieldNow
|
|
5854
|
+
else if (!Number.isFinite(millis)) return never
|
|
5840
5855
|
return callback((resume) => {
|
|
5841
|
-
|
|
5842
|
-
|
|
5856
|
+
const continuation = millis > MAX_TIMER_MILLIS
|
|
5857
|
+
? this.sleepMillis(millis - MAX_TIMER_MILLIS)
|
|
5858
|
+
: void_
|
|
5859
|
+
const handle = setTimeout(() => resume(continuation), Math.min(millis, MAX_TIMER_MILLIS))
|
|
5843
5860
|
return sync(() => clearTimeout(handle))
|
|
5844
5861
|
})
|
|
5845
5862
|
}
|
|
@@ -78,8 +78,7 @@ function recur(ast: SchemaAST.AST, path: ReadonlyArray<PropertyKey>): Equivalenc
|
|
|
78
78
|
// handle post rest elements
|
|
79
79
|
// ---------------------------------------------
|
|
80
80
|
for (let j = 0; j < tail.length; j++) {
|
|
81
|
-
i
|
|
82
|
-
if (!tail[j](a[i], b[i])) {
|
|
81
|
+
if (!tail[j](a[i + j], b[i + j])) {
|
|
83
82
|
return false
|
|
84
83
|
}
|
|
85
84
|
}
|
|
@@ -95,12 +95,12 @@ export function fromASTs(asts: readonly [SchemaAST.AST, ...Array<SchemaAST.AST>]
|
|
|
95
95
|
return out
|
|
96
96
|
}
|
|
97
97
|
|
|
98
|
-
function getEncodedSchema(last: SchemaAST.Declaration): SchemaAST.
|
|
98
|
+
function getEncodedSchema(last: SchemaAST.Declaration): SchemaAST.Declaration | SchemaAST.Null {
|
|
99
99
|
const getLink = last.annotations?.toCodecJson ?? last.annotations?.toCodec
|
|
100
100
|
if (Predicate.isFunction(getLink)) {
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
101
|
+
return SchemaAST.replaceEncoding(last, [
|
|
102
|
+
getLink(last.typeParameters.map((tp) => InternalSchema.make(SchemaAST.toEncoded(tp))))
|
|
103
|
+
])
|
|
104
104
|
}
|
|
105
105
|
return SchemaAST.null
|
|
106
106
|
}
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import * as Cause from "../../Cause.ts"
|
|
2
|
-
import * as Data from "../../Data.ts"
|
|
3
2
|
import * as Effect from "../../Effect.ts"
|
|
4
|
-
import * as Exit from "../../Exit.ts"
|
|
5
3
|
import * as Pipeable from "../../Pipeable.ts"
|
|
6
4
|
import type * as Schema from "../../Schema.ts"
|
|
7
5
|
import * as SchemaAST from "../../SchemaAST.ts"
|
|
6
|
+
import { SchemaError } from "../../SchemaError.ts"
|
|
8
7
|
import type { Issue } from "../../SchemaIssue.ts"
|
|
9
8
|
import * as SchemaParser from "../../SchemaParser.ts"
|
|
10
9
|
|
|
@@ -35,34 +34,16 @@ export function make<S extends Schema.Constraint>(ast: S["ast"], options?: objec
|
|
|
35
34
|
}
|
|
36
35
|
self.ast = ast
|
|
37
36
|
self.rebuild = (ast: SchemaAST.AST) => make(ast, options)
|
|
37
|
+
const makeEffect = SchemaParser.makeEffect(self)
|
|
38
38
|
self.makeEffect = (input: S["~type.make.in"], options?: Schema.MakeOptions) =>
|
|
39
|
-
|
|
39
|
+
fromIssueEffect(makeEffect(input, options))
|
|
40
40
|
self.make = SchemaParser.make(self)
|
|
41
41
|
self.makeOption = SchemaParser.makeOption(self)
|
|
42
42
|
return self
|
|
43
43
|
}
|
|
44
44
|
|
|
45
45
|
/** @internal */
|
|
46
|
-
export
|
|
47
|
-
|
|
48
|
-
// purposefully not internal
|
|
49
|
-
export class SchemaError extends Data.TaggedError("SchemaError")<{
|
|
50
|
-
readonly issue: Issue
|
|
51
|
-
}> {
|
|
52
|
-
readonly [SchemaErrorTypeId]: typeof SchemaErrorTypeId = SchemaErrorTypeId
|
|
53
|
-
constructor(issue: Issue) {
|
|
54
|
-
super({ issue })
|
|
55
|
-
}
|
|
56
|
-
override get message() {
|
|
57
|
-
return this.issue.toString()
|
|
58
|
-
}
|
|
59
|
-
override toString() {
|
|
60
|
-
return `SchemaError(${this.message})`
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
/** @internal */
|
|
65
|
-
export function mapSchemaIssueEffect<A, R>(
|
|
46
|
+
export function fromIssueEffect<A, R>(
|
|
66
47
|
self: Effect.Effect<A, Issue, R>
|
|
67
48
|
): Effect.Effect<A, SchemaError, R> {
|
|
68
49
|
return Effect.catchCause(
|
|
@@ -71,20 +52,6 @@ export function mapSchemaIssueEffect<A, R>(
|
|
|
71
52
|
)
|
|
72
53
|
}
|
|
73
54
|
|
|
74
|
-
/** @internal */
|
|
75
|
-
export function mapSchemaErrorEffect<A, R>(
|
|
76
|
-
self: Effect.Effect<A, SchemaError, R>
|
|
77
|
-
): Effect.Effect<A, Issue, R> {
|
|
78
|
-
return Effect.catchCause(self, (cause) => Effect.failCauseSync(() => Cause.map(cause, (error) => error.issue)))
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
/** @internal */
|
|
82
|
-
export function mapSchemaIssueExit<A>(exit: Exit.Exit<A, Issue>): Exit.Exit<A, SchemaError> {
|
|
83
|
-
return Exit.isSuccess(exit)
|
|
84
|
-
? Exit.succeed(exit.value)
|
|
85
|
-
: Exit.failCause(Cause.map(exit.cause, (issue) => new SchemaError(issue)))
|
|
86
|
-
}
|
|
87
|
-
|
|
88
55
|
/** @internal */
|
|
89
56
|
export const jsonReorder = makeReorder(getJsonPriority)
|
|
90
57
|
|
|
@@ -127,8 +127,9 @@ export type CliError =
|
|
|
127
127
|
* @category models
|
|
128
128
|
* @since 4.0.0
|
|
129
129
|
*/
|
|
130
|
-
export class UnrecognizedOption extends Schema.
|
|
131
|
-
|
|
130
|
+
export class UnrecognizedOption extends Schema.TaggedErrorClass<UnrecognizedOption>(
|
|
131
|
+
`${TypeId}/UnrecognizedOption`
|
|
132
|
+
)("UnrecognizedOption", {
|
|
132
133
|
option: Schema.String,
|
|
133
134
|
command: Schema.optional(Schema.Array(Schema.String)),
|
|
134
135
|
suggestions: Schema.Array(Schema.String)
|
|
@@ -178,8 +179,9 @@ export class UnrecognizedOption extends Schema.ErrorClass<UnrecognizedOption>(`$
|
|
|
178
179
|
* @category models
|
|
179
180
|
* @since 4.0.0
|
|
180
181
|
*/
|
|
181
|
-
export class DuplicateOption extends Schema.
|
|
182
|
-
|
|
182
|
+
export class DuplicateOption extends Schema.TaggedErrorClass<DuplicateOption>(
|
|
183
|
+
`${TypeId}/DuplicateOption`
|
|
184
|
+
)("DuplicateOption", {
|
|
183
185
|
option: Schema.String,
|
|
184
186
|
parentCommand: Schema.String,
|
|
185
187
|
childCommand: Schema.String
|
|
@@ -232,8 +234,9 @@ export class DuplicateOption extends Schema.ErrorClass<DuplicateOption>(`${TypeI
|
|
|
232
234
|
* @category models
|
|
233
235
|
* @since 4.0.0
|
|
234
236
|
*/
|
|
235
|
-
export class MissingOption extends Schema.
|
|
236
|
-
|
|
237
|
+
export class MissingOption extends Schema.TaggedErrorClass<MissingOption>(
|
|
238
|
+
`${TypeId}/MissingOption`
|
|
239
|
+
)("MissingOption", {
|
|
237
240
|
option: Schema.String
|
|
238
241
|
}) {
|
|
239
242
|
/**
|
|
@@ -282,8 +285,9 @@ export class MissingOption extends Schema.ErrorClass<MissingOption>(`${TypeId}/M
|
|
|
282
285
|
* @category models
|
|
283
286
|
* @since 4.0.0
|
|
284
287
|
*/
|
|
285
|
-
export class MissingArgument extends Schema.
|
|
286
|
-
|
|
288
|
+
export class MissingArgument extends Schema.TaggedErrorClass<MissingArgument>(
|
|
289
|
+
`${TypeId}/MissingArgument`
|
|
290
|
+
)("MissingArgument", {
|
|
287
291
|
argument: Schema.String
|
|
288
292
|
}) {
|
|
289
293
|
/**
|
|
@@ -337,8 +341,9 @@ export class MissingArgument extends Schema.ErrorClass<MissingArgument>(`${TypeI
|
|
|
337
341
|
* @category models
|
|
338
342
|
* @since 4.0.0
|
|
339
343
|
*/
|
|
340
|
-
export class InvalidValue extends Schema.
|
|
341
|
-
|
|
344
|
+
export class InvalidValue extends Schema.TaggedErrorClass<InvalidValue>(
|
|
345
|
+
`${TypeId}/InvalidValue`
|
|
346
|
+
)("InvalidValue", {
|
|
342
347
|
option: Schema.String,
|
|
343
348
|
value: Schema.String,
|
|
344
349
|
expected: Schema.String,
|
|
@@ -400,8 +405,9 @@ export class InvalidValue extends Schema.ErrorClass<InvalidValue>(`${TypeId}/Inv
|
|
|
400
405
|
* @category models
|
|
401
406
|
* @since 4.0.0
|
|
402
407
|
*/
|
|
403
|
-
export class UnknownSubcommand extends Schema.
|
|
404
|
-
|
|
408
|
+
export class UnknownSubcommand extends Schema.TaggedErrorClass<UnknownSubcommand>(
|
|
409
|
+
`${TypeId}/UnknownSubcommand`
|
|
410
|
+
)("UnknownSubcomand", {
|
|
405
411
|
subcommand: Schema.String,
|
|
406
412
|
parent: Schema.optional(Schema.Array(Schema.String)),
|
|
407
413
|
suggestions: Schema.Array(Schema.String)
|
|
@@ -464,8 +470,9 @@ export class UnknownSubcommand extends Schema.ErrorClass<UnknownSubcommand>(`${T
|
|
|
464
470
|
* @category models
|
|
465
471
|
* @since 4.0.0
|
|
466
472
|
*/
|
|
467
|
-
export class UserError extends Schema.
|
|
468
|
-
|
|
473
|
+
export class UserError extends Schema.TaggedErrorClass<UserError>(
|
|
474
|
+
`${TypeId}/UserError`
|
|
475
|
+
)("UserError", {
|
|
469
476
|
cause: Schema.Defect()
|
|
470
477
|
}) {
|
|
471
478
|
/**
|
|
@@ -533,8 +540,9 @@ export type NonShowHelpErrors = typeof NonShowHelpErrors.Type
|
|
|
533
540
|
* @category models
|
|
534
541
|
* @since 4.0.0
|
|
535
542
|
*/
|
|
536
|
-
export class ShowHelp extends Schema.
|
|
537
|
-
|
|
543
|
+
export class ShowHelp extends Schema.TaggedErrorClass<ShowHelp>(
|
|
544
|
+
`${TypeId}/ShowHelp`
|
|
545
|
+
)("ShowHelp", {
|
|
538
546
|
commandPath: Schema.Array(Schema.String),
|
|
539
547
|
errors: Schema.Array(NonShowHelpErrors)
|
|
540
548
|
}) {
|
|
@@ -697,7 +697,7 @@ export const make: {
|
|
|
697
697
|
name: Name,
|
|
698
698
|
config: Config,
|
|
699
699
|
handler: (config: Command.Config.Infer<Config>) => Effect.Effect<void, E, R>
|
|
700
|
-
): Command<Name, Command.Config.Infer<Config>, {}, E, Exclude<R,
|
|
700
|
+
): Command<Name, Command.Config.Infer<Config>, {}, E, Exclude<R, BuiltInSettingContext>>
|
|
701
701
|
} = ((
|
|
702
702
|
name: string,
|
|
703
703
|
config?: Command.Config,
|
|
@@ -772,7 +772,7 @@ export const withHandler: {
|
|
|
772
772
|
*/
|
|
773
773
|
<A, R, E>(handler: (value: A) => Effect.Effect<void, E, R>): <Name extends string, XR, XE, ContextInput>(
|
|
774
774
|
self: Command<Name, A, ContextInput, XE, XR>
|
|
775
|
-
) => Command<Name, A, ContextInput, E, Exclude<R,
|
|
775
|
+
) => Command<Name, A, ContextInput, E, Exclude<R, BuiltInSettingContext>>
|
|
776
776
|
/* ========================================================================== */
|
|
777
777
|
/* Combinators */
|
|
778
778
|
/* ========================================================================== */
|
|
@@ -805,11 +805,11 @@ export const withHandler: {
|
|
|
805
805
|
<Name extends string, A, XR, XE, R, E, ContextInput>(
|
|
806
806
|
self: Command<Name, A, ContextInput, XE, XR>,
|
|
807
807
|
handler: (value: A) => Effect.Effect<void, E, R>
|
|
808
|
-
): Command<Name, A, ContextInput, E, Exclude<R,
|
|
808
|
+
): Command<Name, A, ContextInput, E, Exclude<R, BuiltInSettingContext>>
|
|
809
809
|
} = dual(2, <Name extends string, A, XR, XE, R, E, ContextInput>(
|
|
810
810
|
self: Command<Name, A, ContextInput, XE, XR>,
|
|
811
811
|
handler: (value: A) => Effect.Effect<void, E, R>
|
|
812
|
-
): Command<Name, A, ContextInput, E, Exclude<R,
|
|
812
|
+
): Command<Name, A, ContextInput, E, Exclude<R, BuiltInSettingContext>> =>
|
|
813
813
|
makeCommand({ ...toImpl(self), handle: handler } as any))
|
|
814
814
|
|
|
815
815
|
interface SubcommandGroupInternal {
|
|
@@ -1272,6 +1272,7 @@ type ExtractGlobalFlagContext<T extends ReadonlyArray<GlobalFlag.GlobalFlag<any>
|
|
|
1272
1272
|
? F extends GlobalFlag.Setting<infer Id, infer _A> ? GlobalFlag.Setting.Identifier<Id>
|
|
1273
1273
|
: never
|
|
1274
1274
|
: never
|
|
1275
|
+
type BuiltInSettingContext = ExtractGlobalFlagContext<typeof GlobalFlag.BuiltIns>
|
|
1275
1276
|
type ExtractSubcommand<T> = T extends Command<infer _Name, infer _Input, infer _CI, infer _E, infer _R> ? T
|
|
1276
1277
|
: T extends Command.SubcommandGroup<infer Commands> ? Commands[number]
|
|
1277
1278
|
: never
|
|
@@ -2352,15 +2353,14 @@ export const runWith = <const Name extends string, Input, E, R, ContextInput>(
|
|
|
2352
2353
|
|
|
2353
2354
|
// 7. Provide setting values
|
|
2354
2355
|
let program = commandImpl.handle(parseResult.success, [command.name])
|
|
2356
|
+
const [, logLevel] = yield* GlobalFlag.LogLevel.flag.parse(emptyArgs)
|
|
2357
|
+
program = Effect.provideService(program, GlobalFlag.LogLevel, logLevel)
|
|
2355
2358
|
for (const flag of activeFlags) {
|
|
2356
|
-
if (flag._tag !== "Setting") continue
|
|
2359
|
+
if (flag._tag !== "Setting" || flag === GlobalFlag.LogLevel) continue
|
|
2357
2360
|
const [, value] = yield* flag.flag.parse(emptyArgs)
|
|
2358
2361
|
program = Effect.provideService(program, flag, value)
|
|
2359
2362
|
}
|
|
2360
2363
|
|
|
2361
|
-
const [, logLevel] = yield* GlobalFlag.LogLevel.flag.parse(emptyArgs)
|
|
2362
|
-
program = Effect.provideService(program, GlobalFlag.LogLevel, logLevel)
|
|
2363
|
-
|
|
2364
2364
|
// 8. Apply built-in setting behavior
|
|
2365
2365
|
const services = Option.match(logLevel, {
|
|
2366
2366
|
onNone: () => Context.empty(),
|
|
@@ -156,12 +156,11 @@ export const Help: Action<boolean> = action({
|
|
|
156
156
|
Flag.withAlias("h"),
|
|
157
157
|
Flag.withDescription("Show help information")
|
|
158
158
|
),
|
|
159
|
-
run: (_, { command, commandPath })
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
})
|
|
159
|
+
run: Effect.fnUntraced(function*(_, { command, commandPath }) {
|
|
160
|
+
const formatter = yield* CliOutput.Formatter
|
|
161
|
+
const helpDoc = yield* HelpInternal.getHelpForCommandPath(command, commandPath, BuiltIns)
|
|
162
|
+
yield* Console.log(formatter.formatHelpDoc(helpDoc))
|
|
163
|
+
})
|
|
165
164
|
})
|
|
166
165
|
|
|
167
166
|
/**
|
|
@@ -179,11 +178,10 @@ export const Version: Action<boolean> = action({
|
|
|
179
178
|
Flag.withAlias("v"),
|
|
180
179
|
Flag.withDescription("Show version information")
|
|
181
180
|
),
|
|
182
|
-
run: (_, { command, version })
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
})
|
|
181
|
+
run: Effect.fnUntraced(function*(_, { command, version }) {
|
|
182
|
+
const formatter = yield* CliOutput.Formatter
|
|
183
|
+
yield* Console.log(formatter.formatVersion(command.name, version))
|
|
184
|
+
})
|
|
187
185
|
})
|
|
188
186
|
|
|
189
187
|
/**
|
|
@@ -206,14 +204,13 @@ export const Completions: Action<Option.Option<"bash" | "zsh" | "fish">> = actio
|
|
|
206
204
|
Flag.withMetavar("<bash|zsh|fish|sh>"),
|
|
207
205
|
Flag.withDescription("Print shell completion script")
|
|
208
206
|
),
|
|
209
|
-
run: (shell, { command })
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
})
|
|
207
|
+
run: Effect.fnUntraced(function*(shell, { command }) {
|
|
208
|
+
if (Option.isNone(shell)) return
|
|
209
|
+
const descriptor = CommandDescriptor.fromCommand(command)
|
|
210
|
+
yield* Console.log(
|
|
211
|
+
Completions_.generate(command.name, shell.value, descriptor)
|
|
212
|
+
)
|
|
213
|
+
})
|
|
217
214
|
})
|
|
218
215
|
|
|
219
216
|
/**
|
|
@@ -279,17 +276,9 @@ export const LogLevel: Setting<"log-level", Option.Option<LogLevelType>> = setti
|
|
|
279
276
|
* @category references
|
|
280
277
|
* @since 4.0.0
|
|
281
278
|
*/
|
|
282
|
-
export const BuiltIns:
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
]
|
|
288
|
-
|
|
289
|
-
/**
|
|
290
|
-
* Built-in setting context identifiers.
|
|
291
|
-
*
|
|
292
|
-
* @category models
|
|
293
|
-
* @since 4.0.0
|
|
294
|
-
*/
|
|
295
|
-
export type BuiltInSettingContext = Setting.Identifier<"log-level">
|
|
279
|
+
export const BuiltIns: readonly [
|
|
280
|
+
Action<boolean>,
|
|
281
|
+
Action<boolean>,
|
|
282
|
+
Action<Option.Option<"bash" | "zsh" | "fish">>,
|
|
283
|
+
Setting<"log-level", Option.Option<LogLevelType>>
|
|
284
|
+
] = [Help, Version, Completions, LogLevel]
|
|
@@ -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
|
|
@@ -626,9 +626,10 @@ export const make = Effect.gen(function*() {
|
|
|
626
626
|
return engine
|
|
627
627
|
})
|
|
628
628
|
|
|
629
|
-
const retryPolicy = Schedule.
|
|
630
|
-
Schedule.
|
|
631
|
-
)
|
|
629
|
+
const retryPolicy = Schedule.min([
|
|
630
|
+
Schedule.exponential(200, 1.5),
|
|
631
|
+
Schedule.spaced("1 minute")
|
|
632
|
+
])
|
|
632
633
|
|
|
633
634
|
const ensureSuccess = <A, E, R>(effect: Effect.Effect<A, E, R>) =>
|
|
634
635
|
effect.pipe(
|
|
@@ -34,27 +34,25 @@ import type { Sharding } from "./Sharding.ts"
|
|
|
34
34
|
*/
|
|
35
35
|
export const layerHttpApi = <
|
|
36
36
|
ApiId extends string,
|
|
37
|
-
Groups extends HttpApiGroup.
|
|
38
|
-
|
|
37
|
+
Groups extends HttpApiGroup.Constraint,
|
|
38
|
+
Identifier extends HttpApiGroup.Identifier<Groups>,
|
|
39
39
|
Type extends string,
|
|
40
40
|
Rpcs extends Rpc.Any
|
|
41
41
|
>(
|
|
42
42
|
api: HttpApi.HttpApi<ApiId, Groups>,
|
|
43
|
-
|
|
43
|
+
identifier: Identifier,
|
|
44
44
|
entity: Entity.Entity<Type, Rpcs>
|
|
45
|
-
): Layer.Layer<HttpApiGroup.
|
|
45
|
+
): Layer.Layer<HttpApiGroup.Service<ApiId, Identifier>, never, Sharding | Rpc.ServicesServer<Rpcs>> =>
|
|
46
46
|
HttpApiBuilder.group(
|
|
47
47
|
api,
|
|
48
|
-
|
|
49
|
-
Effect.fnUntraced(function*(
|
|
48
|
+
identifier,
|
|
49
|
+
Effect.fnUntraced(function*(handlers: any) {
|
|
50
50
|
const client = yield* entity.client
|
|
51
|
-
|
|
52
|
-
for (const parentRpc_ of entity.protocol.requests.values()) {
|
|
53
|
-
const parentRpc = parentRpc_ as any as Rpc.AnyWithProps
|
|
51
|
+
for (const parentRpc of entity.protocol.requests.values()) {
|
|
54
52
|
handlers = handlers
|
|
55
53
|
.handle(
|
|
56
|
-
parentRpc._tag
|
|
57
|
-
(
|
|
54
|
+
parentRpc._tag,
|
|
55
|
+
({ params, payload }: { params: { entityId: string }; payload: any }) =>
|
|
58
56
|
(client(params.entityId) as any as Record<string, (p: any) => Effect.Effect<any>>)[parentRpc._tag](
|
|
59
57
|
payload
|
|
60
58
|
).pipe(
|
|
@@ -65,11 +63,11 @@ export const layerHttpApi = <
|
|
|
65
63
|
entityId: params.entityId,
|
|
66
64
|
method: parentRpc._tag
|
|
67
65
|
})
|
|
68
|
-
)
|
|
66
|
+
)
|
|
69
67
|
)
|
|
70
68
|
.handle(
|
|
71
|
-
`${parentRpc._tag}Discard
|
|
72
|
-
(
|
|
69
|
+
`${parentRpc._tag}Discard`,
|
|
70
|
+
({ params, payload }: { params: { entityId: string }; payload: any }) =>
|
|
73
71
|
(client(params.entityId) as any as Record<string, (p: any, o: {}) => Effect.Effect<any>>)[parentRpc._tag](
|
|
74
72
|
payload,
|
|
75
73
|
{ discard: true }
|
|
@@ -81,10 +79,10 @@ export const layerHttpApi = <
|
|
|
81
79
|
entityId: params.entityId,
|
|
82
80
|
method: `${parentRpc._tag}Discard`
|
|
83
81
|
})
|
|
84
|
-
)
|
|
85
|
-
)
|
|
82
|
+
)
|
|
83
|
+
)
|
|
86
84
|
}
|
|
87
|
-
return handlers as HttpApiBuilder.Handlers<never
|
|
85
|
+
return handlers as HttpApiBuilder.Handlers<never>
|
|
88
86
|
})
|
|
89
87
|
)
|
|
90
88
|
|
|
@@ -38,7 +38,7 @@ import * as Semaphore from "../../Semaphore.ts"
|
|
|
38
38
|
import * as Stream from "../../Stream.ts"
|
|
39
39
|
import type * as Rpc from "../rpc/Rpc.ts"
|
|
40
40
|
import * as RpcClient from "../rpc/RpcClient.ts"
|
|
41
|
-
import {
|
|
41
|
+
import type { FromServer } from "../rpc/RpcMessage.ts"
|
|
42
42
|
import type { MailboxFull, PersistenceError } from "./ClusterError.ts"
|
|
43
43
|
import { AlreadyProcessingMessage, EntityNotAssignedToRunner } from "./ClusterError.ts"
|
|
44
44
|
import * as ClusterMetrics from "./ClusterMetrics.ts"
|
|
@@ -1040,7 +1040,7 @@ const make = Effect.gen(function*() {
|
|
|
1040
1040
|
spanPrefix: `${entity.type}.client`,
|
|
1041
1041
|
disableTracing: !Context.get(entity.protocol.annotations, ClusterSchema.ClientTracingEnabled),
|
|
1042
1042
|
supportsAck: true,
|
|
1043
|
-
generateRequestId: () =>
|
|
1043
|
+
generateRequestId: () => snowflakeGen.nextUnsafe() as any,
|
|
1044
1044
|
flatten: true,
|
|
1045
1045
|
onFromClient(options): Effect.Effect<
|
|
1046
1046
|
void,
|
|
@@ -1199,7 +1199,7 @@ const make = Effect.gen(function*() {
|
|
|
1199
1199
|
return write({
|
|
1200
1200
|
_tag: "Chunk",
|
|
1201
1201
|
clientId: 0,
|
|
1202
|
-
requestId:
|
|
1202
|
+
requestId: reply.requestId as any,
|
|
1203
1203
|
values: reply.values
|
|
1204
1204
|
})
|
|
1205
1205
|
}
|
|
@@ -1208,7 +1208,7 @@ const make = Effect.gen(function*() {
|
|
|
1208
1208
|
return write({
|
|
1209
1209
|
_tag: "Exit",
|
|
1210
1210
|
clientId: 0,
|
|
1211
|
-
requestId:
|
|
1211
|
+
requestId: reply.requestId as any,
|
|
1212
1212
|
exit: reply.exit
|
|
1213
1213
|
})
|
|
1214
1214
|
}
|
|
@@ -53,8 +53,8 @@ export type Snowflake = Brand.Branded<bigint, TypeId>
|
|
|
53
53
|
* @category constructors
|
|
54
54
|
* @since 4.0.0
|
|
55
55
|
*/
|
|
56
|
-
export const Snowflake = (input: string | bigint): Snowflake =>
|
|
57
|
-
typeof input === "
|
|
56
|
+
export const Snowflake = (input: string | number | bigint): Snowflake =>
|
|
57
|
+
typeof input === "bigint" ? input as Snowflake : BigInt(input) as Snowflake
|
|
58
58
|
|
|
59
59
|
/**
|
|
60
60
|
* Namespace containing support types for snowflake parts and generators.
|