effect 4.0.3 → 4.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AGENTS.md +24 -0
- package/CLAUDE.md +24 -0
- package/ai-docs/package.json +2 -2
- package/ai-docs/src/52_graphql/10_basics.ts +117 -0
- package/ai-docs/src/52_graphql/20_testing.ts +45 -0
- package/ai-docs/src/52_graphql/30_batching.ts +118 -0
- package/ai-docs/src/52_graphql/40_aliased-batching.ts +124 -0
- package/ai-docs/src/52_graphql/50_errors-and-retries.ts +74 -0
- package/ai-docs/src/52_graphql/index.md +6 -0
- package/dist/Array.d.ts +90 -6
- package/dist/Array.d.ts.map +1 -1
- package/dist/Array.js +4 -2
- package/dist/Array.js.map +1 -1
- package/dist/Channel.d.ts +6 -1
- package/dist/Channel.d.ts.map +1 -1
- package/dist/Channel.js +17 -3
- package/dist/Channel.js.map +1 -1
- package/dist/ConfigProvider.d.ts.map +1 -1
- package/dist/ConfigProvider.js +33 -32
- package/dist/ConfigProvider.js.map +1 -1
- package/dist/Context.d.ts.map +1 -1
- package/dist/Context.js +9 -0
- package/dist/Context.js.map +1 -1
- package/dist/Duration.d.ts.map +1 -1
- package/dist/Duration.js +2 -5
- package/dist/Duration.js.map +1 -1
- package/dist/Effect.d.ts +61 -19
- package/dist/Effect.d.ts.map +1 -1
- package/dist/Effect.js +58 -39
- package/dist/Effect.js.map +1 -1
- package/dist/FileSystem.d.ts +23 -9
- package/dist/FileSystem.d.ts.map +1 -1
- package/dist/FileSystem.js.map +1 -1
- package/dist/Match.d.ts +20 -6
- package/dist/Match.d.ts.map +1 -1
- package/dist/Match.js +2 -2
- package/dist/Match.js.map +1 -1
- package/dist/Path.d.ts +37 -5
- package/dist/Path.d.ts.map +1 -1
- package/dist/Path.js +36 -5
- package/dist/Path.js.map +1 -1
- package/dist/RequestResolver.d.ts.map +1 -1
- package/dist/RequestResolver.js +4 -10
- package/dist/RequestResolver.js.map +1 -1
- package/dist/Scheduler.d.ts +9 -0
- package/dist/Scheduler.d.ts.map +1 -1
- package/dist/Scheduler.js +9 -0
- package/dist/Scheduler.js.map +1 -1
- package/dist/Schema.d.ts +15 -2
- package/dist/Schema.d.ts.map +1 -1
- package/dist/Schema.js +16 -2
- package/dist/Schema.js.map +1 -1
- package/dist/SchemaGetter.d.ts +4 -0
- package/dist/SchemaGetter.d.ts.map +1 -1
- package/dist/SchemaGetter.js +52 -33
- package/dist/SchemaGetter.js.map +1 -1
- package/dist/Sink.d.ts.map +1 -1
- package/dist/Sink.js +38 -17
- package/dist/Sink.js.map +1 -1
- package/dist/Stream.d.ts +11 -0
- package/dist/Stream.d.ts.map +1 -1
- package/dist/Stream.js +16 -1
- package/dist/Stream.js.map +1 -1
- package/dist/String.d.ts +12 -0
- package/dist/String.d.ts.map +1 -1
- package/dist/String.js +17 -4
- package/dist/String.js.map +1 -1
- package/dist/TxRef.d.ts.map +1 -1
- package/dist/TxRef.js +3 -2
- package/dist/TxRef.js.map +1 -1
- package/dist/Utils.js +8 -3
- package/dist/Utils.js.map +1 -1
- package/dist/ai/AiError.d.ts +10 -10
- package/dist/ai/AiError.d.ts.map +1 -1
- package/dist/ai/AiError.js +1 -1
- package/dist/ai/AiError.js.map +1 -1
- package/dist/ai/AnthropicStructuredOutput.js +0 -2
- package/dist/ai/AnthropicStructuredOutput.js.map +1 -1
- package/dist/ai/Chat.d.ts +2 -2
- package/dist/ai/Chat.d.ts.map +1 -1
- package/dist/ai/Decision.d.ts +70 -19
- package/dist/ai/Decision.d.ts.map +1 -1
- package/dist/ai/Decision.js +37 -3
- package/dist/ai/Decision.js.map +1 -1
- package/dist/ai/DecisionModel.js +1 -1
- package/dist/ai/DecisionModel.js.map +1 -1
- package/dist/ai/LanguageModel.d.ts +38 -7
- package/dist/ai/LanguageModel.d.ts.map +1 -1
- package/dist/ai/LanguageModel.js +70 -40
- package/dist/ai/LanguageModel.js.map +1 -1
- package/dist/ai/McpServer.d.ts +61 -52
- package/dist/ai/McpServer.d.ts.map +1 -1
- package/dist/ai/McpServer.js +134 -50
- package/dist/ai/McpServer.js.map +1 -1
- package/dist/ai/Prompt.d.ts.map +1 -1
- package/dist/ai/Prompt.js +28 -5
- package/dist/ai/Prompt.js.map +1 -1
- package/dist/ai/Response.d.ts +5 -4
- package/dist/ai/Response.d.ts.map +1 -1
- package/dist/ai/Response.js.map +1 -1
- package/dist/cli/Completions.d.ts +5 -0
- package/dist/cli/Completions.d.ts.map +1 -1
- package/dist/cli/Completions.js.map +1 -1
- package/dist/cli/Flag.d.ts +100 -0
- package/dist/cli/Flag.d.ts.map +1 -1
- package/dist/cli/Flag.js +33 -0
- package/dist/cli/Flag.js.map +1 -1
- package/dist/cli/Param.d.ts +87 -0
- package/dist/cli/Param.d.ts.map +1 -1
- package/dist/cli/Param.js +30 -0
- package/dist/cli/Param.js.map +1 -1
- package/dist/cli/internal/command.d.ts.map +1 -1
- package/dist/cli/internal/command.js +2 -1
- package/dist/cli/internal/command.js.map +1 -1
- package/dist/cli/internal/completions/bash.js +4 -3
- package/dist/cli/internal/completions/bash.js.map +1 -1
- package/dist/cli/internal/completions/descriptor.js +8 -1
- package/dist/cli/internal/completions/descriptor.js.map +1 -1
- package/dist/cli/internal/completions/fish.js +4 -4
- package/dist/cli/internal/completions/fish.js.map +1 -1
- package/dist/cli/internal/completions/powershell.js +3 -2
- package/dist/cli/internal/completions/powershell.js.map +1 -1
- package/dist/cli/internal/completions/zsh.js +7 -3
- package/dist/cli/internal/completions/zsh.js.map +1 -1
- package/dist/cli/internal/parser.js +11 -3
- package/dist/cli/internal/parser.js.map +1 -1
- package/dist/cli/internal/wizard.d.ts.map +1 -1
- package/dist/cli/internal/wizard.js +2 -1
- package/dist/cli/internal/wizard.js.map +1 -1
- package/dist/cluster/ClusterWorkflowEngine.d.ts +1 -0
- package/dist/cluster/ClusterWorkflowEngine.d.ts.map +1 -1
- package/dist/cluster/ClusterWorkflowEngine.js +113 -21
- package/dist/cluster/ClusterWorkflowEngine.js.map +1 -1
- package/dist/cluster/MessageStorage.d.ts.map +1 -1
- package/dist/cluster/MessageStorage.js +20 -12
- package/dist/cluster/MessageStorage.js.map +1 -1
- package/dist/cluster/Runners.d.ts.map +1 -1
- package/dist/cluster/Runners.js +54 -34
- package/dist/cluster/Runners.js.map +1 -1
- package/dist/cluster/Sharding.d.ts.map +1 -1
- package/dist/cluster/Sharding.js +6 -4
- package/dist/cluster/Sharding.js.map +1 -1
- package/dist/cluster/internal/entityManager.js +1 -1
- package/dist/cluster/internal/entityManager.js.map +1 -1
- package/dist/encoding/Sse.d.ts +6 -0
- package/dist/encoding/Sse.d.ts.map +1 -1
- package/dist/encoding/Sse.js +63 -71
- package/dist/encoding/Sse.js.map +1 -1
- package/dist/graphql/GraphQL.d.ts +349 -0
- package/dist/graphql/GraphQL.d.ts.map +1 -0
- package/dist/graphql/GraphQL.js +207 -0
- package/dist/graphql/GraphQL.js.map +1 -0
- package/dist/graphql/GraphQLClient.d.ts +562 -0
- package/dist/graphql/GraphQLClient.d.ts.map +1 -0
- package/dist/graphql/GraphQLClient.js +505 -0
- package/dist/graphql/GraphQLClient.js.map +1 -0
- package/dist/graphql/GraphQLClientError.d.ts +445 -0
- package/dist/graphql/GraphQLClientError.d.ts.map +1 -0
- package/dist/graphql/GraphQLClientError.js +479 -0
- package/dist/graphql/GraphQLClientError.js.map +1 -0
- package/dist/graphql/GraphQLGroup.d.ts +118 -0
- package/dist/graphql/GraphQLGroup.d.ts.map +1 -0
- package/dist/graphql/GraphQLGroup.js +109 -0
- package/dist/graphql/GraphQLGroup.js.map +1 -0
- package/dist/graphql/GraphQLMiddleware.d.ts +249 -0
- package/dist/graphql/GraphQLMiddleware.d.ts.map +1 -0
- package/dist/graphql/GraphQLMiddleware.js +130 -0
- package/dist/graphql/GraphQLMiddleware.js.map +1 -0
- package/dist/graphql/GraphQLProtocol.d.ts +969 -0
- package/dist/graphql/GraphQLProtocol.d.ts.map +1 -0
- package/dist/graphql/GraphQLProtocol.js +809 -0
- package/dist/graphql/GraphQLProtocol.js.map +1 -0
- package/dist/graphql/GraphQLResolver.d.ts +453 -0
- package/dist/graphql/GraphQLResolver.d.ts.map +1 -0
- package/dist/graphql/GraphQLResolver.js +582 -0
- package/dist/graphql/GraphQLResolver.js.map +1 -0
- package/dist/graphql/index.d.ts +40 -0
- package/dist/graphql/index.d.ts.map +1 -0
- package/dist/graphql/index.js +41 -0
- package/dist/graphql/index.js.map +1 -0
- package/dist/http/FetchHttpClient.d.ts +6 -3
- package/dist/http/FetchHttpClient.d.ts.map +1 -1
- package/dist/http/FetchHttpClient.js +6 -3
- package/dist/http/FetchHttpClient.js.map +1 -1
- package/dist/http/FindMyWay/internal/router.js +2 -1
- package/dist/http/FindMyWay/internal/router.js.map +1 -1
- package/dist/http/Headers.d.ts +3 -3
- package/dist/http/Headers.d.ts.map +1 -1
- package/dist/http/Headers.js +6 -5
- package/dist/http/Headers.js.map +1 -1
- package/dist/http/HttpClient.d.ts +27 -0
- package/dist/http/HttpClient.d.ts.map +1 -1
- package/dist/http/HttpClient.js +38 -11
- package/dist/http/HttpClient.js.map +1 -1
- package/dist/http/HttpClientError.d.ts.map +1 -1
- package/dist/http/HttpClientError.js +8 -6
- package/dist/http/HttpClientError.js.map +1 -1
- package/dist/http/HttpClientRequest.d.ts +147 -4
- package/dist/http/HttpClientRequest.d.ts.map +1 -1
- package/dist/http/HttpClientRequest.js +47 -1
- package/dist/http/HttpClientRequest.js.map +1 -1
- package/dist/http/HttpEffect.d.ts.map +1 -1
- package/dist/http/HttpEffect.js +14 -7
- package/dist/http/HttpEffect.js.map +1 -1
- package/dist/http/HttpMiddleware.d.ts +60 -0
- package/dist/http/HttpMiddleware.d.ts.map +1 -1
- package/dist/http/HttpMiddleware.js +93 -32
- package/dist/http/HttpMiddleware.js.map +1 -1
- package/dist/http/HttpRouter.d.ts +35 -0
- package/dist/http/HttpRouter.d.ts.map +1 -1
- package/dist/http/HttpRouter.js +87 -13
- package/dist/http/HttpRouter.js.map +1 -1
- package/dist/http/HttpServerError.d.ts.map +1 -1
- package/dist/http/HttpServerError.js +6 -4
- package/dist/http/HttpServerError.js.map +1 -1
- package/dist/http/HttpServerRequest.js +2 -2
- package/dist/http/HttpServerRequest.js.map +1 -1
- package/dist/http/HttpServerResponse.d.ts +8 -6
- package/dist/http/HttpServerResponse.d.ts.map +1 -1
- package/dist/http/HttpServerResponse.js +27 -16
- package/dist/http/HttpServerResponse.js.map +1 -1
- package/dist/http/HttpStaticServer.d.ts.map +1 -1
- package/dist/http/HttpStaticServer.js +4 -10
- package/dist/http/HttpStaticServer.js.map +1 -1
- package/dist/http/HttpTraceContext.js +1 -1
- package/dist/http/HttpTraceContext.js.map +1 -1
- package/dist/http/Multipart.d.ts.map +1 -1
- package/dist/http/Multipart.js +15 -1
- package/dist/http/Multipart.js.map +1 -1
- package/dist/http/Url.d.ts.map +1 -1
- package/dist/http/Url.js +2 -1
- package/dist/http/Url.js.map +1 -1
- package/dist/http/UrlParams.d.ts +112 -8
- package/dist/http/UrlParams.d.ts.map +1 -1
- package/dist/http/UrlParams.js +141 -14
- package/dist/http/UrlParams.js.map +1 -1
- package/dist/http/internal/compression.d.ts +1 -1
- package/dist/http/internal/compression.d.ts.map +1 -1
- package/dist/http/internal/compression.js +2 -10
- package/dist/http/internal/compression.js.map +1 -1
- package/dist/http/internal/compressionBody.d.ts +2 -0
- package/dist/http/internal/compressionBody.d.ts.map +1 -0
- package/dist/http/internal/compressionBody.js +36 -0
- package/dist/http/internal/compressionBody.js.map +1 -0
- package/dist/http/internal/decompression.d.ts +2 -0
- package/dist/http/internal/decompression.d.ts.map +1 -0
- package/dist/http/internal/decompression.js +162 -0
- package/dist/http/internal/decompression.js.map +1 -0
- package/dist/http/internal/tracing.js +14 -4
- package/dist/http/internal/tracing.js.map +1 -1
- package/dist/http/internal/urlParams.d.ts +2 -0
- package/dist/http/internal/urlParams.d.ts.map +1 -0
- package/dist/http/internal/urlParams.js +4 -0
- package/dist/http/internal/urlParams.js.map +1 -0
- package/dist/http-api/HttpApiClient.d.ts.map +1 -1
- package/dist/http-api/HttpApiClient.js +2 -1
- package/dist/http-api/HttpApiClient.js.map +1 -1
- package/dist/http-api/HttpApiScalar.d.ts +5 -0
- package/dist/http-api/HttpApiScalar.d.ts.map +1 -1
- package/dist/http-api/HttpApiScalar.js.map +1 -1
- package/dist/internal/core.js +17 -1
- package/dist/internal/core.js.map +1 -1
- package/dist/internal/dateTime.js +40 -35
- package/dist/internal/dateTime.js.map +1 -1
- package/dist/internal/effect.js +13 -6
- package/dist/internal/effect.js.map +1 -1
- package/dist/internal/graphql.d.ts +2 -0
- package/dist/internal/graphql.d.ts.map +1 -0
- package/dist/internal/graphql.js +205 -0
- package/dist/internal/graphql.js.map +1 -0
- package/dist/internal/graphqlHeaders.d.ts +4 -0
- package/dist/internal/graphqlHeaders.d.ts.map +1 -0
- package/dist/internal/graphqlHeaders.js +11 -0
- package/dist/internal/graphqlHeaders.js.map +1 -0
- package/dist/internal/request.js +20 -1
- package/dist/internal/request.js.map +1 -1
- package/dist/internal/schema/toCodeDocument.js +4 -1
- package/dist/internal/schema/toCodeDocument.js.map +1 -1
- package/dist/internal/schema/toJsonSchemaDocument.js +29 -5
- package/dist/internal/schema/toJsonSchemaDocument.js.map +1 -1
- package/dist/internal/version.js +1 -1
- package/dist/net/Host.d.ts +49 -0
- package/dist/net/Host.d.ts.map +1 -1
- package/dist/net/Host.js +55 -0
- package/dist/net/Host.js.map +1 -1
- package/dist/net/NetAddress.d.ts +8 -0
- package/dist/net/NetAddress.d.ts.map +1 -1
- package/dist/net/NetAddress.js +8 -0
- package/dist/net/NetAddress.js.map +1 -1
- package/dist/observability/Otlp.d.ts +15 -0
- package/dist/observability/Otlp.d.ts.map +1 -1
- package/dist/observability/Otlp.js +3 -0
- package/dist/observability/Otlp.js.map +1 -1
- package/dist/observability/OtlpExporter.d.ts +8 -0
- package/dist/observability/OtlpExporter.d.ts.map +1 -1
- package/dist/observability/OtlpExporter.js +10 -1
- package/dist/observability/OtlpExporter.js.map +1 -1
- package/dist/observability/OtlpLogger.d.ts +17 -0
- package/dist/observability/OtlpLogger.d.ts.map +1 -1
- package/dist/observability/OtlpLogger.js +14 -1
- package/dist/observability/OtlpLogger.js.map +1 -1
- package/dist/observability/OtlpMetrics.d.ts +17 -0
- package/dist/observability/OtlpMetrics.d.ts.map +1 -1
- package/dist/observability/OtlpMetrics.js +13 -0
- package/dist/observability/OtlpMetrics.js.map +1 -1
- package/dist/observability/OtlpTracer.d.ts +17 -0
- package/dist/observability/OtlpTracer.d.ts.map +1 -1
- package/dist/observability/OtlpTracer.js +15 -2
- package/dist/observability/OtlpTracer.js.map +1 -1
- package/dist/reactivity/AsyncResult.d.ts +6 -0
- package/dist/reactivity/AsyncResult.d.ts.map +1 -1
- package/dist/reactivity/AsyncResult.js +27 -0
- package/dist/reactivity/AsyncResult.js.map +1 -1
- package/dist/reactivity/AtomRegistry.js +3 -1
- package/dist/reactivity/AtomRegistry.js.map +1 -1
- package/dist/rpc/RpcClient.d.ts.map +1 -1
- package/dist/rpc/RpcClient.js +6 -1
- package/dist/rpc/RpcClient.js.map +1 -1
- package/dist/rpc/RpcServer.d.ts.map +1 -1
- package/dist/rpc/RpcServer.js +36 -9
- package/dist/rpc/RpcServer.js.map +1 -1
- package/dist/socket/Socket.d.ts +6 -0
- package/dist/socket/Socket.d.ts.map +1 -1
- package/dist/socket/Socket.js.map +1 -1
- package/dist/sql/SqlClient.d.ts +8 -7
- package/dist/sql/SqlClient.d.ts.map +1 -1
- package/dist/sql/SqlClient.js +8 -7
- package/dist/sql/SqlClient.js.map +1 -1
- package/dist/testing/TestClock.d.ts +16 -3
- package/dist/testing/TestClock.d.ts.map +1 -1
- package/dist/testing/TestClock.js +112 -22
- package/dist/testing/TestClock.js.map +1 -1
- package/dist/workflow/Activity.js +1 -0
- package/dist/workflow/Activity.js.map +1 -1
- package/dist/workflow/DurableDeferred.d.ts.map +1 -1
- package/dist/workflow/DurableDeferred.js +32 -3
- package/dist/workflow/DurableDeferred.js.map +1 -1
- package/dist/workflow/Workflow.d.ts +22 -0
- package/dist/workflow/Workflow.d.ts.map +1 -1
- package/dist/workflow/Workflow.js +15 -3
- package/dist/workflow/Workflow.js.map +1 -1
- package/dist/workflow/WorkflowEngine.d.ts +44 -3
- package/dist/workflow/WorkflowEngine.d.ts.map +1 -1
- package/dist/workflow/WorkflowEngine.js +45 -22
- package/dist/workflow/WorkflowEngine.js.map +1 -1
- package/package.json +6 -3
- package/src/Array.ts +95 -6
- package/src/Channel.ts +24 -3
- package/src/ConfigProvider.ts +40 -44
- package/src/Context.ts +9 -0
- package/src/Duration.ts +4 -5
- package/src/Effect.ts +140 -53
- package/src/FileSystem.ts +23 -9
- package/src/Match.ts +65 -12
- package/src/Path.ts +52 -7
- package/src/RequestResolver.ts +4 -10
- package/src/Scheduler.ts +9 -0
- package/src/Schema.ts +25 -4
- package/src/SchemaGetter.ts +47 -35
- package/src/Sink.ts +45 -18
- package/src/Stream.ts +33 -4
- package/src/String.ts +17 -4
- package/src/TxRef.ts +4 -2
- package/src/Utils.ts +8 -5
- package/src/ai/AiError.ts +3 -1
- package/src/ai/AnthropicStructuredOutput.ts +2 -2
- package/src/ai/Chat.ts +2 -2
- package/src/ai/Decision.ts +70 -21
- package/src/ai/DecisionModel.ts +1 -1
- package/src/ai/LanguageModel.ts +141 -63
- package/src/ai/McpServer.ts +259 -145
- package/src/ai/Prompt.ts +24 -10
- package/src/ai/Response.ts +6 -3
- package/src/cli/Completions.ts +5 -0
- package/src/cli/Flag.ts +101 -0
- package/src/cli/Param.ts +96 -0
- package/src/cli/internal/command.ts +2 -1
- package/src/cli/internal/completions/bash.ts +4 -3
- package/src/cli/internal/completions/descriptor.ts +10 -1
- package/src/cli/internal/completions/fish.ts +4 -4
- package/src/cli/internal/completions/powershell.ts +5 -2
- package/src/cli/internal/completions/zsh.ts +7 -3
- package/src/cli/internal/parser.ts +12 -3
- package/src/cli/internal/wizard.ts +2 -1
- package/src/cluster/ClusterWorkflowEngine.ts +143 -36
- package/src/cluster/MessageStorage.ts +14 -3
- package/src/cluster/Runners.ts +88 -66
- package/src/cluster/Sharding.ts +12 -9
- package/src/cluster/internal/entityManager.ts +1 -1
- package/src/encoding/Sse.ts +70 -80
- package/src/graphql/GraphQL.ts +494 -0
- package/src/graphql/GraphQLClient.ts +924 -0
- package/src/graphql/GraphQLClientError.ts +542 -0
- package/src/graphql/GraphQLGroup.ts +167 -0
- package/src/graphql/GraphQLMiddleware.ts +253 -0
- package/src/graphql/GraphQLProtocol.ts +1540 -0
- package/src/graphql/GraphQLResolver.ts +1038 -0
- package/src/graphql/index.ts +48 -0
- package/src/http/FetchHttpClient.ts +6 -3
- package/src/http/FindMyWay/internal/router.ts +2 -1
- package/src/http/Headers.ts +6 -9
- package/src/http/HttpClient.ts +72 -11
- package/src/http/HttpClientError.ts +10 -6
- package/src/http/HttpClientRequest.ts +173 -7
- package/src/http/HttpEffect.ts +11 -5
- package/src/http/HttpMiddleware.ts +113 -34
- package/src/http/HttpRouter.ts +95 -13
- package/src/http/HttpServerError.ts +8 -4
- package/src/http/HttpServerRequest.ts +2 -2
- package/src/http/HttpServerResponse.ts +28 -16
- package/src/http/HttpStaticServer.ts +4 -10
- package/src/http/HttpTraceContext.ts +1 -1
- package/src/http/Multipart.ts +17 -1
- package/src/http/Url.ts +2 -1
- package/src/http/UrlParams.ts +225 -26
- package/src/http/internal/compression.ts +3 -17
- package/src/http/internal/compressionBody.ts +56 -0
- package/src/http/internal/decompression.ts +226 -0
- package/src/http/internal/tracing.ts +21 -4
- package/src/http/internal/urlParams.ts +5 -0
- package/src/http-api/HttpApiClient.ts +2 -1
- package/src/http-api/HttpApiScalar.ts +5 -0
- package/src/internal/core.ts +21 -1
- package/src/internal/dateTime.ts +13 -10
- package/src/internal/effect.ts +13 -7
- package/src/internal/graphql.ts +286 -0
- package/src/internal/graphqlHeaders.ts +11 -0
- package/src/internal/request.ts +31 -3
- package/src/internal/schema/toCodeDocument.ts +7 -1
- package/src/internal/schema/toJsonSchemaDocument.ts +34 -2
- package/src/internal/version.ts +1 -1
- package/src/net/Host.ts +72 -0
- package/src/net/NetAddress.ts +9 -0
- package/src/observability/Otlp.ts +18 -0
- package/src/observability/OtlpExporter.ts +14 -3
- package/src/observability/OtlpLogger.ts +31 -2
- package/src/observability/OtlpMetrics.ts +30 -1
- package/src/observability/OtlpTracer.ts +32 -3
- package/src/reactivity/AsyncResult.ts +31 -0
- package/src/reactivity/AtomRegistry.ts +3 -1
- package/src/rpc/RpcClient.ts +6 -1
- package/src/rpc/RpcServer.ts +55 -15
- package/src/socket/Socket.ts +6 -0
- package/src/sql/SqlClient.ts +9 -7
- package/src/testing/TestClock.ts +144 -29
- package/src/workflow/Activity.ts +1 -0
- package/src/workflow/DurableDeferred.ts +43 -5
- package/src/workflow/Workflow.ts +31 -5
- package/src/workflow/WorkflowEngine.ts +107 -25
|
@@ -0,0 +1,445 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Serializable GraphQL client errors with an operation name and a
|
|
3
|
+
* `Schema.TaggedError` reason.
|
|
4
|
+
*
|
|
5
|
+
* @stability experimental
|
|
6
|
+
* @since 4.0.0
|
|
7
|
+
*/
|
|
8
|
+
import * as Duration from "../Duration.ts";
|
|
9
|
+
import type * as Headers from "../http/Headers.ts";
|
|
10
|
+
import type * as HttpClientError from "../http/HttpClientError.ts";
|
|
11
|
+
import * as Schema from "../Schema.ts";
|
|
12
|
+
declare const TypeId = "~effect/graphql/GraphQLClientError";
|
|
13
|
+
/**
|
|
14
|
+
* One entry of a GraphQL response's `errors` array, as described by the
|
|
15
|
+
* GraphQL specification.
|
|
16
|
+
*
|
|
17
|
+
* **Details**
|
|
18
|
+
*
|
|
19
|
+
* `path[0]` is the response key the error belongs to, which is the alias when
|
|
20
|
+
* the document used one, so callers can match an error to the field it hit.
|
|
21
|
+
* Unknown top-level fields are preserved as JSON values, including GitHub's
|
|
22
|
+
* `type` field.
|
|
23
|
+
*
|
|
24
|
+
* **Example** (Finding which alias an error belongs to)
|
|
25
|
+
*
|
|
26
|
+
* ```ts import.meta.vitest
|
|
27
|
+
* import { Schema } from "effect"
|
|
28
|
+
* import { GraphQLClientError } from "effect/graphql"
|
|
29
|
+
*
|
|
30
|
+
* const error = Schema.decodeUnknownSync(GraphQLClientError.GraphQLError)({
|
|
31
|
+
* message: "Could not resolve to a Repository",
|
|
32
|
+
* path: ["missing", "issues"],
|
|
33
|
+
* type: "NOT_FOUND"
|
|
34
|
+
* })
|
|
35
|
+
*
|
|
36
|
+
* error.path?.[0] // => "missing"
|
|
37
|
+
* ```
|
|
38
|
+
*
|
|
39
|
+
* @stability experimental
|
|
40
|
+
* @category schemas
|
|
41
|
+
* @since 4.0.0
|
|
42
|
+
*/
|
|
43
|
+
export declare const GraphQLError: Schema.StructWithRest<Schema.Struct<{
|
|
44
|
+
readonly message: Schema.String;
|
|
45
|
+
readonly locations: Schema.optional<Schema.$Array<Schema.Struct<{
|
|
46
|
+
readonly line: Schema.Number;
|
|
47
|
+
readonly column: Schema.Number;
|
|
48
|
+
}>>>;
|
|
49
|
+
readonly path: Schema.optional<Schema.$Array<Schema.Union<readonly [Schema.String, Schema.Number]>>>;
|
|
50
|
+
readonly extensions: Schema.optional<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
|
|
51
|
+
}>, readonly [Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>]>;
|
|
52
|
+
/**
|
|
53
|
+
* The decoded type of {@link GraphQLError}.
|
|
54
|
+
*
|
|
55
|
+
* @stability experimental
|
|
56
|
+
* @category models
|
|
57
|
+
* @since 4.0.0
|
|
58
|
+
*/
|
|
59
|
+
export type GraphQLError = typeof GraphQLError.Type;
|
|
60
|
+
declare const ResponseError_base: Schema.Class<ResponseError, Schema.TaggedStruct<"ResponseError", {
|
|
61
|
+
readonly errors: Schema.NonEmptyArray<Schema.StructWithRest<Schema.Struct<{
|
|
62
|
+
readonly message: Schema.String;
|
|
63
|
+
readonly locations: Schema.optional<Schema.$Array<Schema.Struct<{
|
|
64
|
+
readonly line: Schema.Number;
|
|
65
|
+
readonly column: Schema.Number;
|
|
66
|
+
}>>>;
|
|
67
|
+
readonly path: Schema.optional<Schema.$Array<Schema.Union<readonly [Schema.String, Schema.Number]>>>;
|
|
68
|
+
readonly extensions: Schema.optional<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
|
|
69
|
+
}>, readonly [Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>]>>;
|
|
70
|
+
readonly data: Schema.optional<Schema.Codec<Schema.Json, Schema.Json, never, never>>;
|
|
71
|
+
readonly extensions: Schema.optional<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
|
|
72
|
+
readonly status: Schema.optional<Schema.Int>;
|
|
73
|
+
readonly headers: Schema.optional<Schema.decodeTo<Schema.declare<Headers.Headers, Headers.Headers>, Schema.$Record<Schema.String, Schema.String>, never, never>>;
|
|
74
|
+
}>, import("../Cause.ts").YieldableError>;
|
|
75
|
+
/**
|
|
76
|
+
* The server answered with a non-empty `errors` array.
|
|
77
|
+
*
|
|
78
|
+
* **Details**
|
|
79
|
+
*
|
|
80
|
+
* Queries and mutations fail even when partial `data` is present, since a
|
|
81
|
+
* field error's `null` cannot be distinguished from a genuine `null`. Use
|
|
82
|
+
* `{ partial: true }` to receive decoded `{ data, errors }` instead.
|
|
83
|
+
*
|
|
84
|
+
* On this error, `data` is raw. `GraphQLError.path[0]` identifies the response
|
|
85
|
+
* key (or alias). Non-2xx HTTP responses with a GraphQL body also use this
|
|
86
|
+
* reason rather than `TransportError`.
|
|
87
|
+
*
|
|
88
|
+
* `status` and `headers` are the HTTP status and response headers, as the
|
|
89
|
+
* transport reported them and middleware left them. Headers use
|
|
90
|
+
* `Headers.Headers` at runtime and encode as a plain string record.
|
|
91
|
+
* Decoding restores the normalized header collection. Both are unset over
|
|
92
|
+
* graphql-ws, and `status` is unset for graphql-sse events. `retryAfter`
|
|
93
|
+
* parses the `Retry-After` response header as whole seconds or an HTTP date,
|
|
94
|
+
* measured from `Date.now()` when the error is constructed. `isRetryable` is
|
|
95
|
+
* true for HTTP status `429` or `500`–`599`, and for any response with a
|
|
96
|
+
* valid `Retry-After`, whatever its status. It is false otherwise, including
|
|
97
|
+
* when there is no status.
|
|
98
|
+
*
|
|
99
|
+
* For queries and mutations, callers opt into retries with `Effect.retry`,
|
|
100
|
+
* and should wait for `retryAfter` when it is set. With
|
|
101
|
+
* `GraphQLClient.pages`, retry each page's call, not the stream:
|
|
102
|
+
* `Stream.retry` starts again from the first page. Subscriptions retry a
|
|
103
|
+
* retryable `ResponseError` on their own, by resubscribing. graphql-sse events
|
|
104
|
+
* carry the stream response's headers, so an event with `errors` is retried
|
|
105
|
+
* when that response had a valid `Retry-After`, and ends the stream
|
|
106
|
+
* otherwise.
|
|
107
|
+
*
|
|
108
|
+
* **Example** (Inspecting the errors of a failed call)
|
|
109
|
+
*
|
|
110
|
+
* ```ts import.meta.vitest
|
|
111
|
+
* import { GraphQLClientError } from "effect/graphql"
|
|
112
|
+
*
|
|
113
|
+
* const reason = new GraphQLClientError.ResponseError({
|
|
114
|
+
* errors: [{ message: "Not found", path: ["repository"] }],
|
|
115
|
+
* data: { repository: null },
|
|
116
|
+
* status: 200
|
|
117
|
+
* })
|
|
118
|
+
*
|
|
119
|
+
* reason.isRetryable // => false
|
|
120
|
+
* reason.status // => 200
|
|
121
|
+
* reason.errors.map((error) => error.path?.[0]) // => ["repository"]
|
|
122
|
+
* ```
|
|
123
|
+
*
|
|
124
|
+
* **Example** (Retrying a call on retryable errors)
|
|
125
|
+
*
|
|
126
|
+
* ```ts import.meta.vitest
|
|
127
|
+
* import { Effect } from "effect"
|
|
128
|
+
* import { GraphQLClientError } from "effect/graphql"
|
|
129
|
+
*
|
|
130
|
+
* const call = Effect.fail(new GraphQLClientError.GraphQLClientError({
|
|
131
|
+
* operation: "Viewer",
|
|
132
|
+
* reason: new GraphQLClientError.ResponseError({
|
|
133
|
+
* errors: [{ message: "Query timed out" }],
|
|
134
|
+
* status: 502
|
|
135
|
+
* })
|
|
136
|
+
* }))
|
|
137
|
+
*
|
|
138
|
+
* const retried = Effect.retry(call, {
|
|
139
|
+
* while: (error) => error.reason.isRetryable,
|
|
140
|
+
* times: 3
|
|
141
|
+
* })
|
|
142
|
+
* ```
|
|
143
|
+
*
|
|
144
|
+
* @stability experimental
|
|
145
|
+
* @category errors
|
|
146
|
+
* @since 4.0.0
|
|
147
|
+
*/
|
|
148
|
+
export declare class ResponseError extends ResponseError_base {
|
|
149
|
+
#private;
|
|
150
|
+
/**
|
|
151
|
+
* `true` for HTTP status `429` or `500`–`599`, or when the response has a
|
|
152
|
+
* `Retry-After` header that parses, at any status, including a graphql-sse
|
|
153
|
+
* event whose stream response had one; `false` otherwise, including when
|
|
154
|
+
* there is no status and no `Retry-After`. Use this as the `while` predicate
|
|
155
|
+
* of `Effect.retry` on the call, and {@link retryAfter} as the delay when it
|
|
156
|
+
* is set. Subscriptions resubscribe on it.
|
|
157
|
+
*
|
|
158
|
+
* @since 4.0.0
|
|
159
|
+
*/
|
|
160
|
+
get isRetryable(): boolean;
|
|
161
|
+
/**
|
|
162
|
+
* The `Retry-After` response header parsed as whole seconds or an HTTP
|
|
163
|
+
* date. An HTTP date is measured from `Date.now()` when the error is
|
|
164
|
+
* constructed, so every read returns the same delay. Missing or invalid
|
|
165
|
+
* values yield `undefined`. `Effect.retry` does not apply this delay
|
|
166
|
+
* automatically.
|
|
167
|
+
*
|
|
168
|
+
* @since 4.0.0
|
|
169
|
+
*/
|
|
170
|
+
get retryAfter(): Duration.Duration | undefined;
|
|
171
|
+
get message(): string;
|
|
172
|
+
}
|
|
173
|
+
/**
|
|
174
|
+
* Tests whether a WebSocket close code is fatal, meaning a `TransportError`
|
|
175
|
+
* carrying it is not retryable.
|
|
176
|
+
*
|
|
177
|
+
* **Details**
|
|
178
|
+
*
|
|
179
|
+
* Fatal codes are every standard `1xxx` code except `1000`, `1001`, `1005`,
|
|
180
|
+
* `1006`, `1012`, `1013` and `1014`, plus the graphql-ws codes `4400` (bad
|
|
181
|
+
* request), `4401` (unauthorized), `4403` (forbidden), `4406` (subprotocol
|
|
182
|
+
* not acceptable), `4409` (subscriber already exists), `4429` (too many
|
|
183
|
+
* initialisation requests) and `4500` (internal server error). Any other code
|
|
184
|
+
* is retryable.
|
|
185
|
+
*
|
|
186
|
+
* `4403` is fatal because reconnecting with the same credentials is refused
|
|
187
|
+
* again.
|
|
188
|
+
*
|
|
189
|
+
* **Example** (Checking close codes)
|
|
190
|
+
*
|
|
191
|
+
* ```ts import.meta.vitest
|
|
192
|
+
* import { GraphQLClientError } from "effect/graphql"
|
|
193
|
+
*
|
|
194
|
+
* GraphQLClientError.isFatalCloseCode(1006) // => false
|
|
195
|
+
* GraphQLClientError.isFatalCloseCode(1011) // => true
|
|
196
|
+
* GraphQLClientError.isFatalCloseCode(4401) // => true
|
|
197
|
+
* ```
|
|
198
|
+
*
|
|
199
|
+
* @stability experimental
|
|
200
|
+
* @category predicates
|
|
201
|
+
* @since 4.0.0
|
|
202
|
+
*/
|
|
203
|
+
export declare const isFatalCloseCode: (code: number) => boolean;
|
|
204
|
+
declare const TransportError_base: Schema.Class<TransportError, Schema.TaggedStruct<"TransportError", {
|
|
205
|
+
readonly description: Schema.String;
|
|
206
|
+
readonly status: Schema.optional<Schema.Int>;
|
|
207
|
+
readonly headers: Schema.optional<Schema.decodeTo<Schema.declare<Headers.Headers, Headers.Headers>, Schema.$Record<Schema.String, Schema.String>, never, never>>;
|
|
208
|
+
readonly retryAfter: Schema.optional<Schema.DurationFromMillis>;
|
|
209
|
+
readonly closeCode: Schema.optional<Schema.Int>;
|
|
210
|
+
readonly fatal: Schema.optional<Schema.Boolean>;
|
|
211
|
+
readonly cause: Schema.optional<Schema.Defect>;
|
|
212
|
+
}>, import("../Cause.ts").YieldableError>;
|
|
213
|
+
/**
|
|
214
|
+
* The client could not get a GraphQL response from the server: a network
|
|
215
|
+
* failure, an HTTP response that is not a GraphQL response, or a closed
|
|
216
|
+
* WebSocket connection.
|
|
217
|
+
*
|
|
218
|
+
* **Details**
|
|
219
|
+
*
|
|
220
|
+
* - `status` and `headers` are only set for an HTTP response that is not a
|
|
221
|
+
* GraphQL response. Headers use `Headers.Headers` at runtime and encode
|
|
222
|
+
* as a plain string record; decoding restores the header collection.
|
|
223
|
+
* - `retryAfter` comes from the `Retry-After` header (whole seconds or an
|
|
224
|
+
* HTTP date) and is encoded as milliseconds. When it is set, the error is
|
|
225
|
+
* retryable at any status, unless the close code is fatal.
|
|
226
|
+
* - `closeCode` is set when a WebSocket connection closed. See
|
|
227
|
+
* {@link isFatalCloseCode} for the codes that are not retryable.
|
|
228
|
+
* - `fatal: true` marks a failure that retrying cannot fix, such as an
|
|
229
|
+
* operation on a graphql-ws transport whose scope has closed.
|
|
230
|
+
* - `cause` holds the original error, such as the `HttpClientError`. Once
|
|
231
|
+
* encoded it shrinks to `{ name, message }`, the standard `Schema.Defect`
|
|
232
|
+
* behaviour.
|
|
233
|
+
*
|
|
234
|
+
* **Example** (Retryability of transport failures)
|
|
235
|
+
*
|
|
236
|
+
* ```ts import.meta.vitest
|
|
237
|
+
* import { GraphQLClientError } from "effect/graphql"
|
|
238
|
+
*
|
|
239
|
+
* new GraphQLClientError.TransportError({ description: "ECONNREFUSED" }).isRetryable // => true
|
|
240
|
+
* new GraphQLClientError.TransportError({ description: "503", status: 503 }).isRetryable // => true
|
|
241
|
+
* new GraphQLClientError.TransportError({ description: "404", status: 404 }).isRetryable // => false
|
|
242
|
+
* new GraphQLClientError.TransportError({ description: "closed", closeCode: 4401 }).isRetryable // => false
|
|
243
|
+
* new GraphQLClientError.TransportError({ description: "shut down", fatal: true }).isRetryable // => false
|
|
244
|
+
* ```
|
|
245
|
+
*
|
|
246
|
+
* @stability experimental
|
|
247
|
+
* @category errors
|
|
248
|
+
* @since 4.0.0
|
|
249
|
+
*/
|
|
250
|
+
export declare class TransportError extends TransportError_base {
|
|
251
|
+
/**
|
|
252
|
+
* `true` for a network failure (no `status`), a `429` or `500`–`599`
|
|
253
|
+
* status, a `retryAfter` at any status, and any close code that is not
|
|
254
|
+
* fatal (see {@link isFatalCloseCode}). An error marked `fatal` or with a
|
|
255
|
+
* fatal close code is never retryable. When retrying, wait for
|
|
256
|
+
* `retryAfter` when it is set.
|
|
257
|
+
*
|
|
258
|
+
* @since 4.0.0
|
|
259
|
+
*/
|
|
260
|
+
get isRetryable(): boolean;
|
|
261
|
+
get message(): string;
|
|
262
|
+
/**
|
|
263
|
+
* Converts an `HttpClientError` into a `TransportError`, reading `status`,
|
|
264
|
+
* `headers` (as `Headers.Headers`) and `Retry-After` from the response
|
|
265
|
+
* when there is one.
|
|
266
|
+
*
|
|
267
|
+
* **Details**
|
|
268
|
+
*
|
|
269
|
+
* `Retry-After` is read as whole seconds or an HTTP date; any other value
|
|
270
|
+
* is ignored. An HTTP date is measured from `options.now` (epoch
|
|
271
|
+
* milliseconds), which defaults to `Date.now()`. Transports pass the Effect
|
|
272
|
+
* clock's time when the response arrives.
|
|
273
|
+
*
|
|
274
|
+
* @since 4.0.0
|
|
275
|
+
*/
|
|
276
|
+
static fromHttpClientError(error: HttpClientError.HttpClientError, options?: {
|
|
277
|
+
readonly now?: number | undefined;
|
|
278
|
+
}): TransportError;
|
|
279
|
+
}
|
|
280
|
+
declare const EncodeError_base: Schema.Class<EncodeError, Schema.TaggedStruct<"EncodeError", {
|
|
281
|
+
readonly description: Schema.String;
|
|
282
|
+
}>, import("../Cause.ts").YieldableError>;
|
|
283
|
+
/**
|
|
284
|
+
* The variables Schema rejected the input, so nothing was sent.
|
|
285
|
+
*
|
|
286
|
+
* @stability experimental
|
|
287
|
+
* @category errors
|
|
288
|
+
* @since 4.0.0
|
|
289
|
+
*/
|
|
290
|
+
export declare class EncodeError extends EncodeError_base {
|
|
291
|
+
/**
|
|
292
|
+
* An `EncodeError` is never retryable.
|
|
293
|
+
*
|
|
294
|
+
* @since 4.0.0
|
|
295
|
+
*/
|
|
296
|
+
get isRetryable(): boolean;
|
|
297
|
+
get message(): string;
|
|
298
|
+
}
|
|
299
|
+
declare const DecodeError_base: Schema.Class<DecodeError, Schema.TaggedStruct<"DecodeError", {
|
|
300
|
+
readonly description: Schema.String;
|
|
301
|
+
}>, import("../Cause.ts").YieldableError>;
|
|
302
|
+
/**
|
|
303
|
+
* The response was not a GraphQL response, or `data` did not match the result
|
|
304
|
+
* Schema.
|
|
305
|
+
*
|
|
306
|
+
* **Details**
|
|
307
|
+
*
|
|
308
|
+
* `data: null` without `errors` also produces a `DecodeError`, since
|
|
309
|
+
* `ResponseError` requires a non-empty errors array.
|
|
310
|
+
*
|
|
311
|
+
* @stability experimental
|
|
312
|
+
* @category errors
|
|
313
|
+
* @since 4.0.0
|
|
314
|
+
*/
|
|
315
|
+
export declare class DecodeError extends DecodeError_base {
|
|
316
|
+
/**
|
|
317
|
+
* A `DecodeError` is never retryable.
|
|
318
|
+
*
|
|
319
|
+
* @since 4.0.0
|
|
320
|
+
*/
|
|
321
|
+
get isRetryable(): boolean;
|
|
322
|
+
get message(): string;
|
|
323
|
+
}
|
|
324
|
+
declare const PaginationError_base: Schema.Class<PaginationError, Schema.TaggedStruct<"PaginationError", {
|
|
325
|
+
readonly description: Schema.String;
|
|
326
|
+
readonly cursor: Schema.NullOr<Schema.String>;
|
|
327
|
+
}>, import("../Cause.ts").YieldableError>;
|
|
328
|
+
/**
|
|
329
|
+
* Cursor paging could not continue. Only `GraphQLClient.pages` and
|
|
330
|
+
* `GraphQLClient.items` raise it, when a connection becomes `null` on a page
|
|
331
|
+
* after the first, or when `hasNextPage` is `true` but `endCursor` is `null`
|
|
332
|
+
* or did not advance.
|
|
333
|
+
*
|
|
334
|
+
* **Details**
|
|
335
|
+
*
|
|
336
|
+
* `cursor` is the last cursor that was sent, `null` on the first page.
|
|
337
|
+
*
|
|
338
|
+
* @stability experimental
|
|
339
|
+
* @category errors
|
|
340
|
+
* @since 4.0.0
|
|
341
|
+
*/
|
|
342
|
+
export declare class PaginationError extends PaginationError_base {
|
|
343
|
+
/**
|
|
344
|
+
* A `PaginationError` is never retryable.
|
|
345
|
+
*
|
|
346
|
+
* @since 4.0.0
|
|
347
|
+
*/
|
|
348
|
+
get isRetryable(): boolean;
|
|
349
|
+
get message(): string;
|
|
350
|
+
}
|
|
351
|
+
/**
|
|
352
|
+
* The union of every reason a {@link GraphQLClientError} can carry.
|
|
353
|
+
*
|
|
354
|
+
* @stability experimental
|
|
355
|
+
* @category models
|
|
356
|
+
* @since 4.0.0
|
|
357
|
+
*/
|
|
358
|
+
export type Reason = ResponseError | TransportError | EncodeError | DecodeError | PaginationError;
|
|
359
|
+
declare const GraphQLClientError_base: Schema.Class<GraphQLClientError, Schema.TaggedStruct<"GraphQLClientError", {
|
|
360
|
+
readonly operation: Schema.String;
|
|
361
|
+
readonly reason: Schema.Union<readonly [typeof ResponseError, typeof TransportError, typeof EncodeError, typeof DecodeError, typeof PaginationError]>;
|
|
362
|
+
}>, import("../Cause.ts").YieldableError>;
|
|
363
|
+
/**
|
|
364
|
+
* The error every `GraphQLClient` method fails with. It names the operation
|
|
365
|
+
* and carries one of the five reasons; `cause` is the reason itself.
|
|
366
|
+
*
|
|
367
|
+
* **Example** (Retrying only what is retryable)
|
|
368
|
+
*
|
|
369
|
+
* ```ts import.meta.vitest
|
|
370
|
+
* import { Duration, Schema } from "effect"
|
|
371
|
+
* import { GraphQLClientError } from "effect/graphql"
|
|
372
|
+
*
|
|
373
|
+
* const error = new GraphQLClientError.GraphQLClientError({
|
|
374
|
+
* operation: "Viewer",
|
|
375
|
+
* reason: new GraphQLClientError.TransportError({
|
|
376
|
+
* description: "503 Service Unavailable",
|
|
377
|
+
* status: 503,
|
|
378
|
+
* retryAfter: Duration.seconds(30)
|
|
379
|
+
* })
|
|
380
|
+
* })
|
|
381
|
+
*
|
|
382
|
+
* error.isRetryable // => true
|
|
383
|
+
* error.retryAfter // => Duration.seconds(30)
|
|
384
|
+
*
|
|
385
|
+
* // Errors round-trip through their Schema
|
|
386
|
+
* const encoded = Schema.encodeSync(GraphQLClientError.GraphQLClientError)(error)
|
|
387
|
+
* Schema.decodeUnknownSync(GraphQLClientError.GraphQLClientError)(encoded).reason._tag // => "TransportError"
|
|
388
|
+
* ```
|
|
389
|
+
*
|
|
390
|
+
* @stability experimental
|
|
391
|
+
* @category errors
|
|
392
|
+
* @since 4.0.0
|
|
393
|
+
*/
|
|
394
|
+
export declare class GraphQLClientError extends GraphQLClientError_base {
|
|
395
|
+
/**
|
|
396
|
+
* Marks this value as a GraphQL client error for runtime guards.
|
|
397
|
+
*
|
|
398
|
+
* @stability experimental
|
|
399
|
+
* @since 4.0.0
|
|
400
|
+
*/
|
|
401
|
+
readonly [TypeId] = "~effect/graphql/GraphQLClientError";
|
|
402
|
+
/**
|
|
403
|
+
* The reason, exposed as the error's cause.
|
|
404
|
+
*
|
|
405
|
+
* @since 4.0.0
|
|
406
|
+
*/
|
|
407
|
+
readonly cause: DecodeError | EncodeError | PaginationError | ResponseError | TransportError;
|
|
408
|
+
/**
|
|
409
|
+
* Delegates to the reason's `isRetryable`.
|
|
410
|
+
*
|
|
411
|
+
* @since 4.0.0
|
|
412
|
+
*/
|
|
413
|
+
get isRetryable(): boolean;
|
|
414
|
+
/**
|
|
415
|
+
* The `Retry-After` hint of a `ResponseError` or `TransportError` reason,
|
|
416
|
+
* if any. Use it as the delay when retrying on {@link isRetryable}.
|
|
417
|
+
*
|
|
418
|
+
* @since 4.0.0
|
|
419
|
+
*/
|
|
420
|
+
get retryAfter(): Duration.Duration | undefined;
|
|
421
|
+
/**
|
|
422
|
+
* The HTTP status of a `ResponseError` or `TransportError` reason, if any.
|
|
423
|
+
*
|
|
424
|
+
* @since 4.0.0
|
|
425
|
+
*/
|
|
426
|
+
get status(): number | undefined;
|
|
427
|
+
/**
|
|
428
|
+
* The response headers of a `ResponseError` or `TransportError` reason, if
|
|
429
|
+
* any.
|
|
430
|
+
*
|
|
431
|
+
* @since 4.0.0
|
|
432
|
+
*/
|
|
433
|
+
get headers(): Headers.Headers | undefined;
|
|
434
|
+
get message(): string;
|
|
435
|
+
}
|
|
436
|
+
/**
|
|
437
|
+
* Tests whether a value is a {@link GraphQLClientError}.
|
|
438
|
+
*
|
|
439
|
+
* @stability experimental
|
|
440
|
+
* @category guards
|
|
441
|
+
* @since 4.0.0
|
|
442
|
+
*/
|
|
443
|
+
export declare const isGraphQLClientError: (u: unknown) => u is GraphQLClientError;
|
|
444
|
+
export {};
|
|
445
|
+
//# sourceMappingURL=GraphQLClientError.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GraphQLClientError.d.ts","sourceRoot":"","sources":["../../src/graphql/GraphQLClientError.ts"],"names":[],"mappings":"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"}
|