effect 4.0.2 → 4.0.4
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 +111 -0
- package/ai-docs/src/52_graphql/20_testing.ts +45 -0
- package/ai-docs/src/52_graphql/30_batching.ts +116 -0
- package/ai-docs/src/52_graphql/40_aliased-batching.ts +122 -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/Context.d.ts.map +1 -1
- package/dist/Context.js +12 -3
- package/dist/Context.js.map +1 -1
- package/dist/Crypto.d.ts +33 -5
- package/dist/Crypto.d.ts.map +1 -1
- package/dist/Crypto.js +8 -2
- package/dist/Crypto.js.map +1 -1
- package/dist/DateTime.d.ts +9 -6
- package/dist/DateTime.d.ts.map +1 -1
- package/dist/DateTime.js +9 -6
- package/dist/DateTime.js.map +1 -1
- package/dist/Duration.d.ts +6 -6
- package/dist/Duration.d.ts.map +1 -1
- package/dist/Duration.js +27 -8
- package/dist/Duration.js.map +1 -1
- package/dist/FileSystem.d.ts +44 -2
- package/dist/FileSystem.d.ts.map +1 -1
- package/dist/FileSystem.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 +481 -1
- package/dist/Schema.d.ts.map +1 -1
- package/dist/Schema.js +362 -4
- 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/Stdio.d.ts +7 -1
- package/dist/Stdio.d.ts.map +1 -1
- package/dist/Stdio.js +1 -0
- package/dist/Stdio.js.map +1 -1
- package/dist/Stream.d.ts +22 -11
- package/dist/Stream.d.ts.map +1 -1
- package/dist/Stream.js +21 -6
- package/dist/Stream.js.map +1 -1
- package/dist/Utils.js +8 -3
- package/dist/Utils.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/LanguageModel.d.ts +38 -7
- package/dist/ai/LanguageModel.d.ts.map +1 -1
- package/dist/ai/LanguageModel.js +25 -7
- package/dist/ai/LanguageModel.js.map +1 -1
- package/dist/ai/McpServer.d.ts +61 -0
- package/dist/ai/McpServer.d.ts.map +1 -1
- package/dist/ai/McpServer.js +196 -44
- 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 +4 -3
- package/dist/ai/Response.d.ts.map +1 -1
- package/dist/ai/Response.js.map +1 -1
- package/dist/ai/internal/mcpProtocol/v2026_07_28.js +5 -0
- package/dist/ai/internal/mcpProtocol/v2026_07_28.js.map +1 -1
- package/dist/ai/internal/mcpProtocol.js.map +1 -1
- package/dist/ai/internal/mcpRuntime.js +1 -0
- package/dist/ai/internal/mcpRuntime.js.map +1 -1
- package/dist/cli/CliOutput.d.ts +27 -0
- package/dist/cli/CliOutput.d.ts.map +1 -1
- package/dist/cli/CliOutput.js +33 -10
- package/dist/cli/CliOutput.js.map +1 -1
- package/dist/cli/Command.d.ts.map +1 -1
- package/dist/cli/Command.js +6 -3
- package/dist/cli/Command.js.map +1 -1
- package/dist/cli/Completions.d.ts +3 -3
- package/dist/cli/Completions.d.ts.map +1 -1
- package/dist/cli/Completions.js +8 -5
- package/dist/cli/Completions.js.map +1 -1
- package/dist/cli/GlobalFlag.d.ts +5 -4
- package/dist/cli/GlobalFlag.d.ts.map +1 -1
- package/dist/cli/GlobalFlag.js +3 -3
- package/dist/cli/GlobalFlag.js.map +1 -1
- package/dist/cli/Prompt.d.ts +17 -1
- package/dist/cli/Prompt.d.ts.map +1 -1
- package/dist/cli/Prompt.js +119 -114
- package/dist/cli/Prompt.js.map +1 -1
- package/dist/cli/internal/ansi.d.ts +0 -1
- package/dist/cli/internal/ansi.d.ts.map +1 -1
- package/dist/cli/internal/ansi.js +20 -3
- package/dist/cli/internal/ansi.js.map +1 -1
- package/dist/cli/internal/completions/powershell.d.ts +2 -0
- package/dist/cli/internal/completions/powershell.d.ts.map +1 -0
- package/dist/cli/internal/completions/powershell.js +273 -0
- package/dist/cli/internal/completions/powershell.js.map +1 -0
- package/dist/cli/internal/completions/zsh.js +3 -2
- package/dist/cli/internal/completions/zsh.js.map +1 -1
- package/dist/cli/internal/wizard.d.ts +3 -3
- package/dist/cli/internal/wizard.d.ts.map +1 -1
- package/dist/cli/internal/wizard.js +21 -18
- package/dist/cli/internal/wizard.js.map +1 -1
- package/dist/cluster/ClusterSchema.d.ts +28 -0
- package/dist/cluster/ClusterSchema.d.ts.map +1 -1
- package/dist/cluster/ClusterSchema.js +30 -0
- package/dist/cluster/ClusterSchema.js.map +1 -1
- package/dist/cluster/ClusterWorkflowEngine.d.ts.map +1 -1
- package/dist/cluster/ClusterWorkflowEngine.js +56 -26
- package/dist/cluster/ClusterWorkflowEngine.js.map +1 -1
- package/dist/cluster/MessageStorage.d.ts +18 -3
- package/dist/cluster/MessageStorage.d.ts.map +1 -1
- package/dist/cluster/MessageStorage.js +31 -11
- package/dist/cluster/MessageStorage.js.map +1 -1
- package/dist/cluster/Runners.d.ts.map +1 -1
- package/dist/cluster/Runners.js +8 -2
- package/dist/cluster/Runners.js.map +1 -1
- package/dist/cluster/Sharding.d.ts.map +1 -1
- package/dist/cluster/Sharding.js +187 -66
- package/dist/cluster/Sharding.js.map +1 -1
- package/dist/cluster/SqlMessageStorage.d.ts +59 -19
- package/dist/cluster/SqlMessageStorage.d.ts.map +1 -1
- package/dist/cluster/SqlMessageStorage.js +84 -55
- package/dist/cluster/SqlMessageStorage.js.map +1 -1
- package/dist/cluster/SqlRunnerStorage.d.ts +68 -19
- package/dist/cluster/SqlRunnerStorage.d.ts.map +1 -1
- package/dist/cluster/SqlRunnerStorage.js +191 -113
- package/dist/cluster/SqlRunnerStorage.js.map +1 -1
- package/dist/cluster/internal/entityManager.js +104 -37
- 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 +62 -70
- 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 +498 -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 +731 -0
- package/dist/graphql/GraphQLProtocol.d.ts.map +1 -0
- package/dist/graphql/GraphQLProtocol.js +719 -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 +552 -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/FindMyWay/internal/router.js +3 -6
- package/dist/http/FindMyWay/internal/router.js.map +1 -1
- package/dist/http/HttpClient.d.ts +21 -0
- package/dist/http/HttpClient.d.ts.map +1 -1
- package/dist/http/HttpClient.js +63 -12
- package/dist/http/HttpClient.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.map +1 -1
- package/dist/http/HttpMiddleware.js +31 -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 +35 -0
- package/dist/http/HttpRouter.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/HttpTraceContext.d.ts.map +1 -1
- package/dist/http/HttpTraceContext.js +4 -2
- 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-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/dateTime.js +40 -35
- package/dist/internal/dateTime.js.map +1 -1
- package/dist/internal/effect.js +19 -9
- 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 +195 -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/AddressResolver.d.ts +145 -0
- package/dist/net/AddressResolver.d.ts.map +1 -0
- package/dist/net/AddressResolver.js +114 -0
- package/dist/net/AddressResolver.js.map +1 -0
- package/dist/net/Dns.d.ts +596 -0
- package/dist/net/Dns.d.ts.map +1 -0
- package/dist/net/Dns.js +549 -0
- package/dist/net/Dns.js.map +1 -0
- package/dist/net/Host.d.ts +369 -0
- package/dist/net/Host.d.ts.map +1 -0
- package/dist/net/Host.js +397 -0
- package/dist/net/Host.js.map +1 -0
- package/dist/net/IpInterface.d.ts +76 -3
- package/dist/net/IpInterface.d.ts.map +1 -1
- package/dist/net/IpInterface.js +53 -4
- package/dist/net/IpInterface.js.map +1 -1
- package/dist/net/IpNetwork.d.ts +82 -8
- package/dist/net/IpNetwork.d.ts.map +1 -1
- package/dist/net/IpNetwork.js +60 -4
- package/dist/net/IpNetwork.js.map +1 -1
- package/dist/net/NetAddress.d.ts +396 -35
- package/dist/net/NetAddress.d.ts.map +1 -1
- package/dist/net/NetAddress.js +358 -34
- package/dist/net/NetAddress.js.map +1 -1
- package/dist/net/index.d.ts +15 -0
- package/dist/net/index.d.ts.map +1 -1
- package/dist/net/index.js +15 -0
- package/dist/net/index.js.map +1 -1
- package/dist/observability/OtlpMetrics.d.ts.map +1 -1
- package/dist/observability/OtlpMetrics.js +15 -21
- package/dist/observability/OtlpMetrics.js.map +1 -1
- package/dist/observability/PrometheusMetrics.js +1 -0
- package/dist/observability/PrometheusMetrics.js.map +1 -1
- package/dist/persistence/PersistedQueue.d.ts +32 -3
- package/dist/persistence/PersistedQueue.d.ts.map +1 -1
- package/dist/persistence/PersistedQueue.js +75 -16
- package/dist/persistence/PersistedQueue.js.map +1 -1
- package/dist/rpc/RpcClient.d.ts +22 -6
- package/dist/rpc/RpcClient.d.ts.map +1 -1
- package/dist/rpc/RpcClient.js +12 -5
- package/dist/rpc/RpcClient.js.map +1 -1
- package/dist/rpc/RpcServer.d.ts +6 -0
- package/dist/rpc/RpcServer.d.ts.map +1 -1
- package/dist/rpc/RpcServer.js +78 -29
- package/dist/rpc/RpcServer.js.map +1 -1
- package/dist/socket/DatagramSocket.d.ts +456 -0
- package/dist/socket/DatagramSocket.d.ts.map +1 -0
- package/dist/socket/DatagramSocket.js +535 -0
- package/dist/socket/DatagramSocket.js.map +1 -0
- package/dist/socket/Socket.d.ts +20 -1
- package/dist/socket/Socket.d.ts.map +1 -1
- package/dist/socket/Socket.js +9 -1
- package/dist/socket/Socket.js.map +1 -1
- package/dist/socket/index.d.ts +5 -0
- package/dist/socket/index.d.ts.map +1 -1
- package/dist/socket/index.js +5 -0
- package/dist/socket/index.js.map +1 -1
- package/dist/sql/Migrator.d.ts.map +1 -1
- package/dist/sql/Migrator.js +7 -2
- package/dist/sql/Migrator.js.map +1 -1
- package/dist/sql/SqlClient.d.ts +7 -1
- package/dist/sql/SqlClient.d.ts.map +1 -1
- package/dist/sql/SqlClient.js +31 -6
- package/dist/sql/SqlClient.js.map +1 -1
- package/dist/testing/TestCrypto.d.ts +73 -0
- package/dist/testing/TestCrypto.d.ts.map +1 -0
- package/dist/testing/TestCrypto.js +87 -0
- package/dist/testing/TestCrypto.js.map +1 -0
- package/dist/testing/index.d.ts +5 -0
- package/dist/testing/index.d.ts.map +1 -1
- package/dist/testing/index.js +5 -0
- package/dist/testing/index.js.map +1 -1
- package/dist/workflow/DurableDeferred.d.ts +54 -0
- package/dist/workflow/DurableDeferred.d.ts.map +1 -1
- package/dist/workflow/DurableDeferred.js +108 -50
- package/dist/workflow/DurableDeferred.js.map +1 -1
- package/dist/workflow/WorkflowEngine.d.ts +24 -2
- package/dist/workflow/WorkflowEngine.d.ts.map +1 -1
- package/dist/workflow/WorkflowEngine.js +13 -3
- package/dist/workflow/WorkflowEngine.js.map +1 -1
- package/package.json +6 -3
- package/src/Context.ts +12 -3
- package/src/Crypto.ts +43 -9
- package/src/DateTime.ts +9 -6
- package/src/Duration.ts +36 -16
- package/src/FileSystem.ts +48 -2
- package/src/RequestResolver.ts +4 -10
- package/src/Scheduler.ts +9 -0
- package/src/Schema.ts +677 -5
- package/src/SchemaGetter.ts +47 -35
- package/src/Sink.ts +45 -18
- package/src/Stdio.ts +9 -2
- package/src/Stream.ts +44 -15
- package/src/Utils.ts +8 -5
- package/src/ai/AnthropicStructuredOutput.ts +2 -2
- package/src/ai/Chat.ts +2 -2
- package/src/ai/LanguageModel.ts +96 -24
- package/src/ai/McpServer.ts +288 -94
- package/src/ai/Prompt.ts +24 -10
- package/src/ai/Response.ts +6 -3
- package/src/ai/internal/mcpProtocol/v2026_07_28.ts +5 -0
- package/src/ai/internal/mcpProtocol.ts +3 -0
- package/src/ai/internal/mcpRuntime.ts +2 -0
- package/src/cli/CliOutput.ts +33 -16
- package/src/cli/Command.ts +4 -3
- package/src/cli/Completions.ts +9 -6
- package/src/cli/GlobalFlag.ts +19 -11
- package/src/cli/Prompt.ts +159 -149
- package/src/cli/internal/ansi.ts +26 -3
- package/src/cli/internal/completions/powershell.ts +322 -0
- package/src/cli/internal/completions/zsh.ts +4 -2
- package/src/cli/internal/wizard.ts +34 -26
- package/src/cluster/ClusterSchema.ts +32 -0
- package/src/cluster/ClusterWorkflowEngine.ts +64 -36
- package/src/cluster/MessageStorage.ts +45 -14
- package/src/cluster/Runners.ts +8 -2
- package/src/cluster/Sharding.ts +219 -58
- package/src/cluster/SqlMessageStorage.ts +118 -84
- package/src/cluster/SqlRunnerStorage.ts +224 -128
- package/src/cluster/internal/entityManager.ts +151 -55
- package/src/encoding/Sse.ts +69 -79
- package/src/graphql/GraphQL.ts +494 -0
- package/src/graphql/GraphQLClient.ts +912 -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 +1286 -0
- package/src/graphql/GraphQLResolver.ts +1010 -0
- package/src/graphql/index.ts +48 -0
- package/src/http/FindMyWay/internal/router.ts +4 -7
- package/src/http/HttpClient.ts +110 -12
- package/src/http/HttpEffect.ts +11 -5
- package/src/http/HttpMiddleware.ts +33 -34
- package/src/http/HttpRouter.ts +35 -0
- package/src/http/HttpServerResponse.ts +28 -16
- package/src/http/HttpTraceContext.ts +8 -2
- package/src/http/Multipart.ts +17 -1
- package/src/http-api/HttpApiScalar.ts +5 -0
- package/src/internal/dateTime.ts +13 -10
- package/src/internal/effect.ts +22 -15
- package/src/internal/graphql.ts +263 -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/AddressResolver.ts +222 -0
- package/src/net/Dns.ts +1035 -0
- package/src/net/Host.ts +544 -0
- package/src/net/IpInterface.ts +117 -7
- package/src/net/IpNetwork.ts +116 -17
- package/src/net/NetAddress.ts +620 -76
- package/src/net/index.ts +18 -0
- package/src/observability/OtlpMetrics.ts +12 -23
- package/src/observability/PrometheusMetrics.ts +1 -0
- package/src/persistence/PersistedQueue.ts +146 -53
- package/src/rpc/RpcClient.ts +41 -19
- package/src/rpc/RpcServer.ts +115 -40
- package/src/socket/DatagramSocket.ts +919 -0
- package/src/socket/Socket.ts +28 -2
- package/src/socket/index.ts +6 -0
- package/src/sql/Migrator.ts +21 -5
- package/src/sql/SqlClient.ts +39 -15
- package/src/testing/TestCrypto.ts +94 -0
- package/src/testing/index.ts +6 -0
- package/src/workflow/DurableDeferred.ts +160 -47
- package/src/workflow/WorkflowEngine.ts +50 -5
package/src/Schema.ts
CHANGED
|
@@ -37,6 +37,7 @@ import * as HashSet_ from "./HashSet.ts"
|
|
|
37
37
|
import * as Cookies_ from "./http/Cookies.ts"
|
|
38
38
|
import * as Headers_ from "./http/Headers.ts"
|
|
39
39
|
import * as UrlParams_ from "./http/UrlParams.ts"
|
|
40
|
+
import { NodeInspectSymbol } from "./Inspectable.ts"
|
|
40
41
|
import * as core from "./internal/core.ts"
|
|
41
42
|
import { effectIsExit } from "./internal/effect.ts"
|
|
42
43
|
import * as InternalGraph from "./internal/graph.ts"
|
|
@@ -56,6 +57,8 @@ import { isSchemaError as isSchemaErrorInternal, SchemaErrorTypeId } from "./int
|
|
|
56
57
|
import { getStackTraceLimit, setStackTraceLimit } from "./internal/stackTraceLimit.ts"
|
|
57
58
|
import type * as JsonPatch from "./JsonPatch.ts"
|
|
58
59
|
import type * as JsonSchema from "./JsonSchema.ts"
|
|
60
|
+
import * as Dns_ from "./net/Dns.ts"
|
|
61
|
+
import * as Host_ from "./net/Host.ts"
|
|
59
62
|
import * as IpInterface_ from "./net/IpInterface.ts"
|
|
60
63
|
import * as IpNetwork_ from "./net/IpNetwork.ts"
|
|
61
64
|
import * as NetAddress_ from "./net/NetAddress.ts"
|
|
@@ -1217,6 +1220,15 @@ export class SchemaError extends Data.TaggedError("SchemaError")<{
|
|
|
1217
1220
|
override get message() {
|
|
1218
1221
|
return SchemaIssue.defaultFormatter(this.issue)
|
|
1219
1222
|
}
|
|
1223
|
+
override toJSON() {
|
|
1224
|
+
return {
|
|
1225
|
+
_tag: this._tag,
|
|
1226
|
+
message: this.message
|
|
1227
|
+
}
|
|
1228
|
+
}
|
|
1229
|
+
override [NodeInspectSymbol]() {
|
|
1230
|
+
return this.toJSON()
|
|
1231
|
+
}
|
|
1220
1232
|
override toString() {
|
|
1221
1233
|
return `SchemaError(${this.message})`
|
|
1222
1234
|
}
|
|
@@ -4017,6 +4029,7 @@ export declare namespace StructWithRest {
|
|
|
4017
4029
|
*/
|
|
4018
4030
|
type Objects = Constraint & {
|
|
4019
4031
|
readonly ast: SchemaAST.Objects
|
|
4032
|
+
readonly Encoded: object
|
|
4020
4033
|
}
|
|
4021
4034
|
/**
|
|
4022
4035
|
* Readonly list of record schemas that provide the additional index signatures
|
|
@@ -4186,6 +4199,13 @@ export interface StructWithRest<
|
|
|
4186
4199
|
*
|
|
4187
4200
|
* **Gotchas**
|
|
4188
4201
|
*
|
|
4202
|
+
* The base schema must have an object-shaped encoded type. Whole-object
|
|
4203
|
+
* transformations are not supported, even with an empty rest array. Apply
|
|
4204
|
+
* transformations such as `Schema.fromJsonString` to the completed
|
|
4205
|
+
* `StructWithRest` schema instead. Object-shaped encoded types alone do not
|
|
4206
|
+
* guarantee compatibility: unsupported encodings are still rejected at runtime.
|
|
4207
|
+
* Transformations on individual fields remain supported.
|
|
4208
|
+
*
|
|
4189
4209
|
* TypeScript index signatures also apply to fixed keys. `StructWithRest` does
|
|
4190
4210
|
* not reject incompatible fixed fields at the call site; use
|
|
4191
4211
|
* `StructWithRest.ValidateRecords` when you want an explicit type-level
|
|
@@ -7877,7 +7897,8 @@ export function isMultipleOf(
|
|
|
7877
7897
|
*
|
|
7878
7898
|
* JSON Schema:
|
|
7879
7899
|
*
|
|
7880
|
-
* This check corresponds to
|
|
7900
|
+
* This check corresponds to `type: "integer"` with `minimum: Number.MIN_SAFE_INTEGER`
|
|
7901
|
+
* and `maximum: Number.MAX_SAFE_INTEGER` in JSON Schema.
|
|
7881
7902
|
*
|
|
7882
7903
|
* Arbitrary:
|
|
7883
7904
|
*
|
|
@@ -7896,7 +7917,11 @@ export function isInt(annotations?: Annotations.Filter) {
|
|
|
7896
7917
|
id: "effect/schema/isInt",
|
|
7897
7918
|
payload: null
|
|
7898
7919
|
},
|
|
7899
|
-
toJsonSchema: () =>
|
|
7920
|
+
toJsonSchema: () => ({
|
|
7921
|
+
type: "integer",
|
|
7922
|
+
minimum: globalThis.Number.MIN_SAFE_INTEGER,
|
|
7923
|
+
maximum: globalThis.Number.MAX_SAFE_INTEGER
|
|
7924
|
+
}),
|
|
7900
7925
|
toCode: () => ({ runtime: "Schema.isInt()" }),
|
|
7901
7926
|
arbitraryConstraint: {
|
|
7902
7927
|
number: "integer"
|
|
@@ -11978,10 +12003,10 @@ export const DateTimeZonedFromString: DateTimeZonedFromString = DateTimeZonedStr
|
|
|
11978
12003
|
decodeTo(DateTimeZoned, dateTimeZonedFromString)
|
|
11979
12004
|
)
|
|
11980
12005
|
|
|
11981
|
-
const netAddressFromString = <S extends
|
|
12006
|
+
const netAddressFromString = <S extends Constraint, E extends { readonly message: string }>(
|
|
11982
12007
|
declaration: S,
|
|
11983
|
-
parse: (input: string) => Result_.Result<S["
|
|
11984
|
-
encode: (value: S["
|
|
12008
|
+
parse: (input: string) => Result_.Result<S["Encoded"], E>,
|
|
12009
|
+
encode: (value: S["Encoded"]) => string,
|
|
11985
12010
|
identifier: string
|
|
11986
12011
|
) =>
|
|
11987
12012
|
String.pipe(decodeTo(
|
|
@@ -13332,6 +13357,229 @@ export const SocketAddress: SocketAddress = declare(NetAddress_.isSocketAddress,
|
|
|
13332
13357
|
identifier: "SocketAddress"
|
|
13333
13358
|
})
|
|
13334
13359
|
|
|
13360
|
+
/**
|
|
13361
|
+
* Type-level representation of {@link DomainName}.
|
|
13362
|
+
*
|
|
13363
|
+
* @stability experimental
|
|
13364
|
+
* @category models
|
|
13365
|
+
* @since 4.0.0
|
|
13366
|
+
*/
|
|
13367
|
+
export interface DomainName extends brand<String, "~effect/net/Host/DomainName"> {
|
|
13368
|
+
readonly "Rebuild": DomainName
|
|
13369
|
+
}
|
|
13370
|
+
|
|
13371
|
+
/**
|
|
13372
|
+
* Schema for normalized DNS domain names.
|
|
13373
|
+
*
|
|
13374
|
+
* **Details**
|
|
13375
|
+
*
|
|
13376
|
+
* Only names already in normalized form (lowercase ASCII, with
|
|
13377
|
+
* internationalized labels in `xn--` form) are accepted. Use
|
|
13378
|
+
* {@link DomainNameFromString} to normalize arbitrary input.
|
|
13379
|
+
*
|
|
13380
|
+
* @stability experimental
|
|
13381
|
+
* @category schemas
|
|
13382
|
+
* @since 4.0.0
|
|
13383
|
+
*/
|
|
13384
|
+
export const DomainName: DomainName = String.check(
|
|
13385
|
+
makeFilter(Host_.isDomainName, { expected: "a normalized domain name" })
|
|
13386
|
+
).pipe(brand("~effect/net/Host/DomainName")).annotate({ identifier: "DomainName" })
|
|
13387
|
+
|
|
13388
|
+
/**
|
|
13389
|
+
* Type-level representation of {@link DomainNameFromString}.
|
|
13390
|
+
*
|
|
13391
|
+
* @stability experimental
|
|
13392
|
+
* @category models
|
|
13393
|
+
* @since 4.0.0
|
|
13394
|
+
*/
|
|
13395
|
+
export interface DomainNameFromString extends decodeTo<DomainName, String> {
|
|
13396
|
+
readonly "Rebuild": DomainNameFromString
|
|
13397
|
+
}
|
|
13398
|
+
|
|
13399
|
+
/**
|
|
13400
|
+
* Schema for DNS domain names decoded from strings, normalizing case and
|
|
13401
|
+
* converting internationalized names to their ASCII form.
|
|
13402
|
+
*
|
|
13403
|
+
* @stability experimental
|
|
13404
|
+
* @category schemas
|
|
13405
|
+
* @since 4.0.0
|
|
13406
|
+
*/
|
|
13407
|
+
export const DomainNameFromString: DomainNameFromString = netAddressFromString(
|
|
13408
|
+
DomainName,
|
|
13409
|
+
Host_.domainNameFromString,
|
|
13410
|
+
(name) => name,
|
|
13411
|
+
"DomainNameFromString"
|
|
13412
|
+
)
|
|
13413
|
+
|
|
13414
|
+
/**
|
|
13415
|
+
* Type-level representation of {@link ScopedIpv6Literal}.
|
|
13416
|
+
*
|
|
13417
|
+
* @stability experimental
|
|
13418
|
+
* @category models
|
|
13419
|
+
* @since 4.0.0
|
|
13420
|
+
*/
|
|
13421
|
+
export interface ScopedIpv6Literal extends brand<String, "~effect/net/NetAddress/ScopedIpv6Literal"> {
|
|
13422
|
+
readonly "Rebuild": ScopedIpv6Literal
|
|
13423
|
+
}
|
|
13424
|
+
|
|
13425
|
+
/**
|
|
13426
|
+
* Schema for canonical scoped IPv6 literals such as `fe80::1%eth0`.
|
|
13427
|
+
*
|
|
13428
|
+
* @stability experimental
|
|
13429
|
+
* @category schemas
|
|
13430
|
+
* @since 4.0.0
|
|
13431
|
+
*/
|
|
13432
|
+
export const ScopedIpv6Literal: ScopedIpv6Literal = String.check(
|
|
13433
|
+
makeFilter(NetAddress_.isScopedIpv6Literal, { expected: "a canonical scoped IPv6 literal" })
|
|
13434
|
+
).pipe(brand("~effect/net/NetAddress/ScopedIpv6Literal")).annotate({ identifier: "ScopedIpv6Literal" })
|
|
13435
|
+
|
|
13436
|
+
/**
|
|
13437
|
+
* Type-level representation of {@link ScopedIpv6LiteralFromString}.
|
|
13438
|
+
*
|
|
13439
|
+
* @stability experimental
|
|
13440
|
+
* @category models
|
|
13441
|
+
* @since 4.0.0
|
|
13442
|
+
*/
|
|
13443
|
+
export interface ScopedIpv6LiteralFromString extends decodeTo<ScopedIpv6Literal, String> {
|
|
13444
|
+
readonly "Rebuild": ScopedIpv6LiteralFromString
|
|
13445
|
+
}
|
|
13446
|
+
|
|
13447
|
+
/**
|
|
13448
|
+
* Schema for scoped IPv6 literals decoded from strings, normalizing the address
|
|
13449
|
+
* and numeric zones.
|
|
13450
|
+
*
|
|
13451
|
+
* @stability experimental
|
|
13452
|
+
* @category schemas
|
|
13453
|
+
* @since 4.0.0
|
|
13454
|
+
*/
|
|
13455
|
+
export const ScopedIpv6LiteralFromString: ScopedIpv6LiteralFromString = netAddressFromString(
|
|
13456
|
+
ScopedIpv6Literal,
|
|
13457
|
+
NetAddress_.scopedIpv6LiteralFromString,
|
|
13458
|
+
(literal) => literal,
|
|
13459
|
+
"ScopedIpv6LiteralFromString"
|
|
13460
|
+
)
|
|
13461
|
+
|
|
13462
|
+
/**
|
|
13463
|
+
* Type-level representation of {@link Host}.
|
|
13464
|
+
*
|
|
13465
|
+
* @stability experimental
|
|
13466
|
+
* @category models
|
|
13467
|
+
* @since 4.0.0
|
|
13468
|
+
*/
|
|
13469
|
+
export interface Host extends Union<readonly [IpAddress, ScopedIpv6Literal, DomainName]> {
|
|
13470
|
+
readonly "Rebuild": Host
|
|
13471
|
+
}
|
|
13472
|
+
|
|
13473
|
+
/**
|
|
13474
|
+
* Schema for hosts: numeric IP addresses, scoped IPv6 literals, or domain names.
|
|
13475
|
+
*
|
|
13476
|
+
* @stability experimental
|
|
13477
|
+
* @category schemas
|
|
13478
|
+
* @since 4.0.0
|
|
13479
|
+
*/
|
|
13480
|
+
export const Host: Host = Union([IpAddress, ScopedIpv6Literal, DomainName]).annotate({ identifier: "Host" })
|
|
13481
|
+
|
|
13482
|
+
/**
|
|
13483
|
+
* Type-level representation of {@link HostFromString}.
|
|
13484
|
+
*
|
|
13485
|
+
* @stability experimental
|
|
13486
|
+
* @category models
|
|
13487
|
+
* @since 4.0.0
|
|
13488
|
+
*/
|
|
13489
|
+
export interface HostFromString
|
|
13490
|
+
extends Union<readonly [IpAddressFromString, ScopedIpv6LiteralFromString, DomainNameFromString]>
|
|
13491
|
+
{
|
|
13492
|
+
readonly "Rebuild": HostFromString
|
|
13493
|
+
}
|
|
13494
|
+
|
|
13495
|
+
/**
|
|
13496
|
+
* Schema for hosts decoded from strings. Numeric IP strings decode to IP
|
|
13497
|
+
* addresses; other strings decode to scoped IPv6 literals or domain names.
|
|
13498
|
+
*
|
|
13499
|
+
* @stability experimental
|
|
13500
|
+
* @category schemas
|
|
13501
|
+
* @since 4.0.0
|
|
13502
|
+
*/
|
|
13503
|
+
export const HostFromString: HostFromString = Union([
|
|
13504
|
+
IpAddressFromString,
|
|
13505
|
+
ScopedIpv6LiteralFromString,
|
|
13506
|
+
DomainNameFromString
|
|
13507
|
+
]).annotate({ identifier: "HostFromString" })
|
|
13508
|
+
|
|
13509
|
+
/**
|
|
13510
|
+
* Type-level representation of {@link HostPort}.
|
|
13511
|
+
*
|
|
13512
|
+
* @stability experimental
|
|
13513
|
+
* @category models
|
|
13514
|
+
* @since 4.0.0
|
|
13515
|
+
*/
|
|
13516
|
+
export interface HostPort extends declare<Host_.HostPort> {
|
|
13517
|
+
readonly "Rebuild": HostPort
|
|
13518
|
+
}
|
|
13519
|
+
|
|
13520
|
+
/**
|
|
13521
|
+
* Schema for already-constructed unresolved host and port values.
|
|
13522
|
+
*
|
|
13523
|
+
* @stability experimental
|
|
13524
|
+
* @category schemas
|
|
13525
|
+
* @since 4.0.0
|
|
13526
|
+
*/
|
|
13527
|
+
export const HostPort: HostPort = declare(Host_.isHostPort, {
|
|
13528
|
+
identifier: "HostPort"
|
|
13529
|
+
})
|
|
13530
|
+
|
|
13531
|
+
/**
|
|
13532
|
+
* Type-level representation of {@link HostPortFromString}.
|
|
13533
|
+
*
|
|
13534
|
+
* @stability experimental
|
|
13535
|
+
* @category models
|
|
13536
|
+
* @since 4.0.0
|
|
13537
|
+
*/
|
|
13538
|
+
export interface HostPortFromString extends decodeTo<HostPort, String> {
|
|
13539
|
+
readonly "Rebuild": HostPortFromString
|
|
13540
|
+
}
|
|
13541
|
+
|
|
13542
|
+
/**
|
|
13543
|
+
* Schema for unresolved endpoints encoded as `host:port` or `[IPv6]:port`
|
|
13544
|
+
* strings.
|
|
13545
|
+
*
|
|
13546
|
+
* @stability experimental
|
|
13547
|
+
* @category schemas
|
|
13548
|
+
* @since 4.0.0
|
|
13549
|
+
*/
|
|
13550
|
+
export const HostPortFromString: HostPortFromString = netAddressFromString(
|
|
13551
|
+
HostPort,
|
|
13552
|
+
Host_.hostPortFromString,
|
|
13553
|
+
Host_.formatHostPort,
|
|
13554
|
+
"HostPortFromString"
|
|
13555
|
+
)
|
|
13556
|
+
|
|
13557
|
+
/**
|
|
13558
|
+
* Type-level representation of {@link Port}.
|
|
13559
|
+
*
|
|
13560
|
+
* @stability experimental
|
|
13561
|
+
* @category models
|
|
13562
|
+
* @since 4.0.0
|
|
13563
|
+
*/
|
|
13564
|
+
export interface Port extends Int {
|
|
13565
|
+
readonly "Rebuild": Port
|
|
13566
|
+
}
|
|
13567
|
+
|
|
13568
|
+
/**
|
|
13569
|
+
* Schema for TCP and UDP port numbers from 0 through 65535.
|
|
13570
|
+
*
|
|
13571
|
+
* **Details**
|
|
13572
|
+
*
|
|
13573
|
+
* Port 0 is accepted because it asks the operating system to choose a port
|
|
13574
|
+
* when binding, and it matches the port range of `InetAddress` and `HostPort`.
|
|
13575
|
+
* `Config.Port` accepts only 1 through 65535.
|
|
13576
|
+
*
|
|
13577
|
+
* @stability experimental
|
|
13578
|
+
* @category schemas
|
|
13579
|
+
* @since 4.0.0
|
|
13580
|
+
*/
|
|
13581
|
+
export const Port: Port = Int.check(isBetween({ minimum: 0, maximum: 65535 }, { expected: "a port number" }))
|
|
13582
|
+
|
|
13335
13583
|
// -----------------------------------------------------------------------------
|
|
13336
13584
|
// Duration schemas
|
|
13337
13585
|
// -----------------------------------------------------------------------------
|
|
@@ -13549,6 +13797,426 @@ export const DurationFromMillis: DurationFromMillis = Number.pipe(
|
|
|
13549
13797
|
decodeTo(Duration, durationFromMillis)
|
|
13550
13798
|
)
|
|
13551
13799
|
|
|
13800
|
+
// -----------------------------------------------------------------------------
|
|
13801
|
+
// DNS schemas
|
|
13802
|
+
// -----------------------------------------------------------------------------
|
|
13803
|
+
|
|
13804
|
+
/**
|
|
13805
|
+
* Type-level representation of {@link DnsRecordType}.
|
|
13806
|
+
*
|
|
13807
|
+
* @stability experimental
|
|
13808
|
+
* @category models
|
|
13809
|
+
* @since 4.0.0
|
|
13810
|
+
*/
|
|
13811
|
+
export interface DnsRecordType extends Literals<ReadonlyArray<Dns_.RecordType>> {}
|
|
13812
|
+
|
|
13813
|
+
/**
|
|
13814
|
+
* Schema for supported DNS record types such as `"A"` or `"SRV"`.
|
|
13815
|
+
*
|
|
13816
|
+
* @stability experimental
|
|
13817
|
+
* @category schemas
|
|
13818
|
+
* @since 4.0.0
|
|
13819
|
+
*/
|
|
13820
|
+
export const DnsRecordType: DnsRecordType = Literals(Dns_.recordTypes)
|
|
13821
|
+
|
|
13822
|
+
// Addresses in JSON records must already be canonical; normalizing input is
|
|
13823
|
+
// left to the `*FromString` schemas.
|
|
13824
|
+
const dnsCanonicalAddress = <A extends NetAddress_.IpAddress>(
|
|
13825
|
+
schema: Codec<A>,
|
|
13826
|
+
parse: (input: string) => Result_.Result<A, NetAddress_.NetAddressError>
|
|
13827
|
+
) =>
|
|
13828
|
+
String.pipe(decodeTo(
|
|
13829
|
+
schema,
|
|
13830
|
+
SchemaTransformation.transformEffect({
|
|
13831
|
+
decode: (input, options) => {
|
|
13832
|
+
const result = parse(input)
|
|
13833
|
+
if (Result_.isFailure(result)) {
|
|
13834
|
+
return Effect.fail(new SchemaIssue.InvalidValue({ message: result.failure.message }, input, options))
|
|
13835
|
+
}
|
|
13836
|
+
return NetAddress_.formatIp(result.success) === input
|
|
13837
|
+
? Effect.succeed(result.success)
|
|
13838
|
+
: Effect.fail(new SchemaIssue.InvalidValue({ message: "expected a canonical address" }, input, options))
|
|
13839
|
+
},
|
|
13840
|
+
encode: (address) => Effect.succeed(NetAddress_.formatIp(address))
|
|
13841
|
+
})
|
|
13842
|
+
))
|
|
13843
|
+
|
|
13844
|
+
const dnsUint8 = Int.check(isBetween({ minimum: 0, maximum: 0xff }))
|
|
13845
|
+
|
|
13846
|
+
const dnsUint16 = Int.check(isBetween({ minimum: 0, maximum: 0xffff }))
|
|
13847
|
+
|
|
13848
|
+
const dnsUint32 = Int.check(isBetween({ minimum: 0, maximum: 0xffffffff }))
|
|
13849
|
+
|
|
13850
|
+
// SOA timers are written as whole seconds, as in zone files.
|
|
13851
|
+
const dnsSeconds = dnsUint32.pipe(decodeTo(
|
|
13852
|
+
Duration,
|
|
13853
|
+
SchemaTransformation.transform({ decode: Duration_.seconds, encode: Duration_.toSeconds })
|
|
13854
|
+
))
|
|
13855
|
+
|
|
13856
|
+
// Each record type is an opaque value whose JSON form is a plain object tagged
|
|
13857
|
+
// by record type, such as `{ "_tag": "MX", "exchange": "mail.example.com", "priority": 10 }`.
|
|
13858
|
+
const dnsRecordOfType = <T extends Dns_.RecordType>(
|
|
13859
|
+
type: T,
|
|
13860
|
+
fields: { readonly [K in keyof Dns_.RecordFields<T>]-?: Codec<Dns_.RecordFields<T>[K], unknown> }
|
|
13861
|
+
) =>
|
|
13862
|
+
declare((u): u is Dns_.RecordFor<T> => Dns_.isDnsRecord(u) && u._tag === type, {
|
|
13863
|
+
identifier: `Dns${type.charAt(0)}${type.slice(1).toLowerCase()}Record`,
|
|
13864
|
+
toCodecJson: () => {
|
|
13865
|
+
const json = TaggedStruct(type, fields)
|
|
13866
|
+
return link<Dns_.RecordFor<T>>()(
|
|
13867
|
+
json,
|
|
13868
|
+
SchemaTransformation.transformEffect({
|
|
13869
|
+
decode: (input, options) => {
|
|
13870
|
+
const { _tag, ...rest } = input as { readonly _tag: T }
|
|
13871
|
+
const result = Dns_.makeRecord(type, rest as Dns_.RecordFields<T>)
|
|
13872
|
+
return Result_.isSuccess(result)
|
|
13873
|
+
? Effect.succeed(result.success)
|
|
13874
|
+
: Effect.fail(new SchemaIssue.InvalidValue({ message: result.failure.message }, input, options))
|
|
13875
|
+
},
|
|
13876
|
+
// Records hold only their tag and fields as own properties.
|
|
13877
|
+
encode: (record) => Effect.succeed({ ...record } as unknown as typeof json["Type"])
|
|
13878
|
+
})
|
|
13879
|
+
)
|
|
13880
|
+
}
|
|
13881
|
+
})
|
|
13882
|
+
|
|
13883
|
+
/**
|
|
13884
|
+
* Type-level representation of {@link DnsARecord}.
|
|
13885
|
+
*
|
|
13886
|
+
* @stability experimental
|
|
13887
|
+
* @category models
|
|
13888
|
+
* @since 4.0.0
|
|
13889
|
+
*/
|
|
13890
|
+
export interface DnsARecord extends declare<Dns_.A> {
|
|
13891
|
+
readonly "Rebuild": DnsARecord
|
|
13892
|
+
}
|
|
13893
|
+
|
|
13894
|
+
/**
|
|
13895
|
+
* Schema for already-constructed IPv4 address (`A`) DNS records.
|
|
13896
|
+
*
|
|
13897
|
+
* @stability experimental
|
|
13898
|
+
* @category schemas
|
|
13899
|
+
* @since 4.0.0
|
|
13900
|
+
*/
|
|
13901
|
+
export const DnsARecord: DnsARecord = dnsRecordOfType("A", {
|
|
13902
|
+
address: dnsCanonicalAddress(Ipv4Address, NetAddress_.ipv4FromString)
|
|
13903
|
+
})
|
|
13904
|
+
|
|
13905
|
+
/**
|
|
13906
|
+
* Type-level representation of {@link DnsAaaaRecord}.
|
|
13907
|
+
*
|
|
13908
|
+
* @stability experimental
|
|
13909
|
+
* @category models
|
|
13910
|
+
* @since 4.0.0
|
|
13911
|
+
*/
|
|
13912
|
+
export interface DnsAaaaRecord extends declare<Dns_.Aaaa> {
|
|
13913
|
+
readonly "Rebuild": DnsAaaaRecord
|
|
13914
|
+
}
|
|
13915
|
+
|
|
13916
|
+
/**
|
|
13917
|
+
* Schema for already-constructed IPv6 address (`AAAA`) DNS records.
|
|
13918
|
+
*
|
|
13919
|
+
* @stability experimental
|
|
13920
|
+
* @category schemas
|
|
13921
|
+
* @since 4.0.0
|
|
13922
|
+
*/
|
|
13923
|
+
export const DnsAaaaRecord: DnsAaaaRecord = dnsRecordOfType("AAAA", {
|
|
13924
|
+
address: dnsCanonicalAddress(Ipv6Address, NetAddress_.ipv6FromString)
|
|
13925
|
+
})
|
|
13926
|
+
|
|
13927
|
+
/**
|
|
13928
|
+
* Type-level representation of {@link DnsCaaRecord}.
|
|
13929
|
+
*
|
|
13930
|
+
* @stability experimental
|
|
13931
|
+
* @category models
|
|
13932
|
+
* @since 4.0.0
|
|
13933
|
+
*/
|
|
13934
|
+
export interface DnsCaaRecord extends declare<Dns_.Caa> {
|
|
13935
|
+
readonly "Rebuild": DnsCaaRecord
|
|
13936
|
+
}
|
|
13937
|
+
|
|
13938
|
+
/**
|
|
13939
|
+
* Schema for already-constructed certification authority authorization (`CAA`) DNS records.
|
|
13940
|
+
*
|
|
13941
|
+
* @stability experimental
|
|
13942
|
+
* @category schemas
|
|
13943
|
+
* @since 4.0.0
|
|
13944
|
+
*/
|
|
13945
|
+
export const DnsCaaRecord: DnsCaaRecord = dnsRecordOfType("CAA", {
|
|
13946
|
+
critical: Boolean,
|
|
13947
|
+
tag: String.check(isPattern(/^[a-z0-9]+$/i)),
|
|
13948
|
+
value: String
|
|
13949
|
+
})
|
|
13950
|
+
|
|
13951
|
+
/**
|
|
13952
|
+
* Type-level representation of {@link DnsCnameRecord}.
|
|
13953
|
+
*
|
|
13954
|
+
* @stability experimental
|
|
13955
|
+
* @category models
|
|
13956
|
+
* @since 4.0.0
|
|
13957
|
+
*/
|
|
13958
|
+
export interface DnsCnameRecord extends declare<Dns_.Cname> {
|
|
13959
|
+
readonly "Rebuild": DnsCnameRecord
|
|
13960
|
+
}
|
|
13961
|
+
|
|
13962
|
+
/**
|
|
13963
|
+
* Schema for already-constructed canonical name (`CNAME`) DNS records.
|
|
13964
|
+
*
|
|
13965
|
+
* @stability experimental
|
|
13966
|
+
* @category schemas
|
|
13967
|
+
* @since 4.0.0
|
|
13968
|
+
*/
|
|
13969
|
+
export const DnsCnameRecord: DnsCnameRecord = dnsRecordOfType("CNAME", { target: DomainName })
|
|
13970
|
+
|
|
13971
|
+
/**
|
|
13972
|
+
* Type-level representation of {@link DnsMxRecord}.
|
|
13973
|
+
*
|
|
13974
|
+
* @stability experimental
|
|
13975
|
+
* @category models
|
|
13976
|
+
* @since 4.0.0
|
|
13977
|
+
*/
|
|
13978
|
+
export interface DnsMxRecord extends declare<Dns_.Mx> {
|
|
13979
|
+
readonly "Rebuild": DnsMxRecord
|
|
13980
|
+
}
|
|
13981
|
+
|
|
13982
|
+
/**
|
|
13983
|
+
* Schema for already-constructed mail exchange (`MX`) DNS records.
|
|
13984
|
+
*
|
|
13985
|
+
* @stability experimental
|
|
13986
|
+
* @category schemas
|
|
13987
|
+
* @since 4.0.0
|
|
13988
|
+
*/
|
|
13989
|
+
export const DnsMxRecord: DnsMxRecord = dnsRecordOfType("MX", { exchange: DomainName, priority: dnsUint16 })
|
|
13990
|
+
|
|
13991
|
+
/**
|
|
13992
|
+
* Type-level representation of {@link DnsNaptrRecord}.
|
|
13993
|
+
*
|
|
13994
|
+
* @stability experimental
|
|
13995
|
+
* @category models
|
|
13996
|
+
* @since 4.0.0
|
|
13997
|
+
*/
|
|
13998
|
+
export interface DnsNaptrRecord extends declare<Dns_.Naptr> {
|
|
13999
|
+
readonly "Rebuild": DnsNaptrRecord
|
|
14000
|
+
}
|
|
14001
|
+
|
|
14002
|
+
/**
|
|
14003
|
+
* Schema for already-constructed naming authority pointer (`NAPTR`) DNS records.
|
|
14004
|
+
*
|
|
14005
|
+
* @stability experimental
|
|
14006
|
+
* @category schemas
|
|
14007
|
+
* @since 4.0.0
|
|
14008
|
+
*/
|
|
14009
|
+
export const DnsNaptrRecord: DnsNaptrRecord = dnsRecordOfType("NAPTR", {
|
|
14010
|
+
order: dnsUint16,
|
|
14011
|
+
preference: dnsUint16,
|
|
14012
|
+
flags: String,
|
|
14013
|
+
service: String,
|
|
14014
|
+
regexp: String,
|
|
14015
|
+
replacement: DomainName
|
|
14016
|
+
})
|
|
14017
|
+
|
|
14018
|
+
/**
|
|
14019
|
+
* Type-level representation of {@link DnsNsRecord}.
|
|
14020
|
+
*
|
|
14021
|
+
* @stability experimental
|
|
14022
|
+
* @category models
|
|
14023
|
+
* @since 4.0.0
|
|
14024
|
+
*/
|
|
14025
|
+
export interface DnsNsRecord extends declare<Dns_.Ns> {
|
|
14026
|
+
readonly "Rebuild": DnsNsRecord
|
|
14027
|
+
}
|
|
14028
|
+
|
|
14029
|
+
/**
|
|
14030
|
+
* Schema for already-constructed name server (`NS`) DNS records.
|
|
14031
|
+
*
|
|
14032
|
+
* @stability experimental
|
|
14033
|
+
* @category schemas
|
|
14034
|
+
* @since 4.0.0
|
|
14035
|
+
*/
|
|
14036
|
+
export const DnsNsRecord: DnsNsRecord = dnsRecordOfType("NS", { host: DomainName })
|
|
14037
|
+
|
|
14038
|
+
/**
|
|
14039
|
+
* Type-level representation of {@link DnsPtrRecord}.
|
|
14040
|
+
*
|
|
14041
|
+
* @stability experimental
|
|
14042
|
+
* @category models
|
|
14043
|
+
* @since 4.0.0
|
|
14044
|
+
*/
|
|
14045
|
+
export interface DnsPtrRecord extends declare<Dns_.Ptr> {
|
|
14046
|
+
readonly "Rebuild": DnsPtrRecord
|
|
14047
|
+
}
|
|
14048
|
+
|
|
14049
|
+
/**
|
|
14050
|
+
* Schema for already-constructed pointer (`PTR`) DNS records.
|
|
14051
|
+
*
|
|
14052
|
+
* @stability experimental
|
|
14053
|
+
* @category schemas
|
|
14054
|
+
* @since 4.0.0
|
|
14055
|
+
*/
|
|
14056
|
+
export const DnsPtrRecord: DnsPtrRecord = dnsRecordOfType("PTR", { host: NonEmptyString })
|
|
14057
|
+
|
|
14058
|
+
/**
|
|
14059
|
+
* Type-level representation of {@link DnsSoaRecord}.
|
|
14060
|
+
*
|
|
14061
|
+
* @stability experimental
|
|
14062
|
+
* @category models
|
|
14063
|
+
* @since 4.0.0
|
|
14064
|
+
*/
|
|
14065
|
+
export interface DnsSoaRecord extends declare<Dns_.Soa> {
|
|
14066
|
+
readonly "Rebuild": DnsSoaRecord
|
|
14067
|
+
}
|
|
14068
|
+
|
|
14069
|
+
/**
|
|
14070
|
+
* Schema for already-constructed start of authority (`SOA`) DNS records.
|
|
14071
|
+
*
|
|
14072
|
+
* @stability experimental
|
|
14073
|
+
* @category schemas
|
|
14074
|
+
* @since 4.0.0
|
|
14075
|
+
*/
|
|
14076
|
+
export const DnsSoaRecord: DnsSoaRecord = dnsRecordOfType("SOA", {
|
|
14077
|
+
primary: DomainName,
|
|
14078
|
+
admin: NonEmptyString,
|
|
14079
|
+
serial: dnsUint32,
|
|
14080
|
+
refresh: dnsSeconds,
|
|
14081
|
+
retry: dnsSeconds,
|
|
14082
|
+
expire: dnsSeconds,
|
|
14083
|
+
minimum: dnsSeconds
|
|
14084
|
+
})
|
|
14085
|
+
|
|
14086
|
+
/**
|
|
14087
|
+
* Type-level representation of {@link DnsSrvRecord}.
|
|
14088
|
+
*
|
|
14089
|
+
* @stability experimental
|
|
14090
|
+
* @category models
|
|
14091
|
+
* @since 4.0.0
|
|
14092
|
+
*/
|
|
14093
|
+
export interface DnsSrvRecord extends declare<Dns_.Srv> {
|
|
14094
|
+
readonly "Rebuild": DnsSrvRecord
|
|
14095
|
+
}
|
|
14096
|
+
|
|
14097
|
+
/**
|
|
14098
|
+
* Schema for already-constructed service locator (`SRV`) DNS records.
|
|
14099
|
+
*
|
|
14100
|
+
* @stability experimental
|
|
14101
|
+
* @category schemas
|
|
14102
|
+
* @since 4.0.0
|
|
14103
|
+
*/
|
|
14104
|
+
export const DnsSrvRecord: DnsSrvRecord = dnsRecordOfType("SRV", {
|
|
14105
|
+
target: DomainName,
|
|
14106
|
+
port: dnsUint16,
|
|
14107
|
+
priority: dnsUint16,
|
|
14108
|
+
weight: dnsUint16
|
|
14109
|
+
})
|
|
14110
|
+
|
|
14111
|
+
/**
|
|
14112
|
+
* Type-level representation of {@link DnsTlsaRecord}.
|
|
14113
|
+
*
|
|
14114
|
+
* @stability experimental
|
|
14115
|
+
* @category models
|
|
14116
|
+
* @since 4.0.0
|
|
14117
|
+
*/
|
|
14118
|
+
export interface DnsTlsaRecord extends declare<Dns_.Tlsa> {
|
|
14119
|
+
readonly "Rebuild": DnsTlsaRecord
|
|
14120
|
+
}
|
|
14121
|
+
|
|
14122
|
+
/**
|
|
14123
|
+
* Schema for already-constructed TLS authentication (`TLSA`) DNS records.
|
|
14124
|
+
*
|
|
14125
|
+
* **Details**
|
|
14126
|
+
*
|
|
14127
|
+
* The default JSON serializer encodes the certificate association `data` as a
|
|
14128
|
+
* hex string.
|
|
14129
|
+
*
|
|
14130
|
+
* @stability experimental
|
|
14131
|
+
* @category schemas
|
|
14132
|
+
* @since 4.0.0
|
|
14133
|
+
*/
|
|
14134
|
+
export const DnsTlsaRecord: DnsTlsaRecord = dnsRecordOfType("TLSA", {
|
|
14135
|
+
certUsage: dnsUint8,
|
|
14136
|
+
selector: dnsUint8,
|
|
14137
|
+
matchingType: dnsUint8,
|
|
14138
|
+
data: Uint8ArrayFromHex
|
|
14139
|
+
})
|
|
14140
|
+
|
|
14141
|
+
/**
|
|
14142
|
+
* Type-level representation of {@link DnsTxtRecord}.
|
|
14143
|
+
*
|
|
14144
|
+
* @stability experimental
|
|
14145
|
+
* @category models
|
|
14146
|
+
* @since 4.0.0
|
|
14147
|
+
*/
|
|
14148
|
+
export interface DnsTxtRecord extends declare<Dns_.Txt> {
|
|
14149
|
+
readonly "Rebuild": DnsTxtRecord
|
|
14150
|
+
}
|
|
14151
|
+
|
|
14152
|
+
/**
|
|
14153
|
+
* Schema for already-constructed text (`TXT`) DNS records.
|
|
14154
|
+
*
|
|
14155
|
+
* @stability experimental
|
|
14156
|
+
* @category schemas
|
|
14157
|
+
* @since 4.0.0
|
|
14158
|
+
*/
|
|
14159
|
+
export const DnsTxtRecord: DnsTxtRecord = dnsRecordOfType("TXT", { chunks: NonEmptyArray(String) })
|
|
14160
|
+
|
|
14161
|
+
/**
|
|
14162
|
+
* Type-level representation of {@link DnsRecord}.
|
|
14163
|
+
*
|
|
14164
|
+
* @stability experimental
|
|
14165
|
+
* @category models
|
|
14166
|
+
* @since 4.0.0
|
|
14167
|
+
*/
|
|
14168
|
+
export interface DnsRecord extends
|
|
14169
|
+
Union<
|
|
14170
|
+
readonly [
|
|
14171
|
+
DnsARecord,
|
|
14172
|
+
DnsAaaaRecord,
|
|
14173
|
+
DnsCaaRecord,
|
|
14174
|
+
DnsCnameRecord,
|
|
14175
|
+
DnsMxRecord,
|
|
14176
|
+
DnsNaptrRecord,
|
|
14177
|
+
DnsNsRecord,
|
|
14178
|
+
DnsPtrRecord,
|
|
14179
|
+
DnsSoaRecord,
|
|
14180
|
+
DnsSrvRecord,
|
|
14181
|
+
DnsTlsaRecord,
|
|
14182
|
+
DnsTxtRecord
|
|
14183
|
+
]
|
|
14184
|
+
>
|
|
14185
|
+
{
|
|
14186
|
+
readonly "Rebuild": DnsRecord
|
|
14187
|
+
}
|
|
14188
|
+
|
|
14189
|
+
/**
|
|
14190
|
+
* Schema for already-constructed DNS records of any supported record type.
|
|
14191
|
+
*
|
|
14192
|
+
* **Details**
|
|
14193
|
+
*
|
|
14194
|
+
* The default JSON serializer encodes records as objects tagged by record type,
|
|
14195
|
+
* with addresses and names as canonical strings, SOA timers as whole seconds,
|
|
14196
|
+
* and TLSA data as hex, such as
|
|
14197
|
+
* `{ "_tag": "SRV", "target": "db.internal", "port": 5432, "priority": 10, "weight": 5 }`.
|
|
14198
|
+
* Decoding accepts only canonical addresses and normalized domain names, and
|
|
14199
|
+
* reports invalid fields with their path.
|
|
14200
|
+
*
|
|
14201
|
+
* @stability experimental
|
|
14202
|
+
* @category schemas
|
|
14203
|
+
* @since 4.0.0
|
|
14204
|
+
*/
|
|
14205
|
+
export const DnsRecord: DnsRecord = Union([
|
|
14206
|
+
DnsARecord,
|
|
14207
|
+
DnsAaaaRecord,
|
|
14208
|
+
DnsCaaRecord,
|
|
14209
|
+
DnsCnameRecord,
|
|
14210
|
+
DnsMxRecord,
|
|
14211
|
+
DnsNaptrRecord,
|
|
14212
|
+
DnsNsRecord,
|
|
14213
|
+
DnsPtrRecord,
|
|
14214
|
+
DnsSoaRecord,
|
|
14215
|
+
DnsSrvRecord,
|
|
14216
|
+
DnsTlsaRecord,
|
|
14217
|
+
DnsTxtRecord
|
|
14218
|
+
]).annotate({ identifier: "DnsRecord" })
|
|
14219
|
+
|
|
13552
14220
|
// -----------------------------------------------------------------------------
|
|
13553
14221
|
// Exit schemas
|
|
13554
14222
|
// -----------------------------------------------------------------------------
|
|
@@ -15141,6 +15809,10 @@ export interface Class<Self, S extends Constraint & { readonly fields: Struct.Fi
|
|
|
15141
15809
|
*
|
|
15142
15810
|
* **Gotchas**
|
|
15143
15811
|
*
|
|
15812
|
+
* Fields with the same name replace inherited fields. Use this to refine
|
|
15813
|
+
* validation or change encoding. Effect does not check compatibility; the
|
|
15814
|
+
* caller must ensure the replacement preserves the base class contract.
|
|
15815
|
+
*
|
|
15144
15816
|
* Checks from a `Struct` argument are evaluated against the full subclass
|
|
15145
15817
|
* value after inherited and extension fields are merged. Object-wide checks
|
|
15146
15818
|
* such as `isMaxProperties` count inherited fields too.
|