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
|
@@ -40,7 +40,7 @@ export type FromClientEncoded = RequestEncoded | AckEncoded | InterruptEncoded |
|
|
|
40
40
|
* @category request
|
|
41
41
|
* @since 4.0.0
|
|
42
42
|
*/
|
|
43
|
-
export type RequestId = Branded<
|
|
43
|
+
export type RequestId = Branded<string | number, "~effect/rpc/RpcMessage/RequestId">
|
|
44
44
|
|
|
45
45
|
/**
|
|
46
46
|
* Converts a bigint or string request id into the branded `RequestId` type.
|
|
@@ -48,8 +48,7 @@ export type RequestId = Branded<bigint, "~effect/rpc/RpcMessage/RequestId">
|
|
|
48
48
|
* @category request
|
|
49
49
|
* @since 4.0.0
|
|
50
50
|
*/
|
|
51
|
-
export const RequestId = (id:
|
|
52
|
-
typeof id === "bigint" ? id as RequestId : BigInt(id) as RequestId
|
|
51
|
+
export const RequestId = (id: string | number): RequestId => id as RequestId
|
|
53
52
|
|
|
54
53
|
/**
|
|
55
54
|
* The transport-encoded RPC request envelope, including the string request id,
|
|
@@ -60,7 +59,7 @@ export const RequestId = (id: bigint | string): RequestId =>
|
|
|
60
59
|
*/
|
|
61
60
|
export interface RequestEncoded {
|
|
62
61
|
readonly _tag: "Request"
|
|
63
|
-
readonly id: string
|
|
62
|
+
readonly id: string | number
|
|
64
63
|
readonly tag: string
|
|
65
64
|
readonly payload: unknown
|
|
66
65
|
readonly headers: ReadonlyArray<[string, string]>
|
|
@@ -119,7 +118,7 @@ export interface Interrupt {
|
|
|
119
118
|
*/
|
|
120
119
|
export interface AckEncoded {
|
|
121
120
|
readonly _tag: "Ack"
|
|
122
|
-
readonly requestId: string
|
|
121
|
+
readonly requestId: string | number
|
|
123
122
|
}
|
|
124
123
|
|
|
125
124
|
/**
|
|
@@ -130,7 +129,7 @@ export interface AckEncoded {
|
|
|
130
129
|
*/
|
|
131
130
|
export interface InterruptEncoded {
|
|
132
131
|
readonly _tag: "Interrupt"
|
|
133
|
-
readonly requestId: string
|
|
132
|
+
readonly requestId: string | number
|
|
134
133
|
}
|
|
135
134
|
|
|
136
135
|
/**
|
|
@@ -229,7 +228,7 @@ export type ResponseId = Branded<number, ResponseIdTypeId>
|
|
|
229
228
|
*/
|
|
230
229
|
export interface ResponseChunkEncoded {
|
|
231
230
|
readonly _tag: "Chunk"
|
|
232
|
-
readonly requestId: string
|
|
231
|
+
readonly requestId: string | number
|
|
233
232
|
readonly values: NonEmptyReadonlyArray<unknown>
|
|
234
233
|
}
|
|
235
234
|
|
|
@@ -282,7 +281,7 @@ export type ExitEncoded<A, E> = {
|
|
|
282
281
|
*/
|
|
283
282
|
export interface ResponseExitEncoded {
|
|
284
283
|
readonly _tag: "Exit"
|
|
285
|
-
readonly requestId: string
|
|
284
|
+
readonly requestId: string | number
|
|
286
285
|
readonly exit: ExitEncoded<unknown, unknown>
|
|
287
286
|
}
|
|
288
287
|
|
|
@@ -338,7 +337,7 @@ export const ResponseExitDieEncoded = (options: {
|
|
|
338
337
|
readonly defect: unknown
|
|
339
338
|
}): ResponseExitEncoded => ({
|
|
340
339
|
_tag: "Exit",
|
|
341
|
-
requestId: options.requestId
|
|
340
|
+
requestId: options.requestId,
|
|
342
341
|
exit: {
|
|
343
342
|
_tag: "Failure",
|
|
344
343
|
cause: [{
|
|
@@ -128,9 +128,9 @@ export const jsonRpc = (options?: {
|
|
|
128
128
|
includesFraming: false,
|
|
129
129
|
makeUnsafe: () => {
|
|
130
130
|
const decoder = new TextDecoder()
|
|
131
|
-
const batches = new Map<string, {
|
|
131
|
+
const batches = new Map<string | number, {
|
|
132
132
|
readonly size: number
|
|
133
|
-
readonly responses: Map<string, RpcMessage.FromServerEncoded>
|
|
133
|
+
readonly responses: Map<string | number, RpcMessage.FromServerEncoded>
|
|
134
134
|
}>()
|
|
135
135
|
return {
|
|
136
136
|
decode: (bytes) => {
|
|
@@ -187,9 +187,9 @@ export const ndJsonRpc = (options?: {
|
|
|
187
187
|
|
|
188
188
|
function decodeJsonRpcRaw(
|
|
189
189
|
decoded: JsonRpcMessage | Array<JsonRpcMessage>,
|
|
190
|
-
batches: Map<string, {
|
|
190
|
+
batches: Map<string | number, {
|
|
191
191
|
readonly size: number
|
|
192
|
-
readonly responses: Map<string, RpcMessage.FromServerEncoded>
|
|
192
|
+
readonly responses: Map<string | number, RpcMessage.FromServerEncoded>
|
|
193
193
|
}>
|
|
194
194
|
) {
|
|
195
195
|
if (Array.isArray(decoded)) {
|
|
@@ -221,13 +221,13 @@ function decodeJsonRpcMessage(decoded: JsonRpcMessage): RpcMessage.FromClientEnc
|
|
|
221
221
|
return requestId ?
|
|
222
222
|
{
|
|
223
223
|
_tag: tag,
|
|
224
|
-
requestId
|
|
224
|
+
requestId
|
|
225
225
|
} as any :
|
|
226
226
|
{ _tag: tag } as any
|
|
227
227
|
}
|
|
228
228
|
return {
|
|
229
229
|
_tag: "Request",
|
|
230
|
-
id:
|
|
230
|
+
id: decoded.id ?? "",
|
|
231
231
|
tag: decoded.method,
|
|
232
232
|
payload: decoded.params ?? null,
|
|
233
233
|
headers: decoded.headers ?? [],
|
|
@@ -247,13 +247,13 @@ function decodeJsonRpcMessage(decoded: JsonRpcMessage): RpcMessage.FromClientEnc
|
|
|
247
247
|
} else if (decoded.chunk === true) {
|
|
248
248
|
return {
|
|
249
249
|
_tag: "Chunk",
|
|
250
|
-
requestId:
|
|
250
|
+
requestId: decoded.id ?? "",
|
|
251
251
|
values: decoded.result as any
|
|
252
252
|
}
|
|
253
253
|
}
|
|
254
254
|
return {
|
|
255
255
|
_tag: "Exit",
|
|
256
|
-
requestId:
|
|
256
|
+
requestId: decoded.id ?? "",
|
|
257
257
|
exit: decoded.error != null ?
|
|
258
258
|
{
|
|
259
259
|
_tag: "Failure",
|
|
@@ -273,9 +273,9 @@ function decodeJsonRpcMessage(decoded: JsonRpcMessage): RpcMessage.FromClientEnc
|
|
|
273
273
|
|
|
274
274
|
function encodeJsonRpcRaw(
|
|
275
275
|
response: RpcMessage.FromServerEncoded | RpcMessage.FromClientEncoded,
|
|
276
|
-
batches: Map<string, {
|
|
276
|
+
batches: Map<string | number, {
|
|
277
277
|
readonly size: number
|
|
278
|
-
readonly responses: Map<string, RpcMessage.FromServerEncoded>
|
|
278
|
+
readonly responses: Map<string | number, RpcMessage.FromServerEncoded>
|
|
279
279
|
}>
|
|
280
280
|
) {
|
|
281
281
|
if (!("requestId" in response)) {
|
|
@@ -298,9 +298,9 @@ function encodeJsonRpcResponse(
|
|
|
298
298
|
| RpcMessage.FromServerEncoded
|
|
299
299
|
| RpcMessage.FromClientEncoded
|
|
300
300
|
| Array<RpcMessage.FromServerEncoded | RpcMessage.FromClientEncoded>,
|
|
301
|
-
batches: Map<string, {
|
|
301
|
+
batches: Map<string | number, {
|
|
302
302
|
readonly size: number
|
|
303
|
-
readonly responses: Map<string, RpcMessage.FromServerEncoded>
|
|
303
|
+
readonly responses: Map<string | number, RpcMessage.FromServerEncoded>
|
|
304
304
|
}>
|
|
305
305
|
) {
|
|
306
306
|
if (Array.isArray(response) === false) {
|
|
@@ -341,7 +341,7 @@ function encodeJsonRpcMessage(response: RpcMessage.FromServerEncoded | RpcMessag
|
|
|
341
341
|
jsonrpc: "2.0",
|
|
342
342
|
method: response.tag,
|
|
343
343
|
params: response.payload,
|
|
344
|
-
id: response.id
|
|
344
|
+
id: response.id,
|
|
345
345
|
headers: response.headers,
|
|
346
346
|
traceId: response.traceId,
|
|
347
347
|
spanId: response.spanId,
|
|
@@ -361,21 +361,21 @@ function encodeJsonRpcMessage(response: RpcMessage.FromServerEncoded | RpcMessag
|
|
|
361
361
|
return {
|
|
362
362
|
jsonrpc: "2.0",
|
|
363
363
|
chunk: true,
|
|
364
|
-
id:
|
|
364
|
+
id: response.requestId,
|
|
365
365
|
result: response.values
|
|
366
366
|
}
|
|
367
367
|
case "Exit": {
|
|
368
368
|
if (response.exit._tag === "Success") {
|
|
369
369
|
return {
|
|
370
370
|
jsonrpc: "2.0",
|
|
371
|
-
id: response.requestId
|
|
371
|
+
id: response.requestId ?? undefined,
|
|
372
372
|
result: response.exit.value
|
|
373
373
|
} as any
|
|
374
374
|
}
|
|
375
375
|
const error = response.exit.cause.find((failure) => failure._tag === "Fail")
|
|
376
376
|
return {
|
|
377
377
|
jsonrpc: "2.0",
|
|
378
|
-
id: response.requestId
|
|
378
|
+
id: response.requestId ?? undefined,
|
|
379
379
|
error: response.exit._tag === "Failure" ?
|
|
380
380
|
{
|
|
381
381
|
_tag: "Cause",
|
|
@@ -67,7 +67,9 @@ import { withRun } from "./Utils.ts"
|
|
|
67
67
|
* @since 4.0.0
|
|
68
68
|
*/
|
|
69
69
|
export interface RpcServer<A extends Rpc.Any> {
|
|
70
|
-
readonly write: (clientId: number, message: FromClient<A
|
|
70
|
+
readonly write: (clientId: number, message: FromClient<A>, options?: {
|
|
71
|
+
readonly onRequest?: (<A, E, R>(effect: Effect.Effect<A, E, R>) => Effect.Effect<A, E, R>) | undefined
|
|
72
|
+
}) => Effect.Effect<void>
|
|
71
73
|
readonly disconnect: (clientId: number) => Effect.Effect<void>
|
|
72
74
|
}
|
|
73
75
|
|
|
@@ -164,7 +166,7 @@ export const makeNoSerialization: <Rpcs extends Rpc.Any>(
|
|
|
164
166
|
return Effect.void
|
|
165
167
|
})
|
|
166
168
|
|
|
167
|
-
const write = (clientId
|
|
169
|
+
const write: RpcServer<Rpcs>["write"] = (clientId, message, opts) =>
|
|
168
170
|
Effect.catchDefect(
|
|
169
171
|
Effect.withFiber((requestFiber) => {
|
|
170
172
|
if (isShutdown) return Effect.interrupt
|
|
@@ -184,7 +186,7 @@ export const makeNoSerialization: <Rpcs extends Rpc.Any>(
|
|
|
184
186
|
|
|
185
187
|
switch (message._tag) {
|
|
186
188
|
case "Request": {
|
|
187
|
-
return handleRequest(requestFiber, client, message)
|
|
189
|
+
return handleRequest(requestFiber, client, message, opts)
|
|
188
190
|
}
|
|
189
191
|
case "Ack": {
|
|
190
192
|
const latch = client.latches.get(message.requestId)
|
|
@@ -231,7 +233,8 @@ export const makeNoSerialization: <Rpcs extends Rpc.Any>(
|
|
|
231
233
|
const handleRequest = (
|
|
232
234
|
requestFiber: Fiber.Fiber<any, any>,
|
|
233
235
|
client: Client,
|
|
234
|
-
request: Request<Rpcs
|
|
236
|
+
request: Request<Rpcs>,
|
|
237
|
+
opts: Parameters<RpcServer<Rpcs>["write"]>[2]
|
|
235
238
|
): Effect.Effect<void> => {
|
|
236
239
|
if (client.fibers.has(request.id)) {
|
|
237
240
|
return Effect.interrupt
|
|
@@ -312,6 +315,9 @@ export const makeNoSerialization: <Rpcs extends Rpc.Any>(
|
|
|
312
315
|
}
|
|
313
316
|
return close ? Effect.ensuring(write, close) : write
|
|
314
317
|
})
|
|
318
|
+
if (opts?.onRequest) {
|
|
319
|
+
effect = opts.onRequest(effect)
|
|
320
|
+
}
|
|
315
321
|
if (enableTracing) {
|
|
316
322
|
const parentSpan = requestFiber.context.mapUnsafe.get(
|
|
317
323
|
Tracer.ParentSpan.key
|
|
@@ -537,7 +543,7 @@ export const make: <Rpcs extends Rpc.Any>(
|
|
|
537
543
|
schemas.encodeDefect,
|
|
538
544
|
schemas.collector,
|
|
539
545
|
Effect.provideContext(schemas.encodeChunk(response.values), schemas.context),
|
|
540
|
-
(values) => ({ _tag: "Chunk", requestId:
|
|
546
|
+
(values) => ({ _tag: "Chunk", requestId: response.requestId, values })
|
|
541
547
|
)
|
|
542
548
|
}
|
|
543
549
|
case "Exit": {
|
|
@@ -550,7 +556,7 @@ export const make: <Rpcs extends Rpc.Any>(
|
|
|
550
556
|
schemas.encodeDefect,
|
|
551
557
|
schemas.collector,
|
|
552
558
|
Effect.provideContext(schemas.encodeExit(response.exit), schemas.context),
|
|
553
|
-
(exit) => ({ _tag: "Exit", requestId:
|
|
559
|
+
(exit) => ({ _tag: "Exit", requestId: response.requestId, exit })
|
|
554
560
|
)
|
|
555
561
|
}
|
|
556
562
|
case "Defect": {
|
|
@@ -647,7 +653,7 @@ export const make: <Rpcs extends Rpc.Any>(
|
|
|
647
653
|
Effect.flatMap(encodeDefect(defect), (encodedDefect) =>
|
|
648
654
|
send(client.id, {
|
|
649
655
|
_tag: "Exit",
|
|
650
|
-
requestId
|
|
656
|
+
requestId,
|
|
651
657
|
exit: {
|
|
652
658
|
_tag: "Failure",
|
|
653
659
|
cause: [{
|
|
@@ -685,7 +691,7 @@ export const make: <Rpcs extends Rpc.Any>(
|
|
|
685
691
|
const tag = Predicate.hasProperty(request, "tag") ? (request.tag as string) : ""
|
|
686
692
|
let requestId: RequestId
|
|
687
693
|
switch (typeof request.id) {
|
|
688
|
-
case "
|
|
694
|
+
case "number":
|
|
689
695
|
case "string": {
|
|
690
696
|
requestId = RequestId(request.id)
|
|
691
697
|
break
|
|
@@ -1036,7 +1042,7 @@ export const makeProtocolWithHttpEffect: Effect.Effect<
|
|
|
1036
1042
|
if (queue.state._tag === "Done") return Effect.void
|
|
1037
1043
|
return Effect.forEach(
|
|
1038
1044
|
requestIds,
|
|
1039
|
-
(requestId) => writeRequest(id, { _tag: "Interrupt", requestId
|
|
1045
|
+
(requestId) => writeRequest(id, { _tag: "Interrupt", requestId }),
|
|
1040
1046
|
{ discard: true }
|
|
1041
1047
|
)
|
|
1042
1048
|
})
|
|
@@ -178,11 +178,12 @@ export const make = <
|
|
|
178
178
|
return self
|
|
179
179
|
}
|
|
180
180
|
|
|
181
|
-
const interruptRetryPolicy = Schedule.
|
|
182
|
-
Schedule.
|
|
183
|
-
Schedule.
|
|
184
|
-
|
|
185
|
-
Schedule.
|
|
181
|
+
const interruptRetryPolicy = Schedule.min([
|
|
182
|
+
Schedule.exponential(400, 1.5),
|
|
183
|
+
Schedule.spaced("10 seconds")
|
|
184
|
+
]).pipe(
|
|
185
|
+
Schedule.setInputType<Cause.Cause<unknown>>(),
|
|
186
|
+
Schedule.while((meta) => meta.attempt <= 10 && Cause.hasInterrupts(meta.input))
|
|
186
187
|
)
|
|
187
188
|
|
|
188
189
|
const retryOnInterrupt = (
|
|
@@ -292,7 +292,7 @@ export const raceAll = <
|
|
|
292
292
|
const engine = yield* EngineTag
|
|
293
293
|
const exit = yield* engine.deferredResult(deferred)
|
|
294
294
|
if (Option.isSome(exit)) {
|
|
295
|
-
return yield*
|
|
295
|
+
return yield* exit.value
|
|
296
296
|
}
|
|
297
297
|
return yield* into(
|
|
298
298
|
Effect.raceAll(options.effects),
|
|
@@ -239,9 +239,10 @@ export const process: <
|
|
|
239
239
|
return yield* DurableDeferred.await(deferred)
|
|
240
240
|
})
|
|
241
241
|
|
|
242
|
-
const defaultRetrySchedule = Schedule.
|
|
243
|
-
Schedule.
|
|
244
|
-
)
|
|
242
|
+
const defaultRetrySchedule = Schedule.min([
|
|
243
|
+
Schedule.exponential(500, 1.5),
|
|
244
|
+
Schedule.spaced("1 minute")
|
|
245
|
+
])
|
|
245
246
|
|
|
246
247
|
/**
|
|
247
248
|
* Create a worker effect that processes items from the durable queue.
|
|
@@ -552,9 +552,10 @@ export const makeUnsafe = (options: Encoded): WorkflowEngine["Service"] =>
|
|
|
552
552
|
)
|
|
553
553
|
})
|
|
554
554
|
|
|
555
|
-
const defaultRetrySchedule = Schedule.
|
|
556
|
-
Schedule.
|
|
557
|
-
)
|
|
555
|
+
const defaultRetrySchedule = Schedule.min([
|
|
556
|
+
Schedule.exponential(200, 1.5),
|
|
557
|
+
Schedule.spaced(30000)
|
|
558
|
+
])
|
|
558
559
|
|
|
559
560
|
/**
|
|
560
561
|
* Layer that provides an in-memory `WorkflowEngine`.
|
|
@@ -29,28 +29,27 @@ import type { WorkflowEngine } from "./WorkflowEngine.ts"
|
|
|
29
29
|
*/
|
|
30
30
|
export const layerHttpApi = <
|
|
31
31
|
ApiId extends string,
|
|
32
|
-
Groups extends HttpApiGroup.
|
|
33
|
-
|
|
32
|
+
Groups extends HttpApiGroup.Constraint,
|
|
33
|
+
Identifier extends HttpApiGroup.Identifier<Groups>,
|
|
34
34
|
const Workflows extends NonEmptyReadonlyArray<Workflow.Any>
|
|
35
35
|
>(
|
|
36
36
|
api: HttpApi.HttpApi<ApiId, Groups>,
|
|
37
|
-
|
|
37
|
+
identifier: Identifier,
|
|
38
38
|
workflows: Workflows
|
|
39
39
|
): Layer.Layer<
|
|
40
|
-
HttpApiGroup.
|
|
40
|
+
HttpApiGroup.Service<ApiId, Identifier>,
|
|
41
41
|
never,
|
|
42
42
|
WorkflowEngine | Workflow.RequirementsHandler<Workflows[number]>
|
|
43
43
|
> =>
|
|
44
44
|
HttpApiBuilder.group(
|
|
45
45
|
api,
|
|
46
|
-
|
|
47
|
-
Effect.fnUntraced(function*(
|
|
48
|
-
let handlers = handlers_ as any
|
|
46
|
+
identifier,
|
|
47
|
+
Effect.fnUntraced(function*(handlers: any) {
|
|
49
48
|
for (const workflow_ of workflows) {
|
|
50
49
|
const workflow = workflow_ as Workflow.AnyWithProps
|
|
51
50
|
handlers = handlers
|
|
52
51
|
.handle(
|
|
53
|
-
workflow._tag
|
|
52
|
+
workflow._tag,
|
|
54
53
|
({ payload }: { payload: any }) =>
|
|
55
54
|
workflow.execute(payload).pipe(
|
|
56
55
|
Effect.tapDefect(Effect.logError),
|
|
@@ -61,9 +60,9 @@ export const layerHttpApi = <
|
|
|
61
60
|
)
|
|
62
61
|
)
|
|
63
62
|
.handle(
|
|
64
|
-
workflow._tag + "Discard"
|
|
63
|
+
workflow._tag + "Discard",
|
|
65
64
|
({ payload }: { payload: any }) =>
|
|
66
|
-
workflow.execute(payload, { discard: true }
|
|
65
|
+
workflow.execute(payload, { discard: true }).pipe(
|
|
67
66
|
Effect.tapDefect(Effect.logError),
|
|
68
67
|
Effect.annotateLogs({
|
|
69
68
|
module: "WorkflowProxyServer",
|
|
@@ -72,7 +71,7 @@ export const layerHttpApi = <
|
|
|
72
71
|
)
|
|
73
72
|
)
|
|
74
73
|
.handle(
|
|
75
|
-
workflow._tag + "Resume"
|
|
74
|
+
workflow._tag + "Resume",
|
|
76
75
|
({ payload }: { payload: any }) =>
|
|
77
76
|
workflow.resume(payload.executionId).pipe(
|
|
78
77
|
Effect.tapDefect(Effect.logError),
|
|
@@ -83,7 +82,7 @@ export const layerHttpApi = <
|
|
|
83
82
|
)
|
|
84
83
|
)
|
|
85
84
|
}
|
|
86
|
-
return handlers as HttpApiBuilder.Handlers<never
|
|
85
|
+
return handlers as HttpApiBuilder.Handlers<never>
|
|
87
86
|
})
|
|
88
87
|
)
|
|
89
88
|
|