effect 4.0.0-beta.46 → 4.0.0-beta.47
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Schema.d.ts +223 -140
- package/dist/Schema.d.ts.map +1 -1
- package/dist/Schema.js +110 -32
- package/dist/Schema.js.map +1 -1
- package/dist/Types.d.ts +9 -0
- package/dist/Types.d.ts.map +1 -1
- package/dist/unstable/ai/McpSchema.d.ts +1 -1
- package/dist/unstable/ai/McpSchema.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApiSchema.d.ts +7 -7
- package/dist/unstable/httpapi/HttpApiSchema.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApiSchema.js.map +1 -1
- package/dist/unstable/rpc/RpcSchema.d.ts +1 -1
- package/dist/unstable/rpc/RpcSchema.d.ts.map +1 -1
- package/dist/unstable/workers/Transferable.d.ts +1 -1
- package/dist/unstable/workers/Transferable.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/Schema.ts +260 -167
- package/src/Types.ts +8 -0
- package/src/unstable/ai/McpSchema.ts +1 -1
- package/src/unstable/httpapi/HttpApiSchema.ts +4 -6
- package/src/unstable/rpc/RpcSchema.ts +1 -1
- package/src/unstable/workers/Transferable.ts +2 -2
package/src/Types.ts
CHANGED
|
@@ -1001,3 +1001,11 @@ export type OmitReason<E, K extends string> = E extends { readonly reason: infer
|
|
|
1001
1001
|
export type ExcludeReason<E, K extends string> = E extends { readonly reason: infer R }
|
|
1002
1002
|
? Exclude<R, { readonly _tag: K }>
|
|
1003
1003
|
: never
|
|
1004
|
+
|
|
1005
|
+
/**
|
|
1006
|
+
* Extracts the required keys from a type.
|
|
1007
|
+
*
|
|
1008
|
+
* @since 4.0.0
|
|
1009
|
+
* @category types
|
|
1010
|
+
*/
|
|
1011
|
+
export type RequiredKeys<T> = { [K in keyof T]-?: {} extends Pick<T, K> ? never : K }[keyof T]
|
|
@@ -2106,7 +2106,7 @@ export interface Param<Name extends string, S extends Schema.Top> extends
|
|
|
2106
2106
|
S["~encoded.optionality"]
|
|
2107
2107
|
>
|
|
2108
2108
|
{
|
|
2109
|
-
readonly "
|
|
2109
|
+
readonly "Rebuild": Param<Name, S>
|
|
2110
2110
|
readonly [ParamSchemaTypeId]: typeof ParamSchemaTypeId
|
|
2111
2111
|
readonly name: Name
|
|
2112
2112
|
readonly schema: S
|
|
@@ -87,7 +87,7 @@ export type ResponseEncoding = {
|
|
|
87
87
|
* @since 4.0.0
|
|
88
88
|
*/
|
|
89
89
|
export function status(code: number) {
|
|
90
|
-
return <S extends Schema.Top>(self: S): S["
|
|
90
|
+
return <S extends Schema.Top>(self: S): S["Rebuild"] => {
|
|
91
91
|
return self.annotate({ httpApiStatus: code })
|
|
92
92
|
}
|
|
93
93
|
}
|
|
@@ -190,7 +190,7 @@ export type MultipartTypeId = typeof MultipartTypeId
|
|
|
190
190
|
/**
|
|
191
191
|
* @since 4.0.0
|
|
192
192
|
*/
|
|
193
|
-
export interface asMultipart<S extends Schema.Top> extends Schema.brand<S["
|
|
193
|
+
export interface asMultipart<S extends Schema.Top> extends Schema.brand<S["Rebuild"], MultipartTypeId> {}
|
|
194
194
|
|
|
195
195
|
/**
|
|
196
196
|
* Marks a schema as a multipart payload.
|
|
@@ -225,9 +225,7 @@ export type MultipartStreamTypeId = typeof MultipartStreamTypeId
|
|
|
225
225
|
/**
|
|
226
226
|
* @since 4.0.0
|
|
227
227
|
*/
|
|
228
|
-
export interface asMultipartStream<S extends Schema.Top>
|
|
229
|
-
extends Schema.brand<S["~rebuild.out"], MultipartStreamTypeId>
|
|
230
|
-
{}
|
|
228
|
+
export interface asMultipartStream<S extends Schema.Top> extends Schema.brand<S["Rebuild"], MultipartStreamTypeId> {}
|
|
231
229
|
|
|
232
230
|
/**
|
|
233
231
|
* Marks a schema as a multipart stream payload.
|
|
@@ -252,7 +250,7 @@ export function asMultipartStream(options?: Multipart_.withLimits.Options) {
|
|
|
252
250
|
function asNonMultipartEncoding<S extends Schema.Top>(self: S, options: {
|
|
253
251
|
readonly _tag: "Json" | "FormUrlEncoded" | "Uint8Array" | "Text"
|
|
254
252
|
readonly contentType?: string | undefined
|
|
255
|
-
}): S["
|
|
253
|
+
}): S["Rebuild"] {
|
|
256
254
|
return self.annotate({
|
|
257
255
|
"~httpApiEncoding": {
|
|
258
256
|
_tag: options._tag,
|
|
@@ -47,7 +47,7 @@ export interface Stream<A extends Schema.Top, E extends Schema.Top> extends
|
|
|
47
47
|
Stream<A, E>
|
|
48
48
|
>
|
|
49
49
|
{
|
|
50
|
-
readonly "
|
|
50
|
+
readonly "Rebuild": Stream<A, E>
|
|
51
51
|
readonly [StreamSchemaTypeId]: typeof StreamSchemaTypeId
|
|
52
52
|
readonly success: A
|
|
53
53
|
readonly error: E
|