effect 4.1.5 → 4.1.6
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/ai-docs/package.json +2 -2
- package/dist/Channel.d.ts +104 -7
- package/dist/Channel.d.ts.map +1 -1
- package/dist/Channel.js +73 -4
- package/dist/Channel.js.map +1 -1
- package/dist/Codegen.d.ts +7 -2
- package/dist/Codegen.d.ts.map +1 -1
- package/dist/Codegen.js +7 -2
- package/dist/Codegen.js.map +1 -1
- package/dist/Effect.d.ts +139 -18
- package/dist/Effect.d.ts.map +1 -1
- package/dist/Effect.js +10 -2
- package/dist/Effect.js.map +1 -1
- package/dist/Equal.d.ts +4 -4
- package/dist/Equal.d.ts.map +1 -1
- package/dist/Equal.js +78 -65
- package/dist/Equal.js.map +1 -1
- package/dist/Hash.d.ts.map +1 -1
- package/dist/Hash.js +24 -17
- package/dist/Hash.js.map +1 -1
- package/dist/LayerRef.d.ts +1 -1
- package/dist/LayerRef.d.ts.map +1 -1
- package/dist/LayerRef.js +3 -3
- package/dist/LayerRef.js.map +1 -1
- package/dist/Logger.d.ts +37 -13
- package/dist/Logger.d.ts.map +1 -1
- package/dist/Logger.js +39 -10
- package/dist/Logger.js.map +1 -1
- package/dist/Match.d.ts +23 -23
- package/dist/Match.d.ts.map +1 -1
- package/dist/Match.js.map +1 -1
- package/dist/Order.js +1 -1
- package/dist/Order.js.map +1 -1
- package/dist/Schema.d.ts +41 -0
- package/dist/Schema.d.ts.map +1 -1
- package/dist/Schema.js +51 -390
- package/dist/Schema.js.map +1 -1
- package/dist/SchemaAST.d.ts.map +1 -1
- package/dist/SchemaAST.js +0 -3
- package/dist/SchemaAST.js.map +1 -1
- package/dist/ScopedCache.d.ts.map +1 -1
- package/dist/ScopedCache.js +6 -4
- package/dist/ScopedCache.js.map +1 -1
- package/dist/Stream.d.ts +128 -5
- package/dist/Stream.d.ts.map +1 -1
- package/dist/Stream.js +124 -29
- package/dist/Stream.js.map +1 -1
- package/dist/String.js +1 -1
- package/dist/String.js.map +1 -1
- package/dist/Tracer.d.ts +10 -0
- package/dist/Tracer.d.ts.map +1 -1
- package/dist/Tracer.js +2 -0
- package/dist/Tracer.js.map +1 -1
- package/dist/ai/McpSchema.d.ts +88 -88
- package/dist/ai/McpSchema.d.ts.map +1 -1
- package/dist/ai/McpServer.d.ts +152 -2
- package/dist/ai/McpServer.d.ts.map +1 -1
- package/dist/ai/McpServer.js +8 -2
- package/dist/ai/McpServer.js.map +1 -1
- package/dist/ai/Prompt.d.ts +3 -1
- package/dist/ai/Prompt.d.ts.map +1 -1
- package/dist/ai/Prompt.js +17 -3
- package/dist/ai/Prompt.js.map +1 -1
- package/dist/ai/Skill.d.ts +172 -0
- package/dist/ai/Skill.d.ts.map +1 -0
- package/dist/ai/Skill.js +209 -0
- package/dist/ai/Skill.js.map +1 -0
- package/dist/ai/index.d.ts +5 -0
- package/dist/ai/index.d.ts.map +1 -1
- package/dist/ai/index.js +5 -0
- package/dist/ai/index.js.map +1 -1
- package/dist/cluster/ClusterWorkflowEngine.d.ts.map +1 -1
- package/dist/cluster/ClusterWorkflowEngine.js +155 -83
- package/dist/cluster/ClusterWorkflowEngine.js.map +1 -1
- package/dist/cluster/MessageStorage.d.ts +56 -0
- package/dist/cluster/MessageStorage.d.ts.map +1 -1
- package/dist/cluster/MessageStorage.js +18 -2
- package/dist/cluster/MessageStorage.js.map +1 -1
- package/dist/cluster/SqlMessageStorage.d.ts.map +1 -1
- package/dist/cluster/SqlMessageStorage.js +45 -22
- package/dist/cluster/SqlMessageStorage.js.map +1 -1
- package/dist/cluster/internal/entityActivation.js +2 -0
- package/dist/cluster/internal/entityActivation.js.map +1 -1
- package/dist/cluster/internal/entityManager.js +8 -5
- package/dist/cluster/internal/entityManager.js.map +1 -1
- package/dist/encoding/Base64.js +5 -1
- package/dist/encoding/Base64.js.map +1 -1
- package/dist/encoding/Base64Url.d.ts.map +1 -1
- package/dist/encoding/Base64Url.js +6 -1
- package/dist/encoding/Base64Url.js.map +1 -1
- package/dist/encoding/Xml.d.ts +38 -9
- package/dist/encoding/Xml.d.ts.map +1 -1
- package/dist/encoding/Xml.js +63 -31
- package/dist/encoding/Xml.js.map +1 -1
- package/dist/http/FetchHttpClient.d.ts +2 -1
- package/dist/http/FetchHttpClient.d.ts.map +1 -1
- package/dist/http/FetchHttpClient.js +14 -10
- package/dist/http/FetchHttpClient.js.map +1 -1
- package/dist/http/Headers.d.ts +201 -3
- package/dist/http/Headers.d.ts.map +1 -1
- package/dist/http/Headers.js +205 -3
- package/dist/http/Headers.js.map +1 -1
- package/dist/http/HttpClient.d.ts.map +1 -1
- package/dist/http/HttpClient.js +11 -7
- package/dist/http/HttpClient.js.map +1 -1
- package/dist/http/HttpClientError.d.ts +1 -0
- package/dist/http/HttpClientError.d.ts.map +1 -1
- package/dist/http/HttpClientError.js +32 -9
- package/dist/http/HttpClientError.js.map +1 -1
- package/dist/http/HttpClientRequest.d.ts +46 -0
- package/dist/http/HttpClientRequest.d.ts.map +1 -1
- package/dist/http/HttpClientRequest.js +15 -0
- package/dist/http/HttpClientRequest.js.map +1 -1
- package/dist/http/HttpClientResponse.d.ts +132 -0
- package/dist/http/HttpClientResponse.d.ts.map +1 -1
- package/dist/http/HttpClientResponse.js +83 -0
- package/dist/http/HttpClientResponse.js.map +1 -1
- package/dist/http/HttpMiddleware.js +1 -1
- package/dist/http/HttpMiddleware.js.map +1 -1
- package/dist/http/HttpServerResponse.d.ts +118 -0
- package/dist/http/HttpServerResponse.d.ts.map +1 -1
- package/dist/http/HttpServerResponse.js +43 -0
- package/dist/http/HttpServerResponse.js.map +1 -1
- package/dist/http/Multipart.d.ts.map +1 -1
- package/dist/http/Multipart.js +0 -5
- package/dist/http/Multipart.js.map +1 -1
- package/dist/http/MultipartParser/internal/contentType.d.ts +6 -0
- package/dist/http/MultipartParser/internal/contentType.d.ts.map +1 -1
- package/dist/http/MultipartParser/internal/contentType.js +1 -1
- package/dist/http/MultipartParser/internal/contentType.js.map +1 -1
- package/dist/http/internal/clientPath.d.ts +2 -0
- package/dist/http/internal/clientPath.d.ts.map +1 -0
- package/dist/http/internal/clientPath.js +24 -0
- package/dist/http/internal/clientPath.js.map +1 -0
- package/dist/http/internal/redactedPath.js +2 -0
- package/dist/http/internal/redactedPath.js.map +1 -1
- package/dist/http/internal/tracing.js +5 -3
- package/dist/http/internal/tracing.js.map +1 -1
- package/dist/http-api/HttpApi.d.ts +2 -2
- package/dist/http-api/HttpApi.d.ts.map +1 -1
- package/dist/http-api/HttpApi.js +30 -7
- package/dist/http-api/HttpApi.js.map +1 -1
- package/dist/http-api/HttpApiBuilder.d.ts.map +1 -1
- package/dist/http-api/HttpApiBuilder.js +5 -2
- package/dist/http-api/HttpApiBuilder.js.map +1 -1
- package/dist/http-api/HttpApiClient.d.ts.map +1 -1
- package/dist/http-api/HttpApiClient.js +23 -6
- package/dist/http-api/HttpApiClient.js.map +1 -1
- package/dist/http-api/internal/redactedKeys.d.ts +2 -0
- package/dist/http-api/internal/redactedKeys.d.ts.map +1 -0
- package/dist/http-api/internal/redactedKeys.js +37 -0
- package/dist/http-api/internal/redactedKeys.js.map +1 -0
- package/dist/internal/base64.js +34 -2
- package/dist/internal/base64.js.map +1 -1
- package/dist/internal/dateTime.js +35 -17
- package/dist/internal/dateTime.js.map +1 -1
- package/dist/internal/effect.js +9 -1
- package/dist/internal/effect.js.map +1 -1
- package/dist/internal/equal.js +14 -13
- package/dist/internal/equal.js.map +1 -1
- package/dist/internal/hash.js +4 -1
- package/dist/internal/hash.js.map +1 -1
- package/dist/internal/matcher.js +17 -17
- package/dist/internal/matcher.js.map +1 -1
- package/dist/internal/schema/schemaCodegen.js +3 -2
- package/dist/internal/schema/schemaCodegen.js.map +1 -1
- package/dist/internal/schema/schemaCodegenBuiltIns.d.ts +2 -0
- package/dist/internal/schema/schemaCodegenBuiltIns.d.ts.map +1 -0
- package/dist/internal/schema/schemaCodegenBuiltIns.js +425 -0
- package/dist/internal/schema/schemaCodegenBuiltIns.js.map +1 -0
- package/dist/internal/schema/toEquivalence.js +3 -4
- package/dist/internal/schema/toEquivalence.js.map +1 -1
- package/dist/internal/version.js +1 -1
- package/dist/jose/JoseError.d.ts +51 -1
- package/dist/jose/JoseError.d.ts.map +1 -1
- package/dist/jose/JoseError.js +25 -18
- package/dist/jose/JoseError.js.map +1 -1
- package/dist/jose/internal/compact.js +10 -5
- package/dist/jose/internal/compact.js.map +1 -1
- package/dist/observability/Otlp.d.ts +19 -0
- package/dist/observability/Otlp.d.ts.map +1 -1
- package/dist/observability/Otlp.js +10 -0
- package/dist/observability/Otlp.js.map +1 -1
- package/dist/observability/OtlpExporter.d.ts +49 -13
- package/dist/observability/OtlpExporter.d.ts.map +1 -1
- package/dist/observability/OtlpExporter.js +135 -54
- package/dist/observability/OtlpExporter.js.map +1 -1
- package/dist/observability/OtlpLogger.d.ts +14 -0
- package/dist/observability/OtlpLogger.d.ts.map +1 -1
- package/dist/observability/OtlpLogger.js +10 -2
- package/dist/observability/OtlpLogger.js.map +1 -1
- package/dist/observability/OtlpMetrics.d.ts.map +1 -1
- package/dist/observability/OtlpMetrics.js +2 -0
- package/dist/observability/OtlpMetrics.js.map +1 -1
- package/dist/observability/OtlpTracer.d.ts +14 -0
- package/dist/observability/OtlpTracer.d.ts.map +1 -1
- package/dist/observability/OtlpTracer.js +10 -2
- package/dist/observability/OtlpTracer.js.map +1 -1
- package/dist/persistence/KeyValueStore.d.ts.map +1 -1
- package/dist/persistence/KeyValueStore.js +6 -4
- package/dist/persistence/KeyValueStore.js.map +1 -1
- package/dist/reactivity/Atom.d.ts.map +1 -1
- package/dist/reactivity/Atom.js +10 -9
- package/dist/reactivity/Atom.js.map +1 -1
- package/dist/rpc/RpcClient.d.ts.map +1 -1
- package/dist/rpc/RpcClient.js +32 -1
- package/dist/rpc/RpcClient.js.map +1 -1
- package/dist/rpc/RpcGroup.d.ts +1 -1
- package/dist/rpc/RpcGroup.d.ts.map +1 -1
- package/dist/rpc/RpcGroup.js +4 -0
- package/dist/rpc/RpcGroup.js.map +1 -1
- package/dist/sql/Migrator.d.ts.map +1 -1
- package/dist/sql/Migrator.js +2 -5
- package/dist/sql/Migrator.js.map +1 -1
- package/dist/sql/SqlClient.d.ts.map +1 -1
- package/dist/sql/SqlClient.js +5 -1
- package/dist/sql/SqlClient.js.map +1 -1
- package/dist/workflow/Activity.d.ts +18 -0
- package/dist/workflow/Activity.d.ts.map +1 -1
- package/dist/workflow/Activity.js +13 -4
- package/dist/workflow/Activity.js.map +1 -1
- package/dist/workflow/Workflow.d.ts +10 -9
- package/dist/workflow/Workflow.d.ts.map +1 -1
- package/dist/workflow/Workflow.js +33 -22
- package/dist/workflow/Workflow.js.map +1 -1
- package/dist/workflow/WorkflowEngine.d.ts.map +1 -1
- package/dist/workflow/WorkflowEngine.js +26 -12
- package/dist/workflow/WorkflowEngine.js.map +1 -1
- package/dist/workflow/internal/retry.d.ts +2 -0
- package/dist/workflow/internal/retry.d.ts.map +1 -0
- package/dist/workflow/internal/retry.js +11 -0
- package/dist/workflow/internal/retry.js.map +1 -0
- package/dist/workflow/internal/scope.d.ts +2 -0
- package/dist/workflow/internal/scope.d.ts.map +1 -0
- package/dist/workflow/internal/scope.js +26 -0
- package/dist/workflow/internal/scope.js.map +1 -0
- package/package.json +3 -3
- package/src/Channel.ts +105 -8
- package/src/Codegen.ts +7 -2
- package/src/Effect.ts +224 -48
- package/src/Equal.ts +85 -79
- package/src/Hash.ts +30 -22
- package/src/LayerRef.ts +6 -4
- package/src/Logger.ts +68 -25
- package/src/Match.ts +78 -50
- package/src/Order.ts +1 -1
- package/src/Schema.ts +79 -296
- package/src/SchemaAST.ts +0 -1
- package/src/ScopedCache.ts +6 -4
- package/src/Stream.ts +167 -33
- package/src/String.ts +1 -1
- package/src/Tracer.ts +10 -0
- package/src/ai/McpServer.ts +161 -4
- package/src/ai/Prompt.ts +20 -3
- package/src/ai/Skill.ts +236 -0
- package/src/ai/index.ts +6 -0
- package/src/cluster/ClusterWorkflowEngine.ts +172 -96
- package/src/cluster/MessageStorage.ts +51 -2
- package/src/cluster/SqlMessageStorage.ts +81 -34
- package/src/cluster/internal/entityActivation.ts +6 -0
- package/src/cluster/internal/entityManager.ts +8 -4
- package/src/encoding/Base64.ts +5 -1
- package/src/encoding/Base64Url.ts +6 -1
- package/src/encoding/Xml.ts +96 -26
- package/src/http/FetchHttpClient.ts +8 -5
- package/src/http/Headers.ts +309 -3
- package/src/http/HttpClient.ts +19 -7
- package/src/http/HttpClientError.ts +42 -9
- package/src/http/HttpClientRequest.ts +51 -0
- package/src/http/HttpClientResponse.ts +156 -0
- package/src/http/HttpMiddleware.ts +1 -1
- package/src/http/HttpServerResponse.ts +126 -0
- package/src/http/Multipart.ts +0 -5
- package/src/http/MultipartParser/internal/contentType.ts +1 -1
- package/src/http/internal/clientPath.ts +39 -0
- package/src/http/internal/redactedPath.ts +4 -0
- package/src/http/internal/tracing.ts +6 -3
- package/src/http-api/HttpApi.ts +29 -8
- package/src/http-api/HttpApiBuilder.ts +7 -2
- package/src/http-api/HttpApiClient.ts +30 -7
- package/src/http-api/internal/redactedKeys.ts +40 -0
- package/src/internal/base64.ts +57 -2
- package/src/internal/dateTime.ts +43 -24
- package/src/internal/effect.ts +31 -102
- package/src/internal/equal.ts +37 -17
- package/src/internal/hash.ts +5 -1
- package/src/internal/matcher.ts +34 -113
- package/src/internal/schema/schemaCodegen.ts +5 -4
- package/src/internal/schema/schemaCodegenBuiltIns.ts +343 -0
- package/src/internal/schema/toEquivalence.ts +3 -5
- package/src/internal/version.ts +1 -1
- package/src/jose/JoseError.ts +34 -0
- package/src/jose/internal/compact.ts +14 -5
- package/src/observability/Otlp.ts +29 -0
- package/src/observability/OtlpExporter.ts +206 -75
- package/src/observability/OtlpLogger.ts +24 -2
- package/src/observability/OtlpMetrics.ts +2 -0
- package/src/observability/OtlpTracer.ts +24 -3
- package/src/persistence/KeyValueStore.ts +17 -14
- package/src/reactivity/Atom.ts +12 -18
- package/src/rpc/RpcClient.ts +26 -1
- package/src/rpc/RpcGroup.ts +4 -1
- package/src/sql/Migrator.ts +2 -11
- package/src/sql/SqlClient.ts +14 -8
- package/src/workflow/Activity.ts +28 -4
- package/src/workflow/Workflow.ts +68 -44
- package/src/workflow/WorkflowEngine.ts +38 -15
- package/src/workflow/internal/retry.ts +12 -0
- package/src/workflow/internal/scope.ts +36 -0
package/src/Schema.ts
CHANGED
|
@@ -6913,7 +6913,6 @@ export function isTrimmed(annotations?: Annotations.Filter) {
|
|
|
6913
6913
|
payload: null
|
|
6914
6914
|
},
|
|
6915
6915
|
toJsonSchema: () => ({ pattern: regExp.source }),
|
|
6916
|
-
toCode: () => ({ runtime: "Schema.isTrimmed()" }),
|
|
6917
6916
|
arbitraryConstraint: {
|
|
6918
6917
|
patterns: [{ source: TRIMMED_PATTERN, flags: "" }]
|
|
6919
6918
|
},
|
|
@@ -6948,12 +6947,8 @@ export function isPattern(
|
|
|
6948
6947
|
const source = regExp.source
|
|
6949
6948
|
const flags = regExp.flags
|
|
6950
6949
|
const canExport = /^[dg]*uy?$/.test(flags)
|
|
6951
|
-
const runtimeRegExp = flags === ""
|
|
6952
|
-
? `new globalThis.RegExp(${format(source)})`
|
|
6953
|
-
: `new globalThis.RegExp(${format(source)}, ${format(flags)})`
|
|
6954
6950
|
return SchemaAST.isPattern(regExp, {
|
|
6955
6951
|
toJsonSchema: () => canExport ? { pattern: flags.endsWith("y") ? `^(?:${source})` : source } : [{}, true],
|
|
6956
|
-
toCode: () => ({ runtime: `Schema.isPattern(${runtimeRegExp})` }),
|
|
6957
6952
|
...annotations
|
|
6958
6953
|
})
|
|
6959
6954
|
}
|
|
@@ -6977,10 +6972,7 @@ export function isPattern(
|
|
|
6977
6972
|
* @since 4.0.0
|
|
6978
6973
|
*/
|
|
6979
6974
|
export function isStringFinite(annotations?: Annotations.Filter): SchemaAST.Filter<string> {
|
|
6980
|
-
return SchemaAST.isStringFinite(
|
|
6981
|
-
toCode: () => ({ runtime: "Schema.isStringFinite()" }),
|
|
6982
|
-
...annotations
|
|
6983
|
-
})
|
|
6975
|
+
return SchemaAST.isStringFinite(annotations)
|
|
6984
6976
|
}
|
|
6985
6977
|
/**
|
|
6986
6978
|
* Validates that a string is a signed base-10 integer literal for Effect's
|
|
@@ -7001,10 +6993,7 @@ export function isStringFinite(annotations?: Annotations.Filter): SchemaAST.Filt
|
|
|
7001
6993
|
* @since 4.0.0
|
|
7002
6994
|
*/
|
|
7003
6995
|
export function isStringBigInt(annotations?: Annotations.Filter): SchemaAST.Filter<string> {
|
|
7004
|
-
return SchemaAST.isStringBigInt(
|
|
7005
|
-
toCode: () => ({ runtime: "Schema.isStringBigInt()" }),
|
|
7006
|
-
...annotations
|
|
7007
|
-
})
|
|
6996
|
+
return SchemaAST.isStringBigInt(annotations)
|
|
7008
6997
|
}
|
|
7009
6998
|
/**
|
|
7010
6999
|
* Validates that a string has the `Symbol(description)` format used by Effect's
|
|
@@ -7020,10 +7009,7 @@ export function isStringBigInt(annotations?: Annotations.Filter): SchemaAST.Filt
|
|
|
7020
7009
|
* @since 4.0.0
|
|
7021
7010
|
*/
|
|
7022
7011
|
export function isStringSymbol(annotations?: Annotations.Filter): SchemaAST.Filter<string> {
|
|
7023
|
-
return SchemaAST.isStringSymbol(
|
|
7024
|
-
toCode: () => ({ runtime: "Schema.isStringSymbol()" }),
|
|
7025
|
-
...annotations
|
|
7026
|
-
})
|
|
7012
|
+
return SchemaAST.isStringSymbol(annotations)
|
|
7027
7013
|
}
|
|
7028
7014
|
|
|
7029
7015
|
const getUUIDRegExp = (version?: 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8): globalThis.RegExp => {
|
|
@@ -7076,7 +7062,6 @@ export function isUUID(version?: 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8, annotations?: An
|
|
|
7076
7062
|
payload: { version: version ?? null }
|
|
7077
7063
|
},
|
|
7078
7064
|
toJsonSchema: () => ({ pattern: regExp.source, format: "uuid" }),
|
|
7079
|
-
toCode: () => ({ runtime: version === undefined ? "Schema.isUUID()" : `Schema.isUUID(${version})` }),
|
|
7080
7065
|
...annotations
|
|
7081
7066
|
}
|
|
7082
7067
|
)
|
|
@@ -7117,7 +7102,6 @@ export function isGUID(annotations?: Annotations.Filter) {
|
|
|
7117
7102
|
id: "effect/schema/isGUID",
|
|
7118
7103
|
payload: null
|
|
7119
7104
|
},
|
|
7120
|
-
toCode: () => ({ runtime: "Schema.isGUID()" }),
|
|
7121
7105
|
...annotations
|
|
7122
7106
|
}
|
|
7123
7107
|
)
|
|
@@ -7155,7 +7139,6 @@ export function isULID(annotations?: Annotations.Filter) {
|
|
|
7155
7139
|
id: "effect/schema/isULID",
|
|
7156
7140
|
payload: null
|
|
7157
7141
|
},
|
|
7158
|
-
toCode: () => ({ runtime: "Schema.isULID()" }),
|
|
7159
7142
|
...annotations
|
|
7160
7143
|
}
|
|
7161
7144
|
)
|
|
@@ -7200,7 +7183,6 @@ export function isAscii(annotations?: Annotations.Filter) {
|
|
|
7200
7183
|
id: "effect/schema/isAscii",
|
|
7201
7184
|
payload: null
|
|
7202
7185
|
},
|
|
7203
|
-
toCode: () => ({ runtime: "Schema.isAscii()" }),
|
|
7204
7186
|
...annotations
|
|
7205
7187
|
}
|
|
7206
7188
|
)
|
|
@@ -7240,7 +7222,6 @@ export function isBase64(annotations?: Annotations.Filter) {
|
|
|
7240
7222
|
arbitraryConstraint: {
|
|
7241
7223
|
patterns: [{ source: pattern, flags: "" }]
|
|
7242
7224
|
},
|
|
7243
|
-
toCode: () => ({ runtime: "Schema.isBase64()" }),
|
|
7244
7225
|
...annotations
|
|
7245
7226
|
}
|
|
7246
7227
|
)
|
|
@@ -7281,7 +7262,6 @@ export function isBase64Url(annotations?: Annotations.Filter) {
|
|
|
7281
7262
|
arbitraryConstraint: {
|
|
7282
7263
|
patterns: [{ source: pattern, flags: "" }]
|
|
7283
7264
|
},
|
|
7284
|
-
toCode: () => ({ runtime: "Schema.isBase64Url()" }),
|
|
7285
7265
|
...annotations
|
|
7286
7266
|
}
|
|
7287
7267
|
)
|
|
@@ -7323,7 +7303,6 @@ export function isStartingWith(startsWith: string, annotations?: Annotations.Fil
|
|
|
7323
7303
|
payload: { startsWith }
|
|
7324
7304
|
},
|
|
7325
7305
|
toJsonSchema: () => literalToJsonSchema(jsonSchemaLiteral, startsWith, `^${RegExp_.escape(jsonSchemaLiteral)}`),
|
|
7326
|
-
toCode: () => ({ runtime: `Schema.isStartingWith(${format(startsWith)})` }),
|
|
7327
7306
|
arbitraryConstraint: {
|
|
7328
7307
|
patterns: [{ source: regExp.source, flags: regExp.flags }]
|
|
7329
7308
|
},
|
|
@@ -7357,7 +7336,6 @@ export function isEndingWith(endsWith: string, annotations?: Annotations.Filter)
|
|
|
7357
7336
|
payload: { endsWith }
|
|
7358
7337
|
},
|
|
7359
7338
|
toJsonSchema: () => literalToJsonSchema(jsonSchemaLiteral, endsWith, `${RegExp_.escape(jsonSchemaLiteral)}$`),
|
|
7360
|
-
toCode: () => ({ runtime: `Schema.isEndingWith(${format(endsWith)})` }),
|
|
7361
7339
|
arbitraryConstraint: {
|
|
7362
7340
|
patterns: [{ source: regExp.source, flags: regExp.flags }]
|
|
7363
7341
|
},
|
|
@@ -7392,7 +7370,6 @@ export function isIncluding(includes: string, annotations?: Annotations.Filter)
|
|
|
7392
7370
|
payload: { includes }
|
|
7393
7371
|
},
|
|
7394
7372
|
toJsonSchema: () => literalToJsonSchema(jsonSchemaLiteral, includes, RegExp_.escape(jsonSchemaLiteral)),
|
|
7395
|
-
toCode: () => ({ runtime: `Schema.isIncluding(${format(includes)})` }),
|
|
7396
7373
|
arbitraryConstraint: {
|
|
7397
7374
|
patterns: [{ source: regExp.source, flags: regExp.flags }]
|
|
7398
7375
|
},
|
|
@@ -7426,7 +7403,6 @@ export function isUppercased(annotations?: Annotations.Filter) {
|
|
|
7426
7403
|
payload: null
|
|
7427
7404
|
},
|
|
7428
7405
|
toJsonSchema: () => [{ pattern: regExp.source }, true],
|
|
7429
|
-
toCode: () => ({ runtime: "Schema.isUppercased()" }),
|
|
7430
7406
|
arbitraryConstraint: {
|
|
7431
7407
|
patterns: [{ source: UPPERCASED_PATTERN, flags: "" }]
|
|
7432
7408
|
},
|
|
@@ -7460,7 +7436,6 @@ export function isLowercased(annotations?: Annotations.Filter) {
|
|
|
7460
7436
|
payload: null
|
|
7461
7437
|
},
|
|
7462
7438
|
toJsonSchema: () => [{ pattern: regExp.source }, true],
|
|
7463
|
-
toCode: () => ({ runtime: "Schema.isLowercased()" }),
|
|
7464
7439
|
arbitraryConstraint: {
|
|
7465
7440
|
patterns: [{ source: LOWERCASED_PATTERN, flags: "" }]
|
|
7466
7441
|
},
|
|
@@ -7496,7 +7471,6 @@ export function isCapitalized(annotations?: Annotations.Filter) {
|
|
|
7496
7471
|
payload: null
|
|
7497
7472
|
},
|
|
7498
7473
|
toJsonSchema: () => [{ pattern: CAPITALIZED_PATTERN }, true],
|
|
7499
|
-
toCode: () => ({ runtime: "Schema.isCapitalized()" }),
|
|
7500
7474
|
arbitraryConstraint: {
|
|
7501
7475
|
patterns: [{ source: CAPITALIZED_PATTERN, flags: "" }]
|
|
7502
7476
|
},
|
|
@@ -7532,7 +7506,6 @@ export function isUncapitalized(annotations?: Annotations.Filter) {
|
|
|
7532
7506
|
payload: null
|
|
7533
7507
|
},
|
|
7534
7508
|
toJsonSchema: () => [{ pattern: UNCAPITALIZED_PATTERN }, true],
|
|
7535
|
-
toCode: () => ({ runtime: "Schema.isUncapitalized()" }),
|
|
7536
7509
|
arbitraryConstraint: {
|
|
7537
7510
|
patterns: [{ source: UNCAPITALIZED_PATTERN, flags: "" }]
|
|
7538
7511
|
},
|
|
@@ -7811,8 +7784,7 @@ export const isGreaterThan: (exclusiveMinimum: number, annotations?: Annotations
|
|
|
7811
7784
|
id: "effect/schema/isGreaterThan",
|
|
7812
7785
|
payload: { exclusiveMinimum: encodeNumberPayload(exclusiveMinimum) }
|
|
7813
7786
|
},
|
|
7814
|
-
toJsonSchema: () => ({ exclusiveMinimum })
|
|
7815
|
-
toCode: () => ({ runtime: `Schema.isGreaterThan(${format(exclusiveMinimum)})` })
|
|
7787
|
+
toJsonSchema: () => ({ exclusiveMinimum })
|
|
7816
7788
|
})
|
|
7817
7789
|
})
|
|
7818
7790
|
/**
|
|
@@ -7842,8 +7814,7 @@ export const isGreaterThanOrEqualTo: (minimum: number, annotations?: Annotations
|
|
|
7842
7814
|
id: "effect/schema/isGreaterThanOrEqualTo",
|
|
7843
7815
|
payload: { minimum: encodeNumberPayload(minimum) }
|
|
7844
7816
|
},
|
|
7845
|
-
toJsonSchema: () => ({ minimum })
|
|
7846
|
-
toCode: () => ({ runtime: `Schema.isGreaterThanOrEqualTo(${format(minimum)})` })
|
|
7817
|
+
toJsonSchema: () => ({ minimum })
|
|
7847
7818
|
})
|
|
7848
7819
|
})
|
|
7849
7820
|
/**
|
|
@@ -7873,8 +7844,7 @@ export const isLessThan: (exclusiveMaximum: number, annotations?: Annotations.Fi
|
|
|
7873
7844
|
id: "effect/schema/isLessThan",
|
|
7874
7845
|
payload: { exclusiveMaximum: encodeNumberPayload(exclusiveMaximum) }
|
|
7875
7846
|
},
|
|
7876
|
-
toJsonSchema: () => ({ exclusiveMaximum })
|
|
7877
|
-
toCode: () => ({ runtime: `Schema.isLessThan(${format(exclusiveMaximum)})` })
|
|
7847
|
+
toJsonSchema: () => ({ exclusiveMaximum })
|
|
7878
7848
|
})
|
|
7879
7849
|
})
|
|
7880
7850
|
/**
|
|
@@ -7904,8 +7874,7 @@ export const isLessThanOrEqualTo: (maximum: number, annotations?: Annotations.Fi
|
|
|
7904
7874
|
id: "effect/schema/isLessThanOrEqualTo",
|
|
7905
7875
|
payload: { maximum: encodeNumberPayload(maximum) }
|
|
7906
7876
|
},
|
|
7907
|
-
toJsonSchema: () => ({ maximum })
|
|
7908
|
-
toCode: () => ({ runtime: `Schema.isLessThanOrEqualTo(${format(maximum)})` })
|
|
7877
|
+
toJsonSchema: () => ({ maximum })
|
|
7909
7878
|
})
|
|
7910
7879
|
})
|
|
7911
7880
|
/**
|
|
@@ -7954,11 +7923,6 @@ export const isBetween: (options: {
|
|
|
7954
7923
|
toJsonSchema: () => ({
|
|
7955
7924
|
[exclusiveMinimum ? "exclusiveMinimum" : "minimum"]: options.minimum,
|
|
7956
7925
|
[exclusiveMaximum ? "exclusiveMaximum" : "maximum"]: options.maximum
|
|
7957
|
-
}),
|
|
7958
|
-
toCode: () => ({
|
|
7959
|
-
runtime: `Schema.isBetween({ minimum: ${format(options.minimum)}, maximum: ${
|
|
7960
|
-
format(options.maximum)
|
|
7961
|
-
}, exclusiveMinimum: ${format(exclusiveMinimum)}, exclusiveMaximum: ${format(exclusiveMaximum)} })`
|
|
7962
7926
|
})
|
|
7963
7927
|
}
|
|
7964
7928
|
}
|
|
@@ -7999,7 +7963,6 @@ export function isMultipleOf(
|
|
|
7999
7963
|
payload: { divisor }
|
|
8000
7964
|
},
|
|
8001
7965
|
toJsonSchema: () => ({ multipleOf: divisor }),
|
|
8002
|
-
toCode: () => ({ runtime: `Schema.isMultipleOf(${format(divisor)})` }),
|
|
8003
7966
|
...annotations
|
|
8004
7967
|
}
|
|
8005
7968
|
)
|
|
@@ -8037,7 +8000,6 @@ export function isInt(annotations?: Annotations.Filter) {
|
|
|
8037
8000
|
minimum: globalThis.Number.MIN_SAFE_INTEGER,
|
|
8038
8001
|
maximum: globalThis.Number.MAX_SAFE_INTEGER
|
|
8039
8002
|
}),
|
|
8040
|
-
toCode: () => ({ runtime: "Schema.isInt()" }),
|
|
8041
8003
|
arbitraryConstraint: {
|
|
8042
8004
|
number: "integer"
|
|
8043
8005
|
},
|
|
@@ -8159,9 +8121,6 @@ function encodeDatePayload(date: globalThis.Date): string {
|
|
|
8159
8121
|
return date.toISOString()
|
|
8160
8122
|
}
|
|
8161
8123
|
|
|
8162
|
-
function formatDateRuntime(date: globalThis.Date): string {
|
|
8163
|
-
return `new globalThis.Date(${format(date.getTime())})`
|
|
8164
|
-
}
|
|
8165
8124
|
/**
|
|
8166
8125
|
* Validates that a Date is greater than the specified value (exclusive).
|
|
8167
8126
|
*
|
|
@@ -8187,8 +8146,7 @@ export const isGreaterThanDate: (
|
|
|
8187
8146
|
id: "effect/schema/isGreaterThanDate",
|
|
8188
8147
|
payload: { exclusiveMinimum: encoded }
|
|
8189
8148
|
},
|
|
8190
|
-
toJsonSchema: () => [{}, true]
|
|
8191
|
-
toCode: () => ({ runtime: `Schema.isGreaterThanDate(${formatDateRuntime(exclusiveMinimum)})` })
|
|
8149
|
+
toJsonSchema: () => [{}, true]
|
|
8192
8150
|
}
|
|
8193
8151
|
}
|
|
8194
8152
|
})
|
|
@@ -8223,8 +8181,7 @@ export const isGreaterThanOrEqualToDate: (
|
|
|
8223
8181
|
id: "effect/schema/isGreaterThanOrEqualToDate",
|
|
8224
8182
|
payload: { minimum: encoded }
|
|
8225
8183
|
},
|
|
8226
|
-
toJsonSchema: () => [{}, true]
|
|
8227
|
-
toCode: () => ({ runtime: `Schema.isGreaterThanOrEqualToDate(${formatDateRuntime(minimum)})` })
|
|
8184
|
+
toJsonSchema: () => [{}, true]
|
|
8228
8185
|
}
|
|
8229
8186
|
}
|
|
8230
8187
|
})
|
|
@@ -8253,8 +8210,7 @@ export const isLessThanDate: (
|
|
|
8253
8210
|
id: "effect/schema/isLessThanDate",
|
|
8254
8211
|
payload: { exclusiveMaximum: encoded }
|
|
8255
8212
|
},
|
|
8256
|
-
toJsonSchema: () => [{}, true]
|
|
8257
|
-
toCode: () => ({ runtime: `Schema.isLessThanDate(${formatDateRuntime(exclusiveMaximum)})` })
|
|
8213
|
+
toJsonSchema: () => [{}, true]
|
|
8258
8214
|
}
|
|
8259
8215
|
}
|
|
8260
8216
|
})
|
|
@@ -8289,8 +8245,7 @@ export const isLessThanOrEqualToDate: (
|
|
|
8289
8245
|
id: "effect/schema/isLessThanOrEqualToDate",
|
|
8290
8246
|
payload: { maximum: encoded }
|
|
8291
8247
|
},
|
|
8292
|
-
toJsonSchema: () => [{}, true]
|
|
8293
|
-
toCode: () => ({ runtime: `Schema.isLessThanOrEqualToDate(${formatDateRuntime(maximum)})` })
|
|
8248
|
+
toJsonSchema: () => [{}, true]
|
|
8294
8249
|
}
|
|
8295
8250
|
}
|
|
8296
8251
|
})
|
|
@@ -8334,12 +8289,7 @@ export const isBetweenDate: (options: {
|
|
|
8334
8289
|
id: "effect/schema/isBetweenDate",
|
|
8335
8290
|
payload
|
|
8336
8291
|
},
|
|
8337
|
-
toJsonSchema: () => [{}, true]
|
|
8338
|
-
toCode: () => ({
|
|
8339
|
-
runtime: `Schema.isBetweenDate({ minimum: ${formatDateRuntime(options.minimum)}, maximum: ${
|
|
8340
|
-
formatDateRuntime(options.maximum)
|
|
8341
|
-
}, exclusiveMinimum: ${format(exclusiveMinimum)}, exclusiveMaximum: ${format(exclusiveMaximum)} })`
|
|
8342
|
-
})
|
|
8292
|
+
toJsonSchema: () => [{}, true]
|
|
8343
8293
|
}
|
|
8344
8294
|
}
|
|
8345
8295
|
})
|
|
@@ -8368,8 +8318,7 @@ export const isGreaterThanBigInt: (
|
|
|
8368
8318
|
id: "effect/schema/isGreaterThanBigInt",
|
|
8369
8319
|
payload: { exclusiveMinimum: encoded }
|
|
8370
8320
|
},
|
|
8371
|
-
toJsonSchema: () => [{}, true]
|
|
8372
|
-
toCode: () => ({ runtime: `Schema.isGreaterThanBigInt(${format(exclusiveMinimum)})` })
|
|
8321
|
+
toJsonSchema: () => [{}, true]
|
|
8373
8322
|
}
|
|
8374
8323
|
}
|
|
8375
8324
|
})
|
|
@@ -8399,8 +8348,7 @@ export const isGreaterThanOrEqualToBigInt: (
|
|
|
8399
8348
|
id: "effect/schema/isGreaterThanOrEqualToBigInt",
|
|
8400
8349
|
payload: { minimum: encoded }
|
|
8401
8350
|
},
|
|
8402
|
-
toJsonSchema: () => [{}, true]
|
|
8403
|
-
toCode: () => ({ runtime: `Schema.isGreaterThanOrEqualToBigInt(${format(minimum)})` })
|
|
8351
|
+
toJsonSchema: () => [{}, true]
|
|
8404
8352
|
}
|
|
8405
8353
|
}
|
|
8406
8354
|
})
|
|
@@ -8429,8 +8377,7 @@ export const isLessThanBigInt: (
|
|
|
8429
8377
|
id: "effect/schema/isLessThanBigInt",
|
|
8430
8378
|
payload: { exclusiveMaximum: encoded }
|
|
8431
8379
|
},
|
|
8432
|
-
toJsonSchema: () => [{}, true]
|
|
8433
|
-
toCode: () => ({ runtime: `Schema.isLessThanBigInt(${format(exclusiveMaximum)})` })
|
|
8380
|
+
toJsonSchema: () => [{}, true]
|
|
8434
8381
|
}
|
|
8435
8382
|
}
|
|
8436
8383
|
})
|
|
@@ -8460,8 +8407,7 @@ export const isLessThanOrEqualToBigInt: (
|
|
|
8460
8407
|
id: "effect/schema/isLessThanOrEqualToBigInt",
|
|
8461
8408
|
payload: { maximum: encoded }
|
|
8462
8409
|
},
|
|
8463
|
-
toJsonSchema: () => [{}, true]
|
|
8464
|
-
toCode: () => ({ runtime: `Schema.isLessThanOrEqualToBigInt(${format(maximum)})` })
|
|
8410
|
+
toJsonSchema: () => [{}, true]
|
|
8465
8411
|
}
|
|
8466
8412
|
}
|
|
8467
8413
|
})
|
|
@@ -8500,12 +8446,7 @@ export const isBetweenBigInt: (options: {
|
|
|
8500
8446
|
id: "effect/schema/isBetweenBigInt",
|
|
8501
8447
|
payload
|
|
8502
8448
|
},
|
|
8503
|
-
toJsonSchema: () => [{}, true]
|
|
8504
|
-
toCode: () => ({
|
|
8505
|
-
runtime: `Schema.isBetweenBigInt({ minimum: ${format(options.minimum)}, maximum: ${
|
|
8506
|
-
format(options.maximum)
|
|
8507
|
-
}, exclusiveMinimum: ${format(exclusiveMinimum)}, exclusiveMaximum: ${format(exclusiveMaximum)} })`
|
|
8508
|
-
})
|
|
8449
|
+
toJsonSchema: () => [{}, true]
|
|
8509
8450
|
}
|
|
8510
8451
|
}
|
|
8511
8452
|
})
|
|
@@ -8569,7 +8510,6 @@ function makeIsMinLength(minLength: number, minCodePoints: number, annotations?:
|
|
|
8569
8510
|
: type === undefined
|
|
8570
8511
|
? [{ minLength: minCodePoints, minItems: minLength }, true]
|
|
8571
8512
|
: [{}, true],
|
|
8572
|
-
toCode: () => ({ runtime: `Schema.isMinLength(${minLength})` }),
|
|
8573
8513
|
[InternalAnnotations.STRUCTURAL_ANNOTATION_KEY]: true,
|
|
8574
8514
|
arbitraryConstraint: {
|
|
8575
8515
|
minLength
|
|
@@ -8642,7 +8582,6 @@ export function isMaxLength(maxLength: number, annotations?: Annotations.Filter)
|
|
|
8642
8582
|
: type === undefined
|
|
8643
8583
|
? [{ maxLength, maxItems: maxLength }, true]
|
|
8644
8584
|
: [{}, true],
|
|
8645
|
-
toCode: () => ({ runtime: `Schema.isMaxLength(${maxLength})` }),
|
|
8646
8585
|
[InternalAnnotations.STRUCTURAL_ANNOTATION_KEY]: true,
|
|
8647
8586
|
arbitraryConstraint: {
|
|
8648
8587
|
maxLength
|
|
@@ -8704,7 +8643,6 @@ export function isBetweenLength(minimum: number, maximum: number, annotations?:
|
|
|
8704
8643
|
maxItems: maximum
|
|
8705
8644
|
}, true]
|
|
8706
8645
|
: [{}, true],
|
|
8707
|
-
toCode: () => ({ runtime: `Schema.isBetweenLength(${minimum}, ${maximum})` }),
|
|
8708
8646
|
[InternalAnnotations.STRUCTURAL_ANNOTATION_KEY]: true,
|
|
8709
8647
|
arbitraryConstraint: {
|
|
8710
8648
|
minLength: minimum,
|
|
@@ -8747,7 +8685,6 @@ export function isMinCodePoints(minCodePoints: number, annotations?: Annotations
|
|
|
8747
8685
|
payload: { minCodePoints }
|
|
8748
8686
|
},
|
|
8749
8687
|
toJsonSchema: () => ({ minLength: minCodePoints }),
|
|
8750
|
-
toCode: () => ({ runtime: `Schema.isMinCodePoints(${minCodePoints})` }),
|
|
8751
8688
|
arbitraryConstraint: { minCodePoints },
|
|
8752
8689
|
...annotations
|
|
8753
8690
|
}
|
|
@@ -8786,7 +8723,6 @@ export function isMaxCodePoints(maxCodePoints: number, annotations?: Annotations
|
|
|
8786
8723
|
payload: { maxCodePoints }
|
|
8787
8724
|
},
|
|
8788
8725
|
toJsonSchema: () => ({ maxLength: maxCodePoints }),
|
|
8789
|
-
toCode: () => ({ runtime: `Schema.isMaxCodePoints(${maxCodePoints})` }),
|
|
8790
8726
|
arbitraryConstraint: { maxCodePoints },
|
|
8791
8727
|
...annotations
|
|
8792
8728
|
}
|
|
@@ -8831,7 +8767,6 @@ export function isBetweenCodePoints(minimum: number, maximum: number, annotation
|
|
|
8831
8767
|
payload: { minimum, maximum }
|
|
8832
8768
|
},
|
|
8833
8769
|
toJsonSchema: () => ({ allOf: [{ minLength: minimum }, { maxLength: maximum }] }),
|
|
8834
|
-
toCode: () => ({ runtime: `Schema.isBetweenCodePoints(${minimum}, ${maximum})` }),
|
|
8835
8770
|
arbitraryConstraint: { minCodePoints: minimum, maxCodePoints: maximum },
|
|
8836
8771
|
...annotations
|
|
8837
8772
|
}
|
|
@@ -8886,7 +8821,6 @@ export function isMinSize(minSize: number, annotations?: Annotations.Filter) {
|
|
|
8886
8821
|
payload: { minSize }
|
|
8887
8822
|
},
|
|
8888
8823
|
toJsonSchema: () => [{}, true],
|
|
8889
|
-
toCode: () => ({ runtime: `Schema.isMinSize(${minSize})` }),
|
|
8890
8824
|
[InternalAnnotations.STRUCTURAL_ANNOTATION_KEY]: true,
|
|
8891
8825
|
arbitraryConstraint: {
|
|
8892
8826
|
minSize
|
|
@@ -8927,7 +8861,6 @@ export function isMaxSize(maxSize: number, annotations?: Annotations.Filter) {
|
|
|
8927
8861
|
payload: { maxSize }
|
|
8928
8862
|
},
|
|
8929
8863
|
toJsonSchema: () => [{}, true],
|
|
8930
|
-
toCode: () => ({ runtime: `Schema.isMaxSize(${maxSize})` }),
|
|
8931
8864
|
[InternalAnnotations.STRUCTURAL_ANNOTATION_KEY]: true,
|
|
8932
8865
|
arbitraryConstraint: {
|
|
8933
8866
|
maxSize
|
|
@@ -8972,7 +8905,6 @@ export function isBetweenSize(minimum: number, maximum: number, annotations?: An
|
|
|
8972
8905
|
payload: { minimum, maximum }
|
|
8973
8906
|
},
|
|
8974
8907
|
toJsonSchema: () => [{}, true],
|
|
8975
|
-
toCode: () => ({ runtime: `Schema.isBetweenSize(${minimum}, ${maximum})` }),
|
|
8976
8908
|
[InternalAnnotations.STRUCTURAL_ANNOTATION_KEY]: true,
|
|
8977
8909
|
arbitraryConstraint: {
|
|
8978
8910
|
minSize: minimum,
|
|
@@ -9016,7 +8948,6 @@ export function isMinProperties(minProperties: number, annotations?: Annotations
|
|
|
9016
8948
|
payload: { minProperties }
|
|
9017
8949
|
},
|
|
9018
8950
|
toJsonSchema: ({ type }) => type === "object" ? { minProperties } : [{ minProperties }, true],
|
|
9019
|
-
toCode: () => ({ runtime: `Schema.isMinProperties(${minProperties})` }),
|
|
9020
8951
|
[InternalAnnotations.STRUCTURAL_ANNOTATION_KEY]: true,
|
|
9021
8952
|
arbitraryConstraint: {
|
|
9022
8953
|
minProperties
|
|
@@ -9059,7 +8990,6 @@ export function isMaxProperties(maxProperties: number, annotations?: Annotations
|
|
|
9059
8990
|
payload: { maxProperties }
|
|
9060
8991
|
},
|
|
9061
8992
|
toJsonSchema: ({ type }) => type === "object" ? { maxProperties } : [{ maxProperties }, true],
|
|
9062
|
-
toCode: () => ({ runtime: `Schema.isMaxProperties(${maxProperties})` }),
|
|
9063
8993
|
[InternalAnnotations.STRUCTURAL_ANNOTATION_KEY]: true,
|
|
9064
8994
|
arbitraryConstraint: {
|
|
9065
8995
|
maxProperties
|
|
@@ -9112,7 +9042,6 @@ export function isBetweenProperties(minimum: number, maximum: number, annotation
|
|
|
9112
9042
|
type === "object"
|
|
9113
9043
|
? { minProperties: minimum, maxProperties: maximum }
|
|
9114
9044
|
: [{ minProperties: minimum, maxProperties: maximum }, true],
|
|
9115
|
-
toCode: () => ({ runtime: `Schema.isBetweenProperties(${minimum}, ${maximum})` }),
|
|
9116
9045
|
[InternalAnnotations.STRUCTURAL_ANNOTATION_KEY]: true,
|
|
9117
9046
|
arbitraryConstraint: {
|
|
9118
9047
|
minProperties: minimum,
|
|
@@ -9169,7 +9098,6 @@ export function isPropertyNames(keySchema: Constraint, annotations?: Annotations
|
|
|
9169
9098
|
},
|
|
9170
9099
|
toJsonSchema: ({ schemas, type }) =>
|
|
9171
9100
|
type === "object" ? { propertyNames: schemas[0] } : [{ propertyNames: schemas[0] }, true],
|
|
9172
|
-
toCode: ({ schemas }) => ({ runtime: `Schema.isPropertyNames(${schemas[0].runtime})` }),
|
|
9173
9101
|
[InternalAnnotations.STRUCTURAL_ANNOTATION_KEY]: true,
|
|
9174
9102
|
...annotations
|
|
9175
9103
|
}
|
|
@@ -9201,7 +9129,6 @@ export function isUnique<T>(annotations?: Annotations.Filter) {
|
|
|
9201
9129
|
payload: null
|
|
9202
9130
|
},
|
|
9203
9131
|
toJsonSchema: () => ({ uniqueItems: true }),
|
|
9204
|
-
toCode: () => ({ runtime: "Schema.isUnique()" }),
|
|
9205
9132
|
arbitraryConstraint: {
|
|
9206
9133
|
uniqueBy: identity
|
|
9207
9134
|
},
|
|
@@ -9234,7 +9161,6 @@ export function isUniqueKey<Key, Value>(annotations?: Annotations.Filter) {
|
|
|
9234
9161
|
id: "effect/schema/isUniqueKey",
|
|
9235
9162
|
payload: null
|
|
9236
9163
|
},
|
|
9237
|
-
toCode: () => ({ runtime: "Schema.isUniqueKey()" }),
|
|
9238
9164
|
arbitraryConstraint: {
|
|
9239
9165
|
uniqueBy: (entry: readonly [Key, Value]) => entry[0]
|
|
9240
9166
|
},
|
|
@@ -9378,12 +9304,6 @@ export function ErrorInstance(options?: ErrorOptions): ErrorInstance {
|
|
|
9378
9304
|
id: "effect/schema/Error",
|
|
9379
9305
|
payload: normalizedOptions ?? null
|
|
9380
9306
|
},
|
|
9381
|
-
toCode: () => ({
|
|
9382
|
-
runtime: normalizedOptions !== undefined
|
|
9383
|
-
? `Schema.ErrorInstance(${format(normalizedOptions)})`
|
|
9384
|
-
: `Schema.ErrorInstance()`,
|
|
9385
|
-
Type: `globalThis.Error`
|
|
9386
|
-
}),
|
|
9387
9307
|
expected: "Error",
|
|
9388
9308
|
toCodecJson: () => link<globalThis.Error>()(JsonError, SchemaTransformation.errorFromJsonError(normalizedOptions))
|
|
9389
9309
|
})
|
|
@@ -9522,10 +9442,6 @@ export function ReadonlyMap<Key extends Constraint, Value extends Constraint>(
|
|
|
9522
9442
|
id: "effect/schema/ReadonlyMap",
|
|
9523
9443
|
payload: null
|
|
9524
9444
|
},
|
|
9525
|
-
toCode: ({ typeParameters }) => ({
|
|
9526
|
-
runtime: `Schema.ReadonlyMap(${typeParameters[0].runtime}, ${typeParameters[1].runtime})`,
|
|
9527
|
-
Type: `globalThis.ReadonlyMap<${typeParameters[0].Type}, ${typeParameters[1].Type}>`
|
|
9528
|
-
}),
|
|
9529
9445
|
expected: "ReadonlyMap",
|
|
9530
9446
|
toCodec: ([key, value]) =>
|
|
9531
9447
|
link<globalThis.Map<Key["Encoded"], Value["Encoded"]>>()(
|
|
@@ -9600,10 +9516,6 @@ export function ReadonlySet<Value extends Constraint>(value: Value): $ReadonlySe
|
|
|
9600
9516
|
id: "effect/schema/ReadonlySet",
|
|
9601
9517
|
payload: null
|
|
9602
9518
|
},
|
|
9603
|
-
toCode: ({ typeParameters }) => ({
|
|
9604
|
-
runtime: `Schema.ReadonlySet(${typeParameters[0].runtime})`,
|
|
9605
|
-
Type: `globalThis.ReadonlySet<${typeParameters[0].Type}>`
|
|
9606
|
-
}),
|
|
9607
9519
|
expected: "ReadonlySet",
|
|
9608
9520
|
toCodec: ([value]) =>
|
|
9609
9521
|
link<globalThis.Set<Value["Encoded"]>>()(
|
|
@@ -9645,10 +9557,6 @@ export const RegExp: RegExp = instanceOf(
|
|
|
9645
9557
|
id: "effect/schema/RegExp",
|
|
9646
9558
|
payload: null
|
|
9647
9559
|
},
|
|
9648
|
-
toCode: () => ({
|
|
9649
|
-
runtime: `Schema.RegExp`,
|
|
9650
|
-
Type: `globalThis.RegExp`
|
|
9651
|
-
}),
|
|
9652
9560
|
expected: "RegExp",
|
|
9653
9561
|
toCodecJson: () =>
|
|
9654
9562
|
link<globalThis.RegExp>()(
|
|
@@ -9708,10 +9616,6 @@ export const URL: URL = instanceOf(
|
|
|
9708
9616
|
id: "effect/schema/URL",
|
|
9709
9617
|
payload: null
|
|
9710
9618
|
},
|
|
9711
|
-
toCode: () => ({
|
|
9712
|
-
runtime: `Schema.URL`,
|
|
9713
|
-
Type: `globalThis.URL`
|
|
9714
|
-
}),
|
|
9715
9619
|
expected: "URL",
|
|
9716
9620
|
toCodecJson: () =>
|
|
9717
9621
|
link<globalThis.URL>()(
|
|
@@ -9794,10 +9698,6 @@ export const Date: Date = declare(
|
|
|
9794
9698
|
id: "effect/schema/Date",
|
|
9795
9699
|
payload: null
|
|
9796
9700
|
},
|
|
9797
|
-
toCode: () => ({
|
|
9798
|
-
runtime: `Schema.Date`,
|
|
9799
|
-
Type: `globalThis.Date`
|
|
9800
|
-
}),
|
|
9801
9701
|
expected: "a valid Date",
|
|
9802
9702
|
toCodecJson: () =>
|
|
9803
9703
|
link<globalThis.Date>()(
|
|
@@ -9968,10 +9868,6 @@ export const File: File = instanceOf(globalThis.File, {
|
|
|
9968
9868
|
id: "effect/schema/File",
|
|
9969
9869
|
payload: null
|
|
9970
9870
|
},
|
|
9971
|
-
toCode: () => ({
|
|
9972
|
-
runtime: `Schema.File`,
|
|
9973
|
-
Type: `globalThis.File`
|
|
9974
|
-
}),
|
|
9975
9871
|
expected: "File",
|
|
9976
9872
|
toCodecJson: () =>
|
|
9977
9873
|
link<globalThis.File>()(
|
|
@@ -10049,10 +9945,6 @@ export const FormData: FormData = declare((u): u is globalThis.FormData => u ins
|
|
|
10049
9945
|
id: "effect/schema/FormData",
|
|
10050
9946
|
payload: null
|
|
10051
9947
|
},
|
|
10052
|
-
toCode: () => ({
|
|
10053
|
-
runtime: `Schema.FormData`,
|
|
10054
|
-
Type: `globalThis.FormData`
|
|
10055
|
-
}),
|
|
10056
9948
|
expected: "FormData",
|
|
10057
9949
|
toCodecJson: () =>
|
|
10058
9950
|
link<globalThis.FormData>()(
|
|
@@ -10209,10 +10101,6 @@ export const URLSearchParams: URLSearchParams = instanceOf(globalThis.URLSearchP
|
|
|
10209
10101
|
id: "effect/schema/URLSearchParams",
|
|
10210
10102
|
payload: null
|
|
10211
10103
|
},
|
|
10212
|
-
toCode: () => ({
|
|
10213
|
-
runtime: `Schema.URLSearchParams`,
|
|
10214
|
-
Type: `globalThis.URLSearchParams`
|
|
10215
|
-
}),
|
|
10216
10104
|
expected: "URLSearchParams",
|
|
10217
10105
|
toCodecJson: () =>
|
|
10218
10106
|
link<globalThis.URLSearchParams>()(
|
|
@@ -10722,10 +10610,6 @@ export const Uint8Array: Uint8Array = instanceOf(globalThis.Uint8Array<ArrayBuff
|
|
|
10722
10610
|
id: "effect/schema/Uint8Array",
|
|
10723
10611
|
payload: null
|
|
10724
10612
|
},
|
|
10725
|
-
toCode: () => ({
|
|
10726
|
-
runtime: `Schema.Uint8Array`,
|
|
10727
|
-
Type: `globalThis.Uint8Array`
|
|
10728
|
-
}),
|
|
10729
10613
|
expected: "Uint8Array",
|
|
10730
10614
|
toCodecJson: () =>
|
|
10731
10615
|
link<globalThis.Uint8Array<ArrayBufferLike>>()(
|
|
@@ -10968,11 +10852,6 @@ export const BigDecimal: BigDecimal = declare(
|
|
|
10968
10852
|
id: "effect/schema/BigDecimal",
|
|
10969
10853
|
payload: null
|
|
10970
10854
|
},
|
|
10971
|
-
toCode: () => ({
|
|
10972
|
-
runtime: `Schema.BigDecimal`,
|
|
10973
|
-
Type: `BigDecimal.BigDecimal`,
|
|
10974
|
-
importDeclarations: [`import * as BigDecimal from "effect/BigDecimal"`]
|
|
10975
|
-
}),
|
|
10976
10855
|
expected: "BigDecimal",
|
|
10977
10856
|
toCodecJson: () =>
|
|
10978
10857
|
link<BigDecimal_.BigDecimal>()(
|
|
@@ -11080,11 +10959,6 @@ export const Rational: Rational = declare(
|
|
|
11080
10959
|
id: "effect/schema/Rational",
|
|
11081
10960
|
payload: null
|
|
11082
10961
|
},
|
|
11083
|
-
toCode: () => ({
|
|
11084
|
-
runtime: `Schema.Rational`,
|
|
11085
|
-
Type: `Rational.Rational`,
|
|
11086
|
-
importDeclarations: [`import * as Rational from "effect/Rational"`]
|
|
11087
|
-
}),
|
|
11088
10962
|
expected: "Rational",
|
|
11089
10963
|
toCodecArbitrary: () =>
|
|
11090
10964
|
linkDecoding<Rational_.Rational>()(
|
|
@@ -11170,11 +11044,6 @@ export const ByteSize: ByteSize = declare(
|
|
|
11170
11044
|
id: "effect/schema/ByteSize",
|
|
11171
11045
|
payload: null
|
|
11172
11046
|
},
|
|
11173
|
-
toCode: () => ({
|
|
11174
|
-
runtime: `Schema.ByteSize`,
|
|
11175
|
-
Type: `ByteSize.ByteSize`,
|
|
11176
|
-
importDeclarations: [`import * as ByteSize from "effect/ByteSize"`]
|
|
11177
|
-
}),
|
|
11178
11047
|
expected: "ByteSize",
|
|
11179
11048
|
toCodecJson: () =>
|
|
11180
11049
|
link<ByteSize_.ByteSize>()(
|
|
@@ -11386,11 +11255,6 @@ export function CauseReason<E extends Constraint, D extends Constraint>(
|
|
|
11386
11255
|
id: "effect/schema/CauseReason",
|
|
11387
11256
|
payload: null
|
|
11388
11257
|
},
|
|
11389
|
-
toCode: ({ typeParameters }) => ({
|
|
11390
|
-
runtime: `Schema.CauseReason(${typeParameters[0].runtime}, ${typeParameters[1].runtime})`,
|
|
11391
|
-
Type: `Cause.Reason<${typeParameters[0].Type}>`,
|
|
11392
|
-
importDeclarations: [`import * as Cause from "effect/Cause"`]
|
|
11393
|
-
}),
|
|
11394
11258
|
expected: "Cause.Failure",
|
|
11395
11259
|
toCodec: ([error, defect]) =>
|
|
11396
11260
|
link<Cause_.Reason<E["Encoded"]>>()(
|
|
@@ -11507,11 +11371,6 @@ export function Cause<E extends Constraint, D extends Constraint>(error: E, defe
|
|
|
11507
11371
|
id: "effect/schema/Cause",
|
|
11508
11372
|
payload: null
|
|
11509
11373
|
},
|
|
11510
|
-
toCode: ({ typeParameters }) => ({
|
|
11511
|
-
runtime: `Schema.Cause(${typeParameters[0].runtime}, ${typeParameters[1].runtime})`,
|
|
11512
|
-
Type: `Cause.Cause<${typeParameters[0].Type}>`,
|
|
11513
|
-
importDeclarations: [`import * as Cause from "effect/Cause"`]
|
|
11514
|
-
}),
|
|
11515
11374
|
expected: "Cause",
|
|
11516
11375
|
toCodec: ([error, defect]) =>
|
|
11517
11376
|
link<Cause_.Cause<E["Encoded"]>>()(
|
|
@@ -11607,10 +11466,6 @@ export function Chunk<Value extends Constraint>(value: Value): Chunk<Value> {
|
|
|
11607
11466
|
id: "effect/schema/Chunk",
|
|
11608
11467
|
payload: null
|
|
11609
11468
|
},
|
|
11610
|
-
toCode: ({ typeParameters }) => ({
|
|
11611
|
-
runtime: `Schema.Chunk(${typeParameters[0].runtime})`,
|
|
11612
|
-
Type: `Chunk.Chunk<${typeParameters[0].Type}>`
|
|
11613
|
-
}),
|
|
11614
11469
|
expected: "Chunk",
|
|
11615
11470
|
toCodec: ([value]) => chunkLink(ArraySchema(value)),
|
|
11616
11471
|
toCodecArbitrary: ({ constraint, typeParameters: [value] }) =>
|
|
@@ -11795,11 +11650,6 @@ export const DateTimeUtc: DateTimeUtc = declare(
|
|
|
11795
11650
|
id: "effect/schema/DateTimeUtc",
|
|
11796
11651
|
payload: null
|
|
11797
11652
|
},
|
|
11798
|
-
toCode: () => ({
|
|
11799
|
-
runtime: `Schema.DateTimeUtc`,
|
|
11800
|
-
Type: `DateTime.Utc`,
|
|
11801
|
-
importDeclarations: [`import * as DateTime from "effect/DateTime"`]
|
|
11802
|
-
}),
|
|
11803
11653
|
expected: "DateTime.Utc",
|
|
11804
11654
|
toCodecArbitrary: ({ constraint }) => {
|
|
11805
11655
|
const [minimum, maximum] = dateTimeArbitraryBounds(
|
|
@@ -12025,11 +11875,6 @@ export const TimeZoneOffset: TimeZoneOffset = declare(
|
|
|
12025
11875
|
id: "effect/schema/TimeZoneOffset",
|
|
12026
11876
|
payload: null
|
|
12027
11877
|
},
|
|
12028
|
-
toCode: () => ({
|
|
12029
|
-
runtime: `Schema.TimeZoneOffset`,
|
|
12030
|
-
Type: `DateTime.TimeZone.Offset`,
|
|
12031
|
-
importDeclarations: [`import * as DateTime from "effect/DateTime"`]
|
|
12032
|
-
}),
|
|
12033
11878
|
expected: "DateTime.TimeZone.Offset",
|
|
12034
11879
|
toCodecJson: () =>
|
|
12035
11880
|
link<DateTime.TimeZone.Offset>()(
|
|
@@ -12070,11 +11915,6 @@ export const TimeZoneNamed: TimeZoneNamed = declare(
|
|
|
12070
11915
|
id: "effect/schema/TimeZoneNamed",
|
|
12071
11916
|
payload: null
|
|
12072
11917
|
},
|
|
12073
|
-
toCode: () => ({
|
|
12074
|
-
runtime: `Schema.TimeZoneNamed`,
|
|
12075
|
-
Type: `DateTime.TimeZone.Named`,
|
|
12076
|
-
importDeclarations: [`import * as DateTime from "effect/DateTime"`]
|
|
12077
|
-
}),
|
|
12078
11918
|
expected: "DateTime.TimeZone.Named",
|
|
12079
11919
|
toCodecArbitrary: () =>
|
|
12080
11920
|
linkDecoding<DateTime.TimeZone.Named>()(
|
|
@@ -12151,11 +11991,6 @@ export const TimeZone: TimeZone = declare(
|
|
|
12151
11991
|
id: "effect/schema/TimeZone",
|
|
12152
11992
|
payload: null
|
|
12153
11993
|
},
|
|
12154
|
-
toCode: () => ({
|
|
12155
|
-
runtime: `Schema.TimeZone`,
|
|
12156
|
-
Type: `DateTime.TimeZone`,
|
|
12157
|
-
importDeclarations: [`import * as DateTime from "effect/DateTime"`]
|
|
12158
|
-
}),
|
|
12159
11994
|
expected: "DateTime.TimeZone",
|
|
12160
11995
|
toCodecArbitrary: () =>
|
|
12161
11996
|
linkDecoding<DateTime.TimeZone>()(
|
|
@@ -12236,11 +12071,6 @@ export const DateTimeZoned: DateTimeZoned = declare(
|
|
|
12236
12071
|
id: "effect/schema/DateTimeZoned",
|
|
12237
12072
|
payload: null
|
|
12238
12073
|
},
|
|
12239
|
-
toCode: () => ({
|
|
12240
|
-
runtime: `Schema.DateTimeZoned`,
|
|
12241
|
-
Type: `DateTime.Zoned`,
|
|
12242
|
-
importDeclarations: [`import * as DateTime from "effect/DateTime"`]
|
|
12243
|
-
}),
|
|
12244
12074
|
expected: "DateTime.Zoned",
|
|
12245
12075
|
toCodecArbitrary: ({ constraint }) => {
|
|
12246
12076
|
const [minimum, maximum] = dateTimeArbitraryBounds(
|
|
@@ -13979,11 +13809,6 @@ export const Duration: Duration = declare(
|
|
|
13979
13809
|
id: "effect/schema/Duration",
|
|
13980
13810
|
payload: null
|
|
13981
13811
|
},
|
|
13982
|
-
toCode: () => ({
|
|
13983
|
-
runtime: `Schema.Duration`,
|
|
13984
|
-
Type: `Duration.Duration`,
|
|
13985
|
-
importDeclarations: [`import * as Duration from "effect/Duration"`]
|
|
13986
|
-
}),
|
|
13987
13812
|
expected: "Duration",
|
|
13988
13813
|
toCodecJson: () =>
|
|
13989
13814
|
link<Duration_.Duration>()(
|
|
@@ -14580,7 +14405,6 @@ export const DnsRecord: DnsRecord = Union([
|
|
|
14580
14405
|
// Match operation parameters rather than object identity. RSA modulus length
|
|
14581
14406
|
// affects generation only, so it is ignored here as on import.
|
|
14582
14407
|
interface CryptoAlgorithm {
|
|
14583
|
-
readonly _tag?: string
|
|
14584
14408
|
readonly name: string
|
|
14585
14409
|
readonly hash?: { readonly name: string }
|
|
14586
14410
|
readonly modulusLength?: number
|
|
@@ -14591,20 +14415,6 @@ const cryptoAlgorithmEquals = (self: CryptoAlgorithm, that: CryptoAlgorithm): bo
|
|
|
14591
14415
|
self === that ||
|
|
14592
14416
|
(self.name === that.name && self.hash?.name === that.hash?.name && self.saltLength === that.saltLength)
|
|
14593
14417
|
|
|
14594
|
-
const cryptoDigestCode = (hash: { readonly name: string }) => `Digest.${hash.name.toLowerCase().replace("-", "")}`
|
|
14595
|
-
|
|
14596
|
-
const cryptoAlgorithmCode = (family: string, algorithm: CryptoAlgorithm): string => {
|
|
14597
|
-
if (algorithm.modulusLength === undefined || algorithm.hash === undefined || algorithm._tag === undefined) {
|
|
14598
|
-
const code = `${family}.${algorithm.name}`
|
|
14599
|
-
return algorithm.hash === undefined ? code : `{ ...${code}, hash: ${cryptoDigestCode(algorithm.hash)} }`
|
|
14600
|
-
}
|
|
14601
|
-
const factory = algorithm._tag.charAt(0).toLowerCase() + algorithm._tag.slice(1)
|
|
14602
|
-
const saltLength = algorithm.saltLength === undefined ? "" : `, saltLength: ${algorithm.saltLength}`
|
|
14603
|
-
return `${family}.${factory}({ hash: ${
|
|
14604
|
-
cryptoDigestCode(algorithm.hash)
|
|
14605
|
-
}, modulusLength: ${algorithm.modulusLength}${saltLength} })`
|
|
14606
|
-
}
|
|
14607
|
-
|
|
14608
14418
|
const cryptoAlgorithmPayload = (algorithm: CryptoAlgorithm): Json => {
|
|
14609
14419
|
const payload: { [key: string]: Json } = { name: algorithm.name }
|
|
14610
14420
|
if (algorithm.hash !== undefined) payload.hash = algorithm.hash.name
|
|
@@ -14620,7 +14430,6 @@ const declareCryptoKey = <K extends { readonly algorithm: CryptoAlgorithm }>(
|
|
|
14620
14430
|
is: (u: unknown) => boolean,
|
|
14621
14431
|
algorithm: CryptoAlgorithm
|
|
14622
14432
|
): declare<K> => {
|
|
14623
|
-
const code = cryptoAlgorithmCode(family, algorithm)
|
|
14624
14433
|
const forbidden = SchemaGetter.forbidden<never, unknown>(() =>
|
|
14625
14434
|
`Cannot serialize ${family}.${type} values as JSON, use Schema.${name}FromFormat to read and write keys`
|
|
14626
14435
|
)
|
|
@@ -14629,14 +14438,6 @@ const declareCryptoKey = <K extends { readonly algorithm: CryptoAlgorithm }>(
|
|
|
14629
14438
|
{
|
|
14630
14439
|
expected: `${family}.${type} for ${algorithm.name}`,
|
|
14631
14440
|
representation: { id: `effect/crypto/${name}`, payload: cryptoAlgorithmPayload(algorithm) },
|
|
14632
|
-
toCode: () => ({
|
|
14633
|
-
runtime: `Schema.${name}(${code})`,
|
|
14634
|
-
Type: `${family}.${type}`,
|
|
14635
|
-
importDeclarations: [
|
|
14636
|
-
`import * as ${family} from "effect/crypto/${family}"`,
|
|
14637
|
-
...(code.includes("Digest.") ? [`import * as Digest from "effect/crypto/Digest"`] : [])
|
|
14638
|
-
]
|
|
14639
|
-
}),
|
|
14640
14441
|
toCodecJson: () => link<K>()(Unknown, { decode: forbidden, encode: forbidden }),
|
|
14641
14442
|
// Keys have no Arbitrary: linking to `Never` makes derivation fail.
|
|
14642
14443
|
toCodecArbitrary: () => link<K>()(Never, { decode: forbidden, encode: forbidden }),
|
|
@@ -15709,13 +15510,6 @@ export function Exit<
|
|
|
15709
15510
|
id: "effect/schema/Exit",
|
|
15710
15511
|
payload: null
|
|
15711
15512
|
},
|
|
15712
|
-
toCode: ({ typeParameters }) => ({
|
|
15713
|
-
runtime: `Schema.Exit(${typeParameters[0].runtime}, ${typeParameters[1].runtime}, ${
|
|
15714
|
-
typeParameters[2].runtime
|
|
15715
|
-
})`,
|
|
15716
|
-
Type: `Exit.Exit<${typeParameters[0].Type}, ${typeParameters[1].Type}>`,
|
|
15717
|
-
importDeclarations: [`import * as Exit from "effect/Exit"`]
|
|
15718
|
-
}),
|
|
15719
15513
|
expected: "Exit",
|
|
15720
15514
|
toCodec: ([value, error, defect]) =>
|
|
15721
15515
|
link<Exit_.Exit<A["Encoded"], E["Encoded"]>>()(
|
|
@@ -15993,11 +15787,6 @@ export function Graph<T extends Graph_.Kind, Node extends Constraint, Edge exten
|
|
|
15993
15787
|
id: "effect/schema/Graph",
|
|
15994
15788
|
payload: type
|
|
15995
15789
|
},
|
|
15996
|
-
toCode: ({ typeParameters }) => ({
|
|
15997
|
-
runtime: `Schema.Graph(${format(type)}, ${typeParameters[0].runtime}, ${typeParameters[1].runtime})`,
|
|
15998
|
-
Type: `Graph.Graph<${typeParameters[0].Type}, ${typeParameters[1].Type}, ${format(type)}>`,
|
|
15999
|
-
importDeclarations: [`import * as Graph from "effect/Graph"`]
|
|
16000
|
-
}),
|
|
16001
15790
|
expected: `an immutable ${type} Graph`,
|
|
16002
15791
|
toCodec: ([node, edge]) =>
|
|
16003
15792
|
link<Graph_.Graph<Node["Encoded"], Edge["Encoded"], T>>()(
|
|
@@ -16091,11 +15880,6 @@ export function HashMap<Key extends Constraint, Value extends Constraint>(key: K
|
|
|
16091
15880
|
id: "effect/schema/HashMap",
|
|
16092
15881
|
payload: null
|
|
16093
15882
|
},
|
|
16094
|
-
toCode: ({ typeParameters }) => ({
|
|
16095
|
-
runtime: `Schema.HashMap(${typeParameters[0].runtime}, ${typeParameters[1].runtime})`,
|
|
16096
|
-
Type: `HashMap.HashMap<${typeParameters[0].Type}, ${typeParameters[1].Type}>`,
|
|
16097
|
-
importDeclarations: [`import * as HashMap from "effect/HashMap"`]
|
|
16098
|
-
}),
|
|
16099
15883
|
expected: "HashMap",
|
|
16100
15884
|
toCodec: ([key, value]) => hashMapLink(ArraySchema(Tuple([key, value]))),
|
|
16101
15885
|
toCodecArbitrary: ({ constraint, typeParameters: [key, value] }) =>
|
|
@@ -16186,10 +15970,6 @@ export function HashSet<Value extends Constraint>(value: Value): HashSet<Value>
|
|
|
16186
15970
|
id: "effect/schema/HashSet",
|
|
16187
15971
|
payload: null
|
|
16188
15972
|
},
|
|
16189
|
-
toCode: ({ typeParameters }) => ({
|
|
16190
|
-
runtime: `Schema.HashSet(${typeParameters[0].runtime})`,
|
|
16191
|
-
Type: `HashSet.HashSet<${typeParameters[0].Type}>`
|
|
16192
|
-
}),
|
|
16193
15973
|
expected: "HashSet",
|
|
16194
15974
|
toCodec: ([value]) => hashSetLink(ArraySchema(value)),
|
|
16195
15975
|
toCodecArbitrary: ({ constraint, typeParameters: [value] }) =>
|
|
@@ -16280,11 +16060,6 @@ export function Option<A extends Constraint>(value: A): Option<A> {
|
|
|
16280
16060
|
id: "effect/schema/Option",
|
|
16281
16061
|
payload: null
|
|
16282
16062
|
},
|
|
16283
|
-
toCode: ({ typeParameters }) => ({
|
|
16284
|
-
runtime: `Schema.Option(${typeParameters[0].runtime})`,
|
|
16285
|
-
Type: `Option.Option<${typeParameters[0].Type}>`,
|
|
16286
|
-
importDeclarations: [`import * as Option from "effect/Option"`]
|
|
16287
|
-
}),
|
|
16288
16063
|
expected: "Option",
|
|
16289
16064
|
toCodec: ([value]) =>
|
|
16290
16065
|
link<Option_.Option<A["Encoded"]>>()(
|
|
@@ -16419,11 +16194,6 @@ export const Cookie: Cookie = declare(
|
|
|
16419
16194
|
id: "effect/http/Cookie",
|
|
16420
16195
|
payload: null
|
|
16421
16196
|
},
|
|
16422
|
-
toCode: () => ({
|
|
16423
|
-
runtime: "Schema.Cookie",
|
|
16424
|
-
Type: "Cookies.Cookie",
|
|
16425
|
-
importDeclarations: [`import * as Cookies from "effect/http/Cookies"`]
|
|
16426
|
-
}),
|
|
16427
16197
|
expected: "Cookie"
|
|
16428
16198
|
}
|
|
16429
16199
|
)
|
|
@@ -16463,11 +16233,6 @@ export const Cookies: Cookies = declare(
|
|
|
16463
16233
|
id: "effect/http/Cookies",
|
|
16464
16234
|
payload: null
|
|
16465
16235
|
},
|
|
16466
|
-
toCode: () => ({
|
|
16467
|
-
runtime: "Schema.Cookies",
|
|
16468
|
-
Type: "Cookies.Cookies",
|
|
16469
|
-
importDeclarations: [`import * as Cookies from "effect/http/Cookies"`]
|
|
16470
|
-
}),
|
|
16471
16236
|
expected: "Cookies",
|
|
16472
16237
|
toCodecJson: () =>
|
|
16473
16238
|
link<Cookies_.Cookies>()(
|
|
@@ -16549,11 +16314,6 @@ export const Headers: Headers = declare(
|
|
|
16549
16314
|
id: "effect/http/Headers",
|
|
16550
16315
|
payload: null
|
|
16551
16316
|
},
|
|
16552
|
-
toCode: () => ({
|
|
16553
|
-
runtime: "Schema.Headers",
|
|
16554
|
-
Type: "Headers.Headers",
|
|
16555
|
-
importDeclarations: [`import * as Headers from "effect/http/Headers"`]
|
|
16556
|
-
}),
|
|
16557
16317
|
expected: "Headers",
|
|
16558
16318
|
toEquivalence: () => Headers_.Equivalence,
|
|
16559
16319
|
toCodec: () =>
|
|
@@ -16671,6 +16431,66 @@ export const RetryAfterFromString: RetryAfterFromString = String.annotate({
|
|
|
16671
16431
|
)
|
|
16672
16432
|
)
|
|
16673
16433
|
|
|
16434
|
+
/**
|
|
16435
|
+
* Type-level representation of {@link LinkHeaderFromString}.
|
|
16436
|
+
*
|
|
16437
|
+
* @stability unstable
|
|
16438
|
+
* @category models
|
|
16439
|
+
* @since 4.1.6
|
|
16440
|
+
*/
|
|
16441
|
+
export interface LinkHeaderFromString extends
|
|
16442
|
+
decodeTo<
|
|
16443
|
+
$Array<
|
|
16444
|
+
Struct<{
|
|
16445
|
+
readonly target: String
|
|
16446
|
+
readonly rel: $Array<String>
|
|
16447
|
+
readonly params: $Record<String, String>
|
|
16448
|
+
}>
|
|
16449
|
+
>,
|
|
16450
|
+
String
|
|
16451
|
+
>
|
|
16452
|
+
{
|
|
16453
|
+
readonly "Rebuild": LinkHeaderFromString
|
|
16454
|
+
}
|
|
16455
|
+
|
|
16456
|
+
/**
|
|
16457
|
+
* Schema for `Link` header values (RFC 8288), decoded with
|
|
16458
|
+
* `Headers.parseLink` and encoded with `Headers.formatLink`.
|
|
16459
|
+
*
|
|
16460
|
+
* **When to use**
|
|
16461
|
+
*
|
|
16462
|
+
* Use with `HttpClientResponse.schemaHeaders` or HTTP API header schemas
|
|
16463
|
+
* that carry a `Link` header.
|
|
16464
|
+
*
|
|
16465
|
+
* **Details**
|
|
16466
|
+
*
|
|
16467
|
+
* Decoding never fails on a string, because `Headers.parseLink` is lenient.
|
|
16468
|
+
*
|
|
16469
|
+
* **Example** (Decoding a Link header)
|
|
16470
|
+
*
|
|
16471
|
+
* ```ts
|
|
16472
|
+
* import { Schema } from "effect"
|
|
16473
|
+
*
|
|
16474
|
+
* const links = Schema.decodeSync(Schema.LinkHeaderFromString)('</items?page=2>; rel="next"')
|
|
16475
|
+
* // => [{ target: "/items?page=2", rel: ["next"], params: {} }]
|
|
16476
|
+
* ```
|
|
16477
|
+
*
|
|
16478
|
+
* @stability unstable
|
|
16479
|
+
* @category schemas
|
|
16480
|
+
* @since 4.1.6
|
|
16481
|
+
*/
|
|
16482
|
+
export const LinkHeaderFromString: LinkHeaderFromString = String.annotate({
|
|
16483
|
+
expected: "a Link header value"
|
|
16484
|
+
}).pipe(
|
|
16485
|
+
decodeTo(
|
|
16486
|
+
ArraySchema(Struct({ target: String, rel: ArraySchema(String), params: Record(String, String) })),
|
|
16487
|
+
SchemaTransformation.transform<ReadonlyArray<Headers_.Link>, string>({
|
|
16488
|
+
decode: Headers_.parseLink,
|
|
16489
|
+
encode: Headers_.formatLink
|
|
16490
|
+
})
|
|
16491
|
+
)
|
|
16492
|
+
)
|
|
16493
|
+
|
|
16674
16494
|
/**
|
|
16675
16495
|
* Type-level representation of {@link UrlParams}.
|
|
16676
16496
|
*
|
|
@@ -16705,11 +16525,6 @@ export const UrlParams: UrlParams = declare(
|
|
|
16705
16525
|
id: "effect/http/UrlParams",
|
|
16706
16526
|
payload: null
|
|
16707
16527
|
},
|
|
16708
|
-
toCode: () => ({
|
|
16709
|
-
runtime: "Schema.UrlParams",
|
|
16710
|
-
Type: "UrlParams.UrlParams",
|
|
16711
|
-
importDeclarations: [`import * as UrlParams from "effect/http/UrlParams"`]
|
|
16712
|
-
}),
|
|
16713
16528
|
expected: "UrlParams",
|
|
16714
16529
|
toEquivalence: () => UrlParams_.Equivalence,
|
|
16715
16530
|
toCodec: () =>
|
|
@@ -17050,13 +16865,6 @@ export function Redacted<S extends Constraint>(value: S, options?: {
|
|
|
17050
16865
|
id: "effect/schema/Redacted",
|
|
17051
16866
|
payload: normalizedOptions ?? null
|
|
17052
16867
|
},
|
|
17053
|
-
toCode: ({ typeParameters }) => ({
|
|
17054
|
-
runtime: normalizedOptions !== undefined
|
|
17055
|
-
? `Schema.Redacted(${typeParameters[0].runtime}, ${format(normalizedOptions)})`
|
|
17056
|
-
: `Schema.Redacted(${typeParameters[0].runtime})`,
|
|
17057
|
-
Type: `Redacted.Redacted<${typeParameters[0].Type}>`,
|
|
17058
|
-
importDeclarations: [`import * as Redacted from "effect/Redacted"`]
|
|
17059
|
-
}),
|
|
17060
16868
|
expected: "Redacted",
|
|
17061
16869
|
toCodecJson: ([value]) =>
|
|
17062
16870
|
link<Redacted_.Redacted<S["Encoded"]>>()(
|
|
@@ -17198,11 +17006,6 @@ export function Result<A extends Constraint, E extends Constraint>(
|
|
|
17198
17006
|
id: "effect/schema/Result",
|
|
17199
17007
|
payload: null
|
|
17200
17008
|
},
|
|
17201
|
-
toCode: ({ typeParameters }) => ({
|
|
17202
|
-
runtime: `Schema.Result(${typeParameters[0].runtime}, ${typeParameters[1].runtime})`,
|
|
17203
|
-
Type: `Result.Result<${typeParameters[0].Type}, ${typeParameters[1].Type}>`,
|
|
17204
|
-
importDeclarations: [`import * as Result from "effect/Result"`]
|
|
17205
|
-
}),
|
|
17206
17009
|
expected: "Result",
|
|
17207
17010
|
toCodec: ([success, failure]) =>
|
|
17208
17011
|
link<Result_.Result<A["Encoded"], E["Encoded"]>>()(
|
|
@@ -17279,11 +17082,6 @@ export const SemVer: SemVer = declare(
|
|
|
17279
17082
|
id: "effect/schema/SemVer",
|
|
17280
17083
|
payload: null
|
|
17281
17084
|
},
|
|
17282
|
-
toCode: () => ({
|
|
17283
|
-
runtime: `Schema.SemVer`,
|
|
17284
|
-
Type: `SemVer.SemVer`,
|
|
17285
|
-
importDeclarations: [`import * as SemVer from "effect/SemVer"`]
|
|
17286
|
-
}),
|
|
17287
17085
|
expected: "SemVer",
|
|
17288
17086
|
toCodecArbitrary: () =>
|
|
17289
17087
|
linkDecoding<SemVer_.SemVer>()(
|
|
@@ -17359,11 +17157,6 @@ export const SemVerRange: SemVerRange = declare(
|
|
|
17359
17157
|
id: "effect/schema/SemVerRange",
|
|
17360
17158
|
payload: null
|
|
17361
17159
|
},
|
|
17362
|
-
toCode: () => ({
|
|
17363
|
-
runtime: `Schema.SemVerRange`,
|
|
17364
|
-
Type: `SemVerRange.SemVerRange`,
|
|
17365
|
-
importDeclarations: [`import * as SemVerRange from "effect/SemVerRange"`]
|
|
17366
|
-
}),
|
|
17367
17160
|
expected: "SemVerRange",
|
|
17368
17161
|
toCodecArbitrary: () =>
|
|
17369
17162
|
linkDecoding<SemVerRange_.SemVerRange>()(
|
|
@@ -19129,12 +18922,7 @@ export interface JsonObject {
|
|
|
19129
18922
|
* @category schemas
|
|
19130
18923
|
* @since 4.0.0
|
|
19131
18924
|
*/
|
|
19132
|
-
export const Json: Codec<Json> = make(SchemaAST.
|
|
19133
|
-
toCode: () => ({
|
|
19134
|
-
runtime: "Schema.Json",
|
|
19135
|
-
Type: "Schema.Json"
|
|
19136
|
-
})
|
|
19137
|
-
}))
|
|
18925
|
+
export const Json: Codec<Json> = make(SchemaAST.Json)
|
|
19138
18926
|
/**
|
|
19139
18927
|
* Schema for readonly string-keyed records whose values are JSON-compatible.
|
|
19140
18928
|
*
|
|
@@ -19199,12 +18987,7 @@ const JsonError = Struct({
|
|
|
19199
18987
|
* @category schemas
|
|
19200
18988
|
* @since 4.0.0
|
|
19201
18989
|
*/
|
|
19202
|
-
export const MutableJson: Codec<MutableJson> = make(SchemaAST.
|
|
19203
|
-
toCode: () => ({
|
|
19204
|
-
runtime: "Schema.MutableJson",
|
|
19205
|
-
Type: "Schema.MutableJson"
|
|
19206
|
-
})
|
|
19207
|
-
}))
|
|
18990
|
+
export const MutableJson: Codec<MutableJson> = make(SchemaAST.MutableJson)
|
|
19208
18991
|
/**
|
|
19209
18992
|
* Resolves the typed annotations from a schema. The term "resolve" (rather
|
|
19210
18993
|
* than "get") reflects the lookup strategy: if the schema has checks, the
|