viell-effect-schema-http 0.1.0-rc.1 → 0.2.0

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.
Files changed (62) hide show
  1. package/README.md +93 -48
  2. package/dist/concurrency/Interaction.d.ts +39 -6
  3. package/dist/concurrency/Interaction.d.ts.map +1 -1
  4. package/dist/concurrency/Interaction.js +25 -4
  5. package/dist/concurrency/Interaction.js.map +1 -1
  6. package/dist/http/Body.d.ts +142 -22
  7. package/dist/http/Body.d.ts.map +1 -1
  8. package/dist/http/Body.js +118 -14
  9. package/dist/http/Body.js.map +1 -1
  10. package/dist/http/Operation.d.ts +332 -12
  11. package/dist/http/Operation.d.ts.map +1 -1
  12. package/dist/http/Operation.js +255 -9
  13. package/dist/http/Operation.js.map +1 -1
  14. package/dist/http/Policy.d.ts +49 -13
  15. package/dist/http/Policy.d.ts.map +1 -1
  16. package/dist/http/Policy.js +32 -10
  17. package/dist/http/Policy.js.map +1 -1
  18. package/dist/http/Request.d.ts +661 -79
  19. package/dist/http/Request.d.ts.map +1 -1
  20. package/dist/http/Request.js +762 -120
  21. package/dist/http/Request.js.map +1 -1
  22. package/dist/http/Response.d.ts +200 -11
  23. package/dist/http/Response.d.ts.map +1 -1
  24. package/dist/http/Response.js +149 -10
  25. package/dist/http/Response.js.map +1 -1
  26. package/dist/http/Transport.d.ts +59 -11
  27. package/dist/http/Transport.d.ts.map +1 -1
  28. package/dist/http/Transport.js +46 -9
  29. package/dist/http/Transport.js.map +1 -1
  30. package/dist/http/UrlEncoding.d.ts +81 -9
  31. package/dist/http/UrlEncoding.d.ts.map +1 -1
  32. package/dist/http/UrlEncoding.js +41 -5
  33. package/dist/http/UrlEncoding.js.map +1 -1
  34. package/dist/http/internal/fields.d.ts +17 -4
  35. package/dist/http/internal/fields.d.ts.map +1 -1
  36. package/dist/http/internal/fields.js +11 -6
  37. package/dist/http/internal/fields.js.map +1 -1
  38. package/dist/http/internal/input.d.ts +39 -0
  39. package/dist/http/internal/input.d.ts.map +1 -0
  40. package/dist/http/internal/input.js +40 -0
  41. package/dist/http/internal/input.js.map +1 -0
  42. package/dist/http/internal/shape.d.ts +44 -0
  43. package/dist/http/internal/shape.d.ts.map +1 -0
  44. package/dist/http/internal/shape.js +179 -0
  45. package/dist/http/internal/shape.js.map +1 -0
  46. package/dist/main.d.ts +24 -0
  47. package/dist/main.d.ts.map +1 -1
  48. package/dist/main.js +24 -0
  49. package/dist/main.js.map +1 -1
  50. package/package.json +13 -13
  51. package/src/concurrency/Interaction.ts +39 -6
  52. package/src/http/Body.ts +158 -27
  53. package/src/http/Operation.ts +530 -32
  54. package/src/http/Policy.ts +49 -13
  55. package/src/http/Request.ts +1241 -227
  56. package/src/http/Response.ts +316 -28
  57. package/src/http/Transport.ts +59 -11
  58. package/src/http/UrlEncoding.ts +89 -10
  59. package/src/http/internal/fields.ts +37 -9
  60. package/src/http/internal/input.ts +123 -0
  61. package/src/http/internal/shape.ts +279 -0
  62. package/src/main.ts +24 -0
@@ -2,133 +2,715 @@ import { Effect, Pipeable, Schema } from "effect";
2
2
  import { HttpClientRequest, UrlParams } from "effect/http";
3
3
  import type * as Body from "./Body.js";
4
4
  import * as Fields from "./internal/fields.js";
5
+ import * as Inputs from "./internal/input.js";
6
+ import * as Shapes from "./internal/shape.js";
5
7
  import * as Transport from "./Transport.js";
6
8
  import * as UrlEncoding from "./UrlEncoding.js";
7
9
  declare const InvalidRequest_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }>) => import("effect/Cause").YieldableError & {
8
10
  readonly _tag: "InvalidRequest";
9
11
  } & Readonly<A>;
10
- /** Request fields could not be materialized, the URL could not be encoded, or a GET/HEAD request has a body. */
12
+ /**
13
+ * Request preparation failed before dispatch.
14
+ *
15
+ * @remarks
16
+ * Covers computed-field failures, URL-rendering exceptions, and fields that do not fit the schemas
17
+ * bound to their group. Schema failures of the caller's input remain separate `SchemaError` values.
18
+ * A failed check of a group names its fields and leaves out their values, which may be credentials.
19
+ */
11
20
  export declare class InvalidRequest extends InvalidRequest_base<{
12
21
  readonly message: string;
13
22
  readonly cause?: unknown;
14
23
  }> {
15
24
  }
16
- /** A header or query value, or a computation evaluated once per materialization. `undefined` omits it. */
25
+ /**
26
+ * A fixed header or query value, or a function that supplies it during preparation.
27
+ *
28
+ * @remarks
29
+ * A function runs once each time the request is compiled, not once per retry. `undefined` omits
30
+ * the field. Query fields also accept `null` for a bare key.
31
+ */
17
32
  export type FieldValue<A = string> = Fields.Value<A>;
18
- /** Raw declarations, materialized before input preparation. */
19
- export interface Declaration<H extends boolean = boolean, Q extends boolean = boolean> {
33
+ /**
34
+ * Headers declared together: a name's value, or `undefined` to remove its declarations.
35
+ *
36
+ * @remarks
37
+ * Use with {@link setHeader}. A value is text or a function that supplies it, as in
38
+ * {@link FieldValue}.
39
+ */
40
+ export type HeaderFields = Readonly<Record<string, FieldValue | undefined>>;
41
+ /**
42
+ * Query fields declared together: what a query schema may encode to, or a function.
43
+ *
44
+ * @remarks
45
+ * Use with {@link setQuery}. Numbers, bigints and booleans become text, a `Date` becomes ISO text,
46
+ * `null` is a bare key, an array repeats the name, and `undefined` removes the name's declarations.
47
+ * A function supplies one such value during preparation, written the same way, and `undefined`
48
+ * from it declares nothing, as in {@link FieldValue}. Fields apply in the object's key order, in
49
+ * which JavaScript puts integer-like keys first.
50
+ */
51
+ export type QueryFields = Readonly<Record<string, UrlEncoding.QueryValue | ReadonlyArray<UrlEncoding.QueryValue> | (() => UrlEncoding.QueryValue)>>;
52
+ /**
53
+ * What a schema-backed input takes: the schema's decoded side, its encoded side, or a mix by field.
54
+ *
55
+ * @remarks
56
+ * The decoded side is what the schema's constructor takes, so a plain object works for a
57
+ * `Schema.Class`, and a field with a constructor default can be left out. The encoded side is what
58
+ * goes on the wire, and {@link path}, {@link query}, {@link headers} and the schema body encoders
59
+ * all take it. The request always carries what the schema writes.
60
+ *
61
+ * Preparation tries the decoded side first, then the decoder as a whole, then the decoder field by
62
+ * field. If all fail, it reports the decoded side's error, a `SchemaError` before dispatch. Both
63
+ * routes validate, so text cannot get past a schema, but a weak schema lets more through:
64
+ * `Schema.NumberFromString` turns `"many"` into `NaN`, and `Schema.FiniteFromString` refuses it.
65
+ *
66
+ * A value that fits the decoded side is read as decoded. Under a schema whose two sides share a
67
+ * type, such as one from text to text, an already encoded value fits the decoded side, so it is
68
+ * encoded again, with no error. A mix is one level deep in the type. Renamed fields take their
69
+ * encoded names only when the whole value is on the encoded side.
70
+ */
71
+ export type Input<S extends Schema.Top> = Inputs.Input<S>;
72
+ /**
73
+ * The whole input of a request: the object its call takes, with every binding's property.
74
+ *
75
+ * @example
76
+ * ```ts
77
+ * import { Schema } from "effect";
78
+ * import { Request } from "viell-effect-schema-http";
79
+ * const listThings = Request.get("https://api.example.test/things").pipe(
80
+ * Request.query(Schema.Struct({ sort: Schema.String })),
81
+ * Request.headers(Schema.Struct({ authorization: Schema.String })),
82
+ * );
83
+ * type ListInput = Request.InputOf<typeof listThings>;
84
+ * const withToken = listThings.pipe(
85
+ * Request.mapInput(
86
+ * (input: Omit<ListInput, "headers">): ListInput => ({
87
+ * ...input,
88
+ * headers: { authorization: "Bearer token" },
89
+ * }),
90
+ * ),
91
+ * );
92
+ * // Input: { query: { sort: "name" } }
93
+ * ```
94
+ *
95
+ * @remarks
96
+ * This takes a request, and {@link Input} takes a schema. `Input` is what one binding takes, such
97
+ * as the value under `query`, and this is the object that holds them all, which is what
98
+ * {@link mapInput} has to return. `Operation.InputOf` gives the same for an operation.
99
+ */
100
+ export type InputOf<R> = R extends Request<infer I, unknown, unknown> ? I : never;
101
+ /**
102
+ * The method, URL and raw fields from which request preparation starts.
103
+ *
104
+ * @remarks
105
+ * This is a low-level extension type. Prefer {@link make} and the request combinators.
106
+ */
107
+ export interface Declaration {
20
108
  readonly method: string;
21
109
  readonly url: string;
22
- readonly baseUrl: string;
110
+ /** The fragment written in the constructor, without its `#`. */
111
+ readonly hash: string | undefined;
112
+ /**
113
+ * The base URL as text, or an Effect that supplies it during preparation. The request's own error
114
+ * and service types carry what that Effect needs. {@link mapBaseUrl} always leaves an Effect.
115
+ */
116
+ readonly baseUrl: string | Effect.Effect<string, unknown, unknown>;
23
117
  readonly headers: Fields.Fields;
24
118
  readonly query: Fields.Fields<string | null>;
25
- /** Whether a schema owns the header group; raw header setters are then unavailable. */
26
- readonly headersBound: H;
27
- /** Whether a schema owns the query group; raw query setters are then unavailable. */
28
- readonly queryBound: Q;
119
+ /** The constructor wrote a `?` with nothing after it, which holds no entries. */
120
+ readonly emptyQuery: boolean;
121
+ /** Lowercase header names the request removed, so the library adds no automatic value. */
122
+ readonly removedHeaders: ReadonlySet<string>;
123
+ /** The schemas bound to the header group, which together state its shape. */
124
+ readonly headerShapes: ReadonlyArray<Shape>;
125
+ /** The schemas bound to the query group, which together state its shape. */
126
+ readonly queryShapes: ReadonlyArray<Shape>;
127
+ /** Raw edits, after a schema, of a name it always writes, which could never reach the client. */
128
+ readonly conflicts: ReadonlyArray<readonly [group: "query" | "headers", name: string]>;
29
129
  }
30
- /** A query parameter of a native request, compared by identity to recognize bare keys. */
130
+ /**
131
+ * What one header or query schema says about its group: the names it allows, whether it allows
132
+ * others, and the names it always writes.
133
+ *
134
+ * @remarks
135
+ * This is a low-level extension type, read from the schema's encoded side when it is bound. Header
136
+ * names are lowercase.
137
+ */
138
+ export type Shape = Shapes.Shape;
139
+ /** A part of a request that a binding can supply, and that {@link unbind} can clear. */
140
+ export type Group = "path" | "query" | "headers" | "body";
141
+ /**
142
+ * One entry in Effect's native query collection.
143
+ *
144
+ * @remarks
145
+ * Drafts use entry identity to distinguish bare keys from empty values, and to keep the text a
146
+ * constructor entry was written with.
147
+ */
31
148
  export type UrlParam = UrlParams.UrlParams["params"][number];
32
- /** The request during input preparation. */
149
+ /**
150
+ * The native request and representation details available during input preparation.
151
+ *
152
+ * @remarks
153
+ * The base URL and final query text are applied after preparation. Prefer public combinators
154
+ * unless implementing a low-level extension.
155
+ */
33
156
  export interface Draft {
34
157
  /** Method, path or URL, query parameters, normalized headers and body. */
35
158
  readonly request: HttpClientRequest.HttpClientRequest;
36
159
  /** The authoritative header lines; compilation reconciles them with the native headers. */
37
160
  readonly headerLines: Transport.Lines;
38
- /** The parameters of `request.urlParams` that render as bare keys. Native edits replace them. */
161
+ /** Native query entries that render as bare keys. Replacing an entry loses its identity marker. */
39
162
  readonly bareKeys: ReadonlySet<UrlParam>;
163
+ /** Native query entries that keep their written text. Replacing an entry loses that text. */
164
+ readonly queryText: ReadonlyMap<UrlParam, string>;
165
+ /**
166
+ * Native query entries the request declared, which a bound schema checks. A native edit makes a
167
+ * new entry, so {@link mapEffect} stays outside the check.
168
+ */
169
+ readonly declaredQuery: ReadonlySet<UrlParam>;
170
+ /** Lowercase header names the request removed, so the library adds no automatic value. */
171
+ readonly removedHeaders: ReadonlySet<string>;
172
+ /** The groups a later {@link unbind} cleared, so their earlier bindings skip themselves. */
173
+ readonly unbound: ReadonlySet<Group>;
40
174
  }
41
175
  /**
42
- * A pure description of an HTTP request and the application input it requires. `I` is the complete
43
- * invocation argument; `H` and `Q` record whether schemas own the header and query groups.
176
+ * An immutable HTTP request description with typed application input.
44
177
  *
45
- * `declaration` and `prepare` are low-level extension points. Prefer the combinators of this module.
178
+ * @remarks
179
+ * Construction sends nothing. {@link compile} prepares it; `Operation.make` prepares and sends it.
180
+ * `I` is the complete input, `E` its preparation errors, and `R` its required services.
181
+ * `declaration` and `prepare` are low-level extension points.
46
182
  */
47
- export interface Request<in I, out E = never, out R = never, out H extends boolean = false, out Q extends boolean = false> extends Pipeable.Pipeable {
48
- readonly declaration: Declaration<H, Q>;
183
+ export interface Request<in I, out E = never, out R = never> extends Pipeable.Pipeable {
184
+ readonly declaration: Declaration;
49
185
  readonly prepare: (input: I, draft: Draft) => Effect.Effect<Draft, E, R>;
50
186
  }
51
187
  /**
52
- * A request with no required input; execute it with `undefined`. A query string in `url` becomes raw query
53
- * declarations through form decoding: `+` is a space, percent escapes are decoded, and empty `&` segments
54
- * are dropped. Bare keys stay distinct from empty values. Materialization renders the decoded entries
55
- * through `UrlEncoding.query`. A fragment is discarded. Custom method strings pass through unchanged.
188
+ * Describe a request with a method and URL, without sending it.
189
+ *
190
+ * @remarks
191
+ * Use `undefined` as input until a binding adds required fields. A relative path can be combined
192
+ * with {@link baseUrl}, and {@link path} adds to it, so `""` starts a path written whole in a
193
+ * template. Custom method strings pass through unchanged.
194
+ *
195
+ * A constructor query is passed to the client as written until something edits that entry, so
196
+ * `?a=1;b=2`, `?q=a+b` and `?a=%41` keep their spelling, as do empty `&` segments and a lone `?`.
197
+ * Each entry also has a form-decoded name and value, which {@link setQuery} and {@link removeQuery}
198
+ * compare against. An entry that is edited, or added, is rendered through `UrlEncoding.query`. An
199
+ * entry under a name a {@link query} schema allows goes through that schema, and one under a name
200
+ * no bound schema allows is an incompatible shape. A written empty segment has no name, so it is
201
+ * not a field, and it stays as written.
202
+ *
203
+ * A fragment stays on the request, exactly as written, in the native request's `hash` field. It
204
+ * survives {@link path} and query edits, and wins over a fragment in path output or a base URL.
205
+ * Whether it goes out is up to the client; `fetch` does not send one.
56
206
  */
57
207
  export declare const make: (method: string, url: string) => Request<unknown>;
208
+ /**
209
+ * Describe a GET request. Use {@link baseUrl} for a shared origin or path prefix.
210
+ *
211
+ * @example
212
+ * ```ts
213
+ * import { Request } from "viell-effect-schema-http";
214
+ * const users = Request.get("/users").pipe(
215
+ * Request.baseUrl("https://api.example.test/api/v1"),
216
+ * );
217
+ * ```
218
+ */
58
219
  export declare const get: (url: string) => Request<unknown>;
220
+ /**
221
+ * Describe a POST request. Add typed input with {@link body}, {@link path} or other bindings.
222
+ */
59
223
  export declare const post: (url: string) => Request<unknown>;
224
+ /**
225
+ * Describe a PUT request. Add an outgoing representation with {@link body}.
226
+ */
60
227
  export declare const put: (url: string) => Request<unknown>;
228
+ /**
229
+ * Describe a PATCH request. Add an outgoing representation with {@link body}.
230
+ */
61
231
  export declare const patch: (url: string) => Request<unknown>;
232
+ /**
233
+ * Describe a DELETE request. A response contract decides which deletion outcomes to accept.
234
+ */
62
235
  export declare const del: (url: string) => Request<unknown>;
236
+ /**
237
+ * Describe a HEAD request. A {@link body} is passed on as for any method; the client may refuse it.
238
+ */
63
239
  export declare const head: (url: string) => Request<unknown>;
240
+ /**
241
+ * Describe an OPTIONS request. The HTTP provider still controls browser preflight behavior.
242
+ */
64
243
  export declare const options: (url: string) => Request<unknown>;
65
- /** Replace the base URL joined with the request URL during materialization. */
66
- export declare const baseUrl: (url: string) => <I, E, R, H extends boolean, Q extends boolean>(self: Request<I, E, R, H, Q>) => Request<I, E, R, H, Q>;
67
- /** Replace every line of a header. Names are case-insensitive. */
68
- export declare const setHeader: (name: string, value: FieldValue) => <I, E, R, Q extends boolean>(self: Request<I, E, R, false, Q>) => Request<I, E, R, false, Q>;
69
- /** Add a header line after the existing lines. */
70
- export declare const appendHeader: (name: string, value: FieldValue) => <I, E, R, Q extends boolean>(self: Request<I, E, R, false, Q>) => Request<I, E, R, false, Q>;
71
- /** Remove a header, or only its static lines equal to `value`. Computations are never evaluated to compare. */
72
- export declare const removeHeader: (name: string, value?: string) => <I, E, R, Q extends boolean>(self: Request<I, E, R, false, Q>) => Request<I, E, R, false, Q>;
73
- /** Replace every entry of a query key. `null` is a bare key. */
74
- export declare const setQuery: (name: string, value: FieldValue<string | null>) => <I, E, R, H extends boolean>(self: Request<I, E, R, H, false>) => Request<I, E, R, H, false>;
75
- /** Add a query entry after the existing entries. */
76
- export declare const appendQuery: (name: string, value: FieldValue<string | null>) => <I, E, R, H extends boolean>(self: Request<I, E, R, H, false>) => Request<I, E, R, H, false>;
77
- /** Remove a query key, or only its static entries equal to `value`. */
78
- export declare const removeQuery: (name: string, value?: string | null) => <I, E, R, H extends boolean>(self: Request<I, E, R, H, false>) => Request<I, E, R, H, false>;
79
- /**
80
- * Require `{ headers }` input, encoded by a schema into ordered lines. The schema replaces the raw header
81
- * declarations and owns the group.
82
- *
83
- * When the request has a body, Content-Type and Content-Length keep the values that the body codec, or a
84
- * native edit, gave them, whichever order the combinators are applied in. Without a body, the schema's
85
- * values apply; a `Request.body` applied after this, including `Body.empty`, replaces them as its codec does.
86
- */
87
- export declare const headers: <S extends Schema.ConstraintCodec<unknown, Transport.HeaderInput, unknown, unknown>>(contract: S) => <I, E, R, Q extends boolean>(self: Request<I, E, R, false, Q>) => Request<I & {
88
- readonly headers: S["Type"];
89
- }, E | Schema.SchemaError, R | S["EncodingServices"], true, Q>;
90
- /**
91
- * Require `{ query }` input, encoded by a schema into ordered entries. The schema replaces the raw query
92
- * declarations and owns the group.
93
- */
94
- export declare const query: <S extends Schema.ConstraintCodec<unknown, UrlEncoding.QueryInput, unknown, unknown>>(contract: S) => <I, E, R, H extends boolean>(self: Request<I, E, R, H, false>) => Request<I & {
95
- readonly query: S["Type"];
96
- }, E | Schema.SchemaError, R | S["EncodingServices"], H, true>;
97
- /**
98
- * Require `{ path }` input. `render` receives the schema-encoded value and the current path encoder. A
99
- * value the encoder cannot encode fails with `InvalidRequest`. Any other exception thrown by `render`
100
- * fails the same way, as an exception from a replaced `UrlEncoding` service does.
101
- */
102
- export declare const path: <S extends Schema.Constraint>(contract: S, render: (value: S["Encoded"], encode: UrlEncoding.Service["path"]) => string) => <I, E, R, H extends boolean, Q extends boolean>(self: Request<I, E, R, H, Q>) => Request<I & {
103
- readonly path: S["Type"];
104
- }, E | Schema.SchemaError | InvalidRequest, R | S["EncodingServices"], H, Q>;
105
- /** Require `{ body }` input, encoded once per evaluation. The encoded body sets Content-Type. */
106
- export declare const body: <A, E2, R2>(codec: Body.Encoder<A, E2, R2>) => <I, E, R, H extends boolean, Q extends boolean>(self: Request<I, E, R, H, Q>) => Request<I & {
244
+ /**
245
+ * Set the shared origin and fixed path prefix for a request, as text or from an Effect.
246
+ *
247
+ * @example
248
+ * ```ts
249
+ * import { Request } from "viell-effect-schema-http";
250
+ * const api = Request.baseUrl("https://api.example.test/api/v1");
251
+ * const users = Request.get("/users").pipe(api);
252
+ * const teams = Request.get("/teams").pipe(api);
253
+ * ```
254
+ *
255
+ * @example
256
+ * ```ts
257
+ * import { Context, Effect } from "effect";
258
+ * import { Request } from "viell-effect-schema-http";
259
+ * class ApiHost extends Context.Service<ApiHost, string>()("app/ApiHost") {}
260
+ * const discovered = Effect.gen(function* () {
261
+ * const host = yield* ApiHost;
262
+ * return `https://${host}/api/v1`;
263
+ * });
264
+ * const users = Request.get("/users").pipe(Request.baseUrl(discovered));
265
+ * // The request needs ApiHost, as it would need any other service.
266
+ * ```
267
+ *
268
+ * @remarks
269
+ * The base is joined after path preparation. With the default URL policy, an absolute request
270
+ * URL bypasses it; a leading `/` on a relative path keeps the base's prefix. Calling this again
271
+ * replaces the base, rather than appending to it, and {@link mapBaseUrl} extends it. Keep query
272
+ * fields in request combinators. A fragment in the base is taken off before joining and used if the
273
+ * request has none of its own.
274
+ *
275
+ * An Effect supplies a location that is not known when the request is defined, from a service or a
276
+ * `Config` value, say. Its failures and services join the request's type, so leaving out a service
277
+ * is a compile error. It runs once per evaluation, after the input is encoded and before any
278
+ * attempt, so every retry uses the same base. Its failure is returned as it is, before anything is
279
+ * sent, and a retry policy does not repeat it. What it supplies is treated exactly as text would
280
+ * be, including by a replaced `UrlEncoding.join`.
281
+ *
282
+ * A location that must change between attempts belongs in `Operation.make`'s `transformClient`. A
283
+ * base that is replaced never runs, though the request's types keep what it added.
284
+ */
285
+ export declare const baseUrl: <E2 = never, R2 = never>(url: string | Effect.Effect<string, E2, R2>) => <I, E, R>(self: Request<I, E, R>) => Request<I, E | E2, R | R2>;
286
+ /**
287
+ * Change the base URL, whether it is text or an Effect, to extend a prefix or swap part of it.
288
+ *
289
+ * @example
290
+ * ```ts
291
+ * import { Request } from "viell-effect-schema-http";
292
+ * const api = Request.baseUrl("https://api.example.test/api/v1");
293
+ * const toAdmin = (url: string) => `${url}/admin`;
294
+ * const admin = Request.mapBaseUrl(toAdmin);
295
+ * const listUsers = Request.get("/users").pipe(api, admin);
296
+ * // https://api.example.test/api/v1/admin/users
297
+ * ```
298
+ *
299
+ * @remarks
300
+ * Use it where a request holds a base you cannot read, as an imported definition does, or one that
301
+ * is not known yet. `f` runs during preparation, once per evaluation, and receives the base as it
302
+ * stands at this step, so `""` where none is set. That is the whole text, including any query or
303
+ * fragment in it, and what `f` returns is joined exactly as a base from {@link baseUrl} would be. A
304
+ * later {@link baseUrl} replaces the result. An exception from `f` is an {@link InvalidRequest}.
305
+ */
306
+ export declare const mapBaseUrl: (f: (url: string) => string) => Edit;
307
+ /** A raw edit: a request's fields change, and its input, errors and services stay. */
308
+ type Edit = <I, E, R>(self: Request<I, E, R>) => Request<I, E, R>;
309
+ /**
310
+ * Set a raw header, replacing every existing line with that name, or set several from an object.
311
+ *
312
+ * @example
313
+ * ```ts
314
+ * import { Request } from "viell-effect-schema-http";
315
+ * const request = Request.get("https://api.example.test/things").pipe(
316
+ * Request.setHeader("X-One", "1"),
317
+ * Request.setHeader({ "X-Two": "2", "X-Three": () => "3" }),
318
+ * );
319
+ * ```
320
+ *
321
+ * @remarks
322
+ * Names compare without case, and the new line keeps the spelling of this call. A declared
323
+ * `Accept`, `Content-Type` or `Content-Length` replaces the automatic value, before or after the
324
+ * body.
325
+ *
326
+ * With a {@link headers} schema bound, in either order, the name has to be one a schema allows, and
327
+ * the value is a default that goes through the schema. Setting a name the schema always writes,
328
+ * after that schema, is an {@link InvalidRequest}, because the value could never reach the client.
329
+ *
330
+ * In the object form each key replaces its name as above, in key order, and other names stay. A key
331
+ * set to `undefined` removes that name's declarations and stops no automatic value, which is what
332
+ * {@link removeHeader} is for.
333
+ */
334
+ export declare const setHeader: {
335
+ (name: string, value: FieldValue): Edit;
336
+ (fields: HeaderFields): Edit;
337
+ };
338
+ /**
339
+ * Add a raw header line after the existing lines, preserving repetition.
340
+ *
341
+ * @remarks
342
+ * Each line keeps the spelling of its call. A bound {@link headers} schema checks it as it does
343
+ * {@link setHeader}. Sending separate lines requires a provider that supports them; Fetch may
344
+ * combine or restrict headers.
345
+ */
346
+ export declare const appendHeader: (name: string, value: FieldValue) => Edit;
347
+ /**
348
+ * Remove a raw header, or only its declarations with the supplied fixed value.
349
+ *
350
+ * @remarks
351
+ * Names compare without case. Value functions are never evaluated to compare with `value`. Removing
352
+ * a name a {@link headers} schema always writes, after that schema, is an {@link InvalidRequest},
353
+ * because the schema puts the value back. Removing an optional field clears its default.
354
+ *
355
+ * Without a value, this also stops the library's automatic value for that name: an operation's
356
+ * `Accept`, or a body's `Content-Type` and `Content-Length`. It stops only that. A value that a
357
+ * later declaration, a header schema or {@link mapEffect} supplies still goes out, and the client
358
+ * may add its own. A computed value that returns `undefined` declares nothing, so the removal stays
359
+ * in force. A removal limited to one value stops nothing, as the name may still be declared.
360
+ */
361
+ export declare const removeHeader: (name: string, value?: string) => Edit;
362
+ /**
363
+ * Set a raw query field, replacing entries with the same case-sensitive name, or set several from
364
+ * an object.
365
+ *
366
+ * @example
367
+ * ```ts
368
+ * import { Request } from "viell-effect-schema-http";
369
+ * const search = Request.get("https://api.example.test/users").pipe(
370
+ * Request.setQuery({ page: 2, tag: ["a", "b"], preview: null }),
371
+ * );
372
+ * // URL query: ?page=2&tag=a&tag=b&preview
373
+ * ```
374
+ *
375
+ * @remarks
376
+ * `null` produces a bare key, `""` an empty value, and `undefined` omits the entry. Names compare
377
+ * with an entry's decoded name, so this can replace an entry written in the constructor; other
378
+ * entries stay as written.
379
+ *
380
+ * With a {@link query} schema bound, in either order, the name has to be one a schema allows, and
381
+ * the value is a default that goes through the schema. Setting a name the schema always writes,
382
+ * after that schema, is an {@link InvalidRequest}, because the value could never reach the client.
383
+ *
384
+ * The object form takes {@link QueryFields}. Each key replaces its name as above, in key order, and
385
+ * other names stay. Use {@link appendQuery} for exact order across repeated names.
386
+ */
387
+ export declare const setQuery: {
388
+ (name: string, value: FieldValue<string | null>): Edit;
389
+ (fields: QueryFields): Edit;
390
+ };
391
+ /**
392
+ * Append a raw query entry, preserving order and repeated names.
393
+ *
394
+ * @remarks
395
+ * Uses the same value rules as {@link setQuery}, and a bound {@link query} schema checks it the
396
+ * same way.
397
+ */
398
+ export declare const appendQuery: (name: string, value: FieldValue<string | null>) => Edit;
399
+ /**
400
+ * Remove a raw query field, or only declarations with the supplied fixed value.
401
+ *
402
+ * @remarks
403
+ * Names compare with case, and both names and values compare with an entry's decoded form. Value
404
+ * functions are not evaluated for comparison. Removing a name a {@link query} schema always writes,
405
+ * after that schema, is an {@link InvalidRequest}, because the schema puts the value back. Removing
406
+ * an optional field clears its default.
407
+ */
408
+ export declare const removeQuery: (name: string, value?: string | null) => Edit;
409
+ /**
410
+ * Bind a schema to the call's `{ headers }` input.
411
+ *
412
+ * @remarks
413
+ * The input is an {@link Input} of the schema. Encoding produces ordered header lines. The schema
414
+ * states the shape of the group, whatever the order of the calls: once any schema is bound, every
415
+ * header the request declares must be a name some schema allows. A raw header under such a name
416
+ * is a default: what the schema writes replaces it, and otherwise it goes through the schema,
417
+ * which writes its value, spelling and order. An omitted optional field therefore leaves the
418
+ * default in place. A raw header under a name no schema allows is an {@link InvalidRequest} before
419
+ * anything is sent. A record or `Schema.StructWithRest` allows any name. Names compare without
420
+ * case.
421
+ *
422
+ * Under a union, the defaults and what the schema wrote have to fit one member together. A field
423
+ * that would be lost otherwise is an {@link InvalidRequest}, which names that field.
424
+ *
425
+ * Header schemas stack: a second one adds its fields, and together they state the shape. Use
426
+ * {@link unbind} to start again.
427
+ *
428
+ * A field the schema produces wins over an automatic `Accept`, `Content-Type` or `Content-Length`,
429
+ * whether the schema is bound before or after the body, and so does a default. An optional field
430
+ * left out with no default declares nothing, so the automatic value still applies.
431
+ *
432
+ * Header values are text, so a schema writes its own. A query schema can encode to a `Date`, but
433
+ * HTTP date headers are not ISO text, and `Schema.DateTimeUtcFromHttpDate` writes them.
434
+ */
435
+ export declare const headers: <S extends Schema.Top & Schema.ConstraintCodec<unknown, Transport.HeaderInput, unknown, unknown>>(contract: S) => <I, E, R>(self: Request<I, E, R>) => Request<I & {
436
+ readonly headers: Input<S>;
437
+ }, E | Schema.SchemaError | InvalidRequest, R | S["EncodingServices"] | S["DecodingServices"]>;
438
+ /**
439
+ * Bind a schema to the call's `{ query }` input.
440
+ *
441
+ * @example
442
+ * ```ts
443
+ * import { Schema } from "effect";
444
+ * import { Request } from "viell-effect-schema-http";
445
+ * const search = Request.get("https://api.example.test/users").pipe(
446
+ * Request.query(Schema.Struct({ page: Schema.FiniteFromString })),
447
+ * );
448
+ * // Input: { query: { page: 2 } }; URL query: ?page=2
449
+ * ```
450
+ *
451
+ * @remarks
452
+ * The input is an {@link Input} of the schema. The schema encodes to `UrlEncoding.QueryInput` and
453
+ * states the shape of the group, whatever the order of the calls: once any schema is bound, every
454
+ * query field the request declares must be a name some schema allows. A raw entry under such a
455
+ * name is a default, including one written in the constructor: what the schema writes replaces
456
+ * it, and otherwise it goes through the schema, which writes its value and order. An omitted
457
+ * optional field therefore leaves the default in place. A raw entry under a name no schema allows
458
+ * is an {@link InvalidRequest} before anything is sent. A record, `Schema.StructWithRest` or a list
459
+ * of pairs allows any name.
460
+ *
461
+ * Under a union, the defaults and what the schema wrote have to fit one member together. A field
462
+ * that would be lost otherwise is an {@link InvalidRequest}, which names that field.
463
+ *
464
+ * A field can encode to a `Date`, which is written as ISO text. Text under a field that encodes to
465
+ * a number, boolean, bigint or `Date` is read as one first, and a single value under a list field
466
+ * fits it. Date text is read as `Schema.DateFromString` reads it. The check is as strict as the
467
+ * schema. A `?` in a base URL or path output is text in the URL, not a field, so it is outside this
468
+ * check.
469
+ *
470
+ * Query schemas stack: a second one adds its fields, and together they state the shape. Use
471
+ * {@link unbind} to start again, and {@link mapInput} to supply a required field's value.
472
+ */
473
+ export declare const query: <S extends Schema.Top & Schema.ConstraintCodec<unknown, UrlEncoding.QueryInput, unknown, unknown>>(contract: S) => <I, E, R>(self: Request<I, E, R>) => Request<I & {
474
+ readonly query: Input<S>;
475
+ }, E | Schema.SchemaError | InvalidRequest, R | S["EncodingServices"] | S["DecodingServices"]>;
476
+ /** What a {@link PathValue}'s schema may encode to: one value with an obvious URL text. */
477
+ export type PathScalar = string | number | bigint | boolean;
478
+ /** A schema that encodes to one {@link PathScalar}, so its value fits in a path. */
479
+ export type PathSchema = Schema.Top & Schema.ConstraintCodec<unknown, PathScalar, unknown, unknown>;
480
+ /**
481
+ * A named value for a {@link path} template.
482
+ *
483
+ * @remarks
484
+ * Declare one with {@link pathValue}. `name` is its field under `path` in the input, and `schema` is
485
+ * what checks and encodes it.
486
+ */
487
+ export interface PathValue<K extends string = string, S extends PathSchema = PathSchema> {
488
+ readonly name: K;
489
+ readonly schema: S;
490
+ }
491
+ /**
492
+ * Declare a named value for a {@link path} template.
493
+ *
494
+ * @example
495
+ * ```ts
496
+ * import { Schema } from "effect";
497
+ * import { Request } from "viell-effect-schema-http";
498
+ * const customer = Request.pathValue("customer");
499
+ * const calendar = Request.pathValue("calendar", Schema.FiniteFromString);
500
+ * const getCalendar = Request.get("").pipe(
501
+ * Request.path`/customers/${customer}/calendars/${calendar}`,
502
+ * );
503
+ * // Input: { path: { customer: "a/b", calendar: 7 } }
504
+ * ```
505
+ *
506
+ * @remarks
507
+ * The value arrives under its name in `{ path }`, and without a schema it is a string. A schema has
508
+ * to encode to one {@link PathScalar}, and a value that gets past that type, as under `Schema.Any`,
509
+ * is an {@link InvalidRequest}. The input is an {@link Input} of the schema, so it takes either side.
510
+ * Declare a value once and reuse it across templates and definitions.
511
+ */
512
+ export declare const pathValue: {
513
+ <const K extends string>(name: K): PathValue<K, typeof Schema.String>;
514
+ <const K extends string, S extends PathSchema>(name: K, schema: S): PathValue<K, S>;
515
+ };
516
+ /**
517
+ * Add to the request's path, from a template or from a renderer.
518
+ *
519
+ * @example
520
+ * ```ts
521
+ * import { Schema } from "effect";
522
+ * import { Request } from "viell-effect-schema-http";
523
+ * const customer = Request.pathValue("customer");
524
+ * const calendar = Request.pathValue("calendar", Schema.FiniteFromString);
525
+ * const getCalendar = Request.get("").pipe(
526
+ * Request.baseUrl("https://api.example.test/v1"),
527
+ * Request.path`/customers/${customer}/calendars/${calendar}`,
528
+ * );
529
+ * // Input: { path: { customer: "a/b", calendar: 7 } }
530
+ * // URL: https://api.example.test/v1/customers/a%2Fb/calendars/7
531
+ * ```
532
+ *
533
+ * @example
534
+ * ```ts
535
+ * import { Schema } from "effect";
536
+ * import { Request } from "viell-effect-schema-http";
537
+ * const listFolder = Request.get("/files").pipe(
538
+ * Request.path(Schema.String, (folder, encode) =>
539
+ * folder === "" ? "/" : `/${folder.split("/").map(encode).join("/")}/`,
540
+ * ),
541
+ * );
542
+ * // Input: { path: "a b/c" }; URL: /files/a%20b/c/
543
+ * ```
544
+ *
545
+ * @remarks
546
+ * The path is the constructor's path followed by what each `path` call adds, in order, joined
547
+ * exactly as written. The library adds no `/` and removes none, so `/users` and `42` make
548
+ * `/users42`, and `/users/` and `/42` make `/users//42`. The base URL is joined afterwards. A `?` or
549
+ * `#` in the text is URL syntax, so a `#` starts the fragment for all that follows it. A fragment
550
+ * moves to the compiled request's `hash`, so the query still goes before it. The result is passed
551
+ * to the client as written, and the client may rewrite or refuse it.
552
+ *
553
+ * Use a template when the path has a fixed shape. Only a {@link pathValue} can go in one, so each
554
+ * value has its schema and always goes through the active `UrlEncoding` path encoder, and a run-time
555
+ * string is a compile error. A template with no values adds fixed text. The text is used as written
556
+ * and never parsed, so a backslash is a backslash and not an escape. Stacked templates add their
557
+ * fields to one `path` input, and a name used more than once gets the same value.
558
+ *
559
+ * Use a renderer when the shape of the path depends on the value, such as a value holding several
560
+ * segments or a whole URL. It receives the schema-encoded value and the active path-value encoder,
561
+ * and escaping each dynamic value is up to it. The value under `path` is an {@link Input} of the
562
+ * schema, so a scalar schema takes a scalar and a struct takes its fields. A scalar is one value for
563
+ * the whole `path`, so it does not stack with another scalar of a different type or with a template.
564
+ *
565
+ * Encoding does not make a value safe. A `/` in a value cannot add a segment, but `..` and an empty
566
+ * string have nothing to encode, and the client may resolve a dot segment. Constrain a value from a
567
+ * user in its schema.
568
+ *
569
+ * {@link unbind} removes what earlier calls added, and {@link setPath} replaces the constructor's
570
+ * text. Renderer or path-encoding exceptions become {@link InvalidRequest}; schema failures remain
571
+ * `SchemaError` values.
572
+ */
573
+ export declare const path: {
574
+ (text: TemplateStringsArray): Edit;
575
+ <const V extends readonly [PathValue, ...ReadonlyArray<PathValue>]>(text: TemplateStringsArray, ...values: V): <I, E, R>(self: Request<I, E, R>) => Request<I & {
576
+ readonly path: {
577
+ readonly [P in V[number] as P["name"]]: Input<P["schema"]>;
578
+ };
579
+ }, E | Schema.SchemaError | InvalidRequest, R | V[number]["schema"]["EncodingServices"] | V[number]["schema"]["DecodingServices"]>;
580
+ <S extends Schema.Top>(contract: S, render: (value: S["Encoded"], encode: UrlEncoding.Service["path"]) => string): <I, E, R>(self: Request<I, E, R>) => Request<I & {
581
+ readonly path: Input<S>;
582
+ }, E | Schema.SchemaError | InvalidRequest, R | S["EncodingServices"] | S["DecodingServices"]>;
583
+ };
584
+ /**
585
+ * Replace the constructor's path, leaving every {@link path} binding in place.
586
+ *
587
+ * @example
588
+ * ```ts
589
+ * import { Request } from "viell-effect-schema-http";
590
+ * const id = Request.pathValue("id");
591
+ * const current = Request.get("/things").pipe(Request.path`/${id}`);
592
+ * const legacy = current.pipe(Request.setPath("/legacy/things"));
593
+ * // Input: { path: { id: "a" } }; URL: /legacy/things/a
594
+ * ```
595
+ *
596
+ * @remarks
597
+ * Only the path changes. A constructor's query and fragment stay, and a `?` or `#` in this text is
598
+ * URL text, as it is in {@link path}. To replace a whole path, use {@link unbind} and this together.
599
+ */
600
+ export declare const setPath: (url: string) => Edit;
601
+ /**
602
+ * Bind an encoder to the call's `{ body }` input.
603
+ *
604
+ * @remarks
605
+ * The body is encoded once per operation evaluation. Its encoder supplies `Content-Type` and
606
+ * `Content-Length`; multipart metadata is supplied by the transport. A value the request declares
607
+ * for either field wins, before or after this binding, and {@link removeHeader} stops the automatic
608
+ * value. Neither changes the encoded bytes.
609
+ *
610
+ * Any method can carry a body, and the library adds no check of its own. A client can refuse the
611
+ * request: `fetch` does so for GET and HEAD, which surfaces as a transport failure.
612
+ */
613
+ export declare const body: <A, E2, R2>(codec: Body.Encoder<A, E2, R2>) => <I, E, R>(self: Request<I, E, R>) => Request<I & {
107
614
  readonly body: A;
108
- }, E | E2, R | R2, H, Q>;
109
- /** Adapt the invocation argument without weakening its contract, including application-selected defaults. */
110
- export declare const mapInput: <I, I2>(f: (input: I2) => I) => <E, R, H extends boolean, Q extends boolean>(self: Request<I, E, R, H, Q>) => Request<I2, E, R, H, Q>;
615
+ }, E | E2, R | R2>;
616
+ /**
617
+ * A request's input once {@link unbind} has cleared a group: the same, without that property.
618
+ *
619
+ * @remarks
620
+ * An input left with no properties becomes `unknown`, so `undefined` satisfies it.
621
+ */
622
+ export type Unbound<I, K extends Group> = K extends keyof I ? [keyof Omit<I, K>] extends [never] ? unknown : Omit<I, K> : I;
623
+ /**
624
+ * Remove a group's earlier bindings, their input and the shape they state.
625
+ *
626
+ * @example
627
+ * ```ts
628
+ * import { Schema } from "effect";
629
+ * import { Request } from "viell-effect-schema-http";
630
+ * const paged = Request.get("https://api.example.test/things").pipe(
631
+ * Request.query(Schema.Struct({ page: Schema.FiniteFromString })),
632
+ * );
633
+ * const sorted = paged.pipe(
634
+ * Request.unbind("query"),
635
+ * Request.query(Schema.Struct({ sort: Schema.String })),
636
+ * );
637
+ * // Input: { query: { sort: "name" } }; URL query: ?sort=name
638
+ * ```
639
+ *
640
+ * @remarks
641
+ * Takes `"path"`, `"query"`, `"headers"` or `"body"`, and affects only bindings before it. To
642
+ * replace a binding, unbind the group and bind again. Raw declarations stay, and go out unchecked
643
+ * once no schema states the group's shape. A constructor path and query are declarations, so they
644
+ * stay too. For `"path"`, the text of earlier {@link path} calls goes with their values, and
645
+ * {@link setPath} is what changes the constructor's path.
646
+ *
647
+ * Other steps stay as well. A {@link mapEffect} that reads the removed input receives `undefined`
648
+ * for it. After {@link mapInput}, the binding is skipped, but the mapped input keeps whatever the
649
+ * mapping requires. The request's error and service types keep what the removed bindings added.
650
+ */
651
+ export declare const unbind: <K extends Group>(group: K) => <I, E, R>(self: Request<I, E, R>) => Request<Unbound<I, K>, E, R>;
652
+ /**
653
+ * Adapt your application's argument to this request's required input.
654
+ *
655
+ * @remarks
656
+ * Use it to rename fields or supply defaults while preserving schema validation. The mapping
657
+ * runs during preparation; a thrown exception is a defect. It returns the request's whole input,
658
+ * which {@link InputOf} names.
659
+ */
660
+ export declare const mapInput: <I, I2>(f: (input: I2) => I) => <E, R>(self: Request<I, E, R>) => Request<I2, E, R>;
111
661
  /**
112
- * Effectful preparation of the native request. Runs once per evaluation, before any attempt, before the
113
- * base URL is joined and separate query parameters are rendered. It sees the preparation steps before it.
114
- * For signing a materialized URL, use client middleware through `Operation.make`'s `transformClient` option;
115
- * it runs per attempt. The provider's own URL normalization still applies.
662
+ * Edit the native request with an Effect during preparation.
116
663
  *
117
- * The transform applies to any request whose input includes what `f` reads. One that ignores its input can be
118
- * created once and reused on every request; an inline transform in `pipe` has `input` inferred from the request.
664
+ * @remarks
665
+ * Runs once per evaluation, before attempts, after preceding preparation steps. The base URL
666
+ * and separate query parameters are not yet rendered. Use `Operation.make`'s `transformClient`
667
+ * for per-attempt credentials or signing the materialized URL. Provider normalization still
668
+ * applies afterwards.
669
+ *
670
+ * A transform can be reused on requests whose input contains what its function reads. Inline
671
+ * callbacks in `pipe` infer their input from the request. This is the deliberate way around a
672
+ * group's schemas: what it edits on the native request is outside their check.
673
+ */
674
+ export declare const mapEffect: <I, E2, R2>(f: (request: HttpClientRequest.HttpClientRequest, input: I) => Effect.Effect<HttpClientRequest.HttpClientRequest, E2, R2>) => <E, R, I2 extends I = I>(self: Request<I, E, R> | Request<I2, E, R>) => Request<I2, E | E2, R | R2>;
675
+ /**
676
+ * A prepared native request and the header lines a supporting provider can send.
677
+ *
678
+ * @remarks
679
+ * `request.url` holds the joined URL and its query. A fragment is in `request.hash`, as written.
119
680
  */
120
- export declare const mapEffect: <I, E2, R2>(f: (request: HttpClientRequest.HttpClientRequest, input: I) => Effect.Effect<HttpClientRequest.HttpClientRequest, E2, R2>) => <E, R, H extends boolean, Q extends boolean, I2 extends I = I>(self: Request<I, E, R, H, Q> | Request<I2, E, R, H, Q>) => Request<I2, E | E2, R | R2, H, Q>;
121
- /** A materialized request with the header lines a supporting provider can send. */
122
681
  export interface Compiled {
123
682
  readonly request: HttpClientRequest.HttpClientRequest;
124
683
  readonly headerLines: Transport.Lines;
684
+ /** Lowercase header names the request removed, so the library adds no automatic value. */
685
+ readonly removedHeaders: ReadonlySet<string>;
125
686
  }
126
687
  /**
127
- * Materialize the native request and its header lines without sending it. Computed fields are evaluated
128
- * and input is encoded once per evaluation of the returned Effect.
688
+ * Prepare a request and its header lines without sending it.
689
+ *
690
+ * @example
691
+ * ```ts
692
+ * import { Effect } from "effect";
693
+ * import { Request } from "viell-effect-schema-http";
694
+ * const result = await Effect.runPromise(
695
+ * Request.compile(Request.get("https://api.example.test/health"), undefined),
696
+ * );
697
+ * // result.request.url === "https://api.example.test/health"
698
+ * ```
699
+ *
700
+ * @remarks
701
+ * Each evaluation resolves computed fields, encodes input and resolves the base URL once, in that
702
+ * order. The returned Effect requires any services used by the input schemas, preparation or the
703
+ * base URL. A declared field that does not fit the schemas bound to its group fails here with
704
+ * {@link InvalidRequest}, whatever the input. Use {@link materialize} when only the native request
705
+ * is needed.
706
+ */
707
+ export declare const compile: <I, E, R>(self: Request<I, E, R>, input: I) => Effect.Effect<Compiled, InvalidRequest | E, R>;
708
+ /**
709
+ * Prepare only the native request, without sending it.
710
+ *
711
+ * @remarks
712
+ * Use {@link compile} to retain the original header-line representation as well.
129
713
  */
130
- export declare const compile: <I, E, R, H extends boolean, Q extends boolean>(self: Request<I, E, R, H, Q>, input: I) => Effect.Effect<Compiled, InvalidRequest | E, R>;
131
- /** Materialize only the native request. Use {@link compile} when a provider sends header lines. */
132
- export declare const materialize: <I, E, R, H extends boolean, Q extends boolean>(self: Request<I, E, R, H, Q>, input: I) => Effect.Effect<HttpClientRequest.HttpClientRequest, E | InvalidRequest, R>;
714
+ export declare const materialize: <I, E, R>(self: Request<I, E, R>, input: I) => Effect.Effect<HttpClientRequest.HttpClientRequest, E | InvalidRequest, R>;
133
715
  export {};
134
716
  //# sourceMappingURL=Request.d.ts.map